@amplitude/experiment-tag 0.7.6 → 0.8.0
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/LICENSES +246 -0
- package/dist/experiment-tag-min.js +2 -0
- package/dist/experiment-tag-min.js.gz +0 -0
- package/dist/types/src/experiment.d.ts +109 -0
- package/dist/types/src/index.d.ts +3 -0
- package/dist/types/src/message-bus.d.ts +37 -0
- package/dist/types/src/mutation-manager.d.ts +23 -0
- package/dist/types/src/subscriptions.d.ts +34 -0
- package/dist/types/src/types.d.ts +58 -0
- package/dist/types/src/util/inject-utils.d.ts +20 -0
- package/dist/types/src/util/messenger.d.ts +4 -0
- package/dist/types/src/util/url.d.ts +5 -0
- package/dist/types/src/util/uuid.d.ts +1 -0
- package/dist/types/src/util/variant.d.ts +3 -0
- package/package.json +6 -4
package/dist/LICENSES
ADDED
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
Name: tslib
|
|
2
|
+
Version: 2.8.1
|
|
3
|
+
License: 0BSD
|
|
4
|
+
Private: false
|
|
5
|
+
Description: Runtime library for TypeScript helper functions
|
|
6
|
+
Repository: https://github.com/Microsoft/tslib.git
|
|
7
|
+
Homepage: https://www.typescriptlang.org/
|
|
8
|
+
Author: Microsoft Corp.
|
|
9
|
+
License Copyright:
|
|
10
|
+
===
|
|
11
|
+
|
|
12
|
+
Copyright (c) Microsoft Corporation.
|
|
13
|
+
|
|
14
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
15
|
+
purpose with or without fee is hereby granted.
|
|
16
|
+
|
|
17
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
18
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
19
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
20
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
21
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
22
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
23
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
Name: @amplitude/analytics-connector
|
|
28
|
+
Version: 1.6.4
|
|
29
|
+
License: MIT
|
|
30
|
+
Private: false
|
|
31
|
+
Description: Connector package for Amplitude SDKs
|
|
32
|
+
Repository: https://github.com/amplitude/experiment-js-client.git
|
|
33
|
+
Homepage: https://github.com/amplitude/experiment-js-client
|
|
34
|
+
Author: Amplitude
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
Name: @amplitude/experiment-core
|
|
39
|
+
Version: 0.11.0
|
|
40
|
+
License: MIT
|
|
41
|
+
Private: false
|
|
42
|
+
Description: Amplitude Experiment evaluation JavaScript implementation.
|
|
43
|
+
Repository: https://github.com/amplitude/experiment-js-client.git
|
|
44
|
+
Homepage: https://github.com/amplitude/experiment-js-client
|
|
45
|
+
Author: Amplitude
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
Name: @amplitude/ua-parser-js
|
|
50
|
+
Version: 0.7.33
|
|
51
|
+
License: MIT
|
|
52
|
+
Private: false
|
|
53
|
+
Description: Detect Browser, Engine, OS, CPU, and Device type/model from User-Agent data. Supports browser & node.js environment
|
|
54
|
+
Repository: https://github.com/amplitude/ua-parser-js.git
|
|
55
|
+
Homepage: http://github.com/amplitude/ua-parser-js
|
|
56
|
+
Author: Faisal Salman <f@faisalman.com> (http://faisalman.com)
|
|
57
|
+
Contributors:
|
|
58
|
+
Aamir Poonawalla <aamir@urx.com>
|
|
59
|
+
Admas <mollases@users.noreply.github.com>
|
|
60
|
+
algenon <m@antonz.ru>
|
|
61
|
+
Alvin Portillo <alvin@8thwall.com>
|
|
62
|
+
Amumu <yoyo837@hotmail.com>
|
|
63
|
+
Andrea Vaghi <andrea.vaghi@jobrapido.com>
|
|
64
|
+
Anton Zhiyanov <m@antonz.ru>
|
|
65
|
+
Arturo Mejia <amejia@blim.com>
|
|
66
|
+
Arun Rama Reddy <arunramareddy@gmail.com>
|
|
67
|
+
Austin Pray <austin@austinpray.com>
|
|
68
|
+
Bendeguz <symunona@gmail.com>
|
|
69
|
+
Benjamin Bertrand <bertrand.design@gmail.com>
|
|
70
|
+
Benjamin Urban <benjamin.urban@sueddeutsche.de>
|
|
71
|
+
boneyao <admin@boneyao.com>
|
|
72
|
+
Carl C Von Lewin <carlchristianlewin@gmail.com>
|
|
73
|
+
CESAR RAMOS <c@imagenproactiva.com>
|
|
74
|
+
Chad Killingsworth <ckillingsworth@jackhenry.com>
|
|
75
|
+
Christopher De Cairos <chris.decairos@gmail.com>
|
|
76
|
+
Cyrille David <cyrille@qonto.eu>
|
|
77
|
+
Dario Vladovic <d.vladimyr@gmail.com>
|
|
78
|
+
David Annez <david.annez@gmail.com>
|
|
79
|
+
Davit Barbakadze <jayarjo@gmail.com>
|
|
80
|
+
ddivernois <david-emmanuel.divernois@amadeus.com>
|
|
81
|
+
Deliaz <D3liaz@gmail.com>
|
|
82
|
+
Demis Palma <demis.palma@gmail.com>
|
|
83
|
+
dhoko <aurelien@protonmail.com>
|
|
84
|
+
dianhe <dianhe@webank.com>
|
|
85
|
+
dineshks1 <dineshks1@d.kumar44@outlook.com>
|
|
86
|
+
Dmitry Tyschenko <dtyschenko@gmail.com>
|
|
87
|
+
Douglas Li <doug@knotch.it>
|
|
88
|
+
Dumitru Uzun <contact@duzun.me>
|
|
89
|
+
Dustin <duburns@fanatics.com>
|
|
90
|
+
Elchin Valiyev <elchin.valiyev@autodesk.com>
|
|
91
|
+
Emil Hesslow <hesslow@gmail.com>
|
|
92
|
+
Eric Redon <eric.redon@coox.org>
|
|
93
|
+
Eric Schrenker <eric.schrenker@gmail.com>
|
|
94
|
+
Erik Hesselink <hesselink@gmail.com>
|
|
95
|
+
Fabian Becker <halfdan@xnorfz.de>
|
|
96
|
+
Faisal Salman <f@faisalman.com>
|
|
97
|
+
Frédéric Camblor <fcamblor@gmail.com>
|
|
98
|
+
Frederik Ring <frederik.ring@gmail.com>
|
|
99
|
+
Gerald Host <me@jacobford.co.uk>
|
|
100
|
+
Germán M. Bravo <german.mb@gmail.com>
|
|
101
|
+
Grigory Dmitrenko <grigory@snsk.ru>
|
|
102
|
+
gulpin <gulping.gulpin@gmail.com>
|
|
103
|
+
Hendrik Helwich <h.helwich@iplabs.de>
|
|
104
|
+
Hermann Ebert <ebbmo@HE.local>
|
|
105
|
+
hr6r <hedian@gmail.com>
|
|
106
|
+
Igor Topal <i.topal@smartweb.com.ua>
|
|
107
|
+
Ildar Kamalov <i.kamalov@adguard.com>
|
|
108
|
+
insanehong <insane.hong@navercorp.com>
|
|
109
|
+
jackpoll <jackpoll123456@gmail.com>
|
|
110
|
+
Jake Mc <startswithaj@users.noreply.github.com>
|
|
111
|
+
JBYoshi <12983479+JBYoshi@users.noreply.github.com>
|
|
112
|
+
Joey Parrish <joeyparrish@google.com>
|
|
113
|
+
John Tantalo <john.tantalo@gmail.com>
|
|
114
|
+
John Yanarella <jmy@codecatalyst.com>
|
|
115
|
+
Jon Buckley <jon@jbuckley.ca>
|
|
116
|
+
Josh Goldberg <joshuakgoldberg@outlook.com>
|
|
117
|
+
Junki-Ishida <junki_ishida@dwango.co.jp>
|
|
118
|
+
Kendall Buchanan <kendall@kendagriff.com>
|
|
119
|
+
Lee Treveil <leetreveil@gmail.com>
|
|
120
|
+
leonardo <leofiore@libero.it>
|
|
121
|
+
Levente Balogh <balogh.levente.hu@gmail.com>
|
|
122
|
+
Liam Quinn <lquinn@blackberry.com>
|
|
123
|
+
Lithin <lithin@webklipper.com>
|
|
124
|
+
ll-syber <670159357@qq.com>
|
|
125
|
+
Loris Guignard <loris.guignard@gmail.com>
|
|
126
|
+
Lukas Drgon <lukas.drgon@gmail.com>
|
|
127
|
+
Lukas Eipert <leipert@users.noreply.github.com>
|
|
128
|
+
Malash <i@malash.me>
|
|
129
|
+
Martynas <martynas@firmfirm.co>
|
|
130
|
+
Masahiko Sato <masasato@yahoo-corp.jp>
|
|
131
|
+
Matt Brophy <matt@brophy.org>
|
|
132
|
+
Matthew Origer <karatecowboy@gmail.com>
|
|
133
|
+
Maximilian Haupt <mail@maximilianhaupt.com>
|
|
134
|
+
Max Maurer <maxemanuel.maurer@gmail.com>
|
|
135
|
+
Max Nordlund <max.nordlund@gmail.com>
|
|
136
|
+
Michael Hess <mhess@connectify.me>
|
|
137
|
+
MimyyK <michele.marais@hakisa.com>
|
|
138
|
+
naoh <naoh.cs03g@nctu.edu.tw>
|
|
139
|
+
Nicholas Ionata <nionata@ufl.edu>
|
|
140
|
+
Nikhil Motiani <nikhil.motiani@outlook.com>
|
|
141
|
+
Nik Rolls <nik@rolls.cc>
|
|
142
|
+
nionata <n.ionata129@gmail.com>
|
|
143
|
+
niris <nirisix@gmail.com>
|
|
144
|
+
Nobuo Okada <nookada@yahoo-corp.jp>
|
|
145
|
+
o.drapeza <o.drapeza@tinkoff.ru>
|
|
146
|
+
otakuSiD <otakusid@gmail.com>
|
|
147
|
+
patrick-nurt <github@pereira.dk>
|
|
148
|
+
Pavel Studeny <studeny@avast.com>
|
|
149
|
+
Peter Dave Hello <PeterDaveHello@users.noreply.github.com>
|
|
150
|
+
philippsimon <github@philippsimon.de>
|
|
151
|
+
Pieter Hendrickx <pieter.hendrickx@belfius.be>
|
|
152
|
+
Piper Chester <piperchester@gmail.com>
|
|
153
|
+
Queen Vinyl Darkscratch <vinyldarkscratch@gmail.com>
|
|
154
|
+
Raine Makelainen <raine.makelainen@jolla.com>
|
|
155
|
+
Raman Savaryn <homeneartheocean@gmail.com>
|
|
156
|
+
Robert Tod <robert@qubit.com>
|
|
157
|
+
roman.savarin <roman.savarin@skywindgroup.com>
|
|
158
|
+
Ron Korland <ron@testim.io>
|
|
159
|
+
Ross Noble <rosshnoble@gmail.com>
|
|
160
|
+
ruicong <466403866@qq.com>
|
|
161
|
+
Sandro Sonntag <sandro.sonntag@adorsys.de>
|
|
162
|
+
sgautrea <shanegautreau@gmail.com>
|
|
163
|
+
Shane Gautreau <sgautrea@opentext.com>
|
|
164
|
+
Shane Thacker <shane@steadymade.com>
|
|
165
|
+
Shreedhar <shreedhar@uber.com>
|
|
166
|
+
Simon Eisenmann <simon@longsleep.org>
|
|
167
|
+
Simon Lang <me@simonlang.org>
|
|
168
|
+
Stiekel <histkc@gmail.com>
|
|
169
|
+
sUP <dani3l@gmail.com>
|
|
170
|
+
Sylvain Gizard <sylvain.gizard@gmail.com>
|
|
171
|
+
szchenghuang <szchenghuang@gmail.com>
|
|
172
|
+
Tanguy Krotoff <tkrotoff@gmail.com>
|
|
173
|
+
Tony Tomarchio <tony@tomarchio.cc>
|
|
174
|
+
Ulrich Schmidt <u.schmidt@velian.de>
|
|
175
|
+
Vadim Kurachevsky <vadim@hmvs.org>
|
|
176
|
+
Yılmaz <yilmazdemir36@gmail.com>
|
|
177
|
+
yuanyang <work_yuanyang@163.com>
|
|
178
|
+
Yun Young-jin <yupmin@yupmin-office-macmini.local>
|
|
179
|
+
Zach Bjornson <zbbjornson@gmail.com>
|
|
180
|
+
License Copyright:
|
|
181
|
+
===
|
|
182
|
+
|
|
183
|
+
MIT License
|
|
184
|
+
|
|
185
|
+
Copyright (c) 2012-2021 Faisal Salman <<f@faisalman.com>>
|
|
186
|
+
|
|
187
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
188
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
189
|
+
in the Software without restriction, including without limitation the rights
|
|
190
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
191
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
192
|
+
furnished to do so, subject to the following conditions:
|
|
193
|
+
|
|
194
|
+
The above copyright notice and this permission notice shall be included in all
|
|
195
|
+
copies or substantial portions of the Software.
|
|
196
|
+
|
|
197
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
198
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
199
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
200
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
201
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
202
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
203
|
+
SOFTWARE.
|
|
204
|
+
|
|
205
|
+
---
|
|
206
|
+
|
|
207
|
+
Name: @amplitude/experiment-js-client
|
|
208
|
+
Version: 1.16.1
|
|
209
|
+
License: MIT
|
|
210
|
+
Private: false
|
|
211
|
+
Description: Amplitude Experiment Javascript Client SDK
|
|
212
|
+
Repository: https://github.com/amplitude/experiment-js-client.git
|
|
213
|
+
Homepage: https://github.com/amplitude/experiment-js-client
|
|
214
|
+
Author: Amplitude
|
|
215
|
+
|
|
216
|
+
---
|
|
217
|
+
|
|
218
|
+
Name: dom-mutator
|
|
219
|
+
Version: 0.7.1
|
|
220
|
+
License: MIT
|
|
221
|
+
Private: false
|
|
222
|
+
Author: Jeremy Dorn
|
|
223
|
+
License Copyright:
|
|
224
|
+
===
|
|
225
|
+
|
|
226
|
+
MIT License
|
|
227
|
+
|
|
228
|
+
Copyright (c) 2021 Jeremy Dorn
|
|
229
|
+
|
|
230
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
231
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
232
|
+
in the Software without restriction, including without limitation the rights
|
|
233
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
234
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
235
|
+
furnished to do so, subject to the following conditions:
|
|
236
|
+
|
|
237
|
+
The above copyright notice and this permission notice shall be included in all
|
|
238
|
+
copies or substantial portions of the Software.
|
|
239
|
+
|
|
240
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
241
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
242
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
243
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
244
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
245
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
246
|
+
SOFTWARE.
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* @amplitude/experiment-tag v0.8.0 - For license info see https://unpkg.com/@amplitude/experiment-tag@0.8.0/files/LICENSE */
|
|
2
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).WebExperiment={})}(this,(function(e){"use strict";var t=function(){return t=Object.assign||function(e){for(var t,r=1,i=arguments.length;r<i;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},t.apply(this,arguments)};function r(e,t,r,i){return new(r||(r=Promise))((function(n,o){function a(e){try{l(i.next(e))}catch(e){o(e)}}function s(e){try{l(i.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}l((i=i.apply(e,t||[])).next())}))}function i(e,t){var r,i,n,o={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(l){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(r=1,i&&(n=2&s[0]?i.return:s[0]?i.throw||((n=i.return)&&n.call(i),0):i.next)&&!(n=n.call(i,s[1])).done)return n;switch(i=0,n&&(s=[2&s[0],n.value]),s[0]){case 0:case 1:n=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,i=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!(n=o.trys,(n=n.length>0&&n[n.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!n||s[1]>n[0]&&s[1]<n[3])){o.label=s[1];break}if(6===s[0]&&o.label<n[1]){o.label=n[1],n=s;break}if(n&&o.label<n[2]){o.label=n[2],o.ops.push(s);break}n[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],i=0}finally{r=n=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}function n(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],i=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function o(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var i,n,o=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(i=o.next()).done;)a.push(i.value)}catch(e){n={error:e}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return a}function a(e,t,r){if(r||2===arguments.length)for(var i,n=0,o=t.length;n<o;n++)!i&&n in t||(i||(i=Array.prototype.slice.call(t,0,n)),i[n]=t[n]);return e.concat(i||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError;var s=function(){function e(){}return e.prototype.getApplicationContext=function(){return{versionName:this.versionName,language:l(),platform:"Web",os:void 0,deviceModel:void 0}},e}(),l=function(){return"undefined"!=typeof navigator&&(navigator.languages&&navigator.languages[0]||navigator.language)||""},u=function(){function e(){this.queue=[]}return e.prototype.logEvent=function(e){this.receiver?this.receiver(e):this.queue.length<512&&this.queue.push(e)},e.prototype.setEventReceiver=function(e){this.receiver=e,this.queue.length>0&&(this.queue.forEach((function(t){e(t)})),this.queue=[])},e}(),c=function(){return c=Object.assign||function(e){for(var t,r=1,i=arguments.length;r<i;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},c.apply(this,arguments)};function d(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],i=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function h(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var i,n,o=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(i=o.next()).done;)a.push(i.value)}catch(e){n={error:e}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return a}"function"==typeof SuppressedError&&SuppressedError;var f=function(e,t){var r,i,n=typeof e;if(n!==typeof t)return!1;try{for(var o=d(["string","number","boolean","undefined"]),a=o.next();!a.done;a=o.next()){if(a.value===n)return e===t}}catch(e){r={error:e}}finally{try{a&&!a.done&&(i=o.return)&&i.call(o)}finally{if(r)throw r.error}}if(null==e&&null==t)return!0;if(null==e||null==t)return!1;if(e.length!==t.length)return!1;var s=Array.isArray(e),l=Array.isArray(t);if(s!==l)return!1;if(!s||!l){var u=Object.keys(e).sort(),c=Object.keys(t).sort();if(!f(u,c))return!1;var h=!0;return Object.keys(e).forEach((function(r){f(e[r],t[r])||(h=!1)})),h}for(var p=0;p<e.length;p++)if(!f(e[p],t[p]))return!1;return!0};Object.entries||(Object.entries=function(e){for(var t=Object.keys(e),r=t.length,i=new Array(r);r--;)i[r]=[t[r],e[t[r]]];return i});var p=function(){function e(){this.identity={userProperties:{}},this.listeners=new Set}return e.prototype.editIdentity=function(){var e=this,t=c({},this.identity.userProperties),r=c(c({},this.identity),{userProperties:t});return{setUserId:function(e){return r.userId=e,this},setDeviceId:function(e){return r.deviceId=e,this},setUserProperties:function(e){return r.userProperties=e,this},setOptOut:function(e){return r.optOut=e,this},updateUserProperties:function(e){var t,i,n,o,a,s,l=r.userProperties||{};try{for(var u=d(Object.entries(e)),c=u.next();!c.done;c=u.next()){var f=h(c.value,2),p=f[0],v=f[1];switch(p){case"$set":try{for(var y=(n=void 0,d(Object.entries(v))),g=y.next();!g.done;g=y.next()){var b=h(g.value,2),m=b[0],w=b[1];l[m]=w}}catch(e){n={error:e}}finally{try{g&&!g.done&&(o=y.return)&&o.call(y)}finally{if(n)throw n.error}}break;case"$unset":try{for(var S=(a=void 0,d(Object.keys(v))),x=S.next();!x.done;x=S.next()){delete l[m=x.value]}}catch(e){a={error:e}}finally{try{x&&!x.done&&(s=S.return)&&s.call(S)}finally{if(a)throw a.error}}break;case"$clearAll":l={}}}}catch(e){t={error:e}}finally{try{c&&!c.done&&(i=u.return)&&i.call(u)}finally{if(t)throw t.error}}return r.userProperties=l,this},commit:function(){return e.setIdentity(r),this}}},e.prototype.getIdentity=function(){return c({},this.identity)},e.prototype.setIdentity=function(e){var t=c({},this.identity);this.identity=c({},e),f(t,this.identity)||this.listeners.forEach((function(t){t(e)}))},e.prototype.addIdentityListener=function(e){this.listeners.add(e)},e.prototype.removeIdentityListener=function(e){this.listeners.delete(e)},e}(),v="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:self,y=function(){function e(){this.identityStore=new p,this.eventBridge=new u,this.applicationContextProvider=new s}return e.getInstance=function(t){return v.analyticsConnectorInstances||(v.analyticsConnectorInstances={}),v.analyticsConnectorInstances[t]||(v.analyticsConnectorInstances[t]=new e),v.analyticsConnectorInstances[t]},e}(),g=function(e,t){return g=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},g(e,t)};function b(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}g(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var m=function(){return m=Object.assign||function(e){for(var t,r=1,i=arguments.length;r<i;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},m.apply(this,arguments)};function w(e,t,r,i){return new(r||(r=Promise))((function(n,o){function a(e){try{l(i.next(e))}catch(e){o(e)}}function s(e){try{l(i.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}l((i=i.apply(e,t||[])).next())}))}function S(e,t){var r,i,n,o={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(l){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(r=1,i&&(n=2&s[0]?i.return:s[0]?i.throw||((n=i.return)&&n.call(i),0):i.next)&&!(n=n.call(i,s[1])).done)return n;switch(i=0,n&&(s=[2&s[0],n.value]),s[0]){case 0:case 1:n=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,i=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!(n=o.trys,(n=n.length>0&&n[n.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!n||s[1]>n[0]&&s[1]<n[3])){o.label=s[1];break}if(6===s[0]&&o.label<n[1]){o.label=n[1],n=s;break}if(n&&o.label<n[2]){o.label=n[2],o.ops.push(s);break}n[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],i=0}finally{r=n=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}function x(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],i=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function k(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var i,n,o=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(i=o.next()).done;)a.push(i.value)}catch(e){n={error:e}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return a}function E(e,t,r){if(r||2===arguments.length)for(var i,n=0,o=t.length;n<o;n++)!i&&n in t||(i||(i=Array.prototype.slice.call(t,0,n)),i[n]=t[n]);return e.concat(i||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError;var P="is",O="is not",A="contains",I="does not contain",M="less",C="less or equal",_="greater",j="greater or equal",T="version less",V="version less or equal",N="version greater",U="version greater or equal",R="set is",F="set is not",L="set contains",D="set does not contain",K="set contains any",B="set does not contain any",q="regex match",z="regex does not match",W=-862048943,J=461845907,$=function(e,t){void 0===t&&(t=0);for(var r=function(e){for(var t=[],r=0,i=0;i<e.length;i++){var n=e.charCodeAt(i);n<128?t[r++]=n:n<2048?(t[r++]=n>>6|192,t[r++]=63&n|128):55296==(64512&n)&&i+1<e.length&&56320==(64512&e.charCodeAt(i+1))?(n=65536+((1023&n)<<10)+(1023&e.charCodeAt(++i)),t[r++]=n>>18|240,t[r++]=n>>12&63|128,t[r++]=n>>6&63|128,t[r++]=63&n|128):(t[r++]=n>>12|224,t[r++]=n>>6&63|128,t[r++]=63&n|128)}return Uint8Array.from(t)}(e),i=r.length,n=i>>2,o=t,a=0;a<n;a++){var s=X(r,a<<2);o=H(s,o)}var l=n<<2,u=0;switch(i-l){case 3:u^=r[l+2]<<16,u^=r[l+1]<<8,u^=r[l],u=Math.imul(u,W),u=Q(u,15),o^=u=Math.imul(u,J);break;case 2:u^=r[l+1]<<8,u^=r[l],u=Math.imul(u,W),u=Q(u,15),o^=u=Math.imul(u,J);break;case 1:u^=r[l],u=Math.imul(u,W),u=Q(u,15),o^=u=Math.imul(u,J)}return G(o^=i)>>>0},H=function(e,t){var r=e,i=t;return r=Math.imul(r,W),r=Q(r,15),r=Math.imul(r,J),i=Q(i^=r,13),(i=Math.imul(i,5))+-430675100|0},G=function(e){var t=e;return t^=t>>>16,t=Math.imul(t,-2048144789),t^=t>>>13,t=Math.imul(t,-1028477387),t^=t>>>16},Q=function(e,t,r){return void 0===r&&(r=32),t>r&&(t%=r),(e<<t|(e&4294967295<<r-t>>>0)>>>0>>>r-t>>>0)>>>0},X=function(e,t){void 0===t&&(t=0);var r=e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3];return Z(r)},Z=function(e){return(-16777216&e)>>>24|(16711680&e)>>>8|(65280&e)<<8|(255&e)<<24},Y=function(e,t){var r,i;if(t&&0!==t.length){try{for(var n=x(t),o=n.next();!o.done;o=n.next()){var a=o.value;if(!a||!e||"object"!=typeof e)return;e=e[a]}}catch(e){r={error:e}}finally{try{o&&!o.done&&(i=n.return)&&i.call(n)}finally{if(r)throw r.error}}return e||void 0}},ee="^".concat("(\\d+)\\.(\\d+)","(\\.").concat("(\\d+)").concat("(-(([-\\w]+\\.?)*))?",")?$"),te=function(){function e(e,t,r,i){void 0===i&&(i=void 0),this.major=e,this.minor=t,this.patch=r,this.preRelease=i}return e.parse=function(t){if(t){var r=new RegExp(ee).exec(t);if(r){var i=Number(r[1]),n=Number(r[2]);if(!isNaN(i)&&!isNaN(n))return new e(i,n,Number(r[4])||0,r[5]||void 0)}}},e.prototype.compareTo=function(e){return this.major>e.major?1:this.major<e.major?-1:this.minor>e.minor?1:this.minor<e.minor?-1:this.patch>e.patch?1:this.patch<e.patch||this.preRelease&&!e.preRelease?-1:!this.preRelease&&e.preRelease?1:this.preRelease&&e.preRelease?this.preRelease>e.preRelease?1:this.preRelease<e.preRelease?-1:0:0},e}(),re=function(){function e(){}return e.prototype.evaluate=function(e,t){var r,i,n={},o={context:e,result:n};try{for(var a=x(t),s=a.next();!s.done;s=a.next()){var l=s.value,u=this.evaluateFlag(o,l);u&&(n[l.key]=u)}}catch(e){r={error:e}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}return n},e.prototype.evaluateFlag=function(e,t){var r,i,n;try{for(var o=x(t.segments),a=o.next();!a.done;a=o.next()){var s=a.value;if(n=this.evaluateSegment(e,t,s)){var l=m(m(m({},t.metadata),s.metadata),n.metadata);n=m(m({},n),{metadata:l});break}}}catch(e){r={error:e}}finally{try{a&&!a.done&&(i=o.return)&&i.call(o)}finally{if(r)throw r.error}}return n},e.prototype.evaluateSegment=function(e,t,r){var i;return r.conditions?this.evaluateConditions(e,r.conditions)&&void 0!==(i=this.bucket(e,r))?t.variants[i]:void 0:void 0!==(i=this.bucket(e,r))?t.variants[i]:void 0},e.prototype.evaluateConditions=function(e,t){var r,i,n,o;try{for(var a=x(t),s=a.next();!s.done;s=a.next()){var l=s.value,u=!0;try{for(var c=(n=void 0,x(l)),d=c.next();!d.done;d=c.next()){var h=d.value;if(!(u=this.matchCondition(e,h)))break}}catch(e){n={error:e}}finally{try{d&&!d.done&&(o=c.return)&&o.call(c)}finally{if(n)throw n.error}}if(u)return!0}}catch(e){r={error:e}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}return!1},e.prototype.matchCondition=function(e,t){var r=Y(e,t.selector);if(r){if(this.isSetOperator(t.op)){var i=this.coerceStringArray(r);return!!i&&this.matchSet(i,t.op,t.values)}var n=this.coerceString(r);return void 0!==n&&this.matchString(n,t.op,t.values)}return this.matchNull(t.op,t.values)},e.prototype.getHash=function(e){return $(e)},e.prototype.bucket=function(e,t){var r,i,n,o;if(!t.bucket)return t.variant;var a=this.coerceString(Y(e,t.bucket.selector));if(!a||0===a.length)return t.variant;var s="".concat(t.bucket.salt,"/").concat(a),l=this.getHash(s),u=l%100,c=Math.floor(l/100);try{for(var d=x(t.bucket.allocations),h=d.next();!h.done;h=d.next()){var f=h.value,p=f.range[0],v=f.range[1];if(u>=p&&u<v)try{for(var y=(n=void 0,x(f.distributions)),g=y.next();!g.done;g=y.next()){var b=g.value,m=b.range[0],w=b.range[1];if(c>=m&&c<w)return b.variant}}catch(e){n={error:e}}finally{try{g&&!g.done&&(o=y.return)&&o.call(y)}finally{if(n)throw n.error}}}}catch(e){r={error:e}}finally{try{h&&!h.done&&(i=d.return)&&i.call(d)}finally{if(r)throw r.error}}return t.variant},e.prototype.matchNull=function(e,t){var r=this.containsNone(t);switch(e){case P:case A:case M:case C:case _:case j:case T:case V:case N:case U:case R:case L:case K:return r;case O:case I:case D:case B:return!r;default:return!1}},e.prototype.matchSet=function(e,t,r){switch(t){case R:return this.setEquals(e,r);case F:return!this.setEquals(e,r);case L:return this.matchesSetContainsAll(e,r);case D:return!this.matchesSetContainsAll(e,r);case K:return this.matchesSetContainsAny(e,r);case B:return!this.matchesSetContainsAny(e,r);default:return!1}},e.prototype.matchString=function(e,t,r){var i=this;switch(t){case P:return this.matchesIs(e,r);case O:return!this.matchesIs(e,r);case A:return this.matchesContains(e,r);case I:return!this.matchesContains(e,r);case M:case C:case _:case j:return this.matchesComparable(e,t,r,(function(e){return i.parseNumber(e)}),this.comparator);case T:case V:case N:case U:return this.matchesComparable(e,t,r,(function(e){return te.parse(e)}),this.versionComparator);case q:return this.matchesRegex(e,r);case z:return!this.matchesRegex(e,r);default:return!1}},e.prototype.matchesIs=function(e,t){if(this.containsBooleans(t)){var r=e.toLowerCase();if("true"===r||"false"===r)return t.some((function(e){return e.toLowerCase()===r}))}return t.some((function(t){return e===t}))},e.prototype.matchesContains=function(e,t){var r,i;try{for(var n=x(t),o=n.next();!o.done;o=n.next()){var a=o.value;if(e.toLowerCase().includes(a.toLowerCase()))return!0}}catch(e){r={error:e}}finally{try{o&&!o.done&&(i=n.return)&&i.call(n)}finally{if(r)throw r.error}}return!1},e.prototype.matchesComparable=function(e,t,r,i,n){var o=this,a=i(e),s=r.map((function(e){return i(e)})).filter((function(e){return void 0!==e}));return void 0===a||0===s.length?r.some((function(r){return o.comparator(e,t,r)})):s.some((function(e){return n(a,t,e)}))},e.prototype.comparator=function(e,t,r){switch(t){case M:case T:return e<r;case C:case V:return e<=r;case _:case N:return e>r;case j:case U:return e>=r;default:return!1}},e.prototype.versionComparator=function(e,t,r){var i=e.compareTo(r);switch(t){case M:case T:return i<0;case C:case V:return i<=0;case _:case N:return i>0;case j:case U:return i>=0;default:return!1}},e.prototype.matchesRegex=function(e,t){return t.some((function(t){return Boolean(new RegExp(t).exec(e))}))},e.prototype.containsNone=function(e){return e.some((function(e){return"(none)"===e}))},e.prototype.containsBooleans=function(e){return e.some((function(e){switch(e.toLowerCase()){case"true":case"false":return!0;default:return!1}}))},e.prototype.parseNumber=function(e){var t;return null!==(t=Number(e))&&void 0!==t?t:void 0},e.prototype.coerceString=function(e){if(null!=e)return"object"==typeof e?JSON.stringify(e):String(e)},e.prototype.coerceStringArray=function(e){var t=this;if(Array.isArray(e))return e.map((function(e){return t.coerceString(e)})).filter(Boolean);var r=String(e);try{var i=JSON.parse(r);return Array.isArray(i)?e.map((function(e){return t.coerceString(e)})).filter(Boolean):(n=this.coerceString(r))?[n]:void 0}catch(e){var n;return(n=this.coerceString(r))?[n]:void 0}},e.prototype.isSetOperator=function(e){switch(e){case R:case F:case L:case D:case K:case B:return!0;default:return!1}},e.prototype.setEquals=function(e,t){var r=new Set(e),i=new Set(t);return r.size===i.size&&E([],k(i),!1).every((function(e){return r.has(e)}))},e.prototype.matchesSetContainsAll=function(e,t){var r,i;if(e.length<t.length)return!1;try{for(var n=x(t),o=n.next();!o.done;o=n.next()){var a=o.value;if(!this.matchesIs(a,e))return!1}}catch(e){r={error:e}}finally{try{o&&!o.done&&(i=n.return)&&i.call(n)}finally{if(r)throw r.error}}return!0},e.prototype.matchesSetContainsAny=function(e,t){var r,i;try{for(var n=x(t),o=n.next();!o.done;o=n.next()){var a=o.value;if(this.matchesIs(a,e))return!0}}catch(e){r={error:e}}finally{try{o&&!o.done&&(i=n.return)&&i.call(n)}finally{if(r)throw r.error}}return!1},e}(),ie=function(e,t,r){var i,n;void 0===r&&(r=[]);var o=t[e];if(o){if(!o.dependencies||0===o.dependencies.length)return delete t[o.key],[o];r.push(o.key);var a=[],s=function(e){if(r.some((function(t){return t===e})))throw Error("Detected a cycle between flags ".concat(r));var i=ie(e,t,r);i&&a.push.apply(a,E([],k(i),!1))};try{for(var l=x(o.dependencies),u=l.next();!u.done;u=l.next()){s(u.value)}}catch(e){i={error:e}}finally{try{u&&!u.done&&(n=l.return)&&n.call(l)}finally{if(i)throw i.error}}return a.push(o),r.pop(),delete t[o.key],a}};const ne="function"==typeof Buffer,oe=("function"==typeof TextDecoder&&new TextDecoder,"function"==typeof TextEncoder?new TextEncoder:void 0),ae=Array.prototype.slice.call("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="),se=(e=>{let t={};return e.forEach(((e,r)=>t[e]=r)),t})(ae),le=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,ue=String.fromCharCode.bind(String),ce=("function"==typeof Uint8Array.from&&Uint8Array.from.bind(Uint8Array),e=>e.replace(/=/g,"").replace(/[+\/]/g,(e=>"+"==e?"-":"_"))),de=e=>e.replace(/[^A-Za-z0-9\+\/]/g,""),he=e=>{let t,r,i,n,o="";const a=e.length%3;for(let a=0;a<e.length;){if((r=e.charCodeAt(a++))>255||(i=e.charCodeAt(a++))>255||(n=e.charCodeAt(a++))>255)throw new TypeError("invalid character found");t=r<<16|i<<8|n,o+=ae[t>>18&63]+ae[t>>12&63]+ae[t>>6&63]+ae[63&t]}return a?o.slice(0,a-3)+"===".substring(a):o},fe="function"==typeof btoa?e=>btoa(e):ne?e=>Buffer.from(e,"binary").toString("base64"):he,pe=ne?e=>Buffer.from(e).toString("base64"):e=>{let t=[];for(let r=0,i=e.length;r<i;r+=4096)t.push(ue.apply(null,e.subarray(r,r+4096)));return fe(t.join(""))},ve=e=>{if(e.length<2)return(t=e.charCodeAt(0))<128?e:t<2048?ue(192|t>>>6)+ue(128|63&t):ue(224|t>>>12&15)+ue(128|t>>>6&63)+ue(128|63&t);var t=65536+1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320);return ue(240|t>>>18&7)+ue(128|t>>>12&63)+ue(128|t>>>6&63)+ue(128|63&t)},ye=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,ge=e=>e.replace(ye,ve),be=ne?e=>Buffer.from(e,"utf8").toString("base64"):oe?e=>pe(oe.encode(e)):e=>fe(ge(e)),me=(e,t=!1)=>t?ce(be(e)):be(e),we=e=>me(e,!0),Se=e=>{if(e=e.replace(/\s+/g,""),!le.test(e))throw new TypeError("malformed base64.");e+="==".slice(2-(3&e.length));let t,r,i,n="";for(let o=0;o<e.length;)t=se[e.charAt(o++)]<<18|se[e.charAt(o++)]<<12|(r=se[e.charAt(o++)])<<6|(i=se[e.charAt(o++)]),n+=64===r?ue(t>>16&255):64===i?ue(t>>16&255,t>>8&255):ue(t>>16&255,t>>8&255,255&t);return n},xe=we;var ke=function(e){function t(r,i){var n=e.call(this,i)||this;return n.statusCode=r,Object.setPrototypeOf(n,t.prototype),n}return b(t,e),t}(Error),Ee=function(e){function t(r){var i=e.call(this,r)||this;return Object.setPrototypeOf(i,t.prototype),i}return b(t,e),t}(Error),Pe=function(){function e(e,t,r){this.deploymentKey=e,this.serverUrl=t,this.httpClient=r}return e.prototype.getVariants=function(e,t){return w(this,void 0,void 0,(function(){var r,i,n,o;return S(this,(function(a){switch(a.label){case 0:return r=xe(JSON.stringify(e)),i={Authorization:"Api-Key ".concat(this.deploymentKey),"X-Amp-Exp-User":r},(null==t?void 0:t.flagKeys)&&(i["X-Amp-Exp-Flag-Keys"]=xe(JSON.stringify(t.flagKeys))),(null==t?void 0:t.trackingOption)&&(i["X-Amp-Exp-Track"]=t.trackingOption),n=new URL("".concat(this.serverUrl,"/sdk/v2/vardata?v=0")),(null==t?void 0:t.evaluationMode)&&n.searchParams.append("eval_mode",null==t?void 0:t.evaluationMode),(null==t?void 0:t.deliveryMethod)&&n.searchParams.append("delivery_method",null==t?void 0:t.deliveryMethod),[4,this.httpClient.request({requestUrl:n.toString(),method:"GET",headers:i,timeoutMillis:null==t?void 0:t.timeoutMillis})];case 1:if(200!=(o=a.sent()).status)throw new ke(o.status,"Fetch error response: status=".concat(o.status));return[2,JSON.parse(o.body)]}}))}))},e}(),Oe=function(){function e(e,t,r){this.deploymentKey=e,this.serverUrl=t,this.httpClient=r}return e.prototype.getFlags=function(e){return w(this,void 0,void 0,(function(){var t,r;return S(this,(function(i){switch(i.label){case 0:return t={Authorization:"Api-Key ".concat(this.deploymentKey)},(null==e?void 0:e.libraryName)&&(null==e?void 0:e.libraryVersion)&&(t["X-Amp-Exp-Library"]="".concat(e.libraryName,"/").concat(e.libraryVersion)),(null==e?void 0:e.user)&&(t["X-Amp-Exp-User"]=xe(JSON.stringify(e.user))),[4,this.httpClient.request({requestUrl:"".concat(this.serverUrl,"/sdk/v2/flags")+((null==e?void 0:e.deliveryMethod)?"?delivery_method=".concat(e.deliveryMethod):""),method:"GET",headers:t,timeoutMillis:null==e?void 0:e.timeoutMillis})];case 1:if(200!=(r=i.sent()).status)throw Error("Flags error response: status=".concat(r.status));return[2,JSON.parse(r.body).reduce((function(e,t){return e[t.key]=t,e}),{})]}}))}))},e}(),Ae="undefined"!=typeof globalThis?globalThis:global||self,Ie=function(){return"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof self?self:"undefined"!=typeof global?global:void 0},Me=function(){var e=Ie();if(e)try{var t="EXP_test";return e.localStorage.setItem(t,t),e.localStorage.removeItem(t),!0}catch(e){return!1}return!1},Ce=function(){function e(e,t){this.poller=void 0,this.action=e,this.ms=t}return e.prototype.start=function(){this.poller||(this.poller=Ae.setInterval(this.action,this.ms),this.action())},e.prototype.stop=function(){this.poller&&(Ae.clearInterval(this.poller),this.poller=void 0)},e}(),_e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};var je=function(e,t,r){return e(r={path:t,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==t&&r.path)}},r.exports),r.exports}((function(e,t){!function(r,i){var n="function",o="undefined",a="object",s="string",l="model",u="name",c="type",d="vendor",h="version",f="architecture",p="console",v="mobile",y="tablet",g="smarttv",b="wearable",m="embedded",w="Amazon",S="Apple",x="ASUS",k="BlackBerry",E="Browser",P="Chrome",O="Firefox",A="Google",I="Huawei",M="LG",C="Microsoft",_="Motorola",j="Opera",T="Samsung",V="Sharp",N="Sony",U="Xiaomi",R="Zebra",F="Facebook",L=function(e){for(var t={},r=0;r<e.length;r++)t[e[r].toUpperCase()]=e[r];return t},D=function(e,t){return typeof e===s&&-1!==K(t).indexOf(K(e))},K=function(e){return e.toLowerCase()},B=function(e,t){if(typeof e===s)return e=e.replace(/^\s\s*/,""),typeof t===o?e:e.substring(0,350)},q=function(e,t){for(var r,o,s,l,u,c,d=0;d<t.length&&!u;){var h=t[d],f=t[d+1];for(r=o=0;r<h.length&&!u;)if(u=h[r++].exec(e))for(s=0;s<f.length;s++)c=u[++o],typeof(l=f[s])===a&&l.length>0?2===l.length?typeof l[1]==n?this[l[0]]=l[1].call(this,c):this[l[0]]=l[1]:3===l.length?typeof l[1]!==n||l[1].exec&&l[1].test?this[l[0]]=c?c.replace(l[1],l[2]):i:this[l[0]]=c?l[1].call(this,c,l[2]):i:4===l.length&&(this[l[0]]=c?l[3].call(this,c.replace(l[1],l[2])):i):this[l]=c||i;d+=2}},z=function(e,t){for(var r in t)if(typeof t[r]===a&&t[r].length>0){for(var n=0;n<t[r].length;n++)if(D(t[r][n],e))return"?"===r?i:r}else if(D(t[r],e))return"?"===r?i:r;return e},W={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},J={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[h,[u,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[h,[u,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[u,h],[/opios[\/ ]+([\w\.]+)/i],[h,[u,j+" Mini"]],[/\bopr\/([\w\.]+)/i],[h,[u,j]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant |iemobile|slim)(?:browser)?[\/ ]?([\w\.]*)/i,/(ba?idubrowser)[\/ ]?([\w\.]+)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale|qqbrowserlite|qq|duckduckgo)\/([-\w\.]+)/i,/(weibo)__([\d\.]+)/i],[u,h],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[h,[u,"UC"+E]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i],[h,[u,"WeChat(Win) Desktop"]],[/micromessenger\/([\w\.]+)/i],[h,[u,"WeChat"]],[/konqueror\/([\w\.]+)/i],[h,[u,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[h,[u,"IE"]],[/yabrowser\/([\w\.]+)/i],[h,[u,"Yandex"]],[/(avast|avg)\/([\w\.]+)/i],[[u,/(.+)/,"$1 Secure "+E],h],[/\bfocus\/([\w\.]+)/i],[h,[u,O+" Focus"]],[/\bopt\/([\w\.]+)/i],[h,[u,j+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[h,[u,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[h,[u,"Dolphin"]],[/coast\/([\w\.]+)/i],[h,[u,j+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[h,[u,"MIUI "+E]],[/fxios\/([-\w\.]+)/i],[h,[u,O]],[/\bqihu|(qi?ho?o?|360)browser/i],[[u,"360 "+E]],[/(oculus|samsung|sailfish|huawei)browser\/([\w\.]+)/i],[[u,/(.+)/,"$1 "+E],h],[/(comodo_dragon)\/([\w\.]+)/i],[[u,/_/g," "],h],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i],[u,h],[/(metasr)[\/ ]?([\w\.]+)/i,/(lbbrowser)/i,/\[(linkedin)app\]/i],[u],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[u,F],h],[/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(chromium|instagram)[\/ ]([-\w\.]+)/i],[u,h],[/\bgsa\/([\w\.]+) .*safari\//i],[h,[u,"GSA"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[h,[u,P+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[u,P+" WebView"],h],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[h,[u,"Android "+E]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[u,h],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[h,[u,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[h,u],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[u,[h,z,{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}]],[/(webkit|khtml)\/([\w\.]+)/i],[u,h],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[u,"Netscape"],h],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[h,[u,O+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i],[u,h],[/(cobalt)\/([\w\.]+)/i],[u,[h,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[f,"amd64"]],[/(ia32(?=;))/i],[[f,K]],[/((?:i[346]|x)86)[;\)]/i],[[f,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[f,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[f,"armhf"]],[/windows (ce|mobile); ppc;/i],[[f,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[f,/ower/,"",K]],[/(sun4\w)[;\)]/i],[[f,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[f,K]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[l,[d,T],[c,y]],[/\b((?:s[cgp]h|gt|sm)-\w+|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[l,[d,T],[c,v]],[/((ipod|iphone)\d+,\d+)/i],[l,[d,S],[c,v]],[/(ipad\d+,\d+)/i],[l,[d,S],[c,y]],[/\((ip(?:hone|od)[\w ]*);/i],[l,[d,S],[c,v]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[l,[d,S],[c,y]],[/(macintosh);/i],[l,[d,S]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[l,[d,I],[c,y]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[l,[d,I],[c,v]],[/\b(poco[\w ]+)(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[l,/_/g," "],[d,U],[c,v]],[/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[l,/_/g," "],[d,U],[c,y]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[l,[d,"OPPO"],[c,v]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[l,[d,"Vivo"],[c,v]],[/\b(rmx[12]\d{3})(?: bui|;|\))/i],[l,[d,"Realme"],[c,v]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[l,[d,_],[c,v]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[l,[d,_],[c,y]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[l,[d,M],[c,y]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[l,[d,M],[c,v]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[l,[d,"Lenovo"],[c,y]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[l,/_/g," "],[d,"Nokia"],[c,v]],[/(pixel c)\b/i],[l,[d,A],[c,y]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[l,[d,A],[c,v]],[/droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[l,[d,N],[c,v]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[l,"Xperia Tablet"],[d,N],[c,y]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[l,[d,"OnePlus"],[c,v]],[/(alexa)webm/i,/(kf[a-z]{2}wi)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[l,[d,w],[c,y]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[l,/(.+)/g,"Fire Phone $1"],[d,w],[c,v]],[/(playbook);[-\w\),; ]+(rim)/i],[l,d,[c,y]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[l,[d,k],[c,v]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[l,[d,x],[c,y]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[l,[d,x],[c,v]],[/(nexus 9)/i],[l,[d,"HTC"],[c,y]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic|sony(?!-bra))[-_ ]?([-\w]*)/i],[d,[l,/_/g," "],[c,v]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[l,[d,"Acer"],[c,y]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[l,[d,"Meizu"],[c,v]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[l,[d,V],[c,v]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[d,l,[c,v]],[/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[d,l,[c,y]],[/(surface duo)/i],[l,[d,C],[c,y]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[l,[d,"Fairphone"],[c,v]],[/(u304aa)/i],[l,[d,"AT&T"],[c,v]],[/\bsie-(\w*)/i],[l,[d,"Siemens"],[c,v]],[/\b(rct\w+) b/i],[l,[d,"RCA"],[c,y]],[/\b(venue[\d ]{2,7}) b/i],[l,[d,"Dell"],[c,y]],[/\b(q(?:mv|ta)\w+) b/i],[l,[d,"Verizon"],[c,y]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[l,[d,"Barnes & Noble"],[c,y]],[/\b(tm\d{3}\w+) b/i],[l,[d,"NuVision"],[c,y]],[/\b(k88) b/i],[l,[d,"ZTE"],[c,y]],[/\b(nx\d{3}j) b/i],[l,[d,"ZTE"],[c,v]],[/\b(gen\d{3}) b.+49h/i],[l,[d,"Swiss"],[c,v]],[/\b(zur\d{3}) b/i],[l,[d,"Swiss"],[c,y]],[/\b((zeki)?tb.*\b) b/i],[l,[d,"Zeki"],[c,y]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[d,"Dragon Touch"],l,[c,y]],[/\b(ns-?\w{0,9}) b/i],[l,[d,"Insignia"],[c,y]],[/\b((nxa|next)-?\w{0,9}) b/i],[l,[d,"NextBook"],[c,y]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[d,"Voice"],l,[c,v]],[/\b(lvtel\-)?(v1[12]) b/i],[[d,"LvTel"],l,[c,v]],[/\b(ph-1) /i],[l,[d,"Essential"],[c,v]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[l,[d,"Envizen"],[c,y]],[/\b(trio[-\w\. ]+) b/i],[l,[d,"MachSpeed"],[c,y]],[/\btu_(1491) b/i],[l,[d,"Rotor"],[c,y]],[/(shield[\w ]+) b/i],[l,[d,"Nvidia"],[c,y]],[/(sprint) (\w+)/i],[d,l,[c,v]],[/(kin\.[onetw]{3})/i],[[l,/\./g," "],[d,C],[c,v]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[l,[d,R],[c,y]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[l,[d,R],[c,v]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[d,l,[c,p]],[/droid.+; (shield) bui/i],[l,[d,"Nvidia"],[c,p]],[/(playstation [345portablevi]+)/i],[l,[d,N],[c,p]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[l,[d,C],[c,p]],[/smart-tv.+(samsung)/i],[d,[c,g]],[/hbbtv.+maple;(\d+)/i],[[l,/^/,"SmartTV"],[d,T],[c,g]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[d,M],[c,g]],[/(apple) ?tv/i],[d,[l,S+" TV"],[c,g]],[/crkey/i],[[l,P+"cast"],[d,A],[c,g]],[/droid.+aft(\w)( bui|\))/i],[l,[d,w],[c,g]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[l,[d,V],[c,g]],[/(bravia[\w ]+)( bui|\))/i],[l,[d,N],[c,g]],[/(mitv-\w{5}) bui/i],[l,[d,U],[c,g]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w ]*; *(\w[^;]*);([^;]*)/i],[[d,B],[l,B],[c,g]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[c,g]],[/((pebble))app/i],[d,l,[c,b]],[/droid.+; (glass) \d/i],[l,[d,A],[c,b]],[/droid.+; (wt63?0{2,3})\)/i],[l,[d,R],[c,b]],[/(quest( 2)?)/i],[l,[d,F],[c,b]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[d,[c,m]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i],[l,[c,v]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[l,[c,y]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[c,y]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[c,v]],[/(android[-\w\. ]{0,9});.+buil/i],[l,[d,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[h,[u,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[h,[u,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i],[u,h],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[h,u]],os:[[/microsoft (windows) (vista|xp)/i],[u,h],[/(windows) nt 6\.2; (arm)/i,/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i,/(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i],[u,[h,z,W]],[/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[u,"Windows"],[h,z,W]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/cfnetwork\/.+darwin/i],[[h,/_/g,"."],[u,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[u,"Mac OS"],[h,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[h,u],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[u,h],[/\(bb(10);/i],[h,[u,k]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[h,[u,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[h,[u,O+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[h,[u,"webOS"]],[/crkey\/([\d\.]+)/i],[h,[u,P+"cast"]],[/(cros) [\w]+ ([\w\.]+\w)/i],[[u,"Chromium OS"],h],[/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[u,h],[/(sunos) ?([\w\.\d]*)/i],[[u,"Solaris"],h],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux)/i,/(unix) ?([\w\.]*)/i],[u,h]]},$=function(e,t){if(typeof e===a&&(t=e,e=i),!(this instanceof $))return new $(e,t).getResult();var n=e||(typeof r!==o&&r.navigator&&r.navigator.userAgent?r.navigator.userAgent:""),p=t?function(e,t){var r={};for(var i in e)t[i]&&t[i].length%2==0?r[i]=t[i].concat(e[i]):r[i]=e[i];return r}(J,t):J;return this.getBrowser=function(){var e={};return e[u]=i,e[h]=i,q.call(e,n,p.browser),e.major=function(e){return typeof e===s?e.replace(/[^\d\.]/g,"").split(".")[0]:i}(e.version),e},this.getCPU=function(){var e={};return e[f]=i,q.call(e,n,p.cpu),e},this.getDevice=function(){var e={};return e[d]=i,e[l]=i,e[c]=i,q.call(e,n,p.device),e},this.getEngine=function(){var e={};return e[u]=i,e[h]=i,q.call(e,n,p.engine),e},this.getOS=function(){var e={};return e[u]=i,e[h]=i,q.call(e,n,p.os),e},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return n},this.setUA=function(e){return n=typeof e===s&&e.length>350?B(e,350):e,this},this.setUA(n),this};$.VERSION="0.7.33",$.BROWSER=L([u,h,"major"]),$.CPU=L([f]),$.DEVICE=L([l,d,c,p,v,g,y,b,m]),$.ENGINE=$.OS=L([u,h]),e.exports&&(t=e.exports=$),t.UAParser=$;var H=typeof r!==o&&(r.jQuery||r.Zepto);if(H&&!H.ua){var G=new $;H.ua=G.getResult(),H.ua.get=function(){return G.getUA()},H.ua.set=function(e){G.setUA(e);var t=G.getResult();for(var r in t)H.ua[r]=t[r]}}}("object"==typeof window?window:_e)})),Te=function(){function e(e){this.amplitudeInstance=e}return e.prototype.getUser=function(){var e,t,r,i,n,o,a,s,l,u;return{device_id:null===(t=null===(e=this.amplitudeInstance)||void 0===e?void 0:e.options)||void 0===t?void 0:t.deviceId,user_id:null===(i=null===(r=this.amplitudeInstance)||void 0===r?void 0:r.options)||void 0===i?void 0:i.userId,version:null===(o=null===(n=this.amplitudeInstance)||void 0===n?void 0:n.options)||void 0===o?void 0:o.versionName,language:null===(s=null===(a=this.amplitudeInstance)||void 0===a?void 0:a.options)||void 0===s?void 0:s.language,platform:null===(u=null===(l=this.amplitudeInstance)||void 0===l?void 0:l.options)||void 0===u?void 0:u.platform,os:this.getOs(),device_model:this.getDeviceModel()}},e.prototype.getOs=function(){var e,t,r,i,n,o;return[null===(r=null===(t=null===(e=this.amplitudeInstance)||void 0===e?void 0:e._ua)||void 0===t?void 0:t.browser)||void 0===r?void 0:r.name,null===(o=null===(n=null===(i=this.amplitudeInstance)||void 0===i?void 0:i._ua)||void 0===n?void 0:n.browser)||void 0===o?void 0:o.major].filter((function(e){return null!=e})).join(" ")},e.prototype.getDeviceModel=function(){var e,t,r;return null===(r=null===(t=null===(e=this.amplitudeInstance)||void 0===e?void 0:e._ua)||void 0===t?void 0:t.os)||void 0===r?void 0:r.name},e}(),Ve=function(){function e(e){this.amplitudeInstance=e}return e.prototype.track=function(e){this.amplitudeInstance.logEvent(e.name,e.properties)},e.prototype.setUserProperty=function(e){var t,r;this.amplitudeInstance.setUserProperties(((t={})[e.userProperty]=null===(r=e.variant)||void 0===r?void 0:r.value,t))},e.prototype.unsetUserProperty=function(e){var t;this.amplitudeInstance._logEvent("$identify",null,null,{$unset:(t={},t[e.userProperty]="-",t)})},e}(),Ne=function(){return Ne=Object.assign||function(e){for(var t,r=1,i=arguments.length;r<i;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},Ne.apply(this,arguments)};function Ue(e,t,r,i){return new(r||(r=Promise))((function(n,o){function a(e){try{l(i.next(e))}catch(e){o(e)}}function s(e){try{l(i.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}l((i=i.apply(e,t||[])).next())}))}function Re(e,t){var r,i,n,o={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(l){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(r=1,i&&(n=2&s[0]?i.return:s[0]?i.throw||((n=i.return)&&n.call(i),0):i.next)&&!(n=n.call(i,s[1])).done)return n;switch(i=0,n&&(s=[2&s[0],n.value]),s[0]){case 0:case 1:n=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,i=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!(n=o.trys,(n=n.length>0&&n[n.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!n||s[1]>n[0]&&s[1]<n[3])){o.label=s[1];break}if(6===s[0]&&o.label<n[1]){o.label=n[1],n=s;break}if(n&&o.label<n[2]){o.label=n[2],o.ops.push(s);break}n[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],i=0}finally{r=n=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}function Fe(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],i=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Le(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var i,n,o=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(i=o.next()).done;)a.push(i.value)}catch(e){n={error:e}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return a}function De(e,t,r){if(r||2===arguments.length)for(var i,n=0,o=t.length;n<o;n++)!i&&n in t||(i||(i=Array.prototype.slice.call(t,0,n)),i[n]=t[n]);return e.concat(i||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError;var Ke=function(e,t){var r,i;void 0===t&&(t=!1);var n=Be(e,t),o=void 0,a=Ae.document.cookie.split("; ");try{for(var s=Fe(a),l=s.next();!l.done;l=s.next()){var u=Le(l.value.split("=",2),2),c=u[0],d=u[1];c===n&&(o=decodeURIComponent(d))}}catch(e){r={error:e}}finally{try{l&&!l.done&&(i=s.return)&&i.call(s)}finally{if(r)throw r.error}}if(o)try{if(t){var h=atob(o);return JSON.parse(decodeURIComponent(h))}var f=o.split("."),p=void 0;return f.length>=2&&f[1]&&(p=atob(f[1])),{deviceId:f[0],userId:p}}catch(e){return}},Be=function(e,t){if(t){if((null==e?void 0:e.length)<10)return;return"AMP_".concat(e.substring(0,10))}if(!((null==e?void 0:e.length)<6))return"amp_".concat(e.substring(0,6))},qe=function(){function e(e,t,r){this.type="integration",this.apiKey=e,this.identityStore=t.identityStore,this.eventBridge=t.eventBridge,this.contextProvider=t.applicationContextProvider,this.timeoutMillis=r,this.loadPersistedState(),r<=0&&(this.setup=void 0)}return e.prototype.setup=function(e,t){return Ue(this,void 0,void 0,(function(){return Re(this,(function(r){return(null==e?void 0:e.automaticFetchOnAmplitudeIdentityChange)&&this.identityStore.addIdentityListener((function(){null==t||t.fetch()})),[2,this.waitForConnectorIdentity(this.timeoutMillis)]}))}))},e.prototype.getUser=function(){var e=this.identityStore.getIdentity();return{user_id:e.userId,device_id:e.deviceId,user_properties:e.userProperties,version:this.contextProvider.versionName}},e.prototype.track=function(e){return!!this.eventBridge.receiver&&(this.eventBridge.logEvent({eventType:e.eventType,eventProperties:e.eventProperties}),!0)},e.prototype.loadPersistedState=function(){if(!this.apiKey||this.apiKey.startsWith("client-"))return!1;var e=Ke(this.apiKey,!0);return(e||(e=Ke(this.apiKey,!1))||(e=function(e){var t=Be(e,!0);try{var r=Ae.localStorage.getItem(t);if(!r)return;var i=JSON.parse(r);if("object"!=typeof i)return;return i}catch(e){return}}(this.apiKey))||!!(e=function(e){var t=Be(e,!0);try{var r=Ae.sessionStorage.getItem(t);if(!r)return;var i=JSON.parse(r);if("object"!=typeof i)return;return i}catch(e){return}}(this.apiKey)))&&(this.commitIdentityToConnector(e),!0)},e.prototype.commitIdentityToConnector=function(e){var t=this.identityStore.editIdentity();t.setDeviceId(e.deviceId),e.userId&&t.setUserId(e.userId),t.commit()},e.prototype.waitForConnectorIdentity=function(e){return Ue(this,void 0,void 0,(function(){var t,r=this;return Re(this,(function(i){return(t=this.identityStore.getIdentity()).userId||t.deviceId?[2]:[2,Promise.race([new Promise((function(e){var t=function(){e(),r.identityStore.removeIdentityListener(t)};r.identityStore.addIdentityListener(t)})),new Promise((function(t,r){Ae.setTimeout(r,e,"Timed out waiting for Amplitude Analytics SDK to initialize.")}))])]}))}))},e}();var ze,We,Je=Ae.fetch||function(e,t){return t=t||{},new Promise((function(r,i){var n=new XMLHttpRequest,o=[],a=[],s={},l=function(){return{ok:2==(n.status/100|0),statusText:n.statusText,status:n.status,url:n.responseURL,text:function(){return Promise.resolve(n.responseText)},json:function(){return Promise.resolve(JSON.parse(n.responseText))},blob:function(){return Promise.resolve(new Blob([n.response]))},clone:l,headers:{keys:function(){return o},entries:function(){return a},get:function(e){return s[e.toLowerCase()]},has:function(e){return e.toLowerCase()in s}}}};for(var u in n.open(t.method||"get",e,!0),n.onload=function(){n.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,(function(e,t,r){o.push(t=t.toLowerCase()),a.push([t,r]),s[t]=s[t]?s[t]+","+r:r})),r(l())},n.onerror=i,n.withCredentials="include"==t.credentials,t.headers)n.setRequestHeader(u,t.headers[u]);n.send(t.body||null)}))},$e=function(){function e(e){this.client=e}return e.prototype.request=function(e){return Ue(this,void 0,void 0,(function(){return Re(this,(function(t){switch(t.label){case 0:return[4,this.client.request(e.requestUrl,e.method,e.headers,null,e.timeoutMillis)];case 1:return[2,t.sent()]}}))}))},e}(),He={request:function(e,t,r,i,n){return function(e,t){return null==t||t<=0?e:new Promise((function(r,i){Ae.setTimeout((function(){i(new Ee("Request timeout after "+t+" milliseconds"))}),t),e.then(r,i)}))}(Ue(void 0,void 0,void 0,(function(){var n,o;return Re(this,(function(a){switch(a.label){case 0:return[4,Je(e,{method:t,headers:r,body:i})];case 1:return n=a.sent(),o={status:n.status},[4,n.text()];case 2:return o.body=a.sent(),[2,o]}}))})),n)}};!function(e){e.LocalStorage="localStorage",e.InitialVariants="initialVariants"}(ze||(ze={})),function(e){e.LocalStorage="storage",e.InitialVariants="initial",e.SecondaryLocalStorage="secondary-storage",e.SecondaryInitialVariants="secondary-initial",e.FallbackInline="fallback-inline",e.FallbackConfig="fallback-config",e.LocalEvaluation="local-evaluation"}(We||(We={}));var Ge=function(e){return!e||e===We.FallbackInline||e===We.FallbackConfig||e===We.SecondaryInitialVariants},Qe={debug:!1,instanceName:"$default_instance",fallbackVariant:{},initialVariants:{},initialFlags:void 0,source:ze.LocalStorage,serverUrl:"https://api.lab.amplitude.com",flagsServerUrl:"https://flag.lab.amplitude.com",serverZone:"US",fetchTimeoutMillis:1e4,retryFetchOnFailure:!0,throwOnError:!1,automaticExposureTracking:!0,pollOnStart:!0,flagConfigPollingIntervalMillis:3e5,fetchOnStart:!0,automaticFetchOnAmplitudeIdentityChange:!1,userProvider:null,analyticsProvider:null,exposureTrackingProvider:null,httpClient:He},Xe="1.16.1",Ze=function(){function e(e,t){var r,i=this;this.isReady=new Promise((function(e){i.resolve=e})),this.config=e,this.client=t;var n=null!==(r=e.instanceName)&&void 0!==r?r:Qe.instanceName;this.queue=new et(n),this.cache=new Ye(n)}return e.prototype.ready=function(){return this.integration?this.isReady:Promise.resolve()},e.prototype.setIntegration=function(e){var t=this;this.integration&&this.integration.teardown&&this.integration.teardown(),this.integration=e,e.setup?this.integration.setup(this.config,this.client).then((function(){t.queue.setTracker(t.integration.track.bind(e)),t.resolve()}),(function(){t.queue.setTracker(t.integration.track.bind(e)),t.resolve()})):(this.queue.setTracker(this.integration.track.bind(e)),this.resolve())},e.prototype.getUser=function(){return this.integration?this.integration.getUser():{}},e.prototype.track=function(e){if(this.cache.shouldTrack(e)){var t=this.getExposureEvent(e);this.queue.push(t)}},e.prototype.getExposureEvent=function(e){var t,r,i,n={eventType:"$exposure",eventProperties:e};return(null===(t=e.metadata)||void 0===t?void 0:t.exposureEvent)?n={eventType:null===(r=e.metadata)||void 0===r?void 0:r.exposureEvent,eventProperties:e}:"web"===(null===(i=e.metadata)||void 0===i?void 0:i.deliveryMethod)&&(n={eventType:"$impression",eventProperties:e}),n},e}(),Ye=function(){function e(e){this.isSessionStorageAvailable=tt(),this.inMemoryCache={},this.storageKey="EXP_sent_v2_".concat(e),this.isSessionStorageAvailable&&Ae.sessionStorage.removeItem("EXP_sent_".concat(e))}return e.prototype.shouldTrack=function(e){var t;if("web"===(null===(t=e.metadata)||void 0===t?void 0:t.deliveryMethod))return!0;this.loadCache();var r=this.inMemoryCache[e.flag_key],i=!1;return r&&r.variant===e.variant||(i=!0,this.inMemoryCache[e.flag_key]=e),this.storeCache(),i},e.prototype.loadCache=function(){if(this.isSessionStorageAvailable){var e=Ae.sessionStorage.getItem(this.storageKey);this.inMemoryCache=e?JSON.parse(e):{}}},e.prototype.storeCache=function(){this.isSessionStorageAvailable&&Ae.sessionStorage.setItem(this.storageKey,JSON.stringify(this.inMemoryCache))},e}(),et=function(){function e(e,t){void 0===t&&(t=512),this.isLocalStorageAvailable=Me(),this.inMemoryQueue=[],this.storageKey="EXP_unsent_".concat(e),this.maxQueueSize=t}return e.prototype.push=function(e){this.loadQueue(),this.inMemoryQueue.push(e),this.flush(),this.storeQueue()},e.prototype.setTracker=function(e){var t=this;this.tracker=e,this.poller=Ae.setInterval((function(){t.loadFlushStore()}),1e3),this.loadFlushStore()},e.prototype.flush=function(){var e,t;if(this.tracker&&0!==this.inMemoryQueue.length){try{for(var r=Fe(this.inMemoryQueue),i=r.next();!i.done;i=r.next()){var n=i.value;try{if(!this.tracker(n))return}catch(e){return}}}catch(t){e={error:t}}finally{try{i&&!i.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}this.inMemoryQueue=[],this.poller&&(Ae.clearInterval(this.poller),this.poller=void 0)}},e.prototype.loadQueue=function(){if(this.isLocalStorageAvailable){var e=Ae.localStorage.getItem(this.storageKey);this.inMemoryQueue=e?JSON.parse(e):[]}},e.prototype.storeQueue=function(){this.isLocalStorageAvailable&&(this.inMemoryQueue.length>this.maxQueueSize&&(this.inMemoryQueue=this.inMemoryQueue.slice(this.inMemoryQueue.length-this.maxQueueSize)),Ae.localStorage.setItem(this.storageKey,JSON.stringify(this.inMemoryQueue)))},e.prototype.loadFlushStore=function(){this.loadQueue(),this.flush(),this.storeQueue()},e}(),tt=function(){var e=Ie();if(e)try{var t="EXP_test";return e.sessionStorage.setItem(t,t),e.sessionStorage.removeItem(t),!0}catch(e){return!1}return!1},rt=function(){function e(){this.globalScope=Ie()}return e.prototype.get=function(e){var t;return null===(t=this.globalScope)||void 0===t?void 0:t.localStorage.getItem(e)},e.prototype.put=function(e,t){var r;null===(r=this.globalScope)||void 0===r||r.localStorage.setItem(e,t)},e.prototype.delete=function(e){var t;null===(t=this.globalScope)||void 0===t||t.localStorage.removeItem(e)},e}(),it=function(){function e(e,t,r){this.cache={},this.namespace=e,this.storage=t,this.transformer=r}return e.prototype.get=function(e){return this.cache[e]},e.prototype.getAll=function(){return Ne({},this.cache)},e.prototype.put=function(e,t){this.cache[e]=t},e.prototype.putAll=function(e){var t,r;try{for(var i=Fe(Object.keys(e)),n=i.next();!n.done;n=i.next()){var o=n.value;this.cache[o]=e[o]}}catch(e){t={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}},e.prototype.remove=function(e){delete this.cache[e]},e.prototype.clear=function(){this.cache={}},e.prototype.load=function(){var e,t,r,i=this.storage.get(this.namespace);try{r=JSON.parse(i)||{}}catch(e){return}var n={};try{for(var o=Fe(Object.keys(r)),a=o.next();!a.done;a=o.next()){var s=a.value;try{var l=void 0;(l=this.transformer?this.transformer(r[s]):r[s])&&(n[s]=l)}catch(e){}}}catch(t){e={error:t}}finally{try{a&&!a.done&&(t=o.return)&&t.call(o)}finally{if(e)throw e.error}}this.clear(),this.putAll(n)},e.prototype.store=function(e){void 0===e&&(e=this.cache),this.storage.put(this.namespace,JSON.stringify(e))},e}(),nt=function(e){if("string"==typeof e)return{key:e,value:e};if("object"==typeof e){var t=e.key,r=e.value,i=e.payload,n=e.metadata,o=e.expKey;n&&n.experimentKey?o=n.experimentKey:o&&((n=n||{}).experimentKey=o);var a={};return t?a.key=t:r&&(a.key=r),r&&(a.value=r),n&&(a.metadata=n),i&&(a.payload=i),o&&(a.expKey=o),a}},ot=function(){function e(){this.globalScope=Ie()}return e.prototype.get=function(e){var t;return null===(t=this.globalScope)||void 0===t?void 0:t.sessionStorage.getItem(e)},e.prototype.put=function(e,t){var r;null===(r=this.globalScope)||void 0===r||r.sessionStorage.setItem(e,t)},e.prototype.delete=function(e){var t;null===(t=this.globalScope)||void 0===t||t.sessionStorage.removeItem(e)},e}(),at=function(e){return null==e},st=function(e){return!!at(e)||e&&0===Object.keys(e).length},lt=function(e){var t;return"local"===(null===(t=null==e?void 0:e.metadata)||void 0===t?void 0:t.evaluationMode)},ut=function(){function e(e,t,r,i){this.started=!1,this.done=!1,this.attempts=e,this.min=t,this.max=r,this.scalar=i}return e.prototype.start=function(e){return Ue(this,void 0,void 0,(function(){return Re(this,(function(t){switch(t.label){case 0:if(this.started)throw Error("Backoff already started");return this.started=!0,[4,this.backoff(e,0,this.min)];case 1:return t.sent(),[2]}}))}))},e.prototype.cancel=function(){this.done=!0,clearTimeout(this.timeoutHandle)},e.prototype.backoff=function(e,t,r){return Ue(this,void 0,void 0,(function(){var i=this;return Re(this,(function(n){return this.done||(this.timeoutHandle=Ae.setTimeout((function(){return Ue(i,void 0,void 0,(function(){var i,n;return Re(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,e()];case 1:return o.sent(),[3,3];case 2:return o.sent(),(i=t+1)<this.attempts&&(n=Math.min(r*this.scalar,this.max),this.backoff(e,i,n)),[3,3];case 3:return[2]}}))}))}),r)),[2]}))}))},e}(),ct=function(e){return null==e?{}:"string"==typeof e?{key:e,value:e}:e},dt=function(e){if(!e)return{};var t=void 0;e.metadata&&(t=e.metadata.experimentKey);var r={};return e.key&&(r.key=e.key),e.value&&(r.value=e.value),e.payload&&(r.payload=e.payload),t&&(r.expKey=t),e.metadata&&(r.metadata=e.metadata),r},ht=function(){function e(e){this.setProperties={},this.unsetProperties={},this.analyticsProvider=e}return e.prototype.track=function(e){this.setProperties[e.key]!=e.variant.value&&(this.setProperties[e.key]=e.variant.value,delete this.unsetProperties[e.key],this.analyticsProvider.track(e))},e.prototype.setUserProperty=function(e){this.setProperties[e.key]!=e.variant.value&&this.analyticsProvider.setUserProperty(e)},e.prototype.unsetUserProperty=function(e){this.unsetProperties[e.key]||(this.unsetProperties[e.key]="unset",delete this.setProperties[e.key],this.analyticsProvider.unsetUserProperty(e))},e}(),ft=function(){function e(e){this.tracked={},this.exposureTrackingProvider=e}return e.prototype.track=function(e){var t=this.tracked[e.flag_key];t&&t.variant===e.variant||(this.tracked[e.flag_key]=e,this.exposureTrackingProvider.track(e))},e}(),pt=function(){function e(e,t){var r,i,n,o,a=this;this.engine=new re,this.isRunning=!1,this.apiKey=e,this.config=Ne(Ne(Ne({},Qe),t),{serverUrl:(null==t?void 0:t.serverUrl)||("eu"===(null===(r=null==t?void 0:t.serverZone)||void 0===r?void 0:r.toLowerCase())?"https://api.lab.eu.amplitude.com":Qe.serverUrl),flagsServerUrl:(null==t?void 0:t.flagsServerUrl)||("eu"===(null===(i=null==t?void 0:t.serverZone)||void 0===i?void 0:i.toLowerCase())?"https://flag.lab.eu.amplitude.com":Qe.flagsServerUrl),flagConfigPollingIntervalMillis:t.flagConfigPollingIntervalMillis<6e4?6e4:null!==(n=t.flagConfigPollingIntervalMillis)&&void 0!==n?n:Qe.flagConfigPollingIntervalMillis});var s=null===(o=this.config)||void 0===o?void 0:o.internalInstanceNameSuffix;if(this.isWebExperiment="web"===s,this.poller=new Ce((function(){return a.doFlags()}),this.config.flagConfigPollingIntervalMillis),this.config.initialVariants)for(var l in this.config.initialVariants)this.config.initialVariants[l]=nt(this.config.initialVariants[l]);this.config.userProvider&&(this.userProvider=this.config.userProvider),this.config.analyticsProvider&&(this.analyticsProvider=new ht(this.config.analyticsProvider)),this.config.exposureTrackingProvider&&(this.exposureTrackingProvider=new ft(this.config.exposureTrackingProvider)),this.integrationManager=new Ze(this.config,this);var u,c=new $e(this.config.httpClient||He);this.flagApi=new Oe(this.apiKey,this.config.flagsServerUrl,c),this.evaluationApi=new Pe(this.apiKey,this.config.serverUrl,c);var d=s?"".concat(this.config.instanceName,"-").concat(s):this.config.instanceName;u=this.isWebExperiment?new ot:new rt,this.variants=function(e,t,r){var i=e.substring(e.length-6),n="amp-exp-".concat(t,"-").concat(i);return new it(n,r,nt)}(this.apiKey,d,u),this.flags=function(e,t,r){void 0===r&&(r=new rt);var i=e.substring(e.length-6),n="amp-exp-".concat(t,"-").concat(i,"-flags");return new it(n,r)}(this.apiKey,d,u);try{this.flags.load(),this.variants.load()}catch(e){}this.mergeInitialFlagsWithStorage()}return e.prototype.start=function(e){return Ue(this,void 0,void 0,(function(){var t,r,i;return Re(this,(function(n){switch(n.label){case 0:if(this.isRunning)return[2];this.isRunning=!0,this.setUser(e),n.label=1;case 1:return n.trys.push([1,6,,7]),t=this.doFlags(),null===(i=this.config.fetchOnStart)||void 0===i||i?[4,Promise.all([this.fetch(e),t])]:[3,3];case 2:return n.sent(),[3,5];case 3:return[4,t];case 4:n.sent(),n.label=5;case 5:return[3,7];case 6:if(r=n.sent(),this.config.throwOnError)throw r;return[3,7];case 7:return this.config.pollOnStart&&this.poller.start(),[2]}}))}))},e.prototype.stop=function(){this.isRunning&&(this.poller.stop(),this.isRunning=!1)},e.prototype.fetch=function(){return Ue(this,arguments,void 0,(function(e,t){var r;return void 0===e&&(e=this.user),Re(this,(function(i){switch(i.label){case 0:this.setUser(e||{}),i.label=1;case 1:return i.trys.push([1,3,,4]),[4,this.fetchInternal(e,this.config.fetchTimeoutMillis,this.config.retryFetchOnFailure,t)];case 2:return i.sent(),[3,4];case 3:if(r=i.sent(),this.config.throwOnError)throw r;return this.config.debug&&(r instanceof Ee?console.debug(r):console.error(r)),[3,4];case 4:return[2,this]}}))}))},e.prototype.variant=function(e,t){var r,i;if(!this.apiKey)return{value:void 0};var n=this.variantAndSource(e,t);return this.config.automaticExposureTracking&&this.exposureInternal(e,n),this.debug("[Experiment] variant for ".concat(e," is ").concat((null===(r=n.variant)||void 0===r?void 0:r.key)||(null===(i=n.variant)||void 0===i?void 0:i.value))),n.variant||{}},e.prototype.exposure=function(e){var t=this.variantAndSource(e);this.exposureInternal(e,t)},e.prototype.all=function(){if(!this.apiKey)return{};var e=this.evaluate();for(var t in e){var r=this.flags.get(t);lt(r)||delete e[t]}return Ne(Ne(Ne({},this.secondaryVariants()),this.sourceVariants()),e)},e.prototype.clear=function(){this.variants.clear();try{this.variants.store()}catch(e){}},e.prototype.getUser=function(){var e;if(!this.user)return this.user;if(null===(e=this.user)||void 0===e?void 0:e.user_properties){var t=Ne({},this.user.user_properties);return Ne(Ne({},this.user),{user_properties:t})}return Ne({},this.user)},e.prototype.setUser=function(e){var t;if(e)if(null===(t=this.user)||void 0===t?void 0:t.user_properties){var r=Ne({},e.user_properties);this.user=Ne(Ne({},e),{user_properties:r})}else this.user=Ne({},e);else this.user=null},e.prototype.getUserProvider=function(){return this.userProvider},e.prototype.setUserProvider=function(e){return this.userProvider=e,this},e.prototype.mergeInitialFlagsWithStorage=function(){var e=this;this.config.initialFlags&&JSON.parse(this.config.initialFlags).forEach((function(t){e.flags.get(t.key)||e.flags.put(t.key,t)}))},e.prototype.evaluate=function(e){var t,r,i=this.addContext(this.user),n=function(e,t){var r,i,n=m({},e),o=[],a=t||Object.keys(n);try{for(var s=x(a),l=s.next();!l.done;l=s.next()){var u=l.value,c=ie(u,n);c&&o.push.apply(o,E([],k(c),!1))}}catch(e){r={error:e}}finally{try{l&&!l.done&&(i=s.return)&&i.call(s)}finally{if(r)throw r.error}}return o}(this.flags.getAll(),e),o=function(e){var t,r,i,n;if(!e)return{};var o={user:e},a=Ie();a&&(o.page={url:a.location.href});var s={};if(!e.groups)return o;try{for(var l=Fe(Object.keys(e.groups)),u=l.next();!u.done;u=l.next()){var c=u.value,d=e.groups[c];if(d.length>0&&d[0]){var h=d[0],f={group_name:h},p=null===(n=null===(i=e.group_properties)||void 0===i?void 0:i[c])||void 0===n?void 0:n[h];p&&Object.keys(p).length>0&&(f.group_properties=p),s[c]=f}}}catch(e){t={error:e}}finally{try{u&&!u.done&&(r=l.return)&&r.call(l)}finally{if(t)throw t.error}}return Object.keys(s).length>0&&(o.groups=s),delete o.user.groups,delete o.user.group_properties,o}(i),a=this.engine.evaluate(o,n),s={};try{for(var l=Fe(Object.keys(a)),u=l.next();!u.done;u=l.next()){var c=u.value;s[c]=dt(a[c])}}catch(e){t={error:e}}finally{try{u&&!u.done&&(r=l.return)&&r.call(l)}finally{if(t)throw t.error}}return s},e.prototype.variantAndSource=function(e,t){var r={};this.config.source===ze.LocalStorage?r=this.localStorageVariantAndSource(e,t):this.config.source===ze.InitialVariants&&(r=this.initialVariantsVariantAndSource(e,t));var i=this.flags.get(e);return(lt(i)||!r.variant&&i)&&(r=this.localEvaluationVariantAndSource(e,i,t)),r},e.prototype.localEvaluationVariantAndSource=function(e,t,r){var i,n={},o=this.evaluate([t.key])[e],a=We.LocalEvaluation,s=null===(i=null==o?void 0:o.metadata)||void 0===i?void 0:i.default;if(!at(o)&&!s)return{variant:ct(o),source:a,hasDefaultVariant:!1};if(s&&(n={variant:ct(o),source:a,hasDefaultVariant:!0}),!at(r))return{variant:ct(r),source:We.FallbackInline,hasDefaultVariant:n.hasDefaultVariant};var l=this.config.initialVariants[e];if(!at(l))return{variant:ct(l),source:We.SecondaryInitialVariants,hasDefaultVariant:n.hasDefaultVariant};var u=ct(this.config.fallbackVariant),c={variant:u,source:We.FallbackConfig,hasDefaultVariant:n.hasDefaultVariant};return st(u)?n:c},e.prototype.localStorageVariantAndSource=function(e,t){var r,i={},n=this.variants.get(e),o=null===(r=null==n?void 0:n.metadata)||void 0===r?void 0:r.default;if(!at(n)&&!o)return{variant:ct(n),source:We.LocalStorage,hasDefaultVariant:!1};if(o&&(i={variant:ct(n),source:We.LocalStorage,hasDefaultVariant:!0}),!at(t))return{variant:ct(t),source:We.FallbackInline,hasDefaultVariant:i.hasDefaultVariant};var a=this.config.initialVariants[e];if(!at(a))return{variant:ct(a),source:We.SecondaryInitialVariants,hasDefaultVariant:i.hasDefaultVariant};var s=ct(this.config.fallbackVariant),l={variant:s,source:We.FallbackConfig,hasDefaultVariant:i.hasDefaultVariant};return st(s)?i:l},e.prototype.initialVariantsVariantAndSource=function(e,t){var r,i={},n=this.config.initialVariants[e];if(!at(n))return{variant:ct(n),source:We.InitialVariants,hasDefaultVariant:!1};var o=this.variants.get(e),a=null===(r=null==o?void 0:o.metadata)||void 0===r?void 0:r.default;if(!at(o)&&!a)return{variant:ct(o),source:We.LocalStorage,hasDefaultVariant:!1};if(a&&(i={variant:ct(o),source:We.LocalStorage,hasDefaultVariant:!0}),!at(t))return{variant:ct(t),source:We.FallbackInline,hasDefaultVariant:i.hasDefaultVariant};var s=ct(this.config.fallbackVariant),l={variant:s,source:We.FallbackConfig,hasDefaultVariant:i.hasDefaultVariant};return st(s)?i:l},e.prototype.fetchInternal=function(e,t,r,i){return Ue(this,void 0,void 0,(function(){var n,o;return Re(this,(function(a){switch(a.label){case 0:if(!this.apiKey)throw Error("Experiment API key is empty");this.debug("[Experiment] Fetch all: retry=".concat(r)),r&&this.stopRetries(),a.label=1;case 1:return a.trys.push([1,4,,5]),[4,this.doFetch(e,t,i)];case 2:return n=a.sent(),[4,this.storeVariants(n,i)];case 3:return a.sent(),[2,n];case 4:throw o=a.sent(),r&&this.shouldRetryFetch(o)&&this.startRetries(e,i),o;case 5:return[2]}}))}))},e.prototype.cleanUserPropsForFetch=function(e){var t=Ne({},e);return delete t.cookie,t},e.prototype.doFetch=function(e,t,r){return Ue(this,void 0,void 0,(function(){var i,n,o,a,s,l,u;return Re(this,(function(c){switch(c.label){case 0:return[4,this.addContextOrWait(e)];case 1:return e=c.sent(),e=this.cleanUserPropsForFetch(e),this.debug("[Experiment] Fetch variants for user: ",e),[4,this.evaluationApi.getVariants(e,Ne({timeoutMillis:t},r))];case 2:i=c.sent(),n={};try{for(o=Fe(Object.keys(i)),a=o.next();!a.done;a=o.next())s=a.value,n[s]=dt(i[s])}catch(e){l={error:e}}finally{try{a&&!a.done&&(u=o.return)&&u.call(o)}finally{if(l)throw l.error}}return this.debug("[Experiment] Received variants: ",n),[2,n]}}))}))},e.prototype.doFlags=function(){return Ue(this,void 0,void 0,(function(){var e,t,r;return Re(this,(function(i){switch(i.label){case 0:return i.trys.push([0,4,,5]),e=void 0,this.isWebExperiment?[4,this.addContextOrWait(this.getUser())]:[3,2];case 1:e=i.sent(),i.label=2;case 2:return[4,this.flagApi.getFlags({libraryName:"experiment-js-client",libraryVersion:Xe,timeoutMillis:this.config.fetchTimeoutMillis,deliveryMethod:this.isWebExperiment?"web":void 0,user:(null==e?void 0:e.user_id)||(null==e?void 0:e.device_id)?{user_id:null==e?void 0:e.user_id,device_id:null==e?void 0:e.device_id}:void 0})];case 3:return t=i.sent(),this.flags.clear(),this.flags.putAll(t),[3,5];case 4:if(!((r=i.sent())instanceof Ee))throw r;if(this.config.debug&&console.debug(r),this.config.throwOnError)throw r;return[3,5];case 5:try{this.flags.store()}catch(e){}return this.mergeInitialFlagsWithStorage(),[2]}}))}))},e.prototype.storeVariants=function(e,t){return Ue(this,void 0,void 0,(function(){var r,i,n,o;return Re(this,(function(a){for(o in 0===(r=t&&t.flagKeys?t.flagKeys:[]).length&&this.variants.clear(),i=function(t){r=r.filter((function(e){return e!==t})),n.variants.put(t,e[t])},n=this,e)i(o);for(o in r)this.variants.remove(o);try{this.variants.store()}catch(e){}return this.debug("[Experiment] Stored variants: ",e),[2]}))}))},e.prototype.startRetries=function(e,t){return Ue(this,void 0,void 0,(function(){var r=this;return Re(this,(function(i){return this.debug("[Experiment] Retry fetch"),this.retriesBackoff=new ut(8,500,1e4,1.5),this.retriesBackoff.start((function(){return Ue(r,void 0,void 0,(function(){return Re(this,(function(r){switch(r.label){case 0:return[4,this.fetchInternal(e,1e4,!1,t)];case 1:return r.sent(),[2]}}))}))})),[2]}))}))},e.prototype.stopRetries=function(){this.retriesBackoff&&this.retriesBackoff.cancel()},e.prototype.addContext=function(e){var t,r=null===(t=this.userProvider)||void 0===t?void 0:t.getUser(),i=this.integrationManager.getUser(),n=Ne(Ne(Ne({},null==r?void 0:r.user_properties),i.user_properties),null==e?void 0:e.user_properties);return Ne(Ne(Ne(Ne({library:"experiment-js-client/".concat(Xe)},r),i),e),{user_properties:n})},e.prototype.addContextOrWait=function(e){return Ue(this,void 0,void 0,(function(){return Re(this,(function(t){switch(t.label){case 0:return[4,this.integrationManager.ready()];case 1:return t.sent(),[2,this.addContext(e)]}}))}))},e.prototype.sourceVariants=function(){return this.config.source==ze.LocalStorage?this.variants.getAll():this.config.source==ze.InitialVariants?this.config.initialVariants:void 0},e.prototype.secondaryVariants=function(){return this.config.source==ze.LocalStorage?this.config.initialVariants:this.config.source==ze.InitialVariants?this.variants.getAll():void 0},e.prototype.exposureInternal=function(e,t){var r,i,n,o,a,s,l,u,c;if(null===(n=null===(i=null===(r=t.variant)||void 0===r?void 0:r.metadata)||void 0===i?void 0:i.trackExposure)||void 0===n||n){this.legacyExposureInternal(e,t.variant,t.source);var d={flag_key:e},h=Ge(t.source);if(!h||t.hasDefaultVariant){(null===(o=t.variant)||void 0===o?void 0:o.expKey)&&(d.experiment_key=null===(a=t.variant)||void 0===a?void 0:a.expKey);var f=null===(s=t.variant)||void 0===s?void 0:s.metadata;if(h||(null==f?void 0:f.default)||((null===(l=t.variant)||void 0===l?void 0:l.key)?d.variant=t.variant.key:(null===(u=t.variant)||void 0===u?void 0:u.value)&&(d.variant=t.variant.value)),f&&(d.metadata=f),this.isWebExperiment){var p=Ie();if(null==p?void 0:p.location)try{var v=p.location.href;d.metadata.url=v.split("?")[0]||""}catch(e){}}null===(c=this.exposureTrackingProvider)||void 0===c||c.track(d),this.integrationManager.track(d)}}},e.prototype.legacyExposureInternal=function(e,t,r){var i,n,o,a,s;if(this.analyticsProvider){var l=function(e,t,r,i){var n,o=null==r?void 0:r.value,a="[Experiment] ".concat(t);return{name:"[Experiment] Exposure",user:e,key:t,variant:r,userProperty:a,properties:{key:t,variant:o,source:i},userProperties:(n={},n[a]=o,n)}}(this.addContext(this.getUser()),e,t,r);Ge(r)||!(null==t?void 0:t.value)?null===(n=null===(i=this.analyticsProvider)||void 0===i?void 0:i.unsetUserProperty)||void 0===n||n.call(i,l):(null==t?void 0:t.value)&&(null===(a=null===(o=this.analyticsProvider)||void 0===o?void 0:o.setUserProperty)||void 0===a||a.call(o,l),null===(s=this.analyticsProvider)||void 0===s||s.track(l))}},e.prototype.debug=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];this.config.debug&&console.debug.apply(console,De([e],Le(t),!1))},e.prototype.shouldRetryFetch=function(e){return!(e instanceof ke)||(e.statusCode<400||e.statusCode>=500||429===e.statusCode)},e.prototype.addPlugin=function(e){"integration"===e.type&&this.integrationManager.setIntegration(e)},e}(),vt=function(){function e(e,t){var r,i,n;this.globalScope=Ie(),this.userAgent=void 0!==(null===(r=this.globalScope)||void 0===r?void 0:r.navigator)?null===(i=this.globalScope)||void 0===i?void 0:i.navigator.userAgent:void 0,this.ua=new je.UAParser(this.userAgent).getResult(),this.localStorage=new rt,this.sessionStorage=new ot,this.userProvider=e,this.apiKey=t,this.storageKey="EXP_".concat(null===(n=this.apiKey)||void 0===n?void 0:n.slice(0,10),"_DEFAULT_USER_PROVIDER")}return e.prototype.getUser=function(){var e,t,r,i,n,o=(null===(e=this.userProvider)||void 0===e?void 0:e.getUser())||{};return Ne({language:this.getLanguage(),platform:"Web",os:this.getOs(this.ua),device_model:this.getDeviceModel(this.ua),device_category:null!==(r=null===(t=this.ua.device)||void 0===t?void 0:t.type)&&void 0!==r?r:"desktop",referring_url:null===(n=null===(i=this.globalScope)||void 0===i?void 0:i.document)||void 0===n?void 0:n.referrer.replace(/\/$/,""),cookie:this.getCookie(),browser:this.getBrowser(this.ua),landing_url:this.getLandingUrl(),first_seen:this.getFirstSeen(),url_param:this.getUrlParam(),user_agent:this.userAgent},o)},e.prototype.getLanguage=function(){return"undefined"!=typeof navigator&&(navigator.languages&&navigator.languages[0]||navigator.language)||""},e.prototype.getOs=function(e){var t,r;return[null===(t=e.browser)||void 0===t?void 0:t.name,null===(r=e.browser)||void 0===r?void 0:r.major].filter((function(e){return null!=e})).join(" ")},e.prototype.getDeviceModel=function(e){var t;return null===(t=e.os)||void 0===t?void 0:t.name},e.prototype.getBrowser=function(e){var t,r=null===(t=e.browser)||void 0===t?void 0:t.name;return(null==r?void 0:r.includes("Chrom"))&&(r="Chrome"),(null==r?void 0:r.includes("Firefox"))&&(r="Firefox"),(null==r?void 0:r.includes("Safari"))&&(r="Safari"),(null==r?void 0:r.includes("Edge"))&&(r="Edge"),(null==r?void 0:r.includes("Opera"))&&(r="Opera"),r},e.prototype.getCookie=function(){var e,t,r,i,n;if(null===(t=null===(e=this.globalScope)||void 0===e?void 0:e.document)||void 0===t?void 0:t.cookie)return Object.fromEntries(null===(n=null===(i=null===(r=this.globalScope)||void 0===r?void 0:r.document)||void 0===i?void 0:i.cookie)||void 0===n?void 0:n.split("; ").map((function(e){return e.split("=")})))},e.prototype.getLandingUrl=function(){var e,t;try{var r=JSON.parse(this.sessionStorage.get(this.storageKey)||"{}");return r.landing_url||(r.landing_url=null===(t=null===(e=this.globalScope)||void 0===e?void 0:e.location)||void 0===t?void 0:t.href.replace(/\/$/,""),this.sessionStorage.put(this.storageKey,JSON.stringify(r))),r.landing_url}catch(e){return}},e.prototype.getFirstSeen=function(){try{var e=JSON.parse(this.localStorage.get(this.storageKey)||"{}");return e.first_seen||(e.first_seen=(Date.now()/1e3).toString(),this.localStorage.put(this.storageKey,JSON.stringify(e))),e.first_seen}catch(e){return}},e.prototype.getUrlParam=function(){var e,t,r;if(this.globalScope){var i={};try{var n=new URL(this.globalScope.location.href);try{for(var o=Fe(n.searchParams),a=o.next();!a.done;a=o.next()){var s=Le(a.value,2),l=s[0],u=s[1];i[l]=De(De([],Le(null!==(r=i[l])&&void 0!==r?r:[]),!1),Le(u.split(",")),!1)}}catch(t){e={error:t}}finally{try{a&&!a.done&&(t=o.return)&&t.call(o)}finally{if(e)throw e.error}}}catch(e){return}return Object.entries(i).reduce((function(e,t){var r=Le(t,2),i=r[0],n=r[1];return e[i]=1==n.length?n[0]:n,e}),{})}},e}();Ae.experimentInstances={};var yt=Ae.experimentInstances,gt=function(e,t){return wt(e,t)},bt=function(e,t){return wt(e,t,(function(){return new qe(e,y.getInstance(mt(t)),1e4)}))},mt=function(e){return(null==e?void 0:e.instanceName)||Qe.instanceName},wt=function(e,t,r){var i=function(e,t){var r=mt(t),i=null==t?void 0:t.internalInstanceNameSuffix;return i?"".concat(r,".").concat(e,".").concat(i):"".concat(r,".").concat(e)}(e,t),n=yt[i];return n||(n=function(e,t){return new pt(e,Ne(Ne({},t),{userProvider:new vt(null==t?void 0:t.userProvider,e)}))}(e,t),r&&n.addPlugin(r()),yt[i]=n,n)},St={initialize:gt,initializeWithAmplitudeAnalytics:bt},xt=function(){function e(){}return e.prototype.getUser=function(){return{}},e.prototype.start=function(e){return Ue(this,void 0,void 0,(function(){return Re(this,(function(e){return[2]}))}))},e.prototype.stop=function(){},e.prototype.setUser=function(e){},e.prototype.fetch=function(e,t){return Ue(this,void 0,void 0,(function(){return Re(this,(function(e){return[2,this]}))}))},e.prototype.getUserProvider=function(){return null},e.prototype.setUserProvider=function(e){return this},e.prototype.variant=function(e,t){return Qe.fallbackVariant},e.prototype.all=function(){return{}},e.prototype.clear=function(){},e.prototype.exposure=function(e){},e}(),kt=Object.freeze({__proto__:null,AmplitudeAnalyticsProvider:Ve,AmplitudeIntegrationPlugin:qe,AmplitudeUserProvider:Te,Experiment:St,ExperimentClient:pt,get Source(){return ze},StubExperimentClient:xt,initialize:gt,initializeWithAmplitudeAnalytics:bt}),Et=/^[a-zA-Z:_][a-zA-Z0-9:_.-]*$/,Pt={revert:function(){}},Ot=new Map,At=new Set;function It(e){var t=Ot.get(e);return t||(t={element:e,attributes:{}},Ot.set(e,t)),t}function Mt(e,t,r,i,n){var o=r(e),a={isDirty:!1,originalValue:o,virtualValue:o,mutations:[],el:e,_positionTimeout:null,rateLimitCount:0,observer:new MutationObserver((function(){if(!(a.rateLimitCount>=10||(a.rateLimitCount++,setTimeout((function(){a.rateLimitCount=a.rateLimitCount-1,a.rateLimitCount<=0&&(a.rateLimitCount=0)}),1e3),"position"===t&&a._positionTimeout))){"position"===t&&(a._positionTimeout=setTimeout((function(){a._positionTimeout=null}),1e3));var i=r(e);"position"===t&&i.parentNode===a.virtualValue.parentNode&&i.insertBeforeNode===a.virtualValue.insertBeforeNode||i!==a.virtualValue&&(a.originalValue=i,n(a))}})),mutationRunner:n,setValue:i,getCurrentValue:r};return"position"===t&&e.parentNode?a.observer.observe(e.parentNode,{childList:!0,subtree:!0,attributes:!1,characterData:!1}):a.observer.observe(e,function(e){return"html"===e?{childList:!0,subtree:!0,attributes:!0,characterData:!0}:{childList:!1,subtree:!1,attributes:!0,attributeFilter:[e]}}(t)),a}function Ct(e,t){var r=t.getCurrentValue(t.el);t.virtualValue=e,e&&"string"!=typeof e?r&&e.parentNode===r.parentNode&&e.insertBeforeNode===r.insertBeforeNode||(t.isDirty=!0,Gt()):e!==r&&(t.isDirty=!0,Gt())}function _t(e){var t=e.originalValue;e.mutations.forEach((function(e){return t=e.mutate(t)})),Ct(function(e){zt||(zt=document.createElement("div"));return zt.innerHTML=e,zt.innerHTML}(t),e)}function jt(e){var t=new Set(e.originalValue.split(/\s+/).filter(Boolean));e.mutations.forEach((function(e){return e.mutate(t)})),Ct(Array.from(t).filter(Boolean).join(" "),e)}function Tt(e){var t=e.originalValue;e.mutations.forEach((function(e){return t=e.mutate(t)})),Ct(t,e)}function Vt(e){var t=e.originalValue;e.mutations.forEach((function(e){var r=function(e){var t=e.parentSelector,r=e.insertBeforeSelector,i=document.querySelector(t);if(!i)return null;var n=r?document.querySelector(r):null;return r&&!n?null:{parentNode:i,insertBeforeNode:n}}(e.mutate());t=r||t})),Ct(t,e)}var Nt=function(e){return e.innerHTML},Ut=function(e,t){return e.innerHTML=t};function Rt(e){var t=It(e);return t.html||(t.html=Mt(e,"html",Nt,Ut,_t)),t.html}var Ft=function(e){return{parentNode:e.parentElement,insertBeforeNode:e.nextElementSibling}},Lt=function(e,t){t.insertBeforeNode&&!t.parentNode.contains(t.insertBeforeNode)||t.parentNode.insertBefore(e,t.insertBeforeNode)};function Dt(e){var t=It(e);return t.position||(t.position=Mt(e,"position",Ft,Lt,Vt)),t.position}var Kt=function(e,t){return t?e.className=t:e.removeAttribute("class")},Bt=function(e){return e.className};function qt(e){var t=It(e);return t.classes||(t.classes=Mt(e,"class",Bt,Kt,jt)),t.classes}var zt,Wt;function Jt(e,t){var r,i=It(e);return i.attributes[t]||(i.attributes[t]=Mt(e,t,(r=t,function(e){var t;return null!=(t=e.getAttribute(r))?t:null}),function(e){return function(t,r){return null!==r?t.setAttribute(e,r):t.removeAttribute(e)}}(t),Tt)),i.attributes[t]}function $t(e,t,r){if(r.isDirty){r.isDirty=!1;var i=r.virtualValue;r.mutations.length||function(e,t){var r,i,n=Ot.get(e);if(n)if("html"===t)null==(r=n.html)||null==(i=r.observer)||i.disconnect(),delete n.html;else if("class"===t){var o,a;null==(o=n.classes)||null==(a=o.observer)||a.disconnect(),delete n.classes}else if("position"===t){var s,l;null==(s=n.position)||null==(l=s.observer)||l.disconnect(),delete n.position}else{var u,c,d;null==(u=n.attributes)||null==(c=u[t])||null==(d=c.observer)||d.disconnect(),delete n.attributes[t]}}(e,t),r.setValue(e,i)}}function Ht(e,t){e.html&&$t(t,"html",e.html),e.classes&&$t(t,"class",e.classes),e.position&&$t(t,"position",e.position),Object.keys(e.attributes).forEach((function(r){$t(t,r,e.attributes[r])}))}function Gt(){Ot.forEach(Ht)}function Qt(e){if("position"!==e.kind||1!==e.elements.size){var t=new Set(e.elements);document.querySelectorAll(e.selector).forEach((function(r){t.has(r)||(e.elements.add(r),function(e,t){var r=null;"html"===e.kind?r=Rt(t):"class"===e.kind?r=qt(t):"attribute"===e.kind?r=Jt(t,e.attribute):"position"===e.kind&&(r=Dt(t)),r&&(r.mutations.push(e),r.mutationRunner(r))}(e,r))}))}}function Xt(e){e.elements.forEach((function(t){return function(e,t){var r=null;if("html"===e.kind?r=Rt(t):"class"===e.kind?r=qt(t):"attribute"===e.kind?r=Jt(t,e.attribute):"position"===e.kind&&(r=Dt(t)),r){var i=r.mutations.indexOf(e);-1!==i&&r.mutations.splice(i,1),r.mutationRunner(r)}}(e,t)})),e.elements.clear(),At.delete(e)}function Zt(){At.forEach(Qt)}function Yt(e){return"undefined"==typeof document?Pt:(At.add(e),Qt(e),{revert:function(){Xt(e)}})}function er(e,t){return Yt({kind:"html",elements:new Set,mutate:t,selector:e})}function tr(e,t){return Yt({kind:"position",elements:new Set,mutate:t,selector:e})}function rr(e,t){return Yt({kind:"class",elements:new Set,mutate:t,selector:e})}function ir(e,t,r){return Et.test(t)?"class"===t||"className"===t?rr(e,(function(e){var t=r(Array.from(e).join(" "));e.clear(),t&&t.split(/\s+/g).filter(Boolean).forEach((function(t){return e.add(t)}))})):Yt({kind:"attribute",attribute:t,elements:new Set,mutate:r,selector:e}):Pt}"undefined"!=typeof document&&(Wt||(Wt=new MutationObserver((function(){Zt()}))),Zt(),Wt.observe(document.documentElement,{childList:!0,subtree:!0,attributes:!1,characterData:!1}));var nr={html:er,classes:rr,attribute:ir,position:tr,declarative:function(e){var t=e.selector,r=e.action,i=e.value,n=e.attribute,o=e.parentSelector,a=e.insertBeforeSelector;if("html"===n){if("append"===r)return er(t,(function(e){return e+(null!=i?i:"")}));if("set"===r)return er(t,(function(){return null!=i?i:""}))}else if("class"===n){if("append"===r)return rr(t,(function(e){i&&e.add(i)}));if("remove"===r)return rr(t,(function(e){i&&e.delete(i)}));if("set"===r)return rr(t,(function(e){e.clear(),i&&e.add(i)}))}else if("position"===n){if("set"===r&&o)return tr(t,(function(){return{insertBeforeSelector:a,parentSelector:o}}))}else{if("append"===r)return ir(t,n,(function(e){return null!==e?e+(null!=i?i:""):null!=i?i:""}));if("set"===r)return ir(t,n,(function(){return null!=i?i:""}));if("remove"===r)return ir(t,n,(function(){return null}))}return Pt}},or=function(){function e(){this.messageToSubscriberGroup=new Map,this.subscriberGroupCallback=new Map}return e.prototype.subscribe=function(e,t,r,i){void 0===r&&(r=void 0);var n=this.messageToSubscriberGroup.get(e);n||(n={subscribers:[]},this.messageToSubscriberGroup.set(e,n),i&&this.subscriberGroupCallback.set(e,i));var o={identifier:r,callback:t};n.subscribers.push(o)},e.prototype.publish=function(e,t){var r,i=this.messageToSubscriberGroup.get(e);i&&(i.subscribers.forEach((function(e){t=t||{},e.callback(t)})),null===(r=this.subscriberGroupCallback.get(e))||void 0===r||r(t))},e.prototype.unsubscribeAll=function(){this.messageToSubscriberGroup=new Map,this.subscriberGroupCallback=new Map},e}();var ar={observerOptions:{childList:!0,subtree:!0,attributes:!0,attributeFilter:["style","class"]},debounceMs:150},sr=function(){function e(r,i,n,s){void 0===n&&(n=[]),void 0===s&&(s={});var l=this;this.mutationObserver=null,this.pendingMutations=[],this.processMutationsImmediately=function(){if(l.mutationObserver)try{l.pendingMutations.length>0&&l.onMutations(l.pendingMutations)}catch(e){}finally{l.pendingMutations=[]}},this.handleMutations=function(t){var r,i;try{var n=t.filter((function(e){return l.shouldProcessMutation(e)}));if(0===n.length)return;if(l.pendingMutations.length+n.length>e.MAX_PENDING_MUTATIONS)return(r=l.pendingMutations).push.apply(r,a([],o(n),!1)),l.processMutationsDebounced.cancel(),void l.processMutationsImmediately();(i=l.pendingMutations).push.apply(i,a([],o(n),!1)),l.processMutationsDebounced()}catch(e){}},this.target=r,this.onMutations=i,this.filters=n,this.options=t(t({},ar),s),this.processMutationsDebounced=function(e,t,r){void 0===r&&(r={});var i=null,n=null,s=function(){for(var s=[],l=0;l<arguments.length;l++)s[l]=arguments[l];r.maxWait&&!n&&(n=setTimeout((function(){i&&(clearTimeout(i),i=null),n=null,e.apply(void 0,a([],o(s),!1))}),r.maxWait)),i&&clearTimeout(i),i=setTimeout((function(){n&&(clearTimeout(n),n=null),e.apply(void 0,a([],o(s),!1))}),t)};return s.cancel=function(){i&&clearTimeout(i),n&&clearTimeout(n),i=null,n=null},s}(this.processMutationsImmediately,this.options.debounceMs,{maxWait:2*this.options.debounceMs})}return e.prototype.shouldProcessMutation=function(e){if(0===this.filters.length)return!0;try{return this.filters.every((function(t){return t(e)}))}catch(e){return!1}},e.prototype.cleanup=function(){var e;this.processMutationsDebounced.cancel(),null===(e=this.mutationObserver)||void 0===e||e.disconnect(),this.pendingMutations=[],this.mutationObserver=null},e.prototype.observe=function(){var e=this;return this.mutationObserver&&this.cleanup(),this.mutationObserver=new MutationObserver(this.handleMutations),this.mutationObserver.observe(this.target,this.options.observerOptions),function(){e.cleanup()}},e.MAX_PENDING_MUTATIONS=1e3,e}(),lr=new re,ur=function(e,r,i,a,s){var l=this;this.pageChangeSubscribers=new Set,this.lastNotifiedActivePages={},this.setPageObjects=function(e){l.pageObjects=e},this.initSubscriptions=function(){l.options.useDefaultNavigationHandler&&l.setupLocationChangePublisher(),l.setupPageObjectSubscriptions()},this.addPageChangeSubscriber=function(e){return l.pageChangeSubscribers.add(e),function(){l.pageChangeSubscribers.delete(e)}},this.setupPageObjectSubscriptions=function(){var e,t,r=function(e,t){var r,i,o=function(t){l.messageBus.subscribe(t.trigger_type,(function(r){l.isPageObjectActive(t,r)?l.webExperimentClient.updateActivePages(e,t,!0):l.webExperimentClient.updateActivePages(e,t,!1)}),void 0,(function(e){var r,i;if(!("updateActivePages"in e&&e.updateActivePages||l.options.isVisualEditorMode)){if("url_change"===t.trigger_type){Object.values(l.webExperimentClient.appliedMutations).forEach((function(e){Object.values(e).forEach((function(e){e[mr]&&Object.values(e[mr]).forEach((function(e){var t;null===(t=e.revert)||void 0===t||t.call(e)}))}))}));var o=l.webExperimentClient.appliedMutations;Object.keys(o).forEach((function(e){var t=o[e];Object.keys(t).forEach((function(e){t[e][mr]&&(delete t[e][mr],0===Object.keys(t[e]).length&&delete t[e])})),0===Object.keys(t).length&&delete o[e]}))}l.webExperimentClient.applyVariants()}var a=l.webExperimentClient.getActivePages();if(!l.areActivePagesEqual(a,l.lastNotifiedActivePages)){l.lastNotifiedActivePages=l.cloneActivePagesMap(a);try{for(var s=(r=void 0,n(l.pageChangeSubscribers)),u=s.next();!u.done;u=s.next())(0,u.value)({activePages:a})}catch(e){r={error:e}}finally{try{u&&!u.done&&(i=s.return)&&i.call(s)}finally{if(r)throw r.error}}}}))};try{for(var a=(r=void 0,n(Object.values(t))),s=a.next();!s.done;s=a.next())o(s.value)}catch(e){r={error:e}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}};try{for(var i=n(Object.entries(l.pageObjects)),a=i.next();!a.done;a=i.next()){var s=o(a.value,2);r(s[0],s[1])}}catch(t){e={error:t}}finally{try{a&&!a.done&&(t=i.return)&&t.call(i)}finally{if(e)throw e.error}}},this.setupMutationObserverPublisher=function(){return new sr(l.globalScope.document.documentElement,(function(e){l.messageBus.publish("element_appeared",{mutationList:e})}),[]).observe()},this.setupLocationChangePublisher=function(){l.globalScope.addEventListener("popstate",(function(){l.messageBus.publish("url_change")}));var e,t,r=function(){l.messageBus.publish("url_change"),l.globalScope.webExperiment.previousUrl=l.globalScope.location.href};e=history.pushState,t=history.replaceState,history.pushState=function(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];var n=e.apply(this,t);return r(),n},history.replaceState=function(){for(var e=[],i=0;i<arguments.length;i++)e[i]=arguments[i];var n=t.apply(this,e);return r(),n}},this.isPageObjectActive=function(e,t){if(e.conditions&&e.conditions.length>0&&!lr.evaluateConditions({context:{page:{url:l.globalScope.location.href}},result:{}},e.conditions))return!1;switch(e.trigger_type){case"url_change":return!0;case"manual":return t.name===e.trigger_value.name;case"analytics_event":var r=t;return r.event_type===e.trigger_value.event_type&&Object.entries(e.trigger_value.event_properties||{}).every((function(e){var t=o(e,2),i=t[0],n=t[1];return r.event_properties[i]===n}));case"element_appeared":var i=l.globalScope.document.querySelector(e.trigger_value.selector);if(i){var n=window.getComputedStyle(i);return"none"!==n.display&&"hidden"!==n.visibility}return!1;default:return!1}},this.cloneActivePagesMap=function(e){var r={};for(var i in e)for(var n in r[i]={},e[i])r[i][n]=t({},e[i][n]);return r},this.areActivePagesEqual=function(e,t){var r,i,o,a,s=Object.keys(e),l=Object.keys(t);if(s.length!==l.length)return!1;try{for(var u=n(s),c=u.next();!c.done;c=u.next()){var d=c.value,h=e[d],f=t[d];if(!f)return!1;var p=Object.keys(h),v=Object.keys(f);if(p.length!==v.length)return!1;try{for(var y=(o=void 0,n(p)),g=y.next();!g.done;g=y.next()){var b=g.value,m=h[b],w=f[b];if(!w||m.id!==w.id)return!1}}catch(e){o={error:e}}finally{try{g&&!g.done&&(a=y.return)&&a.call(y)}finally{if(o)throw o.error}}}}catch(e){r={error:e}}finally{try{c&&!c.done&&(i=u.return)&&i.call(u)}finally{if(r)throw r.error}}return!0},this.webExperimentClient=e,this.messageBus=r,this.pageObjects=i,this.options=a,this.globalScope=s},cr={useDefaultNavigationHandler:!0},dr=function(){function e(){}return e.setup=function(){var e,t="closed";null===(e=Ie())||void 0===e||e.addEventListener("message",(function(e){var r=/^.*\.amplitude\.com$/;try{if(!e.origin||!r.test(new URL(e.origin).hostname))return}catch(e){return}if("OpenOverlay"===e.data.type){if("closed"!==t||!r.test(new URL(e.data.context.injectSrc).hostname))return;t="opening",hr(e.data.context.injectSrc).then((function(){t="open"})).catch((function(){t="closed"}))}}))},e}(),hr=function(e){return new Promise((function(t,r){var i;try{var n=document.createElement("script");n.type="text/javascript",n.async=!0,n.src=e;var o=document.querySelector("[nonce]");o&&n.setAttribute("nonce",o.nonce||o.nonce||o.getAttribute("nonce")),n.addEventListener("load",(function(){t({status:!0})}),{once:!0}),n.addEventListener("error",(function(){r({status:!1,message:"Failed to load the script ".concat(e)})})),null===(i=document.head)||void 0===i||i.appendChild(n)}catch(e){r(e)}}))},fr=function(){var e,t,r=Ie(),i=new URLSearchParams(null==r?void 0:r.location.search),a={};try{for(var s=n(i),l=s.next();!l.done;l=s.next()){var u=o(l.value,2),c=u[0],d=u[1];a[c]=d}}catch(t){e={error:t}}finally{try{l&&!l.done&&(t=s.return)&&t.call(s)}finally{if(e)throw e.error}}return a},pr=function(e){if(!e)return"";var t=new URL(e);return t.search="",t.hash="",t.toString()},vr=function(e,t){var r,i,o=new URL(e);try{for(var a=n(t),s=a.next();!s.done;s=a.next()){var l=s.value;o.searchParams.delete(l)}}catch(e){r={error:e}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}return o.toString()},yr=function(e,t){return t=t.replace(/\/$/,""),e.some((function(e){e=(e=(e=e.replace(/\/$/,"")).replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).replace(/\\\*/,".*");var r=new RegExp("^".concat(e,"$"));return r.test(t)||r.test(t+"/")}))},gr=function(e){return e?(e^16*Math.random()>>e/4).toString(16):(String(1e7)+String(-1e3)+String(-4e3)+String(-8e3)+String(-1e11)).replace(/[018]/g,gr)},br="mutate",mr="inject";Ae.Experiment=kt;var wr=function(){function e(e,r,i,n){void 0===n&&(n={});var o,a=this;this.appliedInjections=new Set,this.appliedMutations={},this.previousUrl=void 0,this.urlExposureCache={},this.flagVariantMap={},this.localFlagKeys=[],this.remoteFlagKeys=[],this.isRemoteBlocking=!1,this.isRunning=!1,this.activePages={},this.isVisualEditorMode=!1;var s=Ie();if(!s||!Me())throw new Error("Amplitude Web Experiment Client could not be initialized.");this.globalScope=s,this.apiKey=e,this.initialFlags=JSON.parse(r),this.pageObjects=JSON.parse(i),this.config=t(t(t({},cr),n),null!==(o=this.globalScope.experimentConfig)&&void 0!==o?o:{});var l=fr();this.initialFlags.forEach((function(e){var t=e.key,r=e.variants,i=e.metadata,n=void 0===i?{}:i;if(a.flagVariantMap[t]={},Object.keys(r).forEach((function(e){a.flagVariantMap[t][e]=function(e){if(!e)return{};var t=void 0;e.metadata&&(t="string"==typeof e.metadata.experimentKey?e.metadata.experimentKey:void 0);var r={};return e.key&&(r.key=e.key),e.value&&(r.value=e.value),e.payload&&(r.payload=e.payload),t&&(r.expKey=t),e.metadata&&(r.metadata=e.metadata),r}(r[e])})),l.PREVIEW&&t in l&&l[t]in r){a.globalScope.history.replaceState({},"",vr(a.globalScope.location.href,["PREVIEW",t]));var o={metadata:{segmentName:"Preview"},variant:l[t]};e.segments=[o],n.evaluationMode="local"}"local"!==n.evaluationMode&&a.remoteFlagKeys.push(t),e.metadata=n}));var u=JSON.stringify(this.initialFlags);this.experimentClient=St.initialize(this.apiKey,t({internalInstanceNameSuffix:"web",initialFlags:u,fetchTimeoutMillis:1e3,pollOnStart:!1,fetchOnStart:!1,automaticExposureTracking:!1},this.config));var c=this.experimentClient.all();this.localFlagKeys=Object.keys(c).filter((function(e){var t,r;return"local"===(null===(r=null===(t=c[e])||void 0===t?void 0:t.metadata)||void 0===r?void 0:r.evaluationMode)})),this.messageBus=new or}return e.prototype.start=function(){return r(this,void 0,void 0,(function(){var e,r,a,s,l,u,c,d,h,f,p,v,g,b,m,w;return i(this,(function(i){switch(i.label){case 0:if(this.isRunning)return[2];if(e=fr(),this.isVisualEditorMode="true"===e.VISUAL_EDITOR,this.subscriptionManager=new ur(this,this.messageBus,this.pageObjects,t(t({},this.config),{isVisualEditorMode:this.isVisualEditorMode}),this.globalScope),this.subscriptionManager.initSubscriptions(),this.isVisualEditorMode)return dr.setup(),this.globalScope.history.replaceState({},"",vr(this.globalScope.location.href,["VISUAL_EDITOR"])),this.messageBus.publish("url_change",{updateActivePages:!0}),this.isRunning=!0,[2];this.messageBus.publish("url_change",{updateActivePages:!0}),r="EXP_".concat(this.apiKey.slice(0,10));try{a=JSON.parse(this.globalScope.localStorage.getItem(r)||"{}")}catch(e){a={}}a.web_exp_id?a.web_exp_id&&a.device_id&&(delete a.device_id,this.globalScope.localStorage.setItem(r,JSON.stringify(a))):(a.web_exp_id=a.device_id||gr(),delete a.device_id,this.globalScope.localStorage.setItem(r,JSON.stringify(a))),s=this.getVariants();try{for(l=n(Object.entries(s)),u=l.next();!u.done;u=l.next())c=o(u.value,2),d=c[0],h=c[1],this.remoteFlagKeys.includes(d)&&(null===(g=h.metadata)||void 0===g?void 0:g.blockingEvaluation)&&Object.keys(this.activePages).includes(d)&&(this.isRemoteBlocking=!0,this.applyAntiFlickerCss())}catch(e){p={error:e}}finally{try{u&&!u.done&&(v=l.return)&&v.call(l)}finally{if(p)throw p.error}}return this.globalScope.experimentIntegration||(f=y.getInstance("$default_instance"),this.globalScope.experimentIntegration=new qe(this.apiKey,f,1e3)),this.globalScope.experimentIntegration.type="integration",this.experimentClient.addPlugin(this.globalScope.experimentIntegration),this.experimentClient.setUser(a),this.isRemoteBlocking||null===(w=null===(m=(b=this.globalScope.document).getElementById)||void 0===m?void 0:m.call(b,"amp-exp-css"))||void 0===w||w.remove(),this.applyVariants({flagKeys:this.localFlagKeys}),0===this.remoteFlagKeys.length?(this.isRunning=!0,[2]):[4,this.fetchRemoteFlags()];case 1:return i.sent(),this.applyVariants({flagKeys:this.remoteFlagKeys}),this.isRunning=!0,[2]}}))}))},e.getInstance=function(t,r,i,n){void 0===n&&(n={});var o=Ie();if(!o)throw new Error("Amplitude Web Experiment Client could not be initialized.");if(null==o?void 0:o.webExperiment)return o.webExperiment;var a=new e(t,r,i,n);return o.webExperiment=a,a},e.prototype.getExperimentClient=function(){return this.experimentClient},e.prototype.applyVariants=function(e){var t,r,i=(e||{}).flagKeys,n=this.getVariants();if(0!==Object.keys(n).length){var o=pr(this.globalScope.location.href);for(var a in(null===(t=this.urlExposureCache)||void 0===t?void 0:t[o])||(this.urlExposureCache={},this.urlExposureCache[o]={}),this.fireStoredRedirectImpressions(),n)if(!i||i.includes(a)){var s=n[a],l=s.key||"";if(this.appliedMutations[a]){var u=Object.keys(this.appliedMutations[a]);u.length>0&&!u.includes(l)&&(this.revertVariants({flagKeys:[a]}),delete this.appliedMutations[a])}if("web"===(null===(r=s.metadata)||void 0===r?void 0:r.deliveryMethod)){var c=Array.isArray(s.payload);if(("off"===s.key||"control"===s.key)&&(this.isActionActiveOnPage(a,void 0)&&this.exposureWithDedupe(a,s),"off"===s.key)){this.revertVariants({flagKeys:[a]});continue}c&&this.handleVariantAction(a,s)}}}},e.prototype.revertVariants=function(e){var t,r,i,o;if(this.appliedMutations){var a=(e||{}).flagKeys;a||(a=Object.keys(this.appliedMutations));try{for(var s=n(a),l=s.next();!l.done;l=s.next()){var u=l.value,c=this.appliedMutations[u];if(c){for(var d in c){var h=c[d];if(h)for(var f in h)for(var p in h[f])null===(o=null===(i=h[f][p])||void 0===i?void 0:i.revert)||void 0===o||o.call(i)}delete this.appliedMutations[u]}}}catch(e){t={error:e}}finally{try{l&&!l.done&&(r=s.return)&&r.call(s)}finally{if(t)throw t.error}}}},e.prototype.previewVariants=function(e){var t=e.keyToVariant;if(t)for(var r in this.revertVariants({flagKeys:Object.keys(t)}),t){var i=t[r],n=this.flagVariantMap[r];if(!n)return;var o=n[i];if(!o)return;var a=o.payload;if(!a||!Array.isArray(a))return;this.handleVariantAction(r,o)}},e.prototype.getVariants=function(){var e,t,r={};try{for(var i=n(a(a([],o(this.localFlagKeys),!1),o(this.remoteFlagKeys),!1)),s=i.next();!s.done;s=i.next()){var l=s.value;r[l]=this.experimentClient.variant(l)}}catch(t){e={error:t}}finally{try{s&&!s.done&&(t=i.return)&&t.call(i)}finally{if(e)throw e.error}}return r},e.prototype.getActiveExperiments=function(){return Object.keys(this.appliedMutations)},e.prototype.getActivePages=function(){return this.activePages},e.prototype.addPageChangeSubscriber=function(e){if(this.subscriptionManager)return this.subscriptionManager.addPageChangeSubscriber(e)},e.prototype.setPageObjects=function(e){var t,r;this.isVisualEditorMode&&(this.pageObjects=e,null===(t=this.subscriptionManager)||void 0===t||t.setPageObjects(e),this.activePages={},this.messageBus.unsubscribeAll(),null===(r=this.subscriptionManager)||void 0===r||r.initSubscriptions(),this.messageBus.publish("url_change",{updateActivePages:!0}))},e.prototype.setRedirectHandler=function(e){this.customRedirectHandler=e},e.prototype.fetchRemoteFlags=function(){return r(this,void 0,void 0,(function(){var e;return i(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,this.experimentClient.doFlags()];case 1:return t.sent(),[3,3];case 2:return e=t.sent(),console.warn("Error fetching remote flags:",e),[3,3];case 3:return[2]}}))}))},e.prototype.handleVariantAction=function(e,t){var r,i;try{for(var o=n(t.payload),a=o.next();!a.done;a=o.next()){var s=a.value;"redirect"===s.action?this.handleRedirect(s,e,t):s.action===br?this.handleMutate(s,e,t):s.action===mr&&this.handleInject(s,e,t)}}catch(e){r={error:e}}finally{try{a&&!a.done&&(i=o.return)&&i.call(o)}finally{if(r)throw r.error}}},e.prototype.handleRedirect=function(e,t,r){var i,n,o;if(this.isActionActiveOnPage(t,null===(n=null===(i=null==e?void 0:e.data)||void 0===i?void 0:i.metadata)||void 0===n?void 0:n.scope)){var a=pr(this.previousUrl||this.globalScope.document.referrer),s=null===(o=null==e?void 0:e.data)||void 0===o?void 0:o.url;if(pr(this.globalScope.location.href)!==a){var l=function(e,t){var r=new URL(e),i=new URL(t),n=new URL(t);return r.searchParams.forEach((function(e,t){i.searchParams.has(t)||n.searchParams.append(t,e)})),n.toString()}(this.globalScope.location.href,s);this.globalScope.location.href!==l&&(this.storeRedirectImpressions(t,r,s),this.previousUrl=this.globalScope.location.href,this.customRedirectHandler?this.customRedirectHandler(l):this.globalScope.location.replace(l))}}},e.prototype.handleMutate=function(e,r,i){var n,o,a,s,l,u=this,c=(null===(n=e.data)||void 0===n?void 0:n.mutations)||[],d=i.key||"";if(0!==c.length){var h={};c.forEach((function(e,t){var n,o,a,s,l,c,f,p,v,y,g;u.isActionActiveOnPage(r,null===(n=null==e?void 0:e.metadata)||void 0===n?void 0:n.scope)?(u.exposureWithDedupe(r,i),(null===(g=null===(y=null===(v=u.appliedMutations[r])||void 0===v?void 0:v[d])||void 0===y?void 0:y[br])||void 0===g?void 0:g[t])||(h[t]=nr.declarative(e))):(null===(s=null===(a=null===(o=u.appliedMutations[r])||void 0===o?void 0:o[d])||void 0===a?void 0:a[br])||void 0===s?void 0:s[t])&&(null===(p=null===(f=null===(c=null===(l=u.appliedMutations[r])||void 0===l?void 0:l[d])||void 0===c?void 0:c[br])||void 0===f?void 0:f[t])||void 0===p||p.revert(),delete u.appliedMutations[r][d][br][t])})),null!==(o=(s=this.appliedMutations)[r])&&void 0!==o||(s[r]={}),null!==(a=(l=this.appliedMutations[r])[d])&&void 0!==a||(l[d]={}),this.appliedMutations[r][d][br]=t(t({},this.appliedMutations[r][d][br]),h),0===Object.keys(this.appliedMutations[r][d][br]||{}).length&&delete this.appliedMutations[r][d][br],0===Object.keys(this.appliedMutations[r][d]||{}).length&&delete this.appliedMutations[r]}},e.prototype.handleInject=function(e,t,n){var o,a,s,l,u,c,d,h,f,p,v,y,g=this,b=n.key||"";if(this.isActionActiveOnPage(t,null===(o=null==e?void 0:e.metadata)||void 0===o?void 0:o.scope)){var m=e.data.id;if(m&&"string"==typeof m&&0!==m.length&&(m=m.replace(/-/g,""),!this.appliedInjections.has(m))){var w,S=e.data.js;S&&(w=this.globalScope.document.createElement("script"))&&(w.innerHTML="function ".concat(m,"(html, utils, id){").concat(S,"};"),w.id="js-".concat(m),this.globalScope.document.head.appendChild(w));var x,k=e.data.css;k&&(x=this.globalScope.document.createElement("style"))&&(x.innerHTML=k,x.id="css-".concat(m),this.globalScope.document.head.appendChild(x));var E,P=e.data.html;P&&(E=null!==(c=(new DOMParser).parseFromString(P,"text/html").body.firstElementChild)&&void 0!==c?c:void 0);var O={waitForElement:function(e){return r(this,void 0,void 0,(function(){var t;return i(this,(function(r){return(t=document.querySelector(e))?[2,t]:[2,new Promise((function(t){var r=new MutationObserver((function(){var i=document.querySelector(e);i&&(r.disconnect(),t(i))}));r.observe(document.documentElement,{childList:!0,subtree:!0,attributes:!0})}))]}))}))}};this.appliedInjections.add(m);try{var A=this.globalScope[m];A&&"function"==typeof A&&A(E,O,m)}catch(e){null==w||w.remove(),console.error("Experiment inject failed for ".concat(t," variant ").concat(n.key,". Reason:"),e)}null!==(d=(p=this.appliedMutations)[t])&&void 0!==d||(p[t]={}),null!==(h=(v=this.appliedMutations[t])[b])&&void 0!==h||(v[b]={}),null!==(f=(y=this.appliedMutations[t][b])[mr])&&void 0!==f||(y[mr]={}),this.appliedMutations[t][b][mr][m]={revert:function(){var e;null===(e=O.remove)||void 0===e||e.call(O),null==x||x.remove(),null==w||w.remove(),g.appliedInjections.delete(m)}},this.exposureWithDedupe(t,n)}}else null===(u=null===(l=null===(s=null===(a=this.appliedMutations[t])||void 0===a?void 0:a[b])||void 0===s?void 0:s[mr])||void 0===l?void 0:l[0])||void 0===u||u.revert()},e.prototype.exposureWithDedupe=function(e,t,r){var i,n,o=pr(this.globalScope.location.href);if(!((null===(n=null===(i=this.urlExposureCache)||void 0===i?void 0:i[o])||void 0===n?void 0:n[e])===t.key)){if(r){var a={variant:t,source:"local-evaluation",hasDefaultVariant:!1};this.experimentClient.exposureInternal(e,a)}else this.experimentClient.exposure(e);this.urlExposureCache[o][e]=t.key}},e.prototype.applyAntiFlickerCss=function(){if(!this.globalScope.document.getElementById("amp-exp-css")){var e=document.createElement("style");e.id="amp-exp-css",e.innerText="* { visibility: hidden !important; background-image: none !important; }",document.head.appendChild(e),this.globalScope.window.setTimeout((function(){e.remove()}),1e3)}},e.prototype.updateActivePages=function(e,t,r){this.activePages[e]||(this.activePages[e]={}),r?this.activePages[e][t.id]=t:(delete this.activePages[e][t.id],0===Object.keys(this.activePages[e]).length&&delete this.activePages[e])},e.prototype.isActionActiveOnPage=function(e,t){var r=this.activePages[e];return t?t.some((function(e){var t;return null!==(t=null==r?void 0:r[e])&&void 0!==t&&t})):!!r&&Object.values(r).some(Boolean)},e.prototype.storeRedirectImpressions=function(e,t,r){var i="EXP_".concat(this.apiKey.slice(0,10),"_REDIRECT");try{var n=JSON.parse(this.globalScope.sessionStorage.getItem(i)||"{}");n[e]={redirectUrl:r,variant:t},this.globalScope.sessionStorage.setItem(i,JSON.stringify(n))}catch(e){console.warn("Error storing redirect information:",e)}},e.prototype.fireStoredRedirectImpressions=function(){var e=this,t="EXP_".concat(this.apiKey.slice(0,10),"_REDIRECT");try{var r=JSON.parse(this.globalScope.sessionStorage.getItem(t)||"{}");if(Object.keys(r).length>0)for(var i in r){var n=r[i],o=n.redirectUrl,a=n.variant,s=pr(this.globalScope.location.href),l=pr(o);yr([s],l)&&(this.exposureWithDedupe(i,a,!0),delete r[i])}Object.keys(r).length>0?this.globalScope.setTimeout((function(){try{var r=JSON.parse(e.globalScope.sessionStorage.getItem(t)||"{}");for(var i in r)e.exposureWithDedupe(i,r[i].variant,!0);e.globalScope.sessionStorage.removeItem(t)}catch(e){console.warn("Error processing stored redirects events:",e)}}),500):this.globalScope.sessionStorage.removeItem(t)}catch(e){console.warn("Error processing stored redirects events:",e)}},e}();e.initialize=function(e,t,r,i){wr.getInstance(e,t,r,i).start().finally((function(){var e;null===(e=document.getElementById("amp-exp-css"))||void 0===e||e.remove()}))},Object.defineProperty(e,"__esModule",{value:!0})}));
|
|
Binary file
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { ExperimentClient, Variants } from '@amplitude/experiment-js-client';
|
|
2
|
+
import { MutationController } from 'dom-mutator';
|
|
3
|
+
import { PageChangeEvent } from './subscriptions';
|
|
4
|
+
import { WebExperimentClient, WebExperimentConfig } from './types';
|
|
5
|
+
import { ApplyVariantsOptions, PageObject, PageObjects, PreviewVariantsOptions, RevertVariantsOptions } from './types';
|
|
6
|
+
export declare const PREVIEW_SEGMENT_NAME = "Preview";
|
|
7
|
+
export declare const INJECT_ACTION = "inject";
|
|
8
|
+
export declare class DefaultWebExperimentClient implements WebExperimentClient {
|
|
9
|
+
private readonly apiKey;
|
|
10
|
+
private readonly initialFlags;
|
|
11
|
+
private readonly config;
|
|
12
|
+
private readonly globalScope;
|
|
13
|
+
private readonly experimentClient;
|
|
14
|
+
private appliedInjections;
|
|
15
|
+
appliedMutations: {
|
|
16
|
+
[experiment: string]: {
|
|
17
|
+
[variantKey: string]: {
|
|
18
|
+
[actionType: string]: {
|
|
19
|
+
[id: string]: MutationController;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
private previousUrl;
|
|
25
|
+
private urlExposureCache;
|
|
26
|
+
private flagVariantMap;
|
|
27
|
+
private readonly localFlagKeys;
|
|
28
|
+
private remoteFlagKeys;
|
|
29
|
+
private isRemoteBlocking;
|
|
30
|
+
private customRedirectHandler;
|
|
31
|
+
private isRunning;
|
|
32
|
+
private readonly messageBus;
|
|
33
|
+
private pageObjects;
|
|
34
|
+
private activePages;
|
|
35
|
+
private subscriptionManager;
|
|
36
|
+
private isVisualEditorMode;
|
|
37
|
+
constructor(apiKey: string, initialFlags: string, pageObjects: string, config?: WebExperimentConfig);
|
|
38
|
+
/**
|
|
39
|
+
* Start the web experiment client.
|
|
40
|
+
*/
|
|
41
|
+
start(): Promise<void>;
|
|
42
|
+
/**
|
|
43
|
+
* Get singleton of the {@link DefaultWebExperimentClient} if it has already been initialized.
|
|
44
|
+
* If not, initialize the client and return the instance.
|
|
45
|
+
* @param apiKey
|
|
46
|
+
* @param initialFlags
|
|
47
|
+
* @param pageObjects
|
|
48
|
+
* @param config
|
|
49
|
+
*/
|
|
50
|
+
static getInstance(apiKey: string, initialFlags: string, pageObjects: string, config?: WebExperimentConfig): DefaultWebExperimentClient;
|
|
51
|
+
/**
|
|
52
|
+
* Get the underlying {@link ExperimentClient} instance.
|
|
53
|
+
*/
|
|
54
|
+
getExperimentClient(): ExperimentClient;
|
|
55
|
+
/**
|
|
56
|
+
* Apply evaluated variants to the page.
|
|
57
|
+
* @param options
|
|
58
|
+
*/
|
|
59
|
+
applyVariants(options?: ApplyVariantsOptions): void;
|
|
60
|
+
/**
|
|
61
|
+
* Revert variant actions applied by the experiment.
|
|
62
|
+
* @param options
|
|
63
|
+
*/
|
|
64
|
+
revertVariants(options?: RevertVariantsOptions): void;
|
|
65
|
+
/**
|
|
66
|
+
* Preview the effect of a variant on the page.
|
|
67
|
+
* @param options
|
|
68
|
+
*/
|
|
69
|
+
previewVariants(options: PreviewVariantsOptions): void;
|
|
70
|
+
/**
|
|
71
|
+
* Get all variants for the current web experiment user context.
|
|
72
|
+
*/
|
|
73
|
+
getVariants(): Variants;
|
|
74
|
+
/**
|
|
75
|
+
* Get the list of experiments with active mutations or injects on the current page.
|
|
76
|
+
*/
|
|
77
|
+
getActiveExperiments(): string[];
|
|
78
|
+
/**
|
|
79
|
+
* Get a map of active page view objects.
|
|
80
|
+
*/
|
|
81
|
+
getActivePages(): PageObjects;
|
|
82
|
+
/**
|
|
83
|
+
* Add a subscriber to the page change event.
|
|
84
|
+
* @param callback
|
|
85
|
+
* @returns An unsubscribe function to remove the subscriber.
|
|
86
|
+
*/
|
|
87
|
+
addPageChangeSubscriber(callback: (event: PageChangeEvent) => void): (() => void) | undefined;
|
|
88
|
+
/**
|
|
89
|
+
* When in visual editor mode, update the current page objects and reinitialize subscriptions and active pages.
|
|
90
|
+
*
|
|
91
|
+
* @param {PageObjects} pageObjects - The new set of page objects to be set.
|
|
92
|
+
*/
|
|
93
|
+
setPageObjects(pageObjects: PageObjects): void;
|
|
94
|
+
/**
|
|
95
|
+
* Set a custom redirect handler.
|
|
96
|
+
*/
|
|
97
|
+
setRedirectHandler(handler: (url: string) => void): void;
|
|
98
|
+
private fetchRemoteFlags;
|
|
99
|
+
private handleVariantAction;
|
|
100
|
+
private handleRedirect;
|
|
101
|
+
private handleMutate;
|
|
102
|
+
private handleInject;
|
|
103
|
+
private exposureWithDedupe;
|
|
104
|
+
private applyAntiFlickerCss;
|
|
105
|
+
updateActivePages(flagKey: string, page: PageObject, isActive: boolean): void;
|
|
106
|
+
private isActionActiveOnPage;
|
|
107
|
+
private storeRedirectImpressions;
|
|
108
|
+
private fireStoredRedirectImpressions;
|
|
109
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { WebExperimentConfig } from './types';
|
|
2
|
+
export declare const initialize: (apiKey: string, initialFlags: string, pageObjects: string, config: WebExperimentConfig) => void;
|
|
3
|
+
export { ApplyVariantsOptions, RevertVariantsOptions, PreviewVariantsOptions, WebExperimentClient, WebExperimentConfig, } from 'types';
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export interface EventProperties {
|
|
2
|
+
[k: string]: unknown;
|
|
3
|
+
}
|
|
4
|
+
export interface AnalyticsEvent {
|
|
5
|
+
event_type: string;
|
|
6
|
+
event_properties: EventProperties;
|
|
7
|
+
}
|
|
8
|
+
type Subscriber<T extends MessageType> = {
|
|
9
|
+
identifier?: string;
|
|
10
|
+
callback: (payload: MessagePayloads[T]) => void;
|
|
11
|
+
};
|
|
12
|
+
export type ElementAppearedPayload = {
|
|
13
|
+
mutationList: MutationRecord[];
|
|
14
|
+
};
|
|
15
|
+
export type AnalyticsEventPayload = AnalyticsEvent;
|
|
16
|
+
export type ManualTriggerPayload = {
|
|
17
|
+
name: string;
|
|
18
|
+
};
|
|
19
|
+
export type UrlChangePayload = {
|
|
20
|
+
updateActivePages?: boolean;
|
|
21
|
+
};
|
|
22
|
+
export type MessagePayloads = {
|
|
23
|
+
element_appeared: ElementAppearedPayload;
|
|
24
|
+
url_change: UrlChangePayload;
|
|
25
|
+
analytics_event: AnalyticsEventPayload;
|
|
26
|
+
manual: ManualTriggerPayload;
|
|
27
|
+
};
|
|
28
|
+
export type MessageType = keyof MessagePayloads;
|
|
29
|
+
export declare class MessageBus {
|
|
30
|
+
private messageToSubscriberGroup;
|
|
31
|
+
private subscriberGroupCallback;
|
|
32
|
+
constructor();
|
|
33
|
+
subscribe<T extends MessageType>(messageType: T, listener: Subscriber<T>['callback'], listenerId?: string | undefined, groupCallback?: (payload: MessagePayloads[T]) => void): void;
|
|
34
|
+
publish<T extends MessageType>(messageType: T, payload?: MessagePayloads[T]): void;
|
|
35
|
+
unsubscribeAll(): void;
|
|
36
|
+
}
|
|
37
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
type MutationFilter = (mutation: MutationRecord) => boolean;
|
|
2
|
+
type MutationHandler = (mutations: MutationRecord[]) => void;
|
|
3
|
+
interface DebouncedMutationManagerOptions {
|
|
4
|
+
observerOptions?: MutationObserverInit;
|
|
5
|
+
debounceMs?: number;
|
|
6
|
+
}
|
|
7
|
+
export declare class DebouncedMutationManager {
|
|
8
|
+
private static readonly MAX_PENDING_MUTATIONS;
|
|
9
|
+
private readonly filters;
|
|
10
|
+
private readonly options;
|
|
11
|
+
private readonly onMutations;
|
|
12
|
+
private readonly target;
|
|
13
|
+
private readonly processMutationsDebounced;
|
|
14
|
+
private mutationObserver;
|
|
15
|
+
private pendingMutations;
|
|
16
|
+
constructor(target: Element, onMutations: MutationHandler, filters?: ReadonlyArray<MutationFilter>, options?: DebouncedMutationManagerOptions);
|
|
17
|
+
private shouldProcessMutation;
|
|
18
|
+
private processMutationsImmediately;
|
|
19
|
+
private handleMutations;
|
|
20
|
+
private cleanup;
|
|
21
|
+
observe(): () => void;
|
|
22
|
+
}
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { DefaultWebExperimentClient } from './experiment';
|
|
2
|
+
import { MessageBus } from './message-bus';
|
|
3
|
+
import { PageObjects } from './types';
|
|
4
|
+
type initOptions = {
|
|
5
|
+
useDefaultNavigationHandler?: boolean;
|
|
6
|
+
isVisualEditorMode?: boolean;
|
|
7
|
+
};
|
|
8
|
+
export type PageChangeEvent = {
|
|
9
|
+
activePages: PageObjects;
|
|
10
|
+
};
|
|
11
|
+
export declare class SubscriptionManager {
|
|
12
|
+
private webExperimentClient;
|
|
13
|
+
private messageBus;
|
|
14
|
+
private pageObjects;
|
|
15
|
+
private options;
|
|
16
|
+
private readonly globalScope;
|
|
17
|
+
private pageChangeSubscribers;
|
|
18
|
+
private lastNotifiedActivePages;
|
|
19
|
+
constructor(webExperimentClient: DefaultWebExperimentClient, messageBus: MessageBus, pageObjects: PageObjects, options: initOptions, globalScope: typeof globalThis);
|
|
20
|
+
setPageObjects: (pageObjects: PageObjects) => void;
|
|
21
|
+
initSubscriptions: () => void;
|
|
22
|
+
/**
|
|
23
|
+
* Adds a subscriber to the page change event. Returns a function to unsubscribe.
|
|
24
|
+
* @param callback
|
|
25
|
+
*/
|
|
26
|
+
addPageChangeSubscriber: (callback: (event: PageChangeEvent) => void) => (() => void);
|
|
27
|
+
setupPageObjectSubscriptions: () => void;
|
|
28
|
+
private setupMutationObserverPublisher;
|
|
29
|
+
private setupLocationChangePublisher;
|
|
30
|
+
private isPageObjectActive;
|
|
31
|
+
private cloneActivePagesMap;
|
|
32
|
+
private areActivePagesEqual;
|
|
33
|
+
}
|
|
34
|
+
export {};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { EvaluationCondition } from '@amplitude/experiment-core';
|
|
2
|
+
import { ExperimentConfig } from '@amplitude/experiment-js-client';
|
|
3
|
+
import { ExperimentClient, Variants } from '@amplitude/experiment-js-client';
|
|
4
|
+
import { MessageType } from './message-bus';
|
|
5
|
+
export type ApplyVariantsOptions = {
|
|
6
|
+
/**
|
|
7
|
+
* A list of flag keys to apply.
|
|
8
|
+
*/
|
|
9
|
+
flagKeys?: string[];
|
|
10
|
+
};
|
|
11
|
+
export type RevertVariantsOptions = {
|
|
12
|
+
/**
|
|
13
|
+
* A list of flag keys to revert.
|
|
14
|
+
*/
|
|
15
|
+
flagKeys?: string[];
|
|
16
|
+
};
|
|
17
|
+
export type PreviewVariantsOptions = {
|
|
18
|
+
/**
|
|
19
|
+
* A map of flag keys to variant keys to be previewed.
|
|
20
|
+
*/
|
|
21
|
+
keyToVariant?: Record<string, string>;
|
|
22
|
+
};
|
|
23
|
+
export type PageObject = {
|
|
24
|
+
id: string;
|
|
25
|
+
name: string;
|
|
26
|
+
conditions?: EvaluationCondition[][];
|
|
27
|
+
trigger_type: MessageType;
|
|
28
|
+
trigger_value: Record<string, unknown>;
|
|
29
|
+
};
|
|
30
|
+
export type PageObjects = {
|
|
31
|
+
[flagKey: string]: {
|
|
32
|
+
[id: string]: PageObject;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
export interface WebExperimentConfig extends ExperimentConfig {
|
|
36
|
+
/**
|
|
37
|
+
* Determines whether the default implementation for handling navigation will be used
|
|
38
|
+
* If this is set to false, for single-page applications:
|
|
39
|
+
* 1. The variant actions applied will be based on the context (user, page URL) when the web experiment script was loaded
|
|
40
|
+
* 2. Custom handling of navigation {@link setRedirectHandler} should be implemented such that variant actions applied on the site reflect the latest context
|
|
41
|
+
*/
|
|
42
|
+
useDefaultNavigationHandler?: boolean;
|
|
43
|
+
}
|
|
44
|
+
export declare const Defaults: WebExperimentConfig;
|
|
45
|
+
/**
|
|
46
|
+
* Interface for the Web Experiment client.
|
|
47
|
+
*/
|
|
48
|
+
export interface WebExperimentClient {
|
|
49
|
+
start(): void;
|
|
50
|
+
getExperimentClient(): ExperimentClient;
|
|
51
|
+
applyVariants(options?: ApplyVariantsOptions): void;
|
|
52
|
+
revertVariants(options?: RevertVariantsOptions): void;
|
|
53
|
+
previewVariants(options: PreviewVariantsOptions): void;
|
|
54
|
+
getVariants(): Variants;
|
|
55
|
+
getActiveExperiments(): string[];
|
|
56
|
+
getActivePages(): PageObjects;
|
|
57
|
+
setRedirectHandler(handler: (url: string) => void): void;
|
|
58
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export interface InjectUtils {
|
|
2
|
+
/**
|
|
3
|
+
* Returns a promise that is resolved when an element matching the selector
|
|
4
|
+
* is found in DOM.
|
|
5
|
+
*
|
|
6
|
+
* @param selector The element selector to query for.
|
|
7
|
+
*/
|
|
8
|
+
waitForElement(selector: string): Promise<Element>;
|
|
9
|
+
/**
|
|
10
|
+
* Function which can be set inside injected javascript code. This function is
|
|
11
|
+
* called on page change, when experiments are re-evaluated.
|
|
12
|
+
*
|
|
13
|
+
* Useful for cleaning up changes to the page that have been made in single
|
|
14
|
+
* page apps, where page the page is not fully reloaded. For example, if you
|
|
15
|
+
* inject an HTML element on a specific page, you can set this function to
|
|
16
|
+
* remove the injected element on page change.
|
|
17
|
+
*/
|
|
18
|
+
remove: (() => void) | undefined;
|
|
19
|
+
}
|
|
20
|
+
export declare const getInjectUtils: () => InjectUtils;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const getUrlParams: () => Record<string, string>;
|
|
2
|
+
export declare const urlWithoutParamsAndAnchor: (url: string) => string;
|
|
3
|
+
export declare const removeQueryParams: (url: string, paramsToRemove: string[]) => string;
|
|
4
|
+
export declare const matchesUrl: (urlArray: string[], urlString: string) => boolean;
|
|
5
|
+
export declare const concatenateQueryParamsOf: (currentUrl: string, redirectUrl: string) => string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const UUID: (a?: any) => string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@amplitude/experiment-tag",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"description": "Amplitude Experiment Javascript Snippet",
|
|
5
5
|
"author": "Amplitude",
|
|
6
6
|
"homepage": "https://github.com/amplitude/experiment-js-client",
|
|
@@ -20,7 +20,8 @@
|
|
|
20
20
|
"build-dev": "NODE_ENV=development rm -rf dist && rollup -c && node example/build_example.js",
|
|
21
21
|
"clean": "rimraf node_modules dist",
|
|
22
22
|
"lint": "eslint . --ignore-path ../../.eslintignore && prettier -c . --ignore-path ../../.prettierignore",
|
|
23
|
-
"test": "jest"
|
|
23
|
+
"test": "jest",
|
|
24
|
+
"prepublish": "yarn build"
|
|
24
25
|
},
|
|
25
26
|
"bugs": {
|
|
26
27
|
"url": "https://github.com/amplitude/experiment-js-client/issues"
|
|
@@ -33,10 +34,11 @@
|
|
|
33
34
|
},
|
|
34
35
|
"devDependencies": {
|
|
35
36
|
"@rollup/plugin-terser": "^0.4.4",
|
|
37
|
+
"rollup-plugin-gzip": "^3.1.0",
|
|
36
38
|
"rollup-plugin-license": "^3.6.0"
|
|
37
39
|
},
|
|
38
40
|
"files": [
|
|
39
|
-
"dist
|
|
41
|
+
"dist"
|
|
40
42
|
],
|
|
41
|
-
"gitHead": "
|
|
43
|
+
"gitHead": "a7a5545affe60ba841d5025c462343639bb63b43"
|
|
42
44
|
}
|