PageSourceSearch

https://assets.oneroof.co.nz/rebuild/aws/20260921155645/_next/static/chunks/3739.4567016a23981132.js

js oneroof.co.nz collected 2026-10-02 05:44:37 UTC 9,488 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3739],{53739:function(e,t,r){r.r(t),r.d(t,{default:function(){return w}});var s=r(57437),a=r(27205),n=r(91614),i=r(63966),c=r(84278),o=r(8826),l=r(69806),u=r(42644),h=r(92969),d=r(81816),p=r(33117),v=r(4243),y=r(7442),f=r(61081),b=r(8097),m=r(85264),_=r(68692),S=r(29371),x=r(61856),g=r(2265),j=r(44088);function w(e){let{recentData:t}=e,{data:r}=t,[w,L]=(0,g.useState)(r.saved),Z=(0,g.useMemo)(()=>{let e=(0,p.ZP)();return e.setSuburbs(r.suburbs),e.surround=r.surrounding,e["price-from"]=r.priceFrom,e["price-to"]=r.priceTo,e.bedroom=r.bedrooms,e.bathroom=r.bathrooms,e.carspaces=r.carspaces,e.categories=r.categories,e.landarea=r.landarea,e.floorarea=r.floorarea,e["property-type"]=r.propertyType,e.setSearchTypeId(y.houseSearchType.business),e.pushNewZealand(),e},[r]),{showSaveSearch:k}=(0,h.Z)(),z=(0,g.useMemo)(()=>{let e=Z.toQuery();return{data:{...(0,b.Z)(e,["bedrooms","bathrooms","carspaces","surrounding","typeId","isLandHome","isProject","categoryId","landArea","floorArea","price","order","suburbId","regionId","districtId"]),listTime:Math.floor(Date.now()/1e3),filter:r.filter},suburbs:r.suburbs}},[Z,r]),[N,T]=(0,j.Z)(async e=>{w?(await a.default.delete("user/criteria/".concat(w)),d.eN.updateCacheData({...t,data:{...t.data,saved:!1}}),L(!1)):k(z,e=>{d.eN.updateCacheData({...t,data:{...t.data,saved:e}}),L(e)})(e)},[z,w,L,t,k]),B=r.loaded?{url:null}:{url:"houses/list",params:Object.assign({needCover:1,count:1},Z.toQuery())},{data:C,isLoading:I}=(0,u.Z)({fetcher:B,recentData:t});if(I||!C)return(0,s.jsx)(o.H9,{});let P=(0,m.Z)(C.suburbs),M=(0,f.tr)((0,_.Z)(C.suburbs,e=>e.pureLabel||e.label),", ")||l.i4.label;Z.typeId=null;let D=Z.toSlug();return(0,s.jsxs)("div",{className:"flex flex-col justify-between rounded-sm overflow-hidden group shadow-carousel",children:[(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)("div",{className:"z-[1] absolute right-10 top-10",children:(0,s.jsx)(i.EL,{loading:N.loading,saved:!!w,onClick:T})}),(0,s.jsx)(x.default,{className:"block",href:(0,v.cL)(y.houseSearchType.business,D,C.filter?{filter:C.filter}:void 0),children:(0,s.jsx)(c.default,{src:C.cover,alt:M,hoverScale:!0,className:"aspect-[267/176]",width:267,height:176,defaultIcon:"icon-house-cover"})})]}),(0,s.jsxs)(x.default,{href:(0,v.cL)(y.houseSearchType.business,D,C.filter?{filter:C.filter}:void 0),className:"px-10 py-12 space-y-8 bg-white block",children:[(0,s.jsxs)("div",{className:"text-black flex items-center gap-x-4",children:[(0,s.jsx)("div",{className:"overflow-hidden text-ellipsis whitespace-nowrap text-sm",children:M}),P>1&&(0,s.jsxs)("span",{children:["+",P]}),(0,s.jsx)("i",{className:"icon icon-arrow-right !text-xs"})]}),(0,s.jsxs)("div",{className:"flex items-center gap-x-6 whitespace-nowrap",children:[(0,s.jsx)("span",{className:"h-20 flex items-center px-10 rounded-[100px] bg-secondary-light text-secondary text-xs",children:"Buy Businesses"}),(C.priceFrom||C.priceTo)&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("i",{className:"text-xl leading-20",children:"\xb7"}),(0,s.jsx)("span",{className:"text-sm overflow-hidden text-ellipsis",children:(0,f.W3)(C.priceFrom,C.priceTo,"Max")})]})]}),(0,s.jsx)("div",{className:"min-h-[21px]",children:(0,s.jsxs)(n.Z,{data:{},children:[(0,m.Z)(C.bedrooms)>0&&(0,s.jsx)(n.p,{num:1,html:(0,f.tr)((0,S.Z)(C.bedrooms),","),icon:"icon-bed",className:"!text-black"}),(0,m.Z)(C.bathrooms)>0&&(0,s.jsx)(n.p,{num:1,html:(0,f.tr)((0,S.Z)(C.bathrooms),","),icon:"icon-bath",className:"!text-black"}),(0,m.Z)(C.carspaces)>0&&(0,s.jsx)(n.p,{num:1,html:(0,f.tr)((0,S.Z)(C.carspaces),","),icon:"icon-car",className:"!text-black"})]})})]})]})}},42644:function(e,t,r){r.d(t,{Z:function(){return b}});var s=r(81816),a=r(85292),n=r(99095),i=r(1341),c=r(48587),o=r(82950),l=r(75785),u=r(551),h=r(57333),d=r(94318),p=r(87463),v=r(65437),y=r(2265),f=r(5403);function b(e){let{fetcher:t,recentData:r}=e,{data:b}=r,[m,_]=(0,y.useState)(b.loaded?b:null),{data:S,isLoading:x}=(0,f.Z)(t),g=(0,y.useMemo)(()=>{if(r.isEstimateByListing())return l.e;if(r.isEstimateByArea())return o.r;if(r.isBuyByListing())return n.i;if(r.isRentByListing())return h.c;
1if(r.isBuyBySuburb())return i.T;if(r.isRentBySuburb())return d.P;if(r.isSoldBySuburb())return v.g;else if(r.isNewHomesBySuburb())return u.X;else if(r.isCommercialForSale()||r.isCommercialForLease())return c.w;else if(r.isRuralBySuburb())return p.J;else if(r.isBusinessesBySuburb())return a.e},[r]);return(0,y.useEffect)(()=>{if(S&&!m&&g){let e=new g;e.fromDetail(b),e.fromDetail(S),_(e),r.data=e,s.eN.cache(r)}},[m,b,S,r,g,_]),{isLoading:x,data:m}}},92969:function(e,t,r){r.d(t,{Z:function(){return c}});var s=r(74017),a=r(43618),n=r(2265),i=r(88730);function c(){let e=(0,a.sJ)(s.GL),t=(0,a.Zl)(s.GL),r=(0,a.rb)(s.GL),c=(0,n.useCallback)((e,r)=>{let{data:s,state:a,suburbs:n,signupSource:c="Save_Search"}=e;return e=>{e.preventDefault(),e.stopPropagation(),i.ej.click(),i.ej.show(),t(e=>({...e,show:!0,data:s,state:a,suburbs:n,signupSource:c,successCallback:r}))}},[t]),o=(0,n.useCallback)(()=>{r()},[r]);return{...e,showSaveSearch:c,hideSaveSearch:o}}},88730:function(e,t,r){r.d(t,{ej:function(){return o},z2:function(){return l}}),r(57437);var s=r(69730),a=r(80805);r(15760);var n=r(86620),i=r(26349),c=r(7442);r(33117),r(61081),r(20564),r(69806);let o={click(){(0,a.zz)({event:"analytics_track",event_journey:"Save Property Search",event_interaction:"Search results page",event_type:"Save search"}),(0,s.LP)()&&(0,a.zz)({event:"analytics_track",event_journey:"Save Property Search",event_interaction:"Modal",event_type:"Save this search"})},show(){(0,a.zz)({event:"analytics_track",event_journey:"Save Property",event_interaction:"Modal",event_type:"Enter email"})},signin(){(0,a.zz)({event:"analytics_track",event_journey:"Save Property",event_interaction:"Modal",event_type:"Sign in to save this search"})},registered(){(0,a.zz)({event:"analytics_track",event_journey:"Save Property",event_interaction:"Modal",event_type:"Sign in to save this search"})},notRegistered(){(0,a.zz)({event:"analytics_track",event_journey:"Save Property",event_interaction:"Modal",event_type:"Create password"})},success(){(0,a.zz)({event:"analytics_track",event_journey:"Save Property Search",event_interaction:"Modal",event_type:"Save search success"})}},l={toggleMap(e){(0,a.zz)({event:"analytics_track",event_journey:"Search",event_interaction:"Search results page",event_type:e?"Show map":"Show list"})},searchButtonClick(e){(0,a.zz)({event:"ga4_event",event_name:"perform_search",search_method:"search_cta"});let t=(t,r)=>[(0,n.Z)(e===t),(0,n.Z)(r)],r=(0,i.Z)([t(c.houseSearchType.residential,"buy"),t(c.houseSearchType.rent,"rent"),t(c.houseSearchType.sold,"sold"),t(c.houseSearchType.newHomes,"new home"),t(c.houseSearchType.commercialForSale,"commercial for sale"),t(c.houseSearchType.commercialForLease,"commercial for lease"),t(c.houseSearchType.business,"businesses for sale"),t(c.houseSearchType.rural,"rural")])();(0,a.zz)({event:"analytics_track",event_journey:"Search",event_interaction:"CTA",event_type:r})},filter:{confirm(){(0,a.zz)({event:"analytics_track",event_journey:"filters",event_interaction:"show",event_type:"search"})},clear(){(0,a.zz)({event:"analytics_track",event_journey:"filters",event_interaction:"clear",event_type:"search"})}}}},20564:function(e,t,r){r.r(t),r.d(t,{default:function(){return f}});var s=r(27938),a=r(73797),n=r(90369),i=r(39437),c=r(6170),o=r(69903),l=r(50246),u=r(32014),h=r(3660),d=r(55041),p=new WeakSet;class v extends d.Z{async get(e,t,r,a){return(0,s._)(this,p,y).call(this,"get",e,t,r,a)}async post(e,t,r,a){return(0,s._)(this,p,y).call(this,"post",e,t,r,a)}async put(e,t,r,a){return(0,s._)(this,p,y).call(this,"put",e,t,r,a)}async delete(e,t,r,a){return(0,s._)(this,p,y).call(this,"delete",e,t,r,a)}constructor(){super(),(0,a._)(this,p)}}async function y(e,t,r,s,a){try{return await (0,n._)((0,i._)(v.prototype),e,this).call(this,t,r,s,a)}catch(r){var d;throw!function(e,t){var r,s;let a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};r=c.D.ERROR,s={...a,...(0,u.w)(t)}
1,o.TD.getLogger(l.vw).emit({severityNumber:r,severityText:c.D[r],body:e,attributes:s})}("Upstream API request failed",(0,h.p)(r),{"http.request.method":e.toUpperCase(),"url.path":String(t),"http.response.status_code":null!==(d=null==r?void 0:r.status)&&void 0!==d?d:0}),r}}var f=new v},82950:function(e,t,r){r.d(t,{r:function(){return s}});class s{static fromStreet(e){let t=new s;return e.id&&(t.streetId=e.id),e.pureLabel&&(t.streetLabel=e.pureLabel),e.lat&&(t.streetLat=e.lat),e.lng&&(t.streetLng=e.lng),t}static fromSuburb(e){let t=new s;return t.suburbs=e,t}fromDetail(e){e&&(e._id&&(this._id=e._id),e.cover&&(this.cover=e.cover),e.suburbs&&(this.suburbs=e.suburbs),e.streetId&&(this.streetId=e.streetId),e.streetLabel&&(this.streetLabel=e.streetLabel),e.streetLat&&(this.streetLat=e.streetLat),e.streetLng&&(this.streetLng=e.streetLng),this.loaded=!0)}constructor(){this._id=Date.now(),this.loaded=!1,this.cover=null,this.suburbs=null,this.streetId=null,this.streetLabel=null,this.streetLat=null,this.streetLng=null}}},26349:function(e,t,r){var s=r(58069),a=r(80659),n=r(43193),i=r(30801);t.Z=function(e){var t=null==e?0:e.length,r=n.Z;return e=t?(0,a.Z)(e,function(e){if("function"!=typeof e[1])throw TypeError("Expected a function");return[r(e[0]),e[1]]}):[],(0,i.Z)(function(r){for(var a=-1;++a<t;){var n=e[a];if((0,s.Z)(n[0],this,r))return(0,s.Z)(n[1],this,r)}})}}}]);

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.