PageSourceSearch

https://cdn.beachcomber-hotels.com/v9/_next/static/chunks/5282.4ed5d8eb0b404c91.js

js beachcomber-hotels.com collected 2026-10-09 23:35:28 UTC 11,165 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5282],{15282:function(e,i,n){n.r(i),n.d(i,{default:function(){return q}});var t=n(85893),o=n(67294),l=n(97346),a=n(21608),r=n(31555),d=n(34853),u=n(7126),c=n.n(u),v=n(9669),s=n.n(v),f=function(e){var i=e.data,n=e.formData,o=void 0===n?{}:n,a=e.onChange,r=void 0===a?function(){}:a,d=e.onBlur,u=void 0===d?function(){}:d;if(i){var v=i||{},s=v.type,f=v.label,m=v.name,p=v.options,h=void 0===p?[]:p,y=v.row,b=void 0===y?3:y,x=v.required,g=void 0!==x&&x,_=v.fullflex,j=void 0!==_&&_,w=v.validity,C=void 0===w?[!1,!1]:w,N=v.placeholder,S=void 0===N?"":N;return(0,t.jsxs)(l.Z.Group,{controlId:m,className:"mb-3 ".concat(j?c().fullflex:""),children:[(0,t.jsx)(l.Z.Label,{children:f}),("text"===s||"email"===s)&&(0,t.jsx)(l.Z.Control,{isInvalid:(null===C||void 0===C?void 0:C[1])||!1,isValid:(null===C||void 0===C?void 0:C[0])||!1,type:s,required:g,name:m,value:(null===o||void 0===o?void 0:o[m])||"",onChange:r,onBlur:u}),"textarea"===s&&(0,t.jsx)(l.Z.Control,{as:"textarea",rows:b,name:m,value:(null===o||void 0===o?void 0:o[m])||"",onChange:r,onBlur:u,required:g,isInvalid:(null===C||void 0===C?void 0:C[1])||!1,isValid:(null===C||void 0===C?void 0:C[0])||!1}),"select"===s&&(0,t.jsxs)(l.Z.Select,{required:g,name:m,value:(null===o||void 0===o?void 0:o[m])||"",onChange:r,onBlur:u,isInvalid:(null===C||void 0===C?void 0:C[1])||!1,isValid:(null===C||void 0===C?void 0:C[0])||!1,children:[(0,t.jsx)("option",{value:"",children:S}),h.map((function(e){return(0,t.jsx)("option",{value:e.value,children:e.label},e.id)}))]})]})}},m=n(58299),p=n(22150),h=n(20417),y=n(6873),b=n(85739),x=n(11163);function g(e,i){(null==i||i>e.length)&&(i=e.length);for(var n=0,t=new Array(i);n<i;n++)t[n]=e[n];return t}function _(e,i,n){return i in e?Object.defineProperty(e,i,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[i]=n,e}function j(e){for(var i=1;i<arguments.length;i++){var n=null!=arguments[i]?arguments[i]:{},t=Object.keys(n);"function"===typeof Object.getOwnPropertySymbols&&(t=t.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),t.forEach((function(i){_(e,i,n[i])}))}return e}function w(e,i){return function(e){if(Array.isArray(e))return e}(e)||function(e,i){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var t,o,l=[],a=!0,r=!1;try{for(n=n.call(e);!(a=(t=n.next()).done)&&(l.push(t.value),!i||l.length!==i);a=!0);}catch(d){r=!0,o=d}finally{try{a||null==n.return||n.return()}finally{if(r)throw o}}return l}}(e,i)||function(e,i){if(!e)return;if("string"===typeof e)return g(e,i);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return g(e,i)}(e,i)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var C=[{id:1,type:"select",label:"Reason",name:"reason",required:!0,validity:[!1,!1],options:[]},{id:2,type:"select",label:"Title",name:"title",required:!0,options:[],validity:[!1,!1]},{id:3,type:"text",label:"First Name",name:"first_name",required:!0,validity:[!1,!1]},{id:4,type:"text",label:"Family Name",name:"family_name",required:!0,validity:[!1,!1]},{id:5,type:"email",label:"Email",name:"email",required:!0,validity:[!1,!1]},{id:6,type:"text",label:"Phone",name:"Phone",required:!0,validity:[!1,!1]}],N=[{id:1,type:"select",label:"Country",name:"country",options:[],required:!0,validity:[!1,!1]},{id:2,type:"select",label:"Hotel",name:"hotel",options:[],required:!0,validity:[!1,!1]},{id:3,type:"select",label:"Office",name:"office",options:[],required:!0,validity:[!1,!1]},{id:4,type:"textarea",label:"Message",name:"Message",row:5,fullflex:!0,required:!0,validity:[!1,!1]}],S={reason:"",title:"",first_name:"",family_name:"",email:"",Phone:"",country:"",hotel:"",office:"",Message:"",captcha:""},q=function(e){var i=e.data,n=e.language,u=void 0===n?"en":n,v=e.country,g=void 0===v?"17329":v,q=e.strateName,Z=void 0===q?"":q,O=(0,o.useState)(!1),A=O[0],D=O[1],E=(0,o.useState)(!1),F=E[0],P=E[1],T=(0,o.useState)(!1),k=T[0],I=T[1],B=(0,o.useState)(!1),M=B[0],L=B[1],Q=(0,o.useState)(S),R=Q[0],V=Q[1],H=(0,o.useState)(C),$=H[0],G=H[1],K=(0,o.useState)(N),U=K[0],X=K[1],Y=(0,o.useState)(N),z=Y[0],J=Y[1],W=(0,o.useState)(!1),ee=W[0],ie=W[1],ne=(0,x.useRouter)(),te=0;
1if((0,o.useEffect)((function(){if(i){var e=i||{},n=e.webForm,t=e.allReasons,o=void 0===t?[]:t,l=e.allTitles,a=void 0===l?[]:l,r=e.allOffices,d=void 0===r?[]:r,u=C.map((function(e){var i,t,l=e||{},r=l.name,d=void 0===r?"":r,u=l.label,c=void 0===u?"":u,v=(null===n||void 0===n||null===(i=n[d])||void 0===i?void 0:i.placeholder)||"",s=j({},e,{label:(null===n||void 0===n||null===(t=n[d])||void 0===t?void 0:t.label)||c});return"reason"===d?j({},s,{options:o.map((function(e){return{id:null===e||void 0===e?void 0:e.id,label:(null===e||void 0===e?void 0:e.constant)||"",value:(null===e||void 0===e?void 0:e.id)||""}})),placeholder:v}):"title"===d?j({},s,{options:a.map((function(e){return{id:null===e||void 0===e?void 0:e.title_id,label:(null===e||void 0===e?void 0:e.description)||"",value:(null===e||void 0===e?void 0:e.title_id)||""}})),placeholder:v}):s})),c=N.map((function(e){var i,t,o,l=e||{},a=l.name,r=void 0===a?"":a,u=l.label,c=void 0===u?"":u,v=(null===n||void 0===n||null===(i=n[r])||void 0===i?void 0:i.placeholder)||"",s=j({},e,{label:(null===n||void 0===n||null===(t=n[r])||void 0===t?void 0:t.label)||c});if("country"===r){var f,m=(null===n||void 0===n||null===(f=n[r])||void 0===f?void 0:f.options)||{};return j({},s,{options:Object.keys(m).map((function(e){var i=(null===m||void 0===m?void 0:m[e])||{};return{id:null===i||void 0===i?void 0:i.country_id,label:(null===i||void 0===i?void 0:i.name)||"",value:(null===i||void 0===i?void 0:i.country_id)||""}})),placeholder:v})}return"hotel"===r?j({},s,{options:((null===n||void 0===n||null===(o=n[r])||void 0===o?void 0:o.options)||[]).map((function(e){return{id:null===e||void 0===e?void 0:e.hotel_id,label:(null===e||void 0===e?void 0:e.title)||"",value:(null===e||void 0===e?void 0:e.hotel_id)||""}})),placeholder:v}):"office"===r?j({},s,{options:d.map((function(e){return{id:null===e||void 0===e?void 0:e.foreign_office_id,label:(null===e||void 0===e?void 0:e.foreign_office_name)||"",value:(null===e||void 0===e?void 0:e.foreign_office_id)||""}})),placeholder:v}):s}));G(u),X(c),J(c),V((function(e){return j({},e,{country:g})}))}}),[i,g]),(0,o.useEffect)((function(){var e=ne.query.reason;if(e&&i&&z.length>0){var n=setTimeout((function(){V((function(i){return j({},i,{reason:e})})),ye({target:{name:"reason",value:e.toString()}})}),1e3);return function(){return clearTimeout(n)}}}),[ne.query,i,z]),i){var oe=(i||{}).webForm||{},le=oe.confrimation_title,ae=void 0===le?"":le,re=oe.confrimation_message,de=void 0===re?"":re,ue=oe.weform_title,ce=void 0===ue?"":ue,ve=oe.weform_description,se=void 0===ve?"":ve,fe=oe.submit_button,me=void 0===fe?"":fe,pe=oe.submission_fail,he=function(e){var i=U.find((function(i){return(null===i||void 0===i?void 0:i.name)===e.name}));return j({},e,{validity:null===i||void 0===i?void 0:i.validity})},ye=function(e){var i=e.target,n=i.name,t=i.value;console.log(n,t),V((function(e){return j({},e,_({},n,t))})),function(e,i){if("reason"===e){if("1"===i&&window.location.assign((0,y.$3)(m.f8)),"2"===i||"3"===i||"8"===i){var n=z.filter((function(e){return"office"!==e.name}));return n=n.map(he),void X(n)}if("5"===i||"7"===i||"11"===i||"12"===i){var t=z.filter((function(e){return"office"!==e.name&&"hotel"!==e.name}));return t=t.map(he),void X(t)}if("10"===i){var o=z.filter((function(e){return"hotel"!==e.name}));return o=o.map(he),void X(o)}X(z)}}(n,t)},be=function(e){var i=null===e||void 0===e?void 0:e.name,n=(null===R||void 0===R?void 0:R[i])||"";return(null===e||void 0===e?void 0:e.required)?n&&("email"!==i||(0,p.M_)(n))&&("family_name"!==i||(0,p.r1)(n))&&("first_name"!==i||(0,p.r1)(n))&&("Phone"!==i||(0,p.qh)(n))?j({},e,{validity:[!0,!1]}):j({},e,{validity:[!1,!0]}):j({},e,{validity:[!0,!1]})},xe=function(e){var i=(null===e||void 0===e?void 0:e.validity)||[];if(0==(null===i||void 0===i?void 0:i[0])&&1==(null===i||void 0===i?void 0:i[1]))return!0},ge=function(){var e=$.map(be),i=U.map(be),n=e.filter(xe),t=i.filter(xe);return G(e),X(i),[n,t]},_e=function(e){e.preventDefault(),ee&&ge()},je=function(e){e.preventDefault(),P(!0),I(!1),ie(!0),L(!1);var i=w(ge(),2),n=i[0],t=i[1];if(n.length>0||t.length>0||!(null===R||void 0===R?void 0:R.captcha))return(null===R||void 0===R?void 0:R.captcha)||I(!0),void P(!1);var o=(null===m.QA||void 0===m.QA?void 0:m.QA[u])||1,l=R.reason,a=R.title,r=R.first_name,d=R.family_name,c=R.email,v=R.Phone,f=R.Message,p=R.country,y=R.hotel,b=R.office,x={reason_
1id:l,title_id:a,first_name:r,last_name:d,email:c,phone:v,message:f,country_id:p,language_id:o};"2"===l||"3"===l||"8"===l?(x.hotel_id=y,x.office_id=""):"10"===l?(x.office_id=b,x.hotel_id=""):(x.hotel_id="",x.office_id=""),Z&&(0,h.D)("form",Z,"submission","submission"),s().post(m.jE,x).then((function(e){window&&window.scrollTo(0,0),P(!1),D(!0)})).catch((function(i){3===++te?(L(!0),P(!1),D(!1),console.error(i)):je(e)}))};return(0,t.jsx)("section",{className:c().wrapContact,children:A?(0,t.jsxs)(t.Fragment,{children:[ae&&(0,t.jsx)("span",{className:c().title,children:ae}),(0,t.jsx)("div",{className:c().richText,children:(0,t.jsx)("div",{className:"text-align-center mb-4",children:de&&(0,b.Z)(de||"")})})]}):(0,t.jsxs)(t.Fragment,{children:[ce&&(0,t.jsxs)("span",{className:c().title,children:[ce,":"]}),(0,t.jsx)("div",{className:c().richText,children:(0,t.jsx)("div",{className:"text-align-center mb-4",children:se&&(0,b.Z)(se||"")})}),(0,t.jsx)(l.Z,{noValidate:!0,onSubmit:je,children:(0,t.jsxs)(a.Z,{className:c().rowContact,children:[(0,t.jsx)(r.Z,{md:6,className:c().rowContactFlex,children:$.map((function(e){return(0,t.jsx)(f,{data:e,formData:R,onChange:ye,onBlur:_e},e.id)}))}),(0,t.jsx)(r.Z,{md:6,className:c().rowContactFlex,children:U.map((function(e){return(0,t.jsx)(f,{data:e,formData:R,onChange:ye,onBlur:_e},e.id)}))}),(0,t.jsx)(r.Z,{md:6,children:(0,t.jsx)("div",{className:k?c().invalidCaptcha:c().validCaptcha,children:(0,t.jsx)(d.Z,{sitekey:"6Le5cCIkAAAAAKQBy6ZORXyEffMY8OLrZuH4o9Db",onChange:function(e){if(P(!0),e){I(!1);var i=new FormData;i.append("g-recaptcha-response",e),s().post(m.aL,i).then((function(i){var n,t=(null===(n=i.data)||void 0===n?void 0:n.success)||!1;P(!1),t?(I(!1),V((function(i){return j({},i,{captcha:e})}))):(I(!0),V((function(e){return j({},e,{captcha:""})})))})).catch((function(e){console.error(e,"error"),P(!1),I(!0)}))}else V((function(e){return j({},e,{captcha:""})})),I(!0),P(!1)}})})}),(0,t.jsx)(r.Z,{md:6,className:c().actionSubmit,children:(0,t.jsx)("button",{disabled:F,type:"submit",children:me})})]})}),M&&(0,t.jsx)("div",{className:c().richText,children:(0,t.jsx)("div",{className:"text-align-center mt-4",children:pe&&(0,b.Z)(pe||"")})})]})})}}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.