Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@bentoproject/list

Package Overview
Dependencies
Maintainers
3
Versions
125
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bentoproject/list - npm Package Compare versions

Comparing version 1.2305051745.0 to 1.2305051745.1

2

dist/component-preact.js
;
var r=Object.create,e=Object.defineProperty,n=Object.getOwnPropertyDescriptor,t=Object.getOwnPropertyNames,o=Object.getPrototypeOf,u=Object.prototype.hasOwnProperty,a=function(r){return e(r,"__esModule",{value:!0})},i=function(i){return function(r,o,a){if(o&&"object"==typeof o||"function"==typeof o)for(var i,c=t(o),f=0,l=c.length;f<l;f++)i=c[f],u.call(r,i)||"default"===i||e(r,i,{get:function(r){return o[r]}.bind(null,i),enumerable:!(a=n(o,i))||a.enumerable});return r}(a(e(null!=i?r(o(i)):{},"default",i&&i.__esModule&&"default"in i?{get:function(){return i.default},enumerable:!0}:{value:i,enumerable:!0})),i)};function c(r,e,n){return e in r?Object.defineProperty(r,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):r[e]=n,r}function f(r,e){var n=Object.keys(r);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(r);e&&(t=t.filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.push.apply(n,t)}return n}function l(r){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?f(Object(n),!0).forEach((function(e){c(r,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(n)):f(Object(n)).forEach((function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(n,e))}))}return r}function s(r){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(r){return typeof r}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r})(r)}function v(r,e,n,t,o,u,a){try{var i=r[u](a),c=i.value}catch(r){return void n(r)}i.done?e(c):Promise.resolve(c).then(t,o)}function d(r){return function(){var e=this,n=arguments;return new Promise((function(t,o){var u=r.apply(e,n);function a(r){v(u,t,o,a,i,"next",r)}function i(r){v(u,t,o,a,i,"throw",r)}a(void 0)}))}}!function(r,n){for(var t in a(r),n)e(r,t,{get:n[t],enumerable:!0})}(exports,{BentoList:function(){return K},BentoListWithRef:function(){return H}});var b=i(require("@bentoproject/core/preact")),p=i(require("@bentoproject/core/preact")),m=i(require("@bentoproject/core/preact")),y=i(require("@bentoproject/core/preact"));function g(r,e){(null==e||e>r.length)&&(e=r.length);for(var n=0,t=new Array(e);n<e;n++)t[n]=r[n];return t}function h(r,e){if(r){if("string"==typeof r)return g(r,e);var n=Object.prototype.toString.call(r).slice(8,-1);return"Object"===n&&r.constructor&&(n=r.constructor.name),"Map"===n||"Set"===n?Array.from(r):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?g(r,e):void 0}}function j(r,e){return function(r){if(Array.isArray(r))return r}(r)||function(r,e){var n=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=n){var t,o,u=[],a=!0,i=!1;try{for(n=n.call(r);!(a=(t=n.next()).done)&&(u.push(t.value),!e||u.length!==e);a=!0);}catch(r){i=!0,o=r}finally{try{a||null==n.return||n.return()}finally{if(i)throw o}}return u}}(r,e)||h(r,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}Array.isArray;var w=Object.prototype;function O(r){return(r.ownerDocument||r).defaultView}function M(r){return r.parent&&r.parent!=r}function S(r,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},t=n.needsRootBounds,o=n.rootMargin,u=n.threshold,a=M(e)&&(t||o)?e.document:void 0;return new e.IntersectionObserver(r,{threshold:u,root:a,rootMargin:o})}w.hasOwnProperty,w.toString;var k=new WeakMap,x=new WeakMap;function A(r){for(var e=new Set,n=r.length-1;n>=0;n--){var t=r[n],o=t.target;if(!e.has(o)){e.add(o);var u=x.get(o);if(u)for(var a=0;a<u.length;a++)(0,u[a])(t)}}}var q=i(require("@bentoproject/core/preact")),P=i(require("@bentoproject/core/preact"));function I(r){return function(r){if(Array.isArray(r))return g(r)}(r)||function(r){if("undefined"!=typeof Symbol&&null!=r[Symbol.iterator]||null!=r["@@iterator"])return Array.from(r)}(r)||h(r)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var R=i(require("@bentoproject/core/preact")),L=i(require("@bentoproject/core/preact")),T=i(require("@bentoproject/core/preact")),B={loading:!1,error:null,pages:[],hasMore:!0},C={fetchJson:function(r,e){return this.fetch(r,e).then((function(r){return r.json()}))},fetch:function(r,e){return d(regeneratorRuntime.mark((function n(){var t;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,self.fetch(r,e);case 2:if((t=n.sent).ok){n.next=5;break}throw new Error(t.statusText);case 5:return n.abrupt("return",t);case 6:case"end":return n.stop()}}),n)})))()}},E={loadMoreSpinner:"load-more-spinner-cc33818",loadMoreIcon:"load-more-icon-cc33818"},W=("url('data:image/svg+xml;charset=utf-8,".concat('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 40 40"><defs><linearGradient id="grad"><stop stop-color="rgb(51,51,51)" stop-opacity=".75"></stop><stop offset="100%" stop-color="rgb(51,51,51)" stop-opacity="0"></stop></linearGradient></defs><path d="M11,4.4 A18,18, 0,1,0, 38,20" fill="none" stroke="url(%23grad)" stroke-width="1.725"></path></svg>',"')"),"url('data:image/svg+xml;charset=utf-8,".concat('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="currentColor" d="M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z"></path></svg>',"')"),["src","fetchJson","itemsKey","maxItems","loadMore","loadMoreBookmark","viewportBuffer","template","wrapperTemplate","loadMoreTemplate","loadingTemplate","errorTemplate"]),G=function(r){return b.createElement("div",null,String(r))},J=function(r){return b.createElement("div",null,r)},N=function(r,e){return b.createElement("div",null,"Unable to Load More ",b.createElement("button",{"load-more-retry":!0},b.createElement("label",null,b.createElement("span",{class:r.loadMoreIcon})," Retry")))},U=function(){return b.createElement("div",null,b.createElement("button",{"load-more-button":!0},b.createElement("label",null,"See More")))},_=function(r){return b.createElement("div",null,b.createElement("span",{"aria-label":"Loading",class:r.loadMoreSpinner}))};function z(r,e){return e.split(".").reduce((function(r,e){return r&&""!==e?r[e]:r}),r)}function H(r,e){var n,t=r.src,o=void 0===t?null:t,u=r.fetchJson,a=void 0===u?C.fetchJson:u,i=r.itemsKey,c=void 0===i?"items":i,f=r.maxItems,v=void 0===f?0:f,m=r.loadMore,g=void 0===m?"none":m,h=r.loadMoreBookmark,w=void 0===h?"load-more-src":h,M=r.viewportBuffer,H=void 0===M?2:M,K=r.template,$=void 0===K?G:K,D=r.wrapperTemplate,F=void 0===D?J:D,Q=r.loadMoreTemplate,X=void 0===Q?U:Q,Y=r.loadingTemplate,Z=void 0===Y?_:Y,rr=r.errorTemplate,er=void 0===rr?N:rr,nr=function(r,e){if(null==r)return{};var n,t,o={},u=Object.keys(r);for(t=0;t<u.length;t++)n=u[t],e.indexOf(n)>=0||(o[n]=r[n]);return o}(r,W),tr=(0,P.useAmpContext)().renderable,or=(0,p.useMemo)((function(){var r=Math.floor(100*H);return{rootMargin:"0% 0% ".concat(r,"% 0%"),threshold:0}}),[H]),ur=(0,p.useRef)(null),ar=function(r,e){var n=j((0,q.useState)(!1),2),t=n[0],o=n[1];return(0,q.useEffect)((function(){var n=r.current;if(n)return function(r,e,n){var t=O(r);if(n){var o=S((function(r){e(r[r.length-1])}),t,n);return o.observe(r),function(){o.unobserve(r)}}var u=k.get(t);u||k.set(t,u=S(A,t));var a=x.get(r);return a||(a=[],x.set(r,a)),a.push(e),u.observe(r),function(){!function(r,e){var n,t,o,u=x.get(r);if(u&&(t=e,-1!=(o=(n=u).indexOf(t))&&(n.splice(o,1),1)&&!u.length)){var a=O(r),i=k.get(a);null==i||i.unobserve(r),x.delete(r)}}(r,e)}}(n,(function(r){o(r.isIntersecting)}),e)}),[r,e]),t}(ur,or),ir=function(r){var e=r.fetchPage,n=r.getNextPageParam,t=function(r){var e=(0,T.useRef)(!1);(0,T.useEffect)((function(){return e.current=!0,function(){e.current=!1}}),[]);var n=j((0,T.useState)(r),2),t=n[0],o=n[1];return[t,(0,T.useCallback)((function(r){e.current&&o(r)}),[o])]}(B),o=j(t,2),u=o[0],a=o[1],i=(0,L.useValueRef)({fetchPage:e,getNextPageParam:n,state:u}),c=(0,R.useRef)(0),f=(0,R.useCallback)(d(regeneratorRuntime.mark((function r(){var e,n,t,o,u,f,s,v,d,b,p=arguments;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(e=p.length>0&&void 0!==p[0]&&p[0],n=i.current,t=n.fetchPage,o=n.getNextPageParam,u=n.state,e||!u.loading){r.next=4;break}return r.abrupt("return");case 4:return f=++c.current,a((function(r){return l(l({},r),{},{loading:!0})})),s=e?[]:u.pages,v=s.length?s[s.length-1]:void 0,r.prev=8,r.next=11,t({pageParam:v?o(v):void 0});case 11:if(d=r.sent,f===c.current){r.next=14;break}return r.abrupt("return");case 14:b=o(d),a({loading:!1,error:null,pages:[].concat(I(s),[d]),hasMore:null!=b}),r.next=23;break;case 18:if(r.prev=18,r.t0=r.catch(8),f===c.current){r.next=22;break}return r.abrupt("return");case 22:a((function(e){return l(l({},e),{},{loading:!1,error:r.t0})}));case 23:case"end":return r.stop()}}),r,null,[[8,18]])}))),[i,a]),s=(0,R.useCallback)((function(){return f(!0)}),[f]);return l(l({},u),{},{loadMore:f,reset:s})}({fetchPage:(n=d(regeneratorRuntime.mark((function r(e){var n,t,u;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(n=e.pageParam,t=void 0===n?o:n,tr){r.next=3;break}return r.abrupt("return",null);case 3:return r.next=5,a(t);case 5:return u=r.sent,r.abrupt("return",u);case 7:case"end":return r.stop()}}),r)}))),function(r){return n.apply(this,arguments)}),getNextPageParam:function(r){return function(r,e){return z(r,e)}(r,w)}}),cr=ir.error,fr=ir.hasMore,lr=ir.loadMore,sr=ir.loading,vr=ir.pages,dr=ir.reset;(0,p.useEffect)((function(){dr()}),[o,tr,w,dr]);var br=tr&&"auto"===g&&ar&&!sr&&fr;(0,p.useEffect)((function(){br&&lr()}),[br,lr]);var pr=(0,p.useMemo)((function(){var r=vr.flatMap((function(r){return function(r,e){if(!r)return[];var n=z(r,e);return n?(Array.isArray(n)||(n=[n]),n):[]}(r,c)}));return v>0&&r.length>v&&(r=r.slice(0,v)),r.map((function(r,e){var n=$(r);return n&&"object"===s(n)&&"string"==typeof n.__html&&(n=b.createElement("span",{dangerouslySetInnerHTML:n})),V(n,{"key":e,"role":"listitem"})}))}),[vr,c,v,$]),mr=sr,yr=0!==pr.length,gr="manual"===g&&fr&&!sr;(0,p.useImperativeHandle)(e,(function(){return{refresh:dr}}),[dr]);var hr=E;return b.createElement(y.ContainWrapper,l(l({"aria-live":"polite"},nr),{},{onClick:function(r){r.target.closest("[load-more-button], [load-more-retry]")&&lr()}}),b.createElement(p.Fragment,{"test-id":"contents"},yr&&V(F(pr),{"role":"list"}),mr&&Z(hr),gr&&X(hr),cr&&er(hr,cr),"auto"===g&&b.createElement("span",{ref:ur})))}var K=(0,m.forwardRef)(H);function V(r,e){return(0,p.isValidElement)(r)?(0,p.cloneElement)(r,l(l({},e),r.props)):r}
var r=Object.create,e=Object.defineProperty,n=Object.getOwnPropertyDescriptor,t=Object.getOwnPropertyNames,o=Object.getPrototypeOf,u=Object.prototype.hasOwnProperty,a=function(r){return e(r,"__esModule",{value:!0})},i=function(i){return function(r,o,a){if(o&&"object"==typeof o||"function"==typeof o)for(var i,c=t(o),f=0,l=c.length;f<l;f++)i=c[f],u.call(r,i)||"default"===i||e(r,i,{get:function(r){return o[r]}.bind(null,i),enumerable:!(a=n(o,i))||a.enumerable});return r}(a(e(null!=i?r(o(i)):{},"default",i&&i.__esModule&&"default"in i?{get:function(){return i.default},enumerable:!0}:{value:i,enumerable:!0})),i)};function c(r,e,n){return e in r?Object.defineProperty(r,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):r[e]=n,r}function f(r,e){var n=Object.keys(r);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(r);e&&(t=t.filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.push.apply(n,t)}return n}function l(r){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?f(Object(n),!0).forEach((function(e){c(r,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(n)):f(Object(n)).forEach((function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(n,e))}))}return r}function s(r){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(r){return typeof r}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r})(r)}function v(r,e,n,t,o,u,a){try{var i=r[u](a),c=i.value}catch(r){return void n(r)}i.done?e(c):Promise.resolve(c).then(t,o)}function d(r){return function(){var e=this,n=arguments;return new Promise((function(t,o){var u=r.apply(e,n);function a(r){v(u,t,o,a,i,"next",r)}function i(r){v(u,t,o,a,i,"throw",r)}a(void 0)}))}}!function(r,n){for(var t in a(r),n)e(r,t,{get:n[t],enumerable:!0})}(exports,{BentoList:function(){return K},BentoListWithRef:function(){return H}});var b=i(require("@bentoproject/core/preact")),p=i(require("@bentoproject/core/preact")),m=i(require("@bentoproject/core/preact")),y=i(require("@bentoproject/core/preact"));function g(r,e){(null==e||e>r.length)&&(e=r.length);for(var n=0,t=new Array(e);n<e;n++)t[n]=r[n];return t}function h(r,e){if(r){if("string"==typeof r)return g(r,e);var n=Object.prototype.toString.call(r).slice(8,-1);return"Object"===n&&r.constructor&&(n=r.constructor.name),"Map"===n||"Set"===n?Array.from(r):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?g(r,e):void 0}}function j(r,e){return function(r){if(Array.isArray(r))return r}(r)||function(r,e){var n=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=n){var t,o,u=[],a=!0,i=!1;try{for(n=n.call(r);!(a=(t=n.next()).done)&&(u.push(t.value),!e||u.length!==e);a=!0);}catch(r){i=!0,o=r}finally{try{a||null==n.return||n.return()}finally{if(i)throw o}}return u}}(r,e)||h(r,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}Array.isArray;var w=Object.prototype;function O(r){return(r.ownerDocument||r).defaultView}function M(r){return r.parent&&r.parent!=r}function S(r,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},t=n.needsRootBounds,o=n.rootMargin,u=n.threshold,a=M(e)&&(t||o)?e.document:void 0;return new e.IntersectionObserver(r,{threshold:u,root:a,rootMargin:o})}w.hasOwnProperty,w.toString;var k=new WeakMap,x=new WeakMap;function A(r){for(var e=new Set,n=r.length-1;n>=0;n--){var t=r[n],o=t.target;if(!e.has(o)){e.add(o);var u=x.get(o);if(u)for(var a=0;a<u.length;a++)(0,u[a])(t)}}}var q=i(require("@bentoproject/core/preact")),P=i(require("@bentoproject/core/preact"));function I(r){return function(r){if(Array.isArray(r))return g(r)}(r)||function(r){if("undefined"!=typeof Symbol&&null!=r[Symbol.iterator]||null!=r["@@iterator"])return Array.from(r)}(r)||h(r)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var R=i(require("@bentoproject/core/preact")),L=i(require("@bentoproject/core/preact")),T=i(require("@bentoproject/core/preact")),B={loading:!1,error:null,pages:[],hasMore:!0},C={fetchJson:function(r,e){return this.fetch(r,e).then((function(r){return r.json()}))},fetch:function(r,e){return d(regeneratorRuntime.mark((function n(){var t;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,self.fetch(r,e);case 2:if((t=n.sent).ok){n.next=5;break}throw new Error(t.statusText);case 5:return n.abrupt("return",t);case 6:case"end":return n.stop()}}),n)})))()}},E={loadMoreSpinner:"load-more-spinner-cc33818",loadMoreIcon:"load-more-icon-cc33818"},W=("url('data:image/svg+xml;charset=utf-8,".concat('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 40 40"><defs><linearGradient id="grad"><stop stop-color="rgb(51,51,51)" stop-opacity=".75"></stop><stop offset="100%" stop-color="rgb(51,51,51)" stop-opacity="0"></stop></linearGradient></defs><path d="M11,4.4 A18,18, 0,1,0, 38,20" fill="none" stroke="url(%23grad)" stroke-width="1.725"></path></svg>',"')"),"url('data:image/svg+xml;charset=utf-8,".concat('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="currentColor" d="M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z"></path></svg>',"')"),["errorTemplate","fetchJson","itemsKey","loadMore","loadMoreBookmark","loadMoreTemplate","loadingTemplate","maxItems","src","template","viewportBuffer","wrapperTemplate"]),G=function(r){return b.createElement("div",null,String(r))},J=function(r){return b.createElement("div",null,r)},N=function(r,e){return b.createElement("div",null,"Unable to Load More ",b.createElement("button",{"load-more-retry":!0},b.createElement("label",null,b.createElement("span",{class:r.loadMoreIcon})," Retry")))},U=function(){return b.createElement("div",null,b.createElement("button",{"load-more-button":!0},b.createElement("label",null,"See More")))},_=function(r){return b.createElement("div",null,b.createElement("span",{"aria-label":"Loading",class:r.loadMoreSpinner}))};function z(r,e){return e.split(".").reduce((function(r,e){return r&&""!==e?r[e]:r}),r)}function H(r,e){var n,t=r.errorTemplate,o=void 0===t?N:t,u=r.fetchJson,a=void 0===u?C.fetchJson:u,i=r.itemsKey,c=void 0===i?"items":i,f=r.loadMore,v=void 0===f?"none":f,m=r.loadMoreBookmark,g=void 0===m?"load-more-src":m,h=r.loadMoreTemplate,w=void 0===h?U:h,M=r.loadingTemplate,H=void 0===M?_:M,K=r.maxItems,$=void 0===K?0:K,D=r.src,F=void 0===D?null:D,Q=r.template,X=void 0===Q?G:Q,Y=r.viewportBuffer,Z=void 0===Y?2:Y,rr=r.wrapperTemplate,er=void 0===rr?J:rr,nr=function(r,e){if(null==r)return{};var n,t,o={},u=Object.keys(r);for(t=0;t<u.length;t++)n=u[t],e.indexOf(n)>=0||(o[n]=r[n]);return o}(r,W),tr=(0,P.useAmpContext)().renderable,or=(0,p.useMemo)((function(){var r=Math.floor(100*Z);return{rootMargin:"0% 0% ".concat(r,"% 0%"),threshold:0}}),[Z]),ur=(0,p.useRef)(null),ar=function(r,e){var n=j((0,q.useState)(!1),2),t=n[0],o=n[1];return(0,q.useEffect)((function(){var n=r.current;if(n)return function(r,e,n){var t=O(r);if(n){var o=S((function(r){e(r[r.length-1])}),t,n);return o.observe(r),function(){o.unobserve(r)}}var u=k.get(t);u||k.set(t,u=S(A,t));var a=x.get(r);return a||(a=[],x.set(r,a)),a.push(e),u.observe(r),function(){!function(r,e){var n,t,o,u=x.get(r);if(u&&(t=e,-1!=(o=(n=u).indexOf(t))&&(n.splice(o,1),1)&&!u.length)){var a=O(r),i=k.get(a);null==i||i.unobserve(r),x.delete(r)}}(r,e)}}(n,(function(r){o(r.isIntersecting)}),e)}),[r,e]),t}(ur,or),ir=function(r){var e=r.fetchPage,n=r.getNextPageParam,t=function(r){var e=(0,T.useRef)(!1);(0,T.useEffect)((function(){return e.current=!0,function(){e.current=!1}}),[]);var n=j((0,T.useState)(r),2),t=n[0],o=n[1];return[t,(0,T.useCallback)((function(r){e.current&&o(r)}),[o])]}(B),o=j(t,2),u=o[0],a=o[1],i=(0,L.useValueRef)({fetchPage:e,getNextPageParam:n,state:u}),c=(0,R.useRef)(0),f=(0,R.useCallback)(d(regeneratorRuntime.mark((function r(){var e,n,t,o,u,f,s,v,d,b,p=arguments;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(e=p.length>0&&void 0!==p[0]&&p[0],n=i.current,t=n.fetchPage,o=n.getNextPageParam,u=n.state,e||!u.loading){r.next=4;break}return r.abrupt("return");case 4:return f=++c.current,a((function(r){return l(l({},r),{},{loading:!0})})),s=e?[]:u.pages,v=s.length?s[s.length-1]:void 0,r.prev=8,r.next=11,t({pageParam:v?o(v):void 0});case 11:if(d=r.sent,f===c.current){r.next=14;break}return r.abrupt("return");case 14:b=o(d),a({loading:!1,error:null,pages:[].concat(I(s),[d]),hasMore:null!=b}),r.next=23;break;case 18:if(r.prev=18,r.t0=r.catch(8),f===c.current){r.next=22;break}return r.abrupt("return");case 22:a((function(e){return l(l({},e),{},{loading:!1,error:r.t0})}));case 23:case"end":return r.stop()}}),r,null,[[8,18]])}))),[i,a]),s=(0,R.useCallback)((function(){return f(!0)}),[f]);return l(l({},u),{},{loadMore:f,reset:s})}({fetchPage:(n=d(regeneratorRuntime.mark((function r(e){var n,t,o;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(n=e.pageParam,t=void 0===n?F:n,tr){r.next=3;break}return r.abrupt("return",null);case 3:return r.next=5,a(t);case 5:return o=r.sent,r.abrupt("return",o);case 7:case"end":return r.stop()}}),r)}))),function(r){return n.apply(this,arguments)}),getNextPageParam:function(r){return function(r,e){return z(r,e)}(r,g)}}),cr=ir.error,fr=ir.hasMore,lr=ir.loadMore,sr=ir.loading,vr=ir.pages,dr=ir.reset;(0,p.useEffect)((function(){dr()}),[F,tr,g,dr]);var br=tr&&"auto"===v&&ar&&!sr&&fr;(0,p.useEffect)((function(){br&&lr()}),[br,lr]);var pr=(0,p.useMemo)((function(){var r=vr.flatMap((function(r){return function(r,e){if(!r)return[];var n=z(r,e);return n?(Array.isArray(n)||(n=[n]),n):[]}(r,c)}));return $>0&&r.length>$&&(r=r.slice(0,$)),r.map((function(r,e){var n=X(r);return n&&"object"===s(n)&&"string"==typeof n.__html&&(n=b.createElement("span",{dangerouslySetInnerHTML:n})),V(n,{"key":e,"role":"listitem"})}))}),[vr,c,$,X]),mr=sr,yr=0!==pr.length,gr="manual"===v&&fr&&!sr;(0,p.useImperativeHandle)(e,(function(){return{refresh:dr}}),[dr]);var hr=E;return b.createElement(y.ContainWrapper,l(l({"aria-live":"polite"},nr),{},{onClick:function(r){r.target.closest("[load-more-button], [load-more-retry]")&&lr()}}),b.createElement(p.Fragment,{"test-id":"contents"},yr&&V(er(pr),{"role":"list"}),mr&&H(hr),gr&&w(hr),cr&&o(hr,cr),"auto"===v&&b.createElement("span",{ref:ur})))}var K=(0,m.forwardRef)(H);function V(r,e){return(0,p.isValidElement)(r)?(0,p.cloneElement)(r,l(l({},e),r.props)):r}
/*! https://mths.be/cssescape v1.5.1 by @mathias | MIT license */K.displayName="List";
//# sourceMappingURL=component-preact.js.map

@@ -428,3 +428,3 @@ var __create = Object.create;

// extensions/amp-list/1.0/component.js
var _excluded = ["src", "fetchJson", "itemsKey", "maxItems", "loadMore", "loadMoreBookmark", "viewportBuffer", "template", "wrapperTemplate", "loadMoreTemplate", "loadingTemplate", "errorTemplate"];
var _excluded = ["errorTemplate", "fetchJson", "itemsKey", "loadMore", "loadMoreBookmark", "loadMoreTemplate", "loadingTemplate", "maxItems", "src", "template", "viewportBuffer", "wrapperTemplate"];
function _extends2() {

@@ -536,3 +536,3 @@ _extends2 = Object.assign || function(target) {

function BentoListWithRef(_ref, ref) {
var _ref$src = _ref.src, src = _ref$src === void 0 ? null : _ref$src, _ref$fetchJson = _ref.fetchJson, fetchJson2 = _ref$fetchJson === void 0 ? xhrUtils.fetchJson : _ref$fetchJson, _ref$itemsKey = _ref.itemsKey, itemsKey = _ref$itemsKey === void 0 ? "items" : _ref$itemsKey, _ref$maxItems = _ref.maxItems, maxItems = _ref$maxItems === void 0 ? 0 : _ref$maxItems, _ref$loadMore = _ref.loadMore, loadMoreMode = _ref$loadMore === void 0 ? "none" : _ref$loadMore, _ref$loadMoreBookmark = _ref.loadMoreBookmark, loadMoreBookmark = _ref$loadMoreBookmark === void 0 ? "load-more-src" : _ref$loadMoreBookmark, _ref$viewportBuffer = _ref.viewportBuffer, viewportBuffer = _ref$viewportBuffer === void 0 ? 2 : _ref$viewportBuffer, _ref$template = _ref.template, itemTemplate = _ref$template === void 0 ? defaultItemTemplate : _ref$template, _ref$wrapperTemplate = _ref.wrapperTemplate, wrapperTemplate = _ref$wrapperTemplate === void 0 ? defaultWrapperTemplate : _ref$wrapperTemplate, _ref$loadMoreTemplate = _ref.loadMoreTemplate, loadMoreTemplate = _ref$loadMoreTemplate === void 0 ? defaultLoadMoreTemplate : _ref$loadMoreTemplate, _ref$loadingTemplate = _ref.loadingTemplate, loadingTemplate = _ref$loadingTemplate === void 0 ? defaultLoadingTemplate : _ref$loadingTemplate, _ref$errorTemplate = _ref.errorTemplate, errorTemplate = _ref$errorTemplate === void 0 ? defaultErrorTemplate : _ref$errorTemplate, rest = _objectWithoutPropertiesLoose(_ref, _excluded);
var _ref$errorTemplate = _ref.errorTemplate, errorTemplate = _ref$errorTemplate === void 0 ? defaultErrorTemplate : _ref$errorTemplate, _ref$fetchJson = _ref.fetchJson, fetchJson2 = _ref$fetchJson === void 0 ? xhrUtils.fetchJson : _ref$fetchJson, _ref$itemsKey = _ref.itemsKey, itemsKey = _ref$itemsKey === void 0 ? "items" : _ref$itemsKey, _ref$loadMore = _ref.loadMore, loadMoreMode = _ref$loadMore === void 0 ? "none" : _ref$loadMore, _ref$loadMoreBookmark = _ref.loadMoreBookmark, loadMoreBookmark = _ref$loadMoreBookmark === void 0 ? "load-more-src" : _ref$loadMoreBookmark, _ref$loadMoreTemplate = _ref.loadMoreTemplate, loadMoreTemplate = _ref$loadMoreTemplate === void 0 ? defaultLoadMoreTemplate : _ref$loadMoreTemplate, _ref$loadingTemplate = _ref.loadingTemplate, loadingTemplate = _ref$loadingTemplate === void 0 ? defaultLoadingTemplate : _ref$loadingTemplate, _ref$maxItems = _ref.maxItems, maxItems = _ref$maxItems === void 0 ? 0 : _ref$maxItems, _ref$src = _ref.src, src = _ref$src === void 0 ? null : _ref$src, _ref$template = _ref.template, itemTemplate = _ref$template === void 0 ? defaultItemTemplate : _ref$template, _ref$viewportBuffer = _ref.viewportBuffer, viewportBuffer = _ref$viewportBuffer === void 0 ? 2 : _ref$viewportBuffer, _ref$wrapperTemplate = _ref.wrapperTemplate, wrapperTemplate = _ref$wrapperTemplate === void 0 ? defaultWrapperTemplate : _ref$wrapperTemplate, rest = _objectWithoutPropertiesLoose(_ref, _excluded);
var _useAmpContext = (0, import_context.useAmpContext)(), renderable = _useAmpContext.renderable;

@@ -539,0 +539,0 @@ var ioOptions = (0, import_preact.useMemo)(function() {

@@ -302,3 +302,3 @@ var __async = (__this, __arguments, generator) => {

// extensions/amp-list/1.0/component.js
var _excluded = ["src", "fetchJson", "itemsKey", "maxItems", "loadMore", "loadMoreBookmark", "viewportBuffer", "template", "wrapperTemplate", "loadMoreTemplate", "loadingTemplate", "errorTemplate"];
var _excluded = ["errorTemplate", "fetchJson", "itemsKey", "loadMore", "loadMoreBookmark", "loadMoreTemplate", "loadingTemplate", "maxItems", "src", "template", "viewportBuffer", "wrapperTemplate"];
function _extends2() {

@@ -372,14 +372,14 @@ _extends2 = Object.assign || function(target) {

let {
src = null,
errorTemplate = defaultErrorTemplate,
fetchJson = xhrUtils.fetchJson,
itemsKey = "items",
maxItems = 0,
loadMore: loadMoreMode = "none",
loadMoreBookmark = "load-more-src",
viewportBuffer = 2,
template: itemTemplate = defaultItemTemplate,
wrapperTemplate = defaultWrapperTemplate,
loadMoreTemplate = defaultLoadMoreTemplate,
loadingTemplate = defaultLoadingTemplate,
errorTemplate = defaultErrorTemplate
maxItems = 0,
src = null,
template: itemTemplate = defaultItemTemplate,
viewportBuffer = 2,
wrapperTemplate = defaultWrapperTemplate
} = _ref, rest = _objectWithoutPropertiesLoose(_ref, _excluded);

@@ -386,0 +386,0 @@ const {

;
var e=(e,t,r)=>new Promise(((o,n)=>{var a=e=>{try{l(r.next(e))}catch(e){n(e)}},c=e=>{try{l(r.throw(e))}catch(e){n(e)}},l=e=>e.done?o(e.value):Promise.resolve(e.value).then(a,c);l((r=r.apply(e,t)).next())}));function t(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function r(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,o)}return r}function o(e){for(var o=1;o<arguments.length;o++){var n=null!=arguments[o]?arguments[o]:{};o%2?r(Object(n),!0).forEach((function(r){t(e,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}import{createElement as n}from"@bentoproject/core/preact";import{Fragment as a,cloneElement as c,isValidElement as l,useEffect as i,useImperativeHandle as u,useMemo as s,useRef as f}from"@bentoproject/core/preact";import{forwardRef as p}from"@bentoproject/core/preact";import{ContainWrapper as m}from"@bentoproject/core/preact";var{hasOwnProperty:d,toString:b}=Object.prototype;function g(e){return(e.ownerDocument||e).defaultView}function h(e,t,r={}){const{needsRootBounds:o,rootMargin:n,threshold:a}=r,c=function(e){return e.parent&&e.parent!=e}(t)&&(o||n)?t.document:void 0;return new t.IntersectionObserver(e,{threshold:a,root:c,rootMargin:n})}var j=new WeakMap,v=new WeakMap;function M(e){const t=new Set;for(let r=e.length-1;r>=0;r--){const o=e[r],{target:n}=o;if(t.has(n))continue;t.add(n);const a=v.get(n);if(a)for(let e=0;e<a.length;e++)(0,a[e])(o)}}import{useCallback as y,useEffect as P,useRef as O,useState as w}from"@bentoproject/core/preact";import{useAmpContext as k}from"@bentoproject/core/preact";import{useCallback as T,useRef as x}from"@bentoproject/core/preact";import{useValueRef as S}from"@bentoproject/core/preact";import{useCallback as B,useEffect as R,useRef as I,useState as L}from"@bentoproject/core/preact";var N={loading:!1,error:null,pages:[],hasMore:!0},C={fetchJson(e,t){return this.fetch(e,t).then((e=>e.json()))},fetch(t,r){return e(this,null,(function*(){const e=yield self.fetch(t,r);if(!e.ok)throw new Error(e.statusText);return e}))}},E={loadMoreSpinner:"load-more-spinner-cc33818",loadMoreIcon:"load-more-icon-cc33818"},J=["src","fetchJson","itemsKey","maxItems","loadMore","loadMoreBookmark","viewportBuffer","template","wrapperTemplate","loadMoreTemplate","loadingTemplate","errorTemplate"],K=e=>n("div",null,String(e)),W=e=>n("div",null,e),A=(e,t)=>n("div",null,"Unable to Load More ",n("button",{"load-more-retry":!0},n("label",null,n("span",{class:e.loadMoreIcon})," Retry"))),H=()=>n("div",null,n("button",{"load-more-button":!0},n("label",null,"See More"))),U=e=>n("div",null,n("span",{"aria-label":"Loading",class:e.loadMoreSpinner}));function $(e,t){return t.split(".").reduce(((e,t)=>e&&""!==t?e[t]:e),e)}function q(t,r){let{src:c=null,fetchJson:l=C.fetchJson,itemsKey:p="items",maxItems:d=0,loadMore:b="none",loadMoreBookmark:y="load-more-src",viewportBuffer:O=2,template:q=K,wrapperTemplate:z=W,loadMoreTemplate:F=H,loadingTemplate:G=U,errorTemplate:Q=A}=t,V=function(e,t){if(null==e)return{};var r,o,n={},a=Object.keys(e);for(o=0;o<a.length;o++)r=a[o],t.indexOf(r)>=0||(n[r]=e[r]);return n}(t,J);const{renderable:X}=k(),Y=s((()=>({rootMargin:`0% 0% ${Math.floor(100*O)}% 0%`,threshold:0})),[O]),Z=f(null),_=function(e,t){const[r,o]=w(!1);return P((()=>{const r=e.current;if(r)return function(e,t,r){const o=g(e);if(r){const n=h((e=>{t(e[e.length-1])}),o,r);return n.observe(e),()=>{n.unobserve(e)}}let n=j.get(o);n||j.set(o,n=h(M,o));let a=v.get(e);return a||(a=[],v.set(e,a)),a.push(t),n.observe(e),()=>{!function(e,t){const r=v.get(e);if(!r)return;if(!function(e,t){const r=e.indexOf(t);return-1!=r&&(e.splice(r,1),!0)}(r,t))return;if(r.length)return;const o=g(e),n=j.get(o);null==n||n.unobserve(e),v.delete(e)}(e,t)}}(r,(e=>{o(e.isIntersecting)}),t)}),[e,t]),r}(Z,Y),{error:ee,hasMore:te,loadMore:re,loading:oe,pages:ne,reset:ae}=function({fetchPage:t,getNextPageParam:r}){const[n,a]=function(e){const t=I(!1);R((()=>(t.current=!0,()=>{t.current=!1})),[]);const[r,o]=L(e);return[r,B((e=>{t.current&&o(e)}),[o])]}(N),c=S({fetchPage:t,getNextPageParam:r,state:n}),l=x(0),i=T(((t=!1)=>e(this,null,(function*(){const{fetchPage:e,getNextPageParam:r,state:n}=c.current;if(!t&&n.loading)return;const i=++l.current;a((e=>o(o({},e),{},{loading:!0})));const u=t?[]:n.pages,s=u.length?u[u.length-1]:void 0;try{const t=yield e({pageParam:s?r(s):void 0});if(i!==l.current)return;const o=r(t);a({loading:!1,error:null,pages:[...u,t],hasMore:null!=o})}catch(e){if(i!==l.current)return;a((t=>o(o({},t),{},{loading:!1,error:e})))}}))),[c,a]),u=T((()=>i(!0)),[i]);return o(o({},n),{},{loadMore:i,reset:u})}({fetchPage:t=>e(this,[t],(function*({pageParam:e=c}){return X?yield l(e):null})),getNextPageParam:e=>function(e,t){return $(e,t)}(e,y)});i((()=>{ae()}),[c,X,y,ae]);const ce=X&&"auto"===b&&_&&!oe&&te;i((()=>{ce&&re()}),[ce,re]);const le=s((()=>{let e=ne.flatMap((e=>function(e,t){if(!e)return[];let r=$(e,t);return r?(Array.isArray(r)||(r=[r]),r):[]}(e,p)));return d>0&&e.length>d&&(e=e.slice(0,d)),e.map(((e,t)=>{let r=q(e);return r&&"object"==typeof r&&"string"==typeof r.__html&&(r=n("span",{dangerouslySetInnerHTML:r})),D(r,{"key":t,"role":"listitem"})}))}),[ne,p,d,q]),ie=oe,ue=0!==le.length,se="manual"===b&&te&&!oe;u(r,(()=>({refresh:ae})),[ae]);const fe=E;return n(m,o(o({"aria-live":"polite"},V),{},{onClick:e=>{e.target.closest("[load-more-button], [load-more-retry]")&&re()}}),n(a,{"test-id":"contents"},ue&&D(z(le),{"role":"list"}),ie&&G(fe),se&&F(fe),ee&&Q(fe,ee),"auto"===b&&n("span",{ref:Z})))}var z=p(q);function D(e,t){return l(e)?c(e,o(o({},t),e.props)):e}z.displayName="List";export{z as BentoList,q as BentoListWithRef};
var e=(e,t,r)=>new Promise(((o,n)=>{var a=e=>{try{l(r.next(e))}catch(e){n(e)}},c=e=>{try{l(r.throw(e))}catch(e){n(e)}},l=e=>e.done?o(e.value):Promise.resolve(e.value).then(a,c);l((r=r.apply(e,t)).next())}));function t(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function r(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,o)}return r}function o(e){for(var o=1;o<arguments.length;o++){var n=null!=arguments[o]?arguments[o]:{};o%2?r(Object(n),!0).forEach((function(r){t(e,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}import{createElement as n}from"@bentoproject/core/preact";import{Fragment as a,cloneElement as c,isValidElement as l,useEffect as i,useImperativeHandle as u,useMemo as s,useRef as f}from"@bentoproject/core/preact";import{forwardRef as p}from"@bentoproject/core/preact";import{ContainWrapper as m}from"@bentoproject/core/preact";var{hasOwnProperty:d,toString:b}=Object.prototype;function g(e){return(e.ownerDocument||e).defaultView}function h(e,t,r={}){const{needsRootBounds:o,rootMargin:n,threshold:a}=r,c=function(e){return e.parent&&e.parent!=e}(t)&&(o||n)?t.document:void 0;return new t.IntersectionObserver(e,{threshold:a,root:c,rootMargin:n})}var j=new WeakMap,v=new WeakMap;function M(e){const t=new Set;for(let r=e.length-1;r>=0;r--){const o=e[r],{target:n}=o;if(t.has(n))continue;t.add(n);const a=v.get(n);if(a)for(let e=0;e<a.length;e++)(0,a[e])(o)}}import{useCallback as y,useEffect as P,useRef as O,useState as w}from"@bentoproject/core/preact";import{useAmpContext as k}from"@bentoproject/core/preact";import{useCallback as T,useRef as x}from"@bentoproject/core/preact";import{useValueRef as S}from"@bentoproject/core/preact";import{useCallback as B,useEffect as R,useRef as I,useState as L}from"@bentoproject/core/preact";var N={loading:!1,error:null,pages:[],hasMore:!0},C={fetchJson(e,t){return this.fetch(e,t).then((e=>e.json()))},fetch(t,r){return e(this,null,(function*(){const e=yield self.fetch(t,r);if(!e.ok)throw new Error(e.statusText);return e}))}},E={loadMoreSpinner:"load-more-spinner-cc33818",loadMoreIcon:"load-more-icon-cc33818"},J=["errorTemplate","fetchJson","itemsKey","loadMore","loadMoreBookmark","loadMoreTemplate","loadingTemplate","maxItems","src","template","viewportBuffer","wrapperTemplate"],K=e=>n("div",null,String(e)),W=e=>n("div",null,e),A=(e,t)=>n("div",null,"Unable to Load More ",n("button",{"load-more-retry":!0},n("label",null,n("span",{class:e.loadMoreIcon})," Retry"))),H=()=>n("div",null,n("button",{"load-more-button":!0},n("label",null,"See More"))),U=e=>n("div",null,n("span",{"aria-label":"Loading",class:e.loadMoreSpinner}));function $(e,t){return t.split(".").reduce(((e,t)=>e&&""!==t?e[t]:e),e)}function q(t,r){let{errorTemplate:c=A,fetchJson:l=C.fetchJson,itemsKey:p="items",loadMore:d="none",loadMoreBookmark:b="load-more-src",loadMoreTemplate:y=H,loadingTemplate:O=U,maxItems:q=0,src:z=null,template:F=K,viewportBuffer:G=2,wrapperTemplate:Q=W}=t,V=function(e,t){if(null==e)return{};var r,o,n={},a=Object.keys(e);for(o=0;o<a.length;o++)r=a[o],t.indexOf(r)>=0||(n[r]=e[r]);return n}(t,J);const{renderable:X}=k(),Y=s((()=>({rootMargin:`0% 0% ${Math.floor(100*G)}% 0%`,threshold:0})),[G]),Z=f(null),_=function(e,t){const[r,o]=w(!1);return P((()=>{const r=e.current;if(r)return function(e,t,r){const o=g(e);if(r){const n=h((e=>{t(e[e.length-1])}),o,r);return n.observe(e),()=>{n.unobserve(e)}}let n=j.get(o);n||j.set(o,n=h(M,o));let a=v.get(e);return a||(a=[],v.set(e,a)),a.push(t),n.observe(e),()=>{!function(e,t){const r=v.get(e);if(!r)return;if(!function(e,t){const r=e.indexOf(t);return-1!=r&&(e.splice(r,1),!0)}(r,t))return;if(r.length)return;const o=g(e),n=j.get(o);null==n||n.unobserve(e),v.delete(e)}(e,t)}}(r,(e=>{o(e.isIntersecting)}),t)}),[e,t]),r}(Z,Y),{error:ee,hasMore:te,loadMore:re,loading:oe,pages:ne,reset:ae}=function({fetchPage:t,getNextPageParam:r}){const[n,a]=function(e){const t=I(!1);R((()=>(t.current=!0,()=>{t.current=!1})),[]);const[r,o]=L(e);return[r,B((e=>{t.current&&o(e)}),[o])]}(N),c=S({fetchPage:t,getNextPageParam:r,state:n}),l=x(0),i=T(((t=!1)=>e(this,null,(function*(){const{fetchPage:e,getNextPageParam:r,state:n}=c.current;if(!t&&n.loading)return;const i=++l.current;a((e=>o(o({},e),{},{loading:!0})));const u=t?[]:n.pages,s=u.length?u[u.length-1]:void 0;try{const t=yield e({pageParam:s?r(s):void 0});if(i!==l.current)return;const o=r(t);a({loading:!1,error:null,pages:[...u,t],hasMore:null!=o})}catch(e){if(i!==l.current)return;a((t=>o(o({},t),{},{loading:!1,error:e})))}}))),[c,a]),u=T((()=>i(!0)),[i]);return o(o({},n),{},{loadMore:i,reset:u})}({fetchPage:t=>e(this,[t],(function*({pageParam:e=z}){return X?yield l(e):null})),getNextPageParam:e=>function(e,t){return $(e,t)}(e,b)});i((()=>{ae()}),[z,X,b,ae]);const ce=X&&"auto"===d&&_&&!oe&&te;i((()=>{ce&&re()}),[ce,re]);const le=s((()=>{let e=ne.flatMap((e=>function(e,t){if(!e)return[];let r=$(e,t);return r?(Array.isArray(r)||(r=[r]),r):[]}(e,p)));return q>0&&e.length>q&&(e=e.slice(0,q)),e.map(((e,t)=>{let r=F(e);return r&&"object"==typeof r&&"string"==typeof r.__html&&(r=n("span",{dangerouslySetInnerHTML:r})),D(r,{"key":t,"role":"listitem"})}))}),[ne,p,q,F]),ie=oe,ue=0!==le.length,se="manual"===d&&te&&!oe;u(r,(()=>({refresh:ae})),[ae]);const fe=E;return n(m,o(o({"aria-live":"polite"},V),{},{onClick:e=>{e.target.closest("[load-more-button], [load-more-retry]")&&re()}}),n(a,{"test-id":"contents"},ue&&D(Q(le),{"role":"list"}),ie&&O(fe),se&&y(fe),ee&&c(fe,ee),"auto"===d&&n("span",{ref:Z})))}var z=p(q);function D(e,t){return l(e)?c(e,o(o({},t),e.props)):e}z.displayName="List";export{z as BentoList,q as BentoListWithRef};
/*! https://mths.be/cssescape v1.5.1 by @mathias | MIT license */
//# sourceMappingURL=component-preact.module.js.map
;
var r=Object.create,e=Object.defineProperty,n=Object.getOwnPropertyDescriptor,t=Object.getOwnPropertyNames,o=Object.getPrototypeOf,u=Object.prototype.hasOwnProperty,a=function(r){return e(r,"__esModule",{value:!0})},i=function(i){return function(r,o,a){if(o&&"object"==typeof o||"function"==typeof o)for(var i,c=t(o),f=0,l=c.length;f<l;f++)i=c[f],u.call(r,i)||"default"===i||e(r,i,{get:function(r){return o[r]}.bind(null,i),enumerable:!(a=n(o,i))||a.enumerable});return r}(a(e(null!=i?r(o(i)):{},"default",i&&i.__esModule&&"default"in i?{get:function(){return i.default},enumerable:!0}:{value:i,enumerable:!0})),i)};function c(r,e,n){return e in r?Object.defineProperty(r,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):r[e]=n,r}function f(r,e){var n=Object.keys(r);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(r);e&&(t=t.filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.push.apply(n,t)}return n}function l(r){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?f(Object(n),!0).forEach((function(e){c(r,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(n)):f(Object(n)).forEach((function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(n,e))}))}return r}function s(r){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(r){return typeof r}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r})(r)}function v(r,e,n,t,o,u,a){try{var i=r[u](a),c=i.value}catch(r){return void n(r)}i.done?e(c):Promise.resolve(c).then(t,o)}function d(r){return function(){var e=this,n=arguments;return new Promise((function(t,o){var u=r.apply(e,n);function a(r){v(u,t,o,a,i,"next",r)}function i(r){v(u,t,o,a,i,"throw",r)}a(void 0)}))}}!function(r,n){for(var t in a(r),n)e(r,t,{get:n[t],enumerable:!0})}(exports,{BentoList:function(){return K},BentoListWithRef:function(){return H}});var b=i(require("@bentoproject/core/react")),m=i(require("@bentoproject/core/react")),p=i(require("@bentoproject/core/react")),y=i(require("@bentoproject/core/react"));function g(r,e){(null==e||e>r.length)&&(e=r.length);for(var n=0,t=new Array(e);n<e;n++)t[n]=r[n];return t}function h(r,e){if(r){if("string"==typeof r)return g(r,e);var n=Object.prototype.toString.call(r).slice(8,-1);return"Object"===n&&r.constructor&&(n=r.constructor.name),"Map"===n||"Set"===n?Array.from(r):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?g(r,e):void 0}}function j(r,e){return function(r){if(Array.isArray(r))return r}(r)||function(r,e){var n=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=n){var t,o,u=[],a=!0,i=!1;try{for(n=n.call(r);!(a=(t=n.next()).done)&&(u.push(t.value),!e||u.length!==e);a=!0);}catch(r){i=!0,o=r}finally{try{a||null==n.return||n.return()}finally{if(i)throw o}}return u}}(r,e)||h(r,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}Array.isArray;var w=Object.prototype;function O(r){return(r.ownerDocument||r).defaultView}function M(r){return r.parent&&r.parent!=r}function S(r,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},t=n.needsRootBounds,o=n.rootMargin,u=n.threshold,a=M(e)&&(t||o)?e.document:void 0;return new e.IntersectionObserver(r,{threshold:u,root:a,rootMargin:o})}w.hasOwnProperty,w.toString;var k=new WeakMap,x=new WeakMap;function A(r){for(var e=new Set,n=r.length-1;n>=0;n--){var t=r[n],o=t.target;if(!e.has(o)){e.add(o);var u=x.get(o);if(u)for(var a=0;a<u.length;a++)(0,u[a])(t)}}}var q=i(require("@bentoproject/core/react")),P=i(require("@bentoproject/core/react"));function I(r){return function(r){if(Array.isArray(r))return g(r)}(r)||function(r){if("undefined"!=typeof Symbol&&null!=r[Symbol.iterator]||null!=r["@@iterator"])return Array.from(r)}(r)||h(r)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var R=i(require("@bentoproject/core/react")),L=i(require("@bentoproject/core/react")),T=i(require("@bentoproject/core/react")),B={loading:!1,error:null,pages:[],hasMore:!0},C={fetchJson:function(r,e){return this.fetch(r,e).then((function(r){return r.json()}))},fetch:function(r,e){return d(regeneratorRuntime.mark((function n(){var t;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,self.fetch(r,e);case 2:if((t=n.sent).ok){n.next=5;break}throw new Error(t.statusText);case 5:return n.abrupt("return",t);case 6:case"end":return n.stop()}}),n)})))()}},N={loadMoreSpinner:"load-more-spinner-cc33818",loadMoreIcon:"load-more-icon-cc33818"},E=("url('data:image/svg+xml;charset=utf-8,".concat('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 40 40"><defs><linearGradient id="grad"><stop stop-color="rgb(51,51,51)" stop-opacity=".75"></stop><stop offset="100%" stop-color="rgb(51,51,51)" stop-opacity="0"></stop></linearGradient></defs><path d="M11,4.4 A18,18, 0,1,0, 38,20" fill="none" stroke="url(%23grad)" stroke-width="1.725"></path></svg>',"')"),"url('data:image/svg+xml;charset=utf-8,".concat('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="currentColor" d="M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z"></path></svg>',"')"),["src","fetchJson","itemsKey","maxItems","loadMore","loadMoreBookmark","viewportBuffer","template","wrapperTemplate","loadMoreTemplate","loadingTemplate","errorTemplate"]),W=function(r){return b.createElement("div",null,String(r))},G=function(r){return b.createElement("div",null,r)},J=function(r,e){return b.createElement("div",null,"Unable to Load More ",b.createElement("button",{"load-more-retry":!0},b.createElement("label",null,b.createElement("span",{className:r.loadMoreIcon})," Retry")))},U=function(){return b.createElement("div",null,b.createElement("button",{"load-more-button":!0},b.createElement("label",null,"See More")))},_=function(r){return b.createElement("div",null,b.createElement("span",{"aria-label":"Loading",className:r.loadMoreSpinner}))};function z(r,e){return e.split(".").reduce((function(r,e){return r&&""!==e?r[e]:r}),r)}function H(r,e){var n,t=r.src,o=void 0===t?null:t,u=r.fetchJson,a=void 0===u?C.fetchJson:u,i=r.itemsKey,c=void 0===i?"items":i,f=r.maxItems,v=void 0===f?0:f,p=r.loadMore,g=void 0===p?"none":p,h=r.loadMoreBookmark,w=void 0===h?"load-more-src":h,M=r.viewportBuffer,H=void 0===M?2:M,K=r.template,$=void 0===K?W:K,D=r.wrapperTemplate,F=void 0===D?G:D,Q=r.loadMoreTemplate,X=void 0===Q?U:Q,Y=r.loadingTemplate,Z=void 0===Y?_:Y,rr=r.errorTemplate,er=void 0===rr?J:rr,nr=function(r,e){if(null==r)return{};var n,t,o={},u=Object.keys(r);for(t=0;t<u.length;t++)n=u[t],e.indexOf(n)>=0||(o[n]=r[n]);return o}(r,E),tr=(0,P.useAmpContext)().renderable,or=(0,m.useMemo)((function(){var r=Math.floor(100*H);return{rootMargin:"0% 0% ".concat(r,"% 0%"),threshold:0}}),[H]),ur=(0,m.useRef)(null),ar=function(r,e){var n=j((0,q.useState)(!1),2),t=n[0],o=n[1];return(0,q.useEffect)((function(){var n=r.current;if(n)return function(r,e,n){var t=O(r);if(n){var o=S((function(r){e(r[r.length-1])}),t,n);return o.observe(r),function(){o.unobserve(r)}}var u=k.get(t);u||k.set(t,u=S(A,t));var a=x.get(r);return a||(a=[],x.set(r,a)),a.push(e),u.observe(r),function(){!function(r,e){var n,t,o,u=x.get(r);if(u&&(t=e,-1!=(o=(n=u).indexOf(t))&&(n.splice(o,1),1)&&!u.length)){var a=O(r),i=k.get(a);null==i||i.unobserve(r),x.delete(r)}}(r,e)}}(n,(function(r){o(r.isIntersecting)}),e)}),[r,e]),t}(ur,or),ir=function(r){var e=r.fetchPage,n=r.getNextPageParam,t=function(r){var e=(0,T.useRef)(!1);(0,T.useEffect)((function(){return e.current=!0,function(){e.current=!1}}),[]);var n=j((0,T.useState)(r),2),t=n[0],o=n[1];return[t,(0,T.useCallback)((function(r){e.current&&o(r)}),[o])]}(B),o=j(t,2),u=o[0],a=o[1],i=(0,L.useValueRef)({fetchPage:e,getNextPageParam:n,state:u}),c=(0,R.useRef)(0),f=(0,R.useCallback)(d(regeneratorRuntime.mark((function r(){var e,n,t,o,u,f,s,v,d,b,m=arguments;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(e=m.length>0&&void 0!==m[0]&&m[0],n=i.current,t=n.fetchPage,o=n.getNextPageParam,u=n.state,e||!u.loading){r.next=4;break}return r.abrupt("return");case 4:return f=++c.current,a((function(r){return l(l({},r),{},{loading:!0})})),s=e?[]:u.pages,v=s.length?s[s.length-1]:void 0,r.prev=8,r.next=11,t({pageParam:v?o(v):void 0});case 11:if(d=r.sent,f===c.current){r.next=14;break}return r.abrupt("return");case 14:b=o(d),a({loading:!1,error:null,pages:[].concat(I(s),[d]),hasMore:null!=b}),r.next=23;break;case 18:if(r.prev=18,r.t0=r.catch(8),f===c.current){r.next=22;break}return r.abrupt("return");case 22:a((function(e){return l(l({},e),{},{loading:!1,error:r.t0})}));case 23:case"end":return r.stop()}}),r,null,[[8,18]])}))),[i,a]),s=(0,R.useCallback)((function(){return f(!0)}),[f]);return l(l({},u),{},{loadMore:f,reset:s})}({fetchPage:(n=d(regeneratorRuntime.mark((function r(e){var n,t,u;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(n=e.pageParam,t=void 0===n?o:n,tr){r.next=3;break}return r.abrupt("return",null);case 3:return r.next=5,a(t);case 5:return u=r.sent,r.abrupt("return",u);case 7:case"end":return r.stop()}}),r)}))),function(r){return n.apply(this,arguments)}),getNextPageParam:function(r){return function(r,e){return z(r,e)}(r,w)}}),cr=ir.error,fr=ir.hasMore,lr=ir.loadMore,sr=ir.loading,vr=ir.pages,dr=ir.reset;(0,m.useEffect)((function(){dr()}),[o,tr,w,dr]);var br=tr&&"auto"===g&&ar&&!sr&&fr;(0,m.useEffect)((function(){br&&lr()}),[br,lr]);var mr=(0,m.useMemo)((function(){var r=vr.flatMap((function(r){return function(r,e){if(!r)return[];var n=z(r,e);return n?(Array.isArray(n)||(n=[n]),n):[]}(r,c)}));return v>0&&r.length>v&&(r=r.slice(0,v)),r.map((function(r,e){var n=$(r);return n&&"object"===s(n)&&"string"==typeof n.__html&&(n=b.createElement("span",{dangerouslySetInnerHTML:n})),V(n,{"key":e,"role":"listitem"})}))}),[vr,c,v,$]),pr=sr,yr=0!==mr.length,gr="manual"===g&&fr&&!sr;(0,m.useImperativeHandle)(e,(function(){return{refresh:dr}}),[dr]);var hr=N;return b.createElement(y.ContainWrapper,l(l({"aria-live":"polite"},nr),{},{onClick:function(r){r.target.closest("[load-more-button], [load-more-retry]")&&lr()}}),b.createElement(m.Fragment,{"test-id":"contents"},yr&&V(F(mr),{"role":"list"}),pr&&Z(hr),gr&&X(hr),cr&&er(hr,cr),"auto"===g&&b.createElement("span",{ref:ur})))}var K=(0,p.forwardRef)(H);function V(r,e){return(0,m.isValidElement)(r)?(0,m.cloneElement)(r,l(l({},e),r.props)):r}
var r=Object.create,e=Object.defineProperty,n=Object.getOwnPropertyDescriptor,t=Object.getOwnPropertyNames,o=Object.getPrototypeOf,u=Object.prototype.hasOwnProperty,a=function(r){return e(r,"__esModule",{value:!0})},i=function(i){return function(r,o,a){if(o&&"object"==typeof o||"function"==typeof o)for(var i,c=t(o),f=0,l=c.length;f<l;f++)i=c[f],u.call(r,i)||"default"===i||e(r,i,{get:function(r){return o[r]}.bind(null,i),enumerable:!(a=n(o,i))||a.enumerable});return r}(a(e(null!=i?r(o(i)):{},"default",i&&i.__esModule&&"default"in i?{get:function(){return i.default},enumerable:!0}:{value:i,enumerable:!0})),i)};function c(r,e,n){return e in r?Object.defineProperty(r,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):r[e]=n,r}function f(r,e){var n=Object.keys(r);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(r);e&&(t=t.filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.push.apply(n,t)}return n}function l(r){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?f(Object(n),!0).forEach((function(e){c(r,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(n)):f(Object(n)).forEach((function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(n,e))}))}return r}function s(r){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(r){return typeof r}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r})(r)}function v(r,e,n,t,o,u,a){try{var i=r[u](a),c=i.value}catch(r){return void n(r)}i.done?e(c):Promise.resolve(c).then(t,o)}function d(r){return function(){var e=this,n=arguments;return new Promise((function(t,o){var u=r.apply(e,n);function a(r){v(u,t,o,a,i,"next",r)}function i(r){v(u,t,o,a,i,"throw",r)}a(void 0)}))}}!function(r,n){for(var t in a(r),n)e(r,t,{get:n[t],enumerable:!0})}(exports,{BentoList:function(){return K},BentoListWithRef:function(){return H}});var b=i(require("@bentoproject/core/react")),m=i(require("@bentoproject/core/react")),p=i(require("@bentoproject/core/react")),y=i(require("@bentoproject/core/react"));function g(r,e){(null==e||e>r.length)&&(e=r.length);for(var n=0,t=new Array(e);n<e;n++)t[n]=r[n];return t}function h(r,e){if(r){if("string"==typeof r)return g(r,e);var n=Object.prototype.toString.call(r).slice(8,-1);return"Object"===n&&r.constructor&&(n=r.constructor.name),"Map"===n||"Set"===n?Array.from(r):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?g(r,e):void 0}}function j(r,e){return function(r){if(Array.isArray(r))return r}(r)||function(r,e){var n=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=n){var t,o,u=[],a=!0,i=!1;try{for(n=n.call(r);!(a=(t=n.next()).done)&&(u.push(t.value),!e||u.length!==e);a=!0);}catch(r){i=!0,o=r}finally{try{a||null==n.return||n.return()}finally{if(i)throw o}}return u}}(r,e)||h(r,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}Array.isArray;var w=Object.prototype;function O(r){return(r.ownerDocument||r).defaultView}function M(r){return r.parent&&r.parent!=r}function S(r,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},t=n.needsRootBounds,o=n.rootMargin,u=n.threshold,a=M(e)&&(t||o)?e.document:void 0;return new e.IntersectionObserver(r,{threshold:u,root:a,rootMargin:o})}w.hasOwnProperty,w.toString;var k=new WeakMap,x=new WeakMap;function A(r){for(var e=new Set,n=r.length-1;n>=0;n--){var t=r[n],o=t.target;if(!e.has(o)){e.add(o);var u=x.get(o);if(u)for(var a=0;a<u.length;a++)(0,u[a])(t)}}}var q=i(require("@bentoproject/core/react")),P=i(require("@bentoproject/core/react"));function I(r){return function(r){if(Array.isArray(r))return g(r)}(r)||function(r){if("undefined"!=typeof Symbol&&null!=r[Symbol.iterator]||null!=r["@@iterator"])return Array.from(r)}(r)||h(r)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var R=i(require("@bentoproject/core/react")),L=i(require("@bentoproject/core/react")),T=i(require("@bentoproject/core/react")),B={loading:!1,error:null,pages:[],hasMore:!0},C={fetchJson:function(r,e){return this.fetch(r,e).then((function(r){return r.json()}))},fetch:function(r,e){return d(regeneratorRuntime.mark((function n(){var t;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,self.fetch(r,e);case 2:if((t=n.sent).ok){n.next=5;break}throw new Error(t.statusText);case 5:return n.abrupt("return",t);case 6:case"end":return n.stop()}}),n)})))()}},N={loadMoreSpinner:"load-more-spinner-cc33818",loadMoreIcon:"load-more-icon-cc33818"},E=("url('data:image/svg+xml;charset=utf-8,".concat('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 40 40"><defs><linearGradient id="grad"><stop stop-color="rgb(51,51,51)" stop-opacity=".75"></stop><stop offset="100%" stop-color="rgb(51,51,51)" stop-opacity="0"></stop></linearGradient></defs><path d="M11,4.4 A18,18, 0,1,0, 38,20" fill="none" stroke="url(%23grad)" stroke-width="1.725"></path></svg>',"')"),"url('data:image/svg+xml;charset=utf-8,".concat('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="currentColor" d="M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z"></path></svg>',"')"),["errorTemplate","fetchJson","itemsKey","loadMore","loadMoreBookmark","loadMoreTemplate","loadingTemplate","maxItems","src","template","viewportBuffer","wrapperTemplate"]),W=function(r){return b.createElement("div",null,String(r))},G=function(r){return b.createElement("div",null,r)},J=function(r,e){return b.createElement("div",null,"Unable to Load More ",b.createElement("button",{"load-more-retry":!0},b.createElement("label",null,b.createElement("span",{className:r.loadMoreIcon})," Retry")))},U=function(){return b.createElement("div",null,b.createElement("button",{"load-more-button":!0},b.createElement("label",null,"See More")))},_=function(r){return b.createElement("div",null,b.createElement("span",{"aria-label":"Loading",className:r.loadMoreSpinner}))};function z(r,e){return e.split(".").reduce((function(r,e){return r&&""!==e?r[e]:r}),r)}function H(r,e){var n,t=r.errorTemplate,o=void 0===t?J:t,u=r.fetchJson,a=void 0===u?C.fetchJson:u,i=r.itemsKey,c=void 0===i?"items":i,f=r.loadMore,v=void 0===f?"none":f,p=r.loadMoreBookmark,g=void 0===p?"load-more-src":p,h=r.loadMoreTemplate,w=void 0===h?U:h,M=r.loadingTemplate,H=void 0===M?_:M,K=r.maxItems,$=void 0===K?0:K,D=r.src,F=void 0===D?null:D,Q=r.template,X=void 0===Q?W:Q,Y=r.viewportBuffer,Z=void 0===Y?2:Y,rr=r.wrapperTemplate,er=void 0===rr?G:rr,nr=function(r,e){if(null==r)return{};var n,t,o={},u=Object.keys(r);for(t=0;t<u.length;t++)n=u[t],e.indexOf(n)>=0||(o[n]=r[n]);return o}(r,E),tr=(0,P.useAmpContext)().renderable,or=(0,m.useMemo)((function(){var r=Math.floor(100*Z);return{rootMargin:"0% 0% ".concat(r,"% 0%"),threshold:0}}),[Z]),ur=(0,m.useRef)(null),ar=function(r,e){var n=j((0,q.useState)(!1),2),t=n[0],o=n[1];return(0,q.useEffect)((function(){var n=r.current;if(n)return function(r,e,n){var t=O(r);if(n){var o=S((function(r){e(r[r.length-1])}),t,n);return o.observe(r),function(){o.unobserve(r)}}var u=k.get(t);u||k.set(t,u=S(A,t));var a=x.get(r);return a||(a=[],x.set(r,a)),a.push(e),u.observe(r),function(){!function(r,e){var n,t,o,u=x.get(r);if(u&&(t=e,-1!=(o=(n=u).indexOf(t))&&(n.splice(o,1),1)&&!u.length)){var a=O(r),i=k.get(a);null==i||i.unobserve(r),x.delete(r)}}(r,e)}}(n,(function(r){o(r.isIntersecting)}),e)}),[r,e]),t}(ur,or),ir=function(r){var e=r.fetchPage,n=r.getNextPageParam,t=function(r){var e=(0,T.useRef)(!1);(0,T.useEffect)((function(){return e.current=!0,function(){e.current=!1}}),[]);var n=j((0,T.useState)(r),2),t=n[0],o=n[1];return[t,(0,T.useCallback)((function(r){e.current&&o(r)}),[o])]}(B),o=j(t,2),u=o[0],a=o[1],i=(0,L.useValueRef)({fetchPage:e,getNextPageParam:n,state:u}),c=(0,R.useRef)(0),f=(0,R.useCallback)(d(regeneratorRuntime.mark((function r(){var e,n,t,o,u,f,s,v,d,b,m=arguments;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(e=m.length>0&&void 0!==m[0]&&m[0],n=i.current,t=n.fetchPage,o=n.getNextPageParam,u=n.state,e||!u.loading){r.next=4;break}return r.abrupt("return");case 4:return f=++c.current,a((function(r){return l(l({},r),{},{loading:!0})})),s=e?[]:u.pages,v=s.length?s[s.length-1]:void 0,r.prev=8,r.next=11,t({pageParam:v?o(v):void 0});case 11:if(d=r.sent,f===c.current){r.next=14;break}return r.abrupt("return");case 14:b=o(d),a({loading:!1,error:null,pages:[].concat(I(s),[d]),hasMore:null!=b}),r.next=23;break;case 18:if(r.prev=18,r.t0=r.catch(8),f===c.current){r.next=22;break}return r.abrupt("return");case 22:a((function(e){return l(l({},e),{},{loading:!1,error:r.t0})}));case 23:case"end":return r.stop()}}),r,null,[[8,18]])}))),[i,a]),s=(0,R.useCallback)((function(){return f(!0)}),[f]);return l(l({},u),{},{loadMore:f,reset:s})}({fetchPage:(n=d(regeneratorRuntime.mark((function r(e){var n,t,o;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(n=e.pageParam,t=void 0===n?F:n,tr){r.next=3;break}return r.abrupt("return",null);case 3:return r.next=5,a(t);case 5:return o=r.sent,r.abrupt("return",o);case 7:case"end":return r.stop()}}),r)}))),function(r){return n.apply(this,arguments)}),getNextPageParam:function(r){return function(r,e){return z(r,e)}(r,g)}}),cr=ir.error,fr=ir.hasMore,lr=ir.loadMore,sr=ir.loading,vr=ir.pages,dr=ir.reset;(0,m.useEffect)((function(){dr()}),[F,tr,g,dr]);var br=tr&&"auto"===v&&ar&&!sr&&fr;(0,m.useEffect)((function(){br&&lr()}),[br,lr]);var mr=(0,m.useMemo)((function(){var r=vr.flatMap((function(r){return function(r,e){if(!r)return[];var n=z(r,e);return n?(Array.isArray(n)||(n=[n]),n):[]}(r,c)}));return $>0&&r.length>$&&(r=r.slice(0,$)),r.map((function(r,e){var n=X(r);return n&&"object"===s(n)&&"string"==typeof n.__html&&(n=b.createElement("span",{dangerouslySetInnerHTML:n})),V(n,{"key":e,"role":"listitem"})}))}),[vr,c,$,X]),pr=sr,yr=0!==mr.length,gr="manual"===v&&fr&&!sr;(0,m.useImperativeHandle)(e,(function(){return{refresh:dr}}),[dr]);var hr=N;return b.createElement(y.ContainWrapper,l(l({"aria-live":"polite"},nr),{},{onClick:function(r){r.target.closest("[load-more-button], [load-more-retry]")&&lr()}}),b.createElement(m.Fragment,{"test-id":"contents"},yr&&V(er(mr),{"role":"list"}),pr&&H(hr),gr&&w(hr),cr&&o(hr,cr),"auto"===v&&b.createElement("span",{ref:ur})))}var K=(0,p.forwardRef)(H);function V(r,e){return(0,m.isValidElement)(r)?(0,m.cloneElement)(r,l(l({},e),r.props)):r}
/*! https://mths.be/cssescape v1.5.1 by @mathias | MIT license */K.displayName="List";
//# sourceMappingURL=component-react.js.map

@@ -428,3 +428,3 @@ var __create = Object.create;

// extensions/amp-list/1.0/component.js
var _excluded = ["src", "fetchJson", "itemsKey", "maxItems", "loadMore", "loadMoreBookmark", "viewportBuffer", "template", "wrapperTemplate", "loadMoreTemplate", "loadingTemplate", "errorTemplate"];
var _excluded = ["errorTemplate", "fetchJson", "itemsKey", "loadMore", "loadMoreBookmark", "loadMoreTemplate", "loadingTemplate", "maxItems", "src", "template", "viewportBuffer", "wrapperTemplate"];
function _extends2() {

@@ -536,3 +536,3 @@ _extends2 = Object.assign || function(target) {

function BentoListWithRef(_ref, ref) {
var _ref$src = _ref.src, src = _ref$src === void 0 ? null : _ref$src, _ref$fetchJson = _ref.fetchJson, fetchJson2 = _ref$fetchJson === void 0 ? xhrUtils.fetchJson : _ref$fetchJson, _ref$itemsKey = _ref.itemsKey, itemsKey = _ref$itemsKey === void 0 ? "items" : _ref$itemsKey, _ref$maxItems = _ref.maxItems, maxItems = _ref$maxItems === void 0 ? 0 : _ref$maxItems, _ref$loadMore = _ref.loadMore, loadMoreMode = _ref$loadMore === void 0 ? "none" : _ref$loadMore, _ref$loadMoreBookmark = _ref.loadMoreBookmark, loadMoreBookmark = _ref$loadMoreBookmark === void 0 ? "load-more-src" : _ref$loadMoreBookmark, _ref$viewportBuffer = _ref.viewportBuffer, viewportBuffer = _ref$viewportBuffer === void 0 ? 2 : _ref$viewportBuffer, _ref$template = _ref.template, itemTemplate = _ref$template === void 0 ? defaultItemTemplate : _ref$template, _ref$wrapperTemplate = _ref.wrapperTemplate, wrapperTemplate = _ref$wrapperTemplate === void 0 ? defaultWrapperTemplate : _ref$wrapperTemplate, _ref$loadMoreTemplate = _ref.loadMoreTemplate, loadMoreTemplate = _ref$loadMoreTemplate === void 0 ? defaultLoadMoreTemplate : _ref$loadMoreTemplate, _ref$loadingTemplate = _ref.loadingTemplate, loadingTemplate = _ref$loadingTemplate === void 0 ? defaultLoadingTemplate : _ref$loadingTemplate, _ref$errorTemplate = _ref.errorTemplate, errorTemplate = _ref$errorTemplate === void 0 ? defaultErrorTemplate : _ref$errorTemplate, rest = _objectWithoutPropertiesLoose(_ref, _excluded);
var _ref$errorTemplate = _ref.errorTemplate, errorTemplate = _ref$errorTemplate === void 0 ? defaultErrorTemplate : _ref$errorTemplate, _ref$fetchJson = _ref.fetchJson, fetchJson2 = _ref$fetchJson === void 0 ? xhrUtils.fetchJson : _ref$fetchJson, _ref$itemsKey = _ref.itemsKey, itemsKey = _ref$itemsKey === void 0 ? "items" : _ref$itemsKey, _ref$loadMore = _ref.loadMore, loadMoreMode = _ref$loadMore === void 0 ? "none" : _ref$loadMore, _ref$loadMoreBookmark = _ref.loadMoreBookmark, loadMoreBookmark = _ref$loadMoreBookmark === void 0 ? "load-more-src" : _ref$loadMoreBookmark, _ref$loadMoreTemplate = _ref.loadMoreTemplate, loadMoreTemplate = _ref$loadMoreTemplate === void 0 ? defaultLoadMoreTemplate : _ref$loadMoreTemplate, _ref$loadingTemplate = _ref.loadingTemplate, loadingTemplate = _ref$loadingTemplate === void 0 ? defaultLoadingTemplate : _ref$loadingTemplate, _ref$maxItems = _ref.maxItems, maxItems = _ref$maxItems === void 0 ? 0 : _ref$maxItems, _ref$src = _ref.src, src = _ref$src === void 0 ? null : _ref$src, _ref$template = _ref.template, itemTemplate = _ref$template === void 0 ? defaultItemTemplate : _ref$template, _ref$viewportBuffer = _ref.viewportBuffer, viewportBuffer = _ref$viewportBuffer === void 0 ? 2 : _ref$viewportBuffer, _ref$wrapperTemplate = _ref.wrapperTemplate, wrapperTemplate = _ref$wrapperTemplate === void 0 ? defaultWrapperTemplate : _ref$wrapperTemplate, rest = _objectWithoutPropertiesLoose(_ref, _excluded);
var _useAmpContext = (0, import_context.useAmpContext)(), renderable = _useAmpContext.renderable;

@@ -539,0 +539,0 @@ var ioOptions = (0, import_preact.useMemo)(function() {

@@ -302,3 +302,3 @@ var __async = (__this, __arguments, generator) => {

// extensions/amp-list/1.0/component.js
var _excluded = ["src", "fetchJson", "itemsKey", "maxItems", "loadMore", "loadMoreBookmark", "viewportBuffer", "template", "wrapperTemplate", "loadMoreTemplate", "loadingTemplate", "errorTemplate"];
var _excluded = ["errorTemplate", "fetchJson", "itemsKey", "loadMore", "loadMoreBookmark", "loadMoreTemplate", "loadingTemplate", "maxItems", "src", "template", "viewportBuffer", "wrapperTemplate"];
function _extends2() {

@@ -372,14 +372,14 @@ _extends2 = Object.assign || function(target) {

let {
src = null,
errorTemplate = defaultErrorTemplate,
fetchJson = xhrUtils.fetchJson,
itemsKey = "items",
maxItems = 0,
loadMore: loadMoreMode = "none",
loadMoreBookmark = "load-more-src",
viewportBuffer = 2,
template: itemTemplate = defaultItemTemplate,
wrapperTemplate = defaultWrapperTemplate,
loadMoreTemplate = defaultLoadMoreTemplate,
loadingTemplate = defaultLoadingTemplate,
errorTemplate = defaultErrorTemplate
maxItems = 0,
src = null,
template: itemTemplate = defaultItemTemplate,
viewportBuffer = 2,
wrapperTemplate = defaultWrapperTemplate
} = _ref, rest = _objectWithoutPropertiesLoose(_ref, _excluded);

@@ -386,0 +386,0 @@ const {

;
var e=(e,t,r)=>new Promise(((o,n)=>{var a=e=>{try{l(r.next(e))}catch(e){n(e)}},c=e=>{try{l(r.throw(e))}catch(e){n(e)}},l=e=>e.done?o(e.value):Promise.resolve(e.value).then(a,c);l((r=r.apply(e,t)).next())}));function t(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function r(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,o)}return r}function o(e){for(var o=1;o<arguments.length;o++){var n=null!=arguments[o]?arguments[o]:{};o%2?r(Object(n),!0).forEach((function(r){t(e,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}import{createElement as n}from"@bentoproject/core/react";import{Fragment as a,cloneElement as c,isValidElement as l,useEffect as i,useImperativeHandle as u,useMemo as s,useRef as f}from"@bentoproject/core/react";import{forwardRef as m}from"@bentoproject/core/react";import{ContainWrapper as p}from"@bentoproject/core/react";var{hasOwnProperty:d,toString:b}=Object.prototype;function g(e){return(e.ownerDocument||e).defaultView}function h(e,t,r={}){const{needsRootBounds:o,rootMargin:n,threshold:a}=r,c=function(e){return e.parent&&e.parent!=e}(t)&&(o||n)?t.document:void 0;return new t.IntersectionObserver(e,{threshold:a,root:c,rootMargin:n})}var j=new WeakMap,v=new WeakMap;function M(e){const t=new Set;for(let r=e.length-1;r>=0;r--){const o=e[r],{target:n}=o;if(t.has(n))continue;t.add(n);const a=v.get(n);if(a)for(let e=0;e<a.length;e++)(0,a[e])(o)}}import{useCallback as y,useEffect as P,useRef as O,useState as w}from"@bentoproject/core/react";import{useAmpContext as k}from"@bentoproject/core/react";import{useCallback as T,useRef as x}from"@bentoproject/core/react";import{useValueRef as S}from"@bentoproject/core/react";import{useCallback as N,useEffect as B,useRef as R,useState as I}from"@bentoproject/core/react";var L={loading:!1,error:null,pages:[],hasMore:!0},C={fetchJson(e,t){return this.fetch(e,t).then((e=>e.json()))},fetch(t,r){return e(this,null,(function*(){const e=yield self.fetch(t,r);if(!e.ok)throw new Error(e.statusText);return e}))}},E={loadMoreSpinner:"load-more-spinner-cc33818",loadMoreIcon:"load-more-icon-cc33818"},J=["src","fetchJson","itemsKey","maxItems","loadMore","loadMoreBookmark","viewportBuffer","template","wrapperTemplate","loadMoreTemplate","loadingTemplate","errorTemplate"],K=e=>n("div",null,String(e)),W=e=>n("div",null,e),A=(e,t)=>n("div",null,"Unable to Load More ",n("button",{"load-more-retry":!0},n("label",null,n("span",{className:e.loadMoreIcon})," Retry"))),H=()=>n("div",null,n("button",{"load-more-button":!0},n("label",null,"See More"))),U=e=>n("div",null,n("span",{"aria-label":"Loading",className:e.loadMoreSpinner}));function $(e,t){return t.split(".").reduce(((e,t)=>e&&""!==t?e[t]:e),e)}function q(t,r){let{src:c=null,fetchJson:l=C.fetchJson,itemsKey:m="items",maxItems:d=0,loadMore:b="none",loadMoreBookmark:y="load-more-src",viewportBuffer:O=2,template:q=K,wrapperTemplate:z=W,loadMoreTemplate:F=H,loadingTemplate:G=U,errorTemplate:Q=A}=t,V=function(e,t){if(null==e)return{};var r,o,n={},a=Object.keys(e);for(o=0;o<a.length;o++)r=a[o],t.indexOf(r)>=0||(n[r]=e[r]);return n}(t,J);const{renderable:X}=k(),Y=s((()=>({rootMargin:`0% 0% ${Math.floor(100*O)}% 0%`,threshold:0})),[O]),Z=f(null),_=function(e,t){const[r,o]=w(!1);return P((()=>{const r=e.current;if(r)return function(e,t,r){const o=g(e);if(r){const n=h((e=>{t(e[e.length-1])}),o,r);return n.observe(e),()=>{n.unobserve(e)}}let n=j.get(o);n||j.set(o,n=h(M,o));let a=v.get(e);return a||(a=[],v.set(e,a)),a.push(t),n.observe(e),()=>{!function(e,t){const r=v.get(e);if(!r)return;if(!function(e,t){const r=e.indexOf(t);return-1!=r&&(e.splice(r,1),!0)}(r,t))return;if(r.length)return;const o=g(e),n=j.get(o);null==n||n.unobserve(e),v.delete(e)}(e,t)}}(r,(e=>{o(e.isIntersecting)}),t)}),[e,t]),r}(Z,Y),{error:ee,hasMore:te,loadMore:re,loading:oe,pages:ne,reset:ae}=function({fetchPage:t,getNextPageParam:r}){const[n,a]=function(e){const t=R(!1);B((()=>(t.current=!0,()=>{t.current=!1})),[]);const[r,o]=I(e);return[r,N((e=>{t.current&&o(e)}),[o])]}(L),c=S({fetchPage:t,getNextPageParam:r,state:n}),l=x(0),i=T(((t=!1)=>e(this,null,(function*(){const{fetchPage:e,getNextPageParam:r,state:n}=c.current;if(!t&&n.loading)return;const i=++l.current;a((e=>o(o({},e),{},{loading:!0})));const u=t?[]:n.pages,s=u.length?u[u.length-1]:void 0;try{const t=yield e({pageParam:s?r(s):void 0});if(i!==l.current)return;const o=r(t);a({loading:!1,error:null,pages:[...u,t],hasMore:null!=o})}catch(e){if(i!==l.current)return;a((t=>o(o({},t),{},{loading:!1,error:e})))}}))),[c,a]),u=T((()=>i(!0)),[i]);return o(o({},n),{},{loadMore:i,reset:u})}({fetchPage:t=>e(this,[t],(function*({pageParam:e=c}){return X?yield l(e):null})),getNextPageParam:e=>function(e,t){return $(e,t)}(e,y)});i((()=>{ae()}),[c,X,y,ae]);const ce=X&&"auto"===b&&_&&!oe&&te;i((()=>{ce&&re()}),[ce,re]);const le=s((()=>{let e=ne.flatMap((e=>function(e,t){if(!e)return[];let r=$(e,t);return r?(Array.isArray(r)||(r=[r]),r):[]}(e,m)));return d>0&&e.length>d&&(e=e.slice(0,d)),e.map(((e,t)=>{let r=q(e);return r&&"object"==typeof r&&"string"==typeof r.__html&&(r=n("span",{dangerouslySetInnerHTML:r})),D(r,{"key":t,"role":"listitem"})}))}),[ne,m,d,q]),ie=oe,ue=0!==le.length,se="manual"===b&&te&&!oe;u(r,(()=>({refresh:ae})),[ae]);const fe=E;return n(p,o(o({"aria-live":"polite"},V),{},{onClick:e=>{e.target.closest("[load-more-button], [load-more-retry]")&&re()}}),n(a,{"test-id":"contents"},ue&&D(z(le),{"role":"list"}),ie&&G(fe),se&&F(fe),ee&&Q(fe,ee),"auto"===b&&n("span",{ref:Z})))}var z=m(q);function D(e,t){return l(e)?c(e,o(o({},t),e.props)):e}z.displayName="List";export{z as BentoList,q as BentoListWithRef};
var e=(e,t,r)=>new Promise(((o,n)=>{var a=e=>{try{l(r.next(e))}catch(e){n(e)}},c=e=>{try{l(r.throw(e))}catch(e){n(e)}},l=e=>e.done?o(e.value):Promise.resolve(e.value).then(a,c);l((r=r.apply(e,t)).next())}));function t(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function r(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,o)}return r}function o(e){for(var o=1;o<arguments.length;o++){var n=null!=arguments[o]?arguments[o]:{};o%2?r(Object(n),!0).forEach((function(r){t(e,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}import{createElement as n}from"@bentoproject/core/react";import{Fragment as a,cloneElement as c,isValidElement as l,useEffect as i,useImperativeHandle as u,useMemo as s,useRef as f}from"@bentoproject/core/react";import{forwardRef as m}from"@bentoproject/core/react";import{ContainWrapper as p}from"@bentoproject/core/react";var{hasOwnProperty:d,toString:b}=Object.prototype;function g(e){return(e.ownerDocument||e).defaultView}function h(e,t,r={}){const{needsRootBounds:o,rootMargin:n,threshold:a}=r,c=function(e){return e.parent&&e.parent!=e}(t)&&(o||n)?t.document:void 0;return new t.IntersectionObserver(e,{threshold:a,root:c,rootMargin:n})}var j=new WeakMap,v=new WeakMap;function M(e){const t=new Set;for(let r=e.length-1;r>=0;r--){const o=e[r],{target:n}=o;if(t.has(n))continue;t.add(n);const a=v.get(n);if(a)for(let e=0;e<a.length;e++)(0,a[e])(o)}}import{useCallback as y,useEffect as P,useRef as O,useState as w}from"@bentoproject/core/react";import{useAmpContext as k}from"@bentoproject/core/react";import{useCallback as T,useRef as x}from"@bentoproject/core/react";import{useValueRef as S}from"@bentoproject/core/react";import{useCallback as N,useEffect as B,useRef as R,useState as I}from"@bentoproject/core/react";var L={loading:!1,error:null,pages:[],hasMore:!0},C={fetchJson(e,t){return this.fetch(e,t).then((e=>e.json()))},fetch(t,r){return e(this,null,(function*(){const e=yield self.fetch(t,r);if(!e.ok)throw new Error(e.statusText);return e}))}},E={loadMoreSpinner:"load-more-spinner-cc33818",loadMoreIcon:"load-more-icon-cc33818"},J=["errorTemplate","fetchJson","itemsKey","loadMore","loadMoreBookmark","loadMoreTemplate","loadingTemplate","maxItems","src","template","viewportBuffer","wrapperTemplate"],K=e=>n("div",null,String(e)),W=e=>n("div",null,e),A=(e,t)=>n("div",null,"Unable to Load More ",n("button",{"load-more-retry":!0},n("label",null,n("span",{className:e.loadMoreIcon})," Retry"))),H=()=>n("div",null,n("button",{"load-more-button":!0},n("label",null,"See More"))),U=e=>n("div",null,n("span",{"aria-label":"Loading",className:e.loadMoreSpinner}));function $(e,t){return t.split(".").reduce(((e,t)=>e&&""!==t?e[t]:e),e)}function q(t,r){let{errorTemplate:c=A,fetchJson:l=C.fetchJson,itemsKey:m="items",loadMore:d="none",loadMoreBookmark:b="load-more-src",loadMoreTemplate:y=H,loadingTemplate:O=U,maxItems:q=0,src:z=null,template:F=K,viewportBuffer:G=2,wrapperTemplate:Q=W}=t,V=function(e,t){if(null==e)return{};var r,o,n={},a=Object.keys(e);for(o=0;o<a.length;o++)r=a[o],t.indexOf(r)>=0||(n[r]=e[r]);return n}(t,J);const{renderable:X}=k(),Y=s((()=>({rootMargin:`0% 0% ${Math.floor(100*G)}% 0%`,threshold:0})),[G]),Z=f(null),_=function(e,t){const[r,o]=w(!1);return P((()=>{const r=e.current;if(r)return function(e,t,r){const o=g(e);if(r){const n=h((e=>{t(e[e.length-1])}),o,r);return n.observe(e),()=>{n.unobserve(e)}}let n=j.get(o);n||j.set(o,n=h(M,o));let a=v.get(e);return a||(a=[],v.set(e,a)),a.push(t),n.observe(e),()=>{!function(e,t){const r=v.get(e);if(!r)return;if(!function(e,t){const r=e.indexOf(t);return-1!=r&&(e.splice(r,1),!0)}(r,t))return;if(r.length)return;const o=g(e),n=j.get(o);null==n||n.unobserve(e),v.delete(e)}(e,t)}}(r,(e=>{o(e.isIntersecting)}),t)}),[e,t]),r}(Z,Y),{error:ee,hasMore:te,loadMore:re,loading:oe,pages:ne,reset:ae}=function({fetchPage:t,getNextPageParam:r}){const[n,a]=function(e){const t=R(!1);B((()=>(t.current=!0,()=>{t.current=!1})),[]);const[r,o]=I(e);return[r,N((e=>{t.current&&o(e)}),[o])]}(L),c=S({fetchPage:t,getNextPageParam:r,state:n}),l=x(0),i=T(((t=!1)=>e(this,null,(function*(){const{fetchPage:e,getNextPageParam:r,state:n}=c.current;if(!t&&n.loading)return;const i=++l.current;a((e=>o(o({},e),{},{loading:!0})));const u=t?[]:n.pages,s=u.length?u[u.length-1]:void 0;try{const t=yield e({pageParam:s?r(s):void 0});if(i!==l.current)return;const o=r(t);a({loading:!1,error:null,pages:[...u,t],hasMore:null!=o})}catch(e){if(i!==l.current)return;a((t=>o(o({},t),{},{loading:!1,error:e})))}}))),[c,a]),u=T((()=>i(!0)),[i]);return o(o({},n),{},{loadMore:i,reset:u})}({fetchPage:t=>e(this,[t],(function*({pageParam:e=z}){return X?yield l(e):null})),getNextPageParam:e=>function(e,t){return $(e,t)}(e,b)});i((()=>{ae()}),[z,X,b,ae]);const ce=X&&"auto"===d&&_&&!oe&&te;i((()=>{ce&&re()}),[ce,re]);const le=s((()=>{let e=ne.flatMap((e=>function(e,t){if(!e)return[];let r=$(e,t);return r?(Array.isArray(r)||(r=[r]),r):[]}(e,m)));return q>0&&e.length>q&&(e=e.slice(0,q)),e.map(((e,t)=>{let r=F(e);return r&&"object"==typeof r&&"string"==typeof r.__html&&(r=n("span",{dangerouslySetInnerHTML:r})),D(r,{"key":t,"role":"listitem"})}))}),[ne,m,q,F]),ie=oe,ue=0!==le.length,se="manual"===d&&te&&!oe;u(r,(()=>({refresh:ae})),[ae]);const fe=E;return n(p,o(o({"aria-live":"polite"},V),{},{onClick:e=>{e.target.closest("[load-more-button], [load-more-retry]")&&re()}}),n(a,{"test-id":"contents"},ue&&D(Q(le),{"role":"list"}),ie&&O(fe),se&&y(fe),ee&&c(fe,ee),"auto"===d&&n("span",{ref:Z})))}var z=m(q);function D(e,t){return l(e)?c(e,o(o({},t),e.props)):e}z.displayName="List";export{z as BentoList,q as BentoListWithRef};
/*! https://mths.be/cssescape v1.5.1 by @mathias | MIT license */
//# sourceMappingURL=component-react.module.js.map
;
var r=Object.create,e=Object.defineProperty,n=Object.getOwnPropertyDescriptor,t=Object.getOwnPropertyNames,o=Object.getPrototypeOf,u=Object.prototype.hasOwnProperty,i=function(r){return e(r,"__esModule",{value:!0})},a=function(a){return function(r,o,i){if(o&&"object"==typeof o||"function"==typeof o)for(var a,c=t(o),f=0,l=c.length;f<l;f++)a=c[f],u.call(r,a)||"default"===a||e(r,a,{get:function(r){return o[r]}.bind(null,a),enumerable:!(i=n(o,a))||i.enumerable});return r}(i(e(null!=a?r(o(a)):{},"default",a&&a.__esModule&&"default"in a?{get:function(){return a.default},enumerable:!0}:{value:a,enumerable:!0})),a)};function c(r,e){return(c=Object.setPrototypeOf||function(r,e){return r.__proto__=e,r})(r,e)}function f(r){return(f=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)})(r)}function l(r){return(l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(r){return typeof r}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r})(r)}function s(r,e){if(e&&("object"===l(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(r){if(void 0===r)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}(r)}!function(r,n){for(var t in i(r),n)e(r,t,{get:n[t],enumerable:!0})}(exports,{defineElement:function(){return Y}});var v=a(require("@bentoproject/core"));function b(r,e,n){return e in r?Object.defineProperty(r,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):r[e]=n,r}function d(r,e){var n=Object.keys(r);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(r);e&&(t=t.filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.push.apply(n,t)}return n}function p(r){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?d(Object(n),!0).forEach((function(e){b(r,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(n)):d(Object(n)).forEach((function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(n,e))}))}return r}function m(r,e,n,t,o,u,i){try{var a=r[u](i),c=a.value}catch(r){return void n(r)}a.done?e(c):Promise.resolve(c).then(t,o)}function y(r){return function(){var e=this,n=arguments;return new Promise((function(t,o){var u=r.apply(e,n);function i(r){m(u,t,o,i,a,"next",r)}function a(r){m(u,t,o,i,a,"throw",r)}i(void 0)}))}}var h=a(require("@bentoproject/core")),g=a(require("@bentoproject/core")),j=a(require("@bentoproject/core")),w=a(require("@bentoproject/core"));function O(r,e){(null==e||e>r.length)&&(e=r.length);for(var n=0,t=new Array(e);n<e;n++)t[n]=r[n];return t}function M(r,e){if(r){if("string"==typeof r)return O(r,e);var n=Object.prototype.toString.call(r).slice(8,-1);return"Object"===n&&r.constructor&&(n=r.constructor.name),"Map"===n||"Set"===n?Array.from(r):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?O(r,e):void 0}}function k(r,e){return function(r){if(Array.isArray(r))return r}(r)||function(r,e){var n=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=n){var t,o,u=[],i=!0,a=!1;try{for(n=n.call(r);!(i=(t=n.next()).done)&&(u.push(t.value),!e||u.length!==e);i=!0);}catch(r){a=!0,o=r}finally{try{i||null==n.return||n.return()}finally{if(a)throw o}}return u}}(r,e)||M(r,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}Array.isArray;var S=Object.prototype;function x(r){return(r.ownerDocument||r).defaultView}function R(r){return r.parent&&r.parent!=r}function q(r,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},t=n.needsRootBounds,o=n.rootMargin,u=n.threshold,i=R(e)&&(t||o)?e.document:void 0;return new e.IntersectionObserver(r,{threshold:u,root:i,rootMargin:o})}S.hasOwnProperty,S.toString;var A=new WeakMap,P=new WeakMap;function I(r){for(var e=new Set,n=r.length-1;n>=0;n--){var t=r[n],o=t.target;if(!e.has(o)){e.add(o);var u=P.get(o);if(u)for(var i=0;i<u.length;i++)(0,u[i])(t)}}}var T=a(require("@bentoproject/core")),B=a(require("@bentoproject/core"));function E(r){return function(r){if(Array.isArray(r))return O(r)}(r)||function(r){if("undefined"!=typeof Symbol&&null!=r[Symbol.iterator]||null!=r["@@iterator"])return Array.from(r)}(r)||M(r)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var L=a(require("@bentoproject/core")),C=a(require("@bentoproject/core")),G=a(require("@bentoproject/core")),J={loading:!1,error:null,pages:[],hasMore:!0},K={fetchJson:function(r,e){return this.fetch(r,e).then((function(r){return r.json()}))},fetch:function(r,e){return y(regeneratorRuntime.mark((function n(){var t;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,self.fetch(r,e);case 2:if((t=n.sent).ok){n.next=5;break}throw new Error(t.statusText);case 5:return n.abrupt("return",t);case 6:case"end":return n.stop()}}),n)})))()}},N={loadMoreSpinner:"load-more-spinner-cc33818",loadMoreIcon:"load-more-icon-cc33818"},U=("url('data:image/svg+xml;charset=utf-8,".concat('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 40 40"><defs><linearGradient id="grad"><stop stop-color="rgb(51,51,51)" stop-opacity=".75"></stop><stop offset="100%" stop-color="rgb(51,51,51)" stop-opacity="0"></stop></linearGradient></defs><path d="M11,4.4 A18,18, 0,1,0, 38,20" fill="none" stroke="url(%23grad)" stroke-width="1.725"></path></svg>',"')"),"url('data:image/svg+xml;charset=utf-8,".concat('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="currentColor" d="M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z"></path></svg>',"')"),["src","fetchJson","itemsKey","maxItems","loadMore","loadMoreBookmark","viewportBuffer","template","wrapperTemplate","loadMoreTemplate","loadingTemplate","errorTemplate"]),W=function(r){return h.createElement("div",null,String(r))},_=function(r){return h.createElement("div",null,r)},z=function(r,e){return h.createElement("div",null,"Unable to Load More ",h.createElement("button",{"load-more-retry":!0},h.createElement("label",null,h.createElement("span",{class:r.loadMoreIcon})," Retry")))},D=function(){return h.createElement("div",null,h.createElement("button",{"load-more-button":!0},h.createElement("label",null,"See More")))},H=function(r){return h.createElement("div",null,h.createElement("span",{"aria-label":"Loading",class:r.loadMoreSpinner}))};function V(r,e){return e.split(".").reduce((function(r,e){return r&&""!==e?r[e]:r}),r)}var $=(0,j.forwardRef)((function(r,e){var n,t=r.src,o=void 0===t?null:t,u=r.fetchJson,i=void 0===u?K.fetchJson:u,a=r.itemsKey,c=void 0===a?"items":a,f=r.maxItems,s=void 0===f?0:f,v=r.loadMore,b=void 0===v?"none":v,d=r.loadMoreBookmark,m=void 0===d?"load-more-src":d,j=r.viewportBuffer,O=void 0===j?2:j,M=r.template,S=void 0===M?W:M,R=r.wrapperTemplate,$=void 0===R?_:R,Q=r.loadMoreTemplate,X=void 0===Q?D:Q,Y=r.loadingTemplate,Z=void 0===Y?H:Y,rr=r.errorTemplate,er=void 0===rr?z:rr,nr=function(r,e){if(null==r)return{};var n,t,o={},u=Object.keys(r);for(t=0;t<u.length;t++)n=u[t],e.indexOf(n)>=0||(o[n]=r[n]);return o}(r,U),tr=(0,B.useAmpContext)().renderable,or=(0,g.useMemo)((function(){var r=Math.floor(100*O);return{rootMargin:"0% 0% ".concat(r,"% 0%"),threshold:0}}),[O]),ur=(0,g.useRef)(null),ir=function(r,e){var n=k((0,T.useState)(!1),2),t=n[0],o=n[1];return(0,T.useEffect)((function(){var n=r.current;if(n)return function(r,e,n){var t=x(r);if(n){var o=q((function(r){e(r[r.length-1])}),t,n);return o.observe(r),function(){o.unobserve(r)}}var u=A.get(t);u||A.set(t,u=q(I,t));var i=P.get(r);return i||(i=[],P.set(r,i)),i.push(e),u.observe(r),function(){!function(r,e){var n,t,o,u=P.get(r);if(u&&(t=e,-1!=(o=(n=u).indexOf(t))&&(n.splice(o,1),1)&&!u.length)){var i=x(r),a=A.get(i);null==a||a.unobserve(r),P.delete(r)}}(r,e)}}(n,(function(r){o(r.isIntersecting)}),e)}),[r,e]),t}(ur,or),ar=function(r){var e=r.fetchPage,n=r.getNextPageParam,t=function(r){var e=(0,G.useRef)(!1);(0,G.useEffect)((function(){return e.current=!0,function(){e.current=!1}}),[]);var n=k((0,G.useState)(r),2),t=n[0],o=n[1];return[t,(0,G.useCallback)((function(r){e.current&&o(r)}),[o])]}(J),o=k(t,2),u=o[0],i=o[1],a=(0,C.useValueRef)({fetchPage:e,getNextPageParam:n,state:u}),c=(0,L.useRef)(0),f=(0,L.useCallback)(y(regeneratorRuntime.mark((function r(){var e,n,t,o,u,f,l,s,v,b,d=arguments;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(e=d.length>0&&void 0!==d[0]&&d[0],n=a.current,t=n.fetchPage,o=n.getNextPageParam,u=n.state,e||!u.loading){r.next=4;break}return r.abrupt("return");case 4:return f=++c.current,i((function(r){return p(p({},r),{},{loading:!0})})),l=e?[]:u.pages,s=l.length?l[l.length-1]:void 0,r.prev=8,r.next=11,t({pageParam:s?o(s):void 0});case 11:if(v=r.sent,f===c.current){r.next=14;break}return r.abrupt("return");case 14:b=o(v),i({loading:!1,error:null,pages:[].concat(E(l),[v]),hasMore:null!=b}),r.next=23;break;case 18:if(r.prev=18,r.t0=r.catch(8),f===c.current){r.next=22;break}return r.abrupt("return");case 22:i((function(e){return p(p({},e),{},{loading:!1,error:r.t0})}));case 23:case"end":return r.stop()}}),r,null,[[8,18]])}))),[a,i]),l=(0,L.useCallback)((function(){return f(!0)}),[f]);return p(p({},u),{},{loadMore:f,reset:l})}({fetchPage:(n=y(regeneratorRuntime.mark((function r(e){var n,t,u;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(n=e.pageParam,t=void 0===n?o:n,tr){r.next=3;break}return r.abrupt("return",null);case 3:return r.next=5,i(t);case 5:return u=r.sent,r.abrupt("return",u);case 7:case"end":return r.stop()}}),r)}))),function(r){return n.apply(this,arguments)}),getNextPageParam:function(r){return function(r,e){return V(r,e)}(r,m)}}),cr=ar.error,fr=ar.hasMore,lr=ar.loadMore,sr=ar.loading,vr=ar.pages,br=ar.reset;(0,g.useEffect)((function(){br()}),[o,tr,m,br]);var dr=tr&&"auto"===b&&ir&&!sr&&fr;(0,g.useEffect)((function(){dr&&lr()}),[dr,lr]);var pr=(0,g.useMemo)((function(){var r=vr.flatMap((function(r){return function(r,e){if(!r)return[];var n=V(r,e);return n?(Array.isArray(n)||(n=[n]),n):[]}(r,c)}));return s>0&&r.length>s&&(r=r.slice(0,s)),r.map((function(r,e){var n=S(r);return n&&"object"===l(n)&&"string"==typeof n.__html&&(n=h.createElement("span",{dangerouslySetInnerHTML:n})),F(n,{"key":e,"role":"listitem"})}))}),[vr,c,s,S]),mr=sr,yr=0!==pr.length,hr="manual"===b&&fr&&!sr;(0,g.useImperativeHandle)(e,(function(){return{refresh:br}}),[br]);var gr=N;return h.createElement(w.ContainWrapper,p(p({"aria-live":"polite"},nr),{},{onClick:function(r){r.target.closest("[load-more-button], [load-more-retry]")&&lr()}}),h.createElement(g.Fragment,{"test-id":"contents"},yr&&F($(pr),{"role":"list"}),mr&&Z(gr),hr&&X(gr),cr&&er(gr,cr),"auto"===b&&h.createElement("span",{ref:ur})))}));function F(r,e){return(0,g.isValidElement)(r)?(0,g.cloneElement)(r,p(p({},e),r.props)):r}$.displayName="List";var Q=function(r){!function(r,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),e&&c(r,e)}(o,v.PreactBaseElement);var e,n,t=(e=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(r){return!1}}(),function(){var r,t=f(e);if(n){var o=f(this).constructor;r=Reflect.construct(t,arguments,o)}else r=t.apply(this,arguments);return s(this,r)});function o(){return t.apply(this,arguments)}return o}();Q.Component=$,Q.props={"src":{attr:"src"},"itemsKey":{attr:"items"},"maxItems":{attr:"max-items",type:"number"},"loadMore":{attr:"load-more"},"loadMoreBookmark":{attr:"load-more-bookmark"},"viewportBuffer":{attr:"viewport-buffer",type:"number"}},Q.layoutSizeDefined=!0,Q.usesShadowDom=!0,Q.usesTemplate=!0;var X=a(require("@bentoproject/core"));function Y(r){(0,X.defineBentoElement)("bento-list",Q,r)}
var r=Object.create,e=Object.defineProperty,n=Object.getOwnPropertyDescriptor,t=Object.getOwnPropertyNames,o=Object.getPrototypeOf,u=Object.prototype.hasOwnProperty,i=function(r){return e(r,"__esModule",{value:!0})},a=function(a){return function(r,o,i){if(o&&"object"==typeof o||"function"==typeof o)for(var a,c=t(o),f=0,l=c.length;f<l;f++)a=c[f],u.call(r,a)||"default"===a||e(r,a,{get:function(r){return o[r]}.bind(null,a),enumerable:!(i=n(o,a))||i.enumerable});return r}(i(e(null!=a?r(o(a)):{},"default",a&&a.__esModule&&"default"in a?{get:function(){return a.default},enumerable:!0}:{value:a,enumerable:!0})),a)};function c(r,e){return(c=Object.setPrototypeOf||function(r,e){return r.__proto__=e,r})(r,e)}function f(r){return(f=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)})(r)}function l(r){return(l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(r){return typeof r}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r})(r)}function s(r,e){if(e&&("object"===l(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(r){if(void 0===r)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}(r)}!function(r,n){for(var t in i(r),n)e(r,t,{get:n[t],enumerable:!0})}(exports,{defineElement:function(){return Y}});var v=a(require("@bentoproject/core"));function b(r,e,n){return e in r?Object.defineProperty(r,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):r[e]=n,r}function d(r,e){var n=Object.keys(r);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(r);e&&(t=t.filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.push.apply(n,t)}return n}function p(r){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?d(Object(n),!0).forEach((function(e){b(r,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(n)):d(Object(n)).forEach((function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(n,e))}))}return r}function m(r,e,n,t,o,u,i){try{var a=r[u](i),c=a.value}catch(r){return void n(r)}a.done?e(c):Promise.resolve(c).then(t,o)}function y(r){return function(){var e=this,n=arguments;return new Promise((function(t,o){var u=r.apply(e,n);function i(r){m(u,t,o,i,a,"next",r)}function a(r){m(u,t,o,i,a,"throw",r)}i(void 0)}))}}var h=a(require("@bentoproject/core")),g=a(require("@bentoproject/core")),j=a(require("@bentoproject/core")),w=a(require("@bentoproject/core"));function O(r,e){(null==e||e>r.length)&&(e=r.length);for(var n=0,t=new Array(e);n<e;n++)t[n]=r[n];return t}function M(r,e){if(r){if("string"==typeof r)return O(r,e);var n=Object.prototype.toString.call(r).slice(8,-1);return"Object"===n&&r.constructor&&(n=r.constructor.name),"Map"===n||"Set"===n?Array.from(r):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?O(r,e):void 0}}function k(r,e){return function(r){if(Array.isArray(r))return r}(r)||function(r,e){var n=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=n){var t,o,u=[],i=!0,a=!1;try{for(n=n.call(r);!(i=(t=n.next()).done)&&(u.push(t.value),!e||u.length!==e);i=!0);}catch(r){a=!0,o=r}finally{try{i||null==n.return||n.return()}finally{if(a)throw o}}return u}}(r,e)||M(r,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}Array.isArray;var S=Object.prototype;function x(r){return(r.ownerDocument||r).defaultView}function R(r){return r.parent&&r.parent!=r}function q(r,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},t=n.needsRootBounds,o=n.rootMargin,u=n.threshold,i=R(e)&&(t||o)?e.document:void 0;return new e.IntersectionObserver(r,{threshold:u,root:i,rootMargin:o})}S.hasOwnProperty,S.toString;var A=new WeakMap,P=new WeakMap;function I(r){for(var e=new Set,n=r.length-1;n>=0;n--){var t=r[n],o=t.target;if(!e.has(o)){e.add(o);var u=P.get(o);if(u)for(var i=0;i<u.length;i++)(0,u[i])(t)}}}var T=a(require("@bentoproject/core")),B=a(require("@bentoproject/core"));function E(r){return function(r){if(Array.isArray(r))return O(r)}(r)||function(r){if("undefined"!=typeof Symbol&&null!=r[Symbol.iterator]||null!=r["@@iterator"])return Array.from(r)}(r)||M(r)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var L=a(require("@bentoproject/core")),C=a(require("@bentoproject/core")),G=a(require("@bentoproject/core")),J={loading:!1,error:null,pages:[],hasMore:!0},K={fetchJson:function(r,e){return this.fetch(r,e).then((function(r){return r.json()}))},fetch:function(r,e){return y(regeneratorRuntime.mark((function n(){var t;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,self.fetch(r,e);case 2:if((t=n.sent).ok){n.next=5;break}throw new Error(t.statusText);case 5:return n.abrupt("return",t);case 6:case"end":return n.stop()}}),n)})))()}},N={loadMoreSpinner:"load-more-spinner-cc33818",loadMoreIcon:"load-more-icon-cc33818"},U=("url('data:image/svg+xml;charset=utf-8,".concat('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 40 40"><defs><linearGradient id="grad"><stop stop-color="rgb(51,51,51)" stop-opacity=".75"></stop><stop offset="100%" stop-color="rgb(51,51,51)" stop-opacity="0"></stop></linearGradient></defs><path d="M11,4.4 A18,18, 0,1,0, 38,20" fill="none" stroke="url(%23grad)" stroke-width="1.725"></path></svg>',"')"),"url('data:image/svg+xml;charset=utf-8,".concat('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="currentColor" d="M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z"></path></svg>',"')"),["errorTemplate","fetchJson","itemsKey","loadMore","loadMoreBookmark","loadMoreTemplate","loadingTemplate","maxItems","src","template","viewportBuffer","wrapperTemplate"]),W=function(r){return h.createElement("div",null,String(r))},_=function(r){return h.createElement("div",null,r)},z=function(r,e){return h.createElement("div",null,"Unable to Load More ",h.createElement("button",{"load-more-retry":!0},h.createElement("label",null,h.createElement("span",{class:r.loadMoreIcon})," Retry")))},D=function(){return h.createElement("div",null,h.createElement("button",{"load-more-button":!0},h.createElement("label",null,"See More")))},H=function(r){return h.createElement("div",null,h.createElement("span",{"aria-label":"Loading",class:r.loadMoreSpinner}))};function V(r,e){return e.split(".").reduce((function(r,e){return r&&""!==e?r[e]:r}),r)}var $=(0,j.forwardRef)((function(r,e){var n,t=r.errorTemplate,o=void 0===t?z:t,u=r.fetchJson,i=void 0===u?K.fetchJson:u,a=r.itemsKey,c=void 0===a?"items":a,f=r.loadMore,s=void 0===f?"none":f,v=r.loadMoreBookmark,b=void 0===v?"load-more-src":v,d=r.loadMoreTemplate,m=void 0===d?D:d,j=r.loadingTemplate,O=void 0===j?H:j,M=r.maxItems,S=void 0===M?0:M,R=r.src,$=void 0===R?null:R,Q=r.template,X=void 0===Q?W:Q,Y=r.viewportBuffer,Z=void 0===Y?2:Y,rr=r.wrapperTemplate,er=void 0===rr?_:rr,nr=function(r,e){if(null==r)return{};var n,t,o={},u=Object.keys(r);for(t=0;t<u.length;t++)n=u[t],e.indexOf(n)>=0||(o[n]=r[n]);return o}(r,U),tr=(0,B.useAmpContext)().renderable,or=(0,g.useMemo)((function(){var r=Math.floor(100*Z);return{rootMargin:"0% 0% ".concat(r,"% 0%"),threshold:0}}),[Z]),ur=(0,g.useRef)(null),ir=function(r,e){var n=k((0,T.useState)(!1),2),t=n[0],o=n[1];return(0,T.useEffect)((function(){var n=r.current;if(n)return function(r,e,n){var t=x(r);if(n){var o=q((function(r){e(r[r.length-1])}),t,n);return o.observe(r),function(){o.unobserve(r)}}var u=A.get(t);u||A.set(t,u=q(I,t));var i=P.get(r);return i||(i=[],P.set(r,i)),i.push(e),u.observe(r),function(){!function(r,e){var n,t,o,u=P.get(r);if(u&&(t=e,-1!=(o=(n=u).indexOf(t))&&(n.splice(o,1),1)&&!u.length)){var i=x(r),a=A.get(i);null==a||a.unobserve(r),P.delete(r)}}(r,e)}}(n,(function(r){o(r.isIntersecting)}),e)}),[r,e]),t}(ur,or),ar=function(r){var e=r.fetchPage,n=r.getNextPageParam,t=function(r){var e=(0,G.useRef)(!1);(0,G.useEffect)((function(){return e.current=!0,function(){e.current=!1}}),[]);var n=k((0,G.useState)(r),2),t=n[0],o=n[1];return[t,(0,G.useCallback)((function(r){e.current&&o(r)}),[o])]}(J),o=k(t,2),u=o[0],i=o[1],a=(0,C.useValueRef)({fetchPage:e,getNextPageParam:n,state:u}),c=(0,L.useRef)(0),f=(0,L.useCallback)(y(regeneratorRuntime.mark((function r(){var e,n,t,o,u,f,l,s,v,b,d=arguments;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(e=d.length>0&&void 0!==d[0]&&d[0],n=a.current,t=n.fetchPage,o=n.getNextPageParam,u=n.state,e||!u.loading){r.next=4;break}return r.abrupt("return");case 4:return f=++c.current,i((function(r){return p(p({},r),{},{loading:!0})})),l=e?[]:u.pages,s=l.length?l[l.length-1]:void 0,r.prev=8,r.next=11,t({pageParam:s?o(s):void 0});case 11:if(v=r.sent,f===c.current){r.next=14;break}return r.abrupt("return");case 14:b=o(v),i({loading:!1,error:null,pages:[].concat(E(l),[v]),hasMore:null!=b}),r.next=23;break;case 18:if(r.prev=18,r.t0=r.catch(8),f===c.current){r.next=22;break}return r.abrupt("return");case 22:i((function(e){return p(p({},e),{},{loading:!1,error:r.t0})}));case 23:case"end":return r.stop()}}),r,null,[[8,18]])}))),[a,i]),l=(0,L.useCallback)((function(){return f(!0)}),[f]);return p(p({},u),{},{loadMore:f,reset:l})}({fetchPage:(n=y(regeneratorRuntime.mark((function r(e){var n,t,o;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(n=e.pageParam,t=void 0===n?$:n,tr){r.next=3;break}return r.abrupt("return",null);case 3:return r.next=5,i(t);case 5:return o=r.sent,r.abrupt("return",o);case 7:case"end":return r.stop()}}),r)}))),function(r){return n.apply(this,arguments)}),getNextPageParam:function(r){return function(r,e){return V(r,e)}(r,b)}}),cr=ar.error,fr=ar.hasMore,lr=ar.loadMore,sr=ar.loading,vr=ar.pages,br=ar.reset;(0,g.useEffect)((function(){br()}),[$,tr,b,br]);var dr=tr&&"auto"===s&&ir&&!sr&&fr;(0,g.useEffect)((function(){dr&&lr()}),[dr,lr]);var pr=(0,g.useMemo)((function(){var r=vr.flatMap((function(r){return function(r,e){if(!r)return[];var n=V(r,e);return n?(Array.isArray(n)||(n=[n]),n):[]}(r,c)}));return S>0&&r.length>S&&(r=r.slice(0,S)),r.map((function(r,e){var n=X(r);return n&&"object"===l(n)&&"string"==typeof n.__html&&(n=h.createElement("span",{dangerouslySetInnerHTML:n})),F(n,{"key":e,"role":"listitem"})}))}),[vr,c,S,X]),mr=sr,yr=0!==pr.length,hr="manual"===s&&fr&&!sr;(0,g.useImperativeHandle)(e,(function(){return{refresh:br}}),[br]);var gr=N;return h.createElement(w.ContainWrapper,p(p({"aria-live":"polite"},nr),{},{onClick:function(r){r.target.closest("[load-more-button], [load-more-retry]")&&lr()}}),h.createElement(g.Fragment,{"test-id":"contents"},yr&&F(er(pr),{"role":"list"}),mr&&O(gr),hr&&m(gr),cr&&o(gr,cr),"auto"===s&&h.createElement("span",{ref:ur})))}));function F(r,e){return(0,g.isValidElement)(r)?(0,g.cloneElement)(r,p(p({},e),r.props)):r}$.displayName="List";var Q=function(r){!function(r,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),e&&c(r,e)}(o,v.PreactBaseElement);var e,n,t=(e=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(r){return!1}}(),function(){var r,t=f(e);if(n){var o=f(this).constructor;r=Reflect.construct(t,arguments,o)}else r=t.apply(this,arguments);return s(this,r)});function o(){return t.apply(this,arguments)}return o}();Q.Component=$,Q.props={"src":{attr:"src"},"itemsKey":{attr:"items"},"maxItems":{attr:"max-items",type:"number"},"loadMore":{attr:"load-more"},"loadMoreBookmark":{attr:"load-more-bookmark"},"viewportBuffer":{attr:"viewport-buffer",type:"number"}},Q.layoutSizeDefined=!0,Q.usesShadowDom=!0,Q.usesTemplate=!0;var X=a(require("@bentoproject/core"));function Y(r){(0,X.defineBentoElement)("bento-list",Q,r)}
/*! https://mths.be/cssescape v1.5.1 by @mathias | MIT license */
//# sourceMappingURL=web-component.js.map

@@ -430,3 +430,3 @@ var __create = Object.create;

// extensions/amp-list/1.0/component.js
var _excluded = ["src", "fetchJson", "itemsKey", "maxItems", "loadMore", "loadMoreBookmark", "viewportBuffer", "template", "wrapperTemplate", "loadMoreTemplate", "loadingTemplate", "errorTemplate"];
var _excluded = ["errorTemplate", "fetchJson", "itemsKey", "loadMore", "loadMoreBookmark", "loadMoreTemplate", "loadingTemplate", "maxItems", "src", "template", "viewportBuffer", "wrapperTemplate"];
function _extends2() {

@@ -538,3 +538,3 @@ _extends2 = Object.assign || function(target) {

function BentoListWithRef(_ref, ref) {
var _ref$src = _ref.src, src = _ref$src === void 0 ? null : _ref$src, _ref$fetchJson = _ref.fetchJson, fetchJson2 = _ref$fetchJson === void 0 ? xhrUtils.fetchJson : _ref$fetchJson, _ref$itemsKey = _ref.itemsKey, itemsKey = _ref$itemsKey === void 0 ? "items" : _ref$itemsKey, _ref$maxItems = _ref.maxItems, maxItems = _ref$maxItems === void 0 ? 0 : _ref$maxItems, _ref$loadMore = _ref.loadMore, loadMoreMode = _ref$loadMore === void 0 ? "none" : _ref$loadMore, _ref$loadMoreBookmark = _ref.loadMoreBookmark, loadMoreBookmark = _ref$loadMoreBookmark === void 0 ? "load-more-src" : _ref$loadMoreBookmark, _ref$viewportBuffer = _ref.viewportBuffer, viewportBuffer = _ref$viewportBuffer === void 0 ? 2 : _ref$viewportBuffer, _ref$template = _ref.template, itemTemplate = _ref$template === void 0 ? defaultItemTemplate : _ref$template, _ref$wrapperTemplate = _ref.wrapperTemplate, wrapperTemplate = _ref$wrapperTemplate === void 0 ? defaultWrapperTemplate : _ref$wrapperTemplate, _ref$loadMoreTemplate = _ref.loadMoreTemplate, loadMoreTemplate = _ref$loadMoreTemplate === void 0 ? defaultLoadMoreTemplate : _ref$loadMoreTemplate, _ref$loadingTemplate = _ref.loadingTemplate, loadingTemplate = _ref$loadingTemplate === void 0 ? defaultLoadingTemplate : _ref$loadingTemplate, _ref$errorTemplate = _ref.errorTemplate, errorTemplate = _ref$errorTemplate === void 0 ? defaultErrorTemplate : _ref$errorTemplate, rest = _objectWithoutPropertiesLoose(_ref, _excluded);
var _ref$errorTemplate = _ref.errorTemplate, errorTemplate = _ref$errorTemplate === void 0 ? defaultErrorTemplate : _ref$errorTemplate, _ref$fetchJson = _ref.fetchJson, fetchJson2 = _ref$fetchJson === void 0 ? xhrUtils.fetchJson : _ref$fetchJson, _ref$itemsKey = _ref.itemsKey, itemsKey = _ref$itemsKey === void 0 ? "items" : _ref$itemsKey, _ref$loadMore = _ref.loadMore, loadMoreMode = _ref$loadMore === void 0 ? "none" : _ref$loadMore, _ref$loadMoreBookmark = _ref.loadMoreBookmark, loadMoreBookmark = _ref$loadMoreBookmark === void 0 ? "load-more-src" : _ref$loadMoreBookmark, _ref$loadMoreTemplate = _ref.loadMoreTemplate, loadMoreTemplate = _ref$loadMoreTemplate === void 0 ? defaultLoadMoreTemplate : _ref$loadMoreTemplate, _ref$loadingTemplate = _ref.loadingTemplate, loadingTemplate = _ref$loadingTemplate === void 0 ? defaultLoadingTemplate : _ref$loadingTemplate, _ref$maxItems = _ref.maxItems, maxItems = _ref$maxItems === void 0 ? 0 : _ref$maxItems, _ref$src = _ref.src, src = _ref$src === void 0 ? null : _ref$src, _ref$template = _ref.template, itemTemplate = _ref$template === void 0 ? defaultItemTemplate : _ref$template, _ref$viewportBuffer = _ref.viewportBuffer, viewportBuffer = _ref$viewportBuffer === void 0 ? 2 : _ref$viewportBuffer, _ref$wrapperTemplate = _ref.wrapperTemplate, wrapperTemplate = _ref$wrapperTemplate === void 0 ? defaultWrapperTemplate : _ref$wrapperTemplate, rest = _objectWithoutPropertiesLoose(_ref, _excluded);
var _useAmpContext = (0, import_context.useAmpContext)(), renderable = _useAmpContext.renderable;

@@ -541,0 +541,0 @@ var ioOptions = (0, import_preact.useMemo)(function() {

@@ -305,3 +305,3 @@ var __async = (__this, __arguments, generator) => {

// extensions/amp-list/1.0/component.js
var _excluded = ["src", "fetchJson", "itemsKey", "maxItems", "loadMore", "loadMoreBookmark", "viewportBuffer", "template", "wrapperTemplate", "loadMoreTemplate", "loadingTemplate", "errorTemplate"];
var _excluded = ["errorTemplate", "fetchJson", "itemsKey", "loadMore", "loadMoreBookmark", "loadMoreTemplate", "loadingTemplate", "maxItems", "src", "template", "viewportBuffer", "wrapperTemplate"];
function _extends2() {

@@ -375,14 +375,14 @@ _extends2 = Object.assign || function(target) {

let {
src = null,
errorTemplate = defaultErrorTemplate,
fetchJson = xhrUtils.fetchJson,
itemsKey = "items",
maxItems = 0,
loadMore: loadMoreMode = "none",
loadMoreBookmark = "load-more-src",
viewportBuffer = 2,
template: itemTemplate = defaultItemTemplate,
wrapperTemplate = defaultWrapperTemplate,
loadMoreTemplate = defaultLoadMoreTemplate,
loadingTemplate = defaultLoadingTemplate,
errorTemplate = defaultErrorTemplate
maxItems = 0,
src = null,
template: itemTemplate = defaultItemTemplate,
viewportBuffer = 2,
wrapperTemplate = defaultWrapperTemplate
} = _ref, rest = _objectWithoutPropertiesLoose(_ref, _excluded);

@@ -389,0 +389,0 @@ const {

;
var e=(e,t,r)=>new Promise(((o,n)=>{var a=e=>{try{l(r.next(e))}catch(e){n(e)}},c=e=>{try{l(r.throw(e))}catch(e){n(e)}},l=e=>e.done?o(e.value):Promise.resolve(e.value).then(a,c);l((r=r.apply(e,t)).next())}));import{PreactBaseElement as t}from"@bentoproject/core";function r(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,o)}return r}function n(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach((function(t){r(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}import{createElement as a}from"@bentoproject/core";import{Fragment as c,cloneElement as l,isValidElement as i,useEffect as u,useImperativeHandle as s,useMemo as f,useRef as m}from"@bentoproject/core";import{forwardRef as p}from"@bentoproject/core";import{ContainWrapper as d}from"@bentoproject/core";var{hasOwnProperty:b,toString:g}=Object.prototype;function h(e){return(e.ownerDocument||e).defaultView}function j(e,t,r={}){const{needsRootBounds:o,rootMargin:n,threshold:a}=r,c=function(e){return e.parent&&e.parent!=e}(t)&&(o||n)?t.document:void 0;return new t.IntersectionObserver(e,{threshold:a,root:c,rootMargin:n})}var v=new WeakMap,M=new WeakMap;function y(e){const t=new Set;for(let r=e.length-1;r>=0;r--){const o=e[r],{target:n}=o;if(t.has(n))continue;t.add(n);const a=M.get(n);if(a)for(let e=0;e<a.length;e++)(0,a[e])(o)}}import{useCallback as P,useEffect as w,useRef as O,useState as k}from"@bentoproject/core";import{useAmpContext as x}from"@bentoproject/core";import{useCallback as T,useRef as B}from"@bentoproject/core";import{useValueRef as S}from"@bentoproject/core";import{useCallback as I,useEffect as R,useRef as L,useState as N}from"@bentoproject/core";var C={loading:!1,error:null,pages:[],hasMore:!0},E={fetchJson(e,t){return this.fetch(e,t).then((e=>e.json()))},fetch(t,r){return e(this,null,(function*(){const e=yield self.fetch(t,r);if(!e.ok)throw new Error(e.statusText);return e}))}},J={loadMoreSpinner:"load-more-spinner-cc33818",loadMoreIcon:"load-more-icon-cc33818"},K=["src","fetchJson","itemsKey","maxItems","loadMore","loadMoreBookmark","viewportBuffer","template","wrapperTemplate","loadMoreTemplate","loadingTemplate","errorTemplate"],W=e=>a("div",null,String(e)),A=e=>a("div",null,e),H=(e,t)=>a("div",null,"Unable to Load More ",a("button",{"load-more-retry":!0},a("label",null,a("span",{class:e.loadMoreIcon})," Retry"))),U=()=>a("div",null,a("button",{"load-more-button":!0},a("label",null,"See More"))),$=e=>a("div",null,a("span",{"aria-label":"Loading",class:e.loadMoreSpinner}));function q(e,t){return t.split(".").reduce(((e,t)=>e&&""!==t?e[t]:e),e)}var z=p((function(t,r){let{src:o=null,fetchJson:l=E.fetchJson,itemsKey:i="items",maxItems:p=0,loadMore:b="none",loadMoreBookmark:g="load-more-src",viewportBuffer:P=2,template:O=W,wrapperTemplate:z=A,loadMoreTemplate:F=U,loadingTemplate:G=$,errorTemplate:Q=H}=t,V=function(e,t){if(null==e)return{};var r,o,n={},a=Object.keys(e);for(o=0;o<a.length;o++)r=a[o],t.indexOf(r)>=0||(n[r]=e[r]);return n}(t,K);const{renderable:X}=x(),Y=f((()=>({rootMargin:`0% 0% ${Math.floor(100*P)}% 0%`,threshold:0})),[P]),Z=m(null),_=function(e,t){const[r,o]=k(!1);return w((()=>{const r=e.current;if(r)return function(e,t,r){const o=h(e);if(r){const n=j((e=>{t(e[e.length-1])}),o,r);return n.observe(e),()=>{n.unobserve(e)}}let n=v.get(o);n||v.set(o,n=j(y,o));let a=M.get(e);return a||(a=[],M.set(e,a)),a.push(t),n.observe(e),()=>{!function(e,t){const r=M.get(e);if(!r)return;if(!function(e,t){const r=e.indexOf(t);return-1!=r&&(e.splice(r,1),!0)}(r,t))return;if(r.length)return;const o=h(e),n=v.get(o);null==n||n.unobserve(e),M.delete(e)}(e,t)}}(r,(e=>{o(e.isIntersecting)}),t)}),[e,t]),r}(Z,Y),{error:ee,hasMore:te,loadMore:re,loading:oe,pages:ne,reset:ae}=function({fetchPage:t,getNextPageParam:r}){const[o,a]=function(e){const t=L(!1);R((()=>(t.current=!0,()=>{t.current=!1})),[]);const[r,o]=N(e);return[r,I((e=>{t.current&&o(e)}),[o])]}(C),c=S({fetchPage:t,getNextPageParam:r,state:o}),l=B(0),i=T(((t=!1)=>e(this,null,(function*(){const{fetchPage:e,getNextPageParam:r,state:o}=c.current;if(!t&&o.loading)return;const i=++l.current;a((e=>n(n({},e),{},{loading:!0})));const u=t?[]:o.pages,s=u.length?u[u.length-1]:void 0;try{const t=yield e({pageParam:s?r(s):void 0});if(i!==l.current)return;const o=r(t);a({loading:!1,error:null,pages:[...u,t],hasMore:null!=o})}catch(e){if(i!==l.current)return;a((t=>n(n({},t),{},{loading:!1,error:e})))}}))),[c,a]),u=T((()=>i(!0)),[i]);return n(n({},o),{},{loadMore:i,reset:u})}({fetchPage:t=>e(this,[t],(function*({pageParam:e=o}){return X?yield l(e):null})),getNextPageParam:e=>function(e,t){return q(e,t)}(e,g)});u((()=>{ae()}),[o,X,g,ae]);const ce=X&&"auto"===b&&_&&!oe&&te;u((()=>{ce&&re()}),[ce,re]);const le=f((()=>{let e=ne.flatMap((e=>function(e,t){if(!e)return[];let r=q(e,t);return r?(Array.isArray(r)||(r=[r]),r):[]}(e,i)));return p>0&&e.length>p&&(e=e.slice(0,p)),e.map(((e,t)=>{let r=O(e);return r&&"object"==typeof r&&"string"==typeof r.__html&&(r=a("span",{dangerouslySetInnerHTML:r})),D(r,{"key":t,"role":"listitem"})}))}),[ne,i,p,O]),ie=oe,ue=0!==le.length,se="manual"===b&&te&&!oe;s(r,(()=>({refresh:ae})),[ae]);const fe=J;return a(d,n(n({"aria-live":"polite"},V),{},{onClick:e=>{e.target.closest("[load-more-button], [load-more-retry]")&&re()}}),a(c,{"test-id":"contents"},ue&&D(z(le),{"role":"list"}),ie&&G(fe),se&&F(fe),ee&&Q(fe,ee),"auto"===b&&a("span",{ref:Z})))}));function D(e,t){return i(e)?l(e,n(n({},t),e.props)):e}z.displayName="List";var F=class extends t{};F.Component=z,F.props={"src":{attr:"src"},"itemsKey":{attr:"items"},"maxItems":{attr:"max-items",type:"number"},"loadMore":{attr:"load-more"},"loadMoreBookmark":{attr:"load-more-bookmark"},"viewportBuffer":{attr:"viewport-buffer",type:"number"}},F.layoutSizeDefined=!0,F.usesShadowDom=!0,F.usesTemplate=!0;import{defineBentoElement as G}from"@bentoproject/core";function Q(e){G("bento-list",F,e)}export{Q as defineElement};
var e=(e,t,r)=>new Promise(((o,n)=>{var a=e=>{try{l(r.next(e))}catch(e){n(e)}},c=e=>{try{l(r.throw(e))}catch(e){n(e)}},l=e=>e.done?o(e.value):Promise.resolve(e.value).then(a,c);l((r=r.apply(e,t)).next())}));import{PreactBaseElement as t}from"@bentoproject/core";function r(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,o)}return r}function n(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach((function(t){r(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}import{createElement as a}from"@bentoproject/core";import{Fragment as c,cloneElement as l,isValidElement as i,useEffect as u,useImperativeHandle as s,useMemo as f,useRef as m}from"@bentoproject/core";import{forwardRef as p}from"@bentoproject/core";import{ContainWrapper as d}from"@bentoproject/core";var{hasOwnProperty:b,toString:g}=Object.prototype;function h(e){return(e.ownerDocument||e).defaultView}function j(e,t,r={}){const{needsRootBounds:o,rootMargin:n,threshold:a}=r,c=function(e){return e.parent&&e.parent!=e}(t)&&(o||n)?t.document:void 0;return new t.IntersectionObserver(e,{threshold:a,root:c,rootMargin:n})}var v=new WeakMap,M=new WeakMap;function y(e){const t=new Set;for(let r=e.length-1;r>=0;r--){const o=e[r],{target:n}=o;if(t.has(n))continue;t.add(n);const a=M.get(n);if(a)for(let e=0;e<a.length;e++)(0,a[e])(o)}}import{useCallback as P,useEffect as w,useRef as O,useState as k}from"@bentoproject/core";import{useAmpContext as x}from"@bentoproject/core";import{useCallback as T,useRef as B}from"@bentoproject/core";import{useValueRef as S}from"@bentoproject/core";import{useCallback as I,useEffect as R,useRef as L,useState as N}from"@bentoproject/core";var C={loading:!1,error:null,pages:[],hasMore:!0},E={fetchJson(e,t){return this.fetch(e,t).then((e=>e.json()))},fetch(t,r){return e(this,null,(function*(){const e=yield self.fetch(t,r);if(!e.ok)throw new Error(e.statusText);return e}))}},J={loadMoreSpinner:"load-more-spinner-cc33818",loadMoreIcon:"load-more-icon-cc33818"},K=["errorTemplate","fetchJson","itemsKey","loadMore","loadMoreBookmark","loadMoreTemplate","loadingTemplate","maxItems","src","template","viewportBuffer","wrapperTemplate"],W=e=>a("div",null,String(e)),A=e=>a("div",null,e),H=(e,t)=>a("div",null,"Unable to Load More ",a("button",{"load-more-retry":!0},a("label",null,a("span",{class:e.loadMoreIcon})," Retry"))),U=()=>a("div",null,a("button",{"load-more-button":!0},a("label",null,"See More"))),$=e=>a("div",null,a("span",{"aria-label":"Loading",class:e.loadMoreSpinner}));function q(e,t){return t.split(".").reduce(((e,t)=>e&&""!==t?e[t]:e),e)}var z=p((function(t,r){let{errorTemplate:o=H,fetchJson:l=E.fetchJson,itemsKey:i="items",loadMore:p="none",loadMoreBookmark:b="load-more-src",loadMoreTemplate:g=U,loadingTemplate:P=$,maxItems:O=0,src:z=null,template:F=W,viewportBuffer:G=2,wrapperTemplate:Q=A}=t,V=function(e,t){if(null==e)return{};var r,o,n={},a=Object.keys(e);for(o=0;o<a.length;o++)r=a[o],t.indexOf(r)>=0||(n[r]=e[r]);return n}(t,K);const{renderable:X}=x(),Y=f((()=>({rootMargin:`0% 0% ${Math.floor(100*G)}% 0%`,threshold:0})),[G]),Z=m(null),_=function(e,t){const[r,o]=k(!1);return w((()=>{const r=e.current;if(r)return function(e,t,r){const o=h(e);if(r){const n=j((e=>{t(e[e.length-1])}),o,r);return n.observe(e),()=>{n.unobserve(e)}}let n=v.get(o);n||v.set(o,n=j(y,o));let a=M.get(e);return a||(a=[],M.set(e,a)),a.push(t),n.observe(e),()=>{!function(e,t){const r=M.get(e);if(!r)return;if(!function(e,t){const r=e.indexOf(t);return-1!=r&&(e.splice(r,1),!0)}(r,t))return;if(r.length)return;const o=h(e),n=v.get(o);null==n||n.unobserve(e),M.delete(e)}(e,t)}}(r,(e=>{o(e.isIntersecting)}),t)}),[e,t]),r}(Z,Y),{error:ee,hasMore:te,loadMore:re,loading:oe,pages:ne,reset:ae}=function({fetchPage:t,getNextPageParam:r}){const[o,a]=function(e){const t=L(!1);R((()=>(t.current=!0,()=>{t.current=!1})),[]);const[r,o]=N(e);return[r,I((e=>{t.current&&o(e)}),[o])]}(C),c=S({fetchPage:t,getNextPageParam:r,state:o}),l=B(0),i=T(((t=!1)=>e(this,null,(function*(){const{fetchPage:e,getNextPageParam:r,state:o}=c.current;if(!t&&o.loading)return;const i=++l.current;a((e=>n(n({},e),{},{loading:!0})));const u=t?[]:o.pages,s=u.length?u[u.length-1]:void 0;try{const t=yield e({pageParam:s?r(s):void 0});if(i!==l.current)return;const o=r(t);a({loading:!1,error:null,pages:[...u,t],hasMore:null!=o})}catch(e){if(i!==l.current)return;a((t=>n(n({},t),{},{loading:!1,error:e})))}}))),[c,a]),u=T((()=>i(!0)),[i]);return n(n({},o),{},{loadMore:i,reset:u})}({fetchPage:t=>e(this,[t],(function*({pageParam:e=z}){return X?yield l(e):null})),getNextPageParam:e=>function(e,t){return q(e,t)}(e,b)});u((()=>{ae()}),[z,X,b,ae]);const ce=X&&"auto"===p&&_&&!oe&&te;u((()=>{ce&&re()}),[ce,re]);const le=f((()=>{let e=ne.flatMap((e=>function(e,t){if(!e)return[];let r=q(e,t);return r?(Array.isArray(r)||(r=[r]),r):[]}(e,i)));return O>0&&e.length>O&&(e=e.slice(0,O)),e.map(((e,t)=>{let r=F(e);return r&&"object"==typeof r&&"string"==typeof r.__html&&(r=a("span",{dangerouslySetInnerHTML:r})),D(r,{"key":t,"role":"listitem"})}))}),[ne,i,O,F]),ie=oe,ue=0!==le.length,se="manual"===p&&te&&!oe;s(r,(()=>({refresh:ae})),[ae]);const fe=J;return a(d,n(n({"aria-live":"polite"},V),{},{onClick:e=>{e.target.closest("[load-more-button], [load-more-retry]")&&re()}}),a(c,{"test-id":"contents"},ue&&D(Q(le),{"role":"list"}),ie&&P(fe),se&&g(fe),ee&&o(fe,ee),"auto"===p&&a("span",{ref:Z})))}));function D(e,t){return i(e)?l(e,n(n({},t),e.props)):e}z.displayName="List";var F=class extends t{};F.Component=z,F.props={"src":{attr:"src"},"itemsKey":{attr:"items"},"maxItems":{attr:"max-items",type:"number"},"loadMore":{attr:"load-more"},"loadMoreBookmark":{attr:"load-more-bookmark"},"viewportBuffer":{attr:"viewport-buffer",type:"number"}},F.layoutSizeDefined=!0,F.usesShadowDom=!0,F.usesTemplate=!0;import{defineBentoElement as G}from"@bentoproject/core";function Q(e){G("bento-list",F,e)}export{Q as defineElement};
/*! https://mths.be/cssescape v1.5.1 by @mathias | MIT license */
//# sourceMappingURL=web-component.module.js.map
{
"name": "@bentoproject/list",
"version": "1.2305051745.0",
"version": "1.2305051745.1",
"description": "Bento list Component",

@@ -46,4 +46,4 @@ "author": "Bento Authors",

"dependencies": {
"@bentoproject/core": "0.2305051745.0"
"@bentoproject/core": "0.2305051745.1"
}
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc