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