@puckeditor/plugin-ai 0.6.0 → 0.6.1-canary.0342162f

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.css CHANGED
@@ -265,7 +265,7 @@ p {
265
265
  }
266
266
 
267
267
  /* css-module:/home/runner/work/puck-platform/puck-platform/packages/platform-client/components/Button/Button.module.css/#css-module-data */
268
- ._Button_1sscz_1 {
268
+ ._Button_1br4o_1 {
269
269
  appearance: none;
270
270
  background: none;
271
271
  border: 1px solid transparent;
@@ -287,31 +287,31 @@ p {
287
287
  white-space: nowrap;
288
288
  margin: 0;
289
289
  }
290
- ._Button_1sscz_1:hover,
291
- ._Button_1sscz_1:active {
290
+ ._Button_1br4o_1:hover,
291
+ ._Button_1br4o_1:active {
292
292
  transition: none;
293
293
  }
294
- ._Button_1sscz_1:focus-visible {
294
+ ._Button_1br4o_1:focus-visible {
295
295
  outline: 2px solid var(--puck-color-azure-05);
296
296
  outline-offset: 2px;
297
297
  }
298
- ._Button--medium_1sscz_34 {
298
+ ._Button--medium_1br4o_34 {
299
299
  min-height: 34px;
300
300
  padding-bottom: 7px;
301
301
  padding-left: 19px;
302
302
  padding-right: 19px;
303
303
  padding-top: 7px;
304
304
  }
305
- ._Button--large_1sscz_42 {
305
+ ._Button--large_1br4o_42 {
306
306
  padding-bottom: 11px;
307
307
  padding-left: 19px;
308
308
  padding-right: 19px;
309
309
  padding-top: 11px;
310
310
  }
311
- ._Button-icon_1sscz_49 {
311
+ ._Button-icon_1br4o_49 {
312
312
  margin-top: 2px;
313
313
  }
314
- ._Button--brand_1sscz_53 {
314
+ ._Button--brand_1br4o_53 {
315
315
  background-image:
316
316
  linear-gradient(
317
317
  210deg,
@@ -322,79 +322,78 @@ p {
322
322
  border-radius: 48px;
323
323
  }
324
324
  @media (hover: hover) and (pointer: fine) {
325
- ._Button--brand_1sscz_53:hover {
325
+ ._Button--brand_1br4o_53:hover {
326
326
  opacity: 0.8;
327
327
  }
328
328
  }
329
- ._Button--brand_1sscz_53:active {
329
+ ._Button--brand_1br4o_53:active {
330
330
  opacity: 0.8;
331
331
  }
332
- ._Button--primary_1sscz_74 {
332
+ ._Button--primary_1br4o_74 {
333
333
  background: var(--puck-color-azure-04);
334
334
  }
335
335
  @media (hover: hover) and (pointer: fine) {
336
- ._Button--primary_1sscz_74:hover {
336
+ ._Button--primary_1br4o_74:hover {
337
337
  background-color: var(--puck-color-azure-03);
338
338
  }
339
339
  }
340
- ._Button--primary_1sscz_74:active {
340
+ ._Button--primary_1br4o_74:active {
341
341
  background-color: var(--puck-color-azure-02);
342
342
  }
343
- ._Button--secondary_1sscz_88 {
343
+ ._Button--secondary_1br4o_88 {
344
344
  border: 1px solid currentColor;
345
345
  color: currentColor;
346
346
  }
347
347
  @media (hover: hover) and (pointer: fine) {
348
- ._Button--secondary_1sscz_88:hover {
348
+ ._Button--secondary_1br4o_88:hover {
349
349
  background-color: var(--puck-color-azure-12);
350
350
  color: var(--puck-color-black);
351
351
  }
352
352
  }
353
- ._Button--secondary_1sscz_88:active {
353
+ ._Button--secondary_1br4o_88:active {
354
354
  background-color: var(--puck-color-azure-11);
355
355
  color: var(--puck-color-black);
356
356
  }
357
- ._Button--danger_1sscz_105 {
357
+ ._Button--danger_1br4o_105 {
358
358
  background: var(--puck-color-red-04);
359
359
  }
360
360
  @media (hover: hover) and (pointer: fine) {
361
- ._Button--danger_1sscz_105:hover {
361
+ ._Button--danger_1br4o_105:hover {
362
362
  background-color: var(--puck-color-red-03);
363
363
  }
364
364
  }
365
- ._Button--danger_1sscz_105:active {
365
+ ._Button--danger_1br4o_105:active {
366
366
  background-color: var(--puck-color-red-02);
367
367
  }
368
- ._Button--flush_1sscz_119 {
368
+ ._Button--flush_1br4o_119 {
369
369
  border-radius: 0;
370
370
  }
371
- ._Button--ghost_1sscz_123 {
371
+ ._Button--ghost_1br4o_123 {
372
372
  align-items: center;
373
373
  background-color: transparent;
374
374
  border: none;
375
375
  border-radius: 4px;
376
- color: var(--puck-color-grey-08);
377
- padding: 8px;
376
+ color: var(--puck-color-azure-04);
378
377
  display: flex;
379
378
  }
380
379
  @media (hover: hover) and (pointer: fine) {
381
- ._Button--ghost_1sscz_123:hover {
382
- background-color: var(--puck-color-azure-11);
380
+ ._Button--ghost_1br4o_123:hover {
381
+ background-color: var(--puck-color-grey-11);
383
382
  color: var(--puck-color-azure-04);
384
383
  cursor: pointer;
385
384
  }
386
385
  }
387
- ._Button--disabled_1sscz_141,
388
- ._Button--disabled_1sscz_141:hover {
386
+ ._Button--disabled_1br4o_140,
387
+ ._Button--disabled_1br4o_140:hover {
389
388
  background-color: var(--puck-color-grey-09);
390
389
  color: var(--puck-color-grey-05);
391
390
  cursor: not-allowed;
392
391
  }
393
- ._Button--fullWidth_1sscz_148 {
392
+ ._Button--fullWidth_1br4o_147 {
394
393
  justify-content: center;
395
394
  width: 100%;
396
395
  }
397
- ._Button-spinner_1sscz_153 {
396
+ ._Button-spinner_1br4o_152 {
398
397
  padding-left: 8px;
399
398
  }
400
399
 
@@ -524,7 +523,7 @@ p {
524
523
  }
525
524
 
526
525
  /* css-module:/home/runner/work/puck-platform/puck-platform/packages/platform-client/components/Card/Card.module.css/#css-module-data */
527
- ._Card_jzb6b_1 {
526
+ ._Card_rpnal_1 {
528
527
  background-color: white;
529
528
  border: 1px solid var(--puck-color-grey-08);
530
529
  border-radius: 16px;
@@ -532,32 +531,33 @@ p {
532
531
  display: block;
533
532
  text-decoration: none;
534
533
  }
535
- ._Card_jzb6b_1:hover {
534
+ ._Card_rpnal_1:hover {
536
535
  cursor: pointer;
537
536
  background: var(--puck-color-azure-11);
538
537
  border-color: currentColor;
539
538
  color: var(--puck-color-azure-04);
540
539
  }
541
- ._Card-body_jzb6b_17 {
540
+ ._Card-body_rpnal_17 {
542
541
  align-items: center;
543
542
  display: flex;
544
543
  padding: 16px;
545
544
  }
546
- ._Card-title_jzb6b_23 {
545
+ ._Card-title_rpnal_23 {
547
546
  margin-bottom: 4px;
548
547
  }
549
- ._Card-subtitle_jzb6b_27 {
548
+ ._Card-subtitle_rpnal_27 {
550
549
  margin: 0;
550
+ text-wrap: wrap;
551
551
  }
552
- ._Card-chevron_jzb6b_31 {
552
+ ._Card-chevron_rpnal_32 {
553
553
  align-items: center;
554
554
  display: none;
555
555
  margin-left: auto;
556
556
  }
557
- ._Card--showChevron_jzb6b_37 ._Card-chevron_jzb6b_31 {
557
+ ._Card--showChevron_rpnal_38 ._Card-chevron_rpnal_32 {
558
558
  display: flex;
559
559
  }
560
- ._Card--isActive_jzb6b_41 {
560
+ ._Card--isActive_rpnal_42 {
561
561
  border-color: var(--puck-color-azure-04);
562
562
  color: var(--puck-color-azure-04);
563
563
  }
@@ -925,10 +925,10 @@ p {
925
925
  }
926
926
 
927
927
  /* css-module:/home/runner/work/puck-platform/puck-platform/packages/platform-client/components/PlanGrid/styles.module.css/#css-module-data */
928
- ._PlanGrid--loading_yaytb_1 {
928
+ ._PlanGrid--loading_97rn7_1 {
929
929
  opacity: 0;
930
930
  }
931
- ._PlanGrid-grid_yaytb_5 {
931
+ ._PlanGrid-grid_97rn7_5 {
932
932
  color: var(--puck-color-grey-02);
933
933
  display: grid;
934
934
  gap: 16px;
@@ -937,7 +937,7 @@ p {
937
937
  grid-template-columns: 1fr 1fr 1fr;
938
938
  }
939
939
  }
940
- ._PlanGrid-enterprise_yaytb_16 {
940
+ ._PlanGrid-enterprise_97rn7_16 {
941
941
  color: var(--puck-color-grey-04);
942
942
  font-size: var(--puck-font-size-xxs);
943
943
  margin-left: auto;
@@ -946,13 +946,14 @@ p {
946
946
  padding-top: 20px;
947
947
  text-align: center;
948
948
  }
949
- ._PlanGrid-enterprise_yaytb_16 a {
949
+ ._PlanGrid-enterprise_97rn7_16 a {
950
950
  color: var(--puck-color-azure-04);
951
951
  cursor: pointer;
952
+ font-weight: 500;
952
953
  }
953
954
 
954
955
  /* css-module:/home/runner/work/puck-platform/puck-platform/packages/platform-client/components/PlanCard/styles.module.css/#css-module-data */
955
- ._PlanCard_xeanv_1 {
956
+ ._PlanCard_16zmu_1 {
956
957
  border: 1px solid var(--puck-color-grey-09);
957
958
  border-radius: 16px;
958
959
  display: flex;
@@ -960,17 +961,21 @@ p {
960
961
  flex-direction: column;
961
962
  min-width: 256px;
962
963
  padding: 8px;
964
+ position: relative;
963
965
  }
964
- ._PlanCard--enterprise_xeanv_11 {
966
+ ._PlanCard--enterprise_16zmu_12 {
965
967
  flex-direction: row;
966
968
  grid-column: span 3;
967
969
  }
968
- ._PlanCard-title_xeanv_16 {
970
+ ._PlanCard-title_16zmu_17 {
971
+ display: flex;
972
+ gap: 8px;
973
+ justify-content: space-between;
969
974
  font-size: var(--puck-font-size-xs);
970
975
  font-weight: 700;
971
976
  white-space: nowrap;
972
977
  }
973
- ._PlanCard-header_xeanv_22 {
978
+ ._PlanCard-header_16zmu_26 {
974
979
  box-sizing: border-box;
975
980
  display: flex;
976
981
  flex-direction: column;
@@ -978,101 +983,158 @@ p {
978
983
  padding: 12px 16px;
979
984
  width: 100%;
980
985
  }
981
- ._PlanCard-features_xeanv_31 {
986
+ ._PlanCard-features_16zmu_35 {
982
987
  display: grid;
983
988
  gap: 4px;
984
989
  list-style: none;
985
990
  margin: 0;
986
991
  padding: 0;
987
992
  }
988
- ._PlanCard-feature_xeanv_31 {
993
+ ._PlanCard-feature_16zmu_35 {
989
994
  align-items: center;
990
995
  display: flex;
991
996
  gap: 4px;
992
997
  color: var(--puck-color-grey-05);
993
998
  font-size: var(--puck-font-size-xxs);
994
999
  }
995
- ._PlanCard-featureIcon_xeanv_47 {
1000
+ ._PlanCard-featureIcon_16zmu_51 {
996
1001
  align-self: flex-start;
997
1002
  margin-top: 5px;
998
1003
  }
999
- ._PlanCard-featureTitle_xeanv_52 {
1004
+ ._PlanCard-featureTitle_16zmu_56 {
1000
1005
  color: var(--puck-color-grey-04);
1001
1006
  font-weight: 600;
1002
1007
  }
1003
- ._PlanCard-priceValue_xeanv_57 {
1008
+ ._PlanCard-priceValue_16zmu_61 {
1004
1009
  font-size: var(--puck-font-size-m);
1005
1010
  }
1006
- ._PlanCard-priceInterval_xeanv_61 {
1011
+ ._PlanCard-priceInterval_16zmu_65 {
1007
1012
  color: var(--puck-color-grey-05);
1008
1013
  }
1009
- ._PlanCard-body_xeanv_65 {
1014
+ ._PlanCard-body_16zmu_69 {
1010
1015
  background-color: var(--puck-color-grey-12);
1011
1016
  border: 1px solid var(--puck-color-grey-11);
1012
1017
  border-radius: 8px;
1013
1018
  padding: 16px;
1014
1019
  flex-grow: 1;
1015
1020
  }
1016
- ._PlanCard--enterprise_xeanv_11 ._PlanCard-body_xeanv_65 {
1021
+ ._PlanCard--enterprise_16zmu_12 ._PlanCard-body_16zmu_69 {
1017
1022
  display: flex;
1018
1023
  gap: 8px;
1019
1024
  width: 100%;
1020
1025
  }
1021
- ._PlanCard-section_xeanv_79 {
1026
+ ._PlanCard-section_16zmu_83 {
1022
1027
  padding-bottom: 16px;
1023
1028
  min-width: 192px;
1024
1029
  }
1025
- ._PlanCard-section_xeanv_79:last-of-type {
1030
+ ._PlanCard-section_16zmu_83:last-of-type {
1026
1031
  padding-bottom: 0;
1027
1032
  }
1028
- ._PlanCard-section_xeanv_79 + ._PlanCard-section_xeanv_79 {
1033
+ ._PlanCard-section_16zmu_83 + ._PlanCard-section_16zmu_83 {
1029
1034
  border-top: 1px solid var(--puck-color-grey-09);
1030
1035
  padding-top: 16px;
1031
1036
  }
1032
- ._PlanCard--enterprise_xeanv_11 {
1033
- ._PlanCard-section_xeanv_79 + ._PlanCard-section_xeanv_79 {
1037
+ ._PlanCard--enterprise_16zmu_12 {
1038
+ ._PlanCard-section_16zmu_83 + ._PlanCard-section_16zmu_83 {
1034
1039
  border-left: 1px solid var(--puck-color-grey-09);
1035
1040
  border-top: none;
1036
1041
  padding-left: 16px;
1037
1042
  padding-top: 0;
1038
1043
  }
1039
1044
  }
1040
- ._PlanCard-sectionTitle_xeanv_102 {
1045
+ ._PlanCard-sectionTitle_16zmu_106 {
1041
1046
  font-size: var(--puck-font-size-xs);
1042
1047
  font-weight: 500;
1043
1048
  margin-bottom: 8px;
1044
1049
  }
1045
- ._PlanCard-sectionBody_xeanv_108 + ._PlanCard-sectionTitle_xeanv_102 {
1050
+ ._PlanCard-sectionBody_16zmu_112 + ._PlanCard-sectionTitle_16zmu_106 {
1046
1051
  border-top: 1px solid var(--puck-color-grey-09);
1047
1052
  margin-top: 16px;
1048
1053
  padding-top: 16px;
1049
1054
  }
1050
- ._PlanCard-sectionBody_xeanv_108 {
1055
+ ._PlanCard-sectionBody_16zmu_112 {
1051
1056
  color: var(--puck-color-grey-03);
1052
1057
  font-size: var(--puck-font-size-xxs);
1053
1058
  display: grid;
1054
1059
  gap: 2px;
1055
1060
  }
1056
- ._PlanCard-usageItem_xeanv_121 {
1061
+ ._PlanCard-usageItem_16zmu_125 {
1057
1062
  display: flex;
1058
1063
  gap: 8px;
1059
1064
  font-size: var(--puck-font-size-xxs);
1060
1065
  }
1061
- ._PlanCard-usageLabel_xeanv_127 {
1066
+ ._PlanCard-usageLabel_16zmu_131 {
1062
1067
  color: var(--puck-color-grey-04);
1063
1068
  font-weight: 500;
1064
1069
  }
1065
- ._PlanCard-usageValue_xeanv_132 {
1070
+ ._PlanCard-usageValue_16zmu_136 {
1066
1071
  color: var(--puck-color-grey-05);
1067
1072
  font-family: var(--puck-font-family-monospaced);
1068
1073
  margin-left: auto;
1069
1074
  }
1070
- ._PlanCard-action_xeanv_138 {
1075
+ ._PlanCard-action_16zmu_142 {
1071
1076
  align-items: flex-end;
1072
1077
  display: flex;
1073
1078
  justify-content: flex-end;
1074
1079
  width: 100%;
1075
1080
  }
1081
+ ._PlanCard-description_16zmu_149 {
1082
+ color: var(--puck-color-grey-03);
1083
+ margin-top: 8px;
1084
+ }
1085
+ ._PlanCard--highlight_16zmu_154 {
1086
+ border: transparent;
1087
+ }
1088
+ ._PlanCard--highlight_16zmu_154::before {
1089
+ content: "";
1090
+ position: absolute;
1091
+ inset: 0;
1092
+ padding: 1px;
1093
+ border-radius: inherit;
1094
+ background-image:
1095
+ linear-gradient(
1096
+ 210deg,
1097
+ var(--puck-color-azure-01) 0%,
1098
+ var(--puck-color-azure-03) 40%,
1099
+ var(--puck-color-red-05) 100%);
1100
+ background-size: cover;
1101
+ background-position: center;
1102
+ -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
1103
+ -webkit-mask-composite: xor;
1104
+ mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
1105
+ mask-composite: exclude;
1106
+ pointer-events: none;
1107
+ }
1108
+ ._PlanCard-highlightText_16zmu_184 {
1109
+ @supports (background-clip: text) or (-webkit-background-clip: text) {
1110
+ color: transparent;
1111
+ background-clip: text;
1112
+ -webkit-background-clip: text;
1113
+ background-image:
1114
+ linear-gradient(
1115
+ 210deg,
1116
+ var(--puck-color-azure-01) 0%,
1117
+ var(--puck-color-azure-03) 40%,
1118
+ var(--puck-color-red-05) 100%);
1119
+ background-size: cover;
1120
+ background-position: center;
1121
+ }
1122
+ }
1123
+ ._PlanCard--fullWidth_16zmu_200 {
1124
+ flex-direction: row;
1125
+ grid-column: 1 / -1;
1126
+ }
1127
+ ._PlanCard--fullWidth_16zmu_200 ._PlanCard-header_16zmu_26 {
1128
+ max-width: 312px;
1129
+ }
1130
+ ._PlanCard--fullWidth_16zmu_200 ._PlanCard-action_16zmu_142 {
1131
+ max-width: 256px;
1132
+ }
1133
+ ._PlanCard--fullWidth_16zmu_200 ._PlanCard-sectionBody_16zmu_112 {
1134
+ display: grid;
1135
+ grid-template-rows: 1fr 1fr 1fr 1fr;
1136
+ grid-auto-flow: column;
1137
+ }
1076
1138
 
1077
1139
  /* css-module:/home/runner/work/puck-platform/puck-platform/packages/platform-client/components/Section/Section.module.css/#css-module-data */
1078
1140
  ._Section-inner_1uwo0_1 {
package/dist/index.js CHANGED
@@ -524,7 +524,7 @@ function useChat({
524
524
  // src/components/Chat/index.tsx
525
525
  var import_core2 = require("@puckeditor/core");
526
526
  var import_ai4 = require("ai");
527
- var import_react23 = require("react");
527
+ var import_react24 = require("react");
528
528
  var import_ulid = require("ulid");
529
529
 
530
530
  // ../utils/lib/get-class-name-factory.ts
@@ -567,7 +567,7 @@ var styles_module_default = { "Chat": "_Chat_3s08c_1", "Chat-header": "_Chat-hea
567
567
 
568
568
  // src/components/ChatBody/index.tsx
569
569
  init_react_import();
570
- var import_react21 = require("react");
570
+ var import_react22 = require("react");
571
571
  var import_use_stick_to_bottom = require("use-stick-to-bottom");
572
572
  var import_react_markdown = __toESM(require("react-markdown"));
573
573
 
@@ -644,7 +644,7 @@ var import_react8 = require("react");
644
644
 
645
645
  // css-module:/home/runner/work/puck-platform/puck-platform/packages/platform-client/components/Button/Button.module.css#css-module
646
646
  init_react_import();
647
- var Button_module_default = { "Button": "_Button_1sscz_1", "Button--medium": "_Button--medium_1sscz_34", "Button--large": "_Button--large_1sscz_42", "Button-icon": "_Button-icon_1sscz_49", "Button--brand": "_Button--brand_1sscz_53", "Button--primary": "_Button--primary_1sscz_74", "Button--secondary": "_Button--secondary_1sscz_88", "Button--danger": "_Button--danger_1sscz_105", "Button--flush": "_Button--flush_1sscz_119", "Button--ghost": "_Button--ghost_1sscz_123", "Button--disabled": "_Button--disabled_1sscz_141", "Button--fullWidth": "_Button--fullWidth_1sscz_148", "Button-spinner": "_Button-spinner_1sscz_153" };
647
+ var Button_module_default = { "Button": "_Button_1br4o_1", "Button--medium": "_Button--medium_1br4o_34", "Button--large": "_Button--large_1br4o_42", "Button-icon": "_Button-icon_1br4o_49", "Button--brand": "_Button--brand_1br4o_53", "Button--primary": "_Button--primary_1br4o_74", "Button--secondary": "_Button--secondary_1br4o_88", "Button--danger": "_Button--danger_1br4o_105", "Button--flush": "_Button--flush_1br4o_119", "Button--ghost": "_Button--ghost_1br4o_123", "Button--disabled": "_Button--disabled_1br4o_140", "Button--fullWidth": "_Button--fullWidth_1br4o_147", "Button-spinner": "_Button-spinner_1br4o_152" };
648
648
 
649
649
  // ../platform-client/components/Loader/index.tsx
650
650
  init_react_import();
@@ -867,7 +867,7 @@ init_react_import();
867
867
 
868
868
  // css-module:/home/runner/work/puck-platform/puck-platform/packages/platform-client/components/Card/Card.module.css#css-module
869
869
  init_react_import();
870
- var Card_module_default = { "Card": "_Card_jzb6b_1", "Card-body": "_Card-body_jzb6b_17", "Card-title": "_Card-title_jzb6b_23", "Card-subtitle": "_Card-subtitle_jzb6b_27", "Card-chevron": "_Card-chevron_jzb6b_31", "Card--showChevron": "_Card--showChevron_jzb6b_37", "Card--isActive": "_Card--isActive_jzb6b_41" };
870
+ var Card_module_default = { "Card": "_Card_rpnal_1", "Card-body": "_Card-body_rpnal_17", "Card-title": "_Card-title_rpnal_23", "Card-subtitle": "_Card-subtitle_rpnal_27", "Card-chevron": "_Card-chevron_rpnal_32", "Card--showChevron": "_Card--showChevron_rpnal_38", "Card--isActive": "_Card--isActive_rpnal_42" };
871
871
 
872
872
  // ../platform-client/components/Card/Card.tsx
873
873
  var import_jsx_runtime9 = require("react/jsx-runtime");
@@ -1101,14 +1101,14 @@ init_react_import();
1101
1101
 
1102
1102
  // css-module:/home/runner/work/puck-platform/puck-platform/packages/platform-client/components/PlanGrid/styles.module.css#css-module
1103
1103
  init_react_import();
1104
- var styles_module_default4 = { "PlanGrid--loading": "_PlanGrid--loading_yaytb_1", "PlanGrid-grid": "_PlanGrid-grid_yaytb_5", "PlanGrid-enterprise": "_PlanGrid-enterprise_yaytb_16" };
1104
+ var styles_module_default4 = { "PlanGrid--loading": "_PlanGrid--loading_97rn7_1", "PlanGrid-grid": "_PlanGrid-grid_97rn7_5", "PlanGrid-enterprise": "_PlanGrid-enterprise_97rn7_16" };
1105
1105
 
1106
1106
  // ../platform-client/components/PlanCard/index.tsx
1107
1107
  init_react_import();
1108
1108
 
1109
1109
  // css-module:/home/runner/work/puck-platform/puck-platform/packages/platform-client/components/PlanCard/styles.module.css#css-module
1110
1110
  init_react_import();
1111
- var styles_module_default5 = { "PlanCard": "_PlanCard_xeanv_1", "PlanCard--enterprise": "_PlanCard--enterprise_xeanv_11", "PlanCard-title": "_PlanCard-title_xeanv_16", "PlanCard-header": "_PlanCard-header_xeanv_22", "PlanCard-features": "_PlanCard-features_xeanv_31", "PlanCard-feature": "_PlanCard-feature_xeanv_31", "PlanCard-featureIcon": "_PlanCard-featureIcon_xeanv_47", "PlanCard-featureTitle": "_PlanCard-featureTitle_xeanv_52", "PlanCard-priceValue": "_PlanCard-priceValue_xeanv_57", "PlanCard-priceInterval": "_PlanCard-priceInterval_xeanv_61", "PlanCard-body": "_PlanCard-body_xeanv_65", "PlanCard-section": "_PlanCard-section_xeanv_79", "PlanCard-sectionTitle": "_PlanCard-sectionTitle_xeanv_102", "PlanCard-sectionBody": "_PlanCard-sectionBody_xeanv_108", "PlanCard-usageItem": "_PlanCard-usageItem_xeanv_121", "PlanCard-usageLabel": "_PlanCard-usageLabel_xeanv_127", "PlanCard-usageValue": "_PlanCard-usageValue_xeanv_132", "PlanCard-action": "_PlanCard-action_xeanv_138" };
1111
+ var styles_module_default5 = { "PlanCard": "_PlanCard_16zmu_1", "PlanCard--enterprise": "_PlanCard--enterprise_16zmu_12", "PlanCard-title": "_PlanCard-title_16zmu_17", "PlanCard-header": "_PlanCard-header_16zmu_26", "PlanCard-features": "_PlanCard-features_16zmu_35", "PlanCard-feature": "_PlanCard-feature_16zmu_35", "PlanCard-featureIcon": "_PlanCard-featureIcon_16zmu_51", "PlanCard-featureTitle": "_PlanCard-featureTitle_16zmu_56", "PlanCard-priceValue": "_PlanCard-priceValue_16zmu_61", "PlanCard-priceInterval": "_PlanCard-priceInterval_16zmu_65", "PlanCard-body": "_PlanCard-body_16zmu_69", "PlanCard-section": "_PlanCard-section_16zmu_83", "PlanCard-sectionTitle": "_PlanCard-sectionTitle_16zmu_106", "PlanCard-sectionBody": "_PlanCard-sectionBody_16zmu_112", "PlanCard-usageItem": "_PlanCard-usageItem_16zmu_125", "PlanCard-usageLabel": "_PlanCard-usageLabel_16zmu_131", "PlanCard-usageValue": "_PlanCard-usageValue_16zmu_136", "PlanCard-action": "_PlanCard-action_16zmu_142", "PlanCard-description": "_PlanCard-description_16zmu_149", "PlanCard--highlight": "_PlanCard--highlight_16zmu_154", "PlanCard-highlightText": "_PlanCard-highlightText_16zmu_184", "PlanCard--fullWidth": "_PlanCard--fullWidth_16zmu_200" };
1112
1112
 
1113
1113
  // ../utils/lib/format-currency.ts
1114
1114
  init_react_import();
@@ -1131,115 +1131,8 @@ var formatUSD = (amount, round = false) => {
1131
1131
  return formatted;
1132
1132
  };
1133
1133
 
1134
- // ../platform-client/components/PlanCard/index.tsx
1135
- var import_jsx_runtime19 = require("react/jsx-runtime");
1136
- var cxCard = get_class_name_factory_default("PlanCard", styles_module_default5);
1137
- var Feature = ({
1138
- children,
1139
- title
1140
- }) => /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("li", { className: cxCard("feature"), children: [
1141
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: cxCard("featureIcon"), children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Check, { size: "12" }) }),
1142
- /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { children: [
1143
- title && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: cxCard("featureTitle"), children: [
1144
- title,
1145
- " "
1146
- ] }),
1147
- children
1148
- ] })
1149
- ] });
1150
- function round5(x2) {
1151
- return Math.ceil(x2 / 5) * 5;
1152
- }
1153
- var pricing = {
1154
- createPage: 0.2,
1155
- updatePage: 0.2
1156
- };
1157
- var PlanCard = ({
1158
- title,
1159
- credit,
1160
- price,
1161
- children,
1162
- productId,
1163
- bonusCredit,
1164
- currentProductId,
1165
- currentPlanStatus,
1166
- onUpgrade
1167
- }) => {
1168
- const userOnPlan = currentProductId === productId && currentPlanStatus === "active";
1169
- let isUpgrade = true;
1170
- if (currentProductId?.startsWith("business")) {
1171
- if (productId?.startsWith("pro")) {
1172
- isUpgrade = false;
1173
- }
1174
- } else if (currentProductId?.startsWith("growth")) {
1175
- if (productId?.startsWith("pro") || productId?.startsWith("business")) {
1176
- isUpgrade = false;
1177
- }
1178
- }
1179
- const priceUSD = typeof price === "number" ? formatUSD(price, true) : price;
1180
- const tokenCostEstimate = 0.1;
1181
- const pageEstimate = typeof credit === "number" ? round5(credit / (pricing.createPage + tokenCostEstimate)) : "N/A";
1182
- return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: cxCard(), children: [
1183
- /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: cxCard("header"), children: [
1184
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: cxCard("title"), children: title }),
1185
- /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: cxCard("price"), children: [
1186
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: cxCard("priceValue"), children: priceUSD }),
1187
- " ",
1188
- typeof price === "number" && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: cxCard("priceInterval"), children: "/ month" })
1189
- ] })
1190
- ] }),
1191
- /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: cxCard("body"), children: [
1192
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: cxCard("section"), children: /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: cxCard("sectionBody"), children: [
1193
- /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: cxCard("usageItem"), children: [
1194
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: cxCard("usageLabel"), children: "Monthly AI credit" }),
1195
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: cxCard("usageValue"), children: typeof credit === "number" ? formatUSD(credit, true) : credit })
1196
- ] }),
1197
- /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: cxCard("usageItem"), children: [
1198
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: cxCard("usageLabel"), children: "Early-bird bonus" }),
1199
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: cxCard("usageValue"), children: typeof bonusCredit === "number" ? formatUSD(bonusCredit, true) : bonusCredit })
1200
- ] }),
1201
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: cxCard("usageItem"), children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: cxCard("usageLabel"), style: { opacity: 0.6 }, children: "Top-up available" }) })
1202
- ] }) }),
1203
- " ",
1204
- /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: cxCard("section"), children: [
1205
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: cxCard("sectionTitle"), children: "Usage estimates" }),
1206
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: cxCard("sectionBody"), children: /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: cxCard("usageItem"), children: [
1207
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: cxCard("usageLabel"), children: "AI generations" }),
1208
- /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("span", { className: cxCard("usageValue"), children: [
1209
- typeof pageEstimate === "number" && "~",
1210
- pageEstimate.toLocaleString()
1211
- ] })
1212
- ] }) })
1213
- ] }),
1214
- /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: cxCard("section"), children: [
1215
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: cxCard("sectionTitle"), children: "Features" }),
1216
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: cxCard("sectionBody"), children })
1217
- ] })
1218
- ] }),
1219
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: cxCard("action"), children: userOnPlan ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Button, { fullWidth: true, disabled: true, href: "#", size: "large", children: "Current plan" }) : productId ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
1220
- Button,
1221
- {
1222
- size: "large",
1223
- fullWidth: true,
1224
- variant: isUpgrade ? "primary" : "secondary",
1225
- onClick: () => {
1226
- onUpgrade?.(productId);
1227
- },
1228
- children: isUpgrade ? "Upgrade" : "Downgrade"
1229
- }
1230
- ) : /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
1231
- Button,
1232
- {
1233
- size: "large",
1234
- fullWidth: true,
1235
- variant: "primary",
1236
- href: "http://cal.com/chrisvxd/puck-enquiry",
1237
- children: "Book a call"
1238
- }
1239
- ) })
1240
- ] });
1241
- };
1242
- PlanCard.Feature = Feature;
1134
+ // ../platform-client/lib/use-pricing-group.ts
1135
+ init_react_import();
1243
1136
 
1244
1137
  // ../../node_modules/.pnpm/posthog-js@1.314.0/node_modules/posthog-js/dist/module.js
1245
1138
  init_react_import();
@@ -6008,8 +5901,174 @@ var Go = (qo = Do[Lo] = new Bo(), (function() {
6008
5901
  null != o && o.addEventListener ? "complete" === o.readyState ? i2() : Ui(o, "DOMContentLoaded", i2, { capture: false }) : t && Ei.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized");
6009
5902
  })(), qo);
6010
5903
 
6011
- // ../platform-client/components/PlanGrid/index.tsx
5904
+ // ../platform-client/lib/use-pricing-group.ts
6012
5905
  var import_react16 = require("react");
5906
+ var usePricingGroup = () => {
5907
+ return (0, import_react16.useMemo)(
5908
+ () => Go.getFeatureFlag("pricing-alternatives-pt-2") || "control",
5909
+ []
5910
+ );
5911
+ };
5912
+
5913
+ // ../platform-client/components/PlanCard/index.tsx
5914
+ var import_jsx_runtime19 = require("react/jsx-runtime");
5915
+ var cxCard = get_class_name_factory_default("PlanCard", styles_module_default5);
5916
+ var Feature = ({
5917
+ children,
5918
+ title
5919
+ }) => /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("li", { className: cxCard("feature"), children: [
5920
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: cxCard("featureIcon"), children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Check, { size: "12" }) }),
5921
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { children: [
5922
+ title && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: cxCard("featureTitle"), children: [
5923
+ title,
5924
+ " "
5925
+ ] }),
5926
+ children
5927
+ ] })
5928
+ ] });
5929
+ function round5(x2) {
5930
+ return Math.ceil(x2 / 5) * 5;
5931
+ }
5932
+ var pricing = {
5933
+ createPage: 0.2,
5934
+ updatePage: 0.2
5935
+ };
5936
+ var PlanCard = ({
5937
+ title,
5938
+ credit,
5939
+ price,
5940
+ children,
5941
+ productId,
5942
+ bonusCredit,
5943
+ currentProductId,
5944
+ currentPlanStatus,
5945
+ onUpgrade,
5946
+ description,
5947
+ highlight,
5948
+ featuresTitle = "Features",
5949
+ fullWidth,
5950
+ ctaLabel
5951
+ }) => {
5952
+ const userOnPlan = currentProductId === productId && (currentPlanStatus === "active" || currentPlanStatus === "trialing");
5953
+ let isUpgrade = true;
5954
+ if (currentProductId?.startsWith("business")) {
5955
+ if (productId?.startsWith("pro")) {
5956
+ isUpgrade = false;
5957
+ }
5958
+ } else if (currentProductId?.startsWith("growth")) {
5959
+ if (productId?.startsWith("pro") || productId?.startsWith("business")) {
5960
+ isUpgrade = false;
5961
+ }
5962
+ }
5963
+ const priceUSD = typeof price === "number" ? formatUSD(price, true) : price;
5964
+ const tokenCostEstimate = 0.1;
5965
+ const pageEstimate = typeof credit === "number" ? round5(credit / (pricing.createPage + tokenCostEstimate)) : "N/A";
5966
+ const pricingGroup = usePricingGroup();
5967
+ if (pricingGroup.includes("unlimited")) {
5968
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: cxCard({ highlight, fullWidth }), children: [
5969
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: cxCard("header"), children: [
5970
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: cxCard("title"), children: [
5971
+ title,
5972
+ highlight && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: cxCard("highlightText"), children: "Popular" })
5973
+ ] }),
5974
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: cxCard("price"), children: [
5975
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: cxCard("priceValue"), children: priceUSD }),
5976
+ " ",
5977
+ typeof price === "number" && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: cxCard("priceInterval"), children: "/ month" })
5978
+ ] }),
5979
+ description && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { className: cxCard("description"), children: description })
5980
+ ] }),
5981
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: cxCard("body"), children: /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: cxCard("section"), children: [
5982
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: cxCard("sectionTitle"), children: featuresTitle }),
5983
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: cxCard("sectionBody"), children })
5984
+ ] }) }),
5985
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: cxCard("action"), children: userOnPlan ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Button, { fullWidth: true, disabled: true, href: "#", size: "large", children: "Current plan" }) : productId ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
5986
+ Button,
5987
+ {
5988
+ size: "large",
5989
+ fullWidth: true,
5990
+ variant: isUpgrade ? "primary" : "secondary",
5991
+ onClick: () => {
5992
+ onUpgrade?.(productId);
5993
+ },
5994
+ children: isUpgrade ? ctaLabel ?? "Upgrade" : "Downgrade"
5995
+ }
5996
+ ) : /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
5997
+ Button,
5998
+ {
5999
+ size: "large",
6000
+ fullWidth: true,
6001
+ variant: "ghost",
6002
+ href: "http://cal.com/chrisvxd/puck-enquiry",
6003
+ children: "Book a call"
6004
+ }
6005
+ ) })
6006
+ ] });
6007
+ }
6008
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: cxCard(), children: [
6009
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: cxCard("header"), children: [
6010
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: cxCard("title"), children: title }),
6011
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: cxCard("price"), children: [
6012
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: cxCard("priceValue"), children: priceUSD }),
6013
+ " ",
6014
+ typeof price === "number" && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: cxCard("priceInterval"), children: "/ month" })
6015
+ ] })
6016
+ ] }),
6017
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: cxCard("body"), children: [
6018
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: cxCard("section"), children: /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: cxCard("sectionBody"), children: [
6019
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: cxCard("usageItem"), children: [
6020
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: cxCard("usageLabel"), children: "Monthly AI credit" }),
6021
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: cxCard("usageValue"), children: typeof credit === "number" ? formatUSD(credit, true) : credit })
6022
+ ] }),
6023
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: cxCard("usageItem"), children: [
6024
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: cxCard("usageLabel"), children: "Early-bird bonus" }),
6025
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: cxCard("usageValue"), children: typeof bonusCredit === "number" ? formatUSD(bonusCredit, true) : bonusCredit })
6026
+ ] }),
6027
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: cxCard("usageItem"), children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: cxCard("usageLabel"), style: { opacity: 0.6 }, children: "Top-up available" }) })
6028
+ ] }) }),
6029
+ " ",
6030
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: cxCard("section"), children: [
6031
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: cxCard("sectionTitle"), children: "Usage estimates" }),
6032
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: cxCard("sectionBody"), children: /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: cxCard("usageItem"), children: [
6033
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: cxCard("usageLabel"), children: "AI generations" }),
6034
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("span", { className: cxCard("usageValue"), children: [
6035
+ typeof pageEstimate === "number" && "~",
6036
+ pageEstimate.toLocaleString()
6037
+ ] })
6038
+ ] }) })
6039
+ ] }),
6040
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: cxCard("section"), children: [
6041
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: cxCard("sectionTitle"), children: "Features" }),
6042
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: cxCard("sectionBody"), children })
6043
+ ] })
6044
+ ] }),
6045
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: cxCard("action"), children: userOnPlan ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Button, { fullWidth: true, disabled: true, href: "#", size: "large", children: "Current plan" }) : productId ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
6046
+ Button,
6047
+ {
6048
+ size: "large",
6049
+ fullWidth: true,
6050
+ variant: isUpgrade ? "primary" : "secondary",
6051
+ onClick: () => {
6052
+ onUpgrade?.(productId);
6053
+ },
6054
+ children: isUpgrade ? "Upgrade" : "Downgrade"
6055
+ }
6056
+ ) : /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
6057
+ Button,
6058
+ {
6059
+ size: "large",
6060
+ fullWidth: true,
6061
+ variant: "primary",
6062
+ href: "http://cal.com/chrisvxd/puck-enquiry",
6063
+ children: "Book a call"
6064
+ }
6065
+ ) })
6066
+ ] });
6067
+ };
6068
+ PlanCard.Feature = Feature;
6069
+
6070
+ // ../platform-client/components/PlanGrid/index.tsx
6071
+ var import_react17 = require("react");
6013
6072
  var import_jsx_runtime20 = require("react/jsx-runtime");
6014
6073
  var cx5 = get_class_name_factory_default("PlanGrid", styles_module_default4);
6015
6074
 
@@ -6055,7 +6114,7 @@ init_react_import();
6055
6114
 
6056
6115
  // ../platform-client/components/Table/Table.tsx
6057
6116
  init_react_import();
6058
- var import_react17 = require("react");
6117
+ var import_react18 = require("react");
6059
6118
 
6060
6119
  // css-module:/home/runner/work/puck-platform/puck-platform/packages/platform-client/components/Table/Table.module.css#css-module
6061
6120
  init_react_import();
@@ -6097,9 +6156,9 @@ var cx6 = getClassNameFactory("Viewport", styles_module_default6);
6097
6156
 
6098
6157
  // ../platform-client/context/editor.tsx
6099
6158
  init_react_import();
6100
- var import_react18 = require("react");
6159
+ var import_react19 = require("react");
6101
6160
  var import_jsx_runtime27 = require("react/jsx-runtime");
6102
- var ctx = (0, import_react18.createContext)({});
6161
+ var ctx = (0, import_react19.createContext)({});
6103
6162
 
6104
6163
  // css-module:/home/runner/work/puck-platform/puck-platform/packages/plugin-ai/src/components/ChatBody/styles.module.css#css-module
6105
6164
  init_react_import();
@@ -6107,7 +6166,7 @@ var styles_module_default7 = { "Chat": "_Chat_1njo2_1", "Chat-inner": "_Chat-inn
6107
6166
 
6108
6167
  // src/components/PromptForm/index.tsx
6109
6168
  init_react_import();
6110
- var import_react19 = require("react");
6169
+ var import_react20 = require("react");
6111
6170
 
6112
6171
  // css-module:/home/runner/work/puck-platform/puck-platform/packages/plugin-ai/src/components/PromptForm/styles.module.css#css-module
6113
6172
  init_react_import();
@@ -6131,10 +6190,10 @@ function PromptForm({
6131
6190
  maxRows = 5,
6132
6191
  value = ""
6133
6192
  }) {
6134
- const hasSetInitialPrompt = (0, import_react19.useRef)(false);
6135
- const [prompt, setPrompt] = (0, import_react19.useState)(value);
6136
- const internalRef = (0, import_react19.useRef)(null);
6137
- (0, import_react19.useEffect)(() => {
6193
+ const hasSetInitialPrompt = (0, import_react20.useRef)(false);
6194
+ const [prompt, setPrompt] = (0, import_react20.useState)(value);
6195
+ const internalRef = (0, import_react20.useRef)(null);
6196
+ (0, import_react20.useEffect)(() => {
6138
6197
  setPrompt(value);
6139
6198
  }, [setPrompt, value]);
6140
6199
  const sendPrompt = () => {
@@ -6144,7 +6203,7 @@ function PromptForm({
6144
6203
  }
6145
6204
  setPrompt("");
6146
6205
  };
6147
- (0, import_react19.useEffect)(() => {
6206
+ (0, import_react20.useEffect)(() => {
6148
6207
  const currentUrl = new URL(location.href);
6149
6208
  const initialPrompt = currentUrl.searchParams.get("initialPrompt");
6150
6209
  if (!hasSetInitialPrompt.current && initialPrompt && prompt === "") {
@@ -6250,8 +6309,8 @@ function PromptForm({
6250
6309
 
6251
6310
  // src/lib/context.ts
6252
6311
  init_react_import();
6253
- var import_react20 = require("react");
6254
- var toolStatusContext = (0, import_react20.createContext)({});
6312
+ var import_react21 = require("react");
6313
+ var toolStatusContext = (0, import_react21.createContext)({});
6255
6314
  var ToolStatusProvider = toolStatusContext.Provider;
6256
6315
 
6257
6316
  // src/components/ChatBody/index.tsx
@@ -6346,7 +6405,7 @@ function PuckTool({
6346
6405
  output,
6347
6406
  defaultLabel = "Thinking..."
6348
6407
  }) {
6349
- const toolStatus = (0, import_react21.useContext)(toolStatusContext)[toolCallId];
6408
+ const toolStatus = (0, import_react22.useContext)(toolStatusContext)[toolCallId];
6350
6409
  const outputObj = output;
6351
6410
  const status = outputObj && "status" in outputObj ? outputObj.status : toolStatus ?? { loading: true, label: defaultLabel };
6352
6411
  return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(ToolStatus, { status });
@@ -6560,12 +6619,12 @@ function Chat2({
6560
6619
  const { examplePrompts } = chat ?? {};
6561
6620
  const puckDispatch = usePuck((s2) => s2.dispatch);
6562
6621
  const getPuck = (0, import_core2.useGetPuck)();
6563
- const localChatId = (0, import_react23.useRef)("");
6564
- const inputRef = (0, import_react23.useRef)(null);
6565
- const pluginRef = (0, import_react23.useRef)(null);
6566
- const [error, setError] = (0, import_react23.useState)();
6567
- const [toolStatus, setToolStatus] = (0, import_react23.useState)({});
6568
- const uploadScreenshot = (0, import_react23.useCallback)(
6622
+ const localChatId = (0, import_react24.useRef)("");
6623
+ const inputRef = (0, import_react24.useRef)(null);
6624
+ const pluginRef = (0, import_react24.useRef)(null);
6625
+ const [error, setError] = (0, import_react24.useState)();
6626
+ const [toolStatus, setToolStatus] = (0, import_react24.useState)({});
6627
+ const uploadScreenshot = (0, import_react24.useCallback)(
6569
6628
  async (width, bucketUrl) => {
6570
6629
  const iframeDocument = document?.getElementById("preview-frame")?.contentDocument?.documentElement ?? null;
6571
6630
  if (!iframeDocument) return;
@@ -6593,7 +6652,7 @@ function Chat2({
6593
6652
  },
6594
6653
  []
6595
6654
  );
6596
- const processData = (0, import_react23.useCallback)(
6655
+ const processData = (0, import_react24.useCallback)(
6597
6656
  (dataPart) => {
6598
6657
  switch (dataPart.type) {
6599
6658
  case "data-new-chat-created": {
@@ -6718,12 +6777,12 @@ function Chat2({
6718
6777
  }
6719
6778
  }
6720
6779
  });
6721
- const [forcedStatus, setForcedStatus] = (0, import_react23.useState)();
6722
- const resolvedStatus = (0, import_react23.useMemo)(
6780
+ const [forcedStatus, setForcedStatus] = (0, import_react24.useState)();
6781
+ const resolvedStatus = (0, import_react24.useMemo)(
6723
6782
  () => forcedStatus ?? status,
6724
6783
  [status, forcedStatus]
6725
6784
  );
6726
- (0, import_react23.useEffect)(() => {
6785
+ (0, import_react24.useEffect)(() => {
6727
6786
  window.__PUCK_AI = {
6728
6787
  processData,
6729
6788
  setMessages,
@@ -6747,7 +6806,7 @@ function Chat2({
6747
6806
  console.error(e2);
6748
6807
  });
6749
6808
  };
6750
- const messagesWithStatuses = (0, import_react23.useMemo)(() => {
6809
+ const messagesWithStatuses = (0, import_react24.useMemo)(() => {
6751
6810
  return messages.map((msg) => {
6752
6811
  return {
6753
6812
  ...msg,
@@ -6850,7 +6909,7 @@ function isScrolledIntoView(el) {
6850
6909
 
6851
6910
  // src/components/ScrollTracking/ScrollTracking.tsx
6852
6911
  init_react_import();
6853
- var import_react25 = require("react");
6912
+ var import_react26 = require("react");
6854
6913
 
6855
6914
  // src/lib/scroll-into-view-local.ts
6856
6915
  init_react_import();
@@ -6873,9 +6932,9 @@ function scrollIntoViewLocal(el, win, behavior = "smooth") {
6873
6932
 
6874
6933
  // src/lib/use-frame-mutation-observer.ts
6875
6934
  init_react_import();
6876
- var import_react24 = require("react");
6935
+ var import_react25 = require("react");
6877
6936
  function useFrameMutationObserver(callback) {
6878
- return (0, import_react24.useCallback)(() => {
6937
+ return (0, import_react25.useCallback)(() => {
6879
6938
  const frame = document?.getElementById(
6880
6939
  "preview-frame"
6881
6940
  );
@@ -6917,7 +6976,7 @@ function useFrameMutationObserver(callback) {
6917
6976
 
6918
6977
  // src/components/ScrollTracking/ScrollTracking.tsx
6919
6978
  var ScrollTracking = ({ children }) => {
6920
- const followedRefs = (0, import_react25.useRef)([]);
6979
+ const followedRefs = (0, import_react26.useRef)([]);
6921
6980
  const follow = useFrameMutationObserver((records, win) => {
6922
6981
  if (records.length > 0) {
6923
6982
  const lastRecord = records[records.length - 1];
@@ -6929,7 +6988,7 @@ var ScrollTracking = ({ children }) => {
6929
6988
  });
6930
6989
  }
6931
6990
  });
6932
- (0, import_react25.useEffect)(() => {
6991
+ (0, import_react26.useEffect)(() => {
6933
6992
  follow();
6934
6993
  }, [follow]);
6935
6994
  return children;
package/dist/index.mjs CHANGED
@@ -641,7 +641,7 @@ import { useEffect as useEffect4, useState as useState4 } from "react";
641
641
 
642
642
  // css-module:/home/runner/work/puck-platform/puck-platform/packages/platform-client/components/Button/Button.module.css#css-module
643
643
  init_react_import();
644
- var Button_module_default = { "Button": "_Button_1sscz_1", "Button--medium": "_Button--medium_1sscz_34", "Button--large": "_Button--large_1sscz_42", "Button-icon": "_Button-icon_1sscz_49", "Button--brand": "_Button--brand_1sscz_53", "Button--primary": "_Button--primary_1sscz_74", "Button--secondary": "_Button--secondary_1sscz_88", "Button--danger": "_Button--danger_1sscz_105", "Button--flush": "_Button--flush_1sscz_119", "Button--ghost": "_Button--ghost_1sscz_123", "Button--disabled": "_Button--disabled_1sscz_141", "Button--fullWidth": "_Button--fullWidth_1sscz_148", "Button-spinner": "_Button-spinner_1sscz_153" };
644
+ var Button_module_default = { "Button": "_Button_1br4o_1", "Button--medium": "_Button--medium_1br4o_34", "Button--large": "_Button--large_1br4o_42", "Button-icon": "_Button-icon_1br4o_49", "Button--brand": "_Button--brand_1br4o_53", "Button--primary": "_Button--primary_1br4o_74", "Button--secondary": "_Button--secondary_1br4o_88", "Button--danger": "_Button--danger_1br4o_105", "Button--flush": "_Button--flush_1br4o_119", "Button--ghost": "_Button--ghost_1br4o_123", "Button--disabled": "_Button--disabled_1br4o_140", "Button--fullWidth": "_Button--fullWidth_1br4o_147", "Button-spinner": "_Button-spinner_1br4o_152" };
645
645
 
646
646
  // ../platform-client/components/Loader/index.tsx
647
647
  init_react_import();
@@ -864,7 +864,7 @@ init_react_import();
864
864
 
865
865
  // css-module:/home/runner/work/puck-platform/puck-platform/packages/platform-client/components/Card/Card.module.css#css-module
866
866
  init_react_import();
867
- var Card_module_default = { "Card": "_Card_jzb6b_1", "Card-body": "_Card-body_jzb6b_17", "Card-title": "_Card-title_jzb6b_23", "Card-subtitle": "_Card-subtitle_jzb6b_27", "Card-chevron": "_Card-chevron_jzb6b_31", "Card--showChevron": "_Card--showChevron_jzb6b_37", "Card--isActive": "_Card--isActive_jzb6b_41" };
867
+ var Card_module_default = { "Card": "_Card_rpnal_1", "Card-body": "_Card-body_rpnal_17", "Card-title": "_Card-title_rpnal_23", "Card-subtitle": "_Card-subtitle_rpnal_27", "Card-chevron": "_Card-chevron_rpnal_32", "Card--showChevron": "_Card--showChevron_rpnal_38", "Card--isActive": "_Card--isActive_rpnal_42" };
868
868
 
869
869
  // ../platform-client/components/Card/Card.tsx
870
870
  import { jsx as jsx9, jsxs as jsxs5 } from "react/jsx-runtime";
@@ -1098,14 +1098,14 @@ init_react_import();
1098
1098
 
1099
1099
  // css-module:/home/runner/work/puck-platform/puck-platform/packages/platform-client/components/PlanGrid/styles.module.css#css-module
1100
1100
  init_react_import();
1101
- var styles_module_default4 = { "PlanGrid--loading": "_PlanGrid--loading_yaytb_1", "PlanGrid-grid": "_PlanGrid-grid_yaytb_5", "PlanGrid-enterprise": "_PlanGrid-enterprise_yaytb_16" };
1101
+ var styles_module_default4 = { "PlanGrid--loading": "_PlanGrid--loading_97rn7_1", "PlanGrid-grid": "_PlanGrid-grid_97rn7_5", "PlanGrid-enterprise": "_PlanGrid-enterprise_97rn7_16" };
1102
1102
 
1103
1103
  // ../platform-client/components/PlanCard/index.tsx
1104
1104
  init_react_import();
1105
1105
 
1106
1106
  // css-module:/home/runner/work/puck-platform/puck-platform/packages/platform-client/components/PlanCard/styles.module.css#css-module
1107
1107
  init_react_import();
1108
- var styles_module_default5 = { "PlanCard": "_PlanCard_xeanv_1", "PlanCard--enterprise": "_PlanCard--enterprise_xeanv_11", "PlanCard-title": "_PlanCard-title_xeanv_16", "PlanCard-header": "_PlanCard-header_xeanv_22", "PlanCard-features": "_PlanCard-features_xeanv_31", "PlanCard-feature": "_PlanCard-feature_xeanv_31", "PlanCard-featureIcon": "_PlanCard-featureIcon_xeanv_47", "PlanCard-featureTitle": "_PlanCard-featureTitle_xeanv_52", "PlanCard-priceValue": "_PlanCard-priceValue_xeanv_57", "PlanCard-priceInterval": "_PlanCard-priceInterval_xeanv_61", "PlanCard-body": "_PlanCard-body_xeanv_65", "PlanCard-section": "_PlanCard-section_xeanv_79", "PlanCard-sectionTitle": "_PlanCard-sectionTitle_xeanv_102", "PlanCard-sectionBody": "_PlanCard-sectionBody_xeanv_108", "PlanCard-usageItem": "_PlanCard-usageItem_xeanv_121", "PlanCard-usageLabel": "_PlanCard-usageLabel_xeanv_127", "PlanCard-usageValue": "_PlanCard-usageValue_xeanv_132", "PlanCard-action": "_PlanCard-action_xeanv_138" };
1108
+ var styles_module_default5 = { "PlanCard": "_PlanCard_16zmu_1", "PlanCard--enterprise": "_PlanCard--enterprise_16zmu_12", "PlanCard-title": "_PlanCard-title_16zmu_17", "PlanCard-header": "_PlanCard-header_16zmu_26", "PlanCard-features": "_PlanCard-features_16zmu_35", "PlanCard-feature": "_PlanCard-feature_16zmu_35", "PlanCard-featureIcon": "_PlanCard-featureIcon_16zmu_51", "PlanCard-featureTitle": "_PlanCard-featureTitle_16zmu_56", "PlanCard-priceValue": "_PlanCard-priceValue_16zmu_61", "PlanCard-priceInterval": "_PlanCard-priceInterval_16zmu_65", "PlanCard-body": "_PlanCard-body_16zmu_69", "PlanCard-section": "_PlanCard-section_16zmu_83", "PlanCard-sectionTitle": "_PlanCard-sectionTitle_16zmu_106", "PlanCard-sectionBody": "_PlanCard-sectionBody_16zmu_112", "PlanCard-usageItem": "_PlanCard-usageItem_16zmu_125", "PlanCard-usageLabel": "_PlanCard-usageLabel_16zmu_131", "PlanCard-usageValue": "_PlanCard-usageValue_16zmu_136", "PlanCard-action": "_PlanCard-action_16zmu_142", "PlanCard-description": "_PlanCard-description_16zmu_149", "PlanCard--highlight": "_PlanCard--highlight_16zmu_154", "PlanCard-highlightText": "_PlanCard-highlightText_16zmu_184", "PlanCard--fullWidth": "_PlanCard--fullWidth_16zmu_200" };
1109
1109
 
1110
1110
  // ../utils/lib/format-currency.ts
1111
1111
  init_react_import();
@@ -1128,115 +1128,8 @@ var formatUSD = (amount, round = false) => {
1128
1128
  return formatted;
1129
1129
  };
1130
1130
 
1131
- // ../platform-client/components/PlanCard/index.tsx
1132
- import { jsx as jsx19, jsxs as jsxs11 } from "react/jsx-runtime";
1133
- var cxCard = get_class_name_factory_default("PlanCard", styles_module_default5);
1134
- var Feature = ({
1135
- children,
1136
- title
1137
- }) => /* @__PURE__ */ jsxs11("li", { className: cxCard("feature"), children: [
1138
- /* @__PURE__ */ jsx19("div", { className: cxCard("featureIcon"), children: /* @__PURE__ */ jsx19(Check, { size: "12" }) }),
1139
- /* @__PURE__ */ jsxs11("div", { children: [
1140
- title && /* @__PURE__ */ jsxs11("div", { className: cxCard("featureTitle"), children: [
1141
- title,
1142
- " "
1143
- ] }),
1144
- children
1145
- ] })
1146
- ] });
1147
- function round5(x2) {
1148
- return Math.ceil(x2 / 5) * 5;
1149
- }
1150
- var pricing = {
1151
- createPage: 0.2,
1152
- updatePage: 0.2
1153
- };
1154
- var PlanCard = ({
1155
- title,
1156
- credit,
1157
- price,
1158
- children,
1159
- productId,
1160
- bonusCredit,
1161
- currentProductId,
1162
- currentPlanStatus,
1163
- onUpgrade
1164
- }) => {
1165
- const userOnPlan = currentProductId === productId && currentPlanStatus === "active";
1166
- let isUpgrade = true;
1167
- if (currentProductId?.startsWith("business")) {
1168
- if (productId?.startsWith("pro")) {
1169
- isUpgrade = false;
1170
- }
1171
- } else if (currentProductId?.startsWith("growth")) {
1172
- if (productId?.startsWith("pro") || productId?.startsWith("business")) {
1173
- isUpgrade = false;
1174
- }
1175
- }
1176
- const priceUSD = typeof price === "number" ? formatUSD(price, true) : price;
1177
- const tokenCostEstimate = 0.1;
1178
- const pageEstimate = typeof credit === "number" ? round5(credit / (pricing.createPage + tokenCostEstimate)) : "N/A";
1179
- return /* @__PURE__ */ jsxs11("div", { className: cxCard(), children: [
1180
- /* @__PURE__ */ jsxs11("div", { className: cxCard("header"), children: [
1181
- /* @__PURE__ */ jsx19("div", { className: cxCard("title"), children: title }),
1182
- /* @__PURE__ */ jsxs11("div", { className: cxCard("price"), children: [
1183
- /* @__PURE__ */ jsx19("span", { className: cxCard("priceValue"), children: priceUSD }),
1184
- " ",
1185
- typeof price === "number" && /* @__PURE__ */ jsx19("span", { className: cxCard("priceInterval"), children: "/ month" })
1186
- ] })
1187
- ] }),
1188
- /* @__PURE__ */ jsxs11("div", { className: cxCard("body"), children: [
1189
- /* @__PURE__ */ jsx19("div", { className: cxCard("section"), children: /* @__PURE__ */ jsxs11("div", { className: cxCard("sectionBody"), children: [
1190
- /* @__PURE__ */ jsxs11("div", { className: cxCard("usageItem"), children: [
1191
- /* @__PURE__ */ jsx19("span", { className: cxCard("usageLabel"), children: "Monthly AI credit" }),
1192
- /* @__PURE__ */ jsx19("span", { className: cxCard("usageValue"), children: typeof credit === "number" ? formatUSD(credit, true) : credit })
1193
- ] }),
1194
- /* @__PURE__ */ jsxs11("div", { className: cxCard("usageItem"), children: [
1195
- /* @__PURE__ */ jsx19("span", { className: cxCard("usageLabel"), children: "Early-bird bonus" }),
1196
- /* @__PURE__ */ jsx19("span", { className: cxCard("usageValue"), children: typeof bonusCredit === "number" ? formatUSD(bonusCredit, true) : bonusCredit })
1197
- ] }),
1198
- /* @__PURE__ */ jsx19("div", { className: cxCard("usageItem"), children: /* @__PURE__ */ jsx19("span", { className: cxCard("usageLabel"), style: { opacity: 0.6 }, children: "Top-up available" }) })
1199
- ] }) }),
1200
- " ",
1201
- /* @__PURE__ */ jsxs11("div", { className: cxCard("section"), children: [
1202
- /* @__PURE__ */ jsx19("div", { className: cxCard("sectionTitle"), children: "Usage estimates" }),
1203
- /* @__PURE__ */ jsx19("div", { className: cxCard("sectionBody"), children: /* @__PURE__ */ jsxs11("div", { className: cxCard("usageItem"), children: [
1204
- /* @__PURE__ */ jsx19("span", { className: cxCard("usageLabel"), children: "AI generations" }),
1205
- /* @__PURE__ */ jsxs11("span", { className: cxCard("usageValue"), children: [
1206
- typeof pageEstimate === "number" && "~",
1207
- pageEstimate.toLocaleString()
1208
- ] })
1209
- ] }) })
1210
- ] }),
1211
- /* @__PURE__ */ jsxs11("div", { className: cxCard("section"), children: [
1212
- /* @__PURE__ */ jsx19("div", { className: cxCard("sectionTitle"), children: "Features" }),
1213
- /* @__PURE__ */ jsx19("div", { className: cxCard("sectionBody"), children })
1214
- ] })
1215
- ] }),
1216
- /* @__PURE__ */ jsx19("div", { className: cxCard("action"), children: userOnPlan ? /* @__PURE__ */ jsx19(Button, { fullWidth: true, disabled: true, href: "#", size: "large", children: "Current plan" }) : productId ? /* @__PURE__ */ jsx19(
1217
- Button,
1218
- {
1219
- size: "large",
1220
- fullWidth: true,
1221
- variant: isUpgrade ? "primary" : "secondary",
1222
- onClick: () => {
1223
- onUpgrade?.(productId);
1224
- },
1225
- children: isUpgrade ? "Upgrade" : "Downgrade"
1226
- }
1227
- ) : /* @__PURE__ */ jsx19(
1228
- Button,
1229
- {
1230
- size: "large",
1231
- fullWidth: true,
1232
- variant: "primary",
1233
- href: "http://cal.com/chrisvxd/puck-enquiry",
1234
- children: "Book a call"
1235
- }
1236
- ) })
1237
- ] });
1238
- };
1239
- PlanCard.Feature = Feature;
1131
+ // ../platform-client/lib/use-pricing-group.ts
1132
+ init_react_import();
1240
1133
 
1241
1134
  // ../../node_modules/.pnpm/posthog-js@1.314.0/node_modules/posthog-js/dist/module.js
1242
1135
  init_react_import();
@@ -6005,9 +5898,175 @@ var Go = (qo = Do[Lo] = new Bo(), (function() {
6005
5898
  null != o && o.addEventListener ? "complete" === o.readyState ? i2() : Ui(o, "DOMContentLoaded", i2, { capture: false }) : t && Ei.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized");
6006
5899
  })(), qo);
6007
5900
 
5901
+ // ../platform-client/lib/use-pricing-group.ts
5902
+ import { useMemo as useMemo2 } from "react";
5903
+ var usePricingGroup = () => {
5904
+ return useMemo2(
5905
+ () => Go.getFeatureFlag("pricing-alternatives-pt-2") || "control",
5906
+ []
5907
+ );
5908
+ };
5909
+
5910
+ // ../platform-client/components/PlanCard/index.tsx
5911
+ import { jsx as jsx19, jsxs as jsxs11 } from "react/jsx-runtime";
5912
+ var cxCard = get_class_name_factory_default("PlanCard", styles_module_default5);
5913
+ var Feature = ({
5914
+ children,
5915
+ title
5916
+ }) => /* @__PURE__ */ jsxs11("li", { className: cxCard("feature"), children: [
5917
+ /* @__PURE__ */ jsx19("div", { className: cxCard("featureIcon"), children: /* @__PURE__ */ jsx19(Check, { size: "12" }) }),
5918
+ /* @__PURE__ */ jsxs11("div", { children: [
5919
+ title && /* @__PURE__ */ jsxs11("div", { className: cxCard("featureTitle"), children: [
5920
+ title,
5921
+ " "
5922
+ ] }),
5923
+ children
5924
+ ] })
5925
+ ] });
5926
+ function round5(x2) {
5927
+ return Math.ceil(x2 / 5) * 5;
5928
+ }
5929
+ var pricing = {
5930
+ createPage: 0.2,
5931
+ updatePage: 0.2
5932
+ };
5933
+ var PlanCard = ({
5934
+ title,
5935
+ credit,
5936
+ price,
5937
+ children,
5938
+ productId,
5939
+ bonusCredit,
5940
+ currentProductId,
5941
+ currentPlanStatus,
5942
+ onUpgrade,
5943
+ description,
5944
+ highlight,
5945
+ featuresTitle = "Features",
5946
+ fullWidth,
5947
+ ctaLabel
5948
+ }) => {
5949
+ const userOnPlan = currentProductId === productId && (currentPlanStatus === "active" || currentPlanStatus === "trialing");
5950
+ let isUpgrade = true;
5951
+ if (currentProductId?.startsWith("business")) {
5952
+ if (productId?.startsWith("pro")) {
5953
+ isUpgrade = false;
5954
+ }
5955
+ } else if (currentProductId?.startsWith("growth")) {
5956
+ if (productId?.startsWith("pro") || productId?.startsWith("business")) {
5957
+ isUpgrade = false;
5958
+ }
5959
+ }
5960
+ const priceUSD = typeof price === "number" ? formatUSD(price, true) : price;
5961
+ const tokenCostEstimate = 0.1;
5962
+ const pageEstimate = typeof credit === "number" ? round5(credit / (pricing.createPage + tokenCostEstimate)) : "N/A";
5963
+ const pricingGroup = usePricingGroup();
5964
+ if (pricingGroup.includes("unlimited")) {
5965
+ return /* @__PURE__ */ jsxs11("div", { className: cxCard({ highlight, fullWidth }), children: [
5966
+ /* @__PURE__ */ jsxs11("div", { className: cxCard("header"), children: [
5967
+ /* @__PURE__ */ jsxs11("div", { className: cxCard("title"), children: [
5968
+ title,
5969
+ highlight && /* @__PURE__ */ jsx19("div", { className: cxCard("highlightText"), children: "Popular" })
5970
+ ] }),
5971
+ /* @__PURE__ */ jsxs11("div", { className: cxCard("price"), children: [
5972
+ /* @__PURE__ */ jsx19("span", { className: cxCard("priceValue"), children: priceUSD }),
5973
+ " ",
5974
+ typeof price === "number" && /* @__PURE__ */ jsx19("span", { className: cxCard("priceInterval"), children: "/ month" })
5975
+ ] }),
5976
+ description && /* @__PURE__ */ jsx19("p", { className: cxCard("description"), children: description })
5977
+ ] }),
5978
+ /* @__PURE__ */ jsx19("div", { className: cxCard("body"), children: /* @__PURE__ */ jsxs11("div", { className: cxCard("section"), children: [
5979
+ /* @__PURE__ */ jsx19("div", { className: cxCard("sectionTitle"), children: featuresTitle }),
5980
+ /* @__PURE__ */ jsx19("div", { className: cxCard("sectionBody"), children })
5981
+ ] }) }),
5982
+ /* @__PURE__ */ jsx19("div", { className: cxCard("action"), children: userOnPlan ? /* @__PURE__ */ jsx19(Button, { fullWidth: true, disabled: true, href: "#", size: "large", children: "Current plan" }) : productId ? /* @__PURE__ */ jsx19(
5983
+ Button,
5984
+ {
5985
+ size: "large",
5986
+ fullWidth: true,
5987
+ variant: isUpgrade ? "primary" : "secondary",
5988
+ onClick: () => {
5989
+ onUpgrade?.(productId);
5990
+ },
5991
+ children: isUpgrade ? ctaLabel ?? "Upgrade" : "Downgrade"
5992
+ }
5993
+ ) : /* @__PURE__ */ jsx19(
5994
+ Button,
5995
+ {
5996
+ size: "large",
5997
+ fullWidth: true,
5998
+ variant: "ghost",
5999
+ href: "http://cal.com/chrisvxd/puck-enquiry",
6000
+ children: "Book a call"
6001
+ }
6002
+ ) })
6003
+ ] });
6004
+ }
6005
+ return /* @__PURE__ */ jsxs11("div", { className: cxCard(), children: [
6006
+ /* @__PURE__ */ jsxs11("div", { className: cxCard("header"), children: [
6007
+ /* @__PURE__ */ jsx19("div", { className: cxCard("title"), children: title }),
6008
+ /* @__PURE__ */ jsxs11("div", { className: cxCard("price"), children: [
6009
+ /* @__PURE__ */ jsx19("span", { className: cxCard("priceValue"), children: priceUSD }),
6010
+ " ",
6011
+ typeof price === "number" && /* @__PURE__ */ jsx19("span", { className: cxCard("priceInterval"), children: "/ month" })
6012
+ ] })
6013
+ ] }),
6014
+ /* @__PURE__ */ jsxs11("div", { className: cxCard("body"), children: [
6015
+ /* @__PURE__ */ jsx19("div", { className: cxCard("section"), children: /* @__PURE__ */ jsxs11("div", { className: cxCard("sectionBody"), children: [
6016
+ /* @__PURE__ */ jsxs11("div", { className: cxCard("usageItem"), children: [
6017
+ /* @__PURE__ */ jsx19("span", { className: cxCard("usageLabel"), children: "Monthly AI credit" }),
6018
+ /* @__PURE__ */ jsx19("span", { className: cxCard("usageValue"), children: typeof credit === "number" ? formatUSD(credit, true) : credit })
6019
+ ] }),
6020
+ /* @__PURE__ */ jsxs11("div", { className: cxCard("usageItem"), children: [
6021
+ /* @__PURE__ */ jsx19("span", { className: cxCard("usageLabel"), children: "Early-bird bonus" }),
6022
+ /* @__PURE__ */ jsx19("span", { className: cxCard("usageValue"), children: typeof bonusCredit === "number" ? formatUSD(bonusCredit, true) : bonusCredit })
6023
+ ] }),
6024
+ /* @__PURE__ */ jsx19("div", { className: cxCard("usageItem"), children: /* @__PURE__ */ jsx19("span", { className: cxCard("usageLabel"), style: { opacity: 0.6 }, children: "Top-up available" }) })
6025
+ ] }) }),
6026
+ " ",
6027
+ /* @__PURE__ */ jsxs11("div", { className: cxCard("section"), children: [
6028
+ /* @__PURE__ */ jsx19("div", { className: cxCard("sectionTitle"), children: "Usage estimates" }),
6029
+ /* @__PURE__ */ jsx19("div", { className: cxCard("sectionBody"), children: /* @__PURE__ */ jsxs11("div", { className: cxCard("usageItem"), children: [
6030
+ /* @__PURE__ */ jsx19("span", { className: cxCard("usageLabel"), children: "AI generations" }),
6031
+ /* @__PURE__ */ jsxs11("span", { className: cxCard("usageValue"), children: [
6032
+ typeof pageEstimate === "number" && "~",
6033
+ pageEstimate.toLocaleString()
6034
+ ] })
6035
+ ] }) })
6036
+ ] }),
6037
+ /* @__PURE__ */ jsxs11("div", { className: cxCard("section"), children: [
6038
+ /* @__PURE__ */ jsx19("div", { className: cxCard("sectionTitle"), children: "Features" }),
6039
+ /* @__PURE__ */ jsx19("div", { className: cxCard("sectionBody"), children })
6040
+ ] })
6041
+ ] }),
6042
+ /* @__PURE__ */ jsx19("div", { className: cxCard("action"), children: userOnPlan ? /* @__PURE__ */ jsx19(Button, { fullWidth: true, disabled: true, href: "#", size: "large", children: "Current plan" }) : productId ? /* @__PURE__ */ jsx19(
6043
+ Button,
6044
+ {
6045
+ size: "large",
6046
+ fullWidth: true,
6047
+ variant: isUpgrade ? "primary" : "secondary",
6048
+ onClick: () => {
6049
+ onUpgrade?.(productId);
6050
+ },
6051
+ children: isUpgrade ? "Upgrade" : "Downgrade"
6052
+ }
6053
+ ) : /* @__PURE__ */ jsx19(
6054
+ Button,
6055
+ {
6056
+ size: "large",
6057
+ fullWidth: true,
6058
+ variant: "primary",
6059
+ href: "http://cal.com/chrisvxd/puck-enquiry",
6060
+ children: "Book a call"
6061
+ }
6062
+ ) })
6063
+ ] });
6064
+ };
6065
+ PlanCard.Feature = Feature;
6066
+
6008
6067
  // ../platform-client/components/PlanGrid/index.tsx
6009
- import { useEffect as useEffect7, useMemo as useMemo2, useState as useState9 } from "react";
6010
- import { jsx as jsx20, jsxs as jsxs12 } from "react/jsx-runtime";
6068
+ import { useEffect as useEffect7, useState as useState9 } from "react";
6069
+ import { Fragment as Fragment3, jsx as jsx20, jsxs as jsxs12 } from "react/jsx-runtime";
6011
6070
  var cx5 = get_class_name_factory_default("PlanGrid", styles_module_default4);
6012
6071
 
6013
6072
  // ../platform-client/components/Section/index.ts
@@ -6937,7 +6996,7 @@ var ScrollTracking = ({ children }) => {
6937
6996
  };
6938
6997
 
6939
6998
  // src/index.tsx
6940
- import { Fragment as Fragment3, jsx as jsx31 } from "react/jsx-runtime";
6999
+ import { Fragment as Fragment4, jsx as jsx31 } from "react/jsx-runtime";
6941
7000
  function createAiPlugin(opts) {
6942
7001
  const { scrollTracking = true, ...rest } = opts || {};
6943
7002
  return {
@@ -6951,7 +7010,7 @@ function createAiPlugin(opts) {
6951
7010
  if (scrollTracking) {
6952
7011
  return /* @__PURE__ */ jsx31(ScrollTracking, { children });
6953
7012
  }
6954
- return /* @__PURE__ */ jsx31(Fragment3, { children });
7013
+ return /* @__PURE__ */ jsx31(Fragment4, { children });
6955
7014
  }
6956
7015
  }
6957
7016
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@puckeditor/plugin-ai",
3
- "version": "0.6.0",
3
+ "version": "0.6.1-canary.0342162f",
4
4
  "author": "Chris Villa <chris@puckeditor.com>",
5
5
  "repository": "puckeditor/puck",
6
6
  "bugs": "https://github.com/puckeditor/puck/issues",