@layers/react-native 1.3.0 → 1.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/dist/TrackingTransparency-D6ybvQzE.js +328 -0
  2. package/dist/{TrackingTransparency-CMedp3bh.js → TrackingTransparency-DunpgkgS.mjs} +1 -1
  3. package/dist/TrackingTransparency-DunpgkgS.mjs.map +1 -0
  4. package/dist/{att-DaUoQWpj.js → att-B6KTrEU7.mjs} +2 -2
  5. package/dist/att-B6KTrEU7.mjs.map +1 -0
  6. package/dist/att-BDPyE-Gs.d.mts +10 -0
  7. package/dist/att-BDPyE-Gs.d.mts.map +1 -0
  8. package/dist/{att-BlUZv4_u.d.ts → att-BFy6dcWE.d.ts} +1 -1
  9. package/dist/{att-BlUZv4_u.d.ts.map → att-BFy6dcWE.d.ts.map} +1 -1
  10. package/dist/att-CauvkIKr.js +69 -0
  11. package/dist/att.d.mts +2 -0
  12. package/dist/att.d.ts +1 -1
  13. package/dist/att.js +6 -2
  14. package/dist/att.mjs +3 -0
  15. package/dist/chunk-nOFOJqeH.js +30 -0
  16. package/dist/index-Ct99z5MX.d.mts +187 -0
  17. package/dist/index-Ct99z5MX.d.mts.map +1 -0
  18. package/dist/{index-CSCJSzRS.d.ts → index-DtN6DP29.d.ts} +9 -3
  19. package/dist/index-DtN6DP29.d.ts.map +1 -0
  20. package/dist/index.d.mts +4 -0
  21. package/dist/index.d.ts +3 -3
  22. package/dist/index.js +27 -4
  23. package/dist/index.mjs +5 -0
  24. package/dist/react.d.mts +108 -0
  25. package/dist/react.d.mts.map +1 -0
  26. package/dist/react.d.ts +4 -4
  27. package/dist/react.js +25 -18
  28. package/dist/react.mjs +146 -0
  29. package/dist/react.mjs.map +1 -0
  30. package/dist/skan-CAN-v1eU.d.mts +50 -0
  31. package/dist/skan-CAN-v1eU.d.mts.map +1 -0
  32. package/dist/{skan-DFFAN4wu.js → skan-CBE6_mjp.mjs} +2 -2
  33. package/dist/skan-CBE6_mjp.mjs.map +1 -0
  34. package/dist/skan-DqDVGZkX.js +256 -0
  35. package/dist/{skan-DvnRgJo1.d.ts → skan-DupmPyTn.d.ts} +1 -1
  36. package/dist/{skan-DvnRgJo1.d.ts.map → skan-DupmPyTn.d.ts.map} +1 -1
  37. package/dist/skan.d.mts +2 -0
  38. package/dist/skan.d.ts +1 -1
  39. package/dist/skan.js +2 -2
  40. package/dist/skan.mjs +3 -0
  41. package/dist/{src-DTBDULvf.js → src-DFnL34cK.mjs} +38 -7
  42. package/dist/src-DFnL34cK.mjs.map +1 -0
  43. package/dist/src-DQCNfyUc.js +825 -0
  44. package/package.json +12 -5
  45. package/dist/TrackingTransparency-CMedp3bh.js.map +0 -1
  46. package/dist/att-DaUoQWpj.js.map +0 -1
  47. package/dist/index-CSCJSzRS.d.ts.map +0 -1
  48. package/dist/react.js.map +0 -1
  49. package/dist/skan-DFFAN4wu.js.map +0 -1
  50. package/dist/src-DTBDULvf.js.map +0 -1
  51. /package/dist/{chunk-DyChAoct.js → chunk-DmmLNhcN.mjs} +0 -0
@@ -0,0 +1,328 @@
1
+ const require_chunk = require('./chunk-nOFOJqeH.js');
2
+ let react_native = require("react-native");
3
+ react_native = require_chunk.__toESM(react_native);
4
+ let react = require("react");
5
+ react = require_chunk.__toESM(react);
6
+
7
+ //#region ../../node_modules/expo-modules-core/src/NativeModulesProxy.ts
8
+ /**
9
+ * @deprecated `NativeModulesProxy` is deprecated and might be removed in the future releases.
10
+ * Use `requireNativeModule` or `requireOptionalNativeModule` instead.
11
+ */
12
+ var NativeModulesProxy_default = {};
13
+
14
+ //#endregion
15
+ //#region ../../node_modules/expo-modules-core/src/TurboModuleToExpoModuleProxy.ts
16
+ function createTurboModuleToExpoProxy(turboModule, name) {
17
+ return null;
18
+ }
19
+
20
+ //#endregion
21
+ //#region ../../node_modules/expo-modules-core/src/ensureNativeModulesAreInstalled.ts
22
+ /**
23
+ * Ensures that the native modules are installed in the current runtime.
24
+ * Otherwise, it synchronously calls a native function that installs them.
25
+ */
26
+ function ensureNativeModulesAreInstalled() {}
27
+
28
+ //#endregion
29
+ //#region ../../node_modules/expo-modules-core/src/requireNativeModule.ts
30
+ /**
31
+ * Imports the native module registered with given name. In the first place it tries to load
32
+ * the module installed through the JSI host object and then falls back to the bridge proxy module.
33
+ * Notice that the modules loaded from the proxy may not support some features like synchronous functions.
34
+ *
35
+ * @param moduleName Name of the requested native module.
36
+ * @returns Object representing the native module.
37
+ * @throws Error when there is no native module with given name.
38
+ */
39
+ function requireNativeModule(moduleName) {
40
+ const nativeModule = requireOptionalNativeModule(moduleName);
41
+ if (!nativeModule) throw new Error(`Cannot find native module '${moduleName}'`);
42
+ return nativeModule;
43
+ }
44
+ /**
45
+ * Imports the native module registered with the given name. The same as `requireNativeModule`,
46
+ * but returns `null` when the module cannot be found instead of throwing an error.
47
+ *
48
+ * @param moduleName Name of the requested native module.
49
+ * @returns Object representing the native module or `null` when it cannot be found.
50
+ */
51
+ function requireOptionalNativeModule(moduleName) {
52
+ /* @__PURE__ */ ensureNativeModulesAreInstalled();
53
+ try {
54
+ return globalThis.expo?.modules?.[moduleName] ?? NativeModulesProxy_default[moduleName] ?? createTurboModuleToExpoProxy(react_native.TurboModuleRegistry.get(moduleName), moduleName) ?? null;
55
+ } catch (e) {
56
+ const error = e;
57
+ console.warn(`An error occurred while requiring the '${moduleName}' module: ${error.message}`);
58
+ return null;
59
+ }
60
+ }
61
+
62
+ //#endregion
63
+ //#region ../../node_modules/expo-modules-core/src/environment/browser.ts
64
+ const isDOMAvailable = false;
65
+ const canUseEventListeners = false;
66
+ const canUseViewport = false;
67
+ let isAsyncDebugging = false;
68
+ if (__DEV__) isAsyncDebugging = !global.nativeExtensions && !global.nativeCallSyncHook && !global.RN$Bridgeless;
69
+
70
+ //#endregion
71
+ //#region ../../node_modules/expo-modules-core/src/Platform.ts
72
+ if (__DEV__ && typeof process.env.EXPO_OS === "undefined") console.warn(`The global process.env.EXPO_OS is not defined. This should be inlined by babel-preset-expo during transformation.`);
73
+ const nativeSelect = typeof window !== "undefined" ? react_native.Platform.select : function select(specifics) {
74
+ if (!process.env.EXPO_OS) return void 0;
75
+ if (specifics.hasOwnProperty(process.env.EXPO_OS)) return specifics[process.env.EXPO_OS];
76
+ else if (process.env.EXPO_OS !== "web" && specifics.hasOwnProperty("native")) return specifics.native;
77
+ else if (specifics.hasOwnProperty("default")) return specifics.default;
78
+ };
79
+ const Platform$1 = {
80
+ OS: process.env.EXPO_OS || react_native.Platform.OS,
81
+ select: nativeSelect,
82
+ isDOMAvailable,
83
+ canUseEventListeners,
84
+ canUseViewport,
85
+ isAsyncDebugging
86
+ };
87
+ var Platform_default = Platform$1;
88
+
89
+ //#endregion
90
+ //#region ../../node_modules/expo-modules-core/src/errors/CodedError.ts
91
+ /**
92
+ * A general error class that should be used for all errors in Expo modules.
93
+ * Guarantees a `code` field that can be used to differentiate between different
94
+ * types of errors without further subclassing Error.
95
+ */
96
+ var CodedError = class extends Error {
97
+ code;
98
+ info;
99
+ constructor(code, message) {
100
+ super(message);
101
+ this.code = code;
102
+ }
103
+ };
104
+
105
+ //#endregion
106
+ //#region ../../node_modules/expo-modules-core/src/errors/UnavailabilityError.ts
107
+ /**
108
+ * A class for errors to be thrown when a property is accessed which is
109
+ * unavailable, unsupported, or not currently implemented on the running
110
+ * platform.
111
+ */
112
+ var UnavailabilityError = class extends CodedError {
113
+ constructor(moduleName, propertyName) {
114
+ super("ERR_UNAVAILABLE", `The method or property ${moduleName}.${propertyName} is not available on ${Platform_default.OS}, are you sure you've linked all the native dependencies properly?`);
115
+ }
116
+ };
117
+
118
+ //#endregion
119
+ //#region ../../node_modules/expo-modules-core/src/PermissionsInterface.ts
120
+ let PermissionStatus = /* @__PURE__ */ function(PermissionStatus$1) {
121
+ /**
122
+ * User has granted the permission.
123
+ */
124
+ PermissionStatus$1["GRANTED"] = "granted";
125
+ /**
126
+ * User hasn't granted or denied the permission yet.
127
+ */
128
+ PermissionStatus$1["UNDETERMINED"] = "undetermined";
129
+ /**
130
+ * User has denied the permission.
131
+ */
132
+ PermissionStatus$1["DENIED"] = "denied";
133
+ return PermissionStatus$1;
134
+ }({});
135
+
136
+ //#endregion
137
+ //#region ../../node_modules/expo-modules-core/src/PermissionsHook.ts
138
+ /**
139
+ * Get or request permission for protected functionality within the app.
140
+ * It uses separate permission requesters to interact with a single permission.
141
+ * By default, the hook will only retrieve the permission status.
142
+ */
143
+ function usePermission(methods, options) {
144
+ const isMounted = (0, react.useRef)(true);
145
+ const [status, setStatus] = (0, react.useState)(null);
146
+ const { get = true, request = false,...permissionOptions } = options || {};
147
+ const getPermission = (0, react.useCallback)(async () => {
148
+ let response;
149
+ if (Object.keys(permissionOptions).length > 0) response = await methods.getMethod(permissionOptions);
150
+ else response = await methods.getMethod();
151
+ if (isMounted.current) setStatus(response);
152
+ return response;
153
+ }, [methods.getMethod]);
154
+ const requestPermission = (0, react.useCallback)(async () => {
155
+ let response;
156
+ if (Object.keys(permissionOptions).length > 0) response = await methods.requestMethod(permissionOptions);
157
+ else response = await methods.requestMethod();
158
+ if (isMounted.current) setStatus(response);
159
+ return response;
160
+ }, [methods.requestMethod]);
161
+ (0, react.useEffect)(function runMethods() {
162
+ if (request) requestPermission();
163
+ if (!request && get) getPermission();
164
+ }, [
165
+ get,
166
+ request,
167
+ requestPermission,
168
+ getPermission
169
+ ]);
170
+ (0, react.useEffect)(function didMount() {
171
+ isMounted.current = true;
172
+ return () => {
173
+ isMounted.current = false;
174
+ };
175
+ }, []);
176
+ return [
177
+ status,
178
+ requestPermission,
179
+ getPermission
180
+ ];
181
+ }
182
+ /**
183
+ * Create a new permission hook with the permission methods built-in.
184
+ * This can be used to quickly create specific permission hooks in every module.
185
+ */
186
+ function createPermissionHook(methods) {
187
+ return (options) => usePermission(methods, options);
188
+ }
189
+
190
+ //#endregion
191
+ //#region ../../node_modules/expo-tracking-transparency/build/ExpoTrackingTransparency.js
192
+ var ExpoTrackingTransparency_default = requireNativeModule("ExpoTrackingTransparency");
193
+
194
+ //#endregion
195
+ //#region ../../node_modules/expo-tracking-transparency/build/TrackingTransparency.js
196
+ /**
197
+ * Gets the advertising ID, a UUID string intended only for advertising. Use this string for
198
+ * frequency capping, attribution, conversion events, estimating the number of unique users,
199
+ * advertising fraud detection, and debugging.
200
+ *
201
+ * As a best practice, don't store the advertising ID. Instead, call this function each time your
202
+ * app needs to use the advertising ID. Users can change whether they allow app tracking and can
203
+ * reset their advertising ID at any time in their system settings. Check your app's authorization
204
+ * using `getTrackingPermissionsAsync()` to determine the user's intent.
205
+ *
206
+ * On Android, this function returns the "Android Advertising ID"
207
+ * ([AAID](https://developers.google.com/android/reference/com/google/android/gms/ads/identifier/AdvertisingIdClient.Info#public-string-getid)).
208
+ * On Android devices that support multiple users, including guest users, it's possible for your app
209
+ * to obtain different advertising IDs on the same device. These different IDs correspond to
210
+ * different users who could be signed in on that device. See Google's documentation for more
211
+ * information: [Get a user-resettable advertising
212
+ * ID](https://developer.android.com/training/articles/ad-id).
213
+ *
214
+ * On iOS, this function returns the "Identifier for Advertisers"
215
+ * ([IDFA](https://developer.apple.com/documentation/adsupport/asidentifiermanager/advertisingidentifier)),
216
+ * a string that's unique to each device. On devices running iOS 14.5 and newer, your app must
217
+ * request tracking authorization using `requestTrackingPermissionsAsync()` before it can get the
218
+ * advertising identifier.
219
+ *
220
+ * @return Returns either a UUID `string` or `null`. It returns null in the following cases:
221
+ * - On Android, when `isLimitAdTrackingEnabled()` is `true`
222
+ * - In the iOS simulator, regardless of any settings
223
+ * - On devices running iOS 14.5 and later if you haven't received permission using
224
+ * `requestTrackingPermissionsAsync()`
225
+ * - On iOS, if you've requested permission and the user declines
226
+ * - On iOS, when a profile or configuration restricts access to the advertising identifier, such as
227
+ * when the user has turned off the system-wide "Allow Apps to Request to Track" setting
228
+ *
229
+ * @example
230
+ * ```ts
231
+ * TrackingTransparency.getAdvertisingId();
232
+ * // "E9228286-4C4E-4789-9D95-15827DCB291B"
233
+ * ```
234
+ */
235
+ function getAdvertisingId() {
236
+ const advertisingId = ExpoTrackingTransparency_default.getAdvertisingId();
237
+ if (advertisingId === "00000000-0000-0000-0000-000000000000") return null;
238
+ return advertisingId;
239
+ }
240
+ const androidAndWebPermissionsResponse = {
241
+ granted: true,
242
+ expires: "never",
243
+ canAskAgain: true,
244
+ status: PermissionStatus.GRANTED
245
+ };
246
+ /**
247
+ * Requests the user to authorize or deny access to app-related data that can be used for tracking
248
+ * the user or the device. Examples of data used for tracking include email address, device ID,
249
+ * advertising ID, etc. On iOS 14.5 and above, if the user denies this permission, any attempt to
250
+ * collect the IDFA will return a string of 0s.
251
+ *
252
+ * The system remembers the user’s choice and doesn’t prompt again unless a user uninstalls and then
253
+ * reinstalls the app on the device.
254
+ *
255
+ * On Android, web, and iOS 13 and below, this method always returns that the permission was
256
+ * granted.
257
+ * @example
258
+ * ```typescript
259
+ * const { granted } = await requestTrackingPermissionsAsync();
260
+ *
261
+ * if (granted) {
262
+ * // Your app is authorized to track the user or their device
263
+ * }
264
+ * ```
265
+ */
266
+ async function requestTrackingPermissionsAsync() {
267
+ if (react_native.Platform.OS !== "ios") return Promise.resolve(androidAndWebPermissionsResponse);
268
+ if (!ExpoTrackingTransparency_default.requestPermissionsAsync) throw new UnavailabilityError("TrackingTransparency", "requestPermissionsAsync");
269
+ return await ExpoTrackingTransparency_default.requestPermissionsAsync();
270
+ }
271
+ /**
272
+ * Checks whether or not the user has authorized the app to access app-related data that can be used
273
+ * for tracking the user or the device. See `requestTrackingPermissionsAsync` for more details.
274
+ *
275
+ * On Android, web, and iOS 13 and below, this method always returns that the permission was
276
+ * granted.
277
+ *
278
+ * @example
279
+ * ```typescript
280
+ * const { granted } = await getTrackingPermissionsAsync();
281
+ *
282
+ * if (granted) {
283
+ * // Your app is authorized to track the user or their device
284
+ * }
285
+ * ```
286
+ */
287
+ async function getTrackingPermissionsAsync() {
288
+ if (react_native.Platform.OS !== "ios") return Promise.resolve(androidAndWebPermissionsResponse);
289
+ if (!ExpoTrackingTransparency_default.getPermissionsAsync) throw new UnavailabilityError("TrackingTransparency", "getPermissionsAsync");
290
+ return await ExpoTrackingTransparency_default.getPermissionsAsync();
291
+ }
292
+ /**
293
+ * Check or request the user to authorize or deny access to app-related data that can be used for tracking
294
+ * the user or the device. Examples of data used for tracking include email address, device ID,
295
+ * advertising ID, etc. On iOS 14.5 and above, if the user denies this permission, any attempt to
296
+ * collect the IDFA will return a string of 0s.
297
+ *
298
+ * The system remembers the user’s choice and doesn’t prompt again unless a user uninstalls and then
299
+ * reinstalls the app on the device.
300
+ *
301
+ * On Android, web, and iOS 13 and below, this method always returns that the permission was
302
+ * granted.
303
+ * @example
304
+ * ```ts
305
+ * const [status, requestPermission] = useTrackingPermissions();
306
+ * ```
307
+ */
308
+ const useTrackingPermissions = createPermissionHook({
309
+ getMethod: getTrackingPermissionsAsync,
310
+ requestMethod: requestTrackingPermissionsAsync
311
+ });
312
+ /**
313
+ * Returns whether the TrackingTransparency API is available on the current device.
314
+ *
315
+ * @returns On devices where the Tracking Transparency API is unavailable,
316
+ * the get and request permissions methods will always resolve to `granted`.
317
+ */
318
+ function isAvailable() {
319
+ return Boolean(ExpoTrackingTransparency_default);
320
+ }
321
+
322
+ //#endregion
323
+ exports.PermissionStatus = PermissionStatus;
324
+ exports.getAdvertisingId = getAdvertisingId;
325
+ exports.getTrackingPermissionsAsync = getTrackingPermissionsAsync;
326
+ exports.isAvailable = isAvailable;
327
+ exports.requestTrackingPermissionsAsync = requestTrackingPermissionsAsync;
328
+ exports.useTrackingPermissions = useTrackingPermissions;
@@ -318,4 +318,4 @@ function isAvailable() {
318
318
 
319
319
  //#endregion
320
320
  export { PermissionStatus, getAdvertisingId, getTrackingPermissionsAsync, isAvailable, requestTrackingPermissionsAsync, useTrackingPermissions };
321
- //# sourceMappingURL=TrackingTransparency-CMedp3bh.js.map
321
+ //# sourceMappingURL=TrackingTransparency-DunpgkgS.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TrackingTransparency-DunpgkgS.mjs","names":["NativeModulesProxy","isAsyncDebugging: boolean","ReactNativePlatform","Platform","Platform","response: Permission","ExpoTrackingTransparency"],"sources":["../../../node_modules/expo-modules-core/src/NativeModulesProxy.ts","../../../node_modules/expo-modules-core/src/TurboModuleToExpoModuleProxy.ts","../../../node_modules/expo-modules-core/src/ensureNativeModulesAreInstalled.ts","../../../node_modules/expo-modules-core/src/requireNativeModule.ts","../../../node_modules/expo-modules-core/src/environment/browser.ts","../../../node_modules/expo-modules-core/src/Platform.ts","../../../node_modules/expo-modules-core/src/errors/CodedError.ts","../../../node_modules/expo-modules-core/src/errors/UnavailabilityError.ts","../../../node_modules/expo-modules-core/src/PermissionsInterface.ts","../../../node_modules/expo-modules-core/src/PermissionsHook.ts","../../../node_modules/expo-tracking-transparency/build/ExpoTrackingTransparency.js","../../../node_modules/expo-tracking-transparency/build/TrackingTransparency.js"],"sourcesContent":["import type { ProxyNativeModule } from './NativeModulesProxy.types';\n\n// We default to an empty object shim wherever we don't have an environment-specific implementation\n\n/**\n * @deprecated `NativeModulesProxy` is deprecated and might be removed in the future releases.\n * Use `requireNativeModule` or `requireOptionalNativeModule` instead.\n */\nexport default {} as Record<string, ProxyNativeModule>;\n","// Copyright © 2024 650 Industries.\nimport type { TurboModule } from 'react-native';\n\nexport function createTurboModuleToExpoProxy(turboModule: TurboModule | null, name: string) {\n return null;\n}\n","// Installs the expo global on web\nimport './polyfill';\n\n/**\n * Ensures that the native modules are installed in the current runtime.\n * Otherwise, it synchronously calls a native function that installs them.\n */\nexport function ensureNativeModulesAreInstalled(): void {\n // No-op on web\n}\n","import { TurboModuleRegistry } from 'react-native';\n\nimport NativeModulesProxy from './NativeModulesProxy';\nimport { createTurboModuleToExpoProxy } from './TurboModuleToExpoModuleProxy';\nimport { ensureNativeModulesAreInstalled } from './ensureNativeModulesAreInstalled';\n\n/**\n * Imports the native module registered with given name. In the first place it tries to load\n * the module installed through the JSI host object and then falls back to the bridge proxy module.\n * Notice that the modules loaded from the proxy may not support some features like synchronous functions.\n *\n * @param moduleName Name of the requested native module.\n * @returns Object representing the native module.\n * @throws Error when there is no native module with given name.\n */\nexport function requireNativeModule<ModuleType = any>(moduleName: string): ModuleType {\n const nativeModule = requireOptionalNativeModule<ModuleType>(moduleName);\n\n if (!nativeModule) {\n throw new Error(`Cannot find native module '${moduleName}'`);\n }\n return nativeModule;\n}\n\n/**\n * Imports the native module registered with the given name. The same as `requireNativeModule`,\n * but returns `null` when the module cannot be found instead of throwing an error.\n *\n * @param moduleName Name of the requested native module.\n * @returns Object representing the native module or `null` when it cannot be found.\n */\nexport function requireOptionalNativeModule<ModuleType = any>(\n moduleName: string\n): ModuleType | null {\n ensureNativeModulesAreInstalled();\n\n try {\n return (\n globalThis.expo?.modules?.[moduleName] ??\n NativeModulesProxy[moduleName] ??\n createTurboModuleToExpoProxy(TurboModuleRegistry.get(moduleName), moduleName) ??\n null\n );\n } catch (e) {\n const error = e as Error;\n console.warn(`An error occurred while requiring the '${moduleName}' module: ${error.message}`);\n return null;\n }\n}\n","declare const global: any;\n\n// In standard node environments there is no DOM API\nexport const isDOMAvailable = false;\nexport const canUseEventListeners = false;\nexport const canUseViewport = false;\n\nexport let isAsyncDebugging: boolean = false;\n\nif (__DEV__) {\n // These native globals are injected by native React runtimes and not standard browsers\n // we can use them to determine if the JS is being executed in Chrome.\n isAsyncDebugging =\n !global.nativeExtensions && !global.nativeCallSyncHook && !global.RN$Bridgeless;\n}\n","import { PlatformOSType, Platform as ReactNativePlatform } from 'react-native';\n\nimport {\n isDOMAvailable,\n canUseEventListeners,\n canUseViewport,\n isAsyncDebugging,\n} from './environment/browser';\n\nexport type PlatformSelectOSType = PlatformOSType | 'native' | 'electron' | 'default';\n\nexport type PlatformSelect = <T>(specifics: { [platform in PlatformSelectOSType]?: T }) => T;\n\nif (__DEV__ && typeof process.env.EXPO_OS === 'undefined') {\n console.warn(\n `The global process.env.EXPO_OS is not defined. This should be inlined by babel-preset-expo during transformation.`\n );\n}\n\nconst nativeSelect =\n typeof window !== 'undefined'\n ? ReactNativePlatform.select\n : // process.env.EXPO_OS is injected by `babel-preset-expo` and available in both client and `react-server` environments.\n // Opt to use the env var when possible, and fallback to the React Native Platform module when it's not (arbitrary bundlers and transformers).\n function select<T>(specifics: { [platform in PlatformSelectOSType]?: T }): T | undefined {\n if (!process.env.EXPO_OS) return undefined;\n if (specifics.hasOwnProperty(process.env.EXPO_OS)) {\n return specifics[process.env.EXPO_OS as PlatformSelectOSType]!;\n } else if (process.env.EXPO_OS !== 'web' && specifics.hasOwnProperty('native')) {\n return specifics.native!;\n } else if (specifics.hasOwnProperty('default')) {\n return specifics.default!;\n }\n // do nothing...\n return undefined;\n };\n\nconst Platform = {\n /**\n * Denotes the currently running platform.\n * Can be one of ios, android, web.\n */\n OS: process.env.EXPO_OS || ReactNativePlatform.OS,\n /**\n * Returns the value with the matching platform.\n * Object keys can be any of ios, android, native, web, default.\n *\n * @ios ios, native, default\n * @android android, native, default\n * @web web, default\n */\n select: nativeSelect as PlatformSelect,\n /**\n * Denotes if the DOM API is available in the current environment.\n * The DOM is not available in native React runtimes and Node.js.\n */\n isDOMAvailable,\n /**\n * Denotes if the current environment can attach event listeners\n * to the window. This will return false in native React\n * runtimes and Node.js.\n */\n canUseEventListeners,\n /**\n * Denotes if the current environment can inspect properties of the\n * screen on which the current window is being rendered. This will\n * return false in native React runtimes and Node.js.\n */\n canUseViewport,\n /**\n * If the JavaScript is being executed in a remote JavaScript environment.\n * When `true`, synchronous native invocations cannot be executed.\n */\n isAsyncDebugging,\n};\n\nexport default Platform;\n","/**\n * A general error class that should be used for all errors in Expo modules.\n * Guarantees a `code` field that can be used to differentiate between different\n * types of errors without further subclassing Error.\n */\nexport class CodedError extends Error {\n code: string;\n info?: any;\n\n constructor(code: string, message: string) {\n super(message);\n this.code = code;\n }\n}\n","import { CodedError } from './CodedError';\nimport Platform from '../Platform';\n\n/**\n * A class for errors to be thrown when a property is accessed which is\n * unavailable, unsupported, or not currently implemented on the running\n * platform.\n */\nexport class UnavailabilityError extends CodedError {\n constructor(moduleName: string, propertyName: string) {\n super(\n 'ERR_UNAVAILABLE',\n `The method or property ${moduleName}.${propertyName} is not available on ${Platform.OS}, are you sure you've linked all the native dependencies properly?`\n );\n }\n}\n","export enum PermissionStatus {\n /**\n * User has granted the permission.\n */\n GRANTED = 'granted',\n /**\n * User hasn't granted or denied the permission yet.\n */\n UNDETERMINED = 'undetermined',\n /**\n * User has denied the permission.\n */\n DENIED = 'denied',\n}\n\n/**\n * Permission expiration time. Currently, all permissions are granted permanently.\n */\nexport type PermissionExpiration = 'never' | number;\n\n/**\n * An object obtained by permissions get and request functions.\n */\nexport type PermissionResponse = {\n /**\n * Determines the status of the permission.\n */\n status: PermissionStatus;\n /**\n * Determines time when the permission expires.\n */\n expires: PermissionExpiration;\n /**\n * A convenience boolean that indicates if the permission is granted.\n */\n granted: boolean;\n /**\n * Indicates if user can be asked again for specific permission.\n * If not, one should be directed to the Settings app\n * in order to enable/disable the permission.\n */\n canAskAgain: boolean;\n};\n","// Copyright © 2024 650 Industries.\n\n'use client';\n\nimport { useCallback, useEffect, useRef, useState } from 'react';\n\nimport { PermissionResponse } from './PermissionsInterface';\n\n// These types are identical, but improves the readability for suggestions in editors\ntype RequestPermissionMethod<Permission extends PermissionResponse> = () => Promise<Permission>;\ntype GetPermissionMethod<Permission extends PermissionResponse> = () => Promise<Permission>;\n\ntype PermissionHookMethods<Permission extends PermissionResponse, Options = never> = {\n /** The permission method that requests the user to grant permission. */\n requestMethod: (options?: Options) => Promise<Permission>;\n /** The permission method that only fetches the current permission status. */\n getMethod: (options?: Options) => Promise<Permission>;\n};\n\ntype PermissionHookBehavior = {\n /** If the hook should automatically fetch the current permission status, without asking the user. */\n get?: boolean;\n /** If the hook should automatically request the user to grant permission. */\n request?: boolean;\n};\n\nexport type PermissionHookOptions<Options extends object> = PermissionHookBehavior & Options;\n\n/**\n * Get or request permission for protected functionality within the app.\n * It uses separate permission requesters to interact with a single permission.\n * By default, the hook will only retrieve the permission status.\n */\nfunction usePermission<Permission extends PermissionResponse, Options extends object>(\n methods: PermissionHookMethods<Permission, Options>,\n options?: PermissionHookOptions<Options>\n): [Permission | null, RequestPermissionMethod<Permission>, GetPermissionMethod<Permission>] {\n const isMounted = useRef(true);\n const [status, setStatus] = useState<Permission | null>(null);\n const { get = true, request = false, ...permissionOptions } = options || {};\n\n const getPermission = useCallback(async () => {\n let response: Permission;\n if (Object.keys(permissionOptions).length > 0) {\n response = await methods.getMethod(permissionOptions as Options);\n } else {\n response = await methods.getMethod();\n }\n if (isMounted.current) setStatus(response);\n return response;\n }, [methods.getMethod]);\n\n const requestPermission = useCallback(async () => {\n let response: Permission;\n if (Object.keys(permissionOptions).length > 0) {\n response = await methods.requestMethod(permissionOptions as Options);\n } else {\n response = await methods.requestMethod();\n }\n if (isMounted.current) setStatus(response);\n return response;\n }, [methods.requestMethod]);\n\n useEffect(\n function runMethods() {\n if (request) requestPermission();\n if (!request && get) getPermission();\n },\n [get, request, requestPermission, getPermission]\n );\n\n // Workaround for unmounting components receiving state updates\n useEffect(function didMount() {\n isMounted.current = true;\n return () => {\n isMounted.current = false;\n };\n }, []);\n\n return [status, requestPermission, getPermission];\n}\n\n/**\n * Create a new permission hook with the permission methods built-in.\n * This can be used to quickly create specific permission hooks in every module.\n */\nexport function createPermissionHook<Permission extends PermissionResponse, Options extends object>(\n methods: PermissionHookMethods<Permission, Options>\n) {\n return (options?: PermissionHookOptions<Options>) =>\n usePermission<Permission, Options>(methods, options);\n}\n","import { requireNativeModule } from 'expo-modules-core';\n// TODO: Rename the package to 'ExpoTracking'\nexport default requireNativeModule('ExpoTrackingTransparency');\n//# sourceMappingURL=ExpoTrackingTransparency.js.map","import { PermissionStatus, UnavailabilityError, createPermissionHook, } from 'expo-modules-core';\nimport { Platform } from 'react-native';\nimport ExpoTrackingTransparency from './ExpoTrackingTransparency';\n/**\n * Gets the advertising ID, a UUID string intended only for advertising. Use this string for\n * frequency capping, attribution, conversion events, estimating the number of unique users,\n * advertising fraud detection, and debugging.\n *\n * As a best practice, don't store the advertising ID. Instead, call this function each time your\n * app needs to use the advertising ID. Users can change whether they allow app tracking and can\n * reset their advertising ID at any time in their system settings. Check your app's authorization\n * using `getTrackingPermissionsAsync()` to determine the user's intent.\n *\n * On Android, this function returns the \"Android Advertising ID\"\n * ([AAID](https://developers.google.com/android/reference/com/google/android/gms/ads/identifier/AdvertisingIdClient.Info#public-string-getid)).\n * On Android devices that support multiple users, including guest users, it's possible for your app\n * to obtain different advertising IDs on the same device. These different IDs correspond to\n * different users who could be signed in on that device. See Google's documentation for more\n * information: [Get a user-resettable advertising\n * ID](https://developer.android.com/training/articles/ad-id).\n *\n * On iOS, this function returns the \"Identifier for Advertisers\"\n * ([IDFA](https://developer.apple.com/documentation/adsupport/asidentifiermanager/advertisingidentifier)),\n * a string that's unique to each device. On devices running iOS 14.5 and newer, your app must\n * request tracking authorization using `requestTrackingPermissionsAsync()` before it can get the\n * advertising identifier.\n *\n * @return Returns either a UUID `string` or `null`. It returns null in the following cases:\n * - On Android, when `isLimitAdTrackingEnabled()` is `true`\n * - In the iOS simulator, regardless of any settings\n * - On devices running iOS 14.5 and later if you haven't received permission using\n * `requestTrackingPermissionsAsync()`\n * - On iOS, if you've requested permission and the user declines\n * - On iOS, when a profile or configuration restricts access to the advertising identifier, such as\n * when the user has turned off the system-wide \"Allow Apps to Request to Track\" setting\n *\n * @example\n * ```ts\n * TrackingTransparency.getAdvertisingId();\n * // \"E9228286-4C4E-4789-9D95-15827DCB291B\"\n * ```\n */\nexport function getAdvertisingId() {\n const advertisingId = ExpoTrackingTransparency.getAdvertisingId();\n if (advertisingId === '00000000-0000-0000-0000-000000000000') {\n return null;\n }\n return advertisingId;\n}\nconst androidAndWebPermissionsResponse = {\n granted: true,\n expires: 'never',\n canAskAgain: true,\n status: PermissionStatus.GRANTED,\n};\n/**\n * Requests the user to authorize or deny access to app-related data that can be used for tracking\n * the user or the device. Examples of data used for tracking include email address, device ID,\n * advertising ID, etc. On iOS 14.5 and above, if the user denies this permission, any attempt to\n * collect the IDFA will return a string of 0s.\n *\n * The system remembers the user’s choice and doesn’t prompt again unless a user uninstalls and then\n * reinstalls the app on the device.\n *\n * On Android, web, and iOS 13 and below, this method always returns that the permission was\n * granted.\n * @example\n * ```typescript\n * const { granted } = await requestTrackingPermissionsAsync();\n *\n * if (granted) {\n * // Your app is authorized to track the user or their device\n * }\n * ```\n */\nexport async function requestTrackingPermissionsAsync() {\n if (Platform.OS !== 'ios') {\n return Promise.resolve(androidAndWebPermissionsResponse);\n }\n if (!ExpoTrackingTransparency.requestPermissionsAsync) {\n throw new UnavailabilityError('TrackingTransparency', 'requestPermissionsAsync');\n }\n return await ExpoTrackingTransparency.requestPermissionsAsync();\n}\n/**\n * Checks whether or not the user has authorized the app to access app-related data that can be used\n * for tracking the user or the device. See `requestTrackingPermissionsAsync` for more details.\n *\n * On Android, web, and iOS 13 and below, this method always returns that the permission was\n * granted.\n *\n * @example\n * ```typescript\n * const { granted } = await getTrackingPermissionsAsync();\n *\n * if (granted) {\n * // Your app is authorized to track the user or their device\n * }\n * ```\n */\nexport async function getTrackingPermissionsAsync() {\n if (Platform.OS !== 'ios') {\n return Promise.resolve(androidAndWebPermissionsResponse);\n }\n if (!ExpoTrackingTransparency.getPermissionsAsync) {\n throw new UnavailabilityError('TrackingTransparency', 'getPermissionsAsync');\n }\n return await ExpoTrackingTransparency.getPermissionsAsync();\n}\n/**\n * Check or request the user to authorize or deny access to app-related data that can be used for tracking\n * the user or the device. Examples of data used for tracking include email address, device ID,\n * advertising ID, etc. On iOS 14.5 and above, if the user denies this permission, any attempt to\n * collect the IDFA will return a string of 0s.\n *\n * The system remembers the user’s choice and doesn’t prompt again unless a user uninstalls and then\n * reinstalls the app on the device.\n *\n * On Android, web, and iOS 13 and below, this method always returns that the permission was\n * granted.\n * @example\n * ```ts\n * const [status, requestPermission] = useTrackingPermissions();\n * ```\n */\nexport const useTrackingPermissions = createPermissionHook({\n getMethod: getTrackingPermissionsAsync,\n requestMethod: requestTrackingPermissionsAsync,\n});\n/**\n * Returns whether the TrackingTransparency API is available on the current device.\n *\n * @returns On devices where the Tracking Transparency API is unavailable,\n * the get and request permissions methods will always resolve to `granted`.\n */\nexport function isAvailable() {\n return Boolean(ExpoTrackingTransparency);\n}\nexport { PermissionStatus };\n//# sourceMappingURL=TrackingTransparency.js.map"],"x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11],"mappings":"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"}
@@ -1,4 +1,4 @@
1
- import { t as __require } from "./chunk-DyChAoct.js";
1
+ import { t as __require } from "./chunk-DmmLNhcN.mjs";
2
2
 
3
3
  //#region src/att.ts
4
4
  function getNativeModule() {
@@ -39,4 +39,4 @@ async function getVendorId() {
39
39
 
40
40
  //#endregion
41
41
  export { requestTrackingAuthorization as a, isATTAvailable as i, getAdvertisingId as n, getVendorId as r, getATTStatus as t };
42
- //# sourceMappingURL=att-DaUoQWpj.js.map
42
+ //# sourceMappingURL=att-B6KTrEU7.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"att-B6KTrEU7.mjs","names":[],"sources":["../src/att.ts"],"sourcesContent":["// ATT Module — iOS-only App Tracking Transparency.\n// Bridges to native iOS ATTrackingManager via NativeModules.\n\nexport type ATTStatus = 'not_determined' | 'restricted' | 'denied' | 'authorized';\n\ninterface NativeATTModule {\n getTrackingAuthorizationStatus(): Promise<ATTStatus>;\n requestTrackingAuthorization(): Promise<ATTStatus>;\n isATTAvailable(): Promise<boolean>;\n getAdvertisingId(): Promise<string | null>;\n getVendorId(): Promise<string | null>;\n}\n\nfunction getNativeModule(): NativeATTModule | null {\n try {\n const { NativeModules, Platform } = require('react-native');\n if (Platform.OS === 'ios' && NativeModules.LayersATT) {\n return NativeModules.LayersATT as NativeATTModule;\n }\n } catch {\n // Not available\n }\n return null;\n}\n\nexport async function getATTStatus(): Promise<ATTStatus> {\n const mod = getNativeModule();\n if (!mod) return 'not_determined';\n return mod.getTrackingAuthorizationStatus();\n}\n\nexport async function requestTrackingAuthorization(): Promise<ATTStatus> {\n const mod = getNativeModule();\n if (!mod) return 'not_determined';\n\n const current = await mod.getTrackingAuthorizationStatus();\n if (current !== 'not_determined') return current;\n\n return mod.requestTrackingAuthorization();\n}\n\nexport async function isATTAvailable(): Promise<boolean> {\n const mod = getNativeModule();\n if (!mod) return false;\n return mod.isATTAvailable();\n}\n\nexport async function getAdvertisingId(): Promise<string | null> {\n const mod = getNativeModule();\n if (!mod) return null;\n const status = await mod.getTrackingAuthorizationStatus();\n if (status !== 'authorized') return null;\n return mod.getAdvertisingId();\n}\n\nexport async function getVendorId(): Promise<string | null> {\n const mod = getNativeModule();\n if (!mod) return null;\n return mod.getVendorId();\n}\n"],"mappings":";;;AAaA,SAAS,kBAA0C;AACjD,KAAI;EACF,MAAM,EAAE,eAAe,uBAAqB,eAAe;AAC3D,MAAI,SAAS,OAAO,SAAS,cAAc,UACzC,QAAO,cAAc;SAEjB;AAGR,QAAO;;AAGT,eAAsB,eAAmC;CACvD,MAAM,MAAM,iBAAiB;AAC7B,KAAI,CAAC,IAAK,QAAO;AACjB,QAAO,IAAI,gCAAgC;;AAG7C,eAAsB,+BAAmD;CACvE,MAAM,MAAM,iBAAiB;AAC7B,KAAI,CAAC,IAAK,QAAO;CAEjB,MAAM,UAAU,MAAM,IAAI,gCAAgC;AAC1D,KAAI,YAAY,iBAAkB,QAAO;AAEzC,QAAO,IAAI,8BAA8B;;AAG3C,eAAsB,iBAAmC;CACvD,MAAM,MAAM,iBAAiB;AAC7B,KAAI,CAAC,IAAK,QAAO;AACjB,QAAO,IAAI,gBAAgB;;AAG7B,eAAsB,mBAA2C;CAC/D,MAAM,MAAM,iBAAiB;AAC7B,KAAI,CAAC,IAAK,QAAO;AAEjB,KADe,MAAM,IAAI,gCAAgC,KAC1C,aAAc,QAAO;AACpC,QAAO,IAAI,kBAAkB;;AAG/B,eAAsB,cAAsC;CAC1D,MAAM,MAAM,iBAAiB;AAC7B,KAAI,CAAC,IAAK,QAAO;AACjB,QAAO,IAAI,aAAa"}
@@ -0,0 +1,10 @@
1
+ //#region src/att.d.ts
2
+ type ATTStatus = 'not_determined' | 'restricted' | 'denied' | 'authorized';
3
+ declare function getATTStatus(): Promise<ATTStatus>;
4
+ declare function requestTrackingAuthorization(): Promise<ATTStatus>;
5
+ declare function isATTAvailable(): Promise<boolean>;
6
+ declare function getAdvertisingId(): Promise<string | null>;
7
+ declare function getVendorId(): Promise<string | null>;
8
+ //#endregion
9
+ export { isATTAvailable as a, getVendorId as i, getATTStatus as n, requestTrackingAuthorization as o, getAdvertisingId as r, ATTStatus as t };
10
+ //# sourceMappingURL=att-BDPyE-Gs.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"att-BDPyE-Gs.d.mts","names":[],"sources":["../src/att.ts"],"sourcesContent":[],"mappings":";KAGY,SAAA;AAAA,iBAsBU,YAAA,CAAA,CAtBD,EAsBiB,OAtBjB,CAsByB,SAtBzB,CAAA;AAsBC,iBAMA,4BAAA,CAAA,CANuB,EAMS,OANT,CAMiB,SANjB,CAAA;AAMvB,iBAUA,cAAA,CAAA,CAV4B,EAUV,OAVsB,CAAA,OAAR,CAAA;AAUhC,iBAMA,gBAAA,CAAA,CANyB,EAML,OANK,CAAA,MAAA,GAAA,IAAA,CAAA;AAMzB,iBAQA,WAAA,CAAA,CARoB,EAQL,OARY,CAAA,MAAA,GAAA,IAAA,CAAA"}
@@ -7,4 +7,4 @@ declare function getAdvertisingId(): Promise<string | null>;
7
7
  declare function getVendorId(): Promise<string | null>;
8
8
  //#endregion
9
9
  export { isATTAvailable as a, getVendorId as i, getATTStatus as n, requestTrackingAuthorization as o, getAdvertisingId as r, ATTStatus as t };
10
- //# sourceMappingURL=att-BlUZv4_u.d.ts.map
10
+ //# sourceMappingURL=att-BFy6dcWE.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"att-BlUZv4_u.d.ts","names":[],"sources":["../src/att.ts"],"sourcesContent":[],"mappings":";KAGY,SAAA;AAAA,iBAsBU,YAAA,CAAA,CAtBD,EAsBiB,OAtBjB,CAsByB,SAtBzB,CAAA;AAsBC,iBAMA,4BAAA,CAAA,CANuB,EAMS,OANT,CAMiB,SANjB,CAAA;AAMvB,iBAUA,cAAA,CAAA,CAV4B,EAUV,OAVsB,CAAA,OAAR,CAAA;AAUhC,iBAMA,gBAAA,CAAA,CANyB,EAML,OANK,CAAA,MAAA,GAAA,IAAA,CAAA;AAMzB,iBAQA,WAAA,CAAA,CARoB,EAQL,OARY,CAAA,MAAA,GAAA,IAAA,CAAA"}
1
+ {"version":3,"file":"att-BFy6dcWE.d.ts","names":[],"sources":["../src/att.ts"],"sourcesContent":[],"mappings":";KAGY,SAAA;AAAA,iBAsBU,YAAA,CAAA,CAtBD,EAsBiB,OAtBjB,CAsByB,SAtBzB,CAAA;AAsBC,iBAMA,4BAAA,CAAA,CANuB,EAMS,OANT,CAMiB,SANjB,CAAA;AAMvB,iBAUA,cAAA,CAAA,CAV4B,EAUV,OAVsB,CAAA,OAAR,CAAA;AAUhC,iBAMA,gBAAA,CAAA,CANyB,EAML,OANK,CAAA,MAAA,GAAA,IAAA,CAAA;AAMzB,iBAQA,WAAA,CAAA,CARoB,EAQL,OARY,CAAA,MAAA,GAAA,IAAA,CAAA"}
@@ -0,0 +1,69 @@
1
+
2
+ //#region src/att.ts
3
+ function getNativeModule() {
4
+ try {
5
+ const { NativeModules, Platform } = require("react-native");
6
+ if (Platform.OS === "ios" && NativeModules.LayersATT) return NativeModules.LayersATT;
7
+ } catch {}
8
+ return null;
9
+ }
10
+ async function getATTStatus() {
11
+ const mod = getNativeModule();
12
+ if (!mod) return "not_determined";
13
+ return mod.getTrackingAuthorizationStatus();
14
+ }
15
+ async function requestTrackingAuthorization() {
16
+ const mod = getNativeModule();
17
+ if (!mod) return "not_determined";
18
+ const current = await mod.getTrackingAuthorizationStatus();
19
+ if (current !== "not_determined") return current;
20
+ return mod.requestTrackingAuthorization();
21
+ }
22
+ async function isATTAvailable() {
23
+ const mod = getNativeModule();
24
+ if (!mod) return false;
25
+ return mod.isATTAvailable();
26
+ }
27
+ async function getAdvertisingId() {
28
+ const mod = getNativeModule();
29
+ if (!mod) return null;
30
+ if (await mod.getTrackingAuthorizationStatus() !== "authorized") return null;
31
+ return mod.getAdvertisingId();
32
+ }
33
+ async function getVendorId() {
34
+ const mod = getNativeModule();
35
+ if (!mod) return null;
36
+ return mod.getVendorId();
37
+ }
38
+
39
+ //#endregion
40
+ Object.defineProperty(exports, 'getATTStatus', {
41
+ enumerable: true,
42
+ get: function () {
43
+ return getATTStatus;
44
+ }
45
+ });
46
+ Object.defineProperty(exports, 'getAdvertisingId', {
47
+ enumerable: true,
48
+ get: function () {
49
+ return getAdvertisingId;
50
+ }
51
+ });
52
+ Object.defineProperty(exports, 'getVendorId', {
53
+ enumerable: true,
54
+ get: function () {
55
+ return getVendorId;
56
+ }
57
+ });
58
+ Object.defineProperty(exports, 'isATTAvailable', {
59
+ enumerable: true,
60
+ get: function () {
61
+ return isATTAvailable;
62
+ }
63
+ });
64
+ Object.defineProperty(exports, 'requestTrackingAuthorization', {
65
+ enumerable: true,
66
+ get: function () {
67
+ return requestTrackingAuthorization;
68
+ }
69
+ });
package/dist/att.d.mts ADDED
@@ -0,0 +1,2 @@
1
+ import { a as isATTAvailable, i as getVendorId, n as getATTStatus, o as requestTrackingAuthorization, r as getAdvertisingId, t as ATTStatus } from "./att-BDPyE-Gs.mjs";
2
+ export { ATTStatus, getATTStatus, getAdvertisingId, getVendorId, isATTAvailable, requestTrackingAuthorization };
package/dist/att.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- import { a as isATTAvailable, i as getVendorId, n as getATTStatus, o as requestTrackingAuthorization, r as getAdvertisingId, t as ATTStatus } from "./att-BlUZv4_u.js";
1
+ import { a as isATTAvailable, i as getVendorId, n as getATTStatus, o as requestTrackingAuthorization, r as getAdvertisingId, t as ATTStatus } from "./att-BFy6dcWE.js";
2
2
  export { ATTStatus, getATTStatus, getAdvertisingId, getVendorId, isATTAvailable, requestTrackingAuthorization };
package/dist/att.js CHANGED
@@ -1,3 +1,7 @@
1
- import { a as requestTrackingAuthorization, i as isATTAvailable, n as getAdvertisingId, r as getVendorId, t as getATTStatus } from "./att-DaUoQWpj.js";
1
+ const require_att = require('./att-CauvkIKr.js');
2
2
 
3
- export { getATTStatus, getAdvertisingId, getVendorId, isATTAvailable, requestTrackingAuthorization };
3
+ exports.getATTStatus = require_att.getATTStatus;
4
+ exports.getAdvertisingId = require_att.getAdvertisingId;
5
+ exports.getVendorId = require_att.getVendorId;
6
+ exports.isATTAvailable = require_att.isATTAvailable;
7
+ exports.requestTrackingAuthorization = require_att.requestTrackingAuthorization;
package/dist/att.mjs ADDED
@@ -0,0 +1,3 @@
1
+ import { a as requestTrackingAuthorization, i as isATTAvailable, n as getAdvertisingId, r as getVendorId, t as getATTStatus } from "./att-B6KTrEU7.mjs";
2
+
3
+ export { getATTStatus, getAdvertisingId, getVendorId, isATTAvailable, requestTrackingAuthorization };
@@ -0,0 +1,30 @@
1
+ //#region rolldown:runtime
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __copyProps = (to, from, except, desc) => {
9
+ if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
10
+ key = keys[i];
11
+ if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
12
+ get: ((k) => from[k]).bind(null, key),
13
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
14
+ });
15
+ }
16
+ return to;
17
+ };
18
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
19
+ value: mod,
20
+ enumerable: true
21
+ }) : target, mod));
22
+
23
+ //#endregion
24
+
25
+ Object.defineProperty(exports, '__toESM', {
26
+ enumerable: true,
27
+ get: function () {
28
+ return __toESM;
29
+ }
30
+ });