@tfehotels/tfe-gatsby-library 1.0.69 → 1.0.71

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
- "use strict";function e(e=9){const t="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";let s="";for(let r=0;r<e;r++)s+=t.charAt(Math.floor(62*Math.random()));return s}const t=(e,t)=>`${e.replace(new RegExp("/$"),"")}/${t.replace(new RegExp("^/"),"")}`,s=module.require("slugify"),r=module.require("fs"),a=module.require("path"),n=async e=>{let t=[];e=(e=>{const t=process.env.HOST.replace(/^(test\.|staging\.)/,"");if(e.data?.metas?.[t]?.[e.language])for(const[s,r]of Object.entries(e.data.metas[t][e.language]))"title"!==s?e.head.metas[s]=r:e.head.title=r;return e})(e);for(const s of e.body)t.push(await i(s,{slug:e.slug,tags:e.tags,data:e.data}));return e.body=t,e},o=(e,t,s)=>{const a=[...s,...JSON.parse(r.readFileSync(`${process.env.GATSBY_PROJECT_ROOT}/src/data/pages/redirections.json`,"utf-8"))];t&&a.push({page:"/",redirection:`${process.env.PROTOCOL}://${process.env.HOST}/en/`,type:"301"}),a.forEach((t=>{e({fromPath:t.page,toPath:t.redirection,isPermanent:"301"===t.type,redirectInBrowser:t.redirectInBrowser,force:!0})}))},i=async(e,t)=>{const s=`${process.env.GATSBY_PROJECT_ROOT}/src/components/element/${e.type}/${e.name}/build.js`;if(r.existsSync(s)){const r=await import(s);if(r?.build)return await r.build(e,t)}else"development"===process.env.ENV&&console.warn(`build.js file not found: ${s}`);return e},{getImage:c,withArtDirection:p}=module.require("gatsby-plugin-image"),l=module.require("fs"),g=module.require("path"),u=(e="",s=null)=>`${t(`${process.env.API_PROTOCOL}://${process.env.API_HOST}`,e)}${s?`?${new URLSearchParams(s).toString()}`:""}`,d=e=>{if(!e)return;let t={src:e.url,sizes:"100vw",srcSet:""},s=[],r={fallback:e.url};const a=[e.width,360,769,1024,1216,1408].sort(((e,t)=>e-t));if(e.optimized){t.src=e.url+e.name+"-"+e.width+"w.jpg",r.fallback=e.url+e.name+"-20w.jpg",s.push({sizes:"100vw",srcSet:"",type:"image/avif"}),s.push({sizes:"100vw",srcSet:"",type:"image/webp"});for(let r in a){if(a[r]>e.width)break;let n=("0"===r?"":",")+e.url+e.name+"-"+a[r];t.srcSet+=n+"w.jpg "+a[r]+"w",s[0].srcSet+=n+"w.avif "+a[r]+"w",s[1].srcSet+=n+"w.webp "+a[r]+"w"}}return c({childImageSharp:{gatsbyImageData:{backgroundColor:"transparent",height:e.height/e.width,width:1,layout:"fullWidth",placeholder:r,images:{fallback:t,sources:s}}}})},O=(e,t)=>{const s=d(e),r=d(t);return s&&r?p(s,[{media:"(max-width: 768px)",image:r}]):s},m=require("fs");exports.apiLink=u,exports.buildElement=i,exports.buildImage=d,exports.createAPIPages=async e=>{if(!process.env.GATSBY_PROJECT_ROOT)throw new Error('Please define "process.env.GATSBY_PROJECT_ROOT = __dirname" within the ./gatsby-config.js file.');const t=JSON.parse(r.readFileSync(`${process.env.GATSBY_PROJECT_ROOT}/src/data/projectMetadata.json`,"utf-8")),s=t.languages.length>1,{createPage:a,createRedirect:i}=e;let c=[],p=[];for(const e of t.languages){const t=JSON.parse(r.readFileSync(`${process.env.GATSBY_PROJECT_ROOT}/src/data/pages/site-${e}.json`,"utf-8"));for(const r of t){if(r.is_hidden&&p.push(r.slug),!r.is_active)continue;if(s&&r.redirect_to_english&&"en"!==e){c.push({page:r.slug,redirection:`${process.env.PROTOCOL}://${process.env.HOST}/en/${r.slug.slice(4)}`,type:"302",redirectInBrowser:!0});continue}if(process.env.DEV_PAGE&&r.id!==parseInt(`${process.env.DEV_PAGE}`)){console.warn("DEV_PAGE is defined on .env.development file! Only one page will be generated!");continue}const t=require.resolve(`${process.env.GATSBY_PROJECT_ROOT}/src/components/page/index.tsx`),o=await n(r);a({path:r.slug,component:t,context:o}),s&&"/en/404/"===r.slug&&a({path:"/404/",component:t,context:o})}}o(i,s,c),r.writeFileSync(`${process.env.GATSBY_PROJECT_ROOT}/src/data/pages/excluded.json`,JSON.stringify(p))},exports.createWebpackConfig=({actions:e,getConfig:t})=>{const s=t();let r={...s.resolve.alias,"react-google-recaptcha-v3":a.resolve(process.env.GATSBY_PROJECT_ROOT,"node_modules","react-google-recaptcha-v3")};s.resolve={...s.resolve,alias:r},e.replaceWebpackConfig(s)},exports.dealLink=e=>{if(!process.env.DEALS_ROOT_SLUG)throw new Error("The env variable DEALS_ROOT_SLUG is not defined!");return t(process.env.DEALS_ROOT_SLUG,e)},exports.defaultGatsbyConfig=(e={},t=[])=>{if(!process.env.GATSBY_PROJECT_ROOT)throw new Error('Please define "process.env.GATSBY_PROJECT_ROOT = __dirname" within the ./gatsby-config.js file.');const s=process.env.GATSBY_PROJECT_ROOT,r=JSON.parse(m.readFileSync(`${s}/src/data/projectMetadata.json`,"utf-8")),a=r.languages.length>1;return a&&(t.push({resolve:"gatsby-source-filesystem",options:{path:`${s}/locales`,name:"locale"}}),t.push({resolve:"gatsby-plugin-react-i18next",options:{localeJsonSourceName:"locale",defaultLanguage:process.env.PROJECT_DEFAULT_LANGUAGE,fallbackLng:process.env.PROJECT_DEFAULT_LANGUAGE,languages:r.languages,siteUrl:`${process.env.PROTOCOL}://${process.env.HOST}`,trailingSlash:"always",i18nextOptions:{interpolation:{escapeValue:!1},keySeparator:!1,nsSeparator:!1,react:{transSupportBasicHtmlNodes:!0,transKeepBasicHtmlNodesFor:["a","br","span","strong","i","p","ul","li","h1","h2","h3","h4","h5"]}},redirect:!1,pages:[{matchPath:"/:lang?/(.*)",getLanguageFromPath:!0,languages:r.languages}]}})),{siteMetadata:{title:process.env.SITE_TITLE,description:process.env.SITE_DESCRIPTION,siteUrl:`${process.env.PROTOCOL}://${process.env.HOST}`,image:process.env.SITE_IMAGE,protocol:process.env.PROTOCOL,domain:process.env.HOST},plugins:["gatsby-plugin-image","gatsby-plugin-use-query-params","gatsby-plugin-svgr","gatsby-transformer-sharp","gatsby-plugin-sass",{resolve:"gatsby-plugin-manifest",options:{name:r.name,short_name:r.name,lang:process.env.PROJECT_DEFAULT_LANGUAGE,background_color:r.background_colour,theme_color:r.colour,start_url:"/",display:"standalone",icon:process.env.PROJECT_ICON??"static/icons/favicon.png"}},{resolve:"gatsby-plugin-sharp",options:{defaults:{formats:["auto","webp","avif"],placeholder:"blurred",quality:80,breakpoints:[360,769,1024,1216,1408],backgroundColor:"transparent",tracedSVGOptions:{},blurredOptions:{},jpgOptions:{},pngOptions:{},webpOptions:{},avifOptions:{}}}},{resolve:"gatsby-source-apiserver",options:{typePrefix:"API__",method:"get",allowCache:!1,headers:{"Content-Type":"application/json"},data:{},params:{},verboseOutput:!1,entitiesArray:[{url:`${process.env.API_PROTOCOL}://${process.env.API_HOST}/v1/${process.env.PROJECT}/redirection/`,headers:{"Content-Type":"application/json"},name:"redirections",skipCreateNode:!0,localSave:!0,path:`${s}/src/data/pages/`},...r.languages.map((e=>({url:`${process.env.API_PROTOCOL}://${process.env.API_HOST}/v1/${process.env.PROJECT}/full-content/?language=${e}`,headers:{"Content-Type":"application/json"},name:`site-${e}`,skipCreateNode:!0,localSave:!0,path:`${s}/src/data/pages/`})))]}},{resolve:"gatsby-plugin-s3",options:{bucketName:process.env.S3_BUCKET,protocol:process.env.PROTOCOL,hostname:process.env.HOST,generateRoutingRules:!0,generateRedirectObjectsForPermanentRedirects:!0,acl:"private"}},{resolve:"gatsby-plugin-sitemap",options:{excludes:["/404/","/**/404/",a?"/":""],query:"\n {\n allSitePage {\n nodes {\n path\n pageContext\n }\n }\n }\n ",resolveSiteUrl:()=>`${process.env.PROTOCOL}://${process.env.HOST}`,filterPages:e=>e.is_hidden,serialize:(e,{resolvePagePath:t})=>{const s={url:t(e),lastmod:e.pageContext.published_at};return a&&(s.links=r.languages.reduce(((t,r)=>(e.pageContext.redirect_to_english&&"en"!==r||t.push({lang:r,url:s.url.replace(/^\/[a-z]{2}\//,`/${r}/`)}),t)),[{lang:"x-default",url:s.url.replace(/^\/[a-z]{2}\//,`/${process.env.PROJECT_DEFAULT_LANGUAGE}/`)}])),s}}},{resolve:"gatsby-plugin-google-tagmanager",options:{id:process.env.GTM_ID}},{resolve:"gatsby-plugin-newrelic",options:{config:{instrumentationType:"proAndSPA",accountId:process.env.NEWRELIC_ACCOUNT_ID,trustKey:process.env.NEWRELIC_TRUST_KEY,agentID:process.env.NEWRELIC_AGENT_ID,licenseKey:process.env.NEWRELIC_LICENSE_KEY,applicationID:process.env.NEWRELIC_APP_ID,beacon:"bam.nr-data.net",errorBeacon:"bam.nr-data.net"}}},...t],...e}},exports.extractForm=e=>{let t={settings:{pk:0,name:"",form_method:"post",form_submit:u("/v1/project/request/contact"),form_redirection:null,form_ajax_request:null,recaptcha_action:"",recaptcha_v3:!1},items:[],fields:{}};t.settings.recaptcha_v3=!!e.recaptcha_v3,t.settings.recaptcha_action=e.data.recaptcha_action??e.name,t.settings.pk=e.pk,t.settings.name=e.name,["form_submit","form_recipient","form_method","form_redirection","form_ajax_request","form_success_msg"].map((s=>{e.hasOwnProperty(s)&&(t.settings[s]=e[s])}));const s=new Set(["checkbox","input","select","button","google-places","country-prefix","country","textarea","recaptcha2","title","text","link","image"]);let r=0;const a=(e,s)=>{let r=t.items;for(let t of e)r=r[t],Array.isArray(r)||(r=r.children);r.push(s)},n=(e,o,i)=>{let c=e.input_name&&!t.fields[e.input_name]?e.input_name:e.name??`${e.type}${r++}`;if("section"===e.type){const t=e.name??`sec_${o.length}-${i}`;a(o,{name:t,children:[]}),e.children.map(((e,t)=>n(e,[...o,i],t)))}else s.has(e.type)&&(a(o,c),t.fields[c]=e,"image"===e.type&&(t.fields[c].imageData=O(e.image,e.mobile_image)))};return e.children.map(((e,t)=>n(e,[],t))),t},exports.fetchProjectMetadata=async e=>{const t=`${process.env.API_PROTOCOL}://${process.env.API_HOST}/v1/${process.env.PROJECT}/`;try{const s=await fetch(t);if(!s.ok)throw new Error(`Failed to fetch project metadata data from "${t}": ${s.statusText}`);const r=await s.json(),a=`${e}/src/data/`,n="projectMetadata.json";l.writeFileSync(g.resolve(a,n),JSON.stringify(r,null,2)),console.log(`success Project metadata fetched and saved to:\r\n"${a}${n}"`)}catch(e){console.error(`Error fetching project metadata from "${t}" data:\r\n`,e),process.exit(1)}},exports.getImageData=O,exports.hotelOptionsByCity=e=>{let t={Sydney:[],Melbourne:[],Brisbane:[],Perth:[],Hobart:[],Canberra:[],Adelaide:[],"Gold Coast":[],Darwin:[],Auckland:[],Wellington:[],Singapore:[]};const s=Object.entries(e).reduce(((e,[s,r])=>(t[r.city]?t[r.city].push({label:r.name,value:s}):t[r.city]=[{label:r.name,value:s}],e[s]=r.sort,e)),{});return Object.entries(t).map((([e,t])=>({label:e,options:t.sort(((e,t)=>s[e.value]-s[t.value]))})))},exports.hotelPageLink=(e,t,r="en")=>{const a={TRA:{root:`/book-accommodation/${s(e,{lower:!0})}`,slice:11},VIB:{root:`/book-accommodation/${s(e,{lower:!0})}`,slice:5},ADI:{root:`/${r}/apartments/`,slice:22}};return`${a[process.env.PROJECT].root}/${s(t,{lower:!0}).slice(a[process.env.PROJECT].slice)}`},exports.joinAddress=e=>e.reduce(((e,t)=>(t&&e.push(t),e)),[]).join(", "),exports.joinPaths=t,exports.nOptions=(e,t=0,s={})=>{const r={...s};for(let s=t;s<t+e;s++)r[s.toString()]=s.toString();return r},exports.opentableLink=t=>`https://www.opentable.com.au/restref/client?rid=${t}&restref=${t}&lang=en-AU&r3uid=${e(9)}&ot_source=Restaurant+website&color=1`,exports.postBuild=()=>{const e=JSON.parse(r.readFileSync(`${process.env.GATSBY_PROJECT_ROOT}/src/data/pages/excluded.json`,"utf-8")),t=["User-agent: *",""+("production"===process.env.ENV?"Allow: /":"Disallow: /"),`${e.length?e.map((e=>`Disallow: ${e}`)).join("\n"):""}`,`Sitemap: ${process.env.PROTOCOL}://${process.env.HOST}/sitemap/sitemap-index.xml`,`Host: ${process.env.PROTOCOL}://${process.env.HOST}`];r.writeFileSync(`${process.env.GATSBY_PROJECT_ROOT}/public/robots.txt`,t.join("\n"))},exports.randomString=e,exports.ssoURL=e=>`${process.env.SABRE_SSO_PROTOCOL}://${process.env.SABRE_SSO_HOST}${e}`,exports.tagExists=(e,...t)=>{for(const s of Object.keys(e))if(t.includes(s))return!0;return!1},exports.tripadvisorRatingURL=e=>`https://www.tripadvisor.com/img/cdsi/img2/ratings/traveler/${parseFloat(e).toFixed(1)}-41022-5.svg`;
1
+ "use strict";function e(e=9){const t="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";let s="";for(let r=0;r<e;r++)s+=t.charAt(Math.floor(62*Math.random()));return s}const t=(e,t)=>`${e.replace(new RegExp("/$"),"")}/${t.replace(new RegExp("^/"),"")}`,s=module.require("slugify"),r=module.require("fs"),a=module.require("path"),n=async e=>{let t=[];e=(e=>{const t=process.env.HOST.replace(/^(test\.|staging\.)/,"");if(e.data?.metas?.[t]?.[e.language])for(const[s,r]of Object.entries(e.data.metas[t][e.language]))"title"!==s?e.head.metas[s]=r:e.head.title=r;return e})(e);for(const s of e.body)t.push(await i(s,{slug:e.slug,tags:e.tags,data:e.data}));return e.body=t,e},o=(e,t,s)=>{const a=[...s,...JSON.parse(r.readFileSync(`${process.env.GATSBY_PROJECT_ROOT}/src/data/pages/redirections.json`,"utf-8"))];t&&a.push({page:"/",redirection:`${process.env.PROTOCOL}://${process.env.HOST}/en/`,type:"301"}),a.forEach((t=>{e({fromPath:t.page,toPath:t.redirection,isPermanent:"301"===t.type,redirectInBrowser:t.redirectInBrowser,force:!0})}))},i=async(e,t)=>{const s=`${process.env.GATSBY_PROJECT_ROOT}/src/components/element/${e.type}/${e.name}/build.js`;if(r.existsSync(s)){const r=await import(s);if(r?.build)return await r.build(e,t)}else"development"===process.env.ENV&&console.warn(`build.js file not found: ${s}`);return e},{getImage:c,withArtDirection:p}=module.require("gatsby-plugin-image"),l=module.require("fs"),g=module.require("path"),u=(e="",s=null)=>`${t(`${process.env.API_PROTOCOL}://${process.env.API_HOST}`,e)}${s?`?${new URLSearchParams(s).toString()}`:""}`,d=e=>{if(!e)return;let t={src:e.url,sizes:"100vw",srcSet:""},s=[],r={fallback:e.url};const a=[e.width,360,769,1024,1216,1408].sort(((e,t)=>e-t));if(e.optimized){t.src=e.url+e.name+"-"+e.width+"w.jpg",r.fallback=e.url+e.name+"-20w.jpg",s.push({sizes:"100vw",srcSet:"",type:"image/avif"}),s.push({sizes:"100vw",srcSet:"",type:"image/webp"});for(let r in a){if(a[r]>e.width)break;let n=("0"===r?"":",")+e.url+e.name+"-"+a[r];t.srcSet+=n+"w.jpg "+a[r]+"w",s[0].srcSet+=n+"w.avif "+a[r]+"w",s[1].srcSet+=n+"w.webp "+a[r]+"w"}}return c({childImageSharp:{gatsbyImageData:{backgroundColor:"transparent",height:e.height/e.width,width:1,layout:"fullWidth",placeholder:r,images:{fallback:t,sources:s}}}})},O=(e,t)=>{const s=d(e),r=d(t);return s&&r?p(s,[{media:"(max-width: 768px)",image:r}]):s},m=require("fs");exports.apiLink=u,exports.buildElement=i,exports.buildImage=d,exports.createAPIPages=async e=>{if(!process.env.GATSBY_PROJECT_ROOT)throw new Error('Please define "process.env.GATSBY_PROJECT_ROOT = __dirname" within the ./gatsby-config.js file.');const t=JSON.parse(r.readFileSync(`${process.env.GATSBY_PROJECT_ROOT}/src/data/projectMetadata.json`,"utf-8")),s=t.languages.length>1,{createPage:a,createRedirect:i}=e;let c=[],p=[];for(const e of t.languages){const t=JSON.parse(r.readFileSync(`${process.env.GATSBY_PROJECT_ROOT}/src/data/pages/site-${e}.json`,"utf-8"));for(const r of t){if(r.is_hidden&&p.push(r.slug),!r.is_active)continue;if(s&&r.redirect_to_english&&"en"!==e){c.push({page:r.slug,redirection:`${process.env.PROTOCOL}://${process.env.HOST}/en/${r.slug.slice(4)}`,type:"302",redirectInBrowser:!0});continue}if(process.env.DEV_PAGE&&r.id!==parseInt(`${process.env.DEV_PAGE}`)){console.warn("DEV_PAGE is defined on .env.development file! Only one page will be generated!");continue}const t=require.resolve(`${process.env.GATSBY_PROJECT_ROOT}/src/components/page/index.tsx`),o=await n(r);a({path:r.slug,component:t,context:o}),s&&"/en/404/"===r.slug&&a({path:"/404/",component:t,context:o})}}o(i,s,c),r.writeFileSync(`${process.env.GATSBY_PROJECT_ROOT}/src/data/pages/excluded.json`,JSON.stringify(p))},exports.createWebpackConfig=({actions:e,getConfig:t})=>{const s=t();let r={...s.resolve.alias,"react-google-recaptcha-v3":a.resolve(process.env.GATSBY_PROJECT_ROOT,"node_modules","react-google-recaptcha-v3")};s.resolve={...s.resolve,alias:r},e.replaceWebpackConfig(s)},exports.dealLink=e=>{if(!process.env.DEALS_ROOT_SLUG)throw new Error("The env variable DEALS_ROOT_SLUG is not defined!");return t(process.env.DEALS_ROOT_SLUG,e)},exports.defaultGatsbyConfig=(e={},t=[])=>{if(!process.env.GATSBY_PROJECT_ROOT)throw new Error('Please define "process.env.GATSBY_PROJECT_ROOT = __dirname" within the ./gatsby-config.js file.');const s=process.env.GATSBY_PROJECT_ROOT,r=JSON.parse(m.readFileSync(`${s}/src/data/projectMetadata.json`,"utf-8")),a=r.languages.length>1;return a&&(t.push({resolve:"gatsby-source-filesystem",options:{path:`${s}/locales`,name:"locale"}}),t.push({resolve:"gatsby-plugin-react-i18next",options:{localeJsonSourceName:"locale",defaultLanguage:process.env.PROJECT_DEFAULT_LANGUAGE,fallbackLng:process.env.PROJECT_DEFAULT_LANGUAGE,languages:r.languages,siteUrl:`${process.env.PROTOCOL}://${process.env.HOST}`,trailingSlash:"always",i18nextOptions:{interpolation:{escapeValue:!1},keySeparator:!1,nsSeparator:!1,react:{transSupportBasicHtmlNodes:!0,transKeepBasicHtmlNodesFor:["a","br","span","strong","i","p","ul","li","h1","h2","h3","h4","h5"]}},redirect:!1,pages:[{matchPath:"/:lang?/(.*)",getLanguageFromPath:!0,languages:r.languages}]}})),{siteMetadata:{title:process.env.SITE_TITLE,description:process.env.SITE_DESCRIPTION,siteUrl:`${process.env.PROTOCOL}://${process.env.HOST}`,image:process.env.SITE_IMAGE,protocol:process.env.PROTOCOL,domain:process.env.HOST},plugins:["gatsby-plugin-image","gatsby-plugin-use-query-params","gatsby-plugin-svgr","gatsby-transformer-sharp","gatsby-plugin-sass",{resolve:"gatsby-plugin-manifest",options:{name:r.name,short_name:r.name,lang:process.env.PROJECT_DEFAULT_LANGUAGE,background_color:r.background_colour,theme_color:r.colour,start_url:"/",display:"standalone",icon:process.env.PROJECT_ICON??"static/icons/favicon.png"}},{resolve:"gatsby-plugin-sharp",options:{defaults:{formats:["auto","webp","avif"],placeholder:"blurred",quality:80,breakpoints:[360,769,1024,1216,1408],backgroundColor:"transparent",tracedSVGOptions:{},blurredOptions:{},jpgOptions:{},pngOptions:{},webpOptions:{},avifOptions:{}}}},{resolve:"gatsby-source-apiserver",options:{typePrefix:"API__",method:"get",allowCache:!1,headers:{"Content-Type":"application/json"},data:{},params:{},verboseOutput:!1,entitiesArray:[{url:`${process.env.API_PROTOCOL}://${process.env.API_HOST}/v1/${process.env.PROJECT}/redirection/`,headers:{"Content-Type":"application/json"},name:"redirections",skipCreateNode:!0,localSave:!0,path:`${s}/src/data/pages/`},...r.languages.map((e=>({url:`${process.env.API_PROTOCOL}://${process.env.API_HOST}/v1/${process.env.PROJECT}/full-content/?language=${e}`,headers:{"Content-Type":"application/json"},name:`site-${e}`,skipCreateNode:!0,localSave:!0,path:`${s}/src/data/pages/`})))]}},{resolve:"gatsby-plugin-s3",options:{bucketName:process.env.S3_BUCKET,protocol:process.env.PROTOCOL,hostname:process.env.HOST,generateRoutingRules:!0,generateRedirectObjectsForPermanentRedirects:!0,acl:"private"}},{resolve:"gatsby-plugin-sitemap",options:{excludes:["/404/","/**/404/",a?"/":""],query:"\n {\n allSitePage {\n nodes {\n path\n pageContext\n }\n }\n }\n ",resolveSiteUrl:()=>`${process.env.PROTOCOL}://${process.env.HOST}`,filterPages:e=>e.pageContext.is_hidden,serialize:(e,{resolvePagePath:t})=>{const s={url:t(e),lastmod:e.pageContext.published_at};return a&&(s.links=r.languages.reduce(((t,r)=>(e.pageContext.redirect_to_english&&"en"!==r||t.push({lang:r,url:s.url.replace(/^\/[a-z]{2}\//,`/${r}/`)}),t)),[{lang:"x-default",url:s.url.replace(/^\/[a-z]{2}\//,`/${process.env.PROJECT_DEFAULT_LANGUAGE}/`)}])),s}}},{resolve:"gatsby-plugin-google-tagmanager",options:{id:process.env.GTM_ID}},{resolve:"gatsby-plugin-newrelic",options:{config:{instrumentationType:"proAndSPA",accountId:process.env.NEWRELIC_ACCOUNT_ID,trustKey:process.env.NEWRELIC_TRUST_KEY,agentID:process.env.NEWRELIC_AGENT_ID,licenseKey:process.env.NEWRELIC_LICENSE_KEY,applicationID:process.env.NEWRELIC_APP_ID,beacon:"bam.nr-data.net",errorBeacon:"bam.nr-data.net"}}},...t],...e}},exports.extractForm=e=>{let t={settings:{pk:0,name:"",form_method:"post",form_submit:u("/v1/project/request/contact"),form_redirection:null,form_ajax_request:null,recaptcha_action:"",recaptcha_v3:!1},items:[],fields:{}};t.settings.recaptcha_v3=!!e.recaptcha_v3,t.settings.recaptcha_action=e.data.recaptcha_action??e.name,t.settings.pk=e.pk,t.settings.name=e.name,["form_submit","form_recipient","form_method","form_redirection","form_ajax_request","form_success_msg"].map((s=>{e.hasOwnProperty(s)&&(t.settings[s]=e[s])}));const s=new Set(["checkbox","input","select","button","google-places","country-prefix","country","textarea","recaptcha2","title","text","link","image"]);let r=0;const a=(e,s)=>{let r=t.items;for(let t of e)r=r[t],Array.isArray(r)||(r=r.children);r.push(s)},n=(e,o,i)=>{let c=e.input_name&&!t.fields[e.input_name]?e.input_name:e.name??`${e.type}${r++}`;if("section"===e.type){const t=e.name??`sec_${o.length}-${i}`;a(o,{name:t,children:[]}),e.children.map(((e,t)=>n(e,[...o,i],t)))}else s.has(e.type)&&(a(o,c),t.fields[c]=e,"image"===e.type&&(t.fields[c].imageData=O(e.image,e.mobile_image)))};return e.children.map(((e,t)=>n(e,[],t))),t},exports.fetchProjectMetadata=async e=>{const t=`${process.env.API_PROTOCOL}://${process.env.API_HOST}/v1/${process.env.PROJECT}/`;try{const s=await fetch(t);if(!s.ok)throw new Error(`Failed to fetch project metadata data from "${t}": ${s.statusText}`);const r=await s.json(),a=`${e}/src/data/`,n="projectMetadata.json";l.writeFileSync(g.resolve(a,n),JSON.stringify(r,null,2)),console.log(`success Project metadata fetched and saved to:\r\n"${a}${n}"`)}catch(e){console.error(`Error fetching project metadata from "${t}" data:\r\n`,e),process.exit(1)}},exports.getImageData=O,exports.hotelOptionsByCity=e=>{let t={Sydney:[],Melbourne:[],Brisbane:[],Perth:[],Hobart:[],Canberra:[],Adelaide:[],"Gold Coast":[],Darwin:[],Auckland:[],Wellington:[],Singapore:[]};const s=Object.entries(e).reduce(((e,[s,r])=>(t[r.city]?t[r.city].push({label:r.name,value:s}):t[r.city]=[{label:r.name,value:s}],e[s]=r.sort,e)),{});return Object.entries(t).map((([e,t])=>({label:e,options:t.sort(((e,t)=>s[e.value]-s[t.value]))})))},exports.hotelPageLink=(e,t,r="en")=>{const a={TRA:{root:`/book-accommodation/${s(e,{lower:!0})}`,slice:11},VIB:{root:`/book-accommodation/${s(e,{lower:!0})}`,slice:5},ADI:{root:`/${r}/apartments/`,slice:22}};return`${a[process.env.PROJECT].root}/${s(t,{lower:!0}).slice(a[process.env.PROJECT].slice)}`},exports.joinAddress=e=>e.reduce(((e,t)=>(t&&e.push(t),e)),[]).join(", "),exports.joinPaths=t,exports.nOptions=(e,t=0,s={})=>{const r={...s};for(let s=t;s<t+e;s++)r[s.toString()]=s.toString();return r},exports.opentableLink=t=>`https://www.opentable.com.au/restref/client?rid=${t}&restref=${t}&lang=en-AU&r3uid=${e(9)}&ot_source=Restaurant+website&color=1`,exports.postBuild=()=>{const e=JSON.parse(r.readFileSync(`${process.env.GATSBY_PROJECT_ROOT}/src/data/pages/excluded.json`,"utf-8")),t=["User-agent: *",""+("production"===process.env.ENV?"Allow: /":"Disallow: /"),`${e.length?e.map((e=>`Disallow: ${e}`)).join("\n"):""}`,`Sitemap: ${process.env.PROTOCOL}://${process.env.HOST}/sitemap/sitemap-index.xml`,`Host: ${process.env.PROTOCOL}://${process.env.HOST}`];r.writeFileSync(`${process.env.GATSBY_PROJECT_ROOT}/public/robots.txt`,t.join("\n"))},exports.randomString=e,exports.ssoURL=e=>`${process.env.SABRE_SSO_PROTOCOL}://${process.env.SABRE_SSO_HOST}${e}`,exports.tagExists=(e,...t)=>{for(const s of Object.keys(e))if(t.includes(s))return!0;return!1},exports.tripadvisorRatingURL=e=>`https://www.tripadvisor.com/img/cdsi/img2/ratings/traveler/${parseFloat(e).toFixed(1)}-41022-5.svg`;
2
2
  //# sourceMappingURL=index.node.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.node.cjs","sources":["../src/node/string/index.ts","../src/node/url/index.ts","../src/node/property/index.ts","../src/node/build/index.ts","../src/node/api/index.ts","../src/node/config/index.ts","../src/node/form/index.ts"],"sourcesContent":["export function randomString(length: number = 9): string {\n const characters =\n \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\";\n let result = \"\";\n for (let i = 0; i < length; i++) {\n result += characters.charAt(Math.floor(Math.random() * characters.length));\n }\n return result;\n}\n","import { randomString } from \"../string\";\n\nexport const joinPaths = (path1: string, path2: string): string =>\n `${path1.replace(new RegExp(`/$`), \"\")}/${path2.replace(\n new RegExp(`^/`),\n \"\"\n )}`;\n\nexport const dealLink = (dealSlug: string): string => {\n if (!process.env.DEALS_ROOT_SLUG)\n throw new Error(\"The env variable DEALS_ROOT_SLUG is not defined!\");\n return joinPaths(process.env.DEALS_ROOT_SLUG as string, dealSlug);\n};\n\nexport const ssoURL = (path: string) =>\n `${process.env.SABRE_SSO_PROTOCOL}://${process.env.SABRE_SSO_HOST}${path}`;\n\nexport const tripadvisorRatingURL = (score: string) =>\n `https://www.tripadvisor.com/img/cdsi/img2/ratings/traveler/${parseFloat(\n score\n ).toFixed(1)}-41022-5.svg`;\n\nexport const opentableLink = (id: number): string =>\n `https://www.opentable.com.au/restref/client?rid=${id}&restref=${id}&lang=en-AU&r3uid=${randomString(\n 9\n )}&ot_source=Restaurant+website&color=1`;\n","const slugify = module.require(\"slugify\");\nimport { HotelOptionsByCityType, HotelPagesType, CityKeyType } from \"./types\";\n\n/**\n *\n * Returns Select options sorting by the cities with more hotels, otherwise alphabetically.\n *\n * For instance:\n *\n * [\n * {\n * label: 'Sydney',\n * options: [\n * { label: 'Vibe Hotel Sydney', value: \"58443\" },\n * { label: 'Vibe Hotel Sydney Darling Harbour', value: \"8565\" }\n * ]\n * },\n * {\n * label: 'Mebourne',\n * options: [\n * { label: 'Vibe Hotel Melbourne', value: \"9969\" },\n * ]\n * },\n * ]\n */\nexport const hotelOptionsByCity = (\n hotelPages: HotelPagesType\n): HotelOptionsByCityType[] => {\n let hotelsByCity: Record<CityKeyType, { value: string; label: string }[]> = {\n Sydney: [],\n Melbourne: [],\n Brisbane: [],\n Perth: [],\n Hobart: [],\n Canberra: [],\n Adelaide: [],\n \"Gold Coast\": [],\n Darwin: [],\n Auckland: [],\n Wellington: [],\n Singapore: [],\n };\n const propertyOrder = Object.entries(hotelPages).reduce(\n (acc, [id, hotel]) => {\n if (hotelsByCity[hotel.city]) {\n hotelsByCity[hotel.city].push({ label: hotel.name, value: id });\n } else {\n hotelsByCity[hotel.city] = [{ label: hotel.name, value: id }];\n }\n acc[id] = hotel.sort;\n return acc;\n },\n {} as { [k: string]: number }\n );\n return Object.entries(hotelsByCity).map(([city, options]) => {\n return {\n label: city,\n options: options.sort(\n (a, b) => propertyOrder[a.value] - propertyOrder[b.value]\n ),\n };\n });\n};\n\n/**\n * Joins the Property address\n */\nexport const joinAddress = (addressParams: (string | null)[]) =>\n addressParams\n .reduce((acc: string[], param: string | null) => {\n if (param) {\n acc.push(param);\n }\n return acc;\n }, [])\n .join(\", \");\n\nexport const hotelPageLink = (\n city: string,\n hotelName: string,\n lang: String = \"en\"\n) => {\n const slugs: any = {\n TRA: {\n root: `/book-accommodation/${slugify(city, { lower: true })}`,\n slice: 11,\n },\n VIB: {\n root: `/book-accommodation/${slugify(city, { lower: true })}`,\n slice: 5,\n },\n ADI: { root: `/${lang}/apartments/`, slice: 22 },\n };\n return `${slugs[process.env.PROJECT as string].root}/${slugify(hotelName, {\n lower: true,\n }).slice(slugs[process.env.PROJECT as string].slice)}`;\n};\n","import { Actions } from \"gatsby\";\nimport { RedirectionType } from \"./types\";\nconst fs = module.require(\"fs\");\nconst path = module.require(\"path\");\n\n/**\n * Replace Page Metas\n *\n * Replaces the page metas only on multi-domain projects.\n * For instance if the current page has the following metas defined within the page attributes:\n *\n * {\n * \"metas\": {\n * \"rendezvoushotels.co.nz\": {\n * \"en\": {\n * \"title\": \"Rendezvous hotels in New Zealand\",\n * \"description\": \"Book the best hotels in New Zealand\"\n * }\n * }\n * }\n * }\n *\n * and if the current HOST domain (e.g: \"rendezvoushotels.co.nz\") matches one defined in the metas,\n * the page metas will be replaced by the ones defined on this page attributes.\n *\n * @param page Gatsby Page context\n */\nexport const replacePageMetas = (page: any) => {\n // Remove \"staging.\" and \"test.\" prefixes when checking domain metas for convenience (avoids duplication)\n const domainRoot = (process.env.HOST as string).replace(\n /^(test\\.|staging\\.)/,\n \"\"\n );\n if (page.data?.metas?.[domainRoot]?.[page.language]) {\n for (const [key, value] of Object.entries(\n page.data.metas[domainRoot][page.language]\n )) {\n if (key === \"title\") {\n page.head.title = value;\n continue;\n }\n page.head.metas[key] = value;\n }\n }\n return page;\n};\n\n// Build page elements (only for the ones having a build.js)\nexport const build = async (page: any) => {\n let body = [];\n page = replacePageMetas(page); // Multi-domain projects\n for (const element of page.body) {\n body.push(\n await buildElement(element, {\n slug: page.slug,\n tags: page.tags,\n data: page.data,\n })\n );\n }\n page.body = body;\n return page;\n};\n\n/**\n * Generate API pages\n *\n * @param actions Gatsby actions: https://www.gatsbyjs.com/docs/reference/config-files/actions/\n */\nexport const createAPIPages = async (actions: Actions) => {\n if (!process.env.GATSBY_PROJECT_ROOT) {\n throw new Error(\n 'Please define \"process.env.GATSBY_PROJECT_ROOT = __dirname\" within the ./gatsby-config.js file.'\n );\n }\n const project = JSON.parse(\n fs.readFileSync(\n `${process.env.GATSBY_PROJECT_ROOT}/src/data/projectMetadata.json`,\n \"utf-8\"\n )\n );\n const isMultiLingual = project.languages.length > 1;\n const { createPage, createRedirect } = actions;\n let redirections: RedirectionType[] = [];\n let excluded: string[] = []; // List of excluded pages\n for (const language of project.languages) {\n const jsonDoc = JSON.parse(\n fs.readFileSync(\n `${process.env.GATSBY_PROJECT_ROOT}/src/data/pages/site-${language}.json`,\n `utf-8`\n )\n );\n for (const page of jsonDoc) {\n if (page.is_hidden) {\n excluded.push(page.slug);\n }\n // Skip disabled pages\n if (!page.is_active) {\n continue;\n }\n // Skip non-English pages when they are not translated (only on multi-language projects)\n // Also, creates a 302 (temporally) redirection to English version.\n if (isMultiLingual && page.redirect_to_english && language !== \"en\") {\n redirections.push({\n page: page.slug,\n redirection: `${process.env.PROTOCOL}://${process.env.HOST}/en/${page.slug.slice(4)}`,\n type: \"302\",\n redirectInBrowser: true, // Redirect also in browser because 302 redirection only work on full page loads.\n });\n continue;\n }\n // Skip when \"DEV_PAGE\" is defined on \"./.env.development\" and doesn't match current page:\n if (\n process.env.DEV_PAGE &&\n page.id !== parseInt(`${process.env.DEV_PAGE}`)\n ) {\n console.warn(\n \"DEV_PAGE is defined on .env.development file! Only one page will be generated!\"\n );\n continue;\n }\n const component = require.resolve(\n `${process.env.GATSBY_PROJECT_ROOT}/src/components/page/index.tsx`\n );\n const context = await build(page);\n createPage({\n path: page.slug,\n component: component,\n context: context,\n });\n // The root /404/ page must also be created on multi-language projects to\n // handle non-existing root pages without language prefix, E.G: https://mysite.com/non-existing-page\n if (isMultiLingual && page.slug === \"/en/404/\") {\n createPage({\n path: \"/404/\",\n component: component,\n context: context,\n });\n }\n }\n }\n\n createAPIRedirections(createRedirect, isMultiLingual, redirections);\n // Generate the file \"./src/data/excluded.json\" containing the pages which should be excluded on the sitemap and disallowed within robots.txt.\n fs.writeFileSync(\n `${process.env.GATSBY_PROJECT_ROOT}/src/data/pages/excluded.json`,\n JSON.stringify(excluded)\n );\n};\n\n/**\n * Generate API redirections\n */\nexport const createAPIRedirections = (\n createRedirect: Actions[\"createRedirect\"],\n isMultiLingual: boolean,\n pagesRedirections: RedirectionType[]\n) => {\n // Load API redirections\n const redirections = [\n ...pagesRedirections,\n ...JSON.parse(\n fs.readFileSync(\n `${process.env.GATSBY_PROJECT_ROOT}/src/data/pages/redirections.json`,\n `utf-8`\n )\n ),\n ];\n // Redirect homepage \"/\" to \"/en/\" on multi-language projects\n if (isMultiLingual) {\n redirections.push({\n page: \"/\",\n redirection: `${process.env.PROTOCOL}://${process.env.HOST}/en/`,\n type: \"301\",\n });\n }\n\n redirections.forEach((redirect: RedirectionType) => {\n createRedirect({\n fromPath: redirect.page,\n toPath: redirect.redirection,\n isPermanent: redirect.type === \"301\",\n redirectInBrowser: redirect.redirectInBrowser,\n force: true,\n });\n });\n};\n\n/**\n * Function executed after creating pages to perform following tasks:\n * - Creation of \"robots.txt\"\n */\nexport const postBuild = () => {\n const excludedPages = JSON.parse(\n fs.readFileSync(\n `${process.env.GATSBY_PROJECT_ROOT}/src/data/pages/excluded.json`,\n `utf-8`\n )\n );\n\n const robotsTxt = [\n \"User-agent: *\",\n `${process.env.ENV === \"production\" ? \"Allow: /\" : \"Disallow: /\"}`,\n `${excludedPages.length ? excludedPages.map((slug: string) => `Disallow: ${slug}`).join(\"\\n\") : \"\"}`,\n `Sitemap: ${process.env.PROTOCOL}://${process.env.HOST}/sitemap/sitemap-index.xml`,\n `Host: ${process.env.PROTOCOL}://${process.env.HOST}`,\n ];\n\n fs.writeFileSync(\n `${process.env.GATSBY_PROJECT_ROOT}/public/robots.txt`,\n robotsTxt.join(\"\\n\")\n );\n};\n\n/**\n * Builds API Element (usually for \"section\" and \"data\" elements)\n * This generates a initial data structure for the section/data to avoid processing the React component\n * initial state on every single render.\n *\n * @param element API element\n * @param context\n * @returns\n */\nexport const buildElement = async (element: any, context: any) => {\n const path = `${process.env.GATSBY_PROJECT_ROOT}/src/components/element/${element.type}/${element.name}/build.js`;\n if (fs.existsSync(path)) {\n const module = await import(path);\n if (module?.build) {\n return await module.build(element, context);\n }\n // Show warning on development:\n } else if (process.env.ENV === \"development\") {\n console.warn(`build.js file not found: ${path}`);\n }\n return element;\n};\n\n/**\n *\n * Fixes Development bugs on forms (Recaptcha v3) and Toast.\n * The bug is caused when running `yarn link \"@tfehotels/tfe-gatsby-library\"` on development\n * because this library will try to find the modules at the @tfehotels/tfe-gatsby-library/node_modules folder\n * instead of using the ./node_modules/ of the project.\n *\n */\nexport const createWebpackConfig = ({ actions, getConfig }: any) => {\n const config = getConfig();\n let alias = {\n ...config.resolve.alias,\n \"react-google-recaptcha-v3\": path.resolve(\n process.env.GATSBY_PROJECT_ROOT,\n \"node_modules\",\n \"react-google-recaptcha-v3\"\n ),\n };\n // if (process.env.ENV === \"development\") {\n // alias[\"react-hot-toast\"] = path.resolve(\n // process.env.GATSBY_PROJECT_ROOT,\n // \"node_modules\",\n // \"react-hot-toast\"\n // );\n // }\n config.resolve = {\n ...config.resolve,\n alias: alias,\n };\n actions.replaceWebpackConfig(config);\n};\n","import { joinPaths } from \"../url\";\nimport { ImageType, PageTagsType, QueryParamsType } from \"./types\";\nconst { getImage, withArtDirection } = module.require(\"gatsby-plugin-image\");\nconst fs = module.require(\"fs\");\nconst path = module.require(\"path\");\n\nexport const tagExists = (\n pageTags: PageTagsType,\n ...tags: string[]\n): boolean => {\n for (const tag of Object.keys(pageTags)) {\n if (tags.includes(tag)) {\n return true;\n }\n }\n return false;\n};\n\nexport const apiLink = (\n apiPath: string = \"\",\n queryParams: QueryParamsType | null = null\n): string =>\n `${joinPaths(\n `${process.env.API_PROTOCOL}://${process.env.API_HOST}`,\n apiPath\n )}${queryParams ? `?${new URLSearchParams(queryParams).toString()}` : \"\"}`;\n\nexport const buildImage = (img: ImageType) => {\n if (!img) {\n return undefined;\n }\n\n let fallback = {\n src: img.url,\n sizes: \"100vw\",\n srcSet: \"\",\n };\n let sources = [];\n let placeholder = { fallback: img.url };\n const sizes = [img.width, 360, 769, 1024, 1216, 1408].sort((a, b) => a - b);\n\n if (img.optimized) {\n fallback.src = img.url + img.name + \"-\" + img.width + \"w.jpg\";\n placeholder.fallback = img.url + img.name + \"-20w.jpg\";\n sources.push({ sizes: \"100vw\", srcSet: \"\", type: \"image/avif\" });\n sources.push({ sizes: \"100vw\", srcSet: \"\", type: \"image/webp\" });\n for (let index in sizes) {\n if (sizes[index] > img.width) {\n break;\n }\n let image_url =\n (index === \"0\" ? \"\" : \",\") + img.url + img.name + \"-\" + sizes[index];\n fallback.srcSet += image_url + \"w.jpg \" + sizes[index] + \"w\";\n sources[0].srcSet += image_url + \"w.avif \" + sizes[index] + \"w\";\n sources[1].srcSet += image_url + \"w.webp \" + sizes[index] + \"w\";\n }\n }\n\n return getImage({\n childImageSharp: {\n gatsbyImageData: {\n backgroundColor: \"transparent\",\n height: img.height / img.width,\n width: 1,\n layout: \"fullWidth\",\n placeholder: placeholder,\n images: {\n fallback: fallback,\n sources: sources,\n },\n },\n },\n });\n};\n\nexport const getImageData = (image: ImageType, mobileImage: ImageType) => {\n const image_data = buildImage(image);\n const mobile_image_data = buildImage(mobileImage);\n return image_data && mobile_image_data // If mobile image exists, it must be added using Art Direction.\n ? withArtDirection(image_data, [\n {\n media: \"(max-width: 768px)\",\n image: mobile_image_data,\n },\n ])\n : image_data;\n};\n\nexport const extractForm = (formSection: any) => {\n let form: any = {\n settings: {\n pk: 0,\n name: \"\",\n form_method: \"post\",\n form_submit: apiLink(\"/v1/project/request/contact\"),\n form_redirection: null,\n form_ajax_request: null,\n recaptcha_action: \"\",\n recaptcha_v3: false,\n },\n items: [],\n fields: {},\n };\n\n form.settings.recaptcha_v3 = !!formSection.recaptcha_v3;\n form.settings.recaptcha_action =\n formSection.data.recaptcha_action ?? formSection.name;\n form.settings.pk = formSection.pk;\n form.settings.name = formSection.name;\n [\n \"form_submit\",\n \"form_recipient\",\n \"form_method\",\n \"form_redirection\",\n \"form_ajax_request\",\n \"form_success_msg\",\n ].map((cfg) => {\n if (formSection.hasOwnProperty(cfg)) {\n // @ts-ignore\n form.settings[cfg] = formSection[cfg];\n }\n });\n const validTypes = new Set([\n \"checkbox\",\n \"input\",\n \"select\",\n \"button\",\n \"google-places\",\n \"country-prefix\",\n \"country\",\n \"textarea\",\n \"recaptcha2\",\n \"title\",\n \"text\",\n \"link\",\n \"image\",\n ]);\n let uniqueId = 0;\n const addItem = (parents: any, newItem: any): any => {\n let item = form.items;\n for (let key of parents) {\n item = item[key];\n if (!Array.isArray(item)) {\n item = item.children;\n }\n }\n item.push(newItem);\n };\n // Set Form fields:\n const setFormFields = (field: any, parents: any, k: number) => {\n let fieldName =\n field.input_name && !form.fields[field.input_name]\n ? field.input_name\n : field.name ?? `${field.type}${uniqueId++}`;\n\n if (\"section\" === field.type) {\n const sectionName = field.name ?? `sec_${parents.length}-${k}`;\n addItem(parents, { name: sectionName, children: [] });\n field.children.map((field: any, k2: any) =>\n setFormFields(field, [...parents, k], k2)\n );\n } else if (validTypes.has(field.type)) {\n addItem(parents, fieldName);\n form.fields[fieldName] = field;\n // Pre-process images (fixes flickering issue)\n if (field.type === \"image\") {\n form.fields[fieldName].imageData = getImageData(\n field.image,\n field.mobile_image\n );\n }\n }\n };\n\n formSection.children.map((field: any, k: any) => setFormFields(field, [], k));\n return form;\n};\n\nexport const fetchProjectMetadata = async (rootDir: string) => {\n // The URL of the JSON data you want to fetch\n const url = `${process.env.API_PROTOCOL}://${process.env.API_HOST}/v1/${process.env.PROJECT}/`;\n try {\n const response = await fetch(url);\n if (!response.ok) {\n throw new Error(\n `Failed to fetch project metadata data from \"${url}\": ${response.statusText}`\n );\n }\n const data = await response.json();\n const filePath = `${rootDir}/src/data/`;\n const fileName = \"projectMetadata.json\";\n // Write the data to a local JSON file\n fs.writeFileSync(\n path.resolve(filePath, fileName),\n JSON.stringify(data, null, 2)\n );\n console.log(\n `\\x1b[32msuccess\\x1b[0m Project metadata fetched and saved to:\\r\\n\"${filePath}${fileName}\"`\n );\n } catch (error) {\n console.error(\n `Error fetching project metadata from \"${url}\" data:\\r\\n`,\n error\n );\n process.exit(1);\n }\n};\n","const fs = require(\"fs\");\n\nexport const defaultGatsbyConfig = (config: any = {}, plugins: any[] = []) => {\n if (!process.env.GATSBY_PROJECT_ROOT) {\n throw new Error(\n 'Please define \"process.env.GATSBY_PROJECT_ROOT = __dirname\" within the ./gatsby-config.js file.'\n );\n }\n const rootDir = process.env.GATSBY_PROJECT_ROOT;\n const project = JSON.parse(\n fs.readFileSync(`${rootDir}/src/data/projectMetadata.json`, \"utf-8\")\n );\n const isMultiLingual = project.languages.length > 1;\n\n // Add multi-language plugins (only multi-language projects):\n if (isMultiLingual) {\n plugins.push({\n resolve: `gatsby-source-filesystem`,\n options: {\n path: `${rootDir}/locales`,\n name: `locale`,\n },\n });\n plugins.push({\n resolve: `gatsby-plugin-react-i18next`,\n options: {\n localeJsonSourceName: `locale`,\n defaultLanguage: process.env.PROJECT_DEFAULT_LANGUAGE,\n fallbackLng: process.env.PROJECT_DEFAULT_LANGUAGE,\n languages: project.languages,\n siteUrl: `${process.env.PROTOCOL}://${process.env.HOST}`,\n trailingSlash: \"always\",\n i18nextOptions: {\n interpolation: {\n escapeValue: false,\n },\n keySeparator: false,\n nsSeparator: false,\n react: {\n transSupportBasicHtmlNodes: true,\n transKeepBasicHtmlNodesFor: [\n \"a\",\n \"br\",\n \"span\",\n \"strong\",\n \"i\",\n \"p\",\n \"ul\",\n \"li\",\n \"h1\",\n \"h2\",\n \"h3\",\n \"h4\",\n \"h5\",\n ],\n },\n },\n redirect: false,\n pages: [\n {\n matchPath: \"/:lang?/(.*)\", // Prevents duplication of pages (Otherwise i18 plugin duplicates pages adding language code prefix)\n getLanguageFromPath: true,\n languages: project.languages,\n },\n ],\n },\n });\n }\n\n return {\n siteMetadata: {\n title: process.env.SITE_TITLE,\n description: process.env.SITE_DESCRIPTION,\n siteUrl: `${process.env.PROTOCOL}://${process.env.HOST}`,\n image: process.env.SITE_IMAGE,\n protocol: process.env.PROTOCOL,\n domain: process.env.HOST,\n },\n plugins: [\n `gatsby-plugin-image`,\n \"gatsby-plugin-use-query-params\",\n \"gatsby-plugin-svgr\",\n `gatsby-transformer-sharp`,\n \"gatsby-plugin-sass\",\n {\n resolve: `gatsby-plugin-manifest`,\n options: {\n name: project.name,\n short_name: project.name,\n lang: process.env.PROJECT_DEFAULT_LANGUAGE,\n background_color: project.background_colour,\n theme_color: project.colour,\n start_url: `/`,\n display: `standalone`,\n icon: process.env.PROJECT_ICON ?? \"static/icons/favicon.png\",\n },\n },\n {\n resolve: `gatsby-plugin-sharp`,\n options: {\n defaults: {\n formats: [`auto`, `webp`, \"avif\"],\n placeholder: `blurred`,\n quality: 80,\n breakpoints: [360, 769, 1024, 1216, 1408],\n backgroundColor: `transparent`,\n tracedSVGOptions: {},\n blurredOptions: {},\n jpgOptions: {},\n pngOptions: {},\n webpOptions: {},\n avifOptions: {},\n },\n },\n },\n {\n resolve: \"gatsby-source-apiserver\",\n options: {\n typePrefix: \"API__\",\n method: \"get\",\n allowCache: false,\n headers: {\n \"Content-Type\": \"application/json\",\n },\n data: {}, // Request body\n params: {},\n verboseOutput: false,\n // enableDevRefresh: true,\n entitiesArray: [\n {\n url: `${process.env.API_PROTOCOL}://${process.env.API_HOST}/v1/${process.env.PROJECT}/redirection/`,\n headers: {\n \"Content-Type\": \"application/json\",\n },\n name: \"redirections\",\n skipCreateNode: true,\n localSave: true,\n path: `${rootDir}/src/data/pages/`,\n },\n ...project.languages.map((language: string) => ({\n url: `${process.env.API_PROTOCOL}://${process.env.API_HOST}/v1/${process.env.PROJECT}/full-content/?language=${language}`,\n headers: {\n \"Content-Type\": \"application/json\",\n },\n name: `site-${language}`,\n skipCreateNode: true,\n localSave: true,\n path: `${rootDir}/src/data/pages/`,\n })),\n ],\n },\n },\n {\n resolve: `gatsby-plugin-s3`,\n options: {\n bucketName: process.env.S3_BUCKET,\n protocol: process.env.PROTOCOL,\n hostname: process.env.HOST,\n generateRoutingRules: true,\n generateRedirectObjectsForPermanentRedirects: true,\n acl: \"private\",\n },\n },\n {\n resolve: `gatsby-plugin-sitemap`,\n options: {\n // Skip homepage \"/\" on multi-language projects, because it uses \"/en/\" instead.\n excludes: [\"/404/\", \"/**/404/\", isMultiLingual ? \"/\" : \"\"],\n query: `\n {\n allSitePage {\n nodes {\n path\n pageContext\n }\n }\n }\n `,\n resolveSiteUrl: () => `${process.env.PROTOCOL}://${process.env.HOST}`,\n filterPages: (page: any) => page.is_hidden,\n serialize: (page: any, { resolvePagePath }: any) => {\n const url: any = {\n url: resolvePagePath(page),\n lastmod: page.pageContext.published_at,\n };\n // Generate hreflang links for multi-language projects:\n if (isMultiLingual) {\n url.links = project.languages.reduce(\n (acc: any, lang: string) => {\n // Avoid creating links for non-English pages when the \"redirect_to_english\" flag is active:\n if (!page.pageContext.redirect_to_english || lang === \"en\") {\n acc.push({\n lang: lang,\n url: url.url.replace(/^\\/[a-z]{2}\\//, `/${lang}/`),\n });\n }\n return acc;\n },\n [\n {\n lang: \"x-default\",\n url: url.url.replace(\n /^\\/[a-z]{2}\\//,\n `/${process.env.PROJECT_DEFAULT_LANGUAGE}/`\n ),\n },\n ]\n );\n }\n return url;\n },\n },\n },\n {\n resolve: \"gatsby-plugin-google-tagmanager\",\n options: {\n id: process.env.GTM_ID,\n },\n },\n {\n resolve: \"gatsby-plugin-newrelic\",\n options: {\n config: {\n instrumentationType: \"proAndSPA\",\n accountId: process.env.NEWRELIC_ACCOUNT_ID,\n trustKey: process.env.NEWRELIC_TRUST_KEY,\n agentID: process.env.NEWRELIC_AGENT_ID,\n licenseKey: process.env.NEWRELIC_LICENSE_KEY,\n applicationID: process.env.NEWRELIC_APP_ID,\n beacon: \"bam.nr-data.net\",\n errorBeacon: \"bam.nr-data.net\",\n },\n },\n },\n ...plugins,\n ],\n ...config,\n };\n};\n","import { NOptionsType } from \"./types\";\n\n/**\n *\n * Creates a Object with numeric options for a Select input.\n *\n * @param n Number of options to create\n * @param start The number from which the options start\n * @param defaultOpt Default options to be added into the resulting object\n * @returns Object with the created options, for instance: { \"0\": \"0\", \"1\": \"1\", ... }\n *\n */\nexport const nOptions = (\n n: number,\n start = 0,\n defaultOpt = {}\n): NOptionsType => {\n const obj: NOptionsType = { ...defaultOpt };\n for (let i = start; i < start + n; i++) {\n obj[i.toString()] = i.toString();\n }\n return obj;\n};\n"],"names":["randomString","length","characters","result","i","charAt","Math","floor","random","joinPaths","path1","path2","replace","RegExp","slugify","module","require","fs","path","build","async","body","page","domainRoot","process","env","HOST","data","metas","language","key","value","Object","entries","head","title","replacePageMetas","element","push","buildElement","slug","tags","createAPIRedirections","createRedirect","isMultiLingual","pagesRedirections","redirections","JSON","parse","readFileSync","GATSBY_PROJECT_ROOT","redirection","PROTOCOL","type","forEach","redirect","fromPath","toPath","isPermanent","redirectInBrowser","force","context","name","existsSync","import","ENV","console","warn","getImage","withArtDirection","apiLink","apiPath","queryParams","API_PROTOCOL","API_HOST","URLSearchParams","toString","buildImage","img","fallback","src","url","sizes","srcSet","sources","placeholder","width","sort","a","b","optimized","index","image_url","childImageSharp","gatsbyImageData","backgroundColor","height","layout","images","getImageData","image","mobileImage","image_data","mobile_image_data","media","Error","project","languages","createPage","actions","excluded","jsonDoc","is_hidden","is_active","redirect_to_english","slice","DEV_PAGE","id","parseInt","component","resolve","writeFileSync","stringify","createWebpackConfig","getConfig","config","alias","replaceWebpackConfig","dealSlug","DEALS_ROOT_SLUG","defaultGatsbyConfig","plugins","rootDir","options","localeJsonSourceName","defaultLanguage","PROJECT_DEFAULT_LANGUAGE","fallbackLng","siteUrl","trailingSlash","i18nextOptions","interpolation","escapeValue","keySeparator","nsSeparator","react","transSupportBasicHtmlNodes","transKeepBasicHtmlNodesFor","pages","matchPath","getLanguageFromPath","siteMetadata","SITE_TITLE","description","SITE_DESCRIPTION","SITE_IMAGE","protocol","domain","short_name","lang","background_color","background_colour","theme_color","colour","start_url","display","icon","PROJECT_ICON","defaults","formats","quality","breakpoints","tracedSVGOptions","blurredOptions","jpgOptions","pngOptions","webpOptions","avifOptions","typePrefix","method","allowCache","headers","params","verboseOutput","entitiesArray","PROJECT","skipCreateNode","localSave","map","bucketName","S3_BUCKET","hostname","generateRoutingRules","generateRedirectObjectsForPermanentRedirects","acl","excludes","query","resolveSiteUrl","filterPages","serialize","resolvePagePath","lastmod","pageContext","published_at","links","reduce","acc","GTM_ID","instrumentationType","accountId","NEWRELIC_ACCOUNT_ID","trustKey","NEWRELIC_TRUST_KEY","agentID","NEWRELIC_AGENT_ID","licenseKey","NEWRELIC_LICENSE_KEY","applicationID","NEWRELIC_APP_ID","beacon","errorBeacon","formSection","form","settings","pk","form_method","form_submit","form_redirection","form_ajax_request","recaptcha_action","recaptcha_v3","items","fields","cfg","hasOwnProperty","validTypes","Set","uniqueId","addItem","parents","newItem","item","Array","isArray","children","setFormFields","field","k","fieldName","input_name","sectionName","k2","has","imageData","mobile_image","response","fetch","ok","statusText","json","filePath","fileName","log","error","exit","hotelPages","hotelsByCity","Sydney","Melbourne","Brisbane","Perth","Hobart","Canberra","Adelaide","Darwin","Auckland","Wellington","Singapore","propertyOrder","hotel","city","label","hotelPageLink","hotelName","slugs","TRA","root","lower","VIB","ADI","addressParams","param","join","nOptions","n","start","defaultOpt","obj","postBuild","excludedPages","robotsTxt","SABRE_SSO_PROTOCOL","SABRE_SSO_HOST","tagExists","pageTags","tag","keys","includes","score","parseFloat","toFixed"],"mappings":"aAAO,SAASA,EAAaC,EAAiB,GAC5C,MAAMC,EACJ,iEACF,IAAIC,EAAS,GACb,IAAK,IAAIC,EAAI,EAAGA,EAAIH,EAAQG,IAC1BD,GAAUD,EAAWG,OAAOC,KAAKC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AC1BA,EACGrF,QAAO,CAACC,EAAeqF,KAClBA,GACFrF,EAAIxK,KAAK6P,GAEJrF,IACN,IACFsF,KAAK,2CI/DcC,CACtBC,EACAC,EAAQ,EACRC,EAAa,CAAA,KAEb,MAAMC,EAAoB,IAAKD,GAC/B,IAAK,IAAIpS,EAAImS,EAAOnS,EAAImS,EAAQD,EAAGlS,IACjCqS,EAAIrS,EAAEwE,YAAcxE,EAAEwE,WAExB,OAAO6N,CAAG,wBLCkBpL,GAC3B,mDAAkDA,aAAcA,sBAAuBrH,EACtF,4DEwKqB0S,KACvB,MAAMC,EAAgB5P,KAAKC,MACzB/B,EAAGgC,aACA,GAAEzB,QAAQC,IAAIyB,mDACd,UAIC0P,EAAY,CAChB,gBACC,IAAsB,eAApBpR,QAAQC,IAAIwC,IAAuB,WAAa,eAClD,GAAE0O,EAAc1S,OAAS0S,EAAc/G,KAAKpJ,GAAkB,aAAYA,MAAQ4P,KAAK,MAAQ,KAC/F,YAAW5Q,QAAQC,IAAI2B,cAAc5B,QAAQC,IAAIC,iCACjD,SAAQF,QAAQC,IAAI2B,cAAc5B,QAAQC,IAAIC,QAGjDT,EAAGwG,cACA,GAAEjG,QAAQC,IAAIyB,wCACf0P,EAAUR,KAAK,MAChB,wCFrMoBlR,GACpB,GAAEM,QAAQC,IAAIoR,wBAAwBrR,QAAQC,IAAIqR,iBAAiB5R,sBGT7C6R,CACvBC,KACGvQ,KAEH,IAAK,MAAMwQ,KAAOjR,OAAOkR,KAAKF,GAC5B,GAAIvQ,EAAK0Q,SAASF,GAChB,OAAO,EAGX,OAAO,CAAK,+BHEuBG,GAClC,8DAA6DC,WAC5DD,GACAE,QAAQ"}
1
+ {"version":3,"file":"index.node.cjs","sources":["../src/node/string/index.ts","../src/node/url/index.ts","../src/node/property/index.ts","../src/node/build/index.ts","../src/node/api/index.ts","../src/node/config/index.ts","../src/node/form/index.ts"],"sourcesContent":["export function randomString(length: number = 9): string {\n const characters =\n \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\";\n let result = \"\";\n for (let i = 0; i < length; i++) {\n result += characters.charAt(Math.floor(Math.random() * characters.length));\n }\n return result;\n}\n","import { randomString } from \"../string\";\n\nexport const joinPaths = (path1: string, path2: string): string =>\n `${path1.replace(new RegExp(`/$`), \"\")}/${path2.replace(\n new RegExp(`^/`),\n \"\"\n )}`;\n\nexport const dealLink = (dealSlug: string): string => {\n if (!process.env.DEALS_ROOT_SLUG)\n throw new Error(\"The env variable DEALS_ROOT_SLUG is not defined!\");\n return joinPaths(process.env.DEALS_ROOT_SLUG as string, dealSlug);\n};\n\nexport const ssoURL = (path: string) =>\n `${process.env.SABRE_SSO_PROTOCOL}://${process.env.SABRE_SSO_HOST}${path}`;\n\nexport const tripadvisorRatingURL = (score: string) =>\n `https://www.tripadvisor.com/img/cdsi/img2/ratings/traveler/${parseFloat(\n score\n ).toFixed(1)}-41022-5.svg`;\n\nexport const opentableLink = (id: number): string =>\n `https://www.opentable.com.au/restref/client?rid=${id}&restref=${id}&lang=en-AU&r3uid=${randomString(\n 9\n )}&ot_source=Restaurant+website&color=1`;\n","const slugify = module.require(\"slugify\");\nimport { HotelOptionsByCityType, HotelPagesType, CityKeyType } from \"./types\";\n\n/**\n *\n * Returns Select options sorting by the cities with more hotels, otherwise alphabetically.\n *\n * For instance:\n *\n * [\n * {\n * label: 'Sydney',\n * options: [\n * { label: 'Vibe Hotel Sydney', value: \"58443\" },\n * { label: 'Vibe Hotel Sydney Darling Harbour', value: \"8565\" }\n * ]\n * },\n * {\n * label: 'Mebourne',\n * options: [\n * { label: 'Vibe Hotel Melbourne', value: \"9969\" },\n * ]\n * },\n * ]\n */\nexport const hotelOptionsByCity = (\n hotelPages: HotelPagesType\n): HotelOptionsByCityType[] => {\n let hotelsByCity: Record<CityKeyType, { value: string; label: string }[]> = {\n Sydney: [],\n Melbourne: [],\n Brisbane: [],\n Perth: [],\n Hobart: [],\n Canberra: [],\n Adelaide: [],\n \"Gold Coast\": [],\n Darwin: [],\n Auckland: [],\n Wellington: [],\n Singapore: [],\n };\n const propertyOrder = Object.entries(hotelPages).reduce(\n (acc, [id, hotel]) => {\n if (hotelsByCity[hotel.city]) {\n hotelsByCity[hotel.city].push({ label: hotel.name, value: id });\n } else {\n hotelsByCity[hotel.city] = [{ label: hotel.name, value: id }];\n }\n acc[id] = hotel.sort;\n return acc;\n },\n {} as { [k: string]: number }\n );\n return Object.entries(hotelsByCity).map(([city, options]) => {\n return {\n label: city,\n options: options.sort(\n (a, b) => propertyOrder[a.value] - propertyOrder[b.value]\n ),\n };\n });\n};\n\n/**\n * Joins the Property address\n */\nexport const joinAddress = (addressParams: (string | null)[]) =>\n addressParams\n .reduce((acc: string[], param: string | null) => {\n if (param) {\n acc.push(param);\n }\n return acc;\n }, [])\n .join(\", \");\n\nexport const hotelPageLink = (\n city: string,\n hotelName: string,\n lang: String = \"en\"\n) => {\n const slugs: any = {\n TRA: {\n root: `/book-accommodation/${slugify(city, { lower: true })}`,\n slice: 11,\n },\n VIB: {\n root: `/book-accommodation/${slugify(city, { lower: true })}`,\n slice: 5,\n },\n ADI: { root: `/${lang}/apartments/`, slice: 22 },\n };\n return `${slugs[process.env.PROJECT as string].root}/${slugify(hotelName, {\n lower: true,\n }).slice(slugs[process.env.PROJECT as string].slice)}`;\n};\n","import { Actions } from \"gatsby\";\nimport { RedirectionType } from \"./types\";\nconst fs = module.require(\"fs\");\nconst path = module.require(\"path\");\n\n/**\n * Replace Page Metas\n *\n * Replaces the page metas only on multi-domain projects.\n * For instance if the current page has the following metas defined within the page attributes:\n *\n * {\n * \"metas\": {\n * \"rendezvoushotels.co.nz\": {\n * \"en\": {\n * \"title\": \"Rendezvous hotels in New Zealand\",\n * \"description\": \"Book the best hotels in New Zealand\"\n * }\n * }\n * }\n * }\n *\n * and if the current HOST domain (e.g: \"rendezvoushotels.co.nz\") matches one defined in the metas,\n * the page metas will be replaced by the ones defined on this page attributes.\n *\n * @param page Gatsby Page context\n */\nexport const replacePageMetas = (page: any) => {\n // Remove \"staging.\" and \"test.\" prefixes when checking domain metas for convenience (avoids duplication)\n const domainRoot = (process.env.HOST as string).replace(\n /^(test\\.|staging\\.)/,\n \"\"\n );\n if (page.data?.metas?.[domainRoot]?.[page.language]) {\n for (const [key, value] of Object.entries(\n page.data.metas[domainRoot][page.language]\n )) {\n if (key === \"title\") {\n page.head.title = value;\n continue;\n }\n page.head.metas[key] = value;\n }\n }\n return page;\n};\n\n// Build page elements (only for the ones having a build.js)\nexport const build = async (page: any) => {\n let body = [];\n page = replacePageMetas(page); // Multi-domain projects\n for (const element of page.body) {\n body.push(\n await buildElement(element, {\n slug: page.slug,\n tags: page.tags,\n data: page.data,\n })\n );\n }\n page.body = body;\n return page;\n};\n\n/**\n * Generate API pages\n *\n * @param actions Gatsby actions: https://www.gatsbyjs.com/docs/reference/config-files/actions/\n */\nexport const createAPIPages = async (actions: Actions) => {\n if (!process.env.GATSBY_PROJECT_ROOT) {\n throw new Error(\n 'Please define \"process.env.GATSBY_PROJECT_ROOT = __dirname\" within the ./gatsby-config.js file.'\n );\n }\n const project = JSON.parse(\n fs.readFileSync(\n `${process.env.GATSBY_PROJECT_ROOT}/src/data/projectMetadata.json`,\n \"utf-8\"\n )\n );\n const isMultiLingual = project.languages.length > 1;\n const { createPage, createRedirect } = actions;\n let redirections: RedirectionType[] = [];\n let excluded: string[] = []; // List of excluded pages\n for (const language of project.languages) {\n const jsonDoc = JSON.parse(\n fs.readFileSync(\n `${process.env.GATSBY_PROJECT_ROOT}/src/data/pages/site-${language}.json`,\n `utf-8`\n )\n );\n for (const page of jsonDoc) {\n if (page.is_hidden) {\n excluded.push(page.slug);\n }\n // Skip disabled pages\n if (!page.is_active) {\n continue;\n }\n // Skip non-English pages when they are not translated (only on multi-language projects)\n // Also, creates a 302 (temporally) redirection to English version.\n if (isMultiLingual && page.redirect_to_english && language !== \"en\") {\n redirections.push({\n page: page.slug,\n redirection: `${process.env.PROTOCOL}://${process.env.HOST}/en/${page.slug.slice(4)}`,\n type: \"302\",\n redirectInBrowser: true, // Redirect also in browser because 302 redirection only work on full page loads.\n });\n continue;\n }\n // Skip when \"DEV_PAGE\" is defined on \"./.env.development\" and doesn't match current page:\n if (\n process.env.DEV_PAGE &&\n page.id !== parseInt(`${process.env.DEV_PAGE}`)\n ) {\n console.warn(\n \"DEV_PAGE is defined on .env.development file! Only one page will be generated!\"\n );\n continue;\n }\n const component = require.resolve(\n `${process.env.GATSBY_PROJECT_ROOT}/src/components/page/index.tsx`\n );\n const context = await build(page);\n createPage({\n path: page.slug,\n component: component,\n context: context,\n });\n // The root /404/ page must also be created on multi-language projects to\n // handle non-existing root pages without language prefix, E.G: https://mysite.com/non-existing-page\n if (isMultiLingual && page.slug === \"/en/404/\") {\n createPage({\n path: \"/404/\",\n component: component,\n context: context,\n });\n }\n }\n }\n\n createAPIRedirections(createRedirect, isMultiLingual, redirections);\n // Generate the file \"./src/data/excluded.json\" containing the pages which should be excluded on the sitemap and disallowed within robots.txt.\n fs.writeFileSync(\n `${process.env.GATSBY_PROJECT_ROOT}/src/data/pages/excluded.json`,\n JSON.stringify(excluded)\n );\n};\n\n/**\n * Generate API redirections\n */\nexport const createAPIRedirections = (\n createRedirect: Actions[\"createRedirect\"],\n isMultiLingual: boolean,\n pagesRedirections: RedirectionType[]\n) => {\n // Load API redirections\n const redirections = [\n ...pagesRedirections,\n ...JSON.parse(\n fs.readFileSync(\n `${process.env.GATSBY_PROJECT_ROOT}/src/data/pages/redirections.json`,\n `utf-8`\n )\n ),\n ];\n // Redirect homepage \"/\" to \"/en/\" on multi-language projects\n if (isMultiLingual) {\n redirections.push({\n page: \"/\",\n redirection: `${process.env.PROTOCOL}://${process.env.HOST}/en/`,\n type: \"301\",\n });\n }\n\n redirections.forEach((redirect: RedirectionType) => {\n createRedirect({\n fromPath: redirect.page,\n toPath: redirect.redirection,\n isPermanent: redirect.type === \"301\",\n redirectInBrowser: redirect.redirectInBrowser,\n force: true,\n });\n });\n};\n\n/**\n * Function executed after creating pages to perform following tasks:\n * - Creation of \"robots.txt\"\n */\nexport const postBuild = () => {\n const excludedPages = JSON.parse(\n fs.readFileSync(\n `${process.env.GATSBY_PROJECT_ROOT}/src/data/pages/excluded.json`,\n `utf-8`\n )\n );\n\n const robotsTxt = [\n \"User-agent: *\",\n `${process.env.ENV === \"production\" ? \"Allow: /\" : \"Disallow: /\"}`,\n `${excludedPages.length ? excludedPages.map((slug: string) => `Disallow: ${slug}`).join(\"\\n\") : \"\"}`,\n `Sitemap: ${process.env.PROTOCOL}://${process.env.HOST}/sitemap/sitemap-index.xml`,\n `Host: ${process.env.PROTOCOL}://${process.env.HOST}`,\n ];\n\n fs.writeFileSync(\n `${process.env.GATSBY_PROJECT_ROOT}/public/robots.txt`,\n robotsTxt.join(\"\\n\")\n );\n};\n\n/**\n * Builds API Element (usually for \"section\" and \"data\" elements)\n * This generates a initial data structure for the section/data to avoid processing the React component\n * initial state on every single render.\n *\n * @param element API element\n * @param context\n * @returns\n */\nexport const buildElement = async (element: any, context: any) => {\n const path = `${process.env.GATSBY_PROJECT_ROOT}/src/components/element/${element.type}/${element.name}/build.js`;\n if (fs.existsSync(path)) {\n const module = await import(path);\n if (module?.build) {\n return await module.build(element, context);\n }\n // Show warning on development:\n } else if (process.env.ENV === \"development\") {\n console.warn(`build.js file not found: ${path}`);\n }\n return element;\n};\n\n/**\n *\n * Fixes Development bugs on forms (Recaptcha v3) and Toast.\n * The bug is caused when running `yarn link \"@tfehotels/tfe-gatsby-library\"` on development\n * because this library will try to find the modules at the @tfehotels/tfe-gatsby-library/node_modules folder\n * instead of using the ./node_modules/ of the project.\n *\n */\nexport const createWebpackConfig = ({ actions, getConfig }: any) => {\n const config = getConfig();\n let alias = {\n ...config.resolve.alias,\n \"react-google-recaptcha-v3\": path.resolve(\n process.env.GATSBY_PROJECT_ROOT,\n \"node_modules\",\n \"react-google-recaptcha-v3\"\n ),\n };\n // if (process.env.ENV === \"development\") {\n // alias[\"react-hot-toast\"] = path.resolve(\n // process.env.GATSBY_PROJECT_ROOT,\n // \"node_modules\",\n // \"react-hot-toast\"\n // );\n // }\n config.resolve = {\n ...config.resolve,\n alias: alias,\n };\n actions.replaceWebpackConfig(config);\n};\n","import { joinPaths } from \"../url\";\nimport { ImageType, PageTagsType, QueryParamsType } from \"./types\";\nconst { getImage, withArtDirection } = module.require(\"gatsby-plugin-image\");\nconst fs = module.require(\"fs\");\nconst path = module.require(\"path\");\n\nexport const tagExists = (\n pageTags: PageTagsType,\n ...tags: string[]\n): boolean => {\n for (const tag of Object.keys(pageTags)) {\n if (tags.includes(tag)) {\n return true;\n }\n }\n return false;\n};\n\nexport const apiLink = (\n apiPath: string = \"\",\n queryParams: QueryParamsType | null = null\n): string =>\n `${joinPaths(\n `${process.env.API_PROTOCOL}://${process.env.API_HOST}`,\n apiPath\n )}${queryParams ? `?${new URLSearchParams(queryParams).toString()}` : \"\"}`;\n\nexport const buildImage = (img: ImageType) => {\n if (!img) {\n return undefined;\n }\n\n let fallback = {\n src: img.url,\n sizes: \"100vw\",\n srcSet: \"\",\n };\n let sources = [];\n let placeholder = { fallback: img.url };\n const sizes = [img.width, 360, 769, 1024, 1216, 1408].sort((a, b) => a - b);\n\n if (img.optimized) {\n fallback.src = img.url + img.name + \"-\" + img.width + \"w.jpg\";\n placeholder.fallback = img.url + img.name + \"-20w.jpg\";\n sources.push({ sizes: \"100vw\", srcSet: \"\", type: \"image/avif\" });\n sources.push({ sizes: \"100vw\", srcSet: \"\", type: \"image/webp\" });\n for (let index in sizes) {\n if (sizes[index] > img.width) {\n break;\n }\n let image_url =\n (index === \"0\" ? \"\" : \",\") + img.url + img.name + \"-\" + sizes[index];\n fallback.srcSet += image_url + \"w.jpg \" + sizes[index] + \"w\";\n sources[0].srcSet += image_url + \"w.avif \" + sizes[index] + \"w\";\n sources[1].srcSet += image_url + \"w.webp \" + sizes[index] + \"w\";\n }\n }\n\n return getImage({\n childImageSharp: {\n gatsbyImageData: {\n backgroundColor: \"transparent\",\n height: img.height / img.width,\n width: 1,\n layout: \"fullWidth\",\n placeholder: placeholder,\n images: {\n fallback: fallback,\n sources: sources,\n },\n },\n },\n });\n};\n\nexport const getImageData = (image: ImageType, mobileImage: ImageType) => {\n const image_data = buildImage(image);\n const mobile_image_data = buildImage(mobileImage);\n return image_data && mobile_image_data // If mobile image exists, it must be added using Art Direction.\n ? withArtDirection(image_data, [\n {\n media: \"(max-width: 768px)\",\n image: mobile_image_data,\n },\n ])\n : image_data;\n};\n\nexport const extractForm = (formSection: any) => {\n let form: any = {\n settings: {\n pk: 0,\n name: \"\",\n form_method: \"post\",\n form_submit: apiLink(\"/v1/project/request/contact\"),\n form_redirection: null,\n form_ajax_request: null,\n recaptcha_action: \"\",\n recaptcha_v3: false,\n },\n items: [],\n fields: {},\n };\n\n form.settings.recaptcha_v3 = !!formSection.recaptcha_v3;\n form.settings.recaptcha_action =\n formSection.data.recaptcha_action ?? formSection.name;\n form.settings.pk = formSection.pk;\n form.settings.name = formSection.name;\n [\n \"form_submit\",\n \"form_recipient\",\n \"form_method\",\n \"form_redirection\",\n \"form_ajax_request\",\n \"form_success_msg\",\n ].map((cfg) => {\n if (formSection.hasOwnProperty(cfg)) {\n // @ts-ignore\n form.settings[cfg] = formSection[cfg];\n }\n });\n const validTypes = new Set([\n \"checkbox\",\n \"input\",\n \"select\",\n \"button\",\n \"google-places\",\n \"country-prefix\",\n \"country\",\n \"textarea\",\n \"recaptcha2\",\n \"title\",\n \"text\",\n \"link\",\n \"image\",\n ]);\n let uniqueId = 0;\n const addItem = (parents: any, newItem: any): any => {\n let item = form.items;\n for (let key of parents) {\n item = item[key];\n if (!Array.isArray(item)) {\n item = item.children;\n }\n }\n item.push(newItem);\n };\n // Set Form fields:\n const setFormFields = (field: any, parents: any, k: number) => {\n let fieldName =\n field.input_name && !form.fields[field.input_name]\n ? field.input_name\n : field.name ?? `${field.type}${uniqueId++}`;\n\n if (\"section\" === field.type) {\n const sectionName = field.name ?? `sec_${parents.length}-${k}`;\n addItem(parents, { name: sectionName, children: [] });\n field.children.map((field: any, k2: any) =>\n setFormFields(field, [...parents, k], k2)\n );\n } else if (validTypes.has(field.type)) {\n addItem(parents, fieldName);\n form.fields[fieldName] = field;\n // Pre-process images (fixes flickering issue)\n if (field.type === \"image\") {\n form.fields[fieldName].imageData = getImageData(\n field.image,\n field.mobile_image\n );\n }\n }\n };\n\n formSection.children.map((field: any, k: any) => setFormFields(field, [], k));\n return form;\n};\n\nexport const fetchProjectMetadata = async (rootDir: string) => {\n // The URL of the JSON data you want to fetch\n const url = `${process.env.API_PROTOCOL}://${process.env.API_HOST}/v1/${process.env.PROJECT}/`;\n try {\n const response = await fetch(url);\n if (!response.ok) {\n throw new Error(\n `Failed to fetch project metadata data from \"${url}\": ${response.statusText}`\n );\n }\n const data = await response.json();\n const filePath = `${rootDir}/src/data/`;\n const fileName = \"projectMetadata.json\";\n // Write the data to a local JSON file\n fs.writeFileSync(\n path.resolve(filePath, fileName),\n JSON.stringify(data, null, 2)\n );\n console.log(\n `\\x1b[32msuccess\\x1b[0m Project metadata fetched and saved to:\\r\\n\"${filePath}${fileName}\"`\n );\n } catch (error) {\n console.error(\n `Error fetching project metadata from \"${url}\" data:\\r\\n`,\n error\n );\n process.exit(1);\n }\n};\n","const fs = require(\"fs\");\n\nexport const defaultGatsbyConfig = (config: any = {}, plugins: any[] = []) => {\n if (!process.env.GATSBY_PROJECT_ROOT) {\n throw new Error(\n 'Please define \"process.env.GATSBY_PROJECT_ROOT = __dirname\" within the ./gatsby-config.js file.'\n );\n }\n const rootDir = process.env.GATSBY_PROJECT_ROOT;\n const project = JSON.parse(\n fs.readFileSync(`${rootDir}/src/data/projectMetadata.json`, \"utf-8\")\n );\n const isMultiLingual = project.languages.length > 1;\n\n // Add multi-language plugins (only multi-language projects):\n if (isMultiLingual) {\n plugins.push({\n resolve: `gatsby-source-filesystem`,\n options: {\n path: `${rootDir}/locales`,\n name: `locale`,\n },\n });\n plugins.push({\n resolve: `gatsby-plugin-react-i18next`,\n options: {\n localeJsonSourceName: `locale`,\n defaultLanguage: process.env.PROJECT_DEFAULT_LANGUAGE,\n fallbackLng: process.env.PROJECT_DEFAULT_LANGUAGE,\n languages: project.languages,\n siteUrl: `${process.env.PROTOCOL}://${process.env.HOST}`,\n trailingSlash: \"always\",\n i18nextOptions: {\n interpolation: {\n escapeValue: false,\n },\n keySeparator: false,\n nsSeparator: false,\n react: {\n transSupportBasicHtmlNodes: true,\n transKeepBasicHtmlNodesFor: [\n \"a\",\n \"br\",\n \"span\",\n \"strong\",\n \"i\",\n \"p\",\n \"ul\",\n \"li\",\n \"h1\",\n \"h2\",\n \"h3\",\n \"h4\",\n \"h5\",\n ],\n },\n },\n redirect: false,\n pages: [\n {\n matchPath: \"/:lang?/(.*)\", // Prevents duplication of pages (Otherwise i18 plugin duplicates pages adding language code prefix)\n getLanguageFromPath: true,\n languages: project.languages,\n },\n ],\n },\n });\n }\n\n return {\n siteMetadata: {\n title: process.env.SITE_TITLE,\n description: process.env.SITE_DESCRIPTION,\n siteUrl: `${process.env.PROTOCOL}://${process.env.HOST}`,\n image: process.env.SITE_IMAGE,\n protocol: process.env.PROTOCOL,\n domain: process.env.HOST,\n },\n plugins: [\n `gatsby-plugin-image`,\n \"gatsby-plugin-use-query-params\",\n \"gatsby-plugin-svgr\",\n `gatsby-transformer-sharp`,\n \"gatsby-plugin-sass\",\n {\n resolve: `gatsby-plugin-manifest`,\n options: {\n name: project.name,\n short_name: project.name,\n lang: process.env.PROJECT_DEFAULT_LANGUAGE,\n background_color: project.background_colour,\n theme_color: project.colour,\n start_url: `/`,\n display: `standalone`,\n icon: process.env.PROJECT_ICON ?? \"static/icons/favicon.png\",\n },\n },\n {\n resolve: `gatsby-plugin-sharp`,\n options: {\n defaults: {\n formats: [`auto`, `webp`, \"avif\"],\n placeholder: `blurred`,\n quality: 80,\n breakpoints: [360, 769, 1024, 1216, 1408],\n backgroundColor: `transparent`,\n tracedSVGOptions: {},\n blurredOptions: {},\n jpgOptions: {},\n pngOptions: {},\n webpOptions: {},\n avifOptions: {},\n },\n },\n },\n {\n resolve: \"gatsby-source-apiserver\",\n options: {\n typePrefix: \"API__\",\n method: \"get\",\n allowCache: false,\n headers: {\n \"Content-Type\": \"application/json\",\n },\n data: {}, // Request body\n params: {},\n verboseOutput: false,\n // enableDevRefresh: true,\n entitiesArray: [\n {\n url: `${process.env.API_PROTOCOL}://${process.env.API_HOST}/v1/${process.env.PROJECT}/redirection/`,\n headers: {\n \"Content-Type\": \"application/json\",\n },\n name: \"redirections\",\n skipCreateNode: true,\n localSave: true,\n path: `${rootDir}/src/data/pages/`,\n },\n ...project.languages.map((language: string) => ({\n url: `${process.env.API_PROTOCOL}://${process.env.API_HOST}/v1/${process.env.PROJECT}/full-content/?language=${language}`,\n headers: {\n \"Content-Type\": \"application/json\",\n },\n name: `site-${language}`,\n skipCreateNode: true,\n localSave: true,\n path: `${rootDir}/src/data/pages/`,\n })),\n ],\n },\n },\n {\n resolve: `gatsby-plugin-s3`,\n options: {\n bucketName: process.env.S3_BUCKET,\n protocol: process.env.PROTOCOL,\n hostname: process.env.HOST,\n generateRoutingRules: true,\n generateRedirectObjectsForPermanentRedirects: true,\n acl: \"private\",\n },\n },\n {\n resolve: `gatsby-plugin-sitemap`,\n options: {\n // Skip homepage \"/\" on multi-language projects, because it uses \"/en/\" instead.\n excludes: [\"/404/\", \"/**/404/\", isMultiLingual ? \"/\" : \"\"],\n query: `\n {\n allSitePage {\n nodes {\n path\n pageContext\n }\n }\n }\n `,\n resolveSiteUrl: () => `${process.env.PROTOCOL}://${process.env.HOST}`,\n filterPages: (page: any) => page.pageContext.is_hidden,\n serialize: (page: any, { resolvePagePath }: any) => {\n const url: any = {\n url: resolvePagePath(page),\n lastmod: page.pageContext.published_at,\n };\n // Generate hreflang links for multi-language projects:\n if (isMultiLingual) {\n url.links = project.languages.reduce(\n (acc: any, lang: string) => {\n // Avoid creating links for non-English pages when the \"redirect_to_english\" flag is active:\n if (!page.pageContext.redirect_to_english || lang === \"en\") {\n acc.push({\n lang: lang,\n url: url.url.replace(/^\\/[a-z]{2}\\//, `/${lang}/`),\n });\n }\n return acc;\n },\n [\n {\n lang: \"x-default\",\n url: url.url.replace(\n /^\\/[a-z]{2}\\//,\n `/${process.env.PROJECT_DEFAULT_LANGUAGE}/`\n ),\n },\n ]\n );\n }\n return url;\n },\n },\n },\n {\n resolve: \"gatsby-plugin-google-tagmanager\",\n options: {\n id: process.env.GTM_ID,\n },\n },\n {\n resolve: \"gatsby-plugin-newrelic\",\n options: {\n config: {\n instrumentationType: \"proAndSPA\",\n accountId: process.env.NEWRELIC_ACCOUNT_ID,\n trustKey: process.env.NEWRELIC_TRUST_KEY,\n agentID: process.env.NEWRELIC_AGENT_ID,\n licenseKey: process.env.NEWRELIC_LICENSE_KEY,\n applicationID: process.env.NEWRELIC_APP_ID,\n beacon: \"bam.nr-data.net\",\n errorBeacon: \"bam.nr-data.net\",\n },\n },\n },\n ...plugins,\n ],\n ...config,\n };\n};\n","import { NOptionsType } from \"./types\";\n\n/**\n *\n * Creates a Object with numeric options for a Select input.\n *\n * @param n Number of options to create\n * @param start The number from which the options start\n * @param defaultOpt Default options to be added into the resulting object\n * @returns Object with the created options, for instance: { \"0\": \"0\", \"1\": \"1\", ... }\n *\n */\nexport const nOptions = (\n n: number,\n start = 0,\n defaultOpt = {}\n): NOptionsType => {\n const obj: NOptionsType = { ...defaultOpt };\n for (let i = start; i < start + n; i++) {\n obj[i.toString()] = i.toString();\n }\n return obj;\n};\n"],"names":["randomString","length","characters","result","i","charAt","Math","floor","random","joinPaths","path1","path2","replace","RegExp","slugify","module","require","fs","path","build","async","body","page","domainRoot","process","env","HOST","data","metas","language","key","value","Object","entries","head","title","replacePageMetas","element","push","buildElement","slug","tags","createAPIRedirections","createRedirect","isMultiLingual","pagesRedirections","redirections","JSON","parse","readFileSync","GATSBY_PROJECT_ROOT","redirection","PROTOCOL","type","forEach","redirect","fromPath","toPath","isPermanent","redirectInBrowser","force","context","name","existsSync","import","ENV","console","warn","getImage","withArtDirection","apiLink","apiPath","queryParams","API_PROTOCOL","API_HOST","URLSearchParams","toString","buildImage","img","fallback","src","url","sizes","srcSet","sources","placeholder","width","sort","a","b","optimized","index","image_url","childImageSharp","gatsbyImageData","backgroundColor","height","layout","images","getImageData","image","mobileImage","image_data","mobile_image_data","media","Error","project","languages","createPage","actions","excluded","jsonDoc","is_hidden","is_active","redirect_to_english","slice","DEV_PAGE","id","parseInt","component","resolve","writeFileSync","stringify","createWebpackConfig","getConfig","config","alias","replaceWebpackConfig","dealSlug","DEALS_ROOT_SLUG","defaultGatsbyConfig","plugins","rootDir","options","localeJsonSourceName","defaultLanguage","PROJECT_DEFAULT_LANGUAGE","fallbackLng","siteUrl","trailingSlash","i18nextOptions","interpolation","escapeValue","keySeparator","nsSeparator","react","transSupportBasicHtmlNodes","transKeepBasicHtmlNodesFor","pages","matchPath","getLanguageFromPath","siteMetadata","SITE_TITLE","description","SITE_DESCRIPTION","SITE_IMAGE","protocol","domain","short_name","lang","background_color","background_colour","theme_color","colour","start_url","display","icon","PROJECT_ICON","defaults","formats","quality","breakpoints","tracedSVGOptions","blurredOptions","jpgOptions","pngOptions","webpOptions","avifOptions","typePrefix","method","allowCache","headers","params","verboseOutput","entitiesArray","PROJECT","skipCreateNode","localSave","map","bucketName","S3_BUCKET","hostname","generateRoutingRules","generateRedirectObjectsForPermanentRedirects","acl","excludes","query","resolveSiteUrl","filterPages","pageContext","serialize","resolvePagePath","lastmod","published_at","links","reduce","acc","GTM_ID","instrumentationType","accountId","NEWRELIC_ACCOUNT_ID","trustKey","NEWRELIC_TRUST_KEY","agentID","NEWRELIC_AGENT_ID","licenseKey","NEWRELIC_LICENSE_KEY","applicationID","NEWRELIC_APP_ID","beacon","errorBeacon","formSection","form","settings","pk","form_method","form_submit","form_redirection","form_ajax_request","recaptcha_action","recaptcha_v3","items","fields","cfg","hasOwnProperty","validTypes","Set","uniqueId","addItem","parents","newItem","item","Array","isArray","children","setFormFields","field","k","fieldName","input_name","sectionName","k2","has","imageData","mobile_image","response","fetch","ok","statusText","json","filePath","fileName","log","error","exit","hotelPages","hotelsByCity","Sydney","Melbourne","Brisbane","Perth","Hobart","Canberra","Adelaide","Darwin","Auckland","Wellington","Singapore","propertyOrder","hotel","city","label","hotelPageLink","hotelName","slugs","TRA","root","lower","VIB","ADI","addressParams","param","join","nOptions","n","start","defaultOpt","obj","postBuild","excludedPages","robotsTxt","SABRE_SSO_PROTOCOL","SABRE_SSO_HOST","tagExists","pageTags","tag","keys","includes","score","parseFloat","toFixed"],"mappings":"aAAO,SAASA,EAAaC,EAAiB,GAC5C,MAAMC,EACJ,iEACF,IAAIC,EAAS,GACb,IAAK,IAAIC,EAAI,EAAGA,EAAIH,EAAQG,IAC1BD,GAAUD,EAAWG,OAAOC,KAAKC,MAAsBL,GAAhBI,KAAKE,WAE9C,OAAOL,CACT,CCNaM,MAAAA,EAAYA,CAACC,EAAeC,IACtC,GAAED,EAAME,QAAQ,IAAIC,OAAQ,MAAM,OAAOF,EAAMC,QAC9C,IAAIC,OAAQ,MACZ,MCLEC,EAAUC,OAAOC,QAAQ,WCEzBC,EAAKF,OAAOC,QAAQ,MACpBE,EAAOH,OAAOC,QAAQ,QA6CfG,EAAQC,UACnB,IAAIC,EAAO,GACXC,EAvB+BA,KAE/B,MAAMC,EAAcC,QAAQC,IAAIC,KAAgBd,QAC9C,sBACA,IAEF,GAAIU,EAAKK,MAAMC,QAAQL,KAAcD,EAAKO,UACxC,IAAK,MAAOC,EAAKC,KAAUC,OAAOC,QAChCX,EAAKK,KAAKC,MAAML,GAAYD,EAAKO,WAErB,UAARC,EAIJR,EAAKY,KAAKN,MAAME,GAAOC,EAHrBT,EAAKY,KAAKC,MAAQJ,EAMxB,OAAOT,CAAI,EAMJc,CAAiBd,GACxB,IAAK,MAAMe,KAAWf,EAAKD,KACzBA,EAAKiB,WACGC,EAAaF,EAAS,CAC1BG,KAAMlB,EAAK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AQC,IAAIC,QAGjDT,EAAGwG,cACA,GAAEjG,QAAQC,IAAIyB,wCACf0P,EAAUR,KAAK,MAChB,wCFrMoBlR,GACpB,GAAEM,QAAQC,IAAIoR,wBAAwBrR,QAAQC,IAAIqR,iBAAiB5R,sBGT7C6R,CACvBC,KACGvQ,KAEH,IAAK,MAAMwQ,KAAOjR,OAAOkR,KAAKF,GAC5B,GAAIvQ,EAAK0Q,SAASF,GAChB,OAAO,EAGX,OAAO,CAAK,+BHEuBG,GAClC,8DAA6DC,WAC5DD,GACAE,QAAQ"}
@@ -1,2 +1,2 @@
1
- function e(e=9){const s="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";let t="";for(let r=0;r<e;r++)t+=s.charAt(Math.floor(62*Math.random()));return t}const s=(e,s)=>`${e.replace(new RegExp("/$"),"")}/${s.replace(new RegExp("^/"),"")}`,t=e=>{if(!process.env.DEALS_ROOT_SLUG)throw new Error("The env variable DEALS_ROOT_SLUG is not defined!");return s(process.env.DEALS_ROOT_SLUG,e)},r=e=>`${process.env.SABRE_SSO_PROTOCOL}://${process.env.SABRE_SSO_HOST}${e}`,a=e=>`https://www.tripadvisor.com/img/cdsi/img2/ratings/traveler/${parseFloat(e).toFixed(1)}-41022-5.svg`,n=s=>`https://www.opentable.com.au/restref/client?rid=${s}&restref=${s}&lang=en-AU&r3uid=${e(9)}&ot_source=Restaurant+website&color=1`,o=(e,s=0,t={})=>{const r={...t};for(let t=s;t<s+e;t++)r[t.toString()]=t.toString();return r},i=module.require("slugify"),c=e=>{let s={Sydney:[],Melbourne:[],Brisbane:[],Perth:[],Hobart:[],Canberra:[],Adelaide:[],"Gold Coast":[],Darwin:[],Auckland:[],Wellington:[],Singapore:[]};const t=Object.entries(e).reduce(((e,[t,r])=>(s[r.city]?s[r.city].push({label:r.name,value:t}):s[r.city]=[{label:r.name,value:t}],e[t]=r.sort,e)),{});return Object.entries(s).map((([e,s])=>({label:e,options:s.sort(((e,s)=>t[e.value]-t[s.value]))})))},l=e=>e.reduce(((e,s)=>(s&&e.push(s),e)),[]).join(", "),p=(e,s,t="en")=>{const r={TRA:{root:`/book-accommodation/${i(e,{lower:!0})}`,slice:11},VIB:{root:`/book-accommodation/${i(e,{lower:!0})}`,slice:5},ADI:{root:`/${t}/apartments/`,slice:22}};return`${r[process.env.PROJECT].root}/${i(s,{lower:!0}).slice(r[process.env.PROJECT].slice)}`},g=module.require("fs"),u=module.require("path"),d=async e=>{let s=[];e=(e=>{const s=process.env.HOST.replace(/^(test\.|staging\.)/,"");if(e.data?.metas?.[s]?.[e.language])for(const[t,r]of Object.entries(e.data.metas[s][e.language]))"title"!==t?e.head.metas[t]=r:e.head.title=r;return e})(e);for(const t of e.body)s.push(await _(t,{slug:e.slug,tags:e.tags,data:e.data}));return e.body=s,e},O=async e=>{if(!process.env.GATSBY_PROJECT_ROOT)throw new Error('Please define "process.env.GATSBY_PROJECT_ROOT = __dirname" within the ./gatsby-config.js file.');const s=JSON.parse(g.readFileSync(`${process.env.GATSBY_PROJECT_ROOT}/src/data/projectMetadata.json`,"utf-8")),t=s.languages.length>1,{createPage:r,createRedirect:a}=e;let n=[],o=[];for(const e of s.languages){const s=JSON.parse(g.readFileSync(`${process.env.GATSBY_PROJECT_ROOT}/src/data/pages/site-${e}.json`,"utf-8"));for(const a of s){if(a.is_hidden&&o.push(a.slug),!a.is_active)continue;if(t&&a.redirect_to_english&&"en"!==e){n.push({page:a.slug,redirection:`${process.env.PROTOCOL}://${process.env.HOST}/en/${a.slug.slice(4)}`,type:"302",redirectInBrowser:!0});continue}if(process.env.DEV_PAGE&&a.id!==parseInt(`${process.env.DEV_PAGE}`)){console.warn("DEV_PAGE is defined on .env.development file! Only one page will be generated!");continue}const s=require.resolve(`${process.env.GATSBY_PROJECT_ROOT}/src/components/page/index.tsx`),i=await d(a);r({path:a.slug,component:s,context:i}),t&&"/en/404/"===a.slug&&r({path:"/404/",component:s,context:i})}}m(a,t,n),g.writeFileSync(`${process.env.GATSBY_PROJECT_ROOT}/src/data/pages/excluded.json`,JSON.stringify(o))},m=(e,s,t)=>{const r=[...t,...JSON.parse(g.readFileSync(`${process.env.GATSBY_PROJECT_ROOT}/src/data/pages/redirections.json`,"utf-8"))];s&&r.push({page:"/",redirection:`${process.env.PROTOCOL}://${process.env.HOST}/en/`,type:"301"}),r.forEach((s=>{e({fromPath:s.page,toPath:s.redirection,isPermanent:"301"===s.type,redirectInBrowser:s.redirectInBrowser,force:!0})}))},v=()=>{const e=JSON.parse(g.readFileSync(`${process.env.GATSBY_PROJECT_ROOT}/src/data/pages/excluded.json`,"utf-8")),s=["User-agent: *",""+("production"===process.env.ENV?"Allow: /":"Disallow: /"),`${e.length?e.map((e=>`Disallow: ${e}`)).join("\n"):""}`,`Sitemap: ${process.env.PROTOCOL}://${process.env.HOST}/sitemap/sitemap-index.xml`,`Host: ${process.env.PROTOCOL}://${process.env.HOST}`];g.writeFileSync(`${process.env.GATSBY_PROJECT_ROOT}/public/robots.txt`,s.join("\n"))},_=async(e,s)=>{const t=`${process.env.GATSBY_PROJECT_ROOT}/src/components/element/${e.type}/${e.name}/build.js`;if(g.existsSync(t)){const r=await import(t);if(r?.build)return await r.build(e,s)}else"development"===process.env.ENV&&console.warn(`build.js file not found: ${t}`);return e},h=({actions:e,getConfig:s})=>{const t=s();let r={...t.resolve.alias,"react-google-recaptcha-v3":u.resolve(process.env.GATSBY_PROJECT_ROOT,"node_modules","react-google-recaptcha-v3")};t.resolve={...t.resolve,alias:r},e.replaceWebpackConfig(t)},{getImage:T,withArtDirection:f}=module.require("gatsby-plugin-image"),S=module.require("fs"),$=module.require("path"),y=(e,...s)=>{for(const t of Object.keys(e))if(s.includes(t))return!0;return!1},E=(e="",t=null)=>`${s(`${process.env.API_PROTOCOL}://${process.env.API_HOST}`,e)}${t?`?${new URLSearchParams(t).toString()}`:""}`,R=e=>{if(!e)return;let s={src:e.url,sizes:"100vw",srcSet:""},t=[],r={fallback:e.url};const a=[e.width,360,769,1024,1216,1408].sort(((e,s)=>e-s));if(e.optimized){s.src=e.url+e.name+"-"+e.width+"w.jpg",r.fallback=e.url+e.name+"-20w.jpg",t.push({sizes:"100vw",srcSet:"",type:"image/avif"}),t.push({sizes:"100vw",srcSet:"",type:"image/webp"});for(let r in a){if(a[r]>e.width)break;let n=("0"===r?"":",")+e.url+e.name+"-"+a[r];s.srcSet+=n+"w.jpg "+a[r]+"w",t[0].srcSet+=n+"w.avif "+a[r]+"w",t[1].srcSet+=n+"w.webp "+a[r]+"w"}}return T({childImageSharp:{gatsbyImageData:{backgroundColor:"transparent",height:e.height/e.width,width:1,layout:"fullWidth",placeholder:r,images:{fallback:s,sources:t}}}})},b=(e,s)=>{const t=R(e),r=R(s);return t&&r?f(t,[{media:"(max-width: 768px)",image:r}]):t},P=e=>{let s={settings:{pk:0,name:"",form_method:"post",form_submit:E("/v1/project/request/contact"),form_redirection:null,form_ajax_request:null,recaptcha_action:"",recaptcha_v3:!1},items:[],fields:{}};s.settings.recaptcha_v3=!!e.recaptcha_v3,s.settings.recaptcha_action=e.data.recaptcha_action??e.name,s.settings.pk=e.pk,s.settings.name=e.name,["form_submit","form_recipient","form_method","form_redirection","form_ajax_request","form_success_msg"].map((t=>{e.hasOwnProperty(t)&&(s.settings[t]=e[t])}));const t=new Set(["checkbox","input","select","button","google-places","country-prefix","country","textarea","recaptcha2","title","text","link","image"]);let r=0;const a=(e,t)=>{let r=s.items;for(let s of e)r=r[s],Array.isArray(r)||(r=r.children);r.push(t)},n=(e,o,i)=>{let c=e.input_name&&!s.fields[e.input_name]?e.input_name:e.name??`${e.type}${r++}`;if("section"===e.type){const s=e.name??`sec_${o.length}-${i}`;a(o,{name:s,children:[]}),e.children.map(((e,s)=>n(e,[...o,i],s)))}else t.has(e.type)&&(a(o,c),s.fields[c]=e,"image"===e.type&&(s.fields[c].imageData=b(e.image,e.mobile_image)))};return e.children.map(((e,s)=>n(e,[],s))),s},w=async e=>{const s=`${process.env.API_PROTOCOL}://${process.env.API_HOST}/v1/${process.env.PROJECT}/`;try{const t=await fetch(s);if(!t.ok)throw new Error(`Failed to fetch project metadata data from "${s}": ${t.statusText}`);const r=await t.json(),a=`${e}/src/data/`,n="projectMetadata.json";S.writeFileSync($.resolve(a,n),JSON.stringify(r,null,2)),console.log(`success Project metadata fetched and saved to:\r\n"${a}${n}"`)}catch(e){console.error(`Error fetching project metadata from "${s}" data:\r\n`,e),process.exit(1)}},C=require("fs"),A=(e={},s=[])=>{if(!process.env.GATSBY_PROJECT_ROOT)throw new Error('Please define "process.env.GATSBY_PROJECT_ROOT = __dirname" within the ./gatsby-config.js file.');const t=process.env.GATSBY_PROJECT_ROOT,r=JSON.parse(C.readFileSync(`${t}/src/data/projectMetadata.json`,"utf-8")),a=r.languages.length>1;return a&&(s.push({resolve:"gatsby-source-filesystem",options:{path:`${t}/locales`,name:"locale"}}),s.push({resolve:"gatsby-plugin-react-i18next",options:{localeJsonSourceName:"locale",defaultLanguage:process.env.PROJECT_DEFAULT_LANGUAGE,fallbackLng:process.env.PROJECT_DEFAULT_LANGUAGE,languages:r.languages,siteUrl:`${process.env.PROTOCOL}://${process.env.HOST}`,trailingSlash:"always",i18nextOptions:{interpolation:{escapeValue:!1},keySeparator:!1,nsSeparator:!1,react:{transSupportBasicHtmlNodes:!0,transKeepBasicHtmlNodesFor:["a","br","span","strong","i","p","ul","li","h1","h2","h3","h4","h5"]}},redirect:!1,pages:[{matchPath:"/:lang?/(.*)",getLanguageFromPath:!0,languages:r.languages}]}})),{siteMetadata:{title:process.env.SITE_TITLE,description:process.env.SITE_DESCRIPTION,siteUrl:`${process.env.PROTOCOL}://${process.env.HOST}`,image:process.env.SITE_IMAGE,protocol:process.env.PROTOCOL,domain:process.env.HOST},plugins:["gatsby-plugin-image","gatsby-plugin-use-query-params","gatsby-plugin-svgr","gatsby-transformer-sharp","gatsby-plugin-sass",{resolve:"gatsby-plugin-manifest",options:{name:r.name,short_name:r.name,lang:process.env.PROJECT_DEFAULT_LANGUAGE,background_color:r.background_colour,theme_color:r.colour,start_url:"/",display:"standalone",icon:process.env.PROJECT_ICON??"static/icons/favicon.png"}},{resolve:"gatsby-plugin-sharp",options:{defaults:{formats:["auto","webp","avif"],placeholder:"blurred",quality:80,breakpoints:[360,769,1024,1216,1408],backgroundColor:"transparent",tracedSVGOptions:{},blurredOptions:{},jpgOptions:{},pngOptions:{},webpOptions:{},avifOptions:{}}}},{resolve:"gatsby-source-apiserver",options:{typePrefix:"API__",method:"get",allowCache:!1,headers:{"Content-Type":"application/json"},data:{},params:{},verboseOutput:!1,entitiesArray:[{url:`${process.env.API_PROTOCOL}://${process.env.API_HOST}/v1/${process.env.PROJECT}/redirection/`,headers:{"Content-Type":"application/json"},name:"redirections",skipCreateNode:!0,localSave:!0,path:`${t}/src/data/pages/`},...r.languages.map((e=>({url:`${process.env.API_PROTOCOL}://${process.env.API_HOST}/v1/${process.env.PROJECT}/full-content/?language=${e}`,headers:{"Content-Type":"application/json"},name:`site-${e}`,skipCreateNode:!0,localSave:!0,path:`${t}/src/data/pages/`})))]}},{resolve:"gatsby-plugin-s3",options:{bucketName:process.env.S3_BUCKET,protocol:process.env.PROTOCOL,hostname:process.env.HOST,generateRoutingRules:!0,generateRedirectObjectsForPermanentRedirects:!0,acl:"private"}},{resolve:"gatsby-plugin-sitemap",options:{excludes:["/404/","/**/404/",a?"/":""],query:"\n {\n allSitePage {\n nodes {\n path\n pageContext\n }\n }\n }\n ",resolveSiteUrl:()=>`${process.env.PROTOCOL}://${process.env.HOST}`,filterPages:e=>e.is_hidden,serialize:(e,{resolvePagePath:s})=>{const t={url:s(e),lastmod:e.pageContext.published_at};return a&&(t.links=r.languages.reduce(((s,r)=>(e.pageContext.redirect_to_english&&"en"!==r||s.push({lang:r,url:t.url.replace(/^\/[a-z]{2}\//,`/${r}/`)}),s)),[{lang:"x-default",url:t.url.replace(/^\/[a-z]{2}\//,`/${process.env.PROJECT_DEFAULT_LANGUAGE}/`)}])),t}}},{resolve:"gatsby-plugin-google-tagmanager",options:{id:process.env.GTM_ID}},{resolve:"gatsby-plugin-newrelic",options:{config:{instrumentationType:"proAndSPA",accountId:process.env.NEWRELIC_ACCOUNT_ID,trustKey:process.env.NEWRELIC_TRUST_KEY,agentID:process.env.NEWRELIC_AGENT_ID,licenseKey:process.env.NEWRELIC_LICENSE_KEY,applicationID:process.env.NEWRELIC_APP_ID,beacon:"bam.nr-data.net",errorBeacon:"bam.nr-data.net"}}},...s],...e}};export{E as apiLink,_ as buildElement,R as buildImage,O as createAPIPages,h as createWebpackConfig,t as dealLink,A as defaultGatsbyConfig,P as extractForm,w as fetchProjectMetadata,b as getImageData,c as hotelOptionsByCity,p as hotelPageLink,l as joinAddress,s as joinPaths,o as nOptions,n as opentableLink,v as postBuild,e as randomString,r as ssoURL,y as tagExists,a as tripadvisorRatingURL};
1
+ function e(e=9){const t="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";let s="";for(let r=0;r<e;r++)s+=t.charAt(Math.floor(62*Math.random()));return s}const t=(e,t)=>`${e.replace(new RegExp("/$"),"")}/${t.replace(new RegExp("^/"),"")}`,s=e=>{if(!process.env.DEALS_ROOT_SLUG)throw new Error("The env variable DEALS_ROOT_SLUG is not defined!");return t(process.env.DEALS_ROOT_SLUG,e)},r=e=>`${process.env.SABRE_SSO_PROTOCOL}://${process.env.SABRE_SSO_HOST}${e}`,a=e=>`https://www.tripadvisor.com/img/cdsi/img2/ratings/traveler/${parseFloat(e).toFixed(1)}-41022-5.svg`,n=t=>`https://www.opentable.com.au/restref/client?rid=${t}&restref=${t}&lang=en-AU&r3uid=${e(9)}&ot_source=Restaurant+website&color=1`,o=(e,t=0,s={})=>{const r={...s};for(let s=t;s<t+e;s++)r[s.toString()]=s.toString();return r},i=module.require("slugify"),c=e=>{let t={Sydney:[],Melbourne:[],Brisbane:[],Perth:[],Hobart:[],Canberra:[],Adelaide:[],"Gold Coast":[],Darwin:[],Auckland:[],Wellington:[],Singapore:[]};const s=Object.entries(e).reduce(((e,[s,r])=>(t[r.city]?t[r.city].push({label:r.name,value:s}):t[r.city]=[{label:r.name,value:s}],e[s]=r.sort,e)),{});return Object.entries(t).map((([e,t])=>({label:e,options:t.sort(((e,t)=>s[e.value]-s[t.value]))})))},l=e=>e.reduce(((e,t)=>(t&&e.push(t),e)),[]).join(", "),p=(e,t,s="en")=>{const r={TRA:{root:`/book-accommodation/${i(e,{lower:!0})}`,slice:11},VIB:{root:`/book-accommodation/${i(e,{lower:!0})}`,slice:5},ADI:{root:`/${s}/apartments/`,slice:22}};return`${r[process.env.PROJECT].root}/${i(t,{lower:!0}).slice(r[process.env.PROJECT].slice)}`},g=module.require("fs"),u=module.require("path"),d=async e=>{let t=[];e=(e=>{const t=process.env.HOST.replace(/^(test\.|staging\.)/,"");if(e.data?.metas?.[t]?.[e.language])for(const[s,r]of Object.entries(e.data.metas[t][e.language]))"title"!==s?e.head.metas[s]=r:e.head.title=r;return e})(e);for(const s of e.body)t.push(await _(s,{slug:e.slug,tags:e.tags,data:e.data}));return e.body=t,e},O=async e=>{if(!process.env.GATSBY_PROJECT_ROOT)throw new Error('Please define "process.env.GATSBY_PROJECT_ROOT = __dirname" within the ./gatsby-config.js file.');const t=JSON.parse(g.readFileSync(`${process.env.GATSBY_PROJECT_ROOT}/src/data/projectMetadata.json`,"utf-8")),s=t.languages.length>1,{createPage:r,createRedirect:a}=e;let n=[],o=[];for(const e of t.languages){const t=JSON.parse(g.readFileSync(`${process.env.GATSBY_PROJECT_ROOT}/src/data/pages/site-${e}.json`,"utf-8"));for(const a of t){if(a.is_hidden&&o.push(a.slug),!a.is_active)continue;if(s&&a.redirect_to_english&&"en"!==e){n.push({page:a.slug,redirection:`${process.env.PROTOCOL}://${process.env.HOST}/en/${a.slug.slice(4)}`,type:"302",redirectInBrowser:!0});continue}if(process.env.DEV_PAGE&&a.id!==parseInt(`${process.env.DEV_PAGE}`)){console.warn("DEV_PAGE is defined on .env.development file! Only one page will be generated!");continue}const t=require.resolve(`${process.env.GATSBY_PROJECT_ROOT}/src/components/page/index.tsx`),i=await d(a);r({path:a.slug,component:t,context:i}),s&&"/en/404/"===a.slug&&r({path:"/404/",component:t,context:i})}}m(a,s,n),g.writeFileSync(`${process.env.GATSBY_PROJECT_ROOT}/src/data/pages/excluded.json`,JSON.stringify(o))},m=(e,t,s)=>{const r=[...s,...JSON.parse(g.readFileSync(`${process.env.GATSBY_PROJECT_ROOT}/src/data/pages/redirections.json`,"utf-8"))];t&&r.push({page:"/",redirection:`${process.env.PROTOCOL}://${process.env.HOST}/en/`,type:"301"}),r.forEach((t=>{e({fromPath:t.page,toPath:t.redirection,isPermanent:"301"===t.type,redirectInBrowser:t.redirectInBrowser,force:!0})}))},v=()=>{const e=JSON.parse(g.readFileSync(`${process.env.GATSBY_PROJECT_ROOT}/src/data/pages/excluded.json`,"utf-8")),t=["User-agent: *",""+("production"===process.env.ENV?"Allow: /":"Disallow: /"),`${e.length?e.map((e=>`Disallow: ${e}`)).join("\n"):""}`,`Sitemap: ${process.env.PROTOCOL}://${process.env.HOST}/sitemap/sitemap-index.xml`,`Host: ${process.env.PROTOCOL}://${process.env.HOST}`];g.writeFileSync(`${process.env.GATSBY_PROJECT_ROOT}/public/robots.txt`,t.join("\n"))},_=async(e,t)=>{const s=`${process.env.GATSBY_PROJECT_ROOT}/src/components/element/${e.type}/${e.name}/build.js`;if(g.existsSync(s)){const r=await import(s);if(r?.build)return await r.build(e,t)}else"development"===process.env.ENV&&console.warn(`build.js file not found: ${s}`);return e},h=({actions:e,getConfig:t})=>{const s=t();let r={...s.resolve.alias,"react-google-recaptcha-v3":u.resolve(process.env.GATSBY_PROJECT_ROOT,"node_modules","react-google-recaptcha-v3")};s.resolve={...s.resolve,alias:r},e.replaceWebpackConfig(s)},{getImage:T,withArtDirection:f}=module.require("gatsby-plugin-image"),S=module.require("fs"),$=module.require("path"),y=(e,...t)=>{for(const s of Object.keys(e))if(t.includes(s))return!0;return!1},E=(e="",s=null)=>`${t(`${process.env.API_PROTOCOL}://${process.env.API_HOST}`,e)}${s?`?${new URLSearchParams(s).toString()}`:""}`,R=e=>{if(!e)return;let t={src:e.url,sizes:"100vw",srcSet:""},s=[],r={fallback:e.url};const a=[e.width,360,769,1024,1216,1408].sort(((e,t)=>e-t));if(e.optimized){t.src=e.url+e.name+"-"+e.width+"w.jpg",r.fallback=e.url+e.name+"-20w.jpg",s.push({sizes:"100vw",srcSet:"",type:"image/avif"}),s.push({sizes:"100vw",srcSet:"",type:"image/webp"});for(let r in a){if(a[r]>e.width)break;let n=("0"===r?"":",")+e.url+e.name+"-"+a[r];t.srcSet+=n+"w.jpg "+a[r]+"w",s[0].srcSet+=n+"w.avif "+a[r]+"w",s[1].srcSet+=n+"w.webp "+a[r]+"w"}}return T({childImageSharp:{gatsbyImageData:{backgroundColor:"transparent",height:e.height/e.width,width:1,layout:"fullWidth",placeholder:r,images:{fallback:t,sources:s}}}})},b=(e,t)=>{const s=R(e),r=R(t);return s&&r?f(s,[{media:"(max-width: 768px)",image:r}]):s},P=e=>{let t={settings:{pk:0,name:"",form_method:"post",form_submit:E("/v1/project/request/contact"),form_redirection:null,form_ajax_request:null,recaptcha_action:"",recaptcha_v3:!1},items:[],fields:{}};t.settings.recaptcha_v3=!!e.recaptcha_v3,t.settings.recaptcha_action=e.data.recaptcha_action??e.name,t.settings.pk=e.pk,t.settings.name=e.name,["form_submit","form_recipient","form_method","form_redirection","form_ajax_request","form_success_msg"].map((s=>{e.hasOwnProperty(s)&&(t.settings[s]=e[s])}));const s=new Set(["checkbox","input","select","button","google-places","country-prefix","country","textarea","recaptcha2","title","text","link","image"]);let r=0;const a=(e,s)=>{let r=t.items;for(let t of e)r=r[t],Array.isArray(r)||(r=r.children);r.push(s)},n=(e,o,i)=>{let c=e.input_name&&!t.fields[e.input_name]?e.input_name:e.name??`${e.type}${r++}`;if("section"===e.type){const t=e.name??`sec_${o.length}-${i}`;a(o,{name:t,children:[]}),e.children.map(((e,t)=>n(e,[...o,i],t)))}else s.has(e.type)&&(a(o,c),t.fields[c]=e,"image"===e.type&&(t.fields[c].imageData=b(e.image,e.mobile_image)))};return e.children.map(((e,t)=>n(e,[],t))),t},w=async e=>{const t=`${process.env.API_PROTOCOL}://${process.env.API_HOST}/v1/${process.env.PROJECT}/`;try{const s=await fetch(t);if(!s.ok)throw new Error(`Failed to fetch project metadata data from "${t}": ${s.statusText}`);const r=await s.json(),a=`${e}/src/data/`,n="projectMetadata.json";S.writeFileSync($.resolve(a,n),JSON.stringify(r,null,2)),console.log(`success Project metadata fetched and saved to:\r\n"${a}${n}"`)}catch(e){console.error(`Error fetching project metadata from "${t}" data:\r\n`,e),process.exit(1)}},C=require("fs"),A=(e={},t=[])=>{if(!process.env.GATSBY_PROJECT_ROOT)throw new Error('Please define "process.env.GATSBY_PROJECT_ROOT = __dirname" within the ./gatsby-config.js file.');const s=process.env.GATSBY_PROJECT_ROOT,r=JSON.parse(C.readFileSync(`${s}/src/data/projectMetadata.json`,"utf-8")),a=r.languages.length>1;return a&&(t.push({resolve:"gatsby-source-filesystem",options:{path:`${s}/locales`,name:"locale"}}),t.push({resolve:"gatsby-plugin-react-i18next",options:{localeJsonSourceName:"locale",defaultLanguage:process.env.PROJECT_DEFAULT_LANGUAGE,fallbackLng:process.env.PROJECT_DEFAULT_LANGUAGE,languages:r.languages,siteUrl:`${process.env.PROTOCOL}://${process.env.HOST}`,trailingSlash:"always",i18nextOptions:{interpolation:{escapeValue:!1},keySeparator:!1,nsSeparator:!1,react:{transSupportBasicHtmlNodes:!0,transKeepBasicHtmlNodesFor:["a","br","span","strong","i","p","ul","li","h1","h2","h3","h4","h5"]}},redirect:!1,pages:[{matchPath:"/:lang?/(.*)",getLanguageFromPath:!0,languages:r.languages}]}})),{siteMetadata:{title:process.env.SITE_TITLE,description:process.env.SITE_DESCRIPTION,siteUrl:`${process.env.PROTOCOL}://${process.env.HOST}`,image:process.env.SITE_IMAGE,protocol:process.env.PROTOCOL,domain:process.env.HOST},plugins:["gatsby-plugin-image","gatsby-plugin-use-query-params","gatsby-plugin-svgr","gatsby-transformer-sharp","gatsby-plugin-sass",{resolve:"gatsby-plugin-manifest",options:{name:r.name,short_name:r.name,lang:process.env.PROJECT_DEFAULT_LANGUAGE,background_color:r.background_colour,theme_color:r.colour,start_url:"/",display:"standalone",icon:process.env.PROJECT_ICON??"static/icons/favicon.png"}},{resolve:"gatsby-plugin-sharp",options:{defaults:{formats:["auto","webp","avif"],placeholder:"blurred",quality:80,breakpoints:[360,769,1024,1216,1408],backgroundColor:"transparent",tracedSVGOptions:{},blurredOptions:{},jpgOptions:{},pngOptions:{},webpOptions:{},avifOptions:{}}}},{resolve:"gatsby-source-apiserver",options:{typePrefix:"API__",method:"get",allowCache:!1,headers:{"Content-Type":"application/json"},data:{},params:{},verboseOutput:!1,entitiesArray:[{url:`${process.env.API_PROTOCOL}://${process.env.API_HOST}/v1/${process.env.PROJECT}/redirection/`,headers:{"Content-Type":"application/json"},name:"redirections",skipCreateNode:!0,localSave:!0,path:`${s}/src/data/pages/`},...r.languages.map((e=>({url:`${process.env.API_PROTOCOL}://${process.env.API_HOST}/v1/${process.env.PROJECT}/full-content/?language=${e}`,headers:{"Content-Type":"application/json"},name:`site-${e}`,skipCreateNode:!0,localSave:!0,path:`${s}/src/data/pages/`})))]}},{resolve:"gatsby-plugin-s3",options:{bucketName:process.env.S3_BUCKET,protocol:process.env.PROTOCOL,hostname:process.env.HOST,generateRoutingRules:!0,generateRedirectObjectsForPermanentRedirects:!0,acl:"private"}},{resolve:"gatsby-plugin-sitemap",options:{excludes:["/404/","/**/404/",a?"/":""],query:"\n {\n allSitePage {\n nodes {\n path\n pageContext\n }\n }\n }\n ",resolveSiteUrl:()=>`${process.env.PROTOCOL}://${process.env.HOST}`,filterPages:e=>e.pageContext.is_hidden,serialize:(e,{resolvePagePath:t})=>{const s={url:t(e),lastmod:e.pageContext.published_at};return a&&(s.links=r.languages.reduce(((t,r)=>(e.pageContext.redirect_to_english&&"en"!==r||t.push({lang:r,url:s.url.replace(/^\/[a-z]{2}\//,`/${r}/`)}),t)),[{lang:"x-default",url:s.url.replace(/^\/[a-z]{2}\//,`/${process.env.PROJECT_DEFAULT_LANGUAGE}/`)}])),s}}},{resolve:"gatsby-plugin-google-tagmanager",options:{id:process.env.GTM_ID}},{resolve:"gatsby-plugin-newrelic",options:{config:{instrumentationType:"proAndSPA",accountId:process.env.NEWRELIC_ACCOUNT_ID,trustKey:process.env.NEWRELIC_TRUST_KEY,agentID:process.env.NEWRELIC_AGENT_ID,licenseKey:process.env.NEWRELIC_LICENSE_KEY,applicationID:process.env.NEWRELIC_APP_ID,beacon:"bam.nr-data.net",errorBeacon:"bam.nr-data.net"}}},...t],...e}};export{E as apiLink,_ as buildElement,R as buildImage,O as createAPIPages,h as createWebpackConfig,s as dealLink,A as defaultGatsbyConfig,P as extractForm,w as fetchProjectMetadata,b as getImageData,c as hotelOptionsByCity,p as hotelPageLink,l as joinAddress,t as joinPaths,o as nOptions,n as opentableLink,v as postBuild,e as randomString,r as ssoURL,y as tagExists,a as tripadvisorRatingURL};
2
2
  //# sourceMappingURL=index.node.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.node.esm.js","sources":["../src/node/string/index.ts","../src/node/url/index.ts","../src/node/form/index.ts","../src/node/property/index.ts","../src/node/build/index.ts","../src/node/api/index.ts","../src/node/config/index.ts"],"sourcesContent":["export function randomString(length: number = 9): string {\n const characters =\n \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\";\n let result = \"\";\n for (let i = 0; i < length; i++) {\n result += characters.charAt(Math.floor(Math.random() * characters.length));\n }\n return result;\n}\n","import { randomString } from \"../string\";\n\nexport const joinPaths = (path1: string, path2: string): string =>\n `${path1.replace(new RegExp(`/$`), \"\")}/${path2.replace(\n new RegExp(`^/`),\n \"\"\n )}`;\n\nexport const dealLink = (dealSlug: string): string => {\n if (!process.env.DEALS_ROOT_SLUG)\n throw new Error(\"The env variable DEALS_ROOT_SLUG is not defined!\");\n return joinPaths(process.env.DEALS_ROOT_SLUG as string, dealSlug);\n};\n\nexport const ssoURL = (path: string) =>\n `${process.env.SABRE_SSO_PROTOCOL}://${process.env.SABRE_SSO_HOST}${path}`;\n\nexport const tripadvisorRatingURL = (score: string) =>\n `https://www.tripadvisor.com/img/cdsi/img2/ratings/traveler/${parseFloat(\n score\n ).toFixed(1)}-41022-5.svg`;\n\nexport const opentableLink = (id: number): string =>\n `https://www.opentable.com.au/restref/client?rid=${id}&restref=${id}&lang=en-AU&r3uid=${randomString(\n 9\n )}&ot_source=Restaurant+website&color=1`;\n","import { NOptionsType } from \"./types\";\n\n/**\n *\n * Creates a Object with numeric options for a Select input.\n *\n * @param n Number of options to create\n * @param start The number from which the options start\n * @param defaultOpt Default options to be added into the resulting object\n * @returns Object with the created options, for instance: { \"0\": \"0\", \"1\": \"1\", ... }\n *\n */\nexport const nOptions = (\n n: number,\n start = 0,\n defaultOpt = {}\n): NOptionsType => {\n const obj: NOptionsType = { ...defaultOpt };\n for (let i = start; i < start + n; i++) {\n obj[i.toString()] = i.toString();\n }\n return obj;\n};\n","const slugify = module.require(\"slugify\");\nimport { HotelOptionsByCityType, HotelPagesType, CityKeyType } from \"./types\";\n\n/**\n *\n * Returns Select options sorting by the cities with more hotels, otherwise alphabetically.\n *\n * For instance:\n *\n * [\n * {\n * label: 'Sydney',\n * options: [\n * { label: 'Vibe Hotel Sydney', value: \"58443\" },\n * { label: 'Vibe Hotel Sydney Darling Harbour', value: \"8565\" }\n * ]\n * },\n * {\n * label: 'Mebourne',\n * options: [\n * { label: 'Vibe Hotel Melbourne', value: \"9969\" },\n * ]\n * },\n * ]\n */\nexport const hotelOptionsByCity = (\n hotelPages: HotelPagesType\n): HotelOptionsByCityType[] => {\n let hotelsByCity: Record<CityKeyType, { value: string; label: string }[]> = {\n Sydney: [],\n Melbourne: [],\n Brisbane: [],\n Perth: [],\n Hobart: [],\n Canberra: [],\n Adelaide: [],\n \"Gold Coast\": [],\n Darwin: [],\n Auckland: [],\n Wellington: [],\n Singapore: [],\n };\n const propertyOrder = Object.entries(hotelPages).reduce(\n (acc, [id, hotel]) => {\n if (hotelsByCity[hotel.city]) {\n hotelsByCity[hotel.city].push({ label: hotel.name, value: id });\n } else {\n hotelsByCity[hotel.city] = [{ label: hotel.name, value: id }];\n }\n acc[id] = hotel.sort;\n return acc;\n },\n {} as { [k: string]: number }\n );\n return Object.entries(hotelsByCity).map(([city, options]) => {\n return {\n label: city,\n options: options.sort(\n (a, b) => propertyOrder[a.value] - propertyOrder[b.value]\n ),\n };\n });\n};\n\n/**\n * Joins the Property address\n */\nexport const joinAddress = (addressParams: (string | null)[]) =>\n addressParams\n .reduce((acc: string[], param: string | null) => {\n if (param) {\n acc.push(param);\n }\n return acc;\n }, [])\n .join(\", \");\n\nexport const hotelPageLink = (\n city: string,\n hotelName: string,\n lang: String = \"en\"\n) => {\n const slugs: any = {\n TRA: {\n root: `/book-accommodation/${slugify(city, { lower: true })}`,\n slice: 11,\n },\n VIB: {\n root: `/book-accommodation/${slugify(city, { lower: true })}`,\n slice: 5,\n },\n ADI: { root: `/${lang}/apartments/`, slice: 22 },\n };\n return `${slugs[process.env.PROJECT as string].root}/${slugify(hotelName, {\n lower: true,\n }).slice(slugs[process.env.PROJECT as string].slice)}`;\n};\n","import { Actions } from \"gatsby\";\nimport { RedirectionType } from \"./types\";\nconst fs = module.require(\"fs\");\nconst path = module.require(\"path\");\n\n/**\n * Replace Page Metas\n *\n * Replaces the page metas only on multi-domain projects.\n * For instance if the current page has the following metas defined within the page attributes:\n *\n * {\n * \"metas\": {\n * \"rendezvoushotels.co.nz\": {\n * \"en\": {\n * \"title\": \"Rendezvous hotels in New Zealand\",\n * \"description\": \"Book the best hotels in New Zealand\"\n * }\n * }\n * }\n * }\n *\n * and if the current HOST domain (e.g: \"rendezvoushotels.co.nz\") matches one defined in the metas,\n * the page metas will be replaced by the ones defined on this page attributes.\n *\n * @param page Gatsby Page context\n */\nexport const replacePageMetas = (page: any) => {\n // Remove \"staging.\" and \"test.\" prefixes when checking domain metas for convenience (avoids duplication)\n const domainRoot = (process.env.HOST as string).replace(\n /^(test\\.|staging\\.)/,\n \"\"\n );\n if (page.data?.metas?.[domainRoot]?.[page.language]) {\n for (const [key, value] of Object.entries(\n page.data.metas[domainRoot][page.language]\n )) {\n if (key === \"title\") {\n page.head.title = value;\n continue;\n }\n page.head.metas[key] = value;\n }\n }\n return page;\n};\n\n// Build page elements (only for the ones having a build.js)\nexport const build = async (page: any) => {\n let body = [];\n page = replacePageMetas(page); // Multi-domain projects\n for (const element of page.body) {\n body.push(\n await buildElement(element, {\n slug: page.slug,\n tags: page.tags,\n data: page.data,\n })\n );\n }\n page.body = body;\n return page;\n};\n\n/**\n * Generate API pages\n *\n * @param actions Gatsby actions: https://www.gatsbyjs.com/docs/reference/config-files/actions/\n */\nexport const createAPIPages = async (actions: Actions) => {\n if (!process.env.GATSBY_PROJECT_ROOT) {\n throw new Error(\n 'Please define \"process.env.GATSBY_PROJECT_ROOT = __dirname\" within the ./gatsby-config.js file.'\n );\n }\n const project = JSON.parse(\n fs.readFileSync(\n `${process.env.GATSBY_PROJECT_ROOT}/src/data/projectMetadata.json`,\n \"utf-8\"\n )\n );\n const isMultiLingual = project.languages.length > 1;\n const { createPage, createRedirect } = actions;\n let redirections: RedirectionType[] = [];\n let excluded: string[] = []; // List of excluded pages\n for (const language of project.languages) {\n const jsonDoc = JSON.parse(\n fs.readFileSync(\n `${process.env.GATSBY_PROJECT_ROOT}/src/data/pages/site-${language}.json`,\n `utf-8`\n )\n );\n for (const page of jsonDoc) {\n if (page.is_hidden) {\n excluded.push(page.slug);\n }\n // Skip disabled pages\n if (!page.is_active) {\n continue;\n }\n // Skip non-English pages when they are not translated (only on multi-language projects)\n // Also, creates a 302 (temporally) redirection to English version.\n if (isMultiLingual && page.redirect_to_english && language !== \"en\") {\n redirections.push({\n page: page.slug,\n redirection: `${process.env.PROTOCOL}://${process.env.HOST}/en/${page.slug.slice(4)}`,\n type: \"302\",\n redirectInBrowser: true, // Redirect also in browser because 302 redirection only work on full page loads.\n });\n continue;\n }\n // Skip when \"DEV_PAGE\" is defined on \"./.env.development\" and doesn't match current page:\n if (\n process.env.DEV_PAGE &&\n page.id !== parseInt(`${process.env.DEV_PAGE}`)\n ) {\n console.warn(\n \"DEV_PAGE is defined on .env.development file! Only one page will be generated!\"\n );\n continue;\n }\n const component = require.resolve(\n `${process.env.GATSBY_PROJECT_ROOT}/src/components/page/index.tsx`\n );\n const context = await build(page);\n createPage({\n path: page.slug,\n component: component,\n context: context,\n });\n // The root /404/ page must also be created on multi-language projects to\n // handle non-existing root pages without language prefix, E.G: https://mysite.com/non-existing-page\n if (isMultiLingual && page.slug === \"/en/404/\") {\n createPage({\n path: \"/404/\",\n component: component,\n context: context,\n });\n }\n }\n }\n\n createAPIRedirections(createRedirect, isMultiLingual, redirections);\n // Generate the file \"./src/data/excluded.json\" containing the pages which should be excluded on the sitemap and disallowed within robots.txt.\n fs.writeFileSync(\n `${process.env.GATSBY_PROJECT_ROOT}/src/data/pages/excluded.json`,\n JSON.stringify(excluded)\n );\n};\n\n/**\n * Generate API redirections\n */\nexport const createAPIRedirections = (\n createRedirect: Actions[\"createRedirect\"],\n isMultiLingual: boolean,\n pagesRedirections: RedirectionType[]\n) => {\n // Load API redirections\n const redirections = [\n ...pagesRedirections,\n ...JSON.parse(\n fs.readFileSync(\n `${process.env.GATSBY_PROJECT_ROOT}/src/data/pages/redirections.json`,\n `utf-8`\n )\n ),\n ];\n // Redirect homepage \"/\" to \"/en/\" on multi-language projects\n if (isMultiLingual) {\n redirections.push({\n page: \"/\",\n redirection: `${process.env.PROTOCOL}://${process.env.HOST}/en/`,\n type: \"301\",\n });\n }\n\n redirections.forEach((redirect: RedirectionType) => {\n createRedirect({\n fromPath: redirect.page,\n toPath: redirect.redirection,\n isPermanent: redirect.type === \"301\",\n redirectInBrowser: redirect.redirectInBrowser,\n force: true,\n });\n });\n};\n\n/**\n * Function executed after creating pages to perform following tasks:\n * - Creation of \"robots.txt\"\n */\nexport const postBuild = () => {\n const excludedPages = JSON.parse(\n fs.readFileSync(\n `${process.env.GATSBY_PROJECT_ROOT}/src/data/pages/excluded.json`,\n `utf-8`\n )\n );\n\n const robotsTxt = [\n \"User-agent: *\",\n `${process.env.ENV === \"production\" ? \"Allow: /\" : \"Disallow: /\"}`,\n `${excludedPages.length ? excludedPages.map((slug: string) => `Disallow: ${slug}`).join(\"\\n\") : \"\"}`,\n `Sitemap: ${process.env.PROTOCOL}://${process.env.HOST}/sitemap/sitemap-index.xml`,\n `Host: ${process.env.PROTOCOL}://${process.env.HOST}`,\n ];\n\n fs.writeFileSync(\n `${process.env.GATSBY_PROJECT_ROOT}/public/robots.txt`,\n robotsTxt.join(\"\\n\")\n );\n};\n\n/**\n * Builds API Element (usually for \"section\" and \"data\" elements)\n * This generates a initial data structure for the section/data to avoid processing the React component\n * initial state on every single render.\n *\n * @param element API element\n * @param context\n * @returns\n */\nexport const buildElement = async (element: any, context: any) => {\n const path = `${process.env.GATSBY_PROJECT_ROOT}/src/components/element/${element.type}/${element.name}/build.js`;\n if (fs.existsSync(path)) {\n const module = await import(path);\n if (module?.build) {\n return await module.build(element, context);\n }\n // Show warning on development:\n } else if (process.env.ENV === \"development\") {\n console.warn(`build.js file not found: ${path}`);\n }\n return element;\n};\n\n/**\n *\n * Fixes Development bugs on forms (Recaptcha v3) and Toast.\n * The bug is caused when running `yarn link \"@tfehotels/tfe-gatsby-library\"` on development\n * because this library will try to find the modules at the @tfehotels/tfe-gatsby-library/node_modules folder\n * instead of using the ./node_modules/ of the project.\n *\n */\nexport const createWebpackConfig = ({ actions, getConfig }: any) => {\n const config = getConfig();\n let alias = {\n ...config.resolve.alias,\n \"react-google-recaptcha-v3\": path.resolve(\n process.env.GATSBY_PROJECT_ROOT,\n \"node_modules\",\n \"react-google-recaptcha-v3\"\n ),\n };\n // if (process.env.ENV === \"development\") {\n // alias[\"react-hot-toast\"] = path.resolve(\n // process.env.GATSBY_PROJECT_ROOT,\n // \"node_modules\",\n // \"react-hot-toast\"\n // );\n // }\n config.resolve = {\n ...config.resolve,\n alias: alias,\n };\n actions.replaceWebpackConfig(config);\n};\n","import { joinPaths } from \"../url\";\nimport { ImageType, PageTagsType, QueryParamsType } from \"./types\";\nconst { getImage, withArtDirection } = module.require(\"gatsby-plugin-image\");\nconst fs = module.require(\"fs\");\nconst path = module.require(\"path\");\n\nexport const tagExists = (\n pageTags: PageTagsType,\n ...tags: string[]\n): boolean => {\n for (const tag of Object.keys(pageTags)) {\n if (tags.includes(tag)) {\n return true;\n }\n }\n return false;\n};\n\nexport const apiLink = (\n apiPath: string = \"\",\n queryParams: QueryParamsType | null = null\n): string =>\n `${joinPaths(\n `${process.env.API_PROTOCOL}://${process.env.API_HOST}`,\n apiPath\n )}${queryParams ? `?${new URLSearchParams(queryParams).toString()}` : \"\"}`;\n\nexport const buildImage = (img: ImageType) => {\n if (!img) {\n return undefined;\n }\n\n let fallback = {\n src: img.url,\n sizes: \"100vw\",\n srcSet: \"\",\n };\n let sources = [];\n let placeholder = { fallback: img.url };\n const sizes = [img.width, 360, 769, 1024, 1216, 1408].sort((a, b) => a - b);\n\n if (img.optimized) {\n fallback.src = img.url + img.name + \"-\" + img.width + \"w.jpg\";\n placeholder.fallback = img.url + img.name + \"-20w.jpg\";\n sources.push({ sizes: \"100vw\", srcSet: \"\", type: \"image/avif\" });\n sources.push({ sizes: \"100vw\", srcSet: \"\", type: \"image/webp\" });\n for (let index in sizes) {\n if (sizes[index] > img.width) {\n break;\n }\n let image_url =\n (index === \"0\" ? \"\" : \",\") + img.url + img.name + \"-\" + sizes[index];\n fallback.srcSet += image_url + \"w.jpg \" + sizes[index] + \"w\";\n sources[0].srcSet += image_url + \"w.avif \" + sizes[index] + \"w\";\n sources[1].srcSet += image_url + \"w.webp \" + sizes[index] + \"w\";\n }\n }\n\n return getImage({\n childImageSharp: {\n gatsbyImageData: {\n backgroundColor: \"transparent\",\n height: img.height / img.width,\n width: 1,\n layout: \"fullWidth\",\n placeholder: placeholder,\n images: {\n fallback: fallback,\n sources: sources,\n },\n },\n },\n });\n};\n\nexport const getImageData = (image: ImageType, mobileImage: ImageType) => {\n const image_data = buildImage(image);\n const mobile_image_data = buildImage(mobileImage);\n return image_data && mobile_image_data // If mobile image exists, it must be added using Art Direction.\n ? withArtDirection(image_data, [\n {\n media: \"(max-width: 768px)\",\n image: mobile_image_data,\n },\n ])\n : image_data;\n};\n\nexport const extractForm = (formSection: any) => {\n let form: any = {\n settings: {\n pk: 0,\n name: \"\",\n form_method: \"post\",\n form_submit: apiLink(\"/v1/project/request/contact\"),\n form_redirection: null,\n form_ajax_request: null,\n recaptcha_action: \"\",\n recaptcha_v3: false,\n },\n items: [],\n fields: {},\n };\n\n form.settings.recaptcha_v3 = !!formSection.recaptcha_v3;\n form.settings.recaptcha_action =\n formSection.data.recaptcha_action ?? formSection.name;\n form.settings.pk = formSection.pk;\n form.settings.name = formSection.name;\n [\n \"form_submit\",\n \"form_recipient\",\n \"form_method\",\n \"form_redirection\",\n \"form_ajax_request\",\n \"form_success_msg\",\n ].map((cfg) => {\n if (formSection.hasOwnProperty(cfg)) {\n // @ts-ignore\n form.settings[cfg] = formSection[cfg];\n }\n });\n const validTypes = new Set([\n \"checkbox\",\n \"input\",\n \"select\",\n \"button\",\n \"google-places\",\n \"country-prefix\",\n \"country\",\n \"textarea\",\n \"recaptcha2\",\n \"title\",\n \"text\",\n \"link\",\n \"image\",\n ]);\n let uniqueId = 0;\n const addItem = (parents: any, newItem: any): any => {\n let item = form.items;\n for (let key of parents) {\n item = item[key];\n if (!Array.isArray(item)) {\n item = item.children;\n }\n }\n item.push(newItem);\n };\n // Set Form fields:\n const setFormFields = (field: any, parents: any, k: number) => {\n let fieldName =\n field.input_name && !form.fields[field.input_name]\n ? field.input_name\n : field.name ?? `${field.type}${uniqueId++}`;\n\n if (\"section\" === field.type) {\n const sectionName = field.name ?? `sec_${parents.length}-${k}`;\n addItem(parents, { name: sectionName, children: [] });\n field.children.map((field: any, k2: any) =>\n setFormFields(field, [...parents, k], k2)\n );\n } else if (validTypes.has(field.type)) {\n addItem(parents, fieldName);\n form.fields[fieldName] = field;\n // Pre-process images (fixes flickering issue)\n if (field.type === \"image\") {\n form.fields[fieldName].imageData = getImageData(\n field.image,\n field.mobile_image\n );\n }\n }\n };\n\n formSection.children.map((field: any, k: any) => setFormFields(field, [], k));\n return form;\n};\n\nexport const fetchProjectMetadata = async (rootDir: string) => {\n // The URL of the JSON data you want to fetch\n const url = `${process.env.API_PROTOCOL}://${process.env.API_HOST}/v1/${process.env.PROJECT}/`;\n try {\n const response = await fetch(url);\n if (!response.ok) {\n throw new Error(\n `Failed to fetch project metadata data from \"${url}\": ${response.statusText}`\n );\n }\n const data = await response.json();\n const filePath = `${rootDir}/src/data/`;\n const fileName = \"projectMetadata.json\";\n // Write the data to a local JSON file\n fs.writeFileSync(\n path.resolve(filePath, fileName),\n JSON.stringify(data, null, 2)\n );\n console.log(\n `\\x1b[32msuccess\\x1b[0m Project metadata fetched and saved to:\\r\\n\"${filePath}${fileName}\"`\n );\n } catch (error) {\n console.error(\n `Error fetching project metadata from \"${url}\" data:\\r\\n`,\n error\n );\n process.exit(1);\n }\n};\n","const fs = require(\"fs\");\n\nexport const defaultGatsbyConfig = (config: any = {}, plugins: any[] = []) => {\n if (!process.env.GATSBY_PROJECT_ROOT) {\n throw new Error(\n 'Please define \"process.env.GATSBY_PROJECT_ROOT = __dirname\" within the ./gatsby-config.js file.'\n );\n }\n const rootDir = process.env.GATSBY_PROJECT_ROOT;\n const project = JSON.parse(\n fs.readFileSync(`${rootDir}/src/data/projectMetadata.json`, \"utf-8\")\n );\n const isMultiLingual = project.languages.length > 1;\n\n // Add multi-language plugins (only multi-language projects):\n if (isMultiLingual) {\n plugins.push({\n resolve: `gatsby-source-filesystem`,\n options: {\n path: `${rootDir}/locales`,\n name: `locale`,\n },\n });\n plugins.push({\n resolve: `gatsby-plugin-react-i18next`,\n options: {\n localeJsonSourceName: `locale`,\n defaultLanguage: process.env.PROJECT_DEFAULT_LANGUAGE,\n fallbackLng: process.env.PROJECT_DEFAULT_LANGUAGE,\n languages: project.languages,\n siteUrl: `${process.env.PROTOCOL}://${process.env.HOST}`,\n trailingSlash: \"always\",\n i18nextOptions: {\n interpolation: {\n escapeValue: false,\n },\n keySeparator: false,\n nsSeparator: false,\n react: {\n transSupportBasicHtmlNodes: true,\n transKeepBasicHtmlNodesFor: [\n \"a\",\n \"br\",\n \"span\",\n \"strong\",\n \"i\",\n \"p\",\n \"ul\",\n \"li\",\n \"h1\",\n \"h2\",\n \"h3\",\n \"h4\",\n \"h5\",\n ],\n },\n },\n redirect: false,\n pages: [\n {\n matchPath: \"/:lang?/(.*)\", // Prevents duplication of pages (Otherwise i18 plugin duplicates pages adding language code prefix)\n getLanguageFromPath: true,\n languages: project.languages,\n },\n ],\n },\n });\n }\n\n return {\n siteMetadata: {\n title: process.env.SITE_TITLE,\n description: process.env.SITE_DESCRIPTION,\n siteUrl: `${process.env.PROTOCOL}://${process.env.HOST}`,\n image: process.env.SITE_IMAGE,\n protocol: process.env.PROTOCOL,\n domain: process.env.HOST,\n },\n plugins: [\n `gatsby-plugin-image`,\n \"gatsby-plugin-use-query-params\",\n \"gatsby-plugin-svgr\",\n `gatsby-transformer-sharp`,\n \"gatsby-plugin-sass\",\n {\n resolve: `gatsby-plugin-manifest`,\n options: {\n name: project.name,\n short_name: project.name,\n lang: process.env.PROJECT_DEFAULT_LANGUAGE,\n background_color: project.background_colour,\n theme_color: project.colour,\n start_url: `/`,\n display: `standalone`,\n icon: process.env.PROJECT_ICON ?? \"static/icons/favicon.png\",\n },\n },\n {\n resolve: `gatsby-plugin-sharp`,\n options: {\n defaults: {\n formats: [`auto`, `webp`, \"avif\"],\n placeholder: `blurred`,\n quality: 80,\n breakpoints: [360, 769, 1024, 1216, 1408],\n backgroundColor: `transparent`,\n tracedSVGOptions: {},\n blurredOptions: {},\n jpgOptions: {},\n pngOptions: {},\n webpOptions: {},\n avifOptions: {},\n },\n },\n },\n {\n resolve: \"gatsby-source-apiserver\",\n options: {\n typePrefix: \"API__\",\n method: \"get\",\n allowCache: false,\n headers: {\n \"Content-Type\": \"application/json\",\n },\n data: {}, // Request body\n params: {},\n verboseOutput: false,\n // enableDevRefresh: true,\n entitiesArray: [\n {\n url: `${process.env.API_PROTOCOL}://${process.env.API_HOST}/v1/${process.env.PROJECT}/redirection/`,\n headers: {\n \"Content-Type\": \"application/json\",\n },\n name: \"redirections\",\n skipCreateNode: true,\n localSave: true,\n path: `${rootDir}/src/data/pages/`,\n },\n ...project.languages.map((language: string) => ({\n url: `${process.env.API_PROTOCOL}://${process.env.API_HOST}/v1/${process.env.PROJECT}/full-content/?language=${language}`,\n headers: {\n \"Content-Type\": \"application/json\",\n },\n name: `site-${language}`,\n skipCreateNode: true,\n localSave: true,\n path: `${rootDir}/src/data/pages/`,\n })),\n ],\n },\n },\n {\n resolve: `gatsby-plugin-s3`,\n options: {\n bucketName: process.env.S3_BUCKET,\n protocol: process.env.PROTOCOL,\n hostname: process.env.HOST,\n generateRoutingRules: true,\n generateRedirectObjectsForPermanentRedirects: true,\n acl: \"private\",\n },\n },\n {\n resolve: `gatsby-plugin-sitemap`,\n options: {\n // Skip homepage \"/\" on multi-language projects, because it uses \"/en/\" instead.\n excludes: [\"/404/\", \"/**/404/\", isMultiLingual ? \"/\" : \"\"],\n query: `\n {\n allSitePage {\n nodes {\n path\n pageContext\n }\n }\n }\n `,\n resolveSiteUrl: () => `${process.env.PROTOCOL}://${process.env.HOST}`,\n filterPages: (page: any) => page.is_hidden,\n serialize: (page: any, { resolvePagePath }: any) => {\n const url: any = {\n url: resolvePagePath(page),\n lastmod: page.pageContext.published_at,\n };\n // Generate hreflang links for multi-language projects:\n if (isMultiLingual) {\n url.links = project.languages.reduce(\n (acc: any, lang: string) => {\n // Avoid creating links for non-English pages when the \"redirect_to_english\" flag is active:\n if (!page.pageContext.redirect_to_english || lang === \"en\") {\n acc.push({\n lang: lang,\n url: url.url.replace(/^\\/[a-z]{2}\\//, `/${lang}/`),\n });\n }\n return acc;\n },\n [\n {\n lang: \"x-default\",\n url: url.url.replace(\n /^\\/[a-z]{2}\\//,\n `/${process.env.PROJECT_DEFAULT_LANGUAGE}/`\n ),\n },\n ]\n );\n }\n return url;\n },\n },\n },\n {\n resolve: \"gatsby-plugin-google-tagmanager\",\n options: {\n id: process.env.GTM_ID,\n },\n },\n {\n resolve: \"gatsby-plugin-newrelic\",\n options: {\n config: {\n instrumentationType: \"proAndSPA\",\n accountId: process.env.NEWRELIC_ACCOUNT_ID,\n trustKey: process.env.NEWRELIC_TRUST_KEY,\n agentID: process.env.NEWRELIC_AGENT_ID,\n licenseKey: process.env.NEWRELIC_LICENSE_KEY,\n applicationID: process.env.NEWRELIC_APP_ID,\n beacon: \"bam.nr-data.net\",\n errorBeacon: \"bam.nr-data.net\",\n },\n },\n },\n ...plugins,\n ],\n ...config,\n };\n};\n"],"names":["randomString","length","characters","result","i","charAt","Math","floor","random","joinPaths","path1","path2","replace","RegExp","dealLink","dealSlug","process","env","DEALS_ROOT_SLUG","Error","ssoURL","path","SABRE_SSO_PROTOCOL","SABRE_SSO_HOST","tripadvisorRatingURL","score","parseFloat","toFixed","opentableLink","id","nOptions","n","start","defaultOpt","obj","toString","slugify","module","require","hotelOptionsByCity","hotelPages","hotelsByCity","Sydney","Melbourne","Brisbane","Perth","Hobart","Canberra","Adelaide","Darwin","Auckland","Wellington","Singapore","propertyOrder","Object","entries","reduce","acc","hotel","city","push","label","name","value","sort","map","options","a","b","joinAddress","addressParams","param","join","hotelPageLink","hotelName","lang","slugs","TRA","root","lower","slice","VIB","ADI","PROJECT","fs","build","async","body","page","domainRoot","HOST","data","metas","language","key","head","title","replacePageMetas","element","buildElement","slug","tags","createAPIPages","GATSBY_PROJECT_ROOT","project","JSON","parse","readFileSync","isMultiLingual","languages","createPage","createRedirect","actions","redirections","excluded","jsonDoc","is_hidden","is_active","redirect_to_english","redirection","PROTOCOL","type","redirectInBrowser","DEV_PAGE","parseInt","console","warn","component","resolve","context","createAPIRedirections","writeFileSync","stringify","pagesRedirections","forEach","redirect","fromPath","toPath","isPermanent","force","postBuild","excludedPages","robotsTxt","ENV","existsSync","import","createWebpackConfig","getConfig","config","alias","replaceWebpackConfig","getImage","withArtDirection","tagExists","pageTags","tag","keys","includes","apiLink","apiPath","queryParams","API_PROTOCOL","API_HOST","URLSearchParams","buildImage","img","fallback","src","url","sizes","srcSet","sources","placeholder","width","optimized","index","image_url","childImageSharp","gatsbyImageData","backgroundColor","height","layout","images","getImageData","image","mobileImage","image_data","mobile_image_data","media","extractForm","formSection","form","settings","pk","form_method","form_submit","form_redirection","form_ajax_request","recaptcha_action","recaptcha_v3","items","fields","cfg","hasOwnProperty","validTypes","Set","uniqueId","addItem","parents","newItem","item","Array","isArray","children","setFormFields","field","k","fieldName","input_name","sectionName","k2","has","imageData","mobile_image","fetchProjectMetadata","response","fetch","ok","statusText","json","filePath","rootDir","fileName","log","error","exit","defaultGatsbyConfig","plugins","localeJsonSourceName","defaultLanguage","PROJECT_DEFAULT_LANGUAGE","fallbackLng","siteUrl","trailingSlash","i18nextOptions","interpolation","escapeValue","keySeparator","nsSeparator","react","transSupportBasicHtmlNodes","transKeepBasicHtmlNodesFor","pages","matchPath","getLanguageFromPath","siteMetadata","SITE_TITLE","description","SITE_DESCRIPTION","SITE_IMAGE","protocol","domain","short_name","background_color","background_colour","theme_color","colour","start_url","display","icon","PROJECT_ICON","defaults","formats","quality","breakpoints","tracedSVGOptions","blurredOptions","jpgOptions","pngOptions","webpOptions","avifOptions","typePrefix","method","allowCache","headers","params","verboseOutput","entitiesArray","skipCreateNode","localSave","bucketName","S3_BUCKET","hostname","generateRoutingRules","generateRedirectObjectsForPermanentRedirects","acl","excludes","query","resolveSiteUrl","filterPages","serialize","resolvePagePath","lastmod","pageContext","published_at","links","GTM_ID","instrumentationType","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vBC,SAAUtS,QAAQC,IAAIsS,mBACtBC,QAASxS,QAAQC,IAAIwS,kBACrBC,WAAY1S,QAAQC,IAAI0S,qBACxBC,cAAe5S,QAAQC,IAAI4S,gBAC3BC,OAAQ,kBACRC,YAAa,wBAIhBlF,MAEFzF,EACJ"}
1
+ {"version":3,"file":"index.node.esm.js","sources":["../src/node/string/index.ts","../src/node/url/index.ts","../src/node/form/index.ts","../src/node/property/index.ts","../src/node/build/index.ts","../src/node/api/index.ts","../src/node/config/index.ts"],"sourcesContent":["export function randomString(length: number = 9): string {\n const characters =\n \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\";\n let result = \"\";\n for (let i = 0; i < length; i++) {\n result += characters.charAt(Math.floor(Math.random() * characters.length));\n }\n return result;\n}\n","import { randomString } from \"../string\";\n\nexport const joinPaths = (path1: string, path2: string): string =>\n `${path1.replace(new RegExp(`/$`), \"\")}/${path2.replace(\n new RegExp(`^/`),\n \"\"\n )}`;\n\nexport const dealLink = (dealSlug: string): string => {\n if (!process.env.DEALS_ROOT_SLUG)\n throw new Error(\"The env variable DEALS_ROOT_SLUG is not defined!\");\n return joinPaths(process.env.DEALS_ROOT_SLUG as string, dealSlug);\n};\n\nexport const ssoURL = (path: string) =>\n `${process.env.SABRE_SSO_PROTOCOL}://${process.env.SABRE_SSO_HOST}${path}`;\n\nexport const tripadvisorRatingURL = (score: string) =>\n `https://www.tripadvisor.com/img/cdsi/img2/ratings/traveler/${parseFloat(\n score\n ).toFixed(1)}-41022-5.svg`;\n\nexport const opentableLink = (id: number): string =>\n `https://www.opentable.com.au/restref/client?rid=${id}&restref=${id}&lang=en-AU&r3uid=${randomString(\n 9\n )}&ot_source=Restaurant+website&color=1`;\n","import { NOptionsType } from \"./types\";\n\n/**\n *\n * Creates a Object with numeric options for a Select input.\n *\n * @param n Number of options to create\n * @param start The number from which the options start\n * @param defaultOpt Default options to be added into the resulting object\n * @returns Object with the created options, for instance: { \"0\": \"0\", \"1\": \"1\", ... }\n *\n */\nexport const nOptions = (\n n: number,\n start = 0,\n defaultOpt = {}\n): NOptionsType => {\n const obj: NOptionsType = { ...defaultOpt };\n for (let i = start; i < start + n; i++) {\n obj[i.toString()] = i.toString();\n }\n return obj;\n};\n","const slugify = module.require(\"slugify\");\nimport { HotelOptionsByCityType, HotelPagesType, CityKeyType } from \"./types\";\n\n/**\n *\n * Returns Select options sorting by the cities with more hotels, otherwise alphabetically.\n *\n * For instance:\n *\n * [\n * {\n * label: 'Sydney',\n * options: [\n * { label: 'Vibe Hotel Sydney', value: \"58443\" },\n * { label: 'Vibe Hotel Sydney Darling Harbour', value: \"8565\" }\n * ]\n * },\n * {\n * label: 'Mebourne',\n * options: [\n * { label: 'Vibe Hotel Melbourne', value: \"9969\" },\n * ]\n * },\n * ]\n */\nexport const hotelOptionsByCity = (\n hotelPages: HotelPagesType\n): HotelOptionsByCityType[] => {\n let hotelsByCity: Record<CityKeyType, { value: string; label: string }[]> = {\n Sydney: [],\n Melbourne: [],\n Brisbane: [],\n Perth: [],\n Hobart: [],\n Canberra: [],\n Adelaide: [],\n \"Gold Coast\": [],\n Darwin: [],\n Auckland: [],\n Wellington: [],\n Singapore: [],\n };\n const propertyOrder = Object.entries(hotelPages).reduce(\n (acc, [id, hotel]) => {\n if (hotelsByCity[hotel.city]) {\n hotelsByCity[hotel.city].push({ label: hotel.name, value: id });\n } else {\n hotelsByCity[hotel.city] = [{ label: hotel.name, value: id }];\n }\n acc[id] = hotel.sort;\n return acc;\n },\n {} as { [k: string]: number }\n );\n return Object.entries(hotelsByCity).map(([city, options]) => {\n return {\n label: city,\n options: options.sort(\n (a, b) => propertyOrder[a.value] - propertyOrder[b.value]\n ),\n };\n });\n};\n\n/**\n * Joins the Property address\n */\nexport const joinAddress = (addressParams: (string | null)[]) =>\n addressParams\n .reduce((acc: string[], param: string | null) => {\n if (param) {\n acc.push(param);\n }\n return acc;\n }, [])\n .join(\", \");\n\nexport const hotelPageLink = (\n city: string,\n hotelName: string,\n lang: String = \"en\"\n) => {\n const slugs: any = {\n TRA: {\n root: `/book-accommodation/${slugify(city, { lower: true })}`,\n slice: 11,\n },\n VIB: {\n root: `/book-accommodation/${slugify(city, { lower: true })}`,\n slice: 5,\n },\n ADI: { root: `/${lang}/apartments/`, slice: 22 },\n };\n return `${slugs[process.env.PROJECT as string].root}/${slugify(hotelName, {\n lower: true,\n }).slice(slugs[process.env.PROJECT as string].slice)}`;\n};\n","import { Actions } from \"gatsby\";\nimport { RedirectionType } from \"./types\";\nconst fs = module.require(\"fs\");\nconst path = module.require(\"path\");\n\n/**\n * Replace Page Metas\n *\n * Replaces the page metas only on multi-domain projects.\n * For instance if the current page has the following metas defined within the page attributes:\n *\n * {\n * \"metas\": {\n * \"rendezvoushotels.co.nz\": {\n * \"en\": {\n * \"title\": \"Rendezvous hotels in New Zealand\",\n * \"description\": \"Book the best hotels in New Zealand\"\n * }\n * }\n * }\n * }\n *\n * and if the current HOST domain (e.g: \"rendezvoushotels.co.nz\") matches one defined in the metas,\n * the page metas will be replaced by the ones defined on this page attributes.\n *\n * @param page Gatsby Page context\n */\nexport const replacePageMetas = (page: any) => {\n // Remove \"staging.\" and \"test.\" prefixes when checking domain metas for convenience (avoids duplication)\n const domainRoot = (process.env.HOST as string).replace(\n /^(test\\.|staging\\.)/,\n \"\"\n );\n if (page.data?.metas?.[domainRoot]?.[page.language]) {\n for (const [key, value] of Object.entries(\n page.data.metas[domainRoot][page.language]\n )) {\n if (key === \"title\") {\n page.head.title = value;\n continue;\n }\n page.head.metas[key] = value;\n }\n }\n return page;\n};\n\n// Build page elements (only for the ones having a build.js)\nexport const build = async (page: any) => {\n let body = [];\n page = replacePageMetas(page); // Multi-domain projects\n for (const element of page.body) {\n body.push(\n await buildElement(element, {\n slug: page.slug,\n tags: page.tags,\n data: page.data,\n })\n );\n }\n page.body = body;\n return page;\n};\n\n/**\n * Generate API pages\n *\n * @param actions Gatsby actions: https://www.gatsbyjs.com/docs/reference/config-files/actions/\n */\nexport const createAPIPages = async (actions: Actions) => {\n if (!process.env.GATSBY_PROJECT_ROOT) {\n throw new Error(\n 'Please define \"process.env.GATSBY_PROJECT_ROOT = __dirname\" within the ./gatsby-config.js file.'\n );\n }\n const project = JSON.parse(\n fs.readFileSync(\n `${process.env.GATSBY_PROJECT_ROOT}/src/data/projectMetadata.json`,\n \"utf-8\"\n )\n );\n const isMultiLingual = project.languages.length > 1;\n const { createPage, createRedirect } = actions;\n let redirections: RedirectionType[] = [];\n let excluded: string[] = []; // List of excluded pages\n for (const language of project.languages) {\n const jsonDoc = JSON.parse(\n fs.readFileSync(\n `${process.env.GATSBY_PROJECT_ROOT}/src/data/pages/site-${language}.json`,\n `utf-8`\n )\n );\n for (const page of jsonDoc) {\n if (page.is_hidden) {\n excluded.push(page.slug);\n }\n // Skip disabled pages\n if (!page.is_active) {\n continue;\n }\n // Skip non-English pages when they are not translated (only on multi-language projects)\n // Also, creates a 302 (temporally) redirection to English version.\n if (isMultiLingual && page.redirect_to_english && language !== \"en\") {\n redirections.push({\n page: page.slug,\n redirection: `${process.env.PROTOCOL}://${process.env.HOST}/en/${page.slug.slice(4)}`,\n type: \"302\",\n redirectInBrowser: true, // Redirect also in browser because 302 redirection only work on full page loads.\n });\n continue;\n }\n // Skip when \"DEV_PAGE\" is defined on \"./.env.development\" and doesn't match current page:\n if (\n process.env.DEV_PAGE &&\n page.id !== parseInt(`${process.env.DEV_PAGE}`)\n ) {\n console.warn(\n \"DEV_PAGE is defined on .env.development file! Only one page will be generated!\"\n );\n continue;\n }\n const component = require.resolve(\n `${process.env.GATSBY_PROJECT_ROOT}/src/components/page/index.tsx`\n );\n const context = await build(page);\n createPage({\n path: page.slug,\n component: component,\n context: context,\n });\n // The root /404/ page must also be created on multi-language projects to\n // handle non-existing root pages without language prefix, E.G: https://mysite.com/non-existing-page\n if (isMultiLingual && page.slug === \"/en/404/\") {\n createPage({\n path: \"/404/\",\n component: component,\n context: context,\n });\n }\n }\n }\n\n createAPIRedirections(createRedirect, isMultiLingual, redirections);\n // Generate the file \"./src/data/excluded.json\" containing the pages which should be excluded on the sitemap and disallowed within robots.txt.\n fs.writeFileSync(\n `${process.env.GATSBY_PROJECT_ROOT}/src/data/pages/excluded.json`,\n JSON.stringify(excluded)\n );\n};\n\n/**\n * Generate API redirections\n */\nexport const createAPIRedirections = (\n createRedirect: Actions[\"createRedirect\"],\n isMultiLingual: boolean,\n pagesRedirections: RedirectionType[]\n) => {\n // Load API redirections\n const redirections = [\n ...pagesRedirections,\n ...JSON.parse(\n fs.readFileSync(\n `${process.env.GATSBY_PROJECT_ROOT}/src/data/pages/redirections.json`,\n `utf-8`\n )\n ),\n ];\n // Redirect homepage \"/\" to \"/en/\" on multi-language projects\n if (isMultiLingual) {\n redirections.push({\n page: \"/\",\n redirection: `${process.env.PROTOCOL}://${process.env.HOST}/en/`,\n type: \"301\",\n });\n }\n\n redirections.forEach((redirect: RedirectionType) => {\n createRedirect({\n fromPath: redirect.page,\n toPath: redirect.redirection,\n isPermanent: redirect.type === \"301\",\n redirectInBrowser: redirect.redirectInBrowser,\n force: true,\n });\n });\n};\n\n/**\n * Function executed after creating pages to perform following tasks:\n * - Creation of \"robots.txt\"\n */\nexport const postBuild = () => {\n const excludedPages = JSON.parse(\n fs.readFileSync(\n `${process.env.GATSBY_PROJECT_ROOT}/src/data/pages/excluded.json`,\n `utf-8`\n )\n );\n\n const robotsTxt = [\n \"User-agent: *\",\n `${process.env.ENV === \"production\" ? \"Allow: /\" : \"Disallow: /\"}`,\n `${excludedPages.length ? excludedPages.map((slug: string) => `Disallow: ${slug}`).join(\"\\n\") : \"\"}`,\n `Sitemap: ${process.env.PROTOCOL}://${process.env.HOST}/sitemap/sitemap-index.xml`,\n `Host: ${process.env.PROTOCOL}://${process.env.HOST}`,\n ];\n\n fs.writeFileSync(\n `${process.env.GATSBY_PROJECT_ROOT}/public/robots.txt`,\n robotsTxt.join(\"\\n\")\n );\n};\n\n/**\n * Builds API Element (usually for \"section\" and \"data\" elements)\n * This generates a initial data structure for the section/data to avoid processing the React component\n * initial state on every single render.\n *\n * @param element API element\n * @param context\n * @returns\n */\nexport const buildElement = async (element: any, context: any) => {\n const path = `${process.env.GATSBY_PROJECT_ROOT}/src/components/element/${element.type}/${element.name}/build.js`;\n if (fs.existsSync(path)) {\n const module = await import(path);\n if (module?.build) {\n return await module.build(element, context);\n }\n // Show warning on development:\n } else if (process.env.ENV === \"development\") {\n console.warn(`build.js file not found: ${path}`);\n }\n return element;\n};\n\n/**\n *\n * Fixes Development bugs on forms (Recaptcha v3) and Toast.\n * The bug is caused when running `yarn link \"@tfehotels/tfe-gatsby-library\"` on development\n * because this library will try to find the modules at the @tfehotels/tfe-gatsby-library/node_modules folder\n * instead of using the ./node_modules/ of the project.\n *\n */\nexport const createWebpackConfig = ({ actions, getConfig }: any) => {\n const config = getConfig();\n let alias = {\n ...config.resolve.alias,\n \"react-google-recaptcha-v3\": path.resolve(\n process.env.GATSBY_PROJECT_ROOT,\n \"node_modules\",\n \"react-google-recaptcha-v3\"\n ),\n };\n // if (process.env.ENV === \"development\") {\n // alias[\"react-hot-toast\"] = path.resolve(\n // process.env.GATSBY_PROJECT_ROOT,\n // \"node_modules\",\n // \"react-hot-toast\"\n // );\n // }\n config.resolve = {\n ...config.resolve,\n alias: alias,\n };\n actions.replaceWebpackConfig(config);\n};\n","import { joinPaths } from \"../url\";\nimport { ImageType, PageTagsType, QueryParamsType } from \"./types\";\nconst { getImage, withArtDirection } = module.require(\"gatsby-plugin-image\");\nconst fs = module.require(\"fs\");\nconst path = module.require(\"path\");\n\nexport const tagExists = (\n pageTags: PageTagsType,\n ...tags: string[]\n): boolean => {\n for (const tag of Object.keys(pageTags)) {\n if (tags.includes(tag)) {\n return true;\n }\n }\n return false;\n};\n\nexport const apiLink = (\n apiPath: string = \"\",\n queryParams: QueryParamsType | null = null\n): string =>\n `${joinPaths(\n `${process.env.API_PROTOCOL}://${process.env.API_HOST}`,\n apiPath\n )}${queryParams ? `?${new URLSearchParams(queryParams).toString()}` : \"\"}`;\n\nexport const buildImage = (img: ImageType) => {\n if (!img) {\n return undefined;\n }\n\n let fallback = {\n src: img.url,\n sizes: \"100vw\",\n srcSet: \"\",\n };\n let sources = [];\n let placeholder = { fallback: img.url };\n const sizes = [img.width, 360, 769, 1024, 1216, 1408].sort((a, b) => a - b);\n\n if (img.optimized) {\n fallback.src = img.url + img.name + \"-\" + img.width + \"w.jpg\";\n placeholder.fallback = img.url + img.name + \"-20w.jpg\";\n sources.push({ sizes: \"100vw\", srcSet: \"\", type: \"image/avif\" });\n sources.push({ sizes: \"100vw\", srcSet: \"\", type: \"image/webp\" });\n for (let index in sizes) {\n if (sizes[index] > img.width) {\n break;\n }\n let image_url =\n (index === \"0\" ? \"\" : \",\") + img.url + img.name + \"-\" + sizes[index];\n fallback.srcSet += image_url + \"w.jpg \" + sizes[index] + \"w\";\n sources[0].srcSet += image_url + \"w.avif \" + sizes[index] + \"w\";\n sources[1].srcSet += image_url + \"w.webp \" + sizes[index] + \"w\";\n }\n }\n\n return getImage({\n childImageSharp: {\n gatsbyImageData: {\n backgroundColor: \"transparent\",\n height: img.height / img.width,\n width: 1,\n layout: \"fullWidth\",\n placeholder: placeholder,\n images: {\n fallback: fallback,\n sources: sources,\n },\n },\n },\n });\n};\n\nexport const getImageData = (image: ImageType, mobileImage: ImageType) => {\n const image_data = buildImage(image);\n const mobile_image_data = buildImage(mobileImage);\n return image_data && mobile_image_data // If mobile image exists, it must be added using Art Direction.\n ? withArtDirection(image_data, [\n {\n media: \"(max-width: 768px)\",\n image: mobile_image_data,\n },\n ])\n : image_data;\n};\n\nexport const extractForm = (formSection: any) => {\n let form: any = {\n settings: {\n pk: 0,\n name: \"\",\n form_method: \"post\",\n form_submit: apiLink(\"/v1/project/request/contact\"),\n form_redirection: null,\n form_ajax_request: null,\n recaptcha_action: \"\",\n recaptcha_v3: false,\n },\n items: [],\n fields: {},\n };\n\n form.settings.recaptcha_v3 = !!formSection.recaptcha_v3;\n form.settings.recaptcha_action =\n formSection.data.recaptcha_action ?? formSection.name;\n form.settings.pk = formSection.pk;\n form.settings.name = formSection.name;\n [\n \"form_submit\",\n \"form_recipient\",\n \"form_method\",\n \"form_redirection\",\n \"form_ajax_request\",\n \"form_success_msg\",\n ].map((cfg) => {\n if (formSection.hasOwnProperty(cfg)) {\n // @ts-ignore\n form.settings[cfg] = formSection[cfg];\n }\n });\n const validTypes = new Set([\n \"checkbox\",\n \"input\",\n \"select\",\n \"button\",\n \"google-places\",\n \"country-prefix\",\n \"country\",\n \"textarea\",\n \"recaptcha2\",\n \"title\",\n \"text\",\n \"link\",\n \"image\",\n ]);\n let uniqueId = 0;\n const addItem = (parents: any, newItem: any): any => {\n let item = form.items;\n for (let key of parents) {\n item = item[key];\n if (!Array.isArray(item)) {\n item = item.children;\n }\n }\n item.push(newItem);\n };\n // Set Form fields:\n const setFormFields = (field: any, parents: any, k: number) => {\n let fieldName =\n field.input_name && !form.fields[field.input_name]\n ? field.input_name\n : field.name ?? `${field.type}${uniqueId++}`;\n\n if (\"section\" === field.type) {\n const sectionName = field.name ?? `sec_${parents.length}-${k}`;\n addItem(parents, { name: sectionName, children: [] });\n field.children.map((field: any, k2: any) =>\n setFormFields(field, [...parents, k], k2)\n );\n } else if (validTypes.has(field.type)) {\n addItem(parents, fieldName);\n form.fields[fieldName] = field;\n // Pre-process images (fixes flickering issue)\n if (field.type === \"image\") {\n form.fields[fieldName].imageData = getImageData(\n field.image,\n field.mobile_image\n );\n }\n }\n };\n\n formSection.children.map((field: any, k: any) => setFormFields(field, [], k));\n return form;\n};\n\nexport const fetchProjectMetadata = async (rootDir: string) => {\n // The URL of the JSON data you want to fetch\n const url = `${process.env.API_PROTOCOL}://${process.env.API_HOST}/v1/${process.env.PROJECT}/`;\n try {\n const response = await fetch(url);\n if (!response.ok) {\n throw new Error(\n `Failed to fetch project metadata data from \"${url}\": ${response.statusText}`\n );\n }\n const data = await response.json();\n const filePath = `${rootDir}/src/data/`;\n const fileName = \"projectMetadata.json\";\n // Write the data to a local JSON file\n fs.writeFileSync(\n path.resolve(filePath, fileName),\n JSON.stringify(data, null, 2)\n );\n console.log(\n `\\x1b[32msuccess\\x1b[0m Project metadata fetched and saved to:\\r\\n\"${filePath}${fileName}\"`\n );\n } catch (error) {\n console.error(\n `Error fetching project metadata from \"${url}\" data:\\r\\n`,\n error\n );\n process.exit(1);\n }\n};\n","const fs = require(\"fs\");\n\nexport const defaultGatsbyConfig = (config: any = {}, plugins: any[] = []) => {\n if (!process.env.GATSBY_PROJECT_ROOT) {\n throw new Error(\n 'Please define \"process.env.GATSBY_PROJECT_ROOT = __dirname\" within the ./gatsby-config.js file.'\n );\n }\n const rootDir = process.env.GATSBY_PROJECT_ROOT;\n const project = JSON.parse(\n fs.readFileSync(`${rootDir}/src/data/projectMetadata.json`, \"utf-8\")\n );\n const isMultiLingual = project.languages.length > 1;\n\n // Add multi-language plugins (only multi-language projects):\n if (isMultiLingual) {\n plugins.push({\n resolve: `gatsby-source-filesystem`,\n options: {\n path: `${rootDir}/locales`,\n name: `locale`,\n },\n });\n plugins.push({\n resolve: `gatsby-plugin-react-i18next`,\n options: {\n localeJsonSourceName: `locale`,\n defaultLanguage: process.env.PROJECT_DEFAULT_LANGUAGE,\n fallbackLng: process.env.PROJECT_DEFAULT_LANGUAGE,\n languages: project.languages,\n siteUrl: `${process.env.PROTOCOL}://${process.env.HOST}`,\n trailingSlash: \"always\",\n i18nextOptions: {\n interpolation: {\n escapeValue: false,\n },\n keySeparator: false,\n nsSeparator: false,\n react: {\n transSupportBasicHtmlNodes: true,\n transKeepBasicHtmlNodesFor: [\n \"a\",\n \"br\",\n \"span\",\n \"strong\",\n \"i\",\n \"p\",\n \"ul\",\n \"li\",\n \"h1\",\n \"h2\",\n \"h3\",\n \"h4\",\n \"h5\",\n ],\n },\n },\n redirect: false,\n pages: [\n {\n matchPath: \"/:lang?/(.*)\", // Prevents duplication of pages (Otherwise i18 plugin duplicates pages adding language code prefix)\n getLanguageFromPath: true,\n languages: project.languages,\n },\n ],\n },\n });\n }\n\n return {\n siteMetadata: {\n title: process.env.SITE_TITLE,\n description: process.env.SITE_DESCRIPTION,\n siteUrl: `${process.env.PROTOCOL}://${process.env.HOST}`,\n image: process.env.SITE_IMAGE,\n protocol: process.env.PROTOCOL,\n domain: process.env.HOST,\n },\n plugins: [\n `gatsby-plugin-image`,\n \"gatsby-plugin-use-query-params\",\n \"gatsby-plugin-svgr\",\n `gatsby-transformer-sharp`,\n \"gatsby-plugin-sass\",\n {\n resolve: `gatsby-plugin-manifest`,\n options: {\n name: project.name,\n short_name: project.name,\n lang: process.env.PROJECT_DEFAULT_LANGUAGE,\n background_color: project.background_colour,\n theme_color: project.colour,\n start_url: `/`,\n display: `standalone`,\n icon: process.env.PROJECT_ICON ?? \"static/icons/favicon.png\",\n },\n },\n {\n resolve: `gatsby-plugin-sharp`,\n options: {\n defaults: {\n formats: [`auto`, `webp`, \"avif\"],\n placeholder: `blurred`,\n quality: 80,\n breakpoints: [360, 769, 1024, 1216, 1408],\n backgroundColor: `transparent`,\n tracedSVGOptions: {},\n blurredOptions: {},\n jpgOptions: {},\n pngOptions: {},\n webpOptions: {},\n avifOptions: {},\n },\n },\n },\n {\n resolve: \"gatsby-source-apiserver\",\n options: {\n typePrefix: \"API__\",\n method: \"get\",\n allowCache: false,\n headers: {\n \"Content-Type\": \"application/json\",\n },\n data: {}, // Request body\n params: {},\n verboseOutput: false,\n // enableDevRefresh: true,\n entitiesArray: [\n {\n url: `${process.env.API_PROTOCOL}://${process.env.API_HOST}/v1/${process.env.PROJECT}/redirection/`,\n headers: {\n \"Content-Type\": \"application/json\",\n },\n name: \"redirections\",\n skipCreateNode: true,\n localSave: true,\n path: `${rootDir}/src/data/pages/`,\n },\n ...project.languages.map((language: string) => ({\n url: `${process.env.API_PROTOCOL}://${process.env.API_HOST}/v1/${process.env.PROJECT}/full-content/?language=${language}`,\n headers: {\n \"Content-Type\": \"application/json\",\n },\n name: `site-${language}`,\n skipCreateNode: true,\n localSave: true,\n path: `${rootDir}/src/data/pages/`,\n })),\n ],\n },\n },\n {\n resolve: `gatsby-plugin-s3`,\n options: {\n bucketName: process.env.S3_BUCKET,\n protocol: process.env.PROTOCOL,\n hostname: process.env.HOST,\n generateRoutingRules: true,\n generateRedirectObjectsForPermanentRedirects: true,\n acl: \"private\",\n },\n },\n {\n resolve: `gatsby-plugin-sitemap`,\n options: {\n // Skip homepage \"/\" on multi-language projects, because it uses \"/en/\" instead.\n excludes: [\"/404/\", \"/**/404/\", isMultiLingual ? \"/\" : \"\"],\n query: `\n {\n allSitePage {\n nodes {\n path\n pageContext\n }\n }\n }\n `,\n resolveSiteUrl: () => `${process.env.PROTOCOL}://${process.env.HOST}`,\n filterPages: (page: any) => page.pageContext.is_hidden,\n serialize: (page: any, { resolvePagePath }: any) => {\n const url: any = {\n url: resolvePagePath(page),\n lastmod: page.pageContext.published_at,\n };\n // Generate hreflang links for multi-language projects:\n if (isMultiLingual) {\n url.links = project.languages.reduce(\n (acc: any, lang: string) => {\n // Avoid creating links for non-English pages when the \"redirect_to_english\" flag is active:\n if (!page.pageContext.redirect_to_english || lang === \"en\") {\n acc.push({\n lang: lang,\n url: url.url.replace(/^\\/[a-z]{2}\\//, `/${lang}/`),\n });\n }\n return acc;\n },\n [\n {\n lang: \"x-default\",\n url: url.url.replace(\n /^\\/[a-z]{2}\\//,\n `/${process.env.PROJECT_DEFAULT_LANGUAGE}/`\n ),\n },\n ]\n );\n }\n return url;\n },\n },\n },\n {\n resolve: \"gatsby-plugin-google-tagmanager\",\n options: {\n id: process.env.GTM_ID,\n },\n },\n {\n resolve: \"gatsby-plugin-newrelic\",\n options: {\n config: {\n instrumentationType: \"proAndSPA\",\n accountId: process.env.NEWRELIC_ACCOUNT_ID,\n trustKey: process.env.NEWRELIC_TRUST_KEY,\n agentID: process.env.NEWRELIC_AGENT_ID,\n licenseKey: process.env.NEWRELIC_LICENSE_KEY,\n applicationID: process.env.NEWRELIC_APP_ID,\n beacon: \"bam.nr-data.net\",\n errorBeacon: \"bam.nr-data.net\",\n },\n },\n },\n ...plugins,\n ],\n ...config,\n };\n};\n"],"names":["randomString","length","characters","result","i","charAt","Math","floor","random","joinPaths","path1","path2","replace","RegExp","dealLink","dealSlug","process","env","DEALS_ROOT_SLUG","Error","ssoURL","path","SABRE_SSO_PROTOCOL","SABRE_SSO_HOST","tripadvisorRatingURL","score","parseFloat","toFixed","opentableLink","id","nOptions","n","start","defaultOpt","obj","toString","slugify","module","require","hotelOptionsByCity","hotelPages","hotelsByCity","Sydney","Melbourne","Brisbane","Perth","Hobart","Canberra","Adelaide","Darwin","Auckland","Wellington","Singapore","propertyOrder","Object","entries","reduce","acc","hotel","city","push","label","name","value","sort","map","options","a","b","joinAddress","addressParams","param","join","hotelPageLink","hotelName","lang","slugs","TRA","root","lower","slice","VIB","ADI","PROJECT","fs","build","async","body","page","domainRoot","HOST","data","metas","language","key","head","title","replacePageMetas","element","buildElement","slug","tags","createAPIPages","GATSBY_PROJECT_ROOT","project","JSON","parse","readFileSync","isMultiLingual","languages","createPage","createRedirect","actions","redirections","excluded","jsonDoc","is_hidden","is_active","redirect_to_english","redirection","PROTOCOL","type","redirectInBrowser","DEV_PAGE","parseInt","console","warn","component","resolve","context","createAPIRedirections","writeFileSync","stringify","pagesRedirections","forEach","redirect","fromPath","toPath","isPermanent","force","postBuild","excludedPages","robotsTxt","ENV","existsSync","import","createWebpackConfig","getConfig","config","alias","replaceWebpackConfig","getImage","withArtDirection","tagExists","pageTags","tag","keys","includes","apiLink","apiPath","queryParams","API_PROTOCOL","API_HOST","URLSearchParams","buildImage","img","fallback","src","url","sizes","srcSet","sources","placeholder","width","optimized","index","image_url","childImageSharp","gatsbyImageData","backgroundColor","height","layout","images","getImageData","image","mobileImage","image_data","mobile_image_data","media","extractForm","formSection","form","settings","pk","form_method","form_submit","form_redirection","form_ajax_request","recaptcha_action","recaptcha_v3","items","fields","cfg","hasOwnProperty","validTypes","Set","uniqueId","addItem","parents","newItem","item","Array","isArray","children","setFormFields","field","k","fieldName","input_name","sectionName","k2","has","imageData","mobile_image","fetchProjectMetadata","response","fetch","ok","statusText","json","filePath","rootDir","fileName","log","error","exit","defaultGatsbyConfig","plugins","localeJsonSourceName","defaultLanguage","PROJECT_DEFAULT_LANGUAGE","fallbackLng","siteUrl","trailingSlash","i18nextOptions","interpolation","escapeValue","keySeparator","nsSeparator","react","transSupportBasicHtmlNodes","transKeepBasicHtmlNodesFor","pages","matchPath","getLanguageFromPath","siteMetadata","SITE_TITLE","description","SITE_DESCRIPTION","SITE_IMAGE","protocol","domain","short_name","background_color","background_colour","theme_color","colour","start_url","display","icon","PROJECT_ICON","defaults","formats","quality","breakpoints","tracedSVGOptions","blurredOptions","jpgOptions","pngOptions","webpOptions","avifOptions","typePrefix","method","allowCache","headers","params","verboseOutput","entitiesArray","skipCreateNode","localSave","bucketName","S3_BUCKET","hostname","generateRoutingRules","generateRedirectObjectsForPermanentRedirects","acl","excludes","query","resolveSiteUrl","filterPages","pageContext","serialize","resolvePagePath","lastmod","published_at","links","GTM_ID","instrumentationType","accountId","NEWRELIC_ACCOUNT_ID","trustKey","NEWRELIC_TRUST_KEY","agentID","NEWRELIC_AGENT_ID","licenseKey","NEWRELIC_LICENSE_KEY","applicationID","NEWRELIC_APP_ID","beacon","errorBeacon"],"mappings":"AAAO,SAASA,EAAaC,EAAiB,GAC5C,MAAMC,EACJ,iEACF,IAAIC,EAAS,GACb,IAAK,IAAIC,EAAI,EAAGA,EAAIH,EAAQG,IAC1BD,GAAUD,EAAWG,OAAOC,KAAKC,MAAsBL,GAAhBI,KAAKE,WAE9C,OAAOL,CACT,CCNaM,MAAAA,EAAYA,CAACC,EAAeC,IACtC,GAAED,EAAME,QAAQ,IAAIC,OAAQ,MAAM,OAAOF,EAAMC,QAC9C,IAAIC,OAAQ,MACZ,MAGSC,EAAYC,IACvB,IAAKC,QAAQC,IAAIC,gBACf,MAAM,IAAIC,MAAM,oDACl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URC,eAAgBA,IAAO,GAAE1R,QAAQC,IAAIuG,cAAcxG,QAAQC,IAAIyE,OAC/DiN,YAAcnN,GAAcA,EAAKoN,YAAYxL,UAC7CyL,UAAWA,CAACrN,GAAasN,sBACvB,MAAMtI,EAAW,CACfA,IAAKsI,EAAgBtN,GACrBuN,QAASvN,EAAKoN,YAAYI,cA0B5B,OAvBIpM,IACF4D,EAAIyI,MAAQzM,EAAQK,UAAUrD,QAC5B,CAACC,EAAUkB,KAEJa,EAAKoN,YAAYtL,qBAAgC,OAAT3C,GAC3ClB,EAAIG,KAAK,CACPe,KAAMA,EACN6F,IAAKA,EAAIA,IAAI5J,QAAQ,gBAAkB,IAAG+D,QAGvClB,IAET,CACE,CACEkB,KAAM,YACN6F,IAAKA,EAAIA,IAAI5J,QACX,gBACC,IAAGI,QAAQC,IAAI+N,iCAMnBxE,CAAG,IAIhB,CACExC,QAAS,kCACT9D,QAAS,CACPrC,GAAIb,QAAQC,IAAIiS,SAGpB,CACElL,QAAS,yBACT9D,QAAS,CACPkF,OAAQ,CACN+J,oBAAqB,YACrBC,UAAWpS,QAAQC,IAAIoS,oBACvBC,SAAUtS,QAAQC,IAAIsS,mBACtBC,QAASxS,QAAQC,IAAIwS,kBACrBC,WAAY1S,QAAQC,IAAI0S,qBACxBC,cAAe5S,QAAQC,IAAI4S,gBAC3BC,OAAQ,kBACRC,YAAa,wBAIhBlF,MAEFzF,EACJ"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tfehotels/tfe-gatsby-library",
3
- "version": "1.0.69",
3
+ "version": "1.0.71",
4
4
  "description": "Shared functions and utilities for TFE's Gatsby websites.",
5
5
  "main": "./lib/index.node.cjs",
6
6
  "module": "./lib/index.node.esm.js",
@@ -39,8 +39,8 @@
39
39
  "classnames": "^2.3.2",
40
40
  "date-fns": "^3.6.0",
41
41
  "embla-carousel-react": "^8.1.3",
42
- "gatsby": "^5.13.7",
43
- "gatsby-plugin-image": "^3.13.1",
42
+ "gatsby": "^5.14.1",
43
+ "gatsby-plugin-image": "^3.14.0",
44
44
  "html-react-parser": "^5.1.10",
45
45
  "marked": "^12.0.2",
46
46
  "react": "^18.3.1",
@@ -76,8 +76,8 @@
76
76
  "cross-env": "^7.0.3",
77
77
  "date-fns": "^3.6.0",
78
78
  "embla-carousel-react": "^8.1.3",
79
- "gatsby": "^5.13.7",
80
- "gatsby-plugin-image": "^3.13.1",
79
+ "gatsby": "^5.14.1",
80
+ "gatsby-plugin-image": "^3.14.0",
81
81
  "html-react-parser": "^5.1.10",
82
82
  "marked": "^12.0.2",
83
83
  "prettier": "^3.2.5",