Socket
Socket
Sign inDemoInstall

@ampproject/amp-base-carousel

Package Overview
Dependencies
5
Maintainers
16
Versions
92
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.2110121825.0 to 1.2110142235.0

2

dist/component-react.module.js

@@ -1,2 +0,2 @@

function t(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function e(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function n(n){for(var r=1;r<arguments.length;r++){var o=null!=arguments[r]?arguments[r]:{};r%2?e(Object(o),!0).forEach((function(e){t(n,e,o[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):e(Object(o)).forEach((function(t){Object.defineProperty(n,t,Object.getOwnPropertyDescriptor(o,t))}))}return n}var r={carousel:"carousel-f3d75e0",scrollContainer:"scroll-container-f3d75e0",hideScrollbar:"hide-scrollbar-f3d75e0",horizontalScroll:"horizontal-scroll-f3d75e0",verticalScroll:"vertical-scroll-f3d75e0",slideElement:"slide-element-f3d75e0",thumbnails:"thumbnails-f3d75e0",startAlign:"start-align-f3d75e0",centerAlign:"center-align-f3d75e0",enableSnap:"enable-snap-f3d75e0",disableSnap:"disable-snap-f3d75e0",slideSizing:"slide-sizing-f3d75e0",arrow:"arrow-f3d75e0",ltr:"ltr-f3d75e0",rtl:"rtl-f3d75e0",arrowPrev:"arrow-prev-f3d75e0",arrowNext:"arrow-next-f3d75e0",arrowDisabled:"arrow-disabled-f3d75e0",insetArrow:"inset-arrow-f3d75e0",outsetArrow:"outset-arrow-f3d75e0",defaultArrowButton:"default-arrow-button-f3d75e0",arrowBaseStyle:"arrow-base-style-f3d75e0",arrowFrosting:"arrow-frosting-f3d75e0",arrowBackdrop:"arrow-backdrop-f3d75e0",arrowBackground:"arrow-background-f3d75e0",arrowIcon:"arrow-icon-f3d75e0"};function o(t,e){if(null==t)return{};var n,r,o={},i=Object.keys(t);for(r=0;r<i.length;r++)n=i[r],e.indexOf(n)>=0||(o[n]=t[n]);return o}import{cloneElement as i,createContext as l,createElement as a,createRef as s}from"react";import{hydrate as c,render as d}from"react-dom";import{useCallback as u,useContext as f,useEffect as p,useImperativeHandle as b,useLayoutEffect as v,useMemo as h,useRef as w,useState as g}from"react";function y(t,e,n){return a.apply(void 0,arguments)}function x(t,e,n){return i.apply(void 0,arguments)}function C(t){return t.children}function m(t){return l(t,void 0)}function k(t){return g(t)}function A(t){return w(t)}function S(t,e){p(t,e)}function O(t,e){v(t,e)}function B(t){return f(t)}function M(t,e){return h(t,e)}function L(t,e){return u(t,e)}function I(t,e,n){return b(t,e,n)}var{hasOwnProperty:N,toString:j}=Object.prototype;function z(t,e){return t>0&&e>0?t%e:(t%e+e)%e}var T={START:"start",CENTER:"center"},R={HORIZONTAL:"horizontal",VERTICAL:"vertical"};function P(t,e){const{bottom:n,height:r,left:o,right:i,top:l,width:a}=e.getBoundingClientRect();return{start:Math.round(0==t?o:l),end:Math.round(0==t?i:n),length:Math.round(0==t?a:r)}}function $(t,e){const{end:n,start:r}=P(t,e);return(r+n)/2}function E(t,e){const{start:n}=P(t,e);return n}function G(t,e,n){return e==T.START?E(t,n):$(t,n)}function _(t,e,n){const{end:r,start:o}=P(t,e);return o<=n&&n<r}function F(t,e){return 0==t?e.scrollLeft:e.scrollTop}function V(t,e){return 0==t?e.scrollWidth:e.scrollHeight}function W(t,e,n,r,o=0){const i=e==T.START,{length:l}=P(t,r),a=i?E(t,r):$(t,r),s=i?E(t,n):$(t,n),c=Math.round(a-s-o*l);!function(t,e,n){!function(t,e,n){0==t?e.scrollLeft=n:e.scrollTop=n}(t,e,F(t,e)+n)}(t,n,c);const{length:d}=P(t,n),u=d+F(t,n)+c<V(t,n);return!!c&&u}function H({advance:t,as:e=Z,by:n,disabled:r,outsetArrows:o,rtl:i}){const l=L((()=>{r||t()}),[t,r]);return y(e,{"aria-disabled":String(!!r),by:n,class:"arrow-f3d75e0"+(r?" arrow-disabled-f3d75e0":"")+(n<0?" arrow-prev-f3d75e0":"")+(n>0?" arrow-next-f3d75e0":"")+(o?" outset-arrow-f3d75e0":"")+(o?"":" inset-arrow-f3d75e0")+(i?" rtl-f3d75e0":"")+(i?"":" ltr-f3d75e0"),disabled:r,onClick:l,outsetArrows:o,rtl:i.toString()})}function Z({"aria-disabled":t,by:e,"class":n,disabled:r,onClick:o}){return y("div",{class:n},y("button",{"aria-disabled":t,"aria-label":e<0?"Previous item in carousel":"Next item in carousel",class:"default-arrow-button-f3d75e0",disabled:r,onClick:o},y("div",{class:"arrow-base-style-f3d75e0 arrow-frosting-f3d75e0"}),y("div",{class:"arrow-base-style-f3d75e0 arrow-backdrop-f3d75e0"}),y("div",{class:"arrow-base-style-f3d75e0 arrow-background-f3d75e0"}),y("svg",{class:"arrow-icon-f3d75e0",viewBox:"0 0 24 24"},y("path",{d:e<0?"M14,7.4 L9.4,12 L14,16.6":"M10,7.4 L14.6,12 L10,16.6",fill:"none","stroke-width":"2px","stroke-linejoin":"round","stroke-linecap":"round"}))))}var D=m({slides:[],setSlides:t=>{}});import{Children as U,createPortal as K,forwardRef as Y}from"react";function q(t){return Y(t)}function J(t){return U.toArray.apply(void 0,arguments)}var Q=["as","children","class","contentAs","contentClassName","contentProps","contentRef","contentStyle","layout","paint","size","style","wrapperClassName","wrapperStyle"],X=[null,"paint","layout","content","size","size paint","size layout","strict"],tt={"position":"relative","width":"100%","height":"100%"},et=q((function(t,e){let{as:r="div",children:i,"class":l,contentAs:a="div",contentClassName:s,contentProps:c,contentRef:d,contentStyle:u,layout:f=!1,paint:b=!1,size:p=!1,"style":v,wrapperClassName:h,wrapperStyle:w}=t;const g=(p?4:0)+(f?2:0)+(b?1:0);return y(r,n(n({},o(t,Q)),{},{ref:e,class:`${l||""} ${h||""}`.trim()||null,style:n(n(n({},v),w),{},{contain:X[g]})}),y(a,n(n({},c),{},{ref:d,class:s,style:n(n({},p&&tt),{},{"overflow":b?"hidden":"visible"},u)}),i))})),nt=["as","children","class","style","wrapperClassName","wrapperStyle"];function rt(t){const e=A(null);return e.current=t,e}function ot(t){return(t.ownerDocument||t).defaultView}q((function(t,e){let{as:r="div",children:i,"class":l,"style":a,wrapperClassName:s,wrapperStyle:c}=t;return y(r,n(n({},o(t,nt)),{},{ref:e,class:`${l||""} ${s||""}`.trim()||null,style:n(n({},a),c)}),i)})),new WeakMap,new WeakMap;var it,lt={arrow:"arrow-d701172",auto:"auto-d701172",caption:"caption-d701172",captionText:"caption-text-d701172",clip:"clip-d701172",closeButton:"close-button-d701172",control:"control-d701172",controlsPanel:"controls-panel-d701172",expanded:"expanded-d701172",hideControls:"hide-controls-d701172",lightbox:"lightbox-d701172",gallery:"gallery-d701172",grid:"grid-d701172",nextArrow:"next-arrow-d701172",prevArrow:"prev-arrow-d701172",showControls:"show-controls-d701172",thumbnail:"thumbnail-d701172",topControl:"top-control-d701172"},at="control-d701172",st=m({deregister:()=>{},register:()=>{},open:()=>{}}),ct=["Webkit","webkit","Moz","moz","ms","O","o"];function dt(t,e,n,r,o){const i=function(t,e,n){if(ut(e))return e;it||(it=Object.create(null));let r=it[e];if(!r||n){if(r=e,void 0===t[e]){const n=function(t){return t.charAt(0).toUpperCase()+t.slice(1)}(e),o=function(t,e){for(let n=0;n<ct.length;n++){const r=ct[n]+e;if(void 0!==t[r])return r}return""}(t,n);void 0!==t[o]&&(r=o)}n||(it[e]=r)}return r}(t.style,e,o);if(!i)return;const l=r?n+r:n;ut(i)?t.style.setProperty(i,l):t.style[i]=l}function ut(t){return t.startsWith("--")}var ft,pt,bt,vt,ht,wt=["animation","children","closeButtonAs","onAfterClose","onAfterOpen","onBeforeOpen"],gt={"fade-in":[{opacity:0,visibility:"visible"},{opacity:1,visibility:"visible"}],"fly-in-top":[{opacity:0,transform:"translate(0,-100%)",visibility:"visible"},{opacity:1,transform:"translate(0, 0)",visibility:"visible"}],"fly-in-bottom":[{opacity:0,transform:"translate(0, 100%)",visibility:"visible"},{opacity:1,transform:"translate(0, 0)",visibility:"visible"}]},yt={"part":"scroller"},xt=q((function(t,e){let{animation:r="fade-in",children:i,closeButtonAs:l,onAfterClose:a,onAfterOpen:s,onBeforeOpen:c}=t,d=o(t,wt);const[u,f]=k(!1),[b,p]=k(!1),v=A(),h=rt(r),w=rt(c),g=rt(a),x=rt(s);return I(e,(()=>({open:()=>{var t;null===(t=w.current)||void 0===t||t.call(w),f(!0),p(!0)},close:()=>p(!1)})),[w]),O((()=>{const t=v.current;if(!t)return;let e;if(dt(t,"visibility",b?"hidden":"visible"),b){const n=()=>{var e;dt(t,"opacity",1),dt(t,"visibility","visible"),function(t){try{t.focus()}catch(t){}}(t),null===(e=x.current)||void 0===e||e.call(x)};if(!t.animate)return void n();e=t.animate(gt[h.current],{duration:200,fill:"both",easing:"ease-in"}),e.onfinish=n}else{const n=()=>{dt(t,"opacity",0),dt(t,"visibility","hidden"),g.current&&g.current(),e=null,f(!1)};if(!t.animate)return void n();e=t.animate(gt[h.current],{duration:200,direction:"reverse",fill:"both",easing:"ease-in"}),e.onfinish=n}return()=>{e&&e.cancel()}}),[b,h,g,x]),u&&y(et,n({ref:v,size:!0,layout:!0,paint:!0,part:"lightbox",contentClassName:"content-88b9dee",wrapperClassName:"wrapper-88b9dee",contentProps:yt,role:"dialog",tabIndex:"0",onKeyDown:t=>{"Escape"===t.key&&p(!1)}},d),y(Ct,{as:l,onClick:()=>p(!1)}),i)}));function Ct({onClick:t,as:e=mt}){return y(e,{"aria-label":"Close the modal",onClick:t})}function mt({"aria-label":t,onClick:e}){return y("button",{"aria-label":t,class:"close-button-88b9dee",onClick:e,tabIndex:-1})}xt.displayName="Lightbox";var kt={"aria-label":"Toggle caption expanded state.","role":"button"};function At({onClick:t}){return y("svg",{"aria-label":"Close the lightbox",class:at+" top-control-d701172 close-button-d701172",onClick:t,role:"button",tabIndex:"0",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},ft||(ft=y("path",{d:"M6.4 6.4 L17.6 17.6 Z M17.6 6.4 L6.4 17.6 Z",stroke:"#fff","stroke-width":"2","stroke-linejoin":"round"})))}function St({"aria-disabled":t,by:e,disabled:n,onClick:r}){return y("svg",{"aria-disabled":t,class:"arrow-d701172 "+at+(e<0?" prev-arrow-d701172":"")+(e>0?" next-arrow-d701172":""),disabled:n,onClick:r,role:"button",tabIndex:"0",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},y("path",{d:e<0?"M14,7.4 L9.4,12 L14,16.6":"M10,7.4 L14.6,12 L10,16.6",fill:"none",stroke:"#fff","stroke-width":"2","stroke-linejoin":"round","stroke-linecap":"round"}))}function Ot({onClick:t,showCarousel:e}){return y("svg",{"aria-label":e?"Switch to grid view":"Switch to carousel view",class:at+" top-control-d701172",onClick:t,role:"button",tabIndex:"0",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},e?pt||(pt=y("g",{fill:"#fff"},y("rect",{x:"3",y:"3",width:"6",height:"8",rx:"1",ry:"1"}),y("rect",{x:"15",y:"13",width:"6",height:"8",rx:"1",ry:"1"}),y("rect",{x:"11",y:"3",width:"10",height:"8",rx:"1",ry:"1"}),y("rect",{x:"3",y:"13",width:"10",height:"8",rx:"1",ry:"1"}))):y(C,null,bt||(bt=y("rect",{x:"4",y:"4",width:"16",height:"16",rx:"1","stroke-width":"2",stroke:"#fff",fill:"none"})),vt||(vt=y("circle",{fill:"#fff",cx:"15.5",cy:"8.5",r:"1.5"})),ht||(ht=y("polygon",{fill:"#fff",points:"5,19 5,13 8,10 13,15 16,12 19,15 19,19"}))))}function Bt({onClick:t,render:e}){return y("div",{"aria-label":"View in carousel",class:"thumbnail-d701172",onClick:t,role:"button",tabIndex:"0"},e())}function Mt(){let t=0;return()=>String(++t)}q((function({children:t,onAfterClose:e,onAfterOpen:r,onBeforeOpen:o,onToggleCaption:i,onViewGrid:l,render:a},s){const c=lt,d=A(null),u=A(null),[f,b]=k(0),p=A({}),v=A({}),h=A({}),w=A({}),g=A({}),[x,m]=k(!0),[S,B]=k(!0),[M,N]=k(null),j=L((t=>{const e=null!=t?t:Object.keys(p.current)[0];e&&(w.current[e]||(w.current[e]=[],g.current[e]=[],h.current[e]=0),p.current[e].forEach(((t,n)=>{if(!w.current[e][n]){const r=h.current[e];w.current[e][n]=t(),g.current[e][n]=y(Bt,{onClick:()=>{m(!0),b(r)},render:t}),h.current[e]+=1}})),N(e))}),[]),T=L(((t,e="default",n,r)=>{p.current[e]||(p.current[e]=[],v.current[e]=[]),p.current[e][t-1]=n,v.current[e][t-1]=r}),[]),R=L(((t,e="default")=>{delete p.current[e][t-1],delete v.current[e][t-1],delete w.current[e][t-1],h.current[e]--}),[]),P=L(((t,e)=>{var n;j(e),B(!0),m(!0),null!=t&&b(t),null===(n=d.current)||void 0===n||n.open()}),[j]),$={deregister:R,register:T,open:P},E=A(void 0),[G,_]=k(null),[F,V]=k("auto");return O((()=>{var t;if(null===(t=u.current)||void 0===t||t.goToSlide(f),M){const t=p.current[M].length-h.current[M]+z(f,h.current[M]);_(v.current[M][t]),V("auto")}}),[M,f]),O((()=>{var t;const{offsetHeight:e,scrollHeight:n}=null!==(t=E.current)&&void 0!==t?t:{};n>e+40&&V("clip")}),[G]),I(s,(()=>({open:P,close:()=>{var t;null===(t=d.current)||void 0===t||t.close()}})),[P]),y(C,null,y(xt,{class:"lightbox-d701172"+(S?" show-controls-d701172":"")+(S?"":" hide-controls-d701172"),closeButtonAs:At,onBeforeOpen:o,onAfterOpen:r,onAfterClose:e,ref:d},y("div",{class:"controls-panel-d701172"},y(Ot,{onClick:()=>{x&&(null==l||l()),m(!x)},showCarousel:x})),y(Dt,{arrowPrevAs:St,arrowNextAs:St,class:"gallery-d701172",defaultSlide:z(f,h.current[M])||0,hidden:!x,loop:!0,onClick:()=>B(!S),onSlideChange:t=>b(t),ref:u},w.current[M]),y("div",n({hidden:!x,class:"caption-d701172 "+at+" "+c[F],ref:E},"auto"===F?null:n({onClick:()=>{null==i||i(),V("clip"===F?"expanded":"clip")}},kt)),y("div",{class:"caption-text-d701172 amp-lightbox-gallery-caption",part:"caption"},G)),!x&&y("div",{class:"gallery-d701172 grid-d701172"},g.current[M])),y(st.Provider,{value:$},a?a():t))})).displayName="BentoLightboxGalleryProvider";var Lt=["alt","aria-label","as","caption","children","enableActivation","group","onMount","render","srcset"],It=Mt(),Nt={"aria-label":"Open content in a lightbox view.",role:"button",tabIndex:0},jt=t=>x(t);function zt(t){var e;let{alt:r,"aria-label":i,as:l="div",caption:a,children:s,enableActivation:c=!0,group:d,onMount:u,render:f,srcset:b}=t,p=o(t,Lt);const[v]=k(It),{deregister:h,open:w,register:g}=B(st),x=L((()=>f?f():s?J(s).map(jt):e||(e=y(l,{srcset:b}))),[s,f,b]),C=M((()=>a||r||i),[r,i,a]);O((()=>(g(v,d,x,C),()=>h(v,d))),[C,v,d,h,g,x]),O((()=>null==u?void 0:u(Number(v)-1)),[v,u]);const m=M((()=>c&&n(n({},Nt),{},{onClick:()=>{w(Number(v)-1,d)}})),[c,v,d,w]);return y(l,n(n({},m),{},{srcset:b},p),s)}var Tt=q((function({_thumbnails:t,advanceCount:e,alignment:n,axis:o,children:i,lightboxGroup:l,loop:a,mixedLength:s,onClick:c,restingIndex:d,setRestingIndex:u,snap:f,snapBy:b=1,visibleCount:p},v){const h=A(null),w=a?Math.floor(i.length/2):d,g=A(!1),x=L((t=>{const e=h.current;e&&(N.current=z(N.current+t,i.length),S.current=0,W(o,n,e,e.children[z(w+t,e.children.length)],S.current)||u(N.current))}),[n,o,i.length,w,u]);I(v,(()=>({advance:x,next:()=>x(e),prev:()=>x(-e),get node(){return h.current}})),[x,e]);const m=r,k=A(d),S=A(0),B=function({_thumbnails:t,alignment:e,children:n,lightboxGroup:r,loop:o,mixedLength:i,offsetRef:l,pivotIndex:a,restingIndex:s,snap:c,snapBy:d,visibleCount:u},f){const{length:b}=n,p=r?zt:"div",v=n.map(((n,o)=>{const l=`slide-${n.key||o}`;return y(p,{caption:n.props.caption,key:l,"data-slide":o,class:`${f.slideSizing} ${f.slideElement} ${c&&0===z(o,d)?f.enableSnap:f.disableSnap} ${e===T.CENTER?f.centerAlign:f.startAlign} ${t?f.thumbnails:""} `,group:r||void 0,part:"slide",style:{flex:i?"0 0 auto":`0 0 ${100/u}%`}},n)}));if(!o)return v;const h=[],w=[],g=z(b-s+a,b);if(s<=a)for(let t=0;t<g;t++)h.unshift(v.pop());else for(let t=0;t<b-g;t++)w.push(v.shift());return l.current=h.length?h.length:-w.length,y(C,null,h,v,w)}({alignment:n,children:i,loop:a,mixedLength:s,offsetRef:k,lightboxGroup:l,pivotIndex:w,restingIndex:d,snap:f,snapBy:b,visibleCount:p,_thumbnails:t},m),N=A(d),j=L((()=>{if(!h.current||!h.current.children.length)return;const t=h.current;dt(t,"scrollBehavior","auto"),g.current=!0,W(o,n,t,t.children[w],S.current),dt(t,"scrollBehavior","smooth")}),[n,o,w]);O((()=>{h.current&&a&&h.current.children.length&&j()}),[a,d,j]),O((()=>{if(!h.current)return;const t=h.current;if(!t)return;const e=ot(t);if(!e)return;const n=new e.ResizeObserver(j);return n.observe(t),()=>n.disconnect()}),[j]);const R=M((()=>function(t,e,n){let r=0,o=0,i=null;function l(){r=0;const n=200-(t.Date.now()-o);var a;n>0?r=t.setTimeout(l,n):(a=i,i=null,e.apply(null,a))}return function(...e){o=t.Date.now(),i=e,r||(r=t.setTimeout(l,200))}}(h.current?ot(h.current):window,(()=>{null!==N.current&&N.current!==d&&u(N.current)}))),[d,u]);return y("div",{ref:h,onClick:c,onScroll:()=>{g.current?g.current=!1:((()=>{const t=h.current;if(!t)return;const e=function(t,e,n,r,o){const i=G(t,e,n);if(_(t,r[o],i))return o;for(let e=1;e<=r.length/2;e++){const n=z(o+e,r.length),l=z(o-e,r.length);if(_(t,r[n],i))return n;if(_(t,r[l],i))return l}}(o,n,t,t.children,w);f||(S.current=function(t,e,n,r){const o=G(t,e,r),i=G(t,e,n),{length:l}=P(t,r);return(o-i)/l}(o,n,t,t.children[e])),N.current=z(e-k.current,i.length)})(),R())},class:"scroll-container-f3d75e0 hide-scrollbar-f3d75e0 "+(0===o?"horizontal-scroll-f3d75e0":"vertical-scroll-f3d75e0"),tabIndex:0},B)}));Tt.displayName="Scroller";var Rt,Pt=["auto","lazy","eager","unload"],$t={auto:0,lazy:1,eager:2,unload:3};function Et(t,e){const n=$t[t]||0,r=$t[e]||0,o=Math.max(n,r);return Pt[o]}function Gt(){return Rt||(Rt=m({renderable:!0,playable:!0,loading:"auto"}))}function _t({children:t,loading:e="auto",notify:n,playable:r=!0,renderable:o=!0}){const i=B(Gt()),l=o&&i.renderable,a=l&&r&&i.playable,s=Et(l?"auto":"lazy",Et(e,i.loading)),c=n||i.notify,d=M((()=>({renderable:l,playable:a,loading:s,notify:c})),[l,a,s,c]);return y(Gt().Provider,{children:t,value:d})}var Ft=["advanceCount","arrowPrevAs","arrowNextAs","autoAdvance","autoAdvanceCount","autoAdvanceInterval","autoAdvanceLoops","children","controls","defaultSlide","dir","lightbox","loop","mixedLength","onClick","onFocus","onMouseEnter","onSlideChange","onTouchStart","orientation","outsetArrows","snap","snapAlign","snapBy","visibleCount","_thumbnails"],Vt={ALWAYS:"always",NEVER:"never",AUTO:"auto"},Wt={LTR:"ltr",RTL:"rtl",AUTO:"auto"},Ht=1e3,Zt=Mt(),Dt=q((function(t,e){var r,i;let{advanceCount:l=1,arrowPrevAs:a,arrowNextAs:s,autoAdvance:c=!1,autoAdvanceCount:d=1,autoAdvanceInterval:u=Ht,autoAdvanceLoops:f=Number.POSITIVE_INFINITY,children:b,controls:p=Vt.AUTO,defaultSlide:v=0,dir:h=Wt.AUTO,lightbox:w=!1,loop:g,mixedLength:C=!1,onClick:m,onFocus:N,onMouseEnter:j,onSlideChange:$,onTouchStart:E,orientation:G=R.HORIZONTAL,outsetArrows:_=!1,snap:F=!0,snapAlign:W=T.START,snapBy:Z=1,visibleCount:U=1,_thumbnails:K=!1}=t,Y=o(t,Ft);const q=M((()=>J(b)),[b]),{length:Q}=q,X=B(D),[tt,nt]=k(Math.min(Math.max(v,0),Q)),rt=null!==(r=X.currentSlide)&&void 0!==r?r:tt,it=null!==(i=X.setCurrentSlide)&&void 0!==i?i:nt,lt=K?tt:rt,at=K?nt:it,st=A(lt),ct=G==R.HORIZONTAL?0:1,[dt]=k(Zt);O((()=>{at(rt)}),[rt,at]);const{setSlides:ut,slides:ft}=X,bt=A(null),pt=A(null),vt=A(null),ht=A(0),wt=M((()=>Math.max(u,Ht)),[u]),gt=L((()=>!(ht.current+U/Q>=f||4!==At.current||(g||st.current+U<Q?(bt.current.advance(d),ht.current+=d/Q):(bt.current.advance(-st.current),ht.current=Math.ceil(ht.current)),0))),[d,f,Q,g,U]),yt=L((()=>bt.current.next()),[]),xt=L((()=>bt.current.prev()),[]);S((()=>{if(!c||!pt.current)return;const t=ot(pt.current),e=t.setInterval((()=>{gt()||t.clearInterval(e)}),wt);return()=>t.clearInterval(e)}),[gt,wt,c]);const Ct=L((t=>{Q<=0||isNaN(t)||(t=g?z(t,Q):Math.min(Math.max(t,0),Q-1),at(t),st.current!==t&&(st.current=t,$&&$(t)))}),[Q,g,at,$]);I(e,(()=>({goToSlide:t=>{At.current=0,Ct(t)},next:()=>{At.current=0,yt()},prev:()=>{At.current=0,xt()},get root(){return pt.current},get node(){return vt.current}})),[yt,xt,Ct]),S((()=>{!K&&ft&&ft.length!==q.length&&ut(q)}),[K,q,ut,ft]);const mt=t=>{if(g)return!1;if(lt+t<0)return!0;if(lt+U+t>Q)return!0;if(C&&t>0){if(!bt.current)return!1;const t=bt.current.node;if(!t||!t.children.length)return!1;const e=V(ct,t),n=function(t,e){return 0==t?e.offsetLeft:e.offetTop}(ct,t.children[lt]),{length:r}=P(ct,t);if(r!==e&&r+n>=e)return!0}return!1},At=A(4),kt=M((()=>p!==Vt.ALWAYS&&!_&&(p===Vt.NEVER||3===At.current)),[p,_]),[St,Ot]=k(h===Wt.RTL);return O((()=>{if(!pt.current||h!==Wt.AUTO)return;const t=pt.current.ownerDocument;t&&Ot(function(t){return"rtl"==(t.body.getAttribute("dir")||t.documentElement.getAttribute("dir")||"ltr")}(t))}),[h,Ot]),y(et,n({size:!0,layout:!0,paint:!0,contentStyle:{display:"flex",direction:St?Wt.RTL:Wt.LTR},ref:pt,onFocus:t=>{N&&N(t),At.current=1},onMouseEnter:t=>{j&&j(t),At.current=2},onTouchStart:t=>{E&&E(t),At.current=3},tabIndex:"0",wrapperClassName:"carousel-f3d75e0",contentRef:vt},Y),!kt&&y(H,{advance:xt,as:a,by:-l,disabled:mt(-1),outsetArrows:_,rtl:St}),y(Tt,{advanceCount:l,alignment:W,axis:ct,lightboxGroup:w&&"carousel"+dt,loop:g,mixedLength:C,onClick:m,restingIndex:lt,setRestingIndex:Ct,snap:F,snapBy:Z,ref:bt,visibleCount:C?1:U,_thumbnails:K},q.map(((t,e)=>{const{alt:r,"aria-label":o}=t.props;return y(_t,{caption:r||o,key:e,renderable:e==lt,playable:e==lt},x(t,n(n({},t.props),{},{thumbnailSrc:void 0})))}))),!kt&&y(H,{advance:yt,by:l,as:s,disabled:mt(1),outsetArrows:_,rtl:St}))}));Dt.displayName="BentoBaseCarousel";export{Dt as BentoBaseCarousel};
function t(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function e(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function n(n){for(var r=1;r<arguments.length;r++){var o=null!=arguments[r]?arguments[r]:{};r%2?e(Object(o),!0).forEach((function(e){t(n,e,o[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):e(Object(o)).forEach((function(t){Object.defineProperty(n,t,Object.getOwnPropertyDescriptor(o,t))}))}return n}var r={carousel:"carousel-f3d75e0",scrollContainer:"scroll-container-f3d75e0",hideScrollbar:"hide-scrollbar-f3d75e0",horizontalScroll:"horizontal-scroll-f3d75e0",verticalScroll:"vertical-scroll-f3d75e0",slideElement:"slide-element-f3d75e0",thumbnails:"thumbnails-f3d75e0",startAlign:"start-align-f3d75e0",centerAlign:"center-align-f3d75e0",enableSnap:"enable-snap-f3d75e0",disableSnap:"disable-snap-f3d75e0",slideSizing:"slide-sizing-f3d75e0",arrow:"arrow-f3d75e0",ltr:"ltr-f3d75e0",rtl:"rtl-f3d75e0",arrowPrev:"arrow-prev-f3d75e0",arrowNext:"arrow-next-f3d75e0",arrowDisabled:"arrow-disabled-f3d75e0",insetArrow:"inset-arrow-f3d75e0",outsetArrow:"outset-arrow-f3d75e0",defaultArrowButton:"default-arrow-button-f3d75e0",arrowBaseStyle:"arrow-base-style-f3d75e0",arrowFrosting:"arrow-frosting-f3d75e0",arrowBackdrop:"arrow-backdrop-f3d75e0",arrowBackground:"arrow-background-f3d75e0",arrowIcon:"arrow-icon-f3d75e0"};function o(t,e){if(null==t)return{};var n,r,o={},i=Object.keys(t);for(r=0;r<i.length;r++)n=i[r],e.indexOf(n)>=0||(o[n]=t[n]);return o}import{cloneElement as i,createContext as l,createElement as a,createRef as s}from"react";import{hydrate as c,render as d}from"react-dom";import{useCallback as u,useContext as f,useEffect as b,useImperativeHandle as p,useLayoutEffect as v,useMemo as h,useRef as w,useState as g}from"react";function y(t,e,n){return a.apply(void 0,arguments)}function x(t,e,n){return i.apply(void 0,arguments)}function C(t){return t.children}function m(t){return l(t,void 0)}function A(t){return g(t)}function k(t){return w(t)}function S(t,e){b(t,e)}function O(t,e){v(t,e)}function B(t){return f(t)}function M(t,e){return h(t,e)}function L(t,e){return u(t,e)}function I(t,e,n){return p(t,e,n)}var{hasOwnProperty:N,toString:j}=Object.prototype;function z(t,e){return t>0&&e>0?t%e:(t%e+e)%e}var T={START:"start",CENTER:"center"},R={HORIZONTAL:"horizontal",VERTICAL:"vertical"};function P(t,e){const{bottom:n,height:r,left:o,right:i,top:l,width:a}=e.getBoundingClientRect();return{start:Math.round(0==t?o:l),end:Math.round(0==t?i:n),length:Math.round(0==t?a:r)}}function $(t,e){const{end:n,start:r}=P(t,e);return(r+n)/2}function E(t,e){const{start:n}=P(t,e);return n}function G(t,e,n){return e==T.START?E(t,n):$(t,n)}function _(t,e,n){const{end:r,start:o}=P(t,e);return o<=n&&n<r}function F(t,e){return 0==t?e.scrollLeft:e.scrollTop}function V(t,e){return 0==t?e.scrollWidth:e.scrollHeight}function W(t,e,n,r,o=0){const i=e==T.START,{length:l}=P(t,r),a=i?E(t,r):$(t,r),s=i?E(t,n):$(t,n),c=Math.round(a-s-o*l);!function(t,e,n){!function(t,e,n){0==t?e.scrollLeft=n:e.scrollTop=n}(t,e,F(t,e)+n)}(t,n,c);const{length:d}=P(t,n),u=d+F(t,n)+c<V(t,n);return!!c&&u}function H({advance:t,as:e=Z,by:n,disabled:r,outsetArrows:o,rtl:i}){const l=L((()=>{r||t()}),[t,r]);return y(e,{"aria-disabled":String(!!r),by:n,class:"arrow-f3d75e0"+(r?" arrow-disabled-f3d75e0":"")+(n<0?" arrow-prev-f3d75e0":"")+(n>0?" arrow-next-f3d75e0":"")+(o?" outset-arrow-f3d75e0":"")+(o?"":" inset-arrow-f3d75e0")+(i?" rtl-f3d75e0":"")+(i?"":" ltr-f3d75e0"),disabled:r,onClick:l,outsetArrows:o,rtl:i.toString()})}function Z({"aria-disabled":t,by:e,"class":n,disabled:r,onClick:o}){return y("div",{class:n},y("button",{"aria-disabled":t,"aria-label":e<0?"Previous item in carousel":"Next item in carousel",class:"default-arrow-button-f3d75e0",disabled:r,onClick:o},y("div",{class:"arrow-base-style-f3d75e0 arrow-frosting-f3d75e0"}),y("div",{class:"arrow-base-style-f3d75e0 arrow-backdrop-f3d75e0"}),y("div",{class:"arrow-base-style-f3d75e0 arrow-background-f3d75e0"}),y("svg",{class:"arrow-icon-f3d75e0",viewBox:"0 0 24 24"},y("path",{d:e<0?"M14,7.4 L9.4,12 L14,16.6":"M10,7.4 L14.6,12 L10,16.6",fill:"none","stroke-width":"2px","stroke-linejoin":"round","stroke-linecap":"round"}))))}var D=m({slides:[],setSlides:t=>{}});import{Children as U,createPortal as K,forwardRef as Y}from"react";function q(t){return Y(t)}function J(t){return U.toArray.apply(void 0,arguments)}var Q=["as","children","class","contentAs","contentClassName","contentProps","contentRef","contentStyle","layout","paint","size","style","wrapperClassName","wrapperStyle"],X=[null,"paint","layout","content","size","size paint","size layout","strict"],tt={"position":"relative","width":"100%","height":"100%"},et=q((function(t,e){let{as:r="div",children:i,"class":l,contentAs:a="div",contentClassName:s,contentProps:c,contentRef:d,contentStyle:u,layout:f=!1,paint:b=!1,size:p=!1,"style":v,wrapperClassName:h,wrapperStyle:w}=t;const g=(p?4:0)+(f?2:0)+(b?1:0);return y(r,n(n({},o(t,Q)),{},{ref:e,class:`${l||""} ${h||""}`.trim()||null,style:n(n(n({},v),w),{},{contain:X[g]})}),y(a,n(n({},c),{},{ref:d,class:s,style:n(n({},p&&tt),{},{"overflow":b?"hidden":"visible"},u)}),i))})),nt=["as","children","class","style","wrapperClassName","wrapperStyle"];function rt(t){const e=k(null);return e.current=t,e}function ot(t){return(t.ownerDocument||t).defaultView}q((function(t,e){let{as:r="div",children:i,"class":l,"style":a,wrapperClassName:s,wrapperStyle:c}=t;return y(r,n(n({},o(t,nt)),{},{ref:e,class:`${l||""} ${s||""}`.trim()||null,style:n(n({},a),c)}),i)})),new WeakMap,new WeakMap;var it,lt={arrow:"arrow-d701172",auto:"auto-d701172",caption:"caption-d701172",captionText:"caption-text-d701172",clip:"clip-d701172",closeButton:"close-button-d701172",control:"control-d701172",controlsPanel:"controls-panel-d701172",expanded:"expanded-d701172",hideControls:"hide-controls-d701172",lightbox:"lightbox-d701172",gallery:"gallery-d701172",grid:"grid-d701172",nextArrow:"next-arrow-d701172",prevArrow:"prev-arrow-d701172",showControls:"show-controls-d701172",thumbnail:"thumbnail-d701172",topControl:"top-control-d701172"},at="control-d701172",st=m({deregister:()=>{},register:()=>{},open:()=>{}}),ct=["Webkit","webkit","Moz","moz","ms","O","o"];function dt(t,e,n,r,o){const i=function(t,e,n){if(ut(e))return e;it||(it=Object.create(null));let r=it[e];if(!r||n){if(r=e,void 0===t[e]){const n=function(t){return t.charAt(0).toUpperCase()+t.slice(1)}(e),o=function(t,e){for(let n=0;n<ct.length;n++){const r=ct[n]+e;if(void 0!==t[r])return r}return""}(t,n);void 0!==t[o]&&(r=o)}n||(it[e]=r)}return r}(t.style,e,o);if(!i)return;const l=r?n+r:n;ut(i)?t.style.setProperty(i,l):t.style[i]=l}function ut(t){return t.startsWith("--")}var ft,bt,pt,vt,ht,wt=["animation","children","closeButtonAs","onAfterClose","onAfterOpen","onBeforeOpen"],gt={"fade-in":[{opacity:0,visibility:"visible"},{opacity:1,visibility:"visible"}],"fly-in-top":[{opacity:0,transform:"translate(0,-100%)",visibility:"visible"},{opacity:1,transform:"translate(0, 0)",visibility:"visible"}],"fly-in-bottom":[{opacity:0,transform:"translate(0, 100%)",visibility:"visible"},{opacity:1,transform:"translate(0, 0)",visibility:"visible"}]},yt={"part":"scroller"},xt=q((function(t,e){let{animation:r="fade-in",children:i,closeButtonAs:l,onAfterClose:a,onAfterOpen:s,onBeforeOpen:c}=t,d=o(t,wt);const[u,f]=A(!1),[b,p]=A(!1),v=k(),h=rt(r),w=rt(c),g=rt(a),x=rt(s);return I(e,(()=>({open:()=>{var t;null===(t=w.current)||void 0===t||t.call(w),f(!0),p(!0)},close:()=>p(!1)})),[w]),O((()=>{const t=v.current;if(!t)return;let e;if(dt(t,"visibility",b?"hidden":"visible"),b){const n=()=>{var e;dt(t,"opacity",1),dt(t,"visibility","visible"),function(t){try{t.focus()}catch(t){}}(t),null===(e=x.current)||void 0===e||e.call(x)};if(!t.animate)return void n();e=t.animate(gt[h.current],{duration:200,fill:"both",easing:"ease-in"}),e.onfinish=n}else{const n=()=>{dt(t,"opacity",0),dt(t,"visibility","hidden"),g.current&&g.current(),e=null,f(!1)};if(!t.animate)return void n();e=t.animate(gt[h.current],{duration:200,direction:"reverse",fill:"both",easing:"ease-in"}),e.onfinish=n}return()=>{e&&e.cancel()}}),[b,h,g,x]),u&&y(et,n({ref:v,size:!0,layout:!0,paint:!0,part:"lightbox",contentClassName:"content-88b9dee",wrapperClassName:"wrapper-88b9dee",contentProps:yt,role:"dialog",tabIndex:"0",onKeyDown:t=>{"Escape"===t.key&&p(!1)}},d),y(Ct,{as:l,onClick:()=>p(!1)}),i)}));function Ct({onClick:t,as:e=mt}){return y(e,{"aria-label":"Close the modal",onClick:t})}function mt({"aria-label":t,onClick:e}){return y("button",{"aria-label":t,class:"close-button-88b9dee",onClick:e,tabIndex:-1})}xt.displayName="Lightbox";var At={"aria-label":"Toggle caption expanded state.","role":"button"};function kt({onClick:t}){return y("svg",{"aria-label":"Close the lightbox",class:at+" top-control-d701172 close-button-d701172",onClick:t,role:"button",tabIndex:"0",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},ft||(ft=y("path",{d:"M6.4 6.4 L17.6 17.6 Z M17.6 6.4 L6.4 17.6 Z",stroke:"#fff","stroke-width":"2","stroke-linejoin":"round"})))}function St({"aria-disabled":t,by:e,disabled:n,onClick:r}){return y("svg",{"aria-disabled":t,class:"arrow-d701172 "+at+(e<0?" prev-arrow-d701172":"")+(e>0?" next-arrow-d701172":""),disabled:n,onClick:r,role:"button",tabIndex:"0",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},y("path",{d:e<0?"M14,7.4 L9.4,12 L14,16.6":"M10,7.4 L14.6,12 L10,16.6",fill:"none",stroke:"#fff","stroke-width":"2","stroke-linejoin":"round","stroke-linecap":"round"}))}function Ot({onClick:t,showCarousel:e}){return y("svg",{"aria-label":e?"Switch to grid view":"Switch to carousel view",class:at+" top-control-d701172",onClick:t,role:"button",tabIndex:"0",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},e?bt||(bt=y("g",{fill:"#fff"},y("rect",{x:"3",y:"3",width:"6",height:"8",rx:"1",ry:"1"}),y("rect",{x:"15",y:"13",width:"6",height:"8",rx:"1",ry:"1"}),y("rect",{x:"11",y:"3",width:"10",height:"8",rx:"1",ry:"1"}),y("rect",{x:"3",y:"13",width:"10",height:"8",rx:"1",ry:"1"}))):y(C,null,pt||(pt=y("rect",{x:"4",y:"4",width:"16",height:"16",rx:"1","stroke-width":"2",stroke:"#fff",fill:"none"})),vt||(vt=y("circle",{fill:"#fff",cx:"15.5",cy:"8.5",r:"1.5"})),ht||(ht=y("polygon",{fill:"#fff",points:"5,19 5,13 8,10 13,15 16,12 19,15 19,19"}))))}function Bt({onClick:t,render:e}){return y("div",{"aria-label":"View in carousel",class:"thumbnail-d701172",onClick:t,role:"button",tabIndex:"0"},e())}function Mt(){let t=0;return()=>String(++t)}q((function({children:t,onAfterClose:e,onAfterOpen:r,onBeforeOpen:o,onToggleCaption:i,onViewGrid:l,render:a},s){const c=lt,d=k(null),u=k(null),[f,b]=A(0),p=k({}),v=k({}),h=k({}),w=k({}),g=k({}),[x,m]=A(!0),[S,B]=A(!0),[M,N]=A(null),j=L((t=>{const e=null!=t?t:Object.keys(p.current)[0];e&&(w.current[e]||(w.current[e]=[],g.current[e]=[],h.current[e]=0),p.current[e].forEach(((t,n)=>{if(!w.current[e][n]){const r=h.current[e];w.current[e][n]=t(),g.current[e][n]=y(Bt,{onClick:()=>{m(!0),b(r)},render:t}),h.current[e]+=1}})),N(e))}),[]),T=L(((t,e="default",n,r)=>{p.current[e]||(p.current[e]=[],v.current[e]=[]),p.current[e][t-1]=n,v.current[e][t-1]=r}),[]),R=L(((t,e="default")=>{delete p.current[e][t-1],delete v.current[e][t-1],delete w.current[e][t-1],h.current[e]--}),[]),P=L(((t,e)=>{var n;j(e),B(!0),m(!0),null!=t&&b(t),null===(n=d.current)||void 0===n||n.open()}),[j]),$={deregister:R,register:T,open:P},E=k(void 0),[G,_]=A(null),[F,V]=A("auto");return O((()=>{var t;if(null===(t=u.current)||void 0===t||t.goToSlide(f),M){const t=p.current[M].length-h.current[M]+z(f,h.current[M]);_(v.current[M][t]),V("auto")}}),[M,f]),O((()=>{var t;const{offsetHeight:e,scrollHeight:n}=null!==(t=E.current)&&void 0!==t?t:{};n>e+40&&V("clip")}),[G]),I(s,(()=>({open:P,close:()=>{var t;null===(t=d.current)||void 0===t||t.close()}})),[P]),y(C,null,y(xt,{class:"lightbox-d701172"+(S?" show-controls-d701172":"")+(S?"":" hide-controls-d701172"),closeButtonAs:kt,onBeforeOpen:o,onAfterOpen:r,onAfterClose:e,ref:d},y("div",{class:"controls-panel-d701172"},y(Ot,{onClick:()=>{x&&(null==l||l()),m(!x)},showCarousel:x})),y(Dt,{arrowPrevAs:St,arrowNextAs:St,class:"gallery-d701172",defaultSlide:z(f,h.current[M])||0,hidden:!x,loop:!0,onClick:()=>B(!S),onSlideChange:t=>b(t),ref:u},w.current[M]),y("div",n({hidden:!x,class:"caption-d701172 "+at+" "+c[F],ref:E},"auto"===F?null:n({onClick:()=>{null==i||i(),V("clip"===F?"expanded":"clip")}},At)),y("div",{class:"caption-text-d701172 amp-lightbox-gallery-caption",part:"caption"},G)),!x&&y("div",{class:"gallery-d701172 grid-d701172"},g.current[M])),y(st.Provider,{value:$},a?a():t))})).displayName="BentoLightboxGalleryProvider";var Lt=["alt","aria-label","as","caption","children","enableActivation","group","onMount","render","srcset"],It=Mt(),Nt={"aria-label":"Open content in a lightbox view.",role:"button",tabIndex:0},jt=t=>x(t);function zt(t){var e;let{alt:r,"aria-label":i,as:l="div",caption:a,children:s,enableActivation:c=!0,group:d,onMount:u,render:f,srcset:b}=t,p=o(t,Lt);const[v]=A(It),{deregister:h,open:w,register:g}=B(st),x=L((()=>f?f():s?J(s).map(jt):e||(e=y(l,{srcset:b}))),[s,f,b]),C=M((()=>a||r||i),[r,i,a]);O((()=>(g(v,d,x,C),()=>h(v,d))),[C,v,d,h,g,x]),O((()=>null==u?void 0:u(Number(v)-1)),[v,u]);const m=M((()=>c&&n(n({},Nt),{},{onClick:()=>{w(Number(v)-1,d)}})),[c,v,d,w]);return y(l,n(n({},m),{},{srcset:b},p),s)}var Tt=q((function({_thumbnails:t,advanceCount:e,alignment:n,axis:o,children:i,lightboxGroup:l,loop:a,mixedLength:s,onClick:c,restingIndex:d,setRestingIndex:u,snap:f,snapBy:b=1,visibleCount:p},v){const h=k(null),w=a?Math.floor(i.length/2):d,g=k(!1),x=L((t=>{const e=h.current;e&&(N.current=z(N.current+t,i.length),S.current=0,W(o,n,e,e.children[z(w+t,e.children.length)],S.current)||u(N.current))}),[n,o,i.length,w,u]);I(v,(()=>({advance:x,next:()=>x(e),prev:()=>x(-e),get node(){return h.current}})),[x,e]);const m=r,A=k(d),S=k(0),B=function({_thumbnails:t,alignment:e,children:n,lightboxGroup:r,loop:o,mixedLength:i,offsetRef:l,pivotIndex:a,restingIndex:s,snap:c,snapBy:d,visibleCount:u},f){const{length:b}=n,p=r?zt:"div",v=n.map(((n,o)=>{const l=`slide-${n.key||o}`;return y(p,{caption:n.props.caption,key:l,"data-slide":o,class:`${f.slideSizing} ${f.slideElement} ${c&&0===z(o,d)?f.enableSnap:f.disableSnap} ${e===T.CENTER?f.centerAlign:f.startAlign} ${t?f.thumbnails:""} `,group:r||void 0,part:"slide",style:{flex:i?"0 0 auto":`0 0 ${100/u}%`}},n)}));if(!o)return v;const h=[],w=[],g=z(b-s+a,b);if(s<=a)for(let t=0;t<g;t++)h.unshift(v.pop());else for(let t=0;t<b-g;t++)w.push(v.shift());return l.current=h.length?h.length:-w.length,y(C,null,h,v,w)}({alignment:n,children:i,loop:a,mixedLength:s,offsetRef:A,lightboxGroup:l,pivotIndex:w,restingIndex:d,snap:f,snapBy:b,visibleCount:p,_thumbnails:t},m),N=k(d),j=L((()=>{if(!h.current||!h.current.children.length)return;const t=h.current;dt(t,"scrollBehavior","auto"),g.current=!0,W(o,n,t,t.children[w],S.current),dt(t,"scrollBehavior","smooth")}),[n,o,w]);O((()=>{h.current&&a&&h.current.children.length&&j()}),[a,d,j]),O((()=>{if(!h.current)return;const t=h.current;if(!t)return;const e=ot(t);if(!e)return;const n=new e.ResizeObserver(j);return n.observe(t),()=>n.disconnect()}),[j]);const R=M((()=>function(t,e,n){let r=0,o=0,i=null;function l(){r=0;const n=200-(t.Date.now()-o);var a;n>0?r=t.setTimeout(l,n):(a=i,i=null,e.apply(null,a))}return function(...e){o=t.Date.now(),i=e,r||(r=t.setTimeout(l,200))}}(h.current?ot(h.current):window,(()=>{null!==N.current&&N.current!==d&&u(N.current)}))),[d,u]);return y("div",{ref:h,onClick:c,onScroll:()=>{g.current?g.current=!1:((()=>{const t=h.current;if(!t)return;const e=function(t,e,n,r,o){const i=G(t,e,n);if(_(t,r[o],i))return o;for(let e=1;e<=r.length/2;e++){const n=z(o+e,r.length),l=z(o-e,r.length);if(_(t,r[n],i))return n;if(_(t,r[l],i))return l}}(o,n,t,t.children,w);f||(S.current=function(t,e,n,r){const o=G(t,e,r),i=G(t,e,n),{length:l}=P(t,r);return(o-i)/l}(o,n,t,t.children[e])),N.current=z(e-A.current,i.length)})(),R())},class:"scroll-container-f3d75e0 hide-scrollbar-f3d75e0 "+(0===o?"horizontal-scroll-f3d75e0":"vertical-scroll-f3d75e0"),tabIndex:0},B)}));Tt.displayName="Scroller";var Rt,Pt=["auto","lazy","eager","unload"],$t={auto:0,lazy:1,eager:2,unload:3};function Et(t,e){const n=$t[t]||0,r=$t[e]||0,o=Math.max(n,r);return Pt[o]}function Gt(){return Rt||(Rt=m({renderable:!0,playable:!0,loading:"auto"}))}function _t({children:t,loading:e="auto",notify:n,playable:r=!0,renderable:o=!0}){const i=B(Gt()),l=o&&i.renderable,a=l&&r&&i.playable,s=Et(l?"auto":"lazy",Et(e,i.loading)),c=n||i.notify,d=M((()=>({renderable:l,playable:a,loading:s,notify:c})),[l,a,s,c]);return y(Gt().Provider,{children:t,value:d})}var Ft=["advanceCount","arrowPrevAs","arrowNextAs","autoAdvance","autoAdvanceCount","autoAdvanceInterval","autoAdvanceLoops","children","controls","defaultSlide","dir","lightbox","loop","mixedLength","onClick","onFocus","onMouseEnter","onSlideChange","onTouchStart","orientation","outsetArrows","snap","snapAlign","snapBy","visibleCount","_thumbnails"],Vt={ALWAYS:"always",NEVER:"never",AUTO:"auto"},Wt={LTR:"ltr",RTL:"rtl",AUTO:"auto"},Ht=1e3,Zt=Mt(),Dt=q((function(t,e){var r,i;let{advanceCount:l=1,arrowPrevAs:a,arrowNextAs:s,autoAdvance:c=!1,autoAdvanceCount:d=1,autoAdvanceInterval:u=Ht,autoAdvanceLoops:f=Number.POSITIVE_INFINITY,children:b,controls:p=Vt.AUTO,defaultSlide:v=0,dir:h=Wt.AUTO,lightbox:w=!1,loop:g,mixedLength:C=!1,onClick:m,onFocus:N,onMouseEnter:j,onSlideChange:$,onTouchStart:E,orientation:G=R.HORIZONTAL,outsetArrows:_=!1,snap:F=!0,snapAlign:W=T.START,snapBy:Z=1,visibleCount:U=1,_thumbnails:K=!1}=t,Y=o(t,Ft);const q=M((()=>J(b)),[b]),{length:Q}=q,X=B(D),[tt,nt]=A(Math.min(Math.max(v,0),Q)),rt=null!==(r=X.currentSlide)&&void 0!==r?r:tt,it=null!==(i=X.setCurrentSlide)&&void 0!==i?i:nt,lt=K?tt:rt,at=K?nt:it,st=k(lt),ct=G==R.HORIZONTAL?0:1,[dt]=A(Zt);O((()=>{at(rt)}),[rt,at]);const{setSlides:ut,slides:ft}=X,bt=k(null),pt=k(null),vt=k(null),ht=k(0),wt=M((()=>Math.max(u,Ht)),[u]),gt=L((()=>!(ht.current+U/Q>=f||4!==At.current||(g||st.current+U<Q?(bt.current.advance(d),ht.current+=d/Q):(bt.current.advance(-st.current),ht.current=Math.ceil(ht.current)),0))),[d,f,Q,g,U]),yt=L((()=>bt.current.next()),[]),xt=L((()=>bt.current.prev()),[]);S((()=>{if(!c||!pt.current)return;const t=ot(pt.current),e=t.setInterval((()=>{gt()||t.clearInterval(e)}),wt);return()=>t.clearInterval(e)}),[gt,wt,c]);const Ct=L((t=>{Q<=0||isNaN(t)||(t=g?z(t,Q):Math.min(Math.max(t,0),Q-1),at(t),st.current!==t&&(st.current=t,$&&$(t)))}),[Q,g,at,$]);I(e,(()=>({goToSlide:t=>{At.current=0,Ct(t)},next:()=>{At.current=0,yt()},prev:()=>{At.current=0,xt()},get root(){return pt.current},get node(){return vt.current}})),[yt,xt,Ct]),S((()=>{!K&&ft&&ft.length!==q.length&&ut(q)}),[K,q,ut,ft]);const mt=t=>{if(g)return!1;if(lt+t<0)return!0;if(lt+U+t>Q)return!0;if(C&&t>0){if(!bt.current)return!1;const t=bt.current.node;if(!t||!t.children.length)return!1;const e=V(ct,t),n=function(t,e){return 0==t?e.offsetLeft:e.offetTop}(ct,t.children[lt]),{length:r}=P(ct,t);if(r!==e&&r+n>=e)return!0}return!1},At=k(4),kt=M((()=>p!==Vt.ALWAYS&&!_&&(p===Vt.NEVER||3===At.current)),[p,_]),[St,Ot]=A(h===Wt.RTL);return O((()=>{if(!pt.current||h!==Wt.AUTO)return;const t=pt.current.ownerDocument;t&&Ot(function(t){return"rtl"==(t.body.getAttribute("dir")||t.documentElement.getAttribute("dir")||"ltr")}(t))}),[h,Ot]),y(et,n({size:!0,layout:!0,paint:!0,contentStyle:{display:"flex",direction:St?Wt.RTL:Wt.LTR},ref:pt,onFocus:t=>{N&&N(t),At.current=1},onMouseEnter:t=>{j&&j(t),At.current=2},onTouchStart:t=>{E&&E(t),At.current=3},tabIndex:"0",wrapperClassName:"carousel-f3d75e0",contentRef:vt},Y),!kt&&y(H,{advance:xt,as:a,by:-l,disabled:mt(-1),outsetArrows:_,rtl:St}),y(Tt,{advanceCount:l,alignment:W,axis:ct,lightboxGroup:w&&"carousel"+dt,loop:g,mixedLength:C,onClick:m,restingIndex:lt,setRestingIndex:Ct,snap:F,snapBy:Z,ref:bt,visibleCount:C?1:U,_thumbnails:K},q.map(((t,e)=>{const{alt:r,"aria-label":o}=t.props;return y(_t,{caption:r||o,key:e,renderable:e==lt,playable:e==lt},x(t,n(n({},t.props),{},{thumbnailSrc:void 0})))}))),!kt&&y(H,{advance:yt,by:l,as:s,disabled:mt(1),outsetArrows:_,rtl:St}))}));Dt.displayName="BentoBaseCarousel";export{Dt as BentoBaseCarousel};
/*! https://mths.be/cssescape v1.5.1 by @mathias | MIT license */
{
"name": "@ampproject/amp-base-carousel",
"version": "1.2110121825.0",
"version": "1.2110142235.0",
"description": "AMP HTML amp-base-carousel Component",

@@ -5,0 +5,0 @@ "author": "The AMP HTML Authors",

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc