@youversion/platform-react-ui 0.4.2 → 0.4.4

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/index.cjs CHANGED
@@ -39,8 +39,10 @@ __export(index_exports, {
39
39
  BOOK_IDS: () => BOOK_IDS,
40
40
  BibleChapterPicker: () => BibleChapterPicker,
41
41
  BibleClient: () => BibleClient,
42
- BibleSDKProvider: () => import_platform_react_hooks4.BibleSDKProvider,
42
+ BibleReader: () => BibleReader,
43
+ BibleSDKProvider: () => import_platform_react_hooks6.BibleSDKProvider,
43
44
  BibleTextView: () => BibleTextView,
45
+ BibleVersionPicker: () => BibleVersionPicker,
44
46
  HighlightsClient: () => HighlightsClient,
45
47
  LanguagesClient: () => LanguagesClient,
46
48
  MemoryStorageStrategy: () => MemoryStorageStrategy,
@@ -12614,7 +12616,7 @@ var ApiClient = class {
12614
12616
  /**
12615
12617
  * Creates an instance of ApiClient.
12616
12618
  *
12617
- * @param config - The API configuration object containing baseUrl, timeout, and appId.
12619
+ * @param config - The API configuration object containing baseUrl, timeout, and appKey.
12618
12620
  */
12619
12621
  constructor(config2) {
12620
12622
  __publicField(this, "baseURL");
@@ -12622,14 +12624,17 @@ var ApiClient = class {
12622
12624
  __publicField(this, "defaultHeaders");
12623
12625
  __publicField(this, "config");
12624
12626
  this.config = {
12625
- version: config2.version || "v1",
12626
12627
  ...config2
12627
12628
  };
12628
- this.baseURL = config2.baseUrl || "https://api-dev.youversion.com";
12629
+ const apiHost = config2.apiHost || "api.youversion.com";
12630
+ if (!apiHost) {
12631
+ throw new Error("ApiClient requires a host name. Provide an apiHost in the config.");
12632
+ }
12633
+ this.baseURL = "https://" + apiHost;
12629
12634
  this.timeout = config2.timeout || 1e4;
12630
12635
  this.defaultHeaders = {
12631
12636
  "Content-Type": "application/json",
12632
- "X-YVP-App-Key": this.config.appId,
12637
+ "X-YVP-App-Key": this.config.appKey,
12633
12638
  "X-YVP-Installation-Id": this.config.installationId || "web-sdk-default"
12634
12639
  };
12635
12640
  }
@@ -12768,9 +12773,6 @@ var BibleClient = class {
12768
12773
  __publicField(this, "booleanSchema", external_exports.boolean());
12769
12774
  this.client = client;
12770
12775
  }
12771
- get rootPath() {
12772
- return `/${this.client.config.version}`;
12773
- }
12774
12776
  /**
12775
12777
  * Fetches a collection of Bible versions filtered by language ranges.
12776
12778
  *
@@ -12786,7 +12788,7 @@ var BibleClient = class {
12786
12788
  if (license_id !== void 0) {
12787
12789
  params.license_id = license_id;
12788
12790
  }
12789
- return this.client.get(`${this.rootPath}/bibles`, params);
12791
+ return this.client.get(`/v1/bibles`, params);
12790
12792
  }
12791
12793
  /**
12792
12794
  * Fetches a Bible version by its ID.
@@ -12795,7 +12797,7 @@ var BibleClient = class {
12795
12797
  */
12796
12798
  async getVersion(id) {
12797
12799
  this.versionIdSchema.parse(id);
12798
- return this.client.get(`${this.rootPath}/bibles/${id}`);
12800
+ return this.client.get(`/v1/bibles/${id}`);
12799
12801
  }
12800
12802
  /**
12801
12803
  * Fetches all books for a given Bible version.
@@ -12805,7 +12807,7 @@ var BibleClient = class {
12805
12807
  */
12806
12808
  async getBooks(versionId, canon) {
12807
12809
  this.versionIdSchema.parse(versionId);
12808
- return this.client.get(`${this.rootPath}/bibles/${versionId}/books`, {
12810
+ return this.client.get(`/v1/bibles/${versionId}/books`, {
12809
12811
  ...canon && { canon }
12810
12812
  });
12811
12813
  }
@@ -12818,7 +12820,7 @@ var BibleClient = class {
12818
12820
  async getBook(versionId, book) {
12819
12821
  this.versionIdSchema.parse(versionId);
12820
12822
  this.bookSchema.parse(book);
12821
- return this.client.get(`${this.rootPath}/bibles/${versionId}/books/${book}`);
12823
+ return this.client.get(`/v1/bibles/${versionId}/books/${book}`);
12822
12824
  }
12823
12825
  /**
12824
12826
  * Fetches all chapters for a specific book in a version.
@@ -12830,7 +12832,7 @@ var BibleClient = class {
12830
12832
  this.versionIdSchema.parse(versionId);
12831
12833
  this.bookSchema.parse(book);
12832
12834
  return this.client.get(
12833
- `${this.rootPath}/bibles/${versionId}/books/${book}/chapters`
12835
+ `/v1/bibles/${versionId}/books/${book}/chapters`
12834
12836
  );
12835
12837
  }
12836
12838
  /**
@@ -12845,7 +12847,7 @@ var BibleClient = class {
12845
12847
  this.bookSchema.parse(book);
12846
12848
  this.chapterSchema.parse(chapter);
12847
12849
  return this.client.get(
12848
- `${this.rootPath}/bibles/${versionId}/books/${book}/chapters/${chapter}`
12850
+ `/v1/bibles/${versionId}/books/${book}/chapters/${chapter}`
12849
12851
  );
12850
12852
  }
12851
12853
  /**
@@ -12860,7 +12862,7 @@ var BibleClient = class {
12860
12862
  this.bookSchema.parse(book);
12861
12863
  this.chapterSchema.parse(chapter);
12862
12864
  return this.client.get(
12863
- `${this.rootPath}/bibles/${versionId}/books/${book}/chapters/${chapter}/verses`
12865
+ `/v1/bibles/${versionId}/books/${book}/chapters/${chapter}/verses`
12864
12866
  );
12865
12867
  }
12866
12868
  /**
@@ -12877,7 +12879,7 @@ var BibleClient = class {
12877
12879
  this.chapterSchema.parse(chapter);
12878
12880
  this.verseSchema.parse(verse);
12879
12881
  return this.client.get(
12880
- `${this.rootPath}/bibles/${versionId}/books/${book}/chapters/${chapter}/verses/${verse}`
12882
+ `/v1/bibles/${versionId}/books/${book}/chapters/${chapter}/verses/${verse}`
12881
12883
  );
12882
12884
  }
12883
12885
  /**
@@ -12918,10 +12920,7 @@ var BibleClient = class {
12918
12920
  if (include_notes !== void 0) {
12919
12921
  params.include_notes = include_notes;
12920
12922
  }
12921
- return this.client.get(
12922
- `${this.rootPath}/bibles/${versionId}/passages/${usfm}`,
12923
- params
12924
- );
12923
+ return this.client.get(`/v1/bibles/${versionId}/passages/${usfm}`, params);
12925
12924
  }
12926
12925
  /**
12927
12926
  * Fetches the indexing structure for a Bible version.
@@ -12930,14 +12929,14 @@ var BibleClient = class {
12930
12929
  */
12931
12930
  async getIndex(versionId) {
12932
12931
  this.versionIdSchema.parse(versionId);
12933
- return this.client.get(`${this.rootPath}/bibles/${versionId}/index`);
12932
+ return this.client.get(`/v1/bibles/${versionId}/index`);
12934
12933
  }
12935
12934
  /**
12936
12935
  * Fetches the verse of the day calendar for an entire year.
12937
12936
  * @returns A collection of VOTD objects for all days of the year.
12938
12937
  */
12939
12938
  async getAllVOTDs() {
12940
- return this.client.get(`${this.rootPath}/verse_of_the_days`);
12939
+ return this.client.get(`/v1/verse_of_the_days`);
12941
12940
  }
12942
12941
  /**
12943
12942
  * Fetches the passage_id for the Verse Of The Day.
@@ -12955,7 +12954,7 @@ var BibleClient = class {
12955
12954
  async getVOTD(day) {
12956
12955
  const daySchema = external_exports.number().int().min(1).max(366);
12957
12956
  daySchema.parse(day);
12958
- return this.client.get(`${this.rootPath}/verse_of_the_days/${day}`);
12957
+ return this.client.get(`/v1/verse_of_the_days/${day}`);
12959
12958
  }
12960
12959
  };
12961
12960
  var LanguagesClient = class {
@@ -12972,9 +12971,6 @@ var LanguagesClient = class {
12972
12971
  __publicField(this, "countrySchema", external_exports.string().trim().length(2, "Country code must be a 2-character ISO 3166-1 alpha-2 code").toUpperCase());
12973
12972
  this.client = client;
12974
12973
  }
12975
- get rootPath() {
12976
- return `/${this.client.config.version}`;
12977
- }
12978
12974
  /**
12979
12975
  * Fetches a collection of languages supported in the Platform.
12980
12976
  * @param options Query parameters for pagination and filtering (country is required).
@@ -12992,7 +12988,7 @@ var LanguagesClient = class {
12992
12988
  if (options.page_token !== void 0) {
12993
12989
  params.page_token = options.page_token;
12994
12990
  }
12995
- return this.client.get(`${this.rootPath}/languages`, params);
12991
+ return this.client.get(`/v1/languages`, params);
12996
12992
  }
12997
12993
  /**
12998
12994
  * Fetches details about a specific language in the Platform.
@@ -13001,7 +12997,7 @@ var LanguagesClient = class {
13001
12997
  */
13002
12998
  async getLanguage(languageId) {
13003
12999
  this.languageIdSchema.parse(languageId);
13004
- return this.client.get(`${this.rootPath}/languages/${languageId}`);
13000
+ return this.client.get(`/v1/languages/${languageId}`);
13005
13001
  }
13006
13002
  };
13007
13003
  var _a;
@@ -13018,11 +13014,11 @@ var YouVersionPlatformConfiguration = (_a = class {
13018
13014
  localStorage.setItem("x-yvp-installation-id", newId);
13019
13015
  return newId;
13020
13016
  }
13021
- static get appId() {
13022
- return this._appId;
13017
+ static get appKey() {
13018
+ return this._appKey;
13023
13019
  }
13024
- static set appId(value) {
13025
- this._appId = value;
13020
+ static set appKey(value) {
13021
+ this._appKey = value;
13026
13022
  }
13027
13023
  static get installationId() {
13028
13024
  if (!this._installationId) {
@@ -13060,7 +13056,7 @@ var YouVersionPlatformConfiguration = (_a = class {
13060
13056
  static set previewUserInfo(value) {
13061
13057
  this._previewUserInfo = value;
13062
13058
  }
13063
- }, __publicField(_a, "_appId", null), __publicField(_a, "_installationId", null), __publicField(_a, "_accessToken", null), __publicField(_a, "_apiHost", "api-dev.youversion.com"), __publicField(_a, "_isPreviewMode", false), __publicField(_a, "_previewUserInfo", null), _a);
13059
+ }, __publicField(_a, "_appKey", null), __publicField(_a, "_installationId", null), __publicField(_a, "_accessToken", null), __publicField(_a, "_apiHost", "api.youversion.com"), __publicField(_a, "_isPreviewMode", false), __publicField(_a, "_previewUserInfo", null), _a);
13064
13060
  var HighlightsClient = class {
13065
13061
  /**
13066
13062
  * Creates a new HighlightsClient instance.
@@ -13073,9 +13069,6 @@ var HighlightsClient = class {
13073
13069
  __publicField(this, "colorSchema", external_exports.string().regex(/^[0-9a-f]{6}$/i, "Color must be a 6-character hex string without #"));
13074
13070
  this.client = client;
13075
13071
  }
13076
- get rootPath() {
13077
- return `/${this.client.config.version}`;
13078
- }
13079
13072
  /**
13080
13073
  * Gets the authentication token, either from the provided parameter or from the platform configuration.
13081
13074
  * @param lat Optional explicit long access token. If not provided, retrieves from YouVersionPlatformConfiguration.
@@ -13145,7 +13138,7 @@ var HighlightsClient = class {
13145
13138
  this.validatePassageId(options.passage_id);
13146
13139
  params.passage_id = options.passage_id;
13147
13140
  }
13148
- return this.client.get(`${this.rootPath}/highlights`, params);
13141
+ return this.client.get(`/v1/highlights`, params);
13149
13142
  }
13150
13143
  /**
13151
13144
  * Creates or updates a highlight on a passage.
@@ -13160,7 +13153,7 @@ var HighlightsClient = class {
13160
13153
  this.validatePassageId(data.passage_id);
13161
13154
  this.validateColor(data.color);
13162
13155
  const token = this.getAuthToken(lat);
13163
- return this.client.post(`${this.rootPath}/highlights`, data, { lat: token });
13156
+ return this.client.post(`/v1/highlights`, data, { lat: token });
13164
13157
  }
13165
13158
  /**
13166
13159
  * Clears highlights for a passage.
@@ -13180,7 +13173,7 @@ var HighlightsClient = class {
13180
13173
  this.validateVersionId(options.version_id);
13181
13174
  params.version_id = options.version_id;
13182
13175
  }
13183
- await this.client.delete(`${this.rootPath}/highlights/${passageId}`, params);
13176
+ await this.client.delete(`/v1/highlights/${passageId}`, params);
13184
13177
  }
13185
13178
  };
13186
13179
  var AuthClient = class {
@@ -13464,13 +13457,13 @@ var YouVersionAPI = class {
13464
13457
  Accept: "application/json",
13465
13458
  "Content-Type": "application/json"
13466
13459
  };
13467
- const appId = YouVersionPlatformConfiguration.appId;
13468
- if (appId) {
13469
- headers["X-App-Id"] = appId;
13460
+ const appKey = YouVersionPlatformConfiguration.appKey;
13461
+ if (appKey) {
13462
+ headers["X-YVP-App-Key"] = appKey;
13470
13463
  }
13471
13464
  const installationId = YouVersionPlatformConfiguration.installationId;
13472
13465
  if (installationId) {
13473
- headers["x-yvp-installation-id"] = installationId;
13466
+ headers["X-YVP-Installation-ID"] = installationId;
13474
13467
  }
13475
13468
  const request = new Request(url2.toString(), {
13476
13469
  headers
@@ -13482,15 +13475,15 @@ var URLBuilder = class {
13482
13475
  static get baseURL() {
13483
13476
  return new URL(`https://${YouVersionPlatformConfiguration.apiHost}`);
13484
13477
  }
13485
- static authURL(appId, requiredPermissions = /* @__PURE__ */ new Set(), optionalPermissions = /* @__PURE__ */ new Set()) {
13486
- if (typeof appId !== "string" || appId.trim().length === 0) {
13487
- throw new Error("appId must be a non-empty string");
13478
+ static authURL(appKey, requiredPermissions = /* @__PURE__ */ new Set(), optionalPermissions = /* @__PURE__ */ new Set()) {
13479
+ if (typeof appKey !== "string" || appKey.trim().length === 0) {
13480
+ throw new Error("appKey must be a non-empty string");
13488
13481
  }
13489
13482
  try {
13490
13483
  const url2 = new URL(this.baseURL);
13491
13484
  url2.pathname = "/auth/login";
13492
13485
  const searchParams = new URLSearchParams();
13493
- searchParams.append("app_id", appId);
13486
+ searchParams.append("APP_KEY", appKey);
13494
13487
  searchParams.append("language", "en");
13495
13488
  if (requiredPermissions.size > 0) {
13496
13489
  const requiredList = Array.from(requiredPermissions).map((p) => p.toString());
@@ -13552,11 +13545,11 @@ var YouVersionAPIUsers = class {
13552
13545
  if (!optionalPermissions || !(optionalPermissions instanceof Set)) {
13553
13546
  throw new Error("Invalid optionalPermissions: must be a Set");
13554
13547
  }
13555
- const appId = YouVersionPlatformConfiguration.appId;
13556
- if (!appId) {
13557
- throw new Error("YouVersionPlatformConfiguration.appId must be set before calling signIn");
13548
+ const appKey = YouVersionPlatformConfiguration.appKey;
13549
+ if (!appKey) {
13550
+ throw new Error("YouVersionPlatformConfiguration.appKey must be set before calling signIn");
13558
13551
  }
13559
- const url2 = URLBuilder.authURL(appId, requiredPermissions, optionalPermissions);
13552
+ const url2 = URLBuilder.authURL(appKey, requiredPermissions, optionalPermissions);
13560
13553
  const strategy = AuthenticationStrategyRegistry.get();
13561
13554
  const callbackUrl = await strategy.authenticate(url2);
13562
13555
  const result = new SignInWithYouVersionResult(callbackUrl);
@@ -14202,7 +14195,7 @@ function Root3({
14202
14195
  /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
14203
14196
  Accordion,
14204
14197
  {
14205
- className: "yv:relative yv:overflow-y-auto yv:bg-background yv:mx-6 yv:shadow-[inset_0_-16px_16px_-12px_rgba(0,0,0,0.1)]",
14198
+ className: "yv:relative yv:overflow-y-auto yv:bg-background yv:mx-6",
14206
14199
  type: "single",
14207
14200
  collapsible: true,
14208
14201
  defaultValue: defaultBook || book || "GEN",
@@ -14270,212 +14263,937 @@ function Trigger3({ asChild = true, children, ...props }) {
14270
14263
  const { books, loading } = (0, import_platform_react_hooks.useBooks)(versionId);
14271
14264
  const currentBook = books?.data?.find((bookItem) => bookItem.id === book);
14272
14265
  const buttonText = loading ? "Loading..." : `${currentBook?.title || "Select a chapter"}${chapter ? ` ${chapter}` : ""}`;
14273
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(PopoverTrigger, { asChild, ...props, children: children || /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Button, { variant: background === "light" ? "outline" : "default", children: buttonText }) });
14266
+ const content = typeof children === "function" ? children({ book, chapter, currentBook, loading }) : children || /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Button, { variant: background === "light" ? "outline" : "default", children: buttonText });
14267
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(PopoverTrigger, { asChild, ...props, children: content });
14274
14268
  }
14275
14269
  var BibleChapterPicker = Object.assign({}, { Root: Root3, Trigger: Trigger3 });
14276
14270
 
14277
- // src/components/SignInButton.tsx
14278
- var import_react5 = __toESM(require("react"), 1);
14279
- var import_lucide_react3 = require("lucide-react");
14280
-
14281
- // src/providers/YVPProvider.tsx
14282
- var import_react3 = require("react");
14271
+ // src/components/bible-reader.tsx
14272
+ var import_react4 = require("react");
14273
+ var import_react_use_controllable_state3 = require("@radix-ui/react-use-controllable-state");
14274
+ var import_platform_react_hooks4 = require("@youversion/platform-react-hooks");
14283
14275
 
14284
- // src/providers/YVPErrorBoundary.tsx
14276
+ // src/components/bible-version-picker.tsx
14285
14277
  var import_react2 = require("react");
14278
+ var import_react_use_controllable_state2 = require("@radix-ui/react-use-controllable-state");
14279
+ var import_platform_react_hooks2 = require("@youversion/platform-react-hooks");
14280
+
14281
+ // src/components/ui/item.tsx
14282
+ var React6 = require("react");
14283
+ var import_react_slot2 = require("@radix-ui/react-slot");
14284
+ var import_class_variance_authority3 = require("class-variance-authority");
14286
14285
  var import_jsx_runtime7 = require("react/jsx-runtime");
14287
- var YVPErrorBoundary = class extends import_react2.Component {
14288
- constructor(props) {
14289
- super(props);
14290
- this.state = { hasError: false, error: null };
14291
- }
14292
- static getDerivedStateFromError(error46) {
14293
- return { hasError: true, error: error46 };
14294
- }
14295
- componentDidCatch(error46, errorInfo) {
14296
- const { onError } = this.props;
14297
- if (onError) {
14298
- onError(error46, errorInfo);
14286
+ function ItemGroup({ className, ...props }) {
14287
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
14288
+ "div",
14289
+ {
14290
+ role: "list",
14291
+ "data-slot": "item-group",
14292
+ className: cn("yv:group/item-group yv:flex yv:flex-col", className),
14293
+ ...props
14299
14294
  }
14300
- if (process.env.NODE_ENV === "development") {
14301
- console.error("YVP Error Boundary caught error:", error46, errorInfo);
14295
+ );
14296
+ }
14297
+ var itemVariants = (0, import_class_variance_authority3.cva)(
14298
+ "yv:group/item yv:flex yv:items-center yv:border yv:border-transparent yv:text-sm yv:rounded-md yv:transition-colors yv:[a]:hover:bg-accent/50 yv:[a]:transition-colors yv:duration-100 yv:flex-wrap yv:outline-none yv:focus-visible:border-ring yv:focus-visible:ring-ring/50 yv:focus-visible:ring-[3px]",
14299
+ {
14300
+ variants: {
14301
+ variant: {
14302
+ default: "yv:bg-transparent",
14303
+ outline: "yv:border-border",
14304
+ muted: "yv:bg-muted/50"
14305
+ },
14306
+ size: {
14307
+ default: "yv:p-4 yv:gap-4 yv:",
14308
+ sm: "yv:py-3 yv:px-4 yv:gap-2.5"
14309
+ }
14310
+ },
14311
+ defaultVariants: {
14312
+ variant: "default",
14313
+ size: "default"
14302
14314
  }
14303
14315
  }
14304
- render() {
14305
- const { hasError, error: error46 } = this.state;
14306
- const { children, fallback } = this.props;
14307
- const isDevelopment = process.env.NODE_ENV === "development";
14308
- if (hasError) {
14309
- if (fallback) {
14310
- return fallback;
14316
+ );
14317
+ function Item2({
14318
+ className,
14319
+ variant = "default",
14320
+ size = "default",
14321
+ asChild = false,
14322
+ ...props
14323
+ }) {
14324
+ const Comp = asChild ? import_react_slot2.Slot : "div";
14325
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
14326
+ Comp,
14327
+ {
14328
+ "data-slot": "item",
14329
+ "data-variant": variant,
14330
+ "data-size": size,
14331
+ className: cn(itemVariants({ variant, size, className })),
14332
+ ...props
14333
+ }
14334
+ );
14335
+ }
14336
+ var itemMediaVariants = (0, import_class_variance_authority3.cva)(
14337
+ "yv:flex yv:shrink-0 yv:items-center yv:justify-center yv:gap-2 yv:group-has-[[data-slot=item-description]]/item:self-start yv:[&_svg]:pointer-events-none yv:group-has-[[data-slot=item-description]]/item:translate-y-0.5",
14338
+ {
14339
+ variants: {
14340
+ variant: {
14341
+ default: "yv:bg-transparent",
14342
+ icon: "yv:size-8 yv:border yv:rounded-sm yv:bg-muted yv:[&_svg:not([class*=size-])]:size-4",
14343
+ image: "yv:size-10 yv:rounded-sm yv:overflow-hidden yv:[&_img]:size-full yv:[&_img]:object-cover"
14311
14344
  }
14312
- return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { style: { padding: "20px", textAlign: "center" }, children: [
14313
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("h2", { children: "Something went wrong" }),
14314
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { children: "We encountered an error while loading YouVersion Platform components." }),
14315
- isDevelopment && error46 && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("details", { style: { marginTop: "10px" }, children: [
14316
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("summary", { children: "Error details (development only)" }),
14317
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("pre", { style: { textAlign: "left", overflow: "auto" }, children: error46.toString() })
14318
- ] })
14319
- ] });
14345
+ },
14346
+ defaultVariants: {
14347
+ variant: "default"
14320
14348
  }
14321
- return children;
14322
14349
  }
14323
- };
14350
+ );
14351
+ function ItemMedia({
14352
+ className,
14353
+ variant = "default",
14354
+ ...props
14355
+ }) {
14356
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
14357
+ "div",
14358
+ {
14359
+ "data-slot": "item-media",
14360
+ "data-variant": variant,
14361
+ className: cn(itemMediaVariants({ variant, className })),
14362
+ ...props
14363
+ }
14364
+ );
14365
+ }
14366
+ function ItemContent({ className, ...props }) {
14367
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
14368
+ "div",
14369
+ {
14370
+ "data-slot": "item-content",
14371
+ className: cn(
14372
+ "yv:flex yv:flex-1 yv:flex-col yv:gap-1 yv:[&+[data-slot=item-content]]:flex-none",
14373
+ className
14374
+ ),
14375
+ ...props
14376
+ }
14377
+ );
14378
+ }
14379
+ function ItemTitle({ className, ...props }) {
14380
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
14381
+ "div",
14382
+ {
14383
+ "data-slot": "item-title",
14384
+ className: cn(
14385
+ "yv:flex yv:w-fit yv:items-center yv:gap-2 yv:text-sm yv:leading-snug yv:font-medium",
14386
+ className
14387
+ ),
14388
+ ...props
14389
+ }
14390
+ );
14391
+ }
14392
+ function ItemDescription({ className, ...props }) {
14393
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
14394
+ "p",
14395
+ {
14396
+ "data-slot": "item-description",
14397
+ className: cn(
14398
+ "yv:text-muted-foreground yv:line-clamp-2 yv:text-sm yv:leading-normal yv:font-normal yv:text-balance",
14399
+ "yv:[&>a:hover]:text-primary yv:[&>a]:underline yv:[&>a]:underline-offset-4",
14400
+ className
14401
+ ),
14402
+ ...props
14403
+ }
14404
+ );
14405
+ }
14324
14406
 
14325
- // src/providers/YVPProvider.tsx
14407
+ // src/components/bible-version-picker.tsx
14408
+ var import_lucide_react3 = require("lucide-react");
14409
+
14410
+ // src/components/ui/badge.tsx
14411
+ var React7 = require("react");
14412
+ var import_react_slot3 = require("@radix-ui/react-slot");
14413
+ var import_class_variance_authority4 = require("class-variance-authority");
14326
14414
  var import_jsx_runtime8 = require("react/jsx-runtime");
14327
- var YVPContext = (0, import_react3.createContext)(null);
14328
- function YVPProvider({
14329
- config: config2,
14330
- children,
14331
- errorFallback,
14332
- onError,
14333
- theme = "light"
14334
- }) {
14335
- const [authState, setAuthState] = (0, import_react3.useState)({
14336
- isAuthenticated: false,
14337
- isLoading: false,
14338
- accessToken: null,
14339
- result: null,
14340
- error: null
14341
- });
14342
- (0, import_react3.useEffect)(() => {
14343
- const initializeAuth = () => {
14344
- YouVersionPlatformConfiguration.appId = config2.appId;
14345
- YouVersionPlatformConfiguration.installationId = config2.installationId ?? null;
14346
- const strategy = new WebAuthenticationStrategy({
14347
- redirectUri: config2.redirectUri || ""
14348
- });
14349
- AuthenticationStrategyRegistry.register(strategy);
14350
- const existingToken = YouVersionPlatformConfiguration.accessToken;
14351
- if (existingToken) {
14352
- setAuthState({
14353
- isAuthenticated: true,
14354
- isLoading: false,
14355
- accessToken: existingToken,
14356
- result: null,
14357
- error: null
14358
- });
14359
- return;
14360
- }
14361
- WebAuthenticationStrategy.handleCallback();
14362
- const storedCallback = WebAuthenticationStrategy.getStoredCallback();
14363
- if (storedCallback) {
14364
- try {
14365
- const result = new SignInWithYouVersionResult(storedCallback);
14366
- const { accessToken, errorMsg } = result;
14367
- if (accessToken) {
14368
- YouVersionPlatformConfiguration.setAccessToken(accessToken);
14369
- }
14370
- setAuthState({
14371
- isAuthenticated: !!accessToken,
14372
- isLoading: false,
14373
- accessToken: accessToken ?? null,
14374
- result,
14375
- error: errorMsg ? new Error(errorMsg) : null
14376
- });
14377
- } catch (error46) {
14378
- setAuthState({
14379
- isAuthenticated: false,
14380
- isLoading: false,
14381
- accessToken: null,
14382
- result: null,
14383
- error: error46
14384
- });
14385
- }
14386
- } else {
14387
- setAuthState({
14388
- isAuthenticated: false,
14389
- isLoading: false,
14390
- accessToken: null,
14391
- result: null,
14392
- error: null
14393
- });
14415
+ var badgeVariants = (0, import_class_variance_authority4.cva)(
14416
+ "yv:inline-flex yv:items-center yv:justify-center yv:rounded-full yv:border yv:px-2 yv:py-0.5 yv:text-xs yv:font-medium yv:w-fit yv:whitespace-nowrap yv:shrink-0 yv:[&>svg]:size-3 yv:gap-1 yv:[&>svg]:pointer-events-none yv:focus-visible:border-ring yv:focus-visible:ring-ring/50 yv:focus-visible:ring-[3px] yv:aria-invalid:ring-destructive/20 yv:dark:aria-invalid:ring-destructive/40 yv:aria-invalid:border-destructive yv:transition-[color,box-shadow] yv:overflow-hidden",
14417
+ {
14418
+ variants: {
14419
+ variant: {
14420
+ default: "yv:border-transparent yv:bg-primary yv:text-primary-foreground yv:[a&]:hover:bg-primary/90",
14421
+ secondary: "yv:border-transparent yv:bg-muted yv:text-muted-foreground yv:[a&]:hover:bg-muted/90",
14422
+ destructive: "yv:border-transparent yv:bg-destructive yv:text-white yv:[a&]:hover:bg-destructive/90 yv:focus-visible:ring-destructive/20 yv:dark:focus-visible:ring-destructive/40 yv:dark:bg-destructive/60",
14423
+ outline: "yv:text-foreground yv:[a&]:hover:bg-accent yv:[a&]:hover:text-accent-foreground"
14394
14424
  }
14395
- };
14396
- initializeAuth();
14397
- }, [config2.appId, config2.installationId, config2.redirectUri]);
14398
- const signOut = (0, import_react3.useCallback)(() => {
14399
- YouVersionPlatformConfiguration.setAccessToken(null);
14400
- setAuthState({
14401
- isAuthenticated: false,
14402
- isLoading: false,
14403
- accessToken: null,
14404
- result: null,
14405
- error: null
14406
- });
14407
- }, []);
14408
- const fetchUserInfo = (0, import_react3.useCallback)(async () => {
14409
- if (!authState.isAuthenticated || !authState.accessToken) {
14410
- throw new Error("User is not authenticated");
14425
+ },
14426
+ defaultVariants: {
14427
+ variant: "default"
14411
14428
  }
14412
- return YouVersionAPIUsers.userInfo(authState.accessToken);
14413
- }, [authState.isAuthenticated, authState.accessToken]);
14414
- const value = {
14415
- config: config2,
14416
- client: ApiClient,
14417
- auth: authState,
14418
- signOut,
14419
- fetchUserInfo
14420
- };
14421
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(YVPErrorBoundary, { fallback: errorFallback, onError, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(YVPContext.Provider, { value, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "yv:contents", "data-yv-sdk": true, "data-yv-theme": theme, children }) }) });
14429
+ }
14430
+ );
14431
+ function Badge({
14432
+ className,
14433
+ variant,
14434
+ asChild = false,
14435
+ ...props
14436
+ }) {
14437
+ const Comp = asChild ? import_react_slot3.Slot : "span";
14438
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Comp, { "data-slot": "badge", className: cn(badgeVariants({ variant }), className), ...props });
14422
14439
  }
14423
- function useYVP() {
14424
- const context = (0, import_react3.useContext)(YVPContext);
14440
+
14441
+ // src/components/bible-version-picker.tsx
14442
+ var import_jsx_runtime9 = require("react/jsx-runtime");
14443
+ var BibleVersionPickerContext = (0, import_react2.createContext)(null);
14444
+ function useBibleVersionPickerContext() {
14445
+ const context = (0, import_react2.useContext)(BibleVersionPickerContext);
14425
14446
  if (!context) {
14426
- throw new Error("useYVP must be used within a YVPProvider");
14447
+ throw new Error("BibleVersionPicker components must be used within BibleVersionPicker.Root");
14427
14448
  }
14428
14449
  return context;
14429
14450
  }
14430
-
14431
- // src/hooks/useAuthentication.ts
14432
- var import_react4 = require("react");
14433
- function useAuthentication() {
14434
- const { auth, signOut, fetchUserInfo, client: _client } = useYVP();
14435
- const signIn = (0, import_react4.useCallback)(
14436
- async (requiredPermissions = [], optionalPermissions = []) => {
14437
- return await YouVersionAPIUsers.signIn(
14438
- new Set(requiredPermissions),
14439
- new Set(optionalPermissions)
14440
- );
14441
- },
14442
- []
14451
+ function Root4({
14452
+ versionId: controlledVersionId,
14453
+ onVersionChange,
14454
+ background = "light",
14455
+ side = "top",
14456
+ children
14457
+ }) {
14458
+ const [versionId, setVersionIdState] = (0, import_react_use_controllable_state2.useControllableState)({
14459
+ prop: controlledVersionId,
14460
+ defaultProp: controlledVersionId,
14461
+ onChange: onVersionChange
14462
+ });
14463
+ const [selectedLanguageId, setSelectedLanguageId] = (0, import_react2.useState)("en");
14464
+ const [searchQuery, setSearchQuery] = (0, import_react2.useState)("");
14465
+ const [isLanguagesOpen, setIsLanguagesOpen] = (0, import_react2.useState)(false);
14466
+ const { languages: hookLanguages } = (0, import_platform_react_hooks2.useLanguages)({ country: "US" });
14467
+ const languages = (0, import_react2.useMemo)(() => {
14468
+ if (hookLanguages?.data && hookLanguages.data.length > 0) {
14469
+ return hookLanguages.data.map((lang) => ({
14470
+ id: lang.id || "",
14471
+ englishName: lang.display_names?.en || lang.language,
14472
+ name: lang.display_names?.[lang.id] || lang.language
14473
+ }));
14474
+ }
14475
+ return [];
14476
+ }, [hookLanguages?.data]);
14477
+ const { versions } = (0, import_platform_react_hooks2.useVersions)(selectedLanguageId);
14478
+ const filteredVersions = (0, import_platform_react_hooks2.useFilteredVersions)(
14479
+ versions?.data || [],
14480
+ searchQuery,
14481
+ selectedLanguageId
14443
14482
  );
14444
- return {
14445
- auth,
14446
- signIn,
14447
- signOut,
14448
- fetchUserInfo
14449
- };
14483
+ const contextValue = {
14484
+ versionId,
14485
+ setVersionId: setVersionIdState,
14486
+ background,
14487
+ side,
14488
+ languages,
14489
+ selectedLanguageId,
14490
+ setSelectedLanguageId,
14491
+ searchQuery,
14492
+ setSearchQuery,
14493
+ filteredVersions,
14494
+ isLanguagesOpen,
14495
+ setIsLanguagesOpen
14496
+ };
14497
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(BibleVersionPickerContext.Provider, { value: contextValue, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Popover, { children }) });
14498
+ }
14499
+ function Trigger4({ asChild = true, children, ...props }) {
14500
+ const { versionId, background } = useBibleVersionPickerContext();
14501
+ const { version: version2, loading } = (0, import_platform_react_hooks2.useVersion)(versionId);
14502
+ const content = typeof children === "function" ? children({ version: version2, loading }) : children || /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
14503
+ Button,
14504
+ {
14505
+ variant: background === "light" ? "outline" : "default",
14506
+ className: "yv:cursor-pointer",
14507
+ children: version2?.local_abbreviation || "Select"
14508
+ }
14509
+ );
14510
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(PopoverTrigger, { asChild, ...props, children: content });
14450
14511
  }
14451
-
14452
- // src/components/youversion-logo.tsx
14453
- var React8 = require("react");
14454
- var import_jsx_runtime9 = require("react/jsx-runtime");
14455
- function YouVersionLogo(props) {
14512
+ function Content3() {
14513
+ const {
14514
+ searchQuery,
14515
+ setSearchQuery,
14516
+ filteredVersions,
14517
+ versionId,
14518
+ setVersionId,
14519
+ background,
14520
+ side,
14521
+ setIsLanguagesOpen,
14522
+ isLanguagesOpen,
14523
+ languages,
14524
+ selectedLanguageId,
14525
+ setSelectedLanguageId
14526
+ } = useBibleVersionPickerContext();
14527
+ const closeRef = (0, import_react2.useRef)(null);
14528
+ const handleSelectLanguage = (languageId) => {
14529
+ setSelectedLanguageId(languageId);
14530
+ setIsLanguagesOpen(false);
14531
+ };
14532
+ const handleSelectVersion = (versionId2) => {
14533
+ setVersionId(versionId2);
14534
+ setIsLanguagesOpen(false);
14535
+ closeRef.current?.click();
14536
+ };
14456
14537
  return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
14457
- "svg",
14538
+ PopoverContent,
14458
14539
  {
14459
- xmlns: "http://www.w3.org/2000/svg",
14460
- fill: "none",
14461
- viewBox: "0 0 26 26",
14462
- role: "img",
14463
- "aria-label": "YouVersion",
14464
- ...props,
14540
+ "data-yv-sdk": true,
14541
+ "data-yv-theme": background === "dark" ? "dark" : "light",
14542
+ side,
14543
+ className: "yv:flex yv:flex-col yv:bg-background yv:p-0 yv:h-[66vh] yv:max-h-[66vh] yv:w-96 yv:sm:w-sm yv:overflow-hidden yv:rounded-2xl yv:border-0 yv:shadow-lg",
14465
14544
  children: [
14466
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
14467
- "mask",
14545
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
14546
+ "div",
14468
14547
  {
14469
- id: "youversion-logo-mask",
14470
- width: 26,
14471
- height: 26,
14472
- x: 0,
14548
+ className: `yv:h-[66vh] yv:absolute yv:inset-0 yv:flex yv:flex-col yv:transition-all yv:duration-300 yv:rounded-2xl yv:origin-center ${isLanguagesOpen ? "yv:opacity-0 yv:pointer-events-none yv:blur-sm yv:scale-95" : "yv:opacity-100 yv:pointer-events-auto yv:blur-none yv:scale-100"}`,
14549
+ children: [
14550
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("section", { className: "yv:bg-muted yv:py-3 yv:w-full yv:rounded-t-2xl yv:px-4 yv:border-b yv:border-border yv:flex yv:flex-row yv:justify-between yv:items-center", children: [
14551
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "yv:flex yv:flex-col", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("h2", { className: "yv:font-bold yv:text-base yv:line-clamp-1", children: "Bible Versions" }) }),
14552
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "yv:flex yv:items-center yv:gap-2", children: [
14553
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
14554
+ Button,
14555
+ {
14556
+ "aria-label": "Select language",
14557
+ className: "yv:bg-card yv:border yv:border-transparent yv:hover:bg-card yv:hover:border-border",
14558
+ size: "sm",
14559
+ onClick: () => setIsLanguagesOpen(true),
14560
+ variant: "secondary",
14561
+ children: [
14562
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react3.Globe, { size: 16 }),
14563
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "yv:text-sm yv:font-medium yv:line-clamp-1", children: languages.find((language) => language.id === selectedLanguageId)?.englishName }),
14564
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
14565
+ Badge,
14566
+ {
14567
+ variant: "secondary",
14568
+ className: "yv:h-5 yv:min-w-5 yv:rounded-full yv:px-1 yv:font-mono yv:tabular-nums",
14569
+ children: filteredVersions.length
14570
+ }
14571
+ )
14572
+ ]
14573
+ }
14574
+ ),
14575
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(PopoverClose, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
14576
+ Button,
14577
+ {
14578
+ ref: closeRef,
14579
+ variant: "ghost",
14580
+ size: "icon",
14581
+ className: "yv:w-8 yv:h-8 yv:text-muted-foreground",
14582
+ children: [
14583
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react3.X, { size: 16 }),
14584
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "yv:sr-only", children: "Close version selector" })
14585
+ ]
14586
+ }
14587
+ ) })
14588
+ ] })
14589
+ ] }),
14590
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "yv:flex-1 yv:overflow-y-auto yv:py-2", children: filteredVersions && filteredVersions.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(ItemGroup, { children: filteredVersions.map((version2) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
14591
+ Item2,
14592
+ {
14593
+ className: cn(
14594
+ "yv:hover:bg-muted yv:rounded-[8px]",
14595
+ versionId === version2.id ? "yv:bg-muted" : ""
14596
+ ),
14597
+ size: "sm",
14598
+ variant: "default",
14599
+ role: "listitem",
14600
+ asChild: true,
14601
+ "aria-label": version2.title,
14602
+ children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
14603
+ "button",
14604
+ {
14605
+ type: "button",
14606
+ className: "yv:w-full",
14607
+ onClick: () => handleSelectVersion(version2.id),
14608
+ children: [
14609
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
14610
+ ItemMedia,
14611
+ {
14612
+ variant: "icon",
14613
+ className: "yv:rounded-[8px] yv:size-12 yv:border-border",
14614
+ children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "yv:font-serif yv:font-bold", children: version2.local_abbreviation })
14615
+ }
14616
+ ),
14617
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(ItemContent, { children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(ItemTitle, { className: "yv:line-clamp-2", children: version2.title }) })
14618
+ ]
14619
+ }
14620
+ )
14621
+ },
14622
+ version2.id
14623
+ )) }) : /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "yv:w-full yv:flex yv:items-center yv:justify-center yv:py-8 yv:text-center yv:text-muted-foreground yv:text-sm", children: "No versions found" }) }),
14624
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("section", { className: "yv:bg-muted yv:border-t yv:border-border yv:p-4 yv:w-full yv:rounded-b-2xl yv:flex yv:gap-3", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "yv:flex-1 yv:relative", children: [
14625
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
14626
+ import_lucide_react3.Search,
14627
+ {
14628
+ size: 13,
14629
+ className: "yv:absolute yv:left-3 yv:top-1/2 yv:-translate-y-1/2 yv:text-muted-foreground"
14630
+ }
14631
+ ),
14632
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
14633
+ Input,
14634
+ {
14635
+ className: "yv:rounded-3xl yv:bg-background yv:pl-9 yv:py-3 yv:border-border",
14636
+ type: "text",
14637
+ placeholder: "Search",
14638
+ value: searchQuery,
14639
+ onChange: (e) => setSearchQuery(e.target.value)
14640
+ }
14641
+ )
14642
+ ] }) })
14643
+ ]
14644
+ }
14645
+ ),
14646
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
14647
+ "div",
14648
+ {
14649
+ className: `yv:h-[66vh] yv:absolute yv:inset-0 yv:flex yv:flex-col yv:transition-all yv:duration-300 yv:rounded-2xl yv:origin-center ${isLanguagesOpen ? "yv:opacity-100 yv:pointer-events-auto yv:blur-none yv:scale-100" : "yv:opacity-0 yv:pointer-events-none yv:blur-sm yv:scale-95"}`,
14650
+ children: [
14651
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("section", { className: "yv:bg-muted yv:py-3 yv:w-full yv:rounded-t-2xl yv:px-4 yv:border-b yv:border-border yv:grid yv:grid-cols-[auto_1fr] yv:gap-2 yv:items-center", children: [
14652
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
14653
+ Button,
14654
+ {
14655
+ onClick: () => setIsLanguagesOpen(false),
14656
+ variant: "ghost",
14657
+ size: "icon",
14658
+ className: "yv:w-8 yv:h-8 yv:text-muted-foreground",
14659
+ children: [
14660
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react3.ArrowLeft, { size: 16 }),
14661
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "yv:sr-only", children: "Close Language selector" })
14662
+ ]
14663
+ }
14664
+ ),
14665
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("h2", { className: "yv:font-bold yv:text-base", children: "Select Language" })
14666
+ ] }),
14667
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(ItemGroup, { className: "yv:overflow-y-auto yv:py-2", children: languages.map((language) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
14668
+ Item2,
14669
+ {
14670
+ className: "yv:hover:bg-muted yv:rounded-[8px]",
14671
+ size: "sm",
14672
+ role: "listitem",
14673
+ "aria-label": language.englishName,
14674
+ asChild: true,
14675
+ children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("button", { className: "yv:w-full", onClick: () => handleSelectLanguage(language.id), children: [
14676
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(ItemContent, { children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(ItemTitle, { className: "yv:line-clamp-2", children: language.englishName }) }),
14677
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(ItemContent, { className: "flex-none text-center", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(ItemDescription, { children: language.name }) })
14678
+ ] })
14679
+ },
14680
+ language.id
14681
+ )) })
14682
+ ]
14683
+ }
14684
+ )
14685
+ ]
14686
+ }
14687
+ );
14688
+ }
14689
+ var BibleVersionPicker = Object.assign({}, { Root: Root4, Trigger: Trigger4, Content: Content3 });
14690
+
14691
+ // src/components/verse.tsx
14692
+ var import_react3 = __toESM(require("react"), 1);
14693
+ var import_isomorphic_dompurify = __toESM(require("isomorphic-dompurify"), 1);
14694
+ var import_platform_react_hooks3 = require("@youversion/platform-react-hooks");
14695
+ var import_jsx_runtime10 = require("react/jsx-runtime");
14696
+ var NON_BREAKING_SPACE = "\xA0";
14697
+ var DOMPURIFY_CONFIG = {
14698
+ ALLOWED_ATTR: ["class", "style", "id"],
14699
+ ALLOW_DATA_ATTR: true
14700
+ };
14701
+ function yvDomTransformer(html) {
14702
+ if (!window || !("DOMParser" in window)) {
14703
+ return html;
14704
+ }
14705
+ const sanitizedHtml = import_isomorphic_dompurify.default.sanitize(html, DOMPURIFY_CONFIG);
14706
+ const parser = new DOMParser();
14707
+ const doc = parser.parseFromString(sanitizedHtml, "text/html");
14708
+ const paragraphs = doc.querySelectorAll(".yv-vlbl");
14709
+ paragraphs.forEach((p) => {
14710
+ const text = p.textContent || "";
14711
+ if (!text.endsWith(NON_BREAKING_SPACE)) {
14712
+ p.textContent = text + NON_BREAKING_SPACE;
14713
+ }
14714
+ });
14715
+ const tables = doc.querySelectorAll("table");
14716
+ tables.forEach((table) => {
14717
+ const rows = table.querySelectorAll("tr");
14718
+ if (rows.length === 0) return;
14719
+ let maxColumns = 0;
14720
+ rows.forEach((row) => {
14721
+ const cells = row.querySelectorAll("td, th");
14722
+ let rowColumnCount = 0;
14723
+ cells.forEach((cell) => {
14724
+ if (cell instanceof HTMLTableCellElement) {
14725
+ const colspan = parseInt(cell.getAttribute("colspan") || "1", 10);
14726
+ rowColumnCount += colspan;
14727
+ } else {
14728
+ rowColumnCount += 1;
14729
+ }
14730
+ });
14731
+ maxColumns = Math.max(maxColumns, rowColumnCount);
14732
+ });
14733
+ if (maxColumns > 1) {
14734
+ rows.forEach((row) => {
14735
+ const cells = row.querySelectorAll("td, th");
14736
+ if (cells.length === 1) {
14737
+ const cell = cells[0];
14738
+ if (cell instanceof HTMLTableCellElement) {
14739
+ const existingColspan = parseInt(cell.getAttribute("colspan") || "1", 10);
14740
+ if (existingColspan < maxColumns) {
14741
+ cell.setAttribute("colspan", maxColumns.toString());
14742
+ }
14743
+ }
14744
+ }
14745
+ });
14746
+ }
14747
+ });
14748
+ const modifiedHtml = doc.body.innerHTML;
14749
+ return modifiedHtml;
14750
+ }
14751
+ var Verse = {
14752
+ /**
14753
+ * Renders a single verse with superscript number and text.
14754
+ *
14755
+ * @param props - The verse properties.
14756
+ * @param props.number - The verse number.
14757
+ * @param props.text - The verse text.
14758
+ * @param props.size - The size variant. Defaults to 'default'.
14759
+ * @returns The rendered verse element.
14760
+ */
14761
+ Text: ({ number: number4, text, size = "default" }) => {
14762
+ if (size === "lg") {
14763
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: "yv:[&>p]:inline-block", children: [
14764
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("sup", { className: "yv:text-muted-foreground yv:align-super yv:text-[0.6em]", children: number4 }),
14765
+ "\xA0",
14766
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "yv:font-serif! yv:text-xl yv:text-primary", children: text }),
14767
+ "\xA0"
14768
+ ] });
14769
+ }
14770
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: "yv:[&>p]:inline-block", children: [
14771
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("sup", { className: "yv:text-muted-foreground yv:align-super yv:text-[0.6em]", children: number4 }),
14772
+ "\xA0",
14773
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "yv:text-primary", children: text }),
14774
+ "\xA0"
14775
+ ] });
14776
+ },
14777
+ Html: ({
14778
+ html,
14779
+ fontFamily,
14780
+ fontSize,
14781
+ lineHeight,
14782
+ showVerseNumbers = true
14783
+ }) => {
14784
+ const [transformedHtml, setTransformedHtml] = import_react3.default.useState(html);
14785
+ import_react3.default.useEffect(() => {
14786
+ setTransformedHtml(yvDomTransformer(html));
14787
+ }, [html]);
14788
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
14789
+ "section",
14790
+ {
14791
+ style: {
14792
+ ...fontFamily ? { "--yv-reader-font-family": fontFamily } : {},
14793
+ ...fontSize ? { "--yv-reader-font-size": `${fontSize}px` } : {},
14794
+ ...lineHeight ? { "--yv-reader-line-height": lineHeight } : {}
14795
+ },
14796
+ "data-show-verse-numbers": showVerseNumbers,
14797
+ "data-slot": "yv-bible-renderer",
14798
+ dangerouslySetInnerHTML: { __html: transformedHtml }
14799
+ }
14800
+ );
14801
+ }
14802
+ };
14803
+ var BibleTextView = ({
14804
+ reference,
14805
+ fontFamily,
14806
+ fontSize,
14807
+ lineHeight,
14808
+ versionId,
14809
+ showVerseNumbers
14810
+ }) => {
14811
+ const { passage, loading, error: error46 } = (0, import_platform_react_hooks3.usePassage)({
14812
+ versionId,
14813
+ usfm: reference,
14814
+ include_headings: true,
14815
+ include_notes: true
14816
+ });
14817
+ if (loading) {
14818
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
14819
+ Verse.Html,
14820
+ {
14821
+ html: "<span>Loading...</span>",
14822
+ fontFamily,
14823
+ fontSize,
14824
+ lineHeight,
14825
+ showVerseNumbers
14826
+ }
14827
+ );
14828
+ }
14829
+ if (error46) {
14830
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
14831
+ Verse.Html,
14832
+ {
14833
+ html: '<span class="wj">We have run into an error...</span>',
14834
+ fontFamily,
14835
+ fontSize,
14836
+ lineHeight,
14837
+ showVerseNumbers
14838
+ }
14839
+ );
14840
+ }
14841
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
14842
+ Verse.Html,
14843
+ {
14844
+ html: passage?.content || "",
14845
+ fontFamily,
14846
+ fontSize,
14847
+ lineHeight,
14848
+ showVerseNumbers
14849
+ }
14850
+ );
14851
+ };
14852
+
14853
+ // src/components/bible-reader.tsx
14854
+ var import_jsx_runtime11 = require("react/jsx-runtime");
14855
+ var BibleReaderContext = (0, import_react4.createContext)(null);
14856
+ function useBibleReaderContext() {
14857
+ const context = (0, import_react4.useContext)(BibleReaderContext);
14858
+ if (!context) {
14859
+ throw new Error("BibleReader components must be used within BibleReader.Root");
14860
+ }
14861
+ return context;
14862
+ }
14863
+ function Root5({
14864
+ book: controlledBook,
14865
+ defaultBook = "JHN",
14866
+ onBookChange,
14867
+ chapter: controlledChapter,
14868
+ defaultChapter = "1",
14869
+ onChapterChange,
14870
+ versionId: controlledVersionId,
14871
+ defaultVersionId = 111,
14872
+ onVersionChange,
14873
+ fontFamily,
14874
+ fontSize = 16,
14875
+ lineHeight,
14876
+ showVerseNumbers = true,
14877
+ background = "light",
14878
+ children
14879
+ }) {
14880
+ const [book, setBook] = (0, import_react_use_controllable_state3.useControllableState)({
14881
+ prop: controlledBook,
14882
+ defaultProp: defaultBook,
14883
+ onChange: onBookChange
14884
+ });
14885
+ const [chapter, setChapter] = (0, import_react_use_controllable_state3.useControllableState)({
14886
+ prop: controlledChapter,
14887
+ defaultProp: defaultChapter,
14888
+ onChange: onChapterChange
14889
+ });
14890
+ const [versionId, setVersionId] = (0, import_react_use_controllable_state3.useControllableState)({
14891
+ prop: controlledVersionId,
14892
+ defaultProp: defaultVersionId,
14893
+ onChange: onVersionChange
14894
+ });
14895
+ const contextValue = {
14896
+ book,
14897
+ chapter,
14898
+ versionId,
14899
+ setBook,
14900
+ setChapter,
14901
+ setVersionId,
14902
+ fontFamily,
14903
+ fontSize,
14904
+ lineHeight,
14905
+ showVerseNumbers,
14906
+ background
14907
+ };
14908
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(BibleReaderContext.Provider, { value: contextValue, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
14909
+ "div",
14910
+ {
14911
+ "data-yv-sdk": true,
14912
+ "data-yv-theme": background === "dark" ? "dark" : "light",
14913
+ className: "yv:flex yv:flex-col yv:h-full yv:bg-background yv:text-foreground",
14914
+ children
14915
+ }
14916
+ ) });
14917
+ }
14918
+ function Content4() {
14919
+ const { book, chapter, versionId, fontFamily, fontSize, lineHeight, showVerseNumbers } = useBibleReaderContext();
14920
+ const { books } = (0, import_platform_react_hooks4.useBooks)(versionId);
14921
+ const { version: version2 } = (0, import_platform_react_hooks4.useVersion)(versionId);
14922
+ const bookData = (0, import_react4.useMemo)(() => {
14923
+ return books?.data?.find((b) => b.id === book);
14924
+ }, [books?.data, book]);
14925
+ const usfmReference = `${book}.${chapter}`;
14926
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("main", { className: "yv:*:max-w-lg yv:flex yv:flex-col yv:items-center yv:gap-6 yv:overflow-y-auto yv:px-6 yv:max-sm:px-4 yv:py-12 yv:h-full", children: [
14927
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("h1", { className: "yv:flex yv:gap-2 yv:flex-col yv:justify-center yv:items-center yv:font-serif yv:text-muted-foreground yv:font-medium", children: [
14928
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
14929
+ "span",
14930
+ {
14931
+ className: cn(
14932
+ "yv:leading-none yv:block yv:text-2xl yv:transition-[filter]",
14933
+ !bookData?.title && "yv:blur-sm"
14934
+ ),
14935
+ children: bookData?.title || "Loading..."
14936
+ }
14937
+ ),
14938
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "yv:leading-none yv:block yv:ml-2 yv:text-[2.5rem] yv:font-normal", children: chapter || "-" })
14939
+ ] }),
14940
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
14941
+ BibleTextView,
14942
+ {
14943
+ reference: usfmReference,
14944
+ versionId,
14945
+ fontFamily,
14946
+ fontSize,
14947
+ lineHeight,
14948
+ showVerseNumbers
14949
+ }
14950
+ ),
14951
+ version2?.copyright_short && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("footer", { style: { fontSize }, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { className: "yv:text-balance yv:text-[0.75em] yv:text-center yv:text-muted-foreground", children: version2.copyright_short }) })
14952
+ ] });
14953
+ }
14954
+ function Toolbar({ border = "top" }) {
14955
+ const { book, chapter, versionId, setBook, setChapter, setVersionId, background } = useBibleReaderContext();
14956
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
14957
+ "section",
14958
+ {
14959
+ className: cn(
14960
+ "yv:flex yv:justify-center yv:gap-2 yv:p-4 yv:bg-background yv:border-border",
14961
+ border === "top" && "yv:border-t",
14962
+ border === "bottom" && "yv:border-b"
14963
+ ),
14964
+ children: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "yv:grid yv:w-full yv:grid-cols-2 yv:items-center yv:max-w-lg yv:gap-1", children: [
14965
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
14966
+ BibleChapterPicker.Root,
14967
+ {
14968
+ book,
14969
+ chapter,
14970
+ onBookChange: setBook,
14971
+ onChapterChange: setChapter,
14972
+ versionId,
14973
+ background,
14974
+ children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(BibleChapterPicker.Trigger, { "aria-label": "Change Bible book and chapter", children: ({ chapter: chapter2, currentBook, loading }) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Button, { variant: "secondary", className: "yv:rounded-r-none", disabled: loading, children: loading ? "Loading..." : `${currentBook?.title || "Select"} ${chapter2 || ""}` }) })
14975
+ }
14976
+ ),
14977
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
14978
+ BibleVersionPicker.Root,
14979
+ {
14980
+ versionId,
14981
+ onVersionChange: setVersionId,
14982
+ background,
14983
+ children: [
14984
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(BibleVersionPicker.Trigger, { "aria-label": "Change Bible version", children: ({ version: version2, loading }) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Button, { variant: "secondary", className: "yv:rounded-l-none", disabled: loading, children: loading ? "Loading..." : version2?.local_abbreviation || "Select version" }) }),
14985
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(BibleVersionPicker.Content, {})
14986
+ ]
14987
+ }
14988
+ )
14989
+ ] })
14990
+ }
14991
+ );
14992
+ }
14993
+ var BibleReader = Object.assign({}, { Root: Root5, Content: Content4, Toolbar });
14994
+
14995
+ // src/components/SignInButton.tsx
14996
+ var import_react8 = __toESM(require("react"), 1);
14997
+ var import_lucide_react4 = require("lucide-react");
14998
+
14999
+ // src/providers/YVPProvider.tsx
15000
+ var import_react6 = require("react");
15001
+
15002
+ // src/providers/YVPErrorBoundary.tsx
15003
+ var import_react5 = require("react");
15004
+ var import_jsx_runtime12 = require("react/jsx-runtime");
15005
+ var YVPErrorBoundary = class extends import_react5.Component {
15006
+ constructor(props) {
15007
+ super(props);
15008
+ this.state = { hasError: false, error: null };
15009
+ }
15010
+ static getDerivedStateFromError(error46) {
15011
+ return { hasError: true, error: error46 };
15012
+ }
15013
+ componentDidCatch(error46, errorInfo) {
15014
+ const { onError } = this.props;
15015
+ if (onError) {
15016
+ onError(error46, errorInfo);
15017
+ }
15018
+ if (process.env.NODE_ENV === "development") {
15019
+ console.error("YVP Error Boundary caught error:", error46, errorInfo);
15020
+ }
15021
+ }
15022
+ render() {
15023
+ const { hasError, error: error46 } = this.state;
15024
+ const { children, fallback } = this.props;
15025
+ const isDevelopment = process.env.NODE_ENV === "development";
15026
+ if (hasError) {
15027
+ if (fallback) {
15028
+ return fallback;
15029
+ }
15030
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { style: { padding: "20px", textAlign: "center" }, children: [
15031
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("h2", { children: "Something went wrong" }),
15032
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { children: "We encountered an error while loading YouVersion Platform components." }),
15033
+ isDevelopment && error46 && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("details", { style: { marginTop: "10px" }, children: [
15034
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("summary", { children: "Error details (development only)" }),
15035
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("pre", { style: { textAlign: "left", overflow: "auto" }, children: error46.toString() })
15036
+ ] })
15037
+ ] });
15038
+ }
15039
+ return children;
15040
+ }
15041
+ };
15042
+
15043
+ // src/providers/YVPProvider.tsx
15044
+ var import_jsx_runtime13 = require("react/jsx-runtime");
15045
+ var YVPContext = (0, import_react6.createContext)(null);
15046
+ function YVPProvider({
15047
+ config: config2,
15048
+ children,
15049
+ errorFallback,
15050
+ onError,
15051
+ theme = "light"
15052
+ }) {
15053
+ const [authState, setAuthState] = (0, import_react6.useState)({
15054
+ isAuthenticated: false,
15055
+ isLoading: false,
15056
+ accessToken: null,
15057
+ result: null,
15058
+ error: null
15059
+ });
15060
+ (0, import_react6.useEffect)(() => {
15061
+ const initializeAuth = () => {
15062
+ YouVersionPlatformConfiguration.appKey = config2.appKey;
15063
+ YouVersionPlatformConfiguration.installationId = config2.installationId ?? null;
15064
+ const strategy = new WebAuthenticationStrategy({
15065
+ redirectUri: config2.redirectUri || ""
15066
+ });
15067
+ AuthenticationStrategyRegistry.register(strategy);
15068
+ const existingToken = YouVersionPlatformConfiguration.accessToken;
15069
+ if (existingToken) {
15070
+ setAuthState({
15071
+ isAuthenticated: true,
15072
+ isLoading: false,
15073
+ accessToken: existingToken,
15074
+ result: null,
15075
+ error: null
15076
+ });
15077
+ return;
15078
+ }
15079
+ WebAuthenticationStrategy.handleCallback();
15080
+ const storedCallback = WebAuthenticationStrategy.getStoredCallback();
15081
+ if (storedCallback) {
15082
+ try {
15083
+ const result = new SignInWithYouVersionResult(storedCallback);
15084
+ const { accessToken, errorMsg } = result;
15085
+ if (accessToken) {
15086
+ YouVersionPlatformConfiguration.setAccessToken(accessToken);
15087
+ }
15088
+ setAuthState({
15089
+ isAuthenticated: !!accessToken,
15090
+ isLoading: false,
15091
+ accessToken: accessToken ?? null,
15092
+ result,
15093
+ error: errorMsg ? new Error(errorMsg) : null
15094
+ });
15095
+ } catch (error46) {
15096
+ setAuthState({
15097
+ isAuthenticated: false,
15098
+ isLoading: false,
15099
+ accessToken: null,
15100
+ result: null,
15101
+ error: error46
15102
+ });
15103
+ }
15104
+ } else {
15105
+ setAuthState({
15106
+ isAuthenticated: false,
15107
+ isLoading: false,
15108
+ accessToken: null,
15109
+ result: null,
15110
+ error: null
15111
+ });
15112
+ }
15113
+ };
15114
+ initializeAuth();
15115
+ }, [config2.appKey, config2.installationId, config2.redirectUri]);
15116
+ const signOut = (0, import_react6.useCallback)(() => {
15117
+ YouVersionPlatformConfiguration.setAccessToken(null);
15118
+ setAuthState({
15119
+ isAuthenticated: false,
15120
+ isLoading: false,
15121
+ accessToken: null,
15122
+ result: null,
15123
+ error: null
15124
+ });
15125
+ }, []);
15126
+ const fetchUserInfo = (0, import_react6.useCallback)(async () => {
15127
+ if (!authState.isAuthenticated || !authState.accessToken) {
15128
+ throw new Error("User is not authenticated");
15129
+ }
15130
+ return YouVersionAPIUsers.userInfo(authState.accessToken);
15131
+ }, [authState.isAuthenticated, authState.accessToken]);
15132
+ const value = {
15133
+ config: config2,
15134
+ client: ApiClient,
15135
+ auth: authState,
15136
+ signOut,
15137
+ fetchUserInfo
15138
+ };
15139
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(YVPErrorBoundary, { fallback: errorFallback, onError, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(YVPContext.Provider, { value, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "yv:contents", "data-yv-sdk": true, "data-yv-theme": theme, children }) }) });
15140
+ }
15141
+ function useYVP() {
15142
+ const context = (0, import_react6.useContext)(YVPContext);
15143
+ if (!context) {
15144
+ throw new Error("useYVP must be used within a YVPProvider");
15145
+ }
15146
+ return context;
15147
+ }
15148
+
15149
+ // src/hooks/useAuthentication.ts
15150
+ var import_react7 = require("react");
15151
+ function useAuthentication() {
15152
+ const { auth, signOut, fetchUserInfo, client: _client } = useYVP();
15153
+ const signIn = (0, import_react7.useCallback)(
15154
+ async (requiredPermissions = [], optionalPermissions = []) => {
15155
+ return await YouVersionAPIUsers.signIn(
15156
+ new Set(requiredPermissions),
15157
+ new Set(optionalPermissions)
15158
+ );
15159
+ },
15160
+ []
15161
+ );
15162
+ return {
15163
+ auth,
15164
+ signIn,
15165
+ signOut,
15166
+ fetchUserInfo
15167
+ };
15168
+ }
15169
+
15170
+ // src/components/youversion-logo.tsx
15171
+ var React11 = require("react");
15172
+ var import_jsx_runtime14 = require("react/jsx-runtime");
15173
+ function YouVersionLogo(props) {
15174
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
15175
+ "svg",
15176
+ {
15177
+ xmlns: "http://www.w3.org/2000/svg",
15178
+ fill: "none",
15179
+ viewBox: "0 0 26 26",
15180
+ role: "img",
15181
+ "aria-label": "YouVersion",
15182
+ ...props,
15183
+ children: [
15184
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
15185
+ "mask",
15186
+ {
15187
+ id: "youversion-logo-mask",
15188
+ width: 26,
15189
+ height: 26,
15190
+ x: 0,
14473
15191
  y: 0,
14474
15192
  maskUnits: "userSpaceOnUse",
14475
15193
  style: {
14476
15194
  maskType: "alpha"
14477
15195
  },
14478
- children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
15196
+ children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
14479
15197
  "path",
14480
15198
  {
14481
15199
  fill: "url(#youversion-logo-gradient-a)",
@@ -14486,9 +15204,9 @@ function YouVersionLogo(props) {
14486
15204
  )
14487
15205
  }
14488
15206
  ),
14489
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("g", { mask: "url(#youversion-logo-mask)", children: [
14490
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("path", { fill: "url(#youversion-logo-gradient-c)", d: "M0 0h26v26H0z" }),
14491
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
15207
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("g", { mask: "url(#youversion-logo-mask)", children: [
15208
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("path", { fill: "url(#youversion-logo-gradient-c)", d: "M0 0h26v26H0z" }),
15209
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
14492
15210
  "path",
14493
15211
  {
14494
15212
  fill: "#FEF5EB",
@@ -14497,8 +15215,8 @@ function YouVersionLogo(props) {
14497
15215
  clipRule: "evenodd"
14498
15216
  }
14499
15217
  ),
14500
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("path", { fill: "#FF3D4D", d: "M4.774 20.468h4.073v3.055l-2.036-1.019-2.037 1.019v-3.055Z" }),
14501
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
15218
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("path", { fill: "#FF3D4D", d: "M4.774 20.468h4.073v3.055l-2.036-1.019-2.037 1.019v-3.055Z" }),
15219
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
14502
15220
  "path",
14503
15221
  {
14504
15222
  fill: "#FEF5EB",
@@ -14506,8 +15224,8 @@ function YouVersionLogo(props) {
14506
15224
  }
14507
15225
  )
14508
15226
  ] }),
14509
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("defs", { children: [
14510
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
15227
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("defs", { children: [
15228
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
14511
15229
  "linearGradient",
14512
15230
  {
14513
15231
  id: "youversion-logo-gradient-a",
@@ -14517,12 +15235,12 @@ function YouVersionLogo(props) {
14517
15235
  y2: 26,
14518
15236
  gradientUnits: "userSpaceOnUse",
14519
15237
  children: [
14520
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("stop", { stopColor: "#C93D34" }),
14521
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("stop", { offset: 1, stopColor: "#7A2629" })
15238
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("stop", { stopColor: "#C93D34" }),
15239
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("stop", { offset: 1, stopColor: "#7A2629" })
14522
15240
  ]
14523
15241
  }
14524
15242
  ),
14525
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
15243
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
14526
15244
  "linearGradient",
14527
15245
  {
14528
15246
  id: "youversion-logo-gradient-c",
@@ -14532,8 +15250,8 @@ function YouVersionLogo(props) {
14532
15250
  y2: 26,
14533
15251
  gradientUnits: "userSpaceOnUse",
14534
15252
  children: [
14535
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("stop", { stopColor: "#C93D34" }),
14536
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("stop", { offset: 1, stopColor: "#7A2629" })
15253
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("stop", { stopColor: "#C93D34" }),
15254
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("stop", { offset: 1, stopColor: "#7A2629" })
14537
15255
  ]
14538
15256
  }
14539
15257
  )
@@ -14544,8 +15262,8 @@ function YouVersionLogo(props) {
14544
15262
  }
14545
15263
 
14546
15264
  // src/components/SignInButton.tsx
14547
- var import_jsx_runtime10 = require("react/jsx-runtime");
14548
- var SignInButton = import_react5.default.forwardRef(
15265
+ var import_jsx_runtime15 = require("react/jsx-runtime");
15266
+ var SignInButton = import_react8.default.forwardRef(
14549
15267
  ({
14550
15268
  background = "light",
14551
15269
  className,
@@ -14561,7 +15279,7 @@ var SignInButton = import_react5.default.forwardRef(
14561
15279
  ...props
14562
15280
  }, ref) => {
14563
15281
  const { signIn, auth } = useAuthentication();
14564
- const [localLoading, setLocalLoading] = import_react5.default.useState(false);
15282
+ const [localLoading, setLocalLoading] = import_react8.default.useState(false);
14565
15283
  const handleClick = async (e) => {
14566
15284
  e.preventDefault();
14567
15285
  if (onClick) {
@@ -14586,9 +15304,9 @@ var SignInButton = import_react5.default.forwardRef(
14586
15304
  if (size === "short") {
14587
15305
  buttonCopy = "Sign in";
14588
15306
  }
14589
- const loadingSpinner = /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react3.Loader2, { className: "yv:z-20 yv:absolute yv:left-1/2 yv:top-1/2 yv:animate-spin yv:-translate-x-1/2 yv:-translate-y-1/2 yv:fill-primary-foreground yv:text-primary" });
15307
+ const loadingSpinner = /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_lucide_react4.Loader2, { className: "yv:z-20 yv:absolute yv:left-1/2 yv:top-1/2 yv:animate-spin yv:-translate-x-1/2 yv:-translate-y-1/2 yv:fill-primary-foreground yv:text-primary" });
14590
15308
  if (size === "icon") {
14591
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
15309
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
14592
15310
  Button,
14593
15311
  {
14594
15312
  ...props,
@@ -14611,13 +15329,13 @@ var SignInButton = import_react5.default.forwardRef(
14611
15329
  variant: background === "light" ? "outline" : "default",
14612
15330
  children: [
14613
15331
  buttonLoading ? loadingSpinner : null,
14614
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(YouVersionLogo, {}),
14615
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "yv:sr-only", children: buttonCopy })
15332
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(YouVersionLogo, {}),
15333
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "yv:sr-only", children: buttonCopy })
14616
15334
  ]
14617
15335
  }
14618
15336
  );
14619
15337
  }
14620
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
15338
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
14621
15339
  Button,
14622
15340
  {
14623
15341
  ...props,
@@ -14640,7 +15358,7 @@ var SignInButton = import_react5.default.forwardRef(
14640
15358
  variant: background === "light" ? "outline" : "default",
14641
15359
  children: [
14642
15360
  buttonLoading ? loadingSpinner : null,
14643
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(YouVersionLogo, {}),
15361
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(YouVersionLogo, {}),
14644
15362
  buttonCopy
14645
15363
  ]
14646
15364
  }
@@ -14650,12 +15368,12 @@ var SignInButton = import_react5.default.forwardRef(
14650
15368
  SignInButton.displayName = "SignInButton";
14651
15369
 
14652
15370
  // src/components/verse-of-the-day.tsx
14653
- var import_react8 = __toESM(require("react"), 1);
15371
+ var import_react10 = __toESM(require("react"), 1);
14654
15372
 
14655
15373
  // src/components/icons/votd.tsx
14656
- var import_react6 = require("react");
14657
- var import_jsx_runtime11 = require("react/jsx-runtime");
14658
- var SvgComponent = (props) => /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
15374
+ var import_react9 = require("react");
15375
+ var import_jsx_runtime16 = require("react/jsx-runtime");
15376
+ var SvgComponent = (props) => /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
14659
15377
  "svg",
14660
15378
  {
14661
15379
  width: "44",
@@ -14665,8 +15383,8 @@ var SvgComponent = (props) => /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
14665
15383
  fill: "none",
14666
15384
  xmlns: "http://www.w3.org/2000/svg",
14667
15385
  children: [
14668
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("title", { children: "Sun" }),
14669
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
15386
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("title", { children: "Sun" }),
15387
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
14670
15388
  "path",
14671
15389
  {
14672
15390
  fillRule: "evenodd",
@@ -14680,8 +15398,8 @@ var SvgComponent = (props) => /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
14680
15398
  );
14681
15399
 
14682
15400
  // src/components/icons/share.tsx
14683
- var import_jsx_runtime12 = require("react/jsx-runtime");
14684
- var SvgComponent2 = (props) => /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
15401
+ var import_jsx_runtime17 = require("react/jsx-runtime");
15402
+ var SvgComponent2 = (props) => /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
14685
15403
  "svg",
14686
15404
  {
14687
15405
  xmlns: "http://www.w3.org/2000/svg",
@@ -14691,14 +15409,14 @@ var SvgComponent2 = (props) => /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
14691
15409
  fill: "none",
14692
15410
  ...props,
14693
15411
  children: [
14694
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
15412
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
14695
15413
  "path",
14696
15414
  {
14697
15415
  fill: "currentColor",
14698
15416
  d: "M16.121 9.187a1 1 0 0 1-1.414 0L13 7.48V15a1 1 0 1 1-2 0V7.348L9.121 9.227a1 1 0 1 1-1.414-1.414l3.52-3.52a1 1 0 0 1 1.414 0l3.48 3.48a1 1 0 0 1 0 1.414Z"
14699
15417
  }
14700
15418
  ),
14701
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
15419
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
14702
15420
  "path",
14703
15421
  {
14704
15422
  fill: "currentColor",
@@ -14710,8 +15428,8 @@ var SvgComponent2 = (props) => /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
14710
15428
  );
14711
15429
 
14712
15430
  // src/components/bible-app-logo-lockup.tsx
14713
- var import_jsx_runtime13 = require("react/jsx-runtime");
14714
- var SvgComponent3 = (props) => /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
15431
+ var import_jsx_runtime18 = require("react/jsx-runtime");
15432
+ var SvgComponent3 = (props) => /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
14715
15433
  "svg",
14716
15434
  {
14717
15435
  xmlns: "http://www.w3.org/2000/svg",
@@ -14721,8 +15439,8 @@ var SvgComponent3 = (props) => /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
14721
15439
  fill: "none",
14722
15440
  ...props,
14723
15441
  children: [
14724
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("title", { children: "Bible App" }),
14725
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
15442
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("title", { children: "Bible App" }),
15443
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
14726
15444
  "mask",
14727
15445
  {
14728
15446
  id: "bible-app-logo-lockup-mask",
@@ -14734,7 +15452,7 @@ var SvgComponent3 = (props) => /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
14734
15452
  style: {
14735
15453
  maskType: "alpha"
14736
15454
  },
14737
- children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
15455
+ children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
14738
15456
  "path",
14739
15457
  {
14740
15458
  fill: "url(#bible-app-logo-lockup-gradient-a)",
@@ -14745,9 +15463,9 @@ var SvgComponent3 = (props) => /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
14745
15463
  )
14746
15464
  }
14747
15465
  ),
14748
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("g", { mask: "url(#bible-app-logo-lockup-mask)", children: [
14749
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("path", { fill: "url(#bible-app-logo-lockup-gradient-c)", d: "M63.562 0H80v16.438H63.562z" }),
14750
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
15466
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("g", { mask: "url(#bible-app-logo-lockup-mask)", children: [
15467
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("path", { fill: "url(#bible-app-logo-lockup-gradient-c)", d: "M63.562 0H80v16.438H63.562z" }),
15468
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
14751
15469
  "path",
14752
15470
  {
14753
15471
  fill: "#FEF5EB",
@@ -14756,18 +15474,18 @@ var SvgComponent3 = (props) => /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
14756
15474
  clipRule: "evenodd"
14757
15475
  }
14758
15476
  ),
14759
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("path", { fill: "#FF3D4D", d: "M66.58 12.94h2.575v1.932l-1.287-.644-1.288.644v-1.931Z" }),
14760
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("g", { fill: "#FEF5EB", clipPath: "url(#bible-app-logo-lockup-clip)", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("path", { d: "M70.602 5.614c.173.105.374.156.603.156.219 0 .42-.055.593-.17.178-.113.31-.273.407-.474.1-.206.146-.439.146-.694a1.57 1.57 0 0 0-.142-.694 1.05 1.05 0 0 0-.402-.452 1.135 1.135 0 0 0-.598-.156c-.219 0-.42.055-.598.17a1.15 1.15 0 0 0-.406.474 1.626 1.626 0 0 0-.142.694c0 .265.046.498.142.694.091.197.223.347.397.452Zm-.096-1.16c0-.232.027-.438.087-.616a.906.906 0 0 1 .246-.406.512.512 0 0 1 .356-.142c.133 0 .247.046.357.137.11.091.196.224.26.402.069.174.1.379.1.616 0 .233-.032.439-.09.617a.951.951 0 0 1-.248.41.516.516 0 0 1-.356.142.537.537 0 0 1-.356-.137.95.95 0 0 1-.265-.401 1.995 1.995 0 0 1-.091-.621ZM76.675 9.14a3.91 3.91 0 0 1-.014-.68l.005-.056h-.178l-.005.046a1.256 1.256 0 0 1-.073.36.324.324 0 0 1-.141.16.704.704 0 0 1-.302.05h-.25a.696.696 0 0 1-.17-.013.073.073 0 0 1-.046-.05.654.654 0 0 1-.018-.174v-.78h.178c.082 0 .142.022.183.059.041.036.069.1.082.187.014.096.019.15.023.169l.005.041H76.122l-.004-.05a8.485 8.485 0 0 1-.023-.489v-.164c0-.119.005-.228.01-.324l.004-.05H75.936l-.005.04-.01.07c-.009.077-.022.14-.036.186a.188.188 0 0 1-.073.11c-.032.027-.082.046-.155.046h-.178v-.768c0-.086.009-.141.018-.173.01-.028.023-.041.046-.046a.637.637 0 0 1 .169-.018h.287c.119 0 .201.018.251.046a.241.241 0 0 1 .105.132c.023.064.046.174.06.32l.004.045h.178l-.009-.054a2.264 2.264 0 0 1-.009-.21c0-.12.01-.252.023-.402l.005-.055h-1.832v.164l.046.005a.719.719 0 0 1 .165.023.07.07 0 0 1 .05.05c.009.032.018.087.018.173v1.708c0 .087-.01.142-.018.174a.07.07 0 0 1-.05.05.72.72 0 0 1-.165.023l-.046.004v.165h1.9v-.05ZM74.543 5.724l-.005-.055a3.91 3.91 0 0 1-.014-.717l.005-.055h-.178l-.005.046a1.678 1.678 0 0 1-.073.38.31.31 0 0 1-.146.173.693.693 0 0 1-.301.054h-.251a.695.695 0 0 1-.17-.013.072.072 0 0 1-.045-.05.653.653 0 0 1-.018-.174V3.587c0-.087.009-.142.018-.174a.072.072 0 0 1 .046-.05.82.82 0 0 1 .168-.023l.046-.004v-.164h-.982V3.34l.046.005a.72.72 0 0 1 .165.023.07.07 0 0 1 .05.05c.009.032.018.087.018.173v1.713c0 .087-.01.141-.018.173a.07.07 0 0 1-.05.05.72.72 0 0 1-.165.023l-.046.005v.164l1.904.005ZM68.762 8.034c-.091-.095-.233-.164-.411-.205a.685.685 0 0 0 .27-.2.61.61 0 0 0 .136-.389.522.522 0 0 0-.21-.434c-.137-.11-.329-.16-.57-.16l-.996-.009V6.806l.046.005a.72.72 0 0 1 .164.023.07.07 0 0 1 .05.05c.01.032.019.087.019.173v1.717c0 .087-.01.142-.019.174a.07.07 0 0 1-.05.05.72.72 0 0 1-.164.023l-.046.004v.169l1.073-.004c.178 0 .329-.028.461-.087a.705.705 0 0 0 .306-.256.666.666 0 0 0 .11-.374.555.555 0 0 0-.17-.439Zm-1.078-.977a.71.71 0 0 1 .018-.173c.01-.032.028-.046.046-.06a.349.349 0 0 1 .142-.018c.164 0 .269.041.333.11.064.073.1.187.1.356a.637.637 0 0 1-.105.383c-.059.083-.173.133-.356.133h-.182v-.73h.004Zm.662 1.818c-.096.091-.242.137-.452.137a.375.375 0 0 1-.146-.019c-.023-.009-.036-.027-.046-.054a.639.639 0 0 1-.018-.17v-.826h.242c.21 0 .352.046.434.128.087.082.132.205.132.379 0 .2-.05.338-.146.425ZM72.232 8.034s-.004 0 0 0c-.004 0-.004 0 0 0a.812.812 0 0 0-.41-.205.686.686 0 0 0 .269-.2.61.61 0 0 0 .137-.389.522.522 0 0 0-.21-.434c-.138-.11-.33-.16-.571-.16l-.996-.009V6.806l.046.005a.72.72 0 0 1 .164.023.07.07 0 0 1 .05.05c.01.032.019.087.019.173v1.717c0 .087-.01.142-.018.174a.07.07 0 0 1-.05.05.72.72 0 0 1-.165.023l-.046.004v.169l1.073-.004c.178 0 .33-.028.462-.087a.706.706 0 0 0 .305-.256.667.667 0 0 0 .11-.374.588.588 0 0 0-.169-.439Zm-.242-1.191c-.004 0-.004 0 0 0Zm-.835.214c0-.082.009-.137.018-.173.009-.032.027-.046.045-.06a.35.35 0 0 1 .142-.018c.164 0 .27.041.333.11.064.073.1.187.1.356a.637.637 0 0 1-.104.383c-.06.083-.174.133-.356.133h-.183v-.73h.004Zm.662 1.818c-.096.091-.242.137-.452.137a.36.36 0 0 1-.147-.019c-.022-.009-.036-.027-.045-.054a.634.634 0 0 1-.019-.17v-.826h.243c.21 0 .351.046.433.128.087.082.133.205.133.379 0 .2-.05.338-.146.425ZM69.2 6.637V6.806l.046.005a.72.72 0 0 1 .164.023.07.07 0 0 1 .05.05c.01.032.019.087.019.173v1.717c0 .087-.01.142-.019.174a.07.07 0 0 1-.05.05.72.72 0 0 1-.164.023l-.046.004v.169h.982V9.03l-.046-.005a.824.824 0 0 1-.169-.023.073.073 0 0 1-.046-.05.654.654 0 0 1-.018-.173V7.062c0-.087.01-.142.018-.174a.073.073 0 0 1 .046-.05.824.824 0 0 1 .17-.023l.045-.004v-.164l-.982-.01ZM68.328 5.724v-.165l-.046-.004a.823.823 0 0 1-.169-.023.072.072 0 0 1-.045-.05.648.648 0 0 1-.019-.174v-.785h1.028v.78c0 .087-.01.142-.019.174a.07.07 0 0 1-.05.05.72.72 0 0 1-.164.023l-.046.005v.164h.982V5.55l-.046-.004a.821.821 0 0 1-.169-.023.072.072 0 0 1-.045-.05.653.653 0 0 1-.019-.174V3.587c0-.087.01-.142.019-.174a.072.072 0 0 1 .045-.05.821.821 0 0 1 .17-.023l.045-.004v-.169h-.982v.164l.046.005a.719.719 0 0 1 .164.023.07.07 0 0 1 .05.05c.01.032.019.087.019.173v.767h-1.028v-.762c0-.087.01-.142.019-.174a.072.072 0 0 1 .045-.05.824.824 0 0 1 .17-.023l.045-.004v-.164h-.982V3.34l.046.005a.72.72 0 0 1 .164.023.07.07 0 0 1 .05.05c.01.032.019.087.019.173v1.713c0 .086-.01.141-.019.173a.07.07 0 0 1-.05.05.72.72 0 0 1-.164.023l-.046.005v.169h.982ZM74.465 3.372c.027.023.06.064.1.142l.699 1.287v.503c0 .086-.01.141-.018.173a.07.07 0 0 1-.05.05.72.72 0 0 1-.165.023l-.046.005v.169l.927-.005.05.005v-.165l-.045-.004a.82.82 0 0 1-.169-.023.072.072 0 0 1-.046-.05.652.652 0 0 1-.018-.174v-.616l.539-1.069a1.07 1.07 0 0 1 .132-.205.244.244 0 0 1 .11-.078l.036-.009v-.16h-.703l-.05-.004v.164h.046c.1 0 .164.018.205.041.032.018.05.046.05.096a.673.673 0 0 1-.086.274l-.402.795-.53-1.014a.195.195 0 0 1-.027-.1c0-.014.004-.023.009-.033a.047.047 0 0 1 .027-.022c.028-.019.082-.028.16-.028h.05v-.173h-.885v.178h.05c.004 0 .023.004.05.027ZM74.538 8.701c0-.119.005-.21.01-.278l.004-.055h-.178l-.005.045a1.678 1.678 0 0 1-.073.38.32.32 0 0 1-.142.173.693.693 0 0 1-.3.055h-.252a.696.696 0 0 1-.169-.014.072.072 0 0 1-.046-.05.648.648 0 0 1-.018-.174V7.066c0-.086.01-.141.018-.173a.072.072 0 0 1 .046-.05.824.824 0 0 1 .169-.023l.046-.005v-.164h-.982V6.82l.046.004a.719.719 0 0 1 .164.023.07.07 0 0 1 .05.05c.01.032.018.087.018.174v1.703c0 .087-.009.142-.018.174a.07.07 0 0 1-.05.05.72.72 0 0 1-.164.023l-.046.004v.164h1.9l-.005-.054a5.229 5.229 0 0 1-.023-.434Z" }) })
15477
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("path", { fill: "#FF3D4D", d: "M66.58 12.94h2.575v1.932l-1.287-.644-1.288.644v-1.931Z" }),
15478
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("g", { fill: "#FEF5EB", clipPath: "url(#bible-app-logo-lockup-clip)", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("path", { d: "M70.602 5.614c.173.105.374.156.603.156.219 0 .42-.055.593-.17.178-.113.31-.273.407-.474.1-.206.146-.439.146-.694a1.57 1.57 0 0 0-.142-.694 1.05 1.05 0 0 0-.402-.452 1.135 1.135 0 0 0-.598-.156c-.219 0-.42.055-.598.17a1.15 1.15 0 0 0-.406.474 1.626 1.626 0 0 0-.142.694c0 .265.046.498.142.694.091.197.223.347.397.452Zm-.096-1.16c0-.232.027-.438.087-.616a.906.906 0 0 1 .246-.406.512.512 0 0 1 .356-.142c.133 0 .247.046.357.137.11.091.196.224.26.402.069.174.1.379.1.616 0 .233-.032.439-.09.617a.951.951 0 0 1-.248.41.516.516 0 0 1-.356.142.537.537 0 0 1-.356-.137.95.95 0 0 1-.265-.401 1.995 1.995 0 0 1-.091-.621ZM76.675 9.14a3.91 3.91 0 0 1-.014-.68l.005-.056h-.178l-.005.046a1.256 1.256 0 0 1-.073.36.324.324 0 0 1-.141.16.704.704 0 0 1-.302.05h-.25a.696.696 0 0 1-.17-.013.073.073 0 0 1-.046-.05.654.654 0 0 1-.018-.174v-.78h.178c.082 0 .142.022.183.059.041.036.069.1.082.187.014.096.019.15.023.169l.005.041H76.122l-.004-.05a8.485 8.485 0 0 1-.023-.489v-.164c0-.119.005-.228.01-.324l.004-.05H75.936l-.005.04-.01.07c-.009.077-.022.14-.036.186a.188.188 0 0 1-.073.11c-.032.027-.082.046-.155.046h-.178v-.768c0-.086.009-.141.018-.173.01-.028.023-.041.046-.046a.637.637 0 0 1 .169-.018h.287c.119 0 .201.018.251.046a.241.241 0 0 1 .105.132c.023.064.046.174.06.32l.004.045h.178l-.009-.054a2.264 2.264 0 0 1-.009-.21c0-.12.01-.252.023-.402l.005-.055h-1.832v.164l.046.005a.719.719 0 0 1 .165.023.07.07 0 0 1 .05.05c.009.032.018.087.018.173v1.708c0 .087-.01.142-.018.174a.07.07 0 0 1-.05.05.72.72 0 0 1-.165.023l-.046.004v.165h1.9v-.05ZM74.543 5.724l-.005-.055a3.91 3.91 0 0 1-.014-.717l.005-.055h-.178l-.005.046a1.678 1.678 0 0 1-.073.38.31.31 0 0 1-.146.173.693.693 0 0 1-.301.054h-.251a.695.695 0 0 1-.17-.013.072.072 0 0 1-.045-.05.653.653 0 0 1-.018-.174V3.587c0-.087.009-.142.018-.174a.072.072 0 0 1 .046-.05.82.82 0 0 1 .168-.023l.046-.004v-.164h-.982V3.34l.046.005a.72.72 0 0 1 .165.023.07.07 0 0 1 .05.05c.009.032.018.087.018.173v1.713c0 .087-.01.141-.018.173a.07.07 0 0 1-.05.05.72.72 0 0 1-.165.023l-.046.005v.164l1.904.005ZM68.762 8.034c-.091-.095-.233-.164-.411-.205a.685.685 0 0 0 .27-.2.61.61 0 0 0 .136-.389.522.522 0 0 0-.21-.434c-.137-.11-.329-.16-.57-.16l-.996-.009V6.806l.046.005a.72.72 0 0 1 .164.023.07.07 0 0 1 .05.05c.01.032.019.087.019.173v1.717c0 .087-.01.142-.019.174a.07.07 0 0 1-.05.05.72.72 0 0 1-.164.023l-.046.004v.169l1.073-.004c.178 0 .329-.028.461-.087a.705.705 0 0 0 .306-.256.666.666 0 0 0 .11-.374.555.555 0 0 0-.17-.439Zm-1.078-.977a.71.71 0 0 1 .018-.173c.01-.032.028-.046.046-.06a.349.349 0 0 1 .142-.018c.164 0 .269.041.333.11.064.073.1.187.1.356a.637.637 0 0 1-.105.383c-.059.083-.173.133-.356.133h-.182v-.73h.004Zm.662 1.818c-.096.091-.242.137-.452.137a.375.375 0 0 1-.146-.019c-.023-.009-.036-.027-.046-.054a.639.639 0 0 1-.018-.17v-.826h.242c.21 0 .352.046.434.128.087.082.132.205.132.379 0 .2-.05.338-.146.425ZM72.232 8.034s-.004 0 0 0c-.004 0-.004 0 0 0a.812.812 0 0 0-.41-.205.686.686 0 0 0 .269-.2.61.61 0 0 0 .137-.389.522.522 0 0 0-.21-.434c-.138-.11-.33-.16-.571-.16l-.996-.009V6.806l.046.005a.72.72 0 0 1 .164.023.07.07 0 0 1 .05.05c.01.032.019.087.019.173v1.717c0 .087-.01.142-.018.174a.07.07 0 0 1-.05.05.72.72 0 0 1-.165.023l-.046.004v.169l1.073-.004c.178 0 .33-.028.462-.087a.706.706 0 0 0 .305-.256.667.667 0 0 0 .11-.374.588.588 0 0 0-.169-.439Zm-.242-1.191c-.004 0-.004 0 0 0Zm-.835.214c0-.082.009-.137.018-.173.009-.032.027-.046.045-.06a.35.35 0 0 1 .142-.018c.164 0 .27.041.333.11.064.073.1.187.1.356a.637.637 0 0 1-.104.383c-.06.083-.174.133-.356.133h-.183v-.73h.004Zm.662 1.818c-.096.091-.242.137-.452.137a.36.36 0 0 1-.147-.019c-.022-.009-.036-.027-.045-.054a.634.634 0 0 1-.019-.17v-.826h.243c.21 0 .351.046.433.128.087.082.133.205.133.379 0 .2-.05.338-.146.425ZM69.2 6.637V6.806l.046.005a.72.72 0 0 1 .164.023.07.07 0 0 1 .05.05c.01.032.019.087.019.173v1.717c0 .087-.01.142-.019.174a.07.07 0 0 1-.05.05.72.72 0 0 1-.164.023l-.046.004v.169h.982V9.03l-.046-.005a.824.824 0 0 1-.169-.023.073.073 0 0 1-.046-.05.654.654 0 0 1-.018-.173V7.062c0-.087.01-.142.018-.174a.073.073 0 0 1 .046-.05.824.824 0 0 1 .17-.023l.045-.004v-.164l-.982-.01ZM68.328 5.724v-.165l-.046-.004a.823.823 0 0 1-.169-.023.072.072 0 0 1-.045-.05.648.648 0 0 1-.019-.174v-.785h1.028v.78c0 .087-.01.142-.019.174a.07.07 0 0 1-.05.05.72.72 0 0 1-.164.023l-.046.005v.164h.982V5.55l-.046-.004a.821.821 0 0 1-.169-.023.072.072 0 0 1-.045-.05.653.653 0 0 1-.019-.174V3.587c0-.087.01-.142.019-.174a.072.072 0 0 1 .045-.05.821.821 0 0 1 .17-.023l.045-.004v-.169h-.982v.164l.046.005a.719.719 0 0 1 .164.023.07.07 0 0 1 .05.05c.01.032.019.087.019.173v.767h-1.028v-.762c0-.087.01-.142.019-.174a.072.072 0 0 1 .045-.05.824.824 0 0 1 .17-.023l.045-.004v-.164h-.982V3.34l.046.005a.72.72 0 0 1 .164.023.07.07 0 0 1 .05.05c.01.032.019.087.019.173v1.713c0 .086-.01.141-.019.173a.07.07 0 0 1-.05.05.72.72 0 0 1-.164.023l-.046.005v.169h.982ZM74.465 3.372c.027.023.06.064.1.142l.699 1.287v.503c0 .086-.01.141-.018.173a.07.07 0 0 1-.05.05.72.72 0 0 1-.165.023l-.046.005v.169l.927-.005.05.005v-.165l-.045-.004a.82.82 0 0 1-.169-.023.072.072 0 0 1-.046-.05.652.652 0 0 1-.018-.174v-.616l.539-1.069a1.07 1.07 0 0 1 .132-.205.244.244 0 0 1 .11-.078l.036-.009v-.16h-.703l-.05-.004v.164h.046c.1 0 .164.018.205.041.032.018.05.046.05.096a.673.673 0 0 1-.086.274l-.402.795-.53-1.014a.195.195 0 0 1-.027-.1c0-.014.004-.023.009-.033a.047.047 0 0 1 .027-.022c.028-.019.082-.028.16-.028h.05v-.173h-.885v.178h.05c.004 0 .023.004.05.027ZM74.538 8.701c0-.119.005-.21.01-.278l.004-.055h-.178l-.005.045a1.678 1.678 0 0 1-.073.38.32.32 0 0 1-.142.173.693.693 0 0 1-.3.055h-.252a.696.696 0 0 1-.169-.014.072.072 0 0 1-.046-.05.648.648 0 0 1-.018-.174V7.066c0-.086.01-.141.018-.173a.072.072 0 0 1 .046-.05.824.824 0 0 1 .169-.023l.046-.005v-.164h-.982V6.82l.046.004a.719.719 0 0 1 .164.023.07.07 0 0 1 .05.05c.01.032.018.087.018.174v1.703c0 .087-.009.142-.018.174a.07.07 0 0 1-.05.05.72.72 0 0 1-.164.023l-.046.004v.164h1.9l-.005-.054a5.229 5.229 0 0 1-.023-.434Z" }) })
14761
15479
  ] }),
14762
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
15480
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
14763
15481
  "path",
14764
15482
  {
14765
15483
  fill: "currentColor",
14766
15484
  d: "M1 2.706h3.248c.684 0 1.245.066 1.683.198.438.122.785.298 1.039.526.263.219.443.482.539.789a3.1 3.1 0 0 1 .145.96c0 .394-.088.762-.263 1.104-.176.333-.496.61-.96.829.298.131.543.28.736.447.193.167.346.346.46.54.114.183.193.38.237.59a3.206 3.206 0 0 1-.118 1.71c-.114.342-.307.64-.579.895-.272.245-.627.442-1.065.591-.438.14-.978.21-1.618.21H1V2.707ZM4.431 6.56c.622 0 1.056-.114 1.302-.342.245-.228.368-.557.368-.987 0-.447-.145-.767-.434-.96-.28-.201-.772-.302-1.473-.302H2.538v2.59h1.894Zm0 4.26c.377 0 .688-.035.933-.105.255-.07.452-.17.592-.302.15-.132.255-.29.316-.474s.092-.39.092-.618c0-.473-.136-.833-.408-1.078-.263-.254-.723-.382-1.38-.382H2.537v2.96h1.894Zm6.373-8.114v1.486H9.253V2.706h1.552Zm-.026 2.552v6.838h-1.5V5.258h1.5ZM13.976 8.9c.009.439.061.798.158 1.079.105.28.236.504.394.67.167.167.355.28.566.342.21.062.43.092.657.092.246 0 .474-.043.684-.131.21-.088.395-.224.552-.408.158-.193.28-.443.369-.75.087-.306.131-.683.131-1.13 0-.43-.048-.794-.145-1.092a2.062 2.062 0 0 0-.355-.736 1.314 1.314 0 0 0-.539-.421 1.566 1.566 0 0 0-.631-.132 2.06 2.06 0 0 0-.842.158 1.493 1.493 0 0 0-.565.447 1.9 1.9 0 0 0-.329.697c-.07.263-.105.557-.105.881V8.9Zm.013-6.194v3.446c.272-.36.583-.631.934-.816.36-.192.775-.289 1.249-.289.49 0 .916.088 1.276.263.359.176.657.421.894.737a3.2 3.2 0 0 1 .526 1.144c.123.438.184.925.184 1.46 0 .56-.07 1.07-.21 1.525-.14.447-.342.828-.605 1.144a2.768 2.768 0 0 1-.947.736c-.368.167-.78.25-1.236.25-.412 0-.794-.079-1.144-.236-.351-.158-.671-.421-.96-.79v.816h-1.447v-9.39h1.486Zm8.053 0v9.39h-1.5v-9.39h1.5Zm7.8 7.365c-.123.71-.426 1.262-.908 1.657-.482.386-1.175.578-2.078.578-1.087 0-1.916-.31-2.485-.933-.561-.632-.842-1.517-.842-2.657 0-.587.079-1.109.237-1.565.166-.456.394-.837.684-1.144a2.868 2.868 0 0 1 1.052-.71c.412-.167.863-.25 1.354-.25.526 0 .982.083 1.368.25.386.158.706.386.96.684.254.29.443.64.565 1.052.123.403.184.855.184 1.354v.658h-4.905c.018.622.176 1.127.474 1.512.298.386.75.579 1.354.579.474 0 .829-.092 1.065-.276.237-.184.395-.447.474-.79h1.446Zm-1.368-2.065c0-.561-.132-1.004-.395-1.328-.263-.325-.684-.487-1.262-.487-.553 0-.973.167-1.263.5-.29.324-.456.763-.5 1.315h3.42Zm8.715-5.3h1.578l3.577 9.39h-1.696l-.881-2.393h-3.643l-.868 2.393h-1.644l3.577-9.39Zm2.144 5.668-1.394-3.866-1.381 3.866h2.775Zm3.992-3.116h1.46v.946c.28-.377.6-.661.96-.854.367-.202.788-.303 1.262-.303.482 0 .903.088 1.262.263.36.167.658.408.894.723.246.316.426.697.54 1.145.122.438.184.929.184 1.472 0 .553-.07 1.057-.21 1.513a3.46 3.46 0 0 1-.606 1.157 2.642 2.642 0 0 1-.933.736c-.368.167-.785.25-1.25.25-.368 0-.727-.07-1.078-.21-.35-.14-.68-.399-.986-.776v3.327h-1.5v-9.39Zm1.485 3.537c0 .447.049.82.145 1.118.097.29.224.522.382.697.166.175.355.298.565.368.22.07.447.105.684.105.245 0 .473-.043.684-.131.21-.088.394-.228.552-.421.158-.193.28-.443.368-.75.088-.306.132-.679.132-1.117 0-.447-.048-.82-.145-1.118a1.933 1.933 0 0 0-.368-.737 1.229 1.229 0 0 0-.526-.407 1.718 1.718 0 0 0-.631-.119c-.535 0-.978.176-1.329.526-.342.351-.513.903-.513 1.657v.33Zm6.541-3.537h1.46v.946c.28-.377.6-.661.96-.854a2.585 2.585 0 0 1 1.262-.303c.482 0 .903.088 1.263.263.36.167.657.408.894.723.245.316.425.697.54 1.145.122.438.183.929.183 1.472 0 .553-.07 1.057-.21 1.513a3.46 3.46 0 0 1-.605 1.157 2.642 2.642 0 0 1-.934.736c-.368.167-.784.25-1.25.25a2.88 2.88 0 0 1-1.078-.21c-.35-.14-.679-.399-.986-.776v3.327h-1.499v-9.39Zm1.486 3.537c0 .447.048.82.145 1.118.096.29.223.522.381.697.167.175.355.298.566.368.219.07.447.105.683.105.246 0 .474-.043.684-.131a1.41 1.41 0 0 0 .553-.421c.157-.193.28-.443.368-.75.087-.306.131-.679.131-1.117 0-.447-.048-.82-.144-1.118a1.933 1.933 0 0 0-.369-.737 1.228 1.228 0 0 0-.526-.407 1.717 1.717 0 0 0-.63-.119c-.536 0-.978.176-1.329.526-.342.351-.513.903-.513 1.657v.33Z"
14767
15485
  }
14768
15486
  ),
14769
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("defs", { children: [
14770
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
15487
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("defs", { children: [
15488
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
14771
15489
  "linearGradient",
14772
15490
  {
14773
15491
  id: "bible-app-logo-lockup-gradient-a",
@@ -14777,12 +15495,12 @@ var SvgComponent3 = (props) => /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
14777
15495
  y2: 16.438,
14778
15496
  gradientUnits: "userSpaceOnUse",
14779
15497
  children: [
14780
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("stop", { stopColor: "#C93D34" }),
14781
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("stop", { offset: 1, stopColor: "#7A2629" })
15498
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("stop", { stopColor: "#C93D34" }),
15499
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("stop", { offset: 1, stopColor: "#7A2629" })
14782
15500
  ]
14783
15501
  }
14784
15502
  ),
14785
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
15503
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
14786
15504
  "linearGradient",
14787
15505
  {
14788
15506
  id: "bible-app-logo-lockup-gradient-c",
@@ -14792,182 +15510,20 @@ var SvgComponent3 = (props) => /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
14792
15510
  y2: 16.438,
14793
15511
  gradientUnits: "userSpaceOnUse",
14794
15512
  children: [
14795
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("stop", { stopColor: "#C93D34" }),
14796
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("stop", { offset: 1, stopColor: "#7A2629" })
15513
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("stop", { stopColor: "#C93D34" }),
15514
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("stop", { offset: 1, stopColor: "#7A2629" })
14797
15515
  ]
14798
15516
  }
14799
15517
  ),
14800
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("clipPath", { id: "bible-app-logo-lockup-clip", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("path", { fill: "#fff", d: "M65.52 2.472h12.521V9.68h-12.52z" }) })
15518
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("clipPath", { id: "bible-app-logo-lockup-clip", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("path", { fill: "#fff", d: "M65.52 2.472h12.521V9.68h-12.52z" }) })
14801
15519
  ] })
14802
15520
  ]
14803
15521
  }
14804
15522
  );
14805
15523
 
14806
- // src/components/verse.tsx
14807
- var import_react7 = __toESM(require("react"), 1);
14808
- var import_isomorphic_dompurify = __toESM(require("isomorphic-dompurify"), 1);
14809
- var import_platform_react_hooks2 = require("@youversion/platform-react-hooks");
14810
- var import_jsx_runtime14 = require("react/jsx-runtime");
14811
- var NON_BREAKING_SPACE = "\xA0";
14812
- var DOMPURIFY_CONFIG = {
14813
- ALLOWED_ATTR: ["class", "style", "id"],
14814
- ALLOW_DATA_ATTR: true
14815
- };
14816
- function yvDomTransformer(html) {
14817
- if (!window || !("DOMParser" in window)) {
14818
- return html;
14819
- }
14820
- const sanitizedHtml = import_isomorphic_dompurify.default.sanitize(html, DOMPURIFY_CONFIG);
14821
- const parser = new DOMParser();
14822
- const doc = parser.parseFromString(sanitizedHtml, "text/html");
14823
- const paragraphs = doc.querySelectorAll(".yv-vlbl");
14824
- paragraphs.forEach((p) => {
14825
- const text = p.textContent || "";
14826
- if (!text.endsWith(NON_BREAKING_SPACE)) {
14827
- p.textContent = text + NON_BREAKING_SPACE;
14828
- }
14829
- });
14830
- const tables = doc.querySelectorAll("table");
14831
- tables.forEach((table) => {
14832
- const rows = table.querySelectorAll("tr");
14833
- if (rows.length === 0) return;
14834
- let maxColumns = 0;
14835
- rows.forEach((row) => {
14836
- const cells = row.querySelectorAll("td, th");
14837
- let rowColumnCount = 0;
14838
- cells.forEach((cell) => {
14839
- if (cell instanceof HTMLTableCellElement) {
14840
- const colspan = parseInt(cell.getAttribute("colspan") || "1", 10);
14841
- rowColumnCount += colspan;
14842
- } else {
14843
- rowColumnCount += 1;
14844
- }
14845
- });
14846
- maxColumns = Math.max(maxColumns, rowColumnCount);
14847
- });
14848
- if (maxColumns > 1) {
14849
- rows.forEach((row) => {
14850
- const cells = row.querySelectorAll("td, th");
14851
- if (cells.length === 1) {
14852
- const cell = cells[0];
14853
- if (cell instanceof HTMLTableCellElement) {
14854
- const existingColspan = parseInt(cell.getAttribute("colspan") || "1", 10);
14855
- if (existingColspan < maxColumns) {
14856
- cell.setAttribute("colspan", maxColumns.toString());
14857
- }
14858
- }
14859
- }
14860
- });
14861
- }
14862
- });
14863
- const modifiedHtml = doc.body.innerHTML;
14864
- return modifiedHtml;
14865
- }
14866
- var Verse = {
14867
- /**
14868
- * Renders a single verse with superscript number and text.
14869
- *
14870
- * @param props - The verse properties.
14871
- * @param props.number - The verse number.
14872
- * @param props.text - The verse text.
14873
- * @param props.size - The size variant. Defaults to 'default'.
14874
- * @returns The rendered verse element.
14875
- */
14876
- Text: ({ number: number4, text, size = "default" }) => {
14877
- if (size === "lg") {
14878
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { className: "yv:[&>p]:inline-block", children: [
14879
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("sup", { className: "yv:text-muted-foreground yv:align-super yv:text-[0.6em]", children: number4 }),
14880
- "\xA0",
14881
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "yv:font-serif! yv:text-xl yv:text-primary", children: text }),
14882
- "\xA0"
14883
- ] });
14884
- }
14885
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { className: "yv:[&>p]:inline-block", children: [
14886
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("sup", { className: "yv:text-muted-foreground yv:align-super yv:text-[0.6em]", children: number4 }),
14887
- "\xA0",
14888
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "yv:text-primary", children: text }),
14889
- "\xA0"
14890
- ] });
14891
- },
14892
- Html: ({
14893
- html,
14894
- fontFamily,
14895
- fontSize,
14896
- lineHeight,
14897
- showVerseNumbers = true
14898
- }) => {
14899
- const [transformedHtml, setTransformedHtml] = import_react7.default.useState(html);
14900
- import_react7.default.useEffect(() => {
14901
- setTransformedHtml(yvDomTransformer(html));
14902
- }, [html]);
14903
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
14904
- "section",
14905
- {
14906
- style: {
14907
- ...fontFamily ? { "--yv-reader-font-family": fontFamily } : {},
14908
- ...fontSize ? { "--yv-reader-font-size": `${fontSize}px` } : {},
14909
- ...lineHeight ? { "--yv-reader-line-height": lineHeight } : {}
14910
- },
14911
- "data-show-verse-numbers": showVerseNumbers,
14912
- "data-slot": "yv-bible-renderer",
14913
- dangerouslySetInnerHTML: { __html: transformedHtml }
14914
- }
14915
- );
14916
- }
14917
- };
14918
- var BibleTextView = ({
14919
- reference,
14920
- fontFamily,
14921
- fontSize,
14922
- lineHeight,
14923
- versionId,
14924
- showVerseNumbers
14925
- }) => {
14926
- const { passage, loading, error: error46 } = (0, import_platform_react_hooks2.usePassage)({
14927
- versionId,
14928
- usfm: reference,
14929
- include_headings: true,
14930
- include_notes: true
14931
- });
14932
- if (loading) {
14933
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
14934
- Verse.Html,
14935
- {
14936
- html: "<span>Loading...</span>",
14937
- fontFamily,
14938
- fontSize,
14939
- lineHeight,
14940
- showVerseNumbers
14941
- }
14942
- );
14943
- }
14944
- if (error46) {
14945
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
14946
- Verse.Html,
14947
- {
14948
- html: '<span class="wj">We have run into an error...</span>',
14949
- fontFamily,
14950
- fontSize,
14951
- lineHeight,
14952
- showVerseNumbers
14953
- }
14954
- );
14955
- }
14956
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
14957
- Verse.Html,
14958
- {
14959
- html: passage?.content || "",
14960
- fontFamily,
14961
- fontSize,
14962
- lineHeight,
14963
- showVerseNumbers
14964
- }
14965
- );
14966
- };
14967
-
14968
15524
  // src/components/verse-of-the-day.tsx
14969
- var import_platform_react_hooks3 = require("@youversion/platform-react-hooks");
14970
- var import_jsx_runtime15 = require("react/jsx-runtime");
15525
+ var import_platform_react_hooks5 = require("@youversion/platform-react-hooks");
15526
+ var import_jsx_runtime19 = require("react/jsx-runtime");
14971
15527
  function VerseOfTheDay({
14972
15528
  dayOfYear,
14973
15529
  versionId = 1,
@@ -14978,20 +15534,20 @@ function VerseOfTheDay({
14978
15534
  showBibleAppAttribution = true,
14979
15535
  size = "default"
14980
15536
  }) {
14981
- const day = import_react8.default.useMemo(
14982
- () => dayOfYear || (0, import_platform_react_hooks3.getDayOfYear)(/* @__PURE__ */ new Date()),
15537
+ const day = import_react10.default.useMemo(
15538
+ () => dayOfYear || (0, import_platform_react_hooks5.getDayOfYear)(/* @__PURE__ */ new Date()),
14983
15539
  [dayOfYear]
14984
15540
  );
14985
15541
  const {
14986
15542
  data,
14987
15543
  loading: loadingVerseOfTheDay,
14988
15544
  error: errorVerseOfTheDay
14989
- } = (0, import_platform_react_hooks3.useVerseOfTheDay)(day);
15545
+ } = (0, import_platform_react_hooks5.useVerseOfTheDay)(day);
14990
15546
  const {
14991
15547
  passage,
14992
15548
  loading: loadingPassage,
14993
15549
  error: errorPassage
14994
- } = (0, import_platform_react_hooks3.usePassage)({
15550
+ } = (0, import_platform_react_hooks5.usePassage)({
14995
15551
  versionId,
14996
15552
  usfm: data?.passage_id || "",
14997
15553
  options: {
@@ -15008,34 +15564,34 @@ function VerseOfTheDay({
15008
15564
  } else {
15009
15565
  referenceText = "No verse found";
15010
15566
  }
15011
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
15567
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
15012
15568
  "section",
15013
15569
  {
15014
15570
  "data-size": size,
15015
15571
  className: "yv:data-[size=lg]:p-8 yv:data-[size=default]:p-4 yv:*:shrink-0 yv:font-sans yv:flex yv:flex-col yv:gap-3 yv:max-w-screen-sm yv:p-4 yv:shadow yv:rounded-2xl",
15016
15572
  children: [
15017
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "yv:flex yv:items-center yv:gap-2", children: [
15018
- showSunIcon ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
15573
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "yv:flex yv:items-center yv:gap-2", children: [
15574
+ showSunIcon ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
15019
15575
  "div",
15020
15576
  {
15021
15577
  "data-slot": "card-icon",
15022
15578
  className: "yv:col-start-1 yv:row-start-1 yv:self-start yv:justify-self-start",
15023
- children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(SvgComponent, { className: "yv:shrink-0 yv:h-10 yv:w-10" })
15579
+ children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(SvgComponent, { className: "yv:shrink-0 yv:h-10 yv:w-10" })
15024
15580
  }
15025
15581
  ) : null,
15026
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "yv:grow yv:grid", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
15582
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "yv:grow yv:grid", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
15027
15583
  "p",
15028
15584
  {
15029
15585
  className: "trim-both yv:line-clamp-1 yv:text-muted-foreground yv:uppercase yv:text-xs yv:font-medium yv:select-none",
15030
15586
  children: "Verse of The Day"
15031
15587
  }
15032
15588
  ) }),
15033
- showShareButton ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
15589
+ showShareButton ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
15034
15590
  "div",
15035
15591
  {
15036
15592
  "data-slot": "card-action",
15037
15593
  className: "yv:col-start-2 yv:row-span-2 yv:row-start-1 yv:self-start yv:justify-self-end",
15038
- children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
15594
+ children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
15039
15595
  Button,
15040
15596
  {
15041
15597
  "aria-label": "Share",
@@ -15045,13 +15601,13 @@ function VerseOfTheDay({
15045
15601
  onClick: () => alert("Share: To be implemented..."),
15046
15602
  size: "icon",
15047
15603
  variant: "ghost",
15048
- children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(SvgComponent2, { className: "yv:h-6! yv:w-6!" })
15604
+ children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(SvgComponent2, { className: "yv:h-6! yv:w-6!" })
15049
15605
  }
15050
15606
  )
15051
15607
  }
15052
15608
  ) : null
15053
15609
  ] }),
15054
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { children: passage ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
15610
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { children: passage ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
15055
15611
  Verse.Html,
15056
15612
  {
15057
15613
  fontSize: size === "default" ? 16 : 20,
@@ -15059,13 +15615,13 @@ function VerseOfTheDay({
15059
15615
  html: passage?.content || ""
15060
15616
  }
15061
15617
  ) : null }),
15062
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { className: "yv:text-(--yv-gray-30) yv:font-medium yv:text-sm", children: referenceText }),
15063
- showReadFullChapterButton || showBibleAppAttribution ? /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
15618
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { className: "yv:text-(--yv-gray-30) yv:font-medium yv:text-sm", children: referenceText }),
15619
+ showReadFullChapterButton || showBibleAppAttribution ? /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
15064
15620
  "div",
15065
15621
  {
15066
15622
  className: 'yv:grid yv:grid-cols-1 yv:[:has([data-slot="card-action"]):has([data-slot="attribution"])]:grid-cols-2 yv:mt-4 yv:justify-between yv:items-center yv:gap-2 yv:w-full',
15067
15623
  children: [
15068
- showReadFullChapterButton ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
15624
+ showReadFullChapterButton ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
15069
15625
  Button,
15070
15626
  {
15071
15627
  "data-slot": "card-action",
@@ -15075,7 +15631,7 @@ function VerseOfTheDay({
15075
15631
  children: "Read Full Chapter"
15076
15632
  }
15077
15633
  ) : null,
15078
- showBibleAppAttribution ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
15634
+ showBibleAppAttribution ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
15079
15635
  SvgComponent3,
15080
15636
  {
15081
15637
  "data-slot": "attribution",
@@ -15091,7 +15647,7 @@ function VerseOfTheDay({
15091
15647
  }
15092
15648
 
15093
15649
  // src/index.ts
15094
- var import_platform_react_hooks4 = require("@youversion/platform-react-hooks");
15650
+ var import_platform_react_hooks6 = require("@youversion/platform-react-hooks");
15095
15651
  // Annotate the CommonJS export names for ESM import in node:
15096
15652
  0 && (module.exports = {
15097
15653
  ApiClient,
@@ -15101,8 +15657,10 @@ var import_platform_react_hooks4 = require("@youversion/platform-react-hooks");
15101
15657
  BOOK_IDS,
15102
15658
  BibleChapterPicker,
15103
15659
  BibleClient,
15660
+ BibleReader,
15104
15661
  BibleSDKProvider,
15105
15662
  BibleTextView,
15663
+ BibleVersionPicker,
15106
15664
  HighlightsClient,
15107
15665
  LanguagesClient,
15108
15666
  MemoryStorageStrategy,