(()=>{var e={2485:(e,t)=>{var n;!function(){"use strict";var o={}.hasOwnProperty;function a(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var i=typeof n;if("string"===i||"number"===i)e.push(n);else if(Array.isArray(n)){if(n.length){var l=a.apply(null,n);l&&e.push(l)}}else if("object"===i)if(n.toString===Object.prototype.toString)for(var r in n)o.call(n,r)&&n[r]&&e.push(r);else e.push(n.toString())}}return e.join(" ")}e.exports?(a.default=a,e.exports=a):void 0===(n=function(){return a}.apply(t,[]))||(e.exports=n)}()}},t={};function n(o){var a=t[o];if(void 0!==a)return a.exports;var i=t[o]={exports:{}};return e[o](i,i.exports,n),i.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";const e=window.kadence.icons,t=window.wp.blocks,o=window.wp.i18n,a=window.React,i=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"kadence/show-more","title":"Show More","category":"kadence-blocks","textdomain":"kadence-blocks","usesContext":["postId","queryId"],"attributes":{"align":{"type":"string"},"id":{"type":"number"},"uniqueID":{"type":"string"},"showHideMore":{"type":"boolean","default":true},"defaultExpandedMobile":{"type":"boolean","default":false},"defaultExpandedTablet":{"type":"boolean","default":false},"defaultExpandedDesktop":{"type":"boolean","default":false},"heightDesktop":{"type":"number","default":250},"heightTablet":{"type":"number","default":""},"heightMobile":{"type":"number","default":""},"heightType":{"type":"string","default":"px"},"enableFadeOut":{"type":"boolean","default":false},"fadeOutSize":{"type":"number","default":50},"marginDesktop":{"type":"array","default":["","","",""]},"marginTablet":{"type":"array","default":["","","",""]},"marginMobile":{"type":"array","default":["","","",""]},"marginUnit":{"type":"string","default":"px"},"paddingDesktop":{"type":"array","default":["","","",""]},"paddingTablet":{"type":"array","default":["","","",""]},"paddingMobile":{"type":"array","default":["","","",""]},"paddingUnit":{"type":"string","default":"px"},"inQueryBlock":{"type":"boolean","default":false}},"supports":{"kbMetadata":true}}'),l=window.wp.data,r=window.wp.components,s=window.kadence.components,d=window.kadence.helpers,c=window.wp.blockEditor,u=window.wp.element,p=window.lodash;var g=n(2485),k=n.n(g);(0,t.registerBlockType)("kadence/show-more",{...i,title:(0,o._x)("Show More","block title","kadence-blocks"),description:(0,o._x)("Hide content and enable a show more button to reveal","block description","kadence-blocks"),keywords:[(0,o.__)("show","kadence-blocks"),(0,o.__)("hide","kadence-blocks"),"kb"],icon:{src:e.showMoreIcon},transforms:{from:[],to:[]},edit:function(e){const{attributes:t,setAttributes:n,clientId:g,context:b}=e,{uniqueID:m,showHideMore:h,defaultExpandedMobile:v,defaultExpandedTablet:f,defaultExpandedDesktop:w,heightDesktop:O,heightTablet:y,heightMobile:S,heightType:x,marginDesktop:E,marginTablet:M,marginMobile:B,marginUnit:D,paddingDesktop:C,paddingTablet:_,paddingMobile:T,paddingUnit:I,enableFadeOut:P,fadeOutSize:U,inQueryBlock:q}=t,{addUniqueID:R}=(0,l.useDispatch)("kadenceblocks/data"),{isUniqueID:A,isUniqueBlock:N,previewDevice:V,parentData:z}=(0,l.useSelect)((e=>({isUniqueID:t=>e("kadenceblocks/data").isUniqueID(t),isUniqueBlock:(t,n)=>e("kadenceblocks/data").isUniqueBlock(t,n),previewDevice:e("kadenceblocks/data").getPreviewDeviceType(),parentData:{rootBlock:e("core/block-editor").getBlock(e("core/block-editor").getBlockHierarchyRootClientId(g)),postId:e("core/editor")?.getCurrentPostId()?e("core/editor")?.getCurrentPostId():"",reusableParent:e("core/block-editor").getBlockAttributes(e("core/block-editor").getBlockParentsByBlockName(g,"core/block").slice(-1)[0]),editedPostId:!!e("core/edit-site")&&e("core/edit-site").getEditedPostId()}})),[g]);(0,u.useEffect)((()=>{(0,d.setBlockDefaults)("kadence/show-more",t);const o=(0,d.getPostOrFseId)(e,z),a=(0,d.getUniqueId)(m,g,A,N,o);a!==m?(t.uniqueID=a,n({uniqueID:a}),R(a,g)):R(m,g),n({inQueryBlock:(0,d.getInQueryBlock)(b,q)})}),[]);const{updateBlockAttributes:L}=(0,l.useDispatch)(c.store),{showMoreBlock:F}=(0,l.useSelect)((e=>({showMoreBlock:e("core/block-editor").getBlock(g)})),[g]);(0,u.useEffect)((()=>{F?.innerBlocks?.[0]?.clientId&&"kadence/column"===F?.innerBlocks?.[0]?.name&&F?.innerBlocks?.[0]?.attributes&&!1!==F?.innerBlocks?.[0]?.attributes?.templateLock&&L(F.innerBlocks[0].clientId,{templateLock:!1})}),[g]);const[$,j]=(0,u.useState)("general"),H=(0,d.mouseOverVisualizer)(),K=(0,d.mouseOverVisualizer)(),Q=(e,t,n,o)=>{if("Mobile"===e){if(void 0!==o&&""!==o&&null!==o)return o;if(void 0!==n&&""!==n&&null!==n)return n}else if("Tablet"===e&&void 0!==n&&""!==n&&null!==n)return n;return t},J=wp.data.select("core/block-editor").getBlockOrder(g),G=J[1]?J[1].substr(2,9):(0,p.uniqueId)("button-one-"),W=Q(V,void 0!==E?E[0]:"",void 0!==M?M[0]:"",void 0!==B?B[0]:""),X=Q(V,void 0!==E?E[1]:"",void 0!==M?M[1]:"",void 0!==B?B[1]:""),Y=Q(V,void 0!==E?E[2]:"",void 0!==M?M[2]:"",void 0!==B?B[2]:""),Z=Q(V,void 0!==E?E[3]:"",void 0!==M?M[3]:"",void 0!==B?B[3]:""),ee=Q(V,void 0!==C?C[0]:"",void 0!==_?_[0]:"",void 0!==T?T[0]:""),te=Q(V,void 0!==C?C[1]:"",void 0!==_?_[1]:"",void 0!==T?T[1]:""),ne=Q(V,void 0!==C?C[2]:"",void 0!==_?_[2]:"",void 0!==T?T[2]:""),oe=Q(V,void 0!==C?C[3]:"",void 0!==_?_[3]:"",void 0!==T?T[3]:""),ae=Q(V,void 0!==O?O:"",void 0!==y?y:"",void 0!==S?S:""),ie=Q(V,w,f,v),le=(0,u.useRef)(),re=k()({"kb-block-show-more-container":!0,[`kb-block-show-more-container${m}`]:!0}),se=(0,c.useBlockProps)({className:re,ref:le}),de=k()({"kb-block-show-more-inner-container":!0}),ce=(0,c.useInnerBlocksProps)({className:de},{templateLock:"all",renderAppender:!1,template:[["kadence/column",{className:"kb-show-more-content",templateLock:!1}],["kadence/advancedbtn",{lock:{remove:!0,move:!0},lockBtnCount:!0,hAlign:"left",uniqueID:G,className:"kb-show-more-buttons"},[["kadence/singlebtn",{lock:{remove:!0,move:!0},hideLink:!0,text:(0,o.__)("Show More","kadence-blocks"),sizePreset:"small",noCustomDefaults:!0}],["kadence/singlebtn",{lock:{remove:!0,move:!0},hideLink:!0,text:(0,o.__)("Show Less","kadence-blocks"),sizePreset:"small",noCustomDefaults:!0}]]]]});return(0,a.createElement)(a.Fragment,null,(0,a.createElement)(c.BlockControls,null,(0,a.createElement)(s.CopyPasteAttributes,{attributes:t,defaultAttributes:i.attributes,blockSlug:i.name,onPaste:e=>n(e)})),(0,a.createElement)(s.KadenceInspectorControls,{blockSlug:"kadence/show-more"},(0,a.createElement)(s.InspectorControlTabs,{panelName:"show-more",allowedTabs:["general","advanced"],setActiveTab:j,activeTab:$}),"general"===$&&(0,a.createElement)(a.Fragment,null,(0,a.createElement)(s.KadencePanelBody,{title:(0,o.__)("Show More Settings","kadence-blocks"),initialOpen:!0,panelName:"showMoreSettings",blockSlug:"kadence/show-more"},(0,a.createElement)(r.ToggleControl,{label:(0,o.__)('Display "hide" button once expanded',"kadence-blocks"),checked:h,onChange:e=>n({showHideMore:e})}),(0,a.createElement)(s.ResponsiveRangeControls,{label:(0,o.__)("Maximum Preview Height","kadence-blocks"),value:O||"",onChange:e=>{n({heightDesktop:e})},tabletValue:void 0!==y?y:"",onChangeTablet:e=>{n({heightTablet:e})},mobileValue:void 0!==S?S:"",onChangeMobile:e=>{n({heightMobile:e})},min:0,max:"px"!==(x||"px")?10:2e3,step:"px"!==(x||"px")?.1:1,unit:x||"px",onUnit:e=>{n({heightType:e})},units:["px","em","rem"]}),(0,a.createElement)(r.ToggleControl,{label:(0,o.__)("Fade out preview","kadence-blocks"),checked:P,onChange:e=>n({enableFadeOut:e})}),P&&(0,a.createElement)(r.RangeControl,{label:(0,o.__)("Fade Size","kadence-blocks"),value:U,onChange:e=>n({fadeOutSize:e})}))),"advanced"===$&&(0,a.createElement)(a.Fragment,null,(0,a.createElement)(s.KadencePanelBody,{panelName:"kb-show-more-settings"},(0,a.createElement)(s.ResponsiveMeasureRangeControl,{label:(0,o.__)("Padding","kadence-blocks"),value:[ee,te,ne,oe],tabletValue:_,mobileValue:T,onChange:e=>n({paddingDesktop:e}),onChangeTablet:e=>n({paddingTablet:e}),onChangeMobile:e=>n({paddingMobile:e}),min:0,max:"em"===I||"rem"===I?25:999,step:"em"===I||"rem"===I?.1:1,unit:I,units:["px","em","rem","%"],onUnit:e=>n({paddingUnit:e}),onMouseOver:H.onMouseOver,onMouseOut:H.onMouseOut}),(0,a.createElement)(s.ResponsiveMeasureRangeControl,{label:(0,o.__)("Margin","kadence-blocks"),value:[W,X,Y,Z],tabletValue:M,mobileValue:B,onChange:e=>{n({marginDesktop:e})},onChangeTablet:e=>n({marginTablet:e}),onChangeMobile:e=>n({marginMobile:e}),min:"em"===D||"rem"===D?-25:-999,max:"em"===D||"rem"===D?25:999,step:"em"===D||"rem"===D?.1:1,unit:D,units:["px","em","rem","%","vh"],onUnit:e=>n({marginUnit:e}),onMouseOver:K.onMouseOver,onMouseOut:K.onMouseOut,allowAuto:!0})),(0,a.createElement)("div",{className:"kt-sidebar-settings-spacer"}),(0,a.createElement)(s.KadencePanelBody,{title:(0,o.__)("Expand Settings","kadence-blocks"),panelName:"expandSettings",blockSlug:"kadence/show-more",initialOpen:!1},(0,a.createElement)(r.ToggleControl,{label:(0,o.__)("Default Expanded on Desktop","kadence-blocks"),checked:w,onChange:e=>n({defaultExpandedDesktop:e})}),(0,a.createElement)(r.ToggleControl,{label:(0,o.__)("Default Expanded on Tablet","kadence-blocks"),checked:f,onChange:e=>n({defaultExpandedTablet:e})}),(0,a.createElement)(r.ToggleControl,{label:(0,o.__)("Default Expanded on Mobile","kadence-blocks"),checked:v,onChange:e=>n({defaultExpandedMobile:e})})),(0,a.createElement)(s.KadenceBlockDefaults,{attributes:t,defaultAttributes:i.attributes,blockSlug:i.name}))),(0,a.createElement)((()=>{const e=P&&!ie?Math.abs(U-100):100;return(0,a.createElement)("style",null,`\n .kb-block-show-more-container${m} .kb-show-more-buttons .wp-block-kadence-singlebtn:last-of-type {\n \tdisplay: ${h?"inline-flex":"none"};\n \t}\n\n .kb-block-show-more-container${m} .kb-show-more-content:not(.is-selected, .has-child-selected) {\n\t\t max-height: ${ie?"none":ae+x};\n\t\t -webkit-mask-image: linear-gradient(to bottom, black ${e}%, transparent 100%);\n\t\t mask-image: linear-gradient(to bottom, black ${e}%, transparent 100%);\n\n }\n `)}),null),(0,a.createElement)("div",{...se,style:{marginTop:""!==W?(0,d.getSpacingOptionOutput)(W,D):void 0,marginRight:""!==X?(0,d.getSpacingOptionOutput)(X,D):void 0,marginBottom:""!==Y?(0,d.getSpacingOptionOutput)(Y,D):void 0,marginLeft:""!==Z?(0,d.getSpacingOptionOutput)(Z,D):void 0,paddingTop:""!==ee?(0,d.getSpacingOptionOutput)(ee,I):void 0,paddingRight:""!==te?(0,d.getSpacingOptionOutput)(te,I):void 0,paddingBottom:""!==ne?(0,d.getSpacingOptionOutput)(ne,I):void 0,paddingLeft:""!==oe?(0,d.getSpacingOptionOutput)(oe,I):void 0}},(0,a.createElement)("div",{...ce}),(0,a.createElement)(s.SpacingVisualizer,{style:{marginLeft:void 0!==Z?(0,d.getSpacingOptionOutput)(Z,D):void 0,marginRight:void 0!==X?(0,d.getSpacingOptionOutput)(X,D):void 0,marginTop:void 0!==W?(0,d.getSpacingOptionOutput)(W,D):void 0,marginBottom:void 0!==Y?(0,d.getSpacingOptionOutput)(Y,D):void 0},type:"inside",forceShow:H.isMouseOver,spacing:[(0,d.getSpacingOptionOutput)(ee,I),(0,d.getSpacingOptionOutput)(te,I),(0,d.getSpacingOptionOutput)(ne,I),(0,d.getSpacingOptionOutput)(oe,I)]}),(0,a.createElement)(s.SpacingVisualizer,{type:"outside",forceShow:K.isMouseOver,spacing:[(0,d.getSpacingOptionOutput)(W,D),(0,d.getSpacingOptionOutput)(X,D),(0,d.getSpacingOptionOutput)(Y,D),(0,d.getSpacingOptionOutput)(Z,D)]})))},save:function({attributes:e,innerBlocks:t}){const{uniqueID:n}=e,o=k()({"kb-block-show-more-container":!0,[`kb-block-show-more-container${n}`]:!0});return(0,a.createElement)("div",{...c.useBlockProps.save({className:o})},(0,a.createElement)(c.InnerBlocks.Content,null))},example:{attributes:{},innerBlocks:[{name:"kadence/column",innerBlocks:[{name:"core/paragraph",attributes:{content:(0,o.__)("This content will be partially hidden. Click the button below to reveal more.","kadence-blocks")}}]}]}})})(),(this.kadence=this.kadence||{})["blocks-show-more"]={}})();