decidim-bulletin_board 0.14.0 → 0.17.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0a78cd80754f33c7959ce2f9b3b3df2b9c7fa2c16906695d778c15a359f53223
4
- data.tar.gz: 410e9cbabefcd60c5f0ed182482bc25856e439afe7279f983c6c812960dff04e
3
+ metadata.gz: bc363471aea52b3ad74405e87e9410937432954146e13a929c94b8fadcad3629
4
+ data.tar.gz: 70baf206b39fa702eab21665c99b4ee9c45b897862317bc46aa8622c5c643933
5
5
  SHA512:
6
- metadata.gz: 93c37c58f6d65bba5db313c5310338d625267f71517e7ad8ae65fbd44106721810b048a20957ea1d39815b24ddfce94ad1b428a2576b37595f43f7d2679f3eda
7
- data.tar.gz: 4b9716e1e831ed60664947da4930b307107a5c88e9a2fff8af7d519cdf8f426a2e324a1c1534fe2cd495d39aba04b38ec014f4e0ff140b5ef8ea3b53eeeaa0d0
6
+ metadata.gz: 326b1a82ecf89514a0e96f646b30ee74ba9d1daa00b4eb8e03b0ec75de64c71bcfd3a850f52660c7636a372e16bbb1ea288cc06ee7b706947846b8747a3abc52
7
+ data.tar.gz: '07967b7cd63e30bdb0727bd4b325975d25dfd7a5538cee9c28239a8b03c1ffa50ac4e51297b9e940be58c3e32f15b195706c18ab721918392e57c6ad868ed0f7'
data/.gitignore CHANGED
@@ -1,4 +1,4 @@
1
- /.bundle/
1
+ /.bundle
2
2
  /.yardoc
3
3
  /_yardoc/
4
4
  /coverage/
@@ -17,5 +17,5 @@
17
17
  # byebug history
18
18
  .byebug_history
19
19
 
20
- # compiled dev JS client
21
- /app/assets/javascripts/decidim/bulletin_board/decidim-bulletin_board.dev.js
20
+ # artifacts
21
+ /app/assets/javascripts/decidim/bulletin_board/decidim-bulletin_board.js
data/Gemfile CHANGED
@@ -6,5 +6,5 @@ source "https://rubygems.org"
6
6
  gemspec
7
7
 
8
8
  gem "rubocop", "~> 0.92.0"
9
- gem "rubocop-faker"
10
- gem "rubocop-rspec", "~> 1.21"
9
+ gem "rubocop-faker", "~> 1.1.0"
10
+ gem "rubocop-rspec", "~> 1.44.1"
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- decidim-bulletin_board (0.14.0)
4
+ decidim-bulletin_board (0.17.0)
5
5
  byebug (~> 11.0)
6
6
  graphlient (~> 0.4.0)
7
7
  jwt (~> 2.2.2)
@@ -11,60 +11,60 @@ PATH
11
11
  GEM
12
12
  remote: https://rubygems.org/
13
13
  specs:
14
- actioncable (6.1.3)
15
- actionpack (= 6.1.3)
16
- activesupport (= 6.1.3)
14
+ actioncable (6.1.3.1)
15
+ actionpack (= 6.1.3.1)
16
+ activesupport (= 6.1.3.1)
17
17
  nio4r (~> 2.0)
18
18
  websocket-driver (>= 0.6.1)
19
- actionmailbox (6.1.3)
20
- actionpack (= 6.1.3)
21
- activejob (= 6.1.3)
22
- activerecord (= 6.1.3)
23
- activestorage (= 6.1.3)
24
- activesupport (= 6.1.3)
19
+ actionmailbox (6.1.3.1)
20
+ actionpack (= 6.1.3.1)
21
+ activejob (= 6.1.3.1)
22
+ activerecord (= 6.1.3.1)
23
+ activestorage (= 6.1.3.1)
24
+ activesupport (= 6.1.3.1)
25
25
  mail (>= 2.7.1)
26
- actionmailer (6.1.3)
27
- actionpack (= 6.1.3)
28
- actionview (= 6.1.3)
29
- activejob (= 6.1.3)
30
- activesupport (= 6.1.3)
26
+ actionmailer (6.1.3.1)
27
+ actionpack (= 6.1.3.1)
28
+ actionview (= 6.1.3.1)
29
+ activejob (= 6.1.3.1)
30
+ activesupport (= 6.1.3.1)
31
31
  mail (~> 2.5, >= 2.5.4)
32
32
  rails-dom-testing (~> 2.0)
33
- actionpack (6.1.3)
34
- actionview (= 6.1.3)
35
- activesupport (= 6.1.3)
33
+ actionpack (6.1.3.1)
34
+ actionview (= 6.1.3.1)
35
+ activesupport (= 6.1.3.1)
36
36
  rack (~> 2.0, >= 2.0.9)
37
37
  rack-test (>= 0.6.3)
38
38
  rails-dom-testing (~> 2.0)
39
39
  rails-html-sanitizer (~> 1.0, >= 1.2.0)
40
- actiontext (6.1.3)
41
- actionpack (= 6.1.3)
42
- activerecord (= 6.1.3)
43
- activestorage (= 6.1.3)
44
- activesupport (= 6.1.3)
40
+ actiontext (6.1.3.1)
41
+ actionpack (= 6.1.3.1)
42
+ activerecord (= 6.1.3.1)
43
+ activestorage (= 6.1.3.1)
44
+ activesupport (= 6.1.3.1)
45
45
  nokogiri (>= 1.8.5)
46
- actionview (6.1.3)
47
- activesupport (= 6.1.3)
46
+ actionview (6.1.3.1)
47
+ activesupport (= 6.1.3.1)
48
48
  builder (~> 3.1)
49
49
  erubi (~> 1.4)
50
50
  rails-dom-testing (~> 2.0)
51
51
  rails-html-sanitizer (~> 1.1, >= 1.2.0)
52
- activejob (6.1.3)
53
- activesupport (= 6.1.3)
52
+ activejob (6.1.3.1)
53
+ activesupport (= 6.1.3.1)
54
54
  globalid (>= 0.3.6)
55
- activemodel (6.1.3)
56
- activesupport (= 6.1.3)
57
- activerecord (6.1.3)
58
- activemodel (= 6.1.3)
59
- activesupport (= 6.1.3)
60
- activestorage (6.1.3)
61
- actionpack (= 6.1.3)
62
- activejob (= 6.1.3)
63
- activerecord (= 6.1.3)
64
- activesupport (= 6.1.3)
65
- marcel (~> 0.3.1)
66
- mimemagic (~> 0.3.2)
67
- activesupport (6.1.3)
55
+ activemodel (6.1.3.1)
56
+ activesupport (= 6.1.3.1)
57
+ activerecord (6.1.3.1)
58
+ activemodel (= 6.1.3.1)
59
+ activesupport (= 6.1.3.1)
60
+ activestorage (6.1.3.1)
61
+ actionpack (= 6.1.3.1)
62
+ activejob (= 6.1.3.1)
63
+ activerecord (= 6.1.3.1)
64
+ activesupport (= 6.1.3.1)
65
+ marcel (~> 1.0.0)
66
+ mini_mime (~> 1.0.2)
67
+ activesupport (6.1.3.1)
68
68
  concurrent-ruby (~> 1.0, >= 1.0.2)
69
69
  i18n (>= 1.6, < 2)
70
70
  minitest (>= 5.1)
@@ -75,7 +75,7 @@ GEM
75
75
  ast (2.4.1)
76
76
  builder (3.2.4)
77
77
  byebug (11.1.3)
78
- concurrent-ruby (1.1.7)
78
+ concurrent-ruby (1.1.8)
79
79
  crack (0.4.5)
80
80
  rexml
81
81
  crass (1.0.6)
@@ -96,29 +96,27 @@ GEM
96
96
  faraday (>= 1.0)
97
97
  faraday_middleware
98
98
  graphql-client
99
- graphql (1.12.5)
99
+ graphql (1.12.8)
100
100
  graphql-client (0.16.0)
101
101
  activesupport (>= 3.0)
102
102
  graphql (~> 1.8)
103
103
  hashdiff (1.0.1)
104
- i18n (1.8.5)
104
+ i18n (1.8.10)
105
105
  concurrent-ruby (~> 1.0)
106
106
  jwt (2.2.2)
107
- loofah (2.9.0)
107
+ loofah (2.9.1)
108
108
  crass (~> 1.0.2)
109
109
  nokogiri (>= 1.5.9)
110
110
  mail (2.7.1)
111
111
  mini_mime (>= 0.1.1)
112
- marcel (0.3.3)
113
- mimemagic (~> 0.3.2)
112
+ marcel (1.0.1)
114
113
  method_source (1.0.0)
115
- mimemagic (0.3.5)
116
- mini_mime (1.0.2)
114
+ mini_mime (1.0.3)
117
115
  mini_portile2 (2.5.0)
118
116
  minitest (5.14.4)
119
117
  multipart-post (2.1.1)
120
- nio4r (2.5.5)
121
- nokogiri (1.11.1)
118
+ nio4r (2.5.7)
119
+ nokogiri (1.11.3)
122
120
  mini_portile2 (~> 2.5.0)
123
121
  racc (~> 1.4)
124
122
  parallel (1.20.1)
@@ -129,34 +127,34 @@ GEM
129
127
  rack (2.2.3)
130
128
  rack-test (1.1.0)
131
129
  rack (>= 1.0, < 3)
132
- rails (6.1.3)
133
- actioncable (= 6.1.3)
134
- actionmailbox (= 6.1.3)
135
- actionmailer (= 6.1.3)
136
- actionpack (= 6.1.3)
137
- actiontext (= 6.1.3)
138
- actionview (= 6.1.3)
139
- activejob (= 6.1.3)
140
- activemodel (= 6.1.3)
141
- activerecord (= 6.1.3)
142
- activestorage (= 6.1.3)
143
- activesupport (= 6.1.3)
130
+ rails (6.1.3.1)
131
+ actioncable (= 6.1.3.1)
132
+ actionmailbox (= 6.1.3.1)
133
+ actionmailer (= 6.1.3.1)
134
+ actionpack (= 6.1.3.1)
135
+ actiontext (= 6.1.3.1)
136
+ actionview (= 6.1.3.1)
137
+ activejob (= 6.1.3.1)
138
+ activemodel (= 6.1.3.1)
139
+ activerecord (= 6.1.3.1)
140
+ activestorage (= 6.1.3.1)
141
+ activesupport (= 6.1.3.1)
144
142
  bundler (>= 1.15.0)
145
- railties (= 6.1.3)
143
+ railties (= 6.1.3.1)
146
144
  sprockets-rails (>= 2.0.0)
147
145
  rails-dom-testing (2.0.3)
148
146
  activesupport (>= 4.2.0)
149
147
  nokogiri (>= 1.6)
150
148
  rails-html-sanitizer (1.3.0)
151
149
  loofah (~> 2.3)
152
- railties (6.1.3)
153
- actionpack (= 6.1.3)
154
- activesupport (= 6.1.3)
150
+ railties (6.1.3.1)
151
+ actionpack (= 6.1.3.1)
152
+ activesupport (= 6.1.3.1)
155
153
  method_source
156
154
  rake (>= 0.8.7)
157
155
  thor (~> 1.0)
158
156
  rainbow (3.0.0)
159
- rake (13.0.1)
157
+ rake (13.0.3)
160
158
  regexp_parser (2.0.0)
161
159
  rexml (3.2.4)
162
160
  rspec (3.9.0)
@@ -223,8 +221,8 @@ DEPENDENCIES
223
221
  rake (~> 13.0)
224
222
  rspec (~> 3.7)
225
223
  rubocop (~> 0.92.0)
226
- rubocop-faker
227
- rubocop-rspec (~> 1.21)
224
+ rubocop-faker (~> 1.1.0)
225
+ rubocop-rspec (~> 1.44.1)
228
226
  webmock (~> 3.6)
229
227
  wisper-rspec (~> 1.1.0)
230
228
 
@@ -1,4 +1,4 @@
1
- window.decidimBulletinBoard=function(){var e={735:function(e,t,r){"use strict";r.r(t),r.d(t,{Client:function(){return y},Election:function(){return b},IdentificationKeys:function(){return ee},KeyCeremonyComponent:function(){return te},MESSAGE_PROCESSED:function(){return Q},MESSAGE_RECEIVED:function(){return G},MessageIdentifier:function(){return m},TallyComponent:function(){return re},Trustee:function(){return X},VoteComponent:function(){return ne},Voter:function(){return $}});var n=r(1439),i=r(9312),a=r.n(i),o=r(9953),s=r.n(o),u=r(3718),c=r.n(u),l=r(6890),f=r.n(l),h=r(5313),p=r.n(h);class d{constructor({apiEndpointUrl:e,headers:t}){const r=new n.HttpLink({uri:e,headers:t});this.apolloClient=new n.fe({link:r,cache:new n.h4})}async getLogEntry({electionUniqueId:e,contentHash:t}){return(await this.apolloClient.query({query:f(),variables:{electionUniqueId:e,contentHash:t}})).data.logEntry}async getElectionLogEntries({electionUniqueId:e,after:t,types:r}){return(await this.apolloClient.query({query:a(),variables:{electionUniqueId:e,after:t,types:r},fetchPolicy:"no-cache"})).data.election.logEntries}async processKeyCeremonyStep({messageId:e,signedData:t}){const r=await this.apolloClient.mutate({mutation:s(),variables:{messageId:e,signedData:t}});if(r.data.processKeyCeremonyStep.error)throw new Error(r.data.processKeyCeremonyStep.error);return r.data.processKeyCeremonyStep.pendingMessage}async getPendingMessageByMessageId({messageId:e}){return(await this.apolloClient.query({query:p(),variables:{messageId:e}})).data.pendingMessage}async processTallyStep({messageId:e,signedData:t}){const r=await this.apolloClient.mutate({mutation:c(),variables:{messageId:e,signedData:t}});if(r.data.processTallyStep.error)throw new Error(r.data.processTallyStep.error);return r.data.processTallyStep.pendingMessage}}class y{constructor(e){this.apiClient=new d(e)}getLogEntry({electionUniqueId:e,contentHash:t}){return this.apiClient.getLogEntry({electionUniqueId:e,contentHash:t})}getElectionLogEntries(e){return this.apiClient.getElectionLogEntries(e)}processKeyCeremonyStep(e){return this.apiClient.processKeyCeremonyStep(e)}processTallyStep(e){return this.apiClient.processTallyStep(e)}waitForPendingMessageToBeProcessed(e,t=1e3){return new Promise((r=>{const n=setInterval((()=>{this.apiClient.getPendingMessageByMessageId({messageId:e}).then((e=>{"enqueued"!==e.status&&(clearInterval(n),r(e))}))}),t)}))}}const v="t",g=["a","b","v",v];class m{static parse(e){const[t,r]=e.split("+"),[n,i,a,o]=t.split(".",4),[s,u]=r.split(".",2),c=o?`.${o}`:"";if(!g.includes(s))throw new Error("Invalid message identifier format");return{electionId:`${n}.${i}`,type:a,subtype:o,typeSubtype:`${a}${c}`,author:{type:s,id:u}}}static format(e,t,r,n){return`${e}.${t}+${r}.${n}`}}class b{constructor({uniqueId:e,bulletinBoardClient:t,typesFilter:r,options:n}){this.uniqueId=e,this.bulletinBoardClient=t,this.logEntries=[],this.typesFilter=r,this.subscriptionId=null,this.options=n||{waitUntilNextCheck:2e3}}async subscribeToLogEntriesChanges(){this.unsubscribeToLogEntriesChanges(),await this.getLogEntries(),this.subscriptionId=setInterval((()=>{this.getLogEntries()}),this.options.waitUntilNextCheck)}unsubscribeToLogEntriesChanges(){null!==this.subscriptionId&&(clearInterval(this.subscriptionId),this.subscriptionId=null)}getLastMessageFromTrustee(e){for(let t=this.logEntries.length-1;t>=0;t--){const r=this.logEntries[t],n=m.parse(r.messageId);if(n.author.type===v&&n.author.id===e)return r}return null}getLogEntries(){const e=this.logEntries[this.logEntries.length-1],t=e&&e.id||null;return new Promise((e=>{this.bulletinBoardClient.getElectionLogEntries({electionUniqueId:this.uniqueId,after:t,types:this.typesFilter}).then((t=>{t.length&&(this.logEntries=[...this.logEntries,...t]),e()}))}))}}var E=r(655);function S(e){return"function"==typeof e}var C=!1,w={Promise:void 0,set useDeprecatedSynchronousErrorHandling(e){e&&(new Error).stack;C=e},get useDeprecatedSynchronousErrorHandling(){return C}};function T(e){setTimeout((function(){throw e}),0)}var A={closed:!0,next:function(e){},error:function(e){if(w.useDeprecatedSynchronousErrorHandling)throw e;T(e)},complete:function(){}},I=function(){return Array.isArray||function(e){return e&&"number"==typeof e.length}}();var k=function(){function e(e){return Error.call(this),this.message=e?e.length+" errors occurred during unsubscription:\n"+e.map((function(e,t){return t+1+") "+e.toString()})).join("\n "):"",this.name="UnsubscriptionError",this.errors=e,this}return e.prototype=Object.create(Error.prototype),e}(),_=function(){function e(e){this.closed=!1,this._parentOrParents=null,this._subscriptions=null,e&&(this._ctorUnsubscribe=!0,this._unsubscribe=e)}return e.prototype.unsubscribe=function(){var t;if(!this.closed){var r,n=this,i=n._parentOrParents,a=n._ctorUnsubscribe,o=n._unsubscribe,s=n._subscriptions;if(this.closed=!0,this._parentOrParents=null,this._subscriptions=null,i instanceof e)i.remove(this);else if(null!==i)for(var u=0;u<i.length;++u){i[u].remove(this)}if(S(o)){a&&(this._unsubscribe=void 0);try{o.call(this)}catch(e){t=e instanceof k?B(e.errors):[e]}}if(I(s)){u=-1;for(var c=s.length;++u<c;){var l=s[u];if(null!==(r=l)&&"object"==typeof r)try{l.unsubscribe()}catch(e){t=t||[],e instanceof k?t=t.concat(B(e.errors)):t.push(e)}}}if(t)throw new k(t)}},e.prototype.add=function(t){var r=t;if(!t)return e.EMPTY;switch(typeof t){case"function":r=new e(t);case"object":if(r===this||r.closed||"function"!=typeof r.unsubscribe)return r;if(this.closed)return r.unsubscribe(),r;if(!(r instanceof e)){var n=r;(r=new e)._subscriptions=[n]}break;default:throw new Error("unrecognized teardown "+t+" added to Subscription.")}var i=r._parentOrParents;if(null===i)r._parentOrParents=this;else if(i instanceof e){if(i===this)return r;r._parentOrParents=[i,this]}else{if(-1!==i.indexOf(this))return r;i.push(this)}var a=this._subscriptions;return null===a?this._subscriptions=[r]:a.push(r),r},e.prototype.remove=function(e){var t=this._subscriptions;if(t){var r=t.indexOf(e);-1!==r&&t.splice(r,1)}},e.EMPTY=function(e){return e.closed=!0,e}(new e),e}();function B(e){return e.reduce((function(e,t){return e.concat(t instanceof k?t.errors:t)}),[])}var N=function(){return"function"==typeof Symbol?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random()}(),O=function(e){function t(r,n,i){var a=e.call(this)||this;switch(a.syncErrorValue=null,a.syncErrorThrown=!1,a.syncErrorThrowable=!1,a.isStopped=!1,arguments.length){case 0:a.destination=A;break;case 1:if(!r){a.destination=A;break}if("object"==typeof r){r instanceof t?(a.syncErrorThrowable=r.syncErrorThrowable,a.destination=r,r.add(a)):(a.syncErrorThrowable=!0,a.destination=new R(a,r));break}default:a.syncErrorThrowable=!0,a.destination=new R(a,r,n,i)}return a}return E.ZT(t,e),t.prototype[N]=function(){return this},t.create=function(e,r,n){var i=new t(e,r,n);return i.syncErrorThrowable=!1,i},t.prototype.next=function(e){this.isStopped||this._next(e)},t.prototype.error=function(e){this.isStopped||(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this))},t.prototype._next=function(e){this.destination.next(e)},t.prototype._error=function(e){this.destination.error(e),this.unsubscribe()},t.prototype._complete=function(){this.destination.complete(),this.unsubscribe()},t.prototype._unsubscribeAndRecycle=function(){var e=this._parentOrParents;return this._parentOrParents=null,this.unsubscribe(),this.closed=!1,this.isStopped=!1,this._parentOrParents=e,this},t}(_),R=function(e){function t(t,r,n,i){var a,o=e.call(this)||this;o._parentSubscriber=t;var s=o;return S(r)?a=r:r&&(a=r.next,n=r.error,i=r.complete,r!==A&&(S((s=Object.create(r)).unsubscribe)&&o.add(s.unsubscribe.bind(s)),s.unsubscribe=o.unsubscribe.bind(o))),o._context=s,o._next=a,o._error=n,o._complete=i,o}return E.ZT(t,e),t.prototype.next=function(e){if(!this.isStopped&&this._next){var t=this._parentSubscriber;w.useDeprecatedSynchronousErrorHandling&&t.syncErrorThrowable?this.__tryOrSetError(t,this._next,e)&&this.unsubscribe():this.__tryOrUnsub(this._next,e)}},t.prototype.error=function(e){if(!this.isStopped){var t=this._parentSubscriber,r=w.useDeprecatedSynchronousErrorHandling;if(this._error)r&&t.syncErrorThrowable?(this.__tryOrSetError(t,this._error,e),this.unsubscribe()):(this.__tryOrUnsub(this._error,e),this.unsubscribe());else if(t.syncErrorThrowable)r?(t.syncErrorValue=e,t.syncErrorThrown=!0):T(e),this.unsubscribe();else{if(this.unsubscribe(),r)throw e;T(e)}}},t.prototype.complete=function(){var e=this;if(!this.isStopped){var t=this._parentSubscriber;if(this._complete){var r=function(){return e._complete.call(e._context)};w.useDeprecatedSynchronousErrorHandling&&t.syncErrorThrowable?(this.__tryOrSetError(t,r),this.unsubscribe()):(this.__tryOrUnsub(r),this.unsubscribe())}else this.unsubscribe()}},t.prototype.__tryOrUnsub=function(e,t){try{e.call(this._context,t)}catch(e){if(this.unsubscribe(),w.useDeprecatedSynchronousErrorHandling)throw e;T(e)}},t.prototype.__tryOrSetError=function(e,t,r){if(!w.useDeprecatedSynchronousErrorHandling)throw new Error("bad call");try{t.call(this._context,r)}catch(t){return w.useDeprecatedSynchronousErrorHandling?(e.syncErrorValue=t,e.syncErrorThrown=!0,!0):(T(t),!0)}return!1},t.prototype._unsubscribe=function(){var e=this._parentSubscriber;this._context=null,this._parentSubscriber=null,e.unsubscribe()},t}(O);var x=function(){return"function"==typeof Symbol&&Symbol.observable||"@@observable"}();function P(e){return e}function F(e){return 0===e.length?P:1===e.length?e[0]:function(t){return e.reduce((function(e,t){return t(e)}),t)}}var D=function(){function e(e){this._isScalar=!1,e&&(this._subscribe=e)}return e.prototype.lift=function(t){var r=new e;return r.source=this,r.operator=t,r},e.prototype.subscribe=function(e,t,r){var n=this.operator,i=function(e,t,r){if(e){if(e instanceof O)return e;if(e[N])return e[N]()}return e||t||r?new O(e,t,r):new O(A)}(e,t,r);if(n?i.add(n.call(i,this.source)):i.add(this.source||w.useDeprecatedSynchronousErrorHandling&&!i.syncErrorThrowable?this._subscribe(i):this._trySubscribe(i)),w.useDeprecatedSynchronousErrorHandling&&i.syncErrorThrowable&&(i.syncErrorThrowable=!1,i.syncErrorThrown))throw i.syncErrorValue;return i},e.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){w.useDeprecatedSynchronousErrorHandling&&(e.syncErrorThrown=!0,e.syncErrorValue=t),!function(e){for(;e;){var t=e,r=t.closed,n=t.destination,i=t.isStopped;if(r||i)return!1;e=n&&n instanceof O?n:null}return!0}(e)?console.warn(t):e.error(t)}},e.prototype.forEach=function(e,t){var r=this;return new(t=L(t))((function(t,n){var i;i=r.subscribe((function(t){try{e(t)}catch(e){n(e),i&&i.unsubscribe()}}),n,t)}))},e.prototype._subscribe=function(e){var t=this.source;return t&&t.subscribe(e)},e.prototype[x]=function(){return this},e.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return 0===e.length?this:F(e)(this)},e.prototype.toPromise=function(e){var t=this;return new(e=L(e))((function(e,r){var n;t.subscribe((function(e){return n=e}),(function(e){return r(e)}),(function(){return e(n)}))}))},e.create=function(t){return new e(t)},e}();function L(e){if(e||(e=w.Promise||Promise),!e)throw new Error("no Promise impl found");return e}var U=function(){function e(){return Error.call(this),this.message="object unsubscribed",this.name="ObjectUnsubscribedError",this}return e.prototype=Object.create(Error.prototype),e}(),j=function(e){function t(t,r){var n=e.call(this)||this;return n.subject=t,n.subscriber=r,n.closed=!1,n}return E.ZT(t,e),t.prototype.unsubscribe=function(){if(!this.closed){this.closed=!0;var e=this.subject,t=e.observers;if(this.subject=null,t&&0!==t.length&&!e.isStopped&&!e.closed){var r=t.indexOf(this.subscriber);-1!==r&&t.splice(r,1)}}},t}(_),V=function(e){function t(t){var r=e.call(this,t)||this;return r.destination=t,r}return E.ZT(t,e),t}(O),K=function(e){function t(){var t=e.call(this)||this;return t.observers=[],t.closed=!1,t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return E.ZT(t,e),t.prototype[N]=function(){return new V(this)},t.prototype.lift=function(e){var t=new M(this,this);return t.operator=e,t},t.prototype.next=function(e){if(this.closed)throw new U;if(!this.isStopped)for(var t=this.observers,r=t.length,n=t.slice(),i=0;i<r;i++)n[i].next(e)},t.prototype.error=function(e){if(this.closed)throw new U;this.hasError=!0,this.thrownError=e,this.isStopped=!0;for(var t=this.observers,r=t.length,n=t.slice(),i=0;i<r;i++)n[i].error(e);this.observers.length=0},t.prototype.complete=function(){if(this.closed)throw new U;this.isStopped=!0;for(var e=this.observers,t=e.length,r=e.slice(),n=0;n<t;n++)r[n].complete();this.observers.length=0},t.prototype.unsubscribe=function(){this.isStopped=!0,this.closed=!0,this.observers=null},t.prototype._trySubscribe=function(t){if(this.closed)throw new U;return e.prototype._trySubscribe.call(this,t)},t.prototype._subscribe=function(e){if(this.closed)throw new U;return this.hasError?(e.error(this.thrownError),_.EMPTY):this.isStopped?(e.complete(),_.EMPTY):(this.observers.push(e),new j(this,e))},t.prototype.asObservable=function(){var e=new D;return e.source=this,e},t.create=function(e,t){return new M(e,t)},t}(D),M=function(e){function t(t,r){var n=e.call(this)||this;return n.destination=t,n.source=r,n}return E.ZT(t,e),t.prototype.next=function(e){var t=this.destination;t&&t.next&&t.next(e)},t.prototype.error=function(e){var t=this.destination;t&&t.error&&this.destination.error(e)},t.prototype.complete=function(){var e=this.destination;e&&e.complete&&this.destination.complete()},t.prototype._subscribe=function(e){return this.source?this.source.subscribe(e):_.EMPTY},t}(K);function q(){}var z=function(){function e(e,t,r){this.nextOrObserver=e,this.error=t,this.complete=r}return e.prototype.call=function(e,t){return t.subscribe(new H(e,this.nextOrObserver,this.error,this.complete))},e}(),H=function(e){function t(t,r,n,i){var a=e.call(this,t)||this;return a._tapNext=q,a._tapError=q,a._tapComplete=q,a._tapError=n||q,a._tapComplete=i||q,S(r)?(a._context=a,a._tapNext=r):r&&(a._context=r,a._tapNext=r.next||q,a._tapError=r.error||q,a._tapComplete=r.complete||q),a}return E.ZT(t,e),t.prototype._next=function(e){try{this._tapNext.call(this._context,e)}catch(e){return void this.destination.error(e)}this.destination.next(e)},t.prototype._error=function(e){try{this._tapError.call(this._context,e)}catch(e){return void this.destination.error(e)}this.destination.error(e)},t.prototype._complete=function(){try{this._tapComplete.call(this._context)}catch(e){return void this.destination.error(e)}return this.destination.complete()},t}(O);const G="[Message] Received",Q="[Message] Processed";class W{constructor(){this.events=new K}subscribe(e){return this.events.pipe((t=e,function(e){return e.lift(new z(t,r,n))})).subscribe();var t,r,n}broadcastMessageReceived(e){this.events.next({type:G,message:e})}broadcastMessageProcessed(e,t){this.events.next({type:Q,message:e,result:t})}}var Y=r(1217);function Z(e,t){const r="string"==typeof e?JSON.parse(e):e,n="string"==typeof t?JSON.parse(t):t;if(r&&n){const{n:e,e:t,kty:i}=r,{n:a,e:o,kty:s}=n;return e===a&&t===o&&i===s}return!1}class J{constructor({authorityPublicKeyJSON:e}){this.authorityPublicKeyJSON=e,this.authorityPublicKey=Y.JWK.asKey(e,"json"),this.keys=null}async parse({messageId:e,signedData:t}){const r=m.parse(e),n=await(this.keys?this.keys[r.author.type][r.author.id]:this.authorityPublicKey);if(!t)return{messageIdentifier:r,decodedData:null};const i=await Y.JWS.createVerify(n).verify(t,{algorithms:["RS256"]}),a=JSON.parse(new TextDecoder("utf-8").decode(i.payload));return this.keys||(this.keys=await this.parseCreateElection(a)),{messageIdentifier:r,decodedData:a}}async parseCreateElection({authority:e,bulletin_board:t,trustees:r}){if(!Z(e.public_key,this.authorityPublicKeyJSON))throw new Error("The authority public key doesn't match the election's authority public key.");const n={a:{[e.name]:this.authorityPublicKey},b:{},[v]:{}},i=[];i.push(this.loadKey(t).then((e=>{n.b[t.name]=e})));for(const e of r)i.push(this.loadKey(e).then((t=>{n.t[e.name]=t})));return await Promise.all(i),n}loadKey(e){return Y.JWK.asKey(e.public_key,"json")}}class X{constructor({uniqueId:e,bulletinBoardClient:t,authorityPublicKeyJSON:r,identificationKeys:n,election:i,wrapperAdapter:a,options:o}){this.uniqueId=e,this.bulletinBoardClient=t,this.identificationKeys=n,this.election=i,this.options=o||{waitUntilNextCheck:100},this.wrapperAdapter=a,this.parser=new J({authorityPublicKeyJSON:r}),this.events=new W,this.nextLogEntryIndexToProcess=0,this.lastMessageProcessedWithResult=null,this.hasSetupKeyCeremony=!1}async setup(){return await this.wrapperAdapter.setup(),this.election.subscribeToLogEntriesChanges()}tearDown(){this.election.unsubscribeToLogEntriesChanges()}async*setupKeyCeremony(){let e;for(;!e;)e=await this.waitForNextLogEntryResult();return yield await this.wrapperAdapter.backup(),await this.processKeyCeremonyStep(e),this.hasSetupKeyCeremony=!0,this.hasSetupKeyCeremony}async runKeyCeremony(){if(!this.hasSetupKeyCeremony)throw new Error("The key ceremony has not been setup yet");if(await this.needsToBeRestored())throw new Error("You need to restore the wrapper state to continue");return this.waitForNextLogEntryResult().then((async e=>(await this.processKeyCeremonyStep(e),await this.wrapperAdapter.isKeyCeremonyDone()?this.tearDown():this.runKeyCeremony())))}async runTally(){if(await this.needsToBeRestored())throw new Error("You need to restore the wrapper state to continue");return this.waitForNextLogEntryResult().then((async e=>(await this.processTallyStep(e),await this.wrapperAdapter.isTallyDone()?this.tearDown():this.runTally())))}async needsToBeRestored(){return this.election.getLastMessageFromTrustee(this.uniqueId)&&await this.wrapperAdapter.isFresh()}async restore(e){const t=this.election.getLastMessageFromTrustee(this.uniqueId);return this.hasSetupKeyCeremony=t&&await this.wrapperAdapter.restore(e),this.hasSetupKeyCeremony}async waitForNextLogEntryResult(){return await new Promise((e=>{const t=setInterval((async()=>{const{logEntries:r}=this.election;r.length>this.nextLogEntryIndexToProcess&&(clearInterval(t),e())}),this.options.waitUntilNextCheck)})),this.processNextLogEntry()}async processNextLogEntry(){const{logEntries:e}=this.election,t=e[this.nextLogEntryIndexToProcess];this.events.broadcastMessageReceived(t);const{messageIdentifier:r,decodedData:n}=await this.parser.parse(t),i=await this.wrapperAdapter.processMessage(r.typeSubtype,n);if(this.events.broadcastMessageProcessed(t,i),this.nextLogEntryIndexToProcess+=1,i){const{messageType:e,content:t}=i;return{message_id:m.format(this.election.uniqueId,e,v,this.uniqueId),content:t}}return i}async processKeyCeremonyStep(e){if(e&&!this.isMessageAlreadyLogged(e)){const t=await this.signMessage(e);return this.bulletinBoardClient.processKeyCeremonyStep({messageId:e.message_id,signedData:t})}}async processTallyStep(e){if(e&&!this.isMessageAlreadyLogged(e)){const t=await this.signMessage(e);return this.bulletinBoardClient.processTallyStep({messageId:e.message_id,signedData:t})}}isMessageAlreadyLogged({message_id:e}){const{logEntries:t}=this.election;return t.find((t=>t.messageId===e))}signMessage(e){return this.identificationKeys.sign({iat:Math.floor(new Date/1e3),...e})}}class ${constructor({bulletinBoardClient:e,authorityPublicKeyJSON:t,election:r,uniqueId:n,wrapperAdapter:i}){this.uniqueId=n,this.election=r,this.bulletinBoardClient=e,this.wrapperAdapter=i,this.parser=new J({authorityPublicKeyJSON:t})}async setup(){return await this.wrapperAdapter.setup(),this.bulletinBoardClient.getElectionLogEntries({electionUniqueId:this.election.uniqueId,types:["create_election","end_key_ceremony"]}).then((async e=>{for(const t of e){const{messageIdentifier:e,decodedData:r}=await this.parser.parse(t);await this.wrapperAdapter.processMessage(e.typeSubtype,r)}}))}async encrypt(e){const{encryptedData:t,auditableData:r}=await this.wrapperAdapter.encrypt(e);return{encryptedData:t,encryptedDataHash:await this.hash(t),auditableData:r}}async hash(e){return window.crypto.subtle.digest("SHA-256",(new TextEncoder).encode(e)).then((e=>Array.from(new Uint8Array(e)).map((e=>e.toString(16).padStart(2,"0"))).join("")))}verifyVote(e){const{uniqueId:t}=this.election;return this.bulletinBoardClient.getLogEntry({electionUniqueId:t,contentHash:e})}}class ee{constructor(e,t){this.format="jwk",this.algorithm={name:"RSASSA-PKCS1-v1_5",modulusLength:4096,publicExponent:new Uint8Array([1,0,1]),hash:{name:"SHA-256"}},this.usages=["sign"],this.publicKeyAttrs=["alg","e","kty","n"],this.jwtHeader=this._encode64(JSON.stringify({alg:"RS256",typ:"JWT"})),this.trusteeUniqueId=e,this.privateKey=null,this.publicKey=null,this.storedPublicKey=JSON.parse(t||null),this.keyIdentifier=`${e}-private-key`,this.browserSupport=this._checkBrowserSupport(),this.textEncoder=new TextEncoder("utf-8"),this.dbName="identification_keys",this.dbVersion=1,this.presentPromise=this._read()}present(e){this.presentPromise.then((()=>{this._matchesStoredPublicKey(this.publicKey)?e(this.browserSupport&&null!==this.privateKey):this.reset().then(e(!1))}))}async generate(){return!(!this.browserSupport||this.storedPublicKey)&&new Promise(((e,t)=>{try{return this.crypto.subtle.generateKey(this.algorithm,!0,this.usages).then((t=>this.crypto.subtle.exportKey(this.format,t.privateKey).then((t=>{this.publicKey=this._publicKeyFromPrivateKey(t);const r=document.createElement("a");return r.setAttribute("href",`data:text/plain;charset=utf-8,${encodeURIComponent(JSON.stringify(t))}`),r.setAttribute("download",`${this.keyIdentifier}.jwk`),r.style.display="none",document.body.appendChild(r),r.click(),document.body.removeChild(r),e()})).catch(this._handleErrors)))}catch(e){return t(e)}}))}async upload(e){return!(!this.browserSupport||null!==this.privateKey)&&new Promise(((t,r)=>{if(e)this.onUploadInputChange(e,t,r);else{const e=document.createElement("input");e.setAttribute("type","file"),e.setAttribute("accept",".jwk"),e.style.display="none",document.body.appendChild(e),e.addEventListener("change",(n=>{document.body.removeChild(e),this.onUploadInputChange(n,t,r)})),e.click()}}))}onUploadInputChange(e,t,r){const n=new FileReader;n.readAsText(e.target.files[0]),n.onload=e=>{let n="";try{n=JSON.parse(e.target.result)}catch(e){return r("invalid_format")}return this.crypto.subtle.importKey(this.format,n,this.algorithm,!1,this.usages).then((e=>{const i=this._publicKeyFromPrivateKey(n);this._matchesStoredPublicKey(i)?(this.publicKey=i,this.privateKey=e,this._save().then((()=>t(!0))).catch((()=>{r("could not be saved")}))):r("invalid_public_key")})).catch((()=>{r("invalid_key")}))}}reset(){return this.privateKey=this.publicKey=null,this._clear()}async sign(e){if(!this.browserSupport||null===this.privateKey)return!1;const t=`${this.jwtHeader}.${this._encode64(JSON.stringify(e))}`,r=await this.crypto.subtle.sign(this.algorithm,this.privateKey,this.textEncoder.encode(t));return`${t}.${btoa(Reflect.apply(String.fromCharCode,null,new Uint8Array(r))).replace(/[=]/g,"").replace(/\+/g,"-").replace(/\//g,"_")}`}_checkBrowserSupport(){return this.indexedDB=window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB,this.crypto=window.crypto||window.msCrypto,window.indexedDB&&window.crypto}_handleErrors(e){throw e}_publicKeyFromPrivateKey(e){return Object.keys(e).filter((e=>this.publicKeyAttrs.includes(e))).reduce(((t,r)=>(t[r]=e[r],t)),{})}_matchesStoredPublicKey(e){return Z(e,this.storedPublicKey)}_encode64(e){return btoa(unescape(encodeURIComponent(e))).replace(/[=]/g,"").replace(/\+/g,"-").replace(/\//g,"_")}async _read(){return this._useDb("readonly",(e=>{e.get(this.keyIdentifier).onsuccess=e=>{e.target.result&&(this.privateKey=e.target.result.privateKey,this.publicKey=e.target.result.publicKey)}}))}async _save(){return this._useDb("readwrite",(e=>{e.add({privateKey:this.privateKey,publicKey:this.publicKey},this.keyIdentifier)}))}async _clear(){return this._useDb("readwrite",(e=>{e.delete(this.keyIdentifier)}))}async _useDb(e,t){return new Promise(((r,n)=>{let i=null;const a=this.indexedDB.open(this.dbName,this.dbVersion);a.onerror=e=>{i=null,n(e)},a.onupgradeneeded=()=>{i=a.result,i.createObjectStore("IdentificationKeys")},a.onsuccess=()=>{i=a.result;const n=i.transaction(["IdentificationKeys"],e);t(n.objectStore("IdentificationKeys")),n.oncomplete=()=>{i.close(),r()}}}))}}class te{constructor({bulletinBoardClientParams:e,authorityPublicKeyJSON:t,electionUniqueId:r,trusteeUniqueId:n,trusteeIdentificationKeys:i,trusteeWrapperAdapter:a}){const o=new y(e);this.election=new b({uniqueId:r,bulletinBoardClient:o,typesFilter:["create_election","start_key_ceremony","key_ceremony","end_key_ceremony"]}),this.trustee=new X({uniqueId:n,bulletinBoardClient:o,authorityPublicKeyJSON:t,identificationKeys:i,election:this.election,wrapperAdapter:a})}async bindEvents({onEvent:e,onBindRestoreButton:t,onBindStartButton:r,onRestore:n,onComplete:i,onStart:a,onTrusteeNeedsToBeRestored:o,onBackupNeeded:s,onBindBackupButton:u,onBackupStarted:c}){const l=this.trustee.setup();this.trustee.events.subscribe(e),r((async e=>{if(a(),e.preventDefault(),await l,await this.trustee.needsToBeRestored())o();else{const e=this.trustee.setupKeyCeremony(),{value:t}=await e.next();s(),u(t,`${this.trustee.uniqueId}-election-${this.election.uniqueId}.bak`,(async()=>{c(),await e.next(),await this.trustee.runKeyCeremony(),i()}))}})),t((async e=>{await l;const t=e.target.files[0],r=new FileReader;r.onload=async({target:e})=>{const t=e.result;await this.trustee.restore(t)&&(n(),await this.trustee.runKeyCeremony(),i())},r.readAsText(t)}))}}class re{constructor({bulletinBoardClientParams:e,authorityPublicKeyJSON:t,electionUniqueId:r,trusteeUniqueId:n,trusteeIdentificationKeys:i,trusteeWrapperAdapter:a}){const o=new y(e);this.election=new b({uniqueId:r,bulletinBoardClient:o,typesFilter:["create_election","start_key_ceremony","key_ceremony","end_key_ceremony","start_tally","tally","end_tally"]}),this.trustee=new X({uniqueId:n,bulletinBoardClient:o,authorityPublicKeyJSON:t,identificationKeys:i,election:this.election,wrapperAdapter:a})}async bindEvents({onEvent:e,onBindRestoreButton:t,onBindStartButton:r,onRestore:n,onComplete:i,onStart:a,onTrusteeNeedsToBeRestored:o}){const s=this.trustee.setup();this.trustee.events.subscribe(e),r((async e=>{a(),e.preventDefault(),await s,await this.trustee.needsToBeRestored()?o():(await this.trustee.runTally(),i())})),t((async e=>{await s;const t=e.target.files[0],r=new FileReader;r.onload=async({target:e})=>{const t=e.result;await this.trustee.restore(t)&&(n(),await this.trustee.runTally(),i())},r.readAsText(t)}))}}class ne{constructor({bulletinBoardClientParams:e,authorityPublicKeyJSON:t,electionUniqueId:r,voterUniqueId:n,voterWrapperAdapter:i}){this.bulletinBoardClient=new y(e);const a=new b({uniqueId:r,bulletinBoardClient:this.bulletinBoardClient});this.voter=new $({bulletinBoardClient:this.bulletinBoardClient,authorityPublicKeyJSON:t,election:a,uniqueId:n,wrapperAdapter:i})}async bindEvents({onBindEncryptButton:e,onStart:t,onVoteEncryption:r,castOrAuditBallot:n,onBindAuditBallotButton:i,onBindCastBallotButton:a,onAuditBallot:o,onCastBallot:s,onAuditComplete:u,onCastComplete:c,onInvalid:l}){const f=this.voter.setup();e((async()=>{t(),await f,r((e=>{this.voter.encrypt(e).then((e=>{n(e),i((()=>{o(e,`${this.voter.uniqueId}-election-${this.voter.election.uniqueId}.txt`),u()})),a((async()=>{try{await s(e),c()}catch{l()}}))}))}),(()=>{l()}))}))}}},2634:function(e,t,r){"use strict";r.d(t,{h4:function(){return Be},ab:function(){return ce}});var n=function(){return Object.create(null)},i=Array.prototype,a=i.forEach,o=i.slice,s=function(){function e(e,t){void 0===e&&(e=!0),void 0===t&&(t=n),this.weakness=e,this.makeData=t}return e.prototype.lookup=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return this.lookupArray(e)},e.prototype.lookupArray=function(e){var t=this;return a.call(e,(function(e){return t=t.getChildTrie(e)})),t.data||(t.data=this.makeData(o.call(e)))},e.prototype.getChildTrie=function(t){var r=this.weakness&&function(e){switch(typeof e){case"object":if(null===e)break;case"function":return!0}return!1}(t)?this.weak||(this.weak=new WeakMap):this.strong||(this.strong=new Map),n=r.get(t);return n||r.set(t,n=new e(this.weakness,this.makeData)),n},e}();var u=null,c={},l=1,f="@wry/context:Slot",h=Array,p=h[f]||function(){var e=function(){function e(){this.id=["slot",l++,Date.now(),Math.random().toString(36).slice(2)].join(":")}return e.prototype.hasValue=function(){for(var e=u;e;e=e.parent)if(this.id in e.slots){var t=e.slots[this.id];if(t===c)break;return e!==u&&(u.slots[this.id]=t),!0}return u&&(u.slots[this.id]=c),!1},e.prototype.getValue=function(){if(this.hasValue())return u.slots[this.id]},e.prototype.withValue=function(e,t,r,n){var i,a=((i={__proto__:null})[this.id]=e,i),o=u;u={parent:o,slots:a};try{return t.apply(n,r)}finally{u=o}},e.bind=function(e){var t=u;return function(){var r=u;try{return u=t,e.apply(this,arguments)}finally{u=r}}},e.noContext=function(e,t,r){if(!u)return e.apply(r,t);var n=u;try{return u=null,e.apply(r,t)}finally{u=n}},e}();try{Object.defineProperty(h,f,{value:h[f]=e,enumerable:!1,writable:!1,configurable:!1})}finally{return e}}();p.bind,p.noContext;function d(){}var y=function(){function e(e,t){void 0===e&&(e=1/0),void 0===t&&(t=d),this.max=e,this.dispose=t,this.map=new Map,this.newest=null,this.oldest=null}return e.prototype.has=function(e){return this.map.has(e)},e.prototype.get=function(e){var t=this.getEntry(e);return t&&t.value},e.prototype.getEntry=function(e){var t=this.map.get(e);if(t&&t!==this.newest){var r=t.older,n=t.newer;n&&(n.older=r),r&&(r.newer=n),t.older=this.newest,t.older.newer=t,t.newer=null,this.newest=t,t===this.oldest&&(this.oldest=n)}return t},e.prototype.set=function(e,t){var r=this.getEntry(e);return r?r.value=t:(r={key:e,value:t,newer:null,older:this.newest},this.newest&&(this.newest.newer=r),this.newest=r,this.oldest=this.oldest||r,this.map.set(e,r),r.value)},e.prototype.clean=function(){for(;this.oldest&&this.map.size>this.max;)this.delete(this.oldest.key)},e.prototype.delete=function(e){var t=this.map.get(e);return!!t&&(t===this.newest&&(this.newest=t.older),t===this.oldest&&(this.oldest=t.newer),t.newer&&(t.newer.older=t.older),t.older&&(t.older.newer=t.newer),this.map.delete(e),this.dispose(t.value,e),!0)},e}(),v=new p;function g(e){var t=e.unsubscribe;"function"==typeof t&&(e.unsubscribe=void 0,t())}var m=[];function b(e,t){if(!e)throw new Error(t||"assertion failure")}function E(e){switch(e.length){case 0:throw new Error("unknown value");case 1:return e[0];case 2:throw e[1]}}var S=function(){function e(t){this.fn=t,this.parents=new Set,this.childValues=new Map,this.dirtyChildren=null,this.dirty=!0,this.recomputing=!1,this.value=[],this.deps=null,++e.count}return e.prototype.peek=function(){if(1===this.value.length&&!w(this))return this.value[0]},e.prototype.recompute=function(e){return b(!this.recomputing,"already recomputing"),function(e){var t=v.getValue();if(t)e.parents.add(t),t.childValues.has(e)||t.childValues.set(e,[]),w(e)?I(t,e):k(t,e)}(this),w(this)?function(e,t){B(e),v.withValue(e,C,[e,t]),function(e,t){if("function"==typeof e.subscribe)try{g(e),e.unsubscribe=e.subscribe.apply(null,t)}catch(t){return e.setDirty(),!1}return!0}(e,t)&&function(e){if(e.dirty=!1,w(e))return;A(e)}(e);return E(e.value)}(this,e):E(this.value)},e.prototype.setDirty=function(){this.dirty||(this.dirty=!0,this.value.length=0,T(this),B(this),g(this))},e.prototype.dispose=function(){var e=this;B(this),g(this),this.parents.forEach((function(t){t.setDirty(),N(t,e)}))},e.prototype.dependOn=function(e){e.add(this),this.deps||(this.deps=m.pop()||new Set),this.deps.add(e)},e.prototype.forgetDeps=function(){var e=this;this.deps&&(this.deps.forEach((function(t){return t.delete(e)})),this.deps.clear(),m.push(this.deps),this.deps=null)},e.count=0,e}();function C(e,t){e.recomputing=!0,e.value.length=0;try{e.value[0]=e.fn.apply(null,t)}catch(t){e.value[1]=t}e.recomputing=!1}function w(e){return e.dirty||!(!e.dirtyChildren||!e.dirtyChildren.size)}function T(e){e.parents.forEach((function(t){return I(t,e)}))}function A(e){e.parents.forEach((function(t){return k(t,e)}))}function I(e,t){if(b(e.childValues.has(t)),b(w(t)),e.dirtyChildren){if(e.dirtyChildren.has(t))return}else e.dirtyChildren=m.pop()||new Set;e.dirtyChildren.add(t),T(e)}function k(e,t){b(e.childValues.has(t)),b(!w(t));var r,n,i,a=e.childValues.get(t);0===a.length?e.childValues.set(t,t.value.slice(0)):(r=a,n=t.value,(i=r.length)>0&&i===n.length&&r[i-1]===n[i-1]||e.setDirty()),_(e,t),w(e)||A(e)}function _(e,t){var r=e.dirtyChildren;r&&(r.delete(t),0===r.size&&(m.length<100&&m.push(r),e.dirtyChildren=null))}function B(e){e.childValues.size>0&&e.childValues.forEach((function(t,r){N(e,r)})),e.forgetDeps(),b(null===e.dirtyChildren)}function N(e,t){t.parents.delete(e),e.childValues.delete(t),_(e,t)}function O(e){var t=new Map,r=e&&e.subscribe;function n(e){var n=v.getValue();if(n){var i=t.get(e);i||t.set(e,i=new Set),n.dependOn(i),"function"==typeof r&&(g(i),i.unsubscribe=r(e))}}return n.dirty=function(e){var r=t.get(e);r&&(r.forEach((function(e){return e.setDirty()})),t.delete(e),g(r))},n}var R=new s("function"==typeof WeakMap);function x(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return R.lookupArray(e)}var P=new Set;function F(e,t){void 0===t&&(t=Object.create(null));var r=new y(t.max||Math.pow(2,16),(function(e){return e.dispose()})),n=t.keyArgs||function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e},i=t.makeCacheKey||x;function a(){var a=i.apply(null,n.apply(null,arguments));if(void 0===a)return e.apply(null,arguments);var o=r.get(a);o||(r.set(a,o=new S(e)),o.subscribe=t.subscribe);var s=o.recompute(Array.prototype.slice.call(arguments));return r.set(a,o),P.add(r),v.hasValue()||(P.forEach((function(e){return e.clean()})),P.clear()),s}function o(){var e=i.apply(null,arguments);if(void 0!==e)return r.get(e)}return a.dirty=function(){var e=o.apply(null,arguments);e&&e.setDirty()},a.peek=function(){var e=o.apply(null,arguments);if(e)return e.peek()},a.forget=function(){var e=i.apply(null,arguments);return void 0!==e&&r.delete(e)},a}var D,L=r(496),U=function(){function e(){this.getFragmentDoc=F(L.Yk)}return e.prototype.recordOptimisticTransaction=function(e,t){this.performTransaction(e,t)},e.prototype.transformDocument=function(e){return e},e.prototype.identify=function(e){},e.prototype.gc=function(){return[]},e.prototype.modify=function(e){return!1},e.prototype.transformForLink=function(e){return e},e.prototype.readQuery=function(e,t){return void 0===t&&(t=!!e.optimistic),this.read({rootId:e.id||"ROOT_QUERY",query:e.query,variables:e.variables,returnPartialData:e.returnPartialData,optimistic:t})},e.prototype.readFragment=function(e,t){return void 0===t&&(t=!!e.optimistic),this.read({query:this.getFragmentDoc(e.fragment,e.fragmentName),variables:e.variables,rootId:e.id,returnPartialData:e.returnPartialData,optimistic:t})},e.prototype.writeQuery=function(e){return this.write({dataId:e.id||"ROOT_QUERY",result:e.data,query:e.query,variables:e.variables,broadcast:e.broadcast})},e.prototype.writeFragment=function(e){return this.write({dataId:e.id,result:e.data,variables:e.variables,query:this.getFragmentDoc(e.fragment,e.fragmentName),broadcast:e.broadcast})},e}();D||(D={});var j=function(e,t,r,n,i){this.message=e,this.path=t,this.query=r,this.clientOnly=n,this.variables=i},V=r(655),K=r(2924),M=r(2152),q=Object.prototype.hasOwnProperty;var z=/^[_a-z][_0-9a-z]*/i;function H(e){var t=e.match(z);return t?t[0]:e}function G(e,t,r){return!(!t||"object"!=typeof t)&&(Array.isArray(t)?t.every((function(t){return G(e,t,r)})):e.selections.every((function(e){if((0,L.My)(e)&&(0,L.LZ)(e,r)){var n=(0,L.u2)(e);return q.call(t,n)&&(!e.selectionSet||G(e.selectionSet,t[n],r))}return!0})))}function Q(e){return null!==e&&"object"==typeof e&&!(0,L.hh)(e)&&!Array.isArray(e)}var W=Object.create(null),Y=function(){return W},Z=Object.create(null),J=function(){function e(e,t){var r=this;this.policies=e,this.group=t,this.data=Object.create(null),this.rootIds=Object.create(null),this.refs=Object.create(null),this.getFieldValue=function(e,t){return(0,L.Jv)((0,L.hh)(e)?r.get(e.__ref,t):e&&e[t])},this.canRead=function(e){return(0,L.hh)(e)?r.has(e.__ref):"object"==typeof e},this.toReference=function(e,t){if("string"==typeof e)return(0,L.kQ)(e);if((0,L.hh)(e))return e;var n=r.policies.identify(e)[0];if(n){var i=(0,L.kQ)(n);return t&&r.merge(n,e),i}}}return e.prototype.toObject=function(){return(0,V.pi)({},this.data)},e.prototype.has=function(e){return void 0!==this.lookup(e,!0)},e.prototype.get=function(e,t){if(this.group.depend(e,t),q.call(this.data,e)){var r=this.data[e];if(r&&q.call(r,t))return r[t]}return"__typename"===t&&q.call(this.policies.rootTypenamesById,e)?this.policies.rootTypenamesById[e]:this instanceof ee?this.parent.get(e,t):void 0},e.prototype.lookup=function(e,t){return t&&this.group.depend(e,"__exists"),q.call(this.data,e)?this.data[e]:this instanceof ee?this.parent.lookup(e,t):this.policies.rootTypenamesById[e]?Object.create(null):void 0},e.prototype.merge=function(e,t){var r=this,n=this.lookup(e),i=new L.w0(te).merge(n,t);if(this.data[e]=i,i!==n&&(delete this.refs[e],this.group.caching)){var a=Object.create(null);n||(a.__exists=1),Object.keys(t).forEach((function(e){if(!n||n[e]!==i[e]){a[e]=1;var t=H(e);t===e||r.policies.hasKeyArgs(i.__typename,t)||(a[t]=1),void 0!==i[e]||r instanceof ee||delete i[e]}})),Object.keys(a).forEach((function(t){return r.group.dirty(e,t)}))}},e.prototype.modify=function(e,t){var r=this,n=this.lookup(e);if(n){var i=Object.create(null),a=!1,o=!0,s={DELETE:W,INVALIDATE:Z,isReference:L.hh,toReference:this.toReference,canRead:this.canRead,readField:function(t,n){return r.policies.readField("string"==typeof t?{fieldName:t,from:n||(0,L.kQ)(e)}:t,{store:r})}};if(Object.keys(n).forEach((function(u){var c=H(u),l=n[u];if(void 0!==l){var f="function"==typeof t?t:t[u]||t[c];if(f){var h=f===Y?W:f((0,L.Jv)(l),(0,V.pi)((0,V.pi)({},s),{fieldName:c,storeFieldName:u,storage:r.getStorage(e,u)}));h===Z?r.group.dirty(e,u):(h===W&&(h=void 0),h!==l&&(i[u]=h,a=!0,l=h))}void 0!==l&&(o=!1)}})),a)return this.merge(e,i),o&&(this instanceof ee?this.data[e]=void 0:delete this.data[e],this.group.dirty(e,"__exists")),!0}return!1},e.prototype.delete=function(e,t,r){var n,i=this.lookup(e);if(i){var a=this.getFieldValue(i,"__typename"),o=t&&r?this.policies.getStoreFieldName({typename:a,fieldName:t,args:r}):t;return this.modify(e,o?((n={})[o]=Y,n):Y)}return!1},e.prototype.evict=function(e){var t=!1;return e.id&&(q.call(this.data,e.id)&&(t=this.delete(e.id,e.fieldName,e.args)),this instanceof ee&&(t=this.parent.evict(e)||t),(e.fieldName||t)&&this.group.dirty(e.id,e.fieldName||"__exists")),t},e.prototype.clear=function(){this.replace(null)},e.prototype.extract=function(){var e=this,t=this.toObject(),r=[];return this.getRootIdSet().forEach((function(t){q.call(e.policies.rootTypenamesById,t)||r.push(t)})),r.length&&(t.__META={extraRootIds:r.sort()}),t},e.prototype.replace=function(e){var t=this;if(Object.keys(this.data).forEach((function(r){e&&q.call(e,r)||t.delete(r)})),e){var r=e.__META,n=(0,V._T)(e,["__META"]);Object.keys(n).forEach((function(e){t.merge(e,n[e])})),r&&r.extraRootIds.forEach(this.retain,this)}},e.prototype.retain=function(e){return this.rootIds[e]=(this.rootIds[e]||0)+1},e.prototype.release=function(e){if(this.rootIds[e]>0){var t=--this.rootIds[e];return t||delete this.rootIds[e],t}return 0},e.prototype.getRootIdSet=function(e){return void 0===e&&(e=new Set),Object.keys(this.rootIds).forEach(e.add,e),this instanceof ee?this.parent.getRootIdSet(e):Object.keys(this.policies.rootTypenamesById).forEach(e.add,e),e},e.prototype.gc=function(){var e=this,t=this.getRootIdSet(),r=this.toObject();t.forEach((function(n){q.call(r,n)&&(Object.keys(e.findChildRefIds(n)).forEach(t.add,t),delete r[n])}));var n=Object.keys(r);if(n.length){for(var i=this;i instanceof ee;)i=i.parent;n.forEach((function(e){return i.delete(e)}))}return n},e.prototype.findChildRefIds=function(e){if(!q.call(this.refs,e)){var t=this.refs[e]=Object.create(null),r=new Set([this.data[e]]),n=function(e){return null!==e&&"object"==typeof e};r.forEach((function(e){(0,L.hh)(e)?t[e.__ref]=!0:n(e)&&Object.values(e).filter(n).forEach(r.add,r)}))}return this.refs[e]},e.prototype.makeCacheKey=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return this.group.keyMaker.lookupArray(e)},e}(),X=function(){function e(e){this.caching=e,this.d=null,this.keyMaker=new s(L.mr),this.d=e?O():null}return e.prototype.depend=function(e,t){if(this.d){this.d($(e,t));var r=H(t);r!==t&&this.d($(e,r))}},e.prototype.dirty=function(e,t){this.d&&this.d.dirty($(e,t))},e}();function $(e,t){return t+"#"+e}!function(e){var t=function(e){function t(t){var r=t.policies,n=t.resultCaching,i=void 0===n||n,a=t.seed,o=e.call(this,r,new X(i))||this;return o.storageTrie=new s(L.mr),o.sharedLayerGroup=new X(i),a&&o.replace(a),o}return(0,V.ZT)(t,e),t.prototype.addLayer=function(e,t){return new ee(e,this,t,this.sharedLayerGroup)},t.prototype.removeLayer=function(){return this},t.prototype.getStorage=function(){return this.storageTrie.lookupArray(arguments)},t}(e);e.Root=t}(J||(J={}));var ee=function(e){function t(t,r,n,i){var a=e.call(this,r.policies,i)||this;return a.id=t,a.parent=r,a.replay=n,a.group=i,n(a),a}return(0,V.ZT)(t,e),t.prototype.addLayer=function(e,r){return new t(e,this,r,this.group)},t.prototype.removeLayer=function(e){var t=this,r=this.parent.removeLayer(e);return e===this.id?(this.group.caching&&Object.keys(this.data).forEach((function(e){t.data[e]!==r.lookup(e)&&t.delete(e)})),r):r===this.parent?this:r.addLayer(this.id,this.replay)},t.prototype.toObject=function(){return(0,V.pi)((0,V.pi)({},this.parent.toObject()),this.data)},t.prototype.findChildRefIds=function(t){var r=this.parent.findChildRefIds(t);return q.call(this.data,t)?(0,V.pi)((0,V.pi)({},r),e.prototype.findChildRefIds.call(this,t)):r},t.prototype.getStorage=function(){for(var e=this.parent;e.parent;)e=e.parent;return e.getStorage.apply(e,arguments)},t}(J);function te(e,t,r){var n=e[r],i=t[r];return(0,M.D)(n,i)?n:i}function re(e){return!!(e instanceof J&&e.group.caching)}function ne(e,t){return new j(e.message,t.path.slice(),t.query,t.clientOnly,t.variables)}var ie=function(){function e(e){var t=this;this.config=e,this.executeSelectionSet=F((function(e){return t.execSelectionSetImpl(e)}),{keyArgs:function(e){return[e.selectionSet,e.objectOrReference,e.context]},makeCacheKey:function(e,t,r){if(re(r.store))return r.store.makeCacheKey(e,(0,L.hh)(t)?t.__ref:t,r.varString)}}),this.knownResults=new WeakMap,this.executeSubSelectedArray=F((function(e){return t.execSubSelectedArrayImpl(e)}),{makeCacheKey:function(e){var t=e.field,r=e.array,n=e.context;if(re(n.store))return n.store.makeCacheKey(t,r,n.varString)}}),this.config=(0,V.pi)({addTypename:!0},e)}return e.prototype.diffQueryAgainstStore=function(e){var t=e.store,r=e.query,n=e.rootId,i=void 0===n?"ROOT_QUERY":n,a=e.variables,o=e.returnPartialData,s=void 0===o||o,u=this.config.cache.policies;a=(0,V.pi)((0,V.pi)({},(0,L.O4)((0,L.iW)(r))),a);var c=this.executeSelectionSet({selectionSet:(0,L.p$)(r).selectionSet,objectOrReference:(0,L.kQ)(i),context:{store:t,query:r,policies:u,variables:a,varString:JSON.stringify(a),fragmentMap:(0,L.F)((0,L.kU)(r)),path:[],clientOnly:!1}}),l=c.missing&&c.missing.length>0;if(l&&!s)throw c.missing[0];return{result:c.result,missing:c.missing,complete:!l}},e.prototype.isFresh=function(e,t,r,n){if(re(n.store)&&this.knownResults.get(e)===r){var i=this.executeSelectionSet.peek(r,t,n);if(i&&e===i.result)return!0}return!1},e.prototype.execSelectionSetImpl=function(e){var t=this,r=e.selectionSet,n=e.objectOrReference,i=e.context;if((0,L.hh)(n)&&!i.policies.rootTypenamesById[n.__ref]&&!i.store.has(n.__ref))return{result:{},missing:[ne(new K.ej(4),i)]};var a=i.variables,o=i.policies,s=i.store,u=[],c={result:null},l=s.getFieldValue(n,"__typename");function f(){return c.missing||(c.missing=[])}function h(e){var t;return e.missing&&(t=f()).push.apply(t,e.missing),e.result}this.config.addTypename&&"string"==typeof l&&!o.rootIdsByTypename[l]&&u.push({__typename:l});var p=new Set(r.selections);return p.forEach((function(e){var r;if((0,L.LZ)(e,a))if((0,L.My)(e)){var s=o.readField({fieldName:e.name.value,field:e,variables:i.variables,from:n},i),c=(0,L.u2)(e);i.path.push(c);var d=i.clientOnly;i.clientOnly=d||!(!e.directives||!e.directives.some((function(e){return"client"===e.name.value}))),void 0===s?L.Gw.added(e)||f().push(ne(new K.ej(5),i)):Array.isArray(s)?s=h(t.executeSubSelectedArray({field:e,array:s,context:i})):e.selectionSet&&null!=s&&(s=h(t.executeSelectionSet({selectionSet:e.selectionSet,objectOrReference:s,context:i}))),void 0!==s&&u.push(((r={})[c]=s,r)),i.clientOnly=d,(0,K.kG)(i.path.pop()===c)}else{var y=(0,L.hi)(e,i.fragmentMap);y&&o.fragmentMatches(y,l)&&y.selectionSet.selections.forEach(p.add,p)}})),c.result=(0,L.bw)(u),this.knownResults.set(c.result,r),c},e.prototype.execSubSelectedArrayImpl=function(e){var t,r=this,n=e.field,i=e.array,a=e.context;function o(e,r){return e.missing&&(t=t||[]).push.apply(t,e.missing),(0,K.kG)(a.path.pop()===r),e.result}return n.selectionSet&&(i=i.filter(a.store.canRead)),{result:i=i.map((function(e,t){return null===e?null:(a.path.push(t),Array.isArray(e)?o(r.executeSubSelectedArray({field:n,array:e,context:a}),t):n.selectionSet?o(r.executeSelectionSet({selectionSet:n.selectionSet,objectOrReference:e,context:a}),t):((0,K.kG)(a.path.pop()===t),e))})),missing:t}},e}();var ae=function(){function e(e,t){this.cache=e,this.reader=t}return e.prototype.writeToStore=function(e){var t=e.query,r=e.result,n=e.dataId,i=e.store,a=e.variables,o=(0,L.$H)(t),s=new L.w0;a=(0,V.pi)((0,V.pi)({},(0,L.O4)(o)),a);var u=this.processSelectionSet({result:r||Object.create(null),dataId:n,selectionSet:o.selectionSet,mergeTree:{map:new Map},context:{store:i,written:Object.create(null),merge:function(e,t){return s.merge(e,t)},variables:a,varString:JSON.stringify(a),fragmentMap:(0,L.F)((0,L.kU)(t))}});if(!(0,L.hh)(u))throw new K.ej(7);return i.retain(u.__ref),u},e.prototype.processSelectionSet=function(e){var t=this,r=e.dataId,n=e.result,i=e.selectionSet,a=e.context,o=e.mergeTree,s=this.cache.policies,u=s.identify(n,i,a.fragmentMap),c=u[0],l=u[1];if("string"==typeof(r=r||c)){var f=a.written[r]||(a.written[r]=[]),h=(0,L.kQ)(r);if(f.indexOf(i)>=0)return h;if(f.push(i),this.reader&&this.reader.isFresh(n,h,i,a))return h}var p=Object.create(null);l&&(p=a.merge(p,l));var d=r&&s.rootTypenamesById[r]||(0,L.qw)(n,i,a.fragmentMap)||r&&a.store.get(r,"__typename");"string"==typeof d&&(p.__typename=d);var y=new Set(i.selections);if(y.forEach((function(e){var r;if((0,L.LZ)(e,a.variables))if((0,L.My)(e)){var i=(0,L.u2)(e),u=n[i];if(void 0!==u){var c=s.getStoreFieldName({typename:d,fieldName:e.name.value,field:e,variables:a.variables}),l=se(o,c),f=t.processFieldValue(u,e,a,l),h=e.selectionSet&&a.store.getFieldValue(f,"__typename")||void 0,v=s.getMergeFunction(d,e.name.value,h);v?l.info={field:e,typename:d,merge:v}:ue(o,c),p=a.merge(p,((r={})[c]=f,r))}else if(s.usingPossibleTypes&&!(0,L.FS)(["defer","client"],e))throw new K.ej(8)}else{var g=(0,L.hi)(e,a.fragmentMap);g&&s.fragmentMatches(g,d,n,a.variables)&&g.selectionSet.selections.forEach(y.add,y)}})),"string"==typeof r){var v=(0,L.kQ)(r);return o.map.size&&(p=this.applyMerges(o,v,p,a)),a.store.merge(r,p),v}return p},e.prototype.processFieldValue=function(e,t,r,n){var i=this;return t.selectionSet&&null!==e?Array.isArray(e)?e.map((function(e,a){var o=i.processFieldValue(e,t,r,se(n,a));return ue(n,a),o})):this.processSelectionSet({result:e,selectionSet:t.selectionSet,context:r,mergeTree:n}):e},e.prototype.applyMerges=function(e,t,r,n,i){var a,o=this;if(e.map.size&&!(0,L.hh)(r)){var s,u=Array.isArray(r)||!(0,L.hh)(t)&&!Q(t)?void 0:t,c=r;u&&!i&&(i=[(0,L.hh)(u)?u.__ref:u]);var l=function(e,t){return Array.isArray(e)?"number"==typeof t?e[t]:void 0:n.store.getFieldValue(e,String(t))};e.map.forEach((function(e,t){i&&i.push(t);var r=l(u,t),a=l(c,t),f=o.applyMerges(e,r,a,n,i);f!==a&&(s=s||new Map).set(t,f),i&&(0,K.kG)(i.pop()===t)})),s&&(r=Array.isArray(c)?c.slice(0):(0,V.pi)({},c),s.forEach((function(e,t){r[t]=e})))}return e.info?this.cache.policies.runMergeFunction(t,r,e.info,n,i&&(a=n.store).getStorage.apply(a,i)):r},e}(),oe=[];function se(e,t){var r=e.map;return r.has(t)||r.set(t,oe.pop()||{map:new Map}),r.get(t)}function ue(e,t){var r=e.map,n=r.get(t);!n||n.info||n.map.size||(oe.push(n),r.delete(t))}new Set;var ce=new p;function le(e,t){if(e.size){var r=[];e.forEach((function(e){return r.push(e)})),e.clear(),r.forEach(t)}}var fe=new WeakMap;function he(e){var t=fe.get(e);return t||fe.set(e,t={vars:new Set,dep:O()}),t}function pe(e){var t=new Set,r=new Set,n=function(a){if(arguments.length>0)e!==a&&(e=a,t.forEach((function(e){he(e).dep.dirty(n),de(e)})),le(r,(function(t){return t(e)})));else{var o=ce.getValue();o&&(i(o),he(o).dep(n))}return e};n.onNextChange=function(e){return r.add(e),function(){r.delete(e)}};var i=n.attachCache=function(e){return t.add(e),he(e).vars.add(n),n};return n.forgetCache=function(e){return t.delete(e)},n}function de(e){e.broadcastWatches&&e.broadcastWatches()}function ye(e){return void 0!==e.args?e.args:e.field?(0,L.NC)(e.field,e.variables):null}var ve=function(e,t){var r=e.__typename,n=e.id,i=e._id;if("string"==typeof r&&(t&&(t.keyObject=void 0!==n?{id:n}:void 0!==i?{_id:i}:void 0),void 0===n&&(n=i),void 0!==n))return r+":"+("number"==typeof n||"string"==typeof n?n:JSON.stringify(n))},ge=function(){},me=function(e,t){return t.fieldName},be=function(e,t,r){return(0,r.mergeObjects)(e,t)},Ee=function(e,t){return t},Se=function(){function e(e){this.config=e,this.typePolicies=Object.create(null),this.toBeAdded=Object.create(null),this.supertypeMap=new Map,this.fuzzySubtypes=new Map,this.rootIdsByTypename=Object.create(null),this.rootTypenamesById=Object.create(null),this.usingPossibleTypes=!1,this.config=(0,V.pi)({dataIdFromObject:ve},e),this.cache=this.config.cache,this.setRootTypename("Query"),this.setRootTypename("Mutation"),this.setRootTypename("Subscription"),e.possibleTypes&&this.addPossibleTypes(e.possibleTypes),e.typePolicies&&this.addTypePolicies(e.typePolicies)}return e.prototype.identify=function(e,t,r){var n=t&&r?(0,L.qw)(e,t,r):e.__typename;if(n===this.rootTypenamesById.ROOT_QUERY)return["ROOT_QUERY"];for(var i,a={typename:n,selectionSet:t,fragmentMap:r},o=n&&this.getTypePolicy(n),s=o&&o.keyFn||this.config.dataIdFromObject;s;){var u=s(e,a);if(!Array.isArray(u)){i=u;break}s=Ae(u)}return i=i&&String(i),a.keyObject?[i,a.keyObject]:[i]},e.prototype.addTypePolicies=function(e){var t=this;Object.keys(e).forEach((function(r){var n=e[r],i=n.queryType,a=n.mutationType,o=n.subscriptionType,s=(0,V._T)(n,["queryType","mutationType","subscriptionType"]);i&&t.setRootTypename("Query",r),a&&t.setRootTypename("Mutation",r),o&&t.setRootTypename("Subscription",r),q.call(t.toBeAdded,r)?t.toBeAdded[r].push(s):t.toBeAdded[r]=[s]}))},e.prototype.updateTypePolicy=function(e,t){var r=this,n=this.getTypePolicy(e),i=t.keyFields,a=t.fields;function o(e,t){e.merge="function"==typeof t?t:!0===t?be:!1===t?Ee:e.merge}o(n,t.merge),n.keyFn=!1===i?ge:Array.isArray(i)?Ae(i):"function"==typeof i?i:n.keyFn,a&&Object.keys(a).forEach((function(t){var n=r.getFieldPolicy(e,t,!0),i=a[t];if("function"==typeof i)n.read=i;else{var s=i.keyArgs,u=i.read,c=i.merge;n.keyFn=!1===s?me:Array.isArray(s)?Te(s):"function"==typeof s?s:n.keyFn,"function"==typeof u&&(n.read=u),o(n,c)}n.read&&n.merge&&(n.keyFn=n.keyFn||me)}))},e.prototype.setRootTypename=function(e,t){void 0===t&&(t=e);var r="ROOT_"+e.toUpperCase(),n=this.rootTypenamesById[r];t!==n&&((0,K.kG)(!n||n===e,1),n&&delete this.rootIdsByTypename[n],this.rootIdsByTypename[t]=r,this.rootTypenamesById[r]=t)},e.prototype.addPossibleTypes=function(e){var t=this;this.usingPossibleTypes=!0,Object.keys(e).forEach((function(r){t.getSupertypeSet(r,!0),e[r].forEach((function(e){t.getSupertypeSet(e,!0).add(r);var n=e.match(z);n&&n[0]===e||t.fuzzySubtypes.set(e,new RegExp(e))}))}))},e.prototype.getTypePolicy=function(e){var t=this;if(!q.call(this.typePolicies,e)){var r=this.typePolicies[e]=Object.create(null);r.fields=Object.create(null);var n=this.supertypeMap.get(e);n&&n.size&&n.forEach((function(e){var n=t.getTypePolicy(e),i=n.fields,a=(0,V._T)(n,["fields"]);Object.assign(r,a),Object.assign(r.fields,i)}))}var i=this.toBeAdded[e];return i&&i.length&&this.updateTypePolicy(e,L.oA.apply(void 0,i.splice(0))),this.typePolicies[e]},e.prototype.getFieldPolicy=function(e,t,r){if(e){var n=this.getTypePolicy(e).fields;return n[t]||r&&(n[t]=Object.create(null))}},e.prototype.getSupertypeSet=function(e,t){var r=this.supertypeMap.get(e);return!r&&t&&this.supertypeMap.set(e,r=new Set),r},e.prototype.fragmentMatches=function(e,t,r,n){var i=this;if(!e.typeCondition)return!0;if(!t)return!1;var a=e.typeCondition.name.value;if(t===a)return!0;if(this.usingPossibleTypes&&this.supertypeMap.has(a))for(var o=this.getSupertypeSet(t,!0),s=[o],u=function(e){var t=i.getSupertypeSet(e,!1);t&&t.size&&s.indexOf(t)<0&&s.push(t)},c=!(!r||!this.fuzzySubtypes.size),l=0;l<s.length;++l){var f=s[l];if(f.has(a))return o.has(a)||o.add(a),!0;f.forEach(u),c&&l===s.length-1&&G(e.selectionSet,r,n)&&(c=!1,!0,this.fuzzySubtypes.forEach((function(e,r){var n=t.match(e);n&&n[0]===t&&u(r)})))}return!1},e.prototype.hasKeyArgs=function(e,t){var r=this.getFieldPolicy(e,t,!1);return!(!r||!r.keyFn)},e.prototype.getStoreFieldName=function(e){var t,r=e.typename,n=e.fieldName,i=this.getFieldPolicy(r,n,!1),a=i&&i.keyFn;if(a&&r)for(var o={typename:r,fieldName:n,field:e.field||null,variables:e.variables},s=ye(e);a;){var u=a(s,o);if(!Array.isArray(u)){t=u||n;break}a=Te(u)}return void 0===t&&(t=e.field?(0,L.vf)(e.field,e.variables):(0,L.PT)(n,ye(e))),n===H(t)?t:n+":"+t},e.prototype.readField=function(e,t){var r=e.from;if(r&&(e.field||e.fieldName)){if(void 0===e.typename){var n=t.store.getFieldValue(r,"__typename");n&&(e.typename=n)}var i=this.getStoreFieldName(e),a=H(i),o=t.store.getFieldValue(r,i),s=this.getFieldPolicy(e.typename,a,!1),u=s&&s.read;if(u){var c=Ce(this,r,e,t,t.store.getStorage((0,L.hh)(r)?r.__ref:r,i));return ce.withValue(this.cache,u,[o,c])}return o}},e.prototype.getMergeFunction=function(e,t,r){var n=this.getFieldPolicy(e,t,!1),i=n&&n.merge;return!i&&r&&(i=(n=this.getTypePolicy(r))&&n.merge),i},e.prototype.runMergeFunction=function(e,t,r,n,i){var a=r.field,o=r.typename,s=r.merge;return s===be?we(n.store.getFieldValue)(e,t):s===Ee?t:s(e,t,Ce(this,void 0,{typename:o,fieldName:a.name.value,field:a,variables:n.variables},n,i||Object.create(null)))},e}();function Ce(e,t,r,n,i){var a=e.getStoreFieldName(r),o=H(a),s=r.variables||n.variables,u=n.store,c=u.getFieldValue,l=u.toReference,f=u.canRead;return{args:ye(r),field:r.field||null,fieldName:o,storeFieldName:a,variables:s,isReference:L.hh,toReference:l,storage:i,cache:e.cache,canRead:f,readField:function(r,i){var a="string"==typeof r?{fieldName:r,from:i}:(0,V.pi)({},r);return void 0===a.from&&(a.from=t),void 0===a.variables&&(a.variables=s),e.readField(a,n)},mergeObjects:we(c)}}function we(e){return function(t,r){if(Array.isArray(t)||Array.isArray(r))throw new K.ej(2);if(t&&"object"==typeof t&&r&&"object"==typeof r){var n=e(t,"__typename"),i=e(r,"__typename");return!(n&&i&&n!==i)&&Q(t)&&Q(r)?(0,V.pi)((0,V.pi)({},t),r):r}return r}}function Te(e){return function(t,r){return t?r.fieldName+":"+JSON.stringify(ke(t,e,!1)):r.fieldName}}function Ae(e){var t=new s(L.mr);return function(r,n){var i;if(n.selectionSet&&n.fragmentMap){var a=t.lookupArray([n.selectionSet,n.fragmentMap]);i=a.aliasMap||(a.aliasMap=Ie(n.selectionSet,n.fragmentMap))}var o=n.keyObject=ke(r,e,!0,i);return n.typename+":"+JSON.stringify(o)}}function Ie(e,t){var r=Object.create(null),n=new Set([e]);return n.forEach((function(e){e.selections.forEach((function(e){if((0,L.My)(e)){if(e.alias){var i=e.alias.value,a=e.name.value;if(a!==i)(r.aliases||(r.aliases=Object.create(null)))[a]=i}if(e.selectionSet)(r.subsets||(r.subsets=Object.create(null)))[e.name.value]=Ie(e.selectionSet,t)}else{var o=(0,L.hi)(e,t);o&&n.add(o.selectionSet)}}))})),r}function ke(e,t,r,n){var i,a=Object.create(null);return t.forEach((function(t){if(Array.isArray(t)){if("string"==typeof i){var o=n&&n.subsets,s=o&&o[i];a[i]=ke(e[i],t,r,s)}}else{var u=n&&n.aliases,c=u&&u[t]||t;q.call(e,c)?a[i=t]=e[c]:((0,K.kG)(!r,3),i=void 0)}})),a}var _e={dataIdFromObject:ve,addTypename:!0,resultCaching:!0,typePolicies:{}},Be=function(e){function t(t){void 0===t&&(t={});var r=e.call(this)||this;return r.watches=new Set,r.typenameDocumentCache=new Map,r.makeVar=pe,r.txCount=0,r.maybeBroadcastWatch=F((function(e,t){return r.broadcastWatch.call(r,e,!!t)}),{makeCacheKey:function(e){var t=e.optimistic?r.optimisticData:r.data;if(re(t)){var n=e.optimistic,i=e.rootId,a=e.variables;return t.makeCacheKey(e.query,e.callback,JSON.stringify({optimistic:n,rootId:i,variables:a}))}}}),r.watchDep=O(),r.config=(0,V.pi)((0,V.pi)({},_e),t),r.addTypename=!!r.config.addTypename,r.policies=new Se({cache:r,dataIdFromObject:r.config.dataIdFromObject,possibleTypes:r.config.possibleTypes,typePolicies:r.config.typePolicies}),r.data=new J.Root({policies:r.policies,resultCaching:r.config.resultCaching}),r.optimisticData=r.data,r.storeWriter=new ae(r,r.storeReader=new ie({cache:r,addTypename:r.addTypename})),r}return(0,V.ZT)(t,e),t.prototype.restore=function(e){return e&&this.data.replace(e),this},t.prototype.extract=function(e){return void 0===e&&(e=!1),(e?this.optimisticData:this.data).extract()},t.prototype.read=function(e){var t=e.returnPartialData,r=void 0!==t&&t;try{return this.storeReader.diffQueryAgainstStore({store:e.optimistic?this.optimisticData:this.data,query:e.query,variables:e.variables,rootId:e.rootId,config:this.config,returnPartialData:r}).result||null}catch(e){if(e instanceof j)return null;throw e}},t.prototype.write=function(e){try{return++this.txCount,this.storeWriter.writeToStore({store:this.data,query:e.query,result:e.result,dataId:e.dataId,variables:e.variables})}finally{--this.txCount||!1===e.broadcast||this.broadcastWatches()}},t.prototype.modify=function(e){if(q.call(e,"id")&&!e.id)return!1;var t=e.optimistic?this.optimisticData:this.data;try{return++this.txCount,t.modify(e.id||"ROOT_QUERY",e.fields)}finally{--this.txCount||!1===e.broadcast||this.broadcastWatches()}},t.prototype.diff=function(e){return this.storeReader.diffQueryAgainstStore({store:e.optimistic?this.optimisticData:this.data,rootId:e.id||"ROOT_QUERY",query:e.query,variables:e.variables,returnPartialData:e.returnPartialData,config:this.config})},t.prototype.watch=function(e){var t,r=this;return this.watches.size||he(t=this).vars.forEach((function(e){return e.attachCache(t)})),this.watches.add(e),e.immediate&&this.maybeBroadcastWatch(e),function(){r.watches.delete(e)&&!r.watches.size&&function(e){he(e).vars.forEach((function(t){return t.forgetCache(e)}))}(r),r.watchDep.dirty(e),r.maybeBroadcastWatch.forget(e)}},t.prototype.gc=function(){return this.optimisticData.gc()},t.prototype.retain=function(e,t){return(t?this.optimisticData:this.data).retain(e)},t.prototype.release=function(e,t){return(t?this.optimisticData:this.data).release(e)},t.prototype.identify=function(e){return(0,L.hh)(e)?e.__ref:this.policies.identify(e)[0]},t.prototype.evict=function(e){if(!e.id){if(q.call(e,"id"))return!1;e=(0,V.pi)((0,V.pi)({},e),{id:"ROOT_QUERY"})}try{return++this.txCount,this.optimisticData.evict(e)}finally{--this.txCount||!1===e.broadcast||this.broadcastWatches()}},t.prototype.reset=function(){return this.data.clear(),this.optimisticData=this.data,this.broadcastWatches(),Promise.resolve()},t.prototype.removeOptimistic=function(e){var t=this.optimisticData.removeLayer(e);t!==this.optimisticData&&(this.optimisticData=t,this.broadcastWatches())},t.prototype.performTransaction=function(e,t){var r=this,n=function(t){var n=r,i=n.data,a=n.optimisticData;++r.txCount,t&&(r.data=r.optimisticData=t);try{e(r)}finally{--r.txCount,r.data=i,r.optimisticData=a}},i=!1;"string"==typeof t?(this.optimisticData=this.optimisticData.addLayer(t,n),i=!0):null===t?n(this.data):n(),this.broadcastWatches(i)},t.prototype.transformDocument=function(e){if(this.addTypename){var t=this.typenameDocumentCache.get(e);return t||(t=(0,L.Gw)(e),this.typenameDocumentCache.set(e,t),this.typenameDocumentCache.set(t,t)),t}return e},t.prototype.broadcastWatches=function(e){var t=this;this.txCount||this.watches.forEach((function(r){return t.maybeBroadcastWatch(r,e)}))},t.prototype.broadcastWatch=function(e,t){this.watchDep.dirty(e),this.watchDep(e);var r=this.diff({query:e.query,variables:e.variables,optimistic:e.optimistic});e.optimistic&&t&&(r.fromOptimisticTransaction=!0),e.callback(r)},t}(U)},5367:function(){},5765:function(e,t,r){"use strict";r.d(t,{f:function(){return w}});var n=r(655),i=r(2924),a=r(1707),o=r(496),s=r(9950),u=r(2152),c=r(1498),l=r(6282),f=r(5942),h=r(7636),p=r(2634),d=function(){function e(e){var t=e.cache,r=e.client,n=e.resolvers,i=e.fragmentMatcher;this.cache=t,r&&(this.client=r),n&&this.addResolvers(n),i&&this.setFragmentMatcher(i)}return e.prototype.addResolvers=function(e){var t=this;this.resolvers=this.resolvers||{},Array.isArray(e)?e.forEach((function(e){t.resolvers=(0,o.Ee)(t.resolvers,e)})):this.resolvers=(0,o.Ee)(this.resolvers,e)},e.prototype.setResolvers=function(e){this.resolvers={},this.addResolvers(e)},e.prototype.getResolvers=function(){return this.resolvers||{}},e.prototype.runResolvers=function(e){var t=e.document,r=e.remoteResult,i=e.context,a=e.variables,o=e.onlyRunForcedResolvers,s=void 0!==o&&o;return(0,n.mG)(this,void 0,void 0,(function(){return(0,n.Jh)(this,(function(e){return t?[2,this.resolveDocument(t,r.data,i,a,this.fragmentMatcher,s).then((function(e){return(0,n.pi)((0,n.pi)({},r),{data:e.result})}))]:[2,r]}))}))},e.prototype.setFragmentMatcher=function(e){this.fragmentMatcher=e},e.prototype.getFragmentMatcher=function(){return this.fragmentMatcher},e.prototype.clientQuery=function(e){return(0,o.FS)(["client"],e)&&this.resolvers?e:null},e.prototype.serverQuery=function(e){return(0,o.ob)(e)},e.prototype.prepareContext=function(e){var t=this.cache;return(0,n.pi)((0,n.pi)({},e),{cache:t,getCacheKey:function(e){return t.identify(e)}})},e.prototype.addExportedVariables=function(e,t,r){return void 0===t&&(t={}),void 0===r&&(r={}),(0,n.mG)(this,void 0,void 0,(function(){return(0,n.Jh)(this,(function(i){return e?[2,this.resolveDocument(e,this.buildRootValueFromCache(e,t)||{},this.prepareContext(r),t).then((function(e){return(0,n.pi)((0,n.pi)({},t),e.exportedVariables)}))]:[2,(0,n.pi)({},t)]}))}))},e.prototype.shouldForceResolvers=function(e){var t=!1;return(0,h.Vn)(e,{Directive:{enter:function(e){if("client"===e.name.value&&e.arguments&&(t=e.arguments.some((function(e){return"always"===e.name.value&&"BooleanValue"===e.value.kind&&!0===e.value.value}))))return h.$_}}}),t},e.prototype.buildRootValueFromCache=function(e,t){return this.cache.diff({query:(0,o.aL)(e),variables:t,returnPartialData:!0,optimistic:!1}).result},e.prototype.resolveDocument=function(e,t,r,i,a,s){return void 0===r&&(r={}),void 0===i&&(i={}),void 0===a&&(a=function(){return!0}),void 0===s&&(s=!1),(0,n.mG)(this,void 0,void 0,(function(){var u,c,l,f,h,p,d,y,v;return(0,n.Jh)(this,(function(g){return u=(0,o.p$)(e),c=(0,o.kU)(e),l=(0,o.F)(c),f=u.operation,h=f?f.charAt(0).toUpperCase()+f.slice(1):"Query",d=(p=this).cache,y=p.client,v={fragmentMap:l,context:(0,n.pi)((0,n.pi)({},r),{cache:d,client:y}),variables:i,fragmentMatcher:a,defaultOperationType:h,exportedVariables:{},onlyRunForcedResolvers:s},[2,this.resolveSelectionSet(u.selectionSet,t,v).then((function(e){return{result:e,exportedVariables:v.exportedVariables}}))]}))}))},e.prototype.resolveSelectionSet=function(e,t,r){return(0,n.mG)(this,void 0,void 0,(function(){var a,s,u,c,l,f=this;return(0,n.Jh)(this,(function(h){return a=r.fragmentMap,s=r.context,u=r.variables,c=[t],l=function(e){return(0,n.mG)(f,void 0,void 0,(function(){var l,f;return(0,n.Jh)(this,(function(n){return(0,o.LZ)(e,u)?(0,o.My)(e)?[2,this.resolveField(e,t,r).then((function(t){var r;void 0!==t&&c.push(((r={})[(0,o.u2)(e)]=t,r))}))]:((0,o.Ao)(e)?l=e:(l=a[e.name.value],(0,i.kG)(l,11)),l&&l.typeCondition&&(f=l.typeCondition.name.value,r.fragmentMatcher(t,f,s))?[2,this.resolveSelectionSet(l.selectionSet,t,r).then((function(e){c.push(e)}))]:[2]):[2]}))}))},[2,Promise.all(e.selections.map(l)).then((function(){return(0,o.bw)(c)}))]}))}))},e.prototype.resolveField=function(e,t,r){return(0,n.mG)(this,void 0,void 0,(function(){var i,a,s,u,c,l,f,h,d,y=this;return(0,n.Jh)(this,(function(n){return i=r.variables,a=e.name.value,s=(0,o.u2)(e),u=a!==s,c=t[s]||t[a],l=Promise.resolve(c),r.onlyRunForcedResolvers&&!this.shouldForceResolvers(e)||(f=t.__typename||r.defaultOperationType,(h=this.resolvers&&this.resolvers[f])&&(d=h[u?a:s])&&(l=Promise.resolve(p.ab.withValue(this.cache,d,[t,(0,o.NC)(e,i),r.context,{field:e,fragmentMap:r.fragmentMap}])))),[2,l.then((function(t){return void 0===t&&(t=c),e.directives&&e.directives.forEach((function(e){"export"===e.name.value&&e.arguments&&e.arguments.forEach((function(e){"as"===e.name.value&&"StringValue"===e.value.kind&&(r.exportedVariables[e.value.value]=t)}))})),e.selectionSet?null==t?t:Array.isArray(t)?y.resolveSubSelectedArray(e,t,r):e.selectionSet?y.resolveSelectionSet(e.selectionSet,t,r):void 0:t}))]}))}))},e.prototype.resolveSubSelectedArray=function(e,t,r){var n=this;return Promise.all(t.map((function(t){return null===t?null:Array.isArray(t)?n.resolveSubSelectedArray(e,t,r):e.selectionSet?n.resolveSelectionSet(e.selectionSet,t,r):void 0})))},e}(),y=new(o.mr?WeakMap:Map);function v(e,t){var r=e[t];"function"==typeof r&&(e[t]=function(){return y.set(e,(y.get(e)+1)%1e15),r.apply(this,arguments)})}function g(e){e.notifyTimeout&&(clearTimeout(e.notifyTimeout),e.notifyTimeout=void 0)}var m=function(){function e(e){this.cache=e,this.listeners=new Set,this.document=null,this.lastRequestId=1,this.subscriptions=new Set,this.stopped=!1,this.dirty=!1,this.diff=null,this.observableQuery=null,y.has(e)||(y.set(e,0),v(e,"evict"),v(e,"modify"),v(e,"reset"))}return e.prototype.init=function(e){var t=e.networkStatus||f.I.loading;return this.variables&&this.networkStatus!==f.I.loading&&!(0,u.D)(this.variables,e.variables)&&(t=f.I.setVariables),(0,u.D)(e.variables,this.variables)||(this.diff=null),Object.assign(this,{document:e.document,variables:e.variables,networkError:null,graphQLErrors:this.graphQLErrors||[],networkStatus:t}),e.observableQuery&&this.setObservableQuery(e.observableQuery),e.lastRequestId&&(this.lastRequestId=e.lastRequestId),this},e.prototype.getDiff=function(e){return void 0===e&&(e=this.variables),this.diff&&(0,u.D)(e,this.variables)?this.diff:(this.updateWatch(this.variables=e),this.diff=this.cache.diff({query:this.document,variables:e,returnPartialData:!0,optimistic:!0}))},e.prototype.setDiff=function(e){var t=this,r=this.diff;this.diff=e,this.dirty||(e&&e.result)===(r&&r.result)||(this.dirty=!0,this.notifyTimeout||(this.notifyTimeout=setTimeout((function(){return t.notify()}),0)))},e.prototype.setObservableQuery=function(e){var t=this;e!==this.observableQuery&&(this.oqListener&&this.listeners.delete(this.oqListener),this.observableQuery=e,e?(e.queryInfo=this,this.listeners.add(this.oqListener=function(){t.getDiff().fromOptimisticTransaction?e.observe():e.reobserve()})):delete this.oqListener)},e.prototype.notify=function(){var e=this;g(this),this.shouldNotify()&&this.listeners.forEach((function(t){return t(e)})),this.dirty=!1},e.prototype.shouldNotify=function(){if(!this.dirty||!this.listeners.size)return!1;if((0,f.O)(this.networkStatus)&&this.observableQuery){var e=this.observableQuery.options.fetchPolicy;if("cache-only"!==e&&"cache-and-network"!==e)return!1}return!0},e.prototype.stop=function(){if(!this.stopped){this.stopped=!0,this.cancel(),delete this.cancel,this.subscriptions.forEach((function(e){return e.unsubscribe()}));var e=this.observableQuery;e&&e.stopPolling()}},e.prototype.cancel=function(){},e.prototype.updateWatch=function(e){var t=this;void 0===e&&(e=this.variables);var r=this.observableQuery;r&&"no-cache"===r.options.fetchPolicy||this.lastWatch&&this.lastWatch.query===this.document&&(0,u.D)(e,this.lastWatch.variables)||(this.cancel(),this.cancel=this.cache.watch(this.lastWatch={query:this.document,variables:e,optimistic:!0,callback:function(e){return t.setDiff(e)}}))},e.prototype.shouldWrite=function(e,t){var r=this.lastWrite;return!(r&&r.dmCount===y.get(this.cache)&&(0,u.D)(t,r.variables)&&(0,u.D)(e.data,r.result.data))},e.prototype.markResult=function(e,t,r){var n=this;this.graphQLErrors=(0,o.Of)(e.errors)?e.errors:[],g(this),"no-cache"===t.fetchPolicy?this.diff={result:e.data,complete:!0}:!this.stopped&&r&&(b(e,t.errorPolicy)?this.cache.performTransaction((function(r){if(n.shouldWrite(e,t.variables))r.writeQuery({query:n.document,data:e.data,variables:t.variables}),n.lastWrite={result:e,variables:t.variables,dmCount:y.get(n.cache)};else if(n.diff&&n.diff.complete)return void(e.data=n.diff.result);var i=r.diff({query:n.document,variables:t.variables,returnPartialData:!0,optimistic:!0});n.stopped||n.updateWatch(t.variables),n.diff=i,i.complete&&(e.data=i.result)})):this.lastWrite=void 0)},e.prototype.markReady=function(){return this.networkError=null,this.networkStatus=f.I.ready},e.prototype.markError=function(e){return this.networkStatus=f.I.error,this.lastWrite=void 0,g(this),e.graphQLErrors&&(this.graphQLErrors=e.graphQLErrors),e.networkError&&(this.networkError=e.networkError),e},e}();function b(e,t){void 0===t&&(t="none");var r="ignore"===t||"all"===t,n=!(0,o.d2)(e);return!n&&r&&e.data&&(n=!0),n}var E=Object.prototype.hasOwnProperty,S=function(){function e(e){var t=e.cache,r=e.link,n=e.queryDeduplication,i=void 0!==n&&n,a=e.onBroadcast,s=e.ssrMode,u=void 0!==s&&s,c=e.clientAwareness,l=void 0===c?{}:c,f=e.localState,h=e.assumeImmutableResults;this.clientAwareness={},this.queries=new Map,this.fetchCancelFns=new Map,this.transformCache=new(o.mr?WeakMap:Map),this.queryIdCounter=1,this.requestIdCounter=1,this.mutationIdCounter=1,this.inFlightLinkObservables=new Map,this.cache=t,this.link=r,this.queryDeduplication=i,this.clientAwareness=l,this.localState=f||new d({cache:t}),this.ssrMode=u,this.assumeImmutableResults=!!h,(this.onBroadcast=a)&&(this.mutationStore=Object.create(null))}return e.prototype.stop=function(){var e=this;this.queries.forEach((function(t,r){e.stopQueryNoBroadcast(r)})),this.cancelPendingFetches(new i.ej(12))},e.prototype.cancelPendingFetches=function(e){this.fetchCancelFns.forEach((function(t){return t(e)})),this.fetchCancelFns.clear()},e.prototype.mutate=function(e){var t=e.mutation,r=e.variables,a=e.optimisticResponse,s=e.updateQueries,u=e.refetchQueries,l=void 0===u?[]:u,f=e.awaitRefetchQueries,h=void 0!==f&&f,p=e.update,d=e.errorPolicy,y=void 0===d?"none":d,v=e.fetchPolicy,g=e.context,m=void 0===g?{}:g;return(0,n.mG)(this,void 0,void 0,(function(){var e,u,f;return(0,n.Jh)(this,(function(d){switch(d.label){case 0:return(0,i.kG)(t,13),(0,i.kG)(!v||"no-cache"===v,14),e=this.generateMutationId(),t=this.transform(t).document,r=this.getVariables(t,r),this.transform(t).hasClientExports?[4,this.localState.addExportedVariables(t,r,m)]:[3,2];case 1:r=d.sent(),d.label=2;case 2:return u=this.mutationStore&&(this.mutationStore[e]={mutation:t,variables:r,loading:!0,error:null}),a&&this.markMutationOptimistic(a,{mutationId:e,document:t,variables:r,errorPolicy:y,updateQueries:s,update:p}),this.broadcastQueries(),f=this,[2,new Promise((function(i,d){var g,b;f.getObservableFromLink(t,(0,n.pi)((0,n.pi)({},m),{optimisticResponse:a}),r,!1).subscribe({next:function(n){if((0,o.d2)(n)&&"none"===y)b=new c.c({graphQLErrors:n.errors});else{if(u&&(u.loading=!1,u.error=null),"no-cache"!==v)try{f.markMutationResult({mutationId:e,result:n,document:t,variables:r,errorPolicy:y,updateQueries:s,update:p})}catch(e){return void(b=new c.c({networkError:e}))}g=n}},error:function(t){u&&(u.loading=!1,u.error=t),a&&f.cache.removeOptimistic(e),f.broadcastQueries(),d(new c.c({networkError:t}))},complete:function(){if(b&&u&&(u.loading=!1,u.error=b),a&&f.cache.removeOptimistic(e),f.broadcastQueries(),b)d(b);else{"function"==typeof l&&(l=l(g));var t=[];(0,o.Of)(l)&&l.forEach((function(e){if("string"==typeof e)f.queries.forEach((function(r){var n=r.observableQuery;n&&n.queryName===e&&t.push(n.refetch())}));else{var r={query:e.query,variables:e.variables,fetchPolicy:"network-only"};e.context&&(r.context=e.context),t.push(f.query(r))}})),Promise.all(h?t:[]).then((function(){"ignore"===y&&g&&(0,o.d2)(g)&&delete g.errors,i(g)}),d)}}})}))]}}))}))},e.prototype.markMutationResult=function(e,t){var r=this;if(void 0===t&&(t=this.cache),b(e.result,e.errorPolicy)){var n=[{result:e.result.data,dataId:"ROOT_MUTATION",query:e.document,variables:e.variables}],i=e.updateQueries;i&&this.queries.forEach((function(a,s){var u=a.observableQuery,c=u&&u.queryName;if(c&&E.call(i,c)){var l=i[c],f=r.queries.get(s),h=f.document,p=f.variables,d=t.diff({query:h,variables:p,returnPartialData:!0,optimistic:!1}),y=d.result;if(d.complete&&y){var v=l(y,{mutationResult:e.result,queryName:h&&(0,o.rY)(h)||void 0,queryVariables:p});v&&n.push({result:v,dataId:"ROOT_QUERY",query:h,variables:p})}}})),t.performTransaction((function(t){n.forEach((function(e){return t.write(e)}));var r=e.update;r&&r(t,e.result)}),null)}},e.prototype.markMutationOptimistic=function(e,t){var r=this,i="function"==typeof e?e(t.variables):e;return this.cache.recordOptimisticTransaction((function(e){try{r.markMutationResult((0,n.pi)((0,n.pi)({},t),{result:{data:i}}),e)}catch(e){}}),t.mutationId)},e.prototype.fetchQuery=function(e,t,r){return this.fetchQueryObservable(e,t,r).promise},e.prototype.getQueryStore=function(){var e=Object.create(null);return this.queries.forEach((function(t,r){e[r]={variables:t.variables,networkStatus:t.networkStatus,networkError:t.networkError,graphQLErrors:t.graphQLErrors}})),e},e.prototype.resetErrors=function(e){var t=this.queries.get(e);t&&(t.networkError=void 0,t.graphQLErrors=[])},e.prototype.transform=function(e){var t=this.transformCache;if(!t.has(e)){var r=this.cache.transformDocument(e),n=(0,o.Fo)(this.cache.transformForLink(r)),i=this.localState.clientQuery(r),a=n&&this.localState.serverQuery(n),s={document:r,hasClientExports:(0,o.mj)(r),hasForcedResolvers:this.localState.shouldForceResolvers(r),clientQuery:i,serverQuery:a,defaultVars:(0,o.O4)((0,o.$H)(r))},u=function(e){e&&!t.has(e)&&t.set(e,s)};u(e),u(r),u(i),u(a)}return t.get(e)},e.prototype.getVariables=function(e,t){return(0,n.pi)((0,n.pi)({},this.transform(e).defaultVars),t)},e.prototype.watchQuery=function(e){void 0===(e=(0,n.pi)((0,n.pi)({},e),{variables:this.getVariables(e.query,e.variables)})).notifyOnNetworkStatusChange&&(e.notifyOnNetworkStatusChange=!1);var t=new m(this.cache),r=new l.u({queryManager:this,queryInfo:t,options:e});return this.queries.set(r.queryId,t),t.init({document:e.query,observableQuery:r,variables:e.variables}),r},e.prototype.query=function(e){var t=this;(0,i.kG)(e.query,15),(0,i.kG)("Document"===e.query.kind,16),(0,i.kG)(!e.returnPartialData,17),(0,i.kG)(!e.pollInterval,18);var r=this.generateQueryId();return this.fetchQuery(r,e).finally((function(){return t.stopQuery(r)}))},e.prototype.generateQueryId=function(){return String(this.queryIdCounter++)},e.prototype.generateRequestId=function(){return this.requestIdCounter++},e.prototype.generateMutationId=function(){return String(this.mutationIdCounter++)},e.prototype.stopQueryInStore=function(e){this.stopQueryInStoreNoBroadcast(e),this.broadcastQueries()},e.prototype.stopQueryInStoreNoBroadcast=function(e){var t=this.queries.get(e);t&&t.stop()},e.prototype.clearStore=function(){return this.cancelPendingFetches(new i.ej(19)),this.queries.forEach((function(e){e.observableQuery?e.networkStatus=f.I.loading:e.stop()})),this.mutationStore&&(this.mutationStore=Object.create(null)),this.cache.reset()},e.prototype.resetStore=function(){var e=this;return this.clearStore().then((function(){return e.reFetchObservableQueries()}))},e.prototype.reFetchObservableQueries=function(e){var t=this;void 0===e&&(e=!1);var r=[];return this.queries.forEach((function(n,i){var a=n.observableQuery;if(a&&a.hasObservers()){var o=a.options.fetchPolicy;a.resetLastResults(),"cache-only"===o||!e&&"standby"===o||r.push(a.refetch()),t.getQuery(i).setDiff(null)}})),this.broadcastQueries(),Promise.all(r)},e.prototype.setObservableQuery=function(e){this.getQuery(e.queryId).setObservableQuery(e)},e.prototype.startGraphQLSubscription=function(e){var t=this,r=e.query,n=e.fetchPolicy,i=e.errorPolicy,a=e.variables,s=e.context,u=void 0===s?{}:s;r=this.transform(r).document,a=this.getVariables(r,a);var l=function(e){return t.getObservableFromLink(r,u,e,!1).map((function(a){if("no-cache"!==n&&(b(a,i)&&t.cache.write({query:r,result:a.data,dataId:"ROOT_SUBSCRIPTION",variables:e}),t.broadcastQueries()),(0,o.d2)(a))throw new c.c({graphQLErrors:a.errors});return a}))};if(this.transform(r).hasClientExports){var f=this.localState.addExportedVariables(r,a,u).then(l);return new o.y$((function(e){var t=null;return f.then((function(r){return t=r.subscribe(e)}),e.error),function(){return t&&t.unsubscribe()}}))}return l(a)},e.prototype.stopQuery=function(e){this.stopQueryNoBroadcast(e),this.broadcastQueries()},e.prototype.stopQueryNoBroadcast=function(e){this.stopQueryInStoreNoBroadcast(e),this.removeQuery(e)},e.prototype.removeQuery=function(e){this.fetchCancelFns.delete(e),this.getQuery(e).stop(),this.queries.delete(e)},e.prototype.broadcastQueries=function(){this.onBroadcast&&this.onBroadcast(),this.queries.forEach((function(e){return e.notify()}))},e.prototype.getLocalState=function(){return this.localState},e.prototype.getObservableFromLink=function(e,t,r,i){var s,u,c=this;void 0===i&&(i=null!==(s=null==t?void 0:t.queryDeduplication)&&void 0!==s?s:this.queryDeduplication);var l=this.transform(e).serverQuery;if(l){var f=this.inFlightLinkObservables,h=this.link,p={query:l,variables:r,operationName:(0,o.rY)(l)||void 0,context:this.prepareContext((0,n.pi)((0,n.pi)({},t),{forceFetch:!i}))};if(t=p.context,i){var d=f.get(l)||new Map;f.set(l,d);var y=JSON.stringify(r);if(!(u=d.get(y))){var v=new o.X_([(0,a.ht)(h,p)]);d.set(y,u=v),v.cleanup((function(){d.delete(y)&&d.size<1&&f.delete(l)}))}}else u=new o.X_([(0,a.ht)(h,p)])}else u=new o.X_([o.y$.of({data:{}})]),t=this.prepareContext(t);var g=this.transform(e).clientQuery;return g&&(u=(0,o.sz)(u,(function(e){return c.localState.runResolvers({document:g,remoteResult:e,context:t,variables:r})}))),u},e.prototype.getResultsFromLink=function(e,t,r){var n=e.lastRequestId;return(0,o.sz)(this.getObservableFromLink(e.document,r.context,r.variables),(function(i){var a=(0,o.Of)(i.errors);if(n>=e.lastRequestId){if(a&&"none"===r.errorPolicy)throw e.markError(new c.c({graphQLErrors:i.errors}));e.markResult(i,r,t),e.markReady()}var s={data:i.data,loading:!1,networkStatus:e.networkStatus||f.I.ready};return a&&"ignore"!==r.errorPolicy&&(s.errors=i.errors),s}),(function(t){var r=(0,c.M)(t)?t:new c.c({networkError:t});throw n>=e.lastRequestId&&e.markError(r),r}))},e.prototype.fetchQueryObservable=function(e,t,r){var n=this;void 0===r&&(r=f.I.loading);var i=this.transform(t.query).document,a=this.getVariables(i,t.variables),s=this.getQuery(e),u=s.networkStatus,c=t.fetchPolicy,l=void 0===c?"cache-first":c,h=t.errorPolicy,p=void 0===h?"none":h,d=t.returnPartialData,y=void 0!==d&&d,v=t.notifyOnNetworkStatusChange,g=void 0!==v&&v,m=t.context,b=void 0===m?{}:m;("cache-first"===l||"cache-and-network"===l||"network-only"===l||"no-cache"===l)&&g&&"number"==typeof u&&u!==r&&(0,f.O)(r)&&("cache-first"!==l&&(l="cache-and-network"),y=!0);var E=Object.assign({},t,{query:i,variables:a,fetchPolicy:l,errorPolicy:p,returnPartialData:y,notifyOnNetworkStatusChange:g,context:b}),S=function(e){return E.variables=e,n.fetchQueryByPolicy(s,E,r)};this.fetchCancelFns.set(e,(function(e){Promise.resolve().then((function(){return C.cancel(e)}))}));var C=new o.X_(this.transform(E.query).hasClientExports?this.localState.addExportedVariables(E.query,E.variables,E.context).then(S):S(E.variables));return C.cleanup((function(){n.fetchCancelFns.delete(e);var r=t.nextFetchPolicy;r&&(t.nextFetchPolicy=void 0,t.fetchPolicy="function"==typeof r?r.call(t,t.fetchPolicy||"cache-first"):r)})),C},e.prototype.fetchQueryByPolicy=function(e,t,r){var i=this,a=t.query,s=t.variables,u=t.fetchPolicy,c=t.errorPolicy,l=t.returnPartialData,h=t.context;e.init({document:a,variables:s,lastRequestId:this.generateRequestId(),networkStatus:r});var p=function(){return e.getDiff(s)},d=function(t,r){void 0===r&&(r=e.networkStatus||f.I.loading);var u=t.result;var c=function(e){return o.y$.of((0,n.pi)({data:e,loading:(0,f.O)(r),networkStatus:r},t.complete?null:{partial:!0}))};return i.transform(a).hasForcedResolvers?i.localState.runResolvers({document:a,remoteResult:{data:u},context:h,variables:s,onlyRunForcedResolvers:!0}).then((function(e){return c(e.data)})):c(u)},y=function(t){return i.getResultsFromLink(e,t,{variables:s,context:h,fetchPolicy:u,errorPolicy:c})};switch(u){default:case"cache-first":return(v=p()).complete?[d(v,e.markReady())]:l?[d(v),y(!0)]:[y(!0)];case"cache-and-network":var v;return(v=p()).complete||l?[d(v),y(!0)]:[y(!0)];case"cache-only":return[d(p(),e.markReady())];case"network-only":return[y(!0)];case"no-cache":return[y(!1)];case"standby":return[]}},e.prototype.getQuery=function(e){return e&&!this.queries.has(e)&&this.queries.set(e,new m(this.cache)),this.queries.get(e)},e.prototype.prepareContext=function(e){void 0===e&&(e={});var t=this.localState.prepareContext(e);return(0,n.pi)((0,n.pi)({},t),{clientAwareness:this.clientAwareness})},e}();function C(e,t){return(0,o.oA)(e,t,t.variables&&{variables:(0,n.pi)((0,n.pi)({},e.variables),t.variables)})}var w=function(){function e(e){var t=this;this.defaultOptions={},this.resetStoreCallbacks=[],this.clearStoreCallbacks=[];var r=e.uri,n=e.credentials,o=e.headers,u=e.cache,c=e.ssrMode,l=void 0!==c&&c,f=e.ssrForceFetchDelay,h=void 0===f?0:f,p=e.connectToDevTools,y=void 0===p?"object"==typeof window&&!window.__APOLLO_CLIENT__&&!1:p,v=e.queryDeduplication,g=void 0===v||v,m=e.defaultOptions,b=e.assumeImmutableResults,E=void 0!==b&&b,C=e.resolvers,w=e.typeDefs,T=e.fragmentMatcher,A=e.name,I=e.version,k=e.link;if(k||(k=r?new s.uG({uri:r,credentials:n,headers:o}):a.i0.empty()),!u)throw new i.ej(9);this.link=k,this.cache=u,this.disableNetworkFetches=l||h>0,this.queryDeduplication=g,this.defaultOptions=m||{},this.typeDefs=w,h&&setTimeout((function(){return t.disableNetworkFetches=!1}),h),this.watchQuery=this.watchQuery.bind(this),this.query=this.query.bind(this),this.mutate=this.mutate.bind(this),this.resetStore=this.resetStore.bind(this),this.reFetchObservableQueries=this.reFetchObservableQueries.bind(this),y&&"object"==typeof window&&(window.__APOLLO_CLIENT__=this),this.version="3.3.9",this.localState=new d({cache:u,client:this,resolvers:C,fragmentMatcher:T}),this.queryManager=new S({cache:this.cache,link:this.link,queryDeduplication:g,ssrMode:l,clientAwareness:{name:A,version:I},localState:this.localState,assumeImmutableResults:E,onBroadcast:y?function(){t.devToolsHookCb&&t.devToolsHookCb({action:{},state:{queries:t.queryManager.getQueryStore(),mutations:t.queryManager.mutationStore||{}},dataWithOptimisticResults:t.cache.extract(!0)})}:void 0})}return e.prototype.stop=function(){this.queryManager.stop()},e.prototype.watchQuery=function(e){return this.defaultOptions.watchQuery&&(e=C(this.defaultOptions.watchQuery,e)),!this.disableNetworkFetches||"network-only"!==e.fetchPolicy&&"cache-and-network"!==e.fetchPolicy||(e=(0,n.pi)((0,n.pi)({},e),{fetchPolicy:"cache-first"})),this.queryManager.watchQuery(e)},e.prototype.query=function(e){return this.defaultOptions.query&&(e=C(this.defaultOptions.query,e)),(0,i.kG)("cache-and-network"!==e.fetchPolicy,10),this.disableNetworkFetches&&"network-only"===e.fetchPolicy&&(e=(0,n.pi)((0,n.pi)({},e),{fetchPolicy:"cache-first"})),this.queryManager.query(e)},e.prototype.mutate=function(e){return this.defaultOptions.mutate&&(e=C(this.defaultOptions.mutate,e)),this.queryManager.mutate(e)},e.prototype.subscribe=function(e){return this.queryManager.startGraphQLSubscription(e)},e.prototype.readQuery=function(e,t){return void 0===t&&(t=!1),this.cache.readQuery(e,t)},e.prototype.readFragment=function(e,t){return void 0===t&&(t=!1),this.cache.readFragment(e,t)},e.prototype.writeQuery=function(e){this.cache.writeQuery(e),this.queryManager.broadcastQueries()},e.prototype.writeFragment=function(e){this.cache.writeFragment(e),this.queryManager.broadcastQueries()},e.prototype.__actionHookForDevTools=function(e){this.devToolsHookCb=e},e.prototype.__requestRaw=function(e){return(0,a.ht)(this.link,e)},e.prototype.resetStore=function(){var e=this;return Promise.resolve().then((function(){return e.queryManager.clearStore()})).then((function(){return Promise.all(e.resetStoreCallbacks.map((function(e){return e()})))})).then((function(){return e.reFetchObservableQueries()}))},e.prototype.clearStore=function(){var e=this;return Promise.resolve().then((function(){return e.queryManager.clearStore()})).then((function(){return Promise.all(e.clearStoreCallbacks.map((function(e){return e()})))}))},e.prototype.onResetStore=function(e){var t=this;return this.resetStoreCallbacks.push(e),function(){t.resetStoreCallbacks=t.resetStoreCallbacks.filter((function(t){return t!==e}))}},e.prototype.onClearStore=function(e){var t=this;return this.clearStoreCallbacks.push(e),function(){t.clearStoreCallbacks=t.clearStoreCallbacks.filter((function(t){return t!==e}))}},e.prototype.reFetchObservableQueries=function(e){return this.queryManager.reFetchObservableQueries(e)},e.prototype.extract=function(e){return this.cache.extract(e)},e.prototype.restore=function(e){return this.cache.restore(e)},e.prototype.addResolvers=function(e){this.localState.addResolvers(e)},e.prototype.setResolvers=function(e){this.localState.setResolvers(e)},e.prototype.getResolvers=function(){return this.localState.getResolvers()},e.prototype.setLocalStateFragmentMatcher=function(e){this.localState.setFragmentMatcher(e)},e.prototype.setLink=function(e){this.link=this.queryManager.link=e},e}()},6282:function(e,t,r){"use strict";r.d(t,{u:function(){return c}});var n=r(655),i=r(2924),a=r(2152),o=r(5942),s=r(496),u=function(){function e(e,t,r,n){this.observer=e,this.options=t,this.fetch=r,this.shouldFetch=n}return e.prototype.reobserve=function(e,t){e?this.updateOptions(e):this.updatePolling();var r=this.fetch(this.options,t);return this.concast&&this.concast.removeObserver(this.observer,!0),r.addObserver(this.observer),(this.concast=r).promise},e.prototype.updateOptions=function(e){return Object.assign(this.options,(0,s.oA)(e)),this.updatePolling(),this},e.prototype.stop=function(){this.concast&&(this.concast.removeObserver(this.observer),delete this.concast),this.pollingInfo&&(clearTimeout(this.pollingInfo.timeout),this.options.pollInterval=0,this.updatePolling())},e.prototype.updatePolling=function(){var e=this,t=this.pollingInfo,r=this.options.pollInterval;if(r){if((!t||t.interval!==r)&&((0,i.kG)(r,20),!1!==this.shouldFetch)){(t||(this.pollingInfo={})).interval=r;var n=function(){e.pollingInfo&&(e.shouldFetch&&e.shouldFetch()?e.reobserve({fetchPolicy:"network-only",nextFetchPolicy:e.options.fetchPolicy||"cache-first"},o.I.poll).then(a,a):a())},a=function(){var t=e.pollingInfo;t&&(clearTimeout(t.timeout),t.timeout=setTimeout(n,t.interval))};a()}}else t&&(clearTimeout(t.timeout),delete this.pollingInfo)},e}(),c=function(e){function t(t){var r=t.queryManager,i=t.queryInfo,a=t.options,u=e.call(this,(function(e){return u.onSubscribe(e)}))||this;u.observers=new Set,u.subscriptions=new Set,u.observer={next:function(e){(u.lastError||u.isDifferentFromLastResult(e))&&(u.updateLastResult(e),(0,s.pM)(u.observers,"next",e))},error:function(e){u.updateLastResult((0,n.pi)((0,n.pi)({},u.lastResult),{error:e,errors:e.graphQLErrors,networkStatus:o.I.error,loading:!1})),(0,s.pM)(u.observers,"error",u.lastError=e)}},u.isTornDown=!1,u.options=a,u.queryId=r.generateQueryId();var c=(0,s.$H)(a.query);return u.queryName=c&&c.name&&c.name.value,u.queryManager=r,u.queryInfo=i,u}return(0,n.ZT)(t,e),Object.defineProperty(t.prototype,"variables",{get:function(){return this.options.variables},enumerable:!1,configurable:!0}),t.prototype.result=function(){var e=this;return new Promise((function(t,r){var n={next:function(r){t(r),e.observers.delete(n),e.observers.size||e.queryManager.removeQuery(e.queryId),setTimeout((function(){i.unsubscribe()}),0)},error:r},i=e.subscribe(n)}))},t.prototype.getCurrentResult=function(e){void 0===e&&(e=!0);var t=this.lastResult,r=this.queryInfo.networkStatus||t&&t.networkStatus||o.I.ready,i=(0,n.pi)((0,n.pi)({},t),{loading:(0,o.O)(r),networkStatus:r});if(this.isTornDown)return i;var a=this.options.fetchPolicy,s=void 0===a?"cache-first":a;if("no-cache"===s||"network-only"===s)delete i.partial;else if(!i.data||!this.queryManager.transform(this.options.query).hasForcedResolvers){var u=this.queryInfo.getDiff();i.data=u.complete||this.options.returnPartialData?u.result:void 0,u.complete?(i.networkStatus!==o.I.loading||"cache-first"!==s&&"cache-only"!==s||(i.networkStatus=o.I.ready,i.loading=!1),delete i.partial):i.partial=!0}return e&&this.updateLastResult(i),i},t.prototype.isDifferentFromLastResult=function(e){return!(0,a.D)(this.lastResultSnapshot,e)},t.prototype.getLastResult=function(){return this.lastResult},t.prototype.getLastError=function(){return this.lastError},t.prototype.resetLastResults=function(){delete this.lastResult,delete this.lastResultSnapshot,delete this.lastError,this.isTornDown=!1},t.prototype.resetQueryStoreErrors=function(){this.queryManager.resetErrors(this.queryId)},t.prototype.refetch=function(e){var t={pollInterval:0},r=this.options.fetchPolicy;return"no-cache"!==r&&"cache-and-network"!==r&&(t.fetchPolicy="network-only",t.nextFetchPolicy=r||"cache-first"),e&&!(0,a.D)(this.options.variables,e)&&(t.variables=this.options.variables=(0,n.pi)((0,n.pi)({},this.options.variables),e)),this.newReobserver(!1).reobserve(t,o.I.refetch)},t.prototype.fetchMore=function(e){var t=this,r=(0,n.pi)((0,n.pi)({},e.query?e:(0,n.pi)((0,n.pi)((0,n.pi)({},this.options),e),{variables:(0,n.pi)((0,n.pi)({},this.options.variables),e.variables)})),{fetchPolicy:"no-cache"}),i=this.queryManager.generateQueryId();return r.notifyOnNetworkStatusChange&&(this.queryInfo.networkStatus=o.I.fetchMore,this.observe()),this.queryManager.fetchQuery(i,r,o.I.fetchMore).then((function(n){var i=n.data,a=e.updateQuery;return a?t.updateQuery((function(e){return a(e,{fetchMoreResult:i,variables:r.variables})})):t.queryManager.cache.writeQuery({query:r.query,variables:r.variables,data:i}),n})).finally((function(){t.queryManager.stopQuery(i),t.reobserve()}))},t.prototype.subscribeToMore=function(e){var t=this,r=this.queryManager.startGraphQLSubscription({query:e.document,variables:e.variables,context:e.context}).subscribe({next:function(r){var n=e.updateQuery;n&&t.updateQuery((function(e,t){var i=t.variables;return n(e,{subscriptionData:r,variables:i})}))},error:function(t){e.onError&&e.onError(t)}});return this.subscriptions.add(r),function(){t.subscriptions.delete(r)&&r.unsubscribe()}},t.prototype.setOptions=function(e){return this.reobserve(e)},t.prototype.setVariables=function(e){if((0,a.D)(this.variables,e))return this.observers.size?this.result():Promise.resolve();if(this.options.variables=e,!this.observers.size)return Promise.resolve();var t=this.options.fetchPolicy,r=void 0===t?"cache-first":t,n={fetchPolicy:r,variables:e};return"cache-first"!==r&&"no-cache"!==r&&"network-only"!==r&&(n.fetchPolicy="cache-and-network",n.nextFetchPolicy=r),this.reobserve(n,o.I.setVariables)},t.prototype.updateQuery=function(e){var t,r=this.queryManager,n=e(r.cache.diff({query:this.options.query,variables:this.variables,previousResult:null===(t=this.lastResult)||void 0===t?void 0:t.data,returnPartialData:!0,optimistic:!1}).result,{variables:this.variables});n&&(r.cache.writeQuery({query:this.options.query,data:n,variables:this.variables}),r.broadcastQueries())},t.prototype.startPolling=function(e){this.getReobserver().updateOptions({pollInterval:e})},t.prototype.stopPolling=function(){this.reobserver&&this.reobserver.updateOptions({pollInterval:0})},t.prototype.updateLastResult=function(e){var t=this.lastResult;return this.lastResult=e,this.lastResultSnapshot=this.queryManager.assumeImmutableResults?e:(0,s.Xh)(e),(0,s.Of)(e.errors)||delete this.lastError,t},t.prototype.onSubscribe=function(e){var t=this;if(e===this.observer)return function(){};try{var r=e._subscription._observer;r&&!r.error&&(r.error=l)}catch(e){}var n=!this.observers.size;return this.observers.add(e),this.lastError?e.error&&e.error(this.lastError):this.lastResult&&e.next&&e.next(this.lastResult),n&&this.reobserve().catch((function(e){})),function(){t.observers.delete(e)&&!t.observers.size&&t.tearDownQuery()}},t.prototype.getReobserver=function(){return this.reobserver||(this.reobserver=this.newReobserver(!0))},t.prototype.newReobserver=function(e){var t=this,r=this.queryManager,i=this.queryId;return r.setObservableQuery(this),new u(this.observer,e?this.options:(0,n.pi)({},this.options),(function(e,n){return r.setObservableQuery(t),r.fetchQueryObservable(i,e,n)}),!r.ssrMode&&function(){return!(0,o.O)(t.queryInfo.networkStatus)})},t.prototype.reobserve=function(e,t){return this.isTornDown=!1,this.getReobserver().reobserve(e,t)},t.prototype.observe=function(){this.observer.next(this.getCurrentResult(!1))},t.prototype.hasObservers=function(){return this.observers.size>0},t.prototype.tearDownQuery=function(){this.isTornDown||(this.reobserver&&(this.reobserver.stop(),delete this.reobserver),delete this.options.context,this.subscriptions.forEach((function(e){return e.unsubscribe()})),this.subscriptions.clear(),this.queryManager.stopQuery(this.queryId),this.observers.clear(),this.isTornDown=!0)},t}(s.y$);function l(e){}(0,s.Dy)(c)},1439:function(e,t,r){"use strict";r.d(t,{fe:function(){return n.f},h4:function(){return a.h4},HttpLink:function(){return u.uG}});var n=r(5765),i=(r(6282),r(5942),r(2191));r.o(i,"HttpLink")&&r.d(t,{HttpLink:function(){return i.HttpLink}});r(1498);var a=r(2634),o=r(5367);r.o(o,"HttpLink")&&r.d(t,{HttpLink:function(){return o.HttpLink}});var s=r(1707);r.o(s,"HttpLink")&&r.d(t,{HttpLink:function(){return s.HttpLink}});var u=r(9950),c=(r(4913),r(496),r(2924)),l=r(1466);(0,c.U6)("log");l.ZP.resetCaches,l.ZP.disableFragmentWarnings,l.ZP.enableExperimentalFragmentVariables,l.ZP.disableExperimentalFragmentVariables},5942:function(e,t,r){"use strict";var n;function i(e){return!!e&&e<7}r.d(t,{I:function(){return n},O:function(){return i}}),function(e){e[e.loading=1]="loading",e[e.setVariables=2]="setVariables",e[e.fetchMore=3]="fetchMore",e[e.refetch=4]="refetch",e[e.poll=6]="poll",e[e.ready=7]="ready",e[e.error=8]="error"}(n||(n={}))},2191:function(){},1498:function(e,t,r){"use strict";r.d(t,{M:function(){return a},c:function(){return o}});var n=r(655),i=r(496);function a(e){return e.hasOwnProperty("graphQLErrors")}var o=function(e){function t(r){var n,a,o=r.graphQLErrors,s=r.networkError,u=r.errorMessage,c=r.extraInfo,l=e.call(this,u)||this;return l.graphQLErrors=o||[],l.networkError=s||null,l.message=u||(n=l,a="",(0,i.Of)(n.graphQLErrors)&&n.graphQLErrors.forEach((function(e){var t=e?e.message:"Error message not found.";a+=t+"\n"})),n.networkError&&(a+=n.networkError.message+"\n"),a=a.replace(/\n$/,"")),l.extraInfo=c,l.__proto__=t.prototype,l}return(0,n.ZT)(t,e),t}(Error)},7222:function(e,t,r){"use strict";r.d(t,{i:function(){return l}});var n=r(655),i=r(2924),a=r(496),o=r(4913);function s(e,t){return t?t(e):a.y$.of()}function u(e){return"function"==typeof e?new l(e):e}function c(e){return e.request.length<=1}!function(e){function t(t,r){var n=e.call(this,t)||this;return n.link=r,n}(0,n.ZT)(t,e)}(Error);var l=function(){function e(e){e&&(this.request=e)}return e.empty=function(){return new e((function(){return a.y$.of()}))},e.from=function(t){return 0===t.length?e.empty():t.map(u).reduce((function(e,t){return e.concat(t)}))},e.split=function(t,r,n){var i=u(r),o=u(n||new e(s));return c(i)&&c(o)?new e((function(e){return t(e)?i.request(e)||a.y$.of():o.request(e)||a.y$.of()})):new e((function(e,r){return t(e)?i.request(e,r)||a.y$.of():o.request(e,r)||a.y$.of()}))},e.execute=function(e,t){return e.request((0,o.zi)(t.context,(0,o.DQ)((0,o.Ak)(t))))||a.y$.of()},e.concat=function(t,r){var n=u(t);if(c(n))return n;var i=u(r);return c(i)?new e((function(e){return n.request(e,(function(e){return i.request(e)||a.y$.of()}))||a.y$.of()})):new e((function(e,t){return n.request(e,(function(e){return i.request(e,t)||a.y$.of()}))||a.y$.of()}))},e.prototype.split=function(t,r,n){return this.concat(e.split(t,r,n||new e(s)))},e.prototype.concat=function(t){return e.concat(this,t)},e.prototype.request=function(e,t){throw new i.ej(21)},e.prototype.onError=function(e,t){if(t&&t.error)return t.error(e),!1;throw e},e.prototype.setOnError=function(e){return this.onError=e,this},e}()},4957:function(e,t,r){"use strict";r(7222).i.concat},7325:function(e,t,r){"use strict";r(7222).i.empty},2550:function(e,t,r){"use strict";r.d(t,{h:function(){return n}});var n=r(7222).i.execute},4674:function(e,t,r){"use strict";r(7222).i.from},1707:function(e,t,r){"use strict";r.d(t,{ht:function(){return n.h},i0:function(){return i.i}});r(7325),r(4674),r(4738),r(4957);var n=r(2550),i=r(7222),a=r(9875);r.o(a,"HttpLink")&&r.d(t,{HttpLink:function(){return a.HttpLink}})},4738:function(e,t,r){"use strict";r(7222).i.split},9875:function(){},9950:function(e,t,r){"use strict";r.d(t,{uG:function(){return T}});var n=r(4913),i=Object.prototype.hasOwnProperty;var a=r(2924),o=function(e,t){var r;try{r=JSON.stringify(e)}catch(e){var n=new a.ej(23);throw n.parseError=e,n}return r},s=r(655),u=r(7636),c=r(7420);function l(e){return(0,u.Vn)(e,{leave:f})}var f={Name:function(e){return e.value},Variable:function(e){return"$"+e.name},Document:function(e){return p(e.definitions,"\n\n")+"\n"},OperationDefinition:function(e){var t=e.operation,r=e.name,n=y("(",p(e.variableDefinitions,", "),")"),i=p(e.directives," "),a=e.selectionSet;return r||i||n||"query"!==t?p([t,p([r,n]),i,a]," "):a},VariableDefinition:function(e){var t=e.variable,r=e.type,n=e.defaultValue,i=e.directives;return t+": "+r+y(" = ",n)+y(" ",p(i," "))},SelectionSet:function(e){return d(e.selections)},Field:function(e){var t=e.alias,r=e.name,n=e.arguments,i=e.directives,a=e.selectionSet,o=y("",t,": ")+r,s=o+y("(",p(n,", "),")");return s.length>80&&(s=o+y("(\n",v(p(n,"\n")),"\n)")),p([s,p(i," "),a]," ")},Argument:function(e){return e.name+": "+e.value},FragmentSpread:function(e){return"..."+e.name+y(" ",p(e.directives," "))},InlineFragment:function(e){var t=e.typeCondition,r=e.directives,n=e.selectionSet;return p(["...",y("on ",t),p(r," "),n]," ")},FragmentDefinition:function(e){var t=e.name,r=e.typeCondition,n=e.variableDefinitions,i=e.directives,a=e.selectionSet;return"fragment ".concat(t).concat(y("(",p(n,", "),")")," ")+"on ".concat(r," ").concat(y("",p(i," ")," "))+a},IntValue:function(e){return e.value},FloatValue:function(e){return e.value},StringValue:function(e,t){var r=e.value;return e.block?(0,c.LZ)(r,"description"===t?"":" "):JSON.stringify(r)},BooleanValue:function(e){return e.value?"true":"false"},NullValue:function(){return"null"},EnumValue:function(e){return e.value},ListValue:function(e){return"["+p(e.values,", ")+"]"},ObjectValue:function(e){return"{"+p(e.fields,", ")+"}"},ObjectField:function(e){return e.name+": "+e.value},Directive:function(e){return"@"+e.name+y("(",p(e.arguments,", "),")")},NamedType:function(e){return e.name},ListType:function(e){return"["+e.type+"]"},NonNullType:function(e){return e.type+"!"},SchemaDefinition:h((function(e){var t=e.directives,r=e.operationTypes;return p(["schema",p(t," "),d(r)]," ")})),OperationTypeDefinition:function(e){return e.operation+": "+e.type},ScalarTypeDefinition:h((function(e){return p(["scalar",e.name,p(e.directives," ")]," ")})),ObjectTypeDefinition:h((function(e){var t=e.name,r=e.interfaces,n=e.directives,i=e.fields;return p(["type",t,y("implements ",p(r," & ")),p(n," "),d(i)]," ")})),FieldDefinition:h((function(e){var t=e.name,r=e.arguments,n=e.type,i=e.directives;return t+(m(r)?y("(\n",v(p(r,"\n")),"\n)"):y("(",p(r,", "),")"))+": "+n+y(" ",p(i," "))})),InputValueDefinition:h((function(e){var t=e.name,r=e.type,n=e.defaultValue,i=e.directives;return p([t+": "+r,y("= ",n),p(i," ")]," ")})),InterfaceTypeDefinition:h((function(e){var t=e.name,r=e.interfaces,n=e.directives,i=e.fields;return p(["interface",t,y("implements ",p(r," & ")),p(n," "),d(i)]," ")})),UnionTypeDefinition:h((function(e){var t=e.name,r=e.directives,n=e.types;return p(["union",t,p(r," "),n&&0!==n.length?"= "+p(n," | "):""]," ")})),EnumTypeDefinition:h((function(e){var t=e.name,r=e.directives,n=e.values;return p(["enum",t,p(r," "),d(n)]," ")})),EnumValueDefinition:h((function(e){return p([e.name,p(e.directives," ")]," ")})),InputObjectTypeDefinition:h((function(e){var t=e.name,r=e.directives,n=e.fields;return p(["input",t,p(r," "),d(n)]," ")})),DirectiveDefinition:h((function(e){var t=e.name,r=e.arguments,n=e.repeatable,i=e.locations;return"directive @"+t+(m(r)?y("(\n",v(p(r,"\n")),"\n)"):y("(",p(r,", "),")"))+(n?" repeatable":"")+" on "+p(i," | ")})),SchemaExtension:function(e){var t=e.directives,r=e.operationTypes;return p(["extend schema",p(t," "),d(r)]," ")},ScalarTypeExtension:function(e){return p(["extend scalar",e.name,p(e.directives," ")]," ")},ObjectTypeExtension:function(e){var t=e.name,r=e.interfaces,n=e.directives,i=e.fields;return p(["extend type",t,y("implements ",p(r," & ")),p(n," "),d(i)]," ")},InterfaceTypeExtension:function(e){var t=e.name,r=e.interfaces,n=e.directives,i=e.fields;return p(["extend interface",t,y("implements ",p(r," & ")),p(n," "),d(i)]," ")},UnionTypeExtension:function(e){var t=e.name,r=e.directives,n=e.types;return p(["extend union",t,p(r," "),n&&0!==n.length?"= "+p(n," | "):""]," ")},EnumTypeExtension:function(e){var t=e.name,r=e.directives,n=e.values;return p(["extend enum",t,p(r," "),d(n)]," ")},InputObjectTypeExtension:function(e){var t=e.name,r=e.directives,n=e.fields;return p(["extend input",t,p(r," "),d(n)]," ")}};function h(e){return function(t){return p([t.description,e(t)],"\n")}}function p(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return null!==(t=null==e?void 0:e.filter((function(e){return e})).join(r))&&void 0!==t?t:""}function d(e){return y("{\n",v(p(e,"\n")),"\n}")}function y(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return null!=t&&""!==t?e+t+r:""}function v(e){return y(" ",e.replace(/\n/g,"\n "))}function g(e){return-1!==e.indexOf("\n")}function m(e){return null!=e&&e.some(g)}var b={http:{includeQuery:!0,includeExtensions:!1},headers:{accept:"*/*","content-type":"application/json"},options:{method:"POST"}},E=r(285),S=r(1707),C=r(496);var w=function(e){void 0===e&&(e={});var t=e.uri,r=void 0===t?"/graphql":t,u=e.fetch,c=e.includeExtensions,f=e.useGETForQueries,h=e.includeUnusedVariables,p=void 0!==h&&h,d=(0,s._T)(e,["uri","fetch","includeExtensions","useGETForQueries","includeUnusedVariables"]);!function(e){if(!e&&"undefined"==typeof fetch)throw new a.ej(22)}(u),u||(u=fetch);var y={http:{includeExtensions:c},options:d.fetchOptions,credentials:d.credentials,headers:d.headers};return new S.i0((function(e){var t=function(e,t){return e.getContext().uri||("function"==typeof t?t(e):t||"/graphql")}(e,r),a=e.getContext(),c={};if(a.clientAwareness){var h=a.clientAwareness,d=h.name,v=h.version;d&&(c["apollographql-client-name"]=d),v&&(c["apollographql-client-version"]=v)}var g,m=(0,s.pi)((0,s.pi)({},c),a.headers),S={http:a.http,options:a.fetchOptions,credentials:a.credentials,headers:m},w=function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var i=(0,s.pi)((0,s.pi)({},t.options),{headers:t.headers,credentials:t.credentials}),a=t.http||{};r.forEach((function(e){i=(0,s.pi)((0,s.pi)((0,s.pi)({},i),e.options),{headers:(0,s.pi)((0,s.pi)({},i.headers),e.headers)}),e.credentials&&(i.credentials=e.credentials),a=(0,s.pi)((0,s.pi)({},a),e.http)}));var o=e.operationName,u=e.extensions,c=e.variables,f=e.query,h={operationName:o,variables:c};return a.includeExtensions&&(h.extensions=u),a.includeQuery&&(h.query=l(f)),{options:i,body:h}}(e,b,y,S),T=w.options,A=w.body;if(A.variables&&!p){var I=new Set(Object.keys(A.variables));(0,E.Vn)(e.query,{Variable:function(e,t,r){r&&"VariableDefinition"!==r.kind&&I.delete(e.name.value)}}),I.size&&(A.variables=(0,s.pi)({},A.variables),I.forEach((function(e){delete A.variables[e]})))}if(!T.signal){var k=function(){if("undefined"==typeof AbortController)return{controller:!1,signal:!1};var e=new AbortController;return{controller:e,signal:e.signal}}(),_=k.controller,B=k.signal;(g=_)&&(T.signal=B)}if(f&&!e.query.definitions.some((function(e){return"OperationDefinition"===e.kind&&"mutation"===e.operation}))&&(T.method="GET"),"GET"===T.method){var N=function(e,t){var r=[],n=function(e,t){r.push(e+"="+encodeURIComponent(t))};if("query"in t&&n("query",t.query),t.operationName&&n("operationName",t.operationName),t.variables){var i=void 0;try{i=o(t.variables)}catch(e){return{parseError:e}}n("variables",i)}if(t.extensions){var a=void 0;try{a=o(t.extensions)}catch(e){return{parseError:e}}n("extensions",a)}var s="",u=e,c=e.indexOf("#");-1!==c&&(s=e.substr(c),u=e.substr(0,c));var l=-1===u.indexOf("?")?"?":"&";return{newURI:u+l+r.join("&")+s}}(t,A),O=N.newURI,R=N.parseError;if(R)return(0,n.Qc)(R);t=O}else try{T.body=o(A)}catch(R){return(0,n.Qc)(R)}return new C.y$((function(r){var a;return u(t,T).then((function(t){return e.setContext({response:t}),t})).then((a=e,function(e){return e.text().then((function(t){try{return JSON.parse(t)}catch(n){var r=n;throw r.name="ServerParseError",r.response=e,r.statusCode=e.status,r.bodyText=t,r}})).then((function(t){return e.status>=300&&(0,n.PW)(e,t,"Response not successful: Received status code "+e.status),Array.isArray(t)||i.call(t,"data")||i.call(t,"errors")||(0,n.PW)(e,t,"Server response was missing for query '"+(Array.isArray(a)?a.map((function(e){return e.operationName})):a.operationName)+"'."),t}))})).then((function(e){return r.next(e),r.complete(),e})).catch((function(e){"AbortError"!==e.name&&(e.result&&e.result.errors&&e.result.data&&r.next(e.result),r.error(e))})),function(){g&&g.abort()}}))}))},T=function(e){function t(t){void 0===t&&(t={});var r=e.call(this,w(t).request)||this;return r.options=t,r}return(0,s.ZT)(t,e),t}(S.i0)},4913:function(e,t,r){"use strict";r.d(t,{zi:function(){return c},Qc:function(){return i},PW:function(){return o},DQ:function(){return l},Ak:function(){return s}});var n=r(496);function i(e){return new n.y$((function(t){t.error(e)}))}var a=r(2924);var o=function(e,t,r){var n=new Error(r);throw n.name="ServerError",n.response=e,n.statusCode=e.status,n.result=t,n};function s(e){for(var t=["query","operationName","variables","extensions","context"],r=0,n=Object.keys(e);r<n.length;r++){var i=n[r];if(t.indexOf(i)<0)throw new a.ej(26)}return e}var u=r(655);function c(e,t){var r=(0,u.pi)({},e);return Object.defineProperty(t,"setContext",{enumerable:!1,value:function(e){r="function"==typeof e?(0,u.pi)((0,u.pi)({},r),e(r)):(0,u.pi)((0,u.pi)({},r),e)}}),Object.defineProperty(t,"getContext",{enumerable:!1,value:function(){return(0,u.pi)({},r)}}),t}function l(e){var t={variables:e.variables||{},extensions:e.extensions||{},operationName:e.operationName,query:e.query};return t.operationName||(t.operationName="string"!=typeof t.query?(0,n.rY)(t.query)||void 0:""),t}},1466:function(e,t,r){"use strict";r.d(t,{ZP:function(){return ee}});var n=r(655);function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}"function"==typeof Symbol&&null!=Symbol.iterator&&Symbol.iterator,"function"==typeof Symbol&&null!=Symbol.asyncIterator&&Symbol.asyncIterator;var a="function"==typeof Symbol&&null!=Symbol.toStringTag?Symbol.toStringTag:"@@toStringTag";function o(e,t){for(var r,n=/\r\n|[\n\r]/g,i=1,a=t+1;(r=n.exec(e.body))&&r.index<t;)i+=1,a=t+1-(r.index+r[0].length);return{line:i,column:a}}function s(e){return u(e.source,o(e.source,e.start))}function u(e,t){var r=e.locationOffset.column-1,n=l(r)+e.body,i=t.line-1,a=e.locationOffset.line-1,o=t.line+a,s=1===t.line?r:0,u=t.column+s,f="".concat(e.name,":").concat(o,":").concat(u,"\n"),h=n.split(/\r\n|[\n\r]/g),p=h[i];if(p.length>120){for(var d=Math.floor(u/80),y=u%80,v=[],g=0;g<p.length;g+=80)v.push(p.slice(g,g+80));return f+c([["".concat(o),v[0]]].concat(v.slice(1,d+1).map((function(e){return["",e]})),[[" ",l(y-1)+"^"],["",v[d+1]]]))}return f+c([["".concat(o-1),h[i-1]],["".concat(o),p],["",l(u-1)+"^"],["".concat(o+1),h[i+1]]])}function c(e){var t=e.filter((function(e){e[0];return void 0!==e[1]})),r=Math.max.apply(Math,t.map((function(e){return e[0].length})));return t.map((function(e){var t,n=e[0],i=e[1];return l(r-(t=n).length)+t+(i?" | "+i:" |")})).join("\n")}function l(e){return Array(e+1).join(" ")}function f(e){return(f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function h(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function p(e,t){return!t||"object"!==f(t)&&"function"!=typeof t?d(e):t}function d(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function y(e){var t="function"==typeof Map?new Map:void 0;return(y=function(e){if(null===e||(r=e,-1===Function.toString.call(r).indexOf("[native code]")))return e;var r;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return v(e,arguments,b(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),m(n,e)})(e)}function v(e,t,r){return(v=g()?Reflect.construct:function(e,t,r){var n=[null];n.push.apply(n,t);var i=new(Function.bind.apply(e,n));return r&&m(i,r.prototype),i}).apply(null,arguments)}function g(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}function m(e,t){return(m=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function b(e){return(b=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var E=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&m(e,t)}(y,e);var t,r,n,c,l,f=(t=y,r=g(),function(){var e,n=b(t);if(r){var i=b(this).constructor;e=Reflect.construct(n,arguments,i)}else e=n.apply(this,arguments);return p(this,e)});function y(e,t,r,n,a,s,u){var c,l,h,v,g;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,y),g=f.call(this,e);var m,b=Array.isArray(t)?0!==t.length?t:void 0:t?[t]:void 0,E=r;!E&&b&&(E=null===(m=b[0].loc)||void 0===m?void 0:m.source);var S,C=n;!C&&b&&(C=b.reduce((function(e,t){return t.loc&&e.push(t.loc.start),e}),[])),C&&0===C.length&&(C=void 0),n&&r?S=n.map((function(e){return o(r,e)})):b&&(S=b.reduce((function(e,t){return t.loc&&e.push(o(t.loc.source,t.loc.start)),e}),[]));var w,T=u;if(null==T&&null!=s){var A=s.extensions;"object"==i(w=A)&&null!==w&&(T=A)}return Object.defineProperties(d(g),{name:{value:"GraphQLError"},message:{value:e,enumerable:!0,writable:!0},locations:{value:null!==(c=S)&&void 0!==c?c:void 0,enumerable:null!=S},path:{value:null!=a?a:void 0,enumerable:null!=a},nodes:{value:null!=b?b:void 0},source:{value:null!==(l=E)&&void 0!==l?l:void 0},positions:{value:null!==(h=C)&&void 0!==h?h:void 0},originalError:{value:s},extensions:{value:null!==(v=T)&&void 0!==v?v:void 0,enumerable:null!=T}}),null!=s&&s.stack?(Object.defineProperty(d(g),"stack",{value:s.stack,writable:!0,configurable:!0}),p(g)):(Error.captureStackTrace?Error.captureStackTrace(d(g),y):Object.defineProperty(d(g),"stack",{value:Error().stack,writable:!0,configurable:!0}),g)}return n=y,(c=[{key:"toString",value:function(){return function(e){var t=e.message;if(e.nodes)for(var r=0,n=e.nodes;r<n.length;r++){var i=n[r];i.loc&&(t+="\n\n"+s(i.loc))}else if(e.source&&e.locations)for(var a=0,o=e.locations;a<o.length;a++){var c=o[a];t+="\n\n"+u(e.source,c)}return t}(this)}},{key:a,get:function(){return"Object"}}])&&h(n.prototype,c),l&&h(n,l),y}(y(Error));function S(e,t,r){return new E("Syntax Error: ".concat(r),void 0,e,[t])}var C=Object.freeze({NAME:"Name",DOCUMENT:"Document",OPERATION_DEFINITION:"OperationDefinition",VARIABLE_DEFINITION:"VariableDefinition",SELECTION_SET:"SelectionSet",FIELD:"Field",ARGUMENT:"Argument",FRAGMENT_SPREAD:"FragmentSpread",INLINE_FRAGMENT:"InlineFragment",FRAGMENT_DEFINITION:"FragmentDefinition",VARIABLE:"Variable",INT:"IntValue",FLOAT:"FloatValue",STRING:"StringValue",BOOLEAN:"BooleanValue",NULL:"NullValue",ENUM:"EnumValue",LIST:"ListValue",OBJECT:"ObjectValue",OBJECT_FIELD:"ObjectField",DIRECTIVE:"Directive",NAMED_TYPE:"NamedType",LIST_TYPE:"ListType",NON_NULL_TYPE:"NonNullType",SCHEMA_DEFINITION:"SchemaDefinition",OPERATION_TYPE_DEFINITION:"OperationTypeDefinition",SCALAR_TYPE_DEFINITION:"ScalarTypeDefinition",OBJECT_TYPE_DEFINITION:"ObjectTypeDefinition",FIELD_DEFINITION:"FieldDefinition",INPUT_VALUE_DEFINITION:"InputValueDefinition",INTERFACE_TYPE_DEFINITION:"InterfaceTypeDefinition",UNION_TYPE_DEFINITION:"UnionTypeDefinition",ENUM_TYPE_DEFINITION:"EnumTypeDefinition",ENUM_VALUE_DEFINITION:"EnumValueDefinition",INPUT_OBJECT_TYPE_DEFINITION:"InputObjectTypeDefinition",DIRECTIVE_DEFINITION:"DirectiveDefinition",SCHEMA_EXTENSION:"SchemaExtension",SCALAR_TYPE_EXTENSION:"ScalarTypeExtension",OBJECT_TYPE_EXTENSION:"ObjectTypeExtension",INTERFACE_TYPE_EXTENSION:"InterfaceTypeExtension",UNION_TYPE_EXTENSION:"UnionTypeExtension",ENUM_TYPE_EXTENSION:"EnumTypeExtension",INPUT_OBJECT_TYPE_EXTENSION:"InputObjectTypeExtension"}),w=r(3059),T=Object.freeze({SOF:"<SOF>",EOF:"<EOF>",BANG:"!",DOLLAR:"$",AMP:"&",PAREN_L:"(",PAREN_R:")",SPREAD:"...",COLON:":",EQUALS:"=",AT:"@",BRACKET_L:"[",BRACKET_R:"]",BRACE_L:"{",PIPE:"|",BRACE_R:"}",NAME:"Name",INT:"Int",FLOAT:"Float",STRING:"String",BLOCK_STRING:"BlockString",COMMENT:"Comment"}),A=r(6589);function I(e,t){if(!Boolean(e))throw new Error(t)}var k=function(e,t){return e instanceof t};function _(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var B=function(){function e(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"GraphQL request",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{line:1,column:1};"string"==typeof e||I(0,"Body must be a string. Received: ".concat((0,A.Z)(e),".")),this.body=e,this.name=t,this.locationOffset=r,this.locationOffset.line>0||I(0,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||I(0,"column in locationOffset is 1-indexed and must be positive.")}var t,r,n;return t=e,(r=[{key:a,get:function(){return"Source"}}])&&_(t.prototype,r),n&&_(t,n),e}();var N=Object.freeze({QUERY:"QUERY",MUTATION:"MUTATION",SUBSCRIPTION:"SUBSCRIPTION",FIELD:"FIELD",FRAGMENT_DEFINITION:"FRAGMENT_DEFINITION",FRAGMENT_SPREAD:"FRAGMENT_SPREAD",INLINE_FRAGMENT:"INLINE_FRAGMENT",VARIABLE_DEFINITION:"VARIABLE_DEFINITION",SCHEMA:"SCHEMA",SCALAR:"SCALAR",OBJECT:"OBJECT",FIELD_DEFINITION:"FIELD_DEFINITION",ARGUMENT_DEFINITION:"ARGUMENT_DEFINITION",INTERFACE:"INTERFACE",UNION:"UNION",ENUM:"ENUM",ENUM_VALUE:"ENUM_VALUE",INPUT_OBJECT:"INPUT_OBJECT",INPUT_FIELD_DEFINITION:"INPUT_FIELD_DEFINITION"}),O=r(7420),R=function(){function e(e){var t=new w.WU(T.SOF,0,0,0,0,null);this.source=e,this.lastToken=t,this.token=t,this.line=1,this.lineStart=0}var t=e.prototype;return t.advance=function(){return this.lastToken=this.token,this.token=this.lookahead()},t.lookahead=function(){var e=this.token;if(e.kind!==T.EOF)do{var t;e=null!==(t=e.next)&&void 0!==t?t:e.next=P(this,e)}while(e.kind===T.COMMENT);return e},e}();function x(e){return isNaN(e)?T.EOF:e<127?JSON.stringify(String.fromCharCode(e)):'"\\u'.concat(("00"+e.toString(16).toUpperCase()).slice(-4),'"')}function P(e,t){for(var r=e.source,n=r.body,i=n.length,a=t.end;a<i;){var o=n.charCodeAt(a),s=e.line,u=1+a-e.lineStart;switch(o){case 65279:case 9:case 32:case 44:++a;continue;case 10:++a,++e.line,e.lineStart=a;continue;case 13:10===n.charCodeAt(a+1)?a+=2:++a,++e.line,e.lineStart=a;continue;case 33:return new w.WU(T.BANG,a,a+1,s,u,t);case 35:return D(r,a,s,u,t);case 36:return new w.WU(T.DOLLAR,a,a+1,s,u,t);case 38:return new w.WU(T.AMP,a,a+1,s,u,t);case 40:return new w.WU(T.PAREN_L,a,a+1,s,u,t);case 41:return new w.WU(T.PAREN_R,a,a+1,s,u,t);case 46:if(46===n.charCodeAt(a+1)&&46===n.charCodeAt(a+2))return new w.WU(T.SPREAD,a,a+3,s,u,t);break;case 58:return new w.WU(T.COLON,a,a+1,s,u,t);case 61:return new w.WU(T.EQUALS,a,a+1,s,u,t);case 64:return new w.WU(T.AT,a,a+1,s,u,t);case 91:return new w.WU(T.BRACKET_L,a,a+1,s,u,t);case 93:return new w.WU(T.BRACKET_R,a,a+1,s,u,t);case 123:return new w.WU(T.BRACE_L,a,a+1,s,u,t);case 124:return new w.WU(T.PIPE,a,a+1,s,u,t);case 125:return new w.WU(T.BRACE_R,a,a+1,s,u,t);case 34:return 34===n.charCodeAt(a+1)&&34===n.charCodeAt(a+2)?V(r,a,s,u,t,e):j(r,a,s,u,t);case 45:case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return L(r,a,o,s,u,t);case 65:case 66:case 67:case 68:case 69:case 70:case 71:case 72:case 73:case 74:case 75:case 76:case 77:case 78:case 79:case 80:case 81:case 82:case 83:case 84:case 85:case 86:case 87:case 88:case 89:case 90:case 95:case 97:case 98:case 99:case 100:case 101:case 102:case 103:case 104:case 105:case 106:case 107:case 108:case 109:case 110:case 111:case 112:case 113:case 114:case 115:case 116:case 117:case 118:case 119:case 120:case 121:case 122:return M(r,a,s,u,t)}throw S(r,a,F(o))}var c=e.line,l=1+a-e.lineStart;return new w.WU(T.EOF,i,i,c,l,t)}function F(e){return e<32&&9!==e&&10!==e&&13!==e?"Cannot contain the invalid character ".concat(x(e),"."):39===e?"Unexpected single quote character ('), did you mean to use a double quote (\")?":"Cannot parse the unexpected character ".concat(x(e),".")}function D(e,t,r,n,i){var a,o=e.body,s=t;do{a=o.charCodeAt(++s)}while(!isNaN(a)&&(a>31||9===a));return new w.WU(T.COMMENT,t,s,r,n,i,o.slice(t+1,s))}function L(e,t,r,n,i,a){var o=e.body,s=r,u=t,c=!1;if(45===s&&(s=o.charCodeAt(++u)),48===s){if((s=o.charCodeAt(++u))>=48&&s<=57)throw S(e,u,"Invalid number, unexpected digit after 0: ".concat(x(s),"."))}else u=U(e,u,s),s=o.charCodeAt(u);if(46===s&&(c=!0,s=o.charCodeAt(++u),u=U(e,u,s),s=o.charCodeAt(u)),69!==s&&101!==s||(c=!0,43!==(s=o.charCodeAt(++u))&&45!==s||(s=o.charCodeAt(++u)),u=U(e,u,s),s=o.charCodeAt(u)),46===s||function(e){return 95===e||e>=65&&e<=90||e>=97&&e<=122}(s))throw S(e,u,"Invalid number, expected digit but got: ".concat(x(s),"."));return new w.WU(c?T.FLOAT:T.INT,t,u,n,i,a,o.slice(t,u))}function U(e,t,r){var n=e.body,i=t,a=r;if(a>=48&&a<=57){do{a=n.charCodeAt(++i)}while(a>=48&&a<=57);return i}throw S(e,i,"Invalid number, expected digit but got: ".concat(x(a),"."))}function j(e,t,r,n,i){for(var a,o,s,u,c=e.body,l=t+1,f=l,h=0,p="";l<c.length&&!isNaN(h=c.charCodeAt(l))&&10!==h&&13!==h;){if(34===h)return p+=c.slice(f,l),new w.WU(T.STRING,t,l+1,r,n,i,p);if(h<32&&9!==h)throw S(e,l,"Invalid character within String: ".concat(x(h),"."));if(++l,92===h){switch(p+=c.slice(f,l-1),h=c.charCodeAt(l)){case 34:p+='"';break;case 47:p+="/";break;case 92:p+="\\";break;case 98:p+="\b";break;case 102:p+="\f";break;case 110:p+="\n";break;case 114:p+="\r";break;case 116:p+="\t";break;case 117:var d=(a=c.charCodeAt(l+1),o=c.charCodeAt(l+2),s=c.charCodeAt(l+3),u=c.charCodeAt(l+4),K(a)<<12|K(o)<<8|K(s)<<4|K(u));if(d<0){var y=c.slice(l+1,l+5);throw S(e,l,"Invalid character escape sequence: \\u".concat(y,"."))}p+=String.fromCharCode(d),l+=4;break;default:throw S(e,l,"Invalid character escape sequence: \\".concat(String.fromCharCode(h),"."))}f=++l}}throw S(e,l,"Unterminated string.")}function V(e,t,r,n,i,a){for(var o=e.body,s=t+3,u=s,c=0,l="";s<o.length&&!isNaN(c=o.charCodeAt(s));){if(34===c&&34===o.charCodeAt(s+1)&&34===o.charCodeAt(s+2))return l+=o.slice(u,s),new w.WU(T.BLOCK_STRING,t,s+3,r,n,i,(0,O.W7)(l));if(c<32&&9!==c&&10!==c&&13!==c)throw S(e,s,"Invalid character within String: ".concat(x(c),"."));10===c?(++s,++a.line,a.lineStart=s):13===c?(10===o.charCodeAt(s+1)?s+=2:++s,++a.line,a.lineStart=s):92===c&&34===o.charCodeAt(s+1)&&34===o.charCodeAt(s+2)&&34===o.charCodeAt(s+3)?(l+=o.slice(u,s)+'"""',u=s+=4):++s}throw S(e,s,"Unterminated string.")}function K(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}function M(e,t,r,n,i){for(var a=e.body,o=a.length,s=t+1,u=0;s!==o&&!isNaN(u=a.charCodeAt(s))&&(95===u||u>=48&&u<=57||u>=65&&u<=90||u>=97&&u<=122);)++s;return new w.WU(T.NAME,t,s,r,n,i,a.slice(t,s))}var q=function(){function e(e,t){var r=function(e){return k(e,B)}(e)?e:new B(e);this._lexer=new R(r),this._options=t}var t=e.prototype;return t.parseName=function(){var e=this.expectToken(T.NAME);return{kind:C.NAME,value:e.value,loc:this.loc(e)}},t.parseDocument=function(){var e=this._lexer.token;return{kind:C.DOCUMENT,definitions:this.many(T.SOF,this.parseDefinition,T.EOF),loc:this.loc(e)}},t.parseDefinition=function(){if(this.peek(T.NAME))switch(this._lexer.token.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"schema":case"scalar":case"type":case"interface":case"union":case"enum":case"input":case"directive":return this.parseTypeSystemDefinition();case"extend":return this.parseTypeSystemExtension()}else{if(this.peek(T.BRACE_L))return this.parseOperationDefinition();if(this.peekDescription())return this.parseTypeSystemDefinition()}throw this.unexpected()},t.parseOperationDefinition=function(){var e=this._lexer.token;if(this.peek(T.BRACE_L))return{kind:C.OPERATION_DEFINITION,operation:"query",name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet(),loc:this.loc(e)};var t,r=this.parseOperationType();return this.peek(T.NAME)&&(t=this.parseName()),{kind:C.OPERATION_DEFINITION,operation:r,name:t,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(e)}},t.parseOperationType=function(){var e=this.expectToken(T.NAME);switch(e.value){case"query":return"query";case"mutation":return"mutation";case"subscription":return"subscription"}throw this.unexpected(e)},t.parseVariableDefinitions=function(){return this.optionalMany(T.PAREN_L,this.parseVariableDefinition,T.PAREN_R)},t.parseVariableDefinition=function(){var e=this._lexer.token;return{kind:C.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(T.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(T.EQUALS)?this.parseValueLiteral(!0):void 0,directives:this.parseDirectives(!0),loc:this.loc(e)}},t.parseVariable=function(){var e=this._lexer.token;return this.expectToken(T.DOLLAR),{kind:C.VARIABLE,name:this.parseName(),loc:this.loc(e)}},t.parseSelectionSet=function(){var e=this._lexer.token;return{kind:C.SELECTION_SET,selections:this.many(T.BRACE_L,this.parseSelection,T.BRACE_R),loc:this.loc(e)}},t.parseSelection=function(){return this.peek(T.SPREAD)?this.parseFragment():this.parseField()},t.parseField=function(){var e,t,r=this._lexer.token,n=this.parseName();return this.expectOptionalToken(T.COLON)?(e=n,t=this.parseName()):t=n,{kind:C.FIELD,alias:e,name:t,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(T.BRACE_L)?this.parseSelectionSet():void 0,loc:this.loc(r)}},t.parseArguments=function(e){var t=e?this.parseConstArgument:this.parseArgument;return this.optionalMany(T.PAREN_L,t,T.PAREN_R)},t.parseArgument=function(){var e=this._lexer.token,t=this.parseName();return this.expectToken(T.COLON),{kind:C.ARGUMENT,name:t,value:this.parseValueLiteral(!1),loc:this.loc(e)}},t.parseConstArgument=function(){var e=this._lexer.token;return{kind:C.ARGUMENT,name:this.parseName(),value:(this.expectToken(T.COLON),this.parseValueLiteral(!0)),loc:this.loc(e)}},t.parseFragment=function(){var e=this._lexer.token;this.expectToken(T.SPREAD);var t=this.expectOptionalKeyword("on");return!t&&this.peek(T.NAME)?{kind:C.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1),loc:this.loc(e)}:{kind:C.INLINE_FRAGMENT,typeCondition:t?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(e)}},t.parseFragmentDefinition=function(){var e,t=this._lexer.token;return this.expectKeyword("fragment"),!0===(null===(e=this._options)||void 0===e?void 0:e.experimentalFragmentVariables)?{kind:C.FRAGMENT_DEFINITION,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(t)}:{kind:C.FRAGMENT_DEFINITION,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(t)}},t.parseFragmentName=function(){if("on"===this._lexer.token.value)throw this.unexpected();return this.parseName()},t.parseValueLiteral=function(e){var t=this._lexer.token;switch(t.kind){case T.BRACKET_L:return this.parseList(e);case T.BRACE_L:return this.parseObject(e);case T.INT:return this._lexer.advance(),{kind:C.INT,value:t.value,loc:this.loc(t)};case T.FLOAT:return this._lexer.advance(),{kind:C.FLOAT,value:t.value,loc:this.loc(t)};case T.STRING:case T.BLOCK_STRING:return this.parseStringLiteral();case T.NAME:switch(this._lexer.advance(),t.value){case"true":return{kind:C.BOOLEAN,value:!0,loc:this.loc(t)};case"false":return{kind:C.BOOLEAN,value:!1,loc:this.loc(t)};case"null":return{kind:C.NULL,loc:this.loc(t)};default:return{kind:C.ENUM,value:t.value,loc:this.loc(t)}}case T.DOLLAR:if(!e)return this.parseVariable()}throw this.unexpected()},t.parseStringLiteral=function(){var e=this._lexer.token;return this._lexer.advance(),{kind:C.STRING,value:e.value,block:e.kind===T.BLOCK_STRING,loc:this.loc(e)}},t.parseList=function(e){var t=this,r=this._lexer.token;return{kind:C.LIST,values:this.any(T.BRACKET_L,(function(){return t.parseValueLiteral(e)}),T.BRACKET_R),loc:this.loc(r)}},t.parseObject=function(e){var t=this,r=this._lexer.token;return{kind:C.OBJECT,fields:this.any(T.BRACE_L,(function(){return t.parseObjectField(e)}),T.BRACE_R),loc:this.loc(r)}},t.parseObjectField=function(e){var t=this._lexer.token,r=this.parseName();return this.expectToken(T.COLON),{kind:C.OBJECT_FIELD,name:r,value:this.parseValueLiteral(e),loc:this.loc(t)}},t.parseDirectives=function(e){for(var t=[];this.peek(T.AT);)t.push(this.parseDirective(e));return t},t.parseDirective=function(e){var t=this._lexer.token;return this.expectToken(T.AT),{kind:C.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(e),loc:this.loc(t)}},t.parseTypeReference=function(){var e,t=this._lexer.token;return this.expectOptionalToken(T.BRACKET_L)?(e=this.parseTypeReference(),this.expectToken(T.BRACKET_R),e={kind:C.LIST_TYPE,type:e,loc:this.loc(t)}):e=this.parseNamedType(),this.expectOptionalToken(T.BANG)?{kind:C.NON_NULL_TYPE,type:e,loc:this.loc(t)}:e},t.parseNamedType=function(){var e=this._lexer.token;return{kind:C.NAMED_TYPE,name:this.parseName(),loc:this.loc(e)}},t.parseTypeSystemDefinition=function(){var e=this.peekDescription()?this._lexer.lookahead():this._lexer.token;if(e.kind===T.NAME)switch(e.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}throw this.unexpected(e)},t.peekDescription=function(){return this.peek(T.STRING)||this.peek(T.BLOCK_STRING)},t.parseDescription=function(){if(this.peekDescription())return this.parseStringLiteral()},t.parseSchemaDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("schema");var r=this.parseDirectives(!0),n=this.many(T.BRACE_L,this.parseOperationTypeDefinition,T.BRACE_R);return{kind:C.SCHEMA_DEFINITION,description:t,directives:r,operationTypes:n,loc:this.loc(e)}},t.parseOperationTypeDefinition=function(){var e=this._lexer.token,t=this.parseOperationType();this.expectToken(T.COLON);var r=this.parseNamedType();return{kind:C.OPERATION_TYPE_DEFINITION,operation:t,type:r,loc:this.loc(e)}},t.parseScalarTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("scalar");var r=this.parseName(),n=this.parseDirectives(!0);return{kind:C.SCALAR_TYPE_DEFINITION,description:t,name:r,directives:n,loc:this.loc(e)}},t.parseObjectTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("type");var r=this.parseName(),n=this.parseImplementsInterfaces(),i=this.parseDirectives(!0),a=this.parseFieldsDefinition();return{kind:C.OBJECT_TYPE_DEFINITION,description:t,name:r,interfaces:n,directives:i,fields:a,loc:this.loc(e)}},t.parseImplementsInterfaces=function(){var e;if(!this.expectOptionalKeyword("implements"))return[];if(!0===(null===(e=this._options)||void 0===e?void 0:e.allowLegacySDLImplementsInterfaces)){var t=[];this.expectOptionalToken(T.AMP);do{t.push(this.parseNamedType())}while(this.expectOptionalToken(T.AMP)||this.peek(T.NAME));return t}return this.delimitedMany(T.AMP,this.parseNamedType)},t.parseFieldsDefinition=function(){var e;return!0===(null===(e=this._options)||void 0===e?void 0:e.allowLegacySDLEmptyFields)&&this.peek(T.BRACE_L)&&this._lexer.lookahead().kind===T.BRACE_R?(this._lexer.advance(),this._lexer.advance(),[]):this.optionalMany(T.BRACE_L,this.parseFieldDefinition,T.BRACE_R)},t.parseFieldDefinition=function(){var e=this._lexer.token,t=this.parseDescription(),r=this.parseName(),n=this.parseArgumentDefs();this.expectToken(T.COLON);var i=this.parseTypeReference(),a=this.parseDirectives(!0);return{kind:C.FIELD_DEFINITION,description:t,name:r,arguments:n,type:i,directives:a,loc:this.loc(e)}},t.parseArgumentDefs=function(){return this.optionalMany(T.PAREN_L,this.parseInputValueDef,T.PAREN_R)},t.parseInputValueDef=function(){var e=this._lexer.token,t=this.parseDescription(),r=this.parseName();this.expectToken(T.COLON);var n,i=this.parseTypeReference();this.expectOptionalToken(T.EQUALS)&&(n=this.parseValueLiteral(!0));var a=this.parseDirectives(!0);return{kind:C.INPUT_VALUE_DEFINITION,description:t,name:r,type:i,defaultValue:n,directives:a,loc:this.loc(e)}},t.parseInterfaceTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("interface");var r=this.parseName(),n=this.parseImplementsInterfaces(),i=this.parseDirectives(!0),a=this.parseFieldsDefinition();return{kind:C.INTERFACE_TYPE_DEFINITION,description:t,name:r,interfaces:n,directives:i,fields:a,loc:this.loc(e)}},t.parseUnionTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("union");var r=this.parseName(),n=this.parseDirectives(!0),i=this.parseUnionMemberTypes();return{kind:C.UNION_TYPE_DEFINITION,description:t,name:r,directives:n,types:i,loc:this.loc(e)}},t.parseUnionMemberTypes=function(){return this.expectOptionalToken(T.EQUALS)?this.delimitedMany(T.PIPE,this.parseNamedType):[]},t.parseEnumTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("enum");var r=this.parseName(),n=this.parseDirectives(!0),i=this.parseEnumValuesDefinition();return{kind:C.ENUM_TYPE_DEFINITION,description:t,name:r,directives:n,values:i,loc:this.loc(e)}},t.parseEnumValuesDefinition=function(){return this.optionalMany(T.BRACE_L,this.parseEnumValueDefinition,T.BRACE_R)},t.parseEnumValueDefinition=function(){var e=this._lexer.token,t=this.parseDescription(),r=this.parseName(),n=this.parseDirectives(!0);return{kind:C.ENUM_VALUE_DEFINITION,description:t,name:r,directives:n,loc:this.loc(e)}},t.parseInputObjectTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("input");var r=this.parseName(),n=this.parseDirectives(!0),i=this.parseInputFieldsDefinition();return{kind:C.INPUT_OBJECT_TYPE_DEFINITION,description:t,name:r,directives:n,fields:i,loc:this.loc(e)}},t.parseInputFieldsDefinition=function(){return this.optionalMany(T.BRACE_L,this.parseInputValueDef,T.BRACE_R)},t.parseTypeSystemExtension=function(){var e=this._lexer.lookahead();if(e.kind===T.NAME)switch(e.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension()}throw this.unexpected(e)},t.parseSchemaExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");var t=this.parseDirectives(!0),r=this.optionalMany(T.BRACE_L,this.parseOperationTypeDefinition,T.BRACE_R);if(0===t.length&&0===r.length)throw this.unexpected();return{kind:C.SCHEMA_EXTENSION,directives:t,operationTypes:r,loc:this.loc(e)}},t.parseScalarTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");var t=this.parseName(),r=this.parseDirectives(!0);if(0===r.length)throw this.unexpected();return{kind:C.SCALAR_TYPE_EXTENSION,name:t,directives:r,loc:this.loc(e)}},t.parseObjectTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");var t=this.parseName(),r=this.parseImplementsInterfaces(),n=this.parseDirectives(!0),i=this.parseFieldsDefinition();if(0===r.length&&0===n.length&&0===i.length)throw this.unexpected();return{kind:C.OBJECT_TYPE_EXTENSION,name:t,interfaces:r,directives:n,fields:i,loc:this.loc(e)}},t.parseInterfaceTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");var t=this.parseName(),r=this.parseImplementsInterfaces(),n=this.parseDirectives(!0),i=this.parseFieldsDefinition();if(0===r.length&&0===n.length&&0===i.length)throw this.unexpected();return{kind:C.INTERFACE_TYPE_EXTENSION,name:t,interfaces:r,directives:n,fields:i,loc:this.loc(e)}},t.parseUnionTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");var t=this.parseName(),r=this.parseDirectives(!0),n=this.parseUnionMemberTypes();if(0===r.length&&0===n.length)throw this.unexpected();return{kind:C.UNION_TYPE_EXTENSION,name:t,directives:r,types:n,loc:this.loc(e)}},t.parseEnumTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");var t=this.parseName(),r=this.parseDirectives(!0),n=this.parseEnumValuesDefinition();if(0===r.length&&0===n.length)throw this.unexpected();return{kind:C.ENUM_TYPE_EXTENSION,name:t,directives:r,values:n,loc:this.loc(e)}},t.parseInputObjectTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");var t=this.parseName(),r=this.parseDirectives(!0),n=this.parseInputFieldsDefinition();if(0===r.length&&0===n.length)throw this.unexpected();return{kind:C.INPUT_OBJECT_TYPE_EXTENSION,name:t,directives:r,fields:n,loc:this.loc(e)}},t.parseDirectiveDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("directive"),this.expectToken(T.AT);var r=this.parseName(),n=this.parseArgumentDefs(),i=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");var a=this.parseDirectiveLocations();return{kind:C.DIRECTIVE_DEFINITION,description:t,name:r,arguments:n,repeatable:i,locations:a,loc:this.loc(e)}},t.parseDirectiveLocations=function(){return this.delimitedMany(T.PIPE,this.parseDirectiveLocation)},t.parseDirectiveLocation=function(){var e=this._lexer.token,t=this.parseName();if(void 0!==N[t.value])return t;throw this.unexpected(e)},t.loc=function(e){var t;if(!0!==(null===(t=this._options)||void 0===t?void 0:t.noLocation))return new w.Ye(e,this._lexer.lastToken,this._lexer.source)},t.peek=function(e){return this._lexer.token.kind===e},t.expectToken=function(e){var t=this._lexer.token;if(t.kind===e)return this._lexer.advance(),t;throw S(this._lexer.source,t.start,"Expected ".concat(H(e),", found ").concat(z(t),"."))},t.expectOptionalToken=function(e){var t=this._lexer.token;if(t.kind===e)return this._lexer.advance(),t},t.expectKeyword=function(e){var t=this._lexer.token;if(t.kind!==T.NAME||t.value!==e)throw S(this._lexer.source,t.start,'Expected "'.concat(e,'", found ').concat(z(t),"."));this._lexer.advance()},t.expectOptionalKeyword=function(e){var t=this._lexer.token;return t.kind===T.NAME&&t.value===e&&(this._lexer.advance(),!0)},t.unexpected=function(e){var t=null!=e?e:this._lexer.token;return S(this._lexer.source,t.start,"Unexpected ".concat(z(t),"."))},t.any=function(e,t,r){this.expectToken(e);for(var n=[];!this.expectOptionalToken(r);)n.push(t.call(this));return n},t.optionalMany=function(e,t,r){if(this.expectOptionalToken(e)){var n=[];do{n.push(t.call(this))}while(!this.expectOptionalToken(r));return n}return[]},t.many=function(e,t,r){this.expectToken(e);var n=[];do{n.push(t.call(this))}while(!this.expectOptionalToken(r));return n},t.delimitedMany=function(e,t){this.expectOptionalToken(e);var r=[];do{r.push(t.call(this))}while(this.expectOptionalToken(e));return r},e}();function z(e){var t=e.value;return H(e.kind)+(null!=t?' "'.concat(t,'"'):"")}function H(e){return function(e){return e===T.BANG||e===T.DOLLAR||e===T.AMP||e===T.PAREN_L||e===T.PAREN_R||e===T.SPREAD||e===T.COLON||e===T.EQUALS||e===T.AT||e===T.BRACKET_L||e===T.BRACKET_R||e===T.BRACE_L||e===T.PIPE||e===T.BRACE_R}(e)?'"'.concat(e,'"'):e}var G=new Map,Q=new Map,W=!0,Y=!1;function Z(e){return e.replace(/[\s,]+/g," ").trim()}function J(e){var t=new Set,r=[];return e.definitions.forEach((function(e){if("FragmentDefinition"===e.kind){var n=e.name.value,i=Z((o=e.loc).source.body.substring(o.start,o.end)),a=Q.get(n);a&&!a.has(i)?W&&console.warn("Warning: fragment with name "+n+" already exists.\ngraphql-tag enforces all fragment names across your application to be unique; read more about\nthis in the docs: http://dev.apollodata.com/core/fragments.html#unique-names"):a||Q.set(n,a=new Set),a.add(i),t.has(i)||(t.add(i),r.push(e))}else r.push(e);var o})),(0,n.pi)((0,n.pi)({},e),{definitions:r})}function X(e){var t=Z(e);if(!G.has(t)){var r=function(e,t){return new q(e,t).parseDocument()}(e,{experimentalFragmentVariables:Y});if(!r||"Document"!==r.kind)throw new Error("Not a valid GraphQL document.");G.set(t,function(e){var t=new Set(e.definitions);t.forEach((function(e){e.loc&&delete e.loc,Object.keys(e).forEach((function(r){var n=e[r];n&&"object"==typeof n&&t.add(n)}))}));var r=e.loc;return r&&(delete r.startToken,delete r.endToken),e}(J(r)))}return G.get(t)}function $(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];"string"==typeof e&&(e=[e]);var n=e[0];return t.forEach((function(t,r){t&&"Document"===t.kind?n+=t.loc.source.body:n+=t,n+=e[r+1]})),X(n)}var ee=Object.assign($,{gql:$,default:$,resetCaches:function(){G.clear(),Q.clear()},disableFragmentWarnings:function(){W=!1},enableExperimentalFragmentVariables:function(){Y=!0},disableExperimentalFragmentVariables:function(){Y=!1}})},1494:function(e,t,r){"use strict";e=r.hmd(e);!function(e){var t,r=e.Symbol;if("function"==typeof r)if(r.observable)t=r.observable;else{t=r.for("https://github.com/benlesh/symbol-observable");try{r.observable=t}catch(e){}}else t="@@observable"}("undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==r.g?r.g:e)},496:function(e,t,r){"use strict";r.d(t,{X_:function(){return oe},w0:function(){return Y},y$:function(){return J()},Gw:function(){return U},NC:function(){return E},sz:function(){return ne},aL:function(){return M},mr:function(){return ce},Xh:function(){return $},oA:function(){return le},F:function(){return l},Dy:function(){return ie},O4:function(){return O},kU:function(){return _},hi:function(){return f},Yk:function(){return c},p$:function(){return N},$H:function(){return I},rY:function(){return k},iW:function(){return B},PT:function(){return b},qw:function(){return C},d2:function(){return ue},mj:function(){return s},FS:function(){return o},My:function(){return w},Ao:function(){return T},Of:function(){return se},hh:function(){return y},pM:function(){return re},kQ:function(){return d},Jv:function(){return te},Ee:function(){return H},bw:function(){return G},ob:function(){return q},Fo:function(){return V},u2:function(){return S},LZ:function(){return a},vf:function(){return g}});var n=r(7636),i=r(2924);function a(e,t){var r=e.directives;return!r||!r.length||function(e){var t=[];e&&e.length&&e.forEach((function(e){if(function(e){var t=e.name.value;return"skip"===t||"include"===t}(e)){var r=e.arguments;e.name.value;(0,i.kG)(r&&1===r.length,39);var n=r[0];(0,i.kG)(n.name&&"if"===n.name.value,40);var a=n.value;(0,i.kG)(a&&("Variable"===a.kind||"BooleanValue"===a.kind),41),t.push({directive:e,ifArgument:n})}}));return t}(r).every((function(e){var r=e.directive,n=e.ifArgument,a=!1;return"Variable"===n.value.kind?(a=t&&t[n.value.name.value],(0,i.kG)(void 0!==a,38)):a=n.value.value,"skip"===r.name.value?!a:a}))}function o(e,t){return function(e){var t=[];return(0,n.Vn)(e,{Directive:function(e){t.push(e.name.value)}}),t}(t).some((function(t){return e.indexOf(t)>-1}))}function s(e){return e&&o(["client"],e)&&o(["export"],e)}var u=r(655);function c(e,t){var r=t,n=[];return e.definitions.forEach((function(e){if("OperationDefinition"===e.kind)throw new i.ej(42);"FragmentDefinition"===e.kind&&n.push(e)})),void 0===r&&((0,i.kG)(1===n.length,43),r=n[0].name.value),(0,u.pi)((0,u.pi)({},e),{definitions:(0,u.pr)([{kind:"OperationDefinition",operation:"query",selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:r}}]}}],e.definitions)})}function l(e){void 0===e&&(e=[]);var t={};return e.forEach((function(e){t[e.name.value]=e})),t}function f(e,t){switch(e.kind){case"InlineFragment":return e;case"FragmentSpread":var r=t&&t[e.name.value];return(0,i.kG)(r,44),r;default:return null}}var h=r(5035),p=r.n(h);function d(e){return{__ref:String(e)}}function y(e){return Boolean(e&&"object"==typeof e&&"string"==typeof e.__ref)}function v(e,t,r,n){if(function(e){return"IntValue"===e.kind}(r)||function(e){return"FloatValue"===e.kind}(r))e[t.value]=Number(r.value);else if(function(e){return"BooleanValue"===e.kind}(r)||function(e){return"StringValue"===e.kind}(r))e[t.value]=r.value;else if(function(e){return"ObjectValue"===e.kind}(r)){var a={};r.fields.map((function(e){return v(a,e.name,e.value,n)})),e[t.value]=a}else if(function(e){return"Variable"===e.kind}(r)){var o=(n||{})[r.name.value];e[t.value]=o}else if(function(e){return"ListValue"===e.kind}(r))e[t.value]=r.values.map((function(e){var r={};return v(r,t,e,n),r[t.value]}));else if(function(e){return"EnumValue"===e.kind}(r))e[t.value]=r.value;else{if(!function(e){return"NullValue"===e.kind}(r))throw new i.ej(53);e[t.value]=null}}function g(e,t){var r=null;e.directives&&(r={},e.directives.forEach((function(e){r[e.name.value]={},e.arguments&&e.arguments.forEach((function(n){var i=n.name,a=n.value;return v(r[e.name.value],i,a,t)}))})));var n=null;return e.arguments&&e.arguments.length&&(n={},e.arguments.forEach((function(e){var r=e.name,i=e.value;return v(n,r,i,t)}))),b(e.name.value,n,r)}var m=["connection","include","skip","client","rest","export"];function b(e,t,r){if(t&&r&&r.connection&&r.connection.key){if(r.connection.filter&&r.connection.filter.length>0){var n=r.connection.filter?r.connection.filter:[];n.sort();var i={};return n.forEach((function(e){i[e]=t[e]})),r.connection.key+"("+JSON.stringify(i)+")"}return r.connection.key}var a=e;if(t){var o=p()(t);a+="("+o+")"}return r&&Object.keys(r).forEach((function(e){-1===m.indexOf(e)&&(r[e]&&Object.keys(r[e]).length?a+="@"+e+"("+JSON.stringify(r[e])+")":a+="@"+e)})),a}function E(e,t){if(e.arguments&&e.arguments.length){var r={};return e.arguments.forEach((function(e){var n=e.name,i=e.value;return v(r,n,i,t)})),r}return null}function S(e){return e.alias?e.alias.value:e.name.value}function C(e,t,r){if("string"==typeof e.__typename)return e.__typename;for(var n=0,i=t.selections;n<i.length;n++){var a=i[n];if(w(a)){if("__typename"===a.name.value)return e[S(a)]}else{var o=C(e,f(a,r).selectionSet,r);if("string"==typeof o)return o}}}function w(e){return"Field"===e.kind}function T(e){return"InlineFragment"===e.kind}function A(e){(0,i.kG)(e&&"Document"===e.kind,45);var t=e.definitions.filter((function(e){return"FragmentDefinition"!==e.kind})).map((function(e){if("OperationDefinition"!==e.kind)throw new i.ej(46);return e}));return(0,i.kG)(t.length<=1,47),e}function I(e){return A(e),e.definitions.filter((function(e){return"OperationDefinition"===e.kind}))[0]}function k(e){return e.definitions.filter((function(e){return"OperationDefinition"===e.kind&&e.name})).map((function(e){return e.name.value}))[0]||null}function _(e){return e.definitions.filter((function(e){return"FragmentDefinition"===e.kind}))}function B(e){var t=I(e);return(0,i.kG)(t&&"query"===t.operation,48),t}function N(e){var t;A(e);for(var r=0,n=e.definitions;r<n.length;r++){var a=n[r];if("OperationDefinition"===a.kind){var o=a.operation;if("query"===o||"mutation"===o||"subscription"===o)return a}"FragmentDefinition"!==a.kind||t||(t=a)}if(t)return t;throw new i.ej(52)}function O(e){var t=Object.create(null),r=e&&e.variableDefinitions;return r&&r.length&&r.forEach((function(e){e.defaultValue&&v(t,e.variable.name,e.defaultValue)})),t}function R(e,t,r){var n=0;return e.forEach((function(r,i){t.call(this,r,i,e)&&(e[n++]=r)}),r),e.length=n,e}var x={kind:"Field",name:{kind:"Name",value:"__typename"}};function P(e,t){return e.selectionSet.selections.every((function(e){return"FragmentSpread"===e.kind&&P(t[e.name.value],t)}))}function F(e){return P(I(e)||function(e){(0,i.kG)("Document"===e.kind,49),(0,i.kG)(e.definitions.length<=1,50);var t=e.definitions[0];return(0,i.kG)("FragmentDefinition"===t.kind,51),t}(e),l(_(e)))?null:e}function D(e){return function(t){return e.some((function(e){return e.name&&e.name===t.name.value||e.test&&e.test(t)}))}}function L(e,t){var r=Object.create(null),i=[],a=Object.create(null),o=[],s=F((0,n.Vn)(t,{Variable:{enter:function(e,t,n){"VariableDefinition"!==n.kind&&(r[e.name.value]=!0)}},Field:{enter:function(t){if(e&&t.directives&&(e.some((function(e){return e.remove}))&&t.directives&&t.directives.some(D(e))))return t.arguments&&t.arguments.forEach((function(e){"Variable"===e.value.kind&&i.push({name:e.value.name.value})})),t.selectionSet&&K(t.selectionSet).forEach((function(e){o.push({name:e.name.value})})),null}},FragmentSpread:{enter:function(e){a[e.name.value]=!0}},Directive:{enter:function(t){if(D(e)(t))return null}}}));return s&&R(i,(function(e){return!!e.name&&!r[e.name]})).length&&(s=function(e,t){var r=function(e){return function(t){return e.some((function(e){return t.value&&"Variable"===t.value.kind&&t.value.name&&(e.name===t.value.name.value||e.test&&e.test(t))}))}}(e);return F((0,n.Vn)(t,{OperationDefinition:{enter:function(t){return(0,u.pi)((0,u.pi)({},t),{variableDefinitions:t.variableDefinitions?t.variableDefinitions.filter((function(t){return!e.some((function(e){return e.name===t.variable.name.value}))})):[]})}},Field:{enter:function(t){if(e.some((function(e){return e.remove}))){var n=0;if(t.arguments&&t.arguments.forEach((function(e){r(e)&&(n+=1)})),1===n)return null}}},Argument:{enter:function(e){if(r(e))return null}}}))}(i,s)),s&&R(o,(function(e){return!!e.name&&!a[e.name]})).length&&(s=function(e,t){function r(t){if(e.some((function(e){return e.name===t.name.value})))return null}return F((0,n.Vn)(t,{FragmentSpread:{enter:r},FragmentDefinition:{enter:r}}))}(o,s)),s}function U(e){return(0,n.Vn)(A(e),{SelectionSet:{enter:function(e,t,r){if(!r||"OperationDefinition"!==r.kind){var n=e.selections;if(n)if(!n.some((function(e){return w(e)&&("__typename"===e.name.value||0===e.name.value.lastIndexOf("__",0))}))){var i=r;if(!(w(i)&&i.directives&&i.directives.some((function(e){return"export"===e.name.value}))))return(0,u.pi)((0,u.pi)({},e),{selections:(0,u.pr)(n,[x])})}}}}})}U.added=function(e){return e===x};var j={test:function(e){var t="connection"===e.name.value;return t&&(!e.arguments||e.arguments.some((function(e){return"key"===e.name.value}))),t}};function V(e){return L([j],A(e))}function K(e){var t=[];return e.selections.forEach((function(e){(w(e)||T(e))&&e.selectionSet?K(e.selectionSet).forEach((function(e){return t.push(e)})):"FragmentSpread"===e.kind&&t.push(e)})),t}function M(e){return"query"===N(e).operation?e:(0,n.Vn)(e,{OperationDefinition:{enter:function(e){return(0,u.pi)((0,u.pi)({},e),{operation:"query"})}}})}function q(e){A(e);var t=L([{test:function(e){return"client"===e.name.value},remove:!0}],e);return t&&(t=(0,n.Vn)(t,{FragmentDefinition:{enter:function(e){if(e.selectionSet&&e.selectionSet.selections.every((function(e){return w(e)&&"__typename"===e.name.value})))return null}}})),t}var z=Object.prototype.hasOwnProperty;function H(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return G(e)}function G(e){var t=e[0]||{},r=e.length;if(r>1)for(var n=new Y,i=1;i<r;++i)t=n.merge(t,e[i]);return t}function Q(e){return null!==e&&"object"==typeof e}var W=function(e,t,r){return this.merge(e[r],t[r])},Y=function(){function e(e){void 0===e&&(e=W),this.reconciler=e,this.isObject=Q,this.pastCopies=new Set}return e.prototype.merge=function(e,t){for(var r=this,n=[],i=2;i<arguments.length;i++)n[i-2]=arguments[i];return Q(t)&&Q(e)?(Object.keys(t).forEach((function(i){if(z.call(e,i)){var a=e[i];if(t[i]!==a){var o=r.reconciler.apply(r,(0,u.pr)([e,t,i],n));o!==a&&((e=r.shallowCopyForMerge(e))[i]=o)}}else(e=r.shallowCopyForMerge(e))[i]=t[i]})),e):t},e.prototype.shallowCopyForMerge=function(e){return Q(e)&&!this.pastCopies.has(e)&&(e=Array.isArray(e)?e.slice(0):(0,u.pi)({__proto__:Object.getPrototypeOf(e)},e),this.pastCopies.add(e)),e},e}();var Z=r(9329),J=r.n(Z);r(1494);J().prototype["@@observable"]=function(){return this};var X=Object.prototype.toString;function $(e){return ee(e)}function ee(e,t){switch(X.call(e)){case"[object Array]":if((t=t||new Map).has(e))return t.get(e);var r=e.slice(0);return t.set(e,r),r.forEach((function(e,n){r[n]=ee(e,t)})),r;case"[object Object]":if((t=t||new Map).has(e))return t.get(e);var n=Object.create(Object.getPrototypeOf(e));return t.set(e,n),Object.keys(e).forEach((function(r){n[r]=ee(e[r],t)})),n;default:return e}}function te(e){return e}function re(e,t,r){var n=[];e.forEach((function(e){return e[t]&&n.push(e)})),n.forEach((function(e){return e[t](r)}))}function ne(e,t,r){return new(J())((function(n){var i=n.next,a=n.error,o=n.complete,s=0,u=!1;function c(e,t){return e?function(t){++s,new Promise((function(r){return r(e(t))})).then((function(e){--s,i&&i.call(n,e),u&&l.complete()}),(function(e){--s,a&&a.call(n,e)}))}:function(e){return t&&t.call(n,e)}}var l={next:c(t,i),error:c(r,a),complete:function(){u=!0,s||o&&o.call(n)}},f=e.subscribe(l);return function(){return f.unsubscribe()}}))}function ie(e){function t(t){Object.defineProperty(e,t,{value:J()})}return"function"==typeof Symbol&&Symbol.species&&t(Symbol.species),t("@@species"),e}function ae(e){return e&&"function"==typeof e.then}var oe=function(e){function t(t){var r=e.call(this,(function(e){return r.addObserver(e),function(){return r.removeObserver(e)}}))||this;return r.observers=new Set,r.addCount=0,r.promise=new Promise((function(e,t){r.resolve=e,r.reject=t})),r.handlers={next:function(e){null!==r.sub&&(r.latest=["next",e],re(r.observers,"next",e))},error:function(e){var t=r.sub;null!==t&&(t&&Promise.resolve().then((function(){return t.unsubscribe()})),r.sub=null,r.latest=["error",e],r.reject(e),re(r.observers,"error",e))},complete:function(){if(null!==r.sub){var e=r.sources.shift();e?ae(e)?e.then((function(e){return r.sub=e.subscribe(r.handlers)})):r.sub=e.subscribe(r.handlers):(r.sub=null,r.latest&&"next"===r.latest[0]?r.resolve(r.latest[1]):r.resolve(),re(r.observers,"complete"))}}},r.cancel=function(e){r.reject(e),r.sources=[],r.handlers.complete()},r.promise.catch((function(e){})),"function"==typeof t&&(t=[new(J())(t)]),ae(t)?t.then((function(e){return r.start(e)}),r.handlers.error):r.start(t),r}return(0,u.ZT)(t,e),t.prototype.start=function(e){void 0===this.sub&&(this.sources=Array.from(e),this.handlers.complete())},t.prototype.deliverLastMessage=function(e){if(this.latest){var t=this.latest[0],r=e[t];r&&r.call(e,this.latest[1]),null===this.sub&&"next"===t&&e.complete&&e.complete()}},t.prototype.addObserver=function(e){this.observers.has(e)||(this.deliverLastMessage(e),this.observers.add(e),++this.addCount)},t.prototype.removeObserver=function(e,t){this.observers.delete(e)&&--this.addCount<1&&!t&&this.handlers.error(new Error("Observable cancelled prematurely"))},t.prototype.cleanup=function(e){var t=this,r=!1,n=function(){r||(r=!0,t.observers.delete(i),e())},i={next:n,error:n,complete:n},a=this.addCount;this.addObserver(i),this.addCount=a},t}(J());function se(e){return Array.isArray(e)&&e.length>0}function ue(e){return e.errors&&e.errors.length>0||!1}ie(oe);var ce="function"==typeof WeakMap&&!("object"==typeof navigator&&"ReactNative"===navigator.product);function le(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=Object.create(null);return e.forEach((function(e){e&&Object.keys(e).forEach((function(t){var n=e[t];void 0!==n&&(r[t]=n)}))})),r}},2152:function(e,t,r){"use strict";r.d(t,{D:function(){return u}});var n=Object.prototype,i=n.toString,a=n.hasOwnProperty,o=Function.prototype.toString,s=new Map;function u(e,t){try{return c(e,t)}finally{s.clear()}}function c(e,t){if(e===t)return!0;var r,n,s,u=i.call(e);if(u!==i.call(t))return!1;switch(u){case"[object Array]":if(e.length!==t.length)return!1;case"[object Object]":if(p(e,t))return!0;var f=l(e),d=l(t),y=f.length;if(y!==d.length)return!1;for(var v=0;v<y;++v)if(!a.call(t,f[v]))return!1;for(v=0;v<y;++v){var g=f[v];if(!c(e[g],t[g]))return!1}return!0;case"[object Error]":return e.name===t.name&&e.message===t.message;case"[object Number]":if(e!=e)return t!=t;case"[object Boolean]":case"[object Date]":return+e==+t;case"[object RegExp]":case"[object String]":return e==""+t;case"[object Map]":case"[object Set]":if(e.size!==t.size)return!1;if(p(e,t))return!0;for(var m=e.entries(),b="[object Map]"===u;;){var E=m.next();if(E.done)break;var S=E.value,C=S[0],w=S[1];if(!t.has(C))return!1;if(b&&!c(w,t.get(C)))return!1}return!0;case"[object Function]":var T=o.call(e);return T===o.call(t)&&(n=h,!((s=(r=T).length-n.length)>=0&&r.indexOf(n,s)===s))}return!1}function l(e){return Object.keys(e).filter(f,e)}function f(e){return void 0!==this[e]}var h="{ [native code] }";function p(e,t){var r=s.get(e);if(r){if(r.has(t))return!0}else s.set(e,r=new Set);return r.add(t),!1}},9742:function(e,t){"use strict";t.byteLength=function(e){var t=u(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,a=u(e),o=a[0],s=a[1],c=new i(function(e,t,r){return 3*(t+r)/4-r}(0,o,s)),l=0,f=s>0?o-4:o;for(r=0;r<f;r+=4)t=n[e.charCodeAt(r)]<<18|n[e.charCodeAt(r+1)]<<12|n[e.charCodeAt(r+2)]<<6|n[e.charCodeAt(r+3)],c[l++]=t>>16&255,c[l++]=t>>8&255,c[l++]=255&t;2===s&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,c[l++]=255&t);1===s&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,c[l++]=t>>8&255,c[l++]=255&t);return c},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,a=[],o=16383,s=0,u=n-i;s<u;s+=o)a.push(c(e,s,s+o>u?u:s+o));1===i?(t=e[n-1],a.push(r[t>>2]+r[t<<4&63]+"==")):2===i&&(t=(e[n-2]<<8)+e[n-1],a.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"="));return a.join("")};for(var r=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0,s=a.length;o<s;++o)r[o]=a[o],n[a.charCodeAt(o)]=o;function u(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function c(e,t,n){for(var i,a,o=[],s=t;s<n;s+=3)i=(e[s]<<16&16711680)+(e[s+1]<<8&65280)+(255&e[s+2]),o.push(r[(a=i)>>18&63]+r[a>>12&63]+r[a>>6&63]+r[63&a]);return o.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},2240:function(e,t,r){"use strict";var n=r(1518);function i(e,t){return void 0===t&&(t="utf8"),Buffer.isBuffer(e)?o(e.toString("base64")):o(Buffer.from(e,t).toString("base64"))}function a(e){return e=e.toString(),n.default(e).replace(/\-/g,"+").replace(/_/g,"/")}function o(e){return e.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}var s=i;s.encode=i,s.decode=function(e,t){return void 0===t&&(t="utf8"),Buffer.from(a(e),"base64").toString(t)},s.toBase64=a,s.fromBase64=o,s.toBuffer=function(e){return Buffer.from(a(e),"base64")},t.default=s},1518:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=e.length,r=t%4;if(!r)return e;var n=t,i=4-r,a=t+i,o=Buffer.alloc(a);for(o.write(e);i--;)o.write("=",n++);return o.toString()}},5772:function(e,t,r){e.exports=r(2240).default,e.exports.default=e.exports},8764:function(e,t,r){"use strict";var n=r(9742),i=r(645),a="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;
1
+ (()=>{var e={2634:(e,t,r)=>{"use strict";r.d(t,{h4:()=>Be,ab:()=>ce});var n=function(){return Object.create(null)},i=Array.prototype,a=i.forEach,o=i.slice,s=function(){function e(e,t){void 0===e&&(e=!0),void 0===t&&(t=n),this.weakness=e,this.makeData=t}return e.prototype.lookup=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return this.lookupArray(e)},e.prototype.lookupArray=function(e){var t=this;return a.call(e,(function(e){return t=t.getChildTrie(e)})),t.data||(t.data=this.makeData(o.call(e)))},e.prototype.getChildTrie=function(t){var r=this.weakness&&function(e){switch(typeof e){case"object":if(null===e)break;case"function":return!0}return!1}(t)?this.weak||(this.weak=new WeakMap):this.strong||(this.strong=new Map),n=r.get(t);return n||r.set(t,n=new e(this.weakness,this.makeData)),n},e}();var u=null,c={},l=1,f="@wry/context:Slot",h=Array,p=h[f]||function(){var e=function(){function e(){this.id=["slot",l++,Date.now(),Math.random().toString(36).slice(2)].join(":")}return e.prototype.hasValue=function(){for(var e=u;e;e=e.parent)if(this.id in e.slots){var t=e.slots[this.id];if(t===c)break;return e!==u&&(u.slots[this.id]=t),!0}return u&&(u.slots[this.id]=c),!1},e.prototype.getValue=function(){if(this.hasValue())return u.slots[this.id]},e.prototype.withValue=function(e,t,r,n){var i,a=((i={__proto__:null})[this.id]=e,i),o=u;u={parent:o,slots:a};try{return t.apply(n,r)}finally{u=o}},e.bind=function(e){var t=u;return function(){var r=u;try{return u=t,e.apply(this,arguments)}finally{u=r}}},e.noContext=function(e,t,r){if(!u)return e.apply(r,t);var n=u;try{return u=null,e.apply(r,t)}finally{u=n}},e}();try{Object.defineProperty(h,f,{value:h[f]=e,enumerable:!1,writable:!1,configurable:!1})}finally{return e}}();p.bind,p.noContext;function d(){}var y=function(){function e(e,t){void 0===e&&(e=1/0),void 0===t&&(t=d),this.max=e,this.dispose=t,this.map=new Map,this.newest=null,this.oldest=null}return e.prototype.has=function(e){return this.map.has(e)},e.prototype.get=function(e){var t=this.getNode(e);return t&&t.value},e.prototype.getNode=function(e){var t=this.map.get(e);if(t&&t!==this.newest){var r=t.older,n=t.newer;n&&(n.older=r),r&&(r.newer=n),t.older=this.newest,t.older.newer=t,t.newer=null,this.newest=t,t===this.oldest&&(this.oldest=n)}return t},e.prototype.set=function(e,t){var r=this.getNode(e);return r?r.value=t:(r={key:e,value:t,newer:null,older:this.newest},this.newest&&(this.newest.newer=r),this.newest=r,this.oldest=this.oldest||r,this.map.set(e,r),r.value)},e.prototype.clean=function(){for(;this.oldest&&this.map.size>this.max;)this.delete(this.oldest.key)},e.prototype.delete=function(e){var t=this.map.get(e);return!!t&&(t===this.newest&&(this.newest=t.older),t===this.oldest&&(this.oldest=t.newer),t.newer&&(t.newer.older=t.older),t.older&&(t.older.newer=t.newer),this.map.delete(e),this.dispose(t.value,e),!0)},e}(),v=new p;function g(e){var t=e.unsubscribe;"function"==typeof t&&(e.unsubscribe=void 0,t())}var m=[];function b(e,t){if(!e)throw new Error(t||"assertion failure")}function E(e){switch(e.length){case 0:throw new Error("unknown value");case 1:return e[0];case 2:throw e[1]}}var S=function(){function e(t){this.fn=t,this.parents=new Set,this.childValues=new Map,this.dirtyChildren=null,this.dirty=!0,this.recomputing=!1,this.value=[],this.deps=null,++e.count}return e.prototype.peek=function(){if(1===this.value.length&&!w(this))return this.value[0]},e.prototype.recompute=function(e){return b(!this.recomputing,"already recomputing"),function(e){var t=v.getValue();if(t)e.parents.add(t),t.childValues.has(e)||t.childValues.set(e,[]),w(e)?I(t,e):k(t,e)}(this),w(this)?function(e,t){B(e),v.withValue(e,C,[e,t]),function(e,t){if("function"==typeof e.subscribe)try{g(e),e.unsubscribe=e.subscribe.apply(null,t)}catch(t){return e.setDirty(),!1}return!0}(e,t)&&function(e){if(e.dirty=!1,w(e))return;A(e)}(e);return E(e.value)}(this,e):E(this.value)},e.prototype.setDirty=function(){this.dirty||(this.dirty=!0,this.value.length=0,T(this),B(this),g(this))},e.prototype.dispose=function(){var e=this;B(this),g(this),this.parents.forEach((function(t){t.setDirty(),N(t,e)}))},e.prototype.dependOn=function(e){e.add(this),this.deps||(this.deps=m.pop()||new Set),this.deps.add(e)},e.prototype.forgetDeps=function(){var e=this;this.deps&&(this.deps.forEach((function(t){return t.delete(e)})),this.deps.clear(),m.push(this.deps),this.deps=null)},e.count=0,e}();function C(e,t){e.recomputing=!0,e.value.length=0;try{e.value[0]=e.fn.apply(null,t)}catch(t){e.value[1]=t}e.recomputing=!1}function w(e){return e.dirty||!(!e.dirtyChildren||!e.dirtyChildren.size)}function T(e){e.parents.forEach((function(t){return I(t,e)}))}function A(e){e.parents.forEach((function(t){return k(t,e)}))}function I(e,t){if(b(e.childValues.has(t)),b(w(t)),e.dirtyChildren){if(e.dirtyChildren.has(t))return}else e.dirtyChildren=m.pop()||new Set;e.dirtyChildren.add(t),T(e)}function k(e,t){b(e.childValues.has(t)),b(!w(t));var r,n,i,a=e.childValues.get(t);0===a.length?e.childValues.set(t,t.value.slice(0)):(r=a,n=t.value,(i=r.length)>0&&i===n.length&&r[i-1]===n[i-1]||e.setDirty()),_(e,t),w(e)||A(e)}function _(e,t){var r=e.dirtyChildren;r&&(r.delete(t),0===r.size&&(m.length<100&&m.push(r),e.dirtyChildren=null))}function B(e){e.childValues.size>0&&e.childValues.forEach((function(t,r){N(e,r)})),e.forgetDeps(),b(null===e.dirtyChildren)}function N(e,t){t.parents.delete(e),e.childValues.delete(t),_(e,t)}function O(e){var t=new Map,r=e&&e.subscribe;function n(e){var n=v.getValue();if(n){var i=t.get(e);i||t.set(e,i=new Set),n.dependOn(i),"function"==typeof r&&(g(i),i.unsubscribe=r(e))}}return n.dirty=function(e){var r=t.get(e);r&&(r.forEach((function(e){return e.setDirty()})),t.delete(e),g(r))},n}var R=new s("function"==typeof WeakMap);function x(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return R.lookupArray(e)}var P=new Set;function F(e,t){void 0===t&&(t=Object.create(null));var r=new y(t.max||Math.pow(2,16),(function(e){return e.dispose()})),n=t.keyArgs,i=t.makeCacheKey||x;function a(){var a=i.apply(null,n?n.apply(null,arguments):arguments);if(void 0===a)return e.apply(null,arguments);var o=r.get(a);o||(r.set(a,o=new S(e)),o.subscribe=t.subscribe);var s=o.recompute(Array.prototype.slice.call(arguments));return r.set(a,o),P.add(r),v.hasValue()||(P.forEach((function(e){return e.clean()})),P.clear()),s}function o(){var e=i.apply(null,arguments);if(void 0!==e)return r.get(e)}return a.dirty=function(){var e=o.apply(null,arguments);e&&e.setDirty()},a.peek=function(){var e=o.apply(null,arguments);if(e)return e.peek()},a.forget=function(){var e=i.apply(null,arguments);return void 0!==e&&r.delete(e)},a}var D,L=r(496),U=function(){function e(){this.getFragmentDoc=F(L.Yk)}return e.prototype.recordOptimisticTransaction=function(e,t){this.performTransaction(e,t)},e.prototype.transformDocument=function(e){return e},e.prototype.identify=function(e){},e.prototype.gc=function(){return[]},e.prototype.modify=function(e){return!1},e.prototype.transformForLink=function(e){return e},e.prototype.readQuery=function(e,t){return void 0===t&&(t=!!e.optimistic),this.read({rootId:e.id||"ROOT_QUERY",query:e.query,variables:e.variables,returnPartialData:e.returnPartialData,optimistic:t})},e.prototype.readFragment=function(e,t){return void 0===t&&(t=!!e.optimistic),this.read({query:this.getFragmentDoc(e.fragment,e.fragmentName),variables:e.variables,rootId:e.id,returnPartialData:e.returnPartialData,optimistic:t})},e.prototype.writeQuery=function(e){return this.write({dataId:e.id||"ROOT_QUERY",result:e.data,query:e.query,variables:e.variables,broadcast:e.broadcast})},e.prototype.writeFragment=function(e){return this.write({dataId:e.id,result:e.data,variables:e.variables,query:this.getFragmentDoc(e.fragment,e.fragmentName),broadcast:e.broadcast})},e}();D||(D={});var j=function(e,t,r,n,i){this.message=e,this.path=t,this.query=r,this.clientOnly=n,this.variables=i},V=r(655),K=r(2924),M=r(2152),q=Object.prototype.hasOwnProperty;var z=/^[_a-z][_0-9a-z]*/i;function H(e){var t=e.match(z);return t?t[0]:e}function G(e,t,r){return!(!t||"object"!=typeof t)&&(Array.isArray(t)?t.every((function(t){return G(e,t,r)})):e.selections.every((function(e){if((0,L.My)(e)&&(0,L.LZ)(e,r)){var n=(0,L.u2)(e);return q.call(t,n)&&(!e.selectionSet||G(e.selectionSet,t[n],r))}return!0})))}function Q(e){return null!==e&&"object"==typeof e&&!(0,L.hh)(e)&&!Array.isArray(e)}var W=Object.create(null),Y=function(){return W},Z=Object.create(null),J=function(){function e(e,t){var r=this;this.policies=e,this.group=t,this.data=Object.create(null),this.rootIds=Object.create(null),this.refs=Object.create(null),this.getFieldValue=function(e,t){return(0,L.Jv)((0,L.hh)(e)?r.get(e.__ref,t):e&&e[t])},this.canRead=function(e){return(0,L.hh)(e)?r.has(e.__ref):"object"==typeof e},this.toReference=function(e,t){if("string"==typeof e)return(0,L.kQ)(e);if((0,L.hh)(e))return e;var n=r.policies.identify(e)[0];if(n){var i=(0,L.kQ)(n);return t&&r.merge(n,e),i}}}return e.prototype.toObject=function(){return(0,V.pi)({},this.data)},e.prototype.has=function(e){return void 0!==this.lookup(e,!0)},e.prototype.get=function(e,t){if(this.group.depend(e,t),q.call(this.data,e)){var r=this.data[e];if(r&&q.call(r,t))return r[t]}return"__typename"===t&&q.call(this.policies.rootTypenamesById,e)?this.policies.rootTypenamesById[e]:this instanceof ee?this.parent.get(e,t):void 0},e.prototype.lookup=function(e,t){return t&&this.group.depend(e,"__exists"),q.call(this.data,e)?this.data[e]:this instanceof ee?this.parent.lookup(e,t):this.policies.rootTypenamesById[e]?Object.create(null):void 0},e.prototype.merge=function(e,t){var r=this,n=this.lookup(e),i=new L.w0(te).merge(n,t);if(this.data[e]=i,i!==n&&(delete this.refs[e],this.group.caching)){var a=Object.create(null);n||(a.__exists=1),Object.keys(t).forEach((function(e){if(!n||n[e]!==i[e]){a[e]=1;var t=H(e);t===e||r.policies.hasKeyArgs(i.__typename,t)||(a[t]=1),void 0!==i[e]||r instanceof ee||delete i[e]}})),Object.keys(a).forEach((function(t){return r.group.dirty(e,t)}))}},e.prototype.modify=function(e,t){var r=this,n=this.lookup(e);if(n){var i=Object.create(null),a=!1,o=!0,s={DELETE:W,INVALIDATE:Z,isReference:L.hh,toReference:this.toReference,canRead:this.canRead,readField:function(t,n){return r.policies.readField("string"==typeof t?{fieldName:t,from:n||(0,L.kQ)(e)}:t,{store:r})}};if(Object.keys(n).forEach((function(u){var c=H(u),l=n[u];if(void 0!==l){var f="function"==typeof t?t:t[u]||t[c];if(f){var h=f===Y?W:f((0,L.Jv)(l),(0,V.pi)((0,V.pi)({},s),{fieldName:c,storeFieldName:u,storage:r.getStorage(e,u)}));h===Z?r.group.dirty(e,u):(h===W&&(h=void 0),h!==l&&(i[u]=h,a=!0,l=h))}void 0!==l&&(o=!1)}})),a)return this.merge(e,i),o&&(this instanceof ee?this.data[e]=void 0:delete this.data[e],this.group.dirty(e,"__exists")),!0}return!1},e.prototype.delete=function(e,t,r){var n,i=this.lookup(e);if(i){var a=this.getFieldValue(i,"__typename"),o=t&&r?this.policies.getStoreFieldName({typename:a,fieldName:t,args:r}):t;return this.modify(e,o?((n={})[o]=Y,n):Y)}return!1},e.prototype.evict=function(e){var t=!1;return e.id&&(q.call(this.data,e.id)&&(t=this.delete(e.id,e.fieldName,e.args)),this instanceof ee&&(t=this.parent.evict(e)||t),(e.fieldName||t)&&this.group.dirty(e.id,e.fieldName||"__exists")),t},e.prototype.clear=function(){this.replace(null)},e.prototype.extract=function(){var e=this,t=this.toObject(),r=[];return this.getRootIdSet().forEach((function(t){q.call(e.policies.rootTypenamesById,t)||r.push(t)})),r.length&&(t.__META={extraRootIds:r.sort()}),t},e.prototype.replace=function(e){var t=this;if(Object.keys(this.data).forEach((function(r){e&&q.call(e,r)||t.delete(r)})),e){var r=e.__META,n=(0,V._T)(e,["__META"]);Object.keys(n).forEach((function(e){t.merge(e,n[e])})),r&&r.extraRootIds.forEach(this.retain,this)}},e.prototype.retain=function(e){return this.rootIds[e]=(this.rootIds[e]||0)+1},e.prototype.release=function(e){if(this.rootIds[e]>0){var t=--this.rootIds[e];return t||delete this.rootIds[e],t}return 0},e.prototype.getRootIdSet=function(e){return void 0===e&&(e=new Set),Object.keys(this.rootIds).forEach(e.add,e),this instanceof ee?this.parent.getRootIdSet(e):Object.keys(this.policies.rootTypenamesById).forEach(e.add,e),e},e.prototype.gc=function(){var e=this,t=this.getRootIdSet(),r=this.toObject();t.forEach((function(n){q.call(r,n)&&(Object.keys(e.findChildRefIds(n)).forEach(t.add,t),delete r[n])}));var n=Object.keys(r);if(n.length){for(var i=this;i instanceof ee;)i=i.parent;n.forEach((function(e){return i.delete(e)}))}return n},e.prototype.findChildRefIds=function(e){if(!q.call(this.refs,e)){var t=this.refs[e]=Object.create(null),r=new Set([this.data[e]]),n=function(e){return null!==e&&"object"==typeof e};r.forEach((function(e){(0,L.hh)(e)?t[e.__ref]=!0:n(e)&&Object.values(e).filter(n).forEach(r.add,r)}))}return this.refs[e]},e.prototype.makeCacheKey=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return this.group.keyMaker.lookupArray(e)},e}(),X=function(){function e(e){this.caching=e,this.d=null,this.keyMaker=new s(L.mr),this.d=e?O():null}return e.prototype.depend=function(e,t){if(this.d){this.d($(e,t));var r=H(t);r!==t&&this.d($(e,r))}},e.prototype.dirty=function(e,t){this.d&&this.d.dirty($(e,t))},e}();function $(e,t){return t+"#"+e}!function(e){var t=function(e){function t(t){var r=t.policies,n=t.resultCaching,i=void 0===n||n,a=t.seed,o=e.call(this,r,new X(i))||this;return o.storageTrie=new s(L.mr),o.sharedLayerGroup=new X(i),a&&o.replace(a),o}return(0,V.ZT)(t,e),t.prototype.addLayer=function(e,t){return new ee(e,this,t,this.sharedLayerGroup)},t.prototype.removeLayer=function(){return this},t.prototype.getStorage=function(){return this.storageTrie.lookupArray(arguments)},t}(e);e.Root=t}(J||(J={}));var ee=function(e){function t(t,r,n,i){var a=e.call(this,r.policies,i)||this;return a.id=t,a.parent=r,a.replay=n,a.group=i,n(a),a}return(0,V.ZT)(t,e),t.prototype.addLayer=function(e,r){return new t(e,this,r,this.group)},t.prototype.removeLayer=function(e){var t=this,r=this.parent.removeLayer(e);return e===this.id?(this.group.caching&&Object.keys(this.data).forEach((function(e){t.data[e]!==r.lookup(e)&&t.delete(e)})),r):r===this.parent?this:r.addLayer(this.id,this.replay)},t.prototype.toObject=function(){return(0,V.pi)((0,V.pi)({},this.parent.toObject()),this.data)},t.prototype.findChildRefIds=function(t){var r=this.parent.findChildRefIds(t);return q.call(this.data,t)?(0,V.pi)((0,V.pi)({},r),e.prototype.findChildRefIds.call(this,t)):r},t.prototype.getStorage=function(){for(var e=this.parent;e.parent;)e=e.parent;return e.getStorage.apply(e,arguments)},t}(J);function te(e,t,r){var n=e[r],i=t[r];return(0,M.D)(n,i)?n:i}function re(e){return!!(e instanceof J&&e.group.caching)}function ne(e,t){return new j(e.message,t.path.slice(),t.query,t.clientOnly,t.variables)}var ie=function(){function e(e){var t=this;this.config=e,this.executeSelectionSet=F((function(e){return t.execSelectionSetImpl(e)}),{keyArgs:function(e){return[e.selectionSet,e.objectOrReference,e.context]},makeCacheKey:function(e,t,r){if(re(r.store))return r.store.makeCacheKey(e,(0,L.hh)(t)?t.__ref:t,r.varString)}}),this.knownResults=new WeakMap,this.executeSubSelectedArray=F((function(e){return t.execSubSelectedArrayImpl(e)}),{makeCacheKey:function(e){var t=e.field,r=e.array,n=e.context;if(re(n.store))return n.store.makeCacheKey(t,r,n.varString)}}),this.config=(0,V.pi)({addTypename:!0},e)}return e.prototype.diffQueryAgainstStore=function(e){var t=e.store,r=e.query,n=e.rootId,i=void 0===n?"ROOT_QUERY":n,a=e.variables,o=e.returnPartialData,s=void 0===o||o,u=this.config.cache.policies;a=(0,V.pi)((0,V.pi)({},(0,L.O4)((0,L.iW)(r))),a);var c=this.executeSelectionSet({selectionSet:(0,L.p$)(r).selectionSet,objectOrReference:(0,L.kQ)(i),context:{store:t,query:r,policies:u,variables:a,varString:JSON.stringify(a),fragmentMap:(0,L.F)((0,L.kU)(r)),path:[],clientOnly:!1}}),l=c.missing&&c.missing.length>0;if(l&&!s)throw c.missing[0];return{result:c.result,missing:c.missing,complete:!l}},e.prototype.isFresh=function(e,t,r,n){if(re(n.store)&&this.knownResults.get(e)===r){var i=this.executeSelectionSet.peek(r,t,n);if(i&&e===i.result)return!0}return!1},e.prototype.execSelectionSetImpl=function(e){var t=this,r=e.selectionSet,n=e.objectOrReference,i=e.context;if((0,L.hh)(n)&&!i.policies.rootTypenamesById[n.__ref]&&!i.store.has(n.__ref))return{result:{},missing:[ne(new K.ej(4),i)]};var a=i.variables,o=i.policies,s=i.store,u=[],c={result:null},l=s.getFieldValue(n,"__typename");function f(){return c.missing||(c.missing=[])}function h(e){var t;return e.missing&&(t=f()).push.apply(t,e.missing),e.result}this.config.addTypename&&"string"==typeof l&&!o.rootIdsByTypename[l]&&u.push({__typename:l});var p=new Set(r.selections);return p.forEach((function(e){var r;if((0,L.LZ)(e,a))if((0,L.My)(e)){var s=o.readField({fieldName:e.name.value,field:e,variables:i.variables,from:n},i),c=(0,L.u2)(e);i.path.push(c);var d=i.clientOnly;i.clientOnly=d||!(!e.directives||!e.directives.some((function(e){return"client"===e.name.value}))),void 0===s?L.Gw.added(e)||f().push(ne(new K.ej(5),i)):Array.isArray(s)?s=h(t.executeSubSelectedArray({field:e,array:s,context:i})):e.selectionSet&&null!=s&&(s=h(t.executeSelectionSet({selectionSet:e.selectionSet,objectOrReference:s,context:i}))),void 0!==s&&u.push(((r={})[c]=s,r)),i.clientOnly=d,(0,K.kG)(i.path.pop()===c)}else{var y=(0,L.hi)(e,i.fragmentMap);y&&o.fragmentMatches(y,l)&&y.selectionSet.selections.forEach(p.add,p)}})),c.result=(0,L.bw)(u),this.knownResults.set(c.result,r),c},e.prototype.execSubSelectedArrayImpl=function(e){var t,r=this,n=e.field,i=e.array,a=e.context;function o(e,r){return e.missing&&(t=t||[]).push.apply(t,e.missing),(0,K.kG)(a.path.pop()===r),e.result}return n.selectionSet&&(i=i.filter(a.store.canRead)),{result:i=i.map((function(e,t){return null===e?null:(a.path.push(t),Array.isArray(e)?o(r.executeSubSelectedArray({field:n,array:e,context:a}),t):n.selectionSet?o(r.executeSelectionSet({selectionSet:n.selectionSet,objectOrReference:e,context:a}),t):((0,K.kG)(a.path.pop()===t),e))})),missing:t}},e}();var ae=function(){function e(e,t){this.cache=e,this.reader=t}return e.prototype.writeToStore=function(e){var t=e.query,r=e.result,n=e.dataId,i=e.store,a=e.variables,o=(0,L.$H)(t),s=new L.w0;a=(0,V.pi)((0,V.pi)({},(0,L.O4)(o)),a);var u=this.processSelectionSet({result:r||Object.create(null),dataId:n,selectionSet:o.selectionSet,mergeTree:{map:new Map},context:{store:i,written:Object.create(null),merge:function(e,t){return s.merge(e,t)},variables:a,varString:JSON.stringify(a),fragmentMap:(0,L.F)((0,L.kU)(t))}});if(!(0,L.hh)(u))throw new K.ej(7);return i.retain(u.__ref),u},e.prototype.processSelectionSet=function(e){var t=this,r=e.dataId,n=e.result,i=e.selectionSet,a=e.context,o=e.mergeTree,s=this.cache.policies,u=s.identify(n,i,a.fragmentMap),c=u[0],l=u[1];if("string"==typeof(r=r||c)){var f=a.written[r]||(a.written[r]=[]),h=(0,L.kQ)(r);if(f.indexOf(i)>=0)return h;if(f.push(i),this.reader&&this.reader.isFresh(n,h,i,a))return h}var p=Object.create(null);l&&(p=a.merge(p,l));var d=r&&s.rootTypenamesById[r]||(0,L.qw)(n,i,a.fragmentMap)||r&&a.store.get(r,"__typename");"string"==typeof d&&(p.__typename=d);var y=new Set(i.selections);if(y.forEach((function(e){var r;if((0,L.LZ)(e,a.variables))if((0,L.My)(e)){var i=(0,L.u2)(e),u=n[i];if(void 0!==u){var c=s.getStoreFieldName({typename:d,fieldName:e.name.value,field:e,variables:a.variables}),l=se(o,c),f=t.processFieldValue(u,e,a,l),h=e.selectionSet&&a.store.getFieldValue(f,"__typename")||void 0,v=s.getMergeFunction(d,e.name.value,h);v?l.info={field:e,typename:d,merge:v}:ue(o,c),p=a.merge(p,((r={})[c]=f,r))}else if(s.usingPossibleTypes&&!(0,L.FS)(["defer","client"],e))throw new K.ej(8)}else{var g=(0,L.hi)(e,a.fragmentMap);g&&s.fragmentMatches(g,d,n,a.variables)&&g.selectionSet.selections.forEach(y.add,y)}})),"string"==typeof r){var v=(0,L.kQ)(r);return o.map.size&&(p=this.applyMerges(o,v,p,a)),a.store.merge(r,p),v}return p},e.prototype.processFieldValue=function(e,t,r,n){var i=this;return t.selectionSet&&null!==e?Array.isArray(e)?e.map((function(e,a){var o=i.processFieldValue(e,t,r,se(n,a));return ue(n,a),o})):this.processSelectionSet({result:e,selectionSet:t.selectionSet,context:r,mergeTree:n}):e},e.prototype.applyMerges=function(e,t,r,n,i){var a,o=this;if(e.map.size&&!(0,L.hh)(r)){var s,u=Array.isArray(r)||!(0,L.hh)(t)&&!Q(t)?void 0:t,c=r;u&&!i&&(i=[(0,L.hh)(u)?u.__ref:u]);var l=function(e,t){return Array.isArray(e)?"number"==typeof t?e[t]:void 0:n.store.getFieldValue(e,String(t))};e.map.forEach((function(e,t){i&&i.push(t);var r=l(u,t),a=l(c,t),f=o.applyMerges(e,r,a,n,i);f!==a&&(s=s||new Map).set(t,f),i&&(0,K.kG)(i.pop()===t)})),s&&(r=Array.isArray(c)?c.slice(0):(0,V.pi)({},c),s.forEach((function(e,t){r[t]=e})))}return e.info?this.cache.policies.runMergeFunction(t,r,e.info,n,i&&(a=n.store).getStorage.apply(a,i)):r},e}(),oe=[];function se(e,t){var r=e.map;return r.has(t)||r.set(t,oe.pop()||{map:new Map}),r.get(t)}function ue(e,t){var r=e.map,n=r.get(t);!n||n.info||n.map.size||(oe.push(n),r.delete(t))}new Set;var ce=new p;function le(e,t){if(e.size){var r=[];e.forEach((function(e){return r.push(e)})),e.clear(),r.forEach(t)}}var fe=new WeakMap;function he(e){var t=fe.get(e);return t||fe.set(e,t={vars:new Set,dep:O()}),t}function pe(e){var t=new Set,r=new Set,n=function(a){if(arguments.length>0)e!==a&&(e=a,t.forEach((function(e){he(e).dep.dirty(n),de(e)})),le(r,(function(t){return t(e)})));else{var o=ce.getValue();o&&(i(o),he(o).dep(n))}return e};n.onNextChange=function(e){return r.add(e),function(){r.delete(e)}};var i=n.attachCache=function(e){return t.add(e),he(e).vars.add(n),n};return n.forgetCache=function(e){return t.delete(e)},n}function de(e){e.broadcastWatches&&e.broadcastWatches()}function ye(e){return void 0!==e.args?e.args:e.field?(0,L.NC)(e.field,e.variables):null}var ve=function(e,t){var r=e.__typename,n=e.id,i=e._id;if("string"==typeof r&&(t&&(t.keyObject=void 0!==n?{id:n}:void 0!==i?{_id:i}:void 0),void 0===n&&(n=i),void 0!==n))return r+":"+("number"==typeof n||"string"==typeof n?n:JSON.stringify(n))},ge=function(){},me=function(e,t){return t.fieldName},be=function(e,t,r){return(0,r.mergeObjects)(e,t)},Ee=function(e,t){return t},Se=function(){function e(e){this.config=e,this.typePolicies=Object.create(null),this.toBeAdded=Object.create(null),this.supertypeMap=new Map,this.fuzzySubtypes=new Map,this.rootIdsByTypename=Object.create(null),this.rootTypenamesById=Object.create(null),this.usingPossibleTypes=!1,this.config=(0,V.pi)({dataIdFromObject:ve},e),this.cache=this.config.cache,this.setRootTypename("Query"),this.setRootTypename("Mutation"),this.setRootTypename("Subscription"),e.possibleTypes&&this.addPossibleTypes(e.possibleTypes),e.typePolicies&&this.addTypePolicies(e.typePolicies)}return e.prototype.identify=function(e,t,r){var n=t&&r?(0,L.qw)(e,t,r):e.__typename;if(n===this.rootTypenamesById.ROOT_QUERY)return["ROOT_QUERY"];for(var i,a={typename:n,selectionSet:t,fragmentMap:r},o=n&&this.getTypePolicy(n),s=o&&o.keyFn||this.config.dataIdFromObject;s;){var u=s(e,a);if(!Array.isArray(u)){i=u;break}s=Ae(u)}return i=i&&String(i),a.keyObject?[i,a.keyObject]:[i]},e.prototype.addTypePolicies=function(e){var t=this;Object.keys(e).forEach((function(r){var n=e[r],i=n.queryType,a=n.mutationType,o=n.subscriptionType,s=(0,V._T)(n,["queryType","mutationType","subscriptionType"]);i&&t.setRootTypename("Query",r),a&&t.setRootTypename("Mutation",r),o&&t.setRootTypename("Subscription",r),q.call(t.toBeAdded,r)?t.toBeAdded[r].push(s):t.toBeAdded[r]=[s]}))},e.prototype.updateTypePolicy=function(e,t){var r=this,n=this.getTypePolicy(e),i=t.keyFields,a=t.fields;function o(e,t){e.merge="function"==typeof t?t:!0===t?be:!1===t?Ee:e.merge}o(n,t.merge),n.keyFn=!1===i?ge:Array.isArray(i)?Ae(i):"function"==typeof i?i:n.keyFn,a&&Object.keys(a).forEach((function(t){var n=r.getFieldPolicy(e,t,!0),i=a[t];if("function"==typeof i)n.read=i;else{var s=i.keyArgs,u=i.read,c=i.merge;n.keyFn=!1===s?me:Array.isArray(s)?Te(s):"function"==typeof s?s:n.keyFn,"function"==typeof u&&(n.read=u),o(n,c)}n.read&&n.merge&&(n.keyFn=n.keyFn||me)}))},e.prototype.setRootTypename=function(e,t){void 0===t&&(t=e);var r="ROOT_"+e.toUpperCase(),n=this.rootTypenamesById[r];t!==n&&((0,K.kG)(!n||n===e,1),n&&delete this.rootIdsByTypename[n],this.rootIdsByTypename[t]=r,this.rootTypenamesById[r]=t)},e.prototype.addPossibleTypes=function(e){var t=this;this.usingPossibleTypes=!0,Object.keys(e).forEach((function(r){t.getSupertypeSet(r,!0),e[r].forEach((function(e){t.getSupertypeSet(e,!0).add(r);var n=e.match(z);n&&n[0]===e||t.fuzzySubtypes.set(e,new RegExp(e))}))}))},e.prototype.getTypePolicy=function(e){var t=this;if(!q.call(this.typePolicies,e)){var r=this.typePolicies[e]=Object.create(null);r.fields=Object.create(null);var n=this.supertypeMap.get(e);n&&n.size&&n.forEach((function(e){var n=t.getTypePolicy(e),i=n.fields,a=(0,V._T)(n,["fields"]);Object.assign(r,a),Object.assign(r.fields,i)}))}var i=this.toBeAdded[e];return i&&i.length&&this.updateTypePolicy(e,L.oA.apply(void 0,i.splice(0))),this.typePolicies[e]},e.prototype.getFieldPolicy=function(e,t,r){if(e){var n=this.getTypePolicy(e).fields;return n[t]||r&&(n[t]=Object.create(null))}},e.prototype.getSupertypeSet=function(e,t){var r=this.supertypeMap.get(e);return!r&&t&&this.supertypeMap.set(e,r=new Set),r},e.prototype.fragmentMatches=function(e,t,r,n){var i=this;if(!e.typeCondition)return!0;if(!t)return!1;var a=e.typeCondition.name.value;if(t===a)return!0;if(this.usingPossibleTypes&&this.supertypeMap.has(a))for(var o=this.getSupertypeSet(t,!0),s=[o],u=function(e){var t=i.getSupertypeSet(e,!1);t&&t.size&&s.indexOf(t)<0&&s.push(t)},c=!(!r||!this.fuzzySubtypes.size),l=0;l<s.length;++l){var f=s[l];if(f.has(a))return o.has(a)||o.add(a),!0;f.forEach(u),c&&l===s.length-1&&G(e.selectionSet,r,n)&&(c=!1,!0,this.fuzzySubtypes.forEach((function(e,r){var n=t.match(e);n&&n[0]===t&&u(r)})))}return!1},e.prototype.hasKeyArgs=function(e,t){var r=this.getFieldPolicy(e,t,!1);return!(!r||!r.keyFn)},e.prototype.getStoreFieldName=function(e){var t,r=e.typename,n=e.fieldName,i=this.getFieldPolicy(r,n,!1),a=i&&i.keyFn;if(a&&r)for(var o={typename:r,fieldName:n,field:e.field||null,variables:e.variables},s=ye(e);a;){var u=a(s,o);if(!Array.isArray(u)){t=u||n;break}a=Te(u)}return void 0===t&&(t=e.field?(0,L.vf)(e.field,e.variables):(0,L.PT)(n,ye(e))),n===H(t)?t:n+":"+t},e.prototype.readField=function(e,t){var r=e.from;if(r&&(e.field||e.fieldName)){if(void 0===e.typename){var n=t.store.getFieldValue(r,"__typename");n&&(e.typename=n)}var i=this.getStoreFieldName(e),a=H(i),o=t.store.getFieldValue(r,i),s=this.getFieldPolicy(e.typename,a,!1),u=s&&s.read;if(u){var c=Ce(this,r,e,t,t.store.getStorage((0,L.hh)(r)?r.__ref:r,i));return ce.withValue(this.cache,u,[o,c])}return o}},e.prototype.getMergeFunction=function(e,t,r){var n=this.getFieldPolicy(e,t,!1),i=n&&n.merge;return!i&&r&&(i=(n=this.getTypePolicy(r))&&n.merge),i},e.prototype.runMergeFunction=function(e,t,r,n,i){var a=r.field,o=r.typename,s=r.merge;return s===be?we(n.store.getFieldValue)(e,t):s===Ee?t:s(e,t,Ce(this,void 0,{typename:o,fieldName:a.name.value,field:a,variables:n.variables},n,i||Object.create(null)))},e}();function Ce(e,t,r,n,i){var a=e.getStoreFieldName(r),o=H(a),s=r.variables||n.variables,u=n.store,c=u.getFieldValue,l=u.toReference,f=u.canRead;return{args:ye(r),field:r.field||null,fieldName:o,storeFieldName:a,variables:s,isReference:L.hh,toReference:l,storage:i,cache:e.cache,canRead:f,readField:function(r,i){var a="string"==typeof r?{fieldName:r,from:i}:(0,V.pi)({},r);return void 0===a.from&&(a.from=t),void 0===a.variables&&(a.variables=s),e.readField(a,n)},mergeObjects:we(c)}}function we(e){return function(t,r){if(Array.isArray(t)||Array.isArray(r))throw new K.ej(2);if(t&&"object"==typeof t&&r&&"object"==typeof r){var n=e(t,"__typename"),i=e(r,"__typename");return!(n&&i&&n!==i)&&Q(t)&&Q(r)?(0,V.pi)((0,V.pi)({},t),r):r}return r}}function Te(e){return function(t,r){return t?r.fieldName+":"+JSON.stringify(ke(t,e,!1)):r.fieldName}}function Ae(e){var t=new s(L.mr);return function(r,n){var i;if(n.selectionSet&&n.fragmentMap){var a=t.lookupArray([n.selectionSet,n.fragmentMap]);i=a.aliasMap||(a.aliasMap=Ie(n.selectionSet,n.fragmentMap))}var o=n.keyObject=ke(r,e,!0,i);return n.typename+":"+JSON.stringify(o)}}function Ie(e,t){var r=Object.create(null),n=new Set([e]);return n.forEach((function(e){e.selections.forEach((function(e){if((0,L.My)(e)){if(e.alias){var i=e.alias.value,a=e.name.value;if(a!==i)(r.aliases||(r.aliases=Object.create(null)))[a]=i}if(e.selectionSet)(r.subsets||(r.subsets=Object.create(null)))[e.name.value]=Ie(e.selectionSet,t)}else{var o=(0,L.hi)(e,t);o&&n.add(o.selectionSet)}}))})),r}function ke(e,t,r,n){var i,a=Object.create(null);return t.forEach((function(t){if(Array.isArray(t)){if("string"==typeof i){var o=n&&n.subsets,s=o&&o[i];a[i]=ke(e[i],t,r,s)}}else{var u=n&&n.aliases,c=u&&u[t]||t;q.call(e,c)?a[i=t]=e[c]:((0,K.kG)(!r,3),i=void 0)}})),a}var _e={dataIdFromObject:ve,addTypename:!0,resultCaching:!0,typePolicies:{}},Be=function(e){function t(t){void 0===t&&(t={});var r=e.call(this)||this;return r.watches=new Set,r.typenameDocumentCache=new Map,r.makeVar=pe,r.txCount=0,r.maybeBroadcastWatch=F((function(e,t){return r.broadcastWatch.call(r,e,!!t)}),{makeCacheKey:function(e){var t=e.optimistic?r.optimisticData:r.data;if(re(t)){var n=e.optimistic,i=e.rootId,a=e.variables;return t.makeCacheKey(e.query,e.callback,JSON.stringify({optimistic:n,rootId:i,variables:a}))}}}),r.watchDep=O(),r.config=(0,V.pi)((0,V.pi)({},_e),t),r.addTypename=!!r.config.addTypename,r.policies=new Se({cache:r,dataIdFromObject:r.config.dataIdFromObject,possibleTypes:r.config.possibleTypes,typePolicies:r.config.typePolicies}),r.data=new J.Root({policies:r.policies,resultCaching:r.config.resultCaching}),r.optimisticData=r.data,r.storeWriter=new ae(r,r.storeReader=new ie({cache:r,addTypename:r.addTypename})),r}return(0,V.ZT)(t,e),t.prototype.restore=function(e){return e&&this.data.replace(e),this},t.prototype.extract=function(e){return void 0===e&&(e=!1),(e?this.optimisticData:this.data).extract()},t.prototype.read=function(e){var t=e.returnPartialData,r=void 0!==t&&t;try{return this.storeReader.diffQueryAgainstStore({store:e.optimistic?this.optimisticData:this.data,query:e.query,variables:e.variables,rootId:e.rootId,config:this.config,returnPartialData:r}).result||null}catch(e){if(e instanceof j)return null;throw e}},t.prototype.write=function(e){try{return++this.txCount,this.storeWriter.writeToStore({store:this.data,query:e.query,result:e.result,dataId:e.dataId,variables:e.variables})}finally{--this.txCount||!1===e.broadcast||this.broadcastWatches()}},t.prototype.modify=function(e){if(q.call(e,"id")&&!e.id)return!1;var t=e.optimistic?this.optimisticData:this.data;try{return++this.txCount,t.modify(e.id||"ROOT_QUERY",e.fields)}finally{--this.txCount||!1===e.broadcast||this.broadcastWatches()}},t.prototype.diff=function(e){return this.storeReader.diffQueryAgainstStore({store:e.optimistic?this.optimisticData:this.data,rootId:e.id||"ROOT_QUERY",query:e.query,variables:e.variables,returnPartialData:e.returnPartialData,config:this.config})},t.prototype.watch=function(e){var t,r=this;return this.watches.size||he(t=this).vars.forEach((function(e){return e.attachCache(t)})),this.watches.add(e),e.immediate&&this.maybeBroadcastWatch(e),function(){r.watches.delete(e)&&!r.watches.size&&function(e){he(e).vars.forEach((function(t){return t.forgetCache(e)}))}(r),r.watchDep.dirty(e),r.maybeBroadcastWatch.forget(e)}},t.prototype.gc=function(){return this.optimisticData.gc()},t.prototype.retain=function(e,t){return(t?this.optimisticData:this.data).retain(e)},t.prototype.release=function(e,t){return(t?this.optimisticData:this.data).release(e)},t.prototype.identify=function(e){return(0,L.hh)(e)?e.__ref:this.policies.identify(e)[0]},t.prototype.evict=function(e){if(!e.id){if(q.call(e,"id"))return!1;e=(0,V.pi)((0,V.pi)({},e),{id:"ROOT_QUERY"})}try{return++this.txCount,this.optimisticData.evict(e)}finally{--this.txCount||!1===e.broadcast||this.broadcastWatches()}},t.prototype.reset=function(){return this.data.clear(),this.optimisticData=this.data,this.broadcastWatches(),Promise.resolve()},t.prototype.removeOptimistic=function(e){var t=this.optimisticData.removeLayer(e);t!==this.optimisticData&&(this.optimisticData=t,this.broadcastWatches())},t.prototype.performTransaction=function(e,t){var r=this,n=function(t){var n=r,i=n.data,a=n.optimisticData;++r.txCount,t&&(r.data=r.optimisticData=t);try{e(r)}finally{--r.txCount,r.data=i,r.optimisticData=a}},i=!1;"string"==typeof t?(this.optimisticData=this.optimisticData.addLayer(t,n),i=!0):null===t?n(this.data):n(),this.broadcastWatches(i)},t.prototype.transformDocument=function(e){if(this.addTypename){var t=this.typenameDocumentCache.get(e);return t||(t=(0,L.Gw)(e),this.typenameDocumentCache.set(e,t),this.typenameDocumentCache.set(t,t)),t}return e},t.prototype.broadcastWatches=function(e){var t=this;this.txCount||this.watches.forEach((function(r){return t.maybeBroadcastWatch(r,e)}))},t.prototype.broadcastWatch=function(e,t){this.watchDep.dirty(e),this.watchDep(e);var r=this.diff({query:e.query,variables:e.variables,optimistic:e.optimistic});e.optimistic&&t&&(r.fromOptimisticTransaction=!0),e.callback(r)},t}(U)},5367:()=>{},5765:(e,t,r)=>{"use strict";r.d(t,{f:()=>w});var n=r(655),i=r(2924),a=r(1707),o=r(496),s=r(9950),u=r(2152),c=r(1498),l=r(6282),f=r(5942),h=r(7636),p=r(2634),d=function(){function e(e){var t=e.cache,r=e.client,n=e.resolvers,i=e.fragmentMatcher;this.cache=t,r&&(this.client=r),n&&this.addResolvers(n),i&&this.setFragmentMatcher(i)}return e.prototype.addResolvers=function(e){var t=this;this.resolvers=this.resolvers||{},Array.isArray(e)?e.forEach((function(e){t.resolvers=(0,o.Ee)(t.resolvers,e)})):this.resolvers=(0,o.Ee)(this.resolvers,e)},e.prototype.setResolvers=function(e){this.resolvers={},this.addResolvers(e)},e.prototype.getResolvers=function(){return this.resolvers||{}},e.prototype.runResolvers=function(e){var t=e.document,r=e.remoteResult,i=e.context,a=e.variables,o=e.onlyRunForcedResolvers,s=void 0!==o&&o;return(0,n.mG)(this,void 0,void 0,(function(){return(0,n.Jh)(this,(function(e){return t?[2,this.resolveDocument(t,r.data,i,a,this.fragmentMatcher,s).then((function(e){return(0,n.pi)((0,n.pi)({},r),{data:e.result})}))]:[2,r]}))}))},e.prototype.setFragmentMatcher=function(e){this.fragmentMatcher=e},e.prototype.getFragmentMatcher=function(){return this.fragmentMatcher},e.prototype.clientQuery=function(e){return(0,o.FS)(["client"],e)&&this.resolvers?e:null},e.prototype.serverQuery=function(e){return(0,o.ob)(e)},e.prototype.prepareContext=function(e){var t=this.cache;return(0,n.pi)((0,n.pi)({},e),{cache:t,getCacheKey:function(e){return t.identify(e)}})},e.prototype.addExportedVariables=function(e,t,r){return void 0===t&&(t={}),void 0===r&&(r={}),(0,n.mG)(this,void 0,void 0,(function(){return(0,n.Jh)(this,(function(i){return e?[2,this.resolveDocument(e,this.buildRootValueFromCache(e,t)||{},this.prepareContext(r),t).then((function(e){return(0,n.pi)((0,n.pi)({},t),e.exportedVariables)}))]:[2,(0,n.pi)({},t)]}))}))},e.prototype.shouldForceResolvers=function(e){var t=!1;return(0,h.Vn)(e,{Directive:{enter:function(e){if("client"===e.name.value&&e.arguments&&(t=e.arguments.some((function(e){return"always"===e.name.value&&"BooleanValue"===e.value.kind&&!0===e.value.value}))))return h.$_}}}),t},e.prototype.buildRootValueFromCache=function(e,t){return this.cache.diff({query:(0,o.aL)(e),variables:t,returnPartialData:!0,optimistic:!1}).result},e.prototype.resolveDocument=function(e,t,r,i,a,s){return void 0===r&&(r={}),void 0===i&&(i={}),void 0===a&&(a=function(){return!0}),void 0===s&&(s=!1),(0,n.mG)(this,void 0,void 0,(function(){var u,c,l,f,h,p,d,y,v;return(0,n.Jh)(this,(function(g){return u=(0,o.p$)(e),c=(0,o.kU)(e),l=(0,o.F)(c),f=u.operation,h=f?f.charAt(0).toUpperCase()+f.slice(1):"Query",d=(p=this).cache,y=p.client,v={fragmentMap:l,context:(0,n.pi)((0,n.pi)({},r),{cache:d,client:y}),variables:i,fragmentMatcher:a,defaultOperationType:h,exportedVariables:{},onlyRunForcedResolvers:s},[2,this.resolveSelectionSet(u.selectionSet,t,v).then((function(e){return{result:e,exportedVariables:v.exportedVariables}}))]}))}))},e.prototype.resolveSelectionSet=function(e,t,r){return(0,n.mG)(this,void 0,void 0,(function(){var a,s,u,c,l,f=this;return(0,n.Jh)(this,(function(h){return a=r.fragmentMap,s=r.context,u=r.variables,c=[t],l=function(e){return(0,n.mG)(f,void 0,void 0,(function(){var l,f;return(0,n.Jh)(this,(function(n){return(0,o.LZ)(e,u)?(0,o.My)(e)?[2,this.resolveField(e,t,r).then((function(t){var r;void 0!==t&&c.push(((r={})[(0,o.u2)(e)]=t,r))}))]:((0,o.Ao)(e)?l=e:(l=a[e.name.value],(0,i.kG)(l,11)),l&&l.typeCondition&&(f=l.typeCondition.name.value,r.fragmentMatcher(t,f,s))?[2,this.resolveSelectionSet(l.selectionSet,t,r).then((function(e){c.push(e)}))]:[2]):[2]}))}))},[2,Promise.all(e.selections.map(l)).then((function(){return(0,o.bw)(c)}))]}))}))},e.prototype.resolveField=function(e,t,r){return(0,n.mG)(this,void 0,void 0,(function(){var i,a,s,u,c,l,f,h,d,y=this;return(0,n.Jh)(this,(function(n){return i=r.variables,a=e.name.value,s=(0,o.u2)(e),u=a!==s,c=t[s]||t[a],l=Promise.resolve(c),r.onlyRunForcedResolvers&&!this.shouldForceResolvers(e)||(f=t.__typename||r.defaultOperationType,(h=this.resolvers&&this.resolvers[f])&&(d=h[u?a:s])&&(l=Promise.resolve(p.ab.withValue(this.cache,d,[t,(0,o.NC)(e,i),r.context,{field:e,fragmentMap:r.fragmentMap}])))),[2,l.then((function(t){return void 0===t&&(t=c),e.directives&&e.directives.forEach((function(e){"export"===e.name.value&&e.arguments&&e.arguments.forEach((function(e){"as"===e.name.value&&"StringValue"===e.value.kind&&(r.exportedVariables[e.value.value]=t)}))})),e.selectionSet?null==t?t:Array.isArray(t)?y.resolveSubSelectedArray(e,t,r):e.selectionSet?y.resolveSelectionSet(e.selectionSet,t,r):void 0:t}))]}))}))},e.prototype.resolveSubSelectedArray=function(e,t,r){var n=this;return Promise.all(t.map((function(t){return null===t?null:Array.isArray(t)?n.resolveSubSelectedArray(e,t,r):e.selectionSet?n.resolveSelectionSet(e.selectionSet,t,r):void 0})))},e}(),y=new(o.mr?WeakMap:Map);function v(e,t){var r=e[t];"function"==typeof r&&(e[t]=function(){return y.set(e,(y.get(e)+1)%1e15),r.apply(this,arguments)})}function g(e){e.notifyTimeout&&(clearTimeout(e.notifyTimeout),e.notifyTimeout=void 0)}var m=function(){function e(e){this.cache=e,this.listeners=new Set,this.document=null,this.lastRequestId=1,this.subscriptions=new Set,this.stopped=!1,this.dirty=!1,this.diff=null,this.observableQuery=null,y.has(e)||(y.set(e,0),v(e,"evict"),v(e,"modify"),v(e,"reset"))}return e.prototype.init=function(e){var t=e.networkStatus||f.I.loading;return this.variables&&this.networkStatus!==f.I.loading&&!(0,u.D)(this.variables,e.variables)&&(t=f.I.setVariables),(0,u.D)(e.variables,this.variables)||(this.diff=null),Object.assign(this,{document:e.document,variables:e.variables,networkError:null,graphQLErrors:this.graphQLErrors||[],networkStatus:t}),e.observableQuery&&this.setObservableQuery(e.observableQuery),e.lastRequestId&&(this.lastRequestId=e.lastRequestId),this},e.prototype.reset=function(){g(this),this.diff=null,this.dirty=!1},e.prototype.getDiff=function(e){return void 0===e&&(e=this.variables),this.diff&&(0,u.D)(e,this.variables)?this.diff:(this.updateWatch(this.variables=e),this.diff=this.cache.diff({query:this.document,variables:e,returnPartialData:!0,optimistic:!0}))},e.prototype.setDiff=function(e){var t=this,r=this.diff;this.diff=e,this.dirty||(e&&e.result)===(r&&r.result)||(this.dirty=!0,this.notifyTimeout||(this.notifyTimeout=setTimeout((function(){return t.notify()}),0)))},e.prototype.setObservableQuery=function(e){var t=this;e!==this.observableQuery&&(this.oqListener&&this.listeners.delete(this.oqListener),this.observableQuery=e,e?(e.queryInfo=this,this.listeners.add(this.oqListener=function(){t.getDiff().fromOptimisticTransaction?e.observe():e.reobserve()})):delete this.oqListener)},e.prototype.notify=function(){var e=this;g(this),this.shouldNotify()&&this.listeners.forEach((function(t){return t(e)})),this.dirty=!1},e.prototype.shouldNotify=function(){if(!this.dirty||!this.listeners.size)return!1;if((0,f.O)(this.networkStatus)&&this.observableQuery){var e=this.observableQuery.options.fetchPolicy;if("cache-only"!==e&&"cache-and-network"!==e)return!1}return!0},e.prototype.stop=function(){if(!this.stopped){this.stopped=!0,this.cancel(),delete this.cancel,this.subscriptions.forEach((function(e){return e.unsubscribe()}));var e=this.observableQuery;e&&e.stopPolling()}},e.prototype.cancel=function(){},e.prototype.updateWatch=function(e){var t=this;void 0===e&&(e=this.variables);var r=this.observableQuery;r&&"no-cache"===r.options.fetchPolicy||this.lastWatch&&this.lastWatch.query===this.document&&(0,u.D)(e,this.lastWatch.variables)||(this.cancel(),this.cancel=this.cache.watch(this.lastWatch={query:this.document,variables:e,optimistic:!0,callback:function(e){return t.setDiff(e)}}))},e.prototype.shouldWrite=function(e,t){var r=this.lastWrite;return!(r&&r.dmCount===y.get(this.cache)&&(0,u.D)(t,r.variables)&&(0,u.D)(e.data,r.result.data))},e.prototype.markResult=function(e,t,r){var n=this;this.graphQLErrors=(0,o.Of)(e.errors)?e.errors:[],this.reset(),"no-cache"===t.fetchPolicy?this.diff={result:e.data,complete:!0}:!this.stopped&&r&&(b(e,t.errorPolicy)?this.cache.performTransaction((function(r){if(n.shouldWrite(e,t.variables))r.writeQuery({query:n.document,data:e.data,variables:t.variables}),n.lastWrite={result:e,variables:t.variables,dmCount:y.get(n.cache)};else if(n.diff&&n.diff.complete)return void(e.data=n.diff.result);var i=r.diff({query:n.document,variables:t.variables,returnPartialData:!0,optimistic:!0});n.stopped||n.updateWatch(t.variables),n.diff=i,i.complete&&(e.data=i.result)})):this.lastWrite=void 0)},e.prototype.markReady=function(){return this.networkError=null,this.networkStatus=f.I.ready},e.prototype.markError=function(e){return this.networkStatus=f.I.error,this.lastWrite=void 0,this.reset(),e.graphQLErrors&&(this.graphQLErrors=e.graphQLErrors),e.networkError&&(this.networkError=e.networkError),e},e}();function b(e,t){void 0===t&&(t="none");var r="ignore"===t||"all"===t,n=!(0,o.d2)(e);return!n&&r&&e.data&&(n=!0),n}var E=Object.prototype.hasOwnProperty,S=function(){function e(e){var t=e.cache,r=e.link,n=e.queryDeduplication,i=void 0!==n&&n,a=e.onBroadcast,s=e.ssrMode,u=void 0!==s&&s,c=e.clientAwareness,l=void 0===c?{}:c,f=e.localState,h=e.assumeImmutableResults;this.clientAwareness={},this.queries=new Map,this.fetchCancelFns=new Map,this.transformCache=new(o.mr?WeakMap:Map),this.queryIdCounter=1,this.requestIdCounter=1,this.mutationIdCounter=1,this.inFlightLinkObservables=new Map,this.cache=t,this.link=r,this.queryDeduplication=i,this.clientAwareness=l,this.localState=f||new d({cache:t}),this.ssrMode=u,this.assumeImmutableResults=!!h,(this.onBroadcast=a)&&(this.mutationStore=Object.create(null))}return e.prototype.stop=function(){var e=this;this.queries.forEach((function(t,r){e.stopQueryNoBroadcast(r)})),this.cancelPendingFetches(new i.ej(12))},e.prototype.cancelPendingFetches=function(e){this.fetchCancelFns.forEach((function(t){return t(e)})),this.fetchCancelFns.clear()},e.prototype.mutate=function(e){var t=e.mutation,r=e.variables,a=e.optimisticResponse,s=e.updateQueries,u=e.refetchQueries,l=void 0===u?[]:u,f=e.awaitRefetchQueries,h=void 0!==f&&f,p=e.update,d=e.errorPolicy,y=void 0===d?"none":d,v=e.fetchPolicy,g=e.context,m=void 0===g?{}:g;return(0,n.mG)(this,void 0,void 0,(function(){var e,u,f;return(0,n.Jh)(this,(function(d){switch(d.label){case 0:return(0,i.kG)(t,13),(0,i.kG)(!v||"no-cache"===v,14),e=this.generateMutationId(),t=this.transform(t).document,r=this.getVariables(t,r),this.transform(t).hasClientExports?[4,this.localState.addExportedVariables(t,r,m)]:[3,2];case 1:r=d.sent(),d.label=2;case 2:return u=this.mutationStore&&(this.mutationStore[e]={mutation:t,variables:r,loading:!0,error:null}),a&&this.markMutationOptimistic(a,{mutationId:e,document:t,variables:r,errorPolicy:y,updateQueries:s,update:p}),this.broadcastQueries(),f=this,[2,new Promise((function(i,d){var g,b;f.getObservableFromLink(t,(0,n.pi)((0,n.pi)({},m),{optimisticResponse:a}),r,!1).subscribe({next:function(n){if((0,o.d2)(n)&&"none"===y)b=new c.c({graphQLErrors:n.errors});else{if(u&&(u.loading=!1,u.error=null),"no-cache"!==v)try{f.markMutationResult({mutationId:e,result:n,document:t,variables:r,errorPolicy:y,updateQueries:s,update:p})}catch(e){return void(b=new c.c({networkError:e}))}g=n}},error:function(t){u&&(u.loading=!1,u.error=t),a&&f.cache.removeOptimistic(e),f.broadcastQueries(),d(new c.c({networkError:t}))},complete:function(){if(b&&u&&(u.loading=!1,u.error=b),a&&f.cache.removeOptimistic(e),f.broadcastQueries(),b)d(b);else{"function"==typeof l&&(l=l(g));var t=[];(0,o.Of)(l)&&l.forEach((function(e){if("string"==typeof e)f.queries.forEach((function(r){var n=r.observableQuery;n&&n.queryName===e&&t.push(n.refetch())}));else{var r={query:e.query,variables:e.variables,fetchPolicy:"network-only"};e.context&&(r.context=e.context),t.push(f.query(r))}})),Promise.all(h?t:[]).then((function(){"ignore"===y&&g&&(0,o.d2)(g)&&delete g.errors,i(g)}),d)}}})}))]}}))}))},e.prototype.markMutationResult=function(e,t){var r=this;if(void 0===t&&(t=this.cache),b(e.result,e.errorPolicy)){var n=[{result:e.result.data,dataId:"ROOT_MUTATION",query:e.document,variables:e.variables}],i=e.updateQueries;i&&this.queries.forEach((function(a,s){var u=a.observableQuery,c=u&&u.queryName;if(c&&E.call(i,c)){var l=i[c],f=r.queries.get(s),h=f.document,p=f.variables,d=t.diff({query:h,variables:p,returnPartialData:!0,optimistic:!1}),y=d.result;if(d.complete&&y){var v=l(y,{mutationResult:e.result,queryName:h&&(0,o.rY)(h)||void 0,queryVariables:p});v&&n.push({result:v,dataId:"ROOT_QUERY",query:h,variables:p})}}})),t.performTransaction((function(t){n.forEach((function(e){return t.write(e)}));var r=e.update;r&&r(t,e.result)}),null)}},e.prototype.markMutationOptimistic=function(e,t){var r=this,i="function"==typeof e?e(t.variables):e;return this.cache.recordOptimisticTransaction((function(e){try{r.markMutationResult((0,n.pi)((0,n.pi)({},t),{result:{data:i}}),e)}catch(e){}}),t.mutationId)},e.prototype.fetchQuery=function(e,t,r){return this.fetchQueryObservable(e,t,r).promise},e.prototype.getQueryStore=function(){var e=Object.create(null);return this.queries.forEach((function(t,r){e[r]={variables:t.variables,networkStatus:t.networkStatus,networkError:t.networkError,graphQLErrors:t.graphQLErrors}})),e},e.prototype.resetErrors=function(e){var t=this.queries.get(e);t&&(t.networkError=void 0,t.graphQLErrors=[])},e.prototype.transform=function(e){var t=this.transformCache;if(!t.has(e)){var r=this.cache.transformDocument(e),n=(0,o.Fo)(this.cache.transformForLink(r)),i=this.localState.clientQuery(r),a=n&&this.localState.serverQuery(n),s={document:r,hasClientExports:(0,o.mj)(r),hasForcedResolvers:this.localState.shouldForceResolvers(r),clientQuery:i,serverQuery:a,defaultVars:(0,o.O4)((0,o.$H)(r))},u=function(e){e&&!t.has(e)&&t.set(e,s)};u(e),u(r),u(i),u(a)}return t.get(e)},e.prototype.getVariables=function(e,t){return(0,n.pi)((0,n.pi)({},this.transform(e).defaultVars),t)},e.prototype.watchQuery=function(e){void 0===(e=(0,n.pi)((0,n.pi)({},e),{variables:this.getVariables(e.query,e.variables)})).notifyOnNetworkStatusChange&&(e.notifyOnNetworkStatusChange=!1);var t=new m(this.cache),r=new l.u({queryManager:this,queryInfo:t,options:e});return this.queries.set(r.queryId,t),t.init({document:e.query,observableQuery:r,variables:e.variables}),r},e.prototype.query=function(e){var t=this;(0,i.kG)(e.query,15),(0,i.kG)("Document"===e.query.kind,16),(0,i.kG)(!e.returnPartialData,17),(0,i.kG)(!e.pollInterval,18);var r=this.generateQueryId();return this.fetchQuery(r,e).finally((function(){return t.stopQuery(r)}))},e.prototype.generateQueryId=function(){return String(this.queryIdCounter++)},e.prototype.generateRequestId=function(){return this.requestIdCounter++},e.prototype.generateMutationId=function(){return String(this.mutationIdCounter++)},e.prototype.stopQueryInStore=function(e){this.stopQueryInStoreNoBroadcast(e),this.broadcastQueries()},e.prototype.stopQueryInStoreNoBroadcast=function(e){var t=this.queries.get(e);t&&t.stop()},e.prototype.clearStore=function(){return this.cancelPendingFetches(new i.ej(19)),this.queries.forEach((function(e){e.observableQuery?e.networkStatus=f.I.loading:e.stop()})),this.mutationStore&&(this.mutationStore=Object.create(null)),this.cache.reset()},e.prototype.resetStore=function(){var e=this;return this.clearStore().then((function(){return e.reFetchObservableQueries()}))},e.prototype.reFetchObservableQueries=function(e){var t=this;void 0===e&&(e=!1);var r=[];return this.queries.forEach((function(n,i){var a=n.observableQuery;if(a&&a.hasObservers()){var o=a.options.fetchPolicy;a.resetLastResults(),"cache-only"===o||!e&&"standby"===o||r.push(a.refetch()),t.getQuery(i).setDiff(null)}})),this.broadcastQueries(),Promise.all(r)},e.prototype.setObservableQuery=function(e){this.getQuery(e.queryId).setObservableQuery(e)},e.prototype.startGraphQLSubscription=function(e){var t=this,r=e.query,n=e.fetchPolicy,i=e.errorPolicy,a=e.variables,s=e.context,u=void 0===s?{}:s;r=this.transform(r).document,a=this.getVariables(r,a);var l=function(e){return t.getObservableFromLink(r,u,e,!1).map((function(a){if("no-cache"!==n&&(b(a,i)&&t.cache.write({query:r,result:a.data,dataId:"ROOT_SUBSCRIPTION",variables:e}),t.broadcastQueries()),(0,o.d2)(a))throw new c.c({graphQLErrors:a.errors});return a}))};if(this.transform(r).hasClientExports){var f=this.localState.addExportedVariables(r,a,u).then(l);return new o.y$((function(e){var t=null;return f.then((function(r){return t=r.subscribe(e)}),e.error),function(){return t&&t.unsubscribe()}}))}return l(a)},e.prototype.stopQuery=function(e){this.stopQueryNoBroadcast(e),this.broadcastQueries()},e.prototype.stopQueryNoBroadcast=function(e){this.stopQueryInStoreNoBroadcast(e),this.removeQuery(e)},e.prototype.removeQuery=function(e){this.fetchCancelFns.delete(e),this.getQuery(e).stop(),this.queries.delete(e)},e.prototype.broadcastQueries=function(){this.onBroadcast&&this.onBroadcast(),this.queries.forEach((function(e){return e.notify()}))},e.prototype.getLocalState=function(){return this.localState},e.prototype.getObservableFromLink=function(e,t,r,i){var s,u,c=this;void 0===i&&(i=null!==(s=null==t?void 0:t.queryDeduplication)&&void 0!==s?s:this.queryDeduplication);var l=this.transform(e).serverQuery;if(l){var f=this.inFlightLinkObservables,h=this.link,p={query:l,variables:r,operationName:(0,o.rY)(l)||void 0,context:this.prepareContext((0,n.pi)((0,n.pi)({},t),{forceFetch:!i}))};if(t=p.context,i){var d=f.get(l)||new Map;f.set(l,d);var y=JSON.stringify(r);if(!(u=d.get(y))){var v=new o.X_([(0,a.ht)(h,p)]);d.set(y,u=v),v.cleanup((function(){d.delete(y)&&d.size<1&&f.delete(l)}))}}else u=new o.X_([(0,a.ht)(h,p)])}else u=new o.X_([o.y$.of({data:{}})]),t=this.prepareContext(t);var g=this.transform(e).clientQuery;return g&&(u=(0,o.sz)(u,(function(e){return c.localState.runResolvers({document:g,remoteResult:e,context:t,variables:r})}))),u},e.prototype.getResultsFromLink=function(e,t,r){var n=e.lastRequestId;return(0,o.sz)(this.getObservableFromLink(e.document,r.context,r.variables),(function(i){var a=(0,o.Of)(i.errors);if(n>=e.lastRequestId){if(a&&"none"===r.errorPolicy)throw e.markError(new c.c({graphQLErrors:i.errors}));e.markResult(i,r,t),e.markReady()}var s={data:i.data,loading:!1,networkStatus:e.networkStatus||f.I.ready};return a&&"ignore"!==r.errorPolicy&&(s.errors=i.errors),s}),(function(t){var r=(0,c.M)(t)?t:new c.c({networkError:t});throw n>=e.lastRequestId&&e.markError(r),r}))},e.prototype.fetchQueryObservable=function(e,t,r){var n=this;void 0===r&&(r=f.I.loading);var i=this.transform(t.query).document,a=this.getVariables(i,t.variables),s=this.getQuery(e),u=s.networkStatus,c=t.fetchPolicy,l=void 0===c?"cache-first":c,h=t.errorPolicy,p=void 0===h?"none":h,d=t.returnPartialData,y=void 0!==d&&d,v=t.notifyOnNetworkStatusChange,g=void 0!==v&&v,m=t.context,b=void 0===m?{}:m;("cache-first"===l||"cache-and-network"===l||"network-only"===l||"no-cache"===l)&&g&&"number"==typeof u&&u!==r&&(0,f.O)(r)&&("cache-first"!==l&&(l="cache-and-network"),y=!0);var E=Object.assign({},t,{query:i,variables:a,fetchPolicy:l,errorPolicy:p,returnPartialData:y,notifyOnNetworkStatusChange:g,context:b}),S=function(e){return E.variables=e,n.fetchQueryByPolicy(s,E,r)};this.fetchCancelFns.set(e,(function(e){Promise.resolve().then((function(){return C.cancel(e)}))}));var C=new o.X_(this.transform(E.query).hasClientExports?this.localState.addExportedVariables(E.query,E.variables,E.context).then(S):S(E.variables));return C.cleanup((function(){n.fetchCancelFns.delete(e);var r=t.nextFetchPolicy;r&&(t.nextFetchPolicy=void 0,t.fetchPolicy="function"==typeof r?r.call(t,t.fetchPolicy||"cache-first"):r)})),C},e.prototype.fetchQueryByPolicy=function(e,t,r){var i=this,a=t.query,s=t.variables,u=t.fetchPolicy,c=t.errorPolicy,l=t.returnPartialData,h=t.context;e.init({document:a,variables:s,lastRequestId:this.generateRequestId(),networkStatus:r});var p=function(){return e.getDiff(s)},d=function(t,r){void 0===r&&(r=e.networkStatus||f.I.loading);var u=t.result;var c=function(e){return o.y$.of((0,n.pi)({data:e,loading:(0,f.O)(r),networkStatus:r},t.complete?null:{partial:!0}))};return i.transform(a).hasForcedResolvers?i.localState.runResolvers({document:a,remoteResult:{data:u},context:h,variables:s,onlyRunForcedResolvers:!0}).then((function(e){return c(e.data)})):c(u)},y=function(t){return i.getResultsFromLink(e,t,{variables:s,context:h,fetchPolicy:u,errorPolicy:c})};switch(u){default:case"cache-first":return(v=p()).complete?[d(v,e.markReady())]:l?[d(v),y(!0)]:[y(!0)];case"cache-and-network":var v;return(v=p()).complete||l?[d(v),y(!0)]:[y(!0)];case"cache-only":return[d(p(),e.markReady())];case"network-only":return[y(!0)];case"no-cache":return[y(!1)];case"standby":return[]}},e.prototype.getQuery=function(e){return e&&!this.queries.has(e)&&this.queries.set(e,new m(this.cache)),this.queries.get(e)},e.prototype.prepareContext=function(e){void 0===e&&(e={});var t=this.localState.prepareContext(e);return(0,n.pi)((0,n.pi)({},t),{clientAwareness:this.clientAwareness})},e}();function C(e,t){return(0,o.oA)(e,t,t.variables&&{variables:(0,n.pi)((0,n.pi)({},e.variables),t.variables)})}var w=function(){function e(e){var t=this;this.defaultOptions={},this.resetStoreCallbacks=[],this.clearStoreCallbacks=[];var r=e.uri,n=e.credentials,o=e.headers,u=e.cache,c=e.ssrMode,l=void 0!==c&&c,f=e.ssrForceFetchDelay,h=void 0===f?0:f,p=e.connectToDevTools,y=void 0===p?"object"==typeof window&&!window.__APOLLO_CLIENT__&&!1:p,v=e.queryDeduplication,g=void 0===v||v,m=e.defaultOptions,b=e.assumeImmutableResults,E=void 0!==b&&b,C=e.resolvers,w=e.typeDefs,T=e.fragmentMatcher,A=e.name,I=e.version,k=e.link;if(k||(k=r?new s.uG({uri:r,credentials:n,headers:o}):a.i0.empty()),!u)throw new i.ej(9);this.link=k,this.cache=u,this.disableNetworkFetches=l||h>0,this.queryDeduplication=g,this.defaultOptions=m||{},this.typeDefs=w,h&&setTimeout((function(){return t.disableNetworkFetches=!1}),h),this.watchQuery=this.watchQuery.bind(this),this.query=this.query.bind(this),this.mutate=this.mutate.bind(this),this.resetStore=this.resetStore.bind(this),this.reFetchObservableQueries=this.reFetchObservableQueries.bind(this),y&&"object"==typeof window&&(window.__APOLLO_CLIENT__=this),this.version="3.3.11",this.localState=new d({cache:u,client:this,resolvers:C,fragmentMatcher:T}),this.queryManager=new S({cache:this.cache,link:this.link,queryDeduplication:g,ssrMode:l,clientAwareness:{name:A,version:I},localState:this.localState,assumeImmutableResults:E,onBroadcast:y?function(){t.devToolsHookCb&&t.devToolsHookCb({action:{},state:{queries:t.queryManager.getQueryStore(),mutations:t.queryManager.mutationStore||{}},dataWithOptimisticResults:t.cache.extract(!0)})}:void 0})}return e.prototype.stop=function(){this.queryManager.stop()},e.prototype.watchQuery=function(e){return this.defaultOptions.watchQuery&&(e=C(this.defaultOptions.watchQuery,e)),!this.disableNetworkFetches||"network-only"!==e.fetchPolicy&&"cache-and-network"!==e.fetchPolicy||(e=(0,n.pi)((0,n.pi)({},e),{fetchPolicy:"cache-first"})),this.queryManager.watchQuery(e)},e.prototype.query=function(e){return this.defaultOptions.query&&(e=C(this.defaultOptions.query,e)),(0,i.kG)("cache-and-network"!==e.fetchPolicy,10),this.disableNetworkFetches&&"network-only"===e.fetchPolicy&&(e=(0,n.pi)((0,n.pi)({},e),{fetchPolicy:"cache-first"})),this.queryManager.query(e)},e.prototype.mutate=function(e){return this.defaultOptions.mutate&&(e=C(this.defaultOptions.mutate,e)),this.queryManager.mutate(e)},e.prototype.subscribe=function(e){return this.queryManager.startGraphQLSubscription(e)},e.prototype.readQuery=function(e,t){return void 0===t&&(t=!1),this.cache.readQuery(e,t)},e.prototype.readFragment=function(e,t){return void 0===t&&(t=!1),this.cache.readFragment(e,t)},e.prototype.writeQuery=function(e){this.cache.writeQuery(e),this.queryManager.broadcastQueries()},e.prototype.writeFragment=function(e){this.cache.writeFragment(e),this.queryManager.broadcastQueries()},e.prototype.__actionHookForDevTools=function(e){this.devToolsHookCb=e},e.prototype.__requestRaw=function(e){return(0,a.ht)(this.link,e)},e.prototype.resetStore=function(){var e=this;return Promise.resolve().then((function(){return e.queryManager.clearStore()})).then((function(){return Promise.all(e.resetStoreCallbacks.map((function(e){return e()})))})).then((function(){return e.reFetchObservableQueries()}))},e.prototype.clearStore=function(){var e=this;return Promise.resolve().then((function(){return e.queryManager.clearStore()})).then((function(){return Promise.all(e.clearStoreCallbacks.map((function(e){return e()})))}))},e.prototype.onResetStore=function(e){var t=this;return this.resetStoreCallbacks.push(e),function(){t.resetStoreCallbacks=t.resetStoreCallbacks.filter((function(t){return t!==e}))}},e.prototype.onClearStore=function(e){var t=this;return this.clearStoreCallbacks.push(e),function(){t.clearStoreCallbacks=t.clearStoreCallbacks.filter((function(t){return t!==e}))}},e.prototype.reFetchObservableQueries=function(e){return this.queryManager.reFetchObservableQueries(e)},e.prototype.extract=function(e){return this.cache.extract(e)},e.prototype.restore=function(e){return this.cache.restore(e)},e.prototype.addResolvers=function(e){this.localState.addResolvers(e)},e.prototype.setResolvers=function(e){this.localState.setResolvers(e)},e.prototype.getResolvers=function(){return this.localState.getResolvers()},e.prototype.setLocalStateFragmentMatcher=function(e){this.localState.setFragmentMatcher(e)},e.prototype.setLink=function(e){this.link=this.queryManager.link=e},e}()},6282:(e,t,r)=>{"use strict";r.d(t,{u:()=>c});var n=r(655),i=r(2924),a=r(2152),o=r(5942),s=r(496),u=function(){function e(e,t,r,n){this.observer=e,this.options=t,this.fetch=r,this.shouldFetch=n}return e.prototype.reobserve=function(e,t){e?this.updateOptions(e):this.updatePolling();var r=this.fetch(this.options,t);return this.concast&&this.concast.removeObserver(this.observer,!0),r.addObserver(this.observer),(this.concast=r).promise},e.prototype.updateOptions=function(e){return Object.assign(this.options,(0,s.oA)(e)),this.updatePolling(),this},e.prototype.stop=function(){this.concast&&(this.concast.removeObserver(this.observer),delete this.concast),this.pollingInfo&&(clearTimeout(this.pollingInfo.timeout),this.options.pollInterval=0,this.updatePolling())},e.prototype.updatePolling=function(){var e=this,t=this.pollingInfo,r=this.options.pollInterval;if(r){if((!t||t.interval!==r)&&((0,i.kG)(r,20),!1!==this.shouldFetch)){(t||(this.pollingInfo={})).interval=r;var n=function(){e.pollingInfo&&(e.shouldFetch&&e.shouldFetch()?e.reobserve({fetchPolicy:"network-only",nextFetchPolicy:e.options.fetchPolicy||"cache-first"},o.I.poll).then(a,a):a())},a=function(){var t=e.pollingInfo;t&&(clearTimeout(t.timeout),t.timeout=setTimeout(n,t.interval))};a()}}else t&&(clearTimeout(t.timeout),delete this.pollingInfo)},e}(),c=function(e){function t(t){var r=t.queryManager,i=t.queryInfo,a=t.options,u=e.call(this,(function(e){return u.onSubscribe(e)}))||this;u.observers=new Set,u.subscriptions=new Set,u.observer={next:function(e){(u.lastError||u.isDifferentFromLastResult(e))&&(u.updateLastResult(e),(0,s.pM)(u.observers,"next",e))},error:function(e){u.updateLastResult((0,n.pi)((0,n.pi)({},u.lastResult),{error:e,errors:e.graphQLErrors,networkStatus:o.I.error,loading:!1})),(0,s.pM)(u.observers,"error",u.lastError=e)}},u.isTornDown=!1,u.options=a,u.queryId=r.generateQueryId();var c=(0,s.$H)(a.query);return u.queryName=c&&c.name&&c.name.value,u.queryManager=r,u.queryInfo=i,u}return(0,n.ZT)(t,e),Object.defineProperty(t.prototype,"variables",{get:function(){return this.options.variables},enumerable:!1,configurable:!0}),t.prototype.result=function(){var e=this;return new Promise((function(t,r){var n={next:function(r){t(r),e.observers.delete(n),e.observers.size||e.queryManager.removeQuery(e.queryId),setTimeout((function(){i.unsubscribe()}),0)},error:r},i=e.subscribe(n)}))},t.prototype.getCurrentResult=function(e){void 0===e&&(e=!0);var t=this.lastResult,r=this.queryInfo.networkStatus||t&&t.networkStatus||o.I.ready,i=(0,n.pi)((0,n.pi)({},t),{loading:(0,o.O)(r),networkStatus:r});if(this.isTornDown)return i;var a=this.options.fetchPolicy,s=void 0===a?"cache-first":a;if("no-cache"===s||"network-only"===s)delete i.partial;else if(!i.data||!this.queryManager.transform(this.options.query).hasForcedResolvers){var u=this.queryInfo.getDiff();i.data=u.complete||this.options.returnPartialData?u.result:void 0,u.complete?(i.networkStatus!==o.I.loading||"cache-first"!==s&&"cache-only"!==s||(i.networkStatus=o.I.ready,i.loading=!1),delete i.partial):i.partial=!0}return e&&this.updateLastResult(i),i},t.prototype.isDifferentFromLastResult=function(e){return!(0,a.D)(this.lastResultSnapshot,e)},t.prototype.getLastResult=function(){return this.lastResult},t.prototype.getLastError=function(){return this.lastError},t.prototype.resetLastResults=function(){delete this.lastResult,delete this.lastResultSnapshot,delete this.lastError,this.isTornDown=!1},t.prototype.resetQueryStoreErrors=function(){this.queryManager.resetErrors(this.queryId)},t.prototype.refetch=function(e){var t={pollInterval:0},r=this.options.fetchPolicy;return"no-cache"!==r&&"cache-and-network"!==r&&(t.fetchPolicy="network-only",t.nextFetchPolicy=r||"cache-first"),e&&!(0,a.D)(this.options.variables,e)&&(t.variables=this.options.variables=(0,n.pi)((0,n.pi)({},this.options.variables),e)),this.newReobserver(!1).reobserve(t,o.I.refetch)},t.prototype.fetchMore=function(e){var t=this,r=(0,n.pi)((0,n.pi)({},e.query?e:(0,n.pi)((0,n.pi)((0,n.pi)({},this.options),e),{variables:(0,n.pi)((0,n.pi)({},this.options.variables),e.variables)})),{fetchPolicy:"no-cache"}),i=this.queryManager.generateQueryId();return r.notifyOnNetworkStatusChange&&(this.queryInfo.networkStatus=o.I.fetchMore,this.observe()),this.queryManager.fetchQuery(i,r,o.I.fetchMore).then((function(n){var i=n.data,a=e.updateQuery;return a?t.updateQuery((function(e){return a(e,{fetchMoreResult:i,variables:r.variables})})):t.queryManager.cache.writeQuery({query:r.query,variables:r.variables,data:i}),n})).finally((function(){t.queryManager.stopQuery(i),t.reobserve()}))},t.prototype.subscribeToMore=function(e){var t=this,r=this.queryManager.startGraphQLSubscription({query:e.document,variables:e.variables,context:e.context}).subscribe({next:function(r){var n=e.updateQuery;n&&t.updateQuery((function(e,t){var i=t.variables;return n(e,{subscriptionData:r,variables:i})}))},error:function(t){e.onError&&e.onError(t)}});return this.subscriptions.add(r),function(){t.subscriptions.delete(r)&&r.unsubscribe()}},t.prototype.setOptions=function(e){return this.reobserve(e)},t.prototype.setVariables=function(e){if((0,a.D)(this.variables,e))return this.observers.size?this.result():Promise.resolve();if(this.options.variables=e,!this.observers.size)return Promise.resolve();var t=this.options.fetchPolicy,r=void 0===t?"cache-first":t,n={fetchPolicy:r,variables:e};return"cache-first"!==r&&"no-cache"!==r&&"network-only"!==r&&(n.fetchPolicy="cache-and-network",n.nextFetchPolicy=r),this.reobserve(n,o.I.setVariables)},t.prototype.updateQuery=function(e){var t,r=this.queryManager,n=e(r.cache.diff({query:this.options.query,variables:this.variables,previousResult:null===(t=this.lastResult)||void 0===t?void 0:t.data,returnPartialData:!0,optimistic:!1}).result,{variables:this.variables});n&&(r.cache.writeQuery({query:this.options.query,data:n,variables:this.variables}),r.broadcastQueries())},t.prototype.startPolling=function(e){this.getReobserver().updateOptions({pollInterval:e})},t.prototype.stopPolling=function(){this.reobserver&&this.reobserver.updateOptions({pollInterval:0})},t.prototype.updateLastResult=function(e){var t=this.lastResult;return this.lastResult=e,this.lastResultSnapshot=this.queryManager.assumeImmutableResults?e:(0,s.Xh)(e),(0,s.Of)(e.errors)||delete this.lastError,t},t.prototype.onSubscribe=function(e){var t=this;if(e===this.observer)return function(){};try{var r=e._subscription._observer;r&&!r.error&&(r.error=l)}catch(e){}var n=!this.observers.size;return this.observers.add(e),this.lastError?e.error&&e.error(this.lastError):this.lastResult&&e.next&&e.next(this.lastResult),n&&this.reobserve().catch((function(e){})),function(){t.observers.delete(e)&&!t.observers.size&&t.tearDownQuery()}},t.prototype.getReobserver=function(){return this.reobserver||(this.reobserver=this.newReobserver(!0))},t.prototype.newReobserver=function(e){var t=this,r=this.queryManager,i=this.queryId;return r.setObservableQuery(this),new u(this.observer,e?this.options:(0,n.pi)({},this.options),(function(e,n){return r.setObservableQuery(t),r.fetchQueryObservable(i,e,n)}),!r.ssrMode&&function(){return!(0,o.O)(t.queryInfo.networkStatus)})},t.prototype.reobserve=function(e,t){return this.isTornDown=!1,this.getReobserver().reobserve(e,t)},t.prototype.observe=function(){this.observer.next(this.getCurrentResult(!1))},t.prototype.hasObservers=function(){return this.observers.size>0},t.prototype.tearDownQuery=function(){this.isTornDown||(this.reobserver&&(this.reobserver.stop(),delete this.reobserver),this.subscriptions.forEach((function(e){return e.unsubscribe()})),this.subscriptions.clear(),this.queryManager.stopQuery(this.queryId),this.observers.clear(),this.isTornDown=!0)},t}(s.y$);function l(e){}(0,s.Dy)(c)},1439:(e,t,r)=>{"use strict";r.d(t,{fe:()=>n.f,h4:()=>a.h4,HttpLink:()=>u.uG});var n=r(5765),i=(r(6282),r(5942),r(2191));r.o(i,"HttpLink")&&r.d(t,{HttpLink:function(){return i.HttpLink}});r(1498);var a=r(2634),o=r(5367);r.o(o,"HttpLink")&&r.d(t,{HttpLink:function(){return o.HttpLink}});var s=r(1707);r.o(s,"HttpLink")&&r.d(t,{HttpLink:function(){return s.HttpLink}});var u=r(9950),c=(r(4913),r(496),r(2924)),l=r(2527);(0,c.U6)("log");l.ZP.resetCaches,l.ZP.disableFragmentWarnings,l.ZP.enableExperimentalFragmentVariables,l.ZP.disableExperimentalFragmentVariables},5942:(e,t,r)=>{"use strict";var n;function i(e){return!!e&&e<7}r.d(t,{I:()=>n,O:()=>i}),function(e){e[e.loading=1]="loading",e[e.setVariables=2]="setVariables",e[e.fetchMore=3]="fetchMore",e[e.refetch=4]="refetch",e[e.poll=6]="poll",e[e.ready=7]="ready",e[e.error=8]="error"}(n||(n={}))},2191:()=>{},1498:(e,t,r)=>{"use strict";r.d(t,{M:()=>a,c:()=>o});var n=r(655),i=r(496);function a(e){return e.hasOwnProperty("graphQLErrors")}var o=function(e){function t(r){var n,a,o=r.graphQLErrors,s=r.networkError,u=r.errorMessage,c=r.extraInfo,l=e.call(this,u)||this;return l.graphQLErrors=o||[],l.networkError=s||null,l.message=u||(n=l,a="",(0,i.Of)(n.graphQLErrors)&&n.graphQLErrors.forEach((function(e){var t=e?e.message:"Error message not found.";a+=t+"\n"})),n.networkError&&(a+=n.networkError.message+"\n"),a=a.replace(/\n$/,"")),l.extraInfo=c,l.__proto__=t.prototype,l}return(0,n.ZT)(t,e),t}(Error)},7222:(e,t,r)=>{"use strict";r.d(t,{i:()=>l});var n=r(655),i=r(2924),a=r(496),o=r(4913);function s(e,t){return t?t(e):a.y$.of()}function u(e){return"function"==typeof e?new l(e):e}function c(e){return e.request.length<=1}!function(e){function t(t,r){var n=e.call(this,t)||this;return n.link=r,n}(0,n.ZT)(t,e)}(Error);var l=function(){function e(e){e&&(this.request=e)}return e.empty=function(){return new e((function(){return a.y$.of()}))},e.from=function(t){return 0===t.length?e.empty():t.map(u).reduce((function(e,t){return e.concat(t)}))},e.split=function(t,r,n){var i=u(r),o=u(n||new e(s));return c(i)&&c(o)?new e((function(e){return t(e)?i.request(e)||a.y$.of():o.request(e)||a.y$.of()})):new e((function(e,r){return t(e)?i.request(e,r)||a.y$.of():o.request(e,r)||a.y$.of()}))},e.execute=function(e,t){return e.request((0,o.zi)(t.context,(0,o.DQ)((0,o.Ak)(t))))||a.y$.of()},e.concat=function(t,r){var n=u(t);if(c(n))return n;var i=u(r);return c(i)?new e((function(e){return n.request(e,(function(e){return i.request(e)||a.y$.of()}))||a.y$.of()})):new e((function(e,t){return n.request(e,(function(e){return i.request(e,t)||a.y$.of()}))||a.y$.of()}))},e.prototype.split=function(t,r,n){return this.concat(e.split(t,r,n||new e(s)))},e.prototype.concat=function(t){return e.concat(this,t)},e.prototype.request=function(e,t){throw new i.ej(21)},e.prototype.onError=function(e,t){if(t&&t.error)return t.error(e),!1;throw e},e.prototype.setOnError=function(e){return this.onError=e,this},e}()},4957:(e,t,r)=>{"use strict";r(7222).i.concat},7325:(e,t,r)=>{"use strict";r(7222).i.empty},2550:(e,t,r)=>{"use strict";r.d(t,{h:()=>n});var n=r(7222).i.execute},4674:(e,t,r)=>{"use strict";r(7222).i.from},1707:(e,t,r)=>{"use strict";r.d(t,{ht:()=>n.h,i0:()=>i.i});r(7325),r(4674),r(4738),r(4957);var n=r(2550),i=r(7222),a=r(9875);r.o(a,"HttpLink")&&r.d(t,{HttpLink:function(){return a.HttpLink}})},4738:(e,t,r)=>{"use strict";r(7222).i.split},9875:()=>{},9950:(e,t,r)=>{"use strict";r.d(t,{uG:()=>T});var n=r(4913),i=Object.prototype.hasOwnProperty;var a=r(2924),o=function(e,t){var r;try{r=JSON.stringify(e)}catch(e){var n=new a.ej(23);throw n.parseError=e,n}return r},s=r(655),u=r(7636),c=r(7420);function l(e){return(0,u.Vn)(e,{leave:f})}var f={Name:function(e){return e.value},Variable:function(e){return"$"+e.name},Document:function(e){return p(e.definitions,"\n\n")+"\n"},OperationDefinition:function(e){var t=e.operation,r=e.name,n=y("(",p(e.variableDefinitions,", "),")"),i=p(e.directives," "),a=e.selectionSet;return r||i||n||"query"!==t?p([t,p([r,n]),i,a]," "):a},VariableDefinition:function(e){var t=e.variable,r=e.type,n=e.defaultValue,i=e.directives;return t+": "+r+y(" = ",n)+y(" ",p(i," "))},SelectionSet:function(e){return d(e.selections)},Field:function(e){var t=e.alias,r=e.name,n=e.arguments,i=e.directives,a=e.selectionSet,o=y("",t,": ")+r,s=o+y("(",p(n,", "),")");return s.length>80&&(s=o+y("(\n",v(p(n,"\n")),"\n)")),p([s,p(i," "),a]," ")},Argument:function(e){return e.name+": "+e.value},FragmentSpread:function(e){return"..."+e.name+y(" ",p(e.directives," "))},InlineFragment:function(e){var t=e.typeCondition,r=e.directives,n=e.selectionSet;return p(["...",y("on ",t),p(r," "),n]," ")},FragmentDefinition:function(e){var t=e.name,r=e.typeCondition,n=e.variableDefinitions,i=e.directives,a=e.selectionSet;return"fragment ".concat(t).concat(y("(",p(n,", "),")")," ")+"on ".concat(r," ").concat(y("",p(i," ")," "))+a},IntValue:function(e){return e.value},FloatValue:function(e){return e.value},StringValue:function(e,t){var r=e.value;return e.block?(0,c.LZ)(r,"description"===t?"":" "):JSON.stringify(r)},BooleanValue:function(e){return e.value?"true":"false"},NullValue:function(){return"null"},EnumValue:function(e){return e.value},ListValue:function(e){return"["+p(e.values,", ")+"]"},ObjectValue:function(e){return"{"+p(e.fields,", ")+"}"},ObjectField:function(e){return e.name+": "+e.value},Directive:function(e){return"@"+e.name+y("(",p(e.arguments,", "),")")},NamedType:function(e){return e.name},ListType:function(e){return"["+e.type+"]"},NonNullType:function(e){return e.type+"!"},SchemaDefinition:h((function(e){var t=e.directives,r=e.operationTypes;return p(["schema",p(t," "),d(r)]," ")})),OperationTypeDefinition:function(e){return e.operation+": "+e.type},ScalarTypeDefinition:h((function(e){return p(["scalar",e.name,p(e.directives," ")]," ")})),ObjectTypeDefinition:h((function(e){var t=e.name,r=e.interfaces,n=e.directives,i=e.fields;return p(["type",t,y("implements ",p(r," & ")),p(n," "),d(i)]," ")})),FieldDefinition:h((function(e){var t=e.name,r=e.arguments,n=e.type,i=e.directives;return t+(m(r)?y("(\n",v(p(r,"\n")),"\n)"):y("(",p(r,", "),")"))+": "+n+y(" ",p(i," "))})),InputValueDefinition:h((function(e){var t=e.name,r=e.type,n=e.defaultValue,i=e.directives;return p([t+": "+r,y("= ",n),p(i," ")]," ")})),InterfaceTypeDefinition:h((function(e){var t=e.name,r=e.interfaces,n=e.directives,i=e.fields;return p(["interface",t,y("implements ",p(r," & ")),p(n," "),d(i)]," ")})),UnionTypeDefinition:h((function(e){var t=e.name,r=e.directives,n=e.types;return p(["union",t,p(r," "),n&&0!==n.length?"= "+p(n," | "):""]," ")})),EnumTypeDefinition:h((function(e){var t=e.name,r=e.directives,n=e.values;return p(["enum",t,p(r," "),d(n)]," ")})),EnumValueDefinition:h((function(e){return p([e.name,p(e.directives," ")]," ")})),InputObjectTypeDefinition:h((function(e){var t=e.name,r=e.directives,n=e.fields;return p(["input",t,p(r," "),d(n)]," ")})),DirectiveDefinition:h((function(e){var t=e.name,r=e.arguments,n=e.repeatable,i=e.locations;return"directive @"+t+(m(r)?y("(\n",v(p(r,"\n")),"\n)"):y("(",p(r,", "),")"))+(n?" repeatable":"")+" on "+p(i," | ")})),SchemaExtension:function(e){var t=e.directives,r=e.operationTypes;return p(["extend schema",p(t," "),d(r)]," ")},ScalarTypeExtension:function(e){return p(["extend scalar",e.name,p(e.directives," ")]," ")},ObjectTypeExtension:function(e){var t=e.name,r=e.interfaces,n=e.directives,i=e.fields;return p(["extend type",t,y("implements ",p(r," & ")),p(n," "),d(i)]," ")},InterfaceTypeExtension:function(e){var t=e.name,r=e.interfaces,n=e.directives,i=e.fields;return p(["extend interface",t,y("implements ",p(r," & ")),p(n," "),d(i)]," ")},UnionTypeExtension:function(e){var t=e.name,r=e.directives,n=e.types;return p(["extend union",t,p(r," "),n&&0!==n.length?"= "+p(n," | "):""]," ")},EnumTypeExtension:function(e){var t=e.name,r=e.directives,n=e.values;return p(["extend enum",t,p(r," "),d(n)]," ")},InputObjectTypeExtension:function(e){var t=e.name,r=e.directives,n=e.fields;return p(["extend input",t,p(r," "),d(n)]," ")}};function h(e){return function(t){return p([t.description,e(t)],"\n")}}function p(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return null!==(t=null==e?void 0:e.filter((function(e){return e})).join(r))&&void 0!==t?t:""}function d(e){return y("{\n",v(p(e,"\n")),"\n}")}function y(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return null!=t&&""!==t?e+t+r:""}function v(e){return y(" ",e.replace(/\n/g,"\n "))}function g(e){return-1!==e.indexOf("\n")}function m(e){return null!=e&&e.some(g)}var b={http:{includeQuery:!0,includeExtensions:!1},headers:{accept:"*/*","content-type":"application/json"},options:{method:"POST"}},E=r(285),S=r(1707),C=r(496);var w=function(e){void 0===e&&(e={});var t=e.uri,r=void 0===t?"/graphql":t,u=e.fetch,c=e.includeExtensions,f=e.useGETForQueries,h=e.includeUnusedVariables,p=void 0!==h&&h,d=(0,s._T)(e,["uri","fetch","includeExtensions","useGETForQueries","includeUnusedVariables"]);!function(e){if(!e&&"undefined"==typeof fetch)throw new a.ej(22)}(u),u||(u=fetch);var y={http:{includeExtensions:c},options:d.fetchOptions,credentials:d.credentials,headers:d.headers};return new S.i0((function(e){var t=function(e,t){return e.getContext().uri||("function"==typeof t?t(e):t||"/graphql")}(e,r),a=e.getContext(),c={};if(a.clientAwareness){var h=a.clientAwareness,d=h.name,v=h.version;d&&(c["apollographql-client-name"]=d),v&&(c["apollographql-client-version"]=v)}var g,m=(0,s.pi)((0,s.pi)({},c),a.headers),S={http:a.http,options:a.fetchOptions,credentials:a.credentials,headers:m},w=function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var i=(0,s.pi)((0,s.pi)({},t.options),{headers:t.headers,credentials:t.credentials}),a=t.http||{};r.forEach((function(e){i=(0,s.pi)((0,s.pi)((0,s.pi)({},i),e.options),{headers:(0,s.pi)((0,s.pi)({},i.headers),e.headers)}),e.credentials&&(i.credentials=e.credentials),a=(0,s.pi)((0,s.pi)({},a),e.http)}));var o=e.operationName,u=e.extensions,c=e.variables,f=e.query,h={operationName:o,variables:c};return a.includeExtensions&&(h.extensions=u),a.includeQuery&&(h.query=l(f)),{options:i,body:h}}(e,b,y,S),T=w.options,A=w.body;if(A.variables&&!p){var I=new Set(Object.keys(A.variables));(0,E.Vn)(e.query,{Variable:function(e,t,r){r&&"VariableDefinition"!==r.kind&&I.delete(e.name.value)}}),I.size&&(A.variables=(0,s.pi)({},A.variables),I.forEach((function(e){delete A.variables[e]})))}if(!T.signal){var k=function(){if("undefined"==typeof AbortController)return{controller:!1,signal:!1};var e=new AbortController;return{controller:e,signal:e.signal}}(),_=k.controller,B=k.signal;(g=_)&&(T.signal=B)}if(f&&!e.query.definitions.some((function(e){return"OperationDefinition"===e.kind&&"mutation"===e.operation}))&&(T.method="GET"),"GET"===T.method){var N=function(e,t){var r=[],n=function(e,t){r.push(e+"="+encodeURIComponent(t))};if("query"in t&&n("query",t.query),t.operationName&&n("operationName",t.operationName),t.variables){var i=void 0;try{i=o(t.variables)}catch(e){return{parseError:e}}n("variables",i)}if(t.extensions){var a=void 0;try{a=o(t.extensions)}catch(e){return{parseError:e}}n("extensions",a)}var s="",u=e,c=e.indexOf("#");-1!==c&&(s=e.substr(c),u=e.substr(0,c));var l=-1===u.indexOf("?")?"?":"&";return{newURI:u+l+r.join("&")+s}}(t,A),O=N.newURI,R=N.parseError;if(R)return(0,n.Qc)(R);t=O}else try{T.body=o(A)}catch(R){return(0,n.Qc)(R)}return new C.y$((function(r){var a;return u(t,T).then((function(t){return e.setContext({response:t}),t})).then((a=e,function(e){return e.text().then((function(t){try{return JSON.parse(t)}catch(n){var r=n;throw r.name="ServerParseError",r.response=e,r.statusCode=e.status,r.bodyText=t,r}})).then((function(t){return e.status>=300&&(0,n.PW)(e,t,"Response not successful: Received status code "+e.status),Array.isArray(t)||i.call(t,"data")||i.call(t,"errors")||(0,n.PW)(e,t,"Server response was missing for query '"+(Array.isArray(a)?a.map((function(e){return e.operationName})):a.operationName)+"'."),t}))})).then((function(e){return r.next(e),r.complete(),e})).catch((function(e){"AbortError"!==e.name&&(e.result&&e.result.errors&&e.result.data&&r.next(e.result),r.error(e))})),function(){g&&g.abort()}}))}))},T=function(e){function t(t){void 0===t&&(t={});var r=e.call(this,w(t).request)||this;return r.options=t,r}return(0,s.ZT)(t,e),t}(S.i0)},4913:(e,t,r)=>{"use strict";r.d(t,{zi:()=>c,Qc:()=>i,PW:()=>o,DQ:()=>l,Ak:()=>s});var n=r(496);function i(e){return new n.y$((function(t){t.error(e)}))}var a=r(2924);var o=function(e,t,r){var n=new Error(r);throw n.name="ServerError",n.response=e,n.statusCode=e.status,n.result=t,n};function s(e){for(var t=["query","operationName","variables","extensions","context"],r=0,n=Object.keys(e);r<n.length;r++){var i=n[r];if(t.indexOf(i)<0)throw new a.ej(26)}return e}var u=r(655);function c(e,t){var r=(0,u.pi)({},e);return Object.defineProperty(t,"setContext",{enumerable:!1,value:function(e){r="function"==typeof e?(0,u.pi)((0,u.pi)({},r),e(r)):(0,u.pi)((0,u.pi)({},r),e)}}),Object.defineProperty(t,"getContext",{enumerable:!1,value:function(){return(0,u.pi)({},r)}}),t}function l(e){var t={variables:e.variables||{},extensions:e.extensions||{},operationName:e.operationName,query:e.query};return t.operationName||(t.operationName="string"!=typeof t.query?(0,n.rY)(t.query)||void 0:""),t}},496:(e,t,r)=>{"use strict";r.d(t,{X_:()=>oe,w0:()=>Y,y$:()=>J(),Gw:()=>U,NC:()=>E,sz:()=>ne,aL:()=>M,mr:()=>ce,Xh:()=>$,oA:()=>le,F:()=>l,Dy:()=>ie,O4:()=>O,kU:()=>_,hi:()=>f,Yk:()=>c,p$:()=>N,$H:()=>I,rY:()=>k,iW:()=>B,PT:()=>b,qw:()=>C,d2:()=>ue,mj:()=>s,FS:()=>o,My:()=>w,Ao:()=>T,Of:()=>se,hh:()=>y,pM:()=>re,kQ:()=>d,Jv:()=>te,Ee:()=>H,bw:()=>G,ob:()=>q,Fo:()=>V,u2:()=>S,LZ:()=>a,vf:()=>g});var n=r(7636),i=r(2924);function a(e,t){var r=e.directives;return!r||!r.length||function(e){var t=[];e&&e.length&&e.forEach((function(e){if(function(e){var t=e.name.value;return"skip"===t||"include"===t}(e)){var r=e.arguments;e.name.value;(0,i.kG)(r&&1===r.length,39);var n=r[0];(0,i.kG)(n.name&&"if"===n.name.value,40);var a=n.value;(0,i.kG)(a&&("Variable"===a.kind||"BooleanValue"===a.kind),41),t.push({directive:e,ifArgument:n})}}));return t}(r).every((function(e){var r=e.directive,n=e.ifArgument,a=!1;return"Variable"===n.value.kind?(a=t&&t[n.value.name.value],(0,i.kG)(void 0!==a,38)):a=n.value.value,"skip"===r.name.value?!a:a}))}function o(e,t){return function(e){var t=[];return(0,n.Vn)(e,{Directive:function(e){t.push(e.name.value)}}),t}(t).some((function(t){return e.indexOf(t)>-1}))}function s(e){return e&&o(["client"],e)&&o(["export"],e)}var u=r(655);function c(e,t){var r=t,n=[];return e.definitions.forEach((function(e){if("OperationDefinition"===e.kind)throw new i.ej(42);"FragmentDefinition"===e.kind&&n.push(e)})),void 0===r&&((0,i.kG)(1===n.length,43),r=n[0].name.value),(0,u.pi)((0,u.pi)({},e),{definitions:(0,u.pr)([{kind:"OperationDefinition",operation:"query",selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:r}}]}}],e.definitions)})}function l(e){void 0===e&&(e=[]);var t={};return e.forEach((function(e){t[e.name.value]=e})),t}function f(e,t){switch(e.kind){case"InlineFragment":return e;case"FragmentSpread":var r=t&&t[e.name.value];return(0,i.kG)(r,44),r;default:return null}}var h=r(5035),p=r.n(h);function d(e){return{__ref:String(e)}}function y(e){return Boolean(e&&"object"==typeof e&&"string"==typeof e.__ref)}function v(e,t,r,n){if(function(e){return"IntValue"===e.kind}(r)||function(e){return"FloatValue"===e.kind}(r))e[t.value]=Number(r.value);else if(function(e){return"BooleanValue"===e.kind}(r)||function(e){return"StringValue"===e.kind}(r))e[t.value]=r.value;else if(function(e){return"ObjectValue"===e.kind}(r)){var a={};r.fields.map((function(e){return v(a,e.name,e.value,n)})),e[t.value]=a}else if(function(e){return"Variable"===e.kind}(r)){var o=(n||{})[r.name.value];e[t.value]=o}else if(function(e){return"ListValue"===e.kind}(r))e[t.value]=r.values.map((function(e){var r={};return v(r,t,e,n),r[t.value]}));else if(function(e){return"EnumValue"===e.kind}(r))e[t.value]=r.value;else{if(!function(e){return"NullValue"===e.kind}(r))throw new i.ej(53);e[t.value]=null}}function g(e,t){var r=null;e.directives&&(r={},e.directives.forEach((function(e){r[e.name.value]={},e.arguments&&e.arguments.forEach((function(n){var i=n.name,a=n.value;return v(r[e.name.value],i,a,t)}))})));var n=null;return e.arguments&&e.arguments.length&&(n={},e.arguments.forEach((function(e){var r=e.name,i=e.value;return v(n,r,i,t)}))),b(e.name.value,n,r)}var m=["connection","include","skip","client","rest","export"];function b(e,t,r){if(t&&r&&r.connection&&r.connection.key){if(r.connection.filter&&r.connection.filter.length>0){var n=r.connection.filter?r.connection.filter:[];n.sort();var i={};return n.forEach((function(e){i[e]=t[e]})),r.connection.key+"("+JSON.stringify(i)+")"}return r.connection.key}var a=e;if(t){var o=p()(t);a+="("+o+")"}return r&&Object.keys(r).forEach((function(e){-1===m.indexOf(e)&&(r[e]&&Object.keys(r[e]).length?a+="@"+e+"("+JSON.stringify(r[e])+")":a+="@"+e)})),a}function E(e,t){if(e.arguments&&e.arguments.length){var r={};return e.arguments.forEach((function(e){var n=e.name,i=e.value;return v(r,n,i,t)})),r}return null}function S(e){return e.alias?e.alias.value:e.name.value}function C(e,t,r){if("string"==typeof e.__typename)return e.__typename;for(var n=0,i=t.selections;n<i.length;n++){var a=i[n];if(w(a)){if("__typename"===a.name.value)return e[S(a)]}else{var o=C(e,f(a,r).selectionSet,r);if("string"==typeof o)return o}}}function w(e){return"Field"===e.kind}function T(e){return"InlineFragment"===e.kind}function A(e){(0,i.kG)(e&&"Document"===e.kind,45);var t=e.definitions.filter((function(e){return"FragmentDefinition"!==e.kind})).map((function(e){if("OperationDefinition"!==e.kind)throw new i.ej(46);return e}));return(0,i.kG)(t.length<=1,47),e}function I(e){return A(e),e.definitions.filter((function(e){return"OperationDefinition"===e.kind}))[0]}function k(e){return e.definitions.filter((function(e){return"OperationDefinition"===e.kind&&e.name})).map((function(e){return e.name.value}))[0]||null}function _(e){return e.definitions.filter((function(e){return"FragmentDefinition"===e.kind}))}function B(e){var t=I(e);return(0,i.kG)(t&&"query"===t.operation,48),t}function N(e){var t;A(e);for(var r=0,n=e.definitions;r<n.length;r++){var a=n[r];if("OperationDefinition"===a.kind){var o=a.operation;if("query"===o||"mutation"===o||"subscription"===o)return a}"FragmentDefinition"!==a.kind||t||(t=a)}if(t)return t;throw new i.ej(52)}function O(e){var t=Object.create(null),r=e&&e.variableDefinitions;return r&&r.length&&r.forEach((function(e){e.defaultValue&&v(t,e.variable.name,e.defaultValue)})),t}function R(e,t,r){var n=0;return e.forEach((function(r,i){t.call(this,r,i,e)&&(e[n++]=r)}),r),e.length=n,e}var x={kind:"Field",name:{kind:"Name",value:"__typename"}};function P(e,t){return e.selectionSet.selections.every((function(e){return"FragmentSpread"===e.kind&&P(t[e.name.value],t)}))}function F(e){return P(I(e)||function(e){(0,i.kG)("Document"===e.kind,49),(0,i.kG)(e.definitions.length<=1,50);var t=e.definitions[0];return(0,i.kG)("FragmentDefinition"===t.kind,51),t}(e),l(_(e)))?null:e}function D(e){return function(t){return e.some((function(e){return e.name&&e.name===t.name.value||e.test&&e.test(t)}))}}function L(e,t){var r=Object.create(null),i=[],a=Object.create(null),o=[],s=F((0,n.Vn)(t,{Variable:{enter:function(e,t,n){"VariableDefinition"!==n.kind&&(r[e.name.value]=!0)}},Field:{enter:function(t){if(e&&t.directives&&(e.some((function(e){return e.remove}))&&t.directives&&t.directives.some(D(e))))return t.arguments&&t.arguments.forEach((function(e){"Variable"===e.value.kind&&i.push({name:e.value.name.value})})),t.selectionSet&&K(t.selectionSet).forEach((function(e){o.push({name:e.name.value})})),null}},FragmentSpread:{enter:function(e){a[e.name.value]=!0}},Directive:{enter:function(t){if(D(e)(t))return null}}}));return s&&R(i,(function(e){return!!e.name&&!r[e.name]})).length&&(s=function(e,t){var r=function(e){return function(t){return e.some((function(e){return t.value&&"Variable"===t.value.kind&&t.value.name&&(e.name===t.value.name.value||e.test&&e.test(t))}))}}(e);return F((0,n.Vn)(t,{OperationDefinition:{enter:function(t){return(0,u.pi)((0,u.pi)({},t),{variableDefinitions:t.variableDefinitions?t.variableDefinitions.filter((function(t){return!e.some((function(e){return e.name===t.variable.name.value}))})):[]})}},Field:{enter:function(t){if(e.some((function(e){return e.remove}))){var n=0;if(t.arguments&&t.arguments.forEach((function(e){r(e)&&(n+=1)})),1===n)return null}}},Argument:{enter:function(e){if(r(e))return null}}}))}(i,s)),s&&R(o,(function(e){return!!e.name&&!a[e.name]})).length&&(s=function(e,t){function r(t){if(e.some((function(e){return e.name===t.name.value})))return null}return F((0,n.Vn)(t,{FragmentSpread:{enter:r},FragmentDefinition:{enter:r}}))}(o,s)),s}function U(e){return(0,n.Vn)(A(e),{SelectionSet:{enter:function(e,t,r){if(!r||"OperationDefinition"!==r.kind){var n=e.selections;if(n)if(!n.some((function(e){return w(e)&&("__typename"===e.name.value||0===e.name.value.lastIndexOf("__",0))}))){var i=r;if(!(w(i)&&i.directives&&i.directives.some((function(e){return"export"===e.name.value}))))return(0,u.pi)((0,u.pi)({},e),{selections:(0,u.pr)(n,[x])})}}}}})}U.added=function(e){return e===x};var j={test:function(e){var t="connection"===e.name.value;return t&&(!e.arguments||e.arguments.some((function(e){return"key"===e.name.value}))),t}};function V(e){return L([j],A(e))}function K(e){var t=[];return e.selections.forEach((function(e){(w(e)||T(e))&&e.selectionSet?K(e.selectionSet).forEach((function(e){return t.push(e)})):"FragmentSpread"===e.kind&&t.push(e)})),t}function M(e){return"query"===N(e).operation?e:(0,n.Vn)(e,{OperationDefinition:{enter:function(e){return(0,u.pi)((0,u.pi)({},e),{operation:"query"})}}})}function q(e){A(e);var t=L([{test:function(e){return"client"===e.name.value},remove:!0}],e);return t&&(t=(0,n.Vn)(t,{FragmentDefinition:{enter:function(e){if(e.selectionSet&&e.selectionSet.selections.every((function(e){return w(e)&&"__typename"===e.name.value})))return null}}})),t}var z=Object.prototype.hasOwnProperty;function H(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return G(e)}function G(e){var t=e[0]||{},r=e.length;if(r>1)for(var n=new Y,i=1;i<r;++i)t=n.merge(t,e[i]);return t}function Q(e){return null!==e&&"object"==typeof e}var W=function(e,t,r){return this.merge(e[r],t[r])},Y=function(){function e(e){void 0===e&&(e=W),this.reconciler=e,this.isObject=Q,this.pastCopies=new Set}return e.prototype.merge=function(e,t){for(var r=this,n=[],i=2;i<arguments.length;i++)n[i-2]=arguments[i];return Q(t)&&Q(e)?(Object.keys(t).forEach((function(i){if(z.call(e,i)){var a=e[i];if(t[i]!==a){var o=r.reconciler.apply(r,(0,u.pr)([e,t,i],n));o!==a&&((e=r.shallowCopyForMerge(e))[i]=o)}}else(e=r.shallowCopyForMerge(e))[i]=t[i]})),e):t},e.prototype.shallowCopyForMerge=function(e){return Q(e)&&!this.pastCopies.has(e)&&(e=Array.isArray(e)?e.slice(0):(0,u.pi)({__proto__:Object.getPrototypeOf(e)},e),this.pastCopies.add(e)),e},e}();var Z=r(9329),J=r.n(Z);r(7121);J().prototype["@@observable"]=function(){return this};var X=Object.prototype.toString;function $(e){return ee(e)}function ee(e,t){switch(X.call(e)){case"[object Array]":if((t=t||new Map).has(e))return t.get(e);var r=e.slice(0);return t.set(e,r),r.forEach((function(e,n){r[n]=ee(e,t)})),r;case"[object Object]":if((t=t||new Map).has(e))return t.get(e);var n=Object.create(Object.getPrototypeOf(e));return t.set(e,n),Object.keys(e).forEach((function(r){n[r]=ee(e[r],t)})),n;default:return e}}function te(e){return e}function re(e,t,r){var n=[];e.forEach((function(e){return e[t]&&n.push(e)})),n.forEach((function(e){return e[t](r)}))}function ne(e,t,r){return new(J())((function(n){var i=n.next,a=n.error,o=n.complete,s=0,u=!1;function c(e,t){return e?function(t){++s,new Promise((function(r){return r(e(t))})).then((function(e){--s,i&&i.call(n,e),u&&l.complete()}),(function(e){--s,a&&a.call(n,e)}))}:function(e){return t&&t.call(n,e)}}var l={next:c(t,i),error:c(r,a),complete:function(){u=!0,s||o&&o.call(n)}},f=e.subscribe(l);return function(){return f.unsubscribe()}}))}function ie(e){function t(t){Object.defineProperty(e,t,{value:J()})}return"function"==typeof Symbol&&Symbol.species&&t(Symbol.species),t("@@species"),e}function ae(e){return e&&"function"==typeof e.then}var oe=function(e){function t(t){var r=e.call(this,(function(e){return r.addObserver(e),function(){return r.removeObserver(e)}}))||this;return r.observers=new Set,r.addCount=0,r.promise=new Promise((function(e,t){r.resolve=e,r.reject=t})),r.handlers={next:function(e){null!==r.sub&&(r.latest=["next",e],re(r.observers,"next",e))},error:function(e){var t=r.sub;null!==t&&(t&&Promise.resolve().then((function(){return t.unsubscribe()})),r.sub=null,r.latest=["error",e],r.reject(e),re(r.observers,"error",e))},complete:function(){if(null!==r.sub){var e=r.sources.shift();e?ae(e)?e.then((function(e){return r.sub=e.subscribe(r.handlers)})):r.sub=e.subscribe(r.handlers):(r.sub=null,r.latest&&"next"===r.latest[0]?r.resolve(r.latest[1]):r.resolve(),re(r.observers,"complete"))}}},r.cancel=function(e){r.reject(e),r.sources=[],r.handlers.complete()},r.promise.catch((function(e){})),"function"==typeof t&&(t=[new(J())(t)]),ae(t)?t.then((function(e){return r.start(e)}),r.handlers.error):r.start(t),r}return(0,u.ZT)(t,e),t.prototype.start=function(e){void 0===this.sub&&(this.sources=Array.from(e),this.handlers.complete())},t.prototype.deliverLastMessage=function(e){if(this.latest){var t=this.latest[0],r=e[t];r&&r.call(e,this.latest[1]),null===this.sub&&"next"===t&&e.complete&&e.complete()}},t.prototype.addObserver=function(e){this.observers.has(e)||(this.deliverLastMessage(e),this.observers.add(e),++this.addCount)},t.prototype.removeObserver=function(e,t){this.observers.delete(e)&&--this.addCount<1&&!t&&this.handlers.error(new Error("Observable cancelled prematurely"))},t.prototype.cleanup=function(e){var t=this,r=!1,n=function(){r||(r=!0,t.observers.delete(i),e())},i={next:n,error:n,complete:n},a=this.addCount;this.addObserver(i),this.addCount=a},t}(J());function se(e){return Array.isArray(e)&&e.length>0}function ue(e){return e.errors&&e.errors.length>0||!1}ie(oe);var ce="function"==typeof WeakMap&&!("object"==typeof navigator&&"ReactNative"===navigator.product);function le(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=Object.create(null);return e.forEach((function(e){e&&Object.keys(e).forEach((function(t){var n=e[t];void 0!==n&&(r[t]=n)}))})),r}},2152:(e,t,r)=>{"use strict";r.d(t,{D:()=>u});var n=Object.prototype,i=n.toString,a=n.hasOwnProperty,o=Function.prototype.toString,s=new Map;function u(e,t){try{return c(e,t)}finally{s.clear()}}function c(e,t){if(e===t)return!0;var r,n,s,u=i.call(e);if(u!==i.call(t))return!1;switch(u){case"[object Array]":if(e.length!==t.length)return!1;case"[object Object]":if(p(e,t))return!0;var f=l(e),d=l(t),y=f.length;if(y!==d.length)return!1;for(var v=0;v<y;++v)if(!a.call(t,f[v]))return!1;for(v=0;v<y;++v){var g=f[v];if(!c(e[g],t[g]))return!1}return!0;case"[object Error]":return e.name===t.name&&e.message===t.message;case"[object Number]":if(e!=e)return t!=t;case"[object Boolean]":case"[object Date]":return+e==+t;case"[object RegExp]":case"[object String]":return e==""+t;case"[object Map]":case"[object Set]":if(e.size!==t.size)return!1;if(p(e,t))return!0;for(var m=e.entries(),b="[object Map]"===u;;){var E=m.next();if(E.done)break;var S=E.value,C=S[0],w=S[1];if(!t.has(C))return!1;if(b&&!c(w,t.get(C)))return!1}return!0;case"[object AsyncFunction]":case"[object GeneratorFunction]":case"[object AsyncGeneratorFunction]":case"[object Function]":var T=o.call(e);return T===o.call(t)&&(n=h,!((s=(r=T).length-n.length)>=0&&r.indexOf(n,s)===s))}return!1}function l(e){return Object.keys(e).filter(f,e)}function f(e){return void 0!==this[e]}var h="{ [native code] }";function p(e,t){var r=s.get(e);if(r){if(r.has(t))return!0}else s.set(e,r=new Set);return r.add(t),!1}},9742:(e,t)=>{"use strict";t.byteLength=function(e){var t=u(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,a=u(e),o=a[0],s=a[1],c=new i(function(e,t,r){return 3*(t+r)/4-r}(0,o,s)),l=0,f=s>0?o-4:o;for(r=0;r<f;r+=4)t=n[e.charCodeAt(r)]<<18|n[e.charCodeAt(r+1)]<<12|n[e.charCodeAt(r+2)]<<6|n[e.charCodeAt(r+3)],c[l++]=t>>16&255,c[l++]=t>>8&255,c[l++]=255&t;2===s&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,c[l++]=255&t);1===s&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,c[l++]=t>>8&255,c[l++]=255&t);return c},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,a=[],o=16383,s=0,u=n-i;s<u;s+=o)a.push(c(e,s,s+o>u?u:s+o));1===i?(t=e[n-1],a.push(r[t>>2]+r[t<<4&63]+"==")):2===i&&(t=(e[n-2]<<8)+e[n-1],a.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"="));return a.join("")};for(var r=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0,s=a.length;o<s;++o)r[o]=a[o],n[a.charCodeAt(o)]=o;function u(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function c(e,t,n){for(var i,a,o=[],s=t;s<n;s+=3)i=(e[s]<<16&16711680)+(e[s+1]<<8&65280)+(255&e[s+2]),o.push(r[(a=i)>>18&63]+r[a>>12&63]+r[a>>6&63]+r[63&a]);return o.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},2240:(e,t,r)=>{"use strict";var n=r(1518);function i(e,t){return void 0===t&&(t="utf8"),Buffer.isBuffer(e)?o(e.toString("base64")):o(Buffer.from(e,t).toString("base64"))}function a(e){return e=e.toString(),n.default(e).replace(/\-/g,"+").replace(/_/g,"/")}function o(e){return e.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}var s=i;s.encode=i,s.decode=function(e,t){return void 0===t&&(t="utf8"),Buffer.from(a(e),"base64").toString(t)},s.toBase64=a,s.fromBase64=o,s.toBuffer=function(e){return Buffer.from(a(e),"base64")},t.default=s},1518:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=e.length,r=t%4;if(!r)return e;var n=t,i=4-r,a=t+i,o=Buffer.alloc(a);for(o.write(e);i--;)o.write("=",n++);return o.toString()}},5772:(e,t,r)=>{e.exports=r(2240).default,e.exports.default=e.exports},8764:(e,t,r)=>{"use strict";var n=r(9742),i=r(645),a="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;
2
2
  /*!
3
3
  * The buffer module from node.js, for the browser.
4
4
  *
@@ -12,270 +12,270 @@ window.decidimBulletinBoard=function(){var e={735:function(e,t,r){"use strict";r
12
12
  * See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE
13
13
  * @version v4.2.8+1e68dce6
14
14
  */
15
- e.exports=function(){"use strict";function e(e){var t=typeof e;return null!==e&&("object"===t||"function"===t)}function t(e){return"function"==typeof e}var n=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)},i=0,a=void 0,o=void 0,s=function(e,t){E[i]=e,E[i+1]=t,2===(i+=2)&&(o?o(S):w())};function u(e){o=e}function c(e){s=e}var l="undefined"!=typeof window?window:void 0,f=l||{},h=f.MutationObserver||f.WebKitMutationObserver,p="undefined"==typeof self&&"undefined"!=typeof process&&"[object process]"==={}.toString.call(process),d="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function y(){return function(){return process.nextTick(S)}}function v(){return void 0!==a?function(){a(S)}:b()}function g(){var e=0,t=new h(S),r=document.createTextNode("");return t.observe(r,{characterData:!0}),function(){r.data=e=++e%2}}function m(){var e=new MessageChannel;return e.port1.onmessage=S,function(){return e.port2.postMessage(0)}}function b(){var e=setTimeout;return function(){return e(S,1)}}var E=new Array(1e3);function S(){for(var e=0;e<i;e+=2)(0,E[e])(E[e+1]),E[e]=void 0,E[e+1]=void 0;i=0}function C(){try{var e=Function("return this")().require("vertx");return a=e.runOnLoop||e.runOnContext,v()}catch(e){return b()}}var w=void 0;function T(e,t){var r=this,n=new this.constructor(k);void 0===n[I]&&Q(n);var i=r._state;if(i){var a=arguments[i-1];s((function(){return q(i,n,a,r._result)}))}else K(r,n,e,t);return n}function A(e){var t=this;if(e&&"object"==typeof e&&e.constructor===t)return e;var r=new t(k);return L(r,e),r}w=p?y():h?g():d?m():void 0===l?C():b();var I=Math.random().toString(36).substring(2);function k(){}var _=void 0,B=1,N=2;function O(){return new TypeError("You cannot resolve a promise with itself")}function R(){return new TypeError("A promises callback cannot return that same promise.")}function x(e,t,r,n){try{e.call(t,r,n)}catch(e){return e}}function P(e,t,r){s((function(e){var n=!1,i=x(r,t,(function(r){n||(n=!0,t!==r?L(e,r):j(e,r))}),(function(t){n||(n=!0,V(e,t))}),"Settle: "+(e._label||" unknown promise"));!n&&i&&(n=!0,V(e,i))}),e)}function F(e,t){t._state===B?j(e,t._result):t._state===N?V(e,t._result):K(t,void 0,(function(t){return L(e,t)}),(function(t){return V(e,t)}))}function D(e,r,n){r.constructor===e.constructor&&n===T&&r.constructor.resolve===A?F(e,r):void 0===n?j(e,r):t(n)?P(e,r,n):j(e,r)}function L(t,r){if(t===r)V(t,O());else if(e(r)){var n=void 0;try{n=r.then}catch(e){return void V(t,e)}D(t,r,n)}else j(t,r)}function U(e){e._onerror&&e._onerror(e._result),M(e)}function j(e,t){e._state===_&&(e._result=t,e._state=B,0!==e._subscribers.length&&s(M,e))}function V(e,t){e._state===_&&(e._state=N,e._result=t,s(U,e))}function K(e,t,r,n){var i=e._subscribers,a=i.length;e._onerror=null,i[a]=t,i[a+B]=r,i[a+N]=n,0===a&&e._state&&s(M,e)}function M(e){var t=e._subscribers,r=e._state;if(0!==t.length){for(var n=void 0,i=void 0,a=e._result,o=0;o<t.length;o+=3)n=t[o],i=t[o+r],n?q(r,n,i,a):i(a);e._subscribers.length=0}}function q(e,r,n,i){var a=t(n),o=void 0,s=void 0,u=!0;if(a){try{o=n(i)}catch(e){u=!1,s=e}if(r===o)return void V(r,R())}else o=i;r._state!==_||(a&&u?L(r,o):!1===u?V(r,s):e===B?j(r,o):e===N&&V(r,o))}function z(e,t){try{t((function(t){L(e,t)}),(function(t){V(e,t)}))}catch(t){V(e,t)}}var H=0;function G(){return H++}function Q(e){e[I]=H++,e._state=void 0,e._result=void 0,e._subscribers=[]}function W(){return new Error("Array Methods must be provided an Array")}var Y=function(){function e(e,t){this._instanceConstructor=e,this.promise=new e(k),this.promise[I]||Q(this.promise),n(t)?(this.length=t.length,this._remaining=t.length,this._result=new Array(this.length),0===this.length?j(this.promise,this._result):(this.length=this.length||0,this._enumerate(t),0===this._remaining&&j(this.promise,this._result))):V(this.promise,W())}return e.prototype._enumerate=function(e){for(var t=0;this._state===_&&t<e.length;t++)this._eachEntry(e[t],t)},e.prototype._eachEntry=function(e,t){var r=this._instanceConstructor,n=r.resolve;if(n===A){var i=void 0,a=void 0,o=!1;try{i=e.then}catch(e){o=!0,a=e}if(i===T&&e._state!==_)this._settledAt(e._state,t,e._result);else if("function"!=typeof i)this._remaining--,this._result[t]=e;else if(r===te){var s=new r(k);o?V(s,a):D(s,e,i),this._willSettleAt(s,t)}else this._willSettleAt(new r((function(t){return t(e)})),t)}else this._willSettleAt(n(e),t)},e.prototype._settledAt=function(e,t,r){var n=this.promise;n._state===_&&(this._remaining--,e===N?V(n,r):this._result[t]=r),0===this._remaining&&j(n,this._result)},e.prototype._willSettleAt=function(e,t){var r=this;K(e,void 0,(function(e){return r._settledAt(B,t,e)}),(function(e){return r._settledAt(N,t,e)}))},e}();function Z(e){return new Y(this,e).promise}function J(e){var t=this;return n(e)?new t((function(r,n){for(var i=e.length,a=0;a<i;a++)t.resolve(e[a]).then(r,n)})):new t((function(e,t){return t(new TypeError("You must pass an array to race."))}))}function X(e){var t=new this(k);return V(t,e),t}function $(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function ee(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}var te=function(){function e(t){this[I]=G(),this._result=this._state=void 0,this._subscribers=[],k!==t&&("function"!=typeof t&&$(),this instanceof e?z(this,t):ee())}return e.prototype.catch=function(e){return this.then(null,e)},e.prototype.finally=function(e){var r=this,n=r.constructor;return t(e)?r.then((function(t){return n.resolve(e()).then((function(){return t}))}),(function(t){return n.resolve(e()).then((function(){throw t}))})):r.then(e,e)},e}();function re(){var e=void 0;if(void 0!==r.g)e=r.g;else if("undefined"!=typeof self)e=self;else try{e=Function("return this")()}catch(e){throw new Error("polyfill failed because global object is unavailable in this environment")}var t=e.Promise;if(t){var n=null;try{n=Object.prototype.toString.call(t.resolve())}catch(e){}if("[object Promise]"===n&&!t.cast)return}e.Promise=te}return te.prototype.then=T,te.all=Z,te.race=J,te.resolve=A,te.reject=X,te._setScheduler=u,te._setAsap=c,te._asap=s,te.polyfill=re,te.Promise=te,te}()},5035:function(e){"use strict";e.exports=function(e,t){t||(t={}),"function"==typeof t&&(t={cmp:t});var r,n="boolean"==typeof t.cycles&&t.cycles,i=t.cmp&&(r=t.cmp,function(e){return function(t,n){var i={key:t,value:e[t]},a={key:n,value:e[n]};return r(i,a)}}),a=[];return function e(t){if(t&&t.toJSON&&"function"==typeof t.toJSON&&(t=t.toJSON()),void 0!==t){if("number"==typeof t)return isFinite(t)?""+t:"null";if("object"!=typeof t)return JSON.stringify(t);var r,o;if(Array.isArray(t)){for(o="[",r=0;r<t.length;r++)r&&(o+=","),o+=e(t[r])||"null";return o+"]"}if(null===t)return"null";if(-1!==a.indexOf(t)){if(n)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}var s=a.push(t)-1,u=Object.keys(t).sort(i&&i(t));for(o="",r=0;r<u.length;r++){var c=u[r],l=e(t[c]);l&&(o&&(o+=","),o+=JSON.stringify(c)+":"+l)}return a.splice(s,1),"{"+o+"}"}}(e)}},9312:function(e){var t={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GetElectionLogEntries"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"electionUniqueId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"after"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"types"}},type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"election"},arguments:[{kind:"Argument",name:{kind:"Name",value:"uniqueId"},value:{kind:"Variable",name:{kind:"Name",value:"electionUniqueId"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"logEntries"},arguments:[{kind:"Argument",name:{kind:"Name",value:"after"},value:{kind:"Variable",name:{kind:"Name",value:"after"}}},{kind:"Argument",name:{kind:"Name",value:"types"},value:{kind:"Variable",name:{kind:"Name",value:"types"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"messageId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"signedData"},arguments:[],directives:[]}]}}]}}]}}],loc:{start:0,end:242}};t.loc.source={body:"query GetElectionLogEntries(\n $electionUniqueId: String!\n $after: String\n $types: [String!]\n) {\n election(uniqueId: $electionUniqueId) {\n logEntries(after: $after, types: $types) {\n id\n messageId\n signedData\n }\n }\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};function r(e,t){if("FragmentSpread"===e.kind)t.add(e.name.value);else if("VariableDefinition"===e.kind){var n=e.type;"NamedType"===n.kind&&t.add(n.name.value)}e.selectionSet&&e.selectionSet.selections.forEach((function(e){r(e,t)})),e.variableDefinitions&&e.variableDefinitions.forEach((function(e){r(e,t)})),e.definitions&&e.definitions.forEach((function(e){r(e,t)}))}var n={};function i(e,t){for(var r=0;r<e.definitions.length;r++){var n=e.definitions[r];if(n.name&&n.name.value==t)return n}}t.definitions.forEach((function(e){if(e.name){var t=new Set;r(e,t),n[e.name.value]=t}})),e.exports=t,e.exports.GetElectionLogEntries=function(e,t){var r={kind:e.kind,definitions:[i(e,t)]};e.hasOwnProperty("loc")&&(r.loc=e.loc);var a=n[t]||new Set,o=new Set,s=new Set;for(a.forEach((function(e){s.add(e)}));s.size>0;){var u=s;s=new Set,u.forEach((function(e){o.has(e)||(o.add(e),(n[e]||new Set).forEach((function(e){s.add(e)})))}))}return o.forEach((function(t){var n=i(e,t);n&&r.definitions.push(n)})),r}(t,"GetElectionLogEntries")},6890:function(e){var t={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GetLogEntry"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"electionUniqueId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"contentHash"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"logEntry"},arguments:[{kind:"Argument",name:{kind:"Name",value:"electionUniqueId"},value:{kind:"Variable",name:{kind:"Name",value:"electionUniqueId"}}},{kind:"Argument",name:{kind:"Name",value:"contentHash"},value:{kind:"Variable",name:{kind:"Name",value:"contentHash"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"messageId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"signedData"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"contentHash"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:199}};t.loc.source={body:"query GetLogEntry($electionUniqueId: String!, $contentHash: String!) {\n logEntry(electionUniqueId: $electionUniqueId, contentHash: $contentHash) {\n messageId\n signedData\n contentHash\n }\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};function r(e,t){if("FragmentSpread"===e.kind)t.add(e.name.value);else if("VariableDefinition"===e.kind){var n=e.type;"NamedType"===n.kind&&t.add(n.name.value)}e.selectionSet&&e.selectionSet.selections.forEach((function(e){r(e,t)})),e.variableDefinitions&&e.variableDefinitions.forEach((function(e){r(e,t)})),e.definitions&&e.definitions.forEach((function(e){r(e,t)}))}var n={};function i(e,t){for(var r=0;r<e.definitions.length;r++){var n=e.definitions[r];if(n.name&&n.name.value==t)return n}}t.definitions.forEach((function(e){if(e.name){var t=new Set;r(e,t),n[e.name.value]=t}})),e.exports=t,e.exports.GetLogEntry=function(e,t){var r={kind:e.kind,definitions:[i(e,t)]};e.hasOwnProperty("loc")&&(r.loc=e.loc);var a=n[t]||new Set,o=new Set,s=new Set;for(a.forEach((function(e){s.add(e)}));s.size>0;){var u=s;s=new Set,u.forEach((function(e){o.has(e)||(o.add(e),(n[e]||new Set).forEach((function(e){s.add(e)})))}))}return o.forEach((function(t){var n=i(e,t);n&&r.definitions.push(n)})),r}(t,"GetLogEntry")},5313:function(e){var t={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GetPendingMessageByMessageId"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"messageId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"pendingMessage"},arguments:[{kind:"Argument",name:{kind:"Name",value:"messageId"},value:{kind:"Variable",name:{kind:"Name",value:"messageId"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"status"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:117}};t.loc.source={body:"query GetPendingMessageByMessageId($messageId: String!) {\n pendingMessage(messageId: $messageId) {\n status\n }\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};function r(e,t){if("FragmentSpread"===e.kind)t.add(e.name.value);else if("VariableDefinition"===e.kind){var n=e.type;"NamedType"===n.kind&&t.add(n.name.value)}e.selectionSet&&e.selectionSet.selections.forEach((function(e){r(e,t)})),e.variableDefinitions&&e.variableDefinitions.forEach((function(e){r(e,t)})),e.definitions&&e.definitions.forEach((function(e){r(e,t)}))}var n={};function i(e,t){for(var r=0;r<e.definitions.length;r++){var n=e.definitions[r];if(n.name&&n.name.value==t)return n}}t.definitions.forEach((function(e){if(e.name){var t=new Set;r(e,t),n[e.name.value]=t}})),e.exports=t,e.exports.GetPendingMessageByMessageId=function(e,t){var r={kind:e.kind,definitions:[i(e,t)]};e.hasOwnProperty("loc")&&(r.loc=e.loc);var a=n[t]||new Set,o=new Set,s=new Set;for(a.forEach((function(e){s.add(e)}));s.size>0;){var u=s;s=new Set,u.forEach((function(e){o.has(e)||(o.add(e),(n[e]||new Set).forEach((function(e){s.add(e)})))}))}return o.forEach((function(t){var n=i(e,t);n&&r.definitions.push(n)})),r}(t,"GetPendingMessageByMessageId")},9953:function(e){var t={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"ProcessKeyCeremonyStep"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"messageId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"signedData"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"processKeyCeremonyStep"},arguments:[{kind:"Argument",name:{kind:"Name",value:"messageId"},value:{kind:"Variable",name:{kind:"Name",value:"messageId"}}},{kind:"Argument",name:{kind:"Name",value:"signedData"},value:{kind:"Variable",name:{kind:"Name",value:"signedData"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"pendingMessage"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"signedData"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"error"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:212}};t.loc.source={body:"mutation ProcessKeyCeremonyStep($messageId: String!, $signedData: String!) {\n processKeyCeremonyStep(messageId: $messageId, signedData: $signedData) {\n pendingMessage {\n signedData\n }\n error\n }\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};function r(e,t){if("FragmentSpread"===e.kind)t.add(e.name.value);else if("VariableDefinition"===e.kind){var n=e.type;"NamedType"===n.kind&&t.add(n.name.value)}e.selectionSet&&e.selectionSet.selections.forEach((function(e){r(e,t)})),e.variableDefinitions&&e.variableDefinitions.forEach((function(e){r(e,t)})),e.definitions&&e.definitions.forEach((function(e){r(e,t)}))}var n={};function i(e,t){for(var r=0;r<e.definitions.length;r++){var n=e.definitions[r];if(n.name&&n.name.value==t)return n}}t.definitions.forEach((function(e){if(e.name){var t=new Set;r(e,t),n[e.name.value]=t}})),e.exports=t,e.exports.ProcessKeyCeremonyStep=function(e,t){var r={kind:e.kind,definitions:[i(e,t)]};e.hasOwnProperty("loc")&&(r.loc=e.loc);var a=n[t]||new Set,o=new Set,s=new Set;for(a.forEach((function(e){s.add(e)}));s.size>0;){var u=s;s=new Set,u.forEach((function(e){o.has(e)||(o.add(e),(n[e]||new Set).forEach((function(e){s.add(e)})))}))}return o.forEach((function(t){var n=i(e,t);n&&r.definitions.push(n)})),r}(t,"ProcessKeyCeremonyStep")},3718:function(e){var t={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"ProcessTallyStep"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"messageId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"signedData"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"processTallyStep"},arguments:[{kind:"Argument",name:{kind:"Name",value:"messageId"},value:{kind:"Variable",name:{kind:"Name",value:"messageId"}}},{kind:"Argument",name:{kind:"Name",value:"signedData"},value:{kind:"Variable",name:{kind:"Name",value:"signedData"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"pendingMessage"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"signedData"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"error"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:200}};t.loc.source={body:"mutation ProcessTallyStep($messageId: String!, $signedData: String!) {\n processTallyStep(messageId: $messageId, signedData: $signedData) {\n pendingMessage {\n signedData\n }\n error\n }\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};function r(e,t){if("FragmentSpread"===e.kind)t.add(e.name.value);else if("VariableDefinition"===e.kind){var n=e.type;"NamedType"===n.kind&&t.add(n.name.value)}e.selectionSet&&e.selectionSet.selections.forEach((function(e){r(e,t)})),e.variableDefinitions&&e.variableDefinitions.forEach((function(e){r(e,t)})),e.definitions&&e.definitions.forEach((function(e){r(e,t)}))}var n={};function i(e,t){for(var r=0;r<e.definitions.length;r++){var n=e.definitions[r];if(n.name&&n.name.value==t)return n}}t.definitions.forEach((function(e){if(e.name){var t=new Set;r(e,t),n[e.name.value]=t}})),e.exports=t,e.exports.ProcessTallyStep=function(e,t){var r={kind:e.kind,definitions:[i(e,t)]};e.hasOwnProperty("loc")&&(r.loc=e.loc);var a=n[t]||new Set,o=new Set,s=new Set;for(a.forEach((function(e){s.add(e)}));s.size>0;){var u=s;s=new Set,u.forEach((function(e){o.has(e)||(o.add(e),(n[e]||new Set).forEach((function(e){s.add(e)})))}))}return o.forEach((function(t){var n=i(e,t);n&&r.definitions.push(n)})),r}(t,"ProcessTallyStep")},972:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=e.prototype.toJSON;"function"==typeof t||(0,n.default)(0),e.prototype.inspect=t,i.default&&(e.prototype[i.default]=t)};var n=a(r(7706)),i=a(r(8554));function a(e){return e&&e.__esModule?e:{default:e}}},8002:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return o(e,[])};var n,i=(n=r(8554))&&n.__esModule?n:{default:n};function a(e){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e,t){switch(a(e)){case"string":return JSON.stringify(e);case"function":return e.name?"[function ".concat(e.name,"]"):"[function]";case"object":return null===e?"null":function(e,t){if(-1!==t.indexOf(e))return"[Circular]";var r=[].concat(t,[e]),n=function(e){var t=e[String(i.default)];if("function"==typeof t)return t;if("function"==typeof e.inspect)return e.inspect}(e);if(void 0!==n){var a=n.call(e);if(a!==e)return"string"==typeof a?a:o(a,r)}else if(Array.isArray(e))return function(e,t){if(0===e.length)return"[]";if(t.length>2)return"[Array]";for(var r=Math.min(10,e.length),n=e.length-r,i=[],a=0;a<r;++a)i.push(o(e[a],t));1===n?i.push("... 1 more item"):n>1&&i.push("... ".concat(n," more items"));return"["+i.join(", ")+"]"}(e,r);return function(e,t){var r=Object.keys(e);if(0===r.length)return"{}";if(t.length>2)return"["+function(e){var t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if("Object"===t&&"function"==typeof e.constructor){var r=e.constructor.name;if("string"==typeof r&&""!==r)return r}return t}(e)+"]";return"{ "+r.map((function(r){return r+": "+o(e[r],t)})).join(", ")+" }"}(e,r)}(e,t);default:return String(e)}}},6589:function(e,t,r){"use strict";r.d(t,{Z:function(){return a}});var n=r(7986);function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e){return o(e,[])}function o(e,t){switch(i(e)){case"string":return JSON.stringify(e);case"function":return e.name?"[function ".concat(e.name,"]"):"[function]";case"object":return null===e?"null":function(e,t){if(-1!==t.indexOf(e))return"[Circular]";var r=[].concat(t,[e]),i=function(e){var t=e[String(n.Z)];if("function"==typeof t)return t;if("function"==typeof e.inspect)return e.inspect}(e);if(void 0!==i){var a=i.call(e);if(a!==e)return"string"==typeof a?a:o(a,r)}else if(Array.isArray(e))return function(e,t){if(0===e.length)return"[]";if(t.length>2)return"[Array]";for(var r=Math.min(10,e.length),n=e.length-r,i=[],a=0;a<r;++a)i.push(o(e[a],t));1===n?i.push("... 1 more item"):n>1&&i.push("... ".concat(n," more items"));return"["+i.join(", ")+"]"}(e,r);return function(e,t){var r=Object.keys(e);if(0===r.length)return"{}";if(t.length>2)return"["+function(e){var t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if("Object"===t&&"function"==typeof e.constructor){var r=e.constructor.name;if("string"==typeof r&&""!==r)return r}return t}(e)+"]";return"{ "+r.map((function(r){return r+": "+o(e[r],t)})).join(", ")+" }"}(e,r)}(e,t);default:return String(e)}}},7706:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if(!Boolean(e))throw new Error(null!=t?t:"Unexpected invariant triggered.")}},8554:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):void 0;t.default=r},7986:function(e,t){"use strict";var r="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):void 0;t.Z=r},1807:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isNode=function(e){return null!=e&&"string"==typeof e.kind},t.Token=t.Location=void 0;var n,i=(n=r(972))&&n.__esModule?n:{default:n};var a=function(){function e(e,t,r){this.start=e.start,this.end=t.end,this.startToken=e,this.endToken=t,this.source=r}return e.prototype.toJSON=function(){return{start:this.start,end:this.end}},e}();t.Location=a,(0,i.default)(a);var o=function(){function e(e,t,r,n,i,a,o){this.kind=e,this.start=t,this.end=r,this.line=n,this.column=i,this.value=o,this.prev=a,this.next=null}return e.prototype.toJSON=function(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}},e}();t.Token=o,(0,i.default)(o)},3059:function(e,t,r){"use strict";r.d(t,{Ye:function(){return a},WU:function(){return o},UG:function(){return s}});var n=r(7986);function i(e){var t=e.prototype.toJSON;"function"==typeof t||function(e,t){if(!Boolean(e))throw new Error(null!=t?t:"Unexpected invariant triggered.")}(0),e.prototype.inspect=t,n.Z&&(e.prototype[n.Z]=t)}var a=function(){function e(e,t,r){this.start=e.start,this.end=t.end,this.startToken=e,this.endToken=t,this.source=r}return e.prototype.toJSON=function(){return{start:this.start,end:this.end}},e}();i(a);var o=function(){function e(e,t,r,n,i,a,o){this.kind=e,this.start=t,this.end=r,this.line=n,this.column=i,this.value=o,this.prev=a,this.next=null}return e.prototype.toJSON=function(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}},e}();function s(e){return null!=e&&"string"==typeof e.kind}i(o)},7420:function(e,t,r){"use strict";function n(e){var t=e.split(/\r\n|[\n\r]/g),r=function(e){for(var t,r=!0,n=!0,i=0,a=null,o=0;o<e.length;++o)switch(e.charCodeAt(o)){case 13:10===e.charCodeAt(o+1)&&++o;case 10:r=!1,n=!0,i=0;break;case 9:case 32:++i;break;default:n&&!r&&(null===a||i<a)&&(a=i),n=!1}return null!==(t=a)&&void 0!==t?t:0}(e);if(0!==r)for(var n=1;n<t.length;n++)t[n]=t[n].slice(r);for(var a=0;a<t.length&&i(t[a]);)++a;for(var o=t.length;o>a&&i(t[o-1]);)--o;return t.slice(a,o).join("\n")}function i(e){for(var t=0;t<e.length;++t)if(" "!==e[t]&&"\t"!==e[t])return!1;return!0}function a(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=-1===e.indexOf("\n"),i=" "===e[0]||"\t"===e[0],a='"'===e[e.length-1],o="\\"===e[e.length-1],s=!n||a||o||r,u="";return!s||n&&i||(u+="\n"+t),u+=t?e.replace(/\n/g,"\n"+t):e,s&&(u+="\n"),'"""'+u.replace(/"""/g,'\\"""')+'"""'}r.d(t,{W7:function(){return n},LZ:function(){return a}})},285:function(e,t,r){"use strict";t.Vn=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:o,n=void 0,c=Array.isArray(e),l=[e],f=-1,h=[],p=void 0,d=void 0,y=void 0,v=[],g=[],m=e;do{var b=++f===l.length,E=b&&0!==h.length;if(b){if(d=0===g.length?void 0:v[v.length-1],p=y,y=g.pop(),E){if(c)p=p.slice();else{for(var S={},C=0,w=Object.keys(p);C<w.length;C++){var T=w[C];S[T]=p[T]}p=S}for(var A=0,I=0;I<h.length;I++){var k=h[I][0],_=h[I][1];c&&(k-=A),c&&null===_?(p.splice(k,1),A++):p[k]=_}}f=n.index,l=n.keys,h=n.edits,c=n.inArray,n=n.prev}else{if(d=y?c?f:l[f]:void 0,null==(p=y?y[d]:m))continue;y&&v.push(d)}var B,N=void 0;if(!Array.isArray(p)){if(!(0,a.isNode)(p))throw new Error("Invalid AST Node: ".concat((0,i.default)(p),"."));var O=u(t,p.kind,b);if(O){if((N=O.call(t,p,d,y,v,g))===s)break;if(!1===N){if(!b){v.pop();continue}}else if(void 0!==N&&(h.push([d,N]),!b)){if(!(0,a.isNode)(N)){v.pop();continue}p=N}}}if(void 0===N&&E&&h.push([d,p]),b)v.pop();else n={inArray:c,index:f,keys:l,edits:h,prev:n},c=Array.isArray(p),l=c?p:null!==(B=r[p.kind])&&void 0!==B?B:[],f=-1,h=[],y&&g.push(y),y=p}while(void 0!==n);0!==h.length&&(m=h[h.length-1][1]);return m};var n,i=(n=r(8002))&&n.__esModule?n:{default:n},a=r(1807);var o={Name:[],Document:["definitions"],OperationDefinition:["name","variableDefinitions","directives","selectionSet"],VariableDefinition:["variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentSpread:["name","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","locations"],SchemaExtension:["directives","operationTypes"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"]};var s=Object.freeze({});function u(e,t,r){var n=e[t];if(n){if(!r&&"function"==typeof n)return n;var i=r?n.leave:n.enter;if("function"==typeof i)return i}else{var a=r?e.leave:e.enter;if(a){if("function"==typeof a)return a;var o=a[t];if("function"==typeof o)return o}}}},7636:function(e,t,r){"use strict";r.d(t,{$_:function(){return o},Vn:function(){return s}});var n=r(6589),i=r(3059),a={Name:[],Document:["definitions"],OperationDefinition:["name","variableDefinitions","directives","selectionSet"],VariableDefinition:["variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentSpread:["name","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","locations"],SchemaExtension:["directives","operationTypes"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"]},o=Object.freeze({});function s(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:a,s=void 0,c=Array.isArray(e),l=[e],f=-1,h=[],p=void 0,d=void 0,y=void 0,v=[],g=[],m=e;do{var b=++f===l.length,E=b&&0!==h.length;if(b){if(d=0===g.length?void 0:v[v.length-1],p=y,y=g.pop(),E){if(c)p=p.slice();else{for(var S={},C=0,w=Object.keys(p);C<w.length;C++){var T=w[C];S[T]=p[T]}p=S}for(var A=0,I=0;I<h.length;I++){var k=h[I][0],_=h[I][1];c&&(k-=A),c&&null===_?(p.splice(k,1),A++):p[k]=_}}f=s.index,l=s.keys,h=s.edits,c=s.inArray,s=s.prev}else{if(d=y?c?f:l[f]:void 0,null==(p=y?y[d]:m))continue;y&&v.push(d)}var B,N=void 0;if(!Array.isArray(p)){if(!(0,i.UG)(p))throw new Error("Invalid AST Node: ".concat((0,n.Z)(p),"."));var O=u(t,p.kind,b);if(O){if((N=O.call(t,p,d,y,v,g))===o)break;if(!1===N){if(!b){v.pop();continue}}else if(void 0!==N&&(h.push([d,N]),!b)){if(!(0,i.UG)(N)){v.pop();continue}p=N}}}if(void 0===N&&E&&h.push([d,p]),b)v.pop();else s={inArray:c,index:f,keys:l,edits:h,prev:s},l=(c=Array.isArray(p))?p:null!==(B=r[p.kind])&&void 0!==B?B:[],f=-1,h=[],y&&g.push(y),y=p}while(void 0!==s);return 0!==h.length&&(m=h[h.length-1][1]),m}function u(e,t,r){var n=e[t];if(n){if(!r&&"function"==typeof n)return n;var i=r?n.leave:n.enter;if("function"==typeof i)return i}else{var a=r?e.leave:e.enter;if(a){if("function"==typeof a)return a;var o=a[t];if("function"==typeof o)return o}}}},645:function(e,t){
15
+ e.exports=function(){"use strict";function e(e){var t=typeof e;return null!==e&&("object"===t||"function"===t)}function t(e){return"function"==typeof e}var n=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)},i=0,a=void 0,o=void 0,s=function(e,t){E[i]=e,E[i+1]=t,2===(i+=2)&&(o?o(S):w())};function u(e){o=e}function c(e){s=e}var l="undefined"!=typeof window?window:void 0,f=l||{},h=f.MutationObserver||f.WebKitMutationObserver,p="undefined"==typeof self&&"undefined"!=typeof process&&"[object process]"==={}.toString.call(process),d="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function y(){return function(){return process.nextTick(S)}}function v(){return void 0!==a?function(){a(S)}:b()}function g(){var e=0,t=new h(S),r=document.createTextNode("");return t.observe(r,{characterData:!0}),function(){r.data=e=++e%2}}function m(){var e=new MessageChannel;return e.port1.onmessage=S,function(){return e.port2.postMessage(0)}}function b(){var e=setTimeout;return function(){return e(S,1)}}var E=new Array(1e3);function S(){for(var e=0;e<i;e+=2)(0,E[e])(E[e+1]),E[e]=void 0,E[e+1]=void 0;i=0}function C(){try{var e=Function("return this")().require("vertx");return a=e.runOnLoop||e.runOnContext,v()}catch(e){return b()}}var w=void 0;function T(e,t){var r=this,n=new this.constructor(k);void 0===n[I]&&Q(n);var i=r._state;if(i){var a=arguments[i-1];s((function(){return q(i,n,a,r._result)}))}else K(r,n,e,t);return n}function A(e){var t=this;if(e&&"object"==typeof e&&e.constructor===t)return e;var r=new t(k);return L(r,e),r}w=p?y():h?g():d?m():void 0===l?C():b();var I=Math.random().toString(36).substring(2);function k(){}var _=void 0,B=1,N=2;function O(){return new TypeError("You cannot resolve a promise with itself")}function R(){return new TypeError("A promises callback cannot return that same promise.")}function x(e,t,r,n){try{e.call(t,r,n)}catch(e){return e}}function P(e,t,r){s((function(e){var n=!1,i=x(r,t,(function(r){n||(n=!0,t!==r?L(e,r):j(e,r))}),(function(t){n||(n=!0,V(e,t))}),"Settle: "+(e._label||" unknown promise"));!n&&i&&(n=!0,V(e,i))}),e)}function F(e,t){t._state===B?j(e,t._result):t._state===N?V(e,t._result):K(t,void 0,(function(t){return L(e,t)}),(function(t){return V(e,t)}))}function D(e,r,n){r.constructor===e.constructor&&n===T&&r.constructor.resolve===A?F(e,r):void 0===n?j(e,r):t(n)?P(e,r,n):j(e,r)}function L(t,r){if(t===r)V(t,O());else if(e(r)){var n=void 0;try{n=r.then}catch(e){return void V(t,e)}D(t,r,n)}else j(t,r)}function U(e){e._onerror&&e._onerror(e._result),M(e)}function j(e,t){e._state===_&&(e._result=t,e._state=B,0!==e._subscribers.length&&s(M,e))}function V(e,t){e._state===_&&(e._state=N,e._result=t,s(U,e))}function K(e,t,r,n){var i=e._subscribers,a=i.length;e._onerror=null,i[a]=t,i[a+B]=r,i[a+N]=n,0===a&&e._state&&s(M,e)}function M(e){var t=e._subscribers,r=e._state;if(0!==t.length){for(var n=void 0,i=void 0,a=e._result,o=0;o<t.length;o+=3)n=t[o],i=t[o+r],n?q(r,n,i,a):i(a);e._subscribers.length=0}}function q(e,r,n,i){var a=t(n),o=void 0,s=void 0,u=!0;if(a){try{o=n(i)}catch(e){u=!1,s=e}if(r===o)return void V(r,R())}else o=i;r._state!==_||(a&&u?L(r,o):!1===u?V(r,s):e===B?j(r,o):e===N&&V(r,o))}function z(e,t){try{t((function(t){L(e,t)}),(function(t){V(e,t)}))}catch(t){V(e,t)}}var H=0;function G(){return H++}function Q(e){e[I]=H++,e._state=void 0,e._result=void 0,e._subscribers=[]}function W(){return new Error("Array Methods must be provided an Array")}var Y=function(){function e(e,t){this._instanceConstructor=e,this.promise=new e(k),this.promise[I]||Q(this.promise),n(t)?(this.length=t.length,this._remaining=t.length,this._result=new Array(this.length),0===this.length?j(this.promise,this._result):(this.length=this.length||0,this._enumerate(t),0===this._remaining&&j(this.promise,this._result))):V(this.promise,W())}return e.prototype._enumerate=function(e){for(var t=0;this._state===_&&t<e.length;t++)this._eachEntry(e[t],t)},e.prototype._eachEntry=function(e,t){var r=this._instanceConstructor,n=r.resolve;if(n===A){var i=void 0,a=void 0,o=!1;try{i=e.then}catch(e){o=!0,a=e}if(i===T&&e._state!==_)this._settledAt(e._state,t,e._result);else if("function"!=typeof i)this._remaining--,this._result[t]=e;else if(r===te){var s=new r(k);o?V(s,a):D(s,e,i),this._willSettleAt(s,t)}else this._willSettleAt(new r((function(t){return t(e)})),t)}else this._willSettleAt(n(e),t)},e.prototype._settledAt=function(e,t,r){var n=this.promise;n._state===_&&(this._remaining--,e===N?V(n,r):this._result[t]=r),0===this._remaining&&j(n,this._result)},e.prototype._willSettleAt=function(e,t){var r=this;K(e,void 0,(function(e){return r._settledAt(B,t,e)}),(function(e){return r._settledAt(N,t,e)}))},e}();function Z(e){return new Y(this,e).promise}function J(e){var t=this;return n(e)?new t((function(r,n){for(var i=e.length,a=0;a<i;a++)t.resolve(e[a]).then(r,n)})):new t((function(e,t){return t(new TypeError("You must pass an array to race."))}))}function X(e){var t=new this(k);return V(t,e),t}function $(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function ee(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}var te=function(){function e(t){this[I]=G(),this._result=this._state=void 0,this._subscribers=[],k!==t&&("function"!=typeof t&&$(),this instanceof e?z(this,t):ee())}return e.prototype.catch=function(e){return this.then(null,e)},e.prototype.finally=function(e){var r=this,n=r.constructor;return t(e)?r.then((function(t){return n.resolve(e()).then((function(){return t}))}),(function(t){return n.resolve(e()).then((function(){throw t}))})):r.then(e,e)},e}();function re(){var e=void 0;if(void 0!==r.g)e=r.g;else if("undefined"!=typeof self)e=self;else try{e=Function("return this")()}catch(e){throw new Error("polyfill failed because global object is unavailable in this environment")}var t=e.Promise;if(t){var n=null;try{n=Object.prototype.toString.call(t.resolve())}catch(e){}if("[object Promise]"===n&&!t.cast)return}e.Promise=te}return te.prototype.then=T,te.all=Z,te.race=J,te.resolve=A,te.reject=X,te._setScheduler=u,te._setAsap=c,te._asap=s,te.polyfill=re,te.Promise=te,te}()},5035:e=>{"use strict";e.exports=function(e,t){t||(t={}),"function"==typeof t&&(t={cmp:t});var r,n="boolean"==typeof t.cycles&&t.cycles,i=t.cmp&&(r=t.cmp,function(e){return function(t,n){var i={key:t,value:e[t]},a={key:n,value:e[n]};return r(i,a)}}),a=[];return function e(t){if(t&&t.toJSON&&"function"==typeof t.toJSON&&(t=t.toJSON()),void 0!==t){if("number"==typeof t)return isFinite(t)?""+t:"null";if("object"!=typeof t)return JSON.stringify(t);var r,o;if(Array.isArray(t)){for(o="[",r=0;r<t.length;r++)r&&(o+=","),o+=e(t[r])||"null";return o+"]"}if(null===t)return"null";if(-1!==a.indexOf(t)){if(n)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}var s=a.push(t)-1,u=Object.keys(t).sort(i&&i(t));for(o="",r=0;r<u.length;r++){var c=u[r],l=e(t[c]);l&&(o&&(o+=","),o+=JSON.stringify(c)+":"+l)}return a.splice(s,1),"{"+o+"}"}}(e)}},2527:(e,t,r)=>{"use strict";r.d(t,{ZP:()=>ee});var n=r(655);function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}"function"==typeof Symbol&&null!=Symbol.iterator&&Symbol.iterator,"function"==typeof Symbol&&null!=Symbol.asyncIterator&&Symbol.asyncIterator;var a="function"==typeof Symbol&&null!=Symbol.toStringTag?Symbol.toStringTag:"@@toStringTag";function o(e,t){for(var r,n=/\r\n|[\n\r]/g,i=1,a=t+1;(r=n.exec(e.body))&&r.index<t;)i+=1,a=t+1-(r.index+r[0].length);return{line:i,column:a}}function s(e){return u(e.source,o(e.source,e.start))}function u(e,t){var r=e.locationOffset.column-1,n=l(r)+e.body,i=t.line-1,a=e.locationOffset.line-1,o=t.line+a,s=1===t.line?r:0,u=t.column+s,f="".concat(e.name,":").concat(o,":").concat(u,"\n"),h=n.split(/\r\n|[\n\r]/g),p=h[i];if(p.length>120){for(var d=Math.floor(u/80),y=u%80,v=[],g=0;g<p.length;g+=80)v.push(p.slice(g,g+80));return f+c([["".concat(o),v[0]]].concat(v.slice(1,d+1).map((function(e){return["",e]})),[[" ",l(y-1)+"^"],["",v[d+1]]]))}return f+c([["".concat(o-1),h[i-1]],["".concat(o),p],["",l(u-1)+"^"],["".concat(o+1),h[i+1]]])}function c(e){var t=e.filter((function(e){e[0];return void 0!==e[1]})),r=Math.max.apply(Math,t.map((function(e){return e[0].length})));return t.map((function(e){var t,n=e[0],i=e[1];return l(r-(t=n).length)+t+(i?" | "+i:" |")})).join("\n")}function l(e){return Array(e+1).join(" ")}function f(e){return(f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function h(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function p(e,t){return!t||"object"!==f(t)&&"function"!=typeof t?d(e):t}function d(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function y(e){var t="function"==typeof Map?new Map:void 0;return(y=function(e){if(null===e||(r=e,-1===Function.toString.call(r).indexOf("[native code]")))return e;var r;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return v(e,arguments,b(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),m(n,e)})(e)}function v(e,t,r){return(v=g()?Reflect.construct:function(e,t,r){var n=[null];n.push.apply(n,t);var i=new(Function.bind.apply(e,n));return r&&m(i,r.prototype),i}).apply(null,arguments)}function g(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}function m(e,t){return(m=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function b(e){return(b=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var E=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&m(e,t)}(y,e);var t,r,n,c,l,f=(t=y,r=g(),function(){var e,n=b(t);if(r){var i=b(this).constructor;e=Reflect.construct(n,arguments,i)}else e=n.apply(this,arguments);return p(this,e)});function y(e,t,r,n,a,s,u){var c,l,h,v,g;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,y),g=f.call(this,e);var m,b=Array.isArray(t)?0!==t.length?t:void 0:t?[t]:void 0,E=r;!E&&b&&(E=null===(m=b[0].loc)||void 0===m?void 0:m.source);var S,C=n;!C&&b&&(C=b.reduce((function(e,t){return t.loc&&e.push(t.loc.start),e}),[])),C&&0===C.length&&(C=void 0),n&&r?S=n.map((function(e){return o(r,e)})):b&&(S=b.reduce((function(e,t){return t.loc&&e.push(o(t.loc.source,t.loc.start)),e}),[]));var w,T=u;if(null==T&&null!=s){var A=s.extensions;"object"==i(w=A)&&null!==w&&(T=A)}return Object.defineProperties(d(g),{name:{value:"GraphQLError"},message:{value:e,enumerable:!0,writable:!0},locations:{value:null!==(c=S)&&void 0!==c?c:void 0,enumerable:null!=S},path:{value:null!=a?a:void 0,enumerable:null!=a},nodes:{value:null!=b?b:void 0},source:{value:null!==(l=E)&&void 0!==l?l:void 0},positions:{value:null!==(h=C)&&void 0!==h?h:void 0},originalError:{value:s},extensions:{value:null!==(v=T)&&void 0!==v?v:void 0,enumerable:null!=T}}),null!=s&&s.stack?(Object.defineProperty(d(g),"stack",{value:s.stack,writable:!0,configurable:!0}),p(g)):(Error.captureStackTrace?Error.captureStackTrace(d(g),y):Object.defineProperty(d(g),"stack",{value:Error().stack,writable:!0,configurable:!0}),g)}return n=y,(c=[{key:"toString",value:function(){return function(e){var t=e.message;if(e.nodes)for(var r=0,n=e.nodes;r<n.length;r++){var i=n[r];i.loc&&(t+="\n\n"+s(i.loc))}else if(e.source&&e.locations)for(var a=0,o=e.locations;a<o.length;a++){var c=o[a];t+="\n\n"+u(e.source,c)}return t}(this)}},{key:a,get:function(){return"Object"}}])&&h(n.prototype,c),l&&h(n,l),y}(y(Error));function S(e,t,r){return new E("Syntax Error: ".concat(r),void 0,e,[t])}var C=Object.freeze({NAME:"Name",DOCUMENT:"Document",OPERATION_DEFINITION:"OperationDefinition",VARIABLE_DEFINITION:"VariableDefinition",SELECTION_SET:"SelectionSet",FIELD:"Field",ARGUMENT:"Argument",FRAGMENT_SPREAD:"FragmentSpread",INLINE_FRAGMENT:"InlineFragment",FRAGMENT_DEFINITION:"FragmentDefinition",VARIABLE:"Variable",INT:"IntValue",FLOAT:"FloatValue",STRING:"StringValue",BOOLEAN:"BooleanValue",NULL:"NullValue",ENUM:"EnumValue",LIST:"ListValue",OBJECT:"ObjectValue",OBJECT_FIELD:"ObjectField",DIRECTIVE:"Directive",NAMED_TYPE:"NamedType",LIST_TYPE:"ListType",NON_NULL_TYPE:"NonNullType",SCHEMA_DEFINITION:"SchemaDefinition",OPERATION_TYPE_DEFINITION:"OperationTypeDefinition",SCALAR_TYPE_DEFINITION:"ScalarTypeDefinition",OBJECT_TYPE_DEFINITION:"ObjectTypeDefinition",FIELD_DEFINITION:"FieldDefinition",INPUT_VALUE_DEFINITION:"InputValueDefinition",INTERFACE_TYPE_DEFINITION:"InterfaceTypeDefinition",UNION_TYPE_DEFINITION:"UnionTypeDefinition",ENUM_TYPE_DEFINITION:"EnumTypeDefinition",ENUM_VALUE_DEFINITION:"EnumValueDefinition",INPUT_OBJECT_TYPE_DEFINITION:"InputObjectTypeDefinition",DIRECTIVE_DEFINITION:"DirectiveDefinition",SCHEMA_EXTENSION:"SchemaExtension",SCALAR_TYPE_EXTENSION:"ScalarTypeExtension",OBJECT_TYPE_EXTENSION:"ObjectTypeExtension",INTERFACE_TYPE_EXTENSION:"InterfaceTypeExtension",UNION_TYPE_EXTENSION:"UnionTypeExtension",ENUM_TYPE_EXTENSION:"EnumTypeExtension",INPUT_OBJECT_TYPE_EXTENSION:"InputObjectTypeExtension"}),w=r(3059),T=Object.freeze({SOF:"<SOF>",EOF:"<EOF>",BANG:"!",DOLLAR:"$",AMP:"&",PAREN_L:"(",PAREN_R:")",SPREAD:"...",COLON:":",EQUALS:"=",AT:"@",BRACKET_L:"[",BRACKET_R:"]",BRACE_L:"{",PIPE:"|",BRACE_R:"}",NAME:"Name",INT:"Int",FLOAT:"Float",STRING:"String",BLOCK_STRING:"BlockString",COMMENT:"Comment"}),A=r(6589);function I(e,t){if(!Boolean(e))throw new Error(t)}const k=function(e,t){return e instanceof t};function _(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var B=function(){function e(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"GraphQL request",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{line:1,column:1};"string"==typeof e||I(0,"Body must be a string. Received: ".concat((0,A.Z)(e),".")),this.body=e,this.name=t,this.locationOffset=r,this.locationOffset.line>0||I(0,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||I(0,"column in locationOffset is 1-indexed and must be positive.")}var t,r,n;return t=e,(r=[{key:a,get:function(){return"Source"}}])&&_(t.prototype,r),n&&_(t,n),e}();var N=Object.freeze({QUERY:"QUERY",MUTATION:"MUTATION",SUBSCRIPTION:"SUBSCRIPTION",FIELD:"FIELD",FRAGMENT_DEFINITION:"FRAGMENT_DEFINITION",FRAGMENT_SPREAD:"FRAGMENT_SPREAD",INLINE_FRAGMENT:"INLINE_FRAGMENT",VARIABLE_DEFINITION:"VARIABLE_DEFINITION",SCHEMA:"SCHEMA",SCALAR:"SCALAR",OBJECT:"OBJECT",FIELD_DEFINITION:"FIELD_DEFINITION",ARGUMENT_DEFINITION:"ARGUMENT_DEFINITION",INTERFACE:"INTERFACE",UNION:"UNION",ENUM:"ENUM",ENUM_VALUE:"ENUM_VALUE",INPUT_OBJECT:"INPUT_OBJECT",INPUT_FIELD_DEFINITION:"INPUT_FIELD_DEFINITION"}),O=r(7420),R=function(){function e(e){var t=new w.WU(T.SOF,0,0,0,0,null);this.source=e,this.lastToken=t,this.token=t,this.line=1,this.lineStart=0}var t=e.prototype;return t.advance=function(){return this.lastToken=this.token,this.token=this.lookahead()},t.lookahead=function(){var e=this.token;if(e.kind!==T.EOF)do{var t;e=null!==(t=e.next)&&void 0!==t?t:e.next=P(this,e)}while(e.kind===T.COMMENT);return e},e}();function x(e){return isNaN(e)?T.EOF:e<127?JSON.stringify(String.fromCharCode(e)):'"\\u'.concat(("00"+e.toString(16).toUpperCase()).slice(-4),'"')}function P(e,t){for(var r=e.source,n=r.body,i=n.length,a=t.end;a<i;){var o=n.charCodeAt(a),s=e.line,u=1+a-e.lineStart;switch(o){case 65279:case 9:case 32:case 44:++a;continue;case 10:++a,++e.line,e.lineStart=a;continue;case 13:10===n.charCodeAt(a+1)?a+=2:++a,++e.line,e.lineStart=a;continue;case 33:return new w.WU(T.BANG,a,a+1,s,u,t);case 35:return D(r,a,s,u,t);case 36:return new w.WU(T.DOLLAR,a,a+1,s,u,t);case 38:return new w.WU(T.AMP,a,a+1,s,u,t);case 40:return new w.WU(T.PAREN_L,a,a+1,s,u,t);case 41:return new w.WU(T.PAREN_R,a,a+1,s,u,t);case 46:if(46===n.charCodeAt(a+1)&&46===n.charCodeAt(a+2))return new w.WU(T.SPREAD,a,a+3,s,u,t);break;case 58:return new w.WU(T.COLON,a,a+1,s,u,t);case 61:return new w.WU(T.EQUALS,a,a+1,s,u,t);case 64:return new w.WU(T.AT,a,a+1,s,u,t);case 91:return new w.WU(T.BRACKET_L,a,a+1,s,u,t);case 93:return new w.WU(T.BRACKET_R,a,a+1,s,u,t);case 123:return new w.WU(T.BRACE_L,a,a+1,s,u,t);case 124:return new w.WU(T.PIPE,a,a+1,s,u,t);case 125:return new w.WU(T.BRACE_R,a,a+1,s,u,t);case 34:return 34===n.charCodeAt(a+1)&&34===n.charCodeAt(a+2)?V(r,a,s,u,t,e):j(r,a,s,u,t);case 45:case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return L(r,a,o,s,u,t);case 65:case 66:case 67:case 68:case 69:case 70:case 71:case 72:case 73:case 74:case 75:case 76:case 77:case 78:case 79:case 80:case 81:case 82:case 83:case 84:case 85:case 86:case 87:case 88:case 89:case 90:case 95:case 97:case 98:case 99:case 100:case 101:case 102:case 103:case 104:case 105:case 106:case 107:case 108:case 109:case 110:case 111:case 112:case 113:case 114:case 115:case 116:case 117:case 118:case 119:case 120:case 121:case 122:return M(r,a,s,u,t)}throw S(r,a,F(o))}var c=e.line,l=1+a-e.lineStart;return new w.WU(T.EOF,i,i,c,l,t)}function F(e){return e<32&&9!==e&&10!==e&&13!==e?"Cannot contain the invalid character ".concat(x(e),"."):39===e?"Unexpected single quote character ('), did you mean to use a double quote (\")?":"Cannot parse the unexpected character ".concat(x(e),".")}function D(e,t,r,n,i){var a,o=e.body,s=t;do{a=o.charCodeAt(++s)}while(!isNaN(a)&&(a>31||9===a));return new w.WU(T.COMMENT,t,s,r,n,i,o.slice(t+1,s))}function L(e,t,r,n,i,a){var o=e.body,s=r,u=t,c=!1;if(45===s&&(s=o.charCodeAt(++u)),48===s){if((s=o.charCodeAt(++u))>=48&&s<=57)throw S(e,u,"Invalid number, unexpected digit after 0: ".concat(x(s),"."))}else u=U(e,u,s),s=o.charCodeAt(u);if(46===s&&(c=!0,s=o.charCodeAt(++u),u=U(e,u,s),s=o.charCodeAt(u)),69!==s&&101!==s||(c=!0,43!==(s=o.charCodeAt(++u))&&45!==s||(s=o.charCodeAt(++u)),u=U(e,u,s),s=o.charCodeAt(u)),46===s||function(e){return 95===e||e>=65&&e<=90||e>=97&&e<=122}(s))throw S(e,u,"Invalid number, expected digit but got: ".concat(x(s),"."));return new w.WU(c?T.FLOAT:T.INT,t,u,n,i,a,o.slice(t,u))}function U(e,t,r){var n=e.body,i=t,a=r;if(a>=48&&a<=57){do{a=n.charCodeAt(++i)}while(a>=48&&a<=57);return i}throw S(e,i,"Invalid number, expected digit but got: ".concat(x(a),"."))}function j(e,t,r,n,i){for(var a,o,s,u,c=e.body,l=t+1,f=l,h=0,p="";l<c.length&&!isNaN(h=c.charCodeAt(l))&&10!==h&&13!==h;){if(34===h)return p+=c.slice(f,l),new w.WU(T.STRING,t,l+1,r,n,i,p);if(h<32&&9!==h)throw S(e,l,"Invalid character within String: ".concat(x(h),"."));if(++l,92===h){switch(p+=c.slice(f,l-1),h=c.charCodeAt(l)){case 34:p+='"';break;case 47:p+="/";break;case 92:p+="\\";break;case 98:p+="\b";break;case 102:p+="\f";break;case 110:p+="\n";break;case 114:p+="\r";break;case 116:p+="\t";break;case 117:var d=(a=c.charCodeAt(l+1),o=c.charCodeAt(l+2),s=c.charCodeAt(l+3),u=c.charCodeAt(l+4),K(a)<<12|K(o)<<8|K(s)<<4|K(u));if(d<0){var y=c.slice(l+1,l+5);throw S(e,l,"Invalid character escape sequence: \\u".concat(y,"."))}p+=String.fromCharCode(d),l+=4;break;default:throw S(e,l,"Invalid character escape sequence: \\".concat(String.fromCharCode(h),"."))}f=++l}}throw S(e,l,"Unterminated string.")}function V(e,t,r,n,i,a){for(var o=e.body,s=t+3,u=s,c=0,l="";s<o.length&&!isNaN(c=o.charCodeAt(s));){if(34===c&&34===o.charCodeAt(s+1)&&34===o.charCodeAt(s+2))return l+=o.slice(u,s),new w.WU(T.BLOCK_STRING,t,s+3,r,n,i,(0,O.W7)(l));if(c<32&&9!==c&&10!==c&&13!==c)throw S(e,s,"Invalid character within String: ".concat(x(c),"."));10===c?(++s,++a.line,a.lineStart=s):13===c?(10===o.charCodeAt(s+1)?s+=2:++s,++a.line,a.lineStart=s):92===c&&34===o.charCodeAt(s+1)&&34===o.charCodeAt(s+2)&&34===o.charCodeAt(s+3)?(l+=o.slice(u,s)+'"""',u=s+=4):++s}throw S(e,s,"Unterminated string.")}function K(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}function M(e,t,r,n,i){for(var a=e.body,o=a.length,s=t+1,u=0;s!==o&&!isNaN(u=a.charCodeAt(s))&&(95===u||u>=48&&u<=57||u>=65&&u<=90||u>=97&&u<=122);)++s;return new w.WU(T.NAME,t,s,r,n,i,a.slice(t,s))}var q=function(){function e(e,t){var r=function(e){return k(e,B)}(e)?e:new B(e);this._lexer=new R(r),this._options=t}var t=e.prototype;return t.parseName=function(){var e=this.expectToken(T.NAME);return{kind:C.NAME,value:e.value,loc:this.loc(e)}},t.parseDocument=function(){var e=this._lexer.token;return{kind:C.DOCUMENT,definitions:this.many(T.SOF,this.parseDefinition,T.EOF),loc:this.loc(e)}},t.parseDefinition=function(){if(this.peek(T.NAME))switch(this._lexer.token.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"schema":case"scalar":case"type":case"interface":case"union":case"enum":case"input":case"directive":return this.parseTypeSystemDefinition();case"extend":return this.parseTypeSystemExtension()}else{if(this.peek(T.BRACE_L))return this.parseOperationDefinition();if(this.peekDescription())return this.parseTypeSystemDefinition()}throw this.unexpected()},t.parseOperationDefinition=function(){var e=this._lexer.token;if(this.peek(T.BRACE_L))return{kind:C.OPERATION_DEFINITION,operation:"query",name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet(),loc:this.loc(e)};var t,r=this.parseOperationType();return this.peek(T.NAME)&&(t=this.parseName()),{kind:C.OPERATION_DEFINITION,operation:r,name:t,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(e)}},t.parseOperationType=function(){var e=this.expectToken(T.NAME);switch(e.value){case"query":return"query";case"mutation":return"mutation";case"subscription":return"subscription"}throw this.unexpected(e)},t.parseVariableDefinitions=function(){return this.optionalMany(T.PAREN_L,this.parseVariableDefinition,T.PAREN_R)},t.parseVariableDefinition=function(){var e=this._lexer.token;return{kind:C.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(T.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(T.EQUALS)?this.parseValueLiteral(!0):void 0,directives:this.parseDirectives(!0),loc:this.loc(e)}},t.parseVariable=function(){var e=this._lexer.token;return this.expectToken(T.DOLLAR),{kind:C.VARIABLE,name:this.parseName(),loc:this.loc(e)}},t.parseSelectionSet=function(){var e=this._lexer.token;return{kind:C.SELECTION_SET,selections:this.many(T.BRACE_L,this.parseSelection,T.BRACE_R),loc:this.loc(e)}},t.parseSelection=function(){return this.peek(T.SPREAD)?this.parseFragment():this.parseField()},t.parseField=function(){var e,t,r=this._lexer.token,n=this.parseName();return this.expectOptionalToken(T.COLON)?(e=n,t=this.parseName()):t=n,{kind:C.FIELD,alias:e,name:t,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(T.BRACE_L)?this.parseSelectionSet():void 0,loc:this.loc(r)}},t.parseArguments=function(e){var t=e?this.parseConstArgument:this.parseArgument;return this.optionalMany(T.PAREN_L,t,T.PAREN_R)},t.parseArgument=function(){var e=this._lexer.token,t=this.parseName();return this.expectToken(T.COLON),{kind:C.ARGUMENT,name:t,value:this.parseValueLiteral(!1),loc:this.loc(e)}},t.parseConstArgument=function(){var e=this._lexer.token;return{kind:C.ARGUMENT,name:this.parseName(),value:(this.expectToken(T.COLON),this.parseValueLiteral(!0)),loc:this.loc(e)}},t.parseFragment=function(){var e=this._lexer.token;this.expectToken(T.SPREAD);var t=this.expectOptionalKeyword("on");return!t&&this.peek(T.NAME)?{kind:C.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1),loc:this.loc(e)}:{kind:C.INLINE_FRAGMENT,typeCondition:t?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(e)}},t.parseFragmentDefinition=function(){var e,t=this._lexer.token;return this.expectKeyword("fragment"),!0===(null===(e=this._options)||void 0===e?void 0:e.experimentalFragmentVariables)?{kind:C.FRAGMENT_DEFINITION,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(t)}:{kind:C.FRAGMENT_DEFINITION,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(t)}},t.parseFragmentName=function(){if("on"===this._lexer.token.value)throw this.unexpected();return this.parseName()},t.parseValueLiteral=function(e){var t=this._lexer.token;switch(t.kind){case T.BRACKET_L:return this.parseList(e);case T.BRACE_L:return this.parseObject(e);case T.INT:return this._lexer.advance(),{kind:C.INT,value:t.value,loc:this.loc(t)};case T.FLOAT:return this._lexer.advance(),{kind:C.FLOAT,value:t.value,loc:this.loc(t)};case T.STRING:case T.BLOCK_STRING:return this.parseStringLiteral();case T.NAME:switch(this._lexer.advance(),t.value){case"true":return{kind:C.BOOLEAN,value:!0,loc:this.loc(t)};case"false":return{kind:C.BOOLEAN,value:!1,loc:this.loc(t)};case"null":return{kind:C.NULL,loc:this.loc(t)};default:return{kind:C.ENUM,value:t.value,loc:this.loc(t)}}case T.DOLLAR:if(!e)return this.parseVariable()}throw this.unexpected()},t.parseStringLiteral=function(){var e=this._lexer.token;return this._lexer.advance(),{kind:C.STRING,value:e.value,block:e.kind===T.BLOCK_STRING,loc:this.loc(e)}},t.parseList=function(e){var t=this,r=this._lexer.token;return{kind:C.LIST,values:this.any(T.BRACKET_L,(function(){return t.parseValueLiteral(e)}),T.BRACKET_R),loc:this.loc(r)}},t.parseObject=function(e){var t=this,r=this._lexer.token;return{kind:C.OBJECT,fields:this.any(T.BRACE_L,(function(){return t.parseObjectField(e)}),T.BRACE_R),loc:this.loc(r)}},t.parseObjectField=function(e){var t=this._lexer.token,r=this.parseName();return this.expectToken(T.COLON),{kind:C.OBJECT_FIELD,name:r,value:this.parseValueLiteral(e),loc:this.loc(t)}},t.parseDirectives=function(e){for(var t=[];this.peek(T.AT);)t.push(this.parseDirective(e));return t},t.parseDirective=function(e){var t=this._lexer.token;return this.expectToken(T.AT),{kind:C.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(e),loc:this.loc(t)}},t.parseTypeReference=function(){var e,t=this._lexer.token;return this.expectOptionalToken(T.BRACKET_L)?(e=this.parseTypeReference(),this.expectToken(T.BRACKET_R),e={kind:C.LIST_TYPE,type:e,loc:this.loc(t)}):e=this.parseNamedType(),this.expectOptionalToken(T.BANG)?{kind:C.NON_NULL_TYPE,type:e,loc:this.loc(t)}:e},t.parseNamedType=function(){var e=this._lexer.token;return{kind:C.NAMED_TYPE,name:this.parseName(),loc:this.loc(e)}},t.parseTypeSystemDefinition=function(){var e=this.peekDescription()?this._lexer.lookahead():this._lexer.token;if(e.kind===T.NAME)switch(e.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}throw this.unexpected(e)},t.peekDescription=function(){return this.peek(T.STRING)||this.peek(T.BLOCK_STRING)},t.parseDescription=function(){if(this.peekDescription())return this.parseStringLiteral()},t.parseSchemaDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("schema");var r=this.parseDirectives(!0),n=this.many(T.BRACE_L,this.parseOperationTypeDefinition,T.BRACE_R);return{kind:C.SCHEMA_DEFINITION,description:t,directives:r,operationTypes:n,loc:this.loc(e)}},t.parseOperationTypeDefinition=function(){var e=this._lexer.token,t=this.parseOperationType();this.expectToken(T.COLON);var r=this.parseNamedType();return{kind:C.OPERATION_TYPE_DEFINITION,operation:t,type:r,loc:this.loc(e)}},t.parseScalarTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("scalar");var r=this.parseName(),n=this.parseDirectives(!0);return{kind:C.SCALAR_TYPE_DEFINITION,description:t,name:r,directives:n,loc:this.loc(e)}},t.parseObjectTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("type");var r=this.parseName(),n=this.parseImplementsInterfaces(),i=this.parseDirectives(!0),a=this.parseFieldsDefinition();return{kind:C.OBJECT_TYPE_DEFINITION,description:t,name:r,interfaces:n,directives:i,fields:a,loc:this.loc(e)}},t.parseImplementsInterfaces=function(){var e;if(!this.expectOptionalKeyword("implements"))return[];if(!0===(null===(e=this._options)||void 0===e?void 0:e.allowLegacySDLImplementsInterfaces)){var t=[];this.expectOptionalToken(T.AMP);do{t.push(this.parseNamedType())}while(this.expectOptionalToken(T.AMP)||this.peek(T.NAME));return t}return this.delimitedMany(T.AMP,this.parseNamedType)},t.parseFieldsDefinition=function(){var e;return!0===(null===(e=this._options)||void 0===e?void 0:e.allowLegacySDLEmptyFields)&&this.peek(T.BRACE_L)&&this._lexer.lookahead().kind===T.BRACE_R?(this._lexer.advance(),this._lexer.advance(),[]):this.optionalMany(T.BRACE_L,this.parseFieldDefinition,T.BRACE_R)},t.parseFieldDefinition=function(){var e=this._lexer.token,t=this.parseDescription(),r=this.parseName(),n=this.parseArgumentDefs();this.expectToken(T.COLON);var i=this.parseTypeReference(),a=this.parseDirectives(!0);return{kind:C.FIELD_DEFINITION,description:t,name:r,arguments:n,type:i,directives:a,loc:this.loc(e)}},t.parseArgumentDefs=function(){return this.optionalMany(T.PAREN_L,this.parseInputValueDef,T.PAREN_R)},t.parseInputValueDef=function(){var e=this._lexer.token,t=this.parseDescription(),r=this.parseName();this.expectToken(T.COLON);var n,i=this.parseTypeReference();this.expectOptionalToken(T.EQUALS)&&(n=this.parseValueLiteral(!0));var a=this.parseDirectives(!0);return{kind:C.INPUT_VALUE_DEFINITION,description:t,name:r,type:i,defaultValue:n,directives:a,loc:this.loc(e)}},t.parseInterfaceTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("interface");var r=this.parseName(),n=this.parseImplementsInterfaces(),i=this.parseDirectives(!0),a=this.parseFieldsDefinition();return{kind:C.INTERFACE_TYPE_DEFINITION,description:t,name:r,interfaces:n,directives:i,fields:a,loc:this.loc(e)}},t.parseUnionTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("union");var r=this.parseName(),n=this.parseDirectives(!0),i=this.parseUnionMemberTypes();return{kind:C.UNION_TYPE_DEFINITION,description:t,name:r,directives:n,types:i,loc:this.loc(e)}},t.parseUnionMemberTypes=function(){return this.expectOptionalToken(T.EQUALS)?this.delimitedMany(T.PIPE,this.parseNamedType):[]},t.parseEnumTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("enum");var r=this.parseName(),n=this.parseDirectives(!0),i=this.parseEnumValuesDefinition();return{kind:C.ENUM_TYPE_DEFINITION,description:t,name:r,directives:n,values:i,loc:this.loc(e)}},t.parseEnumValuesDefinition=function(){return this.optionalMany(T.BRACE_L,this.parseEnumValueDefinition,T.BRACE_R)},t.parseEnumValueDefinition=function(){var e=this._lexer.token,t=this.parseDescription(),r=this.parseName(),n=this.parseDirectives(!0);return{kind:C.ENUM_VALUE_DEFINITION,description:t,name:r,directives:n,loc:this.loc(e)}},t.parseInputObjectTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("input");var r=this.parseName(),n=this.parseDirectives(!0),i=this.parseInputFieldsDefinition();return{kind:C.INPUT_OBJECT_TYPE_DEFINITION,description:t,name:r,directives:n,fields:i,loc:this.loc(e)}},t.parseInputFieldsDefinition=function(){return this.optionalMany(T.BRACE_L,this.parseInputValueDef,T.BRACE_R)},t.parseTypeSystemExtension=function(){var e=this._lexer.lookahead();if(e.kind===T.NAME)switch(e.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension()}throw this.unexpected(e)},t.parseSchemaExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");var t=this.parseDirectives(!0),r=this.optionalMany(T.BRACE_L,this.parseOperationTypeDefinition,T.BRACE_R);if(0===t.length&&0===r.length)throw this.unexpected();return{kind:C.SCHEMA_EXTENSION,directives:t,operationTypes:r,loc:this.loc(e)}},t.parseScalarTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");var t=this.parseName(),r=this.parseDirectives(!0);if(0===r.length)throw this.unexpected();return{kind:C.SCALAR_TYPE_EXTENSION,name:t,directives:r,loc:this.loc(e)}},t.parseObjectTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");var t=this.parseName(),r=this.parseImplementsInterfaces(),n=this.parseDirectives(!0),i=this.parseFieldsDefinition();if(0===r.length&&0===n.length&&0===i.length)throw this.unexpected();return{kind:C.OBJECT_TYPE_EXTENSION,name:t,interfaces:r,directives:n,fields:i,loc:this.loc(e)}},t.parseInterfaceTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");var t=this.parseName(),r=this.parseImplementsInterfaces(),n=this.parseDirectives(!0),i=this.parseFieldsDefinition();if(0===r.length&&0===n.length&&0===i.length)throw this.unexpected();return{kind:C.INTERFACE_TYPE_EXTENSION,name:t,interfaces:r,directives:n,fields:i,loc:this.loc(e)}},t.parseUnionTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");var t=this.parseName(),r=this.parseDirectives(!0),n=this.parseUnionMemberTypes();if(0===r.length&&0===n.length)throw this.unexpected();return{kind:C.UNION_TYPE_EXTENSION,name:t,directives:r,types:n,loc:this.loc(e)}},t.parseEnumTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");var t=this.parseName(),r=this.parseDirectives(!0),n=this.parseEnumValuesDefinition();if(0===r.length&&0===n.length)throw this.unexpected();return{kind:C.ENUM_TYPE_EXTENSION,name:t,directives:r,values:n,loc:this.loc(e)}},t.parseInputObjectTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");var t=this.parseName(),r=this.parseDirectives(!0),n=this.parseInputFieldsDefinition();if(0===r.length&&0===n.length)throw this.unexpected();return{kind:C.INPUT_OBJECT_TYPE_EXTENSION,name:t,directives:r,fields:n,loc:this.loc(e)}},t.parseDirectiveDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("directive"),this.expectToken(T.AT);var r=this.parseName(),n=this.parseArgumentDefs(),i=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");var a=this.parseDirectiveLocations();return{kind:C.DIRECTIVE_DEFINITION,description:t,name:r,arguments:n,repeatable:i,locations:a,loc:this.loc(e)}},t.parseDirectiveLocations=function(){return this.delimitedMany(T.PIPE,this.parseDirectiveLocation)},t.parseDirectiveLocation=function(){var e=this._lexer.token,t=this.parseName();if(void 0!==N[t.value])return t;throw this.unexpected(e)},t.loc=function(e){var t;if(!0!==(null===(t=this._options)||void 0===t?void 0:t.noLocation))return new w.Ye(e,this._lexer.lastToken,this._lexer.source)},t.peek=function(e){return this._lexer.token.kind===e},t.expectToken=function(e){var t=this._lexer.token;if(t.kind===e)return this._lexer.advance(),t;throw S(this._lexer.source,t.start,"Expected ".concat(H(e),", found ").concat(z(t),"."))},t.expectOptionalToken=function(e){var t=this._lexer.token;if(t.kind===e)return this._lexer.advance(),t},t.expectKeyword=function(e){var t=this._lexer.token;if(t.kind!==T.NAME||t.value!==e)throw S(this._lexer.source,t.start,'Expected "'.concat(e,'", found ').concat(z(t),"."));this._lexer.advance()},t.expectOptionalKeyword=function(e){var t=this._lexer.token;return t.kind===T.NAME&&t.value===e&&(this._lexer.advance(),!0)},t.unexpected=function(e){var t=null!=e?e:this._lexer.token;return S(this._lexer.source,t.start,"Unexpected ".concat(z(t),"."))},t.any=function(e,t,r){this.expectToken(e);for(var n=[];!this.expectOptionalToken(r);)n.push(t.call(this));return n},t.optionalMany=function(e,t,r){if(this.expectOptionalToken(e)){var n=[];do{n.push(t.call(this))}while(!this.expectOptionalToken(r));return n}return[]},t.many=function(e,t,r){this.expectToken(e);var n=[];do{n.push(t.call(this))}while(!this.expectOptionalToken(r));return n},t.delimitedMany=function(e,t){this.expectOptionalToken(e);var r=[];do{r.push(t.call(this))}while(this.expectOptionalToken(e));return r},e}();function z(e){var t=e.value;return H(e.kind)+(null!=t?' "'.concat(t,'"'):"")}function H(e){return function(e){return e===T.BANG||e===T.DOLLAR||e===T.AMP||e===T.PAREN_L||e===T.PAREN_R||e===T.SPREAD||e===T.COLON||e===T.EQUALS||e===T.AT||e===T.BRACKET_L||e===T.BRACKET_R||e===T.BRACE_L||e===T.PIPE||e===T.BRACE_R}(e)?'"'.concat(e,'"'):e}var G=new Map,Q=new Map,W=!0,Y=!1;function Z(e){return e.replace(/[\s,]+/g," ").trim()}function J(e){var t=new Set,r=[];return e.definitions.forEach((function(e){if("FragmentDefinition"===e.kind){var n=e.name.value,i=Z((o=e.loc).source.body.substring(o.start,o.end)),a=Q.get(n);a&&!a.has(i)?W&&console.warn("Warning: fragment with name "+n+" already exists.\ngraphql-tag enforces all fragment names across your application to be unique; read more about\nthis in the docs: http://dev.apollodata.com/core/fragments.html#unique-names"):a||Q.set(n,a=new Set),a.add(i),t.has(i)||(t.add(i),r.push(e))}else r.push(e);var o})),(0,n.pi)((0,n.pi)({},e),{definitions:r})}function X(e){var t=Z(e);if(!G.has(t)){var r=function(e,t){return new q(e,t).parseDocument()}(e,{experimentalFragmentVariables:Y});if(!r||"Document"!==r.kind)throw new Error("Not a valid GraphQL document.");G.set(t,function(e){var t=new Set(e.definitions);t.forEach((function(e){e.loc&&delete e.loc,Object.keys(e).forEach((function(r){var n=e[r];n&&"object"==typeof n&&t.add(n)}))}));var r=e.loc;return r&&(delete r.startToken,delete r.endToken),e}(J(r)))}return G.get(t)}function $(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];"string"==typeof e&&(e=[e]);var n=e[0];return t.forEach((function(t,r){t&&"Document"===t.kind?n+=t.loc.source.body:n+=t,n+=e[r+1]})),X(n)}const ee=Object.assign($,{gql:$,default:$,resetCaches:function(){G.clear(),Q.clear()},disableFragmentWarnings:function(){W=!1},enableExperimentalFragmentVariables:function(){Y=!0},disableExperimentalFragmentVariables:function(){Y=!1}})},4206:e=>{var t={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GetElectionLogEntries"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"electionUniqueId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"after"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"types"}},type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"election"},arguments:[{kind:"Argument",name:{kind:"Name",value:"uniqueId"},value:{kind:"Variable",name:{kind:"Name",value:"electionUniqueId"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"logEntries"},arguments:[{kind:"Argument",name:{kind:"Name",value:"after"},value:{kind:"Variable",name:{kind:"Name",value:"after"}}},{kind:"Argument",name:{kind:"Name",value:"types"},value:{kind:"Variable",name:{kind:"Name",value:"types"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"messageId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"signedData"},arguments:[],directives:[]}]}}]}}]}}],loc:{start:0,end:242}};t.loc.source={body:"query GetElectionLogEntries(\n $electionUniqueId: String!\n $after: String\n $types: [String!]\n) {\n election(uniqueId: $electionUniqueId) {\n logEntries(after: $after, types: $types) {\n id\n messageId\n signedData\n }\n }\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};function r(e,t){if("FragmentSpread"===e.kind)t.add(e.name.value);else if("VariableDefinition"===e.kind){var n=e.type;"NamedType"===n.kind&&t.add(n.name.value)}e.selectionSet&&e.selectionSet.selections.forEach((function(e){r(e,t)})),e.variableDefinitions&&e.variableDefinitions.forEach((function(e){r(e,t)})),e.definitions&&e.definitions.forEach((function(e){r(e,t)}))}var n={};function i(e,t){for(var r=0;r<e.definitions.length;r++){var n=e.definitions[r];if(n.name&&n.name.value==t)return n}}t.definitions.forEach((function(e){if(e.name){var t=new Set;r(e,t),n[e.name.value]=t}})),e.exports=t,e.exports.GetElectionLogEntries=function(e,t){var r={kind:e.kind,definitions:[i(e,t)]};e.hasOwnProperty("loc")&&(r.loc=e.loc);var a=n[t]||new Set,o=new Set,s=new Set;for(a.forEach((function(e){s.add(e)}));s.size>0;){var u=s;s=new Set,u.forEach((function(e){o.has(e)||(o.add(e),(n[e]||new Set).forEach((function(e){s.add(e)})))}))}return o.forEach((function(t){var n=i(e,t);n&&r.definitions.push(n)})),r}(t,"GetElectionLogEntries")},5073:e=>{var t={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GetLogEntry"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"electionUniqueId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"contentHash"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"logEntry"},arguments:[{kind:"Argument",name:{kind:"Name",value:"electionUniqueId"},value:{kind:"Variable",name:{kind:"Name",value:"electionUniqueId"}}},{kind:"Argument",name:{kind:"Name",value:"contentHash"},value:{kind:"Variable",name:{kind:"Name",value:"contentHash"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"messageId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"signedData"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"contentHash"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:199}};t.loc.source={body:"query GetLogEntry($electionUniqueId: String!, $contentHash: String!) {\n logEntry(electionUniqueId: $electionUniqueId, contentHash: $contentHash) {\n messageId\n signedData\n contentHash\n }\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};function r(e,t){if("FragmentSpread"===e.kind)t.add(e.name.value);else if("VariableDefinition"===e.kind){var n=e.type;"NamedType"===n.kind&&t.add(n.name.value)}e.selectionSet&&e.selectionSet.selections.forEach((function(e){r(e,t)})),e.variableDefinitions&&e.variableDefinitions.forEach((function(e){r(e,t)})),e.definitions&&e.definitions.forEach((function(e){r(e,t)}))}var n={};function i(e,t){for(var r=0;r<e.definitions.length;r++){var n=e.definitions[r];if(n.name&&n.name.value==t)return n}}t.definitions.forEach((function(e){if(e.name){var t=new Set;r(e,t),n[e.name.value]=t}})),e.exports=t,e.exports.GetLogEntry=function(e,t){var r={kind:e.kind,definitions:[i(e,t)]};e.hasOwnProperty("loc")&&(r.loc=e.loc);var a=n[t]||new Set,o=new Set,s=new Set;for(a.forEach((function(e){s.add(e)}));s.size>0;){var u=s;s=new Set,u.forEach((function(e){o.has(e)||(o.add(e),(n[e]||new Set).forEach((function(e){s.add(e)})))}))}return o.forEach((function(t){var n=i(e,t);n&&r.definitions.push(n)})),r}(t,"GetLogEntry")},5053:e=>{var t={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GetPendingMessageByMessageId"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"messageId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"pendingMessage"},arguments:[{kind:"Argument",name:{kind:"Name",value:"messageId"},value:{kind:"Variable",name:{kind:"Name",value:"messageId"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"status"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:117}};t.loc.source={body:"query GetPendingMessageByMessageId($messageId: String!) {\n pendingMessage(messageId: $messageId) {\n status\n }\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};function r(e,t){if("FragmentSpread"===e.kind)t.add(e.name.value);else if("VariableDefinition"===e.kind){var n=e.type;"NamedType"===n.kind&&t.add(n.name.value)}e.selectionSet&&e.selectionSet.selections.forEach((function(e){r(e,t)})),e.variableDefinitions&&e.variableDefinitions.forEach((function(e){r(e,t)})),e.definitions&&e.definitions.forEach((function(e){r(e,t)}))}var n={};function i(e,t){for(var r=0;r<e.definitions.length;r++){var n=e.definitions[r];if(n.name&&n.name.value==t)return n}}t.definitions.forEach((function(e){if(e.name){var t=new Set;r(e,t),n[e.name.value]=t}})),e.exports=t,e.exports.GetPendingMessageByMessageId=function(e,t){var r={kind:e.kind,definitions:[i(e,t)]};e.hasOwnProperty("loc")&&(r.loc=e.loc);var a=n[t]||new Set,o=new Set,s=new Set;for(a.forEach((function(e){s.add(e)}));s.size>0;){var u=s;s=new Set,u.forEach((function(e){o.has(e)||(o.add(e),(n[e]||new Set).forEach((function(e){s.add(e)})))}))}return o.forEach((function(t){var n=i(e,t);n&&r.definitions.push(n)})),r}(t,"GetPendingMessageByMessageId")},9120:e=>{var t={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"ProcessKeyCeremonyStep"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"messageId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"signedData"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"processKeyCeremonyStep"},arguments:[{kind:"Argument",name:{kind:"Name",value:"messageId"},value:{kind:"Variable",name:{kind:"Name",value:"messageId"}}},{kind:"Argument",name:{kind:"Name",value:"signedData"},value:{kind:"Variable",name:{kind:"Name",value:"signedData"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"pendingMessage"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"signedData"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"error"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:212}};t.loc.source={body:"mutation ProcessKeyCeremonyStep($messageId: String!, $signedData: String!) {\n processKeyCeremonyStep(messageId: $messageId, signedData: $signedData) {\n pendingMessage {\n signedData\n }\n error\n }\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};function r(e,t){if("FragmentSpread"===e.kind)t.add(e.name.value);else if("VariableDefinition"===e.kind){var n=e.type;"NamedType"===n.kind&&t.add(n.name.value)}e.selectionSet&&e.selectionSet.selections.forEach((function(e){r(e,t)})),e.variableDefinitions&&e.variableDefinitions.forEach((function(e){r(e,t)})),e.definitions&&e.definitions.forEach((function(e){r(e,t)}))}var n={};function i(e,t){for(var r=0;r<e.definitions.length;r++){var n=e.definitions[r];if(n.name&&n.name.value==t)return n}}t.definitions.forEach((function(e){if(e.name){var t=new Set;r(e,t),n[e.name.value]=t}})),e.exports=t,e.exports.ProcessKeyCeremonyStep=function(e,t){var r={kind:e.kind,definitions:[i(e,t)]};e.hasOwnProperty("loc")&&(r.loc=e.loc);var a=n[t]||new Set,o=new Set,s=new Set;for(a.forEach((function(e){s.add(e)}));s.size>0;){var u=s;s=new Set,u.forEach((function(e){o.has(e)||(o.add(e),(n[e]||new Set).forEach((function(e){s.add(e)})))}))}return o.forEach((function(t){var n=i(e,t);n&&r.definitions.push(n)})),r}(t,"ProcessKeyCeremonyStep")},1798:e=>{var t={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"ProcessTallyStep"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"messageId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"signedData"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"processTallyStep"},arguments:[{kind:"Argument",name:{kind:"Name",value:"messageId"},value:{kind:"Variable",name:{kind:"Name",value:"messageId"}}},{kind:"Argument",name:{kind:"Name",value:"signedData"},value:{kind:"Variable",name:{kind:"Name",value:"signedData"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"pendingMessage"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"signedData"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"error"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:200}};t.loc.source={body:"mutation ProcessTallyStep($messageId: String!, $signedData: String!) {\n processTallyStep(messageId: $messageId, signedData: $signedData) {\n pendingMessage {\n signedData\n }\n error\n }\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};function r(e,t){if("FragmentSpread"===e.kind)t.add(e.name.value);else if("VariableDefinition"===e.kind){var n=e.type;"NamedType"===n.kind&&t.add(n.name.value)}e.selectionSet&&e.selectionSet.selections.forEach((function(e){r(e,t)})),e.variableDefinitions&&e.variableDefinitions.forEach((function(e){r(e,t)})),e.definitions&&e.definitions.forEach((function(e){r(e,t)}))}var n={};function i(e,t){for(var r=0;r<e.definitions.length;r++){var n=e.definitions[r];if(n.name&&n.name.value==t)return n}}t.definitions.forEach((function(e){if(e.name){var t=new Set;r(e,t),n[e.name.value]=t}})),e.exports=t,e.exports.ProcessTallyStep=function(e,t){var r={kind:e.kind,definitions:[i(e,t)]};e.hasOwnProperty("loc")&&(r.loc=e.loc);var a=n[t]||new Set,o=new Set,s=new Set;for(a.forEach((function(e){s.add(e)}));s.size>0;){var u=s;s=new Set,u.forEach((function(e){o.has(e)||(o.add(e),(n[e]||new Set).forEach((function(e){s.add(e)})))}))}return o.forEach((function(t){var n=i(e,t);n&&r.definitions.push(n)})),r}(t,"ProcessTallyStep")},972:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=e.prototype.toJSON;"function"==typeof t||(0,n.default)(0),e.prototype.inspect=t,i.default&&(e.prototype[i.default]=t)};var n=a(r(7706)),i=a(r(8554));function a(e){return e&&e.__esModule?e:{default:e}}},8002:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return o(e,[])};var n,i=(n=r(8554))&&n.__esModule?n:{default:n};function a(e){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e,t){switch(a(e)){case"string":return JSON.stringify(e);case"function":return e.name?"[function ".concat(e.name,"]"):"[function]";case"object":return null===e?"null":function(e,t){if(-1!==t.indexOf(e))return"[Circular]";var r=[].concat(t,[e]),n=function(e){var t=e[String(i.default)];if("function"==typeof t)return t;if("function"==typeof e.inspect)return e.inspect}(e);if(void 0!==n){var a=n.call(e);if(a!==e)return"string"==typeof a?a:o(a,r)}else if(Array.isArray(e))return function(e,t){if(0===e.length)return"[]";if(t.length>2)return"[Array]";for(var r=Math.min(10,e.length),n=e.length-r,i=[],a=0;a<r;++a)i.push(o(e[a],t));1===n?i.push("... 1 more item"):n>1&&i.push("... ".concat(n," more items"));return"["+i.join(", ")+"]"}(e,r);return function(e,t){var r=Object.keys(e);if(0===r.length)return"{}";if(t.length>2)return"["+function(e){var t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if("Object"===t&&"function"==typeof e.constructor){var r=e.constructor.name;if("string"==typeof r&&""!==r)return r}return t}(e)+"]";return"{ "+r.map((function(r){return r+": "+o(e[r],t)})).join(", ")+" }"}(e,r)}(e,t);default:return String(e)}}},6589:(e,t,r)=>{"use strict";r.d(t,{Z:()=>a});var n=r(7986);function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e){return o(e,[])}function o(e,t){switch(i(e)){case"string":return JSON.stringify(e);case"function":return e.name?"[function ".concat(e.name,"]"):"[function]";case"object":return null===e?"null":function(e,t){if(-1!==t.indexOf(e))return"[Circular]";var r=[].concat(t,[e]),i=function(e){var t=e[String(n.Z)];if("function"==typeof t)return t;if("function"==typeof e.inspect)return e.inspect}(e);if(void 0!==i){var a=i.call(e);if(a!==e)return"string"==typeof a?a:o(a,r)}else if(Array.isArray(e))return function(e,t){if(0===e.length)return"[]";if(t.length>2)return"[Array]";for(var r=Math.min(10,e.length),n=e.length-r,i=[],a=0;a<r;++a)i.push(o(e[a],t));1===n?i.push("... 1 more item"):n>1&&i.push("... ".concat(n," more items"));return"["+i.join(", ")+"]"}(e,r);return function(e,t){var r=Object.keys(e);if(0===r.length)return"{}";if(t.length>2)return"["+function(e){var t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if("Object"===t&&"function"==typeof e.constructor){var r=e.constructor.name;if("string"==typeof r&&""!==r)return r}return t}(e)+"]";return"{ "+r.map((function(r){return r+": "+o(e[r],t)})).join(", ")+" }"}(e,r)}(e,t);default:return String(e)}}},7706:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if(!Boolean(e))throw new Error(null!=t?t:"Unexpected invariant triggered.")}},8554:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):void 0;t.default=r},7986:(e,t,r)=>{"use strict";r.d(t,{Z:()=>n});const n="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):void 0},1807:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isNode=function(e){return null!=e&&"string"==typeof e.kind},t.Token=t.Location=void 0;var n,i=(n=r(972))&&n.__esModule?n:{default:n};var a=function(){function e(e,t,r){this.start=e.start,this.end=t.end,this.startToken=e,this.endToken=t,this.source=r}return e.prototype.toJSON=function(){return{start:this.start,end:this.end}},e}();t.Location=a,(0,i.default)(a);var o=function(){function e(e,t,r,n,i,a,o){this.kind=e,this.start=t,this.end=r,this.line=n,this.column=i,this.value=o,this.prev=a,this.next=null}return e.prototype.toJSON=function(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}},e}();t.Token=o,(0,i.default)(o)},3059:(e,t,r)=>{"use strict";r.d(t,{Ye:()=>a,WU:()=>o,UG:()=>s});var n=r(7986);function i(e){var t=e.prototype.toJSON;"function"==typeof t||function(e,t){if(!Boolean(e))throw new Error(null!=t?t:"Unexpected invariant triggered.")}(0),e.prototype.inspect=t,n.Z&&(e.prototype[n.Z]=t)}var a=function(){function e(e,t,r){this.start=e.start,this.end=t.end,this.startToken=e,this.endToken=t,this.source=r}return e.prototype.toJSON=function(){return{start:this.start,end:this.end}},e}();i(a);var o=function(){function e(e,t,r,n,i,a,o){this.kind=e,this.start=t,this.end=r,this.line=n,this.column=i,this.value=o,this.prev=a,this.next=null}return e.prototype.toJSON=function(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}},e}();function s(e){return null!=e&&"string"==typeof e.kind}i(o)},7420:(e,t,r)=>{"use strict";function n(e){var t=e.split(/\r\n|[\n\r]/g),r=function(e){for(var t,r=!0,n=!0,i=0,a=null,o=0;o<e.length;++o)switch(e.charCodeAt(o)){case 13:10===e.charCodeAt(o+1)&&++o;case 10:r=!1,n=!0,i=0;break;case 9:case 32:++i;break;default:n&&!r&&(null===a||i<a)&&(a=i),n=!1}return null!==(t=a)&&void 0!==t?t:0}(e);if(0!==r)for(var n=1;n<t.length;n++)t[n]=t[n].slice(r);for(var a=0;a<t.length&&i(t[a]);)++a;for(var o=t.length;o>a&&i(t[o-1]);)--o;return t.slice(a,o).join("\n")}function i(e){for(var t=0;t<e.length;++t)if(" "!==e[t]&&"\t"!==e[t])return!1;return!0}function a(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=-1===e.indexOf("\n"),i=" "===e[0]||"\t"===e[0],a='"'===e[e.length-1],o="\\"===e[e.length-1],s=!n||a||o||r,u="";return!s||n&&i||(u+="\n"+t),u+=t?e.replace(/\n/g,"\n"+t):e,s&&(u+="\n"),'"""'+u.replace(/"""/g,'\\"""')+'"""'}r.d(t,{W7:()=>n,LZ:()=>a})},285:(e,t,r)=>{"use strict";t.Vn=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:o,n=void 0,c=Array.isArray(e),l=[e],f=-1,h=[],p=void 0,d=void 0,y=void 0,v=[],g=[],m=e;do{var b=++f===l.length,E=b&&0!==h.length;if(b){if(d=0===g.length?void 0:v[v.length-1],p=y,y=g.pop(),E){if(c)p=p.slice();else{for(var S={},C=0,w=Object.keys(p);C<w.length;C++){var T=w[C];S[T]=p[T]}p=S}for(var A=0,I=0;I<h.length;I++){var k=h[I][0],_=h[I][1];c&&(k-=A),c&&null===_?(p.splice(k,1),A++):p[k]=_}}f=n.index,l=n.keys,h=n.edits,c=n.inArray,n=n.prev}else{if(d=y?c?f:l[f]:void 0,null==(p=y?y[d]:m))continue;y&&v.push(d)}var B,N=void 0;if(!Array.isArray(p)){if(!(0,a.isNode)(p))throw new Error("Invalid AST Node: ".concat((0,i.default)(p),"."));var O=u(t,p.kind,b);if(O){if((N=O.call(t,p,d,y,v,g))===s)break;if(!1===N){if(!b){v.pop();continue}}else if(void 0!==N&&(h.push([d,N]),!b)){if(!(0,a.isNode)(N)){v.pop();continue}p=N}}}if(void 0===N&&E&&h.push([d,p]),b)v.pop();else n={inArray:c,index:f,keys:l,edits:h,prev:n},c=Array.isArray(p),l=c?p:null!==(B=r[p.kind])&&void 0!==B?B:[],f=-1,h=[],y&&g.push(y),y=p}while(void 0!==n);0!==h.length&&(m=h[h.length-1][1]);return m};var n,i=(n=r(8002))&&n.__esModule?n:{default:n},a=r(1807);var o={Name:[],Document:["definitions"],OperationDefinition:["name","variableDefinitions","directives","selectionSet"],VariableDefinition:["variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentSpread:["name","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","locations"],SchemaExtension:["directives","operationTypes"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"]};var s=Object.freeze({});function u(e,t,r){var n=e[t];if(n){if(!r&&"function"==typeof n)return n;var i=r?n.leave:n.enter;if("function"==typeof i)return i}else{var a=r?e.leave:e.enter;if(a){if("function"==typeof a)return a;var o=a[t];if("function"==typeof o)return o}}}},7636:(e,t,r)=>{"use strict";r.d(t,{$_:()=>o,Vn:()=>s});var n=r(6589),i=r(3059),a={Name:[],Document:["definitions"],OperationDefinition:["name","variableDefinitions","directives","selectionSet"],VariableDefinition:["variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentSpread:["name","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","locations"],SchemaExtension:["directives","operationTypes"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"]},o=Object.freeze({});function s(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:a,s=void 0,c=Array.isArray(e),l=[e],f=-1,h=[],p=void 0,d=void 0,y=void 0,v=[],g=[],m=e;do{var b=++f===l.length,E=b&&0!==h.length;if(b){if(d=0===g.length?void 0:v[v.length-1],p=y,y=g.pop(),E){if(c)p=p.slice();else{for(var S={},C=0,w=Object.keys(p);C<w.length;C++){var T=w[C];S[T]=p[T]}p=S}for(var A=0,I=0;I<h.length;I++){var k=h[I][0],_=h[I][1];c&&(k-=A),c&&null===_?(p.splice(k,1),A++):p[k]=_}}f=s.index,l=s.keys,h=s.edits,c=s.inArray,s=s.prev}else{if(d=y?c?f:l[f]:void 0,null==(p=y?y[d]:m))continue;y&&v.push(d)}var B,N=void 0;if(!Array.isArray(p)){if(!(0,i.UG)(p))throw new Error("Invalid AST Node: ".concat((0,n.Z)(p),"."));var O=u(t,p.kind,b);if(O){if((N=O.call(t,p,d,y,v,g))===o)break;if(!1===N){if(!b){v.pop();continue}}else if(void 0!==N&&(h.push([d,N]),!b)){if(!(0,i.UG)(N)){v.pop();continue}p=N}}}if(void 0===N&&E&&h.push([d,p]),b)v.pop();else s={inArray:c,index:f,keys:l,edits:h,prev:s},l=(c=Array.isArray(p))?p:null!==(B=r[p.kind])&&void 0!==B?B:[],f=-1,h=[],y&&g.push(y),y=p}while(void 0!==s);return 0!==h.length&&(m=h[h.length-1][1]),m}function u(e,t,r){var n=e[t];if(n){if(!r&&"function"==typeof n)return n;var i=r?n.leave:n.enter;if("function"==typeof i)return i}else{var a=r?e.leave:e.enter;if(a){if("function"==typeof a)return a;var o=a[t];if("function"==typeof o)return o}}}},645:(e,t)=>{
16
16
  /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
17
- t.read=function(e,t,r,n,i){var a,o,s=8*i-n-1,u=(1<<s)-1,c=u>>1,l=-7,f=r?i-1:0,h=r?-1:1,p=e[t+f];for(f+=h,a=p&(1<<-l)-1,p>>=-l,l+=s;l>0;a=256*a+e[t+f],f+=h,l-=8);for(o=a&(1<<-l)-1,a>>=-l,l+=n;l>0;o=256*o+e[t+f],f+=h,l-=8);if(0===a)a=1-c;else{if(a===u)return o?NaN:1/0*(p?-1:1);o+=Math.pow(2,n),a-=c}return(p?-1:1)*o*Math.pow(2,a-n)},t.write=function(e,t,r,n,i,a){var o,s,u,c=8*a-i-1,l=(1<<c)-1,f=l>>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:a-1,d=n?1:-1,y=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=l):(o=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-o))<1&&(o--,u*=2),(t+=o+f>=1?h/u:h*Math.pow(2,1-f))*u>=2&&(o++,u/=2),o+f>=l?(s=0,o=l):o+f>=1?(s=(t*u-1)*Math.pow(2,i),o+=f):(s=t*Math.pow(2,f-1)*Math.pow(2,i),o=0));i>=8;e[r+p]=255&s,p+=d,s/=256,i-=8);for(o=o<<i|s,c+=i;c>0;e[r+p]=255&o,p+=d,o/=256,c-=8);e[r+p-d]|=128*y}},8552:function(e,t,r){var n=r(852)(r(5639),"DataView");e.exports=n},1989:function(e,t,r){var n=r(1789),i=r(401),a=r(7667),o=r(1327),s=r(1866);function u(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}u.prototype.clear=n,u.prototype.delete=i,u.prototype.get=a,u.prototype.has=o,u.prototype.set=s,e.exports=u},6425:function(e,t,r){var n=r(3118),i=r(9435);function a(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}a.prototype=n(i.prototype),a.prototype.constructor=a,e.exports=a},8407:function(e,t,r){var n=r(7040),i=r(4125),a=r(2117),o=r(7518),s=r(4705);function u(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}u.prototype.clear=n,u.prototype.delete=i,u.prototype.get=a,u.prototype.has=o,u.prototype.set=s,e.exports=u},7548:function(e,t,r){var n=r(3118),i=r(9435);function a(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=void 0}a.prototype=n(i.prototype),a.prototype.constructor=a,e.exports=a},7071:function(e,t,r){var n=r(852)(r(5639),"Map");e.exports=n},3369:function(e,t,r){var n=r(4785),i=r(1285),a=r(6e3),o=r(9916),s=r(5265);function u(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}u.prototype.clear=n,u.prototype.delete=i,u.prototype.get=a,u.prototype.has=o,u.prototype.set=s,e.exports=u},3818:function(e,t,r){var n=r(852)(r(5639),"Promise");e.exports=n},8525:function(e,t,r){var n=r(852)(r(5639),"Set");e.exports=n},8668:function(e,t,r){var n=r(3369),i=r(619),a=r(2385);function o(e){var t=-1,r=null==e?0:e.length;for(this.__data__=new n;++t<r;)this.add(e[t])}o.prototype.add=o.prototype.push=i,o.prototype.has=a,e.exports=o},6384:function(e,t,r){var n=r(8407),i=r(7465),a=r(3779),o=r(7599),s=r(4758),u=r(4309);function c(e){var t=this.__data__=new n(e);this.size=t.size}c.prototype.clear=i,c.prototype.delete=a,c.prototype.get=o,c.prototype.has=s,c.prototype.set=u,e.exports=c},2705:function(e,t,r){var n=r(5639).Symbol;e.exports=n},1149:function(e,t,r){var n=r(5639).Uint8Array;e.exports=n},577:function(e,t,r){var n=r(852)(r(5639),"WeakMap");e.exports=n},6874:function(e){e.exports=function(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}},7412:function(e){e.exports=function(e,t){for(var r=-1,n=null==e?0:e.length;++r<n&&!1!==t(e[r],r,e););return e}},4963:function(e){e.exports=function(e,t){for(var r=-1,n=null==e?0:e.length,i=0,a=[];++r<n;){var o=e[r];t(o,r,e)&&(a[i++]=o)}return a}},7443:function(e,t,r){var n=r(2118);e.exports=function(e,t){return!!(null==e?0:e.length)&&n(e,t,0)>-1}},1196:function(e){e.exports=function(e,t,r){for(var n=-1,i=null==e?0:e.length;++n<i;)if(r(t,e[n]))return!0;return!1}},4636:function(e,t,r){var n=r(2545),i=r(5694),a=r(1469),o=r(4144),s=r(5776),u=r(6719),c=Object.prototype.hasOwnProperty;e.exports=function(e,t){var r=a(e),l=!r&&i(e),f=!r&&!l&&o(e),h=!r&&!l&&!f&&u(e),p=r||l||f||h,d=p?n(e.length,String):[],y=d.length;for(var v in e)!t&&!c.call(e,v)||p&&("length"==v||f&&("offset"==v||"parent"==v)||h&&("buffer"==v||"byteLength"==v||"byteOffset"==v)||s(v,y))||d.push(v);return d}},9932:function(e){e.exports=function(e,t){for(var r=-1,n=null==e?0:e.length,i=Array(n);++r<n;)i[r]=t(e[r],r,e);return i}},2488:function(e){e.exports=function(e,t){for(var r=-1,n=t.length,i=e.length;++r<n;)e[i+r]=t[r];return e}},6556:function(e,t,r){var n=r(9465),i=r(7813);e.exports=function(e,t,r){(void 0!==r&&!i(e[t],r)||void 0===r&&!(t in e))&&n(e,t,r)}},4865:function(e,t,r){var n=r(9465),i=r(7813),a=Object.prototype.hasOwnProperty;e.exports=function(e,t,r){var o=e[t];a.call(e,t)&&i(o,r)&&(void 0!==r||t in e)||n(e,t,r)}},8470:function(e,t,r){var n=r(7813);e.exports=function(e,t){for(var r=e.length;r--;)if(n(e[r][0],t))return r;return-1}},4037:function(e,t,r){var n=r(8363),i=r(3674);e.exports=function(e,t){return e&&n(t,i(t),e)}},3886:function(e,t,r){var n=r(8363),i=r(1704);e.exports=function(e,t){return e&&n(t,i(t),e)}},9465:function(e,t,r){var n=r(8777);e.exports=function(e,t,r){"__proto__"==t&&n?n(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}},9750:function(e){e.exports=function(e,t,r){return e==e&&(void 0!==r&&(e=e<=r?e:r),void 0!==t&&(e=e>=t?e:t)),e}},5990:function(e,t,r){var n=r(6384),i=r(7412),a=r(4865),o=r(4037),s=r(3886),u=r(4626),c=r(278),l=r(8805),f=r(1911),h=r(8234),p=r(6904),d=r(4160),y=r(3824),v=r(9148),g=r(8517),m=r(1469),b=r(4144),E=r(6688),S=r(3218),C=r(2928),w=r(3674),T=r(1704),A="[object Arguments]",I="[object Function]",k="[object Object]",_={};_[A]=_["[object Array]"]=_["[object ArrayBuffer]"]=_["[object DataView]"]=_["[object Boolean]"]=_["[object Date]"]=_["[object Float32Array]"]=_["[object Float64Array]"]=_["[object Int8Array]"]=_["[object Int16Array]"]=_["[object Int32Array]"]=_["[object Map]"]=_["[object Number]"]=_[k]=_["[object RegExp]"]=_["[object Set]"]=_["[object String]"]=_["[object Symbol]"]=_["[object Uint8Array]"]=_["[object Uint8ClampedArray]"]=_["[object Uint16Array]"]=_["[object Uint32Array]"]=!0,_["[object Error]"]=_[I]=_["[object WeakMap]"]=!1,e.exports=function e(t,r,B,N,O,R){var x,P=1&r,F=2&r,D=4&r;if(B&&(x=O?B(t,N,O,R):B(t)),void 0!==x)return x;if(!S(t))return t;var L=m(t);if(L){if(x=y(t),!P)return c(t,x)}else{var U=d(t),j=U==I||"[object GeneratorFunction]"==U;if(b(t))return u(t,P);if(U==k||U==A||j&&!O){if(x=F||j?{}:g(t),!P)return F?f(t,s(x,t)):l(t,o(x,t))}else{if(!_[U])return O?t:{};x=v(t,U,P)}}R||(R=new n);var V=R.get(t);if(V)return V;R.set(t,x),C(t)?t.forEach((function(n){x.add(e(n,r,B,n,t,R))})):E(t)&&t.forEach((function(n,i){x.set(i,e(n,r,B,i,t,R))}));var K=L?void 0:(D?F?p:h:F?T:w)(t);return i(K||t,(function(n,i){K&&(n=t[i=n]),a(x,i,e(n,r,B,i,t,R))})),x}},3118:function(e,t,r){var n=r(3218),i=Object.create,a=function(){function e(){}return function(t){if(!n(t))return{};if(i)return i(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}();e.exports=a},5082:function(e,t,r){var n=r(554),i=r(8958);e.exports=function(e,t,r,a){var o=e.length;for((r=n(r))<0&&(r=-r>o?0:o+r),(a=void 0===a||a>o?o:n(a))<0&&(a+=o),a=r>a?0:i(a);r<a;)e[r++]=t;return e}},1848:function(e){e.exports=function(e,t,r,n){for(var i=e.length,a=r+(n?1:-1);n?a--:++a<i;)if(t(e[a],a,e))return a;return-1}},1078:function(e,t,r){var n=r(2488),i=r(7285);e.exports=function e(t,r,a,o,s){var u=-1,c=t.length;for(a||(a=i),s||(s=[]);++u<c;){var l=t[u];r>0&&a(l)?r>1?e(l,r-1,a,o,s):n(s,l):o||(s[s.length]=l)}return s}},8483:function(e,t,r){var n=r(5063)();e.exports=n},7786:function(e,t,r){var n=r(1811),i=r(327);e.exports=function(e,t){for(var r=0,a=(t=n(t,e)).length;null!=e&&r<a;)e=e[i(t[r++])];return r&&r==a?e:void 0}},8866:function(e,t,r){var n=r(2488),i=r(1469);e.exports=function(e,t,r){var a=t(e);return i(e)?a:n(a,r(e))}},4239:function(e,t,r){var n=r(2705),i=r(9607),a=r(2333),o=n?n.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":o&&o in Object(e)?i(e):a(e)}},13:function(e){e.exports=function(e,t){return null!=e&&t in Object(e)}},2118:function(e,t,r){var n=r(1848),i=r(2722),a=r(2351);e.exports=function(e,t,r){return t==t?a(e,t,r):n(e,i,r)}},7556:function(e,t,r){var n=r(8668),i=r(7443),a=r(1196),o=r(9932),s=r(1717),u=r(4757),c=Math.min;e.exports=function(e,t,r){for(var l=r?a:i,f=e[0].length,h=e.length,p=h,d=Array(h),y=1/0,v=[];p--;){var g=e[p];p&&t&&(g=o(g,s(t))),y=c(g.length,y),d[p]=!r&&(t||f>=120&&g.length>=120)?new n(p&&g):void 0}g=e[0];var m=-1,b=d[0];e:for(;++m<f&&v.length<y;){var E=g[m],S=t?t(E):E;if(E=r||0!==E?E:0,!(b?u(b,S):l(v,S,r))){for(p=h;--p;){var C=d[p];if(!(C?u(C,S):l(e[p],S,r)))continue e}b&&b.push(S),v.push(E)}}return v}},9454:function(e,t,r){var n=r(4239),i=r(7005);e.exports=function(e){return i(e)&&"[object Arguments]"==n(e)}},5588:function(e,t,r){var n=r(4160),i=r(7005);e.exports=function(e){return i(e)&&"[object Map]"==n(e)}},2722:function(e){e.exports=function(e){return e!=e}},8458:function(e,t,r){var n=r(3560),i=r(5346),a=r(3218),o=r(346),s=/^\[object .+?Constructor\]$/,u=Function.prototype,c=Object.prototype,l=u.toString,f=c.hasOwnProperty,h=RegExp("^"+l.call(f).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(e){return!(!a(e)||i(e))&&(n(e)?h:s).test(o(e))}},9221:function(e,t,r){var n=r(4160),i=r(7005);e.exports=function(e){return i(e)&&"[object Set]"==n(e)}},8749:function(e,t,r){var n=r(4239),i=r(1780),a=r(7005),o={};o["[object Float32Array]"]=o["[object Float64Array]"]=o["[object Int8Array]"]=o["[object Int16Array]"]=o["[object Int32Array]"]=o["[object Uint8Array]"]=o["[object Uint8ClampedArray]"]=o["[object Uint16Array]"]=o["[object Uint32Array]"]=!0,o["[object Arguments]"]=o["[object Array]"]=o["[object ArrayBuffer]"]=o["[object Boolean]"]=o["[object DataView]"]=o["[object Date]"]=o["[object Error]"]=o["[object Function]"]=o["[object Map]"]=o["[object Number]"]=o["[object Object]"]=o["[object RegExp]"]=o["[object Set]"]=o["[object String]"]=o["[object WeakMap]"]=!1,e.exports=function(e){return a(e)&&i(e.length)&&!!o[n(e)]}},280:function(e,t,r){var n=r(5726),i=r(6916),a=Object.prototype.hasOwnProperty;e.exports=function(e){if(!n(e))return i(e);var t=[];for(var r in Object(e))a.call(e,r)&&"constructor"!=r&&t.push(r);return t}},313:function(e,t,r){var n=r(3218),i=r(5726),a=r(3498),o=Object.prototype.hasOwnProperty;e.exports=function(e){if(!n(e))return a(e);var t=i(e),r=[];for(var s in e)("constructor"!=s||!t&&o.call(e,s))&&r.push(s);return r}},9435:function(e){e.exports=function(){}},2980:function(e,t,r){var n=r(6384),i=r(6556),a=r(8483),o=r(9783),s=r(3218),u=r(1704),c=r(6390);e.exports=function e(t,r,l,f,h){t!==r&&a(r,(function(a,u){if(h||(h=new n),s(a))o(t,r,u,l,e,f,h);else{var p=f?f(c(t,u),a,u+"",t,r,h):void 0;void 0===p&&(p=a),i(t,u,p)}}),u)}},9783:function(e,t,r){var n=r(6556),i=r(4626),a=r(7133),o=r(278),s=r(8517),u=r(5694),c=r(1469),l=r(9246),f=r(4144),h=r(3560),p=r(3218),d=r(8630),y=r(6719),v=r(6390),g=r(9881);e.exports=function(e,t,r,m,b,E,S){var C=v(e,r),w=v(t,r),T=S.get(w);if(T)n(e,r,T);else{var A=E?E(C,w,r+"",e,t,S):void 0,I=void 0===A;if(I){var k=c(w),_=!k&&f(w),B=!k&&!_&&y(w);A=w,k||_||B?c(C)?A=C:l(C)?A=o(C):_?(I=!1,A=i(w,!0)):B?(I=!1,A=a(w,!0)):A=[]:d(w)||u(w)?(A=C,u(C)?A=g(C):p(C)&&!h(C)||(A=s(w))):I=!1}I&&(S.set(w,A),b(A,w,m,E,S),S.delete(w)),n(e,r,A)}}},5970:function(e,t,r){var n=r(3012),i=r(9095);e.exports=function(e,t){return n(e,t,(function(t,r){return i(e,r)}))}},3012:function(e,t,r){var n=r(7786),i=r(611),a=r(1811);e.exports=function(e,t,r){for(var o=-1,s=t.length,u={};++o<s;){var c=t[o],l=n(e,c);r(l,c)&&i(u,a(c,e),l)}return u}},5976:function(e,t,r){var n=r(6557),i=r(5357),a=r(61);e.exports=function(e,t){return a(i(e,t,n),e+"")}},611:function(e,t,r){var n=r(4865),i=r(1811),a=r(5776),o=r(3218),s=r(327);e.exports=function(e,t,r,u){if(!o(e))return e;for(var c=-1,l=(t=i(t,e)).length,f=l-1,h=e;null!=h&&++c<l;){var p=s(t[c]),d=r;if("__proto__"===p||"constructor"===p||"prototype"===p)return e;if(c!=f){var y=h[p];void 0===(d=u?u(y,p,h):void 0)&&(d=o(y)?y:a(t[c+1])?[]:{})}n(h,p,d),h=h[p]}return e}},8045:function(e,t,r){var n=r(6557),i=r(9250),a=i?function(e,t){return i.set(e,t),e}:n;e.exports=a},6560:function(e,t,r){var n=r(5703),i=r(8777),a=r(6557),o=i?function(e,t){return i(e,"toString",{configurable:!0,enumerable:!1,value:n(t),writable:!0})}:a;e.exports=o},4259:function(e){e.exports=function(e,t,r){var n=-1,i=e.length;t<0&&(t=-t>i?0:i+t),(r=r>i?i:r)<0&&(r+=i),i=t>r?0:r-t>>>0,t>>>=0;for(var a=Array(i);++n<i;)a[n]=e[n+t];return a}},2545:function(e){e.exports=function(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}},531:function(e,t,r){var n=r(2705),i=r(9932),a=r(1469),o=r(3448),s=n?n.prototype:void 0,u=s?s.toString:void 0;e.exports=function e(t){if("string"==typeof t)return t;if(a(t))return i(t,e)+"";if(o(t))return u?u.call(t):"";var r=t+"";return"0"==r&&1/t==-Infinity?"-0":r}},1717:function(e){e.exports=function(e){return function(t){return e(t)}}},5652:function(e,t,r){var n=r(8668),i=r(7443),a=r(1196),o=r(4757),s=r(3593),u=r(1814);e.exports=function(e,t,r){var c=-1,l=i,f=e.length,h=!0,p=[],d=p;if(r)h=!1,l=a;else if(f>=200){var y=t?null:s(e);if(y)return u(y);h=!1,l=o,d=new n}else d=t?[]:p;e:for(;++c<f;){var v=e[c],g=t?t(v):v;if(v=r||0!==v?v:0,h&&g==g){for(var m=d.length;m--;)if(d[m]===g)continue e;t&&d.push(g),p.push(v)}else l(d,g,r)||(d!==p&&d.push(g),p.push(v))}return p}},7406:function(e,t,r){var n=r(1811),i=r(928),a=r(292),o=r(327);e.exports=function(e,t){return t=n(t,e),null==(e=a(e,t))||delete e[o(i(t))]}},4757:function(e){e.exports=function(e,t){return e.has(t)}},4387:function(e,t,r){var n=r(9246);e.exports=function(e){return n(e)?e:[]}},1811:function(e,t,r){var n=r(1469),i=r(5403),a=r(5514),o=r(9833);e.exports=function(e,t){return n(e)?e:i(e,t)?[e]:a(o(e))}},4318:function(e,t,r){var n=r(1149);e.exports=function(e){var t=new e.constructor(e.byteLength);return new n(t).set(new n(e)),t}},4626:function(e,t,r){e=r.nmd(e);var n=r(5639),i=t&&!t.nodeType&&t,a=i&&e&&!e.nodeType&&e,o=a&&a.exports===i?n.Buffer:void 0,s=o?o.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var r=e.length,n=s?s(r):new e.constructor(r);return e.copy(n),n}},7157:function(e,t,r){var n=r(4318);e.exports=function(e,t){var r=t?n(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}},3147:function(e){var t=/\w*$/;e.exports=function(e){var r=new e.constructor(e.source,t.exec(e));return r.lastIndex=e.lastIndex,r}},419:function(e,t,r){var n=r(2705),i=n?n.prototype:void 0,a=i?i.valueOf:void 0;e.exports=function(e){return a?Object(a.call(e)):{}}},7133:function(e,t,r){var n=r(4318);e.exports=function(e,t){var r=t?n(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}},2157:function(e){var t=Math.max;e.exports=function(e,r,n,i){for(var a=-1,o=e.length,s=n.length,u=-1,c=r.length,l=t(o-s,0),f=Array(c+l),h=!i;++u<c;)f[u]=r[u];for(;++a<s;)(h||a<o)&&(f[n[a]]=e[a]);for(;l--;)f[u++]=e[a++];return f}},4054:function(e){var t=Math.max;e.exports=function(e,r,n,i){for(var a=-1,o=e.length,s=-1,u=n.length,c=-1,l=r.length,f=t(o-u,0),h=Array(f+l),p=!i;++a<f;)h[a]=e[a];for(var d=a;++c<l;)h[d+c]=r[c];for(;++s<u;)(p||a<o)&&(h[d+n[s]]=e[a++]);return h}},278:function(e){e.exports=function(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}},8363:function(e,t,r){var n=r(4865),i=r(9465);e.exports=function(e,t,r,a){var o=!r;r||(r={});for(var s=-1,u=t.length;++s<u;){var c=t[s],l=a?a(r[c],e[c],c,r,e):void 0;void 0===l&&(l=e[c]),o?i(r,c,l):n(r,c,l)}return r}},8805:function(e,t,r){var n=r(8363),i=r(9551);e.exports=function(e,t){return n(e,i(e),t)}},1911:function(e,t,r){var n=r(8363),i=r(1442);e.exports=function(e,t){return n(e,i(e),t)}},4429:function(e,t,r){var n=r(5639)["__core-js_shared__"];e.exports=n},7991:function(e){e.exports=function(e,t){for(var r=e.length,n=0;r--;)e[r]===t&&++n;return n}},1463:function(e,t,r){var n=r(5976),i=r(6612);e.exports=function(e){return n((function(t,r){var n=-1,a=r.length,o=a>1?r[a-1]:void 0,s=a>2?r[2]:void 0;for(o=e.length>3&&"function"==typeof o?(a--,o):void 0,s&&i(r[0],r[1],s)&&(o=a<3?void 0:o,a=1),t=Object(t);++n<a;){var u=r[n];u&&e(t,u,n,o)}return t}))}},5063:function(e){e.exports=function(e){return function(t,r,n){for(var i=-1,a=Object(t),o=n(t),s=o.length;s--;){var u=o[e?s:++i];if(!1===r(a[u],u,a))break}return t}}},2402:function(e,t,r){var n=r(1774),i=r(5639);e.exports=function(e,t,r){var a=1&t,o=n(e);return function t(){var n=this&&this!==i&&this instanceof t?o:e;return n.apply(a?r:this,arguments)}}},1774:function(e,t,r){var n=r(3118),i=r(3218);e.exports=function(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var r=n(e.prototype),a=e.apply(r,t);return i(a)?a:r}}},6347:function(e,t,r){var n=r(6874),i=r(1774),a=r(6935),o=r(4487),s=r(893),u=r(6460),c=r(5639);e.exports=function(e,t,r){var l=i(e);return function i(){for(var f=arguments.length,h=Array(f),p=f,d=s(i);p--;)h[p]=arguments[p];var y=f<3&&h[0]!==d&&h[f-1]!==d?[]:u(h,d);if((f-=y.length)<r)return o(e,t,a,i.placeholder,void 0,h,y,void 0,void 0,r-f);var v=this&&this!==c&&this instanceof i?l:e;return n(v,this,h)}}},6935:function(e,t,r){var n=r(2157),i=r(4054),a=r(7991),o=r(1774),s=r(4487),u=r(893),c=r(451),l=r(6460),f=r(5639);e.exports=function e(t,r,h,p,d,y,v,g,m,b){var E=128&r,S=1&r,C=2&r,w=24&r,T=512&r,A=C?void 0:o(t);return function I(){for(var k=arguments.length,_=Array(k),B=k;B--;)_[B]=arguments[B];if(w)var N=u(I),O=a(_,N);if(p&&(_=n(_,p,d,w)),y&&(_=i(_,y,v,w)),k-=O,w&&k<b){var R=l(_,N);return s(t,r,e,I.placeholder,h,_,R,g,m,b-k)}var x=S?h:this,P=C?x[t]:t;return k=_.length,g?_=c(_,g):T&&k>1&&_.reverse(),E&&m<k&&(_.length=m),this&&this!==f&&this instanceof I&&(P=A||o(P)),P.apply(x,_)}}},4375:function(e,t,r){var n=r(6874),i=r(1774),a=r(5639);e.exports=function(e,t,r,o){var s=1&t,u=i(e);return function t(){for(var i=-1,c=arguments.length,l=-1,f=o.length,h=Array(f+c),p=this&&this!==a&&this instanceof t?u:e;++l<f;)h[l]=o[l];for(;c--;)h[l++]=arguments[++i];return n(p,s?r:this,h)}}},4487:function(e,t,r){var n=r(6528),i=r(258),a=r(9255);e.exports=function(e,t,r,o,s,u,c,l,f,h){var p=8&t;t|=p?32:64,4&(t&=~(p?64:32))||(t&=-4);var d=[e,t,s,p?u:void 0,p?c:void 0,p?void 0:u,p?void 0:c,l,f,h],y=r.apply(void 0,d);return n(e)&&i(y,d),y.placeholder=o,a(y,e,t)}},3593:function(e,t,r){var n=r(8525),i=r(308),a=r(1814),o=n&&1/a(new n([,-0]))[1]==1/0?function(e){return new n(e)}:i;e.exports=o},7727:function(e,t,r){var n=r(8045),i=r(2402),a=r(6347),o=r(6935),s=r(4375),u=r(6833),c=r(3833),l=r(258),f=r(9255),h=r(554),p=Math.max;e.exports=function(e,t,r,d,y,v,g,m){var b=2&t;if(!b&&"function"!=typeof e)throw new TypeError("Expected a function");var E=d?d.length:0;if(E||(t&=-97,d=y=void 0),g=void 0===g?g:p(h(g),0),m=void 0===m?m:h(m),E-=y?y.length:0,64&t){var S=d,C=y;d=y=void 0}var w=b?void 0:u(e),T=[e,t,r,d,y,S,C,v,g,m];if(w&&c(T,w),e=T[0],t=T[1],r=T[2],d=T[3],y=T[4],!(m=T[9]=void 0===T[9]?b?0:e.length:p(T[9]-E,0))&&24&t&&(t&=-25),t&&1!=t)A=8==t||16==t?a(e,t,m):32!=t&&33!=t||y.length?o.apply(void 0,T):s(e,t,r,d);else var A=i(e,t,r);return f((w?n:l)(A,T),e,t)}},696:function(e,t,r){var n=r(8630);e.exports=function(e){return n(e)?void 0:e}},8777:function(e,t,r){var n=r(852),i=function(){try{var e=n(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();e.exports=i},9021:function(e,t,r){var n=r(5564),i=r(5357),a=r(61);e.exports=function(e){return a(i(e,void 0,n),e+"")}},1957:function(e,t,r){var n="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g;e.exports=n},8234:function(e,t,r){var n=r(8866),i=r(9551),a=r(3674);e.exports=function(e){return n(e,a,i)}},6904:function(e,t,r){var n=r(8866),i=r(1442),a=r(1704);e.exports=function(e){return n(e,a,i)}},6833:function(e,t,r){var n=r(9250),i=r(308),a=n?function(e){return n.get(e)}:i;e.exports=a},7658:function(e,t,r){var n=r(2060),i=Object.prototype.hasOwnProperty;e.exports=function(e){for(var t=e.name+"",r=n[t],a=i.call(n,t)?r.length:0;a--;){var o=r[a],s=o.func;if(null==s||s==e)return o.name}return t}},893:function(e){e.exports=function(e){return e.placeholder}},5050:function(e,t,r){var n=r(7019);e.exports=function(e,t){var r=e.__data__;return n(t)?r["string"==typeof t?"string":"hash"]:r.map}},852:function(e,t,r){var n=r(8458),i=r(7801);e.exports=function(e,t){var r=i(e,t);return n(r)?r:void 0}},5924:function(e,t,r){var n=r(5569)(Object.getPrototypeOf,Object);e.exports=n},9607:function(e,t,r){var n=r(2705),i=Object.prototype,a=i.hasOwnProperty,o=i.toString,s=n?n.toStringTag:void 0;e.exports=function(e){var t=a.call(e,s),r=e[s];try{e[s]=void 0;var n=!0}catch(e){}var i=o.call(e);return n&&(t?e[s]=r:delete e[s]),i}},9551:function(e,t,r){var n=r(4963),i=r(479),a=Object.prototype.propertyIsEnumerable,o=Object.getOwnPropertySymbols,s=o?function(e){return null==e?[]:(e=Object(e),n(o(e),(function(t){return a.call(e,t)})))}:i;e.exports=s},1442:function(e,t,r){var n=r(2488),i=r(5924),a=r(9551),o=r(479),s=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)n(t,a(e)),e=i(e);return t}:o;e.exports=s},4160:function(e,t,r){var n=r(8552),i=r(7071),a=r(3818),o=r(8525),s=r(577),u=r(4239),c=r(346),l="[object Map]",f="[object Promise]",h="[object Set]",p="[object WeakMap]",d="[object DataView]",y=c(n),v=c(i),g=c(a),m=c(o),b=c(s),E=u;(n&&E(new n(new ArrayBuffer(1)))!=d||i&&E(new i)!=l||a&&E(a.resolve())!=f||o&&E(new o)!=h||s&&E(new s)!=p)&&(E=function(e){var t=u(e),r="[object Object]"==t?e.constructor:void 0,n=r?c(r):"";if(n)switch(n){case y:return d;case v:return l;case g:return f;case m:return h;case b:return p}return t}),e.exports=E},7801:function(e){e.exports=function(e,t){return null==e?void 0:e[t]}},8775:function(e){var t=/\{\n\/\* \[wrapped with (.+)\] \*/,r=/,? & /;e.exports=function(e){var n=e.match(t);return n?n[1].split(r):[]}},222:function(e,t,r){var n=r(1811),i=r(5694),a=r(1469),o=r(5776),s=r(1780),u=r(327);e.exports=function(e,t,r){for(var c=-1,l=(t=n(t,e)).length,f=!1;++c<l;){var h=u(t[c]);if(!(f=null!=e&&r(e,h)))break;e=e[h]}return f||++c!=l?f:!!(l=null==e?0:e.length)&&s(l)&&o(h,l)&&(a(e)||i(e))}},1789:function(e,t,r){var n=r(4536);e.exports=function(){this.__data__=n?n(null):{},this.size=0}},401:function(e){e.exports=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}},7667:function(e,t,r){var n=r(4536),i=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;if(n){var r=t[e];return"__lodash_hash_undefined__"===r?void 0:r}return i.call(t,e)?t[e]:void 0}},1327:function(e,t,r){var n=r(4536),i=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;return n?void 0!==t[e]:i.call(t,e)}},1866:function(e,t,r){var n=r(4536);e.exports=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=n&&void 0===t?"__lodash_hash_undefined__":t,this}},3824:function(e){var t=Object.prototype.hasOwnProperty;e.exports=function(e){var r=e.length,n=new e.constructor(r);return r&&"string"==typeof e[0]&&t.call(e,"index")&&(n.index=e.index,n.input=e.input),n}},9148:function(e,t,r){var n=r(4318),i=r(7157),a=r(3147),o=r(419),s=r(7133);e.exports=function(e,t,r){var u=e.constructor;switch(t){case"[object ArrayBuffer]":return n(e);case"[object Boolean]":case"[object Date]":return new u(+e);case"[object DataView]":return i(e,r);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return s(e,r);case"[object Map]":return new u;case"[object Number]":case"[object String]":return new u(e);case"[object RegExp]":return a(e);case"[object Set]":return new u;case"[object Symbol]":return o(e)}}},8517:function(e,t,r){var n=r(3118),i=r(5924),a=r(5726);e.exports=function(e){return"function"!=typeof e.constructor||a(e)?{}:n(i(e))}},3112:function(e){var t=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/;e.exports=function(e,r){var n=r.length;if(!n)return e;var i=n-1;return r[i]=(n>1?"& ":"")+r[i],r=r.join(n>2?", ":" "),e.replace(t,"{\n/* [wrapped with "+r+"] */\n")}},7285:function(e,t,r){var n=r(2705),i=r(5694),a=r(1469),o=n?n.isConcatSpreadable:void 0;e.exports=function(e){return a(e)||i(e)||!!(o&&e&&e[o])}},5776:function(e){var t=/^(?:0|[1-9]\d*)$/;e.exports=function(e,r){var n=typeof e;return!!(r=null==r?9007199254740991:r)&&("number"==n||"symbol"!=n&&t.test(e))&&e>-1&&e%1==0&&e<r}},6612:function(e,t,r){var n=r(7813),i=r(8612),a=r(5776),o=r(3218);e.exports=function(e,t,r){if(!o(r))return!1;var s=typeof t;return!!("number"==s?i(r)&&a(t,r.length):"string"==s&&t in r)&&n(r[t],e)}},5403:function(e,t,r){var n=r(1469),i=r(3448),a=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,o=/^\w*$/;e.exports=function(e,t){if(n(e))return!1;var r=typeof e;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!i(e))||(o.test(e)||!a.test(e)||null!=t&&e in Object(t))}},7019:function(e){e.exports=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}},6528:function(e,t,r){var n=r(6425),i=r(6833),a=r(7658),o=r(8111);e.exports=function(e){var t=a(e),r=o[t];if("function"!=typeof r||!(t in n.prototype))return!1;if(e===r)return!0;var s=i(r);return!!s&&e===s[0]}},5346:function(e,t,r){var n,i=r(4429),a=(n=/[^.]+$/.exec(i&&i.keys&&i.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"";e.exports=function(e){return!!a&&a in e}},5726:function(e){var t=Object.prototype;e.exports=function(e){var r=e&&e.constructor;return e===("function"==typeof r&&r.prototype||t)}},7040:function(e){e.exports=function(){this.__data__=[],this.size=0}},4125:function(e,t,r){var n=r(8470),i=Array.prototype.splice;e.exports=function(e){var t=this.__data__,r=n(t,e);return!(r<0)&&(r==t.length-1?t.pop():i.call(t,r,1),--this.size,!0)}},2117:function(e,t,r){var n=r(8470);e.exports=function(e){var t=this.__data__,r=n(t,e);return r<0?void 0:t[r][1]}},7518:function(e,t,r){var n=r(8470);e.exports=function(e){return n(this.__data__,e)>-1}},4705:function(e,t,r){var n=r(8470);e.exports=function(e,t){var r=this.__data__,i=n(r,e);return i<0?(++this.size,r.push([e,t])):r[i][1]=t,this}},4785:function(e,t,r){var n=r(1989),i=r(8407),a=r(7071);e.exports=function(){this.size=0,this.__data__={hash:new n,map:new(a||i),string:new n}}},1285:function(e,t,r){var n=r(5050);e.exports=function(e){var t=n(this,e).delete(e);return this.size-=t?1:0,t}},6e3:function(e,t,r){var n=r(5050);e.exports=function(e){return n(this,e).get(e)}},9916:function(e,t,r){var n=r(5050);e.exports=function(e){return n(this,e).has(e)}},5265:function(e,t,r){var n=r(5050);e.exports=function(e,t){var r=n(this,e),i=r.size;return r.set(e,t),this.size+=r.size==i?0:1,this}},4523:function(e,t,r){var n=r(8306);e.exports=function(e){var t=n(e,(function(e){return 500===r.size&&r.clear(),e})),r=t.cache;return t}},3833:function(e,t,r){var n=r(2157),i=r(4054),a=r(6460),o="__lodash_placeholder__",s=128,u=Math.min;e.exports=function(e,t){var r=e[1],c=t[1],l=r|c,f=l<131,h=c==s&&8==r||c==s&&256==r&&e[7].length<=t[8]||384==c&&t[7].length<=t[8]&&8==r;if(!f&&!h)return e;1&c&&(e[2]=t[2],l|=1&r?0:4);var p=t[3];if(p){var d=e[3];e[3]=d?n(d,p,t[4]):p,e[4]=d?a(e[3],o):t[4]}return(p=t[5])&&(d=e[5],e[5]=d?i(d,p,t[6]):p,e[6]=d?a(e[5],o):t[6]),(p=t[7])&&(e[7]=p),c&s&&(e[8]=null==e[8]?t[8]:u(e[8],t[8])),null==e[9]&&(e[9]=t[9]),e[0]=t[0],e[1]=l,e}},9250:function(e,t,r){var n=r(577),i=n&&new n;e.exports=i},4536:function(e,t,r){var n=r(852)(Object,"create");e.exports=n},6916:function(e,t,r){var n=r(5569)(Object.keys,Object);e.exports=n},3498:function(e){e.exports=function(e){var t=[];if(null!=e)for(var r in Object(e))t.push(r);return t}},1167:function(e,t,r){e=r.nmd(e);var n=r(1957),i=t&&!t.nodeType&&t,a=i&&e&&!e.nodeType&&e,o=a&&a.exports===i&&n.process,s=function(){try{var e=a&&a.require&&a.require("util").types;return e||o&&o.binding&&o.binding("util")}catch(e){}}();e.exports=s},2333:function(e){var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},5569:function(e){e.exports=function(e,t){return function(r){return e(t(r))}}},5357:function(e,t,r){var n=r(6874),i=Math.max;e.exports=function(e,t,r){return t=i(void 0===t?e.length-1:t,0),function(){for(var a=arguments,o=-1,s=i(a.length-t,0),u=Array(s);++o<s;)u[o]=a[t+o];o=-1;for(var c=Array(t+1);++o<t;)c[o]=a[o];return c[t]=r(u),n(e,this,c)}}},292:function(e,t,r){var n=r(7786),i=r(4259);e.exports=function(e,t){return t.length<2?e:n(e,i(t,0,-1))}},2060:function(e){e.exports={}},451:function(e,t,r){var n=r(278),i=r(5776),a=Math.min;e.exports=function(e,t){for(var r=e.length,o=a(t.length,r),s=n(e);o--;){var u=t[o];e[o]=i(u,r)?s[u]:void 0}return e}},6460:function(e){var t="__lodash_placeholder__";e.exports=function(e,r){for(var n=-1,i=e.length,a=0,o=[];++n<i;){var s=e[n];s!==r&&s!==t||(e[n]=t,o[a++]=n)}return o}},5639:function(e,t,r){var n=r(1957),i="object"==typeof self&&self&&self.Object===Object&&self,a=n||i||Function("return this")();e.exports=a},6390:function(e){e.exports=function(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}},619:function(e){e.exports=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this}},2385:function(e){e.exports=function(e){return this.__data__.has(e)}},258:function(e,t,r){var n=r(8045),i=r(1275)(n);e.exports=i},1814:function(e){e.exports=function(e){var t=-1,r=Array(e.size);return e.forEach((function(e){r[++t]=e})),r}},61:function(e,t,r){var n=r(6560),i=r(1275)(n);e.exports=i},9255:function(e,t,r){var n=r(8775),i=r(3112),a=r(61),o=r(7241);e.exports=function(e,t,r){var s=t+"";return a(e,i(s,o(n(s),r)))}},1275:function(e){var t=Date.now;e.exports=function(e){var r=0,n=0;return function(){var i=t(),a=16-(i-n);if(n=i,a>0){if(++r>=800)return arguments[0]}else r=0;return e.apply(void 0,arguments)}}},7465:function(e,t,r){var n=r(8407);e.exports=function(){this.__data__=new n,this.size=0}},3779:function(e){e.exports=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}},7599:function(e){e.exports=function(e){return this.__data__.get(e)}},4758:function(e){e.exports=function(e){return this.__data__.has(e)}},4309:function(e,t,r){var n=r(8407),i=r(7071),a=r(3369);e.exports=function(e,t){var r=this.__data__;if(r instanceof n){var o=r.__data__;if(!i||o.length<199)return o.push([e,t]),this.size=++r.size,this;r=this.__data__=new a(o)}return r.set(e,t),this.size=r.size,this}},2351:function(e){e.exports=function(e,t,r){for(var n=r-1,i=e.length;++n<i;)if(e[n]===t)return n;return-1}},5514:function(e,t,r){var n=r(4523),i=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,a=/\\(\\)?/g,o=n((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(i,(function(e,r,n,i){t.push(n?i.replace(a,"$1"):r||e)})),t}));e.exports=o},327:function(e,t,r){var n=r(3448);e.exports=function(e){if("string"==typeof e||n(e))return e;var t=e+"";return"0"==t&&1/e==-Infinity?"-0":t}},346:function(e){var t=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return t.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},7241:function(e,t,r){var n=r(7412),i=r(7443),a=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]];e.exports=function(e,t){return n(a,(function(r){var n="_."+r[0];t&r[1]&&!i(e,n)&&e.push(n)})),e.sort()}},1913:function(e,t,r){var n=r(6425),i=r(7548),a=r(278);e.exports=function(e){if(e instanceof n)return e.clone();var t=new i(e.__wrapped__,e.__chain__);return t.__actions__=a(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}},8583:function(e,t,r){var n=r(4865),i=r(8363),a=r(1463),o=r(8612),s=r(5726),u=r(3674),c=Object.prototype.hasOwnProperty,l=a((function(e,t){if(s(t)||o(t))i(t,u(t),e);else for(var r in t)c.call(t,r)&&n(e,r,t[r])}));e.exports=l},6678:function(e,t,r){var n=r(5990);e.exports=function(e){return n(e,4)}},5703:function(e){e.exports=function(e){return function(){return e}}},7813:function(e){e.exports=function(e,t){return e===t||e!=e&&t!=t}},9873:function(e,t,r){var n=r(5082),i=r(6612);e.exports=function(e,t,r,a){var o=null==e?0:e.length;return o?(r&&"number"!=typeof r&&i(e,t,r)&&(r=0,a=o),n(e,t,r,a)):[]}},5564:function(e,t,r){var n=r(1078);e.exports=function(e){return(null==e?0:e.length)?n(e,1):[]}},9095:function(e,t,r){var n=r(13),i=r(222);e.exports=function(e,t){return null!=e&&i(e,t,n)}},6557:function(e){e.exports=function(e){return e}},5325:function(e,t,r){var n=r(9932),i=r(7556),a=r(5976),o=r(4387),s=a((function(e){var t=n(e,o);return t.length&&t[0]===e[0]?i(t):[]}));e.exports=s},5694:function(e,t,r){var n=r(9454),i=r(7005),a=Object.prototype,o=a.hasOwnProperty,s=a.propertyIsEnumerable,u=n(function(){return arguments}())?n:function(e){return i(e)&&o.call(e,"callee")&&!s.call(e,"callee")};e.exports=u},1469:function(e){var t=Array.isArray;e.exports=t},8612:function(e,t,r){var n=r(3560),i=r(1780);e.exports=function(e){return null!=e&&i(e.length)&&!n(e)}},9246:function(e,t,r){var n=r(8612),i=r(7005);e.exports=function(e){return i(e)&&n(e)}},4144:function(e,t,r){e=r.nmd(e);var n=r(5639),i=r(5062),a=t&&!t.nodeType&&t,o=a&&e&&!e.nodeType&&e,s=o&&o.exports===a?n.Buffer:void 0,u=(s?s.isBuffer:void 0)||i;e.exports=u},3560:function(e,t,r){var n=r(4239),i=r(3218);e.exports=function(e){if(!i(e))return!1;var t=n(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},1780:function(e){e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}},6688:function(e,t,r){var n=r(5588),i=r(1717),a=r(1167),o=a&&a.isMap,s=o?i(o):n;e.exports=s},3218:function(e){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},7005:function(e){e.exports=function(e){return null!=e&&"object"==typeof e}},8630:function(e,t,r){var n=r(4239),i=r(5924),a=r(7005),o=Function.prototype,s=Object.prototype,u=o.toString,c=s.hasOwnProperty,l=u.call(Object);e.exports=function(e){if(!a(e)||"[object Object]"!=n(e))return!1;var t=i(e);if(null===t)return!0;var r=c.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&u.call(r)==l}},2928:function(e,t,r){var n=r(9221),i=r(1717),a=r(1167),o=a&&a.isSet,s=o?i(o):n;e.exports=s},3448:function(e,t,r){var n=r(4239),i=r(7005);e.exports=function(e){return"symbol"==typeof e||i(e)&&"[object Symbol]"==n(e)}},6719:function(e,t,r){var n=r(8749),i=r(1717),a=r(1167),o=a&&a.isTypedArray,s=o?i(o):n;e.exports=s},3674:function(e,t,r){var n=r(4636),i=r(280),a=r(8612);e.exports=function(e){return a(e)?n(e):i(e)}},1704:function(e,t,r){var n=r(4636),i=r(313),a=r(8612);e.exports=function(e){return a(e)?n(e,!0):i(e)}},928:function(e){e.exports=function(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}},8306:function(e,t,r){var n=r(3369);function i(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var r=function(){var n=arguments,i=t?t.apply(this,n):n[0],a=r.cache;if(a.has(i))return a.get(i);var o=e.apply(this,n);return r.cache=a.set(i,o)||a,o};return r.cache=new(i.Cache||n),r}i.Cache=n,e.exports=i},2492:function(e,t,r){var n=r(2980),i=r(1463)((function(e,t,r){n(e,t,r)}));e.exports=i},308:function(e){e.exports=function(){}},7557:function(e,t,r){var n=r(9932),i=r(5990),a=r(7406),o=r(1811),s=r(8363),u=r(696),c=r(9021),l=r(6904),f=c((function(e,t){var r={};if(null==e)return r;var c=!1;t=n(t,(function(t){return t=o(t,e),c||(c=t.length>1),t})),s(e,l(e),r),c&&(r=i(r,7,u));for(var f=t.length;f--;)a(r,t[f]);return r}));e.exports=f},5544:function(e,t,r){var n=r(5976),i=r(7727),a=r(893),o=r(6460),s=n((function(e,t){var r=o(t,a(s));return i(e,64,void 0,t,r)}));s.placeholder={},e.exports=s},8718:function(e,t,r){var n=r(5970),i=r(9021)((function(e,t){return null==e?{}:n(e,t)}));e.exports=i},479:function(e){e.exports=function(){return[]}},5062:function(e){e.exports=function(){return!1}},8601:function(e,t,r){var n=r(4841),i=1/0;e.exports=function(e){return e?(e=n(e))===i||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}},554:function(e,t,r){var n=r(8601);e.exports=function(e){var t=n(e),r=t%1;return t==t?r?t-r:t:0}},8958:function(e,t,r){var n=r(9750),i=r(554);e.exports=function(e){return e?n(i(e),0,4294967295):0}},4841:function(e,t,r){var n=r(3218),i=r(3448),a=/^\s+|\s+$/g,o=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,u=/^0o[0-7]+$/i,c=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(i(e))return NaN;if(n(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=n(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(a,"");var r=s.test(e);return r||u.test(e)?c(e.slice(2),r?2:8):o.test(e)?NaN:+e}},9881:function(e,t,r){var n=r(8363),i=r(1704);e.exports=function(e){return n(e,i(e))}},9833:function(e,t,r){var n=r(531);e.exports=function(e){return null==e?"":n(e)}},4908:function(e,t,r){var n=r(5652);e.exports=function(e){return e&&e.length?n(e):[]}},8111:function(e,t,r){var n=r(6425),i=r(7548),a=r(9435),o=r(1469),s=r(7005),u=r(1913),c=Object.prototype.hasOwnProperty;function l(e){if(s(e)&&!o(e)&&!(e instanceof n)){if(e instanceof i)return e;if(c.call(e,"__wrapped__"))return u(e)}return new i(e)}l.prototype=a.prototype,l.prototype.constructor=l,e.exports=l},3720:function(e){e.exports=r;var t=null;try{t=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch(e){}function r(e,t,r){this.low=0|e,this.high=0|t,this.unsigned=!!r}function n(e){return!0===(e&&e.__isLong__)}r.prototype.__isLong__,Object.defineProperty(r.prototype,"__isLong__",{value:!0}),r.isLong=n;var i={},a={};function o(e,t){var r,n,o;return t?(o=0<=(e>>>=0)&&e<256)&&(n=a[e])?n:(r=u(e,(0|e)<0?-1:0,!0),o&&(a[e]=r),r):(o=-128<=(e|=0)&&e<128)&&(n=i[e])?n:(r=u(e,e<0?-1:0,!1),o&&(i[e]=r),r)}function s(e,t){if(isNaN(e))return t?g:v;if(t){if(e<0)return g;if(e>=p)return C}else{if(e<=-d)return w;if(e+1>=d)return S}return e<0?s(-e,t).neg():u(e%h|0,e/h|0,t)}function u(e,t,n){return new r(e,t,n)}r.fromInt=o,r.fromNumber=s,r.fromBits=u;var c=Math.pow;function l(e,t,r){if(0===e.length)throw Error("empty string");if("NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return v;if("number"==typeof t?(r=t,t=!1):t=!!t,(r=r||10)<2||36<r)throw RangeError("radix");var n;if((n=e.indexOf("-"))>0)throw Error("interior hyphen");if(0===n)return l(e.substring(1),t,r).neg();for(var i=s(c(r,8)),a=v,o=0;o<e.length;o+=8){var u=Math.min(8,e.length-o),f=parseInt(e.substring(o,o+u),r);if(u<8){var h=s(c(r,u));a=a.mul(h).add(s(f))}else a=(a=a.mul(i)).add(s(f))}return a.unsigned=t,a}function f(e,t){return"number"==typeof e?s(e,t):"string"==typeof e?l(e,t):u(e.low,e.high,"boolean"==typeof t?t:e.unsigned)}r.fromString=l,r.fromValue=f;var h=4294967296,p=h*h,d=p/2,y=o(1<<24),v=o(0);r.ZERO=v;var g=o(0,!0);r.UZERO=g;var m=o(1);r.ONE=m;var b=o(1,!0);r.UONE=b;var E=o(-1);r.NEG_ONE=E;var S=u(-1,2147483647,!1);r.MAX_VALUE=S;var C=u(-1,-1,!0);r.MAX_UNSIGNED_VALUE=C;var w=u(0,-2147483648,!1);r.MIN_VALUE=w;var T=r.prototype;T.toInt=function(){return this.unsigned?this.low>>>0:this.low},T.toNumber=function(){return this.unsigned?(this.high>>>0)*h+(this.low>>>0):this.high*h+(this.low>>>0)},T.toString=function(e){if((e=e||10)<2||36<e)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative()){if(this.eq(w)){var t=s(e),r=this.div(t),n=r.mul(t).sub(this);return r.toString(e)+n.toInt().toString(e)}return"-"+this.neg().toString(e)}for(var i=s(c(e,6),this.unsigned),a=this,o="";;){var u=a.div(i),l=(a.sub(u.mul(i)).toInt()>>>0).toString(e);if((a=u).isZero())return l+o;for(;l.length<6;)l="0"+l;o=""+l+o}},T.getHighBits=function(){return this.high},T.getHighBitsUnsigned=function(){return this.high>>>0},T.getLowBits=function(){return this.low},T.getLowBitsUnsigned=function(){return this.low>>>0},T.getNumBitsAbs=function(){if(this.isNegative())return this.eq(w)?64:this.neg().getNumBitsAbs();for(var e=0!=this.high?this.high:this.low,t=31;t>0&&0==(e&1<<t);t--);return 0!=this.high?t+33:t+1},T.isZero=function(){return 0===this.high&&0===this.low},T.eqz=T.isZero,T.isNegative=function(){return!this.unsigned&&this.high<0},T.isPositive=function(){return this.unsigned||this.high>=0},T.isOdd=function(){return 1==(1&this.low)},T.isEven=function(){return 0==(1&this.low)},T.equals=function(e){return n(e)||(e=f(e)),(this.unsigned===e.unsigned||this.high>>>31!=1||e.high>>>31!=1)&&(this.high===e.high&&this.low===e.low)},T.eq=T.equals,T.notEquals=function(e){return!this.eq(e)},T.neq=T.notEquals,T.ne=T.notEquals,T.lessThan=function(e){return this.comp(e)<0},T.lt=T.lessThan,T.lessThanOrEqual=function(e){return this.comp(e)<=0},T.lte=T.lessThanOrEqual,T.le=T.lessThanOrEqual,T.greaterThan=function(e){return this.comp(e)>0},T.gt=T.greaterThan,T.greaterThanOrEqual=function(e){return this.comp(e)>=0},T.gte=T.greaterThanOrEqual,T.ge=T.greaterThanOrEqual,T.compare=function(e){if(n(e)||(e=f(e)),this.eq(e))return 0;var t=this.isNegative(),r=e.isNegative();return t&&!r?-1:!t&&r?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1},T.comp=T.compare,T.negate=function(){return!this.unsigned&&this.eq(w)?w:this.not().add(m)},T.neg=T.negate,T.add=function(e){n(e)||(e=f(e));var t=this.high>>>16,r=65535&this.high,i=this.low>>>16,a=65535&this.low,o=e.high>>>16,s=65535&e.high,c=e.low>>>16,l=0,h=0,p=0,d=0;return p+=(d+=a+(65535&e.low))>>>16,h+=(p+=i+c)>>>16,l+=(h+=r+s)>>>16,l+=t+o,u((p&=65535)<<16|(d&=65535),(l&=65535)<<16|(h&=65535),this.unsigned)},T.subtract=function(e){return n(e)||(e=f(e)),this.add(e.neg())},T.sub=T.subtract,T.multiply=function(e){if(this.isZero())return v;if(n(e)||(e=f(e)),t)return u(t.mul(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned);if(e.isZero())return v;if(this.eq(w))return e.isOdd()?w:v;if(e.eq(w))return this.isOdd()?w:v;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(y)&&e.lt(y))return s(this.toNumber()*e.toNumber(),this.unsigned);var r=this.high>>>16,i=65535&this.high,a=this.low>>>16,o=65535&this.low,c=e.high>>>16,l=65535&e.high,h=e.low>>>16,p=65535&e.low,d=0,g=0,m=0,b=0;return m+=(b+=o*p)>>>16,g+=(m+=a*p)>>>16,m&=65535,g+=(m+=o*h)>>>16,d+=(g+=i*p)>>>16,g&=65535,d+=(g+=a*h)>>>16,g&=65535,d+=(g+=o*l)>>>16,d+=r*p+i*h+a*l+o*c,u((m&=65535)<<16|(b&=65535),(d&=65535)<<16|(g&=65535),this.unsigned)},T.mul=T.multiply,T.divide=function(e){if(n(e)||(e=f(e)),e.isZero())throw Error("division by zero");var r,i,a;if(t)return this.unsigned||-2147483648!==this.high||-1!==e.low||-1!==e.high?u((this.unsigned?t.div_u:t.div_s)(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned):this;if(this.isZero())return this.unsigned?g:v;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return g;if(e.gt(this.shru(1)))return b;a=g}else{if(this.eq(w))return e.eq(m)||e.eq(E)?w:e.eq(w)?m:(r=this.shr(1).div(e).shl(1)).eq(v)?e.isNegative()?m:E:(i=this.sub(e.mul(r)),a=r.add(i.div(e)));if(e.eq(w))return this.unsigned?g:v;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();a=v}for(i=this;i.gte(e);){r=Math.max(1,Math.floor(i.toNumber()/e.toNumber()));for(var o=Math.ceil(Math.log(r)/Math.LN2),l=o<=48?1:c(2,o-48),h=s(r),p=h.mul(e);p.isNegative()||p.gt(i);)p=(h=s(r-=l,this.unsigned)).mul(e);h.isZero()&&(h=m),a=a.add(h),i=i.sub(p)}return a},T.div=T.divide,T.modulo=function(e){return n(e)||(e=f(e)),t?u((this.unsigned?t.rem_u:t.rem_s)(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned):this.sub(this.div(e).mul(e))},T.mod=T.modulo,T.rem=T.modulo,T.not=function(){return u(~this.low,~this.high,this.unsigned)},T.and=function(e){return n(e)||(e=f(e)),u(this.low&e.low,this.high&e.high,this.unsigned)},T.or=function(e){return n(e)||(e=f(e)),u(this.low|e.low,this.high|e.high,this.unsigned)},T.xor=function(e){return n(e)||(e=f(e)),u(this.low^e.low,this.high^e.high,this.unsigned)},T.shiftLeft=function(e){return n(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?u(this.low<<e,this.high<<e|this.low>>>32-e,this.unsigned):u(0,this.low<<e-32,this.unsigned)},T.shl=T.shiftLeft,T.shiftRight=function(e){return n(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?u(this.low>>>e|this.high<<32-e,this.high>>e,this.unsigned):u(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},T.shr=T.shiftRight,T.shiftRightUnsigned=function(e){if(n(e)&&(e=e.toInt()),0===(e&=63))return this;var t=this.high;return e<32?u(this.low>>>e|t<<32-e,t>>>e,this.unsigned):u(32===e?t:t>>>e-32,0,this.unsigned)},T.shru=T.shiftRightUnsigned,T.shr_u=T.shiftRightUnsigned,T.toSigned=function(){return this.unsigned?u(this.low,this.high,!1):this},T.toUnsigned=function(){return this.unsigned?this:u(this.low,this.high,!0)},T.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},T.toBytesLE=function(){var e=this.high,t=this.low;return[255&t,t>>>8&255,t>>>16&255,t>>>24,255&e,e>>>8&255,e>>>16&255,e>>>24]},T.toBytesBE=function(){var e=this.high,t=this.low;return[e>>>24,e>>>16&255,e>>>8&255,255&e,t>>>24,t>>>16&255,t>>>8&255,255&t]},r.fromBytes=function(e,t,n){return n?r.fromBytesLE(e,t):r.fromBytesBE(e,t)},r.fromBytesLE=function(e,t){return new r(e[0]|e[1]<<8|e[2]<<16|e[3]<<24,e[4]|e[5]<<8|e[6]<<16|e[7]<<24,t)},r.fromBytesBE=function(e,t){return new r(e[4]<<24|e[5]<<16|e[6]<<8|e[7],e[0]<<24|e[1]<<16|e[2]<<8|e[3],t)}},8925:function(e,t,r){var n=r(3832);function i(e,t){n.cipher.registerAlgorithm(e,(function(){return new n.aes.Algorithm(e,t)}))}r(5649),r(1967),r(7116),e.exports=n.aes=n.aes||{},n.aes.startEncrypting=function(e,t,r,n){var i=d({key:e,output:r,decrypt:!1,mode:n});return i.start(t),i},n.aes.createEncryptionCipher=function(e,t){return d({key:e,output:null,decrypt:!1,mode:t})},n.aes.startDecrypting=function(e,t,r,n){var i=d({key:e,output:r,decrypt:!0,mode:n});return i.start(t),i},n.aes.createDecryptionCipher=function(e,t){return d({key:e,output:null,decrypt:!0,mode:t})},n.aes.Algorithm=function(e,t){l||f();var r=this;r.name=e,r.mode=new t({blockSize:16,cipher:{encrypt:function(e,t){return p(r._w,e,t,!1)},decrypt:function(e,t){return p(r._w,e,t,!0)}}}),r._init=!1},n.aes.Algorithm.prototype.initialize=function(e){if(!this._init){var t,r=e.key;if("string"!=typeof r||16!==r.length&&24!==r.length&&32!==r.length){if(n.util.isArray(r)&&(16===r.length||24===r.length||32===r.length)){t=r,r=n.util.createBuffer();for(var i=0;i<t.length;++i)r.putByte(t[i])}}else r=n.util.createBuffer(r);if(!n.util.isArray(r)){t=r,r=[];var a=t.length();if(16===a||24===a||32===a){a>>>=2;for(i=0;i<a;++i)r.push(t.getInt32())}}if(!n.util.isArray(r)||4!==r.length&&6!==r.length&&8!==r.length)throw new Error("Invalid key parameter.");var o=this.mode.name,s=-1!==["CFB","OFB","CTR","GCM"].indexOf(o);this._w=h(r,e.decrypt&&!s),this._init=!0}},n.aes._expandKey=function(e,t){return l||f(),h(e,t)},n.aes._updateBlock=p,i("AES-ECB",n.cipher.modes.ecb),i("AES-CBC",n.cipher.modes.cbc),i("AES-CFB",n.cipher.modes.cfb),i("AES-OFB",n.cipher.modes.ofb),i("AES-CTR",n.cipher.modes.ctr),i("AES-GCM",n.cipher.modes.gcm);var a,o,s,u,c,l=!1;function f(){l=!0,s=[0,1,2,4,8,16,32,64,128,27,54];for(var e=new Array(256),t=0;t<128;++t)e[t]=t<<1,e[t+128]=t+128<<1^283;a=new Array(256),o=new Array(256),u=new Array(4),c=new Array(4);for(t=0;t<4;++t)u[t]=new Array(256),c[t]=new Array(256);var r,n,i,f,h,p,d,y=0,v=0;for(t=0;t<256;++t){f=(f=v^v<<1^v<<2^v<<3^v<<4)>>8^255&f^99,a[y]=f,o[f]=y,p=(h=e[f])<<24^f<<16^f<<8^f^h,d=((r=e[y])^(n=e[r])^(i=e[n]))<<24^(y^i)<<16^(y^n^i)<<8^y^r^i;for(var g=0;g<4;++g)u[g][y]=p,c[g][f]=d,p=p<<24|p>>>8,d=d<<24|d>>>8;0===y?y=v=1:(y=r^e[e[e[r^i]]],v^=e[e[v]])}}function h(e,t){for(var r,n=e.slice(0),i=1,o=n.length,u=4*(o+6+1),l=o;l<u;++l)r=n[l-1],l%o==0?(r=a[r>>>16&255]<<24^a[r>>>8&255]<<16^a[255&r]<<8^a[r>>>24]^s[i]<<24,i++):o>6&&l%o==4&&(r=a[r>>>24]<<24^a[r>>>16&255]<<16^a[r>>>8&255]<<8^a[255&r]),n[l]=n[l-o]^r;if(t){for(var f,h=c[0],p=c[1],d=c[2],y=c[3],v=n.slice(0),g=(l=0,(u=n.length)-4);l<u;l+=4,g-=4)if(0===l||l===u-4)v[l]=n[g],v[l+1]=n[g+3],v[l+2]=n[g+2],v[l+3]=n[g+1];else for(var m=0;m<4;++m)f=n[g+m],v[l+(3&-m)]=h[a[f>>>24]]^p[a[f>>>16&255]]^d[a[f>>>8&255]]^y[a[255&f]];n=v}return n}function p(e,t,r,n){var i,s,l,f,h,p,d,y,v,g,m,b,E=e.length/4-1;n?(i=c[0],s=c[1],l=c[2],f=c[3],h=o):(i=u[0],s=u[1],l=u[2],f=u[3],h=a),p=t[0]^e[0],d=t[n?3:1]^e[1],y=t[2]^e[2],v=t[n?1:3]^e[3];for(var S=3,C=1;C<E;++C)g=i[p>>>24]^s[d>>>16&255]^l[y>>>8&255]^f[255&v]^e[++S],m=i[d>>>24]^s[y>>>16&255]^l[v>>>8&255]^f[255&p]^e[++S],b=i[y>>>24]^s[v>>>16&255]^l[p>>>8&255]^f[255&d]^e[++S],v=i[v>>>24]^s[p>>>16&255]^l[d>>>8&255]^f[255&y]^e[++S],p=g,d=m,y=b;r[0]=h[p>>>24]<<24^h[d>>>16&255]<<16^h[y>>>8&255]<<8^h[255&v]^e[++S],r[n?3:1]=h[d>>>24]<<24^h[y>>>16&255]<<16^h[v>>>8&255]<<8^h[255&p]^e[++S],r[2]=h[y>>>24]<<24^h[v>>>16&255]<<16^h[p>>>8&255]<<8^h[255&d]^e[++S],r[n?1:3]=h[v>>>24]<<24^h[p>>>16&255]<<16^h[d>>>8&255]<<8^h[255&y]^e[++S]}function d(e){var t,r="AES-"+((e=e||{}).mode||"CBC").toUpperCase(),i=(t=e.decrypt?n.cipher.createDecipher(r,e.key):n.cipher.createCipher(r,e.key)).start;return t.start=function(e,r){var a=null;r instanceof n.util.ByteBuffer&&(a=r,r={}),(r=r||{}).output=a,r.iv=e,i.call(t,r)},t}},3068:function(e,t,r){var n=r(3832);r(7116),r(6270);var i=e.exports=n.asn1=n.asn1||{};function a(e,t,r){if(r>t){var n=new Error("Too few bytes to parse DER.");throw n.available=e.length(),n.remaining=t,n.requested=r,n}}i.Class={UNIVERSAL:0,APPLICATION:64,CONTEXT_SPECIFIC:128,PRIVATE:192},i.Type={NONE:0,BOOLEAN:1,INTEGER:2,BITSTRING:3,OCTETSTRING:4,NULL:5,OID:6,ODESC:7,EXTERNAL:8,REAL:9,ENUMERATED:10,EMBEDDED:11,UTF8:12,ROID:13,SEQUENCE:16,SET:17,PRINTABLESTRING:19,IA5STRING:22,UTCTIME:23,GENERALIZEDTIME:24,BMPSTRING:30},i.create=function(e,t,r,a,o){if(n.util.isArray(a)){for(var s=[],u=0;u<a.length;++u)void 0!==a[u]&&s.push(a[u]);a=s}var c={tagClass:e,type:t,constructed:r,composed:r||n.util.isArray(a),value:a};return o&&"bitStringContents"in o&&(c.bitStringContents=o.bitStringContents,c.original=i.copy(c)),c},i.copy=function(e,t){var r;if(n.util.isArray(e)){r=[];for(var a=0;a<e.length;++a)r.push(i.copy(e[a],t));return r}return"string"==typeof e?e:(r={tagClass:e.tagClass,type:e.type,constructed:e.constructed,composed:e.composed,value:i.copy(e.value,t)},t&&!t.excludeBitStringContents&&(r.bitStringContents=e.bitStringContents),r)},i.equals=function(e,t,r){if(n.util.isArray(e)){if(!n.util.isArray(t))return!1;if(e.length!==t.length)return!1;for(var a=0;a<e.length;++a)if(!i.equals(e[a],t[a]))return!1;return!0}if(typeof e!=typeof t)return!1;if("string"==typeof e)return e===t;var o=e.tagClass===t.tagClass&&e.type===t.type&&e.constructed===t.constructed&&e.composed===t.composed&&i.equals(e.value,t.value);return r&&r.includeBitStringContents&&(o=o&&e.bitStringContents===t.bitStringContents),o},i.getBerValueLength=function(e){var t=e.getByte();if(128!==t)return 128&t?e.getInt((127&t)<<3):t};function o(e,t,r,n){var s;a(e,t,2);var u=e.getByte();t--;var c=192&u,l=31&u;s=e.length();var f,h,p=function(e,t){var r=e.getByte();if(t--,128!==r){var n;if(128&r){var i=127&r;a(e,t,i),n=e.getInt(i<<3)}else n=r;if(n<0)throw new Error("Negative length: "+n);return n}}(e,t);if(t-=s-e.length(),void 0!==p&&p>t){if(n.strict){var d=new Error("Too few bytes to read ASN.1 value.");throw d.available=e.length(),d.remaining=t,d.requested=p,d}p=t}var y=32==(32&u);if(y)if(f=[],void 0===p)for(;;){if(a(e,t,2),e.bytes(2)===String.fromCharCode(0,0)){e.getBytes(2),t-=2;break}s=e.length(),f.push(o(e,t,r+1,n)),t-=s-e.length()}else for(;p>0;)s=e.length(),f.push(o(e,p,r+1,n)),t-=s-e.length(),p-=s-e.length();if(void 0===f&&c===i.Class.UNIVERSAL&&l===i.Type.BITSTRING&&(h=e.bytes(p)),void 0===f&&n.decodeBitStrings&&c===i.Class.UNIVERSAL&&l===i.Type.BITSTRING&&p>1){var v=e.read,g=t,m=0;if(l===i.Type.BITSTRING&&(a(e,t,1),m=e.getByte(),t--),0===m)try{s=e.length();var b=o(e,t,r+1,{verbose:n.verbose,strict:!0,decodeBitStrings:!0}),E=s-e.length();t-=E,l==i.Type.BITSTRING&&E++;var S=b.tagClass;E!==p||S!==i.Class.UNIVERSAL&&S!==i.Class.CONTEXT_SPECIFIC||(f=[b])}catch(e){}void 0===f&&(e.read=v,t=g)}if(void 0===f){if(void 0===p){if(n.strict)throw new Error("Non-constructed ASN.1 object of indefinite length.");p=t}if(l===i.Type.BMPSTRING)for(f="";p>0;p-=2)a(e,t,2),f+=String.fromCharCode(e.getInt16()),t-=2;else f=e.getBytes(p)}var C=void 0===h?null:{bitStringContents:h};return i.create(c,l,y,f,C)}i.fromDer=function(e,t){return void 0===t&&(t={strict:!0,decodeBitStrings:!0}),"boolean"==typeof t&&(t={strict:t,decodeBitStrings:!0}),"strict"in t||(t.strict=!0),"decodeBitStrings"in t||(t.decodeBitStrings=!0),"string"==typeof e&&(e=n.util.createBuffer(e)),o(e,e.length(),0,t)},i.toDer=function(e){var t=n.util.createBuffer(),r=e.tagClass|e.type,a=n.util.createBuffer(),o=!1;if("bitStringContents"in e&&(o=!0,e.original&&(o=i.equals(e,e.original))),o)a.putBytes(e.bitStringContents);else if(e.composed){e.constructed?r|=32:a.putByte(0);for(var s=0;s<e.value.length;++s)void 0!==e.value[s]&&a.putBuffer(i.toDer(e.value[s]))}else if(e.type===i.Type.BMPSTRING)for(s=0;s<e.value.length;++s)a.putInt16(e.value.charCodeAt(s));else e.type===i.Type.INTEGER&&e.value.length>1&&(0===e.value.charCodeAt(0)&&0==(128&e.value.charCodeAt(1))||255===e.value.charCodeAt(0)&&128==(128&e.value.charCodeAt(1)))?a.putBytes(e.value.substr(1)):a.putBytes(e.value);if(t.putByte(r),a.length()<=127)t.putByte(127&a.length());else{var u=a.length(),c="";do{c+=String.fromCharCode(255&u),u>>>=8}while(u>0);t.putByte(128|c.length);for(s=c.length-1;s>=0;--s)t.putByte(c.charCodeAt(s))}return t.putBuffer(a),t},i.oidToDer=function(e){var t,r,i,a,o=e.split("."),s=n.util.createBuffer();s.putByte(40*parseInt(o[0],10)+parseInt(o[1],10));for(var u=2;u<o.length;++u){t=!0,r=[],i=parseInt(o[u],10);do{a=127&i,i>>>=7,t||(a|=128),r.push(a),t=!1}while(i>0);for(var c=r.length-1;c>=0;--c)s.putByte(r[c])}return s},i.derToOid=function(e){var t;"string"==typeof e&&(e=n.util.createBuffer(e));var r=e.getByte();t=Math.floor(r/40)+"."+r%40;for(var i=0;e.length()>0;)i<<=7,128&(r=e.getByte())?i+=127&r:(t+="."+(i+r),i=0);return t},i.utcTimeToDate=function(e){var t=new Date,r=parseInt(e.substr(0,2),10);r=r>=50?1900+r:2e3+r;var n=parseInt(e.substr(2,2),10)-1,i=parseInt(e.substr(4,2),10),a=parseInt(e.substr(6,2),10),o=parseInt(e.substr(8,2),10),s=0;if(e.length>11){var u=e.charAt(10),c=10;"+"!==u&&"-"!==u&&(s=parseInt(e.substr(10,2),10),c+=2)}if(t.setUTCFullYear(r,n,i),t.setUTCHours(a,o,s,0),c&&("+"===(u=e.charAt(c))||"-"===u)){var l=60*parseInt(e.substr(c+1,2),10)+parseInt(e.substr(c+4,2),10);l*=6e4,"+"===u?t.setTime(+t-l):t.setTime(+t+l)}return t},i.generalizedTimeToDate=function(e){var t=new Date,r=parseInt(e.substr(0,4),10),n=parseInt(e.substr(4,2),10)-1,i=parseInt(e.substr(6,2),10),a=parseInt(e.substr(8,2),10),o=parseInt(e.substr(10,2),10),s=parseInt(e.substr(12,2),10),u=0,c=0,l=!1;"Z"===e.charAt(e.length-1)&&(l=!0);var f=e.length-5,h=e.charAt(f);"+"!==h&&"-"!==h||(c=60*parseInt(e.substr(f+1,2),10)+parseInt(e.substr(f+4,2),10),c*=6e4,"+"===h&&(c*=-1),l=!0);return"."===e.charAt(14)&&(u=1e3*parseFloat(e.substr(14),10)),l?(t.setUTCFullYear(r,n,i),t.setUTCHours(a,o,s,u),t.setTime(+t+c)):(t.setFullYear(r,n,i),t.setHours(a,o,s,u)),t},i.dateToUtcTime=function(e){if("string"==typeof e)return e;var t="",r=[];r.push((""+e.getUTCFullYear()).substr(2)),r.push(""+(e.getUTCMonth()+1)),r.push(""+e.getUTCDate()),r.push(""+e.getUTCHours()),r.push(""+e.getUTCMinutes()),r.push(""+e.getUTCSeconds());for(var n=0;n<r.length;++n)r[n].length<2&&(t+="0"),t+=r[n];return t+="Z"},i.dateToGeneralizedTime=function(e){if("string"==typeof e)return e;var t="",r=[];r.push(""+e.getUTCFullYear()),r.push(""+(e.getUTCMonth()+1)),r.push(""+e.getUTCDate()),r.push(""+e.getUTCHours()),r.push(""+e.getUTCMinutes()),r.push(""+e.getUTCSeconds());for(var n=0;n<r.length;++n)r[n].length<2&&(t+="0"),t+=r[n];return t+="Z"},i.integerToDer=function(e){var t=n.util.createBuffer();if(e>=-128&&e<128)return t.putSignedInt(e,8);if(e>=-32768&&e<32768)return t.putSignedInt(e,16);if(e>=-8388608&&e<8388608)return t.putSignedInt(e,24);if(e>=-2147483648&&e<2147483648)return t.putSignedInt(e,32);var r=new Error("Integer too large; max is 32-bits.");throw r.integer=e,r},i.derToInteger=function(e){"string"==typeof e&&(e=n.util.createBuffer(e));var t=8*e.length();if(t>32)throw new Error("Integer too large; max is 32-bits.");return e.getSignedInt(t)},i.validate=function(e,t,r,a){var o=!1;if(e.tagClass!==t.tagClass&&void 0!==t.tagClass||e.type!==t.type&&void 0!==t.type)a&&(e.tagClass!==t.tagClass&&a.push("["+t.name+'] Expected tag class "'+t.tagClass+'", got "'+e.tagClass+'"'),e.type!==t.type&&a.push("["+t.name+'] Expected type "'+t.type+'", got "'+e.type+'"'));else if(e.constructed===t.constructed||void 0===t.constructed){if(o=!0,t.value&&n.util.isArray(t.value))for(var s=0,u=0;o&&u<t.value.length;++u)o=t.value[u].optional||!1,e.value[s]&&((o=i.validate(e.value[s],t.value[u],r,a))?++s:t.value[u].optional&&(o=!0)),!o&&a&&a.push("["+t.name+'] Tag class "'+t.tagClass+'", type "'+t.type+'" expected value length "'+t.value.length+'", got "'+e.value.length+'"');if(o&&r)if(t.capture&&(r[t.capture]=e.value),t.captureAsn1&&(r[t.captureAsn1]=e),t.captureBitStringContents&&"bitStringContents"in e&&(r[t.captureBitStringContents]=e.bitStringContents),t.captureBitStringValue&&"bitStringContents"in e)if(e.bitStringContents.length<2)r[t.captureBitStringValue]="";else{if(0!==e.bitStringContents.charCodeAt(0))throw new Error("captureBitStringValue only supported for zero unused bits");r[t.captureBitStringValue]=e.bitStringContents.slice(1)}}else a&&a.push("["+t.name+'] Expected constructed "'+t.constructed+'", got "'+e.constructed+'"');return o};var s=/[^\\u0000-\\u00ff]/;i.prettyPrint=function(e,t,r){var a="";r=r||2,(t=t||0)>0&&(a+="\n");for(var o="",u=0;u<t*r;++u)o+=" ";switch(a+=o+"Tag: ",e.tagClass){case i.Class.UNIVERSAL:a+="Universal:";break;case i.Class.APPLICATION:a+="Application:";break;case i.Class.CONTEXT_SPECIFIC:a+="Context-Specific:";break;case i.Class.PRIVATE:a+="Private:"}if(e.tagClass===i.Class.UNIVERSAL)switch(a+=e.type,e.type){case i.Type.NONE:a+=" (None)";break;case i.Type.BOOLEAN:a+=" (Boolean)";break;case i.Type.INTEGER:a+=" (Integer)";break;case i.Type.BITSTRING:a+=" (Bit string)";break;case i.Type.OCTETSTRING:a+=" (Octet string)";break;case i.Type.NULL:a+=" (Null)";break;case i.Type.OID:a+=" (Object Identifier)";break;case i.Type.ODESC:a+=" (Object Descriptor)";break;case i.Type.EXTERNAL:a+=" (External or Instance of)";break;case i.Type.REAL:a+=" (Real)";break;case i.Type.ENUMERATED:a+=" (Enumerated)";break;case i.Type.EMBEDDED:a+=" (Embedded PDV)";break;case i.Type.UTF8:a+=" (UTF8)";break;case i.Type.ROID:a+=" (Relative Object Identifier)";break;case i.Type.SEQUENCE:a+=" (Sequence)";break;case i.Type.SET:a+=" (Set)";break;case i.Type.PRINTABLESTRING:a+=" (Printable String)";break;case i.Type.IA5String:a+=" (IA5String (ASCII))";break;case i.Type.UTCTIME:a+=" (UTC time)";break;case i.Type.GENERALIZEDTIME:a+=" (Generalized time)";break;case i.Type.BMPSTRING:a+=" (BMP String)"}else a+=e.type;if(a+="\n",a+=o+"Constructed: "+e.constructed+"\n",e.composed){var c=0,l="";for(u=0;u<e.value.length;++u)void 0!==e.value[u]&&(c+=1,l+=i.prettyPrint(e.value[u],t+1,r),u+1<e.value.length&&(l+=","));a+=o+"Sub values: "+c+l}else{if(a+=o+"Value: ",e.type===i.Type.OID){var f=i.derToOid(e.value);a+=f,n.pki&&n.pki.oids&&f in n.pki.oids&&(a+=" ("+n.pki.oids[f]+") ")}if(e.type===i.Type.INTEGER)try{a+=i.derToInteger(e.value)}catch(t){a+="0x"+n.util.bytesToHex(e.value)}else if(e.type===i.Type.BITSTRING){if(e.value.length>1?a+="0x"+n.util.bytesToHex(e.value.slice(1)):a+="(none)",e.value.length>0){var h=e.value.charCodeAt(0);1==h?a+=" (1 unused bit shown)":h>1&&(a+=" ("+h+" unused bits shown)")}}else e.type===i.Type.OCTETSTRING?(s.test(e.value)||(a+="("+e.value+") "),a+="0x"+n.util.bytesToHex(e.value)):e.type===i.Type.UTF8?a+=n.util.decodeUtf8(e.value):e.type===i.Type.PRINTABLESTRING||e.type===i.Type.IA5String?a+=e.value:s.test(e.value)?a+="0x"+n.util.bytesToHex(e.value):0===e.value.length?a+="[null]":a+=e.value}return a}},8807:function(e){var t={};e.exports=t;var r={};t.encode=function(e,t,r){if("string"!=typeof t)throw new TypeError('"alphabet" must be a string.');if(void 0!==r&&"number"!=typeof r)throw new TypeError('"maxline" must be a number.');var n="";if(e instanceof Uint8Array){var i=0,a=t.length,o=t.charAt(0),s=[0];for(i=0;i<e.length;++i){for(var u=0,c=e[i];u<s.length;++u)c+=s[u]<<8,s[u]=c%a,c=c/a|0;for(;c>0;)s.push(c%a),c=c/a|0}for(i=0;0===e[i]&&i<e.length-1;++i)n+=o;for(i=s.length-1;i>=0;--i)n+=t[s[i]]}else n=function(e,t){var r=0,n=t.length,i=t.charAt(0),a=[0];for(r=0;r<e.length();++r){for(var o=0,s=e.at(r);o<a.length;++o)s+=a[o]<<8,a[o]=s%n,s=s/n|0;for(;s>0;)a.push(s%n),s=s/n|0}var u="";for(r=0;0===e.at(r)&&r<e.length()-1;++r)u+=i;for(r=a.length-1;r>=0;--r)u+=t[a[r]];return u}(e,t);if(r){var l=new RegExp(".{1,"+r+"}","g");n=n.match(l).join("\r\n")}return n},t.decode=function(e,t){if("string"!=typeof e)throw new TypeError('"input" must be a string.');if("string"!=typeof t)throw new TypeError('"alphabet" must be a string.');var n=r[t];if(!n){n=r[t]=[];for(var i=0;i<t.length;++i)n[t.charCodeAt(i)]=i}e=e.replace(/\s/g,"");var a=t.length,o=t.charAt(0),s=[0];for(i=0;i<e.length;i++){var u=n[e.charCodeAt(i)];if(void 0===u)return;for(var c=0,l=u;c<s.length;++c)l+=s[c]*a,s[c]=255&l,l>>=8;for(;l>0;)s.push(255&l),l>>=8}for(var f=0;e[f]===o&&f<e.length-1;++f)s.push(0);return"undefined"!=typeof Buffer?Buffer.from(s.reverse()):new Uint8Array(s.reverse())}},5649:function(e,t,r){var n=r(3832);r(7116),e.exports=n.cipher=n.cipher||{},n.cipher.algorithms=n.cipher.algorithms||{},n.cipher.createCipher=function(e,t){var r=e;if("string"==typeof r&&(r=n.cipher.getAlgorithm(r))&&(r=r()),!r)throw new Error("Unsupported algorithm: "+e);return new n.cipher.BlockCipher({algorithm:r,key:t,decrypt:!1})},n.cipher.createDecipher=function(e,t){var r=e;if("string"==typeof r&&(r=n.cipher.getAlgorithm(r))&&(r=r()),!r)throw new Error("Unsupported algorithm: "+e);return new n.cipher.BlockCipher({algorithm:r,key:t,decrypt:!0})},n.cipher.registerAlgorithm=function(e,t){e=e.toUpperCase(),n.cipher.algorithms[e]=t},n.cipher.getAlgorithm=function(e){return(e=e.toUpperCase())in n.cipher.algorithms?n.cipher.algorithms[e]:null};var i=n.cipher.BlockCipher=function(e){this.algorithm=e.algorithm,this.mode=this.algorithm.mode,this.blockSize=this.mode.blockSize,this._finish=!1,this._input=null,this.output=null,this._op=e.decrypt?this.mode.decrypt:this.mode.encrypt,this._decrypt=e.decrypt,this.algorithm.initialize(e)};i.prototype.start=function(e){e=e||{};var t={};for(var r in e)t[r]=e[r];t.decrypt=this._decrypt,this._finish=!1,this._input=n.util.createBuffer(),this.output=e.output||n.util.createBuffer(),this.mode.start(t)},i.prototype.update=function(e){for(e&&this._input.putBuffer(e);!this._op.call(this.mode,this._input,this.output,this._finish)&&!this._finish;);this._input.compact()},i.prototype.finish=function(e){!e||"ECB"!==this.mode.name&&"CBC"!==this.mode.name||(this.mode.pad=function(t){return e(this.blockSize,t,!1)},this.mode.unpad=function(t){return e(this.blockSize,t,!0)});var t={};return t.decrypt=this._decrypt,t.overflow=this._input.length()%this.blockSize,!(!this._decrypt&&this.mode.pad&&!this.mode.pad(this._input,t))&&(this._finish=!0,this.update(),!(this._decrypt&&this.mode.unpad&&!this.mode.unpad(this.output,t))&&!(this.mode.afterFinish&&!this.mode.afterFinish(this.output,t)))}},1967:function(e,t,r){var n=r(3832);r(7116),n.cipher=n.cipher||{};var i=e.exports=n.cipher.modes=n.cipher.modes||{};function a(e,t){if("string"==typeof e&&(e=n.util.createBuffer(e)),n.util.isArray(e)&&e.length>4){var r=e;e=n.util.createBuffer();for(var i=0;i<r.length;++i)e.putByte(r[i])}if(e.length()<t)throw new Error("Invalid IV length; got "+e.length()+" bytes and expected "+t+" bytes.");if(!n.util.isArray(e)){var a=[],o=t/4;for(i=0;i<o;++i)a.push(e.getInt32());e=a}return e}function o(e){e[e.length-1]=e[e.length-1]+1&4294967295}function s(e){return[e/4294967296|0,4294967295&e]}i.ecb=function(e){e=e||{},this.name="ECB",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)},i.ecb.prototype.start=function(e){},i.ecb.prototype.encrypt=function(e,t,r){if(e.length()<this.blockSize&&!(r&&e.length()>0))return!0;for(var n=0;n<this._ints;++n)this._inBlock[n]=e.getInt32();this.cipher.encrypt(this._inBlock,this._outBlock);for(n=0;n<this._ints;++n)t.putInt32(this._outBlock[n])},i.ecb.prototype.decrypt=function(e,t,r){if(e.length()<this.blockSize&&!(r&&e.length()>0))return!0;for(var n=0;n<this._ints;++n)this._inBlock[n]=e.getInt32();this.cipher.decrypt(this._inBlock,this._outBlock);for(n=0;n<this._ints;++n)t.putInt32(this._outBlock[n])},i.ecb.prototype.pad=function(e,t){var r=e.length()===this.blockSize?this.blockSize:this.blockSize-e.length();return e.fillWithByte(r,r),!0},i.ecb.prototype.unpad=function(e,t){if(t.overflow>0)return!1;var r=e.length(),n=e.at(r-1);return!(n>this.blockSize<<2)&&(e.truncate(n),!0)},i.cbc=function(e){e=e||{},this.name="CBC",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)},i.cbc.prototype.start=function(e){if(null===e.iv){if(!this._prev)throw new Error("Invalid IV parameter.");this._iv=this._prev.slice(0)}else{if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=a(e.iv,this.blockSize),this._prev=this._iv.slice(0)}},i.cbc.prototype.encrypt=function(e,t,r){if(e.length()<this.blockSize&&!(r&&e.length()>0))return!0;for(var n=0;n<this._ints;++n)this._inBlock[n]=this._prev[n]^e.getInt32();this.cipher.encrypt(this._inBlock,this._outBlock);for(n=0;n<this._ints;++n)t.putInt32(this._outBlock[n]);this._prev=this._outBlock},i.cbc.prototype.decrypt=function(e,t,r){if(e.length()<this.blockSize&&!(r&&e.length()>0))return!0;for(var n=0;n<this._ints;++n)this._inBlock[n]=e.getInt32();this.cipher.decrypt(this._inBlock,this._outBlock);for(n=0;n<this._ints;++n)t.putInt32(this._prev[n]^this._outBlock[n]);this._prev=this._inBlock.slice(0)},i.cbc.prototype.pad=function(e,t){var r=e.length()===this.blockSize?this.blockSize:this.blockSize-e.length();return e.fillWithByte(r,r),!0},i.cbc.prototype.unpad=function(e,t){if(t.overflow>0)return!1;var r=e.length(),n=e.at(r-1);return!(n>this.blockSize<<2)&&(e.truncate(n),!0)},i.cfb=function(e){e=e||{},this.name="CFB",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialBlock=new Array(this._ints),this._partialOutput=n.util.createBuffer(),this._partialBytes=0},i.cfb.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=a(e.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},i.cfb.prototype.encrypt=function(e,t,r){var n=e.length();if(0===n)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize)for(var i=0;i<this._ints;++i)this._inBlock[i]=e.getInt32()^this._outBlock[i],t.putInt32(this._inBlock[i]);else{var a=(this.blockSize-n)%this.blockSize;a>0&&(a=this.blockSize-a),this._partialOutput.clear();for(i=0;i<this._ints;++i)this._partialBlock[i]=e.getInt32()^this._outBlock[i],this._partialOutput.putInt32(this._partialBlock[i]);if(a>0)e.read-=this.blockSize;else for(i=0;i<this._ints;++i)this._inBlock[i]=this._partialBlock[i];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),a>0&&!r)return t.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=a,!0;t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}},i.cfb.prototype.decrypt=function(e,t,r){var n=e.length();if(0===n)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize)for(var i=0;i<this._ints;++i)this._inBlock[i]=e.getInt32(),t.putInt32(this._inBlock[i]^this._outBlock[i]);else{var a=(this.blockSize-n)%this.blockSize;a>0&&(a=this.blockSize-a),this._partialOutput.clear();for(i=0;i<this._ints;++i)this._partialBlock[i]=e.getInt32(),this._partialOutput.putInt32(this._partialBlock[i]^this._outBlock[i]);if(a>0)e.read-=this.blockSize;else for(i=0;i<this._ints;++i)this._inBlock[i]=this._partialBlock[i];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),a>0&&!r)return t.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=a,!0;t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}},i.ofb=function(e){e=e||{},this.name="OFB",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=n.util.createBuffer(),this._partialBytes=0},i.ofb.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=a(e.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},i.ofb.prototype.encrypt=function(e,t,r){var n=e.length();if(0===e.length())return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize)for(var i=0;i<this._ints;++i)t.putInt32(e.getInt32()^this._outBlock[i]),this._inBlock[i]=this._outBlock[i];else{var a=(this.blockSize-n)%this.blockSize;a>0&&(a=this.blockSize-a),this._partialOutput.clear();for(i=0;i<this._ints;++i)this._partialOutput.putInt32(e.getInt32()^this._outBlock[i]);if(a>0)e.read-=this.blockSize;else for(i=0;i<this._ints;++i)this._inBlock[i]=this._outBlock[i];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),a>0&&!r)return t.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=a,!0;t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}},i.ofb.prototype.decrypt=i.ofb.prototype.encrypt,i.ctr=function(e){e=e||{},this.name="CTR",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=n.util.createBuffer(),this._partialBytes=0},i.ctr.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=a(e.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},i.ctr.prototype.encrypt=function(e,t,r){var n=e.length();if(0===n)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize)for(var i=0;i<this._ints;++i)t.putInt32(e.getInt32()^this._outBlock[i]);else{var a=(this.blockSize-n)%this.blockSize;a>0&&(a=this.blockSize-a),this._partialOutput.clear();for(i=0;i<this._ints;++i)this._partialOutput.putInt32(e.getInt32()^this._outBlock[i]);if(a>0&&(e.read-=this.blockSize),this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),a>0&&!r)return t.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=a,!0;t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}o(this._inBlock)},i.ctr.prototype.decrypt=i.ctr.prototype.encrypt,i.gcm=function(e){e=e||{},this.name="GCM",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints),this._partialOutput=n.util.createBuffer(),this._partialBytes=0,this._R=3774873600},i.gcm.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");var t,r=n.util.createBuffer(e.iv);if(this._cipherLength=0,t="additionalData"in e?n.util.createBuffer(e.additionalData):n.util.createBuffer(),this._tagLength="tagLength"in e?e.tagLength:128,this._tag=null,e.decrypt&&(this._tag=n.util.createBuffer(e.tag).getBytes(),this._tag.length!==this._tagLength/8))throw new Error("Authentication tag does not match tag length.");this._hashBlock=new Array(this._ints),this.tag=null,this._hashSubkey=new Array(this._ints),this.cipher.encrypt([0,0,0,0],this._hashSubkey),this.componentBits=4,this._m=this.generateHashTable(this._hashSubkey,this.componentBits);var i=r.length();if(12===i)this._j0=[r.getInt32(),r.getInt32(),r.getInt32(),1];else{for(this._j0=[0,0,0,0];r.length()>0;)this._j0=this.ghash(this._hashSubkey,this._j0,[r.getInt32(),r.getInt32(),r.getInt32(),r.getInt32()]);this._j0=this.ghash(this._hashSubkey,this._j0,[0,0].concat(s(8*i)))}this._inBlock=this._j0.slice(0),o(this._inBlock),this._partialBytes=0,t=n.util.createBuffer(t),this._aDataLength=s(8*t.length());var a=t.length()%this.blockSize;for(a&&t.fillWithByte(0,this.blockSize-a),this._s=[0,0,0,0];t.length()>0;)this._s=this.ghash(this._hashSubkey,this._s,[t.getInt32(),t.getInt32(),t.getInt32(),t.getInt32()])},i.gcm.prototype.encrypt=function(e,t,r){var n=e.length();if(0===n)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize){for(var i=0;i<this._ints;++i)t.putInt32(this._outBlock[i]^=e.getInt32());this._cipherLength+=this.blockSize}else{var a=(this.blockSize-n)%this.blockSize;a>0&&(a=this.blockSize-a),this._partialOutput.clear();for(i=0;i<this._ints;++i)this._partialOutput.putInt32(e.getInt32()^this._outBlock[i]);if(a<=0||r){if(r){var s=n%this.blockSize;this._cipherLength+=s,this._partialOutput.truncate(this.blockSize-s)}else this._cipherLength+=this.blockSize;for(i=0;i<this._ints;++i)this._outBlock[i]=this._partialOutput.getInt32();this._partialOutput.read-=this.blockSize}if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),a>0&&!r)return e.read-=this.blockSize,t.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=a,!0;t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}this._s=this.ghash(this._hashSubkey,this._s,this._outBlock),o(this._inBlock)},i.gcm.prototype.decrypt=function(e,t,r){var n=e.length();if(n<this.blockSize&&!(r&&n>0))return!0;this.cipher.encrypt(this._inBlock,this._outBlock),o(this._inBlock),this._hashBlock[0]=e.getInt32(),this._hashBlock[1]=e.getInt32(),this._hashBlock[2]=e.getInt32(),this._hashBlock[3]=e.getInt32(),this._s=this.ghash(this._hashSubkey,this._s,this._hashBlock);for(var i=0;i<this._ints;++i)t.putInt32(this._outBlock[i]^this._hashBlock[i]);n<this.blockSize?this._cipherLength+=n%this.blockSize:this._cipherLength+=this.blockSize},i.gcm.prototype.afterFinish=function(e,t){var r=!0;t.decrypt&&t.overflow&&e.truncate(this.blockSize-t.overflow),this.tag=n.util.createBuffer();var i=this._aDataLength.concat(s(8*this._cipherLength));this._s=this.ghash(this._hashSubkey,this._s,i);var a=[];this.cipher.encrypt(this._j0,a);for(var o=0;o<this._ints;++o)this.tag.putInt32(this._s[o]^a[o]);return this.tag.truncate(this.tag.length()%(this._tagLength/8)),t.decrypt&&this.tag.bytes()!==this._tag&&(r=!1),r},i.gcm.prototype.multiply=function(e,t){for(var r=[0,0,0,0],n=t.slice(0),i=0;i<128;++i){e[i/32|0]&1<<31-i%32&&(r[0]^=n[0],r[1]^=n[1],r[2]^=n[2],r[3]^=n[3]),this.pow(n,n)}return r},i.gcm.prototype.pow=function(e,t){for(var r=1&e[3],n=3;n>0;--n)t[n]=e[n]>>>1|(1&e[n-1])<<31;t[0]=e[0]>>>1,r&&(t[0]^=this._R)},i.gcm.prototype.tableMultiply=function(e){for(var t=[0,0,0,0],r=0;r<32;++r){var n=e[r/8|0]>>>4*(7-r%8)&15,i=this._m[r][n];t[0]^=i[0],t[1]^=i[1],t[2]^=i[2],t[3]^=i[3]}return t},i.gcm.prototype.ghash=function(e,t,r){return t[0]^=r[0],t[1]^=r[1],t[2]^=r[2],t[3]^=r[3],this.tableMultiply(t)},i.gcm.prototype.generateHashTable=function(e,t){for(var r=8/t,n=4*r,i=16*r,a=new Array(i),o=0;o<i;++o){var s=[0,0,0,0],u=(n-1-o%n)*t;s[o/n|0]=1<<t-1<<u,a[o]=this.generateSubHashTable(this.multiply(s,e),t)}return a},i.gcm.prototype.generateSubHashTable=function(e,t){var r=1<<t,n=r>>>1,i=new Array(r);i[n]=e.slice(0);for(var a=n>>>1;a>0;)this.pow(i[2*a],i[a]=[]),a>>=1;for(a=2;a<n;){for(var o=1;o<a;++o){var s=i[a],u=i[o];i[a+o]=[s[0]^u[0],s[1]^u[1],s[2]^u[2],s[3]^u[3]]}a*=2}for(i[0]=[0,0,0,0],a=n+1;a<r;++a){var c=i[a^n];i[a]=[e[0]^c[0],e[1]^c[1],e[2]^c[2],e[3]^c[3]]}return i}},3480:function(e,t,r){var n=r(3832);function i(e,t){n.cipher.registerAlgorithm(e,(function(){return new n.des.Algorithm(e,t)}))}r(5649),r(1967),r(7116),e.exports=n.des=n.des||{},n.des.startEncrypting=function(e,t,r,n){var i=d({key:e,output:r,decrypt:!1,mode:n||(null===t?"ECB":"CBC")});return i.start(t),i},n.des.createEncryptionCipher=function(e,t){return d({key:e,output:null,decrypt:!1,mode:t})},n.des.startDecrypting=function(e,t,r,n){var i=d({key:e,output:r,decrypt:!0,mode:n||(null===t?"ECB":"CBC")});return i.start(t),i},n.des.createDecryptionCipher=function(e,t){return d({key:e,output:null,decrypt:!0,mode:t})},n.des.Algorithm=function(e,t){var r=this;r.name=e,r.mode=new t({blockSize:8,cipher:{encrypt:function(e,t){return p(r._keys,e,t,!1)},decrypt:function(e,t){return p(r._keys,e,t,!0)}}}),r._init=!1},n.des.Algorithm.prototype.initialize=function(e){if(!this._init){var t=n.util.createBuffer(e.key);if(0===this.name.indexOf("3DES")&&24!==t.length())throw new Error("Invalid Triple-DES key size: "+8*t.length());this._keys=function(e){for(var t,r=[0,4,536870912,536870916,65536,65540,536936448,536936452,512,516,536871424,536871428,66048,66052,536936960,536936964],n=[0,1,1048576,1048577,67108864,67108865,68157440,68157441,256,257,1048832,1048833,67109120,67109121,68157696,68157697],i=[0,8,2048,2056,16777216,16777224,16779264,16779272,0,8,2048,2056,16777216,16777224,16779264,16779272],a=[0,2097152,134217728,136314880,8192,2105344,134225920,136323072,131072,2228224,134348800,136445952,139264,2236416,134356992,136454144],o=[0,262144,16,262160,0,262144,16,262160,4096,266240,4112,266256,4096,266240,4112,266256],s=[0,1024,32,1056,0,1024,32,1056,33554432,33555456,33554464,33555488,33554432,33555456,33554464,33555488],u=[0,268435456,524288,268959744,2,268435458,524290,268959746,0,268435456,524288,268959744,2,268435458,524290,268959746],c=[0,65536,2048,67584,536870912,536936448,536872960,536938496,131072,196608,133120,198656,537001984,537067520,537004032,537069568],l=[0,262144,0,262144,2,262146,2,262146,33554432,33816576,33554432,33816576,33554434,33816578,33554434,33816578],f=[0,268435456,8,268435464,0,268435456,8,268435464,1024,268436480,1032,268436488,1024,268436480,1032,268436488],h=[0,32,0,32,1048576,1048608,1048576,1048608,8192,8224,8192,8224,1056768,1056800,1056768,1056800],p=[0,16777216,512,16777728,2097152,18874368,2097664,18874880,67108864,83886080,67109376,83886592,69206016,85983232,69206528,85983744],d=[0,4096,134217728,134221824,524288,528384,134742016,134746112,16,4112,134217744,134221840,524304,528400,134742032,134746128],y=[0,4,256,260,0,4,256,260,1,5,257,261,1,5,257,261],v=e.length()>8?3:1,g=[],m=[0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0],b=0,E=0;E<v;E++){var S=e.getInt32(),C=e.getInt32();S^=(t=252645135&(S>>>4^C))<<4,S^=t=65535&((C^=t)>>>-16^S),S^=(t=858993459&(S>>>2^(C^=t<<-16)))<<2,S^=t=65535&((C^=t)>>>-16^S),S^=(t=1431655765&(S>>>1^(C^=t<<-16)))<<1,S^=t=16711935&((C^=t)>>>8^S),t=(S^=(t=1431655765&(S>>>1^(C^=t<<8)))<<1)<<8|(C^=t)>>>20&240,S=C<<24|C<<8&16711680|C>>>8&65280|C>>>24&240,C=t;for(var w=0;w<m.length;++w){m[w]?(S=S<<2|S>>>26,C=C<<2|C>>>26):(S=S<<1|S>>>27,C=C<<1|C>>>27),C&=-15;var T=r[(S&=-15)>>>28]|n[S>>>24&15]|i[S>>>20&15]|a[S>>>16&15]|o[S>>>12&15]|s[S>>>8&15]|u[S>>>4&15],A=c[C>>>28]|l[C>>>24&15]|f[C>>>20&15]|h[C>>>16&15]|p[C>>>12&15]|d[C>>>8&15]|y[C>>>4&15];t=65535&(A>>>16^T),g[b++]=T^t,g[b++]=A^t<<16}}return g}(t),this._init=!0}},i("DES-ECB",n.cipher.modes.ecb),i("DES-CBC",n.cipher.modes.cbc),i("DES-CFB",n.cipher.modes.cfb),i("DES-OFB",n.cipher.modes.ofb),i("DES-CTR",n.cipher.modes.ctr),i("3DES-ECB",n.cipher.modes.ecb),i("3DES-CBC",n.cipher.modes.cbc),i("3DES-CFB",n.cipher.modes.cfb),i("3DES-OFB",n.cipher.modes.ofb),i("3DES-CTR",n.cipher.modes.ctr);var a=[16843776,0,65536,16843780,16842756,66564,4,65536,1024,16843776,16843780,1024,16778244,16842756,16777216,4,1028,16778240,16778240,66560,66560,16842752,16842752,16778244,65540,16777220,16777220,65540,0,1028,66564,16777216,65536,16843780,4,16842752,16843776,16777216,16777216,1024,16842756,65536,66560,16777220,1024,4,16778244,66564,16843780,65540,16842752,16778244,16777220,1028,66564,16843776,1028,16778240,16778240,0,65540,66560,0,16842756],o=[-2146402272,-2147450880,32768,1081376,1048576,32,-2146435040,-2147450848,-2147483616,-2146402272,-2146402304,-2147483648,-2147450880,1048576,32,-2146435040,1081344,1048608,-2147450848,0,-2147483648,32768,1081376,-2146435072,1048608,-2147483616,0,1081344,32800,-2146402304,-2146435072,32800,0,1081376,-2146435040,1048576,-2147450848,-2146435072,-2146402304,32768,-2146435072,-2147450880,32,-2146402272,1081376,32,32768,-2147483648,32800,-2146402304,1048576,-2147483616,1048608,-2147450848,-2147483616,1048608,1081344,0,-2147450880,32800,-2147483648,-2146435040,-2146402272,1081344],s=[520,134349312,0,134348808,134218240,0,131592,134218240,131080,134217736,134217736,131072,134349320,131080,134348800,520,134217728,8,134349312,512,131584,134348800,134348808,131592,134218248,131584,131072,134218248,8,134349320,512,134217728,134349312,134217728,131080,520,131072,134349312,134218240,0,512,131080,134349320,134218240,134217736,512,0,134348808,134218248,131072,134217728,134349320,8,131592,131584,134217736,134348800,134218248,520,134348800,131592,8,134348808,131584],u=[8396801,8321,8321,128,8396928,8388737,8388609,8193,0,8396800,8396800,8396929,129,0,8388736,8388609,1,8192,8388608,8396801,128,8388608,8193,8320,8388737,1,8320,8388736,8192,8396928,8396929,129,8388736,8388609,8396800,8396929,129,0,0,8396800,8320,8388736,8388737,1,8396801,8321,8321,128,8396929,129,1,8192,8388609,8193,8396928,8388737,8193,8320,8388608,8396801,128,8388608,8192,8396928],c=[256,34078976,34078720,1107296512,524288,256,1073741824,34078720,1074266368,524288,33554688,1074266368,1107296512,1107820544,524544,1073741824,33554432,1074266112,1074266112,0,1073742080,1107820800,1107820800,33554688,1107820544,1073742080,0,1107296256,34078976,33554432,1107296256,524544,524288,1107296512,256,33554432,1073741824,34078720,1107296512,1074266368,33554688,1073741824,1107820544,34078976,1074266368,256,33554432,1107820544,1107820800,524544,1107296256,1107820800,34078720,0,1074266112,1107296256,524544,33554688,1073742080,524288,0,1074266112,34078976,1073742080],l=[536870928,541065216,16384,541081616,541065216,16,541081616,4194304,536887296,4210704,4194304,536870928,4194320,536887296,536870912,16400,0,4194320,536887312,16384,4210688,536887312,16,541065232,541065232,0,4210704,541081600,16400,4210688,541081600,536870912,536887296,16,541065232,4210688,541081616,4194304,16400,536870928,4194304,536887296,536870912,16400,536870928,541081616,4210688,541065216,4210704,541081600,0,541065232,16,16384,541065216,4210704,16384,4194320,536887312,0,541081600,536870912,4194320,536887312],f=[2097152,69206018,67110914,0,2048,67110914,2099202,69208064,69208066,2097152,0,67108866,2,67108864,69206018,2050,67110912,2099202,2097154,67110912,67108866,69206016,69208064,2097154,69206016,2048,2050,69208066,2099200,2,67108864,2099200,67108864,2099200,2097152,67110914,67110914,69206018,69206018,2,2097154,67108864,67110912,2097152,69208064,2050,2099202,69208064,2050,67108866,69208066,69206016,2099200,0,2,69208066,0,2099202,69206016,2048,67108866,67110912,2048,2097154],h=[268439616,4096,262144,268701760,268435456,268439616,64,268435456,262208,268697600,268701760,266240,268701696,266304,4096,64,268697600,268435520,268439552,4160,266240,262208,268697664,268701696,4160,0,0,268697664,268435520,268439552,266304,262144,266304,262144,268701696,4096,64,268697664,4096,266304,268439552,64,268435520,268697600,268697664,268435456,262144,268439616,0,268701760,262208,268435520,268697600,268439552,268439616,0,268701760,266240,266240,4160,4160,262208,268435456,268701696];function p(e,t,r,n){var i,p,d=32===e.length?3:9;i=3===d?n?[30,-2,-2]:[0,32,2]:n?[94,62,-2,32,64,2,30,-2,-2]:[0,32,2,62,30,-2,64,96,2];var y=t[0],v=t[1];y^=(p=252645135&(y>>>4^v))<<4,y^=(p=65535&(y>>>16^(v^=p)))<<16,y^=p=858993459&((v^=p)>>>2^y),y^=p=16711935&((v^=p<<2)>>>8^y),y=(y^=(p=1431655765&(y>>>1^(v^=p<<8)))<<1)<<1|y>>>31,v=(v^=p)<<1|v>>>31;for(var g=0;g<d;g+=3){for(var m=i[g+1],b=i[g+2],E=i[g];E!=m;E+=b){var S=v^e[E],C=(v>>>4|v<<28)^e[E+1];p=y,y=v,v=p^(o[S>>>24&63]|u[S>>>16&63]|l[S>>>8&63]|h[63&S]|a[C>>>24&63]|s[C>>>16&63]|c[C>>>8&63]|f[63&C])}p=y,y=v,v=p}v=v>>>1|v<<31,v^=p=1431655765&((y=y>>>1|y<<31)>>>1^v),v^=(p=16711935&(v>>>8^(y^=p<<1)))<<8,v^=(p=858993459&(v>>>2^(y^=p)))<<2,v^=p=65535&((y^=p)>>>16^v),v^=p=252645135&((y^=p<<16)>>>4^v),y^=p<<4,r[0]=y,r[1]=v}function d(e){var t,r="DES-"+((e=e||{}).mode||"CBC").toUpperCase(),i=(t=e.decrypt?n.cipher.createDecipher(r,e.key):n.cipher.createCipher(r,e.key)).start;return t.start=function(e,r){var a=null;r instanceof n.util.ByteBuffer&&(a=r,r={}),(r=r||{}).output=a,r.iv=e,i.call(t,r)},t}},3832:function(e){e.exports={options:{usePureJavaScript:!1}}},6607:function(e,t,r){var n=r(3832);r(8991),r(7116),(e.exports=n.hmac=n.hmac||{}).create=function(){var e=null,t=null,r=null,i=null,a={start:function(a,o){if(null!==a)if("string"==typeof a){if(!((a=a.toLowerCase())in n.md.algorithms))throw new Error('Unknown hash algorithm "'+a+'"');t=n.md.algorithms[a].create()}else t=a;if(null===o)o=e;else{if("string"==typeof o)o=n.util.createBuffer(o);else if(n.util.isArray(o)){var s=o;o=n.util.createBuffer();for(var u=0;u<s.length;++u)o.putByte(s[u])}var c=o.length();c>t.blockLength&&(t.start(),t.update(o.bytes()),o=t.digest()),r=n.util.createBuffer(),i=n.util.createBuffer(),c=o.length();for(u=0;u<c;++u){s=o.at(u);r.putByte(54^s),i.putByte(92^s)}if(c<t.blockLength)for(s=t.blockLength-c,u=0;u<s;++u)r.putByte(54),i.putByte(92);e=o,r=r.bytes(),i=i.bytes()}t.start(),t.update(r)},update:function(e){t.update(e)},getMac:function(){var e=t.digest().bytes();return t.start(),t.update(i),t.update(e),t.digest()}};return a.digest=a.getMac,a}},5764:function(e,t,r){var n,i=r(3832);e.exports=i.jsbn=i.jsbn||{};function a(e,t,r){this.data=[],null!=e&&("number"==typeof e?this.fromNumber(e,t,r):null==t&&"string"!=typeof e?this.fromString(e,256):this.fromString(e,t))}function o(){return new a(null)}function s(e,t,r,n,i,a){for(var o=16383&t,s=t>>14;--a>=0;){var u=16383&this.data[e],c=this.data[e++]>>14,l=s*u+c*o;i=((u=o*u+((16383&l)<<14)+r.data[n]+i)>>28)+(l>>14)+s*c,r.data[n++]=268435455&u}return i}i.jsbn.BigInteger=a,"undefined"==typeof navigator?(a.prototype.am=s,n=28):"Microsoft Internet Explorer"==navigator.appName?(a.prototype.am=function(e,t,r,n,i,a){for(var o=32767&t,s=t>>15;--a>=0;){var u=32767&this.data[e],c=this.data[e++]>>15,l=s*u+c*o;i=((u=o*u+((32767&l)<<15)+r.data[n]+(1073741823&i))>>>30)+(l>>>15)+s*c+(i>>>30),r.data[n++]=1073741823&u}return i},n=30):"Netscape"!=navigator.appName?(a.prototype.am=function(e,t,r,n,i,a){for(;--a>=0;){var o=t*this.data[e++]+r.data[n]+i;i=Math.floor(o/67108864),r.data[n++]=67108863&o}return i},n=26):(a.prototype.am=s,n=28),a.prototype.DB=n,a.prototype.DM=(1<<n)-1,a.prototype.DV=1<<n;a.prototype.FV=Math.pow(2,52),a.prototype.F1=52-n,a.prototype.F2=2*n-52;var u,c,l=new Array;for(u="0".charCodeAt(0),c=0;c<=9;++c)l[u++]=c;for(u="a".charCodeAt(0),c=10;c<36;++c)l[u++]=c;for(u="A".charCodeAt(0),c=10;c<36;++c)l[u++]=c;function f(e){return"0123456789abcdefghijklmnopqrstuvwxyz".charAt(e)}function h(e,t){var r=l[e.charCodeAt(t)];return null==r?-1:r}function p(e){var t=o();return t.fromInt(e),t}function d(e){var t,r=1;return 0!=(t=e>>>16)&&(e=t,r+=16),0!=(t=e>>8)&&(e=t,r+=8),0!=(t=e>>4)&&(e=t,r+=4),0!=(t=e>>2)&&(e=t,r+=2),0!=(t=e>>1)&&(e=t,r+=1),r}function y(e){this.m=e}function v(e){this.m=e,this.mp=e.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<<e.DB-15)-1,this.mt2=2*e.t}function g(e,t){return e&t}function m(e,t){return e|t}function b(e,t){return e^t}function E(e,t){return e&~t}function S(e){if(0==e)return-1;var t=0;return 0==(65535&e)&&(e>>=16,t+=16),0==(255&e)&&(e>>=8,t+=8),0==(15&e)&&(e>>=4,t+=4),0==(3&e)&&(e>>=2,t+=2),0==(1&e)&&++t,t}function C(e){for(var t=0;0!=e;)e&=e-1,++t;return t}function w(){}function T(e){return e}function A(e){this.r2=o(),this.q3=o(),a.ONE.dlShiftTo(2*e.t,this.r2),this.mu=this.r2.divide(e),this.m=e}y.prototype.convert=function(e){return e.s<0||e.compareTo(this.m)>=0?e.mod(this.m):e},y.prototype.revert=function(e){return e},y.prototype.reduce=function(e){e.divRemTo(this.m,null,e)},y.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},y.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},v.prototype.convert=function(e){var t=o();return e.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),e.s<0&&t.compareTo(a.ZERO)>0&&this.m.subTo(t,t),t},v.prototype.revert=function(e){var t=o();return e.copyTo(t),this.reduce(t),t},v.prototype.reduce=function(e){for(;e.t<=this.mt2;)e.data[e.t++]=0;for(var t=0;t<this.m.t;++t){var r=32767&e.data[t],n=r*this.mpl+((r*this.mph+(e.data[t]>>15)*this.mpl&this.um)<<15)&e.DM;for(r=t+this.m.t,e.data[r]+=this.m.am(0,n,e,t,0,this.m.t);e.data[r]>=e.DV;)e.data[r]-=e.DV,e.data[++r]++}e.clamp(),e.drShiftTo(this.m.t,e),e.compareTo(this.m)>=0&&e.subTo(this.m,e)},v.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},v.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},a.prototype.copyTo=function(e){for(var t=this.t-1;t>=0;--t)e.data[t]=this.data[t];e.t=this.t,e.s=this.s},a.prototype.fromInt=function(e){this.t=1,this.s=e<0?-1:0,e>0?this.data[0]=e:e<-1?this.data[0]=e+this.DV:this.t=0},a.prototype.fromString=function(e,t){var r;if(16==t)r=4;else if(8==t)r=3;else if(256==t)r=8;else if(2==t)r=1;else if(32==t)r=5;else{if(4!=t)return void this.fromRadix(e,t);r=2}this.t=0,this.s=0;for(var n=e.length,i=!1,o=0;--n>=0;){var s=8==r?255&e[n]:h(e,n);s<0?"-"==e.charAt(n)&&(i=!0):(i=!1,0==o?this.data[this.t++]=s:o+r>this.DB?(this.data[this.t-1]|=(s&(1<<this.DB-o)-1)<<o,this.data[this.t++]=s>>this.DB-o):this.data[this.t-1]|=s<<o,(o+=r)>=this.DB&&(o-=this.DB))}8==r&&0!=(128&e[0])&&(this.s=-1,o>0&&(this.data[this.t-1]|=(1<<this.DB-o)-1<<o)),this.clamp(),i&&a.ZERO.subTo(this,this)},a.prototype.clamp=function(){for(var e=this.s&this.DM;this.t>0&&this.data[this.t-1]==e;)--this.t},a.prototype.dlShiftTo=function(e,t){var r;for(r=this.t-1;r>=0;--r)t.data[r+e]=this.data[r];for(r=e-1;r>=0;--r)t.data[r]=0;t.t=this.t+e,t.s=this.s},a.prototype.drShiftTo=function(e,t){for(var r=e;r<this.t;++r)t.data[r-e]=this.data[r];t.t=Math.max(this.t-e,0),t.s=this.s},a.prototype.lShiftTo=function(e,t){var r,n=e%this.DB,i=this.DB-n,a=(1<<i)-1,o=Math.floor(e/this.DB),s=this.s<<n&this.DM;for(r=this.t-1;r>=0;--r)t.data[r+o+1]=this.data[r]>>i|s,s=(this.data[r]&a)<<n;for(r=o-1;r>=0;--r)t.data[r]=0;t.data[o]=s,t.t=this.t+o+1,t.s=this.s,t.clamp()},a.prototype.rShiftTo=function(e,t){t.s=this.s;var r=Math.floor(e/this.DB);if(r>=this.t)t.t=0;else{var n=e%this.DB,i=this.DB-n,a=(1<<n)-1;t.data[0]=this.data[r]>>n;for(var o=r+1;o<this.t;++o)t.data[o-r-1]|=(this.data[o]&a)<<i,t.data[o-r]=this.data[o]>>n;n>0&&(t.data[this.t-r-1]|=(this.s&a)<<i),t.t=this.t-r,t.clamp()}},a.prototype.subTo=function(e,t){for(var r=0,n=0,i=Math.min(e.t,this.t);r<i;)n+=this.data[r]-e.data[r],t.data[r++]=n&this.DM,n>>=this.DB;if(e.t<this.t){for(n-=e.s;r<this.t;)n+=this.data[r],t.data[r++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;r<e.t;)n-=e.data[r],t.data[r++]=n&this.DM,n>>=this.DB;n-=e.s}t.s=n<0?-1:0,n<-1?t.data[r++]=this.DV+n:n>0&&(t.data[r++]=n),t.t=r,t.clamp()},a.prototype.multiplyTo=function(e,t){var r=this.abs(),n=e.abs(),i=r.t;for(t.t=i+n.t;--i>=0;)t.data[i]=0;for(i=0;i<n.t;++i)t.data[i+r.t]=r.am(0,n.data[i],t,i,0,r.t);t.s=0,t.clamp(),this.s!=e.s&&a.ZERO.subTo(t,t)},a.prototype.squareTo=function(e){for(var t=this.abs(),r=e.t=2*t.t;--r>=0;)e.data[r]=0;for(r=0;r<t.t-1;++r){var n=t.am(r,t.data[r],e,2*r,0,1);(e.data[r+t.t]+=t.am(r+1,2*t.data[r],e,2*r+1,n,t.t-r-1))>=t.DV&&(e.data[r+t.t]-=t.DV,e.data[r+t.t+1]=1)}e.t>0&&(e.data[e.t-1]+=t.am(r,t.data[r],e,2*r,0,1)),e.s=0,e.clamp()},a.prototype.divRemTo=function(e,t,r){var n=e.abs();if(!(n.t<=0)){var i=this.abs();if(i.t<n.t)return null!=t&&t.fromInt(0),void(null!=r&&this.copyTo(r));null==r&&(r=o());var s=o(),u=this.s,c=e.s,l=this.DB-d(n.data[n.t-1]);l>0?(n.lShiftTo(l,s),i.lShiftTo(l,r)):(n.copyTo(s),i.copyTo(r));var f=s.t,h=s.data[f-1];if(0!=h){var p=h*(1<<this.F1)+(f>1?s.data[f-2]>>this.F2:0),y=this.FV/p,v=(1<<this.F1)/p,g=1<<this.F2,m=r.t,b=m-f,E=null==t?o():t;for(s.dlShiftTo(b,E),r.compareTo(E)>=0&&(r.data[r.t++]=1,r.subTo(E,r)),a.ONE.dlShiftTo(f,E),E.subTo(s,s);s.t<f;)s.data[s.t++]=0;for(;--b>=0;){var S=r.data[--m]==h?this.DM:Math.floor(r.data[m]*y+(r.data[m-1]+g)*v);if((r.data[m]+=s.am(0,S,r,b,0,f))<S)for(s.dlShiftTo(b,E),r.subTo(E,r);r.data[m]<--S;)r.subTo(E,r)}null!=t&&(r.drShiftTo(f,t),u!=c&&a.ZERO.subTo(t,t)),r.t=f,r.clamp(),l>0&&r.rShiftTo(l,r),u<0&&a.ZERO.subTo(r,r)}}},a.prototype.invDigit=function(){if(this.t<1)return 0;var e=this.data[0];if(0==(1&e))return 0;var t=3&e;return(t=(t=(t=(t=t*(2-(15&e)*t)&15)*(2-(255&e)*t)&255)*(2-((65535&e)*t&65535))&65535)*(2-e*t%this.DV)%this.DV)>0?this.DV-t:-t},a.prototype.isEven=function(){return 0==(this.t>0?1&this.data[0]:this.s)},a.prototype.exp=function(e,t){if(e>4294967295||e<1)return a.ONE;var r=o(),n=o(),i=t.convert(this),s=d(e)-1;for(i.copyTo(r);--s>=0;)if(t.sqrTo(r,n),(e&1<<s)>0)t.mulTo(n,i,r);else{var u=r;r=n,n=u}return t.revert(r)},a.prototype.toString=function(e){if(this.s<0)return"-"+this.negate().toString(e);var t;if(16==e)t=4;else if(8==e)t=3;else if(2==e)t=1;else if(32==e)t=5;else{if(4!=e)return this.toRadix(e);t=2}var r,n=(1<<t)-1,i=!1,a="",o=this.t,s=this.DB-o*this.DB%t;if(o-- >0)for(s<this.DB&&(r=this.data[o]>>s)>0&&(i=!0,a=f(r));o>=0;)s<t?(r=(this.data[o]&(1<<s)-1)<<t-s,r|=this.data[--o]>>(s+=this.DB-t)):(r=this.data[o]>>(s-=t)&n,s<=0&&(s+=this.DB,--o)),r>0&&(i=!0),i&&(a+=f(r));return i?a:"0"},a.prototype.negate=function(){var e=o();return a.ZERO.subTo(this,e),e},a.prototype.abs=function(){return this.s<0?this.negate():this},a.prototype.compareTo=function(e){var t=this.s-e.s;if(0!=t)return t;var r=this.t;if(0!=(t=r-e.t))return this.s<0?-t:t;for(;--r>=0;)if(0!=(t=this.data[r]-e.data[r]))return t;return 0},a.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+d(this.data[this.t-1]^this.s&this.DM)},a.prototype.mod=function(e){var t=o();return this.abs().divRemTo(e,null,t),this.s<0&&t.compareTo(a.ZERO)>0&&e.subTo(t,t),t},a.prototype.modPowInt=function(e,t){var r;return r=e<256||t.isEven()?new y(t):new v(t),this.exp(e,r)},a.ZERO=p(0),a.ONE=p(1),w.prototype.convert=T,w.prototype.revert=T,w.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r)},w.prototype.sqrTo=function(e,t){e.squareTo(t)},A.prototype.convert=function(e){if(e.s<0||e.t>2*this.m.t)return e.mod(this.m);if(e.compareTo(this.m)<0)return e;var t=o();return e.copyTo(t),this.reduce(t),t},A.prototype.revert=function(e){return e},A.prototype.reduce=function(e){for(e.drShiftTo(this.m.t-1,this.r2),e.t>this.m.t+1&&(e.t=this.m.t+1,e.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);e.compareTo(this.r2)<0;)e.dAddOffset(1,this.m.t+1);for(e.subTo(this.r2,e);e.compareTo(this.m)>=0;)e.subTo(this.m,e)},A.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},A.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)};var I=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509],k=(1<<26)/I[I.length-1];a.prototype.chunkSize=function(e){return Math.floor(Math.LN2*this.DB/Math.log(e))},a.prototype.toRadix=function(e){if(null==e&&(e=10),0==this.signum()||e<2||e>36)return"0";var t=this.chunkSize(e),r=Math.pow(e,t),n=p(r),i=o(),a=o(),s="";for(this.divRemTo(n,i,a);i.signum()>0;)s=(r+a.intValue()).toString(e).substr(1)+s,i.divRemTo(n,i,a);return a.intValue().toString(e)+s},a.prototype.fromRadix=function(e,t){this.fromInt(0),null==t&&(t=10);for(var r=this.chunkSize(t),n=Math.pow(t,r),i=!1,o=0,s=0,u=0;u<e.length;++u){var c=h(e,u);c<0?"-"==e.charAt(u)&&0==this.signum()&&(i=!0):(s=t*s+c,++o>=r&&(this.dMultiply(n),this.dAddOffset(s,0),o=0,s=0))}o>0&&(this.dMultiply(Math.pow(t,o)),this.dAddOffset(s,0)),i&&a.ZERO.subTo(this,this)},a.prototype.fromNumber=function(e,t,r){if("number"==typeof t)if(e<2)this.fromInt(1);else for(this.fromNumber(e,r),this.testBit(e-1)||this.bitwiseTo(a.ONE.shiftLeft(e-1),m,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(t);)this.dAddOffset(2,0),this.bitLength()>e&&this.subTo(a.ONE.shiftLeft(e-1),this);else{var n=new Array,i=7&e;n.length=1+(e>>3),t.nextBytes(n),i>0?n[0]&=(1<<i)-1:n[0]=0,this.fromString(n,256)}},a.prototype.bitwiseTo=function(e,t,r){var n,i,a=Math.min(e.t,this.t);for(n=0;n<a;++n)r.data[n]=t(this.data[n],e.data[n]);if(e.t<this.t){for(i=e.s&this.DM,n=a;n<this.t;++n)r.data[n]=t(this.data[n],i);r.t=this.t}else{for(i=this.s&this.DM,n=a;n<e.t;++n)r.data[n]=t(i,e.data[n]);r.t=e.t}r.s=t(this.s,e.s),r.clamp()},a.prototype.changeBit=function(e,t){var r=a.ONE.shiftLeft(e);return this.bitwiseTo(r,t,r),r},a.prototype.addTo=function(e,t){for(var r=0,n=0,i=Math.min(e.t,this.t);r<i;)n+=this.data[r]+e.data[r],t.data[r++]=n&this.DM,n>>=this.DB;if(e.t<this.t){for(n+=e.s;r<this.t;)n+=this.data[r],t.data[r++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;r<e.t;)n+=e.data[r],t.data[r++]=n&this.DM,n>>=this.DB;n+=e.s}t.s=n<0?-1:0,n>0?t.data[r++]=n:n<-1&&(t.data[r++]=this.DV+n),t.t=r,t.clamp()},a.prototype.dMultiply=function(e){this.data[this.t]=this.am(0,e-1,this,0,0,this.t),++this.t,this.clamp()},a.prototype.dAddOffset=function(e,t){if(0!=e){for(;this.t<=t;)this.data[this.t++]=0;for(this.data[t]+=e;this.data[t]>=this.DV;)this.data[t]-=this.DV,++t>=this.t&&(this.data[this.t++]=0),++this.data[t]}},a.prototype.multiplyLowerTo=function(e,t,r){var n,i=Math.min(this.t+e.t,t);for(r.s=0,r.t=i;i>0;)r.data[--i]=0;for(n=r.t-this.t;i<n;++i)r.data[i+this.t]=this.am(0,e.data[i],r,i,0,this.t);for(n=Math.min(e.t,t);i<n;++i)this.am(0,e.data[i],r,i,0,t-i);r.clamp()},a.prototype.multiplyUpperTo=function(e,t,r){--t;var n=r.t=this.t+e.t-t;for(r.s=0;--n>=0;)r.data[n]=0;for(n=Math.max(t-this.t,0);n<e.t;++n)r.data[this.t+n-t]=this.am(t-n,e.data[n],r,0,0,this.t+n-t);r.clamp(),r.drShiftTo(1,r)},a.prototype.modInt=function(e){if(e<=0)return 0;var t=this.DV%e,r=this.s<0?e-1:0;if(this.t>0)if(0==t)r=this.data[0]%e;else for(var n=this.t-1;n>=0;--n)r=(t*r+this.data[n])%e;return r},a.prototype.millerRabin=function(e){var t=this.subtract(a.ONE),r=t.getLowestSetBit();if(r<=0)return!1;for(var n,i=t.shiftRight(r),o={nextBytes:function(e){for(var t=0;t<e.length;++t)e[t]=Math.floor(256*Math.random())}},s=0;s<e;++s){do{n=new a(this.bitLength(),o)}while(n.compareTo(a.ONE)<=0||n.compareTo(t)>=0);var u=n.modPow(i,this);if(0!=u.compareTo(a.ONE)&&0!=u.compareTo(t)){for(var c=1;c++<r&&0!=u.compareTo(t);)if(0==(u=u.modPowInt(2,this)).compareTo(a.ONE))return!1;if(0!=u.compareTo(t))return!1}}return!0},a.prototype.clone=function(){var e=o();return this.copyTo(e),e},a.prototype.intValue=function(){if(this.s<0){if(1==this.t)return this.data[0]-this.DV;if(0==this.t)return-1}else{if(1==this.t)return this.data[0];if(0==this.t)return 0}return(this.data[1]&(1<<32-this.DB)-1)<<this.DB|this.data[0]},a.prototype.byteValue=function(){return 0==this.t?this.s:this.data[0]<<24>>24},a.prototype.shortValue=function(){return 0==this.t?this.s:this.data[0]<<16>>16},a.prototype.signum=function(){return this.s<0?-1:this.t<=0||1==this.t&&this.data[0]<=0?0:1},a.prototype.toByteArray=function(){var e=this.t,t=new Array;t[0]=this.s;var r,n=this.DB-e*this.DB%8,i=0;if(e-- >0)for(n<this.DB&&(r=this.data[e]>>n)!=(this.s&this.DM)>>n&&(t[i++]=r|this.s<<this.DB-n);e>=0;)n<8?(r=(this.data[e]&(1<<n)-1)<<8-n,r|=this.data[--e]>>(n+=this.DB-8)):(r=this.data[e]>>(n-=8)&255,n<=0&&(n+=this.DB,--e)),0!=(128&r)&&(r|=-256),0==i&&(128&this.s)!=(128&r)&&++i,(i>0||r!=this.s)&&(t[i++]=r);return t},a.prototype.equals=function(e){return 0==this.compareTo(e)},a.prototype.min=function(e){return this.compareTo(e)<0?this:e},a.prototype.max=function(e){return this.compareTo(e)>0?this:e},a.prototype.and=function(e){var t=o();return this.bitwiseTo(e,g,t),t},a.prototype.or=function(e){var t=o();return this.bitwiseTo(e,m,t),t},a.prototype.xor=function(e){var t=o();return this.bitwiseTo(e,b,t),t},a.prototype.andNot=function(e){var t=o();return this.bitwiseTo(e,E,t),t},a.prototype.not=function(){for(var e=o(),t=0;t<this.t;++t)e.data[t]=this.DM&~this.data[t];return e.t=this.t,e.s=~this.s,e},a.prototype.shiftLeft=function(e){var t=o();return e<0?this.rShiftTo(-e,t):this.lShiftTo(e,t),t},a.prototype.shiftRight=function(e){var t=o();return e<0?this.lShiftTo(-e,t):this.rShiftTo(e,t),t},a.prototype.getLowestSetBit=function(){for(var e=0;e<this.t;++e)if(0!=this.data[e])return e*this.DB+S(this.data[e]);return this.s<0?this.t*this.DB:-1},a.prototype.bitCount=function(){for(var e=0,t=this.s&this.DM,r=0;r<this.t;++r)e+=C(this.data[r]^t);return e},a.prototype.testBit=function(e){var t=Math.floor(e/this.DB);return t>=this.t?0!=this.s:0!=(this.data[t]&1<<e%this.DB)},a.prototype.setBit=function(e){return this.changeBit(e,m)},a.prototype.clearBit=function(e){return this.changeBit(e,E)},a.prototype.flipBit=function(e){return this.changeBit(e,b)},a.prototype.add=function(e){var t=o();return this.addTo(e,t),t},a.prototype.subtract=function(e){var t=o();return this.subTo(e,t),t},a.prototype.multiply=function(e){var t=o();return this.multiplyTo(e,t),t},a.prototype.divide=function(e){var t=o();return this.divRemTo(e,t,null),t},a.prototype.remainder=function(e){var t=o();return this.divRemTo(e,null,t),t},a.prototype.divideAndRemainder=function(e){var t=o(),r=o();return this.divRemTo(e,t,r),new Array(t,r)},a.prototype.modPow=function(e,t){var r,n,i=e.bitLength(),a=p(1);if(i<=0)return a;r=i<18?1:i<48?3:i<144?4:i<768?5:6,n=i<8?new y(t):t.isEven()?new A(t):new v(t);var s=new Array,u=3,c=r-1,l=(1<<r)-1;if(s[1]=n.convert(this),r>1){var f=o();for(n.sqrTo(s[1],f);u<=l;)s[u]=o(),n.mulTo(f,s[u-2],s[u]),u+=2}var h,g,m=e.t-1,b=!0,E=o();for(i=d(e.data[m])-1;m>=0;){for(i>=c?h=e.data[m]>>i-c&l:(h=(e.data[m]&(1<<i+1)-1)<<c-i,m>0&&(h|=e.data[m-1]>>this.DB+i-c)),u=r;0==(1&h);)h>>=1,--u;if((i-=u)<0&&(i+=this.DB,--m),b)s[h].copyTo(a),b=!1;else{for(;u>1;)n.sqrTo(a,E),n.sqrTo(E,a),u-=2;u>0?n.sqrTo(a,E):(g=a,a=E,E=g),n.mulTo(E,s[h],a)}for(;m>=0&&0==(e.data[m]&1<<i);)n.sqrTo(a,E),g=a,a=E,E=g,--i<0&&(i=this.DB-1,--m)}return n.revert(a)},a.prototype.modInverse=function(e){var t=e.isEven();if(this.isEven()&&t||0==e.signum())return a.ZERO;for(var r=e.clone(),n=this.clone(),i=p(1),o=p(0),s=p(0),u=p(1);0!=r.signum();){for(;r.isEven();)r.rShiftTo(1,r),t?(i.isEven()&&o.isEven()||(i.addTo(this,i),o.subTo(e,o)),i.rShiftTo(1,i)):o.isEven()||o.subTo(e,o),o.rShiftTo(1,o);for(;n.isEven();)n.rShiftTo(1,n),t?(s.isEven()&&u.isEven()||(s.addTo(this,s),u.subTo(e,u)),s.rShiftTo(1,s)):u.isEven()||u.subTo(e,u),u.rShiftTo(1,u);r.compareTo(n)>=0?(r.subTo(n,r),t&&i.subTo(s,i),o.subTo(u,o)):(n.subTo(r,n),t&&s.subTo(i,s),u.subTo(o,u))}return 0!=n.compareTo(a.ONE)?a.ZERO:u.compareTo(e)>=0?u.subtract(e):u.signum()<0?(u.addTo(e,u),u.signum()<0?u.add(e):u):u},a.prototype.pow=function(e){return this.exp(e,new w)},a.prototype.gcd=function(e){var t=this.s<0?this.negate():this.clone(),r=e.s<0?e.negate():e.clone();if(t.compareTo(r)<0){var n=t;t=r,r=n}var i=t.getLowestSetBit(),a=r.getLowestSetBit();if(a<0)return t;for(i<a&&(a=i),a>0&&(t.rShiftTo(a,t),r.rShiftTo(a,r));t.signum()>0;)(i=t.getLowestSetBit())>0&&t.rShiftTo(i,t),(i=r.getLowestSetBit())>0&&r.rShiftTo(i,r),t.compareTo(r)>=0?(t.subTo(r,t),t.rShiftTo(1,t)):(r.subTo(t,r),r.rShiftTo(1,r));return a>0&&r.lShiftTo(a,r),r},a.prototype.isProbablePrime=function(e){var t,r=this.abs();if(1==r.t&&r.data[0]<=I[I.length-1]){for(t=0;t<I.length;++t)if(r.data[0]==I[t])return!0;return!1}if(r.isEven())return!1;for(t=1;t<I.length;){for(var n=I[t],i=t+1;i<I.length&&n<k;)n*=I[i++];for(n=r.modInt(n);t<i;)if(n%I[t++]==0)return!1}return r.millerRabin(e)}},8991:function(e,t,r){var n=r(3832);e.exports=n.md=n.md||{},n.md.algorithms=n.md.algorithms||{}},6971:function(e,t,r){var n=r(3832);r(3453),e.exports=n.mgf=n.mgf||{},n.mgf.mgf1=n.mgf1},3453:function(e,t,r){var n=r(3832);r(7116),n.mgf=n.mgf||{},(e.exports=n.mgf.mgf1=n.mgf1=n.mgf1||{}).create=function(e){return{generate:function(t,r){for(var i=new n.util.ByteBuffer,a=Math.ceil(r/e.digestLength),o=0;o<a;o++){var s=new n.util.ByteBuffer;s.putInt32(o),e.start(),e.update(t+s.getBytes()),i.putBuffer(e.digest())}return i.truncate(i.length()-r),i.getBytes()}}}},6270:function(e,t,r){var n=r(3832);n.pki=n.pki||{};var i=e.exports=n.pki.oids=n.oids=n.oids||{};function a(e,t){i[e]=t,i[t]=e}function o(e,t){i[e]=t}a("1.2.840.113549.1.1.1","rsaEncryption"),a("1.2.840.113549.1.1.4","md5WithRSAEncryption"),a("1.2.840.113549.1.1.5","sha1WithRSAEncryption"),a("1.2.840.113549.1.1.7","RSAES-OAEP"),a("1.2.840.113549.1.1.8","mgf1"),a("1.2.840.113549.1.1.9","pSpecified"),a("1.2.840.113549.1.1.10","RSASSA-PSS"),a("1.2.840.113549.1.1.11","sha256WithRSAEncryption"),a("1.2.840.113549.1.1.12","sha384WithRSAEncryption"),a("1.2.840.113549.1.1.13","sha512WithRSAEncryption"),a("1.3.101.112","EdDSA25519"),a("1.2.840.10040.4.3","dsa-with-sha1"),a("1.3.14.3.2.7","desCBC"),a("1.3.14.3.2.26","sha1"),a("2.16.840.1.101.3.4.2.1","sha256"),a("2.16.840.1.101.3.4.2.2","sha384"),a("2.16.840.1.101.3.4.2.3","sha512"),a("1.2.840.113549.2.5","md5"),a("1.2.840.113549.1.7.1","data"),a("1.2.840.113549.1.7.2","signedData"),a("1.2.840.113549.1.7.3","envelopedData"),a("1.2.840.113549.1.7.4","signedAndEnvelopedData"),a("1.2.840.113549.1.7.5","digestedData"),a("1.2.840.113549.1.7.6","encryptedData"),a("1.2.840.113549.1.9.1","emailAddress"),a("1.2.840.113549.1.9.2","unstructuredName"),a("1.2.840.113549.1.9.3","contentType"),a("1.2.840.113549.1.9.4","messageDigest"),a("1.2.840.113549.1.9.5","signingTime"),a("1.2.840.113549.1.9.6","counterSignature"),a("1.2.840.113549.1.9.7","challengePassword"),a("1.2.840.113549.1.9.8","unstructuredAddress"),a("1.2.840.113549.1.9.14","extensionRequest"),a("1.2.840.113549.1.9.20","friendlyName"),a("1.2.840.113549.1.9.21","localKeyId"),a("1.2.840.113549.1.9.22.1","x509Certificate"),a("1.2.840.113549.1.12.10.1.1","keyBag"),a("1.2.840.113549.1.12.10.1.2","pkcs8ShroudedKeyBag"),a("1.2.840.113549.1.12.10.1.3","certBag"),a("1.2.840.113549.1.12.10.1.4","crlBag"),a("1.2.840.113549.1.12.10.1.5","secretBag"),a("1.2.840.113549.1.12.10.1.6","safeContentsBag"),a("1.2.840.113549.1.5.13","pkcs5PBES2"),a("1.2.840.113549.1.5.12","pkcs5PBKDF2"),a("1.2.840.113549.1.12.1.1","pbeWithSHAAnd128BitRC4"),a("1.2.840.113549.1.12.1.2","pbeWithSHAAnd40BitRC4"),a("1.2.840.113549.1.12.1.3","pbeWithSHAAnd3-KeyTripleDES-CBC"),a("1.2.840.113549.1.12.1.4","pbeWithSHAAnd2-KeyTripleDES-CBC"),a("1.2.840.113549.1.12.1.5","pbeWithSHAAnd128BitRC2-CBC"),a("1.2.840.113549.1.12.1.6","pbewithSHAAnd40BitRC2-CBC"),a("1.2.840.113549.2.7","hmacWithSHA1"),a("1.2.840.113549.2.8","hmacWithSHA224"),a("1.2.840.113549.2.9","hmacWithSHA256"),a("1.2.840.113549.2.10","hmacWithSHA384"),a("1.2.840.113549.2.11","hmacWithSHA512"),a("1.2.840.113549.3.7","des-EDE3-CBC"),a("2.16.840.1.101.3.4.1.2","aes128-CBC"),a("2.16.840.1.101.3.4.1.22","aes192-CBC"),a("2.16.840.1.101.3.4.1.42","aes256-CBC"),a("2.5.4.3","commonName"),a("2.5.4.5","serialName"),a("2.5.4.6","countryName"),a("2.5.4.7","localityName"),a("2.5.4.8","stateOrProvinceName"),a("2.5.4.9","streetAddress"),a("2.5.4.10","organizationName"),a("2.5.4.11","organizationalUnitName"),a("2.5.4.13","description"),a("2.5.4.15","businessCategory"),a("2.5.4.17","postalCode"),a("1.3.6.1.4.1.311.60.2.1.2","jurisdictionOfIncorporationStateOrProvinceName"),a("1.3.6.1.4.1.311.60.2.1.3","jurisdictionOfIncorporationCountryName"),a("2.16.840.1.113730.1.1","nsCertType"),a("2.16.840.1.113730.1.13","nsComment"),o("2.5.29.1","authorityKeyIdentifier"),o("2.5.29.2","keyAttributes"),o("2.5.29.3","certificatePolicies"),o("2.5.29.4","keyUsageRestriction"),o("2.5.29.5","policyMapping"),o("2.5.29.6","subtreesConstraint"),o("2.5.29.7","subjectAltName"),o("2.5.29.8","issuerAltName"),o("2.5.29.9","subjectDirectoryAttributes"),o("2.5.29.10","basicConstraints"),o("2.5.29.11","nameConstraints"),o("2.5.29.12","policyConstraints"),o("2.5.29.13","basicConstraints"),a("2.5.29.14","subjectKeyIdentifier"),a("2.5.29.15","keyUsage"),o("2.5.29.16","privateKeyUsagePeriod"),a("2.5.29.17","subjectAltName"),a("2.5.29.18","issuerAltName"),a("2.5.29.19","basicConstraints"),o("2.5.29.20","cRLNumber"),o("2.5.29.21","cRLReason"),o("2.5.29.22","expirationDate"),o("2.5.29.23","instructionCode"),o("2.5.29.24","invalidityDate"),o("2.5.29.25","cRLDistributionPoints"),o("2.5.29.26","issuingDistributionPoint"),o("2.5.29.27","deltaCRLIndicator"),o("2.5.29.28","issuingDistributionPoint"),o("2.5.29.29","certificateIssuer"),o("2.5.29.30","nameConstraints"),a("2.5.29.31","cRLDistributionPoints"),a("2.5.29.32","certificatePolicies"),o("2.5.29.33","policyMappings"),o("2.5.29.34","policyConstraints"),a("2.5.29.35","authorityKeyIdentifier"),o("2.5.29.36","policyConstraints"),a("2.5.29.37","extKeyUsage"),o("2.5.29.46","freshestCRL"),o("2.5.29.54","inhibitAnyPolicy"),a("1.3.6.1.4.1.11129.2.4.2","timestampList"),a("1.3.6.1.5.5.7.1.1","authorityInfoAccess"),a("1.3.6.1.5.5.7.3.1","serverAuth"),a("1.3.6.1.5.5.7.3.2","clientAuth"),a("1.3.6.1.5.5.7.3.3","codeSigning"),a("1.3.6.1.5.5.7.3.4","emailProtection"),a("1.3.6.1.5.5.7.3.8","timeStamping")},7450:function(e,t,r){var n=r(3832);if(r(8925),r(3068),r(3480),r(8991),r(6270),r(8960),r(6953),r(9563),r(9372),r(8095),r(7116),void 0===i)var i=n.jsbn.BigInteger;var a=n.asn1,o=n.pki=n.pki||{};e.exports=o.pbe=n.pbe=n.pbe||{};var s=o.oids,u={name:"EncryptedPrivateKeyInfo",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedPrivateKeyInfo.encryptionAlgorithm",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:a.Class.UNIVERSAL,type:a.Type.OID,constructed:!1,capture:"encryptionOid"},{name:"AlgorithmIdentifier.parameters",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,captureAsn1:"encryptionParams"}]},{name:"EncryptedPrivateKeyInfo.encryptedData",tagClass:a.Class.UNIVERSAL,type:a.Type.OCTETSTRING,constructed:!1,capture:"encryptedData"}]},c={name:"PBES2Algorithms",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc.oid",tagClass:a.Class.UNIVERSAL,type:a.Type.OID,constructed:!1,capture:"kdfOid"},{name:"PBES2Algorithms.params",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.params.salt",tagClass:a.Class.UNIVERSAL,type:a.Type.OCTETSTRING,constructed:!1,capture:"kdfSalt"},{name:"PBES2Algorithms.params.iterationCount",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"kdfIterationCount"},{name:"PBES2Algorithms.params.keyLength",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,optional:!0,capture:"keyLength"},{name:"PBES2Algorithms.params.prf",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,optional:!0,value:[{name:"PBES2Algorithms.params.prf.algorithm",tagClass:a.Class.UNIVERSAL,type:a.Type.OID,constructed:!1,capture:"prfOid"}]}]}]},{name:"PBES2Algorithms.encryptionScheme",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.encryptionScheme.oid",tagClass:a.Class.UNIVERSAL,type:a.Type.OID,constructed:!1,capture:"encOid"},{name:"PBES2Algorithms.encryptionScheme.iv",tagClass:a.Class.UNIVERSAL,type:a.Type.OCTETSTRING,constructed:!1,capture:"encIv"}]}]},l={name:"pkcs-12PbeParams",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"pkcs-12PbeParams.salt",tagClass:a.Class.UNIVERSAL,type:a.Type.OCTETSTRING,constructed:!1,capture:"salt"},{name:"pkcs-12PbeParams.iterations",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"iterations"}]};function f(e,t){return e.start().update(t).digest().getBytes()}function h(e){var t;if(e){if(!(t=o.oids[a.derToOid(e)])){var r=new Error("Unsupported PRF OID.");throw r.oid=e,r.supported=["hmacWithSHA1","hmacWithSHA224","hmacWithSHA256","hmacWithSHA384","hmacWithSHA512"],r}}else t="hmacWithSHA1";return p(t)}function p(e){var t=n.md;switch(e){case"hmacWithSHA224":t=n.md.sha512;case"hmacWithSHA1":case"hmacWithSHA256":case"hmacWithSHA384":case"hmacWithSHA512":e=e.substr(8).toLowerCase();break;default:var r=new Error("Unsupported PRF algorithm.");throw r.algorithm=e,r.supported=["hmacWithSHA1","hmacWithSHA224","hmacWithSHA256","hmacWithSHA384","hmacWithSHA512"],r}if(!t||!(e in t))throw new Error("Unknown hash algorithm: "+e);return t[e].create()}o.encryptPrivateKeyInfo=function(e,t,r){(r=r||{}).saltSize=r.saltSize||8,r.count=r.count||2048,r.algorithm=r.algorithm||"aes128",r.prfAlgorithm=r.prfAlgorithm||"sha1";var i,u,c,l=n.random.getBytesSync(r.saltSize),f=r.count,h=a.integerToDer(f);if(0===r.algorithm.indexOf("aes")||"des"===r.algorithm){var d,y,v;switch(r.algorithm){case"aes128":i=16,d=16,y=s["aes128-CBC"],v=n.aes.createEncryptionCipher;break;case"aes192":i=24,d=16,y=s["aes192-CBC"],v=n.aes.createEncryptionCipher;break;case"aes256":i=32,d=16,y=s["aes256-CBC"],v=n.aes.createEncryptionCipher;break;case"des":i=8,d=8,y=s.desCBC,v=n.des.createEncryptionCipher;break;default:throw(C=new Error("Cannot encrypt private key. Unknown encryption algorithm.")).algorithm=r.algorithm,C}var g="hmacWith"+r.prfAlgorithm.toUpperCase(),m=p(g),b=n.pkcs5.pbkdf2(t,l,f,i,m),E=n.random.getBytesSync(d);(w=v(b)).start(E),w.update(a.toDer(e)),w.finish(),c=w.output.getBytes();var S=function(e,t,r,i){var s=a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.OCTETSTRING,!1,e),a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,t.getBytes())]);"hmacWithSHA1"!==i&&s.value.push(a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,n.util.hexToBytes(r.toString(16))),a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.OID,!1,a.oidToDer(o.oids[i]).getBytes()),a.create(a.Class.UNIVERSAL,a.Type.NULL,!1,"")]));return s}(l,h,i,g);u=a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.OID,!1,a.oidToDer(s.pkcs5PBES2).getBytes()),a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.OID,!1,a.oidToDer(s.pkcs5PBKDF2).getBytes()),S]),a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.OID,!1,a.oidToDer(y).getBytes()),a.create(a.Class.UNIVERSAL,a.Type.OCTETSTRING,!1,E)])])])}else{var C;if("3des"!==r.algorithm)throw(C=new Error("Cannot encrypt private key. Unknown encryption algorithm.")).algorithm=r.algorithm,C;i=24;var w,T=new n.util.ByteBuffer(l);b=o.pbe.generatePkcs12Key(t,T,1,f,i),E=o.pbe.generatePkcs12Key(t,T,2,f,i);(w=n.des.createEncryptionCipher(b)).start(E),w.update(a.toDer(e)),w.finish(),c=w.output.getBytes(),u=a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.OID,!1,a.oidToDer(s["pbeWithSHAAnd3-KeyTripleDES-CBC"]).getBytes()),a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.OCTETSTRING,!1,l),a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,h.getBytes())])])}return a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[u,a.create(a.Class.UNIVERSAL,a.Type.OCTETSTRING,!1,c)])},o.decryptPrivateKeyInfo=function(e,t){var r=null,i={},s=[];if(!a.validate(e,u,i,s)){var c=new Error("Cannot read encrypted private key. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw c.errors=s,c}var l=a.derToOid(i.encryptionOid),f=o.pbe.getCipher(l,i.encryptionParams,t),h=n.util.createBuffer(i.encryptedData);return f.update(h),f.finish()&&(r=a.fromDer(f.output)),r},o.encryptedPrivateKeyToPem=function(e,t){var r={type:"ENCRYPTED PRIVATE KEY",body:a.toDer(e).getBytes()};return n.pem.encode(r,{maxline:t})},o.encryptedPrivateKeyFromPem=function(e){var t=n.pem.decode(e)[0];if("ENCRYPTED PRIVATE KEY"!==t.type){var r=new Error('Could not convert encrypted private key from PEM; PEM header type is "ENCRYPTED PRIVATE KEY".');throw r.headerType=t.type,r}if(t.procType&&"ENCRYPTED"===t.procType.type)throw new Error("Could not convert encrypted private key from PEM; PEM is encrypted.");return a.fromDer(t.body)},o.encryptRsaPrivateKey=function(e,t,r){if(!(r=r||{}).legacy){var i=o.wrapRsaPrivateKey(o.privateKeyToAsn1(e));return i=o.encryptPrivateKeyInfo(i,t,r),o.encryptedPrivateKeyToPem(i)}var s,u,c,l;switch(r.algorithm){case"aes128":s="AES-128-CBC",c=16,u=n.random.getBytesSync(16),l=n.aes.createEncryptionCipher;break;case"aes192":s="AES-192-CBC",c=24,u=n.random.getBytesSync(16),l=n.aes.createEncryptionCipher;break;case"aes256":s="AES-256-CBC",c=32,u=n.random.getBytesSync(16),l=n.aes.createEncryptionCipher;break;case"3des":s="DES-EDE3-CBC",c=24,u=n.random.getBytesSync(8),l=n.des.createEncryptionCipher;break;case"des":s="DES-CBC",c=8,u=n.random.getBytesSync(8),l=n.des.createEncryptionCipher;break;default:var f=new Error('Could not encrypt RSA private key; unsupported encryption algorithm "'+r.algorithm+'".');throw f.algorithm=r.algorithm,f}var h=l(n.pbe.opensslDeriveBytes(t,u.substr(0,8),c));h.start(u),h.update(a.toDer(o.privateKeyToAsn1(e))),h.finish();var p={type:"RSA PRIVATE KEY",procType:{version:"4",type:"ENCRYPTED"},dekInfo:{algorithm:s,parameters:n.util.bytesToHex(u).toUpperCase()},body:h.output.getBytes()};return n.pem.encode(p)},o.decryptRsaPrivateKey=function(e,t){var r=null,i=n.pem.decode(e)[0];if("ENCRYPTED PRIVATE KEY"!==i.type&&"PRIVATE KEY"!==i.type&&"RSA PRIVATE KEY"!==i.type)throw(c=new Error('Could not convert private key from PEM; PEM header type is not "ENCRYPTED PRIVATE KEY", "PRIVATE KEY", or "RSA PRIVATE KEY".')).headerType=c,c;if(i.procType&&"ENCRYPTED"===i.procType.type){var s,u;switch(i.dekInfo.algorithm){case"DES-CBC":s=8,u=n.des.createDecryptionCipher;break;case"DES-EDE3-CBC":s=24,u=n.des.createDecryptionCipher;break;case"AES-128-CBC":s=16,u=n.aes.createDecryptionCipher;break;case"AES-192-CBC":s=24,u=n.aes.createDecryptionCipher;break;case"AES-256-CBC":s=32,u=n.aes.createDecryptionCipher;break;case"RC2-40-CBC":s=5,u=function(e){return n.rc2.createDecryptionCipher(e,40)};break;case"RC2-64-CBC":s=8,u=function(e){return n.rc2.createDecryptionCipher(e,64)};break;case"RC2-128-CBC":s=16,u=function(e){return n.rc2.createDecryptionCipher(e,128)};break;default:var c;throw(c=new Error('Could not decrypt private key; unsupported encryption algorithm "'+i.dekInfo.algorithm+'".')).algorithm=i.dekInfo.algorithm,c}var l=n.util.hexToBytes(i.dekInfo.parameters),f=u(n.pbe.opensslDeriveBytes(t,l.substr(0,8),s));if(f.start(l),f.update(n.util.createBuffer(i.body)),!f.finish())return r;r=f.output.getBytes()}else r=i.body;return null!==(r="ENCRYPTED PRIVATE KEY"===i.type?o.decryptPrivateKeyInfo(a.fromDer(r),t):a.fromDer(r))&&(r=o.privateKeyFromAsn1(r)),r},o.pbe.generatePkcs12Key=function(e,t,r,i,a,o){var s,u;if(null==o){if(!("sha1"in n.md))throw new Error('"sha1" hash algorithm unavailable.');o=n.md.sha1.create()}var c=o.digestLength,l=o.blockLength,f=new n.util.ByteBuffer,h=new n.util.ByteBuffer;if(null!=e){for(u=0;u<e.length;u++)h.putInt16(e.charCodeAt(u));h.putInt16(0)}var p=h.length(),d=t.length(),y=new n.util.ByteBuffer;y.fillWithByte(r,l);var v=l*Math.ceil(d/l),g=new n.util.ByteBuffer;for(u=0;u<v;u++)g.putByte(t.at(u%d));var m=l*Math.ceil(p/l),b=new n.util.ByteBuffer;for(u=0;u<m;u++)b.putByte(h.at(u%p));var E=g;E.putBuffer(b);for(var S=Math.ceil(a/c),C=1;C<=S;C++){var w=new n.util.ByteBuffer;w.putBytes(y.bytes()),w.putBytes(E.bytes());for(var T=0;T<i;T++)o.start(),o.update(w.getBytes()),w=o.digest();var A=new n.util.ByteBuffer;for(u=0;u<l;u++)A.putByte(w.at(u%c));var I=Math.ceil(d/l)+Math.ceil(p/l),k=new n.util.ByteBuffer;for(s=0;s<I;s++){var _=new n.util.ByteBuffer(E.getBytes(l)),B=511;for(u=A.length()-1;u>=0;u--)B>>=8,B+=A.at(u)+_.at(u),_.setAt(u,255&B);k.putBuffer(_)}E=k,f.putBuffer(w)}return f.truncate(f.length()-a),f},o.pbe.getCipher=function(e,t,r){switch(e){case o.oids.pkcs5PBES2:return o.pbe.getCipherForPBES2(e,t,r);case o.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:case o.oids["pbewithSHAAnd40BitRC2-CBC"]:return o.pbe.getCipherForPKCS12PBE(e,t,r);default:var n=new Error("Cannot read encrypted PBE data block. Unsupported OID.");throw n.oid=e,n.supportedOids=["pkcs5PBES2","pbeWithSHAAnd3-KeyTripleDES-CBC","pbewithSHAAnd40BitRC2-CBC"],n}},o.pbe.getCipherForPBES2=function(e,t,r){var i,s={},u=[];if(!a.validate(t,c,s,u))throw(i=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.")).errors=u,i;if((e=a.derToOid(s.kdfOid))!==o.oids.pkcs5PBKDF2)throw(i=new Error("Cannot read encrypted private key. Unsupported key derivation function OID.")).oid=e,i.supportedOids=["pkcs5PBKDF2"],i;if((e=a.derToOid(s.encOid))!==o.oids["aes128-CBC"]&&e!==o.oids["aes192-CBC"]&&e!==o.oids["aes256-CBC"]&&e!==o.oids["des-EDE3-CBC"]&&e!==o.oids.desCBC)throw(i=new Error("Cannot read encrypted private key. Unsupported encryption scheme OID.")).oid=e,i.supportedOids=["aes128-CBC","aes192-CBC","aes256-CBC","des-EDE3-CBC","desCBC"],i;var l,f,p=s.kdfSalt,d=n.util.createBuffer(s.kdfIterationCount);switch(d=d.getInt(d.length()<<3),o.oids[e]){case"aes128-CBC":l=16,f=n.aes.createDecryptionCipher;break;case"aes192-CBC":l=24,f=n.aes.createDecryptionCipher;break;case"aes256-CBC":l=32,f=n.aes.createDecryptionCipher;break;case"des-EDE3-CBC":l=24,f=n.des.createDecryptionCipher;break;case"desCBC":l=8,f=n.des.createDecryptionCipher}var y=h(s.prfOid),v=n.pkcs5.pbkdf2(r,p,d,l,y),g=s.encIv,m=f(v);return m.start(g),m},o.pbe.getCipherForPKCS12PBE=function(e,t,r){var i={},s=[];if(!a.validate(t,l,i,s))throw(y=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.")).errors=s,y;var u,c,f,p=n.util.createBuffer(i.salt),d=n.util.createBuffer(i.iterations);switch(d=d.getInt(d.length()<<3),e){case o.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:u=24,c=8,f=n.des.startDecrypting;break;case o.oids["pbewithSHAAnd40BitRC2-CBC"]:u=5,c=8,f=function(e,t){var r=n.rc2.createDecryptionCipher(e,40);return r.start(t,null),r};break;default:var y;throw(y=new Error("Cannot read PKCS #12 PBE data block. Unsupported OID.")).oid=e,y}var v=h(i.prfOid),g=o.pbe.generatePkcs12Key(r,p,1,d,u,v);return v.start(),f(g,o.pbe.generatePkcs12Key(r,p,2,d,c,v))},o.pbe.opensslDeriveBytes=function(e,t,r,i){if(null==i){if(!("md5"in n.md))throw new Error('"md5" hash algorithm unavailable.');i=n.md.md5.create()}null===t&&(t="");for(var a=[f(i,e+t)],o=16,s=1;o<r;++s,o+=16)a.push(f(i,a[s-1]+e+t));return a.join("").substr(0,r)}},8960:function(e,t,r){var n=r(3832);r(6607),r(8991),r(7116);var i,a=n.pkcs5=n.pkcs5||{};n.util.isNodejs&&!n.options.usePureJavaScript&&(i=r(3906)),e.exports=n.pbkdf2=a.pbkdf2=function(e,t,r,a,o,s){if("function"==typeof o&&(s=o,o=null),n.util.isNodejs&&!n.options.usePureJavaScript&&i.pbkdf2&&(null===o||"object"!=typeof o)&&(i.pbkdf2Sync.length>4||!o||"sha1"===o))return"string"!=typeof o&&(o="sha1"),e=Buffer.from(e,"binary"),t=Buffer.from(t,"binary"),s?4===i.pbkdf2Sync.length?i.pbkdf2(e,t,r,a,(function(e,t){if(e)return s(e);s(null,t.toString("binary"))})):i.pbkdf2(e,t,r,a,o,(function(e,t){if(e)return s(e);s(null,t.toString("binary"))})):4===i.pbkdf2Sync.length?i.pbkdf2Sync(e,t,r,a).toString("binary"):i.pbkdf2Sync(e,t,r,a,o).toString("binary");if(null==o&&(o="sha1"),"string"==typeof o){if(!(o in n.md.algorithms))throw new Error("Unknown hash algorithm: "+o);o=n.md[o].create()}var u=o.digestLength;if(a>4294967295*u){var c=new Error("Derived key is too long.");if(s)return s(c);throw c}var l=Math.ceil(a/u),f=a-(l-1)*u,h=n.hmac.create();h.start(o,e);var p,d,y,v="";if(!s){for(var g=1;g<=l;++g){h.start(null,null),h.update(t),h.update(n.util.int32ToBytes(g)),p=y=h.digest().getBytes();for(var m=2;m<=r;++m)h.start(null,null),h.update(y),d=h.digest().getBytes(),p=n.util.xorBytes(p,d,u),y=d;v+=g<l?p:p.substr(0,f)}return v}g=1;function b(){if(g>l)return s(null,v);h.start(null,null),h.update(t),h.update(n.util.int32ToBytes(g)),p=y=h.digest().getBytes(),m=2,E()}function E(){if(m<=r)return h.start(null,null),h.update(y),d=h.digest().getBytes(),p=n.util.xorBytes(p,d,u),y=d,++m,n.util.setImmediate(E);v+=g<l?p:p.substr(0,f),++g,b()}b()}},6953:function(e,t,r){var n=r(3832);r(7116);var i=e.exports=n.pem=n.pem||{};function a(e){for(var t=e.name+": ",r=[],n=function(e,t){return" "+t},i=0;i<e.values.length;++i)r.push(e.values[i].replace(/^(\S+\r\n)/,n));t+=r.join(",")+"\r\n";var a=0,o=-1;for(i=0;i<t.length;++i,++a)if(a>65&&-1!==o){var s=t[o];","===s?(++o,t=t.substr(0,o)+"\r\n "+t.substr(o)):t=t.substr(0,o)+"\r\n"+s+t.substr(o+1),a=i-o-1,o=-1,++i}else" "!==t[i]&&"\t"!==t[i]&&","!==t[i]||(o=i);return t}function o(e){return e.replace(/^\s+/,"")}i.encode=function(e,t){t=t||{};var r,i="-----BEGIN "+e.type+"-----\r\n";if(e.procType&&(i+=a(r={name:"Proc-Type",values:[String(e.procType.version),e.procType.type]})),e.contentDomain&&(i+=a(r={name:"Content-Domain",values:[e.contentDomain]})),e.dekInfo&&(r={name:"DEK-Info",values:[e.dekInfo.algorithm]},e.dekInfo.parameters&&r.values.push(e.dekInfo.parameters),i+=a(r)),e.headers)for(var o=0;o<e.headers.length;++o)i+=a(e.headers[o]);return e.procType&&(i+="\r\n"),i+=n.util.encode64(e.body,t.maxline||64)+"\r\n",i+="-----END "+e.type+"-----\r\n"},i.decode=function(e){for(var t,r=[],i=/\s*-----BEGIN ([A-Z0-9- ]+)-----\r?\n?([\x21-\x7e\s]+?(?:\r?\n\r?\n))?([:A-Za-z0-9+\/=\s]+?)-----END \1-----/g,a=/([\x21-\x7e]+):\s*([\x21-\x7e\s^:]+)/,s=/\r?\n/;t=i.exec(e);){var u={type:t[1],procType:null,contentDomain:null,dekInfo:null,headers:[],body:n.util.decode64(t[3])};if(r.push(u),t[2]){for(var c=t[2].split(s),l=0;t&&l<c.length;){for(var f=c[l].replace(/\s+$/,""),h=l+1;h<c.length;++h){var p=c[h];if(!/\s/.test(p[0]))break;f+=p,l=h}if(t=f.match(a)){for(var d={name:t[1],values:[]},y=t[2].split(","),v=0;v<y.length;++v)d.values.push(o(y[v]));if(u.procType)if(u.contentDomain||"Content-Domain"!==d.name)if(u.dekInfo||"DEK-Info"!==d.name)u.headers.push(d);else{if(0===d.values.length)throw new Error('Invalid PEM formatted message. The "DEK-Info" header must have at least one subfield.');u.dekInfo={algorithm:y[0],parameters:y[1]||null}}else u.contentDomain=y[0]||"";else{if("Proc-Type"!==d.name)throw new Error('Invalid PEM formatted message. The first encapsulated header must be "Proc-Type".');if(2!==d.values.length)throw new Error('Invalid PEM formatted message. The "Proc-Type" header must have two subfields.');u.procType={version:y[0],type:y[1]}}}++l}if("ENCRYPTED"===u.procType&&!u.dekInfo)throw new Error('Invalid PEM formatted message. The "DEK-Info" header must be present if "Proc-Type" is "ENCRYPTED".')}}if(0===r.length)throw new Error("Invalid PEM formatted message.");return r}},8936:function(e,t,r){var n=r(3832);r(7116),r(9563),r(137);var i=e.exports=n.pkcs1=n.pkcs1||{};function a(e,t,r){r||(r=n.md.sha1.create());for(var i="",a=Math.ceil(t/r.digestLength),o=0;o<a;++o){var s=String.fromCharCode(o>>24&255,o>>16&255,o>>8&255,255&o);r.start(),r.update(e+s),i+=r.digest().getBytes()}return i.substring(0,t)}i.encode_rsa_oaep=function(e,t,r){var i,o,s,u;"string"==typeof r?(i=r,o=arguments[3]||void 0,s=arguments[4]||void 0):r&&(i=r.label||void 0,o=r.seed||void 0,s=r.md||void 0,r.mgf1&&r.mgf1.md&&(u=r.mgf1.md)),s?s.start():s=n.md.sha1.create(),u||(u=s);var c=Math.ceil(e.n.bitLength()/8),l=c-2*s.digestLength-2;if(t.length>l)throw(v=new Error("RSAES-OAEP input message length is too long.")).length=t.length,v.maxLength=l,v;i||(i=""),s.update(i,"raw");for(var f=s.digest(),h="",p=l-t.length,d=0;d<p;d++)h+="\0";var y=f.getBytes()+h+""+t;if(o){if(o.length!==s.digestLength){var v;throw(v=new Error("Invalid RSAES-OAEP seed. The seed length must match the digest length.")).seedLength=o.length,v.digestLength=s.digestLength,v}}else o=n.random.getBytes(s.digestLength);var g=a(o,c-s.digestLength-1,u),m=n.util.xorBytes(y,g,y.length),b=a(m,s.digestLength,u),E=n.util.xorBytes(o,b,o.length);return"\0"+E+m},i.decode_rsa_oaep=function(e,t,r){var i,o,s;"string"==typeof r?(i=r,o=arguments[3]||void 0):r&&(i=r.label||void 0,o=r.md||void 0,r.mgf1&&r.mgf1.md&&(s=r.mgf1.md));var u=Math.ceil(e.n.bitLength()/8);if(t.length!==u)throw(m=new Error("RSAES-OAEP encoded message length is invalid.")).length=t.length,m.expectedLength=u,m;if(void 0===o?o=n.md.sha1.create():o.start(),s||(s=o),u<2*o.digestLength+2)throw new Error("RSAES-OAEP key is too short for the hash function.");i||(i=""),o.update(i,"raw");for(var c=o.digest().getBytes(),l=t.charAt(0),f=t.substring(1,o.digestLength+1),h=t.substring(1+o.digestLength),p=a(h,o.digestLength,s),d=n.util.xorBytes(f,p,f.length),y=a(d,u-o.digestLength-1,s),v=n.util.xorBytes(h,y,h.length),g=v.substring(0,o.digestLength),m="\0"!==l,b=0;b<o.digestLength;++b)m|=c.charAt(b)!==g.charAt(b);for(var E=1,S=o.digestLength,C=o.digestLength;C<v.length;C++){var w=v.charCodeAt(C),T=1&w^1,A=E?65534:0;m|=w&A,S+=E&=T}if(m||1!==v.charCodeAt(S))throw new Error("Invalid RSAES-OAEP padding.");return v.substring(S+1)}},5147:function(e,t,r){var n=r(3832);r(3068),r(6607),r(6270),r(5496),r(7450),r(9563),r(8095),r(137),r(7116),r(5414);var i=n.asn1,a=n.pki,o=e.exports=n.pkcs12=n.pkcs12||{},s={name:"ContentInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.contentType",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:i.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:"content"}]},u={name:"PFX",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.version",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"version"},s,{name:"PFX.macData",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"mac",value:[{name:"PFX.macData.mac",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.macData.mac.digestAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.macData.mac.digestAlgorithm.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"macAlgorithm"},{name:"PFX.macData.mac.digestAlgorithm.parameters",tagClass:i.Class.UNIVERSAL,captureAsn1:"macAlgorithmParameters"}]},{name:"PFX.macData.mac.digest",tagClass:i.Class.UNIVERSAL,type:i.Type.OCTETSTRING,constructed:!1,capture:"macDigest"}]},{name:"PFX.macData.macSalt",tagClass:i.Class.UNIVERSAL,type:i.Type.OCTETSTRING,constructed:!1,capture:"macSalt"},{name:"PFX.macData.iterations",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,optional:!0,capture:"macIterations"}]}]},c={name:"SafeBag",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"SafeBag.bagId",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"bagId"},{name:"SafeBag.bagValue",tagClass:i.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:"bagValue"},{name:"SafeBag.bagAttributes",tagClass:i.Class.UNIVERSAL,type:i.Type.SET,constructed:!0,optional:!0,capture:"bagAttributes"}]},l={name:"Attribute",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"Attribute.attrId",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"oid"},{name:"Attribute.attrValues",tagClass:i.Class.UNIVERSAL,type:i.Type.SET,constructed:!0,capture:"values"}]},f={name:"CertBag",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"CertBag.certId",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"certId"},{name:"CertBag.certValue",tagClass:i.Class.CONTEXT_SPECIFIC,constructed:!0,value:[{name:"CertBag.certValue[0]",tagClass:i.Class.UNIVERSAL,type:i.Class.OCTETSTRING,constructed:!1,capture:"cert"}]}]};function h(e,t,r,n){for(var i=[],a=0;a<e.length;a++)for(var o=0;o<e[a].safeBags.length;o++){var s=e[a].safeBags[o];void 0!==n&&s.type!==n||(null!==t?void 0!==s.attributes[t]&&s.attributes[t].indexOf(r)>=0&&i.push(s):i.push(s))}return i}function p(e){if(e.composed||e.constructed){for(var t=n.util.createBuffer(),r=0;r<e.value.length;++r)t.putBytes(e.value[r].value);e.composed=e.constructed=!1,e.value=t.getBytes()}return e}function d(e,t){var r={},o=[];if(!i.validate(e,n.pkcs7.asn1.encryptedDataValidator,r,o))throw(s=new Error("Cannot read EncryptedContentInfo.")).errors=o,s;var s,u=i.derToOid(r.contentType);if(u!==a.oids.data)throw(s=new Error("PKCS#12 EncryptedContentInfo ContentType is not Data.")).oid=u,s;u=i.derToOid(r.encAlgorithm);var c=a.pbe.getCipher(u,r.encParameter,t),l=p(r.encryptedContentAsn1),f=n.util.createBuffer(l.value);if(c.update(f),!c.finish())throw new Error("Failed to decrypt PKCS#12 SafeContents.");return c.output.getBytes()}function y(e,t,r){if(!t&&0===e.length)return[];if((e=i.fromDer(e,t)).tagClass!==i.Class.UNIVERSAL||e.type!==i.Type.SEQUENCE||!0!==e.constructed)throw new Error("PKCS#12 SafeContents expected to be a SEQUENCE OF SafeBag.");for(var n=[],o=0;o<e.value.length;o++){var s=e.value[o],u={},l=[];if(!i.validate(s,c,u,l))throw(g=new Error("Cannot read SafeBag.")).errors=l,g;var h,p,d={type:i.derToOid(u.bagId),attributes:v(u.bagAttributes)};n.push(d);var y=u.bagValue.value[0];switch(d.type){case a.oids.pkcs8ShroudedKeyBag:if(null===(y=a.decryptPrivateKeyInfo(y,r)))throw new Error("Unable to decrypt PKCS#8 ShroudedKeyBag, wrong password?");case a.oids.keyBag:try{d.key=a.privateKeyFromAsn1(y)}catch(e){d.key=null,d.asn1=y}continue;case a.oids.certBag:h=f,p=function(){if(i.derToOid(u.certId)!==a.oids.x509Certificate){var e=new Error("Unsupported certificate type, only X.509 supported.");throw e.oid=i.derToOid(u.certId),e}var r=i.fromDer(u.cert,t);try{d.cert=a.certificateFromAsn1(r,!0)}catch(e){d.cert=null,d.asn1=r}};break;default:var g;throw(g=new Error("Unsupported PKCS#12 SafeBag type.")).oid=d.type,g}if(void 0!==h&&!i.validate(y,h,u,l))throw(g=new Error("Cannot read PKCS#12 "+h.name)).errors=l,g;p()}return n}function v(e){var t={};if(void 0!==e)for(var r=0;r<e.length;++r){var n={},o=[];if(!i.validate(e[r],l,n,o)){var s=new Error("Cannot read PKCS#12 BagAttribute.");throw s.errors=o,s}var u=i.derToOid(n.oid);if(void 0!==a.oids[u]){t[a.oids[u]]=[];for(var c=0;c<n.values.length;++c)t[a.oids[u]].push(n.values[c].value)}}return t}o.pkcs12FromAsn1=function(e,t,r){"string"==typeof t?(r=t,t=!0):void 0===t&&(t=!0);var c={};if(!i.validate(e,u,c,[]))throw(l=new Error("Cannot read PKCS#12 PFX. ASN.1 object is not an PKCS#12 PFX.")).errors=l,l;var l,f={version:c.version.charCodeAt(0),safeContents:[],getBags:function(e){var t,r={};return"localKeyId"in e?t=e.localKeyId:"localKeyIdHex"in e&&(t=n.util.hexToBytes(e.localKeyIdHex)),void 0===t&&!("friendlyName"in e)&&"bagType"in e&&(r[e.bagType]=h(f.safeContents,null,null,e.bagType)),void 0!==t&&(r.localKeyId=h(f.safeContents,"localKeyId",t,e.bagType)),"friendlyName"in e&&(r.friendlyName=h(f.safeContents,"friendlyName",e.friendlyName,e.bagType)),r},getBagsByFriendlyName:function(e,t){return h(f.safeContents,"friendlyName",e,t)},getBagsByLocalKeyId:function(e,t){return h(f.safeContents,"localKeyId",e,t)}};if(3!==c.version.charCodeAt(0))throw(l=new Error("PKCS#12 PFX of version other than 3 not supported.")).version=c.version.charCodeAt(0),l;if(i.derToOid(c.contentType)!==a.oids.data)throw(l=new Error("Only PKCS#12 PFX in password integrity mode supported.")).oid=i.derToOid(c.contentType),l;var v=c.content.value[0];if(v.tagClass!==i.Class.UNIVERSAL||v.type!==i.Type.OCTETSTRING)throw new Error("PKCS#12 authSafe content data is not an OCTET STRING.");if(v=p(v),c.mac){var g=null,m=0,b=i.derToOid(c.macAlgorithm);switch(b){case a.oids.sha1:g=n.md.sha1.create(),m=20;break;case a.oids.sha256:g=n.md.sha256.create(),m=32;break;case a.oids.sha384:g=n.md.sha384.create(),m=48;break;case a.oids.sha512:g=n.md.sha512.create(),m=64;break;case a.oids.md5:g=n.md.md5.create(),m=16}if(null===g)throw new Error("PKCS#12 uses unsupported MAC algorithm: "+b);var E=new n.util.ByteBuffer(c.macSalt),S="macIterations"in c?parseInt(n.util.bytesToHex(c.macIterations),16):1,C=o.generateKey(r,E,3,S,m,g),w=n.hmac.create();if(w.start(g,C),w.update(v.value),w.getMac().getBytes()!==c.macDigest)throw new Error("PKCS#12 MAC could not be verified. Invalid password?")}return function(e,t,r,n){if((t=i.fromDer(t,r)).tagClass!==i.Class.UNIVERSAL||t.type!==i.Type.SEQUENCE||!0!==t.constructed)throw new Error("PKCS#12 AuthenticatedSafe expected to be a SEQUENCE OF ContentInfo");for(var o=0;o<t.value.length;o++){var u=t.value[o],c={},l=[];if(!i.validate(u,s,c,l))throw(g=new Error("Cannot read ContentInfo.")).errors=l,g;var f={encrypted:!1},h=null,v=c.content.value[0];switch(i.derToOid(c.contentType)){case a.oids.data:if(v.tagClass!==i.Class.UNIVERSAL||v.type!==i.Type.OCTETSTRING)throw new Error("PKCS#12 SafeContents Data is not an OCTET STRING.");h=p(v).value;break;case a.oids.encryptedData:h=d(v,n),f.encrypted=!0;break;default:var g;throw(g=new Error("Unsupported PKCS#12 contentType.")).contentType=i.derToOid(c.contentType),g}f.safeBags=y(h,r,n),e.safeContents.push(f)}}(f,v.value,t,r),f},o.toPkcs12Asn1=function(e,t,r,s){(s=s||{}).saltSize=s.saltSize||8,s.count=s.count||2048,s.algorithm=s.algorithm||s.encAlgorithm||"aes128","useMac"in s||(s.useMac=!0),"localKeyId"in s||(s.localKeyId=null),"generateLocalKeyId"in s||(s.generateLocalKeyId=!0);var u,c=s.localKeyId;if(null!==c)c=n.util.hexToBytes(c);else if(s.generateLocalKeyId)if(t){var l=n.util.isArray(t)?t[0]:t;"string"==typeof l&&(l=a.certificateFromPem(l)),(k=n.md.sha1.create()).update(i.toDer(a.certificateToAsn1(l)).getBytes()),c=k.digest().getBytes()}else c=n.random.getBytes(20);var f=[];null!==c&&f.push(i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(a.oids.localKeyId).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SET,!0,[i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,c)])])),"friendlyName"in s&&f.push(i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(a.oids.friendlyName).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SET,!0,[i.create(i.Class.UNIVERSAL,i.Type.BMPSTRING,!1,s.friendlyName)])])),f.length>0&&(u=i.create(i.Class.UNIVERSAL,i.Type.SET,!0,f));var h=[],p=[];null!==t&&(p=n.util.isArray(t)?t:[t]);for(var d=[],y=0;y<p.length;++y){"string"==typeof(t=p[y])&&(t=a.certificateFromPem(t));var v=0===y?u:void 0,g=a.certificateToAsn1(t),m=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(a.oids.certBag).getBytes()),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(a.oids.x509Certificate).getBytes()),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,i.toDer(g).getBytes())])])]),v]);d.push(m)}if(d.length>0){var b=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,d),E=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(a.oids.data).getBytes()),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,i.toDer(b).getBytes())])]);h.push(E)}var S=null;if(null!==e){var C=a.wrapRsaPrivateKey(a.privateKeyToAsn1(e));S=null===r?i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(a.oids.keyBag).getBytes()),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[C]),u]):i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(a.oids.pkcs8ShroudedKeyBag).getBytes()),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[a.encryptPrivateKeyInfo(C,r,s)]),u]);var w=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[S]),T=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(a.oids.data).getBytes()),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,i.toDer(w).getBytes())])]);h.push(T)}var A,I=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,h);if(s.useMac){var k=n.md.sha1.create(),_=new n.util.ByteBuffer(n.random.getBytes(s.saltSize)),B=s.count,N=(e=o.generateKey(r,_,3,B,20),n.hmac.create());N.start(k,e),N.update(i.toDer(I).getBytes());var O=N.getMac();A=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(a.oids.sha1).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.NULL,!1,"")]),i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,O.getBytes())]),i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,_.getBytes()),i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(B).getBytes())])}return i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(3).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(a.oids.data).getBytes()),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,i.toDer(I).getBytes())])]),A])},o.generateKey=n.pbe.generatePkcs12Key},9437:function(e,t,r){var n=r(3832);r(8925),r(3068),r(3480),r(6270),r(6953),r(5496),r(9563),r(7116),r(5414);var i=n.asn1,a=e.exports=n.pkcs7=n.pkcs7||{};function o(e){var t={},r=[];if(!i.validate(e,a.asn1.recipientInfoValidator,t,r)){var o=new Error("Cannot read PKCS#7 RecipientInfo. ASN.1 object is not an PKCS#7 RecipientInfo.");throw o.errors=r,o}return{version:t.version.charCodeAt(0),issuer:n.pki.RDNAttributesAsArray(t.issuer),serialNumber:n.util.createBuffer(t.serial).toHex(),encryptedContent:{algorithm:i.derToOid(t.encAlgorithm),parameter:t.encParameter.value,content:t.encKey}}}function s(e){for(var t,r=[],a=0;a<e.length;++a)r.push((t=e[a],i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(t.version).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[n.pki.distinguishedNameToAsn1({attributes:t.issuer}),i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,n.util.hexToBytes(t.serialNumber))]),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(t.encryptedContent.algorithm).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.NULL,!1,"")]),i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,t.encryptedContent.content)])));return r}function u(e){var t=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(e.version).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[n.pki.distinguishedNameToAsn1({attributes:e.issuer}),i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,n.util.hexToBytes(e.serialNumber))]),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.digestAlgorithm).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.NULL,!1,"")])]);if(e.authenticatedAttributesAsn1&&t.value.push(e.authenticatedAttributesAsn1),t.value.push(i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.signatureAlgorithm).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.NULL,!1,"")])),t.value.push(i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,e.signature)),e.unauthenticatedAttributes.length>0){for(var r=i.create(i.Class.CONTEXT_SPECIFIC,1,!0,[]),a=0;a<e.unauthenticatedAttributes.length;++a){var o=e.unauthenticatedAttributes[a];r.values.push(c(o))}t.value.push(r)}return t}function c(e){var t;if(e.type===n.pki.oids.contentType)t=i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.value).getBytes());else if(e.type===n.pki.oids.messageDigest)t=i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,e.value.bytes());else if(e.type===n.pki.oids.signingTime){var r=new Date("1950-01-01T00:00:00Z"),a=new Date("2050-01-01T00:00:00Z"),o=e.value;if("string"==typeof o){var s=Date.parse(o);o=isNaN(s)?13===o.length?i.utcTimeToDate(o):i.generalizedTimeToDate(o):new Date(s)}t=o>=r&&o<a?i.create(i.Class.UNIVERSAL,i.Type.UTCTIME,!1,i.dateToUtcTime(o)):i.create(i.Class.UNIVERSAL,i.Type.GENERALIZEDTIME,!1,i.dateToGeneralizedTime(o))}return i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.type).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SET,!0,[t])])}function l(e,t,r){var a={};if(!i.validate(t,r,a,[])){var o=new Error("Cannot read PKCS#7 message. ASN.1 object is not a supported PKCS#7 message.");throw o.errors=o,o}if(i.derToOid(a.contentType)!==n.pki.oids.data)throw new Error("Unsupported PKCS#7 message. Only wrapped ContentType Data supported.");if(a.encryptedContent){var s="";if(n.util.isArray(a.encryptedContent))for(var u=0;u<a.encryptedContent.length;++u){if(a.encryptedContent[u].type!==i.Type.OCTETSTRING)throw new Error("Malformed PKCS#7 message, expecting encrypted content constructed of only OCTET STRING objects.");s+=a.encryptedContent[u].value}else s=a.encryptedContent;e.encryptedContent={algorithm:i.derToOid(a.encAlgorithm),parameter:n.util.createBuffer(a.encParameter.value),content:n.util.createBuffer(s)}}if(a.content){s="";if(n.util.isArray(a.content))for(u=0;u<a.content.length;++u){if(a.content[u].type!==i.Type.OCTETSTRING)throw new Error("Malformed PKCS#7 message, expecting content constructed of only OCTET STRING objects.");s+=a.content[u].value}else s=a.content;e.content=n.util.createBuffer(s)}return e.version=a.version.charCodeAt(0),e.rawCapture=a,a}function f(e){if(void 0===e.encryptedContent.key)throw new Error("Symmetric key not available.");if(void 0===e.content){var t;switch(e.encryptedContent.algorithm){case n.pki.oids["aes128-CBC"]:case n.pki.oids["aes192-CBC"]:case n.pki.oids["aes256-CBC"]:t=n.aes.createDecryptionCipher(e.encryptedContent.key);break;case n.pki.oids.desCBC:case n.pki.oids["des-EDE3-CBC"]:t=n.des.createDecryptionCipher(e.encryptedContent.key);break;default:throw new Error("Unsupported symmetric cipher, OID "+e.encryptedContent.algorithm)}if(t.start(e.encryptedContent.parameter),t.update(e.encryptedContent.content),!t.finish())throw new Error("Symmetric decryption failed.");e.content=t.output}}a.messageFromPem=function(e){var t=n.pem.decode(e)[0];if("PKCS7"!==t.type){var r=new Error('Could not convert PKCS#7 message from PEM; PEM header type is not "PKCS#7".');throw r.headerType=t.type,r}if(t.procType&&"ENCRYPTED"===t.procType.type)throw new Error("Could not convert PKCS#7 message from PEM; PEM is encrypted.");var o=i.fromDer(t.body);return a.messageFromAsn1(o)},a.messageToPem=function(e,t){var r={type:"PKCS7",body:i.toDer(e.toAsn1()).getBytes()};return n.pem.encode(r,{maxline:t})},a.messageFromAsn1=function(e){var t={},r=[];if(!i.validate(e,a.asn1.contentInfoValidator,t,r)){var o=new Error("Cannot read PKCS#7 message. ASN.1 object is not an PKCS#7 ContentInfo.");throw o.errors=r,o}var s,u=i.derToOid(t.contentType);switch(u){case n.pki.oids.envelopedData:s=a.createEnvelopedData();break;case n.pki.oids.encryptedData:s=a.createEncryptedData();break;case n.pki.oids.signedData:s=a.createSignedData();break;default:throw new Error("Cannot read PKCS#7 message. ContentType with OID "+u+" is not (yet) supported.")}return s.fromAsn1(t.content.value[0]),s},a.createSignedData=function(){var e=null;return e={type:n.pki.oids.signedData,version:1,certificates:[],crls:[],signers:[],digestAlgorithmIdentifiers:[],contentInfo:null,signerInfos:[],fromAsn1:function(t){if(l(e,t,a.asn1.signedDataValidator),e.certificates=[],e.crls=[],e.digestAlgorithmIdentifiers=[],e.contentInfo=null,e.signerInfos=[],e.rawCapture.certificates)for(var r=e.rawCapture.certificates.value,i=0;i<r.length;++i)e.certificates.push(n.pki.certificateFromAsn1(r[i]))},toAsn1:function(){e.contentInfo||e.sign();for(var t=[],r=0;r<e.certificates.length;++r)t.push(n.pki.certificateToAsn1(e.certificates[r]));var a=[],o=i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(e.version).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SET,!0,e.digestAlgorithmIdentifiers),e.contentInfo])]);return t.length>0&&o.value[0].value.push(i.create(i.Class.CONTEXT_SPECIFIC,0,!0,t)),a.length>0&&o.value[0].value.push(i.create(i.Class.CONTEXT_SPECIFIC,1,!0,a)),o.value[0].value.push(i.create(i.Class.UNIVERSAL,i.Type.SET,!0,e.signerInfos)),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.type).getBytes()),o])},addSigner:function(t){var r=t.issuer,i=t.serialNumber;if(t.certificate){var a=t.certificate;"string"==typeof a&&(a=n.pki.certificateFromPem(a)),r=a.issuer.attributes,i=a.serialNumber}var o=t.key;if(!o)throw new Error("Could not add PKCS#7 signer; no private key specified.");"string"==typeof o&&(o=n.pki.privateKeyFromPem(o));var s=t.digestAlgorithm||n.pki.oids.sha1;switch(s){case n.pki.oids.sha1:case n.pki.oids.sha256:case n.pki.oids.sha384:case n.pki.oids.sha512:case n.pki.oids.md5:break;default:throw new Error("Could not add PKCS#7 signer; unknown message digest algorithm: "+s)}var u=t.authenticatedAttributes||[];if(u.length>0){for(var c=!1,l=!1,f=0;f<u.length;++f){var h=u[f];if(c||h.type!==n.pki.oids.contentType){if(l||h.type!==n.pki.oids.messageDigest);else if(l=!0,c)break}else if(c=!0,l)break}if(!c||!l)throw new Error("Invalid signer.authenticatedAttributes. If signer.authenticatedAttributes is specified, then it must contain at least two attributes, PKCS #9 content-type and PKCS #9 message-digest.")}e.signers.push({key:o,version:1,issuer:r,serialNumber:i,digestAlgorithm:s,signatureAlgorithm:n.pki.oids.rsaEncryption,signature:null,authenticatedAttributes:u,unauthenticatedAttributes:[]})},sign:function(t){var r;(t=t||{},"object"!=typeof e.content||null===e.contentInfo)&&(e.contentInfo=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(n.pki.oids.data).getBytes())]),"content"in e&&(e.content instanceof n.util.ByteBuffer?r=e.content.bytes():"string"==typeof e.content&&(r=n.util.encodeUtf8(e.content)),t.detached?e.detachedContent=i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,r):e.contentInfo.value.push(i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,r)]))));0!==e.signers.length&&function(t){var r;r=e.detachedContent?e.detachedContent:(r=e.contentInfo.value[1]).value[0];if(!r)throw new Error("Could not sign PKCS#7 message; there is no content to sign.");var a=i.derToOid(e.contentInfo.value[0].value),o=i.toDer(r);for(var s in o.getByte(),i.getBerValueLength(o),o=o.getBytes(),t)t[s].start().update(o);for(var l=new Date,f=0;f<e.signers.length;++f){var h=e.signers[f];if(0===h.authenticatedAttributes.length){if(a!==n.pki.oids.data)throw new Error("Invalid signer; authenticatedAttributes must be present when the ContentInfo content type is not PKCS#7 Data.")}else{h.authenticatedAttributesAsn1=i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[]);for(var p=i.create(i.Class.UNIVERSAL,i.Type.SET,!0,[]),d=0;d<h.authenticatedAttributes.length;++d){var y=h.authenticatedAttributes[d];y.type===n.pki.oids.messageDigest?y.value=t[h.digestAlgorithm].digest():y.type===n.pki.oids.signingTime&&(y.value||(y.value=l)),p.value.push(c(y)),h.authenticatedAttributesAsn1.value.push(c(y))}o=i.toDer(p).getBytes(),h.md.start().update(o)}h.signature=h.key.sign(h.md,"RSASSA-PKCS1-V1_5")}e.signerInfos=function(e){for(var t=[],r=0;r<e.length;++r)t.push(u(e[r]));return t}(e.signers)}(function(){for(var t={},r=0;r<e.signers.length;++r){var a=e.signers[r];(o=a.digestAlgorithm)in t||(t[o]=n.md[n.pki.oids[o]].create()),0===a.authenticatedAttributes.length?a.md=t[o]:a.md=n.md[n.pki.oids[o]].create()}for(var o in e.digestAlgorithmIdentifiers=[],t)e.digestAlgorithmIdentifiers.push(i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(o).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.NULL,!1,"")]));return t}())},verify:function(){throw new Error("PKCS#7 signature verification not yet implemented.")},addCertificate:function(t){"string"==typeof t&&(t=n.pki.certificateFromPem(t)),e.certificates.push(t)},addCertificateRevokationList:function(e){throw new Error("PKCS#7 CRL support not yet implemented.")}}},a.createEncryptedData=function(){var e=null;return e={type:n.pki.oids.encryptedData,version:0,encryptedContent:{algorithm:n.pki.oids["aes256-CBC"]},fromAsn1:function(t){l(e,t,a.asn1.encryptedDataValidator)},decrypt:function(t){void 0!==t&&(e.encryptedContent.key=t),f(e)}}},a.createEnvelopedData=function(){var e=null;return e={type:n.pki.oids.envelopedData,version:0,recipients:[],encryptedContent:{algorithm:n.pki.oids["aes256-CBC"]},fromAsn1:function(t){var r=l(e,t,a.asn1.envelopedDataValidator);e.recipients=function(e){for(var t=[],r=0;r<e.length;++r)t.push(o(e[r]));return t}(r.recipientInfos.value)},toAsn1:function(){return i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.type).getBytes()),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(e.version).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SET,!0,s(e.recipients)),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,(t=e.encryptedContent,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(n.pki.oids.data).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(t.algorithm).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,t.parameter.getBytes())]),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,t.content.getBytes())])]))])])]);var t},findRecipient:function(t){for(var r=t.issuer.attributes,n=0;n<e.recipients.length;++n){var i=e.recipients[n],a=i.issuer;if(i.serialNumber===t.serialNumber&&a.length===r.length){for(var o=!0,s=0;s<r.length;++s)if(a[s].type!==r[s].type||a[s].value!==r[s].value){o=!1;break}if(o)return i}}return null},decrypt:function(t,r){if(void 0===e.encryptedContent.key&&void 0!==t&&void 0!==r)switch(t.encryptedContent.algorithm){case n.pki.oids.rsaEncryption:case n.pki.oids.desCBC:var i=r.decrypt(t.encryptedContent.content);e.encryptedContent.key=n.util.createBuffer(i);break;default:throw new Error("Unsupported asymmetric cipher, OID "+t.encryptedContent.algorithm)}f(e)},addRecipient:function(t){e.recipients.push({version:0,issuer:t.issuer.attributes,serialNumber:t.serialNumber,encryptedContent:{algorithm:n.pki.oids.rsaEncryption,key:t.publicKey}})},encrypt:function(t,r){if(void 0===e.encryptedContent.content){var i,a,o;switch(r=r||e.encryptedContent.algorithm,t=t||e.encryptedContent.key,r){case n.pki.oids["aes128-CBC"]:i=16,a=16,o=n.aes.createEncryptionCipher;break;case n.pki.oids["aes192-CBC"]:i=24,a=16,o=n.aes.createEncryptionCipher;break;case n.pki.oids["aes256-CBC"]:i=32,a=16,o=n.aes.createEncryptionCipher;break;case n.pki.oids["des-EDE3-CBC"]:i=24,a=8,o=n.des.createEncryptionCipher;break;default:throw new Error("Unsupported symmetric cipher, OID "+r)}if(void 0===t)t=n.util.createBuffer(n.random.getBytes(i));else if(t.length()!=i)throw new Error("Symmetric key has wrong length; got "+t.length()+" bytes, expected "+i+".");e.encryptedContent.algorithm=r,e.encryptedContent.key=t,e.encryptedContent.parameter=n.util.createBuffer(n.random.getBytes(a));var s=o(t);if(s.start(e.encryptedContent.parameter.copy()),s.update(e.content),!s.finish())throw new Error("Symmetric encryption failed.");e.encryptedContent.content=s.output}for(var u=0;u<e.recipients.length;++u){var c=e.recipients[u];if(void 0===c.encryptedContent.content)switch(c.encryptedContent.algorithm){case n.pki.oids.rsaEncryption:c.encryptedContent.content=c.encryptedContent.key.encrypt(e.encryptedContent.key.data);break;default:throw new Error("Unsupported asymmetric cipher, OID "+c.encryptedContent.algorithm)}}}}}},5496:function(e,t,r){var n=r(3832);r(3068),r(7116);var i=n.asn1,a=e.exports=n.pkcs7asn1=n.pkcs7asn1||{};n.pkcs7=n.pkcs7||{},n.pkcs7.asn1=a;var o={name:"ContentInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.ContentType",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:i.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,captureAsn1:"content"}]};a.contentInfoValidator=o;var s={name:"EncryptedContentInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentType",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"contentType"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentEncryptionAlgorithm.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm.parameter",tagClass:i.Class.UNIVERSAL,captureAsn1:"encParameter"}]},{name:"EncryptedContentInfo.encryptedContent",tagClass:i.Class.CONTEXT_SPECIFIC,type:0,capture:"encryptedContent",captureAsn1:"encryptedContentAsn1"}]};a.envelopedDataValidator={name:"EnvelopedData",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"EnvelopedData.Version",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"version"},{name:"EnvelopedData.RecipientInfos",tagClass:i.Class.UNIVERSAL,type:i.Type.SET,constructed:!0,captureAsn1:"recipientInfos"}].concat(s)},a.encryptedDataValidator={name:"EncryptedData",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedData.Version",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"version"}].concat(s)};var u={name:"SignerInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.version",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1},{name:"SignerInfo.issuerAndSerialNumber",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.issuerAndSerialNumber.issuer",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"SignerInfo.issuerAndSerialNumber.serialNumber",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"SignerInfo.digestAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.digestAlgorithm.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"digestAlgorithm"},{name:"SignerInfo.digestAlgorithm.parameter",tagClass:i.Class.UNIVERSAL,constructed:!1,captureAsn1:"digestParameter",optional:!0}]},{name:"SignerInfo.authenticatedAttributes",tagClass:i.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"authenticatedAttributes"},{name:"SignerInfo.digestEncryptionAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,capture:"signatureAlgorithm"},{name:"SignerInfo.encryptedDigest",tagClass:i.Class.UNIVERSAL,type:i.Type.OCTETSTRING,constructed:!1,capture:"signature"},{name:"SignerInfo.unauthenticatedAttributes",tagClass:i.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,capture:"unauthenticatedAttributes"}]};a.signedDataValidator={name:"SignedData",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"SignedData.Version",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"version"},{name:"SignedData.DigestAlgorithms",tagClass:i.Class.UNIVERSAL,type:i.Type.SET,constructed:!0,captureAsn1:"digestAlgorithms"},o,{name:"SignedData.Certificates",tagClass:i.Class.CONTEXT_SPECIFIC,type:0,optional:!0,captureAsn1:"certificates"},{name:"SignedData.CertificateRevocationLists",tagClass:i.Class.CONTEXT_SPECIFIC,type:1,optional:!0,captureAsn1:"crls"},{name:"SignedData.SignerInfos",tagClass:i.Class.UNIVERSAL,type:i.Type.SET,capture:"signerInfos",optional:!0,value:[u]}]},a.recipientInfoValidator={name:"RecipientInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.version",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"version"},{name:"RecipientInfo.issuerAndSerial",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.issuerAndSerial.issuer",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"RecipientInfo.issuerAndSerial.serialNumber",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"RecipientInfo.keyEncryptionAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.keyEncryptionAlgorithm.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"RecipientInfo.keyEncryptionAlgorithm.parameter",tagClass:i.Class.UNIVERSAL,constructed:!1,captureAsn1:"encParameter"}]},{name:"RecipientInfo.encryptedKey",tagClass:i.Class.UNIVERSAL,type:i.Type.OCTETSTRING,constructed:!1,capture:"encKey"}]}},4742:function(e,t,r){var n=r(3832);r(3068),r(6270),r(7450),r(6953),r(8960),r(5147),r(6007),r(8095),r(7116),r(5414);var i=n.asn1,a=e.exports=n.pki=n.pki||{};a.pemToDer=function(e){var t=n.pem.decode(e)[0];if(t.procType&&"ENCRYPTED"===t.procType.type)throw new Error("Could not convert PEM to DER; PEM is encrypted.");return n.util.createBuffer(t.body)},a.privateKeyFromPem=function(e){var t=n.pem.decode(e)[0];if("PRIVATE KEY"!==t.type&&"RSA PRIVATE KEY"!==t.type){var r=new Error('Could not convert private key from PEM; PEM header type is not "PRIVATE KEY" or "RSA PRIVATE KEY".');throw r.headerType=t.type,r}if(t.procType&&"ENCRYPTED"===t.procType.type)throw new Error("Could not convert private key from PEM; PEM is encrypted.");var o=i.fromDer(t.body);return a.privateKeyFromAsn1(o)},a.privateKeyToPem=function(e,t){var r={type:"RSA PRIVATE KEY",body:i.toDer(a.privateKeyToAsn1(e)).getBytes()};return n.pem.encode(r,{maxline:t})},a.privateKeyInfoToPem=function(e,t){var r={type:"PRIVATE KEY",body:i.toDer(e).getBytes()};return n.pem.encode(r,{maxline:t})}},9654:function(e,t,r){var n=r(3832);r(7116),r(5764),r(9563),function(){if(n.prime)e.exports=n.prime;else{var t=e.exports=n.prime=n.prime||{},r=n.jsbn.BigInteger,i=[6,4,2,4,2,4,6,2],a=new r(null);a.fromInt(30);var o=function(e,t){return e|t};t.generateProbablePrime=function(e,t,i){"function"==typeof t&&(i=t,t={});var a=(t=t||{}).algorithm||"PRIMEINC";"string"==typeof a&&(a={name:a}),a.options=a.options||{};var o=t.prng||n.random,u={nextBytes:function(e){for(var t=o.getBytesSync(e.length),r=0;r<e.length;++r)e[r]=t.charCodeAt(r)}};if("PRIMEINC"===a.name)return function(e,t,i,a){if("workers"in i)return function(e,t,i,a){if("undefined"==typeof Worker)return s(e,t,i,a);var o=c(e,t),u=i.workers,l=i.workLoad||100,f=30*l/8,h=i.workerScript||"forge/prime.worker.js";if(-1===u)return n.util.estimateCores((function(e,t){e&&(t=2),u=t-1,p()}));function p(){u=Math.max(1,u);for(var n=[],i=0;i<u;++i)n[i]=new Worker(h);for(i=0;i<u;++i)n[i].addEventListener("message",p);var s=!1;function p(i){if(!s){0;var u=i.data;if(u.found){for(var h=0;h<n.length;++h)n[h].terminate();return s=!0,a(null,new r(u.prime,16))}o.bitLength()>e&&(o=c(e,t));var p=o.toString(16);i.target.postMessage({hex:p,workLoad:l}),o.dAddOffset(f,0)}}}p()}(e,t,i,a);return s(e,t,i,a)}(e,u,a.options,i);throw new Error("Invalid prime generation algorithm: "+a.name)}}function s(e,t,r,n){var i=c(e,t),a=function(e){return e<=100?27:e<=150?18:e<=200?15:e<=250?12:e<=300?9:e<=350?8:e<=400?7:e<=500?6:e<=600?5:e<=800?4:e<=1250?3:2}(i.bitLength());"millerRabinTests"in r&&(a=r.millerRabinTests);var o=10;"maxBlockTime"in r&&(o=r.maxBlockTime),u(i,e,t,0,a,o,n)}function u(e,t,r,a,o,s,l){var f=+new Date;do{if(e.bitLength()>t&&(e=c(t,r)),e.isProbablePrime(o))return l(null,e);e.dAddOffset(i[a++%8],0)}while(s<0||+new Date-f<s);n.util.setImmediate((function(){u(e,t,r,a,o,s,l)}))}function c(e,t){var n=new r(e,t),i=e-1;return n.testBit(i)||n.bitwiseTo(r.ONE.shiftLeft(i),o,n),n.dAddOffset(31-n.mod(a).byteValue(),0),n}}()},4933:function(e,t,r){var n=r(3832);r(7116);var i=null;!n.util.isNodejs||n.options.usePureJavaScript||process.versions["node-webkit"]||(i=r(3906)),(e.exports=n.prng=n.prng||{}).create=function(e){for(var t={plugin:e,key:null,seed:null,time:null,reseeds:0,generated:0,keyBytes:""},r=e.md,a=new Array(32),o=0;o<32;++o)a[o]=r.create();function s(){if(t.pools[0].messageLength>=32)return u();var e=32-t.pools[0].messageLength<<5;t.collect(t.seedFileSync(e)),u()}function u(){t.reseeds=4294967295===t.reseeds?0:t.reseeds+1;var e=t.plugin.md.create();e.update(t.keyBytes);for(var r=1,n=0;n<32;++n)t.reseeds%r==0&&(e.update(t.pools[n].digest().getBytes()),t.pools[n].start()),r<<=1;t.keyBytes=e.digest().getBytes(),e.start(),e.update(t.keyBytes);var i=e.digest().getBytes();t.key=t.plugin.formatKey(t.keyBytes),t.seed=t.plugin.formatSeed(i),t.generated=0}function c(e){var t=null,r=n.util.globalScope,i=r.crypto||r.msCrypto;i&&i.getRandomValues&&(t=function(e){return i.getRandomValues(e)});var a=n.util.createBuffer();if(t)for(;a.length()<e;){var o=Math.max(1,Math.min(e-a.length(),65536)/4),s=new Uint32Array(Math.floor(o));try{t(s);for(var u=0;u<s.length;++u)a.putInt32(s[u])}catch(e){if(!("undefined"!=typeof QuotaExceededError&&e instanceof QuotaExceededError))throw e}}if(a.length()<e)for(var c,l,f,h=Math.floor(65536*Math.random());a.length()<e;){l=16807*(65535&h),l+=(32767&(c=16807*(h>>16)))<<16,h=4294967295&(l=(2147483647&(l+=c>>15))+(l>>31));for(u=0;u<3;++u)f=h>>>(u<<3),f^=Math.floor(256*Math.random()),a.putByte(String.fromCharCode(255&f))}return a.getBytes(e)}return t.pools=a,t.pool=0,t.generate=function(e,r){if(!r)return t.generateSync(e);var i=t.plugin.cipher,a=t.plugin.increment,o=t.plugin.formatKey,s=t.plugin.formatSeed,c=n.util.createBuffer();t.key=null,function l(f){if(f)return r(f);if(c.length()>=e)return r(null,c.getBytes(e));t.generated>1048575&&(t.key=null);if(null===t.key)return n.util.nextTick((function(){!function(e){if(t.pools[0].messageLength>=32)return u(),e();var r=32-t.pools[0].messageLength<<5;t.seedFile(r,(function(r,n){if(r)return e(r);t.collect(n),u(),e()}))}(l)}));var h=i(t.key,t.seed);t.generated+=h.length,c.putBytes(h),t.key=o(i(t.key,a(t.seed))),t.seed=s(i(t.key,t.seed)),n.util.setImmediate(l)}()},t.generateSync=function(e){var r=t.plugin.cipher,i=t.plugin.increment,a=t.plugin.formatKey,o=t.plugin.formatSeed;t.key=null;for(var u=n.util.createBuffer();u.length()<e;){t.generated>1048575&&(t.key=null),null===t.key&&s();var c=r(t.key,t.seed);t.generated+=c.length,u.putBytes(c),t.key=a(r(t.key,i(t.seed))),t.seed=o(r(t.key,t.seed))}return u.getBytes(e)},i?(t.seedFile=function(e,t){i.randomBytes(e,(function(e,r){if(e)return t(e);t(null,r.toString())}))},t.seedFileSync=function(e){return i.randomBytes(e).toString()}):(t.seedFile=function(e,t){try{t(null,c(e))}catch(e){t(e)}},t.seedFileSync=c),t.collect=function(e){for(var r=e.length,n=0;n<r;++n)t.pools[t.pool].update(e.substr(n,1)),t.pool=31===t.pool?0:t.pool+1},t.collectInt=function(e,r){for(var n="",i=0;i<r;i+=8)n+=String.fromCharCode(e>>i&255);t.collect(n)},t.registerWorker=function(e){if(e===self)t.seedFile=function(e,t){self.addEventListener("message",(function e(r){var n=r.data;n.forge&&n.forge.prng&&(self.removeEventListener("message",e),t(n.forge.prng.err,n.forge.prng.bytes))})),self.postMessage({forge:{prng:{needed:e}}})};else{e.addEventListener("message",(function(r){var n=r.data;n.forge&&n.forge.prng&&t.seedFile(n.forge.prng.needed,(function(t,r){e.postMessage({forge:{prng:{err:t,bytes:r}}})}))}))}},t}},6007:function(e,t,r){var n=r(3832);r(9563),r(7116),(e.exports=n.pss=n.pss||{}).create=function(e){3===arguments.length&&(e={md:arguments[0],mgf:arguments[1],saltLength:arguments[2]});var t,r=e.md,i=e.mgf,a=r.digestLength,o=e.salt||null;if("string"==typeof o&&(o=n.util.createBuffer(o)),"saltLength"in e)t=e.saltLength;else{if(null===o)throw new Error("Salt length not specified or specific salt not given.");t=o.length()}if(null!==o&&o.length()!==t)throw new Error("Given salt length does not match length of given salt.");var s=e.prng||n.random,u={encode:function(e,u){var c,l,f=u-1,h=Math.ceil(f/8),p=e.digest().getBytes();if(h<a+t+2)throw new Error("Message is too long to encrypt.");l=null===o?s.getBytesSync(t):o.bytes();var d=new n.util.ByteBuffer;d.fillWithByte(0,8),d.putBytes(p),d.putBytes(l),r.start(),r.update(d.getBytes());var y=r.digest().getBytes(),v=new n.util.ByteBuffer;v.fillWithByte(0,h-t-a-2),v.putByte(1),v.putBytes(l);var g=v.getBytes(),m=h-a-1,b=i.generate(y,m),E="";for(c=0;c<m;c++)E+=String.fromCharCode(g.charCodeAt(c)^b.charCodeAt(c));var S=65280>>8*h-f&255;return(E=String.fromCharCode(E.charCodeAt(0)&~S)+E.substr(1))+y+String.fromCharCode(188)},verify:function(e,o,s){var u,c=s-1,l=Math.ceil(c/8);if(o=o.substr(-l),l<a+t+2)throw new Error("Inconsistent parameters to PSS signature verification.");if(188!==o.charCodeAt(l-1))throw new Error("Encoded message does not end in 0xBC.");var f=l-a-1,h=o.substr(0,f),p=o.substr(f,a),d=65280>>8*l-c&255;if(0!=(h.charCodeAt(0)&d))throw new Error("Bits beyond keysize not zero as expected.");var y=i.generate(p,f),v="";for(u=0;u<f;u++)v+=String.fromCharCode(h.charCodeAt(u)^y.charCodeAt(u));v=String.fromCharCode(v.charCodeAt(0)&~d)+v.substr(1);var g=l-a-t-2;for(u=0;u<g;u++)if(0!==v.charCodeAt(u))throw new Error("Leftmost octets not zero as expected");if(1!==v.charCodeAt(g))throw new Error("Inconsistent PSS signature, 0x01 marker not found");var m=v.substr(-t),b=new n.util.ByteBuffer;return b.fillWithByte(0,8),b.putBytes(e),b.putBytes(m),r.start(),r.update(b.getBytes()),p===r.digest().getBytes()}};return u}},9563:function(e,t,r){var n=r(3832);r(8925),r(1668),r(4933),r(7116),n.random&&n.random.getBytes?e.exports=n.random:function(t){var r={},i=new Array(4),a=n.util.createBuffer();function o(){var e=n.prng.create(r);return e.getBytes=function(t,r){return e.generate(t,r)},e.getBytesSync=function(t){return e.generate(t)},e}r.formatKey=function(e){var t=n.util.createBuffer(e);return(e=new Array(4))[0]=t.getInt32(),e[1]=t.getInt32(),e[2]=t.getInt32(),e[3]=t.getInt32(),n.aes._expandKey(e,!1)},r.formatSeed=function(e){var t=n.util.createBuffer(e);return(e=new Array(4))[0]=t.getInt32(),e[1]=t.getInt32(),e[2]=t.getInt32(),e[3]=t.getInt32(),e},r.cipher=function(e,t){return n.aes._updateBlock(e,t,i,!1),a.putInt32(i[0]),a.putInt32(i[1]),a.putInt32(i[2]),a.putInt32(i[3]),a.getBytes()},r.increment=function(e){return++e[3],e},r.md=n.md.sha256;var s=o(),u=null,c=n.util.globalScope,l=c.crypto||c.msCrypto;if(l&&l.getRandomValues&&(u=function(e){return l.getRandomValues(e)}),n.options.usePureJavaScript||!n.util.isNodejs&&!u){if("undefined"==typeof window||window.document,s.collectInt(+new Date,32),"undefined"!=typeof navigator){var f="";for(var h in navigator)try{"string"==typeof navigator[h]&&(f+=navigator[h])}catch(e){}s.collect(f),f=null}t&&(t().mousemove((function(e){s.collectInt(e.clientX,16),s.collectInt(e.clientY,16)})),t().keypress((function(e){s.collectInt(e.charCode,8)})))}if(n.random)for(var h in s)n.random[h]=s[h];else n.random=s;n.random.createInstance=o,e.exports=n.random}("undefined"!=typeof jQuery?jQuery:null)},9372:function(e,t,r){var n=r(3832);r(7116);var i=[217,120,249,196,25,221,181,237,40,233,253,121,74,160,216,157,198,126,55,131,43,118,83,142,98,76,100,136,68,139,251,162,23,154,89,245,135,179,79,19,97,69,109,141,9,129,125,50,189,143,64,235,134,183,123,11,240,149,33,34,92,107,78,130,84,214,101,147,206,96,178,28,115,86,192,20,167,140,241,220,18,117,202,31,59,190,228,209,66,61,212,48,163,60,182,38,111,191,14,218,70,105,7,87,39,242,29,155,188,148,67,3,248,17,199,246,144,239,62,231,6,195,213,47,200,102,30,215,8,232,234,222,128,82,238,247,132,170,114,172,53,77,106,42,150,26,210,113,90,21,73,116,75,159,208,94,4,24,164,236,194,224,65,110,15,81,203,204,36,145,175,80,161,244,112,57,153,124,58,133,35,184,180,122,252,2,54,91,37,85,151,49,45,93,250,152,227,138,146,174,5,223,41,16,103,108,186,201,211,0,230,207,225,158,168,44,99,22,1,63,88,226,137,169,13,56,52,27,171,51,255,176,187,72,12,95,185,177,205,46,197,243,219,71,229,165,156,119,10,166,32,104,254,127,193,173],a=[1,2,3,5],o=function(e,t){return e<<t&65535|(65535&e)>>16-t},s=function(e,t){return(65535&e)>>t|e<<16-t&65535};e.exports=n.rc2=n.rc2||{},n.rc2.expandKey=function(e,t){"string"==typeof e&&(e=n.util.createBuffer(e)),t=t||128;var r,a=e,o=e.length(),s=t,u=Math.ceil(s/8),c=255>>(7&s);for(r=o;r<128;r++)a.putByte(i[a.at(r-1)+a.at(r-o)&255]);for(a.setAt(128-u,i[a.at(128-u)&c]),r=127-u;r>=0;r--)a.setAt(r,i[a.at(r+1)^a.at(r+u)]);return a};var u=function(e,t,r){var i,u,c,l,f=!1,h=null,p=null,d=null,y=[];for(e=n.rc2.expandKey(e,t),c=0;c<64;c++)y.push(e.getInt16Le());r?(i=function(e){for(c=0;c<4;c++)e[c]+=y[l]+(e[(c+3)%4]&e[(c+2)%4])+(~e[(c+3)%4]&e[(c+1)%4]),e[c]=o(e[c],a[c]),l++},u=function(e){for(c=0;c<4;c++)e[c]+=y[63&e[(c+3)%4]]}):(i=function(e){for(c=3;c>=0;c--)e[c]=s(e[c],a[c]),e[c]-=y[l]+(e[(c+3)%4]&e[(c+2)%4])+(~e[(c+3)%4]&e[(c+1)%4]),l--},u=function(e){for(c=3;c>=0;c--)e[c]-=y[63&e[(c+3)%4]]});var v=function(e){var t=[];for(c=0;c<4;c++){var n=h.getInt16Le();null!==d&&(r?n^=d.getInt16Le():d.putInt16Le(n)),t.push(65535&n)}l=r?0:63;for(var i=0;i<e.length;i++)for(var a=0;a<e[i][0];a++)e[i][1](t);for(c=0;c<4;c++)null!==d&&(r?d.putInt16Le(t[c]):t[c]^=d.getInt16Le()),p.putInt16Le(t[c])},g=null;return g={start:function(e,t){e&&"string"==typeof e&&(e=n.util.createBuffer(e)),f=!1,h=n.util.createBuffer(),p=t||new n.util.createBuffer,d=e,g.output=p},update:function(e){for(f||h.putBuffer(e);h.length()>=8;)v([[5,i],[1,u],[6,i],[1,u],[5,i]])},finish:function(e){var t=!0;if(r)if(e)t=e(8,h,!r);else{var n=8===h.length()?8:8-h.length();h.fillWithByte(n,n)}if(t&&(f=!0,g.update()),!r&&(t=0===h.length()))if(e)t=e(8,p,!r);else{var i=p.length(),a=p.at(i-1);a>i?t=!1:p.truncate(a)}return t}}};n.rc2.startEncrypting=function(e,t,r){var i=n.rc2.createEncryptionCipher(e,128);return i.start(t,r),i},n.rc2.createEncryptionCipher=function(e,t){return u(e,t,!0)},n.rc2.startDecrypting=function(e,t,r){var i=n.rc2.createDecryptionCipher(e,128);return i.start(t,r),i},n.rc2.createDecryptionCipher=function(e,t){return u(e,t,!1)}},8095:function(e,t,r){var n=r(3832);if(r(3068),r(5764),r(6270),r(8936),r(9654),r(9563),r(7116),void 0===i)var i=n.jsbn.BigInteger;var a=n.util.isNodejs?r(3906):null,o=n.asn1,s=n.util;n.pki=n.pki||{},e.exports=n.pki.rsa=n.rsa=n.rsa||{};var u=n.pki,c=[6,4,2,4,2,4,6,2],l={name:"PrivateKeyInfo",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:o.Class.UNIVERSAL,type:o.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:o.Class.UNIVERSAL,type:o.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]},f={name:"RSAPrivateKey",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPrivateKey.version",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"RSAPrivateKey.modulus",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"privateKeyModulus"},{name:"RSAPrivateKey.publicExponent",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"privateKeyPublicExponent"},{name:"RSAPrivateKey.privateExponent",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"privateKeyPrivateExponent"},{name:"RSAPrivateKey.prime1",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"privateKeyPrime1"},{name:"RSAPrivateKey.prime2",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"privateKeyPrime2"},{name:"RSAPrivateKey.exponent1",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"privateKeyExponent1"},{name:"RSAPrivateKey.exponent2",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"privateKeyExponent2"},{name:"RSAPrivateKey.coefficient",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"privateKeyCoefficient"}]},h={name:"RSAPublicKey",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPublicKey.modulus",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"publicKeyModulus"},{name:"RSAPublicKey.exponent",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"publicKeyExponent"}]},p=n.pki.rsa.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:o.Class.UNIVERSAL,type:o.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{name:"SubjectPublicKeyInfo.subjectPublicKey",tagClass:o.Class.UNIVERSAL,type:o.Type.BITSTRING,constructed:!1,value:[{name:"SubjectPublicKeyInfo.subjectPublicKey.RSAPublicKey",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"rsaPublicKey"}]}]},d=function(e){var t;if(!(e.algorithm in u.oids)){var r=new Error("Unknown message digest algorithm.");throw r.algorithm=e.algorithm,r}t=u.oids[e.algorithm];var n=o.oidToDer(t).getBytes(),i=o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[]),a=o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[]);a.value.push(o.create(o.Class.UNIVERSAL,o.Type.OID,!1,n)),a.value.push(o.create(o.Class.UNIVERSAL,o.Type.NULL,!1,""));var s=o.create(o.Class.UNIVERSAL,o.Type.OCTETSTRING,!1,e.digest().getBytes());return i.value.push(a),i.value.push(s),o.toDer(i).getBytes()},y=function(e,t,r){if(r)return e.modPow(t.e,t.n);if(!t.p||!t.q)return e.modPow(t.d,t.n);var a;t.dP||(t.dP=t.d.mod(t.p.subtract(i.ONE))),t.dQ||(t.dQ=t.d.mod(t.q.subtract(i.ONE))),t.qInv||(t.qInv=t.q.modInverse(t.p));do{a=new i(n.util.bytesToHex(n.random.getBytes(t.n.bitLength()/8)),16)}while(a.compareTo(t.n)>=0||!a.gcd(t.n).equals(i.ONE));for(var o=(e=e.multiply(a.modPow(t.e,t.n)).mod(t.n)).mod(t.p).modPow(t.dP,t.p),s=e.mod(t.q).modPow(t.dQ,t.q);o.compareTo(s)<0;)o=o.add(t.p);var u=o.subtract(s).multiply(t.qInv).mod(t.p).multiply(t.q).add(s);return u=u.multiply(a.modInverse(t.n)).mod(t.n)};function v(e,t,r){var i=n.util.createBuffer(),a=Math.ceil(t.n.bitLength()/8);if(e.length>a-11){var o=new Error("Message is too long for PKCS#1 v1.5 padding.");throw o.length=e.length,o.max=a-11,o}i.putByte(0),i.putByte(r);var s,u=a-3-e.length;if(0===r||1===r){s=0===r?0:255;for(var c=0;c<u;++c)i.putByte(s)}else for(;u>0;){var l=0,f=n.random.getBytes(u);for(c=0;c<u;++c)0===(s=f.charCodeAt(c))?++l:i.putByte(s);u=l}return i.putByte(0),i.putBytes(e),i}function g(e,t,r,i){var a=Math.ceil(t.n.bitLength()/8),o=n.util.createBuffer(e),s=o.getByte(),u=o.getByte();if(0!==s||r&&0!==u&&1!==u||!r&&2!=u||r&&0===u&&void 0===i)throw new Error("Encryption block is invalid.");var c=0;if(0===u){c=a-3-i;for(var l=0;l<c;++l)if(0!==o.getByte())throw new Error("Encryption block is invalid.")}else if(1===u)for(c=0;o.length()>1;){if(255!==o.getByte()){--o.read;break}++c}else if(2===u)for(c=0;o.length()>1;){if(0===o.getByte()){--o.read;break}++c}if(0!==o.getByte()||c!==a-3-o.length())throw new Error("Encryption block is invalid.");return o.getBytes()}function m(e,t,r){"function"==typeof t&&(r=t,t={});var a={algorithm:{name:(t=t||{}).algorithm||"PRIMEINC",options:{workers:t.workers||2,workLoad:t.workLoad||100,workerScript:t.workerScript}}};function o(){s(e.pBits,(function(t,n){return t?r(t):(e.p=n,null!==e.q?c(t,e.q):void s(e.qBits,c))}))}function s(e,t){n.prime.generateProbablePrime(e,a,t)}function c(t,n){if(t)return r(t);if(e.q=n,e.p.compareTo(e.q)<0){var a=e.p;e.p=e.q,e.q=a}if(0!==e.p.subtract(i.ONE).gcd(e.e).compareTo(i.ONE))return e.p=null,void o();if(0!==e.q.subtract(i.ONE).gcd(e.e).compareTo(i.ONE))return e.q=null,void s(e.qBits,c);if(e.p1=e.p.subtract(i.ONE),e.q1=e.q.subtract(i.ONE),e.phi=e.p1.multiply(e.q1),0!==e.phi.gcd(e.e).compareTo(i.ONE))return e.p=e.q=null,void o();if(e.n=e.p.multiply(e.q),e.n.bitLength()!==e.bits)return e.q=null,void s(e.qBits,c);var l=e.e.modInverse(e.phi);e.keys={privateKey:u.rsa.setPrivateKey(e.n,e.e,l,e.p,e.q,l.mod(e.p1),l.mod(e.q1),e.q.modInverse(e.p)),publicKey:u.rsa.setPublicKey(e.n,e.e)},r(null,e.keys)}"prng"in t&&(a.prng=t.prng),o()}function b(e){var t=e.toString(16);t[0]>="8"&&(t="00"+t);var r=n.util.hexToBytes(t);return r.length>1&&(0===r.charCodeAt(0)&&0==(128&r.charCodeAt(1))||255===r.charCodeAt(0)&&128==(128&r.charCodeAt(1)))?r.substr(1):r}function E(e){return e<=100?27:e<=150?18:e<=200?15:e<=250?12:e<=300?9:e<=350?8:e<=400?7:e<=500?6:e<=600?5:e<=800?4:e<=1250?3:2}function S(e){return n.util.isNodejs&&"function"==typeof a[e]}function C(e){return void 0!==s.globalScope&&"object"==typeof s.globalScope.crypto&&"object"==typeof s.globalScope.crypto.subtle&&"function"==typeof s.globalScope.crypto.subtle[e]}function w(e){return void 0!==s.globalScope&&"object"==typeof s.globalScope.msCrypto&&"object"==typeof s.globalScope.msCrypto.subtle&&"function"==typeof s.globalScope.msCrypto.subtle[e]}function T(e){for(var t=n.util.hexToBytes(e.toString(16)),r=new Uint8Array(t.length),i=0;i<t.length;++i)r[i]=t.charCodeAt(i);return r}u.rsa.encrypt=function(e,t,r){var a,o=r,s=Math.ceil(t.n.bitLength()/8);!1!==r&&!0!==r?(o=2===r,a=v(e,t,r)):(a=n.util.createBuffer()).putBytes(e);for(var u=new i(a.toHex(),16),c=y(u,t,o).toString(16),l=n.util.createBuffer(),f=s-Math.ceil(c.length/2);f>0;)l.putByte(0),--f;return l.putBytes(n.util.hexToBytes(c)),l.getBytes()},u.rsa.decrypt=function(e,t,r,a){var o=Math.ceil(t.n.bitLength()/8);if(e.length!==o){var s=new Error("Encrypted message length is invalid.");throw s.length=e.length,s.expected=o,s}var u=new i(n.util.createBuffer(e).toHex(),16);if(u.compareTo(t.n)>=0)throw new Error("Encrypted message is invalid.");for(var c=y(u,t,r).toString(16),l=n.util.createBuffer(),f=o-Math.ceil(c.length/2);f>0;)l.putByte(0),--f;return l.putBytes(n.util.hexToBytes(c)),!1!==a?g(l.getBytes(),t,r):l.getBytes()},u.rsa.createKeyPairGenerationState=function(e,t,r){"string"==typeof e&&(e=parseInt(e,10)),e=e||2048;var a,o=(r=r||{}).prng||n.random,s={nextBytes:function(e){for(var t=o.getBytesSync(e.length),r=0;r<e.length;++r)e[r]=t.charCodeAt(r)}},u=r.algorithm||"PRIMEINC";if("PRIMEINC"!==u)throw new Error("Invalid key generation algorithm: "+u);return(a={algorithm:u,state:0,bits:e,rng:s,eInt:t||65537,e:new i(null),p:null,q:null,qBits:e>>1,pBits:e-(e>>1),pqState:0,num:null,keys:null}).e.fromInt(a.eInt),a},u.rsa.stepKeyPairGenerationState=function(e,t){"algorithm"in e||(e.algorithm="PRIMEINC");var r=new i(null);r.fromInt(30);for(var n,a=0,o=function(e,t){return e|t},s=+new Date,l=0;null===e.keys&&(t<=0||l<t);){if(0===e.state){var f=null===e.p?e.pBits:e.qBits,h=f-1;0===e.pqState?(e.num=new i(f,e.rng),e.num.testBit(h)||e.num.bitwiseTo(i.ONE.shiftLeft(h),o,e.num),e.num.dAddOffset(31-e.num.mod(r).byteValue(),0),a=0,++e.pqState):1===e.pqState?e.num.bitLength()>f?e.pqState=0:e.num.isProbablePrime(E(e.num.bitLength()))?++e.pqState:e.num.dAddOffset(c[a++%8],0):2===e.pqState?e.pqState=0===e.num.subtract(i.ONE).gcd(e.e).compareTo(i.ONE)?3:0:3===e.pqState&&(e.pqState=0,null===e.p?e.p=e.num:e.q=e.num,null!==e.p&&null!==e.q&&++e.state,e.num=null)}else if(1===e.state)e.p.compareTo(e.q)<0&&(e.num=e.p,e.p=e.q,e.q=e.num),++e.state;else if(2===e.state)e.p1=e.p.subtract(i.ONE),e.q1=e.q.subtract(i.ONE),e.phi=e.p1.multiply(e.q1),++e.state;else if(3===e.state)0===e.phi.gcd(e.e).compareTo(i.ONE)?++e.state:(e.p=null,e.q=null,e.state=0);else if(4===e.state)e.n=e.p.multiply(e.q),e.n.bitLength()===e.bits?++e.state:(e.q=null,e.state=0);else if(5===e.state){var p=e.e.modInverse(e.phi);e.keys={privateKey:u.rsa.setPrivateKey(e.n,e.e,p,e.p,e.q,p.mod(e.p1),p.mod(e.q1),e.q.modInverse(e.p)),publicKey:u.rsa.setPublicKey(e.n,e.e)}}l+=(n=+new Date)-s,s=n}return null!==e.keys},u.rsa.generateKeyPair=function(e,t,r,i){if(1===arguments.length?"object"==typeof e?(r=e,e=void 0):"function"==typeof e&&(i=e,e=void 0):2===arguments.length?"number"==typeof e?"function"==typeof t?(i=t,t=void 0):"number"!=typeof t&&(r=t,t=void 0):(r=e,i=t,e=void 0,t=void 0):3===arguments.length&&("number"==typeof t?"function"==typeof r&&(i=r,r=void 0):(i=r,r=t,t=void 0)),r=r||{},void 0===e&&(e=r.bits||2048),void 0===t&&(t=r.e||65537),!n.options.usePureJavaScript&&!r.prng&&e>=256&&e<=16384&&(65537===t||3===t))if(i){if(S("generateKeyPair"))return a.generateKeyPair("rsa",{modulusLength:e,publicExponent:t,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}},(function(e,t,r){if(e)return i(e);i(null,{privateKey:u.privateKeyFromPem(r),publicKey:u.publicKeyFromPem(t)})}));if(C("generateKey")&&C("exportKey"))return s.globalScope.crypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:e,publicExponent:T(t),hash:{name:"SHA-256"}},!0,["sign","verify"]).then((function(e){return s.globalScope.crypto.subtle.exportKey("pkcs8",e.privateKey)})).then(void 0,(function(e){i(e)})).then((function(e){if(e){var t=u.privateKeyFromAsn1(o.fromDer(n.util.createBuffer(e)));i(null,{privateKey:t,publicKey:u.setRsaPublicKey(t.n,t.e)})}}));if(w("generateKey")&&w("exportKey")){var c=s.globalScope.msCrypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:e,publicExponent:T(t),hash:{name:"SHA-256"}},!0,["sign","verify"]);return c.oncomplete=function(e){var t=e.target.result,r=s.globalScope.msCrypto.subtle.exportKey("pkcs8",t.privateKey);r.oncomplete=function(e){var t=e.target.result,r=u.privateKeyFromAsn1(o.fromDer(n.util.createBuffer(t)));i(null,{privateKey:r,publicKey:u.setRsaPublicKey(r.n,r.e)})},r.onerror=function(e){i(e)}},void(c.onerror=function(e){i(e)})}}else if(S("generateKeyPairSync")){var l=a.generateKeyPairSync("rsa",{modulusLength:e,publicExponent:t,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}});return{privateKey:u.privateKeyFromPem(l.privateKey),publicKey:u.publicKeyFromPem(l.publicKey)}}var f=u.rsa.createKeyPairGenerationState(e,t,r);if(!i)return u.rsa.stepKeyPairGenerationState(f,0),f.keys;m(f,r,i)},u.setRsaPublicKey=u.rsa.setPublicKey=function(e,t){var r={n:e,e:t,encrypt:function(e,t,i){if("string"==typeof t?t=t.toUpperCase():void 0===t&&(t="RSAES-PKCS1-V1_5"),"RSAES-PKCS1-V1_5"===t)t={encode:function(e,t,r){return v(e,t,2).getBytes()}};else if("RSA-OAEP"===t||"RSAES-OAEP"===t)t={encode:function(e,t){return n.pkcs1.encode_rsa_oaep(t,e,i)}};else if(-1!==["RAW","NONE","NULL",null].indexOf(t))t={encode:function(e){return e}};else if("string"==typeof t)throw new Error('Unsupported encryption scheme: "'+t+'".');var a=t.encode(e,r,!0);return u.rsa.encrypt(a,r,!0)},verify:function(e,t,n){"string"==typeof n?n=n.toUpperCase():void 0===n&&(n="RSASSA-PKCS1-V1_5"),"RSASSA-PKCS1-V1_5"===n?n={verify:function(e,t){return t=g(t,r,!0),e===o.fromDer(t).value[1].value}}:"NONE"!==n&&"NULL"!==n&&null!==n||(n={verify:function(e,t){return e===(t=g(t,r,!0))}});var i=u.rsa.decrypt(t,r,!0,!1);return n.verify(e,i,r.n.bitLength())}};return r},u.setRsaPrivateKey=u.rsa.setPrivateKey=function(e,t,r,i,a,o,s,c){var l={n:e,e:t,d:r,p:i,q:a,dP:o,dQ:s,qInv:c,decrypt:function(e,t,r){"string"==typeof t?t=t.toUpperCase():void 0===t&&(t="RSAES-PKCS1-V1_5");var i=u.rsa.decrypt(e,l,!1,!1);if("RSAES-PKCS1-V1_5"===t)t={decode:g};else if("RSA-OAEP"===t||"RSAES-OAEP"===t)t={decode:function(e,t){return n.pkcs1.decode_rsa_oaep(t,e,r)}};else{if(-1===["RAW","NONE","NULL",null].indexOf(t))throw new Error('Unsupported encryption scheme: "'+t+'".');t={decode:function(e){return e}}}return t.decode(i,l,!1)},sign:function(e,t){var r=!1;"string"==typeof t&&(t=t.toUpperCase()),void 0===t||"RSASSA-PKCS1-V1_5"===t?(t={encode:d},r=1):"NONE"!==t&&"NULL"!==t&&null!==t||(t={encode:function(){return e}},r=1);var n=t.encode(e,l.n.bitLength());return u.rsa.encrypt(n,l,r)}};return l},u.wrapRsaPrivateKey=function(e){return o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,o.integerToDer(0).getBytes()),o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.OID,!1,o.oidToDer(u.oids.rsaEncryption).getBytes()),o.create(o.Class.UNIVERSAL,o.Type.NULL,!1,"")]),o.create(o.Class.UNIVERSAL,o.Type.OCTETSTRING,!1,o.toDer(e).getBytes())])},u.privateKeyFromAsn1=function(e){var t,r,a,s,c,h,p,d,y={},v=[];if(o.validate(e,l,y,v)&&(e=o.fromDer(n.util.createBuffer(y.privateKey))),y={},v=[],!o.validate(e,f,y,v)){var g=new Error("Cannot read private key. ASN.1 object does not contain an RSAPrivateKey.");throw g.errors=v,g}return t=n.util.createBuffer(y.privateKeyModulus).toHex(),r=n.util.createBuffer(y.privateKeyPublicExponent).toHex(),a=n.util.createBuffer(y.privateKeyPrivateExponent).toHex(),s=n.util.createBuffer(y.privateKeyPrime1).toHex(),c=n.util.createBuffer(y.privateKeyPrime2).toHex(),h=n.util.createBuffer(y.privateKeyExponent1).toHex(),p=n.util.createBuffer(y.privateKeyExponent2).toHex(),d=n.util.createBuffer(y.privateKeyCoefficient).toHex(),u.setRsaPrivateKey(new i(t,16),new i(r,16),new i(a,16),new i(s,16),new i(c,16),new i(h,16),new i(p,16),new i(d,16))},u.privateKeyToAsn1=u.privateKeyToRSAPrivateKey=function(e){return o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,o.integerToDer(0).getBytes()),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,b(e.n)),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,b(e.e)),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,b(e.d)),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,b(e.p)),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,b(e.q)),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,b(e.dP)),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,b(e.dQ)),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,b(e.qInv))])},u.publicKeyFromAsn1=function(e){var t={},r=[];if(o.validate(e,p,t,r)){var a,s=o.derToOid(t.publicKeyOid);if(s!==u.oids.rsaEncryption)throw(a=new Error("Cannot read public key. Unknown OID.")).oid=s,a;e=t.rsaPublicKey}if(r=[],!o.validate(e,h,t,r))throw(a=new Error("Cannot read public key. ASN.1 object does not contain an RSAPublicKey.")).errors=r,a;var c=n.util.createBuffer(t.publicKeyModulus).toHex(),l=n.util.createBuffer(t.publicKeyExponent).toHex();return u.setRsaPublicKey(new i(c,16),new i(l,16))},u.publicKeyToAsn1=u.publicKeyToSubjectPublicKeyInfo=function(e){return o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.OID,!1,o.oidToDer(u.oids.rsaEncryption).getBytes()),o.create(o.Class.UNIVERSAL,o.Type.NULL,!1,"")]),o.create(o.Class.UNIVERSAL,o.Type.BITSTRING,!1,[u.publicKeyToRSAPublicKey(e)])])},u.publicKeyToRSAPublicKey=function(e){return o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,b(e.n)),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,b(e.e))])}},137:function(e,t,r){var n=r(3832);r(8991),r(7116);var i=e.exports=n.sha1=n.sha1||{};n.md.sha1=n.md.algorithms.sha1=i,i.create=function(){o||(a=String.fromCharCode(128),a+=n.util.fillString(String.fromCharCode(0),64),o=!0);var e=null,t=n.util.createBuffer(),r=new Array(80),i={algorithm:"sha1",blockLength:64,digestLength:20,messageLength:0,fullMessageLength:null,messageLengthSize:8,start:function(){i.messageLength=0,i.fullMessageLength=i.messageLength64=[];for(var r=i.messageLengthSize/4,a=0;a<r;++a)i.fullMessageLength.push(0);return t=n.util.createBuffer(),e={h0:1732584193,h1:4023233417,h2:2562383102,h3:271733878,h4:3285377520},i}};return i.start(),i.update=function(a,o){"utf8"===o&&(a=n.util.encodeUtf8(a));var u=a.length;i.messageLength+=u,u=[u/4294967296>>>0,u>>>0];for(var c=i.fullMessageLength.length-1;c>=0;--c)i.fullMessageLength[c]+=u[1],u[1]=u[0]+(i.fullMessageLength[c]/4294967296>>>0),i.fullMessageLength[c]=i.fullMessageLength[c]>>>0,u[0]=u[1]/4294967296>>>0;return t.putBytes(a),s(e,r,t),(t.read>2048||0===t.length())&&t.compact(),i},i.digest=function(){var o=n.util.createBuffer();o.putBytes(t.bytes());var u,c=i.fullMessageLength[i.fullMessageLength.length-1]+i.messageLengthSize&i.blockLength-1;o.putBytes(a.substr(0,i.blockLength-c));for(var l=8*i.fullMessageLength[0],f=0;f<i.fullMessageLength.length-1;++f)l+=(u=8*i.fullMessageLength[f+1])/4294967296>>>0,o.putInt32(l>>>0),l=u>>>0;o.putInt32(l);var h={h0:e.h0,h1:e.h1,h2:e.h2,h3:e.h3,h4:e.h4};s(h,r,o);var p=n.util.createBuffer();return p.putInt32(h.h0),p.putInt32(h.h1),p.putInt32(h.h2),p.putInt32(h.h3),p.putInt32(h.h4),p},i};var a=null,o=!1;function s(e,t,r){for(var n,i,a,o,s,u,c,l=r.length();l>=64;){for(i=e.h0,a=e.h1,o=e.h2,s=e.h3,u=e.h4,c=0;c<16;++c)n=r.getInt32(),t[c]=n,n=(i<<5|i>>>27)+(s^a&(o^s))+u+1518500249+n,u=s,s=o,o=(a<<30|a>>>2)>>>0,a=i,i=n;for(;c<20;++c)n=(n=t[c-3]^t[c-8]^t[c-14]^t[c-16])<<1|n>>>31,t[c]=n,n=(i<<5|i>>>27)+(s^a&(o^s))+u+1518500249+n,u=s,s=o,o=(a<<30|a>>>2)>>>0,a=i,i=n;for(;c<32;++c)n=(n=t[c-3]^t[c-8]^t[c-14]^t[c-16])<<1|n>>>31,t[c]=n,n=(i<<5|i>>>27)+(a^o^s)+u+1859775393+n,u=s,s=o,o=(a<<30|a>>>2)>>>0,a=i,i=n;for(;c<40;++c)n=(n=t[c-6]^t[c-16]^t[c-28]^t[c-32])<<2|n>>>30,t[c]=n,n=(i<<5|i>>>27)+(a^o^s)+u+1859775393+n,u=s,s=o,o=(a<<30|a>>>2)>>>0,a=i,i=n;for(;c<60;++c)n=(n=t[c-6]^t[c-16]^t[c-28]^t[c-32])<<2|n>>>30,t[c]=n,n=(i<<5|i>>>27)+(a&o|s&(a^o))+u+2400959708+n,u=s,s=o,o=(a<<30|a>>>2)>>>0,a=i,i=n;for(;c<80;++c)n=(n=t[c-6]^t[c-16]^t[c-28]^t[c-32])<<2|n>>>30,t[c]=n,n=(i<<5|i>>>27)+(a^o^s)+u+3395469782+n,u=s,s=o,o=(a<<30|a>>>2)>>>0,a=i,i=n;e.h0=e.h0+i|0,e.h1=e.h1+a|0,e.h2=e.h2+o|0,e.h3=e.h3+s|0,e.h4=e.h4+u|0,l-=64}}},1668:function(e,t,r){var n=r(3832);r(8991),r(7116);var i=e.exports=n.sha256=n.sha256||{};n.md.sha256=n.md.algorithms.sha256=i,i.create=function(){o||(a=String.fromCharCode(128),a+=n.util.fillString(String.fromCharCode(0),64),s=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],o=!0);var e=null,t=n.util.createBuffer(),r=new Array(64),i={algorithm:"sha256",blockLength:64,digestLength:32,messageLength:0,fullMessageLength:null,messageLengthSize:8,start:function(){i.messageLength=0,i.fullMessageLength=i.messageLength64=[];for(var r=i.messageLengthSize/4,a=0;a<r;++a)i.fullMessageLength.push(0);return t=n.util.createBuffer(),e={h0:1779033703,h1:3144134277,h2:1013904242,h3:2773480762,h4:1359893119,h5:2600822924,h6:528734635,h7:1541459225},i}};return i.start(),i.update=function(a,o){"utf8"===o&&(a=n.util.encodeUtf8(a));var s=a.length;i.messageLength+=s,s=[s/4294967296>>>0,s>>>0];for(var c=i.fullMessageLength.length-1;c>=0;--c)i.fullMessageLength[c]+=s[1],s[1]=s[0]+(i.fullMessageLength[c]/4294967296>>>0),i.fullMessageLength[c]=i.fullMessageLength[c]>>>0,s[0]=s[1]/4294967296>>>0;return t.putBytes(a),u(e,r,t),(t.read>2048||0===t.length())&&t.compact(),i},i.digest=function(){var o=n.util.createBuffer();o.putBytes(t.bytes());var s,c=i.fullMessageLength[i.fullMessageLength.length-1]+i.messageLengthSize&i.blockLength-1;o.putBytes(a.substr(0,i.blockLength-c));for(var l=8*i.fullMessageLength[0],f=0;f<i.fullMessageLength.length-1;++f)l+=(s=8*i.fullMessageLength[f+1])/4294967296>>>0,o.putInt32(l>>>0),l=s>>>0;o.putInt32(l);var h={h0:e.h0,h1:e.h1,h2:e.h2,h3:e.h3,h4:e.h4,h5:e.h5,h6:e.h6,h7:e.h7};u(h,r,o);var p=n.util.createBuffer();return p.putInt32(h.h0),p.putInt32(h.h1),p.putInt32(h.h2),p.putInt32(h.h3),p.putInt32(h.h4),p.putInt32(h.h5),p.putInt32(h.h6),p.putInt32(h.h7),p},i};var a=null,o=!1,s=null;function u(e,t,r){for(var n,i,a,o,u,c,l,f,h,p,d,y,v,g=r.length();g>=64;){for(u=0;u<16;++u)t[u]=r.getInt32();for(;u<64;++u)n=((n=t[u-2])>>>17|n<<15)^(n>>>19|n<<13)^n>>>10,i=((i=t[u-15])>>>7|i<<25)^(i>>>18|i<<14)^i>>>3,t[u]=n+t[u-7]+i+t[u-16]|0;for(c=e.h0,l=e.h1,f=e.h2,h=e.h3,p=e.h4,d=e.h5,y=e.h6,v=e.h7,u=0;u<64;++u)a=(c>>>2|c<<30)^(c>>>13|c<<19)^(c>>>22|c<<10),o=c&l|f&(c^l),n=v+((p>>>6|p<<26)^(p>>>11|p<<21)^(p>>>25|p<<7))+(y^p&(d^y))+s[u]+t[u],v=y,y=d,d=p,p=h+n>>>0,h=f,f=l,l=c,c=n+(i=a+o)>>>0;e.h0=e.h0+c|0,e.h1=e.h1+l|0,e.h2=e.h2+f|0,e.h3=e.h3+h|0,e.h4=e.h4+p|0,e.h5=e.h5+d|0,e.h6=e.h6+y|0,e.h7=e.h7+v|0,g-=64}}},3219:function(e,t,r){var n=r(3832);r(8991),r(7116);var i=e.exports=n.sha512=n.sha512||{};n.md.sha512=n.md.algorithms.sha512=i;var a=n.sha384=n.sha512.sha384=n.sha512.sha384||{};a.create=function(){return i.create("SHA-384")},n.md.sha384=n.md.algorithms.sha384=a,n.sha512.sha256=n.sha512.sha256||{create:function(){return i.create("SHA-512/256")}},n.md["sha512/256"]=n.md.algorithms["sha512/256"]=n.sha512.sha256,n.sha512.sha224=n.sha512.sha224||{create:function(){return i.create("SHA-512/224")}},n.md["sha512/224"]=n.md.algorithms["sha512/224"]=n.sha512.sha224,i.create=function(e){if(s||(o=String.fromCharCode(128),o+=n.util.fillString(String.fromCharCode(0),128),u=[[1116352408,3609767458],[1899447441,602891725],[3049323471,3964484399],[3921009573,2173295548],[961987163,4081628472],[1508970993,3053834265],[2453635748,2937671579],[2870763221,3664609560],[3624381080,2734883394],[310598401,1164996542],[607225278,1323610764],[1426881987,3590304994],[1925078388,4068182383],[2162078206,991336113],[2614888103,633803317],[3248222580,3479774868],[3835390401,2666613458],[4022224774,944711139],[264347078,2341262773],[604807628,2007800933],[770255983,1495990901],[1249150122,1856431235],[1555081692,3175218132],[1996064986,2198950837],[2554220882,3999719339],[2821834349,766784016],[2952996808,2566594879],[3210313671,3203337956],[3336571891,1034457026],[3584528711,2466948901],[113926993,3758326383],[338241895,168717936],[666307205,1188179964],[773529912,1546045734],[1294757372,1522805485],[1396182291,2643833823],[1695183700,2343527390],[1986661051,1014477480],[2177026350,1206759142],[2456956037,344077627],[2730485921,1290863460],[2820302411,3158454273],[3259730800,3505952657],[3345764771,106217008],[3516065817,3606008344],[3600352804,1432725776],[4094571909,1467031594],[275423344,851169720],[430227734,3100823752],[506948616,1363258195],[659060556,3750685593],[883997877,3785050280],[958139571,3318307427],[1322822218,3812723403],[1537002063,2003034995],[1747873779,3602036899],[1955562222,1575990012],[2024104815,1125592928],[2227730452,2716904306],[2361852424,442776044],[2428436474,593698344],[2756734187,3733110249],[3204031479,2999351573],[3329325298,3815920427],[3391569614,3928383900],[3515267271,566280711],[3940187606,3454069534],[4118630271,4000239992],[116418474,1914138554],[174292421,2731055270],[289380356,3203993006],[460393269,320620315],[685471733,587496836],[852142971,1086792851],[1017036298,365543100],[1126000580,2618297676],[1288033470,3409855158],[1501505948,4234509866],[1607167915,987167468],[1816402316,1246189591]],(c={})["SHA-512"]=[[1779033703,4089235720],[3144134277,2227873595],[1013904242,4271175723],[2773480762,1595750129],[1359893119,2917565137],[2600822924,725511199],[528734635,4215389547],[1541459225,327033209]],c["SHA-384"]=[[3418070365,3238371032],[1654270250,914150663],[2438529370,812702999],[355462360,4144912697],[1731405415,4290775857],[2394180231,1750603025],[3675008525,1694076839],[1203062813,3204075428]],c["SHA-512/256"]=[[573645204,4230739756],[2673172387,3360449730],[596883563,1867755857],[2520282905,1497426621],[2519219938,2827943907],[3193839141,1401305490],[721525244,746961066],[246885852,2177182882]],c["SHA-512/224"]=[[2352822216,424955298],[1944164710,2312950998],[502970286,855612546],[1738396948,1479516111],[258812777,2077511080],[2011393907,79989058],[1067287976,1780299464],[286451373,2446758561]],s=!0),void 0===e&&(e="SHA-512"),!(e in c))throw new Error("Invalid SHA-512 algorithm: "+e);for(var t=c[e],r=null,i=n.util.createBuffer(),a=new Array(80),f=0;f<80;++f)a[f]=new Array(2);var h=64;switch(e){case"SHA-384":h=48;break;case"SHA-512/256":h=32;break;case"SHA-512/224":h=28}var p={algorithm:e.replace("-","").toLowerCase(),blockLength:128,digestLength:h,messageLength:0,fullMessageLength:null,messageLengthSize:16,start:function(){p.messageLength=0,p.fullMessageLength=p.messageLength128=[];for(var e=p.messageLengthSize/4,a=0;a<e;++a)p.fullMessageLength.push(0);i=n.util.createBuffer(),r=new Array(t.length);for(a=0;a<t.length;++a)r[a]=t[a].slice(0);return p}};return p.start(),p.update=function(e,t){"utf8"===t&&(e=n.util.encodeUtf8(e));var o=e.length;p.messageLength+=o,o=[o/4294967296>>>0,o>>>0];for(var s=p.fullMessageLength.length-1;s>=0;--s)p.fullMessageLength[s]+=o[1],o[1]=o[0]+(p.fullMessageLength[s]/4294967296>>>0),p.fullMessageLength[s]=p.fullMessageLength[s]>>>0,o[0]=o[1]/4294967296>>>0;return i.putBytes(e),l(r,a,i),(i.read>2048||0===i.length())&&i.compact(),p},p.digest=function(){var t=n.util.createBuffer();t.putBytes(i.bytes());var s,u=p.fullMessageLength[p.fullMessageLength.length-1]+p.messageLengthSize&p.blockLength-1;t.putBytes(o.substr(0,p.blockLength-u));for(var c=8*p.fullMessageLength[0],f=0;f<p.fullMessageLength.length-1;++f)c+=(s=8*p.fullMessageLength[f+1])/4294967296>>>0,t.putInt32(c>>>0),c=s>>>0;t.putInt32(c);var h=new Array(r.length);for(f=0;f<r.length;++f)h[f]=r[f].slice(0);l(h,a,t);var d,y=n.util.createBuffer();d="SHA-512"===e?h.length:"SHA-384"===e?h.length-2:h.length-4;for(f=0;f<d;++f)y.putInt32(h[f][0]),f===d-1&&"SHA-512/224"===e||y.putInt32(h[f][1]);return y},p};var o=null,s=!1,u=null,c=null;function l(e,t,r){for(var n,i,a,o,s,c,l,f,h,p,d,y,v,g,m,b,E,S,C,w,T,A,I,k,_,B,N,O,R,x,P,F,D,L=r.length();L>=128;){for(N=0;N<16;++N)t[N][0]=r.getInt32()>>>0,t[N][1]=r.getInt32()>>>0;for(;N<80;++N)n=(((O=(x=t[N-2])[0])>>>19|(R=x[1])<<13)^(R>>>29|O<<3)^O>>>6)>>>0,i=((O<<13|R>>>19)^(R<<3|O>>>29)^(O<<26|R>>>6))>>>0,a=(((O=(F=t[N-15])[0])>>>1|(R=F[1])<<31)^(O>>>8|R<<24)^O>>>7)>>>0,o=((O<<31|R>>>1)^(O<<24|R>>>8)^(O<<25|R>>>7))>>>0,P=t[N-7],D=t[N-16],R=i+P[1]+o+D[1],t[N][0]=n+P[0]+a+D[0]+(R/4294967296>>>0)>>>0,t[N][1]=R>>>0;for(d=e[0][0],y=e[0][1],v=e[1][0],g=e[1][1],m=e[2][0],b=e[2][1],E=e[3][0],S=e[3][1],C=e[4][0],w=e[4][1],T=e[5][0],A=e[5][1],I=e[6][0],k=e[6][1],_=e[7][0],B=e[7][1],N=0;N<80;++N)l=((C>>>14|w<<18)^(C>>>18|w<<14)^(w>>>9|C<<23))>>>0,f=(I^C&(T^I))>>>0,s=((d>>>28|y<<4)^(y>>>2|d<<30)^(y>>>7|d<<25))>>>0,c=((d<<4|y>>>28)^(y<<30|d>>>2)^(y<<25|d>>>7))>>>0,h=(d&v|m&(d^v))>>>0,p=(y&g|b&(y^g))>>>0,R=B+(((C<<18|w>>>14)^(C<<14|w>>>18)^(w<<23|C>>>9))>>>0)+((k^w&(A^k))>>>0)+u[N][1]+t[N][1],n=_+l+f+u[N][0]+t[N][0]+(R/4294967296>>>0)>>>0,i=R>>>0,a=s+h+((R=c+p)/4294967296>>>0)>>>0,o=R>>>0,_=I,B=k,I=T,k=A,T=C,A=w,C=E+n+((R=S+i)/4294967296>>>0)>>>0,w=R>>>0,E=m,S=b,m=v,b=g,v=d,g=y,d=n+a+((R=i+o)/4294967296>>>0)>>>0,y=R>>>0;R=e[0][1]+y,e[0][0]=e[0][0]+d+(R/4294967296>>>0)>>>0,e[0][1]=R>>>0,R=e[1][1]+g,e[1][0]=e[1][0]+v+(R/4294967296>>>0)>>>0,e[1][1]=R>>>0,R=e[2][1]+b,e[2][0]=e[2][0]+m+(R/4294967296>>>0)>>>0,e[2][1]=R>>>0,R=e[3][1]+S,e[3][0]=e[3][0]+E+(R/4294967296>>>0)>>>0,e[3][1]=R>>>0,R=e[4][1]+w,e[4][0]=e[4][0]+C+(R/4294967296>>>0)>>>0,e[4][1]=R>>>0,R=e[5][1]+A,e[5][0]=e[5][0]+T+(R/4294967296>>>0)>>>0,e[5][1]=R>>>0,R=e[6][1]+k,e[6][0]=e[6][0]+I+(R/4294967296>>>0)>>>0,e[6][1]=R>>>0,R=e[7][1]+B,e[7][0]=e[7][0]+_+(R/4294967296>>>0)>>>0,e[7][1]=R>>>0,L-=128}}},7116:function(e,t,r){var n=r(3832),i=r(8807),a=e.exports=n.util=n.util||{};function o(e){if(8!==e&&16!==e&&24!==e&&32!==e)throw new Error("Only 8, 16, 24, or 32 bits supported: "+e)}function s(e){if(this.data="",this.read=0,"string"==typeof e)this.data=e;else if(a.isArrayBuffer(e)||a.isArrayBufferView(e))if("undefined"!=typeof Buffer&&e instanceof Buffer)this.data=e.toString("binary");else{var t=new Uint8Array(e);try{this.data=String.fromCharCode.apply(null,t)}catch(e){for(var r=0;r<t.length;++r)this.putByte(t[r])}}else(e instanceof s||"object"==typeof e&&"string"==typeof e.data&&"number"==typeof e.read)&&(this.data=e.data,this.read=e.read);this._constructedStringLength=0}!function(){if("undefined"!=typeof process&&process.nextTick&&!process.browser)return a.nextTick=process.nextTick,void("function"==typeof setImmediate?a.setImmediate=setImmediate:a.setImmediate=a.nextTick);if("function"==typeof setImmediate)return a.setImmediate=function(){return setImmediate.apply(void 0,arguments)},void(a.nextTick=function(e){return setImmediate(e)});if(a.setImmediate=function(e){setTimeout(e,0)},"undefined"!=typeof window&&"function"==typeof window.postMessage){var e="forge.setImmediate",t=[];a.setImmediate=function(r){t.push(r),1===t.length&&window.postMessage(e,"*")},window.addEventListener("message",(function(r){if(r.source===window&&r.data===e){r.stopPropagation();var n=t.slice();t.length=0,n.forEach((function(e){e()}))}}),!0)}if("undefined"!=typeof MutationObserver){var r=Date.now(),n=!0,i=document.createElement("div");t=[];new MutationObserver((function(){var e=t.slice();t.length=0,e.forEach((function(e){e()}))})).observe(i,{attributes:!0});var o=a.setImmediate;a.setImmediate=function(e){Date.now()-r>15?(r=Date.now(),o(e)):(t.push(e),1===t.length&&i.setAttribute("a",n=!n))}}a.nextTick=a.setImmediate}(),a.isNodejs="undefined"!=typeof process&&process.versions&&process.versions.node,a.globalScope=a.isNodejs?r.g:"undefined"==typeof self?window:self,a.isArray=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},a.isArrayBuffer=function(e){return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer},a.isArrayBufferView=function(e){return e&&a.isArrayBuffer(e.buffer)&&void 0!==e.byteLength},a.ByteBuffer=s,a.ByteStringBuffer=s;a.ByteStringBuffer.prototype._optimizeConstructedString=function(e){this._constructedStringLength+=e,this._constructedStringLength>4096&&(this.data.substr(0,1),this._constructedStringLength=0)},a.ByteStringBuffer.prototype.length=function(){return this.data.length-this.read},a.ByteStringBuffer.prototype.isEmpty=function(){return this.length()<=0},a.ByteStringBuffer.prototype.putByte=function(e){return this.putBytes(String.fromCharCode(e))},a.ByteStringBuffer.prototype.fillWithByte=function(e,t){e=String.fromCharCode(e);for(var r=this.data;t>0;)1&t&&(r+=e),(t>>>=1)>0&&(e+=e);return this.data=r,this._optimizeConstructedString(t),this},a.ByteStringBuffer.prototype.putBytes=function(e){return this.data+=e,this._optimizeConstructedString(e.length),this},a.ByteStringBuffer.prototype.putString=function(e){return this.putBytes(a.encodeUtf8(e))},a.ByteStringBuffer.prototype.putInt16=function(e){return this.putBytes(String.fromCharCode(e>>8&255)+String.fromCharCode(255&e))},a.ByteStringBuffer.prototype.putInt24=function(e){return this.putBytes(String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(255&e))},a.ByteStringBuffer.prototype.putInt32=function(e){return this.putBytes(String.fromCharCode(e>>24&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(255&e))},a.ByteStringBuffer.prototype.putInt16Le=function(e){return this.putBytes(String.fromCharCode(255&e)+String.fromCharCode(e>>8&255))},a.ByteStringBuffer.prototype.putInt24Le=function(e){return this.putBytes(String.fromCharCode(255&e)+String.fromCharCode(e>>8&255)+String.fromCharCode(e>>16&255))},a.ByteStringBuffer.prototype.putInt32Le=function(e){return this.putBytes(String.fromCharCode(255&e)+String.fromCharCode(e>>8&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>24&255))},a.ByteStringBuffer.prototype.putInt=function(e,t){o(t);var r="";do{t-=8,r+=String.fromCharCode(e>>t&255)}while(t>0);return this.putBytes(r)},a.ByteStringBuffer.prototype.putSignedInt=function(e,t){return e<0&&(e+=2<<t-1),this.putInt(e,t)},a.ByteStringBuffer.prototype.putBuffer=function(e){return this.putBytes(e.getBytes())},a.ByteStringBuffer.prototype.getByte=function(){return this.data.charCodeAt(this.read++)},a.ByteStringBuffer.prototype.getInt16=function(){var e=this.data.charCodeAt(this.read)<<8^this.data.charCodeAt(this.read+1);return this.read+=2,e},a.ByteStringBuffer.prototype.getInt24=function(){var e=this.data.charCodeAt(this.read)<<16^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2);return this.read+=3,e},a.ByteStringBuffer.prototype.getInt32=function(){var e=this.data.charCodeAt(this.read)<<24^this.data.charCodeAt(this.read+1)<<16^this.data.charCodeAt(this.read+2)<<8^this.data.charCodeAt(this.read+3);return this.read+=4,e},a.ByteStringBuffer.prototype.getInt16Le=function(){var e=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8;return this.read+=2,e},a.ByteStringBuffer.prototype.getInt24Le=function(){var e=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2)<<16;return this.read+=3,e},a.ByteStringBuffer.prototype.getInt32Le=function(){var e=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2)<<16^this.data.charCodeAt(this.read+3)<<24;return this.read+=4,e},a.ByteStringBuffer.prototype.getInt=function(e){o(e);var t=0;do{t=(t<<8)+this.data.charCodeAt(this.read++),e-=8}while(e>0);return t},a.ByteStringBuffer.prototype.getSignedInt=function(e){var t=this.getInt(e),r=2<<e-2;return t>=r&&(t-=r<<1),t},a.ByteStringBuffer.prototype.getBytes=function(e){var t;return e?(e=Math.min(this.length(),e),t=this.data.slice(this.read,this.read+e),this.read+=e):0===e?t="":(t=0===this.read?this.data:this.data.slice(this.read),this.clear()),t},a.ByteStringBuffer.prototype.bytes=function(e){return void 0===e?this.data.slice(this.read):this.data.slice(this.read,this.read+e)},a.ByteStringBuffer.prototype.at=function(e){return this.data.charCodeAt(this.read+e)},a.ByteStringBuffer.prototype.setAt=function(e,t){return this.data=this.data.substr(0,this.read+e)+String.fromCharCode(t)+this.data.substr(this.read+e+1),this},a.ByteStringBuffer.prototype.last=function(){return this.data.charCodeAt(this.data.length-1)},a.ByteStringBuffer.prototype.copy=function(){var e=a.createBuffer(this.data);return e.read=this.read,e},a.ByteStringBuffer.prototype.compact=function(){return this.read>0&&(this.data=this.data.slice(this.read),this.read=0),this},a.ByteStringBuffer.prototype.clear=function(){return this.data="",this.read=0,this},a.ByteStringBuffer.prototype.truncate=function(e){var t=Math.max(0,this.length()-e);return this.data=this.data.substr(this.read,t),this.read=0,this},a.ByteStringBuffer.prototype.toHex=function(){for(var e="",t=this.read;t<this.data.length;++t){var r=this.data.charCodeAt(t);r<16&&(e+="0"),e+=r.toString(16)}return e},a.ByteStringBuffer.prototype.toString=function(){return a.decodeUtf8(this.bytes())},a.DataBuffer=function(e,t){t=t||{},this.read=t.readOffset||0,this.growSize=t.growSize||1024;var r=a.isArrayBuffer(e),n=a.isArrayBufferView(e);if(r||n)return this.data=r?new DataView(e):new DataView(e.buffer,e.byteOffset,e.byteLength),void(this.write="writeOffset"in t?t.writeOffset:this.data.byteLength);this.data=new DataView(new ArrayBuffer(0)),this.write=0,null!=e&&this.putBytes(e),"writeOffset"in t&&(this.write=t.writeOffset)},a.DataBuffer.prototype.length=function(){return this.write-this.read},a.DataBuffer.prototype.isEmpty=function(){return this.length()<=0},a.DataBuffer.prototype.accommodate=function(e,t){if(this.length()>=e)return this;t=Math.max(t||this.growSize,e);var r=new Uint8Array(this.data.buffer,this.data.byteOffset,this.data.byteLength),n=new Uint8Array(this.length()+t);return n.set(r),this.data=new DataView(n.buffer),this},a.DataBuffer.prototype.putByte=function(e){return this.accommodate(1),this.data.setUint8(this.write++,e),this},a.DataBuffer.prototype.fillWithByte=function(e,t){this.accommodate(t);for(var r=0;r<t;++r)this.data.setUint8(e);return this},a.DataBuffer.prototype.putBytes=function(e,t){if(a.isArrayBufferView(e)){var r=(n=new Uint8Array(e.buffer,e.byteOffset,e.byteLength)).byteLength-n.byteOffset;return this.accommodate(r),new Uint8Array(this.data.buffer,this.write).set(n),this.write+=r,this}if(a.isArrayBuffer(e)){var n=new Uint8Array(e);return this.accommodate(n.byteLength),new Uint8Array(this.data.buffer).set(n,this.write),this.write+=n.byteLength,this}if(e instanceof a.DataBuffer||"object"==typeof e&&"number"==typeof e.read&&"number"==typeof e.write&&a.isArrayBufferView(e.data)){n=new Uint8Array(e.data.byteLength,e.read,e.length());return this.accommodate(n.byteLength),new Uint8Array(e.data.byteLength,this.write).set(n),this.write+=n.byteLength,this}if(e instanceof a.ByteStringBuffer&&(e=e.data,t="binary"),t=t||"binary","string"==typeof e){var i;if("hex"===t)return this.accommodate(Math.ceil(e.length/2)),i=new Uint8Array(this.data.buffer,this.write),this.write+=a.binary.hex.decode(e,i,this.write),this;if("base64"===t)return this.accommodate(3*Math.ceil(e.length/4)),i=new Uint8Array(this.data.buffer,this.write),this.write+=a.binary.base64.decode(e,i,this.write),this;if("utf8"===t&&(e=a.encodeUtf8(e),t="binary"),"binary"===t||"raw"===t)return this.accommodate(e.length),i=new Uint8Array(this.data.buffer,this.write),this.write+=a.binary.raw.decode(i),this;if("utf16"===t)return this.accommodate(2*e.length),i=new Uint16Array(this.data.buffer,this.write),this.write+=a.text.utf16.encode(i),this;throw new Error("Invalid encoding: "+t)}throw Error("Invalid parameter: "+e)},a.DataBuffer.prototype.putBuffer=function(e){return this.putBytes(e),e.clear(),this},a.DataBuffer.prototype.putString=function(e){return this.putBytes(e,"utf16")},a.DataBuffer.prototype.putInt16=function(e){return this.accommodate(2),this.data.setInt16(this.write,e),this.write+=2,this},a.DataBuffer.prototype.putInt24=function(e){return this.accommodate(3),this.data.setInt16(this.write,e>>8&65535),this.data.setInt8(this.write,e>>16&255),this.write+=3,this},a.DataBuffer.prototype.putInt32=function(e){return this.accommodate(4),this.data.setInt32(this.write,e),this.write+=4,this},a.DataBuffer.prototype.putInt16Le=function(e){return this.accommodate(2),this.data.setInt16(this.write,e,!0),this.write+=2,this},a.DataBuffer.prototype.putInt24Le=function(e){return this.accommodate(3),this.data.setInt8(this.write,e>>16&255),this.data.setInt16(this.write,e>>8&65535,!0),this.write+=3,this},a.DataBuffer.prototype.putInt32Le=function(e){return this.accommodate(4),this.data.setInt32(this.write,e,!0),this.write+=4,this},a.DataBuffer.prototype.putInt=function(e,t){o(t),this.accommodate(t/8);do{t-=8,this.data.setInt8(this.write++,e>>t&255)}while(t>0);return this},a.DataBuffer.prototype.putSignedInt=function(e,t){return o(t),this.accommodate(t/8),e<0&&(e+=2<<t-1),this.putInt(e,t)},a.DataBuffer.prototype.getByte=function(){return this.data.getInt8(this.read++)},a.DataBuffer.prototype.getInt16=function(){var e=this.data.getInt16(this.read);return this.read+=2,e},a.DataBuffer.prototype.getInt24=function(){var e=this.data.getInt16(this.read)<<8^this.data.getInt8(this.read+2);return this.read+=3,e},a.DataBuffer.prototype.getInt32=function(){var e=this.data.getInt32(this.read);return this.read+=4,e},a.DataBuffer.prototype.getInt16Le=function(){var e=this.data.getInt16(this.read,!0);return this.read+=2,e},a.DataBuffer.prototype.getInt24Le=function(){var e=this.data.getInt8(this.read)^this.data.getInt16(this.read+1,!0)<<8;return this.read+=3,e},a.DataBuffer.prototype.getInt32Le=function(){var e=this.data.getInt32(this.read,!0);return this.read+=4,e},a.DataBuffer.prototype.getInt=function(e){o(e);var t=0;do{t=(t<<8)+this.data.getInt8(this.read++),e-=8}while(e>0);return t},a.DataBuffer.prototype.getSignedInt=function(e){var t=this.getInt(e),r=2<<e-2;return t>=r&&(t-=r<<1),t},a.DataBuffer.prototype.getBytes=function(e){var t;return e?(e=Math.min(this.length(),e),t=this.data.slice(this.read,this.read+e),this.read+=e):0===e?t="":(t=0===this.read?this.data:this.data.slice(this.read),this.clear()),t},a.DataBuffer.prototype.bytes=function(e){return void 0===e?this.data.slice(this.read):this.data.slice(this.read,this.read+e)},a.DataBuffer.prototype.at=function(e){return this.data.getUint8(this.read+e)},a.DataBuffer.prototype.setAt=function(e,t){return this.data.setUint8(e,t),this},a.DataBuffer.prototype.last=function(){return this.data.getUint8(this.write-1)},a.DataBuffer.prototype.copy=function(){return new a.DataBuffer(this)},a.DataBuffer.prototype.compact=function(){if(this.read>0){var e=new Uint8Array(this.data.buffer,this.read),t=new Uint8Array(e.byteLength);t.set(e),this.data=new DataView(t),this.write-=this.read,this.read=0}return this},a.DataBuffer.prototype.clear=function(){return this.data=new DataView(new ArrayBuffer(0)),this.read=this.write=0,this},a.DataBuffer.prototype.truncate=function(e){return this.write=Math.max(0,this.length()-e),this.read=Math.min(this.read,this.write),this},a.DataBuffer.prototype.toHex=function(){for(var e="",t=this.read;t<this.data.byteLength;++t){var r=this.data.getUint8(t);r<16&&(e+="0"),e+=r.toString(16)}return e},a.DataBuffer.prototype.toString=function(e){var t=new Uint8Array(this.data,this.read,this.length());if("binary"===(e=e||"utf8")||"raw"===e)return a.binary.raw.encode(t);if("hex"===e)return a.binary.hex.encode(t);if("base64"===e)return a.binary.base64.encode(t);if("utf8"===e)return a.text.utf8.decode(t);if("utf16"===e)return a.text.utf16.decode(t);throw new Error("Invalid encoding: "+e)},a.createBuffer=function(e,t){return t=t||"raw",void 0!==e&&"utf8"===t&&(e=a.encodeUtf8(e)),new a.ByteBuffer(e)},a.fillString=function(e,t){for(var r="";t>0;)1&t&&(r+=e),(t>>>=1)>0&&(e+=e);return r},a.xorBytes=function(e,t,r){for(var n="",i="",a="",o=0,s=0;r>0;--r,++o)i=e.charCodeAt(o)^t.charCodeAt(o),s>=10&&(n+=a,a="",s=0),a+=String.fromCharCode(i),++s;return n+=a},a.hexToBytes=function(e){var t="",r=0;for(!0&e.length&&(r=1,t+=String.fromCharCode(parseInt(e[0],16)));r<e.length;r+=2)t+=String.fromCharCode(parseInt(e.substr(r,2),16));return t},a.bytesToHex=function(e){return a.createBuffer(e).toHex()},a.int32ToBytes=function(e){return String.fromCharCode(e>>24&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(255&e)};var u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",c=[62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,64,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51],l="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";a.encode64=function(e,t){for(var r,n,i,a="",o="",s=0;s<e.length;)r=e.charCodeAt(s++),n=e.charCodeAt(s++),i=e.charCodeAt(s++),a+=u.charAt(r>>2),a+=u.charAt((3&r)<<4|n>>4),isNaN(n)?a+="==":(a+=u.charAt((15&n)<<2|i>>6),a+=isNaN(i)?"=":u.charAt(63&i)),t&&a.length>t&&(o+=a.substr(0,t)+"\r\n",a=a.substr(t));return o+=a},a.decode64=function(e){e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var t,r,n,i,a="",o=0;o<e.length;)t=c[e.charCodeAt(o++)-43],r=c[e.charCodeAt(o++)-43],n=c[e.charCodeAt(o++)-43],i=c[e.charCodeAt(o++)-43],a+=String.fromCharCode(t<<2|r>>4),64!==n&&(a+=String.fromCharCode((15&r)<<4|n>>2),64!==i&&(a+=String.fromCharCode((3&n)<<6|i)));return a},a.encodeUtf8=function(e){return unescape(encodeURIComponent(e))},a.decodeUtf8=function(e){return decodeURIComponent(escape(e))},a.binary={raw:{},hex:{},base64:{},base58:{},baseN:{encode:i.encode,decode:i.decode}},a.binary.raw.encode=function(e){return String.fromCharCode.apply(null,e)},a.binary.raw.decode=function(e,t,r){var n=t;n||(n=new Uint8Array(e.length));for(var i=r=r||0,a=0;a<e.length;++a)n[i++]=e.charCodeAt(a);return t?i-r:n},a.binary.hex.encode=a.bytesToHex,a.binary.hex.decode=function(e,t,r){var n=t;n||(n=new Uint8Array(Math.ceil(e.length/2)));var i=0,a=r=r||0;for(1&e.length&&(i=1,n[a++]=parseInt(e[0],16));i<e.length;i+=2)n[a++]=parseInt(e.substr(i,2),16);return t?a-r:n},a.binary.base64.encode=function(e,t){for(var r,n,i,a="",o="",s=0;s<e.byteLength;)r=e[s++],n=e[s++],i=e[s++],a+=u.charAt(r>>2),a+=u.charAt((3&r)<<4|n>>4),isNaN(n)?a+="==":(a+=u.charAt((15&n)<<2|i>>6),a+=isNaN(i)?"=":u.charAt(63&i)),t&&a.length>t&&(o+=a.substr(0,t)+"\r\n",a=a.substr(t));return o+=a},a.binary.base64.decode=function(e,t,r){var n,i,a,o,s=t;s||(s=new Uint8Array(3*Math.ceil(e.length/4))),e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var u=0,l=r=r||0;u<e.length;)n=c[e.charCodeAt(u++)-43],i=c[e.charCodeAt(u++)-43],a=c[e.charCodeAt(u++)-43],o=c[e.charCodeAt(u++)-43],s[l++]=n<<2|i>>4,64!==a&&(s[l++]=(15&i)<<4|a>>2,64!==o&&(s[l++]=(3&a)<<6|o));return t?l-r:s.subarray(0,l)},a.binary.base58.encode=function(e,t){return a.binary.baseN.encode(e,l,t)},a.binary.base58.decode=function(e,t){return a.binary.baseN.decode(e,l,t)},a.text={utf8:{},utf16:{}},a.text.utf8.encode=function(e,t,r){e=a.encodeUtf8(e);var n=t;n||(n=new Uint8Array(e.length));for(var i=r=r||0,o=0;o<e.length;++o)n[i++]=e.charCodeAt(o);return t?i-r:n},a.text.utf8.decode=function(e){return a.decodeUtf8(String.fromCharCode.apply(null,e))},a.text.utf16.encode=function(e,t,r){var n=t;n||(n=new Uint8Array(2*e.length));for(var i=new Uint16Array(n.buffer),a=r=r||0,o=r,s=0;s<e.length;++s)i[o++]=e.charCodeAt(s),a+=2;return t?a-r:n},a.text.utf16.decode=function(e){return String.fromCharCode.apply(null,new Uint16Array(e.buffer))},a.deflate=function(e,t,r){if(t=a.decode64(e.deflate(a.encode64(t)).rval),r){var n=2;32&t.charCodeAt(1)&&(n=6),t=t.substring(n,t.length-4)}return t},a.inflate=function(e,t,r){var n=e.inflate(a.encode64(t)).rval;return null===n?null:a.decode64(n)};var f=function(e,t,r){if(!e)throw new Error("WebStorage not available.");var n;if(null===r?n=e.removeItem(t):(r=a.encode64(JSON.stringify(r)),n=e.setItem(t,r)),void 0!==n&&!0!==n.rval){var i=new Error(n.error.message);throw i.id=n.error.id,i.name=n.error.name,i}},h=function(e,t){if(!e)throw new Error("WebStorage not available.");var r=e.getItem(t);if(e.init)if(null===r.rval){if(r.error){var n=new Error(r.error.message);throw n.id=r.error.id,n.name=r.error.name,n}r=null}else r=r.rval;return null!==r&&(r=JSON.parse(a.decode64(r))),r},p=function(e,t,r,n){var i=h(e,t);null===i&&(i={}),i[r]=n,f(e,t,i)},d=function(e,t,r){var n=h(e,t);return null!==n&&(n=r in n?n[r]:null),n},y=function(e,t,r){var n=h(e,t);if(null!==n&&r in n){delete n[r];var i=!0;for(var a in n){i=!1;break}i&&(n=null),f(e,t,n)}},v=function(e,t){f(e,t,null)},g=function(e,t,r){var n,i=null;void 0===r&&(r=["web","flash"]);var a=!1,o=null;for(var s in r){n=r[s];try{if("flash"===n||"both"===n){if(null===t[0])throw new Error("Flash local storage not available.");i=e.apply(this,t),a="flash"===n}"web"!==n&&"both"!==n||(t[0]=localStorage,i=e.apply(this,t),a=!0)}catch(e){o=e}if(a)break}if(!a)throw o;return i};a.setItem=function(e,t,r,n,i){g(p,arguments,i)},a.getItem=function(e,t,r,n){return g(d,arguments,n)},a.removeItem=function(e,t,r,n){g(y,arguments,n)},a.clearItems=function(e,t,r){g(v,arguments,r)},a.parseUrl=function(e){var t=/^(https?):\/\/([^:&^\/]*):?(\d*)(.*)$/g;t.lastIndex=0;var r=t.exec(e),n=null===r?null:{full:e,scheme:r[1],host:r[2],port:r[3],path:r[4]};return n&&(n.fullHost=n.host,n.port?(80!==n.port&&"http"===n.scheme||443!==n.port&&"https"===n.scheme)&&(n.fullHost+=":"+n.port):"http"===n.scheme?n.port=80:"https"===n.scheme&&(n.port=443),n.full=n.scheme+"://"+n.fullHost),n};var m=null;a.getQueryVariables=function(e){var t,r=function(e){for(var t={},r=e.split("&"),n=0;n<r.length;n++){var i,a,o=r[n].indexOf("=");o>0?(i=r[n].substring(0,o),a=r[n].substring(o+1)):(i=r[n],a=null),i in t||(t[i]=[]),i in Object.prototype||null===a||t[i].push(unescape(a))}return t};return void 0===e?(null===m&&(m="undefined"!=typeof window&&window.location&&window.location.search?r(window.location.search.substring(1)):{}),t=m):t=r(e),t},a.parseFragment=function(e){var t=e,r="",n=e.indexOf("?");n>0&&(t=e.substring(0,n),r=e.substring(n+1));var i=t.split("/");return i.length>0&&""===i[0]&&i.shift(),{pathString:t,queryString:r,path:i,query:""===r?{}:a.getQueryVariables(r)}},a.makeRequest=function(e){var t=a.parseFragment(e),r={path:t.pathString,query:t.queryString,getPath:function(e){return void 0===e?t.path:t.path[e]},getQuery:function(e,r){var n;return void 0===e?n=t.query:(n=t.query[e])&&void 0!==r&&(n=n[r]),n},getQueryLast:function(e,t){var n=r.getQuery(e);return n?n[n.length-1]:t}};return r},a.makeLink=function(e,t,r){e=jQuery.isArray(e)?e.join("/"):e;var n=jQuery.param(t||{});return r=r||"",e+(n.length>0?"?"+n:"")+(r.length>0?"#"+r:"")},a.isEmpty=function(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0},a.format=function(e){for(var t,r,n=/%./g,i=0,a=[],o=0;t=n.exec(e);){(r=e.substring(o,n.lastIndex-2)).length>0&&a.push(r),o=n.lastIndex;var s=t[0][1];switch(s){case"s":case"o":i<arguments.length?a.push(arguments[1+i++]):a.push("<?>");break;case"%":a.push("%");break;default:a.push("<%"+s+"?>")}}return a.push(e.substring(o)),a.join("")},a.formatNumber=function(e,t,r,n){var i=e,a=isNaN(t=Math.abs(t))?2:t,o=void 0===r?",":r,s=void 0===n?".":n,u=i<0?"-":"",c=parseInt(i=Math.abs(+i||0).toFixed(a),10)+"",l=c.length>3?c.length%3:0;return u+(l?c.substr(0,l)+s:"")+c.substr(l).replace(/(\d{3})(?=\d)/g,"$1"+s)+(a?o+Math.abs(i-c).toFixed(a).slice(2):"")},a.formatSize=function(e){return e=e>=1073741824?a.formatNumber(e/1073741824,2,".","")+" GiB":e>=1048576?a.formatNumber(e/1048576,2,".","")+" MiB":e>=1024?a.formatNumber(e/1024,0)+" KiB":a.formatNumber(e,0)+" bytes"},a.bytesFromIP=function(e){return-1!==e.indexOf(".")?a.bytesFromIPv4(e):-1!==e.indexOf(":")?a.bytesFromIPv6(e):null},a.bytesFromIPv4=function(e){if(4!==(e=e.split(".")).length)return null;for(var t=a.createBuffer(),r=0;r<e.length;++r){var n=parseInt(e[r],10);if(isNaN(n))return null;t.putByte(n)}return t.getBytes()},a.bytesFromIPv6=function(e){for(var t=0,r=2*(8-(e=e.split(":").filter((function(e){return 0===e.length&&++t,!0}))).length+t),n=a.createBuffer(),i=0;i<8;++i)if(e[i]&&0!==e[i].length){var o=a.hexToBytes(e[i]);o.length<2&&n.putByte(0),n.putBytes(o)}else n.fillWithByte(0,r),r=0;return n.getBytes()},a.bytesToIP=function(e){return 4===e.length?a.bytesToIPv4(e):16===e.length?a.bytesToIPv6(e):null},a.bytesToIPv4=function(e){if(4!==e.length)return null;for(var t=[],r=0;r<e.length;++r)t.push(e.charCodeAt(r));return t.join(".")},a.bytesToIPv6=function(e){if(16!==e.length)return null;for(var t=[],r=[],n=0,i=0;i<e.length;i+=2){for(var o=a.bytesToHex(e[i]+e[i+1]);"0"===o[0]&&"0"!==o;)o=o.substr(1);if("0"===o){var s=r[r.length-1],u=t.length;s&&u===s.end+1?(s.end=u,s.end-s.start>r[n].end-r[n].start&&(n=r.length-1)):r.push({start:u,end:u})}t.push(o)}if(r.length>0){var c=r[n];c.end-c.start>0&&(t.splice(c.start,c.end-c.start+1,""),0===c.start&&t.unshift(""),7===c.end&&t.push(""))}return t.join(":")},a.estimateCores=function(e,t){if("function"==typeof e&&(t=e,e={}),e=e||{},"cores"in a&&!e.update)return t(null,a.cores);if("undefined"!=typeof navigator&&"hardwareConcurrency"in navigator&&navigator.hardwareConcurrency>0)return a.cores=navigator.hardwareConcurrency,t(null,a.cores);if("undefined"==typeof Worker)return a.cores=1,t(null,a.cores);if("undefined"==typeof Blob)return a.cores=2,t(null,a.cores);var r=URL.createObjectURL(new Blob(["(",function(){self.addEventListener("message",(function(e){for(var t=Date.now(),r=t+4;Date.now()<r;);self.postMessage({st:t,et:r})}))}.toString(),")()"],{type:"application/javascript"}));!function e(n,i,o){if(0===i){var s=Math.floor(n.reduce((function(e,t){return e+t}),0)/n.length);return a.cores=Math.max(1,s),URL.revokeObjectURL(r),t(null,a.cores)}!function(e,t){for(var n=[],i=[],a=0;a<e;++a){var o=new Worker(r);o.addEventListener("message",(function(r){if(i.push(r.data),i.length===e){for(var a=0;a<e;++a)n[a].terminate();t(null,i)}})),n.push(o)}for(a=0;a<e;++a)n[a].postMessage(a)}(o,(function(t,r){n.push(function(e,t){for(var r=[],n=0;n<e;++n)for(var i=t[n],a=r[n]=[],o=0;o<e;++o)if(n!==o){var s=t[o];(i.st>s.st&&i.st<s.et||s.st>i.st&&s.st<i.et)&&a.push(o)}return r.reduce((function(e,t){return Math.max(e,t.length)}),0)}(o,r)),e(n,i-1,o)}))}([],5,16)}},5414:function(e,t,r){var n=r(3832);r(8925),r(3068),r(3480),r(8991),r(6971),r(6270),r(6953),r(6007),r(8095),r(7116);var i=n.asn1,a=e.exports=n.pki=n.pki||{},o=a.oids,s={};s.CN=o.commonName,s.commonName="CN",s.C=o.countryName,s.countryName="C",s.L=o.localityName,s.localityName="L",s.ST=o.stateOrProvinceName,s.stateOrProvinceName="ST",s.O=o.organizationName,s.organizationName="O",s.OU=o.organizationalUnitName,s.organizationalUnitName="OU",s.E=o.emailAddress,s.emailAddress="E";var u=n.pki.rsa.publicKeyValidator,c={name:"Certificate",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"tbsCertificate",value:[{name:"Certificate.TBSCertificate.version",tagClass:i.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.version.integer",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"certVersion"}]},{name:"Certificate.TBSCertificate.serialNumber",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"certSerialNumber"},{name:"Certificate.TBSCertificate.signature",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.signature.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"certinfoSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:i.Class.UNIVERSAL,optional:!0,captureAsn1:"certinfoSignatureParams"}]},{name:"Certificate.TBSCertificate.issuer",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"certIssuer"},{name:"Certificate.TBSCertificate.validity",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.validity.notBefore (utc)",tagClass:i.Class.UNIVERSAL,type:i.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity1UTCTime"},{name:"Certificate.TBSCertificate.validity.notBefore (generalized)",tagClass:i.Class.UNIVERSAL,type:i.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity2GeneralizedTime"},{name:"Certificate.TBSCertificate.validity.notAfter (utc)",tagClass:i.Class.UNIVERSAL,type:i.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity3UTCTime"},{name:"Certificate.TBSCertificate.validity.notAfter (generalized)",tagClass:i.Class.UNIVERSAL,type:i.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity4GeneralizedTime"}]},{name:"Certificate.TBSCertificate.subject",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"certSubject"},u,{name:"Certificate.TBSCertificate.issuerUniqueID",tagClass:i.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.issuerUniqueID.id",tagClass:i.Class.UNIVERSAL,type:i.Type.BITSTRING,constructed:!1,captureBitStringValue:"certIssuerUniqueId"}]},{name:"Certificate.TBSCertificate.subjectUniqueID",tagClass:i.Class.CONTEXT_SPECIFIC,type:2,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.subjectUniqueID.id",tagClass:i.Class.UNIVERSAL,type:i.Type.BITSTRING,constructed:!1,captureBitStringValue:"certSubjectUniqueId"}]},{name:"Certificate.TBSCertificate.extensions",tagClass:i.Class.CONTEXT_SPECIFIC,type:3,constructed:!0,captureAsn1:"certExtensions",optional:!0}]},{name:"Certificate.signatureAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.signatureAlgorithm.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"certSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:i.Class.UNIVERSAL,optional:!0,captureAsn1:"certSignatureParams"}]},{name:"Certificate.signatureValue",tagClass:i.Class.UNIVERSAL,type:i.Type.BITSTRING,constructed:!1,captureBitStringValue:"certSignature"}]},l={name:"rsapss",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"rsapss.hashAlgorithm",tagClass:i.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,value:[{name:"rsapss.hashAlgorithm.AlgorithmIdentifier",tagClass:i.Class.UNIVERSAL,type:i.Class.SEQUENCE,constructed:!0,optional:!0,value:[{name:"rsapss.hashAlgorithm.AlgorithmIdentifier.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"hashOid"}]}]},{name:"rsapss.maskGenAlgorithm",tagClass:i.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier",tagClass:i.Class.UNIVERSAL,type:i.Class.SEQUENCE,constructed:!0,optional:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"maskGenOid"},{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.params",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.params.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"maskGenHashOid"}]}]}]},{name:"rsapss.saltLength",tagClass:i.Class.CONTEXT_SPECIFIC,type:2,optional:!0,value:[{name:"rsapss.saltLength.saltLength",tagClass:i.Class.UNIVERSAL,type:i.Class.INTEGER,constructed:!1,capture:"saltLength"}]},{name:"rsapss.trailerField",tagClass:i.Class.CONTEXT_SPECIFIC,type:3,optional:!0,value:[{name:"rsapss.trailer.trailer",tagClass:i.Class.UNIVERSAL,type:i.Class.INTEGER,constructed:!1,capture:"trailer"}]}]},f={name:"CertificationRequestInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"certificationRequestInfo",value:[{name:"CertificationRequestInfo.integer",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"certificationRequestInfoVersion"},{name:"CertificationRequestInfo.subject",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"certificationRequestInfoSubject"},u,{name:"CertificationRequestInfo.attributes",tagClass:i.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"certificationRequestInfoAttributes",value:[{name:"CertificationRequestInfo.attributes",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"CertificationRequestInfo.attributes.type",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1},{name:"CertificationRequestInfo.attributes.value",tagClass:i.Class.UNIVERSAL,type:i.Type.SET,constructed:!0}]}]}]},h={name:"CertificationRequest",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"csr",value:[f,{name:"CertificationRequest.signatureAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"CertificationRequest.signatureAlgorithm.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"csrSignatureOid"},{name:"CertificationRequest.signatureAlgorithm.parameters",tagClass:i.Class.UNIVERSAL,optional:!0,captureAsn1:"csrSignatureParams"}]},{name:"CertificationRequest.signature",tagClass:i.Class.UNIVERSAL,type:i.Type.BITSTRING,constructed:!1,captureBitStringValue:"csrSignature"}]};function p(e,t){"string"==typeof t&&(t={shortName:t});for(var r,n=null,i=0;null===n&&i<e.attributes.length;++i)r=e.attributes[i],(t.type&&t.type===r.type||t.name&&t.name===r.name||t.shortName&&t.shortName===r.shortName)&&(n=r);return n}a.RDNAttributesAsArray=function(e,t){for(var r,n,a,u=[],c=0;c<e.value.length;++c){r=e.value[c];for(var l=0;l<r.value.length;++l)a={},n=r.value[l],a.type=i.derToOid(n.value[0].value),a.value=n.value[1].value,a.valueTagClass=n.value[1].type,a.type in o&&(a.name=o[a.type],a.name in s&&(a.shortName=s[a.name])),t&&(t.update(a.type),t.update(a.value)),u.push(a)}return u},a.CRIAttributesAsArray=function(e){for(var t=[],r=0;r<e.length;++r)for(var n=e[r],u=i.derToOid(n.value[0].value),c=n.value[1].value,l=0;l<c.length;++l){var f={};if(f.type=u,f.value=c[l].value,f.valueTagClass=c[l].type,f.type in o&&(f.name=o[f.type],f.name in s&&(f.shortName=s[f.name])),f.type===o.extensionRequest){f.extensions=[];for(var h=0;h<f.value.length;++h)f.extensions.push(a.certificateExtensionFromAsn1(f.value[h]))}t.push(f)}return t};var d=function(e,t,r){var n={};if(e!==o["RSASSA-PSS"])return n;r&&(n={hash:{algorithmOid:o.sha1},mgf:{algorithmOid:o.mgf1,hash:{algorithmOid:o.sha1}},saltLength:20});var a={},s=[];if(!i.validate(t,l,a,s)){var u=new Error("Cannot read RSASSA-PSS parameter block.");throw u.errors=s,u}return void 0!==a.hashOid&&(n.hash=n.hash||{},n.hash.algorithmOid=i.derToOid(a.hashOid)),void 0!==a.maskGenOid&&(n.mgf=n.mgf||{},n.mgf.algorithmOid=i.derToOid(a.maskGenOid),n.mgf.hash=n.mgf.hash||{},n.mgf.hash.algorithmOid=i.derToOid(a.maskGenHashOid)),void 0!==a.saltLength&&(n.saltLength=a.saltLength.charCodeAt(0)),n};function y(e){for(var t,r,a=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]),o=e.attributes,s=0;s<o.length;++s){var u=(t=o[s]).value,c=i.Type.PRINTABLESTRING;"valueTagClass"in t&&(c=t.valueTagClass)===i.Type.UTF8&&(u=n.util.encodeUtf8(u)),r=i.create(i.Class.UNIVERSAL,i.Type.SET,!0,[i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(t.type).getBytes()),i.create(i.Class.UNIVERSAL,c,!1,u)])]),a.value.push(r)}return a}function v(e){for(var t,r=0;r<e.length;++r){if(void 0===(t=e[r]).name&&(t.type&&t.type in a.oids?t.name=a.oids[t.type]:t.shortName&&t.shortName in s&&(t.name=a.oids[s[t.shortName]])),void 0===t.type){if(!t.name||!(t.name in a.oids))throw(u=new Error("Attribute type not specified.")).attribute=t,u;t.type=a.oids[t.name]}if(void 0===t.shortName&&t.name&&t.name in s&&(t.shortName=s[t.name]),t.type===o.extensionRequest&&(t.valueConstructed=!0,t.valueTagClass=i.Type.SEQUENCE,!t.value&&t.extensions)){t.value=[];for(var n=0;n<t.extensions.length;++n)t.value.push(a.certificateExtensionToAsn1(g(t.extensions[n])))}var u;if(void 0===t.value)throw(u=new Error("Attribute value not specified.")).attribute=t,u}}function g(e,t){if(t=t||{},void 0===e.name&&e.id&&e.id in a.oids&&(e.name=a.oids[e.id]),void 0===e.id){if(!e.name||!(e.name in a.oids))throw(S=new Error("Extension ID not specified.")).extension=e,S;e.id=a.oids[e.name]}if(void 0!==e.value)return e;if("keyUsage"===e.name){var r=0,s=0,u=0;e.digitalSignature&&(s|=128,r=7),e.nonRepudiation&&(s|=64,r=6),e.keyEncipherment&&(s|=32,r=5),e.dataEncipherment&&(s|=16,r=4),e.keyAgreement&&(s|=8,r=3),e.keyCertSign&&(s|=4,r=2),e.cRLSign&&(s|=2,r=1),e.encipherOnly&&(s|=1,r=0),e.decipherOnly&&(u|=128,r=7);var c=String.fromCharCode(r);0!==u?c+=String.fromCharCode(s)+String.fromCharCode(u):0!==s&&(c+=String.fromCharCode(s)),e.value=i.create(i.Class.UNIVERSAL,i.Type.BITSTRING,!1,c)}else if("basicConstraints"===e.name)e.value=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]),e.cA&&e.value.value.push(i.create(i.Class.UNIVERSAL,i.Type.BOOLEAN,!1,String.fromCharCode(255))),"pathLenConstraint"in e&&e.value.value.push(i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(e.pathLenConstraint).getBytes()));else if("extKeyUsage"===e.name){e.value=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]);var l=e.value.value;for(var f in e)!0===e[f]&&(f in o?l.push(i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(o[f]).getBytes())):-1!==f.indexOf(".")&&l.push(i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(f).getBytes())))}else if("nsCertType"===e.name){r=0,s=0;e.client&&(s|=128,r=7),e.server&&(s|=64,r=6),e.email&&(s|=32,r=5),e.objsign&&(s|=16,r=4),e.reserved&&(s|=8,r=3),e.sslCA&&(s|=4,r=2),e.emailCA&&(s|=2,r=1),e.objCA&&(s|=1,r=0);c=String.fromCharCode(r);0!==s&&(c+=String.fromCharCode(s)),e.value=i.create(i.Class.UNIVERSAL,i.Type.BITSTRING,!1,c)}else if("subjectAltName"===e.name||"issuerAltName"===e.name){e.value=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]);for(var h=0;h<e.altNames.length;++h){c=(m=e.altNames[h]).value;if(7===m.type&&m.ip){if(null===(c=n.util.bytesFromIP(m.ip)))throw(S=new Error('Extension "ip" value is not a valid IPv4 or IPv6 address.')).extension=e,S}else 8===m.type&&(c=m.oid?i.oidToDer(i.oidToDer(m.oid)):i.oidToDer(c));e.value.value.push(i.create(i.Class.CONTEXT_SPECIFIC,m.type,!1,c))}}else if("nsComment"===e.name&&t.cert){if(!/^[\x00-\x7F]*$/.test(e.comment)||e.comment.length<1||e.comment.length>128)throw new Error('Invalid "nsComment" content.');e.value=i.create(i.Class.UNIVERSAL,i.Type.IA5STRING,!1,e.comment)}else if("subjectKeyIdentifier"===e.name&&t.cert){var p=t.cert.generateSubjectKeyIdentifier();e.subjectKeyIdentifier=p.toHex(),e.value=i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,p.getBytes())}else if("authorityKeyIdentifier"===e.name&&t.cert){e.value=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]);l=e.value.value;if(e.keyIdentifier){var d=!0===e.keyIdentifier?t.cert.generateSubjectKeyIdentifier().getBytes():e.keyIdentifier;l.push(i.create(i.Class.CONTEXT_SPECIFIC,0,!1,d))}if(e.authorityCertIssuer){var v=[i.create(i.Class.CONTEXT_SPECIFIC,4,!0,[y(!0===e.authorityCertIssuer?t.cert.issuer:e.authorityCertIssuer)])];l.push(i.create(i.Class.CONTEXT_SPECIFIC,1,!0,v))}if(e.serialNumber){var g=n.util.hexToBytes(!0===e.serialNumber?t.cert.serialNumber:e.serialNumber);l.push(i.create(i.Class.CONTEXT_SPECIFIC,2,!1,g))}}else if("cRLDistributionPoints"===e.name){e.value=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]);l=e.value.value;var m,b=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]),E=i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[]);for(h=0;h<e.altNames.length;++h){c=(m=e.altNames[h]).value;if(7===m.type&&m.ip){if(null===(c=n.util.bytesFromIP(m.ip)))throw(S=new Error('Extension "ip" value is not a valid IPv4 or IPv6 address.')).extension=e,S}else 8===m.type&&(c=m.oid?i.oidToDer(i.oidToDer(m.oid)):i.oidToDer(c));E.value.push(i.create(i.Class.CONTEXT_SPECIFIC,m.type,!1,c))}b.value.push(i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[E])),l.push(b)}var S;if(void 0===e.value)throw(S=new Error("Extension value not specified.")).extension=e,S;return e}function m(e,t){switch(e){case o["RSASSA-PSS"]:var r=[];return void 0!==t.hash.algorithmOid&&r.push(i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(t.hash.algorithmOid).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.NULL,!1,"")])])),void 0!==t.mgf.algorithmOid&&r.push(i.create(i.Class.CONTEXT_SPECIFIC,1,!0,[i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(t.mgf.algorithmOid).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(t.mgf.hash.algorithmOid).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.NULL,!1,"")])])])),void 0!==t.saltLength&&r.push(i.create(i.Class.CONTEXT_SPECIFIC,2,!0,[i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(t.saltLength).getBytes())])),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,r);default:return i.create(i.Class.UNIVERSAL,i.Type.NULL,!1,"")}}function b(e){var t=i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[]);if(0===e.attributes.length)return t;for(var r=e.attributes,a=0;a<r.length;++a){var o=r[a],s=o.value,u=i.Type.UTF8;"valueTagClass"in o&&(u=o.valueTagClass),u===i.Type.UTF8&&(s=n.util.encodeUtf8(s));var c=!1;"valueConstructed"in o&&(c=o.valueConstructed);var l=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(o.type).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SET,!0,[i.create(i.Class.UNIVERSAL,u,c,s)])]);t.value.push(l)}return t}a.certificateFromPem=function(e,t,r){var o=n.pem.decode(e)[0];if("CERTIFICATE"!==o.type&&"X509 CERTIFICATE"!==o.type&&"TRUSTED CERTIFICATE"!==o.type){var s=new Error('Could not convert certificate from PEM; PEM header type is not "CERTIFICATE", "X509 CERTIFICATE", or "TRUSTED CERTIFICATE".');throw s.headerType=o.type,s}if(o.procType&&"ENCRYPTED"===o.procType.type)throw new Error("Could not convert certificate from PEM; PEM is encrypted.");var u=i.fromDer(o.body,r);return a.certificateFromAsn1(u,t)},a.certificateToPem=function(e,t){var r={type:"CERTIFICATE",body:i.toDer(a.certificateToAsn1(e)).getBytes()};return n.pem.encode(r,{maxline:t})},a.publicKeyFromPem=function(e){var t=n.pem.decode(e)[0];if("PUBLIC KEY"!==t.type&&"RSA PUBLIC KEY"!==t.type){var r=new Error('Could not convert public key from PEM; PEM header type is not "PUBLIC KEY" or "RSA PUBLIC KEY".');throw r.headerType=t.type,r}if(t.procType&&"ENCRYPTED"===t.procType.type)throw new Error("Could not convert public key from PEM; PEM is encrypted.");var o=i.fromDer(t.body);return a.publicKeyFromAsn1(o)},a.publicKeyToPem=function(e,t){var r={type:"PUBLIC KEY",body:i.toDer(a.publicKeyToAsn1(e)).getBytes()};return n.pem.encode(r,{maxline:t})},a.publicKeyToRSAPublicKeyPem=function(e,t){var r={type:"RSA PUBLIC KEY",body:i.toDer(a.publicKeyToRSAPublicKey(e)).getBytes()};return n.pem.encode(r,{maxline:t})},a.getPublicKeyFingerprint=function(e,t){var r,o=(t=t||{}).md||n.md.sha1.create();switch(t.type||"RSAPublicKey"){case"RSAPublicKey":r=i.toDer(a.publicKeyToRSAPublicKey(e)).getBytes();break;case"SubjectPublicKeyInfo":r=i.toDer(a.publicKeyToAsn1(e)).getBytes();break;default:throw new Error('Unknown fingerprint type "'+t.type+'".')}o.start(),o.update(r);var s=o.digest();if("hex"===t.encoding){var u=s.toHex();return t.delimiter?u.match(/.{2}/g).join(t.delimiter):u}if("binary"===t.encoding)return s.getBytes();if(t.encoding)throw new Error('Unknown encoding "'+t.encoding+'".');return s},a.certificationRequestFromPem=function(e,t,r){var o=n.pem.decode(e)[0];if("CERTIFICATE REQUEST"!==o.type){var s=new Error('Could not convert certification request from PEM; PEM header type is not "CERTIFICATE REQUEST".');throw s.headerType=o.type,s}if(o.procType&&"ENCRYPTED"===o.procType.type)throw new Error("Could not convert certification request from PEM; PEM is encrypted.");var u=i.fromDer(o.body,r);return a.certificationRequestFromAsn1(u,t)},a.certificationRequestToPem=function(e,t){var r={type:"CERTIFICATE REQUEST",body:i.toDer(a.certificationRequestToAsn1(e)).getBytes()};return n.pem.encode(r,{maxline:t})},a.createCertificate=function(){var e={version:2,serialNumber:"00",signatureOid:null,signature:null,siginfo:{}};return e.siginfo.algorithmOid=null,e.validity={},e.validity.notBefore=new Date,e.validity.notAfter=new Date,e.issuer={},e.issuer.getField=function(t){return p(e.issuer,t)},e.issuer.addField=function(t){v([t]),e.issuer.attributes.push(t)},e.issuer.attributes=[],e.issuer.hash=null,e.subject={},e.subject.getField=function(t){return p(e.subject,t)},e.subject.addField=function(t){v([t]),e.subject.attributes.push(t)},e.subject.attributes=[],e.subject.hash=null,e.extensions=[],e.publicKey=null,e.md=null,e.setSubject=function(t,r){v(t),e.subject.attributes=t,delete e.subject.uniqueId,r&&(e.subject.uniqueId=r),e.subject.hash=null},e.setIssuer=function(t,r){v(t),e.issuer.attributes=t,delete e.issuer.uniqueId,r&&(e.issuer.uniqueId=r),e.issuer.hash=null},e.setExtensions=function(t){for(var r=0;r<t.length;++r)g(t[r],{cert:e});e.extensions=t},e.getExtension=function(t){"string"==typeof t&&(t={name:t});for(var r,n=null,i=0;null===n&&i<e.extensions.length;++i)r=e.extensions[i],(t.id&&r.id===t.id||t.name&&r.name===t.name)&&(n=r);return n},e.sign=function(t,r){e.md=r||n.md.sha1.create();var s=o[e.md.algorithm+"WithRSAEncryption"];if(!s){var u=new Error("Could not compute certificate digest. Unknown message digest algorithm OID.");throw u.algorithm=e.md.algorithm,u}e.signatureOid=e.siginfo.algorithmOid=s,e.tbsCertificate=a.getTBSCertificate(e);var c=i.toDer(e.tbsCertificate);e.md.update(c.getBytes()),e.signature=t.sign(e.md)},e.verify=function(t){var r=!1;if(!e.issued(t)){var s=t.issuer,u=e.subject;throw(y=new Error("The parent certificate did not issue the given child certificate; the child certificate's issuer does not match the parent's subject.")).expectedIssuer=s.attributes,y.actualIssuer=u.attributes,y}var c=t.md;if(null===c){if(t.signatureOid in o)switch(o[t.signatureOid]){case"sha1WithRSAEncryption":c=n.md.sha1.create();break;case"md5WithRSAEncryption":c=n.md.md5.create();break;case"sha256WithRSAEncryption":c=n.md.sha256.create();break;case"sha384WithRSAEncryption":c=n.md.sha384.create();break;case"sha512WithRSAEncryption":c=n.md.sha512.create();break;case"RSASSA-PSS":c=n.md.sha256.create()}if(null===c)throw(y=new Error("Could not compute certificate digest. Unknown signature OID.")).signatureOid=t.signatureOid,y;var l=t.tbsCertificate||a.getTBSCertificate(t),f=i.toDer(l);c.update(f.getBytes())}if(null!==c){var h;switch(t.signatureOid){case o.sha1WithRSAEncryption:h=void 0;break;case o["RSASSA-PSS"]:var p,d,y;if(void 0===(p=o[t.signatureParameters.mgf.hash.algorithmOid])||void 0===n.md[p])throw(y=new Error("Unsupported MGF hash function.")).oid=t.signatureParameters.mgf.hash.algorithmOid,y.name=p,y;if(void 0===(d=o[t.signatureParameters.mgf.algorithmOid])||void 0===n.mgf[d])throw(y=new Error("Unsupported MGF function.")).oid=t.signatureParameters.mgf.algorithmOid,y.name=d,y;if(d=n.mgf[d].create(n.md[p].create()),void 0===(p=o[t.signatureParameters.hash.algorithmOid])||void 0===n.md[p])throw{message:"Unsupported RSASSA-PSS hash function.",oid:t.signatureParameters.hash.algorithmOid,name:p};h=n.pss.create(n.md[p].create(),d,t.signatureParameters.saltLength)}r=e.publicKey.verify(c.digest().getBytes(),t.signature,h)}return r},e.isIssuer=function(t){var r=!1,n=e.issuer,i=t.subject;if(n.hash&&i.hash)r=n.hash===i.hash;else if(n.attributes.length===i.attributes.length){var a,o;r=!0;for(var s=0;r&&s<n.attributes.length;++s)a=n.attributes[s],o=i.attributes[s],a.type===o.type&&a.value===o.value||(r=!1)}return r},e.issued=function(t){return t.isIssuer(e)},e.generateSubjectKeyIdentifier=function(){return a.getPublicKeyFingerprint(e.publicKey,{type:"RSAPublicKey"})},e.verifySubjectKeyIdentifier=function(){for(var t=o.subjectKeyIdentifier,r=0;r<e.extensions.length;++r){var i=e.extensions[r];if(i.id===t){var a=e.generateSubjectKeyIdentifier().getBytes();return n.util.hexToBytes(i.subjectKeyIdentifier)===a}}return!1},e},a.certificateFromAsn1=function(e,t){var r={},s=[];if(!i.validate(e,c,r,s))throw(h=new Error("Cannot read X.509 certificate. ASN.1 object is not an X509v3 Certificate.")).errors=s,h;if(i.derToOid(r.publicKeyOid)!==a.oids.rsaEncryption)throw new Error("Cannot read public key. OID is not RSA.");var u=a.createCertificate();u.version=r.certVersion?r.certVersion.charCodeAt(0):0;var l=n.util.createBuffer(r.certSerialNumber);u.serialNumber=l.toHex(),u.signatureOid=n.asn1.derToOid(r.certSignatureOid),u.signatureParameters=d(u.signatureOid,r.certSignatureParams,!0),u.siginfo.algorithmOid=n.asn1.derToOid(r.certinfoSignatureOid),u.siginfo.parameters=d(u.siginfo.algorithmOid,r.certinfoSignatureParams,!1),u.signature=r.certSignature;var f=[];if(void 0!==r.certValidity1UTCTime&&f.push(i.utcTimeToDate(r.certValidity1UTCTime)),void 0!==r.certValidity2GeneralizedTime&&f.push(i.generalizedTimeToDate(r.certValidity2GeneralizedTime)),void 0!==r.certValidity3UTCTime&&f.push(i.utcTimeToDate(r.certValidity3UTCTime)),void 0!==r.certValidity4GeneralizedTime&&f.push(i.generalizedTimeToDate(r.certValidity4GeneralizedTime)),f.length>2)throw new Error("Cannot read notBefore/notAfter validity times; more than two times were provided in the certificate.");if(f.length<2)throw new Error("Cannot read notBefore/notAfter validity times; they were not provided as either UTCTime or GeneralizedTime.");if(u.validity.notBefore=f[0],u.validity.notAfter=f[1],u.tbsCertificate=r.tbsCertificate,t){var h;if(u.md=null,u.signatureOid in o)switch(o[u.signatureOid]){case"sha1WithRSAEncryption":u.md=n.md.sha1.create();break;case"md5WithRSAEncryption":u.md=n.md.md5.create();break;case"sha256WithRSAEncryption":u.md=n.md.sha256.create();break;case"sha384WithRSAEncryption":u.md=n.md.sha384.create();break;case"sha512WithRSAEncryption":u.md=n.md.sha512.create();break;case"RSASSA-PSS":u.md=n.md.sha256.create()}if(null===u.md)throw(h=new Error("Could not compute certificate digest. Unknown signature OID.")).signatureOid=u.signatureOid,h;var y=i.toDer(u.tbsCertificate);u.md.update(y.getBytes())}var g=n.md.sha1.create();u.issuer.getField=function(e){return p(u.issuer,e)},u.issuer.addField=function(e){v([e]),u.issuer.attributes.push(e)},u.issuer.attributes=a.RDNAttributesAsArray(r.certIssuer,g),r.certIssuerUniqueId&&(u.issuer.uniqueId=r.certIssuerUniqueId),u.issuer.hash=g.digest().toHex();var m=n.md.sha1.create();return u.subject.getField=function(e){return p(u.subject,e)},u.subject.addField=function(e){v([e]),u.subject.attributes.push(e)},u.subject.attributes=a.RDNAttributesAsArray(r.certSubject,m),r.certSubjectUniqueId&&(u.subject.uniqueId=r.certSubjectUniqueId),u.subject.hash=m.digest().toHex(),r.certExtensions?u.extensions=a.certificateExtensionsFromAsn1(r.certExtensions):u.extensions=[],u.publicKey=a.publicKeyFromAsn1(r.subjectPublicKeyInfo),u},a.certificateExtensionsFromAsn1=function(e){for(var t=[],r=0;r<e.value.length;++r)for(var n=e.value[r],i=0;i<n.value.length;++i)t.push(a.certificateExtensionFromAsn1(n.value[i]));return t},a.certificateExtensionFromAsn1=function(e){var t={};if(t.id=i.derToOid(e.value[0].value),t.critical=!1,e.value[1].type===i.Type.BOOLEAN?(t.critical=0!==e.value[1].value.charCodeAt(0),t.value=e.value[2].value):t.value=e.value[1].value,t.id in o)if(t.name=o[t.id],"keyUsage"===t.name){var r=0,a=0;(u=i.fromDer(t.value)).value.length>1&&(r=u.value.charCodeAt(1),a=u.value.length>2?u.value.charCodeAt(2):0),t.digitalSignature=128==(128&r),t.nonRepudiation=64==(64&r),t.keyEncipherment=32==(32&r),t.dataEncipherment=16==(16&r),t.keyAgreement=8==(8&r),t.keyCertSign=4==(4&r),t.cRLSign=2==(2&r),t.encipherOnly=1==(1&r),t.decipherOnly=128==(128&a)}else if("basicConstraints"===t.name){(u=i.fromDer(t.value)).value.length>0&&u.value[0].type===i.Type.BOOLEAN?t.cA=0!==u.value[0].value.charCodeAt(0):t.cA=!1;var s=null;u.value.length>0&&u.value[0].type===i.Type.INTEGER?s=u.value[0].value:u.value.length>1&&(s=u.value[1].value),null!==s&&(t.pathLenConstraint=i.derToInteger(s))}else if("extKeyUsage"===t.name)for(var u=i.fromDer(t.value),c=0;c<u.value.length;++c){var l=i.derToOid(u.value[c].value);l in o?t[o[l]]=!0:t[l]=!0}else if("nsCertType"===t.name){r=0;(u=i.fromDer(t.value)).value.length>1&&(r=u.value.charCodeAt(1)),t.client=128==(128&r),t.server=64==(64&r),t.email=32==(32&r),t.objsign=16==(16&r),t.reserved=8==(8&r),t.sslCA=4==(4&r),t.emailCA=2==(2&r),t.objCA=1==(1&r)}else if("subjectAltName"===t.name||"issuerAltName"===t.name){var f;t.altNames=[];u=i.fromDer(t.value);for(var h=0;h<u.value.length;++h){var p={type:(f=u.value[h]).type,value:f.value};switch(t.altNames.push(p),f.type){case 1:case 2:case 6:break;case 7:p.ip=n.util.bytesToIP(f.value);break;case 8:p.oid=i.derToOid(f.value)}}}else if("subjectKeyIdentifier"===t.name){u=i.fromDer(t.value);t.subjectKeyIdentifier=n.util.bytesToHex(u.value)}return t},a.certificationRequestFromAsn1=function(e,t){var r={},s=[];if(!i.validate(e,h,r,s))throw(c=new Error("Cannot read PKCS#10 certificate request. ASN.1 object is not a PKCS#10 CertificationRequest.")).errors=s,c;if(i.derToOid(r.publicKeyOid)!==a.oids.rsaEncryption)throw new Error("Cannot read public key. OID is not RSA.");var u=a.createCertificationRequest();if(u.version=r.csrVersion?r.csrVersion.charCodeAt(0):0,u.signatureOid=n.asn1.derToOid(r.csrSignatureOid),u.signatureParameters=d(u.signatureOid,r.csrSignatureParams,!0),u.siginfo.algorithmOid=n.asn1.derToOid(r.csrSignatureOid),u.siginfo.parameters=d(u.siginfo.algorithmOid,r.csrSignatureParams,!1),u.signature=r.csrSignature,u.certificationRequestInfo=r.certificationRequestInfo,t){var c;if(u.md=null,u.signatureOid in o)switch(o[u.signatureOid]){case"sha1WithRSAEncryption":u.md=n.md.sha1.create();break;case"md5WithRSAEncryption":u.md=n.md.md5.create();break;case"sha256WithRSAEncryption":u.md=n.md.sha256.create();break;case"sha384WithRSAEncryption":u.md=n.md.sha384.create();break;case"sha512WithRSAEncryption":u.md=n.md.sha512.create();break;case"RSASSA-PSS":u.md=n.md.sha256.create()}if(null===u.md)throw(c=new Error("Could not compute certification request digest. Unknown signature OID.")).signatureOid=u.signatureOid,c;var l=i.toDer(u.certificationRequestInfo);u.md.update(l.getBytes())}var f=n.md.sha1.create();return u.subject.getField=function(e){return p(u.subject,e)},u.subject.addField=function(e){v([e]),u.subject.attributes.push(e)},u.subject.attributes=a.RDNAttributesAsArray(r.certificationRequestInfoSubject,f),u.subject.hash=f.digest().toHex(),u.publicKey=a.publicKeyFromAsn1(r.subjectPublicKeyInfo),u.getAttribute=function(e){return p(u,e)},u.addAttribute=function(e){v([e]),u.attributes.push(e)},u.attributes=a.CRIAttributesAsArray(r.certificationRequestInfoAttributes||[]),u},a.createCertificationRequest=function(){var e={version:0,signatureOid:null,signature:null,siginfo:{}};return e.siginfo.algorithmOid=null,e.subject={},e.subject.getField=function(t){return p(e.subject,t)},e.subject.addField=function(t){v([t]),e.subject.attributes.push(t)},e.subject.attributes=[],e.subject.hash=null,e.publicKey=null,e.attributes=[],e.getAttribute=function(t){return p(e,t)},e.addAttribute=function(t){v([t]),e.attributes.push(t)},e.md=null,e.setSubject=function(t){v(t),e.subject.attributes=t,e.subject.hash=null},e.setAttributes=function(t){v(t),e.attributes=t},e.sign=function(t,r){e.md=r||n.md.sha1.create();var s=o[e.md.algorithm+"WithRSAEncryption"];if(!s){var u=new Error("Could not compute certification request digest. Unknown message digest algorithm OID.");throw u.algorithm=e.md.algorithm,u}e.signatureOid=e.siginfo.algorithmOid=s,e.certificationRequestInfo=a.getCertificationRequestInfo(e);var c=i.toDer(e.certificationRequestInfo);e.md.update(c.getBytes()),e.signature=t.sign(e.md)},e.verify=function(){var t=!1,r=e.md;if(null===r){if(e.signatureOid in o)switch(o[e.signatureOid]){case"sha1WithRSAEncryption":r=n.md.sha1.create();break;case"md5WithRSAEncryption":r=n.md.md5.create();break;case"sha256WithRSAEncryption":r=n.md.sha256.create();break;case"sha384WithRSAEncryption":r=n.md.sha384.create();break;case"sha512WithRSAEncryption":r=n.md.sha512.create();break;case"RSASSA-PSS":r=n.md.sha256.create()}if(null===r)throw(h=new Error("Could not compute certification request digest. Unknown signature OID.")).signatureOid=e.signatureOid,h;var s=e.certificationRequestInfo||a.getCertificationRequestInfo(e),u=i.toDer(s);r.update(u.getBytes())}if(null!==r){var c;switch(e.signatureOid){case o.sha1WithRSAEncryption:break;case o["RSASSA-PSS"]:var l,f,h;if(void 0===(l=o[e.signatureParameters.mgf.hash.algorithmOid])||void 0===n.md[l])throw(h=new Error("Unsupported MGF hash function.")).oid=e.signatureParameters.mgf.hash.algorithmOid,h.name=l,h;if(void 0===(f=o[e.signatureParameters.mgf.algorithmOid])||void 0===n.mgf[f])throw(h=new Error("Unsupported MGF function.")).oid=e.signatureParameters.mgf.algorithmOid,h.name=f,h;if(f=n.mgf[f].create(n.md[l].create()),void 0===(l=o[e.signatureParameters.hash.algorithmOid])||void 0===n.md[l])throw(h=new Error("Unsupported RSASSA-PSS hash function.")).oid=e.signatureParameters.hash.algorithmOid,h.name=l,h;c=n.pss.create(n.md[l].create(),f,e.signatureParameters.saltLength)}t=e.publicKey.verify(r.digest().getBytes(),e.signature,c)}return t},e};var E=new Date("1950-01-01T00:00:00Z"),S=new Date("2050-01-01T00:00:00Z");function C(e){return e>=E&&e<S?i.create(i.Class.UNIVERSAL,i.Type.UTCTIME,!1,i.dateToUtcTime(e)):i.create(i.Class.UNIVERSAL,i.Type.GENERALIZEDTIME,!1,i.dateToGeneralizedTime(e))}a.getTBSCertificate=function(e){var t=C(e.validity.notBefore),r=C(e.validity.notAfter),o=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(e.version).getBytes())]),i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,n.util.hexToBytes(e.serialNumber)),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.siginfo.algorithmOid).getBytes()),m(e.siginfo.algorithmOid,e.siginfo.parameters)]),y(e.issuer),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[t,r]),y(e.subject),a.publicKeyToAsn1(e.publicKey)]);return e.issuer.uniqueId&&o.value.push(i.create(i.Class.CONTEXT_SPECIFIC,1,!0,[i.create(i.Class.UNIVERSAL,i.Type.BITSTRING,!1,String.fromCharCode(0)+e.issuer.uniqueId)])),e.subject.uniqueId&&o.value.push(i.create(i.Class.CONTEXT_SPECIFIC,2,!0,[i.create(i.Class.UNIVERSAL,i.Type.BITSTRING,!1,String.fromCharCode(0)+e.subject.uniqueId)])),e.extensions.length>0&&o.value.push(a.certificateExtensionsToAsn1(e.extensions)),o},a.getCertificationRequestInfo=function(e){return i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(e.version).getBytes()),y(e.subject),a.publicKeyToAsn1(e.publicKey),b(e)])},a.distinguishedNameToAsn1=function(e){return y(e)},a.certificateToAsn1=function(e){var t=e.tbsCertificate||a.getTBSCertificate(e);return i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[t,i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.signatureOid).getBytes()),m(e.signatureOid,e.signatureParameters)]),i.create(i.Class.UNIVERSAL,i.Type.BITSTRING,!1,String.fromCharCode(0)+e.signature)])},a.certificateExtensionsToAsn1=function(e){var t=i.create(i.Class.CONTEXT_SPECIFIC,3,!0,[]),r=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]);t.value.push(r);for(var n=0;n<e.length;++n)r.value.push(a.certificateExtensionToAsn1(e[n]));return t},a.certificateExtensionToAsn1=function(e){var t=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]);t.value.push(i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.id).getBytes())),e.critical&&t.value.push(i.create(i.Class.UNIVERSAL,i.Type.BOOLEAN,!1,String.fromCharCode(255)));var r=e.value;return"string"!=typeof e.value&&(r=i.toDer(r).getBytes()),t.value.push(i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,r)),t},a.certificationRequestToAsn1=function(e){var t=e.certificationRequestInfo||a.getCertificationRequestInfo(e);return i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[t,i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.signatureOid).getBytes()),m(e.signatureOid,e.signatureParameters)]),i.create(i.Class.UNIVERSAL,i.Type.BITSTRING,!1,String.fromCharCode(0)+e.signature)])},a.createCaStore=function(e){var t={certs:{}};function r(e){return o(e),t.certs[e.hash]||null}function o(e){if(!e.hash){var t=n.md.sha1.create();e.attributes=a.RDNAttributesAsArray(y(e),t),e.hash=t.digest().toHex()}}if(t.getIssuer=function(e){return r(e.issuer)},t.addCertificate=function(e){if("string"==typeof e&&(e=n.pki.certificateFromPem(e)),o(e.subject),!t.hasCertificate(e))if(e.subject.hash in t.certs){var r=t.certs[e.subject.hash];n.util.isArray(r)||(r=[r]),r.push(e),t.certs[e.subject.hash]=r}else t.certs[e.subject.hash]=e},t.hasCertificate=function(e){"string"==typeof e&&(e=n.pki.certificateFromPem(e));var t=r(e.subject);if(!t)return!1;n.util.isArray(t)||(t=[t]);for(var o=i.toDer(a.certificateToAsn1(e)).getBytes(),s=0;s<t.length;++s){if(o===i.toDer(a.certificateToAsn1(t[s])).getBytes())return!0}return!1},t.listAllCertificates=function(){var e=[];for(var r in t.certs)if(t.certs.hasOwnProperty(r)){var i=t.certs[r];if(n.util.isArray(i))for(var a=0;a<i.length;++a)e.push(i[a]);else e.push(i)}return e},t.removeCertificate=function(e){var s;if("string"==typeof e&&(e=n.pki.certificateFromPem(e)),o(e.subject),!t.hasCertificate(e))return null;var u=r(e.subject);if(!n.util.isArray(u))return s=t.certs[e.subject.hash],delete t.certs[e.subject.hash],s;for(var c=i.toDer(a.certificateToAsn1(e)).getBytes(),l=0;l<u.length;++l){c===i.toDer(a.certificateToAsn1(u[l])).getBytes()&&(s=u[l],u.splice(l,1))}return 0===u.length&&delete t.certs[e.subject.hash],s},e)for(var s=0;s<e.length;++s){var u=e[s];t.addCertificate(u)}return t},a.certificateError={bad_certificate:"forge.pki.BadCertificate",unsupported_certificate:"forge.pki.UnsupportedCertificate",certificate_revoked:"forge.pki.CertificateRevoked",certificate_expired:"forge.pki.CertificateExpired",certificate_unknown:"forge.pki.CertificateUnknown",unknown_ca:"forge.pki.UnknownCertificateAuthority"},a.verifyCertificateChain=function(e,t,r){"function"==typeof r&&(r={verify:r}),r=r||{};var i=(t=t.slice(0)).slice(0),o=r.validityCheckDate;void 0===o&&(o=new Date);var s=!0,u=null,c=0;do{var l=t.shift(),f=null,h=!1;if(o&&(o<l.validity.notBefore||o>l.validity.notAfter)&&(u={message:"Certificate is not valid yet or has expired.",error:a.certificateError.certificate_expired,notBefore:l.validity.notBefore,notAfter:l.validity.notAfter,now:o}),null===u){if(null===(f=t[0]||e.getIssuer(l))&&l.isIssuer(l)&&(h=!0,f=l),f){var p=f;n.util.isArray(p)||(p=[p]);for(var d=!1;!d&&p.length>0;){f=p.shift();try{d=f.verify(l)}catch(e){}}d||(u={message:"Certificate signature is invalid.",error:a.certificateError.bad_certificate})}null!==u||f&&!h||e.hasCertificate(l)||(u={message:"Certificate is not trusted.",error:a.certificateError.unknown_ca})}if(null===u&&f&&!l.isIssuer(f)&&(u={message:"Certificate issuer is invalid.",error:a.certificateError.bad_certificate}),null===u)for(var y={keyUsage:!0,basicConstraints:!0},v=0;null===u&&v<l.extensions.length;++v){var g=l.extensions[v];g.critical&&!(g.name in y)&&(u={message:"Certificate has an unsupported critical extension.",error:a.certificateError.unsupported_certificate})}if(null===u&&(!s||0===t.length&&(!f||h))){var m=l.getExtension("basicConstraints"),b=l.getExtension("keyUsage");if(null!==b&&(b.keyCertSign&&null!==m||(u={message:"Certificate keyUsage or basicConstraints conflict or indicate that the certificate is not a CA. If the certificate is the only one in the chain or isn't the first then the certificate must be a valid CA.",error:a.certificateError.bad_certificate})),null!==u||null===m||m.cA||(u={message:"Certificate basicConstraints indicates the certificate is not a CA.",error:a.certificateError.bad_certificate}),null===u&&null!==b&&"pathLenConstraint"in m)c-1>m.pathLenConstraint&&(u={message:"Certificate basicConstraints pathLenConstraint violated.",error:a.certificateError.bad_certificate})}var E=null===u||u.error,S=r.verify?r.verify(E,c,i):E;if(!0!==S)throw!0===E&&(u={message:"The application rejected the certificate.",error:a.certificateError.bad_certificate}),(S||0===S)&&("object"!=typeof S||n.util.isArray(S)?"string"==typeof S&&(u.error=S):(S.message&&(u.message=S.message),S.error&&(u.error=S.error))),u;u=null,s=!1,++c}while(t.length>0);return!0}},1379:function(e,t,r){"use strict";
17
+ t.read=function(e,t,r,n,i){var a,o,s=8*i-n-1,u=(1<<s)-1,c=u>>1,l=-7,f=r?i-1:0,h=r?-1:1,p=e[t+f];for(f+=h,a=p&(1<<-l)-1,p>>=-l,l+=s;l>0;a=256*a+e[t+f],f+=h,l-=8);for(o=a&(1<<-l)-1,a>>=-l,l+=n;l>0;o=256*o+e[t+f],f+=h,l-=8);if(0===a)a=1-c;else{if(a===u)return o?NaN:1/0*(p?-1:1);o+=Math.pow(2,n),a-=c}return(p?-1:1)*o*Math.pow(2,a-n)},t.write=function(e,t,r,n,i,a){var o,s,u,c=8*a-i-1,l=(1<<c)-1,f=l>>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:a-1,d=n?1:-1,y=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=l):(o=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-o))<1&&(o--,u*=2),(t+=o+f>=1?h/u:h*Math.pow(2,1-f))*u>=2&&(o++,u/=2),o+f>=l?(s=0,o=l):o+f>=1?(s=(t*u-1)*Math.pow(2,i),o+=f):(s=t*Math.pow(2,f-1)*Math.pow(2,i),o=0));i>=8;e[r+p]=255&s,p+=d,s/=256,i-=8);for(o=o<<i|s,c+=i;c>0;e[r+p]=255&o,p+=d,o/=256,c-=8);e[r+p-d]|=128*y}},8552:(e,t,r)=>{var n=r(852)(r(5639),"DataView");e.exports=n},1989:(e,t,r)=>{var n=r(1789),i=r(401),a=r(7667),o=r(1327),s=r(1866);function u(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}u.prototype.clear=n,u.prototype.delete=i,u.prototype.get=a,u.prototype.has=o,u.prototype.set=s,e.exports=u},6425:(e,t,r)=>{var n=r(3118),i=r(9435);function a(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}a.prototype=n(i.prototype),a.prototype.constructor=a,e.exports=a},8407:(e,t,r)=>{var n=r(7040),i=r(4125),a=r(2117),o=r(7518),s=r(4705);function u(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}u.prototype.clear=n,u.prototype.delete=i,u.prototype.get=a,u.prototype.has=o,u.prototype.set=s,e.exports=u},7548:(e,t,r)=>{var n=r(3118),i=r(9435);function a(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=void 0}a.prototype=n(i.prototype),a.prototype.constructor=a,e.exports=a},7071:(e,t,r)=>{var n=r(852)(r(5639),"Map");e.exports=n},3369:(e,t,r)=>{var n=r(4785),i=r(1285),a=r(6e3),o=r(9916),s=r(5265);function u(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}u.prototype.clear=n,u.prototype.delete=i,u.prototype.get=a,u.prototype.has=o,u.prototype.set=s,e.exports=u},3818:(e,t,r)=>{var n=r(852)(r(5639),"Promise");e.exports=n},8525:(e,t,r)=>{var n=r(852)(r(5639),"Set");e.exports=n},8668:(e,t,r)=>{var n=r(3369),i=r(619),a=r(2385);function o(e){var t=-1,r=null==e?0:e.length;for(this.__data__=new n;++t<r;)this.add(e[t])}o.prototype.add=o.prototype.push=i,o.prototype.has=a,e.exports=o},6384:(e,t,r)=>{var n=r(8407),i=r(7465),a=r(3779),o=r(7599),s=r(4758),u=r(4309);function c(e){var t=this.__data__=new n(e);this.size=t.size}c.prototype.clear=i,c.prototype.delete=a,c.prototype.get=o,c.prototype.has=s,c.prototype.set=u,e.exports=c},2705:(e,t,r)=>{var n=r(5639).Symbol;e.exports=n},1149:(e,t,r)=>{var n=r(5639).Uint8Array;e.exports=n},577:(e,t,r)=>{var n=r(852)(r(5639),"WeakMap");e.exports=n},6874:e=>{e.exports=function(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}},7412:e=>{e.exports=function(e,t){for(var r=-1,n=null==e?0:e.length;++r<n&&!1!==t(e[r],r,e););return e}},4963:e=>{e.exports=function(e,t){for(var r=-1,n=null==e?0:e.length,i=0,a=[];++r<n;){var o=e[r];t(o,r,e)&&(a[i++]=o)}return a}},7443:(e,t,r)=>{var n=r(2118);e.exports=function(e,t){return!!(null==e?0:e.length)&&n(e,t,0)>-1}},1196:e=>{e.exports=function(e,t,r){for(var n=-1,i=null==e?0:e.length;++n<i;)if(r(t,e[n]))return!0;return!1}},4636:(e,t,r)=>{var n=r(2545),i=r(5694),a=r(1469),o=r(4144),s=r(5776),u=r(6719),c=Object.prototype.hasOwnProperty;e.exports=function(e,t){var r=a(e),l=!r&&i(e),f=!r&&!l&&o(e),h=!r&&!l&&!f&&u(e),p=r||l||f||h,d=p?n(e.length,String):[],y=d.length;for(var v in e)!t&&!c.call(e,v)||p&&("length"==v||f&&("offset"==v||"parent"==v)||h&&("buffer"==v||"byteLength"==v||"byteOffset"==v)||s(v,y))||d.push(v);return d}},9932:e=>{e.exports=function(e,t){for(var r=-1,n=null==e?0:e.length,i=Array(n);++r<n;)i[r]=t(e[r],r,e);return i}},2488:e=>{e.exports=function(e,t){for(var r=-1,n=t.length,i=e.length;++r<n;)e[i+r]=t[r];return e}},6556:(e,t,r)=>{var n=r(9465),i=r(7813);e.exports=function(e,t,r){(void 0!==r&&!i(e[t],r)||void 0===r&&!(t in e))&&n(e,t,r)}},4865:(e,t,r)=>{var n=r(9465),i=r(7813),a=Object.prototype.hasOwnProperty;e.exports=function(e,t,r){var o=e[t];a.call(e,t)&&i(o,r)&&(void 0!==r||t in e)||n(e,t,r)}},8470:(e,t,r)=>{var n=r(7813);e.exports=function(e,t){for(var r=e.length;r--;)if(n(e[r][0],t))return r;return-1}},4037:(e,t,r)=>{var n=r(8363),i=r(3674);e.exports=function(e,t){return e&&n(t,i(t),e)}},3886:(e,t,r)=>{var n=r(8363),i=r(1704);e.exports=function(e,t){return e&&n(t,i(t),e)}},9465:(e,t,r)=>{var n=r(8777);e.exports=function(e,t,r){"__proto__"==t&&n?n(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}},9750:e=>{e.exports=function(e,t,r){return e==e&&(void 0!==r&&(e=e<=r?e:r),void 0!==t&&(e=e>=t?e:t)),e}},5990:(e,t,r)=>{var n=r(6384),i=r(7412),a=r(4865),o=r(4037),s=r(3886),u=r(4626),c=r(278),l=r(8805),f=r(1911),h=r(8234),p=r(6904),d=r(4160),y=r(3824),v=r(9148),g=r(8517),m=r(1469),b=r(4144),E=r(6688),S=r(3218),C=r(2928),w=r(3674),T=r(1704),A="[object Arguments]",I="[object Function]",k="[object Object]",_={};_[A]=_["[object Array]"]=_["[object ArrayBuffer]"]=_["[object DataView]"]=_["[object Boolean]"]=_["[object Date]"]=_["[object Float32Array]"]=_["[object Float64Array]"]=_["[object Int8Array]"]=_["[object Int16Array]"]=_["[object Int32Array]"]=_["[object Map]"]=_["[object Number]"]=_[k]=_["[object RegExp]"]=_["[object Set]"]=_["[object String]"]=_["[object Symbol]"]=_["[object Uint8Array]"]=_["[object Uint8ClampedArray]"]=_["[object Uint16Array]"]=_["[object Uint32Array]"]=!0,_["[object Error]"]=_[I]=_["[object WeakMap]"]=!1,e.exports=function e(t,r,B,N,O,R){var x,P=1&r,F=2&r,D=4&r;if(B&&(x=O?B(t,N,O,R):B(t)),void 0!==x)return x;if(!S(t))return t;var L=m(t);if(L){if(x=y(t),!P)return c(t,x)}else{var U=d(t),j=U==I||"[object GeneratorFunction]"==U;if(b(t))return u(t,P);if(U==k||U==A||j&&!O){if(x=F||j?{}:g(t),!P)return F?f(t,s(x,t)):l(t,o(x,t))}else{if(!_[U])return O?t:{};x=v(t,U,P)}}R||(R=new n);var V=R.get(t);if(V)return V;R.set(t,x),C(t)?t.forEach((function(n){x.add(e(n,r,B,n,t,R))})):E(t)&&t.forEach((function(n,i){x.set(i,e(n,r,B,i,t,R))}));var K=L?void 0:(D?F?p:h:F?T:w)(t);return i(K||t,(function(n,i){K&&(n=t[i=n]),a(x,i,e(n,r,B,i,t,R))})),x}},3118:(e,t,r)=>{var n=r(3218),i=Object.create,a=function(){function e(){}return function(t){if(!n(t))return{};if(i)return i(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}();e.exports=a},5082:(e,t,r)=>{var n=r(554),i=r(8958);e.exports=function(e,t,r,a){var o=e.length;for((r=n(r))<0&&(r=-r>o?0:o+r),(a=void 0===a||a>o?o:n(a))<0&&(a+=o),a=r>a?0:i(a);r<a;)e[r++]=t;return e}},1848:e=>{e.exports=function(e,t,r,n){for(var i=e.length,a=r+(n?1:-1);n?a--:++a<i;)if(t(e[a],a,e))return a;return-1}},1078:(e,t,r)=>{var n=r(2488),i=r(7285);e.exports=function e(t,r,a,o,s){var u=-1,c=t.length;for(a||(a=i),s||(s=[]);++u<c;){var l=t[u];r>0&&a(l)?r>1?e(l,r-1,a,o,s):n(s,l):o||(s[s.length]=l)}return s}},8483:(e,t,r)=>{var n=r(5063)();e.exports=n},7786:(e,t,r)=>{var n=r(1811),i=r(327);e.exports=function(e,t){for(var r=0,a=(t=n(t,e)).length;null!=e&&r<a;)e=e[i(t[r++])];return r&&r==a?e:void 0}},8866:(e,t,r)=>{var n=r(2488),i=r(1469);e.exports=function(e,t,r){var a=t(e);return i(e)?a:n(a,r(e))}},4239:(e,t,r)=>{var n=r(2705),i=r(9607),a=r(2333),o=n?n.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":o&&o in Object(e)?i(e):a(e)}},13:e=>{e.exports=function(e,t){return null!=e&&t in Object(e)}},2118:(e,t,r)=>{var n=r(1848),i=r(2722),a=r(2351);e.exports=function(e,t,r){return t==t?a(e,t,r):n(e,i,r)}},7556:(e,t,r)=>{var n=r(8668),i=r(7443),a=r(1196),o=r(9932),s=r(1717),u=r(4757),c=Math.min;e.exports=function(e,t,r){for(var l=r?a:i,f=e[0].length,h=e.length,p=h,d=Array(h),y=1/0,v=[];p--;){var g=e[p];p&&t&&(g=o(g,s(t))),y=c(g.length,y),d[p]=!r&&(t||f>=120&&g.length>=120)?new n(p&&g):void 0}g=e[0];var m=-1,b=d[0];e:for(;++m<f&&v.length<y;){var E=g[m],S=t?t(E):E;if(E=r||0!==E?E:0,!(b?u(b,S):l(v,S,r))){for(p=h;--p;){var C=d[p];if(!(C?u(C,S):l(e[p],S,r)))continue e}b&&b.push(S),v.push(E)}}return v}},9454:(e,t,r)=>{var n=r(4239),i=r(7005);e.exports=function(e){return i(e)&&"[object Arguments]"==n(e)}},5588:(e,t,r)=>{var n=r(4160),i=r(7005);e.exports=function(e){return i(e)&&"[object Map]"==n(e)}},2722:e=>{e.exports=function(e){return e!=e}},8458:(e,t,r)=>{var n=r(3560),i=r(5346),a=r(3218),o=r(346),s=/^\[object .+?Constructor\]$/,u=Function.prototype,c=Object.prototype,l=u.toString,f=c.hasOwnProperty,h=RegExp("^"+l.call(f).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(e){return!(!a(e)||i(e))&&(n(e)?h:s).test(o(e))}},9221:(e,t,r)=>{var n=r(4160),i=r(7005);e.exports=function(e){return i(e)&&"[object Set]"==n(e)}},8749:(e,t,r)=>{var n=r(4239),i=r(1780),a=r(7005),o={};o["[object Float32Array]"]=o["[object Float64Array]"]=o["[object Int8Array]"]=o["[object Int16Array]"]=o["[object Int32Array]"]=o["[object Uint8Array]"]=o["[object Uint8ClampedArray]"]=o["[object Uint16Array]"]=o["[object Uint32Array]"]=!0,o["[object Arguments]"]=o["[object Array]"]=o["[object ArrayBuffer]"]=o["[object Boolean]"]=o["[object DataView]"]=o["[object Date]"]=o["[object Error]"]=o["[object Function]"]=o["[object Map]"]=o["[object Number]"]=o["[object Object]"]=o["[object RegExp]"]=o["[object Set]"]=o["[object String]"]=o["[object WeakMap]"]=!1,e.exports=function(e){return a(e)&&i(e.length)&&!!o[n(e)]}},280:(e,t,r)=>{var n=r(5726),i=r(6916),a=Object.prototype.hasOwnProperty;e.exports=function(e){if(!n(e))return i(e);var t=[];for(var r in Object(e))a.call(e,r)&&"constructor"!=r&&t.push(r);return t}},313:(e,t,r)=>{var n=r(3218),i=r(5726),a=r(3498),o=Object.prototype.hasOwnProperty;e.exports=function(e){if(!n(e))return a(e);var t=i(e),r=[];for(var s in e)("constructor"!=s||!t&&o.call(e,s))&&r.push(s);return r}},9435:e=>{e.exports=function(){}},2980:(e,t,r)=>{var n=r(6384),i=r(6556),a=r(8483),o=r(9783),s=r(3218),u=r(1704),c=r(6390);e.exports=function e(t,r,l,f,h){t!==r&&a(r,(function(a,u){if(h||(h=new n),s(a))o(t,r,u,l,e,f,h);else{var p=f?f(c(t,u),a,u+"",t,r,h):void 0;void 0===p&&(p=a),i(t,u,p)}}),u)}},9783:(e,t,r)=>{var n=r(6556),i=r(4626),a=r(7133),o=r(278),s=r(8517),u=r(5694),c=r(1469),l=r(9246),f=r(4144),h=r(3560),p=r(3218),d=r(8630),y=r(6719),v=r(6390),g=r(9881);e.exports=function(e,t,r,m,b,E,S){var C=v(e,r),w=v(t,r),T=S.get(w);if(T)n(e,r,T);else{var A=E?E(C,w,r+"",e,t,S):void 0,I=void 0===A;if(I){var k=c(w),_=!k&&f(w),B=!k&&!_&&y(w);A=w,k||_||B?c(C)?A=C:l(C)?A=o(C):_?(I=!1,A=i(w,!0)):B?(I=!1,A=a(w,!0)):A=[]:d(w)||u(w)?(A=C,u(C)?A=g(C):p(C)&&!h(C)||(A=s(w))):I=!1}I&&(S.set(w,A),b(A,w,m,E,S),S.delete(w)),n(e,r,A)}}},5970:(e,t,r)=>{var n=r(3012),i=r(9095);e.exports=function(e,t){return n(e,t,(function(t,r){return i(e,r)}))}},3012:(e,t,r)=>{var n=r(7786),i=r(611),a=r(1811);e.exports=function(e,t,r){for(var o=-1,s=t.length,u={};++o<s;){var c=t[o],l=n(e,c);r(l,c)&&i(u,a(c,e),l)}return u}},5976:(e,t,r)=>{var n=r(6557),i=r(5357),a=r(61);e.exports=function(e,t){return a(i(e,t,n),e+"")}},611:(e,t,r)=>{var n=r(4865),i=r(1811),a=r(5776),o=r(3218),s=r(327);e.exports=function(e,t,r,u){if(!o(e))return e;for(var c=-1,l=(t=i(t,e)).length,f=l-1,h=e;null!=h&&++c<l;){var p=s(t[c]),d=r;if("__proto__"===p||"constructor"===p||"prototype"===p)return e;if(c!=f){var y=h[p];void 0===(d=u?u(y,p,h):void 0)&&(d=o(y)?y:a(t[c+1])?[]:{})}n(h,p,d),h=h[p]}return e}},8045:(e,t,r)=>{var n=r(6557),i=r(9250),a=i?function(e,t){return i.set(e,t),e}:n;e.exports=a},6560:(e,t,r)=>{var n=r(5703),i=r(8777),a=r(6557),o=i?function(e,t){return i(e,"toString",{configurable:!0,enumerable:!1,value:n(t),writable:!0})}:a;e.exports=o},4259:e=>{e.exports=function(e,t,r){var n=-1,i=e.length;t<0&&(t=-t>i?0:i+t),(r=r>i?i:r)<0&&(r+=i),i=t>r?0:r-t>>>0,t>>>=0;for(var a=Array(i);++n<i;)a[n]=e[n+t];return a}},2545:e=>{e.exports=function(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}},531:(e,t,r)=>{var n=r(2705),i=r(9932),a=r(1469),o=r(3448),s=n?n.prototype:void 0,u=s?s.toString:void 0;e.exports=function e(t){if("string"==typeof t)return t;if(a(t))return i(t,e)+"";if(o(t))return u?u.call(t):"";var r=t+"";return"0"==r&&1/t==-Infinity?"-0":r}},7561:(e,t,r)=>{var n=r(7990),i=/^\s+/;e.exports=function(e){return e?e.slice(0,n(e)+1).replace(i,""):e}},1717:e=>{e.exports=function(e){return function(t){return e(t)}}},5652:(e,t,r)=>{var n=r(8668),i=r(7443),a=r(1196),o=r(4757),s=r(3593),u=r(1814);e.exports=function(e,t,r){var c=-1,l=i,f=e.length,h=!0,p=[],d=p;if(r)h=!1,l=a;else if(f>=200){var y=t?null:s(e);if(y)return u(y);h=!1,l=o,d=new n}else d=t?[]:p;e:for(;++c<f;){var v=e[c],g=t?t(v):v;if(v=r||0!==v?v:0,h&&g==g){for(var m=d.length;m--;)if(d[m]===g)continue e;t&&d.push(g),p.push(v)}else l(d,g,r)||(d!==p&&d.push(g),p.push(v))}return p}},7406:(e,t,r)=>{var n=r(1811),i=r(928),a=r(292),o=r(327);e.exports=function(e,t){return t=n(t,e),null==(e=a(e,t))||delete e[o(i(t))]}},4757:e=>{e.exports=function(e,t){return e.has(t)}},4387:(e,t,r)=>{var n=r(9246);e.exports=function(e){return n(e)?e:[]}},1811:(e,t,r)=>{var n=r(1469),i=r(5403),a=r(5514),o=r(9833);e.exports=function(e,t){return n(e)?e:i(e,t)?[e]:a(o(e))}},4318:(e,t,r)=>{var n=r(1149);e.exports=function(e){var t=new e.constructor(e.byteLength);return new n(t).set(new n(e)),t}},4626:(e,t,r)=>{e=r.nmd(e);var n=r(5639),i=t&&!t.nodeType&&t,a=i&&e&&!e.nodeType&&e,o=a&&a.exports===i?n.Buffer:void 0,s=o?o.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var r=e.length,n=s?s(r):new e.constructor(r);return e.copy(n),n}},7157:(e,t,r)=>{var n=r(4318);e.exports=function(e,t){var r=t?n(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}},3147:e=>{var t=/\w*$/;e.exports=function(e){var r=new e.constructor(e.source,t.exec(e));return r.lastIndex=e.lastIndex,r}},419:(e,t,r)=>{var n=r(2705),i=n?n.prototype:void 0,a=i?i.valueOf:void 0;e.exports=function(e){return a?Object(a.call(e)):{}}},7133:(e,t,r)=>{var n=r(4318);e.exports=function(e,t){var r=t?n(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}},2157:e=>{var t=Math.max;e.exports=function(e,r,n,i){for(var a=-1,o=e.length,s=n.length,u=-1,c=r.length,l=t(o-s,0),f=Array(c+l),h=!i;++u<c;)f[u]=r[u];for(;++a<s;)(h||a<o)&&(f[n[a]]=e[a]);for(;l--;)f[u++]=e[a++];return f}},4054:e=>{var t=Math.max;e.exports=function(e,r,n,i){for(var a=-1,o=e.length,s=-1,u=n.length,c=-1,l=r.length,f=t(o-u,0),h=Array(f+l),p=!i;++a<f;)h[a]=e[a];for(var d=a;++c<l;)h[d+c]=r[c];for(;++s<u;)(p||a<o)&&(h[d+n[s]]=e[a++]);return h}},278:e=>{e.exports=function(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}},8363:(e,t,r)=>{var n=r(4865),i=r(9465);e.exports=function(e,t,r,a){var o=!r;r||(r={});for(var s=-1,u=t.length;++s<u;){var c=t[s],l=a?a(r[c],e[c],c,r,e):void 0;void 0===l&&(l=e[c]),o?i(r,c,l):n(r,c,l)}return r}},8805:(e,t,r)=>{var n=r(8363),i=r(9551);e.exports=function(e,t){return n(e,i(e),t)}},1911:(e,t,r)=>{var n=r(8363),i=r(1442);e.exports=function(e,t){return n(e,i(e),t)}},4429:(e,t,r)=>{var n=r(5639)["__core-js_shared__"];e.exports=n},7991:e=>{e.exports=function(e,t){for(var r=e.length,n=0;r--;)e[r]===t&&++n;return n}},1463:(e,t,r)=>{var n=r(5976),i=r(6612);e.exports=function(e){return n((function(t,r){var n=-1,a=r.length,o=a>1?r[a-1]:void 0,s=a>2?r[2]:void 0;for(o=e.length>3&&"function"==typeof o?(a--,o):void 0,s&&i(r[0],r[1],s)&&(o=a<3?void 0:o,a=1),t=Object(t);++n<a;){var u=r[n];u&&e(t,u,n,o)}return t}))}},5063:e=>{e.exports=function(e){return function(t,r,n){for(var i=-1,a=Object(t),o=n(t),s=o.length;s--;){var u=o[e?s:++i];if(!1===r(a[u],u,a))break}return t}}},2402:(e,t,r)=>{var n=r(1774),i=r(5639);e.exports=function(e,t,r){var a=1&t,o=n(e);return function t(){var n=this&&this!==i&&this instanceof t?o:e;return n.apply(a?r:this,arguments)}}},1774:(e,t,r)=>{var n=r(3118),i=r(3218);e.exports=function(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var r=n(e.prototype),a=e.apply(r,t);return i(a)?a:r}}},6347:(e,t,r)=>{var n=r(6874),i=r(1774),a=r(6935),o=r(4487),s=r(893),u=r(6460),c=r(5639);e.exports=function(e,t,r){var l=i(e);return function i(){for(var f=arguments.length,h=Array(f),p=f,d=s(i);p--;)h[p]=arguments[p];var y=f<3&&h[0]!==d&&h[f-1]!==d?[]:u(h,d);if((f-=y.length)<r)return o(e,t,a,i.placeholder,void 0,h,y,void 0,void 0,r-f);var v=this&&this!==c&&this instanceof i?l:e;return n(v,this,h)}}},6935:(e,t,r)=>{var n=r(2157),i=r(4054),a=r(7991),o=r(1774),s=r(4487),u=r(893),c=r(451),l=r(6460),f=r(5639);e.exports=function e(t,r,h,p,d,y,v,g,m,b){var E=128&r,S=1&r,C=2&r,w=24&r,T=512&r,A=C?void 0:o(t);return function I(){for(var k=arguments.length,_=Array(k),B=k;B--;)_[B]=arguments[B];if(w)var N=u(I),O=a(_,N);if(p&&(_=n(_,p,d,w)),y&&(_=i(_,y,v,w)),k-=O,w&&k<b){var R=l(_,N);return s(t,r,e,I.placeholder,h,_,R,g,m,b-k)}var x=S?h:this,P=C?x[t]:t;return k=_.length,g?_=c(_,g):T&&k>1&&_.reverse(),E&&m<k&&(_.length=m),this&&this!==f&&this instanceof I&&(P=A||o(P)),P.apply(x,_)}}},4375:(e,t,r)=>{var n=r(6874),i=r(1774),a=r(5639);e.exports=function(e,t,r,o){var s=1&t,u=i(e);return function t(){for(var i=-1,c=arguments.length,l=-1,f=o.length,h=Array(f+c),p=this&&this!==a&&this instanceof t?u:e;++l<f;)h[l]=o[l];for(;c--;)h[l++]=arguments[++i];return n(p,s?r:this,h)}}},4487:(e,t,r)=>{var n=r(6528),i=r(258),a=r(9255);e.exports=function(e,t,r,o,s,u,c,l,f,h){var p=8&t;t|=p?32:64,4&(t&=~(p?64:32))||(t&=-4);var d=[e,t,s,p?u:void 0,p?c:void 0,p?void 0:u,p?void 0:c,l,f,h],y=r.apply(void 0,d);return n(e)&&i(y,d),y.placeholder=o,a(y,e,t)}},3593:(e,t,r)=>{var n=r(8525),i=r(308),a=r(1814),o=n&&1/a(new n([,-0]))[1]==1/0?function(e){return new n(e)}:i;e.exports=o},7727:(e,t,r)=>{var n=r(8045),i=r(2402),a=r(6347),o=r(6935),s=r(4375),u=r(6833),c=r(3833),l=r(258),f=r(9255),h=r(554),p=Math.max;e.exports=function(e,t,r,d,y,v,g,m){var b=2&t;if(!b&&"function"!=typeof e)throw new TypeError("Expected a function");var E=d?d.length:0;if(E||(t&=-97,d=y=void 0),g=void 0===g?g:p(h(g),0),m=void 0===m?m:h(m),E-=y?y.length:0,64&t){var S=d,C=y;d=y=void 0}var w=b?void 0:u(e),T=[e,t,r,d,y,S,C,v,g,m];if(w&&c(T,w),e=T[0],t=T[1],r=T[2],d=T[3],y=T[4],!(m=T[9]=void 0===T[9]?b?0:e.length:p(T[9]-E,0))&&24&t&&(t&=-25),t&&1!=t)A=8==t||16==t?a(e,t,m):32!=t&&33!=t||y.length?o.apply(void 0,T):s(e,t,r,d);else var A=i(e,t,r);return f((w?n:l)(A,T),e,t)}},696:(e,t,r)=>{var n=r(8630);e.exports=function(e){return n(e)?void 0:e}},8777:(e,t,r)=>{var n=r(852),i=function(){try{var e=n(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();e.exports=i},9021:(e,t,r)=>{var n=r(5564),i=r(5357),a=r(61);e.exports=function(e){return a(i(e,void 0,n),e+"")}},1957:(e,t,r)=>{var n="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g;e.exports=n},8234:(e,t,r)=>{var n=r(8866),i=r(9551),a=r(3674);e.exports=function(e){return n(e,a,i)}},6904:(e,t,r)=>{var n=r(8866),i=r(1442),a=r(1704);e.exports=function(e){return n(e,a,i)}},6833:(e,t,r)=>{var n=r(9250),i=r(308),a=n?function(e){return n.get(e)}:i;e.exports=a},7658:(e,t,r)=>{var n=r(2060),i=Object.prototype.hasOwnProperty;e.exports=function(e){for(var t=e.name+"",r=n[t],a=i.call(n,t)?r.length:0;a--;){var o=r[a],s=o.func;if(null==s||s==e)return o.name}return t}},893:e=>{e.exports=function(e){return e.placeholder}},5050:(e,t,r)=>{var n=r(7019);e.exports=function(e,t){var r=e.__data__;return n(t)?r["string"==typeof t?"string":"hash"]:r.map}},852:(e,t,r)=>{var n=r(8458),i=r(7801);e.exports=function(e,t){var r=i(e,t);return n(r)?r:void 0}},9882:(e,t,r)=>{var n=r(5569)(Object.getPrototypeOf,Object);e.exports=n},9607:(e,t,r)=>{var n=r(2705),i=Object.prototype,a=i.hasOwnProperty,o=i.toString,s=n?n.toStringTag:void 0;e.exports=function(e){var t=a.call(e,s),r=e[s];try{e[s]=void 0;var n=!0}catch(e){}var i=o.call(e);return n&&(t?e[s]=r:delete e[s]),i}},9551:(e,t,r)=>{var n=r(4963),i=r(479),a=Object.prototype.propertyIsEnumerable,o=Object.getOwnPropertySymbols,s=o?function(e){return null==e?[]:(e=Object(e),n(o(e),(function(t){return a.call(e,t)})))}:i;e.exports=s},1442:(e,t,r)=>{var n=r(2488),i=r(9882),a=r(9551),o=r(479),s=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)n(t,a(e)),e=i(e);return t}:o;e.exports=s},4160:(e,t,r)=>{var n=r(8552),i=r(7071),a=r(3818),o=r(8525),s=r(577),u=r(4239),c=r(346),l="[object Map]",f="[object Promise]",h="[object Set]",p="[object WeakMap]",d="[object DataView]",y=c(n),v=c(i),g=c(a),m=c(o),b=c(s),E=u;(n&&E(new n(new ArrayBuffer(1)))!=d||i&&E(new i)!=l||a&&E(a.resolve())!=f||o&&E(new o)!=h||s&&E(new s)!=p)&&(E=function(e){var t=u(e),r="[object Object]"==t?e.constructor:void 0,n=r?c(r):"";if(n)switch(n){case y:return d;case v:return l;case g:return f;case m:return h;case b:return p}return t}),e.exports=E},7801:e=>{e.exports=function(e,t){return null==e?void 0:e[t]}},8775:e=>{var t=/\{\n\/\* \[wrapped with (.+)\] \*/,r=/,? & /;e.exports=function(e){var n=e.match(t);return n?n[1].split(r):[]}},222:(e,t,r)=>{var n=r(1811),i=r(5694),a=r(1469),o=r(5776),s=r(1780),u=r(327);e.exports=function(e,t,r){for(var c=-1,l=(t=n(t,e)).length,f=!1;++c<l;){var h=u(t[c]);if(!(f=null!=e&&r(e,h)))break;e=e[h]}return f||++c!=l?f:!!(l=null==e?0:e.length)&&s(l)&&o(h,l)&&(a(e)||i(e))}},1789:(e,t,r)=>{var n=r(4536);e.exports=function(){this.__data__=n?n(null):{},this.size=0}},401:e=>{e.exports=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}},7667:(e,t,r)=>{var n=r(4536),i=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;if(n){var r=t[e];return"__lodash_hash_undefined__"===r?void 0:r}return i.call(t,e)?t[e]:void 0}},1327:(e,t,r)=>{var n=r(4536),i=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;return n?void 0!==t[e]:i.call(t,e)}},1866:(e,t,r)=>{var n=r(4536);e.exports=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=n&&void 0===t?"__lodash_hash_undefined__":t,this}},3824:e=>{var t=Object.prototype.hasOwnProperty;e.exports=function(e){var r=e.length,n=new e.constructor(r);return r&&"string"==typeof e[0]&&t.call(e,"index")&&(n.index=e.index,n.input=e.input),n}},9148:(e,t,r)=>{var n=r(4318),i=r(7157),a=r(3147),o=r(419),s=r(7133);e.exports=function(e,t,r){var u=e.constructor;switch(t){case"[object ArrayBuffer]":return n(e);case"[object Boolean]":case"[object Date]":return new u(+e);case"[object DataView]":return i(e,r);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return s(e,r);case"[object Map]":return new u;case"[object Number]":case"[object String]":return new u(e);case"[object RegExp]":return a(e);case"[object Set]":return new u;case"[object Symbol]":return o(e)}}},8517:(e,t,r)=>{var n=r(3118),i=r(9882),a=r(5726);e.exports=function(e){return"function"!=typeof e.constructor||a(e)?{}:n(i(e))}},3112:e=>{var t=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/;e.exports=function(e,r){var n=r.length;if(!n)return e;var i=n-1;return r[i]=(n>1?"& ":"")+r[i],r=r.join(n>2?", ":" "),e.replace(t,"{\n/* [wrapped with "+r+"] */\n")}},7285:(e,t,r)=>{var n=r(2705),i=r(5694),a=r(1469),o=n?n.isConcatSpreadable:void 0;e.exports=function(e){return a(e)||i(e)||!!(o&&e&&e[o])}},5776:e=>{var t=/^(?:0|[1-9]\d*)$/;e.exports=function(e,r){var n=typeof e;return!!(r=null==r?9007199254740991:r)&&("number"==n||"symbol"!=n&&t.test(e))&&e>-1&&e%1==0&&e<r}},6612:(e,t,r)=>{var n=r(7813),i=r(8612),a=r(5776),o=r(3218);e.exports=function(e,t,r){if(!o(r))return!1;var s=typeof t;return!!("number"==s?i(r)&&a(t,r.length):"string"==s&&t in r)&&n(r[t],e)}},5403:(e,t,r)=>{var n=r(1469),i=r(3448),a=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,o=/^\w*$/;e.exports=function(e,t){if(n(e))return!1;var r=typeof e;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!i(e))||(o.test(e)||!a.test(e)||null!=t&&e in Object(t))}},7019:e=>{e.exports=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}},6528:(e,t,r)=>{var n=r(6425),i=r(6833),a=r(7658),o=r(8111);e.exports=function(e){var t=a(e),r=o[t];if("function"!=typeof r||!(t in n.prototype))return!1;if(e===r)return!0;var s=i(r);return!!s&&e===s[0]}},5346:(e,t,r)=>{var n,i=r(4429),a=(n=/[^.]+$/.exec(i&&i.keys&&i.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"";e.exports=function(e){return!!a&&a in e}},5726:e=>{var t=Object.prototype;e.exports=function(e){var r=e&&e.constructor;return e===("function"==typeof r&&r.prototype||t)}},7040:e=>{e.exports=function(){this.__data__=[],this.size=0}},4125:(e,t,r)=>{var n=r(8470),i=Array.prototype.splice;e.exports=function(e){var t=this.__data__,r=n(t,e);return!(r<0)&&(r==t.length-1?t.pop():i.call(t,r,1),--this.size,!0)}},2117:(e,t,r)=>{var n=r(8470);e.exports=function(e){var t=this.__data__,r=n(t,e);return r<0?void 0:t[r][1]}},7518:(e,t,r)=>{var n=r(8470);e.exports=function(e){return n(this.__data__,e)>-1}},4705:(e,t,r)=>{var n=r(8470);e.exports=function(e,t){var r=this.__data__,i=n(r,e);return i<0?(++this.size,r.push([e,t])):r[i][1]=t,this}},4785:(e,t,r)=>{var n=r(1989),i=r(8407),a=r(7071);e.exports=function(){this.size=0,this.__data__={hash:new n,map:new(a||i),string:new n}}},1285:(e,t,r)=>{var n=r(5050);e.exports=function(e){var t=n(this,e).delete(e);return this.size-=t?1:0,t}},6e3:(e,t,r)=>{var n=r(5050);e.exports=function(e){return n(this,e).get(e)}},9916:(e,t,r)=>{var n=r(5050);e.exports=function(e){return n(this,e).has(e)}},5265:(e,t,r)=>{var n=r(5050);e.exports=function(e,t){var r=n(this,e),i=r.size;return r.set(e,t),this.size+=r.size==i?0:1,this}},4523:(e,t,r)=>{var n=r(8306);e.exports=function(e){var t=n(e,(function(e){return 500===r.size&&r.clear(),e})),r=t.cache;return t}},3833:(e,t,r)=>{var n=r(2157),i=r(4054),a=r(6460),o="__lodash_placeholder__",s=128,u=Math.min;e.exports=function(e,t){var r=e[1],c=t[1],l=r|c,f=l<131,h=c==s&&8==r||c==s&&256==r&&e[7].length<=t[8]||384==c&&t[7].length<=t[8]&&8==r;if(!f&&!h)return e;1&c&&(e[2]=t[2],l|=1&r?0:4);var p=t[3];if(p){var d=e[3];e[3]=d?n(d,p,t[4]):p,e[4]=d?a(e[3],o):t[4]}return(p=t[5])&&(d=e[5],e[5]=d?i(d,p,t[6]):p,e[6]=d?a(e[5],o):t[6]),(p=t[7])&&(e[7]=p),c&s&&(e[8]=null==e[8]?t[8]:u(e[8],t[8])),null==e[9]&&(e[9]=t[9]),e[0]=t[0],e[1]=l,e}},9250:(e,t,r)=>{var n=r(577),i=n&&new n;e.exports=i},4536:(e,t,r)=>{var n=r(852)(Object,"create");e.exports=n},6916:(e,t,r)=>{var n=r(5569)(Object.keys,Object);e.exports=n},3498:e=>{e.exports=function(e){var t=[];if(null!=e)for(var r in Object(e))t.push(r);return t}},1167:(e,t,r)=>{e=r.nmd(e);var n=r(1957),i=t&&!t.nodeType&&t,a=i&&e&&!e.nodeType&&e,o=a&&a.exports===i&&n.process,s=function(){try{var e=a&&a.require&&a.require("util").types;return e||o&&o.binding&&o.binding("util")}catch(e){}}();e.exports=s},2333:e=>{var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},5569:e=>{e.exports=function(e,t){return function(r){return e(t(r))}}},5357:(e,t,r)=>{var n=r(6874),i=Math.max;e.exports=function(e,t,r){return t=i(void 0===t?e.length-1:t,0),function(){for(var a=arguments,o=-1,s=i(a.length-t,0),u=Array(s);++o<s;)u[o]=a[t+o];o=-1;for(var c=Array(t+1);++o<t;)c[o]=a[o];return c[t]=r(u),n(e,this,c)}}},292:(e,t,r)=>{var n=r(7786),i=r(4259);e.exports=function(e,t){return t.length<2?e:n(e,i(t,0,-1))}},2060:e=>{e.exports={}},451:(e,t,r)=>{var n=r(278),i=r(5776),a=Math.min;e.exports=function(e,t){for(var r=e.length,o=a(t.length,r),s=n(e);o--;){var u=t[o];e[o]=i(u,r)?s[u]:void 0}return e}},6460:e=>{var t="__lodash_placeholder__";e.exports=function(e,r){for(var n=-1,i=e.length,a=0,o=[];++n<i;){var s=e[n];s!==r&&s!==t||(e[n]=t,o[a++]=n)}return o}},5639:(e,t,r)=>{var n=r(1957),i="object"==typeof self&&self&&self.Object===Object&&self,a=n||i||Function("return this")();e.exports=a},6390:e=>{e.exports=function(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}},619:e=>{e.exports=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this}},2385:e=>{e.exports=function(e){return this.__data__.has(e)}},258:(e,t,r)=>{var n=r(8045),i=r(1275)(n);e.exports=i},1814:e=>{e.exports=function(e){var t=-1,r=Array(e.size);return e.forEach((function(e){r[++t]=e})),r}},61:(e,t,r)=>{var n=r(6560),i=r(1275)(n);e.exports=i},9255:(e,t,r)=>{var n=r(8775),i=r(3112),a=r(61),o=r(7241);e.exports=function(e,t,r){var s=t+"";return a(e,i(s,o(n(s),r)))}},1275:e=>{var t=Date.now;e.exports=function(e){var r=0,n=0;return function(){var i=t(),a=16-(i-n);if(n=i,a>0){if(++r>=800)return arguments[0]}else r=0;return e.apply(void 0,arguments)}}},7465:(e,t,r)=>{var n=r(8407);e.exports=function(){this.__data__=new n,this.size=0}},3779:e=>{e.exports=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}},7599:e=>{e.exports=function(e){return this.__data__.get(e)}},4758:e=>{e.exports=function(e){return this.__data__.has(e)}},4309:(e,t,r)=>{var n=r(8407),i=r(7071),a=r(3369);e.exports=function(e,t){var r=this.__data__;if(r instanceof n){var o=r.__data__;if(!i||o.length<199)return o.push([e,t]),this.size=++r.size,this;r=this.__data__=new a(o)}return r.set(e,t),this.size=r.size,this}},2351:e=>{e.exports=function(e,t,r){for(var n=r-1,i=e.length;++n<i;)if(e[n]===t)return n;return-1}},5514:(e,t,r)=>{var n=r(4523),i=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,a=/\\(\\)?/g,o=n((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(i,(function(e,r,n,i){t.push(n?i.replace(a,"$1"):r||e)})),t}));e.exports=o},327:(e,t,r)=>{var n=r(3448);e.exports=function(e){if("string"==typeof e||n(e))return e;var t=e+"";return"0"==t&&1/e==-Infinity?"-0":t}},346:e=>{var t=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return t.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},7990:e=>{var t=/\s/;e.exports=function(e){for(var r=e.length;r--&&t.test(e.charAt(r)););return r}},7241:(e,t,r)=>{var n=r(7412),i=r(7443),a=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]];e.exports=function(e,t){return n(a,(function(r){var n="_."+r[0];t&r[1]&&!i(e,n)&&e.push(n)})),e.sort()}},1913:(e,t,r)=>{var n=r(6425),i=r(7548),a=r(278);e.exports=function(e){if(e instanceof n)return e.clone();var t=new i(e.__wrapped__,e.__chain__);return t.__actions__=a(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}},8583:(e,t,r)=>{var n=r(4865),i=r(8363),a=r(1463),o=r(8612),s=r(5726),u=r(3674),c=Object.prototype.hasOwnProperty,l=a((function(e,t){if(s(t)||o(t))i(t,u(t),e);else for(var r in t)c.call(t,r)&&n(e,r,t[r])}));e.exports=l},6678:(e,t,r)=>{var n=r(5990);e.exports=function(e){return n(e,4)}},5703:e=>{e.exports=function(e){return function(){return e}}},7813:e=>{e.exports=function(e,t){return e===t||e!=e&&t!=t}},9873:(e,t,r)=>{var n=r(5082),i=r(6612);e.exports=function(e,t,r,a){var o=null==e?0:e.length;return o?(r&&"number"!=typeof r&&i(e,t,r)&&(r=0,a=o),n(e,t,r,a)):[]}},5564:(e,t,r)=>{var n=r(1078);e.exports=function(e){return(null==e?0:e.length)?n(e,1):[]}},9095:(e,t,r)=>{var n=r(13),i=r(222);e.exports=function(e,t){return null!=e&&i(e,t,n)}},6557:e=>{e.exports=function(e){return e}},5325:(e,t,r)=>{var n=r(9932),i=r(7556),a=r(5976),o=r(4387),s=a((function(e){var t=n(e,o);return t.length&&t[0]===e[0]?i(t):[]}));e.exports=s},5694:(e,t,r)=>{var n=r(9454),i=r(7005),a=Object.prototype,o=a.hasOwnProperty,s=a.propertyIsEnumerable,u=n(function(){return arguments}())?n:function(e){return i(e)&&o.call(e,"callee")&&!s.call(e,"callee")};e.exports=u},1469:e=>{var t=Array.isArray;e.exports=t},8612:(e,t,r)=>{var n=r(3560),i=r(1780);e.exports=function(e){return null!=e&&i(e.length)&&!n(e)}},9246:(e,t,r)=>{var n=r(8612),i=r(7005);e.exports=function(e){return i(e)&&n(e)}},4144:(e,t,r)=>{e=r.nmd(e);var n=r(5639),i=r(5062),a=t&&!t.nodeType&&t,o=a&&e&&!e.nodeType&&e,s=o&&o.exports===a?n.Buffer:void 0,u=(s?s.isBuffer:void 0)||i;e.exports=u},3560:(e,t,r)=>{var n=r(4239),i=r(3218);e.exports=function(e){if(!i(e))return!1;var t=n(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},1780:e=>{e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}},6688:(e,t,r)=>{var n=r(5588),i=r(1717),a=r(1167),o=a&&a.isMap,s=o?i(o):n;e.exports=s},3218:e=>{e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},7005:e=>{e.exports=function(e){return null!=e&&"object"==typeof e}},8630:(e,t,r)=>{var n=r(4239),i=r(9882),a=r(7005),o=Function.prototype,s=Object.prototype,u=o.toString,c=s.hasOwnProperty,l=u.call(Object);e.exports=function(e){if(!a(e)||"[object Object]"!=n(e))return!1;var t=i(e);if(null===t)return!0;var r=c.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&u.call(r)==l}},2928:(e,t,r)=>{var n=r(9221),i=r(1717),a=r(1167),o=a&&a.isSet,s=o?i(o):n;e.exports=s},3448:(e,t,r)=>{var n=r(4239),i=r(7005);e.exports=function(e){return"symbol"==typeof e||i(e)&&"[object Symbol]"==n(e)}},6719:(e,t,r)=>{var n=r(8749),i=r(1717),a=r(1167),o=a&&a.isTypedArray,s=o?i(o):n;e.exports=s},3674:(e,t,r)=>{var n=r(4636),i=r(280),a=r(8612);e.exports=function(e){return a(e)?n(e):i(e)}},1704:(e,t,r)=>{var n=r(4636),i=r(313),a=r(8612);e.exports=function(e){return a(e)?n(e,!0):i(e)}},928:e=>{e.exports=function(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}},8306:(e,t,r)=>{var n=r(3369);function i(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var r=function(){var n=arguments,i=t?t.apply(this,n):n[0],a=r.cache;if(a.has(i))return a.get(i);var o=e.apply(this,n);return r.cache=a.set(i,o)||a,o};return r.cache=new(i.Cache||n),r}i.Cache=n,e.exports=i},2492:(e,t,r)=>{var n=r(2980),i=r(1463)((function(e,t,r){n(e,t,r)}));e.exports=i},308:e=>{e.exports=function(){}},7557:(e,t,r)=>{var n=r(9932),i=r(5990),a=r(7406),o=r(1811),s=r(8363),u=r(696),c=r(9021),l=r(6904),f=c((function(e,t){var r={};if(null==e)return r;var c=!1;t=n(t,(function(t){return t=o(t,e),c||(c=t.length>1),t})),s(e,l(e),r),c&&(r=i(r,7,u));for(var f=t.length;f--;)a(r,t[f]);return r}));e.exports=f},5544:(e,t,r)=>{var n=r(5976),i=r(7727),a=r(893),o=r(6460),s=n((function(e,t){var r=o(t,a(s));return i(e,64,void 0,t,r)}));s.placeholder={},e.exports=s},8718:(e,t,r)=>{var n=r(5970),i=r(9021)((function(e,t){return null==e?{}:n(e,t)}));e.exports=i},479:e=>{e.exports=function(){return[]}},5062:e=>{e.exports=function(){return!1}},8601:(e,t,r)=>{var n=r(4841),i=1/0;e.exports=function(e){return e?(e=n(e))===i||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}},554:(e,t,r)=>{var n=r(8601);e.exports=function(e){var t=n(e),r=t%1;return t==t?r?t-r:t:0}},8958:(e,t,r)=>{var n=r(9750),i=r(554);e.exports=function(e){return e?n(i(e),0,4294967295):0}},4841:(e,t,r)=>{var n=r(7561),i=r(3218),a=r(3448),o=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,u=/^0o[0-7]+$/i,c=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(a(e))return NaN;if(i(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=i(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=n(e);var r=s.test(e);return r||u.test(e)?c(e.slice(2),r?2:8):o.test(e)?NaN:+e}},9881:(e,t,r)=>{var n=r(8363),i=r(1704);e.exports=function(e){return n(e,i(e))}},9833:(e,t,r)=>{var n=r(531);e.exports=function(e){return null==e?"":n(e)}},4908:(e,t,r)=>{var n=r(5652);e.exports=function(e){return e&&e.length?n(e):[]}},8111:(e,t,r)=>{var n=r(6425),i=r(7548),a=r(9435),o=r(1469),s=r(7005),u=r(1913),c=Object.prototype.hasOwnProperty;function l(e){if(s(e)&&!o(e)&&!(e instanceof n)){if(e instanceof i)return e;if(c.call(e,"__wrapped__"))return u(e)}return new i(e)}l.prototype=a.prototype,l.prototype.constructor=l,e.exports=l},3720:e=>{e.exports=r;var t=null;try{t=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch(e){}function r(e,t,r){this.low=0|e,this.high=0|t,this.unsigned=!!r}function n(e){return!0===(e&&e.__isLong__)}r.prototype.__isLong__,Object.defineProperty(r.prototype,"__isLong__",{value:!0}),r.isLong=n;var i={},a={};function o(e,t){var r,n,o;return t?(o=0<=(e>>>=0)&&e<256)&&(n=a[e])?n:(r=u(e,(0|e)<0?-1:0,!0),o&&(a[e]=r),r):(o=-128<=(e|=0)&&e<128)&&(n=i[e])?n:(r=u(e,e<0?-1:0,!1),o&&(i[e]=r),r)}function s(e,t){if(isNaN(e))return t?g:v;if(t){if(e<0)return g;if(e>=p)return C}else{if(e<=-d)return w;if(e+1>=d)return S}return e<0?s(-e,t).neg():u(e%h|0,e/h|0,t)}function u(e,t,n){return new r(e,t,n)}r.fromInt=o,r.fromNumber=s,r.fromBits=u;var c=Math.pow;function l(e,t,r){if(0===e.length)throw Error("empty string");if("NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return v;if("number"==typeof t?(r=t,t=!1):t=!!t,(r=r||10)<2||36<r)throw RangeError("radix");var n;if((n=e.indexOf("-"))>0)throw Error("interior hyphen");if(0===n)return l(e.substring(1),t,r).neg();for(var i=s(c(r,8)),a=v,o=0;o<e.length;o+=8){var u=Math.min(8,e.length-o),f=parseInt(e.substring(o,o+u),r);if(u<8){var h=s(c(r,u));a=a.mul(h).add(s(f))}else a=(a=a.mul(i)).add(s(f))}return a.unsigned=t,a}function f(e,t){return"number"==typeof e?s(e,t):"string"==typeof e?l(e,t):u(e.low,e.high,"boolean"==typeof t?t:e.unsigned)}r.fromString=l,r.fromValue=f;var h=4294967296,p=h*h,d=p/2,y=o(1<<24),v=o(0);r.ZERO=v;var g=o(0,!0);r.UZERO=g;var m=o(1);r.ONE=m;var b=o(1,!0);r.UONE=b;var E=o(-1);r.NEG_ONE=E;var S=u(-1,2147483647,!1);r.MAX_VALUE=S;var C=u(-1,-1,!0);r.MAX_UNSIGNED_VALUE=C;var w=u(0,-2147483648,!1);r.MIN_VALUE=w;var T=r.prototype;T.toInt=function(){return this.unsigned?this.low>>>0:this.low},T.toNumber=function(){return this.unsigned?(this.high>>>0)*h+(this.low>>>0):this.high*h+(this.low>>>0)},T.toString=function(e){if((e=e||10)<2||36<e)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative()){if(this.eq(w)){var t=s(e),r=this.div(t),n=r.mul(t).sub(this);return r.toString(e)+n.toInt().toString(e)}return"-"+this.neg().toString(e)}for(var i=s(c(e,6),this.unsigned),a=this,o="";;){var u=a.div(i),l=(a.sub(u.mul(i)).toInt()>>>0).toString(e);if((a=u).isZero())return l+o;for(;l.length<6;)l="0"+l;o=""+l+o}},T.getHighBits=function(){return this.high},T.getHighBitsUnsigned=function(){return this.high>>>0},T.getLowBits=function(){return this.low},T.getLowBitsUnsigned=function(){return this.low>>>0},T.getNumBitsAbs=function(){if(this.isNegative())return this.eq(w)?64:this.neg().getNumBitsAbs();for(var e=0!=this.high?this.high:this.low,t=31;t>0&&0==(e&1<<t);t--);return 0!=this.high?t+33:t+1},T.isZero=function(){return 0===this.high&&0===this.low},T.eqz=T.isZero,T.isNegative=function(){return!this.unsigned&&this.high<0},T.isPositive=function(){return this.unsigned||this.high>=0},T.isOdd=function(){return 1==(1&this.low)},T.isEven=function(){return 0==(1&this.low)},T.equals=function(e){return n(e)||(e=f(e)),(this.unsigned===e.unsigned||this.high>>>31!=1||e.high>>>31!=1)&&(this.high===e.high&&this.low===e.low)},T.eq=T.equals,T.notEquals=function(e){return!this.eq(e)},T.neq=T.notEquals,T.ne=T.notEquals,T.lessThan=function(e){return this.comp(e)<0},T.lt=T.lessThan,T.lessThanOrEqual=function(e){return this.comp(e)<=0},T.lte=T.lessThanOrEqual,T.le=T.lessThanOrEqual,T.greaterThan=function(e){return this.comp(e)>0},T.gt=T.greaterThan,T.greaterThanOrEqual=function(e){return this.comp(e)>=0},T.gte=T.greaterThanOrEqual,T.ge=T.greaterThanOrEqual,T.compare=function(e){if(n(e)||(e=f(e)),this.eq(e))return 0;var t=this.isNegative(),r=e.isNegative();return t&&!r?-1:!t&&r?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1},T.comp=T.compare,T.negate=function(){return!this.unsigned&&this.eq(w)?w:this.not().add(m)},T.neg=T.negate,T.add=function(e){n(e)||(e=f(e));var t=this.high>>>16,r=65535&this.high,i=this.low>>>16,a=65535&this.low,o=e.high>>>16,s=65535&e.high,c=e.low>>>16,l=0,h=0,p=0,d=0;return p+=(d+=a+(65535&e.low))>>>16,h+=(p+=i+c)>>>16,l+=(h+=r+s)>>>16,l+=t+o,u((p&=65535)<<16|(d&=65535),(l&=65535)<<16|(h&=65535),this.unsigned)},T.subtract=function(e){return n(e)||(e=f(e)),this.add(e.neg())},T.sub=T.subtract,T.multiply=function(e){if(this.isZero())return v;if(n(e)||(e=f(e)),t)return u(t.mul(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned);if(e.isZero())return v;if(this.eq(w))return e.isOdd()?w:v;if(e.eq(w))return this.isOdd()?w:v;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(y)&&e.lt(y))return s(this.toNumber()*e.toNumber(),this.unsigned);var r=this.high>>>16,i=65535&this.high,a=this.low>>>16,o=65535&this.low,c=e.high>>>16,l=65535&e.high,h=e.low>>>16,p=65535&e.low,d=0,g=0,m=0,b=0;return m+=(b+=o*p)>>>16,g+=(m+=a*p)>>>16,m&=65535,g+=(m+=o*h)>>>16,d+=(g+=i*p)>>>16,g&=65535,d+=(g+=a*h)>>>16,g&=65535,d+=(g+=o*l)>>>16,d+=r*p+i*h+a*l+o*c,u((m&=65535)<<16|(b&=65535),(d&=65535)<<16|(g&=65535),this.unsigned)},T.mul=T.multiply,T.divide=function(e){if(n(e)||(e=f(e)),e.isZero())throw Error("division by zero");var r,i,a;if(t)return this.unsigned||-2147483648!==this.high||-1!==e.low||-1!==e.high?u((this.unsigned?t.div_u:t.div_s)(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned):this;if(this.isZero())return this.unsigned?g:v;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return g;if(e.gt(this.shru(1)))return b;a=g}else{if(this.eq(w))return e.eq(m)||e.eq(E)?w:e.eq(w)?m:(r=this.shr(1).div(e).shl(1)).eq(v)?e.isNegative()?m:E:(i=this.sub(e.mul(r)),a=r.add(i.div(e)));if(e.eq(w))return this.unsigned?g:v;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();a=v}for(i=this;i.gte(e);){r=Math.max(1,Math.floor(i.toNumber()/e.toNumber()));for(var o=Math.ceil(Math.log(r)/Math.LN2),l=o<=48?1:c(2,o-48),h=s(r),p=h.mul(e);p.isNegative()||p.gt(i);)p=(h=s(r-=l,this.unsigned)).mul(e);h.isZero()&&(h=m),a=a.add(h),i=i.sub(p)}return a},T.div=T.divide,T.modulo=function(e){return n(e)||(e=f(e)),t?u((this.unsigned?t.rem_u:t.rem_s)(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned):this.sub(this.div(e).mul(e))},T.mod=T.modulo,T.rem=T.modulo,T.not=function(){return u(~this.low,~this.high,this.unsigned)},T.and=function(e){return n(e)||(e=f(e)),u(this.low&e.low,this.high&e.high,this.unsigned)},T.or=function(e){return n(e)||(e=f(e)),u(this.low|e.low,this.high|e.high,this.unsigned)},T.xor=function(e){return n(e)||(e=f(e)),u(this.low^e.low,this.high^e.high,this.unsigned)},T.shiftLeft=function(e){return n(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?u(this.low<<e,this.high<<e|this.low>>>32-e,this.unsigned):u(0,this.low<<e-32,this.unsigned)},T.shl=T.shiftLeft,T.shiftRight=function(e){return n(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?u(this.low>>>e|this.high<<32-e,this.high>>e,this.unsigned):u(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},T.shr=T.shiftRight,T.shiftRightUnsigned=function(e){if(n(e)&&(e=e.toInt()),0===(e&=63))return this;var t=this.high;return e<32?u(this.low>>>e|t<<32-e,t>>>e,this.unsigned):u(32===e?t:t>>>e-32,0,this.unsigned)},T.shru=T.shiftRightUnsigned,T.shr_u=T.shiftRightUnsigned,T.toSigned=function(){return this.unsigned?u(this.low,this.high,!1):this},T.toUnsigned=function(){return this.unsigned?this:u(this.low,this.high,!0)},T.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},T.toBytesLE=function(){var e=this.high,t=this.low;return[255&t,t>>>8&255,t>>>16&255,t>>>24,255&e,e>>>8&255,e>>>16&255,e>>>24]},T.toBytesBE=function(){var e=this.high,t=this.low;return[e>>>24,e>>>16&255,e>>>8&255,255&e,t>>>24,t>>>16&255,t>>>8&255,255&t]},r.fromBytes=function(e,t,n){return n?r.fromBytesLE(e,t):r.fromBytesBE(e,t)},r.fromBytesLE=function(e,t){return new r(e[0]|e[1]<<8|e[2]<<16|e[3]<<24,e[4]|e[5]<<8|e[6]<<16|e[7]<<24,t)},r.fromBytesBE=function(e,t){return new r(e[4]<<24|e[5]<<16|e[6]<<8|e[7],e[0]<<24|e[1]<<16|e[2]<<8|e[3],t)}},8925:(e,t,r)=>{var n=r(3832);function i(e,t){n.cipher.registerAlgorithm(e,(function(){return new n.aes.Algorithm(e,t)}))}r(5649),r(1967),r(7116),e.exports=n.aes=n.aes||{},n.aes.startEncrypting=function(e,t,r,n){var i=d({key:e,output:r,decrypt:!1,mode:n});return i.start(t),i},n.aes.createEncryptionCipher=function(e,t){return d({key:e,output:null,decrypt:!1,mode:t})},n.aes.startDecrypting=function(e,t,r,n){var i=d({key:e,output:r,decrypt:!0,mode:n});return i.start(t),i},n.aes.createDecryptionCipher=function(e,t){return d({key:e,output:null,decrypt:!0,mode:t})},n.aes.Algorithm=function(e,t){l||f();var r=this;r.name=e,r.mode=new t({blockSize:16,cipher:{encrypt:function(e,t){return p(r._w,e,t,!1)},decrypt:function(e,t){return p(r._w,e,t,!0)}}}),r._init=!1},n.aes.Algorithm.prototype.initialize=function(e){if(!this._init){var t,r=e.key;if("string"!=typeof r||16!==r.length&&24!==r.length&&32!==r.length){if(n.util.isArray(r)&&(16===r.length||24===r.length||32===r.length)){t=r,r=n.util.createBuffer();for(var i=0;i<t.length;++i)r.putByte(t[i])}}else r=n.util.createBuffer(r);if(!n.util.isArray(r)){t=r,r=[];var a=t.length();if(16===a||24===a||32===a){a>>>=2;for(i=0;i<a;++i)r.push(t.getInt32())}}if(!n.util.isArray(r)||4!==r.length&&6!==r.length&&8!==r.length)throw new Error("Invalid key parameter.");var o=this.mode.name,s=-1!==["CFB","OFB","CTR","GCM"].indexOf(o);this._w=h(r,e.decrypt&&!s),this._init=!0}},n.aes._expandKey=function(e,t){return l||f(),h(e,t)},n.aes._updateBlock=p,i("AES-ECB",n.cipher.modes.ecb),i("AES-CBC",n.cipher.modes.cbc),i("AES-CFB",n.cipher.modes.cfb),i("AES-OFB",n.cipher.modes.ofb),i("AES-CTR",n.cipher.modes.ctr),i("AES-GCM",n.cipher.modes.gcm);var a,o,s,u,c,l=!1;function f(){l=!0,s=[0,1,2,4,8,16,32,64,128,27,54];for(var e=new Array(256),t=0;t<128;++t)e[t]=t<<1,e[t+128]=t+128<<1^283;a=new Array(256),o=new Array(256),u=new Array(4),c=new Array(4);for(t=0;t<4;++t)u[t]=new Array(256),c[t]=new Array(256);var r,n,i,f,h,p,d,y=0,v=0;for(t=0;t<256;++t){f=(f=v^v<<1^v<<2^v<<3^v<<4)>>8^255&f^99,a[y]=f,o[f]=y,p=(h=e[f])<<24^f<<16^f<<8^f^h,d=((r=e[y])^(n=e[r])^(i=e[n]))<<24^(y^i)<<16^(y^n^i)<<8^y^r^i;for(var g=0;g<4;++g)u[g][y]=p,c[g][f]=d,p=p<<24|p>>>8,d=d<<24|d>>>8;0===y?y=v=1:(y=r^e[e[e[r^i]]],v^=e[e[v]])}}function h(e,t){for(var r,n=e.slice(0),i=1,o=n.length,u=4*(o+6+1),l=o;l<u;++l)r=n[l-1],l%o==0?(r=a[r>>>16&255]<<24^a[r>>>8&255]<<16^a[255&r]<<8^a[r>>>24]^s[i]<<24,i++):o>6&&l%o==4&&(r=a[r>>>24]<<24^a[r>>>16&255]<<16^a[r>>>8&255]<<8^a[255&r]),n[l]=n[l-o]^r;if(t){for(var f,h=c[0],p=c[1],d=c[2],y=c[3],v=n.slice(0),g=(l=0,(u=n.length)-4);l<u;l+=4,g-=4)if(0===l||l===u-4)v[l]=n[g],v[l+1]=n[g+3],v[l+2]=n[g+2],v[l+3]=n[g+1];else for(var m=0;m<4;++m)f=n[g+m],v[l+(3&-m)]=h[a[f>>>24]]^p[a[f>>>16&255]]^d[a[f>>>8&255]]^y[a[255&f]];n=v}return n}function p(e,t,r,n){var i,s,l,f,h,p,d,y,v,g,m,b,E=e.length/4-1;n?(i=c[0],s=c[1],l=c[2],f=c[3],h=o):(i=u[0],s=u[1],l=u[2],f=u[3],h=a),p=t[0]^e[0],d=t[n?3:1]^e[1],y=t[2]^e[2],v=t[n?1:3]^e[3];for(var S=3,C=1;C<E;++C)g=i[p>>>24]^s[d>>>16&255]^l[y>>>8&255]^f[255&v]^e[++S],m=i[d>>>24]^s[y>>>16&255]^l[v>>>8&255]^f[255&p]^e[++S],b=i[y>>>24]^s[v>>>16&255]^l[p>>>8&255]^f[255&d]^e[++S],v=i[v>>>24]^s[p>>>16&255]^l[d>>>8&255]^f[255&y]^e[++S],p=g,d=m,y=b;r[0]=h[p>>>24]<<24^h[d>>>16&255]<<16^h[y>>>8&255]<<8^h[255&v]^e[++S],r[n?3:1]=h[d>>>24]<<24^h[y>>>16&255]<<16^h[v>>>8&255]<<8^h[255&p]^e[++S],r[2]=h[y>>>24]<<24^h[v>>>16&255]<<16^h[p>>>8&255]<<8^h[255&d]^e[++S],r[n?1:3]=h[v>>>24]<<24^h[p>>>16&255]<<16^h[d>>>8&255]<<8^h[255&y]^e[++S]}function d(e){var t,r="AES-"+((e=e||{}).mode||"CBC").toUpperCase(),i=(t=e.decrypt?n.cipher.createDecipher(r,e.key):n.cipher.createCipher(r,e.key)).start;return t.start=function(e,r){var a=null;r instanceof n.util.ByteBuffer&&(a=r,r={}),(r=r||{}).output=a,r.iv=e,i.call(t,r)},t}},3068:(e,t,r)=>{var n=r(3832);r(7116),r(6270);var i=e.exports=n.asn1=n.asn1||{};function a(e,t,r){if(r>t){var n=new Error("Too few bytes to parse DER.");throw n.available=e.length(),n.remaining=t,n.requested=r,n}}i.Class={UNIVERSAL:0,APPLICATION:64,CONTEXT_SPECIFIC:128,PRIVATE:192},i.Type={NONE:0,BOOLEAN:1,INTEGER:2,BITSTRING:3,OCTETSTRING:4,NULL:5,OID:6,ODESC:7,EXTERNAL:8,REAL:9,ENUMERATED:10,EMBEDDED:11,UTF8:12,ROID:13,SEQUENCE:16,SET:17,PRINTABLESTRING:19,IA5STRING:22,UTCTIME:23,GENERALIZEDTIME:24,BMPSTRING:30},i.create=function(e,t,r,a,o){if(n.util.isArray(a)){for(var s=[],u=0;u<a.length;++u)void 0!==a[u]&&s.push(a[u]);a=s}var c={tagClass:e,type:t,constructed:r,composed:r||n.util.isArray(a),value:a};return o&&"bitStringContents"in o&&(c.bitStringContents=o.bitStringContents,c.original=i.copy(c)),c},i.copy=function(e,t){var r;if(n.util.isArray(e)){r=[];for(var a=0;a<e.length;++a)r.push(i.copy(e[a],t));return r}return"string"==typeof e?e:(r={tagClass:e.tagClass,type:e.type,constructed:e.constructed,composed:e.composed,value:i.copy(e.value,t)},t&&!t.excludeBitStringContents&&(r.bitStringContents=e.bitStringContents),r)},i.equals=function(e,t,r){if(n.util.isArray(e)){if(!n.util.isArray(t))return!1;if(e.length!==t.length)return!1;for(var a=0;a<e.length;++a)if(!i.equals(e[a],t[a]))return!1;return!0}if(typeof e!=typeof t)return!1;if("string"==typeof e)return e===t;var o=e.tagClass===t.tagClass&&e.type===t.type&&e.constructed===t.constructed&&e.composed===t.composed&&i.equals(e.value,t.value);return r&&r.includeBitStringContents&&(o=o&&e.bitStringContents===t.bitStringContents),o},i.getBerValueLength=function(e){var t=e.getByte();if(128!==t)return 128&t?e.getInt((127&t)<<3):t};function o(e,t,r,n){var s;a(e,t,2);var u=e.getByte();t--;var c=192&u,l=31&u;s=e.length();var f,h,p=function(e,t){var r=e.getByte();if(t--,128!==r){var n;if(128&r){var i=127&r;a(e,t,i),n=e.getInt(i<<3)}else n=r;if(n<0)throw new Error("Negative length: "+n);return n}}(e,t);if(t-=s-e.length(),void 0!==p&&p>t){if(n.strict){var d=new Error("Too few bytes to read ASN.1 value.");throw d.available=e.length(),d.remaining=t,d.requested=p,d}p=t}var y=32==(32&u);if(y)if(f=[],void 0===p)for(;;){if(a(e,t,2),e.bytes(2)===String.fromCharCode(0,0)){e.getBytes(2),t-=2;break}s=e.length(),f.push(o(e,t,r+1,n)),t-=s-e.length()}else for(;p>0;)s=e.length(),f.push(o(e,p,r+1,n)),t-=s-e.length(),p-=s-e.length();if(void 0===f&&c===i.Class.UNIVERSAL&&l===i.Type.BITSTRING&&(h=e.bytes(p)),void 0===f&&n.decodeBitStrings&&c===i.Class.UNIVERSAL&&l===i.Type.BITSTRING&&p>1){var v=e.read,g=t,m=0;if(l===i.Type.BITSTRING&&(a(e,t,1),m=e.getByte(),t--),0===m)try{s=e.length();var b=o(e,t,r+1,{verbose:n.verbose,strict:!0,decodeBitStrings:!0}),E=s-e.length();t-=E,l==i.Type.BITSTRING&&E++;var S=b.tagClass;E!==p||S!==i.Class.UNIVERSAL&&S!==i.Class.CONTEXT_SPECIFIC||(f=[b])}catch(e){}void 0===f&&(e.read=v,t=g)}if(void 0===f){if(void 0===p){if(n.strict)throw new Error("Non-constructed ASN.1 object of indefinite length.");p=t}if(l===i.Type.BMPSTRING)for(f="";p>0;p-=2)a(e,t,2),f+=String.fromCharCode(e.getInt16()),t-=2;else f=e.getBytes(p)}var C=void 0===h?null:{bitStringContents:h};return i.create(c,l,y,f,C)}i.fromDer=function(e,t){return void 0===t&&(t={strict:!0,decodeBitStrings:!0}),"boolean"==typeof t&&(t={strict:t,decodeBitStrings:!0}),"strict"in t||(t.strict=!0),"decodeBitStrings"in t||(t.decodeBitStrings=!0),"string"==typeof e&&(e=n.util.createBuffer(e)),o(e,e.length(),0,t)},i.toDer=function(e){var t=n.util.createBuffer(),r=e.tagClass|e.type,a=n.util.createBuffer(),o=!1;if("bitStringContents"in e&&(o=!0,e.original&&(o=i.equals(e,e.original))),o)a.putBytes(e.bitStringContents);else if(e.composed){e.constructed?r|=32:a.putByte(0);for(var s=0;s<e.value.length;++s)void 0!==e.value[s]&&a.putBuffer(i.toDer(e.value[s]))}else if(e.type===i.Type.BMPSTRING)for(s=0;s<e.value.length;++s)a.putInt16(e.value.charCodeAt(s));else e.type===i.Type.INTEGER&&e.value.length>1&&(0===e.value.charCodeAt(0)&&0==(128&e.value.charCodeAt(1))||255===e.value.charCodeAt(0)&&128==(128&e.value.charCodeAt(1)))?a.putBytes(e.value.substr(1)):a.putBytes(e.value);if(t.putByte(r),a.length()<=127)t.putByte(127&a.length());else{var u=a.length(),c="";do{c+=String.fromCharCode(255&u),u>>>=8}while(u>0);t.putByte(128|c.length);for(s=c.length-1;s>=0;--s)t.putByte(c.charCodeAt(s))}return t.putBuffer(a),t},i.oidToDer=function(e){var t,r,i,a,o=e.split("."),s=n.util.createBuffer();s.putByte(40*parseInt(o[0],10)+parseInt(o[1],10));for(var u=2;u<o.length;++u){t=!0,r=[],i=parseInt(o[u],10);do{a=127&i,i>>>=7,t||(a|=128),r.push(a),t=!1}while(i>0);for(var c=r.length-1;c>=0;--c)s.putByte(r[c])}return s},i.derToOid=function(e){var t;"string"==typeof e&&(e=n.util.createBuffer(e));var r=e.getByte();t=Math.floor(r/40)+"."+r%40;for(var i=0;e.length()>0;)i<<=7,128&(r=e.getByte())?i+=127&r:(t+="."+(i+r),i=0);return t},i.utcTimeToDate=function(e){var t=new Date,r=parseInt(e.substr(0,2),10);r=r>=50?1900+r:2e3+r;var n=parseInt(e.substr(2,2),10)-1,i=parseInt(e.substr(4,2),10),a=parseInt(e.substr(6,2),10),o=parseInt(e.substr(8,2),10),s=0;if(e.length>11){var u=e.charAt(10),c=10;"+"!==u&&"-"!==u&&(s=parseInt(e.substr(10,2),10),c+=2)}if(t.setUTCFullYear(r,n,i),t.setUTCHours(a,o,s,0),c&&("+"===(u=e.charAt(c))||"-"===u)){var l=60*parseInt(e.substr(c+1,2),10)+parseInt(e.substr(c+4,2),10);l*=6e4,"+"===u?t.setTime(+t-l):t.setTime(+t+l)}return t},i.generalizedTimeToDate=function(e){var t=new Date,r=parseInt(e.substr(0,4),10),n=parseInt(e.substr(4,2),10)-1,i=parseInt(e.substr(6,2),10),a=parseInt(e.substr(8,2),10),o=parseInt(e.substr(10,2),10),s=parseInt(e.substr(12,2),10),u=0,c=0,l=!1;"Z"===e.charAt(e.length-1)&&(l=!0);var f=e.length-5,h=e.charAt(f);"+"!==h&&"-"!==h||(c=60*parseInt(e.substr(f+1,2),10)+parseInt(e.substr(f+4,2),10),c*=6e4,"+"===h&&(c*=-1),l=!0);return"."===e.charAt(14)&&(u=1e3*parseFloat(e.substr(14),10)),l?(t.setUTCFullYear(r,n,i),t.setUTCHours(a,o,s,u),t.setTime(+t+c)):(t.setFullYear(r,n,i),t.setHours(a,o,s,u)),t},i.dateToUtcTime=function(e){if("string"==typeof e)return e;var t="",r=[];r.push((""+e.getUTCFullYear()).substr(2)),r.push(""+(e.getUTCMonth()+1)),r.push(""+e.getUTCDate()),r.push(""+e.getUTCHours()),r.push(""+e.getUTCMinutes()),r.push(""+e.getUTCSeconds());for(var n=0;n<r.length;++n)r[n].length<2&&(t+="0"),t+=r[n];return t+="Z"},i.dateToGeneralizedTime=function(e){if("string"==typeof e)return e;var t="",r=[];r.push(""+e.getUTCFullYear()),r.push(""+(e.getUTCMonth()+1)),r.push(""+e.getUTCDate()),r.push(""+e.getUTCHours()),r.push(""+e.getUTCMinutes()),r.push(""+e.getUTCSeconds());for(var n=0;n<r.length;++n)r[n].length<2&&(t+="0"),t+=r[n];return t+="Z"},i.integerToDer=function(e){var t=n.util.createBuffer();if(e>=-128&&e<128)return t.putSignedInt(e,8);if(e>=-32768&&e<32768)return t.putSignedInt(e,16);if(e>=-8388608&&e<8388608)return t.putSignedInt(e,24);if(e>=-2147483648&&e<2147483648)return t.putSignedInt(e,32);var r=new Error("Integer too large; max is 32-bits.");throw r.integer=e,r},i.derToInteger=function(e){"string"==typeof e&&(e=n.util.createBuffer(e));var t=8*e.length();if(t>32)throw new Error("Integer too large; max is 32-bits.");return e.getSignedInt(t)},i.validate=function(e,t,r,a){var o=!1;if(e.tagClass!==t.tagClass&&void 0!==t.tagClass||e.type!==t.type&&void 0!==t.type)a&&(e.tagClass!==t.tagClass&&a.push("["+t.name+'] Expected tag class "'+t.tagClass+'", got "'+e.tagClass+'"'),e.type!==t.type&&a.push("["+t.name+'] Expected type "'+t.type+'", got "'+e.type+'"'));else if(e.constructed===t.constructed||void 0===t.constructed){if(o=!0,t.value&&n.util.isArray(t.value))for(var s=0,u=0;o&&u<t.value.length;++u)o=t.value[u].optional||!1,e.value[s]&&((o=i.validate(e.value[s],t.value[u],r,a))?++s:t.value[u].optional&&(o=!0)),!o&&a&&a.push("["+t.name+'] Tag class "'+t.tagClass+'", type "'+t.type+'" expected value length "'+t.value.length+'", got "'+e.value.length+'"');if(o&&r)if(t.capture&&(r[t.capture]=e.value),t.captureAsn1&&(r[t.captureAsn1]=e),t.captureBitStringContents&&"bitStringContents"in e&&(r[t.captureBitStringContents]=e.bitStringContents),t.captureBitStringValue&&"bitStringContents"in e)if(e.bitStringContents.length<2)r[t.captureBitStringValue]="";else{if(0!==e.bitStringContents.charCodeAt(0))throw new Error("captureBitStringValue only supported for zero unused bits");r[t.captureBitStringValue]=e.bitStringContents.slice(1)}}else a&&a.push("["+t.name+'] Expected constructed "'+t.constructed+'", got "'+e.constructed+'"');return o};var s=/[^\\u0000-\\u00ff]/;i.prettyPrint=function(e,t,r){var a="";r=r||2,(t=t||0)>0&&(a+="\n");for(var o="",u=0;u<t*r;++u)o+=" ";switch(a+=o+"Tag: ",e.tagClass){case i.Class.UNIVERSAL:a+="Universal:";break;case i.Class.APPLICATION:a+="Application:";break;case i.Class.CONTEXT_SPECIFIC:a+="Context-Specific:";break;case i.Class.PRIVATE:a+="Private:"}if(e.tagClass===i.Class.UNIVERSAL)switch(a+=e.type,e.type){case i.Type.NONE:a+=" (None)";break;case i.Type.BOOLEAN:a+=" (Boolean)";break;case i.Type.INTEGER:a+=" (Integer)";break;case i.Type.BITSTRING:a+=" (Bit string)";break;case i.Type.OCTETSTRING:a+=" (Octet string)";break;case i.Type.NULL:a+=" (Null)";break;case i.Type.OID:a+=" (Object Identifier)";break;case i.Type.ODESC:a+=" (Object Descriptor)";break;case i.Type.EXTERNAL:a+=" (External or Instance of)";break;case i.Type.REAL:a+=" (Real)";break;case i.Type.ENUMERATED:a+=" (Enumerated)";break;case i.Type.EMBEDDED:a+=" (Embedded PDV)";break;case i.Type.UTF8:a+=" (UTF8)";break;case i.Type.ROID:a+=" (Relative Object Identifier)";break;case i.Type.SEQUENCE:a+=" (Sequence)";break;case i.Type.SET:a+=" (Set)";break;case i.Type.PRINTABLESTRING:a+=" (Printable String)";break;case i.Type.IA5String:a+=" (IA5String (ASCII))";break;case i.Type.UTCTIME:a+=" (UTC time)";break;case i.Type.GENERALIZEDTIME:a+=" (Generalized time)";break;case i.Type.BMPSTRING:a+=" (BMP String)"}else a+=e.type;if(a+="\n",a+=o+"Constructed: "+e.constructed+"\n",e.composed){var c=0,l="";for(u=0;u<e.value.length;++u)void 0!==e.value[u]&&(c+=1,l+=i.prettyPrint(e.value[u],t+1,r),u+1<e.value.length&&(l+=","));a+=o+"Sub values: "+c+l}else{if(a+=o+"Value: ",e.type===i.Type.OID){var f=i.derToOid(e.value);a+=f,n.pki&&n.pki.oids&&f in n.pki.oids&&(a+=" ("+n.pki.oids[f]+") ")}if(e.type===i.Type.INTEGER)try{a+=i.derToInteger(e.value)}catch(t){a+="0x"+n.util.bytesToHex(e.value)}else if(e.type===i.Type.BITSTRING){if(e.value.length>1?a+="0x"+n.util.bytesToHex(e.value.slice(1)):a+="(none)",e.value.length>0){var h=e.value.charCodeAt(0);1==h?a+=" (1 unused bit shown)":h>1&&(a+=" ("+h+" unused bits shown)")}}else e.type===i.Type.OCTETSTRING?(s.test(e.value)||(a+="("+e.value+") "),a+="0x"+n.util.bytesToHex(e.value)):e.type===i.Type.UTF8?a+=n.util.decodeUtf8(e.value):e.type===i.Type.PRINTABLESTRING||e.type===i.Type.IA5String?a+=e.value:s.test(e.value)?a+="0x"+n.util.bytesToHex(e.value):0===e.value.length?a+="[null]":a+=e.value}return a}},8807:e=>{var t={};e.exports=t;var r={};t.encode=function(e,t,r){if("string"!=typeof t)throw new TypeError('"alphabet" must be a string.');if(void 0!==r&&"number"!=typeof r)throw new TypeError('"maxline" must be a number.');var n="";if(e instanceof Uint8Array){var i=0,a=t.length,o=t.charAt(0),s=[0];for(i=0;i<e.length;++i){for(var u=0,c=e[i];u<s.length;++u)c+=s[u]<<8,s[u]=c%a,c=c/a|0;for(;c>0;)s.push(c%a),c=c/a|0}for(i=0;0===e[i]&&i<e.length-1;++i)n+=o;for(i=s.length-1;i>=0;--i)n+=t[s[i]]}else n=function(e,t){var r=0,n=t.length,i=t.charAt(0),a=[0];for(r=0;r<e.length();++r){for(var o=0,s=e.at(r);o<a.length;++o)s+=a[o]<<8,a[o]=s%n,s=s/n|0;for(;s>0;)a.push(s%n),s=s/n|0}var u="";for(r=0;0===e.at(r)&&r<e.length()-1;++r)u+=i;for(r=a.length-1;r>=0;--r)u+=t[a[r]];return u}(e,t);if(r){var l=new RegExp(".{1,"+r+"}","g");n=n.match(l).join("\r\n")}return n},t.decode=function(e,t){if("string"!=typeof e)throw new TypeError('"input" must be a string.');if("string"!=typeof t)throw new TypeError('"alphabet" must be a string.');var n=r[t];if(!n){n=r[t]=[];for(var i=0;i<t.length;++i)n[t.charCodeAt(i)]=i}e=e.replace(/\s/g,"");var a=t.length,o=t.charAt(0),s=[0];for(i=0;i<e.length;i++){var u=n[e.charCodeAt(i)];if(void 0===u)return;for(var c=0,l=u;c<s.length;++c)l+=s[c]*a,s[c]=255&l,l>>=8;for(;l>0;)s.push(255&l),l>>=8}for(var f=0;e[f]===o&&f<e.length-1;++f)s.push(0);return"undefined"!=typeof Buffer?Buffer.from(s.reverse()):new Uint8Array(s.reverse())}},5649:(e,t,r)=>{var n=r(3832);r(7116),e.exports=n.cipher=n.cipher||{},n.cipher.algorithms=n.cipher.algorithms||{},n.cipher.createCipher=function(e,t){var r=e;if("string"==typeof r&&(r=n.cipher.getAlgorithm(r))&&(r=r()),!r)throw new Error("Unsupported algorithm: "+e);return new n.cipher.BlockCipher({algorithm:r,key:t,decrypt:!1})},n.cipher.createDecipher=function(e,t){var r=e;if("string"==typeof r&&(r=n.cipher.getAlgorithm(r))&&(r=r()),!r)throw new Error("Unsupported algorithm: "+e);return new n.cipher.BlockCipher({algorithm:r,key:t,decrypt:!0})},n.cipher.registerAlgorithm=function(e,t){e=e.toUpperCase(),n.cipher.algorithms[e]=t},n.cipher.getAlgorithm=function(e){return(e=e.toUpperCase())in n.cipher.algorithms?n.cipher.algorithms[e]:null};var i=n.cipher.BlockCipher=function(e){this.algorithm=e.algorithm,this.mode=this.algorithm.mode,this.blockSize=this.mode.blockSize,this._finish=!1,this._input=null,this.output=null,this._op=e.decrypt?this.mode.decrypt:this.mode.encrypt,this._decrypt=e.decrypt,this.algorithm.initialize(e)};i.prototype.start=function(e){e=e||{};var t={};for(var r in e)t[r]=e[r];t.decrypt=this._decrypt,this._finish=!1,this._input=n.util.createBuffer(),this.output=e.output||n.util.createBuffer(),this.mode.start(t)},i.prototype.update=function(e){for(e&&this._input.putBuffer(e);!this._op.call(this.mode,this._input,this.output,this._finish)&&!this._finish;);this._input.compact()},i.prototype.finish=function(e){!e||"ECB"!==this.mode.name&&"CBC"!==this.mode.name||(this.mode.pad=function(t){return e(this.blockSize,t,!1)},this.mode.unpad=function(t){return e(this.blockSize,t,!0)});var t={};return t.decrypt=this._decrypt,t.overflow=this._input.length()%this.blockSize,!(!this._decrypt&&this.mode.pad&&!this.mode.pad(this._input,t))&&(this._finish=!0,this.update(),!(this._decrypt&&this.mode.unpad&&!this.mode.unpad(this.output,t))&&!(this.mode.afterFinish&&!this.mode.afterFinish(this.output,t)))}},1967:(e,t,r)=>{var n=r(3832);r(7116),n.cipher=n.cipher||{};var i=e.exports=n.cipher.modes=n.cipher.modes||{};function a(e,t){if("string"==typeof e&&(e=n.util.createBuffer(e)),n.util.isArray(e)&&e.length>4){var r=e;e=n.util.createBuffer();for(var i=0;i<r.length;++i)e.putByte(r[i])}if(e.length()<t)throw new Error("Invalid IV length; got "+e.length()+" bytes and expected "+t+" bytes.");if(!n.util.isArray(e)){var a=[],o=t/4;for(i=0;i<o;++i)a.push(e.getInt32());e=a}return e}function o(e){e[e.length-1]=e[e.length-1]+1&4294967295}function s(e){return[e/4294967296|0,4294967295&e]}i.ecb=function(e){e=e||{},this.name="ECB",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)},i.ecb.prototype.start=function(e){},i.ecb.prototype.encrypt=function(e,t,r){if(e.length()<this.blockSize&&!(r&&e.length()>0))return!0;for(var n=0;n<this._ints;++n)this._inBlock[n]=e.getInt32();this.cipher.encrypt(this._inBlock,this._outBlock);for(n=0;n<this._ints;++n)t.putInt32(this._outBlock[n])},i.ecb.prototype.decrypt=function(e,t,r){if(e.length()<this.blockSize&&!(r&&e.length()>0))return!0;for(var n=0;n<this._ints;++n)this._inBlock[n]=e.getInt32();this.cipher.decrypt(this._inBlock,this._outBlock);for(n=0;n<this._ints;++n)t.putInt32(this._outBlock[n])},i.ecb.prototype.pad=function(e,t){var r=e.length()===this.blockSize?this.blockSize:this.blockSize-e.length();return e.fillWithByte(r,r),!0},i.ecb.prototype.unpad=function(e,t){if(t.overflow>0)return!1;var r=e.length(),n=e.at(r-1);return!(n>this.blockSize<<2)&&(e.truncate(n),!0)},i.cbc=function(e){e=e||{},this.name="CBC",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)},i.cbc.prototype.start=function(e){if(null===e.iv){if(!this._prev)throw new Error("Invalid IV parameter.");this._iv=this._prev.slice(0)}else{if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=a(e.iv,this.blockSize),this._prev=this._iv.slice(0)}},i.cbc.prototype.encrypt=function(e,t,r){if(e.length()<this.blockSize&&!(r&&e.length()>0))return!0;for(var n=0;n<this._ints;++n)this._inBlock[n]=this._prev[n]^e.getInt32();this.cipher.encrypt(this._inBlock,this._outBlock);for(n=0;n<this._ints;++n)t.putInt32(this._outBlock[n]);this._prev=this._outBlock},i.cbc.prototype.decrypt=function(e,t,r){if(e.length()<this.blockSize&&!(r&&e.length()>0))return!0;for(var n=0;n<this._ints;++n)this._inBlock[n]=e.getInt32();this.cipher.decrypt(this._inBlock,this._outBlock);for(n=0;n<this._ints;++n)t.putInt32(this._prev[n]^this._outBlock[n]);this._prev=this._inBlock.slice(0)},i.cbc.prototype.pad=function(e,t){var r=e.length()===this.blockSize?this.blockSize:this.blockSize-e.length();return e.fillWithByte(r,r),!0},i.cbc.prototype.unpad=function(e,t){if(t.overflow>0)return!1;var r=e.length(),n=e.at(r-1);return!(n>this.blockSize<<2)&&(e.truncate(n),!0)},i.cfb=function(e){e=e||{},this.name="CFB",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialBlock=new Array(this._ints),this._partialOutput=n.util.createBuffer(),this._partialBytes=0},i.cfb.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=a(e.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},i.cfb.prototype.encrypt=function(e,t,r){var n=e.length();if(0===n)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize)for(var i=0;i<this._ints;++i)this._inBlock[i]=e.getInt32()^this._outBlock[i],t.putInt32(this._inBlock[i]);else{var a=(this.blockSize-n)%this.blockSize;a>0&&(a=this.blockSize-a),this._partialOutput.clear();for(i=0;i<this._ints;++i)this._partialBlock[i]=e.getInt32()^this._outBlock[i],this._partialOutput.putInt32(this._partialBlock[i]);if(a>0)e.read-=this.blockSize;else for(i=0;i<this._ints;++i)this._inBlock[i]=this._partialBlock[i];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),a>0&&!r)return t.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=a,!0;t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}},i.cfb.prototype.decrypt=function(e,t,r){var n=e.length();if(0===n)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize)for(var i=0;i<this._ints;++i)this._inBlock[i]=e.getInt32(),t.putInt32(this._inBlock[i]^this._outBlock[i]);else{var a=(this.blockSize-n)%this.blockSize;a>0&&(a=this.blockSize-a),this._partialOutput.clear();for(i=0;i<this._ints;++i)this._partialBlock[i]=e.getInt32(),this._partialOutput.putInt32(this._partialBlock[i]^this._outBlock[i]);if(a>0)e.read-=this.blockSize;else for(i=0;i<this._ints;++i)this._inBlock[i]=this._partialBlock[i];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),a>0&&!r)return t.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=a,!0;t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}},i.ofb=function(e){e=e||{},this.name="OFB",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=n.util.createBuffer(),this._partialBytes=0},i.ofb.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=a(e.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},i.ofb.prototype.encrypt=function(e,t,r){var n=e.length();if(0===e.length())return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize)for(var i=0;i<this._ints;++i)t.putInt32(e.getInt32()^this._outBlock[i]),this._inBlock[i]=this._outBlock[i];else{var a=(this.blockSize-n)%this.blockSize;a>0&&(a=this.blockSize-a),this._partialOutput.clear();for(i=0;i<this._ints;++i)this._partialOutput.putInt32(e.getInt32()^this._outBlock[i]);if(a>0)e.read-=this.blockSize;else for(i=0;i<this._ints;++i)this._inBlock[i]=this._outBlock[i];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),a>0&&!r)return t.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=a,!0;t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}},i.ofb.prototype.decrypt=i.ofb.prototype.encrypt,i.ctr=function(e){e=e||{},this.name="CTR",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=n.util.createBuffer(),this._partialBytes=0},i.ctr.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=a(e.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},i.ctr.prototype.encrypt=function(e,t,r){var n=e.length();if(0===n)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize)for(var i=0;i<this._ints;++i)t.putInt32(e.getInt32()^this._outBlock[i]);else{var a=(this.blockSize-n)%this.blockSize;a>0&&(a=this.blockSize-a),this._partialOutput.clear();for(i=0;i<this._ints;++i)this._partialOutput.putInt32(e.getInt32()^this._outBlock[i]);if(a>0&&(e.read-=this.blockSize),this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),a>0&&!r)return t.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=a,!0;t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}o(this._inBlock)},i.ctr.prototype.decrypt=i.ctr.prototype.encrypt,i.gcm=function(e){e=e||{},this.name="GCM",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints),this._partialOutput=n.util.createBuffer(),this._partialBytes=0,this._R=3774873600},i.gcm.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");var t,r=n.util.createBuffer(e.iv);if(this._cipherLength=0,t="additionalData"in e?n.util.createBuffer(e.additionalData):n.util.createBuffer(),this._tagLength="tagLength"in e?e.tagLength:128,this._tag=null,e.decrypt&&(this._tag=n.util.createBuffer(e.tag).getBytes(),this._tag.length!==this._tagLength/8))throw new Error("Authentication tag does not match tag length.");this._hashBlock=new Array(this._ints),this.tag=null,this._hashSubkey=new Array(this._ints),this.cipher.encrypt([0,0,0,0],this._hashSubkey),this.componentBits=4,this._m=this.generateHashTable(this._hashSubkey,this.componentBits);var i=r.length();if(12===i)this._j0=[r.getInt32(),r.getInt32(),r.getInt32(),1];else{for(this._j0=[0,0,0,0];r.length()>0;)this._j0=this.ghash(this._hashSubkey,this._j0,[r.getInt32(),r.getInt32(),r.getInt32(),r.getInt32()]);this._j0=this.ghash(this._hashSubkey,this._j0,[0,0].concat(s(8*i)))}this._inBlock=this._j0.slice(0),o(this._inBlock),this._partialBytes=0,t=n.util.createBuffer(t),this._aDataLength=s(8*t.length());var a=t.length()%this.blockSize;for(a&&t.fillWithByte(0,this.blockSize-a),this._s=[0,0,0,0];t.length()>0;)this._s=this.ghash(this._hashSubkey,this._s,[t.getInt32(),t.getInt32(),t.getInt32(),t.getInt32()])},i.gcm.prototype.encrypt=function(e,t,r){var n=e.length();if(0===n)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize){for(var i=0;i<this._ints;++i)t.putInt32(this._outBlock[i]^=e.getInt32());this._cipherLength+=this.blockSize}else{var a=(this.blockSize-n)%this.blockSize;a>0&&(a=this.blockSize-a),this._partialOutput.clear();for(i=0;i<this._ints;++i)this._partialOutput.putInt32(e.getInt32()^this._outBlock[i]);if(a<=0||r){if(r){var s=n%this.blockSize;this._cipherLength+=s,this._partialOutput.truncate(this.blockSize-s)}else this._cipherLength+=this.blockSize;for(i=0;i<this._ints;++i)this._outBlock[i]=this._partialOutput.getInt32();this._partialOutput.read-=this.blockSize}if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),a>0&&!r)return e.read-=this.blockSize,t.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=a,!0;t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}this._s=this.ghash(this._hashSubkey,this._s,this._outBlock),o(this._inBlock)},i.gcm.prototype.decrypt=function(e,t,r){var n=e.length();if(n<this.blockSize&&!(r&&n>0))return!0;this.cipher.encrypt(this._inBlock,this._outBlock),o(this._inBlock),this._hashBlock[0]=e.getInt32(),this._hashBlock[1]=e.getInt32(),this._hashBlock[2]=e.getInt32(),this._hashBlock[3]=e.getInt32(),this._s=this.ghash(this._hashSubkey,this._s,this._hashBlock);for(var i=0;i<this._ints;++i)t.putInt32(this._outBlock[i]^this._hashBlock[i]);n<this.blockSize?this._cipherLength+=n%this.blockSize:this._cipherLength+=this.blockSize},i.gcm.prototype.afterFinish=function(e,t){var r=!0;t.decrypt&&t.overflow&&e.truncate(this.blockSize-t.overflow),this.tag=n.util.createBuffer();var i=this._aDataLength.concat(s(8*this._cipherLength));this._s=this.ghash(this._hashSubkey,this._s,i);var a=[];this.cipher.encrypt(this._j0,a);for(var o=0;o<this._ints;++o)this.tag.putInt32(this._s[o]^a[o]);return this.tag.truncate(this.tag.length()%(this._tagLength/8)),t.decrypt&&this.tag.bytes()!==this._tag&&(r=!1),r},i.gcm.prototype.multiply=function(e,t){for(var r=[0,0,0,0],n=t.slice(0),i=0;i<128;++i){e[i/32|0]&1<<31-i%32&&(r[0]^=n[0],r[1]^=n[1],r[2]^=n[2],r[3]^=n[3]),this.pow(n,n)}return r},i.gcm.prototype.pow=function(e,t){for(var r=1&e[3],n=3;n>0;--n)t[n]=e[n]>>>1|(1&e[n-1])<<31;t[0]=e[0]>>>1,r&&(t[0]^=this._R)},i.gcm.prototype.tableMultiply=function(e){for(var t=[0,0,0,0],r=0;r<32;++r){var n=e[r/8|0]>>>4*(7-r%8)&15,i=this._m[r][n];t[0]^=i[0],t[1]^=i[1],t[2]^=i[2],t[3]^=i[3]}return t},i.gcm.prototype.ghash=function(e,t,r){return t[0]^=r[0],t[1]^=r[1],t[2]^=r[2],t[3]^=r[3],this.tableMultiply(t)},i.gcm.prototype.generateHashTable=function(e,t){for(var r=8/t,n=4*r,i=16*r,a=new Array(i),o=0;o<i;++o){var s=[0,0,0,0],u=(n-1-o%n)*t;s[o/n|0]=1<<t-1<<u,a[o]=this.generateSubHashTable(this.multiply(s,e),t)}return a},i.gcm.prototype.generateSubHashTable=function(e,t){var r=1<<t,n=r>>>1,i=new Array(r);i[n]=e.slice(0);for(var a=n>>>1;a>0;)this.pow(i[2*a],i[a]=[]),a>>=1;for(a=2;a<n;){for(var o=1;o<a;++o){var s=i[a],u=i[o];i[a+o]=[s[0]^u[0],s[1]^u[1],s[2]^u[2],s[3]^u[3]]}a*=2}for(i[0]=[0,0,0,0],a=n+1;a<r;++a){var c=i[a^n];i[a]=[e[0]^c[0],e[1]^c[1],e[2]^c[2],e[3]^c[3]]}return i}},3480:(e,t,r)=>{var n=r(3832);function i(e,t){n.cipher.registerAlgorithm(e,(function(){return new n.des.Algorithm(e,t)}))}r(5649),r(1967),r(7116),e.exports=n.des=n.des||{},n.des.startEncrypting=function(e,t,r,n){var i=d({key:e,output:r,decrypt:!1,mode:n||(null===t?"ECB":"CBC")});return i.start(t),i},n.des.createEncryptionCipher=function(e,t){return d({key:e,output:null,decrypt:!1,mode:t})},n.des.startDecrypting=function(e,t,r,n){var i=d({key:e,output:r,decrypt:!0,mode:n||(null===t?"ECB":"CBC")});return i.start(t),i},n.des.createDecryptionCipher=function(e,t){return d({key:e,output:null,decrypt:!0,mode:t})},n.des.Algorithm=function(e,t){var r=this;r.name=e,r.mode=new t({blockSize:8,cipher:{encrypt:function(e,t){return p(r._keys,e,t,!1)},decrypt:function(e,t){return p(r._keys,e,t,!0)}}}),r._init=!1},n.des.Algorithm.prototype.initialize=function(e){if(!this._init){var t=n.util.createBuffer(e.key);if(0===this.name.indexOf("3DES")&&24!==t.length())throw new Error("Invalid Triple-DES key size: "+8*t.length());this._keys=function(e){for(var t,r=[0,4,536870912,536870916,65536,65540,536936448,536936452,512,516,536871424,536871428,66048,66052,536936960,536936964],n=[0,1,1048576,1048577,67108864,67108865,68157440,68157441,256,257,1048832,1048833,67109120,67109121,68157696,68157697],i=[0,8,2048,2056,16777216,16777224,16779264,16779272,0,8,2048,2056,16777216,16777224,16779264,16779272],a=[0,2097152,134217728,136314880,8192,2105344,134225920,136323072,131072,2228224,134348800,136445952,139264,2236416,134356992,136454144],o=[0,262144,16,262160,0,262144,16,262160,4096,266240,4112,266256,4096,266240,4112,266256],s=[0,1024,32,1056,0,1024,32,1056,33554432,33555456,33554464,33555488,33554432,33555456,33554464,33555488],u=[0,268435456,524288,268959744,2,268435458,524290,268959746,0,268435456,524288,268959744,2,268435458,524290,268959746],c=[0,65536,2048,67584,536870912,536936448,536872960,536938496,131072,196608,133120,198656,537001984,537067520,537004032,537069568],l=[0,262144,0,262144,2,262146,2,262146,33554432,33816576,33554432,33816576,33554434,33816578,33554434,33816578],f=[0,268435456,8,268435464,0,268435456,8,268435464,1024,268436480,1032,268436488,1024,268436480,1032,268436488],h=[0,32,0,32,1048576,1048608,1048576,1048608,8192,8224,8192,8224,1056768,1056800,1056768,1056800],p=[0,16777216,512,16777728,2097152,18874368,2097664,18874880,67108864,83886080,67109376,83886592,69206016,85983232,69206528,85983744],d=[0,4096,134217728,134221824,524288,528384,134742016,134746112,16,4112,134217744,134221840,524304,528400,134742032,134746128],y=[0,4,256,260,0,4,256,260,1,5,257,261,1,5,257,261],v=e.length()>8?3:1,g=[],m=[0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0],b=0,E=0;E<v;E++){var S=e.getInt32(),C=e.getInt32();S^=(t=252645135&(S>>>4^C))<<4,S^=t=65535&((C^=t)>>>-16^S),S^=(t=858993459&(S>>>2^(C^=t<<-16)))<<2,S^=t=65535&((C^=t)>>>-16^S),S^=(t=1431655765&(S>>>1^(C^=t<<-16)))<<1,S^=t=16711935&((C^=t)>>>8^S),t=(S^=(t=1431655765&(S>>>1^(C^=t<<8)))<<1)<<8|(C^=t)>>>20&240,S=C<<24|C<<8&16711680|C>>>8&65280|C>>>24&240,C=t;for(var w=0;w<m.length;++w){m[w]?(S=S<<2|S>>>26,C=C<<2|C>>>26):(S=S<<1|S>>>27,C=C<<1|C>>>27),C&=-15;var T=r[(S&=-15)>>>28]|n[S>>>24&15]|i[S>>>20&15]|a[S>>>16&15]|o[S>>>12&15]|s[S>>>8&15]|u[S>>>4&15],A=c[C>>>28]|l[C>>>24&15]|f[C>>>20&15]|h[C>>>16&15]|p[C>>>12&15]|d[C>>>8&15]|y[C>>>4&15];t=65535&(A>>>16^T),g[b++]=T^t,g[b++]=A^t<<16}}return g}(t),this._init=!0}},i("DES-ECB",n.cipher.modes.ecb),i("DES-CBC",n.cipher.modes.cbc),i("DES-CFB",n.cipher.modes.cfb),i("DES-OFB",n.cipher.modes.ofb),i("DES-CTR",n.cipher.modes.ctr),i("3DES-ECB",n.cipher.modes.ecb),i("3DES-CBC",n.cipher.modes.cbc),i("3DES-CFB",n.cipher.modes.cfb),i("3DES-OFB",n.cipher.modes.ofb),i("3DES-CTR",n.cipher.modes.ctr);var a=[16843776,0,65536,16843780,16842756,66564,4,65536,1024,16843776,16843780,1024,16778244,16842756,16777216,4,1028,16778240,16778240,66560,66560,16842752,16842752,16778244,65540,16777220,16777220,65540,0,1028,66564,16777216,65536,16843780,4,16842752,16843776,16777216,16777216,1024,16842756,65536,66560,16777220,1024,4,16778244,66564,16843780,65540,16842752,16778244,16777220,1028,66564,16843776,1028,16778240,16778240,0,65540,66560,0,16842756],o=[-2146402272,-2147450880,32768,1081376,1048576,32,-2146435040,-2147450848,-2147483616,-2146402272,-2146402304,-2147483648,-2147450880,1048576,32,-2146435040,1081344,1048608,-2147450848,0,-2147483648,32768,1081376,-2146435072,1048608,-2147483616,0,1081344,32800,-2146402304,-2146435072,32800,0,1081376,-2146435040,1048576,-2147450848,-2146435072,-2146402304,32768,-2146435072,-2147450880,32,-2146402272,1081376,32,32768,-2147483648,32800,-2146402304,1048576,-2147483616,1048608,-2147450848,-2147483616,1048608,1081344,0,-2147450880,32800,-2147483648,-2146435040,-2146402272,1081344],s=[520,134349312,0,134348808,134218240,0,131592,134218240,131080,134217736,134217736,131072,134349320,131080,134348800,520,134217728,8,134349312,512,131584,134348800,134348808,131592,134218248,131584,131072,134218248,8,134349320,512,134217728,134349312,134217728,131080,520,131072,134349312,134218240,0,512,131080,134349320,134218240,134217736,512,0,134348808,134218248,131072,134217728,134349320,8,131592,131584,134217736,134348800,134218248,520,134348800,131592,8,134348808,131584],u=[8396801,8321,8321,128,8396928,8388737,8388609,8193,0,8396800,8396800,8396929,129,0,8388736,8388609,1,8192,8388608,8396801,128,8388608,8193,8320,8388737,1,8320,8388736,8192,8396928,8396929,129,8388736,8388609,8396800,8396929,129,0,0,8396800,8320,8388736,8388737,1,8396801,8321,8321,128,8396929,129,1,8192,8388609,8193,8396928,8388737,8193,8320,8388608,8396801,128,8388608,8192,8396928],c=[256,34078976,34078720,1107296512,524288,256,1073741824,34078720,1074266368,524288,33554688,1074266368,1107296512,1107820544,524544,1073741824,33554432,1074266112,1074266112,0,1073742080,1107820800,1107820800,33554688,1107820544,1073742080,0,1107296256,34078976,33554432,1107296256,524544,524288,1107296512,256,33554432,1073741824,34078720,1107296512,1074266368,33554688,1073741824,1107820544,34078976,1074266368,256,33554432,1107820544,1107820800,524544,1107296256,1107820800,34078720,0,1074266112,1107296256,524544,33554688,1073742080,524288,0,1074266112,34078976,1073742080],l=[536870928,541065216,16384,541081616,541065216,16,541081616,4194304,536887296,4210704,4194304,536870928,4194320,536887296,536870912,16400,0,4194320,536887312,16384,4210688,536887312,16,541065232,541065232,0,4210704,541081600,16400,4210688,541081600,536870912,536887296,16,541065232,4210688,541081616,4194304,16400,536870928,4194304,536887296,536870912,16400,536870928,541081616,4210688,541065216,4210704,541081600,0,541065232,16,16384,541065216,4210704,16384,4194320,536887312,0,541081600,536870912,4194320,536887312],f=[2097152,69206018,67110914,0,2048,67110914,2099202,69208064,69208066,2097152,0,67108866,2,67108864,69206018,2050,67110912,2099202,2097154,67110912,67108866,69206016,69208064,2097154,69206016,2048,2050,69208066,2099200,2,67108864,2099200,67108864,2099200,2097152,67110914,67110914,69206018,69206018,2,2097154,67108864,67110912,2097152,69208064,2050,2099202,69208064,2050,67108866,69208066,69206016,2099200,0,2,69208066,0,2099202,69206016,2048,67108866,67110912,2048,2097154],h=[268439616,4096,262144,268701760,268435456,268439616,64,268435456,262208,268697600,268701760,266240,268701696,266304,4096,64,268697600,268435520,268439552,4160,266240,262208,268697664,268701696,4160,0,0,268697664,268435520,268439552,266304,262144,266304,262144,268701696,4096,64,268697664,4096,266304,268439552,64,268435520,268697600,268697664,268435456,262144,268439616,0,268701760,262208,268435520,268697600,268439552,268439616,0,268701760,266240,266240,4160,4160,262208,268435456,268701696];function p(e,t,r,n){var i,p,d=32===e.length?3:9;i=3===d?n?[30,-2,-2]:[0,32,2]:n?[94,62,-2,32,64,2,30,-2,-2]:[0,32,2,62,30,-2,64,96,2];var y=t[0],v=t[1];y^=(p=252645135&(y>>>4^v))<<4,y^=(p=65535&(y>>>16^(v^=p)))<<16,y^=p=858993459&((v^=p)>>>2^y),y^=p=16711935&((v^=p<<2)>>>8^y),y=(y^=(p=1431655765&(y>>>1^(v^=p<<8)))<<1)<<1|y>>>31,v=(v^=p)<<1|v>>>31;for(var g=0;g<d;g+=3){for(var m=i[g+1],b=i[g+2],E=i[g];E!=m;E+=b){var S=v^e[E],C=(v>>>4|v<<28)^e[E+1];p=y,y=v,v=p^(o[S>>>24&63]|u[S>>>16&63]|l[S>>>8&63]|h[63&S]|a[C>>>24&63]|s[C>>>16&63]|c[C>>>8&63]|f[63&C])}p=y,y=v,v=p}v=v>>>1|v<<31,v^=p=1431655765&((y=y>>>1|y<<31)>>>1^v),v^=(p=16711935&(v>>>8^(y^=p<<1)))<<8,v^=(p=858993459&(v>>>2^(y^=p)))<<2,v^=p=65535&((y^=p)>>>16^v),v^=p=252645135&((y^=p<<16)>>>4^v),y^=p<<4,r[0]=y,r[1]=v}function d(e){var t,r="DES-"+((e=e||{}).mode||"CBC").toUpperCase(),i=(t=e.decrypt?n.cipher.createDecipher(r,e.key):n.cipher.createCipher(r,e.key)).start;return t.start=function(e,r){var a=null;r instanceof n.util.ByteBuffer&&(a=r,r={}),(r=r||{}).output=a,r.iv=e,i.call(t,r)},t}},3832:e=>{e.exports={options:{usePureJavaScript:!1}}},6607:(e,t,r)=>{var n=r(3832);r(8991),r(7116),(e.exports=n.hmac=n.hmac||{}).create=function(){var e=null,t=null,r=null,i=null,a={start:function(a,o){if(null!==a)if("string"==typeof a){if(!((a=a.toLowerCase())in n.md.algorithms))throw new Error('Unknown hash algorithm "'+a+'"');t=n.md.algorithms[a].create()}else t=a;if(null===o)o=e;else{if("string"==typeof o)o=n.util.createBuffer(o);else if(n.util.isArray(o)){var s=o;o=n.util.createBuffer();for(var u=0;u<s.length;++u)o.putByte(s[u])}var c=o.length();c>t.blockLength&&(t.start(),t.update(o.bytes()),o=t.digest()),r=n.util.createBuffer(),i=n.util.createBuffer(),c=o.length();for(u=0;u<c;++u){s=o.at(u);r.putByte(54^s),i.putByte(92^s)}if(c<t.blockLength)for(s=t.blockLength-c,u=0;u<s;++u)r.putByte(54),i.putByte(92);e=o,r=r.bytes(),i=i.bytes()}t.start(),t.update(r)},update:function(e){t.update(e)},getMac:function(){var e=t.digest().bytes();return t.start(),t.update(i),t.update(e),t.digest()}};return a.digest=a.getMac,a}},5764:(e,t,r)=>{var n,i=r(3832);e.exports=i.jsbn=i.jsbn||{};function a(e,t,r){this.data=[],null!=e&&("number"==typeof e?this.fromNumber(e,t,r):null==t&&"string"!=typeof e?this.fromString(e,256):this.fromString(e,t))}function o(){return new a(null)}function s(e,t,r,n,i,a){for(var o=16383&t,s=t>>14;--a>=0;){var u=16383&this.data[e],c=this.data[e++]>>14,l=s*u+c*o;i=((u=o*u+((16383&l)<<14)+r.data[n]+i)>>28)+(l>>14)+s*c,r.data[n++]=268435455&u}return i}i.jsbn.BigInteger=a,"undefined"==typeof navigator?(a.prototype.am=s,n=28):"Microsoft Internet Explorer"==navigator.appName?(a.prototype.am=function(e,t,r,n,i,a){for(var o=32767&t,s=t>>15;--a>=0;){var u=32767&this.data[e],c=this.data[e++]>>15,l=s*u+c*o;i=((u=o*u+((32767&l)<<15)+r.data[n]+(1073741823&i))>>>30)+(l>>>15)+s*c+(i>>>30),r.data[n++]=1073741823&u}return i},n=30):"Netscape"!=navigator.appName?(a.prototype.am=function(e,t,r,n,i,a){for(;--a>=0;){var o=t*this.data[e++]+r.data[n]+i;i=Math.floor(o/67108864),r.data[n++]=67108863&o}return i},n=26):(a.prototype.am=s,n=28),a.prototype.DB=n,a.prototype.DM=(1<<n)-1,a.prototype.DV=1<<n;a.prototype.FV=Math.pow(2,52),a.prototype.F1=52-n,a.prototype.F2=2*n-52;var u,c,l=new Array;for(u="0".charCodeAt(0),c=0;c<=9;++c)l[u++]=c;for(u="a".charCodeAt(0),c=10;c<36;++c)l[u++]=c;for(u="A".charCodeAt(0),c=10;c<36;++c)l[u++]=c;function f(e){return"0123456789abcdefghijklmnopqrstuvwxyz".charAt(e)}function h(e,t){var r=l[e.charCodeAt(t)];return null==r?-1:r}function p(e){var t=o();return t.fromInt(e),t}function d(e){var t,r=1;return 0!=(t=e>>>16)&&(e=t,r+=16),0!=(t=e>>8)&&(e=t,r+=8),0!=(t=e>>4)&&(e=t,r+=4),0!=(t=e>>2)&&(e=t,r+=2),0!=(t=e>>1)&&(e=t,r+=1),r}function y(e){this.m=e}function v(e){this.m=e,this.mp=e.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<<e.DB-15)-1,this.mt2=2*e.t}function g(e,t){return e&t}function m(e,t){return e|t}function b(e,t){return e^t}function E(e,t){return e&~t}function S(e){if(0==e)return-1;var t=0;return 0==(65535&e)&&(e>>=16,t+=16),0==(255&e)&&(e>>=8,t+=8),0==(15&e)&&(e>>=4,t+=4),0==(3&e)&&(e>>=2,t+=2),0==(1&e)&&++t,t}function C(e){for(var t=0;0!=e;)e&=e-1,++t;return t}function w(){}function T(e){return e}function A(e){this.r2=o(),this.q3=o(),a.ONE.dlShiftTo(2*e.t,this.r2),this.mu=this.r2.divide(e),this.m=e}y.prototype.convert=function(e){return e.s<0||e.compareTo(this.m)>=0?e.mod(this.m):e},y.prototype.revert=function(e){return e},y.prototype.reduce=function(e){e.divRemTo(this.m,null,e)},y.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},y.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},v.prototype.convert=function(e){var t=o();return e.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),e.s<0&&t.compareTo(a.ZERO)>0&&this.m.subTo(t,t),t},v.prototype.revert=function(e){var t=o();return e.copyTo(t),this.reduce(t),t},v.prototype.reduce=function(e){for(;e.t<=this.mt2;)e.data[e.t++]=0;for(var t=0;t<this.m.t;++t){var r=32767&e.data[t],n=r*this.mpl+((r*this.mph+(e.data[t]>>15)*this.mpl&this.um)<<15)&e.DM;for(r=t+this.m.t,e.data[r]+=this.m.am(0,n,e,t,0,this.m.t);e.data[r]>=e.DV;)e.data[r]-=e.DV,e.data[++r]++}e.clamp(),e.drShiftTo(this.m.t,e),e.compareTo(this.m)>=0&&e.subTo(this.m,e)},v.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},v.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},a.prototype.copyTo=function(e){for(var t=this.t-1;t>=0;--t)e.data[t]=this.data[t];e.t=this.t,e.s=this.s},a.prototype.fromInt=function(e){this.t=1,this.s=e<0?-1:0,e>0?this.data[0]=e:e<-1?this.data[0]=e+this.DV:this.t=0},a.prototype.fromString=function(e,t){var r;if(16==t)r=4;else if(8==t)r=3;else if(256==t)r=8;else if(2==t)r=1;else if(32==t)r=5;else{if(4!=t)return void this.fromRadix(e,t);r=2}this.t=0,this.s=0;for(var n=e.length,i=!1,o=0;--n>=0;){var s=8==r?255&e[n]:h(e,n);s<0?"-"==e.charAt(n)&&(i=!0):(i=!1,0==o?this.data[this.t++]=s:o+r>this.DB?(this.data[this.t-1]|=(s&(1<<this.DB-o)-1)<<o,this.data[this.t++]=s>>this.DB-o):this.data[this.t-1]|=s<<o,(o+=r)>=this.DB&&(o-=this.DB))}8==r&&0!=(128&e[0])&&(this.s=-1,o>0&&(this.data[this.t-1]|=(1<<this.DB-o)-1<<o)),this.clamp(),i&&a.ZERO.subTo(this,this)},a.prototype.clamp=function(){for(var e=this.s&this.DM;this.t>0&&this.data[this.t-1]==e;)--this.t},a.prototype.dlShiftTo=function(e,t){var r;for(r=this.t-1;r>=0;--r)t.data[r+e]=this.data[r];for(r=e-1;r>=0;--r)t.data[r]=0;t.t=this.t+e,t.s=this.s},a.prototype.drShiftTo=function(e,t){for(var r=e;r<this.t;++r)t.data[r-e]=this.data[r];t.t=Math.max(this.t-e,0),t.s=this.s},a.prototype.lShiftTo=function(e,t){var r,n=e%this.DB,i=this.DB-n,a=(1<<i)-1,o=Math.floor(e/this.DB),s=this.s<<n&this.DM;for(r=this.t-1;r>=0;--r)t.data[r+o+1]=this.data[r]>>i|s,s=(this.data[r]&a)<<n;for(r=o-1;r>=0;--r)t.data[r]=0;t.data[o]=s,t.t=this.t+o+1,t.s=this.s,t.clamp()},a.prototype.rShiftTo=function(e,t){t.s=this.s;var r=Math.floor(e/this.DB);if(r>=this.t)t.t=0;else{var n=e%this.DB,i=this.DB-n,a=(1<<n)-1;t.data[0]=this.data[r]>>n;for(var o=r+1;o<this.t;++o)t.data[o-r-1]|=(this.data[o]&a)<<i,t.data[o-r]=this.data[o]>>n;n>0&&(t.data[this.t-r-1]|=(this.s&a)<<i),t.t=this.t-r,t.clamp()}},a.prototype.subTo=function(e,t){for(var r=0,n=0,i=Math.min(e.t,this.t);r<i;)n+=this.data[r]-e.data[r],t.data[r++]=n&this.DM,n>>=this.DB;if(e.t<this.t){for(n-=e.s;r<this.t;)n+=this.data[r],t.data[r++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;r<e.t;)n-=e.data[r],t.data[r++]=n&this.DM,n>>=this.DB;n-=e.s}t.s=n<0?-1:0,n<-1?t.data[r++]=this.DV+n:n>0&&(t.data[r++]=n),t.t=r,t.clamp()},a.prototype.multiplyTo=function(e,t){var r=this.abs(),n=e.abs(),i=r.t;for(t.t=i+n.t;--i>=0;)t.data[i]=0;for(i=0;i<n.t;++i)t.data[i+r.t]=r.am(0,n.data[i],t,i,0,r.t);t.s=0,t.clamp(),this.s!=e.s&&a.ZERO.subTo(t,t)},a.prototype.squareTo=function(e){for(var t=this.abs(),r=e.t=2*t.t;--r>=0;)e.data[r]=0;for(r=0;r<t.t-1;++r){var n=t.am(r,t.data[r],e,2*r,0,1);(e.data[r+t.t]+=t.am(r+1,2*t.data[r],e,2*r+1,n,t.t-r-1))>=t.DV&&(e.data[r+t.t]-=t.DV,e.data[r+t.t+1]=1)}e.t>0&&(e.data[e.t-1]+=t.am(r,t.data[r],e,2*r,0,1)),e.s=0,e.clamp()},a.prototype.divRemTo=function(e,t,r){var n=e.abs();if(!(n.t<=0)){var i=this.abs();if(i.t<n.t)return null!=t&&t.fromInt(0),void(null!=r&&this.copyTo(r));null==r&&(r=o());var s=o(),u=this.s,c=e.s,l=this.DB-d(n.data[n.t-1]);l>0?(n.lShiftTo(l,s),i.lShiftTo(l,r)):(n.copyTo(s),i.copyTo(r));var f=s.t,h=s.data[f-1];if(0!=h){var p=h*(1<<this.F1)+(f>1?s.data[f-2]>>this.F2:0),y=this.FV/p,v=(1<<this.F1)/p,g=1<<this.F2,m=r.t,b=m-f,E=null==t?o():t;for(s.dlShiftTo(b,E),r.compareTo(E)>=0&&(r.data[r.t++]=1,r.subTo(E,r)),a.ONE.dlShiftTo(f,E),E.subTo(s,s);s.t<f;)s.data[s.t++]=0;for(;--b>=0;){var S=r.data[--m]==h?this.DM:Math.floor(r.data[m]*y+(r.data[m-1]+g)*v);if((r.data[m]+=s.am(0,S,r,b,0,f))<S)for(s.dlShiftTo(b,E),r.subTo(E,r);r.data[m]<--S;)r.subTo(E,r)}null!=t&&(r.drShiftTo(f,t),u!=c&&a.ZERO.subTo(t,t)),r.t=f,r.clamp(),l>0&&r.rShiftTo(l,r),u<0&&a.ZERO.subTo(r,r)}}},a.prototype.invDigit=function(){if(this.t<1)return 0;var e=this.data[0];if(0==(1&e))return 0;var t=3&e;return(t=(t=(t=(t=t*(2-(15&e)*t)&15)*(2-(255&e)*t)&255)*(2-((65535&e)*t&65535))&65535)*(2-e*t%this.DV)%this.DV)>0?this.DV-t:-t},a.prototype.isEven=function(){return 0==(this.t>0?1&this.data[0]:this.s)},a.prototype.exp=function(e,t){if(e>4294967295||e<1)return a.ONE;var r=o(),n=o(),i=t.convert(this),s=d(e)-1;for(i.copyTo(r);--s>=0;)if(t.sqrTo(r,n),(e&1<<s)>0)t.mulTo(n,i,r);else{var u=r;r=n,n=u}return t.revert(r)},a.prototype.toString=function(e){if(this.s<0)return"-"+this.negate().toString(e);var t;if(16==e)t=4;else if(8==e)t=3;else if(2==e)t=1;else if(32==e)t=5;else{if(4!=e)return this.toRadix(e);t=2}var r,n=(1<<t)-1,i=!1,a="",o=this.t,s=this.DB-o*this.DB%t;if(o-- >0)for(s<this.DB&&(r=this.data[o]>>s)>0&&(i=!0,a=f(r));o>=0;)s<t?(r=(this.data[o]&(1<<s)-1)<<t-s,r|=this.data[--o]>>(s+=this.DB-t)):(r=this.data[o]>>(s-=t)&n,s<=0&&(s+=this.DB,--o)),r>0&&(i=!0),i&&(a+=f(r));return i?a:"0"},a.prototype.negate=function(){var e=o();return a.ZERO.subTo(this,e),e},a.prototype.abs=function(){return this.s<0?this.negate():this},a.prototype.compareTo=function(e){var t=this.s-e.s;if(0!=t)return t;var r=this.t;if(0!=(t=r-e.t))return this.s<0?-t:t;for(;--r>=0;)if(0!=(t=this.data[r]-e.data[r]))return t;return 0},a.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+d(this.data[this.t-1]^this.s&this.DM)},a.prototype.mod=function(e){var t=o();return this.abs().divRemTo(e,null,t),this.s<0&&t.compareTo(a.ZERO)>0&&e.subTo(t,t),t},a.prototype.modPowInt=function(e,t){var r;return r=e<256||t.isEven()?new y(t):new v(t),this.exp(e,r)},a.ZERO=p(0),a.ONE=p(1),w.prototype.convert=T,w.prototype.revert=T,w.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r)},w.prototype.sqrTo=function(e,t){e.squareTo(t)},A.prototype.convert=function(e){if(e.s<0||e.t>2*this.m.t)return e.mod(this.m);if(e.compareTo(this.m)<0)return e;var t=o();return e.copyTo(t),this.reduce(t),t},A.prototype.revert=function(e){return e},A.prototype.reduce=function(e){for(e.drShiftTo(this.m.t-1,this.r2),e.t>this.m.t+1&&(e.t=this.m.t+1,e.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);e.compareTo(this.r2)<0;)e.dAddOffset(1,this.m.t+1);for(e.subTo(this.r2,e);e.compareTo(this.m)>=0;)e.subTo(this.m,e)},A.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},A.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)};var I=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509],k=(1<<26)/I[I.length-1];a.prototype.chunkSize=function(e){return Math.floor(Math.LN2*this.DB/Math.log(e))},a.prototype.toRadix=function(e){if(null==e&&(e=10),0==this.signum()||e<2||e>36)return"0";var t=this.chunkSize(e),r=Math.pow(e,t),n=p(r),i=o(),a=o(),s="";for(this.divRemTo(n,i,a);i.signum()>0;)s=(r+a.intValue()).toString(e).substr(1)+s,i.divRemTo(n,i,a);return a.intValue().toString(e)+s},a.prototype.fromRadix=function(e,t){this.fromInt(0),null==t&&(t=10);for(var r=this.chunkSize(t),n=Math.pow(t,r),i=!1,o=0,s=0,u=0;u<e.length;++u){var c=h(e,u);c<0?"-"==e.charAt(u)&&0==this.signum()&&(i=!0):(s=t*s+c,++o>=r&&(this.dMultiply(n),this.dAddOffset(s,0),o=0,s=0))}o>0&&(this.dMultiply(Math.pow(t,o)),this.dAddOffset(s,0)),i&&a.ZERO.subTo(this,this)},a.prototype.fromNumber=function(e,t,r){if("number"==typeof t)if(e<2)this.fromInt(1);else for(this.fromNumber(e,r),this.testBit(e-1)||this.bitwiseTo(a.ONE.shiftLeft(e-1),m,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(t);)this.dAddOffset(2,0),this.bitLength()>e&&this.subTo(a.ONE.shiftLeft(e-1),this);else{var n=new Array,i=7&e;n.length=1+(e>>3),t.nextBytes(n),i>0?n[0]&=(1<<i)-1:n[0]=0,this.fromString(n,256)}},a.prototype.bitwiseTo=function(e,t,r){var n,i,a=Math.min(e.t,this.t);for(n=0;n<a;++n)r.data[n]=t(this.data[n],e.data[n]);if(e.t<this.t){for(i=e.s&this.DM,n=a;n<this.t;++n)r.data[n]=t(this.data[n],i);r.t=this.t}else{for(i=this.s&this.DM,n=a;n<e.t;++n)r.data[n]=t(i,e.data[n]);r.t=e.t}r.s=t(this.s,e.s),r.clamp()},a.prototype.changeBit=function(e,t){var r=a.ONE.shiftLeft(e);return this.bitwiseTo(r,t,r),r},a.prototype.addTo=function(e,t){for(var r=0,n=0,i=Math.min(e.t,this.t);r<i;)n+=this.data[r]+e.data[r],t.data[r++]=n&this.DM,n>>=this.DB;if(e.t<this.t){for(n+=e.s;r<this.t;)n+=this.data[r],t.data[r++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;r<e.t;)n+=e.data[r],t.data[r++]=n&this.DM,n>>=this.DB;n+=e.s}t.s=n<0?-1:0,n>0?t.data[r++]=n:n<-1&&(t.data[r++]=this.DV+n),t.t=r,t.clamp()},a.prototype.dMultiply=function(e){this.data[this.t]=this.am(0,e-1,this,0,0,this.t),++this.t,this.clamp()},a.prototype.dAddOffset=function(e,t){if(0!=e){for(;this.t<=t;)this.data[this.t++]=0;for(this.data[t]+=e;this.data[t]>=this.DV;)this.data[t]-=this.DV,++t>=this.t&&(this.data[this.t++]=0),++this.data[t]}},a.prototype.multiplyLowerTo=function(e,t,r){var n,i=Math.min(this.t+e.t,t);for(r.s=0,r.t=i;i>0;)r.data[--i]=0;for(n=r.t-this.t;i<n;++i)r.data[i+this.t]=this.am(0,e.data[i],r,i,0,this.t);for(n=Math.min(e.t,t);i<n;++i)this.am(0,e.data[i],r,i,0,t-i);r.clamp()},a.prototype.multiplyUpperTo=function(e,t,r){--t;var n=r.t=this.t+e.t-t;for(r.s=0;--n>=0;)r.data[n]=0;for(n=Math.max(t-this.t,0);n<e.t;++n)r.data[this.t+n-t]=this.am(t-n,e.data[n],r,0,0,this.t+n-t);r.clamp(),r.drShiftTo(1,r)},a.prototype.modInt=function(e){if(e<=0)return 0;var t=this.DV%e,r=this.s<0?e-1:0;if(this.t>0)if(0==t)r=this.data[0]%e;else for(var n=this.t-1;n>=0;--n)r=(t*r+this.data[n])%e;return r},a.prototype.millerRabin=function(e){var t=this.subtract(a.ONE),r=t.getLowestSetBit();if(r<=0)return!1;for(var n,i=t.shiftRight(r),o={nextBytes:function(e){for(var t=0;t<e.length;++t)e[t]=Math.floor(256*Math.random())}},s=0;s<e;++s){do{n=new a(this.bitLength(),o)}while(n.compareTo(a.ONE)<=0||n.compareTo(t)>=0);var u=n.modPow(i,this);if(0!=u.compareTo(a.ONE)&&0!=u.compareTo(t)){for(var c=1;c++<r&&0!=u.compareTo(t);)if(0==(u=u.modPowInt(2,this)).compareTo(a.ONE))return!1;if(0!=u.compareTo(t))return!1}}return!0},a.prototype.clone=function(){var e=o();return this.copyTo(e),e},a.prototype.intValue=function(){if(this.s<0){if(1==this.t)return this.data[0]-this.DV;if(0==this.t)return-1}else{if(1==this.t)return this.data[0];if(0==this.t)return 0}return(this.data[1]&(1<<32-this.DB)-1)<<this.DB|this.data[0]},a.prototype.byteValue=function(){return 0==this.t?this.s:this.data[0]<<24>>24},a.prototype.shortValue=function(){return 0==this.t?this.s:this.data[0]<<16>>16},a.prototype.signum=function(){return this.s<0?-1:this.t<=0||1==this.t&&this.data[0]<=0?0:1},a.prototype.toByteArray=function(){var e=this.t,t=new Array;t[0]=this.s;var r,n=this.DB-e*this.DB%8,i=0;if(e-- >0)for(n<this.DB&&(r=this.data[e]>>n)!=(this.s&this.DM)>>n&&(t[i++]=r|this.s<<this.DB-n);e>=0;)n<8?(r=(this.data[e]&(1<<n)-1)<<8-n,r|=this.data[--e]>>(n+=this.DB-8)):(r=this.data[e]>>(n-=8)&255,n<=0&&(n+=this.DB,--e)),0!=(128&r)&&(r|=-256),0==i&&(128&this.s)!=(128&r)&&++i,(i>0||r!=this.s)&&(t[i++]=r);return t},a.prototype.equals=function(e){return 0==this.compareTo(e)},a.prototype.min=function(e){return this.compareTo(e)<0?this:e},a.prototype.max=function(e){return this.compareTo(e)>0?this:e},a.prototype.and=function(e){var t=o();return this.bitwiseTo(e,g,t),t},a.prototype.or=function(e){var t=o();return this.bitwiseTo(e,m,t),t},a.prototype.xor=function(e){var t=o();return this.bitwiseTo(e,b,t),t},a.prototype.andNot=function(e){var t=o();return this.bitwiseTo(e,E,t),t},a.prototype.not=function(){for(var e=o(),t=0;t<this.t;++t)e.data[t]=this.DM&~this.data[t];return e.t=this.t,e.s=~this.s,e},a.prototype.shiftLeft=function(e){var t=o();return e<0?this.rShiftTo(-e,t):this.lShiftTo(e,t),t},a.prototype.shiftRight=function(e){var t=o();return e<0?this.lShiftTo(-e,t):this.rShiftTo(e,t),t},a.prototype.getLowestSetBit=function(){for(var e=0;e<this.t;++e)if(0!=this.data[e])return e*this.DB+S(this.data[e]);return this.s<0?this.t*this.DB:-1},a.prototype.bitCount=function(){for(var e=0,t=this.s&this.DM,r=0;r<this.t;++r)e+=C(this.data[r]^t);return e},a.prototype.testBit=function(e){var t=Math.floor(e/this.DB);return t>=this.t?0!=this.s:0!=(this.data[t]&1<<e%this.DB)},a.prototype.setBit=function(e){return this.changeBit(e,m)},a.prototype.clearBit=function(e){return this.changeBit(e,E)},a.prototype.flipBit=function(e){return this.changeBit(e,b)},a.prototype.add=function(e){var t=o();return this.addTo(e,t),t},a.prototype.subtract=function(e){var t=o();return this.subTo(e,t),t},a.prototype.multiply=function(e){var t=o();return this.multiplyTo(e,t),t},a.prototype.divide=function(e){var t=o();return this.divRemTo(e,t,null),t},a.prototype.remainder=function(e){var t=o();return this.divRemTo(e,null,t),t},a.prototype.divideAndRemainder=function(e){var t=o(),r=o();return this.divRemTo(e,t,r),new Array(t,r)},a.prototype.modPow=function(e,t){var r,n,i=e.bitLength(),a=p(1);if(i<=0)return a;r=i<18?1:i<48?3:i<144?4:i<768?5:6,n=i<8?new y(t):t.isEven()?new A(t):new v(t);var s=new Array,u=3,c=r-1,l=(1<<r)-1;if(s[1]=n.convert(this),r>1){var f=o();for(n.sqrTo(s[1],f);u<=l;)s[u]=o(),n.mulTo(f,s[u-2],s[u]),u+=2}var h,g,m=e.t-1,b=!0,E=o();for(i=d(e.data[m])-1;m>=0;){for(i>=c?h=e.data[m]>>i-c&l:(h=(e.data[m]&(1<<i+1)-1)<<c-i,m>0&&(h|=e.data[m-1]>>this.DB+i-c)),u=r;0==(1&h);)h>>=1,--u;if((i-=u)<0&&(i+=this.DB,--m),b)s[h].copyTo(a),b=!1;else{for(;u>1;)n.sqrTo(a,E),n.sqrTo(E,a),u-=2;u>0?n.sqrTo(a,E):(g=a,a=E,E=g),n.mulTo(E,s[h],a)}for(;m>=0&&0==(e.data[m]&1<<i);)n.sqrTo(a,E),g=a,a=E,E=g,--i<0&&(i=this.DB-1,--m)}return n.revert(a)},a.prototype.modInverse=function(e){var t=e.isEven();if(this.isEven()&&t||0==e.signum())return a.ZERO;for(var r=e.clone(),n=this.clone(),i=p(1),o=p(0),s=p(0),u=p(1);0!=r.signum();){for(;r.isEven();)r.rShiftTo(1,r),t?(i.isEven()&&o.isEven()||(i.addTo(this,i),o.subTo(e,o)),i.rShiftTo(1,i)):o.isEven()||o.subTo(e,o),o.rShiftTo(1,o);for(;n.isEven();)n.rShiftTo(1,n),t?(s.isEven()&&u.isEven()||(s.addTo(this,s),u.subTo(e,u)),s.rShiftTo(1,s)):u.isEven()||u.subTo(e,u),u.rShiftTo(1,u);r.compareTo(n)>=0?(r.subTo(n,r),t&&i.subTo(s,i),o.subTo(u,o)):(n.subTo(r,n),t&&s.subTo(i,s),u.subTo(o,u))}return 0!=n.compareTo(a.ONE)?a.ZERO:u.compareTo(e)>=0?u.subtract(e):u.signum()<0?(u.addTo(e,u),u.signum()<0?u.add(e):u):u},a.prototype.pow=function(e){return this.exp(e,new w)},a.prototype.gcd=function(e){var t=this.s<0?this.negate():this.clone(),r=e.s<0?e.negate():e.clone();if(t.compareTo(r)<0){var n=t;t=r,r=n}var i=t.getLowestSetBit(),a=r.getLowestSetBit();if(a<0)return t;for(i<a&&(a=i),a>0&&(t.rShiftTo(a,t),r.rShiftTo(a,r));t.signum()>0;)(i=t.getLowestSetBit())>0&&t.rShiftTo(i,t),(i=r.getLowestSetBit())>0&&r.rShiftTo(i,r),t.compareTo(r)>=0?(t.subTo(r,t),t.rShiftTo(1,t)):(r.subTo(t,r),r.rShiftTo(1,r));return a>0&&r.lShiftTo(a,r),r},a.prototype.isProbablePrime=function(e){var t,r=this.abs();if(1==r.t&&r.data[0]<=I[I.length-1]){for(t=0;t<I.length;++t)if(r.data[0]==I[t])return!0;return!1}if(r.isEven())return!1;for(t=1;t<I.length;){for(var n=I[t],i=t+1;i<I.length&&n<k;)n*=I[i++];for(n=r.modInt(n);t<i;)if(n%I[t++]==0)return!1}return r.millerRabin(e)}},8991:(e,t,r)=>{var n=r(3832);e.exports=n.md=n.md||{},n.md.algorithms=n.md.algorithms||{}},6971:(e,t,r)=>{var n=r(3832);r(3453),e.exports=n.mgf=n.mgf||{},n.mgf.mgf1=n.mgf1},3453:(e,t,r)=>{var n=r(3832);r(7116),n.mgf=n.mgf||{},(e.exports=n.mgf.mgf1=n.mgf1=n.mgf1||{}).create=function(e){return{generate:function(t,r){for(var i=new n.util.ByteBuffer,a=Math.ceil(r/e.digestLength),o=0;o<a;o++){var s=new n.util.ByteBuffer;s.putInt32(o),e.start(),e.update(t+s.getBytes()),i.putBuffer(e.digest())}return i.truncate(i.length()-r),i.getBytes()}}}},6270:(e,t,r)=>{var n=r(3832);n.pki=n.pki||{};var i=e.exports=n.pki.oids=n.oids=n.oids||{};function a(e,t){i[e]=t,i[t]=e}function o(e,t){i[e]=t}a("1.2.840.113549.1.1.1","rsaEncryption"),a("1.2.840.113549.1.1.4","md5WithRSAEncryption"),a("1.2.840.113549.1.1.5","sha1WithRSAEncryption"),a("1.2.840.113549.1.1.7","RSAES-OAEP"),a("1.2.840.113549.1.1.8","mgf1"),a("1.2.840.113549.1.1.9","pSpecified"),a("1.2.840.113549.1.1.10","RSASSA-PSS"),a("1.2.840.113549.1.1.11","sha256WithRSAEncryption"),a("1.2.840.113549.1.1.12","sha384WithRSAEncryption"),a("1.2.840.113549.1.1.13","sha512WithRSAEncryption"),a("1.3.101.112","EdDSA25519"),a("1.2.840.10040.4.3","dsa-with-sha1"),a("1.3.14.3.2.7","desCBC"),a("1.3.14.3.2.26","sha1"),a("2.16.840.1.101.3.4.2.1","sha256"),a("2.16.840.1.101.3.4.2.2","sha384"),a("2.16.840.1.101.3.4.2.3","sha512"),a("1.2.840.113549.2.5","md5"),a("1.2.840.113549.1.7.1","data"),a("1.2.840.113549.1.7.2","signedData"),a("1.2.840.113549.1.7.3","envelopedData"),a("1.2.840.113549.1.7.4","signedAndEnvelopedData"),a("1.2.840.113549.1.7.5","digestedData"),a("1.2.840.113549.1.7.6","encryptedData"),a("1.2.840.113549.1.9.1","emailAddress"),a("1.2.840.113549.1.9.2","unstructuredName"),a("1.2.840.113549.1.9.3","contentType"),a("1.2.840.113549.1.9.4","messageDigest"),a("1.2.840.113549.1.9.5","signingTime"),a("1.2.840.113549.1.9.6","counterSignature"),a("1.2.840.113549.1.9.7","challengePassword"),a("1.2.840.113549.1.9.8","unstructuredAddress"),a("1.2.840.113549.1.9.14","extensionRequest"),a("1.2.840.113549.1.9.20","friendlyName"),a("1.2.840.113549.1.9.21","localKeyId"),a("1.2.840.113549.1.9.22.1","x509Certificate"),a("1.2.840.113549.1.12.10.1.1","keyBag"),a("1.2.840.113549.1.12.10.1.2","pkcs8ShroudedKeyBag"),a("1.2.840.113549.1.12.10.1.3","certBag"),a("1.2.840.113549.1.12.10.1.4","crlBag"),a("1.2.840.113549.1.12.10.1.5","secretBag"),a("1.2.840.113549.1.12.10.1.6","safeContentsBag"),a("1.2.840.113549.1.5.13","pkcs5PBES2"),a("1.2.840.113549.1.5.12","pkcs5PBKDF2"),a("1.2.840.113549.1.12.1.1","pbeWithSHAAnd128BitRC4"),a("1.2.840.113549.1.12.1.2","pbeWithSHAAnd40BitRC4"),a("1.2.840.113549.1.12.1.3","pbeWithSHAAnd3-KeyTripleDES-CBC"),a("1.2.840.113549.1.12.1.4","pbeWithSHAAnd2-KeyTripleDES-CBC"),a("1.2.840.113549.1.12.1.5","pbeWithSHAAnd128BitRC2-CBC"),a("1.2.840.113549.1.12.1.6","pbewithSHAAnd40BitRC2-CBC"),a("1.2.840.113549.2.7","hmacWithSHA1"),a("1.2.840.113549.2.8","hmacWithSHA224"),a("1.2.840.113549.2.9","hmacWithSHA256"),a("1.2.840.113549.2.10","hmacWithSHA384"),a("1.2.840.113549.2.11","hmacWithSHA512"),a("1.2.840.113549.3.7","des-EDE3-CBC"),a("2.16.840.1.101.3.4.1.2","aes128-CBC"),a("2.16.840.1.101.3.4.1.22","aes192-CBC"),a("2.16.840.1.101.3.4.1.42","aes256-CBC"),a("2.5.4.3","commonName"),a("2.5.4.5","serialName"),a("2.5.4.6","countryName"),a("2.5.4.7","localityName"),a("2.5.4.8","stateOrProvinceName"),a("2.5.4.9","streetAddress"),a("2.5.4.10","organizationName"),a("2.5.4.11","organizationalUnitName"),a("2.5.4.13","description"),a("2.5.4.15","businessCategory"),a("2.5.4.17","postalCode"),a("1.3.6.1.4.1.311.60.2.1.2","jurisdictionOfIncorporationStateOrProvinceName"),a("1.3.6.1.4.1.311.60.2.1.3","jurisdictionOfIncorporationCountryName"),a("2.16.840.1.113730.1.1","nsCertType"),a("2.16.840.1.113730.1.13","nsComment"),o("2.5.29.1","authorityKeyIdentifier"),o("2.5.29.2","keyAttributes"),o("2.5.29.3","certificatePolicies"),o("2.5.29.4","keyUsageRestriction"),o("2.5.29.5","policyMapping"),o("2.5.29.6","subtreesConstraint"),o("2.5.29.7","subjectAltName"),o("2.5.29.8","issuerAltName"),o("2.5.29.9","subjectDirectoryAttributes"),o("2.5.29.10","basicConstraints"),o("2.5.29.11","nameConstraints"),o("2.5.29.12","policyConstraints"),o("2.5.29.13","basicConstraints"),a("2.5.29.14","subjectKeyIdentifier"),a("2.5.29.15","keyUsage"),o("2.5.29.16","privateKeyUsagePeriod"),a("2.5.29.17","subjectAltName"),a("2.5.29.18","issuerAltName"),a("2.5.29.19","basicConstraints"),o("2.5.29.20","cRLNumber"),o("2.5.29.21","cRLReason"),o("2.5.29.22","expirationDate"),o("2.5.29.23","instructionCode"),o("2.5.29.24","invalidityDate"),o("2.5.29.25","cRLDistributionPoints"),o("2.5.29.26","issuingDistributionPoint"),o("2.5.29.27","deltaCRLIndicator"),o("2.5.29.28","issuingDistributionPoint"),o("2.5.29.29","certificateIssuer"),o("2.5.29.30","nameConstraints"),a("2.5.29.31","cRLDistributionPoints"),a("2.5.29.32","certificatePolicies"),o("2.5.29.33","policyMappings"),o("2.5.29.34","policyConstraints"),a("2.5.29.35","authorityKeyIdentifier"),o("2.5.29.36","policyConstraints"),a("2.5.29.37","extKeyUsage"),o("2.5.29.46","freshestCRL"),o("2.5.29.54","inhibitAnyPolicy"),a("1.3.6.1.4.1.11129.2.4.2","timestampList"),a("1.3.6.1.5.5.7.1.1","authorityInfoAccess"),a("1.3.6.1.5.5.7.3.1","serverAuth"),a("1.3.6.1.5.5.7.3.2","clientAuth"),a("1.3.6.1.5.5.7.3.3","codeSigning"),a("1.3.6.1.5.5.7.3.4","emailProtection"),a("1.3.6.1.5.5.7.3.8","timeStamping")},7450:(e,t,r)=>{var n=r(3832);if(r(8925),r(3068),r(3480),r(8991),r(6270),r(8960),r(6953),r(9563),r(9372),r(8095),r(7116),void 0===i)var i=n.jsbn.BigInteger;var a=n.asn1,o=n.pki=n.pki||{};e.exports=o.pbe=n.pbe=n.pbe||{};var s=o.oids,u={name:"EncryptedPrivateKeyInfo",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedPrivateKeyInfo.encryptionAlgorithm",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:a.Class.UNIVERSAL,type:a.Type.OID,constructed:!1,capture:"encryptionOid"},{name:"AlgorithmIdentifier.parameters",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,captureAsn1:"encryptionParams"}]},{name:"EncryptedPrivateKeyInfo.encryptedData",tagClass:a.Class.UNIVERSAL,type:a.Type.OCTETSTRING,constructed:!1,capture:"encryptedData"}]},c={name:"PBES2Algorithms",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc.oid",tagClass:a.Class.UNIVERSAL,type:a.Type.OID,constructed:!1,capture:"kdfOid"},{name:"PBES2Algorithms.params",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.params.salt",tagClass:a.Class.UNIVERSAL,type:a.Type.OCTETSTRING,constructed:!1,capture:"kdfSalt"},{name:"PBES2Algorithms.params.iterationCount",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"kdfIterationCount"},{name:"PBES2Algorithms.params.keyLength",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,optional:!0,capture:"keyLength"},{name:"PBES2Algorithms.params.prf",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,optional:!0,value:[{name:"PBES2Algorithms.params.prf.algorithm",tagClass:a.Class.UNIVERSAL,type:a.Type.OID,constructed:!1,capture:"prfOid"}]}]}]},{name:"PBES2Algorithms.encryptionScheme",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.encryptionScheme.oid",tagClass:a.Class.UNIVERSAL,type:a.Type.OID,constructed:!1,capture:"encOid"},{name:"PBES2Algorithms.encryptionScheme.iv",tagClass:a.Class.UNIVERSAL,type:a.Type.OCTETSTRING,constructed:!1,capture:"encIv"}]}]},l={name:"pkcs-12PbeParams",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"pkcs-12PbeParams.salt",tagClass:a.Class.UNIVERSAL,type:a.Type.OCTETSTRING,constructed:!1,capture:"salt"},{name:"pkcs-12PbeParams.iterations",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"iterations"}]};function f(e,t){return e.start().update(t).digest().getBytes()}function h(e){var t;if(e){if(!(t=o.oids[a.derToOid(e)])){var r=new Error("Unsupported PRF OID.");throw r.oid=e,r.supported=["hmacWithSHA1","hmacWithSHA224","hmacWithSHA256","hmacWithSHA384","hmacWithSHA512"],r}}else t="hmacWithSHA1";return p(t)}function p(e){var t=n.md;switch(e){case"hmacWithSHA224":t=n.md.sha512;case"hmacWithSHA1":case"hmacWithSHA256":case"hmacWithSHA384":case"hmacWithSHA512":e=e.substr(8).toLowerCase();break;default:var r=new Error("Unsupported PRF algorithm.");throw r.algorithm=e,r.supported=["hmacWithSHA1","hmacWithSHA224","hmacWithSHA256","hmacWithSHA384","hmacWithSHA512"],r}if(!t||!(e in t))throw new Error("Unknown hash algorithm: "+e);return t[e].create()}o.encryptPrivateKeyInfo=function(e,t,r){(r=r||{}).saltSize=r.saltSize||8,r.count=r.count||2048,r.algorithm=r.algorithm||"aes128",r.prfAlgorithm=r.prfAlgorithm||"sha1";var i,u,c,l=n.random.getBytesSync(r.saltSize),f=r.count,h=a.integerToDer(f);if(0===r.algorithm.indexOf("aes")||"des"===r.algorithm){var d,y,v;switch(r.algorithm){case"aes128":i=16,d=16,y=s["aes128-CBC"],v=n.aes.createEncryptionCipher;break;case"aes192":i=24,d=16,y=s["aes192-CBC"],v=n.aes.createEncryptionCipher;break;case"aes256":i=32,d=16,y=s["aes256-CBC"],v=n.aes.createEncryptionCipher;break;case"des":i=8,d=8,y=s.desCBC,v=n.des.createEncryptionCipher;break;default:throw(C=new Error("Cannot encrypt private key. Unknown encryption algorithm.")).algorithm=r.algorithm,C}var g="hmacWith"+r.prfAlgorithm.toUpperCase(),m=p(g),b=n.pkcs5.pbkdf2(t,l,f,i,m),E=n.random.getBytesSync(d);(w=v(b)).start(E),w.update(a.toDer(e)),w.finish(),c=w.output.getBytes();var S=function(e,t,r,i){var s=a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.OCTETSTRING,!1,e),a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,t.getBytes())]);"hmacWithSHA1"!==i&&s.value.push(a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,n.util.hexToBytes(r.toString(16))),a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.OID,!1,a.oidToDer(o.oids[i]).getBytes()),a.create(a.Class.UNIVERSAL,a.Type.NULL,!1,"")]));return s}(l,h,i,g);u=a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.OID,!1,a.oidToDer(s.pkcs5PBES2).getBytes()),a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.OID,!1,a.oidToDer(s.pkcs5PBKDF2).getBytes()),S]),a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.OID,!1,a.oidToDer(y).getBytes()),a.create(a.Class.UNIVERSAL,a.Type.OCTETSTRING,!1,E)])])])}else{var C;if("3des"!==r.algorithm)throw(C=new Error("Cannot encrypt private key. Unknown encryption algorithm.")).algorithm=r.algorithm,C;i=24;var w,T=new n.util.ByteBuffer(l);b=o.pbe.generatePkcs12Key(t,T,1,f,i),E=o.pbe.generatePkcs12Key(t,T,2,f,i);(w=n.des.createEncryptionCipher(b)).start(E),w.update(a.toDer(e)),w.finish(),c=w.output.getBytes(),u=a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.OID,!1,a.oidToDer(s["pbeWithSHAAnd3-KeyTripleDES-CBC"]).getBytes()),a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.OCTETSTRING,!1,l),a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,h.getBytes())])])}return a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[u,a.create(a.Class.UNIVERSAL,a.Type.OCTETSTRING,!1,c)])},o.decryptPrivateKeyInfo=function(e,t){var r=null,i={},s=[];if(!a.validate(e,u,i,s)){var c=new Error("Cannot read encrypted private key. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw c.errors=s,c}var l=a.derToOid(i.encryptionOid),f=o.pbe.getCipher(l,i.encryptionParams,t),h=n.util.createBuffer(i.encryptedData);return f.update(h),f.finish()&&(r=a.fromDer(f.output)),r},o.encryptedPrivateKeyToPem=function(e,t){var r={type:"ENCRYPTED PRIVATE KEY",body:a.toDer(e).getBytes()};return n.pem.encode(r,{maxline:t})},o.encryptedPrivateKeyFromPem=function(e){var t=n.pem.decode(e)[0];if("ENCRYPTED PRIVATE KEY"!==t.type){var r=new Error('Could not convert encrypted private key from PEM; PEM header type is "ENCRYPTED PRIVATE KEY".');throw r.headerType=t.type,r}if(t.procType&&"ENCRYPTED"===t.procType.type)throw new Error("Could not convert encrypted private key from PEM; PEM is encrypted.");return a.fromDer(t.body)},o.encryptRsaPrivateKey=function(e,t,r){if(!(r=r||{}).legacy){var i=o.wrapRsaPrivateKey(o.privateKeyToAsn1(e));return i=o.encryptPrivateKeyInfo(i,t,r),o.encryptedPrivateKeyToPem(i)}var s,u,c,l;switch(r.algorithm){case"aes128":s="AES-128-CBC",c=16,u=n.random.getBytesSync(16),l=n.aes.createEncryptionCipher;break;case"aes192":s="AES-192-CBC",c=24,u=n.random.getBytesSync(16),l=n.aes.createEncryptionCipher;break;case"aes256":s="AES-256-CBC",c=32,u=n.random.getBytesSync(16),l=n.aes.createEncryptionCipher;break;case"3des":s="DES-EDE3-CBC",c=24,u=n.random.getBytesSync(8),l=n.des.createEncryptionCipher;break;case"des":s="DES-CBC",c=8,u=n.random.getBytesSync(8),l=n.des.createEncryptionCipher;break;default:var f=new Error('Could not encrypt RSA private key; unsupported encryption algorithm "'+r.algorithm+'".');throw f.algorithm=r.algorithm,f}var h=l(n.pbe.opensslDeriveBytes(t,u.substr(0,8),c));h.start(u),h.update(a.toDer(o.privateKeyToAsn1(e))),h.finish();var p={type:"RSA PRIVATE KEY",procType:{version:"4",type:"ENCRYPTED"},dekInfo:{algorithm:s,parameters:n.util.bytesToHex(u).toUpperCase()},body:h.output.getBytes()};return n.pem.encode(p)},o.decryptRsaPrivateKey=function(e,t){var r=null,i=n.pem.decode(e)[0];if("ENCRYPTED PRIVATE KEY"!==i.type&&"PRIVATE KEY"!==i.type&&"RSA PRIVATE KEY"!==i.type)throw(c=new Error('Could not convert private key from PEM; PEM header type is not "ENCRYPTED PRIVATE KEY", "PRIVATE KEY", or "RSA PRIVATE KEY".')).headerType=c,c;if(i.procType&&"ENCRYPTED"===i.procType.type){var s,u;switch(i.dekInfo.algorithm){case"DES-CBC":s=8,u=n.des.createDecryptionCipher;break;case"DES-EDE3-CBC":s=24,u=n.des.createDecryptionCipher;break;case"AES-128-CBC":s=16,u=n.aes.createDecryptionCipher;break;case"AES-192-CBC":s=24,u=n.aes.createDecryptionCipher;break;case"AES-256-CBC":s=32,u=n.aes.createDecryptionCipher;break;case"RC2-40-CBC":s=5,u=function(e){return n.rc2.createDecryptionCipher(e,40)};break;case"RC2-64-CBC":s=8,u=function(e){return n.rc2.createDecryptionCipher(e,64)};break;case"RC2-128-CBC":s=16,u=function(e){return n.rc2.createDecryptionCipher(e,128)};break;default:var c;throw(c=new Error('Could not decrypt private key; unsupported encryption algorithm "'+i.dekInfo.algorithm+'".')).algorithm=i.dekInfo.algorithm,c}var l=n.util.hexToBytes(i.dekInfo.parameters),f=u(n.pbe.opensslDeriveBytes(t,l.substr(0,8),s));if(f.start(l),f.update(n.util.createBuffer(i.body)),!f.finish())return r;r=f.output.getBytes()}else r=i.body;return null!==(r="ENCRYPTED PRIVATE KEY"===i.type?o.decryptPrivateKeyInfo(a.fromDer(r),t):a.fromDer(r))&&(r=o.privateKeyFromAsn1(r)),r},o.pbe.generatePkcs12Key=function(e,t,r,i,a,o){var s,u;if(null==o){if(!("sha1"in n.md))throw new Error('"sha1" hash algorithm unavailable.');o=n.md.sha1.create()}var c=o.digestLength,l=o.blockLength,f=new n.util.ByteBuffer,h=new n.util.ByteBuffer;if(null!=e){for(u=0;u<e.length;u++)h.putInt16(e.charCodeAt(u));h.putInt16(0)}var p=h.length(),d=t.length(),y=new n.util.ByteBuffer;y.fillWithByte(r,l);var v=l*Math.ceil(d/l),g=new n.util.ByteBuffer;for(u=0;u<v;u++)g.putByte(t.at(u%d));var m=l*Math.ceil(p/l),b=new n.util.ByteBuffer;for(u=0;u<m;u++)b.putByte(h.at(u%p));var E=g;E.putBuffer(b);for(var S=Math.ceil(a/c),C=1;C<=S;C++){var w=new n.util.ByteBuffer;w.putBytes(y.bytes()),w.putBytes(E.bytes());for(var T=0;T<i;T++)o.start(),o.update(w.getBytes()),w=o.digest();var A=new n.util.ByteBuffer;for(u=0;u<l;u++)A.putByte(w.at(u%c));var I=Math.ceil(d/l)+Math.ceil(p/l),k=new n.util.ByteBuffer;for(s=0;s<I;s++){var _=new n.util.ByteBuffer(E.getBytes(l)),B=511;for(u=A.length()-1;u>=0;u--)B>>=8,B+=A.at(u)+_.at(u),_.setAt(u,255&B);k.putBuffer(_)}E=k,f.putBuffer(w)}return f.truncate(f.length()-a),f},o.pbe.getCipher=function(e,t,r){switch(e){case o.oids.pkcs5PBES2:return o.pbe.getCipherForPBES2(e,t,r);case o.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:case o.oids["pbewithSHAAnd40BitRC2-CBC"]:return o.pbe.getCipherForPKCS12PBE(e,t,r);default:var n=new Error("Cannot read encrypted PBE data block. Unsupported OID.");throw n.oid=e,n.supportedOids=["pkcs5PBES2","pbeWithSHAAnd3-KeyTripleDES-CBC","pbewithSHAAnd40BitRC2-CBC"],n}},o.pbe.getCipherForPBES2=function(e,t,r){var i,s={},u=[];if(!a.validate(t,c,s,u))throw(i=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.")).errors=u,i;if((e=a.derToOid(s.kdfOid))!==o.oids.pkcs5PBKDF2)throw(i=new Error("Cannot read encrypted private key. Unsupported key derivation function OID.")).oid=e,i.supportedOids=["pkcs5PBKDF2"],i;if((e=a.derToOid(s.encOid))!==o.oids["aes128-CBC"]&&e!==o.oids["aes192-CBC"]&&e!==o.oids["aes256-CBC"]&&e!==o.oids["des-EDE3-CBC"]&&e!==o.oids.desCBC)throw(i=new Error("Cannot read encrypted private key. Unsupported encryption scheme OID.")).oid=e,i.supportedOids=["aes128-CBC","aes192-CBC","aes256-CBC","des-EDE3-CBC","desCBC"],i;var l,f,p=s.kdfSalt,d=n.util.createBuffer(s.kdfIterationCount);switch(d=d.getInt(d.length()<<3),o.oids[e]){case"aes128-CBC":l=16,f=n.aes.createDecryptionCipher;break;case"aes192-CBC":l=24,f=n.aes.createDecryptionCipher;break;case"aes256-CBC":l=32,f=n.aes.createDecryptionCipher;break;case"des-EDE3-CBC":l=24,f=n.des.createDecryptionCipher;break;case"desCBC":l=8,f=n.des.createDecryptionCipher}var y=h(s.prfOid),v=n.pkcs5.pbkdf2(r,p,d,l,y),g=s.encIv,m=f(v);return m.start(g),m},o.pbe.getCipherForPKCS12PBE=function(e,t,r){var i={},s=[];if(!a.validate(t,l,i,s))throw(y=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.")).errors=s,y;var u,c,f,p=n.util.createBuffer(i.salt),d=n.util.createBuffer(i.iterations);switch(d=d.getInt(d.length()<<3),e){case o.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:u=24,c=8,f=n.des.startDecrypting;break;case o.oids["pbewithSHAAnd40BitRC2-CBC"]:u=5,c=8,f=function(e,t){var r=n.rc2.createDecryptionCipher(e,40);return r.start(t,null),r};break;default:var y;throw(y=new Error("Cannot read PKCS #12 PBE data block. Unsupported OID.")).oid=e,y}var v=h(i.prfOid),g=o.pbe.generatePkcs12Key(r,p,1,d,u,v);return v.start(),f(g,o.pbe.generatePkcs12Key(r,p,2,d,c,v))},o.pbe.opensslDeriveBytes=function(e,t,r,i){if(null==i){if(!("md5"in n.md))throw new Error('"md5" hash algorithm unavailable.');i=n.md.md5.create()}null===t&&(t="");for(var a=[f(i,e+t)],o=16,s=1;o<r;++s,o+=16)a.push(f(i,a[s-1]+e+t));return a.join("").substr(0,r)}},8960:(e,t,r)=>{var n=r(3832);r(6607),r(8991),r(7116);var i,a=n.pkcs5=n.pkcs5||{};n.util.isNodejs&&!n.options.usePureJavaScript&&(i=r(5819)),e.exports=n.pbkdf2=a.pbkdf2=function(e,t,r,a,o,s){if("function"==typeof o&&(s=o,o=null),n.util.isNodejs&&!n.options.usePureJavaScript&&i.pbkdf2&&(null===o||"object"!=typeof o)&&(i.pbkdf2Sync.length>4||!o||"sha1"===o))return"string"!=typeof o&&(o="sha1"),e=Buffer.from(e,"binary"),t=Buffer.from(t,"binary"),s?4===i.pbkdf2Sync.length?i.pbkdf2(e,t,r,a,(function(e,t){if(e)return s(e);s(null,t.toString("binary"))})):i.pbkdf2(e,t,r,a,o,(function(e,t){if(e)return s(e);s(null,t.toString("binary"))})):4===i.pbkdf2Sync.length?i.pbkdf2Sync(e,t,r,a).toString("binary"):i.pbkdf2Sync(e,t,r,a,o).toString("binary");if(null==o&&(o="sha1"),"string"==typeof o){if(!(o in n.md.algorithms))throw new Error("Unknown hash algorithm: "+o);o=n.md[o].create()}var u=o.digestLength;if(a>4294967295*u){var c=new Error("Derived key is too long.");if(s)return s(c);throw c}var l=Math.ceil(a/u),f=a-(l-1)*u,h=n.hmac.create();h.start(o,e);var p,d,y,v="";if(!s){for(var g=1;g<=l;++g){h.start(null,null),h.update(t),h.update(n.util.int32ToBytes(g)),p=y=h.digest().getBytes();for(var m=2;m<=r;++m)h.start(null,null),h.update(y),d=h.digest().getBytes(),p=n.util.xorBytes(p,d,u),y=d;v+=g<l?p:p.substr(0,f)}return v}g=1;function b(){if(g>l)return s(null,v);h.start(null,null),h.update(t),h.update(n.util.int32ToBytes(g)),p=y=h.digest().getBytes(),m=2,E()}function E(){if(m<=r)return h.start(null,null),h.update(y),d=h.digest().getBytes(),p=n.util.xorBytes(p,d,u),y=d,++m,n.util.setImmediate(E);v+=g<l?p:p.substr(0,f),++g,b()}b()}},6953:(e,t,r)=>{var n=r(3832);r(7116);var i=e.exports=n.pem=n.pem||{};function a(e){for(var t=e.name+": ",r=[],n=function(e,t){return" "+t},i=0;i<e.values.length;++i)r.push(e.values[i].replace(/^(\S+\r\n)/,n));t+=r.join(",")+"\r\n";var a=0,o=-1;for(i=0;i<t.length;++i,++a)if(a>65&&-1!==o){var s=t[o];","===s?(++o,t=t.substr(0,o)+"\r\n "+t.substr(o)):t=t.substr(0,o)+"\r\n"+s+t.substr(o+1),a=i-o-1,o=-1,++i}else" "!==t[i]&&"\t"!==t[i]&&","!==t[i]||(o=i);return t}function o(e){return e.replace(/^\s+/,"")}i.encode=function(e,t){t=t||{};var r,i="-----BEGIN "+e.type+"-----\r\n";if(e.procType&&(i+=a(r={name:"Proc-Type",values:[String(e.procType.version),e.procType.type]})),e.contentDomain&&(i+=a(r={name:"Content-Domain",values:[e.contentDomain]})),e.dekInfo&&(r={name:"DEK-Info",values:[e.dekInfo.algorithm]},e.dekInfo.parameters&&r.values.push(e.dekInfo.parameters),i+=a(r)),e.headers)for(var o=0;o<e.headers.length;++o)i+=a(e.headers[o]);return e.procType&&(i+="\r\n"),i+=n.util.encode64(e.body,t.maxline||64)+"\r\n",i+="-----END "+e.type+"-----\r\n"},i.decode=function(e){for(var t,r=[],i=/\s*-----BEGIN ([A-Z0-9- ]+)-----\r?\n?([\x21-\x7e\s]+?(?:\r?\n\r?\n))?([:A-Za-z0-9+\/=\s]+?)-----END \1-----/g,a=/([\x21-\x7e]+):\s*([\x21-\x7e\s^:]+)/,s=/\r?\n/;t=i.exec(e);){var u={type:t[1],procType:null,contentDomain:null,dekInfo:null,headers:[],body:n.util.decode64(t[3])};if(r.push(u),t[2]){for(var c=t[2].split(s),l=0;t&&l<c.length;){for(var f=c[l].replace(/\s+$/,""),h=l+1;h<c.length;++h){var p=c[h];if(!/\s/.test(p[0]))break;f+=p,l=h}if(t=f.match(a)){for(var d={name:t[1],values:[]},y=t[2].split(","),v=0;v<y.length;++v)d.values.push(o(y[v]));if(u.procType)if(u.contentDomain||"Content-Domain"!==d.name)if(u.dekInfo||"DEK-Info"!==d.name)u.headers.push(d);else{if(0===d.values.length)throw new Error('Invalid PEM formatted message. The "DEK-Info" header must have at least one subfield.');u.dekInfo={algorithm:y[0],parameters:y[1]||null}}else u.contentDomain=y[0]||"";else{if("Proc-Type"!==d.name)throw new Error('Invalid PEM formatted message. The first encapsulated header must be "Proc-Type".');if(2!==d.values.length)throw new Error('Invalid PEM formatted message. The "Proc-Type" header must have two subfields.');u.procType={version:y[0],type:y[1]}}}++l}if("ENCRYPTED"===u.procType&&!u.dekInfo)throw new Error('Invalid PEM formatted message. The "DEK-Info" header must be present if "Proc-Type" is "ENCRYPTED".')}}if(0===r.length)throw new Error("Invalid PEM formatted message.");return r}},8936:(e,t,r)=>{var n=r(3832);r(7116),r(9563),r(137);var i=e.exports=n.pkcs1=n.pkcs1||{};function a(e,t,r){r||(r=n.md.sha1.create());for(var i="",a=Math.ceil(t/r.digestLength),o=0;o<a;++o){var s=String.fromCharCode(o>>24&255,o>>16&255,o>>8&255,255&o);r.start(),r.update(e+s),i+=r.digest().getBytes()}return i.substring(0,t)}i.encode_rsa_oaep=function(e,t,r){var i,o,s,u;"string"==typeof r?(i=r,o=arguments[3]||void 0,s=arguments[4]||void 0):r&&(i=r.label||void 0,o=r.seed||void 0,s=r.md||void 0,r.mgf1&&r.mgf1.md&&(u=r.mgf1.md)),s?s.start():s=n.md.sha1.create(),u||(u=s);var c=Math.ceil(e.n.bitLength()/8),l=c-2*s.digestLength-2;if(t.length>l)throw(v=new Error("RSAES-OAEP input message length is too long.")).length=t.length,v.maxLength=l,v;i||(i=""),s.update(i,"raw");for(var f=s.digest(),h="",p=l-t.length,d=0;d<p;d++)h+="\0";var y=f.getBytes()+h+""+t;if(o){if(o.length!==s.digestLength){var v;throw(v=new Error("Invalid RSAES-OAEP seed. The seed length must match the digest length.")).seedLength=o.length,v.digestLength=s.digestLength,v}}else o=n.random.getBytes(s.digestLength);var g=a(o,c-s.digestLength-1,u),m=n.util.xorBytes(y,g,y.length),b=a(m,s.digestLength,u),E=n.util.xorBytes(o,b,o.length);return"\0"+E+m},i.decode_rsa_oaep=function(e,t,r){var i,o,s;"string"==typeof r?(i=r,o=arguments[3]||void 0):r&&(i=r.label||void 0,o=r.md||void 0,r.mgf1&&r.mgf1.md&&(s=r.mgf1.md));var u=Math.ceil(e.n.bitLength()/8);if(t.length!==u)throw(m=new Error("RSAES-OAEP encoded message length is invalid.")).length=t.length,m.expectedLength=u,m;if(void 0===o?o=n.md.sha1.create():o.start(),s||(s=o),u<2*o.digestLength+2)throw new Error("RSAES-OAEP key is too short for the hash function.");i||(i=""),o.update(i,"raw");for(var c=o.digest().getBytes(),l=t.charAt(0),f=t.substring(1,o.digestLength+1),h=t.substring(1+o.digestLength),p=a(h,o.digestLength,s),d=n.util.xorBytes(f,p,f.length),y=a(d,u-o.digestLength-1,s),v=n.util.xorBytes(h,y,h.length),g=v.substring(0,o.digestLength),m="\0"!==l,b=0;b<o.digestLength;++b)m|=c.charAt(b)!==g.charAt(b);for(var E=1,S=o.digestLength,C=o.digestLength;C<v.length;C++){var w=v.charCodeAt(C),T=1&w^1,A=E?65534:0;m|=w&A,S+=E&=T}if(m||1!==v.charCodeAt(S))throw new Error("Invalid RSAES-OAEP padding.");return v.substring(S+1)}},5147:(e,t,r)=>{var n=r(3832);r(3068),r(6607),r(6270),r(5496),r(7450),r(9563),r(8095),r(137),r(7116),r(5414);var i=n.asn1,a=n.pki,o=e.exports=n.pkcs12=n.pkcs12||{},s={name:"ContentInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.contentType",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:i.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:"content"}]},u={name:"PFX",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.version",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"version"},s,{name:"PFX.macData",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"mac",value:[{name:"PFX.macData.mac",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.macData.mac.digestAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.macData.mac.digestAlgorithm.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"macAlgorithm"},{name:"PFX.macData.mac.digestAlgorithm.parameters",tagClass:i.Class.UNIVERSAL,captureAsn1:"macAlgorithmParameters"}]},{name:"PFX.macData.mac.digest",tagClass:i.Class.UNIVERSAL,type:i.Type.OCTETSTRING,constructed:!1,capture:"macDigest"}]},{name:"PFX.macData.macSalt",tagClass:i.Class.UNIVERSAL,type:i.Type.OCTETSTRING,constructed:!1,capture:"macSalt"},{name:"PFX.macData.iterations",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,optional:!0,capture:"macIterations"}]}]},c={name:"SafeBag",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"SafeBag.bagId",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"bagId"},{name:"SafeBag.bagValue",tagClass:i.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:"bagValue"},{name:"SafeBag.bagAttributes",tagClass:i.Class.UNIVERSAL,type:i.Type.SET,constructed:!0,optional:!0,capture:"bagAttributes"}]},l={name:"Attribute",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"Attribute.attrId",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"oid"},{name:"Attribute.attrValues",tagClass:i.Class.UNIVERSAL,type:i.Type.SET,constructed:!0,capture:"values"}]},f={name:"CertBag",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"CertBag.certId",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"certId"},{name:"CertBag.certValue",tagClass:i.Class.CONTEXT_SPECIFIC,constructed:!0,value:[{name:"CertBag.certValue[0]",tagClass:i.Class.UNIVERSAL,type:i.Class.OCTETSTRING,constructed:!1,capture:"cert"}]}]};function h(e,t,r,n){for(var i=[],a=0;a<e.length;a++)for(var o=0;o<e[a].safeBags.length;o++){var s=e[a].safeBags[o];void 0!==n&&s.type!==n||(null!==t?void 0!==s.attributes[t]&&s.attributes[t].indexOf(r)>=0&&i.push(s):i.push(s))}return i}function p(e){if(e.composed||e.constructed){for(var t=n.util.createBuffer(),r=0;r<e.value.length;++r)t.putBytes(e.value[r].value);e.composed=e.constructed=!1,e.value=t.getBytes()}return e}function d(e,t){var r={},o=[];if(!i.validate(e,n.pkcs7.asn1.encryptedDataValidator,r,o))throw(s=new Error("Cannot read EncryptedContentInfo.")).errors=o,s;var s,u=i.derToOid(r.contentType);if(u!==a.oids.data)throw(s=new Error("PKCS#12 EncryptedContentInfo ContentType is not Data.")).oid=u,s;u=i.derToOid(r.encAlgorithm);var c=a.pbe.getCipher(u,r.encParameter,t),l=p(r.encryptedContentAsn1),f=n.util.createBuffer(l.value);if(c.update(f),!c.finish())throw new Error("Failed to decrypt PKCS#12 SafeContents.");return c.output.getBytes()}function y(e,t,r){if(!t&&0===e.length)return[];if((e=i.fromDer(e,t)).tagClass!==i.Class.UNIVERSAL||e.type!==i.Type.SEQUENCE||!0!==e.constructed)throw new Error("PKCS#12 SafeContents expected to be a SEQUENCE OF SafeBag.");for(var n=[],o=0;o<e.value.length;o++){var s=e.value[o],u={},l=[];if(!i.validate(s,c,u,l))throw(g=new Error("Cannot read SafeBag.")).errors=l,g;var h,p,d={type:i.derToOid(u.bagId),attributes:v(u.bagAttributes)};n.push(d);var y=u.bagValue.value[0];switch(d.type){case a.oids.pkcs8ShroudedKeyBag:if(null===(y=a.decryptPrivateKeyInfo(y,r)))throw new Error("Unable to decrypt PKCS#8 ShroudedKeyBag, wrong password?");case a.oids.keyBag:try{d.key=a.privateKeyFromAsn1(y)}catch(e){d.key=null,d.asn1=y}continue;case a.oids.certBag:h=f,p=function(){if(i.derToOid(u.certId)!==a.oids.x509Certificate){var e=new Error("Unsupported certificate type, only X.509 supported.");throw e.oid=i.derToOid(u.certId),e}var r=i.fromDer(u.cert,t);try{d.cert=a.certificateFromAsn1(r,!0)}catch(e){d.cert=null,d.asn1=r}};break;default:var g;throw(g=new Error("Unsupported PKCS#12 SafeBag type.")).oid=d.type,g}if(void 0!==h&&!i.validate(y,h,u,l))throw(g=new Error("Cannot read PKCS#12 "+h.name)).errors=l,g;p()}return n}function v(e){var t={};if(void 0!==e)for(var r=0;r<e.length;++r){var n={},o=[];if(!i.validate(e[r],l,n,o)){var s=new Error("Cannot read PKCS#12 BagAttribute.");throw s.errors=o,s}var u=i.derToOid(n.oid);if(void 0!==a.oids[u]){t[a.oids[u]]=[];for(var c=0;c<n.values.length;++c)t[a.oids[u]].push(n.values[c].value)}}return t}o.pkcs12FromAsn1=function(e,t,r){"string"==typeof t?(r=t,t=!0):void 0===t&&(t=!0);var c={};if(!i.validate(e,u,c,[]))throw(l=new Error("Cannot read PKCS#12 PFX. ASN.1 object is not an PKCS#12 PFX.")).errors=l,l;var l,f={version:c.version.charCodeAt(0),safeContents:[],getBags:function(e){var t,r={};return"localKeyId"in e?t=e.localKeyId:"localKeyIdHex"in e&&(t=n.util.hexToBytes(e.localKeyIdHex)),void 0===t&&!("friendlyName"in e)&&"bagType"in e&&(r[e.bagType]=h(f.safeContents,null,null,e.bagType)),void 0!==t&&(r.localKeyId=h(f.safeContents,"localKeyId",t,e.bagType)),"friendlyName"in e&&(r.friendlyName=h(f.safeContents,"friendlyName",e.friendlyName,e.bagType)),r},getBagsByFriendlyName:function(e,t){return h(f.safeContents,"friendlyName",e,t)},getBagsByLocalKeyId:function(e,t){return h(f.safeContents,"localKeyId",e,t)}};if(3!==c.version.charCodeAt(0))throw(l=new Error("PKCS#12 PFX of version other than 3 not supported.")).version=c.version.charCodeAt(0),l;if(i.derToOid(c.contentType)!==a.oids.data)throw(l=new Error("Only PKCS#12 PFX in password integrity mode supported.")).oid=i.derToOid(c.contentType),l;var v=c.content.value[0];if(v.tagClass!==i.Class.UNIVERSAL||v.type!==i.Type.OCTETSTRING)throw new Error("PKCS#12 authSafe content data is not an OCTET STRING.");if(v=p(v),c.mac){var g=null,m=0,b=i.derToOid(c.macAlgorithm);switch(b){case a.oids.sha1:g=n.md.sha1.create(),m=20;break;case a.oids.sha256:g=n.md.sha256.create(),m=32;break;case a.oids.sha384:g=n.md.sha384.create(),m=48;break;case a.oids.sha512:g=n.md.sha512.create(),m=64;break;case a.oids.md5:g=n.md.md5.create(),m=16}if(null===g)throw new Error("PKCS#12 uses unsupported MAC algorithm: "+b);var E=new n.util.ByteBuffer(c.macSalt),S="macIterations"in c?parseInt(n.util.bytesToHex(c.macIterations),16):1,C=o.generateKey(r,E,3,S,m,g),w=n.hmac.create();if(w.start(g,C),w.update(v.value),w.getMac().getBytes()!==c.macDigest)throw new Error("PKCS#12 MAC could not be verified. Invalid password?")}return function(e,t,r,n){if((t=i.fromDer(t,r)).tagClass!==i.Class.UNIVERSAL||t.type!==i.Type.SEQUENCE||!0!==t.constructed)throw new Error("PKCS#12 AuthenticatedSafe expected to be a SEQUENCE OF ContentInfo");for(var o=0;o<t.value.length;o++){var u=t.value[o],c={},l=[];if(!i.validate(u,s,c,l))throw(g=new Error("Cannot read ContentInfo.")).errors=l,g;var f={encrypted:!1},h=null,v=c.content.value[0];switch(i.derToOid(c.contentType)){case a.oids.data:if(v.tagClass!==i.Class.UNIVERSAL||v.type!==i.Type.OCTETSTRING)throw new Error("PKCS#12 SafeContents Data is not an OCTET STRING.");h=p(v).value;break;case a.oids.encryptedData:h=d(v,n),f.encrypted=!0;break;default:var g;throw(g=new Error("Unsupported PKCS#12 contentType.")).contentType=i.derToOid(c.contentType),g}f.safeBags=y(h,r,n),e.safeContents.push(f)}}(f,v.value,t,r),f},o.toPkcs12Asn1=function(e,t,r,s){(s=s||{}).saltSize=s.saltSize||8,s.count=s.count||2048,s.algorithm=s.algorithm||s.encAlgorithm||"aes128","useMac"in s||(s.useMac=!0),"localKeyId"in s||(s.localKeyId=null),"generateLocalKeyId"in s||(s.generateLocalKeyId=!0);var u,c=s.localKeyId;if(null!==c)c=n.util.hexToBytes(c);else if(s.generateLocalKeyId)if(t){var l=n.util.isArray(t)?t[0]:t;"string"==typeof l&&(l=a.certificateFromPem(l)),(k=n.md.sha1.create()).update(i.toDer(a.certificateToAsn1(l)).getBytes()),c=k.digest().getBytes()}else c=n.random.getBytes(20);var f=[];null!==c&&f.push(i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(a.oids.localKeyId).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SET,!0,[i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,c)])])),"friendlyName"in s&&f.push(i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(a.oids.friendlyName).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SET,!0,[i.create(i.Class.UNIVERSAL,i.Type.BMPSTRING,!1,s.friendlyName)])])),f.length>0&&(u=i.create(i.Class.UNIVERSAL,i.Type.SET,!0,f));var h=[],p=[];null!==t&&(p=n.util.isArray(t)?t:[t]);for(var d=[],y=0;y<p.length;++y){"string"==typeof(t=p[y])&&(t=a.certificateFromPem(t));var v=0===y?u:void 0,g=a.certificateToAsn1(t),m=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(a.oids.certBag).getBytes()),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(a.oids.x509Certificate).getBytes()),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,i.toDer(g).getBytes())])])]),v]);d.push(m)}if(d.length>0){var b=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,d),E=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(a.oids.data).getBytes()),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,i.toDer(b).getBytes())])]);h.push(E)}var S=null;if(null!==e){var C=a.wrapRsaPrivateKey(a.privateKeyToAsn1(e));S=null===r?i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(a.oids.keyBag).getBytes()),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[C]),u]):i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(a.oids.pkcs8ShroudedKeyBag).getBytes()),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[a.encryptPrivateKeyInfo(C,r,s)]),u]);var w=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[S]),T=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(a.oids.data).getBytes()),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,i.toDer(w).getBytes())])]);h.push(T)}var A,I=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,h);if(s.useMac){var k=n.md.sha1.create(),_=new n.util.ByteBuffer(n.random.getBytes(s.saltSize)),B=s.count,N=(e=o.generateKey(r,_,3,B,20),n.hmac.create());N.start(k,e),N.update(i.toDer(I).getBytes());var O=N.getMac();A=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(a.oids.sha1).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.NULL,!1,"")]),i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,O.getBytes())]),i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,_.getBytes()),i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(B).getBytes())])}return i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(3).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(a.oids.data).getBytes()),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,i.toDer(I).getBytes())])]),A])},o.generateKey=n.pbe.generatePkcs12Key},9437:(e,t,r)=>{var n=r(3832);r(8925),r(3068),r(3480),r(6270),r(6953),r(5496),r(9563),r(7116),r(5414);var i=n.asn1,a=e.exports=n.pkcs7=n.pkcs7||{};function o(e){var t={},r=[];if(!i.validate(e,a.asn1.recipientInfoValidator,t,r)){var o=new Error("Cannot read PKCS#7 RecipientInfo. ASN.1 object is not an PKCS#7 RecipientInfo.");throw o.errors=r,o}return{version:t.version.charCodeAt(0),issuer:n.pki.RDNAttributesAsArray(t.issuer),serialNumber:n.util.createBuffer(t.serial).toHex(),encryptedContent:{algorithm:i.derToOid(t.encAlgorithm),parameter:t.encParameter.value,content:t.encKey}}}function s(e){for(var t,r=[],a=0;a<e.length;++a)r.push((t=e[a],i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(t.version).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[n.pki.distinguishedNameToAsn1({attributes:t.issuer}),i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,n.util.hexToBytes(t.serialNumber))]),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(t.encryptedContent.algorithm).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.NULL,!1,"")]),i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,t.encryptedContent.content)])));return r}function u(e){var t=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(e.version).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[n.pki.distinguishedNameToAsn1({attributes:e.issuer}),i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,n.util.hexToBytes(e.serialNumber))]),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.digestAlgorithm).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.NULL,!1,"")])]);if(e.authenticatedAttributesAsn1&&t.value.push(e.authenticatedAttributesAsn1),t.value.push(i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.signatureAlgorithm).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.NULL,!1,"")])),t.value.push(i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,e.signature)),e.unauthenticatedAttributes.length>0){for(var r=i.create(i.Class.CONTEXT_SPECIFIC,1,!0,[]),a=0;a<e.unauthenticatedAttributes.length;++a){var o=e.unauthenticatedAttributes[a];r.values.push(c(o))}t.value.push(r)}return t}function c(e){var t;if(e.type===n.pki.oids.contentType)t=i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.value).getBytes());else if(e.type===n.pki.oids.messageDigest)t=i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,e.value.bytes());else if(e.type===n.pki.oids.signingTime){var r=new Date("1950-01-01T00:00:00Z"),a=new Date("2050-01-01T00:00:00Z"),o=e.value;if("string"==typeof o){var s=Date.parse(o);o=isNaN(s)?13===o.length?i.utcTimeToDate(o):i.generalizedTimeToDate(o):new Date(s)}t=o>=r&&o<a?i.create(i.Class.UNIVERSAL,i.Type.UTCTIME,!1,i.dateToUtcTime(o)):i.create(i.Class.UNIVERSAL,i.Type.GENERALIZEDTIME,!1,i.dateToGeneralizedTime(o))}return i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.type).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SET,!0,[t])])}function l(e,t,r){var a={};if(!i.validate(t,r,a,[])){var o=new Error("Cannot read PKCS#7 message. ASN.1 object is not a supported PKCS#7 message.");throw o.errors=o,o}if(i.derToOid(a.contentType)!==n.pki.oids.data)throw new Error("Unsupported PKCS#7 message. Only wrapped ContentType Data supported.");if(a.encryptedContent){var s="";if(n.util.isArray(a.encryptedContent))for(var u=0;u<a.encryptedContent.length;++u){if(a.encryptedContent[u].type!==i.Type.OCTETSTRING)throw new Error("Malformed PKCS#7 message, expecting encrypted content constructed of only OCTET STRING objects.");s+=a.encryptedContent[u].value}else s=a.encryptedContent;e.encryptedContent={algorithm:i.derToOid(a.encAlgorithm),parameter:n.util.createBuffer(a.encParameter.value),content:n.util.createBuffer(s)}}if(a.content){s="";if(n.util.isArray(a.content))for(u=0;u<a.content.length;++u){if(a.content[u].type!==i.Type.OCTETSTRING)throw new Error("Malformed PKCS#7 message, expecting content constructed of only OCTET STRING objects.");s+=a.content[u].value}else s=a.content;e.content=n.util.createBuffer(s)}return e.version=a.version.charCodeAt(0),e.rawCapture=a,a}function f(e){if(void 0===e.encryptedContent.key)throw new Error("Symmetric key not available.");if(void 0===e.content){var t;switch(e.encryptedContent.algorithm){case n.pki.oids["aes128-CBC"]:case n.pki.oids["aes192-CBC"]:case n.pki.oids["aes256-CBC"]:t=n.aes.createDecryptionCipher(e.encryptedContent.key);break;case n.pki.oids.desCBC:case n.pki.oids["des-EDE3-CBC"]:t=n.des.createDecryptionCipher(e.encryptedContent.key);break;default:throw new Error("Unsupported symmetric cipher, OID "+e.encryptedContent.algorithm)}if(t.start(e.encryptedContent.parameter),t.update(e.encryptedContent.content),!t.finish())throw new Error("Symmetric decryption failed.");e.content=t.output}}a.messageFromPem=function(e){var t=n.pem.decode(e)[0];if("PKCS7"!==t.type){var r=new Error('Could not convert PKCS#7 message from PEM; PEM header type is not "PKCS#7".');throw r.headerType=t.type,r}if(t.procType&&"ENCRYPTED"===t.procType.type)throw new Error("Could not convert PKCS#7 message from PEM; PEM is encrypted.");var o=i.fromDer(t.body);return a.messageFromAsn1(o)},a.messageToPem=function(e,t){var r={type:"PKCS7",body:i.toDer(e.toAsn1()).getBytes()};return n.pem.encode(r,{maxline:t})},a.messageFromAsn1=function(e){var t={},r=[];if(!i.validate(e,a.asn1.contentInfoValidator,t,r)){var o=new Error("Cannot read PKCS#7 message. ASN.1 object is not an PKCS#7 ContentInfo.");throw o.errors=r,o}var s,u=i.derToOid(t.contentType);switch(u){case n.pki.oids.envelopedData:s=a.createEnvelopedData();break;case n.pki.oids.encryptedData:s=a.createEncryptedData();break;case n.pki.oids.signedData:s=a.createSignedData();break;default:throw new Error("Cannot read PKCS#7 message. ContentType with OID "+u+" is not (yet) supported.")}return s.fromAsn1(t.content.value[0]),s},a.createSignedData=function(){var e=null;return e={type:n.pki.oids.signedData,version:1,certificates:[],crls:[],signers:[],digestAlgorithmIdentifiers:[],contentInfo:null,signerInfos:[],fromAsn1:function(t){if(l(e,t,a.asn1.signedDataValidator),e.certificates=[],e.crls=[],e.digestAlgorithmIdentifiers=[],e.contentInfo=null,e.signerInfos=[],e.rawCapture.certificates)for(var r=e.rawCapture.certificates.value,i=0;i<r.length;++i)e.certificates.push(n.pki.certificateFromAsn1(r[i]))},toAsn1:function(){e.contentInfo||e.sign();for(var t=[],r=0;r<e.certificates.length;++r)t.push(n.pki.certificateToAsn1(e.certificates[r]));var a=[],o=i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(e.version).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SET,!0,e.digestAlgorithmIdentifiers),e.contentInfo])]);return t.length>0&&o.value[0].value.push(i.create(i.Class.CONTEXT_SPECIFIC,0,!0,t)),a.length>0&&o.value[0].value.push(i.create(i.Class.CONTEXT_SPECIFIC,1,!0,a)),o.value[0].value.push(i.create(i.Class.UNIVERSAL,i.Type.SET,!0,e.signerInfos)),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.type).getBytes()),o])},addSigner:function(t){var r=t.issuer,i=t.serialNumber;if(t.certificate){var a=t.certificate;"string"==typeof a&&(a=n.pki.certificateFromPem(a)),r=a.issuer.attributes,i=a.serialNumber}var o=t.key;if(!o)throw new Error("Could not add PKCS#7 signer; no private key specified.");"string"==typeof o&&(o=n.pki.privateKeyFromPem(o));var s=t.digestAlgorithm||n.pki.oids.sha1;switch(s){case n.pki.oids.sha1:case n.pki.oids.sha256:case n.pki.oids.sha384:case n.pki.oids.sha512:case n.pki.oids.md5:break;default:throw new Error("Could not add PKCS#7 signer; unknown message digest algorithm: "+s)}var u=t.authenticatedAttributes||[];if(u.length>0){for(var c=!1,l=!1,f=0;f<u.length;++f){var h=u[f];if(c||h.type!==n.pki.oids.contentType){if(l||h.type!==n.pki.oids.messageDigest);else if(l=!0,c)break}else if(c=!0,l)break}if(!c||!l)throw new Error("Invalid signer.authenticatedAttributes. If signer.authenticatedAttributes is specified, then it must contain at least two attributes, PKCS #9 content-type and PKCS #9 message-digest.")}e.signers.push({key:o,version:1,issuer:r,serialNumber:i,digestAlgorithm:s,signatureAlgorithm:n.pki.oids.rsaEncryption,signature:null,authenticatedAttributes:u,unauthenticatedAttributes:[]})},sign:function(t){var r;(t=t||{},"object"!=typeof e.content||null===e.contentInfo)&&(e.contentInfo=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(n.pki.oids.data).getBytes())]),"content"in e&&(e.content instanceof n.util.ByteBuffer?r=e.content.bytes():"string"==typeof e.content&&(r=n.util.encodeUtf8(e.content)),t.detached?e.detachedContent=i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,r):e.contentInfo.value.push(i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,r)]))));0!==e.signers.length&&function(t){var r;r=e.detachedContent?e.detachedContent:(r=e.contentInfo.value[1]).value[0];if(!r)throw new Error("Could not sign PKCS#7 message; there is no content to sign.");var a=i.derToOid(e.contentInfo.value[0].value),o=i.toDer(r);for(var s in o.getByte(),i.getBerValueLength(o),o=o.getBytes(),t)t[s].start().update(o);for(var l=new Date,f=0;f<e.signers.length;++f){var h=e.signers[f];if(0===h.authenticatedAttributes.length){if(a!==n.pki.oids.data)throw new Error("Invalid signer; authenticatedAttributes must be present when the ContentInfo content type is not PKCS#7 Data.")}else{h.authenticatedAttributesAsn1=i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[]);for(var p=i.create(i.Class.UNIVERSAL,i.Type.SET,!0,[]),d=0;d<h.authenticatedAttributes.length;++d){var y=h.authenticatedAttributes[d];y.type===n.pki.oids.messageDigest?y.value=t[h.digestAlgorithm].digest():y.type===n.pki.oids.signingTime&&(y.value||(y.value=l)),p.value.push(c(y)),h.authenticatedAttributesAsn1.value.push(c(y))}o=i.toDer(p).getBytes(),h.md.start().update(o)}h.signature=h.key.sign(h.md,"RSASSA-PKCS1-V1_5")}e.signerInfos=function(e){for(var t=[],r=0;r<e.length;++r)t.push(u(e[r]));return t}(e.signers)}(function(){for(var t={},r=0;r<e.signers.length;++r){var a=e.signers[r];(o=a.digestAlgorithm)in t||(t[o]=n.md[n.pki.oids[o]].create()),0===a.authenticatedAttributes.length?a.md=t[o]:a.md=n.md[n.pki.oids[o]].create()}for(var o in e.digestAlgorithmIdentifiers=[],t)e.digestAlgorithmIdentifiers.push(i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(o).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.NULL,!1,"")]));return t}())},verify:function(){throw new Error("PKCS#7 signature verification not yet implemented.")},addCertificate:function(t){"string"==typeof t&&(t=n.pki.certificateFromPem(t)),e.certificates.push(t)},addCertificateRevokationList:function(e){throw new Error("PKCS#7 CRL support not yet implemented.")}}},a.createEncryptedData=function(){var e=null;return e={type:n.pki.oids.encryptedData,version:0,encryptedContent:{algorithm:n.pki.oids["aes256-CBC"]},fromAsn1:function(t){l(e,t,a.asn1.encryptedDataValidator)},decrypt:function(t){void 0!==t&&(e.encryptedContent.key=t),f(e)}}},a.createEnvelopedData=function(){var e=null;return e={type:n.pki.oids.envelopedData,version:0,recipients:[],encryptedContent:{algorithm:n.pki.oids["aes256-CBC"]},fromAsn1:function(t){var r=l(e,t,a.asn1.envelopedDataValidator);e.recipients=function(e){for(var t=[],r=0;r<e.length;++r)t.push(o(e[r]));return t}(r.recipientInfos.value)},toAsn1:function(){return i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.type).getBytes()),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(e.version).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SET,!0,s(e.recipients)),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,(t=e.encryptedContent,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(n.pki.oids.data).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(t.algorithm).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,t.parameter.getBytes())]),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,t.content.getBytes())])]))])])]);var t},findRecipient:function(t){for(var r=t.issuer.attributes,n=0;n<e.recipients.length;++n){var i=e.recipients[n],a=i.issuer;if(i.serialNumber===t.serialNumber&&a.length===r.length){for(var o=!0,s=0;s<r.length;++s)if(a[s].type!==r[s].type||a[s].value!==r[s].value){o=!1;break}if(o)return i}}return null},decrypt:function(t,r){if(void 0===e.encryptedContent.key&&void 0!==t&&void 0!==r)switch(t.encryptedContent.algorithm){case n.pki.oids.rsaEncryption:case n.pki.oids.desCBC:var i=r.decrypt(t.encryptedContent.content);e.encryptedContent.key=n.util.createBuffer(i);break;default:throw new Error("Unsupported asymmetric cipher, OID "+t.encryptedContent.algorithm)}f(e)},addRecipient:function(t){e.recipients.push({version:0,issuer:t.issuer.attributes,serialNumber:t.serialNumber,encryptedContent:{algorithm:n.pki.oids.rsaEncryption,key:t.publicKey}})},encrypt:function(t,r){if(void 0===e.encryptedContent.content){var i,a,o;switch(r=r||e.encryptedContent.algorithm,t=t||e.encryptedContent.key,r){case n.pki.oids["aes128-CBC"]:i=16,a=16,o=n.aes.createEncryptionCipher;break;case n.pki.oids["aes192-CBC"]:i=24,a=16,o=n.aes.createEncryptionCipher;break;case n.pki.oids["aes256-CBC"]:i=32,a=16,o=n.aes.createEncryptionCipher;break;case n.pki.oids["des-EDE3-CBC"]:i=24,a=8,o=n.des.createEncryptionCipher;break;default:throw new Error("Unsupported symmetric cipher, OID "+r)}if(void 0===t)t=n.util.createBuffer(n.random.getBytes(i));else if(t.length()!=i)throw new Error("Symmetric key has wrong length; got "+t.length()+" bytes, expected "+i+".");e.encryptedContent.algorithm=r,e.encryptedContent.key=t,e.encryptedContent.parameter=n.util.createBuffer(n.random.getBytes(a));var s=o(t);if(s.start(e.encryptedContent.parameter.copy()),s.update(e.content),!s.finish())throw new Error("Symmetric encryption failed.");e.encryptedContent.content=s.output}for(var u=0;u<e.recipients.length;++u){var c=e.recipients[u];if(void 0===c.encryptedContent.content)switch(c.encryptedContent.algorithm){case n.pki.oids.rsaEncryption:c.encryptedContent.content=c.encryptedContent.key.encrypt(e.encryptedContent.key.data);break;default:throw new Error("Unsupported asymmetric cipher, OID "+c.encryptedContent.algorithm)}}}}}},5496:(e,t,r)=>{var n=r(3832);r(3068),r(7116);var i=n.asn1,a=e.exports=n.pkcs7asn1=n.pkcs7asn1||{};n.pkcs7=n.pkcs7||{},n.pkcs7.asn1=a;var o={name:"ContentInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.ContentType",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:i.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,captureAsn1:"content"}]};a.contentInfoValidator=o;var s={name:"EncryptedContentInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentType",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"contentType"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentEncryptionAlgorithm.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm.parameter",tagClass:i.Class.UNIVERSAL,captureAsn1:"encParameter"}]},{name:"EncryptedContentInfo.encryptedContent",tagClass:i.Class.CONTEXT_SPECIFIC,type:0,capture:"encryptedContent",captureAsn1:"encryptedContentAsn1"}]};a.envelopedDataValidator={name:"EnvelopedData",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"EnvelopedData.Version",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"version"},{name:"EnvelopedData.RecipientInfos",tagClass:i.Class.UNIVERSAL,type:i.Type.SET,constructed:!0,captureAsn1:"recipientInfos"}].concat(s)},a.encryptedDataValidator={name:"EncryptedData",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedData.Version",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"version"}].concat(s)};var u={name:"SignerInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.version",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1},{name:"SignerInfo.issuerAndSerialNumber",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.issuerAndSerialNumber.issuer",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"SignerInfo.issuerAndSerialNumber.serialNumber",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"SignerInfo.digestAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.digestAlgorithm.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"digestAlgorithm"},{name:"SignerInfo.digestAlgorithm.parameter",tagClass:i.Class.UNIVERSAL,constructed:!1,captureAsn1:"digestParameter",optional:!0}]},{name:"SignerInfo.authenticatedAttributes",tagClass:i.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"authenticatedAttributes"},{name:"SignerInfo.digestEncryptionAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,capture:"signatureAlgorithm"},{name:"SignerInfo.encryptedDigest",tagClass:i.Class.UNIVERSAL,type:i.Type.OCTETSTRING,constructed:!1,capture:"signature"},{name:"SignerInfo.unauthenticatedAttributes",tagClass:i.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,capture:"unauthenticatedAttributes"}]};a.signedDataValidator={name:"SignedData",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"SignedData.Version",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"version"},{name:"SignedData.DigestAlgorithms",tagClass:i.Class.UNIVERSAL,type:i.Type.SET,constructed:!0,captureAsn1:"digestAlgorithms"},o,{name:"SignedData.Certificates",tagClass:i.Class.CONTEXT_SPECIFIC,type:0,optional:!0,captureAsn1:"certificates"},{name:"SignedData.CertificateRevocationLists",tagClass:i.Class.CONTEXT_SPECIFIC,type:1,optional:!0,captureAsn1:"crls"},{name:"SignedData.SignerInfos",tagClass:i.Class.UNIVERSAL,type:i.Type.SET,capture:"signerInfos",optional:!0,value:[u]}]},a.recipientInfoValidator={name:"RecipientInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.version",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"version"},{name:"RecipientInfo.issuerAndSerial",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.issuerAndSerial.issuer",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"RecipientInfo.issuerAndSerial.serialNumber",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"RecipientInfo.keyEncryptionAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.keyEncryptionAlgorithm.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"RecipientInfo.keyEncryptionAlgorithm.parameter",tagClass:i.Class.UNIVERSAL,constructed:!1,captureAsn1:"encParameter"}]},{name:"RecipientInfo.encryptedKey",tagClass:i.Class.UNIVERSAL,type:i.Type.OCTETSTRING,constructed:!1,capture:"encKey"}]}},4742:(e,t,r)=>{var n=r(3832);r(3068),r(6270),r(7450),r(6953),r(8960),r(5147),r(6007),r(8095),r(7116),r(5414);var i=n.asn1,a=e.exports=n.pki=n.pki||{};a.pemToDer=function(e){var t=n.pem.decode(e)[0];if(t.procType&&"ENCRYPTED"===t.procType.type)throw new Error("Could not convert PEM to DER; PEM is encrypted.");return n.util.createBuffer(t.body)},a.privateKeyFromPem=function(e){var t=n.pem.decode(e)[0];if("PRIVATE KEY"!==t.type&&"RSA PRIVATE KEY"!==t.type){var r=new Error('Could not convert private key from PEM; PEM header type is not "PRIVATE KEY" or "RSA PRIVATE KEY".');throw r.headerType=t.type,r}if(t.procType&&"ENCRYPTED"===t.procType.type)throw new Error("Could not convert private key from PEM; PEM is encrypted.");var o=i.fromDer(t.body);return a.privateKeyFromAsn1(o)},a.privateKeyToPem=function(e,t){var r={type:"RSA PRIVATE KEY",body:i.toDer(a.privateKeyToAsn1(e)).getBytes()};return n.pem.encode(r,{maxline:t})},a.privateKeyInfoToPem=function(e,t){var r={type:"PRIVATE KEY",body:i.toDer(e).getBytes()};return n.pem.encode(r,{maxline:t})}},9654:(e,t,r)=>{var n=r(3832);r(7116),r(5764),r(9563),function(){if(n.prime)e.exports=n.prime;else{var t=e.exports=n.prime=n.prime||{},r=n.jsbn.BigInteger,i=[6,4,2,4,2,4,6,2],a=new r(null);a.fromInt(30);var o=function(e,t){return e|t};t.generateProbablePrime=function(e,t,i){"function"==typeof t&&(i=t,t={});var a=(t=t||{}).algorithm||"PRIMEINC";"string"==typeof a&&(a={name:a}),a.options=a.options||{};var o=t.prng||n.random,u={nextBytes:function(e){for(var t=o.getBytesSync(e.length),r=0;r<e.length;++r)e[r]=t.charCodeAt(r)}};if("PRIMEINC"===a.name)return function(e,t,i,a){if("workers"in i)return function(e,t,i,a){if("undefined"==typeof Worker)return s(e,t,i,a);var o=c(e,t),u=i.workers,l=i.workLoad||100,f=30*l/8,h=i.workerScript||"forge/prime.worker.js";if(-1===u)return n.util.estimateCores((function(e,t){e&&(t=2),u=t-1,p()}));function p(){u=Math.max(1,u);for(var n=[],i=0;i<u;++i)n[i]=new Worker(h);for(i=0;i<u;++i)n[i].addEventListener("message",p);var s=!1;function p(i){if(!s){0;var u=i.data;if(u.found){for(var h=0;h<n.length;++h)n[h].terminate();return s=!0,a(null,new r(u.prime,16))}o.bitLength()>e&&(o=c(e,t));var p=o.toString(16);i.target.postMessage({hex:p,workLoad:l}),o.dAddOffset(f,0)}}}p()}(e,t,i,a);return s(e,t,i,a)}(e,u,a.options,i);throw new Error("Invalid prime generation algorithm: "+a.name)}}function s(e,t,r,n){var i=c(e,t),a=function(e){return e<=100?27:e<=150?18:e<=200?15:e<=250?12:e<=300?9:e<=350?8:e<=400?7:e<=500?6:e<=600?5:e<=800?4:e<=1250?3:2}(i.bitLength());"millerRabinTests"in r&&(a=r.millerRabinTests);var o=10;"maxBlockTime"in r&&(o=r.maxBlockTime),u(i,e,t,0,a,o,n)}function u(e,t,r,a,o,s,l){var f=+new Date;do{if(e.bitLength()>t&&(e=c(t,r)),e.isProbablePrime(o))return l(null,e);e.dAddOffset(i[a++%8],0)}while(s<0||+new Date-f<s);n.util.setImmediate((function(){u(e,t,r,a,o,s,l)}))}function c(e,t){var n=new r(e,t),i=e-1;return n.testBit(i)||n.bitwiseTo(r.ONE.shiftLeft(i),o,n),n.dAddOffset(31-n.mod(a).byteValue(),0),n}}()},4933:(e,t,r)=>{var n=r(3832);r(7116);var i=null;!n.util.isNodejs||n.options.usePureJavaScript||process.versions["node-webkit"]||(i=r(5819)),(e.exports=n.prng=n.prng||{}).create=function(e){for(var t={plugin:e,key:null,seed:null,time:null,reseeds:0,generated:0,keyBytes:""},r=e.md,a=new Array(32),o=0;o<32;++o)a[o]=r.create();function s(){if(t.pools[0].messageLength>=32)return u();var e=32-t.pools[0].messageLength<<5;t.collect(t.seedFileSync(e)),u()}function u(){t.reseeds=4294967295===t.reseeds?0:t.reseeds+1;var e=t.plugin.md.create();e.update(t.keyBytes);for(var r=1,n=0;n<32;++n)t.reseeds%r==0&&(e.update(t.pools[n].digest().getBytes()),t.pools[n].start()),r<<=1;t.keyBytes=e.digest().getBytes(),e.start(),e.update(t.keyBytes);var i=e.digest().getBytes();t.key=t.plugin.formatKey(t.keyBytes),t.seed=t.plugin.formatSeed(i),t.generated=0}function c(e){var t=null,r=n.util.globalScope,i=r.crypto||r.msCrypto;i&&i.getRandomValues&&(t=function(e){return i.getRandomValues(e)});var a=n.util.createBuffer();if(t)for(;a.length()<e;){var o=Math.max(1,Math.min(e-a.length(),65536)/4),s=new Uint32Array(Math.floor(o));try{t(s);for(var u=0;u<s.length;++u)a.putInt32(s[u])}catch(e){if(!("undefined"!=typeof QuotaExceededError&&e instanceof QuotaExceededError))throw e}}if(a.length()<e)for(var c,l,f,h=Math.floor(65536*Math.random());a.length()<e;){l=16807*(65535&h),l+=(32767&(c=16807*(h>>16)))<<16,h=4294967295&(l=(2147483647&(l+=c>>15))+(l>>31));for(u=0;u<3;++u)f=h>>>(u<<3),f^=Math.floor(256*Math.random()),a.putByte(String.fromCharCode(255&f))}return a.getBytes(e)}return t.pools=a,t.pool=0,t.generate=function(e,r){if(!r)return t.generateSync(e);var i=t.plugin.cipher,a=t.plugin.increment,o=t.plugin.formatKey,s=t.plugin.formatSeed,c=n.util.createBuffer();t.key=null,function l(f){if(f)return r(f);if(c.length()>=e)return r(null,c.getBytes(e));t.generated>1048575&&(t.key=null);if(null===t.key)return n.util.nextTick((function(){!function(e){if(t.pools[0].messageLength>=32)return u(),e();var r=32-t.pools[0].messageLength<<5;t.seedFile(r,(function(r,n){if(r)return e(r);t.collect(n),u(),e()}))}(l)}));var h=i(t.key,t.seed);t.generated+=h.length,c.putBytes(h),t.key=o(i(t.key,a(t.seed))),t.seed=s(i(t.key,t.seed)),n.util.setImmediate(l)}()},t.generateSync=function(e){var r=t.plugin.cipher,i=t.plugin.increment,a=t.plugin.formatKey,o=t.plugin.formatSeed;t.key=null;for(var u=n.util.createBuffer();u.length()<e;){t.generated>1048575&&(t.key=null),null===t.key&&s();var c=r(t.key,t.seed);t.generated+=c.length,u.putBytes(c),t.key=a(r(t.key,i(t.seed))),t.seed=o(r(t.key,t.seed))}return u.getBytes(e)},i?(t.seedFile=function(e,t){i.randomBytes(e,(function(e,r){if(e)return t(e);t(null,r.toString())}))},t.seedFileSync=function(e){return i.randomBytes(e).toString()}):(t.seedFile=function(e,t){try{t(null,c(e))}catch(e){t(e)}},t.seedFileSync=c),t.collect=function(e){for(var r=e.length,n=0;n<r;++n)t.pools[t.pool].update(e.substr(n,1)),t.pool=31===t.pool?0:t.pool+1},t.collectInt=function(e,r){for(var n="",i=0;i<r;i+=8)n+=String.fromCharCode(e>>i&255);t.collect(n)},t.registerWorker=function(e){if(e===self)t.seedFile=function(e,t){self.addEventListener("message",(function e(r){var n=r.data;n.forge&&n.forge.prng&&(self.removeEventListener("message",e),t(n.forge.prng.err,n.forge.prng.bytes))})),self.postMessage({forge:{prng:{needed:e}}})};else{e.addEventListener("message",(function(r){var n=r.data;n.forge&&n.forge.prng&&t.seedFile(n.forge.prng.needed,(function(t,r){e.postMessage({forge:{prng:{err:t,bytes:r}}})}))}))}},t}},6007:(e,t,r)=>{var n=r(3832);r(9563),r(7116),(e.exports=n.pss=n.pss||{}).create=function(e){3===arguments.length&&(e={md:arguments[0],mgf:arguments[1],saltLength:arguments[2]});var t,r=e.md,i=e.mgf,a=r.digestLength,o=e.salt||null;if("string"==typeof o&&(o=n.util.createBuffer(o)),"saltLength"in e)t=e.saltLength;else{if(null===o)throw new Error("Salt length not specified or specific salt not given.");t=o.length()}if(null!==o&&o.length()!==t)throw new Error("Given salt length does not match length of given salt.");var s=e.prng||n.random,u={encode:function(e,u){var c,l,f=u-1,h=Math.ceil(f/8),p=e.digest().getBytes();if(h<a+t+2)throw new Error("Message is too long to encrypt.");l=null===o?s.getBytesSync(t):o.bytes();var d=new n.util.ByteBuffer;d.fillWithByte(0,8),d.putBytes(p),d.putBytes(l),r.start(),r.update(d.getBytes());var y=r.digest().getBytes(),v=new n.util.ByteBuffer;v.fillWithByte(0,h-t-a-2),v.putByte(1),v.putBytes(l);var g=v.getBytes(),m=h-a-1,b=i.generate(y,m),E="";for(c=0;c<m;c++)E+=String.fromCharCode(g.charCodeAt(c)^b.charCodeAt(c));var S=65280>>8*h-f&255;return(E=String.fromCharCode(E.charCodeAt(0)&~S)+E.substr(1))+y+String.fromCharCode(188)},verify:function(e,o,s){var u,c=s-1,l=Math.ceil(c/8);if(o=o.substr(-l),l<a+t+2)throw new Error("Inconsistent parameters to PSS signature verification.");if(188!==o.charCodeAt(l-1))throw new Error("Encoded message does not end in 0xBC.");var f=l-a-1,h=o.substr(0,f),p=o.substr(f,a),d=65280>>8*l-c&255;if(0!=(h.charCodeAt(0)&d))throw new Error("Bits beyond keysize not zero as expected.");var y=i.generate(p,f),v="";for(u=0;u<f;u++)v+=String.fromCharCode(h.charCodeAt(u)^y.charCodeAt(u));v=String.fromCharCode(v.charCodeAt(0)&~d)+v.substr(1);var g=l-a-t-2;for(u=0;u<g;u++)if(0!==v.charCodeAt(u))throw new Error("Leftmost octets not zero as expected");if(1!==v.charCodeAt(g))throw new Error("Inconsistent PSS signature, 0x01 marker not found");var m=v.substr(-t),b=new n.util.ByteBuffer;return b.fillWithByte(0,8),b.putBytes(e),b.putBytes(m),r.start(),r.update(b.getBytes()),p===r.digest().getBytes()}};return u}},9563:(e,t,r)=>{var n=r(3832);r(8925),r(1668),r(4933),r(7116),n.random&&n.random.getBytes?e.exports=n.random:function(t){var r={},i=new Array(4),a=n.util.createBuffer();function o(){var e=n.prng.create(r);return e.getBytes=function(t,r){return e.generate(t,r)},e.getBytesSync=function(t){return e.generate(t)},e}r.formatKey=function(e){var t=n.util.createBuffer(e);return(e=new Array(4))[0]=t.getInt32(),e[1]=t.getInt32(),e[2]=t.getInt32(),e[3]=t.getInt32(),n.aes._expandKey(e,!1)},r.formatSeed=function(e){var t=n.util.createBuffer(e);return(e=new Array(4))[0]=t.getInt32(),e[1]=t.getInt32(),e[2]=t.getInt32(),e[3]=t.getInt32(),e},r.cipher=function(e,t){return n.aes._updateBlock(e,t,i,!1),a.putInt32(i[0]),a.putInt32(i[1]),a.putInt32(i[2]),a.putInt32(i[3]),a.getBytes()},r.increment=function(e){return++e[3],e},r.md=n.md.sha256;var s=o(),u=null,c=n.util.globalScope,l=c.crypto||c.msCrypto;if(l&&l.getRandomValues&&(u=function(e){return l.getRandomValues(e)}),n.options.usePureJavaScript||!n.util.isNodejs&&!u){if("undefined"==typeof window||window.document,s.collectInt(+new Date,32),"undefined"!=typeof navigator){var f="";for(var h in navigator)try{"string"==typeof navigator[h]&&(f+=navigator[h])}catch(e){}s.collect(f),f=null}t&&(t().mousemove((function(e){s.collectInt(e.clientX,16),s.collectInt(e.clientY,16)})),t().keypress((function(e){s.collectInt(e.charCode,8)})))}if(n.random)for(var h in s)n.random[h]=s[h];else n.random=s;n.random.createInstance=o,e.exports=n.random}("undefined"!=typeof jQuery?jQuery:null)},9372:(e,t,r)=>{var n=r(3832);r(7116);var i=[217,120,249,196,25,221,181,237,40,233,253,121,74,160,216,157,198,126,55,131,43,118,83,142,98,76,100,136,68,139,251,162,23,154,89,245,135,179,79,19,97,69,109,141,9,129,125,50,189,143,64,235,134,183,123,11,240,149,33,34,92,107,78,130,84,214,101,147,206,96,178,28,115,86,192,20,167,140,241,220,18,117,202,31,59,190,228,209,66,61,212,48,163,60,182,38,111,191,14,218,70,105,7,87,39,242,29,155,188,148,67,3,248,17,199,246,144,239,62,231,6,195,213,47,200,102,30,215,8,232,234,222,128,82,238,247,132,170,114,172,53,77,106,42,150,26,210,113,90,21,73,116,75,159,208,94,4,24,164,236,194,224,65,110,15,81,203,204,36,145,175,80,161,244,112,57,153,124,58,133,35,184,180,122,252,2,54,91,37,85,151,49,45,93,250,152,227,138,146,174,5,223,41,16,103,108,186,201,211,0,230,207,225,158,168,44,99,22,1,63,88,226,137,169,13,56,52,27,171,51,255,176,187,72,12,95,185,177,205,46,197,243,219,71,229,165,156,119,10,166,32,104,254,127,193,173],a=[1,2,3,5],o=function(e,t){return e<<t&65535|(65535&e)>>16-t},s=function(e,t){return(65535&e)>>t|e<<16-t&65535};e.exports=n.rc2=n.rc2||{},n.rc2.expandKey=function(e,t){"string"==typeof e&&(e=n.util.createBuffer(e)),t=t||128;var r,a=e,o=e.length(),s=t,u=Math.ceil(s/8),c=255>>(7&s);for(r=o;r<128;r++)a.putByte(i[a.at(r-1)+a.at(r-o)&255]);for(a.setAt(128-u,i[a.at(128-u)&c]),r=127-u;r>=0;r--)a.setAt(r,i[a.at(r+1)^a.at(r+u)]);return a};var u=function(e,t,r){var i,u,c,l,f=!1,h=null,p=null,d=null,y=[];for(e=n.rc2.expandKey(e,t),c=0;c<64;c++)y.push(e.getInt16Le());r?(i=function(e){for(c=0;c<4;c++)e[c]+=y[l]+(e[(c+3)%4]&e[(c+2)%4])+(~e[(c+3)%4]&e[(c+1)%4]),e[c]=o(e[c],a[c]),l++},u=function(e){for(c=0;c<4;c++)e[c]+=y[63&e[(c+3)%4]]}):(i=function(e){for(c=3;c>=0;c--)e[c]=s(e[c],a[c]),e[c]-=y[l]+(e[(c+3)%4]&e[(c+2)%4])+(~e[(c+3)%4]&e[(c+1)%4]),l--},u=function(e){for(c=3;c>=0;c--)e[c]-=y[63&e[(c+3)%4]]});var v=function(e){var t=[];for(c=0;c<4;c++){var n=h.getInt16Le();null!==d&&(r?n^=d.getInt16Le():d.putInt16Le(n)),t.push(65535&n)}l=r?0:63;for(var i=0;i<e.length;i++)for(var a=0;a<e[i][0];a++)e[i][1](t);for(c=0;c<4;c++)null!==d&&(r?d.putInt16Le(t[c]):t[c]^=d.getInt16Le()),p.putInt16Le(t[c])},g=null;return g={start:function(e,t){e&&"string"==typeof e&&(e=n.util.createBuffer(e)),f=!1,h=n.util.createBuffer(),p=t||new n.util.createBuffer,d=e,g.output=p},update:function(e){for(f||h.putBuffer(e);h.length()>=8;)v([[5,i],[1,u],[6,i],[1,u],[5,i]])},finish:function(e){var t=!0;if(r)if(e)t=e(8,h,!r);else{var n=8===h.length()?8:8-h.length();h.fillWithByte(n,n)}if(t&&(f=!0,g.update()),!r&&(t=0===h.length()))if(e)t=e(8,p,!r);else{var i=p.length(),a=p.at(i-1);a>i?t=!1:p.truncate(a)}return t}}};n.rc2.startEncrypting=function(e,t,r){var i=n.rc2.createEncryptionCipher(e,128);return i.start(t,r),i},n.rc2.createEncryptionCipher=function(e,t){return u(e,t,!0)},n.rc2.startDecrypting=function(e,t,r){var i=n.rc2.createDecryptionCipher(e,128);return i.start(t,r),i},n.rc2.createDecryptionCipher=function(e,t){return u(e,t,!1)}},8095:(e,t,r)=>{var n=r(3832);if(r(3068),r(5764),r(6270),r(8936),r(9654),r(9563),r(7116),void 0===i)var i=n.jsbn.BigInteger;var a=n.util.isNodejs?r(5819):null,o=n.asn1,s=n.util;n.pki=n.pki||{},e.exports=n.pki.rsa=n.rsa=n.rsa||{};var u=n.pki,c=[6,4,2,4,2,4,6,2],l={name:"PrivateKeyInfo",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:o.Class.UNIVERSAL,type:o.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:o.Class.UNIVERSAL,type:o.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]},f={name:"RSAPrivateKey",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPrivateKey.version",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"RSAPrivateKey.modulus",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"privateKeyModulus"},{name:"RSAPrivateKey.publicExponent",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"privateKeyPublicExponent"},{name:"RSAPrivateKey.privateExponent",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"privateKeyPrivateExponent"},{name:"RSAPrivateKey.prime1",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"privateKeyPrime1"},{name:"RSAPrivateKey.prime2",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"privateKeyPrime2"},{name:"RSAPrivateKey.exponent1",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"privateKeyExponent1"},{name:"RSAPrivateKey.exponent2",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"privateKeyExponent2"},{name:"RSAPrivateKey.coefficient",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"privateKeyCoefficient"}]},h={name:"RSAPublicKey",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPublicKey.modulus",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"publicKeyModulus"},{name:"RSAPublicKey.exponent",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"publicKeyExponent"}]},p=n.pki.rsa.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:o.Class.UNIVERSAL,type:o.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{name:"SubjectPublicKeyInfo.subjectPublicKey",tagClass:o.Class.UNIVERSAL,type:o.Type.BITSTRING,constructed:!1,value:[{name:"SubjectPublicKeyInfo.subjectPublicKey.RSAPublicKey",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"rsaPublicKey"}]}]},d=function(e){var t;if(!(e.algorithm in u.oids)){var r=new Error("Unknown message digest algorithm.");throw r.algorithm=e.algorithm,r}t=u.oids[e.algorithm];var n=o.oidToDer(t).getBytes(),i=o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[]),a=o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[]);a.value.push(o.create(o.Class.UNIVERSAL,o.Type.OID,!1,n)),a.value.push(o.create(o.Class.UNIVERSAL,o.Type.NULL,!1,""));var s=o.create(o.Class.UNIVERSAL,o.Type.OCTETSTRING,!1,e.digest().getBytes());return i.value.push(a),i.value.push(s),o.toDer(i).getBytes()},y=function(e,t,r){if(r)return e.modPow(t.e,t.n);if(!t.p||!t.q)return e.modPow(t.d,t.n);var a;t.dP||(t.dP=t.d.mod(t.p.subtract(i.ONE))),t.dQ||(t.dQ=t.d.mod(t.q.subtract(i.ONE))),t.qInv||(t.qInv=t.q.modInverse(t.p));do{a=new i(n.util.bytesToHex(n.random.getBytes(t.n.bitLength()/8)),16)}while(a.compareTo(t.n)>=0||!a.gcd(t.n).equals(i.ONE));for(var o=(e=e.multiply(a.modPow(t.e,t.n)).mod(t.n)).mod(t.p).modPow(t.dP,t.p),s=e.mod(t.q).modPow(t.dQ,t.q);o.compareTo(s)<0;)o=o.add(t.p);var u=o.subtract(s).multiply(t.qInv).mod(t.p).multiply(t.q).add(s);return u=u.multiply(a.modInverse(t.n)).mod(t.n)};function v(e,t,r){var i=n.util.createBuffer(),a=Math.ceil(t.n.bitLength()/8);if(e.length>a-11){var o=new Error("Message is too long for PKCS#1 v1.5 padding.");throw o.length=e.length,o.max=a-11,o}i.putByte(0),i.putByte(r);var s,u=a-3-e.length;if(0===r||1===r){s=0===r?0:255;for(var c=0;c<u;++c)i.putByte(s)}else for(;u>0;){var l=0,f=n.random.getBytes(u);for(c=0;c<u;++c)0===(s=f.charCodeAt(c))?++l:i.putByte(s);u=l}return i.putByte(0),i.putBytes(e),i}function g(e,t,r,i){var a=Math.ceil(t.n.bitLength()/8),o=n.util.createBuffer(e),s=o.getByte(),u=o.getByte();if(0!==s||r&&0!==u&&1!==u||!r&&2!=u||r&&0===u&&void 0===i)throw new Error("Encryption block is invalid.");var c=0;if(0===u){c=a-3-i;for(var l=0;l<c;++l)if(0!==o.getByte())throw new Error("Encryption block is invalid.")}else if(1===u)for(c=0;o.length()>1;){if(255!==o.getByte()){--o.read;break}++c}else if(2===u)for(c=0;o.length()>1;){if(0===o.getByte()){--o.read;break}++c}if(0!==o.getByte()||c!==a-3-o.length())throw new Error("Encryption block is invalid.");return o.getBytes()}function m(e,t,r){"function"==typeof t&&(r=t,t={});var a={algorithm:{name:(t=t||{}).algorithm||"PRIMEINC",options:{workers:t.workers||2,workLoad:t.workLoad||100,workerScript:t.workerScript}}};function o(){s(e.pBits,(function(t,n){return t?r(t):(e.p=n,null!==e.q?c(t,e.q):void s(e.qBits,c))}))}function s(e,t){n.prime.generateProbablePrime(e,a,t)}function c(t,n){if(t)return r(t);if(e.q=n,e.p.compareTo(e.q)<0){var a=e.p;e.p=e.q,e.q=a}if(0!==e.p.subtract(i.ONE).gcd(e.e).compareTo(i.ONE))return e.p=null,void o();if(0!==e.q.subtract(i.ONE).gcd(e.e).compareTo(i.ONE))return e.q=null,void s(e.qBits,c);if(e.p1=e.p.subtract(i.ONE),e.q1=e.q.subtract(i.ONE),e.phi=e.p1.multiply(e.q1),0!==e.phi.gcd(e.e).compareTo(i.ONE))return e.p=e.q=null,void o();if(e.n=e.p.multiply(e.q),e.n.bitLength()!==e.bits)return e.q=null,void s(e.qBits,c);var l=e.e.modInverse(e.phi);e.keys={privateKey:u.rsa.setPrivateKey(e.n,e.e,l,e.p,e.q,l.mod(e.p1),l.mod(e.q1),e.q.modInverse(e.p)),publicKey:u.rsa.setPublicKey(e.n,e.e)},r(null,e.keys)}"prng"in t&&(a.prng=t.prng),o()}function b(e){var t=e.toString(16);t[0]>="8"&&(t="00"+t);var r=n.util.hexToBytes(t);return r.length>1&&(0===r.charCodeAt(0)&&0==(128&r.charCodeAt(1))||255===r.charCodeAt(0)&&128==(128&r.charCodeAt(1)))?r.substr(1):r}function E(e){return e<=100?27:e<=150?18:e<=200?15:e<=250?12:e<=300?9:e<=350?8:e<=400?7:e<=500?6:e<=600?5:e<=800?4:e<=1250?3:2}function S(e){return n.util.isNodejs&&"function"==typeof a[e]}function C(e){return void 0!==s.globalScope&&"object"==typeof s.globalScope.crypto&&"object"==typeof s.globalScope.crypto.subtle&&"function"==typeof s.globalScope.crypto.subtle[e]}function w(e){return void 0!==s.globalScope&&"object"==typeof s.globalScope.msCrypto&&"object"==typeof s.globalScope.msCrypto.subtle&&"function"==typeof s.globalScope.msCrypto.subtle[e]}function T(e){for(var t=n.util.hexToBytes(e.toString(16)),r=new Uint8Array(t.length),i=0;i<t.length;++i)r[i]=t.charCodeAt(i);return r}u.rsa.encrypt=function(e,t,r){var a,o=r,s=Math.ceil(t.n.bitLength()/8);!1!==r&&!0!==r?(o=2===r,a=v(e,t,r)):(a=n.util.createBuffer()).putBytes(e);for(var u=new i(a.toHex(),16),c=y(u,t,o).toString(16),l=n.util.createBuffer(),f=s-Math.ceil(c.length/2);f>0;)l.putByte(0),--f;return l.putBytes(n.util.hexToBytes(c)),l.getBytes()},u.rsa.decrypt=function(e,t,r,a){var o=Math.ceil(t.n.bitLength()/8);if(e.length!==o){var s=new Error("Encrypted message length is invalid.");throw s.length=e.length,s.expected=o,s}var u=new i(n.util.createBuffer(e).toHex(),16);if(u.compareTo(t.n)>=0)throw new Error("Encrypted message is invalid.");for(var c=y(u,t,r).toString(16),l=n.util.createBuffer(),f=o-Math.ceil(c.length/2);f>0;)l.putByte(0),--f;return l.putBytes(n.util.hexToBytes(c)),!1!==a?g(l.getBytes(),t,r):l.getBytes()},u.rsa.createKeyPairGenerationState=function(e,t,r){"string"==typeof e&&(e=parseInt(e,10)),e=e||2048;var a,o=(r=r||{}).prng||n.random,s={nextBytes:function(e){for(var t=o.getBytesSync(e.length),r=0;r<e.length;++r)e[r]=t.charCodeAt(r)}},u=r.algorithm||"PRIMEINC";if("PRIMEINC"!==u)throw new Error("Invalid key generation algorithm: "+u);return(a={algorithm:u,state:0,bits:e,rng:s,eInt:t||65537,e:new i(null),p:null,q:null,qBits:e>>1,pBits:e-(e>>1),pqState:0,num:null,keys:null}).e.fromInt(a.eInt),a},u.rsa.stepKeyPairGenerationState=function(e,t){"algorithm"in e||(e.algorithm="PRIMEINC");var r=new i(null);r.fromInt(30);for(var n,a=0,o=function(e,t){return e|t},s=+new Date,l=0;null===e.keys&&(t<=0||l<t);){if(0===e.state){var f=null===e.p?e.pBits:e.qBits,h=f-1;0===e.pqState?(e.num=new i(f,e.rng),e.num.testBit(h)||e.num.bitwiseTo(i.ONE.shiftLeft(h),o,e.num),e.num.dAddOffset(31-e.num.mod(r).byteValue(),0),a=0,++e.pqState):1===e.pqState?e.num.bitLength()>f?e.pqState=0:e.num.isProbablePrime(E(e.num.bitLength()))?++e.pqState:e.num.dAddOffset(c[a++%8],0):2===e.pqState?e.pqState=0===e.num.subtract(i.ONE).gcd(e.e).compareTo(i.ONE)?3:0:3===e.pqState&&(e.pqState=0,null===e.p?e.p=e.num:e.q=e.num,null!==e.p&&null!==e.q&&++e.state,e.num=null)}else if(1===e.state)e.p.compareTo(e.q)<0&&(e.num=e.p,e.p=e.q,e.q=e.num),++e.state;else if(2===e.state)e.p1=e.p.subtract(i.ONE),e.q1=e.q.subtract(i.ONE),e.phi=e.p1.multiply(e.q1),++e.state;else if(3===e.state)0===e.phi.gcd(e.e).compareTo(i.ONE)?++e.state:(e.p=null,e.q=null,e.state=0);else if(4===e.state)e.n=e.p.multiply(e.q),e.n.bitLength()===e.bits?++e.state:(e.q=null,e.state=0);else if(5===e.state){var p=e.e.modInverse(e.phi);e.keys={privateKey:u.rsa.setPrivateKey(e.n,e.e,p,e.p,e.q,p.mod(e.p1),p.mod(e.q1),e.q.modInverse(e.p)),publicKey:u.rsa.setPublicKey(e.n,e.e)}}l+=(n=+new Date)-s,s=n}return null!==e.keys},u.rsa.generateKeyPair=function(e,t,r,i){if(1===arguments.length?"object"==typeof e?(r=e,e=void 0):"function"==typeof e&&(i=e,e=void 0):2===arguments.length?"number"==typeof e?"function"==typeof t?(i=t,t=void 0):"number"!=typeof t&&(r=t,t=void 0):(r=e,i=t,e=void 0,t=void 0):3===arguments.length&&("number"==typeof t?"function"==typeof r&&(i=r,r=void 0):(i=r,r=t,t=void 0)),r=r||{},void 0===e&&(e=r.bits||2048),void 0===t&&(t=r.e||65537),!n.options.usePureJavaScript&&!r.prng&&e>=256&&e<=16384&&(65537===t||3===t))if(i){if(S("generateKeyPair"))return a.generateKeyPair("rsa",{modulusLength:e,publicExponent:t,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}},(function(e,t,r){if(e)return i(e);i(null,{privateKey:u.privateKeyFromPem(r),publicKey:u.publicKeyFromPem(t)})}));if(C("generateKey")&&C("exportKey"))return s.globalScope.crypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:e,publicExponent:T(t),hash:{name:"SHA-256"}},!0,["sign","verify"]).then((function(e){return s.globalScope.crypto.subtle.exportKey("pkcs8",e.privateKey)})).then(void 0,(function(e){i(e)})).then((function(e){if(e){var t=u.privateKeyFromAsn1(o.fromDer(n.util.createBuffer(e)));i(null,{privateKey:t,publicKey:u.setRsaPublicKey(t.n,t.e)})}}));if(w("generateKey")&&w("exportKey")){var c=s.globalScope.msCrypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:e,publicExponent:T(t),hash:{name:"SHA-256"}},!0,["sign","verify"]);return c.oncomplete=function(e){var t=e.target.result,r=s.globalScope.msCrypto.subtle.exportKey("pkcs8",t.privateKey);r.oncomplete=function(e){var t=e.target.result,r=u.privateKeyFromAsn1(o.fromDer(n.util.createBuffer(t)));i(null,{privateKey:r,publicKey:u.setRsaPublicKey(r.n,r.e)})},r.onerror=function(e){i(e)}},void(c.onerror=function(e){i(e)})}}else if(S("generateKeyPairSync")){var l=a.generateKeyPairSync("rsa",{modulusLength:e,publicExponent:t,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}});return{privateKey:u.privateKeyFromPem(l.privateKey),publicKey:u.publicKeyFromPem(l.publicKey)}}var f=u.rsa.createKeyPairGenerationState(e,t,r);if(!i)return u.rsa.stepKeyPairGenerationState(f,0),f.keys;m(f,r,i)},u.setRsaPublicKey=u.rsa.setPublicKey=function(e,t){var r={n:e,e:t,encrypt:function(e,t,i){if("string"==typeof t?t=t.toUpperCase():void 0===t&&(t="RSAES-PKCS1-V1_5"),"RSAES-PKCS1-V1_5"===t)t={encode:function(e,t,r){return v(e,t,2).getBytes()}};else if("RSA-OAEP"===t||"RSAES-OAEP"===t)t={encode:function(e,t){return n.pkcs1.encode_rsa_oaep(t,e,i)}};else if(-1!==["RAW","NONE","NULL",null].indexOf(t))t={encode:function(e){return e}};else if("string"==typeof t)throw new Error('Unsupported encryption scheme: "'+t+'".');var a=t.encode(e,r,!0);return u.rsa.encrypt(a,r,!0)},verify:function(e,t,n){"string"==typeof n?n=n.toUpperCase():void 0===n&&(n="RSASSA-PKCS1-V1_5"),"RSASSA-PKCS1-V1_5"===n?n={verify:function(e,t){return t=g(t,r,!0),e===o.fromDer(t).value[1].value}}:"NONE"!==n&&"NULL"!==n&&null!==n||(n={verify:function(e,t){return e===(t=g(t,r,!0))}});var i=u.rsa.decrypt(t,r,!0,!1);return n.verify(e,i,r.n.bitLength())}};return r},u.setRsaPrivateKey=u.rsa.setPrivateKey=function(e,t,r,i,a,o,s,c){var l={n:e,e:t,d:r,p:i,q:a,dP:o,dQ:s,qInv:c,decrypt:function(e,t,r){"string"==typeof t?t=t.toUpperCase():void 0===t&&(t="RSAES-PKCS1-V1_5");var i=u.rsa.decrypt(e,l,!1,!1);if("RSAES-PKCS1-V1_5"===t)t={decode:g};else if("RSA-OAEP"===t||"RSAES-OAEP"===t)t={decode:function(e,t){return n.pkcs1.decode_rsa_oaep(t,e,r)}};else{if(-1===["RAW","NONE","NULL",null].indexOf(t))throw new Error('Unsupported encryption scheme: "'+t+'".');t={decode:function(e){return e}}}return t.decode(i,l,!1)},sign:function(e,t){var r=!1;"string"==typeof t&&(t=t.toUpperCase()),void 0===t||"RSASSA-PKCS1-V1_5"===t?(t={encode:d},r=1):"NONE"!==t&&"NULL"!==t&&null!==t||(t={encode:function(){return e}},r=1);var n=t.encode(e,l.n.bitLength());return u.rsa.encrypt(n,l,r)}};return l},u.wrapRsaPrivateKey=function(e){return o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,o.integerToDer(0).getBytes()),o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.OID,!1,o.oidToDer(u.oids.rsaEncryption).getBytes()),o.create(o.Class.UNIVERSAL,o.Type.NULL,!1,"")]),o.create(o.Class.UNIVERSAL,o.Type.OCTETSTRING,!1,o.toDer(e).getBytes())])},u.privateKeyFromAsn1=function(e){var t,r,a,s,c,h,p,d,y={},v=[];if(o.validate(e,l,y,v)&&(e=o.fromDer(n.util.createBuffer(y.privateKey))),y={},v=[],!o.validate(e,f,y,v)){var g=new Error("Cannot read private key. ASN.1 object does not contain an RSAPrivateKey.");throw g.errors=v,g}return t=n.util.createBuffer(y.privateKeyModulus).toHex(),r=n.util.createBuffer(y.privateKeyPublicExponent).toHex(),a=n.util.createBuffer(y.privateKeyPrivateExponent).toHex(),s=n.util.createBuffer(y.privateKeyPrime1).toHex(),c=n.util.createBuffer(y.privateKeyPrime2).toHex(),h=n.util.createBuffer(y.privateKeyExponent1).toHex(),p=n.util.createBuffer(y.privateKeyExponent2).toHex(),d=n.util.createBuffer(y.privateKeyCoefficient).toHex(),u.setRsaPrivateKey(new i(t,16),new i(r,16),new i(a,16),new i(s,16),new i(c,16),new i(h,16),new i(p,16),new i(d,16))},u.privateKeyToAsn1=u.privateKeyToRSAPrivateKey=function(e){return o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,o.integerToDer(0).getBytes()),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,b(e.n)),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,b(e.e)),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,b(e.d)),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,b(e.p)),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,b(e.q)),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,b(e.dP)),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,b(e.dQ)),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,b(e.qInv))])},u.publicKeyFromAsn1=function(e){var t={},r=[];if(o.validate(e,p,t,r)){var a,s=o.derToOid(t.publicKeyOid);if(s!==u.oids.rsaEncryption)throw(a=new Error("Cannot read public key. Unknown OID.")).oid=s,a;e=t.rsaPublicKey}if(r=[],!o.validate(e,h,t,r))throw(a=new Error("Cannot read public key. ASN.1 object does not contain an RSAPublicKey.")).errors=r,a;var c=n.util.createBuffer(t.publicKeyModulus).toHex(),l=n.util.createBuffer(t.publicKeyExponent).toHex();return u.setRsaPublicKey(new i(c,16),new i(l,16))},u.publicKeyToAsn1=u.publicKeyToSubjectPublicKeyInfo=function(e){return o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.OID,!1,o.oidToDer(u.oids.rsaEncryption).getBytes()),o.create(o.Class.UNIVERSAL,o.Type.NULL,!1,"")]),o.create(o.Class.UNIVERSAL,o.Type.BITSTRING,!1,[u.publicKeyToRSAPublicKey(e)])])},u.publicKeyToRSAPublicKey=function(e){return o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,b(e.n)),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,b(e.e))])}},137:(e,t,r)=>{var n=r(3832);r(8991),r(7116);var i=e.exports=n.sha1=n.sha1||{};n.md.sha1=n.md.algorithms.sha1=i,i.create=function(){o||(a=String.fromCharCode(128),a+=n.util.fillString(String.fromCharCode(0),64),o=!0);var e=null,t=n.util.createBuffer(),r=new Array(80),i={algorithm:"sha1",blockLength:64,digestLength:20,messageLength:0,fullMessageLength:null,messageLengthSize:8,start:function(){i.messageLength=0,i.fullMessageLength=i.messageLength64=[];for(var r=i.messageLengthSize/4,a=0;a<r;++a)i.fullMessageLength.push(0);return t=n.util.createBuffer(),e={h0:1732584193,h1:4023233417,h2:2562383102,h3:271733878,h4:3285377520},i}};return i.start(),i.update=function(a,o){"utf8"===o&&(a=n.util.encodeUtf8(a));var u=a.length;i.messageLength+=u,u=[u/4294967296>>>0,u>>>0];for(var c=i.fullMessageLength.length-1;c>=0;--c)i.fullMessageLength[c]+=u[1],u[1]=u[0]+(i.fullMessageLength[c]/4294967296>>>0),i.fullMessageLength[c]=i.fullMessageLength[c]>>>0,u[0]=u[1]/4294967296>>>0;return t.putBytes(a),s(e,r,t),(t.read>2048||0===t.length())&&t.compact(),i},i.digest=function(){var o=n.util.createBuffer();o.putBytes(t.bytes());var u,c=i.fullMessageLength[i.fullMessageLength.length-1]+i.messageLengthSize&i.blockLength-1;o.putBytes(a.substr(0,i.blockLength-c));for(var l=8*i.fullMessageLength[0],f=0;f<i.fullMessageLength.length-1;++f)l+=(u=8*i.fullMessageLength[f+1])/4294967296>>>0,o.putInt32(l>>>0),l=u>>>0;o.putInt32(l);var h={h0:e.h0,h1:e.h1,h2:e.h2,h3:e.h3,h4:e.h4};s(h,r,o);var p=n.util.createBuffer();return p.putInt32(h.h0),p.putInt32(h.h1),p.putInt32(h.h2),p.putInt32(h.h3),p.putInt32(h.h4),p},i};var a=null,o=!1;function s(e,t,r){for(var n,i,a,o,s,u,c,l=r.length();l>=64;){for(i=e.h0,a=e.h1,o=e.h2,s=e.h3,u=e.h4,c=0;c<16;++c)n=r.getInt32(),t[c]=n,n=(i<<5|i>>>27)+(s^a&(o^s))+u+1518500249+n,u=s,s=o,o=(a<<30|a>>>2)>>>0,a=i,i=n;for(;c<20;++c)n=(n=t[c-3]^t[c-8]^t[c-14]^t[c-16])<<1|n>>>31,t[c]=n,n=(i<<5|i>>>27)+(s^a&(o^s))+u+1518500249+n,u=s,s=o,o=(a<<30|a>>>2)>>>0,a=i,i=n;for(;c<32;++c)n=(n=t[c-3]^t[c-8]^t[c-14]^t[c-16])<<1|n>>>31,t[c]=n,n=(i<<5|i>>>27)+(a^o^s)+u+1859775393+n,u=s,s=o,o=(a<<30|a>>>2)>>>0,a=i,i=n;for(;c<40;++c)n=(n=t[c-6]^t[c-16]^t[c-28]^t[c-32])<<2|n>>>30,t[c]=n,n=(i<<5|i>>>27)+(a^o^s)+u+1859775393+n,u=s,s=o,o=(a<<30|a>>>2)>>>0,a=i,i=n;for(;c<60;++c)n=(n=t[c-6]^t[c-16]^t[c-28]^t[c-32])<<2|n>>>30,t[c]=n,n=(i<<5|i>>>27)+(a&o|s&(a^o))+u+2400959708+n,u=s,s=o,o=(a<<30|a>>>2)>>>0,a=i,i=n;for(;c<80;++c)n=(n=t[c-6]^t[c-16]^t[c-28]^t[c-32])<<2|n>>>30,t[c]=n,n=(i<<5|i>>>27)+(a^o^s)+u+3395469782+n,u=s,s=o,o=(a<<30|a>>>2)>>>0,a=i,i=n;e.h0=e.h0+i|0,e.h1=e.h1+a|0,e.h2=e.h2+o|0,e.h3=e.h3+s|0,e.h4=e.h4+u|0,l-=64}}},1668:(e,t,r)=>{var n=r(3832);r(8991),r(7116);var i=e.exports=n.sha256=n.sha256||{};n.md.sha256=n.md.algorithms.sha256=i,i.create=function(){o||(a=String.fromCharCode(128),a+=n.util.fillString(String.fromCharCode(0),64),s=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],o=!0);var e=null,t=n.util.createBuffer(),r=new Array(64),i={algorithm:"sha256",blockLength:64,digestLength:32,messageLength:0,fullMessageLength:null,messageLengthSize:8,start:function(){i.messageLength=0,i.fullMessageLength=i.messageLength64=[];for(var r=i.messageLengthSize/4,a=0;a<r;++a)i.fullMessageLength.push(0);return t=n.util.createBuffer(),e={h0:1779033703,h1:3144134277,h2:1013904242,h3:2773480762,h4:1359893119,h5:2600822924,h6:528734635,h7:1541459225},i}};return i.start(),i.update=function(a,o){"utf8"===o&&(a=n.util.encodeUtf8(a));var s=a.length;i.messageLength+=s,s=[s/4294967296>>>0,s>>>0];for(var c=i.fullMessageLength.length-1;c>=0;--c)i.fullMessageLength[c]+=s[1],s[1]=s[0]+(i.fullMessageLength[c]/4294967296>>>0),i.fullMessageLength[c]=i.fullMessageLength[c]>>>0,s[0]=s[1]/4294967296>>>0;return t.putBytes(a),u(e,r,t),(t.read>2048||0===t.length())&&t.compact(),i},i.digest=function(){var o=n.util.createBuffer();o.putBytes(t.bytes());var s,c=i.fullMessageLength[i.fullMessageLength.length-1]+i.messageLengthSize&i.blockLength-1;o.putBytes(a.substr(0,i.blockLength-c));for(var l=8*i.fullMessageLength[0],f=0;f<i.fullMessageLength.length-1;++f)l+=(s=8*i.fullMessageLength[f+1])/4294967296>>>0,o.putInt32(l>>>0),l=s>>>0;o.putInt32(l);var h={h0:e.h0,h1:e.h1,h2:e.h2,h3:e.h3,h4:e.h4,h5:e.h5,h6:e.h6,h7:e.h7};u(h,r,o);var p=n.util.createBuffer();return p.putInt32(h.h0),p.putInt32(h.h1),p.putInt32(h.h2),p.putInt32(h.h3),p.putInt32(h.h4),p.putInt32(h.h5),p.putInt32(h.h6),p.putInt32(h.h7),p},i};var a=null,o=!1,s=null;function u(e,t,r){for(var n,i,a,o,u,c,l,f,h,p,d,y,v,g=r.length();g>=64;){for(u=0;u<16;++u)t[u]=r.getInt32();for(;u<64;++u)n=((n=t[u-2])>>>17|n<<15)^(n>>>19|n<<13)^n>>>10,i=((i=t[u-15])>>>7|i<<25)^(i>>>18|i<<14)^i>>>3,t[u]=n+t[u-7]+i+t[u-16]|0;for(c=e.h0,l=e.h1,f=e.h2,h=e.h3,p=e.h4,d=e.h5,y=e.h6,v=e.h7,u=0;u<64;++u)a=(c>>>2|c<<30)^(c>>>13|c<<19)^(c>>>22|c<<10),o=c&l|f&(c^l),n=v+((p>>>6|p<<26)^(p>>>11|p<<21)^(p>>>25|p<<7))+(y^p&(d^y))+s[u]+t[u],v=y,y=d,d=p,p=h+n>>>0,h=f,f=l,l=c,c=n+(i=a+o)>>>0;e.h0=e.h0+c|0,e.h1=e.h1+l|0,e.h2=e.h2+f|0,e.h3=e.h3+h|0,e.h4=e.h4+p|0,e.h5=e.h5+d|0,e.h6=e.h6+y|0,e.h7=e.h7+v|0,g-=64}}},3219:(e,t,r)=>{var n=r(3832);r(8991),r(7116);var i=e.exports=n.sha512=n.sha512||{};n.md.sha512=n.md.algorithms.sha512=i;var a=n.sha384=n.sha512.sha384=n.sha512.sha384||{};a.create=function(){return i.create("SHA-384")},n.md.sha384=n.md.algorithms.sha384=a,n.sha512.sha256=n.sha512.sha256||{create:function(){return i.create("SHA-512/256")}},n.md["sha512/256"]=n.md.algorithms["sha512/256"]=n.sha512.sha256,n.sha512.sha224=n.sha512.sha224||{create:function(){return i.create("SHA-512/224")}},n.md["sha512/224"]=n.md.algorithms["sha512/224"]=n.sha512.sha224,i.create=function(e){if(s||(o=String.fromCharCode(128),o+=n.util.fillString(String.fromCharCode(0),128),u=[[1116352408,3609767458],[1899447441,602891725],[3049323471,3964484399],[3921009573,2173295548],[961987163,4081628472],[1508970993,3053834265],[2453635748,2937671579],[2870763221,3664609560],[3624381080,2734883394],[310598401,1164996542],[607225278,1323610764],[1426881987,3590304994],[1925078388,4068182383],[2162078206,991336113],[2614888103,633803317],[3248222580,3479774868],[3835390401,2666613458],[4022224774,944711139],[264347078,2341262773],[604807628,2007800933],[770255983,1495990901],[1249150122,1856431235],[1555081692,3175218132],[1996064986,2198950837],[2554220882,3999719339],[2821834349,766784016],[2952996808,2566594879],[3210313671,3203337956],[3336571891,1034457026],[3584528711,2466948901],[113926993,3758326383],[338241895,168717936],[666307205,1188179964],[773529912,1546045734],[1294757372,1522805485],[1396182291,2643833823],[1695183700,2343527390],[1986661051,1014477480],[2177026350,1206759142],[2456956037,344077627],[2730485921,1290863460],[2820302411,3158454273],[3259730800,3505952657],[3345764771,106217008],[3516065817,3606008344],[3600352804,1432725776],[4094571909,1467031594],[275423344,851169720],[430227734,3100823752],[506948616,1363258195],[659060556,3750685593],[883997877,3785050280],[958139571,3318307427],[1322822218,3812723403],[1537002063,2003034995],[1747873779,3602036899],[1955562222,1575990012],[2024104815,1125592928],[2227730452,2716904306],[2361852424,442776044],[2428436474,593698344],[2756734187,3733110249],[3204031479,2999351573],[3329325298,3815920427],[3391569614,3928383900],[3515267271,566280711],[3940187606,3454069534],[4118630271,4000239992],[116418474,1914138554],[174292421,2731055270],[289380356,3203993006],[460393269,320620315],[685471733,587496836],[852142971,1086792851],[1017036298,365543100],[1126000580,2618297676],[1288033470,3409855158],[1501505948,4234509866],[1607167915,987167468],[1816402316,1246189591]],(c={})["SHA-512"]=[[1779033703,4089235720],[3144134277,2227873595],[1013904242,4271175723],[2773480762,1595750129],[1359893119,2917565137],[2600822924,725511199],[528734635,4215389547],[1541459225,327033209]],c["SHA-384"]=[[3418070365,3238371032],[1654270250,914150663],[2438529370,812702999],[355462360,4144912697],[1731405415,4290775857],[2394180231,1750603025],[3675008525,1694076839],[1203062813,3204075428]],c["SHA-512/256"]=[[573645204,4230739756],[2673172387,3360449730],[596883563,1867755857],[2520282905,1497426621],[2519219938,2827943907],[3193839141,1401305490],[721525244,746961066],[246885852,2177182882]],c["SHA-512/224"]=[[2352822216,424955298],[1944164710,2312950998],[502970286,855612546],[1738396948,1479516111],[258812777,2077511080],[2011393907,79989058],[1067287976,1780299464],[286451373,2446758561]],s=!0),void 0===e&&(e="SHA-512"),!(e in c))throw new Error("Invalid SHA-512 algorithm: "+e);for(var t=c[e],r=null,i=n.util.createBuffer(),a=new Array(80),f=0;f<80;++f)a[f]=new Array(2);var h=64;switch(e){case"SHA-384":h=48;break;case"SHA-512/256":h=32;break;case"SHA-512/224":h=28}var p={algorithm:e.replace("-","").toLowerCase(),blockLength:128,digestLength:h,messageLength:0,fullMessageLength:null,messageLengthSize:16,start:function(){p.messageLength=0,p.fullMessageLength=p.messageLength128=[];for(var e=p.messageLengthSize/4,a=0;a<e;++a)p.fullMessageLength.push(0);i=n.util.createBuffer(),r=new Array(t.length);for(a=0;a<t.length;++a)r[a]=t[a].slice(0);return p}};return p.start(),p.update=function(e,t){"utf8"===t&&(e=n.util.encodeUtf8(e));var o=e.length;p.messageLength+=o,o=[o/4294967296>>>0,o>>>0];for(var s=p.fullMessageLength.length-1;s>=0;--s)p.fullMessageLength[s]+=o[1],o[1]=o[0]+(p.fullMessageLength[s]/4294967296>>>0),p.fullMessageLength[s]=p.fullMessageLength[s]>>>0,o[0]=o[1]/4294967296>>>0;return i.putBytes(e),l(r,a,i),(i.read>2048||0===i.length())&&i.compact(),p},p.digest=function(){var t=n.util.createBuffer();t.putBytes(i.bytes());var s,u=p.fullMessageLength[p.fullMessageLength.length-1]+p.messageLengthSize&p.blockLength-1;t.putBytes(o.substr(0,p.blockLength-u));for(var c=8*p.fullMessageLength[0],f=0;f<p.fullMessageLength.length-1;++f)c+=(s=8*p.fullMessageLength[f+1])/4294967296>>>0,t.putInt32(c>>>0),c=s>>>0;t.putInt32(c);var h=new Array(r.length);for(f=0;f<r.length;++f)h[f]=r[f].slice(0);l(h,a,t);var d,y=n.util.createBuffer();d="SHA-512"===e?h.length:"SHA-384"===e?h.length-2:h.length-4;for(f=0;f<d;++f)y.putInt32(h[f][0]),f===d-1&&"SHA-512/224"===e||y.putInt32(h[f][1]);return y},p};var o=null,s=!1,u=null,c=null;function l(e,t,r){for(var n,i,a,o,s,c,l,f,h,p,d,y,v,g,m,b,E,S,C,w,T,A,I,k,_,B,N,O,R,x,P,F,D,L=r.length();L>=128;){for(N=0;N<16;++N)t[N][0]=r.getInt32()>>>0,t[N][1]=r.getInt32()>>>0;for(;N<80;++N)n=(((O=(x=t[N-2])[0])>>>19|(R=x[1])<<13)^(R>>>29|O<<3)^O>>>6)>>>0,i=((O<<13|R>>>19)^(R<<3|O>>>29)^(O<<26|R>>>6))>>>0,a=(((O=(F=t[N-15])[0])>>>1|(R=F[1])<<31)^(O>>>8|R<<24)^O>>>7)>>>0,o=((O<<31|R>>>1)^(O<<24|R>>>8)^(O<<25|R>>>7))>>>0,P=t[N-7],D=t[N-16],R=i+P[1]+o+D[1],t[N][0]=n+P[0]+a+D[0]+(R/4294967296>>>0)>>>0,t[N][1]=R>>>0;for(d=e[0][0],y=e[0][1],v=e[1][0],g=e[1][1],m=e[2][0],b=e[2][1],E=e[3][0],S=e[3][1],C=e[4][0],w=e[4][1],T=e[5][0],A=e[5][1],I=e[6][0],k=e[6][1],_=e[7][0],B=e[7][1],N=0;N<80;++N)l=((C>>>14|w<<18)^(C>>>18|w<<14)^(w>>>9|C<<23))>>>0,f=(I^C&(T^I))>>>0,s=((d>>>28|y<<4)^(y>>>2|d<<30)^(y>>>7|d<<25))>>>0,c=((d<<4|y>>>28)^(y<<30|d>>>2)^(y<<25|d>>>7))>>>0,h=(d&v|m&(d^v))>>>0,p=(y&g|b&(y^g))>>>0,R=B+(((C<<18|w>>>14)^(C<<14|w>>>18)^(w<<23|C>>>9))>>>0)+((k^w&(A^k))>>>0)+u[N][1]+t[N][1],n=_+l+f+u[N][0]+t[N][0]+(R/4294967296>>>0)>>>0,i=R>>>0,a=s+h+((R=c+p)/4294967296>>>0)>>>0,o=R>>>0,_=I,B=k,I=T,k=A,T=C,A=w,C=E+n+((R=S+i)/4294967296>>>0)>>>0,w=R>>>0,E=m,S=b,m=v,b=g,v=d,g=y,d=n+a+((R=i+o)/4294967296>>>0)>>>0,y=R>>>0;R=e[0][1]+y,e[0][0]=e[0][0]+d+(R/4294967296>>>0)>>>0,e[0][1]=R>>>0,R=e[1][1]+g,e[1][0]=e[1][0]+v+(R/4294967296>>>0)>>>0,e[1][1]=R>>>0,R=e[2][1]+b,e[2][0]=e[2][0]+m+(R/4294967296>>>0)>>>0,e[2][1]=R>>>0,R=e[3][1]+S,e[3][0]=e[3][0]+E+(R/4294967296>>>0)>>>0,e[3][1]=R>>>0,R=e[4][1]+w,e[4][0]=e[4][0]+C+(R/4294967296>>>0)>>>0,e[4][1]=R>>>0,R=e[5][1]+A,e[5][0]=e[5][0]+T+(R/4294967296>>>0)>>>0,e[5][1]=R>>>0,R=e[6][1]+k,e[6][0]=e[6][0]+I+(R/4294967296>>>0)>>>0,e[6][1]=R>>>0,R=e[7][1]+B,e[7][0]=e[7][0]+_+(R/4294967296>>>0)>>>0,e[7][1]=R>>>0,L-=128}}},7116:(e,t,r)=>{var n=r(3832),i=r(8807),a=e.exports=n.util=n.util||{};function o(e){if(8!==e&&16!==e&&24!==e&&32!==e)throw new Error("Only 8, 16, 24, or 32 bits supported: "+e)}function s(e){if(this.data="",this.read=0,"string"==typeof e)this.data=e;else if(a.isArrayBuffer(e)||a.isArrayBufferView(e))if("undefined"!=typeof Buffer&&e instanceof Buffer)this.data=e.toString("binary");else{var t=new Uint8Array(e);try{this.data=String.fromCharCode.apply(null,t)}catch(e){for(var r=0;r<t.length;++r)this.putByte(t[r])}}else(e instanceof s||"object"==typeof e&&"string"==typeof e.data&&"number"==typeof e.read)&&(this.data=e.data,this.read=e.read);this._constructedStringLength=0}!function(){if("undefined"!=typeof process&&process.nextTick&&!process.browser)return a.nextTick=process.nextTick,void("function"==typeof setImmediate?a.setImmediate=setImmediate:a.setImmediate=a.nextTick);if("function"==typeof setImmediate)return a.setImmediate=function(){return setImmediate.apply(void 0,arguments)},void(a.nextTick=function(e){return setImmediate(e)});if(a.setImmediate=function(e){setTimeout(e,0)},"undefined"!=typeof window&&"function"==typeof window.postMessage){var e="forge.setImmediate",t=[];a.setImmediate=function(r){t.push(r),1===t.length&&window.postMessage(e,"*")},window.addEventListener("message",(function(r){if(r.source===window&&r.data===e){r.stopPropagation();var n=t.slice();t.length=0,n.forEach((function(e){e()}))}}),!0)}if("undefined"!=typeof MutationObserver){var r=Date.now(),n=!0,i=document.createElement("div");t=[];new MutationObserver((function(){var e=t.slice();t.length=0,e.forEach((function(e){e()}))})).observe(i,{attributes:!0});var o=a.setImmediate;a.setImmediate=function(e){Date.now()-r>15?(r=Date.now(),o(e)):(t.push(e),1===t.length&&i.setAttribute("a",n=!n))}}a.nextTick=a.setImmediate}(),a.isNodejs="undefined"!=typeof process&&process.versions&&process.versions.node,a.globalScope=a.isNodejs?r.g:"undefined"==typeof self?window:self,a.isArray=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},a.isArrayBuffer=function(e){return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer},a.isArrayBufferView=function(e){return e&&a.isArrayBuffer(e.buffer)&&void 0!==e.byteLength},a.ByteBuffer=s,a.ByteStringBuffer=s;a.ByteStringBuffer.prototype._optimizeConstructedString=function(e){this._constructedStringLength+=e,this._constructedStringLength>4096&&(this.data.substr(0,1),this._constructedStringLength=0)},a.ByteStringBuffer.prototype.length=function(){return this.data.length-this.read},a.ByteStringBuffer.prototype.isEmpty=function(){return this.length()<=0},a.ByteStringBuffer.prototype.putByte=function(e){return this.putBytes(String.fromCharCode(e))},a.ByteStringBuffer.prototype.fillWithByte=function(e,t){e=String.fromCharCode(e);for(var r=this.data;t>0;)1&t&&(r+=e),(t>>>=1)>0&&(e+=e);return this.data=r,this._optimizeConstructedString(t),this},a.ByteStringBuffer.prototype.putBytes=function(e){return this.data+=e,this._optimizeConstructedString(e.length),this},a.ByteStringBuffer.prototype.putString=function(e){return this.putBytes(a.encodeUtf8(e))},a.ByteStringBuffer.prototype.putInt16=function(e){return this.putBytes(String.fromCharCode(e>>8&255)+String.fromCharCode(255&e))},a.ByteStringBuffer.prototype.putInt24=function(e){return this.putBytes(String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(255&e))},a.ByteStringBuffer.prototype.putInt32=function(e){return this.putBytes(String.fromCharCode(e>>24&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(255&e))},a.ByteStringBuffer.prototype.putInt16Le=function(e){return this.putBytes(String.fromCharCode(255&e)+String.fromCharCode(e>>8&255))},a.ByteStringBuffer.prototype.putInt24Le=function(e){return this.putBytes(String.fromCharCode(255&e)+String.fromCharCode(e>>8&255)+String.fromCharCode(e>>16&255))},a.ByteStringBuffer.prototype.putInt32Le=function(e){return this.putBytes(String.fromCharCode(255&e)+String.fromCharCode(e>>8&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>24&255))},a.ByteStringBuffer.prototype.putInt=function(e,t){o(t);var r="";do{t-=8,r+=String.fromCharCode(e>>t&255)}while(t>0);return this.putBytes(r)},a.ByteStringBuffer.prototype.putSignedInt=function(e,t){return e<0&&(e+=2<<t-1),this.putInt(e,t)},a.ByteStringBuffer.prototype.putBuffer=function(e){return this.putBytes(e.getBytes())},a.ByteStringBuffer.prototype.getByte=function(){return this.data.charCodeAt(this.read++)},a.ByteStringBuffer.prototype.getInt16=function(){var e=this.data.charCodeAt(this.read)<<8^this.data.charCodeAt(this.read+1);return this.read+=2,e},a.ByteStringBuffer.prototype.getInt24=function(){var e=this.data.charCodeAt(this.read)<<16^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2);return this.read+=3,e},a.ByteStringBuffer.prototype.getInt32=function(){var e=this.data.charCodeAt(this.read)<<24^this.data.charCodeAt(this.read+1)<<16^this.data.charCodeAt(this.read+2)<<8^this.data.charCodeAt(this.read+3);return this.read+=4,e},a.ByteStringBuffer.prototype.getInt16Le=function(){var e=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8;return this.read+=2,e},a.ByteStringBuffer.prototype.getInt24Le=function(){var e=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2)<<16;return this.read+=3,e},a.ByteStringBuffer.prototype.getInt32Le=function(){var e=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2)<<16^this.data.charCodeAt(this.read+3)<<24;return this.read+=4,e},a.ByteStringBuffer.prototype.getInt=function(e){o(e);var t=0;do{t=(t<<8)+this.data.charCodeAt(this.read++),e-=8}while(e>0);return t},a.ByteStringBuffer.prototype.getSignedInt=function(e){var t=this.getInt(e),r=2<<e-2;return t>=r&&(t-=r<<1),t},a.ByteStringBuffer.prototype.getBytes=function(e){var t;return e?(e=Math.min(this.length(),e),t=this.data.slice(this.read,this.read+e),this.read+=e):0===e?t="":(t=0===this.read?this.data:this.data.slice(this.read),this.clear()),t},a.ByteStringBuffer.prototype.bytes=function(e){return void 0===e?this.data.slice(this.read):this.data.slice(this.read,this.read+e)},a.ByteStringBuffer.prototype.at=function(e){return this.data.charCodeAt(this.read+e)},a.ByteStringBuffer.prototype.setAt=function(e,t){return this.data=this.data.substr(0,this.read+e)+String.fromCharCode(t)+this.data.substr(this.read+e+1),this},a.ByteStringBuffer.prototype.last=function(){return this.data.charCodeAt(this.data.length-1)},a.ByteStringBuffer.prototype.copy=function(){var e=a.createBuffer(this.data);return e.read=this.read,e},a.ByteStringBuffer.prototype.compact=function(){return this.read>0&&(this.data=this.data.slice(this.read),this.read=0),this},a.ByteStringBuffer.prototype.clear=function(){return this.data="",this.read=0,this},a.ByteStringBuffer.prototype.truncate=function(e){var t=Math.max(0,this.length()-e);return this.data=this.data.substr(this.read,t),this.read=0,this},a.ByteStringBuffer.prototype.toHex=function(){for(var e="",t=this.read;t<this.data.length;++t){var r=this.data.charCodeAt(t);r<16&&(e+="0"),e+=r.toString(16)}return e},a.ByteStringBuffer.prototype.toString=function(){return a.decodeUtf8(this.bytes())},a.DataBuffer=function(e,t){t=t||{},this.read=t.readOffset||0,this.growSize=t.growSize||1024;var r=a.isArrayBuffer(e),n=a.isArrayBufferView(e);if(r||n)return this.data=r?new DataView(e):new DataView(e.buffer,e.byteOffset,e.byteLength),void(this.write="writeOffset"in t?t.writeOffset:this.data.byteLength);this.data=new DataView(new ArrayBuffer(0)),this.write=0,null!=e&&this.putBytes(e),"writeOffset"in t&&(this.write=t.writeOffset)},a.DataBuffer.prototype.length=function(){return this.write-this.read},a.DataBuffer.prototype.isEmpty=function(){return this.length()<=0},a.DataBuffer.prototype.accommodate=function(e,t){if(this.length()>=e)return this;t=Math.max(t||this.growSize,e);var r=new Uint8Array(this.data.buffer,this.data.byteOffset,this.data.byteLength),n=new Uint8Array(this.length()+t);return n.set(r),this.data=new DataView(n.buffer),this},a.DataBuffer.prototype.putByte=function(e){return this.accommodate(1),this.data.setUint8(this.write++,e),this},a.DataBuffer.prototype.fillWithByte=function(e,t){this.accommodate(t);for(var r=0;r<t;++r)this.data.setUint8(e);return this},a.DataBuffer.prototype.putBytes=function(e,t){if(a.isArrayBufferView(e)){var r=(n=new Uint8Array(e.buffer,e.byteOffset,e.byteLength)).byteLength-n.byteOffset;return this.accommodate(r),new Uint8Array(this.data.buffer,this.write).set(n),this.write+=r,this}if(a.isArrayBuffer(e)){var n=new Uint8Array(e);return this.accommodate(n.byteLength),new Uint8Array(this.data.buffer).set(n,this.write),this.write+=n.byteLength,this}if(e instanceof a.DataBuffer||"object"==typeof e&&"number"==typeof e.read&&"number"==typeof e.write&&a.isArrayBufferView(e.data)){n=new Uint8Array(e.data.byteLength,e.read,e.length());return this.accommodate(n.byteLength),new Uint8Array(e.data.byteLength,this.write).set(n),this.write+=n.byteLength,this}if(e instanceof a.ByteStringBuffer&&(e=e.data,t="binary"),t=t||"binary","string"==typeof e){var i;if("hex"===t)return this.accommodate(Math.ceil(e.length/2)),i=new Uint8Array(this.data.buffer,this.write),this.write+=a.binary.hex.decode(e,i,this.write),this;if("base64"===t)return this.accommodate(3*Math.ceil(e.length/4)),i=new Uint8Array(this.data.buffer,this.write),this.write+=a.binary.base64.decode(e,i,this.write),this;if("utf8"===t&&(e=a.encodeUtf8(e),t="binary"),"binary"===t||"raw"===t)return this.accommodate(e.length),i=new Uint8Array(this.data.buffer,this.write),this.write+=a.binary.raw.decode(i),this;if("utf16"===t)return this.accommodate(2*e.length),i=new Uint16Array(this.data.buffer,this.write),this.write+=a.text.utf16.encode(i),this;throw new Error("Invalid encoding: "+t)}throw Error("Invalid parameter: "+e)},a.DataBuffer.prototype.putBuffer=function(e){return this.putBytes(e),e.clear(),this},a.DataBuffer.prototype.putString=function(e){return this.putBytes(e,"utf16")},a.DataBuffer.prototype.putInt16=function(e){return this.accommodate(2),this.data.setInt16(this.write,e),this.write+=2,this},a.DataBuffer.prototype.putInt24=function(e){return this.accommodate(3),this.data.setInt16(this.write,e>>8&65535),this.data.setInt8(this.write,e>>16&255),this.write+=3,this},a.DataBuffer.prototype.putInt32=function(e){return this.accommodate(4),this.data.setInt32(this.write,e),this.write+=4,this},a.DataBuffer.prototype.putInt16Le=function(e){return this.accommodate(2),this.data.setInt16(this.write,e,!0),this.write+=2,this},a.DataBuffer.prototype.putInt24Le=function(e){return this.accommodate(3),this.data.setInt8(this.write,e>>16&255),this.data.setInt16(this.write,e>>8&65535,!0),this.write+=3,this},a.DataBuffer.prototype.putInt32Le=function(e){return this.accommodate(4),this.data.setInt32(this.write,e,!0),this.write+=4,this},a.DataBuffer.prototype.putInt=function(e,t){o(t),this.accommodate(t/8);do{t-=8,this.data.setInt8(this.write++,e>>t&255)}while(t>0);return this},a.DataBuffer.prototype.putSignedInt=function(e,t){return o(t),this.accommodate(t/8),e<0&&(e+=2<<t-1),this.putInt(e,t)},a.DataBuffer.prototype.getByte=function(){return this.data.getInt8(this.read++)},a.DataBuffer.prototype.getInt16=function(){var e=this.data.getInt16(this.read);return this.read+=2,e},a.DataBuffer.prototype.getInt24=function(){var e=this.data.getInt16(this.read)<<8^this.data.getInt8(this.read+2);return this.read+=3,e},a.DataBuffer.prototype.getInt32=function(){var e=this.data.getInt32(this.read);return this.read+=4,e},a.DataBuffer.prototype.getInt16Le=function(){var e=this.data.getInt16(this.read,!0);return this.read+=2,e},a.DataBuffer.prototype.getInt24Le=function(){var e=this.data.getInt8(this.read)^this.data.getInt16(this.read+1,!0)<<8;return this.read+=3,e},a.DataBuffer.prototype.getInt32Le=function(){var e=this.data.getInt32(this.read,!0);return this.read+=4,e},a.DataBuffer.prototype.getInt=function(e){o(e);var t=0;do{t=(t<<8)+this.data.getInt8(this.read++),e-=8}while(e>0);return t},a.DataBuffer.prototype.getSignedInt=function(e){var t=this.getInt(e),r=2<<e-2;return t>=r&&(t-=r<<1),t},a.DataBuffer.prototype.getBytes=function(e){var t;return e?(e=Math.min(this.length(),e),t=this.data.slice(this.read,this.read+e),this.read+=e):0===e?t="":(t=0===this.read?this.data:this.data.slice(this.read),this.clear()),t},a.DataBuffer.prototype.bytes=function(e){return void 0===e?this.data.slice(this.read):this.data.slice(this.read,this.read+e)},a.DataBuffer.prototype.at=function(e){return this.data.getUint8(this.read+e)},a.DataBuffer.prototype.setAt=function(e,t){return this.data.setUint8(e,t),this},a.DataBuffer.prototype.last=function(){return this.data.getUint8(this.write-1)},a.DataBuffer.prototype.copy=function(){return new a.DataBuffer(this)},a.DataBuffer.prototype.compact=function(){if(this.read>0){var e=new Uint8Array(this.data.buffer,this.read),t=new Uint8Array(e.byteLength);t.set(e),this.data=new DataView(t),this.write-=this.read,this.read=0}return this},a.DataBuffer.prototype.clear=function(){return this.data=new DataView(new ArrayBuffer(0)),this.read=this.write=0,this},a.DataBuffer.prototype.truncate=function(e){return this.write=Math.max(0,this.length()-e),this.read=Math.min(this.read,this.write),this},a.DataBuffer.prototype.toHex=function(){for(var e="",t=this.read;t<this.data.byteLength;++t){var r=this.data.getUint8(t);r<16&&(e+="0"),e+=r.toString(16)}return e},a.DataBuffer.prototype.toString=function(e){var t=new Uint8Array(this.data,this.read,this.length());if("binary"===(e=e||"utf8")||"raw"===e)return a.binary.raw.encode(t);if("hex"===e)return a.binary.hex.encode(t);if("base64"===e)return a.binary.base64.encode(t);if("utf8"===e)return a.text.utf8.decode(t);if("utf16"===e)return a.text.utf16.decode(t);throw new Error("Invalid encoding: "+e)},a.createBuffer=function(e,t){return t=t||"raw",void 0!==e&&"utf8"===t&&(e=a.encodeUtf8(e)),new a.ByteBuffer(e)},a.fillString=function(e,t){for(var r="";t>0;)1&t&&(r+=e),(t>>>=1)>0&&(e+=e);return r},a.xorBytes=function(e,t,r){for(var n="",i="",a="",o=0,s=0;r>0;--r,++o)i=e.charCodeAt(o)^t.charCodeAt(o),s>=10&&(n+=a,a="",s=0),a+=String.fromCharCode(i),++s;return n+=a},a.hexToBytes=function(e){var t="",r=0;for(!0&e.length&&(r=1,t+=String.fromCharCode(parseInt(e[0],16)));r<e.length;r+=2)t+=String.fromCharCode(parseInt(e.substr(r,2),16));return t},a.bytesToHex=function(e){return a.createBuffer(e).toHex()},a.int32ToBytes=function(e){return String.fromCharCode(e>>24&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(255&e)};var u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",c=[62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,64,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51],l="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";a.encode64=function(e,t){for(var r,n,i,a="",o="",s=0;s<e.length;)r=e.charCodeAt(s++),n=e.charCodeAt(s++),i=e.charCodeAt(s++),a+=u.charAt(r>>2),a+=u.charAt((3&r)<<4|n>>4),isNaN(n)?a+="==":(a+=u.charAt((15&n)<<2|i>>6),a+=isNaN(i)?"=":u.charAt(63&i)),t&&a.length>t&&(o+=a.substr(0,t)+"\r\n",a=a.substr(t));return o+=a},a.decode64=function(e){e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var t,r,n,i,a="",o=0;o<e.length;)t=c[e.charCodeAt(o++)-43],r=c[e.charCodeAt(o++)-43],n=c[e.charCodeAt(o++)-43],i=c[e.charCodeAt(o++)-43],a+=String.fromCharCode(t<<2|r>>4),64!==n&&(a+=String.fromCharCode((15&r)<<4|n>>2),64!==i&&(a+=String.fromCharCode((3&n)<<6|i)));return a},a.encodeUtf8=function(e){return unescape(encodeURIComponent(e))},a.decodeUtf8=function(e){return decodeURIComponent(escape(e))},a.binary={raw:{},hex:{},base64:{},base58:{},baseN:{encode:i.encode,decode:i.decode}},a.binary.raw.encode=function(e){return String.fromCharCode.apply(null,e)},a.binary.raw.decode=function(e,t,r){var n=t;n||(n=new Uint8Array(e.length));for(var i=r=r||0,a=0;a<e.length;++a)n[i++]=e.charCodeAt(a);return t?i-r:n},a.binary.hex.encode=a.bytesToHex,a.binary.hex.decode=function(e,t,r){var n=t;n||(n=new Uint8Array(Math.ceil(e.length/2)));var i=0,a=r=r||0;for(1&e.length&&(i=1,n[a++]=parseInt(e[0],16));i<e.length;i+=2)n[a++]=parseInt(e.substr(i,2),16);return t?a-r:n},a.binary.base64.encode=function(e,t){for(var r,n,i,a="",o="",s=0;s<e.byteLength;)r=e[s++],n=e[s++],i=e[s++],a+=u.charAt(r>>2),a+=u.charAt((3&r)<<4|n>>4),isNaN(n)?a+="==":(a+=u.charAt((15&n)<<2|i>>6),a+=isNaN(i)?"=":u.charAt(63&i)),t&&a.length>t&&(o+=a.substr(0,t)+"\r\n",a=a.substr(t));return o+=a},a.binary.base64.decode=function(e,t,r){var n,i,a,o,s=t;s||(s=new Uint8Array(3*Math.ceil(e.length/4))),e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var u=0,l=r=r||0;u<e.length;)n=c[e.charCodeAt(u++)-43],i=c[e.charCodeAt(u++)-43],a=c[e.charCodeAt(u++)-43],o=c[e.charCodeAt(u++)-43],s[l++]=n<<2|i>>4,64!==a&&(s[l++]=(15&i)<<4|a>>2,64!==o&&(s[l++]=(3&a)<<6|o));return t?l-r:s.subarray(0,l)},a.binary.base58.encode=function(e,t){return a.binary.baseN.encode(e,l,t)},a.binary.base58.decode=function(e,t){return a.binary.baseN.decode(e,l,t)},a.text={utf8:{},utf16:{}},a.text.utf8.encode=function(e,t,r){e=a.encodeUtf8(e);var n=t;n||(n=new Uint8Array(e.length));for(var i=r=r||0,o=0;o<e.length;++o)n[i++]=e.charCodeAt(o);return t?i-r:n},a.text.utf8.decode=function(e){return a.decodeUtf8(String.fromCharCode.apply(null,e))},a.text.utf16.encode=function(e,t,r){var n=t;n||(n=new Uint8Array(2*e.length));for(var i=new Uint16Array(n.buffer),a=r=r||0,o=r,s=0;s<e.length;++s)i[o++]=e.charCodeAt(s),a+=2;return t?a-r:n},a.text.utf16.decode=function(e){return String.fromCharCode.apply(null,new Uint16Array(e.buffer))},a.deflate=function(e,t,r){if(t=a.decode64(e.deflate(a.encode64(t)).rval),r){var n=2;32&t.charCodeAt(1)&&(n=6),t=t.substring(n,t.length-4)}return t},a.inflate=function(e,t,r){var n=e.inflate(a.encode64(t)).rval;return null===n?null:a.decode64(n)};var f=function(e,t,r){if(!e)throw new Error("WebStorage not available.");var n;if(null===r?n=e.removeItem(t):(r=a.encode64(JSON.stringify(r)),n=e.setItem(t,r)),void 0!==n&&!0!==n.rval){var i=new Error(n.error.message);throw i.id=n.error.id,i.name=n.error.name,i}},h=function(e,t){if(!e)throw new Error("WebStorage not available.");var r=e.getItem(t);if(e.init)if(null===r.rval){if(r.error){var n=new Error(r.error.message);throw n.id=r.error.id,n.name=r.error.name,n}r=null}else r=r.rval;return null!==r&&(r=JSON.parse(a.decode64(r))),r},p=function(e,t,r,n){var i=h(e,t);null===i&&(i={}),i[r]=n,f(e,t,i)},d=function(e,t,r){var n=h(e,t);return null!==n&&(n=r in n?n[r]:null),n},y=function(e,t,r){var n=h(e,t);if(null!==n&&r in n){delete n[r];var i=!0;for(var a in n){i=!1;break}i&&(n=null),f(e,t,n)}},v=function(e,t){f(e,t,null)},g=function(e,t,r){var n,i=null;void 0===r&&(r=["web","flash"]);var a=!1,o=null;for(var s in r){n=r[s];try{if("flash"===n||"both"===n){if(null===t[0])throw new Error("Flash local storage not available.");i=e.apply(this,t),a="flash"===n}"web"!==n&&"both"!==n||(t[0]=localStorage,i=e.apply(this,t),a=!0)}catch(e){o=e}if(a)break}if(!a)throw o;return i};a.setItem=function(e,t,r,n,i){g(p,arguments,i)},a.getItem=function(e,t,r,n){return g(d,arguments,n)},a.removeItem=function(e,t,r,n){g(y,arguments,n)},a.clearItems=function(e,t,r){g(v,arguments,r)},a.parseUrl=function(e){var t=/^(https?):\/\/([^:&^\/]*):?(\d*)(.*)$/g;t.lastIndex=0;var r=t.exec(e),n=null===r?null:{full:e,scheme:r[1],host:r[2],port:r[3],path:r[4]};return n&&(n.fullHost=n.host,n.port?(80!==n.port&&"http"===n.scheme||443!==n.port&&"https"===n.scheme)&&(n.fullHost+=":"+n.port):"http"===n.scheme?n.port=80:"https"===n.scheme&&(n.port=443),n.full=n.scheme+"://"+n.fullHost),n};var m=null;a.getQueryVariables=function(e){var t,r=function(e){for(var t={},r=e.split("&"),n=0;n<r.length;n++){var i,a,o=r[n].indexOf("=");o>0?(i=r[n].substring(0,o),a=r[n].substring(o+1)):(i=r[n],a=null),i in t||(t[i]=[]),i in Object.prototype||null===a||t[i].push(unescape(a))}return t};return void 0===e?(null===m&&(m="undefined"!=typeof window&&window.location&&window.location.search?r(window.location.search.substring(1)):{}),t=m):t=r(e),t},a.parseFragment=function(e){var t=e,r="",n=e.indexOf("?");n>0&&(t=e.substring(0,n),r=e.substring(n+1));var i=t.split("/");return i.length>0&&""===i[0]&&i.shift(),{pathString:t,queryString:r,path:i,query:""===r?{}:a.getQueryVariables(r)}},a.makeRequest=function(e){var t=a.parseFragment(e),r={path:t.pathString,query:t.queryString,getPath:function(e){return void 0===e?t.path:t.path[e]},getQuery:function(e,r){var n;return void 0===e?n=t.query:(n=t.query[e])&&void 0!==r&&(n=n[r]),n},getQueryLast:function(e,t){var n=r.getQuery(e);return n?n[n.length-1]:t}};return r},a.makeLink=function(e,t,r){e=jQuery.isArray(e)?e.join("/"):e;var n=jQuery.param(t||{});return r=r||"",e+(n.length>0?"?"+n:"")+(r.length>0?"#"+r:"")},a.isEmpty=function(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0},a.format=function(e){for(var t,r,n=/%./g,i=0,a=[],o=0;t=n.exec(e);){(r=e.substring(o,n.lastIndex-2)).length>0&&a.push(r),o=n.lastIndex;var s=t[0][1];switch(s){case"s":case"o":i<arguments.length?a.push(arguments[1+i++]):a.push("<?>");break;case"%":a.push("%");break;default:a.push("<%"+s+"?>")}}return a.push(e.substring(o)),a.join("")},a.formatNumber=function(e,t,r,n){var i=e,a=isNaN(t=Math.abs(t))?2:t,o=void 0===r?",":r,s=void 0===n?".":n,u=i<0?"-":"",c=parseInt(i=Math.abs(+i||0).toFixed(a),10)+"",l=c.length>3?c.length%3:0;return u+(l?c.substr(0,l)+s:"")+c.substr(l).replace(/(\d{3})(?=\d)/g,"$1"+s)+(a?o+Math.abs(i-c).toFixed(a).slice(2):"")},a.formatSize=function(e){return e=e>=1073741824?a.formatNumber(e/1073741824,2,".","")+" GiB":e>=1048576?a.formatNumber(e/1048576,2,".","")+" MiB":e>=1024?a.formatNumber(e/1024,0)+" KiB":a.formatNumber(e,0)+" bytes"},a.bytesFromIP=function(e){return-1!==e.indexOf(".")?a.bytesFromIPv4(e):-1!==e.indexOf(":")?a.bytesFromIPv6(e):null},a.bytesFromIPv4=function(e){if(4!==(e=e.split(".")).length)return null;for(var t=a.createBuffer(),r=0;r<e.length;++r){var n=parseInt(e[r],10);if(isNaN(n))return null;t.putByte(n)}return t.getBytes()},a.bytesFromIPv6=function(e){for(var t=0,r=2*(8-(e=e.split(":").filter((function(e){return 0===e.length&&++t,!0}))).length+t),n=a.createBuffer(),i=0;i<8;++i)if(e[i]&&0!==e[i].length){var o=a.hexToBytes(e[i]);o.length<2&&n.putByte(0),n.putBytes(o)}else n.fillWithByte(0,r),r=0;return n.getBytes()},a.bytesToIP=function(e){return 4===e.length?a.bytesToIPv4(e):16===e.length?a.bytesToIPv6(e):null},a.bytesToIPv4=function(e){if(4!==e.length)return null;for(var t=[],r=0;r<e.length;++r)t.push(e.charCodeAt(r));return t.join(".")},a.bytesToIPv6=function(e){if(16!==e.length)return null;for(var t=[],r=[],n=0,i=0;i<e.length;i+=2){for(var o=a.bytesToHex(e[i]+e[i+1]);"0"===o[0]&&"0"!==o;)o=o.substr(1);if("0"===o){var s=r[r.length-1],u=t.length;s&&u===s.end+1?(s.end=u,s.end-s.start>r[n].end-r[n].start&&(n=r.length-1)):r.push({start:u,end:u})}t.push(o)}if(r.length>0){var c=r[n];c.end-c.start>0&&(t.splice(c.start,c.end-c.start+1,""),0===c.start&&t.unshift(""),7===c.end&&t.push(""))}return t.join(":")},a.estimateCores=function(e,t){if("function"==typeof e&&(t=e,e={}),e=e||{},"cores"in a&&!e.update)return t(null,a.cores);if("undefined"!=typeof navigator&&"hardwareConcurrency"in navigator&&navigator.hardwareConcurrency>0)return a.cores=navigator.hardwareConcurrency,t(null,a.cores);if("undefined"==typeof Worker)return a.cores=1,t(null,a.cores);if("undefined"==typeof Blob)return a.cores=2,t(null,a.cores);var r=URL.createObjectURL(new Blob(["(",function(){self.addEventListener("message",(function(e){for(var t=Date.now(),r=t+4;Date.now()<r;);self.postMessage({st:t,et:r})}))}.toString(),")()"],{type:"application/javascript"}));!function e(n,i,o){if(0===i){var s=Math.floor(n.reduce((function(e,t){return e+t}),0)/n.length);return a.cores=Math.max(1,s),URL.revokeObjectURL(r),t(null,a.cores)}!function(e,t){for(var n=[],i=[],a=0;a<e;++a){var o=new Worker(r);o.addEventListener("message",(function(r){if(i.push(r.data),i.length===e){for(var a=0;a<e;++a)n[a].terminate();t(null,i)}})),n.push(o)}for(a=0;a<e;++a)n[a].postMessage(a)}(o,(function(t,r){n.push(function(e,t){for(var r=[],n=0;n<e;++n)for(var i=t[n],a=r[n]=[],o=0;o<e;++o)if(n!==o){var s=t[o];(i.st>s.st&&i.st<s.et||s.st>i.st&&s.st<i.et)&&a.push(o)}return r.reduce((function(e,t){return Math.max(e,t.length)}),0)}(o,r)),e(n,i-1,o)}))}([],5,16)}},5414:(e,t,r)=>{var n=r(3832);r(8925),r(3068),r(3480),r(8991),r(6971),r(6270),r(6953),r(6007),r(8095),r(7116);var i=n.asn1,a=e.exports=n.pki=n.pki||{},o=a.oids,s={};s.CN=o.commonName,s.commonName="CN",s.C=o.countryName,s.countryName="C",s.L=o.localityName,s.localityName="L",s.ST=o.stateOrProvinceName,s.stateOrProvinceName="ST",s.O=o.organizationName,s.organizationName="O",s.OU=o.organizationalUnitName,s.organizationalUnitName="OU",s.E=o.emailAddress,s.emailAddress="E";var u=n.pki.rsa.publicKeyValidator,c={name:"Certificate",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"tbsCertificate",value:[{name:"Certificate.TBSCertificate.version",tagClass:i.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.version.integer",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"certVersion"}]},{name:"Certificate.TBSCertificate.serialNumber",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"certSerialNumber"},{name:"Certificate.TBSCertificate.signature",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.signature.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"certinfoSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:i.Class.UNIVERSAL,optional:!0,captureAsn1:"certinfoSignatureParams"}]},{name:"Certificate.TBSCertificate.issuer",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"certIssuer"},{name:"Certificate.TBSCertificate.validity",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.validity.notBefore (utc)",tagClass:i.Class.UNIVERSAL,type:i.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity1UTCTime"},{name:"Certificate.TBSCertificate.validity.notBefore (generalized)",tagClass:i.Class.UNIVERSAL,type:i.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity2GeneralizedTime"},{name:"Certificate.TBSCertificate.validity.notAfter (utc)",tagClass:i.Class.UNIVERSAL,type:i.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity3UTCTime"},{name:"Certificate.TBSCertificate.validity.notAfter (generalized)",tagClass:i.Class.UNIVERSAL,type:i.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity4GeneralizedTime"}]},{name:"Certificate.TBSCertificate.subject",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"certSubject"},u,{name:"Certificate.TBSCertificate.issuerUniqueID",tagClass:i.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.issuerUniqueID.id",tagClass:i.Class.UNIVERSAL,type:i.Type.BITSTRING,constructed:!1,captureBitStringValue:"certIssuerUniqueId"}]},{name:"Certificate.TBSCertificate.subjectUniqueID",tagClass:i.Class.CONTEXT_SPECIFIC,type:2,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.subjectUniqueID.id",tagClass:i.Class.UNIVERSAL,type:i.Type.BITSTRING,constructed:!1,captureBitStringValue:"certSubjectUniqueId"}]},{name:"Certificate.TBSCertificate.extensions",tagClass:i.Class.CONTEXT_SPECIFIC,type:3,constructed:!0,captureAsn1:"certExtensions",optional:!0}]},{name:"Certificate.signatureAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.signatureAlgorithm.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"certSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:i.Class.UNIVERSAL,optional:!0,captureAsn1:"certSignatureParams"}]},{name:"Certificate.signatureValue",tagClass:i.Class.UNIVERSAL,type:i.Type.BITSTRING,constructed:!1,captureBitStringValue:"certSignature"}]},l={name:"rsapss",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"rsapss.hashAlgorithm",tagClass:i.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,value:[{name:"rsapss.hashAlgorithm.AlgorithmIdentifier",tagClass:i.Class.UNIVERSAL,type:i.Class.SEQUENCE,constructed:!0,optional:!0,value:[{name:"rsapss.hashAlgorithm.AlgorithmIdentifier.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"hashOid"}]}]},{name:"rsapss.maskGenAlgorithm",tagClass:i.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier",tagClass:i.Class.UNIVERSAL,type:i.Class.SEQUENCE,constructed:!0,optional:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"maskGenOid"},{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.params",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.params.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"maskGenHashOid"}]}]}]},{name:"rsapss.saltLength",tagClass:i.Class.CONTEXT_SPECIFIC,type:2,optional:!0,value:[{name:"rsapss.saltLength.saltLength",tagClass:i.Class.UNIVERSAL,type:i.Class.INTEGER,constructed:!1,capture:"saltLength"}]},{name:"rsapss.trailerField",tagClass:i.Class.CONTEXT_SPECIFIC,type:3,optional:!0,value:[{name:"rsapss.trailer.trailer",tagClass:i.Class.UNIVERSAL,type:i.Class.INTEGER,constructed:!1,capture:"trailer"}]}]},f={name:"CertificationRequestInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"certificationRequestInfo",value:[{name:"CertificationRequestInfo.integer",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"certificationRequestInfoVersion"},{name:"CertificationRequestInfo.subject",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"certificationRequestInfoSubject"},u,{name:"CertificationRequestInfo.attributes",tagClass:i.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"certificationRequestInfoAttributes",value:[{name:"CertificationRequestInfo.attributes",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"CertificationRequestInfo.attributes.type",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1},{name:"CertificationRequestInfo.attributes.value",tagClass:i.Class.UNIVERSAL,type:i.Type.SET,constructed:!0}]}]}]},h={name:"CertificationRequest",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"csr",value:[f,{name:"CertificationRequest.signatureAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"CertificationRequest.signatureAlgorithm.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"csrSignatureOid"},{name:"CertificationRequest.signatureAlgorithm.parameters",tagClass:i.Class.UNIVERSAL,optional:!0,captureAsn1:"csrSignatureParams"}]},{name:"CertificationRequest.signature",tagClass:i.Class.UNIVERSAL,type:i.Type.BITSTRING,constructed:!1,captureBitStringValue:"csrSignature"}]};function p(e,t){"string"==typeof t&&(t={shortName:t});for(var r,n=null,i=0;null===n&&i<e.attributes.length;++i)r=e.attributes[i],(t.type&&t.type===r.type||t.name&&t.name===r.name||t.shortName&&t.shortName===r.shortName)&&(n=r);return n}a.RDNAttributesAsArray=function(e,t){for(var r,n,a,u=[],c=0;c<e.value.length;++c){r=e.value[c];for(var l=0;l<r.value.length;++l)a={},n=r.value[l],a.type=i.derToOid(n.value[0].value),a.value=n.value[1].value,a.valueTagClass=n.value[1].type,a.type in o&&(a.name=o[a.type],a.name in s&&(a.shortName=s[a.name])),t&&(t.update(a.type),t.update(a.value)),u.push(a)}return u},a.CRIAttributesAsArray=function(e){for(var t=[],r=0;r<e.length;++r)for(var n=e[r],u=i.derToOid(n.value[0].value),c=n.value[1].value,l=0;l<c.length;++l){var f={};if(f.type=u,f.value=c[l].value,f.valueTagClass=c[l].type,f.type in o&&(f.name=o[f.type],f.name in s&&(f.shortName=s[f.name])),f.type===o.extensionRequest){f.extensions=[];for(var h=0;h<f.value.length;++h)f.extensions.push(a.certificateExtensionFromAsn1(f.value[h]))}t.push(f)}return t};var d=function(e,t,r){var n={};if(e!==o["RSASSA-PSS"])return n;r&&(n={hash:{algorithmOid:o.sha1},mgf:{algorithmOid:o.mgf1,hash:{algorithmOid:o.sha1}},saltLength:20});var a={},s=[];if(!i.validate(t,l,a,s)){var u=new Error("Cannot read RSASSA-PSS parameter block.");throw u.errors=s,u}return void 0!==a.hashOid&&(n.hash=n.hash||{},n.hash.algorithmOid=i.derToOid(a.hashOid)),void 0!==a.maskGenOid&&(n.mgf=n.mgf||{},n.mgf.algorithmOid=i.derToOid(a.maskGenOid),n.mgf.hash=n.mgf.hash||{},n.mgf.hash.algorithmOid=i.derToOid(a.maskGenHashOid)),void 0!==a.saltLength&&(n.saltLength=a.saltLength.charCodeAt(0)),n};function y(e){for(var t,r,a=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]),o=e.attributes,s=0;s<o.length;++s){var u=(t=o[s]).value,c=i.Type.PRINTABLESTRING;"valueTagClass"in t&&(c=t.valueTagClass)===i.Type.UTF8&&(u=n.util.encodeUtf8(u)),r=i.create(i.Class.UNIVERSAL,i.Type.SET,!0,[i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(t.type).getBytes()),i.create(i.Class.UNIVERSAL,c,!1,u)])]),a.value.push(r)}return a}function v(e){for(var t,r=0;r<e.length;++r){if(void 0===(t=e[r]).name&&(t.type&&t.type in a.oids?t.name=a.oids[t.type]:t.shortName&&t.shortName in s&&(t.name=a.oids[s[t.shortName]])),void 0===t.type){if(!t.name||!(t.name in a.oids))throw(u=new Error("Attribute type not specified.")).attribute=t,u;t.type=a.oids[t.name]}if(void 0===t.shortName&&t.name&&t.name in s&&(t.shortName=s[t.name]),t.type===o.extensionRequest&&(t.valueConstructed=!0,t.valueTagClass=i.Type.SEQUENCE,!t.value&&t.extensions)){t.value=[];for(var n=0;n<t.extensions.length;++n)t.value.push(a.certificateExtensionToAsn1(g(t.extensions[n])))}var u;if(void 0===t.value)throw(u=new Error("Attribute value not specified.")).attribute=t,u}}function g(e,t){if(t=t||{},void 0===e.name&&e.id&&e.id in a.oids&&(e.name=a.oids[e.id]),void 0===e.id){if(!e.name||!(e.name in a.oids))throw(S=new Error("Extension ID not specified.")).extension=e,S;e.id=a.oids[e.name]}if(void 0!==e.value)return e;if("keyUsage"===e.name){var r=0,s=0,u=0;e.digitalSignature&&(s|=128,r=7),e.nonRepudiation&&(s|=64,r=6),e.keyEncipherment&&(s|=32,r=5),e.dataEncipherment&&(s|=16,r=4),e.keyAgreement&&(s|=8,r=3),e.keyCertSign&&(s|=4,r=2),e.cRLSign&&(s|=2,r=1),e.encipherOnly&&(s|=1,r=0),e.decipherOnly&&(u|=128,r=7);var c=String.fromCharCode(r);0!==u?c+=String.fromCharCode(s)+String.fromCharCode(u):0!==s&&(c+=String.fromCharCode(s)),e.value=i.create(i.Class.UNIVERSAL,i.Type.BITSTRING,!1,c)}else if("basicConstraints"===e.name)e.value=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]),e.cA&&e.value.value.push(i.create(i.Class.UNIVERSAL,i.Type.BOOLEAN,!1,String.fromCharCode(255))),"pathLenConstraint"in e&&e.value.value.push(i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(e.pathLenConstraint).getBytes()));else if("extKeyUsage"===e.name){e.value=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]);var l=e.value.value;for(var f in e)!0===e[f]&&(f in o?l.push(i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(o[f]).getBytes())):-1!==f.indexOf(".")&&l.push(i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(f).getBytes())))}else if("nsCertType"===e.name){r=0,s=0;e.client&&(s|=128,r=7),e.server&&(s|=64,r=6),e.email&&(s|=32,r=5),e.objsign&&(s|=16,r=4),e.reserved&&(s|=8,r=3),e.sslCA&&(s|=4,r=2),e.emailCA&&(s|=2,r=1),e.objCA&&(s|=1,r=0);c=String.fromCharCode(r);0!==s&&(c+=String.fromCharCode(s)),e.value=i.create(i.Class.UNIVERSAL,i.Type.BITSTRING,!1,c)}else if("subjectAltName"===e.name||"issuerAltName"===e.name){e.value=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]);for(var h=0;h<e.altNames.length;++h){c=(m=e.altNames[h]).value;if(7===m.type&&m.ip){if(null===(c=n.util.bytesFromIP(m.ip)))throw(S=new Error('Extension "ip" value is not a valid IPv4 or IPv6 address.')).extension=e,S}else 8===m.type&&(c=m.oid?i.oidToDer(i.oidToDer(m.oid)):i.oidToDer(c));e.value.value.push(i.create(i.Class.CONTEXT_SPECIFIC,m.type,!1,c))}}else if("nsComment"===e.name&&t.cert){if(!/^[\x00-\x7F]*$/.test(e.comment)||e.comment.length<1||e.comment.length>128)throw new Error('Invalid "nsComment" content.');e.value=i.create(i.Class.UNIVERSAL,i.Type.IA5STRING,!1,e.comment)}else if("subjectKeyIdentifier"===e.name&&t.cert){var p=t.cert.generateSubjectKeyIdentifier();e.subjectKeyIdentifier=p.toHex(),e.value=i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,p.getBytes())}else if("authorityKeyIdentifier"===e.name&&t.cert){e.value=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]);l=e.value.value;if(e.keyIdentifier){var d=!0===e.keyIdentifier?t.cert.generateSubjectKeyIdentifier().getBytes():e.keyIdentifier;l.push(i.create(i.Class.CONTEXT_SPECIFIC,0,!1,d))}if(e.authorityCertIssuer){var v=[i.create(i.Class.CONTEXT_SPECIFIC,4,!0,[y(!0===e.authorityCertIssuer?t.cert.issuer:e.authorityCertIssuer)])];l.push(i.create(i.Class.CONTEXT_SPECIFIC,1,!0,v))}if(e.serialNumber){var g=n.util.hexToBytes(!0===e.serialNumber?t.cert.serialNumber:e.serialNumber);l.push(i.create(i.Class.CONTEXT_SPECIFIC,2,!1,g))}}else if("cRLDistributionPoints"===e.name){e.value=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]);l=e.value.value;var m,b=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]),E=i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[]);for(h=0;h<e.altNames.length;++h){c=(m=e.altNames[h]).value;if(7===m.type&&m.ip){if(null===(c=n.util.bytesFromIP(m.ip)))throw(S=new Error('Extension "ip" value is not a valid IPv4 or IPv6 address.')).extension=e,S}else 8===m.type&&(c=m.oid?i.oidToDer(i.oidToDer(m.oid)):i.oidToDer(c));E.value.push(i.create(i.Class.CONTEXT_SPECIFIC,m.type,!1,c))}b.value.push(i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[E])),l.push(b)}var S;if(void 0===e.value)throw(S=new Error("Extension value not specified.")).extension=e,S;return e}function m(e,t){switch(e){case o["RSASSA-PSS"]:var r=[];return void 0!==t.hash.algorithmOid&&r.push(i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(t.hash.algorithmOid).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.NULL,!1,"")])])),void 0!==t.mgf.algorithmOid&&r.push(i.create(i.Class.CONTEXT_SPECIFIC,1,!0,[i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(t.mgf.algorithmOid).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(t.mgf.hash.algorithmOid).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.NULL,!1,"")])])])),void 0!==t.saltLength&&r.push(i.create(i.Class.CONTEXT_SPECIFIC,2,!0,[i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(t.saltLength).getBytes())])),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,r);default:return i.create(i.Class.UNIVERSAL,i.Type.NULL,!1,"")}}function b(e){var t=i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[]);if(0===e.attributes.length)return t;for(var r=e.attributes,a=0;a<r.length;++a){var o=r[a],s=o.value,u=i.Type.UTF8;"valueTagClass"in o&&(u=o.valueTagClass),u===i.Type.UTF8&&(s=n.util.encodeUtf8(s));var c=!1;"valueConstructed"in o&&(c=o.valueConstructed);var l=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(o.type).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SET,!0,[i.create(i.Class.UNIVERSAL,u,c,s)])]);t.value.push(l)}return t}a.certificateFromPem=function(e,t,r){var o=n.pem.decode(e)[0];if("CERTIFICATE"!==o.type&&"X509 CERTIFICATE"!==o.type&&"TRUSTED CERTIFICATE"!==o.type){var s=new Error('Could not convert certificate from PEM; PEM header type is not "CERTIFICATE", "X509 CERTIFICATE", or "TRUSTED CERTIFICATE".');throw s.headerType=o.type,s}if(o.procType&&"ENCRYPTED"===o.procType.type)throw new Error("Could not convert certificate from PEM; PEM is encrypted.");var u=i.fromDer(o.body,r);return a.certificateFromAsn1(u,t)},a.certificateToPem=function(e,t){var r={type:"CERTIFICATE",body:i.toDer(a.certificateToAsn1(e)).getBytes()};return n.pem.encode(r,{maxline:t})},a.publicKeyFromPem=function(e){var t=n.pem.decode(e)[0];if("PUBLIC KEY"!==t.type&&"RSA PUBLIC KEY"!==t.type){var r=new Error('Could not convert public key from PEM; PEM header type is not "PUBLIC KEY" or "RSA PUBLIC KEY".');throw r.headerType=t.type,r}if(t.procType&&"ENCRYPTED"===t.procType.type)throw new Error("Could not convert public key from PEM; PEM is encrypted.");var o=i.fromDer(t.body);return a.publicKeyFromAsn1(o)},a.publicKeyToPem=function(e,t){var r={type:"PUBLIC KEY",body:i.toDer(a.publicKeyToAsn1(e)).getBytes()};return n.pem.encode(r,{maxline:t})},a.publicKeyToRSAPublicKeyPem=function(e,t){var r={type:"RSA PUBLIC KEY",body:i.toDer(a.publicKeyToRSAPublicKey(e)).getBytes()};return n.pem.encode(r,{maxline:t})},a.getPublicKeyFingerprint=function(e,t){var r,o=(t=t||{}).md||n.md.sha1.create();switch(t.type||"RSAPublicKey"){case"RSAPublicKey":r=i.toDer(a.publicKeyToRSAPublicKey(e)).getBytes();break;case"SubjectPublicKeyInfo":r=i.toDer(a.publicKeyToAsn1(e)).getBytes();break;default:throw new Error('Unknown fingerprint type "'+t.type+'".')}o.start(),o.update(r);var s=o.digest();if("hex"===t.encoding){var u=s.toHex();return t.delimiter?u.match(/.{2}/g).join(t.delimiter):u}if("binary"===t.encoding)return s.getBytes();if(t.encoding)throw new Error('Unknown encoding "'+t.encoding+'".');return s},a.certificationRequestFromPem=function(e,t,r){var o=n.pem.decode(e)[0];if("CERTIFICATE REQUEST"!==o.type){var s=new Error('Could not convert certification request from PEM; PEM header type is not "CERTIFICATE REQUEST".');throw s.headerType=o.type,s}if(o.procType&&"ENCRYPTED"===o.procType.type)throw new Error("Could not convert certification request from PEM; PEM is encrypted.");var u=i.fromDer(o.body,r);return a.certificationRequestFromAsn1(u,t)},a.certificationRequestToPem=function(e,t){var r={type:"CERTIFICATE REQUEST",body:i.toDer(a.certificationRequestToAsn1(e)).getBytes()};return n.pem.encode(r,{maxline:t})},a.createCertificate=function(){var e={version:2,serialNumber:"00",signatureOid:null,signature:null,siginfo:{}};return e.siginfo.algorithmOid=null,e.validity={},e.validity.notBefore=new Date,e.validity.notAfter=new Date,e.issuer={},e.issuer.getField=function(t){return p(e.issuer,t)},e.issuer.addField=function(t){v([t]),e.issuer.attributes.push(t)},e.issuer.attributes=[],e.issuer.hash=null,e.subject={},e.subject.getField=function(t){return p(e.subject,t)},e.subject.addField=function(t){v([t]),e.subject.attributes.push(t)},e.subject.attributes=[],e.subject.hash=null,e.extensions=[],e.publicKey=null,e.md=null,e.setSubject=function(t,r){v(t),e.subject.attributes=t,delete e.subject.uniqueId,r&&(e.subject.uniqueId=r),e.subject.hash=null},e.setIssuer=function(t,r){v(t),e.issuer.attributes=t,delete e.issuer.uniqueId,r&&(e.issuer.uniqueId=r),e.issuer.hash=null},e.setExtensions=function(t){for(var r=0;r<t.length;++r)g(t[r],{cert:e});e.extensions=t},e.getExtension=function(t){"string"==typeof t&&(t={name:t});for(var r,n=null,i=0;null===n&&i<e.extensions.length;++i)r=e.extensions[i],(t.id&&r.id===t.id||t.name&&r.name===t.name)&&(n=r);return n},e.sign=function(t,r){e.md=r||n.md.sha1.create();var s=o[e.md.algorithm+"WithRSAEncryption"];if(!s){var u=new Error("Could not compute certificate digest. Unknown message digest algorithm OID.");throw u.algorithm=e.md.algorithm,u}e.signatureOid=e.siginfo.algorithmOid=s,e.tbsCertificate=a.getTBSCertificate(e);var c=i.toDer(e.tbsCertificate);e.md.update(c.getBytes()),e.signature=t.sign(e.md)},e.verify=function(t){var r=!1;if(!e.issued(t)){var s=t.issuer,u=e.subject;throw(y=new Error("The parent certificate did not issue the given child certificate; the child certificate's issuer does not match the parent's subject.")).expectedIssuer=s.attributes,y.actualIssuer=u.attributes,y}var c=t.md;if(null===c){if(t.signatureOid in o)switch(o[t.signatureOid]){case"sha1WithRSAEncryption":c=n.md.sha1.create();break;case"md5WithRSAEncryption":c=n.md.md5.create();break;case"sha256WithRSAEncryption":c=n.md.sha256.create();break;case"sha384WithRSAEncryption":c=n.md.sha384.create();break;case"sha512WithRSAEncryption":c=n.md.sha512.create();break;case"RSASSA-PSS":c=n.md.sha256.create()}if(null===c)throw(y=new Error("Could not compute certificate digest. Unknown signature OID.")).signatureOid=t.signatureOid,y;var l=t.tbsCertificate||a.getTBSCertificate(t),f=i.toDer(l);c.update(f.getBytes())}if(null!==c){var h;switch(t.signatureOid){case o.sha1WithRSAEncryption:h=void 0;break;case o["RSASSA-PSS"]:var p,d,y;if(void 0===(p=o[t.signatureParameters.mgf.hash.algorithmOid])||void 0===n.md[p])throw(y=new Error("Unsupported MGF hash function.")).oid=t.signatureParameters.mgf.hash.algorithmOid,y.name=p,y;if(void 0===(d=o[t.signatureParameters.mgf.algorithmOid])||void 0===n.mgf[d])throw(y=new Error("Unsupported MGF function.")).oid=t.signatureParameters.mgf.algorithmOid,y.name=d,y;if(d=n.mgf[d].create(n.md[p].create()),void 0===(p=o[t.signatureParameters.hash.algorithmOid])||void 0===n.md[p])throw{message:"Unsupported RSASSA-PSS hash function.",oid:t.signatureParameters.hash.algorithmOid,name:p};h=n.pss.create(n.md[p].create(),d,t.signatureParameters.saltLength)}r=e.publicKey.verify(c.digest().getBytes(),t.signature,h)}return r},e.isIssuer=function(t){var r=!1,n=e.issuer,i=t.subject;if(n.hash&&i.hash)r=n.hash===i.hash;else if(n.attributes.length===i.attributes.length){var a,o;r=!0;for(var s=0;r&&s<n.attributes.length;++s)a=n.attributes[s],o=i.attributes[s],a.type===o.type&&a.value===o.value||(r=!1)}return r},e.issued=function(t){return t.isIssuer(e)},e.generateSubjectKeyIdentifier=function(){return a.getPublicKeyFingerprint(e.publicKey,{type:"RSAPublicKey"})},e.verifySubjectKeyIdentifier=function(){for(var t=o.subjectKeyIdentifier,r=0;r<e.extensions.length;++r){var i=e.extensions[r];if(i.id===t){var a=e.generateSubjectKeyIdentifier().getBytes();return n.util.hexToBytes(i.subjectKeyIdentifier)===a}}return!1},e},a.certificateFromAsn1=function(e,t){var r={},s=[];if(!i.validate(e,c,r,s))throw(h=new Error("Cannot read X.509 certificate. ASN.1 object is not an X509v3 Certificate.")).errors=s,h;if(i.derToOid(r.publicKeyOid)!==a.oids.rsaEncryption)throw new Error("Cannot read public key. OID is not RSA.");var u=a.createCertificate();u.version=r.certVersion?r.certVersion.charCodeAt(0):0;var l=n.util.createBuffer(r.certSerialNumber);u.serialNumber=l.toHex(),u.signatureOid=n.asn1.derToOid(r.certSignatureOid),u.signatureParameters=d(u.signatureOid,r.certSignatureParams,!0),u.siginfo.algorithmOid=n.asn1.derToOid(r.certinfoSignatureOid),u.siginfo.parameters=d(u.siginfo.algorithmOid,r.certinfoSignatureParams,!1),u.signature=r.certSignature;var f=[];if(void 0!==r.certValidity1UTCTime&&f.push(i.utcTimeToDate(r.certValidity1UTCTime)),void 0!==r.certValidity2GeneralizedTime&&f.push(i.generalizedTimeToDate(r.certValidity2GeneralizedTime)),void 0!==r.certValidity3UTCTime&&f.push(i.utcTimeToDate(r.certValidity3UTCTime)),void 0!==r.certValidity4GeneralizedTime&&f.push(i.generalizedTimeToDate(r.certValidity4GeneralizedTime)),f.length>2)throw new Error("Cannot read notBefore/notAfter validity times; more than two times were provided in the certificate.");if(f.length<2)throw new Error("Cannot read notBefore/notAfter validity times; they were not provided as either UTCTime or GeneralizedTime.");if(u.validity.notBefore=f[0],u.validity.notAfter=f[1],u.tbsCertificate=r.tbsCertificate,t){var h;if(u.md=null,u.signatureOid in o)switch(o[u.signatureOid]){case"sha1WithRSAEncryption":u.md=n.md.sha1.create();break;case"md5WithRSAEncryption":u.md=n.md.md5.create();break;case"sha256WithRSAEncryption":u.md=n.md.sha256.create();break;case"sha384WithRSAEncryption":u.md=n.md.sha384.create();break;case"sha512WithRSAEncryption":u.md=n.md.sha512.create();break;case"RSASSA-PSS":u.md=n.md.sha256.create()}if(null===u.md)throw(h=new Error("Could not compute certificate digest. Unknown signature OID.")).signatureOid=u.signatureOid,h;var y=i.toDer(u.tbsCertificate);u.md.update(y.getBytes())}var g=n.md.sha1.create();u.issuer.getField=function(e){return p(u.issuer,e)},u.issuer.addField=function(e){v([e]),u.issuer.attributes.push(e)},u.issuer.attributes=a.RDNAttributesAsArray(r.certIssuer,g),r.certIssuerUniqueId&&(u.issuer.uniqueId=r.certIssuerUniqueId),u.issuer.hash=g.digest().toHex();var m=n.md.sha1.create();return u.subject.getField=function(e){return p(u.subject,e)},u.subject.addField=function(e){v([e]),u.subject.attributes.push(e)},u.subject.attributes=a.RDNAttributesAsArray(r.certSubject,m),r.certSubjectUniqueId&&(u.subject.uniqueId=r.certSubjectUniqueId),u.subject.hash=m.digest().toHex(),r.certExtensions?u.extensions=a.certificateExtensionsFromAsn1(r.certExtensions):u.extensions=[],u.publicKey=a.publicKeyFromAsn1(r.subjectPublicKeyInfo),u},a.certificateExtensionsFromAsn1=function(e){for(var t=[],r=0;r<e.value.length;++r)for(var n=e.value[r],i=0;i<n.value.length;++i)t.push(a.certificateExtensionFromAsn1(n.value[i]));return t},a.certificateExtensionFromAsn1=function(e){var t={};if(t.id=i.derToOid(e.value[0].value),t.critical=!1,e.value[1].type===i.Type.BOOLEAN?(t.critical=0!==e.value[1].value.charCodeAt(0),t.value=e.value[2].value):t.value=e.value[1].value,t.id in o)if(t.name=o[t.id],"keyUsage"===t.name){var r=0,a=0;(u=i.fromDer(t.value)).value.length>1&&(r=u.value.charCodeAt(1),a=u.value.length>2?u.value.charCodeAt(2):0),t.digitalSignature=128==(128&r),t.nonRepudiation=64==(64&r),t.keyEncipherment=32==(32&r),t.dataEncipherment=16==(16&r),t.keyAgreement=8==(8&r),t.keyCertSign=4==(4&r),t.cRLSign=2==(2&r),t.encipherOnly=1==(1&r),t.decipherOnly=128==(128&a)}else if("basicConstraints"===t.name){(u=i.fromDer(t.value)).value.length>0&&u.value[0].type===i.Type.BOOLEAN?t.cA=0!==u.value[0].value.charCodeAt(0):t.cA=!1;var s=null;u.value.length>0&&u.value[0].type===i.Type.INTEGER?s=u.value[0].value:u.value.length>1&&(s=u.value[1].value),null!==s&&(t.pathLenConstraint=i.derToInteger(s))}else if("extKeyUsage"===t.name)for(var u=i.fromDer(t.value),c=0;c<u.value.length;++c){var l=i.derToOid(u.value[c].value);l in o?t[o[l]]=!0:t[l]=!0}else if("nsCertType"===t.name){r=0;(u=i.fromDer(t.value)).value.length>1&&(r=u.value.charCodeAt(1)),t.client=128==(128&r),t.server=64==(64&r),t.email=32==(32&r),t.objsign=16==(16&r),t.reserved=8==(8&r),t.sslCA=4==(4&r),t.emailCA=2==(2&r),t.objCA=1==(1&r)}else if("subjectAltName"===t.name||"issuerAltName"===t.name){var f;t.altNames=[];u=i.fromDer(t.value);for(var h=0;h<u.value.length;++h){var p={type:(f=u.value[h]).type,value:f.value};switch(t.altNames.push(p),f.type){case 1:case 2:case 6:break;case 7:p.ip=n.util.bytesToIP(f.value);break;case 8:p.oid=i.derToOid(f.value)}}}else if("subjectKeyIdentifier"===t.name){u=i.fromDer(t.value);t.subjectKeyIdentifier=n.util.bytesToHex(u.value)}return t},a.certificationRequestFromAsn1=function(e,t){var r={},s=[];if(!i.validate(e,h,r,s))throw(c=new Error("Cannot read PKCS#10 certificate request. ASN.1 object is not a PKCS#10 CertificationRequest.")).errors=s,c;if(i.derToOid(r.publicKeyOid)!==a.oids.rsaEncryption)throw new Error("Cannot read public key. OID is not RSA.");var u=a.createCertificationRequest();if(u.version=r.csrVersion?r.csrVersion.charCodeAt(0):0,u.signatureOid=n.asn1.derToOid(r.csrSignatureOid),u.signatureParameters=d(u.signatureOid,r.csrSignatureParams,!0),u.siginfo.algorithmOid=n.asn1.derToOid(r.csrSignatureOid),u.siginfo.parameters=d(u.siginfo.algorithmOid,r.csrSignatureParams,!1),u.signature=r.csrSignature,u.certificationRequestInfo=r.certificationRequestInfo,t){var c;if(u.md=null,u.signatureOid in o)switch(o[u.signatureOid]){case"sha1WithRSAEncryption":u.md=n.md.sha1.create();break;case"md5WithRSAEncryption":u.md=n.md.md5.create();break;case"sha256WithRSAEncryption":u.md=n.md.sha256.create();break;case"sha384WithRSAEncryption":u.md=n.md.sha384.create();break;case"sha512WithRSAEncryption":u.md=n.md.sha512.create();break;case"RSASSA-PSS":u.md=n.md.sha256.create()}if(null===u.md)throw(c=new Error("Could not compute certification request digest. Unknown signature OID.")).signatureOid=u.signatureOid,c;var l=i.toDer(u.certificationRequestInfo);u.md.update(l.getBytes())}var f=n.md.sha1.create();return u.subject.getField=function(e){return p(u.subject,e)},u.subject.addField=function(e){v([e]),u.subject.attributes.push(e)},u.subject.attributes=a.RDNAttributesAsArray(r.certificationRequestInfoSubject,f),u.subject.hash=f.digest().toHex(),u.publicKey=a.publicKeyFromAsn1(r.subjectPublicKeyInfo),u.getAttribute=function(e){return p(u,e)},u.addAttribute=function(e){v([e]),u.attributes.push(e)},u.attributes=a.CRIAttributesAsArray(r.certificationRequestInfoAttributes||[]),u},a.createCertificationRequest=function(){var e={version:0,signatureOid:null,signature:null,siginfo:{}};return e.siginfo.algorithmOid=null,e.subject={},e.subject.getField=function(t){return p(e.subject,t)},e.subject.addField=function(t){v([t]),e.subject.attributes.push(t)},e.subject.attributes=[],e.subject.hash=null,e.publicKey=null,e.attributes=[],e.getAttribute=function(t){return p(e,t)},e.addAttribute=function(t){v([t]),e.attributes.push(t)},e.md=null,e.setSubject=function(t){v(t),e.subject.attributes=t,e.subject.hash=null},e.setAttributes=function(t){v(t),e.attributes=t},e.sign=function(t,r){e.md=r||n.md.sha1.create();var s=o[e.md.algorithm+"WithRSAEncryption"];if(!s){var u=new Error("Could not compute certification request digest. Unknown message digest algorithm OID.");throw u.algorithm=e.md.algorithm,u}e.signatureOid=e.siginfo.algorithmOid=s,e.certificationRequestInfo=a.getCertificationRequestInfo(e);var c=i.toDer(e.certificationRequestInfo);e.md.update(c.getBytes()),e.signature=t.sign(e.md)},e.verify=function(){var t=!1,r=e.md;if(null===r){if(e.signatureOid in o)switch(o[e.signatureOid]){case"sha1WithRSAEncryption":r=n.md.sha1.create();break;case"md5WithRSAEncryption":r=n.md.md5.create();break;case"sha256WithRSAEncryption":r=n.md.sha256.create();break;case"sha384WithRSAEncryption":r=n.md.sha384.create();break;case"sha512WithRSAEncryption":r=n.md.sha512.create();break;case"RSASSA-PSS":r=n.md.sha256.create()}if(null===r)throw(h=new Error("Could not compute certification request digest. Unknown signature OID.")).signatureOid=e.signatureOid,h;var s=e.certificationRequestInfo||a.getCertificationRequestInfo(e),u=i.toDer(s);r.update(u.getBytes())}if(null!==r){var c;switch(e.signatureOid){case o.sha1WithRSAEncryption:break;case o["RSASSA-PSS"]:var l,f,h;if(void 0===(l=o[e.signatureParameters.mgf.hash.algorithmOid])||void 0===n.md[l])throw(h=new Error("Unsupported MGF hash function.")).oid=e.signatureParameters.mgf.hash.algorithmOid,h.name=l,h;if(void 0===(f=o[e.signatureParameters.mgf.algorithmOid])||void 0===n.mgf[f])throw(h=new Error("Unsupported MGF function.")).oid=e.signatureParameters.mgf.algorithmOid,h.name=f,h;if(f=n.mgf[f].create(n.md[l].create()),void 0===(l=o[e.signatureParameters.hash.algorithmOid])||void 0===n.md[l])throw(h=new Error("Unsupported RSASSA-PSS hash function.")).oid=e.signatureParameters.hash.algorithmOid,h.name=l,h;c=n.pss.create(n.md[l].create(),f,e.signatureParameters.saltLength)}t=e.publicKey.verify(r.digest().getBytes(),e.signature,c)}return t},e};var E=new Date("1950-01-01T00:00:00Z"),S=new Date("2050-01-01T00:00:00Z");function C(e){return e>=E&&e<S?i.create(i.Class.UNIVERSAL,i.Type.UTCTIME,!1,i.dateToUtcTime(e)):i.create(i.Class.UNIVERSAL,i.Type.GENERALIZEDTIME,!1,i.dateToGeneralizedTime(e))}a.getTBSCertificate=function(e){var t=C(e.validity.notBefore),r=C(e.validity.notAfter),o=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(e.version).getBytes())]),i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,n.util.hexToBytes(e.serialNumber)),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.siginfo.algorithmOid).getBytes()),m(e.siginfo.algorithmOid,e.siginfo.parameters)]),y(e.issuer),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[t,r]),y(e.subject),a.publicKeyToAsn1(e.publicKey)]);return e.issuer.uniqueId&&o.value.push(i.create(i.Class.CONTEXT_SPECIFIC,1,!0,[i.create(i.Class.UNIVERSAL,i.Type.BITSTRING,!1,String.fromCharCode(0)+e.issuer.uniqueId)])),e.subject.uniqueId&&o.value.push(i.create(i.Class.CONTEXT_SPECIFIC,2,!0,[i.create(i.Class.UNIVERSAL,i.Type.BITSTRING,!1,String.fromCharCode(0)+e.subject.uniqueId)])),e.extensions.length>0&&o.value.push(a.certificateExtensionsToAsn1(e.extensions)),o},a.getCertificationRequestInfo=function(e){return i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(e.version).getBytes()),y(e.subject),a.publicKeyToAsn1(e.publicKey),b(e)])},a.distinguishedNameToAsn1=function(e){return y(e)},a.certificateToAsn1=function(e){var t=e.tbsCertificate||a.getTBSCertificate(e);return i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[t,i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.signatureOid).getBytes()),m(e.signatureOid,e.signatureParameters)]),i.create(i.Class.UNIVERSAL,i.Type.BITSTRING,!1,String.fromCharCode(0)+e.signature)])},a.certificateExtensionsToAsn1=function(e){var t=i.create(i.Class.CONTEXT_SPECIFIC,3,!0,[]),r=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]);t.value.push(r);for(var n=0;n<e.length;++n)r.value.push(a.certificateExtensionToAsn1(e[n]));return t},a.certificateExtensionToAsn1=function(e){var t=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]);t.value.push(i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.id).getBytes())),e.critical&&t.value.push(i.create(i.Class.UNIVERSAL,i.Type.BOOLEAN,!1,String.fromCharCode(255)));var r=e.value;return"string"!=typeof e.value&&(r=i.toDer(r).getBytes()),t.value.push(i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,r)),t},a.certificationRequestToAsn1=function(e){var t=e.certificationRequestInfo||a.getCertificationRequestInfo(e);return i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[t,i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.signatureOid).getBytes()),m(e.signatureOid,e.signatureParameters)]),i.create(i.Class.UNIVERSAL,i.Type.BITSTRING,!1,String.fromCharCode(0)+e.signature)])},a.createCaStore=function(e){var t={certs:{}};function r(e){return o(e),t.certs[e.hash]||null}function o(e){if(!e.hash){var t=n.md.sha1.create();e.attributes=a.RDNAttributesAsArray(y(e),t),e.hash=t.digest().toHex()}}if(t.getIssuer=function(e){return r(e.issuer)},t.addCertificate=function(e){if("string"==typeof e&&(e=n.pki.certificateFromPem(e)),o(e.subject),!t.hasCertificate(e))if(e.subject.hash in t.certs){var r=t.certs[e.subject.hash];n.util.isArray(r)||(r=[r]),r.push(e),t.certs[e.subject.hash]=r}else t.certs[e.subject.hash]=e},t.hasCertificate=function(e){"string"==typeof e&&(e=n.pki.certificateFromPem(e));var t=r(e.subject);if(!t)return!1;n.util.isArray(t)||(t=[t]);for(var o=i.toDer(a.certificateToAsn1(e)).getBytes(),s=0;s<t.length;++s){if(o===i.toDer(a.certificateToAsn1(t[s])).getBytes())return!0}return!1},t.listAllCertificates=function(){var e=[];for(var r in t.certs)if(t.certs.hasOwnProperty(r)){var i=t.certs[r];if(n.util.isArray(i))for(var a=0;a<i.length;++a)e.push(i[a]);else e.push(i)}return e},t.removeCertificate=function(e){var s;if("string"==typeof e&&(e=n.pki.certificateFromPem(e)),o(e.subject),!t.hasCertificate(e))return null;var u=r(e.subject);if(!n.util.isArray(u))return s=t.certs[e.subject.hash],delete t.certs[e.subject.hash],s;for(var c=i.toDer(a.certificateToAsn1(e)).getBytes(),l=0;l<u.length;++l){c===i.toDer(a.certificateToAsn1(u[l])).getBytes()&&(s=u[l],u.splice(l,1))}return 0===u.length&&delete t.certs[e.subject.hash],s},e)for(var s=0;s<e.length;++s){var u=e[s];t.addCertificate(u)}return t},a.certificateError={bad_certificate:"forge.pki.BadCertificate",unsupported_certificate:"forge.pki.UnsupportedCertificate",certificate_revoked:"forge.pki.CertificateRevoked",certificate_expired:"forge.pki.CertificateExpired",certificate_unknown:"forge.pki.CertificateUnknown",unknown_ca:"forge.pki.UnknownCertificateAuthority"},a.verifyCertificateChain=function(e,t,r){"function"==typeof r&&(r={verify:r}),r=r||{};var i=(t=t.slice(0)).slice(0),o=r.validityCheckDate;void 0===o&&(o=new Date);var s=!0,u=null,c=0;do{var l=t.shift(),f=null,h=!1;if(o&&(o<l.validity.notBefore||o>l.validity.notAfter)&&(u={message:"Certificate is not valid yet or has expired.",error:a.certificateError.certificate_expired,notBefore:l.validity.notBefore,notAfter:l.validity.notAfter,now:o}),null===u){if(null===(f=t[0]||e.getIssuer(l))&&l.isIssuer(l)&&(h=!0,f=l),f){var p=f;n.util.isArray(p)||(p=[p]);for(var d=!1;!d&&p.length>0;){f=p.shift();try{d=f.verify(l)}catch(e){}}d||(u={message:"Certificate signature is invalid.",error:a.certificateError.bad_certificate})}null!==u||f&&!h||e.hasCertificate(l)||(u={message:"Certificate is not trusted.",error:a.certificateError.unknown_ca})}if(null===u&&f&&!l.isIssuer(f)&&(u={message:"Certificate issuer is invalid.",error:a.certificateError.bad_certificate}),null===u)for(var y={keyUsage:!0,basicConstraints:!0},v=0;null===u&&v<l.extensions.length;++v){var g=l.extensions[v];g.critical&&!(g.name in y)&&(u={message:"Certificate has an unsupported critical extension.",error:a.certificateError.unsupported_certificate})}if(null===u&&(!s||0===t.length&&(!f||h))){var m=l.getExtension("basicConstraints"),b=l.getExtension("keyUsage");if(null!==b&&(b.keyCertSign&&null!==m||(u={message:"Certificate keyUsage or basicConstraints conflict or indicate that the certificate is not a CA. If the certificate is the only one in the chain or isn't the first then the certificate must be a valid CA.",error:a.certificateError.bad_certificate})),null!==u||null===m||m.cA||(u={message:"Certificate basicConstraints indicates the certificate is not a CA.",error:a.certificateError.bad_certificate}),null===u&&null!==b&&"pathLenConstraint"in m)c-1>m.pathLenConstraint&&(u={message:"Certificate basicConstraints pathLenConstraint violated.",error:a.certificateError.bad_certificate})}var E=null===u||u.error,S=r.verify?r.verify(E,c,i):E;if(!0!==S)throw!0===E&&(u={message:"The application rejected the certificate.",error:a.certificateError.bad_certificate}),(S||0===S)&&("object"!=typeof S||n.util.isArray(S)?"string"==typeof S&&(u.error=S):(S.message&&(u.message=S.message),S.error&&(u.error=S.error))),u;u=null,s=!1,++c}while(t.length>0);return!0}},1379:(e,t,r)=>{"use strict";
18
18
  /*!
19
19
  * algorithms/aes-cbc-hmac-sha2.js - AES-CBC-HMAC-SHA2 Composited Encryption
20
20
  *
21
21
  * Copyright (c) 2015 Cisco Systems, Inc. See LICENSE file.
22
- */var n=r(3748),i=r(1733),a=r(8545),o=r(1194),s=r(4678),u=r(4237);function c(e){if(16!==e.length)throw new Error("invalid iv")}function l(e){return n.setupFallback((function(t,r,i){try{c(i)}catch(e){return Promise.reject(e)}var a=Promise.resolve(r);return a=a.then((function(r){var a="AES-"+e+"-CBC",o=n.nodeCrypto.createCipheriv(a,t,i);return Buffer.concat([o.update(r),o.final()])}))}),(function(e,t,r){try{c(r)}catch(e){return Promise.reject(e)}var i=Promise.resolve();return i=(i=(i=i.then((function(){return n.subtleCrypto.importKey("raw",e,{name:"AES-CBC"},!0,["encrypt"])}))).then((function(e){var i={name:"AES-CBC",iv:r};return n.subtleCrypto.encrypt(i,e,t)}))).then((function(e){return e=Buffer.from(e)}))}),(function(e,t,r){try{c(r)}catch(e){return Promise.reject(e)}var n=Promise.resolve();return n=n.then((function(){var n=o.cipher.createCipher("AES-CBC",new s(e));return n.start({iv:new s(r)}),n.update(new s(t)),n.finish()?Buffer.from(n.output.bytes(),"binary"):Promise.reject(new Error("encryption failed"))}))}))}function f(e){return n.setupFallback((function(t,r,i){try{c(i)}catch(e){return Promise.reject(e)}var a=Promise.resolve();return a=a.then((function(){var a="AES-"+e+"-CBC",o=n.nodeCrypto.createDecipheriv(a,t,i);return Buffer.concat([o.update(r),o.final()])}))}),(function(e,t,r){try{c(r)}catch(e){return Promise.reject(e)}var i=Promise.resolve();return i=(i=(i=i.then((function(){return n.subtleCrypto.importKey("raw",e,{name:"AES-CBC"},!0,["decrypt"])}))).then((function(e){var i={name:"AES-CBC",iv:r};return n.subtleCrypto.decrypt(i,e,t)}))).then((function(e){return e=Buffer.from(e)}))}),(function(e,t,r){try{c(r)}catch(e){return Promise.reject(e)}var n=Promise.resolve();return n=n.then((function(){var n=o.cipher.createDecipher("AES-CBC",new s(e));return n.start({iv:new s(r)}),n.update(new s(t)),n.finish()?Buffer.from(n.output.bytes(),"binary"):Promise.reject(new Error("encryption failed"))}))}))}function h(e,t){if(t<<1!=e.length<<3)throw new Error("invalid encryption key size")}function p(e){var t=l(e);return function(r,a,o){try{h(r,e)}catch(e){return Promise.reject(e)}var s=r.slice(e/8),u=r.slice(0,e/8),c=o.iv||Buffer.alloc(0),l=o.aad||o.adata||Buffer.alloc(0),f=t(s,a,c);return f=f.then((function(t){var r=Buffer.concat([l,c,t,n.int64ToBuffer(8*l.length)]);return i["HS"+2*e].sign(u,r,{length:e}).then((function(r){var n=r.mac.slice(0,e/8);return{data:t,tag:n}}))}))}}function d(e){var t=f(e);return function(r,a,o){try{h(r,e)}catch(e){return Promise.reject(e)}var s=r.slice(e/8),u=r.slice(0,e/8),c=o.iv||Buffer.alloc(0),l=o.aad||o.adata||Buffer.alloc(0),f=o.tag||o.mac||Buffer.alloc(0),p=Promise.resolve();return p=(p=p.then((function(){var t=Buffer.concat([l,c,a,n.int64ToBuffer(8*l.length)]);return i["HS"+2*e].verify(u,t,f,{length:e}).then((function(){return a}),(function(){throw new Error("mac check failed")}))}))).then((function(){return t(s,a,c)}))}}var y=Buffer.from("Encryption","utf8"),v=Buffer.from("Integrity","utf8"),g=Buffer.from(".","utf8");function m(e,t,r,i){var o=8*e.length,s=o/2,u=Promise.resolve();return u=(u=u.then((function(){return Buffer.concat([n.int32ToBuffer(1),e,n.int32ToBuffer(s),Buffer.from(t,"utf8"),r,i,y])}))).then((function(e){return a["SHA-"+o].digest(e).then((function(e){return e.slice(0,s/8)}))})),u=Promise.resolve(u)}function b(e,t,r,i){var o=8*e.length,s=o,u=Promise.resolve();return u=(u=u.then((function(){return Buffer.concat([n.int32ToBuffer(1),e,n.int32ToBuffer(s),Buffer.from(t,"utf8"),r,i,v])}))).then((function(e){return a["SHA-"+o].digest(e).then((function(e){return e.slice(0,s/8)}))})),u=Promise.resolve(u)}function E(e,t){var r=l(e);return function(a,o,s){var c,l,f=s.epu||n.int32ToBuffer(0),h=s.epv||n.int32ToBuffer(0),p=s.iv||Buffer.alloc(0),d=s.aad||s.adata||Buffer.alloc(0),y=s.kdata||Buffer.alloc(0),v=[m(a,t,f,h),b(a,t,f,h)],E=Promise.all(v).then((function(e){c=e[0],l=e[1]}));return E=(E=(E=E.then((function(){return r(c,o,p)}))).then((function(t){var r=Buffer.concat([d,g,Buffer.from(y),g,Buffer.from(u.base64url.encode(p),"utf8"),g,Buffer.from(u.base64url.encode(t),"utf8")]);return Promise.all([Promise.resolve(t),i["HS"+2*e].sign(l,r,{length:e})])}))).then((function(e){return{data:e[0],tag:e[1].mac}}))}}function S(e,t){var r=f(e);return function(a,o,s){var c,l,f=s.epu||n.int32ToBuffer(0),h=s.epv||n.int32ToBuffer(0),p=s.iv||Buffer.alloc(0),d=s.aad||s.adata||Buffer.alloc(0),y=s.kdata||Buffer.alloc(0),v=s.tag||s.mac||Buffer.alloc(0),E=[m(a,t,f,h),b(a,t,f,h)],S=Promise.all(E).then((function(e){c=e[0],l=e[1]}));return S=(S=S.then((function(){var t=Buffer.concat([d,g,Buffer.from(y),g,Buffer.from(u.base64url.encode(p),"utf8"),g,Buffer.from(u.base64url.encode(o),"utf8")]);try{return i["HS"+2*e].verify(l,t,v,{loose:!1})}catch(e){throw new Error("mac check failed")}}))).then((function(){return r(c,o,p)}))}}var C={};["A128CBC-HS256","A192CBC-HS384","A256CBC-HS512"].forEach((function(e){var t=parseInt(/A(\d+)CBC-HS(\d+)?/g.exec(e)[1]);C[e]={encrypt:p(t),decrypt:d(t)}})),["A128CBC+HS256","A192CBC+HS384","A256CBC+HS512"].forEach((function(e){var t=parseInt(/A(\d+)CBC\+HS(\d+)?/g.exec(e)[1]);C[e]={encrypt:E(t,e),decrypt:S(t,e)}})),e.exports=C},2736:function(e,t,r){"use strict";
22
+ */var n=r(3748),i=r(1733),a=r(8545),o=r(1194),s=r(4678),u=r(4237);function c(e){if(16!==e.length)throw new Error("invalid iv")}function l(e){return n.setupFallback((function(t,r,i){try{c(i)}catch(e){return Promise.reject(e)}var a=Promise.resolve(r);return a=a.then((function(r){var a="AES-"+e+"-CBC",o=n.nodeCrypto.createCipheriv(a,t,i);return Buffer.concat([o.update(r),o.final()])}))}),(function(e,t,r){try{c(r)}catch(e){return Promise.reject(e)}var i=Promise.resolve();return i=(i=(i=i.then((function(){return n.subtleCrypto.importKey("raw",e,{name:"AES-CBC"},!0,["encrypt"])}))).then((function(e){var i={name:"AES-CBC",iv:r};return n.subtleCrypto.encrypt(i,e,t)}))).then((function(e){return e=Buffer.from(e)}))}),(function(e,t,r){try{c(r)}catch(e){return Promise.reject(e)}var n=Promise.resolve();return n=n.then((function(){var n=o.cipher.createCipher("AES-CBC",new s(e));return n.start({iv:new s(r)}),n.update(new s(t)),n.finish()?Buffer.from(n.output.bytes(),"binary"):Promise.reject(new Error("encryption failed"))}))}))}function f(e){return n.setupFallback((function(t,r,i){try{c(i)}catch(e){return Promise.reject(e)}var a=Promise.resolve();return a=a.then((function(){var a="AES-"+e+"-CBC",o=n.nodeCrypto.createDecipheriv(a,t,i);return Buffer.concat([o.update(r),o.final()])}))}),(function(e,t,r){try{c(r)}catch(e){return Promise.reject(e)}var i=Promise.resolve();return i=(i=(i=i.then((function(){return n.subtleCrypto.importKey("raw",e,{name:"AES-CBC"},!0,["decrypt"])}))).then((function(e){var i={name:"AES-CBC",iv:r};return n.subtleCrypto.decrypt(i,e,t)}))).then((function(e){return e=Buffer.from(e)}))}),(function(e,t,r){try{c(r)}catch(e){return Promise.reject(e)}var n=Promise.resolve();return n=n.then((function(){var n=o.cipher.createDecipher("AES-CBC",new s(e));return n.start({iv:new s(r)}),n.update(new s(t)),n.finish()?Buffer.from(n.output.bytes(),"binary"):Promise.reject(new Error("encryption failed"))}))}))}function h(e,t){if(t<<1!=e.length<<3)throw new Error("invalid encryption key size")}function p(e){var t=l(e);return function(r,a,o){try{h(r,e)}catch(e){return Promise.reject(e)}var s=r.slice(e/8),u=r.slice(0,e/8),c=o.iv||Buffer.alloc(0),l=o.aad||o.adata||Buffer.alloc(0),f=t(s,a,c);return f=f.then((function(t){var r=Buffer.concat([l,c,t,n.int64ToBuffer(8*l.length)]);return i["HS"+2*e].sign(u,r,{length:e}).then((function(r){var n=r.mac.slice(0,e/8);return{data:t,tag:n}}))}))}}function d(e){var t=f(e);return function(r,a,o){try{h(r,e)}catch(e){return Promise.reject(e)}var s=r.slice(e/8),u=r.slice(0,e/8),c=o.iv||Buffer.alloc(0),l=o.aad||o.adata||Buffer.alloc(0),f=o.tag||o.mac||Buffer.alloc(0),p=Promise.resolve();return p=(p=p.then((function(){var t=Buffer.concat([l,c,a,n.int64ToBuffer(8*l.length)]);return i["HS"+2*e].verify(u,t,f,{length:e}).then((function(){return a}),(function(){throw new Error("mac check failed")}))}))).then((function(){return t(s,a,c)}))}}var y=Buffer.from("Encryption","utf8"),v=Buffer.from("Integrity","utf8"),g=Buffer.from(".","utf8");function m(e,t,r,i){var o=8*e.length,s=o/2,u=Promise.resolve();return u=(u=u.then((function(){return Buffer.concat([n.int32ToBuffer(1),e,n.int32ToBuffer(s),Buffer.from(t,"utf8"),r,i,y])}))).then((function(e){return a["SHA-"+o].digest(e).then((function(e){return e.slice(0,s/8)}))})),u=Promise.resolve(u)}function b(e,t,r,i){var o=8*e.length,s=o,u=Promise.resolve();return u=(u=u.then((function(){return Buffer.concat([n.int32ToBuffer(1),e,n.int32ToBuffer(s),Buffer.from(t,"utf8"),r,i,v])}))).then((function(e){return a["SHA-"+o].digest(e).then((function(e){return e.slice(0,s/8)}))})),u=Promise.resolve(u)}function E(e,t){var r=l(e);return function(a,o,s){var c,l,f=s.epu||n.int32ToBuffer(0),h=s.epv||n.int32ToBuffer(0),p=s.iv||Buffer.alloc(0),d=s.aad||s.adata||Buffer.alloc(0),y=s.kdata||Buffer.alloc(0),v=[m(a,t,f,h),b(a,t,f,h)],E=Promise.all(v).then((function(e){c=e[0],l=e[1]}));return E=(E=(E=E.then((function(){return r(c,o,p)}))).then((function(t){var r=Buffer.concat([d,g,Buffer.from(y),g,Buffer.from(u.base64url.encode(p),"utf8"),g,Buffer.from(u.base64url.encode(t),"utf8")]);return Promise.all([Promise.resolve(t),i["HS"+2*e].sign(l,r,{length:e})])}))).then((function(e){return{data:e[0],tag:e[1].mac}}))}}function S(e,t){var r=f(e);return function(a,o,s){var c,l,f=s.epu||n.int32ToBuffer(0),h=s.epv||n.int32ToBuffer(0),p=s.iv||Buffer.alloc(0),d=s.aad||s.adata||Buffer.alloc(0),y=s.kdata||Buffer.alloc(0),v=s.tag||s.mac||Buffer.alloc(0),E=[m(a,t,f,h),b(a,t,f,h)],S=Promise.all(E).then((function(e){c=e[0],l=e[1]}));return S=(S=S.then((function(){var t=Buffer.concat([d,g,Buffer.from(y),g,Buffer.from(u.base64url.encode(p),"utf8"),g,Buffer.from(u.base64url.encode(o),"utf8")]);try{return i["HS"+2*e].verify(l,t,v,{loose:!1})}catch(e){throw new Error("mac check failed")}}))).then((function(){return r(c,o,p)}))}}var C={};["A128CBC-HS256","A192CBC-HS384","A256CBC-HS512"].forEach((function(e){var t=parseInt(/A(\d+)CBC-HS(\d+)?/g.exec(e)[1]);C[e]={encrypt:p(t),decrypt:d(t)}})),["A128CBC+HS256","A192CBC+HS384","A256CBC+HS512"].forEach((function(e){var t=parseInt(/A(\d+)CBC\+HS(\d+)?/g.exec(e)[1]);C[e]={encrypt:E(t,e),decrypt:S(t,e)}})),e.exports=C},2736:(e,t,r)=>{"use strict";
23
23
  /*!
24
24
  * algorithms/aes-gcm.js - AES-GCM Encryption and Key-Wrapping
25
25
  *
26
26
  * Copyright (c) 2015 Cisco Systems, Inc. See LICENSE file.
27
- */var n=r(3748),i=r(4237),a=r(414),o=r(9560);function s(e,t){function r(r,n){if(e!==r.length<<3)throw new Error("invalid key size");if(!n&&!t)throw new Error("invalid iv");if(n&&12!==n.length)throw new Error("invalid iv")}function s(e){if(t){var r=i.base64url.encode(e.iv),n=i.base64url.encode(e.tag);e={data:e.data,header:{iv:r,tag:n}}}return e}return n.setupFallback((function(e,t,a){var o=a.iv,u=a.aad||a.adata||Buffer.alloc(0);try{r(e,o)}catch(e){return Promise.reject(e)}o=o||i.randomBytes(12);var c,l="aes-"+8*e.length+"-gcm";try{c=n.nodeCrypto.createCipheriv(l,e,o)}catch(e){throw new Error("unsupported algorithm: "+l)}if("function"!=typeof c.setAAD)throw new Error("unsupported algorithm: "+l);return u.length&&c.setAAD(u),s({data:Buffer.concat([c.update(t),c.final()]),iv:o,tag:c.getAuthTag()})}),(function(e,t,a){var o=a.iv,u=a.aad||a.adata||Buffer.alloc(0);try{r(e,o)}catch(e){return Promise.reject(e)}o=o||i.randomBytes(12);var c={name:"AES-GCM"};return n.subtleCrypto.importKey("raw",e,c,!0,["encrypt"]).then((function(e){return c.iv=o,c.tagLength=128,u.length&&(c.additionalData=u),n.subtleCrypto.encrypt(c,e,t)})).then((function(e){var t=e.byteLength-16,r=e.slice(t);r=Buffer.from(r);var n=e.slice(0,t);return s({data:n=Buffer.from(n),iv:o,tag:r})}))}),(function(e,t,n){var u,c,l=n.iv,f=n.aad||n.adata||Buffer.alloc(0);try{r(e,l)}catch(e){return Promise.reject(e)}return l=l||i.randomBytes(12),u=o.createCipher({key:e,iv:l,additionalData:f}),c=Buffer.alloc(t.length),new Promise((function(e,r){var n=a.CHUNK_SIZE,i=0,o=0;!function a(){var f=Math.min(n,t.length-o);if(i+=u.update(t,o,f,c,i),o+=f,t.length>o)setTimeout(a,0);else if((i+=u.finish(c,i))===t.length){var h=u.tag;e(s({data:c,iv:l,tag:h}))}else r(new Error("encryption failed"))}()}))}))}function u(e){function t(t,r,n){if(e!==t.length<<3)throw new Error("invalid key size");if(12!==r.length)throw new Error("invalid iv");if(16!==n.length)throw new Error("invalid tag length")}return n.setupFallback((function(e,r,i){var a=i.aad||i.adata||Buffer.alloc(0),o=i.iv||Buffer.alloc(0),s=i.tag||i.mac||Buffer.alloc(0);try{t(e,o,s)}catch(e){return Promise.reject(e)}var u,c="aes-"+8*e.length+"-gcm";try{u=n.nodeCrypto.createDecipheriv(c,e,o)}catch(e){throw new Error("unsupported algorithm: "+c)}if("function"!=typeof u.setAAD)throw new Error("unsupported algorithm: "+c);u.setAuthTag(s),a.length&&u.setAAD(a);try{return Buffer.concat([u.update(r),u.final()])}catch(e){throw new Error("decryption failed")}}),(function(e,r,i){var a=i.aad||i.adata||Buffer.alloc(0),o=i.iv||Buffer.alloc(0),s=i.tag||i.mac||Buffer.alloc(0);try{t(e,o,s)}catch(e){return Promise.reject(e)}var u={name:"AES-GCM"};return n.subtleCrypto.importKey("raw",e,u,!0,["decrypt"]).then((function(e){return u.iv=o,u.tagLength=128,a.length&&(u.additionalData=a),r=Buffer.concat([r,s],r.length+s.length),n.subtleCrypto.decrypt(u,e,r)})).then((function(e){return e=Buffer.from(e)}))}),(function(e,r,n){var i,s,u=n.aad||n.adata||Buffer.alloc(0),c=n.iv||Buffer.alloc(0),l=n.tag||n.mac||Buffer.alloc(0);try{t(e,c,l)}catch(e){return Promise.reject(e)}return i=o.createDecipher({key:e,iv:c,additionalData:u,tag:l}),s=Buffer.alloc(r.length),new Promise((function(e,t){var n=a.CHUNK_SIZE,o=0,u=0;!function a(){var c=Math.min(n,r.length-u);if(o+=i.update(r,u,c,s,o),u+=c,r.length>u)setTimeout(a,0);else{try{o+=i.finish(s,o)}catch(e){return void t(new Error("decryption failed"))}o===r.length?e(s):t(new Error("decryption failed"))}}()}))}))}var c={};["A128GCM","A192GCM","A256GCM","A128GCMKW","A192GCMKW","A256GCMKW"].forEach((function(e){var t=/A(\d+)GCM(KW)?/g.exec(e),r=parseInt(t[1]),n="KW"===t[2];c[e]={encrypt:s(r,n),decrypt:u(r)}})),e.exports=c},4179:function(e,t,r){"use strict";
27
+ */var n=r(3748),i=r(4237),a=r(414),o=r(9560);function s(e,t){function r(r,n){if(e!==r.length<<3)throw new Error("invalid key size");if(!n&&!t)throw new Error("invalid iv");if(n&&12!==n.length)throw new Error("invalid iv")}function s(e){if(t){var r=i.base64url.encode(e.iv),n=i.base64url.encode(e.tag);e={data:e.data,header:{iv:r,tag:n}}}return e}return n.setupFallback((function(e,t,a){var o=a.iv,u=a.aad||a.adata||Buffer.alloc(0);try{r(e,o)}catch(e){return Promise.reject(e)}o=o||i.randomBytes(12);var c,l="aes-"+8*e.length+"-gcm";try{c=n.nodeCrypto.createCipheriv(l,e,o)}catch(e){throw new Error("unsupported algorithm: "+l)}if("function"!=typeof c.setAAD)throw new Error("unsupported algorithm: "+l);return u.length&&c.setAAD(u),s({data:Buffer.concat([c.update(t),c.final()]),iv:o,tag:c.getAuthTag()})}),(function(e,t,a){var o=a.iv,u=a.aad||a.adata||Buffer.alloc(0);try{r(e,o)}catch(e){return Promise.reject(e)}o=o||i.randomBytes(12);var c={name:"AES-GCM"};return n.subtleCrypto.importKey("raw",e,c,!0,["encrypt"]).then((function(e){return c.iv=o,c.tagLength=128,u.length&&(c.additionalData=u),n.subtleCrypto.encrypt(c,e,t)})).then((function(e){var t=e.byteLength-16,r=e.slice(t);r=Buffer.from(r);var n=e.slice(0,t);return s({data:n=Buffer.from(n),iv:o,tag:r})}))}),(function(e,t,n){var u,c,l=n.iv,f=n.aad||n.adata||Buffer.alloc(0);try{r(e,l)}catch(e){return Promise.reject(e)}return l=l||i.randomBytes(12),u=o.createCipher({key:e,iv:l,additionalData:f}),c=Buffer.alloc(t.length),new Promise((function(e,r){var n=a.CHUNK_SIZE,i=0,o=0;!function a(){var f=Math.min(n,t.length-o);if(i+=u.update(t,o,f,c,i),o+=f,t.length>o)setTimeout(a,0);else if((i+=u.finish(c,i))===t.length){var h=u.tag;e(s({data:c,iv:l,tag:h}))}else r(new Error("encryption failed"))}()}))}))}function u(e){function t(t,r,n){if(e!==t.length<<3)throw new Error("invalid key size");if(12!==r.length)throw new Error("invalid iv");if(16!==n.length)throw new Error("invalid tag length")}return n.setupFallback((function(e,r,i){var a=i.aad||i.adata||Buffer.alloc(0),o=i.iv||Buffer.alloc(0),s=i.tag||i.mac||Buffer.alloc(0);try{t(e,o,s)}catch(e){return Promise.reject(e)}var u,c="aes-"+8*e.length+"-gcm";try{u=n.nodeCrypto.createDecipheriv(c,e,o)}catch(e){throw new Error("unsupported algorithm: "+c)}if("function"!=typeof u.setAAD)throw new Error("unsupported algorithm: "+c);u.setAuthTag(s),a.length&&u.setAAD(a);try{return Buffer.concat([u.update(r),u.final()])}catch(e){throw new Error("decryption failed")}}),(function(e,r,i){var a=i.aad||i.adata||Buffer.alloc(0),o=i.iv||Buffer.alloc(0),s=i.tag||i.mac||Buffer.alloc(0);try{t(e,o,s)}catch(e){return Promise.reject(e)}var u={name:"AES-GCM"};return n.subtleCrypto.importKey("raw",e,u,!0,["decrypt"]).then((function(e){return u.iv=o,u.tagLength=128,a.length&&(u.additionalData=a),r=Buffer.concat([r,s],r.length+s.length),n.subtleCrypto.decrypt(u,e,r)})).then((function(e){return e=Buffer.from(e)}))}),(function(e,r,n){var i,s,u=n.aad||n.adata||Buffer.alloc(0),c=n.iv||Buffer.alloc(0),l=n.tag||n.mac||Buffer.alloc(0);try{t(e,c,l)}catch(e){return Promise.reject(e)}return i=o.createDecipher({key:e,iv:c,additionalData:u,tag:l}),s=Buffer.alloc(r.length),new Promise((function(e,t){var n=a.CHUNK_SIZE,o=0,u=0;!function a(){var c=Math.min(n,r.length-u);if(o+=i.update(r,u,c,s,o),u+=c,r.length>u)setTimeout(a,0);else{try{o+=i.finish(s,o)}catch(e){return void t(new Error("decryption failed"))}o===r.length?e(s):t(new Error("decryption failed"))}}()}))}))}var c={};["A128GCM","A192GCM","A256GCM","A128GCMKW","A192GCMKW","A256GCMKW"].forEach((function(e){var t=/A(\d+)GCM(KW)?/g.exec(e),r=parseInt(t[1]),n="KW"===t[2];c[e]={encrypt:s(r,n),decrypt:u(r)}})),e.exports=c},4179:(e,t,r)=>{"use strict";
28
28
  /*!
29
29
  * algorithms/aes-kw.js - AES-KW Key-Wrapping
30
30
  *
31
31
  * Copyright (c) 2015 Cisco Systems, Inc. See LICENSE file.
32
- */var n=r(3748),i=r(1194),a=r(4678),o=Buffer.from("a6a6a6a6a6a6a6a6","hex");function s(e,t){for(var r=Math.max(e.length,t.length),n=Buffer.alloc(r),i=0;r>i;i++)n[i]=(e[i]||0)^(t[i]||0);return n}function u(e,t){for(var r=[],n=0;e.length>n;n+=t)r.push(e.slice(n,n+t));return r}function c(e){var t=Math.floor(e/4294967296),r=e%4294967296,n=Buffer.alloc(8);return n[0]=255&t>>>24,n[1]=255&t>>>16,n[2]=255&t>>>8,n[3]=255&t>>>0,n[4]=255&r>>>24,n[5]=255&r>>>16,n[6]=255&r>>>8,n[7]=255&r>>>0,n}function l(e){function t(t,r){if(e!==t.length<<3)throw new Error("invalid key size");if(0<r.length&&0!=r.length%8)throw new Error("invalid data length")}return n.setupFallback((function(r,i){try{t(r,i)}catch(e){return Promise.reject(e)}var a,l,f,h=u(i,8),p=Buffer.alloc(16);a=o;for(var d=0;6>d;d++)for(var y=0;h.length>y;y++){f=h.length*d+y+1,l=Buffer.concat([a,h[y]]),a=s((l=n.nodeCrypto.createCipheriv("AES"+e,r,p).update(l)).slice(0,8),c(f)),h[y]=l.slice(8,16)}h=[a].concat(h);var v=Buffer.concat(h);return Promise.resolve({data:v})}),(function(e,r){try{t(e,r)}catch(e){return Promise.reject(e)}var i={name:"AES-KW"},a=[n.subtleCrypto.importKey("raw",r,{name:"HMAC",hash:"SHA-256"},!0,["sign"]),n.subtleCrypto.importKey("raw",e,i,!0,["wrapKey"])];return a=(a=(a=Promise.all(a)).then((function(e){return n.subtleCrypto.wrapKey("raw",e[0],e[1],i)}))).then((function(e){return{data:e=Buffer.from(e)}}))}),(function(e,r){try{t(e,r)}catch(e){return Promise.reject(e)}var n,l,f,h=i.cipher.createCipher("AES",new a(e)),p=u(r,8);n=o;for(var d=0;6>d;d++)for(var y=0;p.length>y;y++)f=p.length*d+y+1,l=Buffer.concat([n,p[y]]),h.start(),h.update(new a(l)),h.finish(),n=s((l=Buffer.from(h.output.bytes(),"binary")).slice(0,8),c(f)),p[y]=l.slice(8,16);p=[n].concat(p);var v=Buffer.concat(p);return Promise.resolve({data:v})}))}function f(e){function t(t,r){if(e!==t.length<<3)throw new Error("invalid key size");if(0<r.length-8&&0!=r.length%8)throw new Error("invalid data length")}return n.setupFallback((function(r,i){try{t(r,i)}catch(e){return Promise.reject(e)}var a,l,f=u(i,8),h=Buffer.alloc(16);a=f[0],f=f.slice(1);for(var p=5;0<=p;--p)for(var d=f.length-1;0<=d;--d){l=s(a,c(f.length*p+d+1)),l=Buffer.concat([l,f[d],h]),a=(l=n.nodeCrypto.createDecipheriv("AES"+e,r,h).update(l)).slice(0,8),f[d]=l.slice(8,16)}if(a.toString()!==o.toString())return Promise.reject(new Error("decryption failed"));var y=Buffer.concat(f);return Promise.resolve(y)}),(function(e,r){try{t(e,r)}catch(e){return Promise.reject(e)}var i={name:"AES-KW"},a=n.subtleCrypto.importKey("raw",e,i,!0,["unwrapKey"]);return a=(a=(a=a.then((function(e){return n.subtleCrypto.unwrapKey("raw",r,e,i,{name:"HMAC",hash:"SHA-256"},!0,["sign"])}))).then((function(e){return n.subtleCrypto.exportKey("raw",e)}))).then((function(e){return e=Buffer.from(e)}))}),(function(e,r){try{t(e,r)}catch(e){return Promise.reject(e)}var n,l,f=i.cipher.createDecipher("AES",new a(e)),h=u(r,8);n=h[0],h=h.slice(1);for(var p=5;0<=p;--p)for(var d=h.length-1;0<=d;--d)l=s(n,c(h.length*p+d+1)),l=Buffer.concat([l,h[d]]),f.start(),f.update(new a(l)),f.finish(),n=(l=Buffer.from(f.output.bytes(),"binary")).slice(0,8),h[d]=l.slice(8,16);if(n.toString()!==o.toString())return Promise.reject(new Error("decryption failed"));var y=Buffer.concat(h);return Promise.resolve(y)}))}var h={};["A128KW","A192KW","A256KW"].forEach((function(e){var t=parseInt(/A(\d+)KW/g.exec(e)[1]);h[e]={encrypt:l(t),decrypt:f(t)}})),e.exports=h},2319:function(e,t,r){"use strict";
32
+ */var n=r(3748),i=r(1194),a=r(4678),o=Buffer.from("a6a6a6a6a6a6a6a6","hex");function s(e,t){for(var r=Math.max(e.length,t.length),n=Buffer.alloc(r),i=0;r>i;i++)n[i]=(e[i]||0)^(t[i]||0);return n}function u(e,t){for(var r=[],n=0;e.length>n;n+=t)r.push(e.slice(n,n+t));return r}function c(e){var t=Math.floor(e/4294967296),r=e%4294967296,n=Buffer.alloc(8);return n[0]=255&t>>>24,n[1]=255&t>>>16,n[2]=255&t>>>8,n[3]=255&t>>>0,n[4]=255&r>>>24,n[5]=255&r>>>16,n[6]=255&r>>>8,n[7]=255&r>>>0,n}function l(e){function t(t,r){if(e!==t.length<<3)throw new Error("invalid key size");if(0<r.length&&0!=r.length%8)throw new Error("invalid data length")}return n.setupFallback((function(r,i){try{t(r,i)}catch(e){return Promise.reject(e)}var a,l,f,h=u(i,8),p=Buffer.alloc(16);a=o;for(var d=0;6>d;d++)for(var y=0;h.length>y;y++){f=h.length*d+y+1,l=Buffer.concat([a,h[y]]),a=s((l=n.nodeCrypto.createCipheriv("AES"+e,r,p).update(l)).slice(0,8),c(f)),h[y]=l.slice(8,16)}h=[a].concat(h);var v=Buffer.concat(h);return Promise.resolve({data:v})}),(function(e,r){try{t(e,r)}catch(e){return Promise.reject(e)}var i={name:"AES-KW"},a=[n.subtleCrypto.importKey("raw",r,{name:"HMAC",hash:"SHA-256"},!0,["sign"]),n.subtleCrypto.importKey("raw",e,i,!0,["wrapKey"])];return a=(a=(a=Promise.all(a)).then((function(e){return n.subtleCrypto.wrapKey("raw",e[0],e[1],i)}))).then((function(e){return{data:e=Buffer.from(e)}}))}),(function(e,r){try{t(e,r)}catch(e){return Promise.reject(e)}var n,l,f,h=i.cipher.createCipher("AES",new a(e)),p=u(r,8);n=o;for(var d=0;6>d;d++)for(var y=0;p.length>y;y++)f=p.length*d+y+1,l=Buffer.concat([n,p[y]]),h.start(),h.update(new a(l)),h.finish(),n=s((l=Buffer.from(h.output.bytes(),"binary")).slice(0,8),c(f)),p[y]=l.slice(8,16);p=[n].concat(p);var v=Buffer.concat(p);return Promise.resolve({data:v})}))}function f(e){function t(t,r){if(e!==t.length<<3)throw new Error("invalid key size");if(0<r.length-8&&0!=r.length%8)throw new Error("invalid data length")}return n.setupFallback((function(r,i){try{t(r,i)}catch(e){return Promise.reject(e)}var a,l,f=u(i,8),h=Buffer.alloc(16);a=f[0],f=f.slice(1);for(var p=5;0<=p;--p)for(var d=f.length-1;0<=d;--d){l=s(a,c(f.length*p+d+1)),l=Buffer.concat([l,f[d],h]),a=(l=n.nodeCrypto.createDecipheriv("AES"+e,r,h).update(l)).slice(0,8),f[d]=l.slice(8,16)}if(a.toString()!==o.toString())return Promise.reject(new Error("decryption failed"));var y=Buffer.concat(f);return Promise.resolve(y)}),(function(e,r){try{t(e,r)}catch(e){return Promise.reject(e)}var i={name:"AES-KW"},a=n.subtleCrypto.importKey("raw",e,i,!0,["unwrapKey"]);return a=(a=(a=a.then((function(e){return n.subtleCrypto.unwrapKey("raw",r,e,i,{name:"HMAC",hash:"SHA-256"},!0,["sign"])}))).then((function(e){return n.subtleCrypto.exportKey("raw",e)}))).then((function(e){return e=Buffer.from(e)}))}),(function(e,r){try{t(e,r)}catch(e){return Promise.reject(e)}var n,l,f=i.cipher.createDecipher("AES",new a(e)),h=u(r,8);n=h[0],h=h.slice(1);for(var p=5;0<=p;--p)for(var d=h.length-1;0<=d;--d)l=s(n,c(h.length*p+d+1)),l=Buffer.concat([l,h[d]]),f.start(),f.update(new a(l)),f.finish(),n=(l=Buffer.from(f.output.bytes(),"binary")).slice(0,8),h[d]=l.slice(8,16);if(n.toString()!==o.toString())return Promise.reject(new Error("decryption failed"));var y=Buffer.concat(h);return Promise.resolve(y)}))}var h={};["A128KW","A192KW","A256KW"].forEach((function(e){var t=parseInt(/A(\d+)KW/g.exec(e)[1]);h[e]={encrypt:l(t),decrypt:f(t)}})),e.exports=h},2319:(e,t,r)=>{"use strict";
33
33
  /*!
34
34
  * algorithms/concat.js - Concat Key Derivation
35
35
  *
36
36
  * Copyright (c) 2015 Cisco Systems, Inc. See LICENSE file.
37
- */var n=r(414),i=r(8545);function a(e){e=e.replace("CONCAT-","");return function(t,r){var a=(r=r||{}).length,o=n.HASHLENGTH[e];if(!a)return Promise.reject(new Error("invalid key length"));if(!r.otherInfo)return Promise.reject(new Error("invalid otherInfo"));var s=r.otherInfo,u=i[e].digest,c=Math.ceil(a/o),l=0,f=[];return function e(){if(c===l++)return Buffer.concat(f).slice(0,a);var r=Buffer.alloc(4+t.length+s.length);return r.writeUInt32BE(l,0),t.copy(r,4),s.copy(r,4+t.length),u(r).then((function(t){return f.push(t),e()}))}()}}var o={};["CONCAT-SHA-1","CONCAT-SHA-256","CONCAT-SHA-384","CONCAT-SHA-512"].forEach((function(e){o[e]={derive:a(e)}})),e.exports=o},414:function(e){"use strict";
37
+ */var n=r(414),i=r(8545);function a(e){e=e.replace("CONCAT-","");return function(t,r){var a=(r=r||{}).length,o=n.HASHLENGTH[e];if(!a)return Promise.reject(new Error("invalid key length"));if(!r.otherInfo)return Promise.reject(new Error("invalid otherInfo"));var s=r.otherInfo,u=i[e].digest,c=Math.ceil(a/o),l=0,f=[];return function e(){if(c===l++)return Buffer.concat(f).slice(0,a);var r=Buffer.alloc(4+t.length+s.length);return r.writeUInt32BE(l,0),t.copy(r,4),s.copy(r,4+t.length),u(r).then((function(t){return f.push(t),e()}))}()}}var o={};["CONCAT-SHA-1","CONCAT-SHA-256","CONCAT-SHA-384","CONCAT-SHA-512"].forEach((function(e){o[e]={derive:a(e)}})),e.exports=o},414:e=>{"use strict";
38
38
  /*!
39
39
  * algorithms/constants.js - Constants used in Cryptographic Algorithms
40
40
  *
41
41
  * Copyright (c) 2015 Cisco Systems, Inc. See LICENSE file.
42
- */e.exports={CHUNK_SIZE:1024,HASHLENGTH:{"SHA-1":160,"SHA-256":256,"SHA-384":384,"SHA-512":512},ENCLENGTH:{"AES-128-CBC":128,"AES-192-CBC":192,"AES-256-CBC":256,"AES-128-KW":128,"AES-192-KW":192,"AES-256-KW":256},KEYLENGTH:{"A128CBC-HS256":256,"A192CBC-HS384":384,"A256CBC-HS512":512,"A128CBC+HS256":256,"A192CBC+HS384":384,"A256CBC+HS512":512,A128GCM:128,A192GCM:192,A256GCM:256,A128KW:128,A192KW:192,A256KW:256,"ECDH-ES+A128KW":128,"ECDH-ES+A192KW":192,"ECDH-ES+A256KW":256},NONCELENGTH:{"A128CBC-HS256":128,"A192CBC-HS384":128,"A256CBC-HS512":128,"A128CBC+HS256":128,"A192CBC+HS384":128,"A256CBC+HS512":128,A128GCM:96,A192GCM:96,A256GCM:96}}},2274:function(e){"use strict";
42
+ */e.exports={CHUNK_SIZE:1024,HASHLENGTH:{"SHA-1":160,"SHA-256":256,"SHA-384":384,"SHA-512":512},ENCLENGTH:{"AES-128-CBC":128,"AES-192-CBC":192,"AES-256-CBC":256,"AES-128-KW":128,"AES-192-KW":192,"AES-256-KW":256},KEYLENGTH:{"A128CBC-HS256":256,"A192CBC-HS384":384,"A256CBC-HS512":512,"A128CBC+HS256":256,"A192CBC+HS384":384,"A256CBC+HS512":512,A128GCM:128,A192GCM:192,A256GCM:256,A128KW:128,A192KW:192,A256KW:256,"ECDH-ES+A128KW":128,"ECDH-ES+A192KW":192,"ECDH-ES+A256KW":256},NONCELENGTH:{"A128CBC-HS256":128,"A192CBC-HS384":128,"A256CBC-HS512":128,"A128CBC+HS256":128,"A192CBC+HS384":128,"A256CBC+HS512":128,A128GCM:96,A192GCM:96,A256GCM:96}}},2274:e=>{"use strict";
43
43
  /*!
44
44
  * algorithms/dir.js - Direct key mode
45
45
  *
46
46
  * Copyright (c) 2015 Cisco Systems, Inc. See LICENSE file.
47
- */var t={dir:{encrypt:function(e){return Promise.resolve({data:e,once:!0,direct:!0})},decrypt:function(e){return Promise.resolve(e)}}};e.exports=t},1762:function(e,t,r){"use strict";
47
+ */var t={dir:{encrypt:function(e){return Promise.resolve({data:e,once:!0,direct:!0})},decrypt:function(e){return Promise.resolve(e)}}};e.exports=t},1762:(e,t,r)=>{"use strict";
48
48
  /*!
49
49
  * algorithms/ec-util.js - Elliptic Curve Utility Functions
50
50
  *
51
51
  * Copyright (c) 2015 Cisco Systems, Inc. See LICENSE file.
52
- */var n=r(6678),i=r(1634),a=r(1194),o=r(4237),s={"P-256":256,"P-384":384,"P-521":521};function u(e,t){var r=n(e);return(t?["x","y"]:["d"]).forEach((function(e){r[e]=o.asBuffer(r[e],"base64url")})),r}var c=Buffer.from([4]);var l="1.2.840.10045.2.1";var f="Could not extract parameters from DER signature";function h(e,t,r){for(var n=0;t+n<r&&0===e[t+n];)++n;return e[t+n]>=128&&--n,n}e.exports={convertToForge:function(e,t){var r=t?["x","y"]:["d"];return r=r.map((function(t){return new a.jsbn.BigInteger(e[t].toString("hex"),16)})),r=[e.crv].concat(r),(t?i.asPublicKey:i.asPrivateKey).apply(i,r)},convertToJWK:function(e,t){var r=n(e);return(t?["x","y"]:["x","y","d"]).forEach((function(e){r[e]=o.base64url.encode(r[e])})),delete r.key_ops,delete r.use,delete r.alg,t&&delete r.d,r},convertToObj:u,convertToBuffer:function(e,t){return e=u(e,t),t?Buffer.concat([c,e.x,e.y]):e.d},curveSize:function(e){return s[e||""]||NaN},derToConcat:function(e,t){var r=0;if(48!==e[r++])throw new Error(f);var n=e[r++];if(129===n&&(n=e[r++]),n>e.length-r)throw new Error(f);if(2!==e[r++])throw new Error(f);var i=e[r++];if(i>e.length-r-2)throw new Error(f);if(i>t+1)throw new Error(f);var a=r;if(r+=i,2!==e[r++])throw new Error(f);var o=e[r++];if(o!==e.length-r)throw new Error(f);if(o>t+1)throw new Error(f);var s=r;if((r+=o)!==e.length)throw new Error(f);var u=t-i,c=t-o,l=Buffer.alloc(u+i+c+o);for(r=0;r<u;++r)l[r]=0;var h=Math.max(-u,0);e.copy(l,r,a+h,a+i);for(var p=r=t;r<p+c;++r)l[r]=0;var d=Math.max(-c,0);return e.copy(l,r,s+d,s+o),l},concatToDer:function(e,t){var r=h(e,0,t),n=h(e,t,e.length),i=t-r,a=t-n,o=i+a+4,s=o<128,u=Buffer.alloc((s?2:3)+o),c=0;return u[c++]=48,s?u[c++]=o:(u[c++]=129,u[c++]=255&o),u[c++]=2,u[c++]=i,r<0?(u[c++]=0,c+=e.copy(u,c,0,t)):c+=e.copy(u,c,r,t),u[c++]=2,u[c++]=a,n<0?(u[c++]=0,e.copy(u,c,t)):e.copy(u,c,t+n),u},convertToPEM:function(e,t){var r,n,i,o=e.crv;return o=function(e){switch(e){case"P-256":return"1.2.840.10045.3.1.7";case"P-384":return"1.3.132.0.34";case"P-521":return"1.3.132.0.35";default:return null}}(o),o=a.asn1.oidToDer(o),t?(r="EC PRIVATE KEY",n=Buffer.concat([Buffer.from([0,4]),e.x,e.y]).toString("binary"),e=e.d.toString("binary"),i=a.asn1.create(a.asn1.Class.UNIVERSAL,a.asn1.Type.SEQUENCE,!0,[a.asn1.create(a.asn1.Class.UNIVERSAL,a.asn1.Type.INTEGER,!1,""),a.asn1.create(a.asn1.Class.UNIVERSAL,a.asn1.Type.OCTETSTRING,!1,e),a.asn1.create(a.asn1.Class.CONTEXT_SPECIFIC,0,!0,[a.asn1.create(a.asn1.Class.UNIVERSAL,a.asn1.Type.OID,!1,o.bytes())]),a.asn1.create(a.asn1.Class.CONTEXT_SPECIFIC,1,!0,[a.asn1.create(a.asn1.Class.UNIVERSAL,a.asn1.Type.BITSTRING,!1,n)])])):(r="PUBLIC KEY",e=Buffer.concat([Buffer.from([0,4]),e.x,e.y]).toString("binary"),i=a.asn1.create(a.asn1.Class.UNIVERSAL,a.asn1.Type.SEQUENCE,!0,[a.asn1.create(a.asn1.Class.UNIVERSAL,a.asn1.Type.SEQUENCE,!0,[a.asn1.create(a.asn1.Class.UNIVERSAL,a.asn1.Type.OID,!1,a.asn1.oidToDer(l).bytes()),a.asn1.create(a.asn1.Class.UNIVERSAL,a.asn1.Type.OID,!1,o.bytes())]),a.asn1.create(a.asn1.Class.UNIVERSAL,a.asn1.Type.BITSTRING,!1,e)])),i=a.asn1.toDer(i).bytes(),a.pem.encode({type:r,body:i})},EC_OID:l}},3724:function(e,t,r){"use strict";
52
+ */var n=r(6678),i=r(1634),a=r(1194),o=r(4237),s={"P-256":256,"P-384":384,"P-521":521};function u(e,t){var r=n(e);return(t?["x","y"]:["d"]).forEach((function(e){r[e]=o.asBuffer(r[e],"base64url")})),r}var c=Buffer.from([4]);var l="1.2.840.10045.2.1";var f="Could not extract parameters from DER signature";function h(e,t,r){for(var n=0;t+n<r&&0===e[t+n];)++n;return e[t+n]>=128&&--n,n}e.exports={convertToForge:function(e,t){var r=t?["x","y"]:["d"];return r=r.map((function(t){return new a.jsbn.BigInteger(e[t].toString("hex"),16)})),r=[e.crv].concat(r),(t?i.asPublicKey:i.asPrivateKey).apply(i,r)},convertToJWK:function(e,t){var r=n(e);return(t?["x","y"]:["x","y","d"]).forEach((function(e){r[e]=o.base64url.encode(r[e])})),delete r.key_ops,delete r.use,delete r.alg,t&&delete r.d,r},convertToObj:u,convertToBuffer:function(e,t){return e=u(e,t),t?Buffer.concat([c,e.x,e.y]):e.d},curveSize:function(e){return s[e||""]||NaN},derToConcat:function(e,t){var r=0;if(48!==e[r++])throw new Error(f);var n=e[r++];if(129===n&&(n=e[r++]),n>e.length-r)throw new Error(f);if(2!==e[r++])throw new Error(f);var i=e[r++];if(i>e.length-r-2)throw new Error(f);if(i>t+1)throw new Error(f);var a=r;if(r+=i,2!==e[r++])throw new Error(f);var o=e[r++];if(o!==e.length-r)throw new Error(f);if(o>t+1)throw new Error(f);var s=r;if((r+=o)!==e.length)throw new Error(f);var u=t-i,c=t-o,l=Buffer.alloc(u+i+c+o);for(r=0;r<u;++r)l[r]=0;var h=Math.max(-u,0);e.copy(l,r,a+h,a+i);for(var p=r=t;r<p+c;++r)l[r]=0;var d=Math.max(-c,0);return e.copy(l,r,s+d,s+o),l},concatToDer:function(e,t){var r=h(e,0,t),n=h(e,t,e.length),i=t-r,a=t-n,o=i+a+4,s=o<128,u=Buffer.alloc((s?2:3)+o),c=0;return u[c++]=48,s?u[c++]=o:(u[c++]=129,u[c++]=255&o),u[c++]=2,u[c++]=i,r<0?(u[c++]=0,c+=e.copy(u,c,0,t)):c+=e.copy(u,c,r,t),u[c++]=2,u[c++]=a,n<0?(u[c++]=0,e.copy(u,c,t)):e.copy(u,c,t+n),u},convertToPEM:function(e,t){var r,n,i,o=e.crv;return o=function(e){switch(e){case"P-256":return"1.2.840.10045.3.1.7";case"P-384":return"1.3.132.0.34";case"P-521":return"1.3.132.0.35";default:return null}}(o),o=a.asn1.oidToDer(o),t?(r="EC PRIVATE KEY",n=Buffer.concat([Buffer.from([0,4]),e.x,e.y]).toString("binary"),e=e.d.toString("binary"),i=a.asn1.create(a.asn1.Class.UNIVERSAL,a.asn1.Type.SEQUENCE,!0,[a.asn1.create(a.asn1.Class.UNIVERSAL,a.asn1.Type.INTEGER,!1,""),a.asn1.create(a.asn1.Class.UNIVERSAL,a.asn1.Type.OCTETSTRING,!1,e),a.asn1.create(a.asn1.Class.CONTEXT_SPECIFIC,0,!0,[a.asn1.create(a.asn1.Class.UNIVERSAL,a.asn1.Type.OID,!1,o.bytes())]),a.asn1.create(a.asn1.Class.CONTEXT_SPECIFIC,1,!0,[a.asn1.create(a.asn1.Class.UNIVERSAL,a.asn1.Type.BITSTRING,!1,n)])])):(r="PUBLIC KEY",e=Buffer.concat([Buffer.from([0,4]),e.x,e.y]).toString("binary"),i=a.asn1.create(a.asn1.Class.UNIVERSAL,a.asn1.Type.SEQUENCE,!0,[a.asn1.create(a.asn1.Class.UNIVERSAL,a.asn1.Type.SEQUENCE,!0,[a.asn1.create(a.asn1.Class.UNIVERSAL,a.asn1.Type.OID,!1,a.asn1.oidToDer(l).bytes()),a.asn1.create(a.asn1.Class.UNIVERSAL,a.asn1.Type.OID,!1,o.bytes())]),a.asn1.create(a.asn1.Class.UNIVERSAL,a.asn1.Type.BITSTRING,!1,e)])),i=a.asn1.toDer(i).bytes(),a.pem.encode({type:r,body:i})},EC_OID:l}},3724:(e,t,r)=>{"use strict";
53
53
  /*!
54
54
  * algorithms/ecdh.js - Elliptic Curve Diffie-Hellman algorithms
55
55
  *
56
56
  * Copyright (c) 2015 Cisco Systems, Inc. See LICENSE file.
57
- */var n=r(5029),i=r(4237),a=r(1762),o=r(5141),s=r(2319),u=r(4179),c=r(3748),l=r(414),f=r(6678),h=r(7557),p=r(8718);function d(e){switch(e){case"P-256":return"SHA-256";case"P-384":return"SHA-384";case"P-521":return"SHA-512";default:throw new Error("unsupported curve: "+e)}}var y=e.exports={};function v(e,t,r){function n(e){return Buffer.concat([c.int32ToBuffer(e.length),e])}var a=r.algorithm||"",o=l.KEYLENGTH[a],s=i.asBuffer(r.apu||"","base64url"),u=i.asBuffer(r.apv||"","base64url"),f={public:t,length:o/8,hash:"SHA-256",otherInfo:Buffer.concat([n(Buffer.from(a,"utf8")),n(s),n(u),c.int32ToBuffer(o)])};return y["ECDH-CONCAT"].derive(e,f)}["ECDH","ECDH-HKDF","ECDH-CONCAT"].forEach((function(e){var t,r,i=/^ECDH(?:-(\w+))?$/g.exec(e||"")[1],u=y[e]=y[e]||{};switch(i||""){case"CONCAT":u.derive=function(e,t){var r;t=t||{};try{if(!(r=t.hash||d(e.crv)))throw new Error("invalid hash: "+r);r.toUpperCase()}catch(e){return Promise.reject(e)}var n=["public"],i=y.ECDH.derive(e,p(t,n));return i.then((function(e){return s["CONCAT-"+r].derive(e,h(t,n))}))};break;case"HKDF":u.derive=function(e,t){var r;t=t||{};try{if(!(r=t.hash||d(e.crv)))throw new Error("invalid hash: "+r);r.toUpperCase()}catch(e){return Promise.reject(e)}var n=["public"],i=y.ECDH.derive(e,p(t,n));return i.then((function(e){return o["HKDF-"+r].derive(e,h(t,n))}))};break;case"":u.derive=(t={name:"ECDH"},r=function(e,t){var r=e&&a.convertToForge(e,!0);if(!r||!r.isValid())return Promise.reject(new Error("invalid EC public key"));switch(t){case"jwk":r=a.convertToJWK(e,!0);break;case"buffer":r=a.convertToBuffer(e,!0)}return Promise.resolve(r)},c.setupFallback((function(e,t){if("function"!=typeof c.nodeCrypto.createECDH)throw new Error("unsupported algorithm: ECDH");var n,i=(t=t||{}).length||0;switch(e.crv){case"P-256":n="prime256v1";break;case"P-384":n="secp384r1";break;case"P-521":n="secp521r1";break;default:return Promise.reject(new Error("invalid curve: "+n))}var o=a.convertToBuffer(e,!1),s=r(t.public,"buffer");return s.then((function(e){var t=c.nodeCrypto.createECDH(n);t.setPrivateKey(o);var r=t.computeSecret(e);if(i){if(r.length<i)return Promise.reject(new Error("key length too large: "+i));r=r.slice(0,i)}return r}))}),(function(e,i){e=e||{};var o=(i=i||{}).length||0,s=n(f(t),{namedCurve:e.crv});o||(o=e.d.length);var u=a.convertToJWK(e,!1);u=c.subtleCrypto.importKey("jwk",u,s,!1,["deriveBits"]);var l=r(i.public,"jwk");l=l.then((function(e){return c.subtleCrypto.importKey("jwk",e,s,!1,[])}));var h=Promise.all([u,l]);return(h=h.then((function(e){var r=e[0],i=e[1],a=n(f(t),{public:i});return c.subtleCrypto.deriveBits(a,r,8*o)}))).then((function(e){return Buffer.from(e)}))}),(function(e,t){var n=(t=t||{}).length||0,i=a.convertToForge(e,!1),o=r(t.public,"forge");return o.then((function(e){var t=i.computeSecret(e);if(n){if(t.length<n)return Promise.reject(new Error("key length too large: "+n));t=t.slice(0,n)}return t}))})));break;default:u.derive=null}})),["ECDH-ES","ECDH-ES+A128KW","ECDH-ES+A192KW","ECDH-ES+A256KW"].forEach((function(e){var t,r,n=/^ECDH-ES(?:\+(.+))?/g.exec(e||"")[1],i=y[e]=y[e]||{};n?(n=u[n])?(i.encrypt=(r=n.encrypt,function(e,t,n){if(!(n=n||{}).epk||!n.epk.d)return Promise.reject(new Error("missing ephemeral private key"));var i=a.convertToObj(n.epk,!1);if(!e||!e.x||!e.y)return Promise.reject(new Error("missing static public key"));var o=v(i,a.convertToObj(e,!0),{algorithm:n.alg,apu:n.apu,apv:n.apv});return o.then((function(e){return r(e,t)}))}),i.decrypt=(t=n.decrypt,function(e,r,n){if(!(n=n||{}).epk||!n.epk.x||!n.epk.y)return Promise.reject(new Error("missing ephemeral public key"));var i=a.convertToObj(n.epk,!0);if(!e||!e.d)return Promise.reject(new Error("missing static private key"));var o=v(a.convertToObj(e,!1),i,{algorithm:n.alg,apu:n.apu,apv:n.apv});return o.then((function(e){return t(e,r)}))})):i.ecrypt=i.decrypt=null:(i.encrypt=function(e,t,r){if(!(r=r||{}).epk||!r.epk.d)return Promise.reject(new Error("missing ephemeral private key"));var n=a.convertToObj(r.epk,!1);if(!e||!e.x||!e.y)return Promise.reject(new Error("missing static public key"));var i=v(n,a.convertToObj(e,!0),{algorithm:r.enc,apu:r.apu,apv:r.apv});return i.then((function(e){return{data:e,once:!0,direct:!0}}))},i.decrypt=function(e,t,r){if(!(r=r||{}).epk||!r.epk.x||!r.epk.y)return Promise.reject(new Error("missing ephemeral public key"));var n=a.convertToObj(r.epk,!0);if(!e||!e.d)return Promise.reject(new Error("missing static private key"));var i=v(a.convertToObj(e,!1),n,{algorithm:r.enc,apu:r.apu,apv:r.apv});return i.then((function(e){return e}))})}))},4008:function(e,t,r){"use strict";
57
+ */var n=r(5029),i=r(4237),a=r(1762),o=r(5141),s=r(2319),u=r(4179),c=r(3748),l=r(414),f=r(6678),h=r(7557),p=r(8718);function d(e){switch(e){case"P-256":return"SHA-256";case"P-384":return"SHA-384";case"P-521":return"SHA-512";default:throw new Error("unsupported curve: "+e)}}var y=e.exports={};function v(e,t,r){function n(e){return Buffer.concat([c.int32ToBuffer(e.length),e])}var a=r.algorithm||"",o=l.KEYLENGTH[a],s=i.asBuffer(r.apu||"","base64url"),u=i.asBuffer(r.apv||"","base64url"),f={public:t,length:o/8,hash:"SHA-256",otherInfo:Buffer.concat([n(Buffer.from(a,"utf8")),n(s),n(u),c.int32ToBuffer(o)])};return y["ECDH-CONCAT"].derive(e,f)}["ECDH","ECDH-HKDF","ECDH-CONCAT"].forEach((function(e){var t,r,i=/^ECDH(?:-(\w+))?$/g.exec(e||"")[1],u=y[e]=y[e]||{};switch(i||""){case"CONCAT":u.derive=function(e,t){var r;t=t||{};try{if(!(r=t.hash||d(e.crv)))throw new Error("invalid hash: "+r);r.toUpperCase()}catch(e){return Promise.reject(e)}var n=["public"],i=y.ECDH.derive(e,p(t,n));return i.then((function(e){return s["CONCAT-"+r].derive(e,h(t,n))}))};break;case"HKDF":u.derive=function(e,t){var r;t=t||{};try{if(!(r=t.hash||d(e.crv)))throw new Error("invalid hash: "+r);r.toUpperCase()}catch(e){return Promise.reject(e)}var n=["public"],i=y.ECDH.derive(e,p(t,n));return i.then((function(e){return o["HKDF-"+r].derive(e,h(t,n))}))};break;case"":u.derive=(t={name:"ECDH"},r=function(e,t){var r=e&&a.convertToForge(e,!0);if(!r||!r.isValid())return Promise.reject(new Error("invalid EC public key"));switch(t){case"jwk":r=a.convertToJWK(e,!0);break;case"buffer":r=a.convertToBuffer(e,!0)}return Promise.resolve(r)},c.setupFallback((function(e,t){if("function"!=typeof c.nodeCrypto.createECDH)throw new Error("unsupported algorithm: ECDH");var n,i=(t=t||{}).length||0;switch(e.crv){case"P-256":n="prime256v1";break;case"P-384":n="secp384r1";break;case"P-521":n="secp521r1";break;default:return Promise.reject(new Error("invalid curve: "+n))}var o=a.convertToBuffer(e,!1),s=r(t.public,"buffer");return s.then((function(e){var t=c.nodeCrypto.createECDH(n);t.setPrivateKey(o);var r=t.computeSecret(e);if(i){if(r.length<i)return Promise.reject(new Error("key length too large: "+i));r=r.slice(0,i)}return r}))}),(function(e,i){e=e||{};var o=(i=i||{}).length||0,s=n(f(t),{namedCurve:e.crv});o||(o=e.d.length);var u=a.convertToJWK(e,!1);u=c.subtleCrypto.importKey("jwk",u,s,!1,["deriveBits"]);var l=r(i.public,"jwk");l=l.then((function(e){return c.subtleCrypto.importKey("jwk",e,s,!1,[])}));var h=Promise.all([u,l]);return(h=h.then((function(e){var r=e[0],i=e[1],a=n(f(t),{public:i});return c.subtleCrypto.deriveBits(a,r,8*o)}))).then((function(e){return Buffer.from(e)}))}),(function(e,t){var n=(t=t||{}).length||0,i=a.convertToForge(e,!1),o=r(t.public,"forge");return o.then((function(e){var t=i.computeSecret(e);if(n){if(t.length<n)return Promise.reject(new Error("key length too large: "+n));t=t.slice(0,n)}return t}))})));break;default:u.derive=null}})),["ECDH-ES","ECDH-ES+A128KW","ECDH-ES+A192KW","ECDH-ES+A256KW"].forEach((function(e){var t,r,n=/^ECDH-ES(?:\+(.+))?/g.exec(e||"")[1],i=y[e]=y[e]||{};n?(n=u[n])?(i.encrypt=(r=n.encrypt,function(e,t,n){if(!(n=n||{}).epk||!n.epk.d)return Promise.reject(new Error("missing ephemeral private key"));var i=a.convertToObj(n.epk,!1);if(!e||!e.x||!e.y)return Promise.reject(new Error("missing static public key"));var o=v(i,a.convertToObj(e,!0),{algorithm:n.alg,apu:n.apu,apv:n.apv});return o.then((function(e){return r(e,t)}))}),i.decrypt=(t=n.decrypt,function(e,r,n){if(!(n=n||{}).epk||!n.epk.x||!n.epk.y)return Promise.reject(new Error("missing ephemeral public key"));var i=a.convertToObj(n.epk,!0);if(!e||!e.d)return Promise.reject(new Error("missing static private key"));var o=v(a.convertToObj(e,!1),i,{algorithm:n.alg,apu:n.apu,apv:n.apv});return o.then((function(e){return t(e,r)}))})):i.ecrypt=i.decrypt=null:(i.encrypt=function(e,t,r){if(!(r=r||{}).epk||!r.epk.d)return Promise.reject(new Error("missing ephemeral private key"));var n=a.convertToObj(r.epk,!1);if(!e||!e.x||!e.y)return Promise.reject(new Error("missing static public key"));var i=v(n,a.convertToObj(e,!0),{algorithm:r.enc,apu:r.apu,apv:r.apv});return i.then((function(e){return{data:e,once:!0,direct:!0}}))},i.decrypt=function(e,t,r){if(!(r=r||{}).epk||!r.epk.x||!r.epk.y)return Promise.reject(new Error("missing ephemeral public key"));var n=a.convertToObj(r.epk,!0);if(!e||!e.d)return Promise.reject(new Error("missing static private key"));var i=v(a.convertToObj(e,!1),n,{algorithm:r.enc,apu:r.apu,apv:r.apv});return i.then((function(e){return e}))})}))},4008:(e,t,r)=>{"use strict";
58
58
  /*!
59
59
  * algorithms/ecdsa.js - Elliptic Curve Digitial Signature Algorithms
60
60
  *
61
61
  * Copyright (c) 2015 Cisco Systems, Inc. See LICENSE file.
62
- */var n=r(1762),i=r(3748),a=r(8545);function o(e){switch(e){case"SHA-256":return"P-256";case"SHA-384":return"P-384";case"SHA-512":return"P-521";default:throw new Error("unsupported hash: "+e)}}function s(e){var t,r=o(e),s=e.toLowerCase().replace("-","");return i.nodeCrypto&&i.nodeCrypto.getHashes().indexOf(s)>-1&&(t=function(e,t){if(r!==e.crv)return Promise.reject(new Error("invalid curve"));var a,o;switch(a=(a=Promise.resolve(i.nodeCrypto.createSign(s))).then((function(e){return e.update(t),e})),s.slice(-3)){case"384":o=48;break;case"512":o=66;break;default:o=32}return a=(a=a.then((function(t){return n.derToConcat(t.sign(n.convertToPEM(e,!0)),o)}))).then((function(e){return{data:t,mac:e}}))}),i.setupFallback(t,(function(t,a){if(r!==t.crv)return Promise.reject(new Error("invalid curve"));var o=n.convertToJWK(t,!1),s={name:"ECDSA",namedCurve:o.crv,hash:{name:e}};return i.subtleCrypto.importKey("jwk",o,s,!0,["sign"]).then((function(e){return i.subtleCrypto.sign(s,e,a)})).then((function(e){return e=Buffer.from(e),{data:a,mac:e}}))}),(function(t,i){if(r!==t.crv)return Promise.reject(new Error("invalid curve"));var o=n.convertToForge(t,!1);return a[e].digest(i).then((function(e){return e=o.sign(e),e=Buffer.concat([e.r,e.s]),{data:i,mac:e}}))}))}function u(e){var t,r=o(e),s=e.toLowerCase().replace("-","");return i.nodeCrypto&&i.nodeCrypto.getHashes().indexOf(s)>-1&&(t=function(e,t,a){if(r!==e.crv)return Promise.reject(new Error("invalid curve"));var o;switch(s.slice(-3)){case"384":o=48;break;case"512":o=66;break;default:o=32}return Promise.resolve(i.nodeCrypto.createVerify(s)).then((function(r){return r.update(t),r.end(),r.verify(n.convertToPEM(e,!1),n.concatToDer(a,o))})).then((function(e){if(!e)throw new Error("verification failed");return{data:t,mac:a,valid:!0}}))}),i.setupFallback(t,(function(t,a,o){if(r!==t.crv)return Promise.reject(new Error("invalid curve"));var s=n.convertToJWK(t,!0),u={name:"ECDSA",namedCurve:s.crv,hash:{name:e}};return i.subtleCrypto.importKey("jwk",s,u,!0,["verify"]).then((function(e){return i.subtleCrypto.verify(u,e,o,a)})).then((function(e){return e?{data:a,mac:o,valid:!0}:Promise.reject(new Error("verification failed"))}))}),(function(t,i,o){if(r!==t.crv)return Promise.reject(new Error("invalid curve"));var s=n.convertToForge(t,!0);return a[e].digest(i).then((function(e){var t=o.length/2,r={r:o.slice(0,t),s:o.slice(t)};return s.verify(e,r)?{data:i,mac:o,valid:!0}:Promise.reject(new Error("verification failed"))}))}))}var c={};["ES256","ES384","ES512"].forEach((function(e){var t=e.replace(/ES(\d+)/g,(function(e,t){return"SHA-"+t}));c[e]={sign:s(t),verify:u(t)}})),e.exports=c},3748:function(e,t,r){"use strict";
62
+ */var n=r(1762),i=r(3748),a=r(8545);function o(e){switch(e){case"SHA-256":return"P-256";case"SHA-384":return"P-384";case"SHA-512":return"P-521";default:throw new Error("unsupported hash: "+e)}}function s(e){var t,r=o(e),s=e.toLowerCase().replace("-","");return i.nodeCrypto&&i.nodeCrypto.getHashes().indexOf(s)>-1&&(t=function(e,t){if(r!==e.crv)return Promise.reject(new Error("invalid curve"));var a,o;switch(a=(a=Promise.resolve(i.nodeCrypto.createSign(s))).then((function(e){return e.update(t),e})),s.slice(-3)){case"384":o=48;break;case"512":o=66;break;default:o=32}return a=(a=a.then((function(t){return n.derToConcat(t.sign(n.convertToPEM(e,!0)),o)}))).then((function(e){return{data:t,mac:e}}))}),i.setupFallback(t,(function(t,a){if(r!==t.crv)return Promise.reject(new Error("invalid curve"));var o=n.convertToJWK(t,!1),s={name:"ECDSA",namedCurve:o.crv,hash:{name:e}};return i.subtleCrypto.importKey("jwk",o,s,!0,["sign"]).then((function(e){return i.subtleCrypto.sign(s,e,a)})).then((function(e){return e=Buffer.from(e),{data:a,mac:e}}))}),(function(t,i){if(r!==t.crv)return Promise.reject(new Error("invalid curve"));var o=n.convertToForge(t,!1);return a[e].digest(i).then((function(e){return e=o.sign(e),e=Buffer.concat([e.r,e.s]),{data:i,mac:e}}))}))}function u(e){var t,r=o(e),s=e.toLowerCase().replace("-","");return i.nodeCrypto&&i.nodeCrypto.getHashes().indexOf(s)>-1&&(t=function(e,t,a){if(r!==e.crv)return Promise.reject(new Error("invalid curve"));var o;switch(s.slice(-3)){case"384":o=48;break;case"512":o=66;break;default:o=32}return Promise.resolve(i.nodeCrypto.createVerify(s)).then((function(r){return r.update(t),r.end(),r.verify(n.convertToPEM(e,!1),n.concatToDer(a,o))})).then((function(e){if(!e)throw new Error("verification failed");return{data:t,mac:a,valid:!0}}))}),i.setupFallback(t,(function(t,a,o){if(r!==t.crv)return Promise.reject(new Error("invalid curve"));var s=n.convertToJWK(t,!0),u={name:"ECDSA",namedCurve:s.crv,hash:{name:e}};return i.subtleCrypto.importKey("jwk",s,u,!0,["verify"]).then((function(e){return i.subtleCrypto.verify(u,e,o,a)})).then((function(e){return e?{data:a,mac:o,valid:!0}:Promise.reject(new Error("verification failed"))}))}),(function(t,i,o){if(r!==t.crv)return Promise.reject(new Error("invalid curve"));var s=n.convertToForge(t,!0);return a[e].digest(i).then((function(e){var t=o.length/2,r={r:o.slice(0,t),s:o.slice(t)};return s.verify(e,r)?{data:i,mac:o,valid:!0}:Promise.reject(new Error("verification failed"))}))}))}var c={};["ES256","ES384","ES512"].forEach((function(e){var t=e.replace(/ES(\d+)/g,(function(e,t){return"SHA-"+t}));c[e]={sign:s(t),verify:u(t)}})),e.exports=c},3748:(e,t,r)=>{"use strict";
63
63
  /*!
64
64
  * algorithms/helpers.js - Internal functions and fields used in Cryptographic
65
65
  * Algorithms
66
66
  *
67
67
  * Copyright (c) 2015 Cisco Systems, Inc. See LICENSE file.
68
- */"undefined"==typeof Promise&&r(2702).polyfill(),t.int32ToBuffer=function(e,t){return(t=t||Buffer.alloc(4))[0]=e>>>24&255,t[1]=e>>>16&255,t[2]=e>>>8&255,t[3]=255&e,t};var n=Math.pow(2,32);t.int64ToBuffer=function(e,r){r=r||Buffer.alloc(8);var i=Math.floor(e/n),a=e%n;return i=t.int32ToBuffer(i),a=t.int32ToBuffer(a),r=Buffer.concat([i,a])};var i={};Object.defineProperty(t,"subtleCrypto",{get:function(){return"subtleCrypto"in i?i.subtleCrypto:i.subtleCrypto=function(){if("undefined"!=typeof crypto&&void 0!==crypto.subtle)return crypto.subtle}()},enumerable:!0}),Object.defineProperty(t,"nodeCrypto",{get:function(){return"nodeCrypto"in i?i.nodeCrypto:i.nodeCrypto=function(){var e;try{e=r(3906)}catch(e){return}if(Object.keys(e).length)return e}()},enumerable:!0}),t.setupFallback=function(e,r,n){return e&&t.nodeCrypto?function(){var t,r=arguments;function i(e){return 0===e.message.indexOf("unsupported algorithm:")?n.apply(null,r):Promise.reject(e)}try{t=Promise.resolve(e.apply(null,r))}catch(e){t=i(e)}return t}:r&&t.subtleCrypto?function(){var e,t=arguments;function i(e){return e.code!==DOMException.NOT_SUPPORTED_ERR&&"Only ArrayBuffer and ArrayBufferView objects can be passed as CryptoOperationData"!==e.message&&e instanceof Error?Promise.reject(e):n.apply(null,t)}try{e=(e=r.apply(null,t)).catch(i)}catch(t){e=i(t)}return e}:n}},5141:function(e,t,r){"use strict";
68
+ */"undefined"==typeof Promise&&r(2702).polyfill(),t.int32ToBuffer=function(e,t){return(t=t||Buffer.alloc(4))[0]=e>>>24&255,t[1]=e>>>16&255,t[2]=e>>>8&255,t[3]=255&e,t};var n=Math.pow(2,32);t.int64ToBuffer=function(e,r){r=r||Buffer.alloc(8);var i=Math.floor(e/n),a=e%n;return i=t.int32ToBuffer(i),a=t.int32ToBuffer(a),r=Buffer.concat([i,a])};var i={};Object.defineProperty(t,"subtleCrypto",{get:function(){return"subtleCrypto"in i?i.subtleCrypto:i.subtleCrypto=function(){if("undefined"!=typeof crypto&&void 0!==crypto.subtle)return crypto.subtle}()},enumerable:!0}),Object.defineProperty(t,"nodeCrypto",{get:function(){return"nodeCrypto"in i?i.nodeCrypto:i.nodeCrypto=function(){var e;try{e=r(3438)}catch(e){return}if(Object.keys(e).length)return e}()},enumerable:!0}),t.setupFallback=function(e,r,n){return e&&t.nodeCrypto?function(){var t,r=arguments;function i(e){return 0===e.message.indexOf("unsupported algorithm:")?n.apply(null,r):Promise.reject(e)}try{t=Promise.resolve(e.apply(null,r))}catch(e){t=i(e)}return t}:r&&t.subtleCrypto?function(){var e,t=arguments;function i(e){return e.code!==DOMException.NOT_SUPPORTED_ERR&&"Only ArrayBuffer and ArrayBufferView objects can be passed as CryptoOperationData"!==e.message&&e instanceof Error?Promise.reject(e):n.apply(null,t)}try{e=(e=r.apply(null,t)).catch(i)}catch(t){e=i(t)}return e}:n}},5141:(e,t,r)=>{"use strict";
69
69
  /*!
70
70
  * algorithms/hkdf.js - HMAC-based Extract-and-Expand Key Derivation
71
71
  *
72
72
  * Copyright (c) 2015 Cisco Systems, Inc. See LICENSE file.
73
- */var n=r(414),i=r(1733);function a(e){var t=e.replace("HKDF-",""),r=e.replace("HKDF-SHA-","HS");return function(e,a){var o=n.HASHLENGTH[t]/8;"string"==typeof r&&(r=i[r].sign);var s=(a=a||{}).salt;s&&0!==s.length||(s=Buffer.alloc(o));var u=a.info||Buffer.alloc(0),c=a.length||o,l=Math.ceil(c/o),f=[],h=0;function p(e,t){return l===h++?Buffer.concat(f).slice(0,c):(t||(t=Buffer.alloc(0)),t=Buffer.concat([t,u,Buffer.from([h])]),t=(t=r(e,t)).then((function(r){return t=r.mac,f.push(t),p(e,t)})))}return r(s,e,{length:8*s.length}).then((function(e){return p(e.mac)}))}}var o={};["HKDF-SHA-1","HKDF-SHA-256","HKDF-SHA-384","HKDF-SHA-512"].forEach((function(e){o[e]={derive:a(e)}})),e.exports=o},1733:function(e,t,r){"use strict";
73
+ */var n=r(414),i=r(1733);function a(e){var t=e.replace("HKDF-",""),r=e.replace("HKDF-SHA-","HS");return function(e,a){var o=n.HASHLENGTH[t]/8;"string"==typeof r&&(r=i[r].sign);var s=(a=a||{}).salt;s&&0!==s.length||(s=Buffer.alloc(o));var u=a.info||Buffer.alloc(0),c=a.length||o,l=Math.ceil(c/o),f=[],h=0;function p(e,t){return l===h++?Buffer.concat(f).slice(0,c):(t||(t=Buffer.alloc(0)),t=Buffer.concat([t,u,Buffer.from([h])]),t=(t=r(e,t)).then((function(r){return t=r.mac,f.push(t),p(e,t)})))}return r(s,e,{length:8*s.length}).then((function(e){return p(e.mac)}))}}var o={};["HKDF-SHA-1","HKDF-SHA-256","HKDF-SHA-384","HKDF-SHA-512"].forEach((function(e){o[e]={derive:a(e)}})),e.exports=o},1733:(e,t,r)=>{"use strict";
74
74
  /*!
75
75
  * algorithms/hmac.js - HMAC-based "signatures"
76
76
  *
77
77
  * Copyright (c) 2015 Cisco Systems, Inc. See LICENSE file.
78
- */var n=r(414),i=r(1194),a=r(4678),o=r(3748);function s(e){var t=e.replace("HS","SHA").toLowerCase(),r=e.replace("HS","SHA-");function a(e,t){return(e=(e||n.HASHLENGTH[r])/8)>t.length?Promise.reject(new Error("invalid key length")):Promise.resolve(t)}return o.setupFallback((function(e,r,n){return a((n=n||{}).length,e).then((function(){var n=o.nodeCrypto.createHmac(t,e);n.update(r);var i=n.digest();return{data:r,mac:i}}))}),(function(e,t,n){var i={name:"HMAC",hash:{name:r}};return a((n=n||{}).length,e).then((function(){return o.subtleCrypto.importKey("raw",e,i,!0,["sign"])})).then((function(e){return o.subtleCrypto.sign(i,e,t)})).then((function(e){var r=Buffer.from(e);return{data:t,mac:r}}))}),(function(e,r,n){return a((n=n||{}).length,e).then((function(){var n=i.hmac.create();return n.start(t,e.toString("binary")),n.update(r.toString("binary")),n=Buffer.from(n.digest().bytes(),"binary"),{data:r,mac:n}}))}))}function u(e){var t=e.replace("HS","SHA").toLowerCase(),r=e.replace("HS","SHA-");function s(e,t,i){e=(e||n.HASHLENGTH[r])/8;for(var a=!0,o=0;e>o;o++)a=a&&t[o]===i[o];return a}return o.setupFallback((function(e,r,n,i){i=i||{};var a=o.nodeCrypto.createHmac(t,e);a.update(r);var u=a.digest();if(!s(i.length,n,u))throw new Error("verification failed");return{data:r,mac:u,valid:!0}}),(function(e,t,n,i){var a={name:"HMAC",hash:{name:r}};return((i=i||{}).length?o.subtleCrypto.importKey("raw",e,a,!0,["sign"]).then((function(e){return o.subtleCrypto.sign(a,e,t)})).then((function(e){var t=Buffer.from(e);return s(i.length,n,t)})):o.subtleCrypto.importKey("raw",e,a,!0,["verify"]).then((function(e){return o.subtleCrypto.verify(a,e,n,t)}))).then((function(e){return e?{data:t,mac:n,valid:!0}:Promise.reject(new Error("verifaction failed"))}))}),(function(e,r,n,o){o=o||{};var u=i.hmac.create();return u.start(t,new a(e)),u.update(r.toString("binary")),u=Buffer.from(u.digest().bytes(),"binary"),s(o.length,n,u)?Promise.resolve({data:r,mac:n,valid:!0}):Promise.reject(new Error("verification failed"))}))}var c={};["HS1","HS256","HS384","HS512"].forEach((function(e){c[e]={sign:s(e),verify:u(e)}})),e.exports=c},5382:function(e,t,r){"use strict";
78
+ */var n=r(414),i=r(1194),a=r(4678),o=r(3748);function s(e){var t=e.replace("HS","SHA").toLowerCase(),r=e.replace("HS","SHA-");function a(e,t){return(e=(e||n.HASHLENGTH[r])/8)>t.length?Promise.reject(new Error("invalid key length")):Promise.resolve(t)}return o.setupFallback((function(e,r,n){return a((n=n||{}).length,e).then((function(){var n=o.nodeCrypto.createHmac(t,e);n.update(r);var i=n.digest();return{data:r,mac:i}}))}),(function(e,t,n){var i={name:"HMAC",hash:{name:r}};return a((n=n||{}).length,e).then((function(){return o.subtleCrypto.importKey("raw",e,i,!0,["sign"])})).then((function(e){return o.subtleCrypto.sign(i,e,t)})).then((function(e){var r=Buffer.from(e);return{data:t,mac:r}}))}),(function(e,r,n){return a((n=n||{}).length,e).then((function(){var n=i.hmac.create();return n.start(t,e.toString("binary")),n.update(r.toString("binary")),n=Buffer.from(n.digest().bytes(),"binary"),{data:r,mac:n}}))}))}function u(e){var t=e.replace("HS","SHA").toLowerCase(),r=e.replace("HS","SHA-");function s(e,t,i){e=(e||n.HASHLENGTH[r])/8;for(var a=!0,o=0;e>o;o++)a=a&&t[o]===i[o];return a}return o.setupFallback((function(e,r,n,i){i=i||{};var a=o.nodeCrypto.createHmac(t,e);a.update(r);var u=a.digest();if(!s(i.length,n,u))throw new Error("verification failed");return{data:r,mac:u,valid:!0}}),(function(e,t,n,i){var a={name:"HMAC",hash:{name:r}};return((i=i||{}).length?o.subtleCrypto.importKey("raw",e,a,!0,["sign"]).then((function(e){return o.subtleCrypto.sign(a,e,t)})).then((function(e){var t=Buffer.from(e);return s(i.length,n,t)})):o.subtleCrypto.importKey("raw",e,a,!0,["verify"]).then((function(e){return o.subtleCrypto.verify(a,e,n,t)}))).then((function(e){return e?{data:t,mac:n,valid:!0}:Promise.reject(new Error("verifaction failed"))}))}),(function(e,r,n,o){o=o||{};var u=i.hmac.create();return u.start(t,new a(e)),u.update(r.toString("binary")),u=Buffer.from(u.digest().bytes(),"binary"),s(o.length,n,u)?Promise.resolve({data:r,mac:n,valid:!0}):Promise.reject(new Error("verification failed"))}))}var c={};["HS1","HS256","HS384","HS512"].forEach((function(e){c[e]={sign:s(e),verify:u(e)}})),e.exports=c},5382:(e,t,r)=>{"use strict";
79
79
  /*!
80
80
  * algorithms/index.js - Cryptographic Algorithms Entry Point
81
81
  *
82
82
  * Copyright (c) 2015 Cisco Systems, Inc. See LICENSE file.
83
- */var n=[r(1379),r(2736),r(4179),r(2319),r(2274),r(3724),r(4008),r(5141),r(1733),r(152),r(3516),r(4658),r(8545)],i={},a={},o={},s={},u={},c={};n.forEach((function(e){Object.keys(e).forEach((function(t){var r=e[t];"function"==typeof r.encrypt&&(u[t]=r.encrypt),"function"==typeof r.decrypt&&(c[t]=r.decrypt),"function"==typeof r.sign&&(o[t]=r.sign),"function"==typeof r.verify&&(s[t]=r.verify),"function"==typeof r.digest&&(i[t]=r.digest),"function"==typeof r.derive&&(a[t]=r.derive)}))})),t.digest=function(e,t,r){var n=i[e];return n?n(t,r):Promise.reject(new Error("unsupported algorithm: "+e))},t.derive=function(e,t,r){var n=a[e];return n?n(t,r):Promise.reject(new Error("unsupported algorithm: "+e))},t.sign=function(e,t,r,n){var i=o[e];return i?i(t,r,n||{}):Promise.reject(new Error("unsupported algorithm: "+e))},t.verify=function(e,t,r,n,i){var a=s[e];return a?a(t,r,n,i||{}):Promise.reject(new Error("unsupported algorithm: "+e))},t.encrypt=function(e,t,r,n){var i=u[e];return i?i(t,r,n||{}):Promise.reject(new Error("unsupported algorithm: "+e))},t.decrypt=function(e,t,r,n){var i=c[e];return i?i(t,r,n||{}):Promise.reject(new Error("unsupported algorithm: "+e))}},152:function(e,t,r){"use strict";
83
+ */var n=[r(1379),r(2736),r(4179),r(2319),r(2274),r(3724),r(4008),r(5141),r(1733),r(152),r(3516),r(4658),r(8545)],i={},a={},o={},s={},u={},c={};n.forEach((function(e){Object.keys(e).forEach((function(t){var r=e[t];"function"==typeof r.encrypt&&(u[t]=r.encrypt),"function"==typeof r.decrypt&&(c[t]=r.decrypt),"function"==typeof r.sign&&(o[t]=r.sign),"function"==typeof r.verify&&(s[t]=r.verify),"function"==typeof r.digest&&(i[t]=r.digest),"function"==typeof r.derive&&(a[t]=r.derive)}))})),t.digest=function(e,t,r){var n=i[e];return n?n(t,r):Promise.reject(new Error("unsupported algorithm: "+e))},t.derive=function(e,t,r){var n=a[e];return n?n(t,r):Promise.reject(new Error("unsupported algorithm: "+e))},t.sign=function(e,t,r,n){var i=o[e];return i?i(t,r,n||{}):Promise.reject(new Error("unsupported algorithm: "+e))},t.verify=function(e,t,r,n,i){var a=s[e];return a?a(t,r,n,i||{}):Promise.reject(new Error("unsupported algorithm: "+e))},t.encrypt=function(e,t,r,n){var i=u[e];return i?i(t,r,n||{}):Promise.reject(new Error("unsupported algorithm: "+e))},t.decrypt=function(e,t,r,n){var i=c[e];return i?i(t,r,n||{}):Promise.reject(new Error("unsupported algorithm: "+e))}},152:(e,t,r)=>{"use strict";
84
84
  /*!
85
85
  * algorithms/pbes2.js - Password-Based Encryption (v2) Algorithms
86
86
  *
87
87
  * Copyright (c) 2015 Cisco Systems, Inc. See LICENSE file.
88
- */var n=r(1194),i=r(5029),a=r(4237),o=r(3748),s=r(414),u=r(4179),c=Buffer.from([0]);function l(e,t,r){var n="PBES2-"+e+"+"+t,i=[Buffer.from(n,"utf8"),c,r];return Buffer.concat(i)}function f(e){function t(e){var t=(e=e||{}).length||0,r=a.asBuffer(e.salt||Buffer.alloc(0),"base64u4l"),n=e.iterations||0;if(0>=t)throw new Error("invalid key length");if(0>=n)throw new Error("invalid iteration count");return e.length=t,e.salt=r,e.iterations=n,e}return o.setupFallback((function(r,n){if(6>o.nodeCrypto.pbkdf2.length)throw new Error("unsupported algorithm: PBKDF2-"+e);try{n=t(n)}catch(e){return Promise.reject(e)}var i=n.length,a=n.salt,s=n.iterations,u=e.replace("-","");return new Promise((function(e,t){o.nodeCrypto.pbkdf2(r,a,s,i,u,(function(r,n){r?t(r):e(n)}))}))}),(function(r,n){try{n=t(n)}catch(e){return Promise.reject(e)}var i=n.length,s=n.salt,u=n.iterations,c=Promise.resolve(r);return c=(c=(c=c.then((function(e){return o.subtleCrypto.importKey("raw",e,"PBKDF2",!1,["deriveBits"])}))).then((function(t){var r={name:"PBKDF2",salt:new Uint8Array(s),iterations:u,hash:e};return o.subtleCrypto.deriveBits(r,t,8*i)}))).then((function(e){return a.asBuffer(e)}))}),(function(r,i){try{i=t(i)}catch(e){return Promise.reject(e)}var a=i.length,o=i.salt,s=i.iterations;return new Promise((function(t,i){var u=n.md[e.replace("-","").toLowerCase()].create();n.pkcs5.pbkdf2(r.toString("binary"),o.toString("binary"),s,a,u,(function(e,r){e?i(e):(r=Buffer.from(r,"binary"),t(r))}))}))}))}function h(e,t){var r="PBKDF2-"+e.replace("HS","SHA-"),n=s.KEYLENGTH[t]/8;return function(o,s,c){c=c||{};var f=a.asBuffer(c.p2s||Buffer.alloc(0),"base64url"),h=c.p2c||8192;if(0>=h)throw new Error("invalid iteration count");if(0===f.length)f=a.randomBytes(16);else if(8>f.length)throw new Error("salt too small");var p={p2s:a.base64url.encode(f),p2c:h};f=l(e,t,f),c=i(c,{salt:f,iterations:h,length:n});var y=Promise.resolve(o);return y=(y=(y=y.then((function(e){return d[r].derive(e,c)}))).then((function(e){return u[t].encrypt(e,s)}))).then((function(e){return e.header=i(e.header||{},p),e}))}}function p(e,t){var r="PBKDF2-"+e.replace("HS","SHA-"),n=s.KEYLENGTH[t]/8;return function(o,s,c){c=c||{};var f=a.asBuffer(c.p2s||Buffer.alloc(0),"base64url"),h=c.p2c||0;if(0>=h)return Promise.reject(new Error("invalid iteration count"));if(8>f.length)return Promise.reject(new Error("salt too small"));f=l(e,t,f),c=i(c,{salt:f,iterations:h,length:n});var p=Promise.resolve(o);return p=(p=p.then((function(e){return d[r].derive(e,c)}))).then((function(e){return u[t].decrypt(e,s)}))}}var d={};["PBKDF2-SHA-256","PBKDF2-SHA-384","PBKDF2-SHA-512"].forEach((function(e){var t=e.replace("PBKDF2-","");d[e]={derive:f(t)}})),["PBES2-HS256+A128KW","PBES2-HS384+A192KW","PBES2-HS512+A256KW"].forEach((function(e){var t=/PBES2-(HS\d+)\+(A\d+KW)/g.exec(e),r=t[1],n=t[2];d[e]={encrypt:h(r,n),decrypt:p(r,n)}})),e.exports=d},8501:function(e,t,r){"use strict";
88
+ */var n=r(1194),i=r(5029),a=r(4237),o=r(3748),s=r(414),u=r(4179),c=Buffer.from([0]);function l(e,t,r){var n="PBES2-"+e+"+"+t,i=[Buffer.from(n,"utf8"),c,r];return Buffer.concat(i)}function f(e){function t(e){var t=(e=e||{}).length||0,r=a.asBuffer(e.salt||Buffer.alloc(0),"base64u4l"),n=e.iterations||0;if(0>=t)throw new Error("invalid key length");if(0>=n)throw new Error("invalid iteration count");return e.length=t,e.salt=r,e.iterations=n,e}return o.setupFallback((function(r,n){if(6>o.nodeCrypto.pbkdf2.length)throw new Error("unsupported algorithm: PBKDF2-"+e);try{n=t(n)}catch(e){return Promise.reject(e)}var i=n.length,a=n.salt,s=n.iterations,u=e.replace("-","");return new Promise((function(e,t){o.nodeCrypto.pbkdf2(r,a,s,i,u,(function(r,n){r?t(r):e(n)}))}))}),(function(r,n){try{n=t(n)}catch(e){return Promise.reject(e)}var i=n.length,s=n.salt,u=n.iterations,c=Promise.resolve(r);return c=(c=(c=c.then((function(e){return o.subtleCrypto.importKey("raw",e,"PBKDF2",!1,["deriveBits"])}))).then((function(t){var r={name:"PBKDF2",salt:new Uint8Array(s),iterations:u,hash:e};return o.subtleCrypto.deriveBits(r,t,8*i)}))).then((function(e){return a.asBuffer(e)}))}),(function(r,i){try{i=t(i)}catch(e){return Promise.reject(e)}var a=i.length,o=i.salt,s=i.iterations;return new Promise((function(t,i){var u=n.md[e.replace("-","").toLowerCase()].create();n.pkcs5.pbkdf2(r.toString("binary"),o.toString("binary"),s,a,u,(function(e,r){e?i(e):(r=Buffer.from(r,"binary"),t(r))}))}))}))}function h(e,t){var r="PBKDF2-"+e.replace("HS","SHA-"),n=s.KEYLENGTH[t]/8;return function(o,s,c){c=c||{};var f=a.asBuffer(c.p2s||Buffer.alloc(0),"base64url"),h=c.p2c||8192;if(0>=h)throw new Error("invalid iteration count");if(0===f.length)f=a.randomBytes(16);else if(8>f.length)throw new Error("salt too small");var p={p2s:a.base64url.encode(f),p2c:h};f=l(e,t,f),c=i(c,{salt:f,iterations:h,length:n});var y=Promise.resolve(o);return y=(y=(y=y.then((function(e){return d[r].derive(e,c)}))).then((function(e){return u[t].encrypt(e,s)}))).then((function(e){return e.header=i(e.header||{},p),e}))}}function p(e,t){var r="PBKDF2-"+e.replace("HS","SHA-"),n=s.KEYLENGTH[t]/8;return function(o,s,c){c=c||{};var f=a.asBuffer(c.p2s||Buffer.alloc(0),"base64url"),h=c.p2c||0;if(0>=h)return Promise.reject(new Error("invalid iteration count"));if(8>f.length)return Promise.reject(new Error("salt too small"));f=l(e,t,f),c=i(c,{salt:f,iterations:h,length:n});var p=Promise.resolve(o);return p=(p=p.then((function(e){return d[r].derive(e,c)}))).then((function(e){return u[t].decrypt(e,s)}))}}var d={};["PBKDF2-SHA-256","PBKDF2-SHA-384","PBKDF2-SHA-512"].forEach((function(e){var t=e.replace("PBKDF2-","");d[e]={derive:f(t)}})),["PBES2-HS256+A128KW","PBES2-HS384+A192KW","PBES2-HS512+A256KW"].forEach((function(e){var t=/PBES2-(HS\d+)\+(A\d+KW)/g.exec(e),r=t[1],n=t[2];d[e]={encrypt:h(r,n),decrypt:p(r,n)}})),e.exports=d},8501:(e,t,r)=>{"use strict";
89
89
  /*!
90
90
  * algorithms/rsa-util.js - RSA Utility Functions
91
91
  *
92
92
  * Copyright (c) 2015 Cisco Systems, Inc. See LICENSE file.
93
- */var n=r(6678),i=r(1194),a=r(4237);function o(e,t){var r=t?["n","e"]:["n","e","d","p","q","dp","dq","qi"];return r=r.map((function(t){return new i.jsbn.BigInteger(e[t].toString("hex"),16)})),(t?i.pki.rsa.setPublicKey:i.pki.rsa.setPrivateKey).apply(i.pki.rsa,r)}e.exports={convertToForge:o,convertToJWK:function(e,t){var r=n(e);return(t?["n","e"]:["n","e","d","p","q","dp","dq","qi"]).forEach((function(e){r[e]=a.base64url.encode(r[e])})),delete r.key_ops,delete r.use,delete r.alg,t&&(delete r.d,delete r.p,delete r.q,delete r.dp,delete r.dq,delete r.qi),r},convertToPem:function(e,t){var r,n=t?"__cachedPublicPem":"__cachedPrivatePem";return e[n]?e[n]:(r=t?i.pki.publicKeyToPem(o(e,t)):i.pki.privateKeyToPem(o(e,t)),Object.defineProperty(e,n,{value:r}),r)}}},3516:function(e,t,r){"use strict";
93
+ */var n=r(6678),i=r(1194),a=r(4237);function o(e,t){var r=t?["n","e"]:["n","e","d","p","q","dp","dq","qi"];return r=r.map((function(t){return new i.jsbn.BigInteger(e[t].toString("hex"),16)})),(t?i.pki.rsa.setPublicKey:i.pki.rsa.setPrivateKey).apply(i.pki.rsa,r)}e.exports={convertToForge:o,convertToJWK:function(e,t){var r=n(e);return(t?["n","e"]:["n","e","d","p","q","dp","dq","qi"]).forEach((function(e){r[e]=a.base64url.encode(r[e])})),delete r.key_ops,delete r.use,delete r.alg,t&&(delete r.d,delete r.p,delete r.q,delete r.dp,delete r.dq,delete r.qi),r},convertToPem:function(e,t){var r,n=t?"__cachedPublicPem":"__cachedPrivatePem";return e[n]?e[n]:(r=t?i.pki.publicKeyToPem(o(e,t)):i.pki.privateKeyToPem(o(e,t)),Object.defineProperty(e,n,{value:r}),r)}}},3516:(e,t,r)=>{"use strict";
94
94
  /*!
95
95
  * algorithms/rsaes.js - RSA Signatures
96
96
  *
97
97
  * Copyright (c) 2015 Cisco Systems, Inc. See LICENSE file.
98
- */var n=r(1194),i=r(3748),a=r(4678),o=r(8501),s={"RSA-OAEP":"RSA_PKCS1_OAEP_PADDING",RSA1_5:"RSA_PKCS1_PADDING"};function u(e){return i.nodeCrypto&&i.nodeCrypto.constants&&-1!==Object.keys(s).indexOf(e)}function c(e){var t={name:e};"RSA-OAEP-256"===e?(t.name="RSA-OAEP",t.hash={name:"SHA-256"}):"RSA-OAEP"===e?t.hash={name:"SHA-1"}:t.name="RSAES-PKCS1-v1_5";var r,c;return r="RSAES-PKCS1-v1_5"!==t.name?function(e,r){return e=o.convertToJWK(e,!0),i.subtleCrypto.importKey("jwk",e,t,!0,["encrypt"]).then((function(e){return i.subtleCrypto.encrypt(t,e,r)})).then((function(e){return{data:Buffer.from(e)}}))}:null,u(e)&&(c=function(t,r){return t=o.convertToPem(t,!0),{data:i.nodeCrypto.publicEncrypt({key:t,padding:i.nodeCrypto.constants[s[e]]},r)}}),i.setupFallback(c,r,(function(e,r){r=new a(r).bytes();var i=o.convertToForge(e,!0),s={};"RSA-OAEP"===t.name&&(s.md=t.hash.name.toLowerCase().replace(/-/g,""),s.md=n.md[s.md].create());var u=i.encrypt(r,t.name.toUpperCase(),s);return u=new a(u).native(),Promise.resolve({data:u})}))}function l(e){var t={name:e};"RSA-OAEP-256"===e?(t.name="RSA-OAEP",t.hash={name:"SHA-256"}):"RSA-OAEP"===e?t.hash={name:"SHA-1"}:t.name="RSAES-PKCS1-v1_5";var r,c;return r="RSAES-PKCS1-v1_5"!==t.name?function(e,r){return e=o.convertToJWK(e,!1),i.subtleCrypto.importKey("jwk",e,t,!0,["decrypt"]).then((function(e){return i.subtleCrypto.decrypt(t,e,r)})).then((function(e){return Buffer.from(e)}))}:null,u(e)?c=function(t,r){return t=o.convertToPem(t,!1),i.nodeCrypto.privateDecrypt({key:t,padding:i.nodeCrypto.constants[s[e]]},r)}:i.nodeCrypto&&"RSA-OAEP"===e&&(c=function(e,t){return e=o.convertToPem(e,!1),i.nodeCrypto.privateDecrypt(e,t)}),i.setupFallback(c,r,(function(e,r){r=new a(r).bytes();var i=o.convertToForge(e,!1),s={};"RSA-OAEP"===t.name&&(s.md=t.hash.name.toLowerCase().replace(/-/g,""),s.md=n.md[s.md].create());var u=i.decrypt(r,t.name.toUpperCase(),s);return u=new a(u).native(),Promise.resolve(u)}))}var f={};["RSA-OAEP","RSA-OAEP-256","RSA1_5"].forEach((function(e){f[e]={encrypt:c(e),decrypt:l(e)}})),e.exports=f},4658:function(e,t,r){"use strict";
98
+ */var n=r(1194),i=r(3748),a=r(4678),o=r(8501),s={"RSA-OAEP":"RSA_PKCS1_OAEP_PADDING",RSA1_5:"RSA_PKCS1_PADDING"};function u(e){return i.nodeCrypto&&i.nodeCrypto.constants&&-1!==Object.keys(s).indexOf(e)}function c(e){var t={name:e};"RSA-OAEP-256"===e?(t.name="RSA-OAEP",t.hash={name:"SHA-256"}):"RSA-OAEP"===e?t.hash={name:"SHA-1"}:t.name="RSAES-PKCS1-v1_5";var r,c;return r="RSAES-PKCS1-v1_5"!==t.name?function(e,r){return e=o.convertToJWK(e,!0),i.subtleCrypto.importKey("jwk",e,t,!0,["encrypt"]).then((function(e){return i.subtleCrypto.encrypt(t,e,r)})).then((function(e){return{data:Buffer.from(e)}}))}:null,u(e)&&(c=function(t,r){return t=o.convertToPem(t,!0),{data:i.nodeCrypto.publicEncrypt({key:t,padding:i.nodeCrypto.constants[s[e]]},r)}}),i.setupFallback(c,r,(function(e,r){r=new a(r).bytes();var i=o.convertToForge(e,!0),s={};"RSA-OAEP"===t.name&&(s.md=t.hash.name.toLowerCase().replace(/-/g,""),s.md=n.md[s.md].create());var u=i.encrypt(r,t.name.toUpperCase(),s);return u=new a(u).native(),Promise.resolve({data:u})}))}function l(e){var t={name:e};"RSA-OAEP-256"===e?(t.name="RSA-OAEP",t.hash={name:"SHA-256"}):"RSA-OAEP"===e?t.hash={name:"SHA-1"}:t.name="RSAES-PKCS1-v1_5";var r,c;return r="RSAES-PKCS1-v1_5"!==t.name?function(e,r){return e=o.convertToJWK(e,!1),i.subtleCrypto.importKey("jwk",e,t,!0,["decrypt"]).then((function(e){return i.subtleCrypto.decrypt(t,e,r)})).then((function(e){return Buffer.from(e)}))}:null,u(e)?c=function(t,r){return t=o.convertToPem(t,!1),i.nodeCrypto.privateDecrypt({key:t,padding:i.nodeCrypto.constants[s[e]]},r)}:i.nodeCrypto&&"RSA-OAEP"===e&&(c=function(e,t){return e=o.convertToPem(e,!1),i.nodeCrypto.privateDecrypt(e,t)}),i.setupFallback(c,r,(function(e,r){r=new a(r).bytes();var i=o.convertToForge(e,!1),s={};"RSA-OAEP"===t.name&&(s.md=t.hash.name.toLowerCase().replace(/-/g,""),s.md=n.md[s.md].create());var u=i.decrypt(r,t.name.toUpperCase(),s);return u=new a(u).native(),Promise.resolve(u)}))}var f={};["RSA-OAEP","RSA-OAEP-256","RSA1_5"].forEach((function(e){f[e]={encrypt:c(e),decrypt:l(e)}})),e.exports=f},4658:(e,t,r)=>{"use strict";
99
99
  /*!
100
100
  * algorithms/rsassa.js - RSA Signatures
101
101
  *
102
102
  * Copyright (c) 2015 Cisco Systems, Inc. See LICENSE file.
103
- */var n=r(1194),i=r(414),a=r(3748),o=r(8501);function s(){return a.nodeCrypto&&a.nodeCrypto.constants&&a.nodeCrypto.constants.RSA_PSS_SALTLEN_DIGEST}function u(e){var t,r=e.replace("RS","SHA").toLowerCase(),i=e.replace("RS","SHA-"),s={name:"RSASSA-PKCS1-V1_5",hash:{name:i}},u="RSA-"+i.replace("-","");return a.nodeCrypto&&a.nodeCrypto.getHashes().indexOf(u)>-1&&(t=function(e,t){var r=a.nodeCrypto.createSign(u);return r.update(t),{data:t,mac:r.sign(o.convertToPem(e,!1))}}),a.setupFallback(t,(function(e,t){return e=o.convertToJWK(e,!1),a.subtleCrypto.importKey("jwk",e,s,!0,["sign"]).then((function(e){return a.subtleCrypto.sign(s,e,t)})).then((function(e){var r=Buffer.from(e);return{data:t,mac:r}}))}),(function(e,t){var i=n.md[r].create();i.start(),i.update(t);var a=o.convertToForge(e,!1).sign(i,"RSASSA-PKCS1-V1_5");return a=Buffer.from(a,"binary"),Promise.resolve({data:t,mac:a})}))}function c(e){var t,r=e.replace("RS","SHA").toLowerCase(),i={name:"RSASSA-PKCS1-V1_5",hash:{name:e.replace("RS","SHA-")}};return a.nodeCrypto&&a.nodeCrypto.getHashes().indexOf(r)>-1&&(t=function(e,t,n){var i=a.nodeCrypto.createVerify(r);return i.update(t),i.end(),i.verify(o.convertToPem(e,!0),n)?{data:t,mac:n,valid:!0}:Promise.reject(new Error("verification failed"))}),a.setupFallback(t,(function(e,t,r){return e=o.convertToJWK(e,!0),a.subtleCrypto.importKey("jwk",e,i,!0,["verify"]).then((function(e){return a.subtleCrypto.verify(i,e,r,t)})).then((function(e){return e?{data:t,mac:r,valid:!0}:Promise.reject(new Error("verification failed"))}))}),(function(e,t,i){var a=n.md[r].create();a.start(),a.update(t),a=a.digest().bytes();var s=o.convertToForge(e,!0),u=i.toString("binary");return s.verify(a,u,"RSASSA-PKCS1-V1_5")?Promise.resolve({data:t,mac:i,valid:!0}):Promise.reject(new Error("verification failed"))}))}function l(e){var t,r=e.replace("PS","SHA").toLowerCase(),u=e.replace("PS","SHA-"),c={name:"RSA-PSS",hash:{name:u},saltLength:i.HASHLENGTH[u]/8},l="RSA-"+u.replace("-","");return s()&&(t=function(e,t){var r=a.nodeCrypto.createSign(l);return r.update(t),{data:t,mac:r.sign({key:o.convertToPem(e,!1),padding:a.nodeCrypto.constants.RSA_PKCS1_PSS_PADDING,saltLength:a.nodeCrypto.constants.RSA_PSS_SALTLEN_DIGEST})}}),a.setupFallback(t,(function(e,t){return e=o.convertToJWK(e,!1),a.subtleCrypto.importKey("jwk",e,c,!0,["sign"]).then((function(e){return a.subtleCrypto.sign(c,e,t)})).then((function(e){var r=Buffer.from(e);return{data:t,mac:r}}))}),(function(e,t){var a=n.md[r].create();a.start(),a.update(t);var s=n.pss.create({md:n.md[r].create(),mgf:n.mgf.mgf1.create(n.md[r].create()),saltLength:i.HASHLENGTH[u]/8}),c=o.convertToForge(e,!1).sign(a,s);return c=Buffer.from(c,"binary"),Promise.resolve({data:t,mac:c})}))}function f(e){var t,r=e.replace("PS","SHA").toLowerCase(),u=e.replace("PS","SHA-"),c={name:"RSA-PSS",hash:{name:u},saltLength:i.HASHLENGTH[u]/8};return s()&&(t=function(e,t,n){var i=a.nodeCrypto.createVerify(r);return i.update(t),i.end(),i.verify({key:o.convertToPem(e,!0),padding:a.nodeCrypto.constants.RSA_PKCS1_PSS_PADDING,saltLength:a.nodeCrypto.constants.RSA_PSS_SALTLEN_DIGEST},n)?{data:t,mac:n,valid:!0}:Promise.reject(new Error("verification failed"))}),a.setupFallback(t,(function(e,t,r){return e=o.convertToJWK(e,!0),a.subtleCrypto.importKey("jwk",e,c,!0,["verify"]).then((function(e){return a.subtleCrypto.verify(c,e,r,t)})).then((function(e){return e?{data:t,mac:r,valid:!0}:Promise.reject(new Error("verification failed"))}))}),(function(e,t,a){var s=n.md[r].create();s.start(),s.update(t),s=s.digest().bytes();var c=n.pss.create({md:n.md[r].create(),mgf:n.mgf.mgf1.create(n.md[r].create()),saltLength:i.HASHLENGTH[u]/8}),l=o.convertToForge(e,!0),f=a.toString("binary");return l.verify(s,f,c)?Promise.resolve({data:t,mac:a,valid:!0}):Promise.reject(new Error("verification failed"))}))}var h={};["PS256","PS384","PS512"].forEach((function(e){h[e]={sign:l(e),verify:f(e)}})),["RS256","RS384","RS512"].forEach((function(e){h[e]={sign:u(e),verify:c(e)}})),e.exports=h},8545:function(e,t,r){"use strict";
103
+ */var n=r(1194),i=r(414),a=r(3748),o=r(8501);function s(){return a.nodeCrypto&&a.nodeCrypto.constants&&a.nodeCrypto.constants.RSA_PSS_SALTLEN_DIGEST}function u(e){var t,r=e.replace("RS","SHA").toLowerCase(),i=e.replace("RS","SHA-"),s={name:"RSASSA-PKCS1-V1_5",hash:{name:i}},u="RSA-"+i.replace("-","");return a.nodeCrypto&&a.nodeCrypto.getHashes().indexOf(u)>-1&&(t=function(e,t){var r=a.nodeCrypto.createSign(u);return r.update(t),{data:t,mac:r.sign(o.convertToPem(e,!1))}}),a.setupFallback(t,(function(e,t){return e=o.convertToJWK(e,!1),a.subtleCrypto.importKey("jwk",e,s,!0,["sign"]).then((function(e){return a.subtleCrypto.sign(s,e,t)})).then((function(e){var r=Buffer.from(e);return{data:t,mac:r}}))}),(function(e,t){var i=n.md[r].create();i.start(),i.update(t);var a=o.convertToForge(e,!1).sign(i,"RSASSA-PKCS1-V1_5");return a=Buffer.from(a,"binary"),Promise.resolve({data:t,mac:a})}))}function c(e){var t,r=e.replace("RS","SHA").toLowerCase(),i={name:"RSASSA-PKCS1-V1_5",hash:{name:e.replace("RS","SHA-")}};return a.nodeCrypto&&a.nodeCrypto.getHashes().indexOf(r)>-1&&(t=function(e,t,n){var i=a.nodeCrypto.createVerify(r);return i.update(t),i.end(),i.verify(o.convertToPem(e,!0),n)?{data:t,mac:n,valid:!0}:Promise.reject(new Error("verification failed"))}),a.setupFallback(t,(function(e,t,r){return e=o.convertToJWK(e,!0),a.subtleCrypto.importKey("jwk",e,i,!0,["verify"]).then((function(e){return a.subtleCrypto.verify(i,e,r,t)})).then((function(e){return e?{data:t,mac:r,valid:!0}:Promise.reject(new Error("verification failed"))}))}),(function(e,t,i){var a=n.md[r].create();a.start(),a.update(t),a=a.digest().bytes();var s=o.convertToForge(e,!0),u=i.toString("binary");return s.verify(a,u,"RSASSA-PKCS1-V1_5")?Promise.resolve({data:t,mac:i,valid:!0}):Promise.reject(new Error("verification failed"))}))}function l(e){var t,r=e.replace("PS","SHA").toLowerCase(),u=e.replace("PS","SHA-"),c={name:"RSA-PSS",hash:{name:u},saltLength:i.HASHLENGTH[u]/8},l="RSA-"+u.replace("-","");return s()&&(t=function(e,t){var r=a.nodeCrypto.createSign(l);return r.update(t),{data:t,mac:r.sign({key:o.convertToPem(e,!1),padding:a.nodeCrypto.constants.RSA_PKCS1_PSS_PADDING,saltLength:a.nodeCrypto.constants.RSA_PSS_SALTLEN_DIGEST})}}),a.setupFallback(t,(function(e,t){return e=o.convertToJWK(e,!1),a.subtleCrypto.importKey("jwk",e,c,!0,["sign"]).then((function(e){return a.subtleCrypto.sign(c,e,t)})).then((function(e){var r=Buffer.from(e);return{data:t,mac:r}}))}),(function(e,t){var a=n.md[r].create();a.start(),a.update(t);var s=n.pss.create({md:n.md[r].create(),mgf:n.mgf.mgf1.create(n.md[r].create()),saltLength:i.HASHLENGTH[u]/8}),c=o.convertToForge(e,!1).sign(a,s);return c=Buffer.from(c,"binary"),Promise.resolve({data:t,mac:c})}))}function f(e){var t,r=e.replace("PS","SHA").toLowerCase(),u=e.replace("PS","SHA-"),c={name:"RSA-PSS",hash:{name:u},saltLength:i.HASHLENGTH[u]/8};return s()&&(t=function(e,t,n){var i=a.nodeCrypto.createVerify(r);return i.update(t),i.end(),i.verify({key:o.convertToPem(e,!0),padding:a.nodeCrypto.constants.RSA_PKCS1_PSS_PADDING,saltLength:a.nodeCrypto.constants.RSA_PSS_SALTLEN_DIGEST},n)?{data:t,mac:n,valid:!0}:Promise.reject(new Error("verification failed"))}),a.setupFallback(t,(function(e,t,r){return e=o.convertToJWK(e,!0),a.subtleCrypto.importKey("jwk",e,c,!0,["verify"]).then((function(e){return a.subtleCrypto.verify(c,e,r,t)})).then((function(e){return e?{data:t,mac:r,valid:!0}:Promise.reject(new Error("verification failed"))}))}),(function(e,t,a){var s=n.md[r].create();s.start(),s.update(t),s=s.digest().bytes();var c=n.pss.create({md:n.md[r].create(),mgf:n.mgf.mgf1.create(n.md[r].create()),saltLength:i.HASHLENGTH[u]/8}),l=o.convertToForge(e,!0),f=a.toString("binary");return l.verify(s,f,c)?Promise.resolve({data:t,mac:a,valid:!0}):Promise.reject(new Error("verification failed"))}))}var h={};["PS256","PS384","PS512"].forEach((function(e){h[e]={sign:l(e),verify:f(e)}})),["RS256","RS384","RS512"].forEach((function(e){h[e]={sign:u(e),verify:c(e)}})),e.exports=h},8545:(e,t,r)=>{"use strict";
104
104
  /*!
105
105
  * algorithms/sha.js - Cryptographic Secure Hash Algorithms, versions 1 and 2
106
106
  *
107
107
  * Copyright (c) 2015 Cisco Systems, Inc. See LICENSE file.
108
- */var n=r(1194),i=r(3748);var a={};["SHA-1","SHA-256","SHA-384","SHA-512"].forEach((function(e){var t,r,o;a[e]={digest:(t=e,r=t.replace("SHA-","SHA").toLowerCase(),o={name:t},i.setupFallback((function(e){var t=i.nodeCrypto.createHash(r);return t.update(e),t.digest()}),(function(e){return i.subtleCrypto.digest(o,e).then((function(e){return e=Buffer.from(e)}))}),(function(e){var t=n.md[r].create();return t.update(e.toString("binary")),t=Buffer.from(t.digest().bytes(),"binary"),Promise.resolve(t)})))}})),e.exports=a},2150:function(e,t,r){"use strict";
108
+ */var n=r(1194),i=r(3748);var a={};["SHA-1","SHA-256","SHA-384","SHA-512"].forEach((function(e){var t,r,o;a[e]={digest:(t=e,r=t.replace("SHA-","SHA").toLowerCase(),o={name:t},i.setupFallback((function(e){var t=i.nodeCrypto.createHash(r);return t.update(e),t.digest()}),(function(e){return i.subtleCrypto.digest(o,e).then((function(e){return e=Buffer.from(e)}))}),(function(e){var t=n.md[r].create();return t.update(e.toString("binary")),t=Buffer.from(t.digest().bytes(),"binary"),Promise.resolve(t)})))}})),e.exports=a},2150:(e,t,r)=>{"use strict";
109
109
  /*!
110
110
  * deps/ciphermodes/gcm/helpers.js - AES-GCM Helper Functions
111
111
  *
112
112
  * Copyright (c) 2015 Cisco Systems, Inc. See LICENSE file.
113
- */var n=r(3720),i=r(9873),a=r(3891),o=3774873600,s=new n(o>>8);var u=e.exports={E1:o,E1B:225,E1L:s,LOOKUP:function(){for(var e=[],t=0;t<256;++t){for(var r=0,n=7;n>=0;--n)0!=(t&1<<n)&&(r^=o>>>7-n);e.push(r)}return e}(),arrayCopy:function(e,t,r,n,i){if(t<0||n<0||i<0)throw new TypeError("Invalid input.");if(r instanceof Uint8Array){if(n>=r.length||n+i>r.length)throw new TypeError("Invalid input.");(0!==t||i<e.length)&&(e=e instanceof Uint8Array?e.subarray(t,t+i):e.slice(t,t+i)),r.set(e,n)}else for(var a=0;a<i;++a)r[n+a]=e[t+a]},arrayEqual:function(e,t){e=e||[],t=t||[];for(var r=Math.min(e.length,t.length),n=e.length===t.length,i=0;i<r;i++)n=n&&void 0!==e[i]&&void 0!==t[i]&&e[i]===t[i];return n},asBytes:function(e,t){switch(arguments.length){case 1:return t=Buffer.alloc(16),a.intToBigEndian(e,t,0),t;case 2:a.intToBigEndian(e,t,0);break;default:throw new TypeError("Expected 1 or 2 arguments.")}},asInts:function(e,t){switch(arguments.length){case 1:return i(t=[],0,0,4),a.bigEndianToInt(e,0,t),t;case 2:a.bigEndianToInt(e,0,t);break;default:throw new TypeError("Expected 1 or 2 arguments.")}},oneAsInts:function(){for(var e=[],t=0;t<4;++t)e.push(1<<31);return e},shiftRight:function(e,t){var r,n;switch(arguments.length){case 1:return r=e[0],e[0]=r>>>1,n=r<<31,r=e[1],e[1]=r>>>1|n,n=r<<31,r=e[2],e[2]=r>>>1|n,n=r<<31,r=e[3],e[3]=r>>>1|n,r<<31&4294967295;case 2:return r=e[0],t[0]=r>>>1,n=r<<31,r=e[1],t[1]=r>>>1|n,n=r<<31,r=e[2],t[2]=r>>>1|n,n=r<<31,r=e[3],t[3]=r>>>1|n,r<<31&4294967295;default:throw new TypeError("Expected 1 or 2 arguments.")}},shiftRightN:function(e,t,r){var n,i,a;switch(arguments.length){case 2:return i=e[0],n=32-t,e[0]=i>>>t,a=i<<n,i=e[1],e[1]=i>>>t|a,a=i<<n,i=e[2],e[2]=i>>>t|a,a=i<<n,i=e[3],e[3]=i>>>t|a,i<<n;case 3:return i=e[0],n=32-t,r[0]=i>>>t,a=i<<n,i=e[1],r[1]=i>>>t|a,a=i<<n,i=e[2],r[2]=i>>>t|a,a=i<<n,i=e[3],r[3]=i>>>t|a,i<<n;default:throw new TypeError("Expected 2 or 3 arguments.")}},xor:function(e,t,r){switch(arguments.length){case 2:e[0]^=t[0],e[1]^=t[1],e[2]^=t[2],e[3]^=t[3];break;case 3:r[0]=e[0]^t[0],r[1]=e[1]^t[1],r[2]=e[2]^t[2],r[3]=e[3]^t[3];break;default:throw new TypeError("Expected 2 or 3 arguments.")}},multiply:function(e,t){for(var r=e.slice(),n=[],i=0;i<4;++i)for(var a=t[i],o=31;o>=0;--o)0!=(a&1<<o)&&u.xor(n,r),0!==u.shiftRight(r)&&(r[0]^=u.E1);u.arrayCopy(n,0,e,0,4)},multiplyP:function(e,t){switch(arguments.length){case 1:0!==u.shiftRight(e)&&(e[0]^=u.E1);break;case 2:0!==u.shiftRight(e,t)&&(t[0]^=u.E1);break;default:throw new TypeError("Expected 1 or 2 arguments.")}},multiplyP8:function(e,t){var r;switch(arguments.length){case 1:r=u.shiftRightN(e,8),e[0]^=u.LOOKUP[r>>>24];break;case 2:r=u.shiftRightN(e,8,t),t[0]^=u.LOOKUP[r>>>24];break;default:throw new TypeError("Expected 1 or 2 arguments.")}}}},9560:function(e,t,r){"use strict";
113
+ */var n=r(3720),i=r(9873),a=r(3891),o=3774873600,s=new n(o>>8);var u=e.exports={E1:o,E1B:225,E1L:s,LOOKUP:function(){for(var e=[],t=0;t<256;++t){for(var r=0,n=7;n>=0;--n)0!=(t&1<<n)&&(r^=o>>>7-n);e.push(r)}return e}(),arrayCopy:function(e,t,r,n,i){if(t<0||n<0||i<0)throw new TypeError("Invalid input.");if(r instanceof Uint8Array){if(n>=r.length||n+i>r.length)throw new TypeError("Invalid input.");(0!==t||i<e.length)&&(e=e instanceof Uint8Array?e.subarray(t,t+i):e.slice(t,t+i)),r.set(e,n)}else for(var a=0;a<i;++a)r[n+a]=e[t+a]},arrayEqual:function(e,t){e=e||[],t=t||[];for(var r=Math.min(e.length,t.length),n=e.length===t.length,i=0;i<r;i++)n=n&&void 0!==e[i]&&void 0!==t[i]&&e[i]===t[i];return n},asBytes:function(e,t){switch(arguments.length){case 1:return t=Buffer.alloc(16),a.intToBigEndian(e,t,0),t;case 2:a.intToBigEndian(e,t,0);break;default:throw new TypeError("Expected 1 or 2 arguments.")}},asInts:function(e,t){switch(arguments.length){case 1:return i(t=[],0,0,4),a.bigEndianToInt(e,0,t),t;case 2:a.bigEndianToInt(e,0,t);break;default:throw new TypeError("Expected 1 or 2 arguments.")}},oneAsInts:function(){for(var e=[],t=0;t<4;++t)e.push(1<<31);return e},shiftRight:function(e,t){var r,n;switch(arguments.length){case 1:return r=e[0],e[0]=r>>>1,n=r<<31,r=e[1],e[1]=r>>>1|n,n=r<<31,r=e[2],e[2]=r>>>1|n,n=r<<31,r=e[3],e[3]=r>>>1|n,r<<31&4294967295;case 2:return r=e[0],t[0]=r>>>1,n=r<<31,r=e[1],t[1]=r>>>1|n,n=r<<31,r=e[2],t[2]=r>>>1|n,n=r<<31,r=e[3],t[3]=r>>>1|n,r<<31&4294967295;default:throw new TypeError("Expected 1 or 2 arguments.")}},shiftRightN:function(e,t,r){var n,i,a;switch(arguments.length){case 2:return i=e[0],n=32-t,e[0]=i>>>t,a=i<<n,i=e[1],e[1]=i>>>t|a,a=i<<n,i=e[2],e[2]=i>>>t|a,a=i<<n,i=e[3],e[3]=i>>>t|a,i<<n;case 3:return i=e[0],n=32-t,r[0]=i>>>t,a=i<<n,i=e[1],r[1]=i>>>t|a,a=i<<n,i=e[2],r[2]=i>>>t|a,a=i<<n,i=e[3],r[3]=i>>>t|a,i<<n;default:throw new TypeError("Expected 2 or 3 arguments.")}},xor:function(e,t,r){switch(arguments.length){case 2:e[0]^=t[0],e[1]^=t[1],e[2]^=t[2],e[3]^=t[3];break;case 3:r[0]=e[0]^t[0],r[1]=e[1]^t[1],r[2]=e[2]^t[2],r[3]=e[3]^t[3];break;default:throw new TypeError("Expected 2 or 3 arguments.")}},multiply:function(e,t){for(var r=e.slice(),n=[],i=0;i<4;++i)for(var a=t[i],o=31;o>=0;--o)0!=(a&1<<o)&&u.xor(n,r),0!==u.shiftRight(r)&&(r[0]^=u.E1);u.arrayCopy(n,0,e,0,4)},multiplyP:function(e,t){switch(arguments.length){case 1:0!==u.shiftRight(e)&&(e[0]^=u.E1);break;case 2:0!==u.shiftRight(e,t)&&(t[0]^=u.E1);break;default:throw new TypeError("Expected 1 or 2 arguments.")}},multiplyP8:function(e,t){var r;switch(arguments.length){case 1:r=u.shiftRightN(e,8),e[0]^=u.LOOKUP[r>>>24];break;case 2:r=u.shiftRightN(e,8,t),t[0]^=u.LOOKUP[r>>>24];break;default:throw new TypeError("Expected 1 or 2 arguments.")}}}},9560:(e,t,r)=>{"use strict";
114
114
  /*!
115
115
  * deps/ciphermodes/gcm/index.js - AES-GCM implementation Entry Point
116
116
  *
117
117
  * Copyright (c) 2015 Cisco Systems, Inc. See LICENSE file.
118
- */var n=r(3720),i=r(1194),a=r(8140),o=r(2150),s=r(3891),u=r(4678),c=r(7826);function l(e){e=e||{},this.name="GCM",this.cipher=e.cipher,this.blockSize=this.blockSize||16}e.exports={createCipher:function(e){var t=new i.aes.Algorithm("AES-GCM",l);return t.initialize({key:new u(e.key)}),t.mode.start(e),t.mode},createDecipher:function(e){var t=new i.aes.Algorithm("AES-GCM",l);return t.initialize({key:new u(e.key)}),t.mode._decrypt=!0,t.mode.start(e),t.mode}},l.prototype.start=function(e){if(this.tag=null,!("iv"in(e=e||{})))throw new Error("Gcm needs ParametersWithIV or AEADParameters");if(this.nonce=e.iv,null==this.nonce||this.nonce.length<1)throw new Error("IV must be at least 1 byte");this.tagLength=16,"tag"in e&&(this.tag=Buffer.from(e.tag));var t=this._decrypt?this.blockSize+this.tagLength:this.blockSize;this.bufBlock=Buffer.alloc(t);var r=e.multiplier;if(null==r&&(r=new a["8k"]),this.multiplier=r,this.H=this.zeroBlock(),c.encrypt(this.cipher,this.H,0,this.H,0),this.multiplier.init(this.H),this.exp=null,this.J0=this.zeroBlock(),12===this.nonce.length)this.nonce.copy(this.J0,0,0,this.nonce.length),this.J0[this.blockSize-1]=1;else{this.gHASH(this.J0,this.nonce,this.nonce.length);var i=this.zeroBlock();s.longToBigEndian(new n(this.nonce.length).multiply(8),i,8),this.gHASHBlock(this.J0,i)}this.S=this.zeroBlock(),this.SAt=this.zeroBlock(),this.SAtPre=this.zeroBlock(),this.atBlock=this.zeroBlock(),this.atBlockPos=0,this.atLength=n.ZERO,this.atLengthPre=n.ZERO,this.counter=Buffer.from(this.J0),this.bufOff=0,this.totalLength=n.ZERO,"additionalData"in e&&this.processAADBytes(e.additionalData,0,e.additionalData.length)},l.prototype.update=function(e,t,r,n,i){for(var a=0;r>0;){var o=Math.min(r,this.bufBlock.length-this.bufOff);e.copy(this.bufBlock,this.bufOff,t,t+o),r-=o,t+=o,this.bufOff+=o,this.bufOff===this.bufBlock.length&&(this.outputBlock(n,i+a),a+=this.blockSize)}return a},l.prototype.finish=function(e,t){var r=0;this._decrypt&&(r+=this.update(this.tag,0,this.tag.length,e,t)),this.totalLength.isZero()&&this.initCipher();var n=this.bufOff;if(this._decrypt){if(n<this.tagLength)throw new Error("data too short");n-=this.tagLength}n>0&&(this.gCTRPartial(this.bufBlock,0,n,e,t+r),r+=n),this.atLength=this.atLength.add(this.atBlockPos);var i=this.zeroBlock();s.longToBigEndian(this.atLength.multiply(8),i,0),s.longToBigEndian(this.totalLength.multiply(8),i,8),this.gHASHBlock(this.S,i);var a=Buffer.alloc(this.blockSize);if(c.encrypt(this.cipher,this.J0,0,a,0),this.xor(a,this.S),this._decrypt){if(!o.arrayEqual(this.tag,a))throw new Error("mac check in Gcm failed")}else this.tag=Buffer.alloc(this.tagLength),a.copy(this.tag,0,0,this.tagLength);return r},l.prototype.initCipher=function(){this.atLength.greaterThan(n.ZERO)&&(this.SAt.copy(this.SAtPre,0,0,this.blockSize),this.atLengthPre=this.atLength.add(n.ZERO)),this.atBlockPos>0&&(this.gHASHPartial(this.SAtPre,this.atBlock,0,this.atBlockPos),this.atLengthPre=this.atLengthPre.add(this.atBlockPos)),this.atLengthPre.greaterThan(n.ZERO)&&this.SAtPre.copy(this.S,0,0,this.blockSize)},l.prototype.outputBlock=function(e,t){this.totalLength.isZero()&&this.initCipher(),this.gCTRBlock(this.bufBlock,e,t),this._decrypt?(this.bufBlock.copy(this.bufBlock,0,this.blockSize,this.blockSize+this.tagLength),this.bufOff=this.tagLength):this.bufOff=0},l.prototype.processAADBytes=function(e,t,r){for(var n=0;n<r;++n)this.atBlock[this.atBlockPos]=e[t+n],++this.atBlockPos===this.blockSize&&(this.gHASHBlock(this.SAt,this.atBlock),this.atBlockPos=0,this.atLength=this.atLength.add(this.blockSize))},l.prototype.getNextCounterBlock=function(){for(var e=15;e>=12;--e){var t=this.counter[e]+1&255;if(this.counter[e]=t,0!==t)break}var r=Buffer.alloc(this.blockSize);return c.encrypt(this.cipher,this.counter,0,r,0),r},l.prototype.gCTRBlock=function(e,t,r){var n=this.getNextCounterBlock();this.xor(n,e),n.copy(t,r,0,this.blockSize),this.gHASHBlock(this.S,this._decrypt?e:n),this.totalLength=this.totalLength.add(this.blockSize)},l.prototype.gCTRPartial=function(e,t,r,n,i){var a=this.getNextCounterBlock();this.xor(a,e,t,r),a.copy(n,i,0,r),this.gHASHPartial(this.S,this._decrypt?e:a,0,r),this.totalLength=this.totalLength.add(r)},l.prototype.gHASHBlock=function(e,t){this.xor(e,t),this.multiplier.multiplyH(e)},l.prototype.gHASHPartial=function(e,t,r,n){this.xor(e,t,r,n),this.multiplier.multiplyH(e)},l.prototype.xor=function(e,t,r,n){switch(arguments.length){case 2:for(var i=15;i>=0;--i)e[i]^=t[i];break;case 4:for(;n-- >0;)e[n]^=t[r+n];break;default:throw new TypeError("Expected 2 or 4 arguments.")}return e},l.prototype.zeroBlock=function(){return Buffer.alloc(16)}},8140:function(e,t,r){"use strict";
118
+ */var n=r(3720),i=r(1194),a=r(8140),o=r(2150),s=r(3891),u=r(4678),c=r(7826);function l(e){e=e||{},this.name="GCM",this.cipher=e.cipher,this.blockSize=this.blockSize||16}e.exports={createCipher:function(e){var t=new i.aes.Algorithm("AES-GCM",l);return t.initialize({key:new u(e.key)}),t.mode.start(e),t.mode},createDecipher:function(e){var t=new i.aes.Algorithm("AES-GCM",l);return t.initialize({key:new u(e.key)}),t.mode._decrypt=!0,t.mode.start(e),t.mode}},l.prototype.start=function(e){if(this.tag=null,!("iv"in(e=e||{})))throw new Error("Gcm needs ParametersWithIV or AEADParameters");if(this.nonce=e.iv,null==this.nonce||this.nonce.length<1)throw new Error("IV must be at least 1 byte");this.tagLength=16,"tag"in e&&(this.tag=Buffer.from(e.tag));var t=this._decrypt?this.blockSize+this.tagLength:this.blockSize;this.bufBlock=Buffer.alloc(t);var r=e.multiplier;if(null==r&&(r=new a["8k"]),this.multiplier=r,this.H=this.zeroBlock(),c.encrypt(this.cipher,this.H,0,this.H,0),this.multiplier.init(this.H),this.exp=null,this.J0=this.zeroBlock(),12===this.nonce.length)this.nonce.copy(this.J0,0,0,this.nonce.length),this.J0[this.blockSize-1]=1;else{this.gHASH(this.J0,this.nonce,this.nonce.length);var i=this.zeroBlock();s.longToBigEndian(new n(this.nonce.length).multiply(8),i,8),this.gHASHBlock(this.J0,i)}this.S=this.zeroBlock(),this.SAt=this.zeroBlock(),this.SAtPre=this.zeroBlock(),this.atBlock=this.zeroBlock(),this.atBlockPos=0,this.atLength=n.ZERO,this.atLengthPre=n.ZERO,this.counter=Buffer.from(this.J0),this.bufOff=0,this.totalLength=n.ZERO,"additionalData"in e&&this.processAADBytes(e.additionalData,0,e.additionalData.length)},l.prototype.update=function(e,t,r,n,i){for(var a=0;r>0;){var o=Math.min(r,this.bufBlock.length-this.bufOff);e.copy(this.bufBlock,this.bufOff,t,t+o),r-=o,t+=o,this.bufOff+=o,this.bufOff===this.bufBlock.length&&(this.outputBlock(n,i+a),a+=this.blockSize)}return a},l.prototype.finish=function(e,t){var r=0;this._decrypt&&(r+=this.update(this.tag,0,this.tag.length,e,t)),this.totalLength.isZero()&&this.initCipher();var n=this.bufOff;if(this._decrypt){if(n<this.tagLength)throw new Error("data too short");n-=this.tagLength}n>0&&(this.gCTRPartial(this.bufBlock,0,n,e,t+r),r+=n),this.atLength=this.atLength.add(this.atBlockPos);var i=this.zeroBlock();s.longToBigEndian(this.atLength.multiply(8),i,0),s.longToBigEndian(this.totalLength.multiply(8),i,8),this.gHASHBlock(this.S,i);var a=Buffer.alloc(this.blockSize);if(c.encrypt(this.cipher,this.J0,0,a,0),this.xor(a,this.S),this._decrypt){if(!o.arrayEqual(this.tag,a))throw new Error("mac check in Gcm failed")}else this.tag=Buffer.alloc(this.tagLength),a.copy(this.tag,0,0,this.tagLength);return r},l.prototype.initCipher=function(){this.atLength.greaterThan(n.ZERO)&&(this.SAt.copy(this.SAtPre,0,0,this.blockSize),this.atLengthPre=this.atLength.add(n.ZERO)),this.atBlockPos>0&&(this.gHASHPartial(this.SAtPre,this.atBlock,0,this.atBlockPos),this.atLengthPre=this.atLengthPre.add(this.atBlockPos)),this.atLengthPre.greaterThan(n.ZERO)&&this.SAtPre.copy(this.S,0,0,this.blockSize)},l.prototype.outputBlock=function(e,t){this.totalLength.isZero()&&this.initCipher(),this.gCTRBlock(this.bufBlock,e,t),this._decrypt?(this.bufBlock.copy(this.bufBlock,0,this.blockSize,this.blockSize+this.tagLength),this.bufOff=this.tagLength):this.bufOff=0},l.prototype.processAADBytes=function(e,t,r){for(var n=0;n<r;++n)this.atBlock[this.atBlockPos]=e[t+n],++this.atBlockPos===this.blockSize&&(this.gHASHBlock(this.SAt,this.atBlock),this.atBlockPos=0,this.atLength=this.atLength.add(this.blockSize))},l.prototype.getNextCounterBlock=function(){for(var e=15;e>=12;--e){var t=this.counter[e]+1&255;if(this.counter[e]=t,0!==t)break}var r=Buffer.alloc(this.blockSize);return c.encrypt(this.cipher,this.counter,0,r,0),r},l.prototype.gCTRBlock=function(e,t,r){var n=this.getNextCounterBlock();this.xor(n,e),n.copy(t,r,0,this.blockSize),this.gHASHBlock(this.S,this._decrypt?e:n),this.totalLength=this.totalLength.add(this.blockSize)},l.prototype.gCTRPartial=function(e,t,r,n,i){var a=this.getNextCounterBlock();this.xor(a,e,t,r),a.copy(n,i,0,r),this.gHASHPartial(this.S,this._decrypt?e:a,0,r),this.totalLength=this.totalLength.add(r)},l.prototype.gHASHBlock=function(e,t){this.xor(e,t),this.multiplier.multiplyH(e)},l.prototype.gHASHPartial=function(e,t,r,n){this.xor(e,t,r,n),this.multiplier.multiplyH(e)},l.prototype.xor=function(e,t,r,n){switch(arguments.length){case 2:for(var i=15;i>=0;--i)e[i]^=t[i];break;case 4:for(;n-- >0;)e[n]^=t[r+n];break;default:throw new TypeError("Expected 2 or 4 arguments.")}return e},l.prototype.zeroBlock=function(){return Buffer.alloc(16)}},8140:(e,t,r)=>{"use strict";
119
119
  /*!
120
120
  * deps/ciphermodes/gcm/multipliers.js - AES-GCM Multipliers
121
121
  *
122
122
  * Copyright (c) 2015 Cisco Systems, Inc. See LICENSE file.
123
- */var n=r(2150),i=r(3891);function a(){this.H=[],this.M=null}a.prototype.init=function(e){var t,r,i;if(null==this.M)for(this.M=[],t=0;t<32;++t)for(this.M[t]=[],r=0;r<16;++r)for(this.M[t][r]=[],i=0;i<4;++i)this.M[t][r][i]=0;else if(n.arrayEqual(this.H,e))return;for(this.H=e.slice(),n.asInts(e,this.M[1][8]),r=4;r>=1;r>>=1)n.multiplyP(this.M[1][r+r],this.M[1][r]);for(n.multiplyP(this.M[1][1],this.M[0][8]),r=4;r>=1;r>>=1)n.multiplyP(this.M[0][r+r],this.M[0][r]);for(t=0;;){for(r=2;r<16;r+=r)for(i=1;i<r;++i)n.xor(this.M[t][r],this.M[t][i],this.M[t][r+i]);if(32==++t)return;if(t>1)for(r=8;r>0;r>>=1)n.multiplyP8(this.M[t-2][r],this.M[t][r])}},a.prototype.multiplyH=function(e){for(var t=[],r=15;r>=0;--r){var n=this.M[r+r][15&e[r]];t[0]^=n[0],t[1]^=n[1],t[2]^=n[2],t[3]^=n[3],n=this.M[r+r+1][(240&e[r])>>>4],t[0]^=n[0],t[1]^=n[1],t[2]^=n[2],t[3]^=n[3]}i.intToBigEndian(t,e,0)},e.exports={"8k":a}},7826:function(e,t,r){"use strict";
123
+ */var n=r(2150),i=r(3891);function a(){this.H=[],this.M=null}a.prototype.init=function(e){var t,r,i;if(null==this.M)for(this.M=[],t=0;t<32;++t)for(this.M[t]=[],r=0;r<16;++r)for(this.M[t][r]=[],i=0;i<4;++i)this.M[t][r][i]=0;else if(n.arrayEqual(this.H,e))return;for(this.H=e.slice(),n.asInts(e,this.M[1][8]),r=4;r>=1;r>>=1)n.multiplyP(this.M[1][r+r],this.M[1][r]);for(n.multiplyP(this.M[1][1],this.M[0][8]),r=4;r>=1;r>>=1)n.multiplyP(this.M[0][r+r],this.M[0][r]);for(t=0;;){for(r=2;r<16;r+=r)for(i=1;i<r;++i)n.xor(this.M[t][r],this.M[t][i],this.M[t][r+i]);if(32==++t)return;if(t>1)for(r=8;r>0;r>>=1)n.multiplyP8(this.M[t-2][r],this.M[t][r])}},a.prototype.multiplyH=function(e){for(var t=[],r=15;r>=0;--r){var n=this.M[r+r][15&e[r]];t[0]^=n[0],t[1]^=n[1],t[2]^=n[2],t[3]^=n[3],n=this.M[r+r+1][(240&e[r])>>>4],t[0]^=n[0],t[1]^=n[1],t[2]^=n[2],t[3]^=n[3]}i.intToBigEndian(t,e,0)},e.exports={"8k":a}},7826:(e,t,r)=>{"use strict";
124
124
  /*!
125
125
  * deps/ciphermodes/helpers.js - Cipher Helper Functions
126
126
  *
127
127
  * Copyright (c) 2015 Cisco Systems, Inc. See LICENSE file.
128
- */var n=r(3891);e.exports={encrypt:function(e,t,r,i,a){var o=new Array(4),s=new Array(4);n.bigEndianToInt(t,r,o),e.encrypt(o,s),n.intToBigEndian(s,i,a)}}},3891:function(e,t,r){"use strict";
128
+ */var n=r(3891);e.exports={encrypt:function(e,t,r,i,a){var o=new Array(4),s=new Array(4);n.bigEndianToInt(t,r,o),e.encrypt(o,s),n.intToBigEndian(s,i,a)}}},3891:(e,t,r)=>{"use strict";
129
129
  /*!
130
130
  * deps/ciphermodes/pack.js - Pack/Unpack Functions
131
131
  *
132
132
  * Copyright (c) 2015 Cisco Systems, Inc. See LICENSE file.
133
- */var n=r(3720),i=e.exports={intToBigEndian:function(e,t,r){if("number"==typeof e)switch(arguments.length){case 1:t=Buffer.alloc(4),i.intToBigEndian(e,t,0);break;case 3:t[r]=255&e>>>24,t[++r]=255&e>>>16,t[++r]=255&e>>>8,t[++r]=255&e;break;default:throw new TypeError("Expected 1 or 3 arguments.")}else switch(arguments.length){case 1:t=Buffer.alloc(4*e.length),i.intToBigEndian(e,t,0);break;case 3:for(var n=0;n<e.length;++n)i.intToBigEndian(e[n],t,r),r+=4;break;default:throw new TypeError("Expected 1 or 3 arguments.")}return t},longToBigEndian:function(e,t,r){if(Array.isArray(e))switch(arguments.length){case 1:t=Buffer.alloc(8*e.length),i.longToBigEndian(e,t,0);break;case 3:for(var n=0;n<e.length;++n)i.longToBigEndian(e[n],t,r),r+=8;break;default:throw new TypeError("Expected 1 or 3 arguments.")}else switch(arguments.length){case 1:t=Buffer.alloc(8),i.longToBigEndian(e,t,0);break;case 3:var a=e.low,o=e.high;i.intToBigEndian(o,t,r),i.intToBigEndian(a,t,r+4);break;default:throw new TypeError("Expected 1 or 3 arguments.")}return t},bigEndianToInt:function(e,t,r){switch(arguments.length){case 2:var n=e[t]<<24;return n|=(255&e[++t])<<16,n|=(255&e[++t])<<8,n|=255&e[++t];case 3:for(var a=0;a<r.length;++a)r[a]=i.bigEndianToInt(e,t),t+=4;break;default:throw new TypeError("Expected 2 or 3 arguments.")}},bigEndianToLong:function(e,t,r){switch(arguments.length){case 2:var a=i.bigEndianToInt(e,t),o=i.bigEndianToInt(e,t+4),s=new n(o,a);return s;case 3:for(var u=0;u<r.length;++u)r[u]=i.bigEndianToLong(e,t),t+=8;break;default:throw new TypeError("Expected 2 or 3 arguments.")}}}},6778:function(e,t,r){"use strict";var n=r(1194).jsbn.BigInteger,i=r(7118);function a(e,t,r,n){this.curve=e,this.g=t,this.n=r,this.h=n}function o(e){return new n(e,16)}a.prototype.getCurve=function(){return this.curve},a.prototype.getG=function(){return this.g},a.prototype.getN=function(){return this.n},a.prototype.getH=function(){return this.h};var s,u,c,l,f,h,p,d=e.exports={secp256r1:(s=o("FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF"),u=o("FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFC"),c=o("5AC635D8AA3A93E7B3EBBD55769886BC651D06B0CC53B0F63BCE3C3E27D2604B"),l=o("FFFFFFFF00000000FFFFFFFFFFFFFFFFBCE6FAADA7179E84F3B9CAC2FC632551"),f=n.ONE,h=new i.ECCurveFp(s,u,c),p=h.decodePointHex("046B17D1F2E12C4247F8BCE6E563A440F277037D812DEB33A0F4A13945D898C2964FE342E2FE1A7F9B8EE7EB4A7C0F9E162BCE33576B315ECECBB6406837BF51F5"),new a(h,p,l,f)),secp384r1:function(){var e=o("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFF0000000000000000FFFFFFFF"),t=o("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFF0000000000000000FFFFFFFC"),r=o("B3312FA7E23EE7E4988E056BE3F82D19181D9C6EFE8141120314088F5013875AC656398D8A2ED19D2A85C8EDD3EC2AEF"),s=o("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC7634D81F4372DDF581A0DB248B0A77AECEC196ACCC52973"),u=n.ONE,c=new i.ECCurveFp(e,t,r),l=c.decodePointHex("04AA87CA22BE8B05378EB1C71EF320AD746E1D3B628BA79B9859F741E082542A385502F25DBF55296C3A545E3872760AB73617DE4A96262C6F5D9E98BF9292DC29F8F41DBD289A147CE9DA3113B5F0B8C00A60B1CE1D7E819D7A431D7C90EA0E5F");return new a(c,l,s,u)}(),secp521r1:function(){var e=o("01FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"),t=o("01FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC"),r=o("0051953EB9618E1C9A1F929A21A0B68540EEA2DA725B99B315F3B8B489918EF109E156193951EC7E937B1652C0BD3BB1BF073573DF883D2C34F1EF451FD46B503F00"),s=o("01FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA51868783BF2F966B7FCC0148F709A5D03BB5C9B8899C47AEBB6FB71E91386409"),u=n.ONE,c=new i.ECCurveFp(e,t,r),l=c.decodePointHex("0400C6858E06B70404E9CD9E3ECB662395B4429C648139053FB521F828AF606B4D3DBAA14B5E77EFE75928FE1DC127A2FFA8DE3348B3C1856A429BF97E7E31C2E5BD66011839296A789A3BC0045C8A5FB42C7D1BD998F54449579B446817AFBD17273E662C97EE72995EF42640C550B9013FAD0761353C7086A272C24088BE94769FD16650");return new a(c,l,s,u)}()};d["P-256"]=d.secp256r1,d["P-384"]=d.secp384r1,d["P-521"]=d.secp521r1},1634:function(e,t,r){"use strict";var n=r(1194),i=n.jsbn.BigInteger,a=r(7118),o=r(6778);function s(e){return new i(e,16)}function u(e,t){t||(t=Math.ceil(e.bitLength()/8)),t*=2;var r=e.toString(16);for(r=r.substring(Math.max(r.length-t,0));t>r.length;)r="0"+r;return Buffer.from(r,"hex")}function c(e){return"string"==typeof e&&(e=Buffer.from(e,"binary")),s(e.toString("hex"))}function l(e){return Math.ceil(e.getN().bitLength()/8)}function f(e){var t=o[e];if(!t)throw new TypeError("unsupported named curve: "+e);return t}function h(e,t){var r=e.getN().bitLength(),n=8*t.length,i=c(t);return r<n&&(i=i.shiftRight(n-r)),i}function p(e,t,r){var n=f(e),i=n.getCurve(),o=new a.ECPointFp(i,i.fromBigInteger(t),i.fromBigInteger(r));this.curve=e,this.params=n,this.point=o;var s=l(n);this.x=u(t,s),this.y=u(r,s)}function d(e,t){var r=f(e);this.curve=e,this.params=r;var n=l(r);this.d=u(t,n)}p.prototype.isValid=function(){return this.params.curve.contains(this.point)},p.prototype.verify=function(e,t){var r=this.params.getN(),n=this.params.getG(),a=c(t.r),o=c(t.s);if(a.compareTo(i.ONE)<0||a.compareTo(r)>=0)return!1;if(o.compareTo(i.ONE)<0||a.compareTo(r)>=0)return!1;var s=h(this.params,e),u=o.modInverse(r),l=s.multiply(u).mod(r),f=a.multiply(u).mod(r),p=n.multiplyTwo(l,this.point,f).getX().toBigInteger();return(p=p.mod(r)).equals(a)},d.prototype.toPublicKey=function(){var e=c(this.d),t=this.params.getG().multiply(e);return new p(this.curve,t.getX().toBigInteger(),t.getY().toBigInteger())},d.prototype.sign=function(e){var t,r,a,o,s=l(this.params),f=this.params.getN(),p=this.params.getG(),d=h(this.params,e),y=c(this.d);do{do{do{a=c(n.random.getBytes(s))}while(a.equals(i.ZERO)||a.compareTo(f)>=0);t=p.multiply(a).getX().toBigInteger().mod(f)}while(t.equals(i.ZERO));o=y.multiply(t),o=d.add(o),r=a.modInverse(f).multiply(o).mod(f)}while(r.equals(i.ONE));var v=l(this.params);return{r:t=u(t,v),s:r=u(r,v)}},d.prototype.isValid=function(){var e=c(this.d),t=this.params.getN().subtract(i.ONE);return e.compareTo(i.ONE)>=0&&e.compareTo(t)<0},d.prototype.computeSecret=function(e){var t=c(this.d),r=e.point.multiply(t).getX().toBigInteger();return r=u(r,l(this.params))},t.generateKeyPair=function(e){var t=f(e),r=t.getN(),a=n.random.getBytes(l(t));a=c(a);var o=r.subtract(i.ONE),s=new d(e,a.mod(o).add(i.ONE)),u=s.toPublicKey();return{private:s,public:u}},t.asPublicKey=function(e,t,r){return"string"==typeof t?t=s(t):Buffer.isBuffer(t)&&(t=c(t)),"string"==typeof r?r=s(r):Buffer.isBuffer(r)&&(r=c(r)),new p(e,t,r)},t.asPrivateKey=function(e,t){return"string"==typeof t?t=s(t):Buffer.isBuffer(t)&&(t=c(t)),new d(e,t)}},7118:function(e,t,r){"use strict";var n=r(1194).jsbn.BigInteger;function i(){return new n(null)}function a(e){this.r2=i(),this.q3=i(),n.ONE.dlShiftTo(2*e.t,this.r2),this.mu=this.r2.divide(e),this.m=e}function o(e,t){this.x=t,this.p=e}function s(e,t,r,i){this.curve=e,this.x=t,this.y=r,this.z=i||n.ONE,this.zinv=null}function u(e,t,r){this.p=e,this.a=this.fromBigInteger(t),this.b=this.fromBigInteger(r),this.infinity=new s(this,null,null),this.reducer=new a(this.p)}a.prototype.convert=function(e){if(e.s<0||e.t>2*this.m.t)return e.mod(this.m);if(e.compareTo(this.m)<0)return e;var t=i();return e.copyTo(t),this.reduce(t),t},a.prototype.revert=function(e){return e},a.prototype.reduce=function(e){for(e.drShiftTo(this.m.t-1,this.r2),e.t>this.m.t+1&&(e.t=this.m.t+1,e.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);e.compareTo(this.r2)<0;)e.dAddOffset(1,this.m.t+1);for(e.subTo(this.r2,e);e.compareTo(this.m)>=0;)e.subTo(this.m,e)},a.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},a.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},o.prototype.equals=function(e){return e===this||this.p.equals(e.p)&&this.x.equals(e.x)},o.prototype.toBigInteger=function(){return this.x},o.prototype.negate=function(){return new o(this.p,this.x.negate().mod(this.p))},o.prototype.add=function(e){return new o(this.p,this.x.add(e.toBigInteger()).mod(this.p))},o.prototype.subtract=function(e){return new o(this.p,this.x.subtract(e.toBigInteger()).mod(this.p))},o.prototype.multiply=function(e){return new o(this.p,this.x.multiply(e.toBigInteger()).mod(this.p))},o.prototype.square=function(){return new o(this.p,this.x.pow(2).mod(this.p))},o.prototype.divide=function(e){return new o(this.p,this.x.multiply(e.toBigInteger().modInverse(this.p)).mod(this.p))},s.prototype.getX=function(){this.zinv||(this.zinv=this.z.modInverse(this.curve.p));var e=this.x.toBigInteger().multiply(this.zinv);return this.curve.reduce(e),this.curve.fromBigInteger(e)},s.prototype.getY=function(){this.zinv||(this.zinv=this.z.modInverse(this.curve.p));var e=this.y.toBigInteger().multiply(this.zinv);return this.curve.reduce(e),this.curve.fromBigInteger(e)},s.prototype.equals=function(e){return e===this||(this.isInfinity()?e.isInfinity():e.isInfinity()?this.isInfinity():!!e.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(e.z)).mod(this.curve.p).equals(n.ZERO)&&e.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(e.z)).mod(this.curve.p).equals(n.ZERO))},s.prototype.isInfinity=function(){return null==this.x&&null==this.y||this.z.equals(n.ZERO)&&!this.y.toBigInteger().equals(n.ZERO)},s.prototype.negate=function(){return new s(this.curve,this.x,this.y.negate(),this.z)},s.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(e.z)).mod(this.curve.p),r=e.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(e.z)).mod(this.curve.p);if(n.ZERO.equals(r))return n.ZERO.equals(t)?this.twice():this.curve.getInfinity();var i=new n("3"),a=this.x.toBigInteger(),o=this.y.toBigInteger(),u=r.pow(2),c=u.multiply(r),l=a.multiply(u),f=t.pow(2).multiply(this.z),h=f.subtract(l.shiftLeft(1)).multiply(e.z).subtract(c).multiply(r).mod(this.curve.p),p=l.multiply(i).multiply(t).subtract(o.multiply(c)).subtract(f.multiply(t)).multiply(e.z).add(t.multiply(c)).mod(this.curve.p),d=c.multiply(this.z).multiply(e.z).mod(this.curve.p);return new s(this.curve,this.curve.fromBigInteger(h),this.curve.fromBigInteger(p),d)},s.prototype.twice=function(){if(this.isInfinity())return this;if(0===this.y.toBigInteger().signum())return this.curve.getInfinity();var e=new n("3"),t=this.x.toBigInteger(),r=this.y.toBigInteger(),i=r.multiply(this.z),a=i.multiply(r).mod(this.curve.p),o=this.curve.a.toBigInteger(),u=t.pow(2).multiply(e);n.ZERO.equals(o)||(u=u.add(this.z.pow(2).multiply(o)));var c=(u=u.mod(this.curve.p)).pow(2).subtract(t.shiftLeft(3).multiply(a)).shiftLeft(1).multiply(i).mod(this.curve.p),l=u.multiply(e).multiply(t).subtract(a.shiftLeft(1)).shiftLeft(2).multiply(a).subtract(u.pow(2).multiply(u)).mod(this.curve.p),f=i.pow(2).multiply(i).shiftLeft(3).mod(this.curve.p);return new s(this.curve,this.curve.fromBigInteger(c),this.curve.fromBigInteger(l),f)},s.prototype.multiply=function(e){if(this.isInfinity())return this;if(0===e.signum())return this.curve.getInfinity();var t,r=e,i=r.multiply(new n("3")),a=this.negate(),o=this;for(t=i.bitLength()-2;t>0;--t){o=o.twice();var s=i.testBit(t);s!==r.testBit(t)&&(o=o.add(s?this:a))}return o},s.prototype.multiplyTwo=function(e,t,r){var n;n=e.bitLength()>r.bitLength()?e.bitLength()-1:r.bitLength()-1;for(var i=this.curve.getInfinity(),a=this.add(t);n>=0;)i=i.twice(),e.testBit(n)?i=r.testBit(n)?i.add(a):i.add(this):r.testBit(n)&&(i=i.add(t)),--n;return i},u.prototype.getP=function(){return this.p},u.prototype.getA=function(){return this.a},u.prototype.getB=function(){return this.b},u.prototype.equals=function(e){return e===this||this.p.equals(e.p)&&this.a.equals(e.a)&&this.b.equals(e.b)},u.prototype.contains=function(e){var t=e.getX().toBigInteger(),r=e.getY().toBigInteger(),n=this.a.toBigInteger(),i=this.b.toBigInteger(),a=this.p,o=r.pow(2).mod(a),s=t.pow(3).add(n.multiply(t)).add(i).mod(a);return o.equals(s)},u.prototype.getInfinity=function(){return this.infinity},u.prototype.fromBigInteger=function(e){return new o(this.p,e)},u.prototype.reduce=function(e){this.reducer.reduce(e)},u.prototype.decodePointHex=function(e){switch(parseInt(e.substring(0,2),16)){case 0:return this.infinity;case 2:case 3:return null;case 4:case 6:case 7:var t=(e.length-2)/2,r=e.substr(2,t),i=e.substr(t+2,t);return new s(this,this.fromBigInteger(new n(r,16)),this.fromBigInteger(new n(i,16)));default:return null}},u.prototype.encodePointHex=function(e){if(e.isInfinity())return"00";var t=e.getX().toBigInteger().toString(16),r=e.getY().toBigInteger().toString(16),n=this.getP().toString(16).length;for(n%2!=0&&n++;t.length<n;)t="0"+t;for(;r.length<n;)r="0"+r;return"04"+t+r},e.exports={ECFieldElementFp:o,ECPointFp:s,ECCurveFp:u}},1194:function(e,t,r){"use strict";
133
+ */var n=r(3720),i=e.exports={intToBigEndian:function(e,t,r){if("number"==typeof e)switch(arguments.length){case 1:t=Buffer.alloc(4),i.intToBigEndian(e,t,0);break;case 3:t[r]=255&e>>>24,t[++r]=255&e>>>16,t[++r]=255&e>>>8,t[++r]=255&e;break;default:throw new TypeError("Expected 1 or 3 arguments.")}else switch(arguments.length){case 1:t=Buffer.alloc(4*e.length),i.intToBigEndian(e,t,0);break;case 3:for(var n=0;n<e.length;++n)i.intToBigEndian(e[n],t,r),r+=4;break;default:throw new TypeError("Expected 1 or 3 arguments.")}return t},longToBigEndian:function(e,t,r){if(Array.isArray(e))switch(arguments.length){case 1:t=Buffer.alloc(8*e.length),i.longToBigEndian(e,t,0);break;case 3:for(var n=0;n<e.length;++n)i.longToBigEndian(e[n],t,r),r+=8;break;default:throw new TypeError("Expected 1 or 3 arguments.")}else switch(arguments.length){case 1:t=Buffer.alloc(8),i.longToBigEndian(e,t,0);break;case 3:var a=e.low,o=e.high;i.intToBigEndian(o,t,r),i.intToBigEndian(a,t,r+4);break;default:throw new TypeError("Expected 1 or 3 arguments.")}return t},bigEndianToInt:function(e,t,r){switch(arguments.length){case 2:var n=e[t]<<24;return n|=(255&e[++t])<<16,n|=(255&e[++t])<<8,n|=255&e[++t];case 3:for(var a=0;a<r.length;++a)r[a]=i.bigEndianToInt(e,t),t+=4;break;default:throw new TypeError("Expected 2 or 3 arguments.")}},bigEndianToLong:function(e,t,r){switch(arguments.length){case 2:var a=i.bigEndianToInt(e,t),o=i.bigEndianToInt(e,t+4),s=new n(o,a);return s;case 3:for(var u=0;u<r.length;++u)r[u]=i.bigEndianToLong(e,t),t+=8;break;default:throw new TypeError("Expected 2 or 3 arguments.")}}}},6778:(e,t,r)=>{"use strict";var n=r(1194).jsbn.BigInteger,i=r(7118);function a(e,t,r,n){this.curve=e,this.g=t,this.n=r,this.h=n}function o(e){return new n(e,16)}a.prototype.getCurve=function(){return this.curve},a.prototype.getG=function(){return this.g},a.prototype.getN=function(){return this.n},a.prototype.getH=function(){return this.h};var s,u,c,l,f,h,p,d=e.exports={secp256r1:(s=o("FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF"),u=o("FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFC"),c=o("5AC635D8AA3A93E7B3EBBD55769886BC651D06B0CC53B0F63BCE3C3E27D2604B"),l=o("FFFFFFFF00000000FFFFFFFFFFFFFFFFBCE6FAADA7179E84F3B9CAC2FC632551"),f=n.ONE,h=new i.ECCurveFp(s,u,c),p=h.decodePointHex("046B17D1F2E12C4247F8BCE6E563A440F277037D812DEB33A0F4A13945D898C2964FE342E2FE1A7F9B8EE7EB4A7C0F9E162BCE33576B315ECECBB6406837BF51F5"),new a(h,p,l,f)),secp384r1:function(){var e=o("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFF0000000000000000FFFFFFFF"),t=o("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFF0000000000000000FFFFFFFC"),r=o("B3312FA7E23EE7E4988E056BE3F82D19181D9C6EFE8141120314088F5013875AC656398D8A2ED19D2A85C8EDD3EC2AEF"),s=o("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC7634D81F4372DDF581A0DB248B0A77AECEC196ACCC52973"),u=n.ONE,c=new i.ECCurveFp(e,t,r),l=c.decodePointHex("04AA87CA22BE8B05378EB1C71EF320AD746E1D3B628BA79B9859F741E082542A385502F25DBF55296C3A545E3872760AB73617DE4A96262C6F5D9E98BF9292DC29F8F41DBD289A147CE9DA3113B5F0B8C00A60B1CE1D7E819D7A431D7C90EA0E5F");return new a(c,l,s,u)}(),secp521r1:function(){var e=o("01FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"),t=o("01FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC"),r=o("0051953EB9618E1C9A1F929A21A0B68540EEA2DA725B99B315F3B8B489918EF109E156193951EC7E937B1652C0BD3BB1BF073573DF883D2C34F1EF451FD46B503F00"),s=o("01FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA51868783BF2F966B7FCC0148F709A5D03BB5C9B8899C47AEBB6FB71E91386409"),u=n.ONE,c=new i.ECCurveFp(e,t,r),l=c.decodePointHex("0400C6858E06B70404E9CD9E3ECB662395B4429C648139053FB521F828AF606B4D3DBAA14B5E77EFE75928FE1DC127A2FFA8DE3348B3C1856A429BF97E7E31C2E5BD66011839296A789A3BC0045C8A5FB42C7D1BD998F54449579B446817AFBD17273E662C97EE72995EF42640C550B9013FAD0761353C7086A272C24088BE94769FD16650");return new a(c,l,s,u)}()};d["P-256"]=d.secp256r1,d["P-384"]=d.secp384r1,d["P-521"]=d.secp521r1},1634:(e,t,r)=>{"use strict";var n=r(1194),i=n.jsbn.BigInteger,a=r(7118),o=r(6778);function s(e){return new i(e,16)}function u(e,t){t||(t=Math.ceil(e.bitLength()/8)),t*=2;var r=e.toString(16);for(r=r.substring(Math.max(r.length-t,0));t>r.length;)r="0"+r;return Buffer.from(r,"hex")}function c(e){return"string"==typeof e&&(e=Buffer.from(e,"binary")),s(e.toString("hex"))}function l(e){return Math.ceil(e.getN().bitLength()/8)}function f(e){var t=o[e];if(!t)throw new TypeError("unsupported named curve: "+e);return t}function h(e,t){var r=e.getN().bitLength(),n=8*t.length,i=c(t);return r<n&&(i=i.shiftRight(n-r)),i}function p(e,t,r){var n=f(e),i=n.getCurve(),o=new a.ECPointFp(i,i.fromBigInteger(t),i.fromBigInteger(r));this.curve=e,this.params=n,this.point=o;var s=l(n);this.x=u(t,s),this.y=u(r,s)}function d(e,t){var r=f(e);this.curve=e,this.params=r;var n=l(r);this.d=u(t,n)}p.prototype.isValid=function(){return this.params.curve.contains(this.point)},p.prototype.verify=function(e,t){var r=this.params.getN(),n=this.params.getG(),a=c(t.r),o=c(t.s);if(a.compareTo(i.ONE)<0||a.compareTo(r)>=0)return!1;if(o.compareTo(i.ONE)<0||a.compareTo(r)>=0)return!1;var s=h(this.params,e),u=o.modInverse(r),l=s.multiply(u).mod(r),f=a.multiply(u).mod(r),p=n.multiplyTwo(l,this.point,f).getX().toBigInteger();return(p=p.mod(r)).equals(a)},d.prototype.toPublicKey=function(){var e=c(this.d),t=this.params.getG().multiply(e);return new p(this.curve,t.getX().toBigInteger(),t.getY().toBigInteger())},d.prototype.sign=function(e){var t,r,a,o,s=l(this.params),f=this.params.getN(),p=this.params.getG(),d=h(this.params,e),y=c(this.d);do{do{do{a=c(n.random.getBytes(s))}while(a.equals(i.ZERO)||a.compareTo(f)>=0);t=p.multiply(a).getX().toBigInteger().mod(f)}while(t.equals(i.ZERO));o=y.multiply(t),o=d.add(o),r=a.modInverse(f).multiply(o).mod(f)}while(r.equals(i.ONE));var v=l(this.params);return{r:t=u(t,v),s:r=u(r,v)}},d.prototype.isValid=function(){var e=c(this.d),t=this.params.getN().subtract(i.ONE);return e.compareTo(i.ONE)>=0&&e.compareTo(t)<0},d.prototype.computeSecret=function(e){var t=c(this.d),r=e.point.multiply(t).getX().toBigInteger();return r=u(r,l(this.params))},t.generateKeyPair=function(e){var t=f(e),r=t.getN(),a=n.random.getBytes(l(t));a=c(a);var o=r.subtract(i.ONE),s=new d(e,a.mod(o).add(i.ONE)),u=s.toPublicKey();return{private:s,public:u}},t.asPublicKey=function(e,t,r){return"string"==typeof t?t=s(t):Buffer.isBuffer(t)&&(t=c(t)),"string"==typeof r?r=s(r):Buffer.isBuffer(r)&&(r=c(r)),new p(e,t,r)},t.asPrivateKey=function(e,t){return"string"==typeof t?t=s(t):Buffer.isBuffer(t)&&(t=c(t)),new d(e,t)}},7118:(e,t,r)=>{"use strict";var n=r(1194).jsbn.BigInteger;function i(){return new n(null)}function a(e){this.r2=i(),this.q3=i(),n.ONE.dlShiftTo(2*e.t,this.r2),this.mu=this.r2.divide(e),this.m=e}function o(e,t){this.x=t,this.p=e}function s(e,t,r,i){this.curve=e,this.x=t,this.y=r,this.z=i||n.ONE,this.zinv=null}function u(e,t,r){this.p=e,this.a=this.fromBigInteger(t),this.b=this.fromBigInteger(r),this.infinity=new s(this,null,null),this.reducer=new a(this.p)}a.prototype.convert=function(e){if(e.s<0||e.t>2*this.m.t)return e.mod(this.m);if(e.compareTo(this.m)<0)return e;var t=i();return e.copyTo(t),this.reduce(t),t},a.prototype.revert=function(e){return e},a.prototype.reduce=function(e){for(e.drShiftTo(this.m.t-1,this.r2),e.t>this.m.t+1&&(e.t=this.m.t+1,e.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);e.compareTo(this.r2)<0;)e.dAddOffset(1,this.m.t+1);for(e.subTo(this.r2,e);e.compareTo(this.m)>=0;)e.subTo(this.m,e)},a.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},a.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},o.prototype.equals=function(e){return e===this||this.p.equals(e.p)&&this.x.equals(e.x)},o.prototype.toBigInteger=function(){return this.x},o.prototype.negate=function(){return new o(this.p,this.x.negate().mod(this.p))},o.prototype.add=function(e){return new o(this.p,this.x.add(e.toBigInteger()).mod(this.p))},o.prototype.subtract=function(e){return new o(this.p,this.x.subtract(e.toBigInteger()).mod(this.p))},o.prototype.multiply=function(e){return new o(this.p,this.x.multiply(e.toBigInteger()).mod(this.p))},o.prototype.square=function(){return new o(this.p,this.x.pow(2).mod(this.p))},o.prototype.divide=function(e){return new o(this.p,this.x.multiply(e.toBigInteger().modInverse(this.p)).mod(this.p))},s.prototype.getX=function(){this.zinv||(this.zinv=this.z.modInverse(this.curve.p));var e=this.x.toBigInteger().multiply(this.zinv);return this.curve.reduce(e),this.curve.fromBigInteger(e)},s.prototype.getY=function(){this.zinv||(this.zinv=this.z.modInverse(this.curve.p));var e=this.y.toBigInteger().multiply(this.zinv);return this.curve.reduce(e),this.curve.fromBigInteger(e)},s.prototype.equals=function(e){return e===this||(this.isInfinity()?e.isInfinity():e.isInfinity()?this.isInfinity():!!e.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(e.z)).mod(this.curve.p).equals(n.ZERO)&&e.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(e.z)).mod(this.curve.p).equals(n.ZERO))},s.prototype.isInfinity=function(){return null==this.x&&null==this.y||this.z.equals(n.ZERO)&&!this.y.toBigInteger().equals(n.ZERO)},s.prototype.negate=function(){return new s(this.curve,this.x,this.y.negate(),this.z)},s.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(e.z)).mod(this.curve.p),r=e.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(e.z)).mod(this.curve.p);if(n.ZERO.equals(r))return n.ZERO.equals(t)?this.twice():this.curve.getInfinity();var i=new n("3"),a=this.x.toBigInteger(),o=this.y.toBigInteger(),u=r.pow(2),c=u.multiply(r),l=a.multiply(u),f=t.pow(2).multiply(this.z),h=f.subtract(l.shiftLeft(1)).multiply(e.z).subtract(c).multiply(r).mod(this.curve.p),p=l.multiply(i).multiply(t).subtract(o.multiply(c)).subtract(f.multiply(t)).multiply(e.z).add(t.multiply(c)).mod(this.curve.p),d=c.multiply(this.z).multiply(e.z).mod(this.curve.p);return new s(this.curve,this.curve.fromBigInteger(h),this.curve.fromBigInteger(p),d)},s.prototype.twice=function(){if(this.isInfinity())return this;if(0===this.y.toBigInteger().signum())return this.curve.getInfinity();var e=new n("3"),t=this.x.toBigInteger(),r=this.y.toBigInteger(),i=r.multiply(this.z),a=i.multiply(r).mod(this.curve.p),o=this.curve.a.toBigInteger(),u=t.pow(2).multiply(e);n.ZERO.equals(o)||(u=u.add(this.z.pow(2).multiply(o)));var c=(u=u.mod(this.curve.p)).pow(2).subtract(t.shiftLeft(3).multiply(a)).shiftLeft(1).multiply(i).mod(this.curve.p),l=u.multiply(e).multiply(t).subtract(a.shiftLeft(1)).shiftLeft(2).multiply(a).subtract(u.pow(2).multiply(u)).mod(this.curve.p),f=i.pow(2).multiply(i).shiftLeft(3).mod(this.curve.p);return new s(this.curve,this.curve.fromBigInteger(c),this.curve.fromBigInteger(l),f)},s.prototype.multiply=function(e){if(this.isInfinity())return this;if(0===e.signum())return this.curve.getInfinity();var t,r=e,i=r.multiply(new n("3")),a=this.negate(),o=this;for(t=i.bitLength()-2;t>0;--t){o=o.twice();var s=i.testBit(t);s!==r.testBit(t)&&(o=o.add(s?this:a))}return o},s.prototype.multiplyTwo=function(e,t,r){var n;n=e.bitLength()>r.bitLength()?e.bitLength()-1:r.bitLength()-1;for(var i=this.curve.getInfinity(),a=this.add(t);n>=0;)i=i.twice(),e.testBit(n)?i=r.testBit(n)?i.add(a):i.add(this):r.testBit(n)&&(i=i.add(t)),--n;return i},u.prototype.getP=function(){return this.p},u.prototype.getA=function(){return this.a},u.prototype.getB=function(){return this.b},u.prototype.equals=function(e){return e===this||this.p.equals(e.p)&&this.a.equals(e.a)&&this.b.equals(e.b)},u.prototype.contains=function(e){var t=e.getX().toBigInteger(),r=e.getY().toBigInteger(),n=this.a.toBigInteger(),i=this.b.toBigInteger(),a=this.p,o=r.pow(2).mod(a),s=t.pow(3).add(n.multiply(t)).add(i).mod(a);return o.equals(s)},u.prototype.getInfinity=function(){return this.infinity},u.prototype.fromBigInteger=function(e){return new o(this.p,e)},u.prototype.reduce=function(e){this.reducer.reduce(e)},u.prototype.decodePointHex=function(e){switch(parseInt(e.substring(0,2),16)){case 0:return this.infinity;case 2:case 3:return null;case 4:case 6:case 7:var t=(e.length-2)/2,r=e.substr(2,t),i=e.substr(t+2,t);return new s(this,this.fromBigInteger(new n(r,16)),this.fromBigInteger(new n(i,16)));default:return null}},u.prototype.encodePointHex=function(e){if(e.isInfinity())return"00";var t=e.getX().toBigInteger().toString(16),r=e.getY().toBigInteger().toString(16),n=this.getP().toString(16).length;for(n%2!=0&&n++;t.length<n;)t="0"+t;for(;r.length<n;)r="0"+r;return"04"+t+r},e.exports={ECFieldElementFp:o,ECPointFp:s,ECCurveFp:u}},1194:(e,t,r)=>{"use strict";
134
134
  /*!
135
135
  * deps/forge.js - Forge Package Customization
136
136
  *
137
137
  * Copyright (c) 2015 Cisco Systems, Inc. See LICENSE file.
138
- */var n,i,a=r(3832);function o(e){e=e||{},this.name="",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._blocks=this.blockSize/4,this._inBlock=new Array(this._blocks),this._outBlock=new Array(this._blocks)}r(8925),r(3068),r(5649),r(6607),r(3453),r(8960),r(6953),r(8936),r(9437),r(4742),r(9654),r(4933),r(6007),r(9563),r(137),r(1668),r(3219),r(7116),o.prototype.start=function(){},o.prototype.encrypt=function(e,t,r){if(e.length()<this.blockSize&&!(r&&e.length()>0))return!0;var n;for(n=0;n<this._blocks;++n)this._inBlock[n]=e.getInt32();for(this.cipher.encrypt(this._inBlock,this._outBlock),n=0;n<this._blocks;++n)t.putInt32(this._outBlock[n])},o.prototype.decrypt=function(e,t,r){if(e.length()<this.blockSize&&!(r&&e.length()>0))return!0;var n;for(n=0;n<this._blocks;++n)this._inBlock[n]=e.getInt32();for(this.cipher.decrypt(this._inBlock,this._outBlock),n=0;n<this._blocks;++n)t.putInt32(this._outBlock[n])},i=o,n=function(){return new a.aes.Algorithm("AES",i)},a.cipher.registerAlgorithm("AES",n),e.exports=a},1217:function(e,t,r){"use strict";
138
+ */var n,i,a=r(3832);function o(e){e=e||{},this.name="",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._blocks=this.blockSize/4,this._inBlock=new Array(this._blocks),this._outBlock=new Array(this._blocks)}r(8925),r(3068),r(5649),r(6607),r(3453),r(8960),r(6953),r(8936),r(9437),r(4742),r(9654),r(4933),r(6007),r(9563),r(137),r(1668),r(3219),r(7116),o.prototype.start=function(){},o.prototype.encrypt=function(e,t,r){if(e.length()<this.blockSize&&!(r&&e.length()>0))return!0;var n;for(n=0;n<this._blocks;++n)this._inBlock[n]=e.getInt32();for(this.cipher.encrypt(this._inBlock,this._outBlock),n=0;n<this._blocks;++n)t.putInt32(this._outBlock[n])},o.prototype.decrypt=function(e,t,r){if(e.length()<this.blockSize&&!(r&&e.length()>0))return!0;var n;for(n=0;n<this._blocks;++n)this._inBlock[n]=e.getInt32();for(this.cipher.decrypt(this._inBlock,this._outBlock),n=0;n<this._blocks;++n)t.putInt32(this._outBlock[n])},i=o,n=function(){return new a.aes.Algorithm("AES",i)},a.cipher.registerAlgorithm("AES",n),e.exports=a},1217:(e,t,r)=>{"use strict";
139
139
  /*!
140
140
  * index.js - Main Entry Point
141
141
  *
142
142
  * Copyright (c) 2015 Cisco Systems, Inc. See LICENSE file.
143
- */"undefined"==typeof Promise&&r(2702).polyfill(),"undefined"==typeof Buffer&&((r.g||window).Buffer=r(8764).lW),"undefined"==typeof process&&((r.g||window).process=r(4155)),process.version||(process.version="");var n=r(2109);e.exports={JWA:r(5382),JWE:r(701),JWK:r(2543),JWS:n,util:r(4237),parse:r(8650),canYouSee:n.createVerify}},4581:function(e,t,r){"use strict";
143
+ */"undefined"==typeof Promise&&r(2702).polyfill(),"undefined"==typeof Buffer&&((r.g||window).Buffer=r(8764).lW),"undefined"==typeof process&&((r.g||window).process=r(4155)),process.version||(process.version="");var n=r(2109);e.exports={JWA:r(5382),JWE:r(701),JWK:r(2543),JWS:n,util:r(4237),parse:r(8650),canYouSee:n.createVerify}},4581:(e,t,r)=>{"use strict";
144
144
  /*!
145
145
  * jwe/decrypt.js - Decrypt from a JWE
146
146
  *
147
147
  * Copyright (c) 2015 Cisco Systems, Inc. See LICENSE file.
148
- */var n=r(9752),i=r(3171),a=r(2543),o=r(5029),s=r(9591),u={algorithms:"*"};function c(e,t){var r,c;if(a.isKey(e))c=(r=e).keystore;else{if(!a.isKeyStore(e))throw new TypeError("Keystore must be provided");c=e}t=o(u,t),Object.defineProperty(this,"decrypt",{value:function(e,u){var l=(u=o({},t,u||{})).handlers||{},f=Object.keys(l),h=new i(u.algorithms);if("string"==typeof e)e={protected:(e=e.split("."))[0],recipients:[{encrypted_key:e[1]}],iv:e[2],ciphertext:e[3],tag:e[4]};else if(!e||"object"!=typeof e)throw new Error("invalid input");"encrypted_key"in e&&(e.recipients=[{encrypted_key:e.encrypted_key}]);var p,d,y,v,g,m=e.recipients||[{}];return Promise.resolve(m).then((function(t){if(e.protected){d=n.decode(e.protected).toString("utf8");var r=(d=JSON.parse(d)).crit;if(r){if(!Array.isArray(r))return Promise.reject(new Error("Invalid 'crit' header"));for(var i=0;r.length>i;i++)if(-1===f.indexOf(r[i]))return Promise.reject(new Error("Critical extension is not supported: "+r[i]))}p=d,d=Object.keys(d)}else p={},d=[];return p=o(e.unprotected||{},p),t=t.map((function(e){var t=Promise.resolve(),r=e.header||{};return r=o(r,p),e.header=r,e.protected=d,h.match(r.alg)||(t=t.then((function(){return Promise.reject(new Error("Algorithm not allowed: "+r.alg))}))),h.match(r.enc)||(t=t.then((function(){return Promise.reject(new Error("Algorithm not allowed: "+r.enc))}))),r.epk&&(t=(t=t.then((function(){return a.asKey(r.epk)}))).then((function(e){r.epk=e.toObject(!1)}))),t.then((function(){return e}))})),Promise.all(t)})).then((function(e){var t={};return new Promise((function(i,o){var s=function(){var u=e.shift();if(u){var l=Promise.resolve(u);(l=(l=l.then((function(e){var t=g=e.encrypted_key||"";return t=n.decode(t),(y=r||c.get({use:"enc",alg:e.header.alg,kid:e.header.kid}))?y.unwrap(e.header.alg,t,e.header):Promise.reject()}))).then((function(e){v={kty:"oct",k:n.encode(e)},v=a.asKey(v),t.key=y,t.header=u.header,t.protected=u.protected,i(t)}))).catch(s)}else o(new Error("no key found"))};s()}))})).then((function(t){return t.iv=e.iv,t.tag=e.tag,t.ciphertext=e.ciphertext,t})).then((function(e){var t=[];return f.forEach((function(r){var n;"function"==typeof(r=l[r])?n=r(e):"object"==typeof r&&"function"==typeof r.prepare&&(n=r.prepare(e)),n&&t.push(Promise.resolve(n))})),Promise.all(t).then((function(){return e}))})).then((function(e){return Buffer.isBuffer(e.ciphertext)||(e.ciphertext=n.decode(e.ciphertext)),e})).then((function(t){var r=e.protected;"aad"in e&&null!=e.aad&&(r+="."+e.aad);var n={iv:t.iv,adata:r,tag:t.tag,kdata:g,epu:t.epu,epv:t.epv},i=t.ciphertext;return delete t.iv,delete t.tag,delete t.ciphertext,v.then((function(e){return e.decrypt(t.header.enc,i,n).then((function(e){return t.payload=t.plaintext=e,t}))}))})).then((function(e){return"DEF"===e.header.zip?new Promise((function(t,r){try{var n=s.inflateRaw(Buffer.from(e.plaintext));e.payload=e.plaintext=Buffer.from(n),t(e)}catch(e){r(e)}})):e})).then((function(e){var t=[];return f.forEach((function(r){var n;"object"==typeof(r=l[r])&&"function"==typeof r.complete&&(n=r.complete(e)),n&&t.push(Promise.resolve(n))})),Promise.all(t).then((function(){return e}))}))}})}e.exports={decrypter:c,createDecrypt:function(e,t){return new c(e,t)}}},4051:function(e){"use strict";
148
+ */var n=r(9752),i=r(3171),a=r(2543),o=r(5029),s=r(9591),u={algorithms:"*"};function c(e,t){var r,c;if(a.isKey(e))c=(r=e).keystore;else{if(!a.isKeyStore(e))throw new TypeError("Keystore must be provided");c=e}t=o(u,t),Object.defineProperty(this,"decrypt",{value:function(e,u){var l=(u=o({},t,u||{})).handlers||{},f=Object.keys(l),h=new i(u.algorithms);if("string"==typeof e)e={protected:(e=e.split("."))[0],recipients:[{encrypted_key:e[1]}],iv:e[2],ciphertext:e[3],tag:e[4]};else if(!e||"object"!=typeof e)throw new Error("invalid input");"encrypted_key"in e&&(e.recipients=[{encrypted_key:e.encrypted_key}]);var p,d,y,v,g,m=e.recipients||[{}];return Promise.resolve(m).then((function(t){if(e.protected){d=n.decode(e.protected).toString("utf8");var r=(d=JSON.parse(d)).crit;if(r){if(!Array.isArray(r))return Promise.reject(new Error("Invalid 'crit' header"));for(var i=0;r.length>i;i++)if(-1===f.indexOf(r[i]))return Promise.reject(new Error("Critical extension is not supported: "+r[i]))}p=d,d=Object.keys(d)}else p={},d=[];return p=o(e.unprotected||{},p),t=t.map((function(e){var t=Promise.resolve(),r=e.header||{};return r=o(r,p),e.header=r,e.protected=d,h.match(r.alg)||(t=t.then((function(){return Promise.reject(new Error("Algorithm not allowed: "+r.alg))}))),h.match(r.enc)||(t=t.then((function(){return Promise.reject(new Error("Algorithm not allowed: "+r.enc))}))),r.epk&&(t=(t=t.then((function(){return a.asKey(r.epk)}))).then((function(e){r.epk=e.toObject(!1)}))),t.then((function(){return e}))})),Promise.all(t)})).then((function(e){var t={};return new Promise((function(i,o){var s=function(){var u=e.shift();if(u){var l=Promise.resolve(u);(l=(l=l.then((function(e){var t=g=e.encrypted_key||"";return t=n.decode(t),(y=r||c.get({use:"enc",alg:e.header.alg,kid:e.header.kid}))?y.unwrap(e.header.alg,t,e.header):Promise.reject()}))).then((function(e){v={kty:"oct",k:n.encode(e)},v=a.asKey(v),t.key=y,t.header=u.header,t.protected=u.protected,i(t)}))).catch(s)}else o(new Error("no key found"))};s()}))})).then((function(t){return t.iv=e.iv,t.tag=e.tag,t.ciphertext=e.ciphertext,t})).then((function(e){var t=[];return f.forEach((function(r){var n;"function"==typeof(r=l[r])?n=r(e):"object"==typeof r&&"function"==typeof r.prepare&&(n=r.prepare(e)),n&&t.push(Promise.resolve(n))})),Promise.all(t).then((function(){return e}))})).then((function(e){return Buffer.isBuffer(e.ciphertext)||(e.ciphertext=n.decode(e.ciphertext)),e})).then((function(t){var r=e.protected;"aad"in e&&null!=e.aad&&(r+="."+e.aad);var n={iv:t.iv,adata:r,tag:t.tag,kdata:g,epu:t.epu,epv:t.epv},i=t.ciphertext;return delete t.iv,delete t.tag,delete t.ciphertext,v.then((function(e){return e.decrypt(t.header.enc,i,n).then((function(e){return t.payload=t.plaintext=e,t}))}))})).then((function(e){return"DEF"===e.header.zip?new Promise((function(t,r){try{var n=s.inflateRaw(Buffer.from(e.plaintext));e.payload=e.plaintext=Buffer.from(n),t(e)}catch(e){r(e)}})):e})).then((function(e){var t=[];return f.forEach((function(r){var n;"object"==typeof(r=l[r])&&"function"==typeof r.complete&&(n=r.complete(e)),n&&t.push(Promise.resolve(n))})),Promise.all(t).then((function(){return e}))}))}})}e.exports={decrypter:c,createDecrypt:function(e,t){return new c(e,t)}}},4051:e=>{"use strict";
149
149
  /*!
150
150
  * jwe/defaults.js - Defaults for JWEs
151
151
  *
152
152
  * Copyright (c) 2015 Cisco Systems, Inc. See LICENSE file.
153
- */e.exports={zip:!1,format:"general",contentAlg:"A128CBC-HS256",protect:"*"}},8414:function(e,t,r){"use strict";
153
+ */e.exports={zip:!1,format:"general",contentAlg:"A128CBC-HS256",protect:"*"}},8414:(e,t,r)=>{"use strict";
154
154
  /*!
155
155
  * jwe/encrypt.js - Encrypt to a JWE
156
156
  *
157
157
  * Copyright (c) 2015 Cisco Systems, Inc. See LICENSE file.
158
- */var n=r(4237),i=r(9077).generateCEK,a=r(2543),o=r(9077).slice,s=r(9591),u=r(414),c=r(8583),l=r(6678),f=r(4051);function h(e,t,r){var o=!1,f=e.format||"general",h=!!e.protectAll,p=Buffer.alloc(0);Object.defineProperty(this,"zip",{get:function(){return t.zip||""},enumerable:!0}),Object.defineProperty(this,"compact",{get:function(){return"compact"===f},enumerable:!0}),Object.defineProperty(this,"format",{get:function(){return f},enumerable:!0}),Object.defineProperty(this,"protected",{get:function(){return l(e.protect)},enumerable:!0}),Object.defineProperty(this,"header",{get:function(){return l(t)},enumerable:!0}),Object.defineProperty(this,"update",{value:function(e,t){if(o)throw new Error("already final");return null!=e&&(e=n.asBuffer(e,t),p=p.length?Buffer.concat([p,e],p.length+e.length):e),this}}),Object.defineProperty(this,"final",{value:function(d,y){if(o)return Promise.reject(new Error("already final"));this.update(d,y),o=!0;var v,g=Promise.resolve({}),m=t.enc;g=(g=g.then((function(t){return e.cek&&(v=a.asKey(e.cek)),t}))).then((function(o){var s=Promise.all(r);return s=(s=s.then((function(r){var o=1===r.length;return r=r.map((function(r){return function(r,o){var s={};s=c(s,t),s=c(s,r.header);var u,f,h=r.key,p=s.alg;return 0===(s.alg||"").indexOf("ECDH-ES")?(u=h.keystore.temp(),f=r.epk?Promise.resolve(r.epk).then((function(e){r.header.epk=e.toJSON(!1,["kid"]),s.epk=e.toObject(!0,["kid"])})):u.generate("EC",h.get("crv")).then((function(e){r.header.epk=e.toJSON(!1,["kid"]),s.epk=e.toObject(!0,["kid"])}))):f=Promise.resolve(),(f=f.then((function(){var r,n;return"dir"===p&&o?n=(v=Promise.resolve(h)).then((function(e){return m||(s.enc=t.enc=m=e.algorithms(a.MODE_ENCRYPT)[0]),{once:!0,direct:!0}})):(v||(m||(s.enc=t.enc=m=e.contentAlg),v=i(m)),n=(n=v.then((function(e){return r=e.get("k",!0),h}))).then((function(e){return e.wrap(p,r,s)}))),n}))).then((function(e){if(e.once&&!o)return Promise.reject(new Error("cannot use 'alg':'"+p+"' with multiple recipients"));var t,i={};return e.data&&(t=e.data,t=n.base64url.encode(t)),e.direct&&t?v=a.asKey({kty:"oct",k:t}):t&&(i.encrypted_key=t),r.header&&Object.keys(r.header).length&&(i.header=l(r.header||{})),e.header&&(i.header=c(i.header||{},e.header)),i}))}(r,o)})),Promise.all(r)}))).then((function(e){return o.recipients=e.filter((function(e){return!!e})),o}))}));var b={};switch(g=(g=(g=g.then((function(r){var i,a,o,s;return o=l(t),h&&1===r.recipients.length||"compact"===f?(i={},i=c({},o,r.recipients[0].header),a=Object.keys(i).length,o=void 0,s=0,delete r.recipients[0].header,0===Object.keys(r.recipients[0]).length&&r.recipients.splice(0,1)):(i={},a=0,s=Object.keys(o).length,e.protect.forEach((function(e){e in o&&(i[e]=o[e],a++,delete o[e],s--)})),r.recipients=(r.recipients||[]).map((function(e){var t=(e=e||{}).header;return t&&(Object.keys(t).forEach((function(e){e in i&&delete t[e]})),Object.keys(t).length||delete e.header),e}))),r.recipients&&0!==r.recipients.length||delete r.recipients,o&&s>0&&(b=c(b,o),r.unprotected=o),i&&a>0&&(b=c(b,i),i=JSON.stringify(i),r.protected=n.base64url.encode(i,"utf8")),r}))).then((function(e){var t=p;return b.zip?"DEF"===b.zip?new Promise((function(r,n){try{var i=s.deflateRaw(Buffer.from(t,"binary"));e.plaintext=i,r(e)}catch(e){n(e)}})):Promise.reject(new Error("unsupported 'zip' mode")):(e.plaintext=t,e)}))).then((function(t){b.adata=t.protected,"aad"in e&&null!=e.aad&&(b.adata+="."+e.aad,b.adata=Buffer.from(b.adata,"utf8"));var r=e.iv||n.randomBytes(u.NONCELENGTH[m]/8);"string"==typeof r&&(r=n.base64url.decode(r)),b.iv=r,"recipients"in t&&1===t.recipients.length&&(b.kdata=t.recipients[0].encrypted_key),"epu"in e&&null!=e.epu&&(b.epu=e.epu),"epv"in e&&null!=e.epv&&(b.epv=e.epv);var i=t.plaintext;return delete t.plaintext,v.then((function(a){var o=a.encrypt(m,i,b);return o=o.then((function(i){return t.iv=n.base64url.encode(r,"binary"),"aad"in e&&null!=e.aad&&(t.aad=e.aad),t.ciphertext=n.base64url.encode(i.data,"binary"),t.tag=n.base64url.encode(i.tag,"binary"),t}))}))})),f){case"compact":g=g.then((function(e){var t=new Array(5);return t[0]=e.protected,e.recipients&&e.recipients[0]&&(t[1]=e.recipients[0].encrypted_key),t[2]=e.iv,t[3]=e.ciphertext,t[4]=e.tag,t=t.join(".")}));break;case"flattened":g=g.then((function(e){var t={},r=e.recipients&&e.recipients[0];return e.protected&&(t.protected=e.protected),e.unprotected&&(t.unprotected=e.unprotected),["header","encrypted_key"].forEach((function(e){r&&e in r&&r[e]&&("object"!=typeof r[e]||Object.keys(r[e]).length)&&(t[e]=r[e])})),e.aad&&(t.aad=e.aad),t.iv=e.iv,t.ciphertext=e.ciphertext,t.tag=e.tag,t}));break;case"general":g=g.then((function(e){var t=e.recipients||[];return(t=(t=t.map((function(e){if(Object.keys(e).length)return e}))).filter((function(e){return!!e}))).length?e.recipients=t:delete e.recipients,e}))}return g}})}e.exports={encrypter:h,createEncrypt:function(e,t){var r=e,i=1,s=t;if(0===arguments.length)throw new Error("at least one recipient must be provided");1===arguments.length||a.isKey(e)||e&&"kty"in e||e&&"key"in e&&(a.isKey(e.key)||"kty"in e.key)?(s=e,i=0,r={}):r=l(e),Array.isArray(s)||(s=o(arguments,i)),r=c(l(f),r);var u=l(r.fields||{});switch(r.zip&&(u.zip="boolean"==typeof r.zip?!!r.zip&&"DEF":r.zip),r.format=(r.compact?"compact":r.format)||"general",r.format){case"compact":if("aad"in e)throw new Error("additional authenticated data cannot be used for compact serialization");case"flattened":if(s.length>1)throw new Error("too many recipients for compact serialization")}var p=!1;if("compact"===r.format||"*"===r.protect)p=!0,r.protect=Object.keys(u).concat("enc");else if("string"==typeof r.protect)r.protect=[r.protect];else if(Array.isArray(r.protect))r.protect=r.protect.concat();else{if(r.protect)throw new Error("protect must be a list of fields");r.protect=[]}if(p&&1<s.length)throw new Error("too many recipients to protect all header parameters");s=s.map((function(e,t){var r;return r=e&&"kty"in e?(r=a.asKey(e)).then((function(e){return{key:e}})):e?(r=a.asKey(e.key)).then((function(t){return{header:e.header,reference:e.reference,key:t}})):Promise.reject(new Error("missing key for recipient "+t)),e.epk&&(r=r.then((function(t){return a.asKey(e.epk).then((function(e){return t.epk=e,t}))}))),r=r.then((function(e){var r=e.key,n=e.header||{};e.header=n;var i={};if(i=c(i,u),(i=c(i,e.header)).alg||(i.alg=r.algorithms(a.MODE_WRAP)[0],n.alg=i.alg),!i.alg)return Promise.reject(new Error("key not valid for encrypting to recipient "+t));n.alg=i.alg;var o,s=e.reference;if(delete e.reference,void 0===s?s=(s=["kid","jku","x5c","x5t","x5u"].some((function(e){return e in n})))?null:"kid":"boolean"==typeof s&&(s=s?"kid":null),s)if(o=r.toJSON(),"jwk"===s){if("oct"===r.kty)return Promise.reject(new Error("cannot embed key"));n.jwk=o}else s in o&&(n[s]=o[s]);return e=Object.freeze(e)}))}));var d={aad:"aad"in r?n.base64url.encode(r.aad||""):null,contentAlg:r.contentAlg,format:r.format,protect:r.protect,cek:r.cek,iv:r.iv,protectAll:p},y=new h(d,u,s);return y}}},9077:function(e,t,r){"use strict";
158
+ */var n=r(4237),i=r(9077).generateCEK,a=r(2543),o=r(9077).slice,s=r(9591),u=r(414),c=r(8583),l=r(6678),f=r(4051);function h(e,t,r){var o=!1,f=e.format||"general",h=!!e.protectAll,p=Buffer.alloc(0);Object.defineProperty(this,"zip",{get:function(){return t.zip||""},enumerable:!0}),Object.defineProperty(this,"compact",{get:function(){return"compact"===f},enumerable:!0}),Object.defineProperty(this,"format",{get:function(){return f},enumerable:!0}),Object.defineProperty(this,"protected",{get:function(){return l(e.protect)},enumerable:!0}),Object.defineProperty(this,"header",{get:function(){return l(t)},enumerable:!0}),Object.defineProperty(this,"update",{value:function(e,t){if(o)throw new Error("already final");return null!=e&&(e=n.asBuffer(e,t),p=p.length?Buffer.concat([p,e],p.length+e.length):e),this}}),Object.defineProperty(this,"final",{value:function(d,y){if(o)return Promise.reject(new Error("already final"));this.update(d,y),o=!0;var v,g=Promise.resolve({}),m=t.enc;g=(g=g.then((function(t){return e.cek&&(v=a.asKey(e.cek)),t}))).then((function(o){var s=Promise.all(r);return s=(s=s.then((function(r){var o=1===r.length;return r=r.map((function(r){return function(r,o){var s={};s=c(s,t),s=c(s,r.header);var u,f,h=r.key,p=s.alg;return 0===(s.alg||"").indexOf("ECDH-ES")?(u=h.keystore.temp(),f=r.epk?Promise.resolve(r.epk).then((function(e){r.header.epk=e.toJSON(!1,["kid"]),s.epk=e.toObject(!0,["kid"])})):u.generate("EC",h.get("crv")).then((function(e){r.header.epk=e.toJSON(!1,["kid"]),s.epk=e.toObject(!0,["kid"])}))):f=Promise.resolve(),(f=f.then((function(){var r,n;return"dir"===p&&o?n=(v=Promise.resolve(h)).then((function(e){return m||(s.enc=t.enc=m=e.algorithms(a.MODE_ENCRYPT)[0]),{once:!0,direct:!0}})):(v||(m||(s.enc=t.enc=m=e.contentAlg),v=i(m)),n=(n=v.then((function(e){return r=e.get("k",!0),h}))).then((function(e){return e.wrap(p,r,s)}))),n}))).then((function(e){if(e.once&&!o)return Promise.reject(new Error("cannot use 'alg':'"+p+"' with multiple recipients"));var t,i={};return e.data&&(t=e.data,t=n.base64url.encode(t)),e.direct&&t?v=a.asKey({kty:"oct",k:t}):t&&(i.encrypted_key=t),r.header&&Object.keys(r.header).length&&(i.header=l(r.header||{})),e.header&&(i.header=c(i.header||{},e.header)),i}))}(r,o)})),Promise.all(r)}))).then((function(e){return o.recipients=e.filter((function(e){return!!e})),o}))}));var b={};switch(g=(g=(g=g.then((function(r){var i,a,o,s;return o=l(t),h&&1===r.recipients.length||"compact"===f?(i={},i=c({},o,r.recipients[0].header),a=Object.keys(i).length,o=void 0,s=0,delete r.recipients[0].header,0===Object.keys(r.recipients[0]).length&&r.recipients.splice(0,1)):(i={},a=0,s=Object.keys(o).length,e.protect.forEach((function(e){e in o&&(i[e]=o[e],a++,delete o[e],s--)})),r.recipients=(r.recipients||[]).map((function(e){var t=(e=e||{}).header;return t&&(Object.keys(t).forEach((function(e){e in i&&delete t[e]})),Object.keys(t).length||delete e.header),e}))),r.recipients&&0!==r.recipients.length||delete r.recipients,o&&s>0&&(b=c(b,o),r.unprotected=o),i&&a>0&&(b=c(b,i),i=JSON.stringify(i),r.protected=n.base64url.encode(i,"utf8")),r}))).then((function(e){var t=p;return b.zip?"DEF"===b.zip?new Promise((function(r,n){try{var i=s.deflateRaw(Buffer.from(t,"binary"));e.plaintext=i,r(e)}catch(e){n(e)}})):Promise.reject(new Error("unsupported 'zip' mode")):(e.plaintext=t,e)}))).then((function(t){b.adata=t.protected,"aad"in e&&null!=e.aad&&(b.adata+="."+e.aad,b.adata=Buffer.from(b.adata,"utf8"));var r=e.iv||n.randomBytes(u.NONCELENGTH[m]/8);"string"==typeof r&&(r=n.base64url.decode(r)),b.iv=r,"recipients"in t&&1===t.recipients.length&&(b.kdata=t.recipients[0].encrypted_key),"epu"in e&&null!=e.epu&&(b.epu=e.epu),"epv"in e&&null!=e.epv&&(b.epv=e.epv);var i=t.plaintext;return delete t.plaintext,v.then((function(a){var o=a.encrypt(m,i,b);return o=o.then((function(i){return t.iv=n.base64url.encode(r,"binary"),"aad"in e&&null!=e.aad&&(t.aad=e.aad),t.ciphertext=n.base64url.encode(i.data,"binary"),t.tag=n.base64url.encode(i.tag,"binary"),t}))}))})),f){case"compact":g=g.then((function(e){var t=new Array(5);return t[0]=e.protected,e.recipients&&e.recipients[0]&&(t[1]=e.recipients[0].encrypted_key),t[2]=e.iv,t[3]=e.ciphertext,t[4]=e.tag,t=t.join(".")}));break;case"flattened":g=g.then((function(e){var t={},r=e.recipients&&e.recipients[0];return e.protected&&(t.protected=e.protected),e.unprotected&&(t.unprotected=e.unprotected),["header","encrypted_key"].forEach((function(e){r&&e in r&&r[e]&&("object"!=typeof r[e]||Object.keys(r[e]).length)&&(t[e]=r[e])})),e.aad&&(t.aad=e.aad),t.iv=e.iv,t.ciphertext=e.ciphertext,t.tag=e.tag,t}));break;case"general":g=g.then((function(e){var t=e.recipients||[];return(t=(t=t.map((function(e){if(Object.keys(e).length)return e}))).filter((function(e){return!!e}))).length?e.recipients=t:delete e.recipients,e}))}return g}})}e.exports={encrypter:h,createEncrypt:function(e,t){var r=e,i=1,s=t;if(0===arguments.length)throw new Error("at least one recipient must be provided");1===arguments.length||a.isKey(e)||e&&"kty"in e||e&&"key"in e&&(a.isKey(e.key)||"kty"in e.key)?(s=e,i=0,r={}):r=l(e),Array.isArray(s)||(s=o(arguments,i)),r=c(l(f),r);var u=l(r.fields||{});switch(r.zip&&(u.zip="boolean"==typeof r.zip?!!r.zip&&"DEF":r.zip),r.format=(r.compact?"compact":r.format)||"general",r.format){case"compact":if("aad"in e)throw new Error("additional authenticated data cannot be used for compact serialization");case"flattened":if(s.length>1)throw new Error("too many recipients for compact serialization")}var p=!1;if("compact"===r.format||"*"===r.protect)p=!0,r.protect=Object.keys(u).concat("enc");else if("string"==typeof r.protect)r.protect=[r.protect];else if(Array.isArray(r.protect))r.protect=r.protect.concat();else{if(r.protect)throw new Error("protect must be a list of fields");r.protect=[]}if(p&&1<s.length)throw new Error("too many recipients to protect all header parameters");s=s.map((function(e,t){var r;return r=e&&"kty"in e?(r=a.asKey(e)).then((function(e){return{key:e}})):e?(r=a.asKey(e.key)).then((function(t){return{header:e.header,reference:e.reference,key:t}})):Promise.reject(new Error("missing key for recipient "+t)),e.epk&&(r=r.then((function(t){return a.asKey(e.epk).then((function(e){return t.epk=e,t}))}))),r=r.then((function(e){var r=e.key,n=e.header||{};e.header=n;var i={};if(i=c(i,u),(i=c(i,e.header)).alg||(i.alg=r.algorithms(a.MODE_WRAP)[0],n.alg=i.alg),!i.alg)return Promise.reject(new Error("key not valid for encrypting to recipient "+t));n.alg=i.alg;var o,s=e.reference;if(delete e.reference,void 0===s?s=(s=["kid","jku","x5c","x5t","x5u"].some((function(e){return e in n})))?null:"kid":"boolean"==typeof s&&(s=s?"kid":null),s)if(o=r.toJSON(),"jwk"===s){if("oct"===r.kty)return Promise.reject(new Error("cannot embed key"));n.jwk=o}else s in o&&(n[s]=o[s]);return e=Object.freeze(e)}))}));var d={aad:"aad"in r?n.base64url.encode(r.aad||""):null,contentAlg:r.contentAlg,format:r.format,protect:r.protect,cek:r.cek,iv:r.iv,protectAll:p},y=new h(d,u,s);return y}}},9077:(e,t,r)=>{"use strict";
159
159
  /*!
160
160
  * jwe/helpers.js - JWE Internal Helper Functions
161
161
  *
162
162
  * Copyright (c) 2015 Cisco Systems, Inc. See LICENSE file.
163
- */var n=r(414),i=r(2543);e.exports={slice:function(e,t){return Array.prototype.slice.call(e,t||0)},generateCEK:function(e){var t=i.createKeyStore(),r=n.KEYLENGTH[e];if(r)return t.generate("oct",r);throw new Error("unsupported encryption algorithm")}}},701:function(e,t,r){"use strict";
163
+ */var n=r(414),i=r(2543);e.exports={slice:function(e,t){return Array.prototype.slice.call(e,t||0)},generateCEK:function(e){var t=i.createKeyStore(),r=n.KEYLENGTH[e];if(r)return t.generate("oct",r);throw new Error("unsupported encryption algorithm")}}},701:(e,t,r)=>{"use strict";
164
164
  /*!
165
165
  * jwe/index.js - JSON Web Encryption (JWE) Entry Point
166
166
  *
167
167
  * Copyright (c) 2015 Cisco Systems, Inc. See LICENSE file.
168
- */var n={createEncrypt:r(8414).createEncrypt,createDecrypt:r(4581).createDecrypt};e.exports=n},7136:function(e,t,r){"use strict";
168
+ */var n={createEncrypt:r(8414).createEncrypt,createDecrypt:r(4581).createDecrypt};e.exports=n},7136:(e,t,r)=>{"use strict";
169
169
  /*!
170
170
  * jwk/basekey.js - JWK Key Base Class Implementation
171
171
  *
172
172
  * Copyright (c) 2015 Cisco Systems, Inc. See LICENSE file.
173
- */var n=r(5029),i=r(5877),a=r(8583),o=r(6678),s=r(5564),u=r(5325),c=r(7557),l=r(8718),f=r(4908),h=r(5382),p=r(6395),d=r(9684),y=r(4237);e.exports=function(e,t,r,v){if(!e)throw new Error("kty cannot be null");if(!t)throw new Error("keystore cannot be null");if(!r)throw new Error("props cannot be null");if("string"==typeof r&&(r=JSON.parse(r)),!v)throw new Error("cfg cannot be null");var g,m,b=[],E={},S={};r=o(r),g=a({},r[d.INTERNALS.THUMBPRINT_KEY]||{}),delete r[d.INTERNALS.THUMBPRINT_KEY],Object.keys(g).forEach((function(e){var t=g[e];m||(m=t,Buffer.isBuffer(m)&&(m=y.base64url.encode(m))),Buffer.isBuffer(t)||(t=y.base64url.decode(t),g[e]=t)})),r.kty=e,r.kid=r.kid||m||i();var C,w=Object.keys(d.COMMON_PROPS).map((function(e){return d.COMMON_PROPS[e].name}));S.base=l(r,w),b=b.concat(Object.keys(S.base)),S.public=o(r),E.public=v.publicKey(S.public),E.public&&(b=b.concat(Object.keys(S.public))),S.private=o(r),E.private=v.privateKey(S.private),E.private&&(b=b.concat(Object.keys(S.private))),S.extra=c(r,b),C=E.public&&"length"in E.public?E.public.length:E.private&&"length"in E.private?E.private.length:NaN,Object.defineProperty(this,"keystore",{value:t,enumerable:!0}),Object.defineProperty(this,"length",{value:C,enumerable:!0}),Object.defineProperty(this,"kty",{value:e,enumerable:!0}),Object.defineProperty(this,"kid",{value:S.base.kid,enumerable:!0}),Object.defineProperty(this,"use",{value:S.base.use||"",enumerable:!0}),Object.defineProperty(this,"alg",{value:S.base.alg||"",enumerable:!0}),Object.defineProperty(this,"thumbprint",{value:function(e){if(e=(e||d.INTERNALS.THUMBPRINT_HASH).toUpperCase(),g[e])return Promise.resolve(g[e]);var t=d.thumbprint(v,S,e);return t=t.then((function(t){return t&&(g[e]=t),t}))}}),Object.defineProperty(this,"algorithms",{value:function(t){var r=[];this.use&&"sig"!==this.use||(t&&p.MODE_SIGN!==t||r.push(p.MODE_SIGN),t&&p.MODE_VERIFY!==t||r.push(p.MODE_VERIFY)),this.use&&"enc"!==this.use||(t&&p.MODE_ENCRYPT!==t||r.push(p.MODE_ENCRYPT),t&&p.MODE_DECRYPT!==t||r.push(p.MODE_DECRYPT),t&&p.MODE_WRAP!==t||r.push(p.MODE_WRAP),t&&p.MODE_UNWRAP!==t||r.push(p.MODE_UNWRAP));var n,i=this,a=r.map((function(e){return v.algorithms.call(i,E,e)}));(a=s(a),a=f(a),this.alg)&&(n="oct"===e?[this.alg,"dir"]:[this.alg],a=u(a,n));return a}}),Object.defineProperty(this,"supports",{value:function(e,t){return-1!==this.algorithms(t).indexOf(e)}}),Object.defineProperty(this,"has",{value:function(e,t){var r=!1;return r=(r=(r=(r=r||!(!S.base||!(e in S.base)))||!(!E.public||!(e in E.public)))||!(!S.extra||!(e in S.extra)))||!!(t&&E.private&&e in E.private)}}),Object.defineProperty(this,"get",{value:function(e,t){var r;return S.base&&e in S.base?r=S.base:E.public&&e in E.public?r=E.public:S.extra&&e in S.extra?r=S.extra:t&&E.private&&e in E.private&&(r=E.private),r&&r[e]||null}}),Object.defineProperty(this,"toJSON",{value:function(e,t){Array.isArray(e)&&(t=e,e=!1);var r={};return r=n(r,S.base,S.public,"boolean"==typeof e&&e?S.private:{},S.extra),r=c(r,t||[])}}),Object.defineProperty(this,"toPEM",{value:function(e){if(null===e&&(e=!1),!v.convertToPEM)throw new Error("Unsupported key type for PEM encoding");var t=e?E.private:E.public;if(!t)throw new Error("Invalid key");return v.convertToPEM.call(this,t,e)}}),Object.defineProperty(this,"toObject",{value:function(e,t){Array.isArray(e)&&(t=e,e=!1);var r={};return r=n(r,S.base,E.public,"boolean"==typeof e&&e?E.private:{},S.extra),r=c(r,(t||[]).concat("length"))}}),Object.defineProperty(this,"sign",{value:function(e,t,r){if(-1===this.algorithms("sign").indexOf(e))return Promise.reject(new Error("unsupported algorithm"));var i=v.signKey.call(this,e,E);return i?(r=r?o(r):{},v.signProps&&(r=n(r,v.signProps.call(this,e,r))),h.sign(e,i,t,r)):Promise.reject(new Error("improper key"))}}),Object.defineProperty(this,"verify",{value:function(e,t,r,i){if(-1===this.algorithms("verify").indexOf(e))return Promise.reject(new Error("unsupported algorithm"));var a=v.verifyKey.call(this,e,E);return a?(i=i?o(i):{},v.verifyProps&&(i=n(i,v.verifyProps.call(this,e,i))),h.verify(e,a,t,r,i)):Promise.reject(new Error("improper key"))}}),Object.defineProperty(this,"encrypt",{value:function(e,t,r){if(-1===this.algorithms("encrypt").indexOf(e))return Promise.reject(new Error("unsupported algorithm"));var i=v.encryptKey.call(this,e,E);return i?(r=r?o(r):{},v.encryptProps&&(r=n(r,v.encryptProps.call(this,e,r))),h.encrypt(e,i,t,r)):Promise.reject(new Error("improper key"))}}),Object.defineProperty(this,"decrypt",{value:function(e,t,r){if(-1===this.algorithms("decrypt").indexOf(e))return Promise.reject(new Error("unsupported algorithm"));var i=v.decryptKey.call(this,e,E);return i?(r=r?o(r):{},v.decryptProps&&(r=n(r,v.decryptProps.call(this,e,r))),h.decrypt(e,i,t,r)):Promise.reject(new Error("improper key"))}}),Object.defineProperty(this,"wrap",{value:function(e,t,r){if(-1===this.algorithms("wrap").indexOf(e))return Promise.reject(new Error("unsupported algorithm"));var i=v.wrapKey.call(this,e,E);return i?(r=r?o(r):{},v.wrapProps&&(r=n(r,v.wrapProps.call(this,e,r))),h.encrypt(e,i,t,r)):Promise.reject(new Error("improper key"))}}),Object.defineProperty(this,"unwrap",{value:function(e,t,r){if(-1===this.algorithms("unwrap").indexOf(e))return Promise.reject(new Error("unsupported algorithm"));var i=v.unwrapKey.call(this,e,E);return i?(r=r?o(r):{},v.unwrapProps&&(r=n(r,v.unwrapProps.call(this,e,r))),h.decrypt(e,i,t,r)):Promise.reject(new Error("improper key"))}})}},6395:function(e){"use strict";
173
+ */var n=r(5029),i=r(5877),a=r(8583),o=r(6678),s=r(5564),u=r(5325),c=r(7557),l=r(8718),f=r(4908),h=r(5382),p=r(6395),d=r(9684),y=r(4237);e.exports=function(e,t,r,v){if(!e)throw new Error("kty cannot be null");if(!t)throw new Error("keystore cannot be null");if(!r)throw new Error("props cannot be null");if("string"==typeof r&&(r=JSON.parse(r)),!v)throw new Error("cfg cannot be null");var g,m,b=[],E={},S={};r=o(r),g=a({},r[d.INTERNALS.THUMBPRINT_KEY]||{}),delete r[d.INTERNALS.THUMBPRINT_KEY],Object.keys(g).forEach((function(e){var t=g[e];m||(m=t,Buffer.isBuffer(m)&&(m=y.base64url.encode(m))),Buffer.isBuffer(t)||(t=y.base64url.decode(t),g[e]=t)})),r.kty=e,r.kid=r.kid||m||i();var C,w=Object.keys(d.COMMON_PROPS).map((function(e){return d.COMMON_PROPS[e].name}));S.base=l(r,w),b=b.concat(Object.keys(S.base)),S.public=o(r),E.public=v.publicKey(S.public),E.public&&(b=b.concat(Object.keys(S.public))),S.private=o(r),E.private=v.privateKey(S.private),E.private&&(b=b.concat(Object.keys(S.private))),S.extra=c(r,b),C=E.public&&"length"in E.public?E.public.length:E.private&&"length"in E.private?E.private.length:NaN,Object.defineProperty(this,"keystore",{value:t,enumerable:!0}),Object.defineProperty(this,"length",{value:C,enumerable:!0}),Object.defineProperty(this,"kty",{value:e,enumerable:!0}),Object.defineProperty(this,"kid",{value:S.base.kid,enumerable:!0}),Object.defineProperty(this,"use",{value:S.base.use||"",enumerable:!0}),Object.defineProperty(this,"alg",{value:S.base.alg||"",enumerable:!0}),Object.defineProperty(this,"thumbprint",{value:function(e){if(e=(e||d.INTERNALS.THUMBPRINT_HASH).toUpperCase(),g[e])return Promise.resolve(g[e]);var t=d.thumbprint(v,S,e);return t=t.then((function(t){return t&&(g[e]=t),t}))}}),Object.defineProperty(this,"algorithms",{value:function(t){var r=[];this.use&&"sig"!==this.use||(t&&p.MODE_SIGN!==t||r.push(p.MODE_SIGN),t&&p.MODE_VERIFY!==t||r.push(p.MODE_VERIFY)),this.use&&"enc"!==this.use||(t&&p.MODE_ENCRYPT!==t||r.push(p.MODE_ENCRYPT),t&&p.MODE_DECRYPT!==t||r.push(p.MODE_DECRYPT),t&&p.MODE_WRAP!==t||r.push(p.MODE_WRAP),t&&p.MODE_UNWRAP!==t||r.push(p.MODE_UNWRAP));var n,i=this,a=r.map((function(e){return v.algorithms.call(i,E,e)}));(a=s(a),a=f(a),this.alg)&&(n="oct"===e?[this.alg,"dir"]:[this.alg],a=u(a,n));return a}}),Object.defineProperty(this,"supports",{value:function(e,t){return-1!==this.algorithms(t).indexOf(e)}}),Object.defineProperty(this,"has",{value:function(e,t){var r=!1;return r=(r=(r=(r=r||!(!S.base||!(e in S.base)))||!(!E.public||!(e in E.public)))||!(!S.extra||!(e in S.extra)))||!!(t&&E.private&&e in E.private)}}),Object.defineProperty(this,"get",{value:function(e,t){var r;return S.base&&e in S.base?r=S.base:E.public&&e in E.public?r=E.public:S.extra&&e in S.extra?r=S.extra:t&&E.private&&e in E.private&&(r=E.private),r&&r[e]||null}}),Object.defineProperty(this,"toJSON",{value:function(e,t){Array.isArray(e)&&(t=e,e=!1);var r={};return r=n(r,S.base,S.public,"boolean"==typeof e&&e?S.private:{},S.extra),r=c(r,t||[])}}),Object.defineProperty(this,"toPEM",{value:function(e){if(null===e&&(e=!1),!v.convertToPEM)throw new Error("Unsupported key type for PEM encoding");var t=e?E.private:E.public;if(!t)throw new Error("Invalid key");return v.convertToPEM.call(this,t,e)}}),Object.defineProperty(this,"toObject",{value:function(e,t){Array.isArray(e)&&(t=e,e=!1);var r={};return r=n(r,S.base,E.public,"boolean"==typeof e&&e?E.private:{},S.extra),r=c(r,(t||[]).concat("length"))}}),Object.defineProperty(this,"sign",{value:function(e,t,r){if(-1===this.algorithms("sign").indexOf(e))return Promise.reject(new Error("unsupported algorithm"));var i=v.signKey.call(this,e,E);return i?(r=r?o(r):{},v.signProps&&(r=n(r,v.signProps.call(this,e,r))),h.sign(e,i,t,r)):Promise.reject(new Error("improper key"))}}),Object.defineProperty(this,"verify",{value:function(e,t,r,i){if(-1===this.algorithms("verify").indexOf(e))return Promise.reject(new Error("unsupported algorithm"));var a=v.verifyKey.call(this,e,E);return a?(i=i?o(i):{},v.verifyProps&&(i=n(i,v.verifyProps.call(this,e,i))),h.verify(e,a,t,r,i)):Promise.reject(new Error("improper key"))}}),Object.defineProperty(this,"encrypt",{value:function(e,t,r){if(-1===this.algorithms("encrypt").indexOf(e))return Promise.reject(new Error("unsupported algorithm"));var i=v.encryptKey.call(this,e,E);return i?(r=r?o(r):{},v.encryptProps&&(r=n(r,v.encryptProps.call(this,e,r))),h.encrypt(e,i,t,r)):Promise.reject(new Error("improper key"))}}),Object.defineProperty(this,"decrypt",{value:function(e,t,r){if(-1===this.algorithms("decrypt").indexOf(e))return Promise.reject(new Error("unsupported algorithm"));var i=v.decryptKey.call(this,e,E);return i?(r=r?o(r):{},v.decryptProps&&(r=n(r,v.decryptProps.call(this,e,r))),h.decrypt(e,i,t,r)):Promise.reject(new Error("improper key"))}}),Object.defineProperty(this,"wrap",{value:function(e,t,r){if(-1===this.algorithms("wrap").indexOf(e))return Promise.reject(new Error("unsupported algorithm"));var i=v.wrapKey.call(this,e,E);return i?(r=r?o(r):{},v.wrapProps&&(r=n(r,v.wrapProps.call(this,e,r))),h.encrypt(e,i,t,r)):Promise.reject(new Error("improper key"))}}),Object.defineProperty(this,"unwrap",{value:function(e,t,r){if(-1===this.algorithms("unwrap").indexOf(e))return Promise.reject(new Error("unsupported algorithm"));var i=v.unwrapKey.call(this,e,E);return i?(r=r?o(r):{},v.unwrapProps&&(r=n(r,v.unwrapProps.call(this,e,r))),h.decrypt(e,i,t,r)):Promise.reject(new Error("improper key"))}})}},6395:e=>{"use strict";
174
174
  /*!
175
175
  * jwk/constants.js - Constants for JWKs
176
176
  *
177
177
  * Copyright (c) 2015 Cisco Systems, Inc. See LICENSE file.
178
- */e.exports={MODE_SIGN:"sign",MODE_VERIFY:"verify",MODE_ENCRYPT:"encrypt",MODE_DECRYPT:"decrypt",MODE_WRAP:"wrap",MODE_UNWRAP:"unwrap"}},5339:function(e,t,r){"use strict";
178
+ */e.exports={MODE_SIGN:"sign",MODE_VERIFY:"verify",MODE_ENCRYPT:"encrypt",MODE_DECRYPT:"decrypt",MODE_WRAP:"wrap",MODE_UNWRAP:"unwrap"}},5339:(e,t,r)=>{"use strict";
179
179
  /*!
180
180
  * jwk/rsa.js - RSA Key Representation
181
181
  *
182
182
  * Copyright (c) 2015 Cisco Systems, Inc. See LICENSE file.
183
- */var n=r(1762),i=r(1194),a=r(1634),o={BaseKey:r(7136),helpers:r(9684)},s=["ES256","ES384","ES512"],u=["ECDH-ES","ECDH-ES+A128KW","ECDH-ES+A192KW","ECDH-ES+A256KW"],c=n.EC_OID;function l(e){switch(e){case"1.2.840.10045.3.1.7":return"P-256";case"1.3.132.0.34":return"P-384";case"1.3.132.0.35":return"P-521";default:return null}}var f={publicKey:function(e){var t=o.helpers.COMMON_PROPS.concat([{name:"crv",type:"string"},{name:"x",type:"binary"},{name:"y",type:"binary"}]),r=o.helpers.unpackProps(e,t);return r&&r.crv&&r.x&&r.y?r.length=n.curveSize(r.crv):(delete r.crv,delete r.x,delete r.y),r},privateKey:function(e){var t=o.helpers.COMMON_PROPS.concat([{name:"crv",type:"string"},{name:"x",type:"binary"},{name:"y",type:"binary"},{name:"d",type:"binary"}]),r=o.helpers.unpackProps(e,t);return r&&r.crv&&r.x&&r.y&&r.d?r.length=n.curveSize(r.crv):r=void 0,r},thumbprint:function(e){return e.public&&(e=e.public),{crv:e.crv,kty:"EC",x:e.x,y:e.y}},algorithms:function(e,t){var r=e.public&&e.public.length||e.private&&e.private.length||0;switch(521===r&&(r=512),t){case"encrypt":case"decrypt":return[];case"wrap":return e.public&&u||[];case"unwrap":return e.private&&u||[];case"sign":return e.private?s.filter((function(e){return e==="ES"+r})):[];case"verify":return e.public?s.filter((function(e){return e==="ES"+r})):[]}},encryptKey:function(e,t){return t.public},decryptKey:function(e,t){return t.private},wrapKey:function(e,t){return t.public},unwrapKey:function(e,t){return t.private},signKey:function(e,t){return t.private},verifyKey:function(e,t){return t.public}};f.convertToPEM=n.convertToPEM;var h={oid:c,privateKey:{name:"ECPrivateKey",tagClass:i.asn1.Class.UNIVERSAL,type:i.asn1.Type.SEQUENCE,constructed:!0,value:[{name:"ECPrivateKey.version",tagClass:i.asn1.Class.UNIVERSAL,type:i.asn1.Type.INTEGER,constructed:!1},{name:"ECPrivateKey.private",tagClass:i.asn1.Class.UNIVERSAL,type:i.asn1.Type.OCTETSTRING,constructed:!1,capture:"d"},{tagClass:i.asn1.Class.CONTEXT_SPECIFIC,name:"ECPrivateKey.parameters",constructed:!0,value:[{name:"ECPrivateKey.namedCurve",tagClass:i.asn1.Class.UNIVERSAL,type:i.asn1.Type.OID,constructed:!1,capture:"crv"}]},{name:"ECPrivateKey.publicKey",tagClass:i.asn1.Class.CONTEXT_SPECIFIC,constructed:!0,value:[{name:"ECPrivateKey.point",tagClass:i.asn1.Class.UNIVERSAL,type:i.asn1.Type.BITSTRING,constructed:!1,capture:"point"}]}]},embeddedPrivateKey:{name:"ECPrivateKey",tagClass:i.asn1.Class.UNIVERSAL,type:i.asn1.Type.SEQUENCE,constructed:!0,value:[{name:"ECPrivateKey.version",tagClass:i.asn1.Class.UNIVERSAL,type:i.asn1.Type.INTEGER,constructed:!1},{name:"ECPrivateKey.private",tagClass:i.asn1.Class.UNIVERSAL,type:i.asn1.Type.OCTETSTRING,constructed:!1,capture:"d"},{name:"ECPrivateKey.publicKey",tagClass:i.asn1.Class.CONTEXT_SPECIFIC,constructed:!0,value:[{name:"ECPrivateKey.point",tagClass:i.asn1.Class.UNIVERSAL,type:i.asn1.Type.BITSTRING,constructed:!1,capture:"point"}]}]}},p={kty:"EC",validators:h,prepare:function(e){var t=f,r=Promise.resolve(e);return r=(r=r.then((function(e){return o.helpers.thumbprint(t,e)}))).then((function(r){var n={};return n[o.helpers.INTERNALS.THUMBPRINT_HASH]=r,e[o.helpers.INTERNALS.THUMBPRINT_KEY]=n,t}))},generate:function(e){var t=a.generateKeyPair(e),r={crv:e,x:t.public.x,y:t.public.y,d:t.private.d};return Promise.resolve(r)},import:function(e){if(h.oid!==e.keyOid)return null;var t;if(e.keyParams&&i.asn1.Type.OID===e.keyParams.type?t=l(t=i.asn1.derToOid(e.keyParams.value)):e.crv&&(t=l(t=i.asn1.derToOid(e.crv))),!t)return null;if(!e.parsed){var r={};if("private"===e.type){if("string"==typeof e.keyValue?e.keyValue=i.asn1.fromDer(e.keyValue):Array.isArray(e.keyValue)&&(e.keyValue=e.keyValue[0]),!i.asn1.validate(e.keyValue,h.embeddedPrivateKey,r,[]))return null}else r.point=e.keyValue;e=r}var n={kty:"EC",crv:t};if(e.d&&(n.d=Buffer.from(e.d,"binary")),e.point){var a=Buffer.from(e.point,"binary");if(4!==a.readUInt16BE(0))return null;var o=(a=a.slice(2)).length/2;n.x=a.slice(0,o),n.y=a.slice(o)}return n}};e.exports=Object.freeze({config:f,factory:p}),r(4567).registry.register(p)},9684:function(e,t,r){"use strict";
183
+ */var n=r(1762),i=r(1194),a=r(1634),o={BaseKey:r(7136),helpers:r(9684)},s=["ES256","ES384","ES512"],u=["ECDH-ES","ECDH-ES+A128KW","ECDH-ES+A192KW","ECDH-ES+A256KW"],c=n.EC_OID;function l(e){switch(e){case"1.2.840.10045.3.1.7":return"P-256";case"1.3.132.0.34":return"P-384";case"1.3.132.0.35":return"P-521";default:return null}}var f={publicKey:function(e){var t=o.helpers.COMMON_PROPS.concat([{name:"crv",type:"string"},{name:"x",type:"binary"},{name:"y",type:"binary"}]),r=o.helpers.unpackProps(e,t);return r&&r.crv&&r.x&&r.y?r.length=n.curveSize(r.crv):(delete r.crv,delete r.x,delete r.y),r},privateKey:function(e){var t=o.helpers.COMMON_PROPS.concat([{name:"crv",type:"string"},{name:"x",type:"binary"},{name:"y",type:"binary"},{name:"d",type:"binary"}]),r=o.helpers.unpackProps(e,t);return r&&r.crv&&r.x&&r.y&&r.d?r.length=n.curveSize(r.crv):r=void 0,r},thumbprint:function(e){return e.public&&(e=e.public),{crv:e.crv,kty:"EC",x:e.x,y:e.y}},algorithms:function(e,t){var r=e.public&&e.public.length||e.private&&e.private.length||0;switch(521===r&&(r=512),t){case"encrypt":case"decrypt":return[];case"wrap":return e.public&&u||[];case"unwrap":return e.private&&u||[];case"sign":return e.private?s.filter((function(e){return e==="ES"+r})):[];case"verify":return e.public?s.filter((function(e){return e==="ES"+r})):[]}},encryptKey:function(e,t){return t.public},decryptKey:function(e,t){return t.private},wrapKey:function(e,t){return t.public},unwrapKey:function(e,t){return t.private},signKey:function(e,t){return t.private},verifyKey:function(e,t){return t.public}};f.convertToPEM=n.convertToPEM;var h={oid:c,privateKey:{name:"ECPrivateKey",tagClass:i.asn1.Class.UNIVERSAL,type:i.asn1.Type.SEQUENCE,constructed:!0,value:[{name:"ECPrivateKey.version",tagClass:i.asn1.Class.UNIVERSAL,type:i.asn1.Type.INTEGER,constructed:!1},{name:"ECPrivateKey.private",tagClass:i.asn1.Class.UNIVERSAL,type:i.asn1.Type.OCTETSTRING,constructed:!1,capture:"d"},{tagClass:i.asn1.Class.CONTEXT_SPECIFIC,name:"ECPrivateKey.parameters",constructed:!0,value:[{name:"ECPrivateKey.namedCurve",tagClass:i.asn1.Class.UNIVERSAL,type:i.asn1.Type.OID,constructed:!1,capture:"crv"}]},{name:"ECPrivateKey.publicKey",tagClass:i.asn1.Class.CONTEXT_SPECIFIC,constructed:!0,value:[{name:"ECPrivateKey.point",tagClass:i.asn1.Class.UNIVERSAL,type:i.asn1.Type.BITSTRING,constructed:!1,capture:"point"}]}]},embeddedPrivateKey:{name:"ECPrivateKey",tagClass:i.asn1.Class.UNIVERSAL,type:i.asn1.Type.SEQUENCE,constructed:!0,value:[{name:"ECPrivateKey.version",tagClass:i.asn1.Class.UNIVERSAL,type:i.asn1.Type.INTEGER,constructed:!1},{name:"ECPrivateKey.private",tagClass:i.asn1.Class.UNIVERSAL,type:i.asn1.Type.OCTETSTRING,constructed:!1,capture:"d"},{name:"ECPrivateKey.publicKey",tagClass:i.asn1.Class.CONTEXT_SPECIFIC,constructed:!0,value:[{name:"ECPrivateKey.point",tagClass:i.asn1.Class.UNIVERSAL,type:i.asn1.Type.BITSTRING,constructed:!1,capture:"point"}]}]}},p={kty:"EC",validators:h,prepare:function(e){var t=f,r=Promise.resolve(e);return r=(r=r.then((function(e){return o.helpers.thumbprint(t,e)}))).then((function(r){var n={};return n[o.helpers.INTERNALS.THUMBPRINT_HASH]=r,e[o.helpers.INTERNALS.THUMBPRINT_KEY]=n,t}))},generate:function(e){var t=a.generateKeyPair(e),r={crv:e,x:t.public.x,y:t.public.y,d:t.private.d};return Promise.resolve(r)},import:function(e){if(h.oid!==e.keyOid)return null;var t;if(e.keyParams&&i.asn1.Type.OID===e.keyParams.type?t=l(t=i.asn1.derToOid(e.keyParams.value)):e.crv&&(t=l(t=i.asn1.derToOid(e.crv))),!t)return null;if(!e.parsed){var r={};if("private"===e.type){if("string"==typeof e.keyValue?e.keyValue=i.asn1.fromDer(e.keyValue):Array.isArray(e.keyValue)&&(e.keyValue=e.keyValue[0]),!i.asn1.validate(e.keyValue,h.embeddedPrivateKey,r,[]))return null}else r.point=e.keyValue;e=r}var n={kty:"EC",crv:t};if(e.d&&(n.d=Buffer.from(e.d,"binary")),e.point){var a=Buffer.from(e.point,"binary");if(4!==a.readUInt16BE(0))return null;var o=(a=a.slice(2)).length/2;n.x=a.slice(0,o),n.y=a.slice(o)}return n}};e.exports=Object.freeze({config:f,factory:p}),r(4567).registry.register(p)},9684:(e,t,r)=>{"use strict";
184
184
  /*!
185
185
  * jwk/helpers.js - JWK Internal Helper Functions and Constants
186
186
  *
187
187
  * Copyright (c) 2015 Cisco Systems, Inc. See LICENSE file.
188
- */var n=r(6678),i=r(4237),a=r(1194),o=r(5382),s={name:"PrivateKeyInfo",tagClass:a.asn1.Class.UNIVERSAL,type:a.asn1.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:a.asn1.Class.UNIVERSAL,type:a.asn1.Type.INTEGER,constructed:!1,capture:"keyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:a.asn1.Class.UNIVERSAL,type:a.asn1.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:a.asn1.Class.UNIVERSAL,type:a.asn1.Type.OID,constructed:!1,capture:"keyOid"},{name:"AlgorithmIdentifier.parameters",captureAsn1:"keyParams"}]},{name:"PrivateKeyInfo",tagClass:a.asn1.Class.UNIVERSAL,type:a.asn1.Type.OCTETSTRING,constructed:!1,capture:"keyValue"}]},u={name:"SubjectPublicKeyInfo",tagClass:a.asn1.Class.UNIVERSAL,type:a.asn1.Type.SEQUENCE,constructed:!0,value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:a.asn1.Class.UNIVERSAL,type:a.asn1.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:a.asn1.Class.UNIVERSAL,type:a.asn1.Type.OID,constructed:!1,capture:"keyOid"},{name:"AlgorithmIdentifier.parameters",captureAsn1:"keyParams"}]},{name:"SubjectPublicKeyInfo.subjectPublicKey",tagClass:a.asn1.Class.UNIVERSAL,type:a.asn1.Type.BITSTRING,constructed:!1,capture:"keyValue"}]},c={name:"Certificate",tagClass:a.asn1.Class.UNIVERSAL,type:a.asn1.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate",tagClass:a.asn1.Class.UNIVERSAL,type:a.asn1.Type.SEQUENCE,constructed:!0,captureAsn1:"certificate",value:[{name:"Certificate.TBSCertificate.version",tagClass:a.asn1.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.version.integer",tagClass:a.asn1.Class.UNIVERSAL,type:a.asn1.Type.INTEGER,constructed:!1,capture:"certVersion"}]},{name:"Certificate.TBSCertificate.serialNumber",tagClass:a.asn1.Class.UNIVERSAL,type:a.asn1.Type.INTEGER,constructed:!1,capture:"certSerialNumber"},{name:"Certificate.TBSCertificate.signature",tagClass:a.asn1.Class.UNIVERSAL,type:a.asn1.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.signature.algorithm",tagClass:a.asn1.Class.UNIVERSAL,type:a.asn1.Type.OID,constructed:!1,capture:"certSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:a.asn1.Class.UNIVERSAL,optional:!0,captureAsn1:"certSignatureParams"}]},{name:"Certificate.TBSCertificate.issuer",tagClass:a.asn1.Class.UNIVERSAL,type:a.asn1.Type.SEQUENCE,constructed:!0,captureAsn1:"certIssuer"},{name:"Certificate.TBSCertificate.validity",tagClass:a.asn1.Class.UNIVERSAL,type:a.asn1.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.validity.notBefore (utc)",tagClass:a.asn1.Class.UNIVERSAL,type:a.asn1.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity1UTCTime"},{name:"Certificate.TBSCertificate.validity.notBefore (generalized)",tagClass:a.asn1.Class.UNIVERSAL,type:a.asn1.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity2GeneralizedTime"},{name:"Certificate.TBSCertificate.validity.notAfter (utc)",tagClass:a.asn1.Class.UNIVERSAL,type:a.asn1.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity3UTCTime"},{name:"Certificate.TBSCertificate.validity.notAfter (generalized)",tagClass:a.asn1.Class.UNIVERSAL,type:a.asn1.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity4GeneralizedTime"}]},{name:"Certificate.TBSCertificate.subject",tagClass:a.asn1.Class.UNIVERSAL,type:a.asn1.Type.SEQUENCE,constructed:!0,captureAsn1:"certSubject"},u,{name:"Certificate.TBSCertificate.issuerUniqueID",tagClass:a.asn1.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.issuerUniqueID.id",tagClass:a.asn1.Class.UNIVERSAL,type:a.asn1.Type.BITSTRING,constructed:!1,capture:"certIssuerUniqueId"}]},{name:"Certificate.TBSCertificate.subjectUniqueID",tagClass:a.asn1.Class.CONTEXT_SPECIFIC,type:2,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.subjectUniqueID.id",tagClass:a.asn1.Class.UNIVERSAL,type:a.asn1.Type.BITSTRING,constructed:!1,capture:"certSubjectUniqueId"}]},{name:"Certificate.TBSCertificate.extensions",tagClass:a.asn1.Class.CONTEXT_SPECIFIC,type:3,constructed:!0,captureAsn1:"certExtensions",optional:!0}]},{name:"Certificate.signatureAlgorithm",tagClass:a.asn1.Class.UNIVERSAL,type:a.asn1.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.signatureAlgorithm.algorithm",tagClass:a.asn1.Class.UNIVERSAL,type:a.asn1.Type.OID,constructed:!1,capture:"certSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:a.asn1.Class.UNIVERSAL,optional:!0,captureAsn1:"certSignatureParams"}]},{name:"Certificate.signatureValue",tagClass:a.asn1.Class.UNIVERSAL,type:a.asn1.Type.BITSTRING,constructed:!1,capture:"certSignature"}]},l={THUMBPRINT_KEY:"internal\0thumbprint",THUMBPRINT_HASH:"SHA-256"};e.exports={validators:{privateKey:s,publicKey:u,certificate:c},thumbprint:function(e,t,r){if("function"!=typeof e.thumbprint)return Promise.reject(new Error("thumbprint not supported"));r=(r||l.THUMBPRINT_HASH).toUpperCase();var n=e.thumbprint(t),a=Object.keys(n).sort().map((function(e){var t=n[e];return Buffer.isBuffer(t)&&(t=i.base64url.encode(t)),JSON.stringify(e)+":"+JSON.stringify(t)}));a="{"+a.join(",")+"}";try{return o.digest(r,Buffer.from(a,"utf8"))}catch(e){return Promise.reject(e)}},unpackProps:function(e,t){var r;t.forEach((function(t){if(t.name in e){r=r||{};var a=e[t.name];switch(t.type){case"binary":Buffer.isBuffer(a)?e[t.name]=i.base64url.encode(a):a=i.base64url.decode(a);break;case"string":case"number":case"boolean":break;case"array":a=[].concat(a);break;case"object":a=n(a)}r[t.name]=a}}));var a=r||{};return Object.keys(e).forEach((function(t){t in a||delete e[t]})),r},COMMON_PROPS:[{name:"kty",type:"string"},{name:"kid",type:"string"},{name:"use",type:"string"},{name:"alg",type:"string"},{name:"x5c",type:"array"},{name:"x5t",type:"binary"},{name:"x5u",type:"string"},{name:"key_ops",type:"array"}],INTERNALS:l}},2543:function(e,t,r){"use strict";
188
+ */var n=r(6678),i=r(4237),a=r(1194),o=r(5382),s={name:"PrivateKeyInfo",tagClass:a.asn1.Class.UNIVERSAL,type:a.asn1.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:a.asn1.Class.UNIVERSAL,type:a.asn1.Type.INTEGER,constructed:!1,capture:"keyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:a.asn1.Class.UNIVERSAL,type:a.asn1.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:a.asn1.Class.UNIVERSAL,type:a.asn1.Type.OID,constructed:!1,capture:"keyOid"},{name:"AlgorithmIdentifier.parameters",captureAsn1:"keyParams"}]},{name:"PrivateKeyInfo",tagClass:a.asn1.Class.UNIVERSAL,type:a.asn1.Type.OCTETSTRING,constructed:!1,capture:"keyValue"}]},u={name:"SubjectPublicKeyInfo",tagClass:a.asn1.Class.UNIVERSAL,type:a.asn1.Type.SEQUENCE,constructed:!0,value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:a.asn1.Class.UNIVERSAL,type:a.asn1.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:a.asn1.Class.UNIVERSAL,type:a.asn1.Type.OID,constructed:!1,capture:"keyOid"},{name:"AlgorithmIdentifier.parameters",captureAsn1:"keyParams"}]},{name:"SubjectPublicKeyInfo.subjectPublicKey",tagClass:a.asn1.Class.UNIVERSAL,type:a.asn1.Type.BITSTRING,constructed:!1,capture:"keyValue"}]},c={name:"Certificate",tagClass:a.asn1.Class.UNIVERSAL,type:a.asn1.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate",tagClass:a.asn1.Class.UNIVERSAL,type:a.asn1.Type.SEQUENCE,constructed:!0,captureAsn1:"certificate",value:[{name:"Certificate.TBSCertificate.version",tagClass:a.asn1.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.version.integer",tagClass:a.asn1.Class.UNIVERSAL,type:a.asn1.Type.INTEGER,constructed:!1,capture:"certVersion"}]},{name:"Certificate.TBSCertificate.serialNumber",tagClass:a.asn1.Class.UNIVERSAL,type:a.asn1.Type.INTEGER,constructed:!1,capture:"certSerialNumber"},{name:"Certificate.TBSCertificate.signature",tagClass:a.asn1.Class.UNIVERSAL,type:a.asn1.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.signature.algorithm",tagClass:a.asn1.Class.UNIVERSAL,type:a.asn1.Type.OID,constructed:!1,capture:"certSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:a.asn1.Class.UNIVERSAL,optional:!0,captureAsn1:"certSignatureParams"}]},{name:"Certificate.TBSCertificate.issuer",tagClass:a.asn1.Class.UNIVERSAL,type:a.asn1.Type.SEQUENCE,constructed:!0,captureAsn1:"certIssuer"},{name:"Certificate.TBSCertificate.validity",tagClass:a.asn1.Class.UNIVERSAL,type:a.asn1.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.validity.notBefore (utc)",tagClass:a.asn1.Class.UNIVERSAL,type:a.asn1.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity1UTCTime"},{name:"Certificate.TBSCertificate.validity.notBefore (generalized)",tagClass:a.asn1.Class.UNIVERSAL,type:a.asn1.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity2GeneralizedTime"},{name:"Certificate.TBSCertificate.validity.notAfter (utc)",tagClass:a.asn1.Class.UNIVERSAL,type:a.asn1.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity3UTCTime"},{name:"Certificate.TBSCertificate.validity.notAfter (generalized)",tagClass:a.asn1.Class.UNIVERSAL,type:a.asn1.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity4GeneralizedTime"}]},{name:"Certificate.TBSCertificate.subject",tagClass:a.asn1.Class.UNIVERSAL,type:a.asn1.Type.SEQUENCE,constructed:!0,captureAsn1:"certSubject"},u,{name:"Certificate.TBSCertificate.issuerUniqueID",tagClass:a.asn1.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.issuerUniqueID.id",tagClass:a.asn1.Class.UNIVERSAL,type:a.asn1.Type.BITSTRING,constructed:!1,capture:"certIssuerUniqueId"}]},{name:"Certificate.TBSCertificate.subjectUniqueID",tagClass:a.asn1.Class.CONTEXT_SPECIFIC,type:2,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.subjectUniqueID.id",tagClass:a.asn1.Class.UNIVERSAL,type:a.asn1.Type.BITSTRING,constructed:!1,capture:"certSubjectUniqueId"}]},{name:"Certificate.TBSCertificate.extensions",tagClass:a.asn1.Class.CONTEXT_SPECIFIC,type:3,constructed:!0,captureAsn1:"certExtensions",optional:!0}]},{name:"Certificate.signatureAlgorithm",tagClass:a.asn1.Class.UNIVERSAL,type:a.asn1.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.signatureAlgorithm.algorithm",tagClass:a.asn1.Class.UNIVERSAL,type:a.asn1.Type.OID,constructed:!1,capture:"certSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:a.asn1.Class.UNIVERSAL,optional:!0,captureAsn1:"certSignatureParams"}]},{name:"Certificate.signatureValue",tagClass:a.asn1.Class.UNIVERSAL,type:a.asn1.Type.BITSTRING,constructed:!1,capture:"certSignature"}]},l={THUMBPRINT_KEY:"internal\0thumbprint",THUMBPRINT_HASH:"SHA-256"};e.exports={validators:{privateKey:s,publicKey:u,certificate:c},thumbprint:function(e,t,r){if("function"!=typeof e.thumbprint)return Promise.reject(new Error("thumbprint not supported"));r=(r||l.THUMBPRINT_HASH).toUpperCase();var n=e.thumbprint(t),a=Object.keys(n).sort().map((function(e){var t=n[e];return Buffer.isBuffer(t)&&(t=i.base64url.encode(t)),JSON.stringify(e)+":"+JSON.stringify(t)}));a="{"+a.join(",")+"}";try{return o.digest(r,Buffer.from(a,"utf8"))}catch(e){return Promise.reject(e)}},unpackProps:function(e,t){var r;t.forEach((function(t){if(t.name in e){r=r||{};var a=e[t.name];switch(t.type){case"binary":Buffer.isBuffer(a)?e[t.name]=i.base64url.encode(a):a=i.base64url.decode(a);break;case"string":case"number":case"boolean":break;case"array":a=[].concat(a);break;case"object":a=n(a)}r[t.name]=a}}));var a=r||{};return Object.keys(e).forEach((function(t){t in a||delete e[t]})),r},COMMON_PROPS:[{name:"kty",type:"string"},{name:"kid",type:"string"},{name:"use",type:"string"},{name:"alg",type:"string"},{name:"x5c",type:"array"},{name:"x5t",type:"binary"},{name:"x5u",type:"string"},{name:"key_ops",type:"array"}],INTERNALS:l}},2543:(e,t,r)=>{"use strict";
189
189
  /*!
190
190
  * jwk/index.js - JSON Web Key (JWK) Entry Point
191
191
  *
192
192
  * Copyright (c) 2015 Cisco Systems, Inc. See LICENSE file.
193
- */var n=r(4567);Object.keys(n.KeyStore).forEach((function(e){t[e]=n.KeyStore[e]}));var i=r(6395);Object.keys(i).forEach((function(e){t[e]=i[e]})),r(9170),r(9746),r(5339)},4567:function(e,t,r){"use strict";
193
+ */var n=r(4567);Object.keys(n.KeyStore).forEach((function(e){t[e]=n.KeyStore[e]}));var i=r(6395);Object.keys(i).forEach((function(e){t[e]=i[e]})),r(9170),r(9746),r(5339)},4567:(e,t,r)=>{"use strict";
194
194
  /*!
195
195
  * jwk/keystore.js - JWK KeyStore Implementation
196
196
  *
197
197
  * Copyright (c) 2015 Cisco Systems, Inc. See LICENSE file.
198
- */var n=r(6678),i=r(5029),a=r(1194),o=r(4237),s={BaseKey:r(7136),helpers:r(9684)},u=function(){var e={};Object.defineProperty(this,"register",{value:function(t){if(!t||"string"!=typeof t.kty||!t.kty)throw new Error("invalid Key factory");var r=t.kty;return e[r]=t,this}}),Object.defineProperty(this,"unregister",{value:function(t){if(!t||"string"!=typeof t.kty||!t.kty)throw new Error("invalid Key factory");var r=t.kty;return t===e[r]&&delete e[r],this}}),Object.defineProperty(this,"get",{value:function(t){return e[t||""]||void 0}}),Object.defineProperty(this,"all",{value:function(){return Object.keys(e).map((function(t){return e[t]}))}})},c=new u;function l(e,t){var r,n={},i=[],u=t.form,l=t.body,f=null;switch(t=a.asn1.fromDer(l),u){case"private":e.all().some((function(e){if(r)return!1;if(!e.validators)return!1;var o=e.validators.oid,s=e.validators.privateKey;return!!s&&(n={},i=[],(r=a.asn1.validate(t,s,n,i))&&(n.keyOid=a.asn1.oidToDer(o),n.parsed=!0),r)})),n.type="private";break;case"pkcs8":r=a.asn1.validate(t,s.helpers.validators.privateKey,n,i),n.type="private";break;case"public":case"spki":r=a.asn1.validate(t,s.helpers.validators.publicKey,n,i),n.type="public";break;case"pkix":case"x509":if(r=a.asn1.validate(t,s.helpers.validators.certificate,n,i)){n=function(e){return["certIssuer","certSubject"].forEach((function(t){var r=a.pki.RDNAttributesAsArray(e[t]),n=e[t]={};r.forEach((function(e){n[e.name||e.type]=e.value}))})),e}(n);var h=a.md.sha1.create();h.update(l),f=o.base64url.encode(Buffer.from(h.digest().toHex(),"hex"))}n.type="public"}return r?(n.keyOid&&(n.keyOid=a.asn1.derToOid(n.keyOid)),r=null,c.all().forEach((function(e){r||e&&"function"==typeof e.import&&(r=e.import(n))})),r&&n.certSubject&&n.certSubject.commonName&&(r.kid=n.certSubject.commonName),r&&f&&(r.x5t=f),r):null}var f=function(e,t){var r={};Object.defineProperty(this,"generate",{value:function(t,r,a){var o=e.get(t);if(!o)return Promise.reject(new Error("unsupported key type"));(a=n(a||{})).kty=t;var s=this;return o.generate(r).then((function(e){return e=i(a,e,{kty:t}),s.add(e)}))}}),Object.defineProperty(this,"add",{value:function(t,i,o){var u;if(o=o||{},Buffer.isBuffer(t)||"string"==typeof t)if("json"===(i=(i||"json").toLowerCase()))t=JSON.parse(t.toString("utf8"));else try{if(u="pem"===i?function(e){var t={};if(!a.pem.decode(e).some((function(e){switch(e.type){case"CERTIFICATE":t.form="pkix";break;case"PUBLIC KEY":t.form="spki";break;case"PRIVATE KEY":t.form="pkcs8";break;case"EC PRIVATE KEY":case"RSA PRIVATE KEY":t.form="private";break;default:return!1}return t.body=e.body,!0})))throw new Error("supported PEM type not found");return t}(t):{body:t.toString("binary"),form:i},!(t=l(e,u)))throw new Error("no importer for key");Object.keys(o).forEach((function(e){t[e]=o[e]}))}catch(e){return Promise.reject(e)}else t=f.isKey(t)?t.toJSON(!0):n(t);var c=e.get(t.kty);if(!c)return Promise.reject(new Error("unsupported key type"));var h=this;return c.prepare(t).then((function(e){return new s.BaseKey(t.kty,h,t,e)})).then((function(e){var t=e.kid||"";return(r[t]=r[t]||[]).push(e),e}))}}),Object.defineProperty(this,"remove",{value:function(e){if(e){var t=r[e.kid];if(t){var n=t.indexOf(e);-1!==n&&(t.splice(n,1),t.length||delete r[e.kid])}}}}),Object.defineProperty(this,"all",{value:function(e,n){void 0!==(e=e||{}).kid&&null!==e.kid&&"string"!=typeof e.kid&&(e.kid=String(e.kid));var i=[],a=function(t){return(!e.kty||!t.kty||e.kty===t.kty)&&((!e.use||!t.use||e.use===t.use)&&(!e.alg||("dir"===e.alg||!t.alg||e.alg===t.alg)&&t.supports(e.alg)))};return Object.keys(r).forEach((function(t){if(!e.kid||e.kid===t){var n=r[t].filter(a);n.length&&(i=i.concat(n))}})),!n&&t&&(i=i.concat(t.all(e))),i}}),Object.defineProperty(this,"get",{value:function(e,r,n){"boolean"==typeof e?(n=e,r=e=null):"object"==typeof e&&(n=r,r=e,e=null),r=r||{},e&&(r.kid=e),void 0!==r.kid&&null!==r.kid&&"string"!=typeof r.kid&&(r.kid=String(r.kid));var i=this.all(r,!0);return i.length||!t||n||(i=t.get(r,n)),i[0]||null}}),Object.defineProperty(this,"temp",{value:function(){return new f(e,this)}}),Object.defineProperty(this,"toJSON",{value:function(e){var t=[];return Object.keys(r).forEach((function(n){var i=r[n].map((function(t){return t.toJSON(e)}));t=t.concat(i)})),{keys:t}}})};f.isKeyStore=function(e){return!!e&&("object"==typeof e&&("function"==typeof e.get&&"function"==typeof e.all&&"function"==typeof e.generate&&"function"==typeof e.add&&"function"==typeof e.remove))},f.createKeyStore=function(){return new f(c)},f.asKeyStore=function(e){if(f.isKeyStore(e))return Promise.resolve(e);var t,r=f.createKeyStore();if("string"==typeof e&&(e=JSON.parse(e)),Array.isArray(e))t=e;else{if(!("keys"in e))return Promise.reject(new Error("invalid keystore"));t=e.keys}t=t.map((function(e){return r.add(e)}));var n=Promise.all(t);return n=n.then((function(){return r}))},f.isKey=function(e){return!!e&&("object"==typeof e&&(!!f.isKeyStore(e.keystore)&&("string"==typeof e.kty&&"number"==typeof e.length&&"function"==typeof e.algorithms&&"function"==typeof e.supports&&"function"==typeof e.encrypt&&"function"==typeof e.decrypt&&"function"==typeof e.wrap&&"function"==typeof e.unwrap&&"function"==typeof e.sign&&"function"==typeof e.verify)))},f.createKey=function(e,t,r){return f.createKeyStore().generate(e,t,r)},f.asKey=function(e,t,r){return f.isKey(e)?Promise.resolve(e):e=f.createKeyStore().add(e,t,r)},e.exports={KeyRegistry:u,KeyStore:f,registry:c}},9170:function(e,t,r){"use strict";
198
+ */var n=r(6678),i=r(5029),a=r(1194),o=r(4237),s={BaseKey:r(7136),helpers:r(9684)},u=function(){var e={};Object.defineProperty(this,"register",{value:function(t){if(!t||"string"!=typeof t.kty||!t.kty)throw new Error("invalid Key factory");var r=t.kty;return e[r]=t,this}}),Object.defineProperty(this,"unregister",{value:function(t){if(!t||"string"!=typeof t.kty||!t.kty)throw new Error("invalid Key factory");var r=t.kty;return t===e[r]&&delete e[r],this}}),Object.defineProperty(this,"get",{value:function(t){return e[t||""]||void 0}}),Object.defineProperty(this,"all",{value:function(){return Object.keys(e).map((function(t){return e[t]}))}})},c=new u;function l(e,t){var r,n={},i=[],u=t.form,l=t.body,f=null;switch(t=a.asn1.fromDer(l),u){case"private":e.all().some((function(e){if(r)return!1;if(!e.validators)return!1;var o=e.validators.oid,s=e.validators.privateKey;return!!s&&(n={},i=[],(r=a.asn1.validate(t,s,n,i))&&(n.keyOid=a.asn1.oidToDer(o),n.parsed=!0),r)})),n.type="private";break;case"pkcs8":r=a.asn1.validate(t,s.helpers.validators.privateKey,n,i),n.type="private";break;case"public":case"spki":r=a.asn1.validate(t,s.helpers.validators.publicKey,n,i),n.type="public";break;case"pkix":case"x509":if(r=a.asn1.validate(t,s.helpers.validators.certificate,n,i)){n=function(e){return["certIssuer","certSubject"].forEach((function(t){var r=a.pki.RDNAttributesAsArray(e[t]),n=e[t]={};r.forEach((function(e){n[e.name||e.type]=e.value}))})),e}(n);var h=a.md.sha1.create();h.update(l),f=o.base64url.encode(Buffer.from(h.digest().toHex(),"hex"))}n.type="public"}return r?(n.keyOid&&(n.keyOid=a.asn1.derToOid(n.keyOid)),r=null,c.all().forEach((function(e){r||e&&"function"==typeof e.import&&(r=e.import(n))})),r&&n.certSubject&&n.certSubject.commonName&&(r.kid=n.certSubject.commonName),r&&f&&(r.x5t=f),r):null}var f=function(e,t){var r={};Object.defineProperty(this,"generate",{value:function(t,r,a){var o=e.get(t);if(!o)return Promise.reject(new Error("unsupported key type"));(a=n(a||{})).kty=t;var s=this;return o.generate(r).then((function(e){return e=i(a,e,{kty:t}),s.add(e)}))}}),Object.defineProperty(this,"add",{value:function(t,i,o){var u;if(o=o||{},Buffer.isBuffer(t)||"string"==typeof t)if("json"===(i=(i||"json").toLowerCase()))t=JSON.parse(t.toString("utf8"));else try{if(u="pem"===i?function(e){var t={};if(!a.pem.decode(e).some((function(e){switch(e.type){case"CERTIFICATE":t.form="pkix";break;case"PUBLIC KEY":t.form="spki";break;case"PRIVATE KEY":t.form="pkcs8";break;case"EC PRIVATE KEY":case"RSA PRIVATE KEY":t.form="private";break;default:return!1}return t.body=e.body,!0})))throw new Error("supported PEM type not found");return t}(t):{body:t.toString("binary"),form:i},!(t=l(e,u)))throw new Error("no importer for key");Object.keys(o).forEach((function(e){t[e]=o[e]}))}catch(e){return Promise.reject(e)}else t=f.isKey(t)?t.toJSON(!0):n(t);var c=e.get(t.kty);if(!c)return Promise.reject(new Error("unsupported key type"));var h=this;return c.prepare(t).then((function(e){return new s.BaseKey(t.kty,h,t,e)})).then((function(e){var t=e.kid||"";return(r[t]=r[t]||[]).push(e),e}))}}),Object.defineProperty(this,"remove",{value:function(e){if(e){var t=r[e.kid];if(t){var n=t.indexOf(e);-1!==n&&(t.splice(n,1),t.length||delete r[e.kid])}}}}),Object.defineProperty(this,"all",{value:function(e,n){void 0!==(e=e||{}).kid&&null!==e.kid&&"string"!=typeof e.kid&&(e.kid=String(e.kid));var i=[],a=function(t){return(!e.kty||!t.kty||e.kty===t.kty)&&((!e.use||!t.use||e.use===t.use)&&(!e.alg||("dir"===e.alg||!t.alg||e.alg===t.alg)&&t.supports(e.alg)))};return Object.keys(r).forEach((function(t){if(!e.kid||e.kid===t){var n=r[t].filter(a);n.length&&(i=i.concat(n))}})),!n&&t&&(i=i.concat(t.all(e))),i}}),Object.defineProperty(this,"get",{value:function(e,r,n){"boolean"==typeof e?(n=e,r=e=null):"object"==typeof e&&(n=r,r=e,e=null),r=r||{},e&&(r.kid=e),void 0!==r.kid&&null!==r.kid&&"string"!=typeof r.kid&&(r.kid=String(r.kid));var i=this.all(r,!0);return i.length||!t||n||(i=t.get(r,n)),i[0]||null}}),Object.defineProperty(this,"temp",{value:function(){return new f(e,this)}}),Object.defineProperty(this,"toJSON",{value:function(e){var t=[];return Object.keys(r).forEach((function(n){var i=r[n].map((function(t){return t.toJSON(e)}));t=t.concat(i)})),{keys:t}}})};f.isKeyStore=function(e){return!!e&&("object"==typeof e&&("function"==typeof e.get&&"function"==typeof e.all&&"function"==typeof e.generate&&"function"==typeof e.add&&"function"==typeof e.remove))},f.createKeyStore=function(){return new f(c)},f.asKeyStore=function(e){if(f.isKeyStore(e))return Promise.resolve(e);var t,r=f.createKeyStore();if("string"==typeof e&&(e=JSON.parse(e)),Array.isArray(e))t=e;else{if(!("keys"in e))return Promise.reject(new Error("invalid keystore"));t=e.keys}t=t.map((function(e){return r.add(e)}));var n=Promise.all(t);return n=n.then((function(){return r}))},f.isKey=function(e){return!!e&&("object"==typeof e&&(!!f.isKeyStore(e.keystore)&&("string"==typeof e.kty&&"number"==typeof e.length&&"function"==typeof e.algorithms&&"function"==typeof e.supports&&"function"==typeof e.encrypt&&"function"==typeof e.decrypt&&"function"==typeof e.wrap&&"function"==typeof e.unwrap&&"function"==typeof e.sign&&"function"==typeof e.verify)))},f.createKey=function(e,t,r){return f.createKeyStore().generate(e,t,r)},f.asKey=function(e,t,r){return f.isKey(e)?Promise.resolve(e):e=f.createKeyStore().add(e,t,r)},e.exports={KeyRegistry:u,KeyStore:f,registry:c}},9170:(e,t,r)=>{"use strict";
199
199
  /*!
200
200
  * jwk/octkey.js - Symmetric Octet Key Representation
201
201
  *
202
202
  * Copyright (c) 2015 Cisco Systems, Inc. See LICENSE file.
203
- */var n=r(4237),i={BaseKey:r(7136),helpers:r(9684)},a=["HS256","HS384","HS512"],o=["A128GCM","A192GCM","A256GCM","A128CBC-HS256","A192CBC-HS384","A256CBC-HS512","A128CBC+HS256","A192CBC+HS384","A256CBC+HS512"],s=["A128KW","A192KW","A256KW","A128GCMKW","A192GCMKW","A256GCMKW","PBES2-HS256+A128KW","PBES2-HS384+A192KW","PBES2-HS512+A256KW","dir"];function u(e,t){return"iv"in t&&(t.iv=Buffer.isBuffer(t.iv)?t.iv:n.base64url.decode(t.iv||"")),"adata"in t&&(t.adata=Buffer.isBuffer(t.adata)?t.adata:Buffer.from(t.adata||"","utf8")),"mac"in t&&(t.mac=Buffer.isBuffer(t.mac)?t.mac:n.base64url.decode(t.mac||"")),"tag"in t&&(t.tag=Buffer.isBuffer(t.tag)?t.tag:n.base64url.decode(t.tag||"")),t}function c(e,t){return"iv"in t&&(t.iv=Buffer.isBuffer(t.iv)?t.iv:n.base64url.decode(t.iv||"")),"adata"in t&&(t.adata=Buffer.isBuffer(t.adata)?t.adata:Buffer.from(t.adata||"","utf8")),t}var l={publicKey:function(e){var t=i.helpers.COMMON_PROPS.concat([]);return i.helpers.unpackProps(e,t)},privateKey:function(e){var t,r=i.helpers.COMMON_PROPS.concat([{name:"k",type:"binary"}]);return(t=i.helpers.unpackProps(e,r))&&t.k?t.length=8*t.k.length:t=void 0,t},thumbprint:function(e){return e.private&&(e=e.private),{k:e.k||"",kty:"oct"}},algorithms:function(e,t){var r=e.private&&8*e.private.k.length,n=[256,384,512];if(!r)return[];switch(t){case"encrypt":case"decrypt":return o.filter((function(e){return e==="A"+r/2+"CBC-HS"+r||e==="A"+r/2+"CBC+HS"+r||e==="A"+r+"GCM"}));case"sign":case"verify":return a.filter((function(e){var t=!1;return n.forEach((function(n){n>r||(t|=e==="HS"+n)})),t}));case"wrap":case"unwrap":return s.filter((function(e){return e==="A"+r+"KW"||e==="A"+r+"GCMKW"||0===e.indexOf("PBES2-")||"dir"===e}))}return[]},encryptKey:function(e,t){return t.private&&t.private.k},encryptProps:c,decryptKey:function(e,t){return t.private&&t.private.k},decryptProps:u,wrapKey:function(e,t){return t.private&&t.private.k},wrapProps:c,unwrapKey:function(e,t){return t.private&&t.private.k},unwrapProps:u,signKey:function(e,t){return t.private&&t.private.k},verifyKey:function(e,t){return t.private&&t.private.k}},f={kty:"oct",prepare:function(e){var t=l,r=Promise.resolve(e);return r=(r=r.then((function(e){return i.helpers.thumbprint(t,e)}))).then((function(r){var n={};return n[i.helpers.INTERNALS.THUMBPRINT_HASH]=r,e[i.helpers.INTERNALS.THUMBPRINT_KEY]=n,t}))},generate:function(e){var t=n.randomBytes(e/8);return Promise.resolve({k:t})}};e.exports=Object.freeze({config:l,factory:f}),r(4567).registry.register(f)},9746:function(e,t,r){"use strict";
203
+ */var n=r(4237),i={BaseKey:r(7136),helpers:r(9684)},a=["HS256","HS384","HS512"],o=["A128GCM","A192GCM","A256GCM","A128CBC-HS256","A192CBC-HS384","A256CBC-HS512","A128CBC+HS256","A192CBC+HS384","A256CBC+HS512"],s=["A128KW","A192KW","A256KW","A128GCMKW","A192GCMKW","A256GCMKW","PBES2-HS256+A128KW","PBES2-HS384+A192KW","PBES2-HS512+A256KW","dir"];function u(e,t){return"iv"in t&&(t.iv=Buffer.isBuffer(t.iv)?t.iv:n.base64url.decode(t.iv||"")),"adata"in t&&(t.adata=Buffer.isBuffer(t.adata)?t.adata:Buffer.from(t.adata||"","utf8")),"mac"in t&&(t.mac=Buffer.isBuffer(t.mac)?t.mac:n.base64url.decode(t.mac||"")),"tag"in t&&(t.tag=Buffer.isBuffer(t.tag)?t.tag:n.base64url.decode(t.tag||"")),t}function c(e,t){return"iv"in t&&(t.iv=Buffer.isBuffer(t.iv)?t.iv:n.base64url.decode(t.iv||"")),"adata"in t&&(t.adata=Buffer.isBuffer(t.adata)?t.adata:Buffer.from(t.adata||"","utf8")),t}var l={publicKey:function(e){var t=i.helpers.COMMON_PROPS.concat([]);return i.helpers.unpackProps(e,t)},privateKey:function(e){var t,r=i.helpers.COMMON_PROPS.concat([{name:"k",type:"binary"}]);return(t=i.helpers.unpackProps(e,r))&&t.k?t.length=8*t.k.length:t=void 0,t},thumbprint:function(e){return e.private&&(e=e.private),{k:e.k||"",kty:"oct"}},algorithms:function(e,t){var r=e.private&&8*e.private.k.length,n=[256,384,512];if(!r)return[];switch(t){case"encrypt":case"decrypt":return o.filter((function(e){return e==="A"+r/2+"CBC-HS"+r||e==="A"+r/2+"CBC+HS"+r||e==="A"+r+"GCM"}));case"sign":case"verify":return a.filter((function(e){var t=!1;return n.forEach((function(n){n>r||(t|=e==="HS"+n)})),t}));case"wrap":case"unwrap":return s.filter((function(e){return e==="A"+r+"KW"||e==="A"+r+"GCMKW"||0===e.indexOf("PBES2-")||"dir"===e}))}return[]},encryptKey:function(e,t){return t.private&&t.private.k},encryptProps:c,decryptKey:function(e,t){return t.private&&t.private.k},decryptProps:u,wrapKey:function(e,t){return t.private&&t.private.k},wrapProps:c,unwrapKey:function(e,t){return t.private&&t.private.k},unwrapProps:u,signKey:function(e,t){return t.private&&t.private.k},verifyKey:function(e,t){return t.private&&t.private.k}},f={kty:"oct",prepare:function(e){var t=l,r=Promise.resolve(e);return r=(r=r.then((function(e){return i.helpers.thumbprint(t,e)}))).then((function(r){var n={};return n[i.helpers.INTERNALS.THUMBPRINT_HASH]=r,e[i.helpers.INTERNALS.THUMBPRINT_KEY]=n,t}))},generate:function(e){var t=n.randomBytes(e/8);return Promise.resolve({k:t})}};e.exports=Object.freeze({config:l,factory:f}),r(4567).registry.register(f)},9746:(e,t,r)=>{"use strict";
204
204
  /*!
205
205
  * jwk/rsa.js - RSA Key Representation
206
206
  *
207
207
  * Copyright (c) 2015 Cisco Systems, Inc. See LICENSE file.
208
- */var n=r(1194),i=r(8501),a=r(3748).nodeCrypto,o={BaseKey:r(7136),helpers:r(9684)},s=["RS256","RS384","RS512","PS256","PS384","PS512"],u=["RSA-OAEP","RSA-OAEP-256","RSA1_5"],c={publicKey:function(e){var t,r=o.helpers.COMMON_PROPS.concat([{name:"n",type:"binary"},{name:"e",type:"binary"}]);return(t=o.helpers.unpackProps(e,r))&&t.n&&t.e?t.length=8*t.n.length:(delete t.e,delete t.n),t},privateKey:function(e){var t,r=o.helpers.COMMON_PROPS.concat([{name:"n",type:"binary"},{name:"e",type:"binary"},{name:"d",type:"binary"},{name:"p",type:"binary"},{name:"q",type:"binary"},{name:"dp",type:"binary"},{name:"dq",type:"binary"},{name:"qi",type:"binary"}]);return(t=o.helpers.unpackProps(e,r))&&t.d&&t.n&&t.e&&t.p&&t.q&&t.dp&&t.dq&&t.qi?t.length=8*t.d.length:t=void 0,t},thumbprint:function(e){return e.public&&(e=e.public),{e:e.e,kty:"RSA",n:e.n}},algorithms:function(e,t){switch(t){case"encrypt":case"decrypt":return[];case"wrap":return e.public&&u.slice()||[];case"unwrap":return e.private&&u.slice()||[];case"sign":return e.private&&s.slice()||[];case"verify":return e.public&&s.slice()||[]}return[]},wrapKey:function(e,t){return t.public},unwrapKey:function(e,t){return t.private},signKey:function(e,t){return t.private},verifyKey:function(e,t){return t.public},convertToPEM:function(e,t){var r=i.convertToForge(e,!t);return t?n.pki.privateKeyToPem(r):n.pki.publicKeyToPem(r)}};var l={oid:"1.2.840.113549.1.1.1",privateKey:{name:"RSAPrivateKey",tagClass:n.asn1.Class.UNIVERSAL,type:n.asn1.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPrivateKey.version",tagClass:n.asn1.Class.UNIVERSAL,type:n.asn1.Type.INTEGER,constructed:!1,capture:"version"},{name:"RSAPrivateKey.modulus",tagClass:n.asn1.Class.UNIVERSAL,type:n.asn1.Type.INTEGER,constructed:!1,capture:"n"},{name:"RSAPrivateKey.publicExponent",tagClass:n.asn1.Class.UNIVERSAL,type:n.asn1.Type.INTEGER,constructed:!1,capture:"e"},{name:"RSAPrivateKey.privateExponent",tagClass:n.asn1.Class.UNIVERSAL,type:n.asn1.Type.INTEGER,constructed:!1,capture:"d"},{name:"RSAPrivateKey.prime1",tagClass:n.asn1.Class.UNIVERSAL,type:n.asn1.Type.INTEGER,constructed:!1,capture:"p"},{name:"RSAPrivateKey.prime2",tagClass:n.asn1.Class.UNIVERSAL,type:n.asn1.Type.INTEGER,constructed:!1,capture:"q"},{name:"RSAPrivateKey.exponent1",tagClass:n.asn1.Class.UNIVERSAL,type:n.asn1.Type.INTEGER,constructed:!1,capture:"dp"},{name:"RSAPrivateKey.exponent2",tagClass:n.asn1.Class.UNIVERSAL,type:n.asn1.Type.INTEGER,constructed:!1,capture:"dq"},{name:"RSAPrivateKey.coefficient",tagClass:n.asn1.Class.UNIVERSAL,type:n.asn1.Type.INTEGER,constructed:!1,capture:"qi"}]},publicKey:{name:"RSAPublicKey",tagClass:n.asn1.Class.UNIVERSAL,type:n.asn1.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPublicKey.modulus",tagClass:n.asn1.Class.UNIVERSAL,type:n.asn1.Type.INTEGER,constructed:!1,capture:"n"},{name:"RSAPublicKey.exponent",tagClass:n.asn1.Class.UNIVERSAL,type:n.asn1.Type.INTEGER,constructed:!1,capture:"e"}]}},f={kty:"RSA",validators:l,prepare:function(e){var t=c,r=Promise.resolve(e);return r=(r=r.then((function(e){return o.helpers.thumbprint(t,e)}))).then((function(r){var n={};return n[o.helpers.INTERNALS.THUMBPRINT_HASH]=r,e[o.helpers.INTERNALS.THUMBPRINT_KEY]=n,t}))},generate:function(e){var t;if(a)t=new Promise((function(t,r){n.pki.rsa.generateKeyPair({bits:e,e:65537},(function(e,n){if(e)return r(e);t(n.privateKey)}))}));else{var r=n.pki.rsa.generateKeyPair({bits:e,e:65537});t=Promise.resolve(r.privateKey)}return t.then((function(e){var t={};return["e","n","d","p","q",{incoming:"dP",outgoing:"dp"},{incoming:"dQ",outgoing:"dq"},{incoming:"qInv",outgoing:"qi"}].forEach((function(r){var n,i,a;"string"==typeof r?n=i=r:(n=r.incoming,i=r.outgoing),n in e&&(t[i]=((a=(a=e[n]).toString(16)).length%2&&(a="0"+a),Buffer.from(a,"hex")))})),t}))},import:function(e){if(l.oid!==e.keyOid)return null;if(!e.parsed){"string"==typeof e.keyValue?e.keyValue=n.asn1.fromDer(e.keyValue):Array.isArray(e.keyValue)&&(e.keyValue=e.keyValue[0]);var t="private"===e.type?l.privateKey:l.publicKey,r={};if(!n.asn1.validate(e.keyValue,t,r,[]))return null;e=r}var i={kty:"RSA"};return["n","e","d","p","q","dp","dq","qi"].forEach((function(t){if(t in e){var r=Buffer.from(e[t],"binary");0===r[0]&&(r=r.slice(1)),i[t]=r}})),i}};e.exports=Object.freeze({config:c,factory:f}),r(4567).registry.register(f)},3206:function(e){"use strict";
208
+ */var n=r(1194),i=r(8501),a=r(3748).nodeCrypto,o={BaseKey:r(7136),helpers:r(9684)},s=["RS256","RS384","RS512","PS256","PS384","PS512"],u=["RSA-OAEP","RSA-OAEP-256","RSA1_5"],c={publicKey:function(e){var t,r=o.helpers.COMMON_PROPS.concat([{name:"n",type:"binary"},{name:"e",type:"binary"}]);return(t=o.helpers.unpackProps(e,r))&&t.n&&t.e?t.length=8*t.n.length:(delete t.e,delete t.n),t},privateKey:function(e){var t,r=o.helpers.COMMON_PROPS.concat([{name:"n",type:"binary"},{name:"e",type:"binary"},{name:"d",type:"binary"},{name:"p",type:"binary"},{name:"q",type:"binary"},{name:"dp",type:"binary"},{name:"dq",type:"binary"},{name:"qi",type:"binary"}]);return(t=o.helpers.unpackProps(e,r))&&t.d&&t.n&&t.e&&t.p&&t.q&&t.dp&&t.dq&&t.qi?t.length=8*t.d.length:t=void 0,t},thumbprint:function(e){return e.public&&(e=e.public),{e:e.e,kty:"RSA",n:e.n}},algorithms:function(e,t){switch(t){case"encrypt":case"decrypt":return[];case"wrap":return e.public&&u.slice()||[];case"unwrap":return e.private&&u.slice()||[];case"sign":return e.private&&s.slice()||[];case"verify":return e.public&&s.slice()||[]}return[]},wrapKey:function(e,t){return t.public},unwrapKey:function(e,t){return t.private},signKey:function(e,t){return t.private},verifyKey:function(e,t){return t.public},convertToPEM:function(e,t){var r=i.convertToForge(e,!t);return t?n.pki.privateKeyToPem(r):n.pki.publicKeyToPem(r)}};var l={oid:"1.2.840.113549.1.1.1",privateKey:{name:"RSAPrivateKey",tagClass:n.asn1.Class.UNIVERSAL,type:n.asn1.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPrivateKey.version",tagClass:n.asn1.Class.UNIVERSAL,type:n.asn1.Type.INTEGER,constructed:!1,capture:"version"},{name:"RSAPrivateKey.modulus",tagClass:n.asn1.Class.UNIVERSAL,type:n.asn1.Type.INTEGER,constructed:!1,capture:"n"},{name:"RSAPrivateKey.publicExponent",tagClass:n.asn1.Class.UNIVERSAL,type:n.asn1.Type.INTEGER,constructed:!1,capture:"e"},{name:"RSAPrivateKey.privateExponent",tagClass:n.asn1.Class.UNIVERSAL,type:n.asn1.Type.INTEGER,constructed:!1,capture:"d"},{name:"RSAPrivateKey.prime1",tagClass:n.asn1.Class.UNIVERSAL,type:n.asn1.Type.INTEGER,constructed:!1,capture:"p"},{name:"RSAPrivateKey.prime2",tagClass:n.asn1.Class.UNIVERSAL,type:n.asn1.Type.INTEGER,constructed:!1,capture:"q"},{name:"RSAPrivateKey.exponent1",tagClass:n.asn1.Class.UNIVERSAL,type:n.asn1.Type.INTEGER,constructed:!1,capture:"dp"},{name:"RSAPrivateKey.exponent2",tagClass:n.asn1.Class.UNIVERSAL,type:n.asn1.Type.INTEGER,constructed:!1,capture:"dq"},{name:"RSAPrivateKey.coefficient",tagClass:n.asn1.Class.UNIVERSAL,type:n.asn1.Type.INTEGER,constructed:!1,capture:"qi"}]},publicKey:{name:"RSAPublicKey",tagClass:n.asn1.Class.UNIVERSAL,type:n.asn1.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPublicKey.modulus",tagClass:n.asn1.Class.UNIVERSAL,type:n.asn1.Type.INTEGER,constructed:!1,capture:"n"},{name:"RSAPublicKey.exponent",tagClass:n.asn1.Class.UNIVERSAL,type:n.asn1.Type.INTEGER,constructed:!1,capture:"e"}]}},f={kty:"RSA",validators:l,prepare:function(e){var t=c,r=Promise.resolve(e);return r=(r=r.then((function(e){return o.helpers.thumbprint(t,e)}))).then((function(r){var n={};return n[o.helpers.INTERNALS.THUMBPRINT_HASH]=r,e[o.helpers.INTERNALS.THUMBPRINT_KEY]=n,t}))},generate:function(e){var t;if(a)t=new Promise((function(t,r){n.pki.rsa.generateKeyPair({bits:e,e:65537},(function(e,n){if(e)return r(e);t(n.privateKey)}))}));else{var r=n.pki.rsa.generateKeyPair({bits:e,e:65537});t=Promise.resolve(r.privateKey)}return t.then((function(e){var t={};return["e","n","d","p","q",{incoming:"dP",outgoing:"dp"},{incoming:"dQ",outgoing:"dq"},{incoming:"qInv",outgoing:"qi"}].forEach((function(r){var n,i,a;"string"==typeof r?n=i=r:(n=r.incoming,i=r.outgoing),n in e&&(t[i]=((a=(a=e[n]).toString(16)).length%2&&(a="0"+a),Buffer.from(a,"hex")))})),t}))},import:function(e){if(l.oid!==e.keyOid)return null;if(!e.parsed){"string"==typeof e.keyValue?e.keyValue=n.asn1.fromDer(e.keyValue):Array.isArray(e.keyValue)&&(e.keyValue=e.keyValue[0]);var t="private"===e.type?l.privateKey:l.publicKey,r={};if(!n.asn1.validate(e.keyValue,t,r,[]))return null;e=r}var i={kty:"RSA"};return["n","e","d","p","q","dp","dq","qi"].forEach((function(t){if(t in e){var r=Buffer.from(e[t],"binary");0===r[0]&&(r=r.slice(1)),i[t]=r}})),i}};e.exports=Object.freeze({config:c,factory:f}),r(4567).registry.register(f)},3206:e=>{"use strict";
209
209
  /*!
210
210
  * jws/defaults.js - Defaults for JWSs
211
211
  *
212
212
  * Copyright (c) 2015 Cisco Systems, Inc. See LICENSE file.
213
- */e.exports={compact:!1,protect:"*"}},7286:function(e){"use strict";
213
+ */e.exports={compact:!1,protect:"*"}},7286:e=>{"use strict";
214
214
  /*!
215
215
  * jws/helpers.js - JWS Internal Helper Functions
216
216
  *
217
217
  * Copyright (c) 2015 Cisco Systems, Inc. See LICENSE file.
218
- */e.exports={slice:function(e,t){return Array.prototype.slice.call(e,t||0)}}},2109:function(e,t,r){"use strict";
218
+ */e.exports={slice:function(e,t){return Array.prototype.slice.call(e,t||0)}}},2109:(e,t,r)=>{"use strict";
219
219
  /*!
220
220
  * jws/index.js - JSON Web Signature (JWS) Entry Point
221
221
  *
222
222
  * Copyright (c) 2015 Cisco Systems, Inc. See LICENSE file.
223
- */var n={createSign:r(4873).createSign,createVerify:r(8747).createVerify};e.exports=n},4873:function(e,t,r){"use strict";
223
+ */var n={createSign:r(4873).createSign,createVerify:r(8747).createVerify};e.exports=n},4873:(e,t,r)=>{"use strict";
224
224
  /*!
225
225
  * jws/sign.js - Sign to JWS
226
226
  *
227
227
  * Copyright (c) 2015 Cisco Systems, Inc. See LICENSE file.
228
- */var n=r(5029),i=r(4237),a=r(2543),o=r(7286).slice,s=r(6678),u=r(4908),c=r(3206),l=function(e,t){var r=!1,n=e.format||"general",a=Buffer.alloc(0);Object.defineProperty(this,"compact",{get:function(){return"compact"===n},enumerable:!0}),Object.defineProperty(this,"format",{get:function(){return n},enumerable:!0}),Object.defineProperty(this,"update",{value:function(e,t){if(r)throw new Error("already final");return null!=e&&(e=i.asBuffer(e,t),a=a.length?Buffer.concat([a,e],a.length+e.length):e),this}}),Object.defineProperty(this,"final",{value:function(e,o){if(r)return Promise.reject(new Error("already final"));var u;switch(this.update(e,o),r=!0,u=(u=(u=Promise.all(t)).then((function(e){return a=i.base64url.encode(a),e=e.map((function(e){var t={},r=0,n=s(e.header),o=Object.keys(n).length;e.protected.forEach((function(e){e in n&&(t[e]=n[e],r++,delete n[e],o--)})),r>0?(t=JSON.stringify(t),t=i.base64url.encode(t)):t="";var u=Buffer.from(t+"."+a,"ascii");return e=(e=e.key.sign(e.header.alg,u,e.header)).then((function(e){var a={};return 0<r&&(a.protected=t),0<o&&(a.header=n),a.signature=i.base64url.encode(e.mac),a}))})),e=[Promise.resolve(a)].concat(e),Promise.all(e)}))).then((function(e){return{payload:e[0],signatures:e.slice(1)}})),n){case"compact":u=u.then((function(e){var t=[e.signatures[0].protected,e.payload,e.signatures[0].signature];return t=t.join(".")}));break;case"flattened":u=u.then((function(e){var t={};t.payload=e.payload;var r=e.signatures[0];return r.protected&&(t.protected=r.protected),r.header&&(t.header=r.header),t.signature=r.signature,t}))}return u}})};e.exports={signer:l,createSign:function(e,t){var r=e,i=1,f=t;if(0===arguments.length)throw new Error("at least one signatory must be provided");1===arguments.length||a.isKey(e)||e&&"kty"in e||e&&"key"in e&&(a.isKey(e.key)||"kty"in e.key)?(f=e,i=0,r={}):r=s(e),Array.isArray(f)||(f=o(arguments,i));var h=(r=n(s(c),r)).fields||{},p=r.format;if(p||(p=r.compact?"compact":"general"),("compact"===p||"flattened"===p)&&1<f.length)throw new Error("too many signatories for compact or flattened JSON serialization");var d="*"===r.protect;r.compact&&(d=!0),f=f.map((function(e,t){return(e&&"kty"in e?a.asKey(e).then((function(e){return{key:e}})):e?a.asKey(e.key).then((function(t){return{header:e.header,reference:e.reference,protect:e.protect,key:t}})):Promise.reject(new Error("missing key for signatory "+t))).then((function(e){var t=e.key,r=e.header||{};r=n(n({},h),r),e.header=r,r.alg||(r.alg=t.algorithms(a.MODE_SIGN)[0]||"");var i,o=e.reference;if(delete e.reference,void 0===o?o=(o=["kid","jku","x5c","x5t","x5u"].some((function(e){return e in r})))?null:"kid":"boolean"==typeof o&&(o=o?"kid":null),o)if(i=t.toJSON(),"jwk"===o){if("oct"===t.kty)return Promise.reject(new Error("cannot embed key"));r.jwk=i}else o in i&&(r[o]=i[o]);var s=e.protect;if(d||"*"===s)s=Object.keys(r);else if("string"===s)s=[s];else if(Array.isArray(s))s=s.concat();else{if(s)return Promise.reject(new Error("protect must be a list of fields"));s=[]}return s=u(s),e.protected=s,e=Object.freeze(e)}))}));var y={format:p};return new l(y,f)}}},8747:function(e,t,r){"use strict";
228
+ */var n=r(5029),i=r(4237),a=r(2543),o=r(7286).slice,s=r(6678),u=r(4908),c=r(3206),l=function(e,t){var r=!1,n=e.format||"general",a=Buffer.alloc(0);Object.defineProperty(this,"compact",{get:function(){return"compact"===n},enumerable:!0}),Object.defineProperty(this,"format",{get:function(){return n},enumerable:!0}),Object.defineProperty(this,"update",{value:function(e,t){if(r)throw new Error("already final");return null!=e&&(e=i.asBuffer(e,t),a=a.length?Buffer.concat([a,e],a.length+e.length):e),this}}),Object.defineProperty(this,"final",{value:function(e,o){if(r)return Promise.reject(new Error("already final"));var u;switch(this.update(e,o),r=!0,u=(u=(u=Promise.all(t)).then((function(e){return a=i.base64url.encode(a),e=e.map((function(e){var t={},r=0,n=s(e.header),o=Object.keys(n).length;e.protected.forEach((function(e){e in n&&(t[e]=n[e],r++,delete n[e],o--)})),r>0?(t=JSON.stringify(t),t=i.base64url.encode(t)):t="";var u=Buffer.from(t+"."+a,"ascii");return e=(e=e.key.sign(e.header.alg,u,e.header)).then((function(e){var a={};return 0<r&&(a.protected=t),0<o&&(a.header=n),a.signature=i.base64url.encode(e.mac),a}))})),e=[Promise.resolve(a)].concat(e),Promise.all(e)}))).then((function(e){return{payload:e[0],signatures:e.slice(1)}})),n){case"compact":u=u.then((function(e){var t=[e.signatures[0].protected,e.payload,e.signatures[0].signature];return t=t.join(".")}));break;case"flattened":u=u.then((function(e){var t={};t.payload=e.payload;var r=e.signatures[0];return r.protected&&(t.protected=r.protected),r.header&&(t.header=r.header),t.signature=r.signature,t}))}return u}})};e.exports={signer:l,createSign:function(e,t){var r=e,i=1,f=t;if(0===arguments.length)throw new Error("at least one signatory must be provided");1===arguments.length||a.isKey(e)||e&&"kty"in e||e&&"key"in e&&(a.isKey(e.key)||"kty"in e.key)?(f=e,i=0,r={}):r=s(e),Array.isArray(f)||(f=o(arguments,i));var h=(r=n(s(c),r)).fields||{},p=r.format;if(p||(p=r.compact?"compact":"general"),("compact"===p||"flattened"===p)&&1<f.length)throw new Error("too many signatories for compact or flattened JSON serialization");var d="*"===r.protect;r.compact&&(d=!0),f=f.map((function(e,t){return(e&&"kty"in e?a.asKey(e).then((function(e){return{key:e}})):e?a.asKey(e.key).then((function(t){return{header:e.header,reference:e.reference,protect:e.protect,key:t}})):Promise.reject(new Error("missing key for signatory "+t))).then((function(e){var t=e.key,r=e.header||{};r=n(n({},h),r),e.header=r,r.alg||(r.alg=t.algorithms(a.MODE_SIGN)[0]||"");var i,o=e.reference;if(delete e.reference,void 0===o?o=(o=["kid","jku","x5c","x5t","x5u"].some((function(e){return e in r})))?null:"kid":"boolean"==typeof o&&(o=o?"kid":null),o)if(i=t.toJSON(),"jwk"===o){if("oct"===t.kty)return Promise.reject(new Error("cannot embed key"));r.jwk=i}else o in i&&(r[o]=i[o]);var s=e.protect;if(d||"*"===s)s=Object.keys(r);else if("string"===s)s=[s];else if(Array.isArray(s))s=s.concat();else{if(s)return Promise.reject(new Error("protect must be a list of fields"));s=[]}return s=u(s),e.protected=s,e=Object.freeze(e)}))}));var y={format:p};return new l(y,f)}}},8747:(e,t,r)=>{"use strict";
229
229
  /*!
230
230
  * jws/verify.js - Verifies from a JWS
231
231
  *
232
232
  * Copyright (c) 2015 Cisco Systems, Inc. See LICENSE file.
233
- */var n=r(6678),i=r(5029),a=r(9752),o=r(3171),s=r(2543),u={algorithms:"*",allowEmbeddedKey:!1},c=function(e,t){var r,c;c=s.isKey(e)?(r=e).keystore:s.isKeyStore(e)?e:s.createKeyStore(),t=i(u,t),Object.defineProperty(this,"defaultKey",{value:r||void 0,enumerable:!0}),Object.defineProperty(this,"keystore",{value:c,enumerable:!0}),Object.defineProperty(this,"verify",{value:function(e,u){var l=(u=i({},t,u||{})).handlers||{},f=Object.keys(l),h=new o(u.algorithms);if("string"==typeof e)e={payload:(e=e.split("."))[1],signatures:[{protected:e[0],signature:e[2]}]};else if(!e||"object"!=typeof e)throw new Error("invalid input");e.signature&&(e.signatures=[{protected:e.protected||void 0,header:e.header||void 0,signature:e.signature}]);var p=e.signatures||[{}];p=p.map((function(e){var t=n(e.header||{}),r=e.protected?JSON.parse(a.decode(e.protected,"utf8")):{};t=i(t,r);var o=a.decode(e.signature);if(!h.match(t.alg))return Promise.reject(new Error("Algorithm not allowed: "+t.alg));var s=r.crit;if(s){if(!Array.isArray(s))return Promise.reject(new Error("Invalid 'crit' header"));for(var u=0;s.length>u;u++)if(-1===f.indexOf(s[u]))return Promise.reject(new Error("Critical extension is not supported: "+s[u]))}return r=Object.keys(r),Promise.resolve({protected:r,aad:e.protected||"",header:t,signature:o})}));var d=Promise.all(p);return d=d.then((function(t){return new Promise((function(n,o){var h=function(){var p=t.shift();if(p){p=i({},p,{payload:e.payload});var d=Promise.resolve(p);(d=(d=(d=(d=(d=(d=d.then((function(e){var t;return u.allowEmbeddedKey&&e.header.jwk?t=s.asKey(e.header.jwk):u.allowEmbeddedKey&&e.header.x5c?(t=e.header.x5c[0],t=Buffer.from(t,"base64"),t=s.asKey(t,"pkix")):t=Promise.resolve(r||c.get({use:"sig",alg:e.header.alg,kid:e.header.kid})),t.then((function(t){return t?(e.key=t,e):Promise.reject(new Error("key does not match"))}))}))).then((function(e){var t=[];return f.forEach((function(r){var n;"function"==typeof(r=l[r])?n=r(e):"object"==typeof r&&"function"==typeof r.prepare&&(n=r.prepare(e)),n&&t.push(Promise.resolve(n))})),Promise.all(t).then((function(){return e}))}))).then((function(e){var t=e.aad||"",r=e.payload||"",n=Buffer.alloc(1+t.length+r.length),i=0;return n.write(t,i,"ascii"),i+=t.length,n.write(".",i,"ascii"),i++,Buffer.isBuffer(r)?r.copy(n,i):n.write(r,i,"binary"),e.content=n,e}))).then((function(e){return e.key.verify(e.header.alg,e.content,e.signature)}))).then((function(e){var t=p.payload;return t=a.decode(t),{protected:p.protected,header:p.header,payload:t,signature:e.mac,key:p.key}}))).then((function(e){var t=[];return f.forEach((function(r){var n;"object"==typeof(r=l[r])&&"function"==typeof r.complete&&(n=r.complete(e)),n&&t.push(Promise.resolve(n))})),Promise.all(t).then((function(){return e}))}))).then(n,h)}else o(new Error("no key found"))};h()}))}))}})};e.exports={verifier:c,createVerify:function(e,t){return new c(e,t)}}},2393:function(e,t,r){"use strict";
233
+ */var n=r(6678),i=r(5029),a=r(9752),o=r(3171),s=r(2543),u={algorithms:"*",allowEmbeddedKey:!1},c=function(e,t){var r,c;c=s.isKey(e)?(r=e).keystore:s.isKeyStore(e)?e:s.createKeyStore(),t=i(u,t),Object.defineProperty(this,"defaultKey",{value:r||void 0,enumerable:!0}),Object.defineProperty(this,"keystore",{value:c,enumerable:!0}),Object.defineProperty(this,"verify",{value:function(e,u){var l=(u=i({},t,u||{})).handlers||{},f=Object.keys(l),h=new o(u.algorithms);if("string"==typeof e)e={payload:(e=e.split("."))[1],signatures:[{protected:e[0],signature:e[2]}]};else if(!e||"object"!=typeof e)throw new Error("invalid input");e.signature&&(e.signatures=[{protected:e.protected||void 0,header:e.header||void 0,signature:e.signature}]);var p=e.signatures||[{}];p=p.map((function(e){var t=n(e.header||{}),r=e.protected?JSON.parse(a.decode(e.protected,"utf8")):{};t=i(t,r);var o=a.decode(e.signature);if(!h.match(t.alg))return Promise.reject(new Error("Algorithm not allowed: "+t.alg));var s=r.crit;if(s){if(!Array.isArray(s))return Promise.reject(new Error("Invalid 'crit' header"));for(var u=0;s.length>u;u++)if(-1===f.indexOf(s[u]))return Promise.reject(new Error("Critical extension is not supported: "+s[u]))}return r=Object.keys(r),Promise.resolve({protected:r,aad:e.protected||"",header:t,signature:o})}));var d=Promise.all(p);return d=d.then((function(t){return new Promise((function(n,o){var h=function(){var p=t.shift();if(p){p=i({},p,{payload:e.payload});var d=Promise.resolve(p);(d=(d=(d=(d=(d=(d=d.then((function(e){var t;return u.allowEmbeddedKey&&e.header.jwk?t=s.asKey(e.header.jwk):u.allowEmbeddedKey&&e.header.x5c?(t=e.header.x5c[0],t=Buffer.from(t,"base64"),t=s.asKey(t,"pkix")):t=Promise.resolve(r||c.get({use:"sig",alg:e.header.alg,kid:e.header.kid})),t.then((function(t){return t?(e.key=t,e):Promise.reject(new Error("key does not match"))}))}))).then((function(e){var t=[];return f.forEach((function(r){var n;"function"==typeof(r=l[r])?n=r(e):"object"==typeof r&&"function"==typeof r.prepare&&(n=r.prepare(e)),n&&t.push(Promise.resolve(n))})),Promise.all(t).then((function(){return e}))}))).then((function(e){var t=e.aad||"",r=e.payload||"",n=Buffer.alloc(1+t.length+r.length),i=0;return n.write(t,i,"ascii"),i+=t.length,n.write(".",i,"ascii"),i++,Buffer.isBuffer(r)?r.copy(n,i):n.write(r,i,"binary"),e.content=n,e}))).then((function(e){return e.key.verify(e.header.alg,e.content,e.signature)}))).then((function(e){var t=p.payload;return t=a.decode(t),{protected:p.protected,header:p.header,payload:t,signature:e.mac,key:p.key}}))).then((function(e){var t=[];return f.forEach((function(r){var n;"object"==typeof(r=l[r])&&"function"==typeof r.complete&&(n=r.complete(e)),n&&t.push(Promise.resolve(n))})),Promise.all(t).then((function(){return e}))}))).then(n,h)}else o(new Error("no key found"))};h()}))}))}})};e.exports={verifier:c,createVerify:function(e,t){return new c(e,t)}}},2393:(e,t,r)=>{"use strict";
234
234
  /*!
235
235
  * parse/compact.js - JOSE Compact Serialization Parser
236
236
  *
237
237
  * Copyright (c) 2015 Cisco Systems, Inc. See LICENSE file.
238
- */var n={JWE:r(701),JWS:r(2109),util:r(4237)};e.exports=function(e){var t,r,i,a=e.split(".");if(3===a.length)t="JWS",r=function(t,r){return n.JWS.createVerify(t).verify(e,r)};else{if(5!==a.length)throw new TypeError("invalid jose serialization");t="JWE",r=function(t,r){return n.JWE.createDecrypt(t).decrypt(e,r)}}return i=n.util.base64url.decode(a[0],"utf8"),i=JSON.parse(i),{type:t,format:"compact",input:e,header:i,perform:r}}},8650:function(e,t,r){"use strict";
238
+ */var n={JWE:r(701),JWS:r(2109),util:r(4237)};e.exports=function(e){var t,r,i,a=e.split(".");if(3===a.length)t="JWS",r=function(t,r){return n.JWS.createVerify(t).verify(e,r)};else{if(5!==a.length)throw new TypeError("invalid jose serialization");t="JWE",r=function(t,r){return n.JWE.createDecrypt(t).decrypt(e,r)}}return i=n.util.base64url.decode(a[0],"utf8"),i=JSON.parse(i),{type:t,format:"compact",input:e,header:i,perform:r}}},8650:(e,t,r)=>{"use strict";
239
239
  /*!
240
240
  * parse/index.js - JOSE Parser Entry Point
241
241
  *
242
242
  * Copyright (c) 2015 Cisco Systems, Inc. See LICENSE file.
243
- */var n=r(2393),i=r(4631),a=e.exports=function(e){if(Buffer.isBuffer(e))return n(e.toString("ascii"));if("string"==typeof e)return n(e);if(e)return i(e);throw new TypeError("invalid input")};a.compact=n,a.json=i},4631:function(e,t,r){"use strict";
243
+ */var n=r(2393),i=r(4631),a=e.exports=function(e){if(Buffer.isBuffer(e))return n(e.toString("ascii"));if("string"==typeof e)return n(e);if(e)return i(e);throw new TypeError("invalid input")};a.compact=n,a.json=i},4631:(e,t,r)=>{"use strict";
244
244
  /*!
245
245
  * parse/compact.js - JOSE JSON Serialization Parser
246
246
  *
247
247
  * Copyright (c) 2015 Cisco Systems, Inc. See LICENSE file.
248
- */var n=r(5029),i={JWE:r(701),JWS:r(2109),util:r(4237)};e.exports=function(e){var t,r,a;if("signatures"in e||"signature"in e)t="JWS",r=function(t,r){return i.JWS.createVerify(t).verify(e,r)},a=(a=e.signatures||[{protected:e.protected,header:e.header,signature:e.signature}]).map((function(e){var t,r={};return e.header&&(r=n(r,e.header)),e.protected&&(t=e.protected,t=i.util.base64url.decode(t,"utf8"),t=JSON.parse(t),r=n(r,t)),r}));else if("ciphertext"in e){t="JWE",r=function(t,r){return i.JWE.createDecrypt(t).decrypt(e,r)};var o={};e.protected&&(o.protected=e.protected,o.protected=i.util.base64url.decode(o.protected,"utf8"),o.protected=JSON.parse(o.protected)),e.unprotected&&(o.unprotected=e.unprotected),a=(a=e.recipients||[{}]).map((function(e){var t={};return e.header&&(t=n(t,e.header)),o.unprotected&&(t=n(t,o.unprotected)),o.protected&&(t=n(t,o.protected)),t}))}return{type:t,format:"json",input:e,all:a,perform:r}}},3171:function(e){"use strict";
248
+ */var n=r(5029),i={JWE:r(701),JWS:r(2109),util:r(4237)};e.exports=function(e){var t,r,a;if("signatures"in e||"signature"in e)t="JWS",r=function(t,r){return i.JWS.createVerify(t).verify(e,r)},a=(a=e.signatures||[{protected:e.protected,header:e.header,signature:e.signature}]).map((function(e){var t,r={};return e.header&&(r=n(r,e.header)),e.protected&&(t=e.protected,t=i.util.base64url.decode(t,"utf8"),t=JSON.parse(t),r=n(r,t)),r}));else if("ciphertext"in e){t="JWE",r=function(t,r){return i.JWE.createDecrypt(t).decrypt(e,r)};var o={};e.protected&&(o.protected=e.protected,o.protected=i.util.base64url.decode(o.protected,"utf8"),o.protected=JSON.parse(o.protected)),e.unprotected&&(o.unprotected=e.unprotected),a=(a=e.recipients||[{}]).map((function(e){var t={};return e.header&&(t=n(t,e.header)),o.unprotected&&(t=n(t,o.unprotected)),o.protected&&(t=n(t,o.protected)),t}))}return{type:t,format:"json",input:e,all:a,perform:r}}},3171:e=>{"use strict";
249
249
  /*!
250
250
  * util/algconfig.js - Functions for managing algorithm set options
251
251
  *
252
252
  * Copyright (c) 2015 Cisco Systems, Inc. See LICENSE file.
253
- */function t(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}e.exports=function(e){e?"string"==typeof e&&(e=e.split(" ")):e=[];var r,n=[],i=[],a=[],o=[],s=/^(!)?([^*]*)(\*?)([^*]*)$/;e.forEach((function(e){if(e){s.lastIndex=0;var u=s.exec(e);u&&(r="("+function(e,r,n){var i=[];return i.push("^"),e&&(e=t(e),i.push(e)),r&&i.push(e||n?".*":".+"),n&&(n=t(n),i.push(n)),i.push("$"),i.join("")}(u[2],u[3],u[4])+")",u[1]?(o.push(r),i.push(u[0])):(a.push(r),n.push(u[0])))}})),a=a.length?new RegExp(a.join("|")):null,o=o.length?new RegExp(o.join("|")):null,n.length||(n=["*"]),Object.defineProperty(this,"spec",{value:n.join(" ")+" "+i.join(" "),enumerable:!0}),Object.defineProperty(this,"match",{value:function(e){var t=Boolean(e);return t&&a&&(a.lastIndex=0,t=a.test(e)),t&&o&&(o.lastIndex=0,t=!o.test(e)),t}})}},9752:function(e,t,r){"use strict";
253
+ */function t(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}e.exports=function(e){e?"string"==typeof e&&(e=e.split(" ")):e=[];var r,n=[],i=[],a=[],o=[],s=/^(!)?([^*]*)(\*?)([^*]*)$/;e.forEach((function(e){if(e){s.lastIndex=0;var u=s.exec(e);u&&(r="("+function(e,r,n){var i=[];return i.push("^"),e&&(e=t(e),i.push(e)),r&&i.push(e||n?".*":".+"),n&&(n=t(n),i.push(n)),i.push("$"),i.join("")}(u[2],u[3],u[4])+")",u[1]?(o.push(r),i.push(u[0])):(a.push(r),n.push(u[0])))}})),a=a.length?new RegExp(a.join("|")):null,o=o.length?new RegExp(o.join("|")):null,n.length||(n=["*"]),Object.defineProperty(this,"spec",{value:n.join(" ")+" "+i.join(" "),enumerable:!0}),Object.defineProperty(this,"match",{value:function(e){var t=Boolean(e);return t&&a&&(a.lastIndex=0,t=a.test(e)),t&&o&&(o.lastIndex=0,t=!o.test(e)),t}})}},9752:(e,t,r)=>{"use strict";
254
254
  /*!
255
255
  * util/base64url.js - Implementation of web-safe Base64 Encoder/Decoder
256
256
  *
257
257
  * Copyright (c) 2015 Cisco Systems, Inc. See LICENSE file.
258
- */var n=r(5772),i={encode:function(e,t){return e instanceof ArrayBuffer&&(e=new Uint8Array(e)),Buffer.isBuffer(e)||(e=Buffer.from(e,t)),n.encode(e)},decode:n.toBuffer};e.exports=i},4678:function(e,t,r){"use strict";
258
+ */var n=r(5772),i={encode:function(e,t){return e instanceof ArrayBuffer&&(e=new Uint8Array(e)),Buffer.isBuffer(e)||(e=Buffer.from(e,t)),n.encode(e)},decode:n.toBuffer};e.exports=i},4678:(e,t,r)=>{"use strict";
259
259
  /*!
260
260
  * util/databuffer.js - Forge-compatible Buffer based on Node.js Buffers
261
261
  *
262
262
  * Copyright (c) 2015 Cisco Systems, Inc. See LICENSE file.
263
- */var n=r(1194),i=r(9752);function a(e,t){t=t||{},Buffer.isBuffer(e)?this.data=e:n.util.isArrayBuffer(e)?(e=new Uint8Array(e),this.data=Buffer.from(e)):n.util.isArrayBufferView(e)&&(e=new Uint8Array(e.buffer,e.byteOffset,e.byteLength),this.data=Buffer.from(e)),this.data&&(this.write=this.data.length,e=void 0),this.growSize=t.growSize||a.DEFAULT_GROW_SIZE,this.write=this.write||0,this.read=this.read||0,e?this.putBytes(e):this.data||this.accommodate(0),t.readOffset="readOffset"in t?t.readOffset:this.read,this.write="writeOffset"in t?t.writeOffset:this.write,this.read=Math.min(t.readOffset,this.write)}a.DEFAULT_GROW_SIZE=16,a.prototype.length=function(){return this.write-this.read},a.prototype.available=function(){return this.data.length-this.write},a.prototype.isEmpty=function(){return this.length()<=0},a.prototype.accommodate=function(e){if(this.data){if(this.available()<e){e=Math.max(e,this.growSize);var t=this.data,r=Buffer.alloc(t.length+e);t.copy(r,0),this.data=r}}else e=Math.max(this.write+e,this.growSize),this.data=Buffer.alloc(e);return this.data.fill(0,this.write),this},a.prototype.clear=function(){return this.read=this.write=0,this.data=Buffer.alloc(0),this},a.prototype.truncate=function(e){return this.write=this.read+Math.max(0,this.length()-e),this.data.fill(0,this.write),this},a.prototype.compact=function(){return this.read>0&&(this.write===this.read?this.read=this.write=0:(this.data.copy(this.data,0,this.read,this.write),this.write=this.write-this.read,this.read=0),this.data.fill(0,this.write)),this},a.prototype.copy=function(){return new a(this,{readOffset:this.read,writeOffset:this.write,growSize:this.growSize})},a.prototype.equals=function(e){if(!a.isBuffer(e))return!1;if(e.length()!==this.length())return!1;for(var t=!0,r=this.read-e.read,n=e.read;e.write>n;n++)t=t&&this.data[n+r]===e.data[n];return t},a.prototype.at=function(e){return this.data[this.read+e]},a.prototype.setAt=function(e,t){return this.data[this.read+e]=t,this},a.prototype.last=function(){return this.data[this.write-1]},a.prototype.bytes=function(e){var t;if(void 0===e?e=this.length():e&&(e=Math.min(e,this.length())),0===e)t="";else{var r=this.read,n=r+e,i=this.data.slice(r,n);t=String.fromCharCode.apply(null,i)}return t},a.prototype.buffer=function(e){var t;if(void 0===e?e=this.length():e&&(e=Math.min(e,this.length())),0===e)t=new ArrayBuffer(0);else{var r=this.read,n=r+e,i=this.data.slice(r,n);(t=new Uint8Array(n-r)).set(i)}return t},a.prototype.native=function(e){var t;if(void 0===e?e=this.length():e&&(e=Math.min(e,this.length())),0===e)t=Buffer.alloc(0);else{var r=this.read,n=r+e;t=this.data.slice(r,n)}return t},a.prototype.toHex=function(){return this.toString("hex")},a.prototype.toString=function(e){if(0===this.length())return"";var t=this.data.slice(this.read,this.write);switch(e=e||"utf8"){case"raw":return t.toString("binary");case"base64url":return i.encode(t);case"utf16":return t.toString("ucs2");default:return t.toString(e)}},a.prototype.fillWithByte=function(e,t){return t||(t=this.available()),this.accommodate(t),this.data.fill(e,this.write,this.write+t),this.write+=t,this},a.prototype.getBuffer=function(e){var t=this.buffer(e);return this.read+=t.byteLength,t},a.prototype.putBuffer=function(e){return this.putBytes(e)},a.prototype.getBytes=function(e){var t=this.bytes(e);return this.read+=t.length,t},a.prototype.putBytes=function(e,t){if("string"==typeof e){switch(t=t||"binary"){case"utf16":t="ucs-2";break;case"raw":t="binary";break;case"base64url":e=i.decode(e)}Buffer.isBuffer(e)||(e=Buffer.from(e,t))}var r,o;if(e instanceof a){var s=e;e=s.data.slice(s.read,s.write),s.read=s.write}else e instanceof n.util.ByteStringBuffer&&(e=e.getBytes());if(Buffer.isBuffer(e))r=e;else if(Array.isArray(e))r=Buffer.from(e);else if(n.util.isArrayBuffer(e))r=new Uint8Array(e),r=Buffer.from(r);else{if(!n.util.isArrayBufferView(e))throw new TypeError("invalid source type");r=e instanceof Uint8Array?e:new Uint8Array(e.buffer,e.byteOffset,e.byteLength),r=Buffer.from(r)}return this.accommodate(r.length),o=this.data,r.copy(o,this.write),this.write+=r.length,this},a.prototype.getNative=function(e){var t=this.native(e);return this.read+=t.length,t},a.prototype.putNative=a.prototype.putBuffer,a.prototype.getByte=function(){var e=this.data[this.read];return this.read=Math.min(this.read+1,this.write),e},a.prototype.putByte=function(e){return this.accommodate(1),this.data[this.write]=255&e,this.write++,this},a.prototype.getInt16=function(){var e=this.data[this.read]<<8^this.data[this.read+1];return this.read=Math.min(this.read+2,this.write),e},a.prototype.putInt16=function(e){return this.accommodate(2),this.data[this.write]=e>>>8&255,this.data[this.write+1]=255&e,this.write+=2,this},a.prototype.getInt24=function(){var e=this.data[this.read]<<16^this.data[this.read+1]<<8^this.data[this.read+2];return this.read=Math.min(this.read+3,this.write),e},a.prototype.putInt24=function(e){return this.accommodate(3),this.data[this.write]=e>>>16&255,this.data[this.write+1]=e>>>8&255,this.data[this.write+2]=255&e,this.write+=3,this},a.prototype.getInt32=function(){var e=this.data[this.read]<<24^this.data[this.read+1]<<16^this.data[this.read+2]<<8^this.data[this.read+3];return this.read=Math.min(this.read+4,this.write),e},a.prototype.putInt32=function(e){return this.accommodate(4),this.data[this.write]=e>>>24&255,this.data[this.write+1]=e>>>16&255,this.data[this.write+2]=e>>>8&255,this.data[this.write+3]=255&e,this.write+=4,this},a.prototype.getInt16Le=function(){var e=this.data[this.read+1]<<8^this.data[this.read];return this.read=Math.min(this.read+2,this.write),e},a.prototype.putInt16Le=function(e){return this.accommodate(2),this.data[this.write+1]=e>>>8&255,this.data[this.write]=255&e,this.write+=2,this},a.prototype.getInt24Le=function(){var e=this.data[this.read+2]<<16^this.data[this.read+1]<<8^this.data[this.read];return this.read=Math.min(this.read+3,this.write),e},a.prototype.putInt24Le=function(e){return this.accommodate(3),this.data[this.write+2]=e>>>16&255,this.data[this.write+1]=e>>>8&255,this.data[this.write]=255&e,this.write+=3,this},a.prototype.getInt32Le=function(){var e=this.data[this.read+3]<<24^this.data[this.read+2]<<16^this.data[this.read+1]<<8^this.data[this.read];return this.read=Math.min(this.read+4,this.write),e},a.prototype.putInt32Le=function(e){return this.accommodate(4),this.data[this.write+3]=e>>>24&255,this.data[this.write+2]=e>>>16&255,this.data[this.write+1]=e>>>8&255,this.data[this.write]=255&e,this.write+=4,this},a.prototype.getInt=function(e){var t=0;do{t=t<<8|this.getByte(),e-=8}while(e>0);return t},a.prototype.putInt=function(e,t){this.accommodate(Math.ceil(t/8));do{t-=8,this.putByte(e>>t&255)}while(t>0);return this},a.prototype.putSignedInt=function(e,t){return e<0&&(e+=2<<t-1),this.putInt(e,t)},a.prototype.putString=function(e){return this.putBytes(e,"utf16")},a.isBuffer=function(e){return e instanceof a},a.asBuffer=function(e){return a.isBuffer(e)?e:e?new a(e):new a},e.exports=a},4237:function(e,t,r){"use strict";
263
+ */var n=r(1194),i=r(9752);function a(e,t){t=t||{},Buffer.isBuffer(e)?this.data=e:n.util.isArrayBuffer(e)?(e=new Uint8Array(e),this.data=Buffer.from(e)):n.util.isArrayBufferView(e)&&(e=new Uint8Array(e.buffer,e.byteOffset,e.byteLength),this.data=Buffer.from(e)),this.data&&(this.write=this.data.length,e=void 0),this.growSize=t.growSize||a.DEFAULT_GROW_SIZE,this.write=this.write||0,this.read=this.read||0,e?this.putBytes(e):this.data||this.accommodate(0),t.readOffset="readOffset"in t?t.readOffset:this.read,this.write="writeOffset"in t?t.writeOffset:this.write,this.read=Math.min(t.readOffset,this.write)}a.DEFAULT_GROW_SIZE=16,a.prototype.length=function(){return this.write-this.read},a.prototype.available=function(){return this.data.length-this.write},a.prototype.isEmpty=function(){return this.length()<=0},a.prototype.accommodate=function(e){if(this.data){if(this.available()<e){e=Math.max(e,this.growSize);var t=this.data,r=Buffer.alloc(t.length+e);t.copy(r,0),this.data=r}}else e=Math.max(this.write+e,this.growSize),this.data=Buffer.alloc(e);return this.data.fill(0,this.write),this},a.prototype.clear=function(){return this.read=this.write=0,this.data=Buffer.alloc(0),this},a.prototype.truncate=function(e){return this.write=this.read+Math.max(0,this.length()-e),this.data.fill(0,this.write),this},a.prototype.compact=function(){return this.read>0&&(this.write===this.read?this.read=this.write=0:(this.data.copy(this.data,0,this.read,this.write),this.write=this.write-this.read,this.read=0),this.data.fill(0,this.write)),this},a.prototype.copy=function(){return new a(this,{readOffset:this.read,writeOffset:this.write,growSize:this.growSize})},a.prototype.equals=function(e){if(!a.isBuffer(e))return!1;if(e.length()!==this.length())return!1;for(var t=!0,r=this.read-e.read,n=e.read;e.write>n;n++)t=t&&this.data[n+r]===e.data[n];return t},a.prototype.at=function(e){return this.data[this.read+e]},a.prototype.setAt=function(e,t){return this.data[this.read+e]=t,this},a.prototype.last=function(){return this.data[this.write-1]},a.prototype.bytes=function(e){var t;if(void 0===e?e=this.length():e&&(e=Math.min(e,this.length())),0===e)t="";else{var r=this.read,n=r+e,i=this.data.slice(r,n);t=String.fromCharCode.apply(null,i)}return t},a.prototype.buffer=function(e){var t;if(void 0===e?e=this.length():e&&(e=Math.min(e,this.length())),0===e)t=new ArrayBuffer(0);else{var r=this.read,n=r+e,i=this.data.slice(r,n);(t=new Uint8Array(n-r)).set(i)}return t},a.prototype.native=function(e){var t;if(void 0===e?e=this.length():e&&(e=Math.min(e,this.length())),0===e)t=Buffer.alloc(0);else{var r=this.read,n=r+e;t=this.data.slice(r,n)}return t},a.prototype.toHex=function(){return this.toString("hex")},a.prototype.toString=function(e){if(0===this.length())return"";var t=this.data.slice(this.read,this.write);switch(e=e||"utf8"){case"raw":return t.toString("binary");case"base64url":return i.encode(t);case"utf16":return t.toString("ucs2");default:return t.toString(e)}},a.prototype.fillWithByte=function(e,t){return t||(t=this.available()),this.accommodate(t),this.data.fill(e,this.write,this.write+t),this.write+=t,this},a.prototype.getBuffer=function(e){var t=this.buffer(e);return this.read+=t.byteLength,t},a.prototype.putBuffer=function(e){return this.putBytes(e)},a.prototype.getBytes=function(e){var t=this.bytes(e);return this.read+=t.length,t},a.prototype.putBytes=function(e,t){if("string"==typeof e){switch(t=t||"binary"){case"utf16":t="ucs-2";break;case"raw":t="binary";break;case"base64url":e=i.decode(e)}Buffer.isBuffer(e)||(e=Buffer.from(e,t))}var r,o;if(e instanceof a){var s=e;e=s.data.slice(s.read,s.write),s.read=s.write}else e instanceof n.util.ByteStringBuffer&&(e=e.getBytes());if(Buffer.isBuffer(e))r=e;else if(Array.isArray(e))r=Buffer.from(e);else if(n.util.isArrayBuffer(e))r=new Uint8Array(e),r=Buffer.from(r);else{if(!n.util.isArrayBufferView(e))throw new TypeError("invalid source type");r=e instanceof Uint8Array?e:new Uint8Array(e.buffer,e.byteOffset,e.byteLength),r=Buffer.from(r)}return this.accommodate(r.length),o=this.data,r.copy(o,this.write),this.write+=r.length,this},a.prototype.getNative=function(e){var t=this.native(e);return this.read+=t.length,t},a.prototype.putNative=a.prototype.putBuffer,a.prototype.getByte=function(){var e=this.data[this.read];return this.read=Math.min(this.read+1,this.write),e},a.prototype.putByte=function(e){return this.accommodate(1),this.data[this.write]=255&e,this.write++,this},a.prototype.getInt16=function(){var e=this.data[this.read]<<8^this.data[this.read+1];return this.read=Math.min(this.read+2,this.write),e},a.prototype.putInt16=function(e){return this.accommodate(2),this.data[this.write]=e>>>8&255,this.data[this.write+1]=255&e,this.write+=2,this},a.prototype.getInt24=function(){var e=this.data[this.read]<<16^this.data[this.read+1]<<8^this.data[this.read+2];return this.read=Math.min(this.read+3,this.write),e},a.prototype.putInt24=function(e){return this.accommodate(3),this.data[this.write]=e>>>16&255,this.data[this.write+1]=e>>>8&255,this.data[this.write+2]=255&e,this.write+=3,this},a.prototype.getInt32=function(){var e=this.data[this.read]<<24^this.data[this.read+1]<<16^this.data[this.read+2]<<8^this.data[this.read+3];return this.read=Math.min(this.read+4,this.write),e},a.prototype.putInt32=function(e){return this.accommodate(4),this.data[this.write]=e>>>24&255,this.data[this.write+1]=e>>>16&255,this.data[this.write+2]=e>>>8&255,this.data[this.write+3]=255&e,this.write+=4,this},a.prototype.getInt16Le=function(){var e=this.data[this.read+1]<<8^this.data[this.read];return this.read=Math.min(this.read+2,this.write),e},a.prototype.putInt16Le=function(e){return this.accommodate(2),this.data[this.write+1]=e>>>8&255,this.data[this.write]=255&e,this.write+=2,this},a.prototype.getInt24Le=function(){var e=this.data[this.read+2]<<16^this.data[this.read+1]<<8^this.data[this.read];return this.read=Math.min(this.read+3,this.write),e},a.prototype.putInt24Le=function(e){return this.accommodate(3),this.data[this.write+2]=e>>>16&255,this.data[this.write+1]=e>>>8&255,this.data[this.write]=255&e,this.write+=3,this},a.prototype.getInt32Le=function(){var e=this.data[this.read+3]<<24^this.data[this.read+2]<<16^this.data[this.read+1]<<8^this.data[this.read];return this.read=Math.min(this.read+4,this.write),e},a.prototype.putInt32Le=function(e){return this.accommodate(4),this.data[this.write+3]=e>>>24&255,this.data[this.write+2]=e>>>16&255,this.data[this.write+1]=e>>>8&255,this.data[this.write]=255&e,this.write+=4,this},a.prototype.getInt=function(e){var t=0;do{t=t<<8|this.getByte(),e-=8}while(e>0);return t},a.prototype.putInt=function(e,t){this.accommodate(Math.ceil(t/8));do{t-=8,this.putByte(e>>t&255)}while(t>0);return this},a.prototype.putSignedInt=function(e,t){return e<0&&(e+=2<<t-1),this.putInt(e,t)},a.prototype.putString=function(e){return this.putBytes(e,"utf16")},a.isBuffer=function(e){return e instanceof a},a.asBuffer=function(e){return a.isBuffer(e)?e:e?new a(e):new a},e.exports=a},4237:(e,t,r)=>{"use strict";
264
264
  /*!
265
265
  * util/index.js - Utilities Entry Point
266
266
  *
267
267
  * Copyright (c) 2015 Cisco Systems, Inc. See LICENSE file.
268
- */var n,i=r(1194);n={base64url:r(9752),utf8:r(8572),asBuffer:function(e,t){return Buffer.isBuffer(e)?e:"string"==typeof e?"base64url"===(t=t||"binary")?n.base64url.decode(e):Buffer.from(e,t):(i.util.isArrayBufferView(e)?e=e instanceof Uint8Array?e:new Uint8Array(e.buffer,e.byteOffset,e.byteOffset+e.byteLength):i.util.isArrayBuffer(e)&&(e=new Uint8Array(e)),Buffer.from(e))},randomBytes:function(e){return Buffer.from(i.random.getBytes(e),"binary")}},e.exports=n},5029:function(e,t,r){"use strict";
268
+ */var n,i=r(1194);n={base64url:r(9752),utf8:r(8572),asBuffer:function(e,t){return Buffer.isBuffer(e)?e:"string"==typeof e?"base64url"===(t=t||"binary")?n.base64url.decode(e):Buffer.from(e,t):(i.util.isArrayBufferView(e)?e=e instanceof Uint8Array?e:new Uint8Array(e.buffer,e.byteOffset,e.byteOffset+e.byteLength):i.util.isArrayBuffer(e)&&(e=new Uint8Array(e)),Buffer.from(e))},randomBytes:function(e){return Buffer.from(i.random.getBytes(e),"binary")}},e.exports=n},5029:(e,t,r)=>{"use strict";
269
269
  /*!
270
270
  * util/utf8.js - Implementation of UTF-8 Encoder/Decoder
271
271
  *
272
272
  * Copyright (c) 2015 Cisco Systems, Inc. See LICENSE file.
273
- */var n,i=r(5544),a=r(2492),o=(n=[],"undefined"!=typeof Uint8ClampedArray&&n.push(Uint8ClampedArray),"undefined"!=typeof Uint8Array&&n.push(Uint8Array),"undefined"!=typeof Uint16Array&&n.push(Uint16Array),"undefined"!=typeof Uint32Array&&n.push(Uint32Array),"undefined"!=typeof Float32Array&&n.push(Float32Array),"undefined"!=typeof Float64Array&&n.push(Float64Array),n);e.exports=i(a,(function(e,t){if(Buffer.isBuffer(t))t=Buffer.from(t);else{var r=function(e){for(var t,r=0;!t&&o.length>r;r++)e instanceof o[r]&&(t=o[r]);return t}(t);t=r?new r(t,t.byteOffset,t.byteLength):void 0}return t,t}))},8572:function(e,t){"use strict";
273
+ */var n,i=r(5544),a=r(2492),o=(n=[],"undefined"!=typeof Uint8ClampedArray&&n.push(Uint8ClampedArray),"undefined"!=typeof Uint8Array&&n.push(Uint8Array),"undefined"!=typeof Uint16Array&&n.push(Uint16Array),"undefined"!=typeof Uint32Array&&n.push(Uint32Array),"undefined"!=typeof Float32Array&&n.push(Float32Array),"undefined"!=typeof Float64Array&&n.push(Float64Array),n);e.exports=i(a,(function(e,t){if(Buffer.isBuffer(t))t=Buffer.from(t);else{var r=function(e){for(var t,r=0;!t&&o.length>r;r++)e instanceof o[r]&&(t=o[r]);return t}(t);t=r?new r(t,t.byteOffset,t.byteLength):void 0}return t,t}))},8572:(e,t)=>{"use strict";
274
274
  /*!
275
275
  * util/utf8.js - Implementation of UTF-8 Encoder/Decoder
276
276
  *
277
277
  * Copyright (c) 2015 Cisco Systems, Inc. See LICENSE file.
278
- */var r=t;r.encode=function(e){var t=encodeURIComponent(e||"");return t=t.replace(/%([0-9a-fA-F]{2})/g,(function(e,t){return t=parseInt(t,16),String.fromCharCode(t)}))},r.decode=function(e){var t=(e||"").replace(/[\u0080-\u00ff]/g,(function(e){return"%"+(256|e.charCodeAt(0)).toString(16).substring(1)}));return t=decodeURIComponent(t)}},9591:function(e,t,r){"use strict";var n={};(0,r(4236).assign)(n,r(4555),r(8843),r(1619)),e.exports=n},4555:function(e,t,r){"use strict";var n=r(405),i=r(4236),a=r(9373),o=r(8898),s=r(2292),u=Object.prototype.toString;function c(e){if(!(this instanceof c))return new c(e);this.options=i.assign({level:-1,method:8,chunkSize:16384,windowBits:15,memLevel:8,strategy:0,to:""},e||{});var t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new s,this.strm.avail_out=0;var r=n.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(0!==r)throw new Error(o[r]);if(t.header&&n.deflateSetHeader(this.strm,t.header),t.dictionary){var l;if(l="string"==typeof t.dictionary?a.string2buf(t.dictionary):"[object ArrayBuffer]"===u.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,0!==(r=n.deflateSetDictionary(this.strm,l)))throw new Error(o[r]);this._dict_set=!0}}function l(e,t){var r=new c(t);if(r.push(e,!0),r.err)throw r.msg||o[r.err];return r.result}c.prototype.push=function(e,t){var r,o,s=this.strm,c=this.options.chunkSize;if(this.ended)return!1;o=t===~~t?t:!0===t?4:0,"string"==typeof e?s.input=a.string2buf(e):"[object ArrayBuffer]"===u.call(e)?s.input=new Uint8Array(e):s.input=e,s.next_in=0,s.avail_in=s.input.length;do{if(0===s.avail_out&&(s.output=new i.Buf8(c),s.next_out=0,s.avail_out=c),1!==(r=n.deflate(s,o))&&0!==r)return this.onEnd(r),this.ended=!0,!1;0!==s.avail_out&&(0!==s.avail_in||4!==o&&2!==o)||("string"===this.options.to?this.onData(a.buf2binstring(i.shrinkBuf(s.output,s.next_out))):this.onData(i.shrinkBuf(s.output,s.next_out)))}while((s.avail_in>0||0===s.avail_out)&&1!==r);return 4===o?(r=n.deflateEnd(this.strm),this.onEnd(r),this.ended=!0,0===r):2!==o||(this.onEnd(0),s.avail_out=0,!0)},c.prototype.onData=function(e){this.chunks.push(e)},c.prototype.onEnd=function(e){0===e&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},t.Deflate=c,t.deflate=l,t.deflateRaw=function(e,t){return(t=t||{}).raw=!0,l(e,t)},t.gzip=function(e,t){return(t=t||{}).gzip=!0,l(e,t)}},8843:function(e,t,r){"use strict";var n=r(7948),i=r(4236),a=r(9373),o=r(1619),s=r(8898),u=r(2292),c=r(2401),l=Object.prototype.toString;function f(e){if(!(this instanceof f))return new f(e);this.options=i.assign({chunkSize:16384,windowBits:0,to:""},e||{});var t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&0==(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new u,this.strm.avail_out=0;var r=n.inflateInit2(this.strm,t.windowBits);if(r!==o.Z_OK)throw new Error(s[r]);if(this.header=new c,n.inflateGetHeader(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=a.string2buf(t.dictionary):"[object ArrayBuffer]"===l.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(r=n.inflateSetDictionary(this.strm,t.dictionary))!==o.Z_OK))throw new Error(s[r])}function h(e,t){var r=new f(t);if(r.push(e,!0),r.err)throw r.msg||s[r.err];return r.result}f.prototype.push=function(e,t){var r,s,u,c,f,h=this.strm,p=this.options.chunkSize,d=this.options.dictionary,y=!1;if(this.ended)return!1;s=t===~~t?t:!0===t?o.Z_FINISH:o.Z_NO_FLUSH,"string"==typeof e?h.input=a.binstring2buf(e):"[object ArrayBuffer]"===l.call(e)?h.input=new Uint8Array(e):h.input=e,h.next_in=0,h.avail_in=h.input.length;do{if(0===h.avail_out&&(h.output=new i.Buf8(p),h.next_out=0,h.avail_out=p),(r=n.inflate(h,o.Z_NO_FLUSH))===o.Z_NEED_DICT&&d&&(r=n.inflateSetDictionary(this.strm,d)),r===o.Z_BUF_ERROR&&!0===y&&(r=o.Z_OK,y=!1),r!==o.Z_STREAM_END&&r!==o.Z_OK)return this.onEnd(r),this.ended=!0,!1;h.next_out&&(0!==h.avail_out&&r!==o.Z_STREAM_END&&(0!==h.avail_in||s!==o.Z_FINISH&&s!==o.Z_SYNC_FLUSH)||("string"===this.options.to?(u=a.utf8border(h.output,h.next_out),c=h.next_out-u,f=a.buf2string(h.output,u),h.next_out=c,h.avail_out=p-c,c&&i.arraySet(h.output,h.output,u,c,0),this.onData(f)):this.onData(i.shrinkBuf(h.output,h.next_out)))),0===h.avail_in&&0===h.avail_out&&(y=!0)}while((h.avail_in>0||0===h.avail_out)&&r!==o.Z_STREAM_END);return r===o.Z_STREAM_END&&(s=o.Z_FINISH),s===o.Z_FINISH?(r=n.inflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===o.Z_OK):s!==o.Z_SYNC_FLUSH||(this.onEnd(o.Z_OK),h.avail_out=0,!0)},f.prototype.onData=function(e){this.chunks.push(e)},f.prototype.onEnd=function(e){e===o.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},t.Inflate=f,t.inflate=h,t.inflateRaw=function(e,t){return(t=t||{}).raw=!0,h(e,t)},t.ungzip=h},4236:function(e,t){"use strict";var r="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;function n(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.assign=function(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var r=t.shift();if(r){if("object"!=typeof r)throw new TypeError(r+"must be non-object");for(var i in r)n(r,i)&&(e[i]=r[i])}}return e},t.shrinkBuf=function(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)};var i={arraySet:function(e,t,r,n,i){if(t.subarray&&e.subarray)e.set(t.subarray(r,r+n),i);else for(var a=0;a<n;a++)e[i+a]=t[r+a]},flattenChunks:function(e){var t,r,n,i,a,o;for(n=0,t=0,r=e.length;t<r;t++)n+=e[t].length;for(o=new Uint8Array(n),i=0,t=0,r=e.length;t<r;t++)a=e[t],o.set(a,i),i+=a.length;return o}},a={arraySet:function(e,t,r,n,i){for(var a=0;a<n;a++)e[i+a]=t[r+a]},flattenChunks:function(e){return[].concat.apply([],e)}};t.setTyped=function(e){e?(t.Buf8=Uint8Array,t.Buf16=Uint16Array,t.Buf32=Int32Array,t.assign(t,i)):(t.Buf8=Array,t.Buf16=Array,t.Buf32=Array,t.assign(t,a))},t.setTyped(r)},9373:function(e,t,r){"use strict";var n=r(4236),i=!0,a=!0;try{String.fromCharCode.apply(null,[0])}catch(e){i=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){a=!1}for(var o=new n.Buf8(256),s=0;s<256;s++)o[s]=s>=252?6:s>=248?5:s>=240?4:s>=224?3:s>=192?2:1;function u(e,t){if(t<65534&&(e.subarray&&a||!e.subarray&&i))return String.fromCharCode.apply(null,n.shrinkBuf(e,t));for(var r="",o=0;o<t;o++)r+=String.fromCharCode(e[o]);return r}o[254]=o[254]=1,t.string2buf=function(e){var t,r,i,a,o,s=e.length,u=0;for(a=0;a<s;a++)55296==(64512&(r=e.charCodeAt(a)))&&a+1<s&&56320==(64512&(i=e.charCodeAt(a+1)))&&(r=65536+(r-55296<<10)+(i-56320),a++),u+=r<128?1:r<2048?2:r<65536?3:4;for(t=new n.Buf8(u),o=0,a=0;o<u;a++)55296==(64512&(r=e.charCodeAt(a)))&&a+1<s&&56320==(64512&(i=e.charCodeAt(a+1)))&&(r=65536+(r-55296<<10)+(i-56320),a++),r<128?t[o++]=r:r<2048?(t[o++]=192|r>>>6,t[o++]=128|63&r):r<65536?(t[o++]=224|r>>>12,t[o++]=128|r>>>6&63,t[o++]=128|63&r):(t[o++]=240|r>>>18,t[o++]=128|r>>>12&63,t[o++]=128|r>>>6&63,t[o++]=128|63&r);return t},t.buf2binstring=function(e){return u(e,e.length)},t.binstring2buf=function(e){for(var t=new n.Buf8(e.length),r=0,i=t.length;r<i;r++)t[r]=e.charCodeAt(r);return t},t.buf2string=function(e,t){var r,n,i,a,s=t||e.length,c=new Array(2*s);for(n=0,r=0;r<s;)if((i=e[r++])<128)c[n++]=i;else if((a=o[i])>4)c[n++]=65533,r+=a-1;else{for(i&=2===a?31:3===a?15:7;a>1&&r<s;)i=i<<6|63&e[r++],a--;a>1?c[n++]=65533:i<65536?c[n++]=i:(i-=65536,c[n++]=55296|i>>10&1023,c[n++]=56320|1023&i)}return u(c,n)},t.utf8border=function(e,t){var r;for((t=t||e.length)>e.length&&(t=e.length),r=t-1;r>=0&&128==(192&e[r]);)r--;return r<0||0===r?t:r+o[e[r]]>t?r:t}},6069:function(e){"use strict";e.exports=function(e,t,r,n){for(var i=65535&e|0,a=e>>>16&65535|0,o=0;0!==r;){r-=o=r>2e3?2e3:r;do{a=a+(i=i+t[n++]|0)|0}while(--o);i%=65521,a%=65521}return i|a<<16|0}},1619:function(e){"use strict";e.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},2869:function(e){"use strict";var t=function(){for(var e,t=[],r=0;r<256;r++){e=r;for(var n=0;n<8;n++)e=1&e?3988292384^e>>>1:e>>>1;t[r]=e}return t}();e.exports=function(e,r,n,i){var a=t,o=i+n;e^=-1;for(var s=i;s<o;s++)e=e>>>8^a[255&(e^r[s])];return-1^e}},405:function(e,t,r){"use strict";var n,i=r(4236),a=r(342),o=r(6069),s=r(2869),u=r(8898),c=-2,l=258,f=262,h=103,p=113,d=666;function y(e,t){return e.msg=u[t],t}function v(e){return(e<<1)-(e>4?9:0)}function g(e){for(var t=e.length;--t>=0;)e[t]=0}function m(e){var t=e.state,r=t.pending;r>e.avail_out&&(r=e.avail_out),0!==r&&(i.arraySet(e.output,t.pending_buf,t.pending_out,r,e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,0===t.pending&&(t.pending_out=0))}function b(e,t){a._tr_flush_block(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,m(e.strm)}function E(e,t){e.pending_buf[e.pending++]=t}function S(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function C(e,t){var r,n,i=e.max_chain_length,a=e.strstart,o=e.prev_length,s=e.nice_match,u=e.strstart>e.w_size-f?e.strstart-(e.w_size-f):0,c=e.window,h=e.w_mask,p=e.prev,d=e.strstart+l,y=c[a+o-1],v=c[a+o];e.prev_length>=e.good_match&&(i>>=2),s>e.lookahead&&(s=e.lookahead);do{if(c[(r=t)+o]===v&&c[r+o-1]===y&&c[r]===c[a]&&c[++r]===c[a+1]){a+=2,r++;do{}while(c[++a]===c[++r]&&c[++a]===c[++r]&&c[++a]===c[++r]&&c[++a]===c[++r]&&c[++a]===c[++r]&&c[++a]===c[++r]&&c[++a]===c[++r]&&c[++a]===c[++r]&&a<d);if(n=l-(d-a),a=d-l,n>o){if(e.match_start=t,o=n,n>=s)break;y=c[a+o-1],v=c[a+o]}}}while((t=p[t&h])>u&&0!=--i);return o<=e.lookahead?o:e.lookahead}function w(e){var t,r,n,a,u,c,l,h,p,d,y=e.w_size;do{if(a=e.window_size-e.lookahead-e.strstart,e.strstart>=y+(y-f)){i.arraySet(e.window,e.window,y,y,0),e.match_start-=y,e.strstart-=y,e.block_start-=y,t=r=e.hash_size;do{n=e.head[--t],e.head[t]=n>=y?n-y:0}while(--r);t=r=y;do{n=e.prev[--t],e.prev[t]=n>=y?n-y:0}while(--r);a+=y}if(0===e.strm.avail_in)break;if(c=e.strm,l=e.window,h=e.strstart+e.lookahead,p=a,d=void 0,(d=c.avail_in)>p&&(d=p),r=0===d?0:(c.avail_in-=d,i.arraySet(l,c.input,c.next_in,d,h),1===c.state.wrap?c.adler=o(c.adler,l,d,h):2===c.state.wrap&&(c.adler=s(c.adler,l,d,h)),c.next_in+=d,c.total_in+=d,d),e.lookahead+=r,e.lookahead+e.insert>=3)for(u=e.strstart-e.insert,e.ins_h=e.window[u],e.ins_h=(e.ins_h<<e.hash_shift^e.window[u+1])&e.hash_mask;e.insert&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[u+3-1])&e.hash_mask,e.prev[u&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=u,u++,e.insert--,!(e.lookahead+e.insert<3)););}while(e.lookahead<f&&0!==e.strm.avail_in)}function T(e,t){for(var r,n;;){if(e.lookahead<f){if(w(e),e.lookahead<f&&0===t)return 1;if(0===e.lookahead)break}if(r=0,e.lookahead>=3&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+3-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),0!==r&&e.strstart-r<=e.w_size-f&&(e.match_length=C(e,r)),e.match_length>=3)if(n=a._tr_tally(e,e.strstart-e.match_start,e.match_length-3),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=3){e.match_length--;do{e.strstart++,e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+3-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart}while(0!=--e.match_length);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+1])&e.hash_mask;else n=a._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(n&&(b(e,!1),0===e.strm.avail_out))return 1}return e.insert=e.strstart<2?e.strstart:2,4===t?(b(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(b(e,!1),0===e.strm.avail_out)?1:2}function A(e,t){for(var r,n,i;;){if(e.lookahead<f){if(w(e),e.lookahead<f&&0===t)return 1;if(0===e.lookahead)break}if(r=0,e.lookahead>=3&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+3-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=2,0!==r&&e.prev_length<e.max_lazy_match&&e.strstart-r<=e.w_size-f&&(e.match_length=C(e,r),e.match_length<=5&&(1===e.strategy||3===e.match_length&&e.strstart-e.match_start>4096)&&(e.match_length=2)),e.prev_length>=3&&e.match_length<=e.prev_length){i=e.strstart+e.lookahead-3,n=a._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-3),e.lookahead-=e.prev_length-1,e.prev_length-=2;do{++e.strstart<=i&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+3-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart)}while(0!=--e.prev_length);if(e.match_available=0,e.match_length=2,e.strstart++,n&&(b(e,!1),0===e.strm.avail_out))return 1}else if(e.match_available){if((n=a._tr_tally(e,0,e.window[e.strstart-1]))&&b(e,!1),e.strstart++,e.lookahead--,0===e.strm.avail_out)return 1}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(n=a._tr_tally(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<2?e.strstart:2,4===t?(b(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(b(e,!1),0===e.strm.avail_out)?1:2}function I(e,t,r,n,i){this.good_length=e,this.max_lazy=t,this.nice_length=r,this.max_chain=n,this.func=i}function k(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=8,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new i.Buf16(1146),this.dyn_dtree=new i.Buf16(122),this.bl_tree=new i.Buf16(78),g(this.dyn_ltree),g(this.dyn_dtree),g(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new i.Buf16(16),this.heap=new i.Buf16(573),g(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new i.Buf16(573),g(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function _(e){var t;return e&&e.state?(e.total_in=e.total_out=0,e.data_type=2,(t=e.state).pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap?42:p,e.adler=2===t.wrap?0:1,t.last_flush=0,a._tr_init(t),0):y(e,c)}function B(e){var t,r=_(e);return 0===r&&((t=e.state).window_size=2*t.w_size,g(t.head),t.max_lazy_match=n[t.level].max_lazy,t.good_match=n[t.level].good_length,t.nice_match=n[t.level].nice_length,t.max_chain_length=n[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=2,t.match_available=0,t.ins_h=0),r}function N(e,t,r,n,a,o){if(!e)return c;var s=1;if(-1===t&&(t=6),n<0?(s=0,n=-n):n>15&&(s=2,n-=16),a<1||a>9||8!==r||n<8||n>15||t<0||t>9||o<0||o>4)return y(e,c);8===n&&(n=9);var u=new k;return e.state=u,u.strm=e,u.wrap=s,u.gzhead=null,u.w_bits=n,u.w_size=1<<u.w_bits,u.w_mask=u.w_size-1,u.hash_bits=a+7,u.hash_size=1<<u.hash_bits,u.hash_mask=u.hash_size-1,u.hash_shift=~~((u.hash_bits+3-1)/3),u.window=new i.Buf8(2*u.w_size),u.head=new i.Buf16(u.hash_size),u.prev=new i.Buf16(u.w_size),u.lit_bufsize=1<<a+6,u.pending_buf_size=4*u.lit_bufsize,u.pending_buf=new i.Buf8(u.pending_buf_size),u.d_buf=1*u.lit_bufsize,u.l_buf=3*u.lit_bufsize,u.level=t,u.strategy=o,u.method=r,B(e)}n=[new I(0,0,0,0,(function(e,t){var r=65535;for(r>e.pending_buf_size-5&&(r=e.pending_buf_size-5);;){if(e.lookahead<=1){if(w(e),0===e.lookahead&&0===t)return 1;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var n=e.block_start+r;if((0===e.strstart||e.strstart>=n)&&(e.lookahead=e.strstart-n,e.strstart=n,b(e,!1),0===e.strm.avail_out))return 1;if(e.strstart-e.block_start>=e.w_size-f&&(b(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(b(e,!0),0===e.strm.avail_out?3:4):(e.strstart>e.block_start&&(b(e,!1),e.strm.avail_out),1)})),new I(4,4,8,4,T),new I(4,5,16,8,T),new I(4,6,32,32,T),new I(4,4,16,16,A),new I(8,16,32,32,A),new I(8,16,128,128,A),new I(8,32,128,256,A),new I(32,128,258,1024,A),new I(32,258,258,4096,A)],t.deflateInit=function(e,t){return N(e,t,8,15,8,0)},t.deflateInit2=N,t.deflateReset=B,t.deflateResetKeep=_,t.deflateSetHeader=function(e,t){return e&&e.state?2!==e.state.wrap?c:(e.state.gzhead=t,0):c},t.deflate=function(e,t){var r,i,o,u;if(!e||!e.state||t>5||t<0)return e?y(e,c):c;if(i=e.state,!e.output||!e.input&&0!==e.avail_in||i.status===d&&4!==t)return y(e,0===e.avail_out?-5:c);if(i.strm=e,r=i.last_flush,i.last_flush=t,42===i.status)if(2===i.wrap)e.adler=0,E(i,31),E(i,139),E(i,8),i.gzhead?(E(i,(i.gzhead.text?1:0)+(i.gzhead.hcrc?2:0)+(i.gzhead.extra?4:0)+(i.gzhead.name?8:0)+(i.gzhead.comment?16:0)),E(i,255&i.gzhead.time),E(i,i.gzhead.time>>8&255),E(i,i.gzhead.time>>16&255),E(i,i.gzhead.time>>24&255),E(i,9===i.level?2:i.strategy>=2||i.level<2?4:0),E(i,255&i.gzhead.os),i.gzhead.extra&&i.gzhead.extra.length&&(E(i,255&i.gzhead.extra.length),E(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(e.adler=s(e.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=69):(E(i,0),E(i,0),E(i,0),E(i,0),E(i,0),E(i,9===i.level?2:i.strategy>=2||i.level<2?4:0),E(i,3),i.status=p);else{var f=8+(i.w_bits-8<<4)<<8;f|=(i.strategy>=2||i.level<2?0:i.level<6?1:6===i.level?2:3)<<6,0!==i.strstart&&(f|=32),f+=31-f%31,i.status=p,S(i,f),0!==i.strstart&&(S(i,e.adler>>>16),S(i,65535&e.adler)),e.adler=1}if(69===i.status)if(i.gzhead.extra){for(o=i.pending;i.gzindex<(65535&i.gzhead.extra.length)&&(i.pending!==i.pending_buf_size||(i.gzhead.hcrc&&i.pending>o&&(e.adler=s(e.adler,i.pending_buf,i.pending-o,o)),m(e),o=i.pending,i.pending!==i.pending_buf_size));)E(i,255&i.gzhead.extra[i.gzindex]),i.gzindex++;i.gzhead.hcrc&&i.pending>o&&(e.adler=s(e.adler,i.pending_buf,i.pending-o,o)),i.gzindex===i.gzhead.extra.length&&(i.gzindex=0,i.status=73)}else i.status=73;if(73===i.status)if(i.gzhead.name){o=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>o&&(e.adler=s(e.adler,i.pending_buf,i.pending-o,o)),m(e),o=i.pending,i.pending===i.pending_buf_size)){u=1;break}u=i.gzindex<i.gzhead.name.length?255&i.gzhead.name.charCodeAt(i.gzindex++):0,E(i,u)}while(0!==u);i.gzhead.hcrc&&i.pending>o&&(e.adler=s(e.adler,i.pending_buf,i.pending-o,o)),0===u&&(i.gzindex=0,i.status=91)}else i.status=91;if(91===i.status)if(i.gzhead.comment){o=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>o&&(e.adler=s(e.adler,i.pending_buf,i.pending-o,o)),m(e),o=i.pending,i.pending===i.pending_buf_size)){u=1;break}u=i.gzindex<i.gzhead.comment.length?255&i.gzhead.comment.charCodeAt(i.gzindex++):0,E(i,u)}while(0!==u);i.gzhead.hcrc&&i.pending>o&&(e.adler=s(e.adler,i.pending_buf,i.pending-o,o)),0===u&&(i.status=h)}else i.status=h;if(i.status===h&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&m(e),i.pending+2<=i.pending_buf_size&&(E(i,255&e.adler),E(i,e.adler>>8&255),e.adler=0,i.status=p)):i.status=p),0!==i.pending){if(m(e),0===e.avail_out)return i.last_flush=-1,0}else if(0===e.avail_in&&v(t)<=v(r)&&4!==t)return y(e,-5);if(i.status===d&&0!==e.avail_in)return y(e,-5);if(0!==e.avail_in||0!==i.lookahead||0!==t&&i.status!==d){var C=2===i.strategy?function(e,t){for(var r;;){if(0===e.lookahead&&(w(e),0===e.lookahead)){if(0===t)return 1;break}if(e.match_length=0,r=a._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(b(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(b(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(b(e,!1),0===e.strm.avail_out)?1:2}(i,t):3===i.strategy?function(e,t){for(var r,n,i,o,s=e.window;;){if(e.lookahead<=l){if(w(e),e.lookahead<=l&&0===t)return 1;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=3&&e.strstart>0&&(n=s[i=e.strstart-1])===s[++i]&&n===s[++i]&&n===s[++i]){o=e.strstart+l;do{}while(n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&i<o);e.match_length=l-(o-i),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=3?(r=a._tr_tally(e,1,e.match_length-3),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=a._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(b(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(b(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(b(e,!1),0===e.strm.avail_out)?1:2}(i,t):n[i.level].func(i,t);if(3!==C&&4!==C||(i.status=d),1===C||3===C)return 0===e.avail_out&&(i.last_flush=-1),0;if(2===C&&(1===t?a._tr_align(i):5!==t&&(a._tr_stored_block(i,0,0,!1),3===t&&(g(i.head),0===i.lookahead&&(i.strstart=0,i.block_start=0,i.insert=0))),m(e),0===e.avail_out))return i.last_flush=-1,0}return 4!==t?0:i.wrap<=0?1:(2===i.wrap?(E(i,255&e.adler),E(i,e.adler>>8&255),E(i,e.adler>>16&255),E(i,e.adler>>24&255),E(i,255&e.total_in),E(i,e.total_in>>8&255),E(i,e.total_in>>16&255),E(i,e.total_in>>24&255)):(S(i,e.adler>>>16),S(i,65535&e.adler)),m(e),i.wrap>0&&(i.wrap=-i.wrap),0!==i.pending?0:1)},t.deflateEnd=function(e){var t;return e&&e.state?42!==(t=e.state.status)&&69!==t&&73!==t&&91!==t&&t!==h&&t!==p&&t!==d?y(e,c):(e.state=null,t===p?y(e,-3):0):c},t.deflateSetDictionary=function(e,t){var r,n,a,s,u,l,f,h,p=t.length;if(!e||!e.state)return c;if(2===(s=(r=e.state).wrap)||1===s&&42!==r.status||r.lookahead)return c;for(1===s&&(e.adler=o(e.adler,t,p,0)),r.wrap=0,p>=r.w_size&&(0===s&&(g(r.head),r.strstart=0,r.block_start=0,r.insert=0),h=new i.Buf8(r.w_size),i.arraySet(h,t,p-r.w_size,r.w_size,0),t=h,p=r.w_size),u=e.avail_in,l=e.next_in,f=e.input,e.avail_in=p,e.next_in=0,e.input=t,w(r);r.lookahead>=3;){n=r.strstart,a=r.lookahead-2;do{r.ins_h=(r.ins_h<<r.hash_shift^r.window[n+3-1])&r.hash_mask,r.prev[n&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=n,n++}while(--a);r.strstart=n,r.lookahead=2,w(r)}return r.strstart+=r.lookahead,r.block_start=r.strstart,r.insert=r.lookahead,r.lookahead=0,r.match_length=r.prev_length=2,r.match_available=0,e.next_in=l,e.input=f,e.avail_in=u,r.wrap=s,0},t.deflateInfo="pako deflate (from Nodeca project)"},2401:function(e){"use strict";e.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},4264:function(e){"use strict";e.exports=function(e,t){var r,n,i,a,o,s,u,c,l,f,h,p,d,y,v,g,m,b,E,S,C,w,T,A,I;r=e.state,n=e.next_in,A=e.input,i=n+(e.avail_in-5),a=e.next_out,I=e.output,o=a-(t-e.avail_out),s=a+(e.avail_out-257),u=r.dmax,c=r.wsize,l=r.whave,f=r.wnext,h=r.window,p=r.hold,d=r.bits,y=r.lencode,v=r.distcode,g=(1<<r.lenbits)-1,m=(1<<r.distbits)-1;e:do{d<15&&(p+=A[n++]<<d,d+=8,p+=A[n++]<<d,d+=8),b=y[p&g];t:for(;;){if(p>>>=E=b>>>24,d-=E,0===(E=b>>>16&255))I[a++]=65535&b;else{if(!(16&E)){if(0==(64&E)){b=y[(65535&b)+(p&(1<<E)-1)];continue t}if(32&E){r.mode=12;break e}e.msg="invalid literal/length code",r.mode=30;break e}S=65535&b,(E&=15)&&(d<E&&(p+=A[n++]<<d,d+=8),S+=p&(1<<E)-1,p>>>=E,d-=E),d<15&&(p+=A[n++]<<d,d+=8,p+=A[n++]<<d,d+=8),b=v[p&m];r:for(;;){if(p>>>=E=b>>>24,d-=E,!(16&(E=b>>>16&255))){if(0==(64&E)){b=v[(65535&b)+(p&(1<<E)-1)];continue r}e.msg="invalid distance code",r.mode=30;break e}if(C=65535&b,d<(E&=15)&&(p+=A[n++]<<d,(d+=8)<E&&(p+=A[n++]<<d,d+=8)),(C+=p&(1<<E)-1)>u){e.msg="invalid distance too far back",r.mode=30;break e}if(p>>>=E,d-=E,C>(E=a-o)){if((E=C-E)>l&&r.sane){e.msg="invalid distance too far back",r.mode=30;break e}if(w=0,T=h,0===f){if(w+=c-E,E<S){S-=E;do{I[a++]=h[w++]}while(--E);w=a-C,T=I}}else if(f<E){if(w+=c+f-E,(E-=f)<S){S-=E;do{I[a++]=h[w++]}while(--E);if(w=0,f<S){S-=E=f;do{I[a++]=h[w++]}while(--E);w=a-C,T=I}}}else if(w+=f-E,E<S){S-=E;do{I[a++]=h[w++]}while(--E);w=a-C,T=I}for(;S>2;)I[a++]=T[w++],I[a++]=T[w++],I[a++]=T[w++],S-=3;S&&(I[a++]=T[w++],S>1&&(I[a++]=T[w++]))}else{w=a-C;do{I[a++]=I[w++],I[a++]=I[w++],I[a++]=I[w++],S-=3}while(S>2);S&&(I[a++]=I[w++],S>1&&(I[a++]=I[w++]))}break}}break}}while(n<i&&a<s);n-=S=d>>3,p&=(1<<(d-=S<<3))-1,e.next_in=n,e.next_out=a,e.avail_in=n<i?i-n+5:5-(n-i),e.avail_out=a<s?s-a+257:257-(a-s),r.hold=p,r.bits=d}},7948:function(e,t,r){"use strict";var n=r(4236),i=r(6069),a=r(2869),o=r(4264),s=r(9241),u=-2,c=12,l=30;function f(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function h(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new n.Buf16(320),this.work=new n.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function p(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=1,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new n.Buf32(852),t.distcode=t.distdyn=new n.Buf32(592),t.sane=1,t.back=-1,0):u}function d(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,p(e)):u}function y(e,t){var r,n;return e&&e.state?(n=e.state,t<0?(r=0,t=-t):(r=1+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?u:(null!==n.window&&n.wbits!==t&&(n.window=null),n.wrap=r,n.wbits=t,d(e))):u}function v(e,t){var r,n;return e?(n=new h,e.state=n,n.window=null,0!==(r=y(e,t))&&(e.state=null),r):u}var g,m,b=!0;function E(e){if(b){var t;for(g=new n.Buf32(512),m=new n.Buf32(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(s(1,e.lens,0,288,g,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;s(2,e.lens,0,32,m,0,e.work,{bits:5}),b=!1}e.lencode=g,e.lenbits=9,e.distcode=m,e.distbits=5}function S(e,t,r,i){var a,o=e.state;return null===o.window&&(o.wsize=1<<o.wbits,o.wnext=0,o.whave=0,o.window=new n.Buf8(o.wsize)),i>=o.wsize?(n.arraySet(o.window,t,r-o.wsize,o.wsize,0),o.wnext=0,o.whave=o.wsize):((a=o.wsize-o.wnext)>i&&(a=i),n.arraySet(o.window,t,r-i,a,o.wnext),(i-=a)?(n.arraySet(o.window,t,r-i,i,0),o.wnext=i,o.whave=o.wsize):(o.wnext+=a,o.wnext===o.wsize&&(o.wnext=0),o.whave<o.wsize&&(o.whave+=a))),0}t.inflateReset=d,t.inflateReset2=y,t.inflateResetKeep=p,t.inflateInit=function(e){return v(e,15)},t.inflateInit2=v,t.inflate=function(e,t){var r,h,p,d,y,v,g,m,b,C,w,T,A,I,k,_,B,N,O,R,x,P,F,D,L=0,U=new n.Buf8(4),j=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!e||!e.state||!e.output||!e.input&&0!==e.avail_in)return u;(r=e.state).mode===c&&(r.mode=13),y=e.next_out,p=e.output,g=e.avail_out,d=e.next_in,h=e.input,v=e.avail_in,m=r.hold,b=r.bits,C=v,w=g,P=0;e:for(;;)switch(r.mode){case 1:if(0===r.wrap){r.mode=13;break}for(;b<16;){if(0===v)break e;v--,m+=h[d++]<<b,b+=8}if(2&r.wrap&&35615===m){r.check=0,U[0]=255&m,U[1]=m>>>8&255,r.check=a(r.check,U,2,0),m=0,b=0,r.mode=2;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&m)<<8)+(m>>8))%31){e.msg="incorrect header check",r.mode=l;break}if(8!=(15&m)){e.msg="unknown compression method",r.mode=l;break}if(b-=4,x=8+(15&(m>>>=4)),0===r.wbits)r.wbits=x;else if(x>r.wbits){e.msg="invalid window size",r.mode=l;break}r.dmax=1<<x,e.adler=r.check=1,r.mode=512&m?10:c,m=0,b=0;break;case 2:for(;b<16;){if(0===v)break e;v--,m+=h[d++]<<b,b+=8}if(r.flags=m,8!=(255&r.flags)){e.msg="unknown compression method",r.mode=l;break}if(57344&r.flags){e.msg="unknown header flags set",r.mode=l;break}r.head&&(r.head.text=m>>8&1),512&r.flags&&(U[0]=255&m,U[1]=m>>>8&255,r.check=a(r.check,U,2,0)),m=0,b=0,r.mode=3;case 3:for(;b<32;){if(0===v)break e;v--,m+=h[d++]<<b,b+=8}r.head&&(r.head.time=m),512&r.flags&&(U[0]=255&m,U[1]=m>>>8&255,U[2]=m>>>16&255,U[3]=m>>>24&255,r.check=a(r.check,U,4,0)),m=0,b=0,r.mode=4;case 4:for(;b<16;){if(0===v)break e;v--,m+=h[d++]<<b,b+=8}r.head&&(r.head.xflags=255&m,r.head.os=m>>8),512&r.flags&&(U[0]=255&m,U[1]=m>>>8&255,r.check=a(r.check,U,2,0)),m=0,b=0,r.mode=5;case 5:if(1024&r.flags){for(;b<16;){if(0===v)break e;v--,m+=h[d++]<<b,b+=8}r.length=m,r.head&&(r.head.extra_len=m),512&r.flags&&(U[0]=255&m,U[1]=m>>>8&255,r.check=a(r.check,U,2,0)),m=0,b=0}else r.head&&(r.head.extra=null);r.mode=6;case 6:if(1024&r.flags&&((T=r.length)>v&&(T=v),T&&(r.head&&(x=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),n.arraySet(r.head.extra,h,d,T,x)),512&r.flags&&(r.check=a(r.check,h,T,d)),v-=T,d+=T,r.length-=T),r.length))break e;r.length=0,r.mode=7;case 7:if(2048&r.flags){if(0===v)break e;T=0;do{x=h[d+T++],r.head&&x&&r.length<65536&&(r.head.name+=String.fromCharCode(x))}while(x&&T<v);if(512&r.flags&&(r.check=a(r.check,h,T,d)),v-=T,d+=T,x)break e}else r.head&&(r.head.name=null);r.length=0,r.mode=8;case 8:if(4096&r.flags){if(0===v)break e;T=0;do{x=h[d+T++],r.head&&x&&r.length<65536&&(r.head.comment+=String.fromCharCode(x))}while(x&&T<v);if(512&r.flags&&(r.check=a(r.check,h,T,d)),v-=T,d+=T,x)break e}else r.head&&(r.head.comment=null);r.mode=9;case 9:if(512&r.flags){for(;b<16;){if(0===v)break e;v--,m+=h[d++]<<b,b+=8}if(m!==(65535&r.check)){e.msg="header crc mismatch",r.mode=l;break}m=0,b=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=c;break;case 10:for(;b<32;){if(0===v)break e;v--,m+=h[d++]<<b,b+=8}e.adler=r.check=f(m),m=0,b=0,r.mode=11;case 11:if(0===r.havedict)return e.next_out=y,e.avail_out=g,e.next_in=d,e.avail_in=v,r.hold=m,r.bits=b,2;e.adler=r.check=1,r.mode=c;case c:if(5===t||6===t)break e;case 13:if(r.last){m>>>=7&b,b-=7&b,r.mode=27;break}for(;b<3;){if(0===v)break e;v--,m+=h[d++]<<b,b+=8}switch(r.last=1&m,b-=1,3&(m>>>=1)){case 0:r.mode=14;break;case 1:if(E(r),r.mode=20,6===t){m>>>=2,b-=2;break e}break;case 2:r.mode=17;break;case 3:e.msg="invalid block type",r.mode=l}m>>>=2,b-=2;break;case 14:for(m>>>=7&b,b-=7&b;b<32;){if(0===v)break e;v--,m+=h[d++]<<b,b+=8}if((65535&m)!=(m>>>16^65535)){e.msg="invalid stored block lengths",r.mode=l;break}if(r.length=65535&m,m=0,b=0,r.mode=15,6===t)break e;case 15:r.mode=16;case 16:if(T=r.length){if(T>v&&(T=v),T>g&&(T=g),0===T)break e;n.arraySet(p,h,d,T,y),v-=T,d+=T,g-=T,y+=T,r.length-=T;break}r.mode=c;break;case 17:for(;b<14;){if(0===v)break e;v--,m+=h[d++]<<b,b+=8}if(r.nlen=257+(31&m),m>>>=5,b-=5,r.ndist=1+(31&m),m>>>=5,b-=5,r.ncode=4+(15&m),m>>>=4,b-=4,r.nlen>286||r.ndist>30){e.msg="too many length or distance symbols",r.mode=l;break}r.have=0,r.mode=18;case 18:for(;r.have<r.ncode;){for(;b<3;){if(0===v)break e;v--,m+=h[d++]<<b,b+=8}r.lens[j[r.have++]]=7&m,m>>>=3,b-=3}for(;r.have<19;)r.lens[j[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,F={bits:r.lenbits},P=s(0,r.lens,0,19,r.lencode,0,r.work,F),r.lenbits=F.bits,P){e.msg="invalid code lengths set",r.mode=l;break}r.have=0,r.mode=19;case 19:for(;r.have<r.nlen+r.ndist;){for(;_=(L=r.lencode[m&(1<<r.lenbits)-1])>>>16&255,B=65535&L,!((k=L>>>24)<=b);){if(0===v)break e;v--,m+=h[d++]<<b,b+=8}if(B<16)m>>>=k,b-=k,r.lens[r.have++]=B;else{if(16===B){for(D=k+2;b<D;){if(0===v)break e;v--,m+=h[d++]<<b,b+=8}if(m>>>=k,b-=k,0===r.have){e.msg="invalid bit length repeat",r.mode=l;break}x=r.lens[r.have-1],T=3+(3&m),m>>>=2,b-=2}else if(17===B){for(D=k+3;b<D;){if(0===v)break e;v--,m+=h[d++]<<b,b+=8}b-=k,x=0,T=3+(7&(m>>>=k)),m>>>=3,b-=3}else{for(D=k+7;b<D;){if(0===v)break e;v--,m+=h[d++]<<b,b+=8}b-=k,x=0,T=11+(127&(m>>>=k)),m>>>=7,b-=7}if(r.have+T>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=l;break}for(;T--;)r.lens[r.have++]=x}}if(r.mode===l)break;if(0===r.lens[256]){e.msg="invalid code -- missing end-of-block",r.mode=l;break}if(r.lenbits=9,F={bits:r.lenbits},P=s(1,r.lens,0,r.nlen,r.lencode,0,r.work,F),r.lenbits=F.bits,P){e.msg="invalid literal/lengths set",r.mode=l;break}if(r.distbits=6,r.distcode=r.distdyn,F={bits:r.distbits},P=s(2,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,F),r.distbits=F.bits,P){e.msg="invalid distances set",r.mode=l;break}if(r.mode=20,6===t)break e;case 20:r.mode=21;case 21:if(v>=6&&g>=258){e.next_out=y,e.avail_out=g,e.next_in=d,e.avail_in=v,r.hold=m,r.bits=b,o(e,w),y=e.next_out,p=e.output,g=e.avail_out,d=e.next_in,h=e.input,v=e.avail_in,m=r.hold,b=r.bits,r.mode===c&&(r.back=-1);break}for(r.back=0;_=(L=r.lencode[m&(1<<r.lenbits)-1])>>>16&255,B=65535&L,!((k=L>>>24)<=b);){if(0===v)break e;v--,m+=h[d++]<<b,b+=8}if(_&&0==(240&_)){for(N=k,O=_,R=B;_=(L=r.lencode[R+((m&(1<<N+O)-1)>>N)])>>>16&255,B=65535&L,!(N+(k=L>>>24)<=b);){if(0===v)break e;v--,m+=h[d++]<<b,b+=8}m>>>=N,b-=N,r.back+=N}if(m>>>=k,b-=k,r.back+=k,r.length=B,0===_){r.mode=26;break}if(32&_){r.back=-1,r.mode=c;break}if(64&_){e.msg="invalid literal/length code",r.mode=l;break}r.extra=15&_,r.mode=22;case 22:if(r.extra){for(D=r.extra;b<D;){if(0===v)break e;v--,m+=h[d++]<<b,b+=8}r.length+=m&(1<<r.extra)-1,m>>>=r.extra,b-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=23;case 23:for(;_=(L=r.distcode[m&(1<<r.distbits)-1])>>>16&255,B=65535&L,!((k=L>>>24)<=b);){if(0===v)break e;v--,m+=h[d++]<<b,b+=8}if(0==(240&_)){for(N=k,O=_,R=B;_=(L=r.distcode[R+((m&(1<<N+O)-1)>>N)])>>>16&255,B=65535&L,!(N+(k=L>>>24)<=b);){if(0===v)break e;v--,m+=h[d++]<<b,b+=8}m>>>=N,b-=N,r.back+=N}if(m>>>=k,b-=k,r.back+=k,64&_){e.msg="invalid distance code",r.mode=l;break}r.offset=B,r.extra=15&_,r.mode=24;case 24:if(r.extra){for(D=r.extra;b<D;){if(0===v)break e;v--,m+=h[d++]<<b,b+=8}r.offset+=m&(1<<r.extra)-1,m>>>=r.extra,b-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=l;break}r.mode=25;case 25:if(0===g)break e;if(T=w-g,r.offset>T){if((T=r.offset-T)>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=l;break}T>r.wnext?(T-=r.wnext,A=r.wsize-T):A=r.wnext-T,T>r.length&&(T=r.length),I=r.window}else I=p,A=y-r.offset,T=r.length;T>g&&(T=g),g-=T,r.length-=T;do{p[y++]=I[A++]}while(--T);0===r.length&&(r.mode=21);break;case 26:if(0===g)break e;p[y++]=r.length,g--,r.mode=21;break;case 27:if(r.wrap){for(;b<32;){if(0===v)break e;v--,m|=h[d++]<<b,b+=8}if(w-=g,e.total_out+=w,r.total+=w,w&&(e.adler=r.check=r.flags?a(r.check,p,w,y-w):i(r.check,p,w,y-w)),w=g,(r.flags?m:f(m))!==r.check){e.msg="incorrect data check",r.mode=l;break}m=0,b=0}r.mode=28;case 28:if(r.wrap&&r.flags){for(;b<32;){if(0===v)break e;v--,m+=h[d++]<<b,b+=8}if(m!==(4294967295&r.total)){e.msg="incorrect length check",r.mode=l;break}m=0,b=0}r.mode=29;case 29:P=1;break e;case l:P=-3;break e;case 31:return-4;case 32:default:return u}return e.next_out=y,e.avail_out=g,e.next_in=d,e.avail_in=v,r.hold=m,r.bits=b,(r.wsize||w!==e.avail_out&&r.mode<l&&(r.mode<27||4!==t))&&S(e,e.output,e.next_out,w-e.avail_out)?(r.mode=31,-4):(C-=e.avail_in,w-=e.avail_out,e.total_in+=C,e.total_out+=w,r.total+=w,r.wrap&&w&&(e.adler=r.check=r.flags?a(r.check,p,w,e.next_out-w):i(r.check,p,w,e.next_out-w)),e.data_type=r.bits+(r.last?64:0)+(r.mode===c?128:0)+(20===r.mode||15===r.mode?256:0),(0===C&&0===w||4===t)&&0===P&&(P=-5),P)},t.inflateEnd=function(e){if(!e||!e.state)return u;var t=e.state;return t.window&&(t.window=null),e.state=null,0},t.inflateGetHeader=function(e,t){var r;return e&&e.state?0==(2&(r=e.state).wrap)?u:(r.head=t,t.done=!1,0):u},t.inflateSetDictionary=function(e,t){var r,n=t.length;return e&&e.state?0!==(r=e.state).wrap&&11!==r.mode?u:11===r.mode&&i(1,t,n,0)!==r.check?-3:S(e,t,n,n)?(r.mode=31,-4):(r.havedict=1,0):u},t.inflateInfo="pako inflate (from Nodeca project)"},9241:function(e,t,r){"use strict";var n=r(4236),i=15,a=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],o=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],s=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],u=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];e.exports=function(e,t,r,c,l,f,h,p){var d,y,v,g,m,b,E,S,C,w=p.bits,T=0,A=0,I=0,k=0,_=0,B=0,N=0,O=0,R=0,x=0,P=null,F=0,D=new n.Buf16(16),L=new n.Buf16(16),U=null,j=0;for(T=0;T<=i;T++)D[T]=0;for(A=0;A<c;A++)D[t[r+A]]++;for(_=w,k=i;k>=1&&0===D[k];k--);if(_>k&&(_=k),0===k)return l[f++]=20971520,l[f++]=20971520,p.bits=1,0;for(I=1;I<k&&0===D[I];I++);for(_<I&&(_=I),O=1,T=1;T<=i;T++)if(O<<=1,(O-=D[T])<0)return-1;if(O>0&&(0===e||1!==k))return-1;for(L[1]=0,T=1;T<i;T++)L[T+1]=L[T]+D[T];for(A=0;A<c;A++)0!==t[r+A]&&(h[L[t[r+A]]++]=A);if(0===e?(P=U=h,b=19):1===e?(P=a,F-=257,U=o,j-=257,b=256):(P=s,U=u,b=-1),x=0,A=0,T=I,m=f,B=_,N=0,v=-1,g=(R=1<<_)-1,1===e&&R>852||2===e&&R>592)return 1;for(;;){E=T-N,h[A]<b?(S=0,C=h[A]):h[A]>b?(S=U[j+h[A]],C=P[F+h[A]]):(S=96,C=0),d=1<<T-N,I=y=1<<B;do{l[m+(x>>N)+(y-=d)]=E<<24|S<<16|C|0}while(0!==y);for(d=1<<T-1;x&d;)d>>=1;if(0!==d?(x&=d-1,x+=d):x=0,A++,0==--D[T]){if(T===k)break;T=t[r+h[A]]}if(T>_&&(x&g)!==v){for(0===N&&(N=_),m+=I,O=1<<(B=T-N);B+N<k&&!((O-=D[B+N])<=0);)B++,O<<=1;if(R+=1<<B,1===e&&R>852||2===e&&R>592)return 1;l[v=x&g]=_<<24|B<<16|m-f|0}}return 0!==x&&(l[m+x]=T-N<<24|64<<16|0),p.bits=_,0}},8898:function(e){"use strict";e.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},342:function(e,t,r){"use strict";var n=r(4236);function i(e){for(var t=e.length;--t>=0;)e[t]=0}var a=256,o=286,s=30,u=15,c=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],l=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],f=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],h=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],p=new Array(576);i(p);var d=new Array(60);i(d);var y=new Array(512);i(y);var v=new Array(256);i(v);var g=new Array(29);i(g);var m,b,E,S=new Array(s);function C(e,t,r,n,i){this.static_tree=e,this.extra_bits=t,this.extra_base=r,this.elems=n,this.max_length=i,this.has_stree=e&&e.length}function w(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function T(e){return e<256?y[e]:y[256+(e>>>7)]}function A(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function I(e,t,r){e.bi_valid>16-r?(e.bi_buf|=t<<e.bi_valid&65535,A(e,e.bi_buf),e.bi_buf=t>>16-e.bi_valid,e.bi_valid+=r-16):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=r)}function k(e,t,r){I(e,r[2*t],r[2*t+1])}function _(e,t){var r=0;do{r|=1&e,e>>>=1,r<<=1}while(--t>0);return r>>>1}function B(e,t,r){var n,i,a=new Array(16),o=0;for(n=1;n<=u;n++)a[n]=o=o+r[n-1]<<1;for(i=0;i<=t;i++){var s=e[2*i+1];0!==s&&(e[2*i]=_(a[s]++,s))}}function N(e){var t;for(t=0;t<o;t++)e.dyn_ltree[2*t]=0;for(t=0;t<s;t++)e.dyn_dtree[2*t]=0;for(t=0;t<19;t++)e.bl_tree[2*t]=0;e.dyn_ltree[512]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0}function O(e){e.bi_valid>8?A(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function R(e,t,r,n){var i=2*t,a=2*r;return e[i]<e[a]||e[i]===e[a]&&n[t]<=n[r]}function x(e,t,r){for(var n=e.heap[r],i=r<<1;i<=e.heap_len&&(i<e.heap_len&&R(t,e.heap[i+1],e.heap[i],e.depth)&&i++,!R(t,n,e.heap[i],e.depth));)e.heap[r]=e.heap[i],r=i,i<<=1;e.heap[r]=n}function P(e,t,r){var n,i,o,s,u=0;if(0!==e.last_lit)do{n=e.pending_buf[e.d_buf+2*u]<<8|e.pending_buf[e.d_buf+2*u+1],i=e.pending_buf[e.l_buf+u],u++,0===n?k(e,i,t):(k(e,(o=v[i])+a+1,t),0!==(s=c[o])&&I(e,i-=g[o],s),k(e,o=T(--n),r),0!==(s=l[o])&&I(e,n-=S[o],s))}while(u<e.last_lit);k(e,256,t)}function F(e,t){var r,n,i,a=t.dyn_tree,o=t.stat_desc.static_tree,s=t.stat_desc.has_stree,c=t.stat_desc.elems,l=-1;for(e.heap_len=0,e.heap_max=573,r=0;r<c;r++)0!==a[2*r]?(e.heap[++e.heap_len]=l=r,e.depth[r]=0):a[2*r+1]=0;for(;e.heap_len<2;)a[2*(i=e.heap[++e.heap_len]=l<2?++l:0)]=1,e.depth[i]=0,e.opt_len--,s&&(e.static_len-=o[2*i+1]);for(t.max_code=l,r=e.heap_len>>1;r>=1;r--)x(e,a,r);i=c;do{r=e.heap[1],e.heap[1]=e.heap[e.heap_len--],x(e,a,1),n=e.heap[1],e.heap[--e.heap_max]=r,e.heap[--e.heap_max]=n,a[2*i]=a[2*r]+a[2*n],e.depth[i]=(e.depth[r]>=e.depth[n]?e.depth[r]:e.depth[n])+1,a[2*r+1]=a[2*n+1]=i,e.heap[1]=i++,x(e,a,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],function(e,t){var r,n,i,a,o,s,c=t.dyn_tree,l=t.max_code,f=t.stat_desc.static_tree,h=t.stat_desc.has_stree,p=t.stat_desc.extra_bits,d=t.stat_desc.extra_base,y=t.stat_desc.max_length,v=0;for(a=0;a<=u;a++)e.bl_count[a]=0;for(c[2*e.heap[e.heap_max]+1]=0,r=e.heap_max+1;r<573;r++)(a=c[2*c[2*(n=e.heap[r])+1]+1]+1)>y&&(a=y,v++),c[2*n+1]=a,n>l||(e.bl_count[a]++,o=0,n>=d&&(o=p[n-d]),s=c[2*n],e.opt_len+=s*(a+o),h&&(e.static_len+=s*(f[2*n+1]+o)));if(0!==v){do{for(a=y-1;0===e.bl_count[a];)a--;e.bl_count[a]--,e.bl_count[a+1]+=2,e.bl_count[y]--,v-=2}while(v>0);for(a=y;0!==a;a--)for(n=e.bl_count[a];0!==n;)(i=e.heap[--r])>l||(c[2*i+1]!==a&&(e.opt_len+=(a-c[2*i+1])*c[2*i],c[2*i+1]=a),n--)}}(e,t),B(a,l,e.bl_count)}function D(e,t,r){var n,i,a=-1,o=t[1],s=0,u=7,c=4;for(0===o&&(u=138,c=3),t[2*(r+1)+1]=65535,n=0;n<=r;n++)i=o,o=t[2*(n+1)+1],++s<u&&i===o||(s<c?e.bl_tree[2*i]+=s:0!==i?(i!==a&&e.bl_tree[2*i]++,e.bl_tree[32]++):s<=10?e.bl_tree[34]++:e.bl_tree[36]++,s=0,a=i,0===o?(u=138,c=3):i===o?(u=6,c=3):(u=7,c=4))}function L(e,t,r){var n,i,a=-1,o=t[1],s=0,u=7,c=4;for(0===o&&(u=138,c=3),n=0;n<=r;n++)if(i=o,o=t[2*(n+1)+1],!(++s<u&&i===o)){if(s<c)do{k(e,i,e.bl_tree)}while(0!=--s);else 0!==i?(i!==a&&(k(e,i,e.bl_tree),s--),k(e,16,e.bl_tree),I(e,s-3,2)):s<=10?(k(e,17,e.bl_tree),I(e,s-3,3)):(k(e,18,e.bl_tree),I(e,s-11,7));s=0,a=i,0===o?(u=138,c=3):i===o?(u=6,c=3):(u=7,c=4)}}i(S);var U=!1;function j(e,t,r,i){I(e,0+(i?1:0),3),function(e,t,r,i){O(e),i&&(A(e,r),A(e,~r)),n.arraySet(e.pending_buf,e.window,t,r,e.pending),e.pending+=r}(e,t,r,!0)}t._tr_init=function(e){U||(!function(){var e,t,r,n,i,a=new Array(16);for(r=0,n=0;n<28;n++)for(g[n]=r,e=0;e<1<<c[n];e++)v[r++]=n;for(v[r-1]=n,i=0,n=0;n<16;n++)for(S[n]=i,e=0;e<1<<l[n];e++)y[i++]=n;for(i>>=7;n<s;n++)for(S[n]=i<<7,e=0;e<1<<l[n]-7;e++)y[256+i++]=n;for(t=0;t<=u;t++)a[t]=0;for(e=0;e<=143;)p[2*e+1]=8,e++,a[8]++;for(;e<=255;)p[2*e+1]=9,e++,a[9]++;for(;e<=279;)p[2*e+1]=7,e++,a[7]++;for(;e<=287;)p[2*e+1]=8,e++,a[8]++;for(B(p,287,a),e=0;e<s;e++)d[2*e+1]=5,d[2*e]=_(e,5);m=new C(p,c,257,o,u),b=new C(d,l,0,s,u),E=new C(new Array(0),f,0,19,7)}(),U=!0),e.l_desc=new w(e.dyn_ltree,m),e.d_desc=new w(e.dyn_dtree,b),e.bl_desc=new w(e.bl_tree,E),e.bi_buf=0,e.bi_valid=0,N(e)},t._tr_stored_block=j,t._tr_flush_block=function(e,t,r,n){var i,o,s=0;e.level>0?(2===e.strm.data_type&&(e.strm.data_type=function(e){var t,r=4093624447;for(t=0;t<=31;t++,r>>>=1)if(1&r&&0!==e.dyn_ltree[2*t])return 0;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return 1;for(t=32;t<a;t++)if(0!==e.dyn_ltree[2*t])return 1;return 0}(e)),F(e,e.l_desc),F(e,e.d_desc),s=function(e){var t;for(D(e,e.dyn_ltree,e.l_desc.max_code),D(e,e.dyn_dtree,e.d_desc.max_code),F(e,e.bl_desc),t=18;t>=3&&0===e.bl_tree[2*h[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t}(e),i=e.opt_len+3+7>>>3,(o=e.static_len+3+7>>>3)<=i&&(i=o)):i=o=r+5,r+4<=i&&-1!==t?j(e,t,r,n):4===e.strategy||o===i?(I(e,2+(n?1:0),3),P(e,p,d)):(I(e,4+(n?1:0),3),function(e,t,r,n){var i;for(I(e,t-257,5),I(e,r-1,5),I(e,n-4,4),i=0;i<n;i++)I(e,e.bl_tree[2*h[i]+1],3);L(e,e.dyn_ltree,t-1),L(e,e.dyn_dtree,r-1)}(e,e.l_desc.max_code+1,e.d_desc.max_code+1,s+1),P(e,e.dyn_ltree,e.dyn_dtree)),N(e),n&&O(e)},t._tr_tally=function(e,t,r){return e.pending_buf[e.d_buf+2*e.last_lit]=t>>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&r,e.last_lit++,0===t?e.dyn_ltree[2*r]++:(e.matches++,t--,e.dyn_ltree[2*(v[r]+a+1)]++,e.dyn_dtree[2*T(t)]++),e.last_lit===e.lit_bufsize-1},t._tr_align=function(e){I(e,2,3),k(e,256,p),function(e){16===e.bi_valid?(A(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}(e)}},2292:function(e){"use strict";e.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},4155:function(e){var t,r,n=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function o(e){if(t===setTimeout)return setTimeout(e,0);if((t===i||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(r){try{return t.call(null,e,0)}catch(r){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:i}catch(e){t=i}try{r="function"==typeof clearTimeout?clearTimeout:a}catch(e){r=a}}();var s,u=[],c=!1,l=-1;function f(){c&&s&&(c=!1,s.length?u=s.concat(u):l=-1,u.length&&h())}function h(){if(!c){var e=o(f);c=!0;for(var t=u.length;t;){for(s=u,u=[];++l<t;)s&&s[l].run();l=-1,t=u.length}s=null,c=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===a||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function p(e,t){this.fun=e,this.array=t}function d(){}n.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];u.push(new p(e,t)),1!==u.length||c||o(h)},p.prototype.run=function(){this.fun.apply(null,this.array)},n.title="browser",n.browser=!0,n.env={},n.argv=[],n.version="",n.versions={},n.on=d,n.addListener=d,n.once=d,n.off=d,n.removeListener=d,n.removeAllListeners=d,n.emit=d,n.prependListener=d,n.prependOnceListener=d,n.listeners=function(e){return[]},n.binding=function(e){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(e){throw new Error("process.chdir is not supported")},n.umask=function(){return 0}},2924:function(e,t,r){"use strict";r.d(t,{ej:function(){return u},kG:function(){return c},U6:function(){return p}});var n=r(655);!function(e){function t(){var t=this||self;t.globalThis=t,delete e.prototype._T_}"object"!=typeof globalThis&&(this?t():(e.defineProperty(e.prototype,"_T_",{configurable:!0,get:t}),_T_))}(Object);var i=globalThis,a="Invariant Violation",o=Object.setPrototypeOf,s=void 0===o?function(e,t){return e.__proto__=t,e}:o,u=function(e){function t(r){void 0===r&&(r=a);var n=e.call(this,"number"==typeof r?a+": "+r+" (see https://github.com/apollographql/invariant-packages)":r)||this;return n.framesToPop=1,n.name=a,s(n,t.prototype),n}return(0,n.ZT)(t,e),t}(Error);function c(e,t){if(!e)throw new u(t)}var l=["log","warn","error","silent"],f=l.indexOf("log");function h(e){return function(){if(l.indexOf(e)>=f)return console[e].apply(console,arguments)}}function p(e){var t=l[f];return f=Math.max(0,l.indexOf(e)),t}!function(e){e.log=h("log"),e.warn=h("warn"),e.error=h("error")}(c||(c={}));var d=i.process||{env:{}};if(!i.process)try{Object.defineProperty(i,"process",{value:d})}catch(e){}},655:function(e,t,r){"use strict";r.d(t,{ZT:function(){return i},pi:function(){return a},_T:function(){return o},mG:function(){return s},Jh:function(){return u},pr:function(){return c}});
278
+ */var r=t;r.encode=function(e){var t=encodeURIComponent(e||"");return t=t.replace(/%([0-9a-fA-F]{2})/g,(function(e,t){return t=parseInt(t,16),String.fromCharCode(t)}))},r.decode=function(e){var t=(e||"").replace(/[\u0080-\u00ff]/g,(function(e){return"%"+(256|e.charCodeAt(0)).toString(16).substring(1)}));return t=decodeURIComponent(t)}},9591:(e,t,r)=>{"use strict";var n={};(0,r(4236).assign)(n,r(4555),r(8843),r(1619)),e.exports=n},4555:(e,t,r)=>{"use strict";var n=r(405),i=r(4236),a=r(9373),o=r(8898),s=r(2292),u=Object.prototype.toString;function c(e){if(!(this instanceof c))return new c(e);this.options=i.assign({level:-1,method:8,chunkSize:16384,windowBits:15,memLevel:8,strategy:0,to:""},e||{});var t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new s,this.strm.avail_out=0;var r=n.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(0!==r)throw new Error(o[r]);if(t.header&&n.deflateSetHeader(this.strm,t.header),t.dictionary){var l;if(l="string"==typeof t.dictionary?a.string2buf(t.dictionary):"[object ArrayBuffer]"===u.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,0!==(r=n.deflateSetDictionary(this.strm,l)))throw new Error(o[r]);this._dict_set=!0}}function l(e,t){var r=new c(t);if(r.push(e,!0),r.err)throw r.msg||o[r.err];return r.result}c.prototype.push=function(e,t){var r,o,s=this.strm,c=this.options.chunkSize;if(this.ended)return!1;o=t===~~t?t:!0===t?4:0,"string"==typeof e?s.input=a.string2buf(e):"[object ArrayBuffer]"===u.call(e)?s.input=new Uint8Array(e):s.input=e,s.next_in=0,s.avail_in=s.input.length;do{if(0===s.avail_out&&(s.output=new i.Buf8(c),s.next_out=0,s.avail_out=c),1!==(r=n.deflate(s,o))&&0!==r)return this.onEnd(r),this.ended=!0,!1;0!==s.avail_out&&(0!==s.avail_in||4!==o&&2!==o)||("string"===this.options.to?this.onData(a.buf2binstring(i.shrinkBuf(s.output,s.next_out))):this.onData(i.shrinkBuf(s.output,s.next_out)))}while((s.avail_in>0||0===s.avail_out)&&1!==r);return 4===o?(r=n.deflateEnd(this.strm),this.onEnd(r),this.ended=!0,0===r):2!==o||(this.onEnd(0),s.avail_out=0,!0)},c.prototype.onData=function(e){this.chunks.push(e)},c.prototype.onEnd=function(e){0===e&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},t.Deflate=c,t.deflate=l,t.deflateRaw=function(e,t){return(t=t||{}).raw=!0,l(e,t)},t.gzip=function(e,t){return(t=t||{}).gzip=!0,l(e,t)}},8843:(e,t,r)=>{"use strict";var n=r(7948),i=r(4236),a=r(9373),o=r(1619),s=r(8898),u=r(2292),c=r(2401),l=Object.prototype.toString;function f(e){if(!(this instanceof f))return new f(e);this.options=i.assign({chunkSize:16384,windowBits:0,to:""},e||{});var t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&0==(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new u,this.strm.avail_out=0;var r=n.inflateInit2(this.strm,t.windowBits);if(r!==o.Z_OK)throw new Error(s[r]);if(this.header=new c,n.inflateGetHeader(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=a.string2buf(t.dictionary):"[object ArrayBuffer]"===l.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(r=n.inflateSetDictionary(this.strm,t.dictionary))!==o.Z_OK))throw new Error(s[r])}function h(e,t){var r=new f(t);if(r.push(e,!0),r.err)throw r.msg||s[r.err];return r.result}f.prototype.push=function(e,t){var r,s,u,c,f,h=this.strm,p=this.options.chunkSize,d=this.options.dictionary,y=!1;if(this.ended)return!1;s=t===~~t?t:!0===t?o.Z_FINISH:o.Z_NO_FLUSH,"string"==typeof e?h.input=a.binstring2buf(e):"[object ArrayBuffer]"===l.call(e)?h.input=new Uint8Array(e):h.input=e,h.next_in=0,h.avail_in=h.input.length;do{if(0===h.avail_out&&(h.output=new i.Buf8(p),h.next_out=0,h.avail_out=p),(r=n.inflate(h,o.Z_NO_FLUSH))===o.Z_NEED_DICT&&d&&(r=n.inflateSetDictionary(this.strm,d)),r===o.Z_BUF_ERROR&&!0===y&&(r=o.Z_OK,y=!1),r!==o.Z_STREAM_END&&r!==o.Z_OK)return this.onEnd(r),this.ended=!0,!1;h.next_out&&(0!==h.avail_out&&r!==o.Z_STREAM_END&&(0!==h.avail_in||s!==o.Z_FINISH&&s!==o.Z_SYNC_FLUSH)||("string"===this.options.to?(u=a.utf8border(h.output,h.next_out),c=h.next_out-u,f=a.buf2string(h.output,u),h.next_out=c,h.avail_out=p-c,c&&i.arraySet(h.output,h.output,u,c,0),this.onData(f)):this.onData(i.shrinkBuf(h.output,h.next_out)))),0===h.avail_in&&0===h.avail_out&&(y=!0)}while((h.avail_in>0||0===h.avail_out)&&r!==o.Z_STREAM_END);return r===o.Z_STREAM_END&&(s=o.Z_FINISH),s===o.Z_FINISH?(r=n.inflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===o.Z_OK):s!==o.Z_SYNC_FLUSH||(this.onEnd(o.Z_OK),h.avail_out=0,!0)},f.prototype.onData=function(e){this.chunks.push(e)},f.prototype.onEnd=function(e){e===o.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},t.Inflate=f,t.inflate=h,t.inflateRaw=function(e,t){return(t=t||{}).raw=!0,h(e,t)},t.ungzip=h},4236:(e,t)=>{"use strict";var r="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;function n(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.assign=function(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var r=t.shift();if(r){if("object"!=typeof r)throw new TypeError(r+"must be non-object");for(var i in r)n(r,i)&&(e[i]=r[i])}}return e},t.shrinkBuf=function(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)};var i={arraySet:function(e,t,r,n,i){if(t.subarray&&e.subarray)e.set(t.subarray(r,r+n),i);else for(var a=0;a<n;a++)e[i+a]=t[r+a]},flattenChunks:function(e){var t,r,n,i,a,o;for(n=0,t=0,r=e.length;t<r;t++)n+=e[t].length;for(o=new Uint8Array(n),i=0,t=0,r=e.length;t<r;t++)a=e[t],o.set(a,i),i+=a.length;return o}},a={arraySet:function(e,t,r,n,i){for(var a=0;a<n;a++)e[i+a]=t[r+a]},flattenChunks:function(e){return[].concat.apply([],e)}};t.setTyped=function(e){e?(t.Buf8=Uint8Array,t.Buf16=Uint16Array,t.Buf32=Int32Array,t.assign(t,i)):(t.Buf8=Array,t.Buf16=Array,t.Buf32=Array,t.assign(t,a))},t.setTyped(r)},9373:(e,t,r)=>{"use strict";var n=r(4236),i=!0,a=!0;try{String.fromCharCode.apply(null,[0])}catch(e){i=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){a=!1}for(var o=new n.Buf8(256),s=0;s<256;s++)o[s]=s>=252?6:s>=248?5:s>=240?4:s>=224?3:s>=192?2:1;function u(e,t){if(t<65534&&(e.subarray&&a||!e.subarray&&i))return String.fromCharCode.apply(null,n.shrinkBuf(e,t));for(var r="",o=0;o<t;o++)r+=String.fromCharCode(e[o]);return r}o[254]=o[254]=1,t.string2buf=function(e){var t,r,i,a,o,s=e.length,u=0;for(a=0;a<s;a++)55296==(64512&(r=e.charCodeAt(a)))&&a+1<s&&56320==(64512&(i=e.charCodeAt(a+1)))&&(r=65536+(r-55296<<10)+(i-56320),a++),u+=r<128?1:r<2048?2:r<65536?3:4;for(t=new n.Buf8(u),o=0,a=0;o<u;a++)55296==(64512&(r=e.charCodeAt(a)))&&a+1<s&&56320==(64512&(i=e.charCodeAt(a+1)))&&(r=65536+(r-55296<<10)+(i-56320),a++),r<128?t[o++]=r:r<2048?(t[o++]=192|r>>>6,t[o++]=128|63&r):r<65536?(t[o++]=224|r>>>12,t[o++]=128|r>>>6&63,t[o++]=128|63&r):(t[o++]=240|r>>>18,t[o++]=128|r>>>12&63,t[o++]=128|r>>>6&63,t[o++]=128|63&r);return t},t.buf2binstring=function(e){return u(e,e.length)},t.binstring2buf=function(e){for(var t=new n.Buf8(e.length),r=0,i=t.length;r<i;r++)t[r]=e.charCodeAt(r);return t},t.buf2string=function(e,t){var r,n,i,a,s=t||e.length,c=new Array(2*s);for(n=0,r=0;r<s;)if((i=e[r++])<128)c[n++]=i;else if((a=o[i])>4)c[n++]=65533,r+=a-1;else{for(i&=2===a?31:3===a?15:7;a>1&&r<s;)i=i<<6|63&e[r++],a--;a>1?c[n++]=65533:i<65536?c[n++]=i:(i-=65536,c[n++]=55296|i>>10&1023,c[n++]=56320|1023&i)}return u(c,n)},t.utf8border=function(e,t){var r;for((t=t||e.length)>e.length&&(t=e.length),r=t-1;r>=0&&128==(192&e[r]);)r--;return r<0||0===r?t:r+o[e[r]]>t?r:t}},6069:e=>{"use strict";e.exports=function(e,t,r,n){for(var i=65535&e|0,a=e>>>16&65535|0,o=0;0!==r;){r-=o=r>2e3?2e3:r;do{a=a+(i=i+t[n++]|0)|0}while(--o);i%=65521,a%=65521}return i|a<<16|0}},1619:e=>{"use strict";e.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},2869:e=>{"use strict";var t=function(){for(var e,t=[],r=0;r<256;r++){e=r;for(var n=0;n<8;n++)e=1&e?3988292384^e>>>1:e>>>1;t[r]=e}return t}();e.exports=function(e,r,n,i){var a=t,o=i+n;e^=-1;for(var s=i;s<o;s++)e=e>>>8^a[255&(e^r[s])];return-1^e}},405:(e,t,r)=>{"use strict";var n,i=r(4236),a=r(342),o=r(6069),s=r(2869),u=r(8898),c=-2,l=258,f=262,h=103,p=113,d=666;function y(e,t){return e.msg=u[t],t}function v(e){return(e<<1)-(e>4?9:0)}function g(e){for(var t=e.length;--t>=0;)e[t]=0}function m(e){var t=e.state,r=t.pending;r>e.avail_out&&(r=e.avail_out),0!==r&&(i.arraySet(e.output,t.pending_buf,t.pending_out,r,e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,0===t.pending&&(t.pending_out=0))}function b(e,t){a._tr_flush_block(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,m(e.strm)}function E(e,t){e.pending_buf[e.pending++]=t}function S(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function C(e,t){var r,n,i=e.max_chain_length,a=e.strstart,o=e.prev_length,s=e.nice_match,u=e.strstart>e.w_size-f?e.strstart-(e.w_size-f):0,c=e.window,h=e.w_mask,p=e.prev,d=e.strstart+l,y=c[a+o-1],v=c[a+o];e.prev_length>=e.good_match&&(i>>=2),s>e.lookahead&&(s=e.lookahead);do{if(c[(r=t)+o]===v&&c[r+o-1]===y&&c[r]===c[a]&&c[++r]===c[a+1]){a+=2,r++;do{}while(c[++a]===c[++r]&&c[++a]===c[++r]&&c[++a]===c[++r]&&c[++a]===c[++r]&&c[++a]===c[++r]&&c[++a]===c[++r]&&c[++a]===c[++r]&&c[++a]===c[++r]&&a<d);if(n=l-(d-a),a=d-l,n>o){if(e.match_start=t,o=n,n>=s)break;y=c[a+o-1],v=c[a+o]}}}while((t=p[t&h])>u&&0!=--i);return o<=e.lookahead?o:e.lookahead}function w(e){var t,r,n,a,u,c,l,h,p,d,y=e.w_size;do{if(a=e.window_size-e.lookahead-e.strstart,e.strstart>=y+(y-f)){i.arraySet(e.window,e.window,y,y,0),e.match_start-=y,e.strstart-=y,e.block_start-=y,t=r=e.hash_size;do{n=e.head[--t],e.head[t]=n>=y?n-y:0}while(--r);t=r=y;do{n=e.prev[--t],e.prev[t]=n>=y?n-y:0}while(--r);a+=y}if(0===e.strm.avail_in)break;if(c=e.strm,l=e.window,h=e.strstart+e.lookahead,p=a,d=void 0,(d=c.avail_in)>p&&(d=p),r=0===d?0:(c.avail_in-=d,i.arraySet(l,c.input,c.next_in,d,h),1===c.state.wrap?c.adler=o(c.adler,l,d,h):2===c.state.wrap&&(c.adler=s(c.adler,l,d,h)),c.next_in+=d,c.total_in+=d,d),e.lookahead+=r,e.lookahead+e.insert>=3)for(u=e.strstart-e.insert,e.ins_h=e.window[u],e.ins_h=(e.ins_h<<e.hash_shift^e.window[u+1])&e.hash_mask;e.insert&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[u+3-1])&e.hash_mask,e.prev[u&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=u,u++,e.insert--,!(e.lookahead+e.insert<3)););}while(e.lookahead<f&&0!==e.strm.avail_in)}function T(e,t){for(var r,n;;){if(e.lookahead<f){if(w(e),e.lookahead<f&&0===t)return 1;if(0===e.lookahead)break}if(r=0,e.lookahead>=3&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+3-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),0!==r&&e.strstart-r<=e.w_size-f&&(e.match_length=C(e,r)),e.match_length>=3)if(n=a._tr_tally(e,e.strstart-e.match_start,e.match_length-3),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=3){e.match_length--;do{e.strstart++,e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+3-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart}while(0!=--e.match_length);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+1])&e.hash_mask;else n=a._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(n&&(b(e,!1),0===e.strm.avail_out))return 1}return e.insert=e.strstart<2?e.strstart:2,4===t?(b(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(b(e,!1),0===e.strm.avail_out)?1:2}function A(e,t){for(var r,n,i;;){if(e.lookahead<f){if(w(e),e.lookahead<f&&0===t)return 1;if(0===e.lookahead)break}if(r=0,e.lookahead>=3&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+3-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=2,0!==r&&e.prev_length<e.max_lazy_match&&e.strstart-r<=e.w_size-f&&(e.match_length=C(e,r),e.match_length<=5&&(1===e.strategy||3===e.match_length&&e.strstart-e.match_start>4096)&&(e.match_length=2)),e.prev_length>=3&&e.match_length<=e.prev_length){i=e.strstart+e.lookahead-3,n=a._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-3),e.lookahead-=e.prev_length-1,e.prev_length-=2;do{++e.strstart<=i&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+3-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart)}while(0!=--e.prev_length);if(e.match_available=0,e.match_length=2,e.strstart++,n&&(b(e,!1),0===e.strm.avail_out))return 1}else if(e.match_available){if((n=a._tr_tally(e,0,e.window[e.strstart-1]))&&b(e,!1),e.strstart++,e.lookahead--,0===e.strm.avail_out)return 1}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(n=a._tr_tally(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<2?e.strstart:2,4===t?(b(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(b(e,!1),0===e.strm.avail_out)?1:2}function I(e,t,r,n,i){this.good_length=e,this.max_lazy=t,this.nice_length=r,this.max_chain=n,this.func=i}function k(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=8,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new i.Buf16(1146),this.dyn_dtree=new i.Buf16(122),this.bl_tree=new i.Buf16(78),g(this.dyn_ltree),g(this.dyn_dtree),g(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new i.Buf16(16),this.heap=new i.Buf16(573),g(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new i.Buf16(573),g(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function _(e){var t;return e&&e.state?(e.total_in=e.total_out=0,e.data_type=2,(t=e.state).pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap?42:p,e.adler=2===t.wrap?0:1,t.last_flush=0,a._tr_init(t),0):y(e,c)}function B(e){var t,r=_(e);return 0===r&&((t=e.state).window_size=2*t.w_size,g(t.head),t.max_lazy_match=n[t.level].max_lazy,t.good_match=n[t.level].good_length,t.nice_match=n[t.level].nice_length,t.max_chain_length=n[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=2,t.match_available=0,t.ins_h=0),r}function N(e,t,r,n,a,o){if(!e)return c;var s=1;if(-1===t&&(t=6),n<0?(s=0,n=-n):n>15&&(s=2,n-=16),a<1||a>9||8!==r||n<8||n>15||t<0||t>9||o<0||o>4)return y(e,c);8===n&&(n=9);var u=new k;return e.state=u,u.strm=e,u.wrap=s,u.gzhead=null,u.w_bits=n,u.w_size=1<<u.w_bits,u.w_mask=u.w_size-1,u.hash_bits=a+7,u.hash_size=1<<u.hash_bits,u.hash_mask=u.hash_size-1,u.hash_shift=~~((u.hash_bits+3-1)/3),u.window=new i.Buf8(2*u.w_size),u.head=new i.Buf16(u.hash_size),u.prev=new i.Buf16(u.w_size),u.lit_bufsize=1<<a+6,u.pending_buf_size=4*u.lit_bufsize,u.pending_buf=new i.Buf8(u.pending_buf_size),u.d_buf=1*u.lit_bufsize,u.l_buf=3*u.lit_bufsize,u.level=t,u.strategy=o,u.method=r,B(e)}n=[new I(0,0,0,0,(function(e,t){var r=65535;for(r>e.pending_buf_size-5&&(r=e.pending_buf_size-5);;){if(e.lookahead<=1){if(w(e),0===e.lookahead&&0===t)return 1;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var n=e.block_start+r;if((0===e.strstart||e.strstart>=n)&&(e.lookahead=e.strstart-n,e.strstart=n,b(e,!1),0===e.strm.avail_out))return 1;if(e.strstart-e.block_start>=e.w_size-f&&(b(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(b(e,!0),0===e.strm.avail_out?3:4):(e.strstart>e.block_start&&(b(e,!1),e.strm.avail_out),1)})),new I(4,4,8,4,T),new I(4,5,16,8,T),new I(4,6,32,32,T),new I(4,4,16,16,A),new I(8,16,32,32,A),new I(8,16,128,128,A),new I(8,32,128,256,A),new I(32,128,258,1024,A),new I(32,258,258,4096,A)],t.deflateInit=function(e,t){return N(e,t,8,15,8,0)},t.deflateInit2=N,t.deflateReset=B,t.deflateResetKeep=_,t.deflateSetHeader=function(e,t){return e&&e.state?2!==e.state.wrap?c:(e.state.gzhead=t,0):c},t.deflate=function(e,t){var r,i,o,u;if(!e||!e.state||t>5||t<0)return e?y(e,c):c;if(i=e.state,!e.output||!e.input&&0!==e.avail_in||i.status===d&&4!==t)return y(e,0===e.avail_out?-5:c);if(i.strm=e,r=i.last_flush,i.last_flush=t,42===i.status)if(2===i.wrap)e.adler=0,E(i,31),E(i,139),E(i,8),i.gzhead?(E(i,(i.gzhead.text?1:0)+(i.gzhead.hcrc?2:0)+(i.gzhead.extra?4:0)+(i.gzhead.name?8:0)+(i.gzhead.comment?16:0)),E(i,255&i.gzhead.time),E(i,i.gzhead.time>>8&255),E(i,i.gzhead.time>>16&255),E(i,i.gzhead.time>>24&255),E(i,9===i.level?2:i.strategy>=2||i.level<2?4:0),E(i,255&i.gzhead.os),i.gzhead.extra&&i.gzhead.extra.length&&(E(i,255&i.gzhead.extra.length),E(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(e.adler=s(e.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=69):(E(i,0),E(i,0),E(i,0),E(i,0),E(i,0),E(i,9===i.level?2:i.strategy>=2||i.level<2?4:0),E(i,3),i.status=p);else{var f=8+(i.w_bits-8<<4)<<8;f|=(i.strategy>=2||i.level<2?0:i.level<6?1:6===i.level?2:3)<<6,0!==i.strstart&&(f|=32),f+=31-f%31,i.status=p,S(i,f),0!==i.strstart&&(S(i,e.adler>>>16),S(i,65535&e.adler)),e.adler=1}if(69===i.status)if(i.gzhead.extra){for(o=i.pending;i.gzindex<(65535&i.gzhead.extra.length)&&(i.pending!==i.pending_buf_size||(i.gzhead.hcrc&&i.pending>o&&(e.adler=s(e.adler,i.pending_buf,i.pending-o,o)),m(e),o=i.pending,i.pending!==i.pending_buf_size));)E(i,255&i.gzhead.extra[i.gzindex]),i.gzindex++;i.gzhead.hcrc&&i.pending>o&&(e.adler=s(e.adler,i.pending_buf,i.pending-o,o)),i.gzindex===i.gzhead.extra.length&&(i.gzindex=0,i.status=73)}else i.status=73;if(73===i.status)if(i.gzhead.name){o=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>o&&(e.adler=s(e.adler,i.pending_buf,i.pending-o,o)),m(e),o=i.pending,i.pending===i.pending_buf_size)){u=1;break}u=i.gzindex<i.gzhead.name.length?255&i.gzhead.name.charCodeAt(i.gzindex++):0,E(i,u)}while(0!==u);i.gzhead.hcrc&&i.pending>o&&(e.adler=s(e.adler,i.pending_buf,i.pending-o,o)),0===u&&(i.gzindex=0,i.status=91)}else i.status=91;if(91===i.status)if(i.gzhead.comment){o=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>o&&(e.adler=s(e.adler,i.pending_buf,i.pending-o,o)),m(e),o=i.pending,i.pending===i.pending_buf_size)){u=1;break}u=i.gzindex<i.gzhead.comment.length?255&i.gzhead.comment.charCodeAt(i.gzindex++):0,E(i,u)}while(0!==u);i.gzhead.hcrc&&i.pending>o&&(e.adler=s(e.adler,i.pending_buf,i.pending-o,o)),0===u&&(i.status=h)}else i.status=h;if(i.status===h&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&m(e),i.pending+2<=i.pending_buf_size&&(E(i,255&e.adler),E(i,e.adler>>8&255),e.adler=0,i.status=p)):i.status=p),0!==i.pending){if(m(e),0===e.avail_out)return i.last_flush=-1,0}else if(0===e.avail_in&&v(t)<=v(r)&&4!==t)return y(e,-5);if(i.status===d&&0!==e.avail_in)return y(e,-5);if(0!==e.avail_in||0!==i.lookahead||0!==t&&i.status!==d){var C=2===i.strategy?function(e,t){for(var r;;){if(0===e.lookahead&&(w(e),0===e.lookahead)){if(0===t)return 1;break}if(e.match_length=0,r=a._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(b(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(b(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(b(e,!1),0===e.strm.avail_out)?1:2}(i,t):3===i.strategy?function(e,t){for(var r,n,i,o,s=e.window;;){if(e.lookahead<=l){if(w(e),e.lookahead<=l&&0===t)return 1;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=3&&e.strstart>0&&(n=s[i=e.strstart-1])===s[++i]&&n===s[++i]&&n===s[++i]){o=e.strstart+l;do{}while(n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&i<o);e.match_length=l-(o-i),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=3?(r=a._tr_tally(e,1,e.match_length-3),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=a._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(b(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(b(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(b(e,!1),0===e.strm.avail_out)?1:2}(i,t):n[i.level].func(i,t);if(3!==C&&4!==C||(i.status=d),1===C||3===C)return 0===e.avail_out&&(i.last_flush=-1),0;if(2===C&&(1===t?a._tr_align(i):5!==t&&(a._tr_stored_block(i,0,0,!1),3===t&&(g(i.head),0===i.lookahead&&(i.strstart=0,i.block_start=0,i.insert=0))),m(e),0===e.avail_out))return i.last_flush=-1,0}return 4!==t?0:i.wrap<=0?1:(2===i.wrap?(E(i,255&e.adler),E(i,e.adler>>8&255),E(i,e.adler>>16&255),E(i,e.adler>>24&255),E(i,255&e.total_in),E(i,e.total_in>>8&255),E(i,e.total_in>>16&255),E(i,e.total_in>>24&255)):(S(i,e.adler>>>16),S(i,65535&e.adler)),m(e),i.wrap>0&&(i.wrap=-i.wrap),0!==i.pending?0:1)},t.deflateEnd=function(e){var t;return e&&e.state?42!==(t=e.state.status)&&69!==t&&73!==t&&91!==t&&t!==h&&t!==p&&t!==d?y(e,c):(e.state=null,t===p?y(e,-3):0):c},t.deflateSetDictionary=function(e,t){var r,n,a,s,u,l,f,h,p=t.length;if(!e||!e.state)return c;if(2===(s=(r=e.state).wrap)||1===s&&42!==r.status||r.lookahead)return c;for(1===s&&(e.adler=o(e.adler,t,p,0)),r.wrap=0,p>=r.w_size&&(0===s&&(g(r.head),r.strstart=0,r.block_start=0,r.insert=0),h=new i.Buf8(r.w_size),i.arraySet(h,t,p-r.w_size,r.w_size,0),t=h,p=r.w_size),u=e.avail_in,l=e.next_in,f=e.input,e.avail_in=p,e.next_in=0,e.input=t,w(r);r.lookahead>=3;){n=r.strstart,a=r.lookahead-2;do{r.ins_h=(r.ins_h<<r.hash_shift^r.window[n+3-1])&r.hash_mask,r.prev[n&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=n,n++}while(--a);r.strstart=n,r.lookahead=2,w(r)}return r.strstart+=r.lookahead,r.block_start=r.strstart,r.insert=r.lookahead,r.lookahead=0,r.match_length=r.prev_length=2,r.match_available=0,e.next_in=l,e.input=f,e.avail_in=u,r.wrap=s,0},t.deflateInfo="pako deflate (from Nodeca project)"},2401:e=>{"use strict";e.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},4264:e=>{"use strict";e.exports=function(e,t){var r,n,i,a,o,s,u,c,l,f,h,p,d,y,v,g,m,b,E,S,C,w,T,A,I;r=e.state,n=e.next_in,A=e.input,i=n+(e.avail_in-5),a=e.next_out,I=e.output,o=a-(t-e.avail_out),s=a+(e.avail_out-257),u=r.dmax,c=r.wsize,l=r.whave,f=r.wnext,h=r.window,p=r.hold,d=r.bits,y=r.lencode,v=r.distcode,g=(1<<r.lenbits)-1,m=(1<<r.distbits)-1;e:do{d<15&&(p+=A[n++]<<d,d+=8,p+=A[n++]<<d,d+=8),b=y[p&g];t:for(;;){if(p>>>=E=b>>>24,d-=E,0===(E=b>>>16&255))I[a++]=65535&b;else{if(!(16&E)){if(0==(64&E)){b=y[(65535&b)+(p&(1<<E)-1)];continue t}if(32&E){r.mode=12;break e}e.msg="invalid literal/length code",r.mode=30;break e}S=65535&b,(E&=15)&&(d<E&&(p+=A[n++]<<d,d+=8),S+=p&(1<<E)-1,p>>>=E,d-=E),d<15&&(p+=A[n++]<<d,d+=8,p+=A[n++]<<d,d+=8),b=v[p&m];r:for(;;){if(p>>>=E=b>>>24,d-=E,!(16&(E=b>>>16&255))){if(0==(64&E)){b=v[(65535&b)+(p&(1<<E)-1)];continue r}e.msg="invalid distance code",r.mode=30;break e}if(C=65535&b,d<(E&=15)&&(p+=A[n++]<<d,(d+=8)<E&&(p+=A[n++]<<d,d+=8)),(C+=p&(1<<E)-1)>u){e.msg="invalid distance too far back",r.mode=30;break e}if(p>>>=E,d-=E,C>(E=a-o)){if((E=C-E)>l&&r.sane){e.msg="invalid distance too far back",r.mode=30;break e}if(w=0,T=h,0===f){if(w+=c-E,E<S){S-=E;do{I[a++]=h[w++]}while(--E);w=a-C,T=I}}else if(f<E){if(w+=c+f-E,(E-=f)<S){S-=E;do{I[a++]=h[w++]}while(--E);if(w=0,f<S){S-=E=f;do{I[a++]=h[w++]}while(--E);w=a-C,T=I}}}else if(w+=f-E,E<S){S-=E;do{I[a++]=h[w++]}while(--E);w=a-C,T=I}for(;S>2;)I[a++]=T[w++],I[a++]=T[w++],I[a++]=T[w++],S-=3;S&&(I[a++]=T[w++],S>1&&(I[a++]=T[w++]))}else{w=a-C;do{I[a++]=I[w++],I[a++]=I[w++],I[a++]=I[w++],S-=3}while(S>2);S&&(I[a++]=I[w++],S>1&&(I[a++]=I[w++]))}break}}break}}while(n<i&&a<s);n-=S=d>>3,p&=(1<<(d-=S<<3))-1,e.next_in=n,e.next_out=a,e.avail_in=n<i?i-n+5:5-(n-i),e.avail_out=a<s?s-a+257:257-(a-s),r.hold=p,r.bits=d}},7948:(e,t,r)=>{"use strict";var n=r(4236),i=r(6069),a=r(2869),o=r(4264),s=r(9241),u=-2,c=12,l=30;function f(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function h(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new n.Buf16(320),this.work=new n.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function p(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=1,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new n.Buf32(852),t.distcode=t.distdyn=new n.Buf32(592),t.sane=1,t.back=-1,0):u}function d(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,p(e)):u}function y(e,t){var r,n;return e&&e.state?(n=e.state,t<0?(r=0,t=-t):(r=1+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?u:(null!==n.window&&n.wbits!==t&&(n.window=null),n.wrap=r,n.wbits=t,d(e))):u}function v(e,t){var r,n;return e?(n=new h,e.state=n,n.window=null,0!==(r=y(e,t))&&(e.state=null),r):u}var g,m,b=!0;function E(e){if(b){var t;for(g=new n.Buf32(512),m=new n.Buf32(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(s(1,e.lens,0,288,g,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;s(2,e.lens,0,32,m,0,e.work,{bits:5}),b=!1}e.lencode=g,e.lenbits=9,e.distcode=m,e.distbits=5}function S(e,t,r,i){var a,o=e.state;return null===o.window&&(o.wsize=1<<o.wbits,o.wnext=0,o.whave=0,o.window=new n.Buf8(o.wsize)),i>=o.wsize?(n.arraySet(o.window,t,r-o.wsize,o.wsize,0),o.wnext=0,o.whave=o.wsize):((a=o.wsize-o.wnext)>i&&(a=i),n.arraySet(o.window,t,r-i,a,o.wnext),(i-=a)?(n.arraySet(o.window,t,r-i,i,0),o.wnext=i,o.whave=o.wsize):(o.wnext+=a,o.wnext===o.wsize&&(o.wnext=0),o.whave<o.wsize&&(o.whave+=a))),0}t.inflateReset=d,t.inflateReset2=y,t.inflateResetKeep=p,t.inflateInit=function(e){return v(e,15)},t.inflateInit2=v,t.inflate=function(e,t){var r,h,p,d,y,v,g,m,b,C,w,T,A,I,k,_,B,N,O,R,x,P,F,D,L=0,U=new n.Buf8(4),j=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!e||!e.state||!e.output||!e.input&&0!==e.avail_in)return u;(r=e.state).mode===c&&(r.mode=13),y=e.next_out,p=e.output,g=e.avail_out,d=e.next_in,h=e.input,v=e.avail_in,m=r.hold,b=r.bits,C=v,w=g,P=0;e:for(;;)switch(r.mode){case 1:if(0===r.wrap){r.mode=13;break}for(;b<16;){if(0===v)break e;v--,m+=h[d++]<<b,b+=8}if(2&r.wrap&&35615===m){r.check=0,U[0]=255&m,U[1]=m>>>8&255,r.check=a(r.check,U,2,0),m=0,b=0,r.mode=2;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&m)<<8)+(m>>8))%31){e.msg="incorrect header check",r.mode=l;break}if(8!=(15&m)){e.msg="unknown compression method",r.mode=l;break}if(b-=4,x=8+(15&(m>>>=4)),0===r.wbits)r.wbits=x;else if(x>r.wbits){e.msg="invalid window size",r.mode=l;break}r.dmax=1<<x,e.adler=r.check=1,r.mode=512&m?10:c,m=0,b=0;break;case 2:for(;b<16;){if(0===v)break e;v--,m+=h[d++]<<b,b+=8}if(r.flags=m,8!=(255&r.flags)){e.msg="unknown compression method",r.mode=l;break}if(57344&r.flags){e.msg="unknown header flags set",r.mode=l;break}r.head&&(r.head.text=m>>8&1),512&r.flags&&(U[0]=255&m,U[1]=m>>>8&255,r.check=a(r.check,U,2,0)),m=0,b=0,r.mode=3;case 3:for(;b<32;){if(0===v)break e;v--,m+=h[d++]<<b,b+=8}r.head&&(r.head.time=m),512&r.flags&&(U[0]=255&m,U[1]=m>>>8&255,U[2]=m>>>16&255,U[3]=m>>>24&255,r.check=a(r.check,U,4,0)),m=0,b=0,r.mode=4;case 4:for(;b<16;){if(0===v)break e;v--,m+=h[d++]<<b,b+=8}r.head&&(r.head.xflags=255&m,r.head.os=m>>8),512&r.flags&&(U[0]=255&m,U[1]=m>>>8&255,r.check=a(r.check,U,2,0)),m=0,b=0,r.mode=5;case 5:if(1024&r.flags){for(;b<16;){if(0===v)break e;v--,m+=h[d++]<<b,b+=8}r.length=m,r.head&&(r.head.extra_len=m),512&r.flags&&(U[0]=255&m,U[1]=m>>>8&255,r.check=a(r.check,U,2,0)),m=0,b=0}else r.head&&(r.head.extra=null);r.mode=6;case 6:if(1024&r.flags&&((T=r.length)>v&&(T=v),T&&(r.head&&(x=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),n.arraySet(r.head.extra,h,d,T,x)),512&r.flags&&(r.check=a(r.check,h,T,d)),v-=T,d+=T,r.length-=T),r.length))break e;r.length=0,r.mode=7;case 7:if(2048&r.flags){if(0===v)break e;T=0;do{x=h[d+T++],r.head&&x&&r.length<65536&&(r.head.name+=String.fromCharCode(x))}while(x&&T<v);if(512&r.flags&&(r.check=a(r.check,h,T,d)),v-=T,d+=T,x)break e}else r.head&&(r.head.name=null);r.length=0,r.mode=8;case 8:if(4096&r.flags){if(0===v)break e;T=0;do{x=h[d+T++],r.head&&x&&r.length<65536&&(r.head.comment+=String.fromCharCode(x))}while(x&&T<v);if(512&r.flags&&(r.check=a(r.check,h,T,d)),v-=T,d+=T,x)break e}else r.head&&(r.head.comment=null);r.mode=9;case 9:if(512&r.flags){for(;b<16;){if(0===v)break e;v--,m+=h[d++]<<b,b+=8}if(m!==(65535&r.check)){e.msg="header crc mismatch",r.mode=l;break}m=0,b=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=c;break;case 10:for(;b<32;){if(0===v)break e;v--,m+=h[d++]<<b,b+=8}e.adler=r.check=f(m),m=0,b=0,r.mode=11;case 11:if(0===r.havedict)return e.next_out=y,e.avail_out=g,e.next_in=d,e.avail_in=v,r.hold=m,r.bits=b,2;e.adler=r.check=1,r.mode=c;case c:if(5===t||6===t)break e;case 13:if(r.last){m>>>=7&b,b-=7&b,r.mode=27;break}for(;b<3;){if(0===v)break e;v--,m+=h[d++]<<b,b+=8}switch(r.last=1&m,b-=1,3&(m>>>=1)){case 0:r.mode=14;break;case 1:if(E(r),r.mode=20,6===t){m>>>=2,b-=2;break e}break;case 2:r.mode=17;break;case 3:e.msg="invalid block type",r.mode=l}m>>>=2,b-=2;break;case 14:for(m>>>=7&b,b-=7&b;b<32;){if(0===v)break e;v--,m+=h[d++]<<b,b+=8}if((65535&m)!=(m>>>16^65535)){e.msg="invalid stored block lengths",r.mode=l;break}if(r.length=65535&m,m=0,b=0,r.mode=15,6===t)break e;case 15:r.mode=16;case 16:if(T=r.length){if(T>v&&(T=v),T>g&&(T=g),0===T)break e;n.arraySet(p,h,d,T,y),v-=T,d+=T,g-=T,y+=T,r.length-=T;break}r.mode=c;break;case 17:for(;b<14;){if(0===v)break e;v--,m+=h[d++]<<b,b+=8}if(r.nlen=257+(31&m),m>>>=5,b-=5,r.ndist=1+(31&m),m>>>=5,b-=5,r.ncode=4+(15&m),m>>>=4,b-=4,r.nlen>286||r.ndist>30){e.msg="too many length or distance symbols",r.mode=l;break}r.have=0,r.mode=18;case 18:for(;r.have<r.ncode;){for(;b<3;){if(0===v)break e;v--,m+=h[d++]<<b,b+=8}r.lens[j[r.have++]]=7&m,m>>>=3,b-=3}for(;r.have<19;)r.lens[j[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,F={bits:r.lenbits},P=s(0,r.lens,0,19,r.lencode,0,r.work,F),r.lenbits=F.bits,P){e.msg="invalid code lengths set",r.mode=l;break}r.have=0,r.mode=19;case 19:for(;r.have<r.nlen+r.ndist;){for(;_=(L=r.lencode[m&(1<<r.lenbits)-1])>>>16&255,B=65535&L,!((k=L>>>24)<=b);){if(0===v)break e;v--,m+=h[d++]<<b,b+=8}if(B<16)m>>>=k,b-=k,r.lens[r.have++]=B;else{if(16===B){for(D=k+2;b<D;){if(0===v)break e;v--,m+=h[d++]<<b,b+=8}if(m>>>=k,b-=k,0===r.have){e.msg="invalid bit length repeat",r.mode=l;break}x=r.lens[r.have-1],T=3+(3&m),m>>>=2,b-=2}else if(17===B){for(D=k+3;b<D;){if(0===v)break e;v--,m+=h[d++]<<b,b+=8}b-=k,x=0,T=3+(7&(m>>>=k)),m>>>=3,b-=3}else{for(D=k+7;b<D;){if(0===v)break e;v--,m+=h[d++]<<b,b+=8}b-=k,x=0,T=11+(127&(m>>>=k)),m>>>=7,b-=7}if(r.have+T>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=l;break}for(;T--;)r.lens[r.have++]=x}}if(r.mode===l)break;if(0===r.lens[256]){e.msg="invalid code -- missing end-of-block",r.mode=l;break}if(r.lenbits=9,F={bits:r.lenbits},P=s(1,r.lens,0,r.nlen,r.lencode,0,r.work,F),r.lenbits=F.bits,P){e.msg="invalid literal/lengths set",r.mode=l;break}if(r.distbits=6,r.distcode=r.distdyn,F={bits:r.distbits},P=s(2,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,F),r.distbits=F.bits,P){e.msg="invalid distances set",r.mode=l;break}if(r.mode=20,6===t)break e;case 20:r.mode=21;case 21:if(v>=6&&g>=258){e.next_out=y,e.avail_out=g,e.next_in=d,e.avail_in=v,r.hold=m,r.bits=b,o(e,w),y=e.next_out,p=e.output,g=e.avail_out,d=e.next_in,h=e.input,v=e.avail_in,m=r.hold,b=r.bits,r.mode===c&&(r.back=-1);break}for(r.back=0;_=(L=r.lencode[m&(1<<r.lenbits)-1])>>>16&255,B=65535&L,!((k=L>>>24)<=b);){if(0===v)break e;v--,m+=h[d++]<<b,b+=8}if(_&&0==(240&_)){for(N=k,O=_,R=B;_=(L=r.lencode[R+((m&(1<<N+O)-1)>>N)])>>>16&255,B=65535&L,!(N+(k=L>>>24)<=b);){if(0===v)break e;v--,m+=h[d++]<<b,b+=8}m>>>=N,b-=N,r.back+=N}if(m>>>=k,b-=k,r.back+=k,r.length=B,0===_){r.mode=26;break}if(32&_){r.back=-1,r.mode=c;break}if(64&_){e.msg="invalid literal/length code",r.mode=l;break}r.extra=15&_,r.mode=22;case 22:if(r.extra){for(D=r.extra;b<D;){if(0===v)break e;v--,m+=h[d++]<<b,b+=8}r.length+=m&(1<<r.extra)-1,m>>>=r.extra,b-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=23;case 23:for(;_=(L=r.distcode[m&(1<<r.distbits)-1])>>>16&255,B=65535&L,!((k=L>>>24)<=b);){if(0===v)break e;v--,m+=h[d++]<<b,b+=8}if(0==(240&_)){for(N=k,O=_,R=B;_=(L=r.distcode[R+((m&(1<<N+O)-1)>>N)])>>>16&255,B=65535&L,!(N+(k=L>>>24)<=b);){if(0===v)break e;v--,m+=h[d++]<<b,b+=8}m>>>=N,b-=N,r.back+=N}if(m>>>=k,b-=k,r.back+=k,64&_){e.msg="invalid distance code",r.mode=l;break}r.offset=B,r.extra=15&_,r.mode=24;case 24:if(r.extra){for(D=r.extra;b<D;){if(0===v)break e;v--,m+=h[d++]<<b,b+=8}r.offset+=m&(1<<r.extra)-1,m>>>=r.extra,b-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=l;break}r.mode=25;case 25:if(0===g)break e;if(T=w-g,r.offset>T){if((T=r.offset-T)>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=l;break}T>r.wnext?(T-=r.wnext,A=r.wsize-T):A=r.wnext-T,T>r.length&&(T=r.length),I=r.window}else I=p,A=y-r.offset,T=r.length;T>g&&(T=g),g-=T,r.length-=T;do{p[y++]=I[A++]}while(--T);0===r.length&&(r.mode=21);break;case 26:if(0===g)break e;p[y++]=r.length,g--,r.mode=21;break;case 27:if(r.wrap){for(;b<32;){if(0===v)break e;v--,m|=h[d++]<<b,b+=8}if(w-=g,e.total_out+=w,r.total+=w,w&&(e.adler=r.check=r.flags?a(r.check,p,w,y-w):i(r.check,p,w,y-w)),w=g,(r.flags?m:f(m))!==r.check){e.msg="incorrect data check",r.mode=l;break}m=0,b=0}r.mode=28;case 28:if(r.wrap&&r.flags){for(;b<32;){if(0===v)break e;v--,m+=h[d++]<<b,b+=8}if(m!==(4294967295&r.total)){e.msg="incorrect length check",r.mode=l;break}m=0,b=0}r.mode=29;case 29:P=1;break e;case l:P=-3;break e;case 31:return-4;case 32:default:return u}return e.next_out=y,e.avail_out=g,e.next_in=d,e.avail_in=v,r.hold=m,r.bits=b,(r.wsize||w!==e.avail_out&&r.mode<l&&(r.mode<27||4!==t))&&S(e,e.output,e.next_out,w-e.avail_out)?(r.mode=31,-4):(C-=e.avail_in,w-=e.avail_out,e.total_in+=C,e.total_out+=w,r.total+=w,r.wrap&&w&&(e.adler=r.check=r.flags?a(r.check,p,w,e.next_out-w):i(r.check,p,w,e.next_out-w)),e.data_type=r.bits+(r.last?64:0)+(r.mode===c?128:0)+(20===r.mode||15===r.mode?256:0),(0===C&&0===w||4===t)&&0===P&&(P=-5),P)},t.inflateEnd=function(e){if(!e||!e.state)return u;var t=e.state;return t.window&&(t.window=null),e.state=null,0},t.inflateGetHeader=function(e,t){var r;return e&&e.state?0==(2&(r=e.state).wrap)?u:(r.head=t,t.done=!1,0):u},t.inflateSetDictionary=function(e,t){var r,n=t.length;return e&&e.state?0!==(r=e.state).wrap&&11!==r.mode?u:11===r.mode&&i(1,t,n,0)!==r.check?-3:S(e,t,n,n)?(r.mode=31,-4):(r.havedict=1,0):u},t.inflateInfo="pako inflate (from Nodeca project)"},9241:(e,t,r)=>{"use strict";var n=r(4236),i=15,a=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],o=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],s=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],u=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];e.exports=function(e,t,r,c,l,f,h,p){var d,y,v,g,m,b,E,S,C,w=p.bits,T=0,A=0,I=0,k=0,_=0,B=0,N=0,O=0,R=0,x=0,P=null,F=0,D=new n.Buf16(16),L=new n.Buf16(16),U=null,j=0;for(T=0;T<=i;T++)D[T]=0;for(A=0;A<c;A++)D[t[r+A]]++;for(_=w,k=i;k>=1&&0===D[k];k--);if(_>k&&(_=k),0===k)return l[f++]=20971520,l[f++]=20971520,p.bits=1,0;for(I=1;I<k&&0===D[I];I++);for(_<I&&(_=I),O=1,T=1;T<=i;T++)if(O<<=1,(O-=D[T])<0)return-1;if(O>0&&(0===e||1!==k))return-1;for(L[1]=0,T=1;T<i;T++)L[T+1]=L[T]+D[T];for(A=0;A<c;A++)0!==t[r+A]&&(h[L[t[r+A]]++]=A);if(0===e?(P=U=h,b=19):1===e?(P=a,F-=257,U=o,j-=257,b=256):(P=s,U=u,b=-1),x=0,A=0,T=I,m=f,B=_,N=0,v=-1,g=(R=1<<_)-1,1===e&&R>852||2===e&&R>592)return 1;for(;;){E=T-N,h[A]<b?(S=0,C=h[A]):h[A]>b?(S=U[j+h[A]],C=P[F+h[A]]):(S=96,C=0),d=1<<T-N,I=y=1<<B;do{l[m+(x>>N)+(y-=d)]=E<<24|S<<16|C|0}while(0!==y);for(d=1<<T-1;x&d;)d>>=1;if(0!==d?(x&=d-1,x+=d):x=0,A++,0==--D[T]){if(T===k)break;T=t[r+h[A]]}if(T>_&&(x&g)!==v){for(0===N&&(N=_),m+=I,O=1<<(B=T-N);B+N<k&&!((O-=D[B+N])<=0);)B++,O<<=1;if(R+=1<<B,1===e&&R>852||2===e&&R>592)return 1;l[v=x&g]=_<<24|B<<16|m-f|0}}return 0!==x&&(l[m+x]=T-N<<24|64<<16|0),p.bits=_,0}},8898:e=>{"use strict";e.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},342:(e,t,r)=>{"use strict";var n=r(4236);function i(e){for(var t=e.length;--t>=0;)e[t]=0}var a=256,o=286,s=30,u=15,c=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],l=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],f=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],h=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],p=new Array(576);i(p);var d=new Array(60);i(d);var y=new Array(512);i(y);var v=new Array(256);i(v);var g=new Array(29);i(g);var m,b,E,S=new Array(s);function C(e,t,r,n,i){this.static_tree=e,this.extra_bits=t,this.extra_base=r,this.elems=n,this.max_length=i,this.has_stree=e&&e.length}function w(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function T(e){return e<256?y[e]:y[256+(e>>>7)]}function A(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function I(e,t,r){e.bi_valid>16-r?(e.bi_buf|=t<<e.bi_valid&65535,A(e,e.bi_buf),e.bi_buf=t>>16-e.bi_valid,e.bi_valid+=r-16):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=r)}function k(e,t,r){I(e,r[2*t],r[2*t+1])}function _(e,t){var r=0;do{r|=1&e,e>>>=1,r<<=1}while(--t>0);return r>>>1}function B(e,t,r){var n,i,a=new Array(16),o=0;for(n=1;n<=u;n++)a[n]=o=o+r[n-1]<<1;for(i=0;i<=t;i++){var s=e[2*i+1];0!==s&&(e[2*i]=_(a[s]++,s))}}function N(e){var t;for(t=0;t<o;t++)e.dyn_ltree[2*t]=0;for(t=0;t<s;t++)e.dyn_dtree[2*t]=0;for(t=0;t<19;t++)e.bl_tree[2*t]=0;e.dyn_ltree[512]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0}function O(e){e.bi_valid>8?A(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function R(e,t,r,n){var i=2*t,a=2*r;return e[i]<e[a]||e[i]===e[a]&&n[t]<=n[r]}function x(e,t,r){for(var n=e.heap[r],i=r<<1;i<=e.heap_len&&(i<e.heap_len&&R(t,e.heap[i+1],e.heap[i],e.depth)&&i++,!R(t,n,e.heap[i],e.depth));)e.heap[r]=e.heap[i],r=i,i<<=1;e.heap[r]=n}function P(e,t,r){var n,i,o,s,u=0;if(0!==e.last_lit)do{n=e.pending_buf[e.d_buf+2*u]<<8|e.pending_buf[e.d_buf+2*u+1],i=e.pending_buf[e.l_buf+u],u++,0===n?k(e,i,t):(k(e,(o=v[i])+a+1,t),0!==(s=c[o])&&I(e,i-=g[o],s),k(e,o=T(--n),r),0!==(s=l[o])&&I(e,n-=S[o],s))}while(u<e.last_lit);k(e,256,t)}function F(e,t){var r,n,i,a=t.dyn_tree,o=t.stat_desc.static_tree,s=t.stat_desc.has_stree,c=t.stat_desc.elems,l=-1;for(e.heap_len=0,e.heap_max=573,r=0;r<c;r++)0!==a[2*r]?(e.heap[++e.heap_len]=l=r,e.depth[r]=0):a[2*r+1]=0;for(;e.heap_len<2;)a[2*(i=e.heap[++e.heap_len]=l<2?++l:0)]=1,e.depth[i]=0,e.opt_len--,s&&(e.static_len-=o[2*i+1]);for(t.max_code=l,r=e.heap_len>>1;r>=1;r--)x(e,a,r);i=c;do{r=e.heap[1],e.heap[1]=e.heap[e.heap_len--],x(e,a,1),n=e.heap[1],e.heap[--e.heap_max]=r,e.heap[--e.heap_max]=n,a[2*i]=a[2*r]+a[2*n],e.depth[i]=(e.depth[r]>=e.depth[n]?e.depth[r]:e.depth[n])+1,a[2*r+1]=a[2*n+1]=i,e.heap[1]=i++,x(e,a,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],function(e,t){var r,n,i,a,o,s,c=t.dyn_tree,l=t.max_code,f=t.stat_desc.static_tree,h=t.stat_desc.has_stree,p=t.stat_desc.extra_bits,d=t.stat_desc.extra_base,y=t.stat_desc.max_length,v=0;for(a=0;a<=u;a++)e.bl_count[a]=0;for(c[2*e.heap[e.heap_max]+1]=0,r=e.heap_max+1;r<573;r++)(a=c[2*c[2*(n=e.heap[r])+1]+1]+1)>y&&(a=y,v++),c[2*n+1]=a,n>l||(e.bl_count[a]++,o=0,n>=d&&(o=p[n-d]),s=c[2*n],e.opt_len+=s*(a+o),h&&(e.static_len+=s*(f[2*n+1]+o)));if(0!==v){do{for(a=y-1;0===e.bl_count[a];)a--;e.bl_count[a]--,e.bl_count[a+1]+=2,e.bl_count[y]--,v-=2}while(v>0);for(a=y;0!==a;a--)for(n=e.bl_count[a];0!==n;)(i=e.heap[--r])>l||(c[2*i+1]!==a&&(e.opt_len+=(a-c[2*i+1])*c[2*i],c[2*i+1]=a),n--)}}(e,t),B(a,l,e.bl_count)}function D(e,t,r){var n,i,a=-1,o=t[1],s=0,u=7,c=4;for(0===o&&(u=138,c=3),t[2*(r+1)+1]=65535,n=0;n<=r;n++)i=o,o=t[2*(n+1)+1],++s<u&&i===o||(s<c?e.bl_tree[2*i]+=s:0!==i?(i!==a&&e.bl_tree[2*i]++,e.bl_tree[32]++):s<=10?e.bl_tree[34]++:e.bl_tree[36]++,s=0,a=i,0===o?(u=138,c=3):i===o?(u=6,c=3):(u=7,c=4))}function L(e,t,r){var n,i,a=-1,o=t[1],s=0,u=7,c=4;for(0===o&&(u=138,c=3),n=0;n<=r;n++)if(i=o,o=t[2*(n+1)+1],!(++s<u&&i===o)){if(s<c)do{k(e,i,e.bl_tree)}while(0!=--s);else 0!==i?(i!==a&&(k(e,i,e.bl_tree),s--),k(e,16,e.bl_tree),I(e,s-3,2)):s<=10?(k(e,17,e.bl_tree),I(e,s-3,3)):(k(e,18,e.bl_tree),I(e,s-11,7));s=0,a=i,0===o?(u=138,c=3):i===o?(u=6,c=3):(u=7,c=4)}}i(S);var U=!1;function j(e,t,r,i){I(e,0+(i?1:0),3),function(e,t,r,i){O(e),i&&(A(e,r),A(e,~r)),n.arraySet(e.pending_buf,e.window,t,r,e.pending),e.pending+=r}(e,t,r,!0)}t._tr_init=function(e){U||(!function(){var e,t,r,n,i,a=new Array(16);for(r=0,n=0;n<28;n++)for(g[n]=r,e=0;e<1<<c[n];e++)v[r++]=n;for(v[r-1]=n,i=0,n=0;n<16;n++)for(S[n]=i,e=0;e<1<<l[n];e++)y[i++]=n;for(i>>=7;n<s;n++)for(S[n]=i<<7,e=0;e<1<<l[n]-7;e++)y[256+i++]=n;for(t=0;t<=u;t++)a[t]=0;for(e=0;e<=143;)p[2*e+1]=8,e++,a[8]++;for(;e<=255;)p[2*e+1]=9,e++,a[9]++;for(;e<=279;)p[2*e+1]=7,e++,a[7]++;for(;e<=287;)p[2*e+1]=8,e++,a[8]++;for(B(p,287,a),e=0;e<s;e++)d[2*e+1]=5,d[2*e]=_(e,5);m=new C(p,c,257,o,u),b=new C(d,l,0,s,u),E=new C(new Array(0),f,0,19,7)}(),U=!0),e.l_desc=new w(e.dyn_ltree,m),e.d_desc=new w(e.dyn_dtree,b),e.bl_desc=new w(e.bl_tree,E),e.bi_buf=0,e.bi_valid=0,N(e)},t._tr_stored_block=j,t._tr_flush_block=function(e,t,r,n){var i,o,s=0;e.level>0?(2===e.strm.data_type&&(e.strm.data_type=function(e){var t,r=4093624447;for(t=0;t<=31;t++,r>>>=1)if(1&r&&0!==e.dyn_ltree[2*t])return 0;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return 1;for(t=32;t<a;t++)if(0!==e.dyn_ltree[2*t])return 1;return 0}(e)),F(e,e.l_desc),F(e,e.d_desc),s=function(e){var t;for(D(e,e.dyn_ltree,e.l_desc.max_code),D(e,e.dyn_dtree,e.d_desc.max_code),F(e,e.bl_desc),t=18;t>=3&&0===e.bl_tree[2*h[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t}(e),i=e.opt_len+3+7>>>3,(o=e.static_len+3+7>>>3)<=i&&(i=o)):i=o=r+5,r+4<=i&&-1!==t?j(e,t,r,n):4===e.strategy||o===i?(I(e,2+(n?1:0),3),P(e,p,d)):(I(e,4+(n?1:0),3),function(e,t,r,n){var i;for(I(e,t-257,5),I(e,r-1,5),I(e,n-4,4),i=0;i<n;i++)I(e,e.bl_tree[2*h[i]+1],3);L(e,e.dyn_ltree,t-1),L(e,e.dyn_dtree,r-1)}(e,e.l_desc.max_code+1,e.d_desc.max_code+1,s+1),P(e,e.dyn_ltree,e.dyn_dtree)),N(e),n&&O(e)},t._tr_tally=function(e,t,r){return e.pending_buf[e.d_buf+2*e.last_lit]=t>>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&r,e.last_lit++,0===t?e.dyn_ltree[2*r]++:(e.matches++,t--,e.dyn_ltree[2*(v[r]+a+1)]++,e.dyn_dtree[2*T(t)]++),e.last_lit===e.lit_bufsize-1},t._tr_align=function(e){I(e,2,3),k(e,256,p),function(e){16===e.bi_valid?(A(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}(e)}},2292:e=>{"use strict";e.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},4155:e=>{var t,r,n=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function o(e){if(t===setTimeout)return setTimeout(e,0);if((t===i||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(r){try{return t.call(null,e,0)}catch(r){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:i}catch(e){t=i}try{r="function"==typeof clearTimeout?clearTimeout:a}catch(e){r=a}}();var s,u=[],c=!1,l=-1;function f(){c&&s&&(c=!1,s.length?u=s.concat(u):l=-1,u.length&&h())}function h(){if(!c){var e=o(f);c=!0;for(var t=u.length;t;){for(s=u,u=[];++l<t;)s&&s[l].run();l=-1,t=u.length}s=null,c=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===a||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function p(e,t){this.fun=e,this.array=t}function d(){}n.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];u.push(new p(e,t)),1!==u.length||c||o(h)},p.prototype.run=function(){this.fun.apply(null,this.array)},n.title="browser",n.browser=!0,n.env={},n.argv=[],n.version="",n.versions={},n.on=d,n.addListener=d,n.once=d,n.off=d,n.removeListener=d,n.removeAllListeners=d,n.emit=d,n.prependListener=d,n.prependOnceListener=d,n.listeners=function(e){return[]},n.binding=function(e){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(e){throw new Error("process.chdir is not supported")},n.umask=function(){return 0}},7121:(e,t,r)=>{"use strict";e=r.hmd(e);!function(e){var t,r=e.Symbol;if("function"==typeof r)if(r.observable)t=r.observable;else{t=r.for("https://github.com/benlesh/symbol-observable");try{r.observable=t}catch(e){}}else t="@@observable"}("undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==r.g?r.g:e)},2924:(e,t,r)=>{"use strict";r.d(t,{ej:()=>l,kG:()=>f,U6:()=>y});var n=r(655);!function(e){function t(){var t=this||self;t.globalThis=t,delete e.prototype._T_}"object"!=typeof globalThis&&(this?t():(e.defineProperty(e.prototype,"_T_",{configurable:!0,get:t}),_T_))}(Object);const i=globalThis;var a=i,o=a.console,s="Invariant Violation",u=Object.setPrototypeOf,c=void 0===u?function(e,t){return e.__proto__=t,e}:u,l=function(e){function t(r){void 0===r&&(r=s);var n=e.call(this,"number"==typeof r?s+": "+r+" (see https://github.com/apollographql/invariant-packages)":r)||this;return n.framesToPop=1,n.name=s,c(n,t.prototype),n}return(0,n.ZT)(t,e),t}(Error);function f(e,t){if(!e)throw new l(t)}var h=["log","warn","error","silent"],p=h.indexOf("log");function d(e){return function(){if(h.indexOf(e)>=p)return o[e].apply(o,arguments)}}function y(e){var t=h[p];return p=Math.max(0,h.indexOf(e)),t}!function(e){e.log=d("log"),e.warn=d("warn"),e.error=d("error")}(f||(f={}));var v=a.process||{env:{}};if(!a.process)try{Object.defineProperty(i,"process",{value:v})}catch(e){}},655:(e,t,r)=>{"use strict";r.d(t,{ZT:()=>i,pi:()=>a,_T:()=>o,mG:()=>s,Jh:()=>u,pr:()=>c});
279
279
  /*! *****************************************************************************
280
280
  Copyright (c) Microsoft Corporation.
281
281
 
@@ -290,4 +290,4 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
290
290
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
291
291
  PERFORMANCE OF THIS SOFTWARE.
292
292
  ***************************************************************************** */
293
- var n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)};function i(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var a=function(){return(a=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function o(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r}function s(e,t,r,n){return new(r||(r=Promise))((function(i,a){function o(e){try{u(n.next(e))}catch(e){a(e)}}function s(e){try{u(n.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,s)}u((n=n.apply(e,t||[])).next())}))}function u(e,t){var r,n,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;o;)try{if(r=1,n&&(i=2&a[0]?n.return:a[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,a[1])).done)return i;switch(n=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,n=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!(i=o.trys,(i=i.length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){o.label=a[1];break}if(6===a[0]&&o.label<i[1]){o.label=i[1],i=a;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(a);break}i[2]&&o.ops.pop(),o.trys.pop();continue}a=t.call(e,o)}catch(e){a=[6,e],n=0}finally{r=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}}function c(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;var n=Array(e),i=0;for(t=0;t<r;t++)for(var a=arguments[t],o=0,s=a.length;o<s;o++,i++)n[i]=a[o];return n}},5877:function(e,t,r){var n=r(3570),i=r(1171),a=i;a.v1=n,a.v4=i,e.exports=a},5327:function(e){for(var t=[],r=0;r<256;++r)t[r]=(r+256).toString(16).substr(1);e.exports=function(e,r){var n=r||0,i=t;return[i[e[n++]],i[e[n++]],i[e[n++]],i[e[n++]],"-",i[e[n++]],i[e[n++]],"-",i[e[n++]],i[e[n++]],"-",i[e[n++]],i[e[n++]],"-",i[e[n++]],i[e[n++]],i[e[n++]],i[e[n++]],i[e[n++]],i[e[n++]]].join("")}},5217:function(e){var t="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(t){var r=new Uint8Array(16);e.exports=function(){return t(r),r}}else{var n=new Array(16);e.exports=function(){for(var e,t=0;t<16;t++)0==(3&t)&&(e=4294967296*Math.random()),n[t]=e>>>((3&t)<<3)&255;return n}}},3570:function(e,t,r){var n,i,a=r(5217),o=r(5327),s=0,u=0;e.exports=function(e,t,r){var c=t&&r||0,l=t||[],f=(e=e||{}).node||n,h=void 0!==e.clockseq?e.clockseq:i;if(null==f||null==h){var p=a();null==f&&(f=n=[1|p[0],p[1],p[2],p[3],p[4],p[5]]),null==h&&(h=i=16383&(p[6]<<8|p[7]))}var d=void 0!==e.msecs?e.msecs:(new Date).getTime(),y=void 0!==e.nsecs?e.nsecs:u+1,v=d-s+(y-u)/1e4;if(v<0&&void 0===e.clockseq&&(h=h+1&16383),(v<0||d>s)&&void 0===e.nsecs&&(y=0),y>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");s=d,u=y,i=h;var g=(1e4*(268435455&(d+=122192928e5))+y)%4294967296;l[c++]=g>>>24&255,l[c++]=g>>>16&255,l[c++]=g>>>8&255,l[c++]=255&g;var m=d/4294967296*1e4&268435455;l[c++]=m>>>8&255,l[c++]=255&m,l[c++]=m>>>24&15|16,l[c++]=m>>>16&255,l[c++]=h>>>8|128,l[c++]=255&h;for(var b=0;b<6;++b)l[c+b]=f[b];return t||o(l)}},1171:function(e,t,r){var n=r(5217),i=r(5327);e.exports=function(e,t,r){var a=t&&r||0;"string"==typeof e&&(t="binary"===e?new Array(16):null,e=null);var o=(e=e||{}).random||(e.rng||n)();if(o[6]=15&o[6]|64,o[8]=63&o[8]|128,t)for(var s=0;s<16;++s)t[a+s]=o[s];return t||i(o)}},9329:function(e,t,r){e.exports=r(516).Observable},516:function(e,t){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function i(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e}t.Observable=void 0;var a=function(){return"function"==typeof Symbol},o=function(e){return a()&&Boolean(Symbol[e])},s=function(e){return o(e)?Symbol[e]:"@@"+e};a()&&!o("observable")&&(Symbol.observable=Symbol("observable"));var u=s("iterator"),c=s("observable"),l=s("species");function f(e,t){var r=e[t];if(null!=r){if("function"!=typeof r)throw new TypeError(r+" is not a function");return r}}function h(e){var t=e.constructor;return void 0!==t&&null===(t=t[l])&&(t=void 0),void 0!==t?t:C}function p(e){return e instanceof C}function d(e){d.log?d.log(e):setTimeout((function(){throw e}))}function y(e){Promise.resolve().then((function(){try{e()}catch(e){d(e)}}))}function v(e){var t=e._cleanup;if(void 0!==t&&(e._cleanup=void 0,t))try{if("function"==typeof t)t();else{var r=f(t,"unsubscribe");r&&r.call(t)}}catch(e){d(e)}}function g(e){e._observer=void 0,e._queue=void 0,e._state="closed"}function m(e,t,r){e._state="running";var n=e._observer;try{var i=f(n,t);switch(t){case"next":i&&i.call(n,r);break;case"error":if(g(e),!i)throw r;i.call(n,r);break;case"complete":g(e),i&&i.call(n)}}catch(e){d(e)}"closed"===e._state?v(e):"running"===e._state&&(e._state="ready")}function b(e,t,r){if("closed"!==e._state){if("buffering"!==e._state)return"ready"!==e._state?(e._state="buffering",e._queue=[{type:t,value:r}],void y((function(){return function(e){var t=e._queue;if(t){e._queue=void 0,e._state="ready";for(var r=0;r<t.length&&(m(e,t[r].type,t[r].value),"closed"!==e._state);++r);}}(e)}))):void m(e,t,r);e._queue.push({type:t,value:r})}}var E=function(){function e(t,n){r(this,e),this._cleanup=void 0,this._observer=t,this._queue=void 0,this._state="initializing";var i=new S(this);try{this._cleanup=n.call(void 0,i)}catch(e){i.error(e)}"initializing"===this._state&&(this._state="ready")}return i(e,[{key:"unsubscribe",value:function(){"closed"!==this._state&&(g(this),v(this))}},{key:"closed",get:function(){return"closed"===this._state}}]),e}(),S=function(){function e(t){r(this,e),this._subscription=t}return i(e,[{key:"next",value:function(e){b(this._subscription,"next",e)}},{key:"error",value:function(e){b(this._subscription,"error",e)}},{key:"complete",value:function(){b(this._subscription,"complete")}},{key:"closed",get:function(){return"closed"===this._subscription._state}}]),e}(),C=function(){function e(t){if(r(this,e),!(this instanceof e))throw new TypeError("Observable cannot be called as a function");if("function"!=typeof t)throw new TypeError("Observable initializer must be a function");this._subscriber=t}return i(e,[{key:"subscribe",value:function(e){return"object"==typeof e&&null!==e||(e={next:e,error:arguments[1],complete:arguments[2]}),new E(e,this._subscriber)}},{key:"forEach",value:function(e){var t=this;return new Promise((function(r,n){if("function"==typeof e)var i=t.subscribe({next:function(t){try{e(t,a)}catch(e){n(e),i.unsubscribe()}},error:n,complete:r});else n(new TypeError(e+" is not a function"));function a(){i.unsubscribe(),r()}}))}},{key:"map",value:function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");return new(h(this))((function(r){return t.subscribe({next:function(t){try{t=e(t)}catch(e){return r.error(e)}r.next(t)},error:function(e){r.error(e)},complete:function(){r.complete()}})}))}},{key:"filter",value:function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");return new(h(this))((function(r){return t.subscribe({next:function(t){try{if(!e(t))return}catch(e){return r.error(e)}r.next(t)},error:function(e){r.error(e)},complete:function(){r.complete()}})}))}},{key:"reduce",value:function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");var r=h(this),n=arguments.length>1,i=!1,a=arguments[1],o=a;return new r((function(r){return t.subscribe({next:function(t){var a=!i;if(i=!0,!a||n)try{o=e(o,t)}catch(e){return r.error(e)}else o=t},error:function(e){r.error(e)},complete:function(){if(!i&&!n)return r.error(new TypeError("Cannot reduce an empty sequence"));r.next(o),r.complete()}})}))}},{key:"concat",value:function(){for(var e=this,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];var i=h(this);return new i((function(t){var n,a=0;return function e(o){n=o.subscribe({next:function(e){t.next(e)},error:function(e){t.error(e)},complete:function(){a===r.length?(n=void 0,t.complete()):e(i.from(r[a++]))}})}(e),function(){n&&(n.unsubscribe(),n=void 0)}}))}},{key:"flatMap",value:function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");var r=h(this);return new r((function(n){var i=[],a=t.subscribe({next:function(t){if(e)try{t=e(t)}catch(e){return n.error(e)}var a=r.from(t).subscribe({next:function(e){n.next(e)},error:function(e){n.error(e)},complete:function(){var e=i.indexOf(a);e>=0&&i.splice(e,1),o()}});i.push(a)},error:function(e){n.error(e)},complete:function(){o()}});function o(){a.closed&&0===i.length&&n.complete()}return function(){i.forEach((function(e){return e.unsubscribe()})),a.unsubscribe()}}))}},{key:c,value:function(){return this}}],[{key:"from",value:function(t){var r="function"==typeof this?this:e;if(null==t)throw new TypeError(t+" is not an object");var n=f(t,c);if(n){var i=n.call(t);if(Object(i)!==i)throw new TypeError(i+" is not an object");return p(i)&&i.constructor===r?i:new r((function(e){return i.subscribe(e)}))}if(o("iterator")&&(n=f(t,u)))return new r((function(e){y((function(){if(!e.closed){var r=!0,i=!1,a=void 0;try{for(var o,s=n.call(t)[Symbol.iterator]();!(r=(o=s.next()).done);r=!0){var u=o.value;if(e.next(u),e.closed)return}}catch(e){i=!0,a=e}finally{try{r||null==s.return||s.return()}finally{if(i)throw a}}e.complete()}}))}));if(Array.isArray(t))return new r((function(e){y((function(){if(!e.closed){for(var r=0;r<t.length;++r)if(e.next(t[r]),e.closed)return;e.complete()}}))}));throw new TypeError(t+" is not observable")}},{key:"of",value:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];var i="function"==typeof this?this:e;return new i((function(e){y((function(){if(!e.closed){for(var t=0;t<r.length;++t)if(e.next(r[t]),e.closed)return;e.complete()}}))}))}},{key:l,get:function(){return this}}]),e}();t.Observable=C,a()&&Object.defineProperty(C,Symbol("extensions"),{value:{symbol:c,hostReportError:d},configurable:!0})},3906:function(){}},t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={id:n,loaded:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.loaded=!0,i.exports}return r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,{a:t}),t},r.d=function(e,t){for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.hmd=function(e){return(e=Object.create(e)).children||(e.children=[]),Object.defineProperty(e,"exports",{enumerable:!0,set:function(){throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+e.id)}}),e},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.nmd=function(e){return e.paths=[],e.children||(e.children=[]),e},r(735)}();
293
+ var n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)};function i(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var a=function(){return(a=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function o(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r}function s(e,t,r,n){return new(r||(r=Promise))((function(i,a){function o(e){try{u(n.next(e))}catch(e){a(e)}}function s(e){try{u(n.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,s)}u((n=n.apply(e,t||[])).next())}))}function u(e,t){var r,n,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;o;)try{if(r=1,n&&(i=2&a[0]?n.return:a[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,a[1])).done)return i;switch(n=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,n=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!(i=o.trys,(i=i.length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){o.label=a[1];break}if(6===a[0]&&o.label<i[1]){o.label=i[1],i=a;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(a);break}i[2]&&o.ops.pop(),o.trys.pop();continue}a=t.call(e,o)}catch(e){a=[6,e],n=0}finally{r=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}}function c(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;var n=Array(e),i=0;for(t=0;t<r;t++)for(var a=arguments[t],o=0,s=a.length;o<s;o++,i++)n[i]=a[o];return n}},5877:(e,t,r)=>{var n=r(3570),i=r(1171),a=i;a.v1=n,a.v4=i,e.exports=a},5327:e=>{for(var t=[],r=0;r<256;++r)t[r]=(r+256).toString(16).substr(1);e.exports=function(e,r){var n=r||0,i=t;return[i[e[n++]],i[e[n++]],i[e[n++]],i[e[n++]],"-",i[e[n++]],i[e[n++]],"-",i[e[n++]],i[e[n++]],"-",i[e[n++]],i[e[n++]],"-",i[e[n++]],i[e[n++]],i[e[n++]],i[e[n++]],i[e[n++]],i[e[n++]]].join("")}},5217:e=>{var t="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(t){var r=new Uint8Array(16);e.exports=function(){return t(r),r}}else{var n=new Array(16);e.exports=function(){for(var e,t=0;t<16;t++)0==(3&t)&&(e=4294967296*Math.random()),n[t]=e>>>((3&t)<<3)&255;return n}}},3570:(e,t,r)=>{var n,i,a=r(5217),o=r(5327),s=0,u=0;e.exports=function(e,t,r){var c=t&&r||0,l=t||[],f=(e=e||{}).node||n,h=void 0!==e.clockseq?e.clockseq:i;if(null==f||null==h){var p=a();null==f&&(f=n=[1|p[0],p[1],p[2],p[3],p[4],p[5]]),null==h&&(h=i=16383&(p[6]<<8|p[7]))}var d=void 0!==e.msecs?e.msecs:(new Date).getTime(),y=void 0!==e.nsecs?e.nsecs:u+1,v=d-s+(y-u)/1e4;if(v<0&&void 0===e.clockseq&&(h=h+1&16383),(v<0||d>s)&&void 0===e.nsecs&&(y=0),y>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");s=d,u=y,i=h;var g=(1e4*(268435455&(d+=122192928e5))+y)%4294967296;l[c++]=g>>>24&255,l[c++]=g>>>16&255,l[c++]=g>>>8&255,l[c++]=255&g;var m=d/4294967296*1e4&268435455;l[c++]=m>>>8&255,l[c++]=255&m,l[c++]=m>>>24&15|16,l[c++]=m>>>16&255,l[c++]=h>>>8|128,l[c++]=255&h;for(var b=0;b<6;++b)l[c+b]=f[b];return t||o(l)}},1171:(e,t,r)=>{var n=r(5217),i=r(5327);e.exports=function(e,t,r){var a=t&&r||0;"string"==typeof e&&(t="binary"===e?new Array(16):null,e=null);var o=(e=e||{}).random||(e.rng||n)();if(o[6]=15&o[6]|64,o[8]=63&o[8]|128,t)for(var s=0;s<16;++s)t[a+s]=o[s];return t||i(o)}},9329:(e,t,r)=>{e.exports=r(516).Observable},516:(e,t)=>{"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function i(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e}t.Observable=void 0;var a=function(){return"function"==typeof Symbol},o=function(e){return a()&&Boolean(Symbol[e])},s=function(e){return o(e)?Symbol[e]:"@@"+e};a()&&!o("observable")&&(Symbol.observable=Symbol("observable"));var u=s("iterator"),c=s("observable"),l=s("species");function f(e,t){var r=e[t];if(null!=r){if("function"!=typeof r)throw new TypeError(r+" is not a function");return r}}function h(e){var t=e.constructor;return void 0!==t&&null===(t=t[l])&&(t=void 0),void 0!==t?t:C}function p(e){return e instanceof C}function d(e){d.log?d.log(e):setTimeout((function(){throw e}))}function y(e){Promise.resolve().then((function(){try{e()}catch(e){d(e)}}))}function v(e){var t=e._cleanup;if(void 0!==t&&(e._cleanup=void 0,t))try{if("function"==typeof t)t();else{var r=f(t,"unsubscribe");r&&r.call(t)}}catch(e){d(e)}}function g(e){e._observer=void 0,e._queue=void 0,e._state="closed"}function m(e,t,r){e._state="running";var n=e._observer;try{var i=f(n,t);switch(t){case"next":i&&i.call(n,r);break;case"error":if(g(e),!i)throw r;i.call(n,r);break;case"complete":g(e),i&&i.call(n)}}catch(e){d(e)}"closed"===e._state?v(e):"running"===e._state&&(e._state="ready")}function b(e,t,r){if("closed"!==e._state){if("buffering"!==e._state)return"ready"!==e._state?(e._state="buffering",e._queue=[{type:t,value:r}],void y((function(){return function(e){var t=e._queue;if(t){e._queue=void 0,e._state="ready";for(var r=0;r<t.length&&(m(e,t[r].type,t[r].value),"closed"!==e._state);++r);}}(e)}))):void m(e,t,r);e._queue.push({type:t,value:r})}}var E=function(){function e(t,n){r(this,e),this._cleanup=void 0,this._observer=t,this._queue=void 0,this._state="initializing";var i=new S(this);try{this._cleanup=n.call(void 0,i)}catch(e){i.error(e)}"initializing"===this._state&&(this._state="ready")}return i(e,[{key:"unsubscribe",value:function(){"closed"!==this._state&&(g(this),v(this))}},{key:"closed",get:function(){return"closed"===this._state}}]),e}(),S=function(){function e(t){r(this,e),this._subscription=t}return i(e,[{key:"next",value:function(e){b(this._subscription,"next",e)}},{key:"error",value:function(e){b(this._subscription,"error",e)}},{key:"complete",value:function(){b(this._subscription,"complete")}},{key:"closed",get:function(){return"closed"===this._subscription._state}}]),e}(),C=function(){function e(t){if(r(this,e),!(this instanceof e))throw new TypeError("Observable cannot be called as a function");if("function"!=typeof t)throw new TypeError("Observable initializer must be a function");this._subscriber=t}return i(e,[{key:"subscribe",value:function(e){return"object"==typeof e&&null!==e||(e={next:e,error:arguments[1],complete:arguments[2]}),new E(e,this._subscriber)}},{key:"forEach",value:function(e){var t=this;return new Promise((function(r,n){if("function"==typeof e)var i=t.subscribe({next:function(t){try{e(t,a)}catch(e){n(e),i.unsubscribe()}},error:n,complete:r});else n(new TypeError(e+" is not a function"));function a(){i.unsubscribe(),r()}}))}},{key:"map",value:function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");return new(h(this))((function(r){return t.subscribe({next:function(t){try{t=e(t)}catch(e){return r.error(e)}r.next(t)},error:function(e){r.error(e)},complete:function(){r.complete()}})}))}},{key:"filter",value:function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");return new(h(this))((function(r){return t.subscribe({next:function(t){try{if(!e(t))return}catch(e){return r.error(e)}r.next(t)},error:function(e){r.error(e)},complete:function(){r.complete()}})}))}},{key:"reduce",value:function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");var r=h(this),n=arguments.length>1,i=!1,a=arguments[1],o=a;return new r((function(r){return t.subscribe({next:function(t){var a=!i;if(i=!0,!a||n)try{o=e(o,t)}catch(e){return r.error(e)}else o=t},error:function(e){r.error(e)},complete:function(){if(!i&&!n)return r.error(new TypeError("Cannot reduce an empty sequence"));r.next(o),r.complete()}})}))}},{key:"concat",value:function(){for(var e=this,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];var i=h(this);return new i((function(t){var n,a=0;return function e(o){n=o.subscribe({next:function(e){t.next(e)},error:function(e){t.error(e)},complete:function(){a===r.length?(n=void 0,t.complete()):e(i.from(r[a++]))}})}(e),function(){n&&(n.unsubscribe(),n=void 0)}}))}},{key:"flatMap",value:function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");var r=h(this);return new r((function(n){var i=[],a=t.subscribe({next:function(t){if(e)try{t=e(t)}catch(e){return n.error(e)}var a=r.from(t).subscribe({next:function(e){n.next(e)},error:function(e){n.error(e)},complete:function(){var e=i.indexOf(a);e>=0&&i.splice(e,1),o()}});i.push(a)},error:function(e){n.error(e)},complete:function(){o()}});function o(){a.closed&&0===i.length&&n.complete()}return function(){i.forEach((function(e){return e.unsubscribe()})),a.unsubscribe()}}))}},{key:c,value:function(){return this}}],[{key:"from",value:function(t){var r="function"==typeof this?this:e;if(null==t)throw new TypeError(t+" is not an object");var n=f(t,c);if(n){var i=n.call(t);if(Object(i)!==i)throw new TypeError(i+" is not an object");return p(i)&&i.constructor===r?i:new r((function(e){return i.subscribe(e)}))}if(o("iterator")&&(n=f(t,u)))return new r((function(e){y((function(){if(!e.closed){var r=!0,i=!1,a=void 0;try{for(var o,s=n.call(t)[Symbol.iterator]();!(r=(o=s.next()).done);r=!0){var u=o.value;if(e.next(u),e.closed)return}}catch(e){i=!0,a=e}finally{try{r||null==s.return||s.return()}finally{if(i)throw a}}e.complete()}}))}));if(Array.isArray(t))return new r((function(e){y((function(){if(!e.closed){for(var r=0;r<t.length;++r)if(e.next(t[r]),e.closed)return;e.complete()}}))}));throw new TypeError(t+" is not observable")}},{key:"of",value:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];var i="function"==typeof this?this:e;return new i((function(e){y((function(){if(!e.closed){for(var t=0;t<r.length;++t)if(e.next(r[t]),e.closed)return;e.complete()}}))}))}},{key:l,get:function(){return this}}]),e}();t.Observable=C,a()&&Object.defineProperty(C,Symbol("extensions"),{value:{symbol:c,hostReportError:d},configurable:!0})},5819:()=>{},3438:()=>{}},t={};function r(n){var i=t[n];if(void 0!==i)return i.exports;var a=t[n]={id:n,loaded:!1,exports:{}};return e[n].call(a.exports,a,a.exports,r),a.loaded=!0,a.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.hmd=e=>((e=Object.create(e)).children||(e.children=[]),Object.defineProperty(e,"exports",{enumerable:!0,set:()=>{throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+e.id)}}),e),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var n={};(()=>{"use strict";r.r(n),r.d(n,{Client:()=>d,Election:()=>m,IdentificationKeys:()=>$,KeyCeremonyComponent:()=>ee,MESSAGE_PROCESSED:()=>G,MESSAGE_RECEIVED:()=>H,MessageIdentifier:()=>g,TallyComponent:()=>te,Trustee:()=>J,VoteComponent:()=>re,Voter:()=>X});var e=r(1439),t=r(4206),i=r.n(t),a=r(9120),o=r.n(a),s=r(1798),u=r.n(s),c=r(5073),l=r.n(c),f=r(5053),h=r.n(f);class p{constructor({apiEndpointUrl:t,headers:r}){const n=new e.HttpLink({uri:t,headers:r});this.apolloClient=new e.fe({link:n,cache:new e.h4})}async getLogEntry({electionUniqueId:e,contentHash:t}){return(await this.apolloClient.query({query:l(),variables:{electionUniqueId:e,contentHash:t}})).data.logEntry}async getElectionLogEntries({electionUniqueId:e,after:t,types:r}){return(await this.apolloClient.query({query:i(),variables:{electionUniqueId:e,after:t,types:r},fetchPolicy:"no-cache"})).data.election.logEntries}async processKeyCeremonyStep({messageId:e,signedData:t}){const r=await this.apolloClient.mutate({mutation:o(),variables:{messageId:e,signedData:t}});if(r.data.processKeyCeremonyStep.error)throw new Error(r.data.processKeyCeremonyStep.error);return r.data.processKeyCeremonyStep.pendingMessage}async getPendingMessageByMessageId({messageId:e}){return(await this.apolloClient.query({query:h(),variables:{messageId:e}})).data.pendingMessage}async processTallyStep({messageId:e,signedData:t}){const r=await this.apolloClient.mutate({mutation:u(),variables:{messageId:e,signedData:t}});if(r.data.processTallyStep.error)throw new Error(r.data.processTallyStep.error);return r.data.processTallyStep.pendingMessage}}class d{constructor(e){this.apiClient=new p(e)}getLogEntry({electionUniqueId:e,contentHash:t}){return this.apiClient.getLogEntry({electionUniqueId:e,contentHash:t})}getElectionLogEntries(e){return this.apiClient.getElectionLogEntries(e)}processKeyCeremonyStep(e){return this.apiClient.processKeyCeremonyStep(e)}processTallyStep(e){return this.apiClient.processTallyStep(e)}waitForPendingMessageToBeProcessed(e,t=1e3){return new Promise((r=>{const n=setInterval((()=>{this.apiClient.getPendingMessageByMessageId({messageId:e}).then((e=>{"enqueued"!==e.status&&(clearInterval(n),r(e))}))}),t)}))}}const y="t",v=["a","b","v",y];class g{static parse(e){const[t,r]=e.split("+"),[n,i,a,o]=t.split(".",4),[s,u]=r.split(".",2),c=o?`.${o}`:"";if(!v.includes(s))throw new Error("Invalid message identifier format");return{electionId:`${n}.${i}`,type:a,subtype:o,typeSubtype:`${a}${c}`,author:{type:s,id:u}}}static format(e,t,r,n){return`${e}.${t}+${r}.${n}`}}class m{constructor({uniqueId:e,bulletinBoardClient:t,typesFilter:r,options:n}){this.uniqueId=e,this.bulletinBoardClient=t,this.logEntries=[],this.typesFilter=r,this.subscriptionId=null,this.options=n||{waitUntilNextCheck:2e3}}async subscribeToLogEntriesChanges(){this.unsubscribeToLogEntriesChanges(),await this.getLogEntries(),this.subscriptionId=setInterval((()=>{this.getLogEntries()}),this.options.waitUntilNextCheck)}unsubscribeToLogEntriesChanges(){null!==this.subscriptionId&&(clearInterval(this.subscriptionId),this.subscriptionId=null)}getLastMessageFromTrustee(e){for(let t=this.logEntries.length-1;t>=0;t--){const r=this.logEntries[t],n=g.parse(r.messageId);if(n.author.type===y&&n.author.id===e)return r}return null}getLogEntries(){const e=this.logEntries[this.logEntries.length-1],t=e&&e.id||null;return new Promise((e=>{this.bulletinBoardClient.getElectionLogEntries({electionUniqueId:this.uniqueId,after:t,types:this.typesFilter}).then((t=>{t.length&&(this.logEntries=[...this.logEntries,...t]),e()}))}))}}var b=r(655);function E(e){return"function"==typeof e}var S=!1,C={Promise:void 0,set useDeprecatedSynchronousErrorHandling(e){e&&(new Error).stack;S=e},get useDeprecatedSynchronousErrorHandling(){return S}};function w(e){setTimeout((function(){throw e}),0)}var T={closed:!0,next:function(e){},error:function(e){if(C.useDeprecatedSynchronousErrorHandling)throw e;w(e)},complete:function(){}},A=function(){return Array.isArray||function(e){return e&&"number"==typeof e.length}}();var I=function(){function e(e){return Error.call(this),this.message=e?e.length+" errors occurred during unsubscription:\n"+e.map((function(e,t){return t+1+") "+e.toString()})).join("\n "):"",this.name="UnsubscriptionError",this.errors=e,this}return e.prototype=Object.create(Error.prototype),e}(),k=function(){function e(e){this.closed=!1,this._parentOrParents=null,this._subscriptions=null,e&&(this._ctorUnsubscribe=!0,this._unsubscribe=e)}return e.prototype.unsubscribe=function(){var t;if(!this.closed){var r,n=this,i=n._parentOrParents,a=n._ctorUnsubscribe,o=n._unsubscribe,s=n._subscriptions;if(this.closed=!0,this._parentOrParents=null,this._subscriptions=null,i instanceof e)i.remove(this);else if(null!==i)for(var u=0;u<i.length;++u){i[u].remove(this)}if(E(o)){a&&(this._unsubscribe=void 0);try{o.call(this)}catch(e){t=e instanceof I?_(e.errors):[e]}}if(A(s)){u=-1;for(var c=s.length;++u<c;){var l=s[u];if(null!==(r=l)&&"object"==typeof r)try{l.unsubscribe()}catch(e){t=t||[],e instanceof I?t=t.concat(_(e.errors)):t.push(e)}}}if(t)throw new I(t)}},e.prototype.add=function(t){var r=t;if(!t)return e.EMPTY;switch(typeof t){case"function":r=new e(t);case"object":if(r===this||r.closed||"function"!=typeof r.unsubscribe)return r;if(this.closed)return r.unsubscribe(),r;if(!(r instanceof e)){var n=r;(r=new e)._subscriptions=[n]}break;default:throw new Error("unrecognized teardown "+t+" added to Subscription.")}var i=r._parentOrParents;if(null===i)r._parentOrParents=this;else if(i instanceof e){if(i===this)return r;r._parentOrParents=[i,this]}else{if(-1!==i.indexOf(this))return r;i.push(this)}var a=this._subscriptions;return null===a?this._subscriptions=[r]:a.push(r),r},e.prototype.remove=function(e){var t=this._subscriptions;if(t){var r=t.indexOf(e);-1!==r&&t.splice(r,1)}},e.EMPTY=function(e){return e.closed=!0,e}(new e),e}();function _(e){return e.reduce((function(e,t){return e.concat(t instanceof I?t.errors:t)}),[])}var B=function(){return"function"==typeof Symbol?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random()}(),N=function(e){function t(r,n,i){var a=e.call(this)||this;switch(a.syncErrorValue=null,a.syncErrorThrown=!1,a.syncErrorThrowable=!1,a.isStopped=!1,arguments.length){case 0:a.destination=T;break;case 1:if(!r){a.destination=T;break}if("object"==typeof r){r instanceof t?(a.syncErrorThrowable=r.syncErrorThrowable,a.destination=r,r.add(a)):(a.syncErrorThrowable=!0,a.destination=new O(a,r));break}default:a.syncErrorThrowable=!0,a.destination=new O(a,r,n,i)}return a}return b.ZT(t,e),t.prototype[B]=function(){return this},t.create=function(e,r,n){var i=new t(e,r,n);return i.syncErrorThrowable=!1,i},t.prototype.next=function(e){this.isStopped||this._next(e)},t.prototype.error=function(e){this.isStopped||(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this))},t.prototype._next=function(e){this.destination.next(e)},t.prototype._error=function(e){this.destination.error(e),this.unsubscribe()},t.prototype._complete=function(){this.destination.complete(),this.unsubscribe()},t.prototype._unsubscribeAndRecycle=function(){var e=this._parentOrParents;return this._parentOrParents=null,this.unsubscribe(),this.closed=!1,this.isStopped=!1,this._parentOrParents=e,this},t}(k),O=function(e){function t(t,r,n,i){var a,o=e.call(this)||this;o._parentSubscriber=t;var s=o;return E(r)?a=r:r&&(a=r.next,n=r.error,i=r.complete,r!==T&&(E((s=Object.create(r)).unsubscribe)&&o.add(s.unsubscribe.bind(s)),s.unsubscribe=o.unsubscribe.bind(o))),o._context=s,o._next=a,o._error=n,o._complete=i,o}return b.ZT(t,e),t.prototype.next=function(e){if(!this.isStopped&&this._next){var t=this._parentSubscriber;C.useDeprecatedSynchronousErrorHandling&&t.syncErrorThrowable?this.__tryOrSetError(t,this._next,e)&&this.unsubscribe():this.__tryOrUnsub(this._next,e)}},t.prototype.error=function(e){if(!this.isStopped){var t=this._parentSubscriber,r=C.useDeprecatedSynchronousErrorHandling;if(this._error)r&&t.syncErrorThrowable?(this.__tryOrSetError(t,this._error,e),this.unsubscribe()):(this.__tryOrUnsub(this._error,e),this.unsubscribe());else if(t.syncErrorThrowable)r?(t.syncErrorValue=e,t.syncErrorThrown=!0):w(e),this.unsubscribe();else{if(this.unsubscribe(),r)throw e;w(e)}}},t.prototype.complete=function(){var e=this;if(!this.isStopped){var t=this._parentSubscriber;if(this._complete){var r=function(){return e._complete.call(e._context)};C.useDeprecatedSynchronousErrorHandling&&t.syncErrorThrowable?(this.__tryOrSetError(t,r),this.unsubscribe()):(this.__tryOrUnsub(r),this.unsubscribe())}else this.unsubscribe()}},t.prototype.__tryOrUnsub=function(e,t){try{e.call(this._context,t)}catch(e){if(this.unsubscribe(),C.useDeprecatedSynchronousErrorHandling)throw e;w(e)}},t.prototype.__tryOrSetError=function(e,t,r){if(!C.useDeprecatedSynchronousErrorHandling)throw new Error("bad call");try{t.call(this._context,r)}catch(t){return C.useDeprecatedSynchronousErrorHandling?(e.syncErrorValue=t,e.syncErrorThrown=!0,!0):(w(t),!0)}return!1},t.prototype._unsubscribe=function(){var e=this._parentSubscriber;this._context=null,this._parentSubscriber=null,e.unsubscribe()},t}(N);var R=function(){return"function"==typeof Symbol&&Symbol.observable||"@@observable"}();function x(e){return e}function P(e){return 0===e.length?x:1===e.length?e[0]:function(t){return e.reduce((function(e,t){return t(e)}),t)}}var F=function(){function e(e){this._isScalar=!1,e&&(this._subscribe=e)}return e.prototype.lift=function(t){var r=new e;return r.source=this,r.operator=t,r},e.prototype.subscribe=function(e,t,r){var n=this.operator,i=function(e,t,r){if(e){if(e instanceof N)return e;if(e[B])return e[B]()}return e||t||r?new N(e,t,r):new N(T)}(e,t,r);if(n?i.add(n.call(i,this.source)):i.add(this.source||C.useDeprecatedSynchronousErrorHandling&&!i.syncErrorThrowable?this._subscribe(i):this._trySubscribe(i)),C.useDeprecatedSynchronousErrorHandling&&i.syncErrorThrowable&&(i.syncErrorThrowable=!1,i.syncErrorThrown))throw i.syncErrorValue;return i},e.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){C.useDeprecatedSynchronousErrorHandling&&(e.syncErrorThrown=!0,e.syncErrorValue=t),!function(e){for(;e;){var t=e,r=t.closed,n=t.destination,i=t.isStopped;if(r||i)return!1;e=n&&n instanceof N?n:null}return!0}(e)?console.warn(t):e.error(t)}},e.prototype.forEach=function(e,t){var r=this;return new(t=D(t))((function(t,n){var i;i=r.subscribe((function(t){try{e(t)}catch(e){n(e),i&&i.unsubscribe()}}),n,t)}))},e.prototype._subscribe=function(e){var t=this.source;return t&&t.subscribe(e)},e.prototype[R]=function(){return this},e.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return 0===e.length?this:P(e)(this)},e.prototype.toPromise=function(e){var t=this;return new(e=D(e))((function(e,r){var n;t.subscribe((function(e){return n=e}),(function(e){return r(e)}),(function(){return e(n)}))}))},e.create=function(t){return new e(t)},e}();function D(e){if(e||(e=C.Promise||Promise),!e)throw new Error("no Promise impl found");return e}var L=function(){function e(){return Error.call(this),this.message="object unsubscribed",this.name="ObjectUnsubscribedError",this}return e.prototype=Object.create(Error.prototype),e}(),U=function(e){function t(t,r){var n=e.call(this)||this;return n.subject=t,n.subscriber=r,n.closed=!1,n}return b.ZT(t,e),t.prototype.unsubscribe=function(){if(!this.closed){this.closed=!0;var e=this.subject,t=e.observers;if(this.subject=null,t&&0!==t.length&&!e.isStopped&&!e.closed){var r=t.indexOf(this.subscriber);-1!==r&&t.splice(r,1)}}},t}(k),j=function(e){function t(t){var r=e.call(this,t)||this;return r.destination=t,r}return b.ZT(t,e),t}(N),V=function(e){function t(){var t=e.call(this)||this;return t.observers=[],t.closed=!1,t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return b.ZT(t,e),t.prototype[B]=function(){return new j(this)},t.prototype.lift=function(e){var t=new K(this,this);return t.operator=e,t},t.prototype.next=function(e){if(this.closed)throw new L;if(!this.isStopped)for(var t=this.observers,r=t.length,n=t.slice(),i=0;i<r;i++)n[i].next(e)},t.prototype.error=function(e){if(this.closed)throw new L;this.hasError=!0,this.thrownError=e,this.isStopped=!0;for(var t=this.observers,r=t.length,n=t.slice(),i=0;i<r;i++)n[i].error(e);this.observers.length=0},t.prototype.complete=function(){if(this.closed)throw new L;this.isStopped=!0;for(var e=this.observers,t=e.length,r=e.slice(),n=0;n<t;n++)r[n].complete();this.observers.length=0},t.prototype.unsubscribe=function(){this.isStopped=!0,this.closed=!0,this.observers=null},t.prototype._trySubscribe=function(t){if(this.closed)throw new L;return e.prototype._trySubscribe.call(this,t)},t.prototype._subscribe=function(e){if(this.closed)throw new L;return this.hasError?(e.error(this.thrownError),k.EMPTY):this.isStopped?(e.complete(),k.EMPTY):(this.observers.push(e),new U(this,e))},t.prototype.asObservable=function(){var e=new F;return e.source=this,e},t.create=function(e,t){return new K(e,t)},t}(F),K=function(e){function t(t,r){var n=e.call(this)||this;return n.destination=t,n.source=r,n}return b.ZT(t,e),t.prototype.next=function(e){var t=this.destination;t&&t.next&&t.next(e)},t.prototype.error=function(e){var t=this.destination;t&&t.error&&this.destination.error(e)},t.prototype.complete=function(){var e=this.destination;e&&e.complete&&this.destination.complete()},t.prototype._subscribe=function(e){return this.source?this.source.subscribe(e):k.EMPTY},t}(V);function M(){}var q=function(){function e(e,t,r){this.nextOrObserver=e,this.error=t,this.complete=r}return e.prototype.call=function(e,t){return t.subscribe(new z(e,this.nextOrObserver,this.error,this.complete))},e}(),z=function(e){function t(t,r,n,i){var a=e.call(this,t)||this;return a._tapNext=M,a._tapError=M,a._tapComplete=M,a._tapError=n||M,a._tapComplete=i||M,E(r)?(a._context=a,a._tapNext=r):r&&(a._context=r,a._tapNext=r.next||M,a._tapError=r.error||M,a._tapComplete=r.complete||M),a}return b.ZT(t,e),t.prototype._next=function(e){try{this._tapNext.call(this._context,e)}catch(e){return void this.destination.error(e)}this.destination.next(e)},t.prototype._error=function(e){try{this._tapError.call(this._context,e)}catch(e){return void this.destination.error(e)}this.destination.error(e)},t.prototype._complete=function(){try{this._tapComplete.call(this._context)}catch(e){return void this.destination.error(e)}return this.destination.complete()},t}(N);const H="[Message] Received",G="[Message] Processed";class Q{constructor(){this.events=new V}subscribe(e){return this.events.pipe((t=e,function(e){return e.lift(new q(t,r,n))})).subscribe();var t,r,n}broadcastMessageReceived(e){this.events.next({type:H,message:e})}broadcastMessageProcessed(e,t){this.events.next({type:G,message:e,result:t})}}var W=r(1217);function Y(e,t){const r="string"==typeof e?JSON.parse(e):e,n="string"==typeof t?JSON.parse(t):t;if(r&&n){const{n:e,e:t,kty:i}=r,{n:a,e:o,kty:s}=n;return e===a&&t===o&&i===s}return!1}class Z{constructor({authorityPublicKeyJSON:e}){this.authorityPublicKeyJSON=e,this.authorityPublicKey=W.JWK.asKey(e,"json"),this.keys=null}async parse({messageId:e,signedData:t}){const r=g.parse(e),n=await(this.keys?this.keys[r.author.type][r.author.id]:this.authorityPublicKey);if(!t)return{messageIdentifier:r,decodedData:null};const i=await W.JWS.createVerify(n).verify(t,{algorithms:["RS256"]}),a=JSON.parse(new TextDecoder("utf-8").decode(i.payload));return this.keys||(this.keys=await this.parseCreateElection(a)),{messageIdentifier:r,decodedData:a}}async parseCreateElection({authority:e,bulletin_board:t,trustees:r}){if(!Y(e.public_key,this.authorityPublicKeyJSON))throw new Error("The authority public key doesn't match the election's authority public key.");const n={a:{[e.slug]:this.authorityPublicKey},b:{},[y]:{}},i=[];i.push(this.loadKey(t).then((e=>{n.b[t.slug]=e})));for(const e of r)i.push(this.loadKey(e).then((t=>{n.t[e.slug]=t})));return await Promise.all(i),n}loadKey(e){return W.JWK.asKey(e.public_key,"json")}}class J{constructor({uniqueId:e,bulletinBoardClient:t,authorityPublicKeyJSON:r,identificationKeys:n,election:i,wrapperAdapter:a,options:o}){this.uniqueId=e,this.bulletinBoardClient=t,this.identificationKeys=n,this.election=i,this.options=o||{waitUntilNextCheck:100},this.wrapperAdapter=a,this.parser=new Z({authorityPublicKeyJSON:r}),this.events=new Q,this.nextLogEntryIndexToProcess=0,this.lastMessageProcessedWithResult=null,this.hasSetupKeyCeremony=!1}async setup(){return await this.wrapperAdapter.setup(),this.election.subscribeToLogEntriesChanges()}tearDown(){this.election.unsubscribeToLogEntriesChanges()}async*setupKeyCeremony(){let e;for(;!e;)e=await this.waitForNextLogEntryResult();return yield await this.wrapperAdapter.backup(),await this.processKeyCeremonyStep(e),this.hasSetupKeyCeremony=!0,this.hasSetupKeyCeremony}async runKeyCeremony(){if(!this.hasSetupKeyCeremony)throw new Error("The key ceremony has not been setup yet");if(await this.needsToBeRestored())throw new Error("You need to restore the wrapper state to continue");return this.waitForNextLogEntryResult().then((async e=>(await this.processKeyCeremonyStep(e),await this.wrapperAdapter.isKeyCeremonyDone()?this.tearDown():this.runKeyCeremony())))}async runTally(){if(await this.needsToBeRestored())throw new Error("You need to restore the wrapper state to continue");return this.waitForNextLogEntryResult().then((async e=>(await this.processTallyStep(e),await this.wrapperAdapter.isTallyDone()?this.tearDown():this.runTally())))}async needsToBeRestored(){return this.election.getLastMessageFromTrustee(this.uniqueId)&&await this.wrapperAdapter.isFresh()}async restore(e){const t=this.election.getLastMessageFromTrustee(this.uniqueId);return this.hasSetupKeyCeremony=t&&await this.wrapperAdapter.restore(e),this.hasSetupKeyCeremony}async waitForNextLogEntryResult(){return await new Promise((e=>{const t=setInterval((async()=>{const{logEntries:r}=this.election;r.length>this.nextLogEntryIndexToProcess&&(clearInterval(t),e())}),this.options.waitUntilNextCheck)})),this.processNextLogEntry()}async processNextLogEntry(){const{logEntries:e}=this.election,t=e[this.nextLogEntryIndexToProcess];this.events.broadcastMessageReceived(t);const{messageIdentifier:r,decodedData:n}=await this.parser.parse(t),i=await this.wrapperAdapter.processMessage(r.typeSubtype,n);if(this.events.broadcastMessageProcessed(t,i),this.nextLogEntryIndexToProcess+=1,i){const{messageType:e,content:t}=i;return{message_id:g.format(this.election.uniqueId,e,y,this.uniqueId),content:t}}return i}async processKeyCeremonyStep(e){if(e&&!this.isMessageAlreadyLogged(e)){const t=await this.signMessage(e);return this.bulletinBoardClient.processKeyCeremonyStep({messageId:e.message_id,signedData:t})}}async processTallyStep(e){if(e&&!this.isMessageAlreadyLogged(e)){const t=await this.signMessage(e);return this.bulletinBoardClient.processTallyStep({messageId:e.message_id,signedData:t})}}isMessageAlreadyLogged({message_id:e}){const{logEntries:t}=this.election;return t.find((t=>t.messageId===e))}signMessage(e){return this.identificationKeys.sign({iat:Math.floor(new Date/1e3),...e})}}class X{constructor({bulletinBoardClient:e,authorityPublicKeyJSON:t,election:r,uniqueId:n,wrapperAdapter:i}){this.uniqueId=n,this.election=r,this.bulletinBoardClient=e,this.wrapperAdapter=i,this.parser=new Z({authorityPublicKeyJSON:t})}async setup(){return await this.wrapperAdapter.setup(),this.bulletinBoardClient.getElectionLogEntries({electionUniqueId:this.election.uniqueId,types:["create_election","end_key_ceremony"]}).then((async e=>{for(const t of e){const{messageIdentifier:e,decodedData:r}=await this.parser.parse(t);await this.wrapperAdapter.processMessage(e.typeSubtype,r)}}))}async encrypt(e,t){const{encryptedData:r,auditableData:n}=await this.wrapperAdapter.encrypt(e,t);return{encryptedData:r,encryptedDataHash:await this.hash(r),auditableData:n}}async hash(e){return window.crypto.subtle.digest("SHA-256",(new TextEncoder).encode(e)).then((e=>Array.from(new Uint8Array(e)).map((e=>e.toString(16).padStart(2,"0"))).join("")))}verifyVote(e){const{uniqueId:t}=this.election;return this.bulletinBoardClient.getLogEntry({electionUniqueId:t,contentHash:e})}}class ${constructor(e,t){this.format="jwk",this.algorithm={name:"RSASSA-PKCS1-v1_5",modulusLength:4096,publicExponent:new Uint8Array([1,0,1]),hash:{name:"SHA-256"}},this.usages=["sign"],this.publicKeyAttrs=["alg","e","kty","n"],this.jwtHeader=this._encode64(JSON.stringify({alg:"RS256",typ:"JWT"})),this.trusteeUniqueId=e,this.privateKey=null,this.publicKey=null,this.storedPublicKey=JSON.parse(t||null),this.keyIdentifier=`${e}-private-key`,this.browserSupport=this._checkBrowserSupport(),this.textEncoder=new TextEncoder("utf-8"),this.dbName="identification_keys",this.dbVersion=1,this.presentPromise=this._read()}present(e){this.presentPromise.then((()=>{this._matchesStoredPublicKey(this.publicKey)?e(this.browserSupport&&null!==this.privateKey):this.reset().then(e(!1))}))}async generate(){return!(!this.browserSupport||this.storedPublicKey)&&new Promise(((e,t)=>{try{return this.crypto.subtle.generateKey(this.algorithm,!0,this.usages).then((t=>this.crypto.subtle.exportKey(this.format,t.privateKey).then((t=>{this.publicKey=this._publicKeyFromPrivateKey(t);const r=document.createElement("a");return r.setAttribute("href",`data:text/plain;charset=utf-8,${encodeURIComponent(JSON.stringify(t))}`),r.setAttribute("download",`${this.keyIdentifier}.jwk`),r.style.display="none",document.body.appendChild(r),r.click(),document.body.removeChild(r),e()})).catch(this._handleErrors)))}catch(e){return t(e)}}))}async upload(e){return!(!this.browserSupport||null!==this.privateKey)&&new Promise(((t,r)=>{if(e)this.onUploadInputChange(e,t,r);else{const e=document.createElement("input");e.setAttribute("type","file"),e.setAttribute("accept",".jwk"),e.style.display="none",document.body.appendChild(e),e.addEventListener("change",(n=>{document.body.removeChild(e),this.onUploadInputChange(n,t,r)})),e.click()}}))}onUploadInputChange(e,t,r){const n=new FileReader;n.readAsText(e.target.files[0]),n.onload=e=>{let n="";try{n=JSON.parse(e.target.result)}catch(e){return r("invalid_format")}return this.crypto.subtle.importKey(this.format,n,this.algorithm,!1,this.usages).then((e=>{const i=this._publicKeyFromPrivateKey(n);this._matchesStoredPublicKey(i)?(this.publicKey=i,this.privateKey=e,this._save().then((()=>t(!0))).catch((()=>{r("could not be saved")}))):r("invalid_public_key")})).catch((()=>{r("invalid_key")}))}}reset(){return this.privateKey=this.publicKey=null,this._clear()}async sign(e){if(!this.browserSupport||null===this.privateKey)return!1;const t=`${this.jwtHeader}.${this._encode64(JSON.stringify(e))}`,r=await this.crypto.subtle.sign(this.algorithm,this.privateKey,this.textEncoder.encode(t));return`${t}.${btoa(Reflect.apply(String.fromCharCode,null,new Uint8Array(r))).replace(/[=]/g,"").replace(/\+/g,"-").replace(/\//g,"_")}`}_checkBrowserSupport(){return this.indexedDB=window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB,this.crypto=window.crypto||window.msCrypto,window.indexedDB&&window.crypto}_handleErrors(e){throw e}_publicKeyFromPrivateKey(e){return Object.keys(e).filter((e=>this.publicKeyAttrs.includes(e))).reduce(((t,r)=>(t[r]=e[r],t)),{})}_matchesStoredPublicKey(e){return Y(e,this.storedPublicKey)}_encode64(e){return btoa(unescape(encodeURIComponent(e))).replace(/[=]/g,"").replace(/\+/g,"-").replace(/\//g,"_")}async _read(){return this._useDb("readonly",(e=>{e.get(this.keyIdentifier).onsuccess=e=>{e.target.result&&(this.privateKey=e.target.result.privateKey,this.publicKey=e.target.result.publicKey)}}))}async _save(){return this._useDb("readwrite",(e=>{e.add({privateKey:this.privateKey,publicKey:this.publicKey},this.keyIdentifier)}))}async _clear(){return this._useDb("readwrite",(e=>{e.delete(this.keyIdentifier)}))}async _useDb(e,t){return new Promise(((r,n)=>{let i=null;const a=this.indexedDB.open(this.dbName,this.dbVersion);a.onerror=e=>{i=null,n(e)},a.onupgradeneeded=()=>{i=a.result,i.createObjectStore("IdentificationKeys")},a.onsuccess=()=>{i=a.result;const n=i.transaction(["IdentificationKeys"],e);t(n.objectStore("IdentificationKeys")),n.oncomplete=()=>{i.close(),r()}}}))}}class ee{constructor({bulletinBoardClientParams:e,authorityPublicKeyJSON:t,electionUniqueId:r,trusteeUniqueId:n,trusteeIdentificationKeys:i,trusteeWrapperAdapter:a}){const o=new d(e);this.election=new m({uniqueId:r,bulletinBoardClient:o,typesFilter:["create_election","start_key_ceremony","key_ceremony","end_key_ceremony"]}),this.trustee=new J({uniqueId:n,bulletinBoardClient:o,authorityPublicKeyJSON:t,identificationKeys:i,election:this.election,wrapperAdapter:a})}async bindEvents({onEvent:e,onBindRestoreButton:t,onBindStartButton:r,onRestore:n,onComplete:i,onStart:a,onTrusteeNeedsToBeRestored:o,onBackupNeeded:s,onBindBackupButton:u,onBackupStarted:c}){const l=this.trustee.setup();this.trustee.events.subscribe(e),r((async e=>{if(a(),e.preventDefault(),await l,await this.trustee.needsToBeRestored())o();else{const e=this.trustee.setupKeyCeremony(),{value:t}=await e.next();s(),u(t,`${this.trustee.uniqueId}-election-${this.election.uniqueId}.bak`,(async()=>{c(),await e.next(),await this.trustee.runKeyCeremony(),i()}))}})),t((async e=>{await l;const t=e.target.files[0],r=new FileReader;r.onload=async({target:e})=>{const t=e.result;await this.trustee.restore(t)&&(n(),await this.trustee.runKeyCeremony(),i())},r.readAsText(t)}))}}class te{constructor({bulletinBoardClientParams:e,authorityPublicKeyJSON:t,electionUniqueId:r,trusteeUniqueId:n,trusteeIdentificationKeys:i,trusteeWrapperAdapter:a}){const o=new d(e);this.election=new m({uniqueId:r,bulletinBoardClient:o,typesFilter:["create_election","start_key_ceremony","key_ceremony","end_key_ceremony","start_tally","tally","end_tally"]}),this.trustee=new J({uniqueId:n,bulletinBoardClient:o,authorityPublicKeyJSON:t,identificationKeys:i,election:this.election,wrapperAdapter:a})}async bindEvents({onEvent:e,onBindRestoreButton:t,onBindStartButton:r,onRestore:n,onComplete:i,onStart:a,onTrusteeNeedsToBeRestored:o}){const s=this.trustee.setup();this.trustee.events.subscribe(e),r((async e=>{a(),e.preventDefault(),await s,await this.trustee.needsToBeRestored()?o():(await this.trustee.runTally(),i())})),t((async e=>{await s;const t=e.target.files[0],r=new FileReader;r.onload=async({target:e})=>{const t=e.result;await this.trustee.restore(t)&&(n(),await this.trustee.runTally(),i())},r.readAsText(t)}))}}class re{constructor({bulletinBoardClientParams:e,authorityPublicKeyJSON:t,electionUniqueId:r,voterUniqueId:n,voterWrapperAdapter:i}){this.bulletinBoardClient=new d(e);const a=new m({uniqueId:r,bulletinBoardClient:this.bulletinBoardClient});this.voter=new X({bulletinBoardClient:this.bulletinBoardClient,authorityPublicKeyJSON:t,election:a,uniqueId:n,wrapperAdapter:i})}async bindEvents({onBindEncryptButton:e,onStart:t,onVoteEncryption:r,castOrAuditBallot:n,onBindAuditBallotButton:i,onBindCastBallotButton:a,onAuditBallot:o,onCastBallot:s,onAuditComplete:u,onCastComplete:c,onInvalid:l}){const f=this.voter.setup();e((async()=>{t(),await f,r(((e,t)=>{this.voter.encrypt(e,t).then((e=>{n(e),i((()=>{o(e,`${this.voter.uniqueId}-election-${this.voter.election.uniqueId}.txt`),u()})),a((async()=>{try{await s(e),c()}catch{l()}}))}))}),(()=>{l()}))}))}}})(),window.decidimBulletinBoard=n})();