JezK
Edit File: index.js
/*! For license information please see index.js.LICENSE.txt */ (()=>{"use strict";var e,t,o={93450:(e,t,o)=>{o.d(t,{A:()=>r});var n=o(86087),r=(0,n.forwardRef)(({icon:e,size:t=24,...o},r)=>(0,n.cloneElement)(e,{width:t,height:t,...o,ref:r}))},94462:(e,t,o)=>{o.d(t,{A:()=>i});var n=o(39793),r=o(5573),i=(0,n.jsx)(r.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,n.jsx)(r.Path,{d:"M5.5 12h1.75l-2.5 3-2.5-3H4a8 8 0 113.134 6.35l.907-1.194A6.5 6.5 0 105.5 12zm9.53 1.97l-2.28-2.28V8.5a.75.75 0 00-1.5 0V12a.747.747 0 00.218.529l1.282-.84-1.28.842 2.5 2.5a.75.75 0 101.06-1.061z"})})},69312:(e,t,o)=>{o.d(t,{x:()=>f});var n=o(56427),r=o(27723),i=o(86087),a=o(47143),s=o(39793);const l=({groupedTags:e,activeCategory:t,onCategorySelect:o})=>{const a=e=>e===t?"woocommerce-personalization-tags-modal-menu-item-active":"";return(0,s.jsxs)(n.MenuGroup,{className:"woocommerce-personalization-tags-modal-menu",children:[(0,s.jsx)(n.MenuItem,{onClick:()=>o(null),className:a(null),children:(0,r.__)("All","woocommerce")}),(0,s.jsx)("div",{className:"woocommerce-personalization-tags-modal-menu-separator","aria-hidden":"true",role:"presentation","data-testid":"woocommerce-personalization-tags-modal-menu-separator"}),Object.keys(e).map((e,t,r)=>(0,s.jsxs)(i.Fragment,{children:[(0,s.jsx)(n.MenuItem,{onClick:()=>o(e),className:a(e),children:e}),t<r.length-1&&(0,s.jsx)("div",{className:"woocommerce-personalization-tags-modal-menu-separator","aria-hidden":"true",role:"presentation","data-testid":"woocommerce-personalization-tags-modal-menu-separator"})]},e))]})};var c=o(94715);const d=({groupedTags:e,activeCategory:t,onInsert:o,canInsertLink:i,closeCallback:l,openLinkModal:d})=>{const{updateBlockAttributes:u}=(0,a.useDispatch)(c.store),p=(0,a.useSelect)(e=>e(c.store).getSelectedBlockClientId()),m=(0,a.useSelect)(e=>e(c.store).getBlock(p)),f=["core/button"].includes(m?.name),g=null===t?Object.entries(e):[[t,e[t]||[]]];return(0,s.jsx)(s.Fragment,{children:g.map(([e,t])=>(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"woocommerce-personalization-tags-modal-category",children:e}),(0,s.jsx)("div",{className:"woocommerce-personalization-tags-modal-category-group",children:t.map(t=>{const a=/\burl\b/.test(t.token);return(0,s.jsxs)("div",{className:"woocommerce-personalization-tags-modal-category-group-item",children:[(0,s.jsxs)("div",{className:"woocommerce-personalization-tags-modal-item-text",children:[(0,s.jsx)("strong",{children:t.name}),t.valueToInsert]}),(0,s.jsxs)("div",{style:{display:"flex",flexDirection:"column",alignItems:"flex-end"},children:[(0,s.jsx)(n.Button,{variant:"link",onClick:()=>{o&&o(t.valueToInsert,!1)},children:(0,r.__)("Insert","woocommerce")}),f&&a&&(0,s.jsx)(n.Button,{variant:"link",onClick:()=>{u(p,{url:t.valueToInsert}),l()},children:(0,r.__)("Set as URL","woocommerce")}),e===(0,r.__)("Link","woocommerce")&&i&&(0,s.jsx)(s.Fragment,{children:(0,s.jsx)(n.Button,{variant:"link",onClick:()=>{l(),d(t)},children:(0,r.__)("Insert as link","woocommerce")})})]})]},t.token)})})]},e))})},u=({onInsert:e,isOpened:t,closeCallback:o,tag:a})=>{const[l,c]=(0,i.useState)((0,r.__)("Link","woocommerce"));return t?(0,s.jsxs)(n.Modal,{size:"small",title:(0,r.__)("Insert Link","woocommerce"),onRequestClose:o,className:"woocommerce-personalization-tags-modal",children:[(0,s.jsx)(n.TextControl,{label:(0,r.__)("Link Text","woocommerce"),value:l,onChange:e=>c(e)}),(0,s.jsx)(n.Button,{isPrimary:!0,onClick:()=>{e&&e(a.token,l)},children:(0,r.__)("Insert","woocommerce")})]}):null};var p=o(36135),m=o(34923);const f=({onInsert:e,isOpened:t,closeCallback:o,canInsertLink:c=!1,openedBy:f=""})=>{const[g,h]=(0,i.useState)(null),[_,y]=(0,i.useState)(""),[b,w]=(0,i.useState)(null),[v,x]=(0,i.useState)(!1),k=(0,a.useSelect)(e=>e(m.H).getPersonalizationTagsList(),[]);if(v)return(0,s.jsx)(u,{onInsert:(t,o)=>{e(t,o),x(!1)},isOpened:v,closeCallback:()=>x(!1),tag:b});if(!t)return null;(0,p.xW)("personalization_tags_modal_opened",{openedBy:f});const S=k.reduce((e,t)=>{const{category:o,name:n,token:r}=t;return(!_||n.toLowerCase().includes(_.toLowerCase())||r.toLowerCase().includes(_.toLowerCase()))&&(e[o]||(e[o]=[]),e[o].push(t)),e},{});return(0,s.jsxs)(n.Modal,{size:"medium",title:(0,r.__)("Personalization Tags","woocommerce"),onRequestClose:()=>{o(),(0,p.yM)("personalization_tags_modal_closed",{openedBy:f})},className:"woocommerce-personalization-tags-modal",children:[(0,s.jsxs)("p",{children:[(0,r.__)("Insert personalization tags to dynamically fill in information and personalize your emails.","woocommerce")," ",(0,s.jsx)(n.ExternalLink,{href:"https://kb.mailpoet.com/article/435-a-guide-to-personalisation-tags-for-tailored-newsletters#list",onClick:()=>(0,p.yM)("personalization_tags_modal_learn_more_link_clicked",{openedBy:f}),children:(0,r.__)("Learn more","woocommerce")})]}),(0,s.jsx)(n.SearchControl,{onChange:e=>{y(e),(0,p.xW)("personalization_tags_modal_search_control_input_updated",{openedBy:f})},value:_}),(0,s.jsx)(l,{groupedTags:S,activeCategory:g,onCategorySelect:e=>{h(e),(0,p.yM)("personalization_tags_modal_category_menu_clicked",{category:e,openedBy:f})}}),(0,s.jsx)(d,{groupedTags:S,activeCategory:g,onInsert:t=>{e(t),(0,p.yM)("personalization_tags_modal_tag_insert_button_clicked",{insertedTag:t,activeCategory:g,openedBy:f})},closeCallback:o,canInsertLink:c,openLinkModal:e=>{w(e),x(!0)}})]})}},96972:(e,t,o)=>{o.d(t,{t:()=>s});var n=o(86087),r=o(56427),i=o(27723),a=o(39793);const s=({contentRef:e,onUpdate:t})=>{const[o,s]=(0,n.useState)(!1),[l,c]=(0,n.useState)(null),[d,u]=(0,n.useState)(""),[p,m]=(0,n.useState)("");return(0,n.useEffect)(()=>{if(!e||!e.current)return;const t=e.current,o=e=>{const t=e.target.closest("span[data-rich-text-comment]");if(t){const e=t.innerText.replace(/^\[|\]$/g,"");m(e),u(e),c(t),s(!0)}};return t.addEventListener("click",o),()=>{t.removeEventListener("click",o)}},[e]),(0,a.jsx)(a.Fragment,{children:o&&l&&(0,a.jsx)(r.Popover,{position:"bottom right",onClose:()=>s(!1),anchor:l,className:"woocommerce-personalization-tag-popover",children:(0,a.jsxs)("div",{className:"woocommerce-personalization-tag-popover-content",children:[(0,a.jsx)(r.TextControl,{label:(0,i.__)("Personalization Tag","woocommerce"),value:d,onChange:e=>u(e),__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0}),(0,a.jsxs)("div",{className:"woocommerce-personalization-tag-popover-content-buttons",children:[(0,a.jsx)(r.Button,{isTertiary:!0,onClick:()=>{s(!1)},children:(0,i.__)("Cancel","woocommerce")}),(0,a.jsx)(r.Button,{isPrimary:!0,onClick:()=>{t(p,d),s(!1)},children:(0,i.__)("Update","woocommerce")})]})]})})})}},93314:(e,t,o)=>{o.d(t,{D:()=>i,E:()=>r});var n=o(50876);const r=(e,t)=>{const o=e.current.ownerDocument.defaultView.getSelection();if(!o.rangeCount)return{start:0,end:0};const r=o.getRangeAt(0);if(null===o.anchorNode.previousSibling)return{start:o.anchorOffset,end:o.anchorOffset+r.toString().length};const i=(0,n.create)({html:t});let a=o.anchorNode.previousSibling;a=function(e){let t=e;for(;t&&t?.children?.length>0;)t=t.children[0];return t}(a);const s=function(e,t){let o=null;for(const[n,r]of t.entries())if(r)for(const t of r)t?.attributes&&e.tagName.toLowerCase()===t.tagName?.toLowerCase()&&e.getAttribute("data-link-href")===t?.attributes["data-link-href"]&&(o=n);return o}(a,i.formats);if(null!==s)return{start:s+o.anchorOffset+1,end:s+o.anchorOffset+r.toString().length};const l=function(e,t){for(const[o,n]of t.entries()){if(!n)continue;const{attributes:t}=n;if(e.getAttribute("data-rich-text-comment")===t["data-rich-text-comment"])return o}return null}(a,i.replacements);return null!==l?{start:l+o.anchorOffset+1,end:l+o.anchorOffset+r.toString().length}:{start:i.text.length,end:i.text.length+r.toString().length}},i=(e,t)=>(t.forEach(t=>{if(!e.includes(t.token.slice(0,t.token.length-1)))return;const o=t.token.substring(1,t.token.length-1).replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),n=new RegExp(`(?<!\x3c!--)(?<!["'])\\[(${o}(\\s[^\\]]*)?)\\](?!--\x3e)`,"g");e=e.replace(n,e=>`\x3c!--${e}--\x3e`)}),e)},36208:(e,t,o)=>{o.d(t,{O:()=>g});var n=o(56427),r=o(47143),i=o(86087),a=o(50876),s=o(94715),l=o(27723),c=o(69312),d=o(93314),u=o(34923),p=o(96972),m=o(36135),f=o(39793);function g({label:e,labelSuffix:t,help:o,placeholder:g,attributeName:h,attributeValue:_,updateProperty:y=()=>{}}){const[b,w]=(0,i.useState)(null),[v,x]=(0,i.useState)(!1),k=(0,r.useSelect)(e=>e(u.H).getPersonalizationTagsList(),[]),S=(0,i.useRef)(null),j=(0,i.useCallback)((e,t,o)=>{const n=o?.start??t.length,r=o?.end??t.length;let i=(0,a.create)({html:t});i=(0,a.insert)(i,(0,a.create)({html:`\x3c!--${e}--\x3e`}),n,r);const s=(0,a.toHTMLString)({value:i});y(h,s),w(null)},[h,y]),E=(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)("span",{children:e}),(0,f.jsx)(n.Button,{className:"woocommerce-settings-panel-personalization-tags-button",icon:"shortcode",title:(0,l.__)("Personalization Tags","woocommerce"),onClick:()=>{x(!0),(0,m.yM)("rich_text_with_button_personalization_tags_shortcode_icon_clicked",{attributeName:h,label:e})}}),t]});return h?(0,f.jsxs)(n.BaseControl,{id:"",label:E,className:`woocommerce-settings-panel-${h}-text`,help:o,__nextHasNoMarginBottom:!0,children:[(0,f.jsx)(c.x,{isOpened:v,onInsert:e=>{j(e,_??"",b),x(!1),(0,m.yM)("rich_text_with_button_personalization_tags_inserted",{attributeName:h,value:e})},closeCallback:()=>x(!1),openedBy:"RichTextWithButton-BaseControl"}),(0,f.jsx)(p.t,{contentRef:S,onUpdate:(e,t)=>{const o=(_??"").replace(`\x3c!--[${e}]--\x3e`,`\x3c!--[${t}]--\x3e`);y(h,o)}}),(0,f.jsx)(s.RichText,{ref:S,className:"woocommerce-settings-panel-richtext",placeholder:g,onFocus:()=>{w((0,d.E)(S,_??""))},onKeyUp:()=>{w((0,d.E)(S,_??""))},onClick:()=>{w((0,d.E)(S,_??""))},onChange:e=>{e=(0,d.D)(e??"",k),y(h,e),(0,m.xW)("rich_text_with_button_input_field_updated",{attributeName:h})},value:_??"","data-automation-id":`email_${h}`})]}):null}},7919:(e,t,o)=>{o.d(t,{P:()=>_});var n=o(56427),r=o(47143),i=o(93450),a=o(39793),s=o(5573),l=(0,a.jsx)(s.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,a.jsx)(s.Path,{d:"M16.5 7.5 10 13.9l-2.5-2.4-1 1 3.5 3.6 7.5-7.6z"})}),c=o(27723),d=o(86087),u=o(48558);const p=window.wp.url;var m=o(52619),f=o(34923),g=o(30515),h=o(36135);const _=(0,d.memo)(function(){const e=(0,d.useRef)(null),{requestSendingNewsletterPreview:t,togglePreviewModal:o,updateSendPreviewEmail:s}=(0,r.useDispatch)(f.H),{toEmail:_,isSendingPreviewEmail:y,sendingPreviewStatus:b,isModalOpened:w,errorMessage:v,postType:x}=(0,r.useSelect)(e=>({...e(f.H).getPreviewState(),postType:e(f.H).getEmailPostType()}),[]),k=()=>{t(_)},S=(0,d.useMemo)(()=>(0,m.applyFilters)("woocommerce_email_editor_check_sending_method_configuration_link",`https://www.mailpoet.com/blog/mailpoet-smtp-plugin/?utm_source=woocommerce_email_editor&utm_medium=plugin&utm_source_platform=${x}`),[x]),j=()=>{(0,h.yM)("send_preview_email_modal_closed"),o(!1)};return(0,d.useEffect)(()=>{w&&(e.current?.focus(),(0,h.yM)("send_preview_email_modal_opened"))},[w]),w?(0,a.jsxs)(n.Modal,{className:"woocommerce-send-preview-email",title:(0,c.__)("Send a test email","woocommerce"),onRequestClose:j,focusOnMount:!1,children:[b===g.T.ERROR?(0,a.jsxs)("div",{className:"woocommerce-send-preview-modal-notice-error",children:[(0,a.jsx)("p",{children:(0,c.__)("Sorry, we were unable to send this email.","woocommerce")}),(0,a.jsx)("strong",{children:v&&(0,c.sprintf)((0,c.__)("Error: %s","woocommerce"),v)}),(0,a.jsxs)("ul",{children:[(0,a.jsx)("li",{children:S&&(0,d.createInterpolateElement)((0,c.__)("Please check your <link>sending method configuration</link> with your hosting provider.","woocommerce"),{link:(0,a.jsx)("a",{href:S,target:"_blank",rel:"noopener noreferrer",onClick:()=>(0,h.yM)("send_preview_email_modal_check_sending_method_configuration_link_clicked")})})}),(0,a.jsx)("li",{children:(0,d.createInterpolateElement)((0,c.__)("Or, sign up for MailPoet Sending Service to easily send emails. <link>Sign up for free</link>","woocommerce"),{link:(0,a.jsx)("a",{href:`https://account.mailpoet.com/?s=1&g=1&utm_source=woocommerce_email_editor&utm_medium=plugin&utm_source_platform=${x}`,target:"_blank",rel:"noopener noreferrer",onClick:()=>(0,h.yM)("send_preview_email_modal_sign_up_for_mailpoet_sending_service_link_clicked")},"sign-up-for-free")})})]})]}):null,(0,a.jsx)("p",{children:(0,c.__)("Send yourself a test email to test how your email would look like in different email apps.","woocommerce")}),(0,a.jsx)(n.TextControl,{label:(0,c.__)("Send to","woocommerce"),onChange:e=>{s(e),(0,h.xW)("send_preview_email_modal_send_to_field_updated")},onKeyDown:e=>{const{keyCode:t}=e;t===u.ENTER&&(e.preventDefault(),k(),(0,h.yM)("send_preview_email_modal_send_to_field_key_code_enter"))},className:"woocommerce-send-preview-email__send-to-field",value:_,type:"email",ref:e,required:!0,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0}),b===g.T.SUCCESS?(0,a.jsxs)("p",{className:"woocommerce-send-preview-modal-notice-success",children:[(0,a.jsx)(i.A,{icon:l,style:{fill:"#4AB866"}}),(0,c.__)("Test email sent successfully!","woocommerce")]}):null,(0,a.jsxs)("div",{className:"woocommerce-send-preview-modal-footer",children:[(0,a.jsx)(n.Button,{variant:"tertiary",onClick:()=>{(0,h.yM)("send_preview_email_modal_close_button_clicked"),j()},children:(0,c.__)("Cancel","woocommerce")}),(0,a.jsx)(n.Button,{variant:"primary",onClick:()=>{k(),(0,h.yM)("send_preview_email_modal_send_test_email_button_clicked")},disabled:y||!(0,p.isEmail)(_),children:y?(0,c.__)("Sending…","woocommerce"):(0,c.__)("Send test email","woocommerce")})]})]}):null})},28129:(e,t,o)=>{o.d(t,{i:()=>d});var n=o(27723),r=o(56427),i=o(47143),a=o(43656),s=o(34923),l=o(36135),c=o(39793);function d({close:e}){(0,l.xW)("edit_template_modal_opened");const{onNavigateToEntityRecord:t,template:o}=(0,i.useSelect)(e=>{const{getEditorSettings:t}=e(a.store),o=t();return{onNavigateToEntityRecord:o?.onNavigateToEntityRecord,template:e(s.H).getCurrentTemplate()}},[]);return(0,c.jsxs)(r.Modal,{size:"medium",onRequestClose:e,__experimentalHideHeader:!0,children:[(0,c.jsx)("p",{children:(0,n.__)("This template is used by multiple emails. Any changes made would affect other emails on the site. Are you sure you want to edit the template?","woocommerce")}),(0,c.jsxs)(r.Flex,{justify:"end",children:[(0,c.jsx)(r.FlexItem,{children:(0,c.jsx)(r.Button,{variant:"tertiary",onClick:()=>{(0,l.yM)("edit_template_modal_cancel_button_clicked"),e()},children:(0,n.__)("Cancel","woocommerce")})}),(0,c.jsx)(r.FlexItem,{children:(0,c.jsx)(r.Button,{variant:"primary",onClick:()=>{(0,l.yM)("edit_template_modal_continue_button_clicked",{templateId:o.id}),t?.({postId:o.id,postType:"wp_template"})},disabled:!o.id||!t,children:(0,n.__)("Edit template","woocommerce")})})]})]})}},20418:(e,t,o)=>{o.d(t,{L:()=>p,O:()=>f});var n=o(27723),r=o(52619),i=o(86087),a=o(56427),s=o(43656),l=o(36208),c=o(36135),d=o(39793);const u={recordEvent:c.yM,recordEventOnce:c.xW,debouncedRecordEvent:c.T7},{Fill:p,Slot:m}=(0,a.createSlotFill)("WooCommerceEmailEditorPostSummarySection");function f(){const e=(0,i.useMemo)(()=>(0,r.applyFilters)("woocommerce_email_editor_setting_sidebar_extension_component",l.O,u),[]);return(0,d.jsxs)(s.PluginDocumentSettingPanel,{name:"email-settings-panel",title:(0,n.__)("Settings","woocommerce"),className:"woocommerce-email-editor__settings-panel",children:[(0,d.jsx)(m,{}),(0,d.jsx)(s.ErrorBoundary,{canCopyContent:!0,children:(0,d.jsx)(e,{})})]})}},38084:(e,t,o)=>{o.d(t,{x:()=>m});var n=o(56427),r=o(27723),i=o(47143),a=o(86087),s=o(34923),l=o(28129),c=o(99800),d=o(36135),u=o(51831),p=o(39793);function m(){const{template:e,currentEmailContent:t,canUpdateTemplates:o,postType:m}=(0,i.useSelect)(e=>({template:e(s.H).getCurrentTemplate(),currentEmailContent:e(s.H).getEditedEmailContent(),canUpdateTemplates:e(s.H).canUserEditTemplates(),postType:e(s.H).getEmailPostType()}),[]),[f]=(0,u.p)("swap"),[g,h]=(0,a.useState)(!1),[_,y]=(0,a.useState)(!1);return(0,p.jsxs)(p.Fragment,{children:[e&&(0,p.jsx)(n.PanelRow,{children:(0,p.jsxs)(n.Flex,{justify:"start",children:[(0,p.jsx)(n.FlexItem,{className:"editor-post-panel__row-label",children:(0,r.__)("Template","woocommerce")}),(0,p.jsxs)(n.FlexItem,{children:[!(f?.length>1||o)&&(0,p.jsx)("b",{children:e?.title}),(f?.length>1||o)&&(0,p.jsx)(n.DropdownMenu,{icon:null,text:e?.title,toggleProps:{variant:"tertiary"},label:(0,r.__)("Template actions","woocommerce"),onToggle:t=>(0,d.yM)("sidebar_template_actions_clicked",{currentTemplate:e?.title,isOpen:t}),children:({onClose:e})=>(0,p.jsxs)(p.Fragment,{children:[o&&(0,p.jsx)(n.MenuItem,{onClick:()=>{(0,d.yM)("sidebar_template_actions_edit_template_clicked"),h(!0),e()},children:(0,r.__)("Edit template","woocommerce")}),f?.length>1&&(0,p.jsx)(n.MenuItem,{onClick:()=>{(0,d.yM)("sidebar_template_actions_swap_template_clicked"),y(!0),e()},children:(0,r.__)("Swap template","woocommerce")})]})})]})]})}),g&&(0,p.jsx)(l.i,{close:()=>((0,d.yM)("edit_template_modal_closed"),h(!1))}),_&&(0,p.jsx)(c.i,{onSelectCallback:()=>y(!1),closeCallback:()=>y(!1),previewContent:t,postType:m})]})}},99800:(e,t,o)=>{o.d(t,{i:()=>an});var n=o(86087),r=o(43656),i=o(3582),a=o(47143),s=o(56427),l=o(27723),c=o(51609),d=o.t(c,2);const u="undefined"!=typeof document?c.useLayoutEffect:()=>{},p={...d},m={};function f(e,t){const o=c.useRef(m);return o.current===m&&(o.current=e(t)),o}const g=p.useInsertionEffect,h=g&&g!==p.useLayoutEffect?g:e=>e();function _(e){const t=f(y).current;return t.next=e,h(t.effect),t.trampoline}function y(){const e={next:void 0,callback:b,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function b(){}const w=function(e,...t){const o=new URL("https://base-ui.com/production-error");return o.searchParams.set("code",e.toString()),t.forEach(e=>o.searchParams.append("args[]",e)),`Base UI error #${e}; visit ${o} for the full message.`};function v(e,t,o,n){const r=f(x).current;return function(e,t,o,n,r){return e.refs[0]!==t||e.refs[1]!==o||e.refs[2]!==n||e.refs[3]!==r}(r,e,t,o,n)&&k(r,[e,t,o,n]),r.callback}function x(){return{callback:null,cleanup:null,refs:[]}}function k(e,t){e.refs=t,t.every(e=>null==e)?e.callback=null:e.callback=o=>{if(e.cleanup&&(e.cleanup(),e.cleanup=null),null!=o){const n=Array(t.length).fill(null);for(let e=0;e<t.length;e+=1){const r=t[e];if(null!=r)switch(typeof r){case"function":{const t=r(o);"function"==typeof t&&(n[e]=t);break}case"object":r.current=o}}e.cleanup=()=>{for(let e=0;e<t.length;e+=1){const o=t[e];if(null!=o)switch(typeof o){case"function":{const t=n[e];"function"==typeof t?t():o(null);break}case"object":o.current=null}}}}}}const S=parseInt(c.version,10);function j(e){return S>=e}function E(e){if(!c.isValidElement(e))return null;const t=e,o=t.props;return(j(19)?o?.ref:t.ref)??null}function T(e,t){return e&&!t?e:!e&&t?t:e||t?{...e,...t}:void 0}function C(){}const M=Object.freeze([]),N=Object.freeze({}),z={};function P(e,t,o,n,r){if(!(o||n||r||e))return I(t);let i=I(e);return t&&(i=R(i,t)),o&&(i=R(i,o)),n&&(i=R(i,n)),r&&(i=R(i,r)),i}function I(e){return B(e)?{...L(e,z)}:function(e){const t={...e};for(const e in t){const o=t[e];A(e,o)&&(t[e]=F(o))}return t}(e)}function R(e,t){return B(t)?L(t,e):function(e,t){if(!t)return e;for(const o in t){const n=t[o];switch(o){case"style":e[o]=T(e.style,n);break;case"className":e[o]=O(e.className,n);break;default:A(o,n)?e[o]=H(e[o],n):e[o]=n}}return e}(e,t)}function A(e,t){const o=e.charCodeAt(0),n=e.charCodeAt(1),r=e.charCodeAt(2);return 111===o&&110===n&&r>=65&&r<=90&&("function"==typeof t||void 0===t)}function B(e){return"function"==typeof e}function L(e,t){return B(e)?e(t):e??z}function H(e,t){return t?e?(...o)=>{const n=o[0];if(D(n)){const r=n;$(r);const i=t(...o);return r.baseUIHandlerPrevented||e?.(...o),i}const r=t(...o);return e?.(...o),r}:F(t):e}function F(e){return e?(...t)=>{const o=t[0];return D(o)&&$(o),e(...t)}:e}function $(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function O(e,t){return t?e?t+" "+e:t:e}function D(e){return null!=e&&"object"==typeof e&&"nativeEvent"in e}function V(e,t,o={}){const n=t.render,r=function(e,t={}){const{className:o,style:n,render:r}=e,{state:i=N,ref:a,props:s,stateAttributesMapping:l,enabled:c=!0}=t,d=c?function(e,t){return"function"==typeof e?e(t):e}(o,i):void 0,u=c?function(e,t){return"function"==typeof e?e(t):e}(n,i):void 0,p=c?function(e,t){const o={};for(const n in e){const r=e[n];if(t?.hasOwnProperty(n)){const e=t[n](r);null!=e&&Object.assign(o,e);continue}!0===r?o[`data-${n.toLowerCase()}`]="":r&&(o[`data-${n.toLowerCase()}`]=r.toString())}return o}(i,l):N,m=c&&s?function(e){return Array.isArray(e)?function(e){if(0===e.length)return z;if(1===e.length)return I(e[0]);let t=I(e[0]);for(let o=1;o<e.length;o+=1)t=R(t,e[o]);return t}(e):P(void 0,e)}(s):void 0,g=c?T(p,m)??{}:N;return"undefined"!=typeof document&&(c?Array.isArray(a)?g.ref=function(e){const t=f(x).current;return function(e,t){return e.refs.length!==t.length||e.refs.some((e,o)=>e!==t[o])}(t,e)&&k(t,e),t.callback}([g.ref,E(r),...a]):g.ref=v(g.ref,E(r),a):v(null,null)),c?(void 0!==d&&(g.className=O(g.className,d)),void 0!==u&&(g.style=T(g.style,u)),g):N}(t,o);return!1===o.enabled?null:function(e,t,o,n){if(t){if("function"==typeof t)return t(o,n);const e=P(o,t.props);e.ref=o.ref;let r=t;return r?.$$typeof===W&&(r=c.Children.toArray(t)[0]),c.cloneElement(r,e)}if(e&&"string"==typeof e)return function(e,t){return"button"===e?(0,c.createElement)("button",{type:"button",...t,key:t.key}):"img"===e?(0,c.createElement)("img",{alt:"",...t,key:t.key}):c.createElement(e,t)}(e,o);throw new Error(w(8))}(e,n,r,o.state??N)}const W=Symbol.for("react.lazy"),G=c.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},elementsRef:{current:[]},nextIndexRef:{current:0}});var U=o(39793);function q(e){const{children:t,elementsRef:o,labelsRef:n,onMapChange:r}=e,i=_(r),a=c.useRef(0),s=f(Z).current,l=f(K).current,[d,p]=c.useState(0),m=c.useRef(d),g=_((e,t)=>{l.set(e,t??null),m.current+=1,p(m.current)}),h=_(e=>{l.delete(e),m.current+=1,p(m.current)}),y=c.useMemo(()=>{const e=new Map;return Array.from(l.keys()).filter(e=>e.isConnected).sort(Y).forEach((t,o)=>{const n=l.get(t)??{};e.set(t,{...n,index:o})}),e},[l,d]);u(()=>{if("function"!=typeof MutationObserver||0===y.size)return;const e=new MutationObserver(e=>{const t=new Set,o=e=>t.has(e)?t.delete(e):t.add(e);e.forEach(e=>{e.removedNodes.forEach(o),e.addedNodes.forEach(o)}),0===t.size&&(m.current+=1,p(m.current))});return y.forEach((t,o)=>{o.parentElement&&e.observe(o.parentElement,{childList:!0})}),()=>{e.disconnect()}},[y]),u(()=>{m.current===d&&(o.current.length!==y.size&&(o.current.length=y.size),n&&n.current.length!==y.size&&(n.current.length=y.size),a.current=y.size),i(y)},[i,y,o,n,d]),u(()=>()=>{o.current=[]},[o]),u(()=>()=>{n&&(n.current=[])},[n]);const b=_(e=>(s.add(e),()=>{s.delete(e)}));u(()=>{s.forEach(e=>e(y))},[s,y]);const w=c.useMemo(()=>({register:g,unregister:h,subscribeMapChange:b,elementsRef:o,labelsRef:n,nextIndexRef:a}),[g,h,b,o,n,a]);return(0,U.jsx)(G.Provider,{value:w,children:t})}function K(){return new Map}function Z(){return new Set}function Y(e,t){const o=e.compareDocumentPosition(t);return o&Node.DOCUMENT_POSITION_FOLLOWING||o&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:o&Node.DOCUMENT_POSITION_PRECEDING||o&Node.DOCUMENT_POSITION_CONTAINS?1:0}const J=c.createContext(void 0);function X(){const e=c.useContext(J);if(void 0===e)throw new Error(w(64));return e}let Q=function(e){return e.activationDirection="data-activation-direction",e.orientation="data-orientation",e}({});const ee={tabActivationDirection:e=>({[Q.activationDirection]:e})};function te(e,t,o,n){let r=!1,i=!1;const a=n??N;return{reason:e,event:t??new Event("base-ui"),cancel(){r=!0},allowPropagation(){i=!0},get isCanceled(){return r},get isPropagationAllowed(){return i},trigger:o,...a}}const oe="none",ne="missing",re="initial",ie=c.forwardRef(function(e,t){const{className:o,defaultValue:n=0,onValueChange:r,orientation:i="horizontal",render:a,value:s,style:l,...d}=e,p=void 0!==e.defaultValue,m=c.useRef([]),[f,g]=c.useState(()=>new Map),[h,y]=function({controlled:e,default:t,name:o,state:n="value"}){const{current:r}=c.useRef(void 0!==e),[i,a]=c.useState(t);return[r?e:i,c.useCallback(e=>{r||a(e)},[])]}({controlled:s,default:n,name:"Tabs",state:"value"}),b=void 0!==s,[w,v]=c.useState(()=>new Map),x=c.useCallback(e=>{if(void 0===e)return null;for(const[t,o]of w.entries())if(null!=o&&e===(o.value??o.index))return t;return null},[w]),[k,S]=c.useState(()=>({previousValue:h,tabActivationDirection:"none"})),{previousValue:j,tabActivationDirection:E}=k;let T=E,C=!1;j!==h&&(T=ae(j,h,i,w),C=null!=j&&null!=h&&null==x(h));const M=C?j:h,N=j!==M||E!==T;u(()=>{N&&S({previousValue:M,tabActivationDirection:T})},[M,N,T]);const z=_((e,t)=>{const o=ae(h,e,i,w);t.activationDirection=o,r?.(e,t),t.isCanceled||y(e)}),P=_((e,t)=>{r?.(e,te(t,void 0,void 0,{activationDirection:"none"}))}),I=_((e,t)=>{g(o=>{if(o.get(e)===t)return o;const n=new Map(o);return n.set(e,t),n})}),R=_((e,t)=>{g(o=>{if(!o.has(e)||o.get(e)!==t)return o;const n=new Map(o);return n.delete(e),n})}),A=c.useCallback(e=>f.get(e),[f]),B=c.useCallback(e=>{for(const t of w.values())if(e===t?.value)return t?.id},[w]),L=c.useMemo(()=>({getTabElementBySelectedValue:x,getTabIdByPanelValue:B,getTabPanelIdByValue:A,onValueChange:z,orientation:i,registerMountedTabPanel:I,setTabMap:v,unregisterMountedTabPanel:R,tabActivationDirection:T,value:h}),[x,B,A,z,i,I,v,R,T,h]),H=c.useMemo(()=>{for(const e of w.values())if(null!=e&&e.value===h)return e},[w,h]),F=c.useMemo(()=>{for(const e of w.values())if(null!=e&&!e.disabled)return e.value},[w]),$=c.useRef(!p),O=c.useRef(p),D=c.useRef(!1);u(()=>{if(b)return;function e(e,t){y(e),S(t=>t.previousValue===e&&"none"===t.tabActivationDirection?t:{previousValue:e,tabActivationDirection:"none"}),P(e,t),$.current=!1}if(0===w.size){if(!D.current||null===h)return;return void e(null,ne)}D.current=!0;const t=H?.disabled,o=null==H&&null!==h;if(t||h!==n||(O.current=!1),O.current&&t&&h===n)return;const r=$.current;if(t||o){const o=F??null;if(h===o)return void($.current=!1);let n=ne;return r?n=re:t&&(n="disabled"),void e(o,n)}r&&null!=H&&(P(h,re),$.current=!1)},[n,F,b,P,H,y,w,h]);const W=V("div",e,{state:{orientation:i,tabActivationDirection:T},ref:t,props:d,stateAttributesMapping:ee});return(0,U.jsx)(J.Provider,{value:L,children:(0,U.jsx)(q,{elementsRef:m,children:W})})});function ae(e,t,o,n){if(null==e||null==t)return"none";let r=null,i=null;for(const[o,a]of n.entries()){if(null==a)continue;const n=a.value??a.index;if(e===n&&(r=o),t===n&&(i=o),null!=r&&null!=i)break}if(null==r||null==i)return r===i||"number"!=typeof e&&"string"!=typeof e||typeof e!=typeof t?"none":"horizontal"===o?t>e?"right":"left":t>e?"down":"up";const a=r.getBoundingClientRect(),s=i.getBoundingClientRect();if("horizontal"===o){if(s.left<a.left)return"left";if(s.left>a.left)return"right"}else{if(s.top<a.top)return"up";if(s.top>a.top)return"down"}return"none"}var se=function({children:e}){return(0,U.jsx)(U.Fragment,{children:e})},le=(0,n.forwardRef)(function({...e},t){return(0,U.jsx)(se,{children:(0,U.jsx)(ie,{ref:t,...e})})}),ce=o(4921);function de(e){return j(19)?e:e?"true":void 0}let ue=0;const pe=p.useId;function me(e){return function(e,t){if(void 0!==pe){const o=pe();return e??(t?`${t}-${o}`:o)}return function(e,t="mui"){const[o,n]=c.useState(e),r=e||o;return c.useEffect(()=>{null==o&&(ue+=1,n(`${t}-${ue}`))},[o,t]),r}(e,t)}(e,"base-ui")}let fe=function(e){return e.startingStyle="data-starting-style",e.endingStyle="data-ending-style",e}({});const ge={[fe.startingStyle]:""},he={[fe.endingStyle]:""},_e={transitionStatus:e=>"starting"===e?ge:"ending"===e?he:null},ye=window.ReactDOM,be=[],we=null;globalThis.requestAnimationFrame;const ve=new class{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=e=>{this.isScheduled=!1;const t=this.callbacks,o=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,o>0)for(let o=0;o<t.length;o+=1)t[o]?.(e)};request(e){const t=this.nextId;return this.nextId+=1,this.callbacks.push(e),this.callbacksCount+=1,this.isScheduled||(requestAnimationFrame(this.tick),this.isScheduled=!0),t}cancel(e){const t=e-this.startId;t<0||t>=this.callbacks.length||(this.callbacks[t]=null,this.callbacksCount-=1)}};class xe{static create(){return new xe}static request(e){return ve.request(e)}static cancel(e){return ve.cancel(e)}currentId=we;request(e){this.cancel(),this.currentId=ve.request(()=>{this.currentId=we,e()})}cancel=()=>{this.currentId!==we&&(ve.cancel(this.currentId),this.currentId=we)};disposeEffect=()=>this.cancel}function ke(e){const{enabled:t=!0,open:o,ref:n,onComplete:r}=e,i=_(r),a=function(e,t=!1,o=!0){const n=function(){const e=f(xe.create).current;var t;return t=e.disposeEffect,c.useEffect(t,be),e}();return _((r,i=null)=>{n.cancel();const a=null==(s=e)?s:"current"in s?s.current:s;var s;if(null==a)return;const l=a,c=()=>{ye.flushSync(r)};if("function"!=typeof l.getAnimations||globalThis.BASE_UI_ANIMATIONS_DISABLED)r();else{if(t){const e=fe.startingStyle;if(!l.hasAttribute(e))return void n.request(d);const t=new MutationObserver(()=>{l.hasAttribute(e)||(t.disconnect(),d())});return t.observe(l,{attributes:!0,attributeFilter:[e]}),void i?.addEventListener("abort",()=>t.disconnect(),{once:!0})}n.request(d)}function d(){Promise.all(l.getAnimations().map(e=>e.finished)).then(()=>{i?.aborted||c()}).catch(()=>{if(o)return void(i?.aborted||c());const e=l.getAnimations();!i?.aborted&&e.length>0&&e.some(e=>e.pending||"finished"!==e.playState)&&d()})}})}(n,o,!1);c.useEffect(()=>{if(!t)return;const e=new AbortController;return a(i,e.signal),()=>{e.abort()}},[t,o,i,a])}let Se=function(e){return e[e.None=0]="None",e[e.GuessFromOrder=1]="GuessFromOrder",e}({});function je(e={}){const{label:t,metadata:o,textRef:n,indexGuessBehavior:r,index:i}=e,{register:a,unregister:s,subscribeMapChange:l,elementsRef:d,labelsRef:p,nextIndexRef:m}=c.useContext(G),f=c.useRef(-1),[g,h]=c.useState(i??(r===Se.GuessFromOrder?()=>{if(-1===f.current){const e=m.current;m.current+=1,f.current=e}return f.current}:-1)),_=c.useRef(null),y=c.useCallback(e=>{if(_.current=e,-1!==g&&null!==e&&(d.current[g]=e,p)){const o=void 0!==t;p.current[g]=o?t:n?.current?.textContent??e.textContent}},[g,d,p,t,n]);return u(()=>{if(null!=i)return;const e=_.current;return e?(a(e,o),()=>{s(e)}):void 0},[i,a,s,o]),u(()=>{if(null==i)return l(e=>{const t=_.current?e.get(_.current)?.index:null;null!=t&&h(t)})},[i,l,h]),c.useMemo(()=>({ref:y,index:g}),[g,y])}let Ee=function(e){return e.index="data-index",e.activationDirection="data-activation-direction",e.orientation="data-orientation",e.hidden="data-hidden",e[e.startingStyle=fe.startingStyle]="startingStyle",e[e.endingStyle=fe.endingStyle]="endingStyle",e}({});const Te={...ee,..._e},Ce=c.forwardRef(function(e,t){const{className:o,value:n,render:r,keepMounted:i=!1,style:a,...s}=e,{value:l,getTabIdByPanelValue:d,orientation:p,tabActivationDirection:m,registerMountedTabPanel:f,unregisterMountedTabPanel:g}=X(),h=me(),_=c.useMemo(()=>({id:h,value:n}),[h,n]),{ref:y,index:b}=je({metadata:_}),w=n===l,{mounted:v,transitionStatus:x,setMounted:k}=function(e,t=!1,o=!1){const[n,r]=c.useState(e&&t?"idle":void 0),[i,a]=c.useState(e);return e&&!i&&(a(!0),r("starting")),e||!i||"ending"===n||o||r("ending"),e||i||"ending"!==n||r(void 0),u(()=>{if(!e&&i&&"ending"!==n&&o){const e=xe.request(()=>{r("ending")});return()=>{xe.cancel(e)}}},[e,i,n,o]),u(()=>{if(!e||t)return;const o=xe.request(()=>{r(void 0)});return()=>{xe.cancel(o)}},[t,e]),u(()=>{if(!e||!t)return;e&&i&&"idle"!==n&&r("starting");const o=xe.request(()=>{r("idle")});return()=>{xe.cancel(o)}},[t,e,i,n]),{mounted:i,setMounted:a,transitionStatus:n}}(w),S=!v,j=d(n),E={hidden:S,orientation:p,tabActivationDirection:m,transitionStatus:x},T=c.useRef(null),C=V("div",e,{state:E,ref:[t,y,T],props:[{"aria-labelledby":j,hidden:S,id:h,role:"tabpanel",tabIndex:w?0:-1,inert:de(!w),[Ee.index]:b},s],stateAttributesMapping:Te});return ke({open:w,ref:T,onComplete(){w||k(!1)}}),u(()=>{if((!S||i)&&null!=h)return f(n,h),()=>{g(n,h)}},[S,i,n,h,f,g]),i||v?C:null});var Me="data-wp-hash";function Ne(){const e=globalThis;return e.__wpStyleRuntime||(e.__wpStyleRuntime={documents:new Map,styles:new Map,injectedStyles:new WeakMap},"undefined"!=typeof document&&function(e){const t=Ne();t.documents.set(e,(t.documents.get(e)??0)+1);for(const[o,n]of t.styles)ze(e,o,n)}(document)),e.__wpStyleRuntime}function ze(e,t,o){if(!e.head)return;const n=Ne();let r=n.injectedStyles.get(e);if(r||(r=new Set,n.injectedStyles.set(e,r)),r.has(t))return;if(function(e,t){if(!e.head)return!1;for(const o of e.head.querySelectorAll(`style[${Me}]`))if(o.getAttribute(Me)===t)return!0;return!1}(e,t))return void r.add(t);const i=e.createElement("style");i.setAttribute(Me,t),i.appendChild(e.createTextNode(o)),e.head.appendChild(i),r.add(t)}function Pe(e,t){const o=Ne();o.styles.set(e,t);for(const n of o.documents.keys())ze(n,e,t)}Pe("d390e935a7","._6defc79820e382c6__button{box-sizing:var(--_gcd-button-box-sizing,border-box);font-family:var(--_gcd-button-font-family,inherit);font-size:var(--_gcd-button-font-size,inherit);font-weight:var(--_gcd-button-font-weight,inherit)}.d2cff2e5dea83bd1__input{box-sizing:var(--_gcd-input-box-sizing,border-box);font-family:var(--_gcd-input-font-family,inherit);font-size:var(--_gcd-input-font-size,inherit);font-weight:var(--_gcd-input-font-weight,inherit);margin:var(--_gcd-input-margin,0);&:is(textarea,[type=text],[type=password],[type=color],[type=date],[type=datetime],[type=datetime-local],[type=email],[type=month],[type=number],[type=search],[type=tel],[type=time],[type=url],[type=week]){background-color:var(--_gcd-input-background-color,transparent);border:var(--_gcd-input-border,none);border-radius:var(--_gcd-input-border-radius,0);box-shadow:var(--_gcd-input-box-shadow,0 0 0 transparent);color:var(--_gcd-input-color,var(--wpds-color-foreground-interactive-neutral,#1e1e1e));&:focus{border-color:var(--_gcd-input-border-color-focus,var(--wp-admin-theme-color));box-shadow:var(--_gcd-input-box-shadow-focus,none);outline:var(--_gcd-input-outline-focus,none)}&:disabled{background:var(--_gcd-input-background-disabled,transparent);border-color:var(--_gcd-input-border-color-disabled,transparent);box-shadow:var(--_gcd-input-box-shadow-disabled,none);color:var(--_gcd-input-color-disabled,var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d))}&::placeholder{color:var(--_gcd-input-placeholder-color,var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d))}}&:is(textarea,[type=text],[type=password],[type=date],[type=datetime],[type=datetime-local],[type=email],[type=month],[type=number],[type=search],[type=tel],[type=time],[type=url],[type=week]){line-height:var(--_gcd-input-line-height,inherit);min-height:var(--_gcd-input-min-height,auto);padding:var(--_gcd-input-padding,0)}}._547d86373d02e108__textarea{box-sizing:var(--_gcd-textarea-box-sizing,border-box);overflow:var(--_gcd-textarea-overflow,auto);resize:var(--_gcd-textarea-resize,block)}._8c15fd0ed9f28ba4__div{outline:var(--_gcd-div-outline,0 solid transparent)}p._43cec3e1eec1066d__p{font-size:var(--_gcd-p-font-size,13px);line-height:var(--_gcd-p-line-height,1.5);margin:var(--_gcd-p-margin,0)}:is(h1,h2,h3,h4,h5,h6).e97669c6d9a38497__heading{color:var(--_gcd-heading-color,var(--wpds-color-foreground-content-neutral,#1e1e1e));font-size:var(--_gcd-heading-font-size,inherit);font-weight:var(--_gcd-heading-font-weight,var(--wpds-typography-font-weight-medium,499));margin:var(--_gcd-heading-margin,0)}._2c0831b0499dbd6e__a,._2c0831b0499dbd6e__a:is(:hover,:focus,:active){border-radius:var(--_gcd-a-border-radius,0);box-shadow:var(--_gcd-a-box-shadow,none);color:var(--_gcd-a-color,inherit);outline:var(--_gcd-a-outline,0 solid transparent);transition:var(--_gcd-a-transition,none)}");Pe("5f8e7aa0bc","@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._08e8a2e44959f892__outset-ring--focus:focus,._970d04df7376df67__outset-ring--focus-within-except-active:focus-within:not(:has(:active)),.c5cb3ee4bddaa8e4__outset-ring--focus-within-visible:focus-within:has(:focus-visible),.cd83dfc2126a0846__outset-ring--focus-within:focus-within,.d0541bc9dd9dc7b6__outset-ring--focus-visible:focus-visible,.e25b2bdd7aa21721__outset-ring--focus-except-active:focus:not(:active),:focus-visible .ecadb9e080e2dfa5__outset-ring--focus-parent-visible{--_gcd-a-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9));--_gcd-div-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9));outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9));outline-offset:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px))}}}");var Ie=(0,n.forwardRef)(function({className:e,...t},o){return(0,U.jsx)(Ce,{ref:o,className:(0,ce.A)("_8c15fd0ed9f28ba4__div","d0541bc9dd9dc7b6__outset-ring--focus-visible",e),...t})}),Re=o(51831),Ae=o(34923),Be=o(5573),Le=(0,U.jsx)(Be.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,U.jsx)(Be.Path,{d:"M19 8h-1V6h-5v2h-2V6H6v2H5c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-8c0-1.1-.9-2-2-2zm.5 10c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5v-8c0-.3.2-.5.5-.5h14c.3 0 .5.2.5.5v8z"})});function He(e){return V(e.defaultTagName??"div",e,e)}var Fe="data-wp-hash";function $e(){const e=globalThis;return e.__wpStyleRuntime||(e.__wpStyleRuntime={documents:new Map,styles:new Map,injectedStyles:new WeakMap},"undefined"!=typeof document&&function(e){const t=$e();t.documents.set(e,(t.documents.get(e)??0)+1);for(const[o,n]of t.styles)Oe(e,o,n)}(document)),e.__wpStyleRuntime}function Oe(e,t,o){if(!e.head)return;const n=$e();let r=n.injectedStyles.get(e);if(r||(r=new Set,n.injectedStyles.set(e,r)),r.has(t))return;if(function(e,t){if(!e.head)return!1;for(const o of e.head.querySelectorAll(`style[${Fe}]`))if(o.getAttribute(Fe)===t)return!0;return!1}(e,t))return void r.add(t);const i=e.createElement("style");i.setAttribute(Fe,t),i.appendChild(e.createTextNode(o)),e.head.appendChild(i),r.add(t)}!function(e,t){const o=$e();o.styles.set(e,t);for(const n of o.documents.keys())Oe(n,e,t)}("7b60a246cc",'@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{.a23e08e65c8e62e5__root{text-wrap:balance;align-items:center;color:var(--wpds-color-foreground-content-neutral,#1e1e1e);display:flex;flex-direction:column;font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);gap:var(--wpds-dimension-gap-xs,4px);max-width:var(--wpds-dimension-surface-width-sm,320px);text-align:center}._01303b3680eaa216__visual{align-items:center;color:var(--wpds-color-foreground-content-neutral-weak,#707070);display:flex;justify-content:center;line-height:1;margin-block-end:var(--wpds-dimension-gap-xs,4px)}._58c8e351db225608__icon{background-color:var(--wpds-color-background-surface-neutral-weak,#f4f4f4);border:1px solid var(--wpds-color-stroke-surface-neutral-weak,#f0f0f0);border-radius:50%;padding:var(--wpds-dimension-padding-xs,4px)}.b8b96f70820333a1__title{margin:0}._70f1dd22bad55b18__description{color:var(--wpds-color-foreground-content-neutral-weak,#707070);margin:0}._89ac025fd8e2bc52__actions{align-items:center;display:flex;flex-direction:column;gap:var(--wpds-dimension-gap-xs,4px);margin-block-start:var(--wpds-dimension-gap-md,12px);@media (min-width:480px){flex-direction:row;justify-content:center}}}}');var De=(0,n.forwardRef)(function({render:e,...t},o){return He({defaultTagName:"div",render:e,ref:o,props:P({className:(0,ce.A)("a23e08e65c8e62e5__root")},t)})}),Ve=(0,n.forwardRef)(function({icon:e,size:t=24,...o},n){return(0,U.jsx)(Be.SVG,{ref:n,...e.props,...o,width:t,height:t})}),We="data-wp-hash";function Ge(){const e=globalThis;return e.__wpStyleRuntime||(e.__wpStyleRuntime={documents:new Map,styles:new Map,injectedStyles:new WeakMap},"undefined"!=typeof document&&function(e){const t=Ge();t.documents.set(e,(t.documents.get(e)??0)+1);for(const[o,n]of t.styles)Ue(e,o,n)}(document)),e.__wpStyleRuntime}function Ue(e,t,o){if(!e.head)return;const n=Ge();let r=n.injectedStyles.get(e);if(r||(r=new Set,n.injectedStyles.set(e,r)),r.has(t))return;if(function(e,t){if(!e.head)return!1;for(const o of e.head.querySelectorAll(`style[${We}]`))if(o.getAttribute(We)===t)return!0;return!1}(e,t))return void r.add(t);const i=e.createElement("style");i.setAttribute(We,t),i.appendChild(e.createTextNode(o)),e.head.appendChild(i),r.add(t)}!function(e,t){const o=Ge();o.styles.set(e,t);for(const n of o.documents.keys())Ue(n,e,t)}("7b60a246cc",'@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{.a23e08e65c8e62e5__root{text-wrap:balance;align-items:center;color:var(--wpds-color-foreground-content-neutral,#1e1e1e);display:flex;flex-direction:column;font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);gap:var(--wpds-dimension-gap-xs,4px);max-width:var(--wpds-dimension-surface-width-sm,320px);text-align:center}._01303b3680eaa216__visual{align-items:center;color:var(--wpds-color-foreground-content-neutral-weak,#707070);display:flex;justify-content:center;line-height:1;margin-block-end:var(--wpds-dimension-gap-xs,4px)}._58c8e351db225608__icon{background-color:var(--wpds-color-background-surface-neutral-weak,#f4f4f4);border:1px solid var(--wpds-color-stroke-surface-neutral-weak,#f0f0f0);border-radius:50%;padding:var(--wpds-dimension-padding-xs,4px)}.b8b96f70820333a1__title{margin:0}._70f1dd22bad55b18__description{color:var(--wpds-color-foreground-content-neutral-weak,#707070);margin:0}._89ac025fd8e2bc52__actions{align-items:center;display:flex;flex-direction:column;gap:var(--wpds-dimension-gap-xs,4px);margin-block-start:var(--wpds-dimension-gap-md,12px);@media (min-width:480px){flex-direction:row;justify-content:center}}}}');var qe=(0,n.forwardRef)(function({render:e,...t},o){return He({defaultTagName:"div",render:e,ref:o,props:P({className:(0,ce.A)("_01303b3680eaa216__visual")},t)})}),Ke="data-wp-hash";function Ze(){const e=globalThis;return e.__wpStyleRuntime||(e.__wpStyleRuntime={documents:new Map,styles:new Map,injectedStyles:new WeakMap},"undefined"!=typeof document&&function(e){const t=Ze();t.documents.set(e,(t.documents.get(e)??0)+1);for(const[o,n]of t.styles)Ye(e,o,n)}(document)),e.__wpStyleRuntime}function Ye(e,t,o){if(!e.head)return;const n=Ze();let r=n.injectedStyles.get(e);if(r||(r=new Set,n.injectedStyles.set(e,r)),r.has(t))return;if(function(e,t){if(!e.head)return!1;for(const o of e.head.querySelectorAll(`style[${Ke}]`))if(o.getAttribute(Ke)===t)return!0;return!1}(e,t))return void r.add(t);const i=e.createElement("style");i.setAttribute(Ke,t),i.appendChild(e.createTextNode(o)),e.head.appendChild(i),r.add(t)}!function(e,t){const o=Ze();o.styles.set(e,t);for(const n of o.documents.keys())Ye(n,e,t)}("7b60a246cc",'@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{.a23e08e65c8e62e5__root{text-wrap:balance;align-items:center;color:var(--wpds-color-foreground-content-neutral,#1e1e1e);display:flex;flex-direction:column;font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);gap:var(--wpds-dimension-gap-xs,4px);max-width:var(--wpds-dimension-surface-width-sm,320px);text-align:center}._01303b3680eaa216__visual{align-items:center;color:var(--wpds-color-foreground-content-neutral-weak,#707070);display:flex;justify-content:center;line-height:1;margin-block-end:var(--wpds-dimension-gap-xs,4px)}._58c8e351db225608__icon{background-color:var(--wpds-color-background-surface-neutral-weak,#f4f4f4);border:1px solid var(--wpds-color-stroke-surface-neutral-weak,#f0f0f0);border-radius:50%;padding:var(--wpds-dimension-padding-xs,4px)}.b8b96f70820333a1__title{margin:0}._70f1dd22bad55b18__description{color:var(--wpds-color-foreground-content-neutral-weak,#707070);margin:0}._89ac025fd8e2bc52__actions{align-items:center;display:flex;flex-direction:column;gap:var(--wpds-dimension-gap-xs,4px);margin-block-start:var(--wpds-dimension-gap-md,12px);@media (min-width:480px){flex-direction:row;justify-content:center}}}}');var Je=(0,n.forwardRef)(function({icon:e,className:t,...o},n){return(0,U.jsx)(qe,{ref:n,className:(0,ce.A)("_58c8e351db225608__icon",t),...o,children:(0,U.jsx)(Ve,{icon:e})})}),Xe="data-wp-hash";function Qe(){const e=globalThis;return e.__wpStyleRuntime||(e.__wpStyleRuntime={documents:new Map,styles:new Map,injectedStyles:new WeakMap},"undefined"!=typeof document&&function(e){const t=Qe();t.documents.set(e,(t.documents.get(e)??0)+1);for(const[o,n]of t.styles)et(e,o,n)}(document)),e.__wpStyleRuntime}function et(e,t,o){if(!e.head)return;const n=Qe();let r=n.injectedStyles.get(e);if(r||(r=new Set,n.injectedStyles.set(e,r)),r.has(t))return;if(function(e,t){if(!e.head)return!1;for(const o of e.head.querySelectorAll(`style[${Xe}]`))if(o.getAttribute(Xe)===t)return!0;return!1}(e,t))return void r.add(t);const i=e.createElement("style");i.setAttribute(Xe,t),i.appendChild(e.createTextNode(o)),e.head.appendChild(i),r.add(t)}function tt(e,t){const o=Qe();o.styles.set(e,t);for(const n of o.documents.keys())et(n,e,t)}tt("0c5702ddca",'@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{._83ed8a8da5dd50ea__text{margin:0}._14437cfb77831647__heading-2xl{--_gcd-heading-font-size:var(--wpds-typography-font-size-2xl,32px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-medium,499);--_gcd-p-font-size:var(--wpds-typography-font-size-2xl,32px);--_gcd-p-line-height:var(--wpds-typography-line-height-2xl,40px);font-size:var(--wpds-typography-font-size-2xl,32px);line-height:var(--wpds-typography-line-height-2xl,40px)}._14437cfb77831647__heading-2xl,._3c78b7fa9b4072dd__heading-xl{font-family:var(--wpds-typography-font-family-heading,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-weight:var(--wpds-typography-font-weight-medium,499)}._3c78b7fa9b4072dd__heading-xl{--_gcd-heading-font-size:var(--wpds-typography-font-size-xl,20px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-medium,499);--_gcd-p-font-size:var(--wpds-typography-font-size-xl,20px);--_gcd-p-line-height:var(--wpds-typography-line-height-md,24px);font-size:var(--wpds-typography-font-size-xl,20px);line-height:var(--wpds-typography-line-height-md,24px)}.aa58f227716bcde2__heading-lg{--_gcd-heading-font-size:var(--wpds-typography-font-size-lg,15px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-medium,499);--_gcd-p-font-size:var(--wpds-typography-font-size-lg,15px);--_gcd-p-line-height:var(--wpds-typography-line-height-sm,20px);font-size:var(--wpds-typography-font-size-lg,15px)}.aa58f227716bcde2__heading-lg,.fc4da56d8dfe52c4__heading-md{font-family:var(--wpds-typography-font-family-heading,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-weight:var(--wpds-typography-font-weight-medium,499);line-height:var(--wpds-typography-line-height-sm,20px)}.fc4da56d8dfe52c4__heading-md{--_gcd-heading-font-size:var(--wpds-typography-font-size-md,13px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-medium,499);--_gcd-p-font-size:var(--wpds-typography-font-size-md,13px);--_gcd-p-line-height:var(--wpds-typography-line-height-sm,20px);font-size:var(--wpds-typography-font-size-md,13px)}.a9b78c7c82e8dff7__heading-sm{--_gcd-heading-font-size:var(--wpds-typography-font-size-xs,11px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-medium,499);--_gcd-p-font-size:var(--wpds-typography-font-size-xs,11px);--_gcd-p-line-height:var(--wpds-typography-line-height-xs,16px);font-family:var(--wpds-typography-font-family-heading,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-xs,11px);font-weight:var(--wpds-typography-font-weight-medium,499);line-height:var(--wpds-typography-line-height-xs,16px);text-transform:uppercase}._305ff559e52180d5__body-xl{--_gcd-heading-font-size:var(--wpds-typography-font-size-xl,20px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-regular,400);--_gcd-p-font-size:var(--wpds-typography-font-size-xl,20px);--_gcd-p-line-height:var(--wpds-typography-line-height-xl,32px);font-size:var(--wpds-typography-font-size-xl,20px);line-height:var(--wpds-typography-line-height-xl,32px)}._305ff559e52180d5__body-xl,.ca1aa3fc2029e958__body-lg{font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-weight:var(--wpds-typography-font-weight-regular,400)}.ca1aa3fc2029e958__body-lg{--_gcd-heading-font-size:var(--wpds-typography-font-size-lg,15px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-regular,400);--_gcd-p-font-size:var(--wpds-typography-font-size-lg,15px);--_gcd-p-line-height:var(--wpds-typography-line-height-md,24px);font-size:var(--wpds-typography-font-size-lg,15px);line-height:var(--wpds-typography-line-height-md,24px)}._131101940be12424__body-md{--_gcd-heading-font-size:var(--wpds-typography-font-size-md,13px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-regular,400);--_gcd-p-font-size:var(--wpds-typography-font-size-md,13px);--_gcd-p-line-height:var(--wpds-typography-line-height-sm,20px);font-size:var(--wpds-typography-font-size-md,13px);line-height:var(--wpds-typography-line-height-sm,20px)}._0e8d87a42c1f75fa__body-sm,._131101940be12424__body-md{font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-weight:var(--wpds-typography-font-weight-regular,400)}._0e8d87a42c1f75fa__body-sm{--_gcd-heading-font-size:var(--wpds-typography-font-size-sm,12px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-regular,400);--_gcd-p-font-size:var(--wpds-typography-font-size-sm,12px);--_gcd-p-line-height:var(--wpds-typography-line-height-xs,16px);font-size:var(--wpds-typography-font-size-sm,12px);line-height:var(--wpds-typography-line-height-xs,16px)}}}');var ot={text:"_83ed8a8da5dd50ea__text","heading-2xl":"_14437cfb77831647__heading-2xl","heading-xl":"_3c78b7fa9b4072dd__heading-xl","heading-lg":"aa58f227716bcde2__heading-lg","heading-md":"fc4da56d8dfe52c4__heading-md","heading-sm":"a9b78c7c82e8dff7__heading-sm","body-xl":"_305ff559e52180d5__body-xl","body-lg":"ca1aa3fc2029e958__body-lg","body-md":"_131101940be12424__body-md","body-sm":"_0e8d87a42c1f75fa__body-sm"};tt("d390e935a7","._6defc79820e382c6__button{box-sizing:var(--_gcd-button-box-sizing,border-box);font-family:var(--_gcd-button-font-family,inherit);font-size:var(--_gcd-button-font-size,inherit);font-weight:var(--_gcd-button-font-weight,inherit)}.d2cff2e5dea83bd1__input{box-sizing:var(--_gcd-input-box-sizing,border-box);font-family:var(--_gcd-input-font-family,inherit);font-size:var(--_gcd-input-font-size,inherit);font-weight:var(--_gcd-input-font-weight,inherit);margin:var(--_gcd-input-margin,0);&:is(textarea,[type=text],[type=password],[type=color],[type=date],[type=datetime],[type=datetime-local],[type=email],[type=month],[type=number],[type=search],[type=tel],[type=time],[type=url],[type=week]){background-color:var(--_gcd-input-background-color,transparent);border:var(--_gcd-input-border,none);border-radius:var(--_gcd-input-border-radius,0);box-shadow:var(--_gcd-input-box-shadow,0 0 0 transparent);color:var(--_gcd-input-color,var(--wpds-color-foreground-interactive-neutral,#1e1e1e));&:focus{border-color:var(--_gcd-input-border-color-focus,var(--wp-admin-theme-color));box-shadow:var(--_gcd-input-box-shadow-focus,none);outline:var(--_gcd-input-outline-focus,none)}&:disabled{background:var(--_gcd-input-background-disabled,transparent);border-color:var(--_gcd-input-border-color-disabled,transparent);box-shadow:var(--_gcd-input-box-shadow-disabled,none);color:var(--_gcd-input-color-disabled,var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d))}&::placeholder{color:var(--_gcd-input-placeholder-color,var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d))}}&:is(textarea,[type=text],[type=password],[type=date],[type=datetime],[type=datetime-local],[type=email],[type=month],[type=number],[type=search],[type=tel],[type=time],[type=url],[type=week]){line-height:var(--_gcd-input-line-height,inherit);min-height:var(--_gcd-input-min-height,auto);padding:var(--_gcd-input-padding,0)}}._547d86373d02e108__textarea{box-sizing:var(--_gcd-textarea-box-sizing,border-box);overflow:var(--_gcd-textarea-overflow,auto);resize:var(--_gcd-textarea-resize,block)}._8c15fd0ed9f28ba4__div{outline:var(--_gcd-div-outline,0 solid transparent)}p._43cec3e1eec1066d__p{font-size:var(--_gcd-p-font-size,13px);line-height:var(--_gcd-p-line-height,1.5);margin:var(--_gcd-p-margin,0)}:is(h1,h2,h3,h4,h5,h6).e97669c6d9a38497__heading{color:var(--_gcd-heading-color,var(--wpds-color-foreground-content-neutral,#1e1e1e));font-size:var(--_gcd-heading-font-size,inherit);font-weight:var(--_gcd-heading-font-weight,var(--wpds-typography-font-weight-medium,499));margin:var(--_gcd-heading-margin,0)}._2c0831b0499dbd6e__a,._2c0831b0499dbd6e__a:is(:hover,:focus,:active){border-radius:var(--_gcd-a-border-radius,0);box-shadow:var(--_gcd-a-box-shadow,none);color:var(--_gcd-a-color,inherit);outline:var(--_gcd-a-outline,0 solid transparent);transition:var(--_gcd-a-transition,none)}");var nt=(0,n.forwardRef)(function({variant:e="body-md",render:t,className:o,...n},r){return He({render:t,defaultTagName:"span",ref:r,props:P(n,{className:(0,ce.A)(ot.text,"e97669c6d9a38497__heading","_43cec3e1eec1066d__p",ot[e],o)})})}),rt="data-wp-hash";function it(){const e=globalThis;return e.__wpStyleRuntime||(e.__wpStyleRuntime={documents:new Map,styles:new Map,injectedStyles:new WeakMap},"undefined"!=typeof document&&function(e){const t=it();t.documents.set(e,(t.documents.get(e)??0)+1);for(const[o,n]of t.styles)at(e,o,n)}(document)),e.__wpStyleRuntime}function at(e,t,o){if(!e.head)return;const n=it();let r=n.injectedStyles.get(e);if(r||(r=new Set,n.injectedStyles.set(e,r)),r.has(t))return;if(function(e,t){if(!e.head)return!1;for(const o of e.head.querySelectorAll(`style[${rt}]`))if(o.getAttribute(rt)===t)return!0;return!1}(e,t))return void r.add(t);const i=e.createElement("style");i.setAttribute(rt,t),i.appendChild(e.createTextNode(o)),e.head.appendChild(i),r.add(t)}!function(e,t){const o=it();o.styles.set(e,t);for(const n of o.documents.keys())at(n,e,t)}("7b60a246cc",'@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{.a23e08e65c8e62e5__root{text-wrap:balance;align-items:center;color:var(--wpds-color-foreground-content-neutral,#1e1e1e);display:flex;flex-direction:column;font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);gap:var(--wpds-dimension-gap-xs,4px);max-width:var(--wpds-dimension-surface-width-sm,320px);text-align:center}._01303b3680eaa216__visual{align-items:center;color:var(--wpds-color-foreground-content-neutral-weak,#707070);display:flex;justify-content:center;line-height:1;margin-block-end:var(--wpds-dimension-gap-xs,4px)}._58c8e351db225608__icon{background-color:var(--wpds-color-background-surface-neutral-weak,#f4f4f4);border:1px solid var(--wpds-color-stroke-surface-neutral-weak,#f0f0f0);border-radius:50%;padding:var(--wpds-dimension-padding-xs,4px)}.b8b96f70820333a1__title{margin:0}._70f1dd22bad55b18__description{color:var(--wpds-color-foreground-content-neutral-weak,#707070);margin:0}._89ac025fd8e2bc52__actions{align-items:center;display:flex;flex-direction:column;gap:var(--wpds-dimension-gap-xs,4px);margin-block-start:var(--wpds-dimension-gap-md,12px);@media (min-width:480px){flex-direction:row;justify-content:center}}}}');var st=(0,U.jsx)("h2",{}),lt=(0,n.forwardRef)(function({render:e=st,className:t,children:o,...n},r){return(0,U.jsx)(nt,{ref:r,variant:"heading-lg",render:e,className:(0,ce.A)("b8b96f70820333a1__title",t),...n,children:o})}),ct="data-wp-hash";function dt(){const e=globalThis;return e.__wpStyleRuntime||(e.__wpStyleRuntime={documents:new Map,styles:new Map,injectedStyles:new WeakMap},"undefined"!=typeof document&&function(e){const t=dt();t.documents.set(e,(t.documents.get(e)??0)+1);for(const[o,n]of t.styles)ut(e,o,n)}(document)),e.__wpStyleRuntime}function ut(e,t,o){if(!e.head)return;const n=dt();let r=n.injectedStyles.get(e);if(r||(r=new Set,n.injectedStyles.set(e,r)),r.has(t))return;if(function(e,t){if(!e.head)return!1;for(const o of e.head.querySelectorAll(`style[${ct}]`))if(o.getAttribute(ct)===t)return!0;return!1}(e,t))return void r.add(t);const i=e.createElement("style");i.setAttribute(ct,t),i.appendChild(e.createTextNode(o)),e.head.appendChild(i),r.add(t)}!function(e,t){const o=dt();o.styles.set(e,t);for(const n of o.documents.keys())ut(n,e,t)}("7b60a246cc",'@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{.a23e08e65c8e62e5__root{text-wrap:balance;align-items:center;color:var(--wpds-color-foreground-content-neutral,#1e1e1e);display:flex;flex-direction:column;font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);gap:var(--wpds-dimension-gap-xs,4px);max-width:var(--wpds-dimension-surface-width-sm,320px);text-align:center}._01303b3680eaa216__visual{align-items:center;color:var(--wpds-color-foreground-content-neutral-weak,#707070);display:flex;justify-content:center;line-height:1;margin-block-end:var(--wpds-dimension-gap-xs,4px)}._58c8e351db225608__icon{background-color:var(--wpds-color-background-surface-neutral-weak,#f4f4f4);border:1px solid var(--wpds-color-stroke-surface-neutral-weak,#f0f0f0);border-radius:50%;padding:var(--wpds-dimension-padding-xs,4px)}.b8b96f70820333a1__title{margin:0}._70f1dd22bad55b18__description{color:var(--wpds-color-foreground-content-neutral-weak,#707070);margin:0}._89ac025fd8e2bc52__actions{align-items:center;display:flex;flex-direction:column;gap:var(--wpds-dimension-gap-xs,4px);margin-block-start:var(--wpds-dimension-gap-md,12px);@media (min-width:480px){flex-direction:row;justify-content:center}}}}');var pt=(0,U.jsx)("p",{}),mt=(0,n.forwardRef)(function({render:e=pt,className:t,children:o,...n},r){return(0,U.jsx)(nt,{ref:r,variant:"body-md",render:e,className:(0,ce.A)("_70f1dd22bad55b18__description",t),...n,children:o})}),ft="data-wp-hash";function gt(){const e=globalThis;return e.__wpStyleRuntime||(e.__wpStyleRuntime={documents:new Map,styles:new Map,injectedStyles:new WeakMap},"undefined"!=typeof document&&function(e){const t=gt();t.documents.set(e,(t.documents.get(e)??0)+1);for(const[o,n]of t.styles)ht(e,o,n)}(document)),e.__wpStyleRuntime}function ht(e,t,o){if(!e.head)return;const n=gt();let r=n.injectedStyles.get(e);if(r||(r=new Set,n.injectedStyles.set(e,r)),r.has(t))return;if(function(e,t){if(!e.head)return!1;for(const o of e.head.querySelectorAll(`style[${ft}]`))if(o.getAttribute(ft)===t)return!0;return!1}(e,t))return void r.add(t);const i=e.createElement("style");i.setAttribute(ft,t),i.appendChild(e.createTextNode(o)),e.head.appendChild(i),r.add(t)}!function(e,t){const o=gt();o.styles.set(e,t);for(const n of o.documents.keys())ht(n,e,t)}("32aba35fe1","@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{._19ce0419607e1896__stack{display:flex}}}");var _t={xs:"var(--wpds-dimension-gap-xs, 4px)",sm:"var(--wpds-dimension-gap-sm, 8px)",md:"var(--wpds-dimension-gap-md, 12px)",lg:"var(--wpds-dimension-gap-lg, 16px)",xl:"var(--wpds-dimension-gap-xl, 24px)","2xl":"var(--wpds-dimension-gap-2xl, 32px)","3xl":"var(--wpds-dimension-gap-3xl, 40px)"},yt=(0,n.forwardRef)(function({direction:e,gap:t,align:o,justify:n,wrap:r,render:i,...a},s){return He({render:i,ref:s,props:P(a,{style:{gap:t&&_t[t],alignItems:o,justifyContent:n,flexDirection:e,flexWrap:r},className:"_19ce0419607e1896__stack"})})});const bt=window.wp.a11y;var wt=(0,U.jsx)(Be.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:(0,U.jsx)(Be.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M5.5 12a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0ZM12 4a8 8 0 1 0 0 16 8 8 0 0 0 0-16Zm.75 4v1.5h-1.5V8h1.5Zm0 8v-5h-1.5v5h1.5Z"})}),vt=(0,U.jsx)(Be.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:(0,U.jsx)(Be.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M5.5 12a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0ZM12 4a8 8 0 1 0 0 16 8 8 0 0 0 0-16Zm-.75 12v-1.5h1.5V16h-1.5Zm0-8v5h1.5V8h-1.5Z"})}),xt=(0,U.jsx)(Be.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:(0,U.jsx)(Be.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M12 18.5a6.5 6.5 0 1 1 0-13 6.5 6.5 0 0 1 0 13ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Zm11.53-1.47-1.06-1.06L11 12.94l-1.47-1.47-1.06 1.06L11 15.06l4.53-4.53Z"})}),kt=(0,U.jsx)(Be.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:(0,U.jsx)(Be.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M12.218 5.377a.25.25 0 0 0-.436 0l-7.29 12.96a.25.25 0 0 0 .218.373h14.58a.25.25 0 0 0 .218-.372l-7.29-12.96Zm-1.743-.735c.669-1.19 2.381-1.19 3.05 0l7.29 12.96a1.75 1.75 0 0 1-1.525 2.608H4.71a1.75 1.75 0 0 1-1.525-2.608l7.29-12.96ZM12.75 17.46h-1.5v-1.5h1.5v1.5Zm-1.5-3h1.5v-5h-1.5v5Z"})}),St="data-wp-hash";function jt(){const e=globalThis;return e.__wpStyleRuntime||(e.__wpStyleRuntime={documents:new Map,styles:new Map,injectedStyles:new WeakMap},"undefined"!=typeof document&&function(e){const t=jt();t.documents.set(e,(t.documents.get(e)??0)+1);for(const[o,n]of t.styles)Et(e,o,n)}(document)),e.__wpStyleRuntime}function Et(e,t,o){if(!e.head)return;const n=jt();let r=n.injectedStyles.get(e);if(r||(r=new Set,n.injectedStyles.set(e,r)),r.has(t))return;if(function(e,t){if(!e.head)return!1;for(const o of e.head.querySelectorAll(`style[${St}]`))if(o.getAttribute(St)===t)return!0;return!1}(e,t))return void r.add(t);const i=e.createElement("style");i.setAttribute(St,t),i.appendChild(e.createTextNode(o)),e.head.appendChild(i),r.add(t)}function Tt(e,t){const o=jt();o.styles.set(e,t);for(const n of o.documents.keys())Et(n,e,t)}Tt("10f3806643","@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._336cd3e4e743482f__box-sizing{box-sizing:border-box;*,:after,:before{box-sizing:inherit}}}}");Tt("726c480820","@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{._4145abab73d17514__notice{--icon-height:var(--wpds-dimension-size-sm,24px);--text-vertical-padding:calc((var(--icon-height) - var(--wpds-typography-line-height-sm, 20px))/2);--wp-ui-notice-background-color:var(--wpds-color-background-surface-neutral-weak,#f4f4f4);--wp-ui-notice-border-color:var(--wpds-color-stroke-surface-neutral,#dbdbdb);--wp-ui-notice-text-color:var(--wpds-color-foreground-content-neutral,#1e1e1e);--wp-ui-notice-decorative-icon-color:var(--wpds-color-foreground-content-neutral,#1e1e1e);align-items:start;background-color:var(--wp-ui-notice-background-color);border:1px solid var(--wp-ui-notice-border-color);border-radius:var(--wpds-border-radius-lg,8px);container-type:inline-size;display:grid;grid-template-columns:auto 1fr auto;padding:var(--wpds-dimension-padding-md,12px)}.d0a25570cb528528__icon{color:var(--wp-ui-notice-decorative-icon-color);grid-column:1;grid-row:1;margin-inline-end:var(--wpds-dimension-gap-xs,4px)}._1904b570a89bb815__description,.b5397fb9d05389e3__title{color:var(--wp-ui-notice-text-color);grid-column:2;padding-block:var(--text-vertical-padding)}._1904b570a89bb815__description{text-wrap:pretty}._0a1270dcdd79c031__actions{display:flex;flex-wrap:wrap;gap:var(--wpds-dimension-gap-md,12px);grid-column:2}._4145abab73d17514__notice:has(._1904b570a89bb815__description) ._0a1270dcdd79c031__actions,._4145abab73d17514__notice:has(.b5397fb9d05389e3__title) ._0a1270dcdd79c031__actions{margin-block-start:var(--wpds-dimension-gap-sm,8px)}._983740ab855c4e09__action-button{flex-shrink:0}.d329e7416d368d31__action-link{flex-shrink:0;&:not(:first-child){margin-inline-start:var(--wpds-dimension-gap-xs,4px)}&:not(:last-child){margin-inline-end:var(--wpds-dimension-gap-xs,4px)}}._487e6a5c1375f7dc__close-icon{grid-column:3;grid-row:1;margin-inline-start:var(--wpds-dimension-gap-xs,4px)}._531c140826094795__is-info{--wp-ui-notice-background-color:var(--wpds-color-background-surface-info-weak,#f3f9ff);--wp-ui-notice-border-color:var(--wpds-color-stroke-surface-info,#a9c6e7);--wp-ui-notice-text-color:var(--wpds-color-foreground-content-info,#001b4f);--wp-ui-notice-decorative-icon-color:var(--wpds-color-foreground-content-info-weak,#006bd7)}.ae2e1004697cce95__is-warning{--wp-ui-notice-background-color:var(--wpds-color-background-surface-warning-weak,#fff7e1);--wp-ui-notice-border-color:var(--wpds-color-stroke-surface-warning,#e1bc7c);--wp-ui-notice-text-color:var(--wpds-color-foreground-content-warning,#2e1900);--wp-ui-notice-decorative-icon-color:var(--wpds-color-foreground-content-warning-weak,#926300)}._2e614a76af494837__is-success{--wp-ui-notice-background-color:var(--wpds-color-background-surface-success-weak,#ebffed);--wp-ui-notice-border-color:var(--wpds-color-stroke-surface-success,#94d29e);--wp-ui-notice-text-color:var(--wpds-color-foreground-content-success,#002900);--wp-ui-notice-decorative-icon-color:var(--wpds-color-foreground-content-success-weak,#008030)}.af00331ae17a0065__is-error{--wp-ui-notice-background-color:var(--wpds-color-background-surface-error-weak,#fff6f5);--wp-ui-notice-border-color:var(--wpds-color-stroke-surface-error,#dab1aa);--wp-ui-notice-text-color:var(--wpds-color-foreground-content-error,#470000);--wp-ui-notice-decorative-icon-color:var(--wpds-color-foreground-content-error-weak,#cc1818)}@container (max-width: 320px){._4145abab73d17514__notice:has(.b5397fb9d05389e3__title) ._0a1270dcdd79c031__actions,._4145abab73d17514__notice:has(.b5397fb9d05389e3__title) ._1904b570a89bb815__description{grid-column:1/3}}}@layer compositions{.d329e7416d368d31__action-link{margin-block:auto}._487e6a5c1375f7dc__close-icon,._983740ab855c4e09__action-button:is(._8ddb8fb33fbf3d38__is-action-button-outline,._77bbde495a8a0af3__is-action-button-minimal){--wp-ui-button-background-color-active:color-mix(in srgb,transparent 50%,var(--wpds-color-background-interactive-neutral-weak-active,#ededed))}}}");var Ct={notice:"_4145abab73d17514__notice",icon:"d0a25570cb528528__icon",title:"b5397fb9d05389e3__title",description:"_1904b570a89bb815__description",actions:"_0a1270dcdd79c031__actions","action-button":"_983740ab855c4e09__action-button","action-link":"d329e7416d368d31__action-link","close-icon":"_487e6a5c1375f7dc__close-icon","is-info":"_531c140826094795__is-info","is-warning":"ae2e1004697cce95__is-warning","is-success":"_2e614a76af494837__is-success","is-error":"af00331ae17a0065__is-error","is-action-button-outline":"_8ddb8fb33fbf3d38__is-action-button-outline","is-action-button-minimal":"_77bbde495a8a0af3__is-action-button-minimal"},Mt={neutral:null,info:wt,warning:vt,success:xt,error:kt};function Nt(e){return"error"===e?"assertive":"polite"}var zt=(0,n.forwardRef)(function({intent:e="neutral",children:t,icon:o,spokenMessage:r=t,politeness:i=Nt(e),render:a,...s},l){!function(e,t){const o=function(e){if(e){if("string"==typeof e)return e;try{return(0,n.renderToString)(e)}catch{return}}}(e);(0,n.useEffect)(()=>{o&&(0,bt.speak)(o,t)},[o,t])}(r,i);const c=null===o?null:o??Mt[e];return He({defaultTagName:"div",render:a,ref:l,props:P({className:(0,ce.A)(Ct.notice,Ct[`is-${e}`],"_336cd3e4e743482f__box-sizing"),children:(0,U.jsxs)(U.Fragment,{children:[t,c&&(0,U.jsx)(Ve,{className:Ct.icon,icon:c})]})},s)})}),Pt="data-wp-hash";function It(){const e=globalThis;return e.__wpStyleRuntime||(e.__wpStyleRuntime={documents:new Map,styles:new Map,injectedStyles:new WeakMap},"undefined"!=typeof document&&function(e){const t=It();t.documents.set(e,(t.documents.get(e)??0)+1);for(const[o,n]of t.styles)Rt(e,o,n)}(document)),e.__wpStyleRuntime}function Rt(e,t,o){if(!e.head)return;const n=It();let r=n.injectedStyles.get(e);if(r||(r=new Set,n.injectedStyles.set(e,r)),r.has(t))return;if(function(e,t){if(!e.head)return!1;for(const o of e.head.querySelectorAll(`style[${Pt}]`))if(o.getAttribute(Pt)===t)return!0;return!1}(e,t))return void r.add(t);const i=e.createElement("style");i.setAttribute(Pt,t),i.appendChild(e.createTextNode(o)),e.head.appendChild(i),r.add(t)}!function(e,t){const o=It();o.styles.set(e,t);for(const n of o.documents.keys())Rt(n,e,t)}("726c480820","@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{._4145abab73d17514__notice{--icon-height:var(--wpds-dimension-size-sm,24px);--text-vertical-padding:calc((var(--icon-height) - var(--wpds-typography-line-height-sm, 20px))/2);--wp-ui-notice-background-color:var(--wpds-color-background-surface-neutral-weak,#f4f4f4);--wp-ui-notice-border-color:var(--wpds-color-stroke-surface-neutral,#dbdbdb);--wp-ui-notice-text-color:var(--wpds-color-foreground-content-neutral,#1e1e1e);--wp-ui-notice-decorative-icon-color:var(--wpds-color-foreground-content-neutral,#1e1e1e);align-items:start;background-color:var(--wp-ui-notice-background-color);border:1px solid var(--wp-ui-notice-border-color);border-radius:var(--wpds-border-radius-lg,8px);container-type:inline-size;display:grid;grid-template-columns:auto 1fr auto;padding:var(--wpds-dimension-padding-md,12px)}.d0a25570cb528528__icon{color:var(--wp-ui-notice-decorative-icon-color);grid-column:1;grid-row:1;margin-inline-end:var(--wpds-dimension-gap-xs,4px)}._1904b570a89bb815__description,.b5397fb9d05389e3__title{color:var(--wp-ui-notice-text-color);grid-column:2;padding-block:var(--text-vertical-padding)}._1904b570a89bb815__description{text-wrap:pretty}._0a1270dcdd79c031__actions{display:flex;flex-wrap:wrap;gap:var(--wpds-dimension-gap-md,12px);grid-column:2}._4145abab73d17514__notice:has(._1904b570a89bb815__description) ._0a1270dcdd79c031__actions,._4145abab73d17514__notice:has(.b5397fb9d05389e3__title) ._0a1270dcdd79c031__actions{margin-block-start:var(--wpds-dimension-gap-sm,8px)}._983740ab855c4e09__action-button{flex-shrink:0}.d329e7416d368d31__action-link{flex-shrink:0;&:not(:first-child){margin-inline-start:var(--wpds-dimension-gap-xs,4px)}&:not(:last-child){margin-inline-end:var(--wpds-dimension-gap-xs,4px)}}._487e6a5c1375f7dc__close-icon{grid-column:3;grid-row:1;margin-inline-start:var(--wpds-dimension-gap-xs,4px)}._531c140826094795__is-info{--wp-ui-notice-background-color:var(--wpds-color-background-surface-info-weak,#f3f9ff);--wp-ui-notice-border-color:var(--wpds-color-stroke-surface-info,#a9c6e7);--wp-ui-notice-text-color:var(--wpds-color-foreground-content-info,#001b4f);--wp-ui-notice-decorative-icon-color:var(--wpds-color-foreground-content-info-weak,#006bd7)}.ae2e1004697cce95__is-warning{--wp-ui-notice-background-color:var(--wpds-color-background-surface-warning-weak,#fff7e1);--wp-ui-notice-border-color:var(--wpds-color-stroke-surface-warning,#e1bc7c);--wp-ui-notice-text-color:var(--wpds-color-foreground-content-warning,#2e1900);--wp-ui-notice-decorative-icon-color:var(--wpds-color-foreground-content-warning-weak,#926300)}._2e614a76af494837__is-success{--wp-ui-notice-background-color:var(--wpds-color-background-surface-success-weak,#ebffed);--wp-ui-notice-border-color:var(--wpds-color-stroke-surface-success,#94d29e);--wp-ui-notice-text-color:var(--wpds-color-foreground-content-success,#002900);--wp-ui-notice-decorative-icon-color:var(--wpds-color-foreground-content-success-weak,#008030)}.af00331ae17a0065__is-error{--wp-ui-notice-background-color:var(--wpds-color-background-surface-error-weak,#fff6f5);--wp-ui-notice-border-color:var(--wpds-color-stroke-surface-error,#dab1aa);--wp-ui-notice-text-color:var(--wpds-color-foreground-content-error,#470000);--wp-ui-notice-decorative-icon-color:var(--wpds-color-foreground-content-error-weak,#cc1818)}@container (max-width: 320px){._4145abab73d17514__notice:has(.b5397fb9d05389e3__title) ._0a1270dcdd79c031__actions,._4145abab73d17514__notice:has(.b5397fb9d05389e3__title) ._1904b570a89bb815__description{grid-column:1/3}}}@layer compositions{.d329e7416d368d31__action-link{margin-block:auto}._487e6a5c1375f7dc__close-icon,._983740ab855c4e09__action-button:is(._8ddb8fb33fbf3d38__is-action-button-outline,._77bbde495a8a0af3__is-action-button-minimal){--wp-ui-button-background-color-active:color-mix(in srgb,transparent 50%,var(--wpds-color-background-interactive-neutral-weak-active,#ededed))}}}");var At=(0,n.forwardRef)(function({className:e,...t},o){return(0,U.jsx)(nt,{ref:o,variant:"body-md",className:(0,ce.A)("_1904b570a89bb815__description",e),...t})}),Bt=o(94715);const Lt=(0,window.wp.priorityQueue.createQueue)();function Ht({children:e,placeholder:t}){const[o,r]=(0,n.useState)(!1);return(0,n.useEffect)(()=>{const e={};return Lt.add(e,()=>{(0,n.flushSync)(()=>{r(!0)})}),()=>{Lt.cancel(e)}},[]),o?e:t}var Ft=o(26314);function $t(){return(0,U.jsxs)(De,{className:"email-editor-template-select__no-results",children:[(0,U.jsx)(Je,{icon:Le}),(0,U.jsx)(lt,{children:(0,l.__)("No recent templates.","woocommerce")}),(0,U.jsx)(mt,{children:(0,l.__)("Your recent creations will appear here as soon as you begin.","woocommerce")})]})}const Ot=(0,n.memo)(function({templates:e,onTemplateSelection:t,selectedCategory:o}){const{layout:n}=(0,a.useSelect)(e=>{const{getEditorSettings:t}=e(r.store),o=t();return{layout:o?.__experimentalFeatures?.layout}}),[i]=(0,Ft.b)(),s=i.reduce((e,t)=>e+(t.css??""),"")+`.is-root-container { width: ${n?.contentSize||"660px"}; margin: 0 auto; }`;return"recent"===o&&0===e.length?(0,U.jsx)($t,{}):(0,U.jsx)("div",{className:"email-editor-template-select__templates",role:"listbox",children:e.map(e=>(0,U.jsx)("div",{className:"email-editor-template-select__template",children:(0,U.jsx)("div",{className:"email-editor-template-select__template-button",role:"button",tabIndex:0,onClick:()=>{t(e)},onKeyPress:o=>{"Enter"!==o.key&&" "!==o.key||t(e)},children:(0,U.jsxs)(Ht,{placeholder:(0,U.jsx)("p",{children:(0,l.__)("rendering template","woocommerce")}),children:[(0,U.jsx)(Bt.BlockPreview,{blocks:e.previewContentParsed,viewportWidth:900,minHeight:300,additionalStyles:[{css:s}]}),(0,U.jsx)(yt,{direction:"row",align:"center",className:"email-editor-template-select__template-details",children:(0,U.jsx)("h4",{className:"email-editor-template-select__template-title",children:e.displayName})})]})})},`${e.slug}_${e.displayName}_${e.id}`))})},(e,t)=>e.templates.length===t.templates.length&&e.selectedCategory===t.selectedCategory);function Dt({templates:e,onTemplateSelection:t,selectedCategory:o}){const r=(0,n.useMemo)(()=>null!=o?e.filter(e=>e.category===o):e,[o,e]);return(0,U.jsxs)(yt,{direction:"column",gap:"xl",className:"email-editor-template-select__list",children:["recent"===o&&(0,U.jsx)(zt,{intent:"info",children:(0,U.jsx)(At,{children:(0,l.__)("Templates created on the legacy editor will not appear here.","woocommerce")})}),(0,U.jsx)(Ot,{templates:r,onTemplateSelection:t,selectedCategory:o})]})}function Vt(){return"undefined"!=typeof window}function Wt(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function Gt(e){return!!Vt()&&(e instanceof HTMLElement||e instanceof Wt(e).HTMLElement)}function Ut(e){return Wt(e).getComputedStyle(e)}const qt="ArrowUp",Kt="ArrowDown",Zt="ArrowLeft",Yt="ArrowRight",Jt="Home",Xt="End",Qt=new Set([Zt,Yt]),eo=new Set([Zt,Yt,Jt,Xt]),to=new Set([qt,Kt]),oo=new Set([qt,Kt,Jt,Xt]),no=new Set([...Qt,...to]),ro=new Set([...no,Jt,Xt]),io=new Set(["Shift","Control","Alt","Meta"]);function ao(e){return!(!function(e){return Gt(e)&&"INPUT"===e.tagName}(e)||null==e.selectionStart)||!(!Gt(e)||"TEXTAREA"!==e.tagName)}function so(e,t,o,n){if(!e||!t||!t.scrollTo)return;let r=e.scrollLeft,i=e.scrollTop;const a=e.clientWidth<e.scrollWidth,s=e.clientHeight<e.scrollHeight;if(a&&"vertical"!==n){const n=lo(e,t,"left"),i=co(e),a=co(t);"ltr"===o&&(n+t.offsetWidth+a.scrollMarginRight>e.scrollLeft+e.clientWidth-i.scrollPaddingRight?r=n+t.offsetWidth+a.scrollMarginRight-e.clientWidth+i.scrollPaddingRight:n-a.scrollMarginLeft<e.scrollLeft+i.scrollPaddingLeft&&(r=n-a.scrollMarginLeft-i.scrollPaddingLeft)),"rtl"===o&&(n-a.scrollMarginRight<e.scrollLeft+i.scrollPaddingLeft?r=n-a.scrollMarginLeft-i.scrollPaddingLeft:n+t.offsetWidth+a.scrollMarginRight>e.scrollLeft+e.clientWidth-i.scrollPaddingRight&&(r=n+t.offsetWidth+a.scrollMarginRight-e.clientWidth+i.scrollPaddingRight))}if(s&&"horizontal"!==n){const o=lo(e,t,"top"),n=co(e),r=co(t);o-r.scrollMarginTop<e.scrollTop+n.scrollPaddingTop?i=o-r.scrollMarginTop-n.scrollPaddingTop:o+t.offsetHeight+r.scrollMarginBottom>e.scrollTop+e.clientHeight-n.scrollPaddingBottom&&(i=o+t.offsetHeight+r.scrollMarginBottom-e.clientHeight+n.scrollPaddingBottom)}e.scrollTo({left:r,top:i,behavior:"auto"})}function lo(e,t,o){const n="left"===o?"offsetLeft":"offsetTop";let r=0;for(;t.offsetParent&&(r+=t[n],t.offsetParent!==e);)t=t.offsetParent;return r}function co(e){const t=getComputedStyle(e);return{scrollMarginTop:parseFloat(t.scrollMarginTop)||0,scrollMarginRight:parseFloat(t.scrollMarginRight)||0,scrollMarginBottom:parseFloat(t.scrollMarginBottom)||0,scrollMarginLeft:parseFloat(t.scrollMarginLeft)||0,scrollPaddingTop:parseFloat(t.scrollPaddingTop)||0,scrollPaddingRight:parseFloat(t.scrollPaddingRight)||0,scrollPaddingBottom:parseFloat(t.scrollPaddingBottom)||0,scrollPaddingLeft:parseFloat(t.scrollPaddingLeft)||0}}Math.min,Math.max;const uo=Math.round,po=Math.floor;function mo(e){e.preventDefault(),e.stopPropagation()}const fo="ArrowLeft",go="ArrowRight";function ho(e,t,o){return Math.floor(e/t)!==o}function _o(e,t){return t<0||t>=e.length}function yo(e,{startingIndex:t=-1,decrement:o=!1,disabledIndices:n,amount:r=1}={}){let i=t;do{i+=o?-r:r}while(i>=0&&i<=e.length-1&&vo(e,i,n));return i}function bo(e,t,o,n,r){if(-1===e)return-1;const i=o.indexOf(e),a=t[e];switch(r){case"tl":return i;case"tr":return a?i+a.width-1:i;case"bl":return a?i+(a.height-1)*n:i;case"br":return o.lastIndexOf(e);default:return-1}}function wo(e,t){return t.flatMap((t,o)=>e.includes(t)?[o]:[])}function vo(e,t,o){if("function"==typeof o?o(t):o?.includes(t))return!0;const n=e[t];return!!n&&(!function(e,t=(e?Ut(e):null)){return!(!(e&&e.isConnected&&t)||function(e){return"hidden"===e.visibility||"collapse"===e.visibility}(t))&&("function"==typeof e.checkVisibility?e.checkVisibility():"none"!==t.display&&"contents"!==t.display)}(n)||!o&&(n.hasAttribute("disabled")||"true"===n.getAttribute("aria-disabled")))}const xo="data-composite-item-active";function ko(e){return"composedPath"in e?e.composedPath()[0]:e.target}const So=[];const jo=c.createContext(void 0);function Eo(e=!1){const t=c.useContext(jo);if(void 0===t&&!e)throw new Error(w(16));return t}const To=c.createContext(void 0);function Co(e){const{render:t,className:o,style:n,refs:r=M,props:i=M,state:a=N,stateAttributesMapping:s,highlightedIndex:l,onHighlightedIndexChange:d,orientation:u,dense:p,itemSizes:m,loopFocus:f,onLoop:g,cols:h,enableHomeAndEndKeys:y,onMapChange:b,stopEventPropagation:w=!0,rootRef:x,disabledIndices:k,modifierKeys:S,highlightItemOnHover:j=!1,tag:E="div",...T}=e,C=function(){const e=c.useContext(To);return e?.direction??"ltr"}(),{props:z,highlightedIndex:P,onHighlightedIndexChange:I,elementsRef:R,onMapChange:A,relayKeyboardEvent:B}=function(e){const{itemSizes:t,cols:o=1,loopFocus:n=!0,onLoop:r,dense:i=!1,orientation:a="both",direction:s,highlightedIndex:l,onHighlightedIndexChange:d,rootRef:u,enableHomeAndEndKeys:p=!1,stopEventPropagation:m=!1,disabledIndices:f,modifierKeys:g=So}=e,[h,y]=c.useState(0),b=o>1,w=c.useRef(null),x=v(w,u),k=c.useRef([]),S=c.useRef(!1),j=l??h,E=_((e,t=!1)=>{if((d??y)(e),t){const t=k.current[e];so(w.current,t,s,a)}}),T=_(e=>{if(0===e.size||S.current)return;S.current=!0;const t=Array.from(e.keys()),o=t.find(e=>e?.hasAttribute(xo))??null,n=o?t.indexOf(o):-1;-1!==n&&E(n),so(w.current,o,s,a)}),C=_((e,t,o)=>r?r?.(e,t,o,k):o),M=c.useMemo(()=>({"aria-orientation":"both"===a?void 0:a,ref:x,onFocus(e){const t=w.current,o=ko(e.nativeEvent);t&&null!=o&&ao(o)&&o.setSelectionRange(0,o.value.length??0)},onKeyDown(e){const l=p?ro:no;if(!l.has(e.key))return;if(function(e,t){for(const o of io.values())if(!t.includes(o)&&e.getModifierState(o))return!0;return!1}(e,g))return;if(!w.current)return;const c="rtl"===s,d=c?Zt:Yt,u={horizontal:d,vertical:Kt,both:d}[a],h=c?Yt:Zt,_={horizontal:h,vertical:qt,both:h}[a],y=ko(e.nativeEvent);if(null!=y&&ao(y)&&null!=(v=y)&&!v.hasAttribute("disabled")&&"true"!==v.getAttribute("aria-disabled")){const t=y.selectionStart,o=y.selectionEnd,n=y.value??"";if(null==t||e.shiftKey||t!==o)return;if(e.key!==_&&t<n.length)return;if(e.key!==u&&t>0)return}var v;let x=j;const S=function(e,t){return yo(e.current,{disabledIndices:t})}(k,f),T=function(e,t){return yo(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}(k,f);if(b){const r=t||Array.from({length:k.current.length},()=>({width:1,height:1})),s=function(e,t,o){const n=[];let r=0;return e.forEach(({width:e,height:i},a)=>{let s=!1;for(o&&(r=0);!s;){const o=[];for(let n=0;n<e;n+=1)for(let e=0;e<i;e+=1)o.push(r+n+e*t);r%t+e<=t&&o.every(e=>null==n[e])?(o.forEach(e=>{n[e]=a}),s=!0):r+=1}}),[...n]}(r,o,i),l=s.findIndex(e=>null!=e&&!vo(k.current,e,f)),d=s.reduce((e,t,o)=>null==t||vo(k.current,t,f)?e:o,-1);x=s[function(e,{event:t,orientation:o,loopFocus:n,onLoop:r,rtl:i,cols:a,disabledIndices:s,minIndex:l,maxIndex:c,prevIndex:d,stopEvent:u=!1}){let p,m=d;if("ArrowUp"===t.key?p="up":"ArrowDown"===t.key&&(p="down"),p){const o=[],i=[];let f=!1,g=0;{let t=null,n=-1;e.forEach((e,r)=>{if(null==e)return;g+=1;const a=e.closest('[role="row"]');a&&(f=!0),a===t&&-1!==n||(t=a,n+=1,o[n]=[]),o[n].push(r),i[r]=n})}let h=!1,_=0;if(f)for(const e of o){const t=e.length;t>_&&(_=t),t!==a&&(h=!0)}const y=h&&g<e.length,b=_||a,w=a=>{if(!h||-1===d)return;const l=i[d];if(null==l)return;const c=o[l].indexOf(d),u="up"===a?-1:1;for(let a=l+u,p=0;p<o.length;p+=1,a+=u){if(a<0||a>=o.length){if(!n||y)return;if(a=a<0?o.length-1:0,r){const e=Math.min(c,o[a].length-1),n=o[a][e]??o[a][0],s=r(t,d,n);a=i[s]??a}}const l=o[a];for(let t=Math.min(c,l.length-1);t>=0;t-=1){const o=l[t];if(!vo(e,o,s))return o}}},v=t=>{if(!y||-1===d)return;const o=d%b,r="up"===t?-b:b,i=c-c%b,a=po(c/b)+1;for(let t=d-o+r,l=0;l<a;l+=1,t+=r){if(t<0||t>c){if(!n)return;t=t<0?i:0}const r=Math.min(t+b-1,c);for(let n=Math.min(t+o,r);n>=t;n-=1)if(!vo(e,n,s))return n}};u&&mo(t);const x=w(p)??v(p);if(void 0!==x)m=x;else if(-1===d)m="up"===p?c:l;else if(m=yo(e,{startingIndex:d,amount:b,decrement:"up"===p,disabledIndices:s}),n){if("up"===p&&(d-b<l||m<0)){const e=d%b,o=c%b,n=c-(o-e);m=o===e?c:o>e?n:n-b,r&&(m=r(t,d,m))}"down"===p&&d+b>c&&(m=yo(e,{startingIndex:d%b-b,amount:b,disabledIndices:s}),r&&(m=r(t,d,m)))}_o(e,m)&&(m=d)}if("both"===o){const o=po(d/a);t.key===(i?fo:go)&&(u&&mo(t),d%a!==a-1?(m=yo(e,{startingIndex:d,disabledIndices:s}),n&&ho(m,a,o)&&(m=yo(e,{startingIndex:d-d%a-1,disabledIndices:s}),r&&(m=r(t,d,m)))):n&&(m=yo(e,{startingIndex:d-d%a-1,disabledIndices:s}),r&&(m=r(t,d,m))),ho(m,a,o)&&(m=d)),t.key===(i?go:fo)&&(u&&mo(t),d%a!==0?(m=yo(e,{startingIndex:d,decrement:!0,disabledIndices:s}),n&&ho(m,a,o)&&(m=yo(e,{startingIndex:d+(a-d%a),decrement:!0,disabledIndices:s}),r&&(m=r(t,d,m)))):n&&(m=yo(e,{startingIndex:d+(a-d%a),decrement:!0,disabledIndices:s}),r&&(m=r(t,d,m))),ho(m,a,o)&&(m=d));const l=po(c/a)===o;_o(e,m)&&(n&&l?(m=t.key===(i?go:fo)?c:yo(e,{startingIndex:d-d%a-1,disabledIndices:s}),r&&(m=r(t,d,m))):m=d)}return m}(s.map(e=>null!=e?k.current[e]:null),{event:e,orientation:a,loopFocus:n,onLoop:C,cols:o,disabledIndices:wo([...f||k.current.map((e,t)=>vo(k.current,t)?t:void 0),void 0],s),minIndex:l,maxIndex:d,prevIndex:bo(j>T?S:j,r,s,o,e.key===Kt?"bl":e.key===Yt?"tr":"tl"),rtl:c})]}const M={horizontal:[d],vertical:[Kt],both:[d,Kt]}[a],N={horizontal:[h],vertical:[qt],both:[h,qt]}[a],z=b?l:{horizontal:p?eo:Qt,vertical:p?oo:to,both:l}[a];p&&(e.key===Jt?x=S:e.key===Xt&&(x=T)),x===j&&(M.includes(e.key)||N.includes(e.key))&&(n&&x===T&&M.includes(e.key)?(x=S,r&&(x=r(e,j,x,k))):n&&x===S&&N.includes(e.key)?(x=T,r&&(x=r(e,j,x,k))):x=yo(k.current,{startingIndex:x,decrement:N.includes(e.key),disabledIndices:f})),x===j||_o(k.current,x)||(m&&e.stopPropagation(),z.has(e.key)&&e.preventDefault(),E(x,!0),queueMicrotask(()=>{k.current[x]?.focus()}))}}),[o,i,s,f,k,p,j,b,t,n,r,C,x,g,E,a,m]);return c.useMemo(()=>({props:M,highlightedIndex:j,onHighlightedIndexChange:E,elementsRef:k,disabledIndices:f,onMapChange:T,relayKeyboardEvent:M.onKeyDown}),[M,j,E,k,f,T])}({itemSizes:m,cols:h,loopFocus:f,onLoop:g,dense:p,orientation:u,highlightedIndex:l,onHighlightedIndexChange:d,rootRef:x,stopEventPropagation:w,enableHomeAndEndKeys:y,direction:C,disabledIndices:k,modifierKeys:S}),L=V(E,e,{state:a,ref:r,props:[z,...i,T],stateAttributesMapping:s}),H=c.useMemo(()=>({highlightedIndex:P,onHighlightedIndexChange:I,highlightItemOnHover:j,relayKeyboardEvent:B}),[P,I,j,B]);return(0,U.jsx)(jo.Provider,{value:H,children:(0,U.jsx)(q,{elementsRef:R,onMapChange:e=>{b?.(e),A(e)},children:L})})}const Mo=c.createContext(void 0);function No(){const e=c.useContext(Mo);if(void 0===e)throw new Error(w(65));return e}const zo=c.forwardRef(function(e,t){const{activateOnFocus:o=!1,className:n,loopFocus:r=!0,render:i,style:a,...s}=e,{onValueChange:l,orientation:d,value:u,setTabMap:p,tabActivationDirection:m}=X(),[f,g]=c.useState(0),[h,y]=c.useState(null),b=c.useRef(new Set),w=c.useRef(new Set),v=c.useRef(null);c.useEffect(()=>{if("undefined"==typeof ResizeObserver)return;const e=new ResizeObserver(()=>{b.current.forEach(e=>{e()})});return v.current=e,h&&e.observe(h),w.current.forEach(t=>{e.observe(t)}),()=>{e.disconnect(),v.current=null}},[h]);const x=_(e=>(b.current.add(e),()=>{b.current.delete(e)})),k=_(e=>(w.current.add(e),v.current?.observe(e),()=>{w.current.delete(e),v.current?.unobserve(e)})),S=_((e,t)=>{e!==u&&l(e,t)}),j={orientation:d,tabActivationDirection:m},E={"aria-orientation":"vertical"===d?"vertical":void 0,role:"tablist"},T=c.useMemo(()=>({activateOnFocus:o,highlightedTabIndex:f,registerIndicatorUpdateListener:x,registerTabResizeObserverElement:k,onTabActivation:S,setHighlightedTabIndex:g,tabsListElement:h}),[o,f,x,k,S,g,h]);return(0,U.jsx)(Mo.Provider,{value:T,children:(0,U.jsx)(Co,{render:i,className:n,style:a,state:j,refs:[t,y],props:[E,s],stateAttributesMapping:ee,highlightedIndex:f,enableHomeAndEndKeys:!0,loopFocus:r,orientation:d,onHighlightedIndexChange:g,onMapChange:p,disabledIndices:M})})});function Po(e){const t=Ut(e);let o=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const r=Gt(e),i=r?e.offsetWidth:o,a=r?e.offsetHeight:n;return(uo(o)!==i||uo(n)!==a)&&(o=i,n=a),{width:o,height:n}}var Io=o(89104);function Ro(){return C}function Ao(){return!1}function Bo(){return!0}let Lo=function(e){return e.activeTabLeft="--active-tab-left",e.activeTabRight="--active-tab-right",e.activeTabTop="--active-tab-top",e.activeTabBottom="--active-tab-bottom",e.activeTabWidth="--active-tab-width",e.activeTabHeight="--active-tab-height",e}({});const Ho=c.createContext(void 0),Fo={disableStyleElements:!1},$o={...ee,activeTabPosition:()=>null,activeTabSize:()=>null},Oo=c.forwardRef(function(e,t){const{className:o,render:n,renderBeforeHydration:r=!1,style:i,...a}=e,{nonce:s}=c.useContext(Ho)??Fo,{getTabElementBySelectedValue:l,orientation:d,tabActivationDirection:u,value:p}=X(),{tabsListElement:m,registerIndicatorUpdateListener:f}=No(),g=(0,Io.useSyncExternalStore)(Ro,Ao,Bo),h=function(){const[,e]=c.useState({});return c.useCallback(()=>{e({})},[])}();c.useEffect(()=>f(h),[f,h]);let _=0,y=0,b=0,w=0,v=0,x=0,k=!1;if(null!=p&&null!=m){const e=l(p);if(k=!0,null!=e){const{width:t,height:o}=Po(e),{width:n,height:r}=Po(m),i=e.getBoundingClientRect(),a=m.getBoundingClientRect(),s=n>0?a.width/n:1,l=r>0?a.height/r:1;if(Math.abs(s)>Number.EPSILON&&Math.abs(l)>Number.EPSILON){const e=i.left-a.left,t=i.top-a.top;_=e/s+m.scrollLeft-m.clientLeft,b=t/l+m.scrollTop-m.clientTop}else _=e.offsetLeft,b=e.offsetTop;v=t,x=o,y=m.scrollWidth-_-v,w=m.scrollHeight-b-x}}const S=V("span",e,{state:{orientation:d,activeTabPosition:k?{left:_,right:y,top:b,bottom:w}:null,activeTabSize:k?{width:v,height:x}:null,tabActivationDirection:u},ref:t,props:[{role:"presentation",style:k?{[Lo.activeTabLeft]:`${_}px`,[Lo.activeTabRight]:`${y}px`,[Lo.activeTabTop]:`${b}px`,[Lo.activeTabBottom]:`${w}px`,[Lo.activeTabWidth]:`${v}px`,[Lo.activeTabHeight]:`${x}px`}:void 0,hidden:!(k&&v>0&&x>0)},a,{suppressHydrationWarning:!0}],stateAttributesMapping:$o});return null==p?null:(0,U.jsxs)(c.Fragment,{children:[S,g&&r&&(0,U.jsx)("script",{nonce:s,dangerouslySetInnerHTML:{__html:'!function(){const t=document.currentScript.previousElementSibling;if(!t)return;const e=t.closest(\'[role="tablist"]\');if(!e)return;const i=e.querySelector("[data-active]");if(!i)return;if(0===i.offsetWidth||0===e.offsetWidth)return;let o=0,n=0,h=0,l=0,r=0,f=0;function s(t){const e=getComputedStyle(t);let i=parseFloat(e.width)||0,o=parseFloat(e.height)||0;return(Math.round(i)!==t.offsetWidth||Math.round(o)!==t.offsetHeight)&&(i=t.offsetWidth,o=t.offsetHeight),{width:i,height:o}}if(null!=i&&null!=e){const{width:t,height:c}=s(i),{width:u,height:d}=s(e),a=i.getBoundingClientRect(),g=e.getBoundingClientRect(),p=u>0?g.width/u:1,b=d>0?g.height/d:1;if(Math.abs(p)>Number.EPSILON&&Math.abs(b)>Number.EPSILON){const t=a.left-g.left,i=a.top-g.top;o=t/p+e.scrollLeft-e.clientLeft,h=i/b+e.scrollTop-e.clientTop}else o=i.offsetLeft,h=i.offsetTop;r=t,f=c,n=e.scrollWidth-o-r,l=e.scrollHeight-h-f}function c(e,i){t.style.setProperty(`--active-tab-${e}`,`${i}px`)}c("left",o),c("right",n),c("top",h),c("bottom",l),c("width",r),c("height",f),r>0&&f>0&&t.removeAttribute("hidden")}();'},suppressHydrationWarning:!0})]})});var Do=o(29491),Vo="data-wp-hash";function Wo(){const e=globalThis;return e.__wpStyleRuntime||(e.__wpStyleRuntime={documents:new Map,styles:new Map,injectedStyles:new WeakMap},"undefined"!=typeof document&&function(e){const t=Wo();t.documents.set(e,(t.documents.get(e)??0)+1);for(const[o,n]of t.styles)Go(e,o,n)}(document)),e.__wpStyleRuntime}function Go(e,t,o){if(!e.head)return;const n=Wo();let r=n.injectedStyles.get(e);if(r||(r=new Set,n.injectedStyles.set(e,r)),r.has(t))return;if(function(e,t){if(!e.head)return!1;for(const o of e.head.querySelectorAll(`style[${Vo}]`))if(o.getAttribute(Vo)===t)return!0;return!1}(e,t))return void r.add(t);const i=e.createElement("style");i.setAttribute(Vo,t),i.appendChild(e.createTextNode(o)),e.head.appendChild(i),r.add(t)}!function(e,t){const o=Wo();o.styles.set(e,t);for(const n of o.documents.keys())Go(n,e,t)}("bb8cbb8f31",'@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{._7313adbc8a112e90__tablist{--direction-factor:1;--direction-start:left;--direction-end:right;align-items:stretch;display:flex;overflow-inline:auto;overscroll-behavior-inline:none;position:relative;&:dir(rtl){--direction-factor:-1;--direction-start:right;--direction-end:left}&[data-orientation=horizontal]{--fade-width:4rem;--fade-gradient-base:transparent 0%,#000 var(--fade-width);--fade-gradient-composed:var(--fade-gradient-base),#000 60%,transparent 50%;width:fit-content;&._9f2ac729c68a735a__is-overflowing-first{mask-image:linear-gradient(to var(--direction-end),var(--fade-gradient-base))}&._81c799c1f3cdd261__is-overflowing-last{mask-image:linear-gradient(to var(--direction-start),var(--fade-gradient-base))}&._9f2ac729c68a735a__is-overflowing-first._81c799c1f3cdd261__is-overflowing-last{mask-image:linear-gradient(to right,var(--fade-gradient-composed)),linear-gradient(to left,var(--fade-gradient-composed))}&._59228b5227f38a99__is-minimal-variant{gap:1rem}}&[data-orientation=vertical]{flex-direction:column}}._1c37dcfaa1ad8cda__indicator{@media not (prefers-reduced-motion){transition-duration:.2s;transition-property:translate,width,height,border-radius,border-block;transition-timing-function:ease-out}outline:2px solid transparent;outline-offset:-1px;pointer-events:none;position:absolute;&[data-orientation=horizontal]{background-color:var(--wpds-color-stroke-interactive-neutral-strong,#6e6e6e);bottom:0;height:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px));left:0;translate:var(--active-tab-left) 0;width:var(--active-tab-width);z-index:1}&[data-orientation=vertical]{background-color:var(--wpds-color-background-interactive-neutral-weak-active,#ededed);border-radius:var(--wpds-border-radius-sm,2px);height:var(--active-tab-height);left:50%;top:0;translate:-50% var(--active-tab-top);width:100%;z-index:0}._7313adbc8a112e90__tablist[data-select-on-move=true]:has(:focus-visible)\n\t\t\t&[data-orientation=vertical]{border:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9));box-sizing:border-box}}.a5fd8814f195aa5e__tab{align-items:center;background:transparent;border:none;border-radius:0;box-shadow:none;color:var(--wpds-color-foreground-interactive-neutral,#1e1e1e);cursor:var(--wpds-cursor-control,pointer);display:flex;flex:1 0 auto;font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-md,13px);font-weight:400;line-height:1.2;outline:none;padding:0;position:relative;white-space:nowrap;z-index:1;&[data-disabled]{color:var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d);cursor:default;@media (forced-colors:active){color:GrayText}}&:not([data-disabled]):is(:hover,:focus-visible){color:var(--wpds-color-foreground-interactive-neutral-active,#1e1e1e)}&:after{border-radius:var(--wpds-border-radius-sm,2px);opacity:0;outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9));pointer-events:none;position:absolute;z-index:-1;@media not (prefers-reduced-motion){transition:opacity .1s linear}}&:focus-visible:after{opacity:1}[data-orientation=horizontal] &{height:48px;padding-inline:var(--wpds-dimension-padding-lg,16px);scroll-margin:24px;&:after{content:"";inset:var(--wpds-dimension-padding-md,12px)}}._59228b5227f38a99__is-minimal-variant[data-orientation=horizontal] &{padding-inline:0;&:after{inset-inline:round(up,var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)),1px)}}[data-orientation=vertical] &{min-height:var(--wpds-dimension-size-lg,40px);padding:var(--wpds-dimension-padding-sm,8px) var(--wpds-dimension-padding-md,12px)}[data-orientation=vertical][data-select-on-move=false] &:after{content:"";inset:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px))}}._5dfc77e6edd345d4__tab-children{align-items:center;display:flex;flex-grow:1;[data-orientation=horizontal] &{justify-content:center}[data-orientation=vertical] &{justify-content:start}}._4a20e969d15e5ac1__tab-chevron{flex-shrink:0;margin-inline-end:calc(var(--wpds-dimension-gap-xs, 4px)*-1);opacity:0;[data-orientation=horizontal] &{display:none}[role=tab]:is([aria-selected=true],:focus-visible,:hover) &{opacity:1}@media not (prefers-reduced-motion){[data-select-on-move=true]\n\t\t\t\t[role=tab]:is([aria-selected=true])\n\t\t\t\t&{transition:opacity .15s linear .15s}}&:dir(rtl){rotate:180deg}}}}');var Uo={tablist:"_7313adbc8a112e90__tablist","is-overflowing-first":"_9f2ac729c68a735a__is-overflowing-first","is-overflowing-last":"_81c799c1f3cdd261__is-overflowing-last","is-minimal-variant":"_59228b5227f38a99__is-minimal-variant",indicator:"_1c37dcfaa1ad8cda__indicator",tab:"a5fd8814f195aa5e__tab","tab-children":"_5dfc77e6edd345d4__tab-children","tab-chevron":"_4a20e969d15e5ac1__tab-chevron"},qo=(0,n.forwardRef)(function({children:e,variant:t="default",className:o,activateOnFocus:r,...i},a){const[s,l]=(0,n.useState)(null),[c,d]=(0,n.useState)({first:!1,last:!1,isScrolling:!1});(0,n.useEffect)(()=>{if(!s)return;const e=()=>{const{scrollWidth:e,clientWidth:t,scrollLeft:o}=s,n=Math.max(e-t,0),r="rtl"===(s.dir||("undefined"!=typeof window?window.getComputedStyle(s).direction:"ltr"))&&o<0?-o:o;d({first:r>1,last:r<n-1,isScrolling:e>t})},t=new ResizeObserver(e);t.observe(s);let o=!1;const n=()=>{o||(requestAnimationFrame(()=>{e(),o=!1}),o=!0)};return s.addEventListener("scroll",n,{passive:!0}),e(),()=>{s.removeEventListener("scroll",n),t.disconnect()}},[s]);const u=(0,Do.useMergeRefs)([a,e=>l(e)]);return(0,U.jsxs)(zo,{ref:u,activateOnFocus:r,"data-select-on-move":r?"true":"false",className:(0,ce.A)(Uo.tablist,c.first&&Uo["is-overflowing-first"],c.last&&Uo["is-overflowing-last"],Uo[`is-${t}-variant`],o),...i,tabIndex:i.tabIndex??(c.isScrolling?-1:void 0),children:[e,(0,U.jsx)(Oo,{className:Uo.indicator})]})});function Ko(e){return e?.ownerDocument||document}function Zo(e){return Gt(e)&&"BUTTON"===e.tagName}const Yo=c.forwardRef(function(e,t){const{className:o,disabled:n=!1,render:r,value:i,id:a,nativeButton:s=!0,style:l,...d}=e,{value:p,getTabPanelIdByValue:m,orientation:f}=X(),{activateOnFocus:g,highlightedTabIndex:h,onTabActivation:y,registerTabResizeObserverElement:b,setHighlightedTabIndex:w,tabsListElement:x}=No(),k=me(a),S=c.useMemo(()=>({disabled:n,id:k,value:i}),[n,k,i]),{compositeProps:j,compositeRef:E,index:T}=function(e={}){const{highlightItemOnHover:t,highlightedIndex:o,onHighlightedIndexChange:n}=Eo(),{ref:r,index:i}=je(e),a=o===i,s=c.useRef(null),l=v(r,s),d=c.useMemo(()=>({tabIndex:a?0:-1,onFocus(){n(i)},onMouseMove(){const e=s.current;if(!t||!e)return;const o=e.hasAttribute("disabled")||"true"===e.ariaDisabled;a||o||e.focus()}}),[a,n,i,t]);return{compositeProps:d,compositeRef:l,index:i}}({metadata:S}),C=i===p,M=c.useRef(!1),N=c.useRef(null);c.useEffect(()=>{const e=N.current;if(e)return b(e)},[b]),u(()=>{if(M.current)return void(M.current=!1);if(!(C&&T>-1&&h!==T))return;const e=x;if(null!=e){const t=function(e){let t=e.activeElement;for(;null!=t?.shadowRoot?.activeElement;)t=t.shadowRoot.activeElement;return t}(Ko(e));if(t&&function(e,t){if(!e||!t)return!1;const o=t.getRootNode?.();if(e.contains(t))return!0;if(o&&function(e){return!(!Vt()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof Wt(e).ShadowRoot)}(o)){let o=t;for(;o;){if(e===o)return!0;o=o.parentNode||o.host}}return!1}(e,t))return}n||w(T)},[C,T,h,w,n,x]);const{getButtonProps:z,buttonRef:I}=function(e={}){const{disabled:t=!1,focusableWhenDisabled:o,tabIndex:n=0,native:r=!0,composite:i}=e,a=c.useRef(null),s=Eo(!0),l=i??void 0!==s,{props:d}=function(e){const{focusableWhenDisabled:t,disabled:o,composite:n=!1,tabIndex:r=0,isNativeButton:i}=e,a=n&&!1!==t,s=n&&!1===t;return{props:c.useMemo(()=>{const e={onKeyDown(e){o&&t&&"Tab"!==e.key&&e.preventDefault()}};return n||(e.tabIndex=r,!i&&o&&(e.tabIndex=t?r:-1)),(i&&(t||a)||!i&&o)&&(e["aria-disabled"]=o),!i||t&&!s||(e.disabled=o),e},[n,o,t,a,s,i,r])}}({focusableWhenDisabled:o,disabled:t,composite:l,tabIndex:n,isNativeButton:r}),p=c.useCallback(()=>{const e=a.current;Zo(e)&&l&&t&&void 0===d.disabled&&e.disabled&&(e.disabled=!1)},[t,d.disabled,l]);return u(p,[p]),{getButtonProps:c.useCallback((e={})=>{const{onClick:o,onMouseDown:n,onKeyUp:i,onKeyDown:a,onPointerDown:s,...c}=e;return P({onClick(e){t?e.preventDefault():o?.(e)},onMouseDown(e){t||n?.(e)},onKeyDown(e){if(t)return;if($(e),a?.(e),e.baseUIHandlerPrevented)return;const n=e.target===e.currentTarget,i=e.currentTarget,s=Zo(i),c=!r&&(d=i,Boolean("A"===d?.tagName&&d?.href));var d;const u=n&&(r?s:!c),p="Enter"===e.key,m=" "===e.key,f=i.getAttribute("role"),g=f?.startsWith("menuitem")||"option"===f||"gridcell"===f;if(n&&l&&m){if(e.defaultPrevented&&g)return;return e.preventDefault(),void(c||r&&s?(i.click(),e.preventBaseUIHandler()):u&&(o?.(e),e.preventBaseUIHandler()))}u&&(r||!m&&!p||e.preventDefault(),!r&&p&&o?.(e))},onKeyUp(e){t||($(e),i?.(e),e.target===e.currentTarget&&r&&l&&Zo(e.currentTarget)&&" "===e.key?e.preventDefault():e.baseUIHandlerPrevented||e.target!==e.currentTarget||r||l||" "!==e.key||o?.(e))},onPointerDown(e){t?e.preventDefault():s?.(e)}},r?{type:"button"}:{role:"button"},d,c)},[t,d,l,r]),buttonRef:_(e=>{a.current=e,p()})}}({disabled:n,native:s,focusableWhenDisabled:!0}),R=m(i),A=c.useRef(!1),B=c.useRef(!1);return V("button",e,{state:{disabled:n,active:C,orientation:f},ref:[t,I,E,N],props:[j,{role:"tab","aria-controls":R,"aria-selected":C,id:k,onClick:function(e){C||n||y(i,te(oe,e.nativeEvent,void 0,{activationDirection:"none"}))},onFocus:function(e){C||(T>-1&&!n&&w(T),n||g&&(!A.current||A.current&&B.current)&&y(i,te(oe,e.nativeEvent,void 0,{activationDirection:"none"})))},onPointerDown:function(e){C||n||(A.current=!0,e.button&&0!==e.button)||(B.current=!0,Ko(e.currentTarget).addEventListener("pointerup",function(){A.current=!1,B.current=!1},{once:!0}))},[xo]:C?"":void 0,onKeyDownCapture(){M.current=!0}},d,z]})});var Jo=(0,U.jsx)(Be.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",children:(0,U.jsx)(Be.Path,{d:"M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z"})}),Xo="data-wp-hash";function Qo(){const e=globalThis;return e.__wpStyleRuntime||(e.__wpStyleRuntime={documents:new Map,styles:new Map,injectedStyles:new WeakMap},"undefined"!=typeof document&&function(e){const t=Qo();t.documents.set(e,(t.documents.get(e)??0)+1);for(const[o,n]of t.styles)en(e,o,n)}(document)),e.__wpStyleRuntime}function en(e,t,o){if(!e.head)return;const n=Qo();let r=n.injectedStyles.get(e);if(r||(r=new Set,n.injectedStyles.set(e,r)),r.has(t))return;if(function(e,t){if(!e.head)return!1;for(const o of e.head.querySelectorAll(`style[${Xo}]`))if(o.getAttribute(Xo)===t)return!0;return!1}(e,t))return void r.add(t);const i=e.createElement("style");i.setAttribute(Xo,t),i.appendChild(e.createTextNode(o)),e.head.appendChild(i),r.add(t)}!function(e,t){const o=Qo();o.styles.set(e,t);for(const n of o.documents.keys())en(n,e,t)}("bb8cbb8f31",'@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{._7313adbc8a112e90__tablist{--direction-factor:1;--direction-start:left;--direction-end:right;align-items:stretch;display:flex;overflow-inline:auto;overscroll-behavior-inline:none;position:relative;&:dir(rtl){--direction-factor:-1;--direction-start:right;--direction-end:left}&[data-orientation=horizontal]{--fade-width:4rem;--fade-gradient-base:transparent 0%,#000 var(--fade-width);--fade-gradient-composed:var(--fade-gradient-base),#000 60%,transparent 50%;width:fit-content;&._9f2ac729c68a735a__is-overflowing-first{mask-image:linear-gradient(to var(--direction-end),var(--fade-gradient-base))}&._81c799c1f3cdd261__is-overflowing-last{mask-image:linear-gradient(to var(--direction-start),var(--fade-gradient-base))}&._9f2ac729c68a735a__is-overflowing-first._81c799c1f3cdd261__is-overflowing-last{mask-image:linear-gradient(to right,var(--fade-gradient-composed)),linear-gradient(to left,var(--fade-gradient-composed))}&._59228b5227f38a99__is-minimal-variant{gap:1rem}}&[data-orientation=vertical]{flex-direction:column}}._1c37dcfaa1ad8cda__indicator{@media not (prefers-reduced-motion){transition-duration:.2s;transition-property:translate,width,height,border-radius,border-block;transition-timing-function:ease-out}outline:2px solid transparent;outline-offset:-1px;pointer-events:none;position:absolute;&[data-orientation=horizontal]{background-color:var(--wpds-color-stroke-interactive-neutral-strong,#6e6e6e);bottom:0;height:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px));left:0;translate:var(--active-tab-left) 0;width:var(--active-tab-width);z-index:1}&[data-orientation=vertical]{background-color:var(--wpds-color-background-interactive-neutral-weak-active,#ededed);border-radius:var(--wpds-border-radius-sm,2px);height:var(--active-tab-height);left:50%;top:0;translate:-50% var(--active-tab-top);width:100%;z-index:0}._7313adbc8a112e90__tablist[data-select-on-move=true]:has(:focus-visible)\n\t\t\t&[data-orientation=vertical]{border:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9));box-sizing:border-box}}.a5fd8814f195aa5e__tab{align-items:center;background:transparent;border:none;border-radius:0;box-shadow:none;color:var(--wpds-color-foreground-interactive-neutral,#1e1e1e);cursor:var(--wpds-cursor-control,pointer);display:flex;flex:1 0 auto;font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-md,13px);font-weight:400;line-height:1.2;outline:none;padding:0;position:relative;white-space:nowrap;z-index:1;&[data-disabled]{color:var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d);cursor:default;@media (forced-colors:active){color:GrayText}}&:not([data-disabled]):is(:hover,:focus-visible){color:var(--wpds-color-foreground-interactive-neutral-active,#1e1e1e)}&:after{border-radius:var(--wpds-border-radius-sm,2px);opacity:0;outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9));pointer-events:none;position:absolute;z-index:-1;@media not (prefers-reduced-motion){transition:opacity .1s linear}}&:focus-visible:after{opacity:1}[data-orientation=horizontal] &{height:48px;padding-inline:var(--wpds-dimension-padding-lg,16px);scroll-margin:24px;&:after{content:"";inset:var(--wpds-dimension-padding-md,12px)}}._59228b5227f38a99__is-minimal-variant[data-orientation=horizontal] &{padding-inline:0;&:after{inset-inline:round(up,var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)),1px)}}[data-orientation=vertical] &{min-height:var(--wpds-dimension-size-lg,40px);padding:var(--wpds-dimension-padding-sm,8px) var(--wpds-dimension-padding-md,12px)}[data-orientation=vertical][data-select-on-move=false] &:after{content:"";inset:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px))}}._5dfc77e6edd345d4__tab-children{align-items:center;display:flex;flex-grow:1;[data-orientation=horizontal] &{justify-content:center}[data-orientation=vertical] &{justify-content:start}}._4a20e969d15e5ac1__tab-chevron{flex-shrink:0;margin-inline-end:calc(var(--wpds-dimension-gap-xs, 4px)*-1);opacity:0;[data-orientation=horizontal] &{display:none}[role=tab]:is([aria-selected=true],:focus-visible,:hover) &{opacity:1}@media not (prefers-reduced-motion){[data-select-on-move=true]\n\t\t\t\t[role=tab]:is([aria-selected=true])\n\t\t\t\t&{transition:opacity .15s linear .15s}}&:dir(rtl){rotate:180deg}}}}');var tn=(0,n.forwardRef)(function({className:e,children:t,...o},n){return(0,U.jsxs)(Yo,{ref:n,className:(0,ce.A)("a5fd8814f195aa5e__tab",e),...o,children:[(0,U.jsx)("span",{className:"_5dfc77e6edd345d4__tab-children",children:t}),(0,U.jsx)(Ve,{icon:Jo,className:"_4a20e969d15e5ac1__tab-chevron"})]})});function on({templateCategories:e}){return(0,U.jsx)("div",{className:"email-editor-template-select__sidebar",children:(0,U.jsx)(qo,{children:e.map(({name:e,label:t})=>(0,U.jsx)(tn,{value:e,children:t},e))})})}var nn=o(36135);const rn=(0,n.memo)(function({templates:e,handleTemplateSelection:t,templateSelectMode:o}){const r=(0,a.useSelect)(e=>e(i.store).getBlockPatternCategories(),[]),s="swap"===o,c=(0,n.useMemo)(()=>{const t=function(e,t){const o=new Map(t.map(e=>[e.name,e.label]));o.set("recent",(0,l.__)("Recent","woocommerce"));const n=new Set;for(const t of e)t.category&&n.add(t.category);return[...n].map(e=>({name:e,label:o.get(e)??e}))}(e,r??[]);return s?t.filter(e=>"recent"!==e.name):t.sort((e,t)=>"recent"===e.name?-1:"recent"===t.name?1:0)},[e,r,s]),[d,u]=(0,n.useState)(null);return(0,n.useEffect)(()=>{if(null!==d||0===c.length)return;const e=setTimeout(()=>{const e=c.find(e=>"recent"!==e.name)?.name??c[0]?.name;u(e)},1e3);return()=>clearTimeout(e)},[c,d]),0===c.length?(0,U.jsx)("div",{className:"email-editor-template-select",children:(0,U.jsx)(Dt,{templates:e,onTemplateSelection:t,selectedCategory:d})}):(0,U.jsxs)(le,{className:"email-editor-template-select",orientation:"vertical",value:d,onValueChange:e=>{(0,nn.yM)("template_select_modal_category_change",{category:e}),u(e)},children:[(0,U.jsx)(on,{templateCategories:c}),c.map(({name:o})=>(0,U.jsx)(Ie,{value:o,tabIndex:-1,className:"email-editor-template-select__panel",children:(0,U.jsx)(Dt,{templates:e,onTemplateSelection:t,selectedCategory:o})},o))]})});function an({onSelectCallback:e,closeCallback:t=null,previewContent:o="",postType:n}){const i=o?"swap":"new";(0,nn.xW)("template_select_modal_opened",{templateSelectMode:i});const[c,d]=(0,Re.p)(o),u=c?.length>0,p=t=>{const s=t.type===n,l=t.template;(0,nn.yM)("template_select_modal_template_selected",{templateSlug:t.slug,templateSelectMode:i,templateType:t.type}),o||(0,a.dispatch)(r.store).resetEditorBlocks(t.emailParsed),(0,a.dispatch)(Ae.H).setTemplateToPost(s?l.template:t.slug),e()},m=()=>{const e=c[0]??null;e&&((0,nn.yM)("template_select_modal_handle_close_without_template_selected"),p(e))};return(0,U.jsxs)(s.Modal,{title:"new"===i?(0,l.__)("Start with an email preset","woocommerce"):(0,l.__)("Select a template","woocommerce"),onRequestClose:()=>((0,nn.yM)("template_select_modal_closed",{templateSelectMode:i}),t?t():m()),isFullScreen:!0,children:[(0,U.jsx)(rn,{templates:[...c,...d],handleTemplateSelection:p,templateSelectMode:i}),(0,U.jsx)(s.Flex,{className:"email-editor-modal-footer",justify:"flex-end",children:(0,U.jsx)(s.FlexItem,{children:(0,U.jsx)(s.Button,{variant:"tertiary",className:"email-editor-start_from_scratch_button",onClick:()=>((0,nn.yM)("template_select_modal_start_from_scratch_clicked"),m()),isBusy:!u,children:(0,l.__)("Start from scratch","woocommerce")})})})]})}},20799:(e,t,o)=>{o.d(t,{G:()=>i,h:()=>a});var n=o(74997);const r=new Map;function i(e,t){const o=(0,n.getBlockType)(e);if(!o)return!1;const{name:i,...a}=o;try{r.has(i)||r.set(i,{...a});const e=t(a),o={...a,...e};return(0,n.unregisterBlockType)(i),(0,n.registerBlockType)(i,o),!0}catch(t){return console.error("Failed to update block settings for",e,t),!1}}function a(){const e=[];for(const[t,o]of r.entries())try{(0,n.unregisterBlockType)(t),(0,n.registerBlockType)(t,o),e.push(t),r.delete(t)}catch(e){console.error("Failed to restore block settings for",t,e)}return e}},35748:(e,t,o)=>{o.d(t,{oj:()=>s,r8:()=>l});var n=o(74997),r=o(47143);const i=new Set,a=new Map;function s(e,t){const o=((0,r.select)("core/blocks").getBlockStyles(e)||[]).find(e=>e.name===t);if(o){const n=a.get(e)||[];n.find(e=>e.name===t)||(n.push(o),a.set(e,n))}(0,n.unregisterBlockStyle)(e,t)}function l(){for(const e of i){const[t,o]=e.split("||");(0,n.unregisterBlockStyle)(t,o)}i.clear();for(const[e,t]of a.entries())t.forEach(t=>(0,n.registerBlockStyle)(e,t)),a.delete(e)}},53587:(e,t,o)=>{o.d(t,{$:()=>a,z:()=>i});var n=o(74997);const r=new Set;function i(e,t){(0,n.registerBlockVariation)(e,t),r.add(function(e,t){return`${e}||${t}`}(e,t.name))}function a(){for(const e of r){const[t,o]=e.split("||");(0,n.unregisterBlockVariation)(t,o)}r.clear()}},85166:(e,t,o)=>{o.d(t,{HY:()=>s,hC:()=>c,tN:()=>l});var n=o(52619);const r=new Set,i=new Set;function a(e,t){return`${e}||${t}`}function s(e,t,o,i){(0,n.addFilter)(e,t,o,i),r.add(a(e,t))}function l(e,t,o,r){(0,n.addAction)(e,t,o,r),i.add(a(e,t))}function c(){!function(){for(const e of r){const[t,o]=e.split("||");(0,n.removeFilter)(t,o),r.delete(e)}}(),function(){for(const e of i){const[t,o]=e.split("||");(0,n.removeAction)(t,o),i.delete(e)}}()}},79637:(e,t,o)=>{o.d(t,{aW:()=>l,gG:()=>a,le:()=>s});var n=o(50876);const r=new Set,i=new Map;function a(e,t){(0,n.registerFormatType)(e,{object:!1,...t}),r.add(e)}function s(e){const t=(0,n.unregisterFormatType)(e);t&&i.set(e,t)}function l(){for(const e of r)(0,n.unregisterFormatType)(e);r.clear();for(const[e,t]of i.entries())(0,n.registerFormatType)(e,{object:!1,...t}),i.delete(e)}},26377:(e,t,o)=>{o.d(t,{IF:()=>l});var n=o(35748),r=o(53587),i=o(79637),a=o(85166),s=o(20799);function l(){(0,s.h)(),(0,n.r8)(),(0,r.$)(),(0,i.aW)(),(0,a.hC)()}},36135:(e,t,o)=>{o.d(t,{T7:()=>d,V1:()=>i,oh:()=>s,vD:()=>a,xW:()=>c,yM:()=>l});var n=o(66087),r=o(52619);const i=()=>(0,r.applyFilters)("woocommerce_email_editor_events_tracking_enabled",!1),a="email_editor_events",s=new EventTarget,l=(e,t={})=>{if(!i())return;const o={name:`${a}_${e}`,..."object"!=typeof t?{data:t}:t};s.dispatchEvent(new CustomEvent(a,{detail:o}))},c=function(){const e={};return(t,o={})=>{if(!i())return;const n=`${t}_${JSON.stringify(o).length}`;e[n]||(l(t,o),e[n]=!0)}}(),d=(0,n.debounce)(l,700)},26314:(e,t,o)=>{o.d(t,{b:()=>ge});var n=o(86087),r=o(47143),i=o(43656),a=o(76597),s=o.n(a),l=o(34923),c=o(83026),d=o(74997),u=o(49786),p=o(61197),m=o(15795);function f(e,t="root",o={}){if(!t)return null;const{fallback:n=!1}=o,{name:r,selectors:i,supports:a}=e,s=i&&Object.keys(i).length>0,l=Array.isArray(t)?t.join("."):t;let c=null;if(c=s&&i.root?i?.root:a?.__experimentalSelector?a.__experimentalSelector:".wp-block-"+r.replace("core/","").replace("/","-"),"root"===l)return c;const d=Array.isArray(t)?t:t.split(".");if(1===d.length){const e=n?c:null;if(s)return(0,m.K)(i,`${l}.root`,null)||(0,m.K)(i,l,null)||e;const t=a?(0,m.K)(a,`${l}.__experimentalSelector`,null):void 0;return t?(0,p.q1)(c,t):e}let u;return s&&(u=(0,m.K)(i,l,null)),u||(n?f(e,d[0],o):null)}var g=o(90103),h={grad:.9,turn:360,rad:360/(2*Math.PI)},_=function(e){return"string"==typeof e?e.length>0:"number"==typeof e},y=function(e,t,o){return void 0===t&&(t=0),void 0===o&&(o=Math.pow(10,t)),Math.round(o*e)/o+0},b=function(e,t,o){return void 0===t&&(t=0),void 0===o&&(o=1),e>o?o:e>t?e:t},w=function(e){return(e=isFinite(e)?e%360:0)>0?e:e+360},v=function(e){return{r:b(e.r,0,255),g:b(e.g,0,255),b:b(e.b,0,255),a:b(e.a)}},x=function(e){return{r:y(e.r),g:y(e.g),b:y(e.b),a:y(e.a,3)}},k=/^#([0-9a-f]{3,8})$/i,S=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},j=function(e){var t=e.r,o=e.g,n=e.b,r=e.a,i=Math.max(t,o,n),a=i-Math.min(t,o,n),s=a?i===t?(o-n)/a:i===o?2+(n-t)/a:4+(t-o)/a:0;return{h:60*(s<0?s+6:s),s:i?a/i*100:0,v:i/255*100,a:r}},E=function(e){var t=e.h,o=e.s,n=e.v,r=e.a;t=t/360*6,o/=100,n/=100;var i=Math.floor(t),a=n*(1-o),s=n*(1-(t-i)*o),l=n*(1-(1-t+i)*o),c=i%6;return{r:255*[n,s,a,a,l,n][c],g:255*[l,n,n,s,a,a][c],b:255*[a,a,l,n,n,s][c],a:r}},T=function(e){return{h:w(e.h),s:b(e.s,0,100),l:b(e.l,0,100),a:b(e.a)}},C=function(e){return{h:y(e.h),s:y(e.s),l:y(e.l),a:y(e.a,3)}},M=function(e){return E((o=(t=e).s,{h:t.h,s:(o*=((n=t.l)<50?n:100-n)/100)>0?2*o/(n+o)*100:0,v:n+o,a:t.a}));var t,o,n},N=function(e){return{h:(t=j(e)).h,s:(r=(200-(o=t.s))*(n=t.v)/100)>0&&r<200?o*n/100/(r<=100?r:200-r)*100:0,l:r/2,a:t.a};var t,o,n,r},z=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,P=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,I=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,R=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,A={string:[[function(e){var t=k.exec(e);return t?(e=t[1]).length<=4?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:4===e.length?y(parseInt(e[3]+e[3],16)/255,2):1}:6===e.length||8===e.length?{r:parseInt(e.substr(0,2),16),g:parseInt(e.substr(2,2),16),b:parseInt(e.substr(4,2),16),a:8===e.length?y(parseInt(e.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(e){var t=I.exec(e)||R.exec(e);return t?t[2]!==t[4]||t[4]!==t[6]?null:v({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:void 0===t[7]?1:Number(t[7])/(t[8]?100:1)}):null},"rgb"],[function(e){var t=z.exec(e)||P.exec(e);if(!t)return null;var o,n,r=T({h:(o=t[1],n=t[2],void 0===n&&(n="deg"),Number(o)*(h[n]||1)),s:Number(t[3]),l:Number(t[4]),a:void 0===t[5]?1:Number(t[5])/(t[6]?100:1)});return M(r)},"hsl"]],object:[[function(e){var t=e.r,o=e.g,n=e.b,r=e.a,i=void 0===r?1:r;return _(t)&&_(o)&&_(n)?v({r:Number(t),g:Number(o),b:Number(n),a:Number(i)}):null},"rgb"],[function(e){var t=e.h,o=e.s,n=e.l,r=e.a,i=void 0===r?1:r;if(!_(t)||!_(o)||!_(n))return null;var a=T({h:Number(t),s:Number(o),l:Number(n),a:Number(i)});return M(a)},"hsl"],[function(e){var t=e.h,o=e.s,n=e.v,r=e.a,i=void 0===r?1:r;if(!_(t)||!_(o)||!_(n))return null;var a=function(e){return{h:w(e.h),s:b(e.s,0,100),v:b(e.v,0,100),a:b(e.a)}}({h:Number(t),s:Number(o),v:Number(n),a:Number(i)});return E(a)},"hsv"]]},B=function(e,t){for(var o=0;o<t.length;o++){var n=t[o][0](e);if(n)return[n,t[o][1]]}return[null,void 0]},L=function(e,t){var o=N(e);return{h:o.h,s:b(o.s+100*t,0,100),l:o.l,a:o.a}},H=function(e){return(299*e.r+587*e.g+114*e.b)/1e3/255},F=function(e,t){var o=N(e);return{h:o.h,s:o.s,l:b(o.l+100*t,0,100),a:o.a}},$=function(){function e(e){this.parsed=function(e){return"string"==typeof e?B(e.trim(),A.string):"object"==typeof e&&null!==e?B(e,A.object):[null,void 0]}(e)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return e.prototype.isValid=function(){return null!==this.parsed},e.prototype.brightness=function(){return y(H(this.rgba),2)},e.prototype.isDark=function(){return H(this.rgba)<.5},e.prototype.isLight=function(){return H(this.rgba)>=.5},e.prototype.toHex=function(){return t=(e=x(this.rgba)).r,o=e.g,n=e.b,i=(r=e.a)<1?S(y(255*r)):"","#"+S(t)+S(o)+S(n)+i;var e,t,o,n,r,i},e.prototype.toRgb=function(){return x(this.rgba)},e.prototype.toRgbString=function(){return t=(e=x(this.rgba)).r,o=e.g,n=e.b,(r=e.a)<1?"rgba("+t+", "+o+", "+n+", "+r+")":"rgb("+t+", "+o+", "+n+")";var e,t,o,n,r},e.prototype.toHsl=function(){return C(N(this.rgba))},e.prototype.toHslString=function(){return t=(e=C(N(this.rgba))).h,o=e.s,n=e.l,(r=e.a)<1?"hsla("+t+", "+o+"%, "+n+"%, "+r+")":"hsl("+t+", "+o+"%, "+n+"%)";var e,t,o,n,r},e.prototype.toHsv=function(){return e=j(this.rgba),{h:y(e.h),s:y(e.s),v:y(e.v),a:y(e.a,3)};var e},e.prototype.invert=function(){return O({r:255-(e=this.rgba).r,g:255-e.g,b:255-e.b,a:e.a});var e},e.prototype.saturate=function(e){return void 0===e&&(e=.1),O(L(this.rgba,e))},e.prototype.desaturate=function(e){return void 0===e&&(e=.1),O(L(this.rgba,-e))},e.prototype.grayscale=function(){return O(L(this.rgba,-1))},e.prototype.lighten=function(e){return void 0===e&&(e=.1),O(F(this.rgba,e))},e.prototype.darken=function(e){return void 0===e&&(e=.1),O(F(this.rgba,-e))},e.prototype.rotate=function(e){return void 0===e&&(e=15),this.hue(this.hue()+e)},e.prototype.alpha=function(e){return"number"==typeof e?O({r:(t=this.rgba).r,g:t.g,b:t.b,a:e}):y(this.rgba.a,3);var t},e.prototype.hue=function(e){var t=N(this.rgba);return"number"==typeof e?O({h:e,s:t.s,l:t.l,a:t.a}):y(t.h)},e.prototype.isEqual=function(e){return this.toHex()===O(e).toHex()},e}(),O=function(e){return e instanceof $?e:new $(e)};function D(e){return e.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/([0-9])([a-zA-Z])/g,"$1-$2").replace(/([a-zA-Z])([0-9])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase()}function V(e){if(!e)return;const t=e.match(/var:preset\|spacing\|(.+)/);return t?`var(--wp--preset--spacing--${t[1]})`:e}function W(e,t="0"){const o=function(e){if(!e)return null;const t="string"==typeof e;return{top:t?e:e?.top,left:t?e:e?.left}}(e);if(!o)return null;const n=V(o?.top)||t,r=V(o?.left)||t;return n===r?n:`${n} ${r}`}function G(e){if(!e||!e?.backgroundImage?.url)return;let t;return e?.backgroundSize||(t={backgroundSize:"cover"}),"contain"!==e?.backgroundSize||e?.backgroundPosition||(t={backgroundPosition:"50% 50%"}),t}var U={default:{name:"default",slug:"flow",className:"is-layout-flow",baseStyles:[{selector:" > .alignleft",rules:{float:"left","margin-inline-start":"0","margin-inline-end":"2em"}},{selector:" > .alignright",rules:{float:"right","margin-inline-start":"2em","margin-inline-end":"0"}},{selector:" > .aligncenter",rules:{"margin-left":"auto !important","margin-right":"auto !important"}}],spacingStyles:[{selector:" > :first-child",rules:{"margin-block-start":"0"}},{selector:" > :last-child",rules:{"margin-block-end":"0"}},{selector:" > *",rules:{"margin-block-start":null,"margin-block-end":"0"}}]},constrained:{name:"constrained",slug:"constrained",className:"is-layout-constrained",baseStyles:[{selector:" > .alignleft",rules:{float:"left","margin-inline-start":"0","margin-inline-end":"2em"}},{selector:" > .alignright",rules:{float:"right","margin-inline-start":"2em","margin-inline-end":"0"}},{selector:" > .aligncenter",rules:{"margin-left":"auto !important","margin-right":"auto !important"}},{selector:" > :where(:not(.alignleft):not(.alignright):not(.alignfull))",rules:{"max-width":"var(--wp--style--global--content-size)","margin-left":"auto !important","margin-right":"auto !important"}},{selector:" > .alignwide",rules:{"max-width":"var(--wp--style--global--wide-size)"}}],spacingStyles:[{selector:" > :first-child",rules:{"margin-block-start":"0"}},{selector:" > :last-child",rules:{"margin-block-end":"0"}},{selector:" > *",rules:{"margin-block-start":null,"margin-block-end":"0"}}]},flex:{name:"flex",slug:"flex",className:"is-layout-flex",displayMode:"flex",baseStyles:[{selector:"",rules:{"flex-wrap":"wrap","align-items":"center"}},{selector:" > :is(*, div)",rules:{margin:"0"}}],spacingStyles:[{selector:"",rules:{gap:null}}]},grid:{name:"grid",slug:"grid",className:"is-layout-grid",displayMode:"grid",baseStyles:[{selector:" > :is(*, div)",rules:{margin:"0"}}],spacingStyles:[{selector:"",rules:{gap:null}}]}},q=["appearanceTools","useRootPaddingAwareAlignments","background.backgroundImage","background.backgroundRepeat","background.backgroundSize","background.backgroundPosition","background.gradient","border.color","border.radius","border.radiusSizes","border.style","border.width","shadow.presets","shadow.defaultPresets","color.background","color.button","color.caption","color.custom","color.customDuotone","color.customGradient","color.defaultDuotone","color.defaultGradients","color.defaultPalette","color.duotone","color.gradients","color.heading","color.link","color.palette","color.text","custom","dimensions.aspectRatio","dimensions.height","dimensions.minHeight","dimensions.width","dimensions.dimensionSizes","layout.contentSize","layout.definitions","layout.wideSize","lightbox.enabled","lightbox.allowEditing","position.fixed","position.sticky","spacing.customSpacingSize","spacing.defaultSpacingSizes","spacing.spacingSizes","spacing.spacingScale","spacing.blockGap","spacing.margin","spacing.padding","spacing.units","typography.fluid","typography.customFontSize","typography.defaultFontSizes","typography.dropCap","typography.fontFamilies","typography.fontSizes","typography.fontStyle","typography.fontWeight","typography.letterSpacing","typography.lineHeight","typography.textAlign","typography.textColumns","typography.textDecoration","typography.textIndent","typography.textTransform","typography.writingMode"],K={button:"wp-element-button",caption:"wp-element-caption"},Z={__experimentalBorder:"border",color:"color",dimensions:"dimensions",spacing:"spacing",typography:"typography"};function Y(e={},t,o){let n=[];return Object.keys(e).forEach(r=>{const i=t+D(r.replace("/","-")),a=e[r];if(a instanceof Object){const e=i+o;n=[...n,...Y(a,e,o)]}else n.push(`${i}: ${a}`)}),n}var J=(e,t,o)=>{if("core/paragraph"!==o)return e;const n=t?.blocks?.["core/paragraph"];if("all"!==(n?.typography?.textIndent??t?.typography?.textIndent??"subsequent"))return e;const r=".wp-block-paragraph + .wp-block-paragraph";if(r in e){const t=e[r],o={...e};return delete o[r],o[".wp-block-paragraph"]=t,o}return e},X=(e,t)=>{const o=".wp-block-button";if(!(o in e))return e;const n={...e};return n[o]=n[o].map(e=>{const o=e.match(/^width:\s*(.+)$/);if(!o)return e;const n=o[1];let r=null;n.endsWith("%")&&(r=parseFloat(n));if(null===r&&n.startsWith("var(--wp--preset--dimension--")&&n.endsWith(")")){const e=n.slice(29,-1),o={...t?.dimensions?.dimensionSizes??{},...t?.blocks?.["core/button"]?.dimensions?.dimensionSizes??{}};for(const t of Object.values(o))if(Array.isArray(t)){for(const o of t)if(o.slug===e&&"string"==typeof o.size&&o.size.endsWith("%")){r=parseFloat(o.size);break}if(null!==r)break}}return null===r||isNaN(r)?e:`width: calc(${r} * 1% - (var(--wp--style--block-gap, 0.5em) * (1 - ${r} / 100)))`}),n},Q=(e,t)=>{const o={};return Object.entries(e).forEach(([e,n])=>{if("root"===e||!t?.[e])return;const r="string"==typeof n;if(r||"object"!=typeof n||null===n||Object.entries(n).forEach(([n,r])=>{if("root"===n||!t?.[e][n])return;const i=ee({[e]:{[n]:t[e][n]}});o[r]=[...o[r]||[],...i],delete t[e][n]}),r||"object"==typeof n&&null!==n&&"root"in n){const i=r?n:n.root,a=ee({[e]:t[e]});o[i]=[...o[i]||[],...a],delete t[e]}}),o};function ee(e={},t="",o,n={},r=!1){const i=p.B4===t,a=Object.entries(d.__EXPERIMENTAL_STYLE_PROPERTY).reduce((t,[n,{value:r,properties:a,useEngine:s,rootOnly:l}])=>{if(l&&!i)return t;const c=r;if("elements"===c[0]||s)return t;const d=(0,m.K)(e,c);if("--wp--style--root--padding"===n&&("string"==typeof d||!o))return t;if(a&&"string"!=typeof d)Object.entries(a).forEach(e=>{const[o,n]=e;if(!(0,m.K)(d,[n],!1))return;const r=o.startsWith("--")?o:D(o);t.push(`${r}: ${(0,u.getCSSValueFromRawStyle)((0,m.K)(d,[n]))}`)});else if((0,m.K)(e,c,!1)){const o=n.startsWith("--")?n:D(n);t.push(`${o}: ${(0,u.getCSSValueFromRawStyle)((0,m.K)(e,c))}`)}return t},[]);return e.background&&(e.background?.backgroundImage&&(e.background.backgroundImage=(0,p.y_)(e.background.backgroundImage,n)),!i&&e.background?.backgroundImage?.id&&(e={...e,background:{...e.background,...G(e.background)}})),(0,u.getCSSRules)(e).forEach(e=>{if(i&&(o||r)&&e.key.startsWith("padding"))return;const t=e.key.startsWith("--")?e.key:D(e.key);let s=(0,p.y_)(e.value,n);"font-size"===t&&(s=(0,g.j)({name:"",slug:"",size:s},n?.settings)),"aspect-ratio"===t&&a.push("min-height: unset"),a.push(`${t}: ${s}`)}),a}function te({layoutDefinitions:e=U,style:t,selector:o,hasBlockGapSupport:n,hasFallbackGapSupport:r,fallbackGapValue:i}){let a="",s=n?W(t?.spacing?.blockGap):"";if(r&&(o===p.B4?s=s||"0.5em":!n&&i&&(s=i)),s&&e&&(Object.values(e).forEach(({className:e,name:t,spacingStyles:r})=>{(n||"flex"===t||"grid"===t)&&r?.length&&r.forEach(t=>{const r=[];if(t.rules&&Object.entries(t.rules).forEach(([e,t])=>{r.push(`${e}: ${t||s}`)}),r.length){let i="";i=n?o===p.B4?`:root :where(.${e})${t?.selector||""}`:`:root :where(${o}-${e})${t?.selector||""}`:o===p.B4?`:where(.${e}${t?.selector||""})`:`:where(${o}.${e}${t?.selector||""})`,a+=`${i} { ${r.join("; ")}; }`}})}),o===p.B4&&n&&(a+=`${p.bB} { --wp--style--block-gap: ${s}; }`)),o===p.B4&&e){const t=["block","flex","grid"];Object.values(e).forEach(({className:e,displayMode:n,baseStyles:r})=>{n&&t.includes(n)&&(a+=`${o} .${e} { display:${n}; }`),r?.length&&r.forEach(t=>{const o=[];t.rules&&Object.entries(t.rules).forEach(([e,t])=>{o.push(`${e}: ${t}`)}),o.length&&(a+=`.${e}${t?.selector||""} { ${o.join("; ")}; }`)})})}return a}var oe=["border","color","dimensions","spacing","typography","filter","outline","shadow","background"];function ne(e){if(!e)return{};const t=Object.entries(e).filter(([e])=>oe.includes(e)).map(([e,t])=>[e,JSON.parse(JSON.stringify(t))]);return Object.fromEntries(t)}var re=(e,t)=>{const o=[];if(!e?.settings)return o;const n=e=>{let t={};return p.EA.forEach(({path:o})=>{const n=(0,m.K)(e,o,!1);!1!==n&&(t=(0,m.n)(t,o,n))}),t},r=n(e.settings),i=e.settings?.custom;return(Object.keys(r).length>0||i)&&o.push({presets:r,custom:i,selector:p.bB}),Object.entries(e.settings?.blocks??{}).forEach(([e,r])=>{const i=r.custom;if("string"==typeof t||!t[e])return;const a=n(r);(Object.keys(a).length>0||i)&&o.push({presets:a,custom:i,selector:t[e]?.selector,featureSelectors:t[e]?.featureSelectors})}),o};function ie(e,t,o){if(!e||"string"==typeof e)return o;const n=e[t];return"string"==typeof n?n:"object"==typeof n&&n.root?n.root:o}function ae(e,t,{path:o,valueKey:n,valueFunc:r,cssVarInfix:i}){const a=(0,m.K)(e,o,[]),s=[];for(const e of["default","theme","custom"])if(a[e])for(const o of a[e]){const e=D(o.slug);n&&!r?s.push(`--wp--preset--${i}--${e}: ${o[n]}`):r&&"function"==typeof r&&s.push(`--wp--preset--${i}--${e}: ${r(o,t)}`)}return s}function se(e,t){return re(e,t).flatMap(({presets:e})=>function(e={}){return p.EA.filter(e=>"duotone"===e.path.at(-1)).flatMap(t=>{const o=(0,m.K)(e,t.path,{});return["default","theme"].filter(e=>o[e]).flatMap(e=>o[e].map(e=>function(e,t){const o=function(e=[]){const t={r:[],g:[],b:[],a:[]};return e.forEach(e=>{const o=O(e).toRgb();t.r.push(o.r/255),t.g.push(o.g/255),t.b.push(o.b/255),t.a.push(o.a)}),t}(t);return`\n<svg\n\txmlns:xlink="http://www.w3.org/1999/xlink"\n\tviewBox="0 0 0 0"\n\twidth="0"\n\theight="0"\n\tfocusable="false"\n\trole="none"\n\taria-hidden="true"\n\tstyle="visibility: hidden; position: absolute; left: -9999px; overflow: hidden;"\n>\n\t<defs>\n\t\t<filter id="${e}">\n\t\t\t\x3c!--\n\t\t\t\tUse sRGB instead of linearRGB so transparency looks correct.\n\t\t\t\tUse perceptual brightness to convert to grayscale.\n\t\t\t--\x3e\n\t\t\t<feColorMatrix color-interpolation-filters="sRGB" type="matrix" values=" .299 .587 .114 0 0 .299 .587 .114 0 0 .299 .587 .114 0 0 .299 .587 .114 0 0 "></feColorMatrix>\n\t\t\t\x3c!-- Use sRGB instead of linearRGB to be consistent with how CSS gradients work. --\x3e\n\t\t\t<feComponentTransfer color-interpolation-filters="sRGB">\n\t\t\t\t<feFuncR type="table" tableValues="${o.r.join(" ")}"></feFuncR>\n\t\t\t\t<feFuncG type="table" tableValues="${o.g.join(" ")}"></feFuncG>\n\t\t\t\t<feFuncB type="table" tableValues="${o.b.join(" ")}"></feFuncB>\n\t\t\t\t<feFuncA type="table" tableValues="${o.a.join(" ")}"></feFuncA>\n\t\t\t</feComponentTransfer>\n\t\t\t\x3c!-- Re-mask the image with the original transparency since the feColorMatrix above loses that information. --\x3e\n\t\t\t<feComposite in2="SourceGraphic" operator="in"></feComposite>\n\t\t</filter>\n\t</defs>\n</svg>`}(`wp-duotone-${e.slug}`,e.colors))).join("")})}(e))}function le(e,t){let o="";return e&&""!==e.trim()?(e.split("&").forEach(e=>{if(e&&""!==e.trim())if(e.includes("{")){const n=e.replace("}","").split("{");if(2!==n.length)return;const[r,i]=n,a=r.match(/([>+~\s]*::[a-zA-Z-]+)/),s=a?a[1]:"",l=a?r.replace(s,"").trim():r.trim();let c;c=""===l?t:r.startsWith(" ")?(0,p.q1)(t,l):(0,p.fx)(t,l),o+=`:root :where(${c})${s}{${i.trim()}}`}else o+=`:root :where(${t}){${e.trim()}}`}),o):o}function ce(e={},t=[],o={}){const{hasBlockGapSupport:n,hasFallbackGapSupport:i,disableLayoutStyles:a=!1,disableRootPadding:s=!1,styleOptions:l={}}=o,c=t.length>0?t:(0,d.getBlockTypes)(),u=function(e,t){const o=t?"."+t:"",n=`settings${o}`,r=`settings${o}`;if(t)return(0,m.K)(e,n)??(0,m.K)(e,r);let i={};return q.forEach(t=>{const o=(0,m.K)(e,`settings.${t}`)??(0,m.K)(e,`settings.${t}`);void 0!==o&&(i=(0,m.n)(i,t.split("."),o))}),i}(e,"spacing.blockGap"),g=n??null!==u,h=i??!g;if(!e?.styles||!e?.settings)return[[],{}];const _=function(e){const t=e.styles?.blocks,o=t?.["core/separator"];return o&&o.color?.background&&!o.color?.text&&!o.border?.color?{...e,styles:{...e.styles,blocks:{...t,"core/separator":{...o,color:{...o.color,text:o.color?.background}}}}}:e}(e),y=((e,t)=>{const{getBlockStyles:o}=(0,r.select)(d.store),n={};return e.forEach(e=>{const r=e.name,i=f(e);if(!i)return;let a=f(e,"filter.duotone");if(!a){const t=f(e),o=(0,d.getBlockSupport)(e,"color.__experimentalDuotone",!1);"string"==typeof o&&t&&(a=(0,p.q1)(t,o))}const s=!!e?.supports?.layout||!!e?.supports?.__experimentalLayout,l=e?.supports?.spacing?.blockGap?.__experimentalDefault,c=o(r),u={};c?.forEach(e=>{const o=t?`-${t}`:"",n=`${e.name}${o}`,r=(0,p.NJ)(n,i);u[n]=r});const m=((e,t)=>{if(e?.selectors&&Object.keys(e.selectors).length>0)return e.selectors;const o={root:t};return Object.entries(Z).forEach(([t,n])=>{const r=f(e,t);r&&(o[n]=r)}),o})(e,i);n[r]={duotoneSelector:a??void 0,fallbackGapValue:l,featureSelectors:Object.keys(m).length?m:void 0,hasLayoutSupport:s,name:r,selector:i,styleVariationSelectors:c?.length?u:void 0}}),n})(c),b=((e,t)=>{const o=re(e,t);let n="";for(const{presets:t,custom:r,selector:i,featureSelectors:a}of o){const o=i,s={[o]:[]};if(e?.settings)for(const n of p.EA){const r=ae(t,e.settings,n);if(0===r.length)continue;const i=ie(a,n.path[0],o);s[i]||(s[i]=[]),s[i].push(...r)}const l=Y(r,"--wp--custom--","--");l.length>0&&s[o].push(...l);for(const[e,t]of Object.entries(s))t.length>0&&(n+=`${e}{${t.join(";")};}`)}return n})(_,y),w=((e,t,o,n,r=!1,i=!1,a={})=>{const s={blockGap:!0,blockStyles:!0,layoutStyles:!0,marginReset:!0,presets:!0,rootPadding:!0,variationStyles:!1,...a},l=((e,t)=>{const o=[];if(!e?.styles)return o;const n=ne(e.styles);return n&&o.push({styles:n,selector:p.B4,skipSelectorWrapper:!0}),Object.entries(d.__EXPERIMENTAL_ELEMENTS).forEach(([t,n])=>{e.styles?.elements?.[t]&&o.push({styles:e.styles?.elements?.[t]??{},selector:n,skipSelectorWrapper:!K[t]})}),Object.entries(e.styles?.blocks??{}).forEach(([e,n])=>{const r=ne(n),i=n,a=[];if(i?.variations){const o={};Object.entries(i.variations).forEach(([n,r])=>{const i=r;o[n]=ne(i),i?.css&&(o[n].css=i.css);const s="string"!=typeof t?t[e]?.styleVariationSelectors?.[n]:void 0;Object.entries(i?.elements??{}).forEach(([e,t])=>{t&&d.__EXPERIMENTAL_ELEMENTS[e]&&a.push({styles:t,selector:(0,p.q1)(s,d.__EXPERIMENTAL_ELEMENTS[e])})}),Object.entries(i?.blocks??{}).forEach(([e,o])=>{const n="string"!=typeof t?(0,p.q1)(s,t[e]?.selector):void 0,r="string"!=typeof t?(0,p.q1)(s,t[e]?.duotoneSelector):void 0,i="string"!=typeof t?(0,p.hX)(s,t[e]?.featureSelectors??{}):void 0,l=ne(o);o?.css&&(l.css=o.css),n&&"string"!=typeof t&&(a.push({selector:n,duotoneSelector:r,featureSelectors:i,fallbackGapValue:t[e]?.fallbackGapValue,hasLayoutSupport:t[e]?.hasLayoutSupport,styles:l}),Object.entries(o.elements??{}).forEach(([e,t])=>{t&&d.__EXPERIMENTAL_ELEMENTS[e]&&a.push({styles:t,selector:(0,p.q1)(n,d.__EXPERIMENTAL_ELEMENTS[e])})}))})}),r.variations=o}"string"!=typeof t&&t?.[e]?.selector&&o.push({duotoneSelector:t[e].duotoneSelector,fallbackGapValue:t[e].fallbackGapValue,hasLayoutSupport:t[e].hasLayoutSupport,selector:t[e].selector,styles:r,featureSelectors:t[e].featureSelectors,styleVariationSelectors:t[e].styleVariationSelectors,name:e}),Object.entries(i?.elements??{}).forEach(([n,r])=>{"string"!=typeof t&&r&&t?.[e]&&d.__EXPERIMENTAL_ELEMENTS[n]&&o.push({styles:r,selector:t[e]?.selector.split(",").map(e=>d.__EXPERIMENTAL_ELEMENTS[n].split(",").map(t=>e+" "+t)).join(",")})}),o.push(...a)}),o})(e,t),c=re(e,t),u=e?.settings?.useRootPaddingAwareAlignments,{contentSize:f,wideSize:g}=e?.settings?.layout||{},h=s.marginReset||s.rootPadding||s.layoutStyles;let _="";if(s.presets&&(f||g)&&(_+=`${p.bB} {`,_=f?_+` --wp--style--global--content-size: ${f};`:_,_=g?_+` --wp--style--global--wide-size: ${g};`:_,_+="}"),h&&(_+=":where(body) {margin: 0;",s.rootPadding&&u&&(_+="padding-right: 0; padding-left: 0; padding-top: var(--wp--style--root--padding-top); padding-bottom: var(--wp--style--root--padding-bottom) }\n\t\t\t\t.has-global-padding { padding-right: var(--wp--style--root--padding-right); padding-left: var(--wp--style--root--padding-left); }\n\t\t\t\t.has-global-padding > .alignfull { margin-right: calc(var(--wp--style--root--padding-right) * -1); margin-left: calc(var(--wp--style--root--padding-left) * -1); }\n\t\t\t\t.has-global-padding :where(:not(.alignfull.is-layout-flow) > .has-global-padding:not(.wp-block-block, .alignfull)) { padding-right: 0; padding-left: 0; }\n\t\t\t\t.has-global-padding :where(:not(.alignfull.is-layout-flow) > .has-global-padding:not(.wp-block-block, .alignfull)) > .alignfull { margin-left: 0; margin-right: 0;\n\t\t\t\t"),_+="}"),s.blockStyles&&l.forEach(({selector:t,duotoneSelector:a,styles:l,fallbackGapValue:c,hasLayoutSupport:d,featureSelectors:m,styleVariationSelectors:f,skipSelectorWrapper:g,name:h})=>{if(m){let t=Q(m,l);t=J(t,e.settings,h),t=X(t,e.settings),Object.entries(t).forEach(([e,t])=>{if(t.length){const o=t.join(";");_+=`:root :where(${e}){${o};}`}})}if(a){const e={};l?.filter&&(e.filter=l.filter,delete l.filter);const t=ee(e);t.length&&(_+=`${a}{${t.join(";")};}`)}r||p.B4!==t&&!d||(_+=te({style:l,selector:t,hasBlockGapSupport:o,hasFallbackGapSupport:n,fallbackGapValue:c}));const y=ee(l,t,u,e,i);y?.length&&(_+=`${g?t:`:root :where(${t})`}{${y.join(";")};}`),l?.css&&(_+=le(l.css,`:root :where(${t})`)),s.variationStyles&&f&&Object.entries(f).forEach(([o,r])=>{const i=l?.variations?.[o];if(i){if(m){let t=Q(m,i);t=J(t,e.settings,h),t=X(t,e.settings),Object.entries(t).forEach(([e,t])=>{if(t.length){const o=function(e,t){const o=e.split(","),n=[];return o.forEach(e=>{n.push(`${t.trim()}${e.trim()}`)}),n.join(", ")}(e,r),n=t.join(";");_+=`:root :where(${o}){${n};}`}})}const o=ee(i,r,u,e);o.length&&(_+=`:root :where(${r}){${o.join(";")};}`),i?.css&&(_+=le(i.css,`:root :where(${r})`)),d&&i?.spacing?.blockGap&&(_+=te({style:i,selector:r+t,hasBlockGapSupport:!0,hasFallbackGapSupport:n,fallbackGapValue:c}))}});const b=Object.entries(l).filter(([e])=>e.startsWith(":"));b?.length&&b.forEach(([e,o])=>{const n=ee(o);if(!n?.length)return;const r=`:root :where(${t.split(",").map(t=>t+e).join(",")}){${n.join(";")};}`;_+=r})}),s.layoutStyles&&(_+=".wp-site-blocks > .alignleft { float: left; margin-right: 2em; }",_+=".wp-site-blocks > .alignright { float: right; margin-left: 2em; }",_+=".wp-site-blocks > .aligncenter { justify-content: center; margin-left: auto; margin-right: auto; }"),s.blockGap&&o){const t=W(e?.styles?.spacing?.blockGap)||"0.5em";_+=`:root :where(.wp-site-blocks) > * { margin-block-start: ${t}; margin-block-end: 0; }`,_+=":root :where(.wp-site-blocks) > :first-child { margin-block-start: 0; }",_+=":root :where(.wp-site-blocks) > :last-child { margin-block-end: 0; }"}return s.presets&&c.forEach(({selector:e,presets:t})=>{p.B4!==e&&p.bB!==e||(e="");const o=function(e="*",t={}){return p.EA.reduce((o,{path:n,cssVarInfix:r,classes:i})=>{if(!i)return o;const a=(0,m.K)(t,n,[]);return["default","theme","custom"].forEach(t=>{a[t]&&a[t].forEach(({slug:t})=>{i.forEach(({classSuffix:n,propertyName:i})=>{const a=`.has-${D(t)}-${n}`,s=e.split(",").map(e=>`${e}${a}`).join(","),l=`var(--wp--preset--${r}--${D(t)})`;o+=`${s}{${i}: ${l} !important;}`})})}),o},"")}(e,t);o.length>0&&(_+=o)}),_})(_,y,g,h,a,s,l),v=se(_,y),x=[{css:b,isGlobalStyles:!0},{css:w,isGlobalStyles:!0},{css:_?.styles?.css??"",isGlobalStyles:!0},{assets:v,__unstableType:"svgs",isGlobalStyles:!0}];return c.forEach(e=>{const t=_?.styles?.blocks?.[e.name];if(t?.css){const{featureSelectors:o}=y[e.name],n="object"==typeof o?o?.css:void 0;let r;"string"==typeof n?r=n:"object"==typeof n&&(r=n?.root);const i=r??y[e.name].selector;x.push({css:le(t.css,i),isGlobalStyles:!0})}}),[x,_.settings]}const de={},ue=[],pe=(e={})=>(0,n.useMemo)(()=>e?.styles&&e?.settings?ce(e,[],{hasBlockGapSupport:!0,hasFallbackGapSupport:!1,disableLayoutStyles:!1,disableRootPadding:!1}):[ue,de],[e]);var me=o(46569);const fe=[];function ge(){const{userTheme:e}=(0,c.u)(),{editorTheme:t,layout:o,deviceType:a,initialEditorSettingsStyles:d}=(0,r.useSelect)(e=>{const{getEditorSettings:t,getDeviceType:o}=e(i.store),n=t(),r=e(l.H).getInitialEditorSettings();return{editorTheme:e(l.H).getTheme(),layout:n?.__experimentalFeatures?.layout,deviceType:o(),initialEditorSettingsStyles:r?.styles}},[]),u=(0,n.useMemo)(()=>s().all([{},t||{},e||{}]),[t,e]),[p]=pe(u);let m="";o&&"Mobile"!==a&&(m=`display:flow-root; width:${o?.contentSize||"660px"}; margin: 0 auto;box-sizing: border-box;max-width: 100%;`);const f=u.styles?.spacing?.padding;return f&&(m+=`padding-left:${(0,me.DJ)(f.left)};`,m+=`padding-right:${(0,me.DJ)(f.right)};`),[(0,n.useMemo)(()=>[...p??[],{css:`.is-root-container{ ${m} }`},...d??[]],[p,d,m])||fe]}},47200:(e,t,o)=>{o.d(t,{L:()=>a});var n=o(47143),r=o(34923);const i="core/editor";function a(){return(0,n.useSelect)(e=>{const t=e(r.H);if(!t)return!1;const o=e(i);if(!o)return!1;const n=o.getCurrentPostId(),a=o.getCurrentPostType(),s=t.getEmailPostId(),l=t.getEmailPostType();if(String(n)===String(s)&&String(a)===String(l))return!0;if("wp_template"===a){const e=t.getCurrentTemplate();if(!e)return!1;const o=t.getEmailTemplates();return!!o&&o.some(t=>t.id===e.id&&t.post_types?.includes(l))}return!1},[])}},51831:(e,t,o)=>{o.d(t,{p:()=>u});var n=o(86087),r=o(74997),i=o(47143),a=o(52619),s=o(34923);const l=[];function c(e,t){return e.map(e=>"core/post-content"===e.name?{...e,name:"core/group",innerBlocks:t}:e.innerBlocks?.length?{...e,innerBlocks:c(e.innerBlocks,t)}:e)}const d={};function u(e="",t=!0){const{templates:o,patterns:u,emailPosts:p,hasEmailPosts:m}=(0,i.useSelect)(o=>{const n=t&&"swap"!==e?o(s.H).getSentEmailEditorPosts():void 0;return{templates:o(s.H).getEmailTemplates(),patterns:o(s.H).getBlockPatternsForEmailTemplate(),emailPosts:n,hasEmailPosts:!(!n||!n?.length)}},[e,t]),f=(0,n.useMemo)(()=>{let t=[];const n=e&&(0,r.parse)(e);if(t=n?[{blocks:n}]:u,!t||!o)return l;const i=[];return o?.filter(e=>"email-general"!==e.slug)?.forEach(e=>{t?.forEach(t=>{let o=(0,r.parse)(e.content?.raw);o=c(o,t.blocks),i.push({id:e.id,slug:e.slug,previewContentParsed:o,emailParsed:t.emailBlocks??t.blocks,template:e,category:t.categories?.[0],type:e.type,displayName:t.title?`${e.title.rendered} - ${t.title}`:e.title.rendered})})}),i},[o,u,e]),g=(0,n.useMemo)(()=>p?.map(e=>{const t=(0,a.applyFilters)("woocommerce_email_editor_preferred_template_title","",e),{postTemplateContent:o}=function(e,t=[]){const o=e.template,n={postTemplateContent:null};if(!o)return n;if(d[o])return d[o];const r=t.find(e=>e.slug===o);if(!r)return n;const i={postTemplateContent:r?.template};return d[o]=i,i}(e,f),n=(0,r.parse)(e.content?.raw);let i=n;o?.content?.raw&&(i=c((0,r.parse)(o?.content?.raw),n));const s={...e,title:{raw:e.title.raw,rendered:t||e.title.rendered}};return{id:e.id,slug:e.slug,previewContentParsed:i,emailParsed:n,category:"recent",type:e.type,displayName:s.title.rendered,template:s}}),[p,f]);return[f||l,g||l,m]}},83026:(e,t,o)=>{o.d(t,{u:()=>s});var n=o(86087),r=o(47143),i=o(3582),a=o(34923);function s(){const{globalStylePost:e}=(0,r.useSelect)(e=>({globalStylePost:e(a.H).getGlobalEmailStylesPost()||null}),[]);return{userTheme:(0,n.useMemo)(()=>({settings:e?.settings,styles:e?.styles}),[e?.settings,e?.styles]),updateUserTheme:(0,n.useCallback)(t=>{e&&(0,r.dispatch)(i.store).editEntityRecord("root","globalStyles",e.id,{styles:t.styles,settings:t.settings})},[e])}}},14302:(e,t,o)=>{o.d(t,{oq:()=>y,KE:()=>g,fA:()=>h,D_:()=>p,oz:()=>l,Lf:()=>_,Bi:()=>b,yd:()=>w,sV:()=>f,H7:()=>m});var n=o(47143);const r=window.wp.privateApis;var i=o(43656),a=o(94715);const{unlock:s}=(0,r.__dangerousOptInToUnstableAPIsOnlyForCoreModules)("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/edit-site"),{ColorPanel:l,BackgroundPanel:c,useHasColorPanel:d,useHasBackgroundPanel:u}=s(a.privateApis),p=c??(()=>null),m=d??(()=>!0),f=u??(()=>!1),{Editor:g,FullscreenMode:h,ViewMoreMenuGroup:_,BackButton:y}=s(i.privateApis),{registerEntityAction:b,unregisterEntityAction:w}=s((0,n.dispatch)(i.store))},34923:(e,t,o)=>{o.d(t,{H:()=>n,q:()=>r});const n="email-editor/editor",r={name:"personalization_tag",kind:"root",baseURL:"/woocommerce-email-editor/v1/personalization_tags",key:"token"}},77977:(e,t,o)=>{o.d(t,{y$:()=>ue});var n={};o.r(n),o.d(n,{invalidatePersonalizationTagsCache:()=>h,requestSendingNewsletterPreview:()=>w,setContentValidation:()=>v,setEditorConfig:()=>j,setEditorSettings:()=>x,setEditorTheme:()=>k,setEditorUrls:()=>S,setEmailPost:()=>g,setEmailPostType:()=>_,setTemplateSelected:()=>b,setTemplateToPost:()=>y,togglePreviewModal:()=>m,updateSendPreviewEmail:()=>f});var r={};o.r(r),o.d(r,{canUserEditGlobalEmailStyles:()=>Z,canUserEditTemplates:()=>W,getBlockPatternsForEmailTemplate:()=>V,getContentValidation:()=>ce,getCurrentTemplate:()=>q,getCurrentTemplateContent:()=>K,getEditedEmailContent:()=>$,getEditedPostTemplate:()=>U,getEmailPostId:()=>X,getEmailPostType:()=>Q,getEmailTemplates:()=>J,getGlobalEmailStylesPost:()=>Y,getGlobalStylesPostId:()=>se,getInitialEditorSettings:()=>ee,getPaletteColors:()=>te,getPersonalizationTagsList:()=>re,getPreviewState:()=>oe,getSentEmailEditorPosts:()=>D,getStyles:()=>ie,getTheme:()=>ae,getUrls:()=>le,hasEdits:()=>L,hasEmptyContent:()=>H,isEmailSent:()=>F,isFeatureActive:()=>B,isTemplateSelected:()=>de});var i=o(47143),a=o(3582);const s=window.wp.dataControls;var l=o(34923);const c=new Map;function d(e){let t=c.get(e);return t||(t={context:"view",per_page:-1,...e?{post_id:e}:{}},c.set(e,t)),t}var u=o(30515),p=o(36135);function m(e){return{type:"CHANGE_PREVIEW_STATE",state:{isModalOpened:e}}}function f(e){return{type:"CHANGE_PREVIEW_STATE",state:{toEmail:e}}}const g=(e,t)=>async({dispatch:o})=>{if(!e||!t)throw new Error("setEmailPost requires valid postId and postType parameters");o({type:"SET_EMAIL_POST",state:{postId:e,postType:t}})},h=()=>async({registry:e})=>{const t=e.select(l.H).getEmailPostId();e.dispatch(a.store).invalidateResolution("getEntityRecords",[l.q.kind,l.q.name,d(t)])};function _(e){if(!e)throw new Error("setEmailPostType requires a valid postType parameter");return{type:"SET_EMAIL_POST",state:{postType:e}}}const y=e=>async({registry:t})=>{const o=t.select(l.H).getEmailPostId(),n=t.select(l.H).getEmailPostType();t.dispatch(a.store).editEntityRecord("postType",n,o,{template:e})};function b(){return{type:"SET_TEMPLATE_SELECTED"}}function*w(e){if(!(0,i.select)(l.H).getPreviewState().isSendingPreviewEmail){yield{type:"CHANGE_PREVIEW_STATE",state:{sendingPreviewStatus:null,isSendingPreviewEmail:!0}};try{const t=(0,i.select)(l.H).getEmailPostId();yield(0,s.apiFetch)({path:"/woocommerce-email-editor/v1/send_preview_email",method:"POST",data:{email:e,postId:t}}),yield{type:"CHANGE_PREVIEW_STATE",state:{sendingPreviewStatus:u.T.SUCCESS,isSendingPreviewEmail:!1}},(0,p.yM)("sent_preview_email",{postId:t,email:e})}catch(t){(0,p.yM)("sent_preview_email_error",{email:e}),yield{type:"CHANGE_PREVIEW_STATE",state:{sendingPreviewStatus:u.T.ERROR,isSendingPreviewEmail:!1,errorMessage:JSON.stringify(t?.error)}}}}}function v(e){return{type:"SET_CONTENT_VALIDATION",validation:e}}function x(e){return{type:"SET_EDITOR_SETTINGS",editorSettings:e}}function k(e){return{type:"SET_EDITOR_THEME",theme:e}}function S(e){return{type:"SET_EDITOR_URLS",urls:e}}function j(e){return{type:"SET_EDITOR_CONFIG",config:e}}function E(e,t){switch(t.type){case"CHANGE_PREVIEW_STATE":return{...e,preview:{...e.preview,...t.state}};case"SET_EMAIL_POST":return{...e,...t.state};case"SET_CONTENT_VALIDATION":return{...e,contentValidation:t.validation};case"SET_TEMPLATE_SELECTED":return{...e,templateSelected:!0};case"SET_EDITOR_SETTINGS":return{...e,editorSettings:t.editorSettings};case"SET_EDITOR_THEME":return{...e,theme:t.theme};case"SET_EDITOR_URLS":return{...e,urls:{...e.urls,...t.urls}};case"SET_EDITOR_CONFIG":return{...e,editorSettings:t.config.editorSettings,theme:t.config.theme,urls:t.config.urls,preview:{...e.preview,toEmail:t.config.userEmail},styles:{...e.styles,globalStylesPostId:t.config.globalStylesPostId??null}};default:return e}}var T=o(43656),C=o(41233),M=o(74997),N=o(52619);function z(e){return e?.content&&"function"==typeof e.content?e.content(e):e?.blocks?(0,M.serialize)(e.blocks):e?.content?e.content:""}const P=new WeakMap;function I(e){let t=P.get(e);return t||(t={...e,get blocks(){return(0,M.parse)(e.content)},get emailBlocks(){return e.emailContent?(0,M.parse)(e.emailContent):null}},P.set(e,t)),t}const R=new WeakMap;function A(e){if(!e)return null;const t=R.get(e);if(t)return t;const o={...e,title:e?.title?.raw||e?.title||"",content:e?.content?.raw||e?.content||""};return R.set(e,o),o}const B=(0,i.createRegistrySelector)(e=>(t,o)=>!!e(C.store).get(l.H,o)),L=(0,i.createRegistrySelector)(e=>()=>{const t=e(l.H).getEmailPostId(),o=e(l.H).getEmailPostType();return!!e(a.store).hasEditsForEntityRecord("postType",o,t)}),H=(0,i.createRegistrySelector)(e=>()=>{const t=e(l.H).getEmailPostId(),o=e(l.H).getEmailPostType(),n=e(a.store).getEntityRecord("postType",o,t);if(!n)return!0;const{content:r}=n;return!r.raw}),F=(0,i.createRegistrySelector)(e=>()=>{const t=e(l.H).getEmailPostId(),o=e(l.H).getEmailPostType(),n=e(a.store).getEntityRecord("postType",o,t);return!!n&&"sent"===n.status}),$=(0,i.createRegistrySelector)(e=>()=>{const t=e(l.H).getEmailPostId(),o=e(l.H).getEmailPostType(),n=e(a.store).getEditedEntityRecord("postType",o,t);return n?z(n):""}),O={per_page:30,status:"publish,sent"},D=(0,i.createRegistrySelector)(e=>()=>{const t=e(l.H).getEmailPostType(),o=(0,N.applyFilters)("woocommerce_email_editor_recent_emails_query",{...O},t),n=(r=o)&&"object"==typeof r&&!Array.isArray(r)?o:O;var r;return e(a.store).getEntityRecords("postType",t,n)?.filter(e=>""!==e?.content?.raw)||[]}),V=(0,i.createRegistrySelector)(e=>{const t=e(l.H).getEmailPostType();return(0,i.createSelector)(()=>t?e(a.store).getBlockPatterns().filter(({templateTypes:e,postTypes:o})=>Array.isArray(e)&&e.includes("email-template")&&(void 0===o||0===o.length||o.includes(t))).map(I):[],()=>[e(a.store).getBlockPatterns(),t])}),W=(0,i.createRegistrySelector)(e=>()=>e(a.store).canUser("create",{kind:"postType",name:"wp_template"}));function G(e,t){return W()?e(a.store).getEditedEntityRecord("postType","wp_template",t):A(e(a.store).getEntityRecord("postType","wp_template",t,{context:"view"}))}const U=(0,i.createRegistrySelector)(e=>(t,o)=>{const n=o||e(T.store).getEditedPostAttribute("template");if(n){const t={context:"view",per_page:-1,_woocommerce_email_editor:"fetch-all-templates"},o=e(a.store).getEntityRecords("postType","wp_template",t)?.find(e=>e.slug===n);return o?G(e,o.id):null}const r=e(a.store).getDefaultTemplateId({slug:"email-general"});return G(e,r)}),q=(0,i.createRegistrySelector)(e=>()=>{if("wp_template"===e(T.store).getCurrentPostType()){const t=e(T.store).getCurrentPostId();return e(a.store).getEditedEntityRecord("postType","wp_template",t)}return e(l.H).getEditedPostTemplate()}),K=()=>{const e=q();return e?z(e):""},Z=(0,i.createRegistrySelector)(e=>()=>{const t=e(l.H).getGlobalStylesPostId();return{postId:t,canEdit:e(a.store).canUser("update",{kind:"root",name:"globalStyles",id:t})}}),Y=(0,i.createRegistrySelector)(e=>()=>{const{postId:t,canEdit:o}=Z();return t&&void 0!==o&&t?o?e(a.store).getEditedEntityRecord("root","globalStyles",t):A(e(a.store).getEntityRecord("root","globalStyles",t,{context:"view"})):null}),J=(0,i.createRegistrySelector)(e=>{const t=e(l.H).getEmailPostType();return(0,i.createSelector)(()=>e(a.store).getEntityRecords("postType","wp_template",{per_page:-1,post_type:t,context:"view"})?.filter(e=>e.post_types.includes(t)),()=>[e(a.store).getEntityRecords("postType","wp_template",{per_page:-1,post_type:t,context:"view"})])});function X(e){return e.postId}function Q(e){return e.postType}function ee(e){return e.editorSettings}function te(e){return e.editorSettings?.__experimentalFeatures?.color?.palette}function oe(e){return e.preview}const ne=[],re=(0,i.createRegistrySelector)(e=>{let t=null;return()=>{const o=e(l.H).getEmailPostId(),n=e(a.store).getEntityRecords(l.q.kind,l.q.name,d(o))||ne,r=e(l.H).getEmailPostType();if(!r)return n;const i="wp_template"===r?e(l.H).getCurrentTemplate()?.post_types:void 0;if(t&&t.tags===n&&t.postType===r&&t.templatePostTypes===i)return t.result;const s=n.filter(e=>void 0===e.postTypes||0===e.postTypes.length||("wp_template"===r?Array.isArray(i)&&i.some(t=>e.postTypes.includes(t)):e.postTypes.includes(r)));return t={tags:n,postType:r,templatePostTypes:i,result:s},s}});function ie(e){return e.theme?.styles}function ae(e){return e.theme}function se(e){return e.styles.globalStylesPostId}function le(e){return e.urls}function ce(e){return e.contentValidation}function de(e){return e.templateSelected}const ue=()=>{if(void 0!==(0,i.select)(l.H))return(0,i.select)(l.H);const e=(0,i.createReduxStore)(l.H,{actions:n,controls:s.controls,selectors:r,resolvers:{},reducer:E,initialState:{editorSettings:void 0,theme:void 0,styles:{globalStylesPostId:null},urls:{back:"",listings:""},preview:{toEmail:"",isModalOpened:!1,isSendingPreviewEmail:!1,sendingPreviewStatus:null},contentValidation:void 0,templateSelected:!1}});return(0,i.register)(e),(0,i.dispatch)(a.store).addEntities([l.q]),e}},30515:(e,t,o)=>{o.d(t,{T:()=>n});let n=function(e){return e.SUCCESS="success",e.ERROR="error",e}({})},46569:(e,t,o)=>{function n(e){if("string"!=typeof e)return null;const t=e.match(/^var:preset\|([a-zA-Z0-9-]+)\|([a-zA-Z0-9-]+)$/);return t?`--wp--preset--${t[1]}--${t[2]}`:null}function r(e){const t=n(e);return t?`var(${t})`:e}function i(e){const t=n(e);if(!t)return e;const o=document.querySelector(":root");return o&&getComputedStyle(o).getPropertyValue(t).trim()||e}o.d(t,{DJ:()=>r,pr:()=>i})},76597:e=>{var t=function(e){return function(e){return!!e&&"object"==typeof e}(e)&&!function(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||function(e){return e.$$typeof===o}(e)}(e)},o="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function n(e,t){return!1!==t.clone&&t.isMergeableObject(e)?s((o=e,Array.isArray(o)?[]:{}),e,t):e;var o}function r(e,t,o){return e.concat(t).map(function(e){return n(e,o)})}function i(e){return Object.keys(e).concat(function(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(t){return Object.propertyIsEnumerable.call(e,t)}):[]}(e))}function a(e,t){try{return t in e}catch(e){return!1}}function s(e,o,l){(l=l||{}).arrayMerge=l.arrayMerge||r,l.isMergeableObject=l.isMergeableObject||t,l.cloneUnlessOtherwiseSpecified=n;var c=Array.isArray(o);return c===Array.isArray(e)?c?l.arrayMerge(e,o,l):function(e,t,o){var r={};return o.isMergeableObject(e)&&i(e).forEach(function(t){r[t]=n(e[t],o)}),i(t).forEach(function(i){(function(e,t){return a(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))})(e,i)||(a(e,i)&&o.isMergeableObject(t[i])?r[i]=function(e,t){if(!t.customMerge)return s;var o=t.customMerge(e);return"function"==typeof o?o:s}(i,o)(e[i],t[i],o):r[i]=n(t[i],o))}),r}(e,o,l):n(o,l)}s.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce(function(e,o){return s(e,o,t)},{})};var l=s;e.exports=l},94931:(e,t,o)=>{var n=o(51609),r=Symbol.for("react.element"),i=Symbol.for("react.fragment"),a=Object.prototype.hasOwnProperty,s=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};function c(e,t,o){var n,i={},c=null,d=null;for(n in void 0!==o&&(c=""+o),void 0!==t.key&&(c=""+t.key),void 0!==t.ref&&(d=t.ref),t)a.call(t,n)&&!l.hasOwnProperty(n)&&(i[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps)void 0===i[n]&&(i[n]=t[n]);return{$$typeof:r,type:e,key:c,ref:d,props:i,_owner:s.current}}t.Fragment=i,t.jsx=c,t.jsxs=c},39793:(e,t,o)=>{e.exports=o(94931)},63133:(e,t,o)=>{var n=o(51609),r="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},i=n.useState,a=n.useEffect,s=n.useLayoutEffect,l=n.useDebugValue;function c(e){var t=e.getSnapshot;e=e.value;try{var o=t();return!r(e,o)}catch(e){return!0}}var d="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var o=t(),n=i({inst:{value:o,getSnapshot:t}}),r=n[0].inst,d=n[1];return s(function(){r.value=o,r.getSnapshot=t,c(r)&&d({inst:r})},[e,o,t]),a(function(){return c(r)&&d({inst:r}),e(function(){c(r)&&d({inst:r})})},[e]),l(o),o};t.useSyncExternalStore=void 0!==n.useSyncExternalStore?n.useSyncExternalStore:d},89104:(e,t,o)=>{e.exports=o(63133)},51609:e=>{e.exports=window.React},66087:e=>{e.exports=window.lodash},1455:e=>{e.exports=window.wp.apiFetch},94715:e=>{e.exports=window.wp.blockEditor},74997:e=>{e.exports=window.wp.blocks},56427:e=>{e.exports=window.wp.components},29491:e=>{e.exports=window.wp.compose},3582:e=>{e.exports=window.wp.coreData},47143:e=>{e.exports=window.wp.data},43656:e=>{e.exports=window.wp.editor},86087:e=>{e.exports=window.wp.element},52619:e=>{e.exports=window.wp.hooks},18537:e=>{e.exports=window.wp.htmlEntities},27723:e=>{e.exports=window.wp.i18n},48558:e=>{e.exports=window.wp.keycodes},692:e=>{e.exports=window.wp.notices},92279:e=>{e.exports=window.wp.plugins},41233:e=>{e.exports=window.wp.preferences},5573:e=>{e.exports=window.wp.primitives},50876:e=>{e.exports=window.wp.richText},49786:e=>{e.exports=window.wp.styleEngine},61197:(e,t,o)=>{o.d(t,{B4:()=>a,EA:()=>l,NJ:()=>m,Px:()=>_,bB:()=>s,fx:()=>p,hX:()=>u,q1:()=>d,yQ:()=>h,y_:()=>f});var n=o(49786),r=o(90103),i=o(15795),a="body",s=":root",l=[{path:["color","palette"],valueKey:"color",cssVarInfix:"color",classes:[{classSuffix:"color",propertyName:"color"},{classSuffix:"background-color",propertyName:"background-color"},{classSuffix:"border-color",propertyName:"border-color"}]},{path:["color","gradients"],valueKey:"gradient",cssVarInfix:"gradient",classes:[{classSuffix:"gradient-background",propertyName:"background"}]},{path:["color","duotone"],valueKey:"colors",cssVarInfix:"duotone",valueFunc:({slug:e})=>`url( '#wp-duotone-${e}' )`,classes:[]},{path:["shadow","presets"],valueKey:"shadow",cssVarInfix:"shadow",classes:[]},{path:["typography","fontSizes"],valueFunc:(e,t)=>(0,r.j)(e,t),valueKey:"size",cssVarInfix:"font-size",classes:[{classSuffix:"font-size",propertyName:"font-size"}]},{path:["typography","fontFamilies"],valueKey:"fontFamily",cssVarInfix:"font-family",classes:[{classSuffix:"font-family",propertyName:"font-family"}]},{path:["spacing","spacingSizes"],valueKey:"size",cssVarInfix:"spacing",valueFunc:({size:e})=>e,classes:[]},{path:["border","radiusSizes"],valueKey:"size",cssVarInfix:"border-radius",classes:[]},{path:["dimensions","dimensionSizes"],valueKey:"size",cssVarInfix:"dimension",classes:[]}],c={"color.background":"color","color.text":"color","filter.duotone":"duotone","elements.link.color.text":"color","elements.link.:hover.color.text":"color","elements.link.typography.fontFamily":"font-family","elements.link.typography.fontSize":"font-size","elements.button.color.text":"color","elements.button.color.background":"color","elements.caption.color.text":"color","elements.button.typography.fontFamily":"font-family","elements.button.typography.fontSize":"font-size","elements.heading.color":"color","elements.heading.color.background":"color","elements.heading.typography.fontFamily":"font-family","elements.heading.gradient":"gradient","elements.heading.color.gradient":"gradient","elements.h1.color":"color","elements.h1.color.background":"color","elements.h1.typography.fontFamily":"font-family","elements.h1.color.gradient":"gradient","elements.h2.color":"color","elements.h2.color.background":"color","elements.h2.typography.fontFamily":"font-family","elements.h2.color.gradient":"gradient","elements.h3.color":"color","elements.h3.color.background":"color","elements.h3.typography.fontFamily":"font-family","elements.h3.color.gradient":"gradient","elements.h4.color":"color","elements.h4.color.background":"color","elements.h4.typography.fontFamily":"font-family","elements.h4.color.gradient":"gradient","elements.h5.color":"color","elements.h5.color.background":"color","elements.h5.typography.fontFamily":"font-family","elements.h5.color.gradient":"gradient","elements.h6.color":"color","elements.h6.color.background":"color","elements.h6.typography.fontFamily":"font-family","elements.h6.color.gradient":"gradient","color.gradient":"gradient",shadow:"shadow","typography.fontSize":"font-size","typography.fontFamily":"font-family"};function d(e,t){if(!e||!t)return t;const o=e.split(","),n=t.split(","),r=[];return o.forEach(e=>{n.forEach(t=>{r.push(`${e.trim()} ${t.trim()}`)})}),r.join(", ")}function u(e,t){if(!e||!t)return;const o={};return Object.entries(t).forEach(([t,n])=>{"string"==typeof n&&(o[t]=d(e,n)),"object"==typeof n&&(o[t]={},Object.entries(n).forEach(([n,r])=>{o[t][n]=d(e,r)}))}),o}function p(e,t){return e.includes(",")?e.split(",").map(e=>e+t).join(","):e+t}function m(e,t){const o=`.is-style-${e}`;if(!t)return o;const n=/((?::\([^)]+\))?\s*)([^\s:]+)/,r=(e,t,n)=>t+n+o;return t.split(",").map(e=>e.replace(n,r)).join(",")}function f(e,t){if(!e||!t)return e;const o=function(e,t){if(!e||!t)return e;if("object"==typeof e&&"ref"in e&&e?.ref){const o=(0,n.getCSSValueFromRawStyle)((0,i.K)(t,e.ref));if("object"==typeof o&&null!==o&&"ref"in o&&o?.ref)return;return void 0===o?e:o}return e}(e,t);return"object"==typeof o&&null!==o&&"url"in o&&o?.url&&(o.url=function(e,t){if(!e||!t||!Array.isArray(t))return e;const o=t.find(t=>t?.name===e);return o?.href?o?.href:e}(o.url,t?._links?.["wp:theme-file"])),o}function g(e,t,o=[],n="slug",r){const a=[t?(0,i.K)(e,["blocks",t,...o]):void 0,(0,i.K)(e,o)].filter(Boolean);for(const i of a)if(i){const a=["custom","theme","default"];for(const s of a){const a=i[s];if(a){const i=a.find(e=>e[n]===r);if(i)return"slug"===n||g(e,t,o,"slug",i.slug)[n]===i[n]?i:void 0}}}}function h(e,t,o){if(!o||"string"!=typeof o){if("object"!=typeof o||null===o||!("ref"in o)||"string"!=typeof o.ref)return o;{const t=(0,i.K)(e,o.ref);if(!t||"object"==typeof t&&"ref"in t)return t;o=t}}let n;if(o.startsWith("var:"))n=o.slice(4).split("|");else{if(!o.startsWith("var(--wp--")||!o.endsWith(")"))return o;n=o.slice(10,-1).split("--")}const[r,...a]=n;return"preset"===r?function(e,t,o,[n,r]=[]){const i=l.find(e=>e.cssVarInfix===n);if(!i||!e.settings)return o;const a=g(e.settings,t,i.path,"slug",r);if(a){const{valueKey:o}=i;return h(e,t,a[o])}return o}(e,t,o,a):"custom"===r?function(e,t,o,n=[]){const r=(t?(0,i.K)(e?.settings??{},["blocks",t,"custom",...n]):void 0)??(0,i.K)(e?.settings??{},["custom",...n]);return r?h(e,t,r):o}(e,t,o,a):o}function _(e,t,o,n){if(!n)return n;const r=c[o],i=l.find(e=>e.cssVarInfix===r);if(!i)return n;const{valueKey:a,path:s}=i,d=g(e,t,s,a,n);return d?`var:preset|${r}|${d.slug}`:n}},15795:(e,t,o)=>{function n(e,t,o){t=Array.isArray(t)?[...t]:[t],e=Array.isArray(e)?[...e]:{...e};const n=t.pop();let r=e;for(const e of t){const t=r[e];r=r[e]=Array.isArray(t)?[...t]:{...t}}return r[n]=o,e}o.d(t,{K:()=>r,n:()=>n});var r=(e,t,o)=>{const n=Array.isArray(t)?t:t.split(".");let r=e;return n.forEach(e=>{r=r?.[e]}),r??o}},90103:(e,t,o)=>{o.d(t,{j:()=>p});var n="1600px",r="320px",i=1,a=.25,s=.75,l="14px";function c(e,t={}){if("string"!=typeof e&&"number"!=typeof e)return null;isFinite(e)&&(e=`${e}px`);const{coerceTo:o,rootSizeValue:n,acceptableUnits:r}={coerceTo:"",rootSizeValue:16,acceptableUnits:["rem","px","em"],...t},i=r?.join("|"),a=new RegExp(`^(\\d*\\.?\\d+)(${i}){1,1}$`),s=e.toString().match(a);if(!s||s.length<3)return null;let[,l,c]=s,u=parseFloat(l);return"px"!==o||"em"!==c&&"rem"!==c||(u*=n,c=o),"px"!==c||"em"!==o&&"rem"!==o||(u/=n,c=o),"em"!==o&&"rem"!==o||"em"!==c&&"rem"!==c||(c=o),c?{value:d(u,3),unit:c}:null}function d(e,t=3){const o=Math.pow(10,t);return Math.round(e*o)/o}function u(e){const t=e?.fluid;return!0===t||t&&"object"==typeof t&&Object.keys(t).length>0}function p(e,t){const{size:o}=e;if(!o||"0"===o||!1===e?.fluid)return o;if(!u(t?.typography)&&!u(e))return o;const p=function(e){const t=e?.typography??{},o=e?.layout,n=c(o?.wideSize)?o?.wideSize:null;return u(t)&&n?{fluid:{maxViewportWidth:n,..."object"==typeof t.fluid?t.fluid:{}}}:{fluid:t?.fluid}}(t)?.fluid??{};return function({minimumFontSize:e,maximumFontSize:t,fontSize:o,minimumViewportWidth:u=r,maximumViewportWidth:p=n,scaleFactor:m=i,minimumFontSizeLimit:f}){if(f=c(f)?f:l,o){const n=c(o);if(!n?.unit||!n?.value)return null;const r=c(f,{coerceTo:n.unit});if(r?.value&&!e&&!t&&n?.value<=r?.value)return null;if(t||(t=`${n.value}${n.unit}`),!e){const t="px"===n.unit?n.value:16*n.value,o=Math.min(Math.max(1-.075*Math.log2(t),a),s),i=d(n.value*o,3);e=r?.value&&i<r?.value?`${r.value}${r.unit}`:`${i}${n.unit}`}}const g=c(e),h=g?.unit||"rem",_=c(t,{coerceTo:h});if(!g||!_)return null;const y=c(e,{coerceTo:"rem"}),b=c(p,{coerceTo:h}),w=c(u,{coerceTo:h});if(!b||!w||!y)return null;const v=b.value-w.value;if(!v)return null;const x=d(w.value/100,3),k=d(x,3)+h,S=d(((_.value-g.value)/v*100||1)*m,3);return`clamp(${e}, ${y.value}${y.unit} + ((1vw - ${k}) * ${S}), ${t})`}({minimumFontSize:"boolean"==typeof e?.fluid?void 0:e?.fluid?.min,maximumFontSize:"boolean"==typeof e?.fluid?void 0:e?.fluid?.max,fontSize:o,minimumFontSizeLimit:"object"==typeof p?p?.minFontSize:void 0,maximumViewportWidth:"object"==typeof p?p?.maxViewportWidth:void 0,minimumViewportWidth:"object"==typeof p?p?.minViewportWidth:void 0})||o}},4921:(e,t,o)=>{function n(e){var t,o,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(o=n(e[t]))&&(r&&(r+=" "),r+=o)}else for(o in e)e[o]&&(r&&(r+=" "),r+=o);return r}o.d(t,{A:()=>r});const r=function(){for(var e,t,o=0,r="",i=arguments.length;o<i;o++)(e=arguments[o])&&(t=n(e))&&(r&&(r+=" "),r+=t);return r}}},n={};function r(e){var t=n[e];if(void 0!==t)return t.exports;var i=n[e]={exports:{}};return o[e](i,i.exports,r),i.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,r.t=function(o,n){if(1&n&&(o=this(o)),8&n)return o;if("object"==typeof o&&o){if(4&n&&o.__esModule)return o;if(16&n&&"function"==typeof o.then)return o}var i=Object.create(null);r.r(i);var a={};e=e||[null,t({}),t([]),t(t)];for(var s=2&n&&o;"object"==typeof s&&!~e.indexOf(s);s=t(s))Object.getOwnPropertyNames(s).forEach(e=>a[e]=()=>o[e]);return a.default=()=>o,r.d(i,a),i},r.d=(e,t)=>{for(var o in t)r.o(t,o)&&!r.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};(()=>{r.r(i),r.d(i,{EditTemplateModal:()=>Ao.i,EmailActionsFill:()=>mt.L,ExperimentalEmailEditor:()=>No,RichTextWithButton:()=>Io.O,SelectTemplateModal:()=>fe.i,SendPreviewEmail:()=>lt.P,TemplateSelection:()=>Ro.x,createStore:()=>Ut.y$,debouncedRecordEvent:()=>E.T7,initializeEditor:()=>Bo,isEventTrackingEnabled:()=>E.V1,recordEvent:()=>E.yM,recordEventOnce:()=>E.xW,registerEntityAction:()=>de.Bi,storeName:()=>k.H,unregisterEntityAction:()=>de.yd,useEmailCss:()=>ue.b,useIsEmailEditor:()=>zo.L,usePreviewTemplates:()=>Po.p});var e=r(47143),t=r(86087),o=r(52619),n=r(43656),a=r(29491);window.wp.formatLibrary;var s=r(74997);function l(){try{return(0,s.getBlockTypes)().filter(e=>!0===e.supports?.email).map(e=>e.name)}catch(e){return console.error("Failed to get allowed block names:",e),[]}}const c=window.wp.blockLibrary;var d=r(94715),u=r(20799),p=r(85166),m=r(39793);const f=(0,a.createHigherOrderComponent)(e=>function(t){return"core/columns"!==t.name?(0,m.jsx)(e,{...t}):(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(e,{...t}),(0,m.jsx)(d.InspectorControls,{children:(0,m.jsx)("style",{children:"\n .components-panel__body .components-toggle-control .components-form-toggle { opacity: 0.3; }\n .components-panel__body .components-toggle-control .components-form-toggle__input { pointer-events: none; }\n .components-panel__body .components-toggle-control label { pointer-events: none; }\n "})})]})},"columnsEditCallback"),g=["core/column","core/columns"];var h=r(27723);function _({layoutClassNames:e}){const t=(0,d.useBlockProps)({className:e});return(0,m.jsxs)("div",{...t,children:[(0,m.jsx)("p",{children:(0,h.__)("This is the Content block.","woocommerce")}),(0,m.jsx)("p",{children:(0,h.__)("It will display all the blocks in the email content, which might be only simple text paragraphs. You can enrich your message with images, incorporate data through tables, explore different layout designs with columns, or use any other block type.","woocommerce")})]})}const y=(0,a.createHigherOrderComponent)(e=>function(t){return"core/image"!==t.name?(0,m.jsx)(e,{...t}):(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(e,{...t}),(0,m.jsx)(d.InspectorControls,{children:(0,m.jsx)("style",{children:"\n .components-tools-panel .components-toggle-control { display: none; }\n "})})]})},"imageEditCallback");var b=r(50876),w=r(56427),v=r(93314),x=r(69312),k=r(34923),S=r(96972);const j=({contentRef:o,onUpdate:n})=>{const[r,i]=(0,t.useState)(!1),[a,s]=(0,t.useState)(null),[l,c]=(0,t.useState)(""),[d,u]=(0,t.useState)(""),p=(0,e.useSelect)(e=>e(k.H).getPersonalizationTagsList(),[]);return(0,t.useEffect)(()=>{if(!o||!o.current)return;const e=o.current,t=e=>{const t=e.target.closest("a[data-link-href]");t&&(s(t),u(t.getAttribute("data-link-href")||""),c(t.textContent||""),i(!0))};return e.addEventListener("click",t),()=>{e.removeEventListener("click",t)}},[o]),(0,m.jsx)(m.Fragment,{children:r&&a&&(0,m.jsx)(w.Popover,{position:"bottom left",onClose:()=>i(!1),anchor:a,className:"woocommerce-personalization-tag-popover",children:(0,m.jsxs)("div",{className:"woocommerce-personalization-tag-popover-content",children:[(0,m.jsx)(w.TextControl,{label:(0,h.__)("Link Text","woocommerce"),value:l,onChange:e=>c(e),__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,autoComplete:"off"}),(0,m.jsx)(w.SelectControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:(0,h.__)("Link tag","woocommerce"),value:d,onChange:e=>{u(e)},options:p.filter(e=>e.category===(0,h.__)("Link","woocommerce")).map(e=>({label:e.name,value:e.token}))}),(0,m.jsxs)("div",{className:"woocommerce-personalization-tag-popover-content-buttons",children:[(0,m.jsx)(w.Button,{isTertiary:!0,onClick:()=>{i(!1)},children:(0,h.__)("Cancel","woocommerce")}),(0,m.jsx)(w.Button,{isPrimary:!0,onClick:()=>{i(!1),n(a,d,l)},children:(0,h.__)("Update link","woocommerce")})]})]})})})};var E=r(36135),T=r(79637);function C({contentRef:o}){const[n,r]=(0,t.useState)(!1),i=(0,e.useSelect)(e=>e("core/block-editor").getSelectedBlockClientId()),{updateBlockAttributes:a}=(0,e.useDispatch)("core/block-editor"),s=(0,e.useSelect)(e=>e("core/block-editor").getBlockAttributes(i)),l="text"in s?"text":"content",c=s?.[l]?.originalHTML||s?.[l]||"",u=(0,t.useCallback)((e,t)=>{let{start:n,end:r}=(0,v.E)(o,c),s="";if(t){let o=(0,b.create)({html:c});o=(0,b.insert)(o,t,n,r),r=n+t.length,o=(0,b.applyFormat)(o,{type:"woocommerce-email-editor/link-shortcode",attributes:{"data-link-href":e,contenteditable:"false",style:"text-decoration: underline;"}},n,r),s=(0,b.toHTMLString)({value:o})}else{let t=(0,b.create)({html:c});t=(0,b.insert)(t,(0,b.create)({html:`\x3c!--${e}--\x3e `}),n,r),s=(0,b.toHTMLString)({value:t})}a(i,{[l]:s})},[c,l,o,i,a]);return(0,m.jsx)(d.BlockControls,{children:(0,m.jsxs)(w.ToolbarGroup,{children:[(0,m.jsx)(w.ToolbarButton,{icon:"shortcode",title:(0,h.__)("Personalization Tags","woocommerce"),onClick:()=>{r(!0),(0,E.yM)("block_controls_personalization_tags_button_clicked")}}),(0,m.jsx)(S.t,{contentRef:o,onUpdate:(e,t)=>{const o=c.replace(`\x3c!--[${e}]--\x3e`,`\x3c!--[${t}]--\x3e`);a(i,{[l]:o})}}),(0,m.jsx)(j,{contentRef:o,onUpdate:(e,t,o)=>{const n=e.getAttribute("data-link-href").replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),r=new RegExp(`<a([^>]*?)data-link-href="${n}"([^>]*?)>${e.textContent}</a>`,"gi"),s=c.replace(r,(e,n,r)=>`<a${n}data-link-href="${t}"${r}>${o}</a>`);a(i,{content:s})}}),(0,m.jsx)(x.x,{isOpened:n,onInsert:(e,t)=>{u(e,t),r(!1)},closeCallback:()=>r(!1),canInsertLink:!0,openedBy:"block-controls"})]})})}const M=(0,a.createHigherOrderComponent)(o=>n=>{const{attributes:r,setAttributes:i,name:a}=n,{content:s}=r,l=(0,e.useSelect)(e=>e(k.H).getPersonalizationTagsList(),[]),c=(0,t.useCallback)(()=>s?(0,v.D)(s,l):"",[s,l]),d=(0,t.useCallback)(e=>{if(void 0!==e.content){const t=(0,v.D)(e.content,l);i({...e,content:t})}else i(e)},[l,i]);return"core/paragraph"===a||"core/heading"===a||"core/list-item"===a?(0,m.jsx)(o,{...n,attributes:{...r,content:c()},setAttributes:d}):(0,m.jsx)(o,{...n})},"personalizationTagsLiveContentUpdate"),N={youtube:["youtube.com","youtu.be"],videopress:["videopress.com","video.wordpress.com"],vimeo:["vimeo.com","player.vimeo.com"],tiktok:["tiktok.com"],dailymotion:["dailymotion.com","dai.ly"]},z=(0,a.createHigherOrderComponent)(o=>function(n){const r="core/embed"===n.name,{responsive:i}=n.attributes,{setAttributes:a}=n,s=(0,e.useDispatch)("core/block-editor");if((0,t.useEffect)(()=>{r&&i&&(s.__unstableMarkNextChangeAsNotPersistent(),a({responsive:!1}))},[r,i,a,s]),!r)return(0,m.jsx)(o,{...n});const{url:l,type:c}=n.attributes;return!l||"wp-embed"===c||function(e){let t="";try{t=new URL(e).hostname}catch{return!1}return Object.values(N).some(e=>e.some(e=>t===e||t.endsWith(`.${e}`)))}(l)?(0,m.jsx)(o,{...n}):(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(w.Notice,{status:"warning",isDismissible:!1,children:(0,h.__)("This embed is not supported in emails. It will be sent as a link.","woocommerce")}),(0,m.jsx)(o,{...n})]})},"withEmailEmbedAdjustments"),P=[...Object.keys(N),"wordpress"];const I=window.wp.domReady;var R=r.n(I),A=r(35748);const B=["core/social-links"];function L(){(0,s.getBlockTypes)().forEach(t=>{const o=t.name;if(B.includes(o))return;const n=(0,e.select)("core/blocks").getBlockStyles(o);Array.isArray(n)&&0!==n?.length&&n.forEach(e=>{(0,A.oj)(o,e.name)})})}const H=e=>o=>{const{setAttributes:n}=o,r=(0,t.useCallback)(e=>{e?.url&&e.url?.startsWith("http://[")&&(e.url=e.url.replace("http://[","[")),n(e)},[n]);return(0,m.jsx)(e,{...o,setAttributes:r})};var F=r(53587);const $=["behance","bluesky","chain","discord","facebook","feed","github","gravatar","instagram","linkedin","mail","mastodon","medium","patreon","pinterest","reddit","spotify","telegram","threads","tiktok","tumblr","twitch","twitter","vimeo","wordpress","whatsapp","x","youtube"],O=e=>t=>{if("core/social-links"!==t.name)return(0,m.jsx)(e,{...t});const o=`\n\t\t.block-editor-tools-panel-color-gradient-settings__item:has([title="${(0,h.__)("Icon color")}"]) {\n\t\t\tdisplay: none !important;\n\t\t}\n\t\t.block-editor-tools-panel-color-gradient-settings__item:nth-child(2 of .block-editor-tools-panel-color-gradient-settings__item){\n\t\t\tborder-top:1px solid #ddd;\n\t\t\tborder-top-left-radius:2px;\n\t\t\tborder-top-right-radius:2px;\n\t\t}\n\t\t`;return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(e,{...t}),(0,m.jsx)(d.InspectorControls,{group:"color",children:(0,m.jsx)("style",{children:o})})]})};var D=r(4921),V=r(46569);const W=["core/column","core/columns"],G=["core/post-content","woocommerce/email-content"];function U(e){const t=e=>null==e||function(e){return null!=e&&0===parseFloat(String(e))}(e)?null:(0,V.DJ)(String(e));if(!e)return{left:null,right:null};if("string"==typeof e){const o=t(e);return{left:o,right:o}}return{left:t(e.left),right:t(e.right)}}function q({block:t,props:o}){const n="full"===o.attributes?.align,r=(i=o.clientId,a=n,(0,e.useSelect)(e=>{if(!a)return{left:null,right:null};const{getBlockParents:t,getBlockName:o,getBlockAttributes:n}=e(d.store),r=t(i);let s=!1;for(let e=r.length-1;e>=0;e--){const t=r[e],i=o(t);if(W.includes(i))return!1;if(G.includes(i)){s=!0;continue}const a=U(n(t)?.style?.spacing?.padding);if(a.left||a.right)return a;if(!s)return{left:null,right:null}}return{left:null,right:null}},[i,a]));var i,a;if(!n||!1===r)return(0,m.jsx)(t,{...o});const s={...o.wrapperProps?.style||{}};return r.left&&(s.marginLeft=`calc(-1 * ${r.left})`),r.right&&(s.marginRight=`calc(-1 * ${r.right})`),(0,m.jsx)(t,{...o,className:(0,D.A)(o.className,"is-email-full-width"),wrapperProps:{...o.wrapperProps,style:s}})}const K=(0,a.createHigherOrderComponent)(e=>function(t){return(0,m.jsx)(q,{block:e,props:t})},"withFullWidthClassName");function Z(){(0,s.getBlockType)("core/paragraph")||(0,c.registerCoreBlocks)(),(0,p.HY)("editor.BlockEdit","woocommerce-email-editor/filter-set-url-attribute",H),(0,p.HY)("editor.BlockEdit","woocommerce-email-editor/deactivate-stack-on-mobile",f),(0,p.HY)("editor.BlockEdit","woocommerce-email-editor/hide-expand-on-click",y),(0,u.G)("core/image",e=>({...e,supports:{...e.supports||{},filter:{...e.supports?.filter||{},duetone:!1}}})),["core/image","core/code","core/language"].forEach(e=>{(0,T.le)(e)}),g.forEach(e=>{(0,u.G)(e,e=>({...e,supports:{...e.supports||{},layout:!1,background:{...e.support?.background||{},backgroundImage:!0}}}))}),(0,u.G)("core/group",e=>{const t=e.variations??[];return{...e,variations:t.filter(e=>"group"===e.name),supports:{...e.supports||{},layout:!1}}}),(0,u.G)("core/buttons",e=>({...e,supports:{...e.supports??{},layout:!1,__experimentalEmailFlexLayout:!0}})),(0,u.G)("core/embed",e=>({...e,variations:(e.variations||[]).filter(e=>P.includes(e.name)).map(e=>{const{responsive:t,...o}=e.attributes||{};return{...e,attributes:o}})})),(0,p.HY)("editor.BlockEdit","woocommerce-email-editor/embed-adjustments",z),(0,u.G)("core/post-content",e=>{return{...e,edit:(t=e.edit,function(e){const{postId:o,postType:n}=e.context,{__unstableLayoutClassNames:r}=e;return o&&n?(0,m.jsx)(t,{...e}):(0,m.jsx)(_,{layoutClassNames:r})})};var t}),(0,u.G)("core/quote",e=>({...e,styles:[],supports:{...e.supports,align:[]}})),(0,T.gG)("woocommerce-email-editor/shortcode",{name:"woocommerce-email-editor/shortcode",title:(0,h.__)("Personalization Tags","woocommerce"),className:"woocommerce-email-editor-personalization-tags",tagName:"span",attributes:{},interactive:!1,edit:C}),(0,T.gG)("woocommerce-email-editor/link-shortcode",{name:"woocommerce-email-editor/link-shortcode",title:(0,h.__)("Personalization Tags Link","woocommerce"),className:"woocommerce-email-editor-personalization-tags-link",tagName:"a",attributes:{"data-link-href":"data-link-href",contenteditable:"contenteditable",style:"style"},interactive:!0,edit:null}),(0,p.HY)("editor.BlockEdit","woocommerce-email-editor/with-live-content-update",M),(0,s.getBlockTypes)().forEach(e=>{e.supports?.shadow&&(0,u.G)(e.name,e=>({...e,supports:{...e.supports,shadow:!1}}))}),(0,u.G)("core/social-link",e=>({...e,variations:(e.variations||[]).filter(e=>$.includes(e.name)),supports:{...e.supports,layout:!1}})),(0,F.z)("core/social-links",{name:"social-links-default",title:"Social Icons",attributes:{openInNewTab:!0,showLabels:!1,align:"center",className:"is-style-logos-only"},isDefault:!0,innerBlocks:[{name:"core/social-link",attributes:{service:"wordpress",url:"https://wordpress.org"}},{name:"core/social-link",attributes:{service:"facebook",url:"https://www.facebook.com/WordPress/"}},{name:"core/social-link",attributes:{service:"x",url:"https://x.com/WordPress"}}]}),(0,p.HY)("editor.BlockEdit","woocommerce-email-editor/disable-social-links-icon-color",O),(0,F.z)("core/site-logo",{name:"site-logo-default",title:"Site Logo",attributes:{align:"center",width:120},isDefault:!0}),(0,p.HY)("editor.BlockListBlock","woocommerce-email-editor/full-width-blocks",K),(0,u.G)("woocommerce/product-image",e=>({...e,supports:{...e.supports||{},align:["full"]}})),R()(L)}var Y=r(5573),J=(0,m.jsx)(Y.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,m.jsx)(Y.Path,{d:"M9 9v6h11V9H9zM4 20h1.5V4H4v16z"})}),X=(0,m.jsx)(Y.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,m.jsx)(Y.Path,{d:"M12.5 15v5H11v-5H4V9h7V4h1.5v5h7v6h-7Z"})}),Q=(0,m.jsx)(Y.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,m.jsx)(Y.Path,{d:"M4 15h11V9H4v6zM18.5 4v16H20V4h-1.5z"})});const ee="__experimentalEmailFlexLayout";function te(e){return(0,s.hasBlockSupport)(e,ee)}function oe({justificationValue:e,onChange:t,isToolbar:o=!1}){const n=[{value:"left",icon:J,label:(0,h.__)("Justify items left","woocommerce")},{value:"center",icon:X,label:(0,h.__)("Justify items center","woocommerce")},{value:"right",icon:Q,label:(0,h.__)("Justify items right","woocommerce")}];if(o){const o=n.map(e=>e.value);return(0,m.jsx)(d.JustifyContentControl,{value:e,onChange:t,allowedControls:o,popoverProps:{placement:"bottom-start"}})}return(0,m.jsx)(w.__experimentalToggleGroupControl,{__nextHasNoMarginBottom:!0,label:(0,h.__)("Justification","woocommerce"),value:e,onChange:t,className:"block-editor-hooks__flex-layout-justification-controls",children:n.map(({value:e,icon:t,label:o})=>(0,m.jsx)(w.__experimentalToggleGroupControlOptionIcon,{value:e,icon:t,label:o},e))})}function ne({setAttributes:e,attributes:t,name:o}){if(!(0,s.getBlockSupport)(o,ee,{}))return null;const{justifyContent:n="left"}=t.layout||{},r=o=>{e({layout:{...t.layout,justifyContent:o}})},i=()=>{const{justifyContent:o,...n}=t.layout||{};e({layout:n})};return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(d.InspectorControls,{children:(0,m.jsx)(w.__experimentalToolsPanel,{label:(0,h.__)("Layout","woocommerce"),resetAll:i,children:(0,m.jsx)(w.__experimentalToolsPanelItem,{isShownByDefault:!0,onDeselect:i,hasValue:()=>t.layout?.justifyContent||!1,label:(0,h.__)("Justification","woocommerce"),children:(0,m.jsx)(w.Flex,{children:(0,m.jsx)(w.FlexItem,{children:(0,m.jsx)(oe,{justificationValue:n,onChange:r})})})})})}),(0,m.jsx)(d.BlockControls,{group:"block",__experimentalShareWithChildBlocks:!0,children:(0,m.jsx)(oe,{justificationValue:n,onChange:r,isToolbar:!0})})]})}const re=(0,a.createHigherOrderComponent)(e=>t=>[te(t.name)&&(0,m.jsx)(ne,{...t},"layout"),(0,m.jsx)(e,{...t},"edit")],"withLayoutControls");function ie({block:e,props:t}){const{attributes:o}=t,{layout:n}=o,r=`is-content-justification-${n?.justifyContent||"left"}`,i=(0,D.A)(r,"is-layout-email-flex is-layout-flex");return(0,m.jsx)(e,{...t,className:i})}const ae=(0,a.createHigherOrderComponent)(e=>function(t){return te(t.name)?(0,m.jsx)(ie,{block:e,props:t}):(0,m.jsx)(e,{...t})},"withLayoutStyles");var se=r(3582);const le=window.wp.commands;var ce=r(92279),de=r(14302),ue=r(26314),pe=r(692);const me=()=>{const o='.editor-preview-dropdown__button-external, a[role="menuitem"][target^="wp-preview-"]',r=async t=>{const r=t.target,i=r?.closest(o);if(!i)return;const a=(0,e.select)(n.store),s=a?.isEditedPostDirty();s&&(t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation(),(0,e.dispatch)(pe.store).createNotice("warning",(0,h.__)("You have unsaved changes. Please save the post before previewing.","woocommerce"),{context:"email-editor",isDismissible:!0}))},i=(0,t.useCallback)(e=>{try{const t=e.target;"Enter"!==e.key&&" "!==e.key||!t?.closest(o)||r(e)}catch(e){console.warn("Preview save message guard error:",e)}},[o]);return(0,t.useEffect)(()=>(document.addEventListener("click",r,!0),document.addEventListener("auxclick",r,!0),document.addEventListener("keydown",i,!0),()=>{document.removeEventListener("click",r,!0),document.removeEventListener("auxclick",r,!0),document.removeEventListener("keydown",i,!0)}),[i]),null};var fe=r(99800);function ge(){const{emailContentIsEmpty:t,templateSelected:o,postType:n}=(0,e.useSelect)(e=>({emailContentIsEmpty:e(k.H).hasEmptyContent(),templateSelected:e(k.H).isTemplateSelected(),postType:e(k.H).getEmailPostType()}),[]),{setTemplateSelected:r}=(0,e.useDispatch)(k.H);return!t||o?null:(0,m.jsx)(fe.i,{onSelectCallback:()=>{r()},postType:n})}var he=(0,m.jsx)(Y.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,m.jsx)(Y.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M20 12a8 8 0 1 1-16 0 8 8 0 0 1 16 0Zm-1.5 0a6.5 6.5 0 0 1-6.5 6.5v-13a6.5 6.5 0 0 1 6.5 6.5Z"})}),_e=(0,m.jsx)(Y.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,m.jsx)(Y.Path,{d:"m8.6 7 3.9 10.8h-1.7l-1-2.8H5.7l-1 2.8H3L6.9 7h1.7Zm-2.4 6.6h3L7.7 9.3l-1.5 4.3ZM17.691 8.879c.473 0 .88.055 1.221.165.352.1.643.264.875.495.274.253.456.572.544.957.088.374.132.83.132 1.37v4.554c0 .274.033.472.099.593.077.11.198.166.363.166.11 0 .215-.028.313-.083.11-.055.237-.137.38-.247l.165.28a3.304 3.304 0 0 1-.71.446c-.23.11-.527.165-.89.165-.352 0-.639-.055-.858-.165-.22-.11-.386-.27-.495-.479-.1-.209-.149-.468-.149-.775-.286.462-.627.814-1.023 1.056-.396.242-.858.363-1.386.363-.462 0-.858-.088-1.188-.264a1.752 1.752 0 0 1-.742-.726 2.201 2.201 0 0 1-.248-1.056c0-.484.11-.875.33-1.172.22-.308.5-.556.841-.742.352-.187.721-.341 1.106-.462.396-.132.765-.253 1.106-.363.351-.121.637-.259.857-.413.232-.154.347-.357.347-.61V10.81c0-.396-.066-.71-.198-.941a1.05 1.05 0 0 0-.511-.511 1.763 1.763 0 0 0-.76-.149c-.253 0-.522.039-.808.116a1.165 1.165 0 0 0-.677.412 1.1 1.1 0 0 1 .595.396c.165.187.247.424.247.71 0 .307-.104.55-.313.726-.198.176-.451.263-.76.263-.34 0-.594-.104-.758-.313a1.231 1.231 0 0 1-.248-.759c0-.297.072-.539.214-.726.154-.187.352-.363.595-.528.264-.176.6-.324 1.006-.445.418-.121.88-.182 1.386-.182Zm.99 3.729a1.57 1.57 0 0 1-.528.462c-.231.121-.479.248-.742.38a5.377 5.377 0 0 0-.76.462c-.23.165-.423.38-.577.643-.154.264-.231.6-.231 1.007 0 .429.11.77.33 1.023.22.242.517.363.891.363.308 0 .594-.088.858-.264.275-.176.528-.44.759-.792v-3.284Z"})}),ye=(0,m.jsx)(Y.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,m.jsx)(Y.Path,{d:"M17.2 10.9c-.5-1-1.2-2.1-2.1-3.2-.6-.9-1.3-1.7-2.1-2.6L12 4l-1 1.1c-.6.9-1.3 1.7-2 2.6-.8 1.2-1.5 2.3-2 3.2-.6 1.2-1 2.2-1 3 0 3.4 2.7 6.1 6.1 6.1s6.1-2.7 6.1-6.1c0-.8-.3-1.8-1-3zm-5.1 7.6c-2.5 0-4.6-2.1-4.6-4.6 0-.3.1-1 .8-2.3.5-.9 1.1-1.9 2-3.1.7-.9 1.3-1.7 1.8-2.3.7.8 1.3 1.6 1.8 2.3.8 1.1 1.5 2.2 2 3.1.7 1.3.8 2 .8 2.3 0 2.5-2.1 4.6-4.6 4.6z"})}),be=(0,m.jsx)(Y.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,m.jsx)(Y.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M11.53 4.47a.75.75 0 1 0-1.06 1.06l8 8a.75.75 0 1 0 1.06-1.06l-8-8Zm5 1a.75.75 0 1 0-1.06 1.06l2 2a.75.75 0 1 0 1.06-1.06l-2-2Zm-11.06 10a.75.75 0 0 1 1.06 0l2 2a.75.75 0 1 1-1.06 1.06l-2-2a.75.75 0 0 1 0-1.06Zm.06-5a.75.75 0 0 0-1.06 1.06l8 8a.75.75 0 1 0 1.06-1.06l-8-8Zm-.06-3a.75.75 0 0 1 1.06 0l10 10a.75.75 0 1 1-1.06 1.06l-10-10a.75.75 0 0 1 0-1.06Zm3.06-2a.75.75 0 0 0-1.06 1.06l10 10a.75.75 0 1 0 1.06-1.06l-10-10Z"})}),we=(0,m.jsx)(Y.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,m.jsx)(Y.Path,{d:"M18 5.5H6a.5.5 0 00-.5.5v3h13V6a.5.5 0 00-.5-.5zm.5 5H10v8h8a.5.5 0 00.5-.5v-7.5zm-10 0h-3V18a.5.5 0 00.5.5h2.5v-8zM6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2z"})}),ve=r(76597),xe=r.n(ve),ke=r(83026);const Se={};function je(e){return!Object.keys(e).some(t=>Object.keys(e[t]).length>0)}function Ee(e,t,o){const n=Array.isArray(t)?[...t]:[t],r=Array.isArray(e)?[...e]:{...e},i=n.pop();let a=r;return n.forEach(e=>{const t=a[e];a[e]=Array.isArray(t)?[...t]:{...t},a=a[e]}),a[i]=o,r}function Te(e){const t=e=>{if("object"==typeof e&&null!==e||void 0===e){if(Array.isArray(e)&&0===e.length)return;for(const o in e)if(Object.prototype.hasOwnProperty.call(e,o)){const n=t(e[o]);void 0===n||je(n)?delete e[o]:e[o]=n}}return e};return t(e)}const Ce=()=>{const{userTheme:o,updateUserTheme:n}=(0,ke.u)(),r=(0,t.useMemo)(()=>o?Te(function(e){const t=e=>{if("object"==typeof e&&null!==e)for(const o in e)e.hasOwnProperty(o)&&(e[o]=t(e[o]));else if("string"==typeof e)return e.replace(/var\(--([a-z]+)--([a-z]+(?:--[a-z0-9]+(?:-[a-z0-9]+)*)*)--([a-z0-9-]+)\)/g,(e,t,o,n)=>`var:${o.split("--").concat(n).join("|")}`);return e};return t(e)}(o?.styles)):Se,[o]),{styles:i}=(0,e.useSelect)(e=>({styles:e(k.H).getStyles()})),a=(0,t.useCallback)(e=>{const t={...o,styles:Te(e)};n(t)},[n,o]),s=(0,t.useCallback)((e,t)=>{const r=Ee(o,["styles",...e],t);n(r)},[n,o]);return{styles:(0,t.useMemo)(()=>i?r?xe().all([i,r]):i:Se,[i,r]),userStyles:o?.styles,defaultStyles:i,updateStyleProp:s,updateStyles:a}},Me=[],Ne={start:{scale:1,opacity:1},hover:{scale:0,opacity:0}},ze={hover:{opacity:1},start:{opacity:.5}},Pe={hover:{scale:1,opacity:1},start:{scale:0,opacity:0}};function Ie({label:o,isFocused:n,withHoverView:r}){const{colors:i}=(0,e.useSelect)(e=>({colors:e(k.H).getPaletteColors()}),[]),a=(0,t.useMemo)(()=>(i?.theme||Me).concat(i?.default||Me),[i]),{styles:s}=Ce(),{backgroundColor:l,headingColor:c,highlightedColors:d}=(0,t.useMemo)(()=>{const e=(0,V.pr)(s?.color?.background)||"white",t=(0,V.pr)(s?.color?.text)||"black",o=(0,V.pr)(s?.elements?.h1?.color?.text)||t,n=(0,V.pr)(s?.elements?.link?.color?.text)||o,r=(0,V.pr)(s?.elements?.button?.color?.background)||n,i=a.find(({color:e})=>e.toLowerCase()===t.toLowerCase()),l=a.find(({color:e})=>e.toLowerCase()===r.toLowerCase()),c=[...i?[i]:Me,...l?[l]:Me,...a].filter(({color:t},o,n)=>t.toLowerCase()!==e.toLowerCase()&&o===n.findIndex(e=>e.color.toLowerCase()===t.toLowerCase())).slice(0,2);return{backgroundColor:e,headingColor:o,highlightedColors:c}},[s,a]),u=s?.elements?.heading?.typography?.fontWeight||"inherit",p=s?.elements?.heading?.typography?.fontFamily||"inherit",[f,g]=(0,t.useState)(!1);return(0,m.jsx)("div",{onMouseEnter:()=>g(!0),onMouseLeave:()=>g(!1),children:(0,m.jsxs)(w.__unstableMotion.div,{style:{height:152,width:"100%",background:l,cursor:r?"pointer":void 0},initial:"start",animate:(f||n)&&o?"hover":"start",children:[(0,m.jsx)(w.__unstableMotion.div,{variants:Ne,style:{height:"100%",overflow:"hidden"},children:(0,m.jsxs)(w.__experimentalHStack,{spacing:10,justify:"center",style:{height:"100%",overflow:"hidden"},children:[(0,m.jsx)(w.__unstableMotion.div,{style:{fontFamily:p,fontSize:65,color:c,fontWeight:u},animate:{scale:1,opacity:1},initial:{scale:.1,opacity:0},transition:{delay:.3,type:"tween"},children:"Aa"}),(0,m.jsx)(w.__experimentalVStack,{spacing:4,children:d.map(({slug:e,color:t},o)=>(0,m.jsx)(w.__unstableMotion.div,{style:{height:32,width:32,background:t,borderRadius:16},animate:{scale:1,opacity:1},initial:{scale:.1,opacity:0},transition:{delay:1===o?.2:.1}},e))})]})}),(0,m.jsx)(w.__unstableMotion.div,{variants:r&&ze,style:{height:"100%",width:"100%",position:"absolute",top:0,overflow:"hidden",filter:"blur(60px)",opacity:.1},children:(0,m.jsx)(w.__experimentalHStack,{spacing:0,justify:"flex-start",style:{height:"100%",overflow:"hidden"},children:a.slice(0,4).map(({color:e})=>(0,m.jsx)("div",{style:{height:"100%",background:e,flexGrow:1}},e))})}),(0,m.jsx)(w.__unstableMotion.div,{variants:Pe,style:{height:"100%",width:"100%",overflow:"hidden",position:"absolute",top:0},children:(0,m.jsx)(w.__experimentalVStack,{spacing:3,justify:"center",style:{height:"100%",overflow:"hidden",padding:10,boxSizing:"border-box"},children:o&&(0,m.jsx)("div",{style:{fontSize:40,fontFamily:p,color:c,fontWeight:u,lineHeight:"1em",textAlign:"center"},children:o})})})]})})}const Re={color:{text:!0,background:!0,custom:!0}};function Ae(){const o=(0,e.useSelect)(e=>e(k.H).getTheme(),[]);return(0,t.useMemo)(()=>({...o?.settings,background:{backgroundImage:!1,backgroundSize:!1,gradient:!1}}),[o?.settings])}function Be(){const e=(0,de.sV)(Ae());return(0,m.jsx)(w.Card,{size:"small",className:"edit-site-global-styles-screen-root",variant:"primary",children:(0,m.jsx)(w.CardBody,{children:(0,m.jsxs)(w.__experimentalVStack,{spacing:4,children:[(0,m.jsx)(w.Card,{children:(0,m.jsx)(w.CardMedia,{children:(0,m.jsx)(Ie,{})})}),(0,m.jsxs)(w.__experimentalItemGroup,{children:[(0,m.jsx)(w.__experimentalNavigatorButton,{path:"/typography",onClick:()=>(0,E.yM)("styles_sidebar_navigation_click",{path:"typography"}),children:(0,m.jsx)(w.__experimentalItem,{children:(0,m.jsxs)(w.__experimentalHStack,{justify:"flex-start",children:[(0,m.jsx)(w.Icon,{icon:_e,size:24}),(0,m.jsx)(w.FlexItem,{children:(0,h.__)("Typography","woocommerce")})]})})}),(0,m.jsx)(w.__experimentalNavigatorButton,{path:"/colors",onClick:()=>(0,E.yM)("styles_sidebar_navigation_click",{path:"colors"}),children:(0,m.jsx)(w.__experimentalItem,{children:(0,m.jsxs)(w.__experimentalHStack,{justify:"flex-start",children:[(0,m.jsx)(w.Icon,{icon:ye,size:24}),(0,m.jsx)(w.FlexItem,{children:(0,h.__)("Colors","woocommerce")})]})})}),e&&(0,m.jsx)(w.__experimentalNavigatorButton,{path:"/background",onClick:()=>(0,E.yM)("styles_sidebar_navigation_click",{path:"background"}),children:(0,m.jsx)(w.__experimentalItem,{children:(0,m.jsxs)(w.__experimentalHStack,{justify:"flex-start",children:[(0,m.jsx)(w.Icon,{icon:be,size:24}),(0,m.jsx)(w.FlexItem,{children:(0,h.__)("Background","woocommerce")})]})})}),(0,m.jsx)(w.__experimentalNavigatorButton,{path:"/layout",onClick:()=>(0,E.yM)("styles_sidebar_navigation_click",{path:"layout"}),children:(0,m.jsx)(w.__experimentalItem,{children:(0,m.jsxs)(w.__experimentalHStack,{justify:"flex-start",children:[(0,m.jsx)(w.Icon,{icon:we,size:24}),(0,m.jsx)(w.FlexItem,{children:(0,h.__)("Layout","woocommerce")})]})})})]})]})})})}const Le={typography:{},color:{}},He=(e,t,o="heading",n=!1)=>{let r;switch(t){case"text":r={typography:e.typography,color:e.color};break;case"heading":r=((e,t="heading",o=!1)=>o?xe().all([Le,e.elements?.heading||{},e.elements?.[t]||{}]):{...Le,...e.elements?.heading||{},...e.elements?.[t]||{}})(e,o??"heading",n);break;default:r=e.elements?.[t]||Le}return{...r,typography:r.typography??{},color:r.color??{}}};function Fe({element:e,label:t}){const{styles:o}=Ce(),n=He(o,e,null,!0),{fontFamily:r,fontStyle:i,fontWeight:a,letterSpacing:s,textDecoration:l,textTransform:c}=n.typography,d=n.color?.text||"inherit",u=n.color?.background||"#f0f0f0",p=(0,h.sprintf)((0,h.__)("Typography %s styles","woocommerce"),t);return(0,m.jsx)(w.__experimentalItem,{children:(0,m.jsx)(w.__experimentalNavigatorButton,{path:`/typography/${e}`,"aria-label":p,onClick:()=>(0,E.yM)("styles_sidebar_screen_typography_button_click",{element:e,label:t,path:`typography/${e}`}),children:(0,m.jsxs)(w.__experimentalHStack,{justify:"flex-start",children:[(0,m.jsx)(w.FlexItem,{className:"edit-site-global-styles-screen-typography__indicator",style:{fontFamily:r??"serif",background:u,color:d,fontStyle:i??"normal",fontWeight:a??"normal",letterSpacing:s??"normal",textDecoration:l??("link"===e?"underline":"none"),textTransform:c??"none"},children:"Aa"}),(0,m.jsx)(w.FlexItem,{children:t})]})})})}const $e=function(){return(0,m.jsx)(w.Card,{size:"small",variant:"primary",isBorderless:!0,children:(0,m.jsx)(w.CardBody,{children:(0,m.jsxs)(w.__experimentalVStack,{spacing:3,children:[(0,m.jsx)(w.__experimentalHeading,{level:3,className:"edit-site-global-styles-subtitle",children:(0,h.__)("Elements","woocommerce")}),(0,m.jsxs)(w.__experimentalItemGroup,{isBordered:!0,isSeparated:!0,size:"small",children:[(0,m.jsx)(Fe,{element:"text",label:(0,h.__)("Text","woocommerce")}),(0,m.jsx)(Fe,{element:"link",label:(0,h.__)("Links","woocommerce")}),(0,m.jsx)(Fe,{element:"heading",label:(0,h.__)("Headings","woocommerce")}),(0,m.jsx)(Fe,{element:"button",label:(0,h.__)("Buttons","woocommerce")})]})]})})})};var Oe=(0,m.jsx)(Y.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,m.jsx)(Y.Path,{d:"M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z"})});const De=w.Navigator||w.__experimentalNavigatorProvider;function Ve({title:e,description:t,onBack:o}){return(0,m.jsxs)(w.__experimentalVStack,{spacing:0,children:[(0,m.jsx)(w.__experimentalView,{children:(0,m.jsx)(w.__experimentalSpacer,{marginBottom:0,paddingX:4,paddingY:3,children:(0,m.jsxs)(w.__experimentalHStack,{spacing:2,children:[(0,m.jsx)(De.BackButton,{style:{minWidth:24,padding:0},icon:Oe,size:"small","aria-label":(0,h.__)("Navigate to the previous view","woocommerce"),onClick:o}),(0,m.jsx)(w.__experimentalSpacer,{children:(0,m.jsx)(w.__experimentalHeading,{className:"woocommerce-email-editor-styles-header",level:2,size:13,children:e})})]})})}),t&&(0,m.jsx)("p",{className:"woocommerce-email-editor-styles-header-description",children:t})]})}w.Navigator||(De.Screen=w.__experimentalNavigatorScreen,De.BackButton=w.__experimentalNavigatorBackButton);const We=Ve;function Ge(){return(0,E.xW)("styles_sidebar_screen_typography_opened"),(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(We,{title:(0,h.__)("Typography","woocommerce"),description:(0,h.__)("Manage the typography settings for different elements.","woocommerce")}),(0,m.jsx)($e,{})]})}var Ue=r(61197),qe=(0,m.jsx)(Y.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,m.jsx)(Y.Path,{d:"M7 11.5h10V13H7z"})});const Ke={placement:"left-start",offset:36,shift:!0};function Ze({label:e,hasValue:o,resetValue:n,isShownByDefault:r,inheritedValue:i,userValue:a,setValue:s,colorGradientControlSettings:l}){const c=(0,t.useRef)(null);return(0,m.jsx)(w.__experimentalToolsPanelItem,{className:"block-editor-color-gradient-item block-editor-tools-panel-color-gradient-settings__item",hasValue:o,label:e,onDeselect:n,isShownByDefault:r,children:(0,m.jsx)(w.Dropdown,{popoverProps:Ke,className:"block-editor-tools-panel-color-gradient-settings__dropdown",renderToggle:({onToggle:t,isOpen:r})=>(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(w.Button,{onClick:t,className:(0,D.A)("block-editor-panel-color-gradient-settings__dropdown",{"is-open":r}),"aria-expanded":r,ref:c,__next40pxDefaultSize:!0,children:(0,m.jsxs)(w.__experimentalHStack,{justify:"flex-start",children:[(0,m.jsx)(w.ColorIndicator,{className:"block-editor-panel-color-gradient-settings__color-indicator",colorValue:i}),(0,m.jsx)(w.FlexItem,{className:"block-editor-panel-color-gradient-settings__color-name",title:e,children:e})]})}),o()&&(0,m.jsx)(w.Button,{__next40pxDefaultSize:!0,label:(0,h.__)("Reset","woocommerce"),className:"block-editor-panel-color-gradient-settings__reset",size:"small",icon:qe,onClick:()=>{n(),r&&t(),c.current?.focus()}})]}),renderContent:()=>(0,m.jsx)(w.__experimentalDropdownContentWrapper,{paddingSize:"none",children:(0,m.jsx)("div",{className:"block-editor-panel-color-gradient-settings__dropdown-content",children:(0,m.jsx)(d.__experimentalColorGradientControl,{...l,showTitle:!1,enableAlpha:!0,__experimentalIsRenderedInSidebar:!0,colorValue:i,onColorChange:s,clearable:i===a,headingLevel:3})})})})})}const Ye={textColor:!0,fontFamily:!0,fontSize:!0,fontAppearance:!0,lineHeight:!0,letterSpacing:!1,textTransform:!1,textDecoration:!1,writingMode:!0,textColumns:!0},Je=function({element:o,headingLevel:n,defaultControls:r=Ye}){const[i,a]=(0,d.useSettings)("typography.fontSizes","typography.fontFamilies"),s=a?.default||[],l=(0,e.useSelect)(e=>e(k.H).getTheme(),[]),c=(0,d.__experimentalUseMultipleOriginColorsAndGradients)(),u=!(0,de.H7)(Re)&&"text"===o,{styles:p,defaultStyles:f,userStyles:g,updateStyleProp:_,updateStyles:y}=Ce(),b=He(p,o,n),v=He(f,o,n),{fontFamily:x,fontSize:S,fontStyle:j,fontWeight:T,lineHeight:C,letterSpacing:M,textDecoration:N,textTransform:z}=b.typography,{fontFamily:P,fontSize:I,fontStyle:R,fontWeight:A,lineHeight:B,letterSpacing:L,textDecoration:H,textTransform:F}=v.typography,$=g?.color?.text,O=v.color?.text,D=(0,Ue.yQ)({settings:l?.settings},"",b.color?.text),V=$?(0,Ue.yQ)({settings:l?.settings},"",$):void 0,W="heading"!==o||"heading"!==n,G=(0,t.useCallback)((e,t)=>{_("heading"===o?["elements",n,...e]:"text"===o?[...e]:["elements",o,...e],t)},[o,_,n]),U=e=>{const t=void 0===e?void 0:(0,Ue.Px)(l?.settings,void 0,"color.text",e);G(["color","text"],t),(0,E.T7)("styles_sidebar_screen_typography_element_panel_set_text_color",{element:o,newValue:e,selectedDefaultTextColor:t===O})},q=e=>{G(["typography","letterSpacing"],e),(0,E.T7)("styles_sidebar_screen_typography_element_panel_set_letter_spacing",{element:o,newValue:e,selectedDefaultLetterSpacing:e===L})},K=e=>{G(["typography","lineHeight"],e),(0,E.T7)("styles_sidebar_screen_typography_element_panel_set_line_height",{element:o,newValue:e,selectedDefaultLineHeight:e===B})},Z=e=>{G(["typography","fontSize"],e),(0,E.T7)("styles_sidebar_screen_typography_element_panel_set_font_size",{element:o,headingLevel:n,newValue:e,selectedDefaultFontSize:e===I})},Y=e=>{G(["typography","fontFamily"],e),(0,E.T7)("styles_sidebar_screen_typography_element_panel_set_font_family",{element:o,newValue:e,selectedDefaultFontFamily:e===P})},J=e=>{G(["typography","textDecoration"],e),(0,E.T7)("styles_sidebar_screen_typography_element_panel_set_text_decoration",{element:o,newValue:e,selectedDefaultTextDecoration:e===H})},X=e=>{G(["typography","textTransform"],e),(0,E.T7)("styles_sidebar_screen_typography_element_panel_set_text_transform",{element:o,newValue:e,selectedDefaultTextTransform:e===F})},Q=({fontStyle:e,fontWeight:t})=>{G(["typography","fontStyle"],e),G(["typography","fontWeight"],t),(0,E.T7)("styles_sidebar_screen_typography_element_panel_set_font_appearance",{element:o,newFontStyle:e,newFontWeight:t,selectedDefaultFontStyle:e===R,selectedDefaultFontWeight:t===A})};return(0,m.jsxs)(w.__experimentalToolsPanel,{label:(0,h.__)("Typography","woocommerce"),resetAll:()=>{u?y(Ee(Ee(g??{},["color","text"],void 0),["typography"],{})):G(["typography"],{}),(0,E.yM)("styles_sidebar_screen_typography_element_panel_reset_all_styles_selected",{element:o,headingLevel:n})},children:[u&&(0,m.jsx)(Ze,{label:(0,h.__)("Color","woocommerce"),hasValue:()=>!!$,resetValue:()=>U(void 0),isShownByDefault:r.textColor,inheritedValue:D,userValue:V,setValue:U,colorGradientControlSettings:c}),(0,m.jsx)(w.__experimentalToolsPanelItem,{label:(0,h.__)("Font family","woocommerce"),hasValue:()=>x!==P,onDeselect:()=>Y(void 0),isShownByDefault:r.fontFamily,children:(0,m.jsx)(d.__experimentalFontFamilyControl,{value:x,onChange:Y,size:"__unstable-large",fontFamilies:s,__nextHasNoMarginBottom:!0})}),W&&(0,m.jsx)(w.__experimentalToolsPanelItem,{label:(0,h.__)("Font size","woocommerce"),hasValue:()=>S!==I,onDeselect:()=>Z(void 0),isShownByDefault:r.fontSize,children:(0,m.jsx)(w.FontSizePicker,{value:S,onChange:Z,fontSizes:i,disableCustomFontSizes:!1,withReset:!1,withSlider:!0,size:"__unstable-large",__nextHasNoMarginBottom:!0})}),(0,m.jsx)(w.__experimentalToolsPanelItem,{className:"single-column",label:(0,h.__)("Appearance","woocommerce"),hasValue:()=>T!==A||j!==R,onDeselect:()=>{Q({fontStyle:void 0,fontWeight:void 0})},isShownByDefault:r.fontAppearance,children:(0,m.jsx)(d.__experimentalFontAppearanceControl,{value:{fontStyle:j,fontWeight:T},onChange:Q,hasFontStyles:!0,hasFontWeights:!0,size:"__unstable-large"})}),(0,m.jsx)(w.__experimentalToolsPanelItem,{className:"single-column",label:(0,h.__)("Line height","woocommerce"),hasValue:()=>C!==B,onDeselect:()=>K(void 0),isShownByDefault:r.lineHeight,children:(0,m.jsx)(d.LineHeightControl,{__nextHasNoMarginBottom:!0,__unstableInputWidth:"auto",value:C,onChange:K,size:"__unstable-large"})}),(0,m.jsx)(w.__experimentalToolsPanelItem,{className:"single-column",label:(0,h.__)("Letter spacing","woocommerce"),hasValue:()=>M!==L,onDeselect:()=>q(void 0),isShownByDefault:r.letterSpacing,children:(0,m.jsx)(d.__experimentalLetterSpacingControl,{value:M,onChange:q,size:"__unstable-large",__unstableInputWidth:"auto"})}),(0,m.jsx)(w.__experimentalToolsPanelItem,{className:"single-column",label:(0,h.__)("Text decoration","woocommerce"),hasValue:()=>N!==H,onDeselect:()=>J(void 0),isShownByDefault:r.textDecoration,children:(0,m.jsx)(d.__experimentalTextDecorationControl,{value:N,onChange:J,size:"__unstable-large",__unstableInputWidth:"auto"})}),(0,m.jsx)(w.__experimentalToolsPanelItem,{label:(0,h.__)("Letter case","woocommerce"),hasValue:()=>z!==F,onDeselect:()=>X(F),isShownByDefault:r.textTransform,children:(0,m.jsx)(d.__experimentalTextTransformControl,{value:z,onChange:X,showNone:!0,isBlock:!0,size:"__unstable-large",__nextHasNoMarginBottom:!0})})]})};function Xe({element:e,headingLevel:t}){const{styles:o}=Ce(),n=He(o,e,t,!0),{fontFamily:r,fontSize:i,fontStyle:a,fontWeight:s,lineHeight:l,letterSpacing:c,textDecoration:d,textTransform:u}=n.typography,p=n.color?.text||"inherit",f=n.color?.background||"#f0f0f0",g="link"===e?{textDecoration:d??"underline"}:{};return(0,m.jsx)("div",{className:"edit-site-typography-preview",style:{fontFamily:r??"serif",background:f,color:p,lineHeight:l,fontSize:i,fontStyle:a,fontWeight:s,letterSpacing:c,textDecoration:d,textTransform:u,...g},children:"Aa"})}const Qe={text:{title:(0,h.__)("Text","woocommerce"),description:(0,h.__)("Manage the fonts and typography used on text.","woocommerce"),defaultControls:Ye},link:{title:(0,h.__)("Links","woocommerce"),description:(0,h.__)("Manage the fonts and typography used on links.","woocommerce"),defaultControls:{...Ye,textDecoration:!0}},heading:{title:(0,h.__)("Headings","woocommerce"),description:(0,h.__)("Manage the fonts and typography used on headings.","woocommerce"),defaultControls:{...Ye,textTransform:!0}},button:{title:(0,h.__)("Buttons","woocommerce"),description:(0,h.__)("Manage the fonts and typography used on buttons.","woocommerce"),defaultControls:Ye}};function et({element:e}){(0,E.xW)("styles_sidebar_screen_typography_element_opened",{element:e});const[o,n]=(0,t.useState)("heading");return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(We,{title:Qe[e].title,description:Qe[e].description}),(0,m.jsx)(w.__experimentalSpacer,{marginX:4,children:(0,m.jsx)(Xe,{element:e,headingLevel:o})}),"heading"===e&&(0,m.jsx)(w.__experimentalSpacer,{marginX:4,marginBottom:"1em",children:(0,m.jsxs)(w.__experimentalToggleGroupControl,{label:(0,h.__)("Select heading level","woocommerce"),hideLabelFromVision:!0,value:o,onChange:e=>{n(e.toString()),(0,E.yM)("styles_sidebar_screen_typography_element_heading_level_selected",{value:e})},isBlock:!0,size:"__unstable-large",__nextHasNoMarginBottom:!0,children:[(0,m.jsx)(w.__experimentalToggleGroupControlOption,{value:"heading",label:(0,h._x)("All","heading levels","woocommerce")}),(0,m.jsx)(w.__experimentalToggleGroupControlOption,{value:"h1",label:(0,h._x)("H1","Heading Level","woocommerce")}),(0,m.jsx)(w.__experimentalToggleGroupControlOption,{value:"h2",label:(0,h._x)("H2","Heading Level","woocommerce")}),(0,m.jsx)(w.__experimentalToggleGroupControlOption,{value:"h3",label:(0,h._x)("H3","Heading Level","woocommerce")}),(0,m.jsx)(w.__experimentalToggleGroupControlOption,{value:"h4",label:(0,h._x)("H4","Heading Level","woocommerce")}),(0,m.jsx)(w.__experimentalToggleGroupControlOption,{value:"h5",label:(0,h._x)("H5","Heading Level","woocommerce")}),(0,m.jsx)(w.__experimentalToggleGroupControlOption,{value:"h6",label:(0,h._x)("H6","Heading Level","woocommerce")})]})}),(0,m.jsx)(Je,{element:e,headingLevel:o,defaultControls:Qe[e].defaultControls})]})}function tt(){(0,E.xW)("styles_sidebar_screen_colors_opened");const{userStyles:t,styles:o,updateStyles:n}=Ce(),r=(0,e.useSelect)(e=>e(k.H).getTheme(),[]);return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(We,{title:(0,h.__)("Colors","woocommerce"),description:(0,h.__)("Manage palettes and the default color of different global elements.","woocommerce")}),(0,m.jsx)(de.oz,{value:t,inheritedValue:o,onChange:e=>{n(e),(0,E.yM)("styles_sidebar_screen_colors_styles_updated")},settings:r?.settings,panelId:"colors"})]})}function ot(){(0,E.xW)("styles_sidebar_screen_background_opened");const{userStyles:e,styles:t,updateStyles:o}=Ce(),n=Ae();return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(We,{title:(0,h.__)("Background","woocommerce"),description:(0,h.__)("Manage the background color of the email.","woocommerce")}),(0,m.jsx)(de.D_,{value:e,inheritedValue:t,onChange:e=>{o(e),(0,E.yM)("styles_sidebar_screen_background_styles_updated")},settings:n,panelId:"background"})]})}var nt=r(66087);function rt(){const[e]=(0,d.useSettings)("spacing.units"),t=(0,w.__experimentalUseCustomUnits)({availableUnits:e}),{styles:o,defaultStyles:n,updateStyleProp:r}=Ce();return(0,m.jsxs)(w.__experimentalToolsPanel,{label:(0,h.__)("Dimensions","woocommerce"),resetAll:()=>{r(["spacing"],n.spacing),(0,E.yM)("styles_sidebar_screen_layout_dimensions_reset_all_selected")},children:[(0,m.jsx)(w.__experimentalToolsPanelItem,{isShownByDefault:!0,hasValue:()=>!(0,nt.isEqual)(o.spacing.padding,n.spacing.padding),label:(0,h.__)("Padding","woocommerce"),onDeselect:()=>{r(["spacing","padding"],n.spacing.padding),(0,E.yM)("styles_sidebar_screen_layout_dimensions_padding_reset_clicked")},className:"tools-panel-item-spacing",children:(0,m.jsx)(d.__experimentalSpacingSizesControl,{allowReset:!0,values:o.spacing.padding,onChange:e=>{r(["spacing","padding"],e),(0,E.T7)("styles_sidebar_screen_layout_dimensions_padding_updated",{value:e})},label:(0,h.__)("Padding","woocommerce"),sides:["horizontal","vertical","top","left","right","bottom"],units:t})}),(0,m.jsx)(w.__experimentalToolsPanelItem,{isShownByDefault:!0,label:(0,h.__)("Block spacing","woocommerce"),hasValue:()=>o.spacing.blockGap!==n.spacing.blockGap,onDeselect:()=>{r(["spacing","blockGap"],n.spacing.blockGap),(0,E.yM)("styles_sidebar_screen_layout_dimensions_block_spacing_reset_clicked")},className:"tools-panel-item-spacing",children:(0,m.jsx)(d.__experimentalSpacingSizesControl,{label:(0,h.__)("Block spacing","woocommerce"),min:0,onChange:e=>{r(["spacing","blockGap"],e.top),(0,E.T7)("styles_sidebar_screen_layout_dimensions_block_spacing_updated",{value:e})},showSideInLabel:!1,sides:["top"],values:{top:o.spacing.blockGap},allowReset:!0})})]})}function it(){return(0,E.xW)("styles_sidebar_screen_layout_opened"),(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(Ve,{title:(0,h.__)("Layout","woocommerce")}),(0,m.jsx)(rt,{})]})}const at=(0,t.memo)(function(){const{userCanEditGlobalStyles:t}=(0,e.useSelect)(e=>{const{canEdit:t}=e(k.H).canUserEditGlobalEmailStyles();return{userCanEditGlobalStyles:t}},[]);return t&&(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(n.PluginSidebarMoreMenuItem,{target:"email-styles-sidebar",icon:he,children:(0,h.__)("Email styles","woocommerce")}),(0,m.jsx)(n.PluginSidebar,{name:"email-styles-sidebar",icon:he,title:(0,h.__)("Styles","woocommerce"),className:"woocommerce-email-editor-styles-panel",children:(0,m.jsxs)(De,{initialPath:"/",children:[(0,m.jsx)(De.Screen,{path:"/",children:(0,m.jsx)(Be,{})}),(0,m.jsx)(De.Screen,{path:"/typography",children:(0,m.jsx)(Ge,{})}),(0,m.jsx)(De.Screen,{path:"/typography/text",children:(0,m.jsx)(et,{element:"text"})}),(0,m.jsx)(De.Screen,{path:"/typography/link",children:(0,m.jsx)(et,{element:"link"})}),(0,m.jsx)(De.Screen,{path:"/typography/heading",children:(0,m.jsx)(et,{element:"heading"})}),(0,m.jsx)(De.Screen,{path:"/typography/button",children:(0,m.jsx)(et,{element:"button"})}),(0,m.jsx)(De.Screen,{path:"/colors",children:(0,m.jsx)(tt,{})}),(0,m.jsx)(De.Screen,{path:"/background",children:(0,m.jsx)(ot,{})}),(0,m.jsx)(De.Screen,{path:"/layout",children:(0,m.jsx)(it,{})})]})})]})});var st=(0,m.jsx)(Y.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,m.jsx)(Y.Path,{d:"M19.5 4.5h-7V6h4.44l-5.97 5.97 1.06 1.06L18 7.06v4.44h1.5v-7Zm-13 1a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-3H17v3a.5.5 0 0 1-.5.5h-10a.5.5 0 0 1-.5-.5v-10a.5.5 0 0 1 .5-.5h3V5.5h-3Z"})}),lt=r(7919);function ct(){const{togglePreviewModal:t}=(0,e.useDispatch)(k.H);return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(n.PluginPreviewMenuItem,{icon:st,onClick:()=>{(0,E.yM)("header_preview_dropdown_send_test_email_selected"),t(!0)},children:(0,h.__)("Send a test email","woocommerce")}),(0,m.jsx)(lt.P,{})]})}var dt=r(48558),ut=r(41233);const pt=()=>{const e=(0,a.useViewportMatch)("large");return(0,m.jsx)(m.Fragment,{children:e&&(0,m.jsx)(de.Lf,{children:(0,m.jsx)(ut.PreferenceToggleMenuItem,{scope:k.H,name:"fullscreenMode",label:(0,h.__)("Fullscreen mode","woocommerce"),info:(0,h.__)("Show and hide the admin user interface","woocommerce"),messageActivated:(0,h.__)("Fullscreen mode activated.","woocommerce"),messageDeactivated:(0,h.__)("Fullscreen mode deactivated.","woocommerce"),shortcut:dt.displayShortcut.secondary("f")})})})};var mt=r(20418);const ft={recordEvent:E.yM,recordEventOnce:E.xW,debouncedRecordEvent:E.T7};function gt(){const e=(0,o.applyFilters)("woocommerce_email_editor_template_sections",[],ft);return 0===e.length?null:(0,m.jsx)(n.PluginDocumentSettingPanel,{name:"template-settings-panel",title:(0,h.__)("Settings","woocommerce"),className:"woocommerce-email-editor__settings-panel",children:e.map(e=>(0,m.jsx)(n.ErrorBoundary,{children:(0,m.jsx)("div",{children:e.render()},e.id)},`error-boundary-${e.id}`))})}function ht(){const{isDirty:t}=(0,n.useEntitiesSavedStatesIsDirty)(),{hasEmptyContent:r,isEmailSent:i,urls:a}=(0,e.useSelect)(e=>({hasEmptyContent:e(k.H).hasEmptyContent(),isEmailSent:e(k.H).isEmailSent(),urls:e(k.H).getUrls()}),[]);function s(){a.send&&(window.location.href=a.send)}const l=r||i||t,c=(0,o.applyFilters)("woocommerce_email_editor_send_button_disabled",l,{hasEmptyContent:r,isEmailSent:i,isDirty:t}),d="boolean"==typeof c?c:l,u=(0,o.applyFilters)("woocommerce_email_editor_send_button_label",(0,h.__)("Send","woocommerce"));return(0,m.jsx)(w.Button,{variant:"primary",size:"compact",onClick:()=>{(0,E.yM)("header_send_button_clicked"),(0,o.applyFilters)("woocommerce_email_editor_send_action_callback",s)()},disabled:d,"data-automation-id":"email_editor_send_button",children:u})}function _t({children:e}){const o=(0,t.useRef)(document.createElement("div"));return(0,t.useEffect)(()=>{const e=document.getElementsByClassName("editor-post-publish-button__button")[0];e&&e.parentNode?.insertBefore(o.current,e.nextSibling)},[o]),(0,t.createPortal)((0,m.jsx)(m.Fragment,{children:e}),o.current)}function yt(){const o=(0,t.useRef)(null),{hasNonPostEntityChanges:r,isEditedPostDirty:i,isEditingTemplate:a}=(0,e.useSelect)(e=>({hasNonPostEntityChanges:e(n.store).hasNonPostEntityChanges(),isEditedPostDirty:e(n.store).isEditedPostDirty(),isEditingTemplate:"wp_template"===e(n.store).getCurrentPostType()}),[]),s=a||r||i&&r,l=(0,t.useCallback)((e,t)=>{t&&e.classList.contains("force-hidden")&&e.classList.remove("force-hidden"),t||e.classList.contains("force-hidden")||e.classList.add("force-hidden")},[]);return(0,t.useEffect)(()=>{const e=document.getElementsByClassName("editor-post-publish-button__button")[0];return l(e,s),e?(o.current&&o.current.disconnect(),o.current=new MutationObserver(()=>{l(e,s)}),o.current.observe(e,{attributes:!0,childList:!0,subtree:!1}),()=>o.current?.disconnect()):()=>o.current?.disconnect()},[s,l]),(0,m.jsx)(_t,{children:!s&&(0,m.jsx)(ht,{})})}const bt=()=>{const o="email-validation",n=(0,e.useSelect)(e=>e(pe.store).getNotices(o),[]);return{notices:n,hasValidationNotice:(0,t.useCallback)(e=>e?void 0!==n.find(t=>t.id===e):n?.length>0,[n]),addValidationNotice:(0,t.useCallback)((t,n,r=[])=>{const i=r;(0,e.dispatch)(pe.store).createNotice("error",n,{id:t,isDismissible:!1,actions:i,context:o})},[o]),removeValidationNotice:(0,t.useCallback)(t=>{(0,e.dispatch)(pe.store).removeNotice(t,o)},[o])}};function wt(){const{notices:e}=bt();return 0===e.length?null:(0,m.jsx)(w.Notice,{status:"error",className:"woocommerce-email-editor-validation-errors components-editor-notices__pinned",isDismissible:!1,children:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)("strong",{children:(0,h.__)("Fix errors to continue:","woocommerce")}),(0,m.jsx)("ul",{children:e.map(({id:e,content:t,actions:o})=>(0,m.jsxs)("li",{children:[t,o.length>0?o.map(({label:e,onClick:t})=>(0,m.jsx)(w.Button,{onClick:t,variant:"link",children:e},e)):null]},e))})]})})}const vt=-3;function xt(){const t=(0,e.useSelect)(e=>e(pe.store).getNotices(),[]),{removeNotice:o}=(0,e.useDispatch)(pe.store),n=t.filter(({type:e})=>"snackbar"===e).slice(vt);return(0,m.jsx)(w.SnackbarList,{notices:n,className:"components-editor-notices__snackbar edit-post-layout__snackbar",onRemove:o})}function kt({children:e}){const[o]=(0,t.useState)(document.createElement("div"));return(0,t.useEffect)(()=>{const e=document.getElementsByClassName("editor-visual-editor ")[0];e&&e.parentNode?.insertBefore(o,e)},[o]),(0,t.createPortal)((0,m.jsx)(m.Fragment,{children:e}),o)}function St({disableSnackbarNotices:t=!1}={}){const{notices:o}=(0,e.useSelect)(e=>({notices:e(pe.store).getNotices("email-editor")}),[]),{removeNotice:n}=(0,e.useDispatch)(pe.store),r=o.filter(({isDismissible:e,type:t})=>e&&"default"===t),i=o.filter(({isDismissible:e,type:t})=>!e&&"default"===t);return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsxs)(kt,{children:[(0,m.jsx)(w.NoticeList,{notices:i,className:"components-editor-notices__pinned"}),(0,m.jsx)(w.NoticeList,{notices:r,className:"components-editor-notices__dismissible",onRemove:e=>n(e,"email-editor")}),(0,m.jsx)(wt,{})]}),!t&&(0,m.jsx)(xt,{})]})}const jt=e=>{const t=(0,s.getBlockSupport)(e,"background");return t&&!1!==t?.backgroundImage};function Et(){const t=(0,e.useSelect)(e=>e("core/block-editor").getSelectedBlock(),[]),o=(0,s.hasBlockSupport)(t?.name,"border",!1)||(0,s.hasBlockSupport)(t?.name,"__experimentalBorder",!1);return(0,m.jsxs)(m.Fragment,{children:[o&&(0,m.jsx)(w.Fill,{name:"InspectorControlsBorder",children:(0,m.jsxs)(w.Notice,{className:"woocommerce-grid-full-width",status:"warning",isDismissible:!1,children:[(0,h.__)("Border display may vary or be unsupported in some email clients.","woocommerce"),(0,m.jsx)("br",{}),(0,h.__)("Units other than pixels (px) lack support in old email clients.","woocommerce")]})}),jt(t?.name)&&(0,m.jsx)(w.Fill,{name:"InspectorControlsBackground",children:(0,m.jsx)(w.Notice,{className:"woocommerce-grid-full-width",status:"warning",isDismissible:!1,children:(0,h.__)("Select a background color for email clients that do not support background images.","woocommerce")})})]})}var Tt=(0,m.jsx)(Y.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,m.jsx)(Y.Path,{d:"M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z"})}),Ct=r(93450),Mt=(0,m.jsx)(Y.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24",children:(0,m.jsx)(Y.Path,{d:"M20 10c0-5.51-4.49-10-10-10C4.48 0 0 4.49 0 10c0 5.52 4.48 10 10 10 5.51 0 10-4.48 10-10zM7.78 15.37L4.37 6.22c.55-.02 1.17-.08 1.17-.08.5-.06.44-1.13-.06-1.11 0 0-1.45.11-2.37.11-.18 0-.37 0-.58-.01C4.12 2.69 6.87 1.11 10 1.11c2.33 0 4.45.87 6.05 2.34-.68-.11-1.65.39-1.65 1.58 0 .74.45 1.36.9 2.1.35.61.55 1.36.55 2.46 0 1.49-1.4 5-1.4 5l-3.03-8.37c.54-.02.82-.17.82-.17.5-.05.44-1.25-.06-1.22 0 0-1.44.12-2.38.12-.87 0-2.33-.12-2.33-.12-.5-.03-.56 1.2-.06 1.22l.92.08 1.26 3.41zM17.41 10c.24-.64.74-1.87.43-4.25.7 1.29 1.05 2.71 1.05 4.25 0 3.29-1.73 6.24-4.4 7.78.97-2.59 1.94-5.2 2.92-7.78zM6.1 18.09C3.12 16.65 1.11 13.53 1.11 10c0-1.3.23-2.48.72-3.59C3.25 10.3 4.67 14.2 6.1 18.09zm4.03-6.63l2.58 6.98c-.86.29-1.76.45-2.71.45-.79 0-1.57-.11-2.29-.33.81-2.38 1.62-4.74 2.42-7.1z"})}),Nt=(0,m.jsx)(Y.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,m.jsx)(Y.Path,{d:"M20 11.2H6.8l3.7-3.7-1-1L3.9 12l5.6 5.5 1-1-3.7-3.7H20z"})});const zt={edit:{opacity:0,scale:.2},hover:{opacity:1,scale:1,clipPath:"inset( 22% round 2px )"}},Pt={edit:{clipPath:"inset(0% round 0px)"},hover:{clipPath:"inset( 22% round 2px )"},tap:{clipPath:"inset(0% round 0px)"}};function It(){const{urls:t}=(0,e.useSelect)(e=>({urls:e(k.H).getUrls()}),[]);return()=>{(0,E.yM)("header_close_button_clicked");const e=()=>{if(t.back)try{const e=new URL(t.back,window.location.href);["http:","https:"].includes(e.protocol)&&(window.location.href=e.href)}catch{}},n=(0,o.applyFilters)("woocommerce_email_editor_close_action_callback",e);("function"==typeof n?n:e)()}}const Rt=()=>{const e=It();return(0,m.jsx)(w.Button,{size:"compact",icon:(0,h.isRTL)()?Tt:Oe,label:(0,h.__)("Close editor","woocommerce"),showTooltip:!0,tooltipPosition:"middle right",onClick:e})},At=()=>{const e=It();return(0,m.jsxs)(w.__unstableMotion.div,{className:"woocommerce-email-editor__view-mode-toggle",transition:{duration:.2},animate:"edit",initial:"edit",whileHover:"hover",whileTap:"tap",children:[(0,m.jsx)(w.Button,{label:(0,h.__)("Close editor","woocommerce"),showTooltip:!0,tooltipPosition:"middle right",onClick:e,children:(0,m.jsx)(w.__unstableMotion.div,{variants:Pt,children:(0,m.jsx)("div",{className:"woocommerce-email-editor__view-mode-toggle-icon",children:(0,m.jsx)(Ct.A,{className:"woocommerce-email-editor-icon__icon",icon:Mt,size:48})})})}),(0,m.jsx)(w.__unstableMotion.div,{className:"woocommerce-email-editor-icon",variants:zt,children:(0,m.jsx)(Ct.A,{icon:Nt})})]})},Bt=()=>{const e=(0,t.useRef)(null),[o,n]=(0,t.useState)(null);return(0,t.useLayoutEffect)(()=>{const t=e.current?.closest(".editor-header__back-button"),o=t?.getBoundingClientRect().width;n(void 0!==o&&o<=48)},[]),null===o?(0,m.jsx)("div",{ref:e}):o?(0,m.jsx)(Rt,{}):(0,m.jsx)(At,{})},Lt=()=>{const e=(0,o.applyFilters)("woocommerce_email_editor_close_content",Bt);return(0,m.jsx)(de.oq,{children:({length:t})=>t<=1&&(0,m.jsx)(e,{})})},Ht="woocommerce-email-editor-template-area-affordance-slot",Ft="woocommerce-email-editor-template-area-affordance-style",$t="[data-block], .block-editor-block-list__block",Ot='\n.woocommerce-email-editor-template-area-affordance-slot {\n\tbox-sizing: border-box;\n\tinset: 0 auto auto 0;\n\tpointer-events: none;\n\tposition: absolute;\n\tz-index: 29;\n}\n.woocommerce-email-editor-template-area-affordance {\n\talign-items: stretch;\n\tbackground: #fff;\n\tborder: 1px solid #1e1e1e;\n\tborder-radius: 2px;\n\tbox-shadow: 0 2px 4px rgba(0, 0, 0, 0.12);\n\tdisplay: inline-flex;\n\tfont-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;\n\tfont-size: 13px;\n\tline-height: 1;\n\tpointer-events: auto;\n\tposition: absolute;\n\tz-index: 30;\n}\n.woocommerce-email-editor-template-area-affordance__frame {\n\tappearance: none;\n\tbackground: transparent;\n\tborder: 1.5px solid transparent;\n\tbox-sizing: border-box;\n\tcursor: pointer;\n\tfont: inherit;\n\tmargin: 0;\n\tpadding: 0;\n\tpointer-events: auto;\n\tposition: absolute;\n\tz-index: 29;\n}\n.woocommerce-email-editor-template-area-affordance__frame:hover,\n.woocommerce-email-editor-template-area-affordance__frame:focus-visible,\n.woocommerce-email-editor-template-area-affordance__frame.is-active {\n\tborder-color: var(--wp-components-color-accent, #3858e9);\n\toutline: none;\n}\n.woocommerce-email-editor-template-area-affordance__label {\n\talign-items: center;\n\tborder-right: 1px solid #ddd;\n\tdisplay: inline-flex;\n\tfont-weight: 500;\n\tgap: 8px;\n\theight: 48px;\n\tpadding: 0 16px;\n\twhite-space: nowrap;\n}\n.woocommerce-email-editor-template-area-affordance__label svg {\n\tfill: currentColor;\n}\n.woocommerce-email-editor-template-area-affordance__button.components-button {\n\tborder-radius: 0;\n\tbox-shadow: none;\n\tcolor: var(--wp-components-color-accent, #3858e9);\n\theight: 48px;\n\tpadding: 0 18px;\n\twhite-space: nowrap;\n}\n.woocommerce-email-editor-template-area-affordance__button.components-button:hover:not(:disabled) {\n\tcolor: var(--wp-components-color-accent, #3858e9);\n}\n.woocommerce-email-editor-template-area-affordance__button.components-button:focus-visible {\n\tbox-shadow: inset 0 0 0 1.5px var(--wp-components-color-accent, #3858e9);\n}\n';function Dt(){const[o,r]=(0,t.useState)(!1),[i,a]=(0,t.useState)(null),[s,l]=(0,t.useState)(null),c=(0,t.useRef)(null),{canEditTemplates:d,currentPostType:u,onNavigateToEntityRecord:p,template:f}=(0,e.useSelect)(e=>{const t=e(n.store).getEditorSettings();return{canEditTemplates:e(k.H).canUserEditTemplates(),currentPostType:e(n.store).getCurrentPostType(),onNavigateToEntityRecord:t?.onNavigateToEntityRecord,template:e(k.H).getCurrentTemplate()}},[]),g="wp_template"!==u&&d&&!!f?.id&&!!p,_=(0,t.useCallback)(()=>{const e=c.current,t=e?.ownerDocument,o=t?.defaultView;if(!e||!t||!o)return void l(null);const n=e.getBoundingClientRect();if(!n.width||!n.height)return void l(null);const r=o.scrollX,i=o.scrollY,a=n.top>54?n.top+i-50-4:n.bottom+i+4;l({frame:{height:n.height+2,left:n.left+r-1,top:n.top+i-1,width:n.width+2},toolbar:{left:n.left+r-1,top:a}})},[]);(0,t.useEffect)(()=>{if(!g)return r(!1),a(null),l(null),void(c.current=null);let e=0,t=null,o=120;const n=()=>{const r=function(){const e=Array.from(document.querySelectorAll("iframe"));for(const t of e)try{const e=t.contentDocument;if(e?.querySelector(".block-editor-block-list__layout.is-root-container, .is-root-container"))return e}catch(e){}return null}(),i=r&&function(e){const t=e.querySelector('[data-type="core/site-logo"], [data-type="core/site-title"], .wp-block-site-logo, .wp-block-site-title');return t?(o=t).closest($t)||o.closest("[data-type]")||o:null;var o}(r);r&&i?(function(e){if(e.getElementById(Ft))return;const t=e.createElement("style");t.id=Ft,t.textContent=Ot,e.head.appendChild(t)}(r),t=function(e){let t=e.getElementById(Ht);return t||(t=e.createElement("div"),t.id=Ht,t.className="woocommerce-email-editor-template-area-affordance-slot",e.body.appendChild(t)),t}(r),c.current=i,a(t),_()):o>0&&(o--,e=window.requestAnimationFrame(n))};return n(),()=>{e&&window.cancelAnimationFrame(e);const o=t?.ownerDocument;t?.remove(),o?.getElementById(Ft)?.remove(),r(!1),a(null),l(null),c.current=null}},[g,_]),(0,t.useEffect)(()=>{const e=i?.ownerDocument,t=e?.defaultView;if(!i||!e||!t)return;const o=e=>{e.target instanceof Node&&i.contains(e.target)||r(!1)};return e.addEventListener("mousedown",o),e.addEventListener("scroll",_,!0),t.addEventListener("resize",_),window.addEventListener("resize",_),_(),()=>{e.removeEventListener("mousedown",o),e.removeEventListener("scroll",_,!0),t.removeEventListener("resize",_),window.removeEventListener("resize",_)}},[i,_]);const y=(0,t.useRef)(null),b=(0,t.useRef)(null),v=(0,t.useCallback)(()=>r(!0),[]),x=(0,t.useCallback)(()=>{f?.id&&p&&((0,E.yM)("template_canvas_affordance_edit_template_clicked",{templateId:f.id}),p({postId:f.id,postType:"wp_template"}))},[p,f?.id]),S=(0,t.useCallback)(e=>{e.stopPropagation()},[]);if((0,t.useEffect)(()=>{const e=y.current;if(e)return e.addEventListener("mousedown",S),e.addEventListener("pointerdown",S),e.addEventListener("click",v),()=>{e.removeEventListener("mousedown",S),e.removeEventListener("pointerdown",S),e.removeEventListener("click",v)}},[i,v,S]),(0,t.useEffect)(()=>{const e=b.current;if(e)return e.addEventListener("mousedown",S),e.addEventListener("pointerdown",S),e.addEventListener("click",x),()=>{e.removeEventListener("mousedown",S),e.removeEventListener("pointerdown",S),e.removeEventListener("click",x)}},[o,x,S]),!g||!i||!s)return null;const j=`${Ht}-toolbar`;return(0,t.createPortal)((0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)("button",{ref:y,type:"button",className:o?"woocommerce-email-editor-template-area-affordance__frame is-active":"woocommerce-email-editor-template-area-affordance__frame","aria-label":(0,h.__)("Template area","woocommerce"),"aria-expanded":o,"aria-controls":o?j:void 0,style:s.frame}),o&&(0,m.jsxs)("div",{id:j,className:"woocommerce-email-editor-template-area-affordance",style:s.toolbar,children:[(0,m.jsxs)("span",{className:"woocommerce-email-editor-template-area-affordance__label",children:[(0,m.jsx)(Ct.A,{icon:we,size:24}),(0,m.jsx)("span",{children:(0,h.__)("Template","woocommerce")})]}),(0,m.jsx)(w.Button,{ref:b,className:"woocommerce-email-editor-template-area-affordance__button",variant:"tertiary",children:(0,h.__)("Edit template","woocommerce")})]})]}),i)}const Vt=n.AutosaveMonitor,Wt=n.EditorKeyboardShortcutsRegister;function Gt({postId:o,postType:r,settings:i,contentRef:a,customSavePanel:s,customSaveButton:l}){const{currentPost:c,onNavigateToEntityRecord:d,onNavigateToPreviousEntityRecord:u}=function(o,r,i){const[a,s]=(0,t.useReducer)((e,{type:t,post:o,previousRenderingMode:n})=>"push"===t?[...e,{post:o,previousRenderingMode:n}]:"pop"===t&&e.length>1?e.slice(0,-1):e,[{post:{postId:o,postType:r}}]),{post:l,previousRenderingMode:c}=a[a.length-1],{getRenderingMode:d}=(0,e.useSelect)(n.store),{setRenderingMode:u}=(0,e.useDispatch)(n.store),p=(0,t.useCallback)(e=>{s({type:"push",post:{postId:e.postId,postType:e.postType},previousRenderingMode:d()}),u(i)},[d,u,i]),m=(0,t.useCallback)(()=>{s({type:"pop"}),c&&u(c)},[u,c]);return{currentPost:l,onNavigateToEntityRecord:p,onNavigateToPreviousEntityRecord:a.length>1?m:void 0}}(o,r,"post-only"),{post:p,template:f}=(0,e.useSelect)(e=>{const{getEditedEntityRecord:t}=e(se.store),o=t("postType",c.postType,c.postId);if(!o||"boolean"==typeof o)return{post:null,template:null};const n=o;if("wp_template"===c.postType)return{post:n,template:null};const{getEditedPostTemplate:r}=e(k.H);return{post:n,template:r(n.template)}},[c.postType,c.postId]),{isFullscreenEnabled:g,allCommands:h}=(0,e.useSelect)(e=>({isFullscreenEnabled:e(k.H).isFeatureActive("fullscreenMode"),allCommands:e(le.store).getCommands()}),[]),{isFullScreenForced:_,displaySendEmailButton:y,disableSnackbarNotices:b}=i,{removeEditorPanel:v}=(0,e.useDispatch)(n.store);(0,t.useEffect)(()=>{v("post-status")},[v]);const[x]=(0,ue.b)(),S=(0,t.useMemo)(()=>({...i,onNavigateToEntityRecord:d,onNavigateToPreviousEntityRecord:u,defaultRenderingMode:"wp_template"===c.postType?"post-only":"template-locked",supportsTemplateMode:!0,styles:x}),[i,d,u,c.postType,x]);if(!p||"wp_template"!==c.postType&&p.template!==f?.slug&&(p.template||!f))return(0,m.jsx)("div",{className:"spinner-container",children:(0,m.jsx)(w.ProgressBar,{})});const j=h.every(({name:e})=>e.includes("woocommerce"));return(0,E.xW)("editor_layout_loaded"),(0,m.jsx)(w.SlotFillProvider,{children:(0,m.jsxs)(n.ErrorBoundary,{canCopyContent:!0,children:[j&&(0,m.jsx)(le.CommandMenu,{}),(0,m.jsxs)(de.KE,{postId:c.postId,postType:c.postType,settings:S,templateId:f&&f.id,contentRef:a,styles:x,customSavePanel:s,customSaveButton:"wp_template"===c.postType?void 0:l,children:[(0,m.jsx)(Vt,{}),(0,m.jsx)(n.LocalAutosaveMonitor,{}),(0,m.jsx)(n.UnsavedChangesWarning,{}),(0,m.jsx)(Wt,{}),(0,m.jsx)(n.PostLockedModal,{}),(0,m.jsx)(ge,{}),(0,m.jsx)(Dt,{}),(0,m.jsx)(at,{}),(0,m.jsx)(ct,{}),(0,m.jsx)(me,{}),(0,m.jsx)(de.fA,{isActive:_||g}),(_||g)&&(0,m.jsx)(Lt,{}),!_&&(0,m.jsx)(pt,{}),"wp_template"===c.postType?(0,m.jsx)(gt,{}):(0,m.jsx)(mt.O,{}),y&&(0,m.jsx)(yt,{}),(0,m.jsx)(St,{disableSnackbarNotices:b}),(0,m.jsx)(Et,{}),(0,m.jsx)(ce.PluginArea,{scope:"woocommerce-email-editor"})]})]})})}var Ut=r(77977);const qt=()=>{const e={"You’ve tried to select a block that is part of a template that may be used elsewhere on your site. Would you like to edit the template?":{domain:"default",replacementText:(0,h.__)("You’ve tried to select a block that is part of a template that may be used in other emails. Would you like to edit the template?","woocommerce")}};(0,p.HY)("i18n.gettext","woocommerce/email-editor/override-text",(t,o,n)=>e[o]&&e[o].domain===(n||"default")?e[o].replacementText:t)},Kt=e=>{(0,o.doAction)("woocommerce_email_editor_events",e.detail)},Zt=()=>{(0,E.V1)()&&E.oh.addEventListener(E.vD,Kt)};window.addEventListener("unload",function(){(0,E.V1)()&&E.oh.removeEventListener(E.vD,Kt)});const Yt=(...t)=>{const o=(0,e.select)(n.store).isInserterOpened(),r=!!document.getElementsByClassName("block-editor-inserter__quick-inserter").length;let i="other_inserter";o?i="inserter_sidebar":r&&(i="quick_inserter");const a=t[0],s=t[5];!1===Array.isArray(a)&&"object"==typeof a&&(0,E.yM)(`${i}_library_block_selected`,{blockName:a.name}),Array.isArray(a)&&s&&s.patternName&&(0,E.yM)(`${i}_library_pattern_selected`,{patternName:s.patternName})},Jt={"core/editor":{autosave:"editor_content_auto_saved",setDeviceType:e=>{(0,E.yM)(`header_preview_dropdown_${e.toLowerCase()}_selected`)},setRenderingMode:t=>{(0,e.select)(n.store).getRenderingMode()!==t&&document.querySelector(`[aria-label="${(0,h.__)("View options")}"]`)&&(0,E.yM)("preview_dropdown_rendering_mode_changed",{renderingMode:t})}},"core/block-editor":{insertBlock:Yt,insertBlocks:Yt},"core/preferences":{set:(t,o,n)=>{if((0,e.select)(ut.store).get(t,o)===n)return;const r={focusMode:"focus_mode_toggle",fullscreenMode:"full_screen_mode_toggle",distractionFree:"distraction_free_toggle",fixedToolbar:"fixed_toolbar_toggle"};r[o]&&(0,E.yM)(r[o],{isEnabled:n})}},"core/commands":{open:"command_menu_opened",close:"command_menu_closed"}},Xt={},Qt={},eo=()=>{(0,E.V1)()&&(0,e.use)(e=>({dispatch:t=>{const o="object"==typeof t?t.name:t,n=e.dispatch(o),r=Jt[o];if(!r)return n;Xt[o]||(Xt[o]={}),Qt[o]||(Qt[o]={});for(const[e,t]of Object.entries(r))Qt[o][e]||(Qt[o][e]=n[e],Xt[o][e]=(...n)=>{try{"function"==typeof t?t(...n):"string"==typeof t&&(0,E.yM)(t)}catch(e){console.error("Error tracking event",e)}return Qt[o][e](...n)}),n[e]=Xt[o][e];return n}}))};let to=[];function oo(e){to.forEach(t=>{const o=e.target?.matches?.(t.selector)?e.target:e.target?.closest?.(t.selector);o&&("function"==typeof t.track?t.track(o,e):(0,E.yM)(t.track))})}const no=new WeakMap,ro={core:["saveEditedEntityRecord","saveEntityRecord"]},io=()=>{Object.keys(no).length>0||(0,e.use)(e=>({dispatch:t=>{const o="object"==typeof t?t.name:t;if(!ro[o])return e.dispatch(o);const n=e.dispatch(o);no[o]||(no[o]={});const r=ro[o].filter(e=>!no[o][e]);if(r.length>0)for(const t of r)no[o][t]=n[t],n[t]=async(...n)=>{const r=e.select(k.H).getContentValidation(),i=r?.validateContent;if(i){let e;try{e=i()}catch(t){e=!1}if(!e)return Promise.reject(new Error((0,h.__)("Content validation failed.","woocommerce")))}return await no[o][t](...n)};return n}}))};var ao=r(94462),so=r(18537),lo=r(1455),co=r.n(lo);function uo(e){return"string"==typeof e.title?(0,so.decodeEntities)(e.title):e.title&&"rendered"in e.title?(0,so.decodeEntities)(e.title.rendered):e.title&&"raw"in e.title?(0,so.decodeEntities)(e.title.raw):""}const po=o=>{"wp_template"===o&&((0,de.yd)("postType",o,"duplicate-post"),(0,de.yd)("postType",o,"reset-post"),(0,de.Bi)("postType",o,{id:"reset-email-template",label:(0,h.__)("Reset","woocommerce"),supportsBulk:!1,icon:ao.A,isEligible(e){if("wp_template"!==e.type)return!1;if("custom"!==e.source)return!1;if(!Boolean(e.plugin)&&!Boolean(e.has_theme_file))return!1;const{permissions:t}=e;return t?.delete},hideModalHeader:!0,modalFocusOnMount:"firstContentElement",RenderModal:({items:o,closeModal:n,onActionPerformed:r})=>{const[i,a]=(0,t.useState)(!1),{createSuccessNotice:l,createErrorNotice:c}=(0,e.useDispatch)(pe.store),{invalidateResolution:d,editEntityRecord:u,saveEditedEntityRecord:p}=(0,e.useDispatch)(se.store),f=o[0],g=(0,h.sprintf)((0,h.__)('Are you sure you want to reset "%s" to default?',"woocommerce"),uo(f));return(0,m.jsxs)(w.__experimentalVStack,{spacing:"5",children:[(0,m.jsx)(w.__experimentalText,{children:g}),(0,m.jsxs)(w.__experimentalHStack,{justify:"right",children:[(0,m.jsx)(w.Button,{variant:"tertiary",onClick:()=>{n?.(),(0,E.yM)("reset_modal_cancel_button_clicked")},disabled:i,__next40pxDefaultSize:!0,children:(0,h.__)("Cancel","woocommerce")}),(0,m.jsx)(w.Button,{variant:"primary",onClick:async()=>{(0,E.yM)("reset_modal_confirm_button_clicked"),a(!0);try{const e=await co()({path:`/wp/v2/templates/${f.id}?context=edit&source=${f.origin}`}),t=(0,s.parse)(e.content?.raw||"");u("postType",f.type,f.id,{blocks:t,content:(0,s.serialize)(t),source:f.origin}),await p("postType",f.type,f.id,{}),await co()({path:`/wp/v2/templates/${f.id}`,method:"DELETE"}),d("getEntityRecord",["postType",f.type,f.id]);const i=(0,h.sprintf)((0,h.__)('"%s" reset to default.',"woocommerce"),uo(f));l(i,{type:"snackbar",id:"reset-email-template-action"}),r?.(o),a(!1),n?.()}catch(e){let t=(0,h.__)("An error occurred while resetting the template.","woocommerce");e&&"object"==typeof e&&"message"in e&&(t=e.message),(0,E.yM)("reset_modal_error",{errorMessage:t}),c(t,{type:"snackbar"}),a(!1),n?.()}},isBusy:i,disabled:i,__next40pxDefaultSize:!0,children:(0,h.__)("Reset","woocommerce")})]})]})}}))};var mo=(0,m.jsx)(Y.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,m.jsx)(Y.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M12 5.5A2.25 2.25 0 0 0 9.878 7h4.244A2.251 2.251 0 0 0 12 5.5ZM12 4a3.751 3.751 0 0 0-3.675 3H5v1.5h1.27l.818 8.997a2.75 2.75 0 0 0 2.739 2.501h4.347a2.75 2.75 0 0 0 2.738-2.5L17.73 8.5H19V7h-3.325A3.751 3.751 0 0 0 12 4Zm4.224 4.5H7.776l.806 8.861a1.25 1.25 0 0 0 1.245 1.137h4.347a1.25 1.25 0 0 0 1.245-1.137l.805-8.861Z"})});function fo(e){return"string"==typeof e.title?(0,so.decodeEntities)(e.title):e.title&&"rendered"in e.title?(0,so.decodeEntities)(e.title.rendered):e.title&&"raw"in e.title?(0,so.decodeEntities)(e.title.raw):""}function go(e,t){return t?e.length>1?(0,h.sprintf)((0,h._n)("Are you sure you want to permanently delete %d item?","Are you sure you want to permanently delete %d items?",e.length,"woocommerce"),e.length):(0,h.sprintf)((0,h.__)('Are you sure you want to permanently delete "%s"?',"woocommerce"),(0,so.decodeEntities)(fo(e[0]))):e.length>1?(0,h.sprintf)((0,h._n)("Are you sure you want to move %d item to the trash ?","Are you sure you want to move %d items to the trash ?",e.length,"woocommerce"),e.length):(0,h.sprintf)((0,h.__)('Are you sure you want to move "%s" to the trash?',"woocommerce"),fo(e[0]))}const ho=n=>{(0,de.yd)("postType",n,"move-to-trash"),(0,de.Bi)("postType",n,(()=>{const n=(0,o.applyFilters)("woocommerce_email_editor_trash_modal_should_permanently_delete",!1);return{id:"trash-email-post",label:n?(0,h.__)("Permanently delete","woocommerce"):(0,h.__)("Move to trash","woocommerce"),supportsBulk:!0,icon:mo,isEligible(e){if("wp_template"===e.type||"wp_template_part"===e.type||"wp_block"===e.type)return!1;const{permissions:t}=e;return t?.delete},hideModalHeader:!0,modalFocusOnMount:"firstContentElement",RenderModal:({items:o,closeModal:r,onActionPerformed:i})=>{const[a,s]=(0,t.useState)(!1),{createSuccessNotice:l,createErrorNotice:c}=(0,e.useDispatch)(pe.store),{deleteEntityRecord:d}=(0,e.useDispatch)(se.store),{urls:u}=(0,e.useSelect)(e=>({urls:e(k.H).getUrls()}),[]);return(0,m.jsxs)(w.__experimentalVStack,{spacing:"5",children:[(0,m.jsx)(w.__experimentalText,{children:go(o,n)}),(0,m.jsxs)(w.__experimentalHStack,{justify:"right",children:[(0,m.jsx)(w.Button,{variant:"tertiary",onClick:()=>{r?.(),(0,E.yM)("trash_modal_cancel_button_clicked")},disabled:a,__next40pxDefaultSize:!0,children:(0,h.__)("Cancel","woocommerce")}),(0,m.jsx)(w.Button,{variant:"primary",onClick:async()=>{(0,E.yM)("trash_modal_move_to_trash_button_clicked"),s(!0);const e=await Promise.allSettled(o.map(e=>d("postType",e.type,e.id,{force:n},{throwOnError:!0})));if(e.every(({status:e})=>"fulfilled"===e)){let t;t=1===e.length?n?(0,h.sprintf)((0,h.__)('"%s" permanently deleted.',"woocommerce"),fo(o[0])):(0,h.sprintf)((0,h.__)('"%s" moved to the trash.',"woocommerce"),fo(o[0])):n?(0,h.__)("The items were permanently deleted.","woocommerce"):(0,h.sprintf)((0,h._n)("%s item moved to the trash.","%s items moved to the trash.",o.length,"woocommerce"),o.length),l(t,{type:"snackbar",id:"trash-email-post-action"}),i?.(o),u?.listings&&(window.location.href=u.listings)}else{let t;if(1===e.length){const o=e[0];t=o.reason?.message?o.reason.message:(0,h.__)("An error occurred while performing the action.","woocommerce")}else{const o=new Set,n=e.filter(({status:e})=>"rejected"===e);for(const e of n){const t=e;t.reason?.message&&o.add(t.reason.message)}t=0===o.size?(0,h.__)("An error occurred while performing the action.","woocommerce"):1===o.size?(0,h.sprintf)((0,h.__)("An error occurred while performing the action: %s","woocommerce"),[...o][0]):(0,h.sprintf)((0,h.__)("Some errors occurred while performing the action: %s","woocommerce"),[...o].join(","))}(0,E.yM)("trash_modal_move_to_trash_error",{errorMessage:t}),c(t,{type:"snackbar"})}s(!1),r?.()},isBusy:a,disabled:a,__next40pxDefaultSize:!0,children:n?(0,h.__)("Delete permanently","woocommerce"):(0,h.__)("Move to trash","woocommerce")})]})]})}}})())};const _o=window.wp.isShallowEqual;var yo=r.n(_o);function bo(e){const o=(0,t.useRef)(e);return yo()(e,o.current)||(o.current=e),o.current}const wo=[],vo=()=>{const{addValidationNotice:n,hasValidationNotice:r,removeValidationNotice:i}=bt(),{editedContent:a,editedTemplateContent:s}=(0,e.useSelect)(e=>({editedContent:e(k.H).getEditedEmailContent(),editedTemplateContent:e(k.H).getCurrentTemplateContent()})),l=bo(a),c=bo(s),d=(0,t.useCallback)(()=>((e,t,{addValidationNotice:n,hasValidationNotice:r,removeValidationNotice:i})=>{const a=(0,o.applyFilters)("woocommerce_email_editor_content_validation_rules",wo);let s=!0;return a.forEach(({id:o,testContent:a,message:l,actions:c})=>{a(e+t)?(n(o,l,c),s=!1):r(o)&&i(o)}),s})(l,c,{addValidationNotice:n,hasValidationNotice:r,removeValidationNotice:i}),[l,c,n,i,r]);return(0,t.useEffect)(()=>((0,e.dispatch)(k.H).setContentValidation({validateContent:d}),()=>{(0,e.dispatch)(k.H).setContentValidation(void 0)}),[d]),(0,t.useEffect)(()=>{const t=(0,e.subscribe)(()=>{r()&&d()},se.store);return()=>t()},[r,d]),{validateContent:d}},xo=()=>{const o=(0,t.useMemo)(()=>{const e=(0,h.__)("Saving failed.");return new RegExp("^"+e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"))},[]);(0,t.useEffect)(()=>{const t=(0,e.subscribe)(()=>{(0,e.select)(pe.store).getNotices().forEach(t=>{"string"==typeof t.content&&o.test(t.content)&&(0,e.dispatch)(pe.store).removeNotice(t.id)})});return()=>{t()}},[o])};const ko=(0,e.createSelector)(e=>function(e){return e.map(e=>function(e){const t={"site-editor-save-success":{content:(0,h.__)("Email design updated.","woocommerce"),removeActions:!0},"editor-save":{content:(0,h.__)("Email saved.","woocommerce"),removeActions:!1,contentCheck:e=>e.includes((0,h.__)("Post updated."))||e.includes((0,h.__)("Post published."))}}[e.id];return t?t.contentCheck&&!t.contentCheck(e.content)?e:{...e,content:t.content,spokenMessage:t.content,actions:t.removeActions?[]:e.actions}:e}(e))}(e),e=>[e]),So=()=>{const r=(0,t.useRef)(null),[i,a]=(0,t.useState)(0),s=(0,t.useCallback)(e=>{r.current=e,a(e=>++e)},[r,a]),l=(0,e.useSelect)(e=>{const{getEditorSettings:t}=e(n.store);return t()?.allowedIframeStyleHandles??[]});return(0,t.useEffect)(()=>{if(!r.current)return;const{ownerDocument:e}=r.current;Array.from(document.styleSheets).filter(e=>{if(!(e?.ownerNode instanceof Element))return!1;const t=e.ownerNode.getAttribute("id"),n=t&&!l.includes(t);return(0,o.applyFilters)("woocommerce_email_editor_iframe_stylesheet_should_remove",n,e)}).map(e=>e.ownerNode.getAttribute("id")).forEach(t=>{const o=e.getElementById(t);o&&o.remove();const n=e.createElement("style");n.id=t,e.head.appendChild(n)})},[l,i]),s};var jo=r(26377);function Eo(){if(!window.WooCommerceEmailEditor)throw new Error("WooCommerceEmailEditor global object is not available. This is required for the email editor to work.");const e=window.WooCommerceEmailEditor.editor_settings,t=window.WooCommerceEmailEditor.editor_theme,o=window.WooCommerceEmailEditor.urls,n=window.WooCommerceEmailEditor.current_wp_user_email,r=window.WooCommerceEmailEditor.user_theme_post_id;if(!e)throw new Error("window.WooCommerceEmailEditor.editor_settings is required.");if(!t)throw new Error("window.WooCommerceEmailEditor.editor_theme is required.");if(!o||"string"!=typeof o.back||"string"!=typeof o.listings)throw new Error("window.WooCommerceEmailEditor.urls.back and .listings are required strings.");return{editorSettings:e,theme:t,urls:o,userEmail:n,globalStylesPostId:r??null}}function To({postId:o,postType:n,isPreview:r=!1,contentRef:i=null,customSavePanel:s,customSaveButton:c}){const[d,u]=(0,t.useState)(!1),{settings:p}=(0,e.useSelect)(e=>({settings:e(k.H).getInitialEditorSettings()}),[]);vo(),xo(),(0,t.useEffect)(()=>{let t;return(0,e.use)(e=>(t=e.select,{select:e=>{if(function(e){return"object"==typeof e?e.name:e}(e)!==pe.store.name)return t(e);const o=t(e),n=o.getNotices;return n?{...o,getNotices:e=>ko(n(e))}:o}})),()=>{(0,e.use)(()=>({select:t}))}},[]);const{setEmailPost:f}=(0,e.useDispatch)(k.H);(0,t.useEffect)(()=>{f(o,n),u(!0)},[o,n,f]);const g=So(),h=(0,a.useMergeRefs)([g,i]),_=(0,t.useMemo)(()=>({...p,allowedBlockTypes:l(),isPreviewMode:r,responsiveEditingEnabled:!1}),[p,r]);return d?(0,m.jsx)(t.StrictMode,{children:(0,m.jsx)(Gt,{postId:o,postType:n,settings:_,contentRef:h,customSavePanel:s,customSaveButton:c})}):null}function Co(){(0,o.hasFilter)("sync.providers","woocommerce/email-editor/disable-collab")||(window._wpCollaborationEnabled&&(window._wpCollaborationEnabled=!1),(0,o.addFilter)("sync.providers","woocommerce/email-editor/disable-collab",()=>[],1e3)),Zt(),eo(),(0,E.V1)()&&(to=[{track:"header_preview_dropdown_preview_in_new_tab_selected",selector:'.editor-preview-dropdown__button-external, a[role="menuitem"][target^="wp-preview-"]'},{track:()=>{const e=document.getElementsByClassName("is-collapsed editor-collapsible-block-toolbar").length;(0,E.yM)("header_blocks_tool_button_clicked",{isBlockToolsCollapsed:e})},selector:".editor-collapsible-block-toolbar__toggle"},{track:e=>{const t=e.classList.contains("is-opened");(0,E.yM)("header_more_menu_dropdown_toggle",{isOpened:t})},selector:`.components-dropdown-menu__toggle[aria-label="${(0,h.__)("Options")}"]`},{track:e=>{(e.textContent===(0,h.__)("Save")&&"false"===e.getAttribute("aria-disabled")||e.textContent===(0,h.__)("Saving…"))&&(0,E.yM)("header_save_button_clicked")},selector:".editor-post-publish-button"},{track:"header_save_email_button_clicked",selector:".editor-post-saved-state.is-saving"},{track:"inserter_sidebar_library_close_icon_clicked",selector:".block-editor-inserter__menu .block-editor-tabbed-sidebar__close-button"},{track:e=>{const t=e.classList.contains("is-opened");(0,E.yM)("header_preview_dropdown_clicked",{isOpened:t})},selector:".editor-preview-dropdown__toggle"},{track:()=>{(0,E.yM)("sidebar_tab_selected",{tab:"document"})},selector:'[data-tab-id="edit-post/document"]'},{track:()=>{(0,E.yM)("sidebar_tab_selected",{tab:"block"})},selector:'[data-tab-id="edit-post/block"]'},{track:e=>{const t=e.classList.contains("is-pressed");(0,E.yM)("header_inserter_sidebar_clicked",{isOpened:t})},selector:".editor-document-tools__inserter-toggle"},{track:e=>{const t=e.classList.contains("is-pressed");(0,E.yM)("header_listview_sidebar_clicked",{isOpened:t})},selector:".editor-document-tools__document-overview-toggle"},{track:e=>{(0,E.yM)("command_bar_command_clicked",{command:e.dataset?.value})},selector:'.commands-command-menu__container [role="option"]'}],document.addEventListener("click",oo)),(0,Ut.y$)(),io(),Z(),(0,p.tN)("core.registerPostTypeSchema","woocommerce-email-editor/modify-move-to-trash-action",e=>{ho(e)}),(0,p.tN)("core.registerPostTypeActions","woocommerce-email-editor/modify-move-to-trash-action",e=>{ho(e)}),(0,p.tN)("core.registerPostTypeSchema","woocommerce-email-editor/modify-template-actions",e=>{po(e)}),(0,p.tN)("core.registerPostTypeActions","woocommerce-email-editor/modify-template-actions",e=>{po(e)}),qt(),(0,s.getBlockTypes)().forEach(e=>{te(e.name)&&(0,u.G)(e.name,e=>({...e,attributes:{...e.attributes,layout:{type:"object"}}}))}),(0,p.HY)("editor.BlockListBlock","woocommerce-email-editor/with-layout-styles",ae),(0,p.HY)("editor.BlockEdit","woocommerce-email-editor/with-inspector-controls",re)}function Mo(n){const r=document.getElementById(n);if(!r)return;const{current_post_id:i,current_post_type:a}=window.WooCommerceEmailEditor;if(null==i)throw new Error("current_post_id is required but not provided.");if(!a)throw new Error("current_post_type is required but not provided.");const s=(0,o.applyFilters)("woocommerce_email_editor_wrap_editor_component",To);Co();const l=Eo();(0,e.dispatch)(k.H).setEditorConfig(l),(0,t.createRoot)(r).render((0,m.jsx)(s,{postId:i,postType:a}))}function No({postId:r,postType:i,isPreview:a=!1,contentRef:s=null,config:l,customSavePanel:c,customSaveButton:d}){const[u,p]=(0,t.useState)(!1);(0,t.useEffect)(()=>{const t=(0,e.select)(n.store).getEditorSettings(),o=l||Eo();return Co(),(0,e.dispatch)(k.H).setEditorConfig(o),p(!0),()=>{try{(0,jo.IF)()}finally{(0,e.dispatch)(n.store).updateEditorSettings(t)}}},[l]);const f=(0,o.applyFilters)("woocommerce_email_editor_wrap_editor_component",To);return u?(0,m.jsx)(f,{postId:r,postType:i,isPreview:a,contentRef:s,customSavePanel:c,customSaveButton:d}):null}var zo=r(47200),Po=r(51831),Io=r(36208),Ro=r(38084),Ao=r(28129);function Bo(e){"loading"===document.readyState?window.addEventListener("DOMContentLoaded",()=>{Mo(e)},{once:!0}):Mo(e)}})(),(window.wc=window.wc||{}).emailEditor=i})();