PageSourceSearch

https://www.spain-sothebysrealty.com/_next/static/chunks/1175.92d12c2d5d7013d7.js

js spain-sothebysrealty.com collected 2026-10-05 18:33:57 UTC 11,429 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1175],{41175:function(e,t,n){n.r(t);var r=n(85893),i=n(25675),a=n.n(i),l=n(16887),o=n(28992),s=n(67294),c=n(24781),u=n(11877),d=n(83431),m=n(52375),f=n(85709);t.default=()=>{let{t:e}=(0,l.$G)(),{createNewsletterSubscription:t,isLoading:n,isError:i}=(0,o.g)(),{checkEmail:p}=(0,c.s)(),[h,b]=(0,s.useState)({name:"",last_name:"",email:"",coast_islands:!1,citylife_collection:!1}),[x,v]=(0,s.useState)(!1),[g,w]=(0,s.useState)(!1),[_,y]=(0,s.useState)(!1),[N,k]=(0,s.useState)(!1),[j,E]=(0,s.useState)(!1),C=e("privacy-policy-link"),L=e("webclauses-link"),S=e=>{let{name:t,value:n,type:r,checked:i}=e.target;b({...h,[t]:"checkbox"===r?i:n})},T=async e=>{if(e.preventDefault(),E(!1),!N){E(!0);return}if(/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(h.email))w(!1);else{v(!1),w(!0);return}let n={...h,coast_islands:h.coast_islands||!h.coast_islands&&!h.citylife_collection,citylife_collection:h.citylife_collection||!h.coast_islands&&!h.citylife_collection};try{var r,i;let{data:e}=await p(n.email);if(e&&e.newsletterSubscriptions.length>0){v(!0);return}let a=await t(n);if(!(null==a?void 0:null===(i=a.data)||void 0===i?void 0:null===(r=i.createNewsletterSubscription)||void 0===r?void 0:r.id))throw Error("Newsletter subscription did not return a valid ID");(0,m.gm)(!0,{email:n.email.trim(),agreeMarketing:!0}),(0,f.u)(f.p.NEWSLETTER),y(!0)}catch(e){console.error("Error during subscription:",e)}};return(0,r.jsx)("div",{id:"newsletter",className:"newsletter-form container text-white bg-dark-blue mt-[70px] md:mt-8 mb-[50px] md:mb-0",children:(0,r.jsxs)("div",{className:"px-7 md:px-24 pt-7 md:pt-10 pb-8",children:[(0,r.jsx)(a(),{unoptimized:!0,src:"/assets/icons/white_envelope.svg",alt:"Envelope Icon",width:"24",height:"20",quality:"75",className:"block",style:{width:24,height:20}}),(0,r.jsx)("h3",{className:"pt-5 text-2xl md:text-[2rem] text-white",children:e("sign-up-to-our-newsletters")}),(0,r.jsxs)("form",{onSubmit:T,children:[(0,r.jsxs)("div",{className:"flex flex-col lg:flex-row justify-between mt-0 md:mt-4",children:[(0,r.jsx)("input",{type:"text",placeholder:e("first-name"),name:"name",value:h.name,onChange:S,className:"rounded-none",required:!0}),(0,r.jsx)("input",{type:"text",placeholder:e("last-name"),className:"rounded-none",name:"last_name",value:h.last_name,onChange:S,required:!0}),(0,r.jsx)("input",{type:"text",placeholder:e("email-address"),className:"rounded-none",name:"email",value:h.email,onChange:S,required:!0})]}),(0,r.jsxs)("div",{className:"lg:flex gap-11 mt-5 mb-8",children:[(0,r.jsx)("p",{className:"flex font-normal font-acta text-[16px] tracking-[0.32px] items-center",children:e("select-content-interests")}),(0,r.jsx)("div",{className:"flex flex-col xl:flex-row justify-between xl:items-end text-xl text-[rgba(255, 255, 255, 0.3)] tracking-wide font-thin font-addington mb-8 lg:mb-0 mt-2",children:(0,r.jsxs)("div",{className:"flex flex-col md:flex-row md:gap-6 text-[13px] font-medium",children:[(0,r.jsxs)("div",{className:"check-block flex items-center",children:[(0,r.jsx)("input",{type:"checkbox",id:"coast-and-islands",name:"coast_islands",checked:h.coast_islands,onChange:S,className:"border border-white bg-dark-blue"}),(0,r.jsx)("label",{htmlFor:"coast-and-islands"}),(0,r.jsx)("span",{className:"ml-2.5",children:e("coast-and-islands")})]}),(0,r.jsxs)("div",{className:"check-block",children:[(0,r.jsx)("input",{type:"checkbox",name:"citylife_collection",checked:h.citylife_collection,onChange:S,id:"citylife-collection"}),(0,r.jsx)("label",{htmlFor:"citylife-collection"}),(0,r.jsx)("span",{className:"ml-2.5",children:e("citylife-collection")})]})]})})]}),(0,r.jsx)("div",{className:"flex flex-col text-[11px] tracking-[0.375px] font-normal mb-3 gap-4 mt-5 md:mt-0",children:(0,r.jsx)(u.Z,{isChecked:N,onChange:()=>k(!N),text:(0,d.K)(e("agree-to-terms"),[C,L],"checkbox-text underline"),borderColor:j?"border-red-500":""})}),(0,r.jsx)("div",{className:"newsletter-subscribe-button",children:(0,r.jsx)("button",{type:"submit",disabled:n,className:"button border bg-dark-blue hover:bg-white hover:text-dark-blue !border-white block md:inline","aria-label":e("subscribe-now"),
1children:e(n?"loading":"subscribe-now")})})]}),g&&(0,r.jsx)("p",{className:"mt-4 text-red-500",children:e("invalid-email-address")}),x&&(0,r.jsx)("p",{className:"mt-4 text-red-500",children:e("newsletter-subscription-already-subscribed")}),j&&(0,r.jsx)("p",{className:"mt-4 text-red-500",children:e("terms-agreement-required")}),_&&(0,r.jsx)("p",{className:"mt-4",children:e("newsletter-subscription-success")}),i&&(0,r.jsx)("p",{className:"mt-4 text-red-500",children:e("newsletter-subscription-error")})]})})}},11877:function(e,t,n){var r=n(85893);n(67294),t.Z=function(e){let{isChecked:t,onChange:n,text:i,borderColor:a}=e;return(0,r.jsxs)("label",{className:"custom-checkbox",children:[(0,r.jsx)("input",{type:"checkbox",checked:t,onChange:n,className:"hidden-checkbox",tabIndex:"0"}),(0,r.jsx)("span",{className:"checkbox-mark ".concat(a?"!border !border-[#B22424]":"")}),(0,r.jsx)("span",{className:"checkbox-text ".concat(a?"text-[#B22424]":""),dangerouslySetInnerHTML:{__html:i}})]})}},52375:function(e,t,n){n.d(t,{gm:function(){return r}});function r(e,t){if(!e||!Object.prototype.hasOwnProperty.call(t,"agreeMarketing")||!0!==t.agreeMarketing)return;let n=function(e){var t;let n=null!==(t=e.email)&&void 0!==t?t:e.mail;if("string"==typeof n)return n.trim()||void 0}(t);if(n)n&&(window._hsq=window._hsq||[],window._hsq.push(["identify",{email:n}]),window._hsq.push(["trackPageView"]))}},83431:function(e,t,n){n.d(t,{K:function(){return r}});function r(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"underline",r=e;return t.forEach((e,t)=>{let i="<".concat(t,">"),a="</".concat(t,">"),l='<a href="'.concat(e,'" class="').concat(n,'" target="_blank" rel="noopener noreferrer">');r=r.replace(i,l).replace(a,"</a>")}),r}},85709:function(e,t,n){n.d(t,{p:function(){return r},u:function(){return i}});let r={CONTACT:"form_contact",VALUATION:"form_valuation",LISTING:"form_listing",AGENT:"form_agent",DEVELOPMENT_DOWNLOAD:"form_development_download",NEWSLETTER:"form_newsletter",TEAM_APPLICATION:"form_team_application",APPLICATION_LANDING:"form_application_landing"};function i(e){e&&void 0!==globalThis.window&&(globalThis.window.dataLayer=globalThis.window.dataLayer||[],globalThis.window.dataLayer.push({event:e,page_location:globalThis.window.location.pathname}))}},24781:function(e,t,n){n.d(t,{s:function(){return o}});var r=n(37340),i=n(68806),a=n(73359);function l(){let e=(0,r._)(["\n    query Query($where: NewsletterSubscriptionWhereInput!) {\n      newsletterSubscriptions(where: $where) {\n        id\n      }\n    }\n  "]);return l=function(){return e},e}let o=()=>{let e=(0,i.Ps)(l()),[t,{loading:n,error:r,data:o}]=(0,a.t)(e);return{checkEmail:e=>t({variables:{where:{email:{equals:e}}}}),isLoading:n,isError:r,data:o?o.newsletterSubscriptions:null}}},28992:function(e,t,n){n.d(t,{g:function(){return o}});var r=n(37340),i=n(68806),a=n(50319);function l(){let e=(0,r._)(["\n    mutation Mutation($data: NewsletterSubscriptionCreateInput!) {\n      createNewsletterSubscription(data: $data) {\n        citylife_collection\n        coast_islands\n        email\n        id\n        last_name\n        name\n      }\n    }\n  "]);return l=function(){return e},e}let o=()=>{let e=(0,i.Ps)(l()),[t,{loading:n,error:r,data:o}]=(0,a.D)(e);return{createNewsletterSubscription:e=>t({variables:{data:{name:e.name,last_name:e.last_name,email:e.email,coast_islands:e.coast_islands,citylife_collection:e.citylife_collection}}}),isLoading:n,isError:r,data:o}}},770:function(e,t,n){n.d(t,{L:function(){return i}});var r=n(73914),i=n(30320).Nq?r.useLayoutEffect:r.useEffect},73359:function(e,t,n){n.d(t,{t:function(){return c}});var r=n(97582),i=n(73914),a=n(14012),l=n(6812),o=n(770),s=["refetch","reobserve","fetchMore","updateQuery","startPolling","stopPolling","subscribeToMore"];function c(e,t){var n,c=i.useRef(void 0),u=i.useRef(void 0),d=i.useRef(void 0),m=(0,a.J)(t,c.current||{}),f=null!==(n=null==m?void 0:m.query)&&void 0!==n?n:e;u.current=t,d.current=f;var p=(0,r.pi)((0,r.pi)({},m),{skip:!c.current}),h=(0,l.p1)(f,p),b=h.obsQueryFields,x=h.result,v=h.client,g=h.resultData,w=h.observable,_=h.onQueryExecuted,y=w.options.initialFetchPolicy||(0,l._F)(p.defaultOptions,v.defaultOptions),N=i.useReducer(function(e){return e+1},0)[1],k=i.useMemo(function(){for(var e={},t=0;t<s.length;t++)!function(t){var n=b[t];e[t]=function(){return c.current||(c.current=Object.create(null),N()),n.apply(this,arguments)}}(s[t]);return e},[N,b]),j=!!c.current,E=i.useMemo(function(){return(0,r.pi)((0,r.pi)((0,r.pi)({},x),k),{called:j})},[x,k,j]),C=i.useCallback(function(e){c.current=e?(0,r.pi)((0,r.pi)({},e),{fetchPolicy:e.fetchPolicy||y}):{fetchPolicy:y};var t,n,i,o,s=(0,a.J)(u.current,(0,r.pi)({query:d.current},c.current)),m=(n=(t=(0,r.pi)((0,r.pi)({},s),{skip:!1})).query||f,i=(0,l.mp)(v,n,t,!1)(w),o=w.reobserveAsConcast((0,l.RN)(w,v,t,i)),_(i),new Promise(function(e){var t;o.subscribe({next:function(e){t=e},error:function(){e((0,l.KH)(w.getCurrentResult(),g.previousData,w,v))},complete:function(){e((0,l.KH)(w.maskResult(t),g.previousData,w,v))}})})).then(function(e){return Object.assign(e,k)});return m.catch(function(){}),m},[v,f,k,y,w,g,_]),L=i.useRef(C);return(0,o.L)(function(){L.current=C}),[i.useCallback(function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return L.current.apply(L,e)},[]),E]}},50319:function(e,t,n){n.d(t,{D:function(){return d}});var r=n(97582),i=n(73914),a=n(14012),l=n(30020),o=n(14692),s=n(30990),c=n(66252),u=n(770);function d(e,t){var n=(0,c.x)(null==t?void 0:t.client);(0,o.Vp)(e,o.n_.Mutation);var d=i.useState({called:!1,loading:!1,client:n}),m=d[0],f=d[1],p=i.useRef({result:m,mutationId:0,isMounted:!0,client:n,mutation:e,options:t});(0,u.L)(function(){Object.assign(p.current,{client:n,options:t,mutation:e})});var h=i.useCallback(function(e){void 0===e&&(e={});var t=p.current,n=t.options,i=t.mutation,o=(0,r.pi)((0,r.pi)({},n),{mutation:i}),c=e.client||p.current.client;p.current.result.loading||o.ignoreResults||!p.current.isMounted||f(p.current.result={loading:!0,error:void 0,data:void 0,called:!0,client:c});var u=++p.current.mutationId,d=(0,a.J)(o,e);return c.mutate(d).then(function(t){var n,r,i=t.data,a=t.errors,o=a&&a.length>0?new s.cA({graphQLErrors:a}):void 0,m=e.onError||(null===(n=p.current.options)||void 0===n?void 0:n.onError);if(o&&m&&m(o,d),u===p.current.mutationId&&!d.ignoreResults){var h={called:!0,loading:!1,data:i,error:o,client:c};p.current.isMounted&&!(0,l.D)(p.current.result,h)&&f(p.current.result=h)}var b=e.onCompleted||(null===(r=p.current.options)||void 0===r?void 0:r.onCompleted);return o||null==b||b(t.data,d),t},function(t){if(u===p.current.mutationId&&p.current.isMounted){var n,r={loading:!1,error:t,data:void 0,called:!0,client:c};(0,l.D)(p.current.result,r)||f(p.current.result=r)}var i=e.onError||(null===(n=p.current.options)||void 0===n?void 0:n.onError);if(i)return i(t,d),{data:void 0,errors:t};throw t})},[]),b=i.useCallback(function(){if(p.current.isMounted){var e={called:!1,loading:!1,client:p.current.client};Object.assign(p.current,{mutationId:0,result:e}),f(e)}},[]);return i.useEffect(function(){var e=p.current;return e.isMounted=!0,function(){e.isMounted=!1}},[]),[h,(0,r.pi)({reset:b},m)]}}}]);

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.