{"version":3,"file":"SubscriptionButton.BOVYCS56.mjs","names":["forwardRef","titleText","title","container","wrapper","DIALOG_ID","useState","container","title","useRef","useRef","useMemo","isIos","useCallback"],"sources":["https:/asset.29cm.co.kr/contents/framer/components/@shared/SwitchButton/SwitchButton.js","https:/asset.29cm.co.kr/contents/framer/hooks/fetchers/useFetchAgreements.js","https:/asset.29cm.co.kr/contents/framer/components/@shared/toasts/NotificationAgreementsToast/NotificationAgreementsToast.js","https:/asset.29cm.co.kr/contents/framer/components/@shared/toasts/NotificationAgreementsToast/NotificationAgreementsToast.hooks.js","https:/asset.29cm.co.kr/contents/framer/components/@shared/icons/CloseIcon.js","https:/asset.29cm.co.kr/contents/framer/components/@shared/dialogs/PrivacyAgreementDetailDialog/PrivacyAgreementDetailDialog.js","https:/asset.29cm.co.kr/contents/framer/components/@shared/dialogs/PrivacyAgreementDetailDialog/PrivacyAgreementDetailDialog.hooks.js","https:/asset.29cm.co.kr/contents/framer/components/@shared/bottom-sheets/NotificationAgreementsBottomSheet/NotificationAgreementsBottomSheet.js","https:/asset.29cm.co.kr/contents/framer/components/@shared/bottom-sheets/NotificationAgreementsBottomSheet/NotificationAgreementsBottomSheet.hooks.js","https:/asset.29cm.co.kr/contents/framer/hooks/useAppNotificationState.js","https:/asset.29cm.co.kr/contents/framer/hooks/useMarketingPushNotification.js","https:/asset.29cm.co.kr/contents/framer/hooks/mutations/usePostAgreementsMutation.js","https:/asset.29cm.co.kr/contents/framer/hooks/fetchers/useFetchNotfiicationPermission.js","https:/asset.29cm.co.kr/contents/framer/hooks/useNotificationRequirements.js","https:/asset.29cm.co.kr/contents/framer/hooks/fetchers/useFetchSubscriptions.js","https:/asset.29cm.co.kr/contents/framer/hooks/useRequestSubscription.js","https:/asset.29cm.co.kr/contents/framer/components/@shared/dialogs/AppLinkDialog/AppLinkDialog.js","https:/asset.29cm.co.kr/contents/framer/components/@shared/dialogs/AppLinkDialog/AppLinkDialog.hooks.js","https:/asset.29cm.co.kr/contents/framer/hooks/useWithApp.js","https:/asset.29cm.co.kr/contents/framer/node_modules/lodash-es/throttle.js","https:/asset.29cm.co.kr/contents/framer/components/systems/curations/SubscriptionButton/SubscriptionButton.hooks.js","https:/asset.29cm.co.kr/contents/framer/components/systems/curations/SubscriptionButton/SubscriptionButton.js"],"sourcesContent":["import { jsxs, jsx } from \"react/jsx-runtime\";\nimport { forwardRef } from \"react\";\nimport \"framer\";\nimport { typography } from \"../../../styles/typography.js\";\nimport { playHaptic } from \"../../../utils/playHaptic.js\";\nconst SwitchButton = forwardRef(({\n  children,\n  style,\n  theme = \"light\",\n  active = false,\n  activeColor,\n  onClick,\n  ...rest\n}) => {\n  const {\n    button,\n    thumb\n  } = getSwitchButtonColors(activeColor)[theme][active ? \"active\" : \"default\"];\n  const handleClick = (e) => {\n    playHaptic(\"rigid\");\n    onClick == null ? void 0 : onClick(e);\n  };\n  return /* @__PURE__ */ jsxs(\"div\", { style: {\n    ...containerStyle,\n    ...style\n  }, ...rest, onClick: handleClick, children: [\n    children ? /* @__PURE__ */ jsx(\"div\", { style: {\n      ...labelStyle,\n      ...labelStyleByTheme[theme]\n    }, children }) : null,\n    /* @__PURE__ */ jsx(\"div\", { style: {\n      ...buttonStyle,\n      backgroundColor: button\n    }, children: /* @__PURE__ */ jsx(\"div\", { style: {\n      ...thumbStyle,\n      backgroundColor: thumb,\n      left: active ? 18 : 2\n    } }) })\n  ] });\n});\nconst getSwitchButtonColors = (activeColor) => ({\n  light: {\n    default: {\n      button: \"#E4E4E4\",\n      thumb: \"#FFFFFF\"\n    },\n    active: {\n      button: activeColor || \"#1E3CF2\",\n      thumb: \"#FFFFFF\"\n    }\n  },\n  dark: {\n    default: {\n      button: \"#27272A\",\n      thumb: \"#A0A0A0\"\n    },\n    active: {\n      button: activeColor || \"#1E3CF2\",\n      thumb: \"#FFFFFF\"\n    }\n  }\n});\nconst containerStyle = {\n  display: \"flex\",\n  alignItems: \"center\",\n  cursor: \"pointer\"\n};\nconst labelStyle = {\n  ...typography(15, 400),\n  paddingRight: 8\n};\nconst labelStyleByTheme = {\n  light: {\n    color: \"#000000\"\n  },\n  dark: {\n    color: \"#A0A0A0\"\n  }\n};\nconst buttonStyle = {\n  position: \"relative\",\n  width: 38,\n  height: 22,\n  padding: 2,\n  borderRadius: 999,\n  transition: \"background-color 0.15s ease-in-out\"\n};\nconst thumbStyle = {\n  position: \"absolute\",\n  top: \"50%\",\n  transform: \"translateY(-50%)\",\n  width: 18,\n  height: 18,\n  borderRadius: 999,\n  transition: \"background-color 0.15s ease-in-out, left 0.15s ease-in-out\"\n};\nexport {\n  SwitchButton\n};\n","import useSWR from \"../../node_modules/swr/core/dist/index.js\";\nimport { userApi } from \"../../apis/user/UserApiService.js\";\nimport \"react\";\nimport \"../../node_modules/@firebase/analytics/dist/esm/index.esm2017.js\";\nimport \"../../node_modules/firebase/app/dist/esm/index.esm.js\";\nimport { useCurrentUser } from \"../useCurrentUser.js\";\nimport \"framer\";\nimport \"../../node_modules/@29cm/snowplow/dist/esm/core/snowplow.js\";\nimport \"../../apis/user-segment/CategoryFirstOrderApiService.js\";\nimport \"../../config/index.js\";\nimport \"../../node_modules/vite-plugin-node-polyfills/shims/buffer/dist/index.js\";\nimport \"../../node_modules/js-cookie/dist/js.cookie.js\";\nimport \"../../apis/preuser/PreuserApiService.js\";\nimport \"../../node_modules/swr/mutation/dist/index.js\";\nimport \"../stores/content/content.store.js\";\nimport \"../stores/dialog/dialog.store.js\";\nimport \"../stores/global-layout/global-layout.store.js\";\nimport \"../stores/toast/toast.store.js\";\nimport \"../../components/@shared/providers/ThemeProvider/ThemeProvider.js\";\nimport \"../../components/@shared/providers/BreakpointProvider/BreakpointProvider.js\";\nimport \"../stores/bottom-sheet/bottom-sheet.store.js\";\nimport \"react/jsx-runtime\";\nimport \"react-dom\";\nimport \"../../components/systems/Dialog/Dialog.module.css.js\";\nimport \"framer-motion\";\nimport \"../../containers/DialogContainer/DialogContainer.emitter.js\";\nimport \"../../utils/redirectLogin.js\";\nimport \"../../utils/event-properties/source.js\";\nconst AGREEMENTS_FETCHER_KEY = \"@user/agreements\";\nconst useFetchAgreements = () => {\n  const {\n    logged\n  } = useCurrentUser();\n  return useSWR(logged ? [AGREEMENTS_FETCHER_KEY] : null, () => userApi.getAgreements());\n};\nexport {\n  AGREEMENTS_FETCHER_KEY,\n  useFetchAgreements\n};\n","import { jsxs, jsx } from \"react/jsx-runtime\";\nimport _JSXStyle from \"../../../../node_modules/styled-jsx/style.js\";\nimport { useFetchAgreements } from \"../../../../hooks/fetchers/useFetchAgreements.js\";\nimport { formatDate as format } from \"../../../../node_modules/date-fns/format.js\";\nconst NotificationAgreementsToast = ({\n  title,\n  hideDescription = false\n}) => {\n  const {\n    data: response\n  } = useFetchAgreements();\n  const {\n    pushAdvertisingAgreement = false\n  } = (response == null ? void 0 : response.data) ?? {};\n  const formattedNow = format(/* @__PURE__ */ new Date(), \"yy.MM.dd\");\n  const shouldRenderDescription = !hideDescription && pushAdvertisingAgreement;\n  return /* @__PURE__ */ jsxs(\"div\", { children: [\n    /* @__PURE__ */ jsx(\"p\", { className: titleText.className, children: title ?? \"알림 설정이 완료되었습니다.\" }),\n    shouldRenderDescription ? /* @__PURE__ */ jsx(\"p\", { className: descriptionText.className, children: `${formattedNow} 마케팅 수신 동의 완료 / 거부 : MY > 회원정보 수정 / 전송자 : 29CM ((주)무신사)` }) : null,\n    titleText.styles,\n    descriptionText.styles\n  ] });\n};\nconst descriptionText = {\n  styles: /* @__PURE__ */ jsx(_JSXStyle, { id: \"112177068\", children: [\"p.jsx-112177068{margin-top:4px;font-size:12px;font-weight:400;line-height:136%;color:#a0a0a0;}\"] }),\n  className: \"jsx-112177068\"\n};\nconst titleText = {\n  styles: /* @__PURE__ */ jsx(_JSXStyle, { id: \"3358454669\", children: [\"p.jsx-3358454669{font-size:14px;font-weight:400;line-height:140%;color:#fff;}\"] }),\n  className: \"jsx-3358454669\"\n};\nexport {\n  NotificationAgreementsToast\n};\n","import { jsx } from \"react/jsx-runtime\";\nimport { useToast } from \"../../../../hooks/useToast.js\";\nimport { NotificationAgreementsToast } from \"./NotificationAgreementsToast.js\";\nconst useNotificationAgreementsToast = () => {\n  const toast = useToast();\n  const show = (title, hideDescription) => {\n    toast.show({\n      content: /* @__PURE__ */ jsx(NotificationAgreementsToast, { title, hideDescription })\n    });\n  };\n  return {\n    show,\n    hide: toast.hide\n  };\n};\nexport {\n  useNotificationAgreementsToast\n};\n","import { jsx } from \"react/jsx-runtime\";\nconst CloseIcon = ({\n  className\n}) => {\n  return /* @__PURE__ */ jsx(\"svg\", { className, style: {\n    width: \"20px\",\n    height: \"20px\"\n  }, xmlns: \"http://www.w3.org/2000/svg\", viewBox: \"0 0 84 82\", children: /* @__PURE__ */ jsx(\"g\", { fill: \"none\", fillRule: \"evenodd\", stroke: \"#000000\", strokeWidth: 4, strokeLinecap: \"square\", children: /* @__PURE__ */ jsx(\"path\", { d: \"M82.655.345L1.156 81.844M82.655 81.655L1.156.156\" }) }) });\n};\nexport {\n  CloseIcon\n};\n","import { jsxs, jsx } from \"react/jsx-runtime\";\nimport _JSXStyle from \"../../../../node_modules/styled-jsx/style.js\";\nimport { CloseIcon } from \"../../icons/CloseIcon.js\";\nconst PrivacyAgreementDetailDialog = ({\n  onClose\n}) => {\n  return /* @__PURE__ */ jsxs(\"div\", { className: container.className, children: [\n    /* @__PURE__ */ jsx(\"button\", { type: \"button\", className: closeButton.className, onClick: onClose, children: /* @__PURE__ */ jsx(CloseIcon, {}) }),\n    /* @__PURE__ */ jsxs(\"dl\", { children: [\n      /* @__PURE__ */ jsx(\"dt\", { className: title.className, children: \"(선택) 개인정보 수집 및 이용 동의\" }),\n      /* @__PURE__ */ jsx(\"dd\", { children: /* @__PURE__ */ jsx(\"div\", { className: wrapper.className, children: /* @__PURE__ */ jsxs(\"article\", { className: article.className, children: [\n        /* @__PURE__ */ jsx(\"p\", { className: paragraph.className, children: \"(주)무신사(29CM)는 아래의 목적으로 개인정보를 수집 및 이용하며, 회원의 개인정보를 안전하게 처리하는데 최선을 다하고 있습니다. 아래의 내용을 확인 후 동의하여 주시기 바랍니다.\" }),\n        /* @__PURE__ */ jsx(\"h2\", { className: subtitle.className, children: \"1. 수집 및 이용 목적\" }),\n        /* @__PURE__ */ jsxs(\"ul\", { className: list.className, children: [\n          /* @__PURE__ */ jsx(\"li\", { className: highlightedItem.className, children: \"개인 맞춤형 상품·서비스 혜택 정보 제공\" }),\n          /* @__PURE__ */ jsx(\"li\", { className: highlightedItem.className, children: \"이벤트 및 광고성 정보 제공 및 참여 기회 제공\" }),\n          /* @__PURE__ */ jsx(\"li\", { className: item.className, children: \"상품·서비스 이용 실적 정보 통계·분석을 통한 신규 서비스(제품) 개발\" })\n        ] }),\n        /* @__PURE__ */ jsx(\"h2\", { className: subtitle.className, children: \"2. 수집 및 이용 항목\" }),\n        /* @__PURE__ */ jsxs(\"ul\", { className: list.className, children: [\n          /* @__PURE__ */ jsx(\"li\", { className: item.className, children: \"회원 정보(이름, 휴대폰 번호, 이메일, 성별, 생년월일, 회원등급, 가입일시)\" }),\n          /* @__PURE__ */ jsx(\"li\", { className: item.className, children: \"쇼핑 및 서비스 이용 정보(장바구니의 상품, 구매일시, 배송지역)\" })\n        ] }),\n        /* @__PURE__ */ jsx(\"h2\", { className: subtitle.className, children: \"3. 보유 및 이용기간\" }),\n        /* @__PURE__ */ jsxs(\"ul\", { className: list.className, children: [\n          /* @__PURE__ */ jsx(\"li\", { className: highlightedItem.className, children: \"회원 탈퇴 요청 시 또는 동의 철회 시 지체 없이 파기합니다.\" }),\n          /* @__PURE__ */ jsx(\"li\", { className: highlightedItem.className, children: \"단, 관계 법령에 따라 일정 기간 보존해야 하는 경우 해당 기간 보관 후 파기합니다.\" })\n        ] }),\n        /* @__PURE__ */ jsx(\"br\", {}),\n        \"선택적인 개인정보 수집 및 이용에 동의하지 않을 권리가 있습니다. 동의하지 않아도 서비스 이용이 가능합니다. 다만, 동의하지 않을 경우 관련 할인 정보, 이벤트 등의 혜택 정보 제공이 제한됩니다.\"\n      ] }) }) })\n    ] }),\n    container.styles,\n    closeButton.styles,\n    title.styles,\n    wrapper.styles,\n    article.styles,\n    subtitle.styles,\n    paragraph.styles,\n    highlightedItem.styles,\n    item.styles,\n    list.styles\n  ] });\n};\nconst container = {\n  styles: /* @__PURE__ */ jsx(_JSXStyle, { id: \"4193539139\", children: [\"div.jsx-4193539139{width:100%;padding:10px 8px;text-align:left;word-break:break-word;}\"] }),\n  className: \"jsx-4193539139\"\n};\nconst closeButton = {\n  styles: /* @__PURE__ */ jsx(_JSXStyle, { id: \"3873915725\", children: [\"button.jsx-3873915725{position:absolute;top:0;right:0;width:60px;height:60px;outline:none;border:none;background-color:transparent;}\"] }),\n  className: \"jsx-3873915725\"\n};\nconst title = {\n  styles: /* @__PURE__ */ jsx(_JSXStyle, { id: \"3876639978\", children: [\"dt.jsx-3876639978{padding-bottom:11px;font-size:20px;font-weight:bold;border-bottom:4px solid #000;}\"] }),\n  className: \"jsx-3876639978\"\n};\nconst article = {\n  styles: /* @__PURE__ */ jsx(_JSXStyle, { id: \"2551450005\", children: [\"article.jsx-2551450005{padding:5px 0;font-size:13px;line-height:24px;}\"] }),\n  className: \"jsx-2551450005\"\n};\nconst wrapper = {\n  styles: /* @__PURE__ */ jsx(_JSXStyle, { id: \"3570035704\", children: [\"div.jsx-3570035704{position:absolute;inset:110px 0 22px 20px;height:auto;overflow-y:scroll;margin-top:15px;padding-right:30px;}\"] }),\n  className: \"jsx-3570035704\"\n};\nconst subtitle = {\n  styles: /* @__PURE__ */ jsx(_JSXStyle, { id: \"1444760618\", children: [\"h2.jsx-1444760618{margin:20px 0 5px;font-size:16px;}\"] }),\n  className: \"jsx-1444760618\"\n};\nconst list = {\n  styles: /* @__PURE__ */ jsx(_JSXStyle, { id: \"57726673\", children: [\"ul.jsx-57726673{margin:0;padding:0;}\"] }),\n  className: \"jsx-57726673\"\n};\nconst item = {\n  styles: /* @__PURE__ */ jsx(_JSXStyle, { id: \"1482811883\", children: [\"li.jsx-1482811883{margin-left:20px;list-style-type:disc;}\"] }),\n  className: \"jsx-1482811883\"\n};\nconst highlightedItem = {\n  styles: /* @__PURE__ */ jsx(_JSXStyle, { id: \"4100544401\", children: [\"li.jsx-4100544401{margin-left:20px;font-size:15px;font-weight:bold;-webkit-text-decoration:underline;text-decoration:underline;list-style-type:disc;}\"] }),\n  className: \"jsx-4100544401\"\n};\nconst paragraph = {\n  styles: /* @__PURE__ */ jsx(_JSXStyle, { id: \"3509134407\", children: [\"p.jsx-3509134407{padding-bottom:10px;}\"] }),\n  className: \"jsx-3509134407\"\n};\nexport {\n  PrivacyAgreementDetailDialog\n};\n","import { jsx } from \"react/jsx-runtime\";\nimport { useDialog } from \"../../../../hooks/useDialog.js\";\nimport { PrivacyAgreementDetailDialog } from \"./PrivacyAgreementDetailDialog.js\";\nconst DIALOG_ID = \"privacy-agreement-detail-dialog-id\";\nconst usePrivacyAgreementDetailDialog = () => {\n  const dialog = useDialog();\n  const show = () => {\n    dialog.show({\n      id: DIALOG_ID,\n      responsiveFullSize: true,\n      hideButtons: true,\n      content: /* @__PURE__ */ jsx(PrivacyAgreementDetailDialog, { onClose: hide }),\n      needInAppLayer: false\n    });\n  };\n  const hide = () => {\n    dialog.hide(DIALOG_ID, false);\n  };\n  return {\n    show,\n    hide\n  };\n};\nexport {\n  usePrivacyAgreementDetailDialog\n};\n","import { jsxs, jsx } from \"react/jsx-runtime\";\nimport _JSXStyle from \"../../../../node_modules/styled-jsx/style.js\";\nimport { useState } from \"react\";\nimport { Button as Default } from \"../../Button/Button.js\";\nimport { Checkbox } from \"../../checkbox/Checkbox.js\";\nimport { usePrivacyAgreementDetailDialog } from \"../../dialogs/PrivacyAgreementDetailDialog/PrivacyAgreementDetailDialog.hooks.js\";\nconst NotificationAgreementsBottomSheet = ({\n  title = \"알림을 받으려면\\n동의가 필요해요\",\n  buttonText = \"동의하고 알림 받기\",\n  privacyAgreement,\n  pushAdvertisingAgreement,\n  onSubmit,\n  onCancel\n}) => {\n  const dialog = usePrivacyAgreementDetailDialog();\n  const [isPrivacyAgreementAgreed, setIsPrivacyAgreementAgreed] = useState(privacyAgreement);\n  const [isPushAdvertisingAgreementAgreed, setIsPushAdvertisingAgreementAgreed] = useState(pushAdvertisingAgreement);\n  const canSubmit = isPrivacyAgreementAgreed && isPushAdvertisingAgreementAgreed;\n  const handleClick = () => dialog.show();\n  return /* @__PURE__ */ jsxs(\"div\", { className: container.className, children: [\n    /* @__PURE__ */ jsxs(\"div\", { className: wrapper.className, children: [\n      /* @__PURE__ */ jsx(\"span\", { className: titleText.className, children: title }),\n      /* @__PURE__ */ jsx(\"span\", { className: hr.className }),\n      privacyAgreement ? null : /* @__PURE__ */ jsxs(\"div\", { className: row.className, children: [\n        /* @__PURE__ */ jsx(Checkbox, { checked: isPrivacyAgreementAgreed, onChange: setIsPrivacyAgreementAgreed, children: \"마케팅 목적의 개인정보 수집 및 이용 동의\" }),\n        /* @__PURE__ */ jsx(\"button\", { className: detailButton.className, onClick: handleClick, children: \"자세히\" })\n      ] }),\n      pushAdvertisingAgreement ? null : /* @__PURE__ */ jsx(\"div\", { className: row.className, children: /* @__PURE__ */ jsx(Checkbox, { checked: isPushAdvertisingAgreementAgreed, onChange: setIsPushAdvertisingAgreementAgreed, children: \"광고성 정보 수신 동의\" }) }),\n      /* @__PURE__ */ jsxs(\"div\", { className: buttons.className, children: [\n        /* @__PURE__ */ jsx(Default, { variant: \"primary\", fill: true, disabled: !canSubmit, onClick: onSubmit, children: buttonText }),\n        /* @__PURE__ */ jsx(\"button\", { className: cancelButton.className, onClick: onCancel, children: \"다음에\" })\n      ] })\n    ] }),\n    titleText.styles,\n    detailButton.styles,\n    cancelButton.styles,\n    buttons.styles,\n    row.styles,\n    hr.styles,\n    container.styles,\n    wrapper.styles\n  ] });\n};\nconst container = {\n  styles: /* @__PURE__ */ jsx(_JSXStyle, { id: \"130359274\", children: [\"div.jsx-130359274{background-color:#fff;}\"] }),\n  className: \"jsx-130359274\"\n};\nconst wrapper = {\n  styles: /* @__PURE__ */ jsx(_JSXStyle, { id: \"2833505254\", children: [\"div.jsx-2833505254{padding:30px 20px 20px;text-align:left;}\"] }),\n  className: \"jsx-2833505254\"\n};\nconst hr = {\n  styles: /* @__PURE__ */ jsx(_JSXStyle, { id: \"2753252006\", children: [\"span.jsx-2753252006{display:block;width:100%;height:1px;margin:24px 0;background-color:#e4e4e4;}\"] }),\n  className: \"jsx-2753252006\"\n};\nconst row = {\n  styles: /* @__PURE__ */ jsx(_JSXStyle, { id: \"2027943628\", children: [\"div.jsx-2027943628{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;gap:6px;}\", \"div.jsx-2027943628+div.jsx-2027943628{margin-top:10px;}\"] }),\n  className: \"jsx-2027943628\"\n};\nconst buttons = {\n  styles: /* @__PURE__ */ jsx(_JSXStyle, { id: \"3286403566\", children: [\"div.jsx-3286403566{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;gap:12px;margin-top:26px;}\"] }),\n  className: \"jsx-3286403566\"\n};\nconst cancelButton = {\n  styles: /* @__PURE__ */ jsx(_JSXStyle, { id: \"642015552\", children: [\"button.jsx-642015552{position:relative;display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;cursor:pointer;margin:0;padding:0;background:none;outline:none;border:none;font-weight:700;font-size:14px;color:#474747;}\"] }),\n  className: \"jsx-642015552\"\n};\nconst detailButton = {\n  styles: /* @__PURE__ */ jsx(_JSXStyle, { id: \"2879314183\", children: [\"button.jsx-2879314183{position:relative;display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;cursor:pointer;margin:0;padding:0;background:none;border:none;outline:none;border-bottom:1px solid;border-color:#474747;font-weight:500;font-size:14px;color:#474747;line-height:140%;}\"] }),\n  className: \"jsx-2879314183\"\n};\nconst titleText = {\n  styles: /* @__PURE__ */ jsx(_JSXStyle, { id: \"249968650\", children: [\"span.jsx-249968650{font-weight:700;font-size:24px;line-height:136%;white-space:pre-line;color:#000;}\"] }),\n  className: \"jsx-249968650\"\n};\nexport {\n  NotificationAgreementsBottomSheet\n};\n","import { jsx } from \"react/jsx-runtime\";\nimport { useBottomSheet } from \"../../../../hooks/useBottomSheet.js\";\nimport { NotificationAgreementsBottomSheet } from \"./NotificationAgreementsBottomSheet.js\";\nconst useNotificationAgreementsBottomSheet = () => {\n  const bottomSheet = useBottomSheet();\n  const show = ({\n    onCancel,\n    ...props\n  }) => {\n    const handleCancel = () => {\n      onCancel();\n      bottomSheet.hide();\n    };\n    bottomSheet.show({\n      content: /* @__PURE__ */ jsx(NotificationAgreementsBottomSheet, { ...props, onCancel: handleCancel }),\n      draggable: false,\n      closeOnOverlayClick: false,\n      detent: \"content-height\"\n    });\n  };\n  return {\n    show,\n    hide: bottomSheet.hide\n  };\n};\nexport {\n  useNotificationAgreementsBottomSheet\n};\n","import { useRef } from \"react\";\nimport { getAppBuildNumber, isIos } from \"../utils/device.js\";\nimport { useReceiveMessage } from \"./useReceiveMessage.js\";\nimport { postMessage } from \"../utils/postMessage.js\";\nconst APP_CRASH_FIX_IOS_BUILD_NUMBER = 719;\nconst REQUEST_TYPE = \"fetchAppNotificationState\";\nconst useAppNotificationState = () => {\n  const callbackFunction = useRef();\n  const isLoading = useRef(false);\n  const isAvailableIosBuildNumber = () => {\n    const buildNumber = getAppBuildNumber();\n    const isAdhocVersion = isIos() && Number.isNaN(buildNumber);\n    if (isAdhocVersion) {\n      return true;\n    }\n    if (!isIos()) {\n      return true;\n    }\n    if (buildNumber < APP_CRASH_FIX_IOS_BUILD_NUMBER) {\n      return false;\n    }\n    return true;\n  };\n  const fetchNotificationState = () => {\n    return new Promise((resolve, reject) => {\n      if (!isAvailableIosBuildNumber()) {\n        reject(\"UNAVAILABLE_IOS_BUILD_NUMBER\");\n      }\n      callbackFunction.current = (...args) => resolve(...args);\n      postMessage(REQUEST_TYPE, {});\n      isLoading.current = true;\n    });\n  };\n  useReceiveMessage(REQUEST_TYPE, (payload) => {\n    if (!isLoading.current || !callbackFunction.current || !payload) {\n      return;\n    }\n    callbackFunction.current(payload.result);\n    callbackFunction.current = void 0;\n    isLoading.current = false;\n  });\n  return {\n    fetchNotificationState\n  };\n};\nexport {\n  useAppNotificationState\n};\n","import { useRef, useMemo } from \"react\";\nimport { useFetchAgreements } from \"./fetchers/useFetchAgreements.js\";\nimport { postMessage } from \"../utils/postMessage.js\";\nimport { useReceiveMessage } from \"./useReceiveMessage.js\";\nimport { useDeviceInfo } from \"./useDeviceInfo.js\";\nconst IOS_REQUEST_TYPE = \"fetchNotificationState\";\nconst ANDROID_REQUEST_TYPE = \"requestMarketingPushNotification\";\nconst useMarketingPushNotification = () => {\n  const callbackFunction = useRef();\n  const {\n    data: response\n  } = useFetchAgreements();\n  const {\n    isIos\n  } = useDeviceInfo();\n  const agreements = response == null ? void 0 : response.data;\n  const privacyAgreementAlreadyAgreed = useMemo(() => {\n    if (!agreements) {\n      return false;\n    }\n    return agreements.privacyAgreement;\n  }, [agreements]);\n  const advertisingAgreementAlreadyAgreed = useMemo(() => {\n    if (!agreements) {\n      return false;\n    }\n    const {\n      privacyAgreement: _,\n      ...advertisingAgreements\n    } = agreements;\n    return Object.values(advertisingAgreements).every((value) => value);\n  }, [agreements]);\n  const requestType = isIos ? IOS_REQUEST_TYPE : ANDROID_REQUEST_TYPE;\n  const requestMarketingPushNotification = ({\n    type,\n    params = {},\n    shouldShowMarketingPushBottomSheet,\n    marketingPushBottomSheetActivateCycle = \"noLimit\",\n    osBottomSheetTitle = \"휴대폰 알림이 꺼져 있어 알림을 받을 수 없어요\",\n    marketingBottomSheetTitle = \"\"\n  }) => {\n    return new Promise((resolve) => {\n      callbackFunction.current = (...args) => resolve(...args);\n      postMessage(requestType, {\n        type,\n        shouldShowMarketingPushBottomSheet,\n        marketingPushBottomSheetActivateCycle,\n        osBottomSheetTitle,\n        marketingBottomSheetTitle,\n        ...params\n      });\n    });\n  };\n  useReceiveMessage(requestType, ({\n    marketingPushAlreadyActivated: _,\n    ...rest\n  }) => {\n    if (!callbackFunction.current) {\n      return;\n    }\n    const payload = {\n      ...rest,\n      privacyAgreementAlreadyAgreed,\n      advertisingAgreementAlreadyAgreed\n    };\n    callbackFunction.current(payload);\n    callbackFunction.current = void 0;\n  });\n  return {\n    requestMarketingPushNotification\n  };\n};\nexport {\n  useMarketingPushNotification\n};\n","import useSWRMutation from \"../../node_modules/swr/mutation/dist/index.js\";\nimport { userApi } from \"../../apis/user/UserApiService.js\";\nconst POST_AGREEMENT_MUTATION_KEY = \"@user/post-agreement\";\nconst usePostAgreementsMutation = (params) => {\n  const {\n    onSuccess,\n    onError\n  } = params ?? {};\n  return useSWRMutation(POST_AGREEMENT_MUTATION_KEY, (_, {\n    arg\n  }) => userApi.postAgreements({\n    endpoint: arg,\n    privacyAgreement: true,\n    advertisingAgreement: true\n  }), {\n    onSuccess,\n    onError\n  });\n};\nexport {\n  POST_AGREEMENT_MUTATION_KEY,\n  usePostAgreementsMutation\n};\n","import useSWR from \"../../node_modules/swr/core/dist/index.js\";\nimport { useAppNotificationState } from \"../useAppNotificationState.js\";\nconst NOTIFICATION_PERMISSION_FETCHER_KEY = \"@notification/permission\";\nconst useFetchNotificationPermission = () => {\n  const {\n    fetchNotificationState\n  } = useAppNotificationState();\n  return useSWR([NOTIFICATION_PERMISSION_FETCHER_KEY], () => fetchNotificationState());\n};\nexport {\n  NOTIFICATION_PERMISSION_FETCHER_KEY,\n  useFetchNotificationPermission\n};\n","import { useNotificationAgreementsBottomSheet } from \"../components/@shared/bottom-sheets/NotificationAgreementsBottomSheet/NotificationAgreementsBottomSheet.hooks.js\";\nimport { useFetchAgreements } from \"./fetchers/useFetchAgreements.js\";\nimport { useAppNotificationState } from \"./useAppNotificationState.js\";\nimport { useMarketingPushNotification } from \"./useMarketingPushNotification.js\";\nimport { usePostAgreementsMutation } from \"./mutations/usePostAgreementsMutation.js\";\nimport { parseErrorMessage } from \"../utils/error/error.js\";\nimport { useNotificationAgreementsToast } from \"../components/@shared/toasts/NotificationAgreementsToast/NotificationAgreementsToast.hooks.js\";\nimport { useFetchNotificationPermission } from \"./fetchers/useFetchNotfiicationPermission.js\";\nconst useNotificationRequirements = () => {\n  const requestAgreements = useNotificationAgreements();\n  const requestPermission = useNotificationPermission();\n  const requestRequirements = async (options) => {\n    try {\n      await requestAgreements(options);\n      await requestPermission(options);\n    } catch (error) {\n      notificationRequirementsErrorHandler(error);\n    }\n  };\n  return requestRequirements;\n};\nconst notificationRequirementsErrorHandler = (error) => {\n  switch (parseErrorMessage(error)) {\n    case \"AGREEMENTS_CANCELED\":\n      return;\n    case \"NO_AGREEMENTS_DATA\":\n      return;\n    case \"UNAVAILABLE_IOS_BUILD_NUMBER\":\n      return;\n  }\n};\nconst useNotificationAgreements = () => {\n  const {\n    data: response,\n    mutate\n  } = useFetchAgreements();\n  const {\n    trigger\n  } = usePostAgreementsMutation();\n  const {\n    show,\n    hide\n  } = useNotificationAgreementsBottomSheet();\n  const agreements = response == null ? void 0 : response.data;\n  const {\n    privacyAgreement = false,\n    pushAdvertisingAgreement = false\n  } = agreements ?? {};\n  const postAgreements = (options) => {\n    const {\n      apiEndpoint,\n      onNotificationAgreementsError\n    } = options;\n    return trigger(apiEndpoint, {\n      onSuccess: () => {\n        hide();\n        mutate();\n      },\n      onError: () => {\n        hide();\n        onNotificationAgreementsError == null ? void 0 : onNotificationAgreementsError();\n      }\n    });\n  };\n  const requestAgreements = (options) => {\n    const {\n      onNotificationAgreementsSubmit,\n      onNotificationAgreementsCancel,\n      ...rest\n    } = options;\n    return new Promise((resolve, reject) => {\n      if (!agreements) {\n        reject(\n          \"NO_AGREEMENTS_DATA\"\n          /* NO_AGREEMENTS_DATA */\n        );\n        return;\n      }\n      if (privacyAgreement && pushAdvertisingAgreement) {\n        resolve(void 0);\n        return;\n      }\n      show({\n        ...rest,\n        privacyAgreement,\n        pushAdvertisingAgreement,\n        // eslint-disable-next-line @typescript-eslint/no-misused-promises\n        onSubmit: async () => {\n          await postAgreements(options);\n          resolve(void 0);\n          onNotificationAgreementsSubmit == null ? void 0 : onNotificationAgreementsSubmit(privacyAgreement, pushAdvertisingAgreement);\n        },\n        onCancel: () => {\n          reject(\n            \"AGREEMENTS_CANCELED\"\n            /* AGREEMENTS_CANCELED */\n          );\n          onNotificationAgreementsCancel == null ? void 0 : onNotificationAgreementsCancel(privacyAgreement, pushAdvertisingAgreement);\n        }\n      });\n    });\n  };\n  return requestAgreements;\n};\nconst useNotificationPermission = () => {\n  const {\n    fetchNotificationState\n  } = useAppNotificationState();\n  const {\n    mutate\n  } = useFetchNotificationPermission();\n  const {\n    requestMarketingPushNotification\n  } = useMarketingPushNotification();\n  const toast = useNotificationAgreementsToast();\n  const hasNotificationPermission = async () => await fetchNotificationState() === \"on\";\n  const requestPermission = async (options) => {\n    const {\n      osBottomSheetType = \"null\",\n      showToastOnSuccess = true,\n      toastTitle,\n      onNotificationEnabled,\n      onNotificationDisabled\n    } = options;\n    try {\n      if (await hasNotificationPermission()) {\n        if (showToastOnSuccess) {\n          toast.show(toastTitle);\n        }\n        onNotificationEnabled == null ? void 0 : onNotificationEnabled();\n        return;\n      }\n      await requestMarketingPushNotification({\n        type: osBottomSheetType\n      });\n      if (await hasNotificationPermission()) {\n        if (showToastOnSuccess) {\n          toast.show(toastTitle);\n        }\n        mutate();\n        onNotificationEnabled == null ? void 0 : onNotificationEnabled();\n      } else {\n        onNotificationDisabled == null ? void 0 : onNotificationDisabled();\n      }\n    } catch (error) {\n      throw new Error(\n        \"UNAVAILABLE_IOS_BUILD_NUMBER\"\n        /* UNAVAILABLE_IOS_BUILD_NUMBER */\n      );\n    }\n  };\n  return requestPermission;\n};\nexport {\n  useNotificationRequirements\n};\n","import useSWR from \"../../node_modules/swr/core/dist/index.js\";\nimport { subscriptionApi } from \"../../apis/subscription/SubscriptionApiService.js\";\nimport { useCurrentUser } from \"../useCurrentUser.js\";\nconst SUBSCRIPTIONS_FETCHER_KEY = \"@subscription/list\";\nconst useFetchSubscriptions = (eventKey, groupKey, enabled = true) => {\n  const {\n    logged\n  } = useCurrentUser();\n  const canFetch = groupKey !== \"\" && logged && enabled;\n  const {\n    data,\n    isLoading,\n    ...rest\n  } = useSWR(canFetch ? [SUBSCRIPTIONS_FETCHER_KEY, groupKey ? groupKey : eventKey] : null, () => groupKey ? subscriptionApi.getSubscriptionsByGroupKey(groupKey) : subscriptionApi.getSubscription(eventKey));\n  return {\n    isLoading: isLoading || !canFetch,\n    subscriptions: data ?? [],\n    ...rest\n  };\n};\nexport {\n  SUBSCRIPTIONS_FETCHER_KEY,\n  useFetchSubscriptions\n};\n","import { subscriptionApi } from \"../apis/subscription/SubscriptionApiService.js\";\nimport { useFetchSubscriptions } from \"./fetchers/useFetchSubscriptions.js\";\nimport { shallowUnique } from \"../utils/unique.js\";\nconst useRequestSubscription = (eventKey, groupKey, enabled = true) => {\n  const {\n    subscriptions,\n    mutate\n  } = useFetchSubscriptions(eventKey, groupKey, enabled);\n  const filterSubscription = (incoming) => subscriptions.filter((subscription) => subscription !== incoming);\n  const subscribeMutator = async (incoming) => {\n    const result = await subscriptionApi.subscribe(incoming);\n    return shallowUnique([...subscriptions, ...result]);\n  };\n  const unsubscribeMutator = async (incoming) => {\n    const result = await subscriptionApi.unsubscribe(incoming);\n    return filterSubscription(result);\n  };\n  const requestSubscribe = (incoming) => mutate(subscribeMutator(incoming), {\n    optimisticData: shallowUnique([...subscriptions, ...incoming]),\n    rollbackOnError: true,\n    populateCache: true,\n    revalidate: false\n  });\n  const requestUnsubscribe = (incoming) => mutate(unsubscribeMutator(incoming), {\n    optimisticData: filterSubscription(incoming),\n    rollbackOnError: true,\n    populateCache: true,\n    revalidate: false\n  });\n  return {\n    subscriptions,\n    requestSubscribe,\n    requestUnsubscribe\n  };\n};\nexport {\n  useRequestSubscription\n};\n","import { jsxs, jsx } from \"react/jsx-runtime\";\nimport _JSXStyle from \"../../../../node_modules/styled-jsx/style.js\";\nimport { QRCodeSVG } from \"../../../../node_modules/qrcode.react/lib/esm/index.js\";\nimport { useIsMobileDevice } from \"../../../../hooks/useIsMobileDevice.js\";\nconst AppLinkDialog = ({\n  content,\n  oneLink,\n  displayDesktopQRCode = true\n}) => {\n  const isMobile = useIsMobileDevice();\n  if (isMobile || !displayDesktopQRCode) {\n    return /* @__PURE__ */ jsxs(\"span\", { className: text.className, children: [\n      content,\n      text.styles\n    ] });\n  }\n  return /* @__PURE__ */ jsxs(\"div\", { className: container.className, children: [\n    /* @__PURE__ */ jsx(QRCodeSVG, { value: oneLink, size: 150, bgColor: \"#ffffff\", fgColor: \"#000000\", includeMargin: false }),\n    /* @__PURE__ */ jsx(\"span\", { className: text.className, children: content }),\n    container.styles,\n    text.styles\n  ] });\n};\nconst container = {\n  styles: /* @__PURE__ */ jsx(_JSXStyle, { id: \"2940926304\", children: [\"div.jsx-2940926304{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;gap:20px;}\"] }),\n  className: \"jsx-2940926304\"\n};\nconst text = {\n  styles: /* @__PURE__ */ jsx(_JSXStyle, { id: \"1263816186\", children: [\"span.jsx-1263816186{font-size:14px;font-weight:400;line-height:140%;color:#000;}\"] }),\n  className: \"jsx-1263816186\"\n};\nexport {\n  AppLinkDialog\n};\n","import { jsx } from \"react/jsx-runtime\";\nimport { useCreateOneLink } from \"../../../../hooks/useCreateOneLink.js\";\nimport { useDialog } from \"../../../../hooks/useDialog.js\";\nimport { useIsMobileDevice } from \"../../../../hooks/useIsMobileDevice.js\";\nimport { getCurrentHref } from \"../../../../utils/getCurrentHref.js\";\nimport { AppLinkDialog } from \"./AppLinkDialog.js\";\nconst DIALOG_ID = \"app-link-dialog-id\";\nconst useAppLinkDialog = ({\n  webviewNavOptions,\n  href,\n  displayDesktopQRCode = true,\n  content\n}) => {\n  const dialog = useDialog();\n  const isMobile = useIsMobileDevice();\n  const {\n    oneLink\n  } = useCreateOneLink(href ?? getCurrentHref({\n    removeQueryParams: true\n  }), webviewNavOptions);\n  const redirectApp = () => {\n    if (!isMobile) {\n      return;\n    }\n    document.location.href = oneLink;\n  };\n  const show = () => {\n    dialog.show({\n      id: DIALOG_ID,\n      content: /* @__PURE__ */ jsx(AppLinkDialog, { content, oneLink, displayDesktopQRCode }),\n      primaryButtonText: isMobile ? \"앱으로 이동\" : \"확인\",\n      secondaryButtonText: isMobile ? \"취소\" : \"\",\n      onPrimaryButtonClick: redirectApp\n    });\n  };\n  const hide = () => {\n    dialog.hide(DIALOG_ID, true);\n  };\n  return {\n    show,\n    hide\n  };\n};\nexport {\n  useAppLinkDialog\n};\n","import { useAppLinkDialog } from \"../components/@shared/dialogs/AppLinkDialog/AppLinkDialog.hooks.js\";\nimport { isWebview } from \"../utils/device.js\";\nconst useWithApp = (params) => {\n  const dialog = useAppLinkDialog(params);\n  const withApp = (callback) => async (...args) => {\n    if (!isWebview()) {\n      dialog.show();\n      return;\n    }\n    await callback(...args);\n  };\n  return withApp;\n};\nexport {\n  useWithApp\n};\n","import debounce from \"./debounce.js\";\nimport isObject from \"./isObject.js\";\nvar FUNC_ERROR_TEXT = \"Expected a function\";\nfunction throttle(func, wait, options) {\n  var leading = true, trailing = true;\n  if (typeof func != \"function\") {\n    throw new TypeError(FUNC_ERROR_TEXT);\n  }\n  if (isObject(options)) {\n    leading = \"leading\" in options ? !!options.leading : leading;\n    trailing = \"trailing\" in options ? !!options.trailing : trailing;\n  }\n  return debounce(func, wait, {\n    \"leading\": leading,\n    \"maxWait\": wait,\n    \"trailing\": trailing\n  });\n}\nexport {\n  throttle as default\n};\n","import { useCallback } from \"react\";\nimport { useNotificationAgreementsToast } from \"../../../@shared/toasts/NotificationAgreementsToast/NotificationAgreementsToast.hooks.js\";\nimport \"../../../../node_modules/@firebase/analytics/dist/esm/index.esm2017.js\";\nimport \"../../../../node_modules/firebase/app/dist/esm/index.esm.js\";\nimport \"../../../../node_modules/swr/core/dist/index.js\";\nimport \"../../../../apis/user-segment/CategoryFirstOrderApiService.js\";\nimport \"../../../../config/index.js\";\nimport \"../../../../node_modules/vite-plugin-node-polyfills/shims/buffer/dist/index.js\";\nimport \"../../../../node_modules/js-cookie/dist/js.cookie.js\";\nimport \"../../../../apis/preuser/PreuserApiService.js\";\nimport \"framer\";\nimport \"../../../../node_modules/@29cm/snowplow/dist/esm/core/snowplow.js\";\nimport \"../../../../node_modules/swr/mutation/dist/index.js\";\nimport \"../../../../hooks/stores/content/content.store.js\";\nimport \"../../../../hooks/stores/dialog/dialog.store.js\";\nimport \"../../../../hooks/stores/global-layout/global-layout.store.js\";\nimport \"../../../../hooks/stores/toast/toast.store.js\";\nimport \"../../../@shared/providers/ThemeProvider/ThemeProvider.js\";\nimport \"../../../@shared/providers/BreakpointProvider/BreakpointProvider.js\";\nimport \"../../../../hooks/stores/bottom-sheet/bottom-sheet.store.js\";\nimport { useDialog } from \"../../../../hooks/useDialog.js\";\nimport \"framer-motion\";\nimport { useEventCallback } from \"../../../../hooks/useEventCallback.js\";\nimport \"../../../../utils/redirectLogin.js\";\nimport \"react/jsx-runtime\";\nimport \"../../../../utils/event-properties/source.js\";\nimport { useWithLogin } from \"../../../../hooks/useWithLogin.js\";\nimport { useNotificationRequirements } from \"../../../../hooks/useNotificationRequirements.js\";\nimport { useRequestSubscription } from \"../../../../hooks/useRequestSubscription.js\";\nimport { useRequestUserAgreementBottomSheet } from \"../../../../hooks/useRequestUserAgreementBottomSheet.js\";\nimport { useWithApp } from \"../../../../hooks/useWithApp.js\";\nimport { useComponentId, FALLBACK_COMPONENT_ID } from \"../EventTrackingProvider/EventTrackingProvider.hooks.js\";\nimport \"../EventTrackingProvider/EventTrackingProvider.js\";\nimport { useTrackSnowplowEvent } from \"../../../../hooks/snowplow/useTrackSnowplowEvent.js\";\nimport throttle from \"../../../../node_modules/lodash-es/throttle.js\";\nconst SUBSCRIPTION_MESSAGES = {\n  ACCESS_FROM_APP: \"알림 신청 기능은 APP에서만 사용할 수 있어요\\nAPP에서 다시 시도해 주세요.\",\n  SUBSCRIBED: \"알림 설정이 완료되었습니다.\",\n  UNSUBSCRIBED: \"알림 설정이 취소되었습니다.\",\n  ERROR_WHILE_SUBSCRIBE: \"일시적인 오류로 알림 취소에 실패했습니다.\",\n  ERROR_WHILE_UNSUBSCRIBE: \"일시적인 오류로 알림 설정에 실패했습니다.\"\n};\nconst createSubscriptionStorageKey = (key) => `subscription-requirements-viewed-${key}`;\nconst useHandleSubscription = ({\n  sectionKey,\n  groupKey,\n  eventKey,\n  restEventKeys\n}, enabled = true) => {\n  const {\n    subscriptions,\n    requestSubscribe,\n    requestUnsubscribe\n  } = useRequestSubscription(eventKey, groupKey, enabled);\n  const componentId = useComponentId();\n  const trackSnowplowEvent = useTrackSnowplowEvent();\n  const requestRequirements = useSubscriptionRequirements();\n  const requestBulkRequirements = useBulkSubscriptionRequirements();\n  const toast = useNotificationAgreementsToast();\n  const withLogin = useWithLogin();\n  const withApp = useWithApp({\n    content: SUBSCRIPTION_MESSAGES.ACCESS_FROM_APP\n  });\n  const isSubscribed = subscriptions.includes(eventKey);\n  const hasRestEventKeys = restEventKeys.length > 0;\n  const isBulkSubscriptionRequirementsViewed = () => {\n    return localStorage.get(createSubscriptionStorageKey(sectionKey), false) ?? false;\n  };\n  const markAsBulkSubscriptionRequirementsViewed = () => {\n    localStorage.set(createSubscriptionStorageKey(sectionKey), true);\n  };\n  const onErrorWhileSubscribe = (error) => {\n    switch (error) {\n      case \"REQUIREMENTS_CANCELED\":\n        return;\n      default:\n        toast.show(SUBSCRIPTION_MESSAGES.ERROR_WHILE_SUBSCRIBE, true);\n        return;\n    }\n  };\n  const subscribe = async () => {\n    try {\n      await requestRequirements();\n      await requestSubscribe([eventKey]);\n      if (componentId !== FALLBACK_COMPONENT_ID) {\n        trackSnowplowEvent(\"click_button\", {\n          section_name: componentId,\n          section_title: componentId,\n          position: -1,\n          layout_position: -1,\n          button_id: \"subscribe_notification\",\n          button_name: \"알림 받기\"\n        });\n      }\n      if (hasRestEventKeys && !isBulkSubscriptionRequirementsViewed()) {\n        markAsBulkSubscriptionRequirementsViewed();\n        await requestBulkRequirements();\n        await requestSubscribe([eventKey, ...restEventKeys]);\n        toast.show(SUBSCRIPTION_MESSAGES.SUBSCRIBED);\n      }\n    } catch (error) {\n      onErrorWhileSubscribe(error);\n    }\n  };\n  const unsubscribe = async () => {\n    try {\n      await requestUnsubscribe(eventKey);\n      toast.show(SUBSCRIPTION_MESSAGES.UNSUBSCRIBED, true);\n    } catch (error) {\n      toast.show(SUBSCRIPTION_MESSAGES.ERROR_WHILE_UNSUBSCRIBE, true);\n    }\n  };\n  const toggleSubscription = useEventCallback(async () => {\n    if (isSubscribed) {\n      await unsubscribe();\n    } else {\n      await subscribe();\n    }\n  });\n  const throttledToggleSubscription = useCallback(throttle(toggleSubscription, 200), []);\n  return {\n    isSubscribed,\n    toggleSubscription: withApp(withLogin(throttledToggleSubscription))\n  };\n};\nconst localStorage = {\n  get: (key, initialValue) => {\n    try {\n      const value = window.localStorage.getItem(key);\n      if (!value) {\n        return initialValue;\n      }\n      return JSON.parse(value);\n    } catch (error) {\n      return initialValue;\n    }\n  },\n  set: (key, value) => {\n    window.localStorage.setItem(key, JSON.stringify(value));\n  }\n};\nconst useBulkSubscriptionRequirements = () => {\n  const dialog = useDialog();\n  const request = () => {\n    return new Promise((resolve, reject) => {\n      dialog.show({\n        title: \"다른 날 소식도 알려드릴까요?\",\n        content: \"매일매일 새로운 회차가 오픈하는 시간에\\n가장 빠르게 알려드릴게요.\",\n        primaryButtonText: \"예\",\n        secondaryButtonText: \"아니오\",\n        needInAppLayer: false,\n        onPrimaryButtonClick: () => resolve(),\n        onSecondaryButtonClick: () => reject(\n          \"REQUIREMENTS_CANCELED\"\n          /* REQUIREMENTS_CANCELED */\n        )\n      });\n    });\n  };\n  return request;\n};\nconst useSubscriptionRequirements = () => {\n  const requestRequirements = useNotificationRequirements();\n  const {\n    isTargetAppVersion,\n    requestUserAgreementBottomSheet\n  } = useRequestUserAgreementBottomSheet();\n  const request = () => {\n    return new Promise((resolve, reject) => {\n      if (isTargetAppVersion) {\n        requestUserAgreementBottomSheet({\n          type: \"CONTENT_DETAIL_PAGE\",\n          onCancel: () => reject(\n            \"REQUIREMENTS_CANCELED\"\n            /* REQUIREMENTS_CANCELED */\n          ),\n          onConfirm: () => resolve()\n        });\n      } else {\n        requestRequirements({\n          apiEndpoint: \"content-detail-page\",\n          onNotificationEnabled: () => resolve(),\n          onNotificationAgreementsError: () => reject(\n            \"REQUIREMENTS_ERROR\"\n            /* REQUIREMENTS_ERROR */\n          ),\n          onNotificationAgreementsCancel: () => reject(\n            \"REQUIREMENTS_CANCELED\"\n            /* REQUIREMENTS_CANCELED */\n          ),\n          onNotificationDisabled: () => reject(\n            \"REQUIREMENTS_CANCELED\"\n            /* REQUIREMENTS_CANCELED */\n          )\n        });\n      }\n    });\n  };\n  return request;\n};\nexport {\n  useHandleSubscription\n};\n","import { jsx } from \"react/jsx-runtime\";\nimport { SwitchButton } from \"../../../@shared/SwitchButton/SwitchButton.js\";\nimport \"react\";\nimport \"../../../../node_modules/@firebase/analytics/dist/esm/index.esm2017.js\";\nimport \"../../../../node_modules/firebase/app/dist/esm/index.esm.js\";\nimport \"../../../../node_modules/swr/core/dist/index.js\";\nimport \"../../../../apis/user-segment/CategoryFirstOrderApiService.js\";\nimport \"../../../../config/index.js\";\nimport \"../../../../node_modules/vite-plugin-node-polyfills/shims/buffer/dist/index.js\";\nimport \"../../../../node_modules/js-cookie/dist/js.cookie.js\";\nimport \"../../../../apis/preuser/PreuserApiService.js\";\nimport { isCanvas } from \"../../../../utils/framer/isCanvas.js\";\nimport { addPropertyControls, ControlType } from \"framer\";\nimport \"../../../../node_modules/@29cm/snowplow/dist/esm/core/snowplow.js\";\nimport \"../../../../node_modules/swr/mutation/dist/index.js\";\nimport \"../../../../hooks/stores/content/content.store.js\";\nimport \"../../../../hooks/stores/dialog/dialog.store.js\";\nimport \"../../../../hooks/stores/global-layout/global-layout.store.js\";\nimport \"../../../../hooks/stores/toast/toast.store.js\";\nimport { useTheme } from \"../../../../hooks/useTheme.js\";\nimport \"../../../@shared/providers/BreakpointProvider/BreakpointProvider.js\";\nimport \"../../../../hooks/stores/bottom-sheet/bottom-sheet.store.js\";\nimport \"react-dom\";\nimport \"../../Dialog/Dialog.module.css.js\";\nimport \"framer-motion\";\nimport \"../../../../containers/DialogContainer/DialogContainer.emitter.js\";\nimport \"../../../../utils/redirectLogin.js\";\nimport \"../../../../utils/event-properties/source.js\";\nimport { useHandleSubscription } from \"./SubscriptionButton.hooks.js\";\nimport { ThemeProvider } from \"../../../@shared/providers/ThemeProvider/ThemeProvider.js\";\nimport { THEME_CONTROLS } from \"../../../../libs/property-controls/theme.js\";\nconst SubscriptionButton = ({\n  sectionKey = \"\",\n  activeColor,\n  eventKey,\n  restEventKeys = []\n}) => {\n  const theme = useTheme();\n  const {\n    isSubscribed,\n    toggleSubscription\n  } = useHandleSubscription({\n    sectionKey,\n    eventKey,\n    restEventKeys\n  });\n  const handleClick = () => {\n    toggleSubscription();\n  };\n  return /* @__PURE__ */ jsx(SwitchButton, { theme, active: isSubscribed || isCanvas(), activeColor, onClick: handleClick, children: \"알림 받기\" });\n};\nconst FramerSubscriptionButton = ({\n  theme,\n  ...rest\n}) => {\n  return /* @__PURE__ */ jsx(ThemeProvider, { theme, children: /* @__PURE__ */ jsx(SubscriptionButton, { ...rest }) });\n};\naddPropertyControls(FramerSubscriptionButton, {\n  ...THEME_CONTROLS,\n  activeColor: {\n    type: ControlType.Color,\n    title: \"활성화 상태 색상\",\n    description: \"버튼이 활성화 상태일 때의 색상 설정\",\n    optional: true\n  },\n  eventKey: {\n    type: ControlType.String,\n    title: \"알림 키\",\n    description: \"알림 기능을 활성화할 이벤트를 구분하기 위해 사전에 정의된 키를 입력합니다.\\n\\n키가 필요한 경우 전시콘텐츠팀에 문의해 주세요.\",\n    defaultValue: \"\"\n  }\n});\nexport {\n  FramerSubscriptionButton,\n  SubscriptionButton\n};\n"],"x_google_ignoreList":[19],"mappings":"2qCAA8C,IACX,IACnB,KAC2C,KACD,CACpD,GAAeA,GAAY,CAC/B,WACA,QACA,QAAQ,QACR,SAAS,GACT,cACA,UACA,GAAG,KACC,CACJ,GAAM,CACJ,SACA,SACE,GAAsB,EAAY,CAAC,GAAO,EAAS,SAAW,WAC5D,EAAe,GAAM,CACzB,GAAW,QAAQ,CACnB,IAAmC,EAAE,EAEvC,OAAuB,EAAK,MAAO,CAAE,MAAO,CAC1C,GAAG,GACH,GAAG,EACJ,CAAE,GAAG,EAAM,QAAS,EAAa,SAAU,CAC1C,EAA2B,EAAI,MAAO,CAAE,MAAO,CAC7C,GAAG,GACH,GAAG,GAAkB,GACtB,CAAE,WAAU,CAAC,CAAG,KACD,EAAI,MAAO,CAAE,MAAO,CAClC,GAAG,GACH,gBAAiB,EAClB,CAAE,SAA0B,EAAI,MAAO,CAAE,MAAO,CAC/C,GAAG,GACH,gBAAiB,EACjB,KAAM,EAAS,GAAK,EACrB,CAAE,CAAC,CAAE,CAAC,CACR,CAAE,CAAC,EACJ,CACI,GAAyB,IAAiB,CAC9C,MAAO,CACL,QAAS,CACP,OAAQ,UACR,MAAO,UACR,CACD,OAAQ,CACN,OAAQ,GAAe,UACvB,MAAO,UACR,CACF,CACD,KAAM,CACJ,QAAS,CACP,OAAQ,UACR,MAAO,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