@embedreach/components 0.2.33 → 0.2.37

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.
@@ -36250,7 +36250,18 @@ const customAutomationOverridesReducer = (state, action) => {
36250
36250
  ...state,
36251
36251
  hideSales: action.payload
36252
36252
  };
36253
+ case "SET_FROM_NAME_SETTINGS_TEXT":
36254
+ return {
36255
+ ...state,
36256
+ fromNameSettingsText: action.payload
36257
+ };
36258
+ case "SET_FROM_NAME_SETTINGS_LINK":
36259
+ return {
36260
+ ...state,
36261
+ fromNameSettingsLink: action.payload
36262
+ };
36253
36263
  default:
36264
+ console.warn(`Unknown action type: ${action}`);
36254
36265
  return state;
36255
36266
  }
36256
36267
  };
@@ -62749,9 +62760,7 @@ const getSmsChannelSenders = (args) => {
62749
62760
  smsApplication: null
62750
62761
  };
62751
62762
  });
62752
- return toReturn.filter(
62753
- (item) => item.smsApplication !== null && item.smsApplication !== void 0
62754
- );
62763
+ return toReturn;
62755
62764
  };
62756
62765
  function toDate$1(argument) {
62757
62766
  const argStr = Object.prototype.toString.call(argument);
@@ -71631,7 +71640,7 @@ const SMSPreview = ({ mergeFieldsResponse }) => {
71631
71640
  const handleAddImage = () => {
71632
71641
  fileInputRef.current?.click();
71633
71642
  };
71634
- if (!channelAccounts || !channelSenders || isMeLoading) {
71643
+ if (!channelAccounts || !channelSenders || isMeLoading || smsChannelSenders === void 0 || smsApplication === void 0) {
71635
71644
  return /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(BasicLoader, { text: ["Loading..."] }) });
71636
71645
  }
71637
71646
  if (smsChannelSenders?.length === 0 && smsApplication?.status !== SmsRegistrationApplicationStatus.PENDING) {
@@ -73048,7 +73057,11 @@ const SelectEmailOrSMS = ({
73048
73057
  return /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
73049
73058
  /* @__PURE__ */ jsxs("div", { children: [
73050
73059
  /* @__PURE__ */ jsx("h3", { className: "text-xl font-medium text-foreground", children: "Message Types" }),
73051
- /* @__PURE__ */ jsx("p", { className: "text-muted-foreground mb-2 text-sm", children: "Select the channels you want to use in this automation" })
73060
+ /* @__PURE__ */ jsxs("p", { className: "text-muted-foreground mb-2 text-sm", children: [
73061
+ "Select the channels you want to use in this",
73062
+ " ",
73063
+ automationType === AutomationTriggerType.ONE_TIME ? t$1("engage:broadcast").toLowerCase() : t$1("engage:automation").toLowerCase()
73064
+ ] })
73052
73065
  ] }),
73053
73066
  /* @__PURE__ */ jsx("div", { className: "w-full grid grid-cols-2 gap-3", children: channelOptions.map((option) => /* @__PURE__ */ jsxs(
73054
73067
  Root$4,
@@ -73218,7 +73231,7 @@ const EditCampaignContent = ({
73218
73231
  }),
73219
73232
  [channelSenders?.results, channelAccounts?.results]
73220
73233
  );
73221
- const smsChannelSenders = useCallback(
73234
+ const smsChannelSenders = useMemo(
73222
73235
  () => getSmsChannelSenders({
73223
73236
  channelSenders: channelSenders?.results ?? [],
73224
73237
  channelAccounts: channelAccounts?.results ?? [],
@@ -81845,7 +81858,7 @@ const getAutomationSteps = ({
81845
81858
  step: 5,
81846
81859
  isValid: () => {
81847
81860
  return Boolean(
81848
- automation2.triggerMetadata?.triggerType === AutomationTriggerType.ONE_TIME && automation2.triggerMetadata?.scheduledAt && new Date(automation2.triggerMetadata.scheduledAt) > /* @__PURE__ */ new Date() && automation2.actionData?.some(
81861
+ automation2.triggerMetadata?.triggerType === AutomationTriggerType.ONE_TIME && automation2.triggerMetadata?.scheduledAt && (automation2.triggerMetadata.scheduledAt === "now" || automation2.triggerMetadata.scheduledAt !== "now" && new Date(automation2.triggerMetadata.scheduledAt) > /* @__PURE__ */ new Date()) && automation2.actionData?.some(
81849
81862
  (action) => action.actionType === "send_communication" && action.actionMetadata.communicationGroupId
81850
81863
  )
81851
81864
  );
@@ -81876,7 +81889,7 @@ const getAutomationSteps = ({
81876
81889
  * We can send if its at least 3 minutes from now
81877
81890
  * (ideally it'll be 5 mins if its 'send now' button)
81878
81891
  */
81879
- new Date(automation2.triggerMetadata.scheduledAt) > new Date(Date.now() + 3 * 60 * 1e3) && automation2.actionData?.some(
81892
+ (automation2.triggerMetadata.scheduledAt === "now" || automation2.triggerMetadata.scheduledAt !== "now" && new Date(automation2.triggerMetadata.scheduledAt) > new Date(Date.now() + 3 * 60 * 1e3)) && automation2.actionData?.some(
81880
81893
  (action) => action.actionType === "send_communication" && action.actionMetadata.communicationGroupId
81881
81894
  )
81882
81895
  );
@@ -82066,7 +82079,7 @@ const validateAutomationStep = async (args) => {
82066
82079
  };
82067
82080
  }
82068
82081
  const hasValidSchedule = Boolean(
82069
- automation2.triggerMetadata?.scheduledAt && new Date(automation2.triggerMetadata.scheduledAt) > /* @__PURE__ */ new Date()
82082
+ automation2.triggerMetadata?.scheduledAt && (automation2.triggerMetadata.scheduledAt === "now" || automation2.triggerMetadata.scheduledAt !== "now" && new Date(automation2.triggerMetadata.scheduledAt) > /* @__PURE__ */ new Date())
82070
82083
  );
82071
82084
  if (!hasValidSchedule) {
82072
82085
  return {
@@ -82088,11 +82101,11 @@ const validateAutomationStep = async (args) => {
82088
82101
  const oneTimeMetadata = automation2.triggerMetadata;
82089
82102
  return {
82090
82103
  canMove: Boolean(
82091
- oneTimeMetadata.scheduledAt && new Date(oneTimeMetadata.scheduledAt) > /* @__PURE__ */ new Date() && automation2.actionData?.some(
82104
+ oneTimeMetadata.scheduledAt && (oneTimeMetadata.scheduledAt === "now" || new Date(oneTimeMetadata.scheduledAt) > /* @__PURE__ */ new Date()) && automation2.actionData?.some(
82092
82105
  (action) => action.actionType === "send_communication" && action.actionMetadata.communicationGroupId
82093
82106
  )
82094
82107
  ),
82095
- errorMessage: `Please ensure you have set a valid future date for your ${t$1("engage:broadcast")} automation`
82108
+ errorMessage: `Please ensure you have set a valid future date for your ${t$1("engage:broadcast")}`
82096
82109
  };
82097
82110
  }
82098
82111
  case AutomationSteps.PreviewAndSend: {
@@ -85781,7 +85794,7 @@ const AutomationsEditorHeader = ({ showBackButton, onDuplicationCreated, onBefor
85781
85794
  }
85782
85795
  if (!isActive) {
85783
85796
  let sendText = "Schedule Send";
85784
- if (automation2.triggerMetadata.triggerType === AutomationTriggerType.ONE_TIME && automation2.triggerMetadata.scheduledAt && new Date(automation2.triggerMetadata.scheduledAt) < new Date(Date.now() + 5 * 60 * 1e3)) {
85797
+ if (automation2.triggerMetadata.triggerType === AutomationTriggerType.ONE_TIME && automation2.triggerMetadata.scheduledAt && (automation2.triggerMetadata.scheduledAt === "now" || automation2.triggerMetadata.scheduledAt !== "now" && new Date(automation2.triggerMetadata.scheduledAt) < new Date(Date.now() + 5 * 60 * 1e3))) {
85785
85798
  sendText = "Send Now";
85786
85799
  }
85787
85800
  return /* @__PURE__ */ jsx(