@launchdarkly/react-sdk 0.0.0 → 0.1.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/CHANGELOG.md +22 -0
- package/LICENSE +13 -0
- package/README.md +21 -0
- package/dist/index.cjs +2 -0
- package/dist/index.d.cts +367 -0
- package/dist/index.d.ts +367 -0
- package/dist/index.js +2 -0
- package/dist/metafile-cjs.json +1 -0
- package/dist/metafile-esm.json +1 -0
- package/dist/server.cjs +1 -0
- package/dist/server.d.cts +197 -0
- package/dist/server.d.ts +197 -0
- package/dist/server.js +1 -0
- package/package.json +76 -3
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,367 @@
|
|
|
1
|
+
import { LDWaitForInitializationResult, LDClient, LDContextStrict, LDOptions, LDStartOptions, LDContext, LDFlagSet, LDEvaluationDetailTyped } from '@launchdarkly/js-client-sdk';
|
|
2
|
+
export * from '@launchdarkly/js-client-sdk';
|
|
3
|
+
import React$1 from 'react';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Initialization state of the client. This type should be consistent with
|
|
7
|
+
* the `status` field of the `LDWaitForInitializationResult` type.
|
|
8
|
+
*/
|
|
9
|
+
type InitializedState = LDWaitForInitializationResult['status'] | 'initializing' | 'unknown';
|
|
10
|
+
/**
|
|
11
|
+
* The LaunchDarkly client interface for React.
|
|
12
|
+
*/
|
|
13
|
+
interface LDReactClient extends LDClient {
|
|
14
|
+
/**
|
|
15
|
+
* Returns the initialization state of the client. This function is helpful to determine
|
|
16
|
+
* whether LDClient can be used to evaluate flags on initial component render.
|
|
17
|
+
*
|
|
18
|
+
* @see {@link LDWaitForInitializationResult} for the possible values and their meaning
|
|
19
|
+
*
|
|
20
|
+
* @returns {InitializedState} The initialization state of the client.
|
|
21
|
+
*/
|
|
22
|
+
getInitializationState(): InitializedState;
|
|
23
|
+
/**
|
|
24
|
+
* Returns the error that caused initialization to fail, if any.
|
|
25
|
+
* Only set when `getInitializationState()` returns `'failed'`.
|
|
26
|
+
*/
|
|
27
|
+
getInitializationError(): Error | undefined;
|
|
28
|
+
/**
|
|
29
|
+
* Subscribes to context changes triggered by `identify()`. The callback is invoked
|
|
30
|
+
* after each successful `identify()` call with the new resolved context.
|
|
31
|
+
*
|
|
32
|
+
* @param callback Function called with the new context after each successful identify.
|
|
33
|
+
* @returns An unsubscribe function. Call it to stop receiving notifications.
|
|
34
|
+
*/
|
|
35
|
+
onContextChange(callback: (context: LDContextStrict) => void): () => void;
|
|
36
|
+
/**
|
|
37
|
+
* Subscribes to initialization status changes triggered when the client is initialized.
|
|
38
|
+
*
|
|
39
|
+
* @param callback Function called with the initialization result.
|
|
40
|
+
* @returns An unsubscribe function. Call it to stop receiving notifications.
|
|
41
|
+
*/
|
|
42
|
+
onInitializationStatusChange(callback: (result: LDWaitForInitializationResult) => void): () => void;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* The React context interface for the LaunchDarkly client.
|
|
46
|
+
*/
|
|
47
|
+
interface LDReactClientContextValue {
|
|
48
|
+
/**
|
|
49
|
+
* The LaunchDarkly client.
|
|
50
|
+
*/
|
|
51
|
+
client: LDReactClient;
|
|
52
|
+
/**
|
|
53
|
+
* The LaunchDarkly context. This will be undefined if the client is not initialized.
|
|
54
|
+
*/
|
|
55
|
+
context?: LDContextStrict;
|
|
56
|
+
/**
|
|
57
|
+
* The initialization state of the client.
|
|
58
|
+
*/
|
|
59
|
+
initializedState: InitializedState;
|
|
60
|
+
/**
|
|
61
|
+
* The error that caused the client to fail to initialize. Only set when `initializedState` is `'failed'`.
|
|
62
|
+
*/
|
|
63
|
+
error?: Error;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* The LaunchDarkly client context provider interface for React.
|
|
67
|
+
* This will be the type that is returned from our createContext function.
|
|
68
|
+
*/
|
|
69
|
+
type LDReactClientContext = React$1.Context<LDReactClientContextValue>;
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Initialization options for the LaunchDarkly React SDK.
|
|
73
|
+
*/
|
|
74
|
+
interface LDReactClientOptions extends LDOptions {
|
|
75
|
+
/**
|
|
76
|
+
* Whether the React SDK should transform flag keys into camel-cased format.
|
|
77
|
+
* Using camel-cased flag keys allow for easier use as prop values, however,
|
|
78
|
+
* these keys won't directly match the flag keys as known to LaunchDarkly.
|
|
79
|
+
* Consequently, flag key collisions may be possible and the Code References feature
|
|
80
|
+
* will not function properly.
|
|
81
|
+
*
|
|
82
|
+
* This is true by default, meaning that keys will automatically be converted to camel-case.
|
|
83
|
+
*
|
|
84
|
+
* For more information, see the React SDK Reference Guide on
|
|
85
|
+
* [flag keys](https://docs.launchdarkly.com/sdk/client-side/react/react-web#flag-keys).
|
|
86
|
+
*
|
|
87
|
+
* @deprecated This option is deprecated and will be removed in a future major version.
|
|
88
|
+
*
|
|
89
|
+
* @see https://docs.launchdarkly.com/sdk/client-side/react/react-web#flag-keys
|
|
90
|
+
*/
|
|
91
|
+
useCamelCaseFlagKeys?: boolean;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Options for creating a React Provider.
|
|
95
|
+
*/
|
|
96
|
+
interface LDReactProviderOptions {
|
|
97
|
+
/**
|
|
98
|
+
* Options for the LaunchDarkly client.
|
|
99
|
+
*
|
|
100
|
+
* @remarks
|
|
101
|
+
* This option is used to pass options to the LaunchDarkly client.
|
|
102
|
+
*
|
|
103
|
+
* @see {@link LDReactClientOptions} for the possible options
|
|
104
|
+
*/
|
|
105
|
+
ldOptions?: LDReactClientOptions;
|
|
106
|
+
/**
|
|
107
|
+
* Options for starting the LaunchDarkly client.
|
|
108
|
+
*
|
|
109
|
+
* @remarks
|
|
110
|
+
* This option is especially useful if you choose to not defer
|
|
111
|
+
* initialization and want to start the client immediately.
|
|
112
|
+
*
|
|
113
|
+
* @see {@link LDStartOptions} for the possible options
|
|
114
|
+
*/
|
|
115
|
+
startOptions?: LDStartOptions;
|
|
116
|
+
/**
|
|
117
|
+
* If set to true, the LDClient will not start automatically.
|
|
118
|
+
*
|
|
119
|
+
* @default false
|
|
120
|
+
*
|
|
121
|
+
* If initialization is deferred, then the LDClient can be started manually
|
|
122
|
+
* by calling the `start` function.
|
|
123
|
+
*/
|
|
124
|
+
deferInitialization?: boolean;
|
|
125
|
+
/**
|
|
126
|
+
* This option allow developers to provide their own named react context for
|
|
127
|
+
* the launchdarkly client. This is useful for cases where you want to have multiple
|
|
128
|
+
* clients in the same application. If not provided, the default context will be used.
|
|
129
|
+
*
|
|
130
|
+
* @see {@link LDReactClientContext} for the possible values and their meaning
|
|
131
|
+
*
|
|
132
|
+
* @returns {LDReactClientContext} The react context for the LaunchDarkly client.
|
|
133
|
+
*/
|
|
134
|
+
reactContext?: LDReactClientContext;
|
|
135
|
+
/**
|
|
136
|
+
* Bootstrap data from the server. Pass the result of `flagsState.toJSON()` obtained
|
|
137
|
+
* from the server SDK's `allFlagsState` method.
|
|
138
|
+
*
|
|
139
|
+
* When provided, the client immediately uses these values before the first network
|
|
140
|
+
* response arrives — eliminating the flag-fetch waterfall on page load.
|
|
141
|
+
*
|
|
142
|
+
* This is merged into `startOptions.bootstrap` when the client is started. If both
|
|
143
|
+
* `bootstrap` and `startOptions.bootstrap` are provided, this top-level value takes
|
|
144
|
+
* precedence.
|
|
145
|
+
*/
|
|
146
|
+
bootstrap?: unknown;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
declare function initLDReactContext(): LDReactClientContext;
|
|
150
|
+
/**
|
|
151
|
+
* The LaunchDarkly React context.
|
|
152
|
+
*/
|
|
153
|
+
declare const LDReactContext: LDReactClientContext;
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* Creates a new LaunchDarkly React provider wrapping an existing client instance.
|
|
157
|
+
*
|
|
158
|
+
* @remarks
|
|
159
|
+
* **NOTE:** We recommend using the convenience factory function {@link createLDReactProvider}
|
|
160
|
+
* instead of this function if you can.
|
|
161
|
+
*
|
|
162
|
+
* This factory function is provided to allow the caller to use an existing client
|
|
163
|
+
* instance. When using this function, the caller is responsible for calling `client.start()`
|
|
164
|
+
* before or after mounting.
|
|
165
|
+
*
|
|
166
|
+
* @example
|
|
167
|
+
* ```tsx
|
|
168
|
+
* import { createClient, createLDReactProviderWithClient, initLDReactContext } from '@launchdarkly/react-sdk';
|
|
169
|
+
*
|
|
170
|
+
* const client = createClient(clientSideID, context);
|
|
171
|
+
* client.start();
|
|
172
|
+
* const LDProvider = createLDReactProviderWithClient(client);
|
|
173
|
+
* ```
|
|
174
|
+
*
|
|
175
|
+
* For multiple client instances, pass a custom React context:
|
|
176
|
+
* ```tsx
|
|
177
|
+
* const ReactContext = initLDReactContext();
|
|
178
|
+
* const LDProvider = createLDReactProviderWithClient(client, ReactContext);
|
|
179
|
+
* ```
|
|
180
|
+
*
|
|
181
|
+
* @param client launchdarkly client instance @see {@link createClient}
|
|
182
|
+
* @param ReactContext optional launchdarkly react context @see {@link initLDReactContext}
|
|
183
|
+
* @returns {React.FC<{ children: React.ReactNode }>} The LaunchDarkly React Client provider.
|
|
184
|
+
*/
|
|
185
|
+
declare function createLDReactProviderWithClient(client: LDReactClient, ReactContext?: React$1.Context<LDReactClientContextValue>): React$1.FC<{
|
|
186
|
+
children: React$1.ReactNode;
|
|
187
|
+
}>;
|
|
188
|
+
/**
|
|
189
|
+
* Creates a new LaunchDarkly React provider, creating the client internally.
|
|
190
|
+
*
|
|
191
|
+
* By default the client is started immediately (before the provider mounts).
|
|
192
|
+
* Pass `deferInitialization: true` in options to opt out of auto-start and call
|
|
193
|
+
* `client.start()` yourself via `useLDClient()`.
|
|
194
|
+
*
|
|
195
|
+
* @example
|
|
196
|
+
* ```tsx
|
|
197
|
+
* import { createLDReactProvider } from '@launchdarkly/react-sdk';
|
|
198
|
+
*
|
|
199
|
+
* const LDProvider = createLDReactProvider('your-client-side-id', { kind: 'user', key: 'user-key' });
|
|
200
|
+
*
|
|
201
|
+
* function Root() {
|
|
202
|
+
* return (
|
|
203
|
+
* <LDProvider>
|
|
204
|
+
* <App />
|
|
205
|
+
* </LDProvider>
|
|
206
|
+
* );
|
|
207
|
+
* }
|
|
208
|
+
* ```
|
|
209
|
+
*
|
|
210
|
+
* @param clientSideID launchdarkly client-side ID
|
|
211
|
+
* @param context the initial LaunchDarkly context
|
|
212
|
+
* @param options optional provider and client options
|
|
213
|
+
* @returns {React.FC<{ children: React.ReactNode }>} The LaunchDarkly React Client provider.
|
|
214
|
+
*/
|
|
215
|
+
declare function createLDReactProvider(clientSideID: string, context: LDContext, options?: LDReactProviderOptions): React$1.FC<{
|
|
216
|
+
children: React$1.ReactNode;
|
|
217
|
+
}>;
|
|
218
|
+
|
|
219
|
+
/**
|
|
220
|
+
* Creates a new instance of the LaunchDarkly client for React.
|
|
221
|
+
*
|
|
222
|
+
* @remarks
|
|
223
|
+
* **NOTE:** We recommend using the convenience factory function {@link createLDReactProvider}
|
|
224
|
+
* instead of this function to create your client instance if you can.
|
|
225
|
+
*
|
|
226
|
+
* This factory function is provided to allow the caller to have more control over their client instance.
|
|
227
|
+
* When using this function, the caller is responsible for:
|
|
228
|
+
* - calling `client.start()` before or after mounting.
|
|
229
|
+
* - subscribing to client lifecycle events.
|
|
230
|
+
*
|
|
231
|
+
* Refer to {@link createLDReactProviderWithClient} for the default behavior.
|
|
232
|
+
*
|
|
233
|
+
* @example
|
|
234
|
+
* ```tsx
|
|
235
|
+
* import { createClient } from '@launchdarkly/react';
|
|
236
|
+
* const client = createClient(clientSideID, context, options);
|
|
237
|
+
*
|
|
238
|
+
* await client.start();
|
|
239
|
+
* ```
|
|
240
|
+
*
|
|
241
|
+
* @param clientSideID launchdarkly client side id @see https://launchdarkly.com/docs/sdk/concepts/client-side-server-side#client-side-id
|
|
242
|
+
* @param context launchdarkly context @see https://launchdarkly.com/docs/sdk/concepts/context
|
|
243
|
+
* @param options options for the client @see {@link LDReactClientOptions}
|
|
244
|
+
* @returns the new client instance @see {@link LDReactClient}
|
|
245
|
+
*/
|
|
246
|
+
declare function createClient(clientSideID: string, context: LDContext, options?: LDReactClientOptions): LDReactClient;
|
|
247
|
+
|
|
248
|
+
/**
|
|
249
|
+
* Returns all feature flags for the current context.
|
|
250
|
+
*
|
|
251
|
+
* @param reactContext Optional React context to read from. Defaults to the global `LDReactContext`.
|
|
252
|
+
* @returns All current flag values, optionally with camelCased keys, wrapped in a proxy that
|
|
253
|
+
* records evaluations.
|
|
254
|
+
*
|
|
255
|
+
* @deprecated This hook is provided to ease migration from older versions of the React SDK.
|
|
256
|
+
* For better performance, migrate to the typed variation hooks (`useBoolVariation`,
|
|
257
|
+
* `useStringVariation`, `useNumberVariation`, `useJsonVariation`) or use `useLDClient`
|
|
258
|
+
* with the client's `allFlags` method directly. This hook will be removed in a future major version.
|
|
259
|
+
*/
|
|
260
|
+
declare function useFlags<T extends LDFlagSet = LDFlagSet>(reactContext?: React.Context<LDReactClientContextValue>): T;
|
|
261
|
+
|
|
262
|
+
/**
|
|
263
|
+
* Represents the current initialization state of the LaunchDarkly client.
|
|
264
|
+
*/
|
|
265
|
+
type InitializationStatus = {
|
|
266
|
+
status: 'unknown';
|
|
267
|
+
} | {
|
|
268
|
+
status: 'initializing';
|
|
269
|
+
} | {
|
|
270
|
+
status: 'complete';
|
|
271
|
+
} | {
|
|
272
|
+
status: 'timeout';
|
|
273
|
+
} | {
|
|
274
|
+
status: 'failed';
|
|
275
|
+
error: Error;
|
|
276
|
+
};
|
|
277
|
+
/**
|
|
278
|
+
* Returns the initialization status of the LaunchDarkly client.
|
|
279
|
+
*
|
|
280
|
+
* @param reactContext Optional React context to read from. Defaults to the global `LDReactContext`.
|
|
281
|
+
* @returns An {@link InitializationStatus} object with the current state (and error, if failed).
|
|
282
|
+
*/
|
|
283
|
+
declare function useInitializationStatus(reactContext?: React.Context<LDReactClientContextValue>): InitializationStatus;
|
|
284
|
+
|
|
285
|
+
/**
|
|
286
|
+
* Returns the LaunchDarkly client instance from the nearest provider.
|
|
287
|
+
*
|
|
288
|
+
* @param reactContext Optional React context to read from. Defaults to the global `LDReactContext`.
|
|
289
|
+
* @returns The {@link LDReactClient} instance.
|
|
290
|
+
*/
|
|
291
|
+
declare function useLDClient(reactContext?: React.Context<LDReactClientContextValue>): LDReactClient;
|
|
292
|
+
|
|
293
|
+
/**
|
|
294
|
+
* Returns the boolean variation of a feature flag.
|
|
295
|
+
*
|
|
296
|
+
* @param key The feature flag key.
|
|
297
|
+
* @param defaultValue The value to return if the flag is not available.
|
|
298
|
+
* @param reactContext Optional React context to read from. Defaults to the global `LDReactContext`.
|
|
299
|
+
* @returns The boolean flag value, or `defaultValue` if the flag is unavailable.
|
|
300
|
+
*/
|
|
301
|
+
declare function useBoolVariation(key: string, defaultValue: boolean, reactContext?: React.Context<LDReactClientContextValue>): boolean;
|
|
302
|
+
/**
|
|
303
|
+
* Returns the string variation of a feature flag.
|
|
304
|
+
*
|
|
305
|
+
* @param key The feature flag key.
|
|
306
|
+
* @param defaultValue The value to return if the flag is not available.
|
|
307
|
+
* @param reactContext Optional React context to read from. Defaults to the global `LDReactContext`.
|
|
308
|
+
* @returns The string flag value, or `defaultValue` if the flag is unavailable.
|
|
309
|
+
*/
|
|
310
|
+
declare function useStringVariation(key: string, defaultValue: string, reactContext?: React.Context<LDReactClientContextValue>): string;
|
|
311
|
+
/**
|
|
312
|
+
* Returns the numeric variation of a feature flag.
|
|
313
|
+
*
|
|
314
|
+
* @param key The feature flag key.
|
|
315
|
+
* @param defaultValue The value to return if the flag is not available.
|
|
316
|
+
* @param reactContext Optional React context to read from. Defaults to the global `LDReactContext`.
|
|
317
|
+
* @returns The number flag value, or `defaultValue` if the flag is unavailable.
|
|
318
|
+
*/
|
|
319
|
+
declare function useNumberVariation(key: string, defaultValue: number, reactContext?: React.Context<LDReactClientContextValue>): number;
|
|
320
|
+
/**
|
|
321
|
+
* Returns the JSON variation of a feature flag.
|
|
322
|
+
*
|
|
323
|
+
* @param key The feature flag key.
|
|
324
|
+
* @param defaultValue The value to return if the flag is not available.
|
|
325
|
+
* @param reactContext Optional React context to read from. Defaults to the global `LDReactContext`.
|
|
326
|
+
* @returns The JSON flag value, or `defaultValue` if the flag is unavailable.
|
|
327
|
+
*/
|
|
328
|
+
declare function useJsonVariation<T = unknown>(key: string, defaultValue: T, reactContext?: React.Context<LDReactClientContextValue>): T;
|
|
329
|
+
|
|
330
|
+
/**
|
|
331
|
+
* Returns the boolean variation and evaluation detail of a feature flag.
|
|
332
|
+
*
|
|
333
|
+
* @param key The feature flag key.
|
|
334
|
+
* @param defaultValue The value to return if the flag is not available.
|
|
335
|
+
* @param reactContext Optional React context to read from. Defaults to the global `LDReactContext`.
|
|
336
|
+
* @returns The evaluation detail including `value`, `variationIndex`, and `reason`.
|
|
337
|
+
*/
|
|
338
|
+
declare function useBoolVariationDetail(key: string, defaultValue: boolean, reactContext?: React.Context<LDReactClientContextValue>): LDEvaluationDetailTyped<boolean>;
|
|
339
|
+
/**
|
|
340
|
+
* Returns the string variation and evaluation detail of a feature flag.
|
|
341
|
+
*
|
|
342
|
+
* @param key The feature flag key.
|
|
343
|
+
* @param defaultValue The value to return if the flag is not available.
|
|
344
|
+
* @param reactContext Optional React context to read from. Defaults to the global `LDReactContext`.
|
|
345
|
+
* @returns The evaluation detail including `value`, `variationIndex`, and `reason`.
|
|
346
|
+
*/
|
|
347
|
+
declare function useStringVariationDetail(key: string, defaultValue: string, reactContext?: React.Context<LDReactClientContextValue>): LDEvaluationDetailTyped<string>;
|
|
348
|
+
/**
|
|
349
|
+
* Returns the numeric variation and evaluation detail of a feature flag.
|
|
350
|
+
*
|
|
351
|
+
* @param key The feature flag key.
|
|
352
|
+
* @param defaultValue The value to return if the flag is not available.
|
|
353
|
+
* @param reactContext Optional React context to read from. Defaults to the global `LDReactContext`.
|
|
354
|
+
* @returns The evaluation detail including `value`, `variationIndex`, and `reason`.
|
|
355
|
+
*/
|
|
356
|
+
declare function useNumberVariationDetail(key: string, defaultValue: number, reactContext?: React.Context<LDReactClientContextValue>): LDEvaluationDetailTyped<number>;
|
|
357
|
+
/**
|
|
358
|
+
* Returns the JSON variation and evaluation detail of a feature flag.
|
|
359
|
+
*
|
|
360
|
+
* @param key The feature flag key.
|
|
361
|
+
* @param defaultValue The value to return if the flag is not available.
|
|
362
|
+
* @param reactContext Optional React context to read from. Defaults to the global `LDReactContext`.
|
|
363
|
+
* @returns The evaluation detail including `value`, `variationIndex`, and `reason`.
|
|
364
|
+
*/
|
|
365
|
+
declare function useJsonVariationDetail<T = unknown>(key: string, defaultValue: T, reactContext?: React.Context<LDReactClientContextValue>): LDEvaluationDetailTyped<T>;
|
|
366
|
+
|
|
367
|
+
export { type InitializationStatus, type InitializedState, type LDReactClient, type LDReactClientContext, type LDReactClientContextValue, type LDReactClientOptions, LDReactContext, type LDReactProviderOptions, createClient, createLDReactProvider, createLDReactProviderWithClient, initLDReactContext, useBoolVariation, useBoolVariationDetail, useFlags, useInitializationStatus, useJsonVariation, useJsonVariationDetail, useLDClient, useNumberVariation, useNumberVariationDetail, useStringVariation, useStringVariationDetail };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
var ri=Object.defineProperty,ai=Object.defineProperties;var si=Object.getOwnPropertyDescriptors;var $t=Object.getOwnPropertySymbols;var oi=Object.prototype.hasOwnProperty,li=Object.prototype.propertyIsEnumerable;var Tt=(t,e,i)=>e in t?ri(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,N=(t,e)=>{for(var i in e||(e={}))oi.call(e,i)&&Tt(t,i,e[i]);if($t)for(var i of $t(e))li.call(e,i)&&Tt(t,i,e[i]);return t},j=(t,e)=>ai(t,si(e));import{createContext as ui}from"react";function Pt(){return ui(null)}var R=Pt();import Da,{useEffect as Ea,useState as xa}from"react";var ci=Object.defineProperty,hi=Object.defineProperties,di=Object.getOwnPropertyDescriptors,Y=Object.getOwnPropertySymbols,ae=Object.prototype.hasOwnProperty,se=Object.prototype.propertyIsEnumerable,Nt=(t,e,i)=>e in t?ci(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,v=(t,e)=>{for(var i in e||(e={}))ae.call(e,i)&&Nt(t,i,e[i]);if(Y)for(var i of Y(e))se.call(e,i)&&Nt(t,i,e[i]);return t},$=(t,e)=>hi(t,di(e)),oe=(t,e)=>{var i={};for(var n in t)ae.call(t,n)&&e.indexOf(n)<0&&(i[n]=t[n]);if(t!=null&&Y)for(var n of Y(t))e.indexOf(n)<0&&se.call(t,n)&&(i[n]=t[n]);return i};function fi(t){return`/${t.replace(/~/g,"~0").replace(/\//g,"~1")}`}function le(t){return t.indexOf("~")?t.replace(/~1/g,"/").replace(/~0/g,"~"):t}function gi(t){return(t.startsWith("/")?t.substring(1):t).split("/").map(e=>le(e))}function pi(t){return!t.startsWith("/")}function vi(t){return!t.match(/\/\/|(^\/.*~[^0|^1])|~$/)}var F=class{constructor(t,e=!1){if(e){let i=t;this.g=[i],this.isValid=i!=="",this.redactionName=i.startsWith("/")?fi(i):i}else{if(this.redactionName=t,t===""||t==="/"||!vi(t)){this.isValid=!1,this.g=[];return}pi(t)?this.g=[t]:t.indexOf("/",1)<0?this.g=[le(t.slice(1))]:this.g=gi(t),this.g[0]==="_meta"?this.isValid=!1:this.isValid=!0}}get(t){let{g:e,isValid:i}=this;if(!i)return;let n=t;for(let r=0;r<e.length;r+=1){let a=e[r];if(n!=null&&Object.prototype.hasOwnProperty.call(n,a)&&typeof n=="object"&&!Array.isArray(n))n=n[a];else return}return n}getComponent(t){return this.g[t]}get depth(){return this.g.length}get isKind(){return this.g.length===1&&this.g[0]==="kind"}compare(t){return this.depth===t.depth&&this.g.every((e,i)=>e===t.getComponent(i))}get components(){return[...this.g]}};F.InvalidReference=new F("");var mi=class{is(t){if(Array.isArray(t))return!1;let e=typeof t;return e==="function"||e==="object"}getType(){return"factory method or object"}},K=class{constructor(t,e){this.mt=t,this.typeOf=typeof e}is(t){return Array.isArray(t)?!1:typeof t===this.typeOf}getType(){return this.mt}},ue=class{constructor(t,e){this.mt=t,this.typeOf=typeof e}is(t){return Array.isArray(t)?t.length>0?t.every(e=>typeof e===this.typeOf):!0:!1}getType(){return this.mt}},ce=class extends K{constructor(t){super(`number with minimum value of ${t}`,0),this.min=t}is(t){return typeof t===this.typeOf&&t>=this.min}},he=class extends K{constructor(t){super(`string matching ${t}`,""),this.expression=t}is(t){return typeof t=="string"&&!!t.match(this.expression)}},yi=class{is(t){return typeof t=="function"}getType(){return"function"}},wi=class{is(t){return typeof t=="boolean"||typeof t=="undefined"||t===null}getType(){return"boolean | undefined | null"}},bi=/^\d\d\d\d-\d\d-\d\dT\d\d:\d\d:\d\d(\.\d\d*)?(Z|[-+]\d\d(:\d\d)?)/,ki=class{is(t){return typeof t=="number"||typeof t=="string"&&bi.test(t)}getType(){return"date"}},Di=class extends he{constructor(){super(/^(\w|\.|-)+$/)}is(t){return super.is(t)&&t!=="kind"}},Ei=class{constructor(t){this.Yt=t}is(t){return typeof t=="string"&&this.Yt.includes(t)}getType(){return this.Yt.join(" | ")}};function T(t){return t==null}var d=class{static createTypeArray(t,e){return new ue(t,e)}static numberWithMin(t){return new ce(t)}static stringMatchingRegex(t){return new he(t)}static oneOf(...t){return new Ei(t)}};d.String=new K("string","");d.Number=new K("number",0);d.ObjectOrFactory=new mi;d.Object=new K("object",{});d.StringArray=new ue("string[]","");d.Boolean=new K("boolean",!0);d.Function=new yi;d.Date=new ki;d.Kind=new Di;d.NullableBoolean=new wi;function de(t){return"kind"in t?d.String.is(t.kind)&&t.kind!=="multi":!1}function fe(t){return"kind"in t?d.String.is(t.kind)&&t.kind==="multi":!1}function ge(t){return!("kind"in t)||t.kind===null||t.kind===void 0}function Q(t,e=[]){if(t===null||typeof t!="object")return JSON.stringify(t);if(e.includes(t))throw new Error("Cycle detected");return Array.isArray(t)?`[${t.map(i=>Q(i,[...e,t])).map(i=>i===void 0?"null":i).join(",")}]`:`{${Object.keys(t).sort().map(i=>{let n=Q(t[i],[...e,t]);if(n!==void 0)return`${JSON.stringify(i)}:${n}`}).filter(i=>i!==void 0).join(",")}}`}var vt="user";function jt(t){return t.includes("%")||t.includes(":")?t.replace(/%/g,"%25").replace(/:/g,"%3A"):t}function xi(t){return t&&d.Object.is(t)}function At(t){return d.Kind.is(t)}function Vt(t){return d.String.is(t)&&t!==""}function ot(t,e=!1){return t?t.map(i=>new F(i,e)):[]}function Ci(t){return t!=null}function Si(t){let e=$(v({},t.custom||[]),{kind:"user",key:String(t.key)});if(Ci(t.anonymous)){let i=!!t.anonymous;delete e.anonymous,e.anonymous=i}return t.name!==null&&t.name!==void 0&&(e.name=t.name),t.ip!==null&&t.ip!==void 0&&(e.ip=t.ip),t.firstName!==null&&t.firstName!==void 0&&(e.firstName=t.firstName),t.lastName!==null&&t.lastName!==void 0&&(e.lastName=t.lastName),t.email!==null&&t.email!==void 0&&(e.email=t.email),t.avatar!==null&&t.avatar!==void 0&&(e.avatar=t.avatar),t.country!==null&&t.country!==void 0&&(e.country=t.country),t.privateAttributeNames!==null&&t.privateAttributeNames!==void 0&&(e._meta={privateAttributes:t.privateAttributeNames}),e}var M=class y{constructor(e,i,n){this.P=!1,this.Q=!1,this.Zt=!1,this.$={},this.kind=i,this.valid=e,this.message=n}static D(e,i){return new y(!1,e,i)}static Re(e,i){if(!(!i||!e.isValid))return e.depth===1&&e.getComponent(0)==="anonymous"?!!(i!=null&&i.anonymous):e.get(i)}Xt(e){if(this.P)return this.$[e];if(this.kind===e)return this.v}static Ne(e){let i=Object.keys(e).filter(l=>l!=="kind"),n=i.every(At);if(!i.length)return y.D("multi","A multi-kind context must contain at least one kind");if(!n)return y.D("multi","Context contains invalid kinds");let r={},a=!0,o=i.reduce((l,u)=>{var c;let h=e[u];return xi(h)?(l[u]=h,r[u]=ot((c=h._meta)==null?void 0:c.privateAttributes)):a=!1,l},{});if(!a)return y.D("multi","Context contained contexts that were not objects");if(!Object.values(o).every(l=>Vt(l.key)))return y.D("multi","Context contained invalid keys");if(i.length===1){let l=i[0],u=new y(!0,l);return u.v=$(v({},o[l]),{kind:l}),u.tt=r,u.Q=l==="user",u}let s=new y(!0,e.kind);return s.$=o,s.tt=r,s.P=!0,s}static Me(e){var i;let{key:n,kind:r}=e,a=At(r),o=Vt(n);if(!a)return y.D(r!=null?r:"unknown","The kind was not valid for the context");if(!o)return y.D(r,"The key for the context was not valid");let s=ot((i=e._meta)==null?void 0:i.privateAttributes),l=new y(!0,r);return l.Q=r==="user",l.v=e,l.tt={[r]:s},l}static Fe(e){if(!(e.key!==void 0&&e.key!==null))return y.D("user","The key for the context was not valid");let i=new y(!0,"user");return i.Q=!0,i.Zt=!0,i.v=Si(e),i.tt={user:ot(e.privateAttributeNames,!0)},i}static fromLDContext(e){return e?de(e)?y.Me(e):fe(e)?y.Ne(e):ge(e)?y.Fe(e):y.D("unknown","Context was not of a valid kind"):y.D("unknown","No context specified. Returning default value")}static toLDContext(e){if(!e.valid)return;let i=e.getContexts();if(!e.P)return i[0][1];let n={kind:"multi"};return i.forEach(r=>{let a=r[0],o=r[1];n[a]=o}),n}valueForKind(e,i=vt){return e.isKind?this.kinds:y.Re(e,this.Xt(i))}key(e=vt){var i;return(i=this.Xt(e))==null?void 0:i.key}get isMultiKind(){return this.P}get canonicalKey(){return this.Q?this.v.key:this.P?Object.keys(this.$).sort().map(e=>`${e}:${jt(this.$[e].key)}`).join(":"):`${this.kind}:${jt(this.v.key)}`}get kinds(){return this.P?Object.keys(this.$):[this.kind]}get kindsAndKeys(){return this.P?Object.entries(this.$).reduce((e,[i,n])=>(e[i]=n.key,e),{}):{[this.kind]:this.v.key}}privateAttributes(e){var i;return((i=this.tt)==null?void 0:i[e])||[]}getContexts(){return this.P?Object.entries(this.$):[[this.kind,this.v]]}get legacy(){return this.Zt}canonicalUnfilteredJson(){if(this.valid){if(this.gt)return this.gt;try{this.gt=Q(y.toLDContext(this))}catch(e){}return this.gt}}};M.UserKind=vt;var Ri=["key","kind","_meta","anonymous"].map(t=>new F(t,!0)),Oi=["name","ip","firstName","lastName","email","avatar","country"];function Ii(t,e){return t.depth===e.length&&e.every((i,n)=>i===t.getComponent(n))}function Li(t,e){let i=[],n={},r=[];for(i.push(...Object.keys(t).map(a=>({key:a,ptr:[a],source:t,parent:n,visited:[t]})));i.length;){let a=i.pop(),o=e.find(s=>Ii(s,a.ptr));if(o)r.push(o.redactionName);else{let s=a.source[a.key];s===null?a.parent[a.key]=s:Array.isArray(s)?a.parent[a.key]=[...s]:typeof s=="object"?a.visited.includes(s)||(a.parent[a.key]={},i.push(...Object.keys(s).map(l=>({key:l,ptr:[...a.ptr,l],source:s,parent:a.parent[a.key],visited:[...a.visited,s]})))):a.parent[a.key]=s}}return{cloned:n,excluded:r.sort()}}var $i=class{constructor(t,e){this.Ue=t,this.je=e}filter(t,e=!1){let i=t.getContexts();if(i.length===1)return this.Qt(t,i[0][1],i[0][0],e);let n={kind:"multi"};return i.forEach(([r,a])=>{n[r]=this.Qt(t,a,r,e)}),n}p(t,e,i,n){return(n?Object.keys(e).map(r=>new F(r,!0)):[...this.je,...t.privateAttributes(i)]).filter(r=>!Ri.some(a=>a.compare(r)))}Qt(t,e,i,n){let r=this.Ue||n&&e.anonymous===!0,{cloned:a,excluded:o}=Li(e,this.p(t,e,i,r));return t.legacy&&Oi.forEach(s=>{s in a&&(a[s]=String(a[s]))}),o.length&&(a._meta||(a._meta={}),a._meta.redactedAttributes=o),a._meta&&(delete a._meta.privateAttributes,Object.keys(a._meta).length===0&&delete a._meta),a}},Mt=30*1e3,Ti=.5,Pi=class{constructor(t,e,i=Math.random){this.Ve=e,this.He=i,this.yt=0,this.te=Math.max(1,t),this.ze=Math.ceil(Math.log2(Mt/this.te))}C(){let t=Math.min(this.yt,this.ze),e=this.te*2**t;return Math.min(e,Mt)}Be(t){return t-Math.trunc(this.He()*Ti*t)}success(t=Date.now()){this.vt=t}fail(t=Date.now()){this.vt!==void 0&&t-this.vt>this.Ve&&(this.yt=0),this.vt=void 0;let e=this.Be(this.C());return this.yt+=1,e}},Ft;(function(t){t[t.Valid=0]="Valid",t[t.Initializing=1]="Initializing",t[t.Interrupted=2]="Interrupted",t[t.Closed=3]="Closed"})(Ft||(Ft={}));var X=class extends Error{constructor(t,e,i,n=!0){super(e),this.kind=t,this.status=i,this.name="LaunchDarklyPollingError",this.recoverable=n}},mt=class extends Error{constructor(t,e,i,n=!0){super(e),this.kind=t,this.code=i,this.name="LaunchDarklyStreamingError",this.recoverable=n}},Za=120*1e3,Ya=300*1e3,E;(function(t){t.Unknown="UNKNOWN",t.NetworkError="NETWORK_ERROR",t.ErrorResponse="ERROR_RESPONSE",t.InvalidData="INVALID_DATA"})(E||(E={}));var tt;(function(t){t[t.Disabled=0]="Disabled",t[t.Enabled=1]="Enabled"})(tt||(tt={}));var U;(function(t){t[t.AnalyticsEvents=0]="AnalyticsEvents",t[t.DiagnosticEvent=1]="DiagnosticEvent"})(U||(U={}));var P;(function(t){t[t.Succeeded=0]="Succeeded",t[t.Failed=1]="Failed",t[t.FailedAndMustShutDown=2]="FailedAndMustShutDown"})(P||(P={}));function V(t){if(typeof t=="string")return t;if(t===void 0)return"undefined";if(t===null)return"null";if(Object.prototype.hasOwnProperty.call(t,"toString"))try{return t.toString()}catch(e){}if(typeof t=="bigint")return`${t}n`;try{return JSON.stringify(t)}catch(e){return e instanceof TypeError&&e.message.indexOf("circular")>=0?"[Circular]":"[Not Stringifiable]"}}function Ni(t){return typeof t=="symbol"?"NaN":typeof t=="bigint"?`${t}n`:String(Number(t))}function ji(t){return typeof t=="symbol"?"NaN":typeof t=="bigint"?`${t}n`:String(parseInt(t,10))}function Ai(t){return typeof t=="symbol"?"NaN":String(parseFloat(t))}var lt={s:t=>V(t),d:t=>Ni(t),i:t=>ji(t),f:t=>Ai(t),j:t=>V(t),o:t=>V(t),O:t=>V(t),c:()=>""};function yt(...t){var e;let i=t.shift();if(d.String.is(i)){let n="",r=0;for(;r<i.length;){let a=i.charAt(r);if(a==="%"){if(r+1<i.length){let o=i.charAt(r+1);if(o in lt&&t.length){let s=t.shift();n+=(e=lt[o])==null?void 0:e.call(lt,s)}else o==="%"?n+="%":n+=`%${o}`;r+=2}}else n+=a,r+=1}return t.length&&(n.length&&(n+=" "),n+=t.map(V).join(" ")),n}return t.map(V).join(" ")}var b;(function(t){t[t.debug=0]="debug",t[t.info=1]="info",t[t.warn=2]="warn",t[t.error=3]="error",t[t.none=4]="none"})(b||(b={}));var Vi=["debug","info","warn","error","none"],pe=class ve{static get(){return new ve({})}constructor(e){var i,n,r;if(this.Xe=(n=b[(i=e.level)!=null?i:"info"])!=null?n:b.info,this.Qe=(r=e.name)!=null?r:"LaunchDarkly",this.se=e.formatter,typeof e.destination=="object")this.ae={[b.debug]:e.destination.debug,[b.info]:e.destination.info,[b.warn]:e.destination.warn,[b.error]:e.destination.error};else if(typeof e.destination=="function"){let{destination:a}=e;this.ae={[b.debug]:a,[b.info]:a,[b.warn]:a,[b.error]:a}}}tn(...e){var i;try{return this.se?(i=this.se)==null?void 0:i.call(this,...e):yt(...e)}catch(n){return yt(...e)}}en(e,i){try{e(i)}catch(n){console.error(i)}}k(e,i){var n;if(e>=this.Xe){let r=`${Vi[e]}: [${this.Qe}]`;try{let a=(n=this.ae)==null?void 0:n[e];a?this.en(a,`${r} ${this.tn(...i)}`):console.error(...i)}catch(a){console.error(...i)}}}error(...e){this.k(b.error,e)}warn(...e){this.k(b.warn,e)}info(...e){this.k(b.info,e)}debug(...e){this.k(b.debug,e)}},Mi={error:d.Function,warn:d.Function,info:d.Function,debug:d.Function},me=class{constructor(t,e){Object.entries(Mi).forEach(([i,n])=>{if(!n.is(t[i]))throw new Error(`Provided logger instance must support logger.${i}(...) method`)}),this.t=t,this.nn=e}k(t,e){try{this.t[t](...e)}catch(i){this.nn[t](...e)}}error(...t){this.k("error",t)}warn(...t){this.k("warn",t)}info(...t){this.k("info",t)}debug(...t){this.k("debug",t)}},ye=t=>{let e=new pe({level:"info",destination:console.error,formatter:yt});return t?new me(t,e):e},k=class{static deprecated(t,e){return`"${t}" is deprecated, please use "${e}"`}static optionBelowMinimum(t,e,i){return`Config option "${t}" had invalid value of ${e}, using minimum of ${i} instead`}static unknownOption(t){return`Ignoring unknown config option "${t}"`}static wrongOptionType(t,e,i){return`Config option "${t}" should be of type ${e}, got ${i}, using default value`}static wrongOptionTypeBoolean(t,e){return`Config option "${t}" should be a boolean, got ${e}, converting to boolean`}static invalidTagValue(t){return`Config option "${t}" must only contain letters, numbers, ., _ or -.`}static tagValueTooLong(t){return`Value of "${t}" was longer than 64 characters and was discarded.`}static partialEndpoint(t){return`You have set custom uris without specifying the ${t} URI; connections may not work properly`}},Fi=/^(\w|\.|-)+$/,Ui=d.stringMatchingRegex(Fi),zi={is:(t,e)=>Ui.is(t)?t.length>64?{valid:!1,message:k.tagValueTooLong(e)}:{valid:!0}:{valid:!1,message:k.invalidTagValue(e)}},Ki=class{constructor(t){let e={},i=t==null?void 0:t.application,n=t==null?void 0:t.logger;i&&Object.entries(i).forEach(([a,o])=>{if(o!=null){let{valid:s,message:l}=zi.is(o,`application.${a}`);s?a==="versionName"?e["application-version-name"]=[o]:e[`application-${a}`]=[o]:n==null||n.warn(l)}});let r=Object.keys(e);r.length&&(this.value=r.sort().flatMap(a=>e[a].sort().map(o=>`${a}/${o}`)).join(" "))}},Ji=class{constructor(t,e,i){this.platform=i,this.basicConfiguration={tags:e.tags,logger:e.logger,offline:e.offline,serviceEndpoints:e.serviceEndpoints,sdkKey:t}}};function ut(t){return t.replace(/\/+$/,"")}function Dt(t){return t.replace(/^\/+/,"").replace(/\?$/,"")}var et=class we{constructor(e,i,n=we.DEFAULT_EVENTS,r="/bulk",a="/diagnostic",o=!0,s){this.streaming=ut(e),this.polling=ut(i),this.events=ut(n),this.analyticsEventPath=r,this.diagnosticEventPath=a,this.includeAuthorizationHeader=o,this.payloadFilterKey=s}};et.DEFAULT_EVENTS="https://events.launchdarkly.com";function Et(t,e=[]){if(e.length===0)return t;let i=e.map(({key:n,value:r})=>`${n}=${r}`);return`${t}?${i.join("&")}`}function Bi(t,e,i){let n=Dt(e),r=[...i];return t.payloadFilterKey&&r.push({key:"filter",value:t.payloadFilterKey}),Et(`${t.streaming}/${n}`,r)}function Hi(t,e,i=[]){let n=Dt(e),r=[...i];return t.payloadFilterKey&&r.push({key:"filter",value:t.payloadFilterKey}),Et(`${t.polling}/${n}`,r)}function Ut(t,e,i=[]){let n=Dt(e);return Et(`${t.events}/${n}`,i)}var be=class extends Error{constructor(t){super(t),this.name="LaunchDarklyUnexpectedResponseError"}},qi=class extends Error{constructor(t){super(t),this.name="LaunchDarklyClientError"}},ke=class extends Error{constructor(t){super(t),this.name="LaunchDarklyTimeoutError"}};function rt(t){return t>=400&&t<500?t===400||t===408||t===429:!0}function _i(t){return t===413?!0:rt(t)}function Wi(t,e){let i,n;return{promise:new Promise((r,a)=>{n=r,i=setTimeout(()=>{let o=`${e} timed out after ${t} seconds.`;a(new ke(o))},t*1e3)}),cancel:()=>{n(),clearTimeout(i)}}}function De(t){return t==null?t:JSON.parse(JSON.stringify(t))}function ct(t){return Math.trunc(t*1e3)}var Gi=t=>JSON.stringify(t)==="{}",xt=(t,e)=>t&&Object.entries(t).reduce((i,[n,r])=>(r&&!Gi(r)&&!(e!=null&&e.includes(n))&&(i[n]=typeof r=="object"?xt(r,e):r),i),{});function G(t,e){if(t===e)return!0;if(t&&e&&typeof t=="object"&&typeof e=="object"){if(t.constructor!==e.constructor)return!1;var i,n,r;if(Array.isArray(t)){if(i=t.length,i!=e.length)return!1;for(n=i;n--!==0;)if(!G(t[n],e[n]))return!1;return!0}if(t instanceof Map&&e instanceof Map){if(t.size!==e.size)return!1;for(n of t.entries())if(!e.has(n[0]))return!1;for(n of t.entries())if(!G(n[1],e.get(n[0])))return!1;return!0}if(t instanceof Set&&e instanceof Set){if(t.size!==e.size)return!1;for(n of t.entries())if(!e.has(n[0]))return!1;return!0}if(ArrayBuffer.isView(t)&&ArrayBuffer.isView(e)){if(i=t.length,i!=e.length)return!1;for(n=i;n--!==0;)if(t[n]!==e[n])return!1;return!0}if(t.constructor===RegExp)return t.source===e.source&&t.flags===e.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===e.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===e.toString();if(r=Object.keys(t),i=r.length,i!==Object.keys(e).length)return!1;for(n=i;n--!==0;)if(!Object.prototype.hasOwnProperty.call(e,r[n]))return!1;for(n=i;n--!==0;){var a=r[n];if(!G(t[a],e[a]))return!1}return!0}return t!==t&&e!==e}function Zi(t,e,i,n=!0,r="user-agent"){let{userAgentBase:a,version:o,wrapperName:s,wrapperVersion:l}=e.sdkData(),u={[r]:`${a!=null?a:"NodeJSClient"}/${o}`};return n&&(u.authorization=t),s&&(u["x-launchdarkly-wrapper"]=l?`${s}/${l}`:s),i!=null&&i.value&&(u["x-launchdarkly-tags"]=i.value),u}function z(t,e,i){let n;t.status?n=`error ${t.status}${t.status===401?" (invalid SDK key)":""}`:n=`I/O error (${t.message||"unknown error"})`;let r=i!=null?i:"giving up permanently";return`Received ${n} for ${e} - ${r}`}function Ee({status:t}){return t?rt(t):!0}var zt=(t,e)=>e.btoa(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,""),xe=async(t=1e3)=>new Promise(e=>{setTimeout(e,t)}),Yi=class{constructor(t,e,i){this.a=e,this.rn=i,this.bt=[],this.oe=Date.now(),this.ce=this.oe,this.ue={diagnosticId:e.crypto.randomUUID(),sdkKeySuffix:t.length>6?t.substring(t.length-6):t}}createInitEvent(){var t,e,i;let n=this.a.info.sdkData(),r=this.a.info.platformData();return{kind:"diagnostic-init",id:this.ue,creationDate:this.oe,sdk:n,configuration:this.rn,platform:v({name:r.name,osArch:(t=r.os)==null?void 0:t.arch,osName:(e=r.os)==null?void 0:e.name,osVersion:(i=r.os)==null?void 0:i.version},r.additional||{})}}recordStreamInit(t,e,i){let n={timestamp:t,failed:e,durationMillis:i};this.bt.push(n)}createStatsEventAndReset(t,e,i){let n=Date.now(),r={kind:"diagnostic",id:this.ue,creationDate:n,dataSinceDate:this.ce,droppedEvents:t,deduplicatedUsers:e,eventsInLastBatch:i,streamInits:this.bt};return this.bt=[],this.ce=n,r}},wt;(function(t){t.MalformedFlag="MALFORMED_FLAG",t.UserNotSpecified="USER_NOT_SPECIFIED",t.FlagNotFound="FLAG_NOT_FOUND",t.ClientNotReady="CLIENT_NOT_READY",t.WrongType="WRONG_TYPE"})(wt||(wt={}));var Qi=wt,Ce=class{static invalidMetricValue(t){return`The track function was called with a non-numeric "metricValue" (${t}), only numeric metric values are supported.`}};Ce.MissingContextKeyNoEvent="Context was unspecified or had no key; event will not be sent";var Xi=class{constructor(t,e){let{basicConfiguration:i,platform:n}=t,{serviceEndpoints:{analyticsEventPath:r,diagnosticEventPath:a}}=i,{crypto:o,requests:s}=n;this.sn=v({},e),this.le=Ut(i.serviceEndpoints,r,[]),this.an=Ut(i.serviceEndpoints,a,[]),this._=s,this.cn=o}async et(t,e,i,n){let r={status:P.Succeeded},a=$(v({},this.sn),{"content-type":"application/json"});i&&(a["x-launchdarkly-payload-id"]=i,a["x-launchDarkly-event-schema"]="4");let o;try{let{status:s,headers:l}=await this._.fetch(e,{headers:a,body:JSON.stringify(t),compressBodyIfPossible:!0,method:"POST",keepalive:!0}),u=Date.parse(l.get("date")||"");if(u&&(r.serverTime=u),s<=204)return r;if(o=new be(z({status:s,message:"some events were dropped"},"event posting")),!rt(s))return _i(s)?r.status=P.Failed:r.status=P.FailedAndMustShutDown,r.error=o,r}catch(s){o=s}return o&&!n?(r.status=P.Failed,r.error=o,r):(await xe(),this.et(t,this.le,i,!1))}async sendEventData(t,e){let i=t===U.AnalyticsEvents?this.cn.randomUUID():void 0,n=t===U.AnalyticsEvents?this.le:this.an;return this.et(e,n,i,!0)}};function it(t){return t.kind==="feature"}function tn(t){return t.kind==="identify"}function en(t){return t.kind==="migration_op"}var nn=class{constructor(t,e,i,n,r,a){this.count=t,this.key=e,this.value=i,this.version=r,this.variation=a,this.default=n}increment(){this.count+=1}};function rn(t){return`${t.key}:${t.variation!==null&&t.variation!==void 0?t.variation:""}:${t.version!==null&&t.version!==void 0?t.version:""}`}var Se=class{constructor(t=!1,e){this.un=t,this.S=e,this.q=0,this.nt=0,this.it={},this.rt={}}summarizeEvent(t){if(it(t)&&!t.excludeFromSummaries){this.v||(this.v=t.context);let e=rn(t),i=this.it[e],n=this.rt[t.key];n||(n=new Set,this.rt[t.key]=n),t.context.kinds.forEach(r=>n.add(r)),i?i.increment():this.it[e]=new nn(1,t.key,t.value,t.default,t.version,t.variation),(this.q===0||t.creationDate<this.q)&&(this.q=t.creationDate),t.creationDate>this.nt&&(this.nt=t.creationDate)}}getSummary(){var t;let e=Object.values(this.it).reduce((n,r)=>{let a=n[r.key];a||(a={default:r.default,counters:[],contextKinds:[...this.rt[r.key]]},n[r.key]=a);let o={value:r.value,count:r.count};return r.variation!==void 0&&r.variation!==null&&(o.variation=r.variation),r.version!==void 0&&r.version!==null?o.version=r.version:o.unknown=!0,a.counters.push(o),n},{}),i={startDate:this.q,endDate:this.nt,features:e,kind:"summary",context:this.v!==void 0&&this.un?(t=this.S)==null?void 0:t.filter(this.v):void 0};return this.ln(),i}ln(){this.q=0,this.nt=0,this.it={},this.rt={}}},an=class extends Error{constructor(t){super(t),this.name="LaunchDarklyInvalidSDKKeyError"}},sn=class{constructor(t,e){this.S=t,this.t=e,this.W={}}summarizeEvent(t){var e;if(it(t)){let i=t.context.canonicalUnfilteredJson();if(!i){t.context.valid&&((e=this.t)==null||e.error("Unable to serialize context, likely the context contains a cycle."));return}let n=this.W[i];n||(this.W[i]=new Se(!0,this.S),n=this.W[i]),n.summarizeEvent(t)}}getSummaries(){let t=this.W;return this.W={},Object.values(t).map(e=>e.getSummary())}};function Z(t){let e=Math.trunc(t);return e===1?!0:e===0?!1:Math.floor(Math.random()*e)===0}function on(t){return t.getSummaries!==void 0}var ln=class{constructor(t,e,i,n,r,a=!0,o=!1){this.e=t,this.st=n,this.x=r,this.at=[],this.de=0,this.Dt=0,this.kt=0,this.St=!1,this.he=0,this.xt=!1,this.Lt=null,this.dn=t.eventsCapacity,this.t=e.basicConfiguration.logger,this.fe=new Xi(e,i),this.S=new $i(t.allAttributesPrivate,t.privateAttributes.map(s=>new F(s))),o?this.J=new sn(this.S,this.t):this.J=new Se,a&&this.start()}start(){var t,e;if(((t=this.st)==null?void 0:t.flushInterval)!==void 0&&(this.Lt=setInterval(()=>{var i;(i=this.st)==null||i.flush()},this.st.flushInterval*1e3)),this.hn=setInterval(async()=>{var i;try{await this.flush()}catch(n){(i=this.t)==null||i.debug(`Flush failed: ${n}`)}},this.e.flushInterval*1e3),this.x){let i=this.x.createInitEvent();this.pe(i),this.me=setInterval(()=>{let n=this.x.createStatsEventAndReset(this.Dt,this.kt,this.he);this.Dt=0,this.kt=0,this.pe(n)},this.e.diagnosticRecordingInterval*1e3)}(e=this.t)==null||e.debug("Started EventProcessor.")}pe(t){this.fe.sendEventData(U.DiagnosticEvent,t)}close(){clearInterval(this.hn),this.Lt&&clearInterval(this.Lt),this.me&&clearInterval(this.me)}async flush(){var t;if(this.xt)throw new an("Events cannot be posted because a permanent error has been encountered. This is most likely an invalid SDK key. The specific error information is logged independently.");let e=this.at;if(this.at=[],on(this.J))this.J.getSummaries().forEach(i=>{Object.keys(i.features).length&&e.push(i)});else{let i=this.J.getSummary();Object.keys(i.features).length&&e.push(i)}e.length&&(this.he=e.length,(t=this.t)==null||t.debug("Flushing %d events",e.length),await this.et(e))}sendEvent(t){var e;if(this.xt)return;if(en(t)){if(Z(t.samplingRatio)){let s=$(v({},t),{context:t.context?this.S.filter(t.context):void 0});s.samplingRatio===1&&delete s.samplingRatio,this.ot(s)}return}this.J.summarizeEvent(t);let i=it(t),n=i&&t.trackEvents||!i,r=this.fn(t),a=tn(t),o=(e=this.st)==null?void 0:e.processContext(t.context);o||a||(this.kt+=1),o&&!a&&this.ot(this.Ot({kind:"index",creationDate:t.creationDate,context:t.context,samplingRatio:1},!1)),n&&Z(t.samplingRatio)&&this.ot(this.Ot(t,!1)),r&&Z(t.samplingRatio)&&this.ot(this.Ot(t,!0))}Ot(t,e){switch(t.kind){case"feature":{let i={kind:e?"debug":"feature",creationDate:t.creationDate,context:this.S.filter(t.context,!e),key:t.key,value:t.value,default:t.default};return t.samplingRatio!==1&&(i.samplingRatio=t.samplingRatio),t.prereqOf&&(i.prereqOf=t.prereqOf),t.variation!==void 0&&(i.variation=t.variation),t.version!==void 0&&(i.version=t.version),t.reason&&(i.reason=t.reason),i}case"index":case"identify":{let i={kind:t.kind,creationDate:t.creationDate,context:this.S.filter(t.context)};return t.samplingRatio!==1&&(i.samplingRatio=t.samplingRatio),i}case"custom":{let i={kind:"custom",creationDate:t.creationDate,key:t.key,context:this.S.filter(t.context)};return t.samplingRatio!==1&&(i.samplingRatio=t.samplingRatio),t.data!==void 0&&(i.data=t.data),t.metricValue!==void 0&&(i.metricValue=t.metricValue),t.url!==void 0&&(i.url=t.url),i}case"click":return{kind:"click",creationDate:t.creationDate,contextKeys:t.context.kindsAndKeys,key:t.key,url:t.url,selector:t.selector};case"pageview":return{kind:"pageview",creationDate:t.creationDate,contextKeys:t.context.kindsAndKeys,key:t.key,url:t.url};default:return t}}ot(t){var e;this.at.length<this.dn?(this.at.push(t),this.St=!1):(this.St||(this.St=!0,(e=this.t)==null||e.warn("Exceeded event queue capacity. Increase capacity to avoid dropping events.")),this.Dt+=1)}fn(t){return it(t)&&t.debugEventsUntilDate&&t.debugEventsUntilDate>this.de&&t.debugEventsUntilDate>Date.now()}async et(t){let e=await this.fe.sendEventData(U.AnalyticsEvents,t);if(e.status===P.FailedAndMustShutDown&&(this.xt=!0),e.serverTime&&(this.de=e.serverTime),e.error)throw e.error}},Re=class{constructor(t,e,i,n,r=1,a){this.context=t,this.key=e,this.data=i,this.metricValue=n,this.samplingRatio=r,this.url=a,this.kind="custom",this.creationDate=Date.now(),this.context=t}},bt=class{constructor(t,e,i,n,r,a,o,s,l,u,c,h,g=1){this.withReasons=t,this.context=e,this.key=i,this.samplingRatio=g,this.kind="feature",this.creationDate=Date.now(),this.value=n,this.default=r,a!==void 0&&(this.version=a),o!==void 0&&(this.variation=o),s!==void 0&&(this.trackEvents=s),l!==void 0&&(this.prereqOf=l),u!==void 0&&(this.reason=u),c!==void 0&&(this.debugEventsUntilDate=c),h!==void 0&&(this.excludeFromSummaries=h)}},Oe=class{constructor(t,e=1){this.context=t,this.samplingRatio=e,this.kind="identify",this.creationDate=Date.now()}},un=class{close(){}async flush(){}sendEvent(){}},cn=class{constructor(t){this.Pt=t}evalEvent(t){var e;return new bt(this.Pt,t.context,t.flagKey,t.value,t.defaultVal,t.version,(e=t.variation)!=null?e:void 0,t.trackEvents||t.addExperimentData,t.prereqOfFlagKey,this.Pt||t.addExperimentData?t.reason:void 0,t.debugEventsUntilDate,t.excludeFromSummaries,t.samplingRatio)}unknownFlagEvent(t,e,i){return new bt(this.Pt,i,t,e,e,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0)}identifyEvent(t){return new Oe(t,1)}customEvent(t,e,i,n,r=1){return new Re(e,t,i!=null?i:void 0,n!=null?n:void 0,r)}},Kt="FDv1Fallback";function hn(t){return{pn:t,ge:"",useSelector(e){return this.ge=e,this},processFullTransfer(e){let i=[{event:"server-intent",data:{payloads:[{id:Kt,target:1,intentCode:"xfer-full",reason:"payload-missing"}]}}];Object.entries((e==null?void 0:e.flags)||[]).forEach(([n,r])=>{i.push({event:"put-object",data:{kind:"flag",key:n,version:r.version||1,object:r}})}),Object.entries((e==null?void 0:e.segments)||[]).forEach(([n,r])=>{i.push({event:"put-object",data:{kind:"segment",key:n,version:r.version||1,object:r}})}),i.push({event:"payload-transferred",data:{state:this.ge,version:1,id:Kt}}),this.pn.processEvents(i)}}}var S={type:"none"};function Ie(t,e){let i="inactive",n,r="partial",a=[];function o(f,x){var C;return(C=t[f])==null?void 0:C.call(t,x)}function s(){i="inactive",n=void 0,r="partial",a=[]}function l(){i="changes",r="partial",a=[]}function u(){a=[]}function c(f){return!f.id||T(f.target)?(e==null||e.warn(`Ignoring 'none' intent with missing fields: id=${f.id}, target=${f.target}`),S):{type:"payload",payload:{id:f.id,version:f.target,type:"none",updates:[]}}}function h(f){var x;if(!((x=f.payloads)!=null&&x.length))return{type:"error",kind:"MISSING_PAYLOAD",message:"No payload present in server-intent"};let C=f.payloads[0];switch(C==null?void 0:C.intentCode){case"xfer-full":return i="full",a=[],r="full",n=C.id,S;case"xfer-changes":return i="changes",a=[],r="partial",n=C.id,S;case"none":return i="changes",a=[],r="partial",n=C.id,c(C);default:return e==null||e.warn(`Unable to process intent code '${C==null?void 0:C.intentCode}'.`),S}}function g(f){if(i==="inactive"||!n)return e==null||e.warn("Received put-object before server-intent was established. Ignoring."),S;if(!f.kind||!f.key||T(f.version)||!f.object)return e==null||e.warn(`Ignoring put-object with missing fields: kind=${f.kind}, key=${f.key}, version=${f.version}`),S;let x=o(f.kind,f.object);return x?(a.push({kind:f.kind,key:f.key,version:f.version,object:x}),S):(e==null||e.warn(`Unable to process object for kind: '${f.kind}'`),S)}function p(f){return i==="inactive"||!n?(e==null||e.warn("Received delete-object before server-intent was established. Ignoring."),S):!f.kind||!f.key||T(f.version)?(e==null||e.warn(`Ignoring delete-object with missing fields: kind=${f.kind}, key=${f.key}, version=${f.version}`),S):(a.push({kind:f.kind,key:f.key,version:f.version,deleted:!0}),S)}function m(f){if(i==="inactive")return{type:"error",kind:"PROTOCOL_ERROR",message:"A payload transferred has been received without an intent having been established."};if(!n||T(f.state)||T(f.version))return e==null||e.warn(`Ignoring payload-transferred with missing fields: state=${f.state}, version=${f.version}`),s(),S;let x={type:"payload",payload:{id:n,version:f.version,state:f.state,type:r,updates:a}};return l(),x}function w(f){return e==null||e.info(`Goodbye was received from the LaunchDarkly connection with reason: ${f.reason}.`),s(),{type:"goodbye",reason:f.reason}}function D(f){return e==null||e.info(`An issue was encountered receiving updates for payload ${n} with reason: ${f.reason}.`),u(),{type:"serverError",id:f.payload_id,reason:f.reason}}return{get state(){return i},processEvent(f){switch(f.event){case"server-intent":return h(f.data);case"put-object":return g(f.data);case"delete-object":return p(f.data);case"payload-transferred":return m(f.data);case"goodbye":return w(f.data);case"error":return D(f.data);case"heart-beat":return S;default:return{type:"error",kind:"UNKNOWN_EVENT",message:`Received an unknown event of type '${f.event}'`}}},reset(){s()}}}function dn(t){return t==="MISSING_PAYLOAD"||t==="PROTOCOL_ERROR"}var Le=class{constructor(t,e,i){this.m=e,this.t=i,this.n=[],this.mn=Ie(t,i)}addPayloadListener(t){this.n.push(t)}removePayloadListener(t){let e=this.n.indexOf(t,0);e>-1&&this.n.splice(e,1)}processEvents(t){t.forEach(e=>{var i,n;let r=this.mn.processEvent(e);switch(r.type){case"payload":this.n.forEach(a=>a(r.payload));break;case"error":dn(r.kind)?(i=this.m)==null||i.call(this,E.InvalidData,r.message):(n=this.t)==null||n.warn(r.message);break}})}},fn=class{constructor(t,e,i,n){this.m=i,this.t=n,this.V(t,"server-intent"),this.V(t,"put-object"),this.V(t,"delete-object"),this.V(t,"payload-transferred"),this.V(t,"goodbye"),this.V(t,"error"),this.Ct=new Le(e,i,n)}addPayloadListener(t){this.Ct.addPayloadListener(t)}removePayloadListener(t){this.Ct.removePayloadListener(t)}V(t,e){t.addEventListener(e,async i=>{var n,r,a,o,s;if(i!=null&&i.data){(n=this.t)==null||n.debug(`Received ${e} event. Data is ${i.data}`);try{this.Ct.processEvents([{event:e,data:JSON.parse(i.data)}])}catch(l){(r=this.t)==null||r.error(`Stream received data that was unable to be processed in "${e}" message`),(a=this.t)==null||a.debug(`Data follows: ${i.data}`),(o=this.m)==null||o.call(this,E.InvalidData,"Malformed data in EventStream.")}}else(s=this.m)==null||s.call(this,E.Unknown,"Event from EventStream missing data.")})}};function gn(t){if(t){let e=Object.keys(t).find(i=>i.toLowerCase()==="x-ld-envid");if(e)return{environmentId:t[e]}}}var Jt="unknown plugin";function nt(t,e){try{return e.getMetadata().name||Jt}catch(i){return t.error("Exception thrown getting metadata for plugin. Unable to get plugin name."),Jt}}function pn(t,e,i){let n=[];return i.forEach(r=>{var a;try{let o=(a=r.getHooks)==null?void 0:a.call(r,e);o===void 0?t.error(`Plugin ${nt(t,r)} returned undefined from getHooks.`):o&&o.length>0&&n.push(...o)}catch(o){t.error(`Exception thrown getting hooks for plugin ${nt(t,r)}. Unable to get hooks.`)}}),n}function vn(t,e,i,n){n.forEach(r=>{try{r.register(i,e)}catch(a){t.error(`Exception thrown registering plugin ${nt(t,r)}.`)}})}var I=Object.freeze({__proto__:null,ClientMessages:Ce,DiagnosticsManager:Yi,ErrorKinds:Qi,EventFactoryBase:cn,EventProcessor:ln,FDv1PayloadAdaptor:hn,InputCustomEvent:Re,InputEvalEvent:bt,InputIdentifyEvent:Oe,NullEventProcessor:un,PayloadProcessor:Le,PayloadStreamReader:fn,canonicalize:Q,createProtocolHandler:Ie,initMetadataFromHeaders:gn,isLegacyUser:ge,isMultiKind:fe,isSingleKind:de,safeGetHooks:pn,safeGetName:nt,safeRegisterPlugins:vn,shouldSample:Z}),Bt={Initializing:"INITIALIZING",Valid:"VALID",Interrupted:"INTERRUPTED",SetOffline:"SET_OFFLINE",Closed:"CLOSED"};function mn(t){return t>=200&&t<=299}var Ht=class extends Error{constructor(t,e){super(t),this.status=e,this.name="LaunchDarklyRequestError"}};function qt(t,e,i,n,r,a,o,s,l,u){let c,h="GET",g=v({},a);l&&(h="REPORT",g["content-type"]="application/json",c=t);let p=l?i.pathReport(r,t):i.pathGet(r,t),m=[...o!=null?o:[]];s&&m.push({key:"withReasons",value:"true"}),u&&m.push({key:"h",value:u});let w=Hi(e,p,m);return{async requestPayload(){let D;try{let f=await n.fetch(w,{method:h,headers:g,body:c});if(mn(f.status))return await f.text();D=f.status}catch(f){throw new Ht(f==null?void 0:f.message)}throw new Ht(`Unexpected status code: ${D}`,D)}}}var _t=new Error("Task has already been executed or shed. This is likely an implementation error. The task will not be executed again.");function yn(t,e,i=!1){let n,r=new Promise(s=>{n=(l,u)=>{var c;try{(c=t.after)==null||c.call(t,l,u)}catch(h){e==null||e.error(`Error in after callback: ${h}`)}s(l)}}),a=t.before?t.before():Promise.resolve(void 0),o=!1;return{execute:()=>{o&&(e==null||e.error(_t)),o=!0,a.then(s=>{t.execute(s).then(l=>n({status:"complete",result:l},s)).catch(l=>n({status:"error",error:l},s))}).catch(s=>{e==null||e.error(s),n({status:"error",error:s},void 0)})},shed:()=>{o&&(e==null||e.error(_t)),o=!0,a.then(s=>{n({status:"shed"},s)})},promise:r,sheddable:i}}function wn(t){let e,i=[];function n(){if(!e&&i.length>0){let r=i.shift();e=r.promise.finally(()=>{e=void 0,n()}),r.execute()}}return{execute(r,a=!1){var o,s;let l=yn(r,t,a);return e?((o=i[i.length-1])!=null&&o.sheddable&&((s=i.pop())==null||s.shed()),i.push(l)):(e=l.promise.finally(()=>{e=void 0,n()}),l.execute()),l.promise},pendingCount(){return i.length}}}function $e(t){return"validate"in t}function at(t,e,i,n,r){let a=v({},i);return T(t)?a:d.Object.is(t)?(Object.entries(t).forEach(([o,s])=>{let l=e[o],u=r?`${r}.${o}`:o;if(!l){n==null||n.warn(k.unknownOption(u));return}if(T(s))return;if($e(l)){let h=l.validate(s,u,n,i[o]);h!==void 0&&(a[o]=h.value);return}if(l.is(s)){a[o]=s;return}let c=l.getType();c==="boolean"?(n==null||n.warn(k.wrongOptionTypeBoolean(u,typeof s)),a[o]=!!s):c==="boolean | undefined | null"?(n==null||n.warn(k.wrongOptionTypeBoolean(u,typeof s)),typeof s!="boolean"&&typeof s!="undefined"&&s!==null&&(a[o]=!!s)):l instanceof ce&&d.Number.is(s)?(n==null||n.warn(k.optionBelowMinimum(u,s,l.min)),a[o]=l.min):n==null||n.warn(k.wrongOptionType(u,c,typeof s))}),a):(n==null||n.warn(k.wrongOptionType(r!=null?r:"config","object",typeof t)),a)}function B(t,e){return{is:i=>d.Object.is(i),getType:()=>"object",validate(i,n,r,a){if(!d.Object.is(i)){r==null||r.warn(k.wrongOptionType(n,"object",typeof i));return}let o=e!=null?e:d.Object.is(a)?a:{},s=at(i,t,o,r,n);return Object.keys(s).length>0?{value:s}:void 0}}}function Te(t,e){return{is:i=>Array.isArray(i),getType:()=>"array",validate(i,n,r){if(!Array.isArray(i)){r==null||r.warn(k.wrongOptionType(n,"array",typeof i));return}let a=[];return i.forEach((o,s)=>{let l=`${n}[${s}]`;if(T(o)||!d.Object.is(o)){r==null||r.warn(k.wrongOptionType(l,"object",typeof o));return}let u=o,c=u[t],h=typeof c=="string"?e[c]:void 0;if(!h){let g=Object.keys(e).join(" | "),p=typeof c=="string"?c:typeof c;r==null||r.warn(k.wrongOptionType(`${l}.${t}`,g,p));return}a.push(at(u,h,{},r,l))}),{value:a}}}}function bn(...t){return{is:e=>t.some(i=>i.is(e)),getType:()=>t.map(e=>e.getType()).join(" | "),validate(e,i,n,r){let a=t.find(o=>o.is(e));if(a)return $e(a)?a.validate(e,i,n,r):{value:e};n==null||n.warn(k.wrongOptionType(i,this.getType(),typeof e))}}}function kn(t,e){return{is:i=>d.Object.is(i),getType:()=>"object",validate(i,n,r,a){if(T(i))return;if(!d.Object.is(i)){r==null||r.warn(k.wrongOptionType(n,"object",typeof i));return}let o=i,s={},l={};Object.keys(o).forEach(c=>{t.is(c)?(s[c]=o[c],l[c]=e):r==null||r.warn(k.wrongOptionType(n,t.getType(),c))});let u=d.Object.is(a)?a:{};return{value:at(s,l,u,r,n)}}}}var Ct=d.oneOf("cache","polling","streaming"),kt=d.oneOf("streaming","polling","offline","one-shot","background"),Pe={pollingBaseUri:d.String,streamingBaseUri:d.String},Dn={type:Ct},Ne={type:Ct,pollInterval:d.numberWithMin(30),endpoints:B(Pe)},je={type:Ct,initialReconnectDelay:d.numberWithMin(1),endpoints:B(Pe)},En=Te("type",{cache:Dn,polling:Ne,streaming:je}),xn=Te("type",{polling:Ne,streaming:je}),Cn={initializers:En,synchronizers:xn},Sn=kn(kt,B(Cn)),Rn={lifecycle:d.Boolean,network:d.Boolean},On={initialConnectionMode:kt,backgroundConnectionMode:kt,automaticModeSwitching:bn(d.Boolean,B(Rn)),connectionModes:Sn},In={initialConnectionMode:"one-shot",backgroundConnectionMode:void 0,automaticModeSwitching:!1};function Ln(t){return{logger:d.Object,maxCachedContexts:d.numberWithMin(0),baseUri:d.String,streamUri:d.String,eventsUri:d.String,capacity:d.numberWithMin(1),diagnosticRecordingInterval:d.numberWithMin(2),flushInterval:d.numberWithMin(2),streamInitialReconnectDelay:d.numberWithMin(0),allAttributesPrivate:d.Boolean,debug:d.Boolean,diagnosticOptOut:d.Boolean,withReasons:d.Boolean,sendEvents:d.Boolean,pollInterval:d.numberWithMin(30),useReport:d.Boolean,privateAttributes:d.StringArray,disableCache:d.Boolean,applicationInfo:d.Object,wrapperName:d.String,wrapperVersion:d.String,payloadFilterKey:d.stringMatchingRegex(/^[a-zA-Z0-9](\w|\.|-)*$/),hooks:d.createTypeArray("Hook[]",{}),inspectors:d.createTypeArray("LDInspection",{}),cleanOldPersistentData:d.Boolean,dataSystem:t!=null&&t.dataSystemDefaults?B(On,t.dataSystemDefaults):d.Object}}var $n=300,Ae="https://clientsdk.launchdarkly.com",Ve="https://clientstream.launchdarkly.com";function Tn(t){return t instanceof me?t:ye(t)}var Pn=class{constructor(t={},e={getImplementationHooks:()=>[],credentialType:"mobileKey"}){var i,n,r;this.logger=ye(),this.baseUri=Ae,this.eventsUri=et.DEFAULT_EVENTS,this.streamUri=Ve,this.maxCachedContexts=5,this.disableCache=!1,this.capacity=100,this.diagnosticRecordingInterval=900,this.flushInterval=30,this.streamInitialReconnectDelay=1,this.allAttributesPrivate=!1,this.debug=!1,this.diagnosticOptOut=!1,this.sendEvents=!0,this.sendLDHeaders=!0,this.useReport=!1,this.withReasons=!1,this.privateAttributes=[],this.pollInterval=$n,this.hooks=[],this.inspectors=[],this.logger=Tn(t.logger);let a=Ln({dataSystemDefaults:e.dataSystemDefaults}),o=at(t,a,{},this.logger);Object.entries(o).forEach(([s,l])=>{s!=="logger"&&(this[s]=l)}),this.serviceEndpoints=new et(this.streamUri,this.baseUri,this.eventsUri,e.analyticsEventPath,e.diagnosticEventPath,e.includeAuthorizationHeader,t.payloadFilterKey),this.useReport=(i=t.useReport)!=null?i:!1,this.tags=new Ki({application:this.applicationInfo,logger:this.logger}),this.userAgentHeaderName=(n=e.userAgentHeaderName)!=null?n:"user-agent",this.trackEventModifier=(r=e.trackEventModifier)!=null?r:(s=>s),this.credentialType=e.credentialType,this.getImplementationHooks=e.getImplementationHooks}};async function St(t,e){if(t.digest)return t.digest(e);if(t.asyncDigest)return t.asyncDigest(e);throw new Error("Platform must implement digest or asyncDigest")}var Me=async(t,{crypto:e,storage:i})=>{let n=await(i==null?void 0:i.get(t));return n||(n=e.randomUUID(),await(i==null?void 0:i.set(t,n))),n};function Fe(t){return async e=>St(t.createHash("sha256").update(e),"base64")}var L=async t=>t;async function H(t){return(await Promise.all(t.map(e=>e.transform(e.value)))).join("_")}async function Nn(t,e){return H([{value:"LaunchDarkly",transform:L},{value:e,transform:Fe(t)}])}async function jn(t){return H([{value:"LaunchDarkly",transform:L},{value:"AnonymousKeys",transform:L},{value:t,transform:L}])}async function An(t){return H([{value:"LaunchDarkly",transform:L},{value:"ContextKeys",transform:L},{value:t,transform:L}])}async function Vn(t){return H([{value:t,transform:L},{value:"ContextIndex",transform:L}])}async function Ue(t,e,i){return H([{value:e,transform:L},{value:i.canonicalKey,transform:Fe(t)}])}var{isLegacyUser:Mn,isSingleKind:ht,isMultiKind:Wt}=I,ze="1.0",Fn=t=>{let e=t,{kind:i}=e,n=oe(e,["kind"]);return{kind:"multi",[i]:n}},Un=async({crypto:t,info:e},{applicationInfo:i})=>{var n;let{ld_application:r}=e.platformData(),a=(n=xt(r))!=null?n:{},o=(i==null?void 0:i.id)||(a==null?void 0:a.id);if(o){let s=(i==null?void 0:i.version)||(a==null?void 0:a.version),l=(i==null?void 0:i.name)||(a==null?void 0:a.name),u=(i==null?void 0:i.versionName)||(a==null?void 0:a.versionName);return a=v(v(v($(v({},a),{id:o}),s?{version:s}:{}),l?{name:l}:{}),u?{versionName:u}:{}),a.key=await St(t.createHash("sha256").update(o),"base64"),a.envAttributesVersion=a.envAttributesVersion||ze,a}},zn=async t=>{var e,i,n,r;let{ld_device:a,os:o}=t.info.platformData(),s=(e=xt(a))!=null?e:{},l=(o==null?void 0:o.name)||((i=s.os)==null?void 0:i.name),u=(o==null?void 0:o.version)||((n=s.os)==null?void 0:n.version),c=(r=s.os)==null?void 0:r.family;if((l||u||c)&&(s.os=v(v(v({},l?{name:l}:{}),u?{version:u}:{}),c?{family:c}:{})),Object.keys(s).filter(h=>h!=="key"&&h!=="envAttributesVersion").length){let h=await An("ld_device");return s.key=await Me(h,t),s.envAttributesVersion=s.envAttributesVersion||ze,s}},Kn=async(t,e,i)=>{if(Mn(t))return t;let n,r;if(ht(t)&&t.kind!=="ld_application"||Wt(t)&&!t.ld_application?n=await Un(e,i):i.logger.warn("Not adding ld_application environment attributes because it already exists."),ht(t)&&t.kind!=="ld_device"||Wt(t)&&!t.ld_device?r=await zn(e):i.logger.warn("Not adding ld_device environment attributes because it already exists."),n||r){let a=ht(t)?Fn(t):t;return v(v(v({},a),n?{ld_application:n}:{}),r?{ld_device:r}:{})}return t};function Jn(){let t,e;return{set(i,n){t=i,e=n},getContext(){return e},getUnwrappedContext(){return t},newIdentificationPromise(){let i,n;return{identifyPromise:new Promise((r,a)=>{i=r,n=a}),identifyResolve:i,identifyReject:n}},hasContext(){return e!==void 0},hasValidContext(){return this.hasContext()&&e.valid}}}var{isLegacyUser:Bn,isMultiKind:Hn,isSingleKind:qn}=I,Rt=async(t,e,i)=>{let{anonymous:n,key:r}=e;if(n&&!r){let a=await jn(t);e.key=await Me(a,i)}},_n=async(t,e)=>{await Rt(t.kind,t,e)},Wn=async(t,e)=>{let i=t,{kind:n}=i,r=oe(i,["kind"]);return Promise.all(Object.entries(r).map(([a,o])=>Rt(a,o,e)))},Gn=async(t,e)=>{await Rt("user",t,e)},Zn=async(t,e)=>{let i=De(t);return qn(i)&&await _n(i,e),Hn(i)&&await Wn(i,e),Bn(i)&&await Gn(i,e),i},Yn=t=>({customBaseURI:t.serviceEndpoints.polling!==Ae,customStreamURI:t.serviceEndpoints.streaming!==Ve,customEventsURI:t.serviceEndpoints.events!==et.DEFAULT_EVENTS,eventsCapacity:t.capacity,eventsFlushIntervalMillis:ct(t.flushInterval),reconnectTimeMillis:ct(t.streamInitialReconnectDelay),diagnosticRecordingIntervalMillis:ct(t.diagnosticRecordingInterval),allAttributesPrivate:t.allAttributesPrivate,usingSecureMode:!1,bootstrapMode:!1}),Qn=(t,e,i)=>{if(e.sendEvents&&!e.diagnosticOptOut)return new I.DiagnosticsManager(t,i,Yn(e))};function Gt(t,e){return{value:e!=null?e:null,variationIndex:null,reason:{kind:"ERROR",errorKind:t}}}function Zt(t,e,i){return v({value:t,variationIndex:e!=null?e:null},i!==void 0&&{reason:i})}var Xn=(t,e,i,n,r)=>{if(e.sendEvents)return new I.EventProcessor($(v({},e),{eventsCapacity:e.capacity}),new Ji(t,e,i),n,void 0,r,!1,!0)},Yt=class extends I.EventFactoryBase{evalEventClient(t,e,i,n,r,a){let{trackEvents:o,debugEventsUntilDate:s,trackReason:l,flagVersion:u,version:c,variation:h}=n;return super.evalEvent({addExperimentData:l,context:r,debugEventsUntilDate:s,defaultVal:i,flagKey:t,reason:a,trackEvents:!!o,value:e,variation:h,version:u!=null?u:c})}},Qt="_freshness";async function tr(t,e){let i=e.canonicalUnfilteredJson();if(i)return St(t.createHash("sha256").update(i),"base64")}function er(t){return t!==null&&typeof t=="object"&&typeof t.version=="number"}async function ir(t,e,i,n,r){let a=await Ue(e,i,n),o=await t.get(a),s=!1;if(o==null){if(o=await t.get(n.canonicalKey),o==null)return;s=!0}try{let l=JSON.parse(o);if(l===null||typeof l!="object"){r==null||r.warn("Cached flag data is not a valid object");return}let u=Object.entries(l),c=u.find(([,h])=>!er(h));if(c){r==null||r.warn(`Discarding cached flags due to invalid entry: ${c[0]}`);return}return{flags:u.reduce((h,[g,p])=>(h[g]=p,h),{}),storageKey:a,fromLegacyKey:s}}catch(l){r==null||r.warn(`Could not parse cached flag evaluations from persistent storage: ${l.message}`);return}}var dt=class Ke{constructor(){this.container={index:new Array}}static fromJson(e){let i=new Ke;try{i.container=JSON.parse(e)}catch(n){}return i}toJson(){return JSON.stringify(this.container)}notice(e,i){let n=this.container.index.find(r=>r.id===e);n===void 0?this.container.index.push({id:e,timestamp:i}):n.timestamp=i}prune(e){let i=Math.max(e,0);return this.container.index.length>i?(this.container.index.sort((n,r)=>n.timestamp-r.timestamp),this.container.index.splice(0,this.container.index.length-i)):[]}},nr=class{constructor(t,e,i,n,r,a,o,s=()=>Date.now()){this.a=t,this.It=e,this.ct=i,this.ye=n,this.A=r,this.y=a,this.t=o,this.gn=s,this.ve=Vn(this.It)}async init(t,e){this.y.init(t,e),await this.At(t)}async upsert(t,e,i){return this.y.upsert(t,e,i)?(await this.At(t),!0):!1}async applyChanges(t,e,i){this.y.applyChanges(t,e,i),await this.At(t)}async loadCached(t){if(this.ye||this.ct<=0||!this.a.storage)return!1;let e=await ir(this.a.storage,this.a.crypto,this.It,t,this.t);if(!e)return!1;e.fromLegacyKey&&(await this.a.storage.set(e.storageKey,JSON.stringify(e.flags)),await this.a.storage.clear(t.canonicalKey));let i=Object.entries(e.flags).reduce((n,[r,a])=>(n[r]={version:a.version,flag:a},n),{});return this.y.initCached(t,i),this.t.debug("Loaded cached flag evaluations from persistent storage"),!0}async yn(t,e,i){var n;let r=await tr(this.a.crypto,e);if(r===void 0){this.t.error("Could not serialize context for freshness tracking");return}let a={timestamp:i,contextHash:r};await((n=this.a.storage)==null?void 0:n.set(`${t}${Qt}`,JSON.stringify(a)))}async vn(){var t;if(this.H!==void 0)return this.H;let e=await((t=this.a.storage)==null?void 0:t.get(await this.ve));if(!e)return this.H=new dt,this.H;try{this.H=dt.fromJson(e),this.t.debug("Loaded context index from persistent storage")}catch(i){this.t.warn(`Could not load index from persistent storage: ${i.message}`),this.H=new dt}return this.H}async At(t){var e,i;if(this.ye)return;let n=this.gn(),r=await this.vn(),a=await Ue(this.a.crypto,this.It,t);this.ct>0&&r.notice(a,n);let o=r.prune(this.ct),s=this.ct<=0||o.some(h=>h.id===a);if(await Promise.all(o.flatMap(h=>{var g,p;return[(g=this.a.storage)==null?void 0:g.clear(h.id),(p=this.a.storage)==null?void 0:p.clear(`${h.id}${Qt}`)]})),await((e=this.a.storage)==null?void 0:e.set(await this.ve,r.toJson())),s)return;let l=this.A.getAll(),u=Object.entries(l).reduce((h,[g,p])=>(p.flag!==null&&p.flag!==void 0&&(h[g]=p.flag),h),{}),c=JSON.stringify(u);await((i=this.a.storage)==null?void 0:i.set(a,c));try{await this.yn(a,t,n)}catch(h){this.t.warn(`Failed to store freshness data: ${h.message}`)}}};function rr(){let t={};return{init(e){t=Object.entries(e).reduce((i,[n,r])=>(i[n]=r,i),{})},insertOrUpdate(e,i){t[e]=i},get(e){if(Object.prototype.hasOwnProperty.call(t,e))return t[e]},getAll(){return t},applyChanges(e,i){i==="full"?this.init(e):i==="partial"&&Object.entries(e).forEach(([n,r])=>{t[n]=r})}}}function Xt(t,e){let i=[];return Object.entries(t).forEach(([n,r])=>{let a=e[n];(!a||!G(r,a))&&i.push(n)}),Object.keys(e).forEach(n=>{t[n]||i.push(n)}),i}function ar(t,e){let i=t,n=e,r,a=new Array;return{handleFlagChanges(o,s){r?a.forEach(l=>{try{l(r,o,s)}catch(u){}}):n.warn("Received a change event without an active context. Changes will not be propagated.")},init(o,s){r=o;let l=i.getAll();i.init(s);let u=Xt(l,s);u.length>0&&this.handleFlagChanges(u,"init")},initCached(o,s){(r==null?void 0:r.canonicalKey)!==o.canonicalKey&&this.init(o,s)},applyChanges(o,s,l){r=o;let u=i.getAll();if(i.applyChanges(s,l),l==="full"){let c=Xt(u,s);c.length>0&&this.handleFlagChanges(c,"init")}else if(l==="partial"){let c=Object.keys(s);c.length>0&&this.handleFlagChanges(c,"patch")}},upsert(o,s,l){if((r==null?void 0:r.canonicalKey)!==o.canonicalKey)return n.warn("Received an update for an inactive context."),!1;let u=i.get(s);return u!==void 0&&u.version>=l.version?!1:(i.insertOrUpdate(s,l),this.handleFlagChanges([s],"patch"),!0)},on(o){a.push(o)},off(o){let s=a.indexOf(o);s>-1&&a.splice(s,1)}}}var sr=class{constructor(t,e,i,n,r,a=()=>Date.now()){this.A=rr(),this.y=ar(this.A,r),this.ut=this.wn(t,e,i,n,r,a)}async wn(t,e,i,n,r,a=()=>Date.now()){let o=await Nn(t.crypto,e);return new nr(t,o,i,n,this.A,this.y,r,a)}get(t){return this.r&&Object.prototype.hasOwnProperty.call(this.r,t)?this.Tt(this.r[t]):this.A.get(t)}getAll(){return this.r?v(v({},this.A.getAll()),Object.entries(this.r).reduce((t,[e,i])=>(t[e]=this.Tt(i),t),{})):this.A.getAll()}presetFlags(t){this.A.init(t)}setBootstrap(t,e){this.y.init(t,e)}async init(t,e){return(await this.ut).init(t,e)}async upsert(t,e,i){return(await this.ut).upsert(t,e,i)}async loadCached(t){return(await this.ut).loadCached(t)}async applyChanges(t,e,i){return(await this.ut).applyChanges(t,e,i)}on(t){this.y.on(t)}off(t){this.y.off(t)}Tt(t){return{flag:{value:t,version:0},version:0}}setOverride(t,e){this.r||(this.r={}),this.r[t]=e,this.y.handleFlagChanges([t],"override")}removeOverride(t){!this.r||!Object.prototype.hasOwnProperty.call(this.r,t)||(delete this.r[t],Object.keys(this.r).length===0&&(this.r=void 0),this.y.handleFlagChanges([t],"override"))}clearAllOverrides(){if(this.r){let t=v({},this.r);this.r=void 0,this.y.handleFlagChanges(Object.keys(t),"override")}}getAllOverrides(){if(!this.r)return{};let t={};return Object.entries(this.r).forEach(([e,i])=>{t[e]=this.Tt(i)}),t}getDebugOverride(){return{setOverride:this.setOverride.bind(this),removeOverride:this.removeOverride.bind(this),clearAllOverrides:this.clearAllOverrides.bind(this),getAllOverrides:this.getAllOverrides.bind(this)}}},te="unknown hook",Je="beforeEvaluation",Be="afterEvaluation",or="afterTrack";function q(t,e,i,n,r){try{return n()}catch(a){return t==null||t.error(`An error was encountered in "${e}" of the "${i}" hook: ${a}`),r}}function _(t,e){try{return e.getMetadata().name||te}catch(i){return t.error("Exception thrown getting metadata for hook. Unable to get hook name."),te}}function lr(t,e,i){return e.map(n=>q(t,Je,_(t,n),()=>{var r,a;return(a=(r=n==null?void 0:n.beforeEvaluation)==null?void 0:r.call(n,i,{}))!=null?a:{}},{}))}function ur(t,e,i,n,r){for(let a=e.length-1;a>=0;a-=1){let o=e[a],s=n[a];q(t,Be,_(t,o),()=>{var l,u;return(u=(l=o==null?void 0:o.afterEvaluation)==null?void 0:l.call(o,i,s,r))!=null?u:{}},{})}}function cr(t,e,i){return e.map(n=>q(t,Je,_(t,n),()=>{var r,a;return(a=(r=n==null?void 0:n.beforeIdentify)==null?void 0:r.call(n,i,{}))!=null?a:{}},{}))}function hr(t,e,i,n,r){for(let a=e.length-1;a>=0;a-=1){let o=e[a],s=n[a];q(t,Be,_(t,o),()=>{var l,u;return(u=(l=o==null?void 0:o.afterIdentify)==null?void 0:l.call(o,i,s,r))!=null?u:{}},{})}}function dr(t,e,i){for(let n=e.length-1;n>=0;n-=1){let r=e[n];q(t,or,_(t,r),()=>{var a;return(a=r==null?void 0:r.afterTrack)==null?void 0:a.call(r,i)},void 0)}}var fr=class{constructor(t,e){this.t=t,this.R=[],this.R.push(...e)}withEvaluation(t,e,i,n){if(this.R.length===0)return n();let r=[...this.R],a={flagKey:t,context:e,defaultValue:i},o=lr(this.t,r,a),s=n();return ur(this.t,r,a,o,s),s}identify(t,e){let i=[...this.R],n={context:t,timeout:e},r=cr(this.t,i,n);return a=>{hr(this.t,i,n,r,a)}}addHook(t){this.R.push(t)}afterTrack(t){if(this.R.length===0)return;let e=[...this.R];dr(this.t,e,t)}};function gr(t){return{getMetadata(){return{name:"LaunchDarkly-Inspector-Adapter"}},afterEvaluation:(e,i,n)=>(t.onFlagUsed(e.flagKey,n,e.context),i),afterIdentify(e,i,n){return t.onIdentityChanged(e.context),i}}}function pr(t,e){return`an inspector: "${e}" of an invalid type (${t}) was configured`}function vr(t,e){return`an inspector: "${e}" of type: "${t}" generated an exception`}function mr(t,e){let i=!1,n={method:(...r)=>{try{t.method(...r)}catch(a){i||(i=!0,e.warn(vr(n.type,n.name)))}},type:t.type,name:t.name,synchronous:t.synchronous};return n}var He="flag-used",qe="flag-details-changed",_e="flag-detail-changed",We="client-identity-changed",yr=[He,qe,_e,We];function wr(t,e){let i=yr.includes(t.type)&&t.method&&typeof t.method=="function";return i||e.warn(pr(t.type,t.name)),i}var br=class{constructor(t,e){this.z=[];let i=t.filter(n=>wr(n,e));this.z=i.map(n=>mr(n,e))}hasInspectors(){return this.z.length!==0}onFlagUsed(t,e,i){this.z.forEach(n=>{n.type===He&&n.method(t,e,i)})}onFlagsChanged(t){this.z.forEach(e=>{e.type===qe&&e.method(t)})}onFlagChanged(t,e){this.z.forEach(i=>{i.type===_e&&i.method(t,e)})}onIdentityChanged(t){this.z.forEach(e=>{e.type===We&&e.method(t)})}},kr=class{constructor(t){this.t=t,this.n=new Map}on(t,e){var i,n;if(typeof t!="string"){(i=this.t)==null||i.warn("Only string event names are supported.");return}this.n.has(t)?(n=this.n.get(t))==null||n.push(e):this.n.set(t,[e])}off(t,e){let i=this.n.get(t);if(i){if(e){let n=i.filter(r=>r!==e);n.length===0?this.n.delete(t):this.n.set(t,n);return}this.n.delete(t)}}En(t,e,...i){var n;try{t(...i)}catch(r){(n=this.t)==null||n.error(`Encountered error invoking handler for "${e}", detail: "${r}"`)}}emit(t,...e){let i=this.n.get(t);i==null||i.forEach(n=>this.En(n,t,...e))}eventNames(){return[...this.n.keys()]}listenerCount(t){var e,i;return(i=(e=this.n.get(t))==null?void 0:e.length)!=null?i:0}};function Dr(t,e,i){let n=e.info.sdkData(),r;i.applicationInfo&&(i.applicationInfo.id&&(r=r!=null?r:{},r.id=i.applicationInfo.id),i.applicationInfo.version&&(r=r!=null?r:{},r.version=i.applicationInfo.version),i.applicationInfo.name&&(r=r!=null?r:{},r.name=i.applicationInfo.name),i.applicationInfo.versionName&&(r=r!=null?r:{},r.versionName=i.applicationInfo.versionName));let a={name:n.userAgentBase,version:n.version};n.wrapperName&&(a.wrapperName=n.wrapperName),n.wrapperVersion&&(a.wrapperVersion=n.wrapperVersion);let o={sdk:a,[i.credentialType]:t};return r&&(o.application=r),o}var{ClientMessages:ee,ErrorKinds:ie}=I,Er=5,xr=class{constructor(t,e,i,n,r,a){var o;if(this.sdkKey=t,this.autoEnvAttributes=e,this.platform=i,this.u=Jn(),this.$t=15,this.T=new Yt(!1),this.lt=new Yt(!0),this.Rt=!1,this.bn=wn(),!t)throw new Error("You must configure the client with a client-side SDK key");if(!i.encoding)throw new Error("Platform must implement Encoding because btoa is required.");this.e=new Pn(n,a),this.logger=this.e.logger,this.we=Zi(this.sdkKey,this.platform.info,this.e.tags,this.e.serviceEndpoints.includeAuthorizationHeader,this.e.userAgentHeaderName),this.N=new sr(this.platform,t,this.e.maxCachedContexts,(o=this.e.disableCache)!=null?o:!1,this.e.logger),this.x=Qn(t,this.e,i),this.E=Xn(t,this.e,i,this.we,this.x),this.emitter=new kr,this.emitter.on("error",(l,u)=>{this.logger.error(`error: ${u}, context: ${JSON.stringify(l)}`)}),this.N.on((l,u,c)=>{this.Dn(u,c);let h=M.toLDContext(l);this.emitter.emit("change",h,u),u.forEach(g=>{this.emitter.emit(`change:${g}`,h)})}),this.dataManager=r(this.N,this.e,this.we,this.emitter,this.x);let s=[...this.e.hooks];if(this.environmentMetadata=Dr(this.sdkKey,this.platform,this.e),this.e.getImplementationHooks(this.environmentMetadata).forEach(l=>{s.push(l)}),this.M=new fr(this.logger,s),this.Y=new br(this.e.inspectors,this.logger),this.Y.hasInspectors()&&this.M.addHook(gr(this.Y)),n.cleanOldPersistentData&&a!=null&&a.getLegacyStorageKeys&&this.platform.storage)try{this.logger.debug("Cleaning old persistent data."),Promise.all(a.getLegacyStorageKeys().map(l=>{var u;return(u=this.platform.storage)==null?void 0:u.clear(l)})).catch(l=>{this.logger.error(`Error cleaning old persistent data: ${l}`)}).finally(()=>{this.logger.debug("Cleaned old persistent data.")})}catch(l){this.logger.error(`Error cleaning old persistent data: ${l}`)}}allFlags(){return Object.entries(this.N.getAll()).reduce((t,[e,i])=>(i.flag!==null&&i.flag!==void 0&&!i.flag.deleted&&(t[e]=i.flag.value),t),{})}async close(){var t;await this.flush(),(t=this.E)==null||t.close(),this.dataManager.close(),this.logger.debug("Closed event processor and data source.")}async flush(){var t;try{await((t=this.E)==null?void 0:t.flush()),this.logger.debug("Successfully flushed event processor.")}catch(e){return this.logger.error(`Error flushing event processor: ${e}.`),{error:e,result:!1}}return{result:!0}}getContext(){return this.u.hasContext()?De(this.u.getUnwrappedContext()):void 0}getInternalContext(){return this.u.getContext()}presetFlags(t){this.N.presetFlags(t)}async identify(t,e){let i=await this.identifyResult(t,e);if(i.status==="error")throw i.error;if(i.status==="timeout"){let n=new ke(`identify timed out after ${i.timeout} seconds.`);throw this.logger.error(n.message),n}}async identifyResult(t,e){var i,n;let r=(i=e==null?void 0:e.timeout)!=null?i:Er,a=(e==null?void 0:e.timeout)===void 0&&(e==null?void 0:e.noTimeout)===!0;r>this.$t&&this.logger.warn(`The identify function was called with a timeout greater than ${this.$t} seconds. We recommend a timeout of less than ${this.$t} seconds.`);let o=this.bn.execute({before:async()=>{let l=await Zn(t,this.platform);this.autoEnvAttributes===tt.Enabled&&(l=await Kn(l,this.platform,this.e));let u=M.fromLDContext(l);if(u.valid){let c=this.M.identify(l,e==null?void 0:e.timeout);return{context:l,checkedContext:u,afterIdentify:c}}return{context:l,checkedContext:u}},execute:async l=>{var u;let{context:c,checkedContext:h}=l;if(!h.valid){let w=new Error("Context was unspecified or had no key");return this.emitter.emit("error",c,w),Promise.reject(w)}this.u.set(c,h),(u=this.E)==null||u.sendEvent(this.T.identifyEvent(h));let{identifyPromise:g,identifyResolve:p,identifyReject:m}=this.u.newIdentificationPromise();return this.logger.debug(`Identifying ${JSON.stringify(h)}`),await this.dataManager.identify(p,m,h,e),g},after:async(l,u)=>{var c,h,g;l.status==="complete"?(c=u==null?void 0:u.afterIdentify)==null||c.call(u,{status:"completed"}):l.status==="shed"?(h=u==null?void 0:u.afterIdentify)==null||h.call(u,{status:"shed"}):l.status==="error"&&((g=u==null?void 0:u.afterIdentify)==null||g.call(u,{status:"error"}))}},(n=e==null?void 0:e.sheddable)!=null?n:!1).then(l=>{if(l.status==="error"){let c={status:"error",error:l.error};return this.maybeSetInitializationResult({status:"failed",error:l.error}),c}if(l.status==="shed")return{status:"shed"};let u={status:"completed"};return this.maybeSetInitializationResult({status:"complete"}),u});if(a)return o;let s=new Promise(l=>{setTimeout(()=>{l({status:"timeout",timeout:r})},r*1e3)});return Promise.race([o,s])}maybeSetInitializationResult(t){this.initializeResult===void 0&&(this.initializeResult=t,this.emitter.emit("ready"),t.status==="complete"&&this.emitter.emit("initialized"),this.initResolve&&(this.initResolve(t),this.initResolve=void 0))}waitForInitialization(t){var e;let i=(e=t==null?void 0:t.timeout)!=null?e:5;return this.initializeResult?Promise.resolve(this.initializeResult):this.initializedPromise?this.promiseWithTimeout(this.initializedPromise,i):(this.initializedPromise||(this.initializedPromise=new Promise(n=>{this.initResolve=n})),this.promiseWithTimeout(this.initializedPromise,i))}promiseWithTimeout(t,e){let i=Wi(e,"waitForInitialization");return Promise.race([t.then(n=>(i.cancel(),n)),i.promise.then(()=>({status:"complete"})).catch(()=>({status:"timeout"}))]).catch(n=>{var r;return(r=this.logger)==null||r.error(n.message),{status:"failed",error:n}})}on(t,e){this.emitter.on(t,e)}off(t,e){this.emitter.off(t,e)}track(t,e,i){var n,r;if(!this.u.hasValidContext()){this.logger.warn(ee.MissingContextKeyNoEvent);return}i!==void 0&&!d.Number.is(i)&&((n=this.logger)==null||n.warn(ee.invalidMetricValue(typeof i))),(r=this.E)==null||r.sendEvent(this.e.trackEventModifier(this.T.customEvent(t,this.u.getContext(),e,i))),this.M.afterTrack({key:t,context:this.u.getUnwrappedContext(),data:e,metricValue:i})}dt(t,e,i,n){var r,a,o,s,l;let u=this.u.hasContext();u||(r=this.logger)==null||r.warn("Flag evaluation called before client is fully initialized, data from this evaulation could be stale.");let c=this.u.getContext(),h=this.N.get(t);if(h===void 0||h.flag.deleted){let f=e!=null?e:null;return(a=this.logger)==null||a.warn(`Unknown feature flag "${t}"; returning default value ${f}.`),u&&((o=this.E)==null||o.sendEvent(this.T.unknownFlagEvent(t,f,c))),Gt(ie.FlagNotFound,e)}let{reason:g,value:p,variation:m,prerequisites:w}=h.flag;if(n){let[f,x]=n(p);if(!f){u&&((s=this.E)==null||s.sendEvent(i.evalEventClient(t,e,e,h.flag,c,g)));let C=new qi(`Wrong type "${x}" for feature flag "${t}"; returning default value`);return this.emitter.emit("error",this.u.getUnwrappedContext(),C),Gt(ie.WrongType,e)}}let D=Zt(p,m,g);return p==null&&(this.logger.debug("Result value is null. Providing default value."),D.value=e),w==null||w.forEach(f=>{this.dt(f,void 0,this.T)}),u&&((l=this.E)==null||l.sendEvent(i.evalEventClient(t,p,e,h.flag,c,g))),D}variation(t,e){let{value:i}=this.M.withEvaluation(t,this.u.getUnwrappedContext(),e,()=>this.dt(t,e,this.T));return i}variationDetail(t,e){return this.M.withEvaluation(t,this.u.getUnwrappedContext(),e,()=>this.dt(t,e,this.lt))}B(t,e,i,n){return this.M.withEvaluation(t,this.u.getUnwrappedContext(),e,()=>this.dt(t,e,i,n))}boolVariation(t,e){return this.B(t,e,this.T,i=>[d.Boolean.is(i),d.Boolean.getType()]).value}jsonVariation(t,e){return this.variation(t,e)}numberVariation(t,e){return this.B(t,e,this.T,i=>[d.Number.is(i),d.Number.getType()]).value}stringVariation(t,e){return this.B(t,e,this.T,i=>[d.String.is(i),d.String.getType()]).value}boolVariationDetail(t,e){return this.B(t,e,this.lt,i=>[d.Boolean.is(i),d.Boolean.getType()])}numberVariationDetail(t,e){return this.B(t,e,this.lt,i=>[d.Number.is(i),d.Number.getType()])}stringVariationDetail(t,e){return this.B(t,e,this.lt,i=>[d.String.is(i),d.String.getType()])}jsonVariationDetail(t,e){return this.variationDetail(t,e)}addHook(t){this.M.addHook(t)}setEventSendingEnabled(t,e){var i,n,r,a;this.Rt!==t&&(this.Rt=t,t?(this.logger.debug("Starting event processor"),(i=this.E)==null||i.start()):e?((n=this.logger)==null||n.debug("Flushing event processor before disabling."),this.flush().then(()=>{var o,s;this.Rt||((o=this.logger)==null||o.debug("Stopping event processor."),(s=this.E)==null||s.close())})):((r=this.logger)==null||r.debug("Stopping event processor."),(a=this.E)==null||a.close()))}sendEvent(t){var e;(e=this.E)==null||e.sendEvent(t)}getDebugOverrides(){var t,e;return(e=(t=this.N).getDebugOverride)==null?void 0:e.call(t)}Dn(t,e){if(!this.Y.hasInspectors())return;let i={};t.forEach(n=>{let r=this.N.get(n);if(r!=null&&r.flag&&!r.flag.deleted){let{reason:a,value:o,variation:s}=r.flag;i[n]=Zt(o,s,a)}else i[n]={value:void 0,variationIndex:null}}),e==="init"?this.Y.onFlagsChanged(i):e==="patch"&&Object.entries(i).forEach(([n,r])=>{this.Y.onFlagChanged(n,r)})}};function Cr(t,e,i){i.forEach(n=>{var r;try{(r=n.registerDebug)==null||r.call(n,e)}catch(a){t.error(`Exception thrown registering plugin ${I.safeGetName(t,n)}.`)}})}function Ge(t,e){let i=Object.keys(e),n="$flagsState",r="$valid",a=e[n];!a&&i.length&&t.warn("LaunchDarkly client was initialized with bootstrap data that did not include flag metadata. Events may not be sent correctly."),e[r]===!1&&t.warn("LaunchDarkly bootstrap data is not available because the back end could not read the flags.");let o={};return i.forEach(s=>{if(s!==n&&s!==r){let l;a&&a[s]?l=v({value:e[s]},a[s]):l={value:e[s],version:0},o[s]={version:l.version,flag:l}}}),o}function Sr(t){return{polling:()=>({pathGet(e,i){return`/sdk/evalx/${t}/contexts/${zt(i,e)}`},pathReport(e,i){return`/sdk/evalx/${t}/context`},pathPost(e,i){throw new Error("Post for FDv1 unsupported.")},pathPing(e,i){throw new Error("Ping for polling unsupported.")}}),streaming:()=>({pathGet(e,i){return`/eval/${t}/${zt(i,e)}`},pathReport(e,i){return`/eval/${t}`},pathPost(e,i){throw new Error("Post for FDv1 unsupported.")},pathPing(e,i){return`/ping/${t}`}})}}function Rr(t,e,i){return{async handlePut(n,r){i.debug(`Got PUT: ${Object.keys(r)}`);let a=Object.entries(r).reduce((o,[s,l])=>(o[s]={version:l.version,flag:l},o),{});await t.init(n,a),e.requestStateUpdate("VALID")},async handlePatch(n,r){i.debug(`Got PATCH ${JSON.stringify(r,null,2)}`),t.upsert(n,r.key,{version:r.version,flag:r})},async handleDelete(n,r){i.debug(`Got DELETE ${JSON.stringify(r,null,2)}`),t.upsert(n,r.key,{version:r.version,flag:$(v({},r),{deleted:!0,flagVersion:0,value:void 0,variation:0,trackEvents:!1})})},handleStreamingError(n){e.reportError(n.kind,n.message,n.code,n.recoverable)},handlePollingError(n){e.reportError(n.kind,n.message,n.status,n.recoverable)}}}function Or(t,e=()=>Date.now()){let i="CLOSED",n=e(),r;function a(){return{state:i,stateSince:n,lastError:r}}function o(s,l=!1){let u=s==="INTERRUPTED"&&i==="INITIALIZING"?"INITIALIZING":s,c=i!==u;c&&(i=u,n=e()),(c||l)&&t.emit("dataSourceStatus",a())}return{get status(){return a()},requestStateUpdate(s){o(s)},reportError(s,l,u,c=!1){r={kind:s,message:l,statusCode:u,time:e()},o(c?"INTERRUPTED":"CLOSED",!0)}}}function ne(t){t==null||t.debug("Poll completed after the processor was closed. Skipping processing.")}var Ir=class{constructor(t,e,i,n,r){this.kn=t,this.Sn=e,this.xn=i,this.m=n,this.t=r,this.h=!1}async Ee(){var t,e,i,n,r,a,o;if(this.h)return;let s=h=>{var g,p,m;(g=this.t)==null||g.error("Polling received invalid data"),(p=this.t)==null||p.debug(`Invalid JSON follows: ${h}`),(m=this.m)==null||m.call(this,new X(E.InvalidData,"Malformed JSON data in polling response"))};(t=this.t)==null||t.debug("Polling LaunchDarkly for feature flag updates");let l=Date.now();try{let h=await this.kn.requestPayload();try{if(this.h){ne(this.t);return}let g=JSON.parse(h);try{(e=this.xn)==null||e.call(this,g)}catch(p){(i=this.t)==null||i.error(`Exception from data handler: ${p}`)}}catch(g){s(h)}}catch(h){if(this.h){ne(this.t);return}let g=h;if(g.status!==void 0&&!rt(g.status)){(n=this.t)==null||n.error(z(h,"polling request")),(r=this.m)==null||r.call(this,new X(E.ErrorResponse,g.message,g.status));return}(a=this.t)==null||a.error(z(h,"polling request","will retry"))}let u=Date.now()-l,c=Math.max(this.Sn*1e3-u,0);(o=this.t)==null||o.debug("Elapsed: %d ms, sleeping for %d ms",u,c),this.Nt=setTimeout(()=>{this.Ee()},c)}start(){this.Ee()}stop(){this.Nt&&(clearTimeout(this.Nt),this.Nt=void 0),this.h=!0}close(){this.stop()}},Lr=(t,e,i,n)=>{i==null||i.error(`Stream received invalid data in "${t}" message`),i==null||i.debug(`Invalid JSON follows: ${e}`),n==null||n(new mt(E.InvalidData,"Malformed JSON data in event stream"))};function $r(t,e){e==null||e.debug(`Received ${t} event after processor was closed. Skipping processing.`)}function re(t){t==null||t.debug("Ping completed after processor was closed. Skipping processing.")}var Tr=class{constructor(t,e,i,n,r,a,o,s,l){var u;this.Ln=t,this.Mt=e,this.n=i,this._=n,this.On=a,this.x=o,this.m=s,this.t=l,this.h=!1;let c;e.useReport&&!n.getEventSourceCapabilities().customMethod?c=e.paths.pathPing(r,t):c=e.useReport?e.paths.pathReport(r,t):e.paths.pathGet(r,t);let h=[...(u=e.queryParameters)!=null?u:[]];this.Mt.withReasons&&h.push({key:"withReasons",value:"true"}),this._=n,this.be=v({},e.baseHeaders),this.t=l,this.Pn=Bi(e.serviceEndpoints,c,h)}De(){this.ht=Date.now()}Ft(t){this.ht&&this.x&&this.x.recordStreamInit(this.ht,!t,Date.now()-this.ht),this.ht=void 0}Cn(t){var e,i,n;return Ee(t)?((n=this.t)==null||n.warn(z(t,"streaming request","will retry")),this.Ft(!1),this.De(),!0):(this.Ft(!1),(e=this.m)==null||e.call(this,new mt(E.ErrorResponse,t.message,t.status,!1)),(i=this.t)==null||i.error(z(t,"streaming request")),!1)}start(){this.De();let t;this.Mt.useReport?(this.be["content-type"]="application/json",t={method:"REPORT",body:this.Ln}):t={};let e=this._.createEventSource(this.Pn,$(v({headers:this.be},t),{errorFilter:i=>this.Cn(i),initialRetryDelayMillis:this.Mt.initialRetryDelayMillis,readTimeoutMillis:300*1e3,retryResetIntervalMillis:60*1e3}));this.ke=e,e.onclose=()=>{var i;(i=this.t)==null||i.info("Closed LaunchDarkly stream connection")},e.onerror=()=>{},e.onopen=()=>{var i;(i=this.t)==null||i.info("Opened LaunchDarkly stream connection")},e.onretrying=i=>{var n;(n=this.t)==null||n.info(`Will retry stream connection in ${i.delayMillis} milliseconds`)},this.n.forEach(({deserializeData:i,processJson:n},r)=>{e.addEventListener(r,a=>{var o,s;if(this.h){$r(r,this.t);return}if((o=this.t)==null||o.debug(`Received ${r} event`),a!=null&&a.data){this.Ft(!0);let{data:l}=a,u=i(l);if(!u){Lr(r,l,this.t,this.m);return}n(u)}else(s=this.m)==null||s.call(this,new mt(E.InvalidData,"Unexpected payload from event stream"))})}),e.addEventListener("ping",async()=>{var i,n,r,a,o,s,l;(i=this.t)==null||i.debug("Got PING, going to poll LaunchDarkly for feature flag updates");try{let u=await this.On.requestPayload();try{if(this.h){re(this.t);return}let c=JSON.parse(u);try{(n=this.n.get("put"))==null||n.processJson(c)}catch(h){(r=this.t)==null||r.error(`Exception from data handler: ${h}`)}}catch(c){(a=this.t)==null||a.error("Polling after ping received invalid data"),(o=this.t)==null||o.debug(`Invalid JSON follows: ${u}`),(s=this.m)==null||s.call(this,new X(E.InvalidData,"Malformed JSON data in ping polling response"))}}catch(u){if(this.h){re(this.t);return}let c=u;(l=this.m)==null||l.call(this,new X(E.ErrorResponse,c.message,c.status))}})}stop(){var t;(t=this.ke)==null||t.close(),this.ke=void 0,this.h=!0}close(){this.stop()}},Pr=class{constructor(t,e,i,n,r,a,o,s,l){this.platform=t,this.flagManager=e,this.credential=i,this.config=n,this.getPollingPaths=r,this.getStreamingPaths=a,this.baseHeaders=o,this.emitter=s,this.diagnosticsManager=l,this.closed=!1,this.logger=n.logger,this.dataSourceStatusManager=Or(s),this.G=Rr(e,this.dataSourceStatusManager,this.config.logger)}setConnectionParams(t){this.In=t}createPollingProcessor(t,e,i,n,r){let a=new Ir(i,this.config.pollInterval,async o=>{await this.G.handlePut(e,o),n==null||n()},o=>{this.emitter.emit("error",t,o),this.G.handlePollingError(o),r==null||r(o)},this.logger);this.updateProcessor=this.Se(a,this.dataSourceStatusManager)}createStreamingProcessor(t,e,i,n,r){var a;let o=new Tr(JSON.stringify(t),{credential:this.credential,serviceEndpoints:this.config.serviceEndpoints,paths:this.getStreamingPaths(),baseHeaders:this.baseHeaders,initialRetryDelayMillis:this.config.streamInitialReconnectDelay*1e3,withReasons:this.config.withReasons,useReport:this.config.useReport,queryParameters:(a=this.In)==null?void 0:a.queryParameters},this.createStreamListeners(e,n),this.platform.requests,this.platform.encoding,i,this.diagnosticsManager,s=>{this.emitter.emit("error",t,s),this.G.handleStreamingError(s),r==null||r(s)},this.logger);this.updateProcessor=this.Se(o,this.dataSourceStatusManager)}createStreamListeners(t,e){let i=new Map;return i.set("put",{deserializeData:JSON.parse,processJson:async n=>{await this.G.handlePut(t,n),e==null||e()}}),i.set("patch",{deserializeData:JSON.parse,processJson:async n=>{this.G.handlePatch(t,n)}}),i.set("delete",{deserializeData:JSON.parse,processJson:async n=>{this.G.handleDelete(t,n)}}),i}Se(t,e){return{start:()=>{e.requestStateUpdate("INITIALIZING"),t.start()},stop:()=>{t.stop(),e.requestStateUpdate("CLOSED")},close:()=>{t.close(),e.requestStateUpdate("CLOSED")}}}close(){var t;(t=this.updateProcessor)==null||t.close(),this.closed=!0}};function st(){return typeof document!==void 0}function Ot(){return typeof window!==void 0}function Ze(t,e,i){return st()?(document.addEventListener(t,e,i),()=>{document.removeEventListener(t,e,i)}):()=>{}}function Ye(t,e,i){return st()?(window.addEventListener(t,e,i),()=>{window.removeEventListener(t,e,i)}):()=>{}}function J(){return Ot()?window.location.href:""}function Nr(){return Ot()?window.location.search:""}function jr(){return Ot()?window.location.hash:""}function Ar(){if(typeof crypto!==void 0)return crypto;throw Error("Access to a web crypto API is required")}function Vr(){return st()?document.visibilityState:"visibile"}function Mr(t){if(st())return document.querySelectorAll(t)}var Fr="[BrowserDataManager]",Ur=class extends Pr{constructor(t,e,i,n,r,a,o,s,l,u){super(t,e,i,n,a,o,s,l,u),this.Hn=r,this.Z=void 0,this.Ut=!1,this.Z=r.streaming}L(t,...e){this.logger.debug(`${Fr} ${t}`,...e)}async identify(t,e,i,n){if(this.closed){this.L("Identify called after data manager was closed.");return}this.context=i;let r=n;r!=null&&r.hash?this.setConnectionParams({queryParameters:[{key:"h",value:r.hash}]}):this.setConnectionParams(),this.jt=r==null?void 0:r.hash,r!=null&&r.bootstrap?this.An(i,r,t):(await this.flagManager.loadCached(i)&&this.L("Identify - Flags loaded from cache. Continuing to initialize via a poll."),await this.Tn(i,t,e)),this.xe(),this.l()}async $n(t){let e=JSON.stringify(M.toLDContext(t)),i=qt(e,this.config.serviceEndpoints,this.getPollingPaths(),this.platform.requests,this.platform.encoding,this.baseHeaders,[],this.config.withReasons,this.config.useReport,this.jt),n=3,r;for(let a=0;a<=n;a+=1)try{return await i.requestPayload()}catch(o){if(!Ee(o))throw o;r=o,a<n&&(this.L(z(o,"initial poll request","will retry")),await xe(1e3))}throw r}async Tn(t,e,i){var n,r;try{this.dataSourceStatusManager.requestStateUpdate(Bt.Initializing);let a=await this.$n(t);try{let o=this.createStreamListeners(t,e).get("put");o.processJson(o.deserializeData(a))}catch(o){this.dataSourceStatusManager.reportError(E.InvalidData,(n=o.message)!=null?n:"Could not parse poll response")}}catch(a){this.dataSourceStatusManager.reportError(E.NetworkError,(r=a.message)!=null?r:"unexpected network error",a.status),i(a)}}An(t,e,i){let{bootstrapParsed:n}=e;n||(n=Ge(this.logger,e.bootstrap)),this.flagManager.setBootstrap(t,n),this.dataSourceStatusManager.requestStateUpdate(Bt.Valid),this.L("Identify - Initialization completed from bootstrap"),i()}setForcedStreaming(t){this.Z=t,this.l()}setAutomaticStreamingState(t){this.Ut=t,this.l()}l(){let t=this.Z||this.Ut&&this.Z===void 0;this.L(`Updating streaming state. forced(${this.Z}) automatic(${this.Ut})`),t?this.Rn():this.xe()}xe(){var t;this.updateProcessor&&this.L("Stopping update processor."),(t=this.updateProcessor)==null||t.close(),this.updateProcessor=void 0}Rn(){if(this.updateProcessor){this.L("Update processor already active. Not changing state.");return}if(!this.context){this.L("Context not set, not starting update processor.");return}this.L("Starting update processor."),this.Nn(this.context)}Nn(t,e,i){var n;let r=M.toLDContext(t);(n=this.updateProcessor)==null||n.close();let a=JSON.stringify(M.toLDContext(t)),o=qt(a,this.config.serviceEndpoints,this.getPollingPaths(),this.platform.requests,this.platform.encoding,this.baseHeaders,[],this.config.withReasons,this.config.useReport,this.jt);this.createStreamingProcessor(r,t,o,e,i),this.updateProcessor.start()}};function zr(t){let e=Ze("visibilitychange",()=>{Vr()==="hidden"&&t()}),i=Ye("pagehide",t);return()=>{e(),i()}}function ft(t){if(typeof t!="string")throw new TypeError("Expected a string");return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function Kr(t,e,i,n){let r=((t.kind==="substring"||t.kind==="regex")&&n.includes("/")?e:e.replace(n,"")).replace(i,"");switch(t.kind){case"exact":return new RegExp(`^${ft(t.url)}/?$`).test(e);case"canonical":return new RegExp(`^${ft(t.url)}/?$`).test(r);case"substring":return new RegExp(`.*${ft(t.substring)}.*$`).test(r);case"regex":return new RegExp(t.pattern).test(r);default:return!1}}function Jr(t,e){let i=[];return e.forEach(n=>{let r=t.target,{selector:a}=n,o=Mr(a);for(;r&&o!=null&&o.length;){for(let s=0;s<o.length;s+=1)if(r===o[s]){i.push(n);break}r=r.parentNode}}),i}var Br=class{constructor(t,e){let i=t.filter(a=>{var o;return(o=a.urls)==null?void 0:o.some(s=>Kr(s,J(),Nr(),jr()))}),n=i.filter(a=>a.kind==="pageview"),r=i.filter(a=>a.kind==="click");if(n.forEach(a=>e(a)),r.length){let a=o=>{Jr(o,r).forEach(s=>{e(s)})};this.Le=Ze("click",a)}}close(){var t;(t=this.Le)==null||t.call(this)}},Hr=300,qr=class{constructor(t){this.Vt=J();let e=()=>{let n=J();n!==this.Vt&&(this.Vt=n,t())};this.Ht=setInterval(e,Hr);let i=Ye("popstate",e);this.Oe=()=>{i()}}close(){var t;this.Ht&&clearInterval(this.Ht),(t=this.Oe)==null||t.call(this)}},_r=class{constructor(t,e,i,n,r,a=o=>new qr(o)){this._=e,this.Un=n,this.Fn=r,this.ft=[],this.Ce=!1,this.pt=`${i}/sdk/goals/${t}`,this.Pe=a(()=>{this.Bt()})}async initialize(){await this.Mn(),this.Bt()}startTracking(){this.Ce=!0,this.Bt()}Bt(){var t;this.Ce&&((t=this.zt)==null||t.close(),this.ft&&this.ft.length&&(this.zt=new Br(this.ft,e=>{this.Fn(J(),e)})))}async Mn(){try{let t=await this._.fetch(this.pt);this.ft=await t.json()}catch(t){this.Un(new be(`Encountered error fetching goals: ${t}`))}}close(){var t,e;(t=this.Pe)==null||t.close(),(e=this.zt)==null||e.close()}};function Wr(t){return t.kind==="click"}var Gr=2,Qe={fetchGoals:!0,eventUrlTransformer:t=>t,streaming:void 0,plugins:[]},Zr={fetchGoals:d.Boolean,eventUrlTransformer:d.Function,streaming:d.Boolean,plugins:d.createTypeArray("LDPlugin",{})};function Yr(t){var e;let i=v({},t);return(e=i.flushInterval)!=null||(i.flushInterval=Gr),i}function Qr(t){let e=Yr(t);return Object.keys(Qe).forEach(i=>{delete e[i]}),e}function Xr(t,e){let i=v({},Qe);return Object.entries(Zr).forEach(n=>{let[r,a]=n,o=t[r];o!==void 0&&(a.is(o)?i[r]=o:e.warn(k.wrongOptionType(r,a.getType(),typeof o)))}),i}var ta=class{constructor(t,e){switch(this.jn=t,this.Ie=[],e){case"sha1":this.Gt="SHA-1";break;case"sha256":this.Gt="SHA-256";break;default:throw new Error(`Algorithm is not supported ${e}`)}}async asyncDigest(t){let e=this.Ie.join(""),i=new TextEncoder().encode(e),n=await this.jn.subtle.digest(this.Gt,i);switch(t){case"base64":return btoa(String.fromCharCode(...new Uint8Array(n)));case"hex":return[...new Uint8Array(n)].map(r=>r.toString(16).padStart(2,"0")).join("");default:throw new Error(`Encoding is not supported ${t}`)}}update(t){return this.Ie.push(t),this}},ea={start:0,end:3},ia={start:4,end:5},gt={start:6,end:7},pt={start:8,end:8},na={start:9,end:9},ra={start:10,end:15};function aa(){if(crypto&&crypto.getRandomValues){let e=new Uint8Array(16);return crypto.getRandomValues(e),[...e.values()]}let t=[];for(let e=0;e<16;e+=1)t.push(Math.floor(Math.random()*256));return t}function A(t,e){let i="";for(let n=e.start;n<=e.end;n+=1)i+=t[n].toString(16).padStart(2,"0");return i}function sa(t){return t[pt.start]=(t[pt.start]|128)&191,t[gt.start]=t[gt.start]&15|64,`${A(t,ea)}-${A(t,ia)}-${A(t,gt)}-${A(t,pt)}${A(t,na)}-${A(t,ra)}`}function oa(){let t=aa();return sa(t)}function la(){return typeof crypto!==void 0&&typeof crypto.randomUUID=="function"?crypto.randomUUID():oa()}var ua=class{createHash(t){return new ta(Ar(),t)}randomUUID(){return la()}};function ca(t){let e=Array.from(t,i=>String.fromCodePoint(i)).join("");return btoa(e)}var ha=class{btoa(t){return ca(new TextEncoder().encode(t))}},da=class{constructor(t){this.e=t}platformData(){return{name:"JS"}}sdkData(){let t={name:"@launchdarkly/js-client-sdk",version:"4.4.1",userAgentBase:"JSClient"};return this.e.wrapperName&&(t.wrapperName=this.e.wrapperName),this.e.wrapperVersion&&(t.wrapperVersion=this.e.wrapperVersion),t}},fa=class{constructor(t,e){this.pt=t,this.n={},this.C=new Pi(e.initialRetryDelayMillis,e.retryResetIntervalMillis),this.Ae=e.errorFilter,this.Te()}Te(){this.K=new EventSource(this.pt),this.K.onopen=()=>{var t;this.C.success(),(t=this.onopen)==null||t.call(this)},this.K.onerror=t=>{var e;this.w(t),(e=this.onerror)==null||e.call(this,t)},Object.entries(this.n).forEach(([t,e])=>{e.forEach(i=>{var n;(n=this.K)==null||n.addEventListener(t,i)})})}addEventListener(t,e){var i,n,r;(n=(i=this.n)[t])!=null||(i[t]=[]),this.n[t].push(e),(r=this.K)==null||r.addEventListener(t,e)}close(){var t,e;clearTimeout(this.Kt),this.Kt=void 0,(t=this.K)==null||t.close(),(e=this.onclose)==null||e.call(this)}Vn(t){var e;(e=this.onretrying)==null||e.call(this,{delayMillis:t}),this.Kt=setTimeout(()=>{this.Te()},t)}w(t){this.close(),!(typeof t.status=="number"&&!this.Ae(t))&&this.Vn(this.C.fail())}},ga=class{fetch(t,e){return fetch(t,e)}createEventSource(t,e){return new fa(t,e)}getEventSourceCapabilities(){return{customMethod:!1,readTimeout:!1,headers:!1}}};function Xe(){return typeof localStorage!="undefined"}function pa(){if(!Xe())return[];let t=[];for(let e=0;e<localStorage.length;e+=1){let i=localStorage.key(e);i&&t.push(i)}return t}var va=class{constructor(t){this.t=t}async clear(t){var e;try{localStorage.removeItem(t)}catch(i){(e=this.t)==null||e.error(`Error clearing key from localStorage: ${t}, reason: ${i}`)}}async get(t){var e;try{let i=localStorage.getItem(t);return i!=null?i:null}catch(i){return(e=this.t)==null||e.error(`Error getting key from localStorage: ${t}, reason: ${i}`),null}}async set(t,e){var i;try{localStorage.setItem(t,e)}catch(n){(i=this.t)==null||i.error(`Error setting key in localStorage: ${t}, reason: ${n}`)}}},ma=class{constructor(t,e){this.encoding=new ha,this.crypto=new ua,this.requests=new ga,Xe()&&(this.storage=new va(t)),this.info=new da(e)}},ya=class extends xr{constructor(t,e,i={},n){var r;let{logger:a,debug:o}=i,s=a!=null?a:new pe({destination:{debug:console.debug,info:console.info,warn:console.warn,error:console.error},level:o?"debug":"info"}),l=(r=i.baseUri)!=null?r:"https://clientsdk.launchdarkly.com",u=n!=null?n:new ma(s,i),c=Xr(i,s),h=Qr($(v({},i),{logger:s})),{eventUrlTransformer:g}=c,p=Sr(t);super(t,e,u,h,(m,w,D,f,x)=>new Ur(u,m,t,w,c,p.polling,p.streaming,D,f,x),{getLegacyStorageKeys:()=>pa().filter(m=>m.startsWith(`ld:${t}:`)),analyticsEventPath:`/events/bulk/${t}`,diagnosticEventPath:`/events/diagnostic/${t}`,includeAuthorizationHeader:!1,highTimeoutThreshold:5,userAgentHeaderName:"x-launchdarkly-user-agent",dataSystemDefaults:In,trackEventModifier:m=>new I.InputCustomEvent(m.context,m.key,m.data,m.metricValue,m.samplingRatio,g(J())),getImplementationHooks:m=>I.safeGetHooks(s,m,c.plugins),credentialType:"clientSideId"}),this.setEventSendingEnabled(!0,!1),this.Wt=c.plugins,c.fetchGoals&&(this.qt=new _r(t,u.requests,l,m=>{s.error(m.message)},(m,w)=>{let D=this.getInternalContext();if(!D)return;let f=g(m);Wr(w)?this.sendEvent({kind:"click",url:f,samplingRatio:1,key:w.key,creationDate:Date.now(),context:D,selector:w.selector}):this.sendEvent({kind:"pageview",url:f,samplingRatio:1,key:w.key,creationDate:Date.now(),context:D})}),this.qt.initialize(),c.automaticBackgroundHandling&&zr(()=>this.flush()))}registerPlugins(t){I.safeRegisterPlugins(this.logger,this.environmentMetadata,t,this.Wt||[]);let e=this.getDebugOverrides();e&&Cr(this.logger,e,this.Wt||[])}setInitialContext(t){this.Jt=t}async identify(t,e){return super.identify(t,e)}async identifyResult(t,e){var i;if(!this.X)return this.logger.error("Client must be started before it can identify a context, did you forget to call start()?"),{status:"error",error:new Error("Identify called before start")};let n=v({},e);(e==null?void 0:e.sheddable)===void 0&&(n.sheddable=!0);let r=await super.identifyResult(t,n);return(i=this.qt)==null||i.startTracking(),r}start(t){var e,i;if(this.initializeResult)return Promise.resolve(this.initializeResult);if(this.X)return this.X;if(!this.Jt)return this.logger.error("Initial context not set"),Promise.resolve({status:"failed",error:new Error("Initial context not set")});let n=$(v({},(e=t==null?void 0:t.identifyOptions)!=null?e:{}),{sheddable:!1});if(t!=null&&t.bootstrap&&!n.bootstrap&&(n.bootstrap=t.bootstrap),n!=null&&n.bootstrap)try{n.bootstrapParsed||(n.bootstrapParsed=Ge(this.logger,n.bootstrap)),this.presetFlags(n.bootstrapParsed)}catch(r){this.logger.error("Failed to bootstrap data",r)}return this.initializedPromise||(this.initializedPromise=new Promise(r=>{this.initResolve=r})),this.X=this.promiseWithTimeout(this.initializedPromise,(i=t==null?void 0:t.timeout)!=null?i:5),this.identifyResult(this.Jt,n),this.X}setStreaming(t){this.dataManager.setForcedStreaming(t)}$e(){let t=this.dataManager,e=this.emitter.eventNames().some(i=>i.startsWith("change:")||i==="change");t.setAutomaticStreamingState(e)}on(t,e){super.on(t,e),this.$e()}off(t,e){super.off(t,e),this.$e()}};function wa(t,e,i,n={},r){let a=new ya(t,i,n,r);a.setInitialContext(e);let o={variation:(s,l)=>a.variation(s,l),variationDetail:(s,l)=>a.variationDetail(s,l),boolVariation:(s,l)=>a.boolVariation(s,l),boolVariationDetail:(s,l)=>a.boolVariationDetail(s,l),numberVariation:(s,l)=>a.numberVariation(s,l),numberVariationDetail:(s,l)=>a.numberVariationDetail(s,l),stringVariation:(s,l)=>a.stringVariation(s,l),stringVariationDetail:(s,l)=>a.stringVariationDetail(s,l),jsonVariation:(s,l)=>a.jsonVariation(s,l),jsonVariationDetail:(s,l)=>a.jsonVariationDetail(s,l),track:(s,l,u)=>a.track(s,l,u),on:(s,l)=>a.on(s,l),off:(s,l)=>a.off(s,l),flush:()=>a.flush(),setStreaming:s=>a.setStreaming(s),identify:(s,l)=>a.identifyResult(s,l),getContext:()=>a.getContext(),close:()=>a.close(),allFlags:()=>a.allFlags(),addHook:s=>a.addHook(s),waitForInitialization:s=>a.waitForInitialization(s),logger:a.logger,start:s=>a.start(s)};return a.registerPlugins(o),o}function ti(t,e,i){return wa(t,e,tt.Disabled,i)}function ba(){return typeof window=="undefined"}function W(t){return{value:t,kind:"NO Evaluation Reason"}}function ka(){return{allFlags:()=>({}),boolVariation:(t,e)=>e,boolVariationDetail:(t,e)=>W(e),close:()=>Promise.resolve(),flush:()=>Promise.resolve({result:!0}),getContext:()=>{},getInitializationState:()=>"unknown",getInitializationError:()=>{},identify:()=>Promise.resolve({status:"completed"}),jsonVariation:(t,e)=>e,jsonVariationDetail:(t,e)=>W(e),logger:{debug:()=>{},info:()=>{},warn:()=>{},error:()=>{}},numberVariation:(t,e)=>e,numberVariationDetail:(t,e)=>W(e),off:()=>{},on:()=>{},onContextChange:()=>()=>{},onInitializationStatusChange:()=>()=>{},setStreaming:()=>{},start:()=>Promise.resolve({status:"failed",error:new Error("Server-side client cannot be used to start")}),stringVariation:(t,e)=>e,stringVariationDetail:(t,e)=>W(e),track:()=>{},variation:(t,e)=>e!=null?e:null,variationDetail:(t,e)=>{let i=e!=null?e:null;return W(i)},waitForInitialization:()=>Promise.resolve({status:"failed",error:new Error("Server-side client cannot be used to wait for initialization")}),addHook:()=>{},shouldUseCamelCaseFlagKeys:()=>!0}}function It(t,e,i){var u;if(ba())return ka();let n=(u=i==null?void 0:i.useCamelCaseFlagKeys)!=null?u:!0,r=ti(t,e,i),a="unknown",o=new Set,s=new Set,l;return j(N({},r),{start:c=>a!=="unknown"?r.start(c):(a="initializing",r.start(c).then(h=>(a=h.status,l=h,s.forEach(g=>g(h)),h))),identify:(...c)=>r.identify(...c).then(h=>{if(h.status==="completed"){let g=r.getContext();g&&o.forEach(p=>p(g))}return h}),getInitializationState:()=>a,getInitializationError:()=>(l==null?void 0:l.status)==="failed"?l.error:void 0,onContextChange:c=>(o.add(c),()=>{o.delete(c)}),onInitializationStatusChange:c=>(l&&c(l),s.add(c),()=>{s.delete(c)}),shouldUseCamelCaseFlagKeys:()=>n})}function ei(t,e){var r;let i=(r=e==null?void 0:e.Provider)!=null?r:R.Provider;return({children:a})=>{var l;let[o,s]=xa({client:t,context:(l=t.getContext())!=null?l:void 0,initializedState:t.getInitializationState(),error:t.getInitializationError()});return Ea(()=>{let u=!0,c=t.onInitializationStatusChange(g=>{u&&s(p=>p.initializedState===g.status?p:j(N({},p),{initializedState:g.status,error:g.status==="failed"?g.error:void 0}))}),h=t.onContextChange(g=>{u&&s(p=>j(N({},p),{context:g}))});return()=>{u=!1,c(),h()}},[]),Da.createElement(i,{value:o},a)}}function Ca(t,e,i){let{deferInitialization:n,startOptions:r,reactContext:a,ldOptions:o,bootstrap:s}=i!=null?i:{},l=It(t,e,o);if(!n){let u=s?j(N({},r),{bootstrap:s}):r;l.start(u)}return ei(l,a)}import{useContext as Sa,useEffect as ni,useMemo as Ra,useRef as Oa,useState as Ia}from"react";function ii(t){return t.replace(/([a-z\d])([A-Z])/g,"$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1 $2").split(/[-._\s]+/).filter(Boolean).map((e,i)=>{let n=e.toLowerCase();return i===0?n:n.charAt(0).toUpperCase()+n.slice(1)}).join("")}function La(t,e){let i=new Map,n=t.shouldUseCamelCaseFlagKeys(),r={},a={};return Object.keys(e).filter(o=>o.indexOf("$")!==0).forEach(o=>{if(n){let s=ii(o);r[s]=e[o],a[s]=o}else r[o]=e[o]}),new Proxy(r,{get(o,s,l){var g;let u=Reflect.get(o,s,l);if(typeof s=="symbol"||!Object.prototype.hasOwnProperty.call(o,s))return u;if(u===void 0)return;if(i.has(s))return i.get(s);let c=n&&(g=a[s])!=null?g:s,h=t.variation(c,u);return i.set(s,h),h}})}function $a(t){let{client:e,context:i}=Sa(t!=null?t:R);ni(()=>{e.logger.warn("[LaunchDarkly] useFlags is deprecated and will be removed in a future major version.")},[]);let[n,r]=Ia(()=>e.allFlags()),a=Oa(!1);return ni(()=>{a.current&&r(e.allFlags()),a.current=!0;let o=()=>r(e.allFlags());return e.on("change",o),()=>e.off("change",o)},[e,i]),Ra(()=>La(e,n),[e,n,i])}import{useContext as Ta}from"react";function Pa(t){let{initializedState:e,error:i}=Ta(t!=null?t:R);return e==="failed"?{status:"failed",error:i}:{status:e}}import{useContext as Na}from"react";function ja(t){let{client:e}=Na(t!=null?t:R);return e}import{useContext as Aa,useEffect as Va,useRef as Lt,useState as Ma}from"react";function O(t,e,i,n){let{client:r,context:a}=Aa(n!=null?n:R),o=Lt(e);o.current=e;let s=Lt(i);s.current=i;let l=Lt(!1),[u,c]=Ma(()=>i(r,t,e));return Va(()=>{l.current&&c(s.current(r,t,o.current)),l.current=!0;let h=()=>c(s.current(r,t,o.current));return r.on(`change:${t}`,h),()=>r.off(`change:${t}`,h)},[r,t,a]),u}function Fa(t,e,i){return O(t,e,(n,r,a)=>n.boolVariation(r,a),i)}function Ua(t,e,i){return O(t,e,(n,r,a)=>n.stringVariation(r,a),i)}function za(t,e,i){return O(t,e,(n,r,a)=>n.numberVariation(r,a),i)}function Ka(t,e,i){return O(t,e,(n,r,a)=>n.jsonVariation(r,a),i)}function Ja(t,e,i){return O(t,e,(n,r,a)=>n.boolVariationDetail(r,a),i)}function Ba(t,e,i){return O(t,e,(n,r,a)=>n.stringVariationDetail(r,a),i)}function Ha(t,e,i){return O(t,e,(n,r,a)=>n.numberVariationDetail(r,a),i)}function qa(t,e,i){return O(t,e,(n,r,a)=>n.jsonVariationDetail(r,a),i)}export{R as LDReactContext,It as createClient,Ca as createLDReactProvider,ei as createLDReactProviderWithClient,Pt as initLDReactContext,Fa as useBoolVariation,Ja as useBoolVariationDetail,$a as useFlags,Pa as useInitializationStatus,Ka as useJsonVariation,qa as useJsonVariationDetail,ja as useLDClient,za as useNumberVariation,Ha as useNumberVariationDetail,Ua as useStringVariation,Ba as useStringVariationDetail};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"inputs":{"src/client/LDClient.ts":{"bytes":3178,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@launchdarkly/js-client-sdk","kind":"import-statement","external":true}],"format":"esm"},"src/client/LDOptions.ts":{"bytes":3039,"imports":[{"path":"@launchdarkly/js-client-sdk","kind":"import-statement","external":true},{"path":"./LDClient","kind":"import-statement","external":true}],"format":"esm"},"src/client/provider/LDReactContext.tsx":{"bytes":656,"imports":[{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"../browser/dist/index.js":{"bytes":87384,"imports":[],"format":"esm"},"src/client/LDReactClient.tsx":{"bytes":6302,"imports":[{"path":"../browser/dist/index.js","kind":"import-statement","original":"@launchdarkly/js-client-sdk"},{"path":"./LDClient","kind":"import-statement","external":true},{"path":"./LDOptions","kind":"import-statement","external":true},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/client/provider/LDReactProvider.tsx":{"bytes":4490,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@launchdarkly/js-client-sdk","kind":"import-statement","external":true},{"path":"../LDOptions","kind":"import-statement","external":true},{"path":"src/client/LDReactClient.tsx","kind":"import-statement","original":"../LDReactClient"},{"path":"src/client/provider/LDReactContext.tsx","kind":"import-statement","original":"./LDReactContext"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/client/deprecated-hooks/flagKeyUtils.ts":{"bytes":710,"imports":[],"format":"esm"},"src/client/deprecated-hooks/useFlags.ts":{"bytes":3849,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"src/client/provider/LDReactContext.tsx","kind":"import-statement","original":"../provider/LDReactContext"},{"path":"src/client/deprecated-hooks/flagKeyUtils.ts","kind":"import-statement","original":"./flagKeyUtils"}],"format":"esm"},"src/client/deprecated-hooks/index.ts":{"bytes":39,"imports":[{"path":"src/client/deprecated-hooks/useFlags.ts","kind":"import-statement","original":"./useFlags"}],"format":"esm"},"src/client/hooks/useInitializationStatus.ts":{"bytes":1060,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"src/client/provider/LDReactContext.tsx","kind":"import-statement","original":"../provider/LDReactContext"}],"format":"esm"},"src/client/hooks/useLDClient.ts":{"bytes":613,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"src/client/provider/LDReactContext.tsx","kind":"import-statement","original":"../provider/LDReactContext"}],"format":"esm"},"src/client/hooks/useVariationCore.ts":{"bytes":1520,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"src/client/provider/LDReactContext.tsx","kind":"import-statement","original":"../provider/LDReactContext"}],"format":"esm"},"src/client/hooks/useVariation.ts":{"bytes":2669,"imports":[{"path":"src/client/hooks/useVariationCore.ts","kind":"import-statement","original":"./useVariationCore"}],"format":"esm"},"src/client/hooks/useVariationDetail.ts":{"bytes":3180,"imports":[{"path":"src/client/hooks/useVariationCore.ts","kind":"import-statement","original":"./useVariationCore"}],"format":"esm"},"src/client/hooks/index.ts":{"bytes":451,"imports":[{"path":"src/client/hooks/useInitializationStatus.ts","kind":"import-statement","original":"./useInitializationStatus"},{"path":"src/client/hooks/useLDClient.ts","kind":"import-statement","original":"./useLDClient"},{"path":"src/client/hooks/useVariation.ts","kind":"import-statement","original":"./useVariation"},{"path":"src/client/hooks/useVariationDetail.ts","kind":"import-statement","original":"./useVariationDetail"}],"format":"esm"},"src/client/index.ts":{"bytes":399,"imports":[{"path":"src/client/LDClient.ts","kind":"import-statement","original":"./LDClient"},{"path":"src/client/LDOptions.ts","kind":"import-statement","original":"./LDOptions"},{"path":"src/client/provider/LDReactContext.tsx","kind":"import-statement","original":"./provider/LDReactContext"},{"path":"src/client/provider/LDReactProvider.tsx","kind":"import-statement","original":"./provider/LDReactProvider"},{"path":"src/client/LDReactClient.tsx","kind":"import-statement","original":"./LDReactClient"},{"path":"src/client/deprecated-hooks/index.ts","kind":"import-statement","original":"./deprecated-hooks"},{"path":"src/client/hooks/index.ts","kind":"import-statement","original":"./hooks"}],"format":"esm"}},"outputs":{"dist/index.cjs":{"imports":[{"path":"react","kind":"require-call","external":true},{"path":"react","kind":"require-call","external":true},{"path":"react","kind":"require-call","external":true},{"path":"react","kind":"require-call","external":true},{"path":"react","kind":"require-call","external":true},{"path":"react","kind":"require-call","external":true}],"exports":[],"entryPoint":"src/client/index.ts","inputs":{"src/client/index.ts":{"bytesInOutput":466},"src/client/provider/LDReactContext.tsx":{"bytesInOutput":82},"src/client/provider/LDReactProvider.tsx":{"bytesInOutput":808},"../browser/dist/index.js":{"bytesInOutput":87221},"src/client/LDReactClient.tsx":{"bytesInOutput":1807},"src/client/deprecated-hooks/useFlags.ts":{"bytesInOutput":902},"src/client/deprecated-hooks/flagKeyUtils.ts":{"bytesInOutput":233},"src/client/deprecated-hooks/index.ts":{"bytesInOutput":0},"src/client/hooks/useInitializationStatus.ts":{"bytesInOutput":159},"src/client/hooks/index.ts":{"bytesInOutput":0},"src/client/hooks/useLDClient.ts":{"bytesInOutput":93},"src/client/hooks/useVariationCore.ts":{"bytesInOutput":404},"src/client/hooks/useVariation.ts":{"bytesInOutput":264},"src/client/hooks/useVariationDetail.ts":{"bytesInOutput":288}},"bytes":94020}}}
|