whipdesk 0.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agent.cjs +30242 -0
- package/dist/mobile-web/android-chrome-192x192.png +0 -0
- package/dist/mobile-web/android-chrome-512x512.png +0 -0
- package/dist/mobile-web/apple-touch-icon.png +0 -0
- package/dist/mobile-web/assets/index-7VFGQkgi.css +1 -0
- package/dist/mobile-web/assets/index-ChOsBFZF.js +2 -0
- package/dist/mobile-web/assets/index.esm-B3nnhxdY.js +1144 -0
- package/dist/mobile-web/assets/index.esm-C6Dwpirr.js +16 -0
- package/dist/mobile-web/assets/index.esm-DOt1fDqh.js +1636 -0
- package/dist/mobile-web/assets/index.esm-DYB-Ijb5.js +2287 -0
- package/dist/mobile-web/assets/index.esm-ES8aBvqn.js +599 -0
- package/dist/mobile-web/assets/index.esm2017-B0pGzpCg.js +481 -0
- package/dist/mobile-web/assets/whip-CTqIatiK.png +0 -0
- package/dist/mobile-web/favicon-16x16.png +0 -0
- package/dist/mobile-web/favicon-32x32.png +0 -0
- package/dist/mobile-web/firebase-messaging-sw.js +43 -0
- package/dist/mobile-web/icon.svg +12 -0
- package/dist/mobile-web/index.html +27 -0
- package/dist/mobile-web/manifest.webmanifest +16 -0
- package/package.json +59 -0
|
@@ -0,0 +1,599 @@
|
|
|
1
|
+
import{r as y,j as m,M as T,e as M,E as Q,T as P,F as ve,v as I,n as Se,U as Ae,Q as Ee,V as _e,W as A}from"./index.esm2017-B0pGzpCg.js";const X="@firebase/installations",R="0.6.9";/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2019 Google LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/const Z=1e4,ee=`w:${R}`,te="FIS_v2",Oe="https://firebaseinstallations.googleapis.com/v1",Ce=60*60*1e3,Ne="installations",De="Installations";/**
|
|
17
|
+
* @license
|
|
18
|
+
* Copyright 2019 Google LLC
|
|
19
|
+
*
|
|
20
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
21
|
+
* you may not use this file except in compliance with the License.
|
|
22
|
+
* You may obtain a copy of the License at
|
|
23
|
+
*
|
|
24
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
25
|
+
*
|
|
26
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
27
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
28
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
29
|
+
* See the License for the specific language governing permissions and
|
|
30
|
+
* limitations under the License.
|
|
31
|
+
*/const Me={"missing-app-config-values":'Missing App configuration value: "{$valueName}"',"not-registered":"Firebase Installation is not registered.","installation-not-found":"Firebase Installation not found.","request-failed":'{$requestName} request failed with error "{$serverCode} {$serverStatus}: {$serverMessage}"',"app-offline":"Could not process request. Application offline.","delete-pending-registration":"Can't delete installation while there is a pending registration request."},g=new Q(Ne,De,Me);function ne(e){return e instanceof ve&&e.code.includes("request-failed")}/**
|
|
32
|
+
* @license
|
|
33
|
+
* Copyright 2019 Google LLC
|
|
34
|
+
*
|
|
35
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
36
|
+
* you may not use this file except in compliance with the License.
|
|
37
|
+
* You may obtain a copy of the License at
|
|
38
|
+
*
|
|
39
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
40
|
+
*
|
|
41
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
42
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
43
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
44
|
+
* See the License for the specific language governing permissions and
|
|
45
|
+
* limitations under the License.
|
|
46
|
+
*/function oe({projectId:e}){return`${Oe}/projects/${e}/installations`}function ie(e){return{token:e.token,requestStatus:2,expiresIn:Re(e.expiresIn),creationTime:Date.now()}}async function re(e,t){const o=(await t.json()).error;return g.create("request-failed",{requestName:e,serverCode:o.code,serverMessage:o.message,serverStatus:o.status})}function ae({apiKey:e}){return new Headers({"Content-Type":"application/json",Accept:"application/json","x-goog-api-key":e})}function Pe(e,{refreshToken:t}){const n=ae(e);return n.append("Authorization",je(t)),n}async function se(e){const t=await e();return t.status>=500&&t.status<600?e():t}function Re(e){return Number(e.replace("s","000"))}function je(e){return`${te} ${e}`}/**
|
|
47
|
+
* @license
|
|
48
|
+
* Copyright 2019 Google LLC
|
|
49
|
+
*
|
|
50
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
51
|
+
* you may not use this file except in compliance with the License.
|
|
52
|
+
* You may obtain a copy of the License at
|
|
53
|
+
*
|
|
54
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
55
|
+
*
|
|
56
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
57
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
58
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
59
|
+
* See the License for the specific language governing permissions and
|
|
60
|
+
* limitations under the License.
|
|
61
|
+
*/async function Fe({appConfig:e,heartbeatServiceProvider:t},{fid:n}){const o=oe(e),i=ae(e),r=t.getImmediate({optional:!0});if(r){const d=await r.getHeartbeatsHeader();d&&i.append("x-firebase-client",d)}const a={fid:n,authVersion:te,appId:e.appId,sdkVersion:ee},c={method:"POST",headers:i,body:JSON.stringify(a)},f=await se(()=>fetch(o,c));if(f.ok){const d=await f.json();return{fid:d.fid||n,registrationStatus:2,refreshToken:d.refreshToken,authToken:ie(d.authToken)}}else throw await re("Create Installation",f)}/**
|
|
62
|
+
* @license
|
|
63
|
+
* Copyright 2019 Google LLC
|
|
64
|
+
*
|
|
65
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
66
|
+
* you may not use this file except in compliance with the License.
|
|
67
|
+
* You may obtain a copy of the License at
|
|
68
|
+
*
|
|
69
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
70
|
+
*
|
|
71
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
72
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
73
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
74
|
+
* See the License for the specific language governing permissions and
|
|
75
|
+
* limitations under the License.
|
|
76
|
+
*/function ce(e){return new Promise(t=>{setTimeout(t,e)})}/**
|
|
77
|
+
* @license
|
|
78
|
+
* Copyright 2019 Google LLC
|
|
79
|
+
*
|
|
80
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
81
|
+
* you may not use this file except in compliance with the License.
|
|
82
|
+
* You may obtain a copy of the License at
|
|
83
|
+
*
|
|
84
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
85
|
+
*
|
|
86
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
87
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
88
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
89
|
+
* See the License for the specific language governing permissions and
|
|
90
|
+
* limitations under the License.
|
|
91
|
+
*/function Ke(e){return btoa(String.fromCharCode(...e)).replace(/\+/g,"-").replace(/\//g,"_")}/**
|
|
92
|
+
* @license
|
|
93
|
+
* Copyright 2019 Google LLC
|
|
94
|
+
*
|
|
95
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
96
|
+
* you may not use this file except in compliance with the License.
|
|
97
|
+
* You may obtain a copy of the License at
|
|
98
|
+
*
|
|
99
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
100
|
+
*
|
|
101
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
102
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
103
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
104
|
+
* See the License for the specific language governing permissions and
|
|
105
|
+
* limitations under the License.
|
|
106
|
+
*/const $e=/^[cdef][\w-]{21}$/,D="";function qe(){try{const e=new Uint8Array(17);(self.crypto||self.msCrypto).getRandomValues(e),e[0]=112+e[0]%16;const n=Le(e);return $e.test(n)?n:D}catch{return D}}function Le(e){return Ke(e).substr(0,22)}/**
|
|
107
|
+
* @license
|
|
108
|
+
* Copyright 2019 Google LLC
|
|
109
|
+
*
|
|
110
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
111
|
+
* you may not use this file except in compliance with the License.
|
|
112
|
+
* You may obtain a copy of the License at
|
|
113
|
+
*
|
|
114
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
115
|
+
*
|
|
116
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
117
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
118
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
119
|
+
* See the License for the specific language governing permissions and
|
|
120
|
+
* limitations under the License.
|
|
121
|
+
*/function v(e){return`${e.appName}!${e.appId}`}/**
|
|
122
|
+
* @license
|
|
123
|
+
* Copyright 2019 Google LLC
|
|
124
|
+
*
|
|
125
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
126
|
+
* you may not use this file except in compliance with the License.
|
|
127
|
+
* You may obtain a copy of the License at
|
|
128
|
+
*
|
|
129
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
130
|
+
*
|
|
131
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
132
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
133
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
134
|
+
* See the License for the specific language governing permissions and
|
|
135
|
+
* limitations under the License.
|
|
136
|
+
*/const ue=new Map;function de(e,t){const n=v(e);fe(n,t),xe(n,t)}function fe(e,t){const n=ue.get(e);if(n)for(const o of n)o(t)}function xe(e,t){const n=Ve();n&&n.postMessage({key:e,fid:t}),Be()}let l=null;function Ve(){return!l&&"BroadcastChannel"in self&&(l=new BroadcastChannel("[Firebase] FID Change"),l.onmessage=e=>{fe(e.data.key,e.data.fid)}),l}function Be(){ue.size===0&&l&&(l.close(),l=null)}/**
|
|
137
|
+
* @license
|
|
138
|
+
* Copyright 2019 Google LLC
|
|
139
|
+
*
|
|
140
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
141
|
+
* you may not use this file except in compliance with the License.
|
|
142
|
+
* You may obtain a copy of the License at
|
|
143
|
+
*
|
|
144
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
145
|
+
*
|
|
146
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
147
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
148
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
149
|
+
* See the License for the specific language governing permissions and
|
|
150
|
+
* limitations under the License.
|
|
151
|
+
*/const He="firebase-installations-database",We=1,w="firebase-installations-store";let E=null;function j(){return E||(E=P(He,We,{upgrade:(e,t)=>{switch(t){case 0:e.createObjectStore(w)}}})),E}async function k(e,t){const n=v(e),i=(await j()).transaction(w,"readwrite"),r=i.objectStore(w),a=await r.get(n);return await r.put(t,n),await i.done,(!a||a.fid!==t.fid)&&de(e,t.fid),t}async function pe(e){const t=v(e),o=(await j()).transaction(w,"readwrite");await o.objectStore(w).delete(t),await o.done}async function S(e,t){const n=v(e),i=(await j()).transaction(w,"readwrite"),r=i.objectStore(w),a=await r.get(n),c=t(a);return c===void 0?await r.delete(n):await r.put(c,n),await i.done,c&&(!a||a.fid!==c.fid)&&de(e,c.fid),c}/**
|
|
152
|
+
* @license
|
|
153
|
+
* Copyright 2019 Google LLC
|
|
154
|
+
*
|
|
155
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
156
|
+
* you may not use this file except in compliance with the License.
|
|
157
|
+
* You may obtain a copy of the License at
|
|
158
|
+
*
|
|
159
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
160
|
+
*
|
|
161
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
162
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
163
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
164
|
+
* See the License for the specific language governing permissions and
|
|
165
|
+
* limitations under the License.
|
|
166
|
+
*/async function F(e){let t;const n=await S(e.appConfig,o=>{const i=Ue(o),r=Ge(e,i);return t=r.registrationPromise,r.installationEntry});return n.fid===D?{installationEntry:await t}:{installationEntry:n,registrationPromise:t}}function Ue(e){const t=e||{fid:qe(),registrationStatus:0};return le(t)}function Ge(e,t){if(t.registrationStatus===0){if(!navigator.onLine){const i=Promise.reject(g.create("app-offline"));return{installationEntry:t,registrationPromise:i}}const n={fid:t.fid,registrationStatus:1,registrationTime:Date.now()},o=Je(e,n);return{installationEntry:n,registrationPromise:o}}else return t.registrationStatus===1?{installationEntry:t,registrationPromise:Ye(e)}:{installationEntry:t}}async function Je(e,t){try{const n=await Fe(e,t);return k(e.appConfig,n)}catch(n){throw ne(n)&&n.customData.serverCode===409?await pe(e.appConfig):await k(e.appConfig,{fid:t.fid,registrationStatus:0}),n}}async function Ye(e){let t=await B(e.appConfig);for(;t.registrationStatus===1;)await ce(100),t=await B(e.appConfig);if(t.registrationStatus===0){const{installationEntry:n,registrationPromise:o}=await F(e);return o||n}return t}function B(e){return S(e,t=>{if(!t)throw g.create("installation-not-found");return le(t)})}function le(e){return ze(e)?{fid:e.fid,registrationStatus:0}:e}function ze(e){return e.registrationStatus===1&&e.registrationTime+Z<Date.now()}/**
|
|
167
|
+
* @license
|
|
168
|
+
* Copyright 2019 Google LLC
|
|
169
|
+
*
|
|
170
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
171
|
+
* you may not use this file except in compliance with the License.
|
|
172
|
+
* You may obtain a copy of the License at
|
|
173
|
+
*
|
|
174
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
175
|
+
*
|
|
176
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
177
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
178
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
179
|
+
* See the License for the specific language governing permissions and
|
|
180
|
+
* limitations under the License.
|
|
181
|
+
*/async function Qe({appConfig:e,heartbeatServiceProvider:t},n){const o=Xe(e,n),i=Pe(e,n),r=t.getImmediate({optional:!0});if(r){const d=await r.getHeartbeatsHeader();d&&i.append("x-firebase-client",d)}const a={installation:{sdkVersion:ee,appId:e.appId}},c={method:"POST",headers:i,body:JSON.stringify(a)},f=await se(()=>fetch(o,c));if(f.ok){const d=await f.json();return ie(d)}else throw await re("Generate Auth Token",f)}function Xe(e,{fid:t}){return`${oe(e)}/${t}/authTokens:generate`}/**
|
|
182
|
+
* @license
|
|
183
|
+
* Copyright 2019 Google LLC
|
|
184
|
+
*
|
|
185
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
186
|
+
* you may not use this file except in compliance with the License.
|
|
187
|
+
* You may obtain a copy of the License at
|
|
188
|
+
*
|
|
189
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
190
|
+
*
|
|
191
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
192
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
193
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
194
|
+
* See the License for the specific language governing permissions and
|
|
195
|
+
* limitations under the License.
|
|
196
|
+
*/async function K(e,t=!1){let n;const o=await S(e.appConfig,r=>{if(!ge(r))throw g.create("not-registered");const a=r.authToken;if(!t&&tt(a))return r;if(a.requestStatus===1)return n=Ze(e,t),r;{if(!navigator.onLine)throw g.create("app-offline");const c=ot(r);return n=et(e,c),c}});return n?await n:o.authToken}async function Ze(e,t){let n=await H(e.appConfig);for(;n.authToken.requestStatus===1;)await ce(100),n=await H(e.appConfig);const o=n.authToken;return o.requestStatus===0?K(e,t):o}function H(e){return S(e,t=>{if(!ge(t))throw g.create("not-registered");const n=t.authToken;return it(n)?Object.assign(Object.assign({},t),{authToken:{requestStatus:0}}):t})}async function et(e,t){try{const n=await Qe(e,t),o=Object.assign(Object.assign({},t),{authToken:n});return await k(e.appConfig,o),n}catch(n){if(ne(n)&&(n.customData.serverCode===401||n.customData.serverCode===404))await pe(e.appConfig);else{const o=Object.assign(Object.assign({},t),{authToken:{requestStatus:0}});await k(e.appConfig,o)}throw n}}function ge(e){return e!==void 0&&e.registrationStatus===2}function tt(e){return e.requestStatus===2&&!nt(e)}function nt(e){const t=Date.now();return t<e.creationTime||e.creationTime+e.expiresIn<t+Ce}function ot(e){const t={requestStatus:1,requestTime:Date.now()};return Object.assign(Object.assign({},e),{authToken:t})}function it(e){return e.requestStatus===1&&e.requestTime+Z<Date.now()}/**
|
|
197
|
+
* @license
|
|
198
|
+
* Copyright 2019 Google LLC
|
|
199
|
+
*
|
|
200
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
201
|
+
* you may not use this file except in compliance with the License.
|
|
202
|
+
* You may obtain a copy of the License at
|
|
203
|
+
*
|
|
204
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
205
|
+
*
|
|
206
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
207
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
208
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
209
|
+
* See the License for the specific language governing permissions and
|
|
210
|
+
* limitations under the License.
|
|
211
|
+
*/async function rt(e){const t=e,{installationEntry:n,registrationPromise:o}=await F(t);return o?o.catch(console.error):K(t).catch(console.error),n.fid}/**
|
|
212
|
+
* @license
|
|
213
|
+
* Copyright 2019 Google LLC
|
|
214
|
+
*
|
|
215
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
216
|
+
* you may not use this file except in compliance with the License.
|
|
217
|
+
* You may obtain a copy of the License at
|
|
218
|
+
*
|
|
219
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
220
|
+
*
|
|
221
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
222
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
223
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
224
|
+
* See the License for the specific language governing permissions and
|
|
225
|
+
* limitations under the License.
|
|
226
|
+
*/async function at(e,t=!1){const n=e;return await st(n),(await K(n,t)).token}async function st(e){const{registrationPromise:t}=await F(e);t&&await t}/**
|
|
227
|
+
* @license
|
|
228
|
+
* Copyright 2019 Google LLC
|
|
229
|
+
*
|
|
230
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
231
|
+
* you may not use this file except in compliance with the License.
|
|
232
|
+
* You may obtain a copy of the License at
|
|
233
|
+
*
|
|
234
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
235
|
+
*
|
|
236
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
237
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
238
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
239
|
+
* See the License for the specific language governing permissions and
|
|
240
|
+
* limitations under the License.
|
|
241
|
+
*/function ct(e){if(!e||!e.options)throw _("App Configuration");if(!e.name)throw _("App Name");const t=["projectId","apiKey","appId"];for(const n of t)if(!e.options[n])throw _(n);return{appName:e.name,projectId:e.options.projectId,apiKey:e.options.apiKey,appId:e.options.appId}}function _(e){return g.create("missing-app-config-values",{valueName:e})}/**
|
|
242
|
+
* @license
|
|
243
|
+
* Copyright 2020 Google LLC
|
|
244
|
+
*
|
|
245
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
246
|
+
* you may not use this file except in compliance with the License.
|
|
247
|
+
* You may obtain a copy of the License at
|
|
248
|
+
*
|
|
249
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
250
|
+
*
|
|
251
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
252
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
253
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
254
|
+
* See the License for the specific language governing permissions and
|
|
255
|
+
* limitations under the License.
|
|
256
|
+
*/const we="installations",ut="installations-internal",dt=e=>{const t=e.getProvider("app").getImmediate(),n=ct(t),o=M(t,"heartbeat");return{app:t,appConfig:n,heartbeatServiceProvider:o,_delete:()=>Promise.resolve()}},ft=e=>{const t=e.getProvider("app").getImmediate(),n=M(t,we).getImmediate();return{getId:()=>rt(n),getToken:i=>at(n,i)}};function pt(){m(new T(we,dt,"PUBLIC")),m(new T(ut,ft,"PRIVATE"))}pt();y(X,R);y(X,R,"esm2017");/**
|
|
257
|
+
* @license
|
|
258
|
+
* Copyright 2019 Google LLC
|
|
259
|
+
*
|
|
260
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
261
|
+
* you may not use this file except in compliance with the License.
|
|
262
|
+
* You may obtain a copy of the License at
|
|
263
|
+
*
|
|
264
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
265
|
+
*
|
|
266
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
267
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
268
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
269
|
+
* See the License for the specific language governing permissions and
|
|
270
|
+
* limitations under the License.
|
|
271
|
+
*/const lt="/firebase-messaging-sw.js",gt="/firebase-cloud-messaging-push-scope",he="BDOU99-h67HcA6JeFXHbSNMu7e2yNNu3RzoMj8TM4W88jITfq7ZmPvIM1Iv-4_l2LxQcYwhqby2xGpWwzjfAnG4",wt="https://fcmregistrations.googleapis.com/v1",be="google.c.a.c_id",ht="google.c.a.c_l",bt="google.c.a.ts",yt="google.c.a.e";var W;(function(e){e[e.DATA_MESSAGE=1]="DATA_MESSAGE",e[e.DISPLAY_NOTIFICATION=3]="DISPLAY_NOTIFICATION"})(W||(W={}));/**
|
|
272
|
+
* @license
|
|
273
|
+
* Copyright 2018 Google LLC
|
|
274
|
+
*
|
|
275
|
+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
|
|
276
|
+
* in compliance with the License. You may obtain a copy of the License at
|
|
277
|
+
*
|
|
278
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
279
|
+
*
|
|
280
|
+
* Unless required by applicable law or agreed to in writing, software distributed under the License
|
|
281
|
+
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
|
|
282
|
+
* or implied. See the License for the specific language governing permissions and limitations under
|
|
283
|
+
* the License.
|
|
284
|
+
*/var b;(function(e){e.PUSH_RECEIVED="push-received",e.NOTIFICATION_CLICKED="notification-clicked"})(b||(b={}));/**
|
|
285
|
+
* @license
|
|
286
|
+
* Copyright 2017 Google LLC
|
|
287
|
+
*
|
|
288
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
289
|
+
* you may not use this file except in compliance with the License.
|
|
290
|
+
* You may obtain a copy of the License at
|
|
291
|
+
*
|
|
292
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
293
|
+
*
|
|
294
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
295
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
296
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
297
|
+
* See the License for the specific language governing permissions and
|
|
298
|
+
* limitations under the License.
|
|
299
|
+
*/function p(e){const t=new Uint8Array(e);return btoa(String.fromCharCode(...t)).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function mt(e){const t="=".repeat((4-e.length%4)%4),n=(e+t).replace(/\-/g,"+").replace(/_/g,"/"),o=atob(n),i=new Uint8Array(o.length);for(let r=0;r<o.length;++r)i[r]=o.charCodeAt(r);return i}/**
|
|
300
|
+
* @license
|
|
301
|
+
* Copyright 2019 Google LLC
|
|
302
|
+
*
|
|
303
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
304
|
+
* you may not use this file except in compliance with the License.
|
|
305
|
+
* You may obtain a copy of the License at
|
|
306
|
+
*
|
|
307
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
308
|
+
*
|
|
309
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
310
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
311
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
312
|
+
* See the License for the specific language governing permissions and
|
|
313
|
+
* limitations under the License.
|
|
314
|
+
*/const O="fcm_token_details_db",Tt=5,U="fcm_token_object_Store";async function kt(e){if("databases"in indexedDB&&!(await indexedDB.databases()).map(r=>r.name).includes(O))return null;let t=null;return(await P(O,Tt,{upgrade:async(o,i,r,a)=>{var c;if(i<2||!o.objectStoreNames.contains(U))return;const f=a.objectStore(U),d=await f.index("fcmSenderId").get(e);if(await f.clear(),!!d){if(i===2){const s=d;if(!s.auth||!s.p256dh||!s.endpoint)return;t={token:s.fcmToken,createTime:(c=s.createTime)!==null&&c!==void 0?c:Date.now(),subscriptionOptions:{auth:s.auth,p256dh:s.p256dh,endpoint:s.endpoint,swScope:s.swScope,vapidKey:typeof s.vapidKey=="string"?s.vapidKey:p(s.vapidKey)}}}else if(i===3){const s=d;t={token:s.fcmToken,createTime:s.createTime,subscriptionOptions:{auth:p(s.auth),p256dh:p(s.p256dh),endpoint:s.endpoint,swScope:s.swScope,vapidKey:p(s.vapidKey)}}}else if(i===4){const s=d;t={token:s.fcmToken,createTime:s.createTime,subscriptionOptions:{auth:p(s.auth),p256dh:p(s.p256dh),endpoint:s.endpoint,swScope:s.swScope,vapidKey:p(s.vapidKey)}}}}}})).close(),await A(O),await A("fcm_vapid_details_db"),await A("undefined"),It(t)?t:null}function It(e){if(!e||!e.subscriptionOptions)return!1;const{subscriptionOptions:t}=e;return typeof e.createTime=="number"&&e.createTime>0&&typeof e.token=="string"&&e.token.length>0&&typeof t.auth=="string"&&t.auth.length>0&&typeof t.p256dh=="string"&&t.p256dh.length>0&&typeof t.endpoint=="string"&&t.endpoint.length>0&&typeof t.swScope=="string"&&t.swScope.length>0&&typeof t.vapidKey=="string"&&t.vapidKey.length>0}/**
|
|
315
|
+
* @license
|
|
316
|
+
* Copyright 2019 Google LLC
|
|
317
|
+
*
|
|
318
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
319
|
+
* you may not use this file except in compliance with the License.
|
|
320
|
+
* You may obtain a copy of the License at
|
|
321
|
+
*
|
|
322
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
323
|
+
*
|
|
324
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
325
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
326
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
327
|
+
* See the License for the specific language governing permissions and
|
|
328
|
+
* limitations under the License.
|
|
329
|
+
*/const vt="firebase-messaging-database",St=1,h="firebase-messaging-store";let C=null;function $(){return C||(C=P(vt,St,{upgrade:(e,t)=>{switch(t){case 0:e.createObjectStore(h)}}})),C}async function ye(e){const t=L(e),o=await(await $()).transaction(h).objectStore(h).get(t);if(o)return o;{const i=await kt(e.appConfig.senderId);if(i)return await q(e,i),i}}async function q(e,t){const n=L(e),i=(await $()).transaction(h,"readwrite");return await i.objectStore(h).put(t,n),await i.done,t}async function At(e){const t=L(e),o=(await $()).transaction(h,"readwrite");await o.objectStore(h).delete(t),await o.done}function L({appConfig:e}){return e.appId}/**
|
|
330
|
+
* @license
|
|
331
|
+
* Copyright 2017 Google LLC
|
|
332
|
+
*
|
|
333
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
334
|
+
* you may not use this file except in compliance with the License.
|
|
335
|
+
* You may obtain a copy of the License at
|
|
336
|
+
*
|
|
337
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
338
|
+
*
|
|
339
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
340
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
341
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
342
|
+
* See the License for the specific language governing permissions and
|
|
343
|
+
* limitations under the License.
|
|
344
|
+
*/const Et={"missing-app-config-values":'Missing App configuration value: "{$valueName}"',"only-available-in-window":"This method is available in a Window context.","only-available-in-sw":"This method is available in a service worker context.","permission-default":"The notification permission was not granted and dismissed instead.","permission-blocked":"The notification permission was not granted and blocked instead.","unsupported-browser":"This browser doesn't support the API's required to use the Firebase SDK.","indexed-db-unsupported":"This browser doesn't support indexedDb.open() (ex. Safari iFrame, Firefox Private Browsing, etc)","failed-service-worker-registration":"We are unable to register the default service worker. {$browserErrorMessage}","token-subscribe-failed":"A problem occurred while subscribing the user to FCM: {$errorInfo}","token-subscribe-no-token":"FCM returned no token when subscribing the user to push.","token-unsubscribe-failed":"A problem occurred while unsubscribing the user from FCM: {$errorInfo}","token-update-failed":"A problem occurred while updating the user from FCM: {$errorInfo}","token-update-no-token":"FCM returned no token when updating the user to push.","use-sw-after-get-token":"The useServiceWorker() method may only be called once and must be called before calling getToken() to ensure your service worker is used.","invalid-sw-registration":"The input to useServiceWorker() must be a ServiceWorkerRegistration.","invalid-bg-handler":"The input to setBackgroundMessageHandler() must be a function.","invalid-vapid-key":"The public VAPID key must be a string.","use-vapid-key-after-get-token":"The usePublicVapidKey() method may only be called once and must be called before calling getToken() to ensure your VAPID key is used."},u=new Q("messaging","Messaging",Et);/**
|
|
345
|
+
* @license
|
|
346
|
+
* Copyright 2019 Google LLC
|
|
347
|
+
*
|
|
348
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
349
|
+
* you may not use this file except in compliance with the License.
|
|
350
|
+
* You may obtain a copy of the License at
|
|
351
|
+
*
|
|
352
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
353
|
+
*
|
|
354
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
355
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
356
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
357
|
+
* See the License for the specific language governing permissions and
|
|
358
|
+
* limitations under the License.
|
|
359
|
+
*/async function _t(e,t){const n=await V(e),o=Te(t),i={method:"POST",headers:n,body:JSON.stringify(o)};let r;try{r=await(await fetch(x(e.appConfig),i)).json()}catch(a){throw u.create("token-subscribe-failed",{errorInfo:a?.toString()})}if(r.error){const a=r.error.message;throw u.create("token-subscribe-failed",{errorInfo:a})}if(!r.token)throw u.create("token-subscribe-no-token");return r.token}async function Ot(e,t){const n=await V(e),o=Te(t.subscriptionOptions),i={method:"PATCH",headers:n,body:JSON.stringify(o)};let r;try{r=await(await fetch(`${x(e.appConfig)}/${t.token}`,i)).json()}catch(a){throw u.create("token-update-failed",{errorInfo:a?.toString()})}if(r.error){const a=r.error.message;throw u.create("token-update-failed",{errorInfo:a})}if(!r.token)throw u.create("token-update-no-token");return r.token}async function me(e,t){const o={method:"DELETE",headers:await V(e)};try{const r=await(await fetch(`${x(e.appConfig)}/${t}`,o)).json();if(r.error){const a=r.error.message;throw u.create("token-unsubscribe-failed",{errorInfo:a})}}catch(i){throw u.create("token-unsubscribe-failed",{errorInfo:i?.toString()})}}function x({projectId:e}){return`${wt}/projects/${e}/registrations`}async function V({appConfig:e,installations:t}){const n=await t.getToken();return new Headers({"Content-Type":"application/json",Accept:"application/json","x-goog-api-key":e.apiKey,"x-goog-firebase-installations-auth":`FIS ${n}`})}function Te({p256dh:e,auth:t,endpoint:n,vapidKey:o}){const i={web:{endpoint:n,auth:t,p256dh:e}};return o!==he&&(i.web.applicationPubKey=o),i}/**
|
|
360
|
+
* @license
|
|
361
|
+
* Copyright 2019 Google LLC
|
|
362
|
+
*
|
|
363
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
364
|
+
* you may not use this file except in compliance with the License.
|
|
365
|
+
* You may obtain a copy of the License at
|
|
366
|
+
*
|
|
367
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
368
|
+
*
|
|
369
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
370
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
371
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
372
|
+
* See the License for the specific language governing permissions and
|
|
373
|
+
* limitations under the License.
|
|
374
|
+
*/const Ct=7*24*60*60*1e3;async function Nt(e){const t=await Pt(e.swRegistration,e.vapidKey),n={vapidKey:e.vapidKey,swScope:e.swRegistration.scope,endpoint:t.endpoint,auth:p(t.getKey("auth")),p256dh:p(t.getKey("p256dh"))},o=await ye(e.firebaseDependencies);if(o){if(Rt(o.subscriptionOptions,n))return Date.now()>=o.createTime+Ct?Mt(e,{token:o.token,createTime:Date.now(),subscriptionOptions:n}):o.token;try{await me(e.firebaseDependencies,o.token)}catch(i){console.warn(i)}return G(e.firebaseDependencies,n)}else return G(e.firebaseDependencies,n)}async function Dt(e){const t=await ye(e.firebaseDependencies);t&&(await me(e.firebaseDependencies,t.token),await At(e.firebaseDependencies));const n=await e.swRegistration.pushManager.getSubscription();return n?n.unsubscribe():!0}async function Mt(e,t){try{const n=await Ot(e.firebaseDependencies,t),o=Object.assign(Object.assign({},t),{token:n,createTime:Date.now()});return await q(e.firebaseDependencies,o),n}catch(n){throw n}}async function G(e,t){const o={token:await _t(e,t),createTime:Date.now(),subscriptionOptions:t};return await q(e,o),o.token}async function Pt(e,t){const n=await e.pushManager.getSubscription();return n||e.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:mt(t)})}function Rt(e,t){const n=t.vapidKey===e.vapidKey,o=t.endpoint===e.endpoint,i=t.auth===e.auth,r=t.p256dh===e.p256dh;return n&&o&&i&&r}/**
|
|
375
|
+
* @license
|
|
376
|
+
* Copyright 2020 Google LLC
|
|
377
|
+
*
|
|
378
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
379
|
+
* you may not use this file except in compliance with the License.
|
|
380
|
+
* You may obtain a copy of the License at
|
|
381
|
+
*
|
|
382
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
383
|
+
*
|
|
384
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
385
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
386
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
387
|
+
* See the License for the specific language governing permissions and
|
|
388
|
+
* limitations under the License.
|
|
389
|
+
*/function J(e){const t={from:e.from,collapseKey:e.collapse_key,messageId:e.fcmMessageId};return jt(t,e),Ft(t,e),Kt(t,e),t}function jt(e,t){if(!t.notification)return;e.notification={};const n=t.notification.title;n&&(e.notification.title=n);const o=t.notification.body;o&&(e.notification.body=o);const i=t.notification.image;i&&(e.notification.image=i);const r=t.notification.icon;r&&(e.notification.icon=r)}function Ft(e,t){t.data&&(e.data=t.data)}function Kt(e,t){var n,o,i,r,a;if(!t.fcmOptions&&!(!((n=t.notification)===null||n===void 0)&&n.click_action))return;e.fcmOptions={};const c=(i=(o=t.fcmOptions)===null||o===void 0?void 0:o.link)!==null&&i!==void 0?i:(r=t.notification)===null||r===void 0?void 0:r.click_action;c&&(e.fcmOptions.link=c);const f=(a=t.fcmOptions)===null||a===void 0?void 0:a.analytics_label;f&&(e.fcmOptions.analyticsLabel=f)}/**
|
|
390
|
+
* @license
|
|
391
|
+
* Copyright 2019 Google LLC
|
|
392
|
+
*
|
|
393
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
394
|
+
* you may not use this file except in compliance with the License.
|
|
395
|
+
* You may obtain a copy of the License at
|
|
396
|
+
*
|
|
397
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
398
|
+
*
|
|
399
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
400
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
401
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
402
|
+
* See the License for the specific language governing permissions and
|
|
403
|
+
* limitations under the License.
|
|
404
|
+
*/function $t(e){return typeof e=="object"&&!!e&&be in e}/**
|
|
405
|
+
* @license
|
|
406
|
+
* Copyright 2019 Google LLC
|
|
407
|
+
*
|
|
408
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
409
|
+
* you may not use this file except in compliance with the License.
|
|
410
|
+
* You may obtain a copy of the License at
|
|
411
|
+
*
|
|
412
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
413
|
+
*
|
|
414
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
415
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
416
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
417
|
+
* See the License for the specific language governing permissions and
|
|
418
|
+
* limitations under the License.
|
|
419
|
+
*/function qt(e){if(!e||!e.options)throw N("App Configuration Object");if(!e.name)throw N("App Name");const t=["projectId","apiKey","appId","messagingSenderId"],{options:n}=e;for(const o of t)if(!n[o])throw N(o);return{appName:e.name,projectId:n.projectId,apiKey:n.apiKey,appId:n.appId,senderId:n.messagingSenderId}}function N(e){return u.create("missing-app-config-values",{valueName:e})}/**
|
|
420
|
+
* @license
|
|
421
|
+
* Copyright 2020 Google LLC
|
|
422
|
+
*
|
|
423
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
424
|
+
* you may not use this file except in compliance with the License.
|
|
425
|
+
* You may obtain a copy of the License at
|
|
426
|
+
*
|
|
427
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
428
|
+
*
|
|
429
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
430
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
431
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
432
|
+
* See the License for the specific language governing permissions and
|
|
433
|
+
* limitations under the License.
|
|
434
|
+
*/class Lt{constructor(t,n,o){this.deliveryMetricsExportedToBigQueryEnabled=!1,this.onBackgroundMessageHandler=null,this.onMessageHandler=null,this.logEvents=[],this.isLogServiceStarted=!1;const i=qt(t);this.firebaseDependencies={app:t,appConfig:i,installations:n,analyticsProvider:o}}_delete(){return Promise.resolve()}}/**
|
|
435
|
+
* @license
|
|
436
|
+
* Copyright 2020 Google LLC
|
|
437
|
+
*
|
|
438
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
439
|
+
* you may not use this file except in compliance with the License.
|
|
440
|
+
* You may obtain a copy of the License at
|
|
441
|
+
*
|
|
442
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
443
|
+
*
|
|
444
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
445
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
446
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
447
|
+
* See the License for the specific language governing permissions and
|
|
448
|
+
* limitations under the License.
|
|
449
|
+
*/async function ke(e){try{e.swRegistration=await navigator.serviceWorker.register(lt,{scope:gt}),e.swRegistration.update().catch(()=>{})}catch(t){throw u.create("failed-service-worker-registration",{browserErrorMessage:t?.message})}}/**
|
|
450
|
+
* @license
|
|
451
|
+
* Copyright 2020 Google LLC
|
|
452
|
+
*
|
|
453
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
454
|
+
* you may not use this file except in compliance with the License.
|
|
455
|
+
* You may obtain a copy of the License at
|
|
456
|
+
*
|
|
457
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
458
|
+
*
|
|
459
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
460
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
461
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
462
|
+
* See the License for the specific language governing permissions and
|
|
463
|
+
* limitations under the License.
|
|
464
|
+
*/async function xt(e,t){if(!t&&!e.swRegistration&&await ke(e),!(!t&&e.swRegistration)){if(!(t instanceof ServiceWorkerRegistration))throw u.create("invalid-sw-registration");e.swRegistration=t}}/**
|
|
465
|
+
* @license
|
|
466
|
+
* Copyright 2020 Google LLC
|
|
467
|
+
*
|
|
468
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
469
|
+
* you may not use this file except in compliance with the License.
|
|
470
|
+
* You may obtain a copy of the License at
|
|
471
|
+
*
|
|
472
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
473
|
+
*
|
|
474
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
475
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
476
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
477
|
+
* See the License for the specific language governing permissions and
|
|
478
|
+
* limitations under the License.
|
|
479
|
+
*/async function Vt(e,t){t?e.vapidKey=t:e.vapidKey||(e.vapidKey=he)}/**
|
|
480
|
+
* @license
|
|
481
|
+
* Copyright 2020 Google LLC
|
|
482
|
+
*
|
|
483
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
484
|
+
* you may not use this file except in compliance with the License.
|
|
485
|
+
* You may obtain a copy of the License at
|
|
486
|
+
*
|
|
487
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
488
|
+
*
|
|
489
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
490
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
491
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
492
|
+
* See the License for the specific language governing permissions and
|
|
493
|
+
* limitations under the License.
|
|
494
|
+
*/async function Ie(e,t){if(!navigator)throw u.create("only-available-in-window");if(Notification.permission==="default"&&await Notification.requestPermission(),Notification.permission!=="granted")throw u.create("permission-blocked");return await Vt(e,t?.vapidKey),await xt(e,t?.serviceWorkerRegistration),Nt(e)}/**
|
|
495
|
+
* @license
|
|
496
|
+
* Copyright 2019 Google LLC
|
|
497
|
+
*
|
|
498
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
499
|
+
* you may not use this file except in compliance with the License.
|
|
500
|
+
* You may obtain a copy of the License at
|
|
501
|
+
*
|
|
502
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
503
|
+
*
|
|
504
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
505
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
506
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
507
|
+
* See the License for the specific language governing permissions and
|
|
508
|
+
* limitations under the License.
|
|
509
|
+
*/async function Bt(e,t,n){const o=Ht(t);(await e.firebaseDependencies.analyticsProvider.get()).logEvent(o,{message_id:n[be],message_name:n[ht],message_time:n[bt],message_device_time:Math.floor(Date.now()/1e3)})}function Ht(e){switch(e){case b.NOTIFICATION_CLICKED:return"notification_open";case b.PUSH_RECEIVED:return"notification_foreground";default:throw new Error}}/**
|
|
510
|
+
* @license
|
|
511
|
+
* Copyright 2017 Google LLC
|
|
512
|
+
*
|
|
513
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
514
|
+
* you may not use this file except in compliance with the License.
|
|
515
|
+
* You may obtain a copy of the License at
|
|
516
|
+
*
|
|
517
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
518
|
+
*
|
|
519
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
520
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
521
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
522
|
+
* See the License for the specific language governing permissions and
|
|
523
|
+
* limitations under the License.
|
|
524
|
+
*/async function Wt(e,t){const n=t.data;if(!n.isFirebaseMessaging)return;e.onMessageHandler&&n.messageType===b.PUSH_RECEIVED&&(typeof e.onMessageHandler=="function"?e.onMessageHandler(J(n)):e.onMessageHandler.next(J(n)));const o=n.data;$t(o)&&o[yt]==="1"&&await Bt(e,n.messageType,o)}const Y="@firebase/messaging",z="0.12.12";/**
|
|
525
|
+
* @license
|
|
526
|
+
* Copyright 2020 Google LLC
|
|
527
|
+
*
|
|
528
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
529
|
+
* you may not use this file except in compliance with the License.
|
|
530
|
+
* You may obtain a copy of the License at
|
|
531
|
+
*
|
|
532
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
533
|
+
*
|
|
534
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
535
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
536
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
537
|
+
* See the License for the specific language governing permissions and
|
|
538
|
+
* limitations under the License.
|
|
539
|
+
*/const Ut=e=>{const t=new Lt(e.getProvider("app").getImmediate(),e.getProvider("installations-internal").getImmediate(),e.getProvider("analytics-internal"));return navigator.serviceWorker.addEventListener("message",n=>Wt(t,n)),t},Gt=e=>{const t=e.getProvider("messaging").getImmediate();return{getToken:o=>Ie(t,o)}};function Jt(){m(new T("messaging",Ut,"PUBLIC")),m(new T("messaging-internal",Gt,"PRIVATE")),y(Y,z),y(Y,z,"esm2017")}/**
|
|
540
|
+
* @license
|
|
541
|
+
* Copyright 2020 Google LLC
|
|
542
|
+
*
|
|
543
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
544
|
+
* you may not use this file except in compliance with the License.
|
|
545
|
+
* You may obtain a copy of the License at
|
|
546
|
+
*
|
|
547
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
548
|
+
*
|
|
549
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
550
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
551
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
552
|
+
* See the License for the specific language governing permissions and
|
|
553
|
+
* limitations under the License.
|
|
554
|
+
*/async function Yt(){try{await Ae()}catch{return!1}return typeof window<"u"&&Ee()&&_e()&&"serviceWorker"in navigator&&"PushManager"in window&&"Notification"in window&&"fetch"in window&&ServiceWorkerRegistration.prototype.hasOwnProperty("showNotification")&&PushSubscription.prototype.hasOwnProperty("getKey")}/**
|
|
555
|
+
* @license
|
|
556
|
+
* Copyright 2020 Google LLC
|
|
557
|
+
*
|
|
558
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
559
|
+
* you may not use this file except in compliance with the License.
|
|
560
|
+
* You may obtain a copy of the License at
|
|
561
|
+
*
|
|
562
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
563
|
+
*
|
|
564
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
565
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
566
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
567
|
+
* See the License for the specific language governing permissions and
|
|
568
|
+
* limitations under the License.
|
|
569
|
+
*/async function zt(e){if(!navigator)throw u.create("only-available-in-window");return e.swRegistration||await ke(e),Dt(e)}/**
|
|
570
|
+
* @license
|
|
571
|
+
* Copyright 2020 Google LLC
|
|
572
|
+
*
|
|
573
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
574
|
+
* you may not use this file except in compliance with the License.
|
|
575
|
+
* You may obtain a copy of the License at
|
|
576
|
+
*
|
|
577
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
578
|
+
*
|
|
579
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
580
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
581
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
582
|
+
* See the License for the specific language governing permissions and
|
|
583
|
+
* limitations under the License.
|
|
584
|
+
*/function Qt(e,t){if(!navigator)throw u.create("only-available-in-window");return e.onMessageHandler=t,()=>{e.onMessageHandler=null}}/**
|
|
585
|
+
* @license
|
|
586
|
+
* Copyright 2017 Google LLC
|
|
587
|
+
*
|
|
588
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
589
|
+
* you may not use this file except in compliance with the License.
|
|
590
|
+
* You may obtain a copy of the License at
|
|
591
|
+
*
|
|
592
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
593
|
+
*
|
|
594
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
595
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
596
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
597
|
+
* See the License for the specific language governing permissions and
|
|
598
|
+
* limitations under the License.
|
|
599
|
+
*/function Zt(e=Se()){return Yt().then(t=>{if(!t)throw u.create("unsupported-browser")},t=>{throw u.create("indexed-db-unsupported")}),M(I(e),"messaging").getImmediate()}async function en(e,t){return e=I(e),Ie(e,t)}function tn(e){return e=I(e),zt(e)}function nn(e,t){return e=I(e),Qt(e,t)}Jt();export{tn as deleteToken,Zt as getMessaging,en as getToken,Yt as isSupported,nn as onMessage};
|