!function(){"use strict";var e,t={535:function(){var e=window.wp.hooks,t=window.wp.components,o=window.wp.i18n,s=window.ReactJSXRuntime;const n=[{label:(0,o.__)("None","otter-blocks"),value:""},{label:(0,o.__)("Fade In","otter-blocks"),value:"fade-in"},{label:(0,o.__)("Slide Up","otter-blocks"),value:"slide-up"},{label:(0,o.__)("Slide Down","otter-blocks"),value:"slide-down"},{label:(0,o.__)("Slide Left","otter-blocks"),value:"slide-left"},{label:(0,o.__)("Slide Right","otter-blocks"),value:"slide-right"},{label:(0,o.__)("Zoom In","otter-blocks"),value:"zoom-in"},{label:(0,o.__)("Count Up","otter-blocks"),value:"count-up"}],l=[{label:(0,o.__)("0ms","otter-blocks"),value:"0"},{label:(0,o.__)("100ms","otter-blocks"),value:"100"},{label:(0,o.__)("200ms","otter-blocks"),value:"200"},{label:(0,o.__)("300ms","otter-blocks"),value:"300"},{label:(0,o.__)("400ms","otter-blocks"),value:"400"},{label:(0,o.__)("500ms","otter-blocks"),value:"500"}];function r({attributes:e,setAttributes:r}){const{animation:a,animationDelay:i}=e;return(0,s.jsxs)("div",{className:"aw-ce-tab-content",children:[(0,s.jsx)(t.SelectControl,{label:(0,o.__)("Animation Type","otter-blocks"),value:a||"",options:n,onChange:e=>r({animation:e,animationDelay:e?i:""}),help:(0,o.__)("Animation is visible on the frontend only.","otter-blocks")}),a&&(0,s.jsx)(t.SelectControl,{label:(0,o.__)("Delay","otter-blocks"),value:i||"0",options:l,onChange:e=>r({animationDelay:e})})]})}(0,e.addFilter)("blocks.registerBlockType","atomic-wind/animation-attributes",(e=>"atomic-wind"!==e.category?e:{...e,attributes:{...e.attributes,animation:{type:"string",default:""},animationDelay:{type:"string",default:""}}})),(0,e.addFilter)("blocks.getSaveContent.extraProps","atomic-wind/animation-save-props",((e,t,o)=>("atomic-wind"!==t.category||o.animation&&(e["data-animation"]=o.animation,o.animationDelay&&"0"!==o.animationDelay&&(e["data-animation-delay"]=o.animationDelay)),e)));var a=window.wp.data,i=window.wp.element;function c(e){const t=e.indexOf(":");return-1===t?e:e.substring(0,t)}function d(e={}){return!!(e.showIf||e.hideIf||e.stateTrigger)}function u({tone:e,children:t}){const o={trigger:{bg:"#e0e7ff",fg:"#3730a3"},default:{bg:"#ede9fe",fg:"#5b21b6"},show:{bg:"#dcfce7",fg:"#166534"},hide:{bg:"#fef3c7",fg:"#92400e"},warn:{bg:"#fee2e2",fg:"#991b1b"},muted:{bg:"#f0f0f0",fg:"#555"}},n=o[e]||o.muted;return(0,s.jsx)("span",{style:{display:"inline-flex",alignItems:"center",gap:"4px",background:n.bg,color:n.fg,borderRadius:"3px",padding:"2px 8px",fontSize:"11px",fontWeight:600,lineHeight:1.6},children:t})}function b({attributes:e,triggers:t,reactors:n}){const{showIf:l,hideIf:r,stateTrigger:a,stateAction:i,stateValue:d,stateDefault:b}=e,m=[];if(a){const e="set"===i?(0,o.sprintf)(
// translators: %1$s: state name, %2$s: value assigned.
// translators: %1$s: state name, %2$s: value assigned.
(0,o.__)("Sets %1$s = %2$s","otter-blocks"),a,d||(0,o.__)("(empty)","otter-blocks")):(0,o.sprintf)(
// translators: %s: state name.
// translators: %s: state name.
(0,o.__)("Toggles %s","otter-blocks"),a);m.push({tone:"trigger",text:e}),b&&m.push({tone:"default",text:(0,o.__)("Active on load","otter-blocks")});const t=n.get(a)||0;m.push({tone:t?"muted":"warn",text:t?(0,o.sprintf)(
// translators: %d: number of blocks that react to this state.
// translators: %d: number of blocks that react to this state.
(0,o._n)("%d block reacts","%d blocks react",t,"otter-blocks"),t):(0,o.__)("No blocks react yet","otter-blocks")})}if(l){const e=t.has(c(l));m.push({tone:e?"show":"warn",text:e?(0,o.sprintf)(
// translators: %s: condition string.
// translators: %s: condition string.
(0,o.__)("Visible when %s","otter-blocks"),l):(0,o.sprintf)(
// translators: %s: condition string.
// translators: %s: condition string.
(0,o.__)("Show If %s — no such trigger","otter-blocks"),l)})}if(r){const e=t.has(c(r));m.push({tone:e?"hide":"warn",text:e?(0,o.sprintf)(
// translators: %s: condition string.
// translators: %s: condition string.
(0,o.__)("Hidden when %s","otter-blocks"),r):(0,o.sprintf)(
// translators: %s: condition string.
// translators: %s: condition string.
(0,o.__)("Hide If %s — no such trigger","otter-blocks"),r)})}return(0,s.jsx)("div",{style:{marginBottom:"16px",padding:"10px",borderRadius:"4px",background:"#f8f9fa",border:"1px solid #e0e0e0"},children:m.length?(0,s.jsx)("div",{style:{display:"flex",flexWrap:"wrap",gap:"6px"},children:m.map(((e,t)=>(0,s.jsx)(u,{tone:e.tone,children:e.text},t)))}):(0,s.jsx)("p",{style:{margin:0,fontSize:"12px",color:"#777"},children:(0,o.__)("No state configured. Make this block a trigger, or gate its visibility with Show If / Hide If.","otter-blocks")})})}function m({triggers:e,onSelect:t}){return e.size?(0,s.jsx)("div",{style:{display:"flex",flexWrap:"wrap",gap:"4px",marginTop:"4px"},children:[...e.entries()].map((([e,o])=>{const n=[];if("set"===o.action&&o.values.size)for(const l of o.values)n.push((0,s.jsxs)("button",{type:"button",onClick:()=>t(`${e}:${l}`),style:{background:"#f0f0f0",border:"1px solid #ddd",borderRadius:"2px",padding:"0 6px",fontSize:"11px",cursor:"pointer",lineHeight:"1.8"},children:[e,":",l]},`${e}:${l}`));else n.push((0,s.jsx)("button",{type:"button",onClick:()=>t(e),style:{background:"#f0f0f0",border:"1px solid #ddd",borderRadius:"2px",padding:"0 6px",fontSize:"11px",cursor:"pointer",lineHeight:"1.8"},children:e},e));return n}))}):null}function p({attributes:e,setAttributes:n}){const{showIf:l,hideIf:r,stateTrigger:d,stateAction:u,stateValue:p,stateDefault:g}=e,h=(0,a.useSelect)((e=>e("core/block-editor").getBlocks()),[]),{triggers:_,reactors:f}=(0,i.useMemo)((()=>{const e=new Map,t=new Map;function o(e){const o=c(e);t.set(o,(t.get(o)||0)+1)}return function t(s){for(const n of s){const s=n.attributes||{};if(s.stateTrigger){e.has(s.stateTrigger)||e.set(s.stateTrigger,{action:s.stateAction||"toggle",values:new Set,hasDefault:!1});const t=e.get(s.stateTrigger);"set"===s.stateAction&&s.stateValue&&t.values.add(s.stateValue),s.stateDefault&&(t.hasDefault=!0)}s.showIf&&o(s.showIf),s.hideIf&&o(s.hideIf),n.innerBlocks?.length&&t(n.innerBlocks)}}(h),{triggers:e,reactors:t}}),[h]);return(0,s.jsxs)("div",{className:"aw-ce-tab-content",children:[(0,s.jsx)(b,{attributes:e,triggers:_,reactors:f}),(0,s.jsx)(t.TextControl,{label:(0,o.__)("Show If","otter-blocks"),value:l||"",onChange:e=>n({showIf:e})}),(0,s.jsx)(m,{triggers:_,onSelect:e=>n({showIf:e})}),(0,s.jsx)("p",{className:"components-base-control__help",children:(0,o.__)("Show this block when a state is active. Use a name (e.g. tabs) for boolean triggers, or name:value (e.g. tabs:pricing) for set-value triggers.","otter-blocks")}),(0,s.jsxs)("div",{style:{marginTop:"16px"},children:[(0,s.jsx)(t.TextControl,{label:(0,o.__)("Hide If","otter-blocks"),value:r||"",onChange:e=>n({hideIf:e})}),(0,s.jsx)(m,{triggers:_,onSelect:e=>n({hideIf:e})}),(0,s.jsx)("p",{className:"components-base-control__help",children:(0,o.__)("Hide this block when a state is active. Same syntax as Show If.","otter-blocks")})]}),(0,s.jsx)(t.TextControl,{label:(0,o.__)("State Trigger","otter-blocks"),value:d||"",onChange:e=>n({stateTrigger:e}),help:(0,o.__)("Give this block a state name so clicking it changes state. Other blocks can react via Show If / Hide If.","otter-blocks")}),d&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(t.SelectControl,{label:(0,o.__)("Action","otter-blocks"),value:u||"toggle",options:[{label:(0,o.__)("Toggle","otter-blocks"),value:"toggle"},{label:(0,o.__)("Set Value","otter-blocks"),value:"set"}],onChange:e=>n({stateAction:e}),help:(0,o.__)("Toggle flips a boolean on/off. Set Value assigns a specific value — useful for tab-style interfaces where only one option is active.","otter-blocks")}),"set"===u&&(0,s.jsx)(t.TextControl,{label:(0,o.__)("Value","otter-blocks"),value:p||"",onChange:e=>n({stateValue:e}),help:(0,o.__)("The value to assign when this trigger is clicked.","otter-blocks")}),(0,s.jsx)(t.ToggleControl,{label:(0,o.__)("Active by Default","otter-blocks"),checked:!!g,onChange:e=>n({stateDefault:e}),help:(0,o.__)("Turn on to make this trigger's state active on page load.","otter-blocks")})]})]})}(0,e.addFilter)("blocks.registerBlockType","atomic-wind/state-attributes",(e=>"atomic-wind"!==e.category?e:{...e,attributes:{...e.attributes,showIf:{type:"string",default:""},hideIf:{type:"string",default:""},stateTrigger:{type:"string",default:""},stateAction:{type:"string",default:"toggle"},stateValue:{type:"string",default:""},stateDefault:{type:"boolean",default:!1}}})),(0,e.addFilter)("blocks.getSaveContent.extraProps","atomic-wind/state-save-props",((e,t,o)=>("atomic-wind"!==t.category||(o.showIf&&(e["data-show-if"]=o.showIf),o.hideIf&&(e["data-hide-if"]=o.hideIf),o.stateTrigger&&(e["data-state-trigger"]=o.stateTrigger,e["data-state-action"]=o.stateAction,"set"===o.stateAction&&o.stateValue&&(e["data-state-value"]=o.stateValue),o.stateDefault&&(e["data-state-default"]=""))),e)));var g=window.wp.compose,h=window.wp.blockEditor;const _={"atomic-wind/text":[{label:(0,o.__)("None","otter-blocks"),value:""},{label:(0,o.__)("Title","otter-blocks"),value:"title"},{label:(0,o.__)("Excerpt","otter-blocks"),value:"excerpt"},{label:(0,o.__)("Date","otter-blocks"),value:"date"},{label:(0,o.__)("Author","otter-blocks"),value:"author"},{label:(0,o.__)("Categories","otter-blocks"),value:"categories"},{label:(0,o.__)("Tags","otter-blocks"),value:"tags"},{label:(0,o.__)("Modified Date","otter-blocks"),value:"modified_date"},{label:(0,o.__)("Comment Count","otter-blocks"),value:"comment_count"},{label:(0,o.__)("Reading Time","otter-blocks"),value:"reading_time"},{label:(0,o.__)("Custom Field","otter-blocks"),value:"custom_field"}],"atomic-wind/link":[{label:(0,o.__)("None","otter-blocks"),value:""},{label:(0,o.__)("Permalink","otter-blocks"),value:"permalink"},{label:(0,o.__)("Author Posts URL","otter-blocks"),value:"author_posts_url"},{label:(0,o.__)("Category Link","otter-blocks"),value:"category_link"},{label:(0,o.__)("Tag Link","otter-blocks"),value:"tag_link"},{label:(0,o.__)("Date Archive","otter-blocks"),value:"date_archive"},{label:(0,o.__)("Author Archive","otter-blocks"),value:"author_archive"}],"atomic-wind/image":[{label:(0,o.__)("None","otter-blocks"),value:""},{label:(0,o.__)("Featured Image","otter-blocks"),value:"featured_image"},{label:(0,o.__)("Author Avatar","otter-blocks"),value:"author_avatar"}]},f=[{label:(0,o.__)("Date","otter-blocks"),value:"date"},{label:(0,o.__)("Title","otter-blocks"),value:"title"},{label:(0,o.__)("Modified","otter-blocks"),value:"modified"},{label:(0,o.__)("Random","otter-blocks"),value:"rand"},{label:(0,o.__)("Menu Order","otter-blocks"),value:"menu_order"}],v=[{label:(0,o.__)("DESC","otter-blocks"),value:"DESC"},{label:(0,o.__)("ASC","otter-blocks"),value:"ASC"}];(0,e.addFilter)("blocks.registerBlockType","atomic-wind/query-attributes",(e=>{if("atomic-wind"!==e.category)return e;const t={postField:{type:"string",default:""},excerptLength:{type:"number",default:25},customFieldKey:{type:"string",default:""}};return"atomic-wind/box"===e.name&&(t.queryPostType={type:"string",default:""},t.queryCount={type:"number",default:3},t.queryOrderBy={type:"string",default:"date"},t.queryOrder={type:"string",default:"DESC"},t.queryTaxonomy={type:"string",default:""},t.queryExcludeCurrent={type:"boolean",default:!1},t.querySticky={type:"string",default:""}),{...e,attributes:{...e.attributes,...t}}}));const k=(0,g.createHigherOrderComponent)((e=>n=>{if(!n.name.startsWith("atomic-wind/"))return(0,s.jsx)(e,{...n});const{attributes:l,setAttributes:r}=n,c="atomic-wind/box"===n.name,d=_.hasOwnProperty(n.name),u=(0,a.useSelect)((e=>c?e("core").getPostTypes({per_page:-1}):null),[c]),b=(0,i.useMemo)((()=>u?u.filter((e=>e.viewable)).map((e=>({label:e.labels.singular_name,value:e.slug}))):[]),[u]),[m,p]=(l.queryTaxonomy||"").split(":"),g=(0,a.useSelect)((e=>{if(!c||!l.queryPostType)return[];const t=e("core").getTaxonomies({per_page:-1});return t?t.filter((e=>!1!==e.visibility?.public_queryable&&!1!==e.visibility?.show_ui)):[]}),[c,l.queryPostType]),k=(0,a.useSelect)((e=>c&&m&&e("core").getEntityRecords("taxonomy",m,{per_page:-1})||[]),[c,m]),w=(0,a.useSelect)((e=>{if(!d)return!1;const{getBlockParents:t,getBlock:o}=e("core/block-editor");return t(n.clientId).some((e=>{const t=o(e);return"atomic-wind/box"===t?.name&&!!t?.attributes?.queryPostType}))}),[n.clientId,d]);return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(e,{...n}),(0,s.jsxs)(h.InspectorControls,{children:[c&&(0,s.jsxs)(t.PanelBody,{title:(0,o.__)("Query","otter-blocks"),initialOpen:!1,children:[(0,s.jsx)(t.SelectControl,{label:(0,o.__)("Post Type","otter-blocks"),value:l.queryPostType||"",options:[{label:(0,o.__)("None","otter-blocks"),value:""},...b],onChange:e=>r({queryPostType:e})}),l.queryPostType&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(t.RangeControl,{label:(0,o.__)("Posts Per Page","otter-blocks"),value:l.queryCount||3,onChange:e=>r({queryCount:e}),min:1,max:50}),(0,s.jsx)(t.SelectControl,{label:(0,o.__)("Order By","otter-blocks"),value:l.queryOrderBy||"date",options:f,onChange:e=>r({queryOrderBy:e})}),(0,s.jsx)(t.SelectControl,{label:(0,o.__)("Order","otter-blocks"),value:l.queryOrder||"DESC",options:v,onChange:e=>r({queryOrder:e})}),(0,s.jsx)(t.SelectControl,{label:(0,o.__)("Taxonomy","otter-blocks"),value:m||"",options:[{label:(0,o.__)("None","otter-blocks"),value:""},...g.map((e=>({label:e.name,value:e.slug})))],onChange:e=>r({queryTaxonomy:e?e+":":""})}),m&&(0,s.jsx)(t.SelectControl,{label:(0,o.__)("Term","otter-blocks"),value:p||"",options:[{label:(0,o.__)("All","otter-blocks"),value:""},...k.map((e=>({label:e.name,value:e.slug})))],onChange:e=>r({queryTaxonomy:m+":"+(e||"")})}),(0,s.jsx)(t.ToggleControl,{label:(0,o.__)("Exclude Current Post","otter-blocks"),checked:!!l.queryExcludeCurrent,onChange:e=>r({queryExcludeCurrent:e})}),(0,s.jsx)(t.SelectControl,{label:(0,o.__)("Sticky Posts","otter-blocks"),value:l.querySticky||"",options:[{label:(0,o.__)("Default","otter-blocks"),value:""},{label:(0,o.__)("Exclude","otter-blocks"),value:"exclude"},{label:(0,o.__)("Only Sticky","otter-blocks"),value:"only"}],onChange:e=>r({querySticky:e})}),(0,s.jsx)("p",{className:"components-base-control__help",children:(0,o.__)("Inner blocks are repeated for each queried post on the frontend.","otter-blocks")})]})]}),d&&w&&(0,s.jsxs)(t.PanelBody,{title:(0,o.__)("Post Data","otter-blocks"),initialOpen:!1,children:[(0,s.jsx)(t.SelectControl,{label:(0,o.__)("Post Field","otter-blocks"),value:l.postField||"",options:_[n.name],onChange:e=>r({postField:e}),help:l.postField?(0,o.__)("Content will be replaced with post data on the frontend.","otter-blocks"):void 0}),"excerpt"===l.postField&&"atomic-wind/text"===n.name&&(0,s.jsx)(t.RangeControl,{label:(0,o.__)("Excerpt Length (words)","otter-blocks"),value:l.excerptLength||25,onChange:e=>r({excerptLength:e}),min:1,max:100}),"custom_field"===l.postField&&"atomic-wind/text"===n.name&&(0,s.jsx)(t.TextControl,{label:(0,o.__)("Meta Key","otter-blocks"),value:l.customFieldKey||"",onChange:e=>r({customFieldKey:e}),help:(0,o.__)("Enter the post meta key or ACF field name.","otter-blocks")})]})]})]})}),"withQueryControls");(0,e.addFilter)("editor.BlockEdit","atomic-wind/query-controls",k);var w=window.wp.plugins,x=window.wp.editor,y=window.wp.primitives,j=(0,s.jsx)(y.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,s.jsx)(y.Path,{d:"M20.8 10.7l-4.3-4.3-1.1 1.1 4.3 4.3c.1.1.1.3 0 .4l-4.3 4.3 1.1 1.1 4.3-4.3c.7-.8.7-1.9 0-2.6zM4.2 11.8l4.3-4.3-1-1-4.3 4.3c-.7.7-.7 1.8 0 2.5l4.3 4.3 1.1-1.1-4.3-4.3c-.2-.1-.2-.3-.1-.4z"})}),C=window.wp.blocks,S=(0,s.jsx)(y.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,s.jsx)(y.Path,{d:"m13.06 12 6.47-6.47-1.06-1.06L12 10.94 5.53 4.47 4.47 5.53 10.94 12l-6.47 6.47 1.06 1.06L12 13.06l6.47 6.47 1.06-1.06L13.06 12Z"})}),T=(0,s.jsx)(y.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,s.jsx)(y.Path,{d:"M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z"})}),I=(0,s.jsx)(y.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,s.jsx)(y.Path,{d:"M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z"})}),N=(0,s.jsx)(y.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,s.jsx)(y.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M5 4.5h11a.5.5 0 0 1 .5.5v11a.5.5 0 0 1-.5.5H5a.5.5 0 0 1-.5-.5V5a.5.5 0 0 1 .5-.5ZM3 5a2 2 0 0 1 2-2h11a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5Zm17 3v10.75c0 .69-.56 1.25-1.25 1.25H6v1.5h12.75a2.75 2.75 0 0 0 2.75-2.75V8H20Z"})}),E=(0,s.jsx)(y.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,s.jsx)(y.Path,{d:"M18.5 15v3.5H13V6.7l4.5 4.1 1-1.1-6.2-5.8-5.8 5.8 1 1.1 4-4v11.7h-6V15H4v5h16v-5z"})}),B=(0,s.jsx)(y.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,s.jsx)(y.Path,{d:"M18.3 11.7c-.6-.6-1.4-.9-2.3-.9H6.7l2.9-3.3-1.1-1-4.5 5L8.5 16l1-1-2.7-2.7H16c.5 0 .9.2 1.3.5 1 1 1 3.4 1 4.5v.3h1.5v-.2c0-1.5 0-4.3-1.5-5.7z"})}),P=(0,s.jsxs)(y.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,s.jsx)(y.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M20.3541 3.64593C18.5085 1.8004 13.2722 4.04455 8.65837 8.65837C4.04455 13.2722 1.8004 18.5085 3.64593 20.3541C5.49146 22.1996 10.7278 19.9555 15.3416 15.3416C19.9555 10.7278 22.1996 5.49146 20.3541 3.64593Z",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),(0,s.jsx)(y.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M3.64593 3.64593C1.8004 5.49146 4.04455 10.7278 8.65837 15.3416C13.2722 19.9555 18.5085 22.1996 20.3541 20.3541C22.1996 18.5085 19.9555 13.2722 15.3416 8.65837C10.7278 4.04455 5.49146 1.8004 3.64593 3.64593Z",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),(0,s.jsx)(y.Path,{d:"M12.009 12H12",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]});const L=["list-view","breadcrumb"],A=e=>{switch(e){case"section":return(0,o.__)("Section","otter-blocks");case"article":return(0,o.__)("Article","otter-blocks");case"main":return(0,o.__)("Main","otter-blocks");case"aside":return(0,o.__)("Aside","otter-blocks");case"header":return(0,o.__)("Header","otter-blocks");case"footer":return(0,o.__)("Footer","otter-blocks");case"nav":return(0,o.__)("Navigation","otter-blocks");case"details":return(0,o.__)("Details","otter-blocks");case"summary":return(0,o.__)("Summary","otter-blocks");default:return}},D=e=>e?("string"==typeof e?e.replace(/<[^>]+>/g," "):e.toPlainText?.()??"").replace(/\s+/g," ").trim():"",M=e=>(t,{context:o}={})=>{if(!L.includes(o))return;const s=t?.metadata?.name;return s||(e?e(t):void 0)},q=(M((({tagName:e})=>A(e))),M((({content:e})=>D(e)?e:void 0)),M((({mode:e,text:t})=>{if("inner-blocks"!==e)return D(t)?t:void 0})),M((({alt:e})=>D(e)||void 0)),M(),(e,t)=>t?.metadata?.name?t.metadata.name:"atomic-wind/box"===e?A(t?.tagName):void 0),R=document.createElement("textarea");function F(e){const t=D(e),o="string"==typeof e?(s=t,R.innerHTML=s,R.value):t;var s;return o.length>30?o.slice(0,30)+"…":o}function O(e){return"atomic-wind/text"===e.name?F(e.attributes?.content):"atomic-wind/link"===e.name&&"inner-blocks"!==e.attributes?.mode?F(e.attributes?.text):""}const V=[{id:"classname",label:(0,o.__)("Classname","otter-blocks")},{id:"state",label:(0,o.__)("State","otter-blocks")},{id:"animation",label:(0,o.__)("Animation","otter-blocks")}],H=(0,i.memo)((({block:e,depth:t,selectedId:o,onSelect:n,collapsed:l,onToggle:r})=>{const i=(0,a.useSelect)((t=>{const o=t(C.store).getBlockType(e.name);return q(e.name,e.attributes)||(o?o.title:e.name)}),[e.name,e.attributes]),c=e.innerBlocks&&e.innerBlocks.length>0,d=l[e.clientId],u=o===e.clientId,b=O(e);return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("button",{type:"button",className:"aw-ce-tree-node"+(u?" is-selected":""),style:{paddingLeft:16*t+8},onClick:()=>n(e.clientId),"data-block-id":e.clientId,children:[c?(0,s.jsx)("span",{className:"aw-ce-tree-toggle",onClick:t=>{t.stopPropagation(),r(e.clientId)},role:"button",tabIndex:-1,children:d?"▶":"▼"}):(0,s.jsx)("span",{className:"aw-ce-tree-toggle-spacer"}),(0,s.jsx)("span",{className:"aw-ce-tree-title",children:i}),b&&(0,s.jsx)("span",{className:"aw-ce-tree-preview",children:b})]}),c&&!d&&e.innerBlocks.map((e=>(0,s.jsx)(H,{block:e,depth:t+1,selectedId:o,onSelect:n,collapsed:l,onToggle:r},e.clientId)))]})}));var z=({onClose:e})=>{const n=(0,i.useRef)({left:Math.round(window.innerWidth/2-340),top:80}),l=(0,i.useRef)({width:680,height:440}),c=(0,i.useRef)(220),u=(0,i.useRef)(null),b=(0,i.useRef)(null),m=(0,i.useRef)(null),g=(0,i.useRef)(null),[,_]=(0,i.useState)(0),[f,v]=(0,i.useState)({}),[k,w]=(0,i.useState)(!0),[x,y]=(0,i.useState)(""),[j,L]=(0,i.useState)(!1),[A,D]=(0,i.useState)(null),[M,R]=(0,i.useState)("classname"),F=(0,a.useSelect)((e=>e(h.store).getBlocks()),[]),z=(0,a.useSelect)((e=>e(h.store).getSelectedBlockClientId()),[]),W=(0,a.useSelect)((e=>{if(!z)return"";const t=e(h.store).getBlockAttributes(z);return t?.className||""}),[z]),{selectedTitle:G,selectedPreview:U,selectedAttributes:X}=(0,a.useSelect)((e=>{if(!z)return{selectedTitle:"",selectedPreview:"",selectedAttributes:{}};const t=e(h.store).getBlock(z);if(!t)return{selectedTitle:"",selectedPreview:"",selectedAttributes:{}};const o=e(C.store).getBlockType(t.name);return{selectedTitle:q(t.name,t.attributes)||(o?o.title:t.name),selectedPreview:O(t),selectedAttributes:t.attributes||{}}}),[z]),{selectBlock:Z,updateBlockAttributes:$}=(0,a.useDispatch)(h.store),K=(0,i.useCallback)((e=>{v((t=>({...t,[e]:!t[e]})))}),[]),Y=(0,i.useCallback)((e=>{Z(e)}),[Z]),Q=(0,i.useCallback)((e=>{if(!z)return;const t=e.target.value.replace(/\n/g," ");$(z,{className:t})}),[z,$]),J=(0,i.useCallback)((e=>{"Enter"===e.key&&e.preventDefault()}),[]),ee=(0,i.useCallback)((()=>{W&&(y(W),navigator.clipboard?.writeText(W),L(!0),setTimeout((()=>L(!1)),1500))}),[W]),te=(0,i.useCallback)((()=>{z&&x&&(D({clientId:z,className:W}),$(z,{className:x}))}),[z,x,W,$]),oe=(0,i.useCallback)((()=>{A&&($(A.clientId,{className:A.className}),D(null))}),[A,$]),se=(0,i.useCallback)((e=>{z&&$(z,e)}),[z,$]);(0,i.useEffect)((()=>{D(null)}),[z]),(0,i.useEffect)((()=>{if(!z||!m.current||!k)return;const e=m.current.querySelector(`[data-block-id="${z}"]`);e&&e.scrollIntoView({block:"nearest",behavior:"smooth"})}),[z,k]),(0,i.useEffect)((()=>{const e=b.current;if(!e)return;let t=!1,o=0,s=0;const l=e=>{if(!t)return;e.preventDefault();const l=u.current;if(!l)return;const r=l.getBoundingClientRect();let a=e.clientX-o,i=e.clientY-s;a=Math.max(0,Math.min(a,window.innerWidth-r.width)),i=Math.max(0,Math.min(i,window.innerHeight-r.height)),n.current={left:a,top:i},l.style.left=a+"px",l.style.top=i+"px"},r=()=>{t=!1,document.removeEventListener("mousemove",l),document.removeEventListener("mouseup",r)},a=e=>{e.target.closest("button")||(t=!0,o=e.clientX-n.current.left,s=e.clientY-n.current.top,document.addEventListener("mousemove",l),document.addEventListener("mouseup",r))};return e.addEventListener("mousedown",a),()=>{e.removeEventListener("mousedown",a),document.removeEventListener("mousemove",l),document.removeEventListener("mouseup",r)}}),[]),(0,i.useEffect)((()=>{const e=u.current;if(!e)return;let t,o,s,n,r=!1;const a=a=>{if(!r)return;a.preventDefault();const i=Math.max(400,s+(a.clientX-t)),c=Math.max(240,n+(a.clientY-o));l.current={width:i,height:c},e.style.width=i+"px",e.style.height=c+"px"},i=()=>{r=!1,document.body.style.cursor="",document.body.style.userSelect="",document.removeEventListener("mousemove",a),document.removeEventListener("mouseup",i)},c=l=>{const c=e.getBoundingClientRect();l.clientX>=c.right-18&&l.clientY>=c.bottom-18&&(l.preventDefault(),r=!0,t=l.clientX,o=l.clientY,s=c.width,n=c.height,document.body.style.cursor="nwse-resize",document.body.style.userSelect="none",document.addEventListener("mousemove",a),document.addEventListener("mouseup",i))};return e.addEventListener("mousedown",c),()=>{e.removeEventListener("mousedown",c),document.removeEventListener("mousemove",a),document.removeEventListener("mouseup",i)}}),[]),(0,i.useEffect)((()=>{const e=g.current;if(!e)return;let t,o,s=!1;const n=e=>{if(!s)return;e.preventDefault();const n=m.current;if(!n)return;const l=Math.max(120,Math.min(500,o+(e.clientX-t)));c.current=l,n.style.width=l+"px"},l=()=>{s=!1,document.body.style.cursor="",document.body.style.userSelect="",document.removeEventListener("mousemove",n),document.removeEventListener("mouseup",l)},r=e=>{e.preventDefault(),s=!0,t=e.clientX,o=c.current,document.body.style.cursor="col-resize",document.body.style.userSelect="none",document.addEventListener("mousemove",n),document.addEventListener("mouseup",l)};return e.addEventListener("mousedown",r),()=>{e.removeEventListener("mousedown",r),document.removeEventListener("mousemove",n),document.removeEventListener("mouseup",l)}}),[k]);const ne=(0,s.jsxs)("div",{className:"aw-ce-panel",style:{left:n.current.left,top:n.current.top,width:l.current.width,height:l.current.height},ref:u,children:[(0,s.jsxs)("div",{className:"aw-ce-header",ref:b,children:[(0,s.jsxs)("div",{className:"aw-ce-header-left",children:[(0,s.jsx)("span",{className:"aw-ce-header-icon",children:P}),(0,s.jsx)("span",{className:"aw-ce-header-title",children:(0,o.__)("Atomic Wind","otter-blocks")})]}),(0,s.jsx)(t.Button,{icon:S,label:(0,o.__)("Close","otter-blocks"),onClick:e,size:"compact",className:"aw-ce-header-close"})]}),(0,s.jsxs)("div",{className:"aw-ce-body",children:[k&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"aw-ce-tree",ref:m,style:{width:c.current},children:F.map((e=>(0,s.jsx)(H,{block:e,depth:0,selectedId:z,onSelect:Y,collapsed:f,onToggle:K},e.clientId)))}),(0,s.jsx)("div",{className:"aw-ce-tree-resize",ref:g})]}),(0,s.jsxs)("div",{className:"aw-ce-classname",children:[(0,s.jsxs)("div",{className:"aw-ce-classname-header",children:[(0,s.jsx)(t.Button,{icon:k?T:I,label:k?(0,o.__)("Hide tree","otter-blocks"):(0,o.__)("Show tree","otter-blocks"),onClick:()=>w(!k),size:"compact",className:"aw-ce-sm-btn"}),z&&(0,s.jsxs)("span",{className:"aw-ce-classname-label",children:[G,U&&(0,s.jsx)("span",{className:"aw-ce-classname-label-preview",children:" — "+U})]}),z&&"classname"===M&&(0,s.jsxs)("div",{className:"aw-ce-classname-actions",children:[(0,s.jsx)(t.Button,{icon:N,label:j?(0,o.__)("Copied!","otter-blocks"):(0,o.__)("Copy classes","otter-blocks"),onClick:ee,size:"compact",className:"aw-ce-sm-btn"+(j?" is-copied":""),disabled:!W}),(0,s.jsx)(t.Button,{icon:E,label:(0,o.__)("Paste classes","otter-blocks"),onClick:te,size:"compact",className:"aw-ce-sm-btn",disabled:!x}),A&&(0,s.jsx)(t.Button,{icon:B,label:(0,o.__)("Undo paste","otter-blocks"),onClick:oe,size:"compact",className:"aw-ce-sm-btn is-undo"})]})]}),(0,s.jsx)("div",{className:"aw-ce-tabs",children:V.map((e=>{const t="state"===e.id&&d(X);return(0,s.jsxs)("button",{type:"button",className:"aw-ce-tab"+(M===e.id?" is-active":""),onClick:()=>R(e.id),children:[e.label,t&&(0,s.jsx)("span",{"aria-hidden":"true",style:{display:"inline-block",width:"6px",height:"6px",marginLeft:"5px",borderRadius:"50%",background:"#3858e9",verticalAlign:"middle"}})]},e.id)}))}),(0,s.jsx)("div",{className:"aw-ce-classname-body",children:(()=>{if(!z)return(0,s.jsx)("p",{className:"aw-ce-classname-placeholder",children:(0,o.__)("Select a block to edit.","otter-blocks")});switch(M){case"state":return(0,s.jsx)(p,{attributes:X,setAttributes:se});case"animation":return(0,s.jsx)(r,{attributes:X,setAttributes:se});default:return(0,s.jsx)("textarea",{className:"aw-ce-classname-input",value:W,onChange:Q,onKeyDown:J,placeholder:(0,o.__)("Add Tailwind classes…","otter-blocks")})}})()})]})]}),(0,s.jsx)("div",{className:"aw-ce-resize-handle"})]});return(0,i.createPortal)(ne,document.body)};let W=!1;const G=new Set;function U(e){W=e,G.forEach((t=>t(e)))}function X(){const[e,t]=(0,i.useState)(W);return(0,i.useEffect)((()=>{const e=e=>t(e);return G.add(e),()=>G.delete(e)}),[]),[e,U]}(0,w.registerPlugin)("atomic-wind-class-editor",{render:()=>{const[e,t]=X();return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(x.PluginMoreMenuItem,{icon:j,onClick:()=>t(!e),children:(0,o.__)("Atomic Wind","otter-blocks")}),e&&(0,s.jsx)(z,{onClose:()=>t(!1)})]})}});const Z=(0,g.createHigherOrderComponent)((e=>n=>{if(!n.name.startsWith("atomic-wind/"))return(0,s.jsx)(e,{...n});const[l,a]=X(),{attributes:i,setAttributes:c}=n;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(h.InspectorControls,{children:(0,s.jsx)("div",{className:"aw-ce-inspector-toggle",children:(0,s.jsx)(t.Button,{icon:P,onClick:()=>a(!l),className:"aw-ce-inspector-btn"+(l?" is-active":""),children:(0,o.__)("Atomic Wind","otter-blocks")})})}),(0,s.jsx)(e,{...n}),(0,s.jsxs)(h.InspectorControls,{children:[(0,s.jsx)(t.PanelBody,{title:(0,s.jsxs)("span",{style:{display:"inline-flex",alignItems:"center"},children:[(0,o.__)("State & Visibility","otter-blocks"),d(i)&&(0,s.jsx)("span",{"aria-label":(0,o.__)("State configured","otter-blocks"),style:{display:"inline-block",width:"6px",height:"6px",marginLeft:"6px",borderRadius:"50%",background:"#3858e9"}})]}),initialOpen:!1,children:(0,s.jsx)(p,{attributes:i,setAttributes:c})}),(0,s.jsx)(t.PanelBody,{title:(0,o.__)("Animation","otter-blocks"),initialOpen:!1,children:(0,s.jsx)(r,{attributes:i,setAttributes:c})})]})]})}),"withClassEditorToggle");(0,e.addFilter)("editor.BlockEdit","atomic-wind/class-editor-toggle",Z,-100),(0,w.registerPlugin)("atomic-wind-wrap-in",{render:()=>{const{clientIds:e,blocks:n}=(0,a.useSelect)((e=>{const{getSelectedBlockClientIds:t,getBlocksByClientId:o}=e("core/block-editor"),s=t();return{clientIds:s,blocks:o(s)}}),[]),{replaceBlocks:l}=(0,a.useDispatch)("core/block-editor");if(!(n.length>0&&n.every((e=>e?.name?.startsWith("atomic-wind/")))))return null;const r=(t,o={})=>{const s=(0,C.createBlock)(t,o,n.map((e=>(0,C.createBlock)(e.name,e.attributes,e.innerBlocks))));l(e,[s])};return(0,s.jsx)(h.BlockSettingsMenuControls,{children:({onClose:e})=>(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(t.MenuItem,{icon:P,onClick:()=>{r("atomic-wind/box"),e()},children:(0,o.__)("Wrap in Box","otter-blocks")}),(0,s.jsx)(t.MenuItem,{icon:P,onClick:()=>{r("atomic-wind/link",{mode:"inner-blocks"}),e()},children:(0,o.__)("Wrap in Link","otter-blocks")})]})})}});const $="atomic-wind-css-warm-frame";function K(){const e=document.getElementById($);e?.parentNode&&e.parentNode.removeChild(e)}let Y=!1;(0,a.subscribe)((()=>{const e=(0,a.select)("core/editor");if(!e)return;const t=e.isSavingPost()&&!e.isAutosavingPost();!Y||t||e.didPostSaveRequestFail()||function(){const e=window.atomicWindEditor,t=(0,a.select)("core/editor");if(!e?.warmUrl||!e?.warmNonce||!t)return;const o=t.getCurrentPostId(),s=t.getEditedPostContent();if(!o||!s||!s.includes("wp:atomic-wind/"))return;let n;try{n=new URL(e.warmUrl)}catch{return}n.searchParams.set("atomic_wind_css_warm",e.warmNonce),n.searchParams.set("post_id",String(o)),n.searchParams.set("v",String(Date.now())),K();const l=document.createElement("iframe");l.id=$,l.setAttribute("aria-hidden","true"),l.tabIndex=-1,l.style.cssText="position:fixed;left:-9999px;top:0;width:1024px;height:768px;border:0;opacity:0;pointer-events:none;";const{origin:r}=n,i={timer:0},c=()=>{window.removeEventListener("message",d),clearTimeout(i.timer),K()},d=e=>{e.origin===r&&e.source===l.contentWindow&&"atomic-wind:css-warmed"===e.data?.type&&Number(e.data.postId)===Number(o)&&c()};window.addEventListener("message",d),i.timer=setTimeout(c,2e4),l.src=n.toString(),document.body.appendChild(l)}(),Y=t}))}},o={};function s(e){var n=o[e];if(void 0!==n)return n.exports;var l=o[e]={exports:{}};return t[e](l,l.exports,s),l.exports}s.m=t,e=[],s.O=function(t,o,n,l){if(!o){var r=1/0;for(d=0;d<e.length;d++){o=e[d][0],n=e[d][1],l=e[d][2];for(var a=!0,i=0;i<o.length;i++)(!1&l||r>=l)&&Object.keys(s.O).every((function(e){return s.O[e](o[i])}))?o.splice(i--,1):(a=!1,l<r&&(r=l));if(a){e.splice(d--,1);var c=n();void 0!==c&&(t=c)}}return t}l=l||0;for(var d=e.length;d>0&&e[d-1][2]>l;d--)e[d]=e[d-1];e[d]=[o,n,l]},s.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},function(){var e={8:0,117:0};s.O.j=function(t){return 0===e[t]};var t=function(t,o){var n,l,r=o[0],a=o[1],i=o[2],c=0;if(r.some((function(t){return 0!==e[t]}))){for(n in a)s.o(a,n)&&(s.m[n]=a[n]);if(i)var d=i(s)}for(t&&t(o);c<r.length;c++)l=r[c],s.o(e,l)&&e[l]&&e[l][0](),e[l]=0;return s.O(d)},o=self.webpackChunkotter_blocks=self.webpackChunkotter_blocks||[];o.forEach(t.bind(null,0)),o.push=t.bind(null,o.push.bind(o))}();var n=s.O(void 0,[117],(function(){return s(535)}));n=s.O(n)}();