{"version":3,"file":"debounce.cc6fdb67.js","sources":["../../../src/react/SearchCard/SearchCard.tsx","../../../node_modules/@mui/utils/debounce.js"],"sourcesContent":["import React from \"react\";\nimport FallbackImage from \"../FallbackImage\";\nimport { ISearchCardProps } from \"../interfaces\";\nimport { IAddToCartData, ToastStore } from \"../stores/ToastStore\";\nimport SVG from \"../SVG\";\nimport { addToBookmarks, ICart, removeFromBookmarks, updateCart } from \"../api\";\nimport { Globals, t } from \"../utils\";\nimport { trackAddToCart } from \"../tracking\";\n\nconst { useState } = React;\n\nconst videoFormats = [\"MP4\", \"MPG\", \"WMV\", \"MOV\", \"MP3\", \"AVI\"];\n\nconst SearchCard = ({\n\tisEvent,\n\ttitle,\n\timage,\n\tproductCategory,\n\ttext,\n\tstyle,\n\tisLoading,\n\tchips,\n\turl,\n\tid,\n\tisOnWishlist,\n\ticon,\n\tfallbackImage,\n\tdownloadUrl,\n\tstartDate,\n\tendDate,\n\tonlineLocation,\n\teventCategories,\n\tpurchasableId,\n\tprice,\n\tpriceAsCurrency,\n\ttrackingData,\n\tcanAddToCart,\n\tisDigitalProduct,\n\tisApp,\n}: ISearchCardProps) => {\n\tconst [isBookmarked, setIsBookmarked] = useState(isOnWishlist);\n\tconst searchCardClassName = isEvent\n\t\t? \"search-card search-card__event\"\n\t\t: \"search-card\";\n\n\tconst getFormattedDateTime = (date: Date) => {\n\t\tif (!date) return;\n\n\t\tconst dateTimeObj: { date: string | null; time: string | null } = {\n\t\t\tdate: null,\n\t\t\ttime: null,\n\t\t};\n\n\t\tdateTimeObj[\"date\"] = new Intl.DateTimeFormat(\"de-AT\").format(date);\n\n\t\tconst timeOptions: Intl.DateTimeFormatOptions = {\n\t\t\thour: \"numeric\",\n\t\t\tminute: \"numeric\",\n\t\t\thour12: false,\n\t\t};\n\n\t\tdateTimeObj[\"time\"] = new Intl.DateTimeFormat(\n\t\t\t\"de-AT\",\n\t\t\ttimeOptions\n\t\t).format(date);\n\n\t\treturn dateTimeObj;\n\t};\n\n\tconst getEventInfo = () => {\n\t\tlet formattedStartDate = null;\n\t\tlet formattedStartTime = null;\n\t\tlet formattedEndDate = null;\n\t\tlet formattedEndTime = null;\n\n\t\tif (startDate) {\n\t\t\tconst startDateObj = new Date(startDate);\n\t\t\tconst startDateTimeObj = getFormattedDateTime(startDateObj);\n\n\t\t\tif (startDateTimeObj) {\n\t\t\t\tformattedStartDate = startDateTimeObj.date;\n\t\t\t\tformattedStartTime = startDateTimeObj.time;\n\t\t\t}\n\t\t}\n\n\t\tif (endDate) {\n\t\t\tconst endDateObj = new Date(endDate);\n\t\t\tconst startDateTimeObj = getFormattedDateTime(endDateObj);\n\n\t\t\tif (startDateTimeObj) {\n\t\t\t\tformattedEndDate = startDateTimeObj.date;\n\t\t\t\tformattedEndTime = startDateTimeObj.time;\n\t\t\t}\n\t\t}\n\n\t\tconst eventIsMultipleDays =\n\t\t\tformattedStartDate != formattedEndDate && endDate !== null;\n\n\t\tlet eventInfoString = \"\";\n\n\t\tif (startDate) {\n\t\t\tif (eventIsMultipleDays) {\n\t\t\t\teventInfoString = `${formattedStartDate} - ${formattedEndDate}`;\n\t\t\t} else {\n\t\t\t\teventInfoString = `${formattedStartDate} | ${formattedStartTime} - ${formattedEndTime}`;\n\t\t\t}\n\t\t}\n\n\t\tif (onlineLocation) {\n\t\t\teventInfoString = `${eventInfoString} | ${onlineLocation}`;\n\t\t}\n\n\t\tif (startDate || endDate) {\n\t\t\treturn (\n\t\t\t\t
{eventInfoString}
\n\t\t\t\t{text}
\n\t\t\t\t\t