{"version":3,"file":"CouponCollection.ynvogsSD.mjs","names":["memo","useMemo","Headline","skeletonStyleByTheme","Fragment","createContext","useMemo","useContext","isBefore","Fragment","Headline"],"sources":["https:/asset.29cm.co.kr/contents/framer/components/systems/curations/CouponCollection/CalendarTags/CalendarTags.hooks.js","https:/asset.29cm.co.kr/contents/framer/components/systems/curations/CouponCollection/CouponCollection.utils.js","https:/asset.29cm.co.kr/contents/framer/components/systems/curations/CouponCollection/CalendarTags/CalendarTags.js","https:/asset.29cm.co.kr/contents/framer/components/systems/curations/CouponCollection/Brand/Brand.hooks.js","https:/asset.29cm.co.kr/contents/framer/components/systems/curations/CouponCollection/Brand/BrandHeadline/BrandHeadline.js","https:/asset.29cm.co.kr/contents/framer/components/systems/curations/CouponCollection/Brand/Brand.js","https:/asset.29cm.co.kr/contents/framer/components/systems/curations/CouponCollection/BrandProfiles/BrandProfiles.hooks.js","https:/asset.29cm.co.kr/contents/framer/components/systems/curations/CouponCollection/BrandProfiles/BrandProfiles.utils.js","https:/asset.29cm.co.kr/contents/framer/components/systems/curations/CouponCollection/BrandProfiles/BrandProfiles.js","https:/asset.29cm.co.kr/contents/framer/components/systems/curations/CouponCollection/provider/CouponScheduleProvider/CouponScheduleProvider.js","https:/asset.29cm.co.kr/contents/framer/components/systems/curations/CouponCollection/provider/CouponScheduleProvider/CouponScheduleProvider.hooks.js","https:/asset.29cm.co.kr/contents/framer/components/systems/curations/CouponCollection/BrandProfilesHeadline/BrandProfilesHeadline.js","https:/asset.29cm.co.kr/contents/framer/components/systems/curations/CouponCollection/CouponCollection.js","https:/framerusercontent.com/modules/brTkyl87HWdHAAJh0eg0/TxXjFRI3GC9iw6loXoq5/CouponCollection.js"],"sourcesContent":["import { useFetchBrandSaleGroup } from \"../../../../../hooks/fetchers/useFetchBrandSaleGroup.js\";\nimport \"../../IntersectionProvider/IntersectionProvider.js\";\nimport { useIntersectionContext } from \"../../IntersectionProvider/IntersectionProvider.hooks.js\";\nconst useBrandSaleGroup = (brandSaleGroupId) => {\n  const {\n    isInView\n  } = useIntersectionContext();\n  const {\n    isLoading,\n    error,\n    data\n  } = useFetchBrandSaleGroup(brandSaleGroupId, isInView);\n  const hasError = error !== void 0;\n  const isPending = isLoading || hasError;\n  const brandSaleList = (data == null ? void 0 : data.data.brandSaleList) ?? [];\n  const title = data == null ? void 0 : data.data.title;\n  return {\n    title,\n    brandSaleList,\n    isPending\n  };\n};\nexport {\n  useBrandSaleGroup\n};\n","const findCurrentIndex = ({\n  list,\n  queryId,\n  idKey,\n  fallbackIndex = 0,\n  getCurrentIndex\n}) => {\n  if (queryId !== void 0) {\n    const targetIndex = list.findIndex((item) => {\n      const itemId = item == null ? void 0 : item[idKey];\n      return itemId === Number(queryId);\n    });\n    if (targetIndex !== -1) {\n      return targetIndex;\n    }\n  }\n  if (getCurrentIndex) {\n    const currentIndex = getCurrentIndex(list);\n    if (currentIndex !== void 0) {\n      return currentIndex;\n    }\n  }\n  return fallbackIndex;\n};\nconst findCurrentIndexByValue = (list, targetValue, compareKey) => {\n  if (targetValue !== void 0) {\n    const targetIndex = list.findIndex((item) => {\n      const itemValue = item == null ? void 0 : item[compareKey];\n      return itemValue === targetValue;\n    });\n    return targetIndex;\n  }\n  return -1;\n};\nexport {\n  findCurrentIndex,\n  findCurrentIndexByValue\n};\n","import { jsxs, jsx } from \"react/jsx-runtime\";\nimport { memo, useMemo } from \"react\";\nimport { useComponentId, useTrackEvent } from \"../../EventTrackingProvider/EventTrackingProvider.hooks.js\";\nimport \"../../EventTrackingProvider/EventTrackingProvider.js\";\nimport { getCurrentBrandSaleIndex, getCalendarTagName } from \"./CalendarTags.utils.js\";\nimport { useBrandSaleGroup } from \"./CalendarTags.hooks.js\";\nimport { Tags } from \"../../Tags/index.js\";\nimport { Tag } from \"../../../../@shared/Tag/Tag.js\";\nimport { useTheme } from \"../../../../../hooks/useTheme.js\";\nimport \"framer-motion\";\nimport \"react-dom\";\nimport { Icon } from \"../../../../@shared/Icon/Icon.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 { useBreakpoint } from \"../../../../../hooks/useBreakpoint.js\";\nimport \"../../../../../hooks/stores/bottom-sheet/bottom-sheet.store.js\";\nimport \"../../../Dialog/Dialog.module.css.js\";\nimport \"../../../../../containers/DialogContainer/DialogContainer.emitter.js\";\nimport \"../../../../../utils/redirectLogin.js\";\nimport \"../../../../../utils/event-properties/source.js\";\nimport { useTrackSnowplowEvent } from \"../../../../../hooks/snowplow/useTrackSnowplowEvent.js\";\nimport { EventTrigger } from \"../../../../@shared/EventTrigger/index.js\";\nimport { findCurrentIndexByValue } from \"../CouponCollection.utils.js\";\nconst DEFAULT_INDEX = 0;\nconst SCHEDULE_BUTTON_NAME = \"스케줄\";\nconst CalendarTags = memo(({\n  children,\n  brandSaleGroupId,\n  scheduleTag,\n  queryBrandSaleId\n}) => {\n  const componentId = useComponentId();\n  const {\n    trackEvent\n  } = useTrackEvent();\n  const trackSnowplowEvent = useTrackSnowplowEvent();\n  const theme = useTheme();\n  const breakpoint = useBreakpoint();\n  const {\n    brandSaleList,\n    isPending\n  } = useBrandSaleGroup(brandSaleGroupId);\n  const currentIndex = useMemo(() => {\n    const foundIndex = findCurrentIndexByValue(brandSaleList, queryBrandSaleId ? Number(queryBrandSaleId) : void 0, \"brandSaleId\");\n    if (foundIndex === -1) {\n      return getCurrentBrandSaleIndex(brandSaleList) ?? 0;\n    }\n    return foundIndex;\n  }, [brandSaleList, queryBrandSaleId]);\n  const handleClickSchedule = () => {\n    trackSnowplowEvent(\"click_button\", {\n      section_name: componentId,\n      section_title: componentId,\n      position: -1,\n      button_id: \"brand_schedule\",\n      button_name: SCHEDULE_BUTTON_NAME,\n      layout_position: -1\n    });\n  };\n  const handleClick = (item, index) => () => {\n    if (!item) {\n      return;\n    }\n    trackEvent({\n      component_type: \"tag\",\n      tag_type: \"time\",\n      tag_name: item.title,\n      position: index + 1\n    });\n    trackSnowplowEvent(\"click_button\", {\n      section_name: componentId,\n      section_title: componentId,\n      position: index + 1,\n      button_id: \"tag\",\n      button_name: getCalendarTagName({\n        displayStartAt: item.displayStartAt,\n        displayEndAt: item.displayEndAt\n      }),\n      layout_position: -1\n    });\n  };\n  return /* @__PURE__ */ jsxs(Tags.Root, { defaultValue: DEFAULT_INDEX, value: currentIndex, loading: isPending, dragPaddingLeft: scheduleTag.visible ? 8 : void 0, children: [\n    /* @__PURE__ */ jsxs(\"div\", { style: containerStyle, children: [\n      scheduleTag.visible ? /* @__PURE__ */ jsx(\"div\", { style: {\n        ...wrapperStyleByBreakpoint[breakpoint],\n        ...wrapperStyleByTheme[theme],\n        ...wrapperStyle\n      }, children: /* @__PURE__ */ jsx(EventTrigger.Target, { onClick: handleClickSchedule, children: /* @__PURE__ */ jsx(\"a\", { style: anchorStyle, href: scheduleTag.href, target: \"_blank\", rel: \"noreferrer\", children: /* @__PURE__ */ jsxs(Tag, { style: {\n        ...tagStyle,\n        color: scheduleTag.color,\n        borderColor: scheduleTag.color\n      }, children: [\n        SCHEDULE_BUTTON_NAME,\n        \" \",\n        /* @__PURE__ */ jsx(Icon, { type: \"searchList\", color: scheduleTag.color, fill: true, weight: \"bold\", size: 14 })\n      ] }) }) }) }) : null,\n      /* @__PURE__ */ jsx(Tags.List, { list: brandSaleList, children: ({\n        index,\n        item\n      }) => /* @__PURE__ */ jsx(Tags.Item, { value: index, onClick: handleClick(item, index), children: item ? getCalendarTagName({\n        displayStartAt: item.displayStartAt,\n        displayEndAt: item.displayEndAt\n      }) : \"\" }) })\n    ] }),\n    /* @__PURE__ */ jsx(Tags.Panels, { list: brandSaleList, children: ({\n      item,\n      index,\n      pending\n    }) => {\n      return /* @__PURE__ */ jsx(Tags.Panel, { value: index, children: children({\n        brandSaleId: item == null ? void 0 : item.brandSaleId,\n        startDate: item ? new Date(item.displayStartAt) : void 0,\n        endDate: item ? new Date(item.displayEndAt) : void 0,\n        index,\n        pending\n      }) }, item == null ? void 0 : item.brandSaleId);\n    } })\n  ] });\n});\nconst containerStyle = {\n  width: \"100%\",\n  display: \"flex\",\n  alignItems: \"center\"\n};\nconst wrapperStyle = {\n  paddingRight: 8,\n  marginBottom: 16,\n  boxSizing: \"border-box\"\n};\nconst wrapperStyleByTheme = {\n  light: {\n    borderRight: \"1px solid #5d5d5d14\"\n  },\n  dark: {\n    borderRight: \"1px solid #f4f4f414\"\n  }\n};\nconst wrapperStyleByBreakpoint = {\n  desktop: {\n    paddingLeft: 0\n  },\n  tablet: {\n    paddingLeft: 20\n  },\n  mobile: {\n    paddingLeft: 20\n  }\n};\nconst anchorStyle = {\n  textDecoration: \"none\"\n};\nconst tagStyle = {\n  display: \"flex\",\n  alignItems: \"center\",\n  gap: 4,\n  paddingRight: 10,\n  backgroundColor: \"transparent\",\n  borderWidth: 1,\n  borderStyle: \"solid\"\n};\nexport {\n  CalendarTags\n};\n","import { useFetchCouponCollectionProducts } from \"../../../../../hooks/fetchers/useFetchCouponCollectionProducts.js\";\nconst useCouponCollectionProducts = (couponCollectionId) => {\n  const hasCouponCollectionId = couponCollectionId !== void 0;\n  const enabled = hasCouponCollectionId;\n  const {\n    products,\n    isPending,\n    hasNext,\n    setSize\n  } = useFetchCouponCollectionProducts(couponCollectionId ?? 0, enabled);\n  return {\n    isPending,\n    products,\n    setSize,\n    hasNext\n  };\n};\nexport {\n  useCouponCollectionProducts\n};\n","import { jsx, jsxs } from \"react/jsx-runtime\";\nimport { EventTrigger } from \"../../../../../@shared/EventTrigger/index.js\";\nimport { Skeleton } from \"../../../../../@shared/Skeleton/Skeleton.js\";\nimport { TextButton as Default } from \"../../../../../@shared/TextButton/TextButton.js\";\nimport { useComponentId } from \"../../../EventTrackingProvider/EventTrackingProvider.hooks.js\";\nimport \"../../../EventTrackingProvider/EventTrackingProvider.js\";\nimport { Headline } from \"../../../Headline/index.js\";\nimport { env } from \"../../../../../../config/index.js\";\nimport { PREVIOUS_SECTION_NAME_QUERY_STRING_KEY, PREVIOUS_SECTION_TITLE_QUERY_STRING_KEY, PREVIOUS_PAGE_NAME_QUERY_STRING_KEY, PREVIOUS_CONTENT_NO_QUERY_STRING_KEY } from \"../../../../../../constants/query-params.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 \"../../../../../../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 { 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 { createContentEventProperties } from \"../../../../../../utils/event-properties/content.js\";\nimport \"../../../../../../utils/event-properties/source.js\";\nimport { createSearchParams } from \"../../../../../../utils/createSearchParams.js\";\nimport { useTrackSnowplowEvent } from \"../../../../../../hooks/snowplow/useTrackSnowplowEvent.js\";\nimport { useNavigatePage } from \"../../../../../../hooks/useNavigatePage.js\";\nconst DEFAULT_COMPONENT_ID = \"CouponCollection\";\nconst ACTION_BUTTON_NAME = \"전체보기\";\nconst BrandHeadline = ({\n  couponCollectionId,\n  isPending,\n  frontBrand\n}) => {\n  const theme = useTheme();\n  const componentId = useComponentId();\n  const {\n    curr_screen,\n    content_no\n  } = createContentEventProperties();\n  const sectionTitle = `${(frontBrand == null ? void 0 : frontBrand.nameKor) ?? \"\"} 인기 아이템`;\n  const couponCollectionSearchParams = createSearchParams({\n    [PREVIOUS_SECTION_NAME_QUERY_STRING_KEY]: componentId || DEFAULT_COMPONENT_ID,\n    [PREVIOUS_SECTION_TITLE_QUERY_STRING_KEY]: sectionTitle,\n    [PREVIOUS_PAGE_NAME_QUERY_STRING_KEY]: curr_screen,\n    [PREVIOUS_CONTENT_NO_QUERY_STRING_KEY]: content_no\n  });\n  const couponCollectionPageUrl = `${env.workspace.content}/coupon-collection/${couponCollectionId}?${couponCollectionSearchParams}`;\n  const navigateCouponCollectionPage = useNavigatePage(couponCollectionPageUrl, {\n    webview: {\n      home: true\n    }\n  });\n  const trackSnowplowEvent = useTrackSnowplowEvent();\n  const handleButtonClick = () => {\n    if (!couponCollectionId) {\n      return;\n    }\n    navigateCouponCollectionPage();\n    trackSnowplowEvent(\"click_button\", {\n      section_name: componentId,\n      section_title: componentId,\n      position: -1,\n      button_id: \"more\",\n      button_name: ACTION_BUTTON_NAME,\n      layout_position: -1\n    });\n  };\n  return /* @__PURE__ */ jsx(Headline.Root, { priority: \"tertiary\", children: /* @__PURE__ */ jsxs(Headline.Content, { children: [\n    !isPending ? /* @__PURE__ */ jsx(Headline.Title, { children: sectionTitle }) : /* @__PURE__ */ jsx(\"div\", { style: {\n      width: \"100%\"\n    }, children: /* @__PURE__ */ jsx(Skeleton, { style: {\n      height: 19.6,\n      width: 160,\n      borderRadius: 2,\n      ...skeletonStyleByTheme[theme]\n    } }) }),\n    /* @__PURE__ */ jsx(Headline.Action, { children: /* @__PURE__ */ jsx(EventTrigger.Target, { onClick: handleButtonClick, children: /* @__PURE__ */ jsx(Default, { style: {\n      opacity: 0.6\n    }, theme, variant: \"primary\", size: \"xSmall\", postfixIcon: \"chevronRight\", children: ACTION_BUTTON_NAME }) }) })\n  ] }) });\n};\nconst skeletonStyleByTheme = {\n  light: {\n    backgroundColor: \"#dee2e6\"\n  },\n  dark: {\n    backgroundColor: \"#27272a\"\n  }\n};\nexport {\n  BrandHeadline\n};\n","import { jsxs, Fragment, jsx } from \"react/jsx-runtime\";\nimport { useComponentId } from \"../../EventTrackingProvider/EventTrackingProvider.hooks.js\";\nimport \"../../EventTrackingProvider/EventTrackingProvider.js\";\nimport { useCouponCollectionProducts } from \"./Brand.hooks.js\";\nimport { Products } from \"../../Products/index.js\";\nimport { CARD_HORIZONTAL_AUTO } from \"../../Products/Root.constants.js\";\nimport { BrandHeadline } from \"./BrandHeadline/BrandHeadline.js\";\nconst Brand = ({\n  couponCollectionId,\n  frontBrand\n}) => {\n  const componentId = useComponentId();\n  const {\n    isPending,\n    products,\n    hasNext,\n    setSize\n  } = useCouponCollectionProducts(couponCollectionId);\n  const loading = isPending || products.length === 0;\n  return /* @__PURE__ */ jsxs(Fragment, { children: [\n    /* @__PURE__ */ jsx(BrandHeadline, { isPending: !frontBrand, frontBrand, couponCollectionId }),\n    /* @__PURE__ */ jsx(Products.Root, { hasNext, options: CARD_HORIZONTAL_AUTO, products, loading, onLastItemView: () => {\n      setSize((prev) => prev + 1);\n    }, children: ({\n      index\n    }) => /* @__PURE__ */ jsx(Products.Card, { index, componentName: componentId }) })\n  ] });\n};\nexport {\n  Brand\n};\n","import { useFetchBrandSales } from \"../../../../../hooks/fetchers/useFetchBrandSales.js\";\nconst useBrandSales = (brandSaleId) => {\n  var _a;\n  const hasBrandSaleId = brandSaleId !== void 0;\n  const enabled = hasBrandSaleId;\n  const {\n    isLoading,\n    error,\n    data\n  } = useFetchBrandSales(brandSaleId ?? 0, enabled);\n  const brandSaleCouponList = ((_a = data == null ? void 0 : data.data) == null ? void 0 : _a.brandSaleCouponList.filter((item) => Boolean(item.couponCollectionId))) ?? [];\n  const hasError = error !== void 0;\n  const isPending = isLoading || hasError || !enabled;\n  return {\n    isPending,\n    brandSaleCouponList\n  };\n};\nexport {\n  useBrandSales\n};\n","import { DiscountType } from \"../../../../../types/models/coupon.js\";\nconst formatCoupon = ({\n  coupon,\n  brand\n}) => {\n  if (!coupon || !brand) {\n    return void 0;\n  }\n  const couponNamePostFix = coupon.discountType === DiscountType.FIXED_PRICE ? \"원\" : \"%\";\n  const couponName = `${brand.nameKor} ${coupon.discountValue}${couponNamePostFix}`;\n  return {\n    ...coupon,\n    id: coupon.couponId,\n    couponName\n  };\n};\nexport {\n  formatCoupon\n};\n","import { jsxs, jsx } from \"react/jsx-runtime\";\nimport { useBrandSales } from \"./BrandProfiles.hooks.js\";\nimport { useComponentId, useTrackEvent } from \"../../EventTrackingProvider/EventTrackingProvider.hooks.js\";\nimport \"../../EventTrackingProvider/EventTrackingProvider.js\";\nimport { Profiles } from \"../../Profiles/index.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 \"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 { useBreakpoint } from \"../../../../../hooks/useBreakpoint.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 { DownloadableCoupon } from \"../../DownloadableCoupon/DownloadableCoupon.js\";\nimport { formatCoupon } from \"./BrandProfiles.utils.js\";\nimport { useTrackSnowplowEvent } from \"../../../../../hooks/snowplow/useTrackSnowplowEvent.js\";\nimport { findCurrentIndexByValue } from \"../CouponCollection.utils.js\";\nconst COUPON_MAX_WIDTH = 429;\nconst GAP = 16;\nconst BrandProfiles = ({\n  children,\n  brandSaleId,\n  couponColor,\n  queryBrandSaleCouponId\n}) => {\n  const breakpoint = useBreakpoint();\n  const componentId = useComponentId();\n  const {\n    trackEvent\n  } = useTrackEvent();\n  const trackSnowplowEvent = useTrackSnowplowEvent();\n  const {\n    isPending,\n    brandSaleCouponList\n  } = useBrandSales(brandSaleId);\n  const foundIndex = findCurrentIndexByValue(brandSaleCouponList, queryBrandSaleCouponId ? Number(queryBrandSaleCouponId) : void 0, \"brandSaleCouponId\");\n  const currentIndex = foundIndex === -1 ? 0 : foundIndex;\n  const handleClick = (brand, index) => () => {\n    if (!brand) {\n      return;\n    }\n    trackEvent({\n      component_type: \"tag\",\n      tag_type: \"brand\",\n      tag_name: brand.nameKor,\n      tag_value: brand.frontBrandId,\n      position: index + 1\n    });\n    trackSnowplowEvent(\"click_button\", {\n      section_name: componentId,\n      section_title: componentId,\n      position: -1,\n      button_id: \"image_tag\",\n      button_name: brand.nameKor,\n      layout_position: -1\n    });\n  };\n  return /* @__PURE__ */ jsxs(Profiles.Root, { loading: isPending, value: currentIndex, children: [\n    /* @__PURE__ */ jsxs(\"div\", { style: {\n      ...profilesLayoutBaseStyle,\n      ...profilesLayoutStyleByBreakpoint[breakpoint]\n    }, children: [\n      /* @__PURE__ */ jsx(\"div\", { style: profilesListStyleByBreakpoint[breakpoint], children: /* @__PURE__ */ jsx(Profiles.List, { list: brandSaleCouponList, children: ({\n        item,\n        index\n      }) => /* @__PURE__ */ jsx(Profiles.Item, { value: index, name: (item == null ? void 0 : item.frontBrand.nameKor) ?? \"\", imageSrc: (item == null ? void 0 : item.frontBrand.iconImageUrl) ?? \"\", onClick: handleClick(item == null ? void 0 : item.frontBrand, index) }) }) }),\n      /* @__PURE__ */ jsx(\"div\", { style: {\n        ...brandCouponBaseStyle,\n        ...brandCouponStyleByBreakpoint[breakpoint]\n      }, children: /* @__PURE__ */ jsx(Profiles.Panels, { list: brandSaleCouponList, children: ({\n        item,\n        index\n      }) => /* @__PURE__ */ jsx(Profiles.Panel, { value: index, children: /* @__PURE__ */ jsx(DownloadableCoupon, { coupon: formatCoupon({\n        coupon: item == null ? void 0 : item.coupon,\n        brand: item == null ? void 0 : item.frontBrand\n      }), backgroundColor: couponColor }) }) }) })\n    ] }),\n    /* @__PURE__ */ jsx(Profiles.Panels, { list: brandSaleCouponList, children: ({\n      item,\n      index\n    }) => /* @__PURE__ */ jsx(Profiles.Panel, { value: index, children: children(item == null ? void 0 : item.couponCollectionId, item == null ? void 0 : item.frontBrand) }) })\n  ] });\n};\nconst profilesLayoutBaseStyle = {\n  display: \"flex\",\n  width: \"100%\"\n};\nconst profilesLayoutStyleByBreakpoint = {\n  desktop: {\n    flexDirection: \"row\",\n    gap: GAP\n  },\n  tablet: {\n    flexDirection: \"row\",\n    gap: GAP\n  },\n  mobile: {\n    flexDirection: \"column\"\n  }\n};\nconst profilesListStyleByBreakpoint = {\n  desktop: {\n    width: `calc(100% - ${COUPON_MAX_WIDTH}px - ${GAP}px)`\n  },\n  tablet: {\n    width: `calc(100% - ${COUPON_MAX_WIDTH}px - ${GAP}px)`\n  },\n  mobile: {\n    width: \"100%\"\n  }\n};\nconst brandCouponBaseStyle = {\n  width: \"100%\"\n};\nconst brandCouponStyleByBreakpoint = {\n  desktop: {\n    maxWidth: COUPON_MAX_WIDTH,\n    padding: 0\n  },\n  tablet: {\n    maxWidth: COUPON_MAX_WIDTH,\n    padding: \"0px 20px 0px 0px\"\n  },\n  mobile: {\n    padding: \"0px 20px 16px\"\n  }\n};\nexport {\n  BrandProfiles\n};\n","import { jsx } from \"react/jsx-runtime\";\nimport { createContext, useMemo } from \"react\";\nimport { isBefore } from \"../../../../../../node_modules/date-fns/isBefore.js\";\nconst CouponScheduleContext = createContext(null);\nconst CouponScheduleProvider = ({\n  children,\n  startDate,\n  endDate\n}) => {\n  const hasDate = startDate !== void 0 && endDate !== void 0;\n  const isBefore$1 = useMemo(() => hasDate && isBefore(/* @__PURE__ */ new Date(), startDate), [hasDate, startDate]);\n  const isAfter = useMemo(() => hasDate && isBefore(endDate, /* @__PURE__ */ new Date()), [hasDate, endDate]);\n  const isActive = useMemo(() => hasDate && isBefore(startDate, /* @__PURE__ */ new Date()) && isBefore(/* @__PURE__ */ new Date(), endDate), [hasDate, startDate, endDate]);\n  return /* @__PURE__ */ jsx(CouponScheduleContext.Provider, { value: {\n    startDate,\n    endDate,\n    isBefore: isBefore$1,\n    isAfter,\n    isActive\n  }, children });\n};\nexport {\n  CouponScheduleContext,\n  CouponScheduleProvider\n};\n","import { useContext } from \"react\";\nimport { CouponScheduleContext } from \"./CouponScheduleProvider.js\";\nconst useCouponScheduleContext = () => {\n  const context = useContext(CouponScheduleContext);\n  if (!context) {\n    throw new Error(\"useCouponScheduleContext should be used within CouponCollection\");\n  }\n  return context;\n};\nexport {\n  useCouponScheduleContext\n};\n","import { jsxs, Fragment, jsx } from \"react/jsx-runtime\";\nimport { Headline } from \"../../Headline/index.js\";\nimport { ko } from \"../../../../../node_modules/date-fns/locale/ko.js\";\nimport { useCouponScheduleContext } from \"../provider/CouponScheduleProvider/CouponScheduleProvider.hooks.js\";\nimport { typography } from \"../../../../../styles/typography.js\";\nimport { Countdown } from \"../../../Countdown/Countdown.js\";\nimport { SubscriptionButton } from \"../../SubscriptionButton/SubscriptionButton.js\";\nimport { splitToStringArray } from \"../../../../../utils/splitToStringArray.js\";\nimport { restOf } from \"../../../../../utils/restOf.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 \"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 { useBreakpoint } from \"../../../../../hooks/useBreakpoint.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 { Skeleton } from \"../../../../@shared/Skeleton/Skeleton.js\";\nimport { formatDate as format } from \"../../../../../node_modules/date-fns/format.js\";\nconst BrandProfilesHeadline = ({\n  brandSaleGroupId,\n  subscription,\n  index,\n  isPending\n}) => {\n  const {\n    isActive,\n    isBefore,\n    isAfter,\n    startDate,\n    endDate\n  } = useCouponScheduleContext();\n  const breakpoint = useBreakpoint();\n  const theme = useTheme();\n  const eventKeys = splitToStringArray(subscription.eventKeys);\n  const renderHeadlineAction = () => {\n    if (isActive && endDate) {\n      return /* @__PURE__ */ jsx(Countdown, { targetDateString: format(endDate, \"yyyy-MM-dd\"), targetTimeString: format(endDate, \"HH:mm:ss\"), dateDisplayFormat: \"D일\", timeDisplayFormat: \"H시간 m분 s초\", fontSize: 15, color: countdownColorByTheme[theme], style: {\n        ...typography(15, 500)\n      } });\n    }\n    if (isBefore) {\n      return subscription.visible ? /* @__PURE__ */ jsx(SubscriptionButton, { activeColor: subscription.activeColor, sectionKey: `${brandSaleGroupId}`, eventKey: eventKeys[index] ?? \"\", restEventKeys: restOf(eventKeys, index) }) : null;\n    }\n    return null;\n  };\n  const renderHeadlineTitle = () => {\n    if (isActive) {\n      return \"종료까지 남은 시간\";\n    }\n    if (isBefore && startDate) {\n      return `${format(startDate, \"a h시\", {\n        locale: ko\n      })} 오픈`;\n    }\n    if (isAfter) {\n      return \"종료된 이벤트\";\n    }\n    return \"\";\n  };\n  return /* @__PURE__ */ jsxs(Fragment, { children: [\n    /* @__PURE__ */ jsx(\"div\", { style: {\n      borderTop: borderStyleByTheme[theme],\n      ...dividerStyleByBreakpoint[breakpoint]\n    } }),\n    /* @__PURE__ */ jsx(Headline.Root, { priority: \"secondary\", children: /* @__PURE__ */ jsxs(Headline.Content, { children: [\n      /* @__PURE__ */ jsx(Headline.Body, { style: headlineTitleStyle, children: /* @__PURE__ */ jsx(Headline.Title, { children: isPending ? /* @__PURE__ */ jsx(Skeleton, { style: {\n        ...headlineTitleSkeletonStyle,\n        ...skeletonStyleByTheme[theme]\n      } }) : renderHeadlineTitle() }) }),\n      /* @__PURE__ */ jsx(Headline.Action, { style: {\n        color: \"#FFFFFF\"\n      }, children: isPending ? /* @__PURE__ */ jsx(Skeleton, { style: {\n        ...headlineTitleSkeletonStyle,\n        ...skeletonStyleByTheme[theme]\n      } }) : renderHeadlineAction() })\n    ] }) })\n  ] });\n};\nconst dividerStyleByBreakpoint = {\n  desktop: {\n    margin: 0\n  },\n  tablet: {\n    margin: \"0 20px\"\n  },\n  mobile: {\n    margin: \"0 20px\"\n  }\n};\nconst headlineTitleStyle = {\n  display: \"flex\",\n  alignItems: \"center\",\n  justifyContent: \"center\",\n  height: 40\n};\nconst headlineTitleSkeletonStyle = {\n  width: 90,\n  height: 21,\n  borderRadius: 2\n};\nconst borderStyleByTheme = {\n  light: \"1px solid #E4E4E4\",\n  dark: \"1px solid #27272A\"\n};\nconst skeletonStyleByTheme = {\n  light: {\n    backgroundColor: \"#dee2e6\"\n  },\n  dark: {\n    backgroundColor: \"#27272a\"\n  }\n};\nconst countdownColorByTheme = {\n  light: \"#FF4800\",\n  dark: \"#D53E00\"\n};\nexport {\n  BrandProfilesHeadline\n};\n","import { jsxs, jsx } from \"react/jsx-runtime\";\nimport { addPropertyControls, ControlType } from \"framer\";\nimport { CalendarTags } from \"./CalendarTags/CalendarTags.js\";\nimport { Brand } from \"./Brand/Brand.js\";\nimport { BrandProfiles } from \"./BrandProfiles/BrandProfiles.js\";\nimport { CouponScheduleProvider } from \"./provider/CouponScheduleProvider/CouponScheduleProvider.js\";\nimport { SECTION_CONTROLS } from \"../../../../libs/property-controls/section.js\";\nimport { Headline } from \"../../Headline/Headline.js\";\nimport { COUPON_CONTROLS, toBackgroundColor } from \"../../../../libs/property-controls/coupon.js\";\nimport { SUBSCRIPTION_CONTROLS } from \"../../../../libs/property-controls/subscription.js\";\nimport { BrandProfilesHeadline } from \"./BrandProfilesHeadline/BrandProfilesHeadline.js\";\nimport { SectionLayout } from \"../SectionLayout/SectionLayout.js\";\nimport { SWRErrorBoundary } from \"../../../@shared/SWRErrorBoundary/SWRErrorBoundary.js\";\nimport { NoContent } from \"../NoContent/NoContent.js\";\nimport \"../../../../hooks/stores/content/content.store.js\";\nimport { getQueryParams } from \"../../../../utils/location.js\";\nimport \"../../../../utils/event-properties/source.js\";\nimport \"react\";\nconst CouponCollection = ({\n  brandSaleGroupId,\n  componentId,\n  headline,\n  theme,\n  breakpoint,\n  backgroundColor,\n  subscription,\n  scheduleTag\n}) => {\n  const query = getQueryParams();\n  const {\n    brandSaleId: queryBrandSaleId,\n    brandSaleCouponId: queryBrandSaleCouponId\n  } = query;\n  return /* @__PURE__ */ jsxs(SectionLayout, { theme, breakpoint, componentId, children: [\n    /* @__PURE__ */ jsx(Headline, { ...headline, priority: \"primary\" }),\n    /* @__PURE__ */ jsx(SWRErrorBoundary, { fallback: (retry) => /* @__PURE__ */ jsx(NoContent, { onClick: retry }), children: /* @__PURE__ */ jsx(CalendarTags, { brandSaleGroupId, scheduleTag, queryBrandSaleId, children: ({\n      brandSaleId,\n      startDate,\n      endDate,\n      index,\n      pending\n    }) => /* @__PURE__ */ jsxs(CouponScheduleProvider, { startDate, endDate, children: [\n      /* @__PURE__ */ jsx(BrandProfilesHeadline, { isPending: pending, brandSaleGroupId, subscription, index }),\n      /* @__PURE__ */ jsx(BrandProfiles, { brandSaleId, couponColor: toBackgroundColor(backgroundColor), queryBrandSaleCouponId, children: (couponCollectionId, frontBrand) => /* @__PURE__ */ jsx(Brand, { couponCollectionId, frontBrand }) })\n    ] }) }) })\n  ] });\n};\naddPropertyControls(CouponCollection, {\n  ...SECTION_CONTROLS,\n  ...COUPON_CONTROLS,\n  brandSaleGroupId: {\n    type: ControlType.String,\n    title: \"타임 세일 브랜드 ID\"\n  },\n  ...SUBSCRIPTION_CONTROLS,\n  scheduleTag: {\n    type: ControlType.Object,\n    title: \"스케줄 태그\",\n    controls: {\n      visible: {\n        type: ControlType.Boolean,\n        title: \"노출 여부\",\n        defaultValue: true\n      },\n      color: {\n        type: ControlType.Color,\n        title: \"색상\",\n        defaultValue: \"#000\"\n      },\n      href: {\n        type: ControlType.Link,\n        title: \"URL\"\n      }\n    }\n  }\n});\nexport {\n  CouponCollection\n};\n","/** local */// import { CouponCollection } from \"https://localhost:4173/components/systems/curations/CouponCollection/CouponCollection.js\"\n/** dev */// import { CouponCollection } from \"https://asset.29cm.co.kr/contents/framer/dev/components/systems/curations/CouponCollection/CouponCollection.js\"\n/** production */import{CouponCollection}from\"https://asset.29cm.co.kr/contents/framer/components/systems/curations/CouponCollection/CouponCollection.js\";CouponCollection.displayName=\"[curation]CouponCollection\";/**\n * @framerDisableUnlink\n */export default CouponCollection;\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"CouponCollection\",\"slots\":[],\"annotations\":{\"framerDisableUnlink\":\"\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./CouponCollection.map"],"mappings":"g2DAAiG,KACrC,KACsC,CAC5F,GAAqB,GAAqB,CAC9C,GAAM,CACJ,YACE,IAAwB,CACtB,CACJ,YACA,QACA,QACE,GAAuB,EAAkB,EAAS,CAEhD,EAAY,GADD,IAAU,IAAK,GAE1B,EAAiB,GAA6B,KAAK,eAAkB,EAAE,CAE7E,MAAO,CACL,MAFY,GAA6B,KAAK,MAG9C,gBACA,YACD,kBCIG,GAA2B,EAAM,EAAa,IAC9C,IAAgB,IAAK,GAOlB,GANe,EAAK,UAAW,GAChB,IAA6B,KAC1B,EACrB,4CC7BwC,IACR,IACqE,I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