From 4dcd9722c334e5a59438fcf7983446cd3da8dc5d Mon Sep 17 00:00:00 2001 From: Gabriel de Tassigny Date: Wed, 11 Nov 2026 10:47:10 +0100 Subject: [PATCH 1/4] fix(gallery): Render the block preview in the iframed editor The Product Gallery library was only loaded in the outer admin document, while the block container lives in the editor canvas iframe, so the widget never found it and the preview stayed blank. Load the library in the editor canvas through enqueue_block_assets and render with the widget of the window that holds the container, with the config rebuilt in that frame so it passes the widget's validation. Also parse the block's Custom Settings JSON before merging it over the config, as the front end does, so the preview matches the published gallery. --- js/gallery-block.asset.php | 2 +- js/gallery-block.js | 2 +- php/media/class-gallery.php | 17 ++++++- src/js/gallery-block/edit.js | 93 +++++++++++++++++++++++++++++------ src/js/gallery-block/utils.js | 28 +++++++++++ 5 files changed, 124 insertions(+), 18 deletions(-) diff --git a/js/gallery-block.asset.php b/js/gallery-block.asset.php index c8826fa0e..2dd5bd3e3 100644 --- a/js/gallery-block.asset.php +++ b/js/gallery-block.asset.php @@ -9,5 +9,5 @@ 'wp-element', 'wp-i18n' ), - 'version' => 'f4dd3a6a83f3bee704eb' + 'version' => '6d1e9f24f83954d8134c' ); diff --git a/js/gallery-block.js b/js/gallery-block.js index bf8fbbff7..4b7c5db1c 100644 --- a/js/gallery-block.js +++ b/js/gallery-block.js @@ -1,2 +1,2 @@ -(()=>{var e={5580(e,t,r){var n=r(6110)(r(9325),"DataView");e.exports=n},1549(e,t,r){var n=r(2032),o=r(3862),a=r(6721),i=r(2749),s=r(5749);function l(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t-1&&e%1==0&&e-1}},1175(e,t,r){var n=r(6025);e.exports=function(e,t){var r=this.__data__,o=n(r,e);return o<0?(++this.size,r.push([e,t])):r[o][1]=t,this}},3040(e,t,r){var n=r(1549),o=r(79),a=r(8223);e.exports=function(){this.size=0,this.__data__={hash:new n,map:new(a||o),string:new n}}},7670(e,t,r){var n=r(2651);e.exports=function(e){var t=n(this,e).delete(e);return this.size-=t?1:0,t}},289(e,t,r){var n=r(2651);e.exports=function(e){return n(this,e).get(e)}},4509(e,t,r){var n=r(2651);e.exports=function(e){return n(this,e).has(e)}},2949(e,t,r){var n=r(2651);e.exports=function(e,t){var r=n(this,e),o=r.size;return r.set(e,t),this.size+=r.size==o?0:1,this}},1042(e,t,r){var n=r(6110)(Object,"create");e.exports=n},3650(e,t,r){var n=r(4335)(Object.keys,Object);e.exports=n},181(e){e.exports=function(e){var t=[];if(null!=e)for(var r in Object(e))t.push(r);return t}},6009(e,t,r){e=r.nmd(e);var n=r(4840),o=t&&!t.nodeType&&t,a=o&&e&&!e.nodeType&&e,i=a&&a.exports===o&&n.process,s=function(){try{var e=a&&a.require&&a.require("util").types;return e||i&&i.binding&&i.binding("util")}catch(e){}}();e.exports=s},9350(e){var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},4335(e){e.exports=function(e,t){return function(r){return e(t(r))}}},9325(e,t,r){var n=r(4840),o="object"==typeof self&&self&&self.Object===Object&&self,a=n||o||Function("return this")();e.exports=a},1420(e,t,r){var n=r(79);e.exports=function(){this.__data__=new n,this.size=0}},938(e){e.exports=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}},3605(e){e.exports=function(e){return this.__data__.get(e)}},9817(e){e.exports=function(e){return this.__data__.has(e)}},945(e,t,r){var n=r(79),o=r(8223),a=r(3661);e.exports=function(e,t){var r=this.__data__;if(r instanceof n){var i=r.__data__;if(!o||i.length<199)return i.push([e,t]),this.size=++r.size,this;r=this.__data__=new a(i)}return r.set(e,t),this.size=r.size,this}},7473(e){var t=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return t.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},8055(e,t,r){var n=r(9999);e.exports=function(e){return n(e,5)}},5288(e){e.exports=function(e,t){return e===t||e!=e&&t!=t}},2428(e,t,r){var n=r(7534),o=r(346),a=Object.prototype,i=a.hasOwnProperty,s=a.propertyIsEnumerable,l=n(function(){return arguments}())?n:function(e){return o(e)&&i.call(e,"callee")&&!s.call(e,"callee")};e.exports=l},6449(e){var t=Array.isArray;e.exports=t},4894(e,t,r){var n=r(1882),o=r(294);e.exports=function(e){return null!=e&&o(e.length)&&!n(e)}},3656(e,t,r){e=r.nmd(e);var n=r(9325),o=r(9935),a=t&&!t.nodeType&&t,i=a&&e&&!e.nodeType&&e,s=i&&i.exports===a?n.Buffer:void 0,l=(s?s.isBuffer:void 0)||o;e.exports=l},1882(e,t,r){var n=r(2552),o=r(3805);e.exports=function(e){if(!o(e))return!1;var t=n(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},294(e){e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}},7730(e,t,r){var n=r(9172),o=r(7301),a=r(6009),i=a&&a.isMap,s=i?o(i):n;e.exports=s},3805(e){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},346(e){e.exports=function(e){return null!=e&&"object"==typeof e}},8440(e,t,r){var n=r(6038),o=r(7301),a=r(6009),i=a&&a.isSet,s=i?o(i):n;e.exports=s},7167(e,t,r){var n=r(4901),o=r(7301),a=r(6009),i=a&&a.isTypedArray,s=i?o(i):n;e.exports=s},5950(e,t,r){var n=r(695),o=r(8984),a=r(4894);e.exports=function(e){return a(e)?n(e):o(e)}},7241(e,t,r){var n=r(695),o=r(2903),a=r(4894);e.exports=function(e){return a(e)?n(e,!0):o(e)}},3345(e){e.exports=function(){return[]}},9935(e){e.exports=function(){return!1}},6087(e){"use strict";e.exports=window.wp.element},6942(e,t){var r;!function(){"use strict";var n={}.hasOwnProperty;function o(){for(var e="",t=0;t{const t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.cw=e=>{var t;return()=>{if(e){var r=e;e=0,t={exports:{}},r.call(t.exports,t,t.exports)}return t.exports}},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.hasOwn(e,t),r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),r.dn=e=>{var t=Object.getOwnPropertyDescriptor(e,"name");(!t||!t.writable&&t.configurable)&&Object.defineProperty(e,"name",{value:"default",configurable:!0})},(()=>{"use strict";var e=r.cw(e=>{function t(e,t){var r,n;if("function"==typeof t)void 0!==(n=t(e))&&(e=n);else if(Array.isArray(t))for(r=0;r=0&&(e=e.replace(/\[/g,t).replace(/]/g,""));var r=e.split(t);if(r.filter(s).length!==r.length)throw Error("Refusing to update blacklisted property "+e);return r}var c=Object.prototype.hasOwnProperty;function u(e,t,r,n){if(!(this instanceof u))return new u(e,t,r,n);void 0===t&&(t=!1),void 0===r&&(r=!0),void 0===n&&(n=!0),this.separator=e||".",this.override=t,this.useArray=r,this.useBrackets=n,this.keepArray=!1,this.cleanup=[]}var p=new u(".",!1,!0,!0);function d(e){return function(){return p[e].apply(p,arguments)}}u.prototype._fill=function(e,r,n,i){var s=e.shift();if(e.length>0){if(r[s]=r[s]||(this.useArray&&function(e){return/^\d+$/.test(e)}(e[0])?[]:{}),!o(r[s])){if(!this.override){if(!o(n)||!a(n))throw new Error("Trying to redefine `"+s+"` which is a "+typeof r[s]);return}r[s]={}}this._fill(e,r[s],n,i)}else{if(!this.override&&o(r[s])&&!a(r[s])){if(!o(n)||!a(n))throw new Error("Trying to redefine non-empty obj['"+s+"']");return}r[s]=t(n,i)}},u.prototype.object=function(e,r){var n=this;return Object.keys(e).forEach(function(o){var a=void 0===r?null:r[o],i=l(o,n.separator).join(n.separator);-1!==i.indexOf(n.separator)?(n._fill(i.split(n.separator),e,e[o],a),delete e[o]):e[o]=t(e[o],a)}),e},u.prototype.str=function(e,r,n,o){var a=l(e,this.separator).join(this.separator);return-1!==e.indexOf(this.separator)?this._fill(a.split(this.separator),n,r,o):n[e]=t(r,o),n},u.prototype.pick=function(e,t,n,o){var a,i,s,c,u;for(i=l(e,this.separator),a=0;ad.createElement("svg",{width:"18px",height:"18px",viewBox:"0 0 18 18",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},d.createElement("title",null,"shape-round"),d.createElement("desc",null,"Created with Sketch."),d.createElement("g",{id:"Desktop-0.4",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},d.createElement("g",{id:"widgets/shape-round",transform:"translate(-3.000000, -3.000000)",fill:"#000000"},d.createElement("path",{d:"M12,3 C16.9705627,3 21,7.02943725 21,12 C21,16.9705627 16.9705627,21 12,21 C7.02943725,21 3,16.9705627 3,12 C3,7.02943725 7.02943725,3 12,3 Z M12,5 C8.13400675,5 5,8.13400675 5,12 C5,15.8659932 8.13400675,19 12,19 C15.8659932,19 19,15.8659932 19,12 C19,8.13400675 15.8659932,5 12,5 Z",id:"Combined-Shape"})))),m=()=>d.createElement("svg",{width:"18px",height:"18px",viewBox:"0 0 18 18",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},d.createElement("title",null,"ratio-square"),d.createElement("desc",null,"Created with Sketch."),d.createElement("g",{id:"Desktop-0.4",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},d.createElement("g",{id:"widgets/shape-square",transform:"translate(-3.000000, -3.000000)",fill:"#000000"},d.createElement("path",{d:"M3,3 L3,21 L21,21 L21,3 L3,3 Z M5,5 L5,19 L19,19 L19,5 L5,5 Z",id:"shape"})))),v=()=>d.createElement("svg",{width:"18px",height:"18px",viewBox:"0 0 18 18",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},d.createElement("title",null,"shape-radius"),d.createElement("desc",null,"Created with Sketch."),d.createElement("g",{id:"Desktop-0.4",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},d.createElement("g",{id:"widgets/shape-radius",transform:"translate(-3.000000, -3.000000)",fill:"#000000"},d.createElement("path",{d:"M17,3 C19.209139,3 21,4.790861 21,7 L21,17 C21,19.209139 19.209139,21 17,21 L7,21 C4.790861,21 3,19.209139 3,17 L3,7 C3,4.790861 4.790861,3 7,3 L17,3 Z M17,5 L7,5 C5.9456382,5 5.08183488,5.81587779 5.00548574,6.85073766 L5,7 L5,17 C5,18.0543618 5.81587779,18.9181651 6.85073766,18.9945143 L7,19 L17,19 C18.0543618,19 18.9181651,18.1841222 18.9945143,17.1492623 L19,17 L19,7 C19,5.9456382 18.1841222,5.08183488 17.1492623,5.00548574 L17,5 Z",id:"Rectangle"})))),h=()=>d.createElement("svg",{width:"18px",height:"18px",viewBox:"0 0 18 18",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},d.createElement("title",null,"shape-none"),d.createElement("desc",null,"Created with Sketch."),d.createElement("g",{id:"Desktop-0.4",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},d.createElement("g",{id:"widgets/shape-none",transform:"translate(-3.000000, -3.000000)",fill:"#000000"},d.createElement("path",{d:"M5,19 L5,21 L3,21 L3,19 L5,19 Z M21,19 L21,21 L19,21 L19,19 L21,19 Z M13,19 L13,21 L11,21 L11,19 L13,19 Z M9,19 L9,21 L7,21 L7,19 L9,19 Z M17,19 L17,21 L15,21 L15,19 L17,19 Z M21,15 L21,17 L19,17 L19,15 L21,15 Z M21,11 L21,13 L19,13 L19,11 L21,11 Z M5,11 L5,13 L3,13 L3,11 L5,11 Z M21,7 L21,9 L19,9 L19,7 L21,7 Z M5,7 L5,9 L3,9 L3,7 L5,7 Z M13,3 L13,5 L11,5 L11,3 L13,3 Z M9,3 L9,5 L7,5 L7,3 L9,3 Z M17,3 L17,5 L15,5 L15,3 L17,3 Z M21,3 L21,5 L19,5 L19,3 L21,3 Z M5,3 L5,5 L3,5 L3,3 L5,3 Z M3,15 L5,15 L5,17 L3,17 L3,15 Z",id:"Shape"})))),y=[{value:{type:"expanded",columns:1},icon:()=>d.createElement("svg",{width:"17px",height:"20px",viewBox:"0 0 17 20",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},d.createElement("title",null,"layout-modern"),d.createElement("desc",null,"Created with Sketch."),d.createElement("g",{id:"Desktop-0.4",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},d.createElement("g",{id:"widgets/layout-modern",transform:"translate(-2.000000, -3.000000)",fill:"#000000"},d.createElement("path",{d:"M2,10 L5,10 L5,7 L2,7 L2,10 Z M2,14 L5,14 L5,11 L2,11 L2,14 Z M2,6 L5,6 L5,3 L2,3 L2,6 Z M6,3 L6,17 L19,17 L19,3 L6,3 Z M8,5 L8,15 L17,15 L17,5 L8,5 Z M6,18 L6,23 L19,23 L19,18 L6,18 Z M8,20 L8,23 L17,23 L17,20 L8,20 Z",id:"shape"})))),label:(0,t.__)("Expanded - 1 Column","cloudinary")},{value:{type:"expanded",columns:2},icon:()=>d.createElement("svg",{width:"18px",height:"17px",viewBox:"0 0 18 17",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},d.createElement("title",null,"layout-grid-2-column"),d.createElement("desc",null,"Created with Sketch."),d.createElement("g",{id:"Desktop-0.4",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},d.createElement("g",{id:"widgets/layout-gird-2-col",transform:"translate(-3.000000, -3.000000)",fill:"#000000"},d.createElement("path",{d:"M11,12 L11,20 L3,20 L3,12 L11,12 Z M21,12 L21,20 L13,20 L13,12 L21,12 Z M9,14 L5,14 L5,18 L9,18 L9,14 Z M19,14 L15,14 L15,18 L19,18 L19,14 Z M11,3 L11,11 L3,11 L3,3 L11,3 Z M21,3 L21,11 L13,11 L13,3 L21,3 Z M9,5 L5,5 L5,9 L9,9 L9,5 Z M19,5 L15,5 L15,9 L19,9 L19,5 Z",id:"Shape"})))),label:(0,t.__)("Expanded - 2 Column","cloudinary")},{value:{type:"expanded",columns:3},icon:()=>d.createElement("svg",{width:"20px",height:"13px",viewBox:"0 0 20 13",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},d.createElement("title",null,"layout-grid-3-column"),d.createElement("desc",null,"Created with Sketch."),d.createElement("g",{id:"Desktop-0.4",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},d.createElement("g",{id:"widgets/layout-gird-3-col",transform:"translate(-2.000000, -5.000000)",fill:"#000000"},d.createElement("path",{d:"M8,12 L8,18 L2,18 L2,12 L8,12 Z M15,12 L15,18 L9,18 L9,12 L15,12 Z M22,12 L22,18 L16,18 L16,12 L22,12 Z M6,14 L4,14 L4,16 L6,16 L6,14 Z M13,14 L11,14 L11,16 L13,16 L13,14 Z M20,14 L18,14 L18,16 L20,16 L20,14 Z M8,5 L8,11 L2,11 L2,5 L8,5 Z M15,5 L15,11 L9,11 L9,5 L15,5 Z M22,5 L22,11 L16,11 L16,5 L22,5 Z M6,7 L4,7 L4,9 L6,9 L6,7 Z M13,7 L11,7 L11,9 L13,9 L13,7 Z M20,7 L18,7 L18,9 L20,9 L20,7 Z",id:"Combined-Shape"})))),label:(0,t.__)("Expanded - 3 Column","cloudinary")},{value:{type:"classic",columns:1},icon:()=>d.createElement("svg",{width:"17px",height:"14px",viewBox:"0 0 17 14",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},d.createElement("title",null,"layout-classic"),d.createElement("desc",null,"Created with Sketch."),d.createElement("g",{id:"Desktop-0.4",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},d.createElement("g",{id:"widgets/layout-classic",transform:"translate(-3.000000, -5.000000)",fill:"#000000"},d.createElement("path",{d:"M3,12 L6,12 L6,9 L3,9 L3,12 Z M3,16 L6,16 L6,13 L3,13 L3,16 Z M3,8 L6,8 L6,5 L3,5 L3,8 Z M7,5 L7,19 L20,19 L20,5 L7,5 Z M9,7 L9,17 L18,17 L18,7 L9,7 Z",id:"shape"})))),label:(0,t.__)("Classic","cloudinary")}],g=["image"],b=[{label:(0,t.__)("1:1","cloudinary"),value:"1:1"},{label:(0,t.__)("3:4","cloudinary"),value:"3:4"},{label:(0,t.__)("4:3","cloudinary"),value:"4:3"},{label:(0,t.__)("4:6","cloudinary"),value:"4:6"},{label:(0,t.__)("6:4","cloudinary"),value:"6:4"},{label:(0,t.__)("5:7","cloudinary"),value:"5:7"},{label:(0,t.__)("7:5","cloudinary"),value:"7:5"},{label:(0,t.__)("8:5","cloudinary"),value:"8:5"},{label:(0,t.__)("5:8","cloudinary"),value:"5:8"},{label:(0,t.__)("9:16","cloudinary"),value:"9:16"},{label:(0,t.__)("16:9","cloudinary"),value:"16:9"}],_=[{label:(0,t.__)("None","cloudinary"),value:"none"},{label:(0,t.__)("Fade","cloudinary"),value:"fade"},{label:(0,t.__)("Slide","cloudinary"),value:"slide"}],x=[{label:(0,t.__)("Always","cloudinary"),value:"always"},{label:(0,t.__)("None","cloudinary"),value:"none"},{label:(0,t.__)("MouseOver","cloudinary"),value:"mouseover"}],w=[{label:(0,t.__)("Inline","cloudinary"),value:"inline"},{label:(0,t.__)("Flyout","cloudinary"),value:"flyout"},{label:(0,t.__)("Popup","cloudinary"),value:"popup"}],L=[{label:(0,t.__)("Top","cloudinary"),value:"top"},{label:(0,t.__)("Bottom","cloudinary"),value:"bottom"},{label:(0,t.__)("Left","cloudinary"),value:"left"},{label:(0,t.__)("Right","cloudinary"),value:"right"}],E=[{label:(0,t.__)("Click","cloudinary"),value:"click"},{label:(0,t.__)("Hover","cloudinary"),value:"hover"}],O=[{label:(0,t.__)("Left","cloudinary"),value:"left"},{label:(0,t.__)("Right","cloudinary"),value:"right"},{label:(0,t.__)("Top","cloudinary"),value:"top"},{label:(0,t.__)("Bottom","cloudinary"),value:"bottom"}],j=[{label:(0,t.__)("Thumbnails","cloudinary"),value:"thumbnails"},{label:(0,t.__)("Indicators","cloudinary"),value:"indicators"},{label:(0,t.__)("None","cloudinary"),value:"none"}],A=[{value:"round",icon:f,label:(0,t.__)("Round","cloudinary")},{value:"radius",icon:v,label:(0,t.__)("Radius","cloudinary")},{value:"none",icon:h,label:(0,t.__)("None","cloudinary")},{value:"square",icon:m,label:(0,t.__)("Square","cloudinary")},{value:"rectangle",icon:()=>d.createElement("svg",{width:"14px",height:"20px",viewBox:"0 0 14 20",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},d.createElement("title",null,"ratio-9-16"),d.createElement("desc",null,"Created with Sketch."),d.createElement("g",{id:"Desktop-0.4",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},d.createElement("g",{id:"ratio/9-16",transform:"translate(-5.000000, -2.000000)",fill:"#000000"},d.createElement("path",{d:"M22,5.5 L22,18.5 L2,18.5 L2,5.5 L22,5.5 Z M20,7.5 L4,7.5 L4,16.5 L20,16.5 L20,7.5 Z",id:"Combined-Shape",transform:"translate(12.000000, 12.000000) rotate(-90.000000) translate(-12.000000, -12.000000) "})))),label:(0,t.__)("Rectangle","cloudinary")}],k=[{value:"round",icon:f,label:(0,t.__)("Round","cloudinary")},{value:"radius",icon:v,label:(0,t.__)("Radius","cloudinary")},{value:"square",icon:m,label:(0,t.__)("Square","cloudinary")}],P=[{label:(0,t.__)("All","cloudinary"),value:"all"},{label:(0,t.__)("Border","cloudinary"),value:"border"},{label:(0,t.__)("Gradient","cloudinary"),value:"gradient"}],S=[{label:(0,t.__)("All","cloudinary"),value:"all"},{label:(0,t.__)("Top","cloudinary"),value:"top"},{label:(0,t.__)("Top-Bottom","cloudinary"),value:"top-bottom"},{label:(0,t.__)("Left-Right","cloudinary"),value:"left-right"},{label:(0,t.__)("Bottom","cloudinary"),value:"bottom"},{label:(0,t.__)("Left","cloudinary"),value:"left"},{label:(0,t.__)("Right","cloudinary"),value:"right"}],C=[{value:"round",icon:f,label:(0,t.__)("Round","cloudinary")},{value:"radius",icon:v,label:(0,t.__)("Radius","cloudinary")},{value:"none",icon:h,label:(0,t.__)("None","cloudinary")},{value:"square",icon:m,label:(0,t.__)("Square","cloudinary")}],M=[{label:(0,t.__)("Pad","cloudinary"),value:"pad"},{label:(0,t.__)("Fill","cloudinary"),value:"fill"}],B=[{label:(0,t.__)("White padding","cloudinary"),value:"rgb:FFFFFF"},{label:(0,t.__)("Border color padding","cloudinary"),value:"auto"},{label:(0,t.__)("Predominant color padding","cloudinary"),value:"auto:predominant"},{label:(0,t.__)("Gradient fade padding","cloudinary"),value:"auto:predominant_gradient"}];var T=r(6942),D=r.n(T),N=r(6087);const R=({value:e,children:t,icon:r,onChange:n,current:o})=>{const a="object"==typeof e?JSON.stringify(e)===JSON.stringify(o):o===e;return N.createElement("button",{type:"button",onClick:()=>n(e),className:D()("radio-select",{"radio-select--active":a})},N.createElement(r,null),N.createElement("div",{className:"radio-select__label"},t))};r.dn(R);const Z=window.wp.data,z=e=>e<10?"0"+String(e):e.toString(16),I=e=>{const t=new Uint8Array((e||40)/2);return window.crypto.getRandomValues(t),Array.from(t,z).join("")},F=e=>{const t=/var\((.*)\)/g.exec(e);return t?getComputedStyle(document.documentElement).getPropertyValue(t[1]):e};function W(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function H(e){return e instanceof W(e).Element||e instanceof Element}function V(e){return e instanceof W(e).HTMLElement||e instanceof HTMLElement}function U(e){return"undefined"!=typeof ShadowRoot&&(e instanceof W(e).ShadowRoot||e instanceof ShadowRoot)}var q=Math.max,$=Math.min,G=Math.round;function X(){var e=navigator.userAgentData;return null!=e&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function J(){return!/^((?!chrome|android).)*safari/i.test(X())}function Y(e,t,r){void 0===t&&(t=!1),void 0===r&&(r=!1);var n=e.getBoundingClientRect(),o=1,a=1;t&&V(e)&&(o=e.offsetWidth>0&&G(n.width)/e.offsetWidth||1,a=e.offsetHeight>0&&G(n.height)/e.offsetHeight||1);var i=(H(e)?W(e):window).visualViewport,s=!J()&&r,l=(n.left+(s&&i?i.offsetLeft:0))/o,c=(n.top+(s&&i?i.offsetTop:0))/a,u=n.width/o,p=n.height/a;return{width:u,height:p,top:c,right:l+u,bottom:c+p,left:l,x:l,y:c}}function K(e){var t=W(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function Q(e){return e?(e.nodeName||"").toLowerCase():null}function ee(e){return((H(e)?e.ownerDocument:e.document)||window.document).documentElement}function te(e){return Y(ee(e)).left+K(e).scrollLeft}function re(e){return W(e).getComputedStyle(e)}function ne(e){var t=re(e),r=t.overflow,n=t.overflowX,o=t.overflowY;return/auto|scroll|overlay|hidden/.test(r+o+n)}function oe(e,t,r){void 0===r&&(r=!1);var n,o,a=V(t),i=V(t)&&function(e){var t=e.getBoundingClientRect(),r=G(t.width)/e.offsetWidth||1,n=G(t.height)/e.offsetHeight||1;return 1!==r||1!==n}(t),s=ee(t),l=Y(e,i,r),c={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(a||!a&&!r)&&(("body"!==Q(t)||ne(s))&&(c=(n=t)!==W(n)&&V(n)?{scrollLeft:(o=n).scrollLeft,scrollTop:o.scrollTop}:K(n)),V(t)?((u=Y(t,!0)).x+=t.clientLeft,u.y+=t.clientTop):s&&(u.x=te(s))),{x:l.left+c.scrollLeft-u.x,y:l.top+c.scrollTop-u.y,width:l.width,height:l.height}}function ae(e){var t=Y(e),r=e.offsetWidth,n=e.offsetHeight;return Math.abs(t.width-r)<=1&&(r=t.width),Math.abs(t.height-n)<=1&&(n=t.height),{x:e.offsetLeft,y:e.offsetTop,width:r,height:n}}function ie(e){return"html"===Q(e)?e:e.assignedSlot||e.parentNode||(U(e)?e.host:null)||ee(e)}function se(e){return["html","body","#document"].indexOf(Q(e))>=0?e.ownerDocument.body:V(e)&&ne(e)?e:se(ie(e))}function le(e,t){var r;void 0===t&&(t=[]);var n=se(e),o=n===(null==(r=e.ownerDocument)?void 0:r.body),a=W(n),i=o?[a].concat(a.visualViewport||[],ne(n)?n:[]):n,s=t.concat(i);return o?s:s.concat(le(ie(i)))}function ce(e){return["table","td","th"].indexOf(Q(e))>=0}function ue(e){return V(e)&&"fixed"!==re(e).position?e.offsetParent:null}function pe(e){for(var t=W(e),r=ue(e);r&&ce(r)&&"static"===re(r).position;)r=ue(r);return r&&("html"===Q(r)||"body"===Q(r)&&"static"===re(r).position)?t:r||function(e){var t=/firefox/i.test(X());if(/Trident/i.test(X())&&V(e)&&"fixed"===re(e).position)return null;var r=ie(e);for(U(r)&&(r=r.host);V(r)&&["html","body"].indexOf(Q(r))<0;){var n=re(r);if("none"!==n.transform||"none"!==n.perspective||"paint"===n.contain||-1!==["transform","perspective"].indexOf(n.willChange)||t&&"filter"===n.willChange||t&&n.filter&&"none"!==n.filter)return r;r=r.parentNode}return null}(e)||t}var de="top",fe="bottom",me="right",ve="left",he="auto",ye=[de,fe,me,ve],ge="start",be="end",_e="viewport",xe="popper",we=ye.reduce(function(e,t){return e.concat([t+"-"+ge,t+"-"+be])},[]),Le=[].concat(ye,[he]).reduce(function(e,t){return e.concat([t,t+"-"+ge,t+"-"+be])},[]),Ee=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function Oe(e){var t=new Map,r=new Set,n=[];function o(e){r.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach(function(e){if(!r.has(e)){var n=t.get(e);n&&o(n)}}),n.push(e)}return e.forEach(function(e){t.set(e.name,e)}),e.forEach(function(e){r.has(e.name)||o(e)}),n}var je={placement:"bottom",modifiers:[],strategy:"absolute"};function Ae(){for(var e=arguments.length,t=new Array(e),r=0;r=0?"x":"y"}function Be(e){var t,r=e.reference,n=e.element,o=e.placement,a=o?Se(o):null,i=o?Ce(o):null,s=r.x+r.width/2-n.width/2,l=r.y+r.height/2-n.height/2;switch(a){case de:t={x:s,y:r.y-n.height};break;case fe:t={x:s,y:r.y+r.height};break;case me:t={x:r.x+r.width,y:l};break;case ve:t={x:r.x-n.width,y:l};break;default:t={x:r.x,y:r.y}}var c=a?Me(a):null;if(null!=c){var u="y"===c?"height":"width";switch(i){case ge:t[c]=t[c]-(r[u]/2-n[u]/2);break;case be:t[c]=t[c]+(r[u]/2-n[u]/2)}}return t}var Te={top:"auto",right:"auto",bottom:"auto",left:"auto"};function De(e){var t,r=e.popper,n=e.popperRect,o=e.placement,a=e.variation,i=e.offsets,s=e.position,l=e.gpuAcceleration,c=e.adaptive,u=e.roundOffsets,p=e.isFixed,d=i.x,f=void 0===d?0:d,m=i.y,v=void 0===m?0:m,h="function"==typeof u?u({x:f,y:v}):{x:f,y:v};f=h.x,v=h.y;var y=i.hasOwnProperty("x"),g=i.hasOwnProperty("y"),b=ve,_=de,x=window;if(c){var w=pe(r),L="clientHeight",E="clientWidth";if(w===W(r)&&"static"!==re(w=ee(r)).position&&"absolute"===s&&(L="scrollHeight",E="scrollWidth"),o===de||(o===ve||o===me)&&a===be)_=fe,v-=(p&&w===x&&x.visualViewport?x.visualViewport.height:w[L])-n.height,v*=l?1:-1;if(o===ve||(o===de||o===fe)&&a===be)b=me,f-=(p&&w===x&&x.visualViewport?x.visualViewport.width:w[E])-n.width,f*=l?1:-1}var O,j=Object.assign({position:s},c&&Te),A=!0===u?function(e,t){var r=e.x,n=e.y,o=t.devicePixelRatio||1;return{x:G(r*o)/o||0,y:G(n*o)/o||0}}({x:f,y:v},W(r)):{x:f,y:v};return f=A.x,v=A.y,l?Object.assign({},j,((O={})[_]=g?"0":"",O[b]=y?"0":"",O.transform=(x.devicePixelRatio||1)<=1?"translate("+f+"px, "+v+"px)":"translate3d("+f+"px, "+v+"px, 0)",O)):Object.assign({},j,((t={})[_]=g?v+"px":"",t[b]=y?f+"px":"",t.transform="",t))}const Ne={name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach(function(e){var r=t.styles[e]||{},n=t.attributes[e]||{},o=t.elements[e];V(o)&&Q(o)&&(Object.assign(o.style,r),Object.keys(n).forEach(function(e){var t=n[e];!1===t?o.removeAttribute(e):o.setAttribute(e,!0===t?"":t)}))})},effect:function(e){var t=e.state,r={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,r.popper),t.styles=r,t.elements.arrow&&Object.assign(t.elements.arrow.style,r.arrow),function(){Object.keys(t.elements).forEach(function(e){var n=t.elements[e],o=t.attributes[e]||{},a=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:r[e]).reduce(function(e,t){return e[t]="",e},{});V(n)&&Q(n)&&(Object.assign(n.style,a),Object.keys(o).forEach(function(e){n.removeAttribute(e)}))})}},requires:["computeStyles"]};const Re={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,r=e.options,n=e.name,o=r.offset,a=void 0===o?[0,0]:o,i=Le.reduce(function(e,r){return e[r]=function(e,t,r){var n=Se(e),o=[ve,de].indexOf(n)>=0?-1:1,a="function"==typeof r?r(Object.assign({},t,{placement:e})):r,i=a[0],s=a[1];return i=i||0,s=(s||0)*o,[ve,me].indexOf(n)>=0?{x:s,y:i}:{x:i,y:s}}(r,t.rects,a),e},{}),s=i[t.placement],l=s.x,c=s.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=c),t.modifiersData[n]=i}};var Ze={left:"right",right:"left",bottom:"top",top:"bottom"};function ze(e){return e.replace(/left|right|bottom|top/g,function(e){return Ze[e]})}var Ie={start:"end",end:"start"};function Fe(e){return e.replace(/start|end/g,function(e){return Ie[e]})}function We(e,t){var r=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(r&&U(r)){var n=t;do{if(n&&e.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function He(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function Ve(e,t,r){return t===_e?He(function(e,t){var r=W(e),n=ee(e),o=r.visualViewport,a=n.clientWidth,i=n.clientHeight,s=0,l=0;if(o){a=o.width,i=o.height;var c=J();(c||!c&&"fixed"===t)&&(s=o.offsetLeft,l=o.offsetTop)}return{width:a,height:i,x:s+te(e),y:l}}(e,r)):H(t)?function(e,t){var r=Y(e,!1,"fixed"===t);return r.top=r.top+e.clientTop,r.left=r.left+e.clientLeft,r.bottom=r.top+e.clientHeight,r.right=r.left+e.clientWidth,r.width=e.clientWidth,r.height=e.clientHeight,r.x=r.left,r.y=r.top,r}(t,r):He(function(e){var t,r=ee(e),n=K(e),o=null==(t=e.ownerDocument)?void 0:t.body,a=q(r.scrollWidth,r.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),i=q(r.scrollHeight,r.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),s=-n.scrollLeft+te(e),l=-n.scrollTop;return"rtl"===re(o||r).direction&&(s+=q(r.clientWidth,o?o.clientWidth:0)-a),{width:a,height:i,x:s,y:l}}(ee(e)))}function Ue(e,t,r,n){var o="clippingParents"===t?function(e){var t=le(ie(e)),r=["absolute","fixed"].indexOf(re(e).position)>=0&&V(e)?pe(e):e;return H(r)?t.filter(function(e){return H(e)&&We(e,r)&&"body"!==Q(e)}):[]}(e):[].concat(t),a=[].concat(o,[r]),i=a[0],s=a.reduce(function(t,r){var o=Ve(e,r,n);return t.top=q(o.top,t.top),t.right=$(o.right,t.right),t.bottom=$(o.bottom,t.bottom),t.left=q(o.left,t.left),t},Ve(e,i,n));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function qe(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function $e(e,t){return t.reduce(function(t,r){return t[r]=e,t},{})}function Ge(e,t){void 0===t&&(t={});var r=t,n=r.placement,o=void 0===n?e.placement:n,a=r.strategy,i=void 0===a?e.strategy:a,s=r.boundary,l=void 0===s?"clippingParents":s,c=r.rootBoundary,u=void 0===c?_e:c,p=r.elementContext,d=void 0===p?xe:p,f=r.altBoundary,m=void 0!==f&&f,v=r.padding,h=void 0===v?0:v,y=qe("number"!=typeof h?h:$e(h,ye)),g=d===xe?"reference":xe,b=e.rects.popper,_=e.elements[m?g:d],x=Ue(H(_)?_:_.contextElement||ee(e.elements.popper),l,u,i),w=Y(e.elements.reference),L=Be({reference:w,element:b,strategy:"absolute",placement:o}),E=He(Object.assign({},b,L)),O=d===xe?E:w,j={top:x.top-O.top+y.top,bottom:O.bottom-x.bottom+y.bottom,left:x.left-O.left+y.left,right:O.right-x.right+y.right},A=e.modifiersData.offset;if(d===xe&&A){var k=A[o];Object.keys(j).forEach(function(e){var t=[me,fe].indexOf(e)>=0?1:-1,r=[de,fe].indexOf(e)>=0?"y":"x";j[e]+=k[r]*t})}return j}function Xe(e,t,r){return q(e,$(t,r))}const Je={name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,r=e.options,n=e.name,o=r.mainAxis,a=void 0===o||o,i=r.altAxis,s=void 0!==i&&i,l=r.boundary,c=r.rootBoundary,u=r.altBoundary,p=r.padding,d=r.tether,f=void 0===d||d,m=r.tetherOffset,v=void 0===m?0:m,h=Ge(t,{boundary:l,rootBoundary:c,padding:p,altBoundary:u}),y=Se(t.placement),g=Ce(t.placement),b=!g,_=Me(y),x="x"===_?"y":"x",w=t.modifiersData.popperOffsets,L=t.rects.reference,E=t.rects.popper,O="function"==typeof v?v(Object.assign({},t.rects,{placement:t.placement})):v,j="number"==typeof O?{mainAxis:O,altAxis:O}:Object.assign({mainAxis:0,altAxis:0},O),A=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,k={x:0,y:0};if(w){if(a){var P,S="y"===_?de:ve,C="y"===_?fe:me,M="y"===_?"height":"width",B=w[_],T=B+h[S],D=B-h[C],N=f?-E[M]/2:0,R=g===ge?L[M]:E[M],Z=g===ge?-E[M]:-L[M],z=t.elements.arrow,I=f&&z?ae(z):{width:0,height:0},F=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},W=F[S],H=F[C],V=Xe(0,L[M],I[M]),U=b?L[M]/2-N-V-W-j.mainAxis:R-V-W-j.mainAxis,G=b?-L[M]/2+N+V+H+j.mainAxis:Z+V+H+j.mainAxis,X=t.elements.arrow&&pe(t.elements.arrow),J=X?"y"===_?X.clientTop||0:X.clientLeft||0:0,Y=null!=(P=null==A?void 0:A[_])?P:0,K=B+G-Y,Q=Xe(f?$(T,B+U-Y-J):T,B,f?q(D,K):D);w[_]=Q,k[_]=Q-B}if(s){var ee,te="x"===_?de:ve,re="x"===_?fe:me,ne=w[x],oe="y"===x?"height":"width",ie=ne+h[te],se=ne-h[re],le=-1!==[de,ve].indexOf(y),ce=null!=(ee=null==A?void 0:A[x])?ee:0,ue=le?ie:ne-L[oe]-E[oe]-ce+j.altAxis,he=le?ne+L[oe]+E[oe]-ce-j.altAxis:se,ye=f&&le?function(e,t,r){var n=Xe(e,t,r);return n>r?r:n}(ue,ne,he):Xe(f?ue:ie,ne,f?he:se);w[x]=ye,k[x]=ye-ne}t.modifiersData[n]=k}},requiresIfExists:["offset"]};const Ye={name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,r=e.state,n=e.name,o=e.options,a=r.elements.arrow,i=r.modifiersData.popperOffsets,s=Se(r.placement),l=Me(s),c=[ve,me].indexOf(s)>=0?"height":"width";if(a&&i){var u=function(e,t){return qe("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:$e(e,ye))}(o.padding,r),p=ae(a),d="y"===l?de:ve,f="y"===l?fe:me,m=r.rects.reference[c]+r.rects.reference[l]-i[l]-r.rects.popper[c],v=i[l]-r.rects.reference[l],h=pe(a),y=h?"y"===l?h.clientHeight||0:h.clientWidth||0:0,g=m/2-v/2,b=u[d],_=y-p[c]-u[f],x=y/2-p[c]/2+g,w=Xe(b,x,_),L=l;r.modifiersData[n]=((t={})[L]=w,t.centerOffset=w-x,t)}},effect:function(e){var t=e.state,r=e.options.element,n=void 0===r?"[data-popper-arrow]":r;null!=n&&("string"!=typeof n||(n=t.elements.popper.querySelector(n)))&&We(t.elements.popper,n)&&(t.elements.arrow=n)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Ke(e,t,r){return void 0===r&&(r={x:0,y:0}),{top:e.top-t.height-r.y,right:e.right-t.width+r.x,bottom:e.bottom-t.height+r.y,left:e.left-t.width-r.x}}function Qe(e){return[de,me,fe,ve].some(function(t){return e[t]>=0})}var et=ke({defaultModifiers:[{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var t=e.state,r=e.instance,n=e.options,o=n.scroll,a=void 0===o||o,i=n.resize,s=void 0===i||i,l=W(t.elements.popper),c=[].concat(t.scrollParents.reference,t.scrollParents.popper);return a&&c.forEach(function(e){e.addEventListener("scroll",r.update,Pe)}),s&&l.addEventListener("resize",r.update,Pe),function(){a&&c.forEach(function(e){e.removeEventListener("scroll",r.update,Pe)}),s&&l.removeEventListener("resize",r.update,Pe)}},data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,r=e.name;t.modifiersData[r]=Be({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}},{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,r=e.options,n=r.gpuAcceleration,o=void 0===n||n,a=r.adaptive,i=void 0===a||a,s=r.roundOffsets,l=void 0===s||s,c={placement:Se(t.placement),variation:Ce(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:o,isFixed:"fixed"===t.options.strategy};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,De(Object.assign({},c,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:i,roundOffsets:l})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,De(Object.assign({},c,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}},Ne,Re,{name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,r=e.options,n=e.name;if(!t.modifiersData[n]._skip){for(var o=r.mainAxis,a=void 0===o||o,i=r.altAxis,s=void 0===i||i,l=r.fallbackPlacements,c=r.padding,u=r.boundary,p=r.rootBoundary,d=r.altBoundary,f=r.flipVariations,m=void 0===f||f,v=r.allowedAutoPlacements,h=t.options.placement,y=Se(h),g=l||(y===h||!m?[ze(h)]:function(e){if(Se(e)===he)return[];var t=ze(e);return[Fe(e),t,Fe(t)]}(h)),b=[h].concat(g).reduce(function(e,r){return e.concat(Se(r)===he?function(e,t){void 0===t&&(t={});var r=t,n=r.placement,o=r.boundary,a=r.rootBoundary,i=r.padding,s=r.flipVariations,l=r.allowedAutoPlacements,c=void 0===l?Le:l,u=Ce(n),p=u?s?we:we.filter(function(e){return Ce(e)===u}):ye,d=p.filter(function(e){return c.indexOf(e)>=0});0===d.length&&(d=p);var f=d.reduce(function(t,r){return t[r]=Ge(e,{placement:r,boundary:o,rootBoundary:a,padding:i})[Se(r)],t},{});return Object.keys(f).sort(function(e,t){return f[e]-f[t]})}(t,{placement:r,boundary:u,rootBoundary:p,padding:c,flipVariations:m,allowedAutoPlacements:v}):r)},[]),_=t.rects.reference,x=t.rects.popper,w=new Map,L=!0,E=b[0],O=0;O=0,S=P?"width":"height",C=Ge(t,{placement:j,boundary:u,rootBoundary:p,altBoundary:d,padding:c}),M=P?k?me:ve:k?fe:de;_[S]>x[S]&&(M=ze(M));var B=ze(M),T=[];if(a&&T.push(C[A]<=0),s&&T.push(C[M]<=0,C[B]<=0),T.every(function(e){return e})){E=j,L=!1;break}w.set(j,T)}if(L)for(var D=function(e){var t=b.find(function(t){var r=w.get(t);if(r)return r.slice(0,e).every(function(e){return e})});if(t)return E=t,"break"},N=m?3:1;N>0;N--){if("break"===D(N))break}t.placement!==E&&(t.modifiersData[n]._skip=!0,t.placement=E,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}},Je,Ye,{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,r=e.name,n=t.rects.reference,o=t.rects.popper,a=t.modifiersData.preventOverflow,i=Ge(t,{elementContext:"reference"}),s=Ge(t,{altBoundary:!0}),l=Ke(i,n),c=Ke(s,o,a),u=Qe(l),p=Qe(c);t.modifiersData[r]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:u,hasPopperEscaped:p},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":p})}}]}),tt="tippy-content",rt="tippy-backdrop",nt="tippy-arrow",ot="tippy-svg-arrow",at={passive:!0,capture:!0},it=function(){return document.body};function st(e,t,r){if(Array.isArray(e)){var n=e[t];return n??(Array.isArray(r)?r[t]:r)}return e}function lt(e,t){var r={}.toString.call(e);return 0===r.indexOf("[object")&&r.indexOf(t+"]")>-1}function ct(e,t){return"function"==typeof e?e.apply(void 0,t):e}function ut(e,t){return 0===t?e:function(n){clearTimeout(r),r=setTimeout(function(){e(n)},t)};var r}function pt(e){return[].concat(e)}function dt(e,t){-1===e.indexOf(t)&&e.push(t)}function ft(e){return e.split("-")[0]}function mt(e){return[].slice.call(e)}function vt(e){return Object.keys(e).reduce(function(t,r){return void 0!==e[r]&&(t[r]=e[r]),t},{})}function ht(){return document.createElement("div")}function yt(e){return["Element","Fragment"].some(function(t){return lt(e,t)})}function gt(e){return lt(e,"MouseEvent")}function bt(e){return!(!e||!e._tippy||e._tippy.reference!==e)}function _t(e){return yt(e)?[e]:function(e){return lt(e,"NodeList")}(e)?mt(e):Array.isArray(e)?e:mt(document.querySelectorAll(e))}function xt(e,t){e.forEach(function(e){e&&(e.style.transitionDuration=t+"ms")})}function wt(e,t){e.forEach(function(e){e&&e.setAttribute("data-state",t)})}function Lt(e){var t,r=pt(e)[0];return null!=r&&null!=(t=r.ownerDocument)&&t.body?r.ownerDocument:document}function Et(e,t,r){var n=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(t){e[n](t,r)})}function Ot(e,t){for(var r=t;r;){var n;if(e.contains(r))return!0;r=null==r.getRootNode||null==(n=r.getRootNode())?void 0:n.host}return!1}var jt={isTouch:!1},At=0;function kt(){jt.isTouch||(jt.isTouch=!0,window.performance&&document.addEventListener("mousemove",Pt))}function Pt(){var e=performance.now();e-At<20&&(jt.isTouch=!1,document.removeEventListener("mousemove",Pt)),At=e}function St(){var e=document.activeElement;if(bt(e)){var t=e._tippy;e.blur&&!t.state.isVisible&&e.blur()}}var Ct=!!("undefined"!=typeof window&&"undefined"!=typeof document)&&!!window.msCrypto;var Mt={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},Bt=Object.assign({appendTo:it,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},Mt,{allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999}),Tt=Object.keys(Bt);function Dt(e){var t=(e.plugins||[]).reduce(function(t,r){var n,o=r.name,a=r.defaultValue;o&&(t[o]=void 0!==e[o]?e[o]:null!=(n=Bt[o])?n:a);return t},{});return Object.assign({},e,t)}function Nt(e,t){var r=Object.assign({},t,{content:ct(t.content,[e])},t.ignoreAttributes?{}:function(e,t){return(t?Object.keys(Dt(Object.assign({},Bt,{plugins:t}))):Tt).reduce(function(t,r){var n=(e.getAttribute("data-tippy-"+r)||"").trim();if(!n)return t;if("content"===r)t[r]=n;else try{t[r]=JSON.parse(n)}catch(e){t[r]=n}return t},{})}(e,t.plugins));return r.aria=Object.assign({},Bt.aria,r.aria),r.aria={expanded:"auto"===r.aria.expanded?t.interactive:r.aria.expanded,content:"auto"===r.aria.content?t.interactive?null:"describedby":r.aria.content},r}function Rt(e,t){e.innerHTML=t}function Zt(e){var t=ht();return!0===e?t.className=nt:(t.className=ot,yt(e)?t.appendChild(e):Rt(t,e)),t}function zt(e,t){yt(t.content)?(Rt(e,""),e.appendChild(t.content)):"function"!=typeof t.content&&(t.allowHTML?Rt(e,t.content):e.textContent=t.content)}function It(e){var t=e.firstElementChild,r=mt(t.children);return{box:t,content:r.find(function(e){return e.classList.contains(tt)}),arrow:r.find(function(e){return e.classList.contains(nt)||e.classList.contains(ot)}),backdrop:r.find(function(e){return e.classList.contains(rt)})}}function Ft(e){var t=ht(),r=ht();r.className="tippy-box",r.setAttribute("data-state","hidden"),r.setAttribute("tabindex","-1");var n=ht();function o(r,n){var o=It(t),a=o.box,i=o.content,s=o.arrow;n.theme?a.setAttribute("data-theme",n.theme):a.removeAttribute("data-theme"),"string"==typeof n.animation?a.setAttribute("data-animation",n.animation):a.removeAttribute("data-animation"),n.inertia?a.setAttribute("data-inertia",""):a.removeAttribute("data-inertia"),a.style.maxWidth="number"==typeof n.maxWidth?n.maxWidth+"px":n.maxWidth,n.role?a.setAttribute("role",n.role):a.removeAttribute("role"),r.content===n.content&&r.allowHTML===n.allowHTML||zt(i,e.props),n.arrow?s?r.arrow!==n.arrow&&(a.removeChild(s),a.appendChild(Zt(n.arrow))):a.appendChild(Zt(n.arrow)):s&&a.removeChild(s)}return n.className=tt,n.setAttribute("data-state","hidden"),zt(n,e.props),t.appendChild(r),r.appendChild(n),o(e.props,e.props),{popper:t,onUpdate:o}}Ft.$$tippy=!0;var Wt=1,Ht=[],Vt=[];function Ut(e,t){var r,n,o,a,i,s,l,c,u=Nt(e,Object.assign({},Bt,Dt(vt(t)))),p=!1,d=!1,f=!1,m=!1,v=[],h=ut($,u.interactiveDebounce),y=Wt++,g=(c=u.plugins).filter(function(e,t){return c.indexOf(e)===t}),b={id:y,reference:e,popper:ht(),popperInstance:null,props:u,state:{isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},plugins:g,clearDelayTimeouts:function(){clearTimeout(r),clearTimeout(n),cancelAnimationFrame(o)},setProps:function(t){0;if(b.state.isDestroyed)return;B("onBeforeUpdate",[b,t]),U();var r=b.props,n=Nt(e,Object.assign({},r,vt(t),{ignoreAttributes:!0}));b.props=n,V(),r.interactiveDebounce!==n.interactiveDebounce&&(N(),h=ut($,n.interactiveDebounce));r.triggerTarget&&!n.triggerTarget?pt(r.triggerTarget).forEach(function(e){e.removeAttribute("aria-expanded")}):n.triggerTarget&&e.removeAttribute("aria-expanded");D(),M(),w&&w(r,n);b.popperInstance&&(Y(),Q().forEach(function(e){requestAnimationFrame(e._tippy.popperInstance.forceUpdate)}));B("onAfterUpdate",[b,t])},setContent:function(e){b.setProps({content:e})},show:function(){0;var e=b.state.isVisible,t=b.state.isDestroyed,r=!b.state.isEnabled,n=jt.isTouch&&!b.props.touch,o=st(b.props.duration,0,Bt.duration);if(e||t||r||n)return;if(k().hasAttribute("disabled"))return;if(B("onShow",[b],!1),!1===b.props.onShow(b))return;b.state.isVisible=!0,A()&&(x.style.visibility="visible");M(),I(),b.state.isMounted||(x.style.transition="none");if(A()){var a=S();xt([a.box,a.content],0)}s=function(){var e;if(b.state.isVisible&&!m){if(m=!0,x.offsetHeight,x.style.transition=b.props.moveTransition,A()&&b.props.animation){var t=S(),r=t.box,n=t.content;xt([r,n],o),wt([r,n],"visible")}T(),D(),dt(Vt,b),null==(e=b.popperInstance)||e.forceUpdate(),B("onMount",[b]),b.props.animation&&A()&&function(e,t){W(e,t)}(o,function(){b.state.isShown=!0,B("onShown",[b])})}},function(){var e,t=b.props.appendTo,r=k();e=b.props.interactive&&t===it||"parent"===t?r.parentNode:ct(t,[r]);e.contains(x)||e.appendChild(x);b.state.isMounted=!0,Y(),!1}()},hide:function(){0;var e=!b.state.isVisible,t=b.state.isDestroyed,r=!b.state.isEnabled,n=st(b.props.duration,1,Bt.duration);if(e||t||r)return;if(B("onHide",[b],!1),!1===b.props.onHide(b))return;b.state.isVisible=!1,b.state.isShown=!1,m=!1,p=!1,A()&&(x.style.visibility="hidden");if(N(),F(),M(!0),A()){var o=S(),a=o.box,i=o.content;b.props.animation&&(xt([a,i],n),wt([a,i],"hidden"))}T(),D(),b.props.animation?A()&&function(e,t){W(e,function(){!b.state.isVisible&&x.parentNode&&x.parentNode.contains(x)&&t()})}(n,b.unmount):b.unmount()},hideWithInteractivity:function(e){0;P().addEventListener("mousemove",h),dt(Ht,h),h(e)},enable:function(){b.state.isEnabled=!0},disable:function(){b.hide(),b.state.isEnabled=!1},unmount:function(){0;b.state.isVisible&&b.hide();if(!b.state.isMounted)return;K(),Q().forEach(function(e){e._tippy.unmount()}),x.parentNode&&x.parentNode.removeChild(x);Vt=Vt.filter(function(e){return e!==b}),b.state.isMounted=!1,B("onHidden",[b])},destroy:function(){0;if(b.state.isDestroyed)return;b.clearDelayTimeouts(),b.unmount(),U(),delete e._tippy,b.state.isDestroyed=!0,B("onDestroy",[b])}};if(!u.render)return b;var _=u.render(b),x=_.popper,w=_.onUpdate;x.setAttribute("data-tippy-root",""),x.id="tippy-"+b.id,b.popper=x,e._tippy=b,x._tippy=b;var L=g.map(function(e){return e.fn(b)}),E=e.hasAttribute("aria-expanded");return V(),D(),M(),B("onCreate",[b]),u.showOnCreate&&ee(),x.addEventListener("mouseenter",function(){b.props.interactive&&b.state.isVisible&&b.clearDelayTimeouts()}),x.addEventListener("mouseleave",function(){b.props.interactive&&b.props.trigger.indexOf("mouseenter")>=0&&P().addEventListener("mousemove",h)}),b;function O(){var e=b.props.touch;return Array.isArray(e)?e:[e,0]}function j(){return"hold"===O()[0]}function A(){var e;return!(null==(e=b.props.render)||!e.$$tippy)}function k(){return l||e}function P(){var e=k().parentNode;return e?Lt(e):document}function S(){return It(x)}function C(e){return b.state.isMounted&&!b.state.isVisible||jt.isTouch||a&&"focus"===a.type?0:st(b.props.delay,e?0:1,Bt.delay)}function M(e){void 0===e&&(e=!1),x.style.pointerEvents=b.props.interactive&&!e?"":"none",x.style.zIndex=""+b.props.zIndex}function B(e,t,r){var n;(void 0===r&&(r=!0),L.forEach(function(r){r[e]&&r[e].apply(r,t)}),r)&&(n=b.props)[e].apply(n,t)}function T(){var t=b.props.aria;if(t.content){var r="aria-"+t.content,n=x.id;pt(b.props.triggerTarget||e).forEach(function(e){var t=e.getAttribute(r);if(b.state.isVisible)e.setAttribute(r,t?t+" "+n:n);else{var o=t&&t.replace(n,"").trim();o?e.setAttribute(r,o):e.removeAttribute(r)}})}}function D(){!E&&b.props.aria.expanded&&pt(b.props.triggerTarget||e).forEach(function(e){b.props.interactive?e.setAttribute("aria-expanded",b.state.isVisible&&e===k()?"true":"false"):e.removeAttribute("aria-expanded")})}function N(){P().removeEventListener("mousemove",h),Ht=Ht.filter(function(e){return e!==h})}function R(t){if(!jt.isTouch||!f&&"mousedown"!==t.type){var r=t.composedPath&&t.composedPath()[0]||t.target;if(!b.props.interactive||!Ot(x,r)){if(pt(b.props.triggerTarget||e).some(function(e){return Ot(e,r)})){if(jt.isTouch)return;if(b.state.isVisible&&b.props.trigger.indexOf("click")>=0)return}else B("onClickOutside",[b,t]);!0===b.props.hideOnClick&&(b.clearDelayTimeouts(),b.hide(),d=!0,setTimeout(function(){d=!1}),b.state.isMounted||F())}}}function Z(){f=!0}function z(){f=!1}function I(){var e=P();e.addEventListener("mousedown",R,!0),e.addEventListener("touchend",R,at),e.addEventListener("touchstart",z,at),e.addEventListener("touchmove",Z,at)}function F(){var e=P();e.removeEventListener("mousedown",R,!0),e.removeEventListener("touchend",R,at),e.removeEventListener("touchstart",z,at),e.removeEventListener("touchmove",Z,at)}function W(e,t){var r=S().box;function n(e){e.target===r&&(Et(r,"remove",n),t())}if(0===e)return t();Et(r,"remove",i),Et(r,"add",n),i=n}function H(t,r,n){void 0===n&&(n=!1),pt(b.props.triggerTarget||e).forEach(function(e){e.addEventListener(t,r,n),v.push({node:e,eventType:t,handler:r,options:n})})}function V(){var e;j()&&(H("touchstart",q,{passive:!0}),H("touchend",G,{passive:!0})),(e=b.props.trigger,e.split(/\s+/).filter(Boolean)).forEach(function(e){if("manual"!==e)switch(H(e,q),e){case"mouseenter":H("mouseleave",G);break;case"focus":H(Ct?"focusout":"blur",X);break;case"focusin":H("focusout",X)}})}function U(){v.forEach(function(e){var t=e.node,r=e.eventType,n=e.handler,o=e.options;t.removeEventListener(r,n,o)}),v=[]}function q(e){var t,r=!1;if(b.state.isEnabled&&!J(e)&&!d){var n="focus"===(null==(t=a)?void 0:t.type);a=e,l=e.currentTarget,D(),!b.state.isVisible&>(e)&&Ht.forEach(function(t){return t(e)}),"click"===e.type&&(b.props.trigger.indexOf("mouseenter")<0||p)&&!1!==b.props.hideOnClick&&b.state.isVisible?r=!0:ee(e),"click"===e.type&&(p=!r),r&&!n&&te(e)}}function $(e){var t=e.target,r=k().contains(t)||x.contains(t);if("mousemove"!==e.type||!r){var n=Q().concat(x).map(function(e){var t,r=null==(t=e._tippy.popperInstance)?void 0:t.state;return r?{popperRect:e.getBoundingClientRect(),popperState:r,props:u}:null}).filter(Boolean);(function(e,t){var r=t.clientX,n=t.clientY;return e.every(function(e){var t=e.popperRect,o=e.popperState,a=e.props.interactiveBorder,i=ft(o.placement),s=o.modifiersData.offset;if(!s)return!0;var l="bottom"===i?s.top.y:0,c="top"===i?s.bottom.y:0,u="right"===i?s.left.x:0,p="left"===i?s.right.x:0,d=t.top-n+l>a,f=n-t.bottom-c>a,m=t.left-r+u>a,v=r-t.right-p>a;return d||f||m||v})})(n,e)&&(N(),te(e))}}function G(e){J(e)||b.props.trigger.indexOf("click")>=0&&p||(b.props.interactive?b.hideWithInteractivity(e):te(e))}function X(e){b.props.trigger.indexOf("focusin")<0&&e.target!==k()||b.props.interactive&&e.relatedTarget&&x.contains(e.relatedTarget)||te(e)}function J(e){return!!jt.isTouch&&j()!==e.type.indexOf("touch")>=0}function Y(){K();var t=b.props,r=t.popperOptions,n=t.placement,o=t.offset,a=t.getReferenceClientRect,i=t.moveTransition,l=A()?It(x).arrow:null,c=a?{getBoundingClientRect:a,contextElement:a.contextElement||k()}:e,u={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(e){var t=e.state;if(A()){var r=S().box;["placement","reference-hidden","escaped"].forEach(function(e){"placement"===e?r.setAttribute("data-placement",t.placement):t.attributes.popper["data-popper-"+e]?r.setAttribute("data-"+e,""):r.removeAttribute("data-"+e)}),t.attributes.popper={}}}},p=[{name:"offset",options:{offset:o}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!i}},u];A()&&l&&p.push({name:"arrow",options:{element:l,padding:3}}),p.push.apply(p,(null==r?void 0:r.modifiers)||[]),b.popperInstance=et(c,x,Object.assign({},r,{placement:n,onFirstUpdate:s,modifiers:p}))}function K(){b.popperInstance&&(b.popperInstance.destroy(),b.popperInstance=null)}function Q(){return mt(x.querySelectorAll("[data-tippy-root]"))}function ee(e){b.clearDelayTimeouts(),e&&B("onTrigger",[b,e]),I();var t=C(!0),n=O(),o=n[0],a=n[1];jt.isTouch&&"hold"===o&&a&&(t=a),t?r=setTimeout(function(){b.show()},t):b.show()}function te(e){if(b.clearDelayTimeouts(),B("onUntrigger",[b,e]),b.state.isVisible){if(!(b.props.trigger.indexOf("mouseenter")>=0&&b.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(e.type)>=0&&p)){var t=C(!1);t?n=setTimeout(function(){b.state.isVisible&&b.hide()},t):o=requestAnimationFrame(function(){b.hide()})}}else F()}}function qt(e,t){void 0===t&&(t={});var r=Bt.plugins.concat(t.plugins||[]);document.addEventListener("touchstart",kt,at),window.addEventListener("blur",St);var n=Object.assign({},t,{plugins:r}),o=_t(e).reduce(function(e,t){var r=t&&Ut(t,n);return r&&e.push(r),e},[]);return yt(e)?o[0]:o}qt.defaultProps=Bt,qt.setDefaultProps=function(e){Object.keys(e).forEach(function(t){Bt[t]=e[t]})},qt.currentInput=jt;Object.assign({},Ne,{effect:function(e){var t=e.state,r={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(t.elements.popper.style,r.popper),t.styles=r,t.elements.arrow&&Object.assign(t.elements.arrow.style,r.arrow)}});qt.setDefaultProps({render:Ft});const $t=qt;var Gt=r(6087);const Xt=({children:e,value:t})=>Gt.createElement("div",{className:"colorpalette-color-label"},Gt.createElement("span",null,e),Gt.createElement("span",{className:"component-color-indicator","aria-label":`Color: ${t}`,style:{background:t}})),Jt=new(o()())("_"),Yt=({attributes:e,setAttributes:r,colors:n})=>{const o=p()(e),a=Jt.object(o),[i,u]=(0,l.useState)(a.customSettings);e.transformation_crop||(e.transformation_crop="pad",e.transformation_background="rgb:FFFFFF"),"fill"===e.transformation_crop&&delete e.transformation_background;const d=(e,t)=>{const n={[t]:F(e)};r(n)},f=(e=>{const[t,r]=(0,l.useState)(null),n=(0,l.useCallback)(e=>r(e),[]);return(0,l.useEffect)(()=>{if(!t)return;const r=$t(t,{content:e});return()=>{r?.destroy()}},[t,e]),n})((0,t.__)("How to resize or crop images to fit the gallery. Pad adds padding around the image using the specified padding style. Fill crops the image from the center so it fills as much of the available space as possible.","cloudinary"));return Gt.createElement(Gt.Fragment,null,Gt.createElement(s.PanelBody,{title:(0,t.__)("Layout","cloudinary")},y.map(t=>Gt.createElement(R,{key:`${t.value.type}-${t.value.columns}-layout`,value:t.value,onChange:e=>{r({displayProps_mode:e.type,displayProps_columns:e.columns||1})},icon:t.icon,current:{type:e.displayProps_mode,columns:e.displayProps_columns||1}},t.label))),Gt.createElement(s.PanelBody,{title:(0,t.__)("Color Palette","cloudinary"),initialOpen:!1},Gt.createElement(Xt,{value:e.themeProps_primary},(0,t.__)("Primary","cloudinary")),Gt.createElement(c.ColorPalette,{value:e.themeProps_primary,colors:n,disableCustomColors:!1,onChange:e=>d(e,"themeProps_primary")}),Gt.createElement(Xt,{value:e.themeProps_onPrimary},(0,t.__)("On Primary","cloudinary")),Gt.createElement(c.ColorPalette,{value:e.themeProps_onPrimary,colors:n,disableCustomColors:!1,onChange:e=>d(e,"themeProps_onPrimary")}),Gt.createElement(Xt,{value:e.themeProps_active},(0,t.__)("Active","cloudinary")),Gt.createElement(c.ColorPalette,{value:e.themeProps_active,colors:n,disableCustomColors:!1,onChange:e=>d(e,"themeProps_active")})),"classic"===e.displayProps_mode&&Gt.createElement(s.PanelBody,{title:(0,t.__)("Fade Transition","cloudinary"),initialOpen:!1},Gt.createElement(s.SelectControl,{value:e.transition,options:_,onChange:e=>r({transition:e}),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0})),Gt.createElement(s.PanelBody,{title:(0,t.__)("Main Viewer Parameters","cloudinary"),initialOpen:!1},Gt.createElement(s.SelectControl,{label:(0,t.__)("Aspect Ratio","cloudinary"),value:e.aspectRatio,options:b,onChange:e=>r({aspectRatio:e}),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0}),Gt.createElement("p",null,Gt.createElement("div",{className:"cld-ui-title"},(0,t.__)("Resize/Crop Mode","cloudinary"),Gt.createElement("span",{className:"dashicons dashicons-info cld-tooltip",ref:f})),Gt.createElement(s.ButtonGroup,null,M.map(t=>Gt.createElement(s.Button,{key:t.value+"-look-and-feel",variant:"secondary",isSecondary:!0,isPressed:t.value===e.transformation_crop,onClick:()=>r({transformation_crop:t.value,transformation_background:null})},t.label)))),"pad"===e.transformation_crop&&Gt.createElement(s.SelectControl,{label:(0,t.__)("Pad style","cloudinary"),value:e.transformation_background,options:B,onChange:e=>{r({transformation_background:e})},__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0}),Gt.createElement("p",null,(0,t.__)("Navigation","cloudinary")),Gt.createElement("p",null,Gt.createElement(s.ButtonGroup,null,x.map(t=>Gt.createElement(s.Button,{key:t.value+"-navigation",variant:"secondary",isSecondary:!0,isPressed:t.value===e.navigation,onClick:()=>r({navigation:t.value})},t.label)))),Gt.createElement("div",{style:{marginTop:"30px"}},Gt.createElement(s.ToggleControl,{label:(0,t.__)("Show Zoom","cloudinary"),checked:e.zoom,onChange:()=>r({zoom:!e.zoom}),__nextHasNoMarginBottom:!0}),e.zoom&&Gt.createElement(Gt.Fragment,null,Gt.createElement("p",null,(0,t.__)("Zoom Type","cloudinary")),Gt.createElement("p",null,Gt.createElement(s.ButtonGroup,null,w.map(t=>Gt.createElement(s.Button,{key:t.value+"-zoom-type",variant:"secondary",isSecondary:!0,isPressed:t.value===e.zoomProps_type,onClick:()=>r({zoomProps_type:t.value})},t.label)))),"flyout"===e.zoomProps_type&&Gt.createElement(s.SelectControl,{label:(0,t.__)("Zoom Viewer Position","cloudinary"),value:e.zoomProps_viewerPosition,options:L,onChange:e=>r({zoomProps_viewerPosition:e}),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0}),"popup"!==e.zoomProps_type&&Gt.createElement(Gt.Fragment,null,Gt.createElement("p",null,(0,t.__)("Zoom Trigger","cloudinary")),Gt.createElement("p",null,Gt.createElement(s.ButtonGroup,null,E.map(t=>Gt.createElement(s.Button,{key:t.value+"-zoom-trigger",variant:"secondary",isSecondary:!0,isPressed:t.value===e.zoomProps_trigger,onClick:()=>r({zoomProps_trigger:t.value})},t.label)))))))),Gt.createElement(s.PanelBody,{title:(0,t.__)("Carousel Parameters","cloudinary"),initialOpen:!1},Gt.createElement("p",null,(0,t.__)("Carousel Location","cloudinary")),Gt.createElement("p",null,Gt.createElement(s.ButtonGroup,null,O.map(t=>Gt.createElement(s.Button,{key:t.value+"-carousel-location",variant:"secondary",isSecondary:!0,isPressed:t.value===e.carouselLocation,onClick:()=>r({carouselLocation:t.value})},t.label)))),Gt.createElement(s.RangeControl,{label:(0,t.__)("Carousel Offset","cloudinary"),value:e.carouselOffset,onChange:e=>r({carouselOffset:e}),min:0,max:100,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0}),Gt.createElement("p",null,(0,t.__)("Carousel Style","cloudinary")),Gt.createElement("p",null,Gt.createElement(s.ButtonGroup,null,j.map(t=>Gt.createElement(s.Button,{key:t.value+"-carousel-style",variant:"secondary",isSecondary:!0,isPressed:t.value===e.carouselStyle,onClick:()=>r({carouselStyle:t.value})},t.label)))),"thumbnails"===e.carouselStyle&&Gt.createElement(Gt.Fragment,null,Gt.createElement(s.RangeControl,{label:(0,t.__)("Width","cloudinary"),value:e.thumbnailProps_width,onChange:e=>r({thumbnailProps_width:e}),min:5,max:300,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0}),Gt.createElement(s.RangeControl,{label:(0,t.__)("Height","cloudinary"),value:e.thumbnailProps_height,onChange:e=>r({thumbnailProps_height:e}),min:5,max:300,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0}),Gt.createElement("p",null,(0,t.__)("Navigation Button Shape","cloudinary")),A.map(t=>Gt.createElement(R,{key:t.value+"-navigation-button-shape",value:t.value,onChange:e=>r({thumbnailProps_navigationShape:e}),icon:t.icon,current:e.thumbnailProps_navigationShape},t.label)),Gt.createElement("p",null,(0,t.__)("Selected Style","cloudinary")),Gt.createElement("p",null,Gt.createElement(s.ButtonGroup,null,P.map(t=>Gt.createElement(s.Button,{key:t.value+"-selected-style",variant:"secondary",isSecondary:!0,isPressed:t.value===e.thumbnailProps_selectedStyle,onClick:()=>r({thumbnailProps_selectedStyle:t.value})},t.label)))),Gt.createElement(s.SelectControl,{label:(0,t.__)("Selected Border Position","cloudinary"),value:e.thumbnailProps_selectedBorderPosition,options:S,onChange:e=>r({thumbnailProps_selectedBorderPosition:e}),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0}),Gt.createElement(s.RangeControl,{label:(0,t.__)("Selected Border Width","cloudinary"),value:e.thumbnailProps_selectedBorderWidth,onChange:e=>r({thumbnailProps_selectedBorderWidth:e}),min:0,max:10,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0}),Gt.createElement("p",null,(0,t.__)("Media Shape Icon","cloudinary")),C.map(t=>Gt.createElement(R,{key:t.value+"-media",value:t.value,onChange:e=>r({thumbnailProps_mediaSymbolShape:e}),icon:t.icon,current:e.thumbnailProps_mediaSymbolShape},t.label))),"indicators"===e.carouselStyle&&Gt.createElement(Gt.Fragment,null,Gt.createElement("p",null,(0,t.__)("Indicators Shape","cloudinary")),k.map(t=>Gt.createElement(R,{key:t.value+"-indicator",value:t.value,onChange:e=>r({indicatorProps_shape:e}),icon:t.icon,current:e.indicatorProps_shape},t.label)))),Gt.createElement(s.PanelBody,{title:(0,t.__)("Additional Settings","cloudinary"),initialOpen:!1},Gt.createElement(s.TextareaControl,{label:(0,t.__)("Custom Settings","cloudinary"),help:(0,t.__)("Provide a JSON string of the settings you want to add and/or override.","cloudinary"),value:i,onChange:e=>{let t={};u(e);try{t=JSON.parse(e)}catch(e){}if("object"==typeof t){const e={...a};e.customSettings=t,r({...a,...e})}},__nextHasNoMarginBottom:!0})))};var Kt=r(6087);const Qt=new(o()())("_"),er=(0,t.__)("Drag images, upload new ones or select files from your library.","cloudinary"),tr=(e,t)=>({...e,container:"."+t,zoom:!1}),rr=({setAttributes:e,attributes:r,isSelected:n})=>{const[a,u]=(0,l.useState)(null),[d,f]=(0,l.useState)(!1),m=(0,l.useMemo)(()=>{if(0!==r.selectedImages.length)return r;const e={},{container:t,...n}=Qt.dot(CLD_GALLERY_CONFIG);return Object.keys(n).forEach(t=>{r[t]||(e[t]=n[t])}),{...r,...e}},[r]),v=(0,l.useMemo)(()=>r.selectedImages.length?r.selectedImages.map(({attachmentId:e})=>({id:e})):[],[r]);(0,l.useEffect)(()=>{if(a&&((({status:e,message:t,options:r={}})=>{(0,Z.dispatch)("core/notices").createNotice(e,t,{isDismissible:!0,...r})})({status:"error",message:a}),u(null)),r.selectedImages.length){let e;const{customSettings:t,...n}=(e=>{const t=new(o()())("_"),r=p()(e),{selectedImages:n,...a}=t.object(r,{});return a.mediaAssets=n,"classic"!==a?.displayProps?.mode?delete a.transition:delete a.displayProps.columns,"pad"!==a?.transformation_crop&&delete a.transformation_background,"pad"!==a?.transformation?.crop&&delete a.transformation.background,a?.themeProps?.primary&&(a.themeProps.primary=F(a?.themeProps?.primary)),a?.themeProps?.onPrimary&&(a.themeProps.onPrimary=F(a?.themeProps?.onPrimary)),a?.themeProps?.active&&(a.themeProps.active=F(a?.themeProps?.active)),a})(r);try{e=cloudinary.galleryWidget(tr({...n,...t},r.container))}catch{e=cloudinary.galleryWidget(tr(n,r.container))}return e.render(),f(!1),()=>e.destroy()}},[a,r,e]);const h=!!r.selectedImages.length;(0,l.useEffect)(()=>{r.container||e({container:`cld-gallery-${I(15)}`})},[r.container,e]),(0,l.useEffect)(()=>{e(m)},[m,e]);const y=(0,c.useBlockProps)();return Kt.createElement("div",y,Kt.createElement(Kt.Fragment,null,Kt.createElement("div",{className:r.container}),Kt.createElement("div",{className:"wp-block-cloudinary-gallery"},Kt.createElement(c.MediaPlaceholder,{labels:{title:!h&&(0,t.__)("Cloudinary Gallery","cloudinary"),instructions:!h&&er},icon:"format-gallery",disableMediaButtons:h&&!n,allowedTypes:g,addToGallery:h,isAppender:h,onSelect:r=>(async r=>{f(!0);try{const t=await i()({path:CLD_REST_ENDPOINT+"/image_data",method:"POST",data:{images:r}});e({selectedImages:t})}catch{f(!1),u((0,t.__)("Could not load selected images. Please try again.","cloudinary"))}})(r),value:v,multiple:!0},d&&Kt.createElement("div",{className:"loading-spinner-container"},Kt.createElement(s.Spinner,null))))),Kt.createElement(c.InspectorControls,null,Kt.createElement(Yt,{attributes:r,setAttributes:e})))};var nr=r(6087);const or=({attributes:e})=>nr.createElement("div",{className:e.container}),ar=JSON.parse('{"aspectRatio":{"type":"string"},"navigation":{"type":"string"},"zoom":{"type":"boolean"},"carouselLocation":{"type":"string"},"carouselOffset":{"type":"number"},"carouselStyle":{"type":"string"},"displayProps_mode":{"type":"string"},"displayProps_columns":{"type":"number"},"indicatorProps_shape":{"type":"string"},"themeProps_primary":{"type":"string"},"themeProps_onPrimary":{"type":"string"},"themeProps_active":{"type":"string"},"zoomProps_type":{"type":"string"},"zoomProps_viewerPosition":{"type":"string"},"zoomProps_trigger":{"type":"string"},"thumbnailProps_width":{"type":"number"},"thumbnailProps_height":{"type":"number"},"thumbnailProps_navigationShape":{"type":"string"},"thumbnailProps_selectedStyle":{"type":"string"},"thumbnailProps_selectedBorderPosition":{"type":"string"},"thumbnailProps_selectedBorderWidth":{"type":"number"},"thumbnailProps_mediaSymbolShape":{"type":"string"},"cloudName":{"type":"string"},"container":{"type":"string"},"selectedImages":{"type":"array","default":[]},"transformation_crop":{"type":"string","default":"pad"},"transformation_background":{"type":"string"},"customSettings":{"type":"string"}}');(0,n.registerBlockType)("cloudinary/gallery",{apiVersion:2,title:(0,t.__)("Cloudinary Gallery","cloudinary"),description:(0,t.__)("Add a gallery powered by the Cloudinary Gallery Widget to your post.","cloudinary"),category:"widgets",icon:"format-gallery",attributes:ar,edit:rr,save:or})})()})(); +(()=>{var e={5580(e,t,r){var n=r(6110)(r(9325),"DataView");e.exports=n},1549(e,t,r){var n=r(2032),o=r(3862),a=r(6721),i=r(2749),s=r(5749);function l(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t-1&&e%1==0&&e-1}},1175(e,t,r){var n=r(6025);e.exports=function(e,t){var r=this.__data__,o=n(r,e);return o<0?(++this.size,r.push([e,t])):r[o][1]=t,this}},3040(e,t,r){var n=r(1549),o=r(79),a=r(8223);e.exports=function(){this.size=0,this.__data__={hash:new n,map:new(a||o),string:new n}}},7670(e,t,r){var n=r(2651);e.exports=function(e){var t=n(this,e).delete(e);return this.size-=t?1:0,t}},289(e,t,r){var n=r(2651);e.exports=function(e){return n(this,e).get(e)}},4509(e,t,r){var n=r(2651);e.exports=function(e){return n(this,e).has(e)}},2949(e,t,r){var n=r(2651);e.exports=function(e,t){var r=n(this,e),o=r.size;return r.set(e,t),this.size+=r.size==o?0:1,this}},1042(e,t,r){var n=r(6110)(Object,"create");e.exports=n},3650(e,t,r){var n=r(4335)(Object.keys,Object);e.exports=n},181(e){e.exports=function(e){var t=[];if(null!=e)for(var r in Object(e))t.push(r);return t}},6009(e,t,r){e=r.nmd(e);var n=r(4840),o=t&&!t.nodeType&&t,a=o&&e&&!e.nodeType&&e,i=a&&a.exports===o&&n.process,s=function(){try{var e=a&&a.require&&a.require("util").types;return e||i&&i.binding&&i.binding("util")}catch(e){}}();e.exports=s},9350(e){var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},4335(e){e.exports=function(e,t){return function(r){return e(t(r))}}},9325(e,t,r){var n=r(4840),o="object"==typeof self&&self&&self.Object===Object&&self,a=n||o||Function("return this")();e.exports=a},1420(e,t,r){var n=r(79);e.exports=function(){this.__data__=new n,this.size=0}},938(e){e.exports=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}},3605(e){e.exports=function(e){return this.__data__.get(e)}},9817(e){e.exports=function(e){return this.__data__.has(e)}},945(e,t,r){var n=r(79),o=r(8223),a=r(3661);e.exports=function(e,t){var r=this.__data__;if(r instanceof n){var i=r.__data__;if(!o||i.length<199)return i.push([e,t]),this.size=++r.size,this;r=this.__data__=new a(i)}return r.set(e,t),this.size=r.size,this}},7473(e){var t=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return t.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},8055(e,t,r){var n=r(9999);e.exports=function(e){return n(e,5)}},5288(e){e.exports=function(e,t){return e===t||e!=e&&t!=t}},2428(e,t,r){var n=r(7534),o=r(346),a=Object.prototype,i=a.hasOwnProperty,s=a.propertyIsEnumerable,l=n(function(){return arguments}())?n:function(e){return o(e)&&i.call(e,"callee")&&!s.call(e,"callee")};e.exports=l},6449(e){var t=Array.isArray;e.exports=t},4894(e,t,r){var n=r(1882),o=r(294);e.exports=function(e){return null!=e&&o(e.length)&&!n(e)}},3656(e,t,r){e=r.nmd(e);var n=r(9325),o=r(9935),a=t&&!t.nodeType&&t,i=a&&e&&!e.nodeType&&e,s=i&&i.exports===a?n.Buffer:void 0,l=(s?s.isBuffer:void 0)||o;e.exports=l},1882(e,t,r){var n=r(2552),o=r(3805);e.exports=function(e){if(!o(e))return!1;var t=n(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},294(e){e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}},7730(e,t,r){var n=r(9172),o=r(7301),a=r(6009),i=a&&a.isMap,s=i?o(i):n;e.exports=s},3805(e){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},346(e){e.exports=function(e){return null!=e&&"object"==typeof e}},8440(e,t,r){var n=r(6038),o=r(7301),a=r(6009),i=a&&a.isSet,s=i?o(i):n;e.exports=s},7167(e,t,r){var n=r(4901),o=r(7301),a=r(6009),i=a&&a.isTypedArray,s=i?o(i):n;e.exports=s},5950(e,t,r){var n=r(695),o=r(8984),a=r(4894);e.exports=function(e){return a(e)?n(e):o(e)}},7241(e,t,r){var n=r(695),o=r(2903),a=r(4894);e.exports=function(e){return a(e)?n(e,!0):o(e)}},3345(e){e.exports=function(){return[]}},9935(e){e.exports=function(){return!1}},6087(e){"use strict";e.exports=window.wp.element},6942(e,t){var r;!function(){"use strict";var n={}.hasOwnProperty;function o(){for(var e="",t=0;t{const t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.cw=e=>{var t;return()=>{if(e){var r=e;e=0,t={exports:{}},r.call(t.exports,t,t.exports)}return t.exports}},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.hasOwn(e,t),r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),r.dn=e=>{var t=Object.getOwnPropertyDescriptor(e,"name");(!t||!t.writable&&t.configurable)&&Object.defineProperty(e,"name",{value:"default",configurable:!0})},(()=>{"use strict";var e=r.cw(e=>{function t(e,t){var r,n;if("function"==typeof t)void 0!==(n=t(e))&&(e=n);else if(Array.isArray(t))for(r=0;r=0&&(e=e.replace(/\[/g,t).replace(/]/g,""));var r=e.split(t);if(r.filter(s).length!==r.length)throw Error("Refusing to update blacklisted property "+e);return r}var c=Object.prototype.hasOwnProperty;function u(e,t,r,n){if(!(this instanceof u))return new u(e,t,r,n);void 0===t&&(t=!1),void 0===r&&(r=!0),void 0===n&&(n=!0),this.separator=e||".",this.override=t,this.useArray=r,this.useBrackets=n,this.keepArray=!1,this.cleanup=[]}var p=new u(".",!1,!0,!0);function d(e){return function(){return p[e].apply(p,arguments)}}u.prototype._fill=function(e,r,n,i){var s=e.shift();if(e.length>0){if(r[s]=r[s]||(this.useArray&&function(e){return/^\d+$/.test(e)}(e[0])?[]:{}),!o(r[s])){if(!this.override){if(!o(n)||!a(n))throw new Error("Trying to redefine `"+s+"` which is a "+typeof r[s]);return}r[s]={}}this._fill(e,r[s],n,i)}else{if(!this.override&&o(r[s])&&!a(r[s])){if(!o(n)||!a(n))throw new Error("Trying to redefine non-empty obj['"+s+"']");return}r[s]=t(n,i)}},u.prototype.object=function(e,r){var n=this;return Object.keys(e).forEach(function(o){var a=void 0===r?null:r[o],i=l(o,n.separator).join(n.separator);-1!==i.indexOf(n.separator)?(n._fill(i.split(n.separator),e,e[o],a),delete e[o]):e[o]=t(e[o],a)}),e},u.prototype.str=function(e,r,n,o){var a=l(e,this.separator).join(this.separator);return-1!==e.indexOf(this.separator)?this._fill(a.split(this.separator),n,r,o):n[e]=t(r,o),n},u.prototype.pick=function(e,t,n,o){var a,i,s,c,u;for(i=l(e,this.separator),a=0;ad.createElement("svg",{width:"18px",height:"18px",viewBox:"0 0 18 18",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},d.createElement("title",null,"shape-round"),d.createElement("desc",null,"Created with Sketch."),d.createElement("g",{id:"Desktop-0.4",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},d.createElement("g",{id:"widgets/shape-round",transform:"translate(-3.000000, -3.000000)",fill:"#000000"},d.createElement("path",{d:"M12,3 C16.9705627,3 21,7.02943725 21,12 C21,16.9705627 16.9705627,21 12,21 C7.02943725,21 3,16.9705627 3,12 C3,7.02943725 7.02943725,3 12,3 Z M12,5 C8.13400675,5 5,8.13400675 5,12 C5,15.8659932 8.13400675,19 12,19 C15.8659932,19 19,15.8659932 19,12 C19,8.13400675 15.8659932,5 12,5 Z",id:"Combined-Shape"})))),m=()=>d.createElement("svg",{width:"18px",height:"18px",viewBox:"0 0 18 18",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},d.createElement("title",null,"ratio-square"),d.createElement("desc",null,"Created with Sketch."),d.createElement("g",{id:"Desktop-0.4",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},d.createElement("g",{id:"widgets/shape-square",transform:"translate(-3.000000, -3.000000)",fill:"#000000"},d.createElement("path",{d:"M3,3 L3,21 L21,21 L21,3 L3,3 Z M5,5 L5,19 L19,19 L19,5 L5,5 Z",id:"shape"})))),v=()=>d.createElement("svg",{width:"18px",height:"18px",viewBox:"0 0 18 18",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},d.createElement("title",null,"shape-radius"),d.createElement("desc",null,"Created with Sketch."),d.createElement("g",{id:"Desktop-0.4",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},d.createElement("g",{id:"widgets/shape-radius",transform:"translate(-3.000000, -3.000000)",fill:"#000000"},d.createElement("path",{d:"M17,3 C19.209139,3 21,4.790861 21,7 L21,17 C21,19.209139 19.209139,21 17,21 L7,21 C4.790861,21 3,19.209139 3,17 L3,7 C3,4.790861 4.790861,3 7,3 L17,3 Z M17,5 L7,5 C5.9456382,5 5.08183488,5.81587779 5.00548574,6.85073766 L5,7 L5,17 C5,18.0543618 5.81587779,18.9181651 6.85073766,18.9945143 L7,19 L17,19 C18.0543618,19 18.9181651,18.1841222 18.9945143,17.1492623 L19,17 L19,7 C19,5.9456382 18.1841222,5.08183488 17.1492623,5.00548574 L17,5 Z",id:"Rectangle"})))),h=()=>d.createElement("svg",{width:"18px",height:"18px",viewBox:"0 0 18 18",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},d.createElement("title",null,"shape-none"),d.createElement("desc",null,"Created with Sketch."),d.createElement("g",{id:"Desktop-0.4",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},d.createElement("g",{id:"widgets/shape-none",transform:"translate(-3.000000, -3.000000)",fill:"#000000"},d.createElement("path",{d:"M5,19 L5,21 L3,21 L3,19 L5,19 Z M21,19 L21,21 L19,21 L19,19 L21,19 Z M13,19 L13,21 L11,21 L11,19 L13,19 Z M9,19 L9,21 L7,21 L7,19 L9,19 Z M17,19 L17,21 L15,21 L15,19 L17,19 Z M21,15 L21,17 L19,17 L19,15 L21,15 Z M21,11 L21,13 L19,13 L19,11 L21,11 Z M5,11 L5,13 L3,13 L3,11 L5,11 Z M21,7 L21,9 L19,9 L19,7 L21,7 Z M5,7 L5,9 L3,9 L3,7 L5,7 Z M13,3 L13,5 L11,5 L11,3 L13,3 Z M9,3 L9,5 L7,5 L7,3 L9,3 Z M17,3 L17,5 L15,5 L15,3 L17,3 Z M21,3 L21,5 L19,5 L19,3 L21,3 Z M5,3 L5,5 L3,5 L3,3 L5,3 Z M3,15 L5,15 L5,17 L3,17 L3,15 Z",id:"Shape"})))),y=[{value:{type:"expanded",columns:1},icon:()=>d.createElement("svg",{width:"17px",height:"20px",viewBox:"0 0 17 20",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},d.createElement("title",null,"layout-modern"),d.createElement("desc",null,"Created with Sketch."),d.createElement("g",{id:"Desktop-0.4",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},d.createElement("g",{id:"widgets/layout-modern",transform:"translate(-2.000000, -3.000000)",fill:"#000000"},d.createElement("path",{d:"M2,10 L5,10 L5,7 L2,7 L2,10 Z M2,14 L5,14 L5,11 L2,11 L2,14 Z M2,6 L5,6 L5,3 L2,3 L2,6 Z M6,3 L6,17 L19,17 L19,3 L6,3 Z M8,5 L8,15 L17,15 L17,5 L8,5 Z M6,18 L6,23 L19,23 L19,18 L6,18 Z M8,20 L8,23 L17,23 L17,20 L8,20 Z",id:"shape"})))),label:(0,t.__)("Expanded - 1 Column","cloudinary")},{value:{type:"expanded",columns:2},icon:()=>d.createElement("svg",{width:"18px",height:"17px",viewBox:"0 0 18 17",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},d.createElement("title",null,"layout-grid-2-column"),d.createElement("desc",null,"Created with Sketch."),d.createElement("g",{id:"Desktop-0.4",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},d.createElement("g",{id:"widgets/layout-gird-2-col",transform:"translate(-3.000000, -3.000000)",fill:"#000000"},d.createElement("path",{d:"M11,12 L11,20 L3,20 L3,12 L11,12 Z M21,12 L21,20 L13,20 L13,12 L21,12 Z M9,14 L5,14 L5,18 L9,18 L9,14 Z M19,14 L15,14 L15,18 L19,18 L19,14 Z M11,3 L11,11 L3,11 L3,3 L11,3 Z M21,3 L21,11 L13,11 L13,3 L21,3 Z M9,5 L5,5 L5,9 L9,9 L9,5 Z M19,5 L15,5 L15,9 L19,9 L19,5 Z",id:"Shape"})))),label:(0,t.__)("Expanded - 2 Column","cloudinary")},{value:{type:"expanded",columns:3},icon:()=>d.createElement("svg",{width:"20px",height:"13px",viewBox:"0 0 20 13",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},d.createElement("title",null,"layout-grid-3-column"),d.createElement("desc",null,"Created with Sketch."),d.createElement("g",{id:"Desktop-0.4",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},d.createElement("g",{id:"widgets/layout-gird-3-col",transform:"translate(-2.000000, -5.000000)",fill:"#000000"},d.createElement("path",{d:"M8,12 L8,18 L2,18 L2,12 L8,12 Z M15,12 L15,18 L9,18 L9,12 L15,12 Z M22,12 L22,18 L16,18 L16,12 L22,12 Z M6,14 L4,14 L4,16 L6,16 L6,14 Z M13,14 L11,14 L11,16 L13,16 L13,14 Z M20,14 L18,14 L18,16 L20,16 L20,14 Z M8,5 L8,11 L2,11 L2,5 L8,5 Z M15,5 L15,11 L9,11 L9,5 L15,5 Z M22,5 L22,11 L16,11 L16,5 L22,5 Z M6,7 L4,7 L4,9 L6,9 L6,7 Z M13,7 L11,7 L11,9 L13,9 L13,7 Z M20,7 L18,7 L18,9 L20,9 L20,7 Z",id:"Combined-Shape"})))),label:(0,t.__)("Expanded - 3 Column","cloudinary")},{value:{type:"classic",columns:1},icon:()=>d.createElement("svg",{width:"17px",height:"14px",viewBox:"0 0 17 14",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},d.createElement("title",null,"layout-classic"),d.createElement("desc",null,"Created with Sketch."),d.createElement("g",{id:"Desktop-0.4",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},d.createElement("g",{id:"widgets/layout-classic",transform:"translate(-3.000000, -5.000000)",fill:"#000000"},d.createElement("path",{d:"M3,12 L6,12 L6,9 L3,9 L3,12 Z M3,16 L6,16 L6,13 L3,13 L3,16 Z M3,8 L6,8 L6,5 L3,5 L3,8 Z M7,5 L7,19 L20,19 L20,5 L7,5 Z M9,7 L9,17 L18,17 L18,7 L9,7 Z",id:"shape"})))),label:(0,t.__)("Classic","cloudinary")}],g=["image"],b=[{label:(0,t.__)("1:1","cloudinary"),value:"1:1"},{label:(0,t.__)("3:4","cloudinary"),value:"3:4"},{label:(0,t.__)("4:3","cloudinary"),value:"4:3"},{label:(0,t.__)("4:6","cloudinary"),value:"4:6"},{label:(0,t.__)("6:4","cloudinary"),value:"6:4"},{label:(0,t.__)("5:7","cloudinary"),value:"5:7"},{label:(0,t.__)("7:5","cloudinary"),value:"7:5"},{label:(0,t.__)("8:5","cloudinary"),value:"8:5"},{label:(0,t.__)("5:8","cloudinary"),value:"5:8"},{label:(0,t.__)("9:16","cloudinary"),value:"9:16"},{label:(0,t.__)("16:9","cloudinary"),value:"16:9"}],_=[{label:(0,t.__)("None","cloudinary"),value:"none"},{label:(0,t.__)("Fade","cloudinary"),value:"fade"},{label:(0,t.__)("Slide","cloudinary"),value:"slide"}],x=[{label:(0,t.__)("Always","cloudinary"),value:"always"},{label:(0,t.__)("None","cloudinary"),value:"none"},{label:(0,t.__)("MouseOver","cloudinary"),value:"mouseover"}],w=[{label:(0,t.__)("Inline","cloudinary"),value:"inline"},{label:(0,t.__)("Flyout","cloudinary"),value:"flyout"},{label:(0,t.__)("Popup","cloudinary"),value:"popup"}],L=[{label:(0,t.__)("Top","cloudinary"),value:"top"},{label:(0,t.__)("Bottom","cloudinary"),value:"bottom"},{label:(0,t.__)("Left","cloudinary"),value:"left"},{label:(0,t.__)("Right","cloudinary"),value:"right"}],E=[{label:(0,t.__)("Click","cloudinary"),value:"click"},{label:(0,t.__)("Hover","cloudinary"),value:"hover"}],O=[{label:(0,t.__)("Left","cloudinary"),value:"left"},{label:(0,t.__)("Right","cloudinary"),value:"right"},{label:(0,t.__)("Top","cloudinary"),value:"top"},{label:(0,t.__)("Bottom","cloudinary"),value:"bottom"}],j=[{label:(0,t.__)("Thumbnails","cloudinary"),value:"thumbnails"},{label:(0,t.__)("Indicators","cloudinary"),value:"indicators"},{label:(0,t.__)("None","cloudinary"),value:"none"}],A=[{value:"round",icon:f,label:(0,t.__)("Round","cloudinary")},{value:"radius",icon:v,label:(0,t.__)("Radius","cloudinary")},{value:"none",icon:h,label:(0,t.__)("None","cloudinary")},{value:"square",icon:m,label:(0,t.__)("Square","cloudinary")},{value:"rectangle",icon:()=>d.createElement("svg",{width:"14px",height:"20px",viewBox:"0 0 14 20",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},d.createElement("title",null,"ratio-9-16"),d.createElement("desc",null,"Created with Sketch."),d.createElement("g",{id:"Desktop-0.4",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},d.createElement("g",{id:"ratio/9-16",transform:"translate(-5.000000, -2.000000)",fill:"#000000"},d.createElement("path",{d:"M22,5.5 L22,18.5 L2,18.5 L2,5.5 L22,5.5 Z M20,7.5 L4,7.5 L4,16.5 L20,16.5 L20,7.5 Z",id:"Combined-Shape",transform:"translate(12.000000, 12.000000) rotate(-90.000000) translate(-12.000000, -12.000000) "})))),label:(0,t.__)("Rectangle","cloudinary")}],k=[{value:"round",icon:f,label:(0,t.__)("Round","cloudinary")},{value:"radius",icon:v,label:(0,t.__)("Radius","cloudinary")},{value:"square",icon:m,label:(0,t.__)("Square","cloudinary")}],P=[{label:(0,t.__)("All","cloudinary"),value:"all"},{label:(0,t.__)("Border","cloudinary"),value:"border"},{label:(0,t.__)("Gradient","cloudinary"),value:"gradient"}],S=[{label:(0,t.__)("All","cloudinary"),value:"all"},{label:(0,t.__)("Top","cloudinary"),value:"top"},{label:(0,t.__)("Top-Bottom","cloudinary"),value:"top-bottom"},{label:(0,t.__)("Left-Right","cloudinary"),value:"left-right"},{label:(0,t.__)("Bottom","cloudinary"),value:"bottom"},{label:(0,t.__)("Left","cloudinary"),value:"left"},{label:(0,t.__)("Right","cloudinary"),value:"right"}],C=[{value:"round",icon:f,label:(0,t.__)("Round","cloudinary")},{value:"radius",icon:v,label:(0,t.__)("Radius","cloudinary")},{value:"none",icon:h,label:(0,t.__)("None","cloudinary")},{value:"square",icon:m,label:(0,t.__)("Square","cloudinary")}],M=[{label:(0,t.__)("Pad","cloudinary"),value:"pad"},{label:(0,t.__)("Fill","cloudinary"),value:"fill"}],B=[{label:(0,t.__)("White padding","cloudinary"),value:"rgb:FFFFFF"},{label:(0,t.__)("Border color padding","cloudinary"),value:"auto"},{label:(0,t.__)("Predominant color padding","cloudinary"),value:"auto:predominant"},{label:(0,t.__)("Gradient fade padding","cloudinary"),value:"auto:predominant_gradient"}];var T=r(6942),D=r.n(T),N=r(6087);const R=({value:e,children:t,icon:r,onChange:n,current:o})=>{const a="object"==typeof e?JSON.stringify(e)===JSON.stringify(o):o===e;return N.createElement("button",{type:"button",onClick:()=>n(e),className:D()("radio-select",{"radio-select--active":a})},N.createElement(r,null),N.createElement("div",{className:"radio-select__label"},t))};r.dn(R);const Z=window.wp.data,z=e=>e<10?"0"+String(e):e.toString(16),I=e=>{const t=new Uint8Array((e||40)/2);return window.crypto.getRandomValues(t),Array.from(t,z).join("")},F=e=>{const t=/var\((.*)\)/g.exec(e);return t?getComputedStyle(document.documentElement).getPropertyValue(t[1]):e};function W(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function H(e){return e instanceof W(e).Element||e instanceof Element}function V(e){return e instanceof W(e).HTMLElement||e instanceof HTMLElement}function U(e){return"undefined"!=typeof ShadowRoot&&(e instanceof W(e).ShadowRoot||e instanceof ShadowRoot)}var q=Math.max,$=Math.min,G=Math.round;function X(){var e=navigator.userAgentData;return null!=e&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function J(){return!/^((?!chrome|android).)*safari/i.test(X())}function Y(e,t,r){void 0===t&&(t=!1),void 0===r&&(r=!1);var n=e.getBoundingClientRect(),o=1,a=1;t&&V(e)&&(o=e.offsetWidth>0&&G(n.width)/e.offsetWidth||1,a=e.offsetHeight>0&&G(n.height)/e.offsetHeight||1);var i=(H(e)?W(e):window).visualViewport,s=!J()&&r,l=(n.left+(s&&i?i.offsetLeft:0))/o,c=(n.top+(s&&i?i.offsetTop:0))/a,u=n.width/o,p=n.height/a;return{width:u,height:p,top:c,right:l+u,bottom:c+p,left:l,x:l,y:c}}function K(e){var t=W(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function Q(e){return e?(e.nodeName||"").toLowerCase():null}function ee(e){return((H(e)?e.ownerDocument:e.document)||window.document).documentElement}function te(e){return Y(ee(e)).left+K(e).scrollLeft}function re(e){return W(e).getComputedStyle(e)}function ne(e){var t=re(e),r=t.overflow,n=t.overflowX,o=t.overflowY;return/auto|scroll|overlay|hidden/.test(r+o+n)}function oe(e,t,r){void 0===r&&(r=!1);var n,o,a=V(t),i=V(t)&&function(e){var t=e.getBoundingClientRect(),r=G(t.width)/e.offsetWidth||1,n=G(t.height)/e.offsetHeight||1;return 1!==r||1!==n}(t),s=ee(t),l=Y(e,i,r),c={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(a||!a&&!r)&&(("body"!==Q(t)||ne(s))&&(c=(n=t)!==W(n)&&V(n)?{scrollLeft:(o=n).scrollLeft,scrollTop:o.scrollTop}:K(n)),V(t)?((u=Y(t,!0)).x+=t.clientLeft,u.y+=t.clientTop):s&&(u.x=te(s))),{x:l.left+c.scrollLeft-u.x,y:l.top+c.scrollTop-u.y,width:l.width,height:l.height}}function ae(e){var t=Y(e),r=e.offsetWidth,n=e.offsetHeight;return Math.abs(t.width-r)<=1&&(r=t.width),Math.abs(t.height-n)<=1&&(n=t.height),{x:e.offsetLeft,y:e.offsetTop,width:r,height:n}}function ie(e){return"html"===Q(e)?e:e.assignedSlot||e.parentNode||(U(e)?e.host:null)||ee(e)}function se(e){return["html","body","#document"].indexOf(Q(e))>=0?e.ownerDocument.body:V(e)&&ne(e)?e:se(ie(e))}function le(e,t){var r;void 0===t&&(t=[]);var n=se(e),o=n===(null==(r=e.ownerDocument)?void 0:r.body),a=W(n),i=o?[a].concat(a.visualViewport||[],ne(n)?n:[]):n,s=t.concat(i);return o?s:s.concat(le(ie(i)))}function ce(e){return["table","td","th"].indexOf(Q(e))>=0}function ue(e){return V(e)&&"fixed"!==re(e).position?e.offsetParent:null}function pe(e){for(var t=W(e),r=ue(e);r&&ce(r)&&"static"===re(r).position;)r=ue(r);return r&&("html"===Q(r)||"body"===Q(r)&&"static"===re(r).position)?t:r||function(e){var t=/firefox/i.test(X());if(/Trident/i.test(X())&&V(e)&&"fixed"===re(e).position)return null;var r=ie(e);for(U(r)&&(r=r.host);V(r)&&["html","body"].indexOf(Q(r))<0;){var n=re(r);if("none"!==n.transform||"none"!==n.perspective||"paint"===n.contain||-1!==["transform","perspective"].indexOf(n.willChange)||t&&"filter"===n.willChange||t&&n.filter&&"none"!==n.filter)return r;r=r.parentNode}return null}(e)||t}var de="top",fe="bottom",me="right",ve="left",he="auto",ye=[de,fe,me,ve],ge="start",be="end",_e="viewport",xe="popper",we=ye.reduce(function(e,t){return e.concat([t+"-"+ge,t+"-"+be])},[]),Le=[].concat(ye,[he]).reduce(function(e,t){return e.concat([t,t+"-"+ge,t+"-"+be])},[]),Ee=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function Oe(e){var t=new Map,r=new Set,n=[];function o(e){r.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach(function(e){if(!r.has(e)){var n=t.get(e);n&&o(n)}}),n.push(e)}return e.forEach(function(e){t.set(e.name,e)}),e.forEach(function(e){r.has(e.name)||o(e)}),n}var je={placement:"bottom",modifiers:[],strategy:"absolute"};function Ae(){for(var e=arguments.length,t=new Array(e),r=0;r=0?"x":"y"}function Be(e){var t,r=e.reference,n=e.element,o=e.placement,a=o?Se(o):null,i=o?Ce(o):null,s=r.x+r.width/2-n.width/2,l=r.y+r.height/2-n.height/2;switch(a){case de:t={x:s,y:r.y-n.height};break;case fe:t={x:s,y:r.y+r.height};break;case me:t={x:r.x+r.width,y:l};break;case ve:t={x:r.x-n.width,y:l};break;default:t={x:r.x,y:r.y}}var c=a?Me(a):null;if(null!=c){var u="y"===c?"height":"width";switch(i){case ge:t[c]=t[c]-(r[u]/2-n[u]/2);break;case be:t[c]=t[c]+(r[u]/2-n[u]/2)}}return t}var Te={top:"auto",right:"auto",bottom:"auto",left:"auto"};function De(e){var t,r=e.popper,n=e.popperRect,o=e.placement,a=e.variation,i=e.offsets,s=e.position,l=e.gpuAcceleration,c=e.adaptive,u=e.roundOffsets,p=e.isFixed,d=i.x,f=void 0===d?0:d,m=i.y,v=void 0===m?0:m,h="function"==typeof u?u({x:f,y:v}):{x:f,y:v};f=h.x,v=h.y;var y=i.hasOwnProperty("x"),g=i.hasOwnProperty("y"),b=ve,_=de,x=window;if(c){var w=pe(r),L="clientHeight",E="clientWidth";if(w===W(r)&&"static"!==re(w=ee(r)).position&&"absolute"===s&&(L="scrollHeight",E="scrollWidth"),o===de||(o===ve||o===me)&&a===be)_=fe,v-=(p&&w===x&&x.visualViewport?x.visualViewport.height:w[L])-n.height,v*=l?1:-1;if(o===ve||(o===de||o===fe)&&a===be)b=me,f-=(p&&w===x&&x.visualViewport?x.visualViewport.width:w[E])-n.width,f*=l?1:-1}var O,j=Object.assign({position:s},c&&Te),A=!0===u?function(e,t){var r=e.x,n=e.y,o=t.devicePixelRatio||1;return{x:G(r*o)/o||0,y:G(n*o)/o||0}}({x:f,y:v},W(r)):{x:f,y:v};return f=A.x,v=A.y,l?Object.assign({},j,((O={})[_]=g?"0":"",O[b]=y?"0":"",O.transform=(x.devicePixelRatio||1)<=1?"translate("+f+"px, "+v+"px)":"translate3d("+f+"px, "+v+"px, 0)",O)):Object.assign({},j,((t={})[_]=g?v+"px":"",t[b]=y?f+"px":"",t.transform="",t))}const Ne={name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach(function(e){var r=t.styles[e]||{},n=t.attributes[e]||{},o=t.elements[e];V(o)&&Q(o)&&(Object.assign(o.style,r),Object.keys(n).forEach(function(e){var t=n[e];!1===t?o.removeAttribute(e):o.setAttribute(e,!0===t?"":t)}))})},effect:function(e){var t=e.state,r={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,r.popper),t.styles=r,t.elements.arrow&&Object.assign(t.elements.arrow.style,r.arrow),function(){Object.keys(t.elements).forEach(function(e){var n=t.elements[e],o=t.attributes[e]||{},a=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:r[e]).reduce(function(e,t){return e[t]="",e},{});V(n)&&Q(n)&&(Object.assign(n.style,a),Object.keys(o).forEach(function(e){n.removeAttribute(e)}))})}},requires:["computeStyles"]};const Re={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,r=e.options,n=e.name,o=r.offset,a=void 0===o?[0,0]:o,i=Le.reduce(function(e,r){return e[r]=function(e,t,r){var n=Se(e),o=[ve,de].indexOf(n)>=0?-1:1,a="function"==typeof r?r(Object.assign({},t,{placement:e})):r,i=a[0],s=a[1];return i=i||0,s=(s||0)*o,[ve,me].indexOf(n)>=0?{x:s,y:i}:{x:i,y:s}}(r,t.rects,a),e},{}),s=i[t.placement],l=s.x,c=s.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=c),t.modifiersData[n]=i}};var Ze={left:"right",right:"left",bottom:"top",top:"bottom"};function ze(e){return e.replace(/left|right|bottom|top/g,function(e){return Ze[e]})}var Ie={start:"end",end:"start"};function Fe(e){return e.replace(/start|end/g,function(e){return Ie[e]})}function We(e,t){var r=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(r&&U(r)){var n=t;do{if(n&&e.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function He(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function Ve(e,t,r){return t===_e?He(function(e,t){var r=W(e),n=ee(e),o=r.visualViewport,a=n.clientWidth,i=n.clientHeight,s=0,l=0;if(o){a=o.width,i=o.height;var c=J();(c||!c&&"fixed"===t)&&(s=o.offsetLeft,l=o.offsetTop)}return{width:a,height:i,x:s+te(e),y:l}}(e,r)):H(t)?function(e,t){var r=Y(e,!1,"fixed"===t);return r.top=r.top+e.clientTop,r.left=r.left+e.clientLeft,r.bottom=r.top+e.clientHeight,r.right=r.left+e.clientWidth,r.width=e.clientWidth,r.height=e.clientHeight,r.x=r.left,r.y=r.top,r}(t,r):He(function(e){var t,r=ee(e),n=K(e),o=null==(t=e.ownerDocument)?void 0:t.body,a=q(r.scrollWidth,r.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),i=q(r.scrollHeight,r.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),s=-n.scrollLeft+te(e),l=-n.scrollTop;return"rtl"===re(o||r).direction&&(s+=q(r.clientWidth,o?o.clientWidth:0)-a),{width:a,height:i,x:s,y:l}}(ee(e)))}function Ue(e,t,r,n){var o="clippingParents"===t?function(e){var t=le(ie(e)),r=["absolute","fixed"].indexOf(re(e).position)>=0&&V(e)?pe(e):e;return H(r)?t.filter(function(e){return H(e)&&We(e,r)&&"body"!==Q(e)}):[]}(e):[].concat(t),a=[].concat(o,[r]),i=a[0],s=a.reduce(function(t,r){var o=Ve(e,r,n);return t.top=q(o.top,t.top),t.right=$(o.right,t.right),t.bottom=$(o.bottom,t.bottom),t.left=q(o.left,t.left),t},Ve(e,i,n));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function qe(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function $e(e,t){return t.reduce(function(t,r){return t[r]=e,t},{})}function Ge(e,t){void 0===t&&(t={});var r=t,n=r.placement,o=void 0===n?e.placement:n,a=r.strategy,i=void 0===a?e.strategy:a,s=r.boundary,l=void 0===s?"clippingParents":s,c=r.rootBoundary,u=void 0===c?_e:c,p=r.elementContext,d=void 0===p?xe:p,f=r.altBoundary,m=void 0!==f&&f,v=r.padding,h=void 0===v?0:v,y=qe("number"!=typeof h?h:$e(h,ye)),g=d===xe?"reference":xe,b=e.rects.popper,_=e.elements[m?g:d],x=Ue(H(_)?_:_.contextElement||ee(e.elements.popper),l,u,i),w=Y(e.elements.reference),L=Be({reference:w,element:b,strategy:"absolute",placement:o}),E=He(Object.assign({},b,L)),O=d===xe?E:w,j={top:x.top-O.top+y.top,bottom:O.bottom-x.bottom+y.bottom,left:x.left-O.left+y.left,right:O.right-x.right+y.right},A=e.modifiersData.offset;if(d===xe&&A){var k=A[o];Object.keys(j).forEach(function(e){var t=[me,fe].indexOf(e)>=0?1:-1,r=[de,fe].indexOf(e)>=0?"y":"x";j[e]+=k[r]*t})}return j}function Xe(e,t,r){return q(e,$(t,r))}const Je={name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,r=e.options,n=e.name,o=r.mainAxis,a=void 0===o||o,i=r.altAxis,s=void 0!==i&&i,l=r.boundary,c=r.rootBoundary,u=r.altBoundary,p=r.padding,d=r.tether,f=void 0===d||d,m=r.tetherOffset,v=void 0===m?0:m,h=Ge(t,{boundary:l,rootBoundary:c,padding:p,altBoundary:u}),y=Se(t.placement),g=Ce(t.placement),b=!g,_=Me(y),x="x"===_?"y":"x",w=t.modifiersData.popperOffsets,L=t.rects.reference,E=t.rects.popper,O="function"==typeof v?v(Object.assign({},t.rects,{placement:t.placement})):v,j="number"==typeof O?{mainAxis:O,altAxis:O}:Object.assign({mainAxis:0,altAxis:0},O),A=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,k={x:0,y:0};if(w){if(a){var P,S="y"===_?de:ve,C="y"===_?fe:me,M="y"===_?"height":"width",B=w[_],T=B+h[S],D=B-h[C],N=f?-E[M]/2:0,R=g===ge?L[M]:E[M],Z=g===ge?-E[M]:-L[M],z=t.elements.arrow,I=f&&z?ae(z):{width:0,height:0},F=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},W=F[S],H=F[C],V=Xe(0,L[M],I[M]),U=b?L[M]/2-N-V-W-j.mainAxis:R-V-W-j.mainAxis,G=b?-L[M]/2+N+V+H+j.mainAxis:Z+V+H+j.mainAxis,X=t.elements.arrow&&pe(t.elements.arrow),J=X?"y"===_?X.clientTop||0:X.clientLeft||0:0,Y=null!=(P=null==A?void 0:A[_])?P:0,K=B+G-Y,Q=Xe(f?$(T,B+U-Y-J):T,B,f?q(D,K):D);w[_]=Q,k[_]=Q-B}if(s){var ee,te="x"===_?de:ve,re="x"===_?fe:me,ne=w[x],oe="y"===x?"height":"width",ie=ne+h[te],se=ne-h[re],le=-1!==[de,ve].indexOf(y),ce=null!=(ee=null==A?void 0:A[x])?ee:0,ue=le?ie:ne-L[oe]-E[oe]-ce+j.altAxis,he=le?ne+L[oe]+E[oe]-ce-j.altAxis:se,ye=f&&le?function(e,t,r){var n=Xe(e,t,r);return n>r?r:n}(ue,ne,he):Xe(f?ue:ie,ne,f?he:se);w[x]=ye,k[x]=ye-ne}t.modifiersData[n]=k}},requiresIfExists:["offset"]};const Ye={name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,r=e.state,n=e.name,o=e.options,a=r.elements.arrow,i=r.modifiersData.popperOffsets,s=Se(r.placement),l=Me(s),c=[ve,me].indexOf(s)>=0?"height":"width";if(a&&i){var u=function(e,t){return qe("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:$e(e,ye))}(o.padding,r),p=ae(a),d="y"===l?de:ve,f="y"===l?fe:me,m=r.rects.reference[c]+r.rects.reference[l]-i[l]-r.rects.popper[c],v=i[l]-r.rects.reference[l],h=pe(a),y=h?"y"===l?h.clientHeight||0:h.clientWidth||0:0,g=m/2-v/2,b=u[d],_=y-p[c]-u[f],x=y/2-p[c]/2+g,w=Xe(b,x,_),L=l;r.modifiersData[n]=((t={})[L]=w,t.centerOffset=w-x,t)}},effect:function(e){var t=e.state,r=e.options.element,n=void 0===r?"[data-popper-arrow]":r;null!=n&&("string"!=typeof n||(n=t.elements.popper.querySelector(n)))&&We(t.elements.popper,n)&&(t.elements.arrow=n)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Ke(e,t,r){return void 0===r&&(r={x:0,y:0}),{top:e.top-t.height-r.y,right:e.right-t.width+r.x,bottom:e.bottom-t.height+r.y,left:e.left-t.width-r.x}}function Qe(e){return[de,me,fe,ve].some(function(t){return e[t]>=0})}var et=ke({defaultModifiers:[{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var t=e.state,r=e.instance,n=e.options,o=n.scroll,a=void 0===o||o,i=n.resize,s=void 0===i||i,l=W(t.elements.popper),c=[].concat(t.scrollParents.reference,t.scrollParents.popper);return a&&c.forEach(function(e){e.addEventListener("scroll",r.update,Pe)}),s&&l.addEventListener("resize",r.update,Pe),function(){a&&c.forEach(function(e){e.removeEventListener("scroll",r.update,Pe)}),s&&l.removeEventListener("resize",r.update,Pe)}},data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,r=e.name;t.modifiersData[r]=Be({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}},{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,r=e.options,n=r.gpuAcceleration,o=void 0===n||n,a=r.adaptive,i=void 0===a||a,s=r.roundOffsets,l=void 0===s||s,c={placement:Se(t.placement),variation:Ce(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:o,isFixed:"fixed"===t.options.strategy};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,De(Object.assign({},c,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:i,roundOffsets:l})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,De(Object.assign({},c,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}},Ne,Re,{name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,r=e.options,n=e.name;if(!t.modifiersData[n]._skip){for(var o=r.mainAxis,a=void 0===o||o,i=r.altAxis,s=void 0===i||i,l=r.fallbackPlacements,c=r.padding,u=r.boundary,p=r.rootBoundary,d=r.altBoundary,f=r.flipVariations,m=void 0===f||f,v=r.allowedAutoPlacements,h=t.options.placement,y=Se(h),g=l||(y===h||!m?[ze(h)]:function(e){if(Se(e)===he)return[];var t=ze(e);return[Fe(e),t,Fe(t)]}(h)),b=[h].concat(g).reduce(function(e,r){return e.concat(Se(r)===he?function(e,t){void 0===t&&(t={});var r=t,n=r.placement,o=r.boundary,a=r.rootBoundary,i=r.padding,s=r.flipVariations,l=r.allowedAutoPlacements,c=void 0===l?Le:l,u=Ce(n),p=u?s?we:we.filter(function(e){return Ce(e)===u}):ye,d=p.filter(function(e){return c.indexOf(e)>=0});0===d.length&&(d=p);var f=d.reduce(function(t,r){return t[r]=Ge(e,{placement:r,boundary:o,rootBoundary:a,padding:i})[Se(r)],t},{});return Object.keys(f).sort(function(e,t){return f[e]-f[t]})}(t,{placement:r,boundary:u,rootBoundary:p,padding:c,flipVariations:m,allowedAutoPlacements:v}):r)},[]),_=t.rects.reference,x=t.rects.popper,w=new Map,L=!0,E=b[0],O=0;O=0,S=P?"width":"height",C=Ge(t,{placement:j,boundary:u,rootBoundary:p,altBoundary:d,padding:c}),M=P?k?me:ve:k?fe:de;_[S]>x[S]&&(M=ze(M));var B=ze(M),T=[];if(a&&T.push(C[A]<=0),s&&T.push(C[M]<=0,C[B]<=0),T.every(function(e){return e})){E=j,L=!1;break}w.set(j,T)}if(L)for(var D=function(e){var t=b.find(function(t){var r=w.get(t);if(r)return r.slice(0,e).every(function(e){return e})});if(t)return E=t,"break"},N=m?3:1;N>0;N--){if("break"===D(N))break}t.placement!==E&&(t.modifiersData[n]._skip=!0,t.placement=E,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}},Je,Ye,{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,r=e.name,n=t.rects.reference,o=t.rects.popper,a=t.modifiersData.preventOverflow,i=Ge(t,{elementContext:"reference"}),s=Ge(t,{altBoundary:!0}),l=Ke(i,n),c=Ke(s,o,a),u=Qe(l),p=Qe(c);t.modifiersData[r]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:u,hasPopperEscaped:p},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":p})}}]}),tt="tippy-content",rt="tippy-backdrop",nt="tippy-arrow",ot="tippy-svg-arrow",at={passive:!0,capture:!0},it=function(){return document.body};function st(e,t,r){if(Array.isArray(e)){var n=e[t];return n??(Array.isArray(r)?r[t]:r)}return e}function lt(e,t){var r={}.toString.call(e);return 0===r.indexOf("[object")&&r.indexOf(t+"]")>-1}function ct(e,t){return"function"==typeof e?e.apply(void 0,t):e}function ut(e,t){return 0===t?e:function(n){clearTimeout(r),r=setTimeout(function(){e(n)},t)};var r}function pt(e){return[].concat(e)}function dt(e,t){-1===e.indexOf(t)&&e.push(t)}function ft(e){return e.split("-")[0]}function mt(e){return[].slice.call(e)}function vt(e){return Object.keys(e).reduce(function(t,r){return void 0!==e[r]&&(t[r]=e[r]),t},{})}function ht(){return document.createElement("div")}function yt(e){return["Element","Fragment"].some(function(t){return lt(e,t)})}function gt(e){return lt(e,"MouseEvent")}function bt(e){return!(!e||!e._tippy||e._tippy.reference!==e)}function _t(e){return yt(e)?[e]:function(e){return lt(e,"NodeList")}(e)?mt(e):Array.isArray(e)?e:mt(document.querySelectorAll(e))}function xt(e,t){e.forEach(function(e){e&&(e.style.transitionDuration=t+"ms")})}function wt(e,t){e.forEach(function(e){e&&e.setAttribute("data-state",t)})}function Lt(e){var t,r=pt(e)[0];return null!=r&&null!=(t=r.ownerDocument)&&t.body?r.ownerDocument:document}function Et(e,t,r){var n=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(t){e[n](t,r)})}function Ot(e,t){for(var r=t;r;){var n;if(e.contains(r))return!0;r=null==r.getRootNode||null==(n=r.getRootNode())?void 0:n.host}return!1}var jt={isTouch:!1},At=0;function kt(){jt.isTouch||(jt.isTouch=!0,window.performance&&document.addEventListener("mousemove",Pt))}function Pt(){var e=performance.now();e-At<20&&(jt.isTouch=!1,document.removeEventListener("mousemove",Pt)),At=e}function St(){var e=document.activeElement;if(bt(e)){var t=e._tippy;e.blur&&!t.state.isVisible&&e.blur()}}var Ct=!!("undefined"!=typeof window&&"undefined"!=typeof document)&&!!window.msCrypto;var Mt={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},Bt=Object.assign({appendTo:it,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},Mt,{allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999}),Tt=Object.keys(Bt);function Dt(e){var t=(e.plugins||[]).reduce(function(t,r){var n,o=r.name,a=r.defaultValue;o&&(t[o]=void 0!==e[o]?e[o]:null!=(n=Bt[o])?n:a);return t},{});return Object.assign({},e,t)}function Nt(e,t){var r=Object.assign({},t,{content:ct(t.content,[e])},t.ignoreAttributes?{}:function(e,t){return(t?Object.keys(Dt(Object.assign({},Bt,{plugins:t}))):Tt).reduce(function(t,r){var n=(e.getAttribute("data-tippy-"+r)||"").trim();if(!n)return t;if("content"===r)t[r]=n;else try{t[r]=JSON.parse(n)}catch(e){t[r]=n}return t},{})}(e,t.plugins));return r.aria=Object.assign({},Bt.aria,r.aria),r.aria={expanded:"auto"===r.aria.expanded?t.interactive:r.aria.expanded,content:"auto"===r.aria.content?t.interactive?null:"describedby":r.aria.content},r}function Rt(e,t){e.innerHTML=t}function Zt(e){var t=ht();return!0===e?t.className=nt:(t.className=ot,yt(e)?t.appendChild(e):Rt(t,e)),t}function zt(e,t){yt(t.content)?(Rt(e,""),e.appendChild(t.content)):"function"!=typeof t.content&&(t.allowHTML?Rt(e,t.content):e.textContent=t.content)}function It(e){var t=e.firstElementChild,r=mt(t.children);return{box:t,content:r.find(function(e){return e.classList.contains(tt)}),arrow:r.find(function(e){return e.classList.contains(nt)||e.classList.contains(ot)}),backdrop:r.find(function(e){return e.classList.contains(rt)})}}function Ft(e){var t=ht(),r=ht();r.className="tippy-box",r.setAttribute("data-state","hidden"),r.setAttribute("tabindex","-1");var n=ht();function o(r,n){var o=It(t),a=o.box,i=o.content,s=o.arrow;n.theme?a.setAttribute("data-theme",n.theme):a.removeAttribute("data-theme"),"string"==typeof n.animation?a.setAttribute("data-animation",n.animation):a.removeAttribute("data-animation"),n.inertia?a.setAttribute("data-inertia",""):a.removeAttribute("data-inertia"),a.style.maxWidth="number"==typeof n.maxWidth?n.maxWidth+"px":n.maxWidth,n.role?a.setAttribute("role",n.role):a.removeAttribute("role"),r.content===n.content&&r.allowHTML===n.allowHTML||zt(i,e.props),n.arrow?s?r.arrow!==n.arrow&&(a.removeChild(s),a.appendChild(Zt(n.arrow))):a.appendChild(Zt(n.arrow)):s&&a.removeChild(s)}return n.className=tt,n.setAttribute("data-state","hidden"),zt(n,e.props),t.appendChild(r),r.appendChild(n),o(e.props,e.props),{popper:t,onUpdate:o}}Ft.$$tippy=!0;var Wt=1,Ht=[],Vt=[];function Ut(e,t){var r,n,o,a,i,s,l,c,u=Nt(e,Object.assign({},Bt,Dt(vt(t)))),p=!1,d=!1,f=!1,m=!1,v=[],h=ut($,u.interactiveDebounce),y=Wt++,g=(c=u.plugins).filter(function(e,t){return c.indexOf(e)===t}),b={id:y,reference:e,popper:ht(),popperInstance:null,props:u,state:{isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},plugins:g,clearDelayTimeouts:function(){clearTimeout(r),clearTimeout(n),cancelAnimationFrame(o)},setProps:function(t){0;if(b.state.isDestroyed)return;B("onBeforeUpdate",[b,t]),U();var r=b.props,n=Nt(e,Object.assign({},r,vt(t),{ignoreAttributes:!0}));b.props=n,V(),r.interactiveDebounce!==n.interactiveDebounce&&(N(),h=ut($,n.interactiveDebounce));r.triggerTarget&&!n.triggerTarget?pt(r.triggerTarget).forEach(function(e){e.removeAttribute("aria-expanded")}):n.triggerTarget&&e.removeAttribute("aria-expanded");D(),M(),w&&w(r,n);b.popperInstance&&(Y(),Q().forEach(function(e){requestAnimationFrame(e._tippy.popperInstance.forceUpdate)}));B("onAfterUpdate",[b,t])},setContent:function(e){b.setProps({content:e})},show:function(){0;var e=b.state.isVisible,t=b.state.isDestroyed,r=!b.state.isEnabled,n=jt.isTouch&&!b.props.touch,o=st(b.props.duration,0,Bt.duration);if(e||t||r||n)return;if(k().hasAttribute("disabled"))return;if(B("onShow",[b],!1),!1===b.props.onShow(b))return;b.state.isVisible=!0,A()&&(x.style.visibility="visible");M(),I(),b.state.isMounted||(x.style.transition="none");if(A()){var a=S();xt([a.box,a.content],0)}s=function(){var e;if(b.state.isVisible&&!m){if(m=!0,x.offsetHeight,x.style.transition=b.props.moveTransition,A()&&b.props.animation){var t=S(),r=t.box,n=t.content;xt([r,n],o),wt([r,n],"visible")}T(),D(),dt(Vt,b),null==(e=b.popperInstance)||e.forceUpdate(),B("onMount",[b]),b.props.animation&&A()&&function(e,t){W(e,t)}(o,function(){b.state.isShown=!0,B("onShown",[b])})}},function(){var e,t=b.props.appendTo,r=k();e=b.props.interactive&&t===it||"parent"===t?r.parentNode:ct(t,[r]);e.contains(x)||e.appendChild(x);b.state.isMounted=!0,Y(),!1}()},hide:function(){0;var e=!b.state.isVisible,t=b.state.isDestroyed,r=!b.state.isEnabled,n=st(b.props.duration,1,Bt.duration);if(e||t||r)return;if(B("onHide",[b],!1),!1===b.props.onHide(b))return;b.state.isVisible=!1,b.state.isShown=!1,m=!1,p=!1,A()&&(x.style.visibility="hidden");if(N(),F(),M(!0),A()){var o=S(),a=o.box,i=o.content;b.props.animation&&(xt([a,i],n),wt([a,i],"hidden"))}T(),D(),b.props.animation?A()&&function(e,t){W(e,function(){!b.state.isVisible&&x.parentNode&&x.parentNode.contains(x)&&t()})}(n,b.unmount):b.unmount()},hideWithInteractivity:function(e){0;P().addEventListener("mousemove",h),dt(Ht,h),h(e)},enable:function(){b.state.isEnabled=!0},disable:function(){b.hide(),b.state.isEnabled=!1},unmount:function(){0;b.state.isVisible&&b.hide();if(!b.state.isMounted)return;K(),Q().forEach(function(e){e._tippy.unmount()}),x.parentNode&&x.parentNode.removeChild(x);Vt=Vt.filter(function(e){return e!==b}),b.state.isMounted=!1,B("onHidden",[b])},destroy:function(){0;if(b.state.isDestroyed)return;b.clearDelayTimeouts(),b.unmount(),U(),delete e._tippy,b.state.isDestroyed=!0,B("onDestroy",[b])}};if(!u.render)return b;var _=u.render(b),x=_.popper,w=_.onUpdate;x.setAttribute("data-tippy-root",""),x.id="tippy-"+b.id,b.popper=x,e._tippy=b,x._tippy=b;var L=g.map(function(e){return e.fn(b)}),E=e.hasAttribute("aria-expanded");return V(),D(),M(),B("onCreate",[b]),u.showOnCreate&&ee(),x.addEventListener("mouseenter",function(){b.props.interactive&&b.state.isVisible&&b.clearDelayTimeouts()}),x.addEventListener("mouseleave",function(){b.props.interactive&&b.props.trigger.indexOf("mouseenter")>=0&&P().addEventListener("mousemove",h)}),b;function O(){var e=b.props.touch;return Array.isArray(e)?e:[e,0]}function j(){return"hold"===O()[0]}function A(){var e;return!(null==(e=b.props.render)||!e.$$tippy)}function k(){return l||e}function P(){var e=k().parentNode;return e?Lt(e):document}function S(){return It(x)}function C(e){return b.state.isMounted&&!b.state.isVisible||jt.isTouch||a&&"focus"===a.type?0:st(b.props.delay,e?0:1,Bt.delay)}function M(e){void 0===e&&(e=!1),x.style.pointerEvents=b.props.interactive&&!e?"":"none",x.style.zIndex=""+b.props.zIndex}function B(e,t,r){var n;(void 0===r&&(r=!0),L.forEach(function(r){r[e]&&r[e].apply(r,t)}),r)&&(n=b.props)[e].apply(n,t)}function T(){var t=b.props.aria;if(t.content){var r="aria-"+t.content,n=x.id;pt(b.props.triggerTarget||e).forEach(function(e){var t=e.getAttribute(r);if(b.state.isVisible)e.setAttribute(r,t?t+" "+n:n);else{var o=t&&t.replace(n,"").trim();o?e.setAttribute(r,o):e.removeAttribute(r)}})}}function D(){!E&&b.props.aria.expanded&&pt(b.props.triggerTarget||e).forEach(function(e){b.props.interactive?e.setAttribute("aria-expanded",b.state.isVisible&&e===k()?"true":"false"):e.removeAttribute("aria-expanded")})}function N(){P().removeEventListener("mousemove",h),Ht=Ht.filter(function(e){return e!==h})}function R(t){if(!jt.isTouch||!f&&"mousedown"!==t.type){var r=t.composedPath&&t.composedPath()[0]||t.target;if(!b.props.interactive||!Ot(x,r)){if(pt(b.props.triggerTarget||e).some(function(e){return Ot(e,r)})){if(jt.isTouch)return;if(b.state.isVisible&&b.props.trigger.indexOf("click")>=0)return}else B("onClickOutside",[b,t]);!0===b.props.hideOnClick&&(b.clearDelayTimeouts(),b.hide(),d=!0,setTimeout(function(){d=!1}),b.state.isMounted||F())}}}function Z(){f=!0}function z(){f=!1}function I(){var e=P();e.addEventListener("mousedown",R,!0),e.addEventListener("touchend",R,at),e.addEventListener("touchstart",z,at),e.addEventListener("touchmove",Z,at)}function F(){var e=P();e.removeEventListener("mousedown",R,!0),e.removeEventListener("touchend",R,at),e.removeEventListener("touchstart",z,at),e.removeEventListener("touchmove",Z,at)}function W(e,t){var r=S().box;function n(e){e.target===r&&(Et(r,"remove",n),t())}if(0===e)return t();Et(r,"remove",i),Et(r,"add",n),i=n}function H(t,r,n){void 0===n&&(n=!1),pt(b.props.triggerTarget||e).forEach(function(e){e.addEventListener(t,r,n),v.push({node:e,eventType:t,handler:r,options:n})})}function V(){var e;j()&&(H("touchstart",q,{passive:!0}),H("touchend",G,{passive:!0})),(e=b.props.trigger,e.split(/\s+/).filter(Boolean)).forEach(function(e){if("manual"!==e)switch(H(e,q),e){case"mouseenter":H("mouseleave",G);break;case"focus":H(Ct?"focusout":"blur",X);break;case"focusin":H("focusout",X)}})}function U(){v.forEach(function(e){var t=e.node,r=e.eventType,n=e.handler,o=e.options;t.removeEventListener(r,n,o)}),v=[]}function q(e){var t,r=!1;if(b.state.isEnabled&&!J(e)&&!d){var n="focus"===(null==(t=a)?void 0:t.type);a=e,l=e.currentTarget,D(),!b.state.isVisible&>(e)&&Ht.forEach(function(t){return t(e)}),"click"===e.type&&(b.props.trigger.indexOf("mouseenter")<0||p)&&!1!==b.props.hideOnClick&&b.state.isVisible?r=!0:ee(e),"click"===e.type&&(p=!r),r&&!n&&te(e)}}function $(e){var t=e.target,r=k().contains(t)||x.contains(t);if("mousemove"!==e.type||!r){var n=Q().concat(x).map(function(e){var t,r=null==(t=e._tippy.popperInstance)?void 0:t.state;return r?{popperRect:e.getBoundingClientRect(),popperState:r,props:u}:null}).filter(Boolean);(function(e,t){var r=t.clientX,n=t.clientY;return e.every(function(e){var t=e.popperRect,o=e.popperState,a=e.props.interactiveBorder,i=ft(o.placement),s=o.modifiersData.offset;if(!s)return!0;var l="bottom"===i?s.top.y:0,c="top"===i?s.bottom.y:0,u="right"===i?s.left.x:0,p="left"===i?s.right.x:0,d=t.top-n+l>a,f=n-t.bottom-c>a,m=t.left-r+u>a,v=r-t.right-p>a;return d||f||m||v})})(n,e)&&(N(),te(e))}}function G(e){J(e)||b.props.trigger.indexOf("click")>=0&&p||(b.props.interactive?b.hideWithInteractivity(e):te(e))}function X(e){b.props.trigger.indexOf("focusin")<0&&e.target!==k()||b.props.interactive&&e.relatedTarget&&x.contains(e.relatedTarget)||te(e)}function J(e){return!!jt.isTouch&&j()!==e.type.indexOf("touch")>=0}function Y(){K();var t=b.props,r=t.popperOptions,n=t.placement,o=t.offset,a=t.getReferenceClientRect,i=t.moveTransition,l=A()?It(x).arrow:null,c=a?{getBoundingClientRect:a,contextElement:a.contextElement||k()}:e,u={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(e){var t=e.state;if(A()){var r=S().box;["placement","reference-hidden","escaped"].forEach(function(e){"placement"===e?r.setAttribute("data-placement",t.placement):t.attributes.popper["data-popper-"+e]?r.setAttribute("data-"+e,""):r.removeAttribute("data-"+e)}),t.attributes.popper={}}}},p=[{name:"offset",options:{offset:o}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!i}},u];A()&&l&&p.push({name:"arrow",options:{element:l,padding:3}}),p.push.apply(p,(null==r?void 0:r.modifiers)||[]),b.popperInstance=et(c,x,Object.assign({},r,{placement:n,onFirstUpdate:s,modifiers:p}))}function K(){b.popperInstance&&(b.popperInstance.destroy(),b.popperInstance=null)}function Q(){return mt(x.querySelectorAll("[data-tippy-root]"))}function ee(e){b.clearDelayTimeouts(),e&&B("onTrigger",[b,e]),I();var t=C(!0),n=O(),o=n[0],a=n[1];jt.isTouch&&"hold"===o&&a&&(t=a),t?r=setTimeout(function(){b.show()},t):b.show()}function te(e){if(b.clearDelayTimeouts(),B("onUntrigger",[b,e]),b.state.isVisible){if(!(b.props.trigger.indexOf("mouseenter")>=0&&b.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(e.type)>=0&&p)){var t=C(!1);t?n=setTimeout(function(){b.state.isVisible&&b.hide()},t):o=requestAnimationFrame(function(){b.hide()})}}else F()}}function qt(e,t){void 0===t&&(t={});var r=Bt.plugins.concat(t.plugins||[]);document.addEventListener("touchstart",kt,at),window.addEventListener("blur",St);var n=Object.assign({},t,{plugins:r}),o=_t(e).reduce(function(e,t){var r=t&&Ut(t,n);return r&&e.push(r),e},[]);return yt(e)?o[0]:o}qt.defaultProps=Bt,qt.setDefaultProps=function(e){Object.keys(e).forEach(function(t){Bt[t]=e[t]})},qt.currentInput=jt;Object.assign({},Ne,{effect:function(e){var t=e.state,r={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(t.elements.popper.style,r.popper),t.styles=r,t.elements.arrow&&Object.assign(t.elements.arrow.style,r.arrow)}});qt.setDefaultProps({render:Ft});const $t=qt;var Gt=r(6087);const Xt=({children:e,value:t})=>Gt.createElement("div",{className:"colorpalette-color-label"},Gt.createElement("span",null,e),Gt.createElement("span",{className:"component-color-indicator","aria-label":`Color: ${t}`,style:{background:t}})),Jt=new(o()())("_"),Yt=({attributes:e,setAttributes:r,colors:n})=>{const o=p()(e),a=Jt.object(o),[i,u]=(0,l.useState)(a.customSettings);e.transformation_crop||(e.transformation_crop="pad",e.transformation_background="rgb:FFFFFF"),"fill"===e.transformation_crop&&delete e.transformation_background;const d=(e,t)=>{const n={[t]:F(e)};r(n)},f=(e=>{const[t,r]=(0,l.useState)(null),n=(0,l.useCallback)(e=>r(e),[]);return(0,l.useEffect)(()=>{if(!t)return;const r=$t(t,{content:e});return()=>{r?.destroy()}},[t,e]),n})((0,t.__)("How to resize or crop images to fit the gallery. Pad adds padding around the image using the specified padding style. Fill crops the image from the center so it fills as much of the available space as possible.","cloudinary"));return Gt.createElement(Gt.Fragment,null,Gt.createElement(s.PanelBody,{title:(0,t.__)("Layout","cloudinary")},y.map(t=>Gt.createElement(R,{key:`${t.value.type}-${t.value.columns}-layout`,value:t.value,onChange:e=>{r({displayProps_mode:e.type,displayProps_columns:e.columns||1})},icon:t.icon,current:{type:e.displayProps_mode,columns:e.displayProps_columns||1}},t.label))),Gt.createElement(s.PanelBody,{title:(0,t.__)("Color Palette","cloudinary"),initialOpen:!1},Gt.createElement(Xt,{value:e.themeProps_primary},(0,t.__)("Primary","cloudinary")),Gt.createElement(c.ColorPalette,{value:e.themeProps_primary,colors:n,disableCustomColors:!1,onChange:e=>d(e,"themeProps_primary")}),Gt.createElement(Xt,{value:e.themeProps_onPrimary},(0,t.__)("On Primary","cloudinary")),Gt.createElement(c.ColorPalette,{value:e.themeProps_onPrimary,colors:n,disableCustomColors:!1,onChange:e=>d(e,"themeProps_onPrimary")}),Gt.createElement(Xt,{value:e.themeProps_active},(0,t.__)("Active","cloudinary")),Gt.createElement(c.ColorPalette,{value:e.themeProps_active,colors:n,disableCustomColors:!1,onChange:e=>d(e,"themeProps_active")})),"classic"===e.displayProps_mode&&Gt.createElement(s.PanelBody,{title:(0,t.__)("Fade Transition","cloudinary"),initialOpen:!1},Gt.createElement(s.SelectControl,{value:e.transition,options:_,onChange:e=>r({transition:e}),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0})),Gt.createElement(s.PanelBody,{title:(0,t.__)("Main Viewer Parameters","cloudinary"),initialOpen:!1},Gt.createElement(s.SelectControl,{label:(0,t.__)("Aspect Ratio","cloudinary"),value:e.aspectRatio,options:b,onChange:e=>r({aspectRatio:e}),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0}),Gt.createElement("p",null,Gt.createElement("div",{className:"cld-ui-title"},(0,t.__)("Resize/Crop Mode","cloudinary"),Gt.createElement("span",{className:"dashicons dashicons-info cld-tooltip",ref:f})),Gt.createElement(s.ButtonGroup,null,M.map(t=>Gt.createElement(s.Button,{key:t.value+"-look-and-feel",variant:"secondary",isSecondary:!0,isPressed:t.value===e.transformation_crop,onClick:()=>r({transformation_crop:t.value,transformation_background:null})},t.label)))),"pad"===e.transformation_crop&&Gt.createElement(s.SelectControl,{label:(0,t.__)("Pad style","cloudinary"),value:e.transformation_background,options:B,onChange:e=>{r({transformation_background:e})},__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0}),Gt.createElement("p",null,(0,t.__)("Navigation","cloudinary")),Gt.createElement("p",null,Gt.createElement(s.ButtonGroup,null,x.map(t=>Gt.createElement(s.Button,{key:t.value+"-navigation",variant:"secondary",isSecondary:!0,isPressed:t.value===e.navigation,onClick:()=>r({navigation:t.value})},t.label)))),Gt.createElement("div",{style:{marginTop:"30px"}},Gt.createElement(s.ToggleControl,{label:(0,t.__)("Show Zoom","cloudinary"),checked:e.zoom,onChange:()=>r({zoom:!e.zoom}),__nextHasNoMarginBottom:!0}),e.zoom&&Gt.createElement(Gt.Fragment,null,Gt.createElement("p",null,(0,t.__)("Zoom Type","cloudinary")),Gt.createElement("p",null,Gt.createElement(s.ButtonGroup,null,w.map(t=>Gt.createElement(s.Button,{key:t.value+"-zoom-type",variant:"secondary",isSecondary:!0,isPressed:t.value===e.zoomProps_type,onClick:()=>r({zoomProps_type:t.value})},t.label)))),"flyout"===e.zoomProps_type&&Gt.createElement(s.SelectControl,{label:(0,t.__)("Zoom Viewer Position","cloudinary"),value:e.zoomProps_viewerPosition,options:L,onChange:e=>r({zoomProps_viewerPosition:e}),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0}),"popup"!==e.zoomProps_type&&Gt.createElement(Gt.Fragment,null,Gt.createElement("p",null,(0,t.__)("Zoom Trigger","cloudinary")),Gt.createElement("p",null,Gt.createElement(s.ButtonGroup,null,E.map(t=>Gt.createElement(s.Button,{key:t.value+"-zoom-trigger",variant:"secondary",isSecondary:!0,isPressed:t.value===e.zoomProps_trigger,onClick:()=>r({zoomProps_trigger:t.value})},t.label)))))))),Gt.createElement(s.PanelBody,{title:(0,t.__)("Carousel Parameters","cloudinary"),initialOpen:!1},Gt.createElement("p",null,(0,t.__)("Carousel Location","cloudinary")),Gt.createElement("p",null,Gt.createElement(s.ButtonGroup,null,O.map(t=>Gt.createElement(s.Button,{key:t.value+"-carousel-location",variant:"secondary",isSecondary:!0,isPressed:t.value===e.carouselLocation,onClick:()=>r({carouselLocation:t.value})},t.label)))),Gt.createElement(s.RangeControl,{label:(0,t.__)("Carousel Offset","cloudinary"),value:e.carouselOffset,onChange:e=>r({carouselOffset:e}),min:0,max:100,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0}),Gt.createElement("p",null,(0,t.__)("Carousel Style","cloudinary")),Gt.createElement("p",null,Gt.createElement(s.ButtonGroup,null,j.map(t=>Gt.createElement(s.Button,{key:t.value+"-carousel-style",variant:"secondary",isSecondary:!0,isPressed:t.value===e.carouselStyle,onClick:()=>r({carouselStyle:t.value})},t.label)))),"thumbnails"===e.carouselStyle&&Gt.createElement(Gt.Fragment,null,Gt.createElement(s.RangeControl,{label:(0,t.__)("Width","cloudinary"),value:e.thumbnailProps_width,onChange:e=>r({thumbnailProps_width:e}),min:5,max:300,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0}),Gt.createElement(s.RangeControl,{label:(0,t.__)("Height","cloudinary"),value:e.thumbnailProps_height,onChange:e=>r({thumbnailProps_height:e}),min:5,max:300,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0}),Gt.createElement("p",null,(0,t.__)("Navigation Button Shape","cloudinary")),A.map(t=>Gt.createElement(R,{key:t.value+"-navigation-button-shape",value:t.value,onChange:e=>r({thumbnailProps_navigationShape:e}),icon:t.icon,current:e.thumbnailProps_navigationShape},t.label)),Gt.createElement("p",null,(0,t.__)("Selected Style","cloudinary")),Gt.createElement("p",null,Gt.createElement(s.ButtonGroup,null,P.map(t=>Gt.createElement(s.Button,{key:t.value+"-selected-style",variant:"secondary",isSecondary:!0,isPressed:t.value===e.thumbnailProps_selectedStyle,onClick:()=>r({thumbnailProps_selectedStyle:t.value})},t.label)))),Gt.createElement(s.SelectControl,{label:(0,t.__)("Selected Border Position","cloudinary"),value:e.thumbnailProps_selectedBorderPosition,options:S,onChange:e=>r({thumbnailProps_selectedBorderPosition:e}),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0}),Gt.createElement(s.RangeControl,{label:(0,t.__)("Selected Border Width","cloudinary"),value:e.thumbnailProps_selectedBorderWidth,onChange:e=>r({thumbnailProps_selectedBorderWidth:e}),min:0,max:10,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0}),Gt.createElement("p",null,(0,t.__)("Media Shape Icon","cloudinary")),C.map(t=>Gt.createElement(R,{key:t.value+"-media",value:t.value,onChange:e=>r({thumbnailProps_mediaSymbolShape:e}),icon:t.icon,current:e.thumbnailProps_mediaSymbolShape},t.label))),"indicators"===e.carouselStyle&&Gt.createElement(Gt.Fragment,null,Gt.createElement("p",null,(0,t.__)("Indicators Shape","cloudinary")),k.map(t=>Gt.createElement(R,{key:t.value+"-indicator",value:t.value,onChange:e=>r({indicatorProps_shape:e}),icon:t.icon,current:e.indicatorProps_shape},t.label)))),Gt.createElement(s.PanelBody,{title:(0,t.__)("Additional Settings","cloudinary"),initialOpen:!1},Gt.createElement(s.TextareaControl,{label:(0,t.__)("Custom Settings","cloudinary"),help:(0,t.__)("Provide a JSON string of the settings you want to add and/or override.","cloudinary"),value:i,onChange:e=>{let t={};u(e);try{t=JSON.parse(e)}catch(e){}if("object"==typeof t){const e={...a};e.customSettings=t,r({...a,...e})}},__nextHasNoMarginBottom:!0})))};var Kt=r(6087);const Qt=new(o()())("_"),er=(0,t.__)("Drag images, upload new ones or select files from your library.","cloudinary"),tr=(e,t)=>({...e,container:"."+t,zoom:!1}),rr=e=>e?.cloudinary?.galleryWidget,nr=({setAttributes:e,attributes:r,isSelected:n})=>{const[a,u]=(0,l.useState)(null),[d,f]=(0,l.useState)(!1),m=(0,l.useRef)(null),v=(0,l.useMemo)(()=>{if(0!==r.selectedImages.length)return r;const e={},{container:t,...n}=Qt.dot(CLD_GALLERY_CONFIG);return Object.keys(n).forEach(t=>{r[t]||(e[t]=n[t])}),{...r,...e}},[r]),h=(0,l.useMemo)(()=>r.selectedImages.length?r.selectedImages.map(({attachmentId:e})=>({id:e})):[],[r]);(0,l.useEffect)(()=>{a&&((({status:e,message:t,options:r={}})=>{(0,Z.dispatch)("core/notices").createNotice(e,t,{isDismissible:!0,...r})})({status:"error",message:a}),u(null));const e=m.current;if(!r.selectedImages.length||!e)return;const t=e.ownerDocument.defaultView||window,n=e=>t===window?e:t.JSON.parse(JSON.stringify(e)),{customSettings:i,...s}=(e=>{const t=new(o()())("_"),r=p()(e),{selectedImages:n,...a}=t.object(r,{});return a.mediaAssets=n,"classic"!==a?.displayProps?.mode?delete a.transition:delete a.displayProps.columns,"pad"!==a?.transformation_crop&&delete a.transformation_background,"pad"!==a?.transformation?.crop&&delete a.transformation.background,a?.themeProps?.primary&&(a.themeProps.primary=F(a?.themeProps?.primary)),a?.themeProps?.onPrimary&&(a.themeProps.onPrimary=F(a?.themeProps?.onPrimary)),a?.themeProps?.active&&(a.themeProps.active=F(a?.themeProps?.active)),a})(r),l=(e=>{let t=e;if("string"==typeof e)try{t=JSON.parse(e)}catch{return{}}return!t||"object"!=typeof t||Array.isArray(t)?{}:t})(i);let c,d=!1;const v=()=>{const e=rr(t);if(!d&&e){try{c=e(n(tr({...s,...l},r.container)))}catch{c=e(n(tr(s,r.container)))}c.render(),f(!1)}};return rr(t)?v():"complete"!==t.document.readyState?t.addEventListener("load",v,{once:!0}):f(!1),()=>{d=!0,t.removeEventListener("load",v),c?.destroy()}},[a,r,e]);const y=!!r.selectedImages.length;(0,l.useEffect)(()=>{r.container||e({container:`cld-gallery-${I(15)}`})},[r.container,e]),(0,l.useEffect)(()=>{e(v)},[v,e]);const b=(0,c.useBlockProps)();return Kt.createElement("div",b,Kt.createElement(Kt.Fragment,null,Kt.createElement("div",{ref:m,className:r.container}),Kt.createElement("div",{className:"wp-block-cloudinary-gallery"},Kt.createElement(c.MediaPlaceholder,{labels:{title:!y&&(0,t.__)("Cloudinary Gallery","cloudinary"),instructions:!y&&er},icon:"format-gallery",disableMediaButtons:y&&!n,allowedTypes:g,addToGallery:y,isAppender:y,onSelect:r=>(async r=>{f(!0);try{const t=await i()({path:CLD_REST_ENDPOINT+"/image_data",method:"POST",data:{images:r}});e({selectedImages:t})}catch{f(!1),u((0,t.__)("Could not load selected images. Please try again.","cloudinary"))}})(r),value:h,multiple:!0},d&&Kt.createElement("div",{className:"loading-spinner-container"},Kt.createElement(s.Spinner,null))))),Kt.createElement(c.InspectorControls,null,Kt.createElement(Yt,{attributes:r,setAttributes:e})))};var or=r(6087);const ar=({attributes:e})=>or.createElement("div",{className:e.container}),ir=JSON.parse('{"aspectRatio":{"type":"string"},"navigation":{"type":"string"},"zoom":{"type":"boolean"},"carouselLocation":{"type":"string"},"carouselOffset":{"type":"number"},"carouselStyle":{"type":"string"},"displayProps_mode":{"type":"string"},"displayProps_columns":{"type":"number"},"indicatorProps_shape":{"type":"string"},"themeProps_primary":{"type":"string"},"themeProps_onPrimary":{"type":"string"},"themeProps_active":{"type":"string"},"zoomProps_type":{"type":"string"},"zoomProps_viewerPosition":{"type":"string"},"zoomProps_trigger":{"type":"string"},"thumbnailProps_width":{"type":"number"},"thumbnailProps_height":{"type":"number"},"thumbnailProps_navigationShape":{"type":"string"},"thumbnailProps_selectedStyle":{"type":"string"},"thumbnailProps_selectedBorderPosition":{"type":"string"},"thumbnailProps_selectedBorderWidth":{"type":"number"},"thumbnailProps_mediaSymbolShape":{"type":"string"},"cloudName":{"type":"string"},"container":{"type":"string"},"selectedImages":{"type":"array","default":[]},"transformation_crop":{"type":"string","default":"pad"},"transformation_background":{"type":"string"},"customSettings":{"type":"string"}}');(0,n.registerBlockType)("cloudinary/gallery",{apiVersion:2,title:(0,t.__)("Cloudinary Gallery","cloudinary"),description:(0,t.__)("Add a gallery powered by the Cloudinary Gallery Widget to your post.","cloudinary"),category:"widgets",icon:"format-gallery",attributes:ir,edit:nr,save:ar})})()})(); //# sourceMappingURL=gallery-block.js.map \ No newline at end of file diff --git a/php/media/class-gallery.php b/php/media/class-gallery.php index a706b2b1d..eeccadb33 100644 --- a/php/media/class-gallery.php +++ b/php/media/class-gallery.php @@ -288,7 +288,7 @@ public function block_editor_scripts_styles() { } /** - * Enqueue the gallery block editor styles. + * Enqueue the gallery block editor styles and the gallery library for the editor canvas. * * Registered on `enqueue_block_assets` so the styles are injected into the * iframed block editor correctly. As of WordPress 7.1 the post editor is @@ -300,6 +300,21 @@ public function block_editor_styles() { return; } + // The gallery block preview is rendered inside the editor canvas, which + // is an iframe in the iframed block editor. The Product Gallery library + // must be loaded in that document too, since the widget looks up its + // container in its own document and validates its config against its + // own frame's globals. + if ( $this->maybe_enqueue_scripts() ) { + wp_enqueue_script( + self::GALLERY_LIBRARY_HANDLE, + CLOUDINARY_ENDPOINTS_GALLERY, + array(), + $this->plugin->version, + true + ); + } + wp_enqueue_style( 'cloudinary-gallery-block-css', $this->plugin->dir_url . 'css/gallery-block.css', diff --git a/src/js/gallery-block/edit.js b/src/js/gallery-block/edit.js index eaf4882a3..d2e079767 100644 --- a/src/js/gallery-block/edit.js +++ b/src/js/gallery-block/edit.js @@ -1,4 +1,4 @@ -/* global cloudinaryGalleryApi CLD_GALLERY_CONFIG CLD_REST_ENDPOINT */ +/* global CLD_GALLERY_CONFIG CLD_REST_ENDPOINT */ /** * External dependencies @@ -12,7 +12,7 @@ import { __ } from '@wordpress/i18n'; import apiFetch from '@wordpress/api-fetch'; import { Spinner } from '@wordpress/components'; import '@wordpress/components/build-style/style.css'; -import { useEffect, useMemo, useState } from '@wordpress/element'; +import { useEffect, useMemo, useRef, useState } from '@wordpress/element'; import { InspectorControls, MediaPlaceholder, @@ -25,7 +25,12 @@ import { import '../../css/gallery.scss'; import Controls from './controls'; import { ALLOWED_MEDIA_TYPES } from './options'; -import { generateId, setupAttributesForRendering, showNotice } from './utils'; +import { + generateId, + parseCustomSettings, + setupAttributesForRendering, + showNotice, +} from './utils'; const dot = new Dot( '_' ); @@ -40,6 +45,14 @@ const galleryWidgetConfig = ( config, container ) => ( { zoom: false, } ); +/** + * Get the Product Gallery widget factory of a given window. + * + * @param {Window} win The window to look the widget up in. + * @return {((config: Object) => Object)|undefined} The `galleryWidget` factory, if loaded. + */ +const getGalleryWidget = ( win ) => win?.cloudinary?.galleryWidget; + // Prefix for the generated gallery container class. A literal prefix keeps // the value a valid, unique CSS selector. Prior to the Block API v2 upgrade // the block's `className` prop was used, but that prop is no longer passed to @@ -49,6 +62,7 @@ const CONTAINER_PREFIX = 'cld-gallery-'; const Edit = ( { setAttributes, attributes, isSelected } ) => { const [ errorMessage, setErrorMessage ] = useState( null ); const [ loading, setLoading ] = useState( false ); + const containerRef = useRef( null ); const preparedAttributes = useMemo( () => { // Do not override block settings with defaults on existing ones. @@ -108,30 +122,76 @@ const Edit = ( { setAttributes, attributes, isSelected } ) => { setErrorMessage( null ); } - if ( attributes.selectedImages.length ) { - let gallery; + const container = containerRef.current; + + if ( ! attributes.selectedImages.length || ! container ) { + return; + } + + // In the iframed block editor the container lives in the editor + // canvas iframe, so the widget of that frame has to be used: it looks + // the container up in its own document and validates its config with + // checks bound to its own frame. + const win = container.ownerDocument.defaultView || window; + + // Recreate the config in the target frame, so that its objects pass + // the widget's validation there. + const toFrame = ( config ) => + win === window + ? config + : win.JSON.parse( JSON.stringify( config ) ); - const { customSettings, ...config } = - setupAttributesForRendering( attributes ); + const { customSettings, ...config } = + setupAttributesForRendering( attributes ); + const custom = parseCustomSettings( customSettings ); + let gallery; + let cancelled = false; + + const render = () => { + const galleryWidget = getGalleryWidget( win ); + + if ( cancelled || ! galleryWidget ) { + return; + } + + // Shallow merge, matching how the front end applies Custom + // Settings over the block attributes. try { - gallery = cloudinary.galleryWidget( - galleryWidgetConfig( - { ...config, ...customSettings }, - attributes.container + gallery = galleryWidget( + toFrame( + galleryWidgetConfig( + { ...config, ...custom }, + attributes.container + ) ) ); } catch { - gallery = cloudinary.galleryWidget( - galleryWidgetConfig( config, attributes.container ) + gallery = galleryWidget( + toFrame( + galleryWidgetConfig( config, attributes.container ) + ) ); } gallery.render(); setLoading( false ); + }; - return () => gallery.destroy(); + if ( getGalleryWidget( win ) ) { + render(); + } else if ( 'complete' !== win.document.readyState ) { + // The library may still be loading in the editor canvas. + win.addEventListener( 'load', render, { once: true } ); + } else { + setLoading( false ); } + + return () => { + cancelled = true; + win.removeEventListener( 'load', render ); + gallery?.destroy(); + }; }, [ errorMessage, attributes, setAttributes ] ); const hasImages = !! attributes.selectedImages.length; @@ -157,7 +217,10 @@ const Edit = ( { setAttributes, attributes, isSelected } ) => { return (
<> -
+
{ return config; }; + +/** + * Parse the block's Custom Settings into an object. + * + * The `customSettings` attribute is stored as JSON text. It is decoded the + * same way the front end does before being merged over the gallery config. + * Invalid JSON, or JSON that is not an object, is ignored. + * + * @param {string|Object} customSettings The Custom Settings attribute value. + * @return {Object} The parsed settings, or an empty object. + */ +export const parseCustomSettings = ( customSettings ) => { + let parsed = customSettings; + + if ( 'string' === typeof customSettings ) { + try { + parsed = JSON.parse( customSettings ); + } catch { + return {}; + } + } + + if ( ! parsed || 'object' !== typeof parsed || Array.isArray( parsed ) ) { + return {}; + } + + return parsed; +}; From 5e48d24ffbea604b83deed39c07178c514a24d7a Mon Sep 17 00:00:00 2001 From: Gabriel de Tassigny Date: Wed, 11 Nov 2026 10:47:13 +0100 Subject: [PATCH 2/4] test(e2e): Cover the gallery preview in the editor canvas --- tests/e2e/cloudinary-gallery-delivery.spec.js | 56 ++++++++++++++++++- tests/e2e/utils/gallery.js | 26 +++++++-- 2 files changed, 76 insertions(+), 6 deletions(-) diff --git a/tests/e2e/cloudinary-gallery-delivery.spec.js b/tests/e2e/cloudinary-gallery-delivery.spec.js index 6c5f98904..621715dd6 100644 --- a/tests/e2e/cloudinary-gallery-delivery.spec.js +++ b/tests/e2e/cloudinary-gallery-delivery.spec.js @@ -11,6 +11,8 @@ const { test, expect } = require( './fixtures' ); const { ensureCloudinaryConnected } = require( './utils/connection' ); const { expectCloudinaryUrl, srcsetUrls } = require( './utils/delivery' ); const { + GALLERY_CONTAINER, + WIDGET_TIMEOUT, collectImageUrls, galleryBlock, openGallery: openGalleryAt, @@ -28,7 +30,7 @@ let cloudName; * State shared by the tests in this file. The layout test edits the post * created in beforeAll, so the tests run in order (see `mode: 'serial'`). * - * @type {{ postId: number, postLink: string, attachmentIds: number[], publicIds: string[] }|null} + * @type {{ postId: number, postLink: string, attachmentIds: number[], publicIds: string[], selectedImages: Object[] }|null} */ let created = null; @@ -97,6 +99,7 @@ test.describe( 'Cloudinary Gallery block delivery', { tag: '@serial' }, () => { postLink: post.link, attachmentIds, publicIds: selectedImages.map( ( image ) => image.publicId ), + selectedImages, }; } ); @@ -260,4 +263,55 @@ test.describe( 'Cloudinary Gallery block delivery', { tag: '@serial' }, () => { } } } ); + + test( 'renders the preview in the editor canvas with Custom Settings applied', async ( { + admin, + editor, + requestUtils, + } ) => { + await requestUtils.rest( { + method: 'POST', + path: `/wp/v2/posts/${ created.postId }`, + data: { + content: galleryBlock( created.selectedImages, { + mode: 'expanded', + columns: INITIAL_COLUMNS, + cloudName, + customSettings: { + transformation: { effect: 'grayscale' }, + }, + } ), + }, + } ); + + await admin.editPost( created.postId ); + + // The editor canvas is an iframe: the widget has to render inside it, + // not in the outer admin document. + const gallery = editor.canvas.locator( + `.${ GALLERY_CONTAINER } [data-test="gallery-wrap"]` + ); + await expect( + gallery, + 'the Gallery Widget should render the editor preview' + ).toBeVisible( { timeout: WIDGET_TIMEOUT } ); + + await expect( + gallery.locator( + '[data-test="gallery-viewer-wrap"] [data-test="image-wrap"][data-ready="true"]' + ) + ).toHaveCount( IMAGE_COUNT, { timeout: WIDGET_TIMEOUT } ); + + const attrs = await collectImageUrls( + gallery.locator( '[data-test="gallery-viewer-wrap"] img' ) + ); + expect( attrs.length ).toBeGreaterThan( 0 ); + for ( const { src } of attrs ) { + expectCloudinaryUrl( src, cloudName ); + expect( + src, + 'the preview should apply the Custom Settings transformation' + ).toContain( 'e_grayscale' ); + } + } ); } ); diff --git a/tests/e2e/utils/gallery.js b/tests/e2e/utils/gallery.js index f4c368ea4..9adf338e3 100644 --- a/tests/e2e/utils/gallery.js +++ b/tests/e2e/utils/gallery.js @@ -24,13 +24,19 @@ const WIDGET_TIMEOUT = 30_000; * match the block's `save()` output exactly, or the editor flags the block * as invalid when a test opens the post. * - * @param {Object[]} selectedImages Response of the plugin's `image_data` endpoint. - * @param {Object} layout Layout attributes. - * @param {string} layout.mode `expanded` or `classic`. - * @param {number} layout.columns Column count (expanded mode only). + * @param {Object[]} selectedImages Response of the plugin's `image_data` endpoint. + * @param {Object} layout Layout attributes. + * @param {string} layout.mode `expanded` or `classic`. + * @param {number} layout.columns Column count (expanded mode only). + * @param {Object} [layout.customSettings] Custom Settings, stored as JSON text like the block does. + * @param {string} [layout.cloudName] Cloud name. The editor saves it on the block, and its + * preview needs it; the front end adds it on render. * @return {string} Block markup. */ -function galleryBlock( selectedImages, { mode, columns } ) { +function galleryBlock( + selectedImages, + { mode, columns, customSettings, cloudName } +) { const attributes = { container: GALLERY_CONTAINER, selectedImages, @@ -38,6 +44,14 @@ function galleryBlock( selectedImages, { mode, columns } ) { displayProps_columns: columns, }; + if ( cloudName ) { + attributes.cloudName = cloudName; + } + + if ( customSettings ) { + attributes.customSettings = JSON.stringify( customSettings ); + } + return ( `\n` + `\n` + @@ -90,6 +104,8 @@ async function collectImageUrls( images ) { } module.exports = { + GALLERY_CONTAINER, + WIDGET_TIMEOUT, collectImageUrls, galleryBlock, openGallery, From 588f8a5518dd7ced8389f4d94d5e6cd864ab6c48 Mon Sep 17 00:00:00 2001 From: Gabriel de Tassigny Date: Wed, 11 Nov 2026 10:49:01 +0100 Subject: [PATCH 3/4] fix(gallery): Stop the spinner when the library fails to load in the canvas --- js/gallery-block.asset.php | 2 +- js/gallery-block.js | 2 +- src/js/gallery-block/edit.js | 9 ++++++++- tests/e2e/cloudinary-gallery-delivery.spec.js | 5 +++-- 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/js/gallery-block.asset.php b/js/gallery-block.asset.php index 2dd5bd3e3..7e6b42e04 100644 --- a/js/gallery-block.asset.php +++ b/js/gallery-block.asset.php @@ -9,5 +9,5 @@ 'wp-element', 'wp-i18n' ), - 'version' => '6d1e9f24f83954d8134c' + 'version' => '64aa07081e69682cd8ae' ); diff --git a/js/gallery-block.js b/js/gallery-block.js index 4b7c5db1c..856a01ab0 100644 --- a/js/gallery-block.js +++ b/js/gallery-block.js @@ -1,2 +1,2 @@ -(()=>{var e={5580(e,t,r){var n=r(6110)(r(9325),"DataView");e.exports=n},1549(e,t,r){var n=r(2032),o=r(3862),a=r(6721),i=r(2749),s=r(5749);function l(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t-1&&e%1==0&&e-1}},1175(e,t,r){var n=r(6025);e.exports=function(e,t){var r=this.__data__,o=n(r,e);return o<0?(++this.size,r.push([e,t])):r[o][1]=t,this}},3040(e,t,r){var n=r(1549),o=r(79),a=r(8223);e.exports=function(){this.size=0,this.__data__={hash:new n,map:new(a||o),string:new n}}},7670(e,t,r){var n=r(2651);e.exports=function(e){var t=n(this,e).delete(e);return this.size-=t?1:0,t}},289(e,t,r){var n=r(2651);e.exports=function(e){return n(this,e).get(e)}},4509(e,t,r){var n=r(2651);e.exports=function(e){return n(this,e).has(e)}},2949(e,t,r){var n=r(2651);e.exports=function(e,t){var r=n(this,e),o=r.size;return r.set(e,t),this.size+=r.size==o?0:1,this}},1042(e,t,r){var n=r(6110)(Object,"create");e.exports=n},3650(e,t,r){var n=r(4335)(Object.keys,Object);e.exports=n},181(e){e.exports=function(e){var t=[];if(null!=e)for(var r in Object(e))t.push(r);return t}},6009(e,t,r){e=r.nmd(e);var n=r(4840),o=t&&!t.nodeType&&t,a=o&&e&&!e.nodeType&&e,i=a&&a.exports===o&&n.process,s=function(){try{var e=a&&a.require&&a.require("util").types;return e||i&&i.binding&&i.binding("util")}catch(e){}}();e.exports=s},9350(e){var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},4335(e){e.exports=function(e,t){return function(r){return e(t(r))}}},9325(e,t,r){var n=r(4840),o="object"==typeof self&&self&&self.Object===Object&&self,a=n||o||Function("return this")();e.exports=a},1420(e,t,r){var n=r(79);e.exports=function(){this.__data__=new n,this.size=0}},938(e){e.exports=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}},3605(e){e.exports=function(e){return this.__data__.get(e)}},9817(e){e.exports=function(e){return this.__data__.has(e)}},945(e,t,r){var n=r(79),o=r(8223),a=r(3661);e.exports=function(e,t){var r=this.__data__;if(r instanceof n){var i=r.__data__;if(!o||i.length<199)return i.push([e,t]),this.size=++r.size,this;r=this.__data__=new a(i)}return r.set(e,t),this.size=r.size,this}},7473(e){var t=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return t.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},8055(e,t,r){var n=r(9999);e.exports=function(e){return n(e,5)}},5288(e){e.exports=function(e,t){return e===t||e!=e&&t!=t}},2428(e,t,r){var n=r(7534),o=r(346),a=Object.prototype,i=a.hasOwnProperty,s=a.propertyIsEnumerable,l=n(function(){return arguments}())?n:function(e){return o(e)&&i.call(e,"callee")&&!s.call(e,"callee")};e.exports=l},6449(e){var t=Array.isArray;e.exports=t},4894(e,t,r){var n=r(1882),o=r(294);e.exports=function(e){return null!=e&&o(e.length)&&!n(e)}},3656(e,t,r){e=r.nmd(e);var n=r(9325),o=r(9935),a=t&&!t.nodeType&&t,i=a&&e&&!e.nodeType&&e,s=i&&i.exports===a?n.Buffer:void 0,l=(s?s.isBuffer:void 0)||o;e.exports=l},1882(e,t,r){var n=r(2552),o=r(3805);e.exports=function(e){if(!o(e))return!1;var t=n(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},294(e){e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}},7730(e,t,r){var n=r(9172),o=r(7301),a=r(6009),i=a&&a.isMap,s=i?o(i):n;e.exports=s},3805(e){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},346(e){e.exports=function(e){return null!=e&&"object"==typeof e}},8440(e,t,r){var n=r(6038),o=r(7301),a=r(6009),i=a&&a.isSet,s=i?o(i):n;e.exports=s},7167(e,t,r){var n=r(4901),o=r(7301),a=r(6009),i=a&&a.isTypedArray,s=i?o(i):n;e.exports=s},5950(e,t,r){var n=r(695),o=r(8984),a=r(4894);e.exports=function(e){return a(e)?n(e):o(e)}},7241(e,t,r){var n=r(695),o=r(2903),a=r(4894);e.exports=function(e){return a(e)?n(e,!0):o(e)}},3345(e){e.exports=function(){return[]}},9935(e){e.exports=function(){return!1}},6087(e){"use strict";e.exports=window.wp.element},6942(e,t){var r;!function(){"use strict";var n={}.hasOwnProperty;function o(){for(var e="",t=0;t{const t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.cw=e=>{var t;return()=>{if(e){var r=e;e=0,t={exports:{}},r.call(t.exports,t,t.exports)}return t.exports}},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.hasOwn(e,t),r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),r.dn=e=>{var t=Object.getOwnPropertyDescriptor(e,"name");(!t||!t.writable&&t.configurable)&&Object.defineProperty(e,"name",{value:"default",configurable:!0})},(()=>{"use strict";var e=r.cw(e=>{function t(e,t){var r,n;if("function"==typeof t)void 0!==(n=t(e))&&(e=n);else if(Array.isArray(t))for(r=0;r=0&&(e=e.replace(/\[/g,t).replace(/]/g,""));var r=e.split(t);if(r.filter(s).length!==r.length)throw Error("Refusing to update blacklisted property "+e);return r}var c=Object.prototype.hasOwnProperty;function u(e,t,r,n){if(!(this instanceof u))return new u(e,t,r,n);void 0===t&&(t=!1),void 0===r&&(r=!0),void 0===n&&(n=!0),this.separator=e||".",this.override=t,this.useArray=r,this.useBrackets=n,this.keepArray=!1,this.cleanup=[]}var p=new u(".",!1,!0,!0);function d(e){return function(){return p[e].apply(p,arguments)}}u.prototype._fill=function(e,r,n,i){var s=e.shift();if(e.length>0){if(r[s]=r[s]||(this.useArray&&function(e){return/^\d+$/.test(e)}(e[0])?[]:{}),!o(r[s])){if(!this.override){if(!o(n)||!a(n))throw new Error("Trying to redefine `"+s+"` which is a "+typeof r[s]);return}r[s]={}}this._fill(e,r[s],n,i)}else{if(!this.override&&o(r[s])&&!a(r[s])){if(!o(n)||!a(n))throw new Error("Trying to redefine non-empty obj['"+s+"']");return}r[s]=t(n,i)}},u.prototype.object=function(e,r){var n=this;return Object.keys(e).forEach(function(o){var a=void 0===r?null:r[o],i=l(o,n.separator).join(n.separator);-1!==i.indexOf(n.separator)?(n._fill(i.split(n.separator),e,e[o],a),delete e[o]):e[o]=t(e[o],a)}),e},u.prototype.str=function(e,r,n,o){var a=l(e,this.separator).join(this.separator);return-1!==e.indexOf(this.separator)?this._fill(a.split(this.separator),n,r,o):n[e]=t(r,o),n},u.prototype.pick=function(e,t,n,o){var a,i,s,c,u;for(i=l(e,this.separator),a=0;ad.createElement("svg",{width:"18px",height:"18px",viewBox:"0 0 18 18",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},d.createElement("title",null,"shape-round"),d.createElement("desc",null,"Created with Sketch."),d.createElement("g",{id:"Desktop-0.4",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},d.createElement("g",{id:"widgets/shape-round",transform:"translate(-3.000000, -3.000000)",fill:"#000000"},d.createElement("path",{d:"M12,3 C16.9705627,3 21,7.02943725 21,12 C21,16.9705627 16.9705627,21 12,21 C7.02943725,21 3,16.9705627 3,12 C3,7.02943725 7.02943725,3 12,3 Z M12,5 C8.13400675,5 5,8.13400675 5,12 C5,15.8659932 8.13400675,19 12,19 C15.8659932,19 19,15.8659932 19,12 C19,8.13400675 15.8659932,5 12,5 Z",id:"Combined-Shape"})))),m=()=>d.createElement("svg",{width:"18px",height:"18px",viewBox:"0 0 18 18",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},d.createElement("title",null,"ratio-square"),d.createElement("desc",null,"Created with Sketch."),d.createElement("g",{id:"Desktop-0.4",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},d.createElement("g",{id:"widgets/shape-square",transform:"translate(-3.000000, -3.000000)",fill:"#000000"},d.createElement("path",{d:"M3,3 L3,21 L21,21 L21,3 L3,3 Z M5,5 L5,19 L19,19 L19,5 L5,5 Z",id:"shape"})))),v=()=>d.createElement("svg",{width:"18px",height:"18px",viewBox:"0 0 18 18",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},d.createElement("title",null,"shape-radius"),d.createElement("desc",null,"Created with Sketch."),d.createElement("g",{id:"Desktop-0.4",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},d.createElement("g",{id:"widgets/shape-radius",transform:"translate(-3.000000, -3.000000)",fill:"#000000"},d.createElement("path",{d:"M17,3 C19.209139,3 21,4.790861 21,7 L21,17 C21,19.209139 19.209139,21 17,21 L7,21 C4.790861,21 3,19.209139 3,17 L3,7 C3,4.790861 4.790861,3 7,3 L17,3 Z M17,5 L7,5 C5.9456382,5 5.08183488,5.81587779 5.00548574,6.85073766 L5,7 L5,17 C5,18.0543618 5.81587779,18.9181651 6.85073766,18.9945143 L7,19 L17,19 C18.0543618,19 18.9181651,18.1841222 18.9945143,17.1492623 L19,17 L19,7 C19,5.9456382 18.1841222,5.08183488 17.1492623,5.00548574 L17,5 Z",id:"Rectangle"})))),h=()=>d.createElement("svg",{width:"18px",height:"18px",viewBox:"0 0 18 18",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},d.createElement("title",null,"shape-none"),d.createElement("desc",null,"Created with Sketch."),d.createElement("g",{id:"Desktop-0.4",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},d.createElement("g",{id:"widgets/shape-none",transform:"translate(-3.000000, -3.000000)",fill:"#000000"},d.createElement("path",{d:"M5,19 L5,21 L3,21 L3,19 L5,19 Z M21,19 L21,21 L19,21 L19,19 L21,19 Z M13,19 L13,21 L11,21 L11,19 L13,19 Z M9,19 L9,21 L7,21 L7,19 L9,19 Z M17,19 L17,21 L15,21 L15,19 L17,19 Z M21,15 L21,17 L19,17 L19,15 L21,15 Z M21,11 L21,13 L19,13 L19,11 L21,11 Z M5,11 L5,13 L3,13 L3,11 L5,11 Z M21,7 L21,9 L19,9 L19,7 L21,7 Z M5,7 L5,9 L3,9 L3,7 L5,7 Z M13,3 L13,5 L11,5 L11,3 L13,3 Z M9,3 L9,5 L7,5 L7,3 L9,3 Z M17,3 L17,5 L15,5 L15,3 L17,3 Z M21,3 L21,5 L19,5 L19,3 L21,3 Z M5,3 L5,5 L3,5 L3,3 L5,3 Z M3,15 L5,15 L5,17 L3,17 L3,15 Z",id:"Shape"})))),y=[{value:{type:"expanded",columns:1},icon:()=>d.createElement("svg",{width:"17px",height:"20px",viewBox:"0 0 17 20",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},d.createElement("title",null,"layout-modern"),d.createElement("desc",null,"Created with Sketch."),d.createElement("g",{id:"Desktop-0.4",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},d.createElement("g",{id:"widgets/layout-modern",transform:"translate(-2.000000, -3.000000)",fill:"#000000"},d.createElement("path",{d:"M2,10 L5,10 L5,7 L2,7 L2,10 Z M2,14 L5,14 L5,11 L2,11 L2,14 Z M2,6 L5,6 L5,3 L2,3 L2,6 Z M6,3 L6,17 L19,17 L19,3 L6,3 Z M8,5 L8,15 L17,15 L17,5 L8,5 Z M6,18 L6,23 L19,23 L19,18 L6,18 Z M8,20 L8,23 L17,23 L17,20 L8,20 Z",id:"shape"})))),label:(0,t.__)("Expanded - 1 Column","cloudinary")},{value:{type:"expanded",columns:2},icon:()=>d.createElement("svg",{width:"18px",height:"17px",viewBox:"0 0 18 17",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},d.createElement("title",null,"layout-grid-2-column"),d.createElement("desc",null,"Created with Sketch."),d.createElement("g",{id:"Desktop-0.4",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},d.createElement("g",{id:"widgets/layout-gird-2-col",transform:"translate(-3.000000, -3.000000)",fill:"#000000"},d.createElement("path",{d:"M11,12 L11,20 L3,20 L3,12 L11,12 Z M21,12 L21,20 L13,20 L13,12 L21,12 Z M9,14 L5,14 L5,18 L9,18 L9,14 Z M19,14 L15,14 L15,18 L19,18 L19,14 Z M11,3 L11,11 L3,11 L3,3 L11,3 Z M21,3 L21,11 L13,11 L13,3 L21,3 Z M9,5 L5,5 L5,9 L9,9 L9,5 Z M19,5 L15,5 L15,9 L19,9 L19,5 Z",id:"Shape"})))),label:(0,t.__)("Expanded - 2 Column","cloudinary")},{value:{type:"expanded",columns:3},icon:()=>d.createElement("svg",{width:"20px",height:"13px",viewBox:"0 0 20 13",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},d.createElement("title",null,"layout-grid-3-column"),d.createElement("desc",null,"Created with Sketch."),d.createElement("g",{id:"Desktop-0.4",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},d.createElement("g",{id:"widgets/layout-gird-3-col",transform:"translate(-2.000000, -5.000000)",fill:"#000000"},d.createElement("path",{d:"M8,12 L8,18 L2,18 L2,12 L8,12 Z M15,12 L15,18 L9,18 L9,12 L15,12 Z M22,12 L22,18 L16,18 L16,12 L22,12 Z M6,14 L4,14 L4,16 L6,16 L6,14 Z M13,14 L11,14 L11,16 L13,16 L13,14 Z M20,14 L18,14 L18,16 L20,16 L20,14 Z M8,5 L8,11 L2,11 L2,5 L8,5 Z M15,5 L15,11 L9,11 L9,5 L15,5 Z M22,5 L22,11 L16,11 L16,5 L22,5 Z M6,7 L4,7 L4,9 L6,9 L6,7 Z M13,7 L11,7 L11,9 L13,9 L13,7 Z M20,7 L18,7 L18,9 L20,9 L20,7 Z",id:"Combined-Shape"})))),label:(0,t.__)("Expanded - 3 Column","cloudinary")},{value:{type:"classic",columns:1},icon:()=>d.createElement("svg",{width:"17px",height:"14px",viewBox:"0 0 17 14",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},d.createElement("title",null,"layout-classic"),d.createElement("desc",null,"Created with Sketch."),d.createElement("g",{id:"Desktop-0.4",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},d.createElement("g",{id:"widgets/layout-classic",transform:"translate(-3.000000, -5.000000)",fill:"#000000"},d.createElement("path",{d:"M3,12 L6,12 L6,9 L3,9 L3,12 Z M3,16 L6,16 L6,13 L3,13 L3,16 Z M3,8 L6,8 L6,5 L3,5 L3,8 Z M7,5 L7,19 L20,19 L20,5 L7,5 Z M9,7 L9,17 L18,17 L18,7 L9,7 Z",id:"shape"})))),label:(0,t.__)("Classic","cloudinary")}],g=["image"],b=[{label:(0,t.__)("1:1","cloudinary"),value:"1:1"},{label:(0,t.__)("3:4","cloudinary"),value:"3:4"},{label:(0,t.__)("4:3","cloudinary"),value:"4:3"},{label:(0,t.__)("4:6","cloudinary"),value:"4:6"},{label:(0,t.__)("6:4","cloudinary"),value:"6:4"},{label:(0,t.__)("5:7","cloudinary"),value:"5:7"},{label:(0,t.__)("7:5","cloudinary"),value:"7:5"},{label:(0,t.__)("8:5","cloudinary"),value:"8:5"},{label:(0,t.__)("5:8","cloudinary"),value:"5:8"},{label:(0,t.__)("9:16","cloudinary"),value:"9:16"},{label:(0,t.__)("16:9","cloudinary"),value:"16:9"}],_=[{label:(0,t.__)("None","cloudinary"),value:"none"},{label:(0,t.__)("Fade","cloudinary"),value:"fade"},{label:(0,t.__)("Slide","cloudinary"),value:"slide"}],x=[{label:(0,t.__)("Always","cloudinary"),value:"always"},{label:(0,t.__)("None","cloudinary"),value:"none"},{label:(0,t.__)("MouseOver","cloudinary"),value:"mouseover"}],w=[{label:(0,t.__)("Inline","cloudinary"),value:"inline"},{label:(0,t.__)("Flyout","cloudinary"),value:"flyout"},{label:(0,t.__)("Popup","cloudinary"),value:"popup"}],L=[{label:(0,t.__)("Top","cloudinary"),value:"top"},{label:(0,t.__)("Bottom","cloudinary"),value:"bottom"},{label:(0,t.__)("Left","cloudinary"),value:"left"},{label:(0,t.__)("Right","cloudinary"),value:"right"}],E=[{label:(0,t.__)("Click","cloudinary"),value:"click"},{label:(0,t.__)("Hover","cloudinary"),value:"hover"}],O=[{label:(0,t.__)("Left","cloudinary"),value:"left"},{label:(0,t.__)("Right","cloudinary"),value:"right"},{label:(0,t.__)("Top","cloudinary"),value:"top"},{label:(0,t.__)("Bottom","cloudinary"),value:"bottom"}],j=[{label:(0,t.__)("Thumbnails","cloudinary"),value:"thumbnails"},{label:(0,t.__)("Indicators","cloudinary"),value:"indicators"},{label:(0,t.__)("None","cloudinary"),value:"none"}],A=[{value:"round",icon:f,label:(0,t.__)("Round","cloudinary")},{value:"radius",icon:v,label:(0,t.__)("Radius","cloudinary")},{value:"none",icon:h,label:(0,t.__)("None","cloudinary")},{value:"square",icon:m,label:(0,t.__)("Square","cloudinary")},{value:"rectangle",icon:()=>d.createElement("svg",{width:"14px",height:"20px",viewBox:"0 0 14 20",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},d.createElement("title",null,"ratio-9-16"),d.createElement("desc",null,"Created with Sketch."),d.createElement("g",{id:"Desktop-0.4",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},d.createElement("g",{id:"ratio/9-16",transform:"translate(-5.000000, -2.000000)",fill:"#000000"},d.createElement("path",{d:"M22,5.5 L22,18.5 L2,18.5 L2,5.5 L22,5.5 Z M20,7.5 L4,7.5 L4,16.5 L20,16.5 L20,7.5 Z",id:"Combined-Shape",transform:"translate(12.000000, 12.000000) rotate(-90.000000) translate(-12.000000, -12.000000) "})))),label:(0,t.__)("Rectangle","cloudinary")}],k=[{value:"round",icon:f,label:(0,t.__)("Round","cloudinary")},{value:"radius",icon:v,label:(0,t.__)("Radius","cloudinary")},{value:"square",icon:m,label:(0,t.__)("Square","cloudinary")}],P=[{label:(0,t.__)("All","cloudinary"),value:"all"},{label:(0,t.__)("Border","cloudinary"),value:"border"},{label:(0,t.__)("Gradient","cloudinary"),value:"gradient"}],S=[{label:(0,t.__)("All","cloudinary"),value:"all"},{label:(0,t.__)("Top","cloudinary"),value:"top"},{label:(0,t.__)("Top-Bottom","cloudinary"),value:"top-bottom"},{label:(0,t.__)("Left-Right","cloudinary"),value:"left-right"},{label:(0,t.__)("Bottom","cloudinary"),value:"bottom"},{label:(0,t.__)("Left","cloudinary"),value:"left"},{label:(0,t.__)("Right","cloudinary"),value:"right"}],C=[{value:"round",icon:f,label:(0,t.__)("Round","cloudinary")},{value:"radius",icon:v,label:(0,t.__)("Radius","cloudinary")},{value:"none",icon:h,label:(0,t.__)("None","cloudinary")},{value:"square",icon:m,label:(0,t.__)("Square","cloudinary")}],M=[{label:(0,t.__)("Pad","cloudinary"),value:"pad"},{label:(0,t.__)("Fill","cloudinary"),value:"fill"}],B=[{label:(0,t.__)("White padding","cloudinary"),value:"rgb:FFFFFF"},{label:(0,t.__)("Border color padding","cloudinary"),value:"auto"},{label:(0,t.__)("Predominant color padding","cloudinary"),value:"auto:predominant"},{label:(0,t.__)("Gradient fade padding","cloudinary"),value:"auto:predominant_gradient"}];var T=r(6942),D=r.n(T),N=r(6087);const R=({value:e,children:t,icon:r,onChange:n,current:o})=>{const a="object"==typeof e?JSON.stringify(e)===JSON.stringify(o):o===e;return N.createElement("button",{type:"button",onClick:()=>n(e),className:D()("radio-select",{"radio-select--active":a})},N.createElement(r,null),N.createElement("div",{className:"radio-select__label"},t))};r.dn(R);const Z=window.wp.data,z=e=>e<10?"0"+String(e):e.toString(16),I=e=>{const t=new Uint8Array((e||40)/2);return window.crypto.getRandomValues(t),Array.from(t,z).join("")},F=e=>{const t=/var\((.*)\)/g.exec(e);return t?getComputedStyle(document.documentElement).getPropertyValue(t[1]):e};function W(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function H(e){return e instanceof W(e).Element||e instanceof Element}function V(e){return e instanceof W(e).HTMLElement||e instanceof HTMLElement}function U(e){return"undefined"!=typeof ShadowRoot&&(e instanceof W(e).ShadowRoot||e instanceof ShadowRoot)}var q=Math.max,$=Math.min,G=Math.round;function X(){var e=navigator.userAgentData;return null!=e&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function J(){return!/^((?!chrome|android).)*safari/i.test(X())}function Y(e,t,r){void 0===t&&(t=!1),void 0===r&&(r=!1);var n=e.getBoundingClientRect(),o=1,a=1;t&&V(e)&&(o=e.offsetWidth>0&&G(n.width)/e.offsetWidth||1,a=e.offsetHeight>0&&G(n.height)/e.offsetHeight||1);var i=(H(e)?W(e):window).visualViewport,s=!J()&&r,l=(n.left+(s&&i?i.offsetLeft:0))/o,c=(n.top+(s&&i?i.offsetTop:0))/a,u=n.width/o,p=n.height/a;return{width:u,height:p,top:c,right:l+u,bottom:c+p,left:l,x:l,y:c}}function K(e){var t=W(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function Q(e){return e?(e.nodeName||"").toLowerCase():null}function ee(e){return((H(e)?e.ownerDocument:e.document)||window.document).documentElement}function te(e){return Y(ee(e)).left+K(e).scrollLeft}function re(e){return W(e).getComputedStyle(e)}function ne(e){var t=re(e),r=t.overflow,n=t.overflowX,o=t.overflowY;return/auto|scroll|overlay|hidden/.test(r+o+n)}function oe(e,t,r){void 0===r&&(r=!1);var n,o,a=V(t),i=V(t)&&function(e){var t=e.getBoundingClientRect(),r=G(t.width)/e.offsetWidth||1,n=G(t.height)/e.offsetHeight||1;return 1!==r||1!==n}(t),s=ee(t),l=Y(e,i,r),c={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(a||!a&&!r)&&(("body"!==Q(t)||ne(s))&&(c=(n=t)!==W(n)&&V(n)?{scrollLeft:(o=n).scrollLeft,scrollTop:o.scrollTop}:K(n)),V(t)?((u=Y(t,!0)).x+=t.clientLeft,u.y+=t.clientTop):s&&(u.x=te(s))),{x:l.left+c.scrollLeft-u.x,y:l.top+c.scrollTop-u.y,width:l.width,height:l.height}}function ae(e){var t=Y(e),r=e.offsetWidth,n=e.offsetHeight;return Math.abs(t.width-r)<=1&&(r=t.width),Math.abs(t.height-n)<=1&&(n=t.height),{x:e.offsetLeft,y:e.offsetTop,width:r,height:n}}function ie(e){return"html"===Q(e)?e:e.assignedSlot||e.parentNode||(U(e)?e.host:null)||ee(e)}function se(e){return["html","body","#document"].indexOf(Q(e))>=0?e.ownerDocument.body:V(e)&&ne(e)?e:se(ie(e))}function le(e,t){var r;void 0===t&&(t=[]);var n=se(e),o=n===(null==(r=e.ownerDocument)?void 0:r.body),a=W(n),i=o?[a].concat(a.visualViewport||[],ne(n)?n:[]):n,s=t.concat(i);return o?s:s.concat(le(ie(i)))}function ce(e){return["table","td","th"].indexOf(Q(e))>=0}function ue(e){return V(e)&&"fixed"!==re(e).position?e.offsetParent:null}function pe(e){for(var t=W(e),r=ue(e);r&&ce(r)&&"static"===re(r).position;)r=ue(r);return r&&("html"===Q(r)||"body"===Q(r)&&"static"===re(r).position)?t:r||function(e){var t=/firefox/i.test(X());if(/Trident/i.test(X())&&V(e)&&"fixed"===re(e).position)return null;var r=ie(e);for(U(r)&&(r=r.host);V(r)&&["html","body"].indexOf(Q(r))<0;){var n=re(r);if("none"!==n.transform||"none"!==n.perspective||"paint"===n.contain||-1!==["transform","perspective"].indexOf(n.willChange)||t&&"filter"===n.willChange||t&&n.filter&&"none"!==n.filter)return r;r=r.parentNode}return null}(e)||t}var de="top",fe="bottom",me="right",ve="left",he="auto",ye=[de,fe,me,ve],ge="start",be="end",_e="viewport",xe="popper",we=ye.reduce(function(e,t){return e.concat([t+"-"+ge,t+"-"+be])},[]),Le=[].concat(ye,[he]).reduce(function(e,t){return e.concat([t,t+"-"+ge,t+"-"+be])},[]),Ee=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function Oe(e){var t=new Map,r=new Set,n=[];function o(e){r.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach(function(e){if(!r.has(e)){var n=t.get(e);n&&o(n)}}),n.push(e)}return e.forEach(function(e){t.set(e.name,e)}),e.forEach(function(e){r.has(e.name)||o(e)}),n}var je={placement:"bottom",modifiers:[],strategy:"absolute"};function Ae(){for(var e=arguments.length,t=new Array(e),r=0;r=0?"x":"y"}function Be(e){var t,r=e.reference,n=e.element,o=e.placement,a=o?Se(o):null,i=o?Ce(o):null,s=r.x+r.width/2-n.width/2,l=r.y+r.height/2-n.height/2;switch(a){case de:t={x:s,y:r.y-n.height};break;case fe:t={x:s,y:r.y+r.height};break;case me:t={x:r.x+r.width,y:l};break;case ve:t={x:r.x-n.width,y:l};break;default:t={x:r.x,y:r.y}}var c=a?Me(a):null;if(null!=c){var u="y"===c?"height":"width";switch(i){case ge:t[c]=t[c]-(r[u]/2-n[u]/2);break;case be:t[c]=t[c]+(r[u]/2-n[u]/2)}}return t}var Te={top:"auto",right:"auto",bottom:"auto",left:"auto"};function De(e){var t,r=e.popper,n=e.popperRect,o=e.placement,a=e.variation,i=e.offsets,s=e.position,l=e.gpuAcceleration,c=e.adaptive,u=e.roundOffsets,p=e.isFixed,d=i.x,f=void 0===d?0:d,m=i.y,v=void 0===m?0:m,h="function"==typeof u?u({x:f,y:v}):{x:f,y:v};f=h.x,v=h.y;var y=i.hasOwnProperty("x"),g=i.hasOwnProperty("y"),b=ve,_=de,x=window;if(c){var w=pe(r),L="clientHeight",E="clientWidth";if(w===W(r)&&"static"!==re(w=ee(r)).position&&"absolute"===s&&(L="scrollHeight",E="scrollWidth"),o===de||(o===ve||o===me)&&a===be)_=fe,v-=(p&&w===x&&x.visualViewport?x.visualViewport.height:w[L])-n.height,v*=l?1:-1;if(o===ve||(o===de||o===fe)&&a===be)b=me,f-=(p&&w===x&&x.visualViewport?x.visualViewport.width:w[E])-n.width,f*=l?1:-1}var O,j=Object.assign({position:s},c&&Te),A=!0===u?function(e,t){var r=e.x,n=e.y,o=t.devicePixelRatio||1;return{x:G(r*o)/o||0,y:G(n*o)/o||0}}({x:f,y:v},W(r)):{x:f,y:v};return f=A.x,v=A.y,l?Object.assign({},j,((O={})[_]=g?"0":"",O[b]=y?"0":"",O.transform=(x.devicePixelRatio||1)<=1?"translate("+f+"px, "+v+"px)":"translate3d("+f+"px, "+v+"px, 0)",O)):Object.assign({},j,((t={})[_]=g?v+"px":"",t[b]=y?f+"px":"",t.transform="",t))}const Ne={name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach(function(e){var r=t.styles[e]||{},n=t.attributes[e]||{},o=t.elements[e];V(o)&&Q(o)&&(Object.assign(o.style,r),Object.keys(n).forEach(function(e){var t=n[e];!1===t?o.removeAttribute(e):o.setAttribute(e,!0===t?"":t)}))})},effect:function(e){var t=e.state,r={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,r.popper),t.styles=r,t.elements.arrow&&Object.assign(t.elements.arrow.style,r.arrow),function(){Object.keys(t.elements).forEach(function(e){var n=t.elements[e],o=t.attributes[e]||{},a=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:r[e]).reduce(function(e,t){return e[t]="",e},{});V(n)&&Q(n)&&(Object.assign(n.style,a),Object.keys(o).forEach(function(e){n.removeAttribute(e)}))})}},requires:["computeStyles"]};const Re={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,r=e.options,n=e.name,o=r.offset,a=void 0===o?[0,0]:o,i=Le.reduce(function(e,r){return e[r]=function(e,t,r){var n=Se(e),o=[ve,de].indexOf(n)>=0?-1:1,a="function"==typeof r?r(Object.assign({},t,{placement:e})):r,i=a[0],s=a[1];return i=i||0,s=(s||0)*o,[ve,me].indexOf(n)>=0?{x:s,y:i}:{x:i,y:s}}(r,t.rects,a),e},{}),s=i[t.placement],l=s.x,c=s.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=c),t.modifiersData[n]=i}};var Ze={left:"right",right:"left",bottom:"top",top:"bottom"};function ze(e){return e.replace(/left|right|bottom|top/g,function(e){return Ze[e]})}var Ie={start:"end",end:"start"};function Fe(e){return e.replace(/start|end/g,function(e){return Ie[e]})}function We(e,t){var r=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(r&&U(r)){var n=t;do{if(n&&e.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function He(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function Ve(e,t,r){return t===_e?He(function(e,t){var r=W(e),n=ee(e),o=r.visualViewport,a=n.clientWidth,i=n.clientHeight,s=0,l=0;if(o){a=o.width,i=o.height;var c=J();(c||!c&&"fixed"===t)&&(s=o.offsetLeft,l=o.offsetTop)}return{width:a,height:i,x:s+te(e),y:l}}(e,r)):H(t)?function(e,t){var r=Y(e,!1,"fixed"===t);return r.top=r.top+e.clientTop,r.left=r.left+e.clientLeft,r.bottom=r.top+e.clientHeight,r.right=r.left+e.clientWidth,r.width=e.clientWidth,r.height=e.clientHeight,r.x=r.left,r.y=r.top,r}(t,r):He(function(e){var t,r=ee(e),n=K(e),o=null==(t=e.ownerDocument)?void 0:t.body,a=q(r.scrollWidth,r.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),i=q(r.scrollHeight,r.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),s=-n.scrollLeft+te(e),l=-n.scrollTop;return"rtl"===re(o||r).direction&&(s+=q(r.clientWidth,o?o.clientWidth:0)-a),{width:a,height:i,x:s,y:l}}(ee(e)))}function Ue(e,t,r,n){var o="clippingParents"===t?function(e){var t=le(ie(e)),r=["absolute","fixed"].indexOf(re(e).position)>=0&&V(e)?pe(e):e;return H(r)?t.filter(function(e){return H(e)&&We(e,r)&&"body"!==Q(e)}):[]}(e):[].concat(t),a=[].concat(o,[r]),i=a[0],s=a.reduce(function(t,r){var o=Ve(e,r,n);return t.top=q(o.top,t.top),t.right=$(o.right,t.right),t.bottom=$(o.bottom,t.bottom),t.left=q(o.left,t.left),t},Ve(e,i,n));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function qe(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function $e(e,t){return t.reduce(function(t,r){return t[r]=e,t},{})}function Ge(e,t){void 0===t&&(t={});var r=t,n=r.placement,o=void 0===n?e.placement:n,a=r.strategy,i=void 0===a?e.strategy:a,s=r.boundary,l=void 0===s?"clippingParents":s,c=r.rootBoundary,u=void 0===c?_e:c,p=r.elementContext,d=void 0===p?xe:p,f=r.altBoundary,m=void 0!==f&&f,v=r.padding,h=void 0===v?0:v,y=qe("number"!=typeof h?h:$e(h,ye)),g=d===xe?"reference":xe,b=e.rects.popper,_=e.elements[m?g:d],x=Ue(H(_)?_:_.contextElement||ee(e.elements.popper),l,u,i),w=Y(e.elements.reference),L=Be({reference:w,element:b,strategy:"absolute",placement:o}),E=He(Object.assign({},b,L)),O=d===xe?E:w,j={top:x.top-O.top+y.top,bottom:O.bottom-x.bottom+y.bottom,left:x.left-O.left+y.left,right:O.right-x.right+y.right},A=e.modifiersData.offset;if(d===xe&&A){var k=A[o];Object.keys(j).forEach(function(e){var t=[me,fe].indexOf(e)>=0?1:-1,r=[de,fe].indexOf(e)>=0?"y":"x";j[e]+=k[r]*t})}return j}function Xe(e,t,r){return q(e,$(t,r))}const Je={name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,r=e.options,n=e.name,o=r.mainAxis,a=void 0===o||o,i=r.altAxis,s=void 0!==i&&i,l=r.boundary,c=r.rootBoundary,u=r.altBoundary,p=r.padding,d=r.tether,f=void 0===d||d,m=r.tetherOffset,v=void 0===m?0:m,h=Ge(t,{boundary:l,rootBoundary:c,padding:p,altBoundary:u}),y=Se(t.placement),g=Ce(t.placement),b=!g,_=Me(y),x="x"===_?"y":"x",w=t.modifiersData.popperOffsets,L=t.rects.reference,E=t.rects.popper,O="function"==typeof v?v(Object.assign({},t.rects,{placement:t.placement})):v,j="number"==typeof O?{mainAxis:O,altAxis:O}:Object.assign({mainAxis:0,altAxis:0},O),A=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,k={x:0,y:0};if(w){if(a){var P,S="y"===_?de:ve,C="y"===_?fe:me,M="y"===_?"height":"width",B=w[_],T=B+h[S],D=B-h[C],N=f?-E[M]/2:0,R=g===ge?L[M]:E[M],Z=g===ge?-E[M]:-L[M],z=t.elements.arrow,I=f&&z?ae(z):{width:0,height:0},F=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},W=F[S],H=F[C],V=Xe(0,L[M],I[M]),U=b?L[M]/2-N-V-W-j.mainAxis:R-V-W-j.mainAxis,G=b?-L[M]/2+N+V+H+j.mainAxis:Z+V+H+j.mainAxis,X=t.elements.arrow&&pe(t.elements.arrow),J=X?"y"===_?X.clientTop||0:X.clientLeft||0:0,Y=null!=(P=null==A?void 0:A[_])?P:0,K=B+G-Y,Q=Xe(f?$(T,B+U-Y-J):T,B,f?q(D,K):D);w[_]=Q,k[_]=Q-B}if(s){var ee,te="x"===_?de:ve,re="x"===_?fe:me,ne=w[x],oe="y"===x?"height":"width",ie=ne+h[te],se=ne-h[re],le=-1!==[de,ve].indexOf(y),ce=null!=(ee=null==A?void 0:A[x])?ee:0,ue=le?ie:ne-L[oe]-E[oe]-ce+j.altAxis,he=le?ne+L[oe]+E[oe]-ce-j.altAxis:se,ye=f&&le?function(e,t,r){var n=Xe(e,t,r);return n>r?r:n}(ue,ne,he):Xe(f?ue:ie,ne,f?he:se);w[x]=ye,k[x]=ye-ne}t.modifiersData[n]=k}},requiresIfExists:["offset"]};const Ye={name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,r=e.state,n=e.name,o=e.options,a=r.elements.arrow,i=r.modifiersData.popperOffsets,s=Se(r.placement),l=Me(s),c=[ve,me].indexOf(s)>=0?"height":"width";if(a&&i){var u=function(e,t){return qe("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:$e(e,ye))}(o.padding,r),p=ae(a),d="y"===l?de:ve,f="y"===l?fe:me,m=r.rects.reference[c]+r.rects.reference[l]-i[l]-r.rects.popper[c],v=i[l]-r.rects.reference[l],h=pe(a),y=h?"y"===l?h.clientHeight||0:h.clientWidth||0:0,g=m/2-v/2,b=u[d],_=y-p[c]-u[f],x=y/2-p[c]/2+g,w=Xe(b,x,_),L=l;r.modifiersData[n]=((t={})[L]=w,t.centerOffset=w-x,t)}},effect:function(e){var t=e.state,r=e.options.element,n=void 0===r?"[data-popper-arrow]":r;null!=n&&("string"!=typeof n||(n=t.elements.popper.querySelector(n)))&&We(t.elements.popper,n)&&(t.elements.arrow=n)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Ke(e,t,r){return void 0===r&&(r={x:0,y:0}),{top:e.top-t.height-r.y,right:e.right-t.width+r.x,bottom:e.bottom-t.height+r.y,left:e.left-t.width-r.x}}function Qe(e){return[de,me,fe,ve].some(function(t){return e[t]>=0})}var et=ke({defaultModifiers:[{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var t=e.state,r=e.instance,n=e.options,o=n.scroll,a=void 0===o||o,i=n.resize,s=void 0===i||i,l=W(t.elements.popper),c=[].concat(t.scrollParents.reference,t.scrollParents.popper);return a&&c.forEach(function(e){e.addEventListener("scroll",r.update,Pe)}),s&&l.addEventListener("resize",r.update,Pe),function(){a&&c.forEach(function(e){e.removeEventListener("scroll",r.update,Pe)}),s&&l.removeEventListener("resize",r.update,Pe)}},data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,r=e.name;t.modifiersData[r]=Be({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}},{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,r=e.options,n=r.gpuAcceleration,o=void 0===n||n,a=r.adaptive,i=void 0===a||a,s=r.roundOffsets,l=void 0===s||s,c={placement:Se(t.placement),variation:Ce(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:o,isFixed:"fixed"===t.options.strategy};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,De(Object.assign({},c,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:i,roundOffsets:l})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,De(Object.assign({},c,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}},Ne,Re,{name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,r=e.options,n=e.name;if(!t.modifiersData[n]._skip){for(var o=r.mainAxis,a=void 0===o||o,i=r.altAxis,s=void 0===i||i,l=r.fallbackPlacements,c=r.padding,u=r.boundary,p=r.rootBoundary,d=r.altBoundary,f=r.flipVariations,m=void 0===f||f,v=r.allowedAutoPlacements,h=t.options.placement,y=Se(h),g=l||(y===h||!m?[ze(h)]:function(e){if(Se(e)===he)return[];var t=ze(e);return[Fe(e),t,Fe(t)]}(h)),b=[h].concat(g).reduce(function(e,r){return e.concat(Se(r)===he?function(e,t){void 0===t&&(t={});var r=t,n=r.placement,o=r.boundary,a=r.rootBoundary,i=r.padding,s=r.flipVariations,l=r.allowedAutoPlacements,c=void 0===l?Le:l,u=Ce(n),p=u?s?we:we.filter(function(e){return Ce(e)===u}):ye,d=p.filter(function(e){return c.indexOf(e)>=0});0===d.length&&(d=p);var f=d.reduce(function(t,r){return t[r]=Ge(e,{placement:r,boundary:o,rootBoundary:a,padding:i})[Se(r)],t},{});return Object.keys(f).sort(function(e,t){return f[e]-f[t]})}(t,{placement:r,boundary:u,rootBoundary:p,padding:c,flipVariations:m,allowedAutoPlacements:v}):r)},[]),_=t.rects.reference,x=t.rects.popper,w=new Map,L=!0,E=b[0],O=0;O=0,S=P?"width":"height",C=Ge(t,{placement:j,boundary:u,rootBoundary:p,altBoundary:d,padding:c}),M=P?k?me:ve:k?fe:de;_[S]>x[S]&&(M=ze(M));var B=ze(M),T=[];if(a&&T.push(C[A]<=0),s&&T.push(C[M]<=0,C[B]<=0),T.every(function(e){return e})){E=j,L=!1;break}w.set(j,T)}if(L)for(var D=function(e){var t=b.find(function(t){var r=w.get(t);if(r)return r.slice(0,e).every(function(e){return e})});if(t)return E=t,"break"},N=m?3:1;N>0;N--){if("break"===D(N))break}t.placement!==E&&(t.modifiersData[n]._skip=!0,t.placement=E,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}},Je,Ye,{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,r=e.name,n=t.rects.reference,o=t.rects.popper,a=t.modifiersData.preventOverflow,i=Ge(t,{elementContext:"reference"}),s=Ge(t,{altBoundary:!0}),l=Ke(i,n),c=Ke(s,o,a),u=Qe(l),p=Qe(c);t.modifiersData[r]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:u,hasPopperEscaped:p},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":p})}}]}),tt="tippy-content",rt="tippy-backdrop",nt="tippy-arrow",ot="tippy-svg-arrow",at={passive:!0,capture:!0},it=function(){return document.body};function st(e,t,r){if(Array.isArray(e)){var n=e[t];return n??(Array.isArray(r)?r[t]:r)}return e}function lt(e,t){var r={}.toString.call(e);return 0===r.indexOf("[object")&&r.indexOf(t+"]")>-1}function ct(e,t){return"function"==typeof e?e.apply(void 0,t):e}function ut(e,t){return 0===t?e:function(n){clearTimeout(r),r=setTimeout(function(){e(n)},t)};var r}function pt(e){return[].concat(e)}function dt(e,t){-1===e.indexOf(t)&&e.push(t)}function ft(e){return e.split("-")[0]}function mt(e){return[].slice.call(e)}function vt(e){return Object.keys(e).reduce(function(t,r){return void 0!==e[r]&&(t[r]=e[r]),t},{})}function ht(){return document.createElement("div")}function yt(e){return["Element","Fragment"].some(function(t){return lt(e,t)})}function gt(e){return lt(e,"MouseEvent")}function bt(e){return!(!e||!e._tippy||e._tippy.reference!==e)}function _t(e){return yt(e)?[e]:function(e){return lt(e,"NodeList")}(e)?mt(e):Array.isArray(e)?e:mt(document.querySelectorAll(e))}function xt(e,t){e.forEach(function(e){e&&(e.style.transitionDuration=t+"ms")})}function wt(e,t){e.forEach(function(e){e&&e.setAttribute("data-state",t)})}function Lt(e){var t,r=pt(e)[0];return null!=r&&null!=(t=r.ownerDocument)&&t.body?r.ownerDocument:document}function Et(e,t,r){var n=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(t){e[n](t,r)})}function Ot(e,t){for(var r=t;r;){var n;if(e.contains(r))return!0;r=null==r.getRootNode||null==(n=r.getRootNode())?void 0:n.host}return!1}var jt={isTouch:!1},At=0;function kt(){jt.isTouch||(jt.isTouch=!0,window.performance&&document.addEventListener("mousemove",Pt))}function Pt(){var e=performance.now();e-At<20&&(jt.isTouch=!1,document.removeEventListener("mousemove",Pt)),At=e}function St(){var e=document.activeElement;if(bt(e)){var t=e._tippy;e.blur&&!t.state.isVisible&&e.blur()}}var Ct=!!("undefined"!=typeof window&&"undefined"!=typeof document)&&!!window.msCrypto;var Mt={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},Bt=Object.assign({appendTo:it,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},Mt,{allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999}),Tt=Object.keys(Bt);function Dt(e){var t=(e.plugins||[]).reduce(function(t,r){var n,o=r.name,a=r.defaultValue;o&&(t[o]=void 0!==e[o]?e[o]:null!=(n=Bt[o])?n:a);return t},{});return Object.assign({},e,t)}function Nt(e,t){var r=Object.assign({},t,{content:ct(t.content,[e])},t.ignoreAttributes?{}:function(e,t){return(t?Object.keys(Dt(Object.assign({},Bt,{plugins:t}))):Tt).reduce(function(t,r){var n=(e.getAttribute("data-tippy-"+r)||"").trim();if(!n)return t;if("content"===r)t[r]=n;else try{t[r]=JSON.parse(n)}catch(e){t[r]=n}return t},{})}(e,t.plugins));return r.aria=Object.assign({},Bt.aria,r.aria),r.aria={expanded:"auto"===r.aria.expanded?t.interactive:r.aria.expanded,content:"auto"===r.aria.content?t.interactive?null:"describedby":r.aria.content},r}function Rt(e,t){e.innerHTML=t}function Zt(e){var t=ht();return!0===e?t.className=nt:(t.className=ot,yt(e)?t.appendChild(e):Rt(t,e)),t}function zt(e,t){yt(t.content)?(Rt(e,""),e.appendChild(t.content)):"function"!=typeof t.content&&(t.allowHTML?Rt(e,t.content):e.textContent=t.content)}function It(e){var t=e.firstElementChild,r=mt(t.children);return{box:t,content:r.find(function(e){return e.classList.contains(tt)}),arrow:r.find(function(e){return e.classList.contains(nt)||e.classList.contains(ot)}),backdrop:r.find(function(e){return e.classList.contains(rt)})}}function Ft(e){var t=ht(),r=ht();r.className="tippy-box",r.setAttribute("data-state","hidden"),r.setAttribute("tabindex","-1");var n=ht();function o(r,n){var o=It(t),a=o.box,i=o.content,s=o.arrow;n.theme?a.setAttribute("data-theme",n.theme):a.removeAttribute("data-theme"),"string"==typeof n.animation?a.setAttribute("data-animation",n.animation):a.removeAttribute("data-animation"),n.inertia?a.setAttribute("data-inertia",""):a.removeAttribute("data-inertia"),a.style.maxWidth="number"==typeof n.maxWidth?n.maxWidth+"px":n.maxWidth,n.role?a.setAttribute("role",n.role):a.removeAttribute("role"),r.content===n.content&&r.allowHTML===n.allowHTML||zt(i,e.props),n.arrow?s?r.arrow!==n.arrow&&(a.removeChild(s),a.appendChild(Zt(n.arrow))):a.appendChild(Zt(n.arrow)):s&&a.removeChild(s)}return n.className=tt,n.setAttribute("data-state","hidden"),zt(n,e.props),t.appendChild(r),r.appendChild(n),o(e.props,e.props),{popper:t,onUpdate:o}}Ft.$$tippy=!0;var Wt=1,Ht=[],Vt=[];function Ut(e,t){var r,n,o,a,i,s,l,c,u=Nt(e,Object.assign({},Bt,Dt(vt(t)))),p=!1,d=!1,f=!1,m=!1,v=[],h=ut($,u.interactiveDebounce),y=Wt++,g=(c=u.plugins).filter(function(e,t){return c.indexOf(e)===t}),b={id:y,reference:e,popper:ht(),popperInstance:null,props:u,state:{isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},plugins:g,clearDelayTimeouts:function(){clearTimeout(r),clearTimeout(n),cancelAnimationFrame(o)},setProps:function(t){0;if(b.state.isDestroyed)return;B("onBeforeUpdate",[b,t]),U();var r=b.props,n=Nt(e,Object.assign({},r,vt(t),{ignoreAttributes:!0}));b.props=n,V(),r.interactiveDebounce!==n.interactiveDebounce&&(N(),h=ut($,n.interactiveDebounce));r.triggerTarget&&!n.triggerTarget?pt(r.triggerTarget).forEach(function(e){e.removeAttribute("aria-expanded")}):n.triggerTarget&&e.removeAttribute("aria-expanded");D(),M(),w&&w(r,n);b.popperInstance&&(Y(),Q().forEach(function(e){requestAnimationFrame(e._tippy.popperInstance.forceUpdate)}));B("onAfterUpdate",[b,t])},setContent:function(e){b.setProps({content:e})},show:function(){0;var e=b.state.isVisible,t=b.state.isDestroyed,r=!b.state.isEnabled,n=jt.isTouch&&!b.props.touch,o=st(b.props.duration,0,Bt.duration);if(e||t||r||n)return;if(k().hasAttribute("disabled"))return;if(B("onShow",[b],!1),!1===b.props.onShow(b))return;b.state.isVisible=!0,A()&&(x.style.visibility="visible");M(),I(),b.state.isMounted||(x.style.transition="none");if(A()){var a=S();xt([a.box,a.content],0)}s=function(){var e;if(b.state.isVisible&&!m){if(m=!0,x.offsetHeight,x.style.transition=b.props.moveTransition,A()&&b.props.animation){var t=S(),r=t.box,n=t.content;xt([r,n],o),wt([r,n],"visible")}T(),D(),dt(Vt,b),null==(e=b.popperInstance)||e.forceUpdate(),B("onMount",[b]),b.props.animation&&A()&&function(e,t){W(e,t)}(o,function(){b.state.isShown=!0,B("onShown",[b])})}},function(){var e,t=b.props.appendTo,r=k();e=b.props.interactive&&t===it||"parent"===t?r.parentNode:ct(t,[r]);e.contains(x)||e.appendChild(x);b.state.isMounted=!0,Y(),!1}()},hide:function(){0;var e=!b.state.isVisible,t=b.state.isDestroyed,r=!b.state.isEnabled,n=st(b.props.duration,1,Bt.duration);if(e||t||r)return;if(B("onHide",[b],!1),!1===b.props.onHide(b))return;b.state.isVisible=!1,b.state.isShown=!1,m=!1,p=!1,A()&&(x.style.visibility="hidden");if(N(),F(),M(!0),A()){var o=S(),a=o.box,i=o.content;b.props.animation&&(xt([a,i],n),wt([a,i],"hidden"))}T(),D(),b.props.animation?A()&&function(e,t){W(e,function(){!b.state.isVisible&&x.parentNode&&x.parentNode.contains(x)&&t()})}(n,b.unmount):b.unmount()},hideWithInteractivity:function(e){0;P().addEventListener("mousemove",h),dt(Ht,h),h(e)},enable:function(){b.state.isEnabled=!0},disable:function(){b.hide(),b.state.isEnabled=!1},unmount:function(){0;b.state.isVisible&&b.hide();if(!b.state.isMounted)return;K(),Q().forEach(function(e){e._tippy.unmount()}),x.parentNode&&x.parentNode.removeChild(x);Vt=Vt.filter(function(e){return e!==b}),b.state.isMounted=!1,B("onHidden",[b])},destroy:function(){0;if(b.state.isDestroyed)return;b.clearDelayTimeouts(),b.unmount(),U(),delete e._tippy,b.state.isDestroyed=!0,B("onDestroy",[b])}};if(!u.render)return b;var _=u.render(b),x=_.popper,w=_.onUpdate;x.setAttribute("data-tippy-root",""),x.id="tippy-"+b.id,b.popper=x,e._tippy=b,x._tippy=b;var L=g.map(function(e){return e.fn(b)}),E=e.hasAttribute("aria-expanded");return V(),D(),M(),B("onCreate",[b]),u.showOnCreate&&ee(),x.addEventListener("mouseenter",function(){b.props.interactive&&b.state.isVisible&&b.clearDelayTimeouts()}),x.addEventListener("mouseleave",function(){b.props.interactive&&b.props.trigger.indexOf("mouseenter")>=0&&P().addEventListener("mousemove",h)}),b;function O(){var e=b.props.touch;return Array.isArray(e)?e:[e,0]}function j(){return"hold"===O()[0]}function A(){var e;return!(null==(e=b.props.render)||!e.$$tippy)}function k(){return l||e}function P(){var e=k().parentNode;return e?Lt(e):document}function S(){return It(x)}function C(e){return b.state.isMounted&&!b.state.isVisible||jt.isTouch||a&&"focus"===a.type?0:st(b.props.delay,e?0:1,Bt.delay)}function M(e){void 0===e&&(e=!1),x.style.pointerEvents=b.props.interactive&&!e?"":"none",x.style.zIndex=""+b.props.zIndex}function B(e,t,r){var n;(void 0===r&&(r=!0),L.forEach(function(r){r[e]&&r[e].apply(r,t)}),r)&&(n=b.props)[e].apply(n,t)}function T(){var t=b.props.aria;if(t.content){var r="aria-"+t.content,n=x.id;pt(b.props.triggerTarget||e).forEach(function(e){var t=e.getAttribute(r);if(b.state.isVisible)e.setAttribute(r,t?t+" "+n:n);else{var o=t&&t.replace(n,"").trim();o?e.setAttribute(r,o):e.removeAttribute(r)}})}}function D(){!E&&b.props.aria.expanded&&pt(b.props.triggerTarget||e).forEach(function(e){b.props.interactive?e.setAttribute("aria-expanded",b.state.isVisible&&e===k()?"true":"false"):e.removeAttribute("aria-expanded")})}function N(){P().removeEventListener("mousemove",h),Ht=Ht.filter(function(e){return e!==h})}function R(t){if(!jt.isTouch||!f&&"mousedown"!==t.type){var r=t.composedPath&&t.composedPath()[0]||t.target;if(!b.props.interactive||!Ot(x,r)){if(pt(b.props.triggerTarget||e).some(function(e){return Ot(e,r)})){if(jt.isTouch)return;if(b.state.isVisible&&b.props.trigger.indexOf("click")>=0)return}else B("onClickOutside",[b,t]);!0===b.props.hideOnClick&&(b.clearDelayTimeouts(),b.hide(),d=!0,setTimeout(function(){d=!1}),b.state.isMounted||F())}}}function Z(){f=!0}function z(){f=!1}function I(){var e=P();e.addEventListener("mousedown",R,!0),e.addEventListener("touchend",R,at),e.addEventListener("touchstart",z,at),e.addEventListener("touchmove",Z,at)}function F(){var e=P();e.removeEventListener("mousedown",R,!0),e.removeEventListener("touchend",R,at),e.removeEventListener("touchstart",z,at),e.removeEventListener("touchmove",Z,at)}function W(e,t){var r=S().box;function n(e){e.target===r&&(Et(r,"remove",n),t())}if(0===e)return t();Et(r,"remove",i),Et(r,"add",n),i=n}function H(t,r,n){void 0===n&&(n=!1),pt(b.props.triggerTarget||e).forEach(function(e){e.addEventListener(t,r,n),v.push({node:e,eventType:t,handler:r,options:n})})}function V(){var e;j()&&(H("touchstart",q,{passive:!0}),H("touchend",G,{passive:!0})),(e=b.props.trigger,e.split(/\s+/).filter(Boolean)).forEach(function(e){if("manual"!==e)switch(H(e,q),e){case"mouseenter":H("mouseleave",G);break;case"focus":H(Ct?"focusout":"blur",X);break;case"focusin":H("focusout",X)}})}function U(){v.forEach(function(e){var t=e.node,r=e.eventType,n=e.handler,o=e.options;t.removeEventListener(r,n,o)}),v=[]}function q(e){var t,r=!1;if(b.state.isEnabled&&!J(e)&&!d){var n="focus"===(null==(t=a)?void 0:t.type);a=e,l=e.currentTarget,D(),!b.state.isVisible&>(e)&&Ht.forEach(function(t){return t(e)}),"click"===e.type&&(b.props.trigger.indexOf("mouseenter")<0||p)&&!1!==b.props.hideOnClick&&b.state.isVisible?r=!0:ee(e),"click"===e.type&&(p=!r),r&&!n&&te(e)}}function $(e){var t=e.target,r=k().contains(t)||x.contains(t);if("mousemove"!==e.type||!r){var n=Q().concat(x).map(function(e){var t,r=null==(t=e._tippy.popperInstance)?void 0:t.state;return r?{popperRect:e.getBoundingClientRect(),popperState:r,props:u}:null}).filter(Boolean);(function(e,t){var r=t.clientX,n=t.clientY;return e.every(function(e){var t=e.popperRect,o=e.popperState,a=e.props.interactiveBorder,i=ft(o.placement),s=o.modifiersData.offset;if(!s)return!0;var l="bottom"===i?s.top.y:0,c="top"===i?s.bottom.y:0,u="right"===i?s.left.x:0,p="left"===i?s.right.x:0,d=t.top-n+l>a,f=n-t.bottom-c>a,m=t.left-r+u>a,v=r-t.right-p>a;return d||f||m||v})})(n,e)&&(N(),te(e))}}function G(e){J(e)||b.props.trigger.indexOf("click")>=0&&p||(b.props.interactive?b.hideWithInteractivity(e):te(e))}function X(e){b.props.trigger.indexOf("focusin")<0&&e.target!==k()||b.props.interactive&&e.relatedTarget&&x.contains(e.relatedTarget)||te(e)}function J(e){return!!jt.isTouch&&j()!==e.type.indexOf("touch")>=0}function Y(){K();var t=b.props,r=t.popperOptions,n=t.placement,o=t.offset,a=t.getReferenceClientRect,i=t.moveTransition,l=A()?It(x).arrow:null,c=a?{getBoundingClientRect:a,contextElement:a.contextElement||k()}:e,u={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(e){var t=e.state;if(A()){var r=S().box;["placement","reference-hidden","escaped"].forEach(function(e){"placement"===e?r.setAttribute("data-placement",t.placement):t.attributes.popper["data-popper-"+e]?r.setAttribute("data-"+e,""):r.removeAttribute("data-"+e)}),t.attributes.popper={}}}},p=[{name:"offset",options:{offset:o}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!i}},u];A()&&l&&p.push({name:"arrow",options:{element:l,padding:3}}),p.push.apply(p,(null==r?void 0:r.modifiers)||[]),b.popperInstance=et(c,x,Object.assign({},r,{placement:n,onFirstUpdate:s,modifiers:p}))}function K(){b.popperInstance&&(b.popperInstance.destroy(),b.popperInstance=null)}function Q(){return mt(x.querySelectorAll("[data-tippy-root]"))}function ee(e){b.clearDelayTimeouts(),e&&B("onTrigger",[b,e]),I();var t=C(!0),n=O(),o=n[0],a=n[1];jt.isTouch&&"hold"===o&&a&&(t=a),t?r=setTimeout(function(){b.show()},t):b.show()}function te(e){if(b.clearDelayTimeouts(),B("onUntrigger",[b,e]),b.state.isVisible){if(!(b.props.trigger.indexOf("mouseenter")>=0&&b.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(e.type)>=0&&p)){var t=C(!1);t?n=setTimeout(function(){b.state.isVisible&&b.hide()},t):o=requestAnimationFrame(function(){b.hide()})}}else F()}}function qt(e,t){void 0===t&&(t={});var r=Bt.plugins.concat(t.plugins||[]);document.addEventListener("touchstart",kt,at),window.addEventListener("blur",St);var n=Object.assign({},t,{plugins:r}),o=_t(e).reduce(function(e,t){var r=t&&Ut(t,n);return r&&e.push(r),e},[]);return yt(e)?o[0]:o}qt.defaultProps=Bt,qt.setDefaultProps=function(e){Object.keys(e).forEach(function(t){Bt[t]=e[t]})},qt.currentInput=jt;Object.assign({},Ne,{effect:function(e){var t=e.state,r={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(t.elements.popper.style,r.popper),t.styles=r,t.elements.arrow&&Object.assign(t.elements.arrow.style,r.arrow)}});qt.setDefaultProps({render:Ft});const $t=qt;var Gt=r(6087);const Xt=({children:e,value:t})=>Gt.createElement("div",{className:"colorpalette-color-label"},Gt.createElement("span",null,e),Gt.createElement("span",{className:"component-color-indicator","aria-label":`Color: ${t}`,style:{background:t}})),Jt=new(o()())("_"),Yt=({attributes:e,setAttributes:r,colors:n})=>{const o=p()(e),a=Jt.object(o),[i,u]=(0,l.useState)(a.customSettings);e.transformation_crop||(e.transformation_crop="pad",e.transformation_background="rgb:FFFFFF"),"fill"===e.transformation_crop&&delete e.transformation_background;const d=(e,t)=>{const n={[t]:F(e)};r(n)},f=(e=>{const[t,r]=(0,l.useState)(null),n=(0,l.useCallback)(e=>r(e),[]);return(0,l.useEffect)(()=>{if(!t)return;const r=$t(t,{content:e});return()=>{r?.destroy()}},[t,e]),n})((0,t.__)("How to resize or crop images to fit the gallery. Pad adds padding around the image using the specified padding style. Fill crops the image from the center so it fills as much of the available space as possible.","cloudinary"));return Gt.createElement(Gt.Fragment,null,Gt.createElement(s.PanelBody,{title:(0,t.__)("Layout","cloudinary")},y.map(t=>Gt.createElement(R,{key:`${t.value.type}-${t.value.columns}-layout`,value:t.value,onChange:e=>{r({displayProps_mode:e.type,displayProps_columns:e.columns||1})},icon:t.icon,current:{type:e.displayProps_mode,columns:e.displayProps_columns||1}},t.label))),Gt.createElement(s.PanelBody,{title:(0,t.__)("Color Palette","cloudinary"),initialOpen:!1},Gt.createElement(Xt,{value:e.themeProps_primary},(0,t.__)("Primary","cloudinary")),Gt.createElement(c.ColorPalette,{value:e.themeProps_primary,colors:n,disableCustomColors:!1,onChange:e=>d(e,"themeProps_primary")}),Gt.createElement(Xt,{value:e.themeProps_onPrimary},(0,t.__)("On Primary","cloudinary")),Gt.createElement(c.ColorPalette,{value:e.themeProps_onPrimary,colors:n,disableCustomColors:!1,onChange:e=>d(e,"themeProps_onPrimary")}),Gt.createElement(Xt,{value:e.themeProps_active},(0,t.__)("Active","cloudinary")),Gt.createElement(c.ColorPalette,{value:e.themeProps_active,colors:n,disableCustomColors:!1,onChange:e=>d(e,"themeProps_active")})),"classic"===e.displayProps_mode&&Gt.createElement(s.PanelBody,{title:(0,t.__)("Fade Transition","cloudinary"),initialOpen:!1},Gt.createElement(s.SelectControl,{value:e.transition,options:_,onChange:e=>r({transition:e}),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0})),Gt.createElement(s.PanelBody,{title:(0,t.__)("Main Viewer Parameters","cloudinary"),initialOpen:!1},Gt.createElement(s.SelectControl,{label:(0,t.__)("Aspect Ratio","cloudinary"),value:e.aspectRatio,options:b,onChange:e=>r({aspectRatio:e}),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0}),Gt.createElement("p",null,Gt.createElement("div",{className:"cld-ui-title"},(0,t.__)("Resize/Crop Mode","cloudinary"),Gt.createElement("span",{className:"dashicons dashicons-info cld-tooltip",ref:f})),Gt.createElement(s.ButtonGroup,null,M.map(t=>Gt.createElement(s.Button,{key:t.value+"-look-and-feel",variant:"secondary",isSecondary:!0,isPressed:t.value===e.transformation_crop,onClick:()=>r({transformation_crop:t.value,transformation_background:null})},t.label)))),"pad"===e.transformation_crop&&Gt.createElement(s.SelectControl,{label:(0,t.__)("Pad style","cloudinary"),value:e.transformation_background,options:B,onChange:e=>{r({transformation_background:e})},__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0}),Gt.createElement("p",null,(0,t.__)("Navigation","cloudinary")),Gt.createElement("p",null,Gt.createElement(s.ButtonGroup,null,x.map(t=>Gt.createElement(s.Button,{key:t.value+"-navigation",variant:"secondary",isSecondary:!0,isPressed:t.value===e.navigation,onClick:()=>r({navigation:t.value})},t.label)))),Gt.createElement("div",{style:{marginTop:"30px"}},Gt.createElement(s.ToggleControl,{label:(0,t.__)("Show Zoom","cloudinary"),checked:e.zoom,onChange:()=>r({zoom:!e.zoom}),__nextHasNoMarginBottom:!0}),e.zoom&&Gt.createElement(Gt.Fragment,null,Gt.createElement("p",null,(0,t.__)("Zoom Type","cloudinary")),Gt.createElement("p",null,Gt.createElement(s.ButtonGroup,null,w.map(t=>Gt.createElement(s.Button,{key:t.value+"-zoom-type",variant:"secondary",isSecondary:!0,isPressed:t.value===e.zoomProps_type,onClick:()=>r({zoomProps_type:t.value})},t.label)))),"flyout"===e.zoomProps_type&&Gt.createElement(s.SelectControl,{label:(0,t.__)("Zoom Viewer Position","cloudinary"),value:e.zoomProps_viewerPosition,options:L,onChange:e=>r({zoomProps_viewerPosition:e}),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0}),"popup"!==e.zoomProps_type&&Gt.createElement(Gt.Fragment,null,Gt.createElement("p",null,(0,t.__)("Zoom Trigger","cloudinary")),Gt.createElement("p",null,Gt.createElement(s.ButtonGroup,null,E.map(t=>Gt.createElement(s.Button,{key:t.value+"-zoom-trigger",variant:"secondary",isSecondary:!0,isPressed:t.value===e.zoomProps_trigger,onClick:()=>r({zoomProps_trigger:t.value})},t.label)))))))),Gt.createElement(s.PanelBody,{title:(0,t.__)("Carousel Parameters","cloudinary"),initialOpen:!1},Gt.createElement("p",null,(0,t.__)("Carousel Location","cloudinary")),Gt.createElement("p",null,Gt.createElement(s.ButtonGroup,null,O.map(t=>Gt.createElement(s.Button,{key:t.value+"-carousel-location",variant:"secondary",isSecondary:!0,isPressed:t.value===e.carouselLocation,onClick:()=>r({carouselLocation:t.value})},t.label)))),Gt.createElement(s.RangeControl,{label:(0,t.__)("Carousel Offset","cloudinary"),value:e.carouselOffset,onChange:e=>r({carouselOffset:e}),min:0,max:100,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0}),Gt.createElement("p",null,(0,t.__)("Carousel Style","cloudinary")),Gt.createElement("p",null,Gt.createElement(s.ButtonGroup,null,j.map(t=>Gt.createElement(s.Button,{key:t.value+"-carousel-style",variant:"secondary",isSecondary:!0,isPressed:t.value===e.carouselStyle,onClick:()=>r({carouselStyle:t.value})},t.label)))),"thumbnails"===e.carouselStyle&&Gt.createElement(Gt.Fragment,null,Gt.createElement(s.RangeControl,{label:(0,t.__)("Width","cloudinary"),value:e.thumbnailProps_width,onChange:e=>r({thumbnailProps_width:e}),min:5,max:300,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0}),Gt.createElement(s.RangeControl,{label:(0,t.__)("Height","cloudinary"),value:e.thumbnailProps_height,onChange:e=>r({thumbnailProps_height:e}),min:5,max:300,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0}),Gt.createElement("p",null,(0,t.__)("Navigation Button Shape","cloudinary")),A.map(t=>Gt.createElement(R,{key:t.value+"-navigation-button-shape",value:t.value,onChange:e=>r({thumbnailProps_navigationShape:e}),icon:t.icon,current:e.thumbnailProps_navigationShape},t.label)),Gt.createElement("p",null,(0,t.__)("Selected Style","cloudinary")),Gt.createElement("p",null,Gt.createElement(s.ButtonGroup,null,P.map(t=>Gt.createElement(s.Button,{key:t.value+"-selected-style",variant:"secondary",isSecondary:!0,isPressed:t.value===e.thumbnailProps_selectedStyle,onClick:()=>r({thumbnailProps_selectedStyle:t.value})},t.label)))),Gt.createElement(s.SelectControl,{label:(0,t.__)("Selected Border Position","cloudinary"),value:e.thumbnailProps_selectedBorderPosition,options:S,onChange:e=>r({thumbnailProps_selectedBorderPosition:e}),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0}),Gt.createElement(s.RangeControl,{label:(0,t.__)("Selected Border Width","cloudinary"),value:e.thumbnailProps_selectedBorderWidth,onChange:e=>r({thumbnailProps_selectedBorderWidth:e}),min:0,max:10,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0}),Gt.createElement("p",null,(0,t.__)("Media Shape Icon","cloudinary")),C.map(t=>Gt.createElement(R,{key:t.value+"-media",value:t.value,onChange:e=>r({thumbnailProps_mediaSymbolShape:e}),icon:t.icon,current:e.thumbnailProps_mediaSymbolShape},t.label))),"indicators"===e.carouselStyle&&Gt.createElement(Gt.Fragment,null,Gt.createElement("p",null,(0,t.__)("Indicators Shape","cloudinary")),k.map(t=>Gt.createElement(R,{key:t.value+"-indicator",value:t.value,onChange:e=>r({indicatorProps_shape:e}),icon:t.icon,current:e.indicatorProps_shape},t.label)))),Gt.createElement(s.PanelBody,{title:(0,t.__)("Additional Settings","cloudinary"),initialOpen:!1},Gt.createElement(s.TextareaControl,{label:(0,t.__)("Custom Settings","cloudinary"),help:(0,t.__)("Provide a JSON string of the settings you want to add and/or override.","cloudinary"),value:i,onChange:e=>{let t={};u(e);try{t=JSON.parse(e)}catch(e){}if("object"==typeof t){const e={...a};e.customSettings=t,r({...a,...e})}},__nextHasNoMarginBottom:!0})))};var Kt=r(6087);const Qt=new(o()())("_"),er=(0,t.__)("Drag images, upload new ones or select files from your library.","cloudinary"),tr=(e,t)=>({...e,container:"."+t,zoom:!1}),rr=e=>e?.cloudinary?.galleryWidget,nr=({setAttributes:e,attributes:r,isSelected:n})=>{const[a,u]=(0,l.useState)(null),[d,f]=(0,l.useState)(!1),m=(0,l.useRef)(null),v=(0,l.useMemo)(()=>{if(0!==r.selectedImages.length)return r;const e={},{container:t,...n}=Qt.dot(CLD_GALLERY_CONFIG);return Object.keys(n).forEach(t=>{r[t]||(e[t]=n[t])}),{...r,...e}},[r]),h=(0,l.useMemo)(()=>r.selectedImages.length?r.selectedImages.map(({attachmentId:e})=>({id:e})):[],[r]);(0,l.useEffect)(()=>{a&&((({status:e,message:t,options:r={}})=>{(0,Z.dispatch)("core/notices").createNotice(e,t,{isDismissible:!0,...r})})({status:"error",message:a}),u(null));const e=m.current;if(!r.selectedImages.length||!e)return;const t=e.ownerDocument.defaultView||window,n=e=>t===window?e:t.JSON.parse(JSON.stringify(e)),{customSettings:i,...s}=(e=>{const t=new(o()())("_"),r=p()(e),{selectedImages:n,...a}=t.object(r,{});return a.mediaAssets=n,"classic"!==a?.displayProps?.mode?delete a.transition:delete a.displayProps.columns,"pad"!==a?.transformation_crop&&delete a.transformation_background,"pad"!==a?.transformation?.crop&&delete a.transformation.background,a?.themeProps?.primary&&(a.themeProps.primary=F(a?.themeProps?.primary)),a?.themeProps?.onPrimary&&(a.themeProps.onPrimary=F(a?.themeProps?.onPrimary)),a?.themeProps?.active&&(a.themeProps.active=F(a?.themeProps?.active)),a})(r),l=(e=>{let t=e;if("string"==typeof e)try{t=JSON.parse(e)}catch{return{}}return!t||"object"!=typeof t||Array.isArray(t)?{}:t})(i);let c,d=!1;const v=()=>{const e=rr(t);if(!d&&e){try{c=e(n(tr({...s,...l},r.container)))}catch{c=e(n(tr(s,r.container)))}c.render(),f(!1)}};return rr(t)?v():"complete"!==t.document.readyState?t.addEventListener("load",v,{once:!0}):f(!1),()=>{d=!0,t.removeEventListener("load",v),c?.destroy()}},[a,r,e]);const y=!!r.selectedImages.length;(0,l.useEffect)(()=>{r.container||e({container:`cld-gallery-${I(15)}`})},[r.container,e]),(0,l.useEffect)(()=>{e(v)},[v,e]);const b=(0,c.useBlockProps)();return Kt.createElement("div",b,Kt.createElement(Kt.Fragment,null,Kt.createElement("div",{ref:m,className:r.container}),Kt.createElement("div",{className:"wp-block-cloudinary-gallery"},Kt.createElement(c.MediaPlaceholder,{labels:{title:!y&&(0,t.__)("Cloudinary Gallery","cloudinary"),instructions:!y&&er},icon:"format-gallery",disableMediaButtons:y&&!n,allowedTypes:g,addToGallery:y,isAppender:y,onSelect:r=>(async r=>{f(!0);try{const t=await i()({path:CLD_REST_ENDPOINT+"/image_data",method:"POST",data:{images:r}});e({selectedImages:t})}catch{f(!1),u((0,t.__)("Could not load selected images. Please try again.","cloudinary"))}})(r),value:h,multiple:!0},d&&Kt.createElement("div",{className:"loading-spinner-container"},Kt.createElement(s.Spinner,null))))),Kt.createElement(c.InspectorControls,null,Kt.createElement(Yt,{attributes:r,setAttributes:e})))};var or=r(6087);const ar=({attributes:e})=>or.createElement("div",{className:e.container}),ir=JSON.parse('{"aspectRatio":{"type":"string"},"navigation":{"type":"string"},"zoom":{"type":"boolean"},"carouselLocation":{"type":"string"},"carouselOffset":{"type":"number"},"carouselStyle":{"type":"string"},"displayProps_mode":{"type":"string"},"displayProps_columns":{"type":"number"},"indicatorProps_shape":{"type":"string"},"themeProps_primary":{"type":"string"},"themeProps_onPrimary":{"type":"string"},"themeProps_active":{"type":"string"},"zoomProps_type":{"type":"string"},"zoomProps_viewerPosition":{"type":"string"},"zoomProps_trigger":{"type":"string"},"thumbnailProps_width":{"type":"number"},"thumbnailProps_height":{"type":"number"},"thumbnailProps_navigationShape":{"type":"string"},"thumbnailProps_selectedStyle":{"type":"string"},"thumbnailProps_selectedBorderPosition":{"type":"string"},"thumbnailProps_selectedBorderWidth":{"type":"number"},"thumbnailProps_mediaSymbolShape":{"type":"string"},"cloudName":{"type":"string"},"container":{"type":"string"},"selectedImages":{"type":"array","default":[]},"transformation_crop":{"type":"string","default":"pad"},"transformation_background":{"type":"string"},"customSettings":{"type":"string"}}');(0,n.registerBlockType)("cloudinary/gallery",{apiVersion:2,title:(0,t.__)("Cloudinary Gallery","cloudinary"),description:(0,t.__)("Add a gallery powered by the Cloudinary Gallery Widget to your post.","cloudinary"),category:"widgets",icon:"format-gallery",attributes:ir,edit:nr,save:ar})})()})(); +(()=>{var e={5580(e,t,r){var n=r(6110)(r(9325),"DataView");e.exports=n},1549(e,t,r){var n=r(2032),o=r(3862),a=r(6721),i=r(2749),s=r(5749);function l(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t-1&&e%1==0&&e-1}},1175(e,t,r){var n=r(6025);e.exports=function(e,t){var r=this.__data__,o=n(r,e);return o<0?(++this.size,r.push([e,t])):r[o][1]=t,this}},3040(e,t,r){var n=r(1549),o=r(79),a=r(8223);e.exports=function(){this.size=0,this.__data__={hash:new n,map:new(a||o),string:new n}}},7670(e,t,r){var n=r(2651);e.exports=function(e){var t=n(this,e).delete(e);return this.size-=t?1:0,t}},289(e,t,r){var n=r(2651);e.exports=function(e){return n(this,e).get(e)}},4509(e,t,r){var n=r(2651);e.exports=function(e){return n(this,e).has(e)}},2949(e,t,r){var n=r(2651);e.exports=function(e,t){var r=n(this,e),o=r.size;return r.set(e,t),this.size+=r.size==o?0:1,this}},1042(e,t,r){var n=r(6110)(Object,"create");e.exports=n},3650(e,t,r){var n=r(4335)(Object.keys,Object);e.exports=n},181(e){e.exports=function(e){var t=[];if(null!=e)for(var r in Object(e))t.push(r);return t}},6009(e,t,r){e=r.nmd(e);var n=r(4840),o=t&&!t.nodeType&&t,a=o&&e&&!e.nodeType&&e,i=a&&a.exports===o&&n.process,s=function(){try{var e=a&&a.require&&a.require("util").types;return e||i&&i.binding&&i.binding("util")}catch(e){}}();e.exports=s},9350(e){var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},4335(e){e.exports=function(e,t){return function(r){return e(t(r))}}},9325(e,t,r){var n=r(4840),o="object"==typeof self&&self&&self.Object===Object&&self,a=n||o||Function("return this")();e.exports=a},1420(e,t,r){var n=r(79);e.exports=function(){this.__data__=new n,this.size=0}},938(e){e.exports=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}},3605(e){e.exports=function(e){return this.__data__.get(e)}},9817(e){e.exports=function(e){return this.__data__.has(e)}},945(e,t,r){var n=r(79),o=r(8223),a=r(3661);e.exports=function(e,t){var r=this.__data__;if(r instanceof n){var i=r.__data__;if(!o||i.length<199)return i.push([e,t]),this.size=++r.size,this;r=this.__data__=new a(i)}return r.set(e,t),this.size=r.size,this}},7473(e){var t=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return t.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},8055(e,t,r){var n=r(9999);e.exports=function(e){return n(e,5)}},5288(e){e.exports=function(e,t){return e===t||e!=e&&t!=t}},2428(e,t,r){var n=r(7534),o=r(346),a=Object.prototype,i=a.hasOwnProperty,s=a.propertyIsEnumerable,l=n(function(){return arguments}())?n:function(e){return o(e)&&i.call(e,"callee")&&!s.call(e,"callee")};e.exports=l},6449(e){var t=Array.isArray;e.exports=t},4894(e,t,r){var n=r(1882),o=r(294);e.exports=function(e){return null!=e&&o(e.length)&&!n(e)}},3656(e,t,r){e=r.nmd(e);var n=r(9325),o=r(9935),a=t&&!t.nodeType&&t,i=a&&e&&!e.nodeType&&e,s=i&&i.exports===a?n.Buffer:void 0,l=(s?s.isBuffer:void 0)||o;e.exports=l},1882(e,t,r){var n=r(2552),o=r(3805);e.exports=function(e){if(!o(e))return!1;var t=n(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},294(e){e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}},7730(e,t,r){var n=r(9172),o=r(7301),a=r(6009),i=a&&a.isMap,s=i?o(i):n;e.exports=s},3805(e){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},346(e){e.exports=function(e){return null!=e&&"object"==typeof e}},8440(e,t,r){var n=r(6038),o=r(7301),a=r(6009),i=a&&a.isSet,s=i?o(i):n;e.exports=s},7167(e,t,r){var n=r(4901),o=r(7301),a=r(6009),i=a&&a.isTypedArray,s=i?o(i):n;e.exports=s},5950(e,t,r){var n=r(695),o=r(8984),a=r(4894);e.exports=function(e){return a(e)?n(e):o(e)}},7241(e,t,r){var n=r(695),o=r(2903),a=r(4894);e.exports=function(e){return a(e)?n(e,!0):o(e)}},3345(e){e.exports=function(){return[]}},9935(e){e.exports=function(){return!1}},6087(e){"use strict";e.exports=window.wp.element},6942(e,t){var r;!function(){"use strict";var n={}.hasOwnProperty;function o(){for(var e="",t=0;t{const t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.cw=e=>{var t;return()=>{if(e){var r=e;e=0,t={exports:{}},r.call(t.exports,t,t.exports)}return t.exports}},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.hasOwn(e,t),r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),r.dn=e=>{var t=Object.getOwnPropertyDescriptor(e,"name");(!t||!t.writable&&t.configurable)&&Object.defineProperty(e,"name",{value:"default",configurable:!0})},(()=>{"use strict";var e=r.cw(e=>{function t(e,t){var r,n;if("function"==typeof t)void 0!==(n=t(e))&&(e=n);else if(Array.isArray(t))for(r=0;r=0&&(e=e.replace(/\[/g,t).replace(/]/g,""));var r=e.split(t);if(r.filter(s).length!==r.length)throw Error("Refusing to update blacklisted property "+e);return r}var c=Object.prototype.hasOwnProperty;function u(e,t,r,n){if(!(this instanceof u))return new u(e,t,r,n);void 0===t&&(t=!1),void 0===r&&(r=!0),void 0===n&&(n=!0),this.separator=e||".",this.override=t,this.useArray=r,this.useBrackets=n,this.keepArray=!1,this.cleanup=[]}var p=new u(".",!1,!0,!0);function d(e){return function(){return p[e].apply(p,arguments)}}u.prototype._fill=function(e,r,n,i){var s=e.shift();if(e.length>0){if(r[s]=r[s]||(this.useArray&&function(e){return/^\d+$/.test(e)}(e[0])?[]:{}),!o(r[s])){if(!this.override){if(!o(n)||!a(n))throw new Error("Trying to redefine `"+s+"` which is a "+typeof r[s]);return}r[s]={}}this._fill(e,r[s],n,i)}else{if(!this.override&&o(r[s])&&!a(r[s])){if(!o(n)||!a(n))throw new Error("Trying to redefine non-empty obj['"+s+"']");return}r[s]=t(n,i)}},u.prototype.object=function(e,r){var n=this;return Object.keys(e).forEach(function(o){var a=void 0===r?null:r[o],i=l(o,n.separator).join(n.separator);-1!==i.indexOf(n.separator)?(n._fill(i.split(n.separator),e,e[o],a),delete e[o]):e[o]=t(e[o],a)}),e},u.prototype.str=function(e,r,n,o){var a=l(e,this.separator).join(this.separator);return-1!==e.indexOf(this.separator)?this._fill(a.split(this.separator),n,r,o):n[e]=t(r,o),n},u.prototype.pick=function(e,t,n,o){var a,i,s,c,u;for(i=l(e,this.separator),a=0;ad.createElement("svg",{width:"18px",height:"18px",viewBox:"0 0 18 18",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},d.createElement("title",null,"shape-round"),d.createElement("desc",null,"Created with Sketch."),d.createElement("g",{id:"Desktop-0.4",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},d.createElement("g",{id:"widgets/shape-round",transform:"translate(-3.000000, -3.000000)",fill:"#000000"},d.createElement("path",{d:"M12,3 C16.9705627,3 21,7.02943725 21,12 C21,16.9705627 16.9705627,21 12,21 C7.02943725,21 3,16.9705627 3,12 C3,7.02943725 7.02943725,3 12,3 Z M12,5 C8.13400675,5 5,8.13400675 5,12 C5,15.8659932 8.13400675,19 12,19 C15.8659932,19 19,15.8659932 19,12 C19,8.13400675 15.8659932,5 12,5 Z",id:"Combined-Shape"})))),m=()=>d.createElement("svg",{width:"18px",height:"18px",viewBox:"0 0 18 18",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},d.createElement("title",null,"ratio-square"),d.createElement("desc",null,"Created with Sketch."),d.createElement("g",{id:"Desktop-0.4",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},d.createElement("g",{id:"widgets/shape-square",transform:"translate(-3.000000, -3.000000)",fill:"#000000"},d.createElement("path",{d:"M3,3 L3,21 L21,21 L21,3 L3,3 Z M5,5 L5,19 L19,19 L19,5 L5,5 Z",id:"shape"})))),v=()=>d.createElement("svg",{width:"18px",height:"18px",viewBox:"0 0 18 18",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},d.createElement("title",null,"shape-radius"),d.createElement("desc",null,"Created with Sketch."),d.createElement("g",{id:"Desktop-0.4",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},d.createElement("g",{id:"widgets/shape-radius",transform:"translate(-3.000000, -3.000000)",fill:"#000000"},d.createElement("path",{d:"M17,3 C19.209139,3 21,4.790861 21,7 L21,17 C21,19.209139 19.209139,21 17,21 L7,21 C4.790861,21 3,19.209139 3,17 L3,7 C3,4.790861 4.790861,3 7,3 L17,3 Z M17,5 L7,5 C5.9456382,5 5.08183488,5.81587779 5.00548574,6.85073766 L5,7 L5,17 C5,18.0543618 5.81587779,18.9181651 6.85073766,18.9945143 L7,19 L17,19 C18.0543618,19 18.9181651,18.1841222 18.9945143,17.1492623 L19,17 L19,7 C19,5.9456382 18.1841222,5.08183488 17.1492623,5.00548574 L17,5 Z",id:"Rectangle"})))),h=()=>d.createElement("svg",{width:"18px",height:"18px",viewBox:"0 0 18 18",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},d.createElement("title",null,"shape-none"),d.createElement("desc",null,"Created with Sketch."),d.createElement("g",{id:"Desktop-0.4",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},d.createElement("g",{id:"widgets/shape-none",transform:"translate(-3.000000, -3.000000)",fill:"#000000"},d.createElement("path",{d:"M5,19 L5,21 L3,21 L3,19 L5,19 Z M21,19 L21,21 L19,21 L19,19 L21,19 Z M13,19 L13,21 L11,21 L11,19 L13,19 Z M9,19 L9,21 L7,21 L7,19 L9,19 Z M17,19 L17,21 L15,21 L15,19 L17,19 Z M21,15 L21,17 L19,17 L19,15 L21,15 Z M21,11 L21,13 L19,13 L19,11 L21,11 Z M5,11 L5,13 L3,13 L3,11 L5,11 Z M21,7 L21,9 L19,9 L19,7 L21,7 Z M5,7 L5,9 L3,9 L3,7 L5,7 Z M13,3 L13,5 L11,5 L11,3 L13,3 Z M9,3 L9,5 L7,5 L7,3 L9,3 Z M17,3 L17,5 L15,5 L15,3 L17,3 Z M21,3 L21,5 L19,5 L19,3 L21,3 Z M5,3 L5,5 L3,5 L3,3 L5,3 Z M3,15 L5,15 L5,17 L3,17 L3,15 Z",id:"Shape"})))),y=[{value:{type:"expanded",columns:1},icon:()=>d.createElement("svg",{width:"17px",height:"20px",viewBox:"0 0 17 20",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},d.createElement("title",null,"layout-modern"),d.createElement("desc",null,"Created with Sketch."),d.createElement("g",{id:"Desktop-0.4",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},d.createElement("g",{id:"widgets/layout-modern",transform:"translate(-2.000000, -3.000000)",fill:"#000000"},d.createElement("path",{d:"M2,10 L5,10 L5,7 L2,7 L2,10 Z M2,14 L5,14 L5,11 L2,11 L2,14 Z M2,6 L5,6 L5,3 L2,3 L2,6 Z M6,3 L6,17 L19,17 L19,3 L6,3 Z M8,5 L8,15 L17,15 L17,5 L8,5 Z M6,18 L6,23 L19,23 L19,18 L6,18 Z M8,20 L8,23 L17,23 L17,20 L8,20 Z",id:"shape"})))),label:(0,t.__)("Expanded - 1 Column","cloudinary")},{value:{type:"expanded",columns:2},icon:()=>d.createElement("svg",{width:"18px",height:"17px",viewBox:"0 0 18 17",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},d.createElement("title",null,"layout-grid-2-column"),d.createElement("desc",null,"Created with Sketch."),d.createElement("g",{id:"Desktop-0.4",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},d.createElement("g",{id:"widgets/layout-gird-2-col",transform:"translate(-3.000000, -3.000000)",fill:"#000000"},d.createElement("path",{d:"M11,12 L11,20 L3,20 L3,12 L11,12 Z M21,12 L21,20 L13,20 L13,12 L21,12 Z M9,14 L5,14 L5,18 L9,18 L9,14 Z M19,14 L15,14 L15,18 L19,18 L19,14 Z M11,3 L11,11 L3,11 L3,3 L11,3 Z M21,3 L21,11 L13,11 L13,3 L21,3 Z M9,5 L5,5 L5,9 L9,9 L9,5 Z M19,5 L15,5 L15,9 L19,9 L19,5 Z",id:"Shape"})))),label:(0,t.__)("Expanded - 2 Column","cloudinary")},{value:{type:"expanded",columns:3},icon:()=>d.createElement("svg",{width:"20px",height:"13px",viewBox:"0 0 20 13",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},d.createElement("title",null,"layout-grid-3-column"),d.createElement("desc",null,"Created with Sketch."),d.createElement("g",{id:"Desktop-0.4",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},d.createElement("g",{id:"widgets/layout-gird-3-col",transform:"translate(-2.000000, -5.000000)",fill:"#000000"},d.createElement("path",{d:"M8,12 L8,18 L2,18 L2,12 L8,12 Z M15,12 L15,18 L9,18 L9,12 L15,12 Z M22,12 L22,18 L16,18 L16,12 L22,12 Z M6,14 L4,14 L4,16 L6,16 L6,14 Z M13,14 L11,14 L11,16 L13,16 L13,14 Z M20,14 L18,14 L18,16 L20,16 L20,14 Z M8,5 L8,11 L2,11 L2,5 L8,5 Z M15,5 L15,11 L9,11 L9,5 L15,5 Z M22,5 L22,11 L16,11 L16,5 L22,5 Z M6,7 L4,7 L4,9 L6,9 L6,7 Z M13,7 L11,7 L11,9 L13,9 L13,7 Z M20,7 L18,7 L18,9 L20,9 L20,7 Z",id:"Combined-Shape"})))),label:(0,t.__)("Expanded - 3 Column","cloudinary")},{value:{type:"classic",columns:1},icon:()=>d.createElement("svg",{width:"17px",height:"14px",viewBox:"0 0 17 14",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},d.createElement("title",null,"layout-classic"),d.createElement("desc",null,"Created with Sketch."),d.createElement("g",{id:"Desktop-0.4",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},d.createElement("g",{id:"widgets/layout-classic",transform:"translate(-3.000000, -5.000000)",fill:"#000000"},d.createElement("path",{d:"M3,12 L6,12 L6,9 L3,9 L3,12 Z M3,16 L6,16 L6,13 L3,13 L3,16 Z M3,8 L6,8 L6,5 L3,5 L3,8 Z M7,5 L7,19 L20,19 L20,5 L7,5 Z M9,7 L9,17 L18,17 L18,7 L9,7 Z",id:"shape"})))),label:(0,t.__)("Classic","cloudinary")}],g=["image"],b=[{label:(0,t.__)("1:1","cloudinary"),value:"1:1"},{label:(0,t.__)("3:4","cloudinary"),value:"3:4"},{label:(0,t.__)("4:3","cloudinary"),value:"4:3"},{label:(0,t.__)("4:6","cloudinary"),value:"4:6"},{label:(0,t.__)("6:4","cloudinary"),value:"6:4"},{label:(0,t.__)("5:7","cloudinary"),value:"5:7"},{label:(0,t.__)("7:5","cloudinary"),value:"7:5"},{label:(0,t.__)("8:5","cloudinary"),value:"8:5"},{label:(0,t.__)("5:8","cloudinary"),value:"5:8"},{label:(0,t.__)("9:16","cloudinary"),value:"9:16"},{label:(0,t.__)("16:9","cloudinary"),value:"16:9"}],_=[{label:(0,t.__)("None","cloudinary"),value:"none"},{label:(0,t.__)("Fade","cloudinary"),value:"fade"},{label:(0,t.__)("Slide","cloudinary"),value:"slide"}],x=[{label:(0,t.__)("Always","cloudinary"),value:"always"},{label:(0,t.__)("None","cloudinary"),value:"none"},{label:(0,t.__)("MouseOver","cloudinary"),value:"mouseover"}],w=[{label:(0,t.__)("Inline","cloudinary"),value:"inline"},{label:(0,t.__)("Flyout","cloudinary"),value:"flyout"},{label:(0,t.__)("Popup","cloudinary"),value:"popup"}],L=[{label:(0,t.__)("Top","cloudinary"),value:"top"},{label:(0,t.__)("Bottom","cloudinary"),value:"bottom"},{label:(0,t.__)("Left","cloudinary"),value:"left"},{label:(0,t.__)("Right","cloudinary"),value:"right"}],E=[{label:(0,t.__)("Click","cloudinary"),value:"click"},{label:(0,t.__)("Hover","cloudinary"),value:"hover"}],O=[{label:(0,t.__)("Left","cloudinary"),value:"left"},{label:(0,t.__)("Right","cloudinary"),value:"right"},{label:(0,t.__)("Top","cloudinary"),value:"top"},{label:(0,t.__)("Bottom","cloudinary"),value:"bottom"}],j=[{label:(0,t.__)("Thumbnails","cloudinary"),value:"thumbnails"},{label:(0,t.__)("Indicators","cloudinary"),value:"indicators"},{label:(0,t.__)("None","cloudinary"),value:"none"}],A=[{value:"round",icon:f,label:(0,t.__)("Round","cloudinary")},{value:"radius",icon:v,label:(0,t.__)("Radius","cloudinary")},{value:"none",icon:h,label:(0,t.__)("None","cloudinary")},{value:"square",icon:m,label:(0,t.__)("Square","cloudinary")},{value:"rectangle",icon:()=>d.createElement("svg",{width:"14px",height:"20px",viewBox:"0 0 14 20",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},d.createElement("title",null,"ratio-9-16"),d.createElement("desc",null,"Created with Sketch."),d.createElement("g",{id:"Desktop-0.4",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},d.createElement("g",{id:"ratio/9-16",transform:"translate(-5.000000, -2.000000)",fill:"#000000"},d.createElement("path",{d:"M22,5.5 L22,18.5 L2,18.5 L2,5.5 L22,5.5 Z M20,7.5 L4,7.5 L4,16.5 L20,16.5 L20,7.5 Z",id:"Combined-Shape",transform:"translate(12.000000, 12.000000) rotate(-90.000000) translate(-12.000000, -12.000000) "})))),label:(0,t.__)("Rectangle","cloudinary")}],k=[{value:"round",icon:f,label:(0,t.__)("Round","cloudinary")},{value:"radius",icon:v,label:(0,t.__)("Radius","cloudinary")},{value:"square",icon:m,label:(0,t.__)("Square","cloudinary")}],P=[{label:(0,t.__)("All","cloudinary"),value:"all"},{label:(0,t.__)("Border","cloudinary"),value:"border"},{label:(0,t.__)("Gradient","cloudinary"),value:"gradient"}],S=[{label:(0,t.__)("All","cloudinary"),value:"all"},{label:(0,t.__)("Top","cloudinary"),value:"top"},{label:(0,t.__)("Top-Bottom","cloudinary"),value:"top-bottom"},{label:(0,t.__)("Left-Right","cloudinary"),value:"left-right"},{label:(0,t.__)("Bottom","cloudinary"),value:"bottom"},{label:(0,t.__)("Left","cloudinary"),value:"left"},{label:(0,t.__)("Right","cloudinary"),value:"right"}],C=[{value:"round",icon:f,label:(0,t.__)("Round","cloudinary")},{value:"radius",icon:v,label:(0,t.__)("Radius","cloudinary")},{value:"none",icon:h,label:(0,t.__)("None","cloudinary")},{value:"square",icon:m,label:(0,t.__)("Square","cloudinary")}],M=[{label:(0,t.__)("Pad","cloudinary"),value:"pad"},{label:(0,t.__)("Fill","cloudinary"),value:"fill"}],B=[{label:(0,t.__)("White padding","cloudinary"),value:"rgb:FFFFFF"},{label:(0,t.__)("Border color padding","cloudinary"),value:"auto"},{label:(0,t.__)("Predominant color padding","cloudinary"),value:"auto:predominant"},{label:(0,t.__)("Gradient fade padding","cloudinary"),value:"auto:predominant_gradient"}];var T=r(6942),D=r.n(T),N=r(6087);const R=({value:e,children:t,icon:r,onChange:n,current:o})=>{const a="object"==typeof e?JSON.stringify(e)===JSON.stringify(o):o===e;return N.createElement("button",{type:"button",onClick:()=>n(e),className:D()("radio-select",{"radio-select--active":a})},N.createElement(r,null),N.createElement("div",{className:"radio-select__label"},t))};r.dn(R);const Z=window.wp.data,z=e=>e<10?"0"+String(e):e.toString(16),I=e=>{const t=new Uint8Array((e||40)/2);return window.crypto.getRandomValues(t),Array.from(t,z).join("")},F=e=>{const t=/var\((.*)\)/g.exec(e);return t?getComputedStyle(document.documentElement).getPropertyValue(t[1]):e};function W(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function H(e){return e instanceof W(e).Element||e instanceof Element}function V(e){return e instanceof W(e).HTMLElement||e instanceof HTMLElement}function U(e){return"undefined"!=typeof ShadowRoot&&(e instanceof W(e).ShadowRoot||e instanceof ShadowRoot)}var q=Math.max,$=Math.min,G=Math.round;function X(){var e=navigator.userAgentData;return null!=e&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function J(){return!/^((?!chrome|android).)*safari/i.test(X())}function Y(e,t,r){void 0===t&&(t=!1),void 0===r&&(r=!1);var n=e.getBoundingClientRect(),o=1,a=1;t&&V(e)&&(o=e.offsetWidth>0&&G(n.width)/e.offsetWidth||1,a=e.offsetHeight>0&&G(n.height)/e.offsetHeight||1);var i=(H(e)?W(e):window).visualViewport,s=!J()&&r,l=(n.left+(s&&i?i.offsetLeft:0))/o,c=(n.top+(s&&i?i.offsetTop:0))/a,u=n.width/o,p=n.height/a;return{width:u,height:p,top:c,right:l+u,bottom:c+p,left:l,x:l,y:c}}function K(e){var t=W(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function Q(e){return e?(e.nodeName||"").toLowerCase():null}function ee(e){return((H(e)?e.ownerDocument:e.document)||window.document).documentElement}function te(e){return Y(ee(e)).left+K(e).scrollLeft}function re(e){return W(e).getComputedStyle(e)}function ne(e){var t=re(e),r=t.overflow,n=t.overflowX,o=t.overflowY;return/auto|scroll|overlay|hidden/.test(r+o+n)}function oe(e,t,r){void 0===r&&(r=!1);var n,o,a=V(t),i=V(t)&&function(e){var t=e.getBoundingClientRect(),r=G(t.width)/e.offsetWidth||1,n=G(t.height)/e.offsetHeight||1;return 1!==r||1!==n}(t),s=ee(t),l=Y(e,i,r),c={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(a||!a&&!r)&&(("body"!==Q(t)||ne(s))&&(c=(n=t)!==W(n)&&V(n)?{scrollLeft:(o=n).scrollLeft,scrollTop:o.scrollTop}:K(n)),V(t)?((u=Y(t,!0)).x+=t.clientLeft,u.y+=t.clientTop):s&&(u.x=te(s))),{x:l.left+c.scrollLeft-u.x,y:l.top+c.scrollTop-u.y,width:l.width,height:l.height}}function ae(e){var t=Y(e),r=e.offsetWidth,n=e.offsetHeight;return Math.abs(t.width-r)<=1&&(r=t.width),Math.abs(t.height-n)<=1&&(n=t.height),{x:e.offsetLeft,y:e.offsetTop,width:r,height:n}}function ie(e){return"html"===Q(e)?e:e.assignedSlot||e.parentNode||(U(e)?e.host:null)||ee(e)}function se(e){return["html","body","#document"].indexOf(Q(e))>=0?e.ownerDocument.body:V(e)&&ne(e)?e:se(ie(e))}function le(e,t){var r;void 0===t&&(t=[]);var n=se(e),o=n===(null==(r=e.ownerDocument)?void 0:r.body),a=W(n),i=o?[a].concat(a.visualViewport||[],ne(n)?n:[]):n,s=t.concat(i);return o?s:s.concat(le(ie(i)))}function ce(e){return["table","td","th"].indexOf(Q(e))>=0}function ue(e){return V(e)&&"fixed"!==re(e).position?e.offsetParent:null}function pe(e){for(var t=W(e),r=ue(e);r&&ce(r)&&"static"===re(r).position;)r=ue(r);return r&&("html"===Q(r)||"body"===Q(r)&&"static"===re(r).position)?t:r||function(e){var t=/firefox/i.test(X());if(/Trident/i.test(X())&&V(e)&&"fixed"===re(e).position)return null;var r=ie(e);for(U(r)&&(r=r.host);V(r)&&["html","body"].indexOf(Q(r))<0;){var n=re(r);if("none"!==n.transform||"none"!==n.perspective||"paint"===n.contain||-1!==["transform","perspective"].indexOf(n.willChange)||t&&"filter"===n.willChange||t&&n.filter&&"none"!==n.filter)return r;r=r.parentNode}return null}(e)||t}var de="top",fe="bottom",me="right",ve="left",he="auto",ye=[de,fe,me,ve],ge="start",be="end",_e="viewport",xe="popper",we=ye.reduce(function(e,t){return e.concat([t+"-"+ge,t+"-"+be])},[]),Le=[].concat(ye,[he]).reduce(function(e,t){return e.concat([t,t+"-"+ge,t+"-"+be])},[]),Ee=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function Oe(e){var t=new Map,r=new Set,n=[];function o(e){r.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach(function(e){if(!r.has(e)){var n=t.get(e);n&&o(n)}}),n.push(e)}return e.forEach(function(e){t.set(e.name,e)}),e.forEach(function(e){r.has(e.name)||o(e)}),n}var je={placement:"bottom",modifiers:[],strategy:"absolute"};function Ae(){for(var e=arguments.length,t=new Array(e),r=0;r=0?"x":"y"}function Be(e){var t,r=e.reference,n=e.element,o=e.placement,a=o?Se(o):null,i=o?Ce(o):null,s=r.x+r.width/2-n.width/2,l=r.y+r.height/2-n.height/2;switch(a){case de:t={x:s,y:r.y-n.height};break;case fe:t={x:s,y:r.y+r.height};break;case me:t={x:r.x+r.width,y:l};break;case ve:t={x:r.x-n.width,y:l};break;default:t={x:r.x,y:r.y}}var c=a?Me(a):null;if(null!=c){var u="y"===c?"height":"width";switch(i){case ge:t[c]=t[c]-(r[u]/2-n[u]/2);break;case be:t[c]=t[c]+(r[u]/2-n[u]/2)}}return t}var Te={top:"auto",right:"auto",bottom:"auto",left:"auto"};function De(e){var t,r=e.popper,n=e.popperRect,o=e.placement,a=e.variation,i=e.offsets,s=e.position,l=e.gpuAcceleration,c=e.adaptive,u=e.roundOffsets,p=e.isFixed,d=i.x,f=void 0===d?0:d,m=i.y,v=void 0===m?0:m,h="function"==typeof u?u({x:f,y:v}):{x:f,y:v};f=h.x,v=h.y;var y=i.hasOwnProperty("x"),g=i.hasOwnProperty("y"),b=ve,_=de,x=window;if(c){var w=pe(r),L="clientHeight",E="clientWidth";if(w===W(r)&&"static"!==re(w=ee(r)).position&&"absolute"===s&&(L="scrollHeight",E="scrollWidth"),o===de||(o===ve||o===me)&&a===be)_=fe,v-=(p&&w===x&&x.visualViewport?x.visualViewport.height:w[L])-n.height,v*=l?1:-1;if(o===ve||(o===de||o===fe)&&a===be)b=me,f-=(p&&w===x&&x.visualViewport?x.visualViewport.width:w[E])-n.width,f*=l?1:-1}var O,j=Object.assign({position:s},c&&Te),A=!0===u?function(e,t){var r=e.x,n=e.y,o=t.devicePixelRatio||1;return{x:G(r*o)/o||0,y:G(n*o)/o||0}}({x:f,y:v},W(r)):{x:f,y:v};return f=A.x,v=A.y,l?Object.assign({},j,((O={})[_]=g?"0":"",O[b]=y?"0":"",O.transform=(x.devicePixelRatio||1)<=1?"translate("+f+"px, "+v+"px)":"translate3d("+f+"px, "+v+"px, 0)",O)):Object.assign({},j,((t={})[_]=g?v+"px":"",t[b]=y?f+"px":"",t.transform="",t))}const Ne={name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach(function(e){var r=t.styles[e]||{},n=t.attributes[e]||{},o=t.elements[e];V(o)&&Q(o)&&(Object.assign(o.style,r),Object.keys(n).forEach(function(e){var t=n[e];!1===t?o.removeAttribute(e):o.setAttribute(e,!0===t?"":t)}))})},effect:function(e){var t=e.state,r={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,r.popper),t.styles=r,t.elements.arrow&&Object.assign(t.elements.arrow.style,r.arrow),function(){Object.keys(t.elements).forEach(function(e){var n=t.elements[e],o=t.attributes[e]||{},a=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:r[e]).reduce(function(e,t){return e[t]="",e},{});V(n)&&Q(n)&&(Object.assign(n.style,a),Object.keys(o).forEach(function(e){n.removeAttribute(e)}))})}},requires:["computeStyles"]};const Re={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,r=e.options,n=e.name,o=r.offset,a=void 0===o?[0,0]:o,i=Le.reduce(function(e,r){return e[r]=function(e,t,r){var n=Se(e),o=[ve,de].indexOf(n)>=0?-1:1,a="function"==typeof r?r(Object.assign({},t,{placement:e})):r,i=a[0],s=a[1];return i=i||0,s=(s||0)*o,[ve,me].indexOf(n)>=0?{x:s,y:i}:{x:i,y:s}}(r,t.rects,a),e},{}),s=i[t.placement],l=s.x,c=s.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=c),t.modifiersData[n]=i}};var Ze={left:"right",right:"left",bottom:"top",top:"bottom"};function ze(e){return e.replace(/left|right|bottom|top/g,function(e){return Ze[e]})}var Ie={start:"end",end:"start"};function Fe(e){return e.replace(/start|end/g,function(e){return Ie[e]})}function We(e,t){var r=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(r&&U(r)){var n=t;do{if(n&&e.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function He(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function Ve(e,t,r){return t===_e?He(function(e,t){var r=W(e),n=ee(e),o=r.visualViewport,a=n.clientWidth,i=n.clientHeight,s=0,l=0;if(o){a=o.width,i=o.height;var c=J();(c||!c&&"fixed"===t)&&(s=o.offsetLeft,l=o.offsetTop)}return{width:a,height:i,x:s+te(e),y:l}}(e,r)):H(t)?function(e,t){var r=Y(e,!1,"fixed"===t);return r.top=r.top+e.clientTop,r.left=r.left+e.clientLeft,r.bottom=r.top+e.clientHeight,r.right=r.left+e.clientWidth,r.width=e.clientWidth,r.height=e.clientHeight,r.x=r.left,r.y=r.top,r}(t,r):He(function(e){var t,r=ee(e),n=K(e),o=null==(t=e.ownerDocument)?void 0:t.body,a=q(r.scrollWidth,r.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),i=q(r.scrollHeight,r.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),s=-n.scrollLeft+te(e),l=-n.scrollTop;return"rtl"===re(o||r).direction&&(s+=q(r.clientWidth,o?o.clientWidth:0)-a),{width:a,height:i,x:s,y:l}}(ee(e)))}function Ue(e,t,r,n){var o="clippingParents"===t?function(e){var t=le(ie(e)),r=["absolute","fixed"].indexOf(re(e).position)>=0&&V(e)?pe(e):e;return H(r)?t.filter(function(e){return H(e)&&We(e,r)&&"body"!==Q(e)}):[]}(e):[].concat(t),a=[].concat(o,[r]),i=a[0],s=a.reduce(function(t,r){var o=Ve(e,r,n);return t.top=q(o.top,t.top),t.right=$(o.right,t.right),t.bottom=$(o.bottom,t.bottom),t.left=q(o.left,t.left),t},Ve(e,i,n));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function qe(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function $e(e,t){return t.reduce(function(t,r){return t[r]=e,t},{})}function Ge(e,t){void 0===t&&(t={});var r=t,n=r.placement,o=void 0===n?e.placement:n,a=r.strategy,i=void 0===a?e.strategy:a,s=r.boundary,l=void 0===s?"clippingParents":s,c=r.rootBoundary,u=void 0===c?_e:c,p=r.elementContext,d=void 0===p?xe:p,f=r.altBoundary,m=void 0!==f&&f,v=r.padding,h=void 0===v?0:v,y=qe("number"!=typeof h?h:$e(h,ye)),g=d===xe?"reference":xe,b=e.rects.popper,_=e.elements[m?g:d],x=Ue(H(_)?_:_.contextElement||ee(e.elements.popper),l,u,i),w=Y(e.elements.reference),L=Be({reference:w,element:b,strategy:"absolute",placement:o}),E=He(Object.assign({},b,L)),O=d===xe?E:w,j={top:x.top-O.top+y.top,bottom:O.bottom-x.bottom+y.bottom,left:x.left-O.left+y.left,right:O.right-x.right+y.right},A=e.modifiersData.offset;if(d===xe&&A){var k=A[o];Object.keys(j).forEach(function(e){var t=[me,fe].indexOf(e)>=0?1:-1,r=[de,fe].indexOf(e)>=0?"y":"x";j[e]+=k[r]*t})}return j}function Xe(e,t,r){return q(e,$(t,r))}const Je={name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,r=e.options,n=e.name,o=r.mainAxis,a=void 0===o||o,i=r.altAxis,s=void 0!==i&&i,l=r.boundary,c=r.rootBoundary,u=r.altBoundary,p=r.padding,d=r.tether,f=void 0===d||d,m=r.tetherOffset,v=void 0===m?0:m,h=Ge(t,{boundary:l,rootBoundary:c,padding:p,altBoundary:u}),y=Se(t.placement),g=Ce(t.placement),b=!g,_=Me(y),x="x"===_?"y":"x",w=t.modifiersData.popperOffsets,L=t.rects.reference,E=t.rects.popper,O="function"==typeof v?v(Object.assign({},t.rects,{placement:t.placement})):v,j="number"==typeof O?{mainAxis:O,altAxis:O}:Object.assign({mainAxis:0,altAxis:0},O),A=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,k={x:0,y:0};if(w){if(a){var P,S="y"===_?de:ve,C="y"===_?fe:me,M="y"===_?"height":"width",B=w[_],T=B+h[S],D=B-h[C],N=f?-E[M]/2:0,R=g===ge?L[M]:E[M],Z=g===ge?-E[M]:-L[M],z=t.elements.arrow,I=f&&z?ae(z):{width:0,height:0},F=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},W=F[S],H=F[C],V=Xe(0,L[M],I[M]),U=b?L[M]/2-N-V-W-j.mainAxis:R-V-W-j.mainAxis,G=b?-L[M]/2+N+V+H+j.mainAxis:Z+V+H+j.mainAxis,X=t.elements.arrow&&pe(t.elements.arrow),J=X?"y"===_?X.clientTop||0:X.clientLeft||0:0,Y=null!=(P=null==A?void 0:A[_])?P:0,K=B+G-Y,Q=Xe(f?$(T,B+U-Y-J):T,B,f?q(D,K):D);w[_]=Q,k[_]=Q-B}if(s){var ee,te="x"===_?de:ve,re="x"===_?fe:me,ne=w[x],oe="y"===x?"height":"width",ie=ne+h[te],se=ne-h[re],le=-1!==[de,ve].indexOf(y),ce=null!=(ee=null==A?void 0:A[x])?ee:0,ue=le?ie:ne-L[oe]-E[oe]-ce+j.altAxis,he=le?ne+L[oe]+E[oe]-ce-j.altAxis:se,ye=f&&le?function(e,t,r){var n=Xe(e,t,r);return n>r?r:n}(ue,ne,he):Xe(f?ue:ie,ne,f?he:se);w[x]=ye,k[x]=ye-ne}t.modifiersData[n]=k}},requiresIfExists:["offset"]};const Ye={name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,r=e.state,n=e.name,o=e.options,a=r.elements.arrow,i=r.modifiersData.popperOffsets,s=Se(r.placement),l=Me(s),c=[ve,me].indexOf(s)>=0?"height":"width";if(a&&i){var u=function(e,t){return qe("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:$e(e,ye))}(o.padding,r),p=ae(a),d="y"===l?de:ve,f="y"===l?fe:me,m=r.rects.reference[c]+r.rects.reference[l]-i[l]-r.rects.popper[c],v=i[l]-r.rects.reference[l],h=pe(a),y=h?"y"===l?h.clientHeight||0:h.clientWidth||0:0,g=m/2-v/2,b=u[d],_=y-p[c]-u[f],x=y/2-p[c]/2+g,w=Xe(b,x,_),L=l;r.modifiersData[n]=((t={})[L]=w,t.centerOffset=w-x,t)}},effect:function(e){var t=e.state,r=e.options.element,n=void 0===r?"[data-popper-arrow]":r;null!=n&&("string"!=typeof n||(n=t.elements.popper.querySelector(n)))&&We(t.elements.popper,n)&&(t.elements.arrow=n)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Ke(e,t,r){return void 0===r&&(r={x:0,y:0}),{top:e.top-t.height-r.y,right:e.right-t.width+r.x,bottom:e.bottom-t.height+r.y,left:e.left-t.width-r.x}}function Qe(e){return[de,me,fe,ve].some(function(t){return e[t]>=0})}var et=ke({defaultModifiers:[{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var t=e.state,r=e.instance,n=e.options,o=n.scroll,a=void 0===o||o,i=n.resize,s=void 0===i||i,l=W(t.elements.popper),c=[].concat(t.scrollParents.reference,t.scrollParents.popper);return a&&c.forEach(function(e){e.addEventListener("scroll",r.update,Pe)}),s&&l.addEventListener("resize",r.update,Pe),function(){a&&c.forEach(function(e){e.removeEventListener("scroll",r.update,Pe)}),s&&l.removeEventListener("resize",r.update,Pe)}},data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,r=e.name;t.modifiersData[r]=Be({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}},{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,r=e.options,n=r.gpuAcceleration,o=void 0===n||n,a=r.adaptive,i=void 0===a||a,s=r.roundOffsets,l=void 0===s||s,c={placement:Se(t.placement),variation:Ce(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:o,isFixed:"fixed"===t.options.strategy};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,De(Object.assign({},c,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:i,roundOffsets:l})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,De(Object.assign({},c,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}},Ne,Re,{name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,r=e.options,n=e.name;if(!t.modifiersData[n]._skip){for(var o=r.mainAxis,a=void 0===o||o,i=r.altAxis,s=void 0===i||i,l=r.fallbackPlacements,c=r.padding,u=r.boundary,p=r.rootBoundary,d=r.altBoundary,f=r.flipVariations,m=void 0===f||f,v=r.allowedAutoPlacements,h=t.options.placement,y=Se(h),g=l||(y===h||!m?[ze(h)]:function(e){if(Se(e)===he)return[];var t=ze(e);return[Fe(e),t,Fe(t)]}(h)),b=[h].concat(g).reduce(function(e,r){return e.concat(Se(r)===he?function(e,t){void 0===t&&(t={});var r=t,n=r.placement,o=r.boundary,a=r.rootBoundary,i=r.padding,s=r.flipVariations,l=r.allowedAutoPlacements,c=void 0===l?Le:l,u=Ce(n),p=u?s?we:we.filter(function(e){return Ce(e)===u}):ye,d=p.filter(function(e){return c.indexOf(e)>=0});0===d.length&&(d=p);var f=d.reduce(function(t,r){return t[r]=Ge(e,{placement:r,boundary:o,rootBoundary:a,padding:i})[Se(r)],t},{});return Object.keys(f).sort(function(e,t){return f[e]-f[t]})}(t,{placement:r,boundary:u,rootBoundary:p,padding:c,flipVariations:m,allowedAutoPlacements:v}):r)},[]),_=t.rects.reference,x=t.rects.popper,w=new Map,L=!0,E=b[0],O=0;O=0,S=P?"width":"height",C=Ge(t,{placement:j,boundary:u,rootBoundary:p,altBoundary:d,padding:c}),M=P?k?me:ve:k?fe:de;_[S]>x[S]&&(M=ze(M));var B=ze(M),T=[];if(a&&T.push(C[A]<=0),s&&T.push(C[M]<=0,C[B]<=0),T.every(function(e){return e})){E=j,L=!1;break}w.set(j,T)}if(L)for(var D=function(e){var t=b.find(function(t){var r=w.get(t);if(r)return r.slice(0,e).every(function(e){return e})});if(t)return E=t,"break"},N=m?3:1;N>0;N--){if("break"===D(N))break}t.placement!==E&&(t.modifiersData[n]._skip=!0,t.placement=E,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}},Je,Ye,{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,r=e.name,n=t.rects.reference,o=t.rects.popper,a=t.modifiersData.preventOverflow,i=Ge(t,{elementContext:"reference"}),s=Ge(t,{altBoundary:!0}),l=Ke(i,n),c=Ke(s,o,a),u=Qe(l),p=Qe(c);t.modifiersData[r]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:u,hasPopperEscaped:p},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":p})}}]}),tt="tippy-content",rt="tippy-backdrop",nt="tippy-arrow",ot="tippy-svg-arrow",at={passive:!0,capture:!0},it=function(){return document.body};function st(e,t,r){if(Array.isArray(e)){var n=e[t];return n??(Array.isArray(r)?r[t]:r)}return e}function lt(e,t){var r={}.toString.call(e);return 0===r.indexOf("[object")&&r.indexOf(t+"]")>-1}function ct(e,t){return"function"==typeof e?e.apply(void 0,t):e}function ut(e,t){return 0===t?e:function(n){clearTimeout(r),r=setTimeout(function(){e(n)},t)};var r}function pt(e){return[].concat(e)}function dt(e,t){-1===e.indexOf(t)&&e.push(t)}function ft(e){return e.split("-")[0]}function mt(e){return[].slice.call(e)}function vt(e){return Object.keys(e).reduce(function(t,r){return void 0!==e[r]&&(t[r]=e[r]),t},{})}function ht(){return document.createElement("div")}function yt(e){return["Element","Fragment"].some(function(t){return lt(e,t)})}function gt(e){return lt(e,"MouseEvent")}function bt(e){return!(!e||!e._tippy||e._tippy.reference!==e)}function _t(e){return yt(e)?[e]:function(e){return lt(e,"NodeList")}(e)?mt(e):Array.isArray(e)?e:mt(document.querySelectorAll(e))}function xt(e,t){e.forEach(function(e){e&&(e.style.transitionDuration=t+"ms")})}function wt(e,t){e.forEach(function(e){e&&e.setAttribute("data-state",t)})}function Lt(e){var t,r=pt(e)[0];return null!=r&&null!=(t=r.ownerDocument)&&t.body?r.ownerDocument:document}function Et(e,t,r){var n=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(t){e[n](t,r)})}function Ot(e,t){for(var r=t;r;){var n;if(e.contains(r))return!0;r=null==r.getRootNode||null==(n=r.getRootNode())?void 0:n.host}return!1}var jt={isTouch:!1},At=0;function kt(){jt.isTouch||(jt.isTouch=!0,window.performance&&document.addEventListener("mousemove",Pt))}function Pt(){var e=performance.now();e-At<20&&(jt.isTouch=!1,document.removeEventListener("mousemove",Pt)),At=e}function St(){var e=document.activeElement;if(bt(e)){var t=e._tippy;e.blur&&!t.state.isVisible&&e.blur()}}var Ct=!!("undefined"!=typeof window&&"undefined"!=typeof document)&&!!window.msCrypto;var Mt={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},Bt=Object.assign({appendTo:it,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},Mt,{allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999}),Tt=Object.keys(Bt);function Dt(e){var t=(e.plugins||[]).reduce(function(t,r){var n,o=r.name,a=r.defaultValue;o&&(t[o]=void 0!==e[o]?e[o]:null!=(n=Bt[o])?n:a);return t},{});return Object.assign({},e,t)}function Nt(e,t){var r=Object.assign({},t,{content:ct(t.content,[e])},t.ignoreAttributes?{}:function(e,t){return(t?Object.keys(Dt(Object.assign({},Bt,{plugins:t}))):Tt).reduce(function(t,r){var n=(e.getAttribute("data-tippy-"+r)||"").trim();if(!n)return t;if("content"===r)t[r]=n;else try{t[r]=JSON.parse(n)}catch(e){t[r]=n}return t},{})}(e,t.plugins));return r.aria=Object.assign({},Bt.aria,r.aria),r.aria={expanded:"auto"===r.aria.expanded?t.interactive:r.aria.expanded,content:"auto"===r.aria.content?t.interactive?null:"describedby":r.aria.content},r}function Rt(e,t){e.innerHTML=t}function Zt(e){var t=ht();return!0===e?t.className=nt:(t.className=ot,yt(e)?t.appendChild(e):Rt(t,e)),t}function zt(e,t){yt(t.content)?(Rt(e,""),e.appendChild(t.content)):"function"!=typeof t.content&&(t.allowHTML?Rt(e,t.content):e.textContent=t.content)}function It(e){var t=e.firstElementChild,r=mt(t.children);return{box:t,content:r.find(function(e){return e.classList.contains(tt)}),arrow:r.find(function(e){return e.classList.contains(nt)||e.classList.contains(ot)}),backdrop:r.find(function(e){return e.classList.contains(rt)})}}function Ft(e){var t=ht(),r=ht();r.className="tippy-box",r.setAttribute("data-state","hidden"),r.setAttribute("tabindex","-1");var n=ht();function o(r,n){var o=It(t),a=o.box,i=o.content,s=o.arrow;n.theme?a.setAttribute("data-theme",n.theme):a.removeAttribute("data-theme"),"string"==typeof n.animation?a.setAttribute("data-animation",n.animation):a.removeAttribute("data-animation"),n.inertia?a.setAttribute("data-inertia",""):a.removeAttribute("data-inertia"),a.style.maxWidth="number"==typeof n.maxWidth?n.maxWidth+"px":n.maxWidth,n.role?a.setAttribute("role",n.role):a.removeAttribute("role"),r.content===n.content&&r.allowHTML===n.allowHTML||zt(i,e.props),n.arrow?s?r.arrow!==n.arrow&&(a.removeChild(s),a.appendChild(Zt(n.arrow))):a.appendChild(Zt(n.arrow)):s&&a.removeChild(s)}return n.className=tt,n.setAttribute("data-state","hidden"),zt(n,e.props),t.appendChild(r),r.appendChild(n),o(e.props,e.props),{popper:t,onUpdate:o}}Ft.$$tippy=!0;var Wt=1,Ht=[],Vt=[];function Ut(e,t){var r,n,o,a,i,s,l,c,u=Nt(e,Object.assign({},Bt,Dt(vt(t)))),p=!1,d=!1,f=!1,m=!1,v=[],h=ut($,u.interactiveDebounce),y=Wt++,g=(c=u.plugins).filter(function(e,t){return c.indexOf(e)===t}),b={id:y,reference:e,popper:ht(),popperInstance:null,props:u,state:{isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},plugins:g,clearDelayTimeouts:function(){clearTimeout(r),clearTimeout(n),cancelAnimationFrame(o)},setProps:function(t){0;if(b.state.isDestroyed)return;B("onBeforeUpdate",[b,t]),U();var r=b.props,n=Nt(e,Object.assign({},r,vt(t),{ignoreAttributes:!0}));b.props=n,V(),r.interactiveDebounce!==n.interactiveDebounce&&(N(),h=ut($,n.interactiveDebounce));r.triggerTarget&&!n.triggerTarget?pt(r.triggerTarget).forEach(function(e){e.removeAttribute("aria-expanded")}):n.triggerTarget&&e.removeAttribute("aria-expanded");D(),M(),w&&w(r,n);b.popperInstance&&(Y(),Q().forEach(function(e){requestAnimationFrame(e._tippy.popperInstance.forceUpdate)}));B("onAfterUpdate",[b,t])},setContent:function(e){b.setProps({content:e})},show:function(){0;var e=b.state.isVisible,t=b.state.isDestroyed,r=!b.state.isEnabled,n=jt.isTouch&&!b.props.touch,o=st(b.props.duration,0,Bt.duration);if(e||t||r||n)return;if(k().hasAttribute("disabled"))return;if(B("onShow",[b],!1),!1===b.props.onShow(b))return;b.state.isVisible=!0,A()&&(x.style.visibility="visible");M(),I(),b.state.isMounted||(x.style.transition="none");if(A()){var a=S();xt([a.box,a.content],0)}s=function(){var e;if(b.state.isVisible&&!m){if(m=!0,x.offsetHeight,x.style.transition=b.props.moveTransition,A()&&b.props.animation){var t=S(),r=t.box,n=t.content;xt([r,n],o),wt([r,n],"visible")}T(),D(),dt(Vt,b),null==(e=b.popperInstance)||e.forceUpdate(),B("onMount",[b]),b.props.animation&&A()&&function(e,t){W(e,t)}(o,function(){b.state.isShown=!0,B("onShown",[b])})}},function(){var e,t=b.props.appendTo,r=k();e=b.props.interactive&&t===it||"parent"===t?r.parentNode:ct(t,[r]);e.contains(x)||e.appendChild(x);b.state.isMounted=!0,Y(),!1}()},hide:function(){0;var e=!b.state.isVisible,t=b.state.isDestroyed,r=!b.state.isEnabled,n=st(b.props.duration,1,Bt.duration);if(e||t||r)return;if(B("onHide",[b],!1),!1===b.props.onHide(b))return;b.state.isVisible=!1,b.state.isShown=!1,m=!1,p=!1,A()&&(x.style.visibility="hidden");if(N(),F(),M(!0),A()){var o=S(),a=o.box,i=o.content;b.props.animation&&(xt([a,i],n),wt([a,i],"hidden"))}T(),D(),b.props.animation?A()&&function(e,t){W(e,function(){!b.state.isVisible&&x.parentNode&&x.parentNode.contains(x)&&t()})}(n,b.unmount):b.unmount()},hideWithInteractivity:function(e){0;P().addEventListener("mousemove",h),dt(Ht,h),h(e)},enable:function(){b.state.isEnabled=!0},disable:function(){b.hide(),b.state.isEnabled=!1},unmount:function(){0;b.state.isVisible&&b.hide();if(!b.state.isMounted)return;K(),Q().forEach(function(e){e._tippy.unmount()}),x.parentNode&&x.parentNode.removeChild(x);Vt=Vt.filter(function(e){return e!==b}),b.state.isMounted=!1,B("onHidden",[b])},destroy:function(){0;if(b.state.isDestroyed)return;b.clearDelayTimeouts(),b.unmount(),U(),delete e._tippy,b.state.isDestroyed=!0,B("onDestroy",[b])}};if(!u.render)return b;var _=u.render(b),x=_.popper,w=_.onUpdate;x.setAttribute("data-tippy-root",""),x.id="tippy-"+b.id,b.popper=x,e._tippy=b,x._tippy=b;var L=g.map(function(e){return e.fn(b)}),E=e.hasAttribute("aria-expanded");return V(),D(),M(),B("onCreate",[b]),u.showOnCreate&&ee(),x.addEventListener("mouseenter",function(){b.props.interactive&&b.state.isVisible&&b.clearDelayTimeouts()}),x.addEventListener("mouseleave",function(){b.props.interactive&&b.props.trigger.indexOf("mouseenter")>=0&&P().addEventListener("mousemove",h)}),b;function O(){var e=b.props.touch;return Array.isArray(e)?e:[e,0]}function j(){return"hold"===O()[0]}function A(){var e;return!(null==(e=b.props.render)||!e.$$tippy)}function k(){return l||e}function P(){var e=k().parentNode;return e?Lt(e):document}function S(){return It(x)}function C(e){return b.state.isMounted&&!b.state.isVisible||jt.isTouch||a&&"focus"===a.type?0:st(b.props.delay,e?0:1,Bt.delay)}function M(e){void 0===e&&(e=!1),x.style.pointerEvents=b.props.interactive&&!e?"":"none",x.style.zIndex=""+b.props.zIndex}function B(e,t,r){var n;(void 0===r&&(r=!0),L.forEach(function(r){r[e]&&r[e].apply(r,t)}),r)&&(n=b.props)[e].apply(n,t)}function T(){var t=b.props.aria;if(t.content){var r="aria-"+t.content,n=x.id;pt(b.props.triggerTarget||e).forEach(function(e){var t=e.getAttribute(r);if(b.state.isVisible)e.setAttribute(r,t?t+" "+n:n);else{var o=t&&t.replace(n,"").trim();o?e.setAttribute(r,o):e.removeAttribute(r)}})}}function D(){!E&&b.props.aria.expanded&&pt(b.props.triggerTarget||e).forEach(function(e){b.props.interactive?e.setAttribute("aria-expanded",b.state.isVisible&&e===k()?"true":"false"):e.removeAttribute("aria-expanded")})}function N(){P().removeEventListener("mousemove",h),Ht=Ht.filter(function(e){return e!==h})}function R(t){if(!jt.isTouch||!f&&"mousedown"!==t.type){var r=t.composedPath&&t.composedPath()[0]||t.target;if(!b.props.interactive||!Ot(x,r)){if(pt(b.props.triggerTarget||e).some(function(e){return Ot(e,r)})){if(jt.isTouch)return;if(b.state.isVisible&&b.props.trigger.indexOf("click")>=0)return}else B("onClickOutside",[b,t]);!0===b.props.hideOnClick&&(b.clearDelayTimeouts(),b.hide(),d=!0,setTimeout(function(){d=!1}),b.state.isMounted||F())}}}function Z(){f=!0}function z(){f=!1}function I(){var e=P();e.addEventListener("mousedown",R,!0),e.addEventListener("touchend",R,at),e.addEventListener("touchstart",z,at),e.addEventListener("touchmove",Z,at)}function F(){var e=P();e.removeEventListener("mousedown",R,!0),e.removeEventListener("touchend",R,at),e.removeEventListener("touchstart",z,at),e.removeEventListener("touchmove",Z,at)}function W(e,t){var r=S().box;function n(e){e.target===r&&(Et(r,"remove",n),t())}if(0===e)return t();Et(r,"remove",i),Et(r,"add",n),i=n}function H(t,r,n){void 0===n&&(n=!1),pt(b.props.triggerTarget||e).forEach(function(e){e.addEventListener(t,r,n),v.push({node:e,eventType:t,handler:r,options:n})})}function V(){var e;j()&&(H("touchstart",q,{passive:!0}),H("touchend",G,{passive:!0})),(e=b.props.trigger,e.split(/\s+/).filter(Boolean)).forEach(function(e){if("manual"!==e)switch(H(e,q),e){case"mouseenter":H("mouseleave",G);break;case"focus":H(Ct?"focusout":"blur",X);break;case"focusin":H("focusout",X)}})}function U(){v.forEach(function(e){var t=e.node,r=e.eventType,n=e.handler,o=e.options;t.removeEventListener(r,n,o)}),v=[]}function q(e){var t,r=!1;if(b.state.isEnabled&&!J(e)&&!d){var n="focus"===(null==(t=a)?void 0:t.type);a=e,l=e.currentTarget,D(),!b.state.isVisible&>(e)&&Ht.forEach(function(t){return t(e)}),"click"===e.type&&(b.props.trigger.indexOf("mouseenter")<0||p)&&!1!==b.props.hideOnClick&&b.state.isVisible?r=!0:ee(e),"click"===e.type&&(p=!r),r&&!n&&te(e)}}function $(e){var t=e.target,r=k().contains(t)||x.contains(t);if("mousemove"!==e.type||!r){var n=Q().concat(x).map(function(e){var t,r=null==(t=e._tippy.popperInstance)?void 0:t.state;return r?{popperRect:e.getBoundingClientRect(),popperState:r,props:u}:null}).filter(Boolean);(function(e,t){var r=t.clientX,n=t.clientY;return e.every(function(e){var t=e.popperRect,o=e.popperState,a=e.props.interactiveBorder,i=ft(o.placement),s=o.modifiersData.offset;if(!s)return!0;var l="bottom"===i?s.top.y:0,c="top"===i?s.bottom.y:0,u="right"===i?s.left.x:0,p="left"===i?s.right.x:0,d=t.top-n+l>a,f=n-t.bottom-c>a,m=t.left-r+u>a,v=r-t.right-p>a;return d||f||m||v})})(n,e)&&(N(),te(e))}}function G(e){J(e)||b.props.trigger.indexOf("click")>=0&&p||(b.props.interactive?b.hideWithInteractivity(e):te(e))}function X(e){b.props.trigger.indexOf("focusin")<0&&e.target!==k()||b.props.interactive&&e.relatedTarget&&x.contains(e.relatedTarget)||te(e)}function J(e){return!!jt.isTouch&&j()!==e.type.indexOf("touch")>=0}function Y(){K();var t=b.props,r=t.popperOptions,n=t.placement,o=t.offset,a=t.getReferenceClientRect,i=t.moveTransition,l=A()?It(x).arrow:null,c=a?{getBoundingClientRect:a,contextElement:a.contextElement||k()}:e,u={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(e){var t=e.state;if(A()){var r=S().box;["placement","reference-hidden","escaped"].forEach(function(e){"placement"===e?r.setAttribute("data-placement",t.placement):t.attributes.popper["data-popper-"+e]?r.setAttribute("data-"+e,""):r.removeAttribute("data-"+e)}),t.attributes.popper={}}}},p=[{name:"offset",options:{offset:o}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!i}},u];A()&&l&&p.push({name:"arrow",options:{element:l,padding:3}}),p.push.apply(p,(null==r?void 0:r.modifiers)||[]),b.popperInstance=et(c,x,Object.assign({},r,{placement:n,onFirstUpdate:s,modifiers:p}))}function K(){b.popperInstance&&(b.popperInstance.destroy(),b.popperInstance=null)}function Q(){return mt(x.querySelectorAll("[data-tippy-root]"))}function ee(e){b.clearDelayTimeouts(),e&&B("onTrigger",[b,e]),I();var t=C(!0),n=O(),o=n[0],a=n[1];jt.isTouch&&"hold"===o&&a&&(t=a),t?r=setTimeout(function(){b.show()},t):b.show()}function te(e){if(b.clearDelayTimeouts(),B("onUntrigger",[b,e]),b.state.isVisible){if(!(b.props.trigger.indexOf("mouseenter")>=0&&b.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(e.type)>=0&&p)){var t=C(!1);t?n=setTimeout(function(){b.state.isVisible&&b.hide()},t):o=requestAnimationFrame(function(){b.hide()})}}else F()}}function qt(e,t){void 0===t&&(t={});var r=Bt.plugins.concat(t.plugins||[]);document.addEventListener("touchstart",kt,at),window.addEventListener("blur",St);var n=Object.assign({},t,{plugins:r}),o=_t(e).reduce(function(e,t){var r=t&&Ut(t,n);return r&&e.push(r),e},[]);return yt(e)?o[0]:o}qt.defaultProps=Bt,qt.setDefaultProps=function(e){Object.keys(e).forEach(function(t){Bt[t]=e[t]})},qt.currentInput=jt;Object.assign({},Ne,{effect:function(e){var t=e.state,r={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(t.elements.popper.style,r.popper),t.styles=r,t.elements.arrow&&Object.assign(t.elements.arrow.style,r.arrow)}});qt.setDefaultProps({render:Ft});const $t=qt;var Gt=r(6087);const Xt=({children:e,value:t})=>Gt.createElement("div",{className:"colorpalette-color-label"},Gt.createElement("span",null,e),Gt.createElement("span",{className:"component-color-indicator","aria-label":`Color: ${t}`,style:{background:t}})),Jt=new(o()())("_"),Yt=({attributes:e,setAttributes:r,colors:n})=>{const o=p()(e),a=Jt.object(o),[i,u]=(0,l.useState)(a.customSettings);e.transformation_crop||(e.transformation_crop="pad",e.transformation_background="rgb:FFFFFF"),"fill"===e.transformation_crop&&delete e.transformation_background;const d=(e,t)=>{const n={[t]:F(e)};r(n)},f=(e=>{const[t,r]=(0,l.useState)(null),n=(0,l.useCallback)(e=>r(e),[]);return(0,l.useEffect)(()=>{if(!t)return;const r=$t(t,{content:e});return()=>{r?.destroy()}},[t,e]),n})((0,t.__)("How to resize or crop images to fit the gallery. Pad adds padding around the image using the specified padding style. Fill crops the image from the center so it fills as much of the available space as possible.","cloudinary"));return Gt.createElement(Gt.Fragment,null,Gt.createElement(s.PanelBody,{title:(0,t.__)("Layout","cloudinary")},y.map(t=>Gt.createElement(R,{key:`${t.value.type}-${t.value.columns}-layout`,value:t.value,onChange:e=>{r({displayProps_mode:e.type,displayProps_columns:e.columns||1})},icon:t.icon,current:{type:e.displayProps_mode,columns:e.displayProps_columns||1}},t.label))),Gt.createElement(s.PanelBody,{title:(0,t.__)("Color Palette","cloudinary"),initialOpen:!1},Gt.createElement(Xt,{value:e.themeProps_primary},(0,t.__)("Primary","cloudinary")),Gt.createElement(c.ColorPalette,{value:e.themeProps_primary,colors:n,disableCustomColors:!1,onChange:e=>d(e,"themeProps_primary")}),Gt.createElement(Xt,{value:e.themeProps_onPrimary},(0,t.__)("On Primary","cloudinary")),Gt.createElement(c.ColorPalette,{value:e.themeProps_onPrimary,colors:n,disableCustomColors:!1,onChange:e=>d(e,"themeProps_onPrimary")}),Gt.createElement(Xt,{value:e.themeProps_active},(0,t.__)("Active","cloudinary")),Gt.createElement(c.ColorPalette,{value:e.themeProps_active,colors:n,disableCustomColors:!1,onChange:e=>d(e,"themeProps_active")})),"classic"===e.displayProps_mode&&Gt.createElement(s.PanelBody,{title:(0,t.__)("Fade Transition","cloudinary"),initialOpen:!1},Gt.createElement(s.SelectControl,{value:e.transition,options:_,onChange:e=>r({transition:e}),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0})),Gt.createElement(s.PanelBody,{title:(0,t.__)("Main Viewer Parameters","cloudinary"),initialOpen:!1},Gt.createElement(s.SelectControl,{label:(0,t.__)("Aspect Ratio","cloudinary"),value:e.aspectRatio,options:b,onChange:e=>r({aspectRatio:e}),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0}),Gt.createElement("p",null,Gt.createElement("div",{className:"cld-ui-title"},(0,t.__)("Resize/Crop Mode","cloudinary"),Gt.createElement("span",{className:"dashicons dashicons-info cld-tooltip",ref:f})),Gt.createElement(s.ButtonGroup,null,M.map(t=>Gt.createElement(s.Button,{key:t.value+"-look-and-feel",variant:"secondary",isSecondary:!0,isPressed:t.value===e.transformation_crop,onClick:()=>r({transformation_crop:t.value,transformation_background:null})},t.label)))),"pad"===e.transformation_crop&&Gt.createElement(s.SelectControl,{label:(0,t.__)("Pad style","cloudinary"),value:e.transformation_background,options:B,onChange:e=>{r({transformation_background:e})},__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0}),Gt.createElement("p",null,(0,t.__)("Navigation","cloudinary")),Gt.createElement("p",null,Gt.createElement(s.ButtonGroup,null,x.map(t=>Gt.createElement(s.Button,{key:t.value+"-navigation",variant:"secondary",isSecondary:!0,isPressed:t.value===e.navigation,onClick:()=>r({navigation:t.value})},t.label)))),Gt.createElement("div",{style:{marginTop:"30px"}},Gt.createElement(s.ToggleControl,{label:(0,t.__)("Show Zoom","cloudinary"),checked:e.zoom,onChange:()=>r({zoom:!e.zoom}),__nextHasNoMarginBottom:!0}),e.zoom&&Gt.createElement(Gt.Fragment,null,Gt.createElement("p",null,(0,t.__)("Zoom Type","cloudinary")),Gt.createElement("p",null,Gt.createElement(s.ButtonGroup,null,w.map(t=>Gt.createElement(s.Button,{key:t.value+"-zoom-type",variant:"secondary",isSecondary:!0,isPressed:t.value===e.zoomProps_type,onClick:()=>r({zoomProps_type:t.value})},t.label)))),"flyout"===e.zoomProps_type&&Gt.createElement(s.SelectControl,{label:(0,t.__)("Zoom Viewer Position","cloudinary"),value:e.zoomProps_viewerPosition,options:L,onChange:e=>r({zoomProps_viewerPosition:e}),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0}),"popup"!==e.zoomProps_type&&Gt.createElement(Gt.Fragment,null,Gt.createElement("p",null,(0,t.__)("Zoom Trigger","cloudinary")),Gt.createElement("p",null,Gt.createElement(s.ButtonGroup,null,E.map(t=>Gt.createElement(s.Button,{key:t.value+"-zoom-trigger",variant:"secondary",isSecondary:!0,isPressed:t.value===e.zoomProps_trigger,onClick:()=>r({zoomProps_trigger:t.value})},t.label)))))))),Gt.createElement(s.PanelBody,{title:(0,t.__)("Carousel Parameters","cloudinary"),initialOpen:!1},Gt.createElement("p",null,(0,t.__)("Carousel Location","cloudinary")),Gt.createElement("p",null,Gt.createElement(s.ButtonGroup,null,O.map(t=>Gt.createElement(s.Button,{key:t.value+"-carousel-location",variant:"secondary",isSecondary:!0,isPressed:t.value===e.carouselLocation,onClick:()=>r({carouselLocation:t.value})},t.label)))),Gt.createElement(s.RangeControl,{label:(0,t.__)("Carousel Offset","cloudinary"),value:e.carouselOffset,onChange:e=>r({carouselOffset:e}),min:0,max:100,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0}),Gt.createElement("p",null,(0,t.__)("Carousel Style","cloudinary")),Gt.createElement("p",null,Gt.createElement(s.ButtonGroup,null,j.map(t=>Gt.createElement(s.Button,{key:t.value+"-carousel-style",variant:"secondary",isSecondary:!0,isPressed:t.value===e.carouselStyle,onClick:()=>r({carouselStyle:t.value})},t.label)))),"thumbnails"===e.carouselStyle&&Gt.createElement(Gt.Fragment,null,Gt.createElement(s.RangeControl,{label:(0,t.__)("Width","cloudinary"),value:e.thumbnailProps_width,onChange:e=>r({thumbnailProps_width:e}),min:5,max:300,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0}),Gt.createElement(s.RangeControl,{label:(0,t.__)("Height","cloudinary"),value:e.thumbnailProps_height,onChange:e=>r({thumbnailProps_height:e}),min:5,max:300,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0}),Gt.createElement("p",null,(0,t.__)("Navigation Button Shape","cloudinary")),A.map(t=>Gt.createElement(R,{key:t.value+"-navigation-button-shape",value:t.value,onChange:e=>r({thumbnailProps_navigationShape:e}),icon:t.icon,current:e.thumbnailProps_navigationShape},t.label)),Gt.createElement("p",null,(0,t.__)("Selected Style","cloudinary")),Gt.createElement("p",null,Gt.createElement(s.ButtonGroup,null,P.map(t=>Gt.createElement(s.Button,{key:t.value+"-selected-style",variant:"secondary",isSecondary:!0,isPressed:t.value===e.thumbnailProps_selectedStyle,onClick:()=>r({thumbnailProps_selectedStyle:t.value})},t.label)))),Gt.createElement(s.SelectControl,{label:(0,t.__)("Selected Border Position","cloudinary"),value:e.thumbnailProps_selectedBorderPosition,options:S,onChange:e=>r({thumbnailProps_selectedBorderPosition:e}),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0}),Gt.createElement(s.RangeControl,{label:(0,t.__)("Selected Border Width","cloudinary"),value:e.thumbnailProps_selectedBorderWidth,onChange:e=>r({thumbnailProps_selectedBorderWidth:e}),min:0,max:10,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0}),Gt.createElement("p",null,(0,t.__)("Media Shape Icon","cloudinary")),C.map(t=>Gt.createElement(R,{key:t.value+"-media",value:t.value,onChange:e=>r({thumbnailProps_mediaSymbolShape:e}),icon:t.icon,current:e.thumbnailProps_mediaSymbolShape},t.label))),"indicators"===e.carouselStyle&&Gt.createElement(Gt.Fragment,null,Gt.createElement("p",null,(0,t.__)("Indicators Shape","cloudinary")),k.map(t=>Gt.createElement(R,{key:t.value+"-indicator",value:t.value,onChange:e=>r({indicatorProps_shape:e}),icon:t.icon,current:e.indicatorProps_shape},t.label)))),Gt.createElement(s.PanelBody,{title:(0,t.__)("Additional Settings","cloudinary"),initialOpen:!1},Gt.createElement(s.TextareaControl,{label:(0,t.__)("Custom Settings","cloudinary"),help:(0,t.__)("Provide a JSON string of the settings you want to add and/or override.","cloudinary"),value:i,onChange:e=>{let t={};u(e);try{t=JSON.parse(e)}catch(e){}if("object"==typeof t){const e={...a};e.customSettings=t,r({...a,...e})}},__nextHasNoMarginBottom:!0})))};var Kt=r(6087);const Qt=new(o()())("_"),er=(0,t.__)("Drag images, upload new ones or select files from your library.","cloudinary"),tr=(e,t)=>({...e,container:"."+t,zoom:!1}),rr=e=>e?.cloudinary?.galleryWidget,nr=({setAttributes:e,attributes:r,isSelected:n})=>{const[a,u]=(0,l.useState)(null),[d,f]=(0,l.useState)(!1),m=(0,l.useRef)(null),v=(0,l.useMemo)(()=>{if(0!==r.selectedImages.length)return r;const e={},{container:t,...n}=Qt.dot(CLD_GALLERY_CONFIG);return Object.keys(n).forEach(t=>{r[t]||(e[t]=n[t])}),{...r,...e}},[r]),h=(0,l.useMemo)(()=>r.selectedImages.length?r.selectedImages.map(({attachmentId:e})=>({id:e})):[],[r]);(0,l.useEffect)(()=>{a&&((({status:e,message:t,options:r={}})=>{(0,Z.dispatch)("core/notices").createNotice(e,t,{isDismissible:!0,...r})})({status:"error",message:a}),u(null));const e=m.current;if(!r.selectedImages.length||!e)return;const t=e.ownerDocument.defaultView||window,n=e=>t===window?e:t.JSON.parse(JSON.stringify(e)),{customSettings:i,...s}=(e=>{const t=new(o()())("_"),r=p()(e),{selectedImages:n,...a}=t.object(r,{});return a.mediaAssets=n,"classic"!==a?.displayProps?.mode?delete a.transition:delete a.displayProps.columns,"pad"!==a?.transformation_crop&&delete a.transformation_background,"pad"!==a?.transformation?.crop&&delete a.transformation.background,a?.themeProps?.primary&&(a.themeProps.primary=F(a?.themeProps?.primary)),a?.themeProps?.onPrimary&&(a.themeProps.onPrimary=F(a?.themeProps?.onPrimary)),a?.themeProps?.active&&(a.themeProps.active=F(a?.themeProps?.active)),a})(r),l=(e=>{let t=e;if("string"==typeof e)try{t=JSON.parse(e)}catch{return{}}return!t||"object"!=typeof t||Array.isArray(t)?{}:t})(i);let c,d=!1;const v=()=>{if(d)return;const e=rr(t);if(e){try{c=e(n(tr({...s,...l},r.container)))}catch{c=e(n(tr(s,r.container)))}c.render(),f(!1)}else f(!1)};return rr(t)?v():"complete"!==t.document.readyState?t.addEventListener("load",v,{once:!0}):f(!1),()=>{d=!0,t.removeEventListener("load",v),c?.destroy()}},[a,r,e]);const y=!!r.selectedImages.length;(0,l.useEffect)(()=>{r.container||e({container:`cld-gallery-${I(15)}`})},[r.container,e]),(0,l.useEffect)(()=>{e(v)},[v,e]);const b=(0,c.useBlockProps)();return Kt.createElement("div",b,Kt.createElement(Kt.Fragment,null,Kt.createElement("div",{ref:m,className:r.container}),Kt.createElement("div",{className:"wp-block-cloudinary-gallery"},Kt.createElement(c.MediaPlaceholder,{labels:{title:!y&&(0,t.__)("Cloudinary Gallery","cloudinary"),instructions:!y&&er},icon:"format-gallery",disableMediaButtons:y&&!n,allowedTypes:g,addToGallery:y,isAppender:y,onSelect:r=>(async r=>{f(!0);try{const t=await i()({path:CLD_REST_ENDPOINT+"/image_data",method:"POST",data:{images:r}});e({selectedImages:t})}catch{f(!1),u((0,t.__)("Could not load selected images. Please try again.","cloudinary"))}})(r),value:h,multiple:!0},d&&Kt.createElement("div",{className:"loading-spinner-container"},Kt.createElement(s.Spinner,null))))),Kt.createElement(c.InspectorControls,null,Kt.createElement(Yt,{attributes:r,setAttributes:e})))};var or=r(6087);const ar=({attributes:e})=>or.createElement("div",{className:e.container}),ir=JSON.parse('{"aspectRatio":{"type":"string"},"navigation":{"type":"string"},"zoom":{"type":"boolean"},"carouselLocation":{"type":"string"},"carouselOffset":{"type":"number"},"carouselStyle":{"type":"string"},"displayProps_mode":{"type":"string"},"displayProps_columns":{"type":"number"},"indicatorProps_shape":{"type":"string"},"themeProps_primary":{"type":"string"},"themeProps_onPrimary":{"type":"string"},"themeProps_active":{"type":"string"},"zoomProps_type":{"type":"string"},"zoomProps_viewerPosition":{"type":"string"},"zoomProps_trigger":{"type":"string"},"thumbnailProps_width":{"type":"number"},"thumbnailProps_height":{"type":"number"},"thumbnailProps_navigationShape":{"type":"string"},"thumbnailProps_selectedStyle":{"type":"string"},"thumbnailProps_selectedBorderPosition":{"type":"string"},"thumbnailProps_selectedBorderWidth":{"type":"number"},"thumbnailProps_mediaSymbolShape":{"type":"string"},"cloudName":{"type":"string"},"container":{"type":"string"},"selectedImages":{"type":"array","default":[]},"transformation_crop":{"type":"string","default":"pad"},"transformation_background":{"type":"string"},"customSettings":{"type":"string"}}');(0,n.registerBlockType)("cloudinary/gallery",{apiVersion:2,title:(0,t.__)("Cloudinary Gallery","cloudinary"),description:(0,t.__)("Add a gallery powered by the Cloudinary Gallery Widget to your post.","cloudinary"),category:"widgets",icon:"format-gallery",attributes:ir,edit:nr,save:ar})})()})(); //# sourceMappingURL=gallery-block.js.map \ No newline at end of file diff --git a/src/js/gallery-block/edit.js b/src/js/gallery-block/edit.js index d2e079767..d6f5934cc 100644 --- a/src/js/gallery-block/edit.js +++ b/src/js/gallery-block/edit.js @@ -149,9 +149,16 @@ const Edit = ( { setAttributes, attributes, isSelected } ) => { let cancelled = false; const render = () => { + if ( cancelled ) { + return; + } + const galleryWidget = getGalleryWidget( win ); - if ( cancelled || ! galleryWidget ) { + // The library failed to load in this frame: don't leave the + // spinner running. + if ( ! galleryWidget ) { + setLoading( false ); return; } diff --git a/tests/e2e/cloudinary-gallery-delivery.spec.js b/tests/e2e/cloudinary-gallery-delivery.spec.js index 621715dd6..5acc6a177 100644 --- a/tests/e2e/cloudinary-gallery-delivery.spec.js +++ b/tests/e2e/cloudinary-gallery-delivery.spec.js @@ -286,8 +286,9 @@ test.describe( 'Cloudinary Gallery block delivery', { tag: '@serial' }, () => { await admin.editPost( created.postId ); - // The editor canvas is an iframe: the widget has to render inside it, - // not in the outer admin document. + // Relies on the iframed editor (WordPress 7.1+, or blocks on API v3): + // the editor canvas is an iframe, and the widget has to render inside + // it, not in the outer admin document. const gallery = editor.canvas.locator( `.${ GALLERY_CONTAINER } [data-test="gallery-wrap"]` ); From a01624c01c57296aec7be4309afe00ac8e89b014 Mon Sep 17 00:00:00 2001 From: Gabriel de Tassigny Date: Wed, 11 Nov 2026 11:01:20 +0100 Subject: [PATCH 4/4] fix(gallery): Preview with the connected account's delivery settings The front end always renders a gallery with the connected cloud name and custom domain settings. The editor preview only got them on new blocks, so blocks with no or a stale cloud name showed broken images, and existing blocks ignored the custom domain. --- js/gallery-block.asset.php | 2 +- js/gallery-block.js | 2 +- src/js/gallery-block/edit.js | 27 ++++++++++++++++++- tests/e2e/cloudinary-gallery-delivery.spec.js | 3 ++- tests/e2e/utils/gallery.js | 11 +------- 5 files changed, 31 insertions(+), 14 deletions(-) diff --git a/js/gallery-block.asset.php b/js/gallery-block.asset.php index 7e6b42e04..c5850ebff 100644 --- a/js/gallery-block.asset.php +++ b/js/gallery-block.asset.php @@ -9,5 +9,5 @@ 'wp-element', 'wp-i18n' ), - 'version' => '64aa07081e69682cd8ae' + 'version' => 'b84b3ec7a0124b944242' ); diff --git a/js/gallery-block.js b/js/gallery-block.js index 856a01ab0..8ac0b9db7 100644 --- a/js/gallery-block.js +++ b/js/gallery-block.js @@ -1,2 +1,2 @@ -(()=>{var e={5580(e,t,r){var n=r(6110)(r(9325),"DataView");e.exports=n},1549(e,t,r){var n=r(2032),o=r(3862),a=r(6721),i=r(2749),s=r(5749);function l(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t-1&&e%1==0&&e-1}},1175(e,t,r){var n=r(6025);e.exports=function(e,t){var r=this.__data__,o=n(r,e);return o<0?(++this.size,r.push([e,t])):r[o][1]=t,this}},3040(e,t,r){var n=r(1549),o=r(79),a=r(8223);e.exports=function(){this.size=0,this.__data__={hash:new n,map:new(a||o),string:new n}}},7670(e,t,r){var n=r(2651);e.exports=function(e){var t=n(this,e).delete(e);return this.size-=t?1:0,t}},289(e,t,r){var n=r(2651);e.exports=function(e){return n(this,e).get(e)}},4509(e,t,r){var n=r(2651);e.exports=function(e){return n(this,e).has(e)}},2949(e,t,r){var n=r(2651);e.exports=function(e,t){var r=n(this,e),o=r.size;return r.set(e,t),this.size+=r.size==o?0:1,this}},1042(e,t,r){var n=r(6110)(Object,"create");e.exports=n},3650(e,t,r){var n=r(4335)(Object.keys,Object);e.exports=n},181(e){e.exports=function(e){var t=[];if(null!=e)for(var r in Object(e))t.push(r);return t}},6009(e,t,r){e=r.nmd(e);var n=r(4840),o=t&&!t.nodeType&&t,a=o&&e&&!e.nodeType&&e,i=a&&a.exports===o&&n.process,s=function(){try{var e=a&&a.require&&a.require("util").types;return e||i&&i.binding&&i.binding("util")}catch(e){}}();e.exports=s},9350(e){var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},4335(e){e.exports=function(e,t){return function(r){return e(t(r))}}},9325(e,t,r){var n=r(4840),o="object"==typeof self&&self&&self.Object===Object&&self,a=n||o||Function("return this")();e.exports=a},1420(e,t,r){var n=r(79);e.exports=function(){this.__data__=new n,this.size=0}},938(e){e.exports=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}},3605(e){e.exports=function(e){return this.__data__.get(e)}},9817(e){e.exports=function(e){return this.__data__.has(e)}},945(e,t,r){var n=r(79),o=r(8223),a=r(3661);e.exports=function(e,t){var r=this.__data__;if(r instanceof n){var i=r.__data__;if(!o||i.length<199)return i.push([e,t]),this.size=++r.size,this;r=this.__data__=new a(i)}return r.set(e,t),this.size=r.size,this}},7473(e){var t=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return t.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},8055(e,t,r){var n=r(9999);e.exports=function(e){return n(e,5)}},5288(e){e.exports=function(e,t){return e===t||e!=e&&t!=t}},2428(e,t,r){var n=r(7534),o=r(346),a=Object.prototype,i=a.hasOwnProperty,s=a.propertyIsEnumerable,l=n(function(){return arguments}())?n:function(e){return o(e)&&i.call(e,"callee")&&!s.call(e,"callee")};e.exports=l},6449(e){var t=Array.isArray;e.exports=t},4894(e,t,r){var n=r(1882),o=r(294);e.exports=function(e){return null!=e&&o(e.length)&&!n(e)}},3656(e,t,r){e=r.nmd(e);var n=r(9325),o=r(9935),a=t&&!t.nodeType&&t,i=a&&e&&!e.nodeType&&e,s=i&&i.exports===a?n.Buffer:void 0,l=(s?s.isBuffer:void 0)||o;e.exports=l},1882(e,t,r){var n=r(2552),o=r(3805);e.exports=function(e){if(!o(e))return!1;var t=n(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},294(e){e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}},7730(e,t,r){var n=r(9172),o=r(7301),a=r(6009),i=a&&a.isMap,s=i?o(i):n;e.exports=s},3805(e){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},346(e){e.exports=function(e){return null!=e&&"object"==typeof e}},8440(e,t,r){var n=r(6038),o=r(7301),a=r(6009),i=a&&a.isSet,s=i?o(i):n;e.exports=s},7167(e,t,r){var n=r(4901),o=r(7301),a=r(6009),i=a&&a.isTypedArray,s=i?o(i):n;e.exports=s},5950(e,t,r){var n=r(695),o=r(8984),a=r(4894);e.exports=function(e){return a(e)?n(e):o(e)}},7241(e,t,r){var n=r(695),o=r(2903),a=r(4894);e.exports=function(e){return a(e)?n(e,!0):o(e)}},3345(e){e.exports=function(){return[]}},9935(e){e.exports=function(){return!1}},6087(e){"use strict";e.exports=window.wp.element},6942(e,t){var r;!function(){"use strict";var n={}.hasOwnProperty;function o(){for(var e="",t=0;t{const t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.cw=e=>{var t;return()=>{if(e){var r=e;e=0,t={exports:{}},r.call(t.exports,t,t.exports)}return t.exports}},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.hasOwn(e,t),r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),r.dn=e=>{var t=Object.getOwnPropertyDescriptor(e,"name");(!t||!t.writable&&t.configurable)&&Object.defineProperty(e,"name",{value:"default",configurable:!0})},(()=>{"use strict";var e=r.cw(e=>{function t(e,t){var r,n;if("function"==typeof t)void 0!==(n=t(e))&&(e=n);else if(Array.isArray(t))for(r=0;r=0&&(e=e.replace(/\[/g,t).replace(/]/g,""));var r=e.split(t);if(r.filter(s).length!==r.length)throw Error("Refusing to update blacklisted property "+e);return r}var c=Object.prototype.hasOwnProperty;function u(e,t,r,n){if(!(this instanceof u))return new u(e,t,r,n);void 0===t&&(t=!1),void 0===r&&(r=!0),void 0===n&&(n=!0),this.separator=e||".",this.override=t,this.useArray=r,this.useBrackets=n,this.keepArray=!1,this.cleanup=[]}var p=new u(".",!1,!0,!0);function d(e){return function(){return p[e].apply(p,arguments)}}u.prototype._fill=function(e,r,n,i){var s=e.shift();if(e.length>0){if(r[s]=r[s]||(this.useArray&&function(e){return/^\d+$/.test(e)}(e[0])?[]:{}),!o(r[s])){if(!this.override){if(!o(n)||!a(n))throw new Error("Trying to redefine `"+s+"` which is a "+typeof r[s]);return}r[s]={}}this._fill(e,r[s],n,i)}else{if(!this.override&&o(r[s])&&!a(r[s])){if(!o(n)||!a(n))throw new Error("Trying to redefine non-empty obj['"+s+"']");return}r[s]=t(n,i)}},u.prototype.object=function(e,r){var n=this;return Object.keys(e).forEach(function(o){var a=void 0===r?null:r[o],i=l(o,n.separator).join(n.separator);-1!==i.indexOf(n.separator)?(n._fill(i.split(n.separator),e,e[o],a),delete e[o]):e[o]=t(e[o],a)}),e},u.prototype.str=function(e,r,n,o){var a=l(e,this.separator).join(this.separator);return-1!==e.indexOf(this.separator)?this._fill(a.split(this.separator),n,r,o):n[e]=t(r,o),n},u.prototype.pick=function(e,t,n,o){var a,i,s,c,u;for(i=l(e,this.separator),a=0;ad.createElement("svg",{width:"18px",height:"18px",viewBox:"0 0 18 18",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},d.createElement("title",null,"shape-round"),d.createElement("desc",null,"Created with Sketch."),d.createElement("g",{id:"Desktop-0.4",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},d.createElement("g",{id:"widgets/shape-round",transform:"translate(-3.000000, -3.000000)",fill:"#000000"},d.createElement("path",{d:"M12,3 C16.9705627,3 21,7.02943725 21,12 C21,16.9705627 16.9705627,21 12,21 C7.02943725,21 3,16.9705627 3,12 C3,7.02943725 7.02943725,3 12,3 Z M12,5 C8.13400675,5 5,8.13400675 5,12 C5,15.8659932 8.13400675,19 12,19 C15.8659932,19 19,15.8659932 19,12 C19,8.13400675 15.8659932,5 12,5 Z",id:"Combined-Shape"})))),m=()=>d.createElement("svg",{width:"18px",height:"18px",viewBox:"0 0 18 18",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},d.createElement("title",null,"ratio-square"),d.createElement("desc",null,"Created with Sketch."),d.createElement("g",{id:"Desktop-0.4",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},d.createElement("g",{id:"widgets/shape-square",transform:"translate(-3.000000, -3.000000)",fill:"#000000"},d.createElement("path",{d:"M3,3 L3,21 L21,21 L21,3 L3,3 Z M5,5 L5,19 L19,19 L19,5 L5,5 Z",id:"shape"})))),v=()=>d.createElement("svg",{width:"18px",height:"18px",viewBox:"0 0 18 18",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},d.createElement("title",null,"shape-radius"),d.createElement("desc",null,"Created with Sketch."),d.createElement("g",{id:"Desktop-0.4",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},d.createElement("g",{id:"widgets/shape-radius",transform:"translate(-3.000000, -3.000000)",fill:"#000000"},d.createElement("path",{d:"M17,3 C19.209139,3 21,4.790861 21,7 L21,17 C21,19.209139 19.209139,21 17,21 L7,21 C4.790861,21 3,19.209139 3,17 L3,7 C3,4.790861 4.790861,3 7,3 L17,3 Z M17,5 L7,5 C5.9456382,5 5.08183488,5.81587779 5.00548574,6.85073766 L5,7 L5,17 C5,18.0543618 5.81587779,18.9181651 6.85073766,18.9945143 L7,19 L17,19 C18.0543618,19 18.9181651,18.1841222 18.9945143,17.1492623 L19,17 L19,7 C19,5.9456382 18.1841222,5.08183488 17.1492623,5.00548574 L17,5 Z",id:"Rectangle"})))),h=()=>d.createElement("svg",{width:"18px",height:"18px",viewBox:"0 0 18 18",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},d.createElement("title",null,"shape-none"),d.createElement("desc",null,"Created with Sketch."),d.createElement("g",{id:"Desktop-0.4",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},d.createElement("g",{id:"widgets/shape-none",transform:"translate(-3.000000, -3.000000)",fill:"#000000"},d.createElement("path",{d:"M5,19 L5,21 L3,21 L3,19 L5,19 Z M21,19 L21,21 L19,21 L19,19 L21,19 Z M13,19 L13,21 L11,21 L11,19 L13,19 Z M9,19 L9,21 L7,21 L7,19 L9,19 Z M17,19 L17,21 L15,21 L15,19 L17,19 Z M21,15 L21,17 L19,17 L19,15 L21,15 Z M21,11 L21,13 L19,13 L19,11 L21,11 Z M5,11 L5,13 L3,13 L3,11 L5,11 Z M21,7 L21,9 L19,9 L19,7 L21,7 Z M5,7 L5,9 L3,9 L3,7 L5,7 Z M13,3 L13,5 L11,5 L11,3 L13,3 Z M9,3 L9,5 L7,5 L7,3 L9,3 Z M17,3 L17,5 L15,5 L15,3 L17,3 Z M21,3 L21,5 L19,5 L19,3 L21,3 Z M5,3 L5,5 L3,5 L3,3 L5,3 Z M3,15 L5,15 L5,17 L3,17 L3,15 Z",id:"Shape"})))),y=[{value:{type:"expanded",columns:1},icon:()=>d.createElement("svg",{width:"17px",height:"20px",viewBox:"0 0 17 20",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},d.createElement("title",null,"layout-modern"),d.createElement("desc",null,"Created with Sketch."),d.createElement("g",{id:"Desktop-0.4",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},d.createElement("g",{id:"widgets/layout-modern",transform:"translate(-2.000000, -3.000000)",fill:"#000000"},d.createElement("path",{d:"M2,10 L5,10 L5,7 L2,7 L2,10 Z M2,14 L5,14 L5,11 L2,11 L2,14 Z M2,6 L5,6 L5,3 L2,3 L2,6 Z M6,3 L6,17 L19,17 L19,3 L6,3 Z M8,5 L8,15 L17,15 L17,5 L8,5 Z M6,18 L6,23 L19,23 L19,18 L6,18 Z M8,20 L8,23 L17,23 L17,20 L8,20 Z",id:"shape"})))),label:(0,t.__)("Expanded - 1 Column","cloudinary")},{value:{type:"expanded",columns:2},icon:()=>d.createElement("svg",{width:"18px",height:"17px",viewBox:"0 0 18 17",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},d.createElement("title",null,"layout-grid-2-column"),d.createElement("desc",null,"Created with Sketch."),d.createElement("g",{id:"Desktop-0.4",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},d.createElement("g",{id:"widgets/layout-gird-2-col",transform:"translate(-3.000000, -3.000000)",fill:"#000000"},d.createElement("path",{d:"M11,12 L11,20 L3,20 L3,12 L11,12 Z M21,12 L21,20 L13,20 L13,12 L21,12 Z M9,14 L5,14 L5,18 L9,18 L9,14 Z M19,14 L15,14 L15,18 L19,18 L19,14 Z M11,3 L11,11 L3,11 L3,3 L11,3 Z M21,3 L21,11 L13,11 L13,3 L21,3 Z M9,5 L5,5 L5,9 L9,9 L9,5 Z M19,5 L15,5 L15,9 L19,9 L19,5 Z",id:"Shape"})))),label:(0,t.__)("Expanded - 2 Column","cloudinary")},{value:{type:"expanded",columns:3},icon:()=>d.createElement("svg",{width:"20px",height:"13px",viewBox:"0 0 20 13",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},d.createElement("title",null,"layout-grid-3-column"),d.createElement("desc",null,"Created with Sketch."),d.createElement("g",{id:"Desktop-0.4",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},d.createElement("g",{id:"widgets/layout-gird-3-col",transform:"translate(-2.000000, -5.000000)",fill:"#000000"},d.createElement("path",{d:"M8,12 L8,18 L2,18 L2,12 L8,12 Z M15,12 L15,18 L9,18 L9,12 L15,12 Z M22,12 L22,18 L16,18 L16,12 L22,12 Z M6,14 L4,14 L4,16 L6,16 L6,14 Z M13,14 L11,14 L11,16 L13,16 L13,14 Z M20,14 L18,14 L18,16 L20,16 L20,14 Z M8,5 L8,11 L2,11 L2,5 L8,5 Z M15,5 L15,11 L9,11 L9,5 L15,5 Z M22,5 L22,11 L16,11 L16,5 L22,5 Z M6,7 L4,7 L4,9 L6,9 L6,7 Z M13,7 L11,7 L11,9 L13,9 L13,7 Z M20,7 L18,7 L18,9 L20,9 L20,7 Z",id:"Combined-Shape"})))),label:(0,t.__)("Expanded - 3 Column","cloudinary")},{value:{type:"classic",columns:1},icon:()=>d.createElement("svg",{width:"17px",height:"14px",viewBox:"0 0 17 14",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},d.createElement("title",null,"layout-classic"),d.createElement("desc",null,"Created with Sketch."),d.createElement("g",{id:"Desktop-0.4",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},d.createElement("g",{id:"widgets/layout-classic",transform:"translate(-3.000000, -5.000000)",fill:"#000000"},d.createElement("path",{d:"M3,12 L6,12 L6,9 L3,9 L3,12 Z M3,16 L6,16 L6,13 L3,13 L3,16 Z M3,8 L6,8 L6,5 L3,5 L3,8 Z M7,5 L7,19 L20,19 L20,5 L7,5 Z M9,7 L9,17 L18,17 L18,7 L9,7 Z",id:"shape"})))),label:(0,t.__)("Classic","cloudinary")}],g=["image"],b=[{label:(0,t.__)("1:1","cloudinary"),value:"1:1"},{label:(0,t.__)("3:4","cloudinary"),value:"3:4"},{label:(0,t.__)("4:3","cloudinary"),value:"4:3"},{label:(0,t.__)("4:6","cloudinary"),value:"4:6"},{label:(0,t.__)("6:4","cloudinary"),value:"6:4"},{label:(0,t.__)("5:7","cloudinary"),value:"5:7"},{label:(0,t.__)("7:5","cloudinary"),value:"7:5"},{label:(0,t.__)("8:5","cloudinary"),value:"8:5"},{label:(0,t.__)("5:8","cloudinary"),value:"5:8"},{label:(0,t.__)("9:16","cloudinary"),value:"9:16"},{label:(0,t.__)("16:9","cloudinary"),value:"16:9"}],_=[{label:(0,t.__)("None","cloudinary"),value:"none"},{label:(0,t.__)("Fade","cloudinary"),value:"fade"},{label:(0,t.__)("Slide","cloudinary"),value:"slide"}],x=[{label:(0,t.__)("Always","cloudinary"),value:"always"},{label:(0,t.__)("None","cloudinary"),value:"none"},{label:(0,t.__)("MouseOver","cloudinary"),value:"mouseover"}],w=[{label:(0,t.__)("Inline","cloudinary"),value:"inline"},{label:(0,t.__)("Flyout","cloudinary"),value:"flyout"},{label:(0,t.__)("Popup","cloudinary"),value:"popup"}],L=[{label:(0,t.__)("Top","cloudinary"),value:"top"},{label:(0,t.__)("Bottom","cloudinary"),value:"bottom"},{label:(0,t.__)("Left","cloudinary"),value:"left"},{label:(0,t.__)("Right","cloudinary"),value:"right"}],E=[{label:(0,t.__)("Click","cloudinary"),value:"click"},{label:(0,t.__)("Hover","cloudinary"),value:"hover"}],O=[{label:(0,t.__)("Left","cloudinary"),value:"left"},{label:(0,t.__)("Right","cloudinary"),value:"right"},{label:(0,t.__)("Top","cloudinary"),value:"top"},{label:(0,t.__)("Bottom","cloudinary"),value:"bottom"}],j=[{label:(0,t.__)("Thumbnails","cloudinary"),value:"thumbnails"},{label:(0,t.__)("Indicators","cloudinary"),value:"indicators"},{label:(0,t.__)("None","cloudinary"),value:"none"}],A=[{value:"round",icon:f,label:(0,t.__)("Round","cloudinary")},{value:"radius",icon:v,label:(0,t.__)("Radius","cloudinary")},{value:"none",icon:h,label:(0,t.__)("None","cloudinary")},{value:"square",icon:m,label:(0,t.__)("Square","cloudinary")},{value:"rectangle",icon:()=>d.createElement("svg",{width:"14px",height:"20px",viewBox:"0 0 14 20",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},d.createElement("title",null,"ratio-9-16"),d.createElement("desc",null,"Created with Sketch."),d.createElement("g",{id:"Desktop-0.4",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},d.createElement("g",{id:"ratio/9-16",transform:"translate(-5.000000, -2.000000)",fill:"#000000"},d.createElement("path",{d:"M22,5.5 L22,18.5 L2,18.5 L2,5.5 L22,5.5 Z M20,7.5 L4,7.5 L4,16.5 L20,16.5 L20,7.5 Z",id:"Combined-Shape",transform:"translate(12.000000, 12.000000) rotate(-90.000000) translate(-12.000000, -12.000000) "})))),label:(0,t.__)("Rectangle","cloudinary")}],k=[{value:"round",icon:f,label:(0,t.__)("Round","cloudinary")},{value:"radius",icon:v,label:(0,t.__)("Radius","cloudinary")},{value:"square",icon:m,label:(0,t.__)("Square","cloudinary")}],P=[{label:(0,t.__)("All","cloudinary"),value:"all"},{label:(0,t.__)("Border","cloudinary"),value:"border"},{label:(0,t.__)("Gradient","cloudinary"),value:"gradient"}],S=[{label:(0,t.__)("All","cloudinary"),value:"all"},{label:(0,t.__)("Top","cloudinary"),value:"top"},{label:(0,t.__)("Top-Bottom","cloudinary"),value:"top-bottom"},{label:(0,t.__)("Left-Right","cloudinary"),value:"left-right"},{label:(0,t.__)("Bottom","cloudinary"),value:"bottom"},{label:(0,t.__)("Left","cloudinary"),value:"left"},{label:(0,t.__)("Right","cloudinary"),value:"right"}],C=[{value:"round",icon:f,label:(0,t.__)("Round","cloudinary")},{value:"radius",icon:v,label:(0,t.__)("Radius","cloudinary")},{value:"none",icon:h,label:(0,t.__)("None","cloudinary")},{value:"square",icon:m,label:(0,t.__)("Square","cloudinary")}],M=[{label:(0,t.__)("Pad","cloudinary"),value:"pad"},{label:(0,t.__)("Fill","cloudinary"),value:"fill"}],B=[{label:(0,t.__)("White padding","cloudinary"),value:"rgb:FFFFFF"},{label:(0,t.__)("Border color padding","cloudinary"),value:"auto"},{label:(0,t.__)("Predominant color padding","cloudinary"),value:"auto:predominant"},{label:(0,t.__)("Gradient fade padding","cloudinary"),value:"auto:predominant_gradient"}];var T=r(6942),D=r.n(T),N=r(6087);const R=({value:e,children:t,icon:r,onChange:n,current:o})=>{const a="object"==typeof e?JSON.stringify(e)===JSON.stringify(o):o===e;return N.createElement("button",{type:"button",onClick:()=>n(e),className:D()("radio-select",{"radio-select--active":a})},N.createElement(r,null),N.createElement("div",{className:"radio-select__label"},t))};r.dn(R);const Z=window.wp.data,z=e=>e<10?"0"+String(e):e.toString(16),I=e=>{const t=new Uint8Array((e||40)/2);return window.crypto.getRandomValues(t),Array.from(t,z).join("")},F=e=>{const t=/var\((.*)\)/g.exec(e);return t?getComputedStyle(document.documentElement).getPropertyValue(t[1]):e};function W(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function H(e){return e instanceof W(e).Element||e instanceof Element}function V(e){return e instanceof W(e).HTMLElement||e instanceof HTMLElement}function U(e){return"undefined"!=typeof ShadowRoot&&(e instanceof W(e).ShadowRoot||e instanceof ShadowRoot)}var q=Math.max,$=Math.min,G=Math.round;function X(){var e=navigator.userAgentData;return null!=e&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function J(){return!/^((?!chrome|android).)*safari/i.test(X())}function Y(e,t,r){void 0===t&&(t=!1),void 0===r&&(r=!1);var n=e.getBoundingClientRect(),o=1,a=1;t&&V(e)&&(o=e.offsetWidth>0&&G(n.width)/e.offsetWidth||1,a=e.offsetHeight>0&&G(n.height)/e.offsetHeight||1);var i=(H(e)?W(e):window).visualViewport,s=!J()&&r,l=(n.left+(s&&i?i.offsetLeft:0))/o,c=(n.top+(s&&i?i.offsetTop:0))/a,u=n.width/o,p=n.height/a;return{width:u,height:p,top:c,right:l+u,bottom:c+p,left:l,x:l,y:c}}function K(e){var t=W(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function Q(e){return e?(e.nodeName||"").toLowerCase():null}function ee(e){return((H(e)?e.ownerDocument:e.document)||window.document).documentElement}function te(e){return Y(ee(e)).left+K(e).scrollLeft}function re(e){return W(e).getComputedStyle(e)}function ne(e){var t=re(e),r=t.overflow,n=t.overflowX,o=t.overflowY;return/auto|scroll|overlay|hidden/.test(r+o+n)}function oe(e,t,r){void 0===r&&(r=!1);var n,o,a=V(t),i=V(t)&&function(e){var t=e.getBoundingClientRect(),r=G(t.width)/e.offsetWidth||1,n=G(t.height)/e.offsetHeight||1;return 1!==r||1!==n}(t),s=ee(t),l=Y(e,i,r),c={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(a||!a&&!r)&&(("body"!==Q(t)||ne(s))&&(c=(n=t)!==W(n)&&V(n)?{scrollLeft:(o=n).scrollLeft,scrollTop:o.scrollTop}:K(n)),V(t)?((u=Y(t,!0)).x+=t.clientLeft,u.y+=t.clientTop):s&&(u.x=te(s))),{x:l.left+c.scrollLeft-u.x,y:l.top+c.scrollTop-u.y,width:l.width,height:l.height}}function ae(e){var t=Y(e),r=e.offsetWidth,n=e.offsetHeight;return Math.abs(t.width-r)<=1&&(r=t.width),Math.abs(t.height-n)<=1&&(n=t.height),{x:e.offsetLeft,y:e.offsetTop,width:r,height:n}}function ie(e){return"html"===Q(e)?e:e.assignedSlot||e.parentNode||(U(e)?e.host:null)||ee(e)}function se(e){return["html","body","#document"].indexOf(Q(e))>=0?e.ownerDocument.body:V(e)&&ne(e)?e:se(ie(e))}function le(e,t){var r;void 0===t&&(t=[]);var n=se(e),o=n===(null==(r=e.ownerDocument)?void 0:r.body),a=W(n),i=o?[a].concat(a.visualViewport||[],ne(n)?n:[]):n,s=t.concat(i);return o?s:s.concat(le(ie(i)))}function ce(e){return["table","td","th"].indexOf(Q(e))>=0}function ue(e){return V(e)&&"fixed"!==re(e).position?e.offsetParent:null}function pe(e){for(var t=W(e),r=ue(e);r&&ce(r)&&"static"===re(r).position;)r=ue(r);return r&&("html"===Q(r)||"body"===Q(r)&&"static"===re(r).position)?t:r||function(e){var t=/firefox/i.test(X());if(/Trident/i.test(X())&&V(e)&&"fixed"===re(e).position)return null;var r=ie(e);for(U(r)&&(r=r.host);V(r)&&["html","body"].indexOf(Q(r))<0;){var n=re(r);if("none"!==n.transform||"none"!==n.perspective||"paint"===n.contain||-1!==["transform","perspective"].indexOf(n.willChange)||t&&"filter"===n.willChange||t&&n.filter&&"none"!==n.filter)return r;r=r.parentNode}return null}(e)||t}var de="top",fe="bottom",me="right",ve="left",he="auto",ye=[de,fe,me,ve],ge="start",be="end",_e="viewport",xe="popper",we=ye.reduce(function(e,t){return e.concat([t+"-"+ge,t+"-"+be])},[]),Le=[].concat(ye,[he]).reduce(function(e,t){return e.concat([t,t+"-"+ge,t+"-"+be])},[]),Ee=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function Oe(e){var t=new Map,r=new Set,n=[];function o(e){r.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach(function(e){if(!r.has(e)){var n=t.get(e);n&&o(n)}}),n.push(e)}return e.forEach(function(e){t.set(e.name,e)}),e.forEach(function(e){r.has(e.name)||o(e)}),n}var je={placement:"bottom",modifiers:[],strategy:"absolute"};function Ae(){for(var e=arguments.length,t=new Array(e),r=0;r=0?"x":"y"}function Be(e){var t,r=e.reference,n=e.element,o=e.placement,a=o?Se(o):null,i=o?Ce(o):null,s=r.x+r.width/2-n.width/2,l=r.y+r.height/2-n.height/2;switch(a){case de:t={x:s,y:r.y-n.height};break;case fe:t={x:s,y:r.y+r.height};break;case me:t={x:r.x+r.width,y:l};break;case ve:t={x:r.x-n.width,y:l};break;default:t={x:r.x,y:r.y}}var c=a?Me(a):null;if(null!=c){var u="y"===c?"height":"width";switch(i){case ge:t[c]=t[c]-(r[u]/2-n[u]/2);break;case be:t[c]=t[c]+(r[u]/2-n[u]/2)}}return t}var Te={top:"auto",right:"auto",bottom:"auto",left:"auto"};function De(e){var t,r=e.popper,n=e.popperRect,o=e.placement,a=e.variation,i=e.offsets,s=e.position,l=e.gpuAcceleration,c=e.adaptive,u=e.roundOffsets,p=e.isFixed,d=i.x,f=void 0===d?0:d,m=i.y,v=void 0===m?0:m,h="function"==typeof u?u({x:f,y:v}):{x:f,y:v};f=h.x,v=h.y;var y=i.hasOwnProperty("x"),g=i.hasOwnProperty("y"),b=ve,_=de,x=window;if(c){var w=pe(r),L="clientHeight",E="clientWidth";if(w===W(r)&&"static"!==re(w=ee(r)).position&&"absolute"===s&&(L="scrollHeight",E="scrollWidth"),o===de||(o===ve||o===me)&&a===be)_=fe,v-=(p&&w===x&&x.visualViewport?x.visualViewport.height:w[L])-n.height,v*=l?1:-1;if(o===ve||(o===de||o===fe)&&a===be)b=me,f-=(p&&w===x&&x.visualViewport?x.visualViewport.width:w[E])-n.width,f*=l?1:-1}var O,j=Object.assign({position:s},c&&Te),A=!0===u?function(e,t){var r=e.x,n=e.y,o=t.devicePixelRatio||1;return{x:G(r*o)/o||0,y:G(n*o)/o||0}}({x:f,y:v},W(r)):{x:f,y:v};return f=A.x,v=A.y,l?Object.assign({},j,((O={})[_]=g?"0":"",O[b]=y?"0":"",O.transform=(x.devicePixelRatio||1)<=1?"translate("+f+"px, "+v+"px)":"translate3d("+f+"px, "+v+"px, 0)",O)):Object.assign({},j,((t={})[_]=g?v+"px":"",t[b]=y?f+"px":"",t.transform="",t))}const Ne={name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach(function(e){var r=t.styles[e]||{},n=t.attributes[e]||{},o=t.elements[e];V(o)&&Q(o)&&(Object.assign(o.style,r),Object.keys(n).forEach(function(e){var t=n[e];!1===t?o.removeAttribute(e):o.setAttribute(e,!0===t?"":t)}))})},effect:function(e){var t=e.state,r={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,r.popper),t.styles=r,t.elements.arrow&&Object.assign(t.elements.arrow.style,r.arrow),function(){Object.keys(t.elements).forEach(function(e){var n=t.elements[e],o=t.attributes[e]||{},a=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:r[e]).reduce(function(e,t){return e[t]="",e},{});V(n)&&Q(n)&&(Object.assign(n.style,a),Object.keys(o).forEach(function(e){n.removeAttribute(e)}))})}},requires:["computeStyles"]};const Re={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,r=e.options,n=e.name,o=r.offset,a=void 0===o?[0,0]:o,i=Le.reduce(function(e,r){return e[r]=function(e,t,r){var n=Se(e),o=[ve,de].indexOf(n)>=0?-1:1,a="function"==typeof r?r(Object.assign({},t,{placement:e})):r,i=a[0],s=a[1];return i=i||0,s=(s||0)*o,[ve,me].indexOf(n)>=0?{x:s,y:i}:{x:i,y:s}}(r,t.rects,a),e},{}),s=i[t.placement],l=s.x,c=s.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=c),t.modifiersData[n]=i}};var Ze={left:"right",right:"left",bottom:"top",top:"bottom"};function ze(e){return e.replace(/left|right|bottom|top/g,function(e){return Ze[e]})}var Ie={start:"end",end:"start"};function Fe(e){return e.replace(/start|end/g,function(e){return Ie[e]})}function We(e,t){var r=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(r&&U(r)){var n=t;do{if(n&&e.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function He(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function Ve(e,t,r){return t===_e?He(function(e,t){var r=W(e),n=ee(e),o=r.visualViewport,a=n.clientWidth,i=n.clientHeight,s=0,l=0;if(o){a=o.width,i=o.height;var c=J();(c||!c&&"fixed"===t)&&(s=o.offsetLeft,l=o.offsetTop)}return{width:a,height:i,x:s+te(e),y:l}}(e,r)):H(t)?function(e,t){var r=Y(e,!1,"fixed"===t);return r.top=r.top+e.clientTop,r.left=r.left+e.clientLeft,r.bottom=r.top+e.clientHeight,r.right=r.left+e.clientWidth,r.width=e.clientWidth,r.height=e.clientHeight,r.x=r.left,r.y=r.top,r}(t,r):He(function(e){var t,r=ee(e),n=K(e),o=null==(t=e.ownerDocument)?void 0:t.body,a=q(r.scrollWidth,r.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),i=q(r.scrollHeight,r.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),s=-n.scrollLeft+te(e),l=-n.scrollTop;return"rtl"===re(o||r).direction&&(s+=q(r.clientWidth,o?o.clientWidth:0)-a),{width:a,height:i,x:s,y:l}}(ee(e)))}function Ue(e,t,r,n){var o="clippingParents"===t?function(e){var t=le(ie(e)),r=["absolute","fixed"].indexOf(re(e).position)>=0&&V(e)?pe(e):e;return H(r)?t.filter(function(e){return H(e)&&We(e,r)&&"body"!==Q(e)}):[]}(e):[].concat(t),a=[].concat(o,[r]),i=a[0],s=a.reduce(function(t,r){var o=Ve(e,r,n);return t.top=q(o.top,t.top),t.right=$(o.right,t.right),t.bottom=$(o.bottom,t.bottom),t.left=q(o.left,t.left),t},Ve(e,i,n));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function qe(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function $e(e,t){return t.reduce(function(t,r){return t[r]=e,t},{})}function Ge(e,t){void 0===t&&(t={});var r=t,n=r.placement,o=void 0===n?e.placement:n,a=r.strategy,i=void 0===a?e.strategy:a,s=r.boundary,l=void 0===s?"clippingParents":s,c=r.rootBoundary,u=void 0===c?_e:c,p=r.elementContext,d=void 0===p?xe:p,f=r.altBoundary,m=void 0!==f&&f,v=r.padding,h=void 0===v?0:v,y=qe("number"!=typeof h?h:$e(h,ye)),g=d===xe?"reference":xe,b=e.rects.popper,_=e.elements[m?g:d],x=Ue(H(_)?_:_.contextElement||ee(e.elements.popper),l,u,i),w=Y(e.elements.reference),L=Be({reference:w,element:b,strategy:"absolute",placement:o}),E=He(Object.assign({},b,L)),O=d===xe?E:w,j={top:x.top-O.top+y.top,bottom:O.bottom-x.bottom+y.bottom,left:x.left-O.left+y.left,right:O.right-x.right+y.right},A=e.modifiersData.offset;if(d===xe&&A){var k=A[o];Object.keys(j).forEach(function(e){var t=[me,fe].indexOf(e)>=0?1:-1,r=[de,fe].indexOf(e)>=0?"y":"x";j[e]+=k[r]*t})}return j}function Xe(e,t,r){return q(e,$(t,r))}const Je={name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,r=e.options,n=e.name,o=r.mainAxis,a=void 0===o||o,i=r.altAxis,s=void 0!==i&&i,l=r.boundary,c=r.rootBoundary,u=r.altBoundary,p=r.padding,d=r.tether,f=void 0===d||d,m=r.tetherOffset,v=void 0===m?0:m,h=Ge(t,{boundary:l,rootBoundary:c,padding:p,altBoundary:u}),y=Se(t.placement),g=Ce(t.placement),b=!g,_=Me(y),x="x"===_?"y":"x",w=t.modifiersData.popperOffsets,L=t.rects.reference,E=t.rects.popper,O="function"==typeof v?v(Object.assign({},t.rects,{placement:t.placement})):v,j="number"==typeof O?{mainAxis:O,altAxis:O}:Object.assign({mainAxis:0,altAxis:0},O),A=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,k={x:0,y:0};if(w){if(a){var P,S="y"===_?de:ve,C="y"===_?fe:me,M="y"===_?"height":"width",B=w[_],T=B+h[S],D=B-h[C],N=f?-E[M]/2:0,R=g===ge?L[M]:E[M],Z=g===ge?-E[M]:-L[M],z=t.elements.arrow,I=f&&z?ae(z):{width:0,height:0},F=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},W=F[S],H=F[C],V=Xe(0,L[M],I[M]),U=b?L[M]/2-N-V-W-j.mainAxis:R-V-W-j.mainAxis,G=b?-L[M]/2+N+V+H+j.mainAxis:Z+V+H+j.mainAxis,X=t.elements.arrow&&pe(t.elements.arrow),J=X?"y"===_?X.clientTop||0:X.clientLeft||0:0,Y=null!=(P=null==A?void 0:A[_])?P:0,K=B+G-Y,Q=Xe(f?$(T,B+U-Y-J):T,B,f?q(D,K):D);w[_]=Q,k[_]=Q-B}if(s){var ee,te="x"===_?de:ve,re="x"===_?fe:me,ne=w[x],oe="y"===x?"height":"width",ie=ne+h[te],se=ne-h[re],le=-1!==[de,ve].indexOf(y),ce=null!=(ee=null==A?void 0:A[x])?ee:0,ue=le?ie:ne-L[oe]-E[oe]-ce+j.altAxis,he=le?ne+L[oe]+E[oe]-ce-j.altAxis:se,ye=f&&le?function(e,t,r){var n=Xe(e,t,r);return n>r?r:n}(ue,ne,he):Xe(f?ue:ie,ne,f?he:se);w[x]=ye,k[x]=ye-ne}t.modifiersData[n]=k}},requiresIfExists:["offset"]};const Ye={name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,r=e.state,n=e.name,o=e.options,a=r.elements.arrow,i=r.modifiersData.popperOffsets,s=Se(r.placement),l=Me(s),c=[ve,me].indexOf(s)>=0?"height":"width";if(a&&i){var u=function(e,t){return qe("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:$e(e,ye))}(o.padding,r),p=ae(a),d="y"===l?de:ve,f="y"===l?fe:me,m=r.rects.reference[c]+r.rects.reference[l]-i[l]-r.rects.popper[c],v=i[l]-r.rects.reference[l],h=pe(a),y=h?"y"===l?h.clientHeight||0:h.clientWidth||0:0,g=m/2-v/2,b=u[d],_=y-p[c]-u[f],x=y/2-p[c]/2+g,w=Xe(b,x,_),L=l;r.modifiersData[n]=((t={})[L]=w,t.centerOffset=w-x,t)}},effect:function(e){var t=e.state,r=e.options.element,n=void 0===r?"[data-popper-arrow]":r;null!=n&&("string"!=typeof n||(n=t.elements.popper.querySelector(n)))&&We(t.elements.popper,n)&&(t.elements.arrow=n)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Ke(e,t,r){return void 0===r&&(r={x:0,y:0}),{top:e.top-t.height-r.y,right:e.right-t.width+r.x,bottom:e.bottom-t.height+r.y,left:e.left-t.width-r.x}}function Qe(e){return[de,me,fe,ve].some(function(t){return e[t]>=0})}var et=ke({defaultModifiers:[{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var t=e.state,r=e.instance,n=e.options,o=n.scroll,a=void 0===o||o,i=n.resize,s=void 0===i||i,l=W(t.elements.popper),c=[].concat(t.scrollParents.reference,t.scrollParents.popper);return a&&c.forEach(function(e){e.addEventListener("scroll",r.update,Pe)}),s&&l.addEventListener("resize",r.update,Pe),function(){a&&c.forEach(function(e){e.removeEventListener("scroll",r.update,Pe)}),s&&l.removeEventListener("resize",r.update,Pe)}},data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,r=e.name;t.modifiersData[r]=Be({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}},{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,r=e.options,n=r.gpuAcceleration,o=void 0===n||n,a=r.adaptive,i=void 0===a||a,s=r.roundOffsets,l=void 0===s||s,c={placement:Se(t.placement),variation:Ce(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:o,isFixed:"fixed"===t.options.strategy};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,De(Object.assign({},c,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:i,roundOffsets:l})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,De(Object.assign({},c,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}},Ne,Re,{name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,r=e.options,n=e.name;if(!t.modifiersData[n]._skip){for(var o=r.mainAxis,a=void 0===o||o,i=r.altAxis,s=void 0===i||i,l=r.fallbackPlacements,c=r.padding,u=r.boundary,p=r.rootBoundary,d=r.altBoundary,f=r.flipVariations,m=void 0===f||f,v=r.allowedAutoPlacements,h=t.options.placement,y=Se(h),g=l||(y===h||!m?[ze(h)]:function(e){if(Se(e)===he)return[];var t=ze(e);return[Fe(e),t,Fe(t)]}(h)),b=[h].concat(g).reduce(function(e,r){return e.concat(Se(r)===he?function(e,t){void 0===t&&(t={});var r=t,n=r.placement,o=r.boundary,a=r.rootBoundary,i=r.padding,s=r.flipVariations,l=r.allowedAutoPlacements,c=void 0===l?Le:l,u=Ce(n),p=u?s?we:we.filter(function(e){return Ce(e)===u}):ye,d=p.filter(function(e){return c.indexOf(e)>=0});0===d.length&&(d=p);var f=d.reduce(function(t,r){return t[r]=Ge(e,{placement:r,boundary:o,rootBoundary:a,padding:i})[Se(r)],t},{});return Object.keys(f).sort(function(e,t){return f[e]-f[t]})}(t,{placement:r,boundary:u,rootBoundary:p,padding:c,flipVariations:m,allowedAutoPlacements:v}):r)},[]),_=t.rects.reference,x=t.rects.popper,w=new Map,L=!0,E=b[0],O=0;O=0,S=P?"width":"height",C=Ge(t,{placement:j,boundary:u,rootBoundary:p,altBoundary:d,padding:c}),M=P?k?me:ve:k?fe:de;_[S]>x[S]&&(M=ze(M));var B=ze(M),T=[];if(a&&T.push(C[A]<=0),s&&T.push(C[M]<=0,C[B]<=0),T.every(function(e){return e})){E=j,L=!1;break}w.set(j,T)}if(L)for(var D=function(e){var t=b.find(function(t){var r=w.get(t);if(r)return r.slice(0,e).every(function(e){return e})});if(t)return E=t,"break"},N=m?3:1;N>0;N--){if("break"===D(N))break}t.placement!==E&&(t.modifiersData[n]._skip=!0,t.placement=E,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}},Je,Ye,{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,r=e.name,n=t.rects.reference,o=t.rects.popper,a=t.modifiersData.preventOverflow,i=Ge(t,{elementContext:"reference"}),s=Ge(t,{altBoundary:!0}),l=Ke(i,n),c=Ke(s,o,a),u=Qe(l),p=Qe(c);t.modifiersData[r]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:u,hasPopperEscaped:p},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":p})}}]}),tt="tippy-content",rt="tippy-backdrop",nt="tippy-arrow",ot="tippy-svg-arrow",at={passive:!0,capture:!0},it=function(){return document.body};function st(e,t,r){if(Array.isArray(e)){var n=e[t];return n??(Array.isArray(r)?r[t]:r)}return e}function lt(e,t){var r={}.toString.call(e);return 0===r.indexOf("[object")&&r.indexOf(t+"]")>-1}function ct(e,t){return"function"==typeof e?e.apply(void 0,t):e}function ut(e,t){return 0===t?e:function(n){clearTimeout(r),r=setTimeout(function(){e(n)},t)};var r}function pt(e){return[].concat(e)}function dt(e,t){-1===e.indexOf(t)&&e.push(t)}function ft(e){return e.split("-")[0]}function mt(e){return[].slice.call(e)}function vt(e){return Object.keys(e).reduce(function(t,r){return void 0!==e[r]&&(t[r]=e[r]),t},{})}function ht(){return document.createElement("div")}function yt(e){return["Element","Fragment"].some(function(t){return lt(e,t)})}function gt(e){return lt(e,"MouseEvent")}function bt(e){return!(!e||!e._tippy||e._tippy.reference!==e)}function _t(e){return yt(e)?[e]:function(e){return lt(e,"NodeList")}(e)?mt(e):Array.isArray(e)?e:mt(document.querySelectorAll(e))}function xt(e,t){e.forEach(function(e){e&&(e.style.transitionDuration=t+"ms")})}function wt(e,t){e.forEach(function(e){e&&e.setAttribute("data-state",t)})}function Lt(e){var t,r=pt(e)[0];return null!=r&&null!=(t=r.ownerDocument)&&t.body?r.ownerDocument:document}function Et(e,t,r){var n=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(t){e[n](t,r)})}function Ot(e,t){for(var r=t;r;){var n;if(e.contains(r))return!0;r=null==r.getRootNode||null==(n=r.getRootNode())?void 0:n.host}return!1}var jt={isTouch:!1},At=0;function kt(){jt.isTouch||(jt.isTouch=!0,window.performance&&document.addEventListener("mousemove",Pt))}function Pt(){var e=performance.now();e-At<20&&(jt.isTouch=!1,document.removeEventListener("mousemove",Pt)),At=e}function St(){var e=document.activeElement;if(bt(e)){var t=e._tippy;e.blur&&!t.state.isVisible&&e.blur()}}var Ct=!!("undefined"!=typeof window&&"undefined"!=typeof document)&&!!window.msCrypto;var Mt={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},Bt=Object.assign({appendTo:it,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},Mt,{allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999}),Tt=Object.keys(Bt);function Dt(e){var t=(e.plugins||[]).reduce(function(t,r){var n,o=r.name,a=r.defaultValue;o&&(t[o]=void 0!==e[o]?e[o]:null!=(n=Bt[o])?n:a);return t},{});return Object.assign({},e,t)}function Nt(e,t){var r=Object.assign({},t,{content:ct(t.content,[e])},t.ignoreAttributes?{}:function(e,t){return(t?Object.keys(Dt(Object.assign({},Bt,{plugins:t}))):Tt).reduce(function(t,r){var n=(e.getAttribute("data-tippy-"+r)||"").trim();if(!n)return t;if("content"===r)t[r]=n;else try{t[r]=JSON.parse(n)}catch(e){t[r]=n}return t},{})}(e,t.plugins));return r.aria=Object.assign({},Bt.aria,r.aria),r.aria={expanded:"auto"===r.aria.expanded?t.interactive:r.aria.expanded,content:"auto"===r.aria.content?t.interactive?null:"describedby":r.aria.content},r}function Rt(e,t){e.innerHTML=t}function Zt(e){var t=ht();return!0===e?t.className=nt:(t.className=ot,yt(e)?t.appendChild(e):Rt(t,e)),t}function zt(e,t){yt(t.content)?(Rt(e,""),e.appendChild(t.content)):"function"!=typeof t.content&&(t.allowHTML?Rt(e,t.content):e.textContent=t.content)}function It(e){var t=e.firstElementChild,r=mt(t.children);return{box:t,content:r.find(function(e){return e.classList.contains(tt)}),arrow:r.find(function(e){return e.classList.contains(nt)||e.classList.contains(ot)}),backdrop:r.find(function(e){return e.classList.contains(rt)})}}function Ft(e){var t=ht(),r=ht();r.className="tippy-box",r.setAttribute("data-state","hidden"),r.setAttribute("tabindex","-1");var n=ht();function o(r,n){var o=It(t),a=o.box,i=o.content,s=o.arrow;n.theme?a.setAttribute("data-theme",n.theme):a.removeAttribute("data-theme"),"string"==typeof n.animation?a.setAttribute("data-animation",n.animation):a.removeAttribute("data-animation"),n.inertia?a.setAttribute("data-inertia",""):a.removeAttribute("data-inertia"),a.style.maxWidth="number"==typeof n.maxWidth?n.maxWidth+"px":n.maxWidth,n.role?a.setAttribute("role",n.role):a.removeAttribute("role"),r.content===n.content&&r.allowHTML===n.allowHTML||zt(i,e.props),n.arrow?s?r.arrow!==n.arrow&&(a.removeChild(s),a.appendChild(Zt(n.arrow))):a.appendChild(Zt(n.arrow)):s&&a.removeChild(s)}return n.className=tt,n.setAttribute("data-state","hidden"),zt(n,e.props),t.appendChild(r),r.appendChild(n),o(e.props,e.props),{popper:t,onUpdate:o}}Ft.$$tippy=!0;var Wt=1,Ht=[],Vt=[];function Ut(e,t){var r,n,o,a,i,s,l,c,u=Nt(e,Object.assign({},Bt,Dt(vt(t)))),p=!1,d=!1,f=!1,m=!1,v=[],h=ut($,u.interactiveDebounce),y=Wt++,g=(c=u.plugins).filter(function(e,t){return c.indexOf(e)===t}),b={id:y,reference:e,popper:ht(),popperInstance:null,props:u,state:{isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},plugins:g,clearDelayTimeouts:function(){clearTimeout(r),clearTimeout(n),cancelAnimationFrame(o)},setProps:function(t){0;if(b.state.isDestroyed)return;B("onBeforeUpdate",[b,t]),U();var r=b.props,n=Nt(e,Object.assign({},r,vt(t),{ignoreAttributes:!0}));b.props=n,V(),r.interactiveDebounce!==n.interactiveDebounce&&(N(),h=ut($,n.interactiveDebounce));r.triggerTarget&&!n.triggerTarget?pt(r.triggerTarget).forEach(function(e){e.removeAttribute("aria-expanded")}):n.triggerTarget&&e.removeAttribute("aria-expanded");D(),M(),w&&w(r,n);b.popperInstance&&(Y(),Q().forEach(function(e){requestAnimationFrame(e._tippy.popperInstance.forceUpdate)}));B("onAfterUpdate",[b,t])},setContent:function(e){b.setProps({content:e})},show:function(){0;var e=b.state.isVisible,t=b.state.isDestroyed,r=!b.state.isEnabled,n=jt.isTouch&&!b.props.touch,o=st(b.props.duration,0,Bt.duration);if(e||t||r||n)return;if(k().hasAttribute("disabled"))return;if(B("onShow",[b],!1),!1===b.props.onShow(b))return;b.state.isVisible=!0,A()&&(x.style.visibility="visible");M(),I(),b.state.isMounted||(x.style.transition="none");if(A()){var a=S();xt([a.box,a.content],0)}s=function(){var e;if(b.state.isVisible&&!m){if(m=!0,x.offsetHeight,x.style.transition=b.props.moveTransition,A()&&b.props.animation){var t=S(),r=t.box,n=t.content;xt([r,n],o),wt([r,n],"visible")}T(),D(),dt(Vt,b),null==(e=b.popperInstance)||e.forceUpdate(),B("onMount",[b]),b.props.animation&&A()&&function(e,t){W(e,t)}(o,function(){b.state.isShown=!0,B("onShown",[b])})}},function(){var e,t=b.props.appendTo,r=k();e=b.props.interactive&&t===it||"parent"===t?r.parentNode:ct(t,[r]);e.contains(x)||e.appendChild(x);b.state.isMounted=!0,Y(),!1}()},hide:function(){0;var e=!b.state.isVisible,t=b.state.isDestroyed,r=!b.state.isEnabled,n=st(b.props.duration,1,Bt.duration);if(e||t||r)return;if(B("onHide",[b],!1),!1===b.props.onHide(b))return;b.state.isVisible=!1,b.state.isShown=!1,m=!1,p=!1,A()&&(x.style.visibility="hidden");if(N(),F(),M(!0),A()){var o=S(),a=o.box,i=o.content;b.props.animation&&(xt([a,i],n),wt([a,i],"hidden"))}T(),D(),b.props.animation?A()&&function(e,t){W(e,function(){!b.state.isVisible&&x.parentNode&&x.parentNode.contains(x)&&t()})}(n,b.unmount):b.unmount()},hideWithInteractivity:function(e){0;P().addEventListener("mousemove",h),dt(Ht,h),h(e)},enable:function(){b.state.isEnabled=!0},disable:function(){b.hide(),b.state.isEnabled=!1},unmount:function(){0;b.state.isVisible&&b.hide();if(!b.state.isMounted)return;K(),Q().forEach(function(e){e._tippy.unmount()}),x.parentNode&&x.parentNode.removeChild(x);Vt=Vt.filter(function(e){return e!==b}),b.state.isMounted=!1,B("onHidden",[b])},destroy:function(){0;if(b.state.isDestroyed)return;b.clearDelayTimeouts(),b.unmount(),U(),delete e._tippy,b.state.isDestroyed=!0,B("onDestroy",[b])}};if(!u.render)return b;var _=u.render(b),x=_.popper,w=_.onUpdate;x.setAttribute("data-tippy-root",""),x.id="tippy-"+b.id,b.popper=x,e._tippy=b,x._tippy=b;var L=g.map(function(e){return e.fn(b)}),E=e.hasAttribute("aria-expanded");return V(),D(),M(),B("onCreate",[b]),u.showOnCreate&&ee(),x.addEventListener("mouseenter",function(){b.props.interactive&&b.state.isVisible&&b.clearDelayTimeouts()}),x.addEventListener("mouseleave",function(){b.props.interactive&&b.props.trigger.indexOf("mouseenter")>=0&&P().addEventListener("mousemove",h)}),b;function O(){var e=b.props.touch;return Array.isArray(e)?e:[e,0]}function j(){return"hold"===O()[0]}function A(){var e;return!(null==(e=b.props.render)||!e.$$tippy)}function k(){return l||e}function P(){var e=k().parentNode;return e?Lt(e):document}function S(){return It(x)}function C(e){return b.state.isMounted&&!b.state.isVisible||jt.isTouch||a&&"focus"===a.type?0:st(b.props.delay,e?0:1,Bt.delay)}function M(e){void 0===e&&(e=!1),x.style.pointerEvents=b.props.interactive&&!e?"":"none",x.style.zIndex=""+b.props.zIndex}function B(e,t,r){var n;(void 0===r&&(r=!0),L.forEach(function(r){r[e]&&r[e].apply(r,t)}),r)&&(n=b.props)[e].apply(n,t)}function T(){var t=b.props.aria;if(t.content){var r="aria-"+t.content,n=x.id;pt(b.props.triggerTarget||e).forEach(function(e){var t=e.getAttribute(r);if(b.state.isVisible)e.setAttribute(r,t?t+" "+n:n);else{var o=t&&t.replace(n,"").trim();o?e.setAttribute(r,o):e.removeAttribute(r)}})}}function D(){!E&&b.props.aria.expanded&&pt(b.props.triggerTarget||e).forEach(function(e){b.props.interactive?e.setAttribute("aria-expanded",b.state.isVisible&&e===k()?"true":"false"):e.removeAttribute("aria-expanded")})}function N(){P().removeEventListener("mousemove",h),Ht=Ht.filter(function(e){return e!==h})}function R(t){if(!jt.isTouch||!f&&"mousedown"!==t.type){var r=t.composedPath&&t.composedPath()[0]||t.target;if(!b.props.interactive||!Ot(x,r)){if(pt(b.props.triggerTarget||e).some(function(e){return Ot(e,r)})){if(jt.isTouch)return;if(b.state.isVisible&&b.props.trigger.indexOf("click")>=0)return}else B("onClickOutside",[b,t]);!0===b.props.hideOnClick&&(b.clearDelayTimeouts(),b.hide(),d=!0,setTimeout(function(){d=!1}),b.state.isMounted||F())}}}function Z(){f=!0}function z(){f=!1}function I(){var e=P();e.addEventListener("mousedown",R,!0),e.addEventListener("touchend",R,at),e.addEventListener("touchstart",z,at),e.addEventListener("touchmove",Z,at)}function F(){var e=P();e.removeEventListener("mousedown",R,!0),e.removeEventListener("touchend",R,at),e.removeEventListener("touchstart",z,at),e.removeEventListener("touchmove",Z,at)}function W(e,t){var r=S().box;function n(e){e.target===r&&(Et(r,"remove",n),t())}if(0===e)return t();Et(r,"remove",i),Et(r,"add",n),i=n}function H(t,r,n){void 0===n&&(n=!1),pt(b.props.triggerTarget||e).forEach(function(e){e.addEventListener(t,r,n),v.push({node:e,eventType:t,handler:r,options:n})})}function V(){var e;j()&&(H("touchstart",q,{passive:!0}),H("touchend",G,{passive:!0})),(e=b.props.trigger,e.split(/\s+/).filter(Boolean)).forEach(function(e){if("manual"!==e)switch(H(e,q),e){case"mouseenter":H("mouseleave",G);break;case"focus":H(Ct?"focusout":"blur",X);break;case"focusin":H("focusout",X)}})}function U(){v.forEach(function(e){var t=e.node,r=e.eventType,n=e.handler,o=e.options;t.removeEventListener(r,n,o)}),v=[]}function q(e){var t,r=!1;if(b.state.isEnabled&&!J(e)&&!d){var n="focus"===(null==(t=a)?void 0:t.type);a=e,l=e.currentTarget,D(),!b.state.isVisible&>(e)&&Ht.forEach(function(t){return t(e)}),"click"===e.type&&(b.props.trigger.indexOf("mouseenter")<0||p)&&!1!==b.props.hideOnClick&&b.state.isVisible?r=!0:ee(e),"click"===e.type&&(p=!r),r&&!n&&te(e)}}function $(e){var t=e.target,r=k().contains(t)||x.contains(t);if("mousemove"!==e.type||!r){var n=Q().concat(x).map(function(e){var t,r=null==(t=e._tippy.popperInstance)?void 0:t.state;return r?{popperRect:e.getBoundingClientRect(),popperState:r,props:u}:null}).filter(Boolean);(function(e,t){var r=t.clientX,n=t.clientY;return e.every(function(e){var t=e.popperRect,o=e.popperState,a=e.props.interactiveBorder,i=ft(o.placement),s=o.modifiersData.offset;if(!s)return!0;var l="bottom"===i?s.top.y:0,c="top"===i?s.bottom.y:0,u="right"===i?s.left.x:0,p="left"===i?s.right.x:0,d=t.top-n+l>a,f=n-t.bottom-c>a,m=t.left-r+u>a,v=r-t.right-p>a;return d||f||m||v})})(n,e)&&(N(),te(e))}}function G(e){J(e)||b.props.trigger.indexOf("click")>=0&&p||(b.props.interactive?b.hideWithInteractivity(e):te(e))}function X(e){b.props.trigger.indexOf("focusin")<0&&e.target!==k()||b.props.interactive&&e.relatedTarget&&x.contains(e.relatedTarget)||te(e)}function J(e){return!!jt.isTouch&&j()!==e.type.indexOf("touch")>=0}function Y(){K();var t=b.props,r=t.popperOptions,n=t.placement,o=t.offset,a=t.getReferenceClientRect,i=t.moveTransition,l=A()?It(x).arrow:null,c=a?{getBoundingClientRect:a,contextElement:a.contextElement||k()}:e,u={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(e){var t=e.state;if(A()){var r=S().box;["placement","reference-hidden","escaped"].forEach(function(e){"placement"===e?r.setAttribute("data-placement",t.placement):t.attributes.popper["data-popper-"+e]?r.setAttribute("data-"+e,""):r.removeAttribute("data-"+e)}),t.attributes.popper={}}}},p=[{name:"offset",options:{offset:o}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!i}},u];A()&&l&&p.push({name:"arrow",options:{element:l,padding:3}}),p.push.apply(p,(null==r?void 0:r.modifiers)||[]),b.popperInstance=et(c,x,Object.assign({},r,{placement:n,onFirstUpdate:s,modifiers:p}))}function K(){b.popperInstance&&(b.popperInstance.destroy(),b.popperInstance=null)}function Q(){return mt(x.querySelectorAll("[data-tippy-root]"))}function ee(e){b.clearDelayTimeouts(),e&&B("onTrigger",[b,e]),I();var t=C(!0),n=O(),o=n[0],a=n[1];jt.isTouch&&"hold"===o&&a&&(t=a),t?r=setTimeout(function(){b.show()},t):b.show()}function te(e){if(b.clearDelayTimeouts(),B("onUntrigger",[b,e]),b.state.isVisible){if(!(b.props.trigger.indexOf("mouseenter")>=0&&b.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(e.type)>=0&&p)){var t=C(!1);t?n=setTimeout(function(){b.state.isVisible&&b.hide()},t):o=requestAnimationFrame(function(){b.hide()})}}else F()}}function qt(e,t){void 0===t&&(t={});var r=Bt.plugins.concat(t.plugins||[]);document.addEventListener("touchstart",kt,at),window.addEventListener("blur",St);var n=Object.assign({},t,{plugins:r}),o=_t(e).reduce(function(e,t){var r=t&&Ut(t,n);return r&&e.push(r),e},[]);return yt(e)?o[0]:o}qt.defaultProps=Bt,qt.setDefaultProps=function(e){Object.keys(e).forEach(function(t){Bt[t]=e[t]})},qt.currentInput=jt;Object.assign({},Ne,{effect:function(e){var t=e.state,r={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(t.elements.popper.style,r.popper),t.styles=r,t.elements.arrow&&Object.assign(t.elements.arrow.style,r.arrow)}});qt.setDefaultProps({render:Ft});const $t=qt;var Gt=r(6087);const Xt=({children:e,value:t})=>Gt.createElement("div",{className:"colorpalette-color-label"},Gt.createElement("span",null,e),Gt.createElement("span",{className:"component-color-indicator","aria-label":`Color: ${t}`,style:{background:t}})),Jt=new(o()())("_"),Yt=({attributes:e,setAttributes:r,colors:n})=>{const o=p()(e),a=Jt.object(o),[i,u]=(0,l.useState)(a.customSettings);e.transformation_crop||(e.transformation_crop="pad",e.transformation_background="rgb:FFFFFF"),"fill"===e.transformation_crop&&delete e.transformation_background;const d=(e,t)=>{const n={[t]:F(e)};r(n)},f=(e=>{const[t,r]=(0,l.useState)(null),n=(0,l.useCallback)(e=>r(e),[]);return(0,l.useEffect)(()=>{if(!t)return;const r=$t(t,{content:e});return()=>{r?.destroy()}},[t,e]),n})((0,t.__)("How to resize or crop images to fit the gallery. Pad adds padding around the image using the specified padding style. Fill crops the image from the center so it fills as much of the available space as possible.","cloudinary"));return Gt.createElement(Gt.Fragment,null,Gt.createElement(s.PanelBody,{title:(0,t.__)("Layout","cloudinary")},y.map(t=>Gt.createElement(R,{key:`${t.value.type}-${t.value.columns}-layout`,value:t.value,onChange:e=>{r({displayProps_mode:e.type,displayProps_columns:e.columns||1})},icon:t.icon,current:{type:e.displayProps_mode,columns:e.displayProps_columns||1}},t.label))),Gt.createElement(s.PanelBody,{title:(0,t.__)("Color Palette","cloudinary"),initialOpen:!1},Gt.createElement(Xt,{value:e.themeProps_primary},(0,t.__)("Primary","cloudinary")),Gt.createElement(c.ColorPalette,{value:e.themeProps_primary,colors:n,disableCustomColors:!1,onChange:e=>d(e,"themeProps_primary")}),Gt.createElement(Xt,{value:e.themeProps_onPrimary},(0,t.__)("On Primary","cloudinary")),Gt.createElement(c.ColorPalette,{value:e.themeProps_onPrimary,colors:n,disableCustomColors:!1,onChange:e=>d(e,"themeProps_onPrimary")}),Gt.createElement(Xt,{value:e.themeProps_active},(0,t.__)("Active","cloudinary")),Gt.createElement(c.ColorPalette,{value:e.themeProps_active,colors:n,disableCustomColors:!1,onChange:e=>d(e,"themeProps_active")})),"classic"===e.displayProps_mode&&Gt.createElement(s.PanelBody,{title:(0,t.__)("Fade Transition","cloudinary"),initialOpen:!1},Gt.createElement(s.SelectControl,{value:e.transition,options:_,onChange:e=>r({transition:e}),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0})),Gt.createElement(s.PanelBody,{title:(0,t.__)("Main Viewer Parameters","cloudinary"),initialOpen:!1},Gt.createElement(s.SelectControl,{label:(0,t.__)("Aspect Ratio","cloudinary"),value:e.aspectRatio,options:b,onChange:e=>r({aspectRatio:e}),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0}),Gt.createElement("p",null,Gt.createElement("div",{className:"cld-ui-title"},(0,t.__)("Resize/Crop Mode","cloudinary"),Gt.createElement("span",{className:"dashicons dashicons-info cld-tooltip",ref:f})),Gt.createElement(s.ButtonGroup,null,M.map(t=>Gt.createElement(s.Button,{key:t.value+"-look-and-feel",variant:"secondary",isSecondary:!0,isPressed:t.value===e.transformation_crop,onClick:()=>r({transformation_crop:t.value,transformation_background:null})},t.label)))),"pad"===e.transformation_crop&&Gt.createElement(s.SelectControl,{label:(0,t.__)("Pad style","cloudinary"),value:e.transformation_background,options:B,onChange:e=>{r({transformation_background:e})},__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0}),Gt.createElement("p",null,(0,t.__)("Navigation","cloudinary")),Gt.createElement("p",null,Gt.createElement(s.ButtonGroup,null,x.map(t=>Gt.createElement(s.Button,{key:t.value+"-navigation",variant:"secondary",isSecondary:!0,isPressed:t.value===e.navigation,onClick:()=>r({navigation:t.value})},t.label)))),Gt.createElement("div",{style:{marginTop:"30px"}},Gt.createElement(s.ToggleControl,{label:(0,t.__)("Show Zoom","cloudinary"),checked:e.zoom,onChange:()=>r({zoom:!e.zoom}),__nextHasNoMarginBottom:!0}),e.zoom&&Gt.createElement(Gt.Fragment,null,Gt.createElement("p",null,(0,t.__)("Zoom Type","cloudinary")),Gt.createElement("p",null,Gt.createElement(s.ButtonGroup,null,w.map(t=>Gt.createElement(s.Button,{key:t.value+"-zoom-type",variant:"secondary",isSecondary:!0,isPressed:t.value===e.zoomProps_type,onClick:()=>r({zoomProps_type:t.value})},t.label)))),"flyout"===e.zoomProps_type&&Gt.createElement(s.SelectControl,{label:(0,t.__)("Zoom Viewer Position","cloudinary"),value:e.zoomProps_viewerPosition,options:L,onChange:e=>r({zoomProps_viewerPosition:e}),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0}),"popup"!==e.zoomProps_type&&Gt.createElement(Gt.Fragment,null,Gt.createElement("p",null,(0,t.__)("Zoom Trigger","cloudinary")),Gt.createElement("p",null,Gt.createElement(s.ButtonGroup,null,E.map(t=>Gt.createElement(s.Button,{key:t.value+"-zoom-trigger",variant:"secondary",isSecondary:!0,isPressed:t.value===e.zoomProps_trigger,onClick:()=>r({zoomProps_trigger:t.value})},t.label)))))))),Gt.createElement(s.PanelBody,{title:(0,t.__)("Carousel Parameters","cloudinary"),initialOpen:!1},Gt.createElement("p",null,(0,t.__)("Carousel Location","cloudinary")),Gt.createElement("p",null,Gt.createElement(s.ButtonGroup,null,O.map(t=>Gt.createElement(s.Button,{key:t.value+"-carousel-location",variant:"secondary",isSecondary:!0,isPressed:t.value===e.carouselLocation,onClick:()=>r({carouselLocation:t.value})},t.label)))),Gt.createElement(s.RangeControl,{label:(0,t.__)("Carousel Offset","cloudinary"),value:e.carouselOffset,onChange:e=>r({carouselOffset:e}),min:0,max:100,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0}),Gt.createElement("p",null,(0,t.__)("Carousel Style","cloudinary")),Gt.createElement("p",null,Gt.createElement(s.ButtonGroup,null,j.map(t=>Gt.createElement(s.Button,{key:t.value+"-carousel-style",variant:"secondary",isSecondary:!0,isPressed:t.value===e.carouselStyle,onClick:()=>r({carouselStyle:t.value})},t.label)))),"thumbnails"===e.carouselStyle&&Gt.createElement(Gt.Fragment,null,Gt.createElement(s.RangeControl,{label:(0,t.__)("Width","cloudinary"),value:e.thumbnailProps_width,onChange:e=>r({thumbnailProps_width:e}),min:5,max:300,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0}),Gt.createElement(s.RangeControl,{label:(0,t.__)("Height","cloudinary"),value:e.thumbnailProps_height,onChange:e=>r({thumbnailProps_height:e}),min:5,max:300,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0}),Gt.createElement("p",null,(0,t.__)("Navigation Button Shape","cloudinary")),A.map(t=>Gt.createElement(R,{key:t.value+"-navigation-button-shape",value:t.value,onChange:e=>r({thumbnailProps_navigationShape:e}),icon:t.icon,current:e.thumbnailProps_navigationShape},t.label)),Gt.createElement("p",null,(0,t.__)("Selected Style","cloudinary")),Gt.createElement("p",null,Gt.createElement(s.ButtonGroup,null,P.map(t=>Gt.createElement(s.Button,{key:t.value+"-selected-style",variant:"secondary",isSecondary:!0,isPressed:t.value===e.thumbnailProps_selectedStyle,onClick:()=>r({thumbnailProps_selectedStyle:t.value})},t.label)))),Gt.createElement(s.SelectControl,{label:(0,t.__)("Selected Border Position","cloudinary"),value:e.thumbnailProps_selectedBorderPosition,options:S,onChange:e=>r({thumbnailProps_selectedBorderPosition:e}),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0}),Gt.createElement(s.RangeControl,{label:(0,t.__)("Selected Border Width","cloudinary"),value:e.thumbnailProps_selectedBorderWidth,onChange:e=>r({thumbnailProps_selectedBorderWidth:e}),min:0,max:10,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0}),Gt.createElement("p",null,(0,t.__)("Media Shape Icon","cloudinary")),C.map(t=>Gt.createElement(R,{key:t.value+"-media",value:t.value,onChange:e=>r({thumbnailProps_mediaSymbolShape:e}),icon:t.icon,current:e.thumbnailProps_mediaSymbolShape},t.label))),"indicators"===e.carouselStyle&&Gt.createElement(Gt.Fragment,null,Gt.createElement("p",null,(0,t.__)("Indicators Shape","cloudinary")),k.map(t=>Gt.createElement(R,{key:t.value+"-indicator",value:t.value,onChange:e=>r({indicatorProps_shape:e}),icon:t.icon,current:e.indicatorProps_shape},t.label)))),Gt.createElement(s.PanelBody,{title:(0,t.__)("Additional Settings","cloudinary"),initialOpen:!1},Gt.createElement(s.TextareaControl,{label:(0,t.__)("Custom Settings","cloudinary"),help:(0,t.__)("Provide a JSON string of the settings you want to add and/or override.","cloudinary"),value:i,onChange:e=>{let t={};u(e);try{t=JSON.parse(e)}catch(e){}if("object"==typeof t){const e={...a};e.customSettings=t,r({...a,...e})}},__nextHasNoMarginBottom:!0})))};var Kt=r(6087);const Qt=new(o()())("_"),er=(0,t.__)("Drag images, upload new ones or select files from your library.","cloudinary"),tr=(e,t)=>({...e,container:"."+t,zoom:!1}),rr=e=>e?.cloudinary?.galleryWidget,nr=({setAttributes:e,attributes:r,isSelected:n})=>{const[a,u]=(0,l.useState)(null),[d,f]=(0,l.useState)(!1),m=(0,l.useRef)(null),v=(0,l.useMemo)(()=>{if(0!==r.selectedImages.length)return r;const e={},{container:t,...n}=Qt.dot(CLD_GALLERY_CONFIG);return Object.keys(n).forEach(t=>{r[t]||(e[t]=n[t])}),{...r,...e}},[r]),h=(0,l.useMemo)(()=>r.selectedImages.length?r.selectedImages.map(({attachmentId:e})=>({id:e})):[],[r]);(0,l.useEffect)(()=>{a&&((({status:e,message:t,options:r={}})=>{(0,Z.dispatch)("core/notices").createNotice(e,t,{isDismissible:!0,...r})})({status:"error",message:a}),u(null));const e=m.current;if(!r.selectedImages.length||!e)return;const t=e.ownerDocument.defaultView||window,n=e=>t===window?e:t.JSON.parse(JSON.stringify(e)),{customSettings:i,...s}=(e=>{const t=new(o()())("_"),r=p()(e),{selectedImages:n,...a}=t.object(r,{});return a.mediaAssets=n,"classic"!==a?.displayProps?.mode?delete a.transition:delete a.displayProps.columns,"pad"!==a?.transformation_crop&&delete a.transformation_background,"pad"!==a?.transformation?.crop&&delete a.transformation.background,a?.themeProps?.primary&&(a.themeProps.primary=F(a?.themeProps?.primary)),a?.themeProps?.onPrimary&&(a.themeProps.onPrimary=F(a?.themeProps?.onPrimary)),a?.themeProps?.active&&(a.themeProps.active=F(a?.themeProps?.active)),a})(r),l=(e=>{let t=e;if("string"==typeof e)try{t=JSON.parse(e)}catch{return{}}return!t||"object"!=typeof t||Array.isArray(t)?{}:t})(i);let c,d=!1;const v=()=>{if(d)return;const e=rr(t);if(e){try{c=e(n(tr({...s,...l},r.container)))}catch{c=e(n(tr(s,r.container)))}c.render(),f(!1)}else f(!1)};return rr(t)?v():"complete"!==t.document.readyState?t.addEventListener("load",v,{once:!0}):f(!1),()=>{d=!0,t.removeEventListener("load",v),c?.destroy()}},[a,r,e]);const y=!!r.selectedImages.length;(0,l.useEffect)(()=>{r.container||e({container:`cld-gallery-${I(15)}`})},[r.container,e]),(0,l.useEffect)(()=>{e(v)},[v,e]);const b=(0,c.useBlockProps)();return Kt.createElement("div",b,Kt.createElement(Kt.Fragment,null,Kt.createElement("div",{ref:m,className:r.container}),Kt.createElement("div",{className:"wp-block-cloudinary-gallery"},Kt.createElement(c.MediaPlaceholder,{labels:{title:!y&&(0,t.__)("Cloudinary Gallery","cloudinary"),instructions:!y&&er},icon:"format-gallery",disableMediaButtons:y&&!n,allowedTypes:g,addToGallery:y,isAppender:y,onSelect:r=>(async r=>{f(!0);try{const t=await i()({path:CLD_REST_ENDPOINT+"/image_data",method:"POST",data:{images:r}});e({selectedImages:t})}catch{f(!1),u((0,t.__)("Could not load selected images. Please try again.","cloudinary"))}})(r),value:h,multiple:!0},d&&Kt.createElement("div",{className:"loading-spinner-container"},Kt.createElement(s.Spinner,null))))),Kt.createElement(c.InspectorControls,null,Kt.createElement(Yt,{attributes:r,setAttributes:e})))};var or=r(6087);const ar=({attributes:e})=>or.createElement("div",{className:e.container}),ir=JSON.parse('{"aspectRatio":{"type":"string"},"navigation":{"type":"string"},"zoom":{"type":"boolean"},"carouselLocation":{"type":"string"},"carouselOffset":{"type":"number"},"carouselStyle":{"type":"string"},"displayProps_mode":{"type":"string"},"displayProps_columns":{"type":"number"},"indicatorProps_shape":{"type":"string"},"themeProps_primary":{"type":"string"},"themeProps_onPrimary":{"type":"string"},"themeProps_active":{"type":"string"},"zoomProps_type":{"type":"string"},"zoomProps_viewerPosition":{"type":"string"},"zoomProps_trigger":{"type":"string"},"thumbnailProps_width":{"type":"number"},"thumbnailProps_height":{"type":"number"},"thumbnailProps_navigationShape":{"type":"string"},"thumbnailProps_selectedStyle":{"type":"string"},"thumbnailProps_selectedBorderPosition":{"type":"string"},"thumbnailProps_selectedBorderWidth":{"type":"number"},"thumbnailProps_mediaSymbolShape":{"type":"string"},"cloudName":{"type":"string"},"container":{"type":"string"},"selectedImages":{"type":"array","default":[]},"transformation_crop":{"type":"string","default":"pad"},"transformation_background":{"type":"string"},"customSettings":{"type":"string"}}');(0,n.registerBlockType)("cloudinary/gallery",{apiVersion:2,title:(0,t.__)("Cloudinary Gallery","cloudinary"),description:(0,t.__)("Add a gallery powered by the Cloudinary Gallery Widget to your post.","cloudinary"),category:"widgets",icon:"format-gallery",attributes:ir,edit:nr,save:ar})})()})(); +(()=>{var e={5580(e,t,r){var n=r(6110)(r(9325),"DataView");e.exports=n},1549(e,t,r){var n=r(2032),o=r(3862),i=r(6721),a=r(2749),s=r(5749);function l(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t-1&&e%1==0&&e-1}},1175(e,t,r){var n=r(6025);e.exports=function(e,t){var r=this.__data__,o=n(r,e);return o<0?(++this.size,r.push([e,t])):r[o][1]=t,this}},3040(e,t,r){var n=r(1549),o=r(79),i=r(8223);e.exports=function(){this.size=0,this.__data__={hash:new n,map:new(i||o),string:new n}}},7670(e,t,r){var n=r(2651);e.exports=function(e){var t=n(this,e).delete(e);return this.size-=t?1:0,t}},289(e,t,r){var n=r(2651);e.exports=function(e){return n(this,e).get(e)}},4509(e,t,r){var n=r(2651);e.exports=function(e){return n(this,e).has(e)}},2949(e,t,r){var n=r(2651);e.exports=function(e,t){var r=n(this,e),o=r.size;return r.set(e,t),this.size+=r.size==o?0:1,this}},1042(e,t,r){var n=r(6110)(Object,"create");e.exports=n},3650(e,t,r){var n=r(4335)(Object.keys,Object);e.exports=n},181(e){e.exports=function(e){var t=[];if(null!=e)for(var r in Object(e))t.push(r);return t}},6009(e,t,r){e=r.nmd(e);var n=r(4840),o=t&&!t.nodeType&&t,i=o&&e&&!e.nodeType&&e,a=i&&i.exports===o&&n.process,s=function(){try{var e=i&&i.require&&i.require("util").types;return e||a&&a.binding&&a.binding("util")}catch(e){}}();e.exports=s},9350(e){var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},4335(e){e.exports=function(e,t){return function(r){return e(t(r))}}},9325(e,t,r){var n=r(4840),o="object"==typeof self&&self&&self.Object===Object&&self,i=n||o||Function("return this")();e.exports=i},1420(e,t,r){var n=r(79);e.exports=function(){this.__data__=new n,this.size=0}},938(e){e.exports=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}},3605(e){e.exports=function(e){return this.__data__.get(e)}},9817(e){e.exports=function(e){return this.__data__.has(e)}},945(e,t,r){var n=r(79),o=r(8223),i=r(3661);e.exports=function(e,t){var r=this.__data__;if(r instanceof n){var a=r.__data__;if(!o||a.length<199)return a.push([e,t]),this.size=++r.size,this;r=this.__data__=new i(a)}return r.set(e,t),this.size=r.size,this}},7473(e){var t=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return t.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},8055(e,t,r){var n=r(9999);e.exports=function(e){return n(e,5)}},5288(e){e.exports=function(e,t){return e===t||e!=e&&t!=t}},2428(e,t,r){var n=r(7534),o=r(346),i=Object.prototype,a=i.hasOwnProperty,s=i.propertyIsEnumerable,l=n(function(){return arguments}())?n:function(e){return o(e)&&a.call(e,"callee")&&!s.call(e,"callee")};e.exports=l},6449(e){var t=Array.isArray;e.exports=t},4894(e,t,r){var n=r(1882),o=r(294);e.exports=function(e){return null!=e&&o(e.length)&&!n(e)}},3656(e,t,r){e=r.nmd(e);var n=r(9325),o=r(9935),i=t&&!t.nodeType&&t,a=i&&e&&!e.nodeType&&e,s=a&&a.exports===i?n.Buffer:void 0,l=(s?s.isBuffer:void 0)||o;e.exports=l},1882(e,t,r){var n=r(2552),o=r(3805);e.exports=function(e){if(!o(e))return!1;var t=n(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},294(e){e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}},7730(e,t,r){var n=r(9172),o=r(7301),i=r(6009),a=i&&i.isMap,s=a?o(a):n;e.exports=s},3805(e){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},346(e){e.exports=function(e){return null!=e&&"object"==typeof e}},8440(e,t,r){var n=r(6038),o=r(7301),i=r(6009),a=i&&i.isSet,s=a?o(a):n;e.exports=s},7167(e,t,r){var n=r(4901),o=r(7301),i=r(6009),a=i&&i.isTypedArray,s=a?o(a):n;e.exports=s},5950(e,t,r){var n=r(695),o=r(8984),i=r(4894);e.exports=function(e){return i(e)?n(e):o(e)}},7241(e,t,r){var n=r(695),o=r(2903),i=r(4894);e.exports=function(e){return i(e)?n(e,!0):o(e)}},3345(e){e.exports=function(){return[]}},9935(e){e.exports=function(){return!1}},6087(e){"use strict";e.exports=window.wp.element},6942(e,t){var r;!function(){"use strict";var n={}.hasOwnProperty;function o(){for(var e="",t=0;t{const t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.cw=e=>{var t;return()=>{if(e){var r=e;e=0,t={exports:{}},r.call(t.exports,t,t.exports)}return t.exports}},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.hasOwn(e,t),r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),r.dn=e=>{var t=Object.getOwnPropertyDescriptor(e,"name");(!t||!t.writable&&t.configurable)&&Object.defineProperty(e,"name",{value:"default",configurable:!0})},(()=>{"use strict";var e=r.cw(e=>{function t(e,t){var r,n;if("function"==typeof t)void 0!==(n=t(e))&&(e=n);else if(Array.isArray(t))for(r=0;r=0&&(e=e.replace(/\[/g,t).replace(/]/g,""));var r=e.split(t);if(r.filter(s).length!==r.length)throw Error("Refusing to update blacklisted property "+e);return r}var c=Object.prototype.hasOwnProperty;function u(e,t,r,n){if(!(this instanceof u))return new u(e,t,r,n);void 0===t&&(t=!1),void 0===r&&(r=!0),void 0===n&&(n=!0),this.separator=e||".",this.override=t,this.useArray=r,this.useBrackets=n,this.keepArray=!1,this.cleanup=[]}var p=new u(".",!1,!0,!0);function d(e){return function(){return p[e].apply(p,arguments)}}u.prototype._fill=function(e,r,n,a){var s=e.shift();if(e.length>0){if(r[s]=r[s]||(this.useArray&&function(e){return/^\d+$/.test(e)}(e[0])?[]:{}),!o(r[s])){if(!this.override){if(!o(n)||!i(n))throw new Error("Trying to redefine `"+s+"` which is a "+typeof r[s]);return}r[s]={}}this._fill(e,r[s],n,a)}else{if(!this.override&&o(r[s])&&!i(r[s])){if(!o(n)||!i(n))throw new Error("Trying to redefine non-empty obj['"+s+"']");return}r[s]=t(n,a)}},u.prototype.object=function(e,r){var n=this;return Object.keys(e).forEach(function(o){var i=void 0===r?null:r[o],a=l(o,n.separator).join(n.separator);-1!==a.indexOf(n.separator)?(n._fill(a.split(n.separator),e,e[o],i),delete e[o]):e[o]=t(e[o],i)}),e},u.prototype.str=function(e,r,n,o){var i=l(e,this.separator).join(this.separator);return-1!==e.indexOf(this.separator)?this._fill(i.split(this.separator),n,r,o):n[e]=t(r,o),n},u.prototype.pick=function(e,t,n,o){var i,a,s,c,u;for(a=l(e,this.separator),i=0;id.createElement("svg",{width:"18px",height:"18px",viewBox:"0 0 18 18",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},d.createElement("title",null,"shape-round"),d.createElement("desc",null,"Created with Sketch."),d.createElement("g",{id:"Desktop-0.4",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},d.createElement("g",{id:"widgets/shape-round",transform:"translate(-3.000000, -3.000000)",fill:"#000000"},d.createElement("path",{d:"M12,3 C16.9705627,3 21,7.02943725 21,12 C21,16.9705627 16.9705627,21 12,21 C7.02943725,21 3,16.9705627 3,12 C3,7.02943725 7.02943725,3 12,3 Z M12,5 C8.13400675,5 5,8.13400675 5,12 C5,15.8659932 8.13400675,19 12,19 C15.8659932,19 19,15.8659932 19,12 C19,8.13400675 15.8659932,5 12,5 Z",id:"Combined-Shape"})))),m=()=>d.createElement("svg",{width:"18px",height:"18px",viewBox:"0 0 18 18",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},d.createElement("title",null,"ratio-square"),d.createElement("desc",null,"Created with Sketch."),d.createElement("g",{id:"Desktop-0.4",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},d.createElement("g",{id:"widgets/shape-square",transform:"translate(-3.000000, -3.000000)",fill:"#000000"},d.createElement("path",{d:"M3,3 L3,21 L21,21 L21,3 L3,3 Z M5,5 L5,19 L19,19 L19,5 L5,5 Z",id:"shape"})))),v=()=>d.createElement("svg",{width:"18px",height:"18px",viewBox:"0 0 18 18",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},d.createElement("title",null,"shape-radius"),d.createElement("desc",null,"Created with Sketch."),d.createElement("g",{id:"Desktop-0.4",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},d.createElement("g",{id:"widgets/shape-radius",transform:"translate(-3.000000, -3.000000)",fill:"#000000"},d.createElement("path",{d:"M17,3 C19.209139,3 21,4.790861 21,7 L21,17 C21,19.209139 19.209139,21 17,21 L7,21 C4.790861,21 3,19.209139 3,17 L3,7 C3,4.790861 4.790861,3 7,3 L17,3 Z M17,5 L7,5 C5.9456382,5 5.08183488,5.81587779 5.00548574,6.85073766 L5,7 L5,17 C5,18.0543618 5.81587779,18.9181651 6.85073766,18.9945143 L7,19 L17,19 C18.0543618,19 18.9181651,18.1841222 18.9945143,17.1492623 L19,17 L19,7 C19,5.9456382 18.1841222,5.08183488 17.1492623,5.00548574 L17,5 Z",id:"Rectangle"})))),h=()=>d.createElement("svg",{width:"18px",height:"18px",viewBox:"0 0 18 18",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},d.createElement("title",null,"shape-none"),d.createElement("desc",null,"Created with Sketch."),d.createElement("g",{id:"Desktop-0.4",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},d.createElement("g",{id:"widgets/shape-none",transform:"translate(-3.000000, -3.000000)",fill:"#000000"},d.createElement("path",{d:"M5,19 L5,21 L3,21 L3,19 L5,19 Z M21,19 L21,21 L19,21 L19,19 L21,19 Z M13,19 L13,21 L11,21 L11,19 L13,19 Z M9,19 L9,21 L7,21 L7,19 L9,19 Z M17,19 L17,21 L15,21 L15,19 L17,19 Z M21,15 L21,17 L19,17 L19,15 L21,15 Z M21,11 L21,13 L19,13 L19,11 L21,11 Z M5,11 L5,13 L3,13 L3,11 L5,11 Z M21,7 L21,9 L19,9 L19,7 L21,7 Z M5,7 L5,9 L3,9 L3,7 L5,7 Z M13,3 L13,5 L11,5 L11,3 L13,3 Z M9,3 L9,5 L7,5 L7,3 L9,3 Z M17,3 L17,5 L15,5 L15,3 L17,3 Z M21,3 L21,5 L19,5 L19,3 L21,3 Z M5,3 L5,5 L3,5 L3,3 L5,3 Z M3,15 L5,15 L5,17 L3,17 L3,15 Z",id:"Shape"})))),y=[{value:{type:"expanded",columns:1},icon:()=>d.createElement("svg",{width:"17px",height:"20px",viewBox:"0 0 17 20",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},d.createElement("title",null,"layout-modern"),d.createElement("desc",null,"Created with Sketch."),d.createElement("g",{id:"Desktop-0.4",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},d.createElement("g",{id:"widgets/layout-modern",transform:"translate(-2.000000, -3.000000)",fill:"#000000"},d.createElement("path",{d:"M2,10 L5,10 L5,7 L2,7 L2,10 Z M2,14 L5,14 L5,11 L2,11 L2,14 Z M2,6 L5,6 L5,3 L2,3 L2,6 Z M6,3 L6,17 L19,17 L19,3 L6,3 Z M8,5 L8,15 L17,15 L17,5 L8,5 Z M6,18 L6,23 L19,23 L19,18 L6,18 Z M8,20 L8,23 L17,23 L17,20 L8,20 Z",id:"shape"})))),label:(0,t.__)("Expanded - 1 Column","cloudinary")},{value:{type:"expanded",columns:2},icon:()=>d.createElement("svg",{width:"18px",height:"17px",viewBox:"0 0 18 17",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},d.createElement("title",null,"layout-grid-2-column"),d.createElement("desc",null,"Created with Sketch."),d.createElement("g",{id:"Desktop-0.4",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},d.createElement("g",{id:"widgets/layout-gird-2-col",transform:"translate(-3.000000, -3.000000)",fill:"#000000"},d.createElement("path",{d:"M11,12 L11,20 L3,20 L3,12 L11,12 Z M21,12 L21,20 L13,20 L13,12 L21,12 Z M9,14 L5,14 L5,18 L9,18 L9,14 Z M19,14 L15,14 L15,18 L19,18 L19,14 Z M11,3 L11,11 L3,11 L3,3 L11,3 Z M21,3 L21,11 L13,11 L13,3 L21,3 Z M9,5 L5,5 L5,9 L9,9 L9,5 Z M19,5 L15,5 L15,9 L19,9 L19,5 Z",id:"Shape"})))),label:(0,t.__)("Expanded - 2 Column","cloudinary")},{value:{type:"expanded",columns:3},icon:()=>d.createElement("svg",{width:"20px",height:"13px",viewBox:"0 0 20 13",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},d.createElement("title",null,"layout-grid-3-column"),d.createElement("desc",null,"Created with Sketch."),d.createElement("g",{id:"Desktop-0.4",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},d.createElement("g",{id:"widgets/layout-gird-3-col",transform:"translate(-2.000000, -5.000000)",fill:"#000000"},d.createElement("path",{d:"M8,12 L8,18 L2,18 L2,12 L8,12 Z M15,12 L15,18 L9,18 L9,12 L15,12 Z M22,12 L22,18 L16,18 L16,12 L22,12 Z M6,14 L4,14 L4,16 L6,16 L6,14 Z M13,14 L11,14 L11,16 L13,16 L13,14 Z M20,14 L18,14 L18,16 L20,16 L20,14 Z M8,5 L8,11 L2,11 L2,5 L8,5 Z M15,5 L15,11 L9,11 L9,5 L15,5 Z M22,5 L22,11 L16,11 L16,5 L22,5 Z M6,7 L4,7 L4,9 L6,9 L6,7 Z M13,7 L11,7 L11,9 L13,9 L13,7 Z M20,7 L18,7 L18,9 L20,9 L20,7 Z",id:"Combined-Shape"})))),label:(0,t.__)("Expanded - 3 Column","cloudinary")},{value:{type:"classic",columns:1},icon:()=>d.createElement("svg",{width:"17px",height:"14px",viewBox:"0 0 17 14",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},d.createElement("title",null,"layout-classic"),d.createElement("desc",null,"Created with Sketch."),d.createElement("g",{id:"Desktop-0.4",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},d.createElement("g",{id:"widgets/layout-classic",transform:"translate(-3.000000, -5.000000)",fill:"#000000"},d.createElement("path",{d:"M3,12 L6,12 L6,9 L3,9 L3,12 Z M3,16 L6,16 L6,13 L3,13 L3,16 Z M3,8 L6,8 L6,5 L3,5 L3,8 Z M7,5 L7,19 L20,19 L20,5 L7,5 Z M9,7 L9,17 L18,17 L18,7 L9,7 Z",id:"shape"})))),label:(0,t.__)("Classic","cloudinary")}],b=["image"],g=[{label:(0,t.__)("1:1","cloudinary"),value:"1:1"},{label:(0,t.__)("3:4","cloudinary"),value:"3:4"},{label:(0,t.__)("4:3","cloudinary"),value:"4:3"},{label:(0,t.__)("4:6","cloudinary"),value:"4:6"},{label:(0,t.__)("6:4","cloudinary"),value:"6:4"},{label:(0,t.__)("5:7","cloudinary"),value:"5:7"},{label:(0,t.__)("7:5","cloudinary"),value:"7:5"},{label:(0,t.__)("8:5","cloudinary"),value:"8:5"},{label:(0,t.__)("5:8","cloudinary"),value:"5:8"},{label:(0,t.__)("9:16","cloudinary"),value:"9:16"},{label:(0,t.__)("16:9","cloudinary"),value:"16:9"}],_=[{label:(0,t.__)("None","cloudinary"),value:"none"},{label:(0,t.__)("Fade","cloudinary"),value:"fade"},{label:(0,t.__)("Slide","cloudinary"),value:"slide"}],x=[{label:(0,t.__)("Always","cloudinary"),value:"always"},{label:(0,t.__)("None","cloudinary"),value:"none"},{label:(0,t.__)("MouseOver","cloudinary"),value:"mouseover"}],w=[{label:(0,t.__)("Inline","cloudinary"),value:"inline"},{label:(0,t.__)("Flyout","cloudinary"),value:"flyout"},{label:(0,t.__)("Popup","cloudinary"),value:"popup"}],L=[{label:(0,t.__)("Top","cloudinary"),value:"top"},{label:(0,t.__)("Bottom","cloudinary"),value:"bottom"},{label:(0,t.__)("Left","cloudinary"),value:"left"},{label:(0,t.__)("Right","cloudinary"),value:"right"}],E=[{label:(0,t.__)("Click","cloudinary"),value:"click"},{label:(0,t.__)("Hover","cloudinary"),value:"hover"}],O=[{label:(0,t.__)("Left","cloudinary"),value:"left"},{label:(0,t.__)("Right","cloudinary"),value:"right"},{label:(0,t.__)("Top","cloudinary"),value:"top"},{label:(0,t.__)("Bottom","cloudinary"),value:"bottom"}],j=[{label:(0,t.__)("Thumbnails","cloudinary"),value:"thumbnails"},{label:(0,t.__)("Indicators","cloudinary"),value:"indicators"},{label:(0,t.__)("None","cloudinary"),value:"none"}],A=[{value:"round",icon:f,label:(0,t.__)("Round","cloudinary")},{value:"radius",icon:v,label:(0,t.__)("Radius","cloudinary")},{value:"none",icon:h,label:(0,t.__)("None","cloudinary")},{value:"square",icon:m,label:(0,t.__)("Square","cloudinary")},{value:"rectangle",icon:()=>d.createElement("svg",{width:"14px",height:"20px",viewBox:"0 0 14 20",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},d.createElement("title",null,"ratio-9-16"),d.createElement("desc",null,"Created with Sketch."),d.createElement("g",{id:"Desktop-0.4",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},d.createElement("g",{id:"ratio/9-16",transform:"translate(-5.000000, -2.000000)",fill:"#000000"},d.createElement("path",{d:"M22,5.5 L22,18.5 L2,18.5 L2,5.5 L22,5.5 Z M20,7.5 L4,7.5 L4,16.5 L20,16.5 L20,7.5 Z",id:"Combined-Shape",transform:"translate(12.000000, 12.000000) rotate(-90.000000) translate(-12.000000, -12.000000) "})))),label:(0,t.__)("Rectangle","cloudinary")}],k=[{value:"round",icon:f,label:(0,t.__)("Round","cloudinary")},{value:"radius",icon:v,label:(0,t.__)("Radius","cloudinary")},{value:"square",icon:m,label:(0,t.__)("Square","cloudinary")}],P=[{label:(0,t.__)("All","cloudinary"),value:"all"},{label:(0,t.__)("Border","cloudinary"),value:"border"},{label:(0,t.__)("Gradient","cloudinary"),value:"gradient"}],S=[{label:(0,t.__)("All","cloudinary"),value:"all"},{label:(0,t.__)("Top","cloudinary"),value:"top"},{label:(0,t.__)("Top-Bottom","cloudinary"),value:"top-bottom"},{label:(0,t.__)("Left-Right","cloudinary"),value:"left-right"},{label:(0,t.__)("Bottom","cloudinary"),value:"bottom"},{label:(0,t.__)("Left","cloudinary"),value:"left"},{label:(0,t.__)("Right","cloudinary"),value:"right"}],C=[{value:"round",icon:f,label:(0,t.__)("Round","cloudinary")},{value:"radius",icon:v,label:(0,t.__)("Radius","cloudinary")},{value:"none",icon:h,label:(0,t.__)("None","cloudinary")},{value:"square",icon:m,label:(0,t.__)("Square","cloudinary")}],M=[{label:(0,t.__)("Pad","cloudinary"),value:"pad"},{label:(0,t.__)("Fill","cloudinary"),value:"fill"}],B=[{label:(0,t.__)("White padding","cloudinary"),value:"rgb:FFFFFF"},{label:(0,t.__)("Border color padding","cloudinary"),value:"auto"},{label:(0,t.__)("Predominant color padding","cloudinary"),value:"auto:predominant"},{label:(0,t.__)("Gradient fade padding","cloudinary"),value:"auto:predominant_gradient"}];var T=r(6942),D=r.n(T),N=r(6087);const R=({value:e,children:t,icon:r,onChange:n,current:o})=>{const i="object"==typeof e?JSON.stringify(e)===JSON.stringify(o):o===e;return N.createElement("button",{type:"button",onClick:()=>n(e),className:D()("radio-select",{"radio-select--active":i})},N.createElement(r,null),N.createElement("div",{className:"radio-select__label"},t))};r.dn(R);const Z=window.wp.data,z=e=>e<10?"0"+String(e):e.toString(16),I=e=>{const t=new Uint8Array((e||40)/2);return window.crypto.getRandomValues(t),Array.from(t,z).join("")},F=e=>{const t=/var\((.*)\)/g.exec(e);return t?getComputedStyle(document.documentElement).getPropertyValue(t[1]):e};function W(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function H(e){return e instanceof W(e).Element||e instanceof Element}function V(e){return e instanceof W(e).HTMLElement||e instanceof HTMLElement}function U(e){return"undefined"!=typeof ShadowRoot&&(e instanceof W(e).ShadowRoot||e instanceof ShadowRoot)}var q=Math.max,G=Math.min,$=Math.round;function X(){var e=navigator.userAgentData;return null!=e&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function J(){return!/^((?!chrome|android).)*safari/i.test(X())}function Y(e,t,r){void 0===t&&(t=!1),void 0===r&&(r=!1);var n=e.getBoundingClientRect(),o=1,i=1;t&&V(e)&&(o=e.offsetWidth>0&&$(n.width)/e.offsetWidth||1,i=e.offsetHeight>0&&$(n.height)/e.offsetHeight||1);var a=(H(e)?W(e):window).visualViewport,s=!J()&&r,l=(n.left+(s&&a?a.offsetLeft:0))/o,c=(n.top+(s&&a?a.offsetTop:0))/i,u=n.width/o,p=n.height/i;return{width:u,height:p,top:c,right:l+u,bottom:c+p,left:l,x:l,y:c}}function K(e){var t=W(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function Q(e){return e?(e.nodeName||"").toLowerCase():null}function ee(e){return((H(e)?e.ownerDocument:e.document)||window.document).documentElement}function te(e){return Y(ee(e)).left+K(e).scrollLeft}function re(e){return W(e).getComputedStyle(e)}function ne(e){var t=re(e),r=t.overflow,n=t.overflowX,o=t.overflowY;return/auto|scroll|overlay|hidden/.test(r+o+n)}function oe(e,t,r){void 0===r&&(r=!1);var n,o,i=V(t),a=V(t)&&function(e){var t=e.getBoundingClientRect(),r=$(t.width)/e.offsetWidth||1,n=$(t.height)/e.offsetHeight||1;return 1!==r||1!==n}(t),s=ee(t),l=Y(e,a,r),c={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(i||!i&&!r)&&(("body"!==Q(t)||ne(s))&&(c=(n=t)!==W(n)&&V(n)?{scrollLeft:(o=n).scrollLeft,scrollTop:o.scrollTop}:K(n)),V(t)?((u=Y(t,!0)).x+=t.clientLeft,u.y+=t.clientTop):s&&(u.x=te(s))),{x:l.left+c.scrollLeft-u.x,y:l.top+c.scrollTop-u.y,width:l.width,height:l.height}}function ie(e){var t=Y(e),r=e.offsetWidth,n=e.offsetHeight;return Math.abs(t.width-r)<=1&&(r=t.width),Math.abs(t.height-n)<=1&&(n=t.height),{x:e.offsetLeft,y:e.offsetTop,width:r,height:n}}function ae(e){return"html"===Q(e)?e:e.assignedSlot||e.parentNode||(U(e)?e.host:null)||ee(e)}function se(e){return["html","body","#document"].indexOf(Q(e))>=0?e.ownerDocument.body:V(e)&&ne(e)?e:se(ae(e))}function le(e,t){var r;void 0===t&&(t=[]);var n=se(e),o=n===(null==(r=e.ownerDocument)?void 0:r.body),i=W(n),a=o?[i].concat(i.visualViewport||[],ne(n)?n:[]):n,s=t.concat(a);return o?s:s.concat(le(ae(a)))}function ce(e){return["table","td","th"].indexOf(Q(e))>=0}function ue(e){return V(e)&&"fixed"!==re(e).position?e.offsetParent:null}function pe(e){for(var t=W(e),r=ue(e);r&&ce(r)&&"static"===re(r).position;)r=ue(r);return r&&("html"===Q(r)||"body"===Q(r)&&"static"===re(r).position)?t:r||function(e){var t=/firefox/i.test(X());if(/Trident/i.test(X())&&V(e)&&"fixed"===re(e).position)return null;var r=ae(e);for(U(r)&&(r=r.host);V(r)&&["html","body"].indexOf(Q(r))<0;){var n=re(r);if("none"!==n.transform||"none"!==n.perspective||"paint"===n.contain||-1!==["transform","perspective"].indexOf(n.willChange)||t&&"filter"===n.willChange||t&&n.filter&&"none"!==n.filter)return r;r=r.parentNode}return null}(e)||t}var de="top",fe="bottom",me="right",ve="left",he="auto",ye=[de,fe,me,ve],be="start",ge="end",_e="viewport",xe="popper",we=ye.reduce(function(e,t){return e.concat([t+"-"+be,t+"-"+ge])},[]),Le=[].concat(ye,[he]).reduce(function(e,t){return e.concat([t,t+"-"+be,t+"-"+ge])},[]),Ee=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function Oe(e){var t=new Map,r=new Set,n=[];function o(e){r.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach(function(e){if(!r.has(e)){var n=t.get(e);n&&o(n)}}),n.push(e)}return e.forEach(function(e){t.set(e.name,e)}),e.forEach(function(e){r.has(e.name)||o(e)}),n}var je={placement:"bottom",modifiers:[],strategy:"absolute"};function Ae(){for(var e=arguments.length,t=new Array(e),r=0;r=0?"x":"y"}function Be(e){var t,r=e.reference,n=e.element,o=e.placement,i=o?Se(o):null,a=o?Ce(o):null,s=r.x+r.width/2-n.width/2,l=r.y+r.height/2-n.height/2;switch(i){case de:t={x:s,y:r.y-n.height};break;case fe:t={x:s,y:r.y+r.height};break;case me:t={x:r.x+r.width,y:l};break;case ve:t={x:r.x-n.width,y:l};break;default:t={x:r.x,y:r.y}}var c=i?Me(i):null;if(null!=c){var u="y"===c?"height":"width";switch(a){case be:t[c]=t[c]-(r[u]/2-n[u]/2);break;case ge:t[c]=t[c]+(r[u]/2-n[u]/2)}}return t}var Te={top:"auto",right:"auto",bottom:"auto",left:"auto"};function De(e){var t,r=e.popper,n=e.popperRect,o=e.placement,i=e.variation,a=e.offsets,s=e.position,l=e.gpuAcceleration,c=e.adaptive,u=e.roundOffsets,p=e.isFixed,d=a.x,f=void 0===d?0:d,m=a.y,v=void 0===m?0:m,h="function"==typeof u?u({x:f,y:v}):{x:f,y:v};f=h.x,v=h.y;var y=a.hasOwnProperty("x"),b=a.hasOwnProperty("y"),g=ve,_=de,x=window;if(c){var w=pe(r),L="clientHeight",E="clientWidth";if(w===W(r)&&"static"!==re(w=ee(r)).position&&"absolute"===s&&(L="scrollHeight",E="scrollWidth"),o===de||(o===ve||o===me)&&i===ge)_=fe,v-=(p&&w===x&&x.visualViewport?x.visualViewport.height:w[L])-n.height,v*=l?1:-1;if(o===ve||(o===de||o===fe)&&i===ge)g=me,f-=(p&&w===x&&x.visualViewport?x.visualViewport.width:w[E])-n.width,f*=l?1:-1}var O,j=Object.assign({position:s},c&&Te),A=!0===u?function(e,t){var r=e.x,n=e.y,o=t.devicePixelRatio||1;return{x:$(r*o)/o||0,y:$(n*o)/o||0}}({x:f,y:v},W(r)):{x:f,y:v};return f=A.x,v=A.y,l?Object.assign({},j,((O={})[_]=b?"0":"",O[g]=y?"0":"",O.transform=(x.devicePixelRatio||1)<=1?"translate("+f+"px, "+v+"px)":"translate3d("+f+"px, "+v+"px, 0)",O)):Object.assign({},j,((t={})[_]=b?v+"px":"",t[g]=y?f+"px":"",t.transform="",t))}const Ne={name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach(function(e){var r=t.styles[e]||{},n=t.attributes[e]||{},o=t.elements[e];V(o)&&Q(o)&&(Object.assign(o.style,r),Object.keys(n).forEach(function(e){var t=n[e];!1===t?o.removeAttribute(e):o.setAttribute(e,!0===t?"":t)}))})},effect:function(e){var t=e.state,r={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,r.popper),t.styles=r,t.elements.arrow&&Object.assign(t.elements.arrow.style,r.arrow),function(){Object.keys(t.elements).forEach(function(e){var n=t.elements[e],o=t.attributes[e]||{},i=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:r[e]).reduce(function(e,t){return e[t]="",e},{});V(n)&&Q(n)&&(Object.assign(n.style,i),Object.keys(o).forEach(function(e){n.removeAttribute(e)}))})}},requires:["computeStyles"]};const Re={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,r=e.options,n=e.name,o=r.offset,i=void 0===o?[0,0]:o,a=Le.reduce(function(e,r){return e[r]=function(e,t,r){var n=Se(e),o=[ve,de].indexOf(n)>=0?-1:1,i="function"==typeof r?r(Object.assign({},t,{placement:e})):r,a=i[0],s=i[1];return a=a||0,s=(s||0)*o,[ve,me].indexOf(n)>=0?{x:s,y:a}:{x:a,y:s}}(r,t.rects,i),e},{}),s=a[t.placement],l=s.x,c=s.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=c),t.modifiersData[n]=a}};var Ze={left:"right",right:"left",bottom:"top",top:"bottom"};function ze(e){return e.replace(/left|right|bottom|top/g,function(e){return Ze[e]})}var Ie={start:"end",end:"start"};function Fe(e){return e.replace(/start|end/g,function(e){return Ie[e]})}function We(e,t){var r=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(r&&U(r)){var n=t;do{if(n&&e.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function He(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function Ve(e,t,r){return t===_e?He(function(e,t){var r=W(e),n=ee(e),o=r.visualViewport,i=n.clientWidth,a=n.clientHeight,s=0,l=0;if(o){i=o.width,a=o.height;var c=J();(c||!c&&"fixed"===t)&&(s=o.offsetLeft,l=o.offsetTop)}return{width:i,height:a,x:s+te(e),y:l}}(e,r)):H(t)?function(e,t){var r=Y(e,!1,"fixed"===t);return r.top=r.top+e.clientTop,r.left=r.left+e.clientLeft,r.bottom=r.top+e.clientHeight,r.right=r.left+e.clientWidth,r.width=e.clientWidth,r.height=e.clientHeight,r.x=r.left,r.y=r.top,r}(t,r):He(function(e){var t,r=ee(e),n=K(e),o=null==(t=e.ownerDocument)?void 0:t.body,i=q(r.scrollWidth,r.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),a=q(r.scrollHeight,r.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),s=-n.scrollLeft+te(e),l=-n.scrollTop;return"rtl"===re(o||r).direction&&(s+=q(r.clientWidth,o?o.clientWidth:0)-i),{width:i,height:a,x:s,y:l}}(ee(e)))}function Ue(e,t,r,n){var o="clippingParents"===t?function(e){var t=le(ae(e)),r=["absolute","fixed"].indexOf(re(e).position)>=0&&V(e)?pe(e):e;return H(r)?t.filter(function(e){return H(e)&&We(e,r)&&"body"!==Q(e)}):[]}(e):[].concat(t),i=[].concat(o,[r]),a=i[0],s=i.reduce(function(t,r){var o=Ve(e,r,n);return t.top=q(o.top,t.top),t.right=G(o.right,t.right),t.bottom=G(o.bottom,t.bottom),t.left=q(o.left,t.left),t},Ve(e,a,n));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function qe(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function Ge(e,t){return t.reduce(function(t,r){return t[r]=e,t},{})}function $e(e,t){void 0===t&&(t={});var r=t,n=r.placement,o=void 0===n?e.placement:n,i=r.strategy,a=void 0===i?e.strategy:i,s=r.boundary,l=void 0===s?"clippingParents":s,c=r.rootBoundary,u=void 0===c?_e:c,p=r.elementContext,d=void 0===p?xe:p,f=r.altBoundary,m=void 0!==f&&f,v=r.padding,h=void 0===v?0:v,y=qe("number"!=typeof h?h:Ge(h,ye)),b=d===xe?"reference":xe,g=e.rects.popper,_=e.elements[m?b:d],x=Ue(H(_)?_:_.contextElement||ee(e.elements.popper),l,u,a),w=Y(e.elements.reference),L=Be({reference:w,element:g,strategy:"absolute",placement:o}),E=He(Object.assign({},g,L)),O=d===xe?E:w,j={top:x.top-O.top+y.top,bottom:O.bottom-x.bottom+y.bottom,left:x.left-O.left+y.left,right:O.right-x.right+y.right},A=e.modifiersData.offset;if(d===xe&&A){var k=A[o];Object.keys(j).forEach(function(e){var t=[me,fe].indexOf(e)>=0?1:-1,r=[de,fe].indexOf(e)>=0?"y":"x";j[e]+=k[r]*t})}return j}function Xe(e,t,r){return q(e,G(t,r))}const Je={name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,r=e.options,n=e.name,o=r.mainAxis,i=void 0===o||o,a=r.altAxis,s=void 0!==a&&a,l=r.boundary,c=r.rootBoundary,u=r.altBoundary,p=r.padding,d=r.tether,f=void 0===d||d,m=r.tetherOffset,v=void 0===m?0:m,h=$e(t,{boundary:l,rootBoundary:c,padding:p,altBoundary:u}),y=Se(t.placement),b=Ce(t.placement),g=!b,_=Me(y),x="x"===_?"y":"x",w=t.modifiersData.popperOffsets,L=t.rects.reference,E=t.rects.popper,O="function"==typeof v?v(Object.assign({},t.rects,{placement:t.placement})):v,j="number"==typeof O?{mainAxis:O,altAxis:O}:Object.assign({mainAxis:0,altAxis:0},O),A=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,k={x:0,y:0};if(w){if(i){var P,S="y"===_?de:ve,C="y"===_?fe:me,M="y"===_?"height":"width",B=w[_],T=B+h[S],D=B-h[C],N=f?-E[M]/2:0,R=b===be?L[M]:E[M],Z=b===be?-E[M]:-L[M],z=t.elements.arrow,I=f&&z?ie(z):{width:0,height:0},F=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},W=F[S],H=F[C],V=Xe(0,L[M],I[M]),U=g?L[M]/2-N-V-W-j.mainAxis:R-V-W-j.mainAxis,$=g?-L[M]/2+N+V+H+j.mainAxis:Z+V+H+j.mainAxis,X=t.elements.arrow&&pe(t.elements.arrow),J=X?"y"===_?X.clientTop||0:X.clientLeft||0:0,Y=null!=(P=null==A?void 0:A[_])?P:0,K=B+$-Y,Q=Xe(f?G(T,B+U-Y-J):T,B,f?q(D,K):D);w[_]=Q,k[_]=Q-B}if(s){var ee,te="x"===_?de:ve,re="x"===_?fe:me,ne=w[x],oe="y"===x?"height":"width",ae=ne+h[te],se=ne-h[re],le=-1!==[de,ve].indexOf(y),ce=null!=(ee=null==A?void 0:A[x])?ee:0,ue=le?ae:ne-L[oe]-E[oe]-ce+j.altAxis,he=le?ne+L[oe]+E[oe]-ce-j.altAxis:se,ye=f&&le?function(e,t,r){var n=Xe(e,t,r);return n>r?r:n}(ue,ne,he):Xe(f?ue:ae,ne,f?he:se);w[x]=ye,k[x]=ye-ne}t.modifiersData[n]=k}},requiresIfExists:["offset"]};const Ye={name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,r=e.state,n=e.name,o=e.options,i=r.elements.arrow,a=r.modifiersData.popperOffsets,s=Se(r.placement),l=Me(s),c=[ve,me].indexOf(s)>=0?"height":"width";if(i&&a){var u=function(e,t){return qe("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:Ge(e,ye))}(o.padding,r),p=ie(i),d="y"===l?de:ve,f="y"===l?fe:me,m=r.rects.reference[c]+r.rects.reference[l]-a[l]-r.rects.popper[c],v=a[l]-r.rects.reference[l],h=pe(i),y=h?"y"===l?h.clientHeight||0:h.clientWidth||0:0,b=m/2-v/2,g=u[d],_=y-p[c]-u[f],x=y/2-p[c]/2+b,w=Xe(g,x,_),L=l;r.modifiersData[n]=((t={})[L]=w,t.centerOffset=w-x,t)}},effect:function(e){var t=e.state,r=e.options.element,n=void 0===r?"[data-popper-arrow]":r;null!=n&&("string"!=typeof n||(n=t.elements.popper.querySelector(n)))&&We(t.elements.popper,n)&&(t.elements.arrow=n)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Ke(e,t,r){return void 0===r&&(r={x:0,y:0}),{top:e.top-t.height-r.y,right:e.right-t.width+r.x,bottom:e.bottom-t.height+r.y,left:e.left-t.width-r.x}}function Qe(e){return[de,me,fe,ve].some(function(t){return e[t]>=0})}var et=ke({defaultModifiers:[{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var t=e.state,r=e.instance,n=e.options,o=n.scroll,i=void 0===o||o,a=n.resize,s=void 0===a||a,l=W(t.elements.popper),c=[].concat(t.scrollParents.reference,t.scrollParents.popper);return i&&c.forEach(function(e){e.addEventListener("scroll",r.update,Pe)}),s&&l.addEventListener("resize",r.update,Pe),function(){i&&c.forEach(function(e){e.removeEventListener("scroll",r.update,Pe)}),s&&l.removeEventListener("resize",r.update,Pe)}},data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,r=e.name;t.modifiersData[r]=Be({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}},{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,r=e.options,n=r.gpuAcceleration,o=void 0===n||n,i=r.adaptive,a=void 0===i||i,s=r.roundOffsets,l=void 0===s||s,c={placement:Se(t.placement),variation:Ce(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:o,isFixed:"fixed"===t.options.strategy};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,De(Object.assign({},c,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:l})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,De(Object.assign({},c,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}},Ne,Re,{name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,r=e.options,n=e.name;if(!t.modifiersData[n]._skip){for(var o=r.mainAxis,i=void 0===o||o,a=r.altAxis,s=void 0===a||a,l=r.fallbackPlacements,c=r.padding,u=r.boundary,p=r.rootBoundary,d=r.altBoundary,f=r.flipVariations,m=void 0===f||f,v=r.allowedAutoPlacements,h=t.options.placement,y=Se(h),b=l||(y===h||!m?[ze(h)]:function(e){if(Se(e)===he)return[];var t=ze(e);return[Fe(e),t,Fe(t)]}(h)),g=[h].concat(b).reduce(function(e,r){return e.concat(Se(r)===he?function(e,t){void 0===t&&(t={});var r=t,n=r.placement,o=r.boundary,i=r.rootBoundary,a=r.padding,s=r.flipVariations,l=r.allowedAutoPlacements,c=void 0===l?Le:l,u=Ce(n),p=u?s?we:we.filter(function(e){return Ce(e)===u}):ye,d=p.filter(function(e){return c.indexOf(e)>=0});0===d.length&&(d=p);var f=d.reduce(function(t,r){return t[r]=$e(e,{placement:r,boundary:o,rootBoundary:i,padding:a})[Se(r)],t},{});return Object.keys(f).sort(function(e,t){return f[e]-f[t]})}(t,{placement:r,boundary:u,rootBoundary:p,padding:c,flipVariations:m,allowedAutoPlacements:v}):r)},[]),_=t.rects.reference,x=t.rects.popper,w=new Map,L=!0,E=g[0],O=0;O=0,S=P?"width":"height",C=$e(t,{placement:j,boundary:u,rootBoundary:p,altBoundary:d,padding:c}),M=P?k?me:ve:k?fe:de;_[S]>x[S]&&(M=ze(M));var B=ze(M),T=[];if(i&&T.push(C[A]<=0),s&&T.push(C[M]<=0,C[B]<=0),T.every(function(e){return e})){E=j,L=!1;break}w.set(j,T)}if(L)for(var D=function(e){var t=g.find(function(t){var r=w.get(t);if(r)return r.slice(0,e).every(function(e){return e})});if(t)return E=t,"break"},N=m?3:1;N>0;N--){if("break"===D(N))break}t.placement!==E&&(t.modifiersData[n]._skip=!0,t.placement=E,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}},Je,Ye,{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,r=e.name,n=t.rects.reference,o=t.rects.popper,i=t.modifiersData.preventOverflow,a=$e(t,{elementContext:"reference"}),s=$e(t,{altBoundary:!0}),l=Ke(a,n),c=Ke(s,o,i),u=Qe(l),p=Qe(c);t.modifiersData[r]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:u,hasPopperEscaped:p},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":p})}}]}),tt="tippy-content",rt="tippy-backdrop",nt="tippy-arrow",ot="tippy-svg-arrow",it={passive:!0,capture:!0},at=function(){return document.body};function st(e,t,r){if(Array.isArray(e)){var n=e[t];return n??(Array.isArray(r)?r[t]:r)}return e}function lt(e,t){var r={}.toString.call(e);return 0===r.indexOf("[object")&&r.indexOf(t+"]")>-1}function ct(e,t){return"function"==typeof e?e.apply(void 0,t):e}function ut(e,t){return 0===t?e:function(n){clearTimeout(r),r=setTimeout(function(){e(n)},t)};var r}function pt(e){return[].concat(e)}function dt(e,t){-1===e.indexOf(t)&&e.push(t)}function ft(e){return e.split("-")[0]}function mt(e){return[].slice.call(e)}function vt(e){return Object.keys(e).reduce(function(t,r){return void 0!==e[r]&&(t[r]=e[r]),t},{})}function ht(){return document.createElement("div")}function yt(e){return["Element","Fragment"].some(function(t){return lt(e,t)})}function bt(e){return lt(e,"MouseEvent")}function gt(e){return!(!e||!e._tippy||e._tippy.reference!==e)}function _t(e){return yt(e)?[e]:function(e){return lt(e,"NodeList")}(e)?mt(e):Array.isArray(e)?e:mt(document.querySelectorAll(e))}function xt(e,t){e.forEach(function(e){e&&(e.style.transitionDuration=t+"ms")})}function wt(e,t){e.forEach(function(e){e&&e.setAttribute("data-state",t)})}function Lt(e){var t,r=pt(e)[0];return null!=r&&null!=(t=r.ownerDocument)&&t.body?r.ownerDocument:document}function Et(e,t,r){var n=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(t){e[n](t,r)})}function Ot(e,t){for(var r=t;r;){var n;if(e.contains(r))return!0;r=null==r.getRootNode||null==(n=r.getRootNode())?void 0:n.host}return!1}var jt={isTouch:!1},At=0;function kt(){jt.isTouch||(jt.isTouch=!0,window.performance&&document.addEventListener("mousemove",Pt))}function Pt(){var e=performance.now();e-At<20&&(jt.isTouch=!1,document.removeEventListener("mousemove",Pt)),At=e}function St(){var e=document.activeElement;if(gt(e)){var t=e._tippy;e.blur&&!t.state.isVisible&&e.blur()}}var Ct=!!("undefined"!=typeof window&&"undefined"!=typeof document)&&!!window.msCrypto;var Mt={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},Bt=Object.assign({appendTo:at,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},Mt,{allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999}),Tt=Object.keys(Bt);function Dt(e){var t=(e.plugins||[]).reduce(function(t,r){var n,o=r.name,i=r.defaultValue;o&&(t[o]=void 0!==e[o]?e[o]:null!=(n=Bt[o])?n:i);return t},{});return Object.assign({},e,t)}function Nt(e,t){var r=Object.assign({},t,{content:ct(t.content,[e])},t.ignoreAttributes?{}:function(e,t){return(t?Object.keys(Dt(Object.assign({},Bt,{plugins:t}))):Tt).reduce(function(t,r){var n=(e.getAttribute("data-tippy-"+r)||"").trim();if(!n)return t;if("content"===r)t[r]=n;else try{t[r]=JSON.parse(n)}catch(e){t[r]=n}return t},{})}(e,t.plugins));return r.aria=Object.assign({},Bt.aria,r.aria),r.aria={expanded:"auto"===r.aria.expanded?t.interactive:r.aria.expanded,content:"auto"===r.aria.content?t.interactive?null:"describedby":r.aria.content},r}function Rt(e,t){e.innerHTML=t}function Zt(e){var t=ht();return!0===e?t.className=nt:(t.className=ot,yt(e)?t.appendChild(e):Rt(t,e)),t}function zt(e,t){yt(t.content)?(Rt(e,""),e.appendChild(t.content)):"function"!=typeof t.content&&(t.allowHTML?Rt(e,t.content):e.textContent=t.content)}function It(e){var t=e.firstElementChild,r=mt(t.children);return{box:t,content:r.find(function(e){return e.classList.contains(tt)}),arrow:r.find(function(e){return e.classList.contains(nt)||e.classList.contains(ot)}),backdrop:r.find(function(e){return e.classList.contains(rt)})}}function Ft(e){var t=ht(),r=ht();r.className="tippy-box",r.setAttribute("data-state","hidden"),r.setAttribute("tabindex","-1");var n=ht();function o(r,n){var o=It(t),i=o.box,a=o.content,s=o.arrow;n.theme?i.setAttribute("data-theme",n.theme):i.removeAttribute("data-theme"),"string"==typeof n.animation?i.setAttribute("data-animation",n.animation):i.removeAttribute("data-animation"),n.inertia?i.setAttribute("data-inertia",""):i.removeAttribute("data-inertia"),i.style.maxWidth="number"==typeof n.maxWidth?n.maxWidth+"px":n.maxWidth,n.role?i.setAttribute("role",n.role):i.removeAttribute("role"),r.content===n.content&&r.allowHTML===n.allowHTML||zt(a,e.props),n.arrow?s?r.arrow!==n.arrow&&(i.removeChild(s),i.appendChild(Zt(n.arrow))):i.appendChild(Zt(n.arrow)):s&&i.removeChild(s)}return n.className=tt,n.setAttribute("data-state","hidden"),zt(n,e.props),t.appendChild(r),r.appendChild(n),o(e.props,e.props),{popper:t,onUpdate:o}}Ft.$$tippy=!0;var Wt=1,Ht=[],Vt=[];function Ut(e,t){var r,n,o,i,a,s,l,c,u=Nt(e,Object.assign({},Bt,Dt(vt(t)))),p=!1,d=!1,f=!1,m=!1,v=[],h=ut(G,u.interactiveDebounce),y=Wt++,b=(c=u.plugins).filter(function(e,t){return c.indexOf(e)===t}),g={id:y,reference:e,popper:ht(),popperInstance:null,props:u,state:{isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},plugins:b,clearDelayTimeouts:function(){clearTimeout(r),clearTimeout(n),cancelAnimationFrame(o)},setProps:function(t){0;if(g.state.isDestroyed)return;B("onBeforeUpdate",[g,t]),U();var r=g.props,n=Nt(e,Object.assign({},r,vt(t),{ignoreAttributes:!0}));g.props=n,V(),r.interactiveDebounce!==n.interactiveDebounce&&(N(),h=ut(G,n.interactiveDebounce));r.triggerTarget&&!n.triggerTarget?pt(r.triggerTarget).forEach(function(e){e.removeAttribute("aria-expanded")}):n.triggerTarget&&e.removeAttribute("aria-expanded");D(),M(),w&&w(r,n);g.popperInstance&&(Y(),Q().forEach(function(e){requestAnimationFrame(e._tippy.popperInstance.forceUpdate)}));B("onAfterUpdate",[g,t])},setContent:function(e){g.setProps({content:e})},show:function(){0;var e=g.state.isVisible,t=g.state.isDestroyed,r=!g.state.isEnabled,n=jt.isTouch&&!g.props.touch,o=st(g.props.duration,0,Bt.duration);if(e||t||r||n)return;if(k().hasAttribute("disabled"))return;if(B("onShow",[g],!1),!1===g.props.onShow(g))return;g.state.isVisible=!0,A()&&(x.style.visibility="visible");M(),I(),g.state.isMounted||(x.style.transition="none");if(A()){var i=S();xt([i.box,i.content],0)}s=function(){var e;if(g.state.isVisible&&!m){if(m=!0,x.offsetHeight,x.style.transition=g.props.moveTransition,A()&&g.props.animation){var t=S(),r=t.box,n=t.content;xt([r,n],o),wt([r,n],"visible")}T(),D(),dt(Vt,g),null==(e=g.popperInstance)||e.forceUpdate(),B("onMount",[g]),g.props.animation&&A()&&function(e,t){W(e,t)}(o,function(){g.state.isShown=!0,B("onShown",[g])})}},function(){var e,t=g.props.appendTo,r=k();e=g.props.interactive&&t===at||"parent"===t?r.parentNode:ct(t,[r]);e.contains(x)||e.appendChild(x);g.state.isMounted=!0,Y(),!1}()},hide:function(){0;var e=!g.state.isVisible,t=g.state.isDestroyed,r=!g.state.isEnabled,n=st(g.props.duration,1,Bt.duration);if(e||t||r)return;if(B("onHide",[g],!1),!1===g.props.onHide(g))return;g.state.isVisible=!1,g.state.isShown=!1,m=!1,p=!1,A()&&(x.style.visibility="hidden");if(N(),F(),M(!0),A()){var o=S(),i=o.box,a=o.content;g.props.animation&&(xt([i,a],n),wt([i,a],"hidden"))}T(),D(),g.props.animation?A()&&function(e,t){W(e,function(){!g.state.isVisible&&x.parentNode&&x.parentNode.contains(x)&&t()})}(n,g.unmount):g.unmount()},hideWithInteractivity:function(e){0;P().addEventListener("mousemove",h),dt(Ht,h),h(e)},enable:function(){g.state.isEnabled=!0},disable:function(){g.hide(),g.state.isEnabled=!1},unmount:function(){0;g.state.isVisible&&g.hide();if(!g.state.isMounted)return;K(),Q().forEach(function(e){e._tippy.unmount()}),x.parentNode&&x.parentNode.removeChild(x);Vt=Vt.filter(function(e){return e!==g}),g.state.isMounted=!1,B("onHidden",[g])},destroy:function(){0;if(g.state.isDestroyed)return;g.clearDelayTimeouts(),g.unmount(),U(),delete e._tippy,g.state.isDestroyed=!0,B("onDestroy",[g])}};if(!u.render)return g;var _=u.render(g),x=_.popper,w=_.onUpdate;x.setAttribute("data-tippy-root",""),x.id="tippy-"+g.id,g.popper=x,e._tippy=g,x._tippy=g;var L=b.map(function(e){return e.fn(g)}),E=e.hasAttribute("aria-expanded");return V(),D(),M(),B("onCreate",[g]),u.showOnCreate&&ee(),x.addEventListener("mouseenter",function(){g.props.interactive&&g.state.isVisible&&g.clearDelayTimeouts()}),x.addEventListener("mouseleave",function(){g.props.interactive&&g.props.trigger.indexOf("mouseenter")>=0&&P().addEventListener("mousemove",h)}),g;function O(){var e=g.props.touch;return Array.isArray(e)?e:[e,0]}function j(){return"hold"===O()[0]}function A(){var e;return!(null==(e=g.props.render)||!e.$$tippy)}function k(){return l||e}function P(){var e=k().parentNode;return e?Lt(e):document}function S(){return It(x)}function C(e){return g.state.isMounted&&!g.state.isVisible||jt.isTouch||i&&"focus"===i.type?0:st(g.props.delay,e?0:1,Bt.delay)}function M(e){void 0===e&&(e=!1),x.style.pointerEvents=g.props.interactive&&!e?"":"none",x.style.zIndex=""+g.props.zIndex}function B(e,t,r){var n;(void 0===r&&(r=!0),L.forEach(function(r){r[e]&&r[e].apply(r,t)}),r)&&(n=g.props)[e].apply(n,t)}function T(){var t=g.props.aria;if(t.content){var r="aria-"+t.content,n=x.id;pt(g.props.triggerTarget||e).forEach(function(e){var t=e.getAttribute(r);if(g.state.isVisible)e.setAttribute(r,t?t+" "+n:n);else{var o=t&&t.replace(n,"").trim();o?e.setAttribute(r,o):e.removeAttribute(r)}})}}function D(){!E&&g.props.aria.expanded&&pt(g.props.triggerTarget||e).forEach(function(e){g.props.interactive?e.setAttribute("aria-expanded",g.state.isVisible&&e===k()?"true":"false"):e.removeAttribute("aria-expanded")})}function N(){P().removeEventListener("mousemove",h),Ht=Ht.filter(function(e){return e!==h})}function R(t){if(!jt.isTouch||!f&&"mousedown"!==t.type){var r=t.composedPath&&t.composedPath()[0]||t.target;if(!g.props.interactive||!Ot(x,r)){if(pt(g.props.triggerTarget||e).some(function(e){return Ot(e,r)})){if(jt.isTouch)return;if(g.state.isVisible&&g.props.trigger.indexOf("click")>=0)return}else B("onClickOutside",[g,t]);!0===g.props.hideOnClick&&(g.clearDelayTimeouts(),g.hide(),d=!0,setTimeout(function(){d=!1}),g.state.isMounted||F())}}}function Z(){f=!0}function z(){f=!1}function I(){var e=P();e.addEventListener("mousedown",R,!0),e.addEventListener("touchend",R,it),e.addEventListener("touchstart",z,it),e.addEventListener("touchmove",Z,it)}function F(){var e=P();e.removeEventListener("mousedown",R,!0),e.removeEventListener("touchend",R,it),e.removeEventListener("touchstart",z,it),e.removeEventListener("touchmove",Z,it)}function W(e,t){var r=S().box;function n(e){e.target===r&&(Et(r,"remove",n),t())}if(0===e)return t();Et(r,"remove",a),Et(r,"add",n),a=n}function H(t,r,n){void 0===n&&(n=!1),pt(g.props.triggerTarget||e).forEach(function(e){e.addEventListener(t,r,n),v.push({node:e,eventType:t,handler:r,options:n})})}function V(){var e;j()&&(H("touchstart",q,{passive:!0}),H("touchend",$,{passive:!0})),(e=g.props.trigger,e.split(/\s+/).filter(Boolean)).forEach(function(e){if("manual"!==e)switch(H(e,q),e){case"mouseenter":H("mouseleave",$);break;case"focus":H(Ct?"focusout":"blur",X);break;case"focusin":H("focusout",X)}})}function U(){v.forEach(function(e){var t=e.node,r=e.eventType,n=e.handler,o=e.options;t.removeEventListener(r,n,o)}),v=[]}function q(e){var t,r=!1;if(g.state.isEnabled&&!J(e)&&!d){var n="focus"===(null==(t=i)?void 0:t.type);i=e,l=e.currentTarget,D(),!g.state.isVisible&&bt(e)&&Ht.forEach(function(t){return t(e)}),"click"===e.type&&(g.props.trigger.indexOf("mouseenter")<0||p)&&!1!==g.props.hideOnClick&&g.state.isVisible?r=!0:ee(e),"click"===e.type&&(p=!r),r&&!n&&te(e)}}function G(e){var t=e.target,r=k().contains(t)||x.contains(t);if("mousemove"!==e.type||!r){var n=Q().concat(x).map(function(e){var t,r=null==(t=e._tippy.popperInstance)?void 0:t.state;return r?{popperRect:e.getBoundingClientRect(),popperState:r,props:u}:null}).filter(Boolean);(function(e,t){var r=t.clientX,n=t.clientY;return e.every(function(e){var t=e.popperRect,o=e.popperState,i=e.props.interactiveBorder,a=ft(o.placement),s=o.modifiersData.offset;if(!s)return!0;var l="bottom"===a?s.top.y:0,c="top"===a?s.bottom.y:0,u="right"===a?s.left.x:0,p="left"===a?s.right.x:0,d=t.top-n+l>i,f=n-t.bottom-c>i,m=t.left-r+u>i,v=r-t.right-p>i;return d||f||m||v})})(n,e)&&(N(),te(e))}}function $(e){J(e)||g.props.trigger.indexOf("click")>=0&&p||(g.props.interactive?g.hideWithInteractivity(e):te(e))}function X(e){g.props.trigger.indexOf("focusin")<0&&e.target!==k()||g.props.interactive&&e.relatedTarget&&x.contains(e.relatedTarget)||te(e)}function J(e){return!!jt.isTouch&&j()!==e.type.indexOf("touch")>=0}function Y(){K();var t=g.props,r=t.popperOptions,n=t.placement,o=t.offset,i=t.getReferenceClientRect,a=t.moveTransition,l=A()?It(x).arrow:null,c=i?{getBoundingClientRect:i,contextElement:i.contextElement||k()}:e,u={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(e){var t=e.state;if(A()){var r=S().box;["placement","reference-hidden","escaped"].forEach(function(e){"placement"===e?r.setAttribute("data-placement",t.placement):t.attributes.popper["data-popper-"+e]?r.setAttribute("data-"+e,""):r.removeAttribute("data-"+e)}),t.attributes.popper={}}}},p=[{name:"offset",options:{offset:o}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!a}},u];A()&&l&&p.push({name:"arrow",options:{element:l,padding:3}}),p.push.apply(p,(null==r?void 0:r.modifiers)||[]),g.popperInstance=et(c,x,Object.assign({},r,{placement:n,onFirstUpdate:s,modifiers:p}))}function K(){g.popperInstance&&(g.popperInstance.destroy(),g.popperInstance=null)}function Q(){return mt(x.querySelectorAll("[data-tippy-root]"))}function ee(e){g.clearDelayTimeouts(),e&&B("onTrigger",[g,e]),I();var t=C(!0),n=O(),o=n[0],i=n[1];jt.isTouch&&"hold"===o&&i&&(t=i),t?r=setTimeout(function(){g.show()},t):g.show()}function te(e){if(g.clearDelayTimeouts(),B("onUntrigger",[g,e]),g.state.isVisible){if(!(g.props.trigger.indexOf("mouseenter")>=0&&g.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(e.type)>=0&&p)){var t=C(!1);t?n=setTimeout(function(){g.state.isVisible&&g.hide()},t):o=requestAnimationFrame(function(){g.hide()})}}else F()}}function qt(e,t){void 0===t&&(t={});var r=Bt.plugins.concat(t.plugins||[]);document.addEventListener("touchstart",kt,it),window.addEventListener("blur",St);var n=Object.assign({},t,{plugins:r}),o=_t(e).reduce(function(e,t){var r=t&&Ut(t,n);return r&&e.push(r),e},[]);return yt(e)?o[0]:o}qt.defaultProps=Bt,qt.setDefaultProps=function(e){Object.keys(e).forEach(function(t){Bt[t]=e[t]})},qt.currentInput=jt;Object.assign({},Ne,{effect:function(e){var t=e.state,r={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(t.elements.popper.style,r.popper),t.styles=r,t.elements.arrow&&Object.assign(t.elements.arrow.style,r.arrow)}});qt.setDefaultProps({render:Ft});const Gt=qt;var $t=r(6087);const Xt=({children:e,value:t})=>$t.createElement("div",{className:"colorpalette-color-label"},$t.createElement("span",null,e),$t.createElement("span",{className:"component-color-indicator","aria-label":`Color: ${t}`,style:{background:t}})),Jt=new(o()())("_"),Yt=({attributes:e,setAttributes:r,colors:n})=>{const o=p()(e),i=Jt.object(o),[a,u]=(0,l.useState)(i.customSettings);e.transformation_crop||(e.transformation_crop="pad",e.transformation_background="rgb:FFFFFF"),"fill"===e.transformation_crop&&delete e.transformation_background;const d=(e,t)=>{const n={[t]:F(e)};r(n)},f=(e=>{const[t,r]=(0,l.useState)(null),n=(0,l.useCallback)(e=>r(e),[]);return(0,l.useEffect)(()=>{if(!t)return;const r=Gt(t,{content:e});return()=>{r?.destroy()}},[t,e]),n})((0,t.__)("How to resize or crop images to fit the gallery. Pad adds padding around the image using the specified padding style. Fill crops the image from the center so it fills as much of the available space as possible.","cloudinary"));return $t.createElement($t.Fragment,null,$t.createElement(s.PanelBody,{title:(0,t.__)("Layout","cloudinary")},y.map(t=>$t.createElement(R,{key:`${t.value.type}-${t.value.columns}-layout`,value:t.value,onChange:e=>{r({displayProps_mode:e.type,displayProps_columns:e.columns||1})},icon:t.icon,current:{type:e.displayProps_mode,columns:e.displayProps_columns||1}},t.label))),$t.createElement(s.PanelBody,{title:(0,t.__)("Color Palette","cloudinary"),initialOpen:!1},$t.createElement(Xt,{value:e.themeProps_primary},(0,t.__)("Primary","cloudinary")),$t.createElement(c.ColorPalette,{value:e.themeProps_primary,colors:n,disableCustomColors:!1,onChange:e=>d(e,"themeProps_primary")}),$t.createElement(Xt,{value:e.themeProps_onPrimary},(0,t.__)("On Primary","cloudinary")),$t.createElement(c.ColorPalette,{value:e.themeProps_onPrimary,colors:n,disableCustomColors:!1,onChange:e=>d(e,"themeProps_onPrimary")}),$t.createElement(Xt,{value:e.themeProps_active},(0,t.__)("Active","cloudinary")),$t.createElement(c.ColorPalette,{value:e.themeProps_active,colors:n,disableCustomColors:!1,onChange:e=>d(e,"themeProps_active")})),"classic"===e.displayProps_mode&&$t.createElement(s.PanelBody,{title:(0,t.__)("Fade Transition","cloudinary"),initialOpen:!1},$t.createElement(s.SelectControl,{value:e.transition,options:_,onChange:e=>r({transition:e}),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0})),$t.createElement(s.PanelBody,{title:(0,t.__)("Main Viewer Parameters","cloudinary"),initialOpen:!1},$t.createElement(s.SelectControl,{label:(0,t.__)("Aspect Ratio","cloudinary"),value:e.aspectRatio,options:g,onChange:e=>r({aspectRatio:e}),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0}),$t.createElement("p",null,$t.createElement("div",{className:"cld-ui-title"},(0,t.__)("Resize/Crop Mode","cloudinary"),$t.createElement("span",{className:"dashicons dashicons-info cld-tooltip",ref:f})),$t.createElement(s.ButtonGroup,null,M.map(t=>$t.createElement(s.Button,{key:t.value+"-look-and-feel",variant:"secondary",isSecondary:!0,isPressed:t.value===e.transformation_crop,onClick:()=>r({transformation_crop:t.value,transformation_background:null})},t.label)))),"pad"===e.transformation_crop&&$t.createElement(s.SelectControl,{label:(0,t.__)("Pad style","cloudinary"),value:e.transformation_background,options:B,onChange:e=>{r({transformation_background:e})},__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0}),$t.createElement("p",null,(0,t.__)("Navigation","cloudinary")),$t.createElement("p",null,$t.createElement(s.ButtonGroup,null,x.map(t=>$t.createElement(s.Button,{key:t.value+"-navigation",variant:"secondary",isSecondary:!0,isPressed:t.value===e.navigation,onClick:()=>r({navigation:t.value})},t.label)))),$t.createElement("div",{style:{marginTop:"30px"}},$t.createElement(s.ToggleControl,{label:(0,t.__)("Show Zoom","cloudinary"),checked:e.zoom,onChange:()=>r({zoom:!e.zoom}),__nextHasNoMarginBottom:!0}),e.zoom&&$t.createElement($t.Fragment,null,$t.createElement("p",null,(0,t.__)("Zoom Type","cloudinary")),$t.createElement("p",null,$t.createElement(s.ButtonGroup,null,w.map(t=>$t.createElement(s.Button,{key:t.value+"-zoom-type",variant:"secondary",isSecondary:!0,isPressed:t.value===e.zoomProps_type,onClick:()=>r({zoomProps_type:t.value})},t.label)))),"flyout"===e.zoomProps_type&&$t.createElement(s.SelectControl,{label:(0,t.__)("Zoom Viewer Position","cloudinary"),value:e.zoomProps_viewerPosition,options:L,onChange:e=>r({zoomProps_viewerPosition:e}),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0}),"popup"!==e.zoomProps_type&&$t.createElement($t.Fragment,null,$t.createElement("p",null,(0,t.__)("Zoom Trigger","cloudinary")),$t.createElement("p",null,$t.createElement(s.ButtonGroup,null,E.map(t=>$t.createElement(s.Button,{key:t.value+"-zoom-trigger",variant:"secondary",isSecondary:!0,isPressed:t.value===e.zoomProps_trigger,onClick:()=>r({zoomProps_trigger:t.value})},t.label)))))))),$t.createElement(s.PanelBody,{title:(0,t.__)("Carousel Parameters","cloudinary"),initialOpen:!1},$t.createElement("p",null,(0,t.__)("Carousel Location","cloudinary")),$t.createElement("p",null,$t.createElement(s.ButtonGroup,null,O.map(t=>$t.createElement(s.Button,{key:t.value+"-carousel-location",variant:"secondary",isSecondary:!0,isPressed:t.value===e.carouselLocation,onClick:()=>r({carouselLocation:t.value})},t.label)))),$t.createElement(s.RangeControl,{label:(0,t.__)("Carousel Offset","cloudinary"),value:e.carouselOffset,onChange:e=>r({carouselOffset:e}),min:0,max:100,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0}),$t.createElement("p",null,(0,t.__)("Carousel Style","cloudinary")),$t.createElement("p",null,$t.createElement(s.ButtonGroup,null,j.map(t=>$t.createElement(s.Button,{key:t.value+"-carousel-style",variant:"secondary",isSecondary:!0,isPressed:t.value===e.carouselStyle,onClick:()=>r({carouselStyle:t.value})},t.label)))),"thumbnails"===e.carouselStyle&&$t.createElement($t.Fragment,null,$t.createElement(s.RangeControl,{label:(0,t.__)("Width","cloudinary"),value:e.thumbnailProps_width,onChange:e=>r({thumbnailProps_width:e}),min:5,max:300,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0}),$t.createElement(s.RangeControl,{label:(0,t.__)("Height","cloudinary"),value:e.thumbnailProps_height,onChange:e=>r({thumbnailProps_height:e}),min:5,max:300,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0}),$t.createElement("p",null,(0,t.__)("Navigation Button Shape","cloudinary")),A.map(t=>$t.createElement(R,{key:t.value+"-navigation-button-shape",value:t.value,onChange:e=>r({thumbnailProps_navigationShape:e}),icon:t.icon,current:e.thumbnailProps_navigationShape},t.label)),$t.createElement("p",null,(0,t.__)("Selected Style","cloudinary")),$t.createElement("p",null,$t.createElement(s.ButtonGroup,null,P.map(t=>$t.createElement(s.Button,{key:t.value+"-selected-style",variant:"secondary",isSecondary:!0,isPressed:t.value===e.thumbnailProps_selectedStyle,onClick:()=>r({thumbnailProps_selectedStyle:t.value})},t.label)))),$t.createElement(s.SelectControl,{label:(0,t.__)("Selected Border Position","cloudinary"),value:e.thumbnailProps_selectedBorderPosition,options:S,onChange:e=>r({thumbnailProps_selectedBorderPosition:e}),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0}),$t.createElement(s.RangeControl,{label:(0,t.__)("Selected Border Width","cloudinary"),value:e.thumbnailProps_selectedBorderWidth,onChange:e=>r({thumbnailProps_selectedBorderWidth:e}),min:0,max:10,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0}),$t.createElement("p",null,(0,t.__)("Media Shape Icon","cloudinary")),C.map(t=>$t.createElement(R,{key:t.value+"-media",value:t.value,onChange:e=>r({thumbnailProps_mediaSymbolShape:e}),icon:t.icon,current:e.thumbnailProps_mediaSymbolShape},t.label))),"indicators"===e.carouselStyle&&$t.createElement($t.Fragment,null,$t.createElement("p",null,(0,t.__)("Indicators Shape","cloudinary")),k.map(t=>$t.createElement(R,{key:t.value+"-indicator",value:t.value,onChange:e=>r({indicatorProps_shape:e}),icon:t.icon,current:e.indicatorProps_shape},t.label)))),$t.createElement(s.PanelBody,{title:(0,t.__)("Additional Settings","cloudinary"),initialOpen:!1},$t.createElement(s.TextareaControl,{label:(0,t.__)("Custom Settings","cloudinary"),help:(0,t.__)("Provide a JSON string of the settings you want to add and/or override.","cloudinary"),value:a,onChange:e=>{let t={};u(e);try{t=JSON.parse(e)}catch(e){}if("object"==typeof t){const e={...i};e.customSettings=t,r({...i,...e})}},__nextHasNoMarginBottom:!0})))};var Kt=r(6087);const Qt=new(o()())("_"),er=(0,t.__)("Drag images, upload new ones or select files from your library.","cloudinary"),tr=(e,t)=>({...e,container:"."+t,zoom:!1}),rr=e=>e?.cloudinary?.galleryWidget,nr=()=>{if("undefined"==typeof CLD_GALLERY_CONFIG)return{};const{cloudName:e,secureDistribution:t,privateCdn:r}=CLD_GALLERY_CONFIG;return Object.fromEntries(Object.entries({cloudName:e,secureDistribution:t,privateCdn:r}).filter(([,e])=>void 0!==e))},or=({setAttributes:e,attributes:r,isSelected:n})=>{const[i,u]=(0,l.useState)(null),[d,f]=(0,l.useState)(!1),m=(0,l.useRef)(null),v=(0,l.useMemo)(()=>{if(0!==r.selectedImages.length)return r;const e={},{container:t,...n}=Qt.dot(CLD_GALLERY_CONFIG);return Object.keys(n).forEach(t=>{r[t]||(e[t]=n[t])}),{...r,...e}},[r]),h=(0,l.useMemo)(()=>r.selectedImages.length?r.selectedImages.map(({attachmentId:e})=>({id:e})):[],[r]);(0,l.useEffect)(()=>{i&&((({status:e,message:t,options:r={}})=>{(0,Z.dispatch)("core/notices").createNotice(e,t,{isDismissible:!0,...r})})({status:"error",message:i}),u(null));const e=m.current;if(!r.selectedImages.length||!e)return;const t=e.ownerDocument.defaultView||window,n=e=>t===window?e:t.JSON.parse(JSON.stringify(e)),{customSettings:a,...s}=(e=>{const t=new(o()())("_"),r=p()(e),{selectedImages:n,...i}=t.object(r,{});return i.mediaAssets=n,"classic"!==i?.displayProps?.mode?delete i.transition:delete i.displayProps.columns,"pad"!==i?.transformation_crop&&delete i.transformation_background,"pad"!==i?.transformation?.crop&&delete i.transformation.background,i?.themeProps?.primary&&(i.themeProps.primary=F(i?.themeProps?.primary)),i?.themeProps?.onPrimary&&(i.themeProps.onPrimary=F(i?.themeProps?.onPrimary)),i?.themeProps?.active&&(i.themeProps.active=F(i?.themeProps?.active)),i})(r),l={...s,...nr()},c=(e=>{let t=e;if("string"==typeof e)try{t=JSON.parse(e)}catch{return{}}return!t||"object"!=typeof t||Array.isArray(t)?{}:t})(a);let d,v=!1;const h=()=>{if(v)return;const e=rr(t);if(e){try{d=e(n(tr({...l,...c},r.container)))}catch{d=e(n(tr(l,r.container)))}d.render(),f(!1)}else f(!1)};return rr(t)?h():"complete"!==t.document.readyState?t.addEventListener("load",h,{once:!0}):f(!1),()=>{v=!0,t.removeEventListener("load",h),d?.destroy()}},[i,r,e]);const y=!!r.selectedImages.length;(0,l.useEffect)(()=>{r.container||e({container:`cld-gallery-${I(15)}`})},[r.container,e]),(0,l.useEffect)(()=>{e(v)},[v,e]);const g=(0,c.useBlockProps)();return Kt.createElement("div",g,Kt.createElement(Kt.Fragment,null,Kt.createElement("div",{ref:m,className:r.container}),Kt.createElement("div",{className:"wp-block-cloudinary-gallery"},Kt.createElement(c.MediaPlaceholder,{labels:{title:!y&&(0,t.__)("Cloudinary Gallery","cloudinary"),instructions:!y&&er},icon:"format-gallery",disableMediaButtons:y&&!n,allowedTypes:b,addToGallery:y,isAppender:y,onSelect:r=>(async r=>{f(!0);try{const t=await a()({path:CLD_REST_ENDPOINT+"/image_data",method:"POST",data:{images:r}});e({selectedImages:t})}catch{f(!1),u((0,t.__)("Could not load selected images. Please try again.","cloudinary"))}})(r),value:h,multiple:!0},d&&Kt.createElement("div",{className:"loading-spinner-container"},Kt.createElement(s.Spinner,null))))),Kt.createElement(c.InspectorControls,null,Kt.createElement(Yt,{attributes:r,setAttributes:e})))};var ir=r(6087);const ar=({attributes:e})=>ir.createElement("div",{className:e.container}),sr=JSON.parse('{"aspectRatio":{"type":"string"},"navigation":{"type":"string"},"zoom":{"type":"boolean"},"carouselLocation":{"type":"string"},"carouselOffset":{"type":"number"},"carouselStyle":{"type":"string"},"displayProps_mode":{"type":"string"},"displayProps_columns":{"type":"number"},"indicatorProps_shape":{"type":"string"},"themeProps_primary":{"type":"string"},"themeProps_onPrimary":{"type":"string"},"themeProps_active":{"type":"string"},"zoomProps_type":{"type":"string"},"zoomProps_viewerPosition":{"type":"string"},"zoomProps_trigger":{"type":"string"},"thumbnailProps_width":{"type":"number"},"thumbnailProps_height":{"type":"number"},"thumbnailProps_navigationShape":{"type":"string"},"thumbnailProps_selectedStyle":{"type":"string"},"thumbnailProps_selectedBorderPosition":{"type":"string"},"thumbnailProps_selectedBorderWidth":{"type":"number"},"thumbnailProps_mediaSymbolShape":{"type":"string"},"cloudName":{"type":"string"},"container":{"type":"string"},"selectedImages":{"type":"array","default":[]},"transformation_crop":{"type":"string","default":"pad"},"transformation_background":{"type":"string"},"customSettings":{"type":"string"}}');(0,n.registerBlockType)("cloudinary/gallery",{apiVersion:2,title:(0,t.__)("Cloudinary Gallery","cloudinary"),description:(0,t.__)("Add a gallery powered by the Cloudinary Gallery Widget to your post.","cloudinary"),category:"widgets",icon:"format-gallery",attributes:sr,edit:or,save:ar})})()})(); //# sourceMappingURL=gallery-block.js.map \ No newline at end of file diff --git a/src/js/gallery-block/edit.js b/src/js/gallery-block/edit.js index d6f5934cc..7c1d92b16 100644 --- a/src/js/gallery-block/edit.js +++ b/src/js/gallery-block/edit.js @@ -53,6 +53,30 @@ const galleryWidgetConfig = ( config, container ) => ( { */ const getGalleryWidget = ( win ) => win?.cloudinary?.galleryWidget; +/** + * Get the delivery settings of the connected Cloudinary account. + * + * The front end always applies them over the block attributes when it + * renders a gallery, so the preview does too. Blocks may have no cloud name + * saved (e.g. created outside the editor) or a stale one, and the custom + * domain settings are not block attributes at all. + * + * @return {Object} The cloud name and custom domain settings that are set. + */ +const getDeliveryConfig = () => { + if ( 'undefined' === typeof CLD_GALLERY_CONFIG ) { + return {}; + } + + const { cloudName, secureDistribution, privateCdn } = CLD_GALLERY_CONFIG; + + return Object.fromEntries( + Object.entries( { cloudName, secureDistribution, privateCdn } ).filter( + ( [ , value ] ) => undefined !== value + ) + ); +}; + // Prefix for the generated gallery container class. A literal prefix keeps // the value a valid, unique CSS selector. Prior to the Block API v2 upgrade // the block's `className` prop was used, but that prop is no longer passed to @@ -141,8 +165,9 @@ const Edit = ( { setAttributes, attributes, isSelected } ) => { ? config : win.JSON.parse( JSON.stringify( config ) ); - const { customSettings, ...config } = + const { customSettings, ...attributesConfig } = setupAttributesForRendering( attributes ); + const config = { ...attributesConfig, ...getDeliveryConfig() }; const custom = parseCustomSettings( customSettings ); let gallery; diff --git a/tests/e2e/cloudinary-gallery-delivery.spec.js b/tests/e2e/cloudinary-gallery-delivery.spec.js index 5acc6a177..7082fee3a 100644 --- a/tests/e2e/cloudinary-gallery-delivery.spec.js +++ b/tests/e2e/cloudinary-gallery-delivery.spec.js @@ -269,6 +269,8 @@ test.describe( 'Cloudinary Gallery block delivery', { tag: '@serial' }, () => { editor, requestUtils, } ) => { + // The block markup has no `cloudName`, like a block created outside + // the editor: the preview has to use the connected account's. await requestUtils.rest( { method: 'POST', path: `/wp/v2/posts/${ created.postId }`, @@ -276,7 +278,6 @@ test.describe( 'Cloudinary Gallery block delivery', { tag: '@serial' }, () => { content: galleryBlock( created.selectedImages, { mode: 'expanded', columns: INITIAL_COLUMNS, - cloudName, customSettings: { transformation: { effect: 'grayscale' }, }, diff --git a/tests/e2e/utils/gallery.js b/tests/e2e/utils/gallery.js index 9adf338e3..bbc90e2de 100644 --- a/tests/e2e/utils/gallery.js +++ b/tests/e2e/utils/gallery.js @@ -29,14 +29,9 @@ const WIDGET_TIMEOUT = 30_000; * @param {string} layout.mode `expanded` or `classic`. * @param {number} layout.columns Column count (expanded mode only). * @param {Object} [layout.customSettings] Custom Settings, stored as JSON text like the block does. - * @param {string} [layout.cloudName] Cloud name. The editor saves it on the block, and its - * preview needs it; the front end adds it on render. * @return {string} Block markup. */ -function galleryBlock( - selectedImages, - { mode, columns, customSettings, cloudName } -) { +function galleryBlock( selectedImages, { mode, columns, customSettings } ) { const attributes = { container: GALLERY_CONTAINER, selectedImages, @@ -44,10 +39,6 @@ function galleryBlock( displayProps_columns: columns, }; - if ( cloudName ) { - attributes.cloudName = cloudName; - } - if ( customSettings ) { attributes.customSettings = JSON.stringify( customSettings ); }