@redacto.io/consent-sdk-react 9.3.0-beta.0 → 9.3.0-beta.1

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.
@@ -12707,6 +12707,7 @@ var GRIEVANCE_TAB_IDS = {
12707
12707
  COMPLETED: "completed",
12708
12708
  REJECTED: "rejected"
12709
12709
  };
12710
+ var MAX_DISPLAYED_PURPOSE_NAMES_IN_ERASURE_MODAL = 3;
12710
12711
 
12711
12712
  // src/RedactoPrivacyCenter/components/SideMenuBarPC/constants.tsx
12712
12713
  import { Activity, MessageCircleWarning, ReceiptText, ShieldCheck } from "lucide-react";
@@ -19499,7 +19500,7 @@ function RequestSubmit({
19499
19500
  }
19500
19501
 
19501
19502
  // src/RedactoPrivacyCenter/components/Form.tsx
19502
- import { FiChevronDown, FiChevronUp, FiX } from "react-icons/fi";
19503
+ import { FiAlertCircle, FiChevronDown, FiChevronUp, FiX } from "react-icons/fi";
19503
19504
  import { Fragment as Fragment11, jsx as jsx62, jsxs as jsxs40 } from "react/jsx-runtime";
19504
19505
  var getVar21 = (varName) => `var(${varName})`;
19505
19506
  var PRODUCT_SCOPED_REQUEST_TYPES = /* @__PURE__ */ new Set([
@@ -19591,6 +19592,8 @@ function Form({
19591
19592
  const [isLoading, setIsLoading] = useState22(false);
19592
19593
  const [isTranslating, setIsTranslating] = useState22(false);
19593
19594
  const [isRequestDetailsExpanded, setIsRequestDetailsExpanded] = useState22(true);
19595
+ const [isErasureConsentModalOpen, setIsErasureConsentModalOpen] = useState22(false);
19596
+ const [revokeConsentOnFulfilment, setRevokeConsentOnFulfilment] = useState22(false);
19594
19597
  const resetFileInput = () => {
19595
19598
  if (fileInputRef.current) {
19596
19599
  fileInputRef.current.value = "";
@@ -19817,11 +19820,34 @@ function Form({
19817
19820
  }
19818
19821
  return translatedName;
19819
19822
  }, [data]);
19823
+ const selectedErasurePurposeList = useMemo14(
19824
+ () => selectedPurposes.filter((p) => p.selected || p.data_elements.some((de) => de.selected)).map((p) => p.name).filter(Boolean),
19825
+ [selectedPurposes]
19826
+ );
19827
+ const selectedErasurePurposeNames = useMemo14(() => {
19828
+ if (selectedErasurePurposeList.length === 0 || selectedErasurePurposeList.length > MAX_DISPLAYED_PURPOSE_NAMES_IN_ERASURE_MODAL) {
19829
+ return t("revokeConsentModalYourPurposes");
19830
+ }
19831
+ return selectedErasurePurposeList.join(", ");
19832
+ }, [selectedErasurePurposeList, t]);
19820
19833
  const handleSubmitClick = () => {
19821
19834
  if (!isFormValid) {
19822
19835
  return;
19823
19836
  }
19824
- void handleSubmit(requestType === "erasure" /* ERASURE */);
19837
+ if (requestType === "erasure" /* ERASURE */) {
19838
+ setIsErasureConsentModalOpen(true);
19839
+ return;
19840
+ }
19841
+ setRevokeConsentOnFulfilment(false);
19842
+ void handleSubmit(false);
19843
+ };
19844
+ const handleErasureModalChoice = (revoke) => {
19845
+ setRevokeConsentOnFulfilment(revoke);
19846
+ setIsErasureConsentModalOpen(false);
19847
+ void handleSubmit(revoke);
19848
+ };
19849
+ const handleErasureModalClose = () => {
19850
+ setIsErasureConsentModalOpen(false);
19825
19851
  };
19826
19852
  const handleSubmit = async (revokeConsent = false) => {
19827
19853
  var _a2, _b2, _c2, _d2;
@@ -20117,676 +20143,731 @@ function Form({
20117
20143
  setIsVerifyingContact(false);
20118
20144
  }
20119
20145
  };
20120
- return /* @__PURE__ */ jsx62(Fragment11, { children: isSubmitted && submittedCase && !isPopup ? /* @__PURE__ */ jsx62(
20121
- RequestSubmit,
20122
- {
20123
- result: submittedCase,
20124
- contact: formData == null ? void 0 : formData.contact,
20125
- onCreateRequest
20126
- }
20127
- ) : /* @__PURE__ */ jsx62("div", { children: /* @__PURE__ */ jsxs40("div", { children: [
20128
- !isPopup && /* @__PURE__ */ jsx62("p", { style: {
20129
- marginTop: 0,
20130
- marginBottom: getVar21("--pc-spacing-sm"),
20131
- lineHeight: 1.5,
20132
- fontSize: pcStyles.textSm.fontSize,
20133
- color: getVar21("--pc-text-secondary")
20134
- }, children: t("description") }),
20135
- /* @__PURE__ */ jsx62(
20136
- "div",
20146
+ return /* @__PURE__ */ jsxs40(Fragment11, { children: [
20147
+ isSubmitted && submittedCase && !isPopup ? /* @__PURE__ */ jsx62(
20148
+ RequestSubmit,
20137
20149
  {
20138
- style: {
20139
- backgroundColor: getVar21("--pc-bg-primary"),
20140
- ...isPopup ? {
20141
- marginTop: 0,
20142
- marginBottom: 0,
20143
- borderRadius: pcStyles.borderRadiusXl
20144
- } : {
20145
- marginTop: pcStyles.mtSm.marginTop,
20146
- marginBottom: pcStyles.mbSm.marginBottom,
20147
- borderRadius: pcStyles.borderRadiusXl,
20148
- border: `1px solid ${getVar21("--pc-border-color")}`,
20149
- boxShadow: getVar21("--pc-shadow-sm")
20150
- }
20151
- },
20152
- children: /* @__PURE__ */ jsxs40(FormBlockWrapper, { inputClassName: "mx-auto", children: [
20153
- /* @__PURE__ */ jsxs40(
20154
- "div",
20155
- {
20156
- style: {
20157
- ...pcStyles.flex,
20158
- ...pcStyles.itemsCenter,
20159
- ...pcStyles.justifyBetween,
20160
- backgroundColor: `var(--pc-bg-secondary)`,
20161
- padding: getVar21("--pc-spacing-md"),
20162
- width: "100%",
20163
- overflow: "visible",
20164
- ...isPopup ? {
20165
- position: "sticky",
20166
- top: 0,
20167
- zIndex: 20,
20168
- borderBottom: `1px solid var(--pc-border-color)`
20169
- } : {
20170
- position: "relative",
20171
- borderRadius: `${getVar21("--pc-border-radius-lg")} ${getVar21("--pc-border-radius-lg")} 0 0`
20172
- }
20173
- },
20174
- className: "pc-padding-responsive",
20175
- children: [
20176
- /* @__PURE__ */ jsx62("p", { style: {
20177
- fontSize: pcStyles.textSm.fontSize,
20178
- fontWeight: pcStyles.fontWeightSemibold.fontWeight,
20179
- color: `var(--pc-text-primary)`,
20180
- margin: 0,
20181
- whiteSpace: "nowrap",
20182
- flexShrink: 0,
20183
- flexGrow: 0
20184
- }, className: "pc-text-responsive", children: t("raiseDataRequest") }),
20185
- isPopup && /* @__PURE__ */ jsx62(
20186
- PCButton,
20187
- {
20188
- variant: "text",
20189
- onClick: onClose,
20190
- style: { padding: 0, flexShrink: 0, marginLeft: "auto" },
20191
- children: /* @__PURE__ */ jsx62(FiX, { size: 20 })
20192
- }
20193
- )
20194
- ]
20150
+ result: submittedCase,
20151
+ contact: formData == null ? void 0 : formData.contact,
20152
+ onCreateRequest,
20153
+ revokeConsentOnFulfilment,
20154
+ revokedPurposeNames: selectedErasurePurposeNames
20155
+ }
20156
+ ) : /* @__PURE__ */ jsx62("div", { children: /* @__PURE__ */ jsxs40("div", { children: [
20157
+ !isPopup && /* @__PURE__ */ jsx62("p", { style: {
20158
+ marginTop: 0,
20159
+ marginBottom: getVar21("--pc-spacing-sm"),
20160
+ lineHeight: 1.5,
20161
+ fontSize: pcStyles.textSm.fontSize,
20162
+ color: getVar21("--pc-text-secondary")
20163
+ }, children: t("description") }),
20164
+ /* @__PURE__ */ jsx62(
20165
+ "div",
20166
+ {
20167
+ style: {
20168
+ backgroundColor: getVar21("--pc-bg-primary"),
20169
+ ...isPopup ? {
20170
+ marginTop: 0,
20171
+ marginBottom: 0,
20172
+ borderRadius: pcStyles.borderRadiusXl
20173
+ } : {
20174
+ marginTop: pcStyles.mtSm.marginTop,
20175
+ marginBottom: pcStyles.mbSm.marginBottom,
20176
+ borderRadius: pcStyles.borderRadiusXl,
20177
+ border: `1px solid ${getVar21("--pc-border-color")}`,
20178
+ boxShadow: getVar21("--pc-shadow-sm")
20195
20179
  }
20196
- ),
20197
- /* @__PURE__ */ jsxs40(
20198
- "div",
20199
- {
20200
- style: {
20201
- ...pcStyles.flex,
20202
- ...pcStyles.flexCol,
20203
- gap: getVar21("--pc-spacing-lg"),
20204
- padding: getVar21("--pc-spacing-lg")
20205
- },
20206
- className: "pc-padding-responsive pc-spacing-responsive",
20207
- children: [
20208
- /* @__PURE__ */ jsxs40("div", { style: {
20180
+ },
20181
+ children: /* @__PURE__ */ jsxs40(FormBlockWrapper, { inputClassName: "mx-auto", children: [
20182
+ /* @__PURE__ */ jsxs40(
20183
+ "div",
20184
+ {
20185
+ style: {
20209
20186
  ...pcStyles.flex,
20187
+ ...pcStyles.itemsCenter,
20188
+ ...pcStyles.justifyBetween,
20189
+ backgroundColor: `var(--pc-bg-secondary)`,
20190
+ padding: getVar21("--pc-spacing-md"),
20210
20191
  width: "100%",
20211
- ...pcStyles.itemsEnd,
20212
- gap: getVar21("--pc-spacing-sm"),
20213
- flexWrap: "wrap"
20214
- }, children: [
20192
+ overflow: "visible",
20193
+ ...isPopup ? {
20194
+ position: "sticky",
20195
+ top: 0,
20196
+ zIndex: 20,
20197
+ borderBottom: `1px solid var(--pc-border-color)`
20198
+ } : {
20199
+ position: "relative",
20200
+ borderRadius: `${getVar21("--pc-border-radius-lg")} ${getVar21("--pc-border-radius-lg")} 0 0`
20201
+ }
20202
+ },
20203
+ className: "pc-padding-responsive",
20204
+ children: [
20205
+ /* @__PURE__ */ jsx62("p", { style: {
20206
+ fontSize: pcStyles.textSm.fontSize,
20207
+ fontWeight: pcStyles.fontWeightSemibold.fontWeight,
20208
+ color: `var(--pc-text-primary)`,
20209
+ margin: 0,
20210
+ whiteSpace: "nowrap",
20211
+ flexShrink: 0,
20212
+ flexGrow: 0
20213
+ }, className: "pc-text-responsive", children: t("raiseDataRequest") }),
20214
+ isPopup && /* @__PURE__ */ jsx62(
20215
+ PCButton,
20216
+ {
20217
+ variant: "text",
20218
+ onClick: onClose,
20219
+ style: { padding: 0, flexShrink: 0, marginLeft: "auto" },
20220
+ children: /* @__PURE__ */ jsx62(FiX, { size: 20 })
20221
+ }
20222
+ )
20223
+ ]
20224
+ }
20225
+ ),
20226
+ /* @__PURE__ */ jsxs40(
20227
+ "div",
20228
+ {
20229
+ style: {
20230
+ ...pcStyles.flex,
20231
+ ...pcStyles.flexCol,
20232
+ gap: getVar21("--pc-spacing-lg"),
20233
+ padding: getVar21("--pc-spacing-lg")
20234
+ },
20235
+ className: "pc-padding-responsive pc-spacing-responsive",
20236
+ children: [
20237
+ /* @__PURE__ */ jsxs40("div", { style: {
20238
+ ...pcStyles.flex,
20239
+ width: "100%",
20240
+ ...pcStyles.itemsEnd,
20241
+ gap: getVar21("--pc-spacing-sm"),
20242
+ flexWrap: "wrap"
20243
+ }, children: [
20244
+ /* @__PURE__ */ jsx62(
20245
+ PCInput,
20246
+ {
20247
+ style: { flex: 1, minWidth: "200px" },
20248
+ label: /* @__PURE__ */ jsxs40("span", { children: [
20249
+ t("contact"),
20250
+ /* @__PURE__ */ jsx62("span", { style: { color: getVar21("--pc-error") }, children: "*" })
20251
+ ] }),
20252
+ placeholder: t("contactPlaceholder"),
20253
+ value: formData.contact,
20254
+ readOnly: !isPopup,
20255
+ onChange: (e) => {
20256
+ if (!isPopup) {
20257
+ return;
20258
+ }
20259
+ ;
20260
+ setFormData({
20261
+ ...formData,
20262
+ contact: e.target.value
20263
+ });
20264
+ setIsPopupFormEnabled(false);
20265
+ }
20266
+ }
20267
+ ),
20268
+ isPopup && !isPopupFormEnabled && /* @__PURE__ */ jsx62("div", { style: { ...pcStyles.flex, ...pcStyles.justifyEnd }, children: /* @__PURE__ */ jsx62(
20269
+ PCButton,
20270
+ {
20271
+ size: "sm",
20272
+ onClick: handleVerifyContact,
20273
+ style: { height: "2.25rem", flexShrink: 0 },
20274
+ disabled: !formData.contact || isVerifyingContact,
20275
+ children: isVerifyingContact ? t("verifying") : t("verify")
20276
+ }
20277
+ ) })
20278
+ ] }),
20215
20279
  /* @__PURE__ */ jsx62(
20216
- PCInput,
20280
+ PCSelect,
20217
20281
  {
20218
- style: { flex: 1, minWidth: "200px" },
20219
20282
  label: /* @__PURE__ */ jsxs40("span", { children: [
20220
- t("contact"),
20283
+ t("requestType"),
20221
20284
  /* @__PURE__ */ jsx62("span", { style: { color: getVar21("--pc-error") }, children: "*" })
20222
20285
  ] }),
20223
- placeholder: t("contactPlaceholder"),
20224
- value: formData.contact,
20225
- readOnly: !isPopup,
20226
- onChange: (e) => {
20227
- if (!isPopup) {
20228
- return;
20286
+ options: Object.values(RequestTypeEnum).map((type) => ({
20287
+ value: type,
20288
+ label: requestTypeLabels[type]
20289
+ })),
20290
+ value: Object.values(RequestTypeEnum).map((type) => ({
20291
+ value: type,
20292
+ label: requestTypeLabels[type]
20293
+ })).find((opt) => opt.value === requestType) || null,
20294
+ onChange: (value) => {
20295
+ if (value) {
20296
+ setRequestType(value.value);
20297
+ setTimePeriod("");
20298
+ setIsRequestDetailsExpanded(true);
20229
20299
  }
20230
- ;
20231
- setFormData({
20232
- ...formData,
20233
- contact: e.target.value
20234
- });
20235
- setIsPopupFormEnabled(false);
20236
- }
20300
+ },
20301
+ placeholder: t("selectRequestType"),
20302
+ disabled: isPopup && !isPopupFormEnabled
20237
20303
  }
20238
20304
  ),
20239
- isPopup && !isPopupFormEnabled && /* @__PURE__ */ jsx62("div", { style: { ...pcStyles.flex, ...pcStyles.justifyEnd }, children: /* @__PURE__ */ jsx62(
20240
- PCButton,
20305
+ /* @__PURE__ */ jsxs40(
20306
+ "div",
20241
20307
  {
20242
- size: "sm",
20243
- onClick: handleVerifyContact,
20244
- style: { height: "2.25rem", flexShrink: 0 },
20245
- disabled: !formData.contact || isVerifyingContact,
20246
- children: isVerifyingContact ? t("verifying") : t("verify")
20247
- }
20248
- ) })
20249
- ] }),
20250
- /* @__PURE__ */ jsx62(
20251
- PCSelect,
20252
- {
20253
- label: /* @__PURE__ */ jsxs40("span", { children: [
20254
- t("requestType"),
20255
- /* @__PURE__ */ jsx62("span", { style: { color: getVar21("--pc-error") }, children: "*" })
20256
- ] }),
20257
- options: Object.values(RequestTypeEnum).map((type) => ({
20258
- value: type,
20259
- label: requestTypeLabels[type]
20260
- })),
20261
- value: Object.values(RequestTypeEnum).map((type) => ({
20262
- value: type,
20263
- label: requestTypeLabels[type]
20264
- })).find((opt) => opt.value === requestType) || null,
20265
- onChange: (value) => {
20266
- if (value) {
20267
- setRequestType(value.value);
20268
- setTimePeriod("");
20269
- setIsRequestDetailsExpanded(true);
20270
- }
20271
- },
20272
- placeholder: t("selectRequestType"),
20273
- disabled: isPopup && !isPopupFormEnabled
20274
- }
20275
- ),
20276
- /* @__PURE__ */ jsxs40(
20277
- "div",
20278
- {
20279
- style: {
20280
- ...pcStyles.flex,
20281
- ...pcStyles.flexCol,
20282
- borderRadius: pcStyles.borderRadiusLg,
20283
- border: `1px solid ${getVar21("--pc-border-color")}`,
20284
- backgroundColor: getVar21("--pc-bg-secondary"),
20285
- overflow: "hidden",
20286
- ...isPopup && !isPopupFormEnabled ? {
20287
- pointerEvents: "none",
20288
- opacity: 0.6
20289
- } : {}
20290
- },
20291
- children: [
20292
- /* @__PURE__ */ jsxs40("div", { style: {
20308
+ style: {
20293
20309
  ...pcStyles.flex,
20294
- ...pcStyles.itemsCenter,
20295
- ...pcStyles.justifyBetween,
20296
- padding: getVar21("--pc-spacing-md"),
20297
- borderBottom: isRequestDetailsExpanded ? `1px solid ${getVar21("--pc-border-color")}` : "none"
20298
- }, children: [
20299
- /* @__PURE__ */ jsxs40("p", { style: {
20300
- fontWeight: pcStyles.fontWeightSemibold.fontWeight,
20301
- color: `var(--pc-text-primary)`,
20302
- fontSize: pcStyles.textSm.fontSize,
20303
- margin: 0
20310
+ ...pcStyles.flexCol,
20311
+ borderRadius: pcStyles.borderRadiusLg,
20312
+ border: `1px solid ${getVar21("--pc-border-color")}`,
20313
+ backgroundColor: getVar21("--pc-bg-secondary"),
20314
+ overflow: "hidden",
20315
+ ...isPopup && !isPopupFormEnabled ? {
20316
+ pointerEvents: "none",
20317
+ opacity: 0.6
20318
+ } : {}
20319
+ },
20320
+ children: [
20321
+ /* @__PURE__ */ jsxs40("div", { style: {
20322
+ ...pcStyles.flex,
20323
+ ...pcStyles.itemsCenter,
20324
+ ...pcStyles.justifyBetween,
20325
+ padding: getVar21("--pc-spacing-md"),
20326
+ borderBottom: isRequestDetailsExpanded ? `1px solid ${getVar21("--pc-border-color")}` : "none"
20304
20327
  }, children: [
20305
- t("requestDetails"),
20306
- " ",
20307
- /* @__PURE__ */ jsx62("span", { style: { color: getVar21("--pc-error") }, children: "*" })
20328
+ /* @__PURE__ */ jsxs40("p", { style: {
20329
+ fontWeight: pcStyles.fontWeightSemibold.fontWeight,
20330
+ color: `var(--pc-text-primary)`,
20331
+ fontSize: pcStyles.textSm.fontSize,
20332
+ margin: 0
20333
+ }, children: [
20334
+ t("requestDetails"),
20335
+ " ",
20336
+ /* @__PURE__ */ jsx62("span", { style: { color: getVar21("--pc-error") }, children: "*" })
20337
+ ] }),
20338
+ /* @__PURE__ */ jsx62(
20339
+ PCButton,
20340
+ {
20341
+ variant: "text",
20342
+ size: "sm",
20343
+ style: { height: "auto", padding: 0, color: "var(--pc-text-secondary)", flexShrink: 0 },
20344
+ onClick: () => setIsRequestDetailsExpanded(
20345
+ !isRequestDetailsExpanded
20346
+ ),
20347
+ children: isRequestDetailsExpanded ? /* @__PURE__ */ jsx62(FiChevronUp, { size: 20 }) : /* @__PURE__ */ jsx62(FiChevronDown, { size: 20 })
20348
+ }
20349
+ )
20308
20350
  ] }),
20309
- /* @__PURE__ */ jsx62(
20310
- PCButton,
20351
+ isRequestDetailsExpanded && /* @__PURE__ */ jsx62("div", { style: {
20352
+ padding: getVar21("--pc-spacing-md")
20353
+ }, children: isProductScopedRequestType(requestType) ? /* @__PURE__ */ jsxs40(
20354
+ "div",
20311
20355
  {
20312
- variant: "text",
20313
- size: "sm",
20314
- style: { height: "auto", padding: 0, color: "var(--pc-text-secondary)", flexShrink: 0 },
20315
- onClick: () => setIsRequestDetailsExpanded(
20316
- !isRequestDetailsExpanded
20317
- ),
20318
- children: isRequestDetailsExpanded ? /* @__PURE__ */ jsx62(FiChevronUp, { size: 20 }) : /* @__PURE__ */ jsx62(FiChevronDown, { size: 20 })
20319
- }
20320
- )
20321
- ] }),
20322
- isRequestDetailsExpanded && /* @__PURE__ */ jsx62("div", { style: {
20323
- padding: getVar21("--pc-spacing-md")
20324
- }, children: isProductScopedRequestType(requestType) ? /* @__PURE__ */ jsxs40(
20325
- "div",
20326
- {
20327
- style: {
20328
- ...pcStyles.flex,
20329
- ...pcStyles.flexCol,
20330
- gap: getVar21("--pc-spacing-md")
20331
- },
20332
- children: [
20333
- !skipProductStep && /* @__PURE__ */ jsx62(
20334
- ProductSelectionSection,
20335
- {
20336
- directGroups: (_b = data == null ? void 0 : data.direct_groups) != null ? _b : [],
20337
- nominatedGroups: (_c = data == null ? void 0 : data.nominated_groups) != null ? _c : [],
20338
- selectedProductKey,
20339
- onSelect: handleProductSelect,
20340
- requestTypeLabel: requestTypeLabels[requestType],
20341
- isTranslating
20342
- }
20343
- ),
20344
- selectedGroup && (() => {
20345
- var _a2, _b2;
20346
- const key = productGroupKey(selectedGroup);
20347
- const isCorrection = requestType === "CORRECTION" /* CORRECTION */;
20348
- const groupDataElements = isCorrection ? buildGroupDataElements(selectedGroup) : [];
20349
- const nominatorLabel = selectedGroup.nominator ? (_b2 = (_a2 = selectedGroup.nominator.name) != null ? _a2 : selectedGroup.nominator.email) != null ? _b2 : "" : "";
20350
- return /* @__PURE__ */ jsxs40(
20351
- "div",
20356
+ style: {
20357
+ ...pcStyles.flex,
20358
+ ...pcStyles.flexCol,
20359
+ gap: getVar21("--pc-spacing-md")
20360
+ },
20361
+ children: [
20362
+ !skipProductStep && /* @__PURE__ */ jsx62(
20363
+ ProductSelectionSection,
20352
20364
  {
20353
- className: "pc-product-purpose-panel",
20354
- "data-testid": `per-product-purposes-${key}`,
20355
- children: [
20356
- /* @__PURE__ */ jsxs40("div", { className: "pc-product-purpose-panel-header", children: [
20357
- /* @__PURE__ */ jsxs40("div", { className: "pc-product-purpose-panel-title-row", children: [
20365
+ directGroups: (_b = data == null ? void 0 : data.direct_groups) != null ? _b : [],
20366
+ nominatedGroups: (_c = data == null ? void 0 : data.nominated_groups) != null ? _c : [],
20367
+ selectedProductKey,
20368
+ onSelect: handleProductSelect,
20369
+ requestTypeLabel: requestTypeLabels[requestType],
20370
+ isTranslating
20371
+ }
20372
+ ),
20373
+ selectedGroup && (() => {
20374
+ var _a2, _b2;
20375
+ const key = productGroupKey(selectedGroup);
20376
+ const isCorrection = requestType === "CORRECTION" /* CORRECTION */;
20377
+ const groupDataElements = isCorrection ? buildGroupDataElements(selectedGroup) : [];
20378
+ const nominatorLabel = selectedGroup.nominator ? (_b2 = (_a2 = selectedGroup.nominator.name) != null ? _a2 : selectedGroup.nominator.email) != null ? _b2 : "" : "";
20379
+ return /* @__PURE__ */ jsxs40(
20380
+ "div",
20381
+ {
20382
+ className: "pc-product-purpose-panel",
20383
+ "data-testid": `per-product-purposes-${key}`,
20384
+ children: [
20385
+ /* @__PURE__ */ jsxs40("div", { className: "pc-product-purpose-panel-header", children: [
20386
+ /* @__PURE__ */ jsxs40("div", { className: "pc-product-purpose-panel-title-row", children: [
20387
+ /* @__PURE__ */ jsx62(
20388
+ PCText,
20389
+ {
20390
+ as: "span",
20391
+ size: "base",
20392
+ weight: "semibold",
20393
+ color: "primary",
20394
+ className: "pc-product-purpose-panel-title",
20395
+ children: selectedGroup.product_name
20396
+ }
20397
+ ),
20398
+ selectedGroup.nominator && /* @__PURE__ */ jsx62(
20399
+ PCText,
20400
+ {
20401
+ as: "span",
20402
+ size: "xs",
20403
+ weight: "medium",
20404
+ color: "secondary",
20405
+ className: "pc-product-purpose-panel-nominator",
20406
+ children: t("actingOnBehalfOfShort", {
20407
+ nominator: nominatorLabel
20408
+ })
20409
+ }
20410
+ )
20411
+ ] }),
20358
20412
  /* @__PURE__ */ jsx62(
20359
- PCText,
20360
- {
20361
- as: "span",
20362
- size: "base",
20363
- weight: "semibold",
20364
- color: "primary",
20365
- className: "pc-product-purpose-panel-title",
20366
- children: selectedGroup.product_name
20367
- }
20368
- ),
20369
- selectedGroup.nominator && /* @__PURE__ */ jsx62(
20370
20413
  PCText,
20371
20414
  {
20372
20415
  as: "span",
20373
20416
  size: "xs",
20374
- weight: "medium",
20375
20417
  color: "secondary",
20376
- className: "pc-product-purpose-panel-nominator",
20377
- children: t("actingOnBehalfOfShort", {
20378
- nominator: nominatorLabel
20379
- })
20418
+ className: "pc-product-purpose-panel-subtitle",
20419
+ children: t("selectPurposesForThisProduct")
20380
20420
  }
20381
20421
  )
20382
20422
  ] }),
20383
20423
  /* @__PURE__ */ jsx62(
20384
- PCText,
20424
+ "div",
20385
20425
  {
20386
- as: "span",
20387
- size: "xs",
20388
- color: "secondary",
20389
- className: "pc-product-purpose-panel-subtitle",
20390
- children: t("selectPurposesForThisProduct")
20426
+ className: "pc-product-purpose-panel-body",
20427
+ "data-testid": `per-product-purposes-body-${key}`,
20428
+ children: isCorrection ? /* @__PURE__ */ jsx62(
20429
+ CorrectionDataSection,
20430
+ {
20431
+ dataElements: groupDataElements,
20432
+ selected: selectedCorrectionElements,
20433
+ setSelected: setSelectedCorrectionElements,
20434
+ correctionValues,
20435
+ setCorrectionValues,
20436
+ isTranslating
20437
+ }
20438
+ ) : /* @__PURE__ */ jsx62(
20439
+ PurposeSelectionSection,
20440
+ {
20441
+ purposes: selectedPurposes,
20442
+ setPurposes: setSelectedPurposes,
20443
+ requestType,
20444
+ isTranslating
20445
+ }
20446
+ )
20391
20447
  }
20392
20448
  )
20393
- ] }),
20394
- /* @__PURE__ */ jsx62(
20395
- "div",
20396
- {
20397
- className: "pc-product-purpose-panel-body",
20398
- "data-testid": `per-product-purposes-body-${key}`,
20399
- children: isCorrection ? /* @__PURE__ */ jsx62(
20400
- CorrectionDataSection,
20449
+ ]
20450
+ }
20451
+ );
20452
+ })()
20453
+ ]
20454
+ }
20455
+ ) : requestType === "grievance" /* GRIEVANCE */ ? /* @__PURE__ */ jsx62(
20456
+ GrievanceDataSection,
20457
+ {
20458
+ grievanceOptions,
20459
+ selectedGrievances,
20460
+ setSelectedGrievances,
20461
+ isTranslating
20462
+ }
20463
+ ) : requestType === "nomination" /* NOMINATION */ ? /* @__PURE__ */ jsx62(
20464
+ NominationDataSection,
20465
+ {
20466
+ nominationData,
20467
+ setNominationData,
20468
+ isTranslating
20469
+ }
20470
+ ) : /* @__PURE__ */ jsx62(
20471
+ "div",
20472
+ {
20473
+ style: {
20474
+ color: getVar21("--pc-text-secondary"),
20475
+ ...isPopup ? {
20476
+ padding: getVar21("--pc-spacing-md")
20477
+ } : {
20478
+ ...pcStyles.flex,
20479
+ height: "8rem",
20480
+ ...pcStyles.itemsCenter,
20481
+ ...pcStyles.justifyCenter,
20482
+ padding: getVar21("--pc-spacing-lg")
20483
+ },
20484
+ textAlign: "center"
20485
+ },
20486
+ children: t("selectRequestType")
20487
+ }
20488
+ ) })
20489
+ ]
20490
+ }
20491
+ ),
20492
+ /* @__PURE__ */ jsxs40(
20493
+ "div",
20494
+ {
20495
+ style: {
20496
+ ...pcStyles.flex,
20497
+ ...pcStyles.flexCol,
20498
+ gap: getVar21("--pc-spacing-sm"),
20499
+ ...isPopup && !isPopupFormEnabled ? {
20500
+ pointerEvents: "none",
20501
+ opacity: 0.6
20502
+ } : {}
20503
+ },
20504
+ children: [
20505
+ /* @__PURE__ */ jsx62("p", { style: {
20506
+ fontWeight: pcStyles.fontWeightSemibold.fontWeight,
20507
+ color: `var(--pc-text-primary)`,
20508
+ fontSize: pcStyles.textSm.fontSize,
20509
+ margin: 0
20510
+ }, children: t("supportingDocumentation") }),
20511
+ /* @__PURE__ */ jsx62(
20512
+ "input",
20513
+ {
20514
+ ref: fileInputRef,
20515
+ id: "privacy-file-upload",
20516
+ type: "file",
20517
+ onChange: (e) => handleFileChange(e),
20518
+ style: { display: "none" }
20519
+ }
20520
+ ),
20521
+ /* @__PURE__ */ jsxs40(
20522
+ "div",
20523
+ {
20524
+ style: {
20525
+ ...pcStyles.flex,
20526
+ flexWrap: "wrap",
20527
+ ...pcStyles.itemsStart,
20528
+ borderRadius: pcStyles.borderRadiusMd,
20529
+ border: `1px solid var(--pc-border-color)`,
20530
+ backgroundColor: `var(--pc-bg-secondary)`,
20531
+ padding: getVar21("--pc-spacing-md"),
20532
+ minHeight: "100px",
20533
+ ...isPopup ? {
20534
+ gap: "0.5rem",
20535
+ ...pcStyles.overflowYAuto
20536
+ } : {
20537
+ gap: getVar21("--pc-spacing-sm")
20538
+ }
20539
+ },
20540
+ children: [
20541
+ isDocument && uploadedDocuments.length > 0 && /* @__PURE__ */ jsx62(
20542
+ "div",
20543
+ {
20544
+ style: {
20545
+ ...pcStyles.flex,
20546
+ ...pcStyles.gapSm,
20547
+ ...isPopup ? { flexWrap: "wrap" } : {},
20548
+ width: "100%"
20549
+ },
20550
+ children: uploadedDocuments.map((doc) => /* @__PURE__ */ jsxs40(
20551
+ "div",
20552
+ {
20553
+ style: {
20554
+ position: "relative",
20555
+ ...pcStyles.flex,
20556
+ ...pcStyles.itemsCenter,
20557
+ ...pcStyles.gapXs,
20558
+ borderRadius: pcStyles.borderRadiusMd,
20559
+ border: `1px solid var(--pc-border-color)`,
20560
+ backgroundColor: `var(--pc-bg-primary)`,
20561
+ padding: getVar21("--pc-spacing-sm")
20562
+ },
20563
+ children: [
20564
+ /* @__PURE__ */ jsx62(
20565
+ "img",
20401
20566
  {
20402
- dataElements: groupDataElements,
20403
- selected: selectedCorrectionElements,
20404
- setSelected: setSelectedCorrectionElements,
20405
- correctionValues,
20406
- setCorrectionValues,
20407
- isTranslating
20567
+ src: fileAttach_default,
20568
+ alt: "fileAttach",
20569
+ width: 24,
20570
+ height: 24
20408
20571
  }
20409
- ) : /* @__PURE__ */ jsx62(
20410
- PurposeSelectionSection,
20572
+ ),
20573
+ /* @__PURE__ */ jsx62(
20574
+ "p",
20575
+ {
20576
+ style: {
20577
+ fontWeight: pcStyles.fontWeightMedium.fontWeight,
20578
+ color: `var(--pc-text-primary)`,
20579
+ ...isPopup ? {
20580
+ maxWidth: "100px",
20581
+ overflow: "hidden",
20582
+ textOverflow: "ellipsis",
20583
+ whiteSpace: "nowrap",
20584
+ fontSize: pcStyles.textXs.fontSize
20585
+ } : {
20586
+ fontSize: pcStyles.textSm.fontSize
20587
+ }
20588
+ },
20589
+ children: doc.name
20590
+ }
20591
+ ),
20592
+ /* @__PURE__ */ jsx62(
20593
+ "div",
20411
20594
  {
20412
- purposes: selectedPurposes,
20413
- setPurposes: setSelectedPurposes,
20414
- requestType,
20415
- isTranslating
20595
+ style: {
20596
+ position: "absolute",
20597
+ right: "-0.25rem",
20598
+ top: "-0.5rem",
20599
+ cursor: "pointer"
20600
+ },
20601
+ onClick: (e) => {
20602
+ e.stopPropagation();
20603
+ handleRemoveDocument(doc.uuid);
20604
+ },
20605
+ children: /* @__PURE__ */ jsx62("div", { style: {
20606
+ borderRadius: "50%",
20607
+ border: `1px solid var(--pc-border-color)`,
20608
+ backgroundColor: `var(--pc-bg-secondary)`,
20609
+ padding: "0.125rem"
20610
+ }, children: /* @__PURE__ */ jsx62(AiOutlineClose, { size: 12, style: { color: "var(--pc-error)" } }) })
20416
20611
  }
20417
20612
  )
20613
+ ]
20614
+ },
20615
+ doc.uuid
20616
+ ))
20617
+ }
20618
+ ),
20619
+ /* @__PURE__ */ jsx62("div", { style: {
20620
+ width: uploadedDocuments.length > 0 ? "auto" : "100%",
20621
+ ...pcStyles.flex,
20622
+ ...pcStyles.itemsCenter,
20623
+ ...pcStyles.justifyCenter,
20624
+ minHeight: uploadedDocuments.length > 0 ? "auto" : "100px"
20625
+ }, children: isDocumentUploading ? /* @__PURE__ */ jsxs40("div", { style: {
20626
+ padding: uploadedDocuments.length > 0 ? getVar21("--pc-spacing-sm") : getVar21("--pc-spacing-lg"),
20627
+ borderRadius: pcStyles.borderRadiusMd,
20628
+ border: uploadedDocuments.length > 0 ? `1px solid var(--pc-border-color)` : "none",
20629
+ backgroundColor: `var(--pc-bg-primary)`,
20630
+ fontWeight: pcStyles.fontWeightSemibold.fontWeight,
20631
+ color: `var(--pc-text-primary)`,
20632
+ ...pcStyles.flex,
20633
+ ...pcStyles.itemsCenter,
20634
+ ...pcStyles.justifyCenter,
20635
+ gap: uploadedDocuments.length > 0 ? getVar21("--pc-spacing-sm") : getVar21("--pc-spacing-md"),
20636
+ width: "auto"
20637
+ }, children: [
20638
+ /* @__PURE__ */ jsx62(PCLoader, { variant: "spinner", size: "sm" }),
20639
+ /* @__PURE__ */ jsx62("span", { children: t("uploading") })
20640
+ ] }) : /* @__PURE__ */ jsx62(
20641
+ "div",
20642
+ {
20643
+ style: {
20644
+ ...pcStyles.flex,
20645
+ width: uploadedDocuments.length > 0 ? "auto" : "100%",
20646
+ cursor: "pointer",
20647
+ ...pcStyles.itemsCenter,
20648
+ ...pcStyles.justifyCenter,
20649
+ gap: uploadedDocuments.length > 0 ? getVar21("--pc-spacing-sm") : getVar21("--pc-spacing-md"),
20650
+ borderRadius: pcStyles.borderRadiusMd,
20651
+ padding: uploadedDocuments.length > 0 ? getVar21("--pc-spacing-sm") : getVar21("--pc-spacing-lg"),
20652
+ border: uploadedDocuments.length > 0 ? `1px solid var(--pc-border-color)` : "none",
20653
+ backgroundColor: uploadedDocuments.length > 0 ? `var(--pc-bg-primary)` : "transparent",
20654
+ transition: "all 0.2s ease"
20655
+ },
20656
+ onMouseEnter: (e) => {
20657
+ e.currentTarget.style.backgroundColor = uploadedDocuments.length > 0 ? `var(--pc-bg-hover)` : `var(--pc-bg-hover)`;
20658
+ if (uploadedDocuments.length > 0) {
20659
+ e.currentTarget.style.borderColor = `var(--pc-primary)`;
20660
+ }
20661
+ },
20662
+ onMouseLeave: (e) => {
20663
+ e.currentTarget.style.backgroundColor = uploadedDocuments.length > 0 ? `var(--pc-bg-primary)` : "transparent";
20664
+ if (uploadedDocuments.length > 0) {
20665
+ e.currentTarget.style.borderColor = `var(--pc-border-color)`;
20666
+ }
20667
+ },
20668
+ role: "button",
20669
+ tabIndex: 0,
20670
+ "aria-label": t("uploadFile"),
20671
+ onClick: () => {
20672
+ var _a2;
20673
+ return (_a2 = document.getElementById("privacy-file-upload")) == null ? void 0 : _a2.click();
20674
+ },
20675
+ onKeyDown: (e) => {
20676
+ var _a2;
20677
+ if (e.key === "Enter" || e.key === " ") {
20678
+ e.preventDefault();
20679
+ (_a2 = document.getElementById("privacy-file-upload")) == null ? void 0 : _a2.click();
20680
+ }
20681
+ },
20682
+ children: uploadedDocuments.length === 0 ? /* @__PURE__ */ jsxs40(Fragment11, { children: [
20683
+ /* @__PURE__ */ jsx62("div", { children: /* @__PURE__ */ jsx62(
20684
+ "img",
20685
+ {
20686
+ src: uploadFileIcon_default,
20687
+ width: 44,
20688
+ height: 44,
20689
+ alt: "upload"
20418
20690
  }
20419
- )
20420
- ]
20691
+ ) }),
20692
+ /* @__PURE__ */ jsx62("span", { style: {
20693
+ color: "var(--pc-text-secondary)",
20694
+ fontSize: pcStyles.textSm.fontSize
20695
+ }, children: t("uploadFile") })
20696
+ ] }) : /* @__PURE__ */ jsxs40("div", { style: { ...pcStyles.flex, ...pcStyles.itemsCenter, ...pcStyles.justifyCenter, ...pcStyles.gapSm }, children: [
20697
+ /* @__PURE__ */ jsx62(
20698
+ PiUploadBold,
20699
+ {
20700
+ size: isPopup ? 20 : 16,
20701
+ style: { color: "var(--pc-text-secondary)" }
20702
+ }
20703
+ ),
20704
+ !isPopup && /* @__PURE__ */ jsx62("p", { style: {
20705
+ fontWeight: pcStyles.fontWeightMedium.fontWeight,
20706
+ color: `var(--pc-text-primary)`
20707
+ }, children: t("uploadFileButton") })
20708
+ ] })
20421
20709
  }
20422
- );
20423
- })()
20424
- ]
20425
- }
20426
- ) : requestType === "grievance" /* GRIEVANCE */ ? /* @__PURE__ */ jsx62(
20427
- GrievanceDataSection,
20428
- {
20429
- grievanceOptions,
20430
- selectedGrievances,
20431
- setSelectedGrievances,
20432
- isTranslating
20710
+ ) })
20711
+ ]
20712
+ }
20713
+ )
20714
+ ]
20715
+ }
20716
+ ),
20717
+ requestType === "ACCESS" /* ACCESS */ && /* @__PURE__ */ jsx62(
20718
+ PCSelect,
20719
+ {
20720
+ label: t("timePeriod"),
20721
+ options: timePeriodOptions,
20722
+ value: timePeriodOptions.find(
20723
+ (opt) => opt.value === timePeriod
20724
+ ) || null,
20725
+ onChange: (value) => {
20726
+ if (value) {
20727
+ setTimePeriod(value.value);
20433
20728
  }
20434
- ) : requestType === "nomination" /* NOMINATION */ ? /* @__PURE__ */ jsx62(
20435
- NominationDataSection,
20436
- {
20437
- nominationData,
20438
- setNominationData,
20439
- isTranslating
20729
+ },
20730
+ disabled: isPopup && !isPopupFormEnabled
20731
+ }
20732
+ ),
20733
+ /* @__PURE__ */ jsx62(
20734
+ PCTextarea,
20735
+ {
20736
+ label: t("additionalNote"),
20737
+ placeholder: t("reasonOptional"),
20738
+ value: formData.additionalNote,
20739
+ onChange: (e) => setFormData({
20740
+ ...formData,
20741
+ additionalNote: e.target.value
20742
+ }),
20743
+ style: isPopup ? { minHeight: "60px" } : {},
20744
+ disabled: isPopup && !isPopupFormEnabled
20745
+ }
20746
+ ),
20747
+ /* @__PURE__ */ jsx62(
20748
+ PCCheckbox,
20749
+ {
20750
+ size: "sm",
20751
+ label: /* @__PURE__ */ jsxs40("span", { children: [
20752
+ t("confirmCheckBox"),
20753
+ " ",
20754
+ /* @__PURE__ */ jsx62("span", { style: { color: getVar21("--pc-error") }, children: "*" })
20755
+ ] }),
20756
+ checked: formData.confirmCheckBox,
20757
+ onChange: (e) => setFormData({
20758
+ ...formData,
20759
+ confirmCheckBox: e.target.checked
20760
+ }),
20761
+ disabled: isPopup && !isPopupFormEnabled
20762
+ }
20763
+ ),
20764
+ /* @__PURE__ */ jsxs40(
20765
+ "div",
20766
+ {
20767
+ style: {
20768
+ ...pcStyles.flex,
20769
+ ...pcStyles.flexRow,
20770
+ ...pcStyles.justifyEnd,
20771
+ gap: getVar21("--pc-spacing-sm"),
20772
+ ...isPopup ? {
20773
+ position: "sticky",
20774
+ bottom: 0,
20775
+ left: 0,
20776
+ right: 0,
20777
+ zIndex: 20,
20778
+ borderTop: `1px solid ${getVar21("--pc-border-color")}`,
20779
+ backgroundColor: getVar21("--pc-bg-primary"),
20780
+ padding: "0.75rem",
20781
+ marginLeft: "-0.75rem",
20782
+ marginRight: "-0.75rem"
20783
+ } : {
20784
+ marginTop: pcStyles.mtMd.marginTop
20440
20785
  }
20441
- ) : /* @__PURE__ */ jsx62(
20442
- "div",
20443
- {
20444
- style: {
20445
- color: getVar21("--pc-text-secondary"),
20446
- ...isPopup ? {
20447
- padding: getVar21("--pc-spacing-md")
20448
- } : {
20786
+ },
20787
+ className: "pc-flex-responsive pc-spacing-responsive",
20788
+ children: [
20789
+ isPopup && /* @__PURE__ */ jsx62(PCButton, { variant: "secondary", onClick: onClose, style: { flexShrink: 0 }, children: (_d = t("cancel")) != null ? _d : "Cancel" }),
20790
+ /* @__PURE__ */ jsx62(
20791
+ PCButton,
20792
+ {
20793
+ variant: "primary",
20794
+ onClick: handleSubmitClick,
20795
+ disabled: !isFormValid || isLoading,
20796
+ isLoading,
20797
+ style: {
20449
20798
  ...pcStyles.flex,
20450
- height: "8rem",
20451
20799
  ...pcStyles.itemsCenter,
20452
20800
  ...pcStyles.justifyCenter,
20453
- padding: getVar21("--pc-spacing-lg")
20801
+ minWidth: "120px",
20802
+ flexShrink: 0,
20803
+ opacity: !isFormValid || isLoading ? 0.5 : 1,
20804
+ cursor: !isFormValid || isLoading ? "not-allowed" : isLoading ? "wait" : "pointer"
20454
20805
  },
20455
- textAlign: "center"
20456
- },
20457
- children: t("selectRequestType")
20458
- }
20459
- ) })
20460
- ]
20461
- }
20462
- ),
20463
- /* @__PURE__ */ jsxs40(
20464
- "div",
20465
- {
20466
- style: {
20467
- ...pcStyles.flex,
20468
- ...pcStyles.flexCol,
20469
- gap: getVar21("--pc-spacing-sm"),
20470
- ...isPopup && !isPopupFormEnabled ? {
20471
- pointerEvents: "none",
20472
- opacity: 0.6
20473
- } : {}
20474
- },
20475
- children: [
20476
- /* @__PURE__ */ jsx62("p", { style: {
20477
- fontWeight: pcStyles.fontWeightSemibold.fontWeight,
20478
- color: `var(--pc-text-primary)`,
20479
- fontSize: pcStyles.textSm.fontSize,
20480
- margin: 0
20481
- }, children: t("supportingDocumentation") }),
20482
- /* @__PURE__ */ jsx62(
20483
- "input",
20484
- {
20485
- ref: fileInputRef,
20486
- id: "privacy-file-upload",
20487
- type: "file",
20488
- onChange: (e) => handleFileChange(e),
20489
- style: { display: "none" }
20490
- }
20491
- ),
20492
- /* @__PURE__ */ jsxs40(
20493
- "div",
20494
- {
20495
- style: {
20496
- ...pcStyles.flex,
20497
- flexWrap: "wrap",
20498
- ...pcStyles.itemsStart,
20499
- borderRadius: pcStyles.borderRadiusMd,
20500
- border: `1px solid var(--pc-border-color)`,
20501
- backgroundColor: `var(--pc-bg-secondary)`,
20502
- padding: getVar21("--pc-spacing-md"),
20503
- minHeight: "100px",
20504
- ...isPopup ? {
20505
- gap: "0.5rem",
20506
- ...pcStyles.overflowYAuto
20507
- } : {
20508
- gap: getVar21("--pc-spacing-sm")
20509
- }
20510
- },
20511
- children: [
20512
- isDocument && uploadedDocuments.length > 0 && /* @__PURE__ */ jsx62(
20513
- "div",
20514
- {
20515
- style: {
20516
- ...pcStyles.flex,
20517
- ...pcStyles.gapSm,
20518
- ...isPopup ? { flexWrap: "wrap" } : {},
20519
- width: "100%"
20520
- },
20521
- children: uploadedDocuments.map((doc) => /* @__PURE__ */ jsxs40(
20522
- "div",
20523
- {
20524
- style: {
20525
- position: "relative",
20526
- ...pcStyles.flex,
20527
- ...pcStyles.itemsCenter,
20528
- ...pcStyles.gapXs,
20529
- borderRadius: pcStyles.borderRadiusMd,
20530
- border: `1px solid var(--pc-border-color)`,
20531
- backgroundColor: `var(--pc-bg-primary)`,
20532
- padding: getVar21("--pc-spacing-sm")
20533
- },
20534
- children: [
20535
- /* @__PURE__ */ jsx62(
20536
- "img",
20537
- {
20538
- src: fileAttach_default,
20539
- alt: "fileAttach",
20540
- width: 24,
20541
- height: 24
20542
- }
20543
- ),
20544
- /* @__PURE__ */ jsx62(
20545
- "p",
20546
- {
20547
- style: {
20548
- fontWeight: pcStyles.fontWeightMedium.fontWeight,
20549
- color: `var(--pc-text-primary)`,
20550
- ...isPopup ? {
20551
- maxWidth: "100px",
20552
- overflow: "hidden",
20553
- textOverflow: "ellipsis",
20554
- whiteSpace: "nowrap",
20555
- fontSize: pcStyles.textXs.fontSize
20556
- } : {
20557
- fontSize: pcStyles.textSm.fontSize
20558
- }
20559
- },
20560
- children: doc.name
20561
- }
20562
- ),
20563
- /* @__PURE__ */ jsx62(
20564
- "div",
20565
- {
20566
- style: {
20567
- position: "absolute",
20568
- right: "-0.25rem",
20569
- top: "-0.5rem",
20570
- cursor: "pointer"
20571
- },
20572
- onClick: (e) => {
20573
- e.stopPropagation();
20574
- handleRemoveDocument(doc.uuid);
20575
- },
20576
- children: /* @__PURE__ */ jsx62("div", { style: {
20577
- borderRadius: "50%",
20578
- border: `1px solid var(--pc-border-color)`,
20579
- backgroundColor: `var(--pc-bg-secondary)`,
20580
- padding: "0.125rem"
20581
- }, children: /* @__PURE__ */ jsx62(AiOutlineClose, { size: 12, style: { color: "var(--pc-error)" } }) })
20582
- }
20583
- )
20584
- ]
20585
- },
20586
- doc.uuid
20587
- ))
20588
- }
20589
- ),
20590
- /* @__PURE__ */ jsx62("div", { style: {
20591
- width: uploadedDocuments.length > 0 ? "auto" : "100%",
20592
- ...pcStyles.flex,
20593
- ...pcStyles.itemsCenter,
20594
- ...pcStyles.justifyCenter,
20595
- minHeight: uploadedDocuments.length > 0 ? "auto" : "100px"
20596
- }, children: isDocumentUploading ? /* @__PURE__ */ jsxs40("div", { style: {
20597
- padding: uploadedDocuments.length > 0 ? getVar21("--pc-spacing-sm") : getVar21("--pc-spacing-lg"),
20598
- borderRadius: pcStyles.borderRadiusMd,
20599
- border: uploadedDocuments.length > 0 ? `1px solid var(--pc-border-color)` : "none",
20600
- backgroundColor: `var(--pc-bg-primary)`,
20601
- fontWeight: pcStyles.fontWeightSemibold.fontWeight,
20602
- color: `var(--pc-text-primary)`,
20603
- ...pcStyles.flex,
20604
- ...pcStyles.itemsCenter,
20605
- ...pcStyles.justifyCenter,
20606
- gap: uploadedDocuments.length > 0 ? getVar21("--pc-spacing-sm") : getVar21("--pc-spacing-md"),
20607
- width: "auto"
20608
- }, children: [
20609
- /* @__PURE__ */ jsx62(PCLoader, { variant: "spinner", size: "sm" }),
20610
- /* @__PURE__ */ jsx62("span", { children: t("uploading") })
20611
- ] }) : /* @__PURE__ */ jsx62(
20612
- "div",
20613
- {
20614
- style: {
20615
- ...pcStyles.flex,
20616
- width: uploadedDocuments.length > 0 ? "auto" : "100%",
20617
- cursor: "pointer",
20618
- ...pcStyles.itemsCenter,
20619
- ...pcStyles.justifyCenter,
20620
- gap: uploadedDocuments.length > 0 ? getVar21("--pc-spacing-sm") : getVar21("--pc-spacing-md"),
20621
- borderRadius: pcStyles.borderRadiusMd,
20622
- padding: uploadedDocuments.length > 0 ? getVar21("--pc-spacing-sm") : getVar21("--pc-spacing-lg"),
20623
- border: uploadedDocuments.length > 0 ? `1px solid var(--pc-border-color)` : "none",
20624
- backgroundColor: uploadedDocuments.length > 0 ? `var(--pc-bg-primary)` : "transparent",
20625
- transition: "all 0.2s ease"
20626
- },
20627
- onMouseEnter: (e) => {
20628
- e.currentTarget.style.backgroundColor = uploadedDocuments.length > 0 ? `var(--pc-bg-hover)` : `var(--pc-bg-hover)`;
20629
- if (uploadedDocuments.length > 0) {
20630
- e.currentTarget.style.borderColor = `var(--pc-primary)`;
20631
- }
20632
- },
20633
- onMouseLeave: (e) => {
20634
- e.currentTarget.style.backgroundColor = uploadedDocuments.length > 0 ? `var(--pc-bg-primary)` : "transparent";
20635
- if (uploadedDocuments.length > 0) {
20636
- e.currentTarget.style.borderColor = `var(--pc-border-color)`;
20637
- }
20638
- },
20639
- role: "button",
20640
- tabIndex: 0,
20641
- "aria-label": t("uploadFile"),
20642
- onClick: () => {
20643
- var _a2;
20644
- return (_a2 = document.getElementById("privacy-file-upload")) == null ? void 0 : _a2.click();
20645
- },
20646
- onKeyDown: (e) => {
20647
- var _a2;
20648
- if (e.key === "Enter" || e.key === " ") {
20649
- e.preventDefault();
20650
- (_a2 = document.getElementById("privacy-file-upload")) == null ? void 0 : _a2.click();
20651
- }
20652
- },
20653
- children: uploadedDocuments.length === 0 ? /* @__PURE__ */ jsxs40(Fragment11, { children: [
20654
- /* @__PURE__ */ jsx62("div", { children: /* @__PURE__ */ jsx62(
20655
- "img",
20656
- {
20657
- src: uploadFileIcon_default,
20658
- width: 44,
20659
- height: 44,
20660
- alt: "upload"
20661
- }
20662
- ) }),
20663
- /* @__PURE__ */ jsx62("span", { style: {
20664
- color: "var(--pc-text-secondary)",
20665
- fontSize: pcStyles.textSm.fontSize
20666
- }, children: t("uploadFile") })
20667
- ] }) : /* @__PURE__ */ jsxs40("div", { style: { ...pcStyles.flex, ...pcStyles.itemsCenter, ...pcStyles.justifyCenter, ...pcStyles.gapSm }, children: [
20668
- /* @__PURE__ */ jsx62(
20669
- PiUploadBold,
20670
- {
20671
- size: isPopup ? 20 : 16,
20672
- style: { color: "var(--pc-text-secondary)" }
20673
- }
20674
- ),
20675
- !isPopup && /* @__PURE__ */ jsx62("p", { style: {
20676
- fontWeight: pcStyles.fontWeightMedium.fontWeight,
20677
- color: `var(--pc-text-primary)`
20678
- }, children: t("uploadFileButton") })
20679
- ] })
20680
- }
20681
- ) })
20682
- ]
20683
- }
20684
- )
20685
- ]
20686
- }
20687
- ),
20688
- requestType === "ACCESS" /* ACCESS */ && /* @__PURE__ */ jsx62(
20689
- PCSelect,
20690
- {
20691
- label: t("timePeriod"),
20692
- options: timePeriodOptions,
20693
- value: timePeriodOptions.find(
20694
- (opt) => opt.value === timePeriod
20695
- ) || null,
20696
- onChange: (value) => {
20697
- if (value) {
20698
- setTimePeriod(value.value);
20699
- }
20700
- },
20701
- disabled: isPopup && !isPopupFormEnabled
20702
- }
20703
- ),
20704
- /* @__PURE__ */ jsx62(
20705
- PCTextarea,
20706
- {
20707
- label: t("additionalNote"),
20708
- placeholder: t("reasonOptional"),
20709
- value: formData.additionalNote,
20710
- onChange: (e) => setFormData({
20711
- ...formData,
20712
- additionalNote: e.target.value
20713
- }),
20714
- style: isPopup ? { minHeight: "60px" } : {},
20715
- disabled: isPopup && !isPopupFormEnabled
20716
- }
20717
- ),
20718
- /* @__PURE__ */ jsx62(
20719
- PCCheckbox,
20720
- {
20721
- size: "sm",
20722
- label: /* @__PURE__ */ jsxs40("span", { children: [
20723
- t("confirmCheckBox"),
20724
- " ",
20725
- /* @__PURE__ */ jsx62("span", { style: { color: getVar21("--pc-error") }, children: "*" })
20726
- ] }),
20727
- checked: formData.confirmCheckBox,
20728
- onChange: (e) => setFormData({
20729
- ...formData,
20730
- confirmCheckBox: e.target.checked
20731
- }),
20732
- disabled: isPopup && !isPopupFormEnabled
20733
- }
20734
- ),
20735
- /* @__PURE__ */ jsxs40(
20736
- "div",
20737
- {
20738
- style: {
20739
- ...pcStyles.flex,
20740
- ...pcStyles.flexRow,
20741
- ...pcStyles.justifyEnd,
20742
- gap: getVar21("--pc-spacing-sm"),
20743
- ...isPopup ? {
20744
- position: "sticky",
20745
- bottom: 0,
20746
- left: 0,
20747
- right: 0,
20748
- zIndex: 20,
20749
- borderTop: `1px solid ${getVar21("--pc-border-color")}`,
20750
- backgroundColor: getVar21("--pc-bg-primary"),
20751
- padding: "0.75rem",
20752
- marginLeft: "-0.75rem",
20753
- marginRight: "-0.75rem"
20754
- } : {
20755
- marginTop: pcStyles.mtMd.marginTop
20756
- }
20757
- },
20758
- className: "pc-flex-responsive pc-spacing-responsive",
20759
- children: [
20760
- isPopup && /* @__PURE__ */ jsx62(PCButton, { variant: "secondary", onClick: onClose, style: { flexShrink: 0 }, children: (_d = t("cancel")) != null ? _d : "Cancel" }),
20761
- /* @__PURE__ */ jsx62(
20762
- PCButton,
20763
- {
20764
- variant: "primary",
20765
- onClick: handleSubmitClick,
20766
- disabled: !isFormValid || isLoading,
20767
- isLoading,
20768
- style: {
20769
- ...pcStyles.flex,
20770
- ...pcStyles.itemsCenter,
20771
- ...pcStyles.justifyCenter,
20772
- minWidth: "120px",
20773
- flexShrink: 0,
20774
- opacity: !isFormValid || isLoading ? 0.5 : 1,
20775
- cursor: !isFormValid || isLoading ? "not-allowed" : isLoading ? "wait" : "pointer"
20776
- },
20777
- children: t("submit")
20778
- }
20779
- )
20780
- ]
20781
- }
20782
- )
20783
- ]
20806
+ children: t("submit")
20807
+ }
20808
+ )
20809
+ ]
20810
+ }
20811
+ )
20812
+ ]
20813
+ }
20814
+ )
20815
+ ] })
20816
+ }
20817
+ )
20818
+ ] }) }),
20819
+ /* @__PURE__ */ jsx62(
20820
+ PCModal,
20821
+ {
20822
+ isOpen: isErasureConsentModalOpen,
20823
+ onClose: handleErasureModalClose,
20824
+ size: "md",
20825
+ showCloseButton: false,
20826
+ footer: /* @__PURE__ */ jsxs40("div", { className: "pc-erasure-modal-footer", children: [
20827
+ /* @__PURE__ */ jsx62(
20828
+ PCButton,
20829
+ {
20830
+ variant: "secondary",
20831
+ onClick: () => handleErasureModalChoice(false),
20832
+ disabled: isLoading,
20833
+ children: t("revokeConsentNo")
20834
+ }
20835
+ ),
20836
+ /* @__PURE__ */ jsx62(
20837
+ PCButton,
20838
+ {
20839
+ variant: "primary",
20840
+ onClick: () => handleErasureModalChoice(true),
20841
+ disabled: isLoading,
20842
+ isLoading,
20843
+ children: t("revokeConsentYes")
20784
20844
  }
20785
20845
  )
20846
+ ] }),
20847
+ children: /* @__PURE__ */ jsxs40("div", { className: "pc-erasure-modal-content", children: [
20848
+ /* @__PURE__ */ jsxs40("div", { className: "pc-erasure-modal-header", children: [
20849
+ /* @__PURE__ */ jsx62("div", { className: "pc-erasure-modal-icon", children: /* @__PURE__ */ jsx62(FiAlertCircle, { size: 24 }) }),
20850
+ /* @__PURE__ */ jsx62("p", { className: "pc-erasure-modal-title", children: t("revokeConsentModalTitle") }),
20851
+ /* @__PURE__ */ jsx62("p", { className: "pc-erasure-modal-question", children: t("revokeConsentModalQuestion") })
20852
+ ] }),
20853
+ /* @__PURE__ */ jsxs40("div", { className: "pc-erasure-modal-purposes", children: [
20854
+ /* @__PURE__ */ jsx62("p", { className: "pc-erasure-modal-purposes-label", children: t("revokeConsentModalPurposesLabel") }),
20855
+ selectedErasurePurposeList.length > 0 ? /* @__PURE__ */ jsxs40(Fragment11, { children: [
20856
+ selectedErasurePurposeList.slice(0, MAX_DISPLAYED_PURPOSE_NAMES_IN_ERASURE_MODAL).map((name) => /* @__PURE__ */ jsx62("div", { className: "pc-erasure-modal-purpose-item", children: name }, name)),
20857
+ selectedErasurePurposeList.length > MAX_DISPLAYED_PURPOSE_NAMES_IN_ERASURE_MODAL && /* @__PURE__ */ jsx62("span", { className: "pc-erasure-modal-purposes-placeholder", children: t("revokeConsentModalAndMore", {
20858
+ count: selectedErasurePurposeList.length - MAX_DISPLAYED_PURPOSE_NAMES_IN_ERASURE_MODAL
20859
+ }) })
20860
+ ] }) : /* @__PURE__ */ jsx62("span", { className: "pc-erasure-modal-purposes-placeholder", children: t("revokeConsentModalYourPurposes") })
20861
+ ] }),
20862
+ /* @__PURE__ */ jsx62("div", { className: "pc-erasure-modal-warning", children: /* @__PURE__ */ jsxs40("p", { className: "pc-erasure-modal-warning-text", children: [
20863
+ /* @__PURE__ */ jsx62("span", { className: "pc-erasure-modal-warning-label", children: t("revokeConsentModalIfYesLabel") }),
20864
+ " ",
20865
+ t("revokeConsentModalIfYesBody")
20866
+ ] }) })
20786
20867
  ] })
20787
20868
  }
20788
20869
  )
20789
- ] }) }) });
20870
+ ] });
20790
20871
  }
20791
20872
 
20792
20873
  // src/RedactoPrivacyCenter/components/CaseHistory.tsx