@plasmicapp/loader-react 1.0.340 → 1.0.342

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.
@@ -22,6 +22,18 @@ var __spreadValues = (a, b) => {
22
22
  return a;
23
23
  };
24
24
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
25
+ var __objRest = (source, exclude) => {
26
+ var target = {};
27
+ for (var prop in source)
28
+ if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
29
+ target[prop] = source[prop];
30
+ if (source != null && __getOwnPropSymbols)
31
+ for (var prop of __getOwnPropSymbols(source)) {
32
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
33
+ target[prop] = source[prop];
34
+ }
35
+ return target;
36
+ };
25
37
  var __export = (target, all) => {
26
38
  for (var name in all)
27
39
  __defProp(target, name, { get: all[name], enumerable: true });
@@ -67,14 +79,27 @@ var __async = (__this, __arguments, generator) => {
67
79
  // src/react-server.ts
68
80
  var react_server_exports = {};
69
81
  __export(react_server_exports, {
70
- ReactServerPlasmicComponentLoader: () => ReactServerPlasmicComponentLoader,
82
+ InternalPlasmicComponentLoader: () => InternalPrepassPlasmicLoader,
83
+ PlasmicComponentLoader: () => PlasmicComponentLoader,
84
+ __EXPERMIENTAL__extractPlasmicQueryData: () => extractPlasmicQueryData,
71
85
  convertBundlesToComponentRenderData: () => convertBundlesToComponentRenderData,
72
86
  initPlasmicLoader: () => initPlasmicLoader,
73
87
  matchesPagePath: () => matchesPagePath
74
88
  });
75
89
  module.exports = __toCommonJS(react_server_exports);
76
90
  var import_server_only = require("server-only");
91
+
92
+ // src/loader-server.tsx
93
+ var import_loader_core3 = require("@plasmicapp/loader-core");
94
+ var import_react = __toESM(require("react"));
95
+ var import_react_dom = __toESM(require("react-dom"));
96
+ var jsxDevRuntime = __toESM(require("react/jsx-dev-runtime"));
97
+ var jsxRuntime = __toESM(require("react/jsx-runtime"));
98
+
99
+ // src/loader-shared.ts
77
100
  var import_loader_core2 = require("@plasmicapp/loader-core");
101
+ var import_loader_fetcher = require("@plasmicapp/loader-fetcher");
102
+ var import_loader_splits = require("@plasmicapp/loader-splits");
78
103
 
79
104
  // src/bundles.ts
80
105
  var import_loader_core = require("@plasmicapp/loader-core");
@@ -146,7 +171,7 @@ function prepComponentData(bundle, compMetas, opts) {
146
171
  };
147
172
  }
148
173
  function mergeBundles(target, from) {
149
- var _a;
174
+ var _a2;
150
175
  const existingCompIds = new Set(target.components.map((c) => c.id));
151
176
  const newCompMetas = from.components.filter(
152
177
  (m) => !existingCompIds.has(m.id)
@@ -196,7 +221,7 @@ function mergeBundles(target, from) {
196
221
  target = __spreadProps(__spreadValues({}, target), { external: [...target.external, ...newExternals] });
197
222
  }
198
223
  const existingSplitIds = new Set(target.activeSplits.map((s) => s.id));
199
- const newSplits = (_a = from.activeSplits.filter((s) => !existingSplitIds.has(s.id))) != null ? _a : [];
224
+ const newSplits = (_a2 = from.activeSplits.filter((s) => !existingSplitIds.has(s.id))) != null ? _a2 : [];
200
225
  if (newSplits.length > 0) {
201
226
  target = __spreadProps(__spreadValues({}, target), {
202
227
  activeSplits: [...target.activeSplits, ...newSplits]
@@ -305,10 +330,157 @@ function getLookupSpecName(lookup) {
305
330
  return lookup.name;
306
331
  }
307
332
  }
333
+ function uniq(elements) {
334
+ return Array.from(new Set(elements));
335
+ }
308
336
 
309
- // src/loader-react-server.ts
310
- var ReactServerPlasmicComponentLoader = class {
337
+ // src/component-lookup.ts
338
+ function getFirstCompMeta(metas, lookup) {
339
+ const filtered = getCompMetas(metas, lookup);
340
+ return filtered.length === 0 ? void 0 : filtered[0];
341
+ }
342
+ var ComponentLookup = class {
343
+ constructor(bundle, registry) {
344
+ this.bundle = bundle;
345
+ this.registry = registry;
346
+ }
347
+ getComponentMeta(spec) {
348
+ const compMeta = getFirstCompMeta(this.bundle.components, spec);
349
+ return compMeta;
350
+ }
351
+ getComponent(spec, opts = {}) {
352
+ const compMeta = getFirstCompMeta(this.bundle.components, spec);
353
+ if (!compMeta) {
354
+ throw new Error(`Component not found: ${spec}`);
355
+ }
356
+ const moduleName = compMeta.entry;
357
+ if (!this.registry.hasModule(moduleName, opts)) {
358
+ throw new Error(`Component not yet fetched: ${compMeta.name}`);
359
+ }
360
+ const entry = this.registry.load(moduleName, {
361
+ forceOriginal: opts.forceOriginal
362
+ });
363
+ return !opts.forceOriginal && typeof (entry == null ? void 0 : entry.getPlasmicComponent) === "function" ? entry.getPlasmicComponent() : entry.default;
364
+ }
365
+ hasComponent(spec) {
366
+ const compMeta = getFirstCompMeta(this.bundle.components, spec);
367
+ if (compMeta) {
368
+ return this.registry.hasModule(compMeta.entry);
369
+ }
370
+ return false;
371
+ }
372
+ getGlobalContexts() {
373
+ const customGlobalMetas = this.bundle.globalGroups.filter(
374
+ (m) => m.type === "global-user-defined"
375
+ );
376
+ return customGlobalMetas.map((meta) => ({
377
+ meta,
378
+ context: this.registry.load(meta.contextFile).default
379
+ }));
380
+ }
381
+ getGlobalContextsProvider(spec) {
382
+ const compMeta = getFirstCompMeta(this.bundle.components, spec);
383
+ const projectMeta = compMeta ? this.bundle.projects.find((x) => x.id === compMeta.projectId) : void 0;
384
+ if (!projectMeta || !projectMeta.globalContextsProviderFileName || !this.registry.hasModule(projectMeta.globalContextsProviderFileName)) {
385
+ return void 0;
386
+ }
387
+ const entry = this.registry.load(
388
+ projectMeta.globalContextsProviderFileName
389
+ );
390
+ return typeof (entry == null ? void 0 : entry.getPlasmicComponent) === "function" ? entry.getPlasmicComponent() : entry.default;
391
+ }
392
+ getRootProvider() {
393
+ const entry = this.registry.load("root-provider.js");
394
+ return entry.default;
395
+ }
396
+ getCss() {
397
+ return this.bundle.modules.browser.filter(
398
+ (mod) => mod.type === "asset" && mod.fileName.endsWith("css")
399
+ );
400
+ }
401
+ getRemoteFonts() {
402
+ return this.bundle.projects.flatMap((p) => p.remoteFonts);
403
+ }
404
+ };
405
+
406
+ // src/variation.ts
407
+ function getPlasmicCookieValues() {
408
+ return Object.fromEntries(
409
+ document.cookie.split("; ").filter((cookie) => cookie.includes("plasmic:")).map((cookie) => cookie.split("=")).map(([key, value]) => [key.split(":")[1], value])
410
+ );
411
+ }
412
+ function updatePlasmicCookieValue(key, value) {
413
+ document.cookie = `plasmic:${key}=${value}`;
414
+ }
415
+ var getGlobalVariantsFromSplits = (splits, variation) => {
416
+ const globalVariants = [];
417
+ Object.keys(variation).map((variationKey) => {
418
+ const [_type, splitId] = variationKey.split(".");
419
+ const sliceId = variation[variationKey];
420
+ const split = splits.find(
421
+ (s) => s.id === splitId || s.externalId === splitId
422
+ );
423
+ if (split) {
424
+ const slice = split.slices.find((s) => s.id === sliceId || s.externalId === sliceId);
425
+ if (slice) {
426
+ slice.contents.map((x) => {
427
+ globalVariants.push({
428
+ name: x.group,
429
+ value: x.variant,
430
+ projectId: x.projectId
431
+ });
432
+ });
433
+ }
434
+ }
435
+ });
436
+ return globalVariants;
437
+ };
438
+ var mergeGlobalVariantsSpec = (target, from) => {
439
+ let result = [...target];
440
+ const existingGlobalVariants = new Set(
441
+ target.map((t) => {
442
+ var _a2;
443
+ return `${t.name}-${(_a2 = t.projectId) != null ? _a2 : ""}`;
444
+ })
445
+ );
446
+ const newGlobals = from.filter(
447
+ (t) => {
448
+ var _a2;
449
+ return !existingGlobalVariants.has(`${t.name}-${(_a2 = t.projectId) != null ? _a2 : ""}`);
450
+ }
451
+ );
452
+ if (newGlobals.length > 0) {
453
+ result = [...result, ...newGlobals];
454
+ }
455
+ return result;
456
+ };
457
+
458
+ // src/loader-shared.ts
459
+ var SUBSTITUTED_COMPONENTS = {};
460
+ var REGISTERED_CODE_COMPONENT_HELPERS = {};
461
+ var SUBSTITUTED_GLOBAL_VARIANT_HOOKS = {};
462
+ var REGISTERED_CUSTOM_FUNCTIONS = {};
463
+ function customFunctionImportAlias(meta) {
464
+ const customFunctionPrefix = `__fn_`;
465
+ return meta.namespace ? `${customFunctionPrefix}${meta.namespace}__${meta.name}` : `${customFunctionPrefix}${meta.name}`;
466
+ }
467
+ function parseFetchComponentDataArgs(...args) {
468
+ let specs;
469
+ let opts;
470
+ if (Array.isArray(args[0])) {
471
+ specs = args[0];
472
+ opts = args[1];
473
+ } else {
474
+ specs = args;
475
+ opts = void 0;
476
+ }
477
+ return { specs, opts };
478
+ }
479
+ var BaseInternalPlasmicComponentLoader = class {
311
480
  constructor(args) {
481
+ this.registry = new import_loader_core2.Registry();
482
+ this.globalVariants = [];
483
+ this.subs = [];
312
484
  this.bundle = {
313
485
  modules: {
314
486
  browser: [],
@@ -327,6 +499,7 @@ var ReactServerPlasmicComponentLoader = class {
327
499
  this.tracker = args.tracker;
328
500
  this.onBundleMerged = args.onBundleMerged;
329
501
  this.onBundleFetched = args.onBundleFetched;
502
+ this.registerModules(args.builtinModules);
330
503
  }
331
504
  maybeGetCompMetas(...specs) {
332
505
  const found = /* @__PURE__ */ new Set();
@@ -421,18 +594,18 @@ var ReactServerPlasmicComponentLoader = class {
421
594
  }
422
595
  fetchAllData() {
423
596
  return __async(this, null, function* () {
424
- var _a;
597
+ var _a2;
425
598
  const bundle = yield this.fetcher.fetchAllData();
426
599
  this.tracker.trackFetch();
427
600
  this.mergeBundle(bundle);
428
- (_a = this.onBundleFetched) == null ? void 0 : _a.call(this);
601
+ (_a2 = this.onBundleFetched) == null ? void 0 : _a2.call(this);
429
602
  return bundle;
430
603
  });
431
604
  }
432
605
  mergeBundle(bundle) {
433
- var _a, _b;
606
+ var _a2, _b;
434
607
  this.bundle = bundle;
435
- this.bundle.bundleKey = (_a = this.bundle.bundleKey) != null ? _a : null;
608
+ this.bundle.bundleKey = (_a2 = this.bundle.bundleKey) != null ? _a2 : null;
436
609
  (_b = this.onBundleMerged) == null ? void 0 : _b.call(this);
437
610
  }
438
611
  getBundle() {
@@ -452,31 +625,861 @@ var ReactServerPlasmicComponentLoader = class {
452
625
  bundleKey: null,
453
626
  deferChunksByDefault: false
454
627
  };
628
+ this.registry.clear();
629
+ }
630
+ registerModules(modules) {
631
+ if (Object.keys(modules).some(
632
+ (name) => this.registry.getRegisteredModule(name) !== modules[name]
633
+ )) {
634
+ if (!this.registry.isEmpty()) {
635
+ console.warn(
636
+ "Calling PlasmicComponentLoader.registerModules() after Plasmic component has rendered; starting over."
637
+ );
638
+ this.registry.clear();
639
+ }
640
+ for (const key of Object.keys(modules)) {
641
+ this.registry.register(key, modules[key]);
642
+ }
643
+ }
644
+ }
645
+ substituteComponent(component, name) {
646
+ this.internalSubstituteComponent(component, name, void 0);
647
+ }
648
+ internalSubstituteComponent(component, name, codeComponentHelpers) {
649
+ if (!this.isRegistryEmpty()) {
650
+ console.warn(
651
+ "Calling PlasmicComponentLoader.registerSubstitution() after Plasmic component has rendered; starting over."
652
+ );
653
+ this.clearRegistry();
654
+ }
655
+ this.subs.push({ lookup: name, component, codeComponentHelpers });
656
+ }
657
+ refreshRegistry() {
658
+ for (const sub of this.subs) {
659
+ const metas = getCompMetas(this.getBundle().components, sub.lookup);
660
+ metas.forEach((meta) => {
661
+ SUBSTITUTED_COMPONENTS[meta.id] = sub.component;
662
+ if (sub.codeComponentHelpers) {
663
+ REGISTERED_CODE_COMPONENT_HELPERS[meta.id] = sub.codeComponentHelpers;
664
+ }
665
+ });
666
+ }
667
+ this.registry.updateModules(this.getBundle());
668
+ }
669
+ isRegistryEmpty() {
670
+ return this.registry.isEmpty();
671
+ }
672
+ clearRegistry() {
673
+ this.registry.clear();
674
+ }
675
+ setGlobalVariants(globalVariants) {
676
+ this.globalVariants = globalVariants;
677
+ }
678
+ getGlobalVariants() {
679
+ return this.globalVariants;
680
+ }
681
+ registerPrefetchedBundle(bundle) {
682
+ if (!isBrowser) {
683
+ const cachedBundle = (0, import_loader_fetcher.internal_getCachedBundleInNodeServer)(this.opts);
684
+ if (cachedBundle) {
685
+ this.mergeBundle(cachedBundle);
686
+ }
687
+ }
688
+ this.mergeBundle(bundle);
689
+ }
690
+ getLookup() {
691
+ return new ComponentLookup(this.getBundle(), this.registry);
692
+ }
693
+ trackConversion(value = 0) {
694
+ this.tracker.trackConversion(value);
695
+ }
696
+ getActiveVariation(opts) {
697
+ return __async(this, null, function* () {
698
+ yield this.fetchComponents();
699
+ return (0, import_loader_splits.getActiveVariation)(__spreadProps(__spreadValues({}, opts), {
700
+ splits: this.getBundle().activeSplits
701
+ }));
702
+ });
703
+ }
704
+ getTeamIds() {
705
+ return uniq(
706
+ this.getBundle().projects.map(
707
+ (p) => p.teamId ? `${p.teamId}${p.indirect ? "@indirect" : ""}` : null
708
+ ).filter((x) => !!x)
709
+ );
710
+ }
711
+ getProjectIds() {
712
+ return uniq(
713
+ this.getBundle().projects.map(
714
+ (p) => `${p.id}${p.indirect ? "@indirect" : ""}`
715
+ )
716
+ );
717
+ }
718
+ trackRender(opts) {
719
+ this.tracker.trackRender(opts);
455
720
  }
456
721
  };
457
- function parseFetchComponentDataArgs(...args) {
458
- let specs;
459
- let opts;
460
- if (Array.isArray(args[0])) {
461
- specs = args[0];
462
- opts = args[1];
722
+ var PlasmicComponentLoader = class {
723
+ constructor(internal) {
724
+ this.warnedRegisterComponent = false;
725
+ this.__internal = internal;
726
+ }
727
+ /**
728
+ * Sets global variants to be used for all components. Note that
729
+ * this is not reactive, and will not re-render all components
730
+ * already mounted; instead, it should be used to activate global
731
+ * variants that should always be activated for the lifetime of this
732
+ * app. If you'd like to reactively change the global variants,
733
+ * you should specify them via <PlasmicRootProvider />
734
+ */
735
+ setGlobalVariants(globalVariants) {
736
+ this.__internal.setGlobalVariants(globalVariants);
737
+ }
738
+ registerModules(modules) {
739
+ this.__internal.registerModules(modules);
740
+ }
741
+ /**
742
+ * Register custom components that should be swapped in for
743
+ * components defined in your project. You can use this to
744
+ * swap in / substitute a Plasmic component with a "real" component.
745
+ */
746
+ substituteComponent(component, name) {
747
+ this.__internal.substituteComponent(component, name);
748
+ }
749
+ registerComponent(component, metaOrName) {
750
+ if (metaOrName && typeof metaOrName === "object" && "props" in metaOrName) {
751
+ this.__internal.registerComponent(component, metaOrName);
752
+ } else {
753
+ if (process.env.NODE_ENV === "development" && !this.warnedRegisterComponent) {
754
+ console.warn(
755
+ `PlasmicLoader: Using deprecated method \`registerComponent\` for component substitution. Please consider using \`substituteComponent\` instead.`
756
+ );
757
+ this.warnedRegisterComponent = true;
758
+ }
759
+ this.substituteComponent(component, metaOrName);
760
+ }
761
+ }
762
+ registerFunction(fn, meta) {
763
+ this.__internal.registerFunction(fn, meta);
764
+ }
765
+ registerGlobalContext(context, meta) {
766
+ this.__internal.registerGlobalContext(context, meta);
767
+ }
768
+ registerTrait(trait, meta) {
769
+ this.__internal.registerTrait(trait, meta);
770
+ }
771
+ registerToken(token) {
772
+ this.__internal.registerToken(token);
773
+ }
774
+ fetchComponentData(...args) {
775
+ return this.__internal.fetchComponentData(...args);
776
+ }
777
+ maybeFetchComponentData(...args) {
778
+ return __async(this, null, function* () {
779
+ return this.__internal.maybeFetchComponentData(...args);
780
+ });
781
+ }
782
+ /**
783
+ * Returns all the page component metadata for these projects.
784
+ */
785
+ fetchPages(opts) {
786
+ return __async(this, null, function* () {
787
+ return this.__internal.fetchPages(opts);
788
+ });
789
+ }
790
+ /**
791
+ * Returns all components metadata for these projects.
792
+ */
793
+ fetchComponents() {
794
+ return __async(this, null, function* () {
795
+ return this.__internal.fetchComponents();
796
+ });
797
+ }
798
+ _getActiveVariation(opts) {
799
+ return __async(this, null, function* () {
800
+ return this.__internal.getActiveVariation(opts);
801
+ });
802
+ }
803
+ getActiveVariation(opts) {
804
+ return __async(this, null, function* () {
805
+ return this._getActiveVariation({
806
+ traits: opts.traits,
807
+ getKnownValue: (key) => {
808
+ if (opts.known) {
809
+ return opts.known[key];
810
+ } else {
811
+ const cookies = getPlasmicCookieValues();
812
+ return cookies[key];
813
+ }
814
+ },
815
+ updateKnownValue: (key, value) => {
816
+ if (!opts.known) {
817
+ updatePlasmicCookieValue(key, value);
818
+ }
819
+ }
820
+ });
821
+ });
822
+ }
823
+ getChunksUrl(bundle, modules) {
824
+ return this.__internal.getChunksUrl(bundle, modules);
825
+ }
826
+ getExternalVariation(variation, filters) {
827
+ return (0, import_loader_splits.getExternalIds)(this.getActiveSplits(), variation, filters);
828
+ }
829
+ getActiveSplits() {
830
+ return this.__internal.getActiveSplits();
831
+ }
832
+ trackConversion(value = 0) {
833
+ this.__internal.trackConversion(value);
834
+ }
835
+ clearCache() {
836
+ return this.__internal.clearCache();
837
+ }
838
+ };
839
+
840
+ // src/swr-util.ts
841
+ function swrSerialize(key) {
842
+ if (typeof key === "function") {
843
+ try {
844
+ key = key();
845
+ } catch (err) {
846
+ key = "";
847
+ }
848
+ }
849
+ const args = [].concat(key);
850
+ key = typeof key == "string" ? key : (Array.isArray(key) ? key.length : key) ? stableHash(key) : "";
851
+ return [key, args];
852
+ }
853
+ var table = /* @__PURE__ */ new WeakMap();
854
+ var counter = 0;
855
+ function stableHash(arg) {
856
+ const type = typeof arg;
857
+ const constructor = arg && arg.constructor;
858
+ const isDate = constructor == Date;
859
+ let result;
860
+ let index;
861
+ if (Object(arg) === arg && !isDate && constructor != RegExp) {
862
+ result = table.get(arg);
863
+ if (result)
864
+ return result;
865
+ result = ++counter + "~";
866
+ table.set(arg, result);
867
+ if (constructor == Array) {
868
+ result = "@";
869
+ for (index = 0; index < arg.length; index++) {
870
+ result += stableHash(arg[index]) + ",";
871
+ }
872
+ table.set(arg, result);
873
+ }
874
+ if (constructor == Object) {
875
+ result = "#";
876
+ const keys = Object.keys(arg).sort();
877
+ while ((index = keys.pop()) !== void 0) {
878
+ if (arg[index] !== void 0) {
879
+ result += index + ":" + stableHash(arg[index]) + ",";
880
+ }
881
+ }
882
+ table.set(arg, result);
883
+ }
463
884
  } else {
464
- specs = args;
465
- opts = void 0;
885
+ result = isDate ? arg.toJSON() : type == "symbol" ? arg.toString() : type == "string" ? JSON.stringify(arg) : "" + arg;
466
886
  }
467
- return { specs, opts };
887
+ return result;
888
+ }
889
+
890
+ // src/loader-server.tsx
891
+ var noop = () => {
892
+ };
893
+ var identity = (x) => x;
894
+ var unreachable = () => {
895
+ debugger;
896
+ throw new Error("Unreachable code");
897
+ };
898
+ var REACT_PROVIDER_TYPE = typeof Symbol === "function" && Symbol.for ? Symbol.for("react.provider") : 60109;
899
+ var FakeRootProviderContext = {
900
+ _currentValue: void 0
901
+ // default value
902
+ };
903
+ var FakeDataContext = {
904
+ _currentValue: void 0
905
+ // default value
906
+ };
907
+ var FakePlasmicComponentContext = {
908
+ _currentValue: false
909
+ // default value
910
+ };
911
+ var FakePlasmicPrepassContext = {
912
+ _currentValue: void 0
913
+ };
914
+ var mkMetaName = (name) => `__plasmic_meta_${name}`;
915
+ function FakeDataCtxReader({ children }) {
916
+ const $ctx = getPrepassContextEnv().readContextValue(FakeDataContext);
917
+ return children($ctx);
918
+ }
919
+ function FakeDataProvider({
920
+ name,
921
+ data,
922
+ hidden,
923
+ advanced,
924
+ label,
925
+ children
926
+ }) {
927
+ var _a2;
928
+ const { readContextValue, setContextValue } = getPrepassContextEnv();
929
+ const existingEnv = (_a2 = readContextValue(FakeDataContext)) != null ? _a2 : {};
930
+ if (!name) {
931
+ return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, children);
932
+ } else {
933
+ setContextValue(FakeDataContext, __spreadProps(__spreadValues({}, existingEnv), {
934
+ [name]: data,
935
+ [mkMetaName(name)]: { hidden, advanced, label }
936
+ }));
937
+ return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, children);
938
+ }
939
+ }
940
+ var fakeApplySelector = (rawData, selector) => {
941
+ if (!selector) {
942
+ return void 0;
943
+ }
944
+ let curData = rawData;
945
+ for (const key of selector.split(".")) {
946
+ curData = curData == null ? void 0 : curData[key];
947
+ }
948
+ return curData;
949
+ };
950
+ function fakeUseSelector(selector) {
951
+ const rawData = getPrepassContextEnv().readContextValue(FakeDataContext);
952
+ return fakeApplySelector(rawData, selector);
953
+ }
954
+ function fakeUseSelectors(selectors = {}) {
955
+ const rawData = getPrepassContextEnv().readContextValue(FakeDataContext);
956
+ return Object.fromEntries(
957
+ Object.entries(selectors).filter(([key, selector]) => !!key && !!selector).map(([key, selector]) => [
958
+ key,
959
+ fakeApplySelector(rawData, selector)
960
+ ])
961
+ );
962
+ }
963
+ function fakeUsePlasmicDataConfig() {
964
+ const cache = getPrepassContextEnv().readContextValue(
965
+ FakePlasmicPrepassContext
966
+ );
967
+ return { cache };
968
+ }
969
+ var fakeUseMutablePlasmicQueryData = (unserializedKey, fetcher) => {
970
+ const [key, args] = swrSerialize(unserializedKey);
971
+ if (!key) {
972
+ return {
973
+ isValidating: false,
974
+ mutate: () => __async(void 0, null, function* () {
975
+ }),
976
+ data: void 0
977
+ };
978
+ }
979
+ const cache = fakeUsePlasmicDataConfig().cache;
980
+ if (cache.has(key)) {
981
+ return {
982
+ isValidating: false,
983
+ mutate: () => __async(void 0, null, function* () {
984
+ }),
985
+ data: cache.get(key)
986
+ };
987
+ }
988
+ const response = fetcher(...args);
989
+ if (response && typeof response.then == "function") {
990
+ throw response.then((data) => cache.set(key, data));
991
+ } else {
992
+ cache.set(key, response);
993
+ return {
994
+ isValidating: false,
995
+ mutate: () => __async(void 0, null, function* () {
996
+ }),
997
+ data: cache.get(key)
998
+ };
999
+ }
1000
+ };
1001
+ var _a;
1002
+ var FakeReactComponent = (_a = class {
1003
+ constructor() {
1004
+ this.context = void 0;
1005
+ this.props = {};
1006
+ this.setState = (v) => void (this.state = v);
1007
+ this.forceUpdate = noop;
1008
+ this.render = () => null;
1009
+ this.state = {};
1010
+ this.refs = {};
1011
+ }
1012
+ initRender(props) {
1013
+ this.props = props;
1014
+ const dispatcher = import_react.default.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentDispatcher.current;
1015
+ const [state, setState] = dispatcher.useState({});
1016
+ this.state = state;
1017
+ this.setState = setState;
1018
+ if (this.constructor.contextType) {
1019
+ this.context = dispatcher.useContext(
1020
+ this.constructor.contextType
1021
+ );
1022
+ }
1023
+ }
1024
+ }, _a.contextType = void 0, _a);
1025
+ var fakeCreateElement = (originalCreateElement) => (type, ...args) => {
1026
+ if (Object.prototype.isPrototypeOf.call(FakeReactComponent, type)) {
1027
+ return originalCreateElement((props) => {
1028
+ const instance = new type();
1029
+ instance.initRender(props);
1030
+ return instance.render();
1031
+ }, ...args);
1032
+ }
1033
+ return originalCreateElement(type, ...args);
1034
+ };
1035
+ var InternalPrepassPlasmicLoader = class extends BaseInternalPlasmicComponentLoader {
1036
+ constructor(opts) {
1037
+ super({
1038
+ opts,
1039
+ tracker: new import_loader_core3.PlasmicTracker({
1040
+ projectIds: opts.projects.map((p) => p.id),
1041
+ platform: opts.platform,
1042
+ preview: opts.preview,
1043
+ nativeFetch: opts.nativeFetch
1044
+ }),
1045
+ onBundleMerged: () => {
1046
+ this.refreshRegistry();
1047
+ },
1048
+ fetcher: new import_loader_core3.PlasmicModulesFetcher(opts),
1049
+ builtinModules: {
1050
+ react: __spreadProps(__spreadValues(__spreadProps(__spreadValues(__spreadValues({}, import_react.default), { isRSC: true }), {
1051
+ createContext: (defaultValue) => {
1052
+ const context = {
1053
+ _currentValue: defaultValue,
1054
+ displayName: "FakeContext",
1055
+ Provider: ({ value, children }) => {
1056
+ getPrepassContextEnv().setContextValue(context, value);
1057
+ return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, children);
1058
+ },
1059
+ Consumer: ({ children }) => children(getPrepassContextEnv().readContextValue(context))
1060
+ };
1061
+ return context;
1062
+ }
1063
+ }), Object.fromEntries(
1064
+ [
1065
+ "useCallback",
1066
+ "useContext",
1067
+ "useEffect",
1068
+ "useImperativeHandle",
1069
+ "useDebugValue",
1070
+ "useInsertionEffect",
1071
+ "useLayoutEffect",
1072
+ "useMemo",
1073
+ "useSyncExternalStore",
1074
+ "useReducer",
1075
+ "useRef",
1076
+ "useState"
1077
+ ].map((hook) => [
1078
+ hook,
1079
+ (...args) => {
1080
+ const dispatcher = import_react.default.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentDispatcher.current;
1081
+ return dispatcher[hook](...args);
1082
+ }
1083
+ ])
1084
+ )), {
1085
+ useDeferredValue: (v) => v,
1086
+ useTransition: () => [
1087
+ false,
1088
+ (f) => {
1089
+ f();
1090
+ }
1091
+ ],
1092
+ createFactory: (type) => import_react.default.createElement.bind(null, type),
1093
+ Component: FakeReactComponent,
1094
+ PureComponent: FakeReactComponent,
1095
+ createElement: fakeCreateElement(import_react.default.createElement)
1096
+ }),
1097
+ "react-dom": import_react_dom.default,
1098
+ "react/jsx-runtime": __spreadValues(__spreadValues(__spreadValues(__spreadValues({}, jsxRuntime), jsxRuntime.jsx ? { jsx: fakeCreateElement(jsxRuntime.jsx) } : {}), jsxRuntime.jsxs ? { jsxs: fakeCreateElement(jsxRuntime.jsxs) } : {}), jsxRuntime.jsxDEV ? { jsxDEV: fakeCreateElement(jsxRuntime.jsxDEV) } : {}),
1099
+ "react/jsx-dev-runtime": __spreadValues(__spreadValues(__spreadValues(__spreadValues({}, jsxDevRuntime), jsxDevRuntime.jsx ? { jsx: fakeCreateElement(jsxDevRuntime.jsx) } : {}), jsxDevRuntime.jsxs ? { jsxs: fakeCreateElement(jsxDevRuntime.jsxs) } : {}), jsxDevRuntime.jsxDEV ? { jsxDEV: fakeCreateElement(jsxDevRuntime.jsxDEV) } : {}),
1100
+ "@plasmicapp/query": {
1101
+ addLoadingStateListener: () => noop,
1102
+ isPlasmicPrepass: () => true,
1103
+ PlasmicPrepassContext: {},
1104
+ PlasmicQueryDataProvider: ({ children }) => /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, children),
1105
+ useMutablePlasmicQueryData: fakeUseMutablePlasmicQueryData,
1106
+ usePlasmicDataConfig: fakeUsePlasmicDataConfig,
1107
+ usePlasmicQueryData: fakeUseMutablePlasmicQueryData,
1108
+ useSWRConfig: unreachable,
1109
+ wrapLoadingFetcher: identity
1110
+ },
1111
+ "@plasmicapp/data-sources-context": (() => {
1112
+ const FakePlasmicDataSourceContext = {
1113
+ _currentValue: void 0
1114
+ // default value
1115
+ };
1116
+ return {
1117
+ PlasmicDataSourceContextProvider: Object.assign(
1118
+ ({ children, value }) => {
1119
+ const { setContextValue } = getPrepassContextEnv();
1120
+ setContextValue(FakePlasmicDataSourceContext, value);
1121
+ return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, children);
1122
+ },
1123
+ {
1124
+ $$typeof: REACT_PROVIDER_TYPE,
1125
+ _context: FakePlasmicDataSourceContext
1126
+ }
1127
+ ),
1128
+ useCurrentUser: () => {
1129
+ var _a2;
1130
+ const { readContextValue } = getPrepassContextEnv();
1131
+ const ctx = readContextValue(FakePlasmicDataSourceContext);
1132
+ return (_a2 = ctx == null ? void 0 : ctx.user) != null ? _a2 : {
1133
+ isLoggedIn: false
1134
+ };
1135
+ },
1136
+ usePlasmicDataSourceContext: () => {
1137
+ const { readContextValue } = getPrepassContextEnv();
1138
+ return readContextValue(FakePlasmicDataSourceContext);
1139
+ }
1140
+ };
1141
+ })(),
1142
+ "@plasmicapp/host": (() => {
1143
+ return {
1144
+ applySelector: fakeApplySelector,
1145
+ DataContext: FakeDataContext,
1146
+ DataCtxReader: FakeDataCtxReader,
1147
+ DataProvider: FakeDataProvider,
1148
+ GlobalActionsContext: {
1149
+ _currentValue: void 0
1150
+ // default value
1151
+ },
1152
+ GlobalActionsProvider: ({ children }) => /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, children),
1153
+ mkMetaName,
1154
+ mkMetaValue: identity,
1155
+ PageParamsProvider: ({ children }) => /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, children),
1156
+ PlasmicCanvasContext: { _currentValue: false },
1157
+ PlasmicCanvasHost: () => null,
1158
+ PlasmicLinkProvider: ({ children }) => /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, children),
1159
+ registerComponent: noop,
1160
+ registerFunction: noop,
1161
+ registerGlobalContext: noop,
1162
+ registerToken: noop,
1163
+ registerTrait: noop,
1164
+ repeatedElement: unreachable,
1165
+ stateHelpersKeys: ["initFunc", "onChangeArgsToValue", "onMutate"],
1166
+ unstable_registerFetcher: noop,
1167
+ useDataEnv: () => getPrepassContextEnv().readContextValue(FakeDataContext),
1168
+ useGlobalActions: () => new Proxy(
1169
+ {},
1170
+ {
1171
+ get: () => noop
1172
+ }
1173
+ ),
1174
+ usePlasmicCanvasContext: () => false,
1175
+ usePlasmicLink: () => (props) => /* @__PURE__ */ import_react.default.createElement("a", __spreadValues({}, props)),
1176
+ usePlasmicLinkMaybe: () => void 0,
1177
+ useSelector: fakeUseSelector,
1178
+ useSelectors: fakeUseSelectors
1179
+ };
1180
+ })(),
1181
+ "@plasmicapp/loader-runtime-registry": {
1182
+ components: SUBSTITUTED_COMPONENTS,
1183
+ globalVariantHooks: SUBSTITUTED_GLOBAL_VARIANT_HOOKS,
1184
+ codeComponentHelpers: REGISTERED_CODE_COMPONENT_HELPERS,
1185
+ functions: REGISTERED_CUSTOM_FUNCTIONS
1186
+ }
1187
+ }
1188
+ });
1189
+ this.registerTrait = noop;
1190
+ this.registerToken = noop;
1191
+ }
1192
+ registerComponent(component, meta) {
1193
+ var _a2;
1194
+ const stateHelpers = Object.fromEntries(
1195
+ Object.entries((_a2 = meta.states) != null ? _a2 : {}).filter(
1196
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
1197
+ ([_, stateSpec]) => (
1198
+ // `initFunc` is the only helper function used in RSC phase
1199
+ "initFunc" in stateSpec
1200
+ )
1201
+ ).map(([stateName, stateSpec]) => [
1202
+ stateName,
1203
+ { initFunc: stateSpec.initFunc }
1204
+ ])
1205
+ );
1206
+ const helpers = { states: stateHelpers };
1207
+ this.internalSubstituteComponent(
1208
+ meta.getServerInfo ? (props) => {
1209
+ var _a3;
1210
+ const { readContextValue } = getPrepassContextEnv();
1211
+ const serverInfo = (_a3 = meta.getServerInfo) == null ? void 0 : _a3.call(meta, props, {
1212
+ readContext: readContextValue,
1213
+ readDataEnv: () => readContextValue(FakeDataContext),
1214
+ readDataSelector: fakeUseSelector,
1215
+ readDataSelectors: fakeUseSelectors,
1216
+ fetchData: fakeUseMutablePlasmicQueryData
1217
+ });
1218
+ if (serverInfo && serverInfo.children) {
1219
+ const contents = [];
1220
+ const children = Array.isArray(serverInfo.children) ? serverInfo.children : [serverInfo.children];
1221
+ children.forEach((childData) => {
1222
+ contents.push(
1223
+ /* @__PURE__ */ import_react.default.createElement(ContextAndDataProviderWrapper, { contextAndData: childData }, childData.node)
1224
+ );
1225
+ });
1226
+ return /* @__PURE__ */ import_react.default.createElement(ContextAndDataProviderWrapper, { contextAndData: serverInfo }, contents);
1227
+ } else {
1228
+ return /* @__PURE__ */ import_react.default.createElement(
1229
+ ContextAndDataProviderWrapper,
1230
+ {
1231
+ contextAndData: serverInfo != null ? serverInfo : {}
1232
+ },
1233
+ Object.values(props).flat(Infinity).filter(
1234
+ (v) => v && typeof v == "object" && v.$$typeof && import_react.default.isValidElement(v)
1235
+ )
1236
+ );
1237
+ }
1238
+ } : component,
1239
+ { name: meta.name, isCode: true },
1240
+ Object.keys(stateHelpers).length > 0 ? helpers : void 0
1241
+ );
1242
+ }
1243
+ registerFunction(fn, meta) {
1244
+ REGISTERED_CUSTOM_FUNCTIONS[customFunctionImportAlias(meta)] = fn;
1245
+ }
1246
+ registerGlobalContext(context, meta) {
1247
+ this.substituteComponent(context, { name: meta.name, isCode: true });
1248
+ }
1249
+ refreshRegistry() {
1250
+ for (const globalGroup of this.getBundle().globalGroups) {
1251
+ if (globalGroup.type !== "global-screen") {
1252
+ SUBSTITUTED_GLOBAL_VARIANT_HOOKS[globalGroup.id] = () => {
1253
+ var _a2;
1254
+ const rootContext = getPrepassContextEnv().readContextValue(
1255
+ FakeRootProviderContext
1256
+ );
1257
+ const loader = this;
1258
+ const { name, projectId } = globalGroup;
1259
+ const spec = [
1260
+ ...loader.getGlobalVariants(),
1261
+ ...(_a2 = rootContext.globalVariants) != null ? _a2 : []
1262
+ ].find(
1263
+ (s) => s.name === name && (!s.projectId || s.projectId === projectId)
1264
+ );
1265
+ return spec ? spec.value : void 0;
1266
+ };
1267
+ }
1268
+ }
1269
+ super.refreshRegistry();
1270
+ }
1271
+ };
1272
+ function handlePrepassPlasmicRootComponent(props) {
1273
+ var _a2;
1274
+ const {
1275
+ globalVariants,
1276
+ globalContextsProps,
1277
+ variation,
1278
+ translator,
1279
+ Head,
1280
+ Link,
1281
+ pageRoute,
1282
+ pageParams,
1283
+ pageQuery,
1284
+ suspenseFallback,
1285
+ disableLoadingBoundary,
1286
+ user,
1287
+ userAuthToken,
1288
+ isUserLoading,
1289
+ authRedirectUri
1290
+ } = props;
1291
+ const loader = props.loader.__internal;
1292
+ const splits = loader.getActiveSplits();
1293
+ const value = {
1294
+ globalVariants: mergeGlobalVariantsSpec(
1295
+ globalVariants != null ? globalVariants : [],
1296
+ getGlobalVariantsFromSplits(splits, variation != null ? variation : {})
1297
+ ),
1298
+ globalContextsProps,
1299
+ loader,
1300
+ variation,
1301
+ translator,
1302
+ Head,
1303
+ Link,
1304
+ user,
1305
+ userAuthToken,
1306
+ isUserLoading,
1307
+ authRedirectUri,
1308
+ suspenseFallback,
1309
+ disableLoadingBoundary
1310
+ };
1311
+ const { setContextValue, readContextValue } = getPrepassContextEnv();
1312
+ setContextValue(FakeRootProviderContext, value);
1313
+ const existingEnv = (_a2 = readContextValue(FakeDataContext)) != null ? _a2 : {};
1314
+ const fixCatchallParams = (params) => {
1315
+ const newParams = {};
1316
+ for (const [key, val] of Object.entries(params)) {
1317
+ if (!val) {
1318
+ continue;
1319
+ }
1320
+ if (key.startsWith("...")) {
1321
+ newParams[key.slice(3)] = typeof val === "string" ? val.replace(/^\/|\/$/g, "").split("/") : val;
1322
+ } else {
1323
+ newParams[key] = val;
1324
+ }
1325
+ }
1326
+ return newParams;
1327
+ };
1328
+ const mkPathFromRouteAndParams = (route, params) => {
1329
+ if (!params) {
1330
+ return route;
1331
+ }
1332
+ let path = route;
1333
+ for (const [key, val] of Object.entries(params)) {
1334
+ if (typeof val === "string") {
1335
+ path = path.replace(`[${key}]`, val);
1336
+ } else if (Array.isArray(val)) {
1337
+ if (path.includes(`[[...${key}]]`)) {
1338
+ path = path.replace(`[[...${key}]]`, val.join("/"));
1339
+ } else if (path.includes(`[...${key}]`)) {
1340
+ path = path.replace(`[...${key}]`, val.join("/"));
1341
+ }
1342
+ }
1343
+ }
1344
+ return path;
1345
+ };
1346
+ const fixedParams = fixCatchallParams(pageParams != null ? pageParams : {});
1347
+ setContextValue(FakeDataContext, __spreadProps(__spreadValues({}, existingEnv), {
1348
+ ["pageRoute"]: pageRoute,
1349
+ [mkMetaName("pageRoute")]: { advanced: true, label: "Page route" },
1350
+ ["pagePath"]: pageRoute ? mkPathFromRouteAndParams(pageRoute, fixedParams) : void 0,
1351
+ [mkMetaName("pagePath")]: { label: "Page path" },
1352
+ ["params"]: __spreadValues(__spreadValues({}, existingEnv.params), fixedParams),
1353
+ [mkMetaName("params")]: { label: "Page URL path params" },
1354
+ ["query"]: __spreadValues(__spreadValues({}, existingEnv.query), pageQuery),
1355
+ [mkMetaName("query")]: { label: "Page URL query params" }
1356
+ }));
1357
+ }
1358
+ function handlePrepassPlasmicComponent(props) {
1359
+ var _b;
1360
+ const { component, projectId, componentProps, forceOriginal } = props;
1361
+ const { setContextValue, readContextValue } = getPrepassContextEnv();
1362
+ const rootContext = readContextValue(
1363
+ FakeRootProviderContext
1364
+ );
1365
+ const isRootLoader = !readContextValue(FakePlasmicComponentContext);
1366
+ if (!rootContext) {
1367
+ throw new Error(
1368
+ `You must use <PlasmicRootProvider/> at the root of your app`
1369
+ );
1370
+ }
1371
+ const _a2 = rootContext, {
1372
+ loader,
1373
+ globalContextsProps,
1374
+ userAuthToken,
1375
+ isUserLoading,
1376
+ authRedirectUri,
1377
+ translator
1378
+ } = _a2, rest = __objRest(_a2, [
1379
+ "loader",
1380
+ "globalContextsProps",
1381
+ "userAuthToken",
1382
+ "isUserLoading",
1383
+ "authRedirectUri",
1384
+ "translator"
1385
+ ]);
1386
+ const spec = { name: component, projectId, isCode: false };
1387
+ const opts = { forceOriginal };
1388
+ const lookup = loader.getLookup();
1389
+ if (!lookup.hasComponent(spec)) {
1390
+ return null;
1391
+ }
1392
+ const Component = lookup.getComponent(spec, opts);
1393
+ let element = /* @__PURE__ */ import_react.default.createElement(Component, __spreadValues({}, componentProps));
1394
+ if (isRootLoader) {
1395
+ const ReactWebRootProvider = lookup.getRootProvider();
1396
+ const GlobalContextsProvider = lookup.getGlobalContextsProvider({
1397
+ name: component,
1398
+ projectId
1399
+ });
1400
+ setContextValue(FakePlasmicComponentContext, true);
1401
+ element = /* @__PURE__ */ import_react.default.createElement(
1402
+ ReactWebRootProvider,
1403
+ __spreadProps(__spreadValues({}, rest), {
1404
+ userAuthToken,
1405
+ isUserLoading,
1406
+ authRedirectUri,
1407
+ i18n: {
1408
+ translator,
1409
+ tagPrefix: (_b = loader.opts.i18n) == null ? void 0 : _b.tagPrefix
1410
+ }
1411
+ }),
1412
+ element
1413
+ );
1414
+ if (GlobalContextsProvider) {
1415
+ element = /* @__PURE__ */ import_react.default.createElement(GlobalContextsProvider, __spreadValues({}, globalContextsProps), element);
1416
+ }
1417
+ }
1418
+ return element;
1419
+ }
1420
+ function handlePlasmicPrepassContext({
1421
+ cache
1422
+ }) {
1423
+ getPrepassContextEnv().setContextValue(FakePlasmicPrepassContext, cache);
1424
+ }
1425
+ function getPrepassContextEnv() {
1426
+ return globalThis.__ssrPrepassEnv;
1427
+ }
1428
+ function ContextAndDataProviderWrapper({
1429
+ children,
1430
+ contextAndData
1431
+ }) {
1432
+ var _a2;
1433
+ const { setContextValue, readContextValue } = getPrepassContextEnv();
1434
+ const contexts = contextAndData.providedContexts ? Array.isArray(contextAndData.providedContexts) ? contextAndData.providedContexts : [contextAndData.providedContexts] : [];
1435
+ const providedData = contextAndData.providedData ? Array.isArray(contextAndData.providedData) ? contextAndData.providedData : [contextAndData.providedData] : [];
1436
+ contexts.forEach((context) => {
1437
+ setContextValue(context.contextKey, context.value);
1438
+ });
1439
+ let $ctx = (_a2 = readContextValue(FakeDataContext)) != null ? _a2 : {};
1440
+ providedData.forEach(({ name, data }) => {
1441
+ $ctx = __spreadProps(__spreadValues({}, $ctx), {
1442
+ [name]: data
1443
+ });
1444
+ });
1445
+ setContextValue(FakeDataContext, $ctx);
1446
+ return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, children);
1447
+ }
1448
+
1449
+ // src/prepass-server.ts
1450
+ var import_prepass = require("@plasmicapp/prepass");
1451
+ function extractPlasmicQueryData(element, loader) {
1452
+ return __async(this, null, function* () {
1453
+ return yield (0, import_prepass.extractPlasmicQueryData)(
1454
+ element,
1455
+ (elt) => handleClientComponentRef(elt, loader, element)
1456
+ );
1457
+ });
1458
+ }
1459
+ function handleClientComponentRef(elt, loader, rootElement) {
1460
+ var _a2, _b;
1461
+ try {
1462
+ const refId = elt.type.$$id;
1463
+ if (refId.includes("PlasmicRootProvider") || elt === rootElement) {
1464
+ const props = elt.props;
1465
+ if (props.prefetchedData) {
1466
+ handlePrepassPlasmicRootComponent(__spreadProps(__spreadValues({}, props), { loader }));
1467
+ }
1468
+ return;
1469
+ } else if (refId.includes("PlasmicComponent") && ((_a2 = elt.props) == null ? void 0 : _a2.component) != null) {
1470
+ return handlePrepassPlasmicComponent(elt.props);
1471
+ } else if (refId.includes("PlasmicPrepassContext") && ((_b = elt.props) == null ? void 0 : _b.cache) != null) {
1472
+ return handlePlasmicPrepassContext(elt.props);
1473
+ }
1474
+ } catch (err) {
1475
+ console.warn("Error processing client reference: ", err);
1476
+ }
1477
+ return;
468
1478
  }
469
1479
 
470
1480
  // src/react-server.ts
471
1481
  function initPlasmicLoader(opts) {
472
- return new ReactServerPlasmicComponentLoader({
473
- opts,
474
- fetcher: new import_loader_core2.PlasmicModulesFetcher(opts),
475
- tracker: new import_loader_core2.PlasmicTracker({
476
- projectIds: opts.projects.map((p) => p.id),
477
- platform: opts.platform,
478
- preview: opts.preview
479
- })
480
- });
1482
+ const internal = new InternalPrepassPlasmicLoader(opts);
1483
+ return new PlasmicComponentLoader(internal);
481
1484
  }
482
1485
  //# sourceMappingURL=react-server.js.map