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U,uBAAuBC,MAAO,CAACE,MAAOtB,IACnDkB,EAAAA,cAAA,KAAGC,UAAU,8BACZP,EAAQF,eACTQ,EAAAA,cAAA,KAAGC,UAAU,4BACbD,EAAAA,cAAA,YAAON,EAAQG,SACfG,EAAAA,cAAA,YAAM,QAERA,EAAAA,cAAA,OAAKC,UAAU,uBAAuBC,MAAO,CAACE,MAAOrB,IAAoChB,GACzFiC,EAAAA,cAAA,OAAKC,UAAU,uBAAuBC,MAAO,CAACC,WAAYnB,EAAwCoB,MAAOnB,IACvGe,EAAAA,cAAA,UAAQc,QAASA,IAAMhB,EAAmBN,EAAiB,IAAI,KAG/DQ,EAAAA,cAAA,YAAOR,GACPQ,EAAAA,cAAA,UAAQc,QAASA,IAAMhB,EAAmBN,EAAiB,IAAI,MAIpD,MAAZnB,EACC2B,EAAAA,cAAA,KAAGC,UAAU,uBAAuBc,KAAMrB,EAAQsB,UAAWd,MAAO,CAACE,MAAMlB,EAAkCiB,WAAYhB,KACtH8B,EAAAA,EAAAA,GAAU,gCAGbjB,EAAAA,cAAA,KACEC,UAAU,sDACVa,QAASA,KAAMI,OAtDjBC,EAAeC,SAASC,eAAe,0BACvCC,EAAkBF,SAASC,eAAe,6BAC9CF,EAAajB,MAAMqB,QAAU,OAC7BD,EAAgBE,UAAUC,IAAI,uCAE9BC,OAAOC,SAAS,CACdC,IAAKN,EAAgBO,UAAY,GACjCC,SAAU,WARWC,IACnBZ,EACAG,CAqDmC,EACjCpB,MAAO,CAACE,MAAMlB,EAAkCiB,WAAYhB,KAE3D8B,EAAAA,EAAAA,GAAU,gCAGfjB,EAAAA,cAAA,OAAKC,UAAU,uBAAuBC,MAAO,CAACE,MAAOhB,IAAoChB,GACrF,C","sources":["webpack:///./Scripts/Components/CustomBundle.js"],"sourcesContent":["import React, { useState } from 'react';\nimport { translate } from '../Services/translation';\n\nconst CustomBundle = ({\n amountHeaderText,\n body,\n doubleFlightTimeText,\n header,\n highFlyText,\n noticeText,\n location,\n variants,\n customBundleBlockBackgroundColor,\n customBundleBlockHeaderTextColor,\n customBundleBlockHeaderBackgroundColor,\n customBundleBlockBodyBackgroundColor,\n customBundleBlockBodyTextColor,\n customBundleBlockDoubleTextColor,\n customBundleBlockPriceTextColor,\n customBundleBlockPeopleTextColor,\n customBundleBlockAmountTextColor,\n customBundleBlockPickerBackgroundColor,\n customBundleBlockPickerTextColor,\n customBundleBlockButtonTextColor,\n customBundleBlockButtonBackgroundColor,\n customBundleBlockNoticeTextColor,\n\n }) => {\n const [doubleTime, setDoubleTime] = useState(false);\n const [numberOfPeople, setNumberOfPeople] = useState(2);\n let variant = variants.find(\n (v) =>\n v.numberOfPeople === numberOfPeople &&\n v.minutes === numberOfPeople * (doubleTime ? 4 : 2),\n );\n const handleDoubleTimeChange = () => {\n if (!doubleTime && numberOfPeople > 6) setNumberOfPeople(6);\n setDoubleTime(!doubleTime);\n };\n const handlePickerChange = (newValue) => {\n if (newValue < 1) return;\n if (newValue > 6 && doubleTime) return;\n if (newValue > 13 && !doubleTime) return;\n\n setNumberOfPeople(newValue);\n };\n\n const onClickDisabled = (e) => {\n var errorElement = document.getElementById('bundles-location-error');\n var selectorElement = document.getElementById('bundles-location-selector');\n errorElement.style.display = 'flex';\n selectorElement.classList.add('bundles__locationpicker--error');\n\n window.scrollTo({\n top: selectorElement.offsetTop - 25,\n behavior: 'smooth',\n });\n };\n\n return (\n
\n
{header}
\n
\n \"\"\n
\n
{body}
\n
\n \n
\n
{variant.price}
\n
\n \n {variant.numberOfPeople}\n \n {variant.minutes}\n x60\n
\n
{amountHeaderText}
\n
\n \n {numberOfPeople}\n \n
\n {location != null ? (\n \n {translate('blocks.custom-bundle.choose')}\n \n ) : (\n onClickDisabled()}\n style={{color:customBundleBlockButtonTextColor, background: customBundleBlockButtonBackgroundColor }}\n >\n {translate('blocks.custom-bundle.choose')}\n \n )}\n
{noticeText}
\n
\n );\n};\n\nexport default CustomBundle;\n"],"names":["CustomBundle","amountHeaderText","body","doubleFlightTimeText","header","highFlyText","noticeText","location","variants","customBundleBlockBackgroundColor","customBundleBlockHeaderTextColor","customBundleBlockHeaderBackgroundColor","customBundleBlockBodyBackgroundColor","customBundleBlockBodyTextColor","customBundleBlockDoubleTextColor","customBundleBlockPriceTextColor","customBundleBlockPeopleTextColor","customBundleBlockAmountTextColor","customBundleBlockPickerBackgroundColor","customBundleBlockPickerTextColor","customBundleBlockButtonTextColor","customBundleBlockButtonBackgroundColor","customBundleBlockNoticeTextColor","doubleTime","setDoubleTime","useState","numberOfPeople","setNumberOfPeople","variant","find","v","minutes","handlePickerChange","newValue","React","className","style","background","color","backgroundColor","src","alt","id","type","checked","onChange","handleDoubleTimeChange","price","onClick","href","actionUrl","translate","onClickDisabled","errorElement","document","getElementById","selectorElement","display","classList","add","window","scrollTo","top","offsetTop","behavior","e"],"sourceRoot":""}