From b7fe1dc650b69bd04ea279bb2baaf370a82f61da Mon Sep 17 00:00:00 2001 From: coder-karen Date: Thu, 9 Jan 2025 08:57:45 +0000 Subject: [PATCH] Tiled Gallery: Ensure container enclosing image is selectable (#40779) Committed via a GitHub action: https://github.com/Automattic/jetpack/actions/runs/12686397153 Upstream-Ref: Automattic/jetpack@83ca14901d61ddd99f8264a832ea432dd876f48b --- CHANGELOG.md | 1 + _inc/blocks/editor-beta.asset.php | 2 +- _inc/blocks/editor-beta.js | 2 +- _inc/blocks/editor-experimental.asset.php | 2 +- _inc/blocks/editor-experimental.js | 2 +- _inc/blocks/editor-no-post-editor.asset.php | 2 +- _inc/blocks/editor-no-post-editor.js | 2 +- _inc/blocks/editor.asset.php | 2 +- _inc/blocks/editor.js | 2 +- 9 files changed, 9 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e8dbffc497..6027757acc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ This is an alpha version! The changes listed here are not final. - Authors widget: Fix saving of unchecked "Display all authors" checkbox in the legacy widget editor. - Fix custom roles settings are not sticking for Jetpack Stats - Testimonials: fix a shortcode related bug which ccurs if the column attribute is added and set to 0 +- Tiled Gallery block: ensure movement and close icons are visible when selecting image in editor, by changing focusable element. ### Other changes - Jetpack AI: Enable ratings feedback thumbs for all diff --git a/_inc/blocks/editor-beta.asset.php b/_inc/blocks/editor-beta.asset.php index fe59cde53c..f787068256 100644 --- a/_inc/blocks/editor-beta.asset.php +++ b/_inc/blocks/editor-beta.asset.php @@ -1 +1 @@ - array('jetpack-connection', 'jetpack-script-data', 'lodash', 'moment', 'react', 'react-dom', 'react-jsx-runtime', 'wp-a11y', 'wp-api-fetch', 'wp-blob', 'wp-block-editor', 'wp-block-serialization-default-parser', 'wp-blocks', 'wp-commands', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-date', 'wp-dom-ready', 'wp-edit-post', 'wp-editor', 'wp-element', 'wp-escape-html', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-keycodes', 'wp-media-utils', 'wp-notices', 'wp-plugins', 'wp-polyfill', 'wp-primitives', 'wp-rich-text', 'wp-token-list', 'wp-url', 'wp-viewport', 'wp-widgets', 'wp-wordcount'), 'version' => '5aef48dcff1aa6b5fec3'); + array('jetpack-connection', 'jetpack-script-data', 'lodash', 'moment', 'react', 'react-dom', 'react-jsx-runtime', 'wp-a11y', 'wp-api-fetch', 'wp-blob', 'wp-block-editor', 'wp-block-serialization-default-parser', 'wp-blocks', 'wp-commands', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-date', 'wp-dom-ready', 'wp-edit-post', 'wp-editor', 'wp-element', 'wp-escape-html', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-keycodes', 'wp-media-utils', 'wp-notices', 'wp-plugins', 'wp-polyfill', 'wp-primitives', 'wp-rich-text', 'wp-token-list', 'wp-url', 'wp-viewport', 'wp-widgets', 'wp-wordcount'), 'version' => 'f8c9019eefc3ed4aa6e4'); diff --git a/_inc/blocks/editor-beta.js b/_inc/blocks/editor-beta.js index 500394e300..ce203c3b52 100644 --- a/_inc/blocks/editor-beta.js +++ b/_inc/blocks/editor-beta.js @@ -104,7 +104,7 @@ __("image %1$d of %2$d in gallery","jetpack"),t+1,n.length);return(0,r.createEle __("image %1$d of %2$d in gallery","jetpack"),t+1,o.length),{src:m,srcSet:h}=(0,c.A)(e,{layoutStyle:u});return(0,r.createElement)(l.A,{alt:e.alt,"aria-label":p,columns:n,height:e.height,id:e.id,imageFilter:a,isFirstItem:0===t,isLastItem:t+1===o.length,isSelected:d===t,key:t,link:e.link,linkTo:i,origUrl:e.url,showMovers:o.length>1,srcSet:h,url:m,width:e.width})}render(){const{align:e,children:t,className:n,columns:a,images:s,layoutStyle:l,roundedCorners:p}=this.props,m=(0,c.s)(l)?d.A:u.A,h=this.props.images.map(this.renderImage,this),g=l!==i.aQ?Math.min(p,i.WN):0;return(0,r.createElement)("div",{className:(0,o.A)(n,{[`has-rounded-corners-${g}`]:g>0})},(0,r.createElement)(m,{align:e,columns:a,images:s,layoutStyle:l,renderedImages:h}),t)}}},84255:(e,t,n)=>{"use strict";n.d(t,{A:()=>c});var r=n(82170),a=n(86087),s=n(84394),o=n(38548),i=n(70954),l=n(89195);class c extends a.Component{gallery=(0,a.createRef)();pendingRaf=null;render(){const{align:e,columns:t,images:n,layoutStyle:a,renderedImages:c}=this.props,u=(0,l.mJ)(n),d="columns"===a?(0,l.FL)(u,t):(0,l.VU)(u,{isWide:["full","wide"].includes(e)});let p=0;return(0,r.createElement)(o.A,{galleryRef:this.gallery},d.map(((e,t)=>(0,r.createElement)(i.A,{key:t},e.map(((e,t)=>{const n=c.slice(p,p+e);return p+=e,(0,r.createElement)(s.A,{key:t},n)}))))))}}},89195:(e,t,n)=>{"use strict";n.d(t,{FL:()=>o,VU:()=>A,mJ:()=>a});var r=n(66087);function a(e){return(0,r.map)(e,s)}function s({height:e,width:t}){return e&&t?t/e:1}function o(e,t){if(e.length<=t)return[Array(e.length).fill(1)];const n=(0,r.sum)(e)/t,a=[];let s=e,o=0;for(let e=0;e{const r=o<=(e+1)*n;return r&&(o+=t),r})).length;a.push(t),s=(0,r.drop)(s,t)}return a.push(s.length),[a]}const i=x([2,1,2],5),l=j([S,S,N,S,S]),c=j([S,S,S,N,S,S,S]),u=x([3,1,3],5),d=j([N,S,S,N]),p=x([1,2,1],5),m=j([N,S,S,S]),h=x([1,3],3),g=j([S,S,S,N]),f=x([3,1],3),v=j([P(1.6),(0,r.overEvery)(R(.9),P(2)),(0,r.overEvery)(R(.9),P(2))]),b=x([1,2],3),k=x([1,1,1,1,1],1),y=x([1,1,1,1],1),E=x([1,1,1],3),w=j([(0,r.overEvery)(R(.9),P(2)),(0,r.overEvery)(R(.9),P(2)),P(1.6)]),_=x([2,1],3),C=j([function(e){return e>=2}]);function A(e,{isWide:t}={}){const n=(e,a)=>{if(!a.length)return e;let s;s=a.length>15&&l(a)&&i(e)?[2,1,2]:a.length>15&&c(a)&&u(e)?[3,1,3]:5!==a.length&&d(a)&&p(e)?[1,2,1]:m(a)&&h(e)?[1,3]:g(a)&&f(e)?[3,1]:v(a)&&b(e)?[1,2]:t&&(5===a.length||10!==a.length&&a.length>6)&&k(e)&&(0,r.sum)((0,r.take)(a,5))<5?[1,1,1,1,1]:function(e,t){const n=(0,r.sum)((0,r.take)(t,4));return y(e)&&n<3.5&&t.length>5||n<7&&4===t.length}(e,a)?[1,1,1,1]:function(e,t,n){const a=(0,r.sum)((0,r.take)(t,3));return t.length>=3&&4!==t.length&&6!==t.length&&E(e)&&(a<2.5||a<5&&t.length>=3&&t[0]===t[2]||n)}(e,a,t)?[1,1,1]:w(a)&&_(e)?[2,1]:C(a)?[1]:a.length>3?[1,1]:Array(a.length).fill(1);const o=e.concat([s]),A=(0,r.sum)(s),x=a.slice(A);return n(o,x)};return n([],e)}function x(e,t){return n=>!(0,r.some)((0,r.takeRight)(n,t),(t=>(0,r.isEqual)(t,e)))}function j(e){return t=>t.length>=e.length&&(0,r.every)((0,r.zipWith)(e,t.slice(0,e.length),((e,t)=>e(t))))}function S(e){return e>=1&&e<2}function N(e){return e<1}function R(e){return t=>t>=e}function P(e){return t=>t{"use strict";n.d(t,{A:()=>s});var r=n(82170),a=n(13022);function s({children:e,className:t}){return(0,r.createElement)("div",{className:(0,a.A)("tiled-gallery__row",t)},e)}},73856:(e,t,n)=>{"use strict";n.d(t,{A:()=>c});var r=n(82170),a=n(66087),s=n(43566),o=n(84394),i=n(38548),l=n(70954);function c({columns:e,renderedImages:t}){const n=Math.min(s.ZS,e),c=t.length%n;return(0,r.createElement)(i.A,null,[...c?[(0,a.take)(t,c)]:[],...(0,a.chunk)((0,a.drop)(t,c),n)].map(((e,t)=>(0,r.createElement)(l.A,{key:t,className:`columns-${e.length}`},e.map(((e,t)=>(0,r.createElement)(o.A,{key:t},e)))))))}},14294:(e,t,n)=>{"use strict";n.d(t,{A:()=>l});var r=n(82170),a=n(90907),s=n(43566),o=n(65378);function i(e){return Math.min(3,e.images.length)}function l({attributes:e}){const{imageFilter:t,images:n}=e;if(!n.length)return null;const{align:l,className:c,columns:u=i(e),linkTo:d,roundedCorners:p}=e;return(0,r.createElement)(o.A,{align:l,className:c,columns:u,imageFilter:t,images:n,isSave:!0,layoutStyle:(0,a.D)(s.kc,c),linkTo:d,roundedCorners:p})}},24549:(e,t,n)=>{"use strict";n.d(t,{A:()=>l,s:()=>i});var r=n(63162),a=n(66087),s=n(14936),o=n(43566);function i(e){return["circle","square"].includes(e)}function l(e,t={}){if(!e.height||!e.url||!e.width)return{};if((0,r.isBlobURL)(e.url)||/^https?:\/\/localhost/.test(e.url)||/^https?:\/\/.*\.local\//.test(e.url))return{src:e.url};const n=e.url.split("?",1)[0],{height:l,width:u}=e,{layoutStyle:d}=t,p=function(e){const{host:t}=new URL(e,window.location.href);return/\.files\.wordpress\.com$/.test(t)}(n)||!0===function(){if("undefined"!=typeof jetpack_plan&&"vip"===jetpack_plan.data)return!0}()?c:s.A;let m;if(i(d)&&u&&l){const e=Math.min(o.rK,u,l);m=p(n,{resize:`${e},${e}`})}else m=p(n);let h;if(i(d)){const e=Math.min(600,u,l),t=Math.min(o.rK,u,l);h=(0,a.range)(e,t,300).map((e=>{const t=p(n,{resize:`${e},${e}`,strip:"info"});return t?`${t} ${e}w`:null})).filter(Boolean).join(",")}else{const e=Math.min(600,u),t=Math.min(o.rK,u);h=(0,a.range)(e,t,300).map((e=>{const t=p(n,{strip:"info",width:e});return t?`${t} ${e}w`:null})).filter(Boolean).join(",")}return Object.assign({src:m},h&&{srcSet:h})}function c(e,t={}){const n={width:"w",height:"h",letterboxing:"lb",removeLetterboxing:"ulb"},r=Object.assign(new URL(e,window.location.href),{username:"",password:"",port:"",search:"",hash:""});for(const[e,a]of Object.entries(t))r.searchParams.set(Object.hasOwn(n,e)?n[e]:e,a);return r.toString()}},60041:(e,t,n)=>{"use strict";n.d(t,{T$:()=>i,WN:()=>a,ZS:()=>r,aQ:()=>o,kc:()=>l,rK:()=>s});const r=20,a=20,s=2e3,o="circle",i="rectangular",l=[{isDefault:!0,name:i},{name:o},{name:"square"},{name:"columns"}]},64300:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var r=n(82170),a=n(63162),s=n(13022);function o(e){const{alt:t,imageFilter:n,height:o,id:i,link:l,linkTo:c,origUrl:u,url:d,width:p}=e;if((0,a.isBlobURL)(u))return null;let m;switch(c){case"media":m=d;break;case"attachment":m=l}const h=(0,r.createElement)("img",{alt:t,"data-height":o,"data-id":i,"data-link":l,"data-url":u,"data-width":p,src:d});return(0,r.createElement)("figure",{className:(0,s.A)("tiled-gallery__item",{[`filter__${n}`]:!!n})},m?(0,r.createElement)("a",{href:m},h):h)}},52516:(e,t,n)=>{"use strict";n.r(t),n.d(t,{attributes:()=>s,migrate:()=>i,save:()=>a.A,supports:()=>o});var r=n(60041),a=n(28635);const s={align:{default:"center",type:"string"},className:{default:`is-style-${r.T$}`,type:"string"},columns:{type:"number"},columnWidths:{default:[],type:"array"},ids:{default:[],type:"array"},imageFilter:{type:"string"},images:{type:"array",default:[],source:"query",selector:".tiled-gallery__item",query:{alt:{attribute:"alt",default:"",selector:"img",source:"attribute"},height:{attribute:"data-height",selector:"img",source:"attribute",type:"number"},id:{attribute:"data-id",selector:"img",source:"attribute"},link:{attribute:"data-link",selector:"img",source:"attribute"},url:{attribute:"data-url",selector:"img",source:"attribute"},width:{attribute:"data-width",selector:"img",source:"attribute",type:"number"}}},linkTo:{default:"none",type:"string"},roundedCorners:{type:"integer",default:0}},o={align:["center","wide","full"],customClassName:!1,html:!1},i=e=>{const t=Math.pow(10,5);return{...e,columnWidths:e.columnWidths.map((e=>e.map((e=>Math.round(e*t)/t))))}}},54001:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var r=n(82170);function a({children:e,width:t}){const n=Math.pow(10,12),a=Math.round(t*n)/n,s=t?{flexBasis:`${a}%`}:void 0;return(0,r.createElement)("div",{className:"tiled-gallery__col",style:s},e)}},99309:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var r=n(82170);function a({children:e,galleryRef:t}){return(0,r.createElement)("div",{className:"tiled-gallery__gallery",ref:t},e)}},77511:(e,t,n)=>{"use strict";n.d(t,{A:()=>p});var r=n(82170),a=n(86087),s=n(27723),o=n(13022),i=n(60041),l=n(64300),c=n(13014),u=n(56420),d=n(65216);const __=s.__;class p extends a.Component{renderImage(e,t){const{columns:n,imageFilter:a,images:o,isSave:i,linkTo:u,layoutStyle:d,onMoveBackward:p,onMoveForward:m,onRemoveImage:h,onSelectImage:g,selectedImage:f,setImageAttributes:v}=this.props,b=(0,s.sprintf)(/* translators: %1$d is the order number of the image, %2$d is the total number of images. */ __("image %1$d of %2$d in gallery","jetpack"),t+1,o.length),{src:k,srcSet:y}=(0,c.A)(e,{layoutStyle:d});return(0,r.createElement)(l.A,{alt:e.alt,"aria-label":b,columns:n,height:e.height,id:e.id,imageFilter:a,isFirstItem:0===t,isLastItem:t+1===o.length,isSelected:f===t,key:t,link:e.link,linkTo:u,onMoveBackward:i?void 0:p(t),onMoveForward:i?void 0:m(t),onRemove:i?void 0:h(t),onSelect:i?void 0:g(t),origUrl:e.url,setAttributes:i?void 0:v(t),showMovers:o.length>1,srcSet:y,url:k,width:e.width})}render(){const{align:e,children:t,className:n,columns:a,images:s,layoutStyle:l,roundedCorners:p,onResize:m,isSave:h,columnWidths:g}=this.props,f=(0,c.s)(l)?d.A:u.A,v=this.props.images.map(this.renderImage,this),b=l!==i.aQ?Math.min(p,i.WN):0;return(0,r.createElement)("div",{className:(0,o.A)(n,{[`has-rounded-corners-${b}`]:b>0})},(0,r.createElement)(f,{align:e,columns:a,columnWidths:h?g:void 0,images:s,layoutStyle:l,renderedImages:v,onResize:h?void 0:m}),t)}}},56420:(e,t,n)=>{"use strict";n.d(t,{A:()=>c});var r=n(82170),a=n(86087),s=n(54001),o=n(99309),i=n(46479),l=n(70394);class c extends a.Component{gallery=(0,a.createRef)();pendingRaf=null;render(){const{align:e,columns:t,images:n,layoutStyle:a,renderedImages:c,columnWidths:u}=this.props,d=(0,l.mJ)(n),p="columns"===a?(0,l.FL)(d,t):(0,l.VU)(d,{isWide:["full","wide"].includes(e)});let m=0;return(0,r.createElement)(o.A,{galleryRef:this.gallery},p.map(((e,t)=>(0,r.createElement)(i.A,{key:t},e.map(((e,n)=>{const a=c.slice(m,m+e);return m+=e,(0,r.createElement)(s.A,{key:n,width:u?.[t]?.[n]},a)}))))))}}},70394:(e,t,n)=>{"use strict";n.d(t,{FL:()=>o,VU:()=>A,mJ:()=>a});var r=n(66087);function a(e){return(0,r.map)(e,s)}function s({height:e,width:t}){return e&&t?t/e:1}function o(e,t){if(e.length<=t)return[Array(e.length).fill(1)];const n=(0,r.sum)(e)/t,a=[];let s=e,o=0;for(let e=0;e{const r=o<=(e+1)*n;return r&&(o+=t),r})).length;a.push(t),s=(0,r.drop)(s,t)}return a.push(s.length),[a]}const i=x([2,1,2],5),l=j([S,S,N,S,S]),c=j([S,S,S,N,S,S,S]),u=x([3,1,3],5),d=j([N,S,S,N]),p=x([1,2,1],5),m=j([N,S,S,S]),h=x([1,3],3),g=j([S,S,S,N]),f=x([3,1],3),v=j([P(1.6),(0,r.overEvery)(R(.9),P(2)),(0,r.overEvery)(R(.9),P(2))]),b=x([1,2],3),k=x([1,1,1,1,1],1),y=x([1,1,1,1],1),E=x([1,1,1],3),w=j([(0,r.overEvery)(R(.9),P(2)),(0,r.overEvery)(R(.9),P(2)),P(1.6)]),_=x([2,1],3),C=j([function(e){return e>=2}]);function A(e,{isWide:t}={}){const n=(e,a)=>{if(!a.length)return e;let s;s=a.length>15&&l(a)&&i(e)?[2,1,2]:a.length>15&&c(a)&&u(e)?[3,1,3]:5!==a.length&&d(a)&&p(e)?[1,2,1]:m(a)&&h(e)?[1,3]:g(a)&&f(e)?[3,1]:v(a)&&b(e)?[1,2]:t&&(5===a.length||10!==a.length&&a.length>6)&&k(e)&&(0,r.sum)((0,r.take)(a,5))<5?[1,1,1,1,1]:function(e,t){const n=(0,r.sum)((0,r.take)(t,4));return y(e)&&n<3.5&&t.length>5||n<7&&4===t.length}(e,a)?[1,1,1,1]:function(e,t,n){const a=(0,r.sum)((0,r.take)(t,3));return t.length>=3&&4!==t.length&&6!==t.length&&E(e)&&(a<2.5||a<5&&t.length>=3&&t[0]===t[2]||n)}(e,a,t)?[1,1,1]:w(a)&&_(e)?[2,1]:C(a)?[1]:a.length>3?[1,1]:Array(a.length).fill(1);const o=e.concat([s]),A=(0,r.sum)(s),x=a.slice(A);return n(o,x)};return n([],e)}function x(e,t){return n=>!(0,r.some)((0,r.takeRight)(n,t),(t=>(0,r.isEqual)(t,e)))}function j(e){return t=>t.length>=e.length&&(0,r.every)((0,r.zipWith)(e,t.slice(0,e.length),((e,t)=>e(t))))}function S(e){return e>=1&&e<2}function N(e){return e<1}function R(e){return t=>t>=e}function P(e){return t=>t{"use strict";n.d(t,{A:()=>s});var r=n(82170),a=n(13022);function s({children:e,className:t}){return(0,r.createElement)("div",{className:(0,a.A)("tiled-gallery__row",t)},e)}},65216:(e,t,n)=>{"use strict";n.d(t,{A:()=>c});var r=n(82170),a=n(66087),s=n(60041),o=n(54001),i=n(99309),l=n(46479);function c({columns:e,renderedImages:t}){const n=Math.min(s.ZS,e),c=t.length%n;return(0,r.createElement)(i.A,null,[...c?[(0,a.take)(t,c)]:[],...(0,a.chunk)((0,a.drop)(t,c),n)].map(((e,t)=>(0,r.createElement)(l.A,{key:t,className:`columns-${e.length}`},e.map(((e,t)=>(0,r.createElement)(o.A,{key:t},e)))))))}},28635:(e,t,n)=>{"use strict";n.d(t,{A:()=>l});var r=n(82170),a=n(90907),s=n(60041),o=n(77511);function i(e){return Math.min(3,e.images.length)}function l({attributes:e}){const{imageFilter:t,images:n}=e;if(!n.length)return null;const{align:l,className:c,columns:u=i(e),linkTo:d,roundedCorners:p,columnWidths:m}=e;return(0,r.createElement)(o.A,{align:l,className:c,columns:u,imageFilter:t,images:n,isSave:!0,layoutStyle:(0,a.D)(s.kc,c),linkTo:d,roundedCorners:p,columnWidths:m})}},13014:(e,t,n)=>{"use strict";n.d(t,{A:()=>l,s:()=>i});var r=n(63162),a=n(66087),s=n(14936),o=n(60041);function i(e){return["circle","square"].includes(e)}function l(e,t={}){if(!e.height||!e.url||!e.width)return{};if((0,r.isBlobURL)(e.url)||/^https?:\/\/localhost/.test(e.url)||/^https?:\/\/.*\.local\//.test(e.url))return{src:e.url};const n=e.url.split("?",1)[0],{height:l,width:u}=e,{layoutStyle:d}=t,p=function(e){const{host:t}=new URL(e,window.location.href);return/\.files\.wordpress\.com$/.test(t)}(n)||!0===function(){if("undefined"!=typeof jetpack_plan&&"vip"===jetpack_plan.data)return!0}()?c:s.A;let m;if(i(d)&&u&&l){const e=Math.min(o.rK,u,l);m=p(n,{resize:`${e},${e}`})}else m=p(n);let h;if(i(d)){const e=Math.min(600,u,l),t=Math.min(o.rK,u,l);h=(0,a.range)(e,t,300).map((e=>{const t=p(n,{resize:`${e},${e}`,strip:"info"});return t?`${t} ${e}w`:null})).filter(Boolean).join(",")}else{const e=Math.min(600,u),t=Math.min(o.rK,u);h=(0,a.range)(e,t,300).map((e=>{const t=p(n,{strip:"info",width:e});return t?`${t} ${e}w`:null})).filter(Boolean).join(",")}return Object.assign({src:m},h&&{srcSet:h})}function c(e,t={}){const n={width:"w",height:"h",letterboxing:"lb",removeLetterboxing:"ulb"},r=Object.assign(new URL(e,window.location.href),{username:"",password:"",port:"",search:"",hash:""});for(const[e,a]of Object.entries(t))r.searchParams.set(Object.hasOwn(n,e)?n[e]:e,a);return r.toString()}},86136:(e,t,n)=>{"use strict";n.d(t,{T$:()=>l,WN:()=>s,ZS:()=>a,aQ:()=>i,hE:()=>r,kc:()=>c,rK:()=>o});const r=4,a=20,s=20,o=2e3,i="circle",l="rectangular",c=[{isDefault:!0,name:l},{name:i},{name:"square"},{name:"columns"}]},92431:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var r=n(82170),a=n(63162),s=n(13022);function o(e){const{alt:t,imageFilter:n,height:o,id:i,link:l,linkTo:c,origUrl:u,url:d,width:p}=e;if((0,a.isBlobURL)(u))return null;let m;switch(c){case"media":m=d;break;case"attachment":m=l}const h=(0,r.createElement)("img",{alt:t,"data-height":o,"data-id":i,"data-link":l,"data-url":u,"data-width":p,src:d,"data-amp-layout":"responsive"});return(0,r.createElement)("figure",{className:(0,s.A)("tiled-gallery__item",{[`filter__${n}`]:!!n})},m?(0,r.createElement)("a",{href:m},h):h)}},24753:(e,t,n)=>{"use strict";n.r(t),n.d(t,{attributes:()=>s,save:()=>a.A,supports:()=>o});var r=n(86136),a=n(21180);const s={align:{default:"center",type:"string"},className:{default:`is-style-${r.T$}`,type:"string"},columns:{type:"number"},columnWidths:{default:[],type:"array"},ids:{default:[],type:"array"},imageFilter:{type:"string"},images:{type:"array",default:[],source:"query",selector:".tiled-gallery__item",query:{alt:{attribute:"alt",default:"",selector:"img",source:"attribute"},height:{attribute:"data-height",selector:"img",source:"attribute",type:"number"},id:{attribute:"data-id",selector:"img",source:"attribute"},link:{attribute:"data-link",selector:"img",source:"attribute"},url:{attribute:"data-url",selector:"img",source:"attribute"},width:{attribute:"data-width",selector:"img",source:"attribute",type:"number"}}},imageCrop:{type:"boolean",default:!0},linkTo:{default:"none",type:"string"},roundedCorners:{type:"integer",default:0}},o={align:["center","wide","full"],color:{gradients:!0,text:!1},customClassName:!1,html:!1,spacing:{margin:!0,padding:!0},__experimentalHideChildBlockControls:!0}},78608:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var r=n(82170);function a({children:e,width:t}){const n=t?{flexBasis:`${t}%`}:void 0;return(0,r.createElement)("div",{className:"tiled-gallery__col",style:n},e)}},52042:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var r=n(82170);function a({children:e,galleryRef:t}){return(0,r.createElement)("div",{className:"tiled-gallery__gallery",ref:t},e)}},26092:(e,t,n)=>{"use strict";n.d(t,{A:()=>p});var r=n(82170),a=n(86087),s=n(27723),o=n(13022),i=n(86136),l=n(92431),c=n(32083),u=n(91341),d=n(67325);const __=s.__;class p extends a.Component{renderImage(e,t){const{columns:n,imageFilter:a,images:o,isSave:i,linkTo:u,layoutStyle:d,onMoveBackward:p,onMoveForward:m,onRemoveImage:h,onSelectImage:g,selectedImage:f,setImageAttributes:v}=this.props,b=(0,s.sprintf)(/* translators: %1$d is the order number of the image, %2$d is the total number of images. */ __("image %1$d of %2$d in gallery","jetpack"),t+1,o.length),{src:k,srcSet:y}=(0,c.A)(e,{layoutStyle:d});return(0,r.createElement)(l.A,{alt:e.alt,"aria-label":b,columns:n,height:e.height,id:e.id,imageFilter:a,isFirstItem:0===t,isLastItem:t+1===o.length,isSelected:f===t,key:t,link:e.link,linkTo:u,onMoveBackward:i?void 0:p(t),onMoveForward:i?void 0:m(t),onRemove:i?void 0:h(t),onSelect:i?void 0:g(t),origUrl:e.url,setAttributes:i?void 0:v(t),showMovers:o.length>1,srcSet:y,url:k,width:e.width})}render(){const{align:e,children:t,className:n,columns:a,images:s,layoutStyle:l,roundedCorners:p,onResize:m,style:h,isSave:g,columnWidths:f}=this.props,v=(0,c.s)(l)?d.A:u.A,b=this.props.images.map(this.renderImage,this),k=l!==i.aQ?Math.min(p,i.WN):0;return(0,r.createElement)("div",{style:h,className:(0,o.A)(n,{[`has-rounded-corners-${k}`]:k>0})},(0,r.createElement)(v,{align:e,columns:a,columnWidths:g?f:void 0,images:s,layoutStyle:l,renderedImages:b,onResize:g?void 0:m}),t)}}},91341:(e,t,n)=>{"use strict";n.d(t,{A:()=>d});var r=n(82170),a=n(86087),s=n(94107),o=n(78608),i=n(52042),l=n(9276),c=n(71245),u=n(86461);class d extends a.Component{gallery=(0,a.createRef)();pendingRaf=null;ro=null;componentDidMount(){this.observeResize()}componentWillUnmount(){this.unobserveResize()}componentDidUpdate(e){(e.images!==this.props.images||e.align!==this.props.align||"columns"===this.props.layoutStyle&&e.columns!==this.props.columns)&&this.triggerResize()}handleGalleryResize=e=>{this.pendingRaf&&(cancelAnimationFrame(this.pendingRaf),this.pendingRaf=null),this.pendingRaf=requestAnimationFrame((()=>{for(const{contentRect:t,target:n}of e){const{width:e}=t,r=[];(0,u.S)(n).forEach((t=>{r.push((0,u.r)(t,e))})),void 0!==this.props.onResize&&this.props.onResize(r)}}))};triggerResize(){this.gallery.current&&this.handleGalleryResize([{target:this.gallery.current,contentRect:{width:this.gallery.current.clientWidth}}])}observeResize(){this.triggerResize(),this.ro=new s.A(this.handleGalleryResize),this.gallery.current&&this.ro.observe(this.gallery.current)}unobserveResize(){this.ro&&(this.ro.disconnect(),this.ro=null),this.pendingRaf&&(cancelAnimationFrame(this.pendingRaf),this.pendingRaf=null)}getColumnWidths(e,t,n){let r=0;return e.map((e=>e.map((e=>{const n=t.slice(r,r+e);return r+=e,n})))).map((e=>(0,u.r)(e,n)))}render(){const{align:e,columns:t,images:n,layoutStyle:s,renderedImages:u}=this.props,d=(0,c.mJ)(n),p="columns"===s?(0,c.FL)(d,t):(0,c.VU)(d,{isWide:["full","wide"].includes(e)}),m=a.Platform.select({web:()=>this.props.columnWidths,native:()=>this.getColumnWidths(p,u,1e3)})();let h=0;return(0,r.createElement)(i.A,{galleryRef:this.gallery},p.map(((e,t)=>(0,r.createElement)(l.A,{key:t},e.map(((e,n)=>{const a=u.slice(h,h+e);return h+=e,(0,r.createElement)(o.A,{key:n,width:m?.[t]?.[n]},a)}))))))}}},71245:(e,t,n)=>{"use strict";n.d(t,{FL:()=>o,VU:()=>A,mJ:()=>a});var r=n(66087);function a(e){return(0,r.map)(e,s)}function s({height:e,width:t}){return e&&t?t/e:1}function o(e,t){if(e.length<=t)return[Array(e.length).fill(1)];const n=(0,r.sum)(e)/t,a=[];let s=e,o=0;for(let e=0;e{const r=o<=(e+1)*n;return r&&(o+=t),r})).length;a.push(t),s=(0,r.drop)(s,t)}return a.push(s.length),[a]}const i=x([2,1,2],5),l=j([S,S,N,S,S]),c=j([S,S,S,N,S,S,S]),u=x([3,1,3],5),d=j([N,S,S,N]),p=x([1,2,1],5),m=j([N,S,S,S]),h=x([1,3],3),g=j([S,S,S,N]),f=x([3,1],3),v=j([P(1.6),(0,r.overEvery)(R(.9),P(2)),(0,r.overEvery)(R(.9),P(2))]),b=x([1,2],3),k=x([1,1,1,1,1],1),y=x([1,1,1,1],1),E=x([1,1,1],3),w=j([(0,r.overEvery)(R(.9),P(2)),(0,r.overEvery)(R(.9),P(2)),P(1.6)]),_=x([2,1],3),C=j([function(e){return e>=2}]);function A(e,{isWide:t}={}){const n=(e,a)=>{if(!a.length)return e;let s;s=a.length>15&&l(a)&&i(e)?[2,1,2]:a.length>15&&c(a)&&u(e)?[3,1,3]:5!==a.length&&d(a)&&p(e)?[1,2,1]:m(a)&&h(e)?[1,3]:g(a)&&f(e)?[3,1]:v(a)&&b(e)?[1,2]:t&&(5===a.length||10!==a.length&&a.length>6)&&k(e)&&(0,r.sum)((0,r.take)(a,5))<5?[1,1,1,1,1]:function(e,t){const n=(0,r.sum)((0,r.take)(t,4));return y(e)&&n<3.5&&t.length>5||n<7&&4===t.length}(e,a)?[1,1,1,1]:function(e,t,n){const a=(0,r.sum)((0,r.take)(t,3));return t.length>=3&&4!==t.length&&6!==t.length&&E(e)&&(a<2.5||a<5&&t.length>=3&&t[0]===t[2]||n)}(e,a,t)?[1,1,1]:w(a)&&_(e)?[2,1]:C(a)?[1]:a.length>3?[1,1]:Array(a.length).fill(1);const o=e.concat([s]),A=(0,r.sum)(s),x=a.slice(A);return n(o,x)};return n([],e)}function x(e,t){return n=>!(0,r.some)((0,r.takeRight)(n,t),(t=>(0,r.isEqual)(t,e)))}function j(e){return t=>t.length>=e.length&&(0,r.every)((0,r.zipWith)(e,t.slice(0,e.length),((e,t)=>e(t))))}function S(e){return e>=1&&e<2}function N(e){return e<1}function R(e){return t=>t>=e}function P(e){return t=>t{"use strict";n.d(t,{S:()=>o,r:()=>s});var r=n(86136);function a(e,t){const n=(t-e.reduce(((e,t)=>e+t),0))/e.length;return e.map((e=>e+n))}function s(e,t){return function(e,[t,n],s){const o=1/t*(s-r.hE*(e.childElementCount-1)-n);return function(e,{rawHeight:t,rowWidth:n}){const s=i(e),o=s.map((e=>(t-r.hE*(e.childElementCount-1))*c(e)[0])),d=a(o,n);s.forEach(((e,n)=>{const s=o[n],i=d[n];!function(e,{colHeight:t,width:n,rawWidth:r}){const s=l(e).map((e=>r/u(e))),o=a(s,t);Array.from(e.children).forEach(((e,t)=>{const r=o[t];e.setAttribute("style",`height:${r}px;width:${n}px;`)}))}(e,{colHeight:t-r.hE*(e.childElementCount-1),width:i,rawWidth:s})}));return d.map((e=>parseFloat(e/n*100).toFixed(5)))}(e,{rawHeight:o,rowWidth:s-r.hE*(e.childElementCount-1)})}(e,function(e){const t=i(e).map(c).reduce((([e,t],[n,r])=>[e+n,t+r]),[0,0]);return t}(e),t)}function o(e){return Array.from(e.querySelectorAll(".tiled-gallery__row"))}function i(e){return Array.from(e.querySelectorAll(".tiled-gallery__col"))}function l(e){return Array.from(e.querySelectorAll(".tiled-gallery__item > img, .tiled-gallery__item > a > img"))}function c(e){const t=l(e),n=t.length,r=1/t.map(u).reduce(((e,t)=>e+1/t),0);return[r,r*n||1]}function u(e){const t=parseInt(e.dataset.width,10),n=parseInt(e.dataset.height,10);return t&&!Number.isNaN(t)&&n&&!Number.isNaN(n)?t/n:1}},9276:(e,t,n)=>{"use strict";n.d(t,{A:()=>s});var r=n(82170),a=n(13022);function s({children:e,className:t}){return(0,r.createElement)("div",{className:(0,a.A)("tiled-gallery__row",t)},e)}},67325:(e,t,n)=>{"use strict";n.d(t,{A:()=>c});var r=n(82170),a=n(66087),s=n(86136),o=n(78608),i=n(52042),l=n(9276);function c({columns:e,renderedImages:t}){const n=Math.min(s.ZS,e),c=t.length%n;return(0,r.createElement)(i.A,null,[...c?[(0,a.take)(t,c)]:[],...(0,a.chunk)((0,a.drop)(t,c),n)].map(((e,t)=>(0,r.createElement)(l.A,{key:t,className:`columns-${e.length}`},e.map(((e,t)=>(0,r.createElement)(o.A,{key:t},e)))))))}},21180:(e,t,n)=>{"use strict";n.d(t,{A:()=>l});var r=n(82170),a=n(90907),s=n(86136),o=n(26092);function i(e){return Math.min(3,e.images.length)}function l({attributes:e}){const{imageFilter:t,images:n}=e;if(!n.length)return null;const{align:l,className:c,columns:u=i(e),linkTo:d,roundedCorners:p,columnWidths:m}=e;return(0,r.createElement)(o.A,{align:l,className:c,columns:u,imageFilter:t,images:n,isSave:!0,layoutStyle:(0,a.D)(s.kc,c),linkTo:d,roundedCorners:p,columnWidths:m})}},32083:(e,t,n)=>{"use strict";n.d(t,{A:()=>u,s:()=>c});var r=n(85985),a=n(63162),s=n(66087),o=n(14936),i=n(13087),l=n(86136);function c(e){return["circle","square"].includes(e)}function u(e,t={}){if(!e.height||!e.width)return e.url?{src:e.url}:{};if((0,i.A)())return{src:e.url};if((0,a.isBlobURL)(e.url)||/^https?:\/\/localhost/.test(e.url)||/^https?:\/\/.*\.local\//.test(e.url)||(0,r.d9)()&&(0,r.pP)())return{src:e.url};const n=e.url.split("?",1)[0],{height:u,width:p}=e,{layoutStyle:m}=t,h=function(e){const{host:t}=new URL(e,window.location.href);return/\.files\.wordpress\.com$/.test(t)}(n)||!0===function(){if("undefined"!=typeof jetpack_plan&&"vip"===jetpack_plan.data)return!0}()?d:o.A;let g;if(c(m)&&p&&u){const e=Math.min(l.rK,p,u);g=h(n,{resize:`${e},${e}`})}else g=h(n);let f;if(c(m)){const e=Math.min(600,p,u),t=Math.min(l.rK,p,u);f=(0,s.range)(e,t,300).map((e=>{const t=h(n,{resize:`${e},${e}`,strip:"info"});return t?`${t} ${e}w`:null})).filter(Boolean).join(",")}else{const e=Math.min(600,p),t=Math.min(l.rK,p);f=(0,s.range)(e,t,300).map((e=>{const t=h(n,{strip:"info",width:e});return t?`${t} ${e}w`:null})).filter(Boolean).join(",")}return Object.assign({src:g},f&&{srcSet:f})}function d(e,t={}){const n={width:"w",height:"h",letterboxing:"lb",removeLetterboxing:"ulb"},r=Object.assign(new URL(e,window.location.href),{username:"",password:"",port:"",search:"",hash:""});for(const[e,a]of Object.entries(t))r.searchParams.set(Object.hasOwn(n,e)?n[e]:e,a);return r.toString()}},60601:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});const r={align:{type:"string",default:"center"},className:{type:"string",default:"is-style-rectangular"},columns:{type:"number"},columnWidths:{type:"array",default:[]},ids:{type:"array",default:[]},imageFilter:{type:"string"},images:{type:"array",default:[],source:"query",selector:".tiled-gallery__item",query:{alt:{attribute:"alt",default:"",selector:"img",source:"attribute"},height:{attribute:"data-height",type:"number",selector:"img",source:"attribute"},id:{attribute:"data-id",selector:"img",source:"attribute"},link:{attribute:"data-link",selector:"img",source:"attribute"},url:{attribute:"data-url",selector:"img",source:"attribute"},width:{attribute:"data-width",selector:"img",source:"attribute",type:"number"}}},imageCrop:{type:"boolean",default:!0},linkTo:{default:"none",type:"string"},roundedCorners:{type:"integer",default:0}}},62554:(e,t,n)=>{"use strict";n.r(t),n.d(t,{attributes:()=>r.A,save:()=>s.A,supports:()=>a.A});var r=n(60601),a=n(2500),s=n(64129)},64129:(e,t,n)=>{"use strict";n.d(t,{A:()=>c});var r=n(82170),a=n(94715),s=n(90907),o=n(35463),i=n(29520),l=n(10309);function c({attributes:e}){const{imageFilter:t,images:n}=e;if(!n.length)return null;const{align:c,className:u,columns:d=(0,i.EB)(e),linkTo:p,roundedCorners:m,columnWidths:h}=e,g=a.useBlockProps.save();return(0,r.createElement)("div",g,(0,r.createElement)(l.A,{align:c,className:u,columns:d,imageFilter:t,images:n,isSave:!0,layoutStyle:(0,s.D)(o.kc,u),linkTo:p,roundedCorners:m,columnWidths:h}))}},2500:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});const r={align:["center","wide","full"],color:{gradients:!0,text:!1},customClassName:!1,html:!1,spacing:{margin:!0,padding:!0},__experimentalHideChildBlockControls:!0}},92990:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});const r={align:{type:"string",default:"center"},className:{type:"string",default:"is-style-rectangular"},columns:{type:"number"},columnWidths:{type:"array",default:[]},ids:{type:"array",default:[]},imageFilter:{type:"string"},images:{type:"array",default:[],source:"query",selector:".tiled-gallery__item",query:{alt:{attribute:"alt",default:"",selector:"img",source:"attribute"},height:{attribute:"data-height",type:"number",selector:"img",source:"attribute"},id:{attribute:"data-id",selector:"img",source:"attribute"},link:{attribute:"data-link",selector:"img",source:"attribute"},url:{attribute:"data-url",selector:"img",source:"attribute"},width:{attribute:"data-width",selector:"img",source:"attribute",type:"number"}}},imageCrop:{type:"boolean",default:!0},linkTo:{default:"none",type:"string"},roundedCorners:{type:"integer",default:0}}},41314:(e,t,n)=>{"use strict";n.d(t,{WN:()=>a,ZS:()=>r,aQ:()=>o,rK:()=>s});const r=20,a=20,s=2e3,o="circle"},7957:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var r=n(82170),a=n(63162),s=n(13022);function o(e){const{alt:t,imageFilter:n,height:o,id:i,link:l,linkTo:c,origUrl:u,url:d,width:p}=e;if((0,a.isBlobURL)(u))return null;let m;switch(c){case"media":m=u;break;case"attachment":m=l}const h=(0,r.createElement)("img",{alt:t,"data-height":o,"data-id":i,"data-link":l,"data-url":u,"data-width":p,src:d,"data-amp-layout":"responsive"});return(0,r.createElement)("figure",{className:(0,s.A)("tiled-gallery__item",{[`filter__${n}`]:!!n})},m?(0,r.createElement)("a",{href:m},h):h)}},59679:(e,t,n)=>{"use strict";n.r(t),n.d(t,{attributes:()=>r.A,save:()=>s.A,supports:()=>a.A});var r=n(92990),a=n(93951),s=n(91162)},89798:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var r=n(82170);function a({children:e,width:t}){const n=Math.pow(10,12),a=Math.round(t*n)/n,s=t?{flexBasis:`${a}%`}:void 0;return(0,r.createElement)("div",{className:"tiled-gallery__col",style:s},e)}},38448:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var r=n(82170);function a({children:e,galleryRef:t}){return(0,r.createElement)("div",{className:"tiled-gallery__gallery",ref:t},e)}},6454:(e,t,n)=>{"use strict";n.d(t,{A:()=>p});var r=n(82170),a=n(86087),s=n(27723),o=n(13022),i=n(41314),l=n(7957),c=n(52537),u=n(62579),d=n(58711);const __=s.__;class p extends a.Component{renderImage(e,t){const{columns:n,imageFilter:a,images:o,isSave:i,linkTo:u,layoutStyle:d,onMoveBackward:p,onMoveForward:m,onRemoveImage:h,onSelectImage:g,selectedImage:f,setImageAttributes:v}=this.props,b=(0,s.sprintf)(/* translators: %1$d is the order number of the image, %2$d is the total number of images. */ -__("image %1$d of %2$d in gallery","jetpack"),t+1,o.length),{src:k,srcSet:y}=(0,c.A)(e,{layoutStyle:d});return(0,r.createElement)(l.A,{alt:e.alt,"aria-label":b,columns:n,height:e.height,id:e.id,imageFilter:a,isFirstItem:0===t,isLastItem:t+1===o.length,isSelected:f===t,key:t,link:e.link,linkTo:u,onMoveBackward:i?void 0:p(t),onMoveForward:i?void 0:m(t),onRemove:i?void 0:h(t),onSelect:i?void 0:g(t),origUrl:e.url,setAttributes:i?void 0:v(t),showMovers:o.length>1,srcSet:y,url:k,width:e.width})}render(){const{align:e,children:t,className:n,columns:a,images:s,layoutStyle:l,roundedCorners:p,onResize:m,isSave:h,columnWidths:g}=this.props,f=(0,c.s)(l)?d.A:u.A,v=this.props.images.map(this.renderImage,this),b=l!==i.aQ?Math.min(p,i.WN):0;return(0,r.createElement)("div",{className:(0,o.A)(n,{[`has-rounded-corners-${b}`]:b>0})},(0,r.createElement)(f,{align:e,columns:a,columnWidths:h?g:void 0,images:s,layoutStyle:l,renderedImages:v,onResize:h?void 0:m}),t)}}},62579:(e,t,n)=>{"use strict";n.d(t,{A:()=>c});var r=n(82170),a=n(86087),s=n(89798),o=n(38448),i=n(26054),l=n(79167);class c extends a.Component{gallery=(0,a.createRef)();pendingRaf=null;render(){const{align:e,columns:t,images:n,layoutStyle:a,renderedImages:c,columnWidths:u}=this.props,d=(0,l.mJ)(n),p="columns"===a?(0,l.FL)(d,t):(0,l.VU)(d,{isWide:["full","wide"].includes(e)});let m=0;return(0,r.createElement)(o.A,{galleryRef:this.gallery},p.map(((e,t)=>(0,r.createElement)(i.A,{key:t},e.map(((e,n)=>{const a=c.slice(m,m+e);return m+=e,(0,r.createElement)(s.A,{key:n,width:u?.[t]?.[n]},a)}))))))}}},79167:(e,t,n)=>{"use strict";n.d(t,{FL:()=>o,VU:()=>A,mJ:()=>a});var r=n(66087);function a(e){return(0,r.map)(e,s)}function s({height:e,width:t}){return e&&t?t/e:1}function o(e,t){if(e.length<=t)return[Array(e.length).fill(1)];const n=(0,r.sum)(e)/t,a=[];let s=e,o=0;for(let e=0;e{const r=o<=(e+1)*n;return r&&(o+=t),r})).length;a.push(t),s=(0,r.drop)(s,t)}return a.push(s.length),[a]}const i=x([2,1,2],5),l=j([S,S,N,S,S]),c=j([S,S,S,N,S,S,S]),u=x([3,1,3],5),d=j([N,S,S,N]),p=x([1,2,1],5),m=j([N,S,S,S]),h=x([1,3],3),g=j([S,S,S,N]),f=x([3,1],3),v=j([P(1.6),(0,r.overEvery)(R(.9),P(2)),(0,r.overEvery)(R(.9),P(2))]),b=x([1,2],3),k=x([1,1,1,1,1],1),y=x([1,1,1,1],1),E=x([1,1,1],3),w=j([(0,r.overEvery)(R(.9),P(2)),(0,r.overEvery)(R(.9),P(2)),P(1.6)]),_=x([2,1],3),C=j([function(e){return e>=2}]);function A(e,{isWide:t}={}){const n=(e,a)=>{if(!a.length)return e;let s;s=a.length>15&&l(a)&&i(e)?[2,1,2]:a.length>15&&c(a)&&u(e)?[3,1,3]:5!==a.length&&d(a)&&p(e)?[1,2,1]:m(a)&&h(e)?[1,3]:g(a)&&f(e)?[3,1]:v(a)&&b(e)?[1,2]:t&&(5===a.length||10!==a.length&&a.length>6)&&k(e)&&(0,r.sum)((0,r.take)(a,5))<5?[1,1,1,1,1]:function(e,t){const n=(0,r.sum)((0,r.take)(t,4));return y(e)&&n<3.5&&t.length>5||n<7&&4===t.length}(e,a)?[1,1,1,1]:function(e,t,n){const a=(0,r.sum)((0,r.take)(t,3));return t.length>=3&&4!==t.length&&6!==t.length&&E(e)&&(a<2.5||a<5&&t.length>=3&&t[0]===t[2]||n)}(e,a,t)?[1,1,1]:w(a)&&_(e)?[2,1]:C(a)?[1]:a.length>3?[1,1]:Array(a.length).fill(1);const o=e.concat([s]),A=(0,r.sum)(s),x=a.slice(A);return n(o,x)};return n([],e)}function x(e,t){return n=>!(0,r.some)((0,r.takeRight)(n,t),(t=>(0,r.isEqual)(t,e)))}function j(e){return t=>t.length>=e.length&&(0,r.every)((0,r.zipWith)(e,t.slice(0,e.length),((e,t)=>e(t))))}function S(e){return e>=1&&e<2}function N(e){return e<1}function R(e){return t=>t>=e}function P(e){return t=>t{"use strict";n.d(t,{A:()=>s});var r=n(82170),a=n(13022);function s({children:e,className:t}){return(0,r.createElement)("div",{className:(0,a.A)("tiled-gallery__row",t)},e)}},58711:(e,t,n)=>{"use strict";n.d(t,{A:()=>c});var r=n(82170),a=n(66087),s=n(41314),o=n(89798),i=n(38448),l=n(26054);function c({columns:e,renderedImages:t}){const n=Math.min(s.ZS,e),c=t.length%n;return(0,r.createElement)(i.A,null,[...c?[(0,a.take)(t,c)]:[],...(0,a.chunk)((0,a.drop)(t,c),n)].map(((e,t)=>(0,r.createElement)(l.A,{key:t,className:`columns-${e.length}`},e.map(((e,t)=>(0,r.createElement)(o.A,{key:t},e)))))))}},91162:(e,t,n)=>{"use strict";n.d(t,{A:()=>p});var r=n(96072),a=n.n(r),s=n(82170),o=n(94715),i=n(13022),l=n(90907),c=n(35463),u=n(29520),d=n(6454);function p({attributes:e}){const{imageFilter:t,images:n}=e;if(!n.length)return null;const{align:r,className:p,columns:m=(0,u.EB)(e),linkTo:h,roundedCorners:g,columnWidths:f}=e,v=o.useBlockProps.save();return(0,s.createElement)("div",a()({},v,{className:(0,i.A)(v.className,p)})," ",(0,s.createElement)(d.A,{align:r,columns:m,imageFilter:t,images:n,isSave:!0,layoutStyle:(0,l.D)(c.kc,p),linkTo:h,roundedCorners:g,columnWidths:f}))}},93951:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});const r={align:["center","wide","full"],color:{gradients:!0,text:!1},customClassName:!1,html:!1,spacing:{margin:!0,padding:!0},__experimentalHideChildBlockControls:!0}},52537:(e,t,n)=>{"use strict";n.d(t,{A:()=>u,s:()=>c});var r=n(85985),a=n(63162),s=n(66087),o=n(14936),i=n(13087),l=n(41314);function c(e){return["circle","square"].includes(e)}function u(e,t={}){if(!e.height||!e.width)return e.url?{src:e.url}:{};if((0,i.A)())return{src:e.url};if((0,a.isBlobURL)(e.url)||/^https?:\/\/localhost/.test(e.url)||/^https?:\/\/.*\.local\//.test(e.url)||(0,r.d9)()&&(0,r.pP)())return{src:e.url};const n=e.url.split("?",1)[0],{height:u,width:p}=e,{layoutStyle:m}=t,h=function(e){const{host:t}=new URL(e,window.location.href);return/\.files\.wordpress\.com$/.test(t)}(n)||!0===function(){if("undefined"!=typeof jetpack_plan&&"vip"===jetpack_plan.data)return!0}()?d:o.A;let g;if(c(m)&&p&&u){const e=Math.min(l.rK,p,u);g=h(n,{resize:`${e},${e}`})}else g=h(n);let f;if(c(m)){const e=Math.min(600,p,u),t=Math.min(l.rK,p,u);f=(0,s.range)(e,t,300).map((e=>{const t=h(n,{resize:`${e},${e}`,strip:"info"});return t?`${t} ${e}w`:null})).filter(Boolean).join(",")}else{const e=Math.min(600,p),t=Math.min(l.rK,p);f=(0,s.range)(e,t,300).map((e=>{const t=h(n,{strip:"info",width:e});return t?`${t} ${e}w`:null})).filter(Boolean).join(",")}return Object.assign({src:g},f&&{srcSet:f})}function d(e,t={}){const n={width:"w",height:"h",letterboxing:"lb",removeLetterboxing:"ulb"},r=Object.assign(new URL(e,window.location.href),{username:"",password:"",port:"",search:"",hash:""});for(const[e,a]of Object.entries(t))r.searchParams.set(Object.hasOwn(n,e)?n[e]:e,a);return r.toString()}},29520:(e,t,n)=>{"use strict";n.d(t,{Ay:()=>k,EB:()=>v});var r=n(82170),a=n(85985),s=n(94715),o=n(56427),i=n(43656),l=n(86087),c=n(27723),u=n(66087),d=n(90907),p=n(76585),m=n(35463),h=n(77530),g=n(10309);const __=c.__,f=3;function v(e){return e.images.length>0?Math.min(f,e.images.length):f}const b=e=>{const t=(0,u.pick)(e,[["alt"],["id"],["link"]]);return t.url=(0,u.get)(e,["sizes","large","url"])||(0,u.get)(e,["media_details","sizes","large","source_url"])||e.url,t},k=(0,o.withNotices)((({attributes:e,isSelected:t,noticeOperations:n,noticeUI:c,setAttributes:f})=>{const{align:k,columns:y=v(e),imageFilter:E,images:w,linkTo:_,roundedCorners:C,columnWidths:A}=e,x=(0,d.D)(m.kc,e.className),j=(0,s.useBlockProps)(),[S,N]=(0,l.useState)(null),[R,P]=(0,l.useState)(void 0===A||0===A?.length),L=e=>{f({images:e,ids:e.map((({id:e})=>parseInt(e,10)))})},T=e=>{(0,i.mediaUpload)({allowedTypes:m.eN,filesList:e,onFileChange:e=>L((w||[]).concat(e.map(b))),onError:n.createErrorNotice}),P(!0)},B=e=>()=>{const t=(0,u.filter)(w,((t,n)=>e!==n));N(null),P(!0),L(t),f({columns:y?Math.min(t.length,y):y})},M=e=>()=>{S!==e&&N(e)},I=e=>{L(e.map(b)),f({columns:y?Math.min(e.length,y):y}),P(!0)},D=(e,t)=>{const n=[...w];n.splice(t,1,w[e]),n.splice(e,1,w[t]),N(t),P(!0),L(n)},F=e=>()=>{e!==w.length-1&&D(e,e+1)},z=e=>()=>{0!==e&&D(e,e-1)},O=e=>{R&&f({columnWidths:e})},H=e=>T(e.target.files),U=e=>t=>{w[e]&&L([...w.slice(0,e),{...w[e],...t},...w.slice(e+1)])};let V;return(0,l.useEffect)((()=>{t||null===S||N(null)}),[t,S,N]),V=0===w.length?(0,r.createElement)(s.MediaPlaceholder,{icon:(0,a.sh)(p),labels:{title:__("Tiled Gallery","jetpack"),name:__("images","jetpack")},onSelect:I,accept:"image/*",allowedTypes:m.eN,multiple:!0,notices:c,onError:n.createErrorNotice}):(0,r.createElement)(r.Fragment,null,(0,r.createElement)(h.M,{layoutStyle:x,images:w,columns:y,onColumnsChange:e=>f({columns:e}),roundedCorners:C,onRoundedCornersChange:e=>f({roundedCorners:e}),linkTo:_,onLinkToChange:e=>f({linkTo:e})}),c,(0,r.createElement)(g.A,{className:"tiled-gallery__wrapper",align:k,columns:y,imageFilter:E,images:w,layoutStyle:x,linkTo:_,onMoveBackward:z,onMoveForward:F,onRemoveImage:B,onSelectImage:M,onResize:O,roundedCorners:C,selectedImage:t?S:null,setImageAttributes:U},(0,r.createElement)(o.DropZone,{onFilesDrop:T}),t&&(0,r.createElement)("div",{className:"tiled-gallery__add-item"},(0,r.createElement)(o.FormFileUpload,{multiple:!0,className:"tiled-gallery__add-item-button",onChange:H,accept:"image/*",icon:"insert"},__("Upload an image","jetpack"))))),(0,r.createElement)("div",j,(0,r.createElement)(h.c,{images:w,onSelectImages:I,imageFilter:E,onFilterChange:e=>{f({imageFilter:e}),N(null)}}),V)}))},25589:(e,t,n)=>{"use strict";var r=n(74997),a=n(66087),s=n(94375),o=n(76585),i=n(10602),l=n(29520),c=n(96589);const u={align:"center",className:"is-style-rectangular",images:[{alt:"",link:"",url:n(32022),width:160,height:95},{alt:"",link:"",url:n(2369),width:160,height:107},{alt:"",link:"",url:n(24324),width:304,height:203},{alt:"",link:"",url:n(49263),width:312,height:207},{alt:"",link:"",url:n(76882),width:152,height:101},{alt:"",link:"",url:n(86781),width:152,height:105}],linkTo:"none"};function d(e){return(0,a.filter)(e,(({id:e,url:t})=>e&&t))}(0,s.M)(o,{edit:l.Ay,save:c.A,transforms:{from:[{type:"block",isMultiBlock:!0,blocks:["core/image"],isMatch:e=>d(e).length>0,transform:e=>{const t=d(e);return(0,r.createBlock)(o.name,{images:t.map((({id:e,url:t,link:n,alt:r})=>({id:e,url:t,link:n,alt:r}))),ids:t.map((({id:e})=>e))})}},{type:"block",blocks:["core/gallery","jetpack/slideshow"],transform:({images:e})=>{const t=d(e);return t.length>0?(0,r.createBlock)(o.name,{images:t.map((({id:e,url:t,link:n,alt:r})=>({id:e,url:t,link:n,alt:r}))),ids:t.map((({id:e})=>e))}):(0,r.createBlock)(o.name)}}],to:[{type:"block",blocks:["core/gallery"],transform:({images:e,ids:t,columns:n,linkTo:a})=>(0,r.createBlock)("core/gallery",{images:e,ids:t,columns:n,imageCrop:!0,linkTo:a})},{type:"block",blocks:["core/image"],transform:({align:e,images:t})=>t.length>0?t.map((({id:t,url:n,alt:a})=>(0,r.createBlock)("core/image",{align:e,id:t,url:n,alt:a}))):(0,r.createBlock)("core/image")}]},providesContext:{imageCrop:"imageCrop"},deprecated:i.A,example:{attributes:u}})},2164:(e,t,n)=>{"use strict";n.d(t,{A:()=>u});var r=n(82170),a=n(94715),s=n(56427),o=n(27723);const __=o.__,_x=o._x,i=[{icon:(0,r.createElement)(s.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},(0,r.createElement)(s.Path,{fill:"none",d:"M0 0h24v24H0V0z"}),(0,r.createElement)(s.Path,{d:"M3 5H1v16c0 1.1.9 2 2 2h16v-2H3V5zm18-4H7c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V3c0-1.1-.9-2-2-2zm0 16H7V3h14v14z"})),title:_x("Original","image style","jetpack"),value:void 0},{icon:(0,r.createElement)(s.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},(0,r.createElement)(s.Path,{fill:"none",d:"M0 0h24v24H0V0z"}),(0,r.createElement)(s.Path,{d:"M3 5H1v16c0 1.1.9 2 2 2h16v-2H3V5zm11 10h2V5h-4v2h2v8zm7-14H7c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V3c0-1.1-.9-2-2-2zm0 16H7V3h14v14z"})),title:_x("Black and White","image style","jetpack"),value:"black-and-white"},{icon:(0,r.createElement)(s.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},(0,r.createElement)(s.Path,{fill:"none",d:"M0 0h24v24H0V0z"}),(0,r.createElement)(s.Path,{d:"M3 5H1v16c0 1.1.9 2 2 2h16v-2H3V5zm18-4H7c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V3c0-1.1-.9-2-2-2zm0 16H7V3h14v14zm-4-4h-4v-2h2c1.1 0 2-.89 2-2V7c0-1.11-.9-2-2-2h-4v2h4v2h-2c-1.1 0-2 .89-2 2v4h6v-2z"})),title:_x("Sepia","image style","jetpack"),value:"sepia"},{icon:(0,r.createElement)(s.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},(0,r.createElement)(s.Path,{fill:"none",d:"M0 0h24v24H0V0z"}),(0,r.createElement)(s.Path,{d:"M21 1H7c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V3c0-1.1-.9-2-2-2zm0 16H7V3h14v14zM3 5H1v16c0 1.1.9 2 2 2h16v-2H3V5zm14 8v-1.5c0-.83-.67-1.5-1.5-1.5.83 0 1.5-.67 1.5-1.5V7c0-1.11-.9-2-2-2h-4v2h4v2h-2v2h2v2h-4v2h4c1.1 0 2-.89 2-2z"})),title:"1977",value:"1977"},{icon:(0,r.createElement)(s.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},(0,r.createElement)(s.Path,{fill:"none",d:"M0 0h24v24H0V0z"}),(0,r.createElement)(s.Path,{d:"M3 5H1v16c0 1.1.9 2 2 2h16v-2H3V5zm12 10h2V5h-2v4h-2V5h-2v6h4v4zm6-14H7c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V3c0-1.1-.9-2-2-2zm0 16H7V3h14v14z"})),title:_x("Clarendon","image style","jetpack"),value:"clarendon"},{icon:(0,r.createElement)(s.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},(0,r.createElement)(s.Path,{fill:"none",d:"M0 0h24v24H0z"}),(0,r.createElement)(s.Path,{d:"M21 1H7c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V3c0-1.1-.9-2-2-2zm0 16H7V3h14v14zM3 5H1v16c0 1.1.9 2 2 2h16v-2H3V5zm14 8v-2c0-1.11-.9-2-2-2h-2V7h4V5h-6v6h4v2h-4v2h4c1.1 0 2-.89 2-2z"})),title:_x("Gingham","image style","jetpack"),value:"gingham"}],l=__("Pick an image filter","jetpack"),c=(0,r.createElement)(s.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},(0,r.createElement)(s.Path,{fill:"none",d:"M0 0h24v24H0V0z"}),(0,r.createElement)(s.Path,{d:"M19 10v9H4.98V5h9V3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-9h-2zm-2.94-2.06L17 10l.94-2.06L20 7l-2.06-.94L17 4l-.94 2.06L14 7zM12 8l-1.25 2.75L8 12l2.75 1.25L12 16l1.25-2.75L16 12l-2.75-1.25z"}));function u({value:e,onChange:t}){return(0,r.createElement)(s.Dropdown,{placement:"bottom-start",className:"editor-block-switcher",contentClassName:"editor-block-switcher__popover",renderToggle:({onToggle:e,isOpen:t})=>(0,r.createElement)(a.BlockControls,null,(0,r.createElement)(s.Toolbar,{label:l},(0,r.createElement)(s.ToolbarButton,{onClick:e,"aria-expanded":t,"aria-haspopup":"true",label:l,showTooltip:!0,icon:c}))),renderContent:({onClose:n})=>(0,r.createElement)(s.NavigableMenu,{className:"tiled-gallery__filter-picker-menu"},i.map((({icon:a,title:o,value:i})=>{return(0,r.createElement)(s.MenuItem,{className:e===i?"is-active":void 0,icon:a,isSelected:e===i,key:i||"original",onClick:(l=i,()=>{t(e===l?void 0:l),n()}),role:"menuitemcheckbox"},o);var l})))})}},26539:(e,t,n)=>{"use strict";n.d(t,{A:()=>m});var r=n(82170),a=n(63162),s=n(56427),o=n(47143),i=n(86087),l=n(27723),c=n(48558),u=n(13022),d=n(18076);const __=l.__;class p extends i.Component{img=(0,i.createRef)();onImageClick=()=>{this.props.isSelected||this.props.onSelect()};onImageKeyDown=e=>{this.img.current&&this.img.current===this.img.current.ownerDocument.activeElement&&this.props.isSelected&&[c.BACKSPACE,c.DELETE].includes(e.keyCode)&&this.props.onRemove()};componentDidUpdate(){const{alt:e,height:t,image:n,link:r,url:a,width:s}=this.props;if(n){const o={};!e&&n.alt_text&&(o.alt=n.alt_text),!t&&n.media_details&&n.media_details.height&&(o.height=+n.media_details.height),!r&&n.link&&(o.link=n.link),!a&&n.source_url&&(o.url=n.source_url),!s&&n.media_details&&n.media_details.width&&(o.width=+n.media_details.width),Object.keys(o).length&&this.props.setAttributes(o)}}render(){const{"aria-label":e,alt:t,columns:n,height:o,id:l,imageFilter:c,isFirstItem:p,isLastItem:m,isSelected:h,link:g,linkTo:f,onMoveBackward:v,onMoveForward:b,onRemove:k,origUrl:y,showMovers:E,srcSet:w,url:_,width:C}=this.props;let A;switch(f){case"media":A=y;break;case"attachment":A=g}const x=(0,a.isBlobURL)(y),j=(0,r.createElement)(i.Fragment,null,(0,r.createElement)("img",{alt:t,"aria-label":e,"data-height":o,"data-id":l,"data-link":g,"data-url":y,"data-width":C,onClick:this.onImageClick,onKeyDown:this.onImageKeyDown,ref:this.img,src:x?void 0:_,srcSet:x?void 0:w,tabIndex:"0",style:x?{backgroundImage:`url(${y})`}:void 0}),x&&(0,r.createElement)(s.Spinner,null));return(0,r.createElement)("figure",{className:(0,u.A)("tiled-gallery__item",{"is-selected":h,"is-transient":x,[`filter__${c}`]:!!c})},E&&(0,r.createElement)("div",{className:"tiled-gallery__item__move-menu"},(0,r.createElement)(s.Button,{icon:1===n?d.Lo:d.Nd,onClick:p?void 0:v,className:"tiled-gallery__item__move-backward",label:__("Move image backward","jetpack"),"aria-disabled":p,disabled:!h}),(0,r.createElement)(s.Button,{icon:1===n?d.W4:d.Gy,onClick:m?void 0:b,className:"tiled-gallery__item__move-forward",label:__("Move image forward","jetpack"),"aria-disabled":m,disabled:!h})),(0,r.createElement)("div",{className:"tiled-gallery__item__inline-menu"},(0,r.createElement)(s.Button,{icon:d.VN,onClick:k,className:"tiled-gallery__item__remove",label:__("Remove image","jetpack"),disabled:!h})),A?(0,r.createElement)("a",null,j):j)}}const m=(0,o.withSelect)(((e,t)=>{const{getMedia:n}=e("core"),{id:r}=t;return{image:r?n(r):null}}))(p)},60918:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var r=n(82170),a=n(63162),s=n(13022);function o(e){const{"aria-label":t,alt:n,imageFilter:o,height:i,id:l,link:c,linkTo:u,origUrl:d,url:p,width:m}=e;if((0,a.isBlobURL)(d))return null;let h;switch(u){case"media":h=d;break;case"attachment":h=c}const g=(0,r.createElement)("img",{alt:n,"data-height":i,"data-id":l,"data-link":c,"data-url":d,"data-width":m,src:p,"data-amp-layout":"responsive",tabIndex:0,role:"button","aria-label":t});return(0,r.createElement)("figure",{className:(0,s.A)("tiled-gallery__item",{[`filter__${o}`]:!!o})},h?(0,r.createElement)("a",{href:h},g):g)}},18076:(e,t,n)=>{"use strict";n.d(t,{Gy:()=>o,Lo:()=>l,Nd:()=>s,VN:()=>c,W4:()=>i});var r=n(82170),a=n(56427);const s=(0,r.createElement)(a.SVG,{width:"18",height:"18",viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg"},(0,r.createElement)(a.Path,{d:"M5 8.70002L10.6 14.4L12 12.9L7.8 8.70002L12 4.50002L10.6 3.00002L5 8.70002Z"})),o=(0,r.createElement)(a.SVG,{width:"18",height:"18",viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg"},(0,r.createElement)(a.Path,{d:"M13 8.7L7.4 3L6 4.5L10.2 8.7L6 12.9L7.4 14.4L13 8.7Z"})),i=(0,r.createElement)(a.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,r.createElement)(a.Path,{d:"M7.41,8.59L12,13.17l4.59-4.58L18,10l-6,6l-6-6L7.41,8.59z"})),l=(0,r.createElement)(a.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,r.createElement)(a.Path,{d:"M12,8l-6,6l1.41,1.41L12,10.83l4.59,4.58L18,14L12,8z"})),c=(0,r.createElement)(a.SVG,{width:"18",height:"18",viewBox:"-2 -2 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,r.createElement)(a.Path,{d:"M14.95 6.46L11.41 10l3.54 3.54-1.41 1.41L10 11.42l-3.53 3.53-1.42-1.42L8.58 10 5.05 6.47l1.42-1.42L10 8.58l3.54-3.53z"}))},98627:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var r=n(82170);function a({children:e,width:t}){const n=t?{flexBasis:`${t}%`}:void 0;return(0,r.createElement)("div",{className:"tiled-gallery__col",style:n},e)}},54359:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var r=n(82170);function a({children:e,galleryRef:t}){return(0,r.createElement)("div",{className:"tiled-gallery__gallery",ref:t},e)}},10309:(e,t,n)=>{"use strict";n.d(t,{A:()=>m});var r=n(82170),a=n(86087),s=n(27723),o=n(13022),i=n(35463),l=n(26539),c=n(60918),u=n(90256),d=n(31238),p=n(56366);const __=s.__;class m extends a.Component{renderImage(e,t){const{columns:n,imageFilter:a,images:o,isSave:i,linkTo:d,layoutStyle:p,onMoveBackward:m,onMoveForward:h,onRemoveImage:g,onSelectImage:f,selectedImage:v,setImageAttributes:b}=this.props,k=(0,s.sprintf)(/* translators: %1$d is the order number of the image, %2$d is the total number of images. */ +__("image %1$d of %2$d in gallery","jetpack"),t+1,o.length),{src:k,srcSet:y}=(0,c.A)(e,{layoutStyle:d});return(0,r.createElement)(l.A,{alt:e.alt,"aria-label":b,columns:n,height:e.height,id:e.id,imageFilter:a,isFirstItem:0===t,isLastItem:t+1===o.length,isSelected:f===t,key:t,link:e.link,linkTo:u,onMoveBackward:i?void 0:p(t),onMoveForward:i?void 0:m(t),onRemove:i?void 0:h(t),onSelect:i?void 0:g(t),origUrl:e.url,setAttributes:i?void 0:v(t),showMovers:o.length>1,srcSet:y,url:k,width:e.width})}render(){const{align:e,children:t,className:n,columns:a,images:s,layoutStyle:l,roundedCorners:p,onResize:m,isSave:h,columnWidths:g}=this.props,f=(0,c.s)(l)?d.A:u.A,v=this.props.images.map(this.renderImage,this),b=l!==i.aQ?Math.min(p,i.WN):0;return(0,r.createElement)("div",{className:(0,o.A)(n,{[`has-rounded-corners-${b}`]:b>0})},(0,r.createElement)(f,{align:e,columns:a,columnWidths:h?g:void 0,images:s,layoutStyle:l,renderedImages:v,onResize:h?void 0:m}),t)}}},62579:(e,t,n)=>{"use strict";n.d(t,{A:()=>c});var r=n(82170),a=n(86087),s=n(89798),o=n(38448),i=n(26054),l=n(79167);class c extends a.Component{gallery=(0,a.createRef)();pendingRaf=null;render(){const{align:e,columns:t,images:n,layoutStyle:a,renderedImages:c,columnWidths:u}=this.props,d=(0,l.mJ)(n),p="columns"===a?(0,l.FL)(d,t):(0,l.VU)(d,{isWide:["full","wide"].includes(e)});let m=0;return(0,r.createElement)(o.A,{galleryRef:this.gallery},p.map(((e,t)=>(0,r.createElement)(i.A,{key:t},e.map(((e,n)=>{const a=c.slice(m,m+e);return m+=e,(0,r.createElement)(s.A,{key:n,width:u?.[t]?.[n]},a)}))))))}}},79167:(e,t,n)=>{"use strict";n.d(t,{FL:()=>o,VU:()=>A,mJ:()=>a});var r=n(66087);function a(e){return(0,r.map)(e,s)}function s({height:e,width:t}){return e&&t?t/e:1}function o(e,t){if(e.length<=t)return[Array(e.length).fill(1)];const n=(0,r.sum)(e)/t,a=[];let s=e,o=0;for(let e=0;e{const r=o<=(e+1)*n;return r&&(o+=t),r})).length;a.push(t),s=(0,r.drop)(s,t)}return a.push(s.length),[a]}const i=x([2,1,2],5),l=j([S,S,N,S,S]),c=j([S,S,S,N,S,S,S]),u=x([3,1,3],5),d=j([N,S,S,N]),p=x([1,2,1],5),m=j([N,S,S,S]),h=x([1,3],3),g=j([S,S,S,N]),f=x([3,1],3),v=j([P(1.6),(0,r.overEvery)(R(.9),P(2)),(0,r.overEvery)(R(.9),P(2))]),b=x([1,2],3),k=x([1,1,1,1,1],1),y=x([1,1,1,1],1),E=x([1,1,1],3),w=j([(0,r.overEvery)(R(.9),P(2)),(0,r.overEvery)(R(.9),P(2)),P(1.6)]),_=x([2,1],3),C=j([function(e){return e>=2}]);function A(e,{isWide:t}={}){const n=(e,a)=>{if(!a.length)return e;let s;s=a.length>15&&l(a)&&i(e)?[2,1,2]:a.length>15&&c(a)&&u(e)?[3,1,3]:5!==a.length&&d(a)&&p(e)?[1,2,1]:m(a)&&h(e)?[1,3]:g(a)&&f(e)?[3,1]:v(a)&&b(e)?[1,2]:t&&(5===a.length||10!==a.length&&a.length>6)&&k(e)&&(0,r.sum)((0,r.take)(a,5))<5?[1,1,1,1,1]:function(e,t){const n=(0,r.sum)((0,r.take)(t,4));return y(e)&&n<3.5&&t.length>5||n<7&&4===t.length}(e,a)?[1,1,1,1]:function(e,t,n){const a=(0,r.sum)((0,r.take)(t,3));return t.length>=3&&4!==t.length&&6!==t.length&&E(e)&&(a<2.5||a<5&&t.length>=3&&t[0]===t[2]||n)}(e,a,t)?[1,1,1]:w(a)&&_(e)?[2,1]:C(a)?[1]:a.length>3?[1,1]:Array(a.length).fill(1);const o=e.concat([s]),A=(0,r.sum)(s),x=a.slice(A);return n(o,x)};return n([],e)}function x(e,t){return n=>!(0,r.some)((0,r.takeRight)(n,t),(t=>(0,r.isEqual)(t,e)))}function j(e){return t=>t.length>=e.length&&(0,r.every)((0,r.zipWith)(e,t.slice(0,e.length),((e,t)=>e(t))))}function S(e){return e>=1&&e<2}function N(e){return e<1}function R(e){return t=>t>=e}function P(e){return t=>t{"use strict";n.d(t,{A:()=>s});var r=n(82170),a=n(13022);function s({children:e,className:t}){return(0,r.createElement)("div",{className:(0,a.A)("tiled-gallery__row",t)},e)}},58711:(e,t,n)=>{"use strict";n.d(t,{A:()=>c});var r=n(82170),a=n(66087),s=n(41314),o=n(89798),i=n(38448),l=n(26054);function c({columns:e,renderedImages:t}){const n=Math.min(s.ZS,e),c=t.length%n;return(0,r.createElement)(i.A,null,[...c?[(0,a.take)(t,c)]:[],...(0,a.chunk)((0,a.drop)(t,c),n)].map(((e,t)=>(0,r.createElement)(l.A,{key:t,className:`columns-${e.length}`},e.map(((e,t)=>(0,r.createElement)(o.A,{key:t},e)))))))}},91162:(e,t,n)=>{"use strict";n.d(t,{A:()=>p});var r=n(96072),a=n.n(r),s=n(82170),o=n(94715),i=n(13022),l=n(90907),c=n(35463),u=n(29520),d=n(6454);function p({attributes:e}){const{imageFilter:t,images:n}=e;if(!n.length)return null;const{align:r,className:p,columns:m=(0,u.EB)(e),linkTo:h,roundedCorners:g,columnWidths:f}=e,v=o.useBlockProps.save();return(0,s.createElement)("div",a()({},v,{className:(0,i.A)(v.className,p)})," ",(0,s.createElement)(d.A,{align:r,columns:m,imageFilter:t,images:n,isSave:!0,layoutStyle:(0,l.D)(c.kc,p),linkTo:h,roundedCorners:g,columnWidths:f}))}},93951:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});const r={align:["center","wide","full"],color:{gradients:!0,text:!1},customClassName:!1,html:!1,spacing:{margin:!0,padding:!0},__experimentalHideChildBlockControls:!0}},52537:(e,t,n)=>{"use strict";n.d(t,{A:()=>u,s:()=>c});var r=n(85985),a=n(63162),s=n(66087),o=n(14936),i=n(13087),l=n(41314);function c(e){return["circle","square"].includes(e)}function u(e,t={}){if(!e.height||!e.width)return e.url?{src:e.url}:{};if((0,i.A)())return{src:e.url};if((0,a.isBlobURL)(e.url)||/^https?:\/\/localhost/.test(e.url)||/^https?:\/\/.*\.local\//.test(e.url)||(0,r.d9)()&&(0,r.pP)())return{src:e.url};const n=e.url.split("?",1)[0],{height:u,width:p}=e,{layoutStyle:m}=t,h=function(e){const{host:t}=new URL(e,window.location.href);return/\.files\.wordpress\.com$/.test(t)}(n)||!0===function(){if("undefined"!=typeof jetpack_plan&&"vip"===jetpack_plan.data)return!0}()?d:o.A;let g;if(c(m)&&p&&u){const e=Math.min(l.rK,p,u);g=h(n,{resize:`${e},${e}`})}else g=h(n);let f;if(c(m)){const e=Math.min(600,p,u),t=Math.min(l.rK,p,u);f=(0,s.range)(e,t,300).map((e=>{const t=h(n,{resize:`${e},${e}`,strip:"info"});return t?`${t} ${e}w`:null})).filter(Boolean).join(",")}else{const e=Math.min(600,p),t=Math.min(l.rK,p);f=(0,s.range)(e,t,300).map((e=>{const t=h(n,{strip:"info",width:e});return t?`${t} ${e}w`:null})).filter(Boolean).join(",")}return Object.assign({src:g},f&&{srcSet:f})}function d(e,t={}){const n={width:"w",height:"h",letterboxing:"lb",removeLetterboxing:"ulb"},r=Object.assign(new URL(e,window.location.href),{username:"",password:"",port:"",search:"",hash:""});for(const[e,a]of Object.entries(t))r.searchParams.set(Object.hasOwn(n,e)?n[e]:e,a);return r.toString()}},29520:(e,t,n)=>{"use strict";n.d(t,{Ay:()=>k,EB:()=>v});var r=n(82170),a=n(85985),s=n(94715),o=n(56427),i=n(43656),l=n(86087),c=n(27723),u=n(66087),d=n(90907),p=n(76585),m=n(35463),h=n(77530),g=n(10309);const __=c.__,f=3;function v(e){return e.images.length>0?Math.min(f,e.images.length):f}const b=e=>{const t=(0,u.pick)(e,[["alt"],["id"],["link"]]);return t.url=(0,u.get)(e,["sizes","large","url"])||(0,u.get)(e,["media_details","sizes","large","source_url"])||e.url,t},k=(0,o.withNotices)((({attributes:e,isSelected:t,noticeOperations:n,noticeUI:c,setAttributes:f})=>{const{align:k,columns:y=v(e),imageFilter:E,images:w,linkTo:_,roundedCorners:C,columnWidths:A}=e,x=(0,d.D)(m.kc,e.className),j=(0,s.useBlockProps)(),[S,N]=(0,l.useState)(null),[R,P]=(0,l.useState)(void 0===A||0===A?.length),L=e=>{f({images:e,ids:e.map((({id:e})=>parseInt(e,10)))})},T=e=>{(0,i.mediaUpload)({allowedTypes:m.eN,filesList:e,onFileChange:e=>L((w||[]).concat(e.map(b))),onError:n.createErrorNotice}),P(!0)},B=e=>()=>{const t=(0,u.filter)(w,((t,n)=>e!==n));N(null),P(!0),L(t),f({columns:y?Math.min(t.length,y):y})},M=e=>()=>{S!==e&&N(e)},I=e=>{L(e.map(b)),f({columns:y?Math.min(e.length,y):y}),P(!0)},D=(e,t)=>{const n=[...w];n.splice(t,1,w[e]),n.splice(e,1,w[t]),N(t),P(!0),L(n)},F=e=>()=>{e!==w.length-1&&D(e,e+1)},z=e=>()=>{0!==e&&D(e,e-1)},O=e=>{R&&f({columnWidths:e})},H=e=>T(e.target.files),U=e=>t=>{w[e]&&L([...w.slice(0,e),{...w[e],...t},...w.slice(e+1)])};let V;return(0,l.useEffect)((()=>{t||null===S||N(null)}),[t,S,N]),V=0===w.length?(0,r.createElement)(s.MediaPlaceholder,{icon:(0,a.sh)(p),labels:{title:__("Tiled Gallery","jetpack"),name:__("images","jetpack")},onSelect:I,accept:"image/*",allowedTypes:m.eN,multiple:!0,notices:c,onError:n.createErrorNotice}):(0,r.createElement)(r.Fragment,null,(0,r.createElement)(h.M,{layoutStyle:x,images:w,columns:y,onColumnsChange:e=>f({columns:e}),roundedCorners:C,onRoundedCornersChange:e=>f({roundedCorners:e}),linkTo:_,onLinkToChange:e=>f({linkTo:e})}),c,(0,r.createElement)(g.A,{className:"tiled-gallery__wrapper",align:k,columns:y,imageFilter:E,images:w,layoutStyle:x,linkTo:_,onMoveBackward:z,onMoveForward:F,onRemoveImage:B,onSelectImage:M,onResize:O,roundedCorners:C,selectedImage:t?S:null,setImageAttributes:U},(0,r.createElement)(o.DropZone,{onFilesDrop:T}),t&&(0,r.createElement)("div",{className:"tiled-gallery__add-item"},(0,r.createElement)(o.FormFileUpload,{multiple:!0,className:"tiled-gallery__add-item-button",onChange:H,accept:"image/*",icon:"insert"},__("Upload an image","jetpack"))))),(0,r.createElement)("div",j,(0,r.createElement)(h.c,{images:w,onSelectImages:I,imageFilter:E,onFilterChange:e=>{f({imageFilter:e}),N(null)}}),V)}))},25589:(e,t,n)=>{"use strict";var r=n(74997),a=n(66087),s=n(94375),o=n(76585),i=n(10602),l=n(29520),c=n(96589);const u={align:"center",className:"is-style-rectangular",images:[{alt:"",link:"",url:n(32022),width:160,height:95},{alt:"",link:"",url:n(2369),width:160,height:107},{alt:"",link:"",url:n(24324),width:304,height:203},{alt:"",link:"",url:n(49263),width:312,height:207},{alt:"",link:"",url:n(76882),width:152,height:101},{alt:"",link:"",url:n(86781),width:152,height:105}],linkTo:"none"};function d(e){return(0,a.filter)(e,(({id:e,url:t})=>e&&t))}(0,s.M)(o,{edit:l.Ay,save:c.A,transforms:{from:[{type:"block",isMultiBlock:!0,blocks:["core/image"],isMatch:e=>d(e).length>0,transform:e=>{const t=d(e);return(0,r.createBlock)(o.name,{images:t.map((({id:e,url:t,link:n,alt:r})=>({id:e,url:t,link:n,alt:r}))),ids:t.map((({id:e})=>e))})}},{type:"block",blocks:["core/gallery","jetpack/slideshow"],transform:({images:e})=>{const t=d(e);return t.length>0?(0,r.createBlock)(o.name,{images:t.map((({id:e,url:t,link:n,alt:r})=>({id:e,url:t,link:n,alt:r}))),ids:t.map((({id:e})=>e))}):(0,r.createBlock)(o.name)}}],to:[{type:"block",blocks:["core/gallery"],transform:({images:e,ids:t,columns:n,linkTo:a})=>(0,r.createBlock)("core/gallery",{images:e,ids:t,columns:n,imageCrop:!0,linkTo:a})},{type:"block",blocks:["core/image"],transform:({align:e,images:t})=>t.length>0?t.map((({id:t,url:n,alt:a})=>(0,r.createBlock)("core/image",{align:e,id:t,url:n,alt:a}))):(0,r.createBlock)("core/image")}]},providesContext:{imageCrop:"imageCrop"},deprecated:i.A,example:{attributes:u}})},2164:(e,t,n)=>{"use strict";n.d(t,{A:()=>u});var r=n(82170),a=n(94715),s=n(56427),o=n(27723);const __=o.__,_x=o._x,i=[{icon:(0,r.createElement)(s.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},(0,r.createElement)(s.Path,{fill:"none",d:"M0 0h24v24H0V0z"}),(0,r.createElement)(s.Path,{d:"M3 5H1v16c0 1.1.9 2 2 2h16v-2H3V5zm18-4H7c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V3c0-1.1-.9-2-2-2zm0 16H7V3h14v14z"})),title:_x("Original","image style","jetpack"),value:void 0},{icon:(0,r.createElement)(s.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},(0,r.createElement)(s.Path,{fill:"none",d:"M0 0h24v24H0V0z"}),(0,r.createElement)(s.Path,{d:"M3 5H1v16c0 1.1.9 2 2 2h16v-2H3V5zm11 10h2V5h-4v2h2v8zm7-14H7c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V3c0-1.1-.9-2-2-2zm0 16H7V3h14v14z"})),title:_x("Black and White","image style","jetpack"),value:"black-and-white"},{icon:(0,r.createElement)(s.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},(0,r.createElement)(s.Path,{fill:"none",d:"M0 0h24v24H0V0z"}),(0,r.createElement)(s.Path,{d:"M3 5H1v16c0 1.1.9 2 2 2h16v-2H3V5zm18-4H7c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V3c0-1.1-.9-2-2-2zm0 16H7V3h14v14zm-4-4h-4v-2h2c1.1 0 2-.89 2-2V7c0-1.11-.9-2-2-2h-4v2h4v2h-2c-1.1 0-2 .89-2 2v4h6v-2z"})),title:_x("Sepia","image style","jetpack"),value:"sepia"},{icon:(0,r.createElement)(s.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},(0,r.createElement)(s.Path,{fill:"none",d:"M0 0h24v24H0V0z"}),(0,r.createElement)(s.Path,{d:"M21 1H7c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V3c0-1.1-.9-2-2-2zm0 16H7V3h14v14zM3 5H1v16c0 1.1.9 2 2 2h16v-2H3V5zm14 8v-1.5c0-.83-.67-1.5-1.5-1.5.83 0 1.5-.67 1.5-1.5V7c0-1.11-.9-2-2-2h-4v2h4v2h-2v2h2v2h-4v2h4c1.1 0 2-.89 2-2z"})),title:"1977",value:"1977"},{icon:(0,r.createElement)(s.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},(0,r.createElement)(s.Path,{fill:"none",d:"M0 0h24v24H0V0z"}),(0,r.createElement)(s.Path,{d:"M3 5H1v16c0 1.1.9 2 2 2h16v-2H3V5zm12 10h2V5h-2v4h-2V5h-2v6h4v4zm6-14H7c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V3c0-1.1-.9-2-2-2zm0 16H7V3h14v14z"})),title:_x("Clarendon","image style","jetpack"),value:"clarendon"},{icon:(0,r.createElement)(s.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},(0,r.createElement)(s.Path,{fill:"none",d:"M0 0h24v24H0z"}),(0,r.createElement)(s.Path,{d:"M21 1H7c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V3c0-1.1-.9-2-2-2zm0 16H7V3h14v14zM3 5H1v16c0 1.1.9 2 2 2h16v-2H3V5zm14 8v-2c0-1.11-.9-2-2-2h-2V7h4V5h-6v6h4v2h-4v2h4c1.1 0 2-.89 2-2z"})),title:_x("Gingham","image style","jetpack"),value:"gingham"}],l=__("Pick an image filter","jetpack"),c=(0,r.createElement)(s.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},(0,r.createElement)(s.Path,{fill:"none",d:"M0 0h24v24H0V0z"}),(0,r.createElement)(s.Path,{d:"M19 10v9H4.98V5h9V3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-9h-2zm-2.94-2.06L17 10l.94-2.06L20 7l-2.06-.94L17 4l-.94 2.06L14 7zM12 8l-1.25 2.75L8 12l2.75 1.25L12 16l1.25-2.75L16 12l-2.75-1.25z"}));function u({value:e,onChange:t}){return(0,r.createElement)(s.Dropdown,{placement:"bottom-start",className:"editor-block-switcher",contentClassName:"editor-block-switcher__popover",renderToggle:({onToggle:e,isOpen:t})=>(0,r.createElement)(a.BlockControls,null,(0,r.createElement)(s.Toolbar,{label:l},(0,r.createElement)(s.ToolbarButton,{onClick:e,"aria-expanded":t,"aria-haspopup":"true",label:l,showTooltip:!0,icon:c}))),renderContent:({onClose:n})=>(0,r.createElement)(s.NavigableMenu,{className:"tiled-gallery__filter-picker-menu"},i.map((({icon:a,title:o,value:i})=>{return(0,r.createElement)(s.MenuItem,{className:e===i?"is-active":void 0,icon:a,isSelected:e===i,key:i||"original",onClick:(l=i,()=>{t(e===l?void 0:l),n()}),role:"menuitemcheckbox"},o);var l})))})}},26539:(e,t,n)=>{"use strict";n.d(t,{A:()=>m});var r=n(82170),a=n(63162),s=n(56427),o=n(47143),i=n(86087),l=n(27723),c=n(48558),u=n(13022),d=n(18076);const __=l.__;class p extends i.Component{img=(0,i.createRef)();onImageClick=()=>{this.props.isSelected||this.props.onSelect()};onImageKeyDown=e=>{const{isSelected:t,onRemove:n}=this.props;t&&[c.BACKSPACE,c.DELETE].includes(e.keyCode)&&(e.preventDefault(),n())};componentDidUpdate(){const{alt:e,height:t,image:n,link:r,url:a,width:s}=this.props;if(n){const o={};!e&&n.alt_text&&(o.alt=n.alt_text),!t&&n.media_details&&n.media_details.height&&(o.height=+n.media_details.height),!r&&n.link&&(o.link=n.link),!a&&n.source_url&&(o.url=n.source_url),!s&&n.media_details&&n.media_details.width&&(o.width=+n.media_details.width),Object.keys(o).length&&this.props.setAttributes(o)}}render(){const{"aria-label":e,alt:t,columns:n,height:o,id:l,imageFilter:c,isFirstItem:p,isLastItem:m,isSelected:h,link:g,linkTo:f,onMoveBackward:v,onMoveForward:b,onRemove:k,origUrl:y,showMovers:E,srcSet:w,url:_,width:C}=this.props;let A;switch(f){case"media":A=y;break;case"attachment":A=g}const x=(0,a.isBlobURL)(y),j=(0,r.createElement)(i.Fragment,null,(0,r.createElement)("img",{alt:t,"data-height":o,"data-id":l,"data-link":g,"data-url":y,"data-width":C,ref:this.img,src:x?void 0:_,srcSet:x?void 0:w,style:x?{backgroundImage:`url(${y})`}:void 0}),x&&(0,r.createElement)(s.Spinner,null));return(0,r.createElement)("div",{className:(0,u.A)("tiled-gallery__item",{"is-selected":h,"is-transient":x,[`filter__${c}`]:!!c}),tabIndex:"0",role:"button",onClick:this.onImageClick,onKeyDown:this.onImageKeyDown,"aria-label":e},E&&(0,r.createElement)("div",{className:"tiled-gallery__item__move-menu"},(0,r.createElement)(s.Button,{icon:1===n?d.Lo:d.Nd,onClick:p?void 0:v,className:"tiled-gallery__item__move-backward",label:__("Move image backward","jetpack"),"aria-disabled":p,disabled:!h}),(0,r.createElement)(s.Button,{icon:1===n?d.W4:d.Gy,onClick:m?void 0:b,className:"tiled-gallery__item__move-forward",label:__("Move image forward","jetpack"),"aria-disabled":m,disabled:!h})),(0,r.createElement)("div",{className:"tiled-gallery__item__inline-menu"},(0,r.createElement)(s.Button,{icon:d.VN,onClick:k,className:"tiled-gallery__item__remove",label:__("Remove image","jetpack"),disabled:!h})),A?(0,r.createElement)("a",{"aria-hidden":"true"},j):j)}}const m=(0,o.withSelect)(((e,t)=>{const{getMedia:n}=e("core"),{id:r}=t;return{image:r?n(r):null}}))(p)},60918:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var r=n(82170),a=n(63162),s=n(13022);function o(e){const{"aria-label":t,alt:n,imageFilter:o,height:i,id:l,link:c,linkTo:u,origUrl:d,url:p,width:m}=e;if((0,a.isBlobURL)(d))return null;let h;switch(u){case"media":h=d;break;case"attachment":h=c}const g=(0,r.createElement)("img",{alt:n,"data-height":i,"data-id":l,"data-link":c,"data-url":d,"data-width":m,src:p,"data-amp-layout":"responsive",tabIndex:0,role:"button","aria-label":t});return(0,r.createElement)("figure",{className:(0,s.A)("tiled-gallery__item",{[`filter__${o}`]:!!o})},h?(0,r.createElement)("a",{href:h},g):g)}},18076:(e,t,n)=>{"use strict";n.d(t,{Gy:()=>o,Lo:()=>l,Nd:()=>s,VN:()=>c,W4:()=>i});var r=n(82170),a=n(56427);const s=(0,r.createElement)(a.SVG,{width:"18",height:"18",viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg"},(0,r.createElement)(a.Path,{d:"M5 8.70002L10.6 14.4L12 12.9L7.8 8.70002L12 4.50002L10.6 3.00002L5 8.70002Z"})),o=(0,r.createElement)(a.SVG,{width:"18",height:"18",viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg"},(0,r.createElement)(a.Path,{d:"M13 8.7L7.4 3L6 4.5L10.2 8.7L6 12.9L7.4 14.4L13 8.7Z"})),i=(0,r.createElement)(a.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,r.createElement)(a.Path,{d:"M7.41,8.59L12,13.17l4.59-4.58L18,10l-6,6l-6-6L7.41,8.59z"})),l=(0,r.createElement)(a.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,r.createElement)(a.Path,{d:"M12,8l-6,6l1.41,1.41L12,10.83l4.59,4.58L18,14L12,8z"})),c=(0,r.createElement)(a.SVG,{width:"18",height:"18",viewBox:"-2 -2 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,r.createElement)(a.Path,{d:"M14.95 6.46L11.41 10l3.54 3.54-1.41 1.41L10 11.42l-3.53 3.53-1.42-1.42L8.58 10 5.05 6.47l1.42-1.42L10 8.58l3.54-3.53z"}))},98627:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var r=n(82170);function a({children:e,width:t}){const n=t?{flexBasis:`${t}%`}:void 0;return(0,r.createElement)("div",{className:"tiled-gallery__col",style:n},e)}},54359:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var r=n(82170);function a({children:e,galleryRef:t}){return(0,r.createElement)("div",{className:"tiled-gallery__gallery",ref:t},e)}},10309:(e,t,n)=>{"use strict";n.d(t,{A:()=>m});var r=n(82170),a=n(86087),s=n(27723),o=n(13022),i=n(35463),l=n(26539),c=n(60918),u=n(90256),d=n(31238),p=n(56366);const __=s.__;class m extends a.Component{renderImage(e,t){const{columns:n,imageFilter:a,images:o,isSave:i,linkTo:d,layoutStyle:p,onMoveBackward:m,onMoveForward:h,onRemoveImage:g,onSelectImage:f,selectedImage:v,setImageAttributes:b}=this.props,k=(0,s.sprintf)(/* translators: %1$d is the order number of the image, %2$d is the total number of images. */ __("Open image %1$d of %2$d in full-screen","jetpack"),t+1,o.length),y=i?c.A:l.A,{src:E,srcSet:w}=(0,u.A)(e,{layoutStyle:p});return(0,r.createElement)(y,{alt:e.alt,"aria-label":k,columns:n,height:e.height,id:e.id,imageFilter:a,isFirstItem:0===t,isLastItem:t+1===o.length,isSelected:v===t,key:t,link:e.link,linkTo:d,onMoveBackward:i?void 0:m(t),onMoveForward:i?void 0:h(t),onRemove:i?void 0:g(t),onSelect:i?void 0:f(t),origUrl:e.url,setAttributes:i?void 0:b(t),showMovers:o.length>1,srcSet:w,url:E,width:e.width})}render(){const{align:e,children:t,className:n,columns:a,images:s,layoutStyle:l,roundedCorners:c,onResize:m,style:h,isSave:g,columnWidths:f}=this.props,v=(0,u.s)(l)?p.A:d.A,b=this.props.images.map(this.renderImage,this),k=l!==i.aQ?Math.min(c,i.WN):0;return(0,r.createElement)("div",{style:h,className:(0,o.A)(n,{[`has-rounded-corners-${k}`]:k>0})},(0,r.createElement)(v,{align:e,columns:a,columnWidths:g?f:void 0,images:s,layoutStyle:l,renderedImages:b,onResize:g?void 0:m}),t)}}},31238:(e,t,n)=>{"use strict";n.d(t,{A:()=>d});var r=n(82170),a=n(86087),s=n(94107),o=n(98627),i=n(54359),l=n(43645),c=n(74176),u=n(18980);class d extends a.Component{gallery=(0,a.createRef)();pendingRaf=null;ro=null;componentDidMount(){this.observeResize()}componentWillUnmount(){this.unobserveResize()}componentDidUpdate(e){(e.images!==this.props.images||e.align!==this.props.align||"columns"===this.props.layoutStyle&&e.columns!==this.props.columns)&&this.triggerResize()}handleGalleryResize=e=>{this.pendingRaf&&(cancelAnimationFrame(this.pendingRaf),this.pendingRaf=null),this.pendingRaf=requestAnimationFrame((()=>{for(const{contentRect:t,target:n}of e){const{width:e}=t,r=[];(0,u.S)(n).forEach((t=>{r.push((0,u.r)(t,e))})),void 0!==this.props.onResize&&this.props.onResize(r)}}))};triggerResize(){this.gallery.current&&this.handleGalleryResize([{target:this.gallery.current,contentRect:{width:this.gallery.current.clientWidth}}])}observeResize(){this.triggerResize(),this.ro=new s.A(this.handleGalleryResize),this.gallery.current&&this.ro.observe(this.gallery.current)}unobserveResize(){this.ro&&(this.ro.disconnect(),this.ro=null),this.pendingRaf&&(cancelAnimationFrame(this.pendingRaf),this.pendingRaf=null)}getColumnWidths(e,t,n){let r=0;return e.map((e=>e.map((e=>{const n=t.slice(r,r+e);return r+=e,n})))).map((e=>(0,u.r)(e,n)))}render(){const{align:e,columns:t,images:n,layoutStyle:s,renderedImages:u}=this.props,d=(0,c.mJ)(n),p="columns"===s?(0,c.FL)(d,t):(0,c.VU)(d,{isWide:["full","wide"].includes(e)}),m=a.Platform.select({web:()=>this.props.columnWidths,native:()=>this.getColumnWidths(p,u,1e3)})();let h=0;return(0,r.createElement)(i.A,{galleryRef:this.gallery},p.map(((e,t)=>(0,r.createElement)(l.A,{key:t},e.map(((e,n)=>{const a=u.slice(h,h+e);return h+=e,(0,r.createElement)(o.A,{key:n,width:m?.[t]?.[n]},a)}))))))}}},74176:(e,t,n)=>{"use strict";n.d(t,{FL:()=>o,VU:()=>A,mJ:()=>a});var r=n(66087);function a(e){return(0,r.map)(e,s)}function s({height:e,width:t}){return e&&t?t/e:1}function o(e,t){if(e.length<=t)return[Array(e.length).fill(1)];const n=(0,r.sum)(e)/t,a=[];let s=e,o=0;for(let e=0;e{const r=o<=(e+1)*n;return r&&(o+=t),r})).length;a.push(t),s=(0,r.drop)(s,t)}return a.push(s.length),[a]}const i=x([2,1,2],5),l=j([S,S,N,S,S]),c=j([S,S,S,N,S,S,S]),u=x([3,1,3],5),d=j([N,S,S,N]),p=x([1,2,1],5),m=j([N,S,S,S]),h=x([1,3],3),g=j([S,S,S,N]),f=x([3,1],3),v=j([P(1.6),(0,r.overEvery)(R(.9),P(2)),(0,r.overEvery)(R(.9),P(2))]),b=x([1,2],3),k=x([1,1,1,1,1],1),y=x([1,1,1,1],1),E=x([1,1,1],3),w=j([(0,r.overEvery)(R(.9),P(2)),(0,r.overEvery)(R(.9),P(2)),P(1.6)]),_=x([2,1],3),C=j([function(e){return e>=2}]);function A(e,{isWide:t}={}){const n=(e,a)=>{if(!a.length)return e;let s;s=a.length>15&&l(a)&&i(e)?[2,1,2]:a.length>15&&c(a)&&u(e)?[3,1,3]:5!==a.length&&d(a)&&p(e)?[1,2,1]:m(a)&&h(e)?[1,3]:g(a)&&f(e)?[3,1]:v(a)&&b(e)?[1,2]:t&&(5===a.length||10!==a.length&&a.length>6)&&k(e)&&(0,r.sum)((0,r.take)(a,5))<5?[1,1,1,1,1]:function(e,t){const n=(0,r.sum)((0,r.take)(t,4));return y(e)&&n<3.5&&t.length>5||n<7&&4===t.length}(e,a)?[1,1,1,1]:function(e,t,n){const a=(0,r.sum)((0,r.take)(t,3));return t.length>=3&&4!==t.length&&6!==t.length&&E(e)&&(a<2.5||a<5&&t.length>=3&&t[0]===t[2]||n)}(e,a,t)?[1,1,1]:w(a)&&_(e)?[2,1]:C(a)?[1]:a.length>3?[1,1]:Array(a.length).fill(1);const o=e.concat([s]),A=(0,r.sum)(s),x=a.slice(A);return n(o,x)};return n([],e)}function x(e,t){return n=>!(0,r.some)((0,r.takeRight)(n,t),(t=>(0,r.isEqual)(t,e)))}function j(e){return t=>t.length>=e.length&&(0,r.every)((0,r.zipWith)(e,t.slice(0,e.length),((e,t)=>e(t))))}function S(e){return e>=1&&e<2}function N(e){return e<1}function R(e){return t=>t>=e}function P(e){return t=>t{"use strict";n.d(t,{S:()=>o,r:()=>s});var r=n(35463);function a(e,t){const n=(t-e.reduce(((e,t)=>e+t),0))/e.length;return e.map((e=>e+n))}function s(e,t){return function(e,[t,n],s){const o=1/t*(s-r.hE*(e.childElementCount-1)-n);return function(e,{rawHeight:t,rowWidth:n}){const s=i(e),o=s.map((e=>(t-r.hE*(e.childElementCount-1))*c(e)[0])),d=a(o,n);s.forEach(((e,n)=>{const s=o[n],i=d[n];!function(e,{colHeight:t,width:n,rawWidth:r}){const s=l(e).map((e=>r/u(e))),o=a(s,t);Array.from(e.children).forEach(((e,t)=>{const r=o[t];e.setAttribute("style",`height:${r}px;width:${n}px;`)}))}(e,{colHeight:t-r.hE*(e.childElementCount-1),width:i,rawWidth:s})}));return d.map((e=>parseFloat(e/n*100).toFixed(5)))}(e,{rawHeight:o,rowWidth:s-r.hE*(e.childElementCount-1)})}(e,function(e){const t=i(e).map(c).reduce((([e,t],[n,r])=>[e+n,t+r]),[0,0]);return t}(e),t)}function o(e){return Array.from(e.querySelectorAll(".tiled-gallery__row"))}function i(e){return Array.from(e.querySelectorAll(".tiled-gallery__col"))}function l(e){return Array.from(e.querySelectorAll(".tiled-gallery__item > img, .tiled-gallery__item > a > img"))}function c(e){const t=l(e),n=t.length,r=1/t.map(u).reduce(((e,t)=>e+1/t),0);return[r,r*n||1]}function u(e){const t=parseInt(e.dataset.width,10),n=parseInt(e.dataset.height,10);return t&&!Number.isNaN(t)&&n&&!Number.isNaN(n)?t/n:1}},43645:(e,t,n)=>{"use strict";n.d(t,{A:()=>s});var r=n(82170),a=n(13022);function s({children:e,className:t}){return(0,r.createElement)("div",{className:(0,a.A)("tiled-gallery__row",t)},e)}},56366:(e,t,n)=>{"use strict";n.d(t,{A:()=>c});var r=n(82170),a=n(66087),s=n(35463),o=n(98627),i=n(54359),l=n(43645);function c({columns:e,renderedImages:t}){const n=Math.min(s.ZS,e),c=t.length%n;return(0,r.createElement)(i.A,null,[...c?[(0,a.take)(t,c)]:[],...(0,a.chunk)((0,a.drop)(t,c),n)].map(((e,t)=>(0,r.createElement)(l.A,{key:t,className:`columns-${e.length}`},e.map(((e,t)=>(0,r.createElement)(o.A,{key:t},e)))))))}},9888:(e,t,n)=>{"use strict";function r(e){return["columns","circle","square"].includes(e)}n.d(t,{o:()=>r})},96589:(e,t,n)=>{"use strict";n.d(t,{A:()=>p});var r=n(96072),a=n.n(r),s=n(82170),o=n(94715),i=n(13022),l=n(90907),c=n(35463),u=n(29520),d=n(10309);function p({attributes:e}){const{imageFilter:t,images:n}=e;if(!n.length)return null;const{align:r,className:p,columns:m=(0,u.EB)(e),linkTo:h,roundedCorners:g,columnWidths:f}=e,v=o.useBlockProps.save();return(0,s.createElement)("div",a()({},v,{className:(0,i.A)(v.className,p)}),(0,s.createElement)(d.A,{align:r,columns:m,imageFilter:t,images:n,isSave:!0,layoutStyle:(0,l.D)(c.kc,p),linkTo:h,roundedCorners:g,columnWidths:f}))}},90256:(e,t,n)=>{"use strict";n.d(t,{A:()=>p,s:()=>d});var r=n(85985),a=n(63162),s=n(47143),o=n(66087),i=n(14936),l=n(13087),c=n(35463);let u;function d(e){return["circle","square"].includes(e)}function p(e,t={}){if(!e.height||!e.width)return e.url?{src:e.url}:{};if((0,l.A)())return{src:e.url};if((0,a.isBlobURL)(e.url)||/^https?:\/\/localhost/.test(e.url)||/^https?:\/\/.*\.local\//.test(e.url)||(0,r.d9)()&&(0,r.pP)())return{src:e.url};const n=e.url.split("?",1)[0],{height:s,width:p}=e,{layoutStyle:h}=t,g=!0===function(){let e;void 0!==u?e=u:"undefined"!=typeof jetpack_plan&&(e=jetpack_plan);return e&&"vip"===e?.data}()||(0,r.Sy)()?m:i.A;let f;if(d(h)&&p&&s){const e=Math.min(c.rK,p,s);f=g(n,{resize:`${e},${e}`})}else f=g(n);let v;if(d(h)){const e=Math.min(600,p,s),t=Math.min(c.rK,p,s);v=(0,o.range)(e,t,300).map((e=>{const t=g(n,{resize:`${e},${e}`,strip:"info"});return t?`${t} ${e}w`:null})).filter(Boolean).join(",")}else{const e=Math.min(600,p),t=Math.min(c.rK,p);v=(0,o.range)(e,t,300).map((e=>{const t=g(n,{strip:"info",width:e});return t?`${t} ${e}w`:null})).filter(Boolean).join(",")}return Object.assign({src:f},v&&{srcSet:v})}function m(e,t={}){const n={width:"w",height:"h",letterboxing:"lb",removeLetterboxing:"ulb"},r=Object.assign(new URL(e,window.location.href),{username:"",password:"",port:"",search:"",hash:""});for(const[e,a]of Object.entries(t))r.searchParams.set(Object.hasOwn(n,e)?n[e]:e,a);return r.toString()}window.addEventListener("load",(function(){(0,s.select)("core/block-editor").getBlocks().some((e=>"jetpack/image-compare"===e.name))&&!u&&(u=window?.Jetpack_Editor_Initial_State?.jetpack?.jetpack_plan)}))},40118:(e,t,n)=>{"use strict";n.d(t,{A:()=>p});var r=n(82170),a=n(94715),s=n(56427),o=n(86087),i=n(27723),l=n(76277),c=n(48558);const __=i.__,u=({tockUrl:e,setEditedUrl:t,setUrl:n,cancel:a})=>{const i=(0,o.useRef)(!0),u=(0,o.useRef)(!1),d=e=>{n(),u.current=!0,e()};return(0,r.createElement)(s.ToolbarGroup,null,(0,r.createElement)(s.Dropdown,{popoverProps:{variant:"toolbar"},onClose:()=>u.current?u.current=!1:a(),placement:"bottom-start",renderToggle:({isOpen:t,onToggle:n})=>(!i.current||t||e||(i.current=!1,n()),(0,r.createElement)(s.ToolbarButton,{className:"components-toolbar__control",label:__("Edit Tock business name","jetpack"),onClick:()=>{n(),t&&a()}},__("Edit","jetpack"))),renderContent:({onClose:n})=>(0,r.createElement)(s.BaseControl,{className:"jetpack-tock-url-settings",help:(0,o.createInterpolateElement)(__("The Tock business can be found in the URL of your public Tock page. For example: www.exploretock.com/myname","jetpack"),{b:(0,r.createElement)("strong",null)}),__nextHasNoMarginBottom:!0},(0,r.createElement)("div",{className:"jetpack-tock-url-input-wrapper"},(0,r.createElement)(s.TextControl,{placeholder:__("Add Tock business name","jetpack"),onChange:t,value:e,onKeyDownCapture:t=>((t,n)=>{const{keyCode:r}=t;r===c.ENTER&&""!==e&&(t.preventDefault(),d(n)),r===c.ESCAPE&&(t.preventDefault(),a(),n())})(t,n),className:"jetpack-tock-url-input",__nextHasNoMarginBottom:!0}),(0,r.createElement)("div",{className:"jetpack-tock-url-input-action"},(0,r.createElement)(s.Button,{type:"submit",label:__("Submit","jetpack"),icon:l.A,className:"jetpack-tock-url-input-submit",onClick:()=>d(n)}))))}))},d=({url:e,popoverAnchor:t})=>{const n=`\n\t\t
\n\t\t