pxengine 0.1.21 → 0.1.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -34861,40 +34861,10 @@ var CampaignSeedCard = import_react59.default.memo(
34861
34861
  CampaignSeedCard.displayName = "CampaignSeedCard";
34862
34862
 
34863
34863
  // src/molecules/creator-discovery/SearchSpecCard/SearchSpecCard.tsx
34864
- var import_react60 = __toESM(require("react"), 1);
34865
- var import_jsx_runtime107 = require("react/jsx-runtime");
34866
- var SearchSpecCard = import_react60.default.memo(
34867
- ({
34868
- selectionStatus,
34869
- isLatestMessage = true,
34870
- className,
34871
- fields: providedFields,
34872
- data,
34873
- ...formCardProps
34874
- }) => {
34875
- const fields = (0, import_react60.useMemo)(() => {
34876
- return providedFields || generateFieldsFromData(data);
34877
- }, [providedFields, data]);
34878
- return /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(
34879
- FormCard,
34880
- {
34881
- ...formCardProps,
34882
- data,
34883
- title: formCardProps.title || "Search Specification",
34884
- fields,
34885
- className,
34886
- footer: !isLatestMessage && selectionStatus ? /* @__PURE__ */ (0, import_jsx_runtime107.jsxs)("div", { className: "flex justify-end items-center gap-1.5 text-green-600 text-xs font-semibold py-1", children: [
34887
- /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(CircleCheck, { className: "h-4 w-4" }),
34888
- /* @__PURE__ */ (0, import_jsx_runtime107.jsx)("span", { children: selectionStatus === "agent" ? "Selected by Agent" : "Selected by User" })
34889
- ] }) : formCardProps.footer
34890
- }
34891
- );
34892
- }
34893
- );
34894
- SearchSpecCard.displayName = "SearchSpecCard";
34864
+ var import_react61 = __toESM(require("react"), 1);
34895
34865
 
34896
34866
  // src/molecules/creator-discovery/SearchSpecCard/CustomFieldRenderers.tsx
34897
- var import_react61 = require("react");
34867
+ var import_react60 = require("react");
34898
34868
 
34899
34869
  // src/lib/countries.ts
34900
34870
  var countries = [
@@ -35101,15 +35071,15 @@ var countriesWithFlags = Object.fromEntries(
35101
35071
  );
35102
35072
 
35103
35073
  // src/molecules/creator-discovery/SearchSpecCard/CustomFieldRenderers.tsx
35104
- var import_jsx_runtime108 = require("react/jsx-runtime");
35074
+ var import_jsx_runtime107 = require("react/jsx-runtime");
35105
35075
  var CountrySelectEdit = ({
35106
35076
  value,
35107
35077
  onChange
35108
35078
  }) => {
35109
- const [isDropdownOpen, setIsDropdownOpen] = (0, import_react61.useState)(false);
35110
- const [searchTerm, setSearchTerm] = (0, import_react61.useState)("");
35111
- const dropdownRef = (0, import_react61.useRef)(null);
35112
- (0, import_react61.useEffect)(() => {
35079
+ const [isDropdownOpen, setIsDropdownOpen] = (0, import_react60.useState)(false);
35080
+ const [searchTerm, setSearchTerm] = (0, import_react60.useState)("");
35081
+ const dropdownRef = (0, import_react60.useRef)(null);
35082
+ (0, import_react60.useEffect)(() => {
35113
35083
  const handleClickOutside = (event) => {
35114
35084
  if (dropdownRef.current && !dropdownRef.current.contains(event.target)) {
35115
35085
  setIsDropdownOpen(false);
@@ -35119,16 +35089,16 @@ var CountrySelectEdit = ({
35119
35089
  return () => document.removeEventListener("mousedown", handleClickOutside);
35120
35090
  }, []);
35121
35091
  const inputValue = Array.isArray(value) ? value : [];
35122
- return /* @__PURE__ */ (0, import_jsx_runtime108.jsxs)("div", { className: "space-y-3", children: [
35123
- /* @__PURE__ */ (0, import_jsx_runtime108.jsxs)("div", { className: "relative", ref: dropdownRef, children: [
35124
- /* @__PURE__ */ (0, import_jsx_runtime108.jsxs)(
35092
+ return /* @__PURE__ */ (0, import_jsx_runtime107.jsxs)("div", { className: "space-y-3", children: [
35093
+ /* @__PURE__ */ (0, import_jsx_runtime107.jsxs)("div", { className: "relative", ref: dropdownRef, children: [
35094
+ /* @__PURE__ */ (0, import_jsx_runtime107.jsxs)(
35125
35095
  "div",
35126
35096
  {
35127
35097
  className: "flex-1 bg-white border border-gray200 rounded-md px-3 py-2 text-sm cursor-pointer flex items-center justify-between font-medium hover:border-purple500 transition-colors",
35128
35098
  onClick: () => setIsDropdownOpen(!isDropdownOpen),
35129
35099
  children: [
35130
- /* @__PURE__ */ (0, import_jsx_runtime108.jsx)("span", { className: "text-gray-700", children: inputValue.length > 0 ? `${inputValue.length} ${inputValue.length === 1 ? "country" : "countries"} selected` : "Select countries..." }),
35131
- /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(
35100
+ /* @__PURE__ */ (0, import_jsx_runtime107.jsx)("span", { className: "text-gray-700", children: inputValue.length > 0 ? `${inputValue.length} ${inputValue.length === 1 ? "country" : "countries"} selected` : "Select countries..." }),
35101
+ /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(
35132
35102
  ChevronDown,
35133
35103
  {
35134
35104
  className: cn(
@@ -35140,8 +35110,8 @@ var CountrySelectEdit = ({
35140
35110
  ]
35141
35111
  }
35142
35112
  ),
35143
- isDropdownOpen && /* @__PURE__ */ (0, import_jsx_runtime108.jsxs)("div", { className: "absolute top-full left-0 right-0 mt-1 bg-white border border-gray200 rounded-lg shadow-xl z-50 max-h-60 overflow-hidden animate-in fade-in slide-in-from-top-1", children: [
35144
- /* @__PURE__ */ (0, import_jsx_runtime108.jsx)("div", { className: "p-2 border-b border-gray-100", children: /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(
35113
+ isDropdownOpen && /* @__PURE__ */ (0, import_jsx_runtime107.jsxs)("div", { className: "absolute top-full left-0 right-0 mt-1 bg-white border border-gray200 rounded-lg shadow-xl z-50 max-h-60 overflow-hidden animate-in fade-in slide-in-from-top-1", children: [
35114
+ /* @__PURE__ */ (0, import_jsx_runtime107.jsx)("div", { className: "p-2 border-b border-gray-100", children: /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(
35145
35115
  "input",
35146
35116
  {
35147
35117
  type: "text",
@@ -35152,9 +35122,9 @@ var CountrySelectEdit = ({
35152
35122
  onClick: (e) => e.stopPropagation()
35153
35123
  }
35154
35124
  ) }),
35155
- /* @__PURE__ */ (0, import_jsx_runtime108.jsx)("div", { className: "max-h-40 overflow-y-auto p-1", children: countries.filter(
35125
+ /* @__PURE__ */ (0, import_jsx_runtime107.jsx)("div", { className: "max-h-40 overflow-y-auto p-1", children: countries.filter(
35156
35126
  (country) => country.name.toLowerCase().includes(searchTerm.toLowerCase()) || country.code.toLowerCase().includes(searchTerm.toLowerCase())
35157
- ).map((country) => /* @__PURE__ */ (0, import_jsx_runtime108.jsxs)(
35127
+ ).map((country) => /* @__PURE__ */ (0, import_jsx_runtime107.jsxs)(
35158
35128
  "div",
35159
35129
  {
35160
35130
  className: cn(
@@ -35175,31 +35145,31 @@ var CountrySelectEdit = ({
35175
35145
  }
35176
35146
  },
35177
35147
  children: [
35178
- /* @__PURE__ */ (0, import_jsx_runtime108.jsxs)("div", { className: "flex items-center gap-2", children: [
35179
- /* @__PURE__ */ (0, import_jsx_runtime108.jsx)("span", { className: "text-sm text-gray-700", children: country.name }),
35180
- /* @__PURE__ */ (0, import_jsx_runtime108.jsx)("span", { className: "text-xs text-gray-400 font-mono", children: country.code })
35148
+ /* @__PURE__ */ (0, import_jsx_runtime107.jsxs)("div", { className: "flex items-center gap-2", children: [
35149
+ /* @__PURE__ */ (0, import_jsx_runtime107.jsx)("span", { className: "text-sm text-gray-700", children: country.name }),
35150
+ /* @__PURE__ */ (0, import_jsx_runtime107.jsx)("span", { className: "text-xs text-gray-400 font-mono", children: country.code })
35181
35151
  ] }),
35182
- inputValue.includes(country.code) && /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(Check, { className: "h-4 w-4 text-purple500" })
35152
+ inputValue.includes(country.code) && /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(Check, { className: "h-4 w-4 text-purple500" })
35183
35153
  ]
35184
35154
  },
35185
35155
  country.code
35186
35156
  )) })
35187
35157
  ] })
35188
35158
  ] }),
35189
- inputValue.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime108.jsx)("div", { className: "flex flex-wrap gap-1.5", children: inputValue.map((countryCode) => /* @__PURE__ */ (0, import_jsx_runtime108.jsxs)(
35159
+ inputValue.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime107.jsx)("div", { className: "flex flex-wrap gap-1.5", children: inputValue.map((countryCode) => /* @__PURE__ */ (0, import_jsx_runtime107.jsxs)(
35190
35160
  Badge2,
35191
35161
  {
35192
35162
  variant: "secondary",
35193
35163
  className: "bg-purple50 text-purple700 border-purple100 hover:bg-purple100 cursor-default flex items-center gap-1 pr-1",
35194
35164
  children: [
35195
35165
  countryCode,
35196
- /* @__PURE__ */ (0, import_jsx_runtime108.jsxs)(
35166
+ /* @__PURE__ */ (0, import_jsx_runtime107.jsxs)(
35197
35167
  "button",
35198
35168
  {
35199
35169
  onClick: () => onChange(inputValue.filter((c) => c !== countryCode)),
35200
35170
  className: "hover:bg-purple200 rounded-full p-0.5 transition-colors",
35201
35171
  children: [
35202
- /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(ChevronDown, { className: "h-3 w-3 rotate-45" }),
35172
+ /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(ChevronDown, { className: "h-3 w-3 rotate-45" }),
35203
35173
  " "
35204
35174
  ]
35205
35175
  }
@@ -35212,9 +35182,9 @@ var CountrySelectEdit = ({
35212
35182
  };
35213
35183
  var CountrySelectDisplay = ({ value }) => {
35214
35184
  if (!value || !Array.isArray(value) || value.length === 0) {
35215
- return /* @__PURE__ */ (0, import_jsx_runtime108.jsx)("span", { className: "text-muted-foreground italic", children: "Not specified" });
35185
+ return /* @__PURE__ */ (0, import_jsx_runtime107.jsx)("span", { className: "text-muted-foreground italic", children: "Not specified" });
35216
35186
  }
35217
- return /* @__PURE__ */ (0, import_jsx_runtime108.jsx)("div", { className: "flex flex-wrap gap-1.5", children: value.map((countryCode) => /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(
35187
+ return /* @__PURE__ */ (0, import_jsx_runtime107.jsx)("div", { className: "flex flex-wrap gap-1.5", children: value.map((countryCode) => /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(
35218
35188
  Badge2,
35219
35189
  {
35220
35190
  variant: "outline",
@@ -35236,22 +35206,22 @@ var KeywordBundlesEdit = ({
35236
35206
  groups[p].push({ bundle: b, index: idx });
35237
35207
  });
35238
35208
  const sortedPriorities = Object.keys(groups).map((n) => parseInt(n)).sort((a, b) => a - b);
35239
- return /* @__PURE__ */ (0, import_jsx_runtime108.jsx)("div", { className: "space-y-6 pt-2", children: sortedPriorities.map((priority) => /* @__PURE__ */ (0, import_jsx_runtime108.jsxs)("div", { className: "space-y-3", children: [
35240
- /* @__PURE__ */ (0, import_jsx_runtime108.jsxs)("div", { className: "flex items-center gap-2", children: [
35241
- /* @__PURE__ */ (0, import_jsx_runtime108.jsxs)(Badge2, { className: "bg-purple500 hover:bg-purple500", children: [
35209
+ return /* @__PURE__ */ (0, import_jsx_runtime107.jsx)("div", { className: "space-y-6 pt-2", children: sortedPriorities.map((priority) => /* @__PURE__ */ (0, import_jsx_runtime107.jsxs)("div", { className: "space-y-3", children: [
35210
+ /* @__PURE__ */ (0, import_jsx_runtime107.jsxs)("div", { className: "flex items-center gap-2", children: [
35211
+ /* @__PURE__ */ (0, import_jsx_runtime107.jsxs)(Badge2, { className: "bg-purple500 hover:bg-purple500", children: [
35242
35212
  "Priority ",
35243
35213
  priority
35244
35214
  ] }),
35245
- /* @__PURE__ */ (0, import_jsx_runtime108.jsx)("div", { className: "h-px flex-1 bg-gray-100" })
35215
+ /* @__PURE__ */ (0, import_jsx_runtime107.jsx)("div", { className: "h-px flex-1 bg-gray-100" })
35246
35216
  ] }),
35247
- groups[priority].map(({ bundle, index: bundleIndex }) => /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(
35217
+ groups[priority].map(({ bundle, index: bundleIndex }) => /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(
35248
35218
  "div",
35249
35219
  {
35250
35220
  className: "bg-gray-50/50 border border-gray-100 rounded-xl p-4 transition-all hover:bg-gray-50 hover:border-gray-200 shadow-sm",
35251
- children: /* @__PURE__ */ (0, import_jsx_runtime108.jsxs)("div", { className: "flex flex-col gap-3", children: [
35252
- /* @__PURE__ */ (0, import_jsx_runtime108.jsx)("label", { className: "text-[10px] font-bold text-gray-400 uppercase tracking-widest pl-1", children: "Keywords" }),
35253
- /* @__PURE__ */ (0, import_jsx_runtime108.jsxs)("div", { className: "space-y-3", children: [
35254
- /* @__PURE__ */ (0, import_jsx_runtime108.jsx)("div", { className: "flex flex-wrap gap-1.5", children: Array.isArray(bundle.keywords) && bundle.keywords.map((keyword, kIndex) => /* @__PURE__ */ (0, import_jsx_runtime108.jsxs)(
35221
+ children: /* @__PURE__ */ (0, import_jsx_runtime107.jsxs)("div", { className: "flex flex-col gap-3", children: [
35222
+ /* @__PURE__ */ (0, import_jsx_runtime107.jsx)("label", { className: "text-[10px] font-bold text-gray-400 uppercase tracking-widest pl-1", children: "Keywords" }),
35223
+ /* @__PURE__ */ (0, import_jsx_runtime107.jsxs)("div", { className: "space-y-3", children: [
35224
+ /* @__PURE__ */ (0, import_jsx_runtime107.jsx)("div", { className: "flex flex-wrap gap-1.5", children: Array.isArray(bundle.keywords) && bundle.keywords.map((keyword, kIndex) => /* @__PURE__ */ (0, import_jsx_runtime107.jsxs)(
35255
35225
  Badge2,
35256
35226
  {
35257
35227
  className: "bg-white border-gray-200 text-gray-700 hover:bg-red-50 hover:text-red-600 hover:border-red-100 transition-all cursor-pointer group",
@@ -35267,12 +35237,12 @@ var KeywordBundlesEdit = ({
35267
35237
  },
35268
35238
  children: [
35269
35239
  keyword,
35270
- /* @__PURE__ */ (0, import_jsx_runtime108.jsx)("span", { className: "ml-1 opacity-0 group-hover:opacity-100 transition-opacity", children: "\xD7" })
35240
+ /* @__PURE__ */ (0, import_jsx_runtime107.jsx)("span", { className: "ml-1 opacity-0 group-hover:opacity-100 transition-opacity", children: "\xD7" })
35271
35241
  ]
35272
35242
  },
35273
35243
  kIndex
35274
35244
  )) }),
35275
- /* @__PURE__ */ (0, import_jsx_runtime108.jsx)("div", { className: "flex gap-2", children: /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(
35245
+ /* @__PURE__ */ (0, import_jsx_runtime107.jsx)("div", { className: "flex gap-2", children: /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(
35276
35246
  "input",
35277
35247
  {
35278
35248
  type: "text",
@@ -35296,9 +35266,9 @@ var KeywordBundlesEdit = ({
35296
35266
  }
35297
35267
  ) })
35298
35268
  ] }),
35299
- /* @__PURE__ */ (0, import_jsx_runtime108.jsxs)("div", { className: "flex flex-col gap-1.5 mt-1", children: [
35300
- /* @__PURE__ */ (0, import_jsx_runtime108.jsx)("label", { className: "text-[10px] font-bold text-gray-400 uppercase tracking-widest pl-1", children: "Priority Level (1-5)" }),
35301
- /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(
35269
+ /* @__PURE__ */ (0, import_jsx_runtime107.jsxs)("div", { className: "flex flex-col gap-1.5 mt-1", children: [
35270
+ /* @__PURE__ */ (0, import_jsx_runtime107.jsx)("label", { className: "text-[10px] font-bold text-gray-400 uppercase tracking-widest pl-1", children: "Priority Level (1-5)" }),
35271
+ /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(
35302
35272
  "input",
35303
35273
  {
35304
35274
  type: "number",
@@ -35326,7 +35296,7 @@ var KeywordBundlesEdit = ({
35326
35296
  var KeywordBundlesDisplay = ({ value }) => {
35327
35297
  const bundles = Array.isArray(value) ? value : [];
35328
35298
  if (bundles.length === 0)
35329
- return /* @__PURE__ */ (0, import_jsx_runtime108.jsx)("span", { className: "text-gray-500 italic text-sm", children: "Not specified" });
35299
+ return /* @__PURE__ */ (0, import_jsx_runtime107.jsx)("span", { className: "text-gray-500 italic text-sm", children: "Not specified" });
35330
35300
  const groups = {};
35331
35301
  bundles.forEach((b) => {
35332
35302
  const p = Number(b?.priority) || 1;
@@ -35335,17 +35305,17 @@ var KeywordBundlesDisplay = ({ value }) => {
35335
35305
  groups[p].push(...keywords);
35336
35306
  });
35337
35307
  const sortedPriorities = Object.keys(groups).map((n) => parseInt(n)).sort((a, b) => a - b);
35338
- return /* @__PURE__ */ (0, import_jsx_runtime108.jsx)("div", { className: "space-y-4 pt-2", children: sortedPriorities.map((priority) => {
35308
+ return /* @__PURE__ */ (0, import_jsx_runtime107.jsx)("div", { className: "space-y-4 pt-2", children: sortedPriorities.map((priority) => {
35339
35309
  const deduped = Array.from(new Set(groups[priority]));
35340
- return /* @__PURE__ */ (0, import_jsx_runtime108.jsxs)("div", { className: "space-y-2", children: [
35341
- /* @__PURE__ */ (0, import_jsx_runtime108.jsxs)("div", { className: "flex items-center gap-2", children: [
35342
- /* @__PURE__ */ (0, import_jsx_runtime108.jsxs)("span", { className: "text-[10px] uppercase tracking-widest text-purple-400 font-bold", children: [
35310
+ return /* @__PURE__ */ (0, import_jsx_runtime107.jsxs)("div", { className: "space-y-2", children: [
35311
+ /* @__PURE__ */ (0, import_jsx_runtime107.jsxs)("div", { className: "flex items-center gap-2", children: [
35312
+ /* @__PURE__ */ (0, import_jsx_runtime107.jsxs)("span", { className: "text-[10px] uppercase tracking-widest text-purple-400 font-bold", children: [
35343
35313
  "Priority ",
35344
35314
  priority
35345
35315
  ] }),
35346
- /* @__PURE__ */ (0, import_jsx_runtime108.jsx)("div", { className: "h-[1px] flex-1 bg-white/10" })
35316
+ /* @__PURE__ */ (0, import_jsx_runtime107.jsx)("div", { className: "h-[1px] flex-1 bg-white/10" })
35347
35317
  ] }),
35348
- /* @__PURE__ */ (0, import_jsx_runtime108.jsx)("div", { className: "flex flex-wrap gap-2", children: deduped.map((keyword) => /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(
35318
+ /* @__PURE__ */ (0, import_jsx_runtime107.jsx)("div", { className: "flex flex-wrap gap-2", children: deduped.map((keyword) => /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(
35349
35319
  "div",
35350
35320
  {
35351
35321
  className: "px-2 py-1 rounded bg-[#1A1A1A] border border-white/10 text-gray-300 text-xs font-medium",
@@ -35357,6 +35327,98 @@ var KeywordBundlesDisplay = ({ value }) => {
35357
35327
  }) });
35358
35328
  };
35359
35329
 
35330
+ // src/molecules/creator-discovery/SearchSpecCard/SearchSpecCard.tsx
35331
+ var import_jsx_runtime108 = require("react/jsx-runtime");
35332
+ var ObjectDisplay = ({ value }) => {
35333
+ if (!value || typeof value !== "object") return null;
35334
+ return /* @__PURE__ */ (0, import_jsx_runtime108.jsx)("div", { className: "space-y-1 pt-1", children: Object.entries(value).map(([k, v]) => /* @__PURE__ */ (0, import_jsx_runtime108.jsxs)("div", { className: "flex gap-2 text-sm", children: [
35335
+ /* @__PURE__ */ (0, import_jsx_runtime108.jsxs)("span", { className: "text-muted-foreground capitalize min-w-[120px]", children: [
35336
+ k.replace(/_/g, " "),
35337
+ ":"
35338
+ ] }),
35339
+ /* @__PURE__ */ (0, import_jsx_runtime108.jsx)("span", { className: "text-foreground font-medium", children: Array.isArray(v) ? v.join(", ") : String(v) })
35340
+ ] }, k)) });
35341
+ };
35342
+ var StringArrayDisplay = ({ value }) => {
35343
+ if (!Array.isArray(value) || value.length === 0)
35344
+ return /* @__PURE__ */ (0, import_jsx_runtime108.jsx)("span", { className: "text-muted-foreground italic text-sm", children: "Not specified" });
35345
+ return /* @__PURE__ */ (0, import_jsx_runtime108.jsx)("div", { className: "flex flex-wrap gap-1.5 pt-1", children: value.map((item) => /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(Badge2, { variant: "outline", className: "text-xs", children: item }, item)) });
35346
+ };
35347
+ function buildSearchSpecFields(data) {
35348
+ if (!data || typeof data !== "object") return [];
35349
+ return Object.keys(data).map((key) => {
35350
+ const value = data[key];
35351
+ if (key === "keyword_bundles") {
35352
+ return {
35353
+ key,
35354
+ label: "Keyword Bundles",
35355
+ type: "custom",
35356
+ renderDisplay: (v) => /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(KeywordBundlesDisplay, { value: v }),
35357
+ renderEdit: (v, onChange) => /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(KeywordBundlesEdit, { value: v, onChange })
35358
+ };
35359
+ }
35360
+ if (key === "geography") {
35361
+ return {
35362
+ key,
35363
+ label: "Geography",
35364
+ type: "custom",
35365
+ renderDisplay: (v) => /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(CountrySelectDisplay, { value: v }),
35366
+ renderEdit: (v, onChange) => /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(CountrySelectEdit, { value: v, onChange })
35367
+ };
35368
+ }
35369
+ if (key === "platforms" && Array.isArray(value)) {
35370
+ return {
35371
+ key,
35372
+ label: "Platforms",
35373
+ type: "custom",
35374
+ renderDisplay: (v) => /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(StringArrayDisplay, { value: v })
35375
+ };
35376
+ }
35377
+ if (typeof value === "object" && value !== null && !Array.isArray(value) && !("min" in value && "max" in value)) {
35378
+ const label = key.split("_").map((w) => w.charAt(0).toUpperCase() + w.slice(1)).join(" ");
35379
+ return {
35380
+ key,
35381
+ label,
35382
+ type: "custom",
35383
+ renderDisplay: (v) => /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(ObjectDisplay, { value: v })
35384
+ };
35385
+ }
35386
+ const [generated] = generateFieldsFromData({ [key]: value });
35387
+ return generated;
35388
+ });
35389
+ }
35390
+ var SearchSpecCard = import_react61.default.memo(
35391
+ ({
35392
+ selectionStatus,
35393
+ isLatestMessage = true,
35394
+ className,
35395
+ fields: providedFields,
35396
+ data,
35397
+ specData,
35398
+ ...formCardProps
35399
+ }) => {
35400
+ const resolvedData = data || specData;
35401
+ const fields = (0, import_react61.useMemo)(() => {
35402
+ return providedFields || buildSearchSpecFields(resolvedData ?? {});
35403
+ }, [providedFields, resolvedData]);
35404
+ return /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(
35405
+ FormCard,
35406
+ {
35407
+ ...formCardProps,
35408
+ data: resolvedData ?? {},
35409
+ title: formCardProps.title || "Search Specification",
35410
+ fields,
35411
+ className,
35412
+ footer: !isLatestMessage && selectionStatus ? /* @__PURE__ */ (0, import_jsx_runtime108.jsxs)("div", { className: "flex justify-end items-center gap-1.5 text-green-600 text-xs font-semibold py-1", children: [
35413
+ /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(CircleCheck, { className: "h-4 w-4" }),
35414
+ /* @__PURE__ */ (0, import_jsx_runtime108.jsx)("span", { children: selectionStatus === "agent" ? "Selected by Agent" : "Selected by User" })
35415
+ ] }) : formCardProps.footer
35416
+ }
35417
+ );
35418
+ }
35419
+ );
35420
+ SearchSpecCard.displayName = "SearchSpecCard";
35421
+
35360
35422
  // src/molecules/creator-discovery/MCQCard/MCQCard.tsx
35361
35423
  var import_react62 = __toESM(require("react"), 1);
35362
35424
  var import_jsx_runtime109 = require("react/jsx-runtime");
@@ -35376,15 +35438,17 @@ var MCQCard = import_react62.default.memo(
35376
35438
  disabled = false
35377
35439
  }) => {
35378
35440
  const [selectedOption, setSelectedOption] = import_react62.default.useState(propsSelectedOption);
35441
+ const [isProceeded, setIsProceeded] = import_react62.default.useState(false);
35379
35442
  import_react62.default.useEffect(() => {
35380
35443
  if (propsSelectedOption) {
35381
35444
  setSelectedOption(propsSelectedOption);
35445
+ setIsProceeded(true);
35382
35446
  }
35383
35447
  }, [propsSelectedOption]);
35384
35448
  const handleOptionClick = (key, e) => {
35385
35449
  e.preventDefault();
35386
35450
  e.stopPropagation();
35387
- if (isLatestMessage && !isLoading && !disabled) {
35451
+ if (isLatestMessage && !isLoading && !disabled && !isProceeded) {
35388
35452
  setSelectedOption(key);
35389
35453
  onSelect?.(key);
35390
35454
  }
@@ -35392,8 +35456,9 @@ var MCQCard = import_react62.default.memo(
35392
35456
  const handleProceed = (e) => {
35393
35457
  e.preventDefault();
35394
35458
  e.stopPropagation();
35395
- if ((selectedOption || recommended) && !disabled) {
35459
+ if ((selectedOption || recommended) && !disabled && !isProceeded) {
35396
35460
  const result = selectedOption || recommended || "";
35461
+ setIsProceeded(true);
35397
35462
  onProceed?.(result);
35398
35463
  onAction?.({
35399
35464
  type: "mcq_selection",
@@ -35402,7 +35467,7 @@ var MCQCard = import_react62.default.memo(
35402
35467
  });
35403
35468
  }
35404
35469
  };
35405
- const isInteractionDisabled = disabled || !isLatestMessage;
35470
+ const isInteractionDisabled = disabled || !isLatestMessage || isProceeded;
35406
35471
  return /* @__PURE__ */ (0, import_jsx_runtime109.jsxs)(
35407
35472
  "div",
35408
35473
  {