Gutenberg Blocks and Template Library by Otter - Version 2.1.3

Version Description

Download this release

Release Info

Developer themeisle
Plugin Icon wp plugin Gutenberg Blocks and Template Library by Otter
Version 2.1.3
Comparing to
See all releases

Code changes from version 2.1.2 to 2.1.3

CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
 
 
 
 
1
  ##### [Version 2.1.2](https://github.com/Codeinwp/otter-blocks/compare/v2.1.1...v2.1.2) (2022-11-09)
2
 
3
  - Section Enhancements
1
+ ##### [Version 2.1.3](https://github.com/Codeinwp/otter-blocks/compare/v2.1.2...v2.1.3) (2022-11-10)
2
+
3
+ - Fixed a crash issue for users with PHP8.0 & PHP8.1 with WP version lower than 6.1
4
+
5
  ##### [Version 2.1.2](https://github.com/Codeinwp/otter-blocks/compare/v2.1.1...v2.1.2) (2022-11-09)
6
 
7
  - Section Enhancements
build/blocks/blocks.asset.php CHANGED
@@ -1 +1 @@
1
- <?php return array('dependencies' => array('lodash', 'moment', 'react', 'react-dom', 'wp-api', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-date', 'wp-dom-ready', 'wp-edit-post', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-keycodes', 'wp-plugins', 'wp-primitives', 'wp-rich-text', 'wp-server-side-render'), 'version' => 'daceb5bfc52d5a6cadf2');
1
+ <?php return array('dependencies' => array('lodash', 'moment', 'react', 'react-dom', 'wp-api', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-date', 'wp-dom-ready', 'wp-edit-post', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-keycodes', 'wp-plugins', 'wp-primitives', 'wp-rich-text', 'wp-server-side-render'), 'version' => '214cc813995950b263ae');
build/blocks/blocks.js CHANGED
@@ -1,4 +1,4 @@
1
- !function(){"use strict";var e,t={5568:function(e,t,l){var o=l(5736),a=l(4981),n=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"themeisle-blocks/about-author","title":"About Author","category":"themeisle-blocks","description":"About Author block is the easiest way to add a author bio below your posts. Powered by Otter.","keywords":["about","author","profile"],"textdomain":"otter-blocks","supports":{"html":false},"editorStyle":"otter-about-author-editor","style":"otter-about-author-style"}'),r=l(340),i=l(9307),s=l(2175),c=l(5609),d=window.wp.serverSideRender,u=l.n(d);const{name:b}=n;(0,a.registerBlockType)(b,{...n,title:(0,o.__)("About Author","otter-blocks"),description:(0,o.__)("About Author block is the easiest way to add a author bio below your posts. Powered by Otter.","otter-blocks"),icon:r.authorIcon,keywords:["about","author","profile"],edit:()=>(0,i.createElement)("div",(0,s.useBlockProps)(),(0,i.createElement)(c.Disabled,null,(0,i.createElement)(u(),{block:"themeisle-blocks/about-author"}))),save:()=>null,supports:{inserter:Boolean(window.themeisleGutenberg.isLegacyPre59),html:!1},example:{}});var m=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"themeisle-blocks/accordion","title":"Accordion","category":"themeisle-blocks","description":"Vertically collapsing accordions perfect for displaying your FAQs. Powered by Otter.","keywords":["accordions","collapse","faq"],"textdomain":"otter-blocks","attributes":{"id":{"type":"string"},"FAQSchema":{"type":"boolean"},"gap":{"type":["string","number"]},"titleColor":{"type":"string"},"titleBackground":{"type":"string"},"contentBackground":{"type":"string"},"borderColor":{"type":"string"},"borderWidth":{"type":"string"},"isSynced":{"type":"array"},"fontFamily":{"type":"string"},"fontVariant":{"type":"string"},"fontStyle":{"type":"string"},"textTransform":{"type":"string"},"fontSize":{"type":"number"},"letterSpacing":{"type":"string"},"padding":{"type":"object"},"paddingTablet":{"type":"object"},"paddingMobile":{"type":"object"},"tag":{"type":"string"},"alwaysOpen":{"type":"boolean"},"boxShadow":{"type":"object","default":{"active":false,"colorOpacity":50,"blur":5,"spread":1,"horizontal":0,"vertical":0}},"iconFirst":{"type":"boolean","default":false},"activeTitleColor":{"type":"string"},"activeTitleBackground":{"type":"string"},"activeContentBackground":{"type":"string"},"icon":{"type":"object"},"openItemIcon":{"type":"object"}},"supports":{"html":false},"editorStyle":"otter-accordion-editor","style":"otter-accordion-style","script":"otter-accordion"}'),p=l(4184),g=l.n(p),h=l(2154),v=l(9818),y=l(9977),k=l(8675),f=l(3075),_=l(1070),w=l(7638),C=l(3532),E=l(2645),x=l(4715);const S=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:()=>{};return(0,v.useSelect)((t=>{const{getView:l}=t("themeisle-gutenberg/data"),{__experimentalGetPreviewDeviceType:o}=!!t("core/edit-post")&&t("core/edit-post"),a=o?o():l();return{responsiveSetAttributes:(0,x.GM)(e,a),responsiveGetAttributes:(0,x._c)(a)}}),[])};var T=l(817),M=l(6993);const B=[{label:(0,o.__)("Default","otter-blocks"),value:"default",isDefault:!0},{label:(0,o.__)("Boxed","otter-blocks"),value:"boxed"}],z={narrow:5,wide:10,wider:20};var P=e=>{var t,l,a,n;let{clientId:r,attributes:d,setAttributes:u,getValue:b}=e;const[m,p]=(0,i.useState)("settings"),g=[{label:(0,o.__)("Title","otter-blocks"),slug:"titleColor",value:b("titleColor")},{label:(0,o.__)("Active Tab Title","otter-blocks"),slug:"activeTitleColor",value:b("activeTitleColor")},{label:(0,o.__)("Title Background","otter-blocks"),slug:"titleBackground",value:b("titleBackground")},{label:(0,o.__)("Active Tab Title Background","otter-blocks"),slug:"activeTitleBackground",value:b("activeTitleBackground")},{label:(0,o.__)("Content Background","otter-blocks"),slug:"contentBackground",value:b("contentBackground")},{label:(0,o.__)("Border","otter-blocks"),slug:"borderColor",value:b("borderColor")}],{responsiveSetAttributes:h,responsiveGetAttributes:P}=S(u);return(0,i.createElement)(s.InspectorControls,null,(0,i.createElement)(w.Z,{value:m,options:[{label:(0,o.__)("Settings","otter-blocks"),value:"settings"},{label:(0,o.__)("Style","otter-blocks"),value:"style"}],onChange:p}),"settings"===m&&(0,i.createElement)(c.PanelBody,{title:(0,o.__)("Settings","otter-blocks")},(0,i.createElement)(c.ToggleControl,{label:(0,o.__)("Place Icon on Left","otter-blocks"),checked:d.iconFirst,onChange:e=>u({iconFirst:e})}),(0,i.createElement)(c.ToggleControl,{label:(0,o.__)("Keep Multiple Items Expanded","otter-blocks"),help:(0,o.__)("When enabled, multiple accordion items can be expanded at the same time","otter-blocks"),checked:d.alwaysOpen||!1,onChange:e=>{u({alwaysOpen:e}),!0!==e&&(0,v.select)("core/block-editor").getBlocksByClientId(r)[0].innerBlocks.forEach((e=>{(0,v.dispatch)("core/block-editor").updateBlockAttributes(e.clientId,{initialOpen:!1})}))}}),(0,i.createElement)(c.ToggleControl,{label:(0,o.__)("Enable FAQ Schema","otter-blocks"),checked:d.FAQSchema||!1,onChange:e=>u({FAQSchema:e})}),(0,i.createElement)(c.SelectControl,{label:(0,o.__)("Accordion title HTML tag","otter-blocks"),value:d.tag||"div",options:[{label:(0,o.__)("H1","otter-blocks"),value:"h1"},{label:(0,o.__)("H2","otter-blocks"),value:"h2"},{label:(0,o.__)("H3","otter-blocks"),value:"h3"},{label:(0,o.__)("H4","otter-blocks"),value:"h4"},{label:(0,o.__)("H5","otter-blocks"),value:"h5"},{label:(0,o.__)("H6","otter-blocks"),value:"h6"},{label:(0,o.__)("div","otter-blocks"),value:"div"}],onChange:e=>{(0,v.select)("core/block-editor").getBlocksByClientId(r)[0].innerBlocks.forEach((t=>{(0,v.dispatch)("core/block-editor").updateBlockAttributes(t.clientId,{tag:e})})),u({tag:e})}})),"style"===m&&(0,i.createElement)(i.Fragment,null,(0,i.createElement)(c.PanelBody,{title:(0,o.__)("Style","otter-blocks")},(0,i.createElement)(E.Z,{options:B,value:(0,x.tB)(B,null==d?void 0:d.className),onChange:e=>{const t=(0,x.L4)(null==d?void 0:d.className,B,e);u({className:t})}})),(0,i.createElement)(c.PanelBody,{title:(0,o.__)("Title Typography","otter-blocks")},(0,i.createElement)(c.FontSizePicker,{value:d.fontSize,fontSizes:[{name:(0,o.__)("Extra Small","otter-blocks"),slug:"extra-small",size:14},{name:(0,o.__)("Small","otter-blocks"),slug:"small",size:16},{name:(0,o.__)("Medium","otter-blocks"),slug:"medium",size:18},{name:(0,o.__)("Large","otter-blocks"),slug:"large",size:24},{name:(0,o.__)("Extra Large","otter-blocks"),slug:"extra-large",size:28}],onChange:e=>u({fontSize:e})}),(0,i.createElement)(y.Z,{label:(0,o.__)("Font Family","otter-blocks"),value:d.fontFamily,onChangeFontFamily:e=>{u(e?{fontFamily:e,fontVariant:"normal",fontStyle:"normal"}:{fontFamily:e,fontVariant:e})},valueVariant:d.fontVariant,onChangeFontVariant:e=>u({fontVariant:e}),valueStyle:d.fontStyle,onChangeFontStyle:e=>u({fontStyle:e}),valueTransform:d.textTransform,onChangeTextTransform:e=>u({textTransform:e})}),(0,i.createElement)(k.Z,{values:["fontFamily","fontVariant","fontStyle","textTransform"],setAttributes:u}),(0,i.createElement)(c.RangeControl,{label:(0,o.__)("Letter Spacing","otter-blocks"),value:d.letterSpacing,onChange:e=>u({letterSpacing:e}),min:-50,max:100,allowReset:!0})),(0,i.createElement)(T.Z,{label:(0,o.__)("Color","otter-blocks"),isSynced:d.isSynced,options:g,setAttributes:u},(0,i.createElement)(s.ContrastChecker,{textColor:b("titleColor"),backgroundColor:b("titleBackground")}),(0,i.createElement)(s.ContrastChecker,{textColor:b("activeTitleColor"),backgroundColor:b("activeTitleBackground")})),(0,i.createElement)(c.PanelBody,{title:(0,o.__)("Dimensions","otter-blocks"),initialOpen:!1},(0,i.createElement)(M.Z,{label:(0,o.__)("Screen Type","otter-blocks")},(0,i.createElement)(c.__experimentalBoxControl,{label:(0,o.__)("Padding","otter-blocks"),values:P([d.padding,d.paddingTablet,d.paddingMobile]),onChange:e=>h(e,["padding","paddingTablet","paddingMobile"])})),(0,i.createElement)(c.RangeControl,{label:(0,o.__)("Gap Between Panels","otter-blocks"),value:"string"==typeof d.gap?z[d.gap]:d.gap,onChange:e=>u({gap:e}),allowReset:!0})),(0,i.createElement)(c.PanelBody,{title:(0,o.__)("Icons","otter-blocks"),initialOpen:!1},(0,i.createElement)(_.Z,{label:(0,o.__)("Closed Item Icon","otter-blocks"),library:"fontawesome",prefix:null===(t=d.icon)||void 0===t?void 0:t.prefix,icon:null===(l=d.icon)||void 0===l?void 0:l.name,allowThemeisleIcons:!1,onChange:e=>u({icon:e})}),(0,i.createElement)(_.Z,{label:(0,o.__)("Open Item Icon","otter-blocks"),library:"fontawesome",prefix:null===(a=d.openItemIcon)||void 0===a?void 0:a.prefix,icon:null===(n=d.openItemIcon)||void 0===n?void 0:n.name,allowThemeisleIcons:!1,onChange:e=>u({openItemIcon:e})})),(0,i.createElement)(c.PanelBody,{title:(0,o.__)("Border","otter-blocks"),initialOpen:!1},(0,i.createElement)(c.__experimentalUnitControl,{label:(0,o.__)("Width","otter-blocks"),value:d.borderWidth,units:[{value:"px",label:"px"},{value:"em",label:"em"},{value:"rem",label:"rem"},{value:"vw",label:"vw"},{value:"vh",label:"vh"}],onChange:e=>u({borderWidth:e})}),(0,i.createElement)(f.Z,{boxShadow:d.boxShadow,onChange:e=>{const t={...d.boxShadow};Object.entries(e).map((function(){let[l,o]=arguments.length>0&&void 0!==arguments[0]?arguments[0]:e;t[l]=o})),u({boxShadow:t})}}))),(0,i.createElement)(C.p,null))},L=l(5225),R=l(4824);const{attributes:F}=m,A={fas:"Font Awesome 5 Free",far:"Font Awesome 5 Free",fal:"Font Awesome 5 Free",fab:"Font Awesome 5 Brands"};const{name:H}=m;(0,a.registerBlockType)(H,{...m,title:(0,o.__)("Accordion","otter-blocks"),description:(0,o.__)("Vertically collapsing accordions perfect for displaying your FAQs. Powered by Otter.","otter-blocks"),icon:r.buttonsIcon,keywords:["accordions","collapse","faq"],edit:e=>{let{name:t,attributes:l,setAttributes:o,clientId:a,isSelected:n}=e;(0,i.useEffect)((()=>{h.Z.attach();const e=(0,L.blockInit)(a,F);return()=>e(l.id)}),[l.id]);const r=(0,v.useSelect)((e=>e("core/block-editor").getBlocksByClientId(a)[0].innerBlocks));(0,i.useEffect)((()=>{void 0===l.alwaysOpen&&o({alwaysOpen:1<r.filter((e=>!0===e.attributes.initialOpen)).length})}),[]);const c=e=>(0,L.getDefaultValueByField)({name:t,field:e,defaultAttributes:F,attributes:l}),d={"--title-color":c("titleColor"),"--title-background":c("titleBackground"),"--content-background":c("contentBackground"),"--border-color":c("borderColor"),"--border-width":c("borderWidth"),"--box-shadow":l.boxShadow.active&&`${l.boxShadow.horizontal}px ${l.boxShadow.vertical}px ${l.boxShadow.blur}px ${l.boxShadow.spread}px ${(0,x.rW)(l.boxShadow.color,l.boxShadow.colorOpacity)}`,"--padding":(0,x.bv)(l.padding,{top:"18px",right:"24px",bottom:"18px",left:"24px"}),"--padding-tablet":(0,x.bv)(l.paddingTablet,{top:"18px",right:"24px",bottom:"18px",left:"24px"}),"--padding-mobile":(0,x.bv)(l.paddingMobile,{top:"18px",right:"24px",bottom:"18px",left:"24px"}),"--gap":(u=l.gap,u?`${u}px`:u)};var u;const[b,m]=(0,L.useCSSNode)();(0,i.useEffect)((()=>{m([`> * > * > .wp-block-themeisle-blocks-accordion-item .wp-block-themeisle-blocks-accordion-item__title > * {\n\t\t\t\t${l.fontSize?"font-size:"+l.fontSize+"px":""};\n\t\t\t\t${l.fontFamily?"font-family:"+l.fontFamily:""};\n\t\t\t\t${l.fontVariant?"font-variant:"+l.fontVariant:""};\n\t\t\t\t${l.fontStyle?"font-style:"+l.fontStyle:""};\n\t\t\t\t${l.textTransform?"text-transform:"+l.textTransform:""};\n\t\t\t\t${l.letterSpacing?"letter-spacing:"+l.letterSpacing+"px":""};\n\t\t\t}`])}),[l.fontSize,l.fontFamily,l.fontVariant,l.fontStyle,l.textTransform,l.letterSpacing]);const[p,y]=(0,L.useCSSNode)();(0,i.useEffect)((()=>{const e=c("icon"),t=c("openItemIcon");y([...e?[`> * > * > .wp-block-themeisle-blocks-accordion-item:not(.is-open) > .wp-block-themeisle-blocks-accordion-item__title::after {\n\t\t\t\tcontent: "\\${R[e.name].unicode}" !important;\n\t\t\t\tfont-family: "${A[e.prefix]}" !important;\n\t\t\t\tfont-weight: ${"fas"!==e.prefix?"400":"900"}\n\t\t\t}`]:[],...t?[`> * > * > .wp-block-themeisle-blocks-accordion-item.is-open > .wp-block-themeisle-blocks-accordion-item__title::after {\n\t\t\t\tcontent: "\\${R[t.name].unicode}" !important;\n\t\t\t\tfont-family: "${A[t.prefix]}" !important;\n\t\t\t\tfont-weight: ${"fas"!==t.prefix?"400":"900"}\n\t\t\t}`]:[]])}),[l.icon,l.openItemIcon]);const[k,f]=(0,L.useCSSNode)();(0,i.useEffect)((()=>{const e=c("activeTitleColor"),t=c("activeTitleBackground");f([...e?[`> * > * > .wp-block-themeisle-blocks-accordion-item.is-open > .wp-block-themeisle-blocks-accordion-item__title {\n\t\t\t\t--title-color: ${e};\n\t\t\t}`]:[],...t?[`> * > * > .wp-block-themeisle-blocks-accordion-item.is-open > .wp-block-themeisle-blocks-accordion-item__title {\n\t\t\t\t--title-background: ${t};\n\t\t\t}`]:[]])}),[l.activeTitleColor,l.activeTitleBackground]),(0,i.useEffect)((()=>{l.fontFamily&&h.Z.loadFontToBrowser(l.fontFamily,l.fontVariant)}),[l.fontFamily]);const _=(0,s.useBlockProps)({id:l.id,className:g()({[p]:p,[k]:k,[b]:b,[`is-${l.gap}-gap`]:"string"==typeof l.gap,"no-gap":0===l.gap,"has-gap":"string"!=typeof l.gap&&0<l.gap,"icon-first":l.iconFirst,"has-icon":!!l.icon,"has-open-icon":!!l.openItemIcon}),style:d});return(0,i.createElement)(i.Fragment,null,(0,i.createElement)(P,{clientId:a,attributes:l,setAttributes:o,getValue:c}),(0,i.createElement)("div",_,(0,i.createElement)(s.InnerBlocks,{allowedBlocks:["themeisle-blocks/accordion-item"],template:[["themeisle-blocks/accordion-item"]],renderAppender:n?s.InnerBlocks.ButtonBlockAppender:""})))},save:e=>{let{attributes:t}=e;const l=s.useBlockProps.save({id:t.id,"data-has-schema":t.FAQSchema,className:g()({exclusive:!1===t.alwaysOpen,[`is-${t.gap}-gap`]:t.gap&&"string"==typeof t.gap,"no-gap":0===t.gap,"has-gap":t.gap&&"string"!=typeof t.gap&&0!==t.gap,"icon-first":t.iconFirst,"has-icon":!!t.icon,"has-open-icon":!!t.openItemIcon})});return(0,i.createElement)("div",l,(0,i.createElement)(s.InnerBlocks.Content,null))},example:{attributes:{},innerBlocks:[{name:"themeisle-blocks/accordion-item",attributes:{initialOpen:!0,title:(0,o.__)("Accordion Item","otter-blocks")},innerBlocks:[{name:"core/paragraph",attributes:{customFontSize:48,content:"Lorem ipsum dolor sit amet, eu liber saperet est. Recusabo volutpat has ne, sed dicit eruditi detraxit ut, modus ancillae mei eu.",align:"left"}}]}]}});var O=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"themeisle-blocks/accordion-item","title":"Accordion Item","category":"themeisle-blocks","description":"Vertically collapsing accordions perfect for displaying your FAQs. Powered by Otter.","keywords":["accordions","collapse","faq"],"parent":["themeisle-blocks/accordion"],"textdomain":"otter-blocks","attributes":{"title":{"type":"string"},"initialOpen":{"type":"boolean","default":false},"tag":{"type":"string"}},"supports":{"reusable":false}}'),N=e=>{let{clientId:t,attributes:l,setAttributes:a}=e;return(0,i.createElement)(s.InspectorControls,null,(0,i.createElement)(c.PanelBody,{title:(0,o.__)("Settings","otter-blocks")},(0,i.createElement)(c.ToggleControl,{label:(0,o.__)("Initially Open","otter-blocks"),checked:l.initialOpen,onChange:e=>{if(a({initialOpen:e}),!e)return;const l=(0,v.select)("core/block-editor").getBlockParents(t).at(-1),o=(0,v.select)("core/block-editor").getBlock(l);o.attributes.alwaysOpen||o.innerBlocks.forEach((e=>{e.clientId!==t&&(0,v.dispatch)("core/editor").updateBlockAttributes(e.clientId,{initialOpen:!1})}))}})))};const{name:V}=O;(0,a.registerBlockType)(V,{...O,title:(0,o.__)("Accordion Item","otter-blocks"),description:(0,o.__)("Vertically collapsing accordions perfect for displaying your FAQs. Powered by Otter.","otter-blocks"),icon:r.buttonsIcon,keywords:["accordions","collapse","faq"],edit:e=>{let{clientId:t,attributes:l,setAttributes:a}=e;const[n,r]=(0,i.useState)(!0);return(0,i.createElement)(i.Fragment,null,(0,i.createElement)(N,{clientId:t,attributes:l,setAttributes:a}),(0,i.createElement)("div",(0,s.useBlockProps)({className:g()({"is-open":n})}),(0,i.createElement)("div",{className:"wp-block-themeisle-blocks-accordion-item__title",onClick:e=>{"string"==typeof e.target.className&&e.target.className.includes("block-editor-rich-text__editable")?r(!0):r(!n)}},(0,i.createElement)(s.RichText,{placeholder:(0,o.__)("Add text…","otter-blocks"),value:l.title,onChange:e=>{n||r(!0),a({title:e})},tagName:l.tag||"div"})),n&&(0,i.createElement)("div",{className:"wp-block-themeisle-blocks-accordion-item__content"},(0,i.createElement)(s.InnerBlocks,{template:[["core/paragraph"]]}))))},save:e=>{let{attributes:t}=e;const l=s.useBlockProps.save({open:!!t.initialOpen});return(0,i.createElement)("details",l,(0,i.createElement)("summary",{className:"wp-block-themeisle-blocks-accordion-item__title"},(0,i.createElement)(s.RichText.Content,{tagName:t.tag||"div",value:t.title})),(0,i.createElement)("div",{className:"wp-block-themeisle-blocks-accordion-item__content"},(0,i.createElement)(s.InnerBlocks.Content,null)))}});var I=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"themeisle-blocks/advanced-heading","title":"Advanced Heading","category":"themeisle-blocks","description":"Advanced Heading gives a spin to editor\'s Heading block with much needed customization options. Powered by Otter.","keywords":["heading","title","advanced heading"],"textdomain":"otter-blocks","attributes":{"id":{"type":"string"},"content":{"type":"string","source":"html","selector":"h1,h2,h3,h4,h5,h6,div,p,span","default":""},"tag":{"default":"h2","type":"string"},"align":{"type":"string"},"alignTablet":{"type":"string"},"alignMobile":{"type":"string"},"headingColor":{"type":"string"},"highlightColor":{"type":"string"},"highlightBackground":{"type":"string"},"fontSize":{"type":"number"},"fontSizeTablet":{"type":"number"},"fontSizeMobile":{"type":"number"},"fontFamily":{"type":"string"},"fontVariant":{"type":"string"},"fontStyle":{"type":"string"},"textTransform":{"type":"string"},"lineHeight":{"type":"number"},"letterSpacing":{"type":"number"},"textShadow":{"type":"boolean","default":false},"textShadowColor":{"type":"string","default":"#000000"},"textShadowColorOpacity":{"type":"number","default":50},"textShadowBlur":{"type":"number","default":5},"textShadowHorizontal":{"type":"number","default":0},"textShadowVertical":{"type":"number","default":0},"paddingType":{"type":"string","default":"linked"},"paddingTypeTablet":{"type":"string","default":"linked"},"paddingTypeMobile":{"type":"string","default":"linked"},"padding":{"type":"number","default":0},"paddingTablet":{"type":"number"},"paddingMobile":{"type":"number"},"paddingTop":{"type":"number","default":0},"paddingTopTablet":{"type":"number"},"paddingTopMobile":{"type":"number"},"paddingRight":{"type":"number","default":0},"paddingRightTablet":{"type":"number"},"paddingRightMobile":{"type":"number"},"paddingBottom":{"type":"number","default":0},"paddingBottomTablet":{"type":"number"},"paddingBottomMobile":{"type":"number"},"paddingLeft":{"type":"number","default":0},"paddingLeftTablet":{"type":"number"},"paddingLeftMobile":{"type":"number"},"marginType":{"type":"string","default":"unlinked"},"marginTypeTablet":{"type":"string","default":"unlinked"},"marginTypeMobile":{"type":"string","default":"unlinked"},"margin":{"type":"number","default":0},"marginTablet":{"type":"number"},"marginMobile":{"type":"number"},"marginTop":{"type":"number","default":0},"marginTopTablet":{"type":"number"},"marginTopMobile":{"type":"number"},"marginBottom":{"type":"number","default":25},"marginBottomTablet":{"type":"number"},"marginBottomMobile":{"type":"number"}},"editorStyle":"otter-advanced-heading-editor","style":"otter-advanced-heading-style"}'),D=l(6713),G=l(2629);const $="themeisle-blocks/highlight";(0,G.registerFormatType)($,{name:$,title:(0,o.__)("Highlight","otter-blocks"),tagName:"span",className:"highlight",edit:e=>{let{isActive:t,value:l,onChange:a}=e;const n=()=>a((0,G.toggleFormat)(l,{type:$}));return(0,i.createElement)(i.Fragment,null,(0,i.createElement)(s.RichTextShortcut,{type:"primary",character:"h",onUse:n}),(0,i.createElement)(s.RichTextToolbarButton,{icon:D.Z,title:(0,o.__)("Highlight","otter-blocks"),onClick:n,isActive:t,shortcutType:"access",shortcutCharacter:"h"}))}});var W=l(80),Z=l.n(W);const j=[{attributes:{id:{type:"string"},content:{type:"string",source:"html",selector:"h1,h2,h3,h4,h5,h6,div,p,span",default:""},tag:{default:"h2",type:"string"},align:{type:"string"},alignTablet:{type:"string"},alignMobile:{type:"string"},headingColor:{type:"string",default:"#000000"},highlightColor:{type:"string"},highlightBackground:{type:"string"},fontSize:{type:"number"},fontSizeTablet:{type:"number"},fontSizeMobile:{type:"number"},fontFamily:{type:"string"},fontVariant:{type:"string"},fontStyle:{type:"string",default:"normal"},textTransform:{type:"string",default:"none"},lineHeight:{type:"number"},letterSpacing:{type:"number"},textShadow:{type:"boolean",default:!1},textShadowColor:{type:"string",default:"#000000"},textShadowColorOpacity:{type:"number",default:50},textShadowBlur:{type:"number",default:5},textShadowHorizontal:{type:"number",default:0},textShadowVertical:{type:"number",default:0},paddingType:{type:"string",default:"linked"},paddingTypeTablet:{type:"string",default:"linked"},paddingTypeMobile:{type:"string",default:"linked"},padding:{type:"number",default:0},paddingTablet:{type:"number",default:0},paddingMobile:{type:"number",default:0},paddingTop:{type:"number",default:0},paddingTopTablet:{type:"number",default:0},paddingTopMobile:{type:"number",default:0},paddingRight:{type:"number",default:0},paddingRightTablet:{type:"number",default:0},paddingRightMobile:{type:"number",default:0},paddingBottom:{type:"number",default:0},paddingBottomTablet:{type:"number",default:0},paddingBottomMobile:{type:"number",default:0},paddingLeft:{type:"number",default:0},paddingLeftTablet:{type:"number",default:0},paddingLeftMobile:{type:"number",default:0},marginType:{type:"string",default:"unlinked"},marginTypeTablet:{type:"string",default:"unlinked"},marginTypeMobile:{type:"string",default:"unlinked"},margin:{type:"number",default:0},marginTablet:{type:"number",default:0},marginMobile:{type:"number",default:0},marginTop:{type:"number",default:0},marginTopTablet:{type:"number",default:0},marginTopMobile:{type:"number",default:0},marginBottom:{type:"number",default:25},marginBottomTablet:{type:"number",default:25},marginBottomMobile:{type:"number",default:20}},save:e=>{let t,{attributes:l,className:o}=e;l.textShadow&&(t={textShadow:`${l.textShadowHorizontal}px ${l.textShadowVertical}px ${l.textShadowBlur}px ${Z()(l.textShadowColor?l.textShadowColor:"#000000",l.textShadowColorOpacity)}`});const a={color:l.headingColor,fontFamily:l.fontFamily,fontWeight:"regular"===l.fontVariant?"normal":l.fontVariant,fontStyle:l.fontStyle,textTransform:l.textTransform,lineHeight:l.lineHeight&&`${l.lineHeight}px`,letterSpacing:l.letterSpacing&&`${l.letterSpacing}px`,...t};return(0,i.createElement)(s.RichText.Content,{tagName:l.tag,value:l.content,id:l.id,className:g()(l.id,o),style:a})}}];var U=j,q={from:[{type:"block",blocks:["core/heading"],transform:e=>{let{content:t}=e;return(0,a.createBlock)("themeisle-blocks/advanced-heading",{content:t})}},{type:"block",blocks:["core/paragraph"],transform:e=>{let{content:t}=e;return(0,a.createBlock)("themeisle-blocks/advanced-heading",{content:t})}}],to:[{type:"block",blocks:["core/paragraph"],transform:e=>{let{content:t}=e;return(0,a.createBlock)("core/paragraph",{content:t})}}]},J=l(7462),K=l(2819),Y=l(4333),Q=e=>{let{attributes:t,setAttributes:l}=e;const a=e=>{l(e?{fontFamily:e,fontVariant:"normal",fontStyle:"normal"}:{fontFamily:e,fontVariant:e})},n=e=>{switch(e){case"h1":return(0,i.createElement)(c.SVG,{style:{width:"25px",height:"20px"}},(0,i.createElement)("text",{style:{fontSize:"12px"},x:"0",y:"15"},"H1"));case"h2":return(0,i.createElement)(c.SVG,{style:{width:"25px",height:"20px"}},(0,i.createElement)("text",{style:{fontSize:"12px"},x:"0",y:"15"},"H2"));case"h3":return(0,i.createElement)(c.SVG,{style:{width:"25px",height:"20px"}},(0,i.createElement)("text",{style:{fontSize:"12px"},x:"0",y:"15"},"H3"));case"h4":return(0,i.createElement)(c.SVG,{style:{width:"25px",height:"20px"}},(0,i.createElement)("text",{style:{fontSize:"12px"},x:"0",y:"15"},"H4"));case"h5":return(0,i.createElement)(c.SVG,{style:{width:"25px",height:"20px"}},(0,i.createElement)("text",{style:{fontSize:"12px"},x:"0",y:"15"},"H5"));case"h6":return(0,i.createElement)(c.SVG,{style:{width:"25px",height:"20px"}},(0,i.createElement)("text",{style:{fontSize:"12px"},x:"0",y:"15"},"H6"));case"div":return(0,i.createElement)(c.SVG,{style:{width:"25px",height:"20px"}},(0,i.createElement)("text",{style:{fontSize:"12px"},x:"0",y:"15"},"DIV"));case"p":return(0,i.createElement)(c.SVG,{style:{width:"25px",height:"20px"}},(0,i.createElement)("text",{x:"0",y:"15"},"P"));case"span":return(0,i.createElement)(c.SVG,{style:{width:"25px",height:"20px"}},(0,i.createElement)("text",{style:{fontSize:"12px"},x:"0",y:"15"},"SPAN"));default:return(0,i.createElement)(c.SVG,{style:{width:"25px",height:"20px"}},(0,i.createElement)("text",{style:{fontSize:"12px"},x:"0",y:"15"},"DEFAULT"))}},r=e=>{l({tag:e})};return(0,i.createElement)(s.BlockControls,null,(0,i.createElement)(c.DropdownMenu,{icon:n(t.tag),label:(0,o.__)("Select tag","otter-blocks"),className:"components-toolbar",controls:[{title:(0,o.__)("Heading","otter-blocks")+" 1",icon:n("h1"),onClick:()=>r("h1")},{title:(0,o.__)("Heading","otter-blocks")+" 2",icon:n("h2"),onClick:()=>r("h2")},{title:(0,o.__)("Heading","otter-blocks")+" 3",icon:n("h3"),onClick:()=>r("h3")},{title:(0,o.__)("Heading","otter-blocks")+" 4",icon:n("h4"),onClick:()=>r("h4")},{title:(0,o.__)("Heading","otter-blocks")+" 5",icon:n("h5"),onClick:()=>r("h5")},{title:(0,o.__)("Heading","otter-blocks")+" 6",icon:n("h6"),onClick:()=>r("h6")},{title:(0,o.__)("Division","otter-blocks"),icon:n("div"),onClick:()=>r("div")},{title:(0,o.__)("Paragraph","otter-blocks"),icon:n("p"),onClick:()=>r("p")},{title:(0,o.__)("Span Tag","otter-blocks"),icon:n("span"),onClick:()=>r("span")}]}),(0,i.createElement)(c.ToolbarGroup,null,(0,i.createElement)(c.Dropdown,{contentClassName:"wp-themesiel-blocks-advanced-heading-popover-content",position:"bottom center",renderToggle:e=>{let{isOpen:t,onToggle:l}=e;return(0,i.createElement)(c.Button,{className:"components-dropdown-menu__toggle",icon:"editor-textcolor",onClick:l,"aria-haspopup":"true","aria-expanded":t,label:(0,o.__)("Typography Settings","otter-blocks"),showTooltip:!0},(0,i.createElement)("span",{className:"components-dropdown-menu__indicator"}))},renderContent:()=>(0,i.createElement)(i.Fragment,null,(0,i.createElement)(y.Z,{label:(0,o.__)("Font Family","otter-blocks"),value:t.fontFamily,onChangeFontFamily:a,valueVariant:t.fontVariant,onChangeFontVariant:e=>l({fontVariant:e}),valueStyle:t.fontStyle,onChangeFontStyle:e=>l({fontStyle:e}),valueTransform:t.textTransform,onChangeTextTransform:e=>l({textTransform:e})}),(0,i.createElement)(c.RangeControl,{label:(0,o.__)("Line Height","otter-blocks"),value:t.lineHeight,onChange:e=>l({lineHeight:e}),step:.1,min:0,max:3}),(0,i.createElement)(c.RangeControl,{label:(0,o.__)("Letter Spacing","otter-blocks"),value:t.letterSpacing,onChange:e=>l({letterSpacing:e}),step:.1,min:-50,max:100}))})))},X=l(2136),ee=l(2372),te=l(1661),le=e=>{let{attributes:t,setAttributes:l}=e;const a=(0,v.useSelect)((e=>{const{getView:t}=e("themeisle-gutenberg/data"),{__experimentalGetPreviewDeviceType:l}=!!e("core/edit-post")&&e("core/edit-post");return l?l():t()}),[]),[n,r]=(0,i.useState)("style"),d={top:"paddingTop",right:"paddingRight",bottom:"paddingBottom",left:"paddingLeft"},u={top:"paddingTopTablet",right:"paddingRightTablet",bottom:"paddingBottomTablet",left:"paddingLeftTablet"},b={top:"paddingTopMobile",right:"paddingRightMobile",bottom:"paddingBottomMobile",left:"paddingLeftMobile"},m=e=>{if("top"==e)switch(a){case"Desktop":return"linked"===t.paddingType?t.padding:t.paddingTop;case"Tablet":return"linked"===t.paddingTypeTablet?t.paddingTablet:t.paddingTopTablet;case"Mobile":return"linked"===t.paddingTypeMobile?t.paddingMobile:t.paddingTopMobile}else if("right"==e)switch(a){case"Desktop":return"linked"===t.paddingType?t.padding:t.paddingRight;case"Tablet":return"linked"===t.paddingTypeTablet?t.paddingTablet:t.paddingRightTablet;case"Mobile":return"linked"===t.paddingTypeMobile?t.paddingMobile:t.paddingRightMobile}else if("bottom"==e)switch(a){case"Desktop":return"linked"===t.paddingType?t.padding:t.paddingBottom;case"Tablet":return"linked"===t.paddingTypeTablet?t.paddingTablet:t.paddingBottomTablet;case"Mobile":return"linked"===t.paddingTypeMobile?t.paddingMobile:t.paddingBottomMobile}else if("left"==e)switch(a){case"Desktop":return"linked"===t.paddingType?t.padding:t.paddingLeft;case"Tablet":return"linked"===t.paddingTypeTablet?t.paddingTablet:t.paddingLeftTablet;case"Mobile":return"linked"===t.paddingTypeMobile?t.paddingMobile:t.paddingLeftMobile}},p={top:"marginTop",bottom:"marginBottom"},g={top:"marginTopTablet",bottom:"marginBottomTablet"},h={top:"marginTopMobile",bottom:"marginBottomMobile"},f=e=>{if("top"==e)switch(a){case"Desktop":return"linked"===t.marginType?t.margin:t.marginTop;case"Tablet":return"linked"===t.marginTypeTablet?t.marginTablet:t.marginTopTablet;case"Mobile":return"linked"===t.marginTypeMobile?t.marginMobile:t.marginTopMobile}else if("bottom"==e)switch(a){case"Desktop":return"linked"===t.marginType?t.margin:t.marginBottom;case"Tablet":return"linked"===t.marginTypeTablet?t.marginTablet:t.marginBottomTablet;case"Mobile":return"linked"===t.marginTypeMobile?t.marginMobile:t.marginBottomMobile}};return(0,i.createElement)(i.Fragment,null,(0,i.createElement)(s.InspectorControls,null,(0,i.createElement)(w.Z,{value:n,options:[{label:(0,o.__)("Style","otter-blocks"),value:"style"},{label:(0,o.__)("Advanced","otter-blocks"),value:"advanced"}],onChange:r}),"style"===n&&(0,i.createElement)(i.Fragment,null,(0,i.createElement)(c.PanelBody,{title:(0,o.__)("General Settings","otter-blocks"),className:"o-adv-h-panel"},(0,i.createElement)(s.__experimentalColorGradientControl,{label:(0,o.__)("Heading Color","otter-blocks"),colorValue:t.headingColor,onColorChange:e=>l({headingColor:e})}),(0,i.createElement)(M.Z,{label:(0,o.__)("Font Size","otter-blocks")},(0,i.createElement)(c.RangeControl,{value:(()=>{switch(a){case"Desktop":return t.fontSize;case"Tablet":return t.fontSizeTablet;case"Mobile":return t.fontSizeMobile;default:return}})()||"",onChange:e=>{"Desktop"===a?l({fontSize:e}):"Tablet"===a?l({fontSizeTablet:e}):"Mobile"===a&&l({fontSizeMobile:e})},step:.1,min:1,max:500,allowReset:!0})),(0,i.createElement)(M.Z,{label:(0,o.__)("Alignment","otter-blocks")},(0,i.createElement)(s.AlignmentToolbar,{value:(()=>{switch(a){case"Desktop":return t.align;case"Tablet":return t.alignTablet;case"Mobile":return t.alignMobile;default:return}})(),onChange:e=>{"Desktop"===a?l({align:e}):"Tablet"===a?l({alignTablet:e}):"Mobile"===a&&l({alignMobile:e})},isCollapsed:!1}))),(0,i.createElement)(c.PanelBody,{title:(0,o.__)("Typography Settings","otter-blocks"),initialOpen:!1},(0,i.createElement)(y.Z,{label:(0,o.__)("Font Family","otter-blocks"),value:t.fontFamily,onChangeFontFamily:e=>{l(e?{fontFamily:e,fontVariant:"normal",fontStyle:"normal"}:{fontFamily:e,fontVariant:e})},valueVariant:t.fontVariant,onChangeFontVariant:e=>l({fontVariant:e}),valueStyle:t.fontStyle,onChangeFontStyle:e=>l({fontStyle:e}),valueTransform:t.textTransform,onChangeTextTransform:e=>l({textTransform:e})}),(0,i.createElement)(k.Z,{values:["fontFamily","fontVariant","fontStyle","textTransform"],setAttributes:l}),(0,i.createElement)(c.RangeControl,{label:(0,o.__)("Line Height","otter-blocks"),value:t.lineHeight,onChange:e=>l({lineHeight:e}),step:.1,min:0,max:3,allowReset:!0}),(0,i.createElement)(c.RangeControl,{label:(0,o.__)("Letter Spacing","otter-blocks"),value:t.letterSpacing,onChange:e=>l({letterSpacing:e}),step:.1,min:-50,max:100,allowReset:!0}),(0,i.createElement)(c.ToggleControl,{label:(0,o.__)("Shadow Properties","otter-blocks"),checked:t.textShadow,onChange:e=>l({textShadow:e})}),t.textShadow&&(0,i.createElement)(i.Fragment,null,(0,i.createElement)(s.__experimentalColorGradientControl,{label:(0,o.__)("Color","otter-blocks"),colorValue:t.textShadowColor,onColorChange:e=>l({textShadowColor:e})}),(0,i.createElement)(X.Z,{label:(0,o.__)("Shadow Properties","otter-blocks")},(0,i.createElement)(c.RangeControl,{label:(0,o.__)("Opacity","otter-blocks"),value:t.textShadowColorOpacity,onChange:e=>l({textShadowColorOpacity:e}),min:0,max:100}),(0,i.createElement)(c.RangeControl,{label:(0,o.__)("Blur","otter-blocks"),value:t.textShadowBlur,onChange:e=>l({textShadowBlur:e}),min:0,max:100}),(0,i.createElement)(c.RangeControl,{label:(0,o.__)("Horizontal","otter-blocks"),value:t.textShadowHorizontal,onChange:e=>l({textShadowHorizontal:e}),min:-100,max:100}),(0,i.createElement)(c.RangeControl,{label:(0,o.__)("Vertical","otter-blocks"),value:t.textShadowVertical,onChange:e=>l({textShadowVertical:e}),min:-100,max:100})))))||"advanced"===n&&(0,i.createElement)(i.Fragment,null,(0,i.createElement)(c.PanelBody,{title:(0,o.__)("Highlight Color","otter-blocks")},(0,i.createElement)(s.__experimentalColorGradientControl,{label:(0,o.__)("Highlight Color","otter-blocks"),colorValue:t.highlightColor,onColorChange:e=>l({highlightColor:e})}),(0,i.createElement)(s.__experimentalColorGradientControl,{label:(0,o.__)("Highlight Background","otter-blocks"),colorValue:t.highlightBackground,onColorChange:e=>l({highlightBackground:e})})),(0,i.createElement)(c.PanelBody,{title:(0,o.__)("Spacing","otter-blocks"),initialOpen:!1},(0,i.createElement)(M.Z,{label:(0,o.__)("Padding","otter-blocks")},(0,i.createElement)(ee.Z,{type:(()=>{switch(a){case"Desktop":return t.paddingType;case"Tablet":return t.paddingTypeTablet;case"Mobile":return t.paddingTypeMobile;default:return}})(),min:0,max:500,changeType:e=>{"Desktop"===a?l({paddingType:e}):"Tablet"===a?l({paddingTypeTablet:e}):"Mobile"===a&&l({paddingTypeMobile:e})},onChange:(e,o)=>{switch(a){case"Desktop":"linked"===t.paddingType?l({padding:o}):l({[d[e]]:o});break;case"Tablet":"linked"===t.paddingTypeTablet?l({paddingTablet:o}):l({[u[e]]:o});break;case"Mobile":"linked"===t.paddingTypeMobile?l({paddingMobile:o}):l({[b[e]]:o})}},options:[{label:(0,o.__)("Top","otter-blocks"),type:"top",value:m("top")},{label:(0,o.__)("Right","otter-blocks"),type:"right",value:m("right")},{label:(0,o.__)("Bottom","otter-blocks"),type:"bottom",value:m("bottom")},{label:(0,o.__)("Left","otter-blocks"),type:"left",value:m("left")}]})),(0,i.createElement)(k.Z,{values:[{padding:"Desktop"===a&&"linked"===t.paddingType},{paddingTablet:"Tablet"===a&&"linked"===t.paddingType},{paddingMobile:"Mobile"===a&&"linked"===t.paddingType},{paddingRight:"Desktop"===a&&"linked"!==t.paddingType},{paddingRightTablet:"Tablet"===a&&"linked"!==t.paddingType},{paddingRightMobile:"Mobile"===a&&"linked"!==t.paddingType},{paddingTop:"Desktop"===a&&"linked"!==t.paddingType},{paddingTopTablet:"Tablet"===a&&"linked"!==t.paddingType},{paddingTopMobile:"Mobile"===a&&"linked"!==t.paddingType},{paddingBottom:"Desktop"===a&&"linked"!==t.paddingType},{paddingBottomTablet:"Tablet"===a&&"linked"!==t.paddingType},{paddingBottomMobile:"Mobile"===a&&"linked"!==t.paddingType},{paddingLeft:"Desktop"===a&&"linked"!==t.paddingType},{paddingLeftTablet:"Tablet"===a&&"linked"!==t.paddingType},{paddingLeftMobile:"Mobile"===a&&"linked"!==t.paddingType}],setAttributes:l}),(0,i.createElement)(M.Z,{label:(0,o.__)("Margin","otter-blocks")},(0,i.createElement)(ee.Z,{type:(()=>{switch(a){case"Desktop":return t.marginType;case"Tablet":return t.marginTypeTablet;case"Mobile":return t.marginTypeMobile;default:return}})(),min:-500,max:500,changeType:e=>{switch(a){case"Desktop":l({marginType:e});break;case"Tablet":l({marginTypeTablet:e});break;case"Mobile":l({marginTypeMobile:e})}},onChange:(e,o)=>{switch(a){case"Desktop":"linked"===t.marginType?l({margin:o}):l({[p[e]]:o});break;case"Tablet":"linked"===t.marginTypeTablet?l({marginTablet:o}):l({[g[e]]:o});break;case"Mobile":"linked"===t.marginTypeMobile?l({marginMobile:o}):l({[h[e]]:o})}},options:[{label:(0,o.__)("Top","otter-blocks"),type:"top",value:f("top")},{label:(0,o.__)("Right","otter-blocks"),disabled:!0},{label:(0,o.__)("Bottom","otter-blocks"),type:"bottom",value:f("bottom")},{label:(0,o.__)("Left","otter-blocks"),disabled:!0}]})),(0,i.createElement)(k.Z,{values:[{margin:"Desktop"===a&&"linked"===t.marginType},{marginTablet:"Tablet"===a&&"linked"===t.marginType},{marginMobile:"Mobile"===a&&"linked"===t.marginType},{marginTop:"Desktop"===a&&"linked"!==t.marginType},{marginTopTablet:"Tablet"===a&&"linked"!==t.marginType},{marginTopMobile:"Mobile"===a&&"linked"!==t.marginType},{marginBottom:"Desktop"===a&&"linked"!==t.marginType},{marginBottomTablet:"Tablet"===a&&"linked"!==t.marginType},{marginBottomMobile:"Mobile"===a&&"linked"!==t.marginType}],setAttributes:l}))),(0,i.createElement)(C.p,null)),(0,i.createElement)(te.Z,{value:t.id,onChange:e=>l({id:e})}))};const{attributes:oe}=I;const{name:ae}=I;(0,a.registerBlockType)(ae,{...I,title:(0,o.__)("Advanced Heading","otter-blocks"),description:(0,o.__)("Advanced Heading gives a spin to editor's Heading block with much needed customization options. Powered by Otter.","otter-blocks"),icon:r.headingIcon,keywords:["heading","title","advanced heading"],deprecated:U,transforms:q,edit:e=>{let{attributes:t,setAttributes:l,clientId:n,mergeBlocks:r,onReplace:c}=e;const{isViewportAvailable:d,isPreviewDesktop:u,isPreviewTablet:b,isPreviewMobile:m}=(0,v.useSelect)((e=>{const{__experimentalGetPreviewDeviceType:t}=!!e("core/edit-post")&&e("core/edit-post");return{isViewportAvailable:!!t,isPreviewDesktop:!!t&&"Desktop"===t(),isPreviewTablet:!!t&&"Tablet"===t(),isPreviewMobile:!!t&&"Mobile"===t()}}),[]),p=(0,Y.useViewportMatch)("large",">="),g=(0,Y.useViewportMatch)("large","<="),y=(0,Y.useViewportMatch)("small",">="),k=(0,Y.useViewportMatch)("small","<=");(0,i.useEffect)((()=>{h.Z.attach();const e=(0,L.blockInit)(n,oe);return()=>e(t.id)}),[t.id]);let f,_,w,C=p&&!g&&y&&!k,E=!p&&!g&&y&&!k,x=!(p||g||y||k);d&&!x&&(C=u,E=b,x=m),C&&(f={fontSize:t.fontSize?`${t.fontSize}px`:void 0},_={textAlign:t.align,paddingTop:"linked"===t.paddingType?`${t.padding}px`:`${t.paddingTop}px`,paddingRight:"linked"===t.paddingType?`${t.padding}px`:`${t.paddingRight}px`,paddingBottom:"linked"===t.paddingType?`${t.padding}px`:`${t.paddingBottom}px`,paddingLeft:"linked"===t.paddingType?`${t.padding}px`:`${t.paddingLeft}px`,marginTop:"linked"===t.marginType?`${t.margin}px`:`${t.marginTop}px`,marginBottom:"linked"===t.marginType?`${t.margin}px`:`${t.marginBottom}px`}),E&&(f={fontSize:t.fontSizeTablet?`${t.fontSizeTablet}px`:void 0},_={textAlign:t.alignTablet,paddingTop:"linked"===t.paddingTypeTablet?`${t.paddingTablet}px`:`${t.paddingTopTablet}px`,paddingRight:"linked"===t.paddingTypeTablet?`${t.paddingTablet}px`:`${t.paddingRightTablet}px`,paddingBottom:"linked"===t.paddingTypeTablet?`${t.paddingTablet}px`:`${t.paddingBottomTablet}px`,paddingLeft:"linked"===t.paddingTypeTablet?`${t.paddingTablet}px`:`${t.paddingLeftTablet}px`,marginTop:"linked"===t.marginTypeTablet?`${t.marginTablet}px`:`${t.marginTopTablet}px`,marginBottom:"linked"===t.marginTypeTablet?`${t.marginTablet}px`:`${t.marginBottomTablet}px`}),x&&(f={fontSize:t.fontSizeMobile?`${t.fontSizeMobile}px`:void 0},_={textAlign:t.alignMobile,paddingTop:"linked"===t.paddingTypeMobile?`${t.paddingMobile}px`:`${t.paddingTopMobile}px`,paddingRight:"linked"===t.paddingTypeMobile?`${t.paddingMobile}px`:`${t.paddingRightMobile}px`,paddingBottom:"linked"===t.paddingTypeMobile?`${t.paddingMobile}px`:`${t.paddingBottomMobile}px`,paddingLeft:"linked"===t.paddingTypeMobile?`${t.paddingMobile}px`:`${t.paddingLeftMobile}px`,marginTop:"linked"===t.marginTypeMobile?`${t.marginMobile}px`:`${t.marginTopMobile}px`,marginBottom:"linked"===t.marginTypeMobile?`${t.marginMobile}px`:`${t.marginBottomMobile}px`}),t.textShadow&&(w={textShadow:`${t.textShadowHorizontal}px ${t.textShadowVertical}px ${t.textShadowBlur}px ${Z()(t.textShadowColor?t.textShadowColor:"#000000",0<=t.textShadowColorOpacity?t.textShadowColorOpacity||1e-5:1)}`});const S=(0,K.omitBy)({color:t.headingColor,...f,fontFamily:t.fontFamily||void 0,fontWeight:"regular"===t.fontVariant?"normal":t.fontVariant,fontStyle:t.fontStyle||void 0,textTransform:t.textTransform||void 0,lineHeight:(3<t.lineHeight?t.lineHeight+"px":t.lineHeight)||void 0,letterSpacing:t.letterSpacing&&`${t.letterSpacing}px`,..._,...w},(e=>{var t;return null==e||null===(t=e.includes)||void 0===t?void 0:t.call(e,"undefined")})),T=(0,s.useBlockProps)({id:t.id,style:S});return(0,i.useEffect)((()=>{t.fontFamily&&h.Z.loadFontToBrowser(t.fontFamily,t.fontVariant)}),[t.fontFamily]),(0,i.createElement)(i.Fragment,null,(0,i.createElement)("style",null,`#block-${n} mark, #block-${n} .highlight {\n\t\t\t\t\t\tcolor: ${t.highlightColor};\n\t\t\t\t\t\tbackground: ${t.highlightBackground};\n\t\t\t\t\t}`),(0,i.createElement)(Q,{attributes:t,setAttributes:l}),(0,i.createElement)(le,{attributes:t,setAttributes:l}),(0,i.createElement)(s.RichText,(0,J.Z)({identifier:"content",value:t.content,placeholder:(0,o.__)("Write heading…","otter-blocks"),tagName:t.tag,allowedFormats:["core/bold","core/italic","core/link","core/strikethrough","themeisle-blocks/highlight","themeisle-blocks/count-animation","themeisle-blocks/typing-animation","themeisle-blocks/dynamic-value","themeisle-blocks/dynamic-link"],onMerge:r,onSplit:(e,l)=>{let o;var r;return o=l||e?(0,a.createBlock)("themeisle-blocks/advanced-heading",{...t,content:e}):(0,a.createBlock)(null!==(r=(0,a.getDefaultBlockName)())&&void 0!==r?r:"themeisle-blocks/advanced-heading"),l&&(o.clientId=n),o},onReplace:c,onRemove:()=>c([]),onChange:e=>{l({content:e})}},T)))},save:e=>{let{attributes:t}=e;const l=s.useBlockProps.save({id:t.id,className:t.id});return(0,i.createElement)(s.RichText.Content,(0,J.Z)({tagName:t.tag,value:t.content},l))},example:{attributes:{content:(0,o.__)("A heading with more customization options","otter-blocks")}}});var ne=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"themeisle-blocks/button-group","title":"Button Group","category":"themeisle-blocks","description":"Prompt visitors to take action with a button group. Powered by Otter.","keywords":["button","buttons","button group"],"textdomain":"otter-blocks","attributes":{"id":{"type":"string"},"align":{"type":["string","object"]},"spacing":{"type":"number","default":20},"paddingTopBottom":{"type":"number"},"paddingLeftRight":{"type":"number"},"collapse":{"type":"string","default":"collapse-none"},"fontSize":{"type":"number"},"fontFamily":{"type":"string"},"fontVariant":{"type":"string"},"textTransform":{"type":"string"},"fontStyle":{"type":"string"},"lineHeight":{"type":"number"}},"editorStyle":"otter-button-group-editor","style":"otter-button-group-style"}');const re={id:{type:"string"},buttons:{type:"number",default:2},align:{type:"string"},spacing:{type:"number",default:20},collapse:{type:"string",default:"collapse-none"},fontSize:{type:"number",default:18},fontFamily:{type:"string"},fontVariant:{type:"string"},textTransform:{type:"string"},fontStyle:{type:"string",default:"normal"},lineHeight:{type:"number"},data:{type:"array",default:[{text:"",link:"",newTab:!1,color:"#ffffff",background:"#32373c",border:"",hoverColor:"",hoverBackground:"",hoverBorder:"",borderSize:0,borderRadius:0,boxShadow:!1,boxShadowColor:"",boxShadowColorOpacity:50,boxShadowBlur:5,boxShadowSpread:1,boxShadowHorizontal:0,boxShadowVertical:0,hoverBoxShadowColor:"",hoverBoxShadowColorOpacity:50,hoverBoxShadowBlur:5,hoverBoxShadowSpread:1,hoverBoxShadowHorizontal:0,hoverBoxShadowVertical:0,iconType:"none",prefix:"",icon:"",paddingTopBottom:12,paddingLeftRight:24},{text:"",link:"",newTab:!1,color:"#ffffff",background:"#32373c",border:"",hoverColor:"",hoverBackground:"",hoverBorder:"",borderSize:0,borderRadius:0,boxShadow:!1,boxShadowColor:"",boxShadowColorOpacity:50,boxShadowBlur:5,boxShadowSpread:1,boxShadowHorizontal:0,boxShadowVertical:0,hoverBoxShadowColor:"",hoverBoxShadowColorOpacity:50,hoverBoxShadowBlur:5,hoverBoxShadowSpread:1,hoverBoxShadowHorizontal:0,hoverBoxShadowVertical:0,iconType:"none",prefix:"",icon:"",paddingTopBottom:12,paddingLeftRight:24}]}},ie=[{attributes:re,save:e=>{let{attributes:t,className:l}=e;const o="collapse-none"!==t.collapse?t.collapse:"",a={fontSize:`${t.fontSize}px`,fontFamily:t.fontFamily,fontWeight:t.fontVariant,fontStyle:t.fontStyle,textTransform:t.textTransform,lineHeight:t.lineHeight&&`${t.lineHeight}px`};return(0,i.createElement)("div",{id:t.id,className:g()(l,o),style:{justifyContent:t.align,alignItems:t.align?t.align:"flex-start"}},(0,K.times)(t.buttons,(e=>(e=>{const l={...a,borderWidth:`${t.data[e].borderSize}px`,borderRadius:`${t.data[e].borderRadius}px`,padding:`${t.data[e].paddingTopBottom}px ${t.data[e].paddingLeftRight}px`};return(0,i.createElement)(i.Fragment,null,(0,i.createElement)("a",{href:t.data[e].link,target:t.data[e].newTab?"_blank":"_self",className:g()("wp-block-themeisle-blocks-button",`wp-block-themeisle-blocks-button-${e}`),style:l},("left"===t.data[e].iconType||"only"===t.data[e].iconType)&&(0,i.createElement)("i",{className:g()(t.data[e].prefix,"fa-fw",`fa-${t.data[e].icon}`,{"margin-right":"left"===t.data[e].iconType})}),"only"!==t.data[e].iconType&&(0,i.createElement)(s.RichText.Content,{tagName:"span",value:t.data[e].text}),"right"===t.data[e].iconType&&(0,i.createElement)("i",{className:`${t.data[e].prefix} fa-fw fa-${t.data[e].icon} margin-left`})))})(e))))}},{attributes:re,save:e=>{let{attributes:t,className:l}=e;const o="collapse-none"!==t.collapse?t.collapse:"",a={fontSize:`${t.fontSize}px`,fontFamily:t.fontFamily,fontWeight:t.fontVariant,fontStyle:t.fontStyle,textTransform:t.textTransform,lineHeight:t.lineHeight&&`${t.lineHeight}px`};return(0,i.createElement)("div",{id:t.id,className:g()(l,o),style:{justifyContent:t.align,alignItems:t.align?t.align:"flex-start"}},(0,K.times)(t.buttons,(e=>(e=>{const l={...a,borderWidth:`${t.data[e].borderSize}px`,borderRadius:`${t.data[e].borderRadius}px`,padding:`${t.data[e].paddingTopBottom}px ${t.data[e].paddingLeftRight}px`};return(0,i.createElement)(i.Fragment,null,(0,i.createElement)("a",{href:t.data[e].link,target:t.data[e].newTab?"_blank":"_self",className:g()("wp-block-themeisle-blocks-button",`wp-block-themeisle-blocks-button-${e}`),style:l,rel:"noopener noreferrer"},("left"===t.data[e].iconType||"only"===t.data[e].iconType)&&(0,i.createElement)("i",{className:g()(t.data[e].prefix,"fa-fw",`fa-${t.data[e].icon}`,{"margin-right":"left"===t.data[e].iconType})}),"only"!==t.data[e].iconType&&(0,i.createElement)(s.RichText.Content,{tagName:"span",value:t.data[e].text}),"right"===t.data[e].iconType&&(0,i.createElement)("i",{className:`${t.data[e].prefix} fa-fw fa-${t.data[e].icon} margin-left`})))})(e))))}},{attributes:{...re,fontSize:{type:"number"},fontStyle:{type:"string"},data:{type:"array",default:[{text:"",link:"",newTab:!1,color:"",background:"",border:"",hoverColor:"",hoverBackground:"",hoverBorder:"",borderSize:"",borderRadius:"",boxShadow:!1,boxShadowColor:"",boxShadowColorOpacity:50,boxShadowBlur:5,boxShadowSpread:1,boxShadowHorizontal:0,boxShadowVertical:0,hoverBoxShadowColor:"",hoverBoxShadowColorOpacity:50,hoverBoxShadowBlur:5,hoverBoxShadowSpread:1,hoverBoxShadowHorizontal:0,hoverBoxShadowVertical:0,iconType:"none",prefix:"",icon:"",paddingTopBottom:"",paddingLeftRight:""},{text:"",link:"",newTab:!1,color:"",background:"",border:"",hoverColor:"",hoverBackground:"",hoverBorder:"",borderSize:"",borderRadius:"",boxShadow:!1,boxShadowColor:"",boxShadowColorOpacity:50,boxShadowBlur:5,boxShadowSpread:1,boxShadowHorizontal:0,boxShadowVertical:0,hoverBoxShadowColor:"",hoverBoxShadowColorOpacity:50,hoverBoxShadowBlur:5,hoverBoxShadowSpread:1,hoverBoxShadowHorizontal:0,hoverBoxShadowVertical:0,iconType:"none",prefix:"",icon:"",paddingTopBottom:"",paddingLeftRight:""}]}},migrate:(e,t)=>{let l,o,n;return"flex-start"===e.align&&(l="left"),"center"===e.align&&(l="center"),"flex-end"===e.align&&(l="right"),e.data&&(o=(0,K.pick)(e.data[0],["paddingLeftRight","paddingTopBottom"]),1<=Object.keys(o).length&&(o=(0,K.pick)(o,Object.keys(o).filter((e=>""!==o[e])))),n=e.data.filter(((t,l)=>l<e.buttons)).map((e=>{const t=(0,K.omit)(e,["paddingLeftRight","paddingTopBottom"]);return(0,a.createBlock)("themeisle-blocks/button",{...t})}))),[{...(0,K.omit)(e,["buttons","data"]),align:l,...o},[...n,...t]]},save:e=>{let{attributes:t,className:l}=e;const o="collapse-none"!==t.collapse?t.collapse:"";return(0,i.createElement)("div",{id:t.id,className:g()(l,o,"wp-block-button")},(0,K.times)(t.buttons,(e=>(e=>(0,i.createElement)("a",{href:t.data[e].link,target:t.data[e].newTab?"_blank":"_self",className:g()("wp-block-themeisle-blocks-button",`wp-block-themeisle-blocks-button-${e}`,"wp-block-button__link"),rel:"noopener noreferrer"},("left"===t.data[e].iconType||"only"===t.data[e].iconType)&&(0,i.createElement)("i",{className:g()(t.data[e].prefix,"fa-fw",`fa-${t.data[e].icon}`,{"margin-right":"left"===t.data[e].iconType})}),"only"!==t.data[e].iconType&&(0,i.createElement)(s.RichText.Content,{tagName:"span",value:t.data[e].text}),"right"===t.data[e].iconType&&(0,i.createElement)("i",{className:`${t.data[e].prefix} fa-fw fa-${t.data[e].icon} margin-left`})))(e))))}}];var se=ie,ce=l(4022),de=l(1138),ue=l(4934),be=l(2380),me=l(9700),pe=l(8286),ge=e=>{var t,l;let{attributes:a,setAttributes:n,currentDevice:r}=e;return(0,i.createElement)(s.InspectorControls,null,(0,i.createElement)(c.PanelBody,{title:(0,o.__)("Spacing","otter-blocks")},(0,i.createElement)(ee.Z,{label:(0,o.__)("Padding","otter-blocks"),min:0,max:100,onChange:(e,t)=>{"top"!==e&&"bottom"!==e||n({paddingTopBottom:t}),"right"!==e&&"left"!==e||n({paddingLeftRight:t})},options:[{label:(0,o.__)("Top","otter-blocks"),type:"top",value:a.paddingTopBottom},{label:(0,o.__)("Right","otter-blocks"),type:"right",value:a.paddingLeftRight},{label:(0,o.__)("Bottom","otter-blocks"),type:"bottom",value:a.paddingTopBottom},{label:(0,o.__)("Left","otter-blocks"),type:"left",value:a.paddingLeftRight}]}),(0,i.createElement)(c.RangeControl,{label:(0,o.__)("Spacing","otter-blocks"),value:a.spacing,onChange:e=>n({spacing:e}),step:.1,min:0,max:50}),(0,i.createElement)(c.SelectControl,{label:(0,o.__)("Collapse On","otter-blocks"),value:a.collapse,options:[{label:(0,o.__)("None","otter-blocks"),value:"collapse-none"},{label:(0,o.__)("Desktop","otter-blocks"),value:"collapse-desktop"},{label:(0,o.__)("Tablet","otter-blocks"),value:"collapse-tablet"},{label:(0,o.__)("Mobile","otter-blocks"),value:"collapse-mobile"}],onChange:e=>n({collapse:e})}),(0,i.createElement)(M.Z,{label:(0,o.__)("Alignment","otter-blocks"),className:"buttons-alignment-control"},(0,i.createElement)(pe.Z,{value:null!==(t=null==a||null===(l=a.align)||void 0===l?void 0:l[r])&&void 0!==t?t:"none",options:[{icon:ce.Z,label:(0,o.__)("None","otter-blocks"),value:"none"},{icon:de.Z,label:(0,o.__)("Full","otter-blocks"),value:"full"},{icon:ue.Z,label:(0,o.__)("Left","otter-blocks"),value:"left"},{icon:be.Z,label:(0,o.__)("Center","otter-blocks"),value:"center"},{icon:me.Z,label:(0,o.__)("Right","otter-blocks"),value:"right"}],onChange:e=>{const t=a.align?{desktop:a.align.desktop,tablet:a.align.tablet,mobile:a.align.mobile}:{};t[r]="none"===e?void 0:e,n({align:t})},hasIcon:!0}))),(0,i.createElement)(c.PanelBody,{title:(0,o.__)("Typography Settings","otter-blocks"),initialOpen:!1},(0,i.createElement)(c.RangeControl,{label:(0,o.__)("Font Size","otter-blocks"),value:a.fontSize,onChange:e=>n({fontSize:e}),step:.1,min:0,max:50}),(0,i.createElement)(y.Z,{label:(0,o.__)("Font Family","otter-blocks"),value:a.fontFamily,onChangeFontFamily:e=>{n(e?{fontFamily:e,fontVariant:"normal",fontStyle:"normal"}:{fontFamily:void 0,fontVariant:void 0,fontStyle:void 0})},valueVariant:a.fontVariant,onChangeFontVariant:e=>n({fontVariant:e}),valueStyle:a.fontStyle,onChangeFontStyle:e=>n({fontStyle:e}),valueTransform:a.textTransform,onChangeTextTransform:e=>n({textTransform:e})}),(0,i.createElement)(c.RangeControl,{label:(0,o.__)("Line Height","otter-blocks"),value:a.lineHeight,onChange:e=>n({lineHeight:e}),step:.1,min:0,max:200})))};const{attributes:he}=ne;const{name:ve}=ne;(0,a.registerBlockType)(ve,{...ne,title:(0,o.__)("Button Group","otter-blocks"),description:(0,o.__)("Prompt visitors to take action with a button group. Powered by Otter.","otter-blocks"),icon:r.buttonsIcon,keywords:["button","buttons","button group"],deprecated:se,edit:e=>{let{attributes:t,setAttributes:l,clientId:o}=e;const{isViewportAvailable:a,isPreviewDesktop:n,isPreviewTablet:r,isPreviewMobile:c}=(0,v.useSelect)((e=>{const{__experimentalGetPreviewDeviceType:t}=!!e("core/edit-post")&&e("core/edit-post");return{isViewportAvailable:!!t,isPreviewDesktop:!!t&&"Desktop"===t(),isPreviewTablet:!!t&&"Tablet"===t(),isPreviewMobile:!!t&&"Mobile"===t()}}),[]),d=(0,v.useSelect)((e=>{const{getView:t}=e("themeisle-gutenberg/data"),{__experimentalGetPreviewDeviceType:l}=!!e("core/edit-post")&&e("core/edit-post");return l?l().toLowerCase():t().toLowerCase()}),[]),u=(0,Y.useViewportMatch)("large",">="),b=(0,Y.useViewportMatch)("large","<="),m=(0,Y.useViewportMatch)("small",">="),p=(0,Y.useViewportMatch)("small","<=");(0,i.useEffect)((()=>{h.Z.attach();const e=(0,L.blockInit)(o,he);return()=>e(t.id)}),[]);let y=u&&!b&&m&&!p,k=!u&&!b&&m&&!p,f=!(u||b||m||p);a&&!f&&(y=n,k=r,f=c);const _={"--spacing":t.spacing&&t.spacing+"px"},w=["desktop","tablet","mobile"].reduce(((e,l)=>(t.align&&t.align[l]&&e.push(`align-${t.align[l]}-${l}`),e)),[]),C=(0,s.useBlockProps)({id:t.id,className:g()("wp-block-buttons",{[`align-${t.align}`]:"string"==typeof t.align,collapse:"collapse-desktop"===t.collapse&&(y||k||f)||"collapse-tablet"===t.collapse&&(k||f)||"collapse-mobile"===t.collapse&&f},...w),style:_});return(0,i.useEffect)((()=>{t.fontFamily&&h.Z.loadFontToBrowser(t.fontFamily,t.fontVariant)}),[t.fontFamily]),(0,i.createElement)(i.Fragment,null,(0,i.createElement)(ge,{attributes:t,setAttributes:l,currentDevice:d}),(0,i.createElement)("div",C,(0,i.createElement)(s.InnerBlocks,{allowedBlocks:["themeisle-blocks/button"],__experimentalMoverDirection:"horizontal",orientation:"horizontal",template:[["themeisle-blocks/button"]],renderAppender:s.InnerBlocks.DefaultAppender})))},save:e=>{let{attributes:t}=e;const l="collapse-none"!==t.collapse?t.collapse:"",o=["desktop","tablet","mobile"].reduce(((e,l)=>(t.align&&t.align[l]&&e.push(`align-${t.align[l]}-${l}`),e)),[]),a=s.useBlockProps.save({id:t.id,className:g()(l,"wp-block-buttons",{[`align-${t.align}`]:"string"==typeof t.align},...o)});return(0,i.createElement)("div",a,(0,i.createElement)(s.InnerBlocks.Content,null))},example:{attributes:{spacing:20},innerBlocks:[{name:"themeisle-blocks/button",attributes:{text:(0,o.__)("Button 1","otter-blocks")}},{name:"themeisle-blocks/button",attributes:{text:(0,o.__)("Button 2","otter-blocks")}}]}});var ye=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"themeisle-blocks/button","title":"Button","category":"themeisle-blocks","description":"Prompt visitors to take action with a button group. Powered by Otter.","keywords":["button","buttons","button group"],"parent":["themeisle-blocks/button-group"],"textdomain":"otter-blocks","attributes":{"id":{"type":"string"},"text":{"type":"string","source":"html","selector":"span"},"link":{"type":"string","source":"attribute","selector":"a","attribute":"href"},"newTab":{"type":"boolean","default":false},"color":{"type":"string"},"background":{"type":"string"},"backgroundGradient":{"type":"string"},"border":{"type":"string"},"hoverColor":{"type":"string"},"hoverBackground":{"type":"string"},"hoverBackgroundGradient":{"type":"string"},"hoverBorder":{"type":"string"},"borderSize":{"type":"number"},"borderRadius":{"type":"number"},"boxShadow":{"type":"boolean","default":false},"boxShadowColor":{"type":"string"},"boxShadowColorOpacity":{"type":"number","default":50},"boxShadowBlur":{"type":"number","default":5},"boxShadowSpread":{"type":"number","default":1},"boxShadowHorizontal":{"type":"number","default":0},"boxShadowVertical":{"type":"number","default":0},"hoverBoxShadowColor":{"type":"string"},"hoverBoxShadowColorOpacity":{"type":"number","default":50},"hoverBoxShadowBlur":{"type":"number","default":5},"hoverBoxShadowSpread":{"type":"number","default":1},"hoverBoxShadowHorizontal":{"type":"number","default":0},"hoverBoxShadowVertical":{"type":"number","default":0},"iconType":{"type":"string","default":"none"},"library":{"type":"string","default":"fontawesome"},"prefix":{"type":"string"},"icon":{"type":"string"}},"supports":{"reusable":false},"styles":[{"name":"fill","label":"Fill","isDefault":true},{"name":"outline","label":"Outline"}]}'),ke=l(8504),fe=e=>{let{attributes:t,setAttributes:l,isSelected:o}=e;return(0,i.createElement)(s.BlockControls,null,(0,i.createElement)(ke.Z,{isSelected:o,setAttributes:l,url:t.link,opensInNewTab:t.newTab}))},_e=e=>{let{attributes:t,setAttributes:l}=e;const[a,n]=(0,i.useState)(!1),r=()=>(0,i.createElement)(c.ButtonGroup,null,(0,i.createElement)(c.Button,{isSmall:!0,isSecondary:a,isPrimary:!a,onClick:()=>n(!1)},(0,o.__)("Normal","otter-blocks")),(0,i.createElement)(c.Button,{isSmall:!0,isSecondary:!a,isPrimary:a,onClick:()=>n(!0)},(0,o.__)("Hover","otter-blocks")));return(0,i.createElement)(s.InspectorControls,null,(0,i.createElement)(c.PanelBody,{title:(0,o.__)("Color","otter-blocks")},(0,i.createElement)(r,null),a?(0,i.createElement)(i.Fragment,{key:"with-hover"},(0,i.createElement)(s.__experimentalColorGradientControl,{label:(0,o.__)("Hover Color","otter-blocks"),colorValue:t.hoverColor,onColorChange:e=>l({hoverColor:e})}),(0,i.createElement)(s.__experimentalColorGradientControl,{label:(0,o.__)("Hover Background","otter-blocks"),colorValue:t.hoverBackground,gradientValue:t.hoverBackgroundGradient,onColorChange:e=>l({hoverBackground:e}),onGradientChange:e=>l({hoverBackgroundGradient:e})})):(0,i.createElement)(i.Fragment,{key:"without-hover"},(0,i.createElement)(s.__experimentalColorGradientControl,{label:(0,o.__)("Color","otter-blocks"),colorValue:t.color,onColorChange:e=>l({color:e})}),(0,i.createElement)(s.__experimentalColorGradientControl,{label:(0,o.__)("Background","otter-blocks"),colorValue:t.background,gradientValue:t.backgroundGradient,onColorChange:e=>l({background:e}),onGradientChange:e=>l({backgroundGradient:e})}))),(0,i.createElement)(c.PanelBody,{title:(0,o.__)("Border & Box Shadow","otter-blocks"),initialOpen:!1},(0,i.createElement)(r,null),a?(0,i.createElement)(s.__experimentalColorGradientControl,{label:(0,o.__)("Hover Border","otter-blocks"),colorValue:t.hoverBorder,onColorChange:e=>l({hoverBorder:e})}):(0,i.createElement)(s.__experimentalColorGradientControl,{label:(0,o.__)("Border","otter-blocks"),colorValue:t.border,onColorChange:e=>l({border:e})}),(0,i.createElement)(c.RangeControl,{label:(0,o.__)("Border Width","otter-blocks"),value:t.borderSize,onChange:e=>l({borderSize:e}),step:.1,min:0,max:10}),(0,i.createElement)(c.RangeControl,{label:(0,o.__)("Border Radius","otter-blocks"),value:t.borderRadius,onChange:e=>l({borderRadius:e}),step:.1,min:0,max:100}),(0,i.createElement)(X.Z,{label:(0,o.__)("Box Shadow","otter-blocks"),attributes:t,setAttributes:l,resetValues:{boxShadow:!1,boxShadowColor:void 0,boxShadowColorOpacity:50,boxShadowBlur:5,boxShadowSpread:1,boxShadowHorizontal:0,boxShadowVertical:0,hoverBoxShadowColor:void 0,hoverBoxShadowColorOpacity:50,hoverBoxShadowBlur:5,hoverBoxShadowSpread:1,hoverBoxShadowHorizontal:0,hoverBoxShadowVertical:0},onClick:()=>l({boxShadow:!0})},(0,i.createElement)(r,null),a?(0,i.createElement)(i.Fragment,{key:"with-hover"},(0,i.createElement)(s.__experimentalColorGradientControl,{label:(0,o.__)("Shadow Color on Hover","otter-blocks"),colorValue:t.hoverBoxShadowColor,onColorChange:e=>l({hoverBoxShadowColor:e})}),(0,i.createElement)(c.RangeControl,{label:(0,o.__)("Opacity","otter-blocks"),value:t.hoverBoxShadowColorOpacity,onChange:e=>l({hoverBoxShadowColorOpacity:e}),min:0,max:100}),(0,i.createElement)(c.RangeControl,{label:(0,o.__)("Blur","otter-blocks"),value:t.hoverBoxShadowBlur,onChange:e=>l({hoverBoxShadowBlur:e}),min:0,max:100}),(0,i.createElement)(c.RangeControl,{label:(0,o.__)("Spread","otter-blocks"),value:t.hoverBoxShadowSpread,onChange:e=>l({hoverBoxShadowSpread:e}),min:-100,max:100}),(0,i.createElement)(c.RangeControl,{label:(0,o.__)("Horizontal","otter-blocks"),value:t.hoverBoxShadowHorizontal,onChange:e=>l({hoverBoxShadowHorizontal:e}),min:-100,max:100}),(0,i.createElement)(c.RangeControl,{label:(0,o.__)("Vertical","otter-blocks"),value:t.hoverBoxShadowVertical,onChange:e=>l({hoverBoxShadowVertical:e}),min:-100,max:100})):(0,i.createElement)(i.Fragment,{key:"without-hover"},(0,i.createElement)(s.__experimentalColorGradientControl,{label:(0,o.__)("Shadow Color","otter-blocks"),colorValue:t.boxShadowColor,onColorChange:e=>l({boxShadowColor:e})}),(0,i.createElement)(c.RangeControl,{label:(0,o.__)("Opacity","otter-blocks"),value:t.boxShadowColorOpacity,onChange:e=>l({boxShadowColorOpacity:e}),min:0,max:100}),(0,i.createElement)(c.RangeControl,{label:(0,o.__)("Blur","otter-blocks"),value:t.boxShadowBlur,onChange:e=>l({boxShadowBlur:e}),min:0,max:100}),(0,i.createElement)(c.RangeControl,{label:(0,o.__)("Spread","otter-blocks"),value:t.boxShadowSpread,onChange:e=>l({boxShadowSpread:e}),min:-100,max:100}),(0,i.createElement)(c.RangeControl,{label:(0,o.__)("Horizontal","otter-blocks"),value:t.boxShadowHorizontal,onChange:e=>l({boxShadowHorizontal:e}),min:-100,max:100}),(0,i.createElement)(c.RangeControl,{label:(0,o.__)("Vertical","otter-blocks"),value:t.boxShadowVertical,onChange:e=>l({boxShadowVertical:e}),min:-100,max:100})))),(0,i.createElement)(c.PanelBody,{title:(0,o.__)("Icon Settings","otter-blocks"),initialOpen:!1},(0,i.createElement)(c.SelectControl,{label:(0,o.__)("Icon Position","otter-blocks"),value:t.iconType,options:[{label:(0,o.__)("No Icon","otter-blocks"),value:"none"},{label:(0,o.__)("Left","otter-blocks"),value:"left"},{label:(0,o.__)("Right","otter-blocks"),value:"right"},{label:(0,o.__)("Icon Only","otter-blocks"),value:"only"}],onChange:e=>l({iconType:e})}),"none"!==t.iconType&&(0,i.createElement)(_.Z,{label:(0,o.__)("Icon Picker","otter-blocks"),library:t.library,prefix:t.prefix,icon:t.icon,changeLibrary:e=>{l({library:e,icon:void 0,prefix:"fab"})},onChange:e=>{l("object"==typeof e?{icon:e.name,prefix:e.prefix}:{icon:e})}})))},we=l(48);const{attributes:Ce}=ye;const{name:Ee}=ye;(0,a.registerBlockType)(Ee,{...ye,title:(0,o.__)("Button","otter-blocks"),description:(0,o.__)("Prompt visitors to take action with a button group. Powered by Otter.","otter-blocks"),icon:r.buttonsIcon,keywords:["button","buttons","button group"],styles:[{name:"fill",label:(0,o.__)("Fill","otter-blocks"),isDefault:!0},{name:"outline",label:(0,o.__)("Outline","otter-blocks")},...window.themeisleGutenberg.hasNeve?[{name:"primary",label:(0,o.__)("Primary","otter-blocks")},{name:"secondary",label:(0,o.__)("Secondary","otter-blocks")}]:[]],edit:e=>{let{attributes:t,setAttributes:l,isSelected:a,clientId:n}=e;const{hasParent:r,parentAttributes:c}=(0,v.useSelect)((e=>{const{getBlock:t,getBlockRootClientId:l}=e("core/block-editor"),o=t(l(n));return{hasParent:!!o,parentAttributes:o?o.attributes:{}}}),[]);(0,i.useEffect)((()=>{const e=(0,L.blockInit)(n,Ce);return()=>e(t.id)}),[]);let d={},u={};t.boxShadow&&(d={boxShadow:`${t.boxShadowHorizontal}px ${t.boxShadowVertical}px ${t.boxShadowBlur}px ${t.boxShadowSpread}px ${Z()(t.boxShadowColor?t.boxShadowColor:"#000000",t.boxShadowColorOpacity)}`}),r&&(u={paddingTop:`${c.paddingTopBottom}px`,paddingBottom:`${c.paddingTopBottom}px`,paddingLeft:`${c.paddingLeftRight}px`,paddingRight:`${c.paddingLeftRight}px`,fontSize:c.fontSize&&`${c.fontSize}px`,fontFamily:c.fontFamily,fontWeight:c.fontVariant,fontStyle:c.fontStyle,textTransform:c.textTransform,lineHeight:c.lineHeight&&`${c.lineHeight}px`});const b={color:t.color,background:t.background||t.backgroundGradient,border:`${t.borderSize}px solid ${t.border}`,borderRadius:t.borderRadius,...d,...u},m={fill:t.color,width:c.fontSize&&`${c.fontSize}px`},p=we.ZP.icons[t.icon],[h,y]=(0,L.useCSSNode)();(0,i.useEffect)((()=>{y([`.wp-block-button__link:hover {\n\t\t\t\tcolor: ${t.hoverColor} !important;\n\t\t\t\tbackground: ${t.hoverBackground||t.hoverBackgroundGradient} !important;\n\t\t\t\tborder-color: ${t.hoverBorder} !important;\n\t\t\t\t${t.boxShadow&&`box-shadow: ${t.hoverBoxShadowHorizontal}px ${t.hoverBoxShadowVertical}px ${t.hoverBoxShadowBlur}px ${t.hoverBoxShadowSpread}px ${Z()(t.hoverBoxShadowColor?t.hoverBoxShadowColor:"#000000",t.hoverBoxShadowColorOpacity)} !important;`}\n\t\t\t}`,`.wp-block-button__link:hover svg {\n\t\t\t\tfill: ${t.hoverColor} !important;\n\t\t\t}`])}),[t.hoverColor,t.hoverBackground,t.hoverBackgroundGradient,t.hoverBorder,t.hoverColor,t.boxShadow,t.hoverBoxShadowHorizontal,t.hoverBoxShadowBlur,t.hoverBoxShadowSpread,t.hoverBoxShadowColor,t.hoverBoxShadowColorOpacity]);const k=(0,s.useBlockProps)({id:t.id,className:g()("wp-block-button",h),style:{}});return(0,i.createElement)(i.Fragment,null,(0,i.createElement)(fe,{attributes:t,setAttributes:l,isSelected:a}),(0,i.createElement)(_e,{attributes:t,setAttributes:l}),(0,i.createElement)("div",k,"none"!==t.iconType?(0,i.createElement)("div",{className:"wp-block-button__link",style:b},("left"===t.iconType||"only"===t.iconType)&&("themeisle-icons"===t.library&&t.icon?(0,i.createElement)(p,{className:g()({"margin-right":"left"===t.iconType}),style:m}):(0,i.createElement)("i",{className:g()(t.prefix,"fa-fw",`fa-${t.icon}`,{"margin-right":"left"===t.iconType})})),"only"!==t.iconType&&(0,i.createElement)(s.RichText,{placeholder:(0,o.__)("Add text…","otter-blocks"),value:t.text,onChange:e=>l({text:e}),tagName:"div",withoutInteractiveFormatting:!0}),"right"===t.iconType&&("themeisle-icons"===t.library&&t.icon?(0,i.createElement)(p,{className:"margin-left",style:m}):(0,i.createElement)("i",{className:`${t.prefix} fa-fw fa-${t.icon} margin-left`}))):(0,i.createElement)(s.RichText,{placeholder:(0,o.__)("Add text…","otter-blocks"),value:t.text,onChange:e=>l({text:e}),tagName:"div",withoutInteractiveFormatting:!0,className:"wp-block-button__link",style:b})))},save:e=>{let{attributes:t}=e;const l=we.ZP.icons[t.icon],o=s.useBlockProps.save({id:t.id,className:"wp-block-button"});return(0,i.createElement)("div",o,(0,i.createElement)("a",{href:t.link,target:t.newTab?"_blank":"_self",rel:"noopener noreferrer",className:"wp-block-button__link"},("left"===t.iconType||"only"===t.iconType)&&("themeisle-icons"===t.library&&t.icon?(0,i.createElement)(l,{className:g()({"margin-right":"left"===t.iconType})}):(0,i.createElement)("i",{className:g()(t.prefix,"fa-fw",`fa-${t.icon}`,{"margin-right":"left"===t.iconType})})),"only"!==t.iconType&&(0,i.createElement)(s.RichText.Content,{tagName:"span",value:t.text}),"right"===t.iconType&&("themeisle-icons"===t.library&&t.icon?(0,i.createElement)(l,{className:"margin-left"}):(0,i.createElement)("i",{className:`${t.prefix} fa-fw fa-${t.icon} margin-left`}))))},example:{attributes:{}}});var xe=l(269),Se=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"themeisle-blocks/circle-counter","title":"Circle Counter","category":"themeisle-blocks","description":"Show your progress with a beautiful Circle Counter block. Powered by Otter.","keywords":["progress","circle","counter"],"textdomain":"otter-blocks","attributes":{"id":{"type":"string"},"title":{"type":"string","default":"Skill"},"percentage":{"type":"number","default":50},"duration":{"type":"number","default":2},"titleStyle":{"type":"string","default":"default"},"height":{"type":"number","default":100},"fontSizeTitle":{"type":"number"},"fontSizePercent":{"type":"number"},"strokeWidth":{"type":"number","default":10},"backgroundColor":{"type":"string"},"progressColor":{"type":"string"},"titleColor":{"type":"string"}},"editorStyle":"otter-circle-counter-editor","style":"otter-circle-counter-style","script":"otter-circle-counter"}'),Te=e=>{let{attributes:t,setAttributes:l}=e;return(0,i.createElement)(s.InspectorControls,null,(0,i.createElement)(c.PanelBody,{title:(0,o.__)("Settings","otter-blocks")},(0,i.createElement)(c.RangeControl,{label:(0,o.__)("Percentage","otter-blocks"),help:(0,o.__)("The value of the counter.","otter-blocks"),value:t.percentage,onChange:e=>{void 0!==e&&(e=(0,K.clamp)(e,0,100),l({percentage:e}))},min:0,max:100}),(0,i.createElement)(c.RangeControl,{label:(0,o.__)("Duration","otter-blocks"),help:(0,o.__)("The duration of the animation.","otter-blocks"),value:t.duration,onChange:e=>{void 0!==e&&(e=(0,K.clamp)(e,0,3),l({duration:e}))},min:0,max:3}),(0,i.createElement)(c.SelectControl,{label:(0,o.__)("Title Style","otter-blocks"),value:t.titleStyle,options:[{label:(0,o.__)("Default","otter-blocks"),value:"default"},{label:(0,o.__)("Hide","otter-blocks"),value:"hide"},{label:(0,o.__)("Bottom","otter-blocks"),value:"bottom"}],onChange:e=>l({titleStyle:e})})),(0,i.createElement)(c.PanelBody,{title:(0,o.__)("Style","otter-blocks")},(0,i.createElement)(c.RangeControl,{label:(0,o.__)("Height","otter-blocks"),help:(0,o.__)("The height of the circle counter.","otter-blocks"),value:t.height,onChange:e=>l({height:e}),min:0,max:240}),(0,i.createElement)(c.RangeControl,{label:(0,o.__)("Circle Thickness","otter-blocks"),help:(0,o.__)("Change the thickness (stroke width) of the circle.","otter-blocks"),value:t.strokeWidth,onChange:e=>l({strokeWidth:e}),initialPosition:10,min:0,max:20}),(0,i.createElement)(c.RangeControl,{label:(0,o.__)("Font Size Title","otter-blocks"),help:(0,o.__)("Change the font size of the title.","otter-blocks"),value:t.fontSizeTitle,onChange:e=>l({fontSizeTitle:e}),initialPosition:37,min:0,max:100}),(0,i.createElement)(c.RangeControl,{label:(0,o.__)("Font Size Percent","otter-blocks"),help:(0,o.__)("Change the font size of the inner text.","otter-blocks"),value:t.fontSizePercent,onChange:e=>l({fontSizePercent:e}),initialPosition:27,min:0,max:80}),"hide"!==t.titleStyle&&(0,i.createElement)(s.__experimentalColorGradientControl,{label:(0,o.__)("Title Color","otter-blocks"),colorValue:t.titleColor,onColorChange:e=>l({titleColor:e})}),(0,i.createElement)(s.__experimentalColorGradientControl,{label:(0,o.__)("Progress Color","otter-blocks"),colorValue:t.progressColor,onColorChange:e=>l({progressColor:e})}),(0,i.createElement)(s.__experimentalColorGradientControl,{label:(0,o.__)("Background Color","otter-blocks"),colorValue:t.backgroundColor,onColorChange:e=>l({backgroundColor:e})})))},Me=e=>{let{attributes:t,progressRef:l,valueRef:o}=e;const a=t.height,n=a/2,r=a/2-t.strokeWidth/2,s=2*Math.PI*r;return 0>r?(0,i.createElement)("div",null):(0,i.createElement)("div",{className:"wp-block-themeisle-blocks-circle-counter__bar",style:{height:a+"px",width:a+"px"}},(0,i.createElement)("svg",{className:"wp-block-themeisle-blocks-circle-counter-container",width:a,height:a},(0,i.createElement)("circle",{className:"wp-block-themeisle-blocks-circle-counter-bg",cx:n,cy:n,r:r,strokeWidth:t.strokeWidth,style:{stroke:t.backgroundColor}}),(0,i.createElement)("circle",{ref:l,className:"wp-block-themeisle-blocks-circle-counter-progress",cx:n,cy:n,r:r,strokeWidth:t.strokeWidth,strokeDasharray:s,style:{stroke:t.progressColor}}),(0,i.createElement)("text",{ref:o,className:"wp-block-themeisle-blocks-circle-counter-text",x:"50%",y:"50%",style:{fill:t.progressColor,fontSize:t.fontSizePercent+"px"}},t.percentage,"%")))};const{attributes:Be}=Se;const{clamp:ze,omit:Pe}=lodash,Le={to:[{type:"block",blocks:["themeisle-blocks/progress-bar"],transform:e=>{const t=Pe(e,["titleStyle","height","fontSize","strokeWidth","progressColor"]);return(0,a.createBlock)("themeisle-blocks/progress-bar",{...t,barBackgroundColor:e.progressColor,height:ze(e.height/4,0,100),titleStyle:"default"})}}]};var Re=Le;const{name:Fe}=Se;(0,a.registerBlockType)(Fe,{...Se,title:(0,o.__)("Circle Counter","otter-blocks"),description:(0,o.__)("Show your progress with a beautiful Circle Counter block. Powered by Otter.","otter-blocks"),icon:xe.Z,keywords:["progress","circle","counter"],transforms:Re,edit:e=>{let{clientId:t,attributes:l,setAttributes:a,isSelected:n,toggleSelection:r}=e;(0,i.useEffect)((()=>{const e=(0,L.blockInit)(t,Be);return()=>e(l.id)}),[l.id]);const d=(0,i.useRef)(null),u=(0,i.useRef)(null),[b,m]=(0,i.useState)({}),p=l.height/2-l.strokeWidth/2,g=2*Math.PI*p;(0,i.useEffect)((()=>{if(!d.current||!d.current||0===l.duration)return;const e=l.percentage/(1e3*l.duration),t=(0,K.range)(0,1e3*l.duration+20,20).map((t=>t*e)).reverse();b&&clearInterval(b),d.current.style.strokeDashoffset=g,u.current.innerText="0%";const o=setInterval((()=>{if(!d.current)return void clearInterval(o);const e=Math.round(t.pop());d.current.style.strokeDashoffset=(100-e)/100*g,u.current.innerHTML=e+"%",0===t.length&&clearInterval(o)}),20);return m(o),()=>{clearInterval(o)}}),[l.duration]),(0,i.useEffect)((()=>{if(d.current&&d.current)return d.current.style.strokeDashoffset=(100-l.percentage)/100*g,u.current.innerHTML=l.percentage+"%",clearInterval(b),()=>{clearInterval(b)}}),[l.percentage,l.height]);const h={"--font-size-title":(v=l.fontSizeTitle,v?`${v}px`:v)};var v;const y=(0,s.useBlockProps)({id:l.id,style:h});return(0,i.createElement)(i.Fragment,null,(0,i.createElement)(Te,{attributes:l,setAttributes:a}),(0,i.createElement)("div",y,"default"===l.titleStyle&&(0,i.createElement)("div",{className:"wp-block-themeisle-blocks-circle-counter-title__area"},(0,i.createElement)(s.RichText,{tagName:"span",allowedFormats:[],className:"wp-block-themeisle-blocks-circle-counter-title__value",placeholder:n?(0,o.__)("Write caption…","otter-blocks"):null,value:l.title,onChange:e=>a({title:e}),multiline:!1,style:{color:l.titleColor}})),(0,i.createElement)(c.ResizableBox,{size:{height:l.height,width:l.height},minHeight:0,maxHeight:240,enable:{top:!1,right:!1,bottom:!0,left:!1},showHandle:n,onResizeStop:(e,t,o,n)=>{a({height:parseInt(l.height+n.height,10)}),r(!0)},onResizeStart:()=>{r(!1)}},(0,i.createElement)(Me,{attributes:l,progressRef:d,valueRef:u})),"bottom"===l.titleStyle&&(0,i.createElement)("div",{className:"wp-block-themeisle-blocks-circle-counter-title__area"},(0,i.createElement)(s.RichText,{tagName:"span",allowedFormats:[],className:"wp-block-themeisle-blocks-circle-counter-title__value",placeholder:n?(0,o.__)("Write caption…","otter-blocks"):null,value:l.title,onChange:e=>a({title:e}),multiline:!1,style:{color:l.titleColor}}))))},save:e=>{let{attributes:t}=e;const l=s.useBlockProps.save({id:t.id,"data-percentage":t.percentage,"data-duration":t.duration,"data-height":t.height,"data-stroke-width":t.strokeWidth,"data-font-size-percent":t.fontSizePercent,"data-background-stroke":t.backgroundColor,"data-progress-stroke":t.progressColor});return(0,i.createElement)("div",l,"default"===t.titleStyle&&(0,i.createElement)("div",{className:"wp-block-themeisle-blocks-circle-counter-title__area"},(0,i.createElement)("span",{className:"wp-block-themeisle-blocks-circle-counter-title__value"},t.title)),(0,i.createElement)("div",{className:"wp-block-themeisle-blocks-circle-counter__bar"}),"bottom"===t.titleStyle&&(0,i.createElement)("div",{className:"wp-block-themeisle-blocks-circle-counter-title__area"},(0,i.createElement)("span",{className:"wp-block-themeisle-blocks-circle-counter-title__value"},t.title)))},example:{attributes:{title:"Lorem ipsum"}}});var Ae=l(2506),He=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"themeisle-blocks/countdown","title":"Countdown","category":"themeisle-blocks","description":"Set a countdown for a date. Powered by Otter.","keywords":["countdown","time","counter"],"textdomain":"otter-blocks","attributes":{"id":{"type":"string"},"date":{"type":"string"},"exclude":{"type":"array"},"backgroundColor":{"type":"string"},"valueColor":{"type":"string"},"labelColor":{"type":"string"},"labelDistance":{"type":"number"},"separatorColor":{"type":"string"},"gap":{"type":"number"},"gapTablet":{"type":"number"},"gapMobile":{"type":"number"},"width":{"type":"number"},"widthTablet":{"type":"number"},"widthMobile":{"type":"number"},"containerWidth":{"type":"string"},"containerWidthTablet":{"type":"string"},"containerWidthMobile":{"type":"string"},"height":{"type":"number"},"heightTablet":{"type":"number"},"heightMobile":{"type":"number"},"borderRadius":{"type":["number","object"]},"borderRadiusBox":{"type":"object"},"borderStyle":{"type":"string"},"borderWidth":{"type":"number"},"borderWidthTablet":{"type":"number"},"borderWidthMobile":{"type":"number"},"borderColor":{"type":"string"},"valueFontSize":{"type":["number","string"]},"valueFontSizeTablet":{"type":["number","string"]},"valueFontSizeMobile":{"type":["number","string"]},"labelFontSize":{"type":["number","string"]},"labelFontSizeTablet":{"type":["number","string"]},"labelFontSizeMobile":{"type":["number","string"]},"hasSeparators":{"type":"boolean"},"valueFontWeight":{"type":"string"},"labelFontWeight":{"type":"string"},"alignment":{"type":"string"},"padding":{"type":"object"},"paddingTablet":{"type":"object"},"paddingMobile":{"type":"object"},"borderRadiusTopRight":{"type":"number"},"borderRadiusTopLeft":{"type":"number"},"borderRadiusBottomRight":{"type":"number"},"borderRadiusBottomLeft":{"type":"number"},"borderRadiusType":{"type":"string","default":"linked"},"separatorAlignment":{"type":"string"},"behaviour":{"type":"string"},"redirectLink":{"type":"string"},"mode":{"type":"string"},"timer":{"type":"object"},"startInterval":{"type":"string"},"endInterval":{"type":"string"},"onEndAction":{"type":"string"}},"supports":{"align":["wide","full"]},"editorStyle":"otter-countdown-editor","style":"otter-countdown-style","script":"otter-countdown"}'),Oe=l(6292),Ne=l.n(Oe),Ve=l(9771),Ie=l(2694),De=l(9084);const Ge=[{name:(0,o.__)("Small","otter-blocks"),size:"0.875em",slug:"small"},{name:(0,o.__)("Medium","otter-blocks"),size:"1em",slug:"medium"},{name:(0,o.__)("Large","otter-blocks"),size:"1.125em",slug:"large"},{name:(0,o.__)("XL","otter-blocks"),size:"1.25em",slug:"xl"}],$e=["","100","200","300","400","500","600","700","800","900"].map((e=>({label:e||"Default",value:e}))),We=e=>{var t;let{attributes:l}=e;return(0,i.createElement)(i.Fragment,null,(0,i.createElement)(c.SelectControl,{label:(0,o.__)("Countdown Type","otter-blocks"),value:l.mode,options:[{label:(0,o.__)("Static","otter-blocks"),value:""},{label:(0,o.__)("Evergreen (Pro)","otter-blocks"),value:"timer",disabled:!0},{label:(0,o.__)("Interval (Pro)","otter-blocks"),value:"interval",disabled:!0}],help:(0,o.__)("An universal deadline for all visitors","otter-blocks")}),!Boolean(null===(t=window.themeisleGutenberg)||void 0===t?void 0:t.hasPro)&&(0,i.createElement)(De.Z,{notice:(0,i.createElement)(c.ExternalLink,{href:(0,x.Wi)(window.themeisleGutenberg.upgradeLink,"countdownfeature")},(0,o.__)("Get more options with Otter Pro.","otter-blocks")),variant:"upsell"}))},Ze=()=>{var e;return(0,i.createElement)(i.Fragment,null,(0,i.createElement)(c.SelectControl,{label:(0,o.__)("On Expire","otter-blocks"),value:"default",onChange:()=>{},options:[{label:(0,o.__)("No action","otter-blocks"),value:"default"},{label:(0,o.__)("Hide the Countdown","otter-blocks"),value:"hide"},{label:(0,o.__)("Redirect to link","otter-blocks"),value:"redirectLink"}],help:(0,o.__)("The countdown remains visible when it reaches 0","otter-blocks"),disabled:!0}),(0,i.createElement)(c.ToggleControl,{label:(0,o.__)("Hide/Show Blocks When the Countdown Ends","otter-blocks"),help:(0,o.__)("Enable Hide/Show other blocks when the Countdown ends.","otter-blocks"),checked:!1,onChange:()=>{},disabled:!0}),!Boolean(null===(e=window.themeisleGutenberg)||void 0===e?void 0:e.hasPro)&&(0,i.createElement)(De.Z,{notice:(0,i.createElement)(c.ExternalLink,{href:(0,x.Wi)(window.themeisleGutenberg.upgradeLink,"countdownfeature")},(0,o.__)("Get more options with Otter Pro.","otter-blocks")),variant:"upsell"}))};var je=e=>{var t,l,a,n,r,d,u,b,m;let{attributes:p,setAttributes:g}=e;const{responsiveSetAttributes:h,responsiveGetAttributes:v}=S(g),y=(e,t)=>{var l;g(e?{exclude:null==p||null===(l=p.exclude)||void 0===l?void 0:l.filter((e=>e!==t))}:{exclude:null!=p&&p.exclude?[...null==p?void 0:p.exclude,t]:[t]})},k=(0,Ve.__experimentalGetSettings)();return(0,i.createElement)(s.InspectorControls,null,(0,i.createElement)(c.PanelBody,{title:(0,o.__)("Time Settings","otter-blocks")},(0,Ie.applyFilters)("otter.countdown.controls.settings",(0,i.createElement)(We,{attributes:p}),{attributes:p,setAttributes:g}),void 0===p.mode&&(0,i.createElement)(c.Dropdown,{position:"bottom left",headerTitle:(0,o.__)("Select the date for the deadline","otter-blocks"),renderToggle:e=>{let{onToggle:t,isOpen:l}=e;return(0,i.createElement)(i.Fragment,null,(0,i.createElement)(c.Button,{onClick:t,isSecondary:!0,"aria-expanded":l,className:"o-extend-btn"},p.date?(0,Ve.format)(k.formats.datetime,p.date):(0,o.__)("Select Date","otter-blocks")))},renderContent:()=>(0,i.createElement)(c.DateTimePicker,{currentDate:p.date,onChange:e=>g({date:e})}),className:"o-extend"})),(0,i.createElement)(c.PanelBody,{title:(0,o.__)("Display","otter-blocks"),initialOpen:!1},(0,i.createElement)(c.ToggleControl,{label:(0,o.__)("Display Days","otter-blocks"),checked:!(null!=p&&null!==(t=p.exclude)&&void 0!==t&&t.includes("day")),onChange:e=>y(e,"day")}),(0,i.createElement)(c.ToggleControl,{label:(0,o.__)("Display Hours","otter-blocks"),checked:!(null!=p&&null!==(l=p.exclude)&&void 0!==l&&l.includes("hour")),onChange:e=>y(e,"hour")}),(0,i.createElement)(c.ToggleControl,{label:(0,o.__)("Display Minutes","otter-blocks"),checked:!(null!=p&&null!==(a=p.exclude)&&void 0!==a&&a.includes("minute")),onChange:e=>y(e,"minute")}),(0,i.createElement)(c.ToggleControl,{label:(0,o.__)("Display Seconds","otter-blocks"),checked:!(null!=p&&null!==(n=p.exclude)&&void 0!==n&&n.includes("second")),onChange:e=>y(e,"second")}),(0,i.createElement)(c.ToggleControl,{label:(0,o.__)("Display Separators","otter-blocks"),checked:null==p?void 0:p.hasSeparators,onChange:e=>g({hasSeparators:e})}),(0,i.createElement)(M.Z,{label:(0,o.__)("Space Between boxes","otter-blocks")},(0,i.createElement)(c.RangeControl,{value:null!==(r=v([p.gap,p.gapTablet,p.gapMobile]))&&void 0!==r?r:6,onChange:e=>h(e,["gap","gapTablet","gapMobile"]),min:0,max:100,allowReset:!0}))),(0,i.createElement)(c.PanelBody,{title:(0,o.__)("End Action","otter-blocks"),initialOpen:!1},(0,Ie.applyFilters)("otter.countdown.controls.end",(0,i.createElement)(Ze,null),{attributes:p,setAttributes:g})),(0,i.createElement)(c.PanelBody,{title:(0,o.__)("Dimensions","otter-blocks"),initialOpen:!1},(0,i.createElement)(M.Z,{label:(0,o.__)("Width","otter-blocks")},(0,i.createElement)(c.__experimentalUnitControl,{value:null!==(d=v([p.containerWidth,p.containerWidthTablet,p.containerWidthMobile]))&&void 0!==d?d:"100%",onChange:e=>h(e,["containerWidth","containerWidthTablet","containerWidthMobile"])})),(0,i.createElement)(M.Z,{label:(0,o.__)("Height","otter-blocks")},(0,i.createElement)(c.RangeControl,{value:null!==(u=v([p.height,p.heightTablet,p.heightMobile]))&&void 0!==u?u:100,onChange:e=>h(e,["height","heightTablet","heightMobile"]),min:50,max:800,allowReset:!0})),(0,i.createElement)(c.SelectControl,{label:(0,o.__)("Position","otter-blocks"),value:p.alingment,onChange:e=>g({alignment:e||void 0}),options:[{label:(0,o.__)("Default","otter-blocks"),value:""},{label:(0,o.__)("Left","otter-blocks"),value:"flex-start"},{label:(0,o.__)("Center","otter-blocks"),value:"center"},{label:(0,o.__)("Right","otter-blocks"),value:"flex-end"}]}),p.hasSeparators&&(0,i.createElement)(c.SelectControl,{label:(0,o.__)("Separator Alignment","otter-blocks"),value:p.separatorAlignment,onChange:e=>{g(e?{separatorAlignment:e}:{separatorAlignment:void 0})},options:[{label:(0,o.__)("Default","otter-blocks"),value:""},{label:(0,o.__)("Center","otter-blocks"),value:"center"}]})),(0,i.createElement)(c.PanelBody,{title:(0,o.__)("Typography","otter-blocks"),initialOpen:!1},(0,i.createElement)(M.Z,{label:(0,o.__)("Time Value Font Size","otter-blocks")},(0,i.createElement)(c.FontSizePicker,{fontSizes:Ge,withReset:!0,value:v([p.valueFontSize,p.valueFontSizeTablet,p.valueFontSizeMobile]),onChange:e=>h(e,["valueFontSize","valueFontSizeTablet","valueFontSizeMobile"])})),(0,i.createElement)(c.SelectControl,{label:(0,o.__)("Time Value Font Weight","otter-blocks"),value:p.valueFontWeight,onChange:e=>g({valueFontWeight:e||void 0}),options:$e}),(0,i.createElement)(M.Z,{label:(0,o.__)("Label Font Size","otter-blocks")},(0,i.createElement)(c.FontSizePicker,{fontSizes:Ge,withReset:!0,value:v([p.labelFontSize,p.labelFontSizeTablet,p.labelFontSizeMobile]),onChange:e=>h(e,["labelFontSize","labelFontSizeTablet","labelFontSizeMobile"])})),(0,i.createElement)(c.SelectControl,{label:(0,o.__)("Label Font Weight","otter-blocks"),value:p.labelFontWeight,onChange:e=>g({labelFontWeight:e||void 0}),options:$e})),(0,i.createElement)(s.PanelColorSettings,{title:(0,o.__)("Color","otter-blocks"),initialOpen:!1,colorSettings:[{value:p.backgroundColor,onChange:e=>g({backgroundColor:e}),label:(0,o.__)("Background","otter-blocks")},{value:p.valueColor,onChange:e=>g({valueColor:e}),label:(0,o.__)("Time Value","otter-blocks")},{value:p.labelColor,onChange:e=>g({labelColor:e}),label:(0,o.__)("Label","otter-blocks")},{value:p.separatorColor,onChange:e=>g({separatorColor:e}),label:(0,o.__)("Separator","otter-blocks")},{value:p.borderColor,onChange:e=>g({borderColor:e}),label:(0,o.__)("Border","otter-blocks")}]},(0,i.createElement)(s.ContrastChecker,{textColor:p.backgroundColor,backgroundColor:p.valueColor})),(0,i.createElement)(c.PanelBody,{title:(0,o.__)("Border","otter-blocks"),initialOpen:!1},(0,i.createElement)(c.SelectControl,{label:(0,o.__)("Type","otter-blocks"),value:null!==(b=p.borderStyle)&&void 0!==b?b:"solid",onChange:e=>g({borderStyle:"solid"===e?void 0:e}),options:[{label:(0,o.__)("None","otter-blocks"),value:"none"},{label:(0,o.__)("Solid","otter-blocks"),value:"solid"},{label:(0,o.__)("Double","otter-blocks"),value:"double"},{label:(0,o.__)("Dotted","otter-blocks"),value:"dotted"},{label:(0,o.__)("Dashed","otter-blocks"),value:"dashed"}]}),"none"!==p.borderStyle&&(0,i.createElement)(M.Z,{label:(0,o.__)("Width","otter-blocks")},(0,i.createElement)(c.RangeControl,{value:null!==(m=v([p.borderWidth,p.borderWidthTablet,p.borderWidthMobile]))&&void 0!==m?m:2,onChange:e=>h(e,["borderWidth","borderWidthTablet","borderWidthMobile"]),min:0,max:50,allowReset:!0})),(0,i.createElement)(c.__experimentalBoxControl,{label:(0,o.__)("Border Radius","otter-blocks"),values:(0,x.Dv)(p.borderRadiusBox,{left:"0px",right:"0px",bottom:"0px",top:"0px"}),onChange:e=>{g({borderRadiusBox:(0,x.cg)(e,{left:"0px",right:"0px",bottom:"0px",top:"0px"})})},id:"o-border-raduis-box"})))};const Ue=1e3,qe=6e4,Je=36e5,Ke=864e5,Ye=function(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return null!==(e=parseInt((null==t?void 0:t.days)||"0")*Ke+parseInt((null==t?void 0:t.hours)||"0")*Je+parseInt((null==t?void 0:t.minutes)||"0")*qe+parseInt((null==t?void 0:t.seconds)||"0")*Ue)&&void 0!==e?e:0},Qe=(e,t)=>{var l;null!==(l=e)&&void 0!==l||(e=0);const a=Math.floor(e/Ke),n=Math.floor(e/Je%24),r=Math.floor(e/qe%60),i=Math.floor(e/Ue%60);return[{tag:"day",name:1<a?(0,o.__)("Days","otter-blocks"):(0,o.__)("Day","otter-blocks"),value:a},{tag:"hour",name:1<n?(0,o.__)("Hours","otter-blocks"):(0,o.__)("Hour","otter-blocks"),value:n},{tag:"minute",name:1<r?(0,o.__)("Minutes","otter-blocks"):(0,o.__)("Minute","otter-blocks"),value:r},{tag:"second",name:1<i?(0,o.__)("Seconds","otter-blocks"):(0,o.__)("Second","otter-blocks"),value:i}].filter((e=>{var l;let{tag:o}=e;return!(null!=t&&null!==(l=t.exclude)&&void 0!==l&&l.includes(o))})).map((e=>(null!=t&&t.keepNeg||(e.value=Math.max(0,e.value)),e)))},Xe=e=>{let{name:t,value:l,tag:o}=e;return(0,i.createElement)("div",{name:o,className:g()("otter-countdown__display-area",{"is-main-component":"separator"!==o})},(0,i.createElement)("div",{className:"otter-countdown__value"},l),(0,i.createElement)("div",{className:"otter-countdown__label"},t))};var et=e=>{var t;let{time:l,settings:o,hasSeparators:a}=e;const n=4===(null==o||null===(t=o.exclude)||void 0===t?void 0:t.length)?Qe(null!=l?l:0,{}):Qe(null!=l?l:0,{exclude:null==o?void 0:o.exclude}),r=a?(0,x.S3)(n,{name:"sep",value:":",tag:"separator"}):n,s=null==r?void 0:r.map(((e,t)=>(0,i.createElement)(Xe,(0,J.Z)({},e,{key:t}))));return(0,i.createElement)("div",{className:"otter-countdown__container"},void 0!==l&&(0,i.createElement)("div",{className:"otter-countdown__display"},s))};const{attributes:tt}=He,lt=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"px";return(0,K.isNumber)(e)?`${e}${t}`:e};const ot=e=>{let{name:t,value:l,tag:o}=e;return(0,i.createElement)("div",{name:o,className:g()("otter-countdown__display-area",{"is-main-component":"separator"!==o})},(0,i.createElement)("div",{className:"otter-countdown__value"},l),(0,i.createElement)("div",{className:"otter-countdown__label"},t))},at=e=>{let{time:t,hasSeparators:l}=e;const o=l?(0,x.S3)(t,{name:"sep",value:":",tag:"separator"}):t,a=null==o?void 0:o.map(((e,t)=>(0,i.createElement)(ot,(0,J.Z)({},e,{key:t}))));return void 0!==t?(0,i.createElement)("div",{className:"otter-countdown__container"},(0,i.createElement)("div",{className:"otter-countdown__display"},a)):(0,i.createElement)(i.Fragment,null)};const{name:nt}=He;(0,a.registerBlockType)(nt,{...He,title:(0,o.__)("Countdown","otter-blocks"),description:(0,o.__)("Set a countdown for a date. Powered by Otter.","otter-blocks"),icon:Ae.Z,keywords:["countdown","time","counter"],edit:e=>{var t;let{attributes:l,setAttributes:a,clientId:n}=e;const[r,d]=(0,i.useState)(0);(0,i.useEffect)((()=>{const e=(0,L.blockInit)(n,tt);return()=>e(l.id)}),[l.id]),(0,i.useEffect)((()=>{if(void 0===l.borderRadiusBox&&(l.borderRadius||l.borderRadiusBottomLeft||l.borderRadiusTopRight||l.borderRadiusTopLeft||l.borderRadiusBottomRight)){const e=(0,K.pickBy)("linked"===(null==l?void 0:l.borderRadiusType)?{left:lt(l.borderRadius,"%"),right:lt(l.borderRadius,"%"),bottom:lt(l.borderRadius,"%"),top:lt(l.borderRadius,"%")}:{left:lt(l.borderRadiusBottomLeft,"%"),right:lt(l.borderRadiusTopRight,"%"),bottom:lt(l.borderRadiusBottomRight,"%"),top:lt(l.borderRadiusTopLeft,"%")},(e=>e));(0,K.isEmpty)(e)||a({borderRadiusBox:e,borderRadius:void 0,borderRadiusBottomLeft:void 0,borderRadiusTopRight:void 0,borderRadiusBottomRight:void 0,borderRadiusTopLeft:void 0,borderRadiusType:void 0})}}),[]),(0,i.useEffect)((()=>{let e;return"timer"!==l.mode&&(e=setInterval((()=>{if(l.date){const e=1e3*Ne()(l.date+(0,x.EP)()).unix();d(e-Date.now())}}),500)),()=>{clearInterval(e)}}),[l.date,l.mode]);const u={"--border-radius":(0,x.bv)(l.borderRadiusBox),"--border-style":l.borderStyle,"--background-color":l.backgroundColor,"--border-color":l.borderColor,"--container-width":l.containerWidth,"--container-width-tablet":l.containerWidthTablet,"--container-width-mobile":l.containerWidthMobile,"--height":lt(l.height),"--height-tablet":lt(l.heightTablet),"--height-mobile":lt(l.heightMobile),"--border-width":lt(l.borderWidth),"--border-width-tablet":lt(l.borderWidthTablet),"--border-width-mobile":lt(l.borderWidthMobile),"--gap":lt(l.gap),"--gap-tablet":lt(l.gapTablet),"--gap-mobile":lt(l.gapMobile),"--value-font-size":lt(l.valueFontSize),"--value-font-size-tablet":lt(l.valueFontSizeTablet),"--value-font-size-mobile":lt(l.valueFontSizeMobile),"--label-font-size":lt(l.labelFontSize),"--label-font-size-tablet":lt(l.labelFontSizeTablet),"--label-font-size-mobile":lt(l.labelFontSizeMobile),"--alignment":l.alignment,"--padding":(0,x.bv)(l.padding),"--padding-tablet":(0,x.bv)(l.paddingTablet),"--padding-mobile":(0,x.bv)(l.paddingMobile),"--value-font-weight":l.valueFontWeight,"--label-font-weight":l.labelFontWeight},[b,m]=(0,L.useCSSNode)();(0,i.useEffect)((()=>{m([`.otter-countdown__display-area .otter-countdown__value {\n\t\t\t\tcolor: ${l.valueColor};\n\t\t\t}`,`.otter-countdown__display-area .otter-countdown__label {\n\t\t\t\tcolor: ${l.labelColor};\n\t\t\t}`,`.otter-countdown__display-area[name="separator"] .otter-countdown__value {\n\t\t\t\tcolor: ${l.separatorColor};\n\t\t\t}`,"center"===l.separatorAlignment?'\n\t\t\t.otter-countdown__display-area[name="separator"] .otter-countdown__label {\n\t\t\t\tdisplay: none;\n\t\t\t}\n\t\t\t':""])}),[l.valueColor,l.labelColor,l.separatorColor,l.separatorAlignment]);const p=(0,s.useBlockProps)({id:l.id,className:g()(b,"ready"),style:u});return(0,i.createElement)(i.Fragment,null,(0,i.createElement)(je,{attributes:l,setAttributes:a}),(0,i.createElement)("div",p,(0,i.createElement)(et,{time:(()=>{switch(l.mode){case"timer":return Ye(l.timer);case"interval":return((e,t)=>{if(!e||!t)return 0;const l=new Date(e).getTime();return new Date(t).getTime()-l})(l.startInterval,l.endInterval);default:return r}})(),settings:{exclude:null==l?void 0:l.exclude},hasSeparators:l.hasSeparators}),4===(null==l||null===(t=l.exclude)||void 0===t?void 0:t.length)&&(0,i.createElement)(i.Fragment,null,(0,i.createElement)("br",null),(0,i.createElement)(c.Notice,{isDismissible:!1,status:"info"},(0,o.__)("The Countdown will be hidden in page","otter-blocks")))))},save:e=>{let{attributes:t}=e;const l=t.startInterval&&t.endInterval?{"data-intv-start":t.startInterval,"data-intv-end":t.endInterval}:{},o=s.useBlockProps.save({id:t.id,"data-date":t.date,"data-bhv":t.behaviour?t.behaviour:void 0,"data-redirect-link":"redirectLink"===t.behaviour&&t.redirectLink?t.redirectLink:void 0,"data-mode":t.mode?t.mode:void 0,"data-timer":(0,K.isEmpty)(t.timer)?void 0:(a=t.timer,Ye(a).toString()),"data-on-end-action":t.onEndAction?t.onEndAction:void 0,...l});var a;return(0,i.createElement)("div",o,(0,i.createElement)(at,{time:Qe(0,{exclude:null==t?void 0:t.exclude}),hasSeparators:null==t?void 0:t.hasSeparators}))},example:{attributes:{date:"2024-07-15T15:03:00"}}});var rt=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"themeisle-blocks/flip","title":"Flip Card","category":"themeisle-blocks","description":"Make a card with a flip effect. Powered by Otter.","keywords":["flip card","container","animation"],"textdomain":"otter-blocks","attributes":{"id":{"type":"string"},"isInverted":{"type":"boolean"},"title":{"type":"string"},"description":{"type":"string"},"animType":{"type":"string","default":"flipY"},"width":{"type":["number","object"]},"widthTablet":{"type":"object"},"widthMobile":{"type":"object"},"height":{"type":["number","object"]},"heightTablet":{"type":"object"},"heightMobile":{"type":"object"},"padding":{"type":["number","object"]},"paddingTablet":{"type":"object"},"paddingMobile":{"type":"object"},"borderWidth":{"type":["number","object"]},"borderColor":{"type":"string"},"borderRadius":{"type":["number","object"]},"backgroundColor":{"type":"string"},"frontVerticalAlign":{"type":"string"},"frontHorizontalAlign":{"type":"string"},"backVerticalAlign":{"type":"string"},"frontMedia":{"type":"object"},"frontMediaWidth":{"type":["number","string"]},"frontMediaHeight":{"type":["number","string"]},"frontBackgroundImage":{"type":"object"},"frontBackgroundType":{"type":"string","default":"color"},"frontBackgroundColor":{"type":"string"},"frontBackgroundGradient":{"type":"string"},"frontBackgroundPosition":{"type":"object"},"frontBackgroundRepeat":{"type":"string"},"frontBackgroundAttachment":{"type":"string"},"frontBackgroundSize":{"type":"string"},"backBackgroundImage":{"type":"object"},"backBackgroundType":{"type":"string","default":"color"},"backBackgroundColor":{"type":"string"},"backBackgroundGradient":{"type":"string"},"backBackgroundPosition":{"type":"object"},"backBackgroundRepeat":{"type":"string"},"backBackgroundSize":{"type":"string"},"backBackgroundAttachment":{"type":"string"},"boxShadow":{"type":"boolean","default":false},"boxShadowColor":{"type":"string","default":"#000000"},"boxShadowColorOpacity":{"type":"number","default":50},"boxShadowBlur":{"type":"number","default":5},"boxShadowHorizontal":{"type":"number","default":0},"boxShadowVertical":{"type":"number","default":0},"titleFontSize":{"type":["number","string"]},"descriptionFontSize":{"type":["number","string"]},"titleColor":{"type":"string"},"descriptionColor":{"type":"string"},"frontContentType":{"type":"string"}},"editorStyle":"otter-flip-editor","style":"otter-flip-style"}');const it={top:"flex-start",left:"flex-start",bottom:"flex-end",right:"flex-end",center:"center"},st={"flex-start":"top",center:"center","flex-end":"bottom"},ct={"flex-start":"left",center:"center","flex-end":"right"},dt=(e,t)=>{if(e&&t)return`${st[e]} ${ct[t]}`};var ut=e=>{let{attributes:t,setAttributes:l,currentSide:a}=e;const n=s.__experimentalBlockAlignmentMatrixControl||s.__experimentalBlockAlignmentMatrixToolbar;return(0,i.createElement)(s.BlockControls,null,("front"===a&&!Boolean(t.isInverted)||"back"===a&&Boolean(t.isInverted))&&(0,i.createElement)(c.Toolbar,null,(0,i.createElement)(n,{label:(0,o.__)("Change front side content position","otter-blocks"),value:dt(t.frontVerticalAlign,t.frontHorizontalAlign),onChange:e=>{const t=null==e?void 0:e.split(" ");l({frontVerticalAlign:null==it?void 0:it[null==t?void 0:t[0]],frontHorizontalAlign:null==it?void 0:it[null==t?void 0:t[1]]})}})))},bt=l(1150),mt=l(8065),pt=l(199),gt=l(5452);const ht=e=>(0,K.isNumber)(e)?(0,x.nT)((0,x.Yj)(e)):e,vt=[{name:"14",size:"14px",slug:"14"},{name:"16",size:"16px",slug:"16"},{name:"18",size:"18px",slug:"18"},{name:"24",size:"24px",slug:"24"}];var yt=e=>{var t,l,a,n,d,u,b;let{attributes:m,setAttributes:p,currentSide:g,setSide:h}=e;const[v,y]=(0,i.useState)("settings"),{responsiveSetAttributes:k,responsiveGetAttributes:f}=S(p);return(0,i.createElement)(s.InspectorControls,null,(0,i.createElement)(w.Z,{value:v,options:[{label:(0,o.__)("Settings","otter-blocks"),value:"settings"},{label:(0,o.__)("Style","otter-blocks"),value:"style"}],onChange:y}),(0,i.createElement)("div",null,"settings"===v&&(0,i.createElement)(i.Fragment,null,(0,i.createElement)(c.PanelBody,{title:(0,o.__)("Flip Settings","otter-blocks")},(0,i.createElement)(c.SelectControl,{label:(0,o.__)("Flip Direction","otter-blocks"),value:m.animType,options:[{label:(0,o.__)("Bottom to Top","otter-blocks"),value:"flipX"},{label:(0,o.__)("Top to Bottom","otter-blocks"),value:"flipX-rev"},{label:(0,o.__)("Left to Right","otter-blocks"),value:"flipY"},{label:(0,o.__)("Right to Left","otter-blocks"),value:"flipY-rev"}],onChange:e=>p({animType:e})}),(0,i.createElement)(c.ToggleControl,{label:(0,o.__)("Invert the Sides","otter-blocks"),checked:m.isInverted,onChange:e=>p({isInverted:e}),help:(0,o.__)("Use this to display the back side first.","otter-blocks")})),(0,i.createElement)(c.PanelBody,{title:(0,o.__)("Front Side Content","otter-blocks"),initialOpen:!1},(0,i.createElement)(E.Z,{label:(0,o.__)("Content Type","otter-blocks"),options:[{label:(0,o.__)("None","otter-blocks"),value:"none"},{label:(0,o.__)("Image","otter-blocks"),value:"image"}],value:null!==(t=null==m?void 0:m.frontContentType)&&void 0!==t?t:"none",onChange:e=>{const t={frontContentType:(0,K.isEmpty)(e)||"none"===e?void 0:e};((0,K.isEmpty)(e)||"none"===e)&&(t.frontMedia=void 0),p(t)}}),"image"===m.frontContentType&&(0,i.createElement)(i.Fragment,null,(0,i.createElement)(c.BaseControl,{label:(0,o.__)("Media Image","otter-blocks"),help:(0,o.__)("Set an image as showcase.","otter-blocks")},null!==(l=m.frontMedia)&&void 0!==l&&l.url?(0,i.createElement)(c.BaseControl,null,(0,i.createElement)("img",{src:m.frontMedia.url,alt:m.frontMedia.alt,style:{border:"2px solid var( --wp-admin-theme-color)",maxHeight:"250px"}}),(0,i.createElement)(c.Button,{isSecondary:!0,onClick:()=>p({frontMedia:void 0})},(0,o.__)("Remove image","otter-blocks"))):(0,i.createElement)(s.MediaPlaceholder,{labels:{title:(0,o.__)("Media Image","otter-blocks")},accept:"image/*",allowedTypes:["image"],value:m.frontMedia,onSelect:e=>{var t,l;console.log(e),p({frontMedia:(0,K.pick)(e,["id","alt","url"]),frontMediaHeight:(0,x.Yj)(null==e||null===(t=e.sizes)||void 0===t?void 0:t.medium.height),frontMediaWidth:(0,x.Yj)(null==e||null===(l=e.sizes)||void 0===l?void 0:l.medium.width)})}})),(0,i.createElement)(c.__experimentalUnitControl,{onChange:e=>p({frontMediaWidth:e}),label:(0,o.__)("Media Width","otter-blocks"),isUnitSelectTabbable:!0,isResetValueOnUnitChange:!0,value:(0,x.Yj)(m.frontMediaWidth)}),(0,i.createElement)("br",null),(0,i.createElement)(c.__experimentalUnitControl,{onChange:e=>p({frontMediaHeight:e}),label:(0,o.__)("Media Height","otter-blocks"),isUnitSelectTabbable:!0,isResetValueOnUnitChange:!0,value:(0,x.Yj)(m.frontMediaHeight)}))),(0,i.createElement)(c.PanelBody,{title:(0,o.__)("Alignment","otter-blocks"),initialOpen:!1},(0,i.createElement)(E.Z,{label:(0,o.__)("Sides","otter-blocks"),options:[{label:(0,o.__)("Front","otter-blocks"),value:"front"},{label:(0,o.__)("Back","otter-blocks"),value:"back"}],value:g,onChange:h}),"front"===g&&!Boolean(m.isInverted)||"back"===g&&Boolean(m.isInverted)?(0,i.createElement)(i.Fragment,null,(0,i.createElement)(c.BaseControl,{label:(0,o.__)("Vertical Alignment","otter-blocks")},(0,i.createElement)(pe.Z,{options:[{icon:r.alignTop,value:"flex-start"},{icon:r.alignCenter,value:"center"},{icon:r.alignBottom,value:"flex-end"}],value:null!==(a=m.frontVerticalAlign)&&void 0!==a?a:"center",onChange:e=>p({frontVerticalAlign:e})})),(0,i.createElement)(c.BaseControl,{label:(0,o.__)("Horizontal Alignment","otter-blocks")},(0,i.createElement)(pe.Z,{options:[{icon:bt.Z,value:"flex-start"},{icon:mt.Z,value:"center"},{icon:pt.Z,value:"flex-end"}],value:null!==(n=m.frontHorizontalAlign)&&void 0!==n?n:"center",onChange:e=>p({frontHorizontalAlign:e})}))):(0,i.createElement)(c.BaseControl,{label:(0,o.__)("Vertical Alignment","otter-blocks")},(0,i.createElement)(pe.Z,{options:[{icon:r.alignTop,value:"flex-start"},{icon:r.alignCenter,value:"center"},{icon:r.alignBottom,value:"flex-end"}],value:m.backVerticalAlign,onChange:e=>p({backVerticalAlign:e})})))),"style"===v&&(0,i.createElement)(i.Fragment,null,(0,i.createElement)(c.PanelBody,{title:(0,o.__)("Dimensions","otter-blocks")},(0,i.createElement)(M.Z,{label:(0,o.__)("Width","otter-blocks")},(0,i.createElement)(c.__experimentalUnitControl,{value:null!==(d=f([(0,K.isNumber)(m.width)?(0,x.Yj)(m.width):null==m?void 0:m.width,m.widthTablet,null==m?void 0:m.widthMobile]))&&void 0!==d?d:"100%",onChange:e=>k(e,["width","widthTablet","widthMobile"],m.width),isUnitSelectTabbable:!0,isResetValueOnUnitChange:!0,allowReset:!0})),(0,i.createElement)(M.Z,{label:(0,o.__)("Height","otter-blocks")},(0,i.createElement)(c.__experimentalUnitControl,{value:null!==(u=f([(0,K.isNumber)(m.height)?(0,x.Yj)(m.height):null==m?void 0:m.height,m.heightTablet,null==m?void 0:m.heightMobile]))&&void 0!==u?u:"300px",onChange:e=>k(e,["height","heightTablet","heightMobile"],m.height),isUnitSelectTabbable:!0,isResetValueOnUnitChange:!0,allowReset:!0,units:[{default:300,label:"px",value:"px"},{default:20,label:"em",value:"em"},{default:20,label:"rem",value:"rem"},{default:30,label:"vw",value:"vw"},{default:35,label:"vh",value:"vh"}]})),(0,i.createElement)(M.Z,{label:(0,o.__)("","otter-blocks")},(0,i.createElement)(c.__experimentalBoxControl,{label:(0,o.__)("Padding","otter-blocks"),values:null!==(b=f([null==m?void 0:m.padding,m.paddingTablet,null==m?void 0:m.paddingMobile]))&&void 0!==b?b:(0,K.isNumber)(m.padding)?(0,x.nT)((0,x.Yj)(m.padding)):(0,x.nT)("20px"),onChange:e=>{let t={};"object"==typeof e&&(t=Object.fromEntries(Object.entries((0,K.pick)(e,["top","bottom","left","right"])).filter((e=>{let[t,l]=e;return null!=l})))),(0,K.isEmpty)(t)&&(t=void 0),k((0,x.cg)(t,(0,x.nT)("20px")),["padding","paddingTablet","paddingMobile"])},allowReset:!0}))),(0,i.createElement)(c.PanelBody,{title:(0,o.__)("Typography Front Side","otter-blocks"),initialOpen:!1},(0,i.createElement)(c.BaseControl,{label:(0,o.__)("Title","otter-blocks")},(0,i.createElement)(c.FontSizePicker,{value:(0,x.Yj)(m.titleFontSize),onChange:e=>p({titleFontSize:e}),fontSizes:[...vt,{name:"32",size:"32px",slug:"32"}],allowReset:!0})),(0,i.createElement)(c.BaseControl,{label:(0,o.__)("Description","otter-blocks")},(0,i.createElement)(c.FontSizePicker,{value:ht(m.descriptionFontSize),onChange:e=>p({descriptionFontSize:e}),fontSizes:[...vt,{name:"28",size:"28px",slug:"28"}],allowReset:!0}))),(0,i.createElement)(c.PanelBody,{title:(0,o.__)("Front Side","otter-blocks"),initialOpen:!1},(0,i.createElement)(gt.Z,{backgroundType:m.frontBackgroundType,backgroundColor:m.frontBackgroundColor,image:m.frontBackgroundImage,gradient:m.frontBackgroundGradient,focalPoint:m.frontBackgroundPosition,backgroundAttachment:m.frontBackgroundAttachment,backgroundRepeat:m.frontBackgroundRepeat,backgroundSize:m.frontBackgroundSize,changeBackgroundType:e=>p({frontBackgroundType:e}),changeImage:e=>{p({frontBackgroundImage:(0,K.pick)(e,["id","url"])})},removeImage:()=>p({frontBackgroundImage:void 0}),changeColor:e=>p({frontBackgroundColor:e}),changeGradient:e=>p({frontBackgroundGradient:e}),changeBackgroundAttachment:e=>p({frontBackgroundAttachment:e}),changeBackgroundRepeat:e=>p({frontBackgroundRepeat:e}),changeFocalPoint:e=>p({frontBackgroundPosition:e}),changeBackgroundSize:e=>p({frontBackgroundSize:e})})),(0,i.createElement)(c.PanelBody,{title:(0,o.__)("Back Side","otter-blocks"),initialOpen:!1},(0,i.createElement)(gt.Z,{backgroundType:m.backBackgroundType,backgroundColor:m.backBackgroundColor,image:m.backBackgroundImage,gradient:m.backBackgroundGradient,focalPoint:m.backBackgroundPosition,backgroundAttachment:m.backBackgroundAttachment,backgroundRepeat:m.backBackgroundRepeat,backgroundSize:m.backBackgroundSize,changeBackgroundType:e=>p({backBackgroundType:e}),changeImage:e=>{p({backBackgroundImage:(0,K.pick)(e,["id","url"])})},removeImage:()=>p({backBackgroundImage:void 0}),changeColor:e=>p({backBackgroundColor:e}),changeGradient:e=>p({backBackgroundGradient:e}),changeBackgroundAttachment:e=>p({backBackgroundAttachment:e}),changeBackgroundRepeat:e=>p({backBackgroundRepeat:e}),changeFocalPoint:e=>p({backBackgroundPosition:e}),changeBackgroundSize:e=>p({backBackgroundSize:e})})),(0,i.createElement)(s.PanelColorSettings,{title:(0,o.__)("Color","otter-blocks"),initialOpen:!1,colorSettings:[{value:m.borderColor,onChange:e=>p({borderColor:e}),label:(0,o.__)("Border Color","otter-blocks")},{value:m.titleColor,onChange:e=>p({titleColor:e}),label:(0,o.__)("Title Color","otter-blocks")},{value:m.descriptionColor,onChange:e=>p({descriptionColor:e}),label:(0,o.__)("Description Color","otter-blocks")}]}),(0,i.createElement)(c.PanelBody,{title:(0,o.__)("Border","otter-blocks"),initialOpen:!1},(0,i.createElement)(c.__experimentalBoxControl,{label:(0,o.__)("Border Width","otter-blocks"),values:(0,x.Dv)(ht(m.borderWidth),(0,x.nT)("3px")),onChange:e=>{p({borderWidth:(0,x.cg)(e,{left:"3px",right:"3px",bottom:"3px",top:"3px"})})},allowReset:!0}),(0,i.createElement)(c.__experimentalBoxControl,{id:"o-border-raduis-box",label:(0,o.__)("Border Radius","otter-blocks"),values:(0,x.Dv)(ht(m.borderRadius),(0,x.nT)("10px")),onChange:e=>{p({borderRadius:(0,x.cg)(e,{left:"10px",right:"10px",bottom:"10px",top:"10px"})})},allowReset:!0}),(0,i.createElement)(c.ToggleControl,{label:(0,o.__)("Shadow Properties","otter-blocks"),checked:m.boxShadow,onChange:e=>p({boxShadow:e})}),m.boxShadow&&(0,i.createElement)(i.Fragment,null,(0,i.createElement)(s.__experimentalColorGradientControl,{label:(0,o.__)("Color","otter-blocks"),colorValue:m.boxShadowColor,onColorChange:e=>{var t,l;p({boxShadowColor:100>m.boxShadowColorOpacity&&null!==(t=m.boxShadowColor)&&void 0!==t&&t.includes("var(")?getComputedStyle(document.documentElement,null).getPropertyValue(null==e||null===(l=e.replace("var(",""))||void 0===l?void 0:l.replace(")","")):e})}}),(0,i.createElement)(X.Z,{label:(0,o.__)("Shadow Properties","otter-blocks")},(0,i.createElement)(c.RangeControl,{label:(0,o.__)("Opacity","otter-blocks"),value:m.boxShadowColorOpacity,onChange:e=>{var t;const l={boxShadowColorOpacity:e};100>e&&null!==(t=m.boxShadowColor)&&void 0!==t&&t.includes("var(")&&(l.boxShadowColor=getComputedStyle(document.documentElement,null).getPropertyValue(m.boxShadowColor.replace("var(","").replace(")",""))),p(l)},min:0,max:100,allowReset:!0}),(0,i.createElement)(c.RangeControl,{label:(0,o.__)("Blur","otter-blocks"),value:m.boxShadowBlur,onChange:e=>p({boxShadowBlur:e}),min:0,max:100,allowReset:!0}),(0,i.createElement)(c.RangeControl,{label:(0,o.__)("Horizontal","otter-blocks"),value:m.boxShadowHorizontal,onChange:e=>p({boxShadowHorizontal:e}),min:-100,max:100,allowReset:!0}),(0,i.createElement)(c.RangeControl,{label:(0,o.__)("Vertical","otter-blocks"),value:m.boxShadowVertical,onChange:e=>p({boxShadowVertical:e}),min:-100,max:100,allowReset:!0})))))),(0,i.createElement)(C.p,null))};const{attributes:kt}=rt;const{name:ft}=rt;(0,a.registerBlockType)(ft,{...rt,title:(0,o.__)("Flip Card","otter-blocks"),description:(0,o.__)("Make a card with a flip effect. Powered by Otter.","otter-blocks"),icon:xe.Z,keywords:["flip card","container","animation"],edit:e=>{var t,l,a,n,r,d,u,b,m,p,h,v,y,k,f,_;let{attributes:w,setAttributes:C,clientId:E,isSelected:S}=e;(0,i.useEffect)((()=>{const e=(0,L.blockInit)(E,kt);return()=>e(w.id)}),[w.id]);const[T,M]=(0,i.useState)("front"),B={"--width":void 0!==w.width&&(0,K.isNumber)(w.width)&&(0,x.Yj)(w.width)||w.width,"--width-tablet":w.widthTablet,"--width-mobile":w.widthMobile,"--height":void 0!==w.height&&(0,K.isNumber)(w.height)&&(0,x.Yj)(w.height)||w.height,"--height-tablet":w.heightTablet,"--height-mobile":w.heightMobile,"--border-width":void 0!==w.borderWidth&&(0,x.um)((0,x.Dv)((0,x.nT)((0,x.Yj)(w.borderWidth)),{left:"3px",right:"3px",bottom:"3px",top:"3px"})),"--border-color":w.borderColor,"--border-radius":void 0!==w.borderRadius&&(0,x.um)((0,x.Dv)((0,x.nT)((0,x.Yj)(w.borderRadius)),{left:"10px",right:"10px",bottom:"10px",top:"10px"})),"--front-background":(0,x.nG)([["gradient"===w.frontBackgroundType&&w.frontBackgroundGradient,w.frontBackgroundGradient],["image"===w.frontBackgroundType&&(null===(t=w.frontBackgroundImage)||void 0===t?void 0:t.url),`url( ${null===(l=w.frontBackgroundImage)||void 0===l?void 0:l.url} ) ${w.frontBackgroundRepeat||"repeat"} ${w.frontBackgroundAttachment||"scroll"} ${Math.round(null!==(a=null===(n=w.frontBackgroundPosition)||void 0===n?void 0:n.x)&&void 0!==a?a:50)}% ${Math.round(null!==(r=null===(d=w.frontBackgroundPosition)||void 0===d?void 0:d.y)&&void 0!==r?r:50)}%/${w.frontBackgroundSize||"auto"}`],[w.frontBackgroundColor]]),"--back-background":(0,x.nG)([["gradient"===w.backBackgroundType&&w.backBackgroundGradient,w.backBackgroundGradient],["image"===w.backBackgroundType&&(null===(u=w.backBackgroundImage)||void 0===u?void 0:u.url),`url( ${null===(b=w.backBackgroundImage)||void 0===b?void 0:b.url} ) ${w.backBackgroundRepeat||"repeat"} ${w.backBackgroundAttachment||"scroll"} ${Math.round(null!==(m=null===(p=w.backBackgroundPosition)||void 0===p?void 0:p.x)&&void 0!==m?m:50)}% ${Math.round(null!==(h=null===(v=w.backBackgroundPosition)||void 0===v?void 0:v.y)&&void 0!==h?h:50)}%/${w.backBackgroundSize||"auto"}`],[w.backBackgroundColor]]),"--box-shadow":w.boxShadow&&`${w.boxShadowHorizontal}px ${w.boxShadowVertical}px ${w.boxShadowBlur}px ${w.boxShadowColor?w.boxShadowColor.includes("#")&&null!=w&&w.boxShadowColorOpacity&&0<=w.boxShadowColorOpacity?Z()(w.boxShadowColor,w.boxShadowColorOpacity||1e-5):w.boxShadowColor:Z()("#000000",void 0!==w.boxShadowColorOpacity?w.boxShadowColorOpacity||1e-5:1)}`,"--front-vertical-align":w.frontVerticalAlign,"--front-horizontal-align":w.frontHorizontalAlign,"--back-vertical-align":w.backVerticalAlign,"--front-media-width":(0,x.Yj)(w.frontMediaWidth),"--front-media-height":(0,x.Yj)(w.frontMediaHeight),"--padding":void 0!==w.padding&&(0,K.isNumber)(w.padding)&&(0,x.Yj)(w.padding)||(0,x.um)(null==w?void 0:w.padding),"--padding-tablet":(0,x.um)(null==w?void 0:w.paddingTablet),"--padding-mobile":(0,x.um)(null==w?void 0:w.paddingMobile)},[z,P]=(0,L.useCSSNode)();(0,i.useEffect)((()=>{P([`.o-flip-inner {\n\t\t\t\ttransform: ${"back"===T?"var( --flip-anim )":"unset"};\n\t\t\t}`,`.o-flip-front .o-flip-content h3 {\n\t\t\t\tcolor: ${w.titleColor};\n\t\t\t\t${w.titleFontSize&&`font-size: ${(0,x.Yj)(w.titleFontSize)}`}\n\t\t\t}`,`.o-flip-front .o-flip-content p {\n\t\t\t\tcolor: ${w.descriptionColor};\n\t\t\t\t${w.descriptionFontSize&&`font-size: ${(0,x.Yj)(w.descriptionFontSize)}`}\n\t\t\t}`])}),[T,w.titleFontSize,w.descriptionFontSize,w.titleColor,w.descriptionColor]);const R=(0,s.useBlockProps)({id:w.id,className:g()({flipX:"flipX"===w.animType,flipY:"flipY"===w.animType,"flipY-rev":"flipY-rev"===w.animType,"flipX-rev":"flipX-rev"===w.animType},z),style:B});return(0,i.createElement)(i.Fragment,null,(0,i.createElement)(ut,{attributes:w,setAttributes:C,currentSide:T}),(0,i.createElement)(yt,{attributes:w,setAttributes:C,currentSide:T,setSide:M}),(0,i.createElement)("div",R,(0,i.createElement)("div",{className:g()("o-flip-inner",{invert:w.isInverted})},(0,i.createElement)("div",{className:"o-flip-front"},(0,i.createElement)("div",{className:"o-flip-content"},(null===(y=w.frontMedia)||void 0===y?void 0:y.url)&&(0,i.createElement)("img",{className:"o-img",srcSet:null===(k=w.frontMedia)||void 0===k?void 0:k.url}),(0,i.createElement)(s.RichText,{tagName:"h3",value:null!==(f=w.title)&&void 0!==f?f:"",onChange:e=>C({title:e}),placeholder:(0,o.__)("Insert a title","otter-blocks")}),(0,i.createElement)(s.RichText,{tagName:"p",value:null!==(_=w.description)&&void 0!==_?_:"",onChange:e=>C({description:e}),placeholder:(0,o.__)("Insert a description","otter-blocks")}))),(0,i.createElement)("div",{className:"o-flip-back"},(0,i.createElement)(s.InnerBlocks,{renderAppender:S?s.InnerBlocks.ButtonBlockAppender:void 0,template:[["core/heading",{content:"Lorem ipsum",level:3}],["core/paragraph",{content:"Tellus posuere sem fermentum facilisis platea."}],["core/buttons",{layout:{type:"flex",justifyContent:"center"},innerBlocks:[{name:"core/button",attributes:{className:"is-style-outline",text:"Learn more"}}]}]]}))),S&&(0,i.createElement)("div",{className:"o-switcher"},(0,i.createElement)(c.Button,{isPrimary:!0,onClick:()=>M("back"===T?"front":"back")},"back"===T?(0,o.__)("Flip to Front","otter-blocks"):(0,o.__)("Flip to Back","otter-blocks")))))},save:e=>{var t,l,o,a;let{attributes:n}=e;const r=s.useBlockProps.save({id:n.id,className:g()("anim",{flipX:"flipX"===n.animType,flipY:"flipY"===n.animType,"flipY-rev":"flipY-rev"===n.animType,"flipX-rev":"flipX-rev"===n.animType})});return(0,i.createElement)("div",r,(0,i.createElement)("div",{className:g()("o-flip-inner",{invert:n.isInverted})},(0,i.createElement)("div",{className:"o-flip-front"},(0,i.createElement)("div",{className:"o-flip-content"},(null===(t=n.frontMedia)||void 0===t?void 0:t.url)&&(0,i.createElement)("img",{className:"o-img",src:null===(l=n.frontMedia)||void 0===l?void 0:l.url,srcSet:null===(o=n.frontMedia)||void 0===o?void 0:o.url,alt:null===(a=n.frontMedia)||void 0===a?void 0:a.alt}),(0,i.createElement)(s.RichText.Content,{tagName:"h3",value:n.title}),(0,i.createElement)(s.RichText.Content,{tagName:"p",value:n.description}))),(0,i.createElement)("div",{className:"o-flip-back"},(0,i.createElement)(s.InnerBlocks.Content,null))))},example:{attributes:{}}});var _t=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"themeisle-blocks/font-awesome-icons","title":"Icon","category":"themeisle-blocks","description":"Add icons from Font Awesome or ThemeIsle Icons library to your website. Powered by Otter.","keywords":["font awesome","dashicons","icons"],"textdomain":"otter-blocks","attributes":{"id":{"type":"string"},"align":{"type":["string","object"]},"library":{"type":"string","default":"fontawesome"},"prefix":{"type":"string","default":"fab"},"icon":{"type":"string","default":"themeisle"},"link":{"type":"string"},"newTab":{"type":"boolean","default":false},"fontSize":{"type":["number","string"],"default":"16px"},"padding":{"type":"number","default":5},"margin":{"type":"number","default":5},"backgroundColor":{"type":"string"},"textColor":{"type":"string"},"borderColor":{"type":"string"},"backgroundColorHover":{"type":"string"},"textColorHover":{"type":"string"},"borderColorHover":{"type":"string"},"borderSize":{"type":"number","default":0},"borderRadius":{"type":"number","default":0},"isSynced":{"type":"array"}},"editorStyle":"otter-font-awesome-editor","style":"otter-font-awesome-style"}');const wt={prefix:{type:"string",default:"fab"},icon:{type:"string",default:"themeisle"},fontSize:{type:"number",default:16},padding:{type:"number",default:5},margin:{type:"number",default:5},backgroundColor:{type:"string"},textColor:{type:"string"},borderColor:{type:"string"},borderSize:{type:"number",default:0},borderRadius:{type:"number",default:0}},Ct=[{attributes:{id:{type:"string"},align:{type:"string"},library:{type:"string",default:"fontawesome"},prefix:{type:"string",default:"fab"},icon:{type:"string",default:"themeisle"},link:{type:"string"},newTab:{type:"boolean",default:!1},fontSize:{type:"number",default:16},padding:{type:"number",default:5},margin:{type:"number",default:5},backgroundColor:{type:"string"},textColor:{type:"string"},borderColor:{type:"string"},backgroundColorHover:{type:"string"},textColorHover:{type:"string"},borderColorHover:{type:"string"},borderSize:{type:"number",default:0},borderRadius:{type:"number",default:0},isSynced:{type:"array"}},supports:{align:["left","center","right"]},save:e=>{let{attributes:t}=e;const l=we.ZP.icons[t.icon],o=s.useBlockProps.save({id:t.id});return(0,i.createElement)("p",o,(0,i.createElement)("span",{className:"wp-block-themeisle-blocks-font-awesome-icons-container"},t.link?(0,i.createElement)("a",{href:t.link,target:t.newTab?"_blank":"_self",rel:"noopener noreferrer"},"themeisle-icons"===t.library?(0,i.createElement)(l,null):(0,i.createElement)("i",{className:`${t.prefix} fa-${t.icon}`})):"themeisle-icons"===t.library?(0,i.createElement)(l,null):(0,i.createElement)("i",{className:`${t.prefix} fa-${t.icon}`})))}},{attributes:wt,supports:{align:["left","center","right"]},migrate:e=>{let t="center";return e.className.includes("alignleft")&&(t="left"),e.className.includes("aligncenter")&&(t="center"),e.className.includes("alignright")&&(t="right"),{...e,align:t,className:""}},save:e=>{let{attributes:t,className:l}=e;const o={borderRadius:t.borderRadius+"%",fontSize:t.fontSize+"px",padding:t.padding+"px"},a={color:t.textColor,backgroundColor:t.backgroundColor,borderColor:t.borderColor,borderRadius:t.borderRadius+"%",borderStyle:"solid",borderWidth:t.borderSize+"px",display:"inline-block",margin:t.margin+"px"};return(0,i.createElement)("p",{className:l,style:{textAlign:t.align}},(0,i.createElement)("span",{className:`${l}-container`,style:a},(0,i.createElement)("i",{className:`${t.prefix} fa-${t.icon}`,style:o})))}},{attributes:{...wt,align:{type:"string"}},save:e=>{let{attributes:t,className:l}=e;const o={borderRadius:t.borderRadius+"%",fontSize:t.fontSize+"px",padding:t.padding+"px"},a={color:t.textColor,backgroundColor:t.backgroundColor,borderColor:t.borderColor,borderRadius:t.borderRadius+"%",borderStyle:"solid",borderWidth:t.borderSize+"px",display:"inline-block",margin:t.margin+"px"};return(0,i.createElement)("p",{className:l,style:{textAlign:t.align}},(0,i.createElement)("span",{className:"undefined-container",style:a},(0,i.createElement)("i",{className:`${t.prefix} fa-${t.icon}`,style:o})))}},{attributes:{...wt,id:{type:"string"},align:{type:"string"},link:{type:"string"},newTab:{type:"boolean",default:!1},backgroundColorHover:{type:"string"},textColorHover:{type:"string"},borderColorHover:{type:"string"}},save:e=>{let{attributes:t,className:l}=e;const o={borderRadius:t.borderRadius+"%",borderStyle:"solid",borderWidth:t.borderSize+"px",display:"inline-block",margin:t.margin+"px"},a={borderRadius:t.borderRadius+"%",fontSize:t.fontSize+"px",padding:t.padding+"px"},n=()=>(0,i.createElement)("i",{className:`${t.prefix} fa-${t.icon}`,style:a});return(0,i.createElement)("p",{className:l,id:t.id,style:{textAlign:t.align}},(0,i.createElement)("span",{className:"wp-block-themeisle-blocks-font-awesome-icons-container",style:o},t.link?(0,i.createElement)("a",{href:t.link,target:t.newTab?"_blank":"_self",style:{color:t.textColor},rel:"noopener noreferrer"},(0,i.createElement)(n,null)):(0,i.createElement)(n,null)))}}];var Et=Ct;const xt={left:"flex-start",center:"center",right:"flex-end","flex-start":"left","flex-end":"right"};var St=e=>{var t,l,o,a;let{attributes:n,setAttributes:r,isSelected:c}=e;const{responsiveSetAttributes:d,responsiveGetAttributes:u}=S(r);return(0,i.createElement)(s.BlockControls,null,(0,i.createElement)(s.AlignmentToolbar,{value:xt[null!==(t=u([null===(l=Lt(n.align))||void 0===l?void 0:l.desktop,null===(o=Lt(n.align))||void 0===o?void 0:o.tablet,null===(a=Lt(n.align))||void 0===a?void 0:a.mobile]))&&void 0!==t?t:"center"],onChange:e=>d(""===e?void 0:xt[e],["align.desktop","align.tablet","align.mobile"],Lt(n.align))}),(0,i.createElement)(ke.Z,{isSelected:c,setAttributes:r,url:n.link,opensInNewTab:n.newTab}))},Tt=l(3159);const Mt=[{name:(0,o.__)("Small","otter-blocks"),size:"16px",slug:"small"},{name:(0,o.__)("Medium","otter-blocks"),size:"32px",slug:"medium"},{name:(0,o.__)("Large","otter-blocks"),size:"48px",slug:"large"},{name:(0,o.__)("XL","otter-blocks"),size:"60px",slug:"xl"}];var Bt=e=>{var t,l,a,n,r;let{attributes:d,setAttributes:u,getValue:b}=e;const[m,p]=(0,i.useState)(!1),{responsiveSetAttributes:g,responsiveGetAttributes:h}=S(u);return(0,i.createElement)(s.InspectorControls,null,(0,i.createElement)(c.PanelBody,{title:(0,o.__)("Icon","otter-blocks")},(0,i.createElement)(_.Z,{label:(0,o.__)("Icon Picker","otter-blocks"),library:d.library,prefix:d.prefix,icon:d.icon,changeLibrary:e=>{u({library:e,icon:"fontawesome"===e?"themeisle":"balance",prefix:"fab"})},onChange:e=>{u("object"==typeof e?{icon:e.name,prefix:e.prefix}:{icon:e})}})),(0,i.createElement)(c.PanelBody,{title:(0,o.__)("Dimensions","otter-blocks"),initialOpen:!1},(0,i.createElement)(Tt.Z,{field:"fontSize",isSynced:d.isSynced,setAttributes:u},(0,i.createElement)(c.FontSizePicker,{fontSizes:Mt,withReset:!0,value:null!==(t=d.fontSize)&&void 0!==t?t:"16px",onChange:e=>u({fontSize:e})})),(0,i.createElement)(Tt.Z,{field:"padding",isSynced:d.isSynced,setAttributes:u},(0,i.createElement)(c.RangeControl,{label:(0,o.__)("Padding","otter-blocks"),value:b("padding"),initialPosition:5,onChange:e=>u({padding:e}),step:.1,min:0,max:100})),(0,i.createElement)(Tt.Z,{field:"margin",isSynced:d.isSynced,setAttributes:u},(0,i.createElement)(c.RangeControl,{label:(0,o.__)("Margin","otter-blocks"),value:b("margin"),initialPosition:5,onChange:e=>u({margin:e}),step:.1,min:0,max:100})),(0,i.createElement)(M.Z,{label:(0,o.__)("Alignment","otter-blocks"),className:"buttons-alignment-control"},(0,i.createElement)(pe.Z,{value:null!==(l=h([null===(a=Lt(d.align))||void 0===a?void 0:a.desktop,null===(n=Lt(d.align))||void 0===n?void 0:n.tablet,null===(r=Lt(d.align))||void 0===r?void 0:r.mobile]))&&void 0!==l?l:"center",onChange:e=>g(""===e?void 0:e,["align.desktop","align.tablet","align.mobile"],Lt(d.align)),options:[{icon:bt.Z,label:(0,o.__)("Left","otter-blocks"),value:"flex-start"},{icon:mt.Z,label:(0,o.__)("Center","otter-blocks"),value:"center"},{icon:pt.Z,label:(0,o.__)("Right","otter-blocks"),value:"flex-end"}],hasIcon:!0}))),(0,i.createElement)(c.PanelBody,{title:(0,o.__)("Color","otter-blocks"),initialOpen:!1},(0,i.createElement)(c.ButtonGroup,null,(0,i.createElement)(c.Button,{isSmall:!0,isSecondary:m,isPrimary:!m,onClick:()=>p(!1)},(0,o.__)("Normal","otter-blocks")),(0,i.createElement)(c.Button,{isSmall:!0,isSecondary:!m,isPrimary:m,onClick:()=>p(!0)},(0,o.__)("Hover","otter-blocks"))),m?(0,i.createElement)(i.Fragment,null,(0,i.createElement)(Tt.Z,{field:"backgroundColorHover",isSynced:d.isSynced,setAttributes:u},(0,i.createElement)(s.__experimentalColorGradientControl,{label:(0,o.__)("Hover Background","otter-blocks"),colorValue:b("backgroundColorHover"),onColorChange:e=>u({backgroundColorHover:e})})),(0,i.createElement)(Tt.Z,{field:"textColorHover",isSynced:d.isSynced,setAttributes:u},(0,i.createElement)(s.__experimentalColorGradientControl,{label:(0,o.__)("Hover Icon","otter-blocks"),colorValue:b("textColorHover"),onColorChange:e=>u({textColorHover:e})})),(0,i.createElement)(s.ContrastChecker,{textColor:b("textColorHover"),backgroundColor:b("backgroundColorHover")}),(0,i.createElement)(s.__experimentalColorGradientControl,{label:(0,o.__)("Hover Border","otter-blocks"),colorValue:d.borderColorHover,onColorChange:e=>u({borderColorHover:e})})):(0,i.createElement)(i.Fragment,null,(0,i.createElement)(Tt.Z,{field:"backgroundColor",isSynced:d.isSynced,setAttributes:u},(0,i.createElement)(s.__experimentalColorGradientControl,{label:(0,o.__)("Background","otter-blocks"),colorValue:b("backgroundColor"),onColorChange:e=>u({backgroundColor:e})})),(0,i.createElement)(Tt.Z,{field:"textColor",isSynced:d.isSynced,setAttributes:u},(0,i.createElement)(s.__experimentalColorGradientControl,{label:(0,o.__)("Icon","otter-blocks"),colorValue:b("textColor"),onColorChange:e=>u({textColor:e})})),(0,i.createElement)(s.ContrastChecker,{textColor:b("textColor"),backgroundColor:b("backgroundColor")}),(0,i.createElement)(s.__experimentalColorGradientControl,{label:(0,o.__)("Border","otter-blocks"),colorValue:d.borderColor,onColorChange:e=>u({borderColor:e})}))),(0,i.createElement)(c.PanelBody,{title:(0,o.__)("Border Settings","otter-blocks"),initialOpen:!1},(0,i.createElement)(c.RangeControl,{label:(0,o.__)("Border Size","otter-blocks"),value:d.borderSize,onChange:e=>u({borderSize:e}),step:.1,min:0,max:120}),(0,i.createElement)(c.RangeControl,{label:(0,o.__)("Border Radius","otter-blocks"),value:d.borderRadius,onChange:e=>u({borderRadius:e}),step:.1,min:0,max:100})))};const{attributes:zt}=_t,Pt={right:"flex-end",center:"center",left:"flex-start"},Lt=e=>{var t;return(0,K.isString)(e)?{desktop:null!==(t=null==Pt?void 0:Pt[e])&&void 0!==t?t:"center"}:e};const{name:Rt}=_t;(0,a.registerBlockType)(Rt,{..._t,title:(0,o.__)("Icon","otter-blocks"),description:(0,o.__)("Add icons from Font Awesome or ThemeIsle Icons library to your website. Powered by Otter.","otter-blocks"),icon:r.faIcon,keywords:["font awesome","dashicons","icons"],deprecated:Et,edit:e=>{var t,l,o;let{name:a,attributes:n,setAttributes:r,isSelected:c,clientId:d}=e;(0,i.useEffect)((()=>{const e=(0,L.blockInit)(d,zt);return()=>e(n.id)}),[n.id]);const u=we.ZP.icons[n.icon],b=e=>(0,L.getDefaultValueByField)({name:a,field:e,defaultAttributes:zt,attributes:n}),m={"--align":n.align,"--border-color":n.borderColor,"--border-size":void 0!==n.borderSize&&`${n.borderSize}px`,"--border-radius":void 0!==n.borderRadius&&`${n.borderRadius}%`,"--margin":void 0!==n.margin&&`${b("margin")}px`,"--padding":void 0!==n.padding&&`${b("padding")}px`,"--font-size":void 0!==n.fontSize&&((0,K.isNumber)(b("fontSize"))?`${b("fontSize")}px`:b("fontSize")),"--align":null===(t=Lt(n.align))||void 0===t?void 0:t.desktop,"--align-tablet":null===(l=Lt(n.align))||void 0===l?void 0:l.tablet,"--align-mobile":null===(o=Lt(n.align))||void 0===o?void 0:o.mobile},[p,g]=(0,L.useCSSNode)();(0,i.useEffect)((()=>{g([`.wp-block-themeisle-blocks-font-awesome-icons-container {\n\t\t\t\tcolor: ${b("textColor")};\n\t\t\t\tbackground-color: ${b("backgroundColor")};\n\t\t\t}`,`.wp-block-themeisle-blocks-font-awesome-icons-container:hover {\n\t\t\t\tcolor: ${b("textColorHover")};\n\t\t\t\tbackground-color: ${b("backgroundColorHover")};\n\t\t\t\tborder-color: ${n.borderColorHover};\n\t\t\t}`,`.wp-block-themeisle-blocks-font-awesome-icons-container a {\n\t\t\t\tcolor: ${b("textColor")};\n\t\t\t}`,`.wp-block-themeisle-blocks-font-awesome-icons-container svg {\n\t\t\t\tfill: ${b("textColor")};\n\t\t\t}`,`.wp-block-themeisle-blocks-font-awesome-icons-container:hover svg {\n\t\t\t\tfill: ${b("textColorHover")};\n\t\t\t}`])}),[n.textColor,n.backgroundColor,n.textColorHover,n.backgroundColorHover,n.borderColorHover,n.fontSize]);const h=(0,s.useBlockProps)({id:n.id,style:m,className:p});return(0,i.createElement)(i.Fragment,null,(0,i.createElement)(St,{attributes:n,setAttributes:r,isSelected:c}),(0,i.createElement)(Bt,{attributes:n,setAttributes:r,getValue:b}),(0,i.createElement)("div",h,(0,i.createElement)("span",{className:"wp-block-themeisle-blocks-font-awesome-icons-container"},"themeisle-icons"===n.library?(0,i.createElement)(u,null):(0,i.createElement)("i",{className:`${n.prefix} fa-${n.icon}`}))))},save:e=>{let{attributes:t}=e;const l=we.ZP.icons[t.icon],o=s.useBlockProps.save({id:t.id});return(0,i.createElement)("div",o,(0,i.createElement)("span",{className:"wp-block-themeisle-blocks-font-awesome-icons-container"},t.link?(0,i.createElement)("a",{href:t.link,target:t.newTab?"_blank":"_self",rel:"noopener noreferrer"},"themeisle-icons"===t.library?(0,i.createElement)(l,null):(0,i.createElement)("i",{className:`${t.prefix} fa-${t.icon}`})):"themeisle-icons"===t.library?(0,i.createElement)(l,null):(0,i.createElement)("i",{className:`${t.prefix} fa-${t.icon}`})))},example:{attributes:{fontSize:70}}});var Ft=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"themeisle-blocks/form","title":"Form","category":"themeisle-blocks","description":"Display a form for your clients. Powered by Otter.","keywords":["business","form","email"],"textdomain":"otter-blocks","attributes":{"id":{"type":"string"},"subject":{"type":"string"},"emailTo":{"type":"string"},"fromName":{"type":"string"},"optionName":{"type":"string"},"hasCaptcha":{"type":"boolean"},"provider":{"type":"string","default":""},"listId":{"type":"string"},"action":{"type":"string","default":"subscribe"},"submitLabel":{"type":"string"},"sendUserEmail":{"type":"boolean"},"redirectLink":{"type":"string"},"inputPadding":{"type":"object"},"labelColor":{"type":"string"},"helpLabelColor":{"type":"string"},"inputRequiredColor":{"type":"string"},"inputBorderRadius":{"type":"number"},"inputBorderColor":{"type":"string"},"inputBorderWidth":{"type":"number"},"submitMessage":{"type":"string"},"inputWidth":{"type":"number"},"submitMessageColor":{"type":"string"},"submitMessageErrorColor":{"type":"string"},"submitBackgroundColor":{"type":"string"},"submitBackgroundColorHover":{"type":"string"},"submitColor":{"type":"string"},"inputGap":{"type":"number"},"inputColor":{"type":"string"},"inputBackgroundColor":{"type":"string"},"inputsGap":{"type":"number"},"labelFontSize":{"type":"string"},"submitFontSize":{"type":"string"},"messageFontSize":{"type":"string"},"helpFontSize":{"type":"string"},"inputFontSize":{"type":"string"},"submitStyle":{"type":"string"},"isSynced":{"type":"array"}},"supports":{"align":["wide","full"]},"editorStyle":"otter-form-editor","style":"otter-form-style","script":"otter-form"}');const At=[{attributes:{id:{type:"string"},subject:{type:"string"},emailTo:{type:"string"},optionName:{type:"string"},hasCaptcha:{type:"boolean"},provider:{type:"string",default:""},apiKey:{type:"string"},listId:{type:"string"},action:{type:"string",default:"subscribe"}},supports:{align:["wide","full"]},save:e=>{let{attributes:t}=e;const l=t.provider&&t.apiKey&&t.listId,a=s.useBlockProps.save({id:t.id,className:g()({"is-subscription":l&&"subscribe"===t.action,"can-submit-and-subscribe":l&&"submit-subscribe"===t.action,"has-captcha":t.hasCaptcha}),"data-email-subject":t.subject,"data-option-name":t.optionName});return(0,i.createElement)("div",a,(0,i.createElement)("div",{className:"otter-form__container"},(0,i.createElement)(s.InnerBlocks.Content,null),(0,i.createElement)("div",{className:"wp-block-button"},(0,i.createElement)("button",{className:"wp-block-button__link"},"subscribe"===t.action?(0,o.__)("Subscribe","otter-blocks"):(0,o.__)("Submit","otter-blocks")))))}}];var Ht=At,Ot=l(8101),Nt=l.n(Ot),Vt=l(6989),It=l.n(Vt);const Dt=e=>(null==e?void 0:e[1])&&e[0]!==e[1],Gt=e=>Boolean(0<e.filter(Dt).length),$t=[{name:(0,o.__)("Small","otter-blocks"),size:"0.875em",slug:"small"},{name:(0,o.__)("Medium","otter-blocks"),size:"1em",slug:"medium"},{name:(0,o.__)("Large","otter-blocks"),size:"1.125em",slug:"large"},{name:(0,o.__)("XL","otter-blocks"),size:"1.25em",slug:"xl"}];var Wt=e=>{var t,l,a,n,r,d,u,b,m,p,g;let{attributes:h,setAttributes:v}=e;const{listIDOptions:y,setListIDOptions:k,saveFormEmailOptions:f,saveIntegration:_,savedFormOptions:w,sendTestEmail:C,loadingState:E,formOptions:x,setFormOption:S,testService:T,hasEmailField:M}=(0,i.useContext)(Ut),B=Gt([[x.emailTo,null==w?void 0:w.email],[x.subject,null==w?void 0:w.emailSubject],[x.redirectLink,null==w?void 0:w.redirectLink],[x.fromName,null==w?void 0:w.fromName],[x.submitMessage,null==w?void 0:w.submitMessage],[x.cc,null==w?void 0:w.cc],[x.bcc,null==w?void 0:w.bcc],[x.hasCaptcha,null==w?void 0:w.hasCaptcha]]),z=Gt([[x.provider,null==w||null===(t=w.integration)||void 0===t?void 0:t.provider],[x.listId,null==w||null===(l=w.integration)||void 0===l?void 0:l.listId],[x.action,null==w||null===(a=w.integration)||void 0===a?void 0:a.action]]);return(0,i.createElement)(s.InspectorControls,null,(0,i.createElement)(s.PanelColorSettings,{title:(0,o.__)("Form Color","otter-blocks"),initialOpen:!1,colorSettings:[{value:h.labelColor,onChange:e=>v({labelColor:e}),label:(0,o.__)("Label","otter-blocks")},{value:h.helpLabelColor,onChange:e=>v({helpLabelColor:e}),label:(0,o.__)("Help Label","otter-blocks")},{value:h.inputBorderColor,onChange:e=>v({inputBorderColor:e}),label:(0,o.__)("Border","otter-blocks")},{value:h.inputRequiredColor,onChange:e=>v({inputRequiredColor:e}),label:(0,o.__)("Label Required","otter-blocks")},{value:h.inputColor,onChange:e=>v({inputColor:e}),label:(0,o.__)("Input Text","otter-blocks")},{value:h.inputBackgroundColor,onChange:e=>v({inputBackgroundColor:e}),label:(0,o.__)("Input Background","otter-blocks")}]}),(0,i.createElement)(s.PanelColorSettings,{title:(0,o.__)("Button Color","otter-blocks"),initialOpen:!1,colorSettings:[{value:h.submitColor,onChange:e=>v({submitColor:e}),label:(0,o.__)("Submit Text","otter-blocks")},{value:h.submitBackgroundColor,onChange:e=>v({submitBackgroundColor:e}),label:(0,o.__)("Button Background","otter-blocks")},{value:h.submitBackgroundColorHover,onChange:e=>v({submitBackgroundColorHover:e}),label:(0,o.__)("Button Background on Hover","otter-blocks")},{value:h.submitMessageColor,onChange:e=>v({submitMessageColor:e}),label:(0,o.__)("Successful Message","otter-blocks")},{value:h.submitMessageErrorColor,onChange:e=>v({submitMessageErrorColor:e}),label:(0,o.__)("Error Message","otter-blocks")}]}),(0,i.createElement)(c.PanelBody,{title:(0,o.__)("Label Styling","otter-blocks"),initialOpen:!1},(0,i.createElement)(Tt.Z,{field:"inputGap",isSynced:h.isSynced,setAttributes:v},(0,i.createElement)(c.RangeControl,{label:(0,o.__)("Spacing","otter-blocks"),value:null!==(n=h.inputGap)&&void 0!==n?n:10,onChange:e=>v({inputGap:e}),allowReset:!0,step:.1,min:0,max:50,initialPositino:10})),(0,i.createElement)(Tt.Z,{field:"labelFontSize",isSynced:h.isSynced,setAttributes:v},(0,i.createElement)(c.FontSizePicker,{label:(0,o.__)("Font Size","otter-blocks"),fontSizes:$t,withReset:!0,value:h.labelFontSize,onChange:e=>v({labelFontSize:e})}))),(0,i.createElement)(c.PanelBody,{title:(0,o.__)("Input Styling","otter-blocks"),initialOpen:!1},(0,i.createElement)(Tt.Z,{field:"inputFontSize",isSynced:h.isSynced,setAttributes:v},(0,i.createElement)(c.FontSizePicker,{label:(0,o.__)("Input Font Size","otter-blocks"),fontSizes:$t,withReset:!0,value:h.inputFontSize,onChange:e=>v({inputFontSize:e})})),(0,i.createElement)(Tt.Z,{field:"inputsGap",isSynced:h.isSynced,setAttributes:v},(0,i.createElement)(c.RangeControl,{label:(0,o.__)("Fields Spacing","otter-blocks"),value:null!==(r=h.inputsGap)&&void 0!==r?r:16,onChange:e=>v({inputsGap:e}),allowReset:!0,min:0,max:50,initialPosition:16})),(0,i.createElement)(Tt.Z,{field:"inputPadding",isSynced:h.isSynced,setAttributes:v},(0,i.createElement)(c.__experimentalBoxControl,{label:(0,o.__)("Input Padding","otter-blocks"),values:null!==(d=h.inputPadding)&&void 0!==d?d:{top:"8px",right:"8px",bottom:"8px",left:"8px"},inputProps:{min:0,max:500},onChange:e=>v({inputPadding:e})})),(0,i.createElement)(Tt.Z,{field:"inputsBorderRadius",isSynced:h.isSynced,setAttributes:v},(0,i.createElement)(c.RangeControl,{label:(0,o.__)("Border Radius","otter-blocks"),value:null!==(u=h.inputBorderRadius)&&void 0!==u?u:4,onChange:e=>v({inputBorderRadius:e}),allowReset:!0,step:.1,min:0,max:50})),(0,i.createElement)(Tt.Z,{field:"inputsBorderWidth",isSynced:h.isSynced,setAttributes:v},(0,i.createElement)(c.RangeControl,{label:(0,o.__)("Border Width","otter-blocks"),value:null!==(b=h.inputBorderWidth)&&void 0!==b?b:1,onChange:e=>v({inputBorderWidth:e}),allowReset:!0,step:.1,min:0,max:50})),(0,i.createElement)(Tt.Z,{field:"helpFontSize",isSynced:h.isSynced,setAttributes:v},(0,i.createElement)(c.BaseControl,{label:(0,o.__)("Help Text Font Size","otter-blocks")},(0,i.createElement)(c.FontSizePicker,{label:(0,o.__)("Help Font Size","otter-blocks"),fontSizes:$t,withReset:!0,value:h.helpFontSize,onChange:e=>v({helpFontSize:e})})))),(0,i.createElement)(c.PanelBody,{title:(0,o.__)("Button","otter-blocks"),initialOpen:!1},(0,i.createElement)(c.TextControl,{label:(0,o.__)("Label","otter-blocks"),placeholder:(0,o.__)("Submit","otter-blocks"),value:h.submitLabel,onChange:e=>v({submitLabel:e}),help:(0,o.__)("Set the label for the submit button.","otter-blocks")}),(0,i.createElement)(Tt.Z,{field:"submitFontSize",isSynced:h.isSynced,setAttributes:v},(0,i.createElement)(c.FontSizePicker,{label:(0,o.__)("Font Size","otter-blocks"),fontSizes:$t,withReset:!0,value:h.submitFontSize,onChange:e=>v({submitFontSize:e})})),(0,i.createElement)(c.SelectControl,{label:(0,o.__)("Alignment","otter-blocks"),value:h.submitStyle,options:[{label:"Default",value:""},{label:"Right",value:"right"},{label:"Full",value:"full"}],onChange:e=>v({submitStyle:e})}),(0,i.createElement)(Tt.Z,{field:"messageFontSize",isSynced:h.isSynced,setAttributes:v},(0,i.createElement)(c.BaseControl,{label:(0,o.__)("Message Font Size","otter-blocks")},(0,i.createElement)(c.FontSizePicker,{label:(0,o.__)("Message Font Size","otter-blocks"),fontSizes:$t,withReset:!0,value:h.messageFontSize,onChange:e=>v({messageFontSize:e})})))),(0,i.createElement)(c.PanelBody,{title:(0,o.__)("Form Options","otter-blocks"),initialOpen:!1},"loading"===(null==E?void 0:E.formOptions)&&(0,i.createElement)("div",{className:"o-fetch-msg"},(0,i.createElement)(c.Spinner,null),(0,o.__)("Loading the options. Please wait...","otter-blocks")),(0,i.createElement)(c.TextControl,{label:(0,o.__)("Email Subject","otter-blocks"),placeholder:(0,o.__)("A new submission","otter-blocks"),value:x.subject,onChange:e=>S({subject:e}),help:(0,o.__)("Customize the title of the email that you are gonna receive after a user submits the form.","otter-blocks")}),(0,i.createElement)(c.TextControl,{label:(0,o.__)("From Name","otter-blocks"),value:x.fromName,onChange:e=>S({fromName:e}),help:(0,o.__)("Set the name of the sender. Some SMTP plugins might override this value.","otter-blocks")}),(0,i.createElement)(c.TextControl,{label:(0,o.__)("Email To","otter-blocks"),placeholder:(0,o.__)("Default is to admin site","otter-blocks"),type:"email",value:x.emailTo,onChange:e=>S({emailTo:e}),help:(0,o.__)("Send the form's data to another email. (Admin's email is default).","otter-blocks")}),(0,i.createElement)(c.TextControl,{label:(0,o.__)("Cc","otter-blocks"),placeholder:(0,o.__)("Send copies to","otter-blocks"),type:"text",value:x.cc,onChange:e=>S({cc:e}),help:(0,o.__)("Add emails separated by commas: example1@otter.com, example2@otter.com.","otter-blocks")}),(0,i.createElement)(c.TextControl,{label:(0,o.__)("Bcc","otter-blocks"),placeholder:(0,o.__)("Send copies to","otter-blocks"),type:"text",value:x.bcc,onChange:e=>S({bcc:e}),help:(0,o.__)("Add emails separated by commas: example1@otter.com, example2@otter.com.","otter-blocks")}),(0,i.createElement)(c.TextareaControl,{label:(0,o.__)("Submit Success Message","otter-blocks"),placeholder:(0,o.__)("Success","otter-blocks"),value:x.submitMessage,onChange:e=>S({submitMessage:e}),help:(0,o.__)("Show this message after the form was successfully submitted.","otter-blocks")}),(0,i.createElement)(c.TextControl,{label:(0,o.__)("Redirect To","otter-blocks"),type:"url",placeholder:(0,o.__)("https://example.com","otter-blocks"),value:x.redirectLink,onChange:e=>S({redirectLink:e}),help:(0,o.__)("Redirect the user to another page when submit is successful.","otter-blocks")}),x.redirectLink&&(0,i.createElement)(c.ExternalLink,{href:x.redirectLink,style:{marginBottom:"10px",display:"block"}},(0,o.__)("Preview Redirect link.","otter-blocks")),(0,i.createElement)(c.Button,{isPrimary:!0,onClick:f,help:(0,o.__)("[WIP] Do not forget to save the options ","otter-blocks"),isBusy:"saving"===(null==E?void 0:E.formOptions)},"saving"===(null==E?void 0:E.formOptions)?(0,o.__)("Saving...","otter-blocks"):(0,o.__)("Apply Options","otter-blocks")),"done"===(null==E?void 0:E.formOptions)&&B&&(0,i.createElement)("div",{className:"o-fetch-msg"},(0,o.__)("You have made some modifications. Do not forget to save the options.","otter-blocks")),"error"===(null==E?void 0:E.formOptions)&&(0,i.createElement)("div",{className:"o-fetch-msg o-error"},(0,o.__)("An error has occurred while saving. Please try again.","otter-blocks"))),(0,i.createElement)(c.PanelBody,{title:(0,o.__)("Test SMTP","otter-blocks"),initialOpen:!1},(0,i.createElement)("span",null,(0,o.__)("In order for the Form to work properly, make sure your SMTP server is set up. The test email will be send to the address from the field Email To on Form Options.","otter-blocks")),(0,i.createElement)(c.ExternalLink,{href:"https://www.wpbeginner.com/wp-tutorials/how-to-use-smtp-server-to-send-wordpress-emails/",style:{marginLeft:"3px"}},(0,o.__)("Learn more.","otter-blocks")),(0,i.createElement)("br",null),(0,i.createElement)(c.Button,{variant:"primary",isPrimary:!0,style:{marginTop:"8px"},onClick:C},(0,o.__)("Send Test Email","otter-blocks"))),(0,i.createElement)(c.PanelBody,{title:(0,o.__)("Bot Protection","otter-blocks"),initialOpen:!1},(0,i.createElement)(c.ToggleControl,{label:(0,o.__)("Add captcha checkbox","otter-blocks"),checked:h.hasCaptcha,onChange:e=>v({hasCaptcha:e}),help:(0,o.__)("Add Google reCaptcha V2 for protection againts bots. You will need an API Key.","otter-blocks")}),x.hasCaptcha&&(0,i.createElement)("div",{style:{display:"flow-root",margin:"10px 0px"}},(0,o.__)("You can change the reCaptcha API Keys in Settings > Otter. ","otter-blocks"),(0,i.createElement)(c.ExternalLink,{href:"https://www.google.com/recaptcha/about/",target:"_blank"},(0,o.__)("Learn more about reCaptcha.","otter-blocks")))),(0,i.createElement)(c.PanelBody,{title:(0,o.__)("Marketing Integration","otter-blocks"),initialOpen:!1},(0,o.__)("Add your client email to a Digital Marketing provider.","otter-blocks"),(0,i.createElement)("br",null)," ",(0,i.createElement)("br",null),"loading"===(null==E?void 0:E.formIntegration)&&(0,i.createElement)("div",{className:"o-fetch-msg"},(0,i.createElement)(c.Spinner,null),(0,o.__)("Fetching data from server. Please wait.","otter-blocks")),(0,i.createElement)("b",null,(0,o.__)("You need to have at least one email field in your form. For multiple email fields, only the first will be used.","otter-blocks")),(0,i.createElement)(c.SelectControl,{label:(0,o.__)("Provider","otter-blocks"),value:x.provider,options:[{label:(0,o.__)("None","otter-blocks"),value:""},{label:(0,o.__)("Mailchimp","otter-blocks"),value:"mailchimp"},{label:(0,o.__)("Sendinblue","otter-blocks"),value:"sendinblue"}],onChange:e=>{S({provider:e,listId:"",apiKey:""})}}),x.provider&&(0,i.createElement)(i.Fragment,null,!x.apiKey&&(0,i.createElement)(i.Fragment,null,"mailchimp"===(null==x?void 0:x.provider)&&(0,i.createElement)(c.ExternalLink,{href:"https://us5.admin.mailchimp.com/account/api/",style:{marginBottom:"10px",display:"block"},target:"_blank"},(0,o.__)("Guide to generate the API Key.","otter-blocks")),"sendinblue"===(null==x?void 0:x.provider)&&(0,i.createElement)(c.ExternalLink,{href:"https://help.sendinblue.com/hc/en-us/articles/209467485-What-s-an-API-key-and-how-can-I-get-mine-",style:{marginBottom:"10px",display:"block"},target:"_blank"},(0,o.__)("Guide to generate the API Key.","otter-blocks"))),(0,i.createElement)(c.TextControl,{label:(0,o.__)("API Key","otter-blocks"),help:(0,o.__)("You can find the key in the provider's website","otter-blocks"),value:x.apiKey?`*************************${x.apiKey.slice(-8)}`:"",onChange:e=>{k([]),S({listId:"",apiKey:e})}}),x.apiKey&&2>y.length&&"loading"===(null==E?void 0:E.listId)&&(0,i.createElement)(i.Fragment,null,(0,i.createElement)(c.Spinner,null),(0,o.__)("Loading the options.","otter-blocks"),(0,i.createElement)("br",null),(0,i.createElement)("br",null)),x.apiKey&&"error"===(null==E?void 0:E.listId)&&(0,i.createElement)(i.Fragment,null,(0,o.__)("Invalid API Key. Please check your API Key in the provider's Dashboard.","otter-blocks"),(0,i.createElement)(c.ExternalLink,{target:"_blank",style:{marginBottom:"10px",display:"block"},href:"sendinblue"===x.provider?"https://account.sendinblue.com/advanced/api":"https://us5.admin.mailchimp.com/account/api/"},(0,o.__)("Go to Dashboard.","otter-blocks"))),x.apiKey&&"timeout"===(null==E?void 0:E.listId)&&(0,i.createElement)("p",null,(0,o.__)("Could no connect to the server. Please try again.","otter-blocks")),x.apiKey&&"done"===(null==E?void 0:E.listId)&&(0,i.createElement)(i.Fragment,null,(0,i.createElement)(c.SelectControl,{label:(0,o.__)("Contact List","otter-blocks"),value:x.listId,options:y,onChange:e=>S({listId:e})}),1>=(null==y?void 0:y.length)&&(0,i.createElement)("p",null,(0,o.__)("No Contact list found. Please create a list in your provider interface or check if the API key is correct.","otter-blocks")),2<=(null==y?void 0:y.length)&&x.listId&&(0,i.createElement)(i.Fragment,null,(0,i.createElement)(c.SelectControl,{label:(0,o.__)("Action","otter-blocks"),value:x.action,options:[{label:(0,o.__)("Default","otter-blocks"),value:""},{label:(0,o.__)("Subscribe","otter-blocks"),value:"subscribe"},{label:(0,o.__)("Submit & Subscribe","otter-blocks"),value:"submit-subscribe"}],onChange:e=>S({action:e})}),"submit-subscribe"===x.action&&(0,i.createElement)("div",{style:{marginBottom:"10px"}},(0,o.__)("This action will add the client to the contact list and send a separate email with the form data to administrator or to the email mentioned in 'Form to' field. A checkbox for data-sharing consent with third-party will be added on form.","otter-blocks"))))),(0,i.createElement)("div",{style:{display:"flex",flexDirection:"row",gap:"10px"}},(0,i.createElement)(c.Button,{isPrimary:!0,variant:"primary",onClick:_,isBusy:"saving"===(null==E?void 0:E.formIntegration)},"saving"===(null==E?void 0:E.formIntegration)?(0,o.__)("Saving","otter-blocks"):(0,o.__)("Save","otter-blocks")),h.optionName&&(null==w||null===(m=w.integration)||void 0===m?void 0:m.provider)&&(null==w||null===(p=w.integration)||void 0===p?void 0:p.apiKey)&&(null==w||null===(g=w.integration)||void 0===g?void 0:g.listId)&&(0,i.createElement)(c.Button,{isSecondary:!0,variant:"secondary",onClick:T,isBusy:"saving"===(null==E?void 0:E.serviceTesting)},(0,i.createElement)(i.Fragment,null,(0,o.__)("Test Service","otter-blocks")))),"done"===(null==E?void 0:E.formIntegration)&&z&&(0,i.createElement)("div",{className:"o-fetch-msg"},(0,o.__)("You have made some modifications. Do not forget to save the options.","otter-blocks")),"done"===(null==E?void 0:E.serviceTesting)&&(0,i.createElement)("div",{className:"o-fetch-msg"},(0,o.__)("Remember to delete the test email from your provider's contact list.","otter-blocks")),"done"===(null==E?void 0:E.formIntegration)&&(null==x?void 0:x.apiKey)&&(null==x?void 0:x.listId)&&!M&&(0,i.createElement)("div",{className:"o-fetch-msg o-error"},(0,o.__)("Please add a Text Field with Email as type in your form for email registration.","otter-blocks")),"error"===(null==E?void 0:E.formIntegration)&&(0,i.createElement)("div",{className:"o-fetch-msg o-error"},(0,o.__)("An error has occurred while saving. Please try again.","otter-blocks"))))},Zt=e=>{let{className:t,loadingState:l,isSaving:a,saveAPIKey:n,siteKey:r,secretKey:s,setSiteKey:d,setSecretKey:u}=e;if("loading"===(null==l?void 0:l.captcha))return(0,i.createElement)(i.Fragment,null,(0,i.createElement)("br",null),(0,i.createElement)(c.Placeholder,null,(0,i.createElement)("div",null,(0,i.createElement)(c.Spinner,null),(0,o.__)("Checking the API Keys for reCaptcha","otter-blocks"))));const b=s&&0<(null==s?void 0:s.length)-13?Array(s.length-13).fill("*").join("")+s.slice(-13):s;return(0,i.createElement)(c.Placeholder,{icon:"admin-site",label:(0,o.__)("Google reCaptcha","otter-blocks"),instructions:(0,o.__)("A Google reCaptcha V2 API keys are required, please enter one below.","otter-blocks"),className:t},(0,i.createElement)("div",{className:"components-placeholder__actions",style:{width:"100%"}},(0,i.createElement)(c.TextControl,{type:"text",label:(0,o.__)("Site Key","otter-blocks"),value:r,className:"components-placeholder__input",onChange:d}),(0,i.createElement)(c.TextControl,{type:"text",label:(0,o.__)("Secret Key","otter-blocks"),value:b,className:"components-placeholder__input",onChange:u}),(0,i.createElement)(c.Button,{isPrimary:!0,type:"submit",onClick:n,isBusy:a,disabled:""===r||""===s},(0,o.__)("Save","otter-blocks"))),(0,i.createElement)("div",{className:"components-placeholder__learn-more",style:{margin:"10px 0px"}},(0,o.__)("You need to activate reCaptcha API.","otter-blocks")," ",(0,i.createElement)(c.ExternalLink,{href:"http://www.google.com/recaptcha/admin"},(0,o.__)("Need an API key? Get one here.","otter-blocks"))))};const{attributes:jt}=Ft,Ut=(0,i.createContext)({});var qt=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"themeisle-blocks/form-input","title":"Text Field","category":"themeisle-blocks","description":"Display a contact form for your clients.","keywords":["input","text","email"],"ancestor":["themeisle-blocks/form"],"textdomain":"otter-blocks","attributes":{"id":{"type":"string"},"type":{"type":"string","default":"text"},"label":{"type":"string"},"placeholder":{"type":"string"},"isRequired":{"type":"boolean"},"mappedName":{"type":"string"},"labelColor":{"type":"string"},"inputWidth":{"type":"number"},"helpText":{"type":"string"}},"supports":{"align":["wide","full"]}}'),Jt=e=>{let{attributes:t,setAttributes:l}=e;return(0,i.createElement)(s.InspectorControls,null,(0,i.createElement)(c.PanelBody,{title:(0,o.__)("Settings","otter-blocks")},(0,i.createElement)(c.SelectControl,{label:(0,o.__)("Field Type","otter-blocks"),value:t.type,options:[{label:(0,o.__)("Text","otter-blocks"),value:"text"},{label:(0,o.__)("Email","otter-blocks"),value:"email"},{label:(0,o.__)("Date","otter-blocks"),value:"date"},{label:(0,o.__)("Number","otter-blocks"),value:"number"}],onChange:e=>l({type:e})}),(0,i.createElement)(c.TextControl,{label:(0,o.__)("Label","otter-blocks"),value:t.label,onChange:e=>l({label:e})}),(0,i.createElement)(c.TextControl,{label:(0,o.__)("Placeholder","otter-blocks"),value:t.placeholder,onChange:e=>l({placeholder:e})}),(0,i.createElement)(c.TextControl,{label:(0,o.__)("Help Text","otter-blocks"),value:t.helpText,onChange:e=>l({helpText:e})}),(0,i.createElement)(c.ToggleControl,{label:(0,o.__)("Required","otter-blocks"),help:(0,o.__)("If enabled, the input field must be filled out before submitting the form.","otter-blocks"),checked:t.isRequired,onChange:e=>l({isRequired:e})})),(0,i.createElement)(s.PanelColorSettings,{title:(0,o.__)("Color","otter-blocks"),initialOpen:!1,colorSettings:[{value:t.labelColor,onChange:e=>l({labelColor:e}),label:(0,o.__)("Label Color","otter-blocks")}]}))};const{attributes:Kt}=qt;const Yt=[{attributes:{id:{type:"string"},type:{type:"string",default:"text"},label:{type:"string"},placeholder:{type:"string"},isRequired:{type:"boolean"},mappedName:{type:"string"}},supports:{align:["wide","full"]},save:e=>{let{attributes:t}=e;const l=s.useBlockProps.save();return(0,i.createElement)("div",l,(0,i.createElement)("label",{htmlFor:t.id,className:"otter-form-input-label"},(0,i.createElement)(s.RichText.Content,{value:t.label,className:"otter-form-input-label__label",tagName:"span"}),t.isRequired&&(0,i.createElement)("span",{className:"required"},(0,o.__)("(required)","otter-blocks"))),(0,i.createElement)("input",{type:t.type,name:t.mappedName,id:t.id,required:t.isRequired,placeholder:t.placeholder,className:"otter-form-input"}))}}];var Qt=Yt;const{name:Xt}=qt;window.themeisleGutenberg.isAncestorTypeAvailable||(qt.parent=["themeisle-blocks/form"]),(0,a.registerBlockType)(Xt,{...qt,title:(0,o.__)("Text Field","otter-blocks"),description:(0,o.__)("Display a contact form for your clients.","otter-blocks"),icon:r.inputIcon,deprecated:Qt,keywords:["input","text","email"],variations:[{name:"themeisle-blocks/form-input-email",description:(0,o.__)("Insert an email field","otter-blocks"),icon:"email",title:(0,o.__)("Email Field","otter-blocks"),attributes:{type:"email"}},{name:"themeisle-blocks/form-input-number",description:(0,o.__)("Insert a number field","otter-blocks"),icon:"calculator",title:(0,o.__)("Number Field","otter-blocks"),attributes:{type:"number"}},{name:"themeisle-blocks/form-input-date",description:(0,o.__)("Insert a date field","otter-blocks"),icon:"calendar-alt",title:(0,o.__)("Date Field","otter-blocks"),attributes:{type:"date"}}],edit:e=>{let{attributes:t,setAttributes:l,clientId:a}=e;(0,i.useEffect)((()=>{const e=(0,L.blockInit)(a,Kt);return()=>e(t.id)}),[t.id]);const n=(0,s.useBlockProps)(),r=(0,i.useRef)(null),c=(0,i.useRef)(null),d=(0,i.useRef)(null);return(0,i.useEffect)((()=>{var e,l,o,a,n,i,s;c.current&&(null===(e=c.current)||void 0===e||null===(l=e.style)||void 0===l||l.setProperty("--input-width",(o=t.inputWidth)?o+"%":null)),r.current&&(null===(a=r.current)||void 0===a||null===(n=a.style)||void 0===n||n.setProperty("--label-color",t.labelColor||null)),d.current&&(null===(i=d.current)||void 0===i||null===(s=i.style)||void 0===s||s.setProperty("--label-color",t.labelColor||null))}),[c.current,r.current,d.current,t.labelColor,t.inputWidth]),(0,i.createElement)(i.Fragment,null,(0,i.createElement)(Jt,{attributes:t,setAttributes:l}),(0,i.createElement)("div",n,(0,i.createElement)("label",{ref:r,htmlFor:t.id,className:"otter-form-input-label"},(0,i.createElement)(s.RichText,{placeholder:(0,o.__)("Type here…","otter-blocks"),className:"otter-form-input-label__label",value:t.label,onChange:e=>l({label:e}),tagName:"span"}),t.isRequired&&(0,i.createElement)("span",{className:"required"},"*")),(0,i.createElement)("input",{ref:c,type:t.type,placeholder:t.placeholder,name:t.id,id:t.id,required:t.isRequired,disabled:!0,className:"otter-form-input components-text-control__input"}),t.helpText&&(0,i.createElement)("span",{className:"o-form-help",ref:d},t.helpText)))},save:e=>{let{attributes:t}=e;const l=s.useBlockProps.save({id:t.id});return(0,i.createElement)("div",l,(0,i.createElement)("label",{htmlFor:t.id?t.id+"-input":"",className:"otter-form-input-label"},(0,i.createElement)(s.RichText.Content,{value:t.label,className:"otter-form-input-label__label",tagName:"span"}),t.isRequired&&(0,i.createElement)("span",{className:"required"},"*")),(0,i.createElement)("input",{type:t.type,name:t.mappedName,id:t.id?t.id+"-input":"",required:t.isRequired,placeholder:t.placeholder,className:"otter-form-input"}),t.helpText&&(0,i.createElement)("span",{className:"o-form-help"},t.helpText))}});var el=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"themeisle-blocks/form-nonce","title":"Nonce Field","category":"themeisle-blocks","description":"Protect the form from CSRF.","keywords":["protection","csrf","field"],"textdomain":"otter-blocks","attributes":{"formId":{"type":"string"}},"supports":{"align":["wide","full"],"inserter":false}}');const{name:tl}=el;(0,a.registerBlockType)(tl,{...el,title:(0,o.__)("Nonce Field","otter-blocks"),description:(0,o.__)("Protect the form from CSRF.","otter-blocks"),icon:r.inputIcon,keywords:["protection","csrf","field"],edit:e=>{let{setAttributes:t,clientId:l}=e;const{parent:o}=(0,v.useSelect)((e=>{const{getBlock:t,getBlockRootClientId:o}=e("core/block-editor");return{parent:t(o(l))}}),[]);return(0,i.useEffect)((()=>{o&&t({formId:o.attributes.id})}),[o]),null},save:()=>null});var ll=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"themeisle-blocks/form-textarea","title":"Textarea Field","category":"themeisle-blocks","description":"Display a contact form for your clients.","keywords":["textarea","message","input"],"ancestor":["themeisle-blocks/form"],"textdomain":"otter-blocks","attributes":{"id":{"type":"string"},"label":{"type":"string"},"placeholder":{"type":"string"},"isRequired":{"type":"boolean"},"mappedName":{"type":"string"},"labelColor":{"type":"string"},"inputWidth":{"type":"number"},"helpText":{"type":"string"}},"supports":{"align":["wide","full"]}}'),ol=e=>{let{attributes:t,setAttributes:l}=e;return(0,i.createElement)(s.InspectorControls,null,(0,i.createElement)(c.PanelBody,{title:(0,o.__)("Settings","otter-blocks")},(0,i.createElement)(c.TextControl,{label:(0,o.__)("Label","otter-blocks"),value:t.label,onChange:e=>l({label:e})}),(0,i.createElement)(c.TextControl,{label:(0,o.__)("Placeholder","otter-blocks"),value:t.placeholder,onChange:e=>l({placeholder:e})}),(0,i.createElement)(c.TextControl,{label:(0,o.__)("Help Text","otter-blocks"),value:t.helpText,onChange:e=>l({helpText:e})}),(0,i.createElement)(c.ToggleControl,{label:(0,o.__)("Required","otter-blocks"),help:(0,o.__)("If enabled, the input field must be filled out before submitting the form.","otter-blocks"),checked:t.isRequired,onChange:e=>l({isRequired:e})})))};const{attributes:al}=ll;const nl=[{attributes:{id:{type:"string"},type:{type:"string",default:"text"},label:{type:"string"},placeholder:{type:"string"},isRequired:{type:"boolean"},mappedName:{type:"string"}},supports:{align:["wide","full"]},save:e=>{let{attributes:t}=e;const l=s.useBlockProps.save();return(0,i.createElement)("div",l,(0,i.createElement)("label",{htmlFor:t.id,className:"otter-form-textarea-label"},(0,i.createElement)(s.RichText.Content,{value:t.label,className:"otter-form-textarea-label__label",tagName:"span"}),t.isRequired&&(0,i.createElement)("span",{className:"required"},(0,o.__)("(required)","otter-blocks"))),(0,i.createElement)("textarea",{name:t.mappedName,id:t.id,required:t.isRequired,placeholder:t.placeholder,rows:10,className:"otter-form-textarea-input"}))}}];var rl=nl;const{name:il}=ll;window.themeisleGutenberg.isAncestorTypeAvailable||(ll.parent=["themeisle-blocks/form"]),(0,a.registerBlockType)(il,{...ll,title:(0,o.__)("Textarea Field","otter-blocks"),description:(0,o.__)("Display a contact form for your clients.","otter-blocks"),icon:r.inputIcon,deprecated:rl,keywords:["textarea","message","input"],edit:e=>{let{attributes:t,setAttributes:l,clientId:a}=e;(0,i.useEffect)((()=>{const e=(0,L.blockInit)(a,al);return()=>e(t.id)}),[t.id]);const n=(0,s.useBlockProps)(),r=(0,i.useRef)(null),c=(0,i.useRef)(null),d=(0,i.useRef)(null);return(0,i.useEffect)((()=>{var e,l,o,a,n,i,s;c.current&&(null===(e=c.current)||void 0===e||null===(l=e.style)||void 0===l||l.setProperty("--input-width",(o=t.inputWidth)?o+"%":o)),r.current&&(null===(a=r.current)||void 0===a||null===(n=a.style)||void 0===n||n.setProperty("--label-color",t.labelColor||null)),d.current&&(null===(i=d.current)||void 0===i||null===(s=i.style)||void 0===s||s.setProperty("--label-color",t.labelColor||null))}),[c.current,r.current,t]),(0,i.createElement)(i.Fragment,null,(0,i.createElement)(ol,{attributes:t,setAttributes:l}),(0,i.createElement)("div",n,(0,i.createElement)("label",{ref:r,htmlFor:t.id?t.id+"-input":"",className:"otter-form-textarea-label"},(0,i.createElement)(s.RichText,{placeholder:(0,o.__)("Type here…","otter-blocks"),className:"otter-form-textarea-label__label",value:t.label,onChange:e=>l({label:e}),tagName:"span"}),t.isRequired&&(0,i.createElement)("span",{className:"required"},"*")),(0,i.createElement)("textarea",{ref:c,placeholder:t.placeholder,name:t.id,id:t.id?t.id+"-input":"",required:t.isRequired,disabled:!0,rows:10,className:"otter-form-textarea-input components-textarea-control__input"}),t.helpText&&(0,i.createElement)("span",{className:"o-form-help",ref:d},t.helpText)))},save:e=>{let{attributes:t}=e;const l=s.useBlockProps.save({id:t.id});return(0,i.createElement)("div",l,(0,i.createElement)("label",{htmlFor:t.id?t.id+"-input":"",className:"otter-form-textarea-label"},(0,i.createElement)(s.RichText.Content,{value:t.label,className:"otter-form-textarea-label__label",tagName:"span"}),t.isRequired&&(0,i.createElement)("span",{className:"required"},"*")),(0,i.createElement)("textarea",{name:t.mappedName,id:t.id?t.id+"-input":"",required:t.isRequired,placeholder:t.placeholder,rows:10,className:"otter-form-textarea-input"}),t.helpText&&(0,i.createElement)("span",{className:"o-form-help"},t.helpText))}});const{name:sl}=Ft;(0,a.registerBlockType)(sl,{...Ft,title:(0,o.__)("Form","otter-blocks"),description:(0,o.__)("Display a form for your clients. Powered by Otter.","otter-blocks"),icon:r.contactIcon,keywords:["business","form","email"],edit:e=>{let{attributes:t,setAttributes:l,clientId:n,isSelected:r,name:c}=e;const[d,u]=(0,i.useState)(""),[b,m]=(0,i.useState)(""),[p,h]=(0,i.useState)({formOptions:"done",formIntegration:"done",listId:"init",captcha:"init",serviceTesting:"init"}),y=e=>{h((t=>({...t,...e})))},[k,f]=(0,i.useState)({provider:void 0,redirectLink:void 0,fromName:void 0,emailTo:void 0,subject:void 0,email:void 0,listId:void 0,action:void 0,hasCaptcha:void 0,submitMessage:void 0,apiKey:void 0,cc:void 0,bcc:void 0}),[_,w]=(0,i.useState)(!0),[C,E]=(0,i.useState)([{label:(0,o.__)("None","otter-blocks"),value:""}]),{insertBlock:x,removeBlock:S}=(0,v.useDispatch)("core/block-editor"),{replaceInnerBlocks:T}=(0,v.useDispatch)("core/block-editor"),{createNotice:M}=(0,v.dispatch)("core/notices"),B=(0,v.useSelect)((e=>0<e("core/block-editor").getBlocks(n).length),[n]),{blockType:z,defaultVariation:P,variations:R}=(0,v.useSelect)((e=>{const{getBlockVariations:t,getBlockType:l,getDefaultBlockVariation:o}=e("core/blocks");return{blockType:l(c),defaultVariation:o(c,"block"),variations:t(c,"block")}}),[c]),{children:F,hasEmailField:A}=(0,v.useSelect)((e=>{const{getBlock:t}=e("core/block-editor"),l=t(n).innerBlocks;return{children:l,hasEmailField:null==l?void 0:l.some((e=>{var t;return"email"===(null==e||null===(t=e.attributes)||void 0===t?void 0:t.type)}))}}));(0,i.useEffect)((()=>{const e=(0,L.blockInit)(n,jt);return()=>e(t.id)}),[t.id]),(0,i.useEffect)((()=>{var e;t.id&&(0,v.select)("core/edit-widgets")?l({optionName:`widget_${t.id.slice(-8)}`}):t.id&&Boolean(window.themeisleGutenberg.isBlockEditor)&&null!==(e=(0,v.select)("core/editor"))&&void 0!==e&&e.getCurrentPostId()&&l({optionName:`${(0,v.select)("core/editor").getCurrentPostId()}_${t.id.slice(-8)}`})}),[t.id]),(0,i.useEffect)((()=>{if(F){const e=F.filter((e=>{let{name:t}=e;return"themeisle-blocks/form-nonce"===t}));if(2<=(null==e?void 0:e.length))e.slice(1).forEach((e=>{S(e.clientId,!1)}));else if(0===(null==e?void 0:e.length)&&n){const e=(0,a.createBlock)("themeisle-blocks/form-nonce");e&&(null==x||x(e,(null==F?void 0:F.length)||0,n,!1))}}}),[F]);const H=e=>null==e?void 0:e.filter((e=>{let{form:l}=e;return l===t.optionName})).pop(),O=e=>{var t,l,o,a;f({emailTo:null==e?void 0:e.email,fromName:null==e?void 0:e.fromName,redirectLink:null==e?void 0:e.redirectLink,subject:null==e?void 0:e.emailSubject,cc:null==e?void 0:e.cc,bcc:null==e?void 0:e.bcc,submitMessage:null==e?void 0:e.submitMessage,provider:null==e||null===(t=e.integration)||void 0===t?void 0:t.provider,apiKey:null==e||null===(l=e.integration)||void 0===l?void 0:l.apiKey,listId:null==e||null===(o=e.integration)||void 0===o?void 0:o.listId,action:null==e||null===(a=e.integration)||void 0===a?void 0:a.action,hasCaptcha:null==e?void 0:e.hasCaptcha})};(0,i.useEffect)((()=>{let e=new AbortController;const l=setTimeout((()=>{y({formOptions:"done",formIntegration:"done"})}),3e3);return t.optionName&&Nt().loadPromise.then((()=>{y({formOptions:"loading",formIntegration:"loading"}),(new(Nt().models.Settings)).fetch({signal:e.signal}).done((t=>{e=null;const o=H(t.themeisle_blocks_form_emails);o&&(O(o),w(o)),y({formIntegration:"done",formOptions:"done"}),clearTimeout(l)})).catch((()=>{y({formIntegration:"done",formOptions:"done"}),clearTimeout(l)}))})),()=>{var t;null===(t=e)||void 0===t||t.abort(),clearTimeout(l)}}),[t.optionName]),(0,i.useEffect)((()=>{let e,t=new AbortController;return k.apiKey&&k.provider&&(e=setTimeout((()=>y({listId:"timeout"})),6e3),y({listId:"loading"}),It()({path:"otter/v1/form/editor",method:"POST",data:{handler:"listId",payload:{provider:k.provider,apiKey:k.apiKey,action:k.action}},signal:t.signal}).then((l=>{if(t=null,clearTimeout(e),null!=l&&l.success){var a;const e=(null==l||null===(a=l.list_id)||void 0===a?void 0:a.map((e=>{var t;return{label:e.name,value:null===(t=e.id)||void 0===t?void 0:t.toString()}})))||[];e.splice(0,0,{label:(0,o.__)("None","otter-blocks"),value:""}),E(e),y({listId:"done"});const t=1===e.map((e=>{let{value:t}=e;return t})).filter((e=>e===k.listId)).length;k.listId&&!t&&M("error",(0,o.__)("The current contact list is invalid. Please choose a new contact list.","otter-blocks"),{isDismissible:!0,type:"snackbar"})}else M("error",null==l?void 0:l.error,{isDismissible:!0,type:"snackbar",id:"themeisle-form-server-error"}),y({listId:"error"})})).catch((e=>{console.error(e),y({listId:"error"})}))),()=>{var l;null===(l=t)||void 0===l||l.abort(),clearTimeout(e)}}),[k.apiKey,k.provider]),(0,i.useEffect)((()=>{let e=new AbortController;if(void 0!==t.hasCaptcha&&t.optionName)try{var l,a;null===(l=new(Nt().models.Settings))||void 0===l||null===(a=l.current)||void 0===a||a.fetch({signal:e.signal}).done((l=>{e=null;const a=l.themeisle_blocks_form_emails?l.themeisle_blocks_form_emails:[];let n=!0,r=!1;null==a||a.forEach(((e,l)=>{let{form:o}=e;o===t.optionName&&(a[l].hasCaptcha!==t.hasCaptcha&&(r=!0),a[l].hasCaptcha=t.hasCaptcha,n=!1)})),n&&a.push({form:t.optionName,hasCaptcha:t.hasCaptcha}),(n||r)&&(new(Nt().models.Settings)({themeisle_blocks_form_emails:a}).save(),M("info",(0,o.__)("Form preferences have been saved.","otter-blocks"),{isDismissible:!0,type:"snackbar"}))}))}catch(e){console.warn(e.message)}return()=>{var t;return null===(t=e)||void 0===t?void 0:t.abort()}}),[t.hasCaptcha,t.optionName]),(0,i.useEffect)((()=>{let e=new AbortController;return t.hasCaptcha&&"init"===(null==p?void 0:p.captcha)&&(()=>{y({captcha:"loading"});try{var t;null===(t=new(Nt().models.Settings))||void 0===t||t.fetch({signal:e.signal}).then((t=>{e=null,""!==t.themeisle_google_captcha_api_site_key&&""!==t.themeisle_google_captcha_api_secret_key?y({captcha:"done"}):(y({captcha:"missing"}),u(t.themeisle_google_captcha_api_site_key),m(t.themeisle_google_captcha_api_secret_key))})).catch((e=>{console.error(e),y({captcha:"error"})}))}catch(e){console.warn(e.message),y({captcha:"error"})}})(),()=>{var t;return null===(t=e)||void 0===t?void 0:t.abort()}}),[p.captcha,t.hasCaptcha]);const N={"--message-font-size":void 0!==t.messageFontSize&&t.messageFontSize,"--input-font-size":void 0!==t.inputFontSize&&t.inputFontSize,"--help-font-size":void 0!==t.helpFontSize&&t.helpFontSize,"--input-color":t.inputColor,"--padding":(V=t.inputPadding,V?V.top+" "+V.right+" "+V.bottom+" "+V.left:null),"--border-radius":void 0!==t.inputBorderRadius&&t.inputBorderRadius+"px","--border-width":void 0!==t.inputBorderWidth&&t.inputBorderWidth+"px","--border-color":t.inputBorderColor,"--label-color":t.labelColor,"--input-width":void 0!==t.inputWidth&&t.inputWidth+"%","--submit-color":t.submitColor,"--required-color":t.inputRequiredColor,"--input-gap":void 0!==t.inputGap&&t.inputGap+"px","--inputs-gap":void 0!==t.inputsGap&&t.inputsGap+"px","--label-font-size":void 0!==t.labelFontSize&&t.labelFontSize,"--submit-font-size":void 0!==t.submitFontSize&&t.submitFontSize,"--help-label-color":t.helpLabelColor,"--input-bg-color":t.inputBackgroundColor};var V;const[I,D]=(0,L.useCSSNode)();(0,i.useEffect)((()=>{D([`.otter-form__container .wp-block-button__link {\n\t\t\t\tbackground-color: ${t.submitBackgroundColor}\n\t\t\t}`,`.otter-form__container .wp-block-button__link:hover {\n\t\t\t\t${t.submitBackgroundColorHover&&`background-color: ${t.submitBackgroundColorHover}`}\n\t\t\t}`])}),[t.submitBackgroundColor,t.submitBackgroundColorHover]);const G=(0,s.useBlockProps)({id:t.id,style:N,className:I});return(0,i.createElement)(i.Fragment,null,(0,i.createElement)(Ut.Provider,{value:{savedFormOptions:_,listIDOptions:C,setListIDOptions:E,saveFormEmailOptions:()=>{y({formOptions:"saving"}),(new(Nt().models.Settings)).fetch().done((e=>{const l=e.themeisle_blocks_form_emails?e.themeisle_blocks_form_emails:[];let a=!0,n=!1;null==l||l.forEach(((e,o)=>{let{form:r}=e;r===t.optionName&&(n=l[o].email!==k.emailTo||l[o].redirectLink!==k.redirectLink||l[o].emailSubject!==k.subject||l[o].submitMessage!==k.submitMessage||l[o].fromName!==k.fromName||l[o].cc!==k.cc||l[o].bcc!==k.bcc,l[o].email=k.emailTo,l[o].redirectLink=k.redirectLink,l[o].emailSubject=k.subject,l[o].submitMessage=k.submitMessage,l[o].fromName=k.fromName,l[o].cc=k.cc,l[o].bcc=k.bcc,a=!1)})),a&&l.push({form:t.optionName,email:k.emailTo,fromName:k.fromName,redirectLink:k.redirectLink,emailSubject:k.subject,submitMessage:k.submitMessage,cc:k.cc,bcc:k.bcc}),a||n?new(Nt().models.Settings)({themeisle_blocks_form_emails:l}).save().then((e=>{const t=H(e.themeisle_blocks_form_emails);t?(O(t),w(t),y({formOptions:"done"}),M("info",(0,o.__)("Form options have been saved.","otter-blocks"),{isDismissible:!0,type:"snackbar"})):y({formOptions:"error"})})):y({formOptions:"done"})})).catch((()=>y({formOptions:"error"})))},formOptions:k,setFormOption:e=>{f((t=>({...t,...e})))},saveIntegration:()=>{var e;y({formIntegration:"saving"}),null===(e=new(Nt().models.Settings))||void 0===e||e.fetch().done((e=>{const a=e.themeisle_blocks_form_emails?e.themeisle_blocks_form_emails:[];let n=!0,r=!1;null==a||a.forEach(((e,l)=>{let{form:o}=e;var i,s,c,d,u;o===t.optionName&&(null!==(i=a[l])&&void 0!==i&&i.integration||(a[l].integration={}),r=(null===(s=a[l].integration)||void 0===s?void 0:s.provider)!==k.provider||(null===(c=a[l].integration)||void 0===c?void 0:c.listId)!==k.listId||(null===(d=a[l].integration)||void 0===d?void 0:d.action)!==k.action||(null===(u=a[l].integration)||void 0===u?void 0:u.apiKey)!==k.apiKey,n=!1,a[l].integration.provider=k.provider,a[l].integration.apiKey=k.apiKey,a[l].integration.listId=k.listId,a[l].integration.action=k.action)})),n&&a.push({form:t.optionName,integration:{provider:k.provider,apiKey:k.apiKey,listId:k.listId,action:k.action}}),n||r?new(Nt().models.Settings)({themeisle_blocks_form_emails:a}).save().then((e=>{const t=H(e.themeisle_blocks_form_emails);var a;t&&(O(t),w(t),l({action:null==t||null===(a=t.integration)||void 0===a?void 0:a.action})),y({formIntegration:"done"}),r&&M("info",(0,o.__)("Integration details have been saved.","otter-blocks"),{isDismissible:!0,type:"snackbar"})})).catch((e=>{console.error(e),y({formIntegration:"error"})})):y({formIntegration:"done"})})).catch((()=>{y({formIntegration:"error"})}))},sendTestEmail:()=>{It()({path:"otter/v1/form/editor",method:"POST",data:{handler:"testEmail",payload:{provider:"default",to:null==k?void 0:k.emailTo,site:window.location.href}}}).then((e=>{null!=e&&e.success?M("info",(0,o.__)("The test email has been send. Check your emails for confirmation.","otter-blocks"),{isDismissible:!0,type:"snackbar"}):M("error",(0,o.__)("An error has occurred: ","otter-blocks")+((null==e?void 0:e.error)||(0,o.__)("unknown","otter-blocks")),{isDismissible:!0,type:"snackbar"})})).catch((e=>{console.error(e),M("error",null==e?void 0:e.message,{isDismissible:!0,type:"snackbar"})}))},loadingState:p,testService:()=>{y({serviceTesting:"loading"}),It()({path:"otter/v1/form/editor",method:"POST",data:{handler:"testEmail",payload:{formOption:t.optionName}}}).then((e=>{null!=e&&e.success?(M("info",(0,o.__)("A test email has been registered to your contact list. Check your provider for confirmation.","otter-blocks"),{isDismissible:!0,type:"snackbar"}),y({serviceTesting:"done"})):(M("error",(0,o.__)("An error has occurred: ","otter-blocks")+((null==e?void 0:e.error)||(0,o.__)("unknown","otter-blocks")+(0,o.__)(". Check your provider for confirmation.","otter-blocks")),{isDismissible:!0,type:"snackbar"}),y({serviceTesting:"error"}))})).catch((e=>{console.error(e),M("error",null==e?void 0:e.message,{isDismissible:!0,type:"snackbar"}),y({testService:"error"})}))},hasEmailField:A}},(0,i.createElement)(Wt,{attributes:t,setAttributes:l}),(0,i.createElement)("div",G,B?(0,i.createElement)("form",{className:"otter-form__container",onSubmit:()=>!1},(0,i.createElement)(s.InnerBlocks,null),t.hasCaptcha&&"done"!==(null==p?void 0:p.captcha)&&(0,i.createElement)(Zt,{className:"otter-form-captcha",loadingState:p,saveAPIKey:()=>{y({captcha:"loading"});try{var e,t,l;const a=new(Nt().models.Settings)({themeisle_google_captcha_api_site_key:d,themeisle_google_captcha_api_secret_key:b});null==a||null===(e=a.save)||void 0===e||null===(t=e.call(a))||void 0===t||null===(l=t.then((e=>{""!==e.themeisle_google_captcha_api_site_key&&""!==e.themeisle_google_captcha_api_secret_key?y({captcha:"done"}):y({captcha:"missing"}),m(""),u(""),M("info",(0,o.__)("Google reCaptcha API Keys have been saved.","otter-blocks"),{isDismissible:!0,type:"snackbar"}).catch((e=>{console.error(e),y({captcha:"error"})}))})))||void 0===l||l.catch((e=>{console.error(e),y({captcha:"error"})}))}catch(e){console.warn(e.message),y({captcha:"error"})}},siteKey:d,secretKey:b,setSiteKey:u,setSecretKey:m}),"submit-subscribe"===t.action&&(0,i.createElement)("div",{className:"otter-form-consent"},(0,i.createElement)("input",{id:"o-consent",name:"o-consent",type:"checkbox"}),(0,i.createElement)("label",{htmlFor:"o-consent"},(0,o.__)("I have read and agreed the privacy statement.","otter-blocks"))),(0,i.createElement)("div",{className:g()("wp-block-button has-submit-msg",{right:"right"===t.submitStyle},{full:"full"===t.submitStyle})},(0,i.createElement)("button",{className:"wp-block-button__link",type:"submit",disabled:!0},t.submitLabel?t.submitLabel:(0,o.__)("Submit","otter-blocks")),r&&(0,i.createElement)("div",null,(0,i.createElement)("div",{className:"o-form-server-response o-success",style:{color:t.submitMessageColor}},k.submitMessage||(0,o.__)("Success","otter-blocks")),(0,i.createElement)("div",{className:"o-form-server-response o-error",style:{color:t.submitMessageErrorColor,margin:"0px"}},(0,o.__)("Error. Please try again.","otter-blocks"))))):(0,i.createElement)(s.__experimentalBlockVariationPicker,{icon:(0,K.get)(z,["icon","src"]),label:(0,K.get)(z,["title"]),variations:R,onSelect:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:P;e&&T(n,(0,a.createBlocksFromInnerBlocksTemplate)(e.innerBlocks),!0)},allowSkip:!0}))))},save:e=>{let{attributes:t}=e;const l=s.useBlockProps.save({id:t.id,className:g()({"can-submit-and-subscribe":"submit-subscribe"===t.action,"has-captcha":t.hasCaptcha}),"data-option-name":t.optionName});return(0,i.createElement)("div",l,(0,i.createElement)("form",{className:"otter-form__container"},(0,i.createElement)(s.InnerBlocks.Content,null),(0,i.createElement)("div",{className:g()("wp-block-button",{right:"right"===t.submitStyle},{full:"full"===t.submitStyle})},(0,i.createElement)("button",{className:"wp-block-button__link",type:"submit"},t.submitLabel?t.submitLabel:(0,o.__)("Submit","otter-blocks")))))},deprecated:Ht,example:{attributes:{},innerBlocks:[{name:"themeisle-blocks/form-input",attributes:{label:(0,o.__)("Name","otter-blocks"),type:"text",isRequired:!0}},{name:"themeisle-blocks/form-input",attributes:{label:(0,o.__)("Email","otter-blocks"),type:"email",isRequired:!0}},{name:"themeisle-blocks/form-textarea",attributes:{label:(0,o.__)("Message","otter-blocks")}},{name:"core/paragraph",attributes:{content:(0,o.__)("You agree to receive email communication from us by submitting this form and understand that your contact information will be stored with us.","otter-blocks"),fontSize:"extra-small"}}]},variations:[{name:"themeisle-blocks/form-contact",description:(0,o.__)("Contact form for clients","otter-blocks"),icon:r.contactIcon,title:(0,o.__)("Contact Form","otter-blocks"),innerBlocks:[["themeisle-blocks/form-input",{label:(0,o.__)("Name","otter-blocks"),type:"text",isRequired:!0}],["themeisle-blocks/form-input",{label:(0,o.__)("Email","otter-blocks"),type:"email",isRequired:!0}],["themeisle-blocks/form-textarea",{label:(0,o.__)("Message","otter-blocks")}],["core/paragraph",{content:(0,o.__)("You agree to receive email communication from us by submitting this form and understand that your contact information will be stored with us.","otter-blocks"),fontSize:"extra-small"}]]},{name:"themeisle-blocks/form-subscribe",description:(0,o.__)("Add the clients to your subscription list","otter-blocks"),icon:r.contactIcon,title:(0,o.__)("Subscribe Form","otter-blocks"),innerBlocks:[["themeisle-blocks/form-input",{label:(0,o.__)("Name","otter-blocks"),type:"text",isRequired:!0}],["themeisle-blocks/form-input",{label:(0,o.__)("Email","otter-blocks"),type:"email",isRequired:!0}],["core/paragraph",{content:(0,o.__)("You agree to receive email communication from us by submitting this form and understand that your contact information will be stored with us.","otter-blocks"),fontSize:"extra-small"}]]}]});var cl=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"themeisle-blocks/google-map","title":"Google Maps","category":"themeisle-blocks","description":"Display Google Maps on your website with Google Map block. Powered by Otter.","keywords":["map","google","orbitfox"],"textdomain":"otter-blocks","attributes":{"id":{"type":"string"},"style":{"type":"string","default":"standard"},"location":{"type":"string","default":"La Sagrada Familia, Barcelona, Spain"},"latitude":{"type":"string"},"longitude":{"type":"string"},"type":{"type":"string","default":"roadmap"},"zoom":{"type":"number","default":15},"height":{"type":["number","string"],"default":"400px"},"heightTablet":{"type":"string"},"heightMobile":{"type":"string"},"draggable":{"type":"boolean","default":true},"mapTypeControl":{"type":"boolean","default":true},"zoomControl":{"type":"boolean","default":true},"fullscreenControl":{"type":"boolean","default":true},"streetViewControl":{"type":"boolean","default":true},"markers":{"type":"array","default":[]}},"supports":{"align":["wide","full"],"html":false},"editorStyle":"otter-google-map-editor","style":"otter-google-map-style","script":"google-maps"}'),dl=l(4586),ul=e=>{let{api:t,error:l,isAPILoaded:a,isAPISaved:n,isSaving:r,changeAPI:s,saveAPIKey:d}=e;return a?n?void 0:(0,i.createElement)(c.Placeholder,{icon:"admin-site",label:(0,o.__)("Google Maps","otter-blocks"),instructions:(0,o.__)("A Google Maps API key is required, please enter one below.","otter-blocks")},(0,i.createElement)("div",{className:"components-placeholder__actions"},(0,i.createElement)(c.TextControl,{type:"text",placeholder:(0,o.__)("Google Maps API Key","otter-blocks"),value:t,className:g()("components-placeholder__input",{"is-invalid":l}),onChange:s}),(0,i.createElement)(c.Button,{isPrimary:!0,type:"submit",onClick:d,isBusy:r,disabled:""===t||l},(0,o.__)("Save","otter-blocks"))),(0,i.createElement)("div",{className:"components-placeholder__learn-more"},l&&(0,i.createElement)("p",null,(0,o.__)("The API key could not be validated.","otter-blocks")),(0,i.createElement)("p",null,(0,o.__)("You need to activate Maps and Places API.","otter-blocks")," ",(0,i.createElement)(c.ExternalLink,{href:"https://developers.google.com/maps/documentation/javascript/get-api-key"},(0,o.__)("Need an API key? Get one here.","otter-blocks"))))):(0,i.createElement)(c.Placeholder,null,(0,i.createElement)(c.Spinner,null),(0,o.__)("Loading…","otter-blocks"))},bl=l(5241);const ml=e=>{let{value:t,onChange:l}=e;const a=(0,Y.useInstanceId)(ml);(0,i.useEffect)((()=>{window.wp.oldEditor.initialize(r.current.id,{tinymce:{classic_block_editor:!0,plugins:"lists,media,paste,tabfocus,wordpress,wpautoresize,wpeditimage,wpgallery,wplink,wpdialogs,wptextpattern,wpview",toolbar1:"formatselect,bold,italic,bullist,numlist,alignleft,aligncenter,alignright,link,unlink,spellchecker,wp_add_media"}});const e=window.tinymce.get(r.current.id);return e.on("change",(()=>l(e.getContent()))),()=>window.wp.oldEditor.remove(r.current.id)}),[]);const n=`inspector-textarea-control-${a}`,r=(0,i.useRef)(null);return(0,i.createElement)(c.BaseControl,{id:n,label:(0,o.__)("Description","otter-blocks")},(0,i.createElement)("textarea",{id:n,className:"components-textarea-control__input",rows:4,value:t,onChange:e=>l(e.target.value),ref:r}))};var pl=ml,gl=e=>{let{marker:t,isOpen:l,isPlaceAPIAvailable:a,openMarker:n,removeMarker:r,changeMarkerProp:s}=e;const d=(0,i.useRef)(null);return(0,i.createElement)("div",{className:"wp-block-themeisle-blocks-google-map-marker"},(0,i.createElement)("div",{className:"wp-block-themeisle-blocks-google-map-marker-title-area"},(0,i.createElement)(c.Button,{className:"wp-block-themeisle-blocks-google-map-marker-title",onClick:()=>n(t.id)},t.title||(0,o.__)("Custom Marker","otter-blocks")),(0,i.createElement)(c.Button,{icon:"no-alt",label:(0,o.__)("Remove Marker","otter-blocks"),showTooltip:!0,className:"wp-block-themeisle-blocks-google-map-marker-remove",onClick:()=>r(t.id)})),(0,i.createElement)("div",{className:g()("wp-block-themeisle-blocks-google-map-marker-control-area",{opened:t.id===l})},(0,i.createElement)(c.BaseControl,{label:(0,o.__)("Location","otter-blocks"),id:`themeisle-location-search-${t.id}`},(0,i.createElement)("input",{type:"text",id:`themeisle-location-search-${t.id}`,placeholder:(0,o.__)("Enter a location…","otter-blocks"),value:t.location,className:"wp-block-themeisle-blocks-google-map-search",ref:d,onFocus:()=>{const e=document.getElementsByClassName("pac-container");Object.keys(e).forEach((t=>e[t].remove()));const l=new window.google.maps.places.SearchBox(d.current);l.addListener("places_changed",(()=>{const e=l.getPlaces();e&&0<e.length&&e.forEach((e=>{const l=e.formatted_address||e.name,o=e.geometry.location.lat(),a=e.geometry.location.lng();s(t.id,"location",l),s(t.id,"latitude",o),s(t.id,"longitude",a)}))}))},onChange:e=>s(t.id,"location",e.target.value),disabled:!a}),!a&&(0,i.createElement)("p",null,(0,o.__)("To enable locations earch, please ensure Places API is activated in the Google Developers Console.","otter-blocks")+" ",(0,i.createElement)(c.ExternalLink,{href:"https://developers.google.com/places/web-service/intro"},(0,o.__)("More info.","otter-blocks")))),(0,i.createElement)(c.TextControl,{label:(0,o.__)("Latitude","otter-blocks"),type:"text",value:t.latitude,onChange:e=>s(t.id,"latitude",e)}),(0,i.createElement)(c.TextControl,{label:(0,o.__)("Longitude","otter-blocks"),type:"text",value:t.longitude,onChange:e=>s(t.id,"longitude",e)}),(0,i.createElement)(c.SelectControl,{label:(0,o.__)("Map Icon","otter-blocks"),value:t.icon||"https://maps.google.com/mapfiles/ms/icons/red-dot.png",options:[{label:(0,o.__)("Red","otter-blocks"),value:"https://maps.google.com/mapfiles/ms/icons/red-dot.png"},{label:(0,o.__)("Blue","otter-blocks"),value:"https://maps.google.com/mapfiles/ms/icons/blue-dot.png"},{label:(0,o.__)("Yellow","otter-blocks"),value:"https://maps.google.com/mapfiles/ms/icons/yellow-dot.png"},{label:(0,o.__)("Green","otter-blocks"),value:"https://maps.google.com/mapfiles/ms/icons/green-dot.png"},{label:(0,o.__)("Orange","otter-blocks"),value:"https://maps.google.com/mapfiles/ms/icons/orange-dot.png"}],onChange:e=>s(t.id,"icon",e)}),(0,i.createElement)(c.TextControl,{label:(0,o.__)("Title","otter-blocks"),type:"text",value:t.title,onChange:e=>s(t.id,"title",e)}),(0,i.createElement)(pl,{label:(0,o.__)("Description","otter-blocks"),type:"text",value:t.description,onChange:e=>s(t.id,"description",e)})))},hl=e=>{let{initialOpen:t,markers:l,isPlaceAPIAvailable:a,addMarker:n,removeMarker:r,changeMarkerProp:s}=e;(0,i.useEffect)((()=>{!1!==t&&u(t)}),[t]);const[d,u]=(0,i.useState)(null),b=e=>{d===e&&(e=null),u(e)};return(0,i.createElement)(i.Fragment,null,(0,i.createElement)("div",{className:"wp-block-themeisle-blocks-google-map-marker-group"},l.map((e=>(0,i.createElement)(gl,{key:e.id,marker:e,isOpen:d,isPlaceAPIAvailable:a,openMarker:b,removeMarker:r,changeMarkerProp:s})))),(0,i.createElement)(c.Button,{isSecondary:!0,className:"wp-block-themeisle-blocks-google-map-marker-add",onClick:n},(0,o.__)("Add Marker","otter-blocks")))},vl=e=>{let{attributes:t,setAttributes:l,map:a,changeStyle:n,isPlaceAPIAvailable:r,isMarkerOpen:d,setMarkerOpen:u,removeMarker:b,changeMarkerProp:m,addMarkerManual:p,api:g,isSaving:h,changeAPI:v,saveAPIKey:y}=e;const[f,_]=(0,i.useState)("settings"),{responsiveSetAttributes:E,responsiveGetAttributes:x}=S(l),T=(0,i.useRef)(null);return(0,i.createElement)(s.InspectorControls,null,(0,i.createElement)(w.Z,{value:f,options:[{label:(0,o.__)("Settings","otter-blocks"),value:"settings"},{label:(0,o.__)("Style","otter-blocks"),value:"style"}],onChange:_}),"settings"===f&&(0,i.createElement)(i.Fragment,null,(0,i.createElement)(c.PanelBody,{title:(0,o.__)("Location","otter-blocks")},(0,i.createElement)(c.BaseControl,{label:(0,o.__)("Location"),id:"wp-block-themeisle-blocks-google-map-search"},(0,i.createElement)("input",{type:"text",id:"wp-block-themeisle-blocks-google-map-search",placeholder:(0,o.__)("Enter a location…","otter-blocks"),value:t.location,className:"wp-block-themeisle-blocks-google-map-search",ref:T,onFocus:()=>{const e=document.getElementsByClassName("pac-container");Object.keys(e).forEach((t=>e[t].remove()));const t=new window.google.maps.places.SearchBox(T.current);t.addListener("places_changed",(()=>{const e=t.getPlaces();e&&0<e.length&&e.forEach((e=>{const t=e.geometry.location.lat(),o=e.geometry.location.lng(),n=new window.google.maps.LatLng(t,o);a.setCenter(n),l({location:e.formatted_address||e.name,latitude:t.toString(),longitude:o.toString()})}))}))},onChange:e=>{l({location:e.target.value})},disabled:!r}),!r&&(0,i.createElement)("p",null,(0,o.__)("To enable locations earch, please ensure Places API is activated in the Google Developers Console.","otter-blocks")+" ",(0,i.createElement)(c.ExternalLink,{href:"https://developers.google.com/places/web-service/intro"},(0,o.__)("More info.","otter-blocks")))),(0,i.createElement)(c.TextControl,{label:(0,o.__)("Latitude","otter-blocks"),type:"text",placeholder:(0,o.__)("Enter latitude…","otter-blocks"),value:t.latitude,onChange:e=>{l({latitude:e.toString()});const o=Number(e),{longitude:n}=t,r=new window.google.maps.LatLng(o,n);a.setCenter(r)}}),(0,i.createElement)(c.TextControl,{label:(0,o.__)("Longitude","otter-blocks"),type:"text",placeholder:(0,o.__)("Enter longitude","otter-blocks"),value:t.longitude,onChange:e=>{l({longitude:e.toString()});const{latitude:o}=t,n=Number(e),r=new window.google.maps.LatLng(o,n);a.setCenter(r)}})),(0,i.createElement)(c.PanelBody,{title:(0,o.__)("Positioning & Zooming","otter-blocks"),initialOpen:!1},(0,i.createElement)(c.RangeControl,{label:(0,o.__)("Map Zoom Level","otter-blocks"),value:t.zoom,onChange:e=>{l({zoom:e}),a.setZoom(e)},min:0,max:20}),(0,i.createElement)(M.Z,{label:(0,o.__)("Height","otter-blocks")},(0,i.createElement)(c.__experimentalUnitControl,{value:x([(B=t.height,(0,K.isNumber)(B)?(e=>e?`${e}px`:e)(B):B),t.heightTablet,t.heightMobile]),onChange:e=>E(e,["height","heightTablet","heightMobile"])}),(0,i.createElement)(k.Z,{values:["height","heightTablet","heightMobile"],setAttributes:l}))),(0,i.createElement)(c.PanelBody,{title:(0,o.__)("Controls","otter-blocks"),initialOpen:!1},(0,i.createElement)(c.BaseControl,null,(0,o.__)("The following changes will not affect block preview during the editing process. You can click outside the block to see the changes take effect.","otter-blocks")),(0,i.createElement)(c.ToggleControl,{label:(0,o.__)("Draggable Map","otter-blocks"),checked:t.draggable,onChange:()=>{l({draggable:!t.draggable})}}),(0,i.createElement)(c.ToggleControl,{label:(0,o.__)("Map Type Control","otter-blocks"),checked:t.mapTypeControl,onChange:()=>{l({mapTypeControl:!t.mapTypeControl})}}),(0,i.createElement)(c.ToggleControl,{label:(0,o.__)("Zoom Control","otter-blocks"),checked:t.zoomControl,onChange:()=>{l({zoomControl:!t.zoomControl})}}),(0,i.createElement)(c.ToggleControl,{label:(0,o.__)("Full Screen Control","otter-blocks"),checked:t.fullscreenControl,onChange:()=>{l({fullscreenControl:!t.fullscreenControl})}}),(0,i.createElement)(c.ToggleControl,{label:(0,o.__)("Street View Control","otter-blocks"),checked:t.streetViewControl,onChange:()=>{l({streetViewControl:!t.streetViewControl})}})),(0,i.createElement)(c.PanelBody,{title:(0,o.__)("Markers","otter-blocks"),initialOpen:!1,opened:!1!==d||void 0,onToggle:()=>{!1!==d&&u(!0)}},(0,i.createElement)(hl,{markers:t.markers,removeMarker:b,changeMarkerProp:m,addMarker:p,isPlaceAPIAvailable:r,initialOpen:d})),(0,i.createElement)(c.PanelBody,{title:(0,o.__)("Global Settings","otter-blocks"),initialOpen:!1},(0,i.createElement)(c.TextControl,{label:(0,o.__)("Google Maps API Key","otter-blocks"),type:"text",placeholder:(0,o.__)("Google Maps API Key","otter-blocks"),value:g,className:"components-placeholder__input",onChange:v,help:(0,o.__)("Changing the API key effects all Google Map Embed blocks. You will have to refresh the page after changing your API keys.","otter-blocks")}),(0,i.createElement)(c.Button,{isSecondary:!0,type:"submit",onClick:y,isBusy:h},(0,o.__)("Save API Key","otter-blocks")))),"style"===f&&(0,i.createElement)(c.PanelBody,{title:(0,o.__)("Styles","otter-blocks")},(0,i.createElement)(bl.V,{value:t.style,options:[{label:(0,o.__)("Standard","otter-blocks"),value:"standard",image:window.themeisleGutenberg.assetsPath+"/icons/map-standard.png"},{label:(0,o.__)("Silver","otter-blocks"),value:"silver",image:window.themeisleGutenberg.assetsPath+"/icons/map-silver.png"},{label:(0,o.__)("Retro","otter-blocks"),value:"retro",image:window.themeisleGutenberg.assetsPath+"/icons/map-retro.png"},{label:(0,o.__)("Dark","otter-blocks"),value:"dark",image:window.themeisleGutenberg.assetsPath+"/icons/map-dark.png"},{label:(0,o.__)("Night","otter-blocks"),value:"night",image:window.themeisleGutenberg.assetsPath+"/icons/map-night.png"},{label:(0,o.__)("Aubergine","otter-blocks"),value:"aubergine",image:window.themeisleGutenberg.assetsPath+"/icons/map-aubergine.png"}],onChange:n}),(0,i.createElement)(c.SelectControl,{label:(0,o.__)("Map Type","otter-blocks"),value:t.type,options:[{label:(0,o.__)("Road Map","otter-blocks"),value:"roadmap"},{label:(0,o.__)("Satellite View","otter-blocks"),value:"satellite"},{label:(0,o.__)("Hybrid","otter-blocks"),value:"hybrid"},{label:(0,o.__)("Terrain","otter-blocks"),value:"terrain"}],onChange:e=>{l({type:e}),a.setMapTypeId(window.google.maps.MapTypeId[e.toUpperCase()])}})),(0,i.createElement)(C.p,null));var B},yl=e=>{let{marker:t,isAdvanced:l,isPlaceAPIAvailable:a,addMarker:n,close:r}=e;(0,i.useEffect)((()=>{u(t.id),m(t.location),g(t.title),v(t.icon),k(t.description),_(t.latitude),C(t.longitude)}),[t]);const s=(0,i.useRef)(null),[d,u]=(0,i.useState)(t.id),[b,m]=(0,i.useState)(t.location),[p,g]=(0,i.useState)(t.title),[h,v]=(0,i.useState)(t.icon),[y,k]=(0,i.useState)(t.description),[f,_]=(0,i.useState)(t.latitude),[w,C]=(0,i.useState)(t.longitude);return(0,i.createElement)(c.Modal,{title:(0,o.__)("Add Marker","otter-blocks"),onRequestClose:r,shouldCloseOnClickOutside:!1},l&&(0,i.createElement)(i.Fragment,null,(0,i.createElement)(c.BaseControl,{label:(0,o.__)("Location","otter-blocks"),id:`themeisle-location-search-${t.id}`},(0,i.createElement)("input",{type:"text",id:`themeisle-location-search-${d}`,placeholder:(0,o.__)("Enter a location…","otter-blocks"),value:b,className:"wp-block-themeisle-blocks-google-map-search",ref:s,onFocus:()=>{const e=document.getElementsByClassName("pac-container");Object.keys(e).forEach((t=>e[t].remove()));const t=new window.google.maps.places.SearchBox(s.current);t.addListener("places_changed",(()=>{const e=t.getPlaces();e&&0<e.length&&e.forEach((e=>{const t=e.formatted_address||e.name,l=e.geometry.location.lat(),o=e.geometry.location.lng();m(t),_(l),C(o)}))}))},onChange:e=>m(e.target.value),disabled:!a})),(0,i.createElement)(c.TextControl,{label:(0,o.__)("Latitude","otter-blocks"),type:"text",value:f,onChange:_}),(0,i.createElement)(c.TextControl,{label:(0,o.__)("Longitude","otter-blocks"),type:"text",value:w,onChange:C})),(0,i.createElement)(c.TextControl,{label:(0,o.__)("Title","otter-blocks"),type:"text",value:p,onChange:g}),(0,i.createElement)(pl,{label:(0,o.__)("Description","otter-blocks"),type:"text",value:y,onChange:k}),(0,i.createElement)(c.SelectControl,{label:(0,o.__)("Map Icon","otter-blocks"),value:h||"https://maps.google.com/mapfiles/ms/icons/red-dot.png",options:[{label:(0,o.__)("Red","otter-blocks"),value:"https://maps.google.com/mapfiles/ms/icons/red-dot.png"},{label:(0,o.__)("Blue","otter-blocks"),value:"https://maps.google.com/mapfiles/ms/icons/blue-dot.png"},{label:(0,o.__)("Yellow","otter-blocks"),value:"https://maps.google.com/mapfiles/ms/icons/yellow-dot.png"},{label:(0,o.__)("Green","otter-blocks"),value:"https://maps.google.com/mapfiles/ms/icons/green-dot.png"},{label:(0,o.__)("Orange","otter-blocks"),value:"https://maps.google.com/mapfiles/ms/icons/orange-dot.png"}],onChange:v}),(0,i.createElement)(c.ButtonGroup,null,(0,i.createElement)(c.Button,{isPrimary:!0,onClick:()=>n(b,p,h,y,f,w)},(0,o.__)("Add","otter-blocks")),(0,i.createElement)(c.Button,{isSecondary:!0,onClick:r},(0,o.__)("Cancel","otter-blocks"))))},kl=e=>{let{attributes:t,initMap:l,displayMap:a,isMapLoaded:n,selectMarker:r,isSelectingMarker:s}=e;(0,i.useEffect)((()=>{a&&l()}),[a]);const{responsiveGetAttributes:d}=S();return(0,i.createElement)(i.Fragment,null,(0,i.createElement)("div",{id:t.id,className:g()("wp-block-themeisle-blocks-google-map-container",{"is-selecting-marker":s}),style:{height:d([(u=t.height,(0,K.isNumber)(u)?(e=>e?`${e}px`:e)(u):u),t.heightTablet,t.heightMobile])}}),n&&(0,i.createElement)(c.Button,{className:"wp-block-themeisle-blocks-google-map-marker-button",title:(0,o.__)("Add Button","otter-blocks"),onClick:r},(0,i.createElement)("span",{className:"dashicons dashicons-sticky"})));var u},fl={standard:[],silver:[{elementType:"geometry",stylers:[{color:"#f5f5f5"}]},{elementType:"labels.icon",stylers:[{visibility:"off"}]},{elementType:"labels.text.fill",stylers:[{color:"#616161"}]},{elementType:"labels.text.stroke",stylers:[{color:"#f5f5f5"}]},{featureType:"administrative.land_parcel",elementType:"labels.text.fill",stylers:[{color:"#bdbdbd"}]},{featureType:"poi",elementType:"geometry",stylers:[{color:"#eeeeee"}]},{featureType:"poi",elementType:"labels.text.fill",stylers:[{color:"#757575"}]},{featureType:"poi.park",elementType:"geometry",stylers:[{color:"#e5e5e5"}]},{featureType:"poi.park",elementType:"labels.text.fill",stylers:[{color:"#9e9e9e"}]},{featureType:"road",elementType:"geometry",stylers:[{color:"#ffffff"}]},{featureType:"road.arterial",elementType:"labels.text.fill",stylers:[{color:"#757575"}]},{featureType:"road.highway",elementType:"geometry",stylers:[{color:"#dadada"}]},{featureType:"road.highway",elementType:"labels.text.fill",stylers:[{color:"#616161"}]},{featureType:"road.local",elementType:"labels.text.fill",stylers:[{color:"#9e9e9e"}]},{featureType:"transit.line",elementType:"geometry",stylers:[{color:"#e5e5e5"}]},{featureType:"transit.station",elementType:"geometry",stylers:[{color:"#eeeeee"}]},{featureType:"water",elementType:"geometry",stylers:[{color:"#c9c9c9"}]},{featureType:"water",elementType:"labels.text.fill",stylers:[{color:"#9e9e9e"}]}],retro:[{elementType:"geometry",stylers:[{color:"#ebe3cd"}]},{elementType:"labels.text.fill",stylers:[{color:"#523735"}]},{elementType:"labels.text.stroke",stylers:[{color:"#f5f1e6"}]},{featureType:"administrative",elementType:"geometry.stroke",stylers:[{color:"#c9b2a6"}]},{featureType:"administrative.land_parcel",elementType:"geometry.stroke",stylers:[{color:"#dcd2be"}]},{featureType:"administrative.land_parcel",elementType:"labels.text.fill",stylers:[{color:"#ae9e90"}]},{featureType:"landscape.natural",elementType:"geometry",stylers:[{color:"#dfd2ae"}]},{featureType:"poi",elementType:"geometry",stylers:[{color:"#dfd2ae"}]},{featureType:"poi",elementType:"labels.text.fill",stylers:[{color:"#93817c"}]},{featureType:"poi.park",elementType:"geometry.fill",stylers:[{color:"#a5b076"}]},{featureType:"poi.park",elementType:"labels.text.fill",stylers:[{color:"#447530"}]},{featureType:"road",elementType:"geometry",stylers:[{color:"#f5f1e6"}]},{featureType:"road.arterial",elementType:"geometry",stylers:[{color:"#fdfcf8"}]},{featureType:"road.highway",elementType:"geometry",stylers:[{color:"#f8c967"}]},{featureType:"road.highway",elementType:"geometry.stroke",stylers:[{color:"#e9bc62"}]},{featureType:"road.highway.controlled_access",elementType:"geometry",stylers:[{color:"#e98d58"}]},{featureType:"road.highway.controlled_access",elementType:"geometry.stroke",stylers:[{color:"#db8555"}]},{featureType:"road.local",elementType:"labels.text.fill",stylers:[{color:"#806b63"}]},{featureType:"transit.line",elementType:"geometry",stylers:[{color:"#dfd2ae"}]},{featureType:"transit.line",elementType:"labels.text.fill",stylers:[{color:"#8f7d77"}]},{featureType:"transit.line",elementType:"labels.text.stroke",stylers:[{color:"#ebe3cd"}]},{featureType:"transit.station",elementType:"geometry",stylers:[{color:"#dfd2ae"}]},{featureType:"water",elementType:"geometry.fill",stylers:[{color:"#b9d3c2"}]},{featureType:"water",elementType:"labels.text.fill",stylers:[{color:"#92998d"}]}],dark:[{elementType:"geometry",stylers:[{color:"#212121"}]},{elementType:"labels.icon",stylers:[{visibility:"off"}]},{elementType:"labels.text.fill",stylers:[{color:"#757575"}]},{elementType:"labels.text.stroke",stylers:[{color:"#212121"}]},{featureType:"administrative",elementType:"geometry",stylers:[{color:"#757575"}]},{featureType:"administrative.country",elementType:"labels.text.fill",stylers:[{color:"#9e9e9e"}]},{featureType:"administrative.land_parcel",stylers:[{visibility:"off"}]},{featureType:"administrative.locality",elementType:"labels.text.fill",stylers:[{color:"#bdbdbd"}]},{featureType:"poi",elementType:"labels.text.fill",stylers:[{color:"#757575"}]},{featureType:"poi.park",elementType:"geometry",stylers:[{color:"#181818"}]},{featureType:"poi.park",elementType:"labels.text.fill",stylers:[{color:"#616161"}]},{featureType:"poi.park",elementType:"labels.text.stroke",stylers:[{color:"#1b1b1b"}]},{featureType:"road",elementType:"geometry.fill",stylers:[{color:"#2c2c2c"}]},{featureType:"road",elementType:"labels.text.fill",stylers:[{color:"#8a8a8a"}]},{featureType:"road.arterial",elementType:"geometry",stylers:[{color:"#373737"}]},{featureType:"road.highway",elementType:"geometry",stylers:[{color:"#3c3c3c"}]},{featureType:"road.highway.controlled_access",elementType:"geometry",stylers:[{color:"#4e4e4e"}]},{featureType:"road.local",elementType:"labels.text.fill",stylers:[{color:"#616161"}]},{featureType:"transit",elementType:"labels.text.fill",stylers:[{color:"#757575"}]},{featureType:"water",elementType:"geometry",stylers:[{color:"#000000"}]},{featureType:"water",elementType:"labels.text.fill",stylers:[{color:"#3d3d3d"}]}],night:[{elementType:"geometry",stylers:[{color:"#242f3e"}]},{elementType:"labels.text.fill",stylers:[{color:"#746855"}]},{elementType:"labels.text.stroke",stylers:[{color:"#242f3e"}]},{featureType:"administrative.locality",elementType:"labels.text.fill",stylers:[{color:"#d59563"}]},{featureType:"poi",elementType:"labels.text.fill",stylers:[{color:"#d59563"}]},{featureType:"poi.park",elementType:"geometry",stylers:[{color:"#263c3f"}]},{featureType:"poi.park",elementType:"labels.text.fill",stylers:[{color:"#6b9a76"}]},{featureType:"road",elementType:"geometry",stylers:[{color:"#38414e"}]},{featureType:"road",elementType:"geometry.stroke",stylers:[{color:"#212a37"}]},{featureType:"road",elementType:"labels.text.fill",stylers:[{color:"#9ca5b3"}]},{featureType:"road.highway",elementType:"geometry",stylers:[{color:"#746855"}]},{featureType:"road.highway",elementType:"geometry.stroke",stylers:[{color:"#1f2835"}]},{featureType:"road.highway",elementType:"labels.text.fill",stylers:[{color:"#f3d19c"}]},{featureType:"transit",elementType:"geometry",stylers:[{color:"#2f3948"}]},{featureType:"transit.station",elementType:"labels.text.fill",stylers:[{color:"#d59563"}]},{featureType:"water",elementType:"geometry",stylers:[{color:"#17263c"}]},{featureType:"water",elementType:"labels.text.fill",stylers:[{color:"#515c6d"}]},{featureType:"water",elementType:"labels.text.stroke",stylers:[{color:"#17263c"}]}],aubergine:[{elementType:"geometry",stylers:[{color:"#1d2c4d"}]},{elementType:"labels.text.fill",stylers:[{color:"#8ec3b9"}]},{elementType:"labels.text.stroke",stylers:[{color:"#1a3646"}]},{featureType:"administrative.country",elementType:"geometry.stroke",stylers:[{color:"#4b6878"}]},{featureType:"administrative.land_parcel",elementType:"labels.text.fill",stylers:[{color:"#64779e"}]},{featureType:"administrative.province",elementType:"geometry.stroke",stylers:[{color:"#4b6878"}]},{featureType:"landscape.man_made",elementType:"geometry.stroke",stylers:[{color:"#334e87"}]},{featureType:"landscape.natural",elementType:"geometry",stylers:[{color:"#023e58"}]},{featureType:"poi",elementType:"geometry",stylers:[{color:"#283d6a"}]},{featureType:"poi",elementType:"labels.text.fill",stylers:[{color:"#6f9ba5"}]},{featureType:"poi",elementType:"labels.text.stroke",stylers:[{color:"#1d2c4d"}]},{featureType:"poi.park",elementType:"geometry.fill",stylers:[{color:"#023e58"}]},{featureType:"poi.park",elementType:"labels.text.fill",stylers:[{color:"#3C7680"}]},{featureType:"road",elementType:"geometry",stylers:[{color:"#304a7d"}]},{featureType:"road",elementType:"labels.text.fill",stylers:[{color:"#98a5be"}]},{featureType:"road",elementType:"labels.text.stroke",stylers:[{color:"#1d2c4d"}]},{featureType:"road.highway",elementType:"geometry",stylers:[{color:"#2c6675"}]},{featureType:"road.highway",elementType:"geometry.stroke",stylers:[{color:"#255763"}]},{featureType:"road.highway",elementType:"labels.text.fill",stylers:[{color:"#b0d5ce"}]},{featureType:"road.highway",elementType:"labels.text.stroke",stylers:[{color:"#023e58"}]},{featureType:"transit",elementType:"labels.text.fill",stylers:[{color:"#98a5be"}]},{featureType:"transit",elementType:"labels.text.stroke",stylers:[{color:"#1d2c4d"}]},{featureType:"transit.line",elementType:"geometry.fill",stylers:[{color:"#283d6a"}]},{featureType:"transit.station",elementType:"geometry",stylers:[{color:"#3a4762"}]},{featureType:"water",elementType:"geometry",stylers:[{color:"#0e1626"}]},{featureType:"water",elementType:"labels.text.fill",stylers:[{color:"#4e6d70"}]}]};const{attributes:_l}=cl;const wl={to:[{type:"block",blocks:["themeisle-blocks/leaflet-map"],transform:e=>{const t=(0,K.omit)(e,["style","mapTypeControl","fullscreenControl","streetViewControl"]);return(0,a.createBlock)("themeisle-blocks/leaflet-map",{...t})}}]};var Cl=wl;const{name:El}=cl;(0,a.registerBlockType)(El,{...cl,title:(0,o.__)("Google Maps","otter-blocks"),description:(0,o.__)("Display Google Maps on your website with Google Map block. Powered by Otter.","otter-blocks"),icon:r.mapIcon,keywords:["map","google","orbitfox"],transforms:Cl,edit:e=>{let{attributes:t,setAttributes:l,clientId:a,isSelected:n}=e;(0,i.useEffect)((()=>{const e=(0,L.blockInit)(a,_l);return()=>e(t.id)}),[t.id]),(0,i.useEffect)((()=>{let e=!0;return(async()=>{await window.wp.api.loadPromise.then((()=>{c.current=new window.wp.api.models.Settings})),!1===Boolean(window.themeisleGutenberg.mapsAPI)?v||c.current.fetch().then((t=>{e&&(h(t.themeisle_google_map_block_api_key),y(!0),""!==t.themeisle_google_map_block_api_key&&(f(!0),G(t.themeisle_google_map_block_api_key)))})):!v&&e&&(h(window.themeisleGutenberg.mapsAPI),y(!0),f(!0),G(window.themeisleGutenberg.mapsAPI))})(),window.isMapLoaded=window.isMapLoaded||!1,window[`removeMarker_${a.substr(0,8)}`]=j,window.gm_authFailure=function(){f(!1),D(!0)},d.current=document.createElement("script"),d.current.type="text/javascript",d.current.async=!0,d.current.defer=!0,d.current.id="themeisle-google-map-api-loading",()=>{e=!1}}),[]),(0,i.useEffect)((()=>{!1!==k&&void 0!==window.google&&u.current.setOptions({mapTypeControl:!!n||t.mapTypeControl,zoomControl:!!n||t.zoomControl,fullscreenControl:!!n||t.fullscreenControl,streetViewControl:!!n||t.streetViewControl})}),[n]),(0,i.useEffect)((()=>{m.current=[...t.markers]}),[t.markers]);const r=(0,i.useRef)([]),c=(0,i.useRef)(null),d=(0,i.useRef)(null),u=(0,i.useRef)(null),b=(0,i.useRef)(null),m=(0,i.useRef)([...t.markers]),[p,h]=(0,i.useState)(""),[v,y]=(0,i.useState)(!1),[k,f]=(0,i.useState)(!1),[_,w]=(0,i.useState)(!1),[C,E]=(0,i.useState)(!1),[x,S]=(0,i.useState)(!0),[T,M]=(0,i.useState)(!1),[B,z]=(0,i.useState)(!1),[P,R]=(0,i.useState)(!1),[F,A]=(0,i.useState)(!1),[H,O]=(0,i.useState)(!1),[N,V]=(0,i.useState)({}),[I,D]=(0,i.useState)(!1),G=e=>{window.isMapLoaded||(window.isMapLoaded=!0,d.current.onload=()=>{document.getElementById("themeisle-google-map-api-loading").id="themeisle-google-map-api",M(!0)},d.current.src=`https://maps.googleapis.com/maps/api/js?key=${e}&libraries=places&cache=${Math.random()}`,document.head.appendChild(d.current)),document.getElementById("themeisle-google-map-api")&&M(!0)},$=(e,t,l,n)=>{const r=`<div class="wp-block-themeisle-blocks-map-overview"><h6 class="wp-block-themeisle-blocks-map-overview-title">${l}</h6><div class="wp-block-themeisle-blocks-map-overview-content">${n?`<p>${n}</p>`:""}<a class="wp-block-themeisle-blocks-map-overview-delete" onclick="removeMarker_${a.substr(0,8)}( '${t}' )">${(0,o.__)("Delete Marker","otter-blocks")}</a></div></div>`,i=new window.google.maps.InfoWindow({content:r});e.addListener("click",(()=>{b.current=i,i.open(u.current,e)})),window.google.maps.event.addListener(i,"domready",(()=>{z(t)})),window.google.maps.event.addListener(i,"closeclick",(()=>{z(!1)}))},W=e=>{e.forEach((e=>{const{latitude:t}=e,{longitude:l}=e,o=new window.google.maps.LatLng(t,l),a=new window.google.maps.Marker({position:o,map:u.current,title:e.title,draggable:!0,icon:e.icon||"https://maps.google.com/mapfiles/ms/icons/red-dot.png"});window.google.maps.event.addListener(a,"dragend",(t=>{const l=t.latLng.lat(),o=t.latLng.lng();Z(e.id,"latitude",l),Z(e.id,"longitude",o)})),r.current.push(a),window.google.maps.event.addListener(a,"click",(()=>{b.current&&b.current.close()})),$(a,e.id,e.title,e.description)}))},Z=(e,t,o)=>{const a=[...m.current];a.find((t=>t.id===e))[t]=o.toString(),U(),W(a),l({markers:a})},j=e=>{let t=[...m.current];t=t.filter((t=>t.id!==e)),l({markers:t}),U(),z(!1),0<t.length&&W(t)},U=()=>{for(let e=0;e<r.current.length;e++)r.current[e].setMap(null);r.current=[]},q=()=>{!1===Boolean(window.themeisleGutenberg.mapsAPI)&&(E(!0),new window.wp.api.models.Settings({themeisle_google_map_block_api_key:p}).save().then((e=>{let t=!1;""!==e.themeisle_google_map_block_api_key&&(t=!0),E(!1),f(t),""!==e.themeisle_google_map_block_api_key&&(window.isMapLoaded=!1,G(e.themeisle_google_map_block_api_key))})))},J=e=>{l({style:e}),u.current.setOptions({styles:fl[e]})},K=(0,s.useBlockProps)({className:g()("wp-block-themeisle-blocks-google-map-resizer",{"is-focused":n})});return v&&k?(0,i.createElement)(i.Fragment,null,(0,i.createElement)(bl.d,{label:(0,o.__)("Block Styles","otter-blocks"),value:t.style,options:[{label:(0,o.__)("Standard","otter-blocks"),value:"standard",image:window.themeisleGutenberg.assetsPath+"/icons/map-standard.png"},{label:(0,o.__)("Silver","otter-blocks"),value:"silver",image:window.themeisleGutenberg.assetsPath+"/icons/map-silver.png"},{label:(0,o.__)("Retro","otter-blocks"),value:"retro",image:window.themeisleGutenberg.assetsPath+"/icons/map-retro.png"},{label:(0,o.__)("Dark","otter-blocks"),value:"dark",image:window.themeisleGutenberg.assetsPath+"/icons/map-dark.png"},{label:(0,o.__)("Night","otter-blocks"),value:"night",image:window.themeisleGutenberg.assetsPath+"/icons/map-night.png"},{label:(0,o.__)("Aubergine","otter-blocks"),value:"aubergine",image:window.themeisleGutenberg.assetsPath+"/icons/map-aubergine.png"}],onChange:J}),(0,i.createElement)(vl,{attributes:t,setAttributes:l,map:u.current,changeStyle:J,isPlaceAPIAvailable:x,isMarkerOpen:B,setMarkerOpen:z,removeMarker:j,changeMarkerProp:Z,addMarkerManual:()=>{const e=(0,dl.Z)(),t=(0,o.__)("Custom Marker","otter-blocks"),l=u.current.getCenter(),a=l.lat(),n=l.lng();A(!0),O(!0),V({id:e,location:"",title:t,icon:"https://maps.google.com/mapfiles/ms/icons/red-dot.png",description:"",latitude:a,longitude:n})},api:p,isSaving:C,changeAPI:h,saveAPIKey:q}),F&&(0,i.createElement)(yl,{marker:N,isAdvanced:H,isPlaceAPIAvailable:x,close:()=>A(!1),addMarker:(e,o,a,n,i,s)=>{const c=new window.google.maps.LatLng(i,s),d=(0,dl.Z)(),m=new window.google.maps.Marker({position:c,map:u.current,title:o,draggable:!0,icon:a});window.google.maps.event.addListener(m,"dragend",(e=>{const t=e.latLng.lat(),l=e.latLng.lng();Z(d,"latitude",t),Z(d,"longitude",l)})),r.current.push(m);const p=[...t.markers],g={id:d,location:e,title:o,icon:a,description:n,latitude:i,longitude:s};p.push(g),l({markers:p}),window.google.maps.event.addListener(m,"click",(()=>{b.current&&b.current.close()})),$(m,g.id,o,n),A(!1),R(!1)}}),(0,i.createElement)("div",K,(0,i.createElement)(kl,{attributes:t,initMap:()=>{var e,o,a;const n=null!==(e=null===(o=(0,L.getEditorIframe)())||void 0===o||null===(a=o.contentWindow)||void 0===a?void 0:a.document)&&void 0!==e?e:document;if(u.current=new window.google.maps.Map(n.getElementById(t.id),{center:{lat:Number(t.latitude)||41.4036299,lng:Number(t.longitude)||2.1743558000000576},gestureHandling:"cooperative",zoom:t.zoom,mapTypeId:t.type,styles:fl[t.style]}),t.location&&void 0===t.latitude&&void 0===t.longitude){const e={query:t.location,fields:["name","geometry"]};new window.google.maps.places.PlacesService(u.current).findPlaceFromQuery(e,((e,t)=>{t===window.google.maps.places.PlacesServiceStatus.OK&&0<e.length&&u.current.setCenter(e[0].geometry.location)}))}window.google.maps.event.addListenerOnce(u.current,"idle",(()=>{w(!0)})),u.current.addListener("zoom_changed",(()=>{const e=u.current.getZoom();l({zoom:e})})),u.current.addListener("maptypeid_changed",(()=>{const e=u.current.getMapTypeId();l({type:e})})),u.current.addListener("bounds_changed",(()=>{const e=u.current.getCenter(),t=e.lat(),o=e.lng();l({latitude:t.toString(),longitude:o.toString()})})),0<t.markers.length&&W(t.markers);const r={query:t.location,fields:["name","geometry"]};new window.google.maps.places.PlacesService(u.current).findPlaceFromQuery(r,((e,t)=>{"REQUEST_DENIED"===t&&S(!1)}))},displayMap:T,isMapLoaded:_,selectMarker:()=>{R(!P),P?window.google.maps.event.clearListeners(u.current,"click"):u.current.addListener("click",(e=>{window.google.maps.event.clearListeners(u.current,"click");const t=(0,dl.Z)(),l=(0,o.__)("Custom Marker","otter-blocks"),a=e.latLng.lat(),n=e.latLng.lng();A(!0),O(!1),V({id:t,location:"",title:l,icon:"https://maps.google.com/mapfiles/ms/icons/red-dot.png",description:"",latitude:a,longitude:n})}))},isSelectingMarker:P}))):(0,i.createElement)("div",K,(0,i.createElement)(ul,{api:p,error:I,isAPILoaded:v,isAPISaved:k,isSaving:C,changeAPI:e=>{h(e),D(!1)},saveAPIKey:q}))},save:()=>null});var xl=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"themeisle-blocks/icon-list","title":"Icon List","category":"themeisle-blocks","description":"Display an icon list in a beautiful layout. Powered by Otter.","keywords":["icon","list","items"],"textdomain":"otter-blocks","attributes":{"id":{"type":"string"},"defaultLibrary":{"type":"string","default":"fontawesome"},"defaultPrefix":{"type":"string","default":"fas"},"defaultIcon":{"type":"string","default":"angle-right"},"defaultContentColor":{"type":"string"},"defaultIconColor":{"type":"string"},"defaultSize":{"type":["number","string"]},"defaultIconSize":{"type":"string"},"gap":{"type":["number","string"]},"gapIconLabel":{"type":["string"]},"horizontalAlign":{"type":"string"},"alignmentTablet":{"type":"string"},"alignmentMobile":{"type":"string"},"hideLabels":{"type":"boolean"},"hasDivider":{"type":"boolean"},"dividerWidth":{"type":"string"},"dividerColor":{"type":"string"},"dividerLength":{"type":"string"}},"editorStyle":"otter-icon-list-editor","style":"otter-icon-list-style"}'),Sl=e=>{let{attributes:t,setAttributes:l}=e;return(0,i.createElement)(s.BlockControls,null,(0,i.createElement)(s.AlignmentToolbar,{value:{"flex-start":"left",center:"center","flex-end":"right"}[t.horizontalAlign],onChange:e=>{switch(e){case"left":l({horizontalAlign:"flex-start"});break;case"center":l({horizontalAlign:"center"});break;case"right":l({horizontalAlign:"flex-end"});break;default:l({horizontalAlign:void 0})}}}))},Tl=e=>{var t,l,a,n,r,d,u,b,m;let{attributes:p,setAttributes:g}=e;const[h,v]=(0,i.useState)("settings"),{responsiveSetAttributes:y,responsiveGetAttributes:k}=S(g);return(0,i.createElement)(s.InspectorControls,null,(0,i.createElement)("div",null,(0,i.createElement)(w.Z,{value:h,options:[{label:(0,o.__)("Settings","otter-blocks"),value:"settings"},{label:(0,o.__)("Style","otter-blocks"),value:"style"}],onChange:v}),"settings"===h&&(0,i.createElement)(i.Fragment,null,(0,i.createElement)(c.PanelBody,{title:(0,o.__)("Layout","otter-blocks")},(0,i.createElement)(E.Z,{label:(0,o.__)("List Orientation","otter-blocks"),options:[{label:(0,o.__)("Vertical","otter-blocks"),value:"default"},{label:(0,o.__)("Horizontal","otter-blocks"),value:"is-style-horizontal"}],value:null!=p&&null!==(t=p.className)&&void 0!==t&&t.includes("is-style-horizontal")?"is-style-horizontal":"default",onChange:e=>{var t;const l=(null==p||null===(t=p.className)||void 0===t?void 0:t.split(" "))||[];"default"===e&&l.includes("is-style-horizontal")?l.splice(l.indexOf("is-style-horizontal"),1):"is-style-horizontal"!==e||l.includes("is-style-horizontal")||l.push("is-style-horizontal"),g({className:l.join(" ")})}}),(0,i.createElement)(M.Z,{label:(0,o.__)("Alignment","otter-blocks")},(0,i.createElement)(pe.Z,{value:null!==(l=k([p.horizontalAlign,p.alignmentTablet,p.alignmentMobile]))&&void 0!==l?l:"flex-start",onChange:e=>{y(e,["horizontalAlign","alignmentTablet","alignmentMobile"])},options:[{icon:bt.Z,label:(0,o.__)("Left","otter-blocks"),value:"flex-start"},{icon:mt.Z,label:(0,o.__)("Center","otter-blocks"),value:"center"},{icon:pt.Z,label:(0,o.__)("Right","otter-blocks"),value:"flex-end"}],hasIcon:!0})),(0,i.createElement)(c.ToggleControl,{label:(0,o.__)("Hide Labels","otter-blocks"),checked:Boolean(p.hideLabels),onChange:()=>g({hideLabels:!p.hideLabels})})),(0,i.createElement)(c.PanelBody,{title:(0,o.__)("Icons","otter-blocks")},(0,i.createElement)(i.Suspense,{fallback:(0,i.createElement)(c.Placeholder,null,(0,i.createElement)(c.Spinner,null))},(0,i.createElement)(_.Z,{label:(0,o.__)("Icon Picker","otter-blocks"),library:p.defaultLibrary,prefix:p.defaultPrefix,icon:p.defaultIcon,changeLibrary:e=>{g({defaultLibrary:e,defaultIcon:void 0,defaultPrefix:"fas"})},onChange:e=>{if("image"===p.defaultLibrary&&null!=e&&e.url)return g({defaultIcon:e.url});g("object"==typeof e?{defaultIcon:e.name,defaultPrefix:e.prefix}:{defaultIcon:e})},allowImage:!0})))),"style"===h&&(0,i.createElement)(i.Fragment,null,(0,i.createElement)(s.PanelColorSettings,{title:(0,o.__)("Color","otter-blocks"),initialOpen:!0,colorSettings:[{value:p.defaultIconColor,onChange:e=>g({defaultIconColor:e}),label:(0,o.__)("Icon","otter-blocks")},{value:p.defaultContentColor,onChange:e=>g({defaultContentColor:e}),label:(0,o.__)("Text","otter-blocks")},...p.hasDivider?[{value:p.dividerColor,onChange:e=>g({dividerColor:e}),label:(0,o.__)("Divider","otter-blocks")}]:[]]}),(0,i.createElement)(c.PanelBody,{title:(0,o.__)("Size","otter-blocks")},(0,i.createElement)(c.BaseControl,{label:(0,o.__)("Font Size","otter-blocks"),__nextHasNoMarginBottom:!0},(0,i.createElement)(c.FontSizePicker,{value:null!==(a=(0,x.Yj)(p.defaultSize))&&void 0!==a?a:"16px",onChange:e=>g({defaultSize:e}),fontSizes:[{name:"Small",size:"12px",slug:"small"},{name:"Normal",size:"16px",slug:"Normal"},{name:"Medium",size:"20px",slug:"medium"},{name:"Large",size:"36px",slug:"large"}],withReset:!0})),(0,i.createElement)(c.BaseControl,{label:(0,o.__)("Icon Size","otter-blocks"),__nextHasNoMarginBottom:!0},(0,i.createElement)(c.FontSizePicker,{value:null!==(n=null!==(r=p.defaultIconSize)&&void 0!==r?r:(0,x.Yj)(p.defaultSize))&&void 0!==n?n:"16px",onChange:e=>g({defaultIconSize:e}),fontSizes:[{name:"Small",size:"12px",slug:"small"},{name:"Normal",size:"16px",slug:"Normal"},{name:"Medium",size:"20px",slug:"medium"},{name:"Large",size:"36px",slug:"large"}],withReset:!0}))),(0,i.createElement)(c.PanelBody,{title:(0,o.__)("Dimensions","otter-blocks")},(0,i.createElement)(c.__experimentalUnitControl,{label:(0,o.__)("Space between List items","otter-blocks"),value:null!==(d=p.gap)&&void 0!==d?d:"5px",onChange:e=>g({gap:e}),units:[{a11yLabel:"Pixels (px)",label:"px",step:1,value:"px"}]}),(0,i.createElement)("br",null),(0,i.createElement)(c.__experimentalUnitControl,{label:(0,o.__)("Space between Icon and Label","otter-blocks"),value:null!==(u=p.gapIconLabel)&&void 0!==u?u:"16px",onChange:e=>g({gapIconLabel:e}),units:[{a11yLabel:"Pixels (px)",label:"px",step:1,value:"px"}]})),(0,i.createElement)(c.PanelBody,{title:(0,o.__)("Divider","otter-blocks")},(0,i.createElement)(c.ToggleControl,{label:(0,o.__)("Enable Divider","otter-blocks"),checked:Boolean(p.hasDivider),onChange:()=>g({hasDivider:!p.hasDivider})}),p.hasDivider&&(0,i.createElement)(i.Fragment,null,(0,i.createElement)(c.__experimentalUnitControl,{label:(0,o.__)("Width","otter-blocks"),value:null!==(b=p.dividerWidth)&&void 0!==b?b:"2px",onChange:e=>g({dividerWidth:e}),units:[{a11yLabel:"Pixels (px)",label:"px",step:1,value:"px"}],max:5}),(0,i.createElement)("br",null),(0,i.createElement)(c.__experimentalUnitControl,{label:(0,o.__)("Length","otter-blocks"),value:null!==(m=p.dividerLength)&&void 0!==m?m:"100%",onChange:e=>g({dividerLength:e}),isResetValueOnUnitChange:!0}))))))};const{attributes:Ml}=xl;var Bl=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"themeisle-blocks/icon-list-item","title":"Icon List Item","category":"themeisle-blocks","description":"Display an item for the icon list. Powered by Otter.","keywords":["icon","list","items"],"parent":["themeisle-blocks/icon-list"],"textdomain":"otter-blocks","attributes":{"id":{"type":"string"},"content":{"type":"string"},"contentColor":{"type":"string"},"iconColor":{"type":"string"},"library":{"type":"string"},"iconPrefix":{"type":"string"},"icon":{"type":"string"}}}'),zl=e=>{let{attributes:t,setAttributes:l}=e;return(0,i.createElement)(s.InspectorControls,null,(0,i.createElement)(c.PanelBody,{title:(0,o.__)("Settings","otter-blocks")},(0,i.createElement)(_.Z,{label:(0,o.__)("Icon Picker","otter-blocks"),library:t.library,prefix:t.iconPrefix,icon:t.icon,changeLibrary:e=>{l({library:e,icon:void 0,iconPrefix:"fab"})},onChange:e=>{if("image"===t.library&&null!=e&&e.url)return l({icon:e.url});l("object"==typeof e?{icon:e.name,iconPrefix:e.prefix}:{icon:e})},allowImage:!0})),(0,i.createElement)(s.PanelColorSettings,{title:(0,o.__)("Color","otter-blocks"),initialOpen:!0,colorSettings:[{value:t.contentColor,onChange:e=>l({contentColor:e}),label:(0,o.__)("Content Color","otter-blocks")},..."image"!==t.library?[{value:t.iconColor,onChange:e=>l({iconColor:e}),label:(0,o.__)("Icon Color","otter-blocks")}]:[]]}))};const{attributes:Pl}=Bl;const{name:Ll}=Bl;(0,a.registerBlockType)(Ll,{...Bl,title:(0,o.__)("Icon List Item","otter-blocks"),description:(0,o.__)("Display an item for the icon list. Powered by Otter.","otter-blocks"),icon:r.faIcon,keywords:["item","icon","list"],merge(e,t){return{content:(e.content||"")+(t.content||"")}},edit:e=>{var t,l;let{attributes:n,setAttributes:r,name:c,clientId:d,onReplace:u,onRemove:b,mergeBlocks:m}=e;const[p,h]=(0,i.useState)(!1),{hasParent:y,parentAttributes:k}=(0,v.useSelect)((e=>{const{getBlock:t,getBlockRootClientId:l}=e("core/block-editor"),o=t(l(d));return{hasParent:!!o,parentAttributes:o?o.attributes:{}}}),[]);(0,i.useEffect)((()=>{const e=(0,L.blockInit)(d,Pl);return()=>e(n.id)}),[n.id]),(0,i.useEffect)((()=>{r({library:n.library||k.defaultLibrary,icon:n.icon||k.defaultIcon,iconPrefix:n.iconPrefix||k.defaultPrefix})}),[y,k,n]),(0,i.useEffect)((()=>{if("image"===n.library)try{const e=new URL(n.icon);"http:"!==(null==e?void 0:e.protocol)&&"https:"!==(null==e?void 0:e.protocol)||h(!0)}catch(e){h(!1)}}),[n.library,n.icon]);const f=we.ZP.icons[n.icon],_=`${n.iconPrefix||k.defaultPrefix} fa-${n.icon||k.defaultIcon}`,w={"--content-color":null!==(t=n.contentColor)&&void 0!==t?t:k.defaultContentColor,"--icon-color":null!==(l=n.iconColor)&&void 0!==l?l:k.defaultIconColor},C=(0,s.useBlockProps)({style:w});return(0,i.createElement)(i.Fragment,null,(0,i.createElement)(zl,{attributes:n,setAttributes:r}),(0,i.createElement)("div",C,"image"===n.library&&p?(0,i.createElement)("img",{src:n.icon}):"themeisle-icons"===n.library&&n.icon&&void 0!==f?(0,i.createElement)(f,{className:g()({"wp-block-themeisle-blocks-icon-list-item-icon":!n.iconColor},{"wp-block-themeisle-blocks-icon-list-item-icon-custom":n.iconColor})}):(0,i.createElement)("i",{className:g()(_,{"wp-block-themeisle-blocks-icon-list-item-icon":!n.iconColor},{"wp-block-themeisle-blocks-icon-list-item-icon-custom":n.iconColor})}),(0,i.createElement)(s.RichText,{identifier:"content",tagName:"p",placeholder:(0,o.__)("Write your content…","otter-blocks"),className:g()({"wp-block-themeisle-blocks-icon-list-item-content":!n.contentColor},{"wp-block-themeisle-blocks-icon-list-item-content-custom":n.contentColor}),value:n.content,onChange:e=>{r({content:e})},onSplit:e=>e?(0,a.createBlock)(c,{...n,content:e}):(0,a.createBlock)(c),onMerge:m,onReplace:u,onRemove:b})))},save:e=>{let{attributes:t}=e;const l=`${t.iconPrefix} fa-${t.icon}`,o=we.ZP.icons[t.icon],a=s.useBlockProps.save({id:t.id});return(0,i.createElement)("div",a,"image"===t.library&&t.icon?(0,i.createElement)("img",{src:t.icon}):"themeisle-icons"===t.library&&t.icon?(0,i.createElement)(o,{className:g()({"wp-block-themeisle-blocks-icon-list-item-icon":!t.iconColor},{"wp-block-themeisle-blocks-icon-list-item-icon-custom":t.iconColor})}):(0,i.createElement)("i",{className:g()(l,{"wp-block-themeisle-blocks-icon-list-item-icon":!t.iconColor},{"wp-block-themeisle-blocks-icon-list-item-icon-custom":t.iconColor})}),(0,i.createElement)(s.RichText.Content,{tagName:"p",className:g()({"wp-block-themeisle-blocks-icon-list-item-content":!t.contentColor},{"wp-block-themeisle-blocks-icon-list-item-content-custom":t.contentColor}),value:t.content}))}});const{name:Rl}=xl;(0,a.registerBlockType)(Rl,{...xl,title:(0,o.__)("Icon List","otter-blocks"),description:(0,o.__)("Display an icon list in a beautiful layout. Powered by Otter.","otter-blocks"),icon:r.faIcon,keywords:["icon","list","items"],edit:e=>{let{attributes:t,setAttributes:l,clientId:o,className:a}=e;(0,i.useEffect)((()=>{const e=(0,L.blockInit)(o,Ml);return()=>e(t.id)}),[t.id]);const{responsiveGetAttributes:n}=S(l),r={"--icon-align":n([t.horizontalAlign,t.alignmentTablet,t.alignmentMobile]),"--icon-align-tablet":t.alignmentTablet,"--icon-align-mobile":t.alignmentMobile,"--gap":(0,x.Yj)(t.gap),"--gap-icon-label":t.gapIconLabel,"--font-size":(0,x.Yj)(t.defaultSize),"--icon-size":t.defaultIconSize,"--label-visibility":t.hideLabels?"none":void 0,"--divider-color":t.dividerColor,"--divider-width":t.dividerWidth,"--divider-length":t.dividerLength,"--divider-margin-left":t.horizontalAlign?"auto":void 0,"--divider-margin-right":"flex-end"===t.horizontalAlign?"0":void 0,"--divider-margin-left-tablet":t.alignmentTablet?"auto":void 0,"--divider-margin-right-tablet":"flex-end"===t.alignmentTablet?"0":void 0,"--divider-margin-left-mobile":t.alignmentMobile?"auto":void 0,"--divider-margin-right-mobile":"flex-end"===t.alignmentMobile?"0":void 0},c=(0,s.useBlockProps)({id:t.id,style:r,className:g()(a,{"has-divider":Boolean(t.hasDivider)})});return(0,i.createElement)(i.Fragment,null,(0,i.createElement)(Sl,{attributes:t,setAttributes:l}),(0,i.createElement)(Tl,{attributes:t,setAttributes:l}),(0,i.createElement)("div",c,(0,i.createElement)(s.InnerBlocks,{allowedBlocks:["themeisle-blocks/icon-list-item"],__experimentalMoverDirection:"vertical",orientation:"vertical",template:[["themeisle-blocks/icon-list-item"]],renderAppender:s.InnerBlocks.DefaultAppender})))},save:e=>{let{attributes:t,className:l}=e;const o=s.useBlockProps.save({id:t.id,className:g()(l,{"has-divider":Boolean(t.hasDivider)})});return(0,i.createElement)("div",o,(0,i.createElement)(s.InnerBlocks.Content,null))},example:{innerBlocks:[{name:"themeisle-blocks/icon-list-item",attributes:{content:(0,o.__)("List Item 1","otter-blocks")}},{name:"themeisle-blocks/icon-list-item",attributes:{content:(0,o.__)("List Item 2","otter-blocks")}},{name:"themeisle-blocks/icon-list-item",attributes:{content:(0,o.__)("List Item 3","otter-blocks")}}]}});var Fl=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"themeisle-blocks/leaflet-map","title":"Maps","category":"themeisle-blocks","description":"Display Open Street Maps on your website with Maps block. Powered by Otter.","keywords":["map","opeenstreetmap","location"],"textdomain":"otter-blocks","attributes":{"id":{"type":"string"},"location":{"type":"string","default":"La Sagrada Familia, Barcelona, Spain"},"latitude":{"type":"string","default":"41.4034789"},"longitude":{"type":"string","default":"2.174410333009705"},"bbox":{"type":"string","default":"2.1207046508789067%2C41.34807736149302%2C2.2288513183593754%2C41.45816618938139"},"zoom":{"type":"number"},"height":{"type":["number","string"],"default":"400px"},"heightTablet":{"type":"string"},"heightMobile":{"type":"string"},"markers":{"type":"array","default":[]},"zoomControl":{"type":"boolean","default":true},"draggable":{"type":"boolean","default":true}},"supports":{"align":["wide","full"],"html":false},"editorStyle":"otter-leaflet-map-editor","style":"otter-leaflet-map-style","editorScript":"leaflet-gesture-handling","script":"otter-leaflet"}');async function Al(e){const t=await async function(e){if("string"!=typeof e)throw(0,o.__)("Location must be a string","otter-blocks");const t="https://nominatim.openstreetmap.org/search?q="+e.split(" ").map((e=>encodeURIComponent(e))).join("+")+"&format=geojson",l=await fetch(t);return l.ok&&200===l.status?l.json():console.warn((0,o.__)("An error has occured: ","otter-blocks")+l.status)}(e);if(null!=t&&t.features.length){var l;const e=t.features[0];if(null!=e&&null!==(l=e.geometry)&&void 0!==l&&l.coordinates.length)return{longitude:e.geometry.coordinates[0],latitude:e.geometry.coordinates[1]}}return null}const Hl=e=>{let{value:t,onChange:l}=e;const a=(0,Y.useInstanceId)(Hl);(0,i.useEffect)((()=>{wp.oldEditor.initialize(r.current.id,{tinymce:{classic_block_editor:!0,plugins:"lists,media,paste,tabfocus,wordpress,wpautoresize,wpeditimage,wpgallery,wplink,wpdialogs,wptextpattern,wpview",toolbar1:"formatselect,bold,italic,bullist,numlist,alignleft,aligncenter,alignright,link,unlink,spellchecker,wp_add_media"}});const e=window.tinymce.get(r.current.id);return e.on("change",(()=>l(e.getContent()))),()=>wp.oldEditor.remove(r.current.id)}),[]);const n=`inspector-textarea-control-${a}`,r=(0,i.useRef)(null);return(0,i.createElement)(c.BaseControl,{id:n,label:(0,o.__)("Description","otter-blocks")},(0,i.createElement)("textarea",{id:n,className:"components-textarea-control__input",rows:4,value:t,onChange:e=>l(e.target.value),ref:r}))};var Ol=Hl,Nl=e=>{let{marker:t,isOpen:l,openMarker:a,dispatch:n}=e;const[r,s]=(0,i.useState)(t.location),[d,u]=(0,i.useState)(t.longitude),[b,m]=(0,i.useState)(t.latitude),[p,h]=(0,i.useState)(t.title),[v,y]=(0,i.useState)(t.description),[k,f]=(0,i.useState)({target:"",reason:""});return(0,i.createElement)("div",{className:"wp-block-themeisle-blocks-leaflet-map-marker"},(0,i.createElement)("div",{className:"wp-block-themeisle-blocks-leaflet-map-marker-title-area"},(0,i.createElement)(c.Button,{className:"wp-block-themeisle-blocks-leaflet-map-marker-title",onClick:()=>a()},t.title||(0,o.__)("Custom Marker","otter-blocks")),(0,i.createElement)(c.Button,{icon:"no-alt",label:(0,o.__)("Remove Marker","otter-blocks"),showTooltip:!0,className:"wp-block-themeisle-blocks-leaflet-map-marker-remove",onClick:()=>n({type:Gl.REMOVE,ids:[t.id]})})),l&&(0,i.createElement)("div",{className:"wp-block-themeisle-blocks-leaflet-map-marker-control-area"},(0,i.createElement)(c.TextControl,{label:(0,o.__)("Location","otter-blocks"),type:"text",className:g()({"wp-block-themeisle-blocks-leaflet-map-input-error":"LOCATION"===k.target}),value:r,onChange:e=>{s(e)},help:(0,o.__)("Press Enter to search the location","otter-blocks"),onKeyDown:e=>((e,l)=>{e.key===l&&(async()=>{const e=await Al(r);e?(n({type:Gl.UPDATE,ids:[t.id],updatedProps:{location:r,latitude:e.latitude,longitude:e.longitude}}),m(e.latitude),u(e.longitude),"LOCATION"===k.target&&f({})):f({target:"LOCATION",reason:(0,o.__)("Location couldn't been found!","otter-blocks")})})()})(e,"Enter")}),(0,i.createElement)(c.TextControl,{label:(0,o.__)("Latitude","otter-blocks"),type:"text",value:b,onChange:e=>{m(e),n({type:Gl.UPDATE,ids:[t.id],updatedProps:{latitude:e}})}}),(0,i.createElement)(c.TextControl,{label:(0,o.__)("Longitude","otter-blocks"),type:"text",value:d,onChange:e=>{u(e),n({type:Gl.UPDATE,ids:[t.id],updatedProps:{longitude:e}})}}),(0,i.createElement)(c.TextControl,{label:(0,o.__)("Title","otter-blocks"),type:"text",value:p,onChange:e=>{h(e),n({type:Gl.UPDATE,ids:[t.id],updatedProps:{title:e}})}}),(0,i.createElement)(Ol,{label:(0,o.__)("Description","otter-blocks"),type:"text",value:t.description,onChange:e=>{y(v),n({type:Gl.UPDATE,ids:[t.id],updatedProps:{description:e}})}})))},Vl=e=>{let{markers:t,dispatch:l,markersInteraction:a}=e;const{openMarker:n,setOpenMarker:r}=a;return(0,i.createElement)(i.Fragment,null,(0,i.createElement)("div",{className:"wp-block-themeisle-blocks-leaflet-map-marker-group"},t.map((e=>(0,i.createElement)(Nl,{key:e.id,marker:e,isOpen:n===e.id,openMarker:()=>r(a.openMarker!==e.id?e.id:null),dispatch:l})))),(0,i.createElement)(c.Button,{isSecondary:!0,className:"wp-block-themeisle-blocks-leaflet-map-marker-add",onClick:()=>{l({type:Gl.ADD,marker:{id:(0,dl.Z)()},dispatch:l})}},(0,o.__)("Add Marker","otter-blocks")))},Il=e=>{let{attributes:t,setAttributes:l,dispatch:a,markersInteraction:n}=e;const[r,d]=(0,i.useState)(t.location),[u,b]=(0,i.useState)({target:"",reason:""}),{responsiveSetAttributes:m,responsiveGetAttributes:p}=S(l);return(0,i.createElement)(s.InspectorControls,null,(0,i.createElement)(c.PanelBody,{title:(0,o.__)("Location","otter-blocks")},(0,i.createElement)(c.TextControl,{label:(0,o.__)("Location","otter-blocks"),type:"text",className:g()({"wp-block-themeisle-blocks-leaflet-map-input-error":"LOCATION"===u.target}),placeholder:(0,o.__)("Enter location. E.g: La Sagrada Familia, Barcelona, Spain","otter-blocks"),help:(0,o.__)("Press Enter to search the location","otter-blocks"),value:r,onChange:d,onKeyDown:e=>((e,t)=>{e.key===t&&(async()=>{l({location:r});const e=await Al(r);e?(l({latitude:e.latitude.toString(),longitude:e.longitude.toString()}),"LOCATION"===u.target&&b({})):b({target:"LOCATION",reason:(0,o.__)("Location couldn't been found!","otter-blocks")})})()})(e,"Enter")}),(0,i.createElement)(c.TextControl,{label:(0,o.__)("Latitude","otter-blocks"),type:"text",placeholder:(0,o.__)("Enter latitude…","otter-blocks"),value:t.latitude,onChange:e=>{l({latitude:e.toString()})}}),(0,i.createElement)(c.TextControl,{label:(0,o.__)("Longitude","otter-blocks"),type:"text",placeholder:(0,o.__)("Enter longitude","otter-blocks"),value:t.longitude,onChange:e=>{l({longitude:e.toString()})}})),(0,i.createElement)(c.PanelBody,{title:(0,o.__)("Positioning & Zooming","otter-blocks"),initialOpen:!1},(0,i.createElement)(c.RangeControl,{label:(0,o.__)("Map Zoom Level","otter-blocks"),value:t.zoom,onChange:e=>{l({zoom:e})},min:0,max:20}),(0,i.createElement)(M.Z,{label:(0,o.__)("Height","otter-blocks")},(0,i.createElement)(c.__experimentalUnitControl,{value:p([(h=t.height,(0,K.isNumber)(h)?(e=>e?`${e}px`:e)(h):h),t.heightTablet,t.heightMobile]),onChange:e=>m(e,["height","heightTablet","heightMobile"])}),(0,i.createElement)(k.Z,{values:["height","heightTablet","heightMobile"],setAttributes:l}))),(0,i.createElement)(c.PanelBody,{title:(0,o.__)("Controls","otter-blocks"),initialOpen:!1},(0,i.createElement)(c.BaseControl,null,(0,o.__)("The following changes will not affect block preview during the editing process. You can click outside the block to see the changes take effect.","otter-blocks")),(0,i.createElement)(c.ToggleControl,{label:(0,o.__)("Draggable Map","otter-blocks"),checked:t.draggable,onChange:()=>{l({draggable:!t.draggable})}}),(0,i.createElement)(c.ToggleControl,{label:(0,o.__)("Zoom Control","otter-blocks"),checked:t.zoomControl,onChange:()=>{l({zoomControl:!t.zoomControl})}})),(0,i.createElement)(c.PanelBody,{title:(0,o.__)("Markers","otter-blocks"),initialOpen:!1},(0,i.createElement)(Vl,{markers:t.markers,dispatch:a,markersInteraction:n})));var h};const{attributes:Dl}=Fl,Gl={ADD:"ADD",ADD_MANUAL:"ADD_MANUAL",REMOVE:"REMOVE",UPDATE:"UPDATE",INIT:"INIT"};const $l={to:[{type:"block",blocks:["themeisle-blocks/google-map"],transform:e=>{const t=e;return(0,a.createBlock)("themeisle-blocks/google-map",{...t})}}]};var Wl=$l;const{name:Zl}=Fl;(0,a.registerBlockType)(Zl,{...Fl,title:(0,o.__)("Maps","otter-blocks"),description:(0,o.__)("Display Open Street Maps on your website with Maps block. Powered by Otter.","otter-blocks"),icon:r.mapIcon,keywords:["map","opeenstreetmap","location"],transforms:Wl,edit:e=>{let{clientId:t,attributes:l,setAttributes:a}=e;(0,i.useEffect)((()=>{const e=(0,L.blockInit)(t,Dl);return()=>e(l.id)}),[l.id]);const{responsiveGetAttributes:n}=S(),r=(0,i.useRef)(null),[c,d]=(0,i.useState)(null),[u,b]=(0,i.useState)(!1),[m,p]=(0,i.useState)(null),g=(e,t)=>{if(window.L&&c&&t&&e){var l,a,n,r,i;null!==(l=e.id)&&void 0!==l||(e.id=(0,dl.Z)()),null!==(a=e.latitude)&&void 0!==a||(e.latitude=c.getCenter().lat),null!==(n=e.longitude)&&void 0!==n||(e.longitude=c.getCenter().lng),null!==(r=e.title)&&void 0!==r||(e.title=(0,o.__)("Add a title","otter-blocks")),null!==(i=e.description)&&void 0!==i||(e.description="");const s=window.L.marker([e.latitude,e.longitude]||0,{draggable:!0});return s.on("movestart",(()=>{s.closeTooltip(),s.closePopup()})),s.on("moveend",(()=>{const l=s.getLatLng();t({type:Gl.UPDATE,ids:[e.id],updatedProps:{latitude:l.lat,longitude:l.lng}})})),s.on("click",(()=>{p(e.id)})),s.markerProps=e,s}return null},[h,v]=(0,i.useReducer)(((e,t)=>{switch(t.type){case Gl.ADD:const l=g(t.marker,t.dispatch);return[...e,l];case Gl.ADD_MANUAL:if(u){const l=g(t.marker,t.dispatch);return[...e,l]}return e;case Gl.REMOVE:return e.filter((e=>{let{markerProps:l}=e;return t.ids.includes(l.id)})).forEach((e=>{c.hasLayer(e)&&c.removeLayer(e)})),e.filter((e=>{let{markerProps:l}=e;return!t.ids.includes(l.id)}));case Gl.INIT:const a=t.markers.map((e=>g(e,t.dispatch)));return[...e,...a];case Gl.UPDATE:return e.map((e=>{const l=e.markerProps;return t.ids.includes(l.id)&&(e.markerProps=(0,K.merge)(e.markerProps,t.updatedProps)),e}));default:console.warn((0,o.__)("The action for the leaflet block do not have a defined action in marker's reducer: ","otter-blocks")+t.type)}return e}),[],(()=>[])),y=()=>{if(!r.current&&!window.L)return;let{L:e}=window;const t=(0,L.getEditorIframe)();var n;if(Boolean(t)&&(e=null===(n=t.contentWindow)||void 0===n?void 0:n.L),!e)return;r.current.innerHTML="";const i=e.map(r.current,{gestureHandling:!0,gestureHandlingOptions:{text:{touch:(0,o.__)("Use two fingers to move the map","otter-blocks"),scroll:(0,o.__)("Use ctrl + scroll to zoom the map","otter-blocks"),scrollMac:(0,o.__)("Use ⌘ + scroll to zoom the map","otter-blocks")}}});e.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",{attribution:'&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a>',subdomains:["a","b","c"]}).addTo(i),i.on("zoom",(()=>{a({zoom:i.getZoom()})})),i.on("moveend",(()=>{const e=i.getCenter();a({latitude:e.lat.toString(),longitude:e.lng.toString()})})),i.on("click",(e=>{v({type:Gl.ADD_MANUAL,marker:{latitude:e.latlng.lat,longitude:e.latlng.lng},dispatch:v}),b(!1)})),e.Control.AddMarker=e.Control.extend({onAdd:()=>{const t=e.DomUtil.create("button","wp-block-themeisle-blocks-leaflet-map-marker-button"),l=e.DomUtil.create("span","dashicons dashicons-sticky",t);return e.DomEvent.on(t,"click",(t=>{e.DomEvent.stopPropagation(t),b(!u)})),t.title=(0,o.__)("Add marker on the map with a click","otter-blocks"),t.appendChild(l),t},onRemove:()=>{}}),e.control.addmarker=t=>new e.Control.AddMarker(t),e.control.addmarker({position:"bottomleft"}).addTo(i),d(i),v({type:Gl.INIT,markers:l.markers,dispatch:v})};(0,i.useEffect)((()=>{(0,L.getEditorIframe)()?((0,L.copyScriptAssetToIframe)("#leaflet-js",(()=>{y()})),(0,L.copyScriptAssetToIframe)("#leaflet-gesture-handling-js",(()=>{}))):y()}),[]),(0,i.useEffect)((()=>{l.height&&c&&c.invalidateSize(!0)}),[l.height,c]),(0,i.useEffect)((()=>{l.latitude&&l.longitude&&c&&c.setView([l.latitude,l.longitude],l.zoom||15)}),[l.latitude,l.longitude,l.zoom,c]),(0,i.useEffect)((()=>{var e;null===(e=r.current)||void 0===e||e.classList.toggle("is-selecting-location",u)}),[u]),(0,i.useEffect)((()=>{l.latitude&&l.longitude&&c&&a({bbox:c.getBounds().toBBoxString()})}),[l.latitude,l.longitude,c]),(0,i.useEffect)((()=>{h&&(h.forEach((e=>{c.hasLayer(e)||c.addLayer(e);const{markerProps:t}=e;e.setLatLng([t.latitude,t.longitude]),e.closeTooltip(),e.unbindTooltip(),e.bindTooltip(t.title,{direction:"auto"}),e.closePopup(),e.unbindPopup(),e.bindPopup(((e,t)=>{const l=document.createElement("div"),a=document.createElement("h6"),n=document.createElement("div"),r=document.createElement("p"),i=document.createElement("button");return a.innerHTML=e.title,r.innerHTML=e.description,i.onclick=()=>t({type:Gl.REMOVE,ids:[e.id]}),i.innerHTML=(0,o.__)("Delete Marker","otter-blocks"),l.classList.add("wp-block-themeisle-blocks-map-overview"),n.classList.add("wp-block-themeisle-blocks-map-overview-content"),a.classList.add("wp-block-themeisle-blocks-map-overview-title"),i.classList.add("wp-block-themeisle-blocks-map-overview-delete"),l.appendChild(a),l.appendChild(n),l.appendChild(i),n.appendChild(r),l})(t,v))})),l.markers.length!==h.length&&c&&a({markers:h.map((e=>{let{markerProps:t}=e;return t}))}))}),[h,c,l.markers]);const k=(0,s.useBlockProps)();return(0,i.createElement)(i.Fragment,null,(0,i.createElement)(Il,{attributes:l,setAttributes:a,dispatch:v,markersInteraction:{openMarker:m,setOpenMarker:p}}),(0,i.createElement)("div",k,(0,i.createElement)("div",{id:l.id,ref:r,style:{width:"100%",height:n([(f=l.height||400,(0,K.isNumber)(f)?(e=>e?`${e}px`:e)(f):f),l.heightTablet,l.heightMobile])}})));var f},save:()=>null,example:{attributes:{}}});var jl=l(2553),Ul=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"themeisle-blocks/lottie","title":"Lottie Animation","category":"themeisle-blocks","description":"Add Lottie animations to your WordPress. Powered by Otter.","keywords":["media","lottie","animation"],"textdomain":"otter-blocks","attributes":{"id":{"type":"string"},"file":{"type":"object"},"trigger":{"type":"string","default":"none"},"loop":{"type":"boolean","default":false},"count":{"type":"number","default":0},"speed":{"type":"number","default":1},"direction":{"type":"boolean","default":false},"width":{"type":["string","number"]},"ariaLabel":{"type":"string","default":""},"backgroundColor":{"type":"string"},"backgroundGradient":{"type":"string"}},"supports":{"align":["left","center","right"]},"editorStyle":"otter-lottie-editor","editorScript":["lottie-player","dotlottie-player"],"script":"otter-lottie"}'),ql=e=>{var t;let{className:l,file:a,onChange:n,attributes:r}=e;const[d,u]=(0,i.useState)((null===(t=r.file)||void 0===t?void 0:t.url)||null);return Boolean(window.themeisleGutenberg.isWPVIP)?(0,i.createElement)(c.Placeholder,{label:(0,o.__)("Lottie","otter-blocks"),instructions:(0,o.__)("Add Lottie animations and files to your website. You need to use a .json file.","otter-blocks"),icon:(0,i.createElement)(s.BlockIcon,{icon:jl.Z}),className:l},(0,i.createElement)("form",{onSubmit:e=>(e&&e.preventDefault(),n(d))},(0,i.createElement)("input",{type:"url",value:d||"",className:"components-placeholder__input","aria-label":(0,o.__)("Lottie","otter-blocks"),placeholder:(0,o.__)("Enter URL to embed here…","otter-blocks"),onChange:e=>u(e.target.value)}),(0,i.createElement)(c.Button,{isPrimary:!0,disabled:!d,type:"submit"},(0,o.__)("Embed","otter-blocks")))):(0,i.createElement)(s.MediaPlaceholder,{labels:{title:(0,o.__)("Lottie","otter-blocks"),instructions:(0,o.__)("Add Lottie animations and files to your website.","otter-blocks")},icon:(0,i.createElement)(s.BlockIcon,{icon:jl.Z}),accept:["application/json",".lottie"],allowedTypes:["application/json"],value:{...a},onSelectURL:n,onSelect:n})},Jl=e=>{let{attributes:t,setAttributes:l,playerRef:a}=e;return(0,i.createElement)(i.Fragment,null,(0,i.createElement)(s.InspectorControls,null,(0,i.createElement)(c.PanelBody,{title:(0,o.__)("Settings","otter-blocks"),initialOpen:!0},(0,i.createElement)(c.SelectControl,{label:(0,o.__)("Trigger","otter-blocks"),help:(0,o.__)("Animation trigger. This will only work on the front-end.","otter-blocks"),value:t.trigger,options:[{label:(0,o.__)("Autoplay","otter-blocks"),value:"none"},{label:(0,o.__)("Scroll","otter-blocks"),value:"scroll"},{label:(0,o.__)("Hover","otter-blocks"),value:"hover"},{label:(0,o.__)("Click","otter-blocks"),value:"click"}],onChange:e=>{l({trigger:e})}}),"scroll"!==t.trigger&&(0,i.createElement)(i.Fragment,null,(0,i.createElement)(c.ToggleControl,{label:(0,o.__)("Loop","otter-blocks"),help:(0,o.__)("Whether to loop animation.","otter-blocks"),checked:t.loop,onChange:e=>{l({loop:e}),a.current.setLooping(e),t.direction&&a.current.seek("100%"),a.current.play()}}),t.loop&&(0,i.createElement)(c.TextControl,{label:(0,o.__)("Numbers of loops","otter-blocks"),help:(0,o.__)("Number of times to loop animation.","otter-blocks"),type:"number",value:t.count,onChange:e=>{l({count:Number(e)}),a.current.load(t.file.url)}}),(0,i.createElement)(c.RangeControl,{label:(0,o.__)("Speed","otter-blocks"),help:(0,o.__)("Animation speed.","otter-blocks"),value:t.speed,onChange:e=>{l({speed:Number(e)}),a.current.setSpeed(e)},step:.1,min:.1,max:5}),(0,i.createElement)(c.ToggleControl,{label:(0,o.__)("Reverse","otter-blocks"),help:(0,o.__)("Direction of animation.","otter-blocks"),checked:t.direction,onChange:e=>{l({direction:e}),a.current.setDirection(e?-1:1),a.current.seek(e?"100%":0)}})),(0,i.createElement)(s.__experimentalUnitControl,{onChange:e=>{const t=parseInt(e.slice(0,-1)),o=e.slice(-1);100<t&&"%"===o&&(e="100%"),l({width:e})},label:(0,o.__)("Width","otter-blocks"),isUnitSelectTabbable:!0,isResetValueOnUnitChange:!0,__unstableInputWidth:"50%",value:Number.isInteger(t.width)?`${t.width}px`:t.width,units:[{value:"%",label:"%",default:100},{value:"px",label:"px",default:300}]})),(0,i.createElement)(c.PanelBody,{title:(0,o.__)("Background","otter-blocks"),initialOpen:!1},(0,i.createElement)(s.__experimentalColorGradientControl,{colorValue:t.backgroundColor,gradientValue:t.backgroundGradient,onColorChange:e=>l({backgroundColor:e}),onGradientChange:e=>l({backgroundGradient:e}),showTitle:!1,className:"otter-lottie-background-control"}))),(0,i.createElement)(s.InspectorAdvancedControls,null,(0,i.createElement)(c.TextControl,{label:(0,o.__)("Aria Label","otter-blocks"),help:(0,o.__)("Describe the purpose of this animation on the page.","otter-blocks"),value:t.ariaLabel,onChange:e=>l({ariaLabel:e})})))},Kl=e=>{let{isEditing:t,setEditing:l}=e;return(0,i.createElement)(s.BlockControls,null,(0,i.createElement)(c.ToolbarGroup,null,(0,i.createElement)(c.Tooltip,{text:t?(0,o.__)("Save","otter-blocks"):(0,o.__)("Edit","otter-blocks")},(0,i.createElement)(c.Button,{onClick:()=>l(!t)},(0,i.createElement)(c.Dashicon,{icon:t?"yes":"edit"})))))},Yl=e=>{let{attributes:t,playerRef:l}=e;(0,i.useEffect)((()=>{const e=(0,L.getEditorIframe)();Boolean(e)?((0,L.copyScriptAssetToIframe)("#lottie-player-js",(()=>{!(0,K.isEmpty)(t.file)&&t.loop&&null!==l.current&&l.current.addEventListener("complete",o)})),(0,L.copyScriptAssetToIframe)("#dotlottie-player-js",(()=>{!(0,K.isEmpty)(t.file)&&t.loop&&null!==l.current&&l.current.addEventListener("complete",o)}))):!(0,K.isEmpty)(t.file)&&t.loop&&null!==l.current&&l.current.addEventListener("complete",o)}),[]);const o=()=>{l.current&&(l.current.setLooping(t.loop),l.current.play(),l.current.removeEventListener("complete",o))};let a=(0,i.createElement)("lottie-player");return t.file.url.endsWith(".lottie")&&(a=(0,i.createElement)("dotlottie-player")),(0,i.cloneElement)(a,{id:t.id,ref:l,src:t.file.url,autoplay:!t.trigger||"none"===t.trigger,loop:t.loop,count:t.direction?-1*t.count:t.count,speed:t.speed,background:t.backgroundColor||t.backgroundGradient,direction:t.direction?-1:1,trigger:t.trigger,"data-loop":t.loop,mode:"normal",style:{width:!(!t.width||"%"===t.width.toString().slice(-1))&&`${t.width}px`,maxWidth:!(!t.width||"%"!==t.width.toString().slice(-1))&&`${t.width}`,height:"auto"},..."hover"===t.trigger&&{hover:"hover"},...t.ariaLabel&&{"aria-label":t.ariaLabel}})};const{attributes:Ql}=Ul;const{name:Xl}=Ul;(0,a.registerBlockType)(Xl,{...Ul,title:(0,o.__)("Lottie Animation","otter-blocks"),description:(0,o.__)("Add Lottie animations to your WordPress. Powered by Otter.","otter-blocks"),icon:jl.Z,keywords:["media","lottie","animation"],edit:e=>{let{attributes:t,setAttributes:l,isSelected:o,clientId:a}=e;const n=(0,i.useRef)(null),[r,c]=(0,i.useState)(!Boolean(t.file));(0,i.useEffect)((()=>{const e=(0,L.blockInit)(a,Ql);return()=>e(t.id)}),[t.id]),(0,i.useEffect)((()=>{var e,l,a,r,i,s;o?(null===(e=n.current)||void 0===e||null===(l=e.play)||void 0===l||l.call(e),t.direction&&(null===(a=n.current)||void 0===a||null===(r=a.seek)||void 0===r||r.call(a,"100%"))):null===(i=n.current)||void 0===i||null===(s=i.stop)||void 0===s||s.call(i)}),[o]);const d=(0,s.useBlockProps)();return(0,i.createElement)(i.Fragment,null,(!(0,K.isEmpty)(t.file)&&r||!r)&&(0,i.createElement)(Kl,{isEditing:r,setEditing:c}),!((0,K.isEmpty)(t.file)||r)&&(0,i.createElement)(Jl,{attributes:t,setAttributes:l,playerRef:n}),(0,i.createElement)("div",d,((0,K.isEmpty)(t.file)||r)&&(0,i.createElement)(ql,{value:t.file,onChange:e=>{if(""===e||null===e)return;const t=(0,K.pick)(e,["id","url"]);(0,K.isEmpty)(t)&&(t.url=e),l({file:{...t}}),c(!1)},attributes:t}),!((0,K.isEmpty)(t.file)||r)&&(0,i.createElement)(Yl,{attributes:t,isSelected:o,playerRef:n})))},save:e=>{let{attributes:t}=e;const l=s.useBlockProps.save({id:t.id,...t.file.url.endsWith(".lottie")?{"data-src":t.file?t.file.url:""}:{src:t.file?t.file.url:""},width:t.width});let o=(0,i.createElement)("lottie-player");return t.file.url.endsWith(".lottie")&&(o=(0,i.createElement)("dotlottie-player")),o=(0,i.cloneElement)(o,{trigger:t.trigger,background:t.backgroundColor||t.backgroundGradient,...t.ariaLabel&&{"aria-label":t.ariaLabel},...l}),"scroll"===t.trigger?o:(0,i.cloneElement)(o,{autoplay:!0,loop:!0,count:t.direction?-1*t.count:t.count,speed:t.speed,direction:t.direction?-1:1,trigger:t.trigger,"data-loop":t.loop,mode:"normal",..."hover"===t.trigger&&{hover:"hover"}})},example:{viewportWidth:1200,attributes:{id:"wp-block-themeisle-blocks-lottie-2",file:{url:"https://assets8.lottiefiles.com/packages/lf20_kd5rzej5.json"}}}});var eo=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"themeisle-blocks/plugin-cards","title":"Plugin Card","category":"themeisle-blocks","description":"Plugin Card block lets you display plugins data in your blog posts. Powered by Otter.","keywords":["plugin","card","orbitfox"],"textdomain":"otter-blocks","attributes":{"slug":{"type":"string"}},"supports":{"html":false},"editorStyle":"otter-plugin-card-editor","style":"otter-plugin-card-style"}'),to=l(9630),lo=e=>{let{setAttributes:t,hasError:l,setError:a,className:n}=e;const[r,s]=(0,i.useState)(!1),[d,u]=(0,i.useState)(""),[b,m]=(0,i.useState)({}),[p,g]=(0,i.useState)(null),h=e=>{if(Object.keys(b).length){e.stopPropagation(),e.preventDefault();const t=p?p-1:Object.keys(b).length-1;g(t)}},v=e=>{if(Object.keys(b).length){e.stopPropagation(),e.preventDefault();const t=null===p||p===Object.keys(b).length-1?0:p+1;g(t)}},y=e=>{t({slug:e.slug}),m({})};return(0,i.createElement)(c.Placeholder,{icon:"admin-plugins",label:(0,o.__)("Plugin Card","otter-blocks"),instructions:(0,o.__)("Search for the plugin you want to display.","otter-blocks"),className:n},(0,i.createElement)("div",{className:"o-plugin-cards-search-field"},(0,i.createElement)(c.Dashicon,{icon:"search"}),r&&(0,i.createElement)(c.Spinner,null),(0,i.createElement)(c.TextControl,{type:"text",placeholder:(0,o.__)("Search for plugin…","otter-blocks"),value:d,onChange:u,onKeyDown:e=>{switch(e.keyCode){case to.UP:h(e);break;case to.DOWN:v(e);break;case to.TAB:Object.keys(b).length&&!e.shiftKey&&g(0);break;case to.ENTER:(async e=>{t({slug:""}),s(!0),a(!1);const l=await It()({path:`otter/v1/plugins?search=${encodeURIComponent(e)}`});if(l.data.errors)return a(!0),s(!1),g(null),void m({});s(!1),g(null),m(l.data.plugins)})(e.target.value)}},onFocus:()=>g(null)}),b&&(0,i.createElement)("div",{tabIndex:"-1",className:"o-plugin-cards-search-results"},Object.keys(b).map((e=>{const t=b[e];let l;return t.icons.svg&&(l=t.icons.svg),t.icons["2x"]&&(l=t.icons["2x"]),t.icons["1x"]&&(l=t.icons["1x"]),t.icons.default&&(l=t.icons.default),(0,i.createElement)("button",{className:"o-plugin-cards-list-item",key:e,onClick:e=>{e.preventDefault(),y(t)},onKeyDown:e=>((e,t)=>{switch(e.keyCode){case to.UP:h(e);break;case to.DOWN:v(e);break;case to.TAB:if(e.shiftKey){0!==p&&h(e);break}if(p===Object.keys(b).length-1)break;v(e);break;case to.ENTER:y(t)}})(e,t)},(0,i.createElement)("img",{src:l}),(0,i.createElement)("span",{dangerouslySetInnerHTML:{__html:(0,K.unescape)(t.name)}}))})))),l&&(0,i.createElement)("div",{className:"o-plugin-cards-error"},(0,i.createElement)("span",null,(0,o.__)("There seems to be an error. Make sure your internet is working properly.","otter-blocks"))))},oo=e=>{let{setAttributes:t}=e;return(0,i.createElement)(s.BlockControls,null,(0,i.createElement)(c.ToolbarGroup,null,(0,i.createElement)(c.Tooltip,{text:(0,o.__)("Edit","otter-blocks")},(0,i.createElement)(c.Button,{className:"components-icon-button components-toolbar__control o-plugin-cards-edit-plugin-card",onClick:()=>t({slug:void 0})},(0,i.createElement)(c.Dashicon,{icon:"edit"})))))};const{name:ao}=eo;(0,a.registerBlockType)(ao,{...eo,title:(0,o.__)("Plugin Card","otter-blocks"),description:(0,o.__)("Plugin Card block lets you display plugins data in your blog posts. Powered by Otter.","otter-blocks"),icon:r.pluginsIcon,keywords:["plugin","card","orbitfox"],edit:e=>{let{attributes:t,setAttributes:l}=e;const[o,a]=(0,i.useState)(!1),n=(0,s.useBlockProps)();return t.slug?(0,i.createElement)(i.Fragment,null,(0,i.createElement)(oo,{setAttributes:l}),(0,i.createElement)("div",n,(0,i.createElement)(c.Disabled,null,(0,i.createElement)(u(),{block:"themeisle-blocks/plugin-cards",attributes:{...t}})))):(0,i.createElement)("div",n,(0,i.createElement)(lo,{attributes:t,setAttributes:l,hasError:o,setError:a}))},save:()=>null,example:{attributes:{slug:"otter-blocks"}}});var no=l(7682),ro=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"themeisle-blocks/popup","title":"Popup","category":"themeisle-blocks","description":"Display your content in beautiful popup with many customization options. Powered by Otter.","keywords":["popup","modal","lightbox"],"textdomain":"otter-blocks","attributes":{"id":{"type":"string"},"minWidth":{"type":["number","string"]},"maxWidth":{"type":["number","string"]},"trigger":{"type":"string"},"wait":{"type":"number"},"anchor":{"type":"string"},"scroll":{"type":"number"},"showClose":{"type":"boolean","default":true},"outsideClose":{"type":"boolean","default":true},"anchorClose":{"type":"boolean","default":false},"closeAnchor":{"type":"string"},"recurringClose":{"type":"boolean","default":false},"recurringTime":{"type":"number"},"backgroundColor":{"type":"string"},"closeColor":{"type":"string"},"overlayColor":{"type":"string"},"overlayOpacity":{"type":"number"},"lockScrolling":{"type":"boolean"},"padding":{"type":"object"},"paddingTablet":{"type":"object"},"paddingMobile":{"type":"object"},"borderWidth":{"type":"object"},"borderRadius":{"type":"object"},"borderColor":{"type":"string"},"borderStyle":{"type":"string"},"width":{"type":"string"},"widthTablet":{"type":"string"},"widthMobile":{"type":"string"},"heightMode":{"type":"string"},"height":{"type":"string"},"heightTablet":{"type":"string"},"heightMobile":{"type":"string"},"verticalPosition":{"type":"string"},"horizontalPosition":{"type":"string"},"verticalPositionTablet":{"type":"string"},"horizontalPositionTablet":{"type":"string"},"verticalPositionMobile":{"type":"string"},"horizontalPositionMobile":{"type":"string"},"closeButtonType":{"type":"string"},"boxShadow":{"type":"object","default":{"active":false,"colorOpacity":50,"blur":5,"spread":1,"horizontal":0,"vertical":0}},"disableOn":{"type":"string"}},"editorStyle":"otter-popup-editor","style":"otter-popup-style","script":"otter-popup"}'),io=l(6755),so=l(7231);const co=()=>(0,i.createElement)(i.Fragment,null,(0,i.createElement)(c.Disabled,null,(0,i.createElement)(c.ToggleControl,{label:(0,o.__)("Close On Anchor Click","otter-blocks"),checked:!1,onChange:()=>{},className:"o-disabled"}),(0,i.createElement)(c.ToggleControl,{label:(0,o.__)("Dismiss for Recurring Visitors","otter-blocks"),checked:!1,onChange:()=>{},className:"o-disabled"})),(0,i.createElement)(De.Z,{notice:(0,i.createElement)(c.ExternalLink,{href:(0,x.Wi)(window.themeisleGutenberg.upgradeLink,"popupblock")},(0,o.__)("Get more options with Otter Pro. ","otter-blocks")),variant:"upsell"}));var uo=e=>{var t,l,a,n,r,d,u,b,m,p,g,h;let{attributes:v,setAttributes:y}=e;const[k,_]=(0,i.useState)("settings"),{responsiveSetAttributes:C,responsiveGetAttributes:E}=S(y);let T=[{label:(0,o.__)("On Load","otter-blocks"),value:"onLoad"},{label:(0,o.__)("On Anchor Click (Pro)","otter-blocks"),value:"onClick",disabled:!0},{label:(0,o.__)("On Scroll (Pro)","otter-blocks"),value:"onScroll",disabled:!0},{label:(0,o.__)("On Exit (Pro)","otter-blocks"),value:"onExit",disabled:!0}];return T=(0,Ie.applyFilters)("otter.popupBlock.triggers",T),(0,i.createElement)(s.InspectorControls,null,(0,Ie.applyFilters)("otter.feedback","","popup-block",(0,o.__)("Help us improve this block","otter-blocks")),(0,i.createElement)(w.Z,{value:k,options:[{label:(0,o.__)("Settings","otter-blocks"),value:"settings"},{label:(0,o.__)("Style","otter-blocks"),value:"style"}],onChange:_}),(0,i.createElement)("div",null,"settings"===k&&(0,i.createElement)(i.Fragment,null,(0,i.createElement)(c.PanelBody,{title:(0,o.__)("Popup settings","otter-blocks")},(0,i.createElement)(c.SelectControl,{label:(0,o.__)("Open Trigger","otter-blocks"),help:!Boolean(window.themeisleGutenberg.hasPro)&&(0,o.__)("You need to have Otter Pro to activate Pro features.","otter-blocks"),options:T,value:v.trigger,onChange:e=>y({trigger:e})}),(void 0===v.trigger||"onLoad"===v.trigger)&&(0,i.createElement)(c.RangeControl,{label:(0,o.__)("Trigger Delay","otter-blocks"),help:(0,o.__)("How much time in seconds to wait before showing the popup.","otter-blocks"),min:0,max:100,value:null!==(t=v.wait)&&void 0!==t?t:0,onChange:e=>y({wait:Number(e)}),allowReset:!0}),(0,i.createElement)(c.ToggleControl,{label:(0,o.__)("Disable Page Scrolling","otter-blocks"),checked:v.lockScrolling,onChange:()=>y({lockScrolling:!v.lockScrolling})}),(0,i.createElement)(c.ToggleControl,{label:(0,o.__)("Show on mobile","otter-blocks"),checked:!Boolean(v.disableOn),onChange:e=>y({disableOn:e?void 0:"mobile"})})),(0,i.createElement)(c.PanelBody,{title:(0,o.__)("Popup Position","otter-blocks"),initialOpen:!1},(0,i.createElement)(M.Z,{label:(0,o.__)("Screen Type","otter-blocks")},(0,i.createElement)("div",{className:"o-position-picker"},(0,i.createElement)(c.__experimentalAlignmentMatrixControl,{value:E([`${null!==(l=v.verticalPosition)&&void 0!==l?l:"center"} ${null!==(a=v.horizontalPosition)&&void 0!==a?a:"center"}`,`${null!==(n=v.verticalPositionTablet)&&void 0!==n?n:"center"} ${null!==(r=v.horizontalPositionTablet)&&void 0!==r?r:"center"}`,`${null!==(d=v.verticalPositionMobile)&&void 0!==d?d:"center"} ${null!==(u=v.horizontalPositionMobile)&&void 0!==u?u:"center"}`]),onChange:e=>{const[t,l]=e.split(" ");switch(view){case"Desktop":y({verticalPosition:Boolean(t)&&"center"!==t?t:void 0,horizontalPosition:Boolean(l)&&"center"!==l?l:void 0});break;case"Tablet":y({verticalPositionTabelt:Boolean(t)&&"center"!==t?t:void 0,horizontalPositionTablet:Boolean(l)&&"center"!==l?l:void 0});break;case"Mobile":y({verticalPositionMobile:Boolean(t)&&"center"!==t?t:void 0,horizontalPositionMobile:Boolean(l)&&"center"!==l?l:void 0})}}})))),(0,i.createElement)(c.PanelBody,{title:(0,o.__)("Frequency & Close Settings","otter-blocks"),initialOpen:!1},(0,Ie.applyFilters)("otter.popupBlock.controls",(0,i.createElement)((()=>(0,i.createElement)(i.Fragment,null,(0,i.createElement)(c.ToggleControl,{label:(0,o.__)("Show Close Button","otter-blocks"),checked:v.showClose,onChange:()=>y({showClose:!v.showClose})}),(0,i.createElement)(c.ToggleControl,{label:(0,o.__)("Close on Click Outside","otter-blocks"),checked:v.outsideClose,onChange:()=>y({outsideClose:!v.outsideClose})}),!Boolean(window.themeisleGutenberg.hasPro)&&(0,i.createElement)(co,null))),null),v,y))),"style"===k&&(0,i.createElement)(i.Fragment,null,(0,i.createElement)(c.PanelBody,{title:(0,o.__)("Dimensions","otter-blocks")},(0,i.createElement)(M.Z,{label:(0,o.__)("Width","otter-blocks")},(0,i.createElement)(c.__experimentalUnitControl,{value:null!==(b=E([v.width,v.widthTablet,v.widthMobile]))&&void 0!==b?b:"500px",onChange:e=>{C(e,["width","widthTablet","widthMobile"])}})),(0,i.createElement)(c.SelectControl,{label:(0,o.__)("Height","otter-blocks"),options:[{label:(0,o.__)("Fit Content","otter-blocks"),value:"none"},{label:(0,o.__)("Custom","otter-blocks"),value:"custom"}],value:v.heightMode,onChange:e=>y({heightMode:"none"!==e?e:void 0})}),"custom"===v.heightMode&&(0,i.createElement)(M.Z,{label:(0,o.__)("Custom Height","otter-blocks")},(0,i.createElement)(c.__experimentalUnitControl,{value:null!==(m=E([v.height,v.heightTablet,v.heightMobile]))&&void 0!==m?m:"400px",onChange:e=>{C(e,["height","heightTablet","heightMobile"])}})),(0,i.createElement)(M.Z,null,(0,i.createElement)(c.__experimentalBoxControl,{label:(0,o.__)("Padding","otter-blocks"),values:null!==(p=E([v.padding,v.paddingTablet,v.paddingMobile]))&&void 0!==p?p:{top:"20px",bottom:"20px",left:"20px",right:"20px"},onChange:e=>{C((0,x.cg)(e,{top:"20px",bottom:"20px",left:"20px",right:"20px"}),["padding","paddingTablet","paddingMobile"])}}))),(0,i.createElement)(s.PanelColorSettings,{title:(0,o.__)("Color","otter-blocks"),initialOpen:!1,colorSettings:[{value:v.backgroundColor,onChange:e=>y({backgroundColor:e}),label:(0,o.__)("Background","otter-blocks")},{value:v.closeColor,onChange:e=>y({closeColor:e}),label:(0,o.__)("Close Button","otter-blocks")},{value:v.overlayColor,onChange:e=>y({overlayColor:e}),label:(0,o.__)("Overlay","otter-blocks")},{value:v.borderColor,onChange:e=>y({borderColor:e}),label:(0,o.__)("Border","otter-blocks")}]}),(0,i.createElement)(c.PanelBody,{title:(0,o.__)("Overlay","otter-blocks"),initialOpen:!1},(0,i.createElement)(c.RangeControl,{label:(0,o.__)("Overlay Opacity","otter-blocks"),value:v.overlayOpacity,initialPosition:100,onChange:e=>y({overlayOpacity:void 0!==e?Number(e):void 0}),allowReset:!0})),(0,i.createElement)(c.PanelBody,{title:(0,o.__)("Close Button","otter-blocks"),initialOpen:!1},(0,i.createElement)(c.ToggleControl,{label:(0,o.__)("Show Close Button","otter-blocks"),checked:v.showClose,onChange:()=>y({showClose:!v.showClose})}),(0,i.createElement)(c.SelectControl,{label:(0,o.__)("Position","otter-blocks"),options:[{label:(0,o.__)("Inside","otter-blocks"),value:"none"},{label:(0,o.__)("Outside","otter-blocks"),value:"outside"}],value:v.closeButtonType,onChange:e=>y({closeButtonType:"none"!==e?e:void 0})})),(0,i.createElement)(c.PanelBody,{title:(0,o.__)("Border","otter-blocks"),initialOpen:!1},(0,i.createElement)(c.__experimentalBoxControl,{label:(0,o.__)("Width","otter-blocks"),values:null!==(g=v.borderWidth)&&void 0!==g?g:{top:"0px",bottom:"0px",left:"0px",right:"0px"},onChange:e=>{y({borderWidth:(0,x.cg)(e,{top:"0px",bottom:"0px",left:"0px",right:"0px"})})}}),(0,i.createElement)(c.__experimentalBoxControl,{id:"o-border-raduis-box",label:(0,o.__)("Border Radius","otter-blocks"),values:null!==(h=v.borderRadius)&&void 0!==h?h:{top:"0px",bottom:"0px",left:"0px",right:"0px"},onChange:e=>{y({borderRadius:(0,x.cg)(e,{top:"0px",bottom:"0px",left:"0px",right:"0px"})})}}),(0,i.createElement)(f.Z,{boxShadow:v.boxShadow,onChange:e=>{const t={...v.boxShadow};Object.entries(e).map((function(){let[l,o]=arguments.length>0&&void 0!==arguments[0]?arguments[0]:e;t[l]=o})),y({boxShadow:t})}})))))};const{attributes:bo}=ro,mo=e=>({top:e,bottom:e,left:e,right:e});const{name:po}=ro;(0,a.registerBlockType)(po,{...ro,title:(0,o.__)("Popup","otter-blocks"),description:(0,o.__)("Display your content in beautiful popup with many customization options. Powered by Otter.","otter-blocks"),icon:no.Z,keywords:["popup","modal","lightbox"],edit:e=>{var t,l,a;let{attributes:n,setAttributes:r,clientId:d,className:u}=e;(0,i.useEffect)((()=>{const e=(0,L.blockInit)(d,bo);return()=>e(n.id)}),[]);const[b,m]=(0,i.useState)(!1),p="custom"===n.heightMode?{"--height":n.height,"--height-tablet":n.heightMobile,"--height-mobile":n.heightMobile}:{"--height":"fit-content"},h={"--min-width":n.minWidth?n.minWidth+"px":"400px","--max-width":n.maxWidth?n.maxWidth+"px":void 0,"--background-color":n.backgroundColor,"--close-color":n.closeColor,"--overlay-color":n.overlayColor,"--overlay-opacity":void 0!==n.overlayOpacity?n.overlayOpacity/100:1,"--brd-width":(0,x.bv)(n.borderWidth),"--brd-radius":(0,x.bv)(n.borderRadius),"--brd-color":n.borderColor,"--brd-style":n.borderStyle,"--width":!Boolean(n.width)&&n.maxWidth?n.maxWidth+"px":n.width,"--width-tablet":n.widthTablet,"--width-mobile":n.widthMobile,"--padding":n.padding?(0,x.bv)((0,K.merge)(mo("20px"),n.padding)):void 0,"--padding-tablet":n.paddingTablet?(0,x.bv)((0,K.merge)(mo("20px"),null!==(t=n.padding)&&void 0!==t?t:{},n.paddingTablet)):void 0,"--padding-mobile":n.paddingMobile?(0,x.bv)((0,K.merge)(mo("20px"),null!==(l=n.padding)&&void 0!==l?l:{},null!==(a=n.paddingTablet)&&void 0!==a?a:{},n.paddingMobile)):void 0,"--box-shadow":n.boxShadow.active&&`${n.boxShadow.horizontal}px ${n.boxShadow.vertical}px ${n.boxShadow.blur}px ${n.boxShadow.spread}px ${hexToRgba(n.boxShadow.color||"#FFFFFF",n.boxShadow.colorOpacity)}`,...p},[v,y]=(0,L.useCSSNode)();(0,i.useEffect)((()=>{y([" .otter-popup__modal_content "+(0,x.iC)([["top","30px","top"===n.verticalPosition],["bottom","30px","bottom"===n.verticalPosition],["left","30px","left"===n.horizontalPosition],["right","30px","right"===n.horizontalPosition]])," .otter-popup__modal_content "+(0,x.iC)([["top","15px","top"===n.verticalPositionTablet],["bottom","15px","bottom"===n.verticalPositionTablet],["left","15px","left"===n.horizontalPositionTablet],["right","15px","right"===n.horizontalPositionTablet]])," .otter-popup__modal_content "+(0,x.iC)([["top","10px","top"===n.verticalPositionMobile],["bottom","10px","bottom"===n.verticalPositionMobile],["left","10px","left"===n.horizontalPositionMobile],["right","10px","right"===n.horizontalPositionMobile]])],["@media ( min-width: 960px )","@media ( min-width: 600px ) and ( max-width: 960px )","@media ( max-width: 600px )"])}),[n.horizontalPosition,n.verticalPosition,n.horizontalPositionTablet,n.verticalPositionTablet,n.horizontalPositionMobile,n.verticalPositionMobile]);const k=(0,s.useBlockProps)({id:n.id,style:h,className:g()(u,v,{"with-outside-button":"outside"===n.closeButtonType})});return(0,i.createElement)(i.Fragment,null,(0,i.createElement)(uo,{attributes:n,setAttributes:r}),(0,i.createElement)("div",k,(0,i.createElement)(c.Button,{variant:"primary",isPrimary:!0,icon:io.Z,onClick:()=>m(!0)},(0,o.__)("Edit Popup","otter-blocks")),b&&(0,i.createElement)("div",{className:"otter-popup__modal_wrap"},(0,i.createElement)("div",{role:"presentation",className:"otter-popup__modal_wrap_overlay",onClick:()=>m(!1)}),(0,i.createElement)("div",{className:"otter-popup__modal_content"},n.showClose&&(0,i.createElement)("div",{className:"otter-popup__modal_header"},(0,i.createElement)(c.Button,{icon:so.Z,onClick:()=>m(!1)})),(0,i.createElement)("div",{className:"otter-popup__modal_body"},(0,i.createElement)(s.InnerBlocks,null))))))},save:e=>{let{attributes:t,className:l}=e;const o=s.useBlockProps.save({id:t.id,className:g()(l,"is-front",{"with-outside-button":"outside"===t.closeButtonType}),"data-open":t.trigger,"data-dismiss":t.recurringClose?t.recurringTime:"","data-time":void 0===t.trigger||"onLoad"===t.trigger?t.wait||0:"","data-anchor":"onClick"===t.trigger?t.anchor:"","data-offset":"onScroll"===t.trigger?t.scroll:"","data-outside":t.outsideClose?t.outsideClose:"","data-anchorclose":t.anchorClose?t.closeAnchor:"","data-lock-scrolling":t.lockScrolling?"1":void 0,"data-disable-on":t.disableOn?t.disableOn:void 0});return(0,i.createElement)("div",o,(0,i.createElement)("div",{className:"otter-popup__modal_wrap"},(0,i.createElement)("div",{role:"presentation",className:"otter-popup__modal_wrap_overlay"}),(0,i.createElement)("div",{className:"otter-popup__modal_content"},t.showClose&&(0,i.createElement)("div",{className:"otter-popup__modal_header"},(0,i.createElement)("button",{type:"button",class:"components-button has-icon"},(0,i.createElement)("svg",{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",role:"img","aria-hidden":"true"},(0,i.createElement)("path",{d:"M12 13.06l3.712 3.713 1.061-1.06L13.061 12l3.712-3.712-1.06-1.06L12 10.938 8.288 7.227l-1.061 1.06L10.939 12l-3.712 3.712 1.06 1.061L12 13.061z"})))),(0,i.createElement)("div",{className:"otter-popup__modal_body"},(0,i.createElement)(s.InnerBlocks.Content,null)))))},example:{attributes:{}}});var go=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"themeisle-blocks/posts-grid","title":"Posts","category":"themeisle-blocks","description":"Display a list of your most recent posts in a beautiful layout. Powered by Otter.","keywords":["posts","grid","news"],"textdomain":"otter-blocks","attributes":{"id":{"type":"string"},"style":{"type":"string","default":"grid"},"postTypes":{"type":"array","default":[]},"columns":{"type":"number","default":3},"template":{"type":"array","default":["category","title","meta","description"]},"categories":{"type":"array","items":{"type":"object"}},"postsToShow":{"type":"number","default":5},"order":{"type":"string","default":"desc"},"orderBy":{"type":"string","default":"date"},"offset":{"type":"number","default":0},"imageSize":{"type":"string","default":"full"},"displayFeaturedImage":{"type":"boolean","default":true},"displayCategory":{"type":"boolean","default":true},"displayTitle":{"type":"boolean","default":true},"titleTag":{"type":"string","default":"h5"},"displayMeta":{"type":"boolean","default":true},"displayDescription":{"type":"boolean","default":true},"excerptLength":{"type":"number","default":100},"displayDate":{"type":"boolean","default":true},"displayAuthor":{"type":"boolean","default":true},"displayComments":{"type":"boolean","default":true},"displayPostCategory":{"type":"boolean","default":false},"displayReadMoreLink":{"type":"boolean","default":false},"cropImage":{"type":"boolean","default":false},"customTitleFontSize":{"type":["string","number"]},"customTitleFontSizeTablet":{"type":["string","number"]},"customTitleFontSizeMobile":{"type":["string","number"]},"customDescriptionFontSize":{"type":["string","number"]},"customDescriptionFontSizeTablet":{"type":["string","number"]},"customDescriptionFontSizeMobile":{"type":["string","number"]},"customMetaFontSize":{"type":"string"},"customMetaFontSizeTablet":{"type":"string"},"customMetaFontSizeMobile":{"type":"string"},"textColor":{"type":"string"},"backgroundColor":{"type":"string"},"borderColor":{"type":"string"},"borderRadius":{"type":["number","object"]},"borderWidth":{"type":"string"},"cardBorderRadius":{"type":"object"},"boxShadow":{"type":"object","default":{"active":false,"colorOpacity":50,"blur":5,"spread":1,"horizontal":0,"vertical":0}},"imageBoxShadow":{"type":"object","default":{"active":false,"colorOpacity":50,"blur":5,"spread":1,"horizontal":0,"vertical":0}},"textAlign":{"type":"string"},"verticalAlign":{"type":"string"},"enableFeaturedPost":{"type":"boolean"},"imageWidth":{"type":["string","number"]},"imageWidthTablet":{"type":"string"},"imageWidthMobile":{"type":"string"},"columnGap":{"type":"string"},"columnGapTablet":{"type":"string"},"columnGapMobile":{"type":"string"},"rowGap":{"type":"string"},"rowGapTablet":{"type":"string"},"rowGapMobile":{"type":"string"},"padding":{"type":"string"},"paddingTablet":{"type":"string"},"paddingMobile":{"type":"string"},"contentGap":{"type":"string"}},"supports":{"align":["wide","full"],"html":false},"editorStyle":"otter-posts-grid-editor","style":"otter-posts-grid-style"}');const{attributes:ho}=go;var vo=[{attributes:{...ho,categories:{type:"string"}},supports:{align:["wide","full"],html:!1},migrate:e=>({...e,categories:[{id:Number(e.categories)}]}),isEligible:e=>{let{categories:t}=e;return t&&"string"==typeof t},save:()=>null}],yo=e=>{let{attributes:t,setAttributes:l}=e;const a=s.BlockVerticalAlignmentToolbar;return(0,i.createElement)(s.BlockControls,null,(0,i.createElement)(a,{label:(0,o.__)("Change Vertical Alignment","otter-blocks"),value:t.verticalAlign,onChange:e=>l({verticalAlign:e})}))},ko=l(454),fo=l.n(ko),_o=l(1286);const wo=(0,_o.W6)((()=>(0,i.createElement)("div",{className:"o-sortable-handle",tabIndex:"0"},(0,i.createElement)("span",null)))),Co={image:"displayFeaturedImage",category:"displayCategory",title:"displayTitle",meta:"displayMeta",description:"displayDescription"},Eo=e=>{var t,l;let{attributes:a,setAttributes:n,template:r,disabled:s}=e;const[d,u]=(0,i.useState)(!1),b=null==r?void 0:r.startsWith("custom_"),m=null==a||null===(t=a.customMetas)||void 0===t||null===(l=t.filter((e=>{let{id:t}=e;return t===r})))||void 0===l?void 0:l.pop(),p={image:a.displayFeaturedImage,category:a.displayCategory,title:a.displayTitle,meta:a.displayMeta,description:a.displayDescription},h=e=>{const t={...m,...e};n({customMetas:a.customMetas.map((e=>e.id===m.id?t:e))})},v=b?(0,Ie.applyFilters)("otter.postsBlock.panelLabel","",m):(0,K.startCase)((0,K.toLower)(r)),y=p[r]||(null==m?void 0:m.display),k=y?"visibility":"hidden";
2
  /* translators: %s Label */
3
  let f=(0,o.sprintf)((0,o.__)("Display %s","otter-blocks"),v);return y&&(
4
  /* translators: %s Label */
1
+ !function(){"use strict";var e,t={5568:function(e,t,l){var o=l(5736),a=l(4981),n=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"themeisle-blocks/about-author","title":"About Author","category":"themeisle-blocks","description":"About Author block is the easiest way to add a author bio below your posts. Powered by Otter.","keywords":["about","author","profile"],"textdomain":"otter-blocks","supports":{"html":false},"editorStyle":"otter-about-author-editor","style":"otter-about-author-style"}'),r=l(340),i=l(9307),s=l(2175),c=l(5609),d=window.wp.serverSideRender,u=l.n(d);const{name:b}=n;(0,a.registerBlockType)(b,{...n,title:(0,o.__)("About Author","otter-blocks"),description:(0,o.__)("About Author block is the easiest way to add a author bio below your posts. Powered by Otter.","otter-blocks"),icon:r.authorIcon,keywords:["about","author","profile"],edit:()=>(0,i.createElement)("div",(0,s.useBlockProps)(),(0,i.createElement)(c.Disabled,null,(0,i.createElement)(u(),{block:"themeisle-blocks/about-author"}))),save:()=>null,supports:{inserter:Boolean(window.themeisleGutenberg.isLegacyPre59),html:!1},example:{}});var m=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"themeisle-blocks/accordion","title":"Accordion","category":"themeisle-blocks","description":"Vertically collapsing accordions perfect for displaying your FAQs. Powered by Otter.","keywords":["accordions","collapse","faq"],"textdomain":"otter-blocks","attributes":{"id":{"type":"string"},"FAQSchema":{"type":"boolean"},"gap":{"type":["string","number"]},"titleColor":{"type":"string"},"titleBackground":{"type":"string"},"contentBackground":{"type":"string"},"borderColor":{"type":"string"},"borderWidth":{"type":"string"},"isSynced":{"type":"array"},"fontFamily":{"type":"string"},"fontVariant":{"type":"string"},"fontStyle":{"type":"string"},"textTransform":{"type":"string"},"fontSize":{"type":"number"},"letterSpacing":{"type":"string"},"padding":{"type":"object"},"paddingTablet":{"type":"object"},"paddingMobile":{"type":"object"},"tag":{"type":"string"},"alwaysOpen":{"type":"boolean"},"boxShadow":{"type":"object","default":{"active":false,"colorOpacity":50,"blur":5,"spread":1,"horizontal":0,"vertical":0}},"iconFirst":{"type":"boolean","default":false},"activeTitleColor":{"type":"string"},"activeTitleBackground":{"type":"string"},"activeContentBackground":{"type":"string"},"icon":{"type":"object"},"openItemIcon":{"type":"object"}},"supports":{"html":false},"editorStyle":"otter-accordion-editor","style":"otter-accordion-style","script":"otter-accordion"}'),p=l(4184),g=l.n(p),h=l(2154),v=l(9818),y=l(9977),k=l(8675),f=l(3075),_=l(1070),w=l(7638),C=l(3532),E=l(2645),x=l(4715);const S=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:()=>{};return(0,v.useSelect)((t=>{const{getView:l}=t("themeisle-gutenberg/data"),{__experimentalGetPreviewDeviceType:o}=!!t("core/edit-post")&&t("core/edit-post"),a=o?o():l();return{responsiveSetAttributes:(0,x.GM)(e,a),responsiveGetAttributes:(0,x._c)(a)}}),[])};var T=l(817),M=l(6993);const B=[{label:(0,o.__)("Default","otter-blocks"),value:"default",isDefault:!0},{label:(0,o.__)("Boxed","otter-blocks"),value:"boxed"}],z={narrow:5,wide:10,wider:20};var P=e=>{var t,l,a,n;let{clientId:r,attributes:d,setAttributes:u,getValue:b}=e;const[m,p]=(0,i.useState)("settings"),g=[{label:(0,o.__)("Title","otter-blocks"),slug:"titleColor",value:b("titleColor")},{label:(0,o.__)("Active Tab Title","otter-blocks"),slug:"activeTitleColor",value:b("activeTitleColor")},{label:(0,o.__)("Title Background","otter-blocks"),slug:"titleBackground",value:b("titleBackground")},{label:(0,o.__)("Active Tab Title Background","otter-blocks"),slug:"activeTitleBackground",value:b("activeTitleBackground")},{label:(0,o.__)("Content Background","otter-blocks"),slug:"contentBackground",value:b("contentBackground")},{label:(0,o.__)("Border","otter-blocks"),slug:"borderColor",value:b("borderColor")}],{responsiveSetAttributes:h,responsiveGetAttributes:P}=S(u);return(0,i.createElement)(s.InspectorControls,null,(0,i.createElement)(w.Z,{value:m,options:[{label:(0,o.__)("Settings","otter-blocks"),value:"settings"},{label:(0,o.__)("Style","otter-blocks"),value:"style"}],onChange:p}),"settings"===m&&(0,i.createElement)(c.PanelBody,{title:(0,o.__)("Settings","otter-blocks")},(0,i.createElement)(c.ToggleControl,{label:(0,o.__)("Place Icon on Left","otter-blocks"),checked:d.iconFirst,onChange:e=>u({iconFirst:e})}),(0,i.createElement)(c.ToggleControl,{label:(0,o.__)("Keep Multiple Items Expanded","otter-blocks"),help:(0,o.__)("When enabled, multiple accordion items can be expanded at the same time","otter-blocks"),checked:d.alwaysOpen||!1,onChange:e=>{u({alwaysOpen:e}),!0!==e&&(0,v.select)("core/block-editor").getBlocksByClientId(r)[0].innerBlocks.forEach((e=>{(0,v.dispatch)("core/block-editor").updateBlockAttributes(e.clientId,{initialOpen:!1})}))}}),(0,i.createElement)(c.ToggleControl,{label:(0,o.__)("Enable FAQ Schema","otter-blocks"),checked:d.FAQSchema||!1,onChange:e=>u({FAQSchema:e})}),(0,i.createElement)(c.SelectControl,{label:(0,o.__)("Accordion title HTML tag","otter-blocks"),value:d.tag||"div",options:[{label:(0,o.__)("H1","otter-blocks"),value:"h1"},{label:(0,o.__)("H2","otter-blocks"),value:"h2"},{label:(0,o.__)("H3","otter-blocks"),value:"h3"},{label:(0,o.__)("H4","otter-blocks"),value:"h4"},{label:(0,o.__)("H5","otter-blocks"),value:"h5"},{label:(0,o.__)("H6","otter-blocks"),value:"h6"},{label:(0,o.__)("div","otter-blocks"),value:"div"}],onChange:e=>{(0,v.select)("core/block-editor").getBlocksByClientId(r)[0].innerBlocks.forEach((t=>{(0,v.dispatch)("core/block-editor").updateBlockAttributes(t.clientId,{tag:e})})),u({tag:e})}})),"style"===m&&(0,i.createElement)(i.Fragment,null,(0,i.createElement)(c.PanelBody,{title:(0,o.__)("Style","otter-blocks")},(0,i.createElement)(E.Z,{options:B,value:(0,x.tB)(B,null==d?void 0:d.className),onChange:e=>{const t=(0,x.L4)(null==d?void 0:d.className,B,e);u({className:t})}})),(0,i.createElement)(c.PanelBody,{title:(0,o.__)("Title Typography","otter-blocks")},(0,i.createElement)(c.FontSizePicker,{value:d.fontSize,fontSizes:[{name:(0,o.__)("Extra Small","otter-blocks"),slug:"extra-small",size:14},{name:(0,o.__)("Small","otter-blocks"),slug:"small",size:16},{name:(0,o.__)("Medium","otter-blocks"),slug:"medium",size:18},{name:(0,o.__)("Large","otter-blocks"),slug:"large",size:24},{name:(0,o.__)("Extra Large","otter-blocks"),slug:"extra-large",size:28}],onChange:e=>u({fontSize:e})}),(0,i.createElement)(y.Z,{label:(0,o.__)("Font Family","otter-blocks"),value:d.fontFamily,onChangeFontFamily:e=>{u(e?{fontFamily:e,fontVariant:"normal",fontStyle:"normal"}:{fontFamily:e,fontVariant:e})},valueVariant:d.fontVariant,onChangeFontVariant:e=>u({fontVariant:e}),valueStyle:d.fontStyle,onChangeFontStyle:e=>u({fontStyle:e}),valueTransform:d.textTransform,onChangeTextTransform:e=>u({textTransform:e})}),(0,i.createElement)(k.Z,{values:["fontFamily","fontVariant","fontStyle","textTransform"],setAttributes:u}),(0,i.createElement)(c.RangeControl,{label:(0,o.__)("Letter Spacing","otter-blocks"),value:d.letterSpacing,onChange:e=>u({letterSpacing:e}),min:-50,max:100,allowReset:!0})),(0,i.createElement)(T.Z,{label:(0,o.__)("Color","otter-blocks"),isSynced:d.isSynced,options:g,setAttributes:u},(0,i.createElement)(s.ContrastChecker,{textColor:b("titleColor"),backgroundColor:b("titleBackground")}),(0,i.createElement)(s.ContrastChecker,{textColor:b("activeTitleColor"),backgroundColor:b("activeTitleBackground")})),(0,i.createElement)(c.PanelBody,{title:(0,o.__)("Dimensions","otter-blocks"),initialOpen:!1},(0,i.createElement)(M.Z,{label:(0,o.__)("Screen Type","otter-blocks")},(0,i.createElement)(c.__experimentalBoxControl,{label:(0,o.__)("Padding","otter-blocks"),values:P([d.padding,d.paddingTablet,d.paddingMobile]),onChange:e=>h(e,["padding","paddingTablet","paddingMobile"])})),(0,i.createElement)(c.RangeControl,{label:(0,o.__)("Gap Between Panels","otter-blocks"),value:"string"==typeof d.gap?z[d.gap]:d.gap,onChange:e=>u({gap:e}),allowReset:!0})),(0,i.createElement)(c.PanelBody,{title:(0,o.__)("Icons","otter-blocks"),initialOpen:!1},(0,i.createElement)(_.Z,{label:(0,o.__)("Closed Item Icon","otter-blocks"),library:"fontawesome",prefix:null===(t=d.icon)||void 0===t?void 0:t.prefix,icon:null===(l=d.icon)||void 0===l?void 0:l.name,allowThemeisleIcons:!1,onChange:e=>u({icon:e})}),(0,i.createElement)(_.Z,{label:(0,o.__)("Open Item Icon","otter-blocks"),library:"fontawesome",prefix:null===(a=d.openItemIcon)||void 0===a?void 0:a.prefix,icon:null===(n=d.openItemIcon)||void 0===n?void 0:n.name,allowThemeisleIcons:!1,onChange:e=>u({openItemIcon:e})})),(0,i.createElement)(c.PanelBody,{title:(0,o.__)("Border","otter-blocks"),initialOpen:!1},(0,i.createElement)(c.__experimentalUnitControl,{label:(0,o.__)("Width","otter-blocks"),value:d.borderWidth,units:[{value:"px",label:"px"},{value:"em",label:"em"},{value:"rem",label:"rem"},{value:"vw",label:"vw"},{value:"vh",label:"vh"}],onChange:e=>u({borderWidth:e})}),(0,i.createElement)(f.Z,{boxShadow:d.boxShadow,onChange:e=>{const t={...d.boxShadow};Object.entries(e).map((function(){let[l,o]=arguments.length>0&&void 0!==arguments[0]?arguments[0]:e;t[l]=o})),u({boxShadow:t})}}))),(0,i.createElement)(C.p,null))},L=l(5225),R=l(4824);const{attributes:F}=m,A={fas:"Font Awesome 5 Free",far:"Font Awesome 5 Free",fal:"Font Awesome 5 Free",fab:"Font Awesome 5 Brands"};const{name:H}=m;(0,a.registerBlockType)(H,{...m,title:(0,o.__)("Accordion","otter-blocks"),description:(0,o.__)("Vertically collapsing accordions perfect for displaying your FAQs. Powered by Otter.","otter-blocks"),icon:r.buttonsIcon,keywords:["accordions","collapse","faq"],edit:e=>{let{name:t,attributes:l,setAttributes:o,clientId:a,isSelected:n}=e;(0,i.useEffect)((()=>{h.Z.attach();const e=(0,L.blockInit)(a,F);return()=>e(l.id)}),[l.id]);const r=(0,v.useSelect)((e=>e("core/block-editor").getBlocksByClientId(a)[0].innerBlocks));(0,i.useEffect)((()=>{void 0===l.alwaysOpen&&o({alwaysOpen:1<r.filter((e=>!0===e.attributes.initialOpen)).length})}),[]);const c=e=>(0,L.getDefaultValueByField)({name:t,field:e,defaultAttributes:F,attributes:l}),d={"--title-color":c("titleColor"),"--title-background":c("titleBackground"),"--content-background":c("contentBackground"),"--border-color":c("borderColor"),"--border-width":c("borderWidth"),"--box-shadow":l.boxShadow.active&&`${l.boxShadow.horizontal}px ${l.boxShadow.vertical}px ${l.boxShadow.blur}px ${l.boxShadow.spread}px ${(0,x.rW)(l.boxShadow.color,l.boxShadow.colorOpacity)}`,"--padding":(0,x.bv)(l.padding,{top:"18px",right:"24px",bottom:"18px",left:"24px"}),"--padding-tablet":(0,x.bv)(l.paddingTablet,{top:"18px",right:"24px",bottom:"18px",left:"24px"}),"--padding-mobile":(0,x.bv)(l.paddingMobile,{top:"18px",right:"24px",bottom:"18px",left:"24px"}),"--gap":(u=l.gap,u?`${u}px`:u)};var u;const[b,m]=(0,L.useCSSNode)();(0,i.useEffect)((()=>{m([`> * > * > .wp-block-themeisle-blocks-accordion-item .wp-block-themeisle-blocks-accordion-item__title > * {\n\t\t\t\t${l.fontSize?"font-size:"+l.fontSize+"px":""};\n\t\t\t\t${l.fontFamily?"font-family:"+l.fontFamily:""};\n\t\t\t\t${l.fontVariant?"font-variant:"+l.fontVariant:""};\n\t\t\t\t${l.fontStyle?"font-style:"+l.fontStyle:""};\n\t\t\t\t${l.textTransform?"text-transform:"+l.textTransform:""};\n\t\t\t\t${l.letterSpacing?"letter-spacing:"+l.letterSpacing+"px":""};\n\t\t\t}`])}),[l.fontSize,l.fontFamily,l.fontVariant,l.fontStyle,l.textTransform,l.letterSpacing]);const[p,y]=(0,L.useCSSNode)();(0,i.useEffect)((()=>{const e=c("icon"),t=c("openItemIcon");y([...e?[`> * > * > .wp-block-themeisle-blocks-accordion-item:not(.is-open) > .wp-block-themeisle-blocks-accordion-item__title::after {\n\t\t\t\tcontent: "\\${R[e.name].unicode}" !important;\n\t\t\t\tfont-family: "${A[e.prefix]}" !important;\n\t\t\t\tfont-weight: ${"fas"!==e.prefix?"400":"900"}\n\t\t\t}`]:[],...t?[`> * > * > .wp-block-themeisle-blocks-accordion-item.is-open > .wp-block-themeisle-blocks-accordion-item__title::after {\n\t\t\t\tcontent: "\\${R[t.name].unicode}" !important;\n\t\t\t\tfont-family: "${A[t.prefix]}" !important;\n\t\t\t\tfont-weight: ${"fas"!==t.prefix?"400":"900"}\n\t\t\t}`]:[]])}),[l.icon,l.openItemIcon]);const[k,f]=(0,L.useCSSNode)();(0,i.useEffect)((()=>{const e=c("activeTitleColor"),t=c("activeTitleBackground");f([...e?[`> * > * > .wp-block-themeisle-blocks-accordion-item.is-open > .wp-block-themeisle-blocks-accordion-item__title {\n\t\t\t\t--title-color: ${e};\n\t\t\t}`]:[],...t?[`> * > * > .wp-block-themeisle-blocks-accordion-item.is-open > .wp-block-themeisle-blocks-accordion-item__title {\n\t\t\t\t--title-background: ${t};\n\t\t\t}`]:[]])}),[l.activeTitleColor,l.activeTitleBackground]),(0,i.useEffect)((()=>{l.fontFamily&&h.Z.loadFontToBrowser(l.fontFamily,l.fontVariant)}),[l.fontFamily]);const _=(0,s.useBlockProps)({id:l.id,className:g()({[p]:p,[k]:k,[b]:b,[`is-${l.gap}-gap`]:"string"==typeof l.gap,"no-gap":0===l.gap,"has-gap":"string"!=typeof l.gap&&0<l.gap,"icon-first":l.iconFirst,"has-icon":!!l.icon,"has-open-icon":!!l.openItemIcon}),style:d});return(0,i.createElement)(i.Fragment,null,(0,i.createElement)(P,{clientId:a,attributes:l,setAttributes:o,getValue:c}),(0,i.createElement)("div",_,(0,i.createElement)(s.InnerBlocks,{allowedBlocks:["themeisle-blocks/accordion-item"],template:[["themeisle-blocks/accordion-item"]],renderAppender:n?s.InnerBlocks.ButtonBlockAppender:""})))},save:e=>{let{attributes:t}=e;const l=s.useBlockProps.save({id:t.id,"data-has-schema":t.FAQSchema,className:g()({exclusive:!1===t.alwaysOpen,[`is-${t.gap}-gap`]:t.gap&&"string"==typeof t.gap,"no-gap":0===t.gap,"has-gap":t.gap&&"string"!=typeof t.gap&&0!==t.gap,"icon-first":t.iconFirst,"has-icon":!!t.icon,"has-open-icon":!!t.openItemIcon})});return(0,i.createElement)("div",l,(0,i.createElement)(s.InnerBlocks.Content,null))},example:{attributes:{},innerBlocks:[{name:"themeisle-blocks/accordion-item",attributes:{initialOpen:!0,title:(0,o.__)("Accordion Item","otter-blocks")},innerBlocks:[{name:"core/paragraph",attributes:{customFontSize:48,content:"Lorem ipsum dolor sit amet, eu liber saperet est. Recusabo volutpat has ne, sed dicit eruditi detraxit ut, modus ancillae mei eu.",align:"left"}}]}]}});var O=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"themeisle-blocks/accordion-item","title":"Accordion Item","category":"themeisle-blocks","description":"Vertically collapsing accordions perfect for displaying your FAQs. Powered by Otter.","keywords":["accordions","collapse","faq"],"parent":["themeisle-blocks/accordion"],"textdomain":"otter-blocks","attributes":{"title":{"type":"string"},"initialOpen":{"type":"boolean","default":false},"tag":{"type":"string"}},"supports":{"reusable":false}}'),N=e=>{let{clientId:t,attributes:l,setAttributes:a}=e;return(0,i.createElement)(s.InspectorControls,null,(0,i.createElement)(c.PanelBody,{title:(0,o.__)("Settings","otter-blocks")},(0,i.createElement)(c.ToggleControl,{label:(0,o.__)("Initially Open","otter-blocks"),checked:l.initialOpen,onChange:e=>{if(a({initialOpen:e}),!e)return;const l=(0,v.select)("core/block-editor").getBlockParents(t).at(-1),o=(0,v.select)("core/block-editor").getBlock(l);o.attributes.alwaysOpen||o.innerBlocks.forEach((e=>{e.clientId!==t&&(0,v.dispatch)("core/editor").updateBlockAttributes(e.clientId,{initialOpen:!1})}))}})))};const{name:V}=O;(0,a.registerBlockType)(V,{...O,title:(0,o.__)("Accordion Item","otter-blocks"),description:(0,o.__)("Vertically collapsing accordions perfect for displaying your FAQs. Powered by Otter.","otter-blocks"),icon:r.buttonsIcon,keywords:["accordions","collapse","faq"],edit:e=>{let{clientId:t,attributes:l,setAttributes:a}=e;const[n,r]=(0,i.useState)(!0);return(0,i.createElement)(i.Fragment,null,(0,i.createElement)(N,{clientId:t,attributes:l,setAttributes:a}),(0,i.createElement)("div",(0,s.useBlockProps)({className:g()({"is-open":n})}),(0,i.createElement)("div",{className:"wp-block-themeisle-blocks-accordion-item__title",onClick:e=>{"string"==typeof e.target.className&&e.target.className.includes("block-editor-rich-text__editable")?r(!0):r(!n)}},(0,i.createElement)(s.RichText,{placeholder:(0,o.__)("Add text…","otter-blocks"),value:l.title,onChange:e=>{n||r(!0),a({title:e})},tagName:l.tag||"div"})),n&&(0,i.createElement)("div",{className:"wp-block-themeisle-blocks-accordion-item__content"},(0,i.createElement)(s.InnerBlocks,{template:[["core/paragraph"]]}))))},save:e=>{let{attributes:t}=e;const l=s.useBlockProps.save({open:!!t.initialOpen});return(0,i.createElement)("details",l,(0,i.createElement)("summary",{className:"wp-block-themeisle-blocks-accordion-item__title"},(0,i.createElement)(s.RichText.Content,{tagName:t.tag||"div",value:t.title})),(0,i.createElement)("div",{className:"wp-block-themeisle-blocks-accordion-item__content"},(0,i.createElement)(s.InnerBlocks.Content,null)))}});var I=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"themeisle-blocks/advanced-heading","title":"Advanced Heading","category":"themeisle-blocks","description":"Advanced Heading gives a spin to editor\'s Heading block with much needed customization options. Powered by Otter.","keywords":["heading","title","advanced heading"],"textdomain":"otter-blocks","attributes":{"id":{"type":"string"},"content":{"type":"string","source":"html","selector":"h1,h2,h3,h4,h5,h6,div,p,span","default":""},"tag":{"default":"h2","type":"string"},"align":{"type":"string"},"alignTablet":{"type":"string"},"alignMobile":{"type":"string"},"headingColor":{"type":"string"},"highlightColor":{"type":"string"},"highlightBackground":{"type":"string"},"fontSize":{"type":"number"},"fontSizeTablet":{"type":"number"},"fontSizeMobile":{"type":"number"},"fontFamily":{"type":"string"},"fontVariant":{"type":"string"},"fontStyle":{"type":"string"},"textTransform":{"type":"string"},"lineHeight":{"type":"number"},"letterSpacing":{"type":"number"},"textShadow":{"type":"boolean","default":false},"textShadowColor":{"type":"string","default":"#000000"},"textShadowColorOpacity":{"type":"number","default":50},"textShadowBlur":{"type":"number","default":5},"textShadowHorizontal":{"type":"number","default":0},"textShadowVertical":{"type":"number","default":0},"paddingType":{"type":"string","default":"linked"},"paddingTypeTablet":{"type":"string","default":"linked"},"paddingTypeMobile":{"type":"string","default":"linked"},"padding":{"type":"number","default":0},"paddingTablet":{"type":"number"},"paddingMobile":{"type":"number"},"paddingTop":{"type":"number","default":0},"paddingTopTablet":{"type":"number"},"paddingTopMobile":{"type":"number"},"paddingRight":{"type":"number","default":0},"paddingRightTablet":{"type":"number"},"paddingRightMobile":{"type":"number"},"paddingBottom":{"type":"number","default":0},"paddingBottomTablet":{"type":"number"},"paddingBottomMobile":{"type":"number"},"paddingLeft":{"type":"number","default":0},"paddingLeftTablet":{"type":"number"},"paddingLeftMobile":{"type":"number"},"marginType":{"type":"string","default":"unlinked"},"marginTypeTablet":{"type":"string","default":"unlinked"},"marginTypeMobile":{"type":"string","default":"unlinked"},"margin":{"type":"number","default":0},"marginTablet":{"type":"number"},"marginMobile":{"type":"number"},"marginTop":{"type":"number","default":0},"marginTopTablet":{"type":"number"},"marginTopMobile":{"type":"number"},"marginBottom":{"type":"number","default":25},"marginBottomTablet":{"type":"number"},"marginBottomMobile":{"type":"number"}},"editorStyle":"otter-advanced-heading-editor","style":"otter-advanced-heading-style"}'),D=l(6713),G=l(2629);const $="themeisle-blocks/highlight";(0,G.registerFormatType)($,{name:$,title:(0,o.__)("Highlight","otter-blocks"),tagName:"span",className:"highlight",edit:e=>{let{isActive:t,value:l,onChange:a}=e;const n=()=>a((0,G.toggleFormat)(l,{type:$}));return(0,i.createElement)(i.Fragment,null,(0,i.createElement)(s.RichTextShortcut,{type:"primary",character:"h",onUse:n}),(0,i.createElement)(s.RichTextToolbarButton,{icon:D.Z,title:(0,o.__)("Highlight","otter-blocks"),onClick:n,isActive:t,shortcutType:"access",shortcutCharacter:"h"}))}});var W=l(80),Z=l.n(W);const j=[{attributes:{id:{type:"string"},content:{type:"string",source:"html",selector:"h1,h2,h3,h4,h5,h6,div,p,span",default:""},tag:{default:"h2",type:"string"},align:{type:"string"},alignTablet:{type:"string"},alignMobile:{type:"string"},headingColor:{type:"string",default:"#000000"},highlightColor:{type:"string"},highlightBackground:{type:"string"},fontSize:{type:"number"},fontSizeTablet:{type:"number"},fontSizeMobile:{type:"number"},fontFamily:{type:"string"},fontVariant:{type:"string"},fontStyle:{type:"string",default:"normal"},textTransform:{type:"string",default:"none"},lineHeight:{type:"number"},letterSpacing:{type:"number"},textShadow:{type:"boolean",default:!1},textShadowColor:{type:"string",default:"#000000"},textShadowColorOpacity:{type:"number",default:50},textShadowBlur:{type:"number",default:5},textShadowHorizontal:{type:"number",default:0},textShadowVertical:{type:"number",default:0},paddingType:{type:"string",default:"linked"},paddingTypeTablet:{type:"string",default:"linked"},paddingTypeMobile:{type:"string",default:"linked"},padding:{type:"number",default:0},paddingTablet:{type:"number",default:0},paddingMobile:{type:"number",default:0},paddingTop:{type:"number",default:0},paddingTopTablet:{type:"number",default:0},paddingTopMobile:{type:"number",default:0},paddingRight:{type:"number",default:0},paddingRightTablet:{type:"number",default:0},paddingRightMobile:{type:"number",default:0},paddingBottom:{type:"number",default:0},paddingBottomTablet:{type:"number",default:0},paddingBottomMobile:{type:"number",default:0},paddingLeft:{type:"number",default:0},paddingLeftTablet:{type:"number",default:0},paddingLeftMobile:{type:"number",default:0},marginType:{type:"string",default:"unlinked"},marginTypeTablet:{type:"string",default:"unlinked"},marginTypeMobile:{type:"string",default:"unlinked"},margin:{type:"number",default:0},marginTablet:{type:"number",default:0},marginMobile:{type:"number",default:0},marginTop:{type:"number",default:0},marginTopTablet:{type:"number",default:0},marginTopMobile:{type:"number",default:0},marginBottom:{type:"number",default:25},marginBottomTablet:{type:"number",default:25},marginBottomMobile:{type:"number",default:20}},save:e=>{let t,{attributes:l,className:o}=e;l.textShadow&&(t={textShadow:`${l.textShadowHorizontal}px ${l.textShadowVertical}px ${l.textShadowBlur}px ${Z()(l.textShadowColor?l.textShadowColor:"#000000",l.textShadowColorOpacity)}`});const a={color:l.headingColor,fontFamily:l.fontFamily,fontWeight:"regular"===l.fontVariant?"normal":l.fontVariant,fontStyle:l.fontStyle,textTransform:l.textTransform,lineHeight:l.lineHeight&&`${l.lineHeight}px`,letterSpacing:l.letterSpacing&&`${l.letterSpacing}px`,...t};return(0,i.createElement)(s.RichText.Content,{tagName:l.tag,value:l.content,id:l.id,className:g()(l.id,o),style:a})}}];var U=j,q={from:[{type:"block",blocks:["core/heading"],transform:e=>{let{content:t}=e;return(0,a.createBlock)("themeisle-blocks/advanced-heading",{content:t})}},{type:"block",blocks:["core/paragraph"],transform:e=>{let{content:t}=e;return(0,a.createBlock)("themeisle-blocks/advanced-heading",{content:t})}}],to:[{type:"block",blocks:["core/paragraph"],transform:e=>{let{content:t}=e;return(0,a.createBlock)("core/paragraph",{content:t})}}]},J=l(7462),K=l(2819),Y=l(4333),Q=e=>{let{attributes:t,setAttributes:l}=e;const a=e=>{l(e?{fontFamily:e,fontVariant:"normal",fontStyle:"normal"}:{fontFamily:e,fontVariant:e})},n=e=>{switch(e){case"h1":return(0,i.createElement)(c.SVG,{style:{width:"25px",height:"20px"}},(0,i.createElement)("text",{style:{fontSize:"12px"},x:"0",y:"15"},"H1"));case"h2":return(0,i.createElement)(c.SVG,{style:{width:"25px",height:"20px"}},(0,i.createElement)("text",{style:{fontSize:"12px"},x:"0",y:"15"},"H2"));case"h3":return(0,i.createElement)(c.SVG,{style:{width:"25px",height:"20px"}},(0,i.createElement)("text",{style:{fontSize:"12px"},x:"0",y:"15"},"H3"));case"h4":return(0,i.createElement)(c.SVG,{style:{width:"25px",height:"20px"}},(0,i.createElement)("text",{style:{fontSize:"12px"},x:"0",y:"15"},"H4"));case"h5":return(0,i.createElement)(c.SVG,{style:{width:"25px",height:"20px"}},(0,i.createElement)("text",{style:{fontSize:"12px"},x:"0",y:"15"},"H5"));case"h6":return(0,i.createElement)(c.SVG,{style:{width:"25px",height:"20px"}},(0,i.createElement)("text",{style:{fontSize:"12px"},x:"0",y:"15"},"H6"));case"div":return(0,i.createElement)(c.SVG,{style:{width:"25px",height:"20px"}},(0,i.createElement)("text",{style:{fontSize:"12px"},x:"0",y:"15"},"DIV"));case"p":return(0,i.createElement)(c.SVG,{style:{width:"25px",height:"20px"}},(0,i.createElement)("text",{x:"0",y:"15"},"P"));case"span":return(0,i.createElement)(c.SVG,{style:{width:"25px",height:"20px"}},(0,i.createElement)("text",{style:{fontSize:"12px"},x:"0",y:"15"},"SPAN"));default:return(0,i.createElement)(c.SVG,{style:{width:"25px",height:"20px"}},(0,i.createElement)("text",{style:{fontSize:"12px"},x:"0",y:"15"},"DEFAULT"))}},r=e=>{l({tag:e})};return(0,i.createElement)(s.BlockControls,null,(0,i.createElement)(c.DropdownMenu,{icon:n(t.tag),label:(0,o.__)("Select tag","otter-blocks"),className:"components-toolbar",controls:[{title:(0,o.__)("Heading","otter-blocks")+" 1",icon:n("h1"),onClick:()=>r("h1")},{title:(0,o.__)("Heading","otter-blocks")+" 2",icon:n("h2"),onClick:()=>r("h2")},{title:(0,o.__)("Heading","otter-blocks")+" 3",icon:n("h3"),onClick:()=>r("h3")},{title:(0,o.__)("Heading","otter-blocks")+" 4",icon:n("h4"),onClick:()=>r("h4")},{title:(0,o.__)("Heading","otter-blocks")+" 5",icon:n("h5"),onClick:()=>r("h5")},{title:(0,o.__)("Heading","otter-blocks")+" 6",icon:n("h6"),onClick:()=>r("h6")},{title:(0,o.__)("Division","otter-blocks"),icon:n("div"),onClick:()=>r("div")},{title:(0,o.__)("Paragraph","otter-blocks"),icon:n("p"),onClick:()=>r("p")},{title:(0,o.__)("Span Tag","otter-blocks"),icon:n("span"),onClick:()=>r("span")}]}),(0,i.createElement)(c.ToolbarGroup,null,(0,i.createElement)(c.Dropdown,{contentClassName:"wp-themesiel-blocks-advanced-heading-popover-content",position:"bottom center",renderToggle:e=>{let{isOpen:t,onToggle:l}=e;return(0,i.createElement)(c.Button,{className:"components-dropdown-menu__toggle",icon:"editor-textcolor",onClick:l,"aria-haspopup":"true","aria-expanded":t,label:(0,o.__)("Typography Settings","otter-blocks"),showTooltip:!0},(0,i.createElement)("span",{className:"components-dropdown-menu__indicator"}))},renderContent:()=>(0,i.createElement)(i.Fragment,null,(0,i.createElement)(y.Z,{label:(0,o.__)("Font Family","otter-blocks"),value:t.fontFamily,onChangeFontFamily:a,valueVariant:t.fontVariant,onChangeFontVariant:e=>l({fontVariant:e}),valueStyle:t.fontStyle,onChangeFontStyle:e=>l({fontStyle:e}),valueTransform:t.textTransform,onChangeTextTransform:e=>l({textTransform:e})}),(0,i.createElement)(c.RangeControl,{label:(0,o.__)("Line Height","otter-blocks"),value:t.lineHeight,onChange:e=>l({lineHeight:e}),step:.1,min:0,max:3}),(0,i.createElement)(c.RangeControl,{label:(0,o.__)("Letter Spacing","otter-blocks"),value:t.letterSpacing,onChange:e=>l({letterSpacing:e}),step:.1,min:-50,max:100}))})))},X=l(2136),ee=l(2372),te=l(1661),le=e=>{let{attributes:t,setAttributes:l}=e;const a=(0,v.useSelect)((e=>{const{getView:t}=e("themeisle-gutenberg/data"),{__experimentalGetPreviewDeviceType:l}=!!e("core/edit-post")&&e("core/edit-post");return l?l():t()}),[]),[n,r]=(0,i.useState)("style"),d={top:"paddingTop",right:"paddingRight",bottom:"paddingBottom",left:"paddingLeft"},u={top:"paddingTopTablet",right:"paddingRightTablet",bottom:"paddingBottomTablet",left:"paddingLeftTablet"},b={top:"paddingTopMobile",right:"paddingRightMobile",bottom:"paddingBottomMobile",left:"paddingLeftMobile"},m=e=>{if("top"==e)switch(a){case"Desktop":return"linked"===t.paddingType?t.padding:t.paddingTop;case"Tablet":return"linked"===t.paddingTypeTablet?t.paddingTablet:t.paddingTopTablet;case"Mobile":return"linked"===t.paddingTypeMobile?t.paddingMobile:t.paddingTopMobile}else if("right"==e)switch(a){case"Desktop":return"linked"===t.paddingType?t.padding:t.paddingRight;case"Tablet":return"linked"===t.paddingTypeTablet?t.paddingTablet:t.paddingRightTablet;case"Mobile":return"linked"===t.paddingTypeMobile?t.paddingMobile:t.paddingRightMobile}else if("bottom"==e)switch(a){case"Desktop":return"linked"===t.paddingType?t.padding:t.paddingBottom;case"Tablet":return"linked"===t.paddingTypeTablet?t.paddingTablet:t.paddingBottomTablet;case"Mobile":return"linked"===t.paddingTypeMobile?t.paddingMobile:t.paddingBottomMobile}else if("left"==e)switch(a){case"Desktop":return"linked"===t.paddingType?t.padding:t.paddingLeft;case"Tablet":return"linked"===t.paddingTypeTablet?t.paddingTablet:t.paddingLeftTablet;case"Mobile":return"linked"===t.paddingTypeMobile?t.paddingMobile:t.paddingLeftMobile}},p={top:"marginTop",bottom:"marginBottom"},g={top:"marginTopTablet",bottom:"marginBottomTablet"},h={top:"marginTopMobile",bottom:"marginBottomMobile"},f=e=>{if("top"==e)switch(a){case"Desktop":return"linked"===t.marginType?t.margin:t.marginTop;case"Tablet":return"linked"===t.marginTypeTablet?t.marginTablet:t.marginTopTablet;case"Mobile":return"linked"===t.marginTypeMobile?t.marginMobile:t.marginTopMobile}else if("bottom"==e)switch(a){case"Desktop":return"linked"===t.marginType?t.margin:t.marginBottom;case"Tablet":return"linked"===t.marginTypeTablet?t.marginTablet:t.marginBottomTablet;case"Mobile":return"linked"===t.marginTypeMobile?t.marginMobile:t.marginBottomMobile}};return(0,i.createElement)(i.Fragment,null,(0,i.createElement)(s.InspectorControls,null,(0,i.createElement)(w.Z,{value:n,options:[{label:(0,o.__)("Style","otter-blocks"),value:"style"},{label:(0,o.__)("Advanced","otter-blocks"),value:"advanced"}],onChange:r}),"style"===n&&(0,i.createElement)(i.Fragment,null,(0,i.createElement)(c.PanelBody,{title:(0,o.__)("General Settings","otter-blocks"),className:"o-adv-h-panel"},(0,i.createElement)(s.__experimentalColorGradientControl,{label:(0,o.__)("Heading Color","otter-blocks"),colorValue:t.headingColor,onColorChange:e=>l({headingColor:e})}),(0,i.createElement)(M.Z,{label:(0,o.__)("Font Size","otter-blocks")},(0,i.createElement)(c.RangeControl,{value:(()=>{switch(a){case"Desktop":return t.fontSize;case"Tablet":return t.fontSizeTablet;case"Mobile":return t.fontSizeMobile;default:return}})()||"",onChange:e=>{"Desktop"===a?l({fontSize:e}):"Tablet"===a?l({fontSizeTablet:e}):"Mobile"===a&&l({fontSizeMobile:e})},step:.1,min:1,max:500,allowReset:!0})),(0,i.createElement)(M.Z,{label:(0,o.__)("Alignment","otter-blocks")},(0,i.createElement)(s.AlignmentToolbar,{value:(()=>{switch(a){case"Desktop":return t.align;case"Tablet":return t.alignTablet;case"Mobile":return t.alignMobile;default:return}})(),onChange:e=>{"Desktop"===a?l({align:e}):"Tablet"===a?l({alignTablet:e}):"Mobile"===a&&l({alignMobile:e})},isCollapsed:!1}))),(0,i.createElement)(c.PanelBody,{title:(0,o.__)("Typography Settings","otter-blocks"),initialOpen:!1},(0,i.createElement)(y.Z,{label:(0,o.__)("Font Family","otter-blocks"),value:t.fontFamily,onChangeFontFamily:e=>{l(e?{fontFamily:e,fontVariant:"normal",fontStyle:"normal"}:{fontFamily:e,fontVariant:e})},valueVariant:t.fontVariant,onChangeFontVariant:e=>l({fontVariant:e}),valueStyle:t.fontStyle,onChangeFontStyle:e=>l({fontStyle:e}),valueTransform:t.textTransform,onChangeTextTransform:e=>l({textTransform:e})}),(0,i.createElement)(k.Z,{values:["fontFamily","fontVariant","fontStyle","textTransform"],setAttributes:l}),(0,i.createElement)(c.RangeControl,{label:(0,o.__)("Line Height","otter-blocks"),value:t.lineHeight,onChange:e=>l({lineHeight:e}),step:.1,min:0,max:3,allowReset:!0}),(0,i.createElement)(c.RangeControl,{label:(0,o.__)("Letter Spacing","otter-blocks"),value:t.letterSpacing,onChange:e=>l({letterSpacing:e}),step:.1,min:-50,max:100,allowReset:!0}),(0,i.createElement)(c.ToggleControl,{label:(0,o.__)("Shadow Properties","otter-blocks"),checked:t.textShadow,onChange:e=>l({textShadow:e})}),t.textShadow&&(0,i.createElement)(i.Fragment,null,(0,i.createElement)(s.__experimentalColorGradientControl,{label:(0,o.__)("Color","otter-blocks"),colorValue:t.textShadowColor,onColorChange:e=>l({textShadowColor:e})}),(0,i.createElement)(X.Z,{label:(0,o.__)("Shadow Properties","otter-blocks")},(0,i.createElement)(c.RangeControl,{label:(0,o.__)("Opacity","otter-blocks"),value:t.textShadowColorOpacity,onChange:e=>l({textShadowColorOpacity:e}),min:0,max:100}),(0,i.createElement)(c.RangeControl,{label:(0,o.__)("Blur","otter-blocks"),value:t.textShadowBlur,onChange:e=>l({textShadowBlur:e}),min:0,max:100}),(0,i.createElement)(c.RangeControl,{label:(0,o.__)("Horizontal","otter-blocks"),value:t.textShadowHorizontal,onChange:e=>l({textShadowHorizontal:e}),min:-100,max:100}),(0,i.createElement)(c.RangeControl,{label:(0,o.__)("Vertical","otter-blocks"),value:t.textShadowVertical,onChange:e=>l({textShadowVertical:e}),min:-100,max:100})))))||"advanced"===n&&(0,i.createElement)(i.Fragment,null,(0,i.createElement)(c.PanelBody,{title:(0,o.__)("Highlight Color","otter-blocks")},(0,i.createElement)(s.__experimentalColorGradientControl,{label:(0,o.__)("Highlight Color","otter-blocks"),colorValue:t.highlightColor,onColorChange:e=>l({highlightColor:e})}),(0,i.createElement)(s.__experimentalColorGradientControl,{label:(0,o.__)("Highlight Background","otter-blocks"),colorValue:t.highlightBackground,onColorChange:e=>l({highlightBackground:e})})),(0,i.createElement)(c.PanelBody,{title:(0,o.__)("Spacing","otter-blocks"),initialOpen:!1},(0,i.createElement)(M.Z,{label:(0,o.__)("Padding","otter-blocks")},(0,i.createElement)(ee.Z,{type:(()=>{switch(a){case"Desktop":return t.paddingType;case"Tablet":return t.paddingTypeTablet;case"Mobile":return t.paddingTypeMobile;default:return}})(),min:0,max:500,changeType:e=>{"Desktop"===a?l({paddingType:e}):"Tablet"===a?l({paddingTypeTablet:e}):"Mobile"===a&&l({paddingTypeMobile:e})},onChange:(e,o)=>{switch(a){case"Desktop":"linked"===t.paddingType?l({padding:o}):l({[d[e]]:o});break;case"Tablet":"linked"===t.paddingTypeTablet?l({paddingTablet:o}):l({[u[e]]:o});break;case"Mobile":"linked"===t.paddingTypeMobile?l({paddingMobile:o}):l({[b[e]]:o})}},options:[{label:(0,o.__)("Top","otter-blocks"),type:"top",value:m("top")},{label:(0,o.__)("Right","otter-blocks"),type:"right",value:m("right")},{label:(0,o.__)("Bottom","otter-blocks"),type:"bottom",value:m("bottom")},{label:(0,o.__)("Left","otter-blocks"),type:"left",value:m("left")}]})),(0,i.createElement)(k.Z,{values:[{padding:"Desktop"===a&&"linked"===t.paddingType},{paddingTablet:"Tablet"===a&&"linked"===t.paddingType},{paddingMobile:"Mobile"===a&&"linked"===t.paddingType},{paddingRight:"Desktop"===a&&"linked"!==t.paddingType},{paddingRightTablet:"Tablet"===a&&"linked"!==t.paddingType},{paddingRightMobile:"Mobile"===a&&"linked"!==t.paddingType},{paddingTop:"Desktop"===a&&"linked"!==t.paddingType},{paddingTopTablet:"Tablet"===a&&"linked"!==t.paddingType},{paddingTopMobile:"Mobile"===a&&"linked"!==t.paddingType},{paddingBottom:"Desktop"===a&&"linked"!==t.paddingType},{paddingBottomTablet:"Tablet"===a&&"linked"!==t.paddingType},{paddingBottomMobile:"Mobile"===a&&"linked"!==t.paddingType},{paddingLeft:"Desktop"===a&&"linked"!==t.paddingType},{paddingLeftTablet:"Tablet"===a&&"linked"!==t.paddingType},{paddingLeftMobile:"Mobile"===a&&"linked"!==t.paddingType}],setAttributes:l}),(0,i.createElement)(M.Z,{label:(0,o.__)("Margin","otter-blocks")},(0,i.createElement)(ee.Z,{type:(()=>{switch(a){case"Desktop":return t.marginType;case"Tablet":return t.marginTypeTablet;case"Mobile":return t.marginTypeMobile;default:return}})(),min:-500,max:500,changeType:e=>{switch(a){case"Desktop":l({marginType:e});break;case"Tablet":l({marginTypeTablet:e});break;case"Mobile":l({marginTypeMobile:e})}},onChange:(e,o)=>{switch(a){case"Desktop":"linked"===t.marginType?l({margin:o}):l({[p[e]]:o});break;case"Tablet":"linked"===t.marginTypeTablet?l({marginTablet:o}):l({[g[e]]:o});break;case"Mobile":"linked"===t.marginTypeMobile?l({marginMobile:o}):l({[h[e]]:o})}},options:[{label:(0,o.__)("Top","otter-blocks"),type:"top",value:f("top")},{label:(0,o.__)("Right","otter-blocks"),disabled:!0},{label:(0,o.__)("Bottom","otter-blocks"),type:"bottom",value:f("bottom")},{label:(0,o.__)("Left","otter-blocks"),disabled:!0}]})),(0,i.createElement)(k.Z,{values:[{margin:"Desktop"===a&&"linked"===t.marginType},{marginTablet:"Tablet"===a&&"linked"===t.marginType},{marginMobile:"Mobile"===a&&"linked"===t.marginType},{marginTop:"Desktop"===a&&"linked"!==t.marginType},{marginTopTablet:"Tablet"===a&&"linked"!==t.marginType},{marginTopMobile:"Mobile"===a&&"linked"!==t.marginType},{marginBottom:"Desktop"===a&&"linked"!==t.marginType},{marginBottomTablet:"Tablet"===a&&"linked"!==t.marginType},{marginBottomMobile:"Mobile"===a&&"linked"!==t.marginType}],setAttributes:l}))),(0,i.createElement)(C.p,null)),(0,i.createElement)(te.Z,{value:t.id,onChange:e=>l({id:e})}))};const{attributes:oe}=I;const{name:ae}=I;(0,a.registerBlockType)(ae,{...I,title:(0,o.__)("Advanced Heading","otter-blocks"),description:(0,o.__)("Advanced Heading gives a spin to editor's Heading block with much needed customization options. Powered by Otter.","otter-blocks"),icon:r.headingIcon,keywords:["heading","title","advanced heading"],deprecated:U,transforms:q,edit:e=>{let{attributes:t,setAttributes:l,clientId:n,mergeBlocks:r,onReplace:c}=e;const{isViewportAvailable:d,isPreviewDesktop:u,isPreviewTablet:b,isPreviewMobile:m}=(0,v.useSelect)((e=>{const{__experimentalGetPreviewDeviceType:t}=!!e("core/edit-post")&&e("core/edit-post");return{isViewportAvailable:!!t,isPreviewDesktop:!!t&&"Desktop"===t(),isPreviewTablet:!!t&&"Tablet"===t(),isPreviewMobile:!!t&&"Mobile"===t()}}),[]),p=(0,Y.useViewportMatch)("large",">="),g=(0,Y.useViewportMatch)("large","<="),y=(0,Y.useViewportMatch)("small",">="),k=(0,Y.useViewportMatch)("small","<=");(0,i.useEffect)((()=>{h.Z.attach();const e=(0,L.blockInit)(n,oe);return()=>e(t.id)}),[t.id]);let f,_,w,C=p&&!g&&y&&!k,E=!p&&!g&&y&&!k,x=!(p||g||y||k);d&&!x&&(C=u,E=b,x=m),C&&(f={fontSize:t.fontSize?`${t.fontSize}px`:void 0},_={textAlign:t.align,paddingTop:"linked"===t.paddingType?`${t.padding}px`:`${t.paddingTop}px`,paddingRight:"linked"===t.paddingType?`${t.padding}px`:`${t.paddingRight}px`,paddingBottom:"linked"===t.paddingType?`${t.padding}px`:`${t.paddingBottom}px`,paddingLeft:"linked"===t.paddingType?`${t.padding}px`:`${t.paddingLeft}px`,marginTop:"linked"===t.marginType?`${t.margin}px`:`${t.marginTop}px`,marginBottom:"linked"===t.marginType?`${t.margin}px`:`${t.marginBottom}px`}),E&&(f={fontSize:t.fontSizeTablet?`${t.fontSizeTablet}px`:void 0},_={textAlign:t.alignTablet,paddingTop:"linked"===t.paddingTypeTablet?`${t.paddingTablet}px`:`${t.paddingTopTablet}px`,paddingRight:"linked"===t.paddingTypeTablet?`${t.paddingTablet}px`:`${t.paddingRightTablet}px`,paddingBottom:"linked"===t.paddingTypeTablet?`${t.paddingTablet}px`:`${t.paddingBottomTablet}px`,paddingLeft:"linked"===t.paddingTypeTablet?`${t.paddingTablet}px`:`${t.paddingLeftTablet}px`,marginTop:"linked"===t.marginTypeTablet?`${t.marginTablet}px`:`${t.marginTopTablet}px`,marginBottom:"linked"===t.marginTypeTablet?`${t.marginTablet}px`:`${t.marginBottomTablet}px`}),x&&(f={fontSize:t.fontSizeMobile?`${t.fontSizeMobile}px`:void 0},_={textAlign:t.alignMobile,paddingTop:"linked"===t.paddingTypeMobile?`${t.paddingMobile}px`:`${t.paddingTopMobile}px`,paddingRight:"linked"===t.paddingTypeMobile?`${t.paddingMobile}px`:`${t.paddingRightMobile}px`,paddingBottom:"linked"===t.paddingTypeMobile?`${t.paddingMobile}px`:`${t.paddingBottomMobile}px`,paddingLeft:"linked"===t.paddingTypeMobile?`${t.paddingMobile}px`:`${t.paddingLeftMobile}px`,marginTop:"linked"===t.marginTypeMobile?`${t.marginMobile}px`:`${t.marginTopMobile}px`,marginBottom:"linked"===t.marginTypeMobile?`${t.marginMobile}px`:`${t.marginBottomMobile}px`}),t.textShadow&&(w={textShadow:`${t.textShadowHorizontal}px ${t.textShadowVertical}px ${t.textShadowBlur}px ${Z()(t.textShadowColor?t.textShadowColor:"#000000",0<=t.textShadowColorOpacity?t.textShadowColorOpacity||1e-5:1)}`});const S=(0,K.omitBy)({color:t.headingColor,...f,fontFamily:t.fontFamily||void 0,fontWeight:"regular"===t.fontVariant?"normal":t.fontVariant,fontStyle:t.fontStyle||void 0,textTransform:t.textTransform||void 0,lineHeight:(3<t.lineHeight?t.lineHeight+"px":t.lineHeight)||void 0,letterSpacing:t.letterSpacing&&`${t.letterSpacing}px`,..._,...w},(e=>{var t;return null==e||null===(t=e.includes)||void 0===t?void 0:t.call(e,"undefined")})),T=(0,s.useBlockProps)({id:t.id,style:S});return(0,i.useEffect)((()=>{t.fontFamily&&h.Z.loadFontToBrowser(t.fontFamily,t.fontVariant)}),[t.fontFamily]),(0,i.createElement)(i.Fragment,null,(0,i.createElement)("style",null,`#block-${n} mark, #block-${n} .highlight {\n\t\t\t\t\t\tcolor: ${t.highlightColor};\n\t\t\t\t\t\tbackground: ${t.highlightBackground};\n\t\t\t\t\t}`),(0,i.createElement)(Q,{attributes:t,setAttributes:l}),(0,i.createElement)(le,{attributes:t,setAttributes:l}),(0,i.createElement)(s.RichText,(0,J.Z)({identifier:"content",value:t.content,placeholder:(0,o.__)("Write heading…","otter-blocks"),tagName:t.tag,allowedFormats:["core/bold","core/italic","core/link","core/strikethrough","themeisle-blocks/highlight","themeisle-blocks/count-animation","themeisle-blocks/typing-animation","themeisle-blocks/dynamic-value","themeisle-blocks/dynamic-link"],onMerge:r,onSplit:(e,l)=>{let o;var r;return o=l||e?(0,a.createBlock)("themeisle-blocks/advanced-heading",{...t,content:e}):(0,a.createBlock)(null!==(r=(0,a.getDefaultBlockName)())&&void 0!==r?r:"themeisle-blocks/advanced-heading"),l&&(o.clientId=n),o},onReplace:c,onRemove:()=>c([]),onChange:e=>{l({content:e})}},T)))},save:e=>{let{attributes:t}=e;const l=s.useBlockProps.save({id:t.id,className:t.id});return(0,i.createElement)(s.RichText.Content,(0,J.Z)({tagName:t.tag,value:t.content},l))},example:{attributes:{content:(0,o.__)("A heading with more customization options","otter-blocks")}}});var ne=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"themeisle-blocks/button-group","title":"Button Group","category":"themeisle-blocks","description":"Prompt visitors to take action with a button group. Powered by Otter.","keywords":["button","buttons","button group"],"textdomain":"otter-blocks","attributes":{"id":{"type":"string"},"align":{"type":["string","object"]},"spacing":{"type":"number","default":20},"paddingTopBottom":{"type":"number"},"paddingLeftRight":{"type":"number"},"collapse":{"type":"string","default":"collapse-none"},"fontSize":{"type":"number"},"fontFamily":{"type":"string"},"fontVariant":{"type":"string"},"textTransform":{"type":"string"},"fontStyle":{"type":"string"},"lineHeight":{"type":"number"}},"editorStyle":"otter-button-group-editor","style":"otter-button-group-style"}');const re={id:{type:"string"},buttons:{type:"number",default:2},align:{type:"string"},spacing:{type:"number",default:20},collapse:{type:"string",default:"collapse-none"},fontSize:{type:"number",default:18},fontFamily:{type:"string"},fontVariant:{type:"string"},textTransform:{type:"string"},fontStyle:{type:"string",default:"normal"},lineHeight:{type:"number"},data:{type:"array",default:[{text:"",link:"",newTab:!1,color:"#ffffff",background:"#32373c",border:"",hoverColor:"",hoverBackground:"",hoverBorder:"",borderSize:0,borderRadius:0,boxShadow:!1,boxShadowColor:"",boxShadowColorOpacity:50,boxShadowBlur:5,boxShadowSpread:1,boxShadowHorizontal:0,boxShadowVertical:0,hoverBoxShadowColor:"",hoverBoxShadowColorOpacity:50,hoverBoxShadowBlur:5,hoverBoxShadowSpread:1,hoverBoxShadowHorizontal:0,hoverBoxShadowVertical:0,iconType:"none",prefix:"",icon:"",paddingTopBottom:12,paddingLeftRight:24},{text:"",link:"",newTab:!1,color:"#ffffff",background:"#32373c",border:"",hoverColor:"",hoverBackground:"",hoverBorder:"",borderSize:0,borderRadius:0,boxShadow:!1,boxShadowColor:"",boxShadowColorOpacity:50,boxShadowBlur:5,boxShadowSpread:1,boxShadowHorizontal:0,boxShadowVertical:0,hoverBoxShadowColor:"",hoverBoxShadowColorOpacity:50,hoverBoxShadowBlur:5,hoverBoxShadowSpread:1,hoverBoxShadowHorizontal:0,hoverBoxShadowVertical:0,iconType:"none",prefix:"",icon:"",paddingTopBottom:12,paddingLeftRight:24}]}},ie=[{attributes:re,save:e=>{let{attributes:t,className:l}=e;const o="collapse-none"!==t.collapse?t.collapse:"",a={fontSize:`${t.fontSize}px`,fontFamily:t.fontFamily,fontWeight:t.fontVariant,fontStyle:t.fontStyle,textTransform:t.textTransform,lineHeight:t.lineHeight&&`${t.lineHeight}px`};return(0,i.createElement)("div",{id:t.id,className:g()(l,o),style:{justifyContent:t.align,alignItems:t.align?t.align:"flex-start"}},(0,K.times)(t.buttons,(e=>(e=>{const l={...a,borderWidth:`${t.data[e].borderSize}px`,borderRadius:`${t.data[e].borderRadius}px`,padding:`${t.data[e].paddingTopBottom}px ${t.data[e].paddingLeftRight}px`};return(0,i.createElement)(i.Fragment,null,(0,i.createElement)("a",{href:t.data[e].link,target:t.data[e].newTab?"_blank":"_self",className:g()("wp-block-themeisle-blocks-button",`wp-block-themeisle-blocks-button-${e}`),style:l},("left"===t.data[e].iconType||"only"===t.data[e].iconType)&&(0,i.createElement)("i",{className:g()(t.data[e].prefix,"fa-fw",`fa-${t.data[e].icon}`,{"margin-right":"left"===t.data[e].iconType})}),"only"!==t.data[e].iconType&&(0,i.createElement)(s.RichText.Content,{tagName:"span",value:t.data[e].text}),"right"===t.data[e].iconType&&(0,i.createElement)("i",{className:`${t.data[e].prefix} fa-fw fa-${t.data[e].icon} margin-left`})))})(e))))}},{attributes:re,save:e=>{let{attributes:t,className:l}=e;const o="collapse-none"!==t.collapse?t.collapse:"",a={fontSize:`${t.fontSize}px`,fontFamily:t.fontFamily,fontWeight:t.fontVariant,fontStyle:t.fontStyle,textTransform:t.textTransform,lineHeight:t.lineHeight&&`${t.lineHeight}px`};return(0,i.createElement)("div",{id:t.id,className:g()(l,o),style:{justifyContent:t.align,alignItems:t.align?t.align:"flex-start"}},(0,K.times)(t.buttons,(e=>(e=>{const l={...a,borderWidth:`${t.data[e].borderSize}px`,borderRadius:`${t.data[e].borderRadius}px`,padding:`${t.data[e].paddingTopBottom}px ${t.data[e].paddingLeftRight}px`};return(0,i.createElement)(i.Fragment,null,(0,i.createElement)("a",{href:t.data[e].link,target:t.data[e].newTab?"_blank":"_self",className:g()("wp-block-themeisle-blocks-button",`wp-block-themeisle-blocks-button-${e}`),style:l,rel:"noopener noreferrer"},("left"===t.data[e].iconType||"only"===t.data[e].iconType)&&(0,i.createElement)("i",{className:g()(t.data[e].prefix,"fa-fw",`fa-${t.data[e].icon}`,{"margin-right":"left"===t.data[e].iconType})}),"only"!==t.data[e].iconType&&(0,i.createElement)(s.RichText.Content,{tagName:"span",value:t.data[e].text}),"right"===t.data[e].iconType&&(0,i.createElement)("i",{className:`${t.data[e].prefix} fa-fw fa-${t.data[e].icon} margin-left`})))})(e))))}},{attributes:{...re,fontSize:{type:"number"},fontStyle:{type:"string"},data:{type:"array",default:[{text:"",link:"",newTab:!1,color:"",background:"",border:"",hoverColor:"",hoverBackground:"",hoverBorder:"",borderSize:"",borderRadius:"",boxShadow:!1,boxShadowColor:"",boxShadowColorOpacity:50,boxShadowBlur:5,boxShadowSpread:1,boxShadowHorizontal:0,boxShadowVertical:0,hoverBoxShadowColor:"",hoverBoxShadowColorOpacity:50,hoverBoxShadowBlur:5,hoverBoxShadowSpread:1,hoverBoxShadowHorizontal:0,hoverBoxShadowVertical:0,iconType:"none",prefix:"",icon:"",paddingTopBottom:"",paddingLeftRight:""},{text:"",link:"",newTab:!1,color:"",background:"",border:"",hoverColor:"",hoverBackground:"",hoverBorder:"",borderSize:"",borderRadius:"",boxShadow:!1,boxShadowColor:"",boxShadowColorOpacity:50,boxShadowBlur:5,boxShadowSpread:1,boxShadowHorizontal:0,boxShadowVertical:0,hoverBoxShadowColor:"",hoverBoxShadowColorOpacity:50,hoverBoxShadowBlur:5,hoverBoxShadowSpread:1,hoverBoxShadowHorizontal:0,hoverBoxShadowVertical:0,iconType:"none",prefix:"",icon:"",paddingTopBottom:"",paddingLeftRight:""}]}},migrate:(e,t)=>{let l,o,n;return"flex-start"===e.align&&(l="left"),"center"===e.align&&(l="center"),"flex-end"===e.align&&(l="right"),e.data&&(o=(0,K.pick)(e.data[0],["paddingLeftRight","paddingTopBottom"]),1<=Object.keys(o).length&&(o=(0,K.pick)(o,Object.keys(o).filter((e=>""!==o[e])))),n=e.data.filter(((t,l)=>l<e.buttons)).map((e=>{const t=(0,K.omit)(e,["paddingLeftRight","paddingTopBottom"]);return(0,a.createBlock)("themeisle-blocks/button",{...t})}))),[{...(0,K.omit)(e,["buttons","data"]),align:l,...o},[...n,...t]]},save:e=>{let{attributes:t,className:l}=e;const o="collapse-none"!==t.collapse?t.collapse:"";return(0,i.createElement)("div",{id:t.id,className:g()(l,o,"wp-block-button")},(0,K.times)(t.buttons,(e=>(e=>(0,i.createElement)("a",{href:t.data[e].link,target:t.data[e].newTab?"_blank":"_self",className:g()("wp-block-themeisle-blocks-button",`wp-block-themeisle-blocks-button-${e}`,"wp-block-button__link"),rel:"noopener noreferrer"},("left"===t.data[e].iconType||"only"===t.data[e].iconType)&&(0,i.createElement)("i",{className:g()(t.data[e].prefix,"fa-fw",`fa-${t.data[e].icon}`,{"margin-right":"left"===t.data[e].iconType})}),"only"!==t.data[e].iconType&&(0,i.createElement)(s.RichText.Content,{tagName:"span",value:t.data[e].text}),"right"===t.data[e].iconType&&(0,i.createElement)("i",{className:`${t.data[e].prefix} fa-fw fa-${t.data[e].icon} margin-left`})))(e))))}}];var se=ie,ce=l(4022),de=l(1138),ue=l(4934),be=l(2380),me=l(9700),pe=l(8286),ge=e=>{var t,l;let{attributes:a,setAttributes:n,currentDevice:r}=e;return(0,i.createElement)(s.InspectorControls,null,(0,i.createElement)(c.PanelBody,{title:(0,o.__)("Spacing","otter-blocks")},(0,i.createElement)(ee.Z,{label:(0,o.__)("Padding","otter-blocks"),min:0,max:100,onChange:(e,t)=>{"top"!==e&&"bottom"!==e||n({paddingTopBottom:t}),"right"!==e&&"left"!==e||n({paddingLeftRight:t})},options:[{label:(0,o.__)("Top","otter-blocks"),type:"top",value:a.paddingTopBottom},{label:(0,o.__)("Right","otter-blocks"),type:"right",value:a.paddingLeftRight},{label:(0,o.__)("Bottom","otter-blocks"),type:"bottom",value:a.paddingTopBottom},{label:(0,o.__)("Left","otter-blocks"),type:"left",value:a.paddingLeftRight}]}),(0,i.createElement)(c.RangeControl,{label:(0,o.__)("Spacing","otter-blocks"),value:a.spacing,onChange:e=>n({spacing:e}),step:.1,min:0,max:50}),(0,i.createElement)(c.SelectControl,{label:(0,o.__)("Collapse On","otter-blocks"),value:a.collapse,options:[{label:(0,o.__)("None","otter-blocks"),value:"collapse-none"},{label:(0,o.__)("Desktop","otter-blocks"),value:"collapse-desktop"},{label:(0,o.__)("Tablet","otter-blocks"),value:"collapse-tablet"},{label:(0,o.__)("Mobile","otter-blocks"),value:"collapse-mobile"}],onChange:e=>n({collapse:e})}),(0,i.createElement)(M.Z,{label:(0,o.__)("Alignment","otter-blocks"),className:"buttons-alignment-control"},(0,i.createElement)(pe.Z,{value:null!==(t=null==a||null===(l=a.align)||void 0===l?void 0:l[r])&&void 0!==t?t:"none",options:[{icon:ce.Z,label:(0,o.__)("None","otter-blocks"),value:"none"},{icon:de.Z,label:(0,o.__)("Full","otter-blocks"),value:"full"},{icon:ue.Z,label:(0,o.__)("Left","otter-blocks"),value:"left"},{icon:be.Z,label:(0,o.__)("Center","otter-blocks"),value:"center"},{icon:me.Z,label:(0,o.__)("Right","otter-blocks"),value:"right"}],onChange:e=>{const t=a.align?{desktop:a.align.desktop,tablet:a.align.tablet,mobile:a.align.mobile}:{};t[r]="none"===e?void 0:e,n({align:t})},hasIcon:!0}))),(0,i.createElement)(c.PanelBody,{title:(0,o.__)("Typography Settings","otter-blocks"),initialOpen:!1},(0,i.createElement)(c.RangeControl,{label:(0,o.__)("Font Size","otter-blocks"),value:a.fontSize,onChange:e=>n({fontSize:e}),step:.1,min:0,max:50}),(0,i.createElement)(y.Z,{label:(0,o.__)("Font Family","otter-blocks"),value:a.fontFamily,onChangeFontFamily:e=>{n(e?{fontFamily:e,fontVariant:"normal",fontStyle:"normal"}:{fontFamily:void 0,fontVariant:void 0,fontStyle:void 0})},valueVariant:a.fontVariant,onChangeFontVariant:e=>n({fontVariant:e}),valueStyle:a.fontStyle,onChangeFontStyle:e=>n({fontStyle:e}),valueTransform:a.textTransform,onChangeTextTransform:e=>n({textTransform:e})}),(0,i.createElement)(c.RangeControl,{label:(0,o.__)("Line Height","otter-blocks"),value:a.lineHeight,onChange:e=>n({lineHeight:e}),step:.1,min:0,max:200})))};const{attributes:he}=ne;const{name:ve}=ne;(0,a.registerBlockType)(ve,{...ne,title:(0,o.__)("Button Group","otter-blocks"),description:(0,o.__)("Prompt visitors to take action with a button group. Powered by Otter.","otter-blocks"),icon:r.buttonsIcon,keywords:["button","buttons","button group"],deprecated:se,edit:e=>{let{attributes:t,setAttributes:l,clientId:o}=e;const{isViewportAvailable:a,isPreviewDesktop:n,isPreviewTablet:r,isPreviewMobile:c}=(0,v.useSelect)((e=>{const{__experimentalGetPreviewDeviceType:t}=!!e("core/edit-post")&&e("core/edit-post");return{isViewportAvailable:!!t,isPreviewDesktop:!!t&&"Desktop"===t(),isPreviewTablet:!!t&&"Tablet"===t(),isPreviewMobile:!!t&&"Mobile"===t()}}),[]),d=(0,v.useSelect)((e=>{const{getView:t}=e("themeisle-gutenberg/data"),{__experimentalGetPreviewDeviceType:l}=!!e("core/edit-post")&&e("core/edit-post");return l?l().toLowerCase():t().toLowerCase()}),[]),u=(0,Y.useViewportMatch)("large",">="),b=(0,Y.useViewportMatch)("large","<="),m=(0,Y.useViewportMatch)("small",">="),p=(0,Y.useViewportMatch)("small","<=");(0,i.useEffect)((()=>{h.Z.attach();const e=(0,L.blockInit)(o,he);return()=>e(t.id)}),[]);let y=u&&!b&&m&&!p,k=!u&&!b&&m&&!p,f=!(u||b||m||p);a&&!f&&(y=n,k=r,f=c);const _={"--spacing":t.spacing&&t.spacing+"px"},w=["desktop","tablet","mobile"].reduce(((e,l)=>(t.align&&t.align[l]&&e.push(`align-${t.align[l]}-${l}`),e)),[]),C=(0,s.useBlockProps)({id:t.id,className:g()("wp-block-buttons",{[`align-${t.align}`]:"string"==typeof t.align,collapse:"collapse-desktop"===t.collapse&&(y||k||f)||"collapse-tablet"===t.collapse&&(k||f)||"collapse-mobile"===t.collapse&&f},...w),style:_});return(0,i.useEffect)((()=>{t.fontFamily&&h.Z.loadFontToBrowser(t.fontFamily,t.fontVariant)}),[t.fontFamily]),(0,i.createElement)(i.Fragment,null,(0,i.createElement)(ge,{attributes:t,setAttributes:l,currentDevice:d}),(0,i.createElement)("div",C,(0,i.createElement)(s.InnerBlocks,{allowedBlocks:["themeisle-blocks/button"],__experimentalMoverDirection:"horizontal",orientation:"horizontal",template:[["themeisle-blocks/button"]],renderAppender:s.InnerBlocks.DefaultAppender})))},save:e=>{let{attributes:t}=e;const l="collapse-none"!==t.collapse?t.collapse:"",o=["desktop","tablet","mobile"].reduce(((e,l)=>(t.align&&t.align[l]&&e.push(`align-${t.align[l]}-${l}`),e)),[]),a=s.useBlockProps.save({id:t.id,className:g()(l,"wp-block-buttons",{[`align-${t.align}`]:"string"==typeof t.align},...o)});return(0,i.createElement)("div",a,(0,i.createElement)(s.InnerBlocks.Content,null))},example:{attributes:{spacing:20},innerBlocks:[{name:"themeisle-blocks/button",attributes:{text:(0,o.__)("Button 1","otter-blocks")}},{name:"themeisle-blocks/button",attributes:{text:(0,o.__)("Button 2","otter-blocks")}}]}});var ye=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"themeisle-blocks/button","title":"Button","category":"themeisle-blocks","description":"Prompt visitors to take action with a button group. Powered by Otter.","keywords":["button","buttons","button group"],"parent":["themeisle-blocks/button-group"],"textdomain":"otter-blocks","attributes":{"id":{"type":"string"},"text":{"type":"string","source":"html","selector":"span"},"link":{"type":"string","source":"attribute","selector":"a","attribute":"href"},"newTab":{"type":"boolean","default":false},"color":{"type":"string"},"background":{"type":"string"},"backgroundGradient":{"type":"string"},"border":{"type":"string"},"hoverColor":{"type":"string"},"hoverBackground":{"type":"string"},"hoverBackgroundGradient":{"type":"string"},"hoverBorder":{"type":"string"},"borderSize":{"type":"number"},"borderRadius":{"type":"number"},"boxShadow":{"type":"boolean","default":false},"boxShadowColor":{"type":"string"},"boxShadowColorOpacity":{"type":"number","default":50},"boxShadowBlur":{"type":"number","default":5},"boxShadowSpread":{"type":"number","default":1},"boxShadowHorizontal":{"type":"number","default":0},"boxShadowVertical":{"type":"number","default":0},"hoverBoxShadowColor":{"type":"string"},"hoverBoxShadowColorOpacity":{"type":"number","default":50},"hoverBoxShadowBlur":{"type":"number","default":5},"hoverBoxShadowSpread":{"type":"number","default":1},"hoverBoxShadowHorizontal":{"type":"number","default":0},"hoverBoxShadowVertical":{"type":"number","default":0},"iconType":{"type":"string","default":"none"},"library":{"type":"string","default":"fontawesome"},"prefix":{"type":"string"},"icon":{"type":"string"}},"supports":{"reusable":false},"styles":[{"name":"fill","label":"Fill","isDefault":true},{"name":"outline","label":"Outline"}]}'),ke=l(8504),fe=e=>{let{attributes:t,setAttributes:l,isSelected:o}=e;return(0,i.createElement)(s.BlockControls,null,(0,i.createElement)(ke.Z,{isSelected:o,setAttributes:l,url:t.link,opensInNewTab:t.newTab}))},_e=e=>{let{attributes:t,setAttributes:l}=e;const[a,n]=(0,i.useState)(!1),r=()=>(0,i.createElement)(c.ButtonGroup,null,(0,i.createElement)(c.Button,{isSmall:!0,isSecondary:a,isPrimary:!a,onClick:()=>n(!1)},(0,o.__)("Normal","otter-blocks")),(0,i.createElement)(c.Button,{isSmall:!0,isSecondary:!a,isPrimary:a,onClick:()=>n(!0)},(0,o.__)("Hover","otter-blocks")));return(0,i.createElement)(s.InspectorControls,null,(0,i.createElement)(c.PanelBody,{title:(0,o.__)("Color","otter-blocks")},(0,i.createElement)(r,null),a?(0,i.createElement)(i.Fragment,{key:"with-hover"},(0,i.createElement)(s.__experimentalColorGradientControl,{label:(0,o.__)("Hover Color","otter-blocks"),colorValue:t.hoverColor,onColorChange:e=>l({hoverColor:e})}),(0,i.createElement)(s.__experimentalColorGradientControl,{label:(0,o.__)("Hover Background","otter-blocks"),colorValue:t.hoverBackground,gradientValue:t.hoverBackgroundGradient,onColorChange:e=>l({hoverBackground:e}),onGradientChange:e=>l({hoverBackgroundGradient:e})})):(0,i.createElement)(i.Fragment,{key:"without-hover"},(0,i.createElement)(s.__experimentalColorGradientControl,{label:(0,o.__)("Color","otter-blocks"),colorValue:t.color,onColorChange:e=>l({color:e})}),(0,i.createElement)(s.__experimentalColorGradientControl,{label:(0,o.__)("Background","otter-blocks"),colorValue:t.background,gradientValue:t.backgroundGradient,onColorChange:e=>l({background:e}),onGradientChange:e=>l({backgroundGradient:e})}))),(0,i.createElement)(c.PanelBody,{title:(0,o.__)("Border & Box Shadow","otter-blocks"),initialOpen:!1},(0,i.createElement)(r,null),a?(0,i.createElement)(s.__experimentalColorGradientControl,{label:(0,o.__)("Hover Border","otter-blocks"),colorValue:t.hoverBorder,onColorChange:e=>l({hoverBorder:e})}):(0,i.createElement)(s.__experimentalColorGradientControl,{label:(0,o.__)("Border","otter-blocks"),colorValue:t.border,onColorChange:e=>l({border:e})}),(0,i.createElement)(c.RangeControl,{label:(0,o.__)("Border Width","otter-blocks"),value:t.borderSize,onChange:e=>l({borderSize:e}),step:.1,min:0,max:10}),(0,i.createElement)(c.RangeControl,{label:(0,o.__)("Border Radius","otter-blocks"),value:t.borderRadius,onChange:e=>l({borderRadius:e}),step:.1,min:0,max:100}),(0,i.createElement)(X.Z,{label:(0,o.__)("Box Shadow","otter-blocks"),attributes:t,setAttributes:l,resetValues:{boxShadow:!1,boxShadowColor:void 0,boxShadowColorOpacity:50,boxShadowBlur:5,boxShadowSpread:1,boxShadowHorizontal:0,boxShadowVertical:0,hoverBoxShadowColor:void 0,hoverBoxShadowColorOpacity:50,hoverBoxShadowBlur:5,hoverBoxShadowSpread:1,hoverBoxShadowHorizontal:0,hoverBoxShadowVertical:0},onClick:()=>l({boxShadow:!0})},(0,i.createElement)(r,null),a?(0,i.createElement)(i.Fragment,{key:"with-hover"},(0,i.createElement)(s.__experimentalColorGradientControl,{label:(0,o.__)("Shadow Color on Hover","otter-blocks"),colorValue:t.hoverBoxShadowColor,onColorChange:e=>l({hoverBoxShadowColor:e})}),(0,i.createElement)(c.RangeControl,{label:(0,o.__)("Opacity","otter-blocks"),value:t.hoverBoxShadowColorOpacity,onChange:e=>l({hoverBoxShadowColorOpacity:e}),min:0,max:100}),(0,i.createElement)(c.RangeControl,{label:(0,o.__)("Blur","otter-blocks"),value:t.hoverBoxShadowBlur,onChange:e=>l({hoverBoxShadowBlur:e}),min:0,max:100}),(0,i.createElement)(c.RangeControl,{label:(0,o.__)("Spread","otter-blocks"),value:t.hoverBoxShadowSpread,onChange:e=>l({hoverBoxShadowSpread:e}),min:-100,max:100}),(0,i.createElement)(c.RangeControl,{label:(0,o.__)("Horizontal","otter-blocks"),value:t.hoverBoxShadowHorizontal,onChange:e=>l({hoverBoxShadowHorizontal:e}),min:-100,max:100}),(0,i.createElement)(c.RangeControl,{label:(0,o.__)("Vertical","otter-blocks"),value:t.hoverBoxShadowVertical,onChange:e=>l({hoverBoxShadowVertical:e}),min:-100,max:100})):(0,i.createElement)(i.Fragment,{key:"without-hover"},(0,i.createElement)(s.__experimentalColorGradientControl,{label:(0,o.__)("Shadow Color","otter-blocks"),colorValue:t.boxShadowColor,onColorChange:e=>l({boxShadowColor:e})}),(0,i.createElement)(c.RangeControl,{label:(0,o.__)("Opacity","otter-blocks"),value:t.boxShadowColorOpacity,onChange:e=>l({boxShadowColorOpacity:e}),min:0,max:100}),(0,i.createElement)(c.RangeControl,{label:(0,o.__)("Blur","otter-blocks"),value:t.boxShadowBlur,onChange:e=>l({boxShadowBlur:e}),min:0,max:100}),(0,i.createElement)(c.RangeControl,{label:(0,o.__)("Spread","otter-blocks"),value:t.boxShadowSpread,onChange:e=>l({boxShadowSpread:e}),min:-100,max:100}),(0,i.createElement)(c.RangeControl,{label:(0,o.__)("Horizontal","otter-blocks"),value:t.boxShadowHorizontal,onChange:e=>l({boxShadowHorizontal:e}),min:-100,max:100}),(0,i.createElement)(c.RangeControl,{label:(0,o.__)("Vertical","otter-blocks"),value:t.boxShadowVertical,onChange:e=>l({boxShadowVertical:e}),min:-100,max:100})))),(0,i.createElement)(c.PanelBody,{title:(0,o.__)("Icon Settings","otter-blocks"),initialOpen:!1},(0,i.createElement)(c.SelectControl,{label:(0,o.__)("Icon Position","otter-blocks"),value:t.iconType,options:[{label:(0,o.__)("No Icon","otter-blocks"),value:"none"},{label:(0,o.__)("Left","otter-blocks"),value:"left"},{label:(0,o.__)("Right","otter-blocks"),value:"right"},{label:(0,o.__)("Icon Only","otter-blocks"),value:"only"}],onChange:e=>l({iconType:e})}),"none"!==t.iconType&&(0,i.createElement)(_.Z,{label:(0,o.__)("Icon Picker","otter-blocks"),library:t.library,prefix:t.prefix,icon:t.icon,changeLibrary:e=>{l({library:e,icon:void 0,prefix:"fab"})},onChange:e=>{l("object"==typeof e?{icon:e.name,prefix:e.prefix}:{icon:e})}})))},we=l(48);const{attributes:Ce}=ye;const{name:Ee}=ye;(0,a.registerBlockType)(Ee,{...ye,title:(0,o.__)("Button","otter-blocks"),description:(0,o.__)("Prompt visitors to take action with a button group. Powered by Otter.","otter-blocks"),icon:r.buttonsIcon,keywords:["button","buttons","button group"],styles:[{name:"fill",label:(0,o.__)("Fill","otter-blocks"),isDefault:!0},{name:"outline",label:(0,o.__)("Outline","otter-blocks")},...window.themeisleGutenberg.hasNeve?[{name:"primary",label:(0,o.__)("Primary","otter-blocks")},{name:"secondary",label:(0,o.__)("Secondary","otter-blocks")}]:[]],edit:e=>{let{attributes:t,setAttributes:l,isSelected:a,clientId:n}=e;const{hasParent:r,parentAttributes:c}=(0,v.useSelect)((e=>{const{getBlock:t,getBlockRootClientId:l}=e("core/block-editor"),o=t(l(n));return{hasParent:!!o,parentAttributes:o?o.attributes:{}}}),[]);(0,i.useEffect)((()=>{const e=(0,L.blockInit)(n,Ce);return()=>e(t.id)}),[]);let d={},u={};t.boxShadow&&(d={boxShadow:`${t.boxShadowHorizontal}px ${t.boxShadowVertical}px ${t.boxShadowBlur}px ${t.boxShadowSpread}px ${Z()(t.boxShadowColor?t.boxShadowColor:"#000000",t.boxShadowColorOpacity)}`}),r&&(u={paddingTop:`${c.paddingTopBottom}px`,paddingBottom:`${c.paddingTopBottom}px`,paddingLeft:`${c.paddingLeftRight}px`,paddingRight:`${c.paddingLeftRight}px`,fontSize:c.fontSize&&`${c.fontSize}px`,fontFamily:c.fontFamily,fontWeight:c.fontVariant,fontStyle:c.fontStyle,textTransform:c.textTransform,lineHeight:c.lineHeight&&`${c.lineHeight}px`});const b={color:t.color,background:t.background||t.backgroundGradient,border:`${t.borderSize}px solid ${t.border}`,borderRadius:t.borderRadius,...d,...u},m={fill:t.color,width:c.fontSize&&`${c.fontSize}px`},p=we.ZP.icons[t.icon],[h,y]=(0,L.useCSSNode)();(0,i.useEffect)((()=>{y([`.wp-block-button__link:hover {\n\t\t\t\tcolor: ${t.hoverColor} !important;\n\t\t\t\tbackground: ${t.hoverBackground||t.hoverBackgroundGradient} !important;\n\t\t\t\tborder-color: ${t.hoverBorder} !important;\n\t\t\t\t${t.boxShadow&&`box-shadow: ${t.hoverBoxShadowHorizontal}px ${t.hoverBoxShadowVertical}px ${t.hoverBoxShadowBlur}px ${t.hoverBoxShadowSpread}px ${Z()(t.hoverBoxShadowColor?t.hoverBoxShadowColor:"#000000",t.hoverBoxShadowColorOpacity)} !important;`}\n\t\t\t}`,`.wp-block-button__link:hover svg {\n\t\t\t\tfill: ${t.hoverColor} !important;\n\t\t\t}`])}),[t.hoverColor,t.hoverBackground,t.hoverBackgroundGradient,t.hoverBorder,t.hoverColor,t.boxShadow,t.hoverBoxShadowHorizontal,t.hoverBoxShadowBlur,t.hoverBoxShadowSpread,t.hoverBoxShadowColor,t.hoverBoxShadowColorOpacity]);const k=(0,s.useBlockProps)({id:t.id,className:g()("wp-block-button",h),style:{}});return(0,i.createElement)(i.Fragment,null,(0,i.createElement)(fe,{attributes:t,setAttributes:l,isSelected:a}),(0,i.createElement)(_e,{attributes:t,setAttributes:l}),(0,i.createElement)("div",k,"none"!==t.iconType?(0,i.createElement)("div",{className:"wp-block-button__link",style:b},("left"===t.iconType||"only"===t.iconType)&&("themeisle-icons"===t.library&&t.icon?(0,i.createElement)(p,{className:g()({"margin-right":"left"===t.iconType}),style:m}):(0,i.createElement)("i",{className:g()(t.prefix,"fa-fw",`fa-${t.icon}`,{"margin-right":"left"===t.iconType})})),"only"!==t.iconType&&(0,i.createElement)(s.RichText,{placeholder:(0,o.__)("Add text…","otter-blocks"),value:t.text,onChange:e=>l({text:e}),tagName:"div",withoutInteractiveFormatting:!0}),"right"===t.iconType&&("themeisle-icons"===t.library&&t.icon?(0,i.createElement)(p,{className:"margin-left",style:m}):(0,i.createElement)("i",{className:`${t.prefix} fa-fw fa-${t.icon} margin-left`}))):(0,i.createElement)(s.RichText,{placeholder:(0,o.__)("Add text…","otter-blocks"),value:t.text,onChange:e=>l({text:e}),tagName:"div",withoutInteractiveFormatting:!0,className:"wp-block-button__link",style:b})))},save:e=>{let{attributes:t}=e;const l=we.ZP.icons[t.icon],o=s.useBlockProps.save({id:t.id,className:"wp-block-button"});return(0,i.createElement)("div",o,(0,i.createElement)("a",{href:t.link,target:t.newTab?"_blank":"_self",rel:"noopener noreferrer",className:"wp-block-button__link"},("left"===t.iconType||"only"===t.iconType)&&("themeisle-icons"===t.library&&t.icon?(0,i.createElement)(l,{className:g()({"margin-right":"left"===t.iconType})}):(0,i.createElement)("i",{className:g()(t.prefix,"fa-fw",`fa-${t.icon}`,{"margin-right":"left"===t.iconType})})),"only"!==t.iconType&&(0,i.createElement)(s.RichText.Content,{tagName:"span",value:t.text}),"right"===t.iconType&&("themeisle-icons"===t.library&&t.icon?(0,i.createElement)(l,{className:"margin-left"}):(0,i.createElement)("i",{className:`${t.prefix} fa-fw fa-${t.icon} margin-left`}))))},example:{attributes:{}}});var xe=l(269),Se=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"themeisle-blocks/circle-counter","title":"Circle Counter","category":"themeisle-blocks","description":"Show your progress with a beautiful Circle Counter block. Powered by Otter.","keywords":["progress","circle","counter"],"textdomain":"otter-blocks","attributes":{"id":{"type":"string"},"title":{"type":"string","default":"Skill"},"percentage":{"type":"number","default":50},"duration":{"type":"number","default":2},"titleStyle":{"type":"string","default":"default"},"height":{"type":"number","default":100},"fontSizeTitle":{"type":"number"},"fontSizePercent":{"type":"number"},"strokeWidth":{"type":"number","default":10},"backgroundColor":{"type":"string"},"progressColor":{"type":"string"},"titleColor":{"type":"string"}},"editorStyle":"otter-circle-counter-editor","style":"otter-circle-counter-style","script":"otter-circle-counter"}'),Te=e=>{let{attributes:t,setAttributes:l}=e;return(0,i.createElement)(s.InspectorControls,null,(0,i.createElement)(c.PanelBody,{title:(0,o.__)("Settings","otter-blocks")},(0,i.createElement)(c.RangeControl,{label:(0,o.__)("Percentage","otter-blocks"),help:(0,o.__)("The value of the counter.","otter-blocks"),value:t.percentage,onChange:e=>{void 0!==e&&(e=(0,K.clamp)(e,0,100),l({percentage:e}))},min:0,max:100}),(0,i.createElement)(c.RangeControl,{label:(0,o.__)("Duration","otter-blocks"),help:(0,o.__)("The duration of the animation.","otter-blocks"),value:t.duration,onChange:e=>{void 0!==e&&(e=(0,K.clamp)(e,0,3),l({duration:e}))},min:0,max:3}),(0,i.createElement)(c.SelectControl,{label:(0,o.__)("Title Style","otter-blocks"),value:t.titleStyle,options:[{label:(0,o.__)("Default","otter-blocks"),value:"default"},{label:(0,o.__)("Hide","otter-blocks"),value:"hide"},{label:(0,o.__)("Bottom","otter-blocks"),value:"bottom"}],onChange:e=>l({titleStyle:e})})),(0,i.createElement)(c.PanelBody,{title:(0,o.__)("Style","otter-blocks")},(0,i.createElement)(c.RangeControl,{label:(0,o.__)("Height","otter-blocks"),help:(0,o.__)("The height of the circle counter.","otter-blocks"),value:t.height,onChange:e=>l({height:e}),min:0,max:240}),(0,i.createElement)(c.RangeControl,{label:(0,o.__)("Circle Thickness","otter-blocks"),help:(0,o.__)("Change the thickness (stroke width) of the circle.","otter-blocks"),value:t.strokeWidth,onChange:e=>l({strokeWidth:e}),initialPosition:10,min:0,max:20}),(0,i.createElement)(c.RangeControl,{label:(0,o.__)("Font Size Title","otter-blocks"),help:(0,o.__)("Change the font size of the title.","otter-blocks"),value:t.fontSizeTitle,onChange:e=>l({fontSizeTitle:e}),initialPosition:37,min:0,max:100}),(0,i.createElement)(c.RangeControl,{label:(0,o.__)("Font Size Percent","otter-blocks"),help:(0,o.__)("Change the font size of the inner text.","otter-blocks"),value:t.fontSizePercent,onChange:e=>l({fontSizePercent:e}),initialPosition:27,min:0,max:80}),"hide"!==t.titleStyle&&(0,i.createElement)(s.__experimentalColorGradientControl,{label:(0,o.__)("Title Color","otter-blocks"),colorValue:t.titleColor,onColorChange:e=>l({titleColor:e})}),(0,i.createElement)(s.__experimentalColorGradientControl,{label:(0,o.__)("Progress Color","otter-blocks"),colorValue:t.progressColor,onColorChange:e=>l({progressColor:e})}),(0,i.createElement)(s.__experimentalColorGradientControl,{label:(0,o.__)("Background Color","otter-blocks"),colorValue:t.backgroundColor,onColorChange:e=>l({backgroundColor:e})})))},Me=e=>{let{attributes:t,progressRef:l,valueRef:o}=e;const a=t.height,n=a/2,r=a/2-t.strokeWidth/2,s=2*Math.PI*r;return 0>r?(0,i.createElement)("div",null):(0,i.createElement)("div",{className:"wp-block-themeisle-blocks-circle-counter__bar",style:{height:a+"px",width:a+"px"}},(0,i.createElement)("svg",{className:"wp-block-themeisle-blocks-circle-counter-container",width:a,height:a},(0,i.createElement)("circle",{className:"wp-block-themeisle-blocks-circle-counter-bg",cx:n,cy:n,r:r,strokeWidth:t.strokeWidth,style:{stroke:t.backgroundColor}}),(0,i.createElement)("circle",{ref:l,className:"wp-block-themeisle-blocks-circle-counter-progress",cx:n,cy:n,r:r,strokeWidth:t.strokeWidth,strokeDasharray:s,style:{stroke:t.progressColor}}),(0,i.createElement)("text",{ref:o,className:"wp-block-themeisle-blocks-circle-counter-text",x:"50%",y:"50%",style:{fill:t.progressColor,fontSize:t.fontSizePercent+"px"}},t.percentage,"%")))};const{attributes:Be}=Se;const{clamp:ze,omit:Pe}=lodash,Le={to:[{type:"block",blocks:["themeisle-blocks/progress-bar"],transform:e=>{const t=Pe(e,["titleStyle","height","fontSize","strokeWidth","progressColor"]);return(0,a.createBlock)("themeisle-blocks/progress-bar",{...t,barBackgroundColor:e.progressColor,height:ze(e.height/4,0,100),titleStyle:"default"})}}]};var Re=Le;const{name:Fe}=Se;(0,a.registerBlockType)(Fe,{...Se,title:(0,o.__)("Circle Counter","otter-blocks"),description:(0,o.__)("Show your progress with a beautiful Circle Counter block. Powered by Otter.","otter-blocks"),icon:xe.Z,keywords:["progress","circle","counter"],transforms:Re,edit:e=>{let{clientId:t,attributes:l,setAttributes:a,isSelected:n,toggleSelection:r}=e;(0,i.useEffect)((()=>{const e=(0,L.blockInit)(t,Be);return()=>e(l.id)}),[l.id]);const d=(0,i.useRef)(null),u=(0,i.useRef)(null),[b,m]=(0,i.useState)({}),p=l.height/2-l.strokeWidth/2,g=2*Math.PI*p;(0,i.useEffect)((()=>{if(!d.current||!d.current||0===l.duration)return;const e=l.percentage/(1e3*l.duration),t=(0,K.range)(0,1e3*l.duration+20,20).map((t=>t*e)).reverse();b&&clearInterval(b),d.current.style.strokeDashoffset=g,u.current.innerText="0%";const o=setInterval((()=>{if(!d.current)return void clearInterval(o);const e=Math.round(t.pop());d.current.style.strokeDashoffset=(100-e)/100*g,u.current.innerHTML=e+"%",0===t.length&&clearInterval(o)}),20);return m(o),()=>{clearInterval(o)}}),[l.duration]),(0,i.useEffect)((()=>{if(d.current&&d.current)return d.current.style.strokeDashoffset=(100-l.percentage)/100*g,u.current.innerHTML=l.percentage+"%",clearInterval(b),()=>{clearInterval(b)}}),[l.percentage,l.height]);const h={"--font-size-title":(v=l.fontSizeTitle,v?`${v}px`:v)};var v;const y=(0,s.useBlockProps)({id:l.id,style:h});return(0,i.createElement)(i.Fragment,null,(0,i.createElement)(Te,{attributes:l,setAttributes:a}),(0,i.createElement)("div",y,"default"===l.titleStyle&&(0,i.createElement)("div",{className:"wp-block-themeisle-blocks-circle-counter-title__area"},(0,i.createElement)(s.RichText,{tagName:"span",allowedFormats:[],className:"wp-block-themeisle-blocks-circle-counter-title__value",placeholder:n?(0,o.__)("Write caption…","otter-blocks"):null,value:l.title,onChange:e=>a({title:e}),multiline:!1,style:{color:l.titleColor}})),(0,i.createElement)(c.ResizableBox,{size:{height:l.height,width:l.height},minHeight:0,maxHeight:240,enable:{top:!1,right:!1,bottom:!0,left:!1},showHandle:n,onResizeStop:(e,t,o,n)=>{a({height:parseInt(l.height+n.height,10)}),r(!0)},onResizeStart:()=>{r(!1)}},(0,i.createElement)(Me,{attributes:l,progressRef:d,valueRef:u})),"bottom"===l.titleStyle&&(0,i.createElement)("div",{className:"wp-block-themeisle-blocks-circle-counter-title__area"},(0,i.createElement)(s.RichText,{tagName:"span",allowedFormats:[],className:"wp-block-themeisle-blocks-circle-counter-title__value",placeholder:n?(0,o.__)("Write caption…","otter-blocks"):null,value:l.title,onChange:e=>a({title:e}),multiline:!1,style:{color:l.titleColor}}))))},save:e=>{let{attributes:t}=e;const l=s.useBlockProps.save({id:t.id,"data-percentage":t.percentage,"data-duration":t.duration,"data-height":t.height,"data-stroke-width":t.strokeWidth,"data-font-size-percent":t.fontSizePercent,"data-background-stroke":t.backgroundColor,"data-progress-stroke":t.progressColor});return(0,i.createElement)("div",l,"default"===t.titleStyle&&(0,i.createElement)("div",{className:"wp-block-themeisle-blocks-circle-counter-title__area"},(0,i.createElement)("span",{className:"wp-block-themeisle-blocks-circle-counter-title__value"},t.title)),(0,i.createElement)("div",{className:"wp-block-themeisle-blocks-circle-counter__bar"}),"bottom"===t.titleStyle&&(0,i.createElement)("div",{className:"wp-block-themeisle-blocks-circle-counter-title__area"},(0,i.createElement)("span",{className:"wp-block-themeisle-blocks-circle-counter-title__value"},t.title)))},example:{attributes:{title:"Lorem ipsum"}}});var Ae=l(2506),He=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"themeisle-blocks/countdown","title":"Countdown","category":"themeisle-blocks","description":"Set a countdown for a date. Powered by Otter.","keywords":["countdown","time","counter"],"textdomain":"otter-blocks","attributes":{"id":{"type":"string"},"date":{"type":"string"},"exclude":{"type":"array"},"backgroundColor":{"type":"string"},"valueColor":{"type":"string"},"labelColor":{"type":"string"},"labelDistance":{"type":"number"},"separatorColor":{"type":"string"},"gap":{"type":"number"},"gapTablet":{"type":"number"},"gapMobile":{"type":"number"},"width":{"type":"number"},"widthTablet":{"type":"number"},"widthMobile":{"type":"number"},"containerWidth":{"type":"string"},"containerWidthTablet":{"type":"string"},"containerWidthMobile":{"type":"string"},"height":{"type":"number"},"heightTablet":{"type":"number"},"heightMobile":{"type":"number"},"borderRadius":{"type":["number","object"]},"borderRadiusBox":{"type":"object"},"borderStyle":{"type":"string"},"borderWidth":{"type":"number"},"borderWidthTablet":{"type":"number"},"borderWidthMobile":{"type":"number"},"borderColor":{"type":"string"},"valueFontSize":{"type":["number","string"]},"valueFontSizeTablet":{"type":["number","string"]},"valueFontSizeMobile":{"type":["number","string"]},"labelFontSize":{"type":["number","string"]},"labelFontSizeTablet":{"type":["number","string"]},"labelFontSizeMobile":{"type":["number","string"]},"hasSeparators":{"type":"boolean"},"valueFontWeight":{"type":"string"},"labelFontWeight":{"type":"string"},"alignment":{"type":"string"},"padding":{"type":"object"},"paddingTablet":{"type":"object"},"paddingMobile":{"type":"object"},"borderRadiusTopRight":{"type":"number"},"borderRadiusTopLeft":{"type":"number"},"borderRadiusBottomRight":{"type":"number"},"borderRadiusBottomLeft":{"type":"number"},"borderRadiusType":{"type":"string","default":"linked"},"separatorAlignment":{"type":"string"},"behaviour":{"type":"string"},"redirectLink":{"type":"string"},"mode":{"type":"string"},"timer":{"type":"object"},"startInterval":{"type":"string"},"endInterval":{"type":"string"},"onEndAction":{"type":"string"}},"supports":{"align":["wide","full"]},"editorStyle":"otter-countdown-editor","style":"otter-countdown-style","script":"otter-countdown"}'),Oe=l(6292),Ne=l.n(Oe),Ve=l(9771),Ie=l(2694),De=l(9084);const Ge=[{name:(0,o.__)("Small","otter-blocks"),size:"0.875em",slug:"small"},{name:(0,o.__)("Medium","otter-blocks"),size:"1em",slug:"medium"},{name:(0,o.__)("Large","otter-blocks"),size:"1.125em",slug:"large"},{name:(0,o.__)("XL","otter-blocks"),size:"1.25em",slug:"xl"}],$e=["","100","200","300","400","500","600","700","800","900"].map((e=>({label:e||"Default",value:e}))),We=e=>{var t;let{attributes:l}=e;return(0,i.createElement)(i.Fragment,null,(0,i.createElement)(c.SelectControl,{label:(0,o.__)("Countdown Type","otter-blocks"),value:l.mode,options:[{label:(0,o.__)("Static","otter-blocks"),value:""},{label:(0,o.__)("Evergreen (Pro)","otter-blocks"),value:"timer",disabled:!0},{label:(0,o.__)("Interval (Pro)","otter-blocks"),value:"interval",disabled:!0}],help:(0,o.__)("An universal deadline for all visitors","otter-blocks")}),!Boolean(null===(t=window.themeisleGutenberg)||void 0===t?void 0:t.hasPro)&&(0,i.createElement)(De.Z,{notice:(0,i.createElement)(c.ExternalLink,{href:(0,x.Wi)(window.themeisleGutenberg.upgradeLink,"countdownfeature")},(0,o.__)("Get more options with Otter Pro.","otter-blocks")),variant:"upsell"}))},Ze=()=>{var e;return(0,i.createElement)(i.Fragment,null,(0,i.createElement)(c.SelectControl,{label:(0,o.__)("On Expire","otter-blocks"),value:"default",onChange:()=>{},options:[{label:(0,o.__)("No action","otter-blocks"),value:"default"},{label:(0,o.__)("Hide the Countdown","otter-blocks"),value:"hide"},{label:(0,o.__)("Redirect to link","otter-blocks"),value:"redirectLink"}],help:(0,o.__)("The countdown remains visible when it reaches 0","otter-blocks"),disabled:!0}),(0,i.createElement)(c.ToggleControl,{label:(0,o.__)("Hide/Show Blocks When the Countdown Ends","otter-blocks"),help:(0,o.__)("Enable Hide/Show other blocks when the Countdown ends.","otter-blocks"),checked:!1,onChange:()=>{},disabled:!0}),!Boolean(null===(e=window.themeisleGutenberg)||void 0===e?void 0:e.hasPro)&&(0,i.createElement)(De.Z,{notice:(0,i.createElement)(c.ExternalLink,{href:(0,x.Wi)(window.themeisleGutenberg.upgradeLink,"countdownfeature")},(0,o.__)("Get more options with Otter Pro.","otter-blocks")),variant:"upsell"}))};var je=e=>{var t,l,a,n,r,d,u,b,m;let{attributes:p,setAttributes:g}=e;const{responsiveSetAttributes:h,responsiveGetAttributes:v}=S(g),y=(e,t)=>{var l;g(e?{exclude:null==p||null===(l=p.exclude)||void 0===l?void 0:l.filter((e=>e!==t))}:{exclude:null!=p&&p.exclude?[...null==p?void 0:p.exclude,t]:[t]})},k=(0,Ve.__experimentalGetSettings)();return(0,i.createElement)(s.InspectorControls,null,(0,i.createElement)(c.PanelBody,{title:(0,o.__)("Time Settings","otter-blocks")},(0,Ie.applyFilters)("otter.countdown.controls.settings",(0,i.createElement)(We,{attributes:p}),{attributes:p,setAttributes:g}),void 0===p.mode&&(0,i.createElement)(c.Dropdown,{position:"bottom left",headerTitle:(0,o.__)("Select the date for the deadline","otter-blocks"),renderToggle:e=>{let{onToggle:t,isOpen:l}=e;return(0,i.createElement)(i.Fragment,null,(0,i.createElement)(c.Button,{onClick:t,isSecondary:!0,"aria-expanded":l,className:"o-extend-btn"},p.date?(0,Ve.format)(k.formats.datetime,p.date):(0,o.__)("Select Date","otter-blocks")))},renderContent:()=>(0,i.createElement)(c.DateTimePicker,{currentDate:p.date,onChange:e=>g({date:e})}),className:"o-extend"})),(0,i.createElement)(c.PanelBody,{title:(0,o.__)("Display","otter-blocks"),initialOpen:!1},(0,i.createElement)(c.ToggleControl,{label:(0,o.__)("Display Days","otter-blocks"),checked:!(null!=p&&null!==(t=p.exclude)&&void 0!==t&&t.includes("day")),onChange:e=>y(e,"day")}),(0,i.createElement)(c.ToggleControl,{label:(0,o.__)("Display Hours","otter-blocks"),checked:!(null!=p&&null!==(l=p.exclude)&&void 0!==l&&l.includes("hour")),onChange:e=>y(e,"hour")}),(0,i.createElement)(c.ToggleControl,{label:(0,o.__)("Display Minutes","otter-blocks"),checked:!(null!=p&&null!==(a=p.exclude)&&void 0!==a&&a.includes("minute")),onChange:e=>y(e,"minute")}),(0,i.createElement)(c.ToggleControl,{label:(0,o.__)("Display Seconds","otter-blocks"),checked:!(null!=p&&null!==(n=p.exclude)&&void 0!==n&&n.includes("second")),onChange:e=>y(e,"second")}),(0,i.createElement)(c.ToggleControl,{label:(0,o.__)("Display Separators","otter-blocks"),checked:null==p?void 0:p.hasSeparators,onChange:e=>g({hasSeparators:e})}),(0,i.createElement)(M.Z,{label:(0,o.__)("Space Between boxes","otter-blocks")},(0,i.createElement)(c.RangeControl,{value:null!==(r=v([p.gap,p.gapTablet,p.gapMobile]))&&void 0!==r?r:6,onChange:e=>h(e,["gap","gapTablet","gapMobile"]),min:0,max:100,allowReset:!0}))),(0,i.createElement)(c.PanelBody,{title:(0,o.__)("End Action","otter-blocks"),initialOpen:!1},(0,Ie.applyFilters)("otter.countdown.controls.end",(0,i.createElement)(Ze,null),{attributes:p,setAttributes:g})),(0,i.createElement)(c.PanelBody,{title:(0,o.__)("Dimensions","otter-blocks"),initialOpen:!1},(0,i.createElement)(M.Z,{label:(0,o.__)("Width","otter-blocks")},(0,i.createElement)(c.__experimentalUnitControl,{value:null!==(d=v([p.containerWidth,p.containerWidthTablet,p.containerWidthMobile]))&&void 0!==d?d:"100%",onChange:e=>h(e,["containerWidth","containerWidthTablet","containerWidthMobile"])})),(0,i.createElement)(M.Z,{label:(0,o.__)("Height","otter-blocks")},(0,i.createElement)(c.RangeControl,{value:null!==(u=v([p.height,p.heightTablet,p.heightMobile]))&&void 0!==u?u:100,onChange:e=>h(e,["height","heightTablet","heightMobile"]),min:50,max:800,allowReset:!0})),(0,i.createElement)(c.SelectControl,{label:(0,o.__)("Position","otter-blocks"),value:p.alingment,onChange:e=>g({alignment:e||void 0}),options:[{label:(0,o.__)("Default","otter-blocks"),value:""},{label:(0,o.__)("Left","otter-blocks"),value:"flex-start"},{label:(0,o.__)("Center","otter-blocks"),value:"center"},{label:(0,o.__)("Right","otter-blocks"),value:"flex-end"}]}),p.hasSeparators&&(0,i.createElement)(c.SelectControl,{label:(0,o.__)("Separator Alignment","otter-blocks"),value:p.separatorAlignment,onChange:e=>{g(e?{separatorAlignment:e}:{separatorAlignment:void 0})},options:[{label:(0,o.__)("Default","otter-blocks"),value:""},{label:(0,o.__)("Center","otter-blocks"),value:"center"}]})),(0,i.createElement)(c.PanelBody,{title:(0,o.__)("Typography","otter-blocks"),initialOpen:!1},(0,i.createElement)(M.Z,{label:(0,o.__)("Time Value Font Size","otter-blocks")},(0,i.createElement)(c.FontSizePicker,{fontSizes:Ge,withReset:!0,value:v([p.valueFontSize,p.valueFontSizeTablet,p.valueFontSizeMobile]),onChange:e=>h(e,["valueFontSize","valueFontSizeTablet","valueFontSizeMobile"])})),(0,i.createElement)(c.SelectControl,{label:(0,o.__)("Time Value Font Weight","otter-blocks"),value:p.valueFontWeight,onChange:e=>g({valueFontWeight:e||void 0}),options:$e}),(0,i.createElement)(M.Z,{label:(0,o.__)("Label Font Size","otter-blocks")},(0,i.createElement)(c.FontSizePicker,{fontSizes:Ge,withReset:!0,value:v([p.labelFontSize,p.labelFontSizeTablet,p.labelFontSizeMobile]),onChange:e=>h(e,["labelFontSize","labelFontSizeTablet","labelFontSizeMobile"])})),(0,i.createElement)(c.SelectControl,{label:(0,o.__)("Label Font Weight","otter-blocks"),value:p.labelFontWeight,onChange:e=>g({labelFontWeight:e||void 0}),options:$e})),(0,i.createElement)(s.PanelColorSettings,{title:(0,o.__)("Color","otter-blocks"),initialOpen:!1,colorSettings:[{value:p.backgroundColor,onChange:e=>g({backgroundColor:e}),label:(0,o.__)("Background","otter-blocks")},{value:p.valueColor,onChange:e=>g({valueColor:e}),label:(0,o.__)("Time Value","otter-blocks")},{value:p.labelColor,onChange:e=>g({labelColor:e}),label:(0,o.__)("Label","otter-blocks")},{value:p.separatorColor,onChange:e=>g({separatorColor:e}),label:(0,o.__)("Separator","otter-blocks")},{value:p.borderColor,onChange:e=>g({borderColor:e}),label:(0,o.__)("Border","otter-blocks")}]},(0,i.createElement)(s.ContrastChecker,{textColor:p.backgroundColor,backgroundColor:p.valueColor})),(0,i.createElement)(c.PanelBody,{title:(0,o.__)("Border","otter-blocks"),initialOpen:!1},(0,i.createElement)(c.SelectControl,{label:(0,o.__)("Type","otter-blocks"),value:null!==(b=p.borderStyle)&&void 0!==b?b:"solid",onChange:e=>g({borderStyle:"solid"===e?void 0:e}),options:[{label:(0,o.__)("None","otter-blocks"),value:"none"},{label:(0,o.__)("Solid","otter-blocks"),value:"solid"},{label:(0,o.__)("Double","otter-blocks"),value:"double"},{label:(0,o.__)("Dotted","otter-blocks"),value:"dotted"},{label:(0,o.__)("Dashed","otter-blocks"),value:"dashed"}]}),"none"!==p.borderStyle&&(0,i.createElement)(M.Z,{label:(0,o.__)("Width","otter-blocks")},(0,i.createElement)(c.RangeControl,{value:null!==(m=v([p.borderWidth,p.borderWidthTablet,p.borderWidthMobile]))&&void 0!==m?m:2,onChange:e=>h(e,["borderWidth","borderWidthTablet","borderWidthMobile"]),min:0,max:50,allowReset:!0})),(0,i.createElement)(c.__experimentalBoxControl,{label:(0,o.__)("Border Radius","otter-blocks"),values:(0,x.Dv)(p.borderRadiusBox,{left:"0px",right:"0px",bottom:"0px",top:"0px"}),onChange:e=>{g({borderRadiusBox:(0,x.cg)(e,{left:"0px",right:"0px",bottom:"0px",top:"0px"})})},id:"o-border-raduis-box"})))};const Ue=1e3,qe=6e4,Je=36e5,Ke=864e5,Ye=function(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return null!==(e=parseInt((null==t?void 0:t.days)||"0")*Ke+parseInt((null==t?void 0:t.hours)||"0")*Je+parseInt((null==t?void 0:t.minutes)||"0")*qe+parseInt((null==t?void 0:t.seconds)||"0")*Ue)&&void 0!==e?e:0},Qe=(e,t)=>{var l;null!==(l=e)&&void 0!==l||(e=0);const a=Math.floor(e/Ke),n=Math.floor(e/Je%24),r=Math.floor(e/qe%60),i=Math.floor(e/Ue%60);return[{tag:"day",name:1<a?(0,o.__)("Days","otter-blocks"):(0,o.__)("Day","otter-blocks"),value:a},{tag:"hour",name:1<n?(0,o.__)("Hours","otter-blocks"):(0,o.__)("Hour","otter-blocks"),value:n},{tag:"minute",name:1<r?(0,o.__)("Minutes","otter-blocks"):(0,o.__)("Minute","otter-blocks"),value:r},{tag:"second",name:1<i?(0,o.__)("Seconds","otter-blocks"):(0,o.__)("Second","otter-blocks"),value:i}].filter((e=>{var l;let{tag:o}=e;return!(null!=t&&null!==(l=t.exclude)&&void 0!==l&&l.includes(o))})).map((e=>(null!=t&&t.keepNeg||(e.value=Math.max(0,e.value)),e)))},Xe=e=>{let{name:t,value:l,tag:o}=e;return(0,i.createElement)("div",{name:o,className:g()("otter-countdown__display-area",{"is-main-component":"separator"!==o})},(0,i.createElement)("div",{className:"otter-countdown__value"},l),(0,i.createElement)("div",{className:"otter-countdown__label"},t))};var et=e=>{var t;let{time:l,settings:o,hasSeparators:a}=e;const n=4===(null==o||null===(t=o.exclude)||void 0===t?void 0:t.length)?Qe(null!=l?l:0,{}):Qe(null!=l?l:0,{exclude:null==o?void 0:o.exclude}),r=a?(0,x.S3)(n,{name:"sep",value:":",tag:"separator"}):n,s=null==r?void 0:r.map(((e,t)=>(0,i.createElement)(Xe,(0,J.Z)({},e,{key:t}))));return(0,i.createElement)("div",{className:"otter-countdown__container"},void 0!==l&&(0,i.createElement)("div",{className:"otter-countdown__display"},s))};const{attributes:tt}=He,lt=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"px";return(0,K.isNumber)(e)?`${e}${t}`:e};const ot=e=>{let{name:t,value:l,tag:o}=e;return(0,i.createElement)("div",{name:o,className:g()("otter-countdown__display-area",{"is-main-component":"separator"!==o})},(0,i.createElement)("div",{className:"otter-countdown__value"},l),(0,i.createElement)("div",{className:"otter-countdown__label"},t))},at=e=>{let{time:t,hasSeparators:l}=e;const o=l?(0,x.S3)(t,{name:"sep",value:":",tag:"separator"}):t,a=null==o?void 0:o.map(((e,t)=>(0,i.createElement)(ot,(0,J.Z)({},e,{key:t}))));return void 0!==t?(0,i.createElement)("div",{className:"otter-countdown__container"},(0,i.createElement)("div",{className:"otter-countdown__display"},a)):(0,i.createElement)(i.Fragment,null)};const{name:nt}=He;(0,a.registerBlockType)(nt,{...He,title:(0,o.__)("Countdown","otter-blocks"),description:(0,o.__)("Set a countdown for a date. Powered by Otter.","otter-blocks"),icon:Ae.Z,keywords:["countdown","time","counter"],edit:e=>{var t;let{attributes:l,setAttributes:a,clientId:n}=e;const[r,d]=(0,i.useState)(0);(0,i.useEffect)((()=>{const e=(0,L.blockInit)(n,tt);return()=>e(l.id)}),[l.id]),(0,i.useEffect)((()=>{if(void 0===l.borderRadiusBox&&(l.borderRadius||l.borderRadiusBottomLeft||l.borderRadiusTopRight||l.borderRadiusTopLeft||l.borderRadiusBottomRight)){const e=(0,K.pickBy)("linked"===(null==l?void 0:l.borderRadiusType)?{left:lt(l.borderRadius,"%"),right:lt(l.borderRadius,"%"),bottom:lt(l.borderRadius,"%"),top:lt(l.borderRadius,"%")}:{left:lt(l.borderRadiusBottomLeft,"%"),right:lt(l.borderRadiusTopRight,"%"),bottom:lt(l.borderRadiusBottomRight,"%"),top:lt(l.borderRadiusTopLeft,"%")},(e=>e));(0,K.isEmpty)(e)||a({borderRadiusBox:e,borderRadius:void 0,borderRadiusBottomLeft:void 0,borderRadiusTopRight:void 0,borderRadiusBottomRight:void 0,borderRadiusTopLeft:void 0,borderRadiusType:void 0})}}),[]),(0,i.useEffect)((()=>{let e;return"timer"!==l.mode&&(e=setInterval((()=>{if(l.date){const e=1e3*Ne()(l.date+(0,x.EP)()).unix();d(e-Date.now())}}),500)),()=>{clearInterval(e)}}),[l.date,l.mode]);const u={"--border-radius":(0,x.bv)(l.borderRadiusBox),"--border-style":l.borderStyle,"--background-color":l.backgroundColor,"--border-color":l.borderColor,"--container-width":l.containerWidth,"--container-width-tablet":l.containerWidthTablet,"--container-width-mobile":l.containerWidthMobile,"--height":lt(l.height),"--height-tablet":lt(l.heightTablet),"--height-mobile":lt(l.heightMobile),"--border-width":lt(l.borderWidth),"--border-width-tablet":lt(l.borderWidthTablet),"--border-width-mobile":lt(l.borderWidthMobile),"--gap":lt(l.gap),"--gap-tablet":lt(l.gapTablet),"--gap-mobile":lt(l.gapMobile),"--value-font-size":lt(l.valueFontSize),"--value-font-size-tablet":lt(l.valueFontSizeTablet),"--value-font-size-mobile":lt(l.valueFontSizeMobile),"--label-font-size":lt(l.labelFontSize),"--label-font-size-tablet":lt(l.labelFontSizeTablet),"--label-font-size-mobile":lt(l.labelFontSizeMobile),"--alignment":l.alignment,"--padding":(0,x.bv)(l.padding),"--padding-tablet":(0,x.bv)(l.paddingTablet),"--padding-mobile":(0,x.bv)(l.paddingMobile),"--value-font-weight":l.valueFontWeight,"--label-font-weight":l.labelFontWeight},[b,m]=(0,L.useCSSNode)();(0,i.useEffect)((()=>{m([`.otter-countdown__display-area .otter-countdown__value {\n\t\t\t\tcolor: ${l.valueColor};\n\t\t\t}`,`.otter-countdown__display-area .otter-countdown__label {\n\t\t\t\tcolor: ${l.labelColor};\n\t\t\t}`,`.otter-countdown__display-area[name="separator"] .otter-countdown__value {\n\t\t\t\tcolor: ${l.separatorColor};\n\t\t\t}`,"center"===l.separatorAlignment?'\n\t\t\t.otter-countdown__display-area[name="separator"] .otter-countdown__label {\n\t\t\t\tdisplay: none;\n\t\t\t}\n\t\t\t':""])}),[l.valueColor,l.labelColor,l.separatorColor,l.separatorAlignment]);const p=(0,s.useBlockProps)({id:l.id,className:g()(b,"ready"),style:u});return(0,i.createElement)(i.Fragment,null,(0,i.createElement)(je,{attributes:l,setAttributes:a}),(0,i.createElement)("div",p,(0,i.createElement)(et,{time:(()=>{switch(l.mode){case"timer":return Ye(l.timer);case"interval":return((e,t)=>{if(!e||!t)return 0;const l=new Date(e).getTime();return new Date(t).getTime()-l})(l.startInterval,l.endInterval);default:return r}})(),settings:{exclude:null==l?void 0:l.exclude},hasSeparators:l.hasSeparators}),4===(null==l||null===(t=l.exclude)||void 0===t?void 0:t.length)&&(0,i.createElement)(i.Fragment,null,(0,i.createElement)("br",null),(0,i.createElement)(c.Notice,{isDismissible:!1,status:"info"},(0,o.__)("The Countdown will be hidden in page","otter-blocks")))))},save:e=>{let{attributes:t}=e;const l=t.startInterval&&t.endInterval?{"data-intv-start":t.startInterval,"data-intv-end":t.endInterval}:{},o=s.useBlockProps.save({id:t.id,"data-date":t.date,"data-bhv":t.behaviour?t.behaviour:void 0,"data-redirect-link":"redirectLink"===t.behaviour&&t.redirectLink?t.redirectLink:void 0,"data-mode":t.mode?t.mode:void 0,"data-timer":(0,K.isEmpty)(t.timer)?void 0:(a=t.timer,Ye(a).toString()),"data-on-end-action":t.onEndAction?t.onEndAction:void 0,...l});var a;return(0,i.createElement)("div",o,(0,i.createElement)(at,{time:Qe(0,{exclude:null==t?void 0:t.exclude}),hasSeparators:null==t?void 0:t.hasSeparators}))},example:{attributes:{date:"2024-07-15T15:03:00"}}});var rt=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"themeisle-blocks/flip","title":"Flip Card","category":"themeisle-blocks","description":"Make a card with a flip effect. Powered by Otter.","keywords":["flip card","container","animation"],"textdomain":"otter-blocks","attributes":{"id":{"type":"string"},"isInverted":{"type":"boolean"},"title":{"type":"string"},"description":{"type":"string"},"animType":{"type":"string","default":"flipY"},"width":{"type":["number","object"]},"widthTablet":{"type":"object"},"widthMobile":{"type":"object"},"height":{"type":["number","object"]},"heightTablet":{"type":"object"},"heightMobile":{"type":"object"},"padding":{"type":["number","object"]},"paddingTablet":{"type":"object"},"paddingMobile":{"type":"object"},"borderWidth":{"type":["number","object"]},"borderColor":{"type":"string"},"borderRadius":{"type":["number","object"]},"backgroundColor":{"type":"string"},"frontVerticalAlign":{"type":"string"},"frontHorizontalAlign":{"type":"string"},"backVerticalAlign":{"type":"string"},"frontMedia":{"type":"object"},"frontMediaWidth":{"type":["number","string"]},"frontMediaHeight":{"type":["number","string"]},"frontBackgroundImage":{"type":"object"},"frontBackgroundType":{"type":"string","default":"color"},"frontBackgroundColor":{"type":"string"},"frontBackgroundGradient":{"type":"string"},"frontBackgroundPosition":{"type":"object"},"frontBackgroundRepeat":{"type":"string"},"frontBackgroundAttachment":{"type":"string"},"frontBackgroundSize":{"type":"string"},"backBackgroundImage":{"type":"object"},"backBackgroundType":{"type":"string","default":"color"},"backBackgroundColor":{"type":"string"},"backBackgroundGradient":{"type":"string"},"backBackgroundPosition":{"type":"object"},"backBackgroundRepeat":{"type":"string"},"backBackgroundSize":{"type":"string"},"backBackgroundAttachment":{"type":"string"},"boxShadow":{"type":"boolean","default":false},"boxShadowColor":{"type":"string","default":"#000000"},"boxShadowColorOpacity":{"type":"number","default":50},"boxShadowBlur":{"type":"number","default":5},"boxShadowHorizontal":{"type":"number","default":0},"boxShadowVertical":{"type":"number","default":0},"titleFontSize":{"type":["number","string"]},"descriptionFontSize":{"type":["number","string"]},"titleColor":{"type":"string"},"descriptionColor":{"type":"string"},"frontContentType":{"type":"string"}},"editorStyle":"otter-flip-editor","style":"otter-flip-style"}');const it={top:"flex-start",left:"flex-start",bottom:"flex-end",right:"flex-end",center:"center"},st={"flex-start":"top",center:"center","flex-end":"bottom"},ct={"flex-start":"left",center:"center","flex-end":"right"},dt=(e,t)=>{if(e&&t)return`${st[e]} ${ct[t]}`};var ut=e=>{let{attributes:t,setAttributes:l,currentSide:a}=e;const n=s.__experimentalBlockAlignmentMatrixControl||s.__experimentalBlockAlignmentMatrixToolbar;return(0,i.createElement)(s.BlockControls,null,("front"===a&&!Boolean(t.isInverted)||"back"===a&&Boolean(t.isInverted))&&(0,i.createElement)(c.Toolbar,null,(0,i.createElement)(n,{label:(0,o.__)("Change front side content position","otter-blocks"),value:dt(t.frontVerticalAlign,t.frontHorizontalAlign),onChange:e=>{const t=null==e?void 0:e.split(" ");l({frontVerticalAlign:null==it?void 0:it[null==t?void 0:t[0]],frontHorizontalAlign:null==it?void 0:it[null==t?void 0:t[1]]})}})))},bt=l(1150),mt=l(8065),pt=l(199),gt=l(5452);const ht=e=>(0,K.isNumber)(e)?(0,x.nT)((0,x.Yj)(e)):e,vt=[{name:"14",size:"14px",slug:"14"},{name:"16",size:"16px",slug:"16"},{name:"18",size:"18px",slug:"18"},{name:"24",size:"24px",slug:"24"}];var yt=e=>{var t,l,a,n,d,u,b;let{attributes:m,setAttributes:p,currentSide:g,setSide:h}=e;const[v,y]=(0,i.useState)("settings"),{responsiveSetAttributes:k,responsiveGetAttributes:f}=S(p);return(0,i.createElement)(s.InspectorControls,null,(0,i.createElement)(w.Z,{value:v,options:[{label:(0,o.__)("Settings","otter-blocks"),value:"settings"},{label:(0,o.__)("Style","otter-blocks"),value:"style"}],onChange:y}),(0,i.createElement)("div",null,"settings"===v&&(0,i.createElement)(i.Fragment,null,(0,i.createElement)(c.PanelBody,{title:(0,o.__)("Flip Settings","otter-blocks")},(0,i.createElement)(c.SelectControl,{label:(0,o.__)("Flip Direction","otter-blocks"),value:m.animType,options:[{label:(0,o.__)("Bottom to Top","otter-blocks"),value:"flipX"},{label:(0,o.__)("Top to Bottom","otter-blocks"),value:"flipX-rev"},{label:(0,o.__)("Left to Right","otter-blocks"),value:"flipY"},{label:(0,o.__)("Right to Left","otter-blocks"),value:"flipY-rev"}],onChange:e=>p({animType:e})}),(0,i.createElement)(c.ToggleControl,{label:(0,o.__)("Invert the Sides","otter-blocks"),checked:m.isInverted,onChange:e=>p({isInverted:e}),help:(0,o.__)("Use this to display the back side first.","otter-blocks")})),(0,i.createElement)(c.PanelBody,{title:(0,o.__)("Front Side Content","otter-blocks"),initialOpen:!1},(0,i.createElement)(E.Z,{label:(0,o.__)("Content Type","otter-blocks"),options:[{label:(0,o.__)("None","otter-blocks"),value:"none"},{label:(0,o.__)("Image","otter-blocks"),value:"image"}],value:null!==(t=null==m?void 0:m.frontContentType)&&void 0!==t?t:"none",onChange:e=>{const t={frontContentType:(0,K.isEmpty)(e)||"none"===e?void 0:e};((0,K.isEmpty)(e)||"none"===e)&&(t.frontMedia=void 0),p(t)}}),"image"===m.frontContentType&&(0,i.createElement)(i.Fragment,null,(0,i.createElement)(c.BaseControl,{label:(0,o.__)("Media Image","otter-blocks"),help:(0,o.__)("Set an image as showcase.","otter-blocks")},null!==(l=m.frontMedia)&&void 0!==l&&l.url?(0,i.createElement)(c.BaseControl,null,(0,i.createElement)("img",{src:m.frontMedia.url,alt:m.frontMedia.alt,style:{border:"2px solid var( --wp-admin-theme-color)",maxHeight:"250px"}}),(0,i.createElement)(c.Button,{isSecondary:!0,onClick:()=>p({frontMedia:void 0})},(0,o.__)("Remove image","otter-blocks"))):(0,i.createElement)(s.MediaPlaceholder,{labels:{title:(0,o.__)("Media Image","otter-blocks")},accept:"image/*",allowedTypes:["image"],value:m.frontMedia,onSelect:e=>{var t,l;console.log(e),p({frontMedia:(0,K.pick)(e,["id","alt","url"]),frontMediaHeight:(0,x.Yj)(null==e||null===(t=e.sizes)||void 0===t?void 0:t.medium.height),frontMediaWidth:(0,x.Yj)(null==e||null===(l=e.sizes)||void 0===l?void 0:l.medium.width)})}})),(0,i.createElement)(c.__experimentalUnitControl,{onChange:e=>p({frontMediaWidth:e}),label:(0,o.__)("Media Width","otter-blocks"),isUnitSelectTabbable:!0,isResetValueOnUnitChange:!0,value:(0,x.Yj)(m.frontMediaWidth)}),(0,i.createElement)("br",null),(0,i.createElement)(c.__experimentalUnitControl,{onChange:e=>p({frontMediaHeight:e}),label:(0,o.__)("Media Height","otter-blocks"),isUnitSelectTabbable:!0,isResetValueOnUnitChange:!0,value:(0,x.Yj)(m.frontMediaHeight)}))),(0,i.createElement)(c.PanelBody,{title:(0,o.__)("Alignment","otter-blocks"),initialOpen:!1},(0,i.createElement)(E.Z,{label:(0,o.__)("Sides","otter-blocks"),options:[{label:(0,o.__)("Front","otter-blocks"),value:"front"},{label:(0,o.__)("Back","otter-blocks"),value:"back"}],value:g,onChange:h}),"front"===g&&!Boolean(m.isInverted)||"back"===g&&Boolean(m.isInverted)?(0,i.createElement)(i.Fragment,null,(0,i.createElement)(c.BaseControl,{label:(0,o.__)("Vertical Alignment","otter-blocks")},(0,i.createElement)(pe.Z,{options:[{icon:r.alignTop,value:"flex-start"},{icon:r.alignCenter,value:"center"},{icon:r.alignBottom,value:"flex-end"}],value:null!==(a=m.frontVerticalAlign)&&void 0!==a?a:"center",onChange:e=>p({frontVerticalAlign:e})})),(0,i.createElement)(c.BaseControl,{label:(0,o.__)("Horizontal Alignment","otter-blocks")},(0,i.createElement)(pe.Z,{options:[{icon:bt.Z,value:"flex-start"},{icon:mt.Z,value:"center"},{icon:pt.Z,value:"flex-end"}],value:null!==(n=m.frontHorizontalAlign)&&void 0!==n?n:"center",onChange:e=>p({frontHorizontalAlign:e})}))):(0,i.createElement)(c.BaseControl,{label:(0,o.__)("Vertical Alignment","otter-blocks")},(0,i.createElement)(pe.Z,{options:[{icon:r.alignTop,value:"flex-start"},{icon:r.alignCenter,value:"center"},{icon:r.alignBottom,value:"flex-end"}],value:m.backVerticalAlign,onChange:e=>p({backVerticalAlign:e})})))),"style"===v&&(0,i.createElement)(i.Fragment,null,(0,i.createElement)(c.PanelBody,{title:(0,o.__)("Dimensions","otter-blocks")},(0,i.createElement)(M.Z,{label:(0,o.__)("Width","otter-blocks")},(0,i.createElement)(c.__experimentalUnitControl,{value:null!==(d=f([(0,K.isNumber)(m.width)?(0,x.Yj)(m.width):null==m?void 0:m.width,m.widthTablet,null==m?void 0:m.widthMobile]))&&void 0!==d?d:"100%",onChange:e=>k(e,["width","widthTablet","widthMobile"],m.width),isUnitSelectTabbable:!0,isResetValueOnUnitChange:!0,allowReset:!0})),(0,i.createElement)(M.Z,{label:(0,o.__)("Height","otter-blocks")},(0,i.createElement)(c.__experimentalUnitControl,{value:null!==(u=f([(0,K.isNumber)(m.height)?(0,x.Yj)(m.height):null==m?void 0:m.height,m.heightTablet,null==m?void 0:m.heightMobile]))&&void 0!==u?u:"300px",onChange:e=>k(e,["height","heightTablet","heightMobile"],m.height),isUnitSelectTabbable:!0,isResetValueOnUnitChange:!0,allowReset:!0,units:[{default:300,label:"px",value:"px"},{default:20,label:"em",value:"em"},{default:20,label:"rem",value:"rem"},{default:30,label:"vw",value:"vw"},{default:35,label:"vh",value:"vh"}]})),(0,i.createElement)(M.Z,{label:(0,o.__)("","otter-blocks")},(0,i.createElement)(c.__experimentalBoxControl,{label:(0,o.__)("Padding","otter-blocks"),values:null!==(b=f([null==m?void 0:m.padding,m.paddingTablet,null==m?void 0:m.paddingMobile]))&&void 0!==b?b:(0,K.isNumber)(m.padding)?(0,x.nT)((0,x.Yj)(m.padding)):(0,x.nT)("20px"),onChange:e=>{let t={};"object"==typeof e&&(t=Object.fromEntries(Object.entries((0,K.pick)(e,["top","bottom","left","right"])).filter((e=>{let[t,l]=e;return null!=l})))),(0,K.isEmpty)(t)&&(t=void 0),k((0,x.cg)(t,(0,x.nT)("20px")),["padding","paddingTablet","paddingMobile"])},allowReset:!0}))),(0,i.createElement)(c.PanelBody,{title:(0,o.__)("Typography Front Side","otter-blocks"),initialOpen:!1},(0,i.createElement)(c.BaseControl,{label:(0,o.__)("Title","otter-blocks")},(0,i.createElement)(c.FontSizePicker,{value:(0,x.Yj)(m.titleFontSize),onChange:e=>p({titleFontSize:e}),fontSizes:[...vt,{name:"32",size:"32px",slug:"32"}],allowReset:!0})),(0,i.createElement)(c.BaseControl,{label:(0,o.__)("Description","otter-blocks")},(0,i.createElement)(c.FontSizePicker,{value:ht(m.descriptionFontSize),onChange:e=>p({descriptionFontSize:e}),fontSizes:[...vt,{name:"28",size:"28px",slug:"28"}],allowReset:!0}))),(0,i.createElement)(c.PanelBody,{title:(0,o.__)("Front Side","otter-blocks"),initialOpen:!1},(0,i.createElement)(gt.Z,{backgroundType:m.frontBackgroundType,backgroundColor:m.frontBackgroundColor,image:m.frontBackgroundImage,gradient:m.frontBackgroundGradient,focalPoint:m.frontBackgroundPosition,backgroundAttachment:m.frontBackgroundAttachment,backgroundRepeat:m.frontBackgroundRepeat,backgroundSize:m.frontBackgroundSize,changeBackgroundType:e=>p({frontBackgroundType:e}),changeImage:e=>{p({frontBackgroundImage:(0,K.pick)(e,["id","url"])})},removeImage:()=>p({frontBackgroundImage:void 0}),changeColor:e=>p({frontBackgroundColor:e}),changeGradient:e=>p({frontBackgroundGradient:e}),changeBackgroundAttachment:e=>p({frontBackgroundAttachment:e}),changeBackgroundRepeat:e=>p({frontBackgroundRepeat:e}),changeFocalPoint:e=>p({frontBackgroundPosition:e}),changeBackgroundSize:e=>p({frontBackgroundSize:e})})),(0,i.createElement)(c.PanelBody,{title:(0,o.__)("Back Side","otter-blocks"),initialOpen:!1},(0,i.createElement)(gt.Z,{backgroundType:m.backBackgroundType,backgroundColor:m.backBackgroundColor,image:m.backBackgroundImage,gradient:m.backBackgroundGradient,focalPoint:m.backBackgroundPosition,backgroundAttachment:m.backBackgroundAttachment,backgroundRepeat:m.backBackgroundRepeat,backgroundSize:m.backBackgroundSize,changeBackgroundType:e=>p({backBackgroundType:e}),changeImage:e=>{p({backBackgroundImage:(0,K.pick)(e,["id","url"])})},removeImage:()=>p({backBackgroundImage:void 0}),changeColor:e=>p({backBackgroundColor:e}),changeGradient:e=>p({backBackgroundGradient:e}),changeBackgroundAttachment:e=>p({backBackgroundAttachment:e}),changeBackgroundRepeat:e=>p({backBackgroundRepeat:e}),changeFocalPoint:e=>p({backBackgroundPosition:e}),changeBackgroundSize:e=>p({backBackgroundSize:e})})),(0,i.createElement)(s.PanelColorSettings,{title:(0,o.__)("Color","otter-blocks"),initialOpen:!1,colorSettings:[{value:m.borderColor,onChange:e=>p({borderColor:e}),label:(0,o.__)("Border Color","otter-blocks")},{value:m.titleColor,onChange:e=>p({titleColor:e}),label:(0,o.__)("Title Color","otter-blocks")},{value:m.descriptionColor,onChange:e=>p({descriptionColor:e}),label:(0,o.__)("Description Color","otter-blocks")}]}),(0,i.createElement)(c.PanelBody,{title:(0,o.__)("Border","otter-blocks"),initialOpen:!1},(0,i.createElement)(c.__experimentalBoxControl,{label:(0,o.__)("Border Width","otter-blocks"),values:(0,x.Dv)(ht(m.borderWidth),(0,x.nT)("3px")),onChange:e=>{p({borderWidth:(0,x.cg)(e,{left:"3px",right:"3px",bottom:"3px",top:"3px"})})},allowReset:!0}),(0,i.createElement)(c.__experimentalBoxControl,{id:"o-border-raduis-box",label:(0,o.__)("Border Radius","otter-blocks"),values:(0,x.Dv)(ht(m.borderRadius),(0,x.nT)("10px")),onChange:e=>{p({borderRadius:(0,x.cg)(e,{left:"10px",right:"10px",bottom:"10px",top:"10px"})})},allowReset:!0}),(0,i.createElement)(c.ToggleControl,{label:(0,o.__)("Shadow Properties","otter-blocks"),checked:m.boxShadow,onChange:e=>p({boxShadow:e})}),m.boxShadow&&(0,i.createElement)(i.Fragment,null,(0,i.createElement)(s.__experimentalColorGradientControl,{label:(0,o.__)("Color","otter-blocks"),colorValue:m.boxShadowColor,onColorChange:e=>{var t,l;p({boxShadowColor:100>m.boxShadowColorOpacity&&null!==(t=m.boxShadowColor)&&void 0!==t&&t.includes("var(")?getComputedStyle(document.documentElement,null).getPropertyValue(null==e||null===(l=e.replace("var(",""))||void 0===l?void 0:l.replace(")","")):e})}}),(0,i.createElement)(X.Z,{label:(0,o.__)("Shadow Properties","otter-blocks")},(0,i.createElement)(c.RangeControl,{label:(0,o.__)("Opacity","otter-blocks"),value:m.boxShadowColorOpacity,onChange:e=>{var t;const l={boxShadowColorOpacity:e};100>e&&null!==(t=m.boxShadowColor)&&void 0!==t&&t.includes("var(")&&(l.boxShadowColor=getComputedStyle(document.documentElement,null).getPropertyValue(m.boxShadowColor.replace("var(","").replace(")",""))),p(l)},min:0,max:100,allowReset:!0}),(0,i.createElement)(c.RangeControl,{label:(0,o.__)("Blur","otter-blocks"),value:m.boxShadowBlur,onChange:e=>p({boxShadowBlur:e}),min:0,max:100,allowReset:!0}),(0,i.createElement)(c.RangeControl,{label:(0,o.__)("Horizontal","otter-blocks"),value:m.boxShadowHorizontal,onChange:e=>p({boxShadowHorizontal:e}),min:-100,max:100,allowReset:!0}),(0,i.createElement)(c.RangeControl,{label:(0,o.__)("Vertical","otter-blocks"),value:m.boxShadowVertical,onChange:e=>p({boxShadowVertical:e}),min:-100,max:100,allowReset:!0})))))),(0,i.createElement)(C.p,null))};const{attributes:kt}=rt;const{name:ft}=rt;(0,a.registerBlockType)(ft,{...rt,title:(0,o.__)("Flip Card","otter-blocks"),description:(0,o.__)("Make a card with a flip effect. Powered by Otter.","otter-blocks"),icon:xe.Z,keywords:["flip card","container","animation"],edit:e=>{var t,l,a,n,r,d,u,b,m,p,h,v,y,k,f,_;let{attributes:w,setAttributes:C,clientId:E,isSelected:S}=e;(0,i.useEffect)((()=>{const e=(0,L.blockInit)(E,kt);return()=>e(w.id)}),[w.id]);const[T,M]=(0,i.useState)("front"),B={"--width":void 0!==w.width&&(0,K.isNumber)(w.width)&&(0,x.Yj)(w.width)||w.width,"--width-tablet":w.widthTablet,"--width-mobile":w.widthMobile,"--height":void 0!==w.height&&(0,K.isNumber)(w.height)&&(0,x.Yj)(w.height)||w.height,"--height-tablet":w.heightTablet,"--height-mobile":w.heightMobile,"--border-width":void 0!==w.borderWidth&&(0,x.um)((0,x.Dv)((0,x.nT)((0,x.Yj)(w.borderWidth)),{left:"3px",right:"3px",bottom:"3px",top:"3px"})),"--border-color":w.borderColor,"--border-radius":void 0!==w.borderRadius&&(0,x.um)((0,x.Dv)((0,x.nT)((0,x.Yj)(w.borderRadius)),{left:"10px",right:"10px",bottom:"10px",top:"10px"})),"--front-background":(0,x.nG)([["gradient"===w.frontBackgroundType&&w.frontBackgroundGradient,w.frontBackgroundGradient],["image"===w.frontBackgroundType&&(null===(t=w.frontBackgroundImage)||void 0===t?void 0:t.url),`url( ${null===(l=w.frontBackgroundImage)||void 0===l?void 0:l.url} ) ${w.frontBackgroundRepeat||"repeat"} ${w.frontBackgroundAttachment||"scroll"} ${Math.round(null!==(a=null===(n=w.frontBackgroundPosition)||void 0===n?void 0:n.x)&&void 0!==a?a:50)}% ${Math.round(null!==(r=null===(d=w.frontBackgroundPosition)||void 0===d?void 0:d.y)&&void 0!==r?r:50)}%/${w.frontBackgroundSize||"auto"}`],[w.frontBackgroundColor]]),"--back-background":(0,x.nG)([["gradient"===w.backBackgroundType&&w.backBackgroundGradient,w.backBackgroundGradient],["image"===w.backBackgroundType&&(null===(u=w.backBackgroundImage)||void 0===u?void 0:u.url),`url( ${null===(b=w.backBackgroundImage)||void 0===b?void 0:b.url} ) ${w.backBackgroundRepeat||"repeat"} ${w.backBackgroundAttachment||"scroll"} ${Math.round(null!==(m=null===(p=w.backBackgroundPosition)||void 0===p?void 0:p.x)&&void 0!==m?m:50)}% ${Math.round(null!==(h=null===(v=w.backBackgroundPosition)||void 0===v?void 0:v.y)&&void 0!==h?h:50)}%/${w.backBackgroundSize||"auto"}`],[w.backBackgroundColor]]),"--box-shadow":w.boxShadow&&`${w.boxShadowHorizontal}px ${w.boxShadowVertical}px ${w.boxShadowBlur}px ${w.boxShadowColor?w.boxShadowColor.includes("#")&&null!=w&&w.boxShadowColorOpacity&&0<=w.boxShadowColorOpacity?Z()(w.boxShadowColor,w.boxShadowColorOpacity||1e-5):w.boxShadowColor:Z()("#000000",void 0!==w.boxShadowColorOpacity?w.boxShadowColorOpacity||1e-5:1)}`,"--front-vertical-align":w.frontVerticalAlign,"--front-horizontal-align":w.frontHorizontalAlign,"--back-vertical-align":w.backVerticalAlign,"--front-media-width":(0,x.Yj)(w.frontMediaWidth),"--front-media-height":(0,x.Yj)(w.frontMediaHeight),"--padding":void 0!==w.padding&&(0,K.isNumber)(w.padding)&&(0,x.Yj)(w.padding)||(0,x.um)(null==w?void 0:w.padding),"--padding-tablet":(0,x.um)(null==w?void 0:w.paddingTablet),"--padding-mobile":(0,x.um)(null==w?void 0:w.paddingMobile)},[z,P]=(0,L.useCSSNode)();(0,i.useEffect)((()=>{P([`.o-flip-inner {\n\t\t\t\ttransform: ${"back"===T?"var( --flip-anim )":"unset"};\n\t\t\t}`,`.o-flip-front .o-flip-content h3 {\n\t\t\t\tcolor: ${w.titleColor};\n\t\t\t\t${w.titleFontSize&&`font-size: ${(0,x.Yj)(w.titleFontSize)}`}\n\t\t\t}`,`.o-flip-front .o-flip-content p {\n\t\t\t\tcolor: ${w.descriptionColor};\n\t\t\t\t${w.descriptionFontSize&&`font-size: ${(0,x.Yj)(w.descriptionFontSize)}`}\n\t\t\t}`])}),[T,w.titleFontSize,w.descriptionFontSize,w.titleColor,w.descriptionColor]);const R=(0,s.useBlockProps)({id:w.id,className:g()({flipX:"flipX"===w.animType,flipY:"flipY"===w.animType,"flipY-rev":"flipY-rev"===w.animType,"flipX-rev":"flipX-rev"===w.animType},z),style:B});return(0,i.createElement)(i.Fragment,null,(0,i.createElement)(ut,{attributes:w,setAttributes:C,currentSide:T}),(0,i.createElement)(yt,{attributes:w,setAttributes:C,currentSide:T,setSide:M}),(0,i.createElement)("div",R,(0,i.createElement)("div",{className:g()("o-flip-inner",{invert:w.isInverted})},(0,i.createElement)("div",{className:"o-flip-front"},(0,i.createElement)("div",{className:"o-flip-content"},(null===(y=w.frontMedia)||void 0===y?void 0:y.url)&&(0,i.createElement)("img",{className:"o-img",srcSet:null===(k=w.frontMedia)||void 0===k?void 0:k.url}),(0,i.createElement)(s.RichText,{tagName:"h3",value:null!==(f=w.title)&&void 0!==f?f:"",onChange:e=>C({title:e}),placeholder:(0,o.__)("Insert a title","otter-blocks")}),(0,i.createElement)(s.RichText,{tagName:"p",value:null!==(_=w.description)&&void 0!==_?_:"",onChange:e=>C({description:e}),placeholder:(0,o.__)("Insert a description","otter-blocks")}))),(0,i.createElement)("div",{className:"o-flip-back"},(0,i.createElement)(s.InnerBlocks,{renderAppender:S?s.InnerBlocks.ButtonBlockAppender:void 0,template:[["core/heading",{content:"Lorem ipsum",level:3}],["core/paragraph",{content:"Tellus posuere sem fermentum facilisis platea."}],["core/buttons",{layout:{type:"flex",justifyContent:"center"},innerBlocks:[{name:"core/button",attributes:{className:"is-style-outline",text:"Learn more"}}]}]]}))),S&&(0,i.createElement)("div",{className:"o-switcher"},(0,i.createElement)(c.Button,{isPrimary:!0,onClick:()=>M("back"===T?"front":"back")},"back"===T?(0,o.__)("Flip to Front","otter-blocks"):(0,o.__)("Flip to Back","otter-blocks")))))},save:e=>{var t,l,o,a;let{attributes:n}=e;const r=s.useBlockProps.save({id:n.id,className:g()("anim",{flipX:"flipX"===n.animType,flipY:"flipY"===n.animType,"flipY-rev":"flipY-rev"===n.animType,"flipX-rev":"flipX-rev"===n.animType})});return(0,i.createElement)("div",r,(0,i.createElement)("div",{className:g()("o-flip-inner",{invert:n.isInverted})},(0,i.createElement)("div",{className:"o-flip-front"},(0,i.createElement)("div",{className:"o-flip-content"},(null===(t=n.frontMedia)||void 0===t?void 0:t.url)&&(0,i.createElement)("img",{className:"o-img",src:null===(l=n.frontMedia)||void 0===l?void 0:l.url,srcSet:null===(o=n.frontMedia)||void 0===o?void 0:o.url,alt:null===(a=n.frontMedia)||void 0===a?void 0:a.alt}),(0,i.createElement)(s.RichText.Content,{tagName:"h3",value:n.title}),(0,i.createElement)(s.RichText.Content,{tagName:"p",value:n.description}))),(0,i.createElement)("div",{className:"o-flip-back"},(0,i.createElement)(s.InnerBlocks.Content,null))))},example:{attributes:{}}});var _t=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"themeisle-blocks/font-awesome-icons","title":"Icon","category":"themeisle-blocks","description":"Add icons from Font Awesome or ThemeIsle Icons library to your website. Powered by Otter.","keywords":["font awesome","dashicons","icons"],"textdomain":"otter-blocks","attributes":{"id":{"type":"string"},"align":{"type":["string","object"]},"library":{"type":"string","default":"fontawesome"},"prefix":{"type":"string","default":"fab"},"icon":{"type":"string","default":"themeisle"},"link":{"type":"string"},"newTab":{"type":"boolean","default":false},"fontSize":{"type":["number","string"],"default":"16px"},"padding":{"type":"number","default":5},"margin":{"type":"number","default":5},"backgroundColor":{"type":"string"},"textColor":{"type":"string"},"borderColor":{"type":"string"},"backgroundColorHover":{"type":"string"},"textColorHover":{"type":"string"},"borderColorHover":{"type":"string"},"borderSize":{"type":"number","default":0},"borderRadius":{"type":"number","default":0},"isSynced":{"type":"array"}},"editorStyle":"otter-font-awesome-editor","style":"otter-font-awesome-style"}');const wt={prefix:{type:"string",default:"fab"},icon:{type:"string",default:"themeisle"},fontSize:{type:"number",default:16},padding:{type:"number",default:5},margin:{type:"number",default:5},backgroundColor:{type:"string"},textColor:{type:"string"},borderColor:{type:"string"},borderSize:{type:"number",default:0},borderRadius:{type:"number",default:0}},Ct=[{attributes:{id:{type:"string"},align:{type:"string"},library:{type:"string",default:"fontawesome"},prefix:{type:"string",default:"fab"},icon:{type:"string",default:"themeisle"},link:{type:"string"},newTab:{type:"boolean",default:!1},fontSize:{type:"number",default:16},padding:{type:"number",default:5},margin:{type:"number",default:5},backgroundColor:{type:"string"},textColor:{type:"string"},borderColor:{type:"string"},backgroundColorHover:{type:"string"},textColorHover:{type:"string"},borderColorHover:{type:"string"},borderSize:{type:"number",default:0},borderRadius:{type:"number",default:0},isSynced:{type:"array"}},supports:{align:["left","center","right"]},save:e=>{let{attributes:t}=e;const l=we.ZP.icons[t.icon],o=s.useBlockProps.save({id:t.id});return(0,i.createElement)("p",o,(0,i.createElement)("span",{className:"wp-block-themeisle-blocks-font-awesome-icons-container"},t.link?(0,i.createElement)("a",{href:t.link,target:t.newTab?"_blank":"_self",rel:"noopener noreferrer"},"themeisle-icons"===t.library?(0,i.createElement)(l,null):(0,i.createElement)("i",{className:`${t.prefix} fa-${t.icon}`})):"themeisle-icons"===t.library?(0,i.createElement)(l,null):(0,i.createElement)("i",{className:`${t.prefix} fa-${t.icon}`})))}},{attributes:wt,supports:{align:["left","center","right"]},migrate:e=>{let t="center";return e.className.includes("alignleft")&&(t="left"),e.className.includes("aligncenter")&&(t="center"),e.className.includes("alignright")&&(t="right"),{...e,align:t,className:""}},save:e=>{let{attributes:t,className:l}=e;const o={borderRadius:t.borderRadius+"%",fontSize:t.fontSize+"px",padding:t.padding+"px"},a={color:t.textColor,backgroundColor:t.backgroundColor,borderColor:t.borderColor,borderRadius:t.borderRadius+"%",borderStyle:"solid",borderWidth:t.borderSize+"px",display:"inline-block",margin:t.margin+"px"};return(0,i.createElement)("p",{className:l,style:{textAlign:t.align}},(0,i.createElement)("span",{className:`${l}-container`,style:a},(0,i.createElement)("i",{className:`${t.prefix} fa-${t.icon}`,style:o})))}},{attributes:{...wt,align:{type:"string"}},save:e=>{let{attributes:t,className:l}=e;const o={borderRadius:t.borderRadius+"%",fontSize:t.fontSize+"px",padding:t.padding+"px"},a={color:t.textColor,backgroundColor:t.backgroundColor,borderColor:t.borderColor,borderRadius:t.borderRadius+"%",borderStyle:"solid",borderWidth:t.borderSize+"px",display:"inline-block",margin:t.margin+"px"};return(0,i.createElement)("p",{className:l,style:{textAlign:t.align}},(0,i.createElement)("span",{className:"undefined-container",style:a},(0,i.createElement)("i",{className:`${t.prefix} fa-${t.icon}`,style:o})))}},{attributes:{...wt,id:{type:"string"},align:{type:"string"},link:{type:"string"},newTab:{type:"boolean",default:!1},backgroundColorHover:{type:"string"},textColorHover:{type:"string"},borderColorHover:{type:"string"}},save:e=>{let{attributes:t,className:l}=e;const o={borderRadius:t.borderRadius+"%",borderStyle:"solid",borderWidth:t.borderSize+"px",display:"inline-block",margin:t.margin+"px"},a={borderRadius:t.borderRadius+"%",fontSize:t.fontSize+"px",padding:t.padding+"px"},n=()=>(0,i.createElement)("i",{className:`${t.prefix} fa-${t.icon}`,style:a});return(0,i.createElement)("p",{className:l,id:t.id,style:{textAlign:t.align}},(0,i.createElement)("span",{className:"wp-block-themeisle-blocks-font-awesome-icons-container",style:o},t.link?(0,i.createElement)("a",{href:t.link,target:t.newTab?"_blank":"_self",style:{color:t.textColor},rel:"noopener noreferrer"},(0,i.createElement)(n,null)):(0,i.createElement)(n,null)))}}];var Et=Ct;const xt={left:"flex-start",center:"center",right:"flex-end","flex-start":"left","flex-end":"right"};var St=e=>{var t,l,o,a;let{attributes:n,setAttributes:r,isSelected:c}=e;const{responsiveSetAttributes:d,responsiveGetAttributes:u}=S(r);return(0,i.createElement)(s.BlockControls,null,(0,i.createElement)(s.AlignmentToolbar,{value:xt[null!==(t=u([null===(l=Lt(n.align))||void 0===l?void 0:l.desktop,null===(o=Lt(n.align))||void 0===o?void 0:o.tablet,null===(a=Lt(n.align))||void 0===a?void 0:a.mobile]))&&void 0!==t?t:"center"],onChange:e=>d(""===e?void 0:xt[e],["align.desktop","align.tablet","align.mobile"],Lt(n.align))}),(0,i.createElement)(ke.Z,{isSelected:c,setAttributes:r,url:n.link,opensInNewTab:n.newTab}))},Tt=l(3159);const Mt=[{name:(0,o.__)("Small","otter-blocks"),size:"16px",slug:"small"},{name:(0,o.__)("Medium","otter-blocks"),size:"32px",slug:"medium"},{name:(0,o.__)("Large","otter-blocks"),size:"48px",slug:"large"},{name:(0,o.__)("XL","otter-blocks"),size:"60px",slug:"xl"}];var Bt=e=>{var t,l,a,n,r;let{attributes:d,setAttributes:u,getValue:b}=e;const[m,p]=(0,i.useState)(!1),{responsiveSetAttributes:g,responsiveGetAttributes:h}=S(u);return(0,i.createElement)(s.InspectorControls,null,(0,i.createElement)(c.PanelBody,{title:(0,o.__)("Icon","otter-blocks")},(0,i.createElement)(_.Z,{label:(0,o.__)("Icon Picker","otter-blocks"),library:d.library,prefix:d.prefix,icon:d.icon,changeLibrary:e=>{u({library:e,icon:"fontawesome"===e?"themeisle":"balance",prefix:"fab"})},onChange:e=>{u("object"==typeof e?{icon:e.name,prefix:e.prefix}:{icon:e})}})),(0,i.createElement)(c.PanelBody,{title:(0,o.__)("Dimensions","otter-blocks"),initialOpen:!1},(0,i.createElement)(Tt.Z,{field:"fontSize",isSynced:d.isSynced,setAttributes:u},(0,i.createElement)(c.FontSizePicker,{fontSizes:Mt,withReset:!0,value:null!==(t=d.fontSize)&&void 0!==t?t:"16px",onChange:e=>u({fontSize:e})})),(0,i.createElement)(Tt.Z,{field:"padding",isSynced:d.isSynced,setAttributes:u},(0,i.createElement)(c.RangeControl,{label:(0,o.__)("Padding","otter-blocks"),value:b("padding"),initialPosition:5,onChange:e=>u({padding:e}),step:.1,min:0,max:100})),(0,i.createElement)(Tt.Z,{field:"margin",isSynced:d.isSynced,setAttributes:u},(0,i.createElement)(c.RangeControl,{label:(0,o.__)("Margin","otter-blocks"),value:b("margin"),initialPosition:5,onChange:e=>u({margin:e}),step:.1,min:0,max:100})),(0,i.createElement)(M.Z,{label:(0,o.__)("Alignment","otter-blocks"),className:"buttons-alignment-control"},(0,i.createElement)(pe.Z,{value:null!==(l=h([null===(a=Lt(d.align))||void 0===a?void 0:a.desktop,null===(n=Lt(d.align))||void 0===n?void 0:n.tablet,null===(r=Lt(d.align))||void 0===r?void 0:r.mobile]))&&void 0!==l?l:"center",onChange:e=>g(""===e?void 0:e,["align.desktop","align.tablet","align.mobile"],Lt(d.align)),options:[{icon:bt.Z,label:(0,o.__)("Left","otter-blocks"),value:"flex-start"},{icon:mt.Z,label:(0,o.__)("Center","otter-blocks"),value:"center"},{icon:pt.Z,label:(0,o.__)("Right","otter-blocks"),value:"flex-end"}],hasIcon:!0}))),(0,i.createElement)(c.PanelBody,{title:(0,o.__)("Color","otter-blocks"),initialOpen:!1},(0,i.createElement)(c.ButtonGroup,null,(0,i.createElement)(c.Button,{isSmall:!0,isSecondary:m,isPrimary:!m,onClick:()=>p(!1)},(0,o.__)("Normal","otter-blocks")),(0,i.createElement)(c.Button,{isSmall:!0,isSecondary:!m,isPrimary:m,onClick:()=>p(!0)},(0,o.__)("Hover","otter-blocks"))),m?(0,i.createElement)(i.Fragment,null,(0,i.createElement)(Tt.Z,{field:"backgroundColorHover",isSynced:d.isSynced,setAttributes:u},(0,i.createElement)(s.__experimentalColorGradientControl,{label:(0,o.__)("Hover Background","otter-blocks"),colorValue:b("backgroundColorHover"),onColorChange:e=>u({backgroundColorHover:e})})),(0,i.createElement)(Tt.Z,{field:"textColorHover",isSynced:d.isSynced,setAttributes:u},(0,i.createElement)(s.__experimentalColorGradientControl,{label:(0,o.__)("Hover Icon","otter-blocks"),colorValue:b("textColorHover"),onColorChange:e=>u({textColorHover:e})})),(0,i.createElement)(s.ContrastChecker,{textColor:b("textColorHover"),backgroundColor:b("backgroundColorHover")}),(0,i.createElement)(s.__experimentalColorGradientControl,{label:(0,o.__)("Hover Border","otter-blocks"),colorValue:d.borderColorHover,onColorChange:e=>u({borderColorHover:e})})):(0,i.createElement)(i.Fragment,null,(0,i.createElement)(Tt.Z,{field:"backgroundColor",isSynced:d.isSynced,setAttributes:u},(0,i.createElement)(s.__experimentalColorGradientControl,{label:(0,o.__)("Background","otter-blocks"),colorValue:b("backgroundColor"),onColorChange:e=>u({backgroundColor:e})})),(0,i.createElement)(Tt.Z,{field:"textColor",isSynced:d.isSynced,setAttributes:u},(0,i.createElement)(s.__experimentalColorGradientControl,{label:(0,o.__)("Icon","otter-blocks"),colorValue:b("textColor"),onColorChange:e=>u({textColor:e})})),(0,i.createElement)(s.ContrastChecker,{textColor:b("textColor"),backgroundColor:b("backgroundColor")}),(0,i.createElement)(s.__experimentalColorGradientControl,{label:(0,o.__)("Border","otter-blocks"),colorValue:d.borderColor,onColorChange:e=>u({borderColor:e})}))),(0,i.createElement)(c.PanelBody,{title:(0,o.__)("Border Settings","otter-blocks"),initialOpen:!1},(0,i.createElement)(c.RangeControl,{label:(0,o.__)("Border Size","otter-blocks"),value:d.borderSize,onChange:e=>u({borderSize:e}),step:.1,min:0,max:120}),(0,i.createElement)(c.RangeControl,{label:(0,o.__)("Border Radius","otter-blocks"),value:d.borderRadius,onChange:e=>u({borderRadius:e}),step:.1,min:0,max:100})))};const{attributes:zt}=_t,Pt={right:"flex-end",center:"center",left:"flex-start"},Lt=e=>{var t;return(0,K.isString)(e)?{desktop:null!==(t=null==Pt?void 0:Pt[e])&&void 0!==t?t:"center"}:e};const{name:Rt}=_t;(0,a.registerBlockType)(Rt,{..._t,title:(0,o.__)("Icon","otter-blocks"),description:(0,o.__)("Add icons from Font Awesome or ThemeIsle Icons library to your website. Powered by Otter.","otter-blocks"),icon:r.faIcon,keywords:["font awesome","dashicons","icons"],deprecated:Et,edit:e=>{var t,l,o;let{name:a,attributes:n,setAttributes:r,isSelected:c,clientId:d}=e;(0,i.useEffect)((()=>{const e=(0,L.blockInit)(d,zt);return()=>e(n.id)}),[n.id]);const u=we.ZP.icons[n.icon],b=e=>(0,L.getDefaultValueByField)({name:a,field:e,defaultAttributes:zt,attributes:n}),m={"--align":n.align,"--border-color":n.borderColor,"--border-size":void 0!==n.borderSize&&`${n.borderSize}px`,"--border-radius":void 0!==n.borderRadius&&`${n.borderRadius}%`,"--margin":void 0!==n.margin&&`${b("margin")}px`,"--padding":void 0!==n.padding&&`${b("padding")}px`,"--font-size":void 0!==n.fontSize&&((0,K.isNumber)(b("fontSize"))?`${b("fontSize")}px`:b("fontSize")),"--align":null===(t=Lt(n.align))||void 0===t?void 0:t.desktop,"--align-tablet":null===(l=Lt(n.align))||void 0===l?void 0:l.tablet,"--align-mobile":null===(o=Lt(n.align))||void 0===o?void 0:o.mobile},[p,g]=(0,L.useCSSNode)();(0,i.useEffect)((()=>{g([`.wp-block-themeisle-blocks-font-awesome-icons-container {\n\t\t\t\tcolor: ${b("textColor")};\n\t\t\t\tbackground-color: ${b("backgroundColor")};\n\t\t\t}`,`.wp-block-themeisle-blocks-font-awesome-icons-container:hover {\n\t\t\t\tcolor: ${b("textColorHover")};\n\t\t\t\tbackground-color: ${b("backgroundColorHover")};\n\t\t\t\tborder-color: ${n.borderColorHover};\n\t\t\t}`,`.wp-block-themeisle-blocks-font-awesome-icons-container a {\n\t\t\t\tcolor: ${b("textColor")};\n\t\t\t}`,`.wp-block-themeisle-blocks-font-awesome-icons-container svg {\n\t\t\t\tfill: ${b("textColor")};\n\t\t\t}`,`.wp-block-themeisle-blocks-font-awesome-icons-container:hover svg {\n\t\t\t\tfill: ${b("textColorHover")};\n\t\t\t}`])}),[n.textColor,n.backgroundColor,n.textColorHover,n.backgroundColorHover,n.borderColorHover,n.fontSize]);const h=(0,s.useBlockProps)({id:n.id,style:m,className:p});return(0,i.createElement)(i.Fragment,null,(0,i.createElement)(St,{attributes:n,setAttributes:r,isSelected:c}),(0,i.createElement)(Bt,{attributes:n,setAttributes:r,getValue:b}),(0,i.createElement)("div",h,(0,i.createElement)("span",{className:"wp-block-themeisle-blocks-font-awesome-icons-container"},"themeisle-icons"===n.library?(0,i.createElement)(u,null):(0,i.createElement)("i",{className:`${n.prefix} fa-${n.icon}`}))))},save:e=>{let{attributes:t}=e;const l=we.ZP.icons[t.icon],o=s.useBlockProps.save({id:t.id});return(0,i.createElement)("div",o,(0,i.createElement)("span",{className:"wp-block-themeisle-blocks-font-awesome-icons-container"},t.link?(0,i.createElement)("a",{href:t.link,target:t.newTab?"_blank":"_self",rel:"noopener noreferrer"},"themeisle-icons"===t.library?(0,i.createElement)(l,null):(0,i.createElement)("i",{className:`${t.prefix} fa-${t.icon}`})):"themeisle-icons"===t.library?(0,i.createElement)(l,null):(0,i.createElement)("i",{className:`${t.prefix} fa-${t.icon}`})))},example:{attributes:{fontSize:70}}});var Ft=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"themeisle-blocks/form","title":"Form","category":"themeisle-blocks","description":"Display a form for your clients. Powered by Otter.","keywords":["business","form","email"],"textdomain":"otter-blocks","attributes":{"id":{"type":"string"},"subject":{"type":"string"},"emailTo":{"type":"string"},"fromName":{"type":"string"},"optionName":{"type":"string"},"hasCaptcha":{"type":"boolean"},"provider":{"type":"string","default":""},"listId":{"type":"string"},"action":{"type":"string","default":"subscribe"},"submitLabel":{"type":"string"},"sendUserEmail":{"type":"boolean"},"redirectLink":{"type":"string"},"inputPadding":{"type":"object"},"labelColor":{"type":"string"},"helpLabelColor":{"type":"string"},"inputRequiredColor":{"type":"string"},"inputBorderRadius":{"type":"number"},"inputBorderColor":{"type":"string"},"inputBorderWidth":{"type":"number"},"submitMessage":{"type":"string"},"inputWidth":{"type":"number"},"submitMessageColor":{"type":"string"},"submitMessageErrorColor":{"type":"string"},"submitBackgroundColor":{"type":"string"},"submitBackgroundColorHover":{"type":"string"},"submitColor":{"type":"string"},"inputGap":{"type":"number"},"inputColor":{"type":"string"},"inputBackgroundColor":{"type":"string"},"inputsGap":{"type":"number"},"labelFontSize":{"type":"string"},"submitFontSize":{"type":"string"},"messageFontSize":{"type":"string"},"helpFontSize":{"type":"string"},"inputFontSize":{"type":"string"},"submitStyle":{"type":"string"},"isSynced":{"type":"array"}},"supports":{"align":["wide","full"]},"editorStyle":"otter-form-editor","style":"otter-form-style","script":"otter-form"}');const At=[{attributes:{id:{type:"string"},subject:{type:"string"},emailTo:{type:"string"},optionName:{type:"string"},hasCaptcha:{type:"boolean"},provider:{type:"string",default:""},apiKey:{type:"string"},listId:{type:"string"},action:{type:"string",default:"subscribe"}},supports:{align:["wide","full"]},save:e=>{let{attributes:t}=e;const l=t.provider&&t.apiKey&&t.listId,a=s.useBlockProps.save({id:t.id,className:g()({"is-subscription":l&&"subscribe"===t.action,"can-submit-and-subscribe":l&&"submit-subscribe"===t.action,"has-captcha":t.hasCaptcha}),"data-email-subject":t.subject,"data-option-name":t.optionName});return(0,i.createElement)("div",a,(0,i.createElement)("div",{className:"otter-form__container"},(0,i.createElement)(s.InnerBlocks.Content,null),(0,i.createElement)("div",{className:"wp-block-button"},(0,i.createElement)("button",{className:"wp-block-button__link"},"subscribe"===t.action?(0,o.__)("Subscribe","otter-blocks"):(0,o.__)("Submit","otter-blocks")))))}}];var Ht=At,Ot=l(8101),Nt=l.n(Ot),Vt=l(6989),It=l.n(Vt);const Dt=e=>(null==e?void 0:e[1])&&e[0]!==e[1],Gt=e=>Boolean(0<e.filter(Dt).length),$t=[{name:(0,o.__)("Small","otter-blocks"),size:"0.875em",slug:"small"},{name:(0,o.__)("Medium","otter-blocks"),size:"1em",slug:"medium"},{name:(0,o.__)("Large","otter-blocks"),size:"1.125em",slug:"large"},{name:(0,o.__)("XL","otter-blocks"),size:"1.25em",slug:"xl"}];var Wt=e=>{var t,l,a,n,r,d,u,b,m,p,g;let{attributes:h,setAttributes:v}=e;const{listIDOptions:y,setListIDOptions:k,saveFormEmailOptions:f,saveIntegration:_,savedFormOptions:w,sendTestEmail:C,loadingState:E,formOptions:x,setFormOption:S,testService:T,hasEmailField:M}=(0,i.useContext)(Ut),B=Gt([[x.emailTo,null==w?void 0:w.email],[x.subject,null==w?void 0:w.emailSubject],[x.redirectLink,null==w?void 0:w.redirectLink],[x.fromName,null==w?void 0:w.fromName],[x.submitMessage,null==w?void 0:w.submitMessage],[x.cc,null==w?void 0:w.cc],[x.bcc,null==w?void 0:w.bcc],[x.hasCaptcha,null==w?void 0:w.hasCaptcha]]),z=Gt([[x.provider,null==w||null===(t=w.integration)||void 0===t?void 0:t.provider],[x.listId,null==w||null===(l=w.integration)||void 0===l?void 0:l.listId],[x.action,null==w||null===(a=w.integration)||void 0===a?void 0:a.action]]);return(0,i.createElement)(s.InspectorControls,null,(0,i.createElement)(s.PanelColorSettings,{title:(0,o.__)("Form Color","otter-blocks"),initialOpen:!1,colorSettings:[{value:h.labelColor,onChange:e=>v({labelColor:e}),label:(0,o.__)("Label","otter-blocks")},{value:h.helpLabelColor,onChange:e=>v({helpLabelColor:e}),label:(0,o.__)("Help Label","otter-blocks")},{value:h.inputBorderColor,onChange:e=>v({inputBorderColor:e}),label:(0,o.__)("Border","otter-blocks")},{value:h.inputRequiredColor,onChange:e=>v({inputRequiredColor:e}),label:(0,o.__)("Label Required","otter-blocks")},{value:h.inputColor,onChange:e=>v({inputColor:e}),label:(0,o.__)("Input Text","otter-blocks")},{value:h.inputBackgroundColor,onChange:e=>v({inputBackgroundColor:e}),label:(0,o.__)("Input Background","otter-blocks")}]}),(0,i.createElement)(s.PanelColorSettings,{title:(0,o.__)("Button Color","otter-blocks"),initialOpen:!1,colorSettings:[{value:h.submitColor,onChange:e=>v({submitColor:e}),label:(0,o.__)("Submit Text","otter-blocks")},{value:h.submitBackgroundColor,onChange:e=>v({submitBackgroundColor:e}),label:(0,o.__)("Button Background","otter-blocks")},{value:h.submitBackgroundColorHover,onChange:e=>v({submitBackgroundColorHover:e}),label:(0,o.__)("Button Background on Hover","otter-blocks")},{value:h.submitMessageColor,onChange:e=>v({submitMessageColor:e}),label:(0,o.__)("Successful Message","otter-blocks")},{value:h.submitMessageErrorColor,onChange:e=>v({submitMessageErrorColor:e}),label:(0,o.__)("Error Message","otter-blocks")}]}),(0,i.createElement)(c.PanelBody,{title:(0,o.__)("Label Styling","otter-blocks"),initialOpen:!1},(0,i.createElement)(Tt.Z,{field:"inputGap",isSynced:h.isSynced,setAttributes:v},(0,i.createElement)(c.RangeControl,{label:(0,o.__)("Spacing","otter-blocks"),value:null!==(n=h.inputGap)&&void 0!==n?n:10,onChange:e=>v({inputGap:e}),allowReset:!0,step:.1,min:0,max:50,initialPositino:10})),(0,i.createElement)(Tt.Z,{field:"labelFontSize",isSynced:h.isSynced,setAttributes:v},(0,i.createElement)(c.FontSizePicker,{label:(0,o.__)("Font Size","otter-blocks"),fontSizes:$t,withReset:!0,value:h.labelFontSize,onChange:e=>v({labelFontSize:e})}))),(0,i.createElement)(c.PanelBody,{title:(0,o.__)("Input Styling","otter-blocks"),initialOpen:!1},(0,i.createElement)(Tt.Z,{field:"inputFontSize",isSynced:h.isSynced,setAttributes:v},(0,i.createElement)(c.FontSizePicker,{label:(0,o.__)("Input Font Size","otter-blocks"),fontSizes:$t,withReset:!0,value:h.inputFontSize,onChange:e=>v({inputFontSize:e})})),(0,i.createElement)(Tt.Z,{field:"inputsGap",isSynced:h.isSynced,setAttributes:v},(0,i.createElement)(c.RangeControl,{label:(0,o.__)("Fields Spacing","otter-blocks"),value:null!==(r=h.inputsGap)&&void 0!==r?r:16,onChange:e=>v({inputsGap:e}),allowReset:!0,min:0,max:50,initialPosition:16})),(0,i.createElement)(Tt.Z,{field:"inputPadding",isSynced:h.isSynced,setAttributes:v},(0,i.createElement)(c.__experimentalBoxControl,{label:(0,o.__)("Input Padding","otter-blocks"),values:null!==(d=h.inputPadding)&&void 0!==d?d:{top:"8px",right:"8px",bottom:"8px",left:"8px"},inputProps:{min:0,max:500},onChange:e=>v({inputPadding:e})})),(0,i.createElement)(Tt.Z,{field:"inputsBorderRadius",isSynced:h.isSynced,setAttributes:v},(0,i.createElement)(c.RangeControl,{label:(0,o.__)("Border Radius","otter-blocks"),value:null!==(u=h.inputBorderRadius)&&void 0!==u?u:4,onChange:e=>v({inputBorderRadius:e}),allowReset:!0,step:.1,min:0,max:50})),(0,i.createElement)(Tt.Z,{field:"inputsBorderWidth",isSynced:h.isSynced,setAttributes:v},(0,i.createElement)(c.RangeControl,{label:(0,o.__)("Border Width","otter-blocks"),value:null!==(b=h.inputBorderWidth)&&void 0!==b?b:1,onChange:e=>v({inputBorderWidth:e}),allowReset:!0,step:.1,min:0,max:50})),(0,i.createElement)(Tt.Z,{field:"helpFontSize",isSynced:h.isSynced,setAttributes:v},(0,i.createElement)(c.BaseControl,{label:(0,o.__)("Help Text Font Size","otter-blocks")},(0,i.createElement)(c.FontSizePicker,{label:(0,o.__)("Help Font Size","otter-blocks"),fontSizes:$t,withReset:!0,value:h.helpFontSize,onChange:e=>v({helpFontSize:e})})))),(0,i.createElement)(c.PanelBody,{title:(0,o.__)("Button","otter-blocks"),initialOpen:!1},(0,i.createElement)(c.TextControl,{label:(0,o.__)("Label","otter-blocks"),placeholder:(0,o.__)("Submit","otter-blocks"),value:h.submitLabel,onChange:e=>v({submitLabel:e}),help:(0,o.__)("Set the label for the submit button.","otter-blocks")}),(0,i.createElement)(Tt.Z,{field:"submitFontSize",isSynced:h.isSynced,setAttributes:v},(0,i.createElement)(c.FontSizePicker,{label:(0,o.__)("Font Size","otter-blocks"),fontSizes:$t,withReset:!0,value:h.submitFontSize,onChange:e=>v({submitFontSize:e})})),(0,i.createElement)(c.SelectControl,{label:(0,o.__)("Alignment","otter-blocks"),value:h.submitStyle,options:[{label:"Default",value:""},{label:"Right",value:"right"},{label:"Full",value:"full"}],onChange:e=>v({submitStyle:e})}),(0,i.createElement)(Tt.Z,{field:"messageFontSize",isSynced:h.isSynced,setAttributes:v},(0,i.createElement)(c.BaseControl,{label:(0,o.__)("Message Font Size","otter-blocks")},(0,i.createElement)(c.FontSizePicker,{label:(0,o.__)("Message Font Size","otter-blocks"),fontSizes:$t,withReset:!0,value:h.messageFontSize,onChange:e=>v({messageFontSize:e})})))),(0,i.createElement)(c.PanelBody,{title:(0,o.__)("Form Options","otter-blocks"),initialOpen:!1},"loading"===(null==E?void 0:E.formOptions)&&(0,i.createElement)("div",{className:"o-fetch-msg"},(0,i.createElement)(c.Spinner,null),(0,o.__)("Loading the options. Please wait...","otter-blocks")),(0,i.createElement)(c.TextControl,{label:(0,o.__)("Email Subject","otter-blocks"),placeholder:(0,o.__)("A new submission","otter-blocks"),value:x.subject,onChange:e=>S({subject:e}),help:(0,o.__)("Customize the title of the email that you are gonna receive after a user submits the form.","otter-blocks")}),(0,i.createElement)(c.TextControl,{label:(0,o.__)("From Name","otter-blocks"),value:x.fromName,onChange:e=>S({fromName:e}),help:(0,o.__)("Set the name of the sender. Some SMTP plugins might override this value.","otter-blocks")}),(0,i.createElement)(c.TextControl,{label:(0,o.__)("Email To","otter-blocks"),placeholder:(0,o.__)("Default is to admin site","otter-blocks"),type:"email",value:x.emailTo,onChange:e=>S({emailTo:e}),help:(0,o.__)("Send the form's data to another email. (Admin's email is default).","otter-blocks")}),(0,i.createElement)(c.TextControl,{label:(0,o.__)("Cc","otter-blocks"),placeholder:(0,o.__)("Send copies to","otter-blocks"),type:"text",value:x.cc,onChange:e=>S({cc:e}),help:(0,o.__)("Add emails separated by commas: example1@otter.com, example2@otter.com.","otter-blocks")}),(0,i.createElement)(c.TextControl,{label:(0,o.__)("Bcc","otter-blocks"),placeholder:(0,o.__)("Send copies to","otter-blocks"),type:"text",value:x.bcc,onChange:e=>S({bcc:e}),help:(0,o.__)("Add emails separated by commas: example1@otter.com, example2@otter.com.","otter-blocks")}),(0,i.createElement)(c.TextareaControl,{label:(0,o.__)("Submit Success Message","otter-blocks"),placeholder:(0,o.__)("Success","otter-blocks"),value:x.submitMessage,onChange:e=>S({submitMessage:e}),help:(0,o.__)("Show this message after the form was successfully submitted.","otter-blocks")}),(0,i.createElement)(c.TextControl,{label:(0,o.__)("Redirect To","otter-blocks"),type:"url",placeholder:(0,o.__)("https://example.com","otter-blocks"),value:x.redirectLink,onChange:e=>S({redirectLink:e}),help:(0,o.__)("Redirect the user to another page when submit is successful.","otter-blocks")}),x.redirectLink&&(0,i.createElement)(c.ExternalLink,{href:x.redirectLink,style:{marginBottom:"10px",display:"block"}},(0,o.__)("Preview Redirect link.","otter-blocks")),(0,i.createElement)(c.Button,{isPrimary:!0,onClick:f,help:(0,o.__)("[WIP] Do not forget to save the options ","otter-blocks"),isBusy:"saving"===(null==E?void 0:E.formOptions)},"saving"===(null==E?void 0:E.formOptions)?(0,o.__)("Saving...","otter-blocks"):(0,o.__)("Apply Options","otter-blocks")),"done"===(null==E?void 0:E.formOptions)&&B&&(0,i.createElement)("div",{className:"o-fetch-msg"},(0,o.__)("You have made some modifications. Do not forget to save the options.","otter-blocks")),"error"===(null==E?void 0:E.formOptions)&&(0,i.createElement)("div",{className:"o-fetch-msg o-error"},(0,o.__)("An error has occurred while saving. Please try again.","otter-blocks"))),(0,i.createElement)(c.PanelBody,{title:(0,o.__)("Test SMTP","otter-blocks"),initialOpen:!1},(0,i.createElement)("span",null,(0,o.__)("In order for the Form to work properly, make sure your SMTP server is set up. The test email will be send to the address from the field Email To on Form Options.","otter-blocks")),(0,i.createElement)(c.ExternalLink,{href:"https://www.wpbeginner.com/wp-tutorials/how-to-use-smtp-server-to-send-wordpress-emails/",style:{marginLeft:"3px"}},(0,o.__)("Learn more.","otter-blocks")),(0,i.createElement)("br",null),(0,i.createElement)(c.Button,{variant:"primary",isPrimary:!0,style:{marginTop:"8px"},onClick:C},(0,o.__)("Send Test Email","otter-blocks"))),(0,i.createElement)(c.PanelBody,{title:(0,o.__)("Bot Protection","otter-blocks"),initialOpen:!1},(0,i.createElement)(c.ToggleControl,{label:(0,o.__)("Add captcha checkbox","otter-blocks"),checked:h.hasCaptcha,onChange:e=>v({hasCaptcha:e}),help:(0,o.__)("Add Google reCaptcha V2 for protection againts bots. You will need an API Key.","otter-blocks")}),x.hasCaptcha&&(0,i.createElement)("div",{style:{display:"flow-root",margin:"10px 0px"}},(0,o.__)("You can change the reCaptcha API Keys in Settings > Otter. ","otter-blocks"),(0,i.createElement)(c.ExternalLink,{href:"https://www.google.com/recaptcha/about/",target:"_blank"},(0,o.__)("Learn more about reCaptcha.","otter-blocks")))),(0,i.createElement)(c.PanelBody,{title:(0,o.__)("Marketing Integration","otter-blocks"),initialOpen:!1},(0,o.__)("Add your client email to a Digital Marketing provider.","otter-blocks"),(0,i.createElement)("br",null)," ",(0,i.createElement)("br",null),"loading"===(null==E?void 0:E.formIntegration)&&(0,i.createElement)("div",{className:"o-fetch-msg"},(0,i.createElement)(c.Spinner,null),(0,o.__)("Fetching data from server. Please wait.","otter-blocks")),(0,i.createElement)("b",null,(0,o.__)("You need to have at least one email field in your form. For multiple email fields, only the first will be used.","otter-blocks")),(0,i.createElement)(c.SelectControl,{label:(0,o.__)("Provider","otter-blocks"),value:x.provider,options:[{label:(0,o.__)("None","otter-blocks"),value:""},{label:(0,o.__)("Mailchimp","otter-blocks"),value:"mailchimp"},{label:(0,o.__)("Sendinblue","otter-blocks"),value:"sendinblue"}],onChange:e=>{S({provider:e,listId:"",apiKey:""})}}),x.provider&&(0,i.createElement)(i.Fragment,null,!x.apiKey&&(0,i.createElement)(i.Fragment,null,"mailchimp"===(null==x?void 0:x.provider)&&(0,i.createElement)(c.ExternalLink,{href:"https://us5.admin.mailchimp.com/account/api/",style:{marginBottom:"10px",display:"block"},target:"_blank"},(0,o.__)("Guide to generate the API Key.","otter-blocks")),"sendinblue"===(null==x?void 0:x.provider)&&(0,i.createElement)(c.ExternalLink,{href:"https://help.sendinblue.com/hc/en-us/articles/209467485-What-s-an-API-key-and-how-can-I-get-mine-",style:{marginBottom:"10px",display:"block"},target:"_blank"},(0,o.__)("Guide to generate the API Key.","otter-blocks"))),(0,i.createElement)(c.TextControl,{label:(0,o.__)("API Key","otter-blocks"),help:(0,o.__)("You can find the key in the provider's website","otter-blocks"),value:x.apiKey?`*************************${x.apiKey.slice(-8)}`:"",onChange:e=>{k([]),S({listId:"",apiKey:e})}}),x.apiKey&&2>y.length&&"loading"===(null==E?void 0:E.listId)&&(0,i.createElement)(i.Fragment,null,(0,i.createElement)(c.Spinner,null),(0,o.__)("Loading the options.","otter-blocks"),(0,i.createElement)("br",null),(0,i.createElement)("br",null)),x.apiKey&&"error"===(null==E?void 0:E.listId)&&(0,i.createElement)(i.Fragment,null,(0,o.__)("Invalid API Key. Please check your API Key in the provider's Dashboard.","otter-blocks"),(0,i.createElement)(c.ExternalLink,{target:"_blank",style:{marginBottom:"10px",display:"block"},href:"sendinblue"===x.provider?"https://account.sendinblue.com/advanced/api":"https://us5.admin.mailchimp.com/account/api/"},(0,o.__)("Go to Dashboard.","otter-blocks"))),x.apiKey&&"timeout"===(null==E?void 0:E.listId)&&(0,i.createElement)("p",null,(0,o.__)("Could no connect to the server. Please try again.","otter-blocks")),x.apiKey&&"done"===(null==E?void 0:E.listId)&&(0,i.createElement)(i.Fragment,null,(0,i.createElement)(c.SelectControl,{label:(0,o.__)("Contact List","otter-blocks"),value:x.listId,options:y,onChange:e=>S({listId:e})}),1>=(null==y?void 0:y.length)&&(0,i.createElement)("p",null,(0,o.__)("No Contact list found. Please create a list in your provider interface or check if the API key is correct.","otter-blocks")),2<=(null==y?void 0:y.length)&&x.listId&&(0,i.createElement)(i.Fragment,null,(0,i.createElement)(c.SelectControl,{label:(0,o.__)("Action","otter-blocks"),value:x.action,options:[{label:(0,o.__)("Default","otter-blocks"),value:""},{label:(0,o.__)("Subscribe","otter-blocks"),value:"subscribe"},{label:(0,o.__)("Submit & Subscribe","otter-blocks"),value:"submit-subscribe"}],onChange:e=>S({action:e})}),"submit-subscribe"===x.action&&(0,i.createElement)("div",{style:{marginBottom:"10px"}},(0,o.__)("This action will add the client to the contact list and send a separate email with the form data to administrator or to the email mentioned in 'Form to' field. A checkbox for data-sharing consent with third-party will be added on form.","otter-blocks"))))),(0,i.createElement)("div",{style:{display:"flex",flexDirection:"row",gap:"10px"}},(0,i.createElement)(c.Button,{isPrimary:!0,variant:"primary",onClick:_,isBusy:"saving"===(null==E?void 0:E.formIntegration)},"saving"===(null==E?void 0:E.formIntegration)?(0,o.__)("Saving","otter-blocks"):(0,o.__)("Save","otter-blocks")),h.optionName&&(null==w||null===(m=w.integration)||void 0===m?void 0:m.provider)&&(null==w||null===(p=w.integration)||void 0===p?void 0:p.apiKey)&&(null==w||null===(g=w.integration)||void 0===g?void 0:g.listId)&&(0,i.createElement)(c.Button,{isSecondary:!0,variant:"secondary",onClick:T,isBusy:"saving"===(null==E?void 0:E.serviceTesting)},(0,i.createElement)(i.Fragment,null,(0,o.__)("Test Service","otter-blocks")))),"done"===(null==E?void 0:E.formIntegration)&&z&&(0,i.createElement)("div",{className:"o-fetch-msg"},(0,o.__)("You have made some modifications. Do not forget to save the options.","otter-blocks")),"done"===(null==E?void 0:E.serviceTesting)&&(0,i.createElement)("div",{className:"o-fetch-msg"},(0,o.__)("Remember to delete the test email from your provider's contact list.","otter-blocks")),"done"===(null==E?void 0:E.formIntegration)&&(null==x?void 0:x.apiKey)&&(null==x?void 0:x.listId)&&!M&&(0,i.createElement)("div",{className:"o-fetch-msg o-error"},(0,o.__)("Please add a Text Field with Email as type in your form for email registration.","otter-blocks")),"error"===(null==E?void 0:E.formIntegration)&&(0,i.createElement)("div",{className:"o-fetch-msg o-error"},(0,o.__)("An error has occurred while saving. Please try again.","otter-blocks"))))},Zt=e=>{let{className:t,loadingState:l,isSaving:a,saveAPIKey:n,siteKey:r,secretKey:s,setSiteKey:d,setSecretKey:u}=e;if("loading"===(null==l?void 0:l.captcha))return(0,i.createElement)(i.Fragment,null,(0,i.createElement)("br",null),(0,i.createElement)(c.Placeholder,null,(0,i.createElement)("div",null,(0,i.createElement)(c.Spinner,null),(0,o.__)("Checking the API Keys for reCaptcha","otter-blocks"))));const b=s&&0<(null==s?void 0:s.length)-13?Array(s.length-13).fill("*").join("")+s.slice(-13):s;return(0,i.createElement)(c.Placeholder,{icon:"admin-site",label:(0,o.__)("Google reCaptcha","otter-blocks"),instructions:(0,o.__)("A Google reCaptcha V2 API keys are required, please enter one below.","otter-blocks"),className:t},(0,i.createElement)("div",{className:"components-placeholder__actions",style:{width:"100%"}},(0,i.createElement)(c.TextControl,{type:"text",label:(0,o.__)("Site Key","otter-blocks"),value:r,className:"components-placeholder__input",onChange:d}),(0,i.createElement)(c.TextControl,{type:"text",label:(0,o.__)("Secret Key","otter-blocks"),value:b,className:"components-placeholder__input",onChange:u}),(0,i.createElement)(c.Button,{isPrimary:!0,type:"submit",onClick:n,isBusy:a,disabled:""===r||""===s},(0,o.__)("Save","otter-blocks"))),(0,i.createElement)("div",{className:"components-placeholder__learn-more",style:{margin:"10px 0px"}},(0,o.__)("You need to activate reCaptcha API.","otter-blocks")," ",(0,i.createElement)(c.ExternalLink,{href:"http://www.google.com/recaptcha/admin"},(0,o.__)("Need an API key? Get one here.","otter-blocks"))))};const{attributes:jt}=Ft,Ut=(0,i.createContext)({});var qt=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"themeisle-blocks/form-input","title":"Text Field","category":"themeisle-blocks","description":"Display a contact form for your clients.","keywords":["input","text","email"],"ancestor":["themeisle-blocks/form"],"textdomain":"otter-blocks","attributes":{"id":{"type":"string"},"type":{"type":"string","default":"text"},"label":{"type":"string"},"placeholder":{"type":"string"},"isRequired":{"type":"boolean"},"mappedName":{"type":"string"},"labelColor":{"type":"string"},"inputWidth":{"type":"number"},"helpText":{"type":"string"}},"supports":{"align":["wide","full"]}}'),Jt=e=>{let{attributes:t,setAttributes:l}=e;return(0,i.createElement)(s.InspectorControls,null,(0,i.createElement)(c.PanelBody,{title:(0,o.__)("Settings","otter-blocks")},(0,i.createElement)(c.SelectControl,{label:(0,o.__)("Field Type","otter-blocks"),value:t.type,options:[{label:(0,o.__)("Text","otter-blocks"),value:"text"},{label:(0,o.__)("Email","otter-blocks"),value:"email"},{label:(0,o.__)("Date","otter-blocks"),value:"date"},{label:(0,o.__)("Number","otter-blocks"),value:"number"}],onChange:e=>l({type:e})}),(0,i.createElement)(c.TextControl,{label:(0,o.__)("Label","otter-blocks"),value:t.label,onChange:e=>l({label:e})}),(0,i.createElement)(c.TextControl,{label:(0,o.__)("Placeholder","otter-blocks"),value:t.placeholder,onChange:e=>l({placeholder:e})}),(0,i.createElement)(c.TextControl,{label:(0,o.__)("Help Text","otter-blocks"),value:t.helpText,onChange:e=>l({helpText:e})}),(0,i.createElement)(c.ToggleControl,{label:(0,o.__)("Required","otter-blocks"),help:(0,o.__)("If enabled, the input field must be filled out before submitting the form.","otter-blocks"),checked:t.isRequired,onChange:e=>l({isRequired:e})})),(0,i.createElement)(s.PanelColorSettings,{title:(0,o.__)("Color","otter-blocks"),initialOpen:!1,colorSettings:[{value:t.labelColor,onChange:e=>l({labelColor:e}),label:(0,o.__)("Label Color","otter-blocks")}]}))};const{attributes:Kt}=qt;const Yt=[{attributes:{id:{type:"string"},type:{type:"string",default:"text"},label:{type:"string"},placeholder:{type:"string"},isRequired:{type:"boolean"},mappedName:{type:"string"}},supports:{align:["wide","full"]},save:e=>{let{attributes:t}=e;const l=s.useBlockProps.save();return(0,i.createElement)("div",l,(0,i.createElement)("label",{htmlFor:t.id,className:"otter-form-input-label"},(0,i.createElement)(s.RichText.Content,{value:t.label,className:"otter-form-input-label__label",tagName:"span"}),t.isRequired&&(0,i.createElement)("span",{className:"required"},(0,o.__)("(required)","otter-blocks"))),(0,i.createElement)("input",{type:t.type,name:t.mappedName,id:t.id,required:t.isRequired,placeholder:t.placeholder,className:"otter-form-input"}))}}];var Qt=Yt;const{name:Xt}=qt;window.themeisleGutenberg.isAncestorTypeAvailable||(qt.parent=["themeisle-blocks/form"]),(0,a.registerBlockType)(Xt,{...qt,title:(0,o.__)("Text Field","otter-blocks"),description:(0,o.__)("Display a contact form for your clients.","otter-blocks"),icon:r.inputIcon,deprecated:Qt,keywords:["input","text","email"],variations:[{name:"themeisle-blocks/form-input-email",description:(0,o.__)("Insert an email field","otter-blocks"),icon:"email",title:(0,o.__)("Email Field","otter-blocks"),attributes:{type:"email"}},{name:"themeisle-blocks/form-input-number",description:(0,o.__)("Insert a number field","otter-blocks"),icon:"calculator",title:(0,o.__)("Number Field","otter-blocks"),attributes:{type:"number"}},{name:"themeisle-blocks/form-input-date",description:(0,o.__)("Insert a date field","otter-blocks"),icon:"calendar-alt",title:(0,o.__)("Date Field","otter-blocks"),attributes:{type:"date"}}],edit:e=>{let{attributes:t,setAttributes:l,clientId:a}=e;(0,i.useEffect)((()=>{const e=(0,L.blockInit)(a,Kt);return()=>e(t.id)}),[t.id]);const n=(0,s.useBlockProps)(),r=(0,i.useRef)(null),c=(0,i.useRef)(null),d=(0,i.useRef)(null);return(0,i.useEffect)((()=>{var e,l,o,a,n,i,s;c.current&&(null===(e=c.current)||void 0===e||null===(l=e.style)||void 0===l||l.setProperty("--input-width",(o=t.inputWidth)?o+"%":null)),r.current&&(null===(a=r.current)||void 0===a||null===(n=a.style)||void 0===n||n.setProperty("--label-color",t.labelColor||null)),d.current&&(null===(i=d.current)||void 0===i||null===(s=i.style)||void 0===s||s.setProperty("--label-color",t.labelColor||null))}),[c.current,r.current,d.current,t.labelColor,t.inputWidth]),(0,i.createElement)(i.Fragment,null,(0,i.createElement)(Jt,{attributes:t,setAttributes:l}),(0,i.createElement)("div",n,(0,i.createElement)("label",{ref:r,htmlFor:t.id,className:"otter-form-input-label"},(0,i.createElement)(s.RichText,{placeholder:(0,o.__)("Type here…","otter-blocks"),className:"otter-form-input-label__label",value:t.label,onChange:e=>l({label:e}),tagName:"span"}),t.isRequired&&(0,i.createElement)("span",{className:"required"},"*")),(0,i.createElement)("input",{ref:c,type:t.type,placeholder:t.placeholder,name:t.id,id:t.id,required:t.isRequired,disabled:!0,className:"otter-form-input components-text-control__input"}),t.helpText&&(0,i.createElement)("span",{className:"o-form-help",ref:d},t.helpText)))},save:e=>{let{attributes:t}=e;const l=s.useBlockProps.save({id:t.id});return(0,i.createElement)("div",l,(0,i.createElement)("label",{htmlFor:t.id?t.id+"-input":"",className:"otter-form-input-label"},(0,i.createElement)(s.RichText.Content,{value:t.label,className:"otter-form-input-label__label",tagName:"span"}),t.isRequired&&(0,i.createElement)("span",{className:"required"},"*")),(0,i.createElement)("input",{type:t.type,name:t.mappedName,id:t.id?t.id+"-input":"",required:t.isRequired,placeholder:t.placeholder,className:"otter-form-input"}),t.helpText&&(0,i.createElement)("span",{className:"o-form-help"},t.helpText))}});var el=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"themeisle-blocks/form-nonce","title":"Nonce Field","category":"themeisle-blocks","description":"Protect the form from CSRF.","keywords":["protection","csrf","field"],"textdomain":"otter-blocks","attributes":{"formId":{"type":"string"}},"supports":{"align":["wide","full"],"inserter":false}}');const{name:tl}=el;(0,a.registerBlockType)(tl,{...el,title:(0,o.__)("Nonce Field","otter-blocks"),description:(0,o.__)("Protect the form from CSRF.","otter-blocks"),icon:r.inputIcon,keywords:["protection","csrf","field"],edit:e=>{let{setAttributes:t,clientId:l}=e;const{parent:o}=(0,v.useSelect)((e=>{const{getBlock:t,getBlockRootClientId:o}=e("core/block-editor");return{parent:t(o(l))}}),[]);return(0,i.useEffect)((()=>{o&&t({formId:o.attributes.id})}),[o]),null},save:()=>null});var ll=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"themeisle-blocks/form-textarea","title":"Textarea Field","category":"themeisle-blocks","description":"Display a contact form for your clients.","keywords":["textarea","message","input"],"ancestor":["themeisle-blocks/form"],"textdomain":"otter-blocks","attributes":{"id":{"type":"string"},"label":{"type":"string"},"placeholder":{"type":"string"},"isRequired":{"type":"boolean"},"mappedName":{"type":"string"},"labelColor":{"type":"string"},"inputWidth":{"type":"number"},"helpText":{"type":"string"}},"supports":{"align":["wide","full"]}}'),ol=e=>{let{attributes:t,setAttributes:l}=e;return(0,i.createElement)(s.InspectorControls,null,(0,i.createElement)(c.PanelBody,{title:(0,o.__)("Settings","otter-blocks")},(0,i.createElement)(c.TextControl,{label:(0,o.__)("Label","otter-blocks"),value:t.label,onChange:e=>l({label:e})}),(0,i.createElement)(c.TextControl,{label:(0,o.__)("Placeholder","otter-blocks"),value:t.placeholder,onChange:e=>l({placeholder:e})}),(0,i.createElement)(c.TextControl,{label:(0,o.__)("Help Text","otter-blocks"),value:t.helpText,onChange:e=>l({helpText:e})}),(0,i.createElement)(c.ToggleControl,{label:(0,o.__)("Required","otter-blocks"),help:(0,o.__)("If enabled, the input field must be filled out before submitting the form.","otter-blocks"),checked:t.isRequired,onChange:e=>l({isRequired:e})})))};const{attributes:al}=ll;const nl=[{attributes:{id:{type:"string"},type:{type:"string",default:"text"},label:{type:"string"},placeholder:{type:"string"},isRequired:{type:"boolean"},mappedName:{type:"string"}},supports:{align:["wide","full"]},save:e=>{let{attributes:t}=e;const l=s.useBlockProps.save();return(0,i.createElement)("div",l,(0,i.createElement)("label",{htmlFor:t.id,className:"otter-form-textarea-label"},(0,i.createElement)(s.RichText.Content,{value:t.label,className:"otter-form-textarea-label__label",tagName:"span"}),t.isRequired&&(0,i.createElement)("span",{className:"required"},(0,o.__)("(required)","otter-blocks"))),(0,i.createElement)("textarea",{name:t.mappedName,id:t.id,required:t.isRequired,placeholder:t.placeholder,rows:10,className:"otter-form-textarea-input"}))}}];var rl=nl;const{name:il}=ll;window.themeisleGutenberg.isAncestorTypeAvailable||(ll.parent=["themeisle-blocks/form"]),(0,a.registerBlockType)(il,{...ll,title:(0,o.__)("Textarea Field","otter-blocks"),description:(0,o.__)("Display a contact form for your clients.","otter-blocks"),icon:r.inputIcon,deprecated:rl,keywords:["textarea","message","input"],edit:e=>{let{attributes:t,setAttributes:l,clientId:a}=e;(0,i.useEffect)((()=>{const e=(0,L.blockInit)(a,al);return()=>e(t.id)}),[t.id]);const n=(0,s.useBlockProps)(),r=(0,i.useRef)(null),c=(0,i.useRef)(null),d=(0,i.useRef)(null);return(0,i.useEffect)((()=>{var e,l,o,a,n,i,s;c.current&&(null===(e=c.current)||void 0===e||null===(l=e.style)||void 0===l||l.setProperty("--input-width",(o=t.inputWidth)?o+"%":o)),r.current&&(null===(a=r.current)||void 0===a||null===(n=a.style)||void 0===n||n.setProperty("--label-color",t.labelColor||null)),d.current&&(null===(i=d.current)||void 0===i||null===(s=i.style)||void 0===s||s.setProperty("--label-color",t.labelColor||null))}),[c.current,r.current,t]),(0,i.createElement)(i.Fragment,null,(0,i.createElement)(ol,{attributes:t,setAttributes:l}),(0,i.createElement)("div",n,(0,i.createElement)("label",{ref:r,htmlFor:t.id?t.id+"-input":"",className:"otter-form-textarea-label"},(0,i.createElement)(s.RichText,{placeholder:(0,o.__)("Type here…","otter-blocks"),className:"otter-form-textarea-label__label",value:t.label,onChange:e=>l({label:e}),tagName:"span"}),t.isRequired&&(0,i.createElement)("span",{className:"required"},"*")),(0,i.createElement)("textarea",{ref:c,placeholder:t.placeholder,name:t.id,id:t.id?t.id+"-input":"",required:t.isRequired,disabled:!0,rows:10,className:"otter-form-textarea-input components-textarea-control__input"}),t.helpText&&(0,i.createElement)("span",{className:"o-form-help",ref:d},t.helpText)))},save:e=>{let{attributes:t}=e;const l=s.useBlockProps.save({id:t.id});return(0,i.createElement)("div",l,(0,i.createElement)("label",{htmlFor:t.id?t.id+"-input":"",className:"otter-form-textarea-label"},(0,i.createElement)(s.RichText.Content,{value:t.label,className:"otter-form-textarea-label__label",tagName:"span"}),t.isRequired&&(0,i.createElement)("span",{className:"required"},"*")),(0,i.createElement)("textarea",{name:t.mappedName,id:t.id?t.id+"-input":"",required:t.isRequired,placeholder:t.placeholder,rows:10,className:"otter-form-textarea-input"}),t.helpText&&(0,i.createElement)("span",{className:"o-form-help"},t.helpText))}});const{name:sl}=Ft;(0,a.registerBlockType)(sl,{...Ft,title:(0,o.__)("Form","otter-blocks"),description:(0,o.__)("Display a form for your clients. Powered by Otter.","otter-blocks"),icon:r.contactIcon,keywords:["business","form","email"],edit:e=>{let{attributes:t,setAttributes:l,clientId:n,isSelected:r,name:c}=e;const[d,u]=(0,i.useState)(""),[b,m]=(0,i.useState)(""),[p,h]=(0,i.useState)({formOptions:"done",formIntegration:"done",listId:"init",captcha:"init",serviceTesting:"init"}),y=e=>{h((t=>({...t,...e})))},[k,f]=(0,i.useState)({provider:void 0,redirectLink:void 0,fromName:void 0,emailTo:void 0,subject:void 0,email:void 0,listId:void 0,action:void 0,hasCaptcha:void 0,submitMessage:void 0,apiKey:void 0,cc:void 0,bcc:void 0}),[_,w]=(0,i.useState)(!0),[C,E]=(0,i.useState)([{label:(0,o.__)("None","otter-blocks"),value:""}]),{insertBlock:x,removeBlock:S}=(0,v.useDispatch)("core/block-editor"),{replaceInnerBlocks:T}=(0,v.useDispatch)("core/block-editor"),{createNotice:M}=(0,v.dispatch)("core/notices"),B=(0,v.useSelect)((e=>0<e("core/block-editor").getBlocks(n).length),[n]),{blockType:z,defaultVariation:P,variations:R}=(0,v.useSelect)((e=>{const{getBlockVariations:t,getBlockType:l,getDefaultBlockVariation:o}=e("core/blocks");return{blockType:l(c),defaultVariation:o(c,"block"),variations:t(c,"block")}}),[c]),{children:F,hasEmailField:A}=(0,v.useSelect)((e=>{const{getBlock:t}=e("core/block-editor"),l=t(n).innerBlocks;return{children:l,hasEmailField:null==l?void 0:l.some((e=>{var t;return"email"===(null==e||null===(t=e.attributes)||void 0===t?void 0:t.type)}))}}));(0,i.useEffect)((()=>{const e=(0,L.blockInit)(n,jt);return()=>e(t.id)}),[t.id]),(0,i.useEffect)((()=>{var e;t.id&&(0,v.select)("core/edit-widgets")?l({optionName:`widget_${t.id.slice(-8)}`}):t.id&&Boolean(window.themeisleGutenberg.isBlockEditor)&&null!==(e=(0,v.select)("core/editor"))&&void 0!==e&&e.getCurrentPostId()&&l({optionName:`${(0,v.select)("core/editor").getCurrentPostId()}_${t.id.slice(-8)}`})}),[t.id]),(0,i.useEffect)((()=>{if(F){const e=F.filter((e=>{let{name:t}=e;return"themeisle-blocks/form-nonce"===t}));if(2<=(null==e?void 0:e.length))e.slice(1).forEach((e=>{S(e.clientId,!1)}));else if(0===(null==e?void 0:e.length)&&n){const e=(0,a.createBlock)("themeisle-blocks/form-nonce");e&&(null==x||x(e,(null==F?void 0:F.length)||0,n,!1))}}}),[F]);const H=e=>null==e?void 0:e.filter((e=>{let{form:l}=e;return l===t.optionName})).pop(),O=e=>{var t,l,o,a;f({emailTo:null==e?void 0:e.email,fromName:null==e?void 0:e.fromName,redirectLink:null==e?void 0:e.redirectLink,subject:null==e?void 0:e.emailSubject,cc:null==e?void 0:e.cc,bcc:null==e?void 0:e.bcc,submitMessage:null==e?void 0:e.submitMessage,provider:null==e||null===(t=e.integration)||void 0===t?void 0:t.provider,apiKey:null==e||null===(l=e.integration)||void 0===l?void 0:l.apiKey,listId:null==e||null===(o=e.integration)||void 0===o?void 0:o.listId,action:null==e||null===(a=e.integration)||void 0===a?void 0:a.action,hasCaptcha:null==e?void 0:e.hasCaptcha})};(0,i.useEffect)((()=>{let e=new AbortController;const l=setTimeout((()=>{y({formOptions:"done",formIntegration:"done"})}),3e3);return t.optionName&&Nt().loadPromise.then((()=>{y({formOptions:"loading",formIntegration:"loading"}),(new(Nt().models.Settings)).fetch({signal:e.signal}).done((t=>{e=null;const o=H(t.themeisle_blocks_form_emails);o&&(O(o),w(o)),y({formIntegration:"done",formOptions:"done"}),clearTimeout(l)})).catch((()=>{y({formIntegration:"done",formOptions:"done"}),clearTimeout(l)}))})),()=>{var t;null===(t=e)||void 0===t||t.abort(),clearTimeout(l)}}),[t.optionName]),(0,i.useEffect)((()=>{let e,t=new AbortController;return k.apiKey&&k.provider&&(e=setTimeout((()=>y({listId:"timeout"})),6e3),y({listId:"loading"}),It()({path:"otter/v1/form/editor",method:"POST",data:{handler:"listId",payload:{provider:k.provider,apiKey:k.apiKey,action:k.action}},signal:t.signal}).then((l=>{if(t=null,clearTimeout(e),null!=l&&l.success){var a;const e=(null==l||null===(a=l.list_id)||void 0===a?void 0:a.map((e=>{var t;return{label:e.name,value:null===(t=e.id)||void 0===t?void 0:t.toString()}})))||[];e.splice(0,0,{label:(0,o.__)("None","otter-blocks"),value:""}),E(e),y({listId:"done"});const t=1===e.map((e=>{let{value:t}=e;return t})).filter((e=>e===k.listId)).length;k.listId&&!t&&M("error",(0,o.__)("The current contact list is invalid. Please choose a new contact list.","otter-blocks"),{isDismissible:!0,type:"snackbar"})}else M("error",null==l?void 0:l.error,{isDismissible:!0,type:"snackbar",id:"themeisle-form-server-error"}),y({listId:"error"})})).catch((e=>{console.error(e),y({listId:"error"})}))),()=>{var l;null===(l=t)||void 0===l||l.abort(),clearTimeout(e)}}),[k.apiKey,k.provider]),(0,i.useEffect)((()=>{let e=new AbortController;if(void 0!==t.hasCaptcha&&t.optionName)try{var l,a;null===(l=new(Nt().models.Settings))||void 0===l||null===(a=l.current)||void 0===a||a.fetch({signal:e.signal}).done((l=>{e=null;const a=l.themeisle_blocks_form_emails?l.themeisle_blocks_form_emails:[];let n=!0,r=!1;null==a||a.forEach(((e,l)=>{let{form:o}=e;o===t.optionName&&(a[l].hasCaptcha!==t.hasCaptcha&&(r=!0),a[l].hasCaptcha=t.hasCaptcha,n=!1)})),n&&a.push({form:t.optionName,hasCaptcha:t.hasCaptcha}),(n||r)&&(new(Nt().models.Settings)({themeisle_blocks_form_emails:a}).save(),M("info",(0,o.__)("Form preferences have been saved.","otter-blocks"),{isDismissible:!0,type:"snackbar"}))}))}catch(e){console.warn(e.message)}return()=>{var t;return null===(t=e)||void 0===t?void 0:t.abort()}}),[t.hasCaptcha,t.optionName]),(0,i.useEffect)((()=>{let e=new AbortController;return t.hasCaptcha&&"init"===(null==p?void 0:p.captcha)&&(()=>{y({captcha:"loading"});try{var t;null===(t=new(Nt().models.Settings))||void 0===t||t.fetch({signal:e.signal}).then((t=>{e=null,""!==t.themeisle_google_captcha_api_site_key&&""!==t.themeisle_google_captcha_api_secret_key?y({captcha:"done"}):(y({captcha:"missing"}),u(t.themeisle_google_captcha_api_site_key),m(t.themeisle_google_captcha_api_secret_key))})).catch((e=>{console.error(e),y({captcha:"error"})}))}catch(e){console.warn(e.message),y({captcha:"error"})}})(),()=>{var t;return null===(t=e)||void 0===t?void 0:t.abort()}}),[p.captcha,t.hasCaptcha]);const N={"--message-font-size":void 0!==t.messageFontSize&&t.messageFontSize,"--input-font-size":void 0!==t.inputFontSize&&t.inputFontSize,"--help-font-size":void 0!==t.helpFontSize&&t.helpFontSize,"--input-color":t.inputColor,"--padding":(V=t.inputPadding,V?V.top+" "+V.right+" "+V.bottom+" "+V.left:null),"--border-radius":void 0!==t.inputBorderRadius&&t.inputBorderRadius+"px","--border-width":void 0!==t.inputBorderWidth&&t.inputBorderWidth+"px","--border-color":t.inputBorderColor,"--label-color":t.labelColor,"--input-width":void 0!==t.inputWidth&&t.inputWidth+"%","--submit-color":t.submitColor,"--required-color":t.inputRequiredColor,"--input-gap":void 0!==t.inputGap&&t.inputGap+"px","--inputs-gap":void 0!==t.inputsGap&&t.inputsGap+"px","--label-font-size":void 0!==t.labelFontSize&&t.labelFontSize,"--submit-font-size":void 0!==t.submitFontSize&&t.submitFontSize,"--help-label-color":t.helpLabelColor,"--input-bg-color":t.inputBackgroundColor};var V;const[I,D]=(0,L.useCSSNode)();(0,i.useEffect)((()=>{D([`.otter-form__container .wp-block-button__link {\n\t\t\t\tbackground-color: ${t.submitBackgroundColor}\n\t\t\t}`,`.otter-form__container .wp-block-button__link:hover {\n\t\t\t\t${t.submitBackgroundColorHover&&`background-color: ${t.submitBackgroundColorHover}`}\n\t\t\t}`])}),[t.submitBackgroundColor,t.submitBackgroundColorHover]);const G=(0,s.useBlockProps)({id:t.id,style:N,className:I});return(0,i.createElement)(i.Fragment,null,(0,i.createElement)(Ut.Provider,{value:{savedFormOptions:_,listIDOptions:C,setListIDOptions:E,saveFormEmailOptions:()=>{y({formOptions:"saving"}),(new(Nt().models.Settings)).fetch().done((e=>{const l=e.themeisle_blocks_form_emails?e.themeisle_blocks_form_emails:[];let a=!0,n=!1;null==l||l.forEach(((e,o)=>{let{form:r}=e;r===t.optionName&&(n=l[o].email!==k.emailTo||l[o].redirectLink!==k.redirectLink||l[o].emailSubject!==k.subject||l[o].submitMessage!==k.submitMessage||l[o].fromName!==k.fromName||l[o].cc!==k.cc||l[o].bcc!==k.bcc,l[o].email=k.emailTo,l[o].redirectLink=k.redirectLink,l[o].emailSubject=k.subject,l[o].submitMessage=k.submitMessage,l[o].fromName=k.fromName,l[o].cc=k.cc,l[o].bcc=k.bcc,a=!1)})),a&&l.push({form:t.optionName,email:k.emailTo,fromName:k.fromName,redirectLink:k.redirectLink,emailSubject:k.subject,submitMessage:k.submitMessage,cc:k.cc,bcc:k.bcc}),a||n?new(Nt().models.Settings)({themeisle_blocks_form_emails:l}).save().then((e=>{const t=H(e.themeisle_blocks_form_emails);t?(O(t),w(t),y({formOptions:"done"}),M("info",(0,o.__)("Form options have been saved.","otter-blocks"),{isDismissible:!0,type:"snackbar"})):y({formOptions:"error"})})):y({formOptions:"done"})})).catch((()=>y({formOptions:"error"})))},formOptions:k,setFormOption:e=>{f((t=>({...t,...e})))},saveIntegration:()=>{var e;y({formIntegration:"saving"}),null===(e=new(Nt().models.Settings))||void 0===e||e.fetch().done((e=>{const a=e.themeisle_blocks_form_emails?e.themeisle_blocks_form_emails:[];let n=!0,r=!1;null==a||a.forEach(((e,l)=>{let{form:o}=e;var i,s,c,d,u;o===t.optionName&&(null!==(i=a[l])&&void 0!==i&&i.integration||(a[l].integration={}),r=(null===(s=a[l].integration)||void 0===s?void 0:s.provider)!==k.provider||(null===(c=a[l].integration)||void 0===c?void 0:c.listId)!==k.listId||(null===(d=a[l].integration)||void 0===d?void 0:d.action)!==k.action||(null===(u=a[l].integration)||void 0===u?void 0:u.apiKey)!==k.apiKey,n=!1,a[l].integration.provider=k.provider,a[l].integration.apiKey=k.apiKey,a[l].integration.listId=k.listId,a[l].integration.action=k.action)})),n&&a.push({form:t.optionName,integration:{provider:k.provider,apiKey:k.apiKey,listId:k.listId,action:k.action}}),n||r?new(Nt().models.Settings)({themeisle_blocks_form_emails:a}).save().then((e=>{const t=H(e.themeisle_blocks_form_emails);var a;t&&(O(t),w(t),l({action:null==t||null===(a=t.integration)||void 0===a?void 0:a.action})),y({formIntegration:"done"}),r&&M("info",(0,o.__)("Integration details have been saved.","otter-blocks"),{isDismissible:!0,type:"snackbar"})})).catch((e=>{console.error(e),y({formIntegration:"error"})})):y({formIntegration:"done"})})).catch((()=>{y({formIntegration:"error"})}))},sendTestEmail:()=>{It()({path:"otter/v1/form/editor",method:"POST",data:{handler:"testEmail",payload:{provider:"default",to:null==k?void 0:k.emailTo,site:window.location.href}}}).then((e=>{null!=e&&e.success?M("info",(0,o.__)("The test email has been send. Check your emails for confirmation.","otter-blocks"),{isDismissible:!0,type:"snackbar"}):M("error",(0,o.__)("An error has occurred: ","otter-blocks")+((null==e?void 0:e.error)||(0,o.__)("unknown","otter-blocks")),{isDismissible:!0,type:"snackbar"})})).catch((e=>{console.error(e),M("error",null==e?void 0:e.message,{isDismissible:!0,type:"snackbar"})}))},loadingState:p,testService:()=>{y({serviceTesting:"loading"}),It()({path:"otter/v1/form/editor",method:"POST",data:{handler:"testEmail",payload:{formOption:t.optionName}}}).then((e=>{null!=e&&e.success?(M("info",(0,o.__)("A test email has been registered to your contact list. Check your provider for confirmation.","otter-blocks"),{isDismissible:!0,type:"snackbar"}),y({serviceTesting:"done"})):(M("error",(0,o.__)("An error has occurred: ","otter-blocks")+((null==e?void 0:e.error)||(0,o.__)("unknown","otter-blocks")+(0,o.__)(". Check your provider for confirmation.","otter-blocks")),{isDismissible:!0,type:"snackbar"}),y({serviceTesting:"error"}))})).catch((e=>{console.error(e),M("error",null==e?void 0:e.message,{isDismissible:!0,type:"snackbar"}),y({testService:"error"})}))},hasEmailField:A}},(0,i.createElement)(Wt,{attributes:t,setAttributes:l}),(0,i.createElement)("div",G,B?(0,i.createElement)("form",{className:"otter-form__container",onSubmit:()=>!1},(0,i.createElement)(s.InnerBlocks,null),t.hasCaptcha&&"done"!==(null==p?void 0:p.captcha)&&(0,i.createElement)(Zt,{className:"otter-form-captcha",loadingState:p,saveAPIKey:()=>{y({captcha:"loading"});try{var e,t,l;const a=new(Nt().models.Settings)({themeisle_google_captcha_api_site_key:d,themeisle_google_captcha_api_secret_key:b});null==a||null===(e=a.save)||void 0===e||null===(t=e.call(a))||void 0===t||null===(l=t.then((e=>{""!==e.themeisle_google_captcha_api_site_key&&""!==e.themeisle_google_captcha_api_secret_key?y({captcha:"done"}):y({captcha:"missing"}),m(""),u(""),M("info",(0,o.__)("Google reCaptcha API Keys have been saved.","otter-blocks"),{isDismissible:!0,type:"snackbar"}).catch((e=>{console.error(e),y({captcha:"error"})}))})))||void 0===l||l.catch((e=>{console.error(e),y({captcha:"error"})}))}catch(e){console.warn(e.message),y({captcha:"error"})}},siteKey:d,secretKey:b,setSiteKey:u,setSecretKey:m}),"submit-subscribe"===t.action&&(0,i.createElement)("div",{className:"otter-form-consent"},(0,i.createElement)("input",{id:"o-consent",name:"o-consent",type:"checkbox"}),(0,i.createElement)("label",{htmlFor:"o-consent"},(0,o.__)("I have read and agreed the privacy statement.","otter-blocks"))),(0,i.createElement)("div",{className:g()("wp-block-button has-submit-msg",{right:"right"===t.submitStyle},{full:"full"===t.submitStyle})},(0,i.createElement)("button",{className:"wp-block-button__link",type:"submit",disabled:!0},t.submitLabel?t.submitLabel:(0,o.__)("Submit","otter-blocks")),r&&(0,i.createElement)("div",null,(0,i.createElement)("div",{className:"o-form-server-response o-success",style:{color:t.submitMessageColor}},k.submitMessage||(0,o.__)("Success","otter-blocks")),(0,i.createElement)("div",{className:"o-form-server-response o-error",style:{color:t.submitMessageErrorColor,margin:"0px"}},(0,o.__)("Error. Please try again.","otter-blocks"))))):(0,i.createElement)(s.__experimentalBlockVariationPicker,{icon:(0,K.get)(z,["icon","src"]),label:(0,K.get)(z,["title"]),variations:R,onSelect:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:P;e&&T(n,(0,a.createBlocksFromInnerBlocksTemplate)(e.innerBlocks),!0)},allowSkip:!0}))))},save:e=>{let{attributes:t}=e;const l=s.useBlockProps.save({id:t.id,className:g()({"can-submit-and-subscribe":"submit-subscribe"===t.action,"has-captcha":t.hasCaptcha}),"data-option-name":t.optionName});return(0,i.createElement)("div",l,(0,i.createElement)("form",{className:"otter-form__container"},(0,i.createElement)(s.InnerBlocks.Content,null),(0,i.createElement)("div",{className:g()("wp-block-button",{right:"right"===t.submitStyle},{full:"full"===t.submitStyle})},(0,i.createElement)("button",{className:"wp-block-button__link",type:"submit"},t.submitLabel?t.submitLabel:(0,o.__)("Submit","otter-blocks")))))},deprecated:Ht,example:{attributes:{},innerBlocks:[{name:"themeisle-blocks/form-input",attributes:{label:(0,o.__)("Name","otter-blocks"),type:"text",isRequired:!0}},{name:"themeisle-blocks/form-input",attributes:{label:(0,o.__)("Email","otter-blocks"),type:"email",isRequired:!0}},{name:"themeisle-blocks/form-textarea",attributes:{label:(0,o.__)("Message","otter-blocks")}},{name:"core/paragraph",attributes:{content:(0,o.__)("You agree to receive email communication from us by submitting this form and understand that your contact information will be stored with us.","otter-blocks"),fontSize:"extra-small"}}]},variations:[{name:"themeisle-blocks/form-contact",description:(0,o.__)("Contact form for clients","otter-blocks"),icon:r.contactIcon,title:(0,o.__)("Contact Form","otter-blocks"),innerBlocks:[["themeisle-blocks/form-input",{label:(0,o.__)("Name","otter-blocks"),type:"text",isRequired:!0}],["themeisle-blocks/form-input",{label:(0,o.__)("Email","otter-blocks"),type:"email",isRequired:!0}],["themeisle-blocks/form-textarea",{label:(0,o.__)("Message","otter-blocks")}],["core/paragraph",{content:(0,o.__)("You agree to receive email communication from us by submitting this form and understand that your contact information will be stored with us.","otter-blocks"),fontSize:"extra-small"}]]},{name:"themeisle-blocks/form-subscribe",description:(0,o.__)("Add the clients to your subscription list","otter-blocks"),icon:r.contactIcon,title:(0,o.__)("Subscribe Form","otter-blocks"),innerBlocks:[["themeisle-blocks/form-input",{label:(0,o.__)("Name","otter-blocks"),type:"text",isRequired:!0}],["themeisle-blocks/form-input",{label:(0,o.__)("Email","otter-blocks"),type:"email",isRequired:!0}],["core/paragraph",{content:(0,o.__)("You agree to receive email communication from us by submitting this form and understand that your contact information will be stored with us.","otter-blocks"),fontSize:"extra-small"}]]}]});var cl=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"themeisle-blocks/google-map","title":"Google Maps","category":"themeisle-blocks","description":"Display Google Maps on your website with Google Map block. Powered by Otter.","keywords":["map","google","orbitfox"],"textdomain":"otter-blocks","attributes":{"id":{"type":"string"},"style":{"type":"string","default":"standard"},"location":{"type":"string","default":"La Sagrada Familia, Barcelona, Spain"},"latitude":{"type":"string"},"longitude":{"type":"string"},"type":{"type":"string","default":"roadmap"},"zoom":{"type":"number","default":15},"height":{"type":["number","string"],"default":"400px"},"heightTablet":{"type":"string"},"heightMobile":{"type":"string"},"draggable":{"type":"boolean","default":true},"mapTypeControl":{"type":"boolean","default":true},"zoomControl":{"type":"boolean","default":true},"fullscreenControl":{"type":"boolean","default":true},"streetViewControl":{"type":"boolean","default":true},"markers":{"type":"array","default":[]}},"supports":{"align":["wide","full"],"html":false},"editorStyle":"otter-google-map-editor","style":"otter-google-map-style","script":"google-maps"}'),dl=l(4586),ul=e=>{let{api:t,error:l,isAPILoaded:a,isAPISaved:n,isSaving:r,changeAPI:s,saveAPIKey:d}=e;return a?n?void 0:(0,i.createElement)(c.Placeholder,{icon:"admin-site",label:(0,o.__)("Google Maps","otter-blocks"),instructions:(0,o.__)("A Google Maps API key is required, please enter one below.","otter-blocks")},(0,i.createElement)("div",{className:"components-placeholder__actions"},(0,i.createElement)(c.TextControl,{type:"text",placeholder:(0,o.__)("Google Maps API Key","otter-blocks"),value:t,className:g()("components-placeholder__input",{"is-invalid":l}),onChange:s}),(0,i.createElement)(c.Button,{isPrimary:!0,type:"submit",onClick:d,isBusy:r,disabled:""===t||l},(0,o.__)("Save","otter-blocks"))),(0,i.createElement)("div",{className:"components-placeholder__learn-more"},l&&(0,i.createElement)("p",null,(0,o.__)("The API key could not be validated.","otter-blocks")),(0,i.createElement)("p",null,(0,o.__)("You need to activate Maps and Places API.","otter-blocks")," ",(0,i.createElement)(c.ExternalLink,{href:"https://developers.google.com/maps/documentation/javascript/get-api-key"},(0,o.__)("Need an API key? Get one here.","otter-blocks"))))):(0,i.createElement)(c.Placeholder,null,(0,i.createElement)(c.Spinner,null),(0,o.__)("Loading…","otter-blocks"))},bl=l(5241);const ml=e=>{let{value:t,onChange:l}=e;const a=(0,Y.useInstanceId)(ml);(0,i.useEffect)((()=>{window.wp.oldEditor.initialize(r.current.id,{tinymce:{classic_block_editor:!0,plugins:"lists,media,paste,tabfocus,wordpress,wpautoresize,wpeditimage,wpgallery,wplink,wpdialogs,wptextpattern,wpview",toolbar1:"formatselect,bold,italic,bullist,numlist,alignleft,aligncenter,alignright,link,unlink,spellchecker,wp_add_media"}});const e=window.tinymce.get(r.current.id);return e.on("change",(()=>l(e.getContent()))),()=>window.wp.oldEditor.remove(r.current.id)}),[]);const n=`inspector-textarea-control-${a}`,r=(0,i.useRef)(null);return(0,i.createElement)(c.BaseControl,{id:n,label:(0,o.__)("Description","otter-blocks")},(0,i.createElement)("textarea",{id:n,className:"components-textarea-control__input",rows:4,value:t,onChange:e=>l(e.target.value),ref:r}))};var pl=ml,gl=e=>{let{marker:t,isOpen:l,isPlaceAPIAvailable:a,openMarker:n,removeMarker:r,changeMarkerProp:s}=e;const d=(0,i.useRef)(null);return(0,i.createElement)("div",{className:"wp-block-themeisle-blocks-google-map-marker"},(0,i.createElement)("div",{className:"wp-block-themeisle-blocks-google-map-marker-title-area"},(0,i.createElement)(c.Button,{className:"wp-block-themeisle-blocks-google-map-marker-title",onClick:()=>n(t.id)},t.title||(0,o.__)("Custom Marker","otter-blocks")),(0,i.createElement)(c.Button,{icon:"no-alt",label:(0,o.__)("Remove Marker","otter-blocks"),showTooltip:!0,className:"wp-block-themeisle-blocks-google-map-marker-remove",onClick:()=>r(t.id)})),(0,i.createElement)("div",{className:g()("wp-block-themeisle-blocks-google-map-marker-control-area",{opened:t.id===l})},(0,i.createElement)(c.BaseControl,{label:(0,o.__)("Location","otter-blocks"),id:`themeisle-location-search-${t.id}`},(0,i.createElement)("input",{type:"text",id:`themeisle-location-search-${t.id}`,placeholder:(0,o.__)("Enter a location…","otter-blocks"),value:t.location,className:"wp-block-themeisle-blocks-google-map-search",ref:d,onFocus:()=>{const e=document.getElementsByClassName("pac-container");Object.keys(e).forEach((t=>e[t].remove()));const l=new window.google.maps.places.SearchBox(d.current);l.addListener("places_changed",(()=>{const e=l.getPlaces();e&&0<e.length&&e.forEach((e=>{const l=e.formatted_address||e.name,o=e.geometry.location.lat(),a=e.geometry.location.lng();s(t.id,"location",l),s(t.id,"latitude",o),s(t.id,"longitude",a)}))}))},onChange:e=>s(t.id,"location",e.target.value),disabled:!a}),!a&&(0,i.createElement)("p",null,(0,o.__)("To enable locations earch, please ensure Places API is activated in the Google Developers Console.","otter-blocks")+" ",(0,i.createElement)(c.ExternalLink,{href:"https://developers.google.com/places/web-service/intro"},(0,o.__)("More info.","otter-blocks")))),(0,i.createElement)(c.TextControl,{label:(0,o.__)("Latitude","otter-blocks"),type:"text",value:t.latitude,onChange:e=>s(t.id,"latitude",e)}),(0,i.createElement)(c.TextControl,{label:(0,o.__)("Longitude","otter-blocks"),type:"text",value:t.longitude,onChange:e=>s(t.id,"longitude",e)}),(0,i.createElement)(c.SelectControl,{label:(0,o.__)("Map Icon","otter-blocks"),value:t.icon||"https://maps.google.com/mapfiles/ms/icons/red-dot.png",options:[{label:(0,o.__)("Red","otter-blocks"),value:"https://maps.google.com/mapfiles/ms/icons/red-dot.png"},{label:(0,o.__)("Blue","otter-blocks"),value:"https://maps.google.com/mapfiles/ms/icons/blue-dot.png"},{label:(0,o.__)("Yellow","otter-blocks"),value:"https://maps.google.com/mapfiles/ms/icons/yellow-dot.png"},{label:(0,o.__)("Green","otter-blocks"),value:"https://maps.google.com/mapfiles/ms/icons/green-dot.png"},{label:(0,o.__)("Orange","otter-blocks"),value:"https://maps.google.com/mapfiles/ms/icons/orange-dot.png"}],onChange:e=>s(t.id,"icon",e)}),(0,i.createElement)(c.TextControl,{label:(0,o.__)("Title","otter-blocks"),type:"text",value:t.title,onChange:e=>s(t.id,"title",e)}),(0,i.createElement)(pl,{label:(0,o.__)("Description","otter-blocks"),type:"text",value:t.description,onChange:e=>s(t.id,"description",e)})))},hl=e=>{let{initialOpen:t,markers:l,isPlaceAPIAvailable:a,addMarker:n,removeMarker:r,changeMarkerProp:s}=e;(0,i.useEffect)((()=>{!1!==t&&u(t)}),[t]);const[d,u]=(0,i.useState)(null),b=e=>{d===e&&(e=null),u(e)};return(0,i.createElement)(i.Fragment,null,(0,i.createElement)("div",{className:"wp-block-themeisle-blocks-google-map-marker-group"},l.map((e=>(0,i.createElement)(gl,{key:e.id,marker:e,isOpen:d,isPlaceAPIAvailable:a,openMarker:b,removeMarker:r,changeMarkerProp:s})))),(0,i.createElement)(c.Button,{isSecondary:!0,className:"wp-block-themeisle-blocks-google-map-marker-add",onClick:n},(0,o.__)("Add Marker","otter-blocks")))},vl=e=>{let{attributes:t,setAttributes:l,map:a,changeStyle:n,isPlaceAPIAvailable:r,isMarkerOpen:d,setMarkerOpen:u,removeMarker:b,changeMarkerProp:m,addMarkerManual:p,api:g,isSaving:h,changeAPI:v,saveAPIKey:y}=e;const[f,_]=(0,i.useState)("settings"),{responsiveSetAttributes:E,responsiveGetAttributes:x}=S(l),T=(0,i.useRef)(null);return(0,i.createElement)(s.InspectorControls,null,(0,i.createElement)(w.Z,{value:f,options:[{label:(0,o.__)("Settings","otter-blocks"),value:"settings"},{label:(0,o.__)("Style","otter-blocks"),value:"style"}],onChange:_}),"settings"===f&&(0,i.createElement)(i.Fragment,null,(0,i.createElement)(c.PanelBody,{title:(0,o.__)("Location","otter-blocks")},(0,i.createElement)(c.BaseControl,{label:(0,o.__)("Location"),id:"wp-block-themeisle-blocks-google-map-search"},(0,i.createElement)("input",{type:"text",id:"wp-block-themeisle-blocks-google-map-search",placeholder:(0,o.__)("Enter a location…","otter-blocks"),value:t.location,className:"wp-block-themeisle-blocks-google-map-search",ref:T,onFocus:()=>{const e=document.getElementsByClassName("pac-container");Object.keys(e).forEach((t=>e[t].remove()));const t=new window.google.maps.places.SearchBox(T.current);t.addListener("places_changed",(()=>{const e=t.getPlaces();e&&0<e.length&&e.forEach((e=>{const t=e.geometry.location.lat(),o=e.geometry.location.lng(),n=new window.google.maps.LatLng(t,o);a.setCenter(n),l({location:e.formatted_address||e.name,latitude:t.toString(),longitude:o.toString()})}))}))},onChange:e=>{l({location:e.target.value})},disabled:!r}),!r&&(0,i.createElement)("p",null,(0,o.__)("To enable locations earch, please ensure Places API is activated in the Google Developers Console.","otter-blocks")+" ",(0,i.createElement)(c.ExternalLink,{href:"https://developers.google.com/places/web-service/intro"},(0,o.__)("More info.","otter-blocks")))),(0,i.createElement)(c.TextControl,{label:(0,o.__)("Latitude","otter-blocks"),type:"text",placeholder:(0,o.__)("Enter latitude…","otter-blocks"),value:t.latitude,onChange:e=>{l({latitude:e.toString()});const o=Number(e),{longitude:n}=t,r=new window.google.maps.LatLng(o,n);a.setCenter(r)}}),(0,i.createElement)(c.TextControl,{label:(0,o.__)("Longitude","otter-blocks"),type:"text",placeholder:(0,o.__)("Enter longitude","otter-blocks"),value:t.longitude,onChange:e=>{l({longitude:e.toString()});const{latitude:o}=t,n=Number(e),r=new window.google.maps.LatLng(o,n);a.setCenter(r)}})),(0,i.createElement)(c.PanelBody,{title:(0,o.__)("Positioning & Zooming","otter-blocks"),initialOpen:!1},(0,i.createElement)(c.RangeControl,{label:(0,o.__)("Map Zoom Level","otter-blocks"),value:t.zoom,onChange:e=>{l({zoom:e}),a.setZoom(e)},min:0,max:20}),(0,i.createElement)(M.Z,{label:(0,o.__)("Height","otter-blocks")},(0,i.createElement)(c.__experimentalUnitControl,{value:x([(B=t.height,(0,K.isNumber)(B)?(e=>e?`${e}px`:e)(B):B),t.heightTablet,t.heightMobile]),onChange:e=>E(e,["height","heightTablet","heightMobile"])}),(0,i.createElement)(k.Z,{values:["height","heightTablet","heightMobile"],setAttributes:l}))),(0,i.createElement)(c.PanelBody,{title:(0,o.__)("Controls","otter-blocks"),initialOpen:!1},(0,i.createElement)(c.BaseControl,null,(0,o.__)("The following changes will not affect block preview during the editing process. You can click outside the block to see the changes take effect.","otter-blocks")),(0,i.createElement)(c.ToggleControl,{label:(0,o.__)("Draggable Map","otter-blocks"),checked:t.draggable,onChange:()=>{l({draggable:!t.draggable})}}),(0,i.createElement)(c.ToggleControl,{label:(0,o.__)("Map Type Control","otter-blocks"),checked:t.mapTypeControl,onChange:()=>{l({mapTypeControl:!t.mapTypeControl})}}),(0,i.createElement)(c.ToggleControl,{label:(0,o.__)("Zoom Control","otter-blocks"),checked:t.zoomControl,onChange:()=>{l({zoomControl:!t.zoomControl})}}),(0,i.createElement)(c.ToggleControl,{label:(0,o.__)("Full Screen Control","otter-blocks"),checked:t.fullscreenControl,onChange:()=>{l({fullscreenControl:!t.fullscreenControl})}}),(0,i.createElement)(c.ToggleControl,{label:(0,o.__)("Street View Control","otter-blocks"),checked:t.streetViewControl,onChange:()=>{l({streetViewControl:!t.streetViewControl})}})),(0,i.createElement)(c.PanelBody,{title:(0,o.__)("Markers","otter-blocks"),initialOpen:!1,opened:!1!==d||void 0,onToggle:()=>{!1!==d&&u(!0)}},(0,i.createElement)(hl,{markers:t.markers,removeMarker:b,changeMarkerProp:m,addMarker:p,isPlaceAPIAvailable:r,initialOpen:d})),(0,i.createElement)(c.PanelBody,{title:(0,o.__)("Global Settings","otter-blocks"),initialOpen:!1},(0,i.createElement)(c.TextControl,{label:(0,o.__)("Google Maps API Key","otter-blocks"),type:"text",placeholder:(0,o.__)("Google Maps API Key","otter-blocks"),value:g,className:"components-placeholder__input",onChange:v,help:(0,o.__)("Changing the API key effects all Google Map Embed blocks. You will have to refresh the page after changing your API keys.","otter-blocks")}),(0,i.createElement)(c.Button,{isSecondary:!0,type:"submit",onClick:y,isBusy:h},(0,o.__)("Save API Key","otter-blocks")))),"style"===f&&(0,i.createElement)(c.PanelBody,{title:(0,o.__)("Styles","otter-blocks")},(0,i.createElement)(bl.V,{value:t.style,options:[{label:(0,o.__)("Standard","otter-blocks"),value:"standard",image:window.themeisleGutenberg.assetsPath+"/icons/map-standard.png"},{label:(0,o.__)("Silver","otter-blocks"),value:"silver",image:window.themeisleGutenberg.assetsPath+"/icons/map-silver.png"},{label:(0,o.__)("Retro","otter-blocks"),value:"retro",image:window.themeisleGutenberg.assetsPath+"/icons/map-retro.png"},{label:(0,o.__)("Dark","otter-blocks"),value:"dark",image:window.themeisleGutenberg.assetsPath+"/icons/map-dark.png"},{label:(0,o.__)("Night","otter-blocks"),value:"night",image:window.themeisleGutenberg.assetsPath+"/icons/map-night.png"},{label:(0,o.__)("Aubergine","otter-blocks"),value:"aubergine",image:window.themeisleGutenberg.assetsPath+"/icons/map-aubergine.png"}],onChange:n}),(0,i.createElement)(c.SelectControl,{label:(0,o.__)("Map Type","otter-blocks"),value:t.type,options:[{label:(0,o.__)("Road Map","otter-blocks"),value:"roadmap"},{label:(0,o.__)("Satellite View","otter-blocks"),value:"satellite"},{label:(0,o.__)("Hybrid","otter-blocks"),value:"hybrid"},{label:(0,o.__)("Terrain","otter-blocks"),value:"terrain"}],onChange:e=>{l({type:e}),a.setMapTypeId(window.google.maps.MapTypeId[e.toUpperCase()])}})),(0,i.createElement)(C.p,null));var B},yl=e=>{let{marker:t,isAdvanced:l,isPlaceAPIAvailable:a,addMarker:n,close:r}=e;(0,i.useEffect)((()=>{u(t.id),m(t.location),g(t.title),v(t.icon),k(t.description),_(t.latitude),C(t.longitude)}),[t]);const s=(0,i.useRef)(null),[d,u]=(0,i.useState)(t.id),[b,m]=(0,i.useState)(t.location),[p,g]=(0,i.useState)(t.title),[h,v]=(0,i.useState)(t.icon),[y,k]=(0,i.useState)(t.description),[f,_]=(0,i.useState)(t.latitude),[w,C]=(0,i.useState)(t.longitude);return(0,i.createElement)(c.Modal,{title:(0,o.__)("Add Marker","otter-blocks"),onRequestClose:r,shouldCloseOnClickOutside:!1},l&&(0,i.createElement)(i.Fragment,null,(0,i.createElement)(c.BaseControl,{label:(0,o.__)("Location","otter-blocks"),id:`themeisle-location-search-${t.id}`},(0,i.createElement)("input",{type:"text",id:`themeisle-location-search-${d}`,placeholder:(0,o.__)("Enter a location…","otter-blocks"),value:b,className:"wp-block-themeisle-blocks-google-map-search",ref:s,onFocus:()=>{const e=document.getElementsByClassName("pac-container");Object.keys(e).forEach((t=>e[t].remove()));const t=new window.google.maps.places.SearchBox(s.current);t.addListener("places_changed",(()=>{const e=t.getPlaces();e&&0<e.length&&e.forEach((e=>{const t=e.formatted_address||e.name,l=e.geometry.location.lat(),o=e.geometry.location.lng();m(t),_(l),C(o)}))}))},onChange:e=>m(e.target.value),disabled:!a})),(0,i.createElement)(c.TextControl,{label:(0,o.__)("Latitude","otter-blocks"),type:"text",value:f,onChange:_}),(0,i.createElement)(c.TextControl,{label:(0,o.__)("Longitude","otter-blocks"),type:"text",value:w,onChange:C})),(0,i.createElement)(c.TextControl,{label:(0,o.__)("Title","otter-blocks"),type:"text",value:p,onChange:g}),(0,i.createElement)(pl,{label:(0,o.__)("Description","otter-blocks"),type:"text",value:y,onChange:k}),(0,i.createElement)(c.SelectControl,{label:(0,o.__)("Map Icon","otter-blocks"),value:h||"https://maps.google.com/mapfiles/ms/icons/red-dot.png",options:[{label:(0,o.__)("Red","otter-blocks"),value:"https://maps.google.com/mapfiles/ms/icons/red-dot.png"},{label:(0,o.__)("Blue","otter-blocks"),value:"https://maps.google.com/mapfiles/ms/icons/blue-dot.png"},{label:(0,o.__)("Yellow","otter-blocks"),value:"https://maps.google.com/mapfiles/ms/icons/yellow-dot.png"},{label:(0,o.__)("Green","otter-blocks"),value:"https://maps.google.com/mapfiles/ms/icons/green-dot.png"},{label:(0,o.__)("Orange","otter-blocks"),value:"https://maps.google.com/mapfiles/ms/icons/orange-dot.png"}],onChange:v}),(0,i.createElement)(c.ButtonGroup,null,(0,i.createElement)(c.Button,{isPrimary:!0,onClick:()=>n(b,p,h,y,f,w)},(0,o.__)("Add","otter-blocks")),(0,i.createElement)(c.Button,{isSecondary:!0,onClick:r},(0,o.__)("Cancel","otter-blocks"))))},kl=e=>{let{attributes:t,initMap:l,displayMap:a,isMapLoaded:n,selectMarker:r,isSelectingMarker:s}=e;(0,i.useEffect)((()=>{a&&l()}),[a]);const{responsiveGetAttributes:d}=S();return(0,i.createElement)(i.Fragment,null,(0,i.createElement)("div",{id:t.id,className:g()("wp-block-themeisle-blocks-google-map-container",{"is-selecting-marker":s}),style:{height:d([(u=t.height,(0,K.isNumber)(u)?(e=>e?`${e}px`:e)(u):u),t.heightTablet,t.heightMobile])}}),n&&(0,i.createElement)(c.Button,{className:"wp-block-themeisle-blocks-google-map-marker-button",title:(0,o.__)("Add Button","otter-blocks"),onClick:r},(0,i.createElement)("span",{className:"dashicons dashicons-sticky"})));var u},fl={standard:[],silver:[{elementType:"geometry",stylers:[{color:"#f5f5f5"}]},{elementType:"labels.icon",stylers:[{visibility:"off"}]},{elementType:"labels.text.fill",stylers:[{color:"#616161"}]},{elementType:"labels.text.stroke",stylers:[{color:"#f5f5f5"}]},{featureType:"administrative.land_parcel",elementType:"labels.text.fill",stylers:[{color:"#bdbdbd"}]},{featureType:"poi",elementType:"geometry",stylers:[{color:"#eeeeee"}]},{featureType:"poi",elementType:"labels.text.fill",stylers:[{color:"#757575"}]},{featureType:"poi.park",elementType:"geometry",stylers:[{color:"#e5e5e5"}]},{featureType:"poi.park",elementType:"labels.text.fill",stylers:[{color:"#9e9e9e"}]},{featureType:"road",elementType:"geometry",stylers:[{color:"#ffffff"}]},{featureType:"road.arterial",elementType:"labels.text.fill",stylers:[{color:"#757575"}]},{featureType:"road.highway",elementType:"geometry",stylers:[{color:"#dadada"}]},{featureType:"road.highway",elementType:"labels.text.fill",stylers:[{color:"#616161"}]},{featureType:"road.local",elementType:"labels.text.fill",stylers:[{color:"#9e9e9e"}]},{featureType:"transit.line",elementType:"geometry",stylers:[{color:"#e5e5e5"}]},{featureType:"transit.station",elementType:"geometry",stylers:[{color:"#eeeeee"}]},{featureType:"water",elementType:"geometry",stylers:[{color:"#c9c9c9"}]},{featureType:"water",elementType:"labels.text.fill",stylers:[{color:"#9e9e9e"}]}],retro:[{elementType:"geometry",stylers:[{color:"#ebe3cd"}]},{elementType:"labels.text.fill",stylers:[{color:"#523735"}]},{elementType:"labels.text.stroke",stylers:[{color:"#f5f1e6"}]},{featureType:"administrative",elementType:"geometry.stroke",stylers:[{color:"#c9b2a6"}]},{featureType:"administrative.land_parcel",elementType:"geometry.stroke",stylers:[{color:"#dcd2be"}]},{featureType:"administrative.land_parcel",elementType:"labels.text.fill",stylers:[{color:"#ae9e90"}]},{featureType:"landscape.natural",elementType:"geometry",stylers:[{color:"#dfd2ae"}]},{featureType:"poi",elementType:"geometry",stylers:[{color:"#dfd2ae"}]},{featureType:"poi",elementType:"labels.text.fill",stylers:[{color:"#93817c"}]},{featureType:"poi.park",elementType:"geometry.fill",stylers:[{color:"#a5b076"}]},{featureType:"poi.park",elementType:"labels.text.fill",stylers:[{color:"#447530"}]},{featureType:"road",elementType:"geometry",stylers:[{color:"#f5f1e6"}]},{featureType:"road.arterial",elementType:"geometry",stylers:[{color:"#fdfcf8"}]},{featureType:"road.highway",elementType:"geometry",stylers:[{color:"#f8c967"}]},{featureType:"road.highway",elementType:"geometry.stroke",stylers:[{color:"#e9bc62"}]},{featureType:"road.highway.controlled_access",elementType:"geometry",stylers:[{color:"#e98d58"}]},{featureType:"road.highway.controlled_access",elementType:"geometry.stroke",stylers:[{color:"#db8555"}]},{featureType:"road.local",elementType:"labels.text.fill",stylers:[{color:"#806b63"}]},{featureType:"transit.line",elementType:"geometry",stylers:[{color:"#dfd2ae"}]},{featureType:"transit.line",elementType:"labels.text.fill",stylers:[{color:"#8f7d77"}]},{featureType:"transit.line",elementType:"labels.text.stroke",stylers:[{color:"#ebe3cd"}]},{featureType:"transit.station",elementType:"geometry",stylers:[{color:"#dfd2ae"}]},{featureType:"water",elementType:"geometry.fill",stylers:[{color:"#b9d3c2"}]},{featureType:"water",elementType:"labels.text.fill",stylers:[{color:"#92998d"}]}],dark:[{elementType:"geometry",stylers:[{color:"#212121"}]},{elementType:"labels.icon",stylers:[{visibility:"off"}]},{elementType:"labels.text.fill",stylers:[{color:"#757575"}]},{elementType:"labels.text.stroke",stylers:[{color:"#212121"}]},{featureType:"administrative",elementType:"geometry",stylers:[{color:"#757575"}]},{featureType:"administrative.country",elementType:"labels.text.fill",stylers:[{color:"#9e9e9e"}]},{featureType:"administrative.land_parcel",stylers:[{visibility:"off"}]},{featureType:"administrative.locality",elementType:"labels.text.fill",stylers:[{color:"#bdbdbd"}]},{featureType:"poi",elementType:"labels.text.fill",stylers:[{color:"#757575"}]},{featureType:"poi.park",elementType:"geometry",stylers:[{color:"#181818"}]},{featureType:"poi.park",elementType:"labels.text.fill",stylers:[{color:"#616161"}]},{featureType:"poi.park",elementType:"labels.text.stroke",stylers:[{color:"#1b1b1b"}]},{featureType:"road",elementType:"geometry.fill",stylers:[{color:"#2c2c2c"}]},{featureType:"road",elementType:"labels.text.fill",stylers:[{color:"#8a8a8a"}]},{featureType:"road.arterial",elementType:"geometry",stylers:[{color:"#373737"}]},{featureType:"road.highway",elementType:"geometry",stylers:[{color:"#3c3c3c"}]},{featureType:"road.highway.controlled_access",elementType:"geometry",stylers:[{color:"#4e4e4e"}]},{featureType:"road.local",elementType:"labels.text.fill",stylers:[{color:"#616161"}]},{featureType:"transit",elementType:"labels.text.fill",stylers:[{color:"#757575"}]},{featureType:"water",elementType:"geometry",stylers:[{color:"#000000"}]},{featureType:"water",elementType:"labels.text.fill",stylers:[{color:"#3d3d3d"}]}],night:[{elementType:"geometry",stylers:[{color:"#242f3e"}]},{elementType:"labels.text.fill",stylers:[{color:"#746855"}]},{elementType:"labels.text.stroke",stylers:[{color:"#242f3e"}]},{featureType:"administrative.locality",elementType:"labels.text.fill",stylers:[{color:"#d59563"}]},{featureType:"poi",elementType:"labels.text.fill",stylers:[{color:"#d59563"}]},{featureType:"poi.park",elementType:"geometry",stylers:[{color:"#263c3f"}]},{featureType:"poi.park",elementType:"labels.text.fill",stylers:[{color:"#6b9a76"}]},{featureType:"road",elementType:"geometry",stylers:[{color:"#38414e"}]},{featureType:"road",elementType:"geometry.stroke",stylers:[{color:"#212a37"}]},{featureType:"road",elementType:"labels.text.fill",stylers:[{color:"#9ca5b3"}]},{featureType:"road.highway",elementType:"geometry",stylers:[{color:"#746855"}]},{featureType:"road.highway",elementType:"geometry.stroke",stylers:[{color:"#1f2835"}]},{featureType:"road.highway",elementType:"labels.text.fill",stylers:[{color:"#f3d19c"}]},{featureType:"transit",elementType:"geometry",stylers:[{color:"#2f3948"}]},{featureType:"transit.station",elementType:"labels.text.fill",stylers:[{color:"#d59563"}]},{featureType:"water",elementType:"geometry",stylers:[{color:"#17263c"}]},{featureType:"water",elementType:"labels.text.fill",stylers:[{color:"#515c6d"}]},{featureType:"water",elementType:"labels.text.stroke",stylers:[{color:"#17263c"}]}],aubergine:[{elementType:"geometry",stylers:[{color:"#1d2c4d"}]},{elementType:"labels.text.fill",stylers:[{color:"#8ec3b9"}]},{elementType:"labels.text.stroke",stylers:[{color:"#1a3646"}]},{featureType:"administrative.country",elementType:"geometry.stroke",stylers:[{color:"#4b6878"}]},{featureType:"administrative.land_parcel",elementType:"labels.text.fill",stylers:[{color:"#64779e"}]},{featureType:"administrative.province",elementType:"geometry.stroke",stylers:[{color:"#4b6878"}]},{featureType:"landscape.man_made",elementType:"geometry.stroke",stylers:[{color:"#334e87"}]},{featureType:"landscape.natural",elementType:"geometry",stylers:[{color:"#023e58"}]},{featureType:"poi",elementType:"geometry",stylers:[{color:"#283d6a"}]},{featureType:"poi",elementType:"labels.text.fill",stylers:[{color:"#6f9ba5"}]},{featureType:"poi",elementType:"labels.text.stroke",stylers:[{color:"#1d2c4d"}]},{featureType:"poi.park",elementType:"geometry.fill",stylers:[{color:"#023e58"}]},{featureType:"poi.park",elementType:"labels.text.fill",stylers:[{color:"#3C7680"}]},{featureType:"road",elementType:"geometry",stylers:[{color:"#304a7d"}]},{featureType:"road",elementType:"labels.text.fill",stylers:[{color:"#98a5be"}]},{featureType:"road",elementType:"labels.text.stroke",stylers:[{color:"#1d2c4d"}]},{featureType:"road.highway",elementType:"geometry",stylers:[{color:"#2c6675"}]},{featureType:"road.highway",elementType:"geometry.stroke",stylers:[{color:"#255763"}]},{featureType:"road.highway",elementType:"labels.text.fill",stylers:[{color:"#b0d5ce"}]},{featureType:"road.highway",elementType:"labels.text.stroke",stylers:[{color:"#023e58"}]},{featureType:"transit",elementType:"labels.text.fill",stylers:[{color:"#98a5be"}]},{featureType:"transit",elementType:"labels.text.stroke",stylers:[{color:"#1d2c4d"}]},{featureType:"transit.line",elementType:"geometry.fill",stylers:[{color:"#283d6a"}]},{featureType:"transit.station",elementType:"geometry",stylers:[{color:"#3a4762"}]},{featureType:"water",elementType:"geometry",stylers:[{color:"#0e1626"}]},{featureType:"water",elementType:"labels.text.fill",stylers:[{color:"#4e6d70"}]}]};const{attributes:_l}=cl;const wl={to:[{type:"block",blocks:["themeisle-blocks/leaflet-map"],transform:e=>{const t=(0,K.omit)(e,["style","mapTypeControl","fullscreenControl","streetViewControl"]);return(0,a.createBlock)("themeisle-blocks/leaflet-map",{...t})}}]};var Cl=wl;const{name:El}=cl;(0,a.registerBlockType)(El,{...cl,title:(0,o.__)("Google Maps","otter-blocks"),description:(0,o.__)("Display Google Maps on your website with Google Map block. Powered by Otter.","otter-blocks"),icon:r.mapIcon,keywords:["map","google","orbitfox"],transforms:Cl,edit:e=>{let{attributes:t,setAttributes:l,clientId:a,isSelected:n}=e;(0,i.useEffect)((()=>{const e=(0,L.blockInit)(a,_l);return()=>e(t.id)}),[t.id]),(0,i.useEffect)((()=>{let e=!0;return(async()=>{await window.wp.api.loadPromise.then((()=>{c.current=new window.wp.api.models.Settings})),!1===Boolean(window.themeisleGutenberg.mapsAPI)?v||c.current.fetch().then((t=>{e&&(h(t.themeisle_google_map_block_api_key),y(!0),""!==t.themeisle_google_map_block_api_key&&(f(!0),G(t.themeisle_google_map_block_api_key)))})):!v&&e&&(h(window.themeisleGutenberg.mapsAPI),y(!0),f(!0),G(window.themeisleGutenberg.mapsAPI))})(),window.isMapLoaded=window.isMapLoaded||!1,window[`removeMarker_${a.substr(0,8)}`]=j,window.gm_authFailure=function(){f(!1),D(!0)},d.current=document.createElement("script"),d.current.type="text/javascript",d.current.async=!0,d.current.defer=!0,d.current.id="themeisle-google-map-api-loading",()=>{e=!1}}),[]),(0,i.useEffect)((()=>{!1!==k&&void 0!==window.google&&u.current.setOptions({mapTypeControl:!!n||t.mapTypeControl,zoomControl:!!n||t.zoomControl,fullscreenControl:!!n||t.fullscreenControl,streetViewControl:!!n||t.streetViewControl})}),[n]),(0,i.useEffect)((()=>{m.current=[...t.markers]}),[t.markers]);const r=(0,i.useRef)([]),c=(0,i.useRef)(null),d=(0,i.useRef)(null),u=(0,i.useRef)(null),b=(0,i.useRef)(null),m=(0,i.useRef)([...t.markers]),[p,h]=(0,i.useState)(""),[v,y]=(0,i.useState)(!1),[k,f]=(0,i.useState)(!1),[_,w]=(0,i.useState)(!1),[C,E]=(0,i.useState)(!1),[x,S]=(0,i.useState)(!0),[T,M]=(0,i.useState)(!1),[B,z]=(0,i.useState)(!1),[P,R]=(0,i.useState)(!1),[F,A]=(0,i.useState)(!1),[H,O]=(0,i.useState)(!1),[N,V]=(0,i.useState)({}),[I,D]=(0,i.useState)(!1),G=e=>{window.isMapLoaded||(window.isMapLoaded=!0,d.current.onload=()=>{document.getElementById("themeisle-google-map-api-loading").id="themeisle-google-map-api",M(!0)},d.current.src=`https://maps.googleapis.com/maps/api/js?key=${e}&libraries=places&cache=${Math.random()}`,document.head.appendChild(d.current)),document.getElementById("themeisle-google-map-api")&&M(!0)},$=(e,t,l,n)=>{const r=`<div class="wp-block-themeisle-blocks-map-overview"><h6 class="wp-block-themeisle-blocks-map-overview-title">${l}</h6><div class="wp-block-themeisle-blocks-map-overview-content">${n?`<p>${n}</p>`:""}<a class="wp-block-themeisle-blocks-map-overview-delete" onclick="removeMarker_${a.substr(0,8)}( '${t}' )">${(0,o.__)("Delete Marker","otter-blocks")}</a></div></div>`,i=new window.google.maps.InfoWindow({content:r});e.addListener("click",(()=>{b.current=i,i.open(u.current,e)})),window.google.maps.event.addListener(i,"domready",(()=>{z(t)})),window.google.maps.event.addListener(i,"closeclick",(()=>{z(!1)}))},W=e=>{e.forEach((e=>{const{latitude:t}=e,{longitude:l}=e,o=new window.google.maps.LatLng(t,l),a=new window.google.maps.Marker({position:o,map:u.current,title:e.title,draggable:!0,icon:e.icon||"https://maps.google.com/mapfiles/ms/icons/red-dot.png"});window.google.maps.event.addListener(a,"dragend",(t=>{const l=t.latLng.lat(),o=t.latLng.lng();Z(e.id,"latitude",l),Z(e.id,"longitude",o)})),r.current.push(a),window.google.maps.event.addListener(a,"click",(()=>{b.current&&b.current.close()})),$(a,e.id,e.title,e.description)}))},Z=(e,t,o)=>{const a=[...m.current];a.find((t=>t.id===e))[t]=o.toString(),U(),W(a),l({markers:a})},j=e=>{let t=[...m.current];t=t.filter((t=>t.id!==e)),l({markers:t}),U(),z(!1),0<t.length&&W(t)},U=()=>{for(let e=0;e<r.current.length;e++)r.current[e].setMap(null);r.current=[]},q=()=>{!1===Boolean(window.themeisleGutenberg.mapsAPI)&&(E(!0),new window.wp.api.models.Settings({themeisle_google_map_block_api_key:p}).save().then((e=>{let t=!1;""!==e.themeisle_google_map_block_api_key&&(t=!0),E(!1),f(t),""!==e.themeisle_google_map_block_api_key&&(window.isMapLoaded=!1,G(e.themeisle_google_map_block_api_key))})))},J=e=>{l({style:e}),u.current.setOptions({styles:fl[e]})},K=(0,s.useBlockProps)({className:g()("wp-block-themeisle-blocks-google-map-resizer",{"is-focused":n})});return v&&k?(0,i.createElement)(i.Fragment,null,(0,i.createElement)(bl.d,{label:(0,o.__)("Block Styles","otter-blocks"),value:t.style,options:[{label:(0,o.__)("Standard","otter-blocks"),value:"standard",image:window.themeisleGutenberg.assetsPath+"/icons/map-standard.png"},{label:(0,o.__)("Silver","otter-blocks"),value:"silver",image:window.themeisleGutenberg.assetsPath+"/icons/map-silver.png"},{label:(0,o.__)("Retro","otter-blocks"),value:"retro",image:window.themeisleGutenberg.assetsPath+"/icons/map-retro.png"},{label:(0,o.__)("Dark","otter-blocks"),value:"dark",image:window.themeisleGutenberg.assetsPath+"/icons/map-dark.png"},{label:(0,o.__)("Night","otter-blocks"),value:"night",image:window.themeisleGutenberg.assetsPath+"/icons/map-night.png"},{label:(0,o.__)("Aubergine","otter-blocks"),value:"aubergine",image:window.themeisleGutenberg.assetsPath+"/icons/map-aubergine.png"}],onChange:J}),(0,i.createElement)(vl,{attributes:t,setAttributes:l,map:u.current,changeStyle:J,isPlaceAPIAvailable:x,isMarkerOpen:B,setMarkerOpen:z,removeMarker:j,changeMarkerProp:Z,addMarkerManual:()=>{const e=(0,dl.Z)(),t=(0,o.__)("Custom Marker","otter-blocks"),l=u.current.getCenter(),a=l.lat(),n=l.lng();A(!0),O(!0),V({id:e,location:"",title:t,icon:"https://maps.google.com/mapfiles/ms/icons/red-dot.png",description:"",latitude:a,longitude:n})},api:p,isSaving:C,changeAPI:h,saveAPIKey:q}),F&&(0,i.createElement)(yl,{marker:N,isAdvanced:H,isPlaceAPIAvailable:x,close:()=>A(!1),addMarker:(e,o,a,n,i,s)=>{const c=new window.google.maps.LatLng(i,s),d=(0,dl.Z)(),m=new window.google.maps.Marker({position:c,map:u.current,title:o,draggable:!0,icon:a});window.google.maps.event.addListener(m,"dragend",(e=>{const t=e.latLng.lat(),l=e.latLng.lng();Z(d,"latitude",t),Z(d,"longitude",l)})),r.current.push(m);const p=[...t.markers],g={id:d,location:e,title:o,icon:a,description:n,latitude:i,longitude:s};p.push(g),l({markers:p}),window.google.maps.event.addListener(m,"click",(()=>{b.current&&b.current.close()})),$(m,g.id,o,n),A(!1),R(!1)}}),(0,i.createElement)("div",K,(0,i.createElement)(kl,{attributes:t,initMap:()=>{var e,o,a;const n=null!==(e=null===(o=(0,L.getEditorIframe)())||void 0===o||null===(a=o.contentWindow)||void 0===a?void 0:a.document)&&void 0!==e?e:document;if(u.current=new window.google.maps.Map(n.getElementById(t.id),{center:{lat:Number(t.latitude)||41.4036299,lng:Number(t.longitude)||2.1743558000000576},gestureHandling:"cooperative",zoom:t.zoom,mapTypeId:t.type,styles:fl[t.style]}),t.location&&void 0===t.latitude&&void 0===t.longitude){const e={query:t.location,fields:["name","geometry"]};new window.google.maps.places.PlacesService(u.current).findPlaceFromQuery(e,((e,t)=>{t===window.google.maps.places.PlacesServiceStatus.OK&&0<e.length&&u.current.setCenter(e[0].geometry.location)}))}window.google.maps.event.addListenerOnce(u.current,"idle",(()=>{w(!0)})),u.current.addListener("zoom_changed",(()=>{const e=u.current.getZoom();l({zoom:e})})),u.current.addListener("maptypeid_changed",(()=>{const e=u.current.getMapTypeId();l({type:e})})),u.current.addListener("bounds_changed",(()=>{const e=u.current.getCenter(),t=e.lat(),o=e.lng();l({latitude:t.toString(),longitude:o.toString()})})),0<t.markers.length&&W(t.markers);const r={query:t.location,fields:["name","geometry"]};new window.google.maps.places.PlacesService(u.current).findPlaceFromQuery(r,((e,t)=>{"REQUEST_DENIED"===t&&S(!1)}))},displayMap:T,isMapLoaded:_,selectMarker:()=>{R(!P),P?window.google.maps.event.clearListeners(u.current,"click"):u.current.addListener("click",(e=>{window.google.maps.event.clearListeners(u.current,"click");const t=(0,dl.Z)(),l=(0,o.__)("Custom Marker","otter-blocks"),a=e.latLng.lat(),n=e.latLng.lng();A(!0),O(!1),V({id:t,location:"",title:l,icon:"https://maps.google.com/mapfiles/ms/icons/red-dot.png",description:"",latitude:a,longitude:n})}))},isSelectingMarker:P}))):(0,i.createElement)("div",K,(0,i.createElement)(ul,{api:p,error:I,isAPILoaded:v,isAPISaved:k,isSaving:C,changeAPI:e=>{h(e),D(!1)},saveAPIKey:q}))},save:()=>null});var xl=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"themeisle-blocks/icon-list","title":"Icon List","category":"themeisle-blocks","description":"Display an icon list in a beautiful layout. Powered by Otter.","keywords":["icon","list","items"],"textdomain":"otter-blocks","attributes":{"id":{"type":"string"},"defaultLibrary":{"type":"string","default":"fontawesome"},"defaultPrefix":{"type":"string","default":"fas"},"defaultIcon":{"type":"string","default":"angle-right"},"defaultContentColor":{"type":"string"},"defaultIconColor":{"type":"string"},"defaultSize":{"type":["number","string"]},"defaultIconSize":{"type":"string"},"gap":{"type":["number","string"]},"gapIconLabel":{"type":["string"]},"horizontalAlign":{"type":"string"},"alignmentTablet":{"type":"string"},"alignmentMobile":{"type":"string"},"hideLabels":{"type":"boolean"},"hasDivider":{"type":"boolean"},"dividerWidth":{"type":"string"},"dividerColor":{"type":"string"},"dividerLength":{"type":"string"}},"editorStyle":"otter-icon-list-editor","style":"otter-icon-list-style"}'),Sl=e=>{let{attributes:t,setAttributes:l}=e;return(0,i.createElement)(s.BlockControls,null,(0,i.createElement)(s.AlignmentToolbar,{value:{"flex-start":"left",center:"center","flex-end":"right"}[t.horizontalAlign],onChange:e=>{switch(e){case"left":l({horizontalAlign:"flex-start"});break;case"center":l({horizontalAlign:"center"});break;case"right":l({horizontalAlign:"flex-end"});break;default:l({horizontalAlign:void 0})}}}))},Tl=e=>{var t,l,a,n,r,d,u,b,m;let{attributes:p,setAttributes:g}=e;const[h,v]=(0,i.useState)("settings"),{responsiveSetAttributes:y,responsiveGetAttributes:k}=S(g);return(0,i.createElement)(s.InspectorControls,null,(0,i.createElement)("div",null,(0,i.createElement)(w.Z,{value:h,options:[{label:(0,o.__)("Settings","otter-blocks"),value:"settings"},{label:(0,o.__)("Style","otter-blocks"),value:"style"}],onChange:v}),"settings"===h&&(0,i.createElement)(i.Fragment,null,(0,i.createElement)(c.PanelBody,{title:(0,o.__)("Layout","otter-blocks")},(0,i.createElement)(E.Z,{label:(0,o.__)("List Orientation","otter-blocks"),options:[{label:(0,o.__)("Vertical","otter-blocks"),value:"default"},{label:(0,o.__)("Horizontal","otter-blocks"),value:"is-style-horizontal"}],value:null!=p&&null!==(t=p.className)&&void 0!==t&&t.includes("is-style-horizontal")?"is-style-horizontal":"default",onChange:e=>{var t;const l=(null==p||null===(t=p.className)||void 0===t?void 0:t.split(" "))||[];"default"===e&&l.includes("is-style-horizontal")?l.splice(l.indexOf("is-style-horizontal"),1):"is-style-horizontal"!==e||l.includes("is-style-horizontal")||l.push("is-style-horizontal"),g({className:l.join(" ")})}}),(0,i.createElement)(M.Z,{label:(0,o.__)("Alignment","otter-blocks")},(0,i.createElement)(pe.Z,{value:null!==(l=k([p.horizontalAlign,p.alignmentTablet,p.alignmentMobile]))&&void 0!==l?l:"flex-start",onChange:e=>{y(e,["horizontalAlign","alignmentTablet","alignmentMobile"])},options:[{icon:bt.Z,label:(0,o.__)("Left","otter-blocks"),value:"flex-start"},{icon:mt.Z,label:(0,o.__)("Center","otter-blocks"),value:"center"},{icon:pt.Z,label:(0,o.__)("Right","otter-blocks"),value:"flex-end"}],hasIcon:!0})),(0,i.createElement)(c.ToggleControl,{label:(0,o.__)("Hide Labels","otter-blocks"),checked:Boolean(p.hideLabels),onChange:()=>g({hideLabels:!p.hideLabels})})),(0,i.createElement)(c.PanelBody,{title:(0,o.__)("Icons","otter-blocks")},(0,i.createElement)(i.Suspense,{fallback:(0,i.createElement)(c.Placeholder,null,(0,i.createElement)(c.Spinner,null))},(0,i.createElement)(_.Z,{label:(0,o.__)("Icon Picker","otter-blocks"),library:p.defaultLibrary,prefix:p.defaultPrefix,icon:p.defaultIcon,changeLibrary:e=>{g({defaultLibrary:e,defaultIcon:void 0,defaultPrefix:"fas"})},onChange:e=>{if("image"===p.defaultLibrary&&null!=e&&e.url)return g({defaultIcon:e.url});g("object"==typeof e?{defaultIcon:e.name,defaultPrefix:e.prefix}:{defaultIcon:e})},allowImage:!0})))),"style"===h&&(0,i.createElement)(i.Fragment,null,(0,i.createElement)(s.PanelColorSettings,{title:(0,o.__)("Color","otter-blocks"),initialOpen:!0,colorSettings:[{value:p.defaultIconColor,onChange:e=>g({defaultIconColor:e}),label:(0,o.__)("Icon","otter-blocks")},{value:p.defaultContentColor,onChange:e=>g({defaultContentColor:e}),label:(0,o.__)("Text","otter-blocks")},...p.hasDivider?[{value:p.dividerColor,onChange:e=>g({dividerColor:e}),label:(0,o.__)("Divider","otter-blocks")}]:[]]}),(0,i.createElement)(c.PanelBody,{title:(0,o.__)("Size","otter-blocks")},(0,i.createElement)(c.BaseControl,{label:(0,o.__)("Font Size","otter-blocks"),__nextHasNoMarginBottom:!0},(0,i.createElement)(c.FontSizePicker,{value:null!==(a=(0,x.Yj)(p.defaultSize))&&void 0!==a?a:"16px",onChange:e=>g({defaultSize:e}),fontSizes:[{name:"Small",size:"12px",slug:"small"},{name:"Normal",size:"16px",slug:"Normal"},{name:"Medium",size:"20px",slug:"medium"},{name:"Large",size:"36px",slug:"large"}],withReset:!0})),(0,i.createElement)(c.BaseControl,{label:(0,o.__)("Icon Size","otter-blocks"),__nextHasNoMarginBottom:!0},(0,i.createElement)(c.FontSizePicker,{value:null!==(n=null!==(r=p.defaultIconSize)&&void 0!==r?r:(0,x.Yj)(p.defaultSize))&&void 0!==n?n:"16px",onChange:e=>g({defaultIconSize:e}),fontSizes:[{name:"Small",size:"12px",slug:"small"},{name:"Normal",size:"16px",slug:"Normal"},{name:"Medium",size:"20px",slug:"medium"},{name:"Large",size:"36px",slug:"large"}],withReset:!0}))),(0,i.createElement)(c.PanelBody,{title:(0,o.__)("Dimensions","otter-blocks")},(0,i.createElement)(c.__experimentalUnitControl,{label:(0,o.__)("Space between List items","otter-blocks"),value:null!==(d=p.gap)&&void 0!==d?d:"5px",onChange:e=>g({gap:e}),units:[{a11yLabel:"Pixels (px)",label:"px",step:1,value:"px"}]}),(0,i.createElement)("br",null),(0,i.createElement)(c.__experimentalUnitControl,{label:(0,o.__)("Space between Icon and Label","otter-blocks"),value:null!==(u=p.gapIconLabel)&&void 0!==u?u:"16px",onChange:e=>g({gapIconLabel:e}),units:[{a11yLabel:"Pixels (px)",label:"px",step:1,value:"px"}]})),(0,i.createElement)(c.PanelBody,{title:(0,o.__)("Divider","otter-blocks")},(0,i.createElement)(c.ToggleControl,{label:(0,o.__)("Enable Divider","otter-blocks"),checked:Boolean(p.hasDivider),onChange:()=>g({hasDivider:!p.hasDivider})}),p.hasDivider&&(0,i.createElement)(i.Fragment,null,(0,i.createElement)(c.__experimentalUnitControl,{label:(0,o.__)("Width","otter-blocks"),value:null!==(b=p.dividerWidth)&&void 0!==b?b:"2px",onChange:e=>g({dividerWidth:e}),units:[{a11yLabel:"Pixels (px)",label:"px",step:1,value:"px"}],max:5}),(0,i.createElement)("br",null),(0,i.createElement)(c.__experimentalUnitControl,{label:(0,o.__)("Length","otter-blocks"),value:null!==(m=p.dividerLength)&&void 0!==m?m:"100%",onChange:e=>g({dividerLength:e}),isResetValueOnUnitChange:!0}))))))};const{attributes:Ml}=xl;var Bl=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"themeisle-blocks/icon-list-item","title":"Icon List Item","category":"themeisle-blocks","description":"Display an item for the icon list. Powered by Otter.","keywords":["icon","list","items"],"parent":["themeisle-blocks/icon-list"],"textdomain":"otter-blocks","attributes":{"id":{"type":"string"},"content":{"type":"string"},"contentColor":{"type":"string"},"iconColor":{"type":"string"},"library":{"type":"string"},"iconPrefix":{"type":"string"},"icon":{"type":"string"}}}'),zl=e=>{let{attributes:t,setAttributes:l}=e;return(0,i.createElement)(s.InspectorControls,null,(0,i.createElement)(c.PanelBody,{title:(0,o.__)("Settings","otter-blocks")},(0,i.createElement)(_.Z,{label:(0,o.__)("Icon Picker","otter-blocks"),library:t.library,prefix:t.iconPrefix,icon:t.icon,changeLibrary:e=>{l({library:e,icon:void 0,iconPrefix:"fab"})},onChange:e=>{if("image"===t.library&&null!=e&&e.url)return l({icon:e.url});l("object"==typeof e?{icon:e.name,iconPrefix:e.prefix}:{icon:e})},allowImage:!0})),(0,i.createElement)(s.PanelColorSettings,{title:(0,o.__)("Color","otter-blocks"),initialOpen:!0,colorSettings:[{value:t.contentColor,onChange:e=>l({contentColor:e}),label:(0,o.__)("Content Color","otter-blocks")},..."image"!==t.library?[{value:t.iconColor,onChange:e=>l({iconColor:e}),label:(0,o.__)("Icon Color","otter-blocks")}]:[]]}))};const{attributes:Pl}=Bl;const{name:Ll}=Bl;(0,a.registerBlockType)(Ll,{...Bl,title:(0,o.__)("Icon List Item","otter-blocks"),description:(0,o.__)("Display an item for the icon list. Powered by Otter.","otter-blocks"),icon:r.faIcon,keywords:["item","icon","list"],merge(e,t){return{content:(e.content||"")+(t.content||"")}},edit:e=>{var t,l;let{attributes:n,setAttributes:r,name:c,clientId:d,onReplace:u,onRemove:b,mergeBlocks:m}=e;const[p,h]=(0,i.useState)(!1),{hasParent:y,parentAttributes:k}=(0,v.useSelect)((e=>{const{getBlock:t,getBlockRootClientId:l}=e("core/block-editor"),o=t(l(d));return{hasParent:!!o,parentAttributes:o?o.attributes:{}}}),[]);(0,i.useEffect)((()=>{const e=(0,L.blockInit)(d,Pl);return()=>e(n.id)}),[n.id]),(0,i.useEffect)((()=>{r({library:n.library||k.defaultLibrary,icon:n.icon||k.defaultIcon,iconPrefix:n.iconPrefix||k.defaultPrefix})}),[y,k,n]),(0,i.useEffect)((()=>{if("image"===n.library)try{const e=new URL(n.icon);"http:"!==(null==e?void 0:e.protocol)&&"https:"!==(null==e?void 0:e.protocol)||h(!0)}catch(e){h(!1)}}),[n.library,n.icon]);const f=we.ZP.icons[n.icon],_=`${n.iconPrefix||k.defaultPrefix} fa-${n.icon||k.defaultIcon}`,w={"--content-color":null!==(t=n.contentColor)&&void 0!==t?t:k.defaultContentColor,"--icon-color":null!==(l=n.iconColor)&&void 0!==l?l:k.defaultIconColor},C=(0,s.useBlockProps)({style:w});return(0,i.createElement)(i.Fragment,null,(0,i.createElement)(zl,{attributes:n,setAttributes:r}),(0,i.createElement)("div",C,"image"===n.library&&p?(0,i.createElement)("img",{src:n.icon}):"themeisle-icons"===n.library&&n.icon&&void 0!==f?(0,i.createElement)(f,{className:g()({"wp-block-themeisle-blocks-icon-list-item-icon":!n.iconColor},{"wp-block-themeisle-blocks-icon-list-item-icon-custom":n.iconColor})}):(0,i.createElement)("i",{className:g()(_,{"wp-block-themeisle-blocks-icon-list-item-icon":!n.iconColor},{"wp-block-themeisle-blocks-icon-list-item-icon-custom":n.iconColor})}),(0,i.createElement)(s.RichText,{identifier:"content",tagName:"p",placeholder:(0,o.__)("Write your content…","otter-blocks"),className:g()({"wp-block-themeisle-blocks-icon-list-item-content":!n.contentColor},{"wp-block-themeisle-blocks-icon-list-item-content-custom":n.contentColor}),value:n.content,onChange:e=>{r({content:e})},onSplit:e=>e?(0,a.createBlock)(c,{...n,content:e}):(0,a.createBlock)(c),onMerge:m,onReplace:u,onRemove:b})))},save:e=>{let{attributes:t}=e;const l=`${t.iconPrefix} fa-${t.icon}`,o=we.ZP.icons[t.icon],a=s.useBlockProps.save({id:t.id});return(0,i.createElement)("div",a,"image"===t.library&&t.icon?(0,i.createElement)("img",{src:t.icon}):"themeisle-icons"===t.library&&t.icon?(0,i.createElement)(o,{className:g()({"wp-block-themeisle-blocks-icon-list-item-icon":!t.iconColor},{"wp-block-themeisle-blocks-icon-list-item-icon-custom":t.iconColor})}):(0,i.createElement)("i",{className:g()(l,{"wp-block-themeisle-blocks-icon-list-item-icon":!t.iconColor},{"wp-block-themeisle-blocks-icon-list-item-icon-custom":t.iconColor})}),(0,i.createElement)(s.RichText.Content,{tagName:"p",className:g()({"wp-block-themeisle-blocks-icon-list-item-content":!t.contentColor},{"wp-block-themeisle-blocks-icon-list-item-content-custom":t.contentColor}),value:t.content}))}});const{name:Rl}=xl;(0,a.registerBlockType)(Rl,{...xl,title:(0,o.__)("Icon List","otter-blocks"),description:(0,o.__)("Display an icon list in a beautiful layout. Powered by Otter.","otter-blocks"),icon:r.faIcon,keywords:["icon","list","items"],edit:e=>{let{attributes:t,setAttributes:l,clientId:o,className:a}=e;(0,i.useEffect)((()=>{const e=(0,L.blockInit)(o,Ml);return()=>e(t.id)}),[t.id]);const{responsiveGetAttributes:n}=S(l),r={"--icon-align":n([t.horizontalAlign,t.alignmentTablet,t.alignmentMobile]),"--icon-align-tablet":t.alignmentTablet,"--icon-align-mobile":t.alignmentMobile,"--gap":(0,x.Yj)(t.gap),"--gap-icon-label":t.gapIconLabel,"--font-size":(0,x.Yj)(t.defaultSize),"--icon-size":t.defaultIconSize,"--label-visibility":t.hideLabels?"none":void 0,"--divider-color":t.dividerColor,"--divider-width":t.dividerWidth,"--divider-length":t.dividerLength,"--divider-margin-left":t.horizontalAlign?"auto":void 0,"--divider-margin-right":"flex-end"===t.horizontalAlign?"0":void 0,"--divider-margin-left-tablet":t.alignmentTablet?"auto":void 0,"--divider-margin-right-tablet":"flex-end"===t.alignmentTablet?"0":void 0,"--divider-margin-left-mobile":t.alignmentMobile?"auto":void 0,"--divider-margin-right-mobile":"flex-end"===t.alignmentMobile?"0":void 0},c=(0,s.useBlockProps)({id:t.id,style:r,className:g()(a,{"has-divider":Boolean(t.hasDivider)})});return(0,i.createElement)(i.Fragment,null,(0,i.createElement)(Sl,{attributes:t,setAttributes:l}),(0,i.createElement)(Tl,{attributes:t,setAttributes:l}),(0,i.createElement)("div",c,(0,i.createElement)(s.InnerBlocks,{allowedBlocks:["themeisle-blocks/icon-list-item"],__experimentalMoverDirection:"vertical",orientation:"vertical",template:[["themeisle-blocks/icon-list-item"]],renderAppender:s.InnerBlocks.DefaultAppender})))},save:e=>{let{attributes:t,className:l}=e;const o=s.useBlockProps.save({id:t.id,className:g()(l,{"has-divider":Boolean(t.hasDivider)})});return(0,i.createElement)("div",o,(0,i.createElement)(s.InnerBlocks.Content,null))},example:{innerBlocks:[{name:"themeisle-blocks/icon-list-item",attributes:{content:(0,o.__)("List Item 1","otter-blocks")}},{name:"themeisle-blocks/icon-list-item",attributes:{content:(0,o.__)("List Item 2","otter-blocks")}},{name:"themeisle-blocks/icon-list-item",attributes:{content:(0,o.__)("List Item 3","otter-blocks")}}]}});var Fl=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"themeisle-blocks/leaflet-map","title":"Maps","category":"themeisle-blocks","description":"Display Open Street Maps on your website with Maps block. Powered by Otter.","keywords":["map","opeenstreetmap","location"],"textdomain":"otter-blocks","attributes":{"id":{"type":"string"},"location":{"type":"string","default":"La Sagrada Familia, Barcelona, Spain"},"latitude":{"type":"string","default":"41.4034789"},"longitude":{"type":"string","default":"2.174410333009705"},"bbox":{"type":"string","default":"2.1207046508789067%2C41.34807736149302%2C2.2288513183593754%2C41.45816618938139"},"zoom":{"type":"number"},"height":{"type":["number","string"],"default":"400px"},"heightTablet":{"type":"string"},"heightMobile":{"type":"string"},"markers":{"type":"array","default":[]},"zoomControl":{"type":"boolean","default":true},"draggable":{"type":"boolean","default":true}},"supports":{"align":["wide","full"],"html":false},"editorStyle":"otter-leaflet-map-editor","style":"otter-leaflet-map-style","editorScript":"leaflet-gesture-handling","script":"otter-leaflet"}');async function Al(e){const t=await async function(e){if("string"!=typeof e)throw(0,o.__)("Location must be a string","otter-blocks");const t="https://nominatim.openstreetmap.org/search?q="+e.split(" ").map((e=>encodeURIComponent(e))).join("+")+"&format=geojson",l=await fetch(t);return l.ok&&200===l.status?l.json():console.warn((0,o.__)("An error has occured: ","otter-blocks")+l.status)}(e);if(null!=t&&t.features.length){var l;const e=t.features[0];if(null!=e&&null!==(l=e.geometry)&&void 0!==l&&l.coordinates.length)return{longitude:e.geometry.coordinates[0],latitude:e.geometry.coordinates[1]}}return null}const Hl=e=>{let{value:t,onChange:l}=e;const a=(0,Y.useInstanceId)(Hl);(0,i.useEffect)((()=>{wp.oldEditor.initialize(r.current.id,{tinymce:{classic_block_editor:!0,plugins:"lists,media,paste,tabfocus,wordpress,wpautoresize,wpeditimage,wpgallery,wplink,wpdialogs,wptextpattern,wpview",toolbar1:"formatselect,bold,italic,bullist,numlist,alignleft,aligncenter,alignright,link,unlink,spellchecker,wp_add_media"}});const e=window.tinymce.get(r.current.id);return e.on("change",(()=>l(e.getContent()))),()=>wp.oldEditor.remove(r.current.id)}),[]);const n=`inspector-textarea-control-${a}`,r=(0,i.useRef)(null);return(0,i.createElement)(c.BaseControl,{id:n,label:(0,o.__)("Description","otter-blocks")},(0,i.createElement)("textarea",{id:n,className:"components-textarea-control__input",rows:4,value:t,onChange:e=>l(e.target.value),ref:r}))};var Ol=Hl,Nl=e=>{let{marker:t,isOpen:l,openMarker:a,dispatch:n}=e;const[r,s]=(0,i.useState)(t.location),[d,u]=(0,i.useState)(t.longitude),[b,m]=(0,i.useState)(t.latitude),[p,h]=(0,i.useState)(t.title),[v,y]=(0,i.useState)(t.description),[k,f]=(0,i.useState)({target:"",reason:""});return(0,i.createElement)("div",{className:"wp-block-themeisle-blocks-leaflet-map-marker"},(0,i.createElement)("div",{className:"wp-block-themeisle-blocks-leaflet-map-marker-title-area"},(0,i.createElement)(c.Button,{className:"wp-block-themeisle-blocks-leaflet-map-marker-title",onClick:()=>a()},t.title||(0,o.__)("Custom Marker","otter-blocks")),(0,i.createElement)(c.Button,{icon:"no-alt",label:(0,o.__)("Remove Marker","otter-blocks"),showTooltip:!0,className:"wp-block-themeisle-blocks-leaflet-map-marker-remove",onClick:()=>n({type:Gl.REMOVE,ids:[t.id]})})),l&&(0,i.createElement)("div",{className:"wp-block-themeisle-blocks-leaflet-map-marker-control-area"},(0,i.createElement)(c.TextControl,{label:(0,o.__)("Location","otter-blocks"),type:"text",className:g()({"wp-block-themeisle-blocks-leaflet-map-input-error":"LOCATION"===k.target}),value:r,onChange:e=>{s(e)},help:(0,o.__)("Press Enter to search the location","otter-blocks"),onKeyDown:e=>((e,l)=>{e.key===l&&(async()=>{const e=await Al(r);e?(n({type:Gl.UPDATE,ids:[t.id],updatedProps:{location:r,latitude:e.latitude,longitude:e.longitude}}),m(e.latitude),u(e.longitude),"LOCATION"===k.target&&f({})):f({target:"LOCATION",reason:(0,o.__)("Location couldn't been found!","otter-blocks")})})()})(e,"Enter")}),(0,i.createElement)(c.TextControl,{label:(0,o.__)("Latitude","otter-blocks"),type:"text",value:b,onChange:e=>{m(e),n({type:Gl.UPDATE,ids:[t.id],updatedProps:{latitude:e}})}}),(0,i.createElement)(c.TextControl,{label:(0,o.__)("Longitude","otter-blocks"),type:"text",value:d,onChange:e=>{u(e),n({type:Gl.UPDATE,ids:[t.id],updatedProps:{longitude:e}})}}),(0,i.createElement)(c.TextControl,{label:(0,o.__)("Title","otter-blocks"),type:"text",value:p,onChange:e=>{h(e),n({type:Gl.UPDATE,ids:[t.id],updatedProps:{title:e}})}}),(0,i.createElement)(Ol,{label:(0,o.__)("Description","otter-blocks"),type:"text",value:t.description,onChange:e=>{y(v),n({type:Gl.UPDATE,ids:[t.id],updatedProps:{description:e}})}})))},Vl=e=>{let{markers:t,dispatch:l,markersInteraction:a}=e;const{openMarker:n,setOpenMarker:r}=a;return(0,i.createElement)(i.Fragment,null,(0,i.createElement)("div",{className:"wp-block-themeisle-blocks-leaflet-map-marker-group"},t.map((e=>(0,i.createElement)(Nl,{key:e.id,marker:e,isOpen:n===e.id,openMarker:()=>r(a.openMarker!==e.id?e.id:null),dispatch:l})))),(0,i.createElement)(c.Button,{isSecondary:!0,className:"wp-block-themeisle-blocks-leaflet-map-marker-add",onClick:()=>{l({type:Gl.ADD,marker:{id:(0,dl.Z)()},dispatch:l})}},(0,o.__)("Add Marker","otter-blocks")))},Il=e=>{let{attributes:t,setAttributes:l,dispatch:a,markersInteraction:n}=e;const[r,d]=(0,i.useState)(t.location),[u,b]=(0,i.useState)({target:"",reason:""}),{responsiveSetAttributes:m,responsiveGetAttributes:p}=S(l);return(0,i.createElement)(s.InspectorControls,null,(0,i.createElement)(c.PanelBody,{title:(0,o.__)("Location","otter-blocks")},(0,i.createElement)(c.TextControl,{label:(0,o.__)("Location","otter-blocks"),type:"text",className:g()({"wp-block-themeisle-blocks-leaflet-map-input-error":"LOCATION"===u.target}),placeholder:(0,o.__)("Enter location. E.g: La Sagrada Familia, Barcelona, Spain","otter-blocks"),help:(0,o.__)("Press Enter to search the location","otter-blocks"),value:r,onChange:d,onKeyDown:e=>((e,t)=>{e.key===t&&(async()=>{l({location:r});const e=await Al(r);e?(l({latitude:e.latitude.toString(),longitude:e.longitude.toString()}),"LOCATION"===u.target&&b({})):b({target:"LOCATION",reason:(0,o.__)("Location couldn't been found!","otter-blocks")})})()})(e,"Enter")}),(0,i.createElement)(c.TextControl,{label:(0,o.__)("Latitude","otter-blocks"),type:"text",placeholder:(0,o.__)("Enter latitude…","otter-blocks"),value:t.latitude,onChange:e=>{l({latitude:e.toString()})}}),(0,i.createElement)(c.TextControl,{label:(0,o.__)("Longitude","otter-blocks"),type:"text",placeholder:(0,o.__)("Enter longitude","otter-blocks"),value:t.longitude,onChange:e=>{l({longitude:e.toString()})}})),(0,i.createElement)(c.PanelBody,{title:(0,o.__)("Positioning & Zooming","otter-blocks"),initialOpen:!1},(0,i.createElement)(c.RangeControl,{label:(0,o.__)("Map Zoom Level","otter-blocks"),value:t.zoom,onChange:e=>{l({zoom:e})},min:0,max:20}),(0,i.createElement)(M.Z,{label:(0,o.__)("Height","otter-blocks")},(0,i.createElement)(c.__experimentalUnitControl,{value:p([(h=t.height,(0,K.isNumber)(h)?(e=>e?`${e}px`:e)(h):h),t.heightTablet,t.heightMobile]),onChange:e=>m(e,["height","heightTablet","heightMobile"])}),(0,i.createElement)(k.Z,{values:["height","heightTablet","heightMobile"],setAttributes:l}))),(0,i.createElement)(c.PanelBody,{title:(0,o.__)("Controls","otter-blocks"),initialOpen:!1},(0,i.createElement)(c.BaseControl,null,(0,o.__)("The following changes will not affect block preview during the editing process. You can click outside the block to see the changes take effect.","otter-blocks")),(0,i.createElement)(c.ToggleControl,{label:(0,o.__)("Draggable Map","otter-blocks"),checked:t.draggable,onChange:()=>{l({draggable:!t.draggable})}}),(0,i.createElement)(c.ToggleControl,{label:(0,o.__)("Zoom Control","otter-blocks"),checked:t.zoomControl,onChange:()=>{l({zoomControl:!t.zoomControl})}})),(0,i.createElement)(c.PanelBody,{title:(0,o.__)("Markers","otter-blocks"),initialOpen:!1},(0,i.createElement)(Vl,{markers:t.markers,dispatch:a,markersInteraction:n})));var h};const{attributes:Dl}=Fl,Gl={ADD:"ADD",ADD_MANUAL:"ADD_MANUAL",REMOVE:"REMOVE",UPDATE:"UPDATE",INIT:"INIT"};const $l={to:[{type:"block",blocks:["themeisle-blocks/google-map"],transform:e=>{const t=e;return(0,a.createBlock)("themeisle-blocks/google-map",{...t})}}]};var Wl=$l;const{name:Zl}=Fl;(0,a.registerBlockType)(Zl,{...Fl,title:(0,o.__)("Maps","otter-blocks"),description:(0,o.__)("Display Open Street Maps on your website with Maps block. Powered by Otter.","otter-blocks"),icon:r.mapIcon,keywords:["map","opeenstreetmap","location"],transforms:Wl,edit:e=>{let{clientId:t,attributes:l,setAttributes:a}=e;(0,i.useEffect)((()=>{const e=(0,L.blockInit)(t,Dl);return()=>e(l.id)}),[l.id]);const{responsiveGetAttributes:n}=S(),r=(0,i.useRef)(null),[c,d]=(0,i.useState)(null),[u,b]=(0,i.useState)(!1),[m,p]=(0,i.useState)(null),g=(e,t)=>{if(window.L&&c&&t&&e){var l,a,n,r,i;null!==(l=e.id)&&void 0!==l||(e.id=(0,dl.Z)()),null!==(a=e.latitude)&&void 0!==a||(e.latitude=c.getCenter().lat),null!==(n=e.longitude)&&void 0!==n||(e.longitude=c.getCenter().lng),null!==(r=e.title)&&void 0!==r||(e.title=(0,o.__)("Add a title","otter-blocks")),null!==(i=e.description)&&void 0!==i||(e.description="");const s=window.L.marker([e.latitude,e.longitude]||0,{draggable:!0});return s.on("movestart",(()=>{s.closeTooltip(),s.closePopup()})),s.on("moveend",(()=>{const l=s.getLatLng();t({type:Gl.UPDATE,ids:[e.id],updatedProps:{latitude:l.lat,longitude:l.lng}})})),s.on("click",(()=>{p(e.id)})),s.markerProps=e,s}return null},[h,v]=(0,i.useReducer)(((e,t)=>{switch(t.type){case Gl.ADD:const l=g(t.marker,t.dispatch);return[...e,l];case Gl.ADD_MANUAL:if(u){const l=g(t.marker,t.dispatch);return[...e,l]}return e;case Gl.REMOVE:return e.filter((e=>{let{markerProps:l}=e;return t.ids.includes(l.id)})).forEach((e=>{c.hasLayer(e)&&c.removeLayer(e)})),e.filter((e=>{let{markerProps:l}=e;return!t.ids.includes(l.id)}));case Gl.INIT:const a=t.markers.map((e=>g(e,t.dispatch)));return[...e,...a];case Gl.UPDATE:return e.map((e=>{const l=e.markerProps;return t.ids.includes(l.id)&&(e.markerProps=(0,K.merge)(e.markerProps,t.updatedProps)),e}));default:console.warn((0,o.__)("The action for the leaflet block do not have a defined action in marker's reducer: ","otter-blocks")+t.type)}return e}),[],(()=>[])),y=()=>{if(!r.current&&!window.L)return;let{L:e}=window;const t=(0,L.getEditorIframe)();var n;if(Boolean(t)&&(e=null===(n=t.contentWindow)||void 0===n?void 0:n.L),!e)return;r.current.innerHTML="";const i=e.map(r.current,{gestureHandling:!0,gestureHandlingOptions:{text:{touch:(0,o.__)("Use two fingers to move the map","otter-blocks"),scroll:(0,o.__)("Use ctrl + scroll to zoom the map","otter-blocks"),scrollMac:(0,o.__)("Use ⌘ + scroll to zoom the map","otter-blocks")}}});e.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",{attribution:'&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a>',subdomains:["a","b","c"]}).addTo(i),i.on("zoom",(()=>{a({zoom:i.getZoom()})})),i.on("moveend",(()=>{const e=i.getCenter();a({latitude:e.lat.toString(),longitude:e.lng.toString()})})),i.on("click",(e=>{v({type:Gl.ADD_MANUAL,marker:{latitude:e.latlng.lat,longitude:e.latlng.lng},dispatch:v}),b(!1)})),e.Control.AddMarker=e.Control.extend({onAdd:()=>{const t=e.DomUtil.create("button","wp-block-themeisle-blocks-leaflet-map-marker-button"),l=e.DomUtil.create("span","dashicons dashicons-sticky",t);return e.DomEvent.on(t,"click",(t=>{e.DomEvent.stopPropagation(t),b(!u)})),t.title=(0,o.__)("Add marker on the map with a click","otter-blocks"),t.appendChild(l),t},onRemove:()=>{}}),e.control.addmarker=t=>new e.Control.AddMarker(t),e.control.addmarker({position:"bottomleft"}).addTo(i),d(i),v({type:Gl.INIT,markers:l.markers,dispatch:v})};(0,i.useEffect)((()=>{(0,L.getEditorIframe)()?((0,L.copyScriptAssetToIframe)("#leaflet-js",(()=>{y()})),(0,L.copyScriptAssetToIframe)("#leaflet-gesture-handling-js",(()=>{}))):y()}),[]),(0,i.useEffect)((()=>{l.height&&c&&c.invalidateSize(!0)}),[l.height,c]),(0,i.useEffect)((()=>{l.latitude&&l.longitude&&c&&c.setView([l.latitude,l.longitude],l.zoom||15)}),[l.latitude,l.longitude,l.zoom,c]),(0,i.useEffect)((()=>{var e;null===(e=r.current)||void 0===e||e.classList.toggle("is-selecting-location",u)}),[u]),(0,i.useEffect)((()=>{l.latitude&&l.longitude&&c&&a({bbox:c.getBounds().toBBoxString()})}),[l.latitude,l.longitude,c]),(0,i.useEffect)((()=>{h&&(h.forEach((e=>{c.hasLayer(e)||c.addLayer(e);const{markerProps:t}=e;e.setLatLng([t.latitude,t.longitude]),e.closeTooltip(),e.unbindTooltip(),e.bindTooltip(t.title,{direction:"auto"}),e.closePopup(),e.unbindPopup(),e.bindPopup(((e,t)=>{const l=document.createElement("div"),a=document.createElement("h6"),n=document.createElement("div"),r=document.createElement("p"),i=document.createElement("button");return a.innerHTML=e.title,r.innerHTML=e.description,i.onclick=()=>t({type:Gl.REMOVE,ids:[e.id]}),i.innerHTML=(0,o.__)("Delete Marker","otter-blocks"),l.classList.add("wp-block-themeisle-blocks-map-overview"),n.classList.add("wp-block-themeisle-blocks-map-overview-content"),a.classList.add("wp-block-themeisle-blocks-map-overview-title"),i.classList.add("wp-block-themeisle-blocks-map-overview-delete"),l.appendChild(a),l.appendChild(n),l.appendChild(i),n.appendChild(r),l})(t,v))})),l.markers.length!==h.length&&c&&a({markers:h.map((e=>{let{markerProps:t}=e;return t}))}))}),[h,c,l.markers]);const k=(0,s.useBlockProps)();return(0,i.createElement)(i.Fragment,null,(0,i.createElement)(Il,{attributes:l,setAttributes:a,dispatch:v,markersInteraction:{openMarker:m,setOpenMarker:p}}),(0,i.createElement)("div",k,(0,i.createElement)("div",{id:l.id,ref:r,style:{width:"100%",height:n([(f=l.height||400,(0,K.isNumber)(f)?(e=>e?`${e}px`:e)(f):f),l.heightTablet,l.heightMobile])}})));var f},save:()=>null,example:{attributes:{}}});var jl=l(2553),Ul=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"themeisle-blocks/lottie","title":"Lottie Animation","category":"themeisle-blocks","description":"Add Lottie animations to your WordPress. Powered by Otter.","keywords":["media","lottie","animation"],"textdomain":"otter-blocks","attributes":{"id":{"type":"string"},"file":{"type":"object"},"trigger":{"type":"string","default":"none"},"loop":{"type":"boolean","default":false},"count":{"type":"number","default":0},"speed":{"type":"number","default":1},"direction":{"type":"boolean","default":false},"width":{"type":["string","number"]},"ariaLabel":{"type":"string","default":""},"backgroundColor":{"type":"string"},"backgroundGradient":{"type":"string"}},"supports":{"align":["left","center","right"]},"editorStyle":"otter-lottie-editor","script":"otter-lottie"}'),ql=e=>{var t;let{className:l,file:a,onChange:n,attributes:r}=e;const[d,u]=(0,i.useState)((null===(t=r.file)||void 0===t?void 0:t.url)||null);return Boolean(window.themeisleGutenberg.isWPVIP)?(0,i.createElement)(c.Placeholder,{label:(0,o.__)("Lottie","otter-blocks"),instructions:(0,o.__)("Add Lottie animations and files to your website. You need to use a .json file.","otter-blocks"),icon:(0,i.createElement)(s.BlockIcon,{icon:jl.Z}),className:l},(0,i.createElement)("form",{onSubmit:e=>(e&&e.preventDefault(),n(d))},(0,i.createElement)("input",{type:"url",value:d||"",className:"components-placeholder__input","aria-label":(0,o.__)("Lottie","otter-blocks"),placeholder:(0,o.__)("Enter URL to embed here…","otter-blocks"),onChange:e=>u(e.target.value)}),(0,i.createElement)(c.Button,{isPrimary:!0,disabled:!d,type:"submit"},(0,o.__)("Embed","otter-blocks")))):(0,i.createElement)(s.MediaPlaceholder,{labels:{title:(0,o.__)("Lottie","otter-blocks"),instructions:(0,o.__)("Add Lottie animations and files to your website.","otter-blocks")},icon:(0,i.createElement)(s.BlockIcon,{icon:jl.Z}),accept:["application/json",".lottie"],allowedTypes:["application/json"],value:{...a},onSelectURL:n,onSelect:n})},Jl=e=>{let{attributes:t,setAttributes:l,playerRef:a}=e;return(0,i.createElement)(i.Fragment,null,(0,i.createElement)(s.InspectorControls,null,(0,i.createElement)(c.PanelBody,{title:(0,o.__)("Settings","otter-blocks"),initialOpen:!0},(0,i.createElement)(c.SelectControl,{label:(0,o.__)("Trigger","otter-blocks"),help:(0,o.__)("Animation trigger. This will only work on the front-end.","otter-blocks"),value:t.trigger,options:[{label:(0,o.__)("Autoplay","otter-blocks"),value:"none"},{label:(0,o.__)("Scroll","otter-blocks"),value:"scroll"},{label:(0,o.__)("Hover","otter-blocks"),value:"hover"},{label:(0,o.__)("Click","otter-blocks"),value:"click"}],onChange:e=>{l({trigger:e})}}),"scroll"!==t.trigger&&(0,i.createElement)(i.Fragment,null,(0,i.createElement)(c.ToggleControl,{label:(0,o.__)("Loop","otter-blocks"),help:(0,o.__)("Whether to loop animation.","otter-blocks"),checked:t.loop,onChange:e=>{l({loop:e}),a.current.setLooping(e),t.direction&&a.current.seek("100%"),a.current.play()}}),t.loop&&(0,i.createElement)(c.TextControl,{label:(0,o.__)("Numbers of loops","otter-blocks"),help:(0,o.__)("Number of times to loop animation.","otter-blocks"),type:"number",value:t.count,onChange:e=>{l({count:Number(e)}),a.current.load(t.file.url)}}),(0,i.createElement)(c.RangeControl,{label:(0,o.__)("Speed","otter-blocks"),help:(0,o.__)("Animation speed.","otter-blocks"),value:t.speed,onChange:e=>{l({speed:Number(e)}),a.current.setSpeed(e)},step:.1,min:.1,max:5}),(0,i.createElement)(c.ToggleControl,{label:(0,o.__)("Reverse","otter-blocks"),help:(0,o.__)("Direction of animation.","otter-blocks"),checked:t.direction,onChange:e=>{l({direction:e}),a.current.setDirection(e?-1:1),a.current.seek(e?"100%":0)}})),(0,i.createElement)(s.__experimentalUnitControl,{onChange:e=>{const t=parseInt(e.slice(0,-1)),o=e.slice(-1);100<t&&"%"===o&&(e="100%"),l({width:e})},label:(0,o.__)("Width","otter-blocks"),isUnitSelectTabbable:!0,isResetValueOnUnitChange:!0,__unstableInputWidth:"50%",value:Number.isInteger(t.width)?`${t.width}px`:t.width,units:[{value:"%",label:"%",default:100},{value:"px",label:"px",default:300}]})),(0,i.createElement)(c.PanelBody,{title:(0,o.__)("Background","otter-blocks"),initialOpen:!1},(0,i.createElement)(s.__experimentalColorGradientControl,{colorValue:t.backgroundColor,gradientValue:t.backgroundGradient,onColorChange:e=>l({backgroundColor:e}),onGradientChange:e=>l({backgroundGradient:e}),showTitle:!1,className:"otter-lottie-background-control"}))),(0,i.createElement)(s.InspectorAdvancedControls,null,(0,i.createElement)(c.TextControl,{label:(0,o.__)("Aria Label","otter-blocks"),help:(0,o.__)("Describe the purpose of this animation on the page.","otter-blocks"),value:t.ariaLabel,onChange:e=>l({ariaLabel:e})})))},Kl=e=>{let{isEditing:t,setEditing:l}=e;return(0,i.createElement)(s.BlockControls,null,(0,i.createElement)(c.ToolbarGroup,null,(0,i.createElement)(c.Tooltip,{text:t?(0,o.__)("Save","otter-blocks"):(0,o.__)("Edit","otter-blocks")},(0,i.createElement)(c.Button,{onClick:()=>l(!t)},(0,i.createElement)(c.Dashicon,{icon:t?"yes":"edit"})))))},Yl=e=>{let{attributes:t,playerRef:l}=e;(0,i.useEffect)((()=>{const e=(0,L.getEditorIframe)();Boolean(e)?((0,L.copyScriptAssetToIframe)("#lottie-player-js",(()=>{!(0,K.isEmpty)(t.file)&&t.loop&&null!==l.current&&l.current.addEventListener("complete",o)})),(0,L.copyScriptAssetToIframe)("#dotlottie-player-js",(()=>{!(0,K.isEmpty)(t.file)&&t.loop&&null!==l.current&&l.current.addEventListener("complete",o)}))):!(0,K.isEmpty)(t.file)&&t.loop&&null!==l.current&&l.current.addEventListener("complete",o)}),[]);const o=()=>{l.current&&(l.current.setLooping(t.loop),l.current.play(),l.current.removeEventListener("complete",o))};let a=(0,i.createElement)("lottie-player");return t.file.url.endsWith(".lottie")&&(a=(0,i.createElement)("dotlottie-player")),(0,i.cloneElement)(a,{id:t.id,ref:l,src:t.file.url,autoplay:!t.trigger||"none"===t.trigger,loop:t.loop,count:t.direction?-1*t.count:t.count,speed:t.speed,background:t.backgroundColor||t.backgroundGradient,direction:t.direction?-1:1,trigger:t.trigger,"data-loop":t.loop,mode:"normal",style:{width:!(!t.width||"%"===t.width.toString().slice(-1))&&`${t.width}px`,maxWidth:!(!t.width||"%"!==t.width.toString().slice(-1))&&`${t.width}`,height:"auto"},..."hover"===t.trigger&&{hover:"hover"},...t.ariaLabel&&{"aria-label":t.ariaLabel}})};const{attributes:Ql}=Ul;const{name:Xl}=Ul;(0,a.registerBlockType)(Xl,{...Ul,title:(0,o.__)("Lottie Animation","otter-blocks"),description:(0,o.__)("Add Lottie animations to your WordPress. Powered by Otter.","otter-blocks"),icon:jl.Z,keywords:["media","lottie","animation"],edit:e=>{let{attributes:t,setAttributes:l,isSelected:o,clientId:a}=e;const n=(0,i.useRef)(null),[r,c]=(0,i.useState)(!Boolean(t.file));(0,i.useEffect)((()=>{const e=(0,L.blockInit)(a,Ql);return()=>e(t.id)}),[t.id]),(0,i.useEffect)((()=>{var e,l,a,r,i,s;o?(null===(e=n.current)||void 0===e||null===(l=e.play)||void 0===l||l.call(e),t.direction&&(null===(a=n.current)||void 0===a||null===(r=a.seek)||void 0===r||r.call(a,"100%"))):null===(i=n.current)||void 0===i||null===(s=i.stop)||void 0===s||s.call(i)}),[o]);const d=(0,s.useBlockProps)();return(0,i.createElement)(i.Fragment,null,(!(0,K.isEmpty)(t.file)&&r||!r)&&(0,i.createElement)(Kl,{isEditing:r,setEditing:c}),!((0,K.isEmpty)(t.file)||r)&&(0,i.createElement)(Jl,{attributes:t,setAttributes:l,playerRef:n}),(0,i.createElement)("div",d,((0,K.isEmpty)(t.file)||r)&&(0,i.createElement)(ql,{value:t.file,onChange:e=>{if(""===e||null===e)return;const t=(0,K.pick)(e,["id","url"]);(0,K.isEmpty)(t)&&(t.url=e),l({file:{...t}}),c(!1)},attributes:t}),!((0,K.isEmpty)(t.file)||r)&&(0,i.createElement)(Yl,{attributes:t,isSelected:o,playerRef:n})))},save:e=>{let{attributes:t}=e;const l=s.useBlockProps.save({id:t.id,...t.file.url.endsWith(".lottie")?{"data-src":t.file?t.file.url:""}:{src:t.file?t.file.url:""},width:t.width});let o=(0,i.createElement)("lottie-player");return t.file.url.endsWith(".lottie")&&(o=(0,i.createElement)("dotlottie-player")),o=(0,i.cloneElement)(o,{trigger:t.trigger,background:t.backgroundColor||t.backgroundGradient,...t.ariaLabel&&{"aria-label":t.ariaLabel},...l}),"scroll"===t.trigger?o:(0,i.cloneElement)(o,{autoplay:!0,loop:!0,count:t.direction?-1*t.count:t.count,speed:t.speed,direction:t.direction?-1:1,trigger:t.trigger,"data-loop":t.loop,mode:"normal",..."hover"===t.trigger&&{hover:"hover"}})},example:{viewportWidth:1200,attributes:{id:"wp-block-themeisle-blocks-lottie-2",file:{url:"https://assets8.lottiefiles.com/packages/lf20_kd5rzej5.json"}}}});var eo=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"themeisle-blocks/plugin-cards","title":"Plugin Card","category":"themeisle-blocks","description":"Plugin Card block lets you display plugins data in your blog posts. Powered by Otter.","keywords":["plugin","card","orbitfox"],"textdomain":"otter-blocks","attributes":{"slug":{"type":"string"}},"supports":{"html":false},"editorStyle":"otter-plugin-card-editor","style":"otter-plugin-card-style"}'),to=l(9630),lo=e=>{let{setAttributes:t,hasError:l,setError:a,className:n}=e;const[r,s]=(0,i.useState)(!1),[d,u]=(0,i.useState)(""),[b,m]=(0,i.useState)({}),[p,g]=(0,i.useState)(null),h=e=>{if(Object.keys(b).length){e.stopPropagation(),e.preventDefault();const t=p?p-1:Object.keys(b).length-1;g(t)}},v=e=>{if(Object.keys(b).length){e.stopPropagation(),e.preventDefault();const t=null===p||p===Object.keys(b).length-1?0:p+1;g(t)}},y=e=>{t({slug:e.slug}),m({})};return(0,i.createElement)(c.Placeholder,{icon:"admin-plugins",label:(0,o.__)("Plugin Card","otter-blocks"),instructions:(0,o.__)("Search for the plugin you want to display.","otter-blocks"),className:n},(0,i.createElement)("div",{className:"o-plugin-cards-search-field"},(0,i.createElement)(c.Dashicon,{icon:"search"}),r&&(0,i.createElement)(c.Spinner,null),(0,i.createElement)(c.TextControl,{type:"text",placeholder:(0,o.__)("Search for plugin…","otter-blocks"),value:d,onChange:u,onKeyDown:e=>{switch(e.keyCode){case to.UP:h(e);break;case to.DOWN:v(e);break;case to.TAB:Object.keys(b).length&&!e.shiftKey&&g(0);break;case to.ENTER:(async e=>{t({slug:""}),s(!0),a(!1);const l=await It()({path:`otter/v1/plugins?search=${encodeURIComponent(e)}`});if(l.data.errors)return a(!0),s(!1),g(null),void m({});s(!1),g(null),m(l.data.plugins)})(e.target.value)}},onFocus:()=>g(null)}),b&&(0,i.createElement)("div",{tabIndex:"-1",className:"o-plugin-cards-search-results"},Object.keys(b).map((e=>{const t=b[e];let l;return t.icons.svg&&(l=t.icons.svg),t.icons["2x"]&&(l=t.icons["2x"]),t.icons["1x"]&&(l=t.icons["1x"]),t.icons.default&&(l=t.icons.default),(0,i.createElement)("button",{className:"o-plugin-cards-list-item",key:e,onClick:e=>{e.preventDefault(),y(t)},onKeyDown:e=>((e,t)=>{switch(e.keyCode){case to.UP:h(e);break;case to.DOWN:v(e);break;case to.TAB:if(e.shiftKey){0!==p&&h(e);break}if(p===Object.keys(b).length-1)break;v(e);break;case to.ENTER:y(t)}})(e,t)},(0,i.createElement)("img",{src:l}),(0,i.createElement)("span",{dangerouslySetInnerHTML:{__html:(0,K.unescape)(t.name)}}))})))),l&&(0,i.createElement)("div",{className:"o-plugin-cards-error"},(0,i.createElement)("span",null,(0,o.__)("There seems to be an error. Make sure your internet is working properly.","otter-blocks"))))},oo=e=>{let{setAttributes:t}=e;return(0,i.createElement)(s.BlockControls,null,(0,i.createElement)(c.ToolbarGroup,null,(0,i.createElement)(c.Tooltip,{text:(0,o.__)("Edit","otter-blocks")},(0,i.createElement)(c.Button,{className:"components-icon-button components-toolbar__control o-plugin-cards-edit-plugin-card",onClick:()=>t({slug:void 0})},(0,i.createElement)(c.Dashicon,{icon:"edit"})))))};const{name:ao}=eo;(0,a.registerBlockType)(ao,{...eo,title:(0,o.__)("Plugin Card","otter-blocks"),description:(0,o.__)("Plugin Card block lets you display plugins data in your blog posts. Powered by Otter.","otter-blocks"),icon:r.pluginsIcon,keywords:["plugin","card","orbitfox"],edit:e=>{let{attributes:t,setAttributes:l}=e;const[o,a]=(0,i.useState)(!1),n=(0,s.useBlockProps)();return t.slug?(0,i.createElement)(i.Fragment,null,(0,i.createElement)(oo,{setAttributes:l}),(0,i.createElement)("div",n,(0,i.createElement)(c.Disabled,null,(0,i.createElement)(u(),{block:"themeisle-blocks/plugin-cards",attributes:{...t}})))):(0,i.createElement)("div",n,(0,i.createElement)(lo,{attributes:t,setAttributes:l,hasError:o,setError:a}))},save:()=>null,example:{attributes:{slug:"otter-blocks"}}});var no=l(7682),ro=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"themeisle-blocks/popup","title":"Popup","category":"themeisle-blocks","description":"Display your content in beautiful popup with many customization options. Powered by Otter.","keywords":["popup","modal","lightbox"],"textdomain":"otter-blocks","attributes":{"id":{"type":"string"},"minWidth":{"type":["number","string"]},"maxWidth":{"type":["number","string"]},"trigger":{"type":"string"},"wait":{"type":"number"},"anchor":{"type":"string"},"scroll":{"type":"number"},"showClose":{"type":"boolean","default":true},"outsideClose":{"type":"boolean","default":true},"anchorClose":{"type":"boolean","default":false},"closeAnchor":{"type":"string"},"recurringClose":{"type":"boolean","default":false},"recurringTime":{"type":"number"},"backgroundColor":{"type":"string"},"closeColor":{"type":"string"},"overlayColor":{"type":"string"},"overlayOpacity":{"type":"number"},"lockScrolling":{"type":"boolean"},"padding":{"type":"object"},"paddingTablet":{"type":"object"},"paddingMobile":{"type":"object"},"borderWidth":{"type":"object"},"borderRadius":{"type":"object"},"borderColor":{"type":"string"},"borderStyle":{"type":"string"},"width":{"type":"string"},"widthTablet":{"type":"string"},"widthMobile":{"type":"string"},"heightMode":{"type":"string"},"height":{"type":"string"},"heightTablet":{"type":"string"},"heightMobile":{"type":"string"},"verticalPosition":{"type":"string"},"horizontalPosition":{"type":"string"},"verticalPositionTablet":{"type":"string"},"horizontalPositionTablet":{"type":"string"},"verticalPositionMobile":{"type":"string"},"horizontalPositionMobile":{"type":"string"},"closeButtonType":{"type":"string"},"boxShadow":{"type":"object","default":{"active":false,"colorOpacity":50,"blur":5,"spread":1,"horizontal":0,"vertical":0}},"disableOn":{"type":"string"}},"editorStyle":"otter-popup-editor","style":"otter-popup-style","script":"otter-popup"}'),io=l(6755),so=l(7231);const co=()=>(0,i.createElement)(i.Fragment,null,(0,i.createElement)(c.Disabled,null,(0,i.createElement)(c.ToggleControl,{label:(0,o.__)("Close On Anchor Click","otter-blocks"),checked:!1,onChange:()=>{},className:"o-disabled"}),(0,i.createElement)(c.ToggleControl,{label:(0,o.__)("Dismiss for Recurring Visitors","otter-blocks"),checked:!1,onChange:()=>{},className:"o-disabled"})),(0,i.createElement)(De.Z,{notice:(0,i.createElement)(c.ExternalLink,{href:(0,x.Wi)(window.themeisleGutenberg.upgradeLink,"popupblock")},(0,o.__)("Get more options with Otter Pro. ","otter-blocks")),variant:"upsell"}));var uo=e=>{var t,l,a,n,r,d,u,b,m,p,g,h;let{attributes:v,setAttributes:y}=e;const[k,_]=(0,i.useState)("settings"),{responsiveSetAttributes:C,responsiveGetAttributes:E}=S(y);let T=[{label:(0,o.__)("On Load","otter-blocks"),value:"onLoad"},{label:(0,o.__)("On Anchor Click (Pro)","otter-blocks"),value:"onClick",disabled:!0},{label:(0,o.__)("On Scroll (Pro)","otter-blocks"),value:"onScroll",disabled:!0},{label:(0,o.__)("On Exit (Pro)","otter-blocks"),value:"onExit",disabled:!0}];return T=(0,Ie.applyFilters)("otter.popupBlock.triggers",T),(0,i.createElement)(s.InspectorControls,null,(0,Ie.applyFilters)("otter.feedback","","popup-block",(0,o.__)("Help us improve this block","otter-blocks")),(0,i.createElement)(w.Z,{value:k,options:[{label:(0,o.__)("Settings","otter-blocks"),value:"settings"},{label:(0,o.__)("Style","otter-blocks"),value:"style"}],onChange:_}),(0,i.createElement)("div",null,"settings"===k&&(0,i.createElement)(i.Fragment,null,(0,i.createElement)(c.PanelBody,{title:(0,o.__)("Popup settings","otter-blocks")},(0,i.createElement)(c.SelectControl,{label:(0,o.__)("Open Trigger","otter-blocks"),help:!Boolean(window.themeisleGutenberg.hasPro)&&(0,o.__)("You need to have Otter Pro to activate Pro features.","otter-blocks"),options:T,value:v.trigger,onChange:e=>y({trigger:e})}),(void 0===v.trigger||"onLoad"===v.trigger)&&(0,i.createElement)(c.RangeControl,{label:(0,o.__)("Trigger Delay","otter-blocks"),help:(0,o.__)("How much time in seconds to wait before showing the popup.","otter-blocks"),min:0,max:100,value:null!==(t=v.wait)&&void 0!==t?t:0,onChange:e=>y({wait:Number(e)}),allowReset:!0}),(0,i.createElement)(c.ToggleControl,{label:(0,o.__)("Disable Page Scrolling","otter-blocks"),checked:v.lockScrolling,onChange:()=>y({lockScrolling:!v.lockScrolling})}),(0,i.createElement)(c.ToggleControl,{label:(0,o.__)("Show on mobile","otter-blocks"),checked:!Boolean(v.disableOn),onChange:e=>y({disableOn:e?void 0:"mobile"})})),(0,i.createElement)(c.PanelBody,{title:(0,o.__)("Popup Position","otter-blocks"),initialOpen:!1},(0,i.createElement)(M.Z,{label:(0,o.__)("Screen Type","otter-blocks")},(0,i.createElement)("div",{className:"o-position-picker"},(0,i.createElement)(c.__experimentalAlignmentMatrixControl,{value:E([`${null!==(l=v.verticalPosition)&&void 0!==l?l:"center"} ${null!==(a=v.horizontalPosition)&&void 0!==a?a:"center"}`,`${null!==(n=v.verticalPositionTablet)&&void 0!==n?n:"center"} ${null!==(r=v.horizontalPositionTablet)&&void 0!==r?r:"center"}`,`${null!==(d=v.verticalPositionMobile)&&void 0!==d?d:"center"} ${null!==(u=v.horizontalPositionMobile)&&void 0!==u?u:"center"}`]),onChange:e=>{const[t,l]=e.split(" ");switch(view){case"Desktop":y({verticalPosition:Boolean(t)&&"center"!==t?t:void 0,horizontalPosition:Boolean(l)&&"center"!==l?l:void 0});break;case"Tablet":y({verticalPositionTabelt:Boolean(t)&&"center"!==t?t:void 0,horizontalPositionTablet:Boolean(l)&&"center"!==l?l:void 0});break;case"Mobile":y({verticalPositionMobile:Boolean(t)&&"center"!==t?t:void 0,horizontalPositionMobile:Boolean(l)&&"center"!==l?l:void 0})}}})))),(0,i.createElement)(c.PanelBody,{title:(0,o.__)("Frequency & Close Settings","otter-blocks"),initialOpen:!1},(0,Ie.applyFilters)("otter.popupBlock.controls",(0,i.createElement)((()=>(0,i.createElement)(i.Fragment,null,(0,i.createElement)(c.ToggleControl,{label:(0,o.__)("Show Close Button","otter-blocks"),checked:v.showClose,onChange:()=>y({showClose:!v.showClose})}),(0,i.createElement)(c.ToggleControl,{label:(0,o.__)("Close on Click Outside","otter-blocks"),checked:v.outsideClose,onChange:()=>y({outsideClose:!v.outsideClose})}),!Boolean(window.themeisleGutenberg.hasPro)&&(0,i.createElement)(co,null))),null),v,y))),"style"===k&&(0,i.createElement)(i.Fragment,null,(0,i.createElement)(c.PanelBody,{title:(0,o.__)("Dimensions","otter-blocks")},(0,i.createElement)(M.Z,{label:(0,o.__)("Width","otter-blocks")},(0,i.createElement)(c.__experimentalUnitControl,{value:null!==(b=E([v.width,v.widthTablet,v.widthMobile]))&&void 0!==b?b:"500px",onChange:e=>{C(e,["width","widthTablet","widthMobile"])}})),(0,i.createElement)(c.SelectControl,{label:(0,o.__)("Height","otter-blocks"),options:[{label:(0,o.__)("Fit Content","otter-blocks"),value:"none"},{label:(0,o.__)("Custom","otter-blocks"),value:"custom"}],value:v.heightMode,onChange:e=>y({heightMode:"none"!==e?e:void 0})}),"custom"===v.heightMode&&(0,i.createElement)(M.Z,{label:(0,o.__)("Custom Height","otter-blocks")},(0,i.createElement)(c.__experimentalUnitControl,{value:null!==(m=E([v.height,v.heightTablet,v.heightMobile]))&&void 0!==m?m:"400px",onChange:e=>{C(e,["height","heightTablet","heightMobile"])}})),(0,i.createElement)(M.Z,null,(0,i.createElement)(c.__experimentalBoxControl,{label:(0,o.__)("Padding","otter-blocks"),values:null!==(p=E([v.padding,v.paddingTablet,v.paddingMobile]))&&void 0!==p?p:{top:"20px",bottom:"20px",left:"20px",right:"20px"},onChange:e=>{C((0,x.cg)(e,{top:"20px",bottom:"20px",left:"20px",right:"20px"}),["padding","paddingTablet","paddingMobile"])}}))),(0,i.createElement)(s.PanelColorSettings,{title:(0,o.__)("Color","otter-blocks"),initialOpen:!1,colorSettings:[{value:v.backgroundColor,onChange:e=>y({backgroundColor:e}),label:(0,o.__)("Background","otter-blocks")},{value:v.closeColor,onChange:e=>y({closeColor:e}),label:(0,o.__)("Close Button","otter-blocks")},{value:v.overlayColor,onChange:e=>y({overlayColor:e}),label:(0,o.__)("Overlay","otter-blocks")},{value:v.borderColor,onChange:e=>y({borderColor:e}),label:(0,o.__)("Border","otter-blocks")}]}),(0,i.createElement)(c.PanelBody,{title:(0,o.__)("Overlay","otter-blocks"),initialOpen:!1},(0,i.createElement)(c.RangeControl,{label:(0,o.__)("Overlay Opacity","otter-blocks"),value:v.overlayOpacity,initialPosition:100,onChange:e=>y({overlayOpacity:void 0!==e?Number(e):void 0}),allowReset:!0})),(0,i.createElement)(c.PanelBody,{title:(0,o.__)("Close Button","otter-blocks"),initialOpen:!1},(0,i.createElement)(c.ToggleControl,{label:(0,o.__)("Show Close Button","otter-blocks"),checked:v.showClose,onChange:()=>y({showClose:!v.showClose})}),(0,i.createElement)(c.SelectControl,{label:(0,o.__)("Position","otter-blocks"),options:[{label:(0,o.__)("Inside","otter-blocks"),value:"none"},{label:(0,o.__)("Outside","otter-blocks"),value:"outside"}],value:v.closeButtonType,onChange:e=>y({closeButtonType:"none"!==e?e:void 0})})),(0,i.createElement)(c.PanelBody,{title:(0,o.__)("Border","otter-blocks"),initialOpen:!1},(0,i.createElement)(c.__experimentalBoxControl,{label:(0,o.__)("Width","otter-blocks"),values:null!==(g=v.borderWidth)&&void 0!==g?g:{top:"0px",bottom:"0px",left:"0px",right:"0px"},onChange:e=>{y({borderWidth:(0,x.cg)(e,{top:"0px",bottom:"0px",left:"0px",right:"0px"})})}}),(0,i.createElement)(c.__experimentalBoxControl,{id:"o-border-raduis-box",label:(0,o.__)("Border Radius","otter-blocks"),values:null!==(h=v.borderRadius)&&void 0!==h?h:{top:"0px",bottom:"0px",left:"0px",right:"0px"},onChange:e=>{y({borderRadius:(0,x.cg)(e,{top:"0px",bottom:"0px",left:"0px",right:"0px"})})}}),(0,i.createElement)(f.Z,{boxShadow:v.boxShadow,onChange:e=>{const t={...v.boxShadow};Object.entries(e).map((function(){let[l,o]=arguments.length>0&&void 0!==arguments[0]?arguments[0]:e;t[l]=o})),y({boxShadow:t})}})))))};const{attributes:bo}=ro,mo=e=>({top:e,bottom:e,left:e,right:e});const{name:po}=ro;(0,a.registerBlockType)(po,{...ro,title:(0,o.__)("Popup","otter-blocks"),description:(0,o.__)("Display your content in beautiful popup with many customization options. Powered by Otter.","otter-blocks"),icon:no.Z,keywords:["popup","modal","lightbox"],edit:e=>{var t,l,a;let{attributes:n,setAttributes:r,clientId:d,className:u}=e;(0,i.useEffect)((()=>{const e=(0,L.blockInit)(d,bo);return()=>e(n.id)}),[]);const[b,m]=(0,i.useState)(!1),p="custom"===n.heightMode?{"--height":n.height,"--height-tablet":n.heightMobile,"--height-mobile":n.heightMobile}:{"--height":"fit-content"},h={"--min-width":n.minWidth?n.minWidth+"px":"400px","--max-width":n.maxWidth?n.maxWidth+"px":void 0,"--background-color":n.backgroundColor,"--close-color":n.closeColor,"--overlay-color":n.overlayColor,"--overlay-opacity":void 0!==n.overlayOpacity?n.overlayOpacity/100:1,"--brd-width":(0,x.bv)(n.borderWidth),"--brd-radius":(0,x.bv)(n.borderRadius),"--brd-color":n.borderColor,"--brd-style":n.borderStyle,"--width":!Boolean(n.width)&&n.maxWidth?n.maxWidth+"px":n.width,"--width-tablet":n.widthTablet,"--width-mobile":n.widthMobile,"--padding":n.padding?(0,x.bv)((0,K.merge)(mo("20px"),n.padding)):void 0,"--padding-tablet":n.paddingTablet?(0,x.bv)((0,K.merge)(mo("20px"),null!==(t=n.padding)&&void 0!==t?t:{},n.paddingTablet)):void 0,"--padding-mobile":n.paddingMobile?(0,x.bv)((0,K.merge)(mo("20px"),null!==(l=n.padding)&&void 0!==l?l:{},null!==(a=n.paddingTablet)&&void 0!==a?a:{},n.paddingMobile)):void 0,"--box-shadow":n.boxShadow.active&&`${n.boxShadow.horizontal}px ${n.boxShadow.vertical}px ${n.boxShadow.blur}px ${n.boxShadow.spread}px ${hexToRgba(n.boxShadow.color||"#FFFFFF",n.boxShadow.colorOpacity)}`,...p},[v,y]=(0,L.useCSSNode)();(0,i.useEffect)((()=>{y([" .otter-popup__modal_content "+(0,x.iC)([["top","30px","top"===n.verticalPosition],["bottom","30px","bottom"===n.verticalPosition],["left","30px","left"===n.horizontalPosition],["right","30px","right"===n.horizontalPosition]])," .otter-popup__modal_content "+(0,x.iC)([["top","15px","top"===n.verticalPositionTablet],["bottom","15px","bottom"===n.verticalPositionTablet],["left","15px","left"===n.horizontalPositionTablet],["right","15px","right"===n.horizontalPositionTablet]])," .otter-popup__modal_content "+(0,x.iC)([["top","10px","top"===n.verticalPositionMobile],["bottom","10px","bottom"===n.verticalPositionMobile],["left","10px","left"===n.horizontalPositionMobile],["right","10px","right"===n.horizontalPositionMobile]])],["@media ( min-width: 960px )","@media ( min-width: 600px ) and ( max-width: 960px )","@media ( max-width: 600px )"])}),[n.horizontalPosition,n.verticalPosition,n.horizontalPositionTablet,n.verticalPositionTablet,n.horizontalPositionMobile,n.verticalPositionMobile]);const k=(0,s.useBlockProps)({id:n.id,style:h,className:g()(u,v,{"with-outside-button":"outside"===n.closeButtonType})});return(0,i.createElement)(i.Fragment,null,(0,i.createElement)(uo,{attributes:n,setAttributes:r}),(0,i.createElement)("div",k,(0,i.createElement)(c.Button,{variant:"primary",isPrimary:!0,icon:io.Z,onClick:()=>m(!0)},(0,o.__)("Edit Popup","otter-blocks")),b&&(0,i.createElement)("div",{className:"otter-popup__modal_wrap"},(0,i.createElement)("div",{role:"presentation",className:"otter-popup__modal_wrap_overlay",onClick:()=>m(!1)}),(0,i.createElement)("div",{className:"otter-popup__modal_content"},n.showClose&&(0,i.createElement)("div",{className:"otter-popup__modal_header"},(0,i.createElement)(c.Button,{icon:so.Z,onClick:()=>m(!1)})),(0,i.createElement)("div",{className:"otter-popup__modal_body"},(0,i.createElement)(s.InnerBlocks,null))))))},save:e=>{let{attributes:t,className:l}=e;const o=s.useBlockProps.save({id:t.id,className:g()(l,"is-front",{"with-outside-button":"outside"===t.closeButtonType}),"data-open":t.trigger,"data-dismiss":t.recurringClose?t.recurringTime:"","data-time":void 0===t.trigger||"onLoad"===t.trigger?t.wait||0:"","data-anchor":"onClick"===t.trigger?t.anchor:"","data-offset":"onScroll"===t.trigger?t.scroll:"","data-outside":t.outsideClose?t.outsideClose:"","data-anchorclose":t.anchorClose?t.closeAnchor:"","data-lock-scrolling":t.lockScrolling?"1":void 0,"data-disable-on":t.disableOn?t.disableOn:void 0});return(0,i.createElement)("div",o,(0,i.createElement)("div",{className:"otter-popup__modal_wrap"},(0,i.createElement)("div",{role:"presentation",className:"otter-popup__modal_wrap_overlay"}),(0,i.createElement)("div",{className:"otter-popup__modal_content"},t.showClose&&(0,i.createElement)("div",{className:"otter-popup__modal_header"},(0,i.createElement)("button",{type:"button",class:"components-button has-icon"},(0,i.createElement)("svg",{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",role:"img","aria-hidden":"true"},(0,i.createElement)("path",{d:"M12 13.06l3.712 3.713 1.061-1.06L13.061 12l3.712-3.712-1.06-1.06L12 10.938 8.288 7.227l-1.061 1.06L10.939 12l-3.712 3.712 1.06 1.061L12 13.061z"})))),(0,i.createElement)("div",{className:"otter-popup__modal_body"},(0,i.createElement)(s.InnerBlocks.Content,null)))))},example:{attributes:{}}});var go=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"themeisle-blocks/posts-grid","title":"Posts","category":"themeisle-blocks","description":"Display a list of your most recent posts in a beautiful layout. Powered by Otter.","keywords":["posts","grid","news"],"textdomain":"otter-blocks","attributes":{"id":{"type":"string"},"style":{"type":"string","default":"grid"},"postTypes":{"type":"array","default":[]},"columns":{"type":"number","default":3},"template":{"type":"array","default":["category","title","meta","description"]},"categories":{"type":"array","items":{"type":"object"}},"postsToShow":{"type":"number","default":5},"order":{"type":"string","default":"desc"},"orderBy":{"type":"string","default":"date"},"offset":{"type":"number","default":0},"imageSize":{"type":"string","default":"full"},"displayFeaturedImage":{"type":"boolean","default":true},"displayCategory":{"type":"boolean","default":true},"displayTitle":{"type":"boolean","default":true},"titleTag":{"type":"string","default":"h5"},"displayMeta":{"type":"boolean","default":true},"displayDescription":{"type":"boolean","default":true},"excerptLength":{"type":"number","default":100},"displayDate":{"type":"boolean","default":true},"displayAuthor":{"type":"boolean","default":true},"displayComments":{"type":"boolean","default":true},"displayPostCategory":{"type":"boolean","default":false},"displayReadMoreLink":{"type":"boolean","default":false},"cropImage":{"type":"boolean","default":false},"customTitleFontSize":{"type":["string","number"]},"customTitleFontSizeTablet":{"type":["string","number"]},"customTitleFontSizeMobile":{"type":["string","number"]},"customDescriptionFontSize":{"type":["string","number"]},"customDescriptionFontSizeTablet":{"type":["string","number"]},"customDescriptionFontSizeMobile":{"type":["string","number"]},"customMetaFontSize":{"type":"string"},"customMetaFontSizeTablet":{"type":"string"},"customMetaFontSizeMobile":{"type":"string"},"textColor":{"type":"string"},"backgroundColor":{"type":"string"},"borderColor":{"type":"string"},"borderRadius":{"type":["number","object"]},"borderWidth":{"type":"string"},"cardBorderRadius":{"type":"object"},"boxShadow":{"type":"object","default":{"active":false,"colorOpacity":50,"blur":5,"spread":1,"horizontal":0,"vertical":0}},"imageBoxShadow":{"type":"object","default":{"active":false,"colorOpacity":50,"blur":5,"spread":1,"horizontal":0,"vertical":0}},"textAlign":{"type":"string"},"verticalAlign":{"type":"string"},"enableFeaturedPost":{"type":"boolean"},"imageWidth":{"type":["string","number"]},"imageWidthTablet":{"type":"string"},"imageWidthMobile":{"type":"string"},"columnGap":{"type":"string"},"columnGapTablet":{"type":"string"},"columnGapMobile":{"type":"string"},"rowGap":{"type":"string"},"rowGapTablet":{"type":"string"},"rowGapMobile":{"type":"string"},"padding":{"type":"string"},"paddingTablet":{"type":"string"},"paddingMobile":{"type":"string"},"contentGap":{"type":"string"}},"supports":{"align":["wide","full"],"html":false},"editorStyle":"otter-posts-grid-editor","style":"otter-posts-grid-style"}');const{attributes:ho}=go;var vo=[{attributes:{...ho,categories:{type:"string"}},supports:{align:["wide","full"],html:!1},migrate:e=>({...e,categories:[{id:Number(e.categories)}]}),isEligible:e=>{let{categories:t}=e;return t&&"string"==typeof t},save:()=>null}],yo=e=>{let{attributes:t,setAttributes:l}=e;const a=s.BlockVerticalAlignmentToolbar;return(0,i.createElement)(s.BlockControls,null,(0,i.createElement)(a,{label:(0,o.__)("Change Vertical Alignment","otter-blocks"),value:t.verticalAlign,onChange:e=>l({verticalAlign:e})}))},ko=l(454),fo=l.n(ko),_o=l(1286);const wo=(0,_o.W6)((()=>(0,i.createElement)("div",{className:"o-sortable-handle",tabIndex:"0"},(0,i.createElement)("span",null)))),Co={image:"displayFeaturedImage",category:"displayCategory",title:"displayTitle",meta:"displayMeta",description:"displayDescription"},Eo=e=>{var t,l;let{attributes:a,setAttributes:n,template:r,disabled:s}=e;const[d,u]=(0,i.useState)(!1),b=null==r?void 0:r.startsWith("custom_"),m=null==a||null===(t=a.customMetas)||void 0===t||null===(l=t.filter((e=>{let{id:t}=e;return t===r})))||void 0===l?void 0:l.pop(),p={image:a.displayFeaturedImage,category:a.displayCategory,title:a.displayTitle,meta:a.displayMeta,description:a.displayDescription},h=e=>{const t={...m,...e};n({customMetas:a.customMetas.map((e=>e.id===m.id?t:e))})},v=b?(0,Ie.applyFilters)("otter.postsBlock.panelLabel","",m):(0,K.startCase)((0,K.toLower)(r)),y=p[r]||(null==m?void 0:m.display),k=y?"visibility":"hidden";
2
  /* translators: %s Label */
3
  let f=(0,o.sprintf)((0,o.__)("Display %s","otter-blocks"),v);return y&&(
4
  /* translators: %s Label */
build/blocks/editor.css CHANGED
@@ -16,7 +16,7 @@
16
  .block-editor-block-inspector .o-background-selector-control{margin:0}.block-editor-block-inspector .o-background-selector-control .components-dropdown{width:100%}.block-editor-block-inspector .o-background-selector-control .components-dropdown .components-toolbar__control{box-shadow:inset 0 0 0 1px var(--wp-admin-theme-color);color:var(--wp-admin-theme-color);justify-content:center;outline:1px solid transparent;width:100%}
17
  .o-sync-control{border:1px solid #ccc;border-radius:5px;margin-bottom:10px;padding:5px 10px 8px}.o-sync-control legend{align-items:center;display:flex}.o-sync-control legend .components-toggle-control{margin:12px 6px}.o-sync-control legend .components-toggle-control .components-base-control__field{margin-bottom:0}.o-sync-control legend span.clickable{cursor:pointer;text-decoration:underline}.o-sync-control>.components-disabled{opacity:.5}.o-sync-control .components-base-control{margin-top:0}
18
  .o-style-switcher{grid-row-gap:5px;display:grid;grid-template-columns:50% 50%}.o-style-switcher .o-style-switcher-item{border-radius:4px;cursor:pointer;display:block;flex-basis:50%;height:auto;margin:0 4px;min-height:100px;min-width:100px;overflow:hidden;padding:5px}.o-style-switcher .o-style-switcher-item.is-active{box-shadow:0 0 0 2px #000}.o-style-switcher .o-style-switcher-item:hover{background:#f3f4f5}.o-style-switcher .o-style-switcher-item:focus{box-shadow:0 0 0 2px #00a0d2}.o-style-switcher .o-style-switcher-item .o-style-switcher-item-preview img{border:1px solid #dcddde;border-radius:5px}.o-style-switcher .o-style-switcher-item .o-style-switcher-item-label{text-align:center}.otter-styles-popover-content .components-popover__content{padding:20px}
19
- #o-feedback{padding:15px}#o-feedback.is-link{text-decoration:none}.o-feedback-modal-overlay{z-index:160001}.o-feedback-form .invalid textarea{border-color:#d63638;box-shadow:0 0 0 .5px #d63638;outline:2px solid transparent}.o-feedback-form .f-error p,.o-feedback-form .invalid p{color:#d63638}.o-feedback-form .buttons-wrap{display:flex;justify-content:space-between;margin-top:14px}.o-feedback-form .f-send{min-width:112px}.o-feedback-form .f-send>svg{margin:0 auto}.o-feedback-form .toggle-info{text-decoration:none}.o-feedback-form .info{color:#757575;height:0;overflow:hidden;transition:.2s ease-out}.o-feedback-form .info .wrapper{padding-bottom:3px}.o-feedback-form .info .wrapper>p{margin-top:0}.o-feedback-form .info-row{border-bottom:1px solid #cbcbcb;display:flex;justify-content:space-between}.o-feedback-form .info-row p{margin:6px 0!important}.o-feedback-modal{border-radius:10px;overflow:visible;width:490px}.o-feedback-modal.no-header .components-modal__content{margin-top:0;padding-top:24px}.o-feedback-modal.no-header .components-modal__content:before,.o-feedback-modal.no-header .components-modal__header{display:none}.o-feedback-modal .components-modal__header{border:none}.o-feedback-modal .components-modal__header-heading{font-size:20px;font-weight:400}.finish-feedback{text-align:center}.finish-feedback .f-title{font-size:23px;line-height:28px;margin:.5em 0}.finish-feedback .f-description{margin:0 auto 20px!important;width:60%}.finish-feedback button.f-done{padding:0 30px}
20
  .o-button-dropdown-control{border:1px solid rgba(0,0,0,.1);display:block;padding:0}.o-button-dropdown-control .o-button-dropdown-control-button{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:none;border:1px solid transparent;color:inherit;cursor:pointer;display:flex;height:46px;margin:0;padding:9.2px 12px;text-align:left;width:100%}.o-button-dropdown-control .o-button-dropdown-control-button.is-open{background:#f0f0f0;color:var(--wp-admin-theme-color)}.o-button-dropdown-control .o-button-dropdown-control-button .component-color-indicator{background:linear-gradient(-45deg,transparent 48%,#ddd 0,#ddd 52%,transparent 0);background-size:cover!important;margin-right:8px}.o-button-dropdown-control-content .components-popover__content{width:280px}@media(min-width:782px){.o-button-dropdown-control-content .components-popover__content{margin-top:-60px!important}}.o-button-dropdown-control-content .components-popover__content .block-editor-color-gradient-control__color-indicator{display:none}.o-button-dropdown-control-content .components-popover__content .block-editor-block-inspector{padding:10px}@media(min-width:782px){body:not(.branch-6-1) .o-button-dropdown-control-content .components-popover__content{margin-right:156px!important}}
21
  .o-images-grid-component{grid-column-gap:10px;grid-row-gap:10px;display:grid;grid-template-columns:auto auto auto}.o-images-grid-component.is-single{justify-content:start}.o-images-grid-component.is-single .o-images-grid-component__image{margin-right:5px}.o-images-grid-component .is-sorting{opacity:.25}.o-images-grid-component .components-button.is-primary{align-content:center;background:#d5dadf;border:none;border-radius:0;color:#fff;cursor:pointer;display:flex;height:75px;justify-content:center;width:75px}.o-images-grid-component .components-button.is-primary svg{color:#fff;height:36px;width:36px}.o-images-grid-component__image{background-position:50%;background-size:cover;box-shadow:0 0 0 1px rgba(0,0,0,.2);cursor:move;height:75px;overflow:visible;width:75px}.o-images-grid-component__image.is-selected{box-shadow:0 0 0 1px #fff,0 0 0 3px #007cba}.o-images-grid-component__image.is-selected:focus,.o-images-grid-component__image.is-selected:hover{box-shadow:0 0 0 1px #fff,0 0 0 3px #007cba!important}.o-images-grid-component__image:focus{background-blend-mode:luminosity}.o-images-grid-component__image .o-images-grid-component__image__count{align-items:center;background:#007cba;border:1px solid #fff;border-radius:100%;color:#fff;display:flex;height:25px;justify-content:center;left:50px;position:relative;top:-40px;width:25px}@media(min-width:540px)and (max-width:782px){.o-images-grid-component{grid-template-columns:auto auto auto auto auto auto}}
22
  .o-panel-tab{z-index:999999}.o-panel-tab .o-panel-tab__header{background:#fff;border:1px solid #d5dadf;display:flex}.o-panel-tab .o-panel-tab__header .o-panel-tab__header__label{align-items:center;cursor:default;display:flex;flex-basis:60%;padding-left:15px}.o-panel-tab .o-panel-tab__header .o-panel-tab__header__label::-moz-selection{background:none}.o-panel-tab .o-panel-tab__header .o-panel-tab__header__label::selection{background:none}.o-panel-tab .o-panel-tab__header .components-button{border-left:1px solid #d5dadf;border-radius:0;flex-basis:20%;height:auto;justify-content:center;padding:10px 5px}.o-panel-tab .o-panel-tab__header .components-button .dashicon{margin:2px}.o-panel-tab .o-panel-tab__header:hover{background:#fafafb}.o-panel-tab .o-panel-tab__content{background:#fff;border:1px solid #d5dadf;border-top:none;padding:10px 15px}.o-panel-tab .o-panel-tab__content .components-select-control label{overflow:visible;white-space:normal}.o-panel-tab .o-panel-tab__content .components-base-control{margin:12px 0}.o-panel-tab .o-panel-tab__content .components-base-control .components-dropdown{width:100%}.o-panel-tab .o-panel-tab__content .components-base-control .components-dropdown .components-button{display:flex;justify-content:center;width:100%}.o-panel-tab .o-panel-tab__content .components-base-control .components-datetime__time-field-hours-input{min-width:60px}.o-panel-tab .o-panel-tab__content .components-base-control .components-datetime__timezone{display:inline-block}
16
  .block-editor-block-inspector .o-background-selector-control{margin:0}.block-editor-block-inspector .o-background-selector-control .components-dropdown{width:100%}.block-editor-block-inspector .o-background-selector-control .components-dropdown .components-toolbar__control{box-shadow:inset 0 0 0 1px var(--wp-admin-theme-color);color:var(--wp-admin-theme-color);justify-content:center;outline:1px solid transparent;width:100%}
17
  .o-sync-control{border:1px solid #ccc;border-radius:5px;margin-bottom:10px;padding:5px 10px 8px}.o-sync-control legend{align-items:center;display:flex}.o-sync-control legend .components-toggle-control{margin:12px 6px}.o-sync-control legend .components-toggle-control .components-base-control__field{margin-bottom:0}.o-sync-control legend span.clickable{cursor:pointer;text-decoration:underline}.o-sync-control>.components-disabled{opacity:.5}.o-sync-control .components-base-control{margin-top:0}
18
  .o-style-switcher{grid-row-gap:5px;display:grid;grid-template-columns:50% 50%}.o-style-switcher .o-style-switcher-item{border-radius:4px;cursor:pointer;display:block;flex-basis:50%;height:auto;margin:0 4px;min-height:100px;min-width:100px;overflow:hidden;padding:5px}.o-style-switcher .o-style-switcher-item.is-active{box-shadow:0 0 0 2px #000}.o-style-switcher .o-style-switcher-item:hover{background:#f3f4f5}.o-style-switcher .o-style-switcher-item:focus{box-shadow:0 0 0 2px #00a0d2}.o-style-switcher .o-style-switcher-item .o-style-switcher-item-preview img{border:1px solid #dcddde;border-radius:5px}.o-style-switcher .o-style-switcher-item .o-style-switcher-item-label{text-align:center}.otter-styles-popover-content .components-popover__content{padding:20px}
19
+ #o-feedback{padding:15px}#o-feedback.is-link{text-decoration:none}.o-feedback-modal-overlay{z-index:999999999}.o-feedback-form .invalid textarea{border-color:#d63638;box-shadow:0 0 0 .5px #d63638;outline:2px solid transparent}.o-feedback-form .f-error p,.o-feedback-form .invalid p{color:#d63638}.o-feedback-form .buttons-wrap{display:flex;justify-content:space-between;margin-top:14px}.o-feedback-form .f-send{min-width:112px}.o-feedback-form .f-send>svg{margin:0 auto}.o-feedback-form .toggle-info{text-decoration:none}.o-feedback-form .info{color:#757575;height:0;overflow:hidden;transition:.2s ease-out}.o-feedback-form .info .wrapper{padding-bottom:3px}.o-feedback-form .info .wrapper>p{margin-top:0}.o-feedback-form .info-row{border-bottom:1px solid #cbcbcb;display:flex;justify-content:space-between}.o-feedback-form .info-row p{margin:6px 0!important}.o-feedback-modal{border-radius:10px;overflow:visible;width:490px}.o-feedback-modal.no-header .components-modal__content{margin-top:0;padding-top:24px}.o-feedback-modal.no-header .components-modal__content:before,.o-feedback-modal.no-header .components-modal__header{display:none}.o-feedback-modal .components-modal__header{border:none}.o-feedback-modal .components-modal__header-heading{font-size:20px;font-weight:400}.finish-feedback{text-align:center}.finish-feedback .f-title{font-size:23px;line-height:28px;margin:.5em 0}.finish-feedback .f-description{margin:0 auto 20px!important;width:60%}.finish-feedback button.f-done{padding:0 30px}
20
  .o-button-dropdown-control{border:1px solid rgba(0,0,0,.1);display:block;padding:0}.o-button-dropdown-control .o-button-dropdown-control-button{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:none;border:1px solid transparent;color:inherit;cursor:pointer;display:flex;height:46px;margin:0;padding:9.2px 12px;text-align:left;width:100%}.o-button-dropdown-control .o-button-dropdown-control-button.is-open{background:#f0f0f0;color:var(--wp-admin-theme-color)}.o-button-dropdown-control .o-button-dropdown-control-button .component-color-indicator{background:linear-gradient(-45deg,transparent 48%,#ddd 0,#ddd 52%,transparent 0);background-size:cover!important;margin-right:8px}.o-button-dropdown-control-content .components-popover__content{width:280px}@media(min-width:782px){.o-button-dropdown-control-content .components-popover__content{margin-top:-60px!important}}.o-button-dropdown-control-content .components-popover__content .block-editor-color-gradient-control__color-indicator{display:none}.o-button-dropdown-control-content .components-popover__content .block-editor-block-inspector{padding:10px}@media(min-width:782px){body:not(.branch-6-1) .o-button-dropdown-control-content .components-popover__content{margin-right:156px!important}}
21
  .o-images-grid-component{grid-column-gap:10px;grid-row-gap:10px;display:grid;grid-template-columns:auto auto auto}.o-images-grid-component.is-single{justify-content:start}.o-images-grid-component.is-single .o-images-grid-component__image{margin-right:5px}.o-images-grid-component .is-sorting{opacity:.25}.o-images-grid-component .components-button.is-primary{align-content:center;background:#d5dadf;border:none;border-radius:0;color:#fff;cursor:pointer;display:flex;height:75px;justify-content:center;width:75px}.o-images-grid-component .components-button.is-primary svg{color:#fff;height:36px;width:36px}.o-images-grid-component__image{background-position:50%;background-size:cover;box-shadow:0 0 0 1px rgba(0,0,0,.2);cursor:move;height:75px;overflow:visible;width:75px}.o-images-grid-component__image.is-selected{box-shadow:0 0 0 1px #fff,0 0 0 3px #007cba}.o-images-grid-component__image.is-selected:focus,.o-images-grid-component__image.is-selected:hover{box-shadow:0 0 0 1px #fff,0 0 0 3px #007cba!important}.o-images-grid-component__image:focus{background-blend-mode:luminosity}.o-images-grid-component__image .o-images-grid-component__image__count{align-items:center;background:#007cba;border:1px solid #fff;border-radius:100%;color:#fff;display:flex;height:25px;justify-content:center;left:50px;position:relative;top:-40px;width:25px}@media(min-width:540px)and (max-width:782px){.o-images-grid-component{grid-template-columns:auto auto auto auto auto auto}}
22
  .o-panel-tab{z-index:999999}.o-panel-tab .o-panel-tab__header{background:#fff;border:1px solid #d5dadf;display:flex}.o-panel-tab .o-panel-tab__header .o-panel-tab__header__label{align-items:center;cursor:default;display:flex;flex-basis:60%;padding-left:15px}.o-panel-tab .o-panel-tab__header .o-panel-tab__header__label::-moz-selection{background:none}.o-panel-tab .o-panel-tab__header .o-panel-tab__header__label::selection{background:none}.o-panel-tab .o-panel-tab__header .components-button{border-left:1px solid #d5dadf;border-radius:0;flex-basis:20%;height:auto;justify-content:center;padding:10px 5px}.o-panel-tab .o-panel-tab__header .components-button .dashicon{margin:2px}.o-panel-tab .o-panel-tab__header:hover{background:#fafafb}.o-panel-tab .o-panel-tab__content{background:#fff;border:1px solid #d5dadf;border-top:none;padding:10px 15px}.o-panel-tab .o-panel-tab__content .components-select-control label{overflow:visible;white-space:normal}.o-panel-tab .o-panel-tab__content .components-base-control{margin:12px 0}.o-panel-tab .o-panel-tab__content .components-base-control .components-dropdown{width:100%}.o-panel-tab .o-panel-tab__content .components-base-control .components-dropdown .components-button{display:flex;justify-content:center;width:100%}.o-panel-tab .o-panel-tab__content .components-base-control .components-datetime__time-field-hours-input{min-width:60px}.o-panel-tab .o-panel-tab__content .components-base-control .components-datetime__timezone{display:inline-block}
build/blocks/lottie/block.json CHANGED
@@ -52,6 +52,5 @@
52
  "align": [ "left", "center", "right" ]
53
  },
54
  "editorStyle": "otter-lottie-editor",
55
- "editorScript": [ "lottie-player", "dotlottie-player" ],
56
  "script": "otter-lottie"
57
  }
52
  "align": [ "left", "center", "right" ]
53
  },
54
  "editorStyle": "otter-lottie-editor",
 
55
  "script": "otter-lottie"
56
  }
build/dashboard/index.asset.php CHANGED
@@ -1 +1 @@
1
- <?php return array('dependencies' => array('lodash', 'wp-api', 'wp-api-fetch', 'wp-components', 'wp-data', 'wp-date', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-notices', 'wp-primitives'), 'version' => '833087476f2b3d3d775c');
1
+ <?php return array('dependencies' => array('lodash', 'wp-api', 'wp-api-fetch', 'wp-components', 'wp-data', 'wp-date', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-notices', 'wp-primitives'), 'version' => 'df74673bca66d590f16c');
build/dashboard/index.css CHANGED
@@ -1 +1 @@
1
- #o-feedback{padding:15px}#o-feedback.is-link{text-decoration:none}.o-feedback-modal-overlay{z-index:160001}.o-feedback-form .invalid textarea{border-color:#d63638;box-shadow:0 0 0 .5px #d63638;outline:2px solid transparent}.o-feedback-form .f-error p,.o-feedback-form .invalid p{color:#d63638}.o-feedback-form .buttons-wrap{display:flex;justify-content:space-between;margin-top:14px}.o-feedback-form .f-send{min-width:112px}.o-feedback-form .f-send>svg{margin:0 auto}.o-feedback-form .toggle-info{text-decoration:none}.o-feedback-form .info{color:#757575;height:0;overflow:hidden;transition:.2s ease-out}.o-feedback-form .info .wrapper{padding-bottom:3px}.o-feedback-form .info .wrapper>p{margin-top:0}.o-feedback-form .info-row{border-bottom:1px solid #cbcbcb;display:flex;justify-content:space-between}.o-feedback-form .info-row p{margin:6px 0!important}.o-feedback-modal{border-radius:10px;overflow:visible;width:490px}.o-feedback-modal.no-header .components-modal__content{margin-top:0;padding-top:24px}.o-feedback-modal.no-header .components-modal__content:before,.o-feedback-modal.no-header .components-modal__header{display:none}.o-feedback-modal .components-modal__header{border:none}.o-feedback-modal .components-modal__header-heading{font-size:20px;font-weight:400}.finish-feedback{text-align:center}.finish-feedback .f-title{font-size:23px;line-height:28px;margin:.5em 0}.finish-feedback .f-description{margin:0 auto 20px!important;width:60%}.finish-feedback button.f-done{padding:0 30px}
1
+ #o-feedback{padding:15px}#o-feedback.is-link{text-decoration:none}.o-feedback-modal-overlay{z-index:999999999}.o-feedback-form .invalid textarea{border-color:#d63638;box-shadow:0 0 0 .5px #d63638;outline:2px solid transparent}.o-feedback-form .f-error p,.o-feedback-form .invalid p{color:#d63638}.o-feedback-form .buttons-wrap{display:flex;justify-content:space-between;margin-top:14px}.o-feedback-form .f-send{min-width:112px}.o-feedback-form .f-send>svg{margin:0 auto}.o-feedback-form .toggle-info{text-decoration:none}.o-feedback-form .info{color:#757575;height:0;overflow:hidden;transition:.2s ease-out}.o-feedback-form .info .wrapper{padding-bottom:3px}.o-feedback-form .info .wrapper>p{margin-top:0}.o-feedback-form .info-row{border-bottom:1px solid #cbcbcb;display:flex;justify-content:space-between}.o-feedback-form .info-row p{margin:6px 0!important}.o-feedback-modal{border-radius:10px;overflow:visible;width:490px}.o-feedback-modal.no-header .components-modal__content{margin-top:0;padding-top:24px}.o-feedback-modal.no-header .components-modal__content:before,.o-feedback-modal.no-header .components-modal__header{display:none}.o-feedback-modal .components-modal__header{border:none}.o-feedback-modal .components-modal__header-heading{font-size:20px;font-weight:400}.finish-feedback{text-align:center}.finish-feedback .f-title{font-size:23px;line-height:28px;margin:.5em 0}.finish-feedback .f-description{margin:0 auto 20px!important;width:60%}.finish-feedback button.f-done{padding:0 30px}
build/dashboard/style-index.css CHANGED
@@ -1 +1 @@
1
- #o-feedback{padding:15px}#o-feedback.is-link{text-decoration:none}.o-feedback-modal-overlay{z-index:160001}.o-feedback-form .invalid textarea{border-color:#d63638;box-shadow:0 0 0 .5px #d63638;outline:2px solid transparent}.o-feedback-form .f-error p,.o-feedback-form .invalid p{color:#d63638}.o-feedback-form .buttons-wrap{display:flex;justify-content:space-between;margin-top:14px}.o-feedback-form .f-send{min-width:112px}.o-feedback-form .f-send>svg{margin:0 auto}.o-feedback-form .toggle-info{text-decoration:none}.o-feedback-form .info{color:#757575;height:0;overflow:hidden;transition:.2s ease-out}.o-feedback-form .info .wrapper{padding-bottom:3px}.o-feedback-form .info .wrapper>p{margin-top:0}.o-feedback-form .info-row{border-bottom:1px solid #cbcbcb;display:flex;justify-content:space-between}.o-feedback-form .info-row p{margin:6px 0!important}.o-feedback-modal{border-radius:10px;overflow:visible;width:490px}.o-feedback-modal.no-header .components-modal__content{margin-top:0;padding-top:24px}.o-feedback-modal.no-header .components-modal__content:before,.o-feedback-modal.no-header .components-modal__header{display:none}.o-feedback-modal .components-modal__header{border:none}.o-feedback-modal .components-modal__header-heading{font-size:20px;font-weight:400}.finish-feedback{text-align:center}.finish-feedback .f-title{font-size:23px;line-height:28px;margin:.5em 0}.finish-feedback .f-description{margin:0 auto 20px!important;width:60%}.finish-feedback button.f-done{padding:0 30px}*{box-sizing:inherit}.settings_page_otter{background:#f6f6f6;box-sizing:border-box;font-family:Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif;font-size:14px;position:relative}#wpcontent,.auto-fold #wpcontent{padding-left:0}#otter .components-button.is-primary{--wp-admin-theme-color:#ed6f57;--wp-admin-theme-color-darker-20:#d5654f;--wp-admin-theme-color-darker-10:#dd6851}#otter .otter-header{background-color:#fff;box-shadow:0 1px 0 hsla(0,0%,84%,.5),0 1px 2px #eee;padding:20px 10px 0}#otter .otter-header .otter-container{margin:0 auto;max-width:100%;max-width:930px}#otter .otter-header .otter-container .otter-logo{align-items:center;display:flex;justify-content:space-between}#otter .otter-header .otter-container .otter-logo img{max-width:200px}#otter .otter-header .otter-container .otter-logo .version{background-color:#e5e5e5;border-radius:3px;font-size:.8em;font-weight:400;margin-left:10px;padding:2px 7px}@media(max-width:960px){#otter .otter-header .otter-container .otter-logo{justify-content:center}}#otter .otter-header .otter-container .otter-navigation{display:flex;flex-wrap:wrap;font-size:15px;font-weight:600;line-height:1.5;list-style:none;padding-top:25px;text-decoration:none}@media(max-width:960px){#otter .otter-header .otter-container .otter-navigation{flex-direction:column;justify-content:center}}#otter .otter-header .otter-container .otter-navigation button{background:none;border:0;cursor:pointer;display:inline-flex;margin:0}#otter .otter-header .otter-container .otter-navigation button.is-active{border-bottom:4px solid #1e7db2}#otter .otter-header .otter-container .otter-navigation button.is-active span{color:#282828;cursor:default}@media(max-width:960px){#otter .otter-header .otter-container .otter-navigation button.is-active{border-bottom:0;border-left:4px solid #1e7db2}}#otter .otter-header .otter-container .otter-navigation button span{color:#868686;cursor:pointer;font-family:Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif;font-size:21px;font-weight:400;letter-spacing:0;line-height:25px;padding:0 16px 16px;text-decoration:none}@media(max-width:960px){#otter .otter-header .otter-container .otter-navigation button span{padding:10px}#otter .otter-header .otter-container .otter-navigation button{justify-content:center;width:100%}}#otter .otter-main{display:grid;gap:25px;grid-template-columns:2fr 1fr;margin-left:auto;margin-right:auto;max-width:930px}#otter .otter-main.is-upsell{grid-template-columns:auto}#otter .otter-main.is-feedback .components-panel__body{height:-moz-max-content;height:max-content}@media(max-width:960px){#otter .otter-main{grid-template-columns:auto}}#otter .otter-main .components-panel__body{background:#fff;border:1px solid #e2e4e7;border-radius:10px;margin:25px 0}#otter .otter-main .components-panel__body .components-panel__body-toggle{border-bottom:1px solid #d6e2ed}#otter .otter-main .components-panel__body .components-panel__body-toggle:hover{border-bottom:1px solid #d6e2ed!important}#otter .otter-main .components-panel__body.is-pro .components-panel__body-title .components-button{display:flex;flex-direction:row-reverse;justify-content:flex-end}#otter .otter-main .components-panel__body.is-pro .components-panel__body-title span:after{background:#1e7db3;border-radius:2px;color:#fff;content:"Pro";font-size:8px;margin-left:10px;padding:4px 6px;position:relative;text-transform:uppercase;top:-1px}#otter .otter-main .components-panel__body .otter-info .otter-license-footer{align-items:center;display:flex;gap:10px;margin-top:20px}#otter .otter-main .components-panel__body .otter-info .otter-license-footer.is-expired{align-items:flex-start;flex-direction:column}#otter .otter-main .components-panel__body .otter-info .otter-license-footer .dashicon{align-items:center;background:#6eb77a;border-radius:50%;color:#fff;display:inline-flex;justify-content:center;margin-right:10px;padding:2px}#otter .otter-main .components-panel__body .otter-info .otter-license-footer p{margin:0}#otter .otter-main .components-panel__body .otter-info .otter-license-purchase-history{margin:10px 0 0}#otter .otter-main .components-panel__body input[type=password],#otter .otter-main .components-panel__body input[type=text]{border:1px solid #b7c9d9;border-radius:3px;box-shadow:none;color:#444;font-size:14px;height:40px;margin:0 0 10px;padding:9px 15px;width:100%}#otter .otter-main .components-panel__body input[type=password]:disabled,#otter .otter-main .components-panel__body input[type=text]:disabled{background:#f6f6f6;border-color:#eee;color:#bbb}#otter .otter-main .components-panel__body input[type=password]:focus,#otter .otter-main .components-panel__body input[type=text]:focus{border-color:#00a0d2;box-shadow:0 0 0 1px #00a0d2;outline:2px solid transparent;outline-offset:-2px}#otter .otter-main .components-panel__body .components-panel__row{margin:0;padding:10px}#otter .otter-main .components-panel__body .components-panel__row:first-of-type{padding-top:20px}#otter .otter-main .components-panel__body .components-panel__row .components-base-control .components-base-control__field{align-items:center;display:flex;margin-bottom:10px}#otter .otter-main .components-panel__body .components-panel__row .components-base-control.otter-button-field{width:100%}#otter .otter-main .components-panel__body .components-panel__row .components-base-control.otter-button-field .components-base-control__field{display:block}#otter .otter-main .components-panel__body .components-panel__row .components-base-control.otter-button-field .components-base-control__field .components-base-control__label{font-weight:600;margin-bottom:10px}#otter .otter-main .components-panel__body .components-panel__row .components-base-control.otter-button-field .components-base-control__field .otter-button-group{align-items:center;display:flex;margin:2px 0 15px}#otter .otter-main .components-panel__body .components-panel__row .components-base-control.otter-button-field .components-base-control__field .otter-button-group .is-secondary{font-size:14px;margin-right:10px;padding:2px 20px}#otter .otter-main .components-panel__body .otter-info{padding:0 10px 10px}#otter .otter-main .components-panel__body .otter-info h3{font-weight:400;margin:1em 0 25px}#otter .otter-main .components-panel__body .otter-info p{margin:0 0 1.5em}#otter .otter-main .components-panel__body .otter-info .otter-info-links li{margin-bottom:15px}#otter .otter-main .components-panel__body .otter-info .otter-info-links a{color:#2271b1;text-decoration:none}#otter .otter-main .components-panel__body .otter-info .otter-info-button-group{display:flex}#otter .otter-main .components-panel__body .otter-info .otter-info-button-group.is-single{display:grid}#otter .otter-main .components-panel__body .otter-info .otter-info-button-group .components-button{justify-content:center}#otter .otter-main .components-panel__body .otter-info .otter-info-button-group .is-default,#otter .otter-main .components-panel__body .otter-info .otter-info-button-group .is-secondary{font-size:14px;padding:2px 20px}#otter .otter-main .components-panel__body .otter-info .otter-info-button-group .is-default:not(:last-child),#otter .otter-main .components-panel__body .otter-info .otter-info-button-group .is-secondary:not(:last-child){margin-right:15px}#otter .otter-main .otter-upsell .upsell-title{padding:20px 0 0}#otter .otter-main .otter-upsell .upsell-title h2{font-size:28px;font-weight:500;line-height:normal}#otter .otter-main .otter-upsell .upsell-table{list-style:none;margin:30px 0;padding:0}#otter .otter-main .otter-upsell .upsell-table li{background:#fff;border-bottom:1px solid #d9d9d9;display:grid;grid-template-columns:5fr 1fr 1fr;margin:0!important}#otter .otter-main .otter-upsell .upsell-table li:nth-child(odd){background:#f6f6f6}#otter .otter-main .otter-upsell .upsell-table .t-head{color:#30436e;font-size:25px;padding:20px 0}#otter .otter-main .otter-upsell .upsell-table .t-row{border-left:1px solid #d9d9d9;border-right:1px solid #d9d9d9}#otter .otter-main .otter-upsell .upsell-table .t-row .c{border-left:1px solid #d9d9d9}#otter .otter-main .otter-upsell .upsell-table .c{align-items:center;color:#757575;display:flex;justify-content:center}#otter .otter-main .otter-upsell .upsell-table .content{color:#757575;padding:20px 40px}#otter .otter-main .otter-upsell .upsell-table .content p{margin:10px 0}#otter .otter-main .otter-upsell .upsell-table .h-wrap{align-items:center;display:flex}#otter .otter-main .otter-upsell .upsell-table .h-wrap h4{color:#313233;font-size:20px;font-weight:500;line-height:1.2;margin:10px 0}#otter .otter-main .otter-upsell .components-button{font-size:1.2em;justify-content:center;padding:30px;width:100%}#otter .otter-main .notice-card{grid-column-gap:25px;color:#757575;display:grid;font-size:13px;grid-column:1/3;grid-template-columns:minmax(65px,1fr) auto 2fr;margin:25px 0 -25px;padding:25px;place-items:center;position:relative}#otter .otter-main .notice-card .notice-text:first-child{font-size:32px;font-weight:600}#otter .otter-main .notice-card .dismiss{color:#ccc;padding:6px;position:absolute;right:2px;top:2px}#otter .otter-footer{border-bottom:1px solid #e1e1e1;border-top:1px solid #e1e1e1;color:#72777c;font-style:italic;margin:2rem 0 1.5rem;padding:20px;text-align:center}#otter .otter-footer .otter-container{margin:0 auto}#otter .components-placeholder{background:#f6f6f6;box-shadow:none;margin-bottom:25vh;margin-top:25vh}#otter .components-placeholder .components-placeholder__fieldset{justify-content:center}.otter-button-control .components-base-control_labels .components-base-control__label{font-weight:600;margin-bottom:10px}.otter-button-control .otter-button-control-group .components-button{font-size:14px;margin-right:10px;padding:2px 20px}.otter-modal-actions{display:flex;justify-content:flex-end;margin-top:10px}.otter-modal-actions .components-button{font-size:14px;margin-right:10px;padding:2px 20px}.otter-modal-actions .components-button:last-child{margin:0}.components-modal__screen-overlay{background-color:rgba(0,0,0,.5)}.components-editor-notices__snackbar{bottom:40px;padding-left:16px;padding-right:16px;position:fixed}.otter-bf-banner{margin:25px auto 0;max-width:930px;position:relative}.otter-bf-banner img{width:100%}.otter-bf-banner a:focus{box-shadow:none}.otter-bf-banner .otter-bf-text{background:#1f2733;border-radius:6px;margin:8px 10px;position:absolute;right:0;top:0}.otter-bf-banner .otter-bf-text h3{color:#fff;font-size:13px;margin:0;padding:10px 12px;text-transform:uppercase}.otter-bf-banner .otter-bf-text h3 span{color:#ffcb7c}@media(max-width:600px){.otter-bf-banner .otter-bf-text{margin:4px 5px}.otter-bf-banner .otter-bf-text h3{font-size:8px;padding:0 8px}}
1
+ #o-feedback{padding:15px}#o-feedback.is-link{text-decoration:none}.o-feedback-modal-overlay{z-index:999999999}.o-feedback-form .invalid textarea{border-color:#d63638;box-shadow:0 0 0 .5px #d63638;outline:2px solid transparent}.o-feedback-form .f-error p,.o-feedback-form .invalid p{color:#d63638}.o-feedback-form .buttons-wrap{display:flex;justify-content:space-between;margin-top:14px}.o-feedback-form .f-send{min-width:112px}.o-feedback-form .f-send>svg{margin:0 auto}.o-feedback-form .toggle-info{text-decoration:none}.o-feedback-form .info{color:#757575;height:0;overflow:hidden;transition:.2s ease-out}.o-feedback-form .info .wrapper{padding-bottom:3px}.o-feedback-form .info .wrapper>p{margin-top:0}.o-feedback-form .info-row{border-bottom:1px solid #cbcbcb;display:flex;justify-content:space-between}.o-feedback-form .info-row p{margin:6px 0!important}.o-feedback-modal{border-radius:10px;overflow:visible;width:490px}.o-feedback-modal.no-header .components-modal__content{margin-top:0;padding-top:24px}.o-feedback-modal.no-header .components-modal__content:before,.o-feedback-modal.no-header .components-modal__header{display:none}.o-feedback-modal .components-modal__header{border:none}.o-feedback-modal .components-modal__header-heading{font-size:20px;font-weight:400}.finish-feedback{text-align:center}.finish-feedback .f-title{font-size:23px;line-height:28px;margin:.5em 0}.finish-feedback .f-description{margin:0 auto 20px!important;width:60%}.finish-feedback button.f-done{padding:0 30px}*{box-sizing:inherit}.settings_page_otter{background:#f6f6f6;box-sizing:border-box;font-family:Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif;font-size:14px;position:relative}#wpcontent,.auto-fold #wpcontent{padding-left:0}#otter .components-button.is-primary{--wp-admin-theme-color:#ed6f57;--wp-admin-theme-color-darker-20:#d5654f;--wp-admin-theme-color-darker-10:#dd6851}#otter .otter-header{background-color:#fff;box-shadow:0 1px 0 hsla(0,0%,84%,.5),0 1px 2px #eee;padding:20px 10px 0}#otter .otter-header .otter-container{margin:0 auto;max-width:100%;max-width:930px}#otter .otter-header .otter-container .otter-logo{align-items:center;display:flex;justify-content:space-between}#otter .otter-header .otter-container .otter-logo img{max-width:200px}#otter .otter-header .otter-container .otter-logo .version{background-color:#e5e5e5;border-radius:3px;font-size:.8em;font-weight:400;margin-left:10px;padding:2px 7px}@media(max-width:960px){#otter .otter-header .otter-container .otter-logo{justify-content:center}}#otter .otter-header .otter-container .otter-navigation{display:flex;flex-wrap:wrap;font-size:15px;font-weight:600;line-height:1.5;list-style:none;padding-top:25px;text-decoration:none}@media(max-width:960px){#otter .otter-header .otter-container .otter-navigation{flex-direction:column;justify-content:center}}#otter .otter-header .otter-container .otter-navigation button{background:none;border:0;cursor:pointer;display:inline-flex;margin:0}#otter .otter-header .otter-container .otter-navigation button.is-active{border-bottom:4px solid #1e7db2}#otter .otter-header .otter-container .otter-navigation button.is-active span{color:#282828;cursor:default}@media(max-width:960px){#otter .otter-header .otter-container .otter-navigation button.is-active{border-bottom:0;border-left:4px solid #1e7db2}}#otter .otter-header .otter-container .otter-navigation button span{color:#868686;cursor:pointer;font-family:Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif;font-size:21px;font-weight:400;letter-spacing:0;line-height:25px;padding:0 16px 16px;text-decoration:none}@media(max-width:960px){#otter .otter-header .otter-container .otter-navigation button span{padding:10px}#otter .otter-header .otter-container .otter-navigation button{justify-content:center;width:100%}}#otter .otter-main{display:grid;gap:25px;grid-template-columns:2fr 1fr;margin-left:auto;margin-right:auto;max-width:930px}#otter .otter-main.is-upsell{grid-template-columns:auto}#otter .otter-main.is-feedback .components-panel__body{height:-moz-max-content;height:max-content}@media(max-width:960px){#otter .otter-main{grid-template-columns:auto}}#otter .otter-main .components-panel__body{background:#fff;border:1px solid #e2e4e7;border-radius:10px;margin:25px 0}#otter .otter-main .components-panel__body .components-panel__body-toggle{border-bottom:1px solid #d6e2ed}#otter .otter-main .components-panel__body .components-panel__body-toggle:hover{border-bottom:1px solid #d6e2ed!important}#otter .otter-main .components-panel__body.is-pro .components-panel__body-title .components-button{display:flex;flex-direction:row-reverse;justify-content:flex-end}#otter .otter-main .components-panel__body.is-pro .components-panel__body-title span:after{background:#1e7db3;border-radius:2px;color:#fff;content:"Pro";font-size:8px;margin-left:10px;padding:4px 6px;position:relative;text-transform:uppercase;top:-1px}#otter .otter-main .components-panel__body .otter-info .otter-license-footer{align-items:center;display:flex;gap:10px;margin-top:20px}#otter .otter-main .components-panel__body .otter-info .otter-license-footer.is-expired{align-items:flex-start;flex-direction:column}#otter .otter-main .components-panel__body .otter-info .otter-license-footer .dashicon{align-items:center;background:#6eb77a;border-radius:50%;color:#fff;display:inline-flex;justify-content:center;margin-right:10px;padding:2px}#otter .otter-main .components-panel__body .otter-info .otter-license-footer p{margin:0}#otter .otter-main .components-panel__body .otter-info .otter-license-purchase-history{margin:10px 0 0}#otter .otter-main .components-panel__body input[type=password],#otter .otter-main .components-panel__body input[type=text]{border:1px solid #b7c9d9;border-radius:3px;box-shadow:none;color:#444;font-size:14px;height:40px;margin:0 0 10px;padding:9px 15px;width:100%}#otter .otter-main .components-panel__body input[type=password]:disabled,#otter .otter-main .components-panel__body input[type=text]:disabled{background:#f6f6f6;border-color:#eee;color:#bbb}#otter .otter-main .components-panel__body input[type=password]:focus,#otter .otter-main .components-panel__body input[type=text]:focus{border-color:#00a0d2;box-shadow:0 0 0 1px #00a0d2;outline:2px solid transparent;outline-offset:-2px}#otter .otter-main .components-panel__body .components-panel__row{margin:0;padding:10px}#otter .otter-main .components-panel__body .components-panel__row:first-of-type{padding-top:20px}#otter .otter-main .components-panel__body .components-panel__row .components-base-control .components-base-control__field{align-items:center;display:flex;margin-bottom:10px}#otter .otter-main .components-panel__body .components-panel__row .components-base-control.otter-button-field{width:100%}#otter .otter-main .components-panel__body .components-panel__row .components-base-control.otter-button-field .components-base-control__field{display:block}#otter .otter-main .components-panel__body .components-panel__row .components-base-control.otter-button-field .components-base-control__field .components-base-control__label{font-weight:600;margin-bottom:10px}#otter .otter-main .components-panel__body .components-panel__row .components-base-control.otter-button-field .components-base-control__field .otter-button-group{align-items:center;display:flex;margin:2px 0 15px}#otter .otter-main .components-panel__body .components-panel__row .components-base-control.otter-button-field .components-base-control__field .otter-button-group .is-secondary{font-size:14px;margin-right:10px;padding:2px 20px}#otter .otter-main .components-panel__body .otter-info{padding:0 10px 10px}#otter .otter-main .components-panel__body .otter-info h3{font-weight:400;margin:1em 0 25px}#otter .otter-main .components-panel__body .otter-info p{margin:0 0 1.5em}#otter .otter-main .components-panel__body .otter-info .otter-info-links li{margin-bottom:15px}#otter .otter-main .components-panel__body .otter-info .otter-info-links a{color:#2271b1;text-decoration:none}#otter .otter-main .components-panel__body .otter-info .otter-info-button-group{display:flex}#otter .otter-main .components-panel__body .otter-info .otter-info-button-group.is-single{display:grid}#otter .otter-main .components-panel__body .otter-info .otter-info-button-group .components-button{justify-content:center}#otter .otter-main .components-panel__body .otter-info .otter-info-button-group .is-default,#otter .otter-main .components-panel__body .otter-info .otter-info-button-group .is-secondary{font-size:14px;padding:2px 20px}#otter .otter-main .components-panel__body .otter-info .otter-info-button-group .is-default:not(:last-child),#otter .otter-main .components-panel__body .otter-info .otter-info-button-group .is-secondary:not(:last-child){margin-right:15px}#otter .otter-main .otter-upsell .upsell-title{padding:20px 0 0}#otter .otter-main .otter-upsell .upsell-title h2{font-size:28px;font-weight:500;line-height:normal}#otter .otter-main .otter-upsell .upsell-table{list-style:none;margin:30px 0;padding:0}#otter .otter-main .otter-upsell .upsell-table li{background:#fff;border-bottom:1px solid #d9d9d9;display:grid;grid-template-columns:5fr 1fr 1fr;margin:0!important}#otter .otter-main .otter-upsell .upsell-table li:nth-child(odd){background:#f6f6f6}#otter .otter-main .otter-upsell .upsell-table .t-head{color:#30436e;font-size:25px;padding:20px 0}#otter .otter-main .otter-upsell .upsell-table .t-row{border-left:1px solid #d9d9d9;border-right:1px solid #d9d9d9}#otter .otter-main .otter-upsell .upsell-table .t-row .c{border-left:1px solid #d9d9d9}#otter .otter-main .otter-upsell .upsell-table .c{align-items:center;color:#757575;display:flex;justify-content:center}#otter .otter-main .otter-upsell .upsell-table .content{color:#757575;padding:20px 40px}#otter .otter-main .otter-upsell .upsell-table .content p{margin:10px 0}#otter .otter-main .otter-upsell .upsell-table .h-wrap{align-items:center;display:flex}#otter .otter-main .otter-upsell .upsell-table .h-wrap h4{color:#313233;font-size:20px;font-weight:500;line-height:1.2;margin:10px 0}#otter .otter-main .otter-upsell .components-button{font-size:1.2em;justify-content:center;padding:30px;width:100%}#otter .otter-main .notice-card{grid-column-gap:25px;color:#757575;display:grid;font-size:13px;grid-column:1/3;grid-template-columns:minmax(65px,1fr) auto 2fr;margin:25px 0 -25px;padding:25px;place-items:center;position:relative}#otter .otter-main .notice-card .notice-text:first-child{font-size:32px;font-weight:600}#otter .otter-main .notice-card .dismiss{color:#ccc;padding:6px;position:absolute;right:2px;top:2px}#otter .otter-footer{border-bottom:1px solid #e1e1e1;border-top:1px solid #e1e1e1;color:#72777c;font-style:italic;margin:2rem 0 1.5rem;padding:20px;text-align:center}#otter .otter-footer .otter-container{margin:0 auto}#otter .components-placeholder{background:#f6f6f6;box-shadow:none;margin-bottom:25vh;margin-top:25vh}#otter .components-placeholder .components-placeholder__fieldset{justify-content:center}.otter-button-control .components-base-control_labels .components-base-control__label{font-weight:600;margin-bottom:10px}.otter-button-control .otter-button-control-group .components-button{font-size:14px;margin-right:10px;padding:2px 20px}.otter-modal-actions{display:flex;justify-content:flex-end;margin-top:10px}.otter-modal-actions .components-button{font-size:14px;margin-right:10px;padding:2px 20px}.otter-modal-actions .components-button:last-child{margin:0}.components-modal__screen-overlay{background-color:rgba(0,0,0,.5)}.components-editor-notices__snackbar{bottom:40px;padding-left:16px;padding-right:16px;position:fixed}.otter-bf-banner{margin:25px auto 0;max-width:930px;position:relative}.otter-bf-banner img{width:100%}.otter-bf-banner a:focus{box-shadow:none}.otter-bf-banner .otter-bf-text{background:#1f2733;border-radius:6px;margin:8px 10px;position:absolute;right:0;top:0}.otter-bf-banner .otter-bf-text h3{color:#fff;font-size:13px;margin:0;padding:10px 12px;text-transform:uppercase}.otter-bf-banner .otter-bf-text h3 span{color:#ffcb7c}@media(max-width:600px){.otter-bf-banner .otter-bf-text{margin:4px 5px}.otter-bf-banner .otter-bf-text h3{font-size:8px;padding:0 8px}}
otter-blocks.php CHANGED
@@ -7,7 +7,7 @@
7
  * Plugin Name: Otter – Page Builder Blocks & Extensions for Gutenberg
8
  * Plugin URI: https://themeisle.com/plugins/otter-blocks
9
  * Description: Create beautiful and attracting posts, pages, and landing pages with Otter – Page Builder Blocks & Extensions for Gutenberg. Otter comes with dozens of Gutenberg blocks that are all you need to build beautiful pages.
10
- * Version: 2.1.2
11
  * Author: ThemeIsle
12
  * Author URI: https://themeisle.com
13
  * License: GPL-2.0+
@@ -26,7 +26,7 @@ if ( ! defined( 'WPINC' ) ) {
26
  define( 'OTTER_BLOCKS_BASEFILE', __FILE__ );
27
  define( 'OTTER_BLOCKS_URL', plugins_url( '/', __FILE__ ) );
28
  define( 'OTTER_BLOCKS_PATH', dirname( __FILE__ ) );
29
- define( 'OTTER_BLOCKS_VERSION', '2.1.2' );
30
  define( 'OTTER_BLOCKS_PRO_SUPPORT', true );
31
  define( 'OTTER_BLOCKS_SHOW_NOTICES', false );
32
 
7
  * Plugin Name: Otter – Page Builder Blocks & Extensions for Gutenberg
8
  * Plugin URI: https://themeisle.com/plugins/otter-blocks
9
  * Description: Create beautiful and attracting posts, pages, and landing pages with Otter – Page Builder Blocks & Extensions for Gutenberg. Otter comes with dozens of Gutenberg blocks that are all you need to build beautiful pages.
10
+ * Version: 2.1.3
11
  * Author: ThemeIsle
12
  * Author URI: https://themeisle.com
13
  * License: GPL-2.0+
26
  define( 'OTTER_BLOCKS_BASEFILE', __FILE__ );
27
  define( 'OTTER_BLOCKS_URL', plugins_url( '/', __FILE__ ) );
28
  define( 'OTTER_BLOCKS_PATH', dirname( __FILE__ ) );
29
+ define( 'OTTER_BLOCKS_VERSION', '2.1.3' );
30
  define( 'OTTER_BLOCKS_PRO_SUPPORT', true );
31
  define( 'OTTER_BLOCKS_SHOW_NOTICES', false );
32
 
readme.md CHANGED
@@ -208,6 +208,13 @@ You can check Otter documentation [here](https://docs.themeisle.com/article/1478
208
 
209
  ## Changelog ##
210
 
 
 
 
 
 
 
 
211
  ##### [Version 2.1.2](https://github.com/Codeinwp/otter-blocks/compare/v2.1.1...v2.1.2) (2022-11-09)
212
 
213
  - Section Enhancements
208
 
209
  ## Changelog ##
210
 
211
+ ##### [Version 2.1.3](https://github.com/Codeinwp/otter-blocks/compare/v2.1.2...v2.1.3) (2022-11-10)
212
+
213
+ - Fixed a crash issue for users with PHP8.0 & PHP8.1 with WP version lower than 6.1
214
+
215
+
216
+
217
+
218
  ##### [Version 2.1.2](https://github.com/Codeinwp/otter-blocks/compare/v2.1.1...v2.1.2) (2022-11-09)
219
 
220
  - Section Enhancements
readme.txt CHANGED
@@ -208,6 +208,13 @@ You can check Otter documentation [here](https://docs.themeisle.com/article/1478
208
 
209
  == Changelog ==
210
 
 
 
 
 
 
 
 
211
  ##### [Version 2.1.2](https://github.com/Codeinwp/otter-blocks/compare/v2.1.1...v2.1.2) (2022-11-09)
212
 
213
  - Section Enhancements
208
 
209
  == Changelog ==
210
 
211
+ ##### [Version 2.1.3](https://github.com/Codeinwp/otter-blocks/compare/v2.1.2...v2.1.3) (2022-11-10)
212
+
213
+ - Fixed a crash issue for users with PHP8.0 & PHP8.1 with WP version lower than 6.1
214
+
215
+
216
+
217
+
218
  ##### [Version 2.1.2](https://github.com/Codeinwp/otter-blocks/compare/v2.1.1...v2.1.2) (2022-11-09)
219
 
220
  - Section Enhancements
vendor/autoload.php CHANGED
@@ -22,4 +22,4 @@ if (PHP_VERSION_ID < 50600) {
22
 
23
  require_once __DIR__ . '/composer/autoload_real.php';
24
 
25
- return ComposerAutoloaderInit20458f86173b5b8eb8068a5cad00f6f4::getLoader();
22
 
23
  require_once __DIR__ . '/composer/autoload_real.php';
24
 
25
+ return ComposerAutoloaderInit2b8eba14bcd6717b91104c70245c36bc::getLoader();
vendor/composer/autoload_real.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
- class ComposerAutoloaderInit20458f86173b5b8eb8068a5cad00f6f4
6
  {
7
  private static $loader;
8
 
@@ -24,18 +24,18 @@ class ComposerAutoloaderInit20458f86173b5b8eb8068a5cad00f6f4
24
 
25
  require __DIR__ . '/platform_check.php';
26
 
27
- spl_autoload_register(array('ComposerAutoloaderInit20458f86173b5b8eb8068a5cad00f6f4', 'loadClassLoader'), true, true);
28
  self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
29
- spl_autoload_unregister(array('ComposerAutoloaderInit20458f86173b5b8eb8068a5cad00f6f4', 'loadClassLoader'));
30
 
31
  require __DIR__ . '/autoload_static.php';
32
- call_user_func(\Composer\Autoload\ComposerStaticInit20458f86173b5b8eb8068a5cad00f6f4::getInitializer($loader));
33
 
34
  $loader->register(true);
35
 
36
- $includeFiles = \Composer\Autoload\ComposerStaticInit20458f86173b5b8eb8068a5cad00f6f4::$files;
37
  foreach ($includeFiles as $fileIdentifier => $file) {
38
- composerRequire20458f86173b5b8eb8068a5cad00f6f4($fileIdentifier, $file);
39
  }
40
 
41
  return $loader;
@@ -47,7 +47,7 @@ class ComposerAutoloaderInit20458f86173b5b8eb8068a5cad00f6f4
47
  * @param string $file
48
  * @return void
49
  */
50
- function composerRequire20458f86173b5b8eb8068a5cad00f6f4($fileIdentifier, $file)
51
  {
52
  if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
53
  $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
+ class ComposerAutoloaderInit2b8eba14bcd6717b91104c70245c36bc
6
  {
7
  private static $loader;
8
 
24
 
25
  require __DIR__ . '/platform_check.php';
26
 
27
+ spl_autoload_register(array('ComposerAutoloaderInit2b8eba14bcd6717b91104c70245c36bc', 'loadClassLoader'), true, true);
28
  self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
29
+ spl_autoload_unregister(array('ComposerAutoloaderInit2b8eba14bcd6717b91104c70245c36bc', 'loadClassLoader'));
30
 
31
  require __DIR__ . '/autoload_static.php';
32
+ call_user_func(\Composer\Autoload\ComposerStaticInit2b8eba14bcd6717b91104c70245c36bc::getInitializer($loader));
33
 
34
  $loader->register(true);
35
 
36
+ $includeFiles = \Composer\Autoload\ComposerStaticInit2b8eba14bcd6717b91104c70245c36bc::$files;
37
  foreach ($includeFiles as $fileIdentifier => $file) {
38
+ composerRequire2b8eba14bcd6717b91104c70245c36bc($fileIdentifier, $file);
39
  }
40
 
41
  return $loader;
47
  * @param string $file
48
  * @return void
49
  */
50
+ function composerRequire2b8eba14bcd6717b91104c70245c36bc($fileIdentifier, $file)
51
  {
52
  if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
53
  $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
vendor/composer/autoload_static.php CHANGED
@@ -4,7 +4,7 @@
4
 
5
  namespace Composer\Autoload;
6
 
7
- class ComposerStaticInit20458f86173b5b8eb8068a5cad00f6f4
8
  {
9
  public static $files = array (
10
  '16e4325dd9bdbbd2ce8c9530b088e50b' => __DIR__ . '/..' . '/codeinwp/themeisle-sdk/load.php',
@@ -176,9 +176,9 @@ class ComposerStaticInit20458f86173b5b8eb8068a5cad00f6f4
176
  public static function getInitializer(ClassLoader $loader)
177
  {
178
  return \Closure::bind(function () use ($loader) {
179
- $loader->prefixLengthsPsr4 = ComposerStaticInit20458f86173b5b8eb8068a5cad00f6f4::$prefixLengthsPsr4;
180
- $loader->prefixDirsPsr4 = ComposerStaticInit20458f86173b5b8eb8068a5cad00f6f4::$prefixDirsPsr4;
181
- $loader->classMap = ComposerStaticInit20458f86173b5b8eb8068a5cad00f6f4::$classMap;
182
 
183
  }, null, ClassLoader::class);
184
  }
4
 
5
  namespace Composer\Autoload;
6
 
7
+ class ComposerStaticInit2b8eba14bcd6717b91104c70245c36bc
8
  {
9
  public static $files = array (
10
  '16e4325dd9bdbbd2ce8c9530b088e50b' => __DIR__ . '/..' . '/codeinwp/themeisle-sdk/load.php',
176
  public static function getInitializer(ClassLoader $loader)
177
  {
178
  return \Closure::bind(function () use ($loader) {
179
+ $loader->prefixLengthsPsr4 = ComposerStaticInit2b8eba14bcd6717b91104c70245c36bc::$prefixLengthsPsr4;
180
+ $loader->prefixDirsPsr4 = ComposerStaticInit2b8eba14bcd6717b91104c70245c36bc::$prefixDirsPsr4;
181
+ $loader->classMap = ComposerStaticInit2b8eba14bcd6717b91104c70245c36bc::$classMap;
182
 
183
  }, null, ClassLoader::class);
184
  }
vendor/composer/installed.php CHANGED
@@ -1,8 +1,8 @@
1
  <?php return array(
2
  'root' => array(
3
  'name' => 'codeinwp/otter-blocks',
4
- 'pretty_version' => '2.1.2',
5
- 'version' => '2.1.2.0',
6
  'reference' => NULL,
7
  'type' => 'wordpress-plugin',
8
  'install_path' => __DIR__ . '/../../',
@@ -11,8 +11,8 @@
11
  ),
12
  'versions' => array(
13
  'codeinwp/otter-blocks' => array(
14
- 'pretty_version' => '2.1.2',
15
- 'version' => '2.1.2.0',
16
  'reference' => NULL,
17
  'type' => 'wordpress-plugin',
18
  'install_path' => __DIR__ . '/../../',
1
  <?php return array(
2
  'root' => array(
3
  'name' => 'codeinwp/otter-blocks',
4
+ 'pretty_version' => '2.1.3',
5
+ 'version' => '2.1.3.0',
6
  'reference' => NULL,
7
  'type' => 'wordpress-plugin',
8
  'install_path' => __DIR__ . '/../../',
11
  ),
12
  'versions' => array(
13
  'codeinwp/otter-blocks' => array(
14
+ 'pretty_version' => '2.1.3',
15
+ 'version' => '2.1.3.0',
16
  'reference' => NULL,
17
  'type' => 'wordpress-plugin',
18
  'install_path' => __DIR__ . '/../../',