{"version":3,"sources":["webpack:///./node_modules/date-fns/esm/endOfYear/index.js","webpack:///./node_modules/date-fns/esm/startOfDay/index.js","webpack:///./src/components/ship/detail.jsx","webpack:///./src/templates/detailPages/shipWildcard.jsx"],"names":["endOfYear","dirtyDate","arguments","date","year","getFullYear","setFullYear","setHours","startOfDay","ShipDetail","shipData","products","shippingCompanyId","useState","isImageGalleryActive","setIsImageGalleryActive","showProductButton","setShowProductButton","images","setImages","useBodyClass","useEffect","a","nodes","length","selectedMinDate","selectedMaxDate","searchRequest","url","Date","add","years","officeId","environment","builds","payload","catalogueIds","catalogueId","rooms","index","pax","age","serviceType","searchType","fromDate","format","toDate","productIds","filter","p","content","general","product","tideId","map","host","fetch","method","headers","apiKey","body","JSON","stringify","productsResponse","json","foundProducts","imageList","image","original","addWidthParameter","thumbnail","className","items","useBrowserFullscreen","onScreenChange","showPlayButton","name","shippingCompany","yearManufactured","stars","passengers","dangerouslySetInnerHTML","__html","description","to","target","ShipWildcard","pageContext","page","ship","navigation","cruiseTypes","privacy","data","useContext","GlobalContext","setNavigation","setPrivacy","theme","isTiny","showQsm","Boolean","layout","qsm","isTinted","seo","pageTitle","title","pagePath","path","siteName","websiteName","Helmet"],"mappings":"2FAAA,8DAyBe,SAASA,EAAUC,GAChC,YAAa,EAAGC,WAChB,IAAIC,EAAO,YAAOF,GACdG,EAAOD,EAAKE,cAGhB,OAFAF,EAAKG,YAAYF,EAAO,EAAG,EAAG,GAC9BD,EAAKI,SAAS,GAAI,GAAI,GAAI,KACnBJ,I,kCC/BT,8DAyBe,SAASK,EAAWP,GACjC,YAAa,EAAGC,WAChB,IAAIC,EAAO,YAAOF,GAElB,OADAE,EAAKI,SAAS,EAAG,EAAG,EAAG,GAChBJ,I,6aCpBT,IA8JeM,EA9JI,SAAC,GAA+C,IAAD,EAA5CC,EAA4C,EAA5CA,SAAUC,EAAkC,EAAlCA,SAAUC,EAAwB,EAAxBA,kBAAwB,EACRC,oBAAS,GAA1DC,EADyD,KACnCC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BAAC,IAAD,CACEU,QAAQ,EACRC,QAASC,QAAQb,EAAKtC,QAAQoD,OAAOC,KACrCC,UAAU,EACVb,YAAaA,GAEb,kBAAC,IAAD,CACEc,IAAKhB,EAAKvC,QAAQuD,IAClBC,UAAWjB,EAAKvC,QAAQuD,KAAOhB,EAAKvC,QAAQuD,IAAIE,MAAQlB,EAAKvC,QAAQuD,IAAIE,MAAQnB,EAAKtC,QAAQC,QAAQwD,MACtGC,SAAUpB,EAAKtC,QAAQC,QAAQ0D,KAC/BC,SAAUC,cAAYb,KAExB,kBAACc,EAAA,OAAD,KACE,+BACGvB,EAAKvC,QAAQuD,KAAOhB,EAAKvC,QAAQuD,IAAIE,MAAQlB,EAAKvC,QAAQuD,IAAIE,MAAQnB,EAAKtC,QAAQC,QAAQwD,QAGhG,kBAAC,EAAD,CAAYjG,SAAU+E,EAAM9E,SAAUkF,EAAKlF,SAAUC,kBAAmBA,KAvBnE","file":"component---src-templates-detail-pages-ship-wildcard-jsx-438ce25fe89825c58ce4.js","sourcesContent":["import toDate from '../toDate/index.js';\nimport requiredArgs from '../_lib/requiredArgs/index.js';\n/**\n * @name endOfYear\n * @category Year Helpers\n * @summary Return the end of a year for the given date.\n *\n * @description\n * Return the end of a year for the given date.\n * The result will be in the local timezone.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the original date\n * @returns {Date} the end of a year\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // The end of a year for 2 September 2014 11:55:00:\n * var result = endOfYear(new Date(2014, 8, 2, 11, 55, 00))\n * //=> Wed Dec 31 2014 23:59:59.999\n */\n\nexport default function endOfYear(dirtyDate) {\n requiredArgs(1, arguments);\n var date = toDate(dirtyDate);\n var year = date.getFullYear();\n date.setFullYear(year + 1, 0, 0);\n date.setHours(23, 59, 59, 999);\n return date;\n}","import toDate from '../toDate/index.js';\nimport requiredArgs from '../_lib/requiredArgs/index.js';\n/**\n * @name startOfDay\n * @category Day Helpers\n * @summary Return the start of a day for the given date.\n *\n * @description\n * Return the start of a day for the given date.\n * The result will be in the local timezone.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the original date\n * @returns {Date} the start of a day\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // The start of a day for 2 September 2014 11:55:00:\n * var result = startOfDay(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Tue Sep 02 2014 00:00:00\n */\n\nexport default function startOfDay(dirtyDate) {\n requiredArgs(1, arguments);\n var date = toDate(dirtyDate);\n date.setHours(0, 0, 0, 0);\n return date;\n}","import React, { useEffect, useState } from \"react\";\nimport { addWidthParameter } from \"../../utils/addWidthParameter\";\nimport { useBodyClass } from \"../../utils/bodyClassUtils\";\nimport ReactImageGallery from \"react-image-gallery\";\nimport { add, endOfYear, format, startOfDay } from \"date-fns\";\nimport { apiKey, catalogueId, host } from \"../../settings\";\nimport { environment } from \"../../environments/environment\";\nimport { Link } from \"gatsby\";\n\nconst ShipDetail = ({ shipData, products, shippingCompanyId }) => {\n const [isImageGalleryActive, setIsImageGalleryActive] = useState(false);\n const [showProductButton, setShowProductButton] = useState(false);\n const [images, setImages] = useState([]);\n useBodyClass(isImageGalleryActive, \"has-overlay\");\n\n const handleScreenchange = () => {\n setIsImageGalleryActive(!isImageGalleryActive);\n };\n\n const dateFormat = \"yyyy/MM/dd\";\n\n const fetchProducts = () => {\n const selectedMinDate = startOfDay(new Date());\n const selectedMaxDate = endOfYear(add(new Date(), { years: 2 }));\n\n const searchRequest = {\n officeId: environment.builds[0].officeId,\n payload: { \n catalogueIds: [ catalogueId ],\n rooms: [\n {\n index: 0,\n pax: [\n {\n age: 25\n },\n {\n age: 25\n }\n ]\n }\n ],\n serviceType: 11,\n searchType: 1,\n fromDate: format(selectedMinDate, dateFormat),\n toDate: format(selectedMaxDate, dateFormat),\n productIds: products.nodes\n .filter(p => p.content?.general?.product?.tideId)\n .map(p => p.content.general.product.tideId)\n }\n }\n\n /*const availableProductsRequest = {\n catalogueId: catalogueId,\n language: \"nl-BE\",\n officeId: environment.builds[0].officeId,\n agentId: 0,\n from: format(selectedMinDate, dateFormat),\n to: format(selectedMaxDate, dateFormat),\n calculatePrices: false,\n productType: \"Cruise\",\n productIds: products.nodes\n .filter(p => p.content?.general?.product?.tideId)\n .map(p => p.content.general.product.tideId),\n periodOffset: 0,\n duration: {\n min: 7,\n max: 60,\n },\n flightsIncluded: false,\n ignorePreferredHotels: false,\n travelerGroupings: [\n {\n travelerAges: [25, 25],\n },\n ],\n };*/\n\n const url = `${host}/api/web/booking/v2/search`;\n return fetch(url, {\n method: \"POST\",\n headers: {\n \"Api-Key\": apiKey,\n \"Content-Type\": \"application/json\",\n \"Language\": \"nl-BE\"\n },\n body: JSON.stringify(searchRequest),\n });\n };\n\n useEffect(() => {\n (async () => {\n if (products && products.nodes.length) {\n const productsResponse = await fetchProducts();\n const foundProducts = await productsResponse.json();\n if (foundProducts && foundProducts.length) {\n setShowProductButton(true);\n }\n }\n })();\n }, [products]);\n\n useEffect(() => {\n if (shipData.content?.general?.imageList) {\n setImages(\n shipData.content.general.imageList.map(image => {\n return { original: addWidthParameter(image.url, 1350), thumbnail: addWidthParameter(image.url, 200) };\n })\n );\n }\n }, [shipData]);\n\n return (\n \n \n \n \n \n \n {shipData.content.general.name}\n \n \n Rederij\n {shipData.content.general.shippingCompany?.name}\n \n \n Bouwjaar\n {shipData.content.general.yearManufactured}\n \n \n Aantal sterren\n {shipData.content.general.stars}\n \n \n Passagiers\n {shipData.content.general.passengers}\n \n \n \n \n \n {showProductButton && shippingCompanyId && (\n \n \n \n Toon reizen van deze rederij\n \n \n \n )}\n \n \n \n );\n};\n\nexport default ShipDetail;\n","import { Helmet } from \"react-helmet\";\nimport Layout from \"../layout\";\nimport React, { useContext } from \"react\";\nimport SeoHeaders from \"../../components/seo/seo-headers\";\nimport { websiteName } from \"../../settings\";\nimport { graphql } from \"gatsby\";\nimport GlobalContext from \"../../contexts/global-provider\";\nimport ShipDetail from \"../../components/ship/detail\";\n\nconst ShipWildcard = ({ pageContext: { page, ship, navigation, cruiseTypes, shippingCompanyId, privacy }, data }) => {\n const { setNavigation, setPrivacy, theme } = useContext(GlobalContext);\n setNavigation(navigation);\n setPrivacy(privacy);\n\n if (!ship) {\n return <>>;\n }\n\n // Output\n\n return (\n \n \n \n \n {ship.content.seo && ship.content.seo.title ? ship.content.seo.title : page.content.general.title}\n \n \n \n \n );\n};\n\nexport const query = graphql`\n query ShipWildcardQuery($shippingCompanyId: Int) {\n products: allTideItemForCruise(\n filter: { content: { general: { shippingCompany: { itemId: { eq: $shippingCompanyId } } } } }\n ) {\n nodes {\n content {\n general {\n product {\n tideId\n }\n }\n }\n }\n }\n }\n`;\n\nexport default ShipWildcard;\n"],"sourceRoot":""}
{shipData.content.general.shippingCompany?.name}
{shipData.content.general.yearManufactured}
{shipData.content.general.stars}
{shipData.content.general.passengers}