kollapsminoriteten/wp-content/plugins/jetpack/_inc/blocks/swiper.js

1 line
155 KiB
JavaScript
Raw Normal View History

2026-03-31 11:30:59 +02:00
(()=>{"use strict";var e={49(e,t,s){s.d(t,{A:()=>n});var a=s(645),i=s(541),r=s(774);function n({swiper:e,extendParams:t,on:s}){t({a11y:{enabled:!0,notificationClass:"swiper-notification",prevSlideMessage:"Previous slide",nextSlideMessage:"Next slide",firstSlideMessage:"This is the first slide",lastSlideMessage:"This is the last slide",paginationBulletMessage:"Go to slide {{index}}",slideLabelMessage:"{{index}} / {{slidesLength}}",containerMessage:null,containerRoleDescriptionMessage:null,containerRole:null,itemRoleDescriptionMessage:null,slideRole:"group",id:null,scrollOnFocus:!0,wrapperLiveRegion:!0}}),e.a11y={clicked:!1};let n,l,o=null,d=(new Date).getTime();function c(e){const t=o;0!==t.length&&(0,r.s)(t,e)}function p(e){(e=(0,r.m)(e)).forEach(e=>{e.setAttribute("tabIndex","0")})}function u(e){(e=(0,r.m)(e)).forEach(e=>{e.setAttribute("tabIndex","-1")})}function m(e,t){(e=(0,r.m)(e)).forEach(e=>{e.setAttribute("role",t)})}function h(e,t){(e=(0,r.m)(e)).forEach(e=>{e.setAttribute("aria-roledescription",t)})}function f(e,t){(e=(0,r.m)(e)).forEach(e=>{e.setAttribute("aria-label",t)})}function g(e){(e=(0,r.m)(e)).forEach(e=>{e.setAttribute("aria-disabled",!0)})}function v(e){(e=(0,r.m)(e)).forEach(e=>{e.setAttribute("aria-disabled",!1)})}function w(t){if(13!==t.keyCode&&32!==t.keyCode)return;const s=e.params.a11y,a=t.target;if(!e.pagination||!e.pagination.el||a!==e.pagination.el&&!e.pagination.el.contains(t.target)||t.target.matches((0,i.c)(e.params.pagination.bulletClass))){if(e.navigation&&e.navigation.prevEl&&e.navigation.nextEl){const t=(0,r.m)(e.navigation.prevEl);(0,r.m)(e.navigation.nextEl).includes(a)&&(e.isEnd&&!e.params.loop||e.slideNext(),e.isEnd?c(s.lastSlideMessage):c(s.nextSlideMessage)),t.includes(a)&&(e.isBeginning&&!e.params.loop||e.slidePrev(),e.isBeginning?c(s.firstSlideMessage):c(s.prevSlideMessage))}e.pagination&&a.matches((0,i.c)(e.params.pagination.bulletClass))&&a.click()}}function b(){return e.pagination&&e.pagination.bullets&&e.pagination.bullets.length}function y(){return b()&&e.params.pagination.clickable}const E=(e,t,s)=>{p(e),"BUTTON"!==e.tagName&&(m(e,"button"),e.addEventListener("keydown",w)),f(e,s),function(e,t){(e=(0,r.m)(e)).forEach(e=>{e.setAttribute("aria-controls",t)})}(e,t)},x=t=>{l&&l!==t.target&&!l.contains(t.target)&&(n=!0),e.a11y.clicked=!0},S=()=>{n=!1,requestAnimationFrame(()=>{requestAnimationFrame(()=>{e.destroyed||(e.a11y.clicked=!1)})})},T=e=>{d=(new Date).getTime()},M=t=>{if(e.a11y.clicked||!e.params.a11y.scrollOnFocus)return;if((new Date).getTime()-d<100)return;const s=t.target.closest(`.${e.params.slideClass}, swiper-slide`);if(!s||!e.slides.includes(s))return;l=s;const a=e.virtual&&e.params.virtual.enabled,i=(a?parseInt(s.getAttribute("data-swiper-slide-index"),10):e.slides.indexOf(s))===e.activeIndex,r=e.params.watchSlidesProgress&&e.visibleSlides&&e.visibleSlides.includes(s);i||r||t.sourceCapabilities&&t.sourceCapabilities.firesTouchEvents||(e.isHorizontal()?e.el.scrollLeft=0:e.el.scrollTop=0,requestAnimationFrame(()=>{n||(e.params.loop?e.slideToLoop(e.getSlideIndexWhenGrid(parseInt(s.getAttribute("data-swiper-slide-index"))),0):a?e.slideTo(e.getSlideIndexWhenGrid(parseInt(s.getAttribute("data-swiper-slide-index"),10)),0):e.slideTo(e.getSlideIndexWhenGrid(e.slides.indexOf(s)),0),n=!1)}))},C=()=>{const t=e.params.a11y;t.itemRoleDescriptionMessage&&h(e.slides,t.itemRoleDescriptionMessage),t.slideRole&&m(e.slides,t.slideRole);const s=e.slides.length;t.slideLabelMessage&&e.slides.forEach((a,i)=>{const r=e.params.loop?parseInt(a.getAttribute("data-swiper-slide-index"),10):i;f(a,t.slideLabelMessage.replace(/\{\{index\}\}/,r+1).replace(/\{\{slidesLength\}\}/,s))})},P=()=>{const t=e.params.a11y;e.el.append(o);const s=e.el;t.containerRoleDescriptionMessage&&h(s,t.containerRoleDescriptionMessage),t.containerMessage&&f(s,t.containerMessage),t.containerRole&&m(s,t.containerRole);const i=e.wrapperEl,n=t.id||i.getAttribute("id")||`swiper-wrapper-${function(e=16){return"x".repeat(e).replace(/x/g,()=>Math.round(16*Math.random()).toString(16))}(16)}`;var l,d;if(l=i,d=n,(l=(0,r.m)(l))