@rocapine/react-native-onboarding 1.60.0 → 1.62.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/OnboardingStudioClient.d.ts +23 -5
- package/dist/OnboardingStudioClient.d.ts.map +1 -1
- package/dist/OnboardingStudioClient.js +82 -6
- package/dist/OnboardingStudioClient.js.map +1 -1
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -1
- package/dist/index.js.map +1 -1
- package/dist/infra/provider/OnboardingProvider.d.ts +37 -1
- package/dist/infra/provider/OnboardingProvider.d.ts.map +1 -1
- package/dist/infra/provider/OnboardingProvider.js +76 -2
- package/dist/infra/provider/OnboardingProvider.js.map +1 -1
- package/dist/infra/queries/cacheKey.d.ts +22 -4
- package/dist/infra/queries/cacheKey.d.ts.map +1 -1
- package/dist/infra/queries/cacheKey.js +26 -5
- package/dist/infra/queries/cacheKey.js.map +1 -1
- package/dist/paywalls/PaywallProvider.d.ts +66 -0
- package/dist/paywalls/PaywallProvider.d.ts.map +1 -0
- package/dist/paywalls/PaywallProvider.js +227 -0
- package/dist/paywalls/PaywallProvider.js.map +1 -0
- package/dist/paywalls/getPaywalls.query.d.ts +37 -0
- package/dist/paywalls/getPaywalls.query.d.ts.map +1 -0
- package/dist/paywalls/getPaywalls.query.js +114 -0
- package/dist/paywalls/getPaywalls.query.js.map +1 -0
- package/dist/paywalls/present.d.ts +100 -0
- package/dist/paywalls/present.d.ts.map +1 -0
- package/dist/paywalls/present.js +113 -0
- package/dist/paywalls/present.js.map +1 -0
- package/dist/paywalls/types.d.ts +95 -0
- package/dist/paywalls/types.d.ts.map +1 -0
- package/dist/paywalls/types.js +10 -0
- package/dist/paywalls/types.js.map +1 -0
- package/dist/paywalls/usePaywall.d.ts +29 -0
- package/dist/paywalls/usePaywall.d.ts.map +1 -0
- package/dist/paywalls/usePaywall.js +17 -0
- package/dist/paywalls/usePaywall.js.map +1 -0
- package/dist/products/ProductRuntimeContext.d.ts +15 -0
- package/dist/products/ProductRuntimeContext.d.ts.map +1 -0
- package/dist/products/ProductRuntimeContext.js +19 -0
- package/dist/products/ProductRuntimeContext.js.map +1 -0
- package/dist/products/adapters/expoIap.d.ts +4 -0
- package/dist/products/adapters/expoIap.d.ts.map +1 -0
- package/dist/products/adapters/expoIap.js +95 -0
- package/dist/products/adapters/expoIap.js.map +1 -0
- package/dist/products/adapters/revenueCat.d.ts +7 -0
- package/dist/products/adapters/revenueCat.d.ts.map +1 -0
- package/dist/products/adapters/revenueCat.js +116 -0
- package/dist/products/adapters/revenueCat.js.map +1 -0
- package/dist/products/adapters/stub.d.ts +8 -0
- package/dist/products/adapters/stub.d.ts.map +1 -0
- package/dist/products/adapters/stub.js +21 -0
- package/dist/products/adapters/stub.js.map +1 -0
- package/dist/products/derive.d.ts +19 -0
- package/dist/products/derive.d.ts.map +1 -0
- package/dist/products/derive.js +79 -0
- package/dist/products/derive.js.map +1 -0
- package/dist/products/duration.d.ts +3 -0
- package/dist/products/duration.d.ts.map +1 -0
- package/dist/products/duration.js +25 -0
- package/dist/products/duration.js.map +1 -0
- package/dist/products/index.d.ts +10 -0
- package/dist/products/index.d.ts.map +1 -0
- package/dist/products/index.js +23 -0
- package/dist/products/index.js.map +1 -0
- package/dist/products/mergeProductRuntimes.d.ts +55 -0
- package/dist/products/mergeProductRuntimes.d.ts.map +1 -0
- package/dist/products/mergeProductRuntimes.js +79 -0
- package/dist/products/mergeProductRuntimes.js.map +1 -0
- package/dist/products/toVariables.d.ts +18 -0
- package/dist/products/toVariables.d.ts.map +1 -0
- package/dist/products/toVariables.js +52 -0
- package/dist/products/toVariables.js.map +1 -0
- package/dist/products/types.d.ts +96 -0
- package/dist/products/types.d.ts.map +1 -0
- package/dist/products/types.js +3 -0
- package/dist/products/types.js.map +1 -0
- package/dist/products/useProducts.d.ts +12 -0
- package/dist/products/useProducts.d.ts.map +1 -0
- package/dist/products/useProducts.js +90 -0
- package/dist/products/useProducts.js.map +1 -0
- package/dist/screens/elements/AnimatedTextElement.d.ts +1 -24
- package/dist/screens/elements/AnimatedTextElement.d.ts.map +1 -1
- package/dist/screens/elements/BaseBoxProps.d.ts +1 -24
- package/dist/screens/elements/BaseBoxProps.d.ts.map +1 -1
- package/dist/screens/elements/ButtonElement.d.ts +6 -121
- package/dist/screens/elements/ButtonElement.d.ts.map +1 -1
- package/dist/screens/elements/CarouselElement.d.ts +1 -24
- package/dist/screens/elements/CarouselElement.d.ts.map +1 -1
- package/dist/screens/elements/CheckboxGroupElement.d.ts +1 -24
- package/dist/screens/elements/CheckboxGroupElement.d.ts.map +1 -1
- package/dist/screens/elements/DatePickerElement.d.ts +1 -24
- package/dist/screens/elements/DatePickerElement.d.ts.map +1 -1
- package/dist/screens/elements/DrawingPadElement.d.ts +1 -24
- package/dist/screens/elements/DrawingPadElement.d.ts.map +1 -1
- package/dist/screens/elements/IconElement.d.ts +1 -24
- package/dist/screens/elements/IconElement.d.ts.map +1 -1
- package/dist/screens/elements/ImageElement.d.ts +1 -24
- package/dist/screens/elements/ImageElement.d.ts.map +1 -1
- package/dist/screens/elements/InputElement.d.ts +1 -24
- package/dist/screens/elements/InputElement.d.ts.map +1 -1
- package/dist/screens/elements/KeyboardAvoidingViewElement.d.ts +1 -24
- package/dist/screens/elements/KeyboardAvoidingViewElement.d.ts.map +1 -1
- package/dist/screens/elements/LottieElement.d.ts +1 -24
- package/dist/screens/elements/LottieElement.d.ts.map +1 -1
- package/dist/screens/elements/ProgressIndicatorElement.d.ts +1 -24
- package/dist/screens/elements/ProgressIndicatorElement.d.ts.map +1 -1
- package/dist/screens/elements/ProgressiveBlurImageElement.d.ts +1 -24
- package/dist/screens/elements/ProgressiveBlurImageElement.d.ts.map +1 -1
- package/dist/screens/elements/RadioGroupElement.d.ts +1 -24
- package/dist/screens/elements/RadioGroupElement.d.ts.map +1 -1
- package/dist/screens/elements/RichTextElement.d.ts +1 -24
- package/dist/screens/elements/RichTextElement.d.ts.map +1 -1
- package/dist/screens/elements/RiveElement.d.ts +1 -24
- package/dist/screens/elements/RiveElement.d.ts.map +1 -1
- package/dist/screens/elements/SafeAreaViewElement.d.ts +1 -24
- package/dist/screens/elements/SafeAreaViewElement.d.ts.map +1 -1
- package/dist/screens/elements/ScrollViewElement.d.ts +1 -24
- package/dist/screens/elements/ScrollViewElement.d.ts.map +1 -1
- package/dist/screens/elements/SliderElement.d.ts +1 -24
- package/dist/screens/elements/SliderElement.d.ts.map +1 -1
- package/dist/screens/elements/StackElement.d.ts +1 -24
- package/dist/screens/elements/StackElement.d.ts.map +1 -1
- package/dist/screens/elements/TextElement.d.ts +1 -24
- package/dist/screens/elements/TextElement.d.ts.map +1 -1
- package/dist/screens/elements/TypewriterTextElement.d.ts +1 -24
- package/dist/screens/elements/TypewriterTextElement.d.ts.map +1 -1
- package/dist/screens/elements/VideoElement.d.ts +1 -24
- package/dist/screens/elements/VideoElement.d.ts.map +1 -1
- package/dist/screens/elements/WheelPickerElement.d.ts +1 -24
- package/dist/screens/elements/WheelPickerElement.d.ts.map +1 -1
- package/dist/screens/elements/ZStackElement.d.ts +1 -24
- package/dist/screens/elements/ZStackElement.d.ts.map +1 -1
- package/dist/steps/Carousel/types.d.ts +1 -1
- package/dist/steps/Commitment/types.d.ts +1 -1
- package/dist/steps/ComposableScreen/types.d.ts +1 -1
- package/dist/steps/Loader/types.d.ts +1 -1
- package/dist/steps/MediaContent/types.d.ts +1 -1
- package/dist/steps/Picker/types.d.ts +1 -1
- package/dist/steps/Question/types.d.ts +1 -1
- package/dist/steps/Ratings/types.d.ts +1 -1
- package/dist/steps/common.types.d.ts +44 -30
- package/dist/steps/common.types.d.ts.map +1 -1
- package/dist/steps/common.types.js +27 -3
- package/dist/steps/common.types.js.map +1 -1
- package/package.json +1 -1
- package/src/OnboardingStudioClient.ts +110 -7
- package/src/__tests__/mergeProductRuntimes.test.ts +172 -0
- package/src/__tests__/productAdapters.test.ts +58 -0
- package/src/__tests__/productDerive.test.ts +111 -0
- package/src/__tests__/productVariables.test.ts +109 -0
- package/src/__tests__/resolveLocalProductArgs.test.ts +41 -0
- package/src/index.ts +14 -0
- package/src/infra/provider/OnboardingProvider.tsx +101 -2
- package/src/infra/queries/cacheKey.ts +27 -4
- package/src/paywalls/PaywallProvider.tsx +342 -0
- package/src/paywalls/__tests__/getPaywalls.test.ts +334 -0
- package/src/paywalls/__tests__/present.test.ts +190 -0
- package/src/paywalls/getPaywalls.query.ts +123 -0
- package/src/paywalls/present.ts +141 -0
- package/src/paywalls/types.ts +99 -0
- package/src/paywalls/usePaywall.ts +35 -0
- package/src/products/ProductRuntimeContext.tsx +17 -0
- package/src/products/adapters/expoIap.ts +93 -0
- package/src/products/adapters/revenueCat.ts +108 -0
- package/src/products/adapters/stub.ts +20 -0
- package/src/products/derive.ts +93 -0
- package/src/products/duration.ts +21 -0
- package/src/products/index.ts +20 -0
- package/src/products/mergeProductRuntimes.ts +78 -0
- package/src/products/toVariables.ts +54 -0
- package/src/products/types.ts +88 -0
- package/src/products/useProducts.ts +106 -0
- package/src/steps/common.types.ts +83 -6
|
@@ -1,21 +1,39 @@
|
|
|
1
1
|
import { OnboardingStepType } from "./steps/types";
|
|
2
2
|
import { Onboarding, GetStepsResponseHeaders, OnboardingOptions, OnboardingStudioClientOptions, UserDefinedParams, BaseStepType } from "./types";
|
|
3
|
+
import { PaywallCatalog, PaywallOptions, GetPaywallsResponseHeaders } from "./paywalls/types";
|
|
3
4
|
export declare class OnboardingStudioClient {
|
|
4
5
|
private baseUrl;
|
|
5
6
|
projectId: string;
|
|
6
7
|
options: OnboardingStudioClientOptions;
|
|
7
8
|
constructor(projectId: string, options: OnboardingStudioClientOptions);
|
|
8
9
|
/**
|
|
9
|
-
* Removes this client's cached onboarding payload
|
|
10
|
-
* derived from `options.cacheKey`, or the
|
|
11
|
-
* or app launch is then a cache miss
|
|
12
|
-
* refetch as well, also
|
|
13
|
-
* `["onboardingQuestions", ...]
|
|
10
|
+
* Removes this client's cached onboarding payload AND cached paywall catalog
|
|
11
|
+
* from AsyncStorage (the keys derived from `options.cacheKey`, or the
|
|
12
|
+
* default keys). The next query mount or app launch is then a cache miss
|
|
13
|
+
* and refetches both. To force an in-session refetch as well, also
|
|
14
|
+
* invalidate the React Query keys `["onboardingQuestions", ...]` and
|
|
15
|
+
* `["paywallCatalog", ...]`.
|
|
14
16
|
*/
|
|
15
17
|
clearCache(): Promise<void>;
|
|
16
18
|
getSteps<StepType extends BaseStepType = OnboardingStepType>(onboardingOptions?: OnboardingOptions, userDefinedParams?: UserDefinedParams): Promise<{
|
|
17
19
|
data: Onboarding<StepType>;
|
|
18
20
|
headers: GetStepsResponseHeaders;
|
|
19
21
|
}>;
|
|
22
|
+
/**
|
|
23
|
+
* Fetches the paywall catalog for this project/audience/locale from
|
|
24
|
+
* `get-paywalls`. By design **omits `placement` by default** — the endpoint
|
|
25
|
+
* deliberately returns every placement in one round-trip so a paywall can
|
|
26
|
+
* be presented the instant the user taps upgrade, without a network call at
|
|
27
|
+
* that moment (spec §6.1). Pass `paywallOptions.placement` only when a
|
|
28
|
+
* single placement is genuinely all that's needed.
|
|
29
|
+
*
|
|
30
|
+
* Unlike `getSteps`, there is no fallback-payload option here: a
|
|
31
|
+
* non-`ok` response or a network failure always rejects rather than
|
|
32
|
+
* resolving to a stand-in catalog.
|
|
33
|
+
*/
|
|
34
|
+
getPaywalls(paywallOptions?: PaywallOptions, userDefinedParams?: UserDefinedParams): Promise<{
|
|
35
|
+
data: PaywallCatalog;
|
|
36
|
+
headers: GetPaywallsResponseHeaders;
|
|
37
|
+
}>;
|
|
20
38
|
}
|
|
21
39
|
//# sourceMappingURL=OnboardingStudioClient.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OnboardingStudioClient.d.ts","sourceRoot":"","sources":["../src/OnboardingStudioClient.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EACL,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,EAAE,0BAA0B,CAAA;KAAE,CAAC;CA2E1E"}
|
|
@@ -17,14 +17,18 @@ class OnboardingStudioClient {
|
|
|
17
17
|
"https://takbcvjljqialzqyksic.supabase.co/functions/v1";
|
|
18
18
|
}
|
|
19
19
|
/**
|
|
20
|
-
* Removes this client's cached onboarding payload
|
|
21
|
-
* derived from `options.cacheKey`, or the
|
|
22
|
-
* or app launch is then a cache miss
|
|
23
|
-
* refetch as well, also
|
|
24
|
-
* `["onboardingQuestions", ...]
|
|
20
|
+
* Removes this client's cached onboarding payload AND cached paywall catalog
|
|
21
|
+
* from AsyncStorage (the keys derived from `options.cacheKey`, or the
|
|
22
|
+
* default keys). The next query mount or app launch is then a cache miss
|
|
23
|
+
* and refetches both. To force an in-session refetch as well, also
|
|
24
|
+
* invalidate the React Query keys `["onboardingQuestions", ...]` and
|
|
25
|
+
* `["paywallCatalog", ...]`.
|
|
25
26
|
*/
|
|
26
27
|
async clearCache() {
|
|
27
|
-
await
|
|
28
|
+
await Promise.all([
|
|
29
|
+
async_storage_1.default.removeItem((0, cacheKey_1.getOnboardingCacheKey)(this.options.cacheKey)),
|
|
30
|
+
async_storage_1.default.removeItem((0, cacheKey_1.getPaywallsCacheKey)(this.options.cacheKey)),
|
|
31
|
+
]);
|
|
28
32
|
}
|
|
29
33
|
async getSteps(onboardingOptions, userDefinedParams) {
|
|
30
34
|
console.info("OnboardingStudioClient getSteps");
|
|
@@ -87,6 +91,78 @@ class OnboardingStudioClient {
|
|
|
87
91
|
throw error;
|
|
88
92
|
}
|
|
89
93
|
}
|
|
94
|
+
/**
|
|
95
|
+
* Fetches the paywall catalog for this project/audience/locale from
|
|
96
|
+
* `get-paywalls`. By design **omits `placement` by default** — the endpoint
|
|
97
|
+
* deliberately returns every placement in one round-trip so a paywall can
|
|
98
|
+
* be presented the instant the user taps upgrade, without a network call at
|
|
99
|
+
* that moment (spec §6.1). Pass `paywallOptions.placement` only when a
|
|
100
|
+
* single placement is genuinely all that's needed.
|
|
101
|
+
*
|
|
102
|
+
* Unlike `getSteps`, there is no fallback-payload option here: a
|
|
103
|
+
* non-`ok` response or a network failure always rejects rather than
|
|
104
|
+
* resolving to a stand-in catalog.
|
|
105
|
+
*/
|
|
106
|
+
async getPaywalls(paywallOptions, userDefinedParams) {
|
|
107
|
+
console.info("OnboardingStudioClient getPaywalls");
|
|
108
|
+
const isSandbox = this.options.isSandbox;
|
|
109
|
+
const urlParams = new URLSearchParams();
|
|
110
|
+
// Add userDefinedParams to URL
|
|
111
|
+
if (userDefinedParams) {
|
|
112
|
+
Object.entries(userDefinedParams).forEach(([key, value]) => {
|
|
113
|
+
urlParams.append(key, value);
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
urlParams.append("projectId", this.projectId);
|
|
117
|
+
urlParams.append("platform", react_native_1.Platform.OS);
|
|
118
|
+
const appVersion = this.options.appVersion; // TODO get the version from the expo app
|
|
119
|
+
if (appVersion) {
|
|
120
|
+
urlParams.append("appVersion", appVersion);
|
|
121
|
+
}
|
|
122
|
+
if (isSandbox) {
|
|
123
|
+
urlParams.append("draft", "true");
|
|
124
|
+
}
|
|
125
|
+
// Add paywallOptions to URL
|
|
126
|
+
if (paywallOptions === null || paywallOptions === void 0 ? void 0 : paywallOptions.locale) {
|
|
127
|
+
urlParams.append("locale", paywallOptions.locale);
|
|
128
|
+
}
|
|
129
|
+
// Narrows the response to a single paywall. Omitted unless explicitly
|
|
130
|
+
// requested — see the method doc above.
|
|
131
|
+
if (paywallOptions === null || paywallOptions === void 0 ? void 0 : paywallOptions.placement) {
|
|
132
|
+
urlParams.append("placement", paywallOptions.placement);
|
|
133
|
+
}
|
|
134
|
+
// Deliberately NOT sending spec §6.1's `omitNulls=true`: it's a
|
|
135
|
+
// convenience for untyped consumers that strips null-valued keys from the
|
|
136
|
+
// response, which would make the runtime shape diverge from `PaywallCatalog`
|
|
137
|
+
// and `Paywall`'s declared `| null` fields. This client parses into those
|
|
138
|
+
// typed objects, so the fields must always be present (possibly `null`),
|
|
139
|
+
// not sometimes missing.
|
|
140
|
+
const url = `${this.baseUrl}/get-paywalls?${urlParams.toString()}`;
|
|
141
|
+
console.info("OnboardingStudioClient getPaywalls url", url);
|
|
142
|
+
try {
|
|
143
|
+
const response = await Promise.race(this.options.timeout
|
|
144
|
+
? [
|
|
145
|
+
fetch(url),
|
|
146
|
+
new Promise((_, reject) => setTimeout(() => reject(new Error("timeout")), this.options.timeout)),
|
|
147
|
+
]
|
|
148
|
+
: [fetch(url)]);
|
|
149
|
+
if (!response.ok) {
|
|
150
|
+
throw new Error(`Failed to fetch paywalls: ${response.status} ${response.statusText}`);
|
|
151
|
+
}
|
|
152
|
+
const data = await response.json();
|
|
153
|
+
return {
|
|
154
|
+
data,
|
|
155
|
+
headers: {
|
|
156
|
+
"ONBS-Audience-Id": response.headers.get("ONBS-Audience-Id"),
|
|
157
|
+
"ONBS-Paywall-Ids": response.headers.get("ONBS-Paywall-Ids"),
|
|
158
|
+
},
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
catch (error) {
|
|
162
|
+
console.error("OnboardingStudioClient getPaywalls error", error);
|
|
163
|
+
throw error;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
90
166
|
}
|
|
91
167
|
exports.OnboardingStudioClient = OnboardingStudioClient;
|
|
92
168
|
//# sourceMappingURL=OnboardingStudioClient.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OnboardingStudioClient.js","sourceRoot":"","sources":["../src/OnboardingStudioClient.ts"],"names":[],"mappings":";;;;;;AAAA,8FAAqE;AAUrE,
|
|
1
|
+
{"version":3,"file":"OnboardingStudioClient.js","sourceRoot":"","sources":["../src/OnboardingStudioClient.ts"],"names":[],"mappings":";;;;;;AAAA,8FAAqE;AAUrE,uDAGkC;AAOlC,+CAAwC;AAExC,MAAa,sBAAsB;IAKjC,YAAY,SAAiB,EAAE,OAAsC;QACnE,OAAO,CAAC,IAAI,CAAC,yCAAyC,EAAE,SAAS,CAAC,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F;gBACH,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CACjB,CAAC;YACF,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;gBACjB,MAAM,IAAI,KAAK,CACb,6BAA6B,QAAQ,CAAC,MAAM,IAAI,QAAQ,CAAC,UAAU,EAAE,CACtE,CAAC;YACJ,CAAC;YACD,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;YACnC,OAAO;gBACL,IAAI;gBACJ,OAAO,EAAE;oBACP,kBAAkB,EAAE,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,kBAAkB,CAAC;oBAC5D,kBAAkB,EAAE,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,kBAAkB,CAAC;iBAC7D;aACF,CAAC;QACJ,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,CAAC,KAAK,CAAC,0CAA0C,EAAE,KAAK,CAAC,CAAC;YACjE,MAAM,KAAK,CAAC;QACd,CAAC;IACH,CAAC;CACF;AAtMD,wDAsMC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -13,4 +13,10 @@ export { evaluateCondition, evaluateLeaf, isConditionGroup } from "./evaluateCon
|
|
|
13
13
|
export type { Condition } from "./evaluateCondition";
|
|
14
14
|
export type { LeafCondition, ConditionGroup, ConditionValue, ConditionOperator, Branch, NextStep, } from "./steps/common.types";
|
|
15
15
|
export { BaseStepTypeSchema, LeafConditionSchema, ConditionGroupSchema, BranchSchema, NextStepSchema, ConditionOperatorSchema, ConditionValueSchema, UNARY_CONDITION_OPERATORS, isUnaryConditionOperator, ONBOARDING_END_STEP_ID, } from "./steps/common.types";
|
|
16
|
+
export * from "./products";
|
|
17
|
+
export type { Paywall, PaywallCatalog, PaywallOptions, GetPaywallsResponseHeaders, PresentResult, } from "./paywalls/types";
|
|
18
|
+
export { PaywallProvider, usePaywallHost } from "./paywalls/PaywallProvider";
|
|
19
|
+
export type { PaywallContextValue } from "./paywalls/PaywallProvider";
|
|
20
|
+
export { usePaywall } from "./paywalls/usePaywall";
|
|
21
|
+
export type { UsePaywallResult } from "./paywalls/usePaywall";
|
|
16
22
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,cAAc,SAAS,CAAC;AACxB,cAAc,sBAAsB,CAAC;AAErC,OAAO,EACL,qBAAqB,EACrB,4BAA4B,GAC7B,MAAM,0BAA0B,CAAC;AAElC,YAAY,EACV,YAAY,EACZ,kBAAkB,EAClB,uBAAuB,EACvB,uBAAuB,EACvB,sBAAsB,EACtB,uBAAuB,EACvB,eAAe,EACf,gBAAgB,EAChB,oBAAoB,EACpB,gCAAgC,EAChC,QAAQ,EACR,cAAc,EACd,cAAc,EACd,YAAY,EACZ,UAAU,EACV,6BAA6B,EAC7B,cAAc,EACd,eAAe,EACf,YAAY,EACZ,cAAc,EACd,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,iBAAiB,EACjB,gBAAgB,EAChB,eAAe,EACf,aAAa,EACb,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EACL,kBAAkB,EAClB,wBAAwB,EACxB,6BAA6B,EAC7B,6BAA6B,EAC7B,6BAA6B,EAC7B,uBAAuB,GACxB,MAAM,gCAAgC,CAAC;AAExC,cAAc,SAAS,CAAC;AAExB,YAAY,EAAE,2BAA2B,EAAE,MAAM,0BAA0B,CAAC;AAC5E,OAAO,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AAEzE,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACxF,YAAY,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACrD,YAAY,EACV,aAAa,EACb,cAAc,EACd,cAAc,EACd,iBAAiB,EACjB,MAAM,EACN,QAAQ,GACT,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,kBAAkB,EAClB,mBAAmB,EACnB,oBAAoB,EACpB,YAAY,EACZ,cAAc,EACd,uBAAuB,EACvB,oBAAoB,EACpB,yBAAyB,EACzB,wBAAwB,EACxB,sBAAsB,GACvB,MAAM,sBAAsB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,cAAc,SAAS,CAAC;AACxB,cAAc,sBAAsB,CAAC;AAErC,OAAO,EACL,qBAAqB,EACrB,4BAA4B,GAC7B,MAAM,0BAA0B,CAAC;AAElC,YAAY,EACV,YAAY,EACZ,kBAAkB,EAClB,uBAAuB,EACvB,uBAAuB,EACvB,sBAAsB,EACtB,uBAAuB,EACvB,eAAe,EACf,gBAAgB,EAChB,oBAAoB,EACpB,gCAAgC,EAChC,QAAQ,EACR,cAAc,EACd,cAAc,EACd,YAAY,EACZ,UAAU,EACV,6BAA6B,EAC7B,cAAc,EACd,eAAe,EACf,YAAY,EACZ,cAAc,EACd,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,iBAAiB,EACjB,gBAAgB,EAChB,eAAe,EACf,aAAa,EACb,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EACL,kBAAkB,EAClB,wBAAwB,EACxB,6BAA6B,EAC7B,6BAA6B,EAC7B,6BAA6B,EAC7B,uBAAuB,GACxB,MAAM,gCAAgC,CAAC;AAExC,cAAc,SAAS,CAAC;AAExB,YAAY,EAAE,2BAA2B,EAAE,MAAM,0BAA0B,CAAC;AAC5E,OAAO,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AAEzE,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACxF,YAAY,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACrD,YAAY,EACV,aAAa,EACb,cAAc,EACd,cAAc,EACd,iBAAiB,EACjB,MAAM,EACN,QAAQ,GACT,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,kBAAkB,EAClB,mBAAmB,EACnB,oBAAoB,EACpB,YAAY,EACZ,cAAc,EACd,uBAAuB,EACvB,oBAAoB,EACpB,yBAAyB,EACzB,wBAAwB,EACxB,sBAAsB,GACvB,MAAM,sBAAsB,CAAC;AAE9B,cAAc,YAAY,CAAC;AAE3B,YAAY,EACV,OAAO,EACP,cAAc,EACd,cAAc,EACd,0BAA0B,EAC1B,aAAa,GACd,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC7E,YAAY,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,YAAY,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.ONBOARDING_END_STEP_ID = exports.isUnaryConditionOperator = exports.UNARY_CONDITION_OPERATORS = exports.ConditionValueSchema = exports.ConditionOperatorSchema = exports.NextStepSchema = exports.BranchSchema = exports.ConditionGroupSchema = exports.LeafConditionSchema = exports.BaseStepTypeSchema = exports.isConditionGroup = exports.evaluateLeaf = exports.evaluateCondition = exports.resolveStartStepNumber = exports.resolveNextStepNumber = exports.expoRouterAdapter = exports.resolveWheelPickerItems = exports.generateWheelPickerRangeItems = exports.WheelPickerElementPropsSchema = exports.SetVariableButtonActionSchema = exports.CustomButtonActionSchema = exports.ButtonActionSchema = exports.DEFAULT_ONBOARDING_CACHE_KEY = exports.getOnboardingCacheKey = exports.OnboardingStudioClient = void 0;
|
|
17
|
+
exports.usePaywall = exports.usePaywallHost = exports.PaywallProvider = exports.ONBOARDING_END_STEP_ID = exports.isUnaryConditionOperator = exports.UNARY_CONDITION_OPERATORS = exports.ConditionValueSchema = exports.ConditionOperatorSchema = exports.NextStepSchema = exports.BranchSchema = exports.ConditionGroupSchema = exports.LeafConditionSchema = exports.BaseStepTypeSchema = exports.isConditionGroup = exports.evaluateLeaf = exports.evaluateCondition = exports.resolveStartStepNumber = exports.resolveNextStepNumber = exports.expoRouterAdapter = exports.resolveWheelPickerItems = exports.generateWheelPickerRangeItems = exports.WheelPickerElementPropsSchema = exports.SetVariableButtonActionSchema = exports.CustomButtonActionSchema = exports.ButtonActionSchema = exports.DEFAULT_ONBOARDING_CACHE_KEY = exports.getOnboardingCacheKey = exports.OnboardingStudioClient = void 0;
|
|
18
18
|
// Core client and types
|
|
19
19
|
var OnboardingStudioClient_1 = require("./OnboardingStudioClient");
|
|
20
20
|
Object.defineProperty(exports, "OnboardingStudioClient", { enumerable: true, get: function () { return OnboardingStudioClient_1.OnboardingStudioClient; } });
|
|
@@ -55,4 +55,11 @@ Object.defineProperty(exports, "ConditionValueSchema", { enumerable: true, get:
|
|
|
55
55
|
Object.defineProperty(exports, "UNARY_CONDITION_OPERATORS", { enumerable: true, get: function () { return common_types_1.UNARY_CONDITION_OPERATORS; } });
|
|
56
56
|
Object.defineProperty(exports, "isUnaryConditionOperator", { enumerable: true, get: function () { return common_types_1.isUnaryConditionOperator; } });
|
|
57
57
|
Object.defineProperty(exports, "ONBOARDING_END_STEP_ID", { enumerable: true, get: function () { return common_types_1.ONBOARDING_END_STEP_ID; } });
|
|
58
|
+
// Product runtime (paywall phase 3) — vendor-neutral store products
|
|
59
|
+
__exportStar(require("./products"), exports);
|
|
60
|
+
var PaywallProvider_1 = require("./paywalls/PaywallProvider");
|
|
61
|
+
Object.defineProperty(exports, "PaywallProvider", { enumerable: true, get: function () { return PaywallProvider_1.PaywallProvider; } });
|
|
62
|
+
Object.defineProperty(exports, "usePaywallHost", { enumerable: true, get: function () { return PaywallProvider_1.usePaywallHost; } });
|
|
63
|
+
var usePaywall_1 = require("./paywalls/usePaywall");
|
|
64
|
+
Object.defineProperty(exports, "usePaywall", { enumerable: true, get: function () { return usePaywall_1.usePaywall; } });
|
|
58
65
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,wBAAwB;AACxB,mEAAkE;AAAzD,gIAAA,sBAAsB,OAAA;AAC/B,0CAAwB;AACxB,uDAAqC;AACrC,8EAA8E;AAC9E,qDAGkC;AAFhC,iHAAA,qBAAqB,OAAA;AACrB,wHAAA,4BAA4B,OAAA;AAkC9B,wDAOwC;AANtC,2GAAA,kBAAkB,OAAA;AAClB,iHAAA,wBAAwB,OAAA;AACxB,sHAAA,6BAA6B,OAAA;AAC7B,sHAAA,6BAA6B,OAAA;AAC7B,sHAAA,6BAA6B,OAAA;AAC7B,gHAAA,uBAAuB,OAAA;AAEzB,sBAAsB;AACtB,0CAAwB;AAGxB,0EAAyE;AAAhE,sHAAA,iBAAiB,OAAA;AAC1B,YAAY;AACZ,iEAAgE;AAAvD,8HAAA,qBAAqB,OAAA;AAC9B,mEAAkE;AAAzD,gIAAA,sBA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,YAAY,OAAA;AACZ,8GAAA,cAAc,OAAA;AACd,uHAAA,uBAAuB,OAAA;AACvB,oHAAA,oBAAoB,OAAA;AACpB,yHAAA,yBAAyB,OAAA;AACzB,wHAAA,wBAAwB,OAAA;AACxB,sHAAA,sBAAsB,OAAA;AAExB,oEAAoE;AACpE,6CAA2B;AAS3B,8DAA6E;AAApE,kHAAA,eAAe,OAAA;AAAE,iHAAA,cAAc,OAAA;AAExC,oDAAmD;AAA1C,wGAAA,UAAU,OAAA"}
|
|
@@ -3,6 +3,32 @@ import { Onboarding, OnboardingMetadata } from "../../types";
|
|
|
3
3
|
import { OnboardingStepType } from "../../steps/types";
|
|
4
4
|
import { ComposableVariableEntry } from "../../steps/ComposableScreen/types";
|
|
5
5
|
import { OnboardingNavigationAdapter } from "../navigation/types";
|
|
6
|
+
import { ProductProvider, ProductRef, ProductRuntime } from "../../products/types";
|
|
7
|
+
/**
|
|
8
|
+
* Args for the local `useProducts` call.
|
|
9
|
+
*
|
|
10
|
+
* This function used to zero refs/provider out entirely whenever a
|
|
11
|
+
* `PaywallProvider` (or other ancestor) already published a `ProductRuntime`
|
|
12
|
+
* via `ProductRuntimeContext` — on the assumption that the paywall catalog's
|
|
13
|
+
* product union is always a superset of whatever `productRefs` this
|
|
14
|
+
* `OnboardingProvider` declares. Finding 5 (2026-08-17 final review) found
|
|
15
|
+
* that assumption wrong: it is a claim about a host-supplied prop, not a
|
|
16
|
+
* property of the code, and it silently stopped resolving any `productRefs`
|
|
17
|
+
* key absent from the catalog union the moment a host added a
|
|
18
|
+
* `PaywallProvider` above an existing `OnboardingProvider` — no error,
|
|
19
|
+
* nothing that type-checks, just a variable that renders empty.
|
|
20
|
+
*
|
|
21
|
+
* `productRefs`/`productProvider` are therefore passed through UNCHANGED
|
|
22
|
+
* regardless of whether a context runtime exists — `mergeProductRuntimes`
|
|
23
|
+
* (in `OnboardingProvider` below) unions the resulting local runtime back
|
|
24
|
+
* into the context one. Exported so the pass-through itself is covered by an
|
|
25
|
+
* importable, real test, not only inspection: this is the exact seam Finding
|
|
26
|
+
* 5's silent regression went through.
|
|
27
|
+
*/
|
|
28
|
+
export declare const resolveLocalProductArgs: (productRefs: ProductRef[] | undefined, productProvider: ProductProvider | undefined) => {
|
|
29
|
+
refs: ProductRef[] | undefined;
|
|
30
|
+
provider: ProductProvider | undefined;
|
|
31
|
+
};
|
|
6
32
|
export type CustomActionHandler = (args: {
|
|
7
33
|
variables: Record<string, ComposableVariableEntry | undefined>;
|
|
8
34
|
/**
|
|
@@ -59,8 +85,17 @@ interface OnboardingProviderProps {
|
|
|
59
85
|
* logic (mark onboarding done, navigate to paywall/home, etc.). Optional.
|
|
60
86
|
*/
|
|
61
87
|
onComplete?: OnboardingCompleteHandler;
|
|
88
|
+
/**
|
|
89
|
+
* Billing adapter. Omit for an app with no paywall. Must be a stable reference.
|
|
90
|
+
*/
|
|
91
|
+
productProvider?: ProductProvider;
|
|
92
|
+
/**
|
|
93
|
+
* Product slots to resolve at mount, e.g.
|
|
94
|
+
* `[{ key: "yearly", ios: "com.app.yr", android: "com.app.yr:p1y", compareTo: "monthly" }]`.
|
|
95
|
+
*/
|
|
96
|
+
productRefs?: ProductRef[];
|
|
62
97
|
}
|
|
63
|
-
export declare const OnboardingProvider: ({ children, client, locale, customAudienceParams, customActions, fontsFallback, navigation, onComplete, }: OnboardingProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
98
|
+
export declare const OnboardingProvider: ({ children, client, locale, customAudienceParams, customActions, fontsFallback, navigation, onComplete, productProvider, productRefs, }: OnboardingProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
64
99
|
export declare const OnboardingProgressContext: import("react").Context<{
|
|
65
100
|
activeStep: {
|
|
66
101
|
number: number;
|
|
@@ -85,6 +120,7 @@ export declare const OnboardingProgressContext: import("react").Context<{
|
|
|
85
120
|
completeOnboarding: () => void;
|
|
86
121
|
customActions: CustomActions;
|
|
87
122
|
navigation: OnboardingNavigationAdapter;
|
|
123
|
+
products: ProductRuntime;
|
|
88
124
|
}>;
|
|
89
125
|
export {};
|
|
90
126
|
//# sourceMappingURL=OnboardingProvider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OnboardingProvider.d.ts","sourceRoot":"","sources":["../../../src/infra/provider/OnboardingProvider.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AAEtE,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAC7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAC;AAI7E,OAAO,EAAE,2BAA2B,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"OnboardingProvider.d.ts","sourceRoot":"","sources":["../../../src/infra/provider/OnboardingProvider.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AAEtE,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAC7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAC;AAI7E,OAAO,EAAE,2BAA2B,EAAE,MAAM,qBAAqB,CAAC;AAGlE,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAuBnF;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,uBAAuB,GAClC,aAAa,UAAU,EAAE,GAAG,SAAS,EACrC,iBAAiB,eAAe,GAAG,SAAS,KAC3C;IAAE,IAAI,EAAE,UAAU,EAAE,GAAG,SAAS,CAAC;IAAC,QAAQ,EAAE,eAAe,GAAG,SAAS,CAAA;CAGxE,CAAC;AAQH,MAAM,MAAM,mBAAmB,GAAG,CAAC,IAAI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ACxB;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,qBAAqB,EAAE,OAAO,CAAA;KAAE;mBAC/C,CAAC,IAAI,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,qBAAqB,EAAE,OAAO,CAAA;KAAE,KAAK,IAAI;gBACrE,MAAM;mBACH,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI;kBACxB,MAAM;qBACH,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI;YACjC,sBAAsB;YACtB,MAAM;0BACQ,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;gBAC7B,UAAU,CAAC,kBAAkB,CAAC,GAAG,IAAI;mBAClC,CAAC,UAAU,EAAE,UAAU,CAAC,kBAAkB,CAAC,KAAK,IAAI;eACxD,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;iBACjB,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,KAAK,IAAI;kBACjC,MAAM,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;wBACnB,MAAM,IAAI;mBACf,aAAa;gBAChB,2BAA2B;cAC7B,cAAc;EAoBxB,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.OnboardingProgressContext = exports.OnboardingProvider = void 0;
|
|
3
|
+
exports.OnboardingProgressContext = exports.OnboardingProvider = exports.resolveLocalProductArgs = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const react_query_1 = require("@tanstack/react-query");
|
|
@@ -10,6 +10,9 @@ const FontLoader_1 = require("./FontLoader");
|
|
|
10
10
|
const extractAssetUrls_1 = require("../preload/extractAssetUrls");
|
|
11
11
|
const preloadAssets_1 = require("../preload/preloadAssets");
|
|
12
12
|
const expoRouterAdapter_1 = require("../navigation/expoRouterAdapter");
|
|
13
|
+
const useProducts_1 = require("../../products/useProducts");
|
|
14
|
+
const ProductRuntimeContext_1 = require("../../products/ProductRuntimeContext");
|
|
15
|
+
const mergeProductRuntimes_1 = require("../../products/mergeProductRuntimes");
|
|
13
16
|
const queryClient = new react_query_1.QueryClient({
|
|
14
17
|
defaultOptions: {
|
|
15
18
|
queries: {
|
|
@@ -17,6 +20,47 @@ const queryClient = new react_query_1.QueryClient({
|
|
|
17
20
|
},
|
|
18
21
|
},
|
|
19
22
|
});
|
|
23
|
+
// Module-scope so the context default is referentially stable — an inline
|
|
24
|
+
// object literal here would allocate a fresh value on every read of the
|
|
25
|
+
// default, defeating the same stability contract useProducts upholds.
|
|
26
|
+
const EMPTY_PRODUCT_RUNTIME = {
|
|
27
|
+
products: {},
|
|
28
|
+
status: "idle",
|
|
29
|
+
purchasing: false,
|
|
30
|
+
purchase: async () => ({ status: "error", error: new Error("No ProductProvider") }),
|
|
31
|
+
restore: async () => ({ status: "error", error: new Error("No ProductProvider") }),
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* Args for the local `useProducts` call.
|
|
35
|
+
*
|
|
36
|
+
* This function used to zero refs/provider out entirely whenever a
|
|
37
|
+
* `PaywallProvider` (or other ancestor) already published a `ProductRuntime`
|
|
38
|
+
* via `ProductRuntimeContext` — on the assumption that the paywall catalog's
|
|
39
|
+
* product union is always a superset of whatever `productRefs` this
|
|
40
|
+
* `OnboardingProvider` declares. Finding 5 (2026-08-17 final review) found
|
|
41
|
+
* that assumption wrong: it is a claim about a host-supplied prop, not a
|
|
42
|
+
* property of the code, and it silently stopped resolving any `productRefs`
|
|
43
|
+
* key absent from the catalog union the moment a host added a
|
|
44
|
+
* `PaywallProvider` above an existing `OnboardingProvider` — no error,
|
|
45
|
+
* nothing that type-checks, just a variable that renders empty.
|
|
46
|
+
*
|
|
47
|
+
* `productRefs`/`productProvider` are therefore passed through UNCHANGED
|
|
48
|
+
* regardless of whether a context runtime exists — `mergeProductRuntimes`
|
|
49
|
+
* (in `OnboardingProvider` below) unions the resulting local runtime back
|
|
50
|
+
* into the context one. Exported so the pass-through itself is covered by an
|
|
51
|
+
* importable, real test, not only inspection: this is the exact seam Finding
|
|
52
|
+
* 5's silent regression went through.
|
|
53
|
+
*/
|
|
54
|
+
const resolveLocalProductArgs = (productRefs, productProvider) => ({
|
|
55
|
+
refs: productRefs,
|
|
56
|
+
provider: productProvider,
|
|
57
|
+
});
|
|
58
|
+
exports.resolveLocalProductArgs = resolveLocalProductArgs;
|
|
59
|
+
// Frozen at module scope, not `= {}` inline: a default PARAMETER re-allocates on
|
|
60
|
+
// every render, and `customActions` is a RenderContext dependency, so a host that
|
|
61
|
+
// omits the prop would get a fresh `ctx` on every variable write and re-render the
|
|
62
|
+
// whole tree. Same reason EMPTY_PRODUCT_RUNTIME above is hoisted.
|
|
63
|
+
const EMPTY_CUSTOM_ACTIONS = Object.freeze({});
|
|
20
64
|
const OnboardingDataGate = ({ client, locale, customAudienceParams, setOnboarding, fontsFallback, children, }) => {
|
|
21
65
|
const { data, error } = (0, react_query_1.useQuery)((0, getOnboarding_query_1.getOnboardingQuery)(client, locale, customAudienceParams, setOnboarding));
|
|
22
66
|
// Background asset preload: once the payload is available, warm every remote
|
|
@@ -37,7 +81,8 @@ const OnboardingDataGate = ({ client, locale, customAudienceParams, setOnboardin
|
|
|
37
81
|
return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: fontsFallback !== null && fontsFallback !== void 0 ? fontsFallback : null });
|
|
38
82
|
return ((0, jsx_runtime_1.jsx)(FontLoader_1.FontLoaderGate, { fonts: data.fonts, fallback: fontsFallback, children: children }));
|
|
39
83
|
};
|
|
40
|
-
const OnboardingProvider = ({ children, client, locale = "en", customAudienceParams = {}, customActions =
|
|
84
|
+
const OnboardingProvider = ({ children, client, locale = "en", customAudienceParams = {}, customActions = EMPTY_CUSTOM_ACTIONS, fontsFallback, navigation = expoRouterAdapter_1.expoRouterAdapter, onComplete, productProvider, productRefs, }) => {
|
|
85
|
+
var _a;
|
|
41
86
|
const [activeStep, setActiveStep] = (0, react_1.useState)({
|
|
42
87
|
number: 0,
|
|
43
88
|
displayProgressHeader: false,
|
|
@@ -75,6 +120,33 @@ const OnboardingProvider = ({ children, client, locale = "en", customAudiencePar
|
|
|
75
120
|
metadata: onboarding === null || onboarding === void 0 ? void 0 : onboarding.metadata,
|
|
76
121
|
});
|
|
77
122
|
}, [onComplete, onboarding]);
|
|
123
|
+
// A ProductRuntime may already be published above by a `PaywallProvider`
|
|
124
|
+
// (Phase 5 Task 6) sharing one product catalog with this provider. Hooks
|
|
125
|
+
// can't be called conditionally, so `useProducts` is always called, with
|
|
126
|
+
// this provider's OWN `productRefs`/`productProvider` regardless of whether
|
|
127
|
+
// a context runtime exists (`resolveLocalProductArgs`) — when a context
|
|
128
|
+
// runtime is present, `mergeProductRuntimes` unions the two into the one
|
|
129
|
+
// `ProductRuntime` published below (Finding 5, 2026-08-17 final review: the
|
|
130
|
+
// two runtimes used to never merge, so a context runtime silently made
|
|
131
|
+
// `productRefs` unresolvable). Do not "simplify" this into a conditional
|
|
132
|
+
// hook call.
|
|
133
|
+
const contextRuntime = (0, ProductRuntimeContext_1.useProductRuntime)();
|
|
134
|
+
const { refs: localProductRefs, provider: localProductProvider } = (0, exports.resolveLocalProductArgs)(productRefs, productProvider);
|
|
135
|
+
const localProductRuntime = (0, useProducts_1.useProducts)(localProductRefs, localProductProvider, locale);
|
|
136
|
+
const hasLocalRefs = ((_a = productRefs === null || productRefs === void 0 ? void 0 : productRefs.length) !== null && _a !== void 0 ? _a : 0) > 0;
|
|
137
|
+
const hasLocalProvider = !!localProductProvider;
|
|
138
|
+
// Memoized — round 2 of the final review (N1) caught that calling
|
|
139
|
+
// `mergeProductRuntimes` inline in the render body allocates a fresh object
|
|
140
|
+
// (and a fresh `purchase` closure) on EVERY render whenever `hasLocalRefs`,
|
|
141
|
+
// breaking `ScreenHost.products`'s "referentially stable across variable
|
|
142
|
+
// writes" contract (`ScreenHost.ts`) the moment a host uses `productRefs`
|
|
143
|
+
// alongside a `PaywallProvider` ancestor — every memoized element would
|
|
144
|
+
// re-render on every keystroke, since `setVariables` always allocates a new
|
|
145
|
+
// object. Keyed on the two runtimes plus the two booleans that change the
|
|
146
|
+
// merge's shape, exactly the inputs the function reads.
|
|
147
|
+
const productRuntime = (0, react_1.useMemo)(() => contextRuntime
|
|
148
|
+
? (0, mergeProductRuntimes_1.mergeProductRuntimes)(contextRuntime, localProductRuntime, hasLocalRefs, hasLocalProvider)
|
|
149
|
+
: localProductRuntime, [contextRuntime, localProductRuntime, hasLocalRefs, hasLocalProvider]);
|
|
78
150
|
return ((0, jsx_runtime_1.jsx)(react_query_1.QueryClientProvider, { client: queryClient, children: (0, jsx_runtime_1.jsx)(exports.OnboardingProgressContext.Provider, { value: {
|
|
79
151
|
activeStep,
|
|
80
152
|
setActiveStep,
|
|
@@ -93,6 +165,7 @@ const OnboardingProvider = ({ children, client, locale = "en", customAudiencePar
|
|
|
93
165
|
completeOnboarding,
|
|
94
166
|
customActions,
|
|
95
167
|
navigation,
|
|
168
|
+
products: productRuntime,
|
|
96
169
|
}, children: (0, jsx_runtime_1.jsx)(OnboardingDataGate, { client: client, locale: locale, customAudienceParams: customAudienceParams, setOnboarding: setOnboarding, fontsFallback: fontsFallback, children: children }) }) }));
|
|
97
170
|
};
|
|
98
171
|
exports.OnboardingProvider = OnboardingProvider;
|
|
@@ -114,5 +187,6 @@ exports.OnboardingProgressContext = (0, react_1.createContext)({
|
|
|
114
187
|
completeOnboarding: () => { },
|
|
115
188
|
customActions: {},
|
|
116
189
|
navigation: expoRouterAdapter_1.expoRouterAdapter,
|
|
190
|
+
products: EMPTY_PRODUCT_RUNTIME,
|
|
117
191
|
});
|
|
118
192
|
//# sourceMappingURL=OnboardingProvider.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OnboardingProvider.js","sourceRoot":"","sources":["../../../src/infra/provider/OnboardingProvider.tsx"],"names":[],"mappings":";;;;AAAA,
|
|
1
|
+
{"version":3,"file":"OnboardingProvider.js","sourceRoot":"","sources":["../../../src/infra/provider/OnboardingProvider.tsx"],"names":[],"mappings":";;;;AAAA,iCAAyF;AACzF,uDAAmF;AACnF,yEAAsE;AACtE,wEAAoE;AAIpE,6CAA8C;AAC9C,kEAA+D;AAC/D,4DAAyD;AAEzD,uEAAoE;AACpE,4DAAyD;AAEzD,gFAAyE;AACzE,8EAA2E;AAE3E,MAAM,WAAW,GAAG,IAAI,yBAAW,CAAC;IAClC,cAAc,EAAE;QACd,OAAO,EAAE;YACP,SAAS,EAAE,QAAQ;SACpB;KACF;CACF,CAAC,CAAA;AAEF,0EAA0E;AAC1E,wEAAwE;AACxE,sEAAsE;AACtE,MAAM,qBAAqB,GAAmB;IAC5C,QAAQ,EAAE,EAAE;IACZ,MAAM,EAAE,MAAM;IACd,UAAU,EAAE,KAAK;IACjB,QAAQ,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,KAAK,CAAC,oBAAoB,CAAC,EAAE,CAAC;IACnF,OAAO,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,KAAK,CAAC,oBAAoB,CAAC,EAAE,CAAC;CACnF,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;GAoBG;AACI,MAAM,uBAAuB,GAAG,CACrC,WAAqC,EACrC,eAA4C,EAC+B,EAAE,CAAC,CAAC;IAC/E,IAAI,EAAE,WAAW;IACjB,QAAQ,EAAE,eAAe;CAC1B,CAAC,CAAC;AANU,QAAA,uBAAuB,2BAMjC;AAEH,iFAAiF;AACjF,kFAAkF;AAClF,mFAAmF;AACnF,kEAAkE;AAClE,MAAM,oBAAoB,GAAkB,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;AAoF9D,MAAM,kBAAkB,GAAG,CAAC,EAC1B,MAAM,EACN,MAAM,EACN,oBAAoB,EAC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E,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC;IACxB,kBAAkB,EAAE,GAAG,EAAE,GAAG,CAAC;IAC7B,aAAa,EAAE,EAAE;IACjB,UAAU,EAAE,qCAAiB;IAC7B,QAAQ,EAAE,qBAAqB;CAChC,CAAC,CAAC"}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* AsyncStorage key derivation for the cached onboarding
|
|
2
|
+
* AsyncStorage key derivation for the SDK's cached payloads (onboarding
|
|
3
|
+
* steps, paywall catalog).
|
|
3
4
|
*
|
|
4
|
-
* Lives in its own module so
|
|
5
|
-
* `OnboardingStudioClient` can use
|
|
6
|
-
* (the query
|
|
5
|
+
* Lives in its own module so `getOnboarding.query.ts`, `getPaywalls.query.ts`
|
|
6
|
+
* and `OnboardingStudioClient` can all use these as values without a circular
|
|
7
|
+
* import (the query modules import `OnboardingStudioClient` for typing) —
|
|
8
|
+
* this module itself has no imports.
|
|
7
9
|
*/
|
|
8
10
|
/** Default cache key used when the host does not provide a custom one. */
|
|
9
11
|
export declare const DEFAULT_ONBOARDING_CACHE_KEY = "rocapine-onboarding-studio";
|
|
@@ -17,4 +19,20 @@ export declare const DEFAULT_ONBOARDING_CACHE_KEY = "rocapine-onboarding-studio"
|
|
|
17
19
|
* when to refetch (see `OnboardingStudioClient.clearCache`).
|
|
18
20
|
*/
|
|
19
21
|
export declare const getOnboardingCacheKey: (customKey?: string) => string;
|
|
22
|
+
/** Default cache key used when the host does not provide a custom one. */
|
|
23
|
+
export declare const DEFAULT_PAYWALLS_CACHE_KEY = "rocapine-paywalls-studio";
|
|
24
|
+
/**
|
|
25
|
+
* Derives the AsyncStorage key for the cached paywall catalog.
|
|
26
|
+
*
|
|
27
|
+
* Namespaced separately from `getOnboardingCacheKey`
|
|
28
|
+
* (`rocapine-paywalls-*` vs `rocapine-onboarding-*`) so the two caches never
|
|
29
|
+
* collide, even though both derive from the same `client.options.cacheKey`.
|
|
30
|
+
*
|
|
31
|
+
* - No custom key → the shared default `"rocapine-paywalls-studio"`
|
|
32
|
+
* (stale-while-revalidate: served cache-first and healed in the background).
|
|
33
|
+
* - Custom key → `"rocapine-paywalls-sdk-{customKey}"`, which the SDK persists
|
|
34
|
+
* cache-first with **no** background revalidation, so the host owns when to
|
|
35
|
+
* refetch (see `OnboardingStudioClient.clearCache`).
|
|
36
|
+
*/
|
|
37
|
+
export declare const getPaywallsCacheKey: (customKey?: string) => string;
|
|
20
38
|
//# sourceMappingURL=cacheKey.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cacheKey.d.ts","sourceRoot":"","sources":["../../../src/infra/queries/cacheKey.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"cacheKey.d.ts","sourceRoot":"","sources":["../../../src/infra/queries/cacheKey.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,0EAA0E;AAC1E,eAAO,MAAM,4BAA4B,+BAA+B,CAAC;AAEzE;;;;;;;;GAQG;AACH,eAAO,MAAM,qBAAqB,GAAI,YAAY,MAAM,KAAG,MAGzB,CAAC;AAEnC,0EAA0E;AAC1E,eAAO,MAAM,0BAA0B,6BAA6B,CAAC;AAErE;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,mBAAmB,GAAI,YAAY,MAAM,KAAG,MAGzB,CAAC"}
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/**
|
|
3
|
-
* AsyncStorage key derivation for the cached onboarding
|
|
3
|
+
* AsyncStorage key derivation for the SDK's cached payloads (onboarding
|
|
4
|
+
* steps, paywall catalog).
|
|
4
5
|
*
|
|
5
|
-
* Lives in its own module so
|
|
6
|
-
* `OnboardingStudioClient` can use
|
|
7
|
-
* (the query
|
|
6
|
+
* Lives in its own module so `getOnboarding.query.ts`, `getPaywalls.query.ts`
|
|
7
|
+
* and `OnboardingStudioClient` can all use these as values without a circular
|
|
8
|
+
* import (the query modules import `OnboardingStudioClient` for typing) —
|
|
9
|
+
* this module itself has no imports.
|
|
8
10
|
*/
|
|
9
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.getOnboardingCacheKey = exports.DEFAULT_ONBOARDING_CACHE_KEY = void 0;
|
|
12
|
+
exports.getPaywallsCacheKey = exports.DEFAULT_PAYWALLS_CACHE_KEY = exports.getOnboardingCacheKey = exports.DEFAULT_ONBOARDING_CACHE_KEY = void 0;
|
|
11
13
|
/** Default cache key used when the host does not provide a custom one. */
|
|
12
14
|
exports.DEFAULT_ONBOARDING_CACHE_KEY = "rocapine-onboarding-studio";
|
|
13
15
|
/**
|
|
@@ -23,4 +25,23 @@ const getOnboardingCacheKey = (customKey) => customKey
|
|
|
23
25
|
? `rocapine-onboarding-sdk-${customKey}`
|
|
24
26
|
: exports.DEFAULT_ONBOARDING_CACHE_KEY;
|
|
25
27
|
exports.getOnboardingCacheKey = getOnboardingCacheKey;
|
|
28
|
+
/** Default cache key used when the host does not provide a custom one. */
|
|
29
|
+
exports.DEFAULT_PAYWALLS_CACHE_KEY = "rocapine-paywalls-studio";
|
|
30
|
+
/**
|
|
31
|
+
* Derives the AsyncStorage key for the cached paywall catalog.
|
|
32
|
+
*
|
|
33
|
+
* Namespaced separately from `getOnboardingCacheKey`
|
|
34
|
+
* (`rocapine-paywalls-*` vs `rocapine-onboarding-*`) so the two caches never
|
|
35
|
+
* collide, even though both derive from the same `client.options.cacheKey`.
|
|
36
|
+
*
|
|
37
|
+
* - No custom key → the shared default `"rocapine-paywalls-studio"`
|
|
38
|
+
* (stale-while-revalidate: served cache-first and healed in the background).
|
|
39
|
+
* - Custom key → `"rocapine-paywalls-sdk-{customKey}"`, which the SDK persists
|
|
40
|
+
* cache-first with **no** background revalidation, so the host owns when to
|
|
41
|
+
* refetch (see `OnboardingStudioClient.clearCache`).
|
|
42
|
+
*/
|
|
43
|
+
const getPaywallsCacheKey = (customKey) => customKey
|
|
44
|
+
? `rocapine-paywalls-sdk-${customKey}`
|
|
45
|
+
: exports.DEFAULT_PAYWALLS_CACHE_KEY;
|
|
46
|
+
exports.getPaywallsCacheKey = getPaywallsCacheKey;
|
|
26
47
|
//# sourceMappingURL=cacheKey.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cacheKey.js","sourceRoot":"","sources":["../../../src/infra/queries/cacheKey.ts"],"names":[],"mappings":";AAAA
|
|
1
|
+
{"version":3,"file":"cacheKey.js","sourceRoot":"","sources":["../../../src/infra/queries/cacheKey.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;;;AAEH,0EAA0E;AAC7D,QAAA,4BAA4B,GAAG,4BAA4B,CAAC;AAEzE;;;;;;;;GAQG;AACI,MAAM,qBAAqB,GAAG,CAAC,SAAkB,EAAU,EAAE,CAClE,SAAS;IACP,CAAC,CAAC,2BAA2B,SAAS,EAAE;IACxC,CAAC,CAAC,oCAA4B,CAAC;AAHtB,QAAA,qBAAqB,yBAGC;AAEnC,0EAA0E;AAC7D,QAAA,0BAA0B,GAAG,0BAA0B,CAAC;AAErE;;;;;;;;;;;;GAYG;AACI,MAAM,mBAAmB,GAAG,CAAC,SAAkB,EAAU,EAAE,CAChE,SAAS;IACP,CAAC,CAAC,yBAAyB,SAAS,EAAE;IACtC,CAAC,CAAC,kCAA0B,CAAC;AAHpB,QAAA,mBAAmB,uBAGC"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { OnboardingStudioClient } from "../OnboardingStudioClient";
|
|
2
|
+
import { Paywall, PaywallCatalog, PresentResult } from "./types";
|
|
3
|
+
import { ProductProvider } from "../products/types";
|
|
4
|
+
import type { CustomActions } from "../infra/provider/OnboardingProvider";
|
|
5
|
+
/**
|
|
6
|
+
* Everything a paywall consumer or a paywall HOST needs. Deliberately one
|
|
7
|
+
* context carrying both, mirroring how `OnboardingProgressContext` bundles
|
|
8
|
+
* far more than any single hook reads — `usePaywall()` and `usePaywallHost()`
|
|
9
|
+
* each slice out the fields they need, same pattern as the small hooks in
|
|
10
|
+
* `infra/hooks/` slicing `OnboardingProgressContext`.
|
|
11
|
+
*/
|
|
12
|
+
export type PaywallContextValue = {
|
|
13
|
+
present: (placement: string) => Promise<PresentResult>;
|
|
14
|
+
isReady: boolean;
|
|
15
|
+
catalog: PaywallCatalog | null;
|
|
16
|
+
/** The paywall currently being presented, or null. Read by `usePaywallHost()` — not by `usePaywall()`. */
|
|
17
|
+
activePaywall: Paywall | null;
|
|
18
|
+
/**
|
|
19
|
+
* Resolve the pending `present()` call and clear the active placement.
|
|
20
|
+
* Call this from the presented paywall's `ScreenHost.complete` (Task 7's
|
|
21
|
+
* `PaywallHost`) — never from an ordinary consumer.
|
|
22
|
+
*/
|
|
23
|
+
complete: (result: PresentResult) => void;
|
|
24
|
+
/** Forwarded into the presented paywall's `ScreenHost.customActions`. */
|
|
25
|
+
customActions: CustomActions;
|
|
26
|
+
};
|
|
27
|
+
export declare const PaywallContext: import("react").Context<PaywallContextValue>;
|
|
28
|
+
/**
|
|
29
|
+
* The seam a paywall HOST (Task 7's `PaywallHost`) reads from — analogous to
|
|
30
|
+
* `ScreenHost` being the seam the rendering engine reads from. Kept out of
|
|
31
|
+
* `usePaywall()`'s return so an ordinary caller never sees presentation
|
|
32
|
+
* internals it has no reason to touch (which paywall is active, how to
|
|
33
|
+
* resolve it).
|
|
34
|
+
*/
|
|
35
|
+
export declare const usePaywallHost: () => Pick<PaywallContextValue, "activePaywall" | "complete" | "customActions">;
|
|
36
|
+
interface PaywallProviderProps {
|
|
37
|
+
children: React.ReactNode;
|
|
38
|
+
client: OnboardingStudioClient;
|
|
39
|
+
locale?: string;
|
|
40
|
+
customAudienceParams?: Record<string, any>;
|
|
41
|
+
/**
|
|
42
|
+
* Billing adapter. Products are resolved once, over the union of every
|
|
43
|
+
* `paywall.products[]` in the catalog (deduplicated), and published via
|
|
44
|
+
* `ProductRuntimeContext` — an `OnboardingProvider` mounted anywhere inside
|
|
45
|
+
* this tree picks up the SAME runtime instead of resolving its own, so
|
|
46
|
+
* there is one store round-trip and one `purchasing` flag for both.
|
|
47
|
+
*/
|
|
48
|
+
productProvider?: ProductProvider;
|
|
49
|
+
/** Handlers for `{ type: "custom" }` ButtonActions inside a paywall's elements. */
|
|
50
|
+
customActions?: CustomActions;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* App-level ancestor. Renders ABOVE `OnboardingProvider`, not inside it —
|
|
54
|
+
* that is what lets both share one `ProductRuntimeContext` (React context
|
|
55
|
+
* only flows to descendants; two true siblings could not share one runtime).
|
|
56
|
+
*
|
|
57
|
+
* ```tsx
|
|
58
|
+
* <PaywallProvider client={client} productProvider={revenueCatProductProvider(Purchases)}>
|
|
59
|
+
* <App />
|
|
60
|
+
* <PaywallHost /> // Task 7: renders the active paywall in a fullScreen RN Modal
|
|
61
|
+
* </PaywallProvider>
|
|
62
|
+
* ```
|
|
63
|
+
*/
|
|
64
|
+
export declare const PaywallProvider: ({ children, client, locale, customAudienceParams, productProvider, customActions, }: PaywallProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
65
|
+
export {};
|
|
66
|
+
//# sourceMappingURL=PaywallProvider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PaywallProvider.d.ts","sourceRoot":"","sources":["../../src/paywalls/PaywallProvider.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AAEnE,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAWjE,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sCAAsC,CAAC;AAwB1E;;;;;;GAMG;AACH,MAAM,MAAM,mBAAmB,GAAG;IAChC,OAAO,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC,aAAa,CAAC,CAAC;IACvD,OAAO,EAAE,OAAO,CAAC;IAC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