react-listing-engine 0.6.0 → 0.6.2

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # react-listing-engine
2
2
 
3
+ ## 0.6.1
4
+
5
+ ### Patch Changes
6
+
7
+ - `/styled`: fix "Clear all" in the mobile filters sheet -- it cleared each filter by its registry `key`, which no-ops when a filter maps its control to different state fields via `to/fromParams` (e.g. `rent` -> `minRent`/`maxRent`). It now resets via each filter's own `toParams(fromParams({}))`. Also: the mobile Filters button now shows a count badge of how many filters are applied.
8
+
3
9
  ## 0.6.0
4
10
 
5
11
  ### Minor Changes
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }"use client";
2
+ var _chunkEYXV5OMYcjs = require('./chunk-EYXV5OMY.cjs');var _react = require('react');function ce(e,r){let t=_chunkEYXV5OMYcjs.s.call(void 0, ),i=_react.useRef.call(void 0, r);i.current=r,_react.useEffect.call(void 0, ()=>t.on(e,n=>i.current(n)),[t,e])}function L(e){return typeof e!="number"?e:new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",maximumFractionDigits:0}).format(e)}var _jsxruntime = require('react/jsx-runtime');function Me(e){return e?"rle-card rle-card--selected":"rle-card"}function H({item:e,selected:r,onSelect:t}){let i=_nullishCoalesce(e, () => ({})),n=Me(r),s=_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[i.imageUrl?_jsxruntime.jsx.call(void 0, "img",{src:i.imageUrl,alt:_nullishCoalesce(i.title, () => ("")),className:"rle-card-media"}):_jsxruntime.jsx.call(void 0, "div",{className:"rle-card-media rle-card-media--placeholder","aria-hidden":"true"}),_jsxruntime.jsxs.call(void 0, "div",{className:"rle-card-body",children:[i.title&&_jsxruntime.jsx.call(void 0, "span",{className:"rle-card-title",children:i.title}),i.subtitle&&_jsxruntime.jsx.call(void 0, "span",{className:"rle-card-address",children:i.subtitle}),i.badge&&_jsxruntime.jsx.call(void 0, "div",{className:"rle-card-info",children:_jsxruntime.jsx.call(void 0, "span",{className:"rle-card-info-item",children:i.badge})}),i.price!=null&&_jsxruntime.jsx.call(void 0, "span",{className:"rle-card-price",children:L(i.price)})]})]});return t?_jsxruntime.jsx.call(void 0, "button",{type:"button",onClick:t,"aria-pressed":_nullishCoalesce(r, () => (!1)),className:n,children:s}):_jsxruntime.jsx.call(void 0, "article",{className:n,children:s})}function V(e){return _jsxruntime.jsxs.call(void 0, "div",{role:"status",className:"rle-empty",children:[_jsxruntime.jsxs.call(void 0, "svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round",className:"rle-empty-icon","aria-hidden":"true",children:[_jsxruntime.jsx.call(void 0, "circle",{cx:"11",cy:"11",r:"7"}),_jsxruntime.jsx.call(void 0, "path",{d:"m21 21-4.3-4.3"})]}),_jsxruntime.jsx.call(void 0, "p",{className:"rle-empty-title",children:"No results"}),_jsxruntime.jsx.call(void 0, "p",{className:"rle-empty-hint",children:"Try adjusting your filters or search terms."})]})}function O({children:e}){return _jsxruntime.jsx.call(void 0, "div",{className:"rle-filter-panel",children:e})}function D(e){return _jsxruntime.jsx.call(void 0, "div",{className:"rle-loading",role:"status","aria-busy":"true","aria-label":"Loading results",children:Array.from({length:3}).map((r,t)=>_jsxruntime.jsxs.call(void 0, "div",{className:"rle-loading-item",children:[_jsxruntime.jsx.call(void 0, "div",{className:"rle-skeleton",style:{aspectRatio:"4 / 3",width:"100%"}}),_jsxruntime.jsx.call(void 0, "div",{className:"rle-skeleton",style:{height:16,width:"65%"}}),_jsxruntime.jsx.call(void 0, "div",{className:"rle-skeleton",style:{height:12,width:"35%"}})]},t))})}function K({point:e}){let r=_nullishCoalesce(e.entity, () => ({}));return _jsxruntime.jsx.call(void 0, "span",{className:"rle-pin",children:r.price!=null?L(r.price):""})}function $({entity:e,onClose:r}){let t=_nullishCoalesce(e, () => ({}));return _jsxruntime.jsxs.call(void 0, "div",{className:"rle-popup",role:"group","aria-label":"Location details",children:[_jsxruntime.jsx.call(void 0, "button",{type:"button",onClick:r,"aria-label":"Close",className:"rle-popup-close",children:_jsxruntime.jsxs.call(void 0, "svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",width:"16",height:"16","aria-hidden":"true",children:[_jsxruntime.jsx.call(void 0, "path",{d:"M18 6 6 18"}),_jsxruntime.jsx.call(void 0, "path",{d:"m6 6 12 12"})]})}),_jsxruntime.jsxs.call(void 0, "div",{children:[t.title&&_jsxruntime.jsx.call(void 0, "div",{className:"rle-card-title",children:t.title}),t.subtitle&&_jsxruntime.jsx.call(void 0, "div",{className:"rle-card-address",children:t.subtitle}),t.price!=null&&_jsxruntime.jsx.call(void 0, "div",{className:"rle-card-price",children:L(t.price)})]})]})}function z({count:e,total:r}){let t=r!=null&&r!==e?`${e} of ${r} results`:`${e} results`;return _jsxruntime.jsx.call(void 0, "div",{className:"rle-result-header",children:t})}function U({value:e,onChange:r,placeholder:t}){return _jsxruntime.jsx.call(void 0, "input",{type:"search",value:e,placeholder:t,onChange:i=>r(i.target.value),"aria-label":_nullishCoalesce(t, () => ("Search")),className:"rle-input"})}function Z({children:e}){return _jsxruntime.jsx.call(void 0, "aside",{className:"rle-sidebar",children:e})}function q({children:e}){return _jsxruntime.jsx.call(void 0, "div",{className:"rle-toolbar",children:e})}var fe={Card:H,Marker:K,Popup:$,Sidebar:Z,FilterPanel:O,Search:U,Empty:V,Loading:D,ResultHeader:z,Toolbar:q};function ge({view:e,onViewChange:r}){return _jsxruntime.jsx.call(void 0, "nav",{className:"rle-bottom-nav","aria-label":"Listing navigation",children:_jsxruntime.jsxs.call(void 0, "div",{className:"rle-viewtoggle",role:"group","aria-label":"View",children:[_jsxruntime.jsxs.call(void 0, "button",{type:"button",className:`rle-viewtoggle__btn${e==="list"?" rle-viewtoggle__btn--active":""}`,"aria-pressed":e==="list",onClick:()=>r("list"),children:[_jsxruntime.jsx.call(void 0, De,{}),"List"]}),_jsxruntime.jsxs.call(void 0, "button",{type:"button",className:`rle-viewtoggle__btn${e==="map"?" rle-viewtoggle__btn--active":""}`,"aria-pressed":e==="map",onClick:()=>r("map"),children:[_jsxruntime.jsx.call(void 0, Ke,{}),"Map"]})]})})}function ve(){return _jsxruntime.jsxs.call(void 0, "svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[_jsxruntime.jsx.call(void 0, "line",{x1:"4",y1:"6",x2:"20",y2:"6"}),_jsxruntime.jsx.call(void 0, "circle",{cx:"9",cy:"6",r:"2",fill:"currentColor",stroke:"none"}),_jsxruntime.jsx.call(void 0, "line",{x1:"4",y1:"12",x2:"20",y2:"12"}),_jsxruntime.jsx.call(void 0, "circle",{cx:"15",cy:"12",r:"2",fill:"currentColor",stroke:"none"}),_jsxruntime.jsx.call(void 0, "line",{x1:"4",y1:"18",x2:"20",y2:"18"}),_jsxruntime.jsx.call(void 0, "circle",{cx:"11",cy:"18",r:"2",fill:"currentColor",stroke:"none"})]})}function De(){return _jsxruntime.jsxs.call(void 0, "svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",width:"16",height:"16","aria-hidden":"true",children:[_jsxruntime.jsx.call(void 0, "line",{x1:"8",y1:"6",x2:"20",y2:"6"}),_jsxruntime.jsx.call(void 0, "line",{x1:"8",y1:"12",x2:"20",y2:"12"}),_jsxruntime.jsx.call(void 0, "line",{x1:"8",y1:"18",x2:"20",y2:"18"}),_jsxruntime.jsx.call(void 0, "line",{x1:"4",y1:"6",x2:"4.01",y2:"6"}),_jsxruntime.jsx.call(void 0, "line",{x1:"4",y1:"12",x2:"4.01",y2:"12"}),_jsxruntime.jsx.call(void 0, "line",{x1:"4",y1:"18",x2:"4.01",y2:"18"})]})}function Ke(){return _jsxruntime.jsxs.call(void 0, "svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",width:"16",height:"16","aria-hidden":"true",children:[_jsxruntime.jsx.call(void 0, "polygon",{points:"1 6 8 3 16 6 23 3 23 18 16 21 8 18 1 21 1 6"}),_jsxruntime.jsx.call(void 0, "line",{x1:"8",y1:"3",x2:"8",y2:"18"}),_jsxruntime.jsx.call(void 0, "line",{x1:"16",y1:"6",x2:"16",y2:"21"})]})}function ye(){return _jsxruntime.jsxs.call(void 0, "svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[_jsxruntime.jsx.call(void 0, "line",{x1:"12",y1:"5",x2:"12",y2:"19"}),_jsxruntime.jsx.call(void 0, "line",{x1:"5",y1:"12",x2:"19",y2:"12"})]})}var _reactdom = require('react-dom');function be({open:e,onOpenChange:r,title:t,children:i,footer:n}){let s=_react.useRef.call(void 0, null),[l,p]=_react.useState.call(void 0, !1),[c,m]=_react.useState.call(void 0, !1);return _react.useEffect.call(void 0, ()=>{if(!e){m(!1),p(!1);return}p(!0);let d=requestAnimationFrame(()=>m(!0));return()=>cancelAnimationFrame(d)},[e]),_react.useEffect.call(void 0, ()=>{if(!l)return;let d=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=d}},[l]),_react.useEffect.call(void 0, ()=>{if(!l)return;_optionalChain([s, 'access', _2 => _2.current, 'optionalAccess', _3 => _3.focus, 'call', _4 => _4()]);function d(b){b.key==="Escape"&&r(!1)}return document.addEventListener("keydown",d),()=>document.removeEventListener("keydown",d)},[l,r]),!l||typeof document>"u"?null:_reactdom.createPortal.call(void 0, _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, "div",{className:`rle-sheet-backdrop${c?" rle-sheet-backdrop--open":""}`,onClick:()=>r(!1),"aria-hidden":"true"}),_jsxruntime.jsxs.call(void 0, "div",{ref:s,className:`rle-sheet${c?" rle-sheet--open":""}`,role:"dialog","aria-modal":"true","aria-label":t,tabIndex:-1,children:[_jsxruntime.jsx.call(void 0, "div",{className:"rle-sheet__handle","aria-hidden":"true"}),_jsxruntime.jsxs.call(void 0, "div",{className:"rle-sheet__header",children:[t&&_jsxruntime.jsx.call(void 0, "div",{className:"rle-sheet__title",children:t}),_jsxruntime.jsx.call(void 0, "button",{type:"button",className:"rle-sheet__close",onClick:()=>r(!1),"aria-label":"Close",children:_jsxruntime.jsx.call(void 0, ze,{})})]}),_jsxruntime.jsx.call(void 0, "div",{className:"rle-sheet__body",children:i}),n&&_jsxruntime.jsx.call(void 0, "div",{className:"rle-sheet__footer",children:n})]})]}),document.body)}function ze(){return _jsxruntime.jsxs.call(void 0, "svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",width:"16",height:"16","aria-hidden":"true",children:[_jsxruntime.jsx.call(void 0, "path",{d:"M18 6 6 18"}),_jsxruntime.jsx.call(void 0, "path",{d:"m6 6 12 12"})]})}function Ne({search:e,onFiltersClick:r,filterCount:t=0,action:i}){let{Search:n}=_chunkEYXV5OMYcjs.q.call(void 0, );return _jsxruntime.jsxs.call(void 0, "header",{className:"rle-mobile-header",children:[e&&_jsxruntime.jsx.call(void 0, "div",{className:"rle-mobile-header__search",children:_jsxruntime.jsx.call(void 0, n,{value:e.value,onChange:e.onChange,placeholder:e.placeholder})}),_jsxruntime.jsxs.call(void 0, "button",{type:"button",className:"rle-mobile-header__btn",onClick:r,children:[_jsxruntime.jsx.call(void 0, ve,{}),_jsxruntime.jsx.call(void 0, "span",{children:"Filters"}),t>0&&_jsxruntime.jsx.call(void 0, "span",{className:"rle-mobile-header__count",children:t})]}),i&&_jsxruntime.jsx.call(void 0, "button",{type:"button",className:"rle-mobile-header__btn rle-mobile-header__btn--icon",onClick:i.onClick,"aria-label":i.label,children:_nullishCoalesce(i.icon, () => (_jsxruntime.jsx.call(void 0, ye,{})))})]})}var qe=_jsxruntime.jsx.call(void 0, "div",{className:"rle-empty",children:"Map unavailable"});function Ge(){let e=_react.useRef.call(void 0, null),[r,t]=_react.useState.call(void 0, !0),[i,n]=_react.useState.call(void 0, !0);return _react.useEffect.call(void 0, ()=>{let s=e.current;if(!s)return;let l=()=>{let{clientWidth:c,scrollLeft:m,scrollWidth:d}=s;t(m<=0),n(m+c>=d-1)};l(),s.addEventListener("scroll",l,{passive:!0});let p;return typeof ResizeObserver<"u"&&(p=new ResizeObserver(l),p.observe(s)),()=>{s.removeEventListener("scroll",l),_optionalChain([p, 'optionalAccess', _5 => _5.disconnect, 'call', _6 => _6()])}},[]),{atEnd:i,atStart:r,ref:e}}function we({search:e,toolbarEnd:r,mobileAction:t,autoFetch:i=!0,hasMap:n=!0,mapCenter:s,mapZoom:l,className:p}){let c=_chunkEYXV5OMYcjs.s.call(void 0, ),{Search:m}=_chunkEYXV5OMYcjs.q.call(void 0, ),d=_chunkEYXV5OMYcjs.w.call(void 0, ),{filters:b}=_chunkEYXV5OMYcjs.u.call(void 0, ),[P,E]=_react.useState.call(void 0, "list"),[C,u]=_react.useState.call(void 0, !1),{atEnd:R,atStart:T,ref:A}=Ge(),S=e?{value:String(_nullishCoalesce(b[e.filterKey], () => (""))),onChange:w=>{c.applyFilters({[e.filterKey]:w||void 0})},placeholder:e.placeholder}:void 0;_react.useEffect.call(void 0, ()=>{i!==!1&&c.applyFilters({})},[c,i]);let Ce=()=>{let w=c.filters.list().reduce((Ie,Q)=>Object.assign(Ie,Q.toParams(Q.fromParams({}))),{});c.applyFilters(w)},xe=c.filters.list().filter(w=>_optionalChain([w, 'access', _7 => _7.isActive, 'optionalCall', _8 => _8(b)])).length,ke=_nullishCoalesce(d.total, () => (d.items.length));return _jsxruntime.jsxs.call(void 0, "div",{className:p?`rle-app ${p}`:"rle-app",children:[_jsxruntime.jsxs.call(void 0, "div",{className:"rle-filter-bar",children:[_jsxruntime.jsxs.call(void 0, "div",{className:"rle-filter-bar__scroll",ref:A,children:[S&&_jsxruntime.jsx.call(void 0, "div",{className:"rle-filter-bar__search",children:_jsxruntime.jsx.call(void 0, m,{value:S.value,onChange:S.onChange,placeholder:S.placeholder})}),_jsxruntime.jsx.call(void 0, _chunkEYXV5OMYcjs.v,{className:"rle-filters-row",groupClassName:"rle-filter-group",hideLabels:!0}),_jsxruntime.jsxs.call(void 0, "div",{className:"rle-filter-bar__end",children:[_jsxruntime.jsx.call(void 0, _chunkEYXV5OMYcjs.A,{}),r]})]}),!T&&_jsxruntime.jsx.call(void 0, "div",{className:"rle-filter-bar__fade rle-filter-bar__fade--start","aria-hidden":"true"}),!R&&_jsxruntime.jsx.call(void 0, "div",{className:"rle-filter-bar__fade rle-filter-bar__fade--end","aria-hidden":"true"})]}),_jsxruntime.jsx.call(void 0, Ne,{search:S,onFiltersClick:()=>u(!0),filterCount:xe,action:t}),_jsxruntime.jsxs.call(void 0, "div",{className:`rle-body ${n?"rle-split":"rle-body--list-only"}`,"data-mobile-view":P,children:[_jsxruntime.jsxs.call(void 0, "div",{className:"rle-list",children:[_jsxruntime.jsx.call(void 0, _chunkEYXV5OMYcjs.x,{className:"rle-list-grid"}),_jsxruntime.jsx.call(void 0, _chunkEYXV5OMYcjs.z,{})]}),n&&_jsxruntime.jsx.call(void 0, "div",{className:"rle-map",children:_jsxruntime.jsx.call(void 0, _chunkEYXV5OMYcjs.y,{center:s,zoom:l,fallback:qe})})]}),n&&_jsxruntime.jsx.call(void 0, ge,{view:P,onViewChange:E}),_jsxruntime.jsx.call(void 0, be,{title:"Filters",open:C,onOpenChange:u,footer:_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, "button",{type:"button",className:"rle-btn rle-btn--ghost",onClick:Ce,children:"Clear all"}),_jsxruntime.jsxs.call(void 0, "button",{type:"button",className:"rle-btn rle-btn--primary",onClick:()=>u(!1),children:["Show ",ke," results"]})]}),children:_jsxruntime.jsx.call(void 0, _chunkEYXV5OMYcjs.v,{className:"rle-filter-stack",groupClassName:"rle-filter-group"})})]})}function Pe(e){return"provider"in e}function je(e){let r=e!=null&&!Pe(e),t=r?e.apiKey:void 0,i=r?e.mapId:void 0,[n,s]=_react.useState.call(void 0, ()=>!e||Pe(e)?{ready:!0,provider:_optionalChain([e, 'optionalAccess', _9 => _9.provider])}:{ready:!1});return _react.useEffect.call(void 0, ()=>{if(!t)return;let l=!1;return Promise.resolve().then(() => _interopRequireWildcard(require("./maps/google/index.cjs"))).then(({googleProvider:p})=>{l||s({ready:!0,provider:p({apiKey:t,mapId:i})})}),()=>{l=!0}},[t,i]),n}function et({onFiltersChange:e}){let r=_react.useRef.call(void 0, e);return r.current=e,ce("FiltersChanged",t=>{t.type==="FiltersChanged"&&r.current(t.filters)}),null}function pr(e){let{datasets:r,filters:t,map:i,components:n,initialFilters:s,onFiltersChange:l,mobileAction:p,search:c,toolbarEnd:m,config:d,autoFetch:b,className:P}=e,{ready:E,provider:C}=je(i);if(!E)return null;let u=[];for(let A of r)u.push(_chunkEYXV5OMYcjs.k.call(void 0, A));t&&u.push(_chunkEYXV5OMYcjs.l.call(void 0, t)),C&&u.push(_chunkEYXV5OMYcjs.j.call(void 0, C)),s&&u.push(_chunkEYXV5OMYcjs.n.call(void 0, s)),d&&u.push(_chunkEYXV5OMYcjs.i.call(void 0, d));let R=_chunkEYXV5OMYcjs.h.call(void 0, ...u),T={...fe,...n};return _jsxruntime.jsxs.call(void 0, _chunkEYXV5OMYcjs.B,{...R,children:[l&&_jsxruntime.jsx.call(void 0, et,{onFiltersChange:l}),_jsxruntime.jsx.call(void 0, _chunkEYXV5OMYcjs.p,{...T,children:_jsxruntime.jsx.call(void 0, we,{className:P,search:c,toolbarEnd:m,mobileAction:p,autoFetch:b,hasMap:i!=null,mapCenter:_optionalChain([i, 'optionalAccess', _10 => _10.center]),mapZoom:_optionalChain([i, 'optionalAccess', _11 => _11.zoom])})})]})}exports.a = ce; exports.b = H; exports.c = V; exports.d = O; exports.e = D; exports.f = K; exports.g = $; exports.h = z; exports.i = U; exports.j = Z; exports.k = q; exports.l = fe; exports.m = ge; exports.n = be; exports.o = we; exports.p = pr;
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ import{A as de,B as pe,h as X,i as Y,j,k as ee,l as te,n as re,p as ie,q as x,s as k,u as oe,v as B,w as ne,x as se,y as le,z as ae}from"./chunk-R3FX2V3N.js";import{useEffect as Fe,useRef as _e}from"react";function ce(e,r){let t=k(),i=_e(r);i.current=r,Fe(()=>t.on(e,n=>i.current(n)),[t,e])}function L(e){return typeof e!="number"?e:new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",maximumFractionDigits:0}).format(e)}import{Fragment as Ee,jsx as f,jsxs as ue}from"react/jsx-runtime";function Me(e){return e?"rle-card rle-card--selected":"rle-card"}function H({item:e,selected:r,onSelect:t}){let i=e??{},n=Me(r),s=ue(Ee,{children:[i.imageUrl?f("img",{src:i.imageUrl,alt:i.title??"",className:"rle-card-media"}):f("div",{className:"rle-card-media rle-card-media--placeholder","aria-hidden":"true"}),ue("div",{className:"rle-card-body",children:[i.title&&f("span",{className:"rle-card-title",children:i.title}),i.subtitle&&f("span",{className:"rle-card-address",children:i.subtitle}),i.badge&&f("div",{className:"rle-card-info",children:f("span",{className:"rle-card-info-item",children:i.badge})}),i.price!=null&&f("span",{className:"rle-card-price",children:L(i.price)})]})]});return t?f("button",{type:"button",onClick:t,"aria-pressed":r??!1,className:n,children:s}):f("article",{className:n,children:s})}import{jsx as I,jsxs as me}from"react/jsx-runtime";function V(e){return me("div",{role:"status",className:"rle-empty",children:[me("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round",className:"rle-empty-icon","aria-hidden":"true",children:[I("circle",{cx:"11",cy:"11",r:"7"}),I("path",{d:"m21 21-4.3-4.3"})]}),I("p",{className:"rle-empty-title",children:"No results"}),I("p",{className:"rle-empty-hint",children:"Try adjusting your filters or search terms."})]})}import{jsx as Re}from"react/jsx-runtime";function O({children:e}){return Re("div",{className:"rle-filter-panel",children:e})}import{jsx as F,jsxs as Te}from"react/jsx-runtime";function D(e){return F("div",{className:"rle-loading",role:"status","aria-busy":"true","aria-label":"Loading results",children:Array.from({length:3}).map((r,t)=>Te("div",{className:"rle-loading-item",children:[F("div",{className:"rle-skeleton",style:{aspectRatio:"4 / 3",width:"100%"}}),F("div",{className:"rle-skeleton",style:{height:16,width:"65%"}}),F("div",{className:"rle-skeleton",style:{height:12,width:"35%"}})]},t))})}import{jsx as Ae}from"react/jsx-runtime";function K({point:e}){let r=e.entity??{};return Ae("span",{className:"rle-pin",children:r.price!=null?L(r.price):""})}import{jsx as N,jsxs as W}from"react/jsx-runtime";function $({entity:e,onClose:r}){let t=e??{};return W("div",{className:"rle-popup",role:"group","aria-label":"Location details",children:[N("button",{type:"button",onClick:r,"aria-label":"Close",className:"rle-popup-close",children:W("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",width:"16",height:"16","aria-hidden":"true",children:[N("path",{d:"M18 6 6 18"}),N("path",{d:"m6 6 12 12"})]})}),W("div",{children:[t.title&&N("div",{className:"rle-card-title",children:t.title}),t.subtitle&&N("div",{className:"rle-card-address",children:t.subtitle}),t.price!=null&&N("div",{className:"rle-card-price",children:L(t.price)})]})]})}import{jsx as Be}from"react/jsx-runtime";function z({count:e,total:r}){let t=r!=null&&r!==e?`${e} of ${r} results`:`${e} results`;return Be("div",{className:"rle-result-header",children:t})}import{jsx as He}from"react/jsx-runtime";function U({value:e,onChange:r,placeholder:t}){return He("input",{type:"search",value:e,placeholder:t,onChange:i=>r(i.target.value),"aria-label":t??"Search",className:"rle-input"})}import{jsx as Ve}from"react/jsx-runtime";function Z({children:e}){return Ve("aside",{className:"rle-sidebar",children:e})}import{jsx as Oe}from"react/jsx-runtime";function q({children:e}){return Oe("div",{className:"rle-toolbar",children:e})}var fe={Card:H,Marker:K,Popup:$,Sidebar:Z,FilterPanel:O,Search:U,Empty:V,Loading:D,ResultHeader:z,Toolbar:q};import{jsx as o,jsxs as y}from"react/jsx-runtime";function ge({view:e,onViewChange:r}){return o("nav",{className:"rle-bottom-nav","aria-label":"Listing navigation",children:y("div",{className:"rle-viewtoggle",role:"group","aria-label":"View",children:[y("button",{type:"button",className:`rle-viewtoggle__btn${e==="list"?" rle-viewtoggle__btn--active":""}`,"aria-pressed":e==="list",onClick:()=>r("list"),children:[o(De,{}),"List"]}),y("button",{type:"button",className:`rle-viewtoggle__btn${e==="map"?" rle-viewtoggle__btn--active":""}`,"aria-pressed":e==="map",onClick:()=>r("map"),children:[o(Ke,{}),"Map"]})]})})}function ve(){return y("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[o("line",{x1:"4",y1:"6",x2:"20",y2:"6"}),o("circle",{cx:"9",cy:"6",r:"2",fill:"currentColor",stroke:"none"}),o("line",{x1:"4",y1:"12",x2:"20",y2:"12"}),o("circle",{cx:"15",cy:"12",r:"2",fill:"currentColor",stroke:"none"}),o("line",{x1:"4",y1:"18",x2:"20",y2:"18"}),o("circle",{cx:"11",cy:"18",r:"2",fill:"currentColor",stroke:"none"})]})}function De(){return y("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",width:"16",height:"16","aria-hidden":"true",children:[o("line",{x1:"8",y1:"6",x2:"20",y2:"6"}),o("line",{x1:"8",y1:"12",x2:"20",y2:"12"}),o("line",{x1:"8",y1:"18",x2:"20",y2:"18"}),o("line",{x1:"4",y1:"6",x2:"4.01",y2:"6"}),o("line",{x1:"4",y1:"12",x2:"4.01",y2:"12"}),o("line",{x1:"4",y1:"18",x2:"4.01",y2:"18"})]})}function Ke(){return y("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",width:"16",height:"16","aria-hidden":"true",children:[o("polygon",{points:"1 6 8 3 16 6 23 3 23 18 16 21 8 18 1 21 1 6"}),o("line",{x1:"8",y1:"3",x2:"8",y2:"18"}),o("line",{x1:"16",y1:"6",x2:"16",y2:"21"})]})}function ye(){return y("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[o("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),o("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]})}import{useEffect as G,useRef as We,useState as he}from"react";import{createPortal as $e}from"react-dom";import{Fragment as Ue,jsx as g,jsxs as _}from"react/jsx-runtime";function be({open:e,onOpenChange:r,title:t,children:i,footer:n}){let s=We(null),[l,p]=he(!1),[c,m]=he(!1);return G(()=>{if(!e){m(!1),p(!1);return}p(!0);let d=requestAnimationFrame(()=>m(!0));return()=>cancelAnimationFrame(d)},[e]),G(()=>{if(!l)return;let d=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=d}},[l]),G(()=>{if(!l)return;s.current?.focus();function d(b){b.key==="Escape"&&r(!1)}return document.addEventListener("keydown",d),()=>document.removeEventListener("keydown",d)},[l,r]),!l||typeof document>"u"?null:$e(_(Ue,{children:[g("div",{className:`rle-sheet-backdrop${c?" rle-sheet-backdrop--open":""}`,onClick:()=>r(!1),"aria-hidden":"true"}),_("div",{ref:s,className:`rle-sheet${c?" rle-sheet--open":""}`,role:"dialog","aria-modal":"true","aria-label":t,tabIndex:-1,children:[g("div",{className:"rle-sheet__handle","aria-hidden":"true"}),_("div",{className:"rle-sheet__header",children:[t&&g("div",{className:"rle-sheet__title",children:t}),g("button",{type:"button",className:"rle-sheet__close",onClick:()=>r(!1),"aria-label":"Close",children:g(ze,{})})]}),g("div",{className:"rle-sheet__body",children:i}),n&&g("div",{className:"rle-sheet__footer",children:n})]})]}),document.body)}function ze(){return _("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",width:"16",height:"16","aria-hidden":"true",children:[g("path",{d:"M18 6 6 18"}),g("path",{d:"m6 6 12 12"})]})}import{useEffect as Se,useRef as Ze,useState as M}from"react";import{jsx as h,jsxs as Le}from"react/jsx-runtime";function Ne({search:e,onFiltersClick:r,filterCount:t=0,action:i}){let{Search:n}=x();return Le("header",{className:"rle-mobile-header",children:[e&&h("div",{className:"rle-mobile-header__search",children:h(n,{value:e.value,onChange:e.onChange,placeholder:e.placeholder})}),Le("button",{type:"button",className:"rle-mobile-header__btn",onClick:r,children:[h(ve,{}),h("span",{children:"Filters"}),t>0&&h("span",{className:"rle-mobile-header__count",children:t})]}),i&&h("button",{type:"button",className:"rle-mobile-header__btn rle-mobile-header__btn--icon",onClick:i.onClick,"aria-label":i.label,children:i.icon??h(ye,{})})]})}import{Fragment as Je,jsx as a,jsxs as v}from"react/jsx-runtime";var qe=a("div",{className:"rle-empty",children:"Map unavailable"});function Ge(){let e=Ze(null),[r,t]=M(!0),[i,n]=M(!0);return Se(()=>{let s=e.current;if(!s)return;let l=()=>{let{clientWidth:c,scrollLeft:m,scrollWidth:d}=s;t(m<=0),n(m+c>=d-1)};l(),s.addEventListener("scroll",l,{passive:!0});let p;return typeof ResizeObserver<"u"&&(p=new ResizeObserver(l),p.observe(s)),()=>{s.removeEventListener("scroll",l),p?.disconnect()}},[]),{atEnd:i,atStart:r,ref:e}}function we({search:e,toolbarEnd:r,mobileAction:t,autoFetch:i=!0,hasMap:n=!0,mapCenter:s,mapZoom:l,className:p}){let c=k(),{Search:m}=x(),d=ne(),{filters:b}=oe(),[P,E]=M("list"),[C,u]=M(!1),{atEnd:R,atStart:T,ref:A}=Ge(),S=e?{value:String(b[e.filterKey]??""),onChange:w=>{c.applyFilters({[e.filterKey]:w||void 0})},placeholder:e.placeholder}:void 0;Se(()=>{i!==!1&&c.applyFilters({})},[c,i]);let Ce=()=>{let w=c.filters.list().reduce((Ie,Q)=>Object.assign(Ie,Q.toParams(Q.fromParams({}))),{});c.applyFilters(w)},xe=c.filters.list().filter(w=>w.isActive?.(b)).length,ke=d.total??d.items.length;return v("div",{className:p?`rle-app ${p}`:"rle-app",children:[v("div",{className:"rle-filter-bar",children:[v("div",{className:"rle-filter-bar__scroll",ref:A,children:[S&&a("div",{className:"rle-filter-bar__search",children:a(m,{value:S.value,onChange:S.onChange,placeholder:S.placeholder})}),a(B,{className:"rle-filters-row",groupClassName:"rle-filter-group",hideLabels:!0}),v("div",{className:"rle-filter-bar__end",children:[a(de,{}),r]})]}),!T&&a("div",{className:"rle-filter-bar__fade rle-filter-bar__fade--start","aria-hidden":"true"}),!R&&a("div",{className:"rle-filter-bar__fade rle-filter-bar__fade--end","aria-hidden":"true"})]}),a(Ne,{search:S,onFiltersClick:()=>u(!0),filterCount:xe,action:t}),v("div",{className:`rle-body ${n?"rle-split":"rle-body--list-only"}`,"data-mobile-view":P,children:[v("div",{className:"rle-list",children:[a(se,{className:"rle-list-grid"}),a(ae,{})]}),n&&a("div",{className:"rle-map",children:a(le,{center:s,zoom:l,fallback:qe})})]}),n&&a(ge,{view:P,onViewChange:E}),a(be,{title:"Filters",open:C,onOpenChange:u,footer:v(Je,{children:[a("button",{type:"button",className:"rle-btn rle-btn--ghost",onClick:Ce,children:"Clear all"}),v("button",{type:"button",className:"rle-btn rle-btn--primary",onClick:()=>u(!1),children:["Show ",ke," results"]})]}),children:a(B,{className:"rle-filter-stack",groupClassName:"rle-filter-group"})})]})}import{useEffect as Qe,useRef as Xe,useState as Ye}from"react";import{jsx as J,jsxs as tt}from"react/jsx-runtime";function Pe(e){return"provider"in e}function je(e){let r=e!=null&&!Pe(e),t=r?e.apiKey:void 0,i=r?e.mapId:void 0,[n,s]=Ye(()=>!e||Pe(e)?{ready:!0,provider:e?.provider}:{ready:!1});return Qe(()=>{if(!t)return;let l=!1;return import("./maps/google/index.js").then(({googleProvider:p})=>{l||s({ready:!0,provider:p({apiKey:t,mapId:i})})}),()=>{l=!0}},[t,i]),n}function et({onFiltersChange:e}){let r=Xe(e);return r.current=e,ce("FiltersChanged",t=>{t.type==="FiltersChanged"&&r.current(t.filters)}),null}function pr(e){let{datasets:r,filters:t,map:i,components:n,initialFilters:s,onFiltersChange:l,mobileAction:p,search:c,toolbarEnd:m,config:d,autoFetch:b,className:P}=e,{ready:E,provider:C}=je(i);if(!E)return null;let u=[];for(let A of r)u.push(ee(A));t&&u.push(te(t)),C&&u.push(j(C)),s&&u.push(re(s)),d&&u.push(Y(d));let R=X(...u),T={...fe,...n};return tt(pe,{...R,children:[l&&J(et,{onFiltersChange:l}),J(ie,{...T,children:J(we,{className:P,search:c,toolbarEnd:m,mobileAction:p,autoFetch:b,hasMap:i!=null,mapCenter:i?.center,mapZoom:i?.zoom})})]})}export{ce as a,H as b,V as c,O as d,D as e,K as f,$ as g,z as h,U as i,Z as j,q as k,fe as l,ge as m,be as n,we as o,pr as p};
package/dist/index.cjs CHANGED
@@ -1,2 +1,2 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } var _class;"use client";
2
- var _chunkIE27WTWMcjs = require('./chunk-IE27WTWM.cjs');var _chunkEYXV5OMYcjs = require('./chunk-EYXV5OMY.cjs');var _chunkCHNUE46Kcjs = require('./chunk-CHNUE46K.cjs');var _chunk2VUHLHHXcjs = require('./chunk-2VUHLHHX.cjs');var d=(o=>(o.Paged="paged",o.Infinite="infinite",o))(d||{});var f=(r=>(r.FiltersChanged="FiltersChanged",r.ResultsLoaded="ResultsLoaded",r.PointClicked="PointClicked",r.BoundsChanged="BoundsChanged",r.LayerToggled="LayerToggled",r))(f||{});var u= (_class =class{__init() {this.listeners=new Set}constructor(t={}){;_class.prototype.__init.call(this);this.query={...t}}getQuery(){return{...this.query}}setQuery(t){this.query={...t},this.notify()}subscribe(t){return this.listeners.add(t),()=>{this.listeners.delete(t)}}notify(){for(let t of[...this.listeners])t()}}, _class);var _jsxruntime = require('react/jsx-runtime');function Z({children:e}){let{Toolbar:t}=_chunkEYXV5OMYcjs.q.call(void 0, );return _jsxruntime.jsx.call(void 0, t,{children:e})}var _react = require('react');function tt(){let e=_chunkEYXV5OMYcjs.s.call(void 0, ),t=_chunkEYXV5OMYcjs.t.call(void 0, ),o=_react.useCallback.call(void 0, a=>e.loadPoints(a),[e]),n=_react.useCallback.call(void 0, (a,r)=>e.selectPoint(a,r),[e]);return{bounds:t.bounds,points:t.points,loadPoints:o,selectPoint:n}}function it(e){let t=_chunkEYXV5OMYcjs.s.call(void 0, ),o=_chunkEYXV5OMYcjs.t.call(void 0, ),n=_react.useCallback.call(void 0, ()=>t.toggleLayer(e),[t,e]);return{visible:_nullishCoalesce(o.layers[e], () => (!0)),points:_nullishCoalesce(o.points[e], () => ([])),toggle:n}}exports.BrowserHistoryPort = _chunkCHNUE46Kcjs.a; exports.DatasetRegistry = _chunkEYXV5OMYcjs.c; exports.FilterRegistry = _chunkEYXV5OMYcjs.b; exports.ListingApp = _chunkIE27WTWMcjs.p; exports.ListingComponentsProvider = _chunkEYXV5OMYcjs.p; exports.ListingConfig = _chunkEYXV5OMYcjs.f; exports.ListingEngine = _chunkEYXV5OMYcjs.g; exports.ListingEngineContext = _chunkEYXV5OMYcjs.r; exports.ListingEventType = f; exports.ListingFilters = _chunkEYXV5OMYcjs.v; exports.ListingList = _chunkEYXV5OMYcjs.x; exports.ListingMap = _chunkEYXV5OMYcjs.y; exports.ListingPagination = _chunkEYXV5OMYcjs.z; exports.ListingProvider = _chunkEYXV5OMYcjs.B; exports.ListingResultHeader = _chunkEYXV5OMYcjs.A; exports.ListingStore = _chunkEYXV5OMYcjs.a; exports.ListingToolbar = Z; exports.MemoryHistoryPort = u; exports.PaginationMode = d; exports.TypedEmitter = _chunkEYXV5OMYcjs.d; exports.UrlSyncController = _chunk2VUHLHHXcjs.a; exports.composeListingProviders = _chunkEYXV5OMYcjs.h; exports.listingDefaultConfig = _chunkEYXV5OMYcjs.e; exports.useListing = _chunkEYXV5OMYcjs.s; exports.useListingComponents = _chunkEYXV5OMYcjs.q; exports.useListingEvent = _chunkIE27WTWMcjs.a; exports.useListingFilters = _chunkEYXV5OMYcjs.u; exports.useListingLayer = it; exports.useListingMap = tt; exports.useListingResults = _chunkEYXV5OMYcjs.w; exports.useListingState = _chunkEYXV5OMYcjs.t; exports.withConfig = _chunkEYXV5OMYcjs.i; exports.withDataset = _chunkEYXV5OMYcjs.k; exports.withFilters = _chunkEYXV5OMYcjs.l; exports.withInitialFilters = _chunkEYXV5OMYcjs.n; exports.withMap = _chunkEYXV5OMYcjs.j; exports.withPrimaryDataset = _chunkEYXV5OMYcjs.o; exports.withUrlSync = _chunkEYXV5OMYcjs.m;
2
+ var _chunkDBEYCUOScjs = require('./chunk-DBEYCUOS.cjs');var _chunkEYXV5OMYcjs = require('./chunk-EYXV5OMY.cjs');var _chunkCHNUE46Kcjs = require('./chunk-CHNUE46K.cjs');var _chunk2VUHLHHXcjs = require('./chunk-2VUHLHHX.cjs');var d=(o=>(o.Paged="paged",o.Infinite="infinite",o))(d||{});var f=(r=>(r.FiltersChanged="FiltersChanged",r.ResultsLoaded="ResultsLoaded",r.PointClicked="PointClicked",r.BoundsChanged="BoundsChanged",r.LayerToggled="LayerToggled",r))(f||{});var u= (_class =class{__init() {this.listeners=new Set}constructor(t={}){;_class.prototype.__init.call(this);this.query={...t}}getQuery(){return{...this.query}}setQuery(t){this.query={...t},this.notify()}subscribe(t){return this.listeners.add(t),()=>{this.listeners.delete(t)}}notify(){for(let t of[...this.listeners])t()}}, _class);var _jsxruntime = require('react/jsx-runtime');function Z({children:e}){let{Toolbar:t}=_chunkEYXV5OMYcjs.q.call(void 0, );return _jsxruntime.jsx.call(void 0, t,{children:e})}var _react = require('react');function tt(){let e=_chunkEYXV5OMYcjs.s.call(void 0, ),t=_chunkEYXV5OMYcjs.t.call(void 0, ),o=_react.useCallback.call(void 0, a=>e.loadPoints(a),[e]),n=_react.useCallback.call(void 0, (a,r)=>e.selectPoint(a,r),[e]);return{bounds:t.bounds,points:t.points,loadPoints:o,selectPoint:n}}function it(e){let t=_chunkEYXV5OMYcjs.s.call(void 0, ),o=_chunkEYXV5OMYcjs.t.call(void 0, ),n=_react.useCallback.call(void 0, ()=>t.toggleLayer(e),[t,e]);return{visible:_nullishCoalesce(o.layers[e], () => (!0)),points:_nullishCoalesce(o.points[e], () => ([])),toggle:n}}exports.BrowserHistoryPort = _chunkCHNUE46Kcjs.a; exports.DatasetRegistry = _chunkEYXV5OMYcjs.c; exports.FilterRegistry = _chunkEYXV5OMYcjs.b; exports.ListingApp = _chunkDBEYCUOScjs.p; exports.ListingComponentsProvider = _chunkEYXV5OMYcjs.p; exports.ListingConfig = _chunkEYXV5OMYcjs.f; exports.ListingEngine = _chunkEYXV5OMYcjs.g; exports.ListingEngineContext = _chunkEYXV5OMYcjs.r; exports.ListingEventType = f; exports.ListingFilters = _chunkEYXV5OMYcjs.v; exports.ListingList = _chunkEYXV5OMYcjs.x; exports.ListingMap = _chunkEYXV5OMYcjs.y; exports.ListingPagination = _chunkEYXV5OMYcjs.z; exports.ListingProvider = _chunkEYXV5OMYcjs.B; exports.ListingResultHeader = _chunkEYXV5OMYcjs.A; exports.ListingStore = _chunkEYXV5OMYcjs.a; exports.ListingToolbar = Z; exports.MemoryHistoryPort = u; exports.PaginationMode = d; exports.TypedEmitter = _chunkEYXV5OMYcjs.d; exports.UrlSyncController = _chunk2VUHLHHXcjs.a; exports.composeListingProviders = _chunkEYXV5OMYcjs.h; exports.listingDefaultConfig = _chunkEYXV5OMYcjs.e; exports.useListing = _chunkEYXV5OMYcjs.s; exports.useListingComponents = _chunkEYXV5OMYcjs.q; exports.useListingEvent = _chunkDBEYCUOScjs.a; exports.useListingFilters = _chunkEYXV5OMYcjs.u; exports.useListingLayer = it; exports.useListingMap = tt; exports.useListingResults = _chunkEYXV5OMYcjs.w; exports.useListingState = _chunkEYXV5OMYcjs.t; exports.withConfig = _chunkEYXV5OMYcjs.i; exports.withDataset = _chunkEYXV5OMYcjs.k; exports.withFilters = _chunkEYXV5OMYcjs.l; exports.withInitialFilters = _chunkEYXV5OMYcjs.n; exports.withMap = _chunkEYXV5OMYcjs.j; exports.withPrimaryDataset = _chunkEYXV5OMYcjs.o; exports.withUrlSync = _chunkEYXV5OMYcjs.m;
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- import{a as O,p as m}from"./chunk-I3HM2WET.js";import{A as N,B as U,a as y,b as P,c as L,d as h,e as b,f as x,g as C,h as I,i as k,j as q,k as v,l as B,m as S,n as A,o as F,p as T,q as p,r as w,s,t as i,u as H,v as z,w as D,x as G,y as J,z as K}from"./chunk-R3FX2V3N.js";import{a as R}from"./chunk-5FBI2WIM.js";import{a as Q}from"./chunk-35KYEBAC.js";var d=(o=>(o.Paged="paged",o.Infinite="infinite",o))(d||{});var f=(r=>(r.FiltersChanged="FiltersChanged",r.ResultsLoaded="ResultsLoaded",r.PointClicked="PointClicked",r.BoundsChanged="BoundsChanged",r.LayerToggled="LayerToggled",r))(f||{});var u=class{query;listeners=new Set;constructor(t={}){this.query={...t}}getQuery(){return{...this.query}}setQuery(t){this.query={...t},this.notify()}subscribe(t){return this.listeners.add(t),()=>{this.listeners.delete(t)}}notify(){for(let t of[...this.listeners])t()}};import{jsx as c}from"react/jsx-runtime";function Z({children:e}){let{Toolbar:t}=p();return c(t,{children:e})}import{useCallback as l}from"react";function tt(){let e=s(),t=i(),o=l(a=>e.loadPoints(a),[e]),n=l((a,r)=>e.selectPoint(a,r),[e]);return{bounds:t.bounds,points:t.points,loadPoints:o,selectPoint:n}}import{useCallback as g}from"react";function it(e){let t=s(),o=i(),n=g(()=>t.toggleLayer(e),[t,e]);return{visible:o.layers[e]??!0,points:o.points[e]??[],toggle:n}}export{R as BrowserHistoryPort,L as DatasetRegistry,P as FilterRegistry,m as ListingApp,T as ListingComponentsProvider,x as ListingConfig,C as ListingEngine,w as ListingEngineContext,f as ListingEventType,z as ListingFilters,G as ListingList,J as ListingMap,K as ListingPagination,U as ListingProvider,N as ListingResultHeader,y as ListingStore,Z as ListingToolbar,u as MemoryHistoryPort,d as PaginationMode,h as TypedEmitter,Q as UrlSyncController,I as composeListingProviders,b as listingDefaultConfig,s as useListing,p as useListingComponents,O as useListingEvent,H as useListingFilters,it as useListingLayer,tt as useListingMap,D as useListingResults,i as useListingState,k as withConfig,v as withDataset,B as withFilters,A as withInitialFilters,q as withMap,F as withPrimaryDataset,S as withUrlSync};
2
+ import{a as O,p as m}from"./chunk-T6CGFUTE.js";import{A as N,B as U,a as y,b as P,c as L,d as h,e as b,f as x,g as C,h as I,i as k,j as q,k as v,l as B,m as S,n as A,o as F,p as T,q as p,r as w,s,t as i,u as H,v as z,w as D,x as G,y as J,z as K}from"./chunk-R3FX2V3N.js";import{a as R}from"./chunk-5FBI2WIM.js";import{a as Q}from"./chunk-35KYEBAC.js";var d=(o=>(o.Paged="paged",o.Infinite="infinite",o))(d||{});var f=(r=>(r.FiltersChanged="FiltersChanged",r.ResultsLoaded="ResultsLoaded",r.PointClicked="PointClicked",r.BoundsChanged="BoundsChanged",r.LayerToggled="LayerToggled",r))(f||{});var u=class{query;listeners=new Set;constructor(t={}){this.query={...t}}getQuery(){return{...this.query}}setQuery(t){this.query={...t},this.notify()}subscribe(t){return this.listeners.add(t),()=>{this.listeners.delete(t)}}notify(){for(let t of[...this.listeners])t()}};import{jsx as c}from"react/jsx-runtime";function Z({children:e}){let{Toolbar:t}=p();return c(t,{children:e})}import{useCallback as l}from"react";function tt(){let e=s(),t=i(),o=l(a=>e.loadPoints(a),[e]),n=l((a,r)=>e.selectPoint(a,r),[e]);return{bounds:t.bounds,points:t.points,loadPoints:o,selectPoint:n}}import{useCallback as g}from"react";function it(e){let t=s(),o=i(),n=g(()=>t.toggleLayer(e),[t,e]);return{visible:o.layers[e]??!0,points:o.points[e]??[],toggle:n}}export{R as BrowserHistoryPort,L as DatasetRegistry,P as FilterRegistry,m as ListingApp,T as ListingComponentsProvider,x as ListingConfig,C as ListingEngine,w as ListingEngineContext,f as ListingEventType,z as ListingFilters,G as ListingList,J as ListingMap,K as ListingPagination,U as ListingProvider,N as ListingResultHeader,y as ListingStore,Z as ListingToolbar,u as MemoryHistoryPort,d as PaginationMode,h as TypedEmitter,Q as UrlSyncController,I as composeListingProviders,b as listingDefaultConfig,s as useListing,p as useListingComponents,O as useListingEvent,H as useListingFilters,it as useListingLayer,tt as useListingMap,D as useListingResults,i as useListingState,k as withConfig,v as withDataset,B as withFilters,A as withInitialFilters,q as withMap,F as withPrimaryDataset,S as withUrlSync};
@@ -1,2 +1,2 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
2
- var _chunkIE27WTWMcjs = require('../chunk-IE27WTWM.cjs');var _chunkEYXV5OMYcjs = require('../chunk-EYXV5OMY.cjs');var _jsxruntime = require('react/jsx-runtime');function L({children:o}){return _jsxruntime.jsx.call(void 0, _chunkEYXV5OMYcjs.p,{..._chunkIE27WTWMcjs.l,children:o})}exports.BottomNav = _chunkIE27WTWMcjs.m; exports.BottomSheet = _chunkIE27WTWMcjs.n; exports.ListingApp = _chunkIE27WTWMcjs.p; exports.StyledCard = _chunkIE27WTWMcjs.b; exports.StyledComponentsProviderWithDefaults = L; exports.StyledEmpty = _chunkIE27WTWMcjs.c; exports.StyledFilterPanel = _chunkIE27WTWMcjs.d; exports.StyledListingLayout = _chunkIE27WTWMcjs.o; exports.StyledLoading = _chunkIE27WTWMcjs.e; exports.StyledMarker = _chunkIE27WTWMcjs.f; exports.StyledPopup = _chunkIE27WTWMcjs.g; exports.StyledResultHeader = _chunkIE27WTWMcjs.h; exports.StyledSearch = _chunkIE27WTWMcjs.i; exports.StyledSidebar = _chunkIE27WTWMcjs.j; exports.StyledToolbar = _chunkIE27WTWMcjs.k; exports.styledDefaultComponents = _chunkIE27WTWMcjs.l;
2
+ var _chunkDBEYCUOScjs = require('../chunk-DBEYCUOS.cjs');var _chunkEYXV5OMYcjs = require('../chunk-EYXV5OMY.cjs');var _jsxruntime = require('react/jsx-runtime');function L({children:o}){return _jsxruntime.jsx.call(void 0, _chunkEYXV5OMYcjs.p,{..._chunkDBEYCUOScjs.l,children:o})}exports.BottomNav = _chunkDBEYCUOScjs.m; exports.BottomSheet = _chunkDBEYCUOScjs.n; exports.ListingApp = _chunkDBEYCUOScjs.p; exports.StyledCard = _chunkDBEYCUOScjs.b; exports.StyledComponentsProviderWithDefaults = L; exports.StyledEmpty = _chunkDBEYCUOScjs.c; exports.StyledFilterPanel = _chunkDBEYCUOScjs.d; exports.StyledListingLayout = _chunkDBEYCUOScjs.o; exports.StyledLoading = _chunkDBEYCUOScjs.e; exports.StyledMarker = _chunkDBEYCUOScjs.f; exports.StyledPopup = _chunkDBEYCUOScjs.g; exports.StyledResultHeader = _chunkDBEYCUOScjs.h; exports.StyledSearch = _chunkDBEYCUOScjs.i; exports.StyledSidebar = _chunkDBEYCUOScjs.j; exports.StyledToolbar = _chunkDBEYCUOScjs.k; exports.styledDefaultComponents = _chunkDBEYCUOScjs.l;
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- import{b as r,c as p,d as i,e as d,f as y,g as l,h as n,i as m,j as s,k as a,l as t,m as S,n as f,o as P,p as u}from"../chunk-I3HM2WET.js";import{p as e}from"../chunk-R3FX2V3N.js";import{jsx as g}from"react/jsx-runtime";function L({children:o}){return g(e,{...t,children:o})}export{S as BottomNav,f as BottomSheet,u as ListingApp,r as StyledCard,L as StyledComponentsProviderWithDefaults,p as StyledEmpty,i as StyledFilterPanel,P as StyledListingLayout,d as StyledLoading,y as StyledMarker,l as StyledPopup,n as StyledResultHeader,m as StyledSearch,s as StyledSidebar,a as StyledToolbar,t as styledDefaultComponents};
2
+ import{b as r,c as p,d as i,e as d,f as y,g as l,h as n,i as m,j as s,k as a,l as t,m as S,n as f,o as P,p as u}from"../chunk-T6CGFUTE.js";import{p as e}from"../chunk-R3FX2V3N.js";import{jsx as g}from"react/jsx-runtime";function L({children:o}){return g(e,{...t,children:o})}export{S as BottomNav,f as BottomSheet,u as ListingApp,r as StyledCard,L as StyledComponentsProviderWithDefaults,p as StyledEmpty,i as StyledFilterPanel,P as StyledListingLayout,d as StyledLoading,y as StyledMarker,l as StyledPopup,n as StyledResultHeader,m as StyledSearch,s as StyledSidebar,a as StyledToolbar,t as styledDefaultComponents};
package/dist/styles.css CHANGED
@@ -599,10 +599,10 @@
599
599
  /* -----------------------------------------------------------------------
600
600
  * Layout shell -- the responsive "filter bar + list/map split" chrome
601
601
  * `StyledListingLayout` composes the `~/react` structure-only components
602
- * into. Breakpoint: 768px, matching the mobile-only bottom nav/sheet below.
602
+ * into. Breakpoint: 1024px, matching the mobile-only bottom nav/sheet below.
603
603
  * Mobile-first: rules with no media query apply to every width; a
604
- * `(min-width: 768px)` block layers desktop-only overrides, a
605
- * `(max-width: 767px)` block layers mobile-only overrides -- never both for
604
+ * `(min-width: 1024px)` block layers desktop-only overrides, a
605
+ * `(max-width: 1023px)` block layers mobile-only overrides -- never both for
606
606
  * the same property, so there is exactly one source of truth per viewport.
607
607
  * --------------------------------------------------------------------- */
608
608
 
@@ -641,7 +641,7 @@
641
641
  }
642
642
 
643
643
  /* -----------------------------------------------------------------------
644
- * Desktop filter bar -- hidden below 768px in favor of the bottom nav's
644
+ * Desktop filter bar -- hidden below 1024px in favor of the bottom nav's
645
645
  * Filters button + bottom sheet.
646
646
  * --------------------------------------------------------------------- */
647
647
 
@@ -649,21 +649,59 @@
649
649
  position: sticky;
650
650
  top: 0;
651
651
  z-index: 10;
652
+ background: var(--rle-surface);
653
+ border-bottom: 1px solid var(--rle-border);
654
+ }
655
+
656
+ /* The scrolling row itself: one line that scrolls horizontally once the
657
+ active-filter badges overflow, instead of wrapping to a second row. Scrollbar
658
+ hidden; the fade overlays below sit above its edges. */
659
+ .rle-filter-bar__scroll {
652
660
  display: flex;
653
- flex-wrap: wrap;
654
661
  align-items: center;
655
662
  gap: var(--rle-space);
656
663
  padding: var(--rle-space);
657
- background: var(--rle-surface);
658
- border-bottom: 1px solid var(--rle-border);
664
+ overflow-x: auto;
665
+ overflow-y: hidden;
666
+ scrollbar-width: none;
667
+ }
668
+
669
+ .rle-filter-bar__scroll::-webkit-scrollbar {
670
+ display: none;
671
+ }
672
+
673
+ /* Keep every item at its natural width so the row scrolls rather than squishing
674
+ its filter buttons. */
675
+ .rle-filter-bar__scroll > * {
676
+ flex-shrink: 0;
677
+ }
678
+
679
+ /* Soft fade painted OVER the content at a scrollable edge -- rendered only on a
680
+ side that has more content off-screen (`useScrollEdges`), so content dissolves
681
+ into the bar background exactly like the host app's own filter bars. A
682
+ background gradient can't do this (it paints behind content); this overlay
683
+ sits on top. */
684
+ .rle-filter-bar__fade {
685
+ position: absolute;
686
+ top: 0;
687
+ bottom: 1px; /* clear the bar's 1px border-bottom */
688
+ width: 44px;
689
+ pointer-events: none;
690
+ }
691
+
692
+ .rle-filter-bar__fade--start {
693
+ left: 0;
694
+ background: linear-gradient(to right, var(--rle-surface), transparent);
659
695
  }
660
696
 
661
- /* Bounded so the search sits inline with the filters on one row instead of
662
- taking a full row of its own (the `.rle-input` inside is width:100%). */
697
+ .rle-filter-bar__fade--end {
698
+ right: 0;
699
+ background: linear-gradient(to left, var(--rle-surface), transparent);
700
+ }
701
+
702
+ /* Fixed-width search so it neither grows into the filters nor collapses. */
663
703
  .rle-filter-bar__search {
664
- flex: 1 1 200px;
665
- min-width: 180px;
666
- max-width: 340px;
704
+ flex: 0 0 clamp(180px, 22vw, 280px);
667
705
  }
668
706
 
669
707
  .rle-filter-bar__end {
@@ -673,7 +711,7 @@
673
711
  margin-left: auto;
674
712
  }
675
713
 
676
- @media (max-width: 767px) {
714
+ @media (max-width: 1023px) {
677
715
  .rle-filter-bar {
678
716
  display: none;
679
717
  }
@@ -685,11 +723,17 @@
685
723
  shrinkable wrapper for each individual filter group in either layout. */
686
724
  .rle-filters-row {
687
725
  display: flex;
688
- flex-wrap: wrap;
726
+ flex-wrap: nowrap;
689
727
  align-items: center;
690
728
  gap: var(--rle-space);
691
729
  }
692
730
 
731
+ /* In the (scrolling) desktop row the groups keep their natural width; in the
732
+ mobile stack they lay out vertically, where this is a no-op. */
733
+ .rle-filters-row > * {
734
+ flex-shrink: 0;
735
+ }
736
+
693
737
  .rle-filter-stack {
694
738
  display: flex;
695
739
  flex-direction: column;
@@ -701,7 +745,7 @@
701
745
  }
702
746
 
703
747
  /* -----------------------------------------------------------------------
704
- * Mobile header -- shown below 768px (hidden at 768px+), the compact
748
+ * Mobile header -- shown below 1024px (hidden at 1024px+), the compact
705
749
  * counterpart to the desktop `.rle-filter-bar`: the search input (grows to
706
750
  * fill), a Filters button that opens the bottom sheet, and an optional
707
751
  * trailing action (e.g. Save). The List|Map toggle lives in the floating
@@ -712,7 +756,7 @@
712
756
  display: none;
713
757
  }
714
758
 
715
- @media (max-width: 767px) {
759
+ @media (max-width: 1023px) {
716
760
  .rle-mobile-header {
717
761
  position: sticky;
718
762
  top: 0;
@@ -772,8 +816,25 @@
772
816
  color: var(--rle-muted);
773
817
  }
774
818
 
819
+ /* Applied-filter count badge on the Filters button. */
820
+ .rle-mobile-header__count {
821
+ display: inline-flex;
822
+ align-items: center;
823
+ justify-content: center;
824
+ min-width: 18px;
825
+ height: 18px;
826
+ padding: 0 5px;
827
+ background: var(--rle-primary);
828
+ color: var(--rle-primary-contrast);
829
+ border-radius: var(--rle-radius-pill);
830
+ font-size: 11px;
831
+ font-weight: 600;
832
+ font-variant-numeric: tabular-nums;
833
+ line-height: 1;
834
+ }
835
+
775
836
  /* -----------------------------------------------------------------------
776
- * Body / split -- list-left, map-right from 768px up; a single full-area
837
+ * Body / split -- list-left, map-right from 1024px up; a single full-area
777
838
  * panel (one of `.rle-list`/`.rle-map` visible at a time) below it.
778
839
  * --------------------------------------------------------------------- */
779
840
 
@@ -789,7 +850,7 @@
789
850
  height: 100%;
790
851
  }
791
852
 
792
- @media (min-width: 768px) {
853
+ @media (min-width: 1024px) {
793
854
  .rle-split {
794
855
  /* List-majority: scanning the cards is the primary task and the map is
795
856
  orientation, so the list takes ~58% (floored at 400px) rather than
@@ -822,10 +883,10 @@
822
883
  height: 100%;
823
884
  }
824
885
 
825
- @media (max-width: 767px) {
886
+ @media (max-width: 1023px) {
826
887
  /* Exactly one of list/map visible at a time, driven by the mobile-view
827
888
  toggle in the bottom nav -- see `listing-layout.tsx`. Scoped to mobile
828
- only: at 768px+ `.rle-split`'s two grid columns keep both visible
889
+ only: at 1024px+ `.rle-split`'s two grid columns keep both visible
829
890
  regardless of this data attribute's current value. */
830
891
  .rle-body[data-mobile-view='list'] .rle-map {
831
892
  display: none;
@@ -856,7 +917,7 @@
856
917
  display: none;
857
918
  }
858
919
 
859
- @media (max-width: 767px) {
920
+ @media (max-width: 1023px) {
860
921
  .rle-bottom-nav {
861
922
  position: fixed;
862
923
  left: 50%;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-listing-engine",
3
- "version": "0.6.0",
3
+ "version": "0.6.2",
4
4
  "license": "MIT",
5
5
  "description": "Headless, composable listing engine for React: filterable list + Google-Maps multi-layer map, with pluggable data adapters, a filter/dataset registry, injectable components, and a shadcn-compatible styled adapter.",
6
6
  "funding": [
@@ -1,2 +0,0 @@
1
- "use client";
2
- import{A as se,B as le,h as G,i as J,j as Q,k as X,l as Y,n as j,p as ee,q as C,s as x,u as te,v as T,w as re,x as ie,y as oe,z as ne}from"./chunk-R3FX2V3N.js";import{useEffect as we,useRef as Pe}from"react";function ae(e,r){let t=x(),i=Pe(r);i.current=r,we(()=>t.on(e,n=>i.current(n)),[t,e])}function b(e){return typeof e!="number"?e:new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",maximumFractionDigits:0}).format(e)}import{Fragment as xe,jsx as u,jsxs as de}from"react/jsx-runtime";function Ce(e){return e?"rle-card rle-card--selected":"rle-card"}function B({item:e,selected:r,onSelect:t}){let i=e??{},n=Ce(r),a=de(xe,{children:[i.imageUrl?u("img",{src:i.imageUrl,alt:i.title??"",className:"rle-card-media"}):u("div",{className:"rle-card-media rle-card-media--placeholder","aria-hidden":"true"}),de("div",{className:"rle-card-body",children:[i.title&&u("span",{className:"rle-card-title",children:i.title}),i.subtitle&&u("span",{className:"rle-card-address",children:i.subtitle}),i.badge&&u("div",{className:"rle-card-info",children:u("span",{className:"rle-card-info-item",children:i.badge})}),i.price!=null&&u("span",{className:"rle-card-price",children:b(i.price)})]})]});return t?u("button",{type:"button",onClick:t,"aria-pressed":r??!1,className:n,children:a}):u("article",{className:n,children:a})}import{jsx as k,jsxs as pe}from"react/jsx-runtime";function A(e){return pe("div",{role:"status",className:"rle-empty",children:[pe("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round",className:"rle-empty-icon","aria-hidden":"true",children:[k("circle",{cx:"11",cy:"11",r:"7"}),k("path",{d:"m21 21-4.3-4.3"})]}),k("p",{className:"rle-empty-title",children:"No results"}),k("p",{className:"rle-empty-hint",children:"Try adjusting your filters or search terms."})]})}import{jsx as ke}from"react/jsx-runtime";function V({children:e}){return ke("div",{className:"rle-filter-panel",children:e})}import{jsx as I,jsxs as Ie}from"react/jsx-runtime";function K(e){return I("div",{className:"rle-loading",role:"status","aria-busy":"true","aria-label":"Loading results",children:Array.from({length:3}).map((r,t)=>Ie("div",{className:"rle-loading-item",children:[I("div",{className:"rle-skeleton",style:{aspectRatio:"4 / 3",width:"100%"}}),I("div",{className:"rle-skeleton",style:{height:16,width:"65%"}}),I("div",{className:"rle-skeleton",style:{height:12,width:"35%"}})]},t))})}import{jsx as Fe}from"react/jsx-runtime";function H({point:e}){let r=e.entity??{};return Fe("span",{className:"rle-pin",children:r.price!=null?b(r.price):""})}import{jsx as L,jsxs as D}from"react/jsx-runtime";function O({entity:e,onClose:r}){let t=e??{};return D("div",{className:"rle-popup",role:"group","aria-label":"Location details",children:[L("button",{type:"button",onClick:r,"aria-label":"Close",className:"rle-popup-close",children:D("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",width:"16",height:"16","aria-hidden":"true",children:[L("path",{d:"M18 6 6 18"}),L("path",{d:"m6 6 12 12"})]})}),D("div",{children:[t.title&&L("div",{className:"rle-card-title",children:t.title}),t.subtitle&&L("div",{className:"rle-card-address",children:t.subtitle}),t.price!=null&&L("div",{className:"rle-card-price",children:b(t.price)})]})]})}import{jsx as Me}from"react/jsx-runtime";function W({count:e,total:r}){let t=r!=null&&r!==e?`${e} of ${r} results`:`${e} results`;return Me("div",{className:"rle-result-header",children:t})}import{jsx as _e}from"react/jsx-runtime";function $({value:e,onChange:r,placeholder:t}){return _e("input",{type:"search",value:e,placeholder:t,onChange:i=>r(i.target.value),"aria-label":t??"Search",className:"rle-input"})}import{jsx as Ee}from"react/jsx-runtime";function z({children:e}){return Ee("aside",{className:"rle-sidebar",children:e})}import{jsx as Re}from"react/jsx-runtime";function U({children:e}){return Re("div",{className:"rle-toolbar",children:e})}var ce={Card:B,Marker:H,Popup:O,Sidebar:z,FilterPanel:V,Search:$,Empty:A,Loading:K,ResultHeader:W,Toolbar:U};import{jsx as o,jsxs as y}from"react/jsx-runtime";function me({view:e,onViewChange:r}){return o("nav",{className:"rle-bottom-nav","aria-label":"Listing navigation",children:y("div",{className:"rle-viewtoggle",role:"group","aria-label":"View",children:[y("button",{type:"button",className:`rle-viewtoggle__btn${e==="list"?" rle-viewtoggle__btn--active":""}`,"aria-pressed":e==="list",onClick:()=>r("list"),children:[o(Te,{}),"List"]}),y("button",{type:"button",className:`rle-viewtoggle__btn${e==="map"?" rle-viewtoggle__btn--active":""}`,"aria-pressed":e==="map",onClick:()=>r("map"),children:[o(Be,{}),"Map"]})]})})}function ue(){return y("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[o("line",{x1:"4",y1:"6",x2:"20",y2:"6"}),o("circle",{cx:"9",cy:"6",r:"2",fill:"currentColor",stroke:"none"}),o("line",{x1:"4",y1:"12",x2:"20",y2:"12"}),o("circle",{cx:"15",cy:"12",r:"2",fill:"currentColor",stroke:"none"}),o("line",{x1:"4",y1:"18",x2:"20",y2:"18"}),o("circle",{cx:"11",cy:"18",r:"2",fill:"currentColor",stroke:"none"})]})}function Te(){return y("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",width:"16",height:"16","aria-hidden":"true",children:[o("line",{x1:"8",y1:"6",x2:"20",y2:"6"}),o("line",{x1:"8",y1:"12",x2:"20",y2:"12"}),o("line",{x1:"8",y1:"18",x2:"20",y2:"18"}),o("line",{x1:"4",y1:"6",x2:"4.01",y2:"6"}),o("line",{x1:"4",y1:"12",x2:"4.01",y2:"12"}),o("line",{x1:"4",y1:"18",x2:"4.01",y2:"18"})]})}function Be(){return y("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",width:"16",height:"16","aria-hidden":"true",children:[o("polygon",{points:"1 6 8 3 16 6 23 3 23 18 16 21 8 18 1 21 1 6"}),o("line",{x1:"8",y1:"3",x2:"8",y2:"18"}),o("line",{x1:"16",y1:"6",x2:"16",y2:"21"})]})}function ge(){return y("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[o("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),o("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]})}import{useEffect as Z,useRef as Ae,useState as fe}from"react";import{createPortal as Ve}from"react-dom";import{Fragment as He,jsx as g,jsxs as F}from"react/jsx-runtime";function ye({open:e,onOpenChange:r,title:t,children:i,footer:n}){let a=Ae(null),[l,m]=fe(!1),[p,h]=fe(!1);return Z(()=>{if(!e){h(!1),m(!1);return}m(!0);let d=requestAnimationFrame(()=>h(!0));return()=>cancelAnimationFrame(d)},[e]),Z(()=>{if(!l)return;let d=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=d}},[l]),Z(()=>{if(!l)return;a.current?.focus();function d(S){S.key==="Escape"&&r(!1)}return document.addEventListener("keydown",d),()=>document.removeEventListener("keydown",d)},[l,r]),!l||typeof document>"u"?null:Ve(F(He,{children:[g("div",{className:`rle-sheet-backdrop${p?" rle-sheet-backdrop--open":""}`,onClick:()=>r(!1),"aria-hidden":"true"}),F("div",{ref:a,className:`rle-sheet${p?" rle-sheet--open":""}`,role:"dialog","aria-modal":"true","aria-label":t,tabIndex:-1,children:[g("div",{className:"rle-sheet__handle","aria-hidden":"true"}),F("div",{className:"rle-sheet__header",children:[t&&g("div",{className:"rle-sheet__title",children:t}),g("button",{type:"button",className:"rle-sheet__close",onClick:()=>r(!1),"aria-label":"Close",children:g(Ke,{})})]}),g("div",{className:"rle-sheet__body",children:i}),n&&g("div",{className:"rle-sheet__footer",children:n})]})]}),document.body)}function Ke(){return F("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",width:"16",height:"16","aria-hidden":"true",children:[g("path",{d:"M18 6 6 18"}),g("path",{d:"m6 6 12 12"})]})}import{useEffect as De,useState as be}from"react";import{jsx as N,jsxs as ve}from"react/jsx-runtime";function he({search:e,onFiltersClick:r,action:t}){let{Search:i}=C();return ve("header",{className:"rle-mobile-header",children:[e&&N("div",{className:"rle-mobile-header__search",children:N(i,{value:e.value,onChange:e.onChange,placeholder:e.placeholder})}),ve("button",{type:"button",className:"rle-mobile-header__btn",onClick:r,children:[N(ue,{}),N("span",{children:"Filters"})]}),t&&N("button",{type:"button",className:"rle-mobile-header__btn rle-mobile-header__btn--icon",onClick:t.onClick,"aria-label":t.label,children:t.icon??N(ge,{})})]})}import{Fragment as We,jsx as s,jsxs as v}from"react/jsx-runtime";var Oe=s("div",{className:"rle-empty",children:"Map unavailable"});function Le({search:e,toolbarEnd:r,mobileAction:t,autoFetch:i=!0,hasMap:n=!0,mapCenter:a,mapZoom:l,className:m}){let p=x(),{Search:h}=C(),d=re(),{filters:S}=te(),[w,M]=be("list"),[P,c]=be(!1),f=e?{value:String(S[e.filterKey]??""),onChange:R=>{p.applyFilters({[e.filterKey]:R||void 0})},placeholder:e.placeholder}:void 0;De(()=>{i!==!1&&p.applyFilters({})},[p,i]);let _=()=>{let R=Object.fromEntries(p.filters.list().map(Se=>[Se.key,void 0]));p.applyFilters(R)},E=d.total??d.items.length;return v("div",{className:m?`rle-app ${m}`:"rle-app",children:[v("div",{className:"rle-filter-bar",children:[f&&s("div",{className:"rle-filter-bar__search",children:s(h,{value:f.value,onChange:f.onChange,placeholder:f.placeholder})}),s(T,{className:"rle-filters-row",groupClassName:"rle-filter-group",hideLabels:!0}),v("div",{className:"rle-filter-bar__end",children:[s(se,{}),r]})]}),s(he,{search:f,onFiltersClick:()=>c(!0),action:t}),v("div",{className:`rle-body ${n?"rle-split":"rle-body--list-only"}`,"data-mobile-view":w,children:[v("div",{className:"rle-list",children:[s(ie,{className:"rle-list-grid"}),s(ne,{})]}),n&&s("div",{className:"rle-map",children:s(oe,{center:a,zoom:l,fallback:Oe})})]}),n&&s(me,{view:w,onViewChange:M}),s(ye,{title:"Filters",open:P,onOpenChange:c,footer:v(We,{children:[s("button",{type:"button",className:"rle-btn rle-btn--ghost",onClick:_,children:"Clear all"}),v("button",{type:"button",className:"rle-btn rle-btn--primary",onClick:()=>c(!1),children:["Show ",E," results"]})]}),children:s(T,{className:"rle-filter-stack",groupClassName:"rle-filter-group"})})]})}import{useEffect as $e,useRef as ze,useState as Ue}from"react";import{jsx as q,jsxs as Ge}from"react/jsx-runtime";function Ne(e){return"provider"in e}function Ze(e){let r=e!=null&&!Ne(e),t=r?e.apiKey:void 0,i=r?e.mapId:void 0,[n,a]=Ue(()=>!e||Ne(e)?{ready:!0,provider:e?.provider}:{ready:!1});return $e(()=>{if(!t)return;let l=!1;return import("./maps/google/index.js").then(({googleProvider:m})=>{l||a({ready:!0,provider:m({apiKey:t,mapId:i})})}),()=>{l=!0}},[t,i]),n}function qe({onFiltersChange:e}){let r=ze(e);return r.current=e,ae("FiltersChanged",t=>{t.type==="FiltersChanged"&&r.current(t.filters)}),null}function ir(e){let{datasets:r,filters:t,map:i,components:n,initialFilters:a,onFiltersChange:l,mobileAction:m,search:p,toolbarEnd:h,config:d,autoFetch:S,className:w}=e,{ready:M,provider:P}=Ze(i);if(!M)return null;let c=[];for(let E of r)c.push(X(E));t&&c.push(Y(t)),P&&c.push(Q(P)),a&&c.push(j(a)),d&&c.push(J(d));let f=G(...c),_={...ce,...n};return Ge(le,{...f,children:[l&&q(qe,{onFiltersChange:l}),q(ee,{..._,children:q(Le,{className:w,search:p,toolbarEnd:h,mobileAction:m,autoFetch:S,hasMap:i!=null,mapCenter:i?.center,mapZoom:i?.zoom})})]})}export{ae as a,B as b,A as c,V as d,K as e,H as f,O as g,W as h,$ as i,z as j,U as k,ce as l,me as m,ye as n,Le as o,ir as p};
@@ -1,2 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }"use client";
2
- var _chunkEYXV5OMYcjs = require('./chunk-EYXV5OMY.cjs');var _react = require('react');function ae(e,r){let t=_chunkEYXV5OMYcjs.s.call(void 0, ),i=_react.useRef.call(void 0, r);i.current=r,_react.useEffect.call(void 0, ()=>t.on(e,n=>i.current(n)),[t,e])}function b(e){return typeof e!="number"?e:new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",maximumFractionDigits:0}).format(e)}var _jsxruntime = require('react/jsx-runtime');function Ce(e){return e?"rle-card rle-card--selected":"rle-card"}function B({item:e,selected:r,onSelect:t}){let i=_nullishCoalesce(e, () => ({})),n=Ce(r),a=_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[i.imageUrl?_jsxruntime.jsx.call(void 0, "img",{src:i.imageUrl,alt:_nullishCoalesce(i.title, () => ("")),className:"rle-card-media"}):_jsxruntime.jsx.call(void 0, "div",{className:"rle-card-media rle-card-media--placeholder","aria-hidden":"true"}),_jsxruntime.jsxs.call(void 0, "div",{className:"rle-card-body",children:[i.title&&_jsxruntime.jsx.call(void 0, "span",{className:"rle-card-title",children:i.title}),i.subtitle&&_jsxruntime.jsx.call(void 0, "span",{className:"rle-card-address",children:i.subtitle}),i.badge&&_jsxruntime.jsx.call(void 0, "div",{className:"rle-card-info",children:_jsxruntime.jsx.call(void 0, "span",{className:"rle-card-info-item",children:i.badge})}),i.price!=null&&_jsxruntime.jsx.call(void 0, "span",{className:"rle-card-price",children:b(i.price)})]})]});return t?_jsxruntime.jsx.call(void 0, "button",{type:"button",onClick:t,"aria-pressed":_nullishCoalesce(r, () => (!1)),className:n,children:a}):_jsxruntime.jsx.call(void 0, "article",{className:n,children:a})}function A(e){return _jsxruntime.jsxs.call(void 0, "div",{role:"status",className:"rle-empty",children:[_jsxruntime.jsxs.call(void 0, "svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round",className:"rle-empty-icon","aria-hidden":"true",children:[_jsxruntime.jsx.call(void 0, "circle",{cx:"11",cy:"11",r:"7"}),_jsxruntime.jsx.call(void 0, "path",{d:"m21 21-4.3-4.3"})]}),_jsxruntime.jsx.call(void 0, "p",{className:"rle-empty-title",children:"No results"}),_jsxruntime.jsx.call(void 0, "p",{className:"rle-empty-hint",children:"Try adjusting your filters or search terms."})]})}function V({children:e}){return _jsxruntime.jsx.call(void 0, "div",{className:"rle-filter-panel",children:e})}function K(e){return _jsxruntime.jsx.call(void 0, "div",{className:"rle-loading",role:"status","aria-busy":"true","aria-label":"Loading results",children:Array.from({length:3}).map((r,t)=>_jsxruntime.jsxs.call(void 0, "div",{className:"rle-loading-item",children:[_jsxruntime.jsx.call(void 0, "div",{className:"rle-skeleton",style:{aspectRatio:"4 / 3",width:"100%"}}),_jsxruntime.jsx.call(void 0, "div",{className:"rle-skeleton",style:{height:16,width:"65%"}}),_jsxruntime.jsx.call(void 0, "div",{className:"rle-skeleton",style:{height:12,width:"35%"}})]},t))})}function H({point:e}){let r=_nullishCoalesce(e.entity, () => ({}));return _jsxruntime.jsx.call(void 0, "span",{className:"rle-pin",children:r.price!=null?b(r.price):""})}function O({entity:e,onClose:r}){let t=_nullishCoalesce(e, () => ({}));return _jsxruntime.jsxs.call(void 0, "div",{className:"rle-popup",role:"group","aria-label":"Location details",children:[_jsxruntime.jsx.call(void 0, "button",{type:"button",onClick:r,"aria-label":"Close",className:"rle-popup-close",children:_jsxruntime.jsxs.call(void 0, "svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",width:"16",height:"16","aria-hidden":"true",children:[_jsxruntime.jsx.call(void 0, "path",{d:"M18 6 6 18"}),_jsxruntime.jsx.call(void 0, "path",{d:"m6 6 12 12"})]})}),_jsxruntime.jsxs.call(void 0, "div",{children:[t.title&&_jsxruntime.jsx.call(void 0, "div",{className:"rle-card-title",children:t.title}),t.subtitle&&_jsxruntime.jsx.call(void 0, "div",{className:"rle-card-address",children:t.subtitle}),t.price!=null&&_jsxruntime.jsx.call(void 0, "div",{className:"rle-card-price",children:b(t.price)})]})]})}function W({count:e,total:r}){let t=r!=null&&r!==e?`${e} of ${r} results`:`${e} results`;return _jsxruntime.jsx.call(void 0, "div",{className:"rle-result-header",children:t})}function $({value:e,onChange:r,placeholder:t}){return _jsxruntime.jsx.call(void 0, "input",{type:"search",value:e,placeholder:t,onChange:i=>r(i.target.value),"aria-label":_nullishCoalesce(t, () => ("Search")),className:"rle-input"})}function z({children:e}){return _jsxruntime.jsx.call(void 0, "aside",{className:"rle-sidebar",children:e})}function U({children:e}){return _jsxruntime.jsx.call(void 0, "div",{className:"rle-toolbar",children:e})}var ce={Card:B,Marker:H,Popup:O,Sidebar:z,FilterPanel:V,Search:$,Empty:A,Loading:K,ResultHeader:W,Toolbar:U};function me({view:e,onViewChange:r}){return _jsxruntime.jsx.call(void 0, "nav",{className:"rle-bottom-nav","aria-label":"Listing navigation",children:_jsxruntime.jsxs.call(void 0, "div",{className:"rle-viewtoggle",role:"group","aria-label":"View",children:[_jsxruntime.jsxs.call(void 0, "button",{type:"button",className:`rle-viewtoggle__btn${e==="list"?" rle-viewtoggle__btn--active":""}`,"aria-pressed":e==="list",onClick:()=>r("list"),children:[_jsxruntime.jsx.call(void 0, Te,{}),"List"]}),_jsxruntime.jsxs.call(void 0, "button",{type:"button",className:`rle-viewtoggle__btn${e==="map"?" rle-viewtoggle__btn--active":""}`,"aria-pressed":e==="map",onClick:()=>r("map"),children:[_jsxruntime.jsx.call(void 0, Be,{}),"Map"]})]})})}function ue(){return _jsxruntime.jsxs.call(void 0, "svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[_jsxruntime.jsx.call(void 0, "line",{x1:"4",y1:"6",x2:"20",y2:"6"}),_jsxruntime.jsx.call(void 0, "circle",{cx:"9",cy:"6",r:"2",fill:"currentColor",stroke:"none"}),_jsxruntime.jsx.call(void 0, "line",{x1:"4",y1:"12",x2:"20",y2:"12"}),_jsxruntime.jsx.call(void 0, "circle",{cx:"15",cy:"12",r:"2",fill:"currentColor",stroke:"none"}),_jsxruntime.jsx.call(void 0, "line",{x1:"4",y1:"18",x2:"20",y2:"18"}),_jsxruntime.jsx.call(void 0, "circle",{cx:"11",cy:"18",r:"2",fill:"currentColor",stroke:"none"})]})}function Te(){return _jsxruntime.jsxs.call(void 0, "svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",width:"16",height:"16","aria-hidden":"true",children:[_jsxruntime.jsx.call(void 0, "line",{x1:"8",y1:"6",x2:"20",y2:"6"}),_jsxruntime.jsx.call(void 0, "line",{x1:"8",y1:"12",x2:"20",y2:"12"}),_jsxruntime.jsx.call(void 0, "line",{x1:"8",y1:"18",x2:"20",y2:"18"}),_jsxruntime.jsx.call(void 0, "line",{x1:"4",y1:"6",x2:"4.01",y2:"6"}),_jsxruntime.jsx.call(void 0, "line",{x1:"4",y1:"12",x2:"4.01",y2:"12"}),_jsxruntime.jsx.call(void 0, "line",{x1:"4",y1:"18",x2:"4.01",y2:"18"})]})}function Be(){return _jsxruntime.jsxs.call(void 0, "svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",width:"16",height:"16","aria-hidden":"true",children:[_jsxruntime.jsx.call(void 0, "polygon",{points:"1 6 8 3 16 6 23 3 23 18 16 21 8 18 1 21 1 6"}),_jsxruntime.jsx.call(void 0, "line",{x1:"8",y1:"3",x2:"8",y2:"18"}),_jsxruntime.jsx.call(void 0, "line",{x1:"16",y1:"6",x2:"16",y2:"21"})]})}function ge(){return _jsxruntime.jsxs.call(void 0, "svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[_jsxruntime.jsx.call(void 0, "line",{x1:"12",y1:"5",x2:"12",y2:"19"}),_jsxruntime.jsx.call(void 0, "line",{x1:"5",y1:"12",x2:"19",y2:"12"})]})}var _reactdom = require('react-dom');function ye({open:e,onOpenChange:r,title:t,children:i,footer:n}){let a=_react.useRef.call(void 0, null),[l,m]=_react.useState.call(void 0, !1),[p,h]=_react.useState.call(void 0, !1);return _react.useEffect.call(void 0, ()=>{if(!e){h(!1),m(!1);return}m(!0);let d=requestAnimationFrame(()=>h(!0));return()=>cancelAnimationFrame(d)},[e]),_react.useEffect.call(void 0, ()=>{if(!l)return;let d=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=d}},[l]),_react.useEffect.call(void 0, ()=>{if(!l)return;_optionalChain([a, 'access', _2 => _2.current, 'optionalAccess', _3 => _3.focus, 'call', _4 => _4()]);function d(S){S.key==="Escape"&&r(!1)}return document.addEventListener("keydown",d),()=>document.removeEventListener("keydown",d)},[l,r]),!l||typeof document>"u"?null:_reactdom.createPortal.call(void 0, _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, "div",{className:`rle-sheet-backdrop${p?" rle-sheet-backdrop--open":""}`,onClick:()=>r(!1),"aria-hidden":"true"}),_jsxruntime.jsxs.call(void 0, "div",{ref:a,className:`rle-sheet${p?" rle-sheet--open":""}`,role:"dialog","aria-modal":"true","aria-label":t,tabIndex:-1,children:[_jsxruntime.jsx.call(void 0, "div",{className:"rle-sheet__handle","aria-hidden":"true"}),_jsxruntime.jsxs.call(void 0, "div",{className:"rle-sheet__header",children:[t&&_jsxruntime.jsx.call(void 0, "div",{className:"rle-sheet__title",children:t}),_jsxruntime.jsx.call(void 0, "button",{type:"button",className:"rle-sheet__close",onClick:()=>r(!1),"aria-label":"Close",children:_jsxruntime.jsx.call(void 0, Ke,{})})]}),_jsxruntime.jsx.call(void 0, "div",{className:"rle-sheet__body",children:i}),n&&_jsxruntime.jsx.call(void 0, "div",{className:"rle-sheet__footer",children:n})]})]}),document.body)}function Ke(){return _jsxruntime.jsxs.call(void 0, "svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",width:"16",height:"16","aria-hidden":"true",children:[_jsxruntime.jsx.call(void 0, "path",{d:"M18 6 6 18"}),_jsxruntime.jsx.call(void 0, "path",{d:"m6 6 12 12"})]})}function he({search:e,onFiltersClick:r,action:t}){let{Search:i}=_chunkEYXV5OMYcjs.q.call(void 0, );return _jsxruntime.jsxs.call(void 0, "header",{className:"rle-mobile-header",children:[e&&_jsxruntime.jsx.call(void 0, "div",{className:"rle-mobile-header__search",children:_jsxruntime.jsx.call(void 0, i,{value:e.value,onChange:e.onChange,placeholder:e.placeholder})}),_jsxruntime.jsxs.call(void 0, "button",{type:"button",className:"rle-mobile-header__btn",onClick:r,children:[_jsxruntime.jsx.call(void 0, ue,{}),_jsxruntime.jsx.call(void 0, "span",{children:"Filters"})]}),t&&_jsxruntime.jsx.call(void 0, "button",{type:"button",className:"rle-mobile-header__btn rle-mobile-header__btn--icon",onClick:t.onClick,"aria-label":t.label,children:_nullishCoalesce(t.icon, () => (_jsxruntime.jsx.call(void 0, ge,{})))})]})}var Oe=_jsxruntime.jsx.call(void 0, "div",{className:"rle-empty",children:"Map unavailable"});function Le({search:e,toolbarEnd:r,mobileAction:t,autoFetch:i=!0,hasMap:n=!0,mapCenter:a,mapZoom:l,className:m}){let p=_chunkEYXV5OMYcjs.s.call(void 0, ),{Search:h}=_chunkEYXV5OMYcjs.q.call(void 0, ),d=_chunkEYXV5OMYcjs.w.call(void 0, ),{filters:S}=_chunkEYXV5OMYcjs.u.call(void 0, ),[w,M]=_react.useState.call(void 0, "list"),[P,c]=_react.useState.call(void 0, !1),f=e?{value:String(_nullishCoalesce(S[e.filterKey], () => (""))),onChange:R=>{p.applyFilters({[e.filterKey]:R||void 0})},placeholder:e.placeholder}:void 0;_react.useEffect.call(void 0, ()=>{i!==!1&&p.applyFilters({})},[p,i]);let _=()=>{let R=Object.fromEntries(p.filters.list().map(Se=>[Se.key,void 0]));p.applyFilters(R)},E=_nullishCoalesce(d.total, () => (d.items.length));return _jsxruntime.jsxs.call(void 0, "div",{className:m?`rle-app ${m}`:"rle-app",children:[_jsxruntime.jsxs.call(void 0, "div",{className:"rle-filter-bar",children:[f&&_jsxruntime.jsx.call(void 0, "div",{className:"rle-filter-bar__search",children:_jsxruntime.jsx.call(void 0, h,{value:f.value,onChange:f.onChange,placeholder:f.placeholder})}),_jsxruntime.jsx.call(void 0, _chunkEYXV5OMYcjs.v,{className:"rle-filters-row",groupClassName:"rle-filter-group",hideLabels:!0}),_jsxruntime.jsxs.call(void 0, "div",{className:"rle-filter-bar__end",children:[_jsxruntime.jsx.call(void 0, _chunkEYXV5OMYcjs.A,{}),r]})]}),_jsxruntime.jsx.call(void 0, he,{search:f,onFiltersClick:()=>c(!0),action:t}),_jsxruntime.jsxs.call(void 0, "div",{className:`rle-body ${n?"rle-split":"rle-body--list-only"}`,"data-mobile-view":w,children:[_jsxruntime.jsxs.call(void 0, "div",{className:"rle-list",children:[_jsxruntime.jsx.call(void 0, _chunkEYXV5OMYcjs.x,{className:"rle-list-grid"}),_jsxruntime.jsx.call(void 0, _chunkEYXV5OMYcjs.z,{})]}),n&&_jsxruntime.jsx.call(void 0, "div",{className:"rle-map",children:_jsxruntime.jsx.call(void 0, _chunkEYXV5OMYcjs.y,{center:a,zoom:l,fallback:Oe})})]}),n&&_jsxruntime.jsx.call(void 0, me,{view:w,onViewChange:M}),_jsxruntime.jsx.call(void 0, ye,{title:"Filters",open:P,onOpenChange:c,footer:_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, "button",{type:"button",className:"rle-btn rle-btn--ghost",onClick:_,children:"Clear all"}),_jsxruntime.jsxs.call(void 0, "button",{type:"button",className:"rle-btn rle-btn--primary",onClick:()=>c(!1),children:["Show ",E," results"]})]}),children:_jsxruntime.jsx.call(void 0, _chunkEYXV5OMYcjs.v,{className:"rle-filter-stack",groupClassName:"rle-filter-group"})})]})}function Ne(e){return"provider"in e}function Ze(e){let r=e!=null&&!Ne(e),t=r?e.apiKey:void 0,i=r?e.mapId:void 0,[n,a]=_react.useState.call(void 0, ()=>!e||Ne(e)?{ready:!0,provider:_optionalChain([e, 'optionalAccess', _5 => _5.provider])}:{ready:!1});return _react.useEffect.call(void 0, ()=>{if(!t)return;let l=!1;return Promise.resolve().then(() => _interopRequireWildcard(require("./maps/google/index.cjs"))).then(({googleProvider:m})=>{l||a({ready:!0,provider:m({apiKey:t,mapId:i})})}),()=>{l=!0}},[t,i]),n}function qe({onFiltersChange:e}){let r=_react.useRef.call(void 0, e);return r.current=e,ae("FiltersChanged",t=>{t.type==="FiltersChanged"&&r.current(t.filters)}),null}function ir(e){let{datasets:r,filters:t,map:i,components:n,initialFilters:a,onFiltersChange:l,mobileAction:m,search:p,toolbarEnd:h,config:d,autoFetch:S,className:w}=e,{ready:M,provider:P}=Ze(i);if(!M)return null;let c=[];for(let E of r)c.push(_chunkEYXV5OMYcjs.k.call(void 0, E));t&&c.push(_chunkEYXV5OMYcjs.l.call(void 0, t)),P&&c.push(_chunkEYXV5OMYcjs.j.call(void 0, P)),a&&c.push(_chunkEYXV5OMYcjs.n.call(void 0, a)),d&&c.push(_chunkEYXV5OMYcjs.i.call(void 0, d));let f=_chunkEYXV5OMYcjs.h.call(void 0, ...c),_={...ce,...n};return _jsxruntime.jsxs.call(void 0, _chunkEYXV5OMYcjs.B,{...f,children:[l&&_jsxruntime.jsx.call(void 0, qe,{onFiltersChange:l}),_jsxruntime.jsx.call(void 0, _chunkEYXV5OMYcjs.p,{..._,children:_jsxruntime.jsx.call(void 0, Le,{className:w,search:p,toolbarEnd:h,mobileAction:m,autoFetch:S,hasMap:i!=null,mapCenter:_optionalChain([i, 'optionalAccess', _6 => _6.center]),mapZoom:_optionalChain([i, 'optionalAccess', _7 => _7.zoom])})})]})}exports.a = ae; exports.b = B; exports.c = A; exports.d = V; exports.e = K; exports.f = H; exports.g = O; exports.h = W; exports.i = $; exports.j = z; exports.k = U; exports.l = ce; exports.m = me; exports.n = ye; exports.o = Le; exports.p = ir;