(()=>{"use strict";const e=window.wp.blocks,a=window.React,t=window.wp.blockEditor,i=window.wp.components,l=window.wp.i18n,s=["core/image"],n=[["core/image",{url:"",alt:(0,l.__)("Image 1","vitalisite-fse")}],["core/image",{url:"",alt:(0,l.__)("Image 2","vitalisite-fse")}],["core/image",{url:"",alt:(0,l.__)("Image 3","vitalisite-fse")}],["core/image",{url:"",alt:(0,l.__)("Image 4","vitalisite-fse")}]],o=JSON.parse('{"UU":"vitalisite-fse/slider"}');(0,e.registerBlockType)(o.UU,{edit:function({attributes:e,setAttributes:o}){const{showNavigation:r,showPagination:c,autoplayDelay:p,enableLoop:d}=e,m=(0,t.useBlockProps)({className:"vitalisite-slider-wrapper"});return(0,a.createElement)(a.Fragment,null,(0,a.createElement)(t.InspectorControls,null,(0,a.createElement)(i.PanelBody,{title:(0,l.__)("Paramètres du slider","vitalisite-fse")},(0,a.createElement)(i.ToggleControl,{label:(0,l.__)("Afficher la navigation","vitalisite-fse"),checked:r,onChange:e=>o({showNavigation:e}),help:(0,l.__)("Afficher les flèches de navigation","vitalisite-fse")}),(0,a.createElement)(i.ToggleControl,{label:(0,l.__)("Afficher la pagination","vitalisite-fse"),checked:c,onChange:e=>o({showPagination:e}),help:(0,l.__)("Afficher les points de pagination","vitalisite-fse")}),(0,a.createElement)(i.ToggleControl,{label:(0,l.__)("Activer la boucle","vitalisite-fse"),checked:d,onChange:e=>o({enableLoop:e}),help:(0,l.__)("Revenir au début quand la dernière image est atteinte","vitalisite-fse")}),(0,a.createElement)(i.RangeControl,{label:(0,l.__)("Délai autoplay (ms)","vitalisite-fse"),value:p,onChange:e=>o({autoplayDelay:e}),min:1e3,max:1e4,step:500,help:(0,l.__)("Temps en millisecondes entre chaque slide","vitalisite-fse")}))),(0,a.createElement)("div",{...m},(0,a.createElement)("div",{className:"vitalisite-slider swiper"},(0,a.createElement)("div",{className:"swiper-wrapper editor-preview"},(0,a.createElement)(t.InnerBlocks,{allowedBlocks:s,template:n,templateLock:!1,renderAppender:t.InnerBlocks.ButtonBlockAppender})))))},save:function({attributes:e}){const{showNavigation:i,showPagination:l,autoplayDelay:s,enableLoop:n}=e,o=t.useBlockProps.save({className:"vitalisite-slider-wrapper"});return(0,a.createElement)("div",{...o},(0,a.createElement)("div",{className:"vitalisite-slider swiper","data-show-navigation":i,"data-show-pagination":l,"data-autoplay-delay":s,"data-enable-loop":n},(0,a.createElement)("div",{className:"swiper-wrapper"},(0,a.createElement)(t.InnerBlocks.Content,null))))}})})();