2 lines
168 KiB
JavaScript
2 lines
168 KiB
JavaScript
|
|
(()=>{var e,t={6942:(e,t)=>{var a;!function(){"use strict";var l={}.hasOwnProperty;function i(){for(var e="",t=0;t<arguments.length;t++){var a=arguments[t];a&&(e=r(e,o(a)))}return e}function o(e){if("string"==typeof e||"number"==typeof e)return e;if("object"!=typeof e)return"";if(Array.isArray(e))return i.apply(null,e);if(e.toString!==Object.prototype.toString&&!e.toString.toString().includes("[native code]"))return e.toString();var t="";for(var a in e)l.call(e,a)&&e[a]&&(t=r(t,a));return t}function r(e,t){return t?e?e+" "+t:e+t:e}e.exports?(i.default=i,e.exports=i):void 0===(a=function(){return i}.apply(t,[]))||(e.exports=a)}()},7816:(e,t,a)=>{"use strict";const l=window.kadence.icons;var i=a(6942),o=a.n(i);const r=window.lodash,n=window.React;var s=a.n(n);const d=window.ReactJSXRuntime;var c=Object.defineProperty,u=Object.defineProperties,g=Object.getOwnPropertyDescriptors,m=Object.getOwnPropertySymbols,h=Object.prototype.hasOwnProperty,p=Object.prototype.propertyIsEnumerable,b=(e,t,a)=>t in e?c(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,k=(e,t)=>{for(var a in t||(t={}))h.call(t,a)&&b(e,a,t[a]);if(m)for(var a of m(t))p.call(t,a)&&b(e,a,t[a]);return e},y=(e,t)=>u(e,g(t)),f=(e,t)=>t.filter(e),v=(e,t)=>e.top===t.top?e.left<t.left?-1:1:e.top<t.top?-1:1;function x({stone:e,availableSpots:t,containerSize:a}){let l=(({availableSpots:e,stone:t})=>function(e,t){for(let a=0,l=t.length;a<l;a++){let l=t[a];if(e(l))return l}return null}(e=>((e,t)=>{let a=e.right-e.left>=t.width;if(!e.bottom)return a;let l=e.bottom-e.top>=t.height;return a&&l})(e,t),e))({availableSpots:t,stone:e}),i={left:l.left,top:l.top},o=(({availableSpots:e,optimalSpot:t,containerSize:a,stone:l})=>{let i={right:a,top:t.top+l.height,left:t.left};t.bottom&&(i.bottom=t.bottom);for(let t=0,a=e.length;t<a;t+=1){let a=e[t];if(i.left<a.left&&i.top<a.top){i.right=a.left;break}}return i})({optimalSpot:l,availableSpots:t.filter(e=>e!==l),stone:e,containerSize:a}),r=[...t,o],n=(({spots:e,position:t,optimalSpot:a,stone:l})=>e.map((e,i,o)=>{if(e===a)return(({stone:e,position:t,spotsList:a,optimalSpot:l})=>{let i=k({},l);return i.left=t.left+e.width,(e=>e.right-e.left<5||e.bottom&&e.bottom-e.top<5)(i)||(({spotsList:e,usedSpot:t})=>e.some(e=>e!==t&&t.left===e.left))({usedSpot:i,spotsList:a})?null:i})({stone:l,position:t,optimalSpot:a,spotsList:o});let r=(({position:e,spot:t,stone:a})=>{if(e.left>t.left&&t.right>=e.left&&e.top+a.height>t.top){if(t.bottom&&t.bottom<e.top)return t;let a=k({},t);return a.right=e.left,a}return null})({position:t,spot:e,stone:l});if(r)return r;let n=(({position:e,stone:t,spot:a})=>{if(e.left+t.width>a.left&&e.top>=a.top){if(a.bottom&&a.bottom<e.top||a.right<e.left)return a;let t=k({},a);return t.bottom=e.top,t}return null})({position:t,stone:l,spot:e});return n||e}))({spots:r,position:i,optimalSpot:l,stone:e});return r=[...f(Boolean,n)],r=(e=>((e,t)=>[...t].sort(e))(v,e))(r),{position:i,availableSpots:r}}var w=e=>({fade:`${e}ms opacity ease`,fadeMove:`\n ${e}ms opacity ease,\n ${e}ms top ease,\n ${e}ms left ease\n `,move:`\n ${e}ms top ease,\n ${e}ms left ease\n `}),_=({style:e,position:t,transition:a,transitionDuration:l})=>k(k(y(k({},e),{position:"absolute"}),(e=>e?y(k({},e),{opacity:1}):{opacity:0,top:0,left:0})(t)),(({transition:e,transitionDuration:t})=>e?{transition:w(t)[e]}:null)({transition:a,transitionDuration:l})),C=e=>{var t=e,{children:a,style:l,transition:i=!1,transitionDuration:o=500,transitionStep:r=50}=t,s=((e,t)=>{var a={};for(var l in e)h.call(e,l)&&t.indexOf(l)<0&&(a[l]=e[l]);if(null!=e&&m)for(var l of m(e))t.indexOf(l)<0&&p.call(e,l)&&(a[l]=e[l]);return a})(t,["children","style","transition","transitionDuration","transitionStep"]);let c=(0,n.useRef)([]),u=(0,n.useRef)(null),g=(()=>{let[e,t]=(0,n.useState)(),a=(0,n.useRef)(function(e){let t;return function(...a){t&&clearTimeout(t),t=setTimeout(function(){t=null,e.apply(null,a)},300)}}(t));return(0,n.useEffect)(()=>{let e=()=>{a.current(window.innerWidth)};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}}
|
||
|
|
(0,Ka.__)("image %1$d of %2$d in gallery","kadence-blocks"),t+1,$t.length),o=l?Y:N;return(0,d.jsx)("div",{className:"kadence-blocks-gallery-item-inner",children:(0,d.jsx)(Ya,{thumbUrl:e.thumbUrl,url:e.url,width:e.width,height:e.height,lightUrl:e.lightUrl,alt:e.alt,id:e.id,index:t,link:e.link,linkTo:b,isFirstItem:0===t,isLastItem:t+1===$t.length,isSelected:a&&dt===t,onMoveBackward:()=>{var e;0!==(e=t)&&ht(e,e-1)},onMoveForward:()=>{var e;(e=t)!==te.length-1&&ht(e,e+1)},onRemove:()=>{(e=>{const t=(0,r.filter)(te,(t,a)=>e!==a);ct(null),mt({imagesDynamic:t})})(t)},onSelect:e=>{(e=>{dt!==e&&ct(e)})(e)},setAttributes:e=>{((e,t)=>{te[e]&&(te[e].id&&((e,t)=>{const a=new window.FormData;(0,r.forEach)(t,(e,t)=>a.append(t,e)),Ha()({path:"/wp/v2/media/"+e,body:a,method:"POST"})})(te[e].id,t),c({imagesDynamic:[...te.slice(0,e),{...te[e],...t},...te.slice(e+1)]}))})(t,e)},caption:e.caption,customLink:e.customLink,linkTarget:e.linkTarget,linkSponsored:e.linkSponsored,setLinkAttributes:e=>{((e,t)=>{te[e]&&c({imagesDynamic:[...te.slice(0,e),{...te[e],...t},...te.slice(e+1)]})})(t,e)},showCaption:f,captionStyles:v,captionStyle:$,"aria-label":i,imageRatio:o,type:_,thumbnail:l,dynamicSource:He,previewDevice:Ue})})};return(0,d.jsxs)("div",{...nt,children:[(0,d.jsx)(S.SpacingVisualizer,{type:"outsideVertical",forceShow:Rt.isMouseOver,spacing:[(0,j.getSpacingOptionOutput)(We,Ke),(0,j.getSpacingOptionOutput)(Ge,Ke),(0,j.getSpacingOptionOutput)(Ve,Ke),(0,j.getSpacingOptionOutput)(qe,Ke)]}),(0,d.jsx)(S.SpacingVisualizer,{style:{marginLeft:void 0!==qe?(0,j.getSpacingOptionOutput)(qe,Ke):void 0,marginRight:void 0!==Ge?(0,j.getSpacingOptionOutput)(Ge,Ke):void 0},type:"inside",forceShow:zt.isMouseOver,spacing:[(0,j.getSpacingOptionOutput)(Xe,Ie),(0,j.getSpacingOptionOutput)(Ze,Ie),(0,j.getSpacingOptionOutput)(Je,Ie),(0,j.getSpacingOptionOutput)(Ye,Ie)]}),aa,qt,Zt,i,f&&v[0].google&&(0,d.jsx)(S.WebfontLoader,{config:Ht}),_&&"fluidcarousel"===_&&(0,d.jsxs)("div",{id:`kb-gallery-id-${m}`,style:st,className:la,children:[(0,d.jsxs)("div",{className:`kt-blocks-carousel kt-blocks-fluid-carousel kt-carousel-container-dotstyle-${A}${!1===X?" kb-carousel-mode-align-left":""}`,children:[1!==$t.length&&(0,d.jsx)(Aa,{options:It,className:`splide kt-carousel-arrowstyle-${B} kt-carousel-dotstyle-${A} kb-slider-group-${"center"!==ge&&"outside-top-center"!==ge&&"outside-bottom-center"!==ge?"arrows":"arrow"} kb-slider-arrow-position-${ge}`,children:$t.map((e,t)=>(0,d.jsx)(Da,{className:"kadence-blocks-gallery-item",children:ia(e,t)},e.id||e.url))}),1===$t.length&&$t.map((e,t)=>(0,d.jsx)("div",{className:"kadence-blocks-gallery-item",children:ia(e,t)},e.id||e.url))]}),P&&De&&(0,d.jsx)("button",{className:"kb-gallery-pause-button",style:ta(),onClick:e=>e.preventDefault(),"aria-label":(0,Ka.__)("Pause carousel","kadence-blocks"),children:(0,d.jsxs)("svg",{className:"kb-gallery-pause-icon",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,d.jsx)("rect",{x:"6",y:"4",width:"4",height:"16",fill:"currentColor"}),(0,d.jsx)("rect",{x:"14",y:"4",width:"4",height:"16",fill:"currentColor"})]})})]}),_&&"slider"===_&&(0,d.jsxs)("div",{className:la,style:st,children:[(0,d.jsxs)("div",{className:`kt-blocks-carousel kt-blocks-slider kt-carousel-container-dotstyle-${A}`,children:[1!==$t.length&&(0,d.jsx)(Aa,{options:Kt,className:`splide kt-carousel-arrowstyle-${B} kt-carousel-dotstyle-${A} kb-slider-group-${"center"!==ge&&"outside-top-center"!==ge&&"outside-bottom-center"!==ge?"arrows":"arrow"} kb-slider-arrow-position-${ge}`,children:$t.map((e,t)=>(0,d.jsx)(Da,{className:"kadence-blocks-gallery-item",children:ia(e,t)},e.id||e.url))}),1===$t.length&&$t.map((e,t)=>(0,d.jsx)("div",{className:"kadence-blocks-gallery-item",children:ia(e,t)},e.id||e.url))]}),P&&De&&(0,d.jsx)("button",{className:"kb-gallery-pause-button",style:ta(),onClick:e=>e.preventDefault(),"aria-label":(0,Ka.__)("Pause carousel","kadence-blocks"),children:(0,d.jsxs)("svg",{className:"kb-gallery-pause-icon",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"h
|