var f={exports:{}},u={};/** * @license React * react-jsx-runtime.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var j=window.React,C=Symbol.for("react.element"),T=Symbol.for("react.fragment"),B=Object.prototype.hasOwnProperty,P=j.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,$={key:!0,ref:!0,__self:!0,__source:!0};function x(e,o,t){var s,a={},i=null,l=null;t!==void 0&&(i=""+t),o.key!==void 0&&(i=""+o.key),o.ref!==void 0&&(l=o.ref);for(s in o)B.call(o,s)&&!$.hasOwnProperty(s)&&(a[s]=o[s]);if(e&&e.defaultProps)for(s in o=e.defaultProps,o)a[s]===void 0&&(a[s]=o[s]);return{$$typeof:C,type:e,key:i,ref:l,props:a,_owner:P.current}}u.Fragment=T;u.jsx=x;u.jsxs=x;f.exports=u;var n=f.exports;const{useSelect:E}=window.wp.data,d=e=>({metaValue:E(s=>s("core/editor").getEditedPostAttribute("meta")[e],[e]),setMetaValue:s=>{window.wp.data.dispatch("core/editor").editPost({meta:{[e]:s}})}});const{ButtonGroup:k,Button:S}=window.wp.components;function h({options:e=[],selected:o,onChange:t,className:s=""}){const a=i=>{t(i)};return n.jsx(k,{className:`brandy-post-editor-btn-group ${s}`,children:e.map(i=>n.jsx(S,{onClick:()=>{a(i.value)},className:o===i.value?"selected":"",children:i.label},i.value))})}function m({content:e}){return n.jsx("div",{style:{marginTop:4,fontSize:12,color:"#5A6D80"},children:e})}const{ToggleControl:D}=window.wp.components;function R({checked:e=!1,onChange:o=()=>{}}){return n.jsx(D,{checked:e,onChange:o,className:"brandy-plugin-switcher"})}const g=(e,o)=>{const t=window.wp.data.select("core/editor").getEditorSettings(),s=t.styles,a=s.find(l=>w(l)&&l.type===e),i={css:o,author:"brandy",type:e};window.wp.data.dispatch("core/editor").updateEditorSettings({...t,styles:a?s.map(l=>w(l)&&l.type===e?{...l,css:o}:l):[...s,i]})};function w(e){return e.author==="brandy"}const{__:p}=window.wp.i18n,{PanelBody:O,__experimentalNumberControl:V}=window.wp.components,{useEffect:I}=window.React,N=[{label:"Inherit",value:"inherit"},{label:"Full",value:"full"},{label:"Medium",value:"medium"},{label:"Small",value:"small"}],L=[{label:"Inherit",value:"inherit"},{label:"Custom",value:"custom"},{label:"Unset",value:"unset"}],y={type:"inherit",value:1500};function z(){const{metaValue:e,setMetaValue:o}=d("_brandy_container_layout"),{metaValue:t,setMetaValue:s}=d("_brandy_container_max_width"),a=r=>{o(r)},i=r=>{s({...t??y,type:r})},l=r=>{s({...t??y,value:r})};return I(()=>{let r="inherit";e=="full"&&(r="100%"),e=="medium"&&(r="80%"),e=="small"&&(r="60%");let c="";(t==null?void 0:t.type)==="custom"&&(c=`--theme-container-max-width:${t.value?`${t.value}px`:"100%"};`),(t==null?void 0:t.type)==="unset"&&(c="--theme-container-max-width:100%;"),g("post_content",`body{--theme-container-width:${r};${c}}`)},[e,t]),n.jsxs(O,{title:"Content",children:[n.jsxs("div",{children:[n.jsxs("div",{style:{marginBottom:10},children:[p("Container layout","brandy"),n.jsx(m,{content:p("This will affect content width for this post")})]}),n.jsx(h,{options:N,selected:e??"inherit",onChange:a})]}),n.jsxs("div",{style:{marginTop:20},children:[n.jsxs("div",{style:{marginBottom:10},children:[p("Container max width","brandy"),n.jsx(m,{content:p("This will affect content max width for this post")})]}),n.jsx(h,{options:L,selected:(t==null?void 0:t.type)??"inherit",onChange:i}),(t==null?void 0:t.type)==="custom"&&n.jsx("div",{style:{marginTop:10},children:n.jsx(V,{value:(t==null?void 0:t.value)??1500,onChange:l})})]})]})}const{useEffect:A}=window.React,{__:F}=window.wp.i18n,{PanelBody:H}=window.wp.components;function q(){const{metaValue:e,setMetaValue:o}=d("_brandy_title_display"),t=s=>{o(s?"show":"hide")};return A(()=>{g("post_title",`body{--page-title-display:${e==="hide"?"none":"block"}}`)},[e]),n.jsx(H,{title:"Title",children:n.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[n.jsx("span",{children:F("Display title?","brandy")}),n.jsx(R,{checked:e!="hide",onChange:t})]})})}const{__:G}=window.wp.i18n,{PanelBody:U}=window.wp.components,J=[{label:"Inherit",value:"inherit"},{label:"Enable",value:"enable"},{label:"Disable",value:"disable"}];function Y(){const{metaValue:e,setMetaValue:o}=d("_brandy_post_header_transparent"),t=s=>{o(s)};return n.jsx(U,{title:"Header Transparent",children:n.jsxs("div",{children:[n.jsx("div",{style:{marginBottom:10},children:G("Transparent options","brandy")}),n.jsx(h,{options:J,selected:e??"inherit",onChange:t})]})})}function v({options:e=[],selected:o,onChange:t}){const s=a=>{t(a.target.value)};return n.jsx("select",{className:"brandy-editor-select",value:o,onChange:s,onfocus:"this.size=10;",onblur:"this.size=1;",children:e.map((a,i)=>n.jsx("option",{value:a.value,children:a.label},i))})}const{__:_}=window.wp.i18n,{PanelBody:K}=window.wp.components,{templates:Q}=window.brandyBlockEditorData.header_settings,W=[{label:"Inherit",value:"inherit"},...Q.map(({settings:{name:e},id:o})=>({label:e,value:o}))];function X(){const{metaValue:e,setMetaValue:o}=d("_brandy_post_header_template"),t=s=>{o(s)};return n.jsx(K,{title:_("Header Template"),children:n.jsxs("div",{children:[n.jsx(v,{options:W,selected:e??"inherit",onChange:t}),n.jsx("a",{style:{marginTop:10,display:"inline-block"},href:window.brandyBlockEditorData.links.customizer+"?action=brandy_quick_setting&panel=header",children:_("Add your custom header")})]})})}const{__:b}=window.wp.i18n,{PanelBody:Z}=window.wp.components,{templates:M}=window.brandyBlockEditorData.footer_settings,ee=[{label:"Inherit",value:"inherit"},...M.map(({settings:{name:e},id:o})=>({label:e,value:o}))];function te(){const{metaValue:e,setMetaValue:o}=d("_brandy_post_footer_template"),t=s=>{o(s)};return n.jsx(Z,{title:b("Footer Template"),children:n.jsxs("div",{children:[n.jsx(v,{options:ee,selected:e??"inherit",onChange:t}),n.jsx("a",{style:{marginTop:10,display:"inline-block"},href:window.brandyBlockEditorData.links.customizer+"?action=brandy_quick_setting&panel=footer",children:b("Add your custom footer")})]})})}const{registerPlugin:ne}=window.wp.plugins,{__:oe}=window.wp.i18n,{PluginSidebar:se}=window.wp.editPost,ie=()=>n.jsxs(se,{name:"brandy-page-settings",title:oe("Brandy page settings","brandy"),children:[n.jsx(q,{}),n.jsx(z,{}),n.jsx(Y,{}),n.jsx(X,{}),n.jsx(te,{})]});ne("brandy",{render:ie});