",value:"div"}],value:e||"",onChange:e=>t({tagName:e})}))}function V7({postId:e,hasInnerBlocks:t,layout:n,tagName:r,blockProps:o,clientId:a}){const i=Tl((e=>{var t;const{getSettings:n}=e(nk);return null===(t=n())||void 0===t?void 0:t.supportsLayout}),[]),s=JL("layout")||{},l=n&&n.inherit?s:n,[c,u,d]=fd("postType","wp_template_part",{id:e}),p=GH(o,{value:c,onInput:u,onChange:d,renderAppender:t?void 0:JH.ButtonBlockAppender,__experimentalLayout:i?l:void 0});return(0,tt.createElement)(bB,{clientId:a,tagName:r,wrapperProps:p})}const X7=[{name:"header",icon:AV,title:er("Header"),description:er("The Header template defines a page area that typically contains a title, logo, and main navigation."),attributes:{area:"header"},scope:["inserter"]},{name:"footer",icon:SV,title:er("Footer"),description:er("The Footer template defines a page area that typically contains site credits, social links, or any other combination of blocks."),attributes:{area:"footer"},scope:["inserter"]}];X7.forEach((e=>{e.isActive||(e.isActive=(e,t)=>{const{area:n,theme:r,slug:o}=e;if(n)return n===t.area;if(!o)return!1;const a=tn(yd).getEntityRecord("postType","wp_template_part",`${r}//${o}`);return(null==a?void 0:a.area)===t.area})}));const U7=X7;const $7={apiVersion:2,name:"core/template-part",title:"Template Part",category:"theme",description:"Edit the different global regions of your site, like the header, footer, sidebar, or create your own.",textdomain:"default",attributes:{slug:{type:"string"},theme:{type:"string"},tagName:{type:"string"},area:{type:"string"}},supports:{align:!0,html:!1,color:{gradients:!0,link:!0},spacing:{padding:!0},__experimentalLayout:!0},editorStyle:"wp-block-template-part-editor"},{name:K7}=$7,G7={icon:yH,__experimentalLabel:({slug:e,theme:t})=>{var n;if(!e)return;const r=tn(yd).getEntityRecord("postType","wp_template_part",t+"//"+e);return r?(0,at.startCase)((null===(n=r.title)||void 0===n?void 0:n.rendered)||r.slug):void 0},edit:function({attributes:e,setAttributes:t,clientId:n}){const{slug:r,theme:o,tagName:a,layout:i={}}=e,s=x7(o,r),[l,c]=DF(s),{isResolved:u,innerBlocks:d,isMissing:p,defaultWrapper:m,area:f,enableSelection:h,hasResolvedReplacements:g}=Tl((t=>{var r;const{getEditedEntityRecord:o,getEntityRecords:a,hasFinishedResolution:i}=t(yd),{getBlocks:l}=t(nk),c=["postType","wp_template_part",s],u=s?o(...c):null,d=(null==u?void 0:u.area)||e.area,p=["postType","wp_template_part",d&&"uncategorized"!==d&&{area:d}],m=a(...p),f=s?(null==m?void 0:m.length)>1:(null==m?void 0:m.length)>0,h=!!s&&i("getEditedEntityRecord",c),g=null===(r=t("core/editor").__experimentalGetDefaultTemplatePartAreas().find((({area:e})=>e===d)))||void 0===r?void 0:r.area_tag;return{innerBlocks:l(n),isResolved:h,isMissing:h&&!u,defaultWrapper:g||"div",area:d,enableSelection:f,hasResolvedReplacements:i("getEntityRecords",p)}}),[s,n]),b=VR(),v=!r,y=!v&&!p&&u,_=a||m;return 0===d.length&&(r&&!o||r&&p)?(0,tt.createElement)(_,b,(0,tt.createElement)(cR,null,pn(er("Template part has been deleted or is unavailable: %s"),r))):y&&l?(0,tt.createElement)(_,b,(0,tt.createElement)(cR,null,er("Block cannot be rendered inside itself."))):(0,tt.createElement)(c,null,(0,tt.createElement)(F7,{tagName:a,setAttributes:t,isEntityAvailable:y,templatePartId:s,defaultWrapper:m}),v&&(0,tt.createElement)(_,b,(0,tt.createElement)(j7,{area:e.area,clientId:n,setAttributes:t,enableSelection:h,hasResolvedReplacements:g})),y&&h&&(0,tt.createElement)(lk,null,(0,tt.createElement)(tb,{className:"wp-block-template-part__block-control-group"},(0,tt.createElement)(Xg,{className:"wp-block-template-part__preview-dropdown-button",contentClassName:"wp-block-template-part__preview-dropdown-content",position:"bottom right left",renderToggle:({isOpen:e,onToggle:t})=>(0,tt.createElement)(jg,{"aria-expanded":e,onClick:t,disabled:e},er("Replace")),renderContent:({onClose:e})=>(0,tt.createElement)(R7,{setAttributes:t,onClose:e,area:f,templatePartId:s})}))),y&&(0,tt.createElement)(V7,{clientId:n,tagName:_,blockProps:b,postId:s,hasInnerBlocks:d.length>0,layout:i}),!v&&!u&&(0,tt.createElement)(_,b,(0,tt.createElement)(cq,null)))}};In("blocks.registerBlockType","core/template-part",(function(e,t){if("core/template-part"!==t)return e;if(!e.variations||!e.variations.length)return{...e,variations:U7};if(e.variations){const t=(e,t)=>{const{area:n,theme:r,slug:o}=e;if(n)return n===t.area;if(!o)return!1;const a=tn(yd).getEntityRecord("postType","wp_template_part",`${r}//${o}`);return(null==a?void 0:a.area)===t.area},n=e.variations.map((e=>{return{...e,...!e.isActive&&{isActive:t},..."string"==typeof e.icon&&{icon:(n=e.icon,"header"===n?AV:"footer"===n?SV:"sidebar"===n?CV:yH)}};var n}));return{...e,variations:n}}return e}));const J7=(0,tt.createElement)(mo,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,tt.createElement)(uo,{d:"M18.1823 11.6392C18.1823 13.0804 17.0139 14.2487 15.5727 14.2487C14.3579 14.2487 13.335 13.4179 13.0453 12.2922L13.0377 12.2625L13.0278 12.2335L12.3985 10.377L12.3942 10.3785C11.8571 8.64997 10.246 7.39405 8.33961 7.39405C5.99509 7.39405 4.09448 9.29465 4.09448 11.6392C4.09448 13.9837 5.99509 15.8843 8.33961 15.8843C8.88499 15.8843 9.40822 15.781 9.88943 15.5923L9.29212 14.0697C8.99812 14.185 8.67729 14.2487 8.33961 14.2487C6.89838 14.2487 5.73003 13.0804 5.73003 11.6392C5.73003 10.1979 6.89838 9.02959 8.33961 9.02959C9.55444 9.02959 10.5773 9.86046 10.867 10.9862L10.8772 10.9836L11.4695 12.7311C11.9515 14.546 13.6048 15.8843 15.5727 15.8843C17.9172 15.8843 19.8178 13.9837 19.8178 11.6392C19.8178 9.29465 17.9172 7.39404 15.5727 7.39404C15.0287 7.39404 14.5066 7.4968 14.0264 7.6847L14.6223 9.20781C14.9158 9.093 15.2358 9.02959 15.5727 9.02959C17.0139 9.02959 18.1823 10.1979 18.1823 11.6392Z"})),Q7=(0,tt.createElement)(mo,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,tt.createElement)(uo,{d:"M17 4h-2v4.5h2V7h3V5.5h-3V4zM4 5.5h9V7H4V5.5zm16 5.75h-9v1.5h9v-1.5zm-16 0h3V10h2v4.25H7v-1.5H4v-1.5zM9 17H4v1.5h5V17zm4 0h7v1.5h-7V20h-2v-4.25h2V17z"}));function Z7({attributes:{query:e,displayLayout:t},setQuery:n,setDisplayLayout:r}){const o=Qk(Z7,"blocks-query-pagination-max-page-input"),a=[{icon:W3,title:er("List view"),onClick:()=>r({type:"list"}),isActive:"list"===(null==t?void 0:t.type)},{icon:MH,title:er("Grid view"),onClick:()=>r({type:"flex",columns:(null==t?void 0:t.columns)||3}),isActive:"flex"===(null==t?void 0:t.type)}];return(0,tt.createElement)(tt.Fragment,null,!e.inherit&&(0,tt.createElement)(tb,null,(0,tt.createElement)(Xg,{contentClassName:"block-library-query-toolbar__popover",renderToggle:({onToggle:e})=>(0,tt.createElement)(jg,{icon:Q7,label:er("Display settings"),onClick:e}),renderContent:()=>(0,tt.createElement)(tt.Fragment,null,(0,tt.createElement)(EA,null,(0,tt.createElement)(BL,{__unstableInputWidth:"60px",label:er("Items per Page"),labelPosition:"edge",min:1,max:100,onChange:e=>{isNaN(e)||e<1||e>100||n({perPage:e})},step:"1",value:e.perPage,isDragEnabled:!1})),(0,tt.createElement)(EA,null,(0,tt.createElement)(BL,{__unstableInputWidth:"60px",label:er("Offset"),labelPosition:"edge",min:0,max:100,onChange:e=>{isNaN(e)||e<0||e>100||n({offset:e})},step:"1",value:e.offset,isDragEnabled:!1})),(0,tt.createElement)(EA,{id:o,help:er("Limit the pages you want to show, even if the query has more results. To show all pages use 0 (zero).")},(0,tt.createElement)(BL,{id:o,__unstableInputWidth:"60px",label:er("Max page to show"),labelPosition:"edge",min:0,onChange:e=>{isNaN(e)||e<0||n({pages:e})},step:"1",value:e.pages,isDragEnabled:!1})))})),(0,tt.createElement)(tb,{controls:a}))}const e8=e=>{const t=null==e?void 0:e.reduce(((e,t)=>{const{mapById:n,mapByName:r,names:o}=e;return n[t.id]=t,r[t.name]=t,o.push(t.name),e}),{mapById:{},mapByName:{},names:[]});return{terms:e,...t}},t8=[{label:er("Include"),value:""},{label:er("Exclude"),value:"exclude"},{label:er("Only"),value:"only"}];function n8({attributes:{query:e,displayLayout:t},setQuery:n,setDisplayLayout:r}){var o,a;const{order:i,orderBy:s,author:l,postType:c,sticky:u,inherit:d}=e,[p,m]=(0,tt.useState)(!0),[f,h]=(0,tt.useState)(!0),[g,b]=(0,tt.useState)("post"===c),{postTypesTaxonomiesMap:v,postTypesSelectOptions:y}=(()=>{const{postTypes:e}=Tl((e=>{var t;const{getPostTypes:n}=e(yd),r=["attachment"];return{postTypes:null===(t=n({per_page:-1}))||void 0===t?void 0:t.filter((({viewable:e,slug:t})=>e&&!r.includes(t)))}}),[]);return{postTypesTaxonomiesMap:(0,tt.useMemo)((()=>{if(null!=e&&e.length)return e.reduce(((e,t)=>(e[t.slug]=t.taxonomies,e)),{})}),[e]),postTypesSelectOptions:(0,tt.useMemo)((()=>(e||[]).map((({labels:e,slug:t})=>({label:e.singular_name,value:t})))),[e])}})(),{authorList:_,categories:M,tags:k}=Tl((e=>{const{getEntityRecords:t}=e(yd),n={per_page:100},r=t("taxonomy","category",n),o=t("taxonomy","post_tag",n);return{categories:e8(r),tags:e8(o),authorList:t("root","user",{per_page:-1})}}),[]);(0,tt.useEffect)((()=>{if(!v)return;const e=v[c];m(e.includes("category")),h(e.includes("post_tag"))}),[c,v]),(0,tt.useEffect)((()=>{b("post"===c)}),[c]);const w=(e,t)=>r=>{const o=Array.from(r.reduce(((t,n)=>{const r=((e,t)=>{var n;const r=(null==t?void 0:t.id)||(null===(n=e[t])||void 0===n?void 0:n.id);if(r)return r;const o=t.toLocaleLowerCase();for(const t in e)if(t.toLocaleLowerCase()===o)return e[t].id})(e.mapByName,n);return r&&t.add(r),t}),new Set));n({[t]:o})},E=w(M,"categoryIds"),L=w(k,"tagIds"),[A,S]=(0,tt.useState)(e.search),C=(0,tt.useCallback)((0,at.debounce)((()=>{e.search!==A&&n({search:A})}),250),[A,e.search]);(0,tt.useEffect)((()=>(C(),C.cancel)),[A,C]);const T=t=>{const n={category:{queryProp:"categoryIds",terms:M},post_tag:{queryProp:"tagIds",terms:k}}[t];return(e[n.queryProp]||[]).reduce(((e,t)=>{const r=n.terms.mapById[t];return r&&e.push({id:t,value:r.name}),e}),[])};return(0,tt.createElement)(FA,null,(0,tt.createElement)(BA,{title:er("Settings")},(0,tt.createElement)(KN,{label:er("Inherit query from template"),help:er("Toggle to use the global query context that is set with the current template, such as an archive or search. Disable to customize the settings independently."),checked:!!d,onChange:e=>n({inherit:!!e})}),!d&&(0,tt.createElement)(KS,{options:y,value:c,label:er("Post Type"),onChange:e=>{const t={postType:e};v[e].includes("category")||(t.categoryIds=[]),v[e].includes("post_tag")||(t.tagIds=[]),"post"!==e&&(t.sticky=""),n(t)},help:er('WordPress contains different types of content and they are divided into collections called "Post Types". By default there are a few different ones such as blog posts and pages, but plugins could add more.')}),"flex"===(null==t?void 0:t.type)&&(0,tt.createElement)(tt.Fragment,null,(0,tt.createElement)(rT,{label:er("Columns"),value:t.columns,onChange:e=>r({columns:e}),min:2,max:Math.max(6,t.columns)}),t.columns>6&&(0,tt.createElement)(RT,{status:"warning",isDismissible:!1},er("This column count exceeds the recommended amount and may cause visual breakage."))),!d&&(0,tt.createElement)(Y3,{order:i,orderBy:s,onOrderChange:e=>n({order:e}),onOrderByChange:e=>n({orderBy:e})}),g&&(0,tt.createElement)(KS,{label:er("Sticky posts"),options:t8,value:u,onChange:e=>n({sticky:e}),help:er('Blog posts can be "stickied", a feature that places them at the top of the front page of posts, keeping it there until new sticky posts are published.')})),!d&&(0,tt.createElement)(BA,{title:er("Filters")},p&&(null==M||null===(o=M.terms)||void 0===o?void 0:o.length)>0&&(0,tt.createElement)(P3,{label:er("Categories"),value:T("category"),suggestions:M.names,onChange:E}),f&&(null==k||null===(a=k.terms)||void 0===a?void 0:a.length)>0&&(0,tt.createElement)(P3,{label:er("Tags"),value:T("post_tag"),suggestions:k.names,onChange:L}),(0,tt.createElement)(Y3,{selectedAuthorId:l,authorList:_,onAuthorChange:e=>n({author:""!==e?+e:void 0})}),(0,tt.createElement)(LA,{label:er("Keyword"),value:A,onChange:S})))}const r8=({clientId:e,name:t,attributes:n,setAttributes:r})=>{var o;const{blockType:a,defaultVariation:i,scopeVariations:s,allVariations:l}=Tl((e=>{const{getBlockVariations:n,getBlockType:r,getDefaultBlockVariation:o}=e(Gr);return{blockType:r(t),defaultVariation:o(t,"block"),scopeVariations:n(t,"block"),allVariations:n(t)}}),[t]),{replaceInnerBlocks:c}=ld(nk),u=VR(),d=aF(n,l),p=(null==d?void 0:d.icon)||(null==a||null===(o=a.icon)||void 0===o?void 0:o.src),m=(null==d?void 0:d.title)||(null==a?void 0:a.title);return(0,tt.createElement)("div",u,(0,tt.createElement)(_H,{icon:p,label:m,variations:s,onSelect:(t=i)=>{t.attributes&&r(t.attributes),t.innerBlocks&&c(e,qo(t.innerBlocks),!1)}}))},o8=[["core/post-template"]];function a8({attributes:e,setAttributes:t}){const{queryId:n,query:r,displayLayout:o,tagName:a="div",layout:i={}}=e,{__unstableMarkNextChangeAsNotPersistent:s}=ld(nk),l=Qk(a8),{themeSupportsLayout:c}=Tl((e=>{var t;const{getSettings:n}=e(nk);return{themeSupportsLayout:null===(t=n())||void 0===t?void 0:t.supportsLayout}}),[]),u=JL("layout")||{},d=i&&i.inherit?u:i,p=GH(VR(),{template:o8,__experimentalLayout:c?d:void 0}),{postsPerPage:m}=Tl((e=>{const{getSettings:t}=e(nk);return{postsPerPage:+t().postsPerPage||3}}),[]);(0,tt.useEffect)((()=>{const e={};!r.perPage&&m&&(e.perPage=m),Object.keys(e).length&&(s(),f(e))}),[r.perPage]),(0,tt.useEffect)((()=>{n||(s(),t({queryId:l}))}),[n,l]);const f=e=>t({query:{...r,...e}}),h=e=>t({displayLayout:{...o,...e}});return(0,tt.createElement)(tt.Fragment,null,(0,tt.createElement)(n8,{attributes:e,setQuery:f,setDisplayLayout:h}),(0,tt.createElement)(lk,null,(0,tt.createElement)(Z7,{attributes:e,setQuery:f,setDisplayLayout:h})),(0,tt.createElement)(WA,null,(0,tt.createElement)(KS,{label:er("HTML element"),options:[{label:er("Default (
)"),value:"div"},{label:"
",value:"main"},{label:"",value:"section"},{label:"",value:"aside"}],value:a,onChange:e=>t({tagName:e})})),(0,tt.createElement)(a,p))}function i8(e){const{clientId:t,name:n}=e,r=VR(),{replaceBlock:o,selectBlock:a}=ld(nk);return(0,tt.createElement)("div",r,(0,tt.createElement)(zH,{blockName:n,clientId:t,startBlankComponent:(0,tt.createElement)(r8,e),onBlockPatternSelect:e=>{const n=e.map((e=>Fo(e))),r=(e=>{const t=[...e];for(;t.length>0;){var n;const e=t.shift();if("core/query"===e.name)return e.clientId;null===(n=e.innerBlocks)||void 0===n||n.forEach((e=>{t.push(e)}))}})(n);o(t,n),r&&a(r)}}))}const s8=e=>{const{clientId:t}=e,n=Tl((e=>!!e(nk).getBlocks(t).length),[t])?a8:i8;return(0,tt.createElement)(n,e)};const l8=(0,tt.createElement)(mo,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 48 48"},(0,tt.createElement)(uo,{d:"M41 9H7v3h34V9zm-22 5H7v1h12v-1zM7 26h12v1H7v-1zm34-5H7v3h34v-3zM7 38h12v1H7v-1zm34-5H7v3h34v-3z"})),c8=(0,tt.createElement)(mo,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 48 48"},(0,tt.createElement)(uo,{d:"M41 9H7v3h34V9zm-4 5H7v1h30v-1zm4 3H7v1h34v-1zM7 20h30v1H7v-1zm0 12h30v1H7v-1zm34 3H7v1h34v-1zM7 38h30v1H7v-1zm34-11H7v3h34v-3z"})),u8=(0,tt.createElement)(mo,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 48 48"},(0,tt.createElement)(uo,{d:"M41 9H7v3h34V9zm-22 5H7v1h12v-1zm22 3H7v1h34v-1zM7 20h34v1H7v-1zm0 12h12v1H7v-1zm34 3H7v1h34v-1zM7 38h34v1H7v-1zm34-11H7v3h34v-3z"})),d8=(0,tt.createElement)(mo,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 48 48"},(0,tt.createElement)(uo,{d:"M7 9h34v6H7V9zm12 8H7v1h12v-1zm18 3H7v1h30v-1zm0 18H7v1h30v-1zM7 35h12v1H7v-1zm34-8H7v6h34v-6z"})),p8={query:{perPage:3,pages:0,offset:0,postType:"post",categoryIds:[],tagIds:[],order:"desc",orderBy:"date",author:"",search:"",exclude:[],sticky:"",inherit:!1}},m8=[{name:"posts-list",title:er("Posts List"),description:er("Display a list of your most recent posts, excluding sticky posts."),icon:k3,attributes:{query:{perPage:4,pages:1,offset:0,postType:"post",categoryIds:[],tagIds:[],order:"desc",orderBy:"date",author:"",search:"",sticky:"exclude",inherit:!1}},scope:["inserter"]},{name:"title-date",title:er("Title & Date"),icon:l8,attributes:{...p8},innerBlocks:[["core/post-template",{},[["core/post-title"],["core/post-date"]]]],scope:["block"]},{name:"title-excerpt",title:er("Title & Excerpt"),icon:c8,attributes:{...p8},innerBlocks:[["core/post-template",{},[["core/post-title"],["core/post-excerpt"]]]],scope:["block"]},{name:"title-date-excerpt",title:er("Title, Date, & Excerpt"),icon:u8,attributes:{...p8},innerBlocks:[["core/post-template",{},[["core/post-title"],["core/post-date"],["core/post-excerpt"]]]],scope:["block"]},{name:"image-date-title",title:er("Image, Date, & Title"),icon:d8,attributes:{...p8},innerBlocks:[["core/post-template",{},[["core/post-featured-image"],["core/post-date"],["core/post-title"]]]],scope:["block"]}],f8=[{attributes:{queryId:{type:"number"},query:{type:"object",default:{perPage:null,pages:0,offset:0,postType:"post",categoryIds:[],tagIds:[],order:"desc",orderBy:"date",author:"",search:"",exclude:[],sticky:"",inherit:!0}},layout:{type:"object",default:{type:"list"}}},supports:{html:!1},migrate:e=>({...(0,at.omit)(e,["layout"]),displayLayout:e.layout}),save:()=>(0,tt.createElement)(JH.Content,null)}],h8=({attributes:{query:{postType:e}={}}={}})=>{if(!e)return null;const t=Pl("post-new.php",{post_type:e});return(0,tt.createElement)("div",{className:"wp-block-query__create-new-link"},TP(er("Create a new post for this feed."),{a:(0,tt.createElement)("a",{href:t})}))},g8=ri((e=>t=>{const{name:n,isSelected:r}=t;return"core/query"===n&&r?(0,tt.createElement)(tt.Fragment,null,(0,tt.createElement)(FA,null,(0,tt.createElement)(h8,t)),(0,tt.createElement)(e,ot({key:"edit"},t))):(0,tt.createElement)(e,ot({key:"edit"},t))}),"withInspectorControls"),b8={apiVersion:2,name:"core/query",title:"Query Loop",category:"theme",description:"An advanced block that allows displaying post types based on different query parameters and visual configurations.",textdomain:"default",attributes:{queryId:{type:"number"},query:{type:"object",default:{perPage:null,pages:0,offset:0,postType:"post",categoryIds:[],tagIds:[],order:"desc",orderBy:"date",author:"",search:"",exclude:[],sticky:"",inherit:!0}},tagName:{type:"string",default:"div"},displayLayout:{type:"object",default:{type:"list"}}},providesContext:{queryId:"queryId",query:"query",displayLayout:"displayLayout"},supports:{align:["wide","full"],html:!1,color:{gradients:!0,link:!0},__experimentalLayout:!0},editorStyle:"wp-block-query-editor"},{name:v8}=b8,y8={icon:J7,edit:s8,save:function({attributes:{tagName:e="div"}}){return(0,tt.createElement)(e,VR.save(),(0,tt.createElement)(JH.Content,null))},variations:m8,deprecated:f8};In("editor.BlockEdit","core/query",g8);const _8=[["core/post-title"],["core/post-date"],["core/post-excerpt"]];const M8={apiVersion:2,name:"core/post-template",title:"Post Template",category:"design",parent:["core/query"],description:"Contains the block elements used to render a post, like the title, date, featured image, content or excerpt, and more.",textdomain:"default",usesContext:["queryId","query","queryContext","displayLayout","templateSlug"],supports:{reusable:!1,html:!1,align:!0},style:"wp-block-post-template",editorStyle:"wp-block-post-template-editor"},{name:k8}=M8,w8={icon:J7,edit:function({clientId:e,context:{query:{perPage:t,offset:n,categoryIds:r=[],postType:o,tagIds:a=[],order:i,orderBy:s,author:l,search:c,exclude:u,sticky:d,inherit:p}={},queryContext:m=[{page:1}],templateSlug:f,displayLayout:{type:h="flex",columns:g=1}={}}}){const[{page:b}]=m,[v,y]=(0,tt.useState)(),{posts:_,blocks:M}=Tl((m=>{const{getEntityRecords:h}=m(yd),{getBlocks:g}=m(nk),v={offset:t?t*(b-1)+n:0,categories:r,tags:a,order:i,orderby:s};return t&&(v.per_page=t),l&&(v.author=l),c&&(v.search=c),null!=u&&u.length&&(v.exclude=u),d&&(v.sticky="only"===d),p&&null!=f&&f.startsWith("archive-")&&(v.postType=f.replace("archive-",""),o=v.postType),{posts:h("postType",o,v),blocks:g(e)}}),[t,b,n,r,a,i,s,e,l,c,o,u,d,p,f]),k=(0,tt.useMemo)((()=>null==_?void 0:_.map((e=>({postType:e.type,postId:e.id})))),[_]),w="flex"===h&&g>1,E=VR({className:so()({"is-flex-container":w,[`columns-${g}`]:w})}),L=GH({},{template:_8});return _?_.length?(0,tt.createElement)("ul",E,k&&k.map((e=>(0,tt.createElement)(yB,{key:e.postId,value:e},e===(v||k[0])?(0,tt.createElement)("li",L):(0,tt.createElement)("li",null,(0,tt.createElement)(lW,{blocks:M,__experimentalLive:!0,__experimentalOnClick:()=>y(e)})))))):(0,tt.createElement)("p",E," ",er("No results found.")):(0,tt.createElement)("p",E,(0,tt.createElement)(cq,null))},save:function(){return(0,tt.createElement)(JH.Content,null)}},E8=["archive"];const L8=(0,tt.createElement)(mo,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,tt.createElement)(uo,{stroke:"#1E1E1E",strokeWidth:"1.5",d:"M4 19.25h9M4 15.25h16"}),(0,tt.createElement)(uo,{d:"M8.994 10.103H6.08L5.417 12H4l2.846-8h1.383l2.845 8H9.657l-.663-1.897zm-.457-1.28l-.994-2.857-1.006 2.857h2z",fill:"#1E1E1E"})),A8=[{isDefault:!0,name:"archive-title",title:er("Archive Title"),description:er("Display the archive title based on the queried object."),icon:L8,attributes:{type:"archive"},scope:["inserter"]}];A8.forEach((e=>{e.isActive||(e.isActive=(e,t)=>e.type===t.type)}));const S8=A8,C8={apiVersion:2,name:"core/query-title",title:"Query Title",category:"design",description:"Display the query title.",textdomain:"default",attributes:{type:{type:"string"},textAlign:{type:"string"},level:{type:"number",default:1}},supports:{align:["wide","full"],html:!1,color:{gradients:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0}},editorStyle:"wp-block-query-title-editor"},{name:T8}=C8,x8={edit:function({attributes:{type:e,level:t,textAlign:n},setAttributes:r}){const o=`h${t}`,a=VR({className:so()({[`has-text-align-${n}`]:n,"wp-block-query-title__placeholder":"archive"===e})});if(!E8.includes(e))return(0,tt.createElement)("div",a,(0,tt.createElement)(cR,null,er("Provided type is not supported.")));let i;return"archive"===e&&(i=(0,tt.createElement)(o,a,er("Archive title"))),(0,tt.createElement)(tt.Fragment,null,(0,tt.createElement)(lk,{group:"block"},(0,tt.createElement)(FJ,{selectedLevel:t,onChange:e=>r({level:e})}),(0,tt.createElement)(gD,{value:n,onChange:e=>{r({textAlign:e})}})),i)},variations:S8},z8=(0,tt.createElement)(mo,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,tt.createElement)(po,{x:"4",y:"10.5",width:"6",height:"3",rx:"1.5",fill:"#000"}),(0,tt.createElement)(po,{x:"12",y:"10.5",width:"3",height:"3",rx:"1.5",fill:"#000"}),(0,tt.createElement)(po,{x:"17",y:"10.5",width:"3",height:"3",rx:"1.5",fill:"#000"})),O8=[["core/query-pagination-previous"],["core/query-pagination-numbers"],["core/query-pagination-next"]];const N8={apiVersion:2,name:"core/query-pagination",title:"Query Pagination",category:"design",parent:["core/query"],description:"Displays a paginated navigation to next/previous set of posts, when applicable.",textdomain:"default",usesContext:["queryId","query"],supports:{align:!0,reusable:!1,html:!1,color:{gradients:!0,link:!0}},editorStyle:"wp-block-query-pagination-editor",style:"wp-block-query-pagination"},{name:D8}=N8,B8={icon:z8,edit:function(){const e=GH(VR(),{template:O8,allowedBlocks:["core/query-pagination-previous","core/query-pagination-numbers","core/query-pagination-next"],orientation:"horizontal"});return(0,tt.createElement)("div",e)},save:function(){return(0,tt.createElement)("div",VR.save(),(0,tt.createElement)(JH.Content,null))}},I8=(0,tt.createElement)(mo,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,tt.createElement)(po,{x:"6",y:"10.5",width:"3",height:"3",rx:"1.5",fill:"#000"}),(0,tt.createElement)(po,{x:"11",y:"10.5",width:"3",height:"3",rx:"1.5",fill:"#000"}),(0,tt.createElement)(uo,{d:"M16.5 9.5L19 12l-2.5 2.5",stroke:"#1E1E1E",strokeWidth:"1.5"}));const P8={apiVersion:2,name:"core/query-pagination-next",title:"Query Pagination Next",category:"design",parent:["core/query-pagination"],description:"Displays the next posts page link.",textdomain:"default",attributes:{label:{type:"string"}},usesContext:["queryId","query"],supports:{reusable:!1,html:!1,color:{gradients:!0,link:!0},typography:{fontSize:!0,lineHeight:!0}}},{name:R8}=P8,Y8={icon:I8,edit:function({attributes:{label:e},setAttributes:t}){return(0,tt.createElement)(zj,ot({__experimentalVersion:2,tagName:"a","aria-label":er("Next page link"),placeholder:er("Next Page"),value:e,onChange:e=>t({label:e})},VR()))}},W8=(0,tt.createElement)(mo,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,tt.createElement)(po,{x:"4",y:"10.5",width:"6",height:"3",rx:"1.5",fill:"#000"}),(0,tt.createElement)(uo,{d:"M13.5 14v-4l-1.5.5",stroke:"#1E1E1E"}),(0,tt.createElement)(uo,{d:"M19.266 9.805c-.473-.611-1.22-.51-1.702-.367a3.854 3.854 0 00-.718.307l.13 1.082c.192-.17.47-.422.782-.515.34-.1.578.025.668.141.21.27-.034.835-.16 1.055-.49.85-.93 1.594-1.45 2.492H19.5v-1h-.914c.277-.574.814-1.443.914-2.106.052-.343.02-.762-.234-1.09z",fill:"#1E1E1E"})),H8=(e,t="a",n="")=>(0,tt.createElement)(t,{className:`page-numbers ${n}`},e);const q8={apiVersion:2,name:"core/query-pagination-numbers",title:"Query Pagination Numbers",category:"design",parent:["core/query-pagination"],description:"Displays a list of page numbers for pagination",textdomain:"default",usesContext:["queryId","query"],supports:{reusable:!1,html:!1},editorStyle:"query-pagination-numbers-editor"},{name:j8}=q8,F8={icon:W8,edit:function(){const e=(0,tt.createElement)(tt.Fragment,null,H8(1),H8(2),H8(3,"span","current"),H8(4),H8(5),H8("...","span","dots"),H8(8));return(0,tt.createElement)("div",VR(),e)}},V8=(0,tt.createElement)(mo,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,tt.createElement)(po,{x:"18",y:"13.5",width:"3",height:"3",rx:"1.5",transform:"rotate(-180 18 13.5)",fill:"#000"}),(0,tt.createElement)(po,{x:"13",y:"13.5",width:"3",height:"3",rx:"1.5",transform:"rotate(-180 13 13.5)",fill:"#000"}),(0,tt.createElement)(uo,{d:"M7.5 14.5L5 12l2.5-2.5",stroke:"#1E1E1E",strokeWidth:"1.5"}));const X8={apiVersion:2,name:"core/query-pagination-previous",title:"Query Pagination Previous",category:"design",parent:["core/query-pagination"],description:"Displays the previous posts page link.",textdomain:"default",attributes:{label:{type:"string"}},usesContext:["queryId","query"],supports:{reusable:!1,html:!1,color:{gradients:!0,link:!0},typography:{fontSize:!0,lineHeight:!0}}},{name:U8}=X8,$8={icon:V8,edit:function({attributes:{label:e},setAttributes:t}){return(0,tt.createElement)(zj,ot({__experimentalVersion:2,tagName:"a","aria-label":er("Previous page link"),placeholder:er("Previous Page"),value:e,onChange:e=>t({label:e})},VR()))}};const K8=(0,tt.createElement)(mo,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,tt.createElement)(uo,{d:"M6.6 6L5.4 7l4.5 5-4.5 5 1.1 1 5.5-6-5.4-6zm6 0l-1.1 1 4.5 5-4.5 5 1.1 1 5.5-6-5.5-6z"})),G8=(0,tt.createElement)(mo,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,tt.createElement)(uo,{d:"M11.6 7l-1.1-1L5 12l5.5 6 1.1-1L7 12l4.6-5zm6 0l-1.1-1-5.5 6 5.5 6 1.1-1-4.6-5 4.6-5z"})),J8=[{isDefault:!0,name:"post-next",title:er("Next post"),description:er("Displays the post link that follows the current post."),icon:K8,attributes:{type:"next"},scope:["inserter","transform"]},{name:"post-previous",title:er("Previous post"),description:er("Displays the post link that precedes the current post."),icon:G8,attributes:{type:"previous"},scope:["inserter","transform"]}];J8.forEach((e=>{e.isActive||(e.isActive=(e,t)=>e.type===t.type)}));const Q8=J8,Z8={apiVersion:2,name:"core/post-navigation-link",title:"Post Navigation Link",category:"theme",description:"Displays the next or previous post link that is adjacent to the current post.",textdomain:"default",attributes:{textAlign:{type:"string"},type:{type:"string",default:"next"},label:{type:"string"},showTitle:{type:"boolean",default:!1}},supports:{reusable:!1,html:!1}},{name:e9}=Z8,t9={edit:function({attributes:{type:e,label:t,showTitle:n,textAlign:r},setAttributes:o}){const a="next"===e,i=er(a?"Next":"Previous"),s=er(a?"Next post":"Previous post"),l=VR({className:so()({[`has-text-align-${r}`]:r})});return(0,tt.createElement)(tt.Fragment,null,(0,tt.createElement)(FA,null,(0,tt.createElement)(BA,null,(0,tt.createElement)(KN,{label:er("Display the title as a link"),help:er("If you have entered a custom label, it will be prepended before the title."),checked:!!n,onChange:()=>o({showTitle:!n})}))),(0,tt.createElement)(lk,null,(0,tt.createElement)(bD,{value:r,onChange:e=>{o({textAlign:e})}})),(0,tt.createElement)("div",l,(0,tt.createElement)(Cj,{tagName:"a","aria-label":s,placeholder:i,value:t,allowedFormats:["core/bold","core/italic"],onChange:e=>o({label:e})})))},variations:Q8};function n9(e,t,n){return Tl((r=>r(yd).canUserEditEntityRecord(e,t,n)),[e,t,n])}const r9={apiVersion:2,name:"core/post-title",title:"Post Title",category:"theme",description:"Displays the title of a post, page, or any other content-type.",textdomain:"default",usesContext:["postId","postType","queryId"],attributes:{textAlign:{type:"string"},level:{type:"number",default:2},isLink:{type:"boolean",default:!1},rel:{type:"string",attribute:"rel",default:""},linkTarget:{type:"string",default:"_self"}},supports:{align:["wide","full"],html:!1,color:{gradients:!0,link:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0}},style:"wp-block-post-title"},{name:o9}=r9,a9={icon:r3,edit:function({attributes:{level:e,textAlign:t,isLink:n,rel:r,linkTarget:o},setAttributes:a,context:{postType:i,postId:s,queryId:l}}){const c=0===e?"p":"h"+e,u=!!l,d=n9("postType",i,s),[p="",m,f]=md("postType",i,"title",s),[h]=md("postType",i,"link",s),g=VR({className:so()({[`has-text-align-${t}`]:t})});let b=(0,tt.createElement)(c,n?{}:g,er("An example title"));return i&&s&&(b=d&&!u?(0,tt.createElement)(zj,ot({tagName:c,placeholder:er("No Title"),value:p,onChange:m,__experimentalVersion:2},n?{}:g)):(0,tt.createElement)(c,n?{}:g,(0,tt.createElement)(Pa,{key:"html"},f.rendered))),n&&(b=d&&!u?(0,tt.createElement)(c,g,(0,tt.createElement)(zj,{tagName:"a",href:h,target:o,rel:r,placeholder:p.length?null:er("No Title"),value:p,onChange:m,__experimentalVersion:2})):(0,tt.createElement)(c,g,(0,tt.createElement)("a",{href:h,target:o,rel:r,onClick:e=>e.preventDefault()},(0,tt.createElement)(Pa,{key:"html"},f.rendered)))),(0,tt.createElement)(tt.Fragment,null,(0,tt.createElement)(lk,{group:"block"},(0,tt.createElement)(FJ,{selectedLevel:e,onChange:e=>a({level:e})}),(0,tt.createElement)(gD,{value:t,onChange:e=>{a({textAlign:e})}})),(0,tt.createElement)(FA,null,(0,tt.createElement)(BA,{title:er("Link settings")},(0,tt.createElement)(KN,{label:er("Make title a link"),onChange:()=>a({isLink:!n}),checked:n}),n&&(0,tt.createElement)(tt.Fragment,null,(0,tt.createElement)(KN,{label:er("Open in new tab"),onChange:e=>a({linkTarget:e?"_blank":"_self"}),checked:"_blank"===o}),(0,tt.createElement)(LA,{label:er("Link rel"),value:r,onChange:e=>a({rel:e})})))),b)}},i9=(0,tt.createElement)(mo,{xmlns:"https://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,tt.createElement)(uo,{d:"M4 20h16v-1.5H4V20zm0-4.8h16v-1.5H4v1.5zm0-6.4v1.5h16V8.8H4zM16 4H4v1.5h12V4z"}));function s9({userCanEdit:e,postType:t,postId:n}){const[,,r]=md("postType",t,"content",n),o=VR();return null!=r&&r.protected&&!e?(0,tt.createElement)("div",o,(0,tt.createElement)(cR,null,er("This content is password protected."))):(0,tt.createElement)("div",o,(0,tt.createElement)(Pa,{key:"html"},null==r?void 0:r.rendered))}function l9({layout:e,context:t={}}){const{postType:n,postId:r}=t,o=Tl((e=>{var t;const{getSettings:n}=e(nk);return null===(t=n())||void 0===t?void 0:t.supportsLayout}),[]),a=JL("layout")||{},i=e&&e.inherit?a:e,[s,l,c]=fd("postType",n,{id:r}),u=GH(VR({className:"entry-content"}),{value:s,onInput:l,onChange:c,__experimentalLayout:o?i:void 0});return(0,tt.createElement)("div",u)}function c9(e){const{context:{queryId:t,postType:n,postId:r}={}}=e,o=!!t,a=n9("postType",n,r);return a&&!o?(0,tt.createElement)(l9,e):(0,tt.createElement)(s9,{userCanEdit:a,postType:n,postId:r})}function u9(){const e=VR();return(0,tt.createElement)("div",e,(0,tt.createElement)("div",{className:"wp-block-post-content__placeholder"},(0,tt.createElement)("span",null,er("This is a placeholder for post content."))))}function d9(){const e=VR();return(0,tt.createElement)("div",e,(0,tt.createElement)(cR,null,er("Block cannot be rendered inside itself.")))}const p9={apiVersion:2,name:"core/post-content",title:"Post Content",category:"theme",description:"Displays the contents of a post or page.",textdomain:"default",usesContext:["postId","postType","queryId"],supports:{align:["wide","full"],html:!1,__experimentalLayout:!0},editorStyle:"wp-block-post-content-editor"},{name:m9}=p9,f9={icon:i9,edit:function({context:e,attributes:t}){const{postId:n,postType:r}=e,{layout:o={}}=t,[a,i]=DF(n);return n&&r&&a?(0,tt.createElement)(d9,null):(0,tt.createElement)(i,null,n&&r?(0,tt.createElement)(c9,{context:e,layout:o}):(0,tt.createElement)(u9,null))}};const h9=function({isSelected:e,context:{postType:t,postId:n,queryId:r},attributes:o,setAttributes:a}){const i=!!r,{authorId:s,authorDetails:l,authors:c}=Tl((e=>{var r;const{getEditedEntityRecord:o,getUser:a,getUsers:i}=e(yd),s=null===(r=o("postType",t,n))||void 0===r?void 0:r.author;return{authorId:s,authorDetails:s?a(s):null,authors:i({who:"authors"})}}),[t,n]),{editEntityRecord:u}=ld(yd),{textAlign:d,showAvatar:p,showBio:m,byline:f}=o,h=[];l&&(0,at.forEach)(l.avatar_urls,((e,t)=>{h.push({value:t,label:`${t} x ${t}`})}));const g=VR({className:so()({[`has-text-align-${d}`]:d})});return(0,tt.createElement)(tt.Fragment,null,(0,tt.createElement)(FA,null,(0,tt.createElement)(BA,{title:er("Author Settings")},!i&&!(null==c||!c.length)&&(0,tt.createElement)(KS,{label:er("Author"),value:s,options:c.map((({id:e,name:t})=>({value:e,label:t}))),onChange:e=>{u("postType",t,n,{author:e})}}),(0,tt.createElement)(KN,{label:er("Show avatar"),checked:p,onChange:()=>a({showAvatar:!p})}),p&&(0,tt.createElement)(KS,{label:er("Avatar size"),value:o.avatarSize,options:h,onChange:e=>{a({avatarSize:Number(e)})}}),(0,tt.createElement)(KN,{label:er("Show bio"),checked:m,onChange:()=>a({showBio:!m})}))),(0,tt.createElement)(lk,{group:"block"},(0,tt.createElement)(gD,{value:d,onChange:e=>{a({textAlign:e})}})),(0,tt.createElement)("div",g,p&&l&&(0,tt.createElement)("div",{className:"wp-block-post-author__avatar"},(0,tt.createElement)("img",{width:o.avatarSize,src:l.avatar_urls[o.avatarSize],alt:l.name})),(0,tt.createElement)("div",{className:"wp-block-post-author__content"},(!Cj.isEmpty(f)||e)&&(0,tt.createElement)(Cj,{className:"wp-block-post-author__byline",multiline:!1,"aria-label":er("Post author byline text"),placeholder:er("Write byline…"),value:f,onChange:e=>a({byline:e})}),(0,tt.createElement)("p",{className:"wp-block-post-author__name"},(null==l?void 0:l.name)||er("Post Author")),m&&(0,tt.createElement)("p",{className:"wp-block-post-author__bio"},null==l?void 0:l.description))))},g9=(0,tt.createElement)(mo,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,tt.createElement)(uo,{d:"M10 4.5a1 1 0 11-2 0 1 1 0 012 0zm1.5 0a2.5 2.5 0 11-5 0 2.5 2.5 0 015 0zm2.25 7.5v-1A2.75 2.75 0 0011 8.25H7A2.75 2.75 0 004.25 11v1h1.5v-1c0-.69.56-1.25 1.25-1.25h4c.69 0 1.25.56 1.25 1.25v1h1.5zM4 20h9v-1.5H4V20zm16-4H4v-1.5h16V16z",fillRule:"evenodd",clipRule:"evenodd"})),b9={apiVersion:2,name:"core/post-author",title:"Post Author",category:"theme",description:"Add the author of this post.",textdomain:"default",attributes:{textAlign:{type:"string"},avatarSize:{type:"number",default:48},showAvatar:{type:"boolean",default:!0},showBio:{type:"boolean"},byline:{type:"string"}},usesContext:["postType","postId","queryId"],supports:{html:!1,typography:{fontSize:!0,lineHeight:!0},color:{gradients:!0,link:!0}},editorStyle:"wp-block-post-author-editor",style:"wp-block-post-author"},{name:v9}=b9,y9={icon:g9,edit:h9},_9=["core/post-comment-content","core/post-comment-author"];const M9={apiVersion:2,name:"core/post-comment",title:"Post Comment",category:"theme",description:"Post comment.",textdomain:"default",attributes:{commentId:{type:"number"}},providesContext:{commentId:"commentId"},supports:{html:!1}},{name:k9}=M9,w9={icon:v3,edit:function({attributes:e,setAttributes:t}){const{commentId:n}=e,[r,o]=(0,tt.useState)(n),a=VR();return n?(0,tt.createElement)("div",a,(0,tt.createElement)(JH,{allowedBlocks:_9})):(0,tt.createElement)("div",a,(0,tt.createElement)(vH,{icon:fo,label:er("Post Comment"),instructions:er("To show a comment, input the comment ID.")},(0,tt.createElement)(LA,{value:n,onChange:e=>o(parseInt(e))}),(0,tt.createElement)(Eh,{variant:"primary",onClick:()=>{t({commentId:r})}},er("Save"))))},save:function(){return(0,tt.createElement)("div",VR.save(),(0,tt.createElement)(JH.Content,null))}};const E9={apiVersion:2,name:"core/post-comment-author",title:"Post Comment Author",category:"design",parent:["core/post-comment"],description:"Post comment author.",textdomain:"default",usesContext:["commentId"],supports:{html:!1}},{name:L9}=E9,A9={icon:g9,edit:function({attributes:e,context:t}){const{className:n}=e,{commentId:r}=t,o=Tl((e=>{const{getEntityRecord:t}=e(yd),n=t("root","comment",r),o=null==n?void 0:n.author_name;if(n&&!o){var a;const e=t("root","user",n.author);return null!==(a=null==e?void 0:e.name)&&void 0!==a?a:er("Anonymous")}return null!=o?o:""}));return(0,tt.createElement)("div",VR(),(0,tt.createElement)("p",{className:n},o))}};const S9={apiVersion:2,name:"core/post-comment-content",title:"Post Comment Content",category:"design",parent:["core/post-comment"],description:"Post comment content",textdomain:"default",usesContext:["commentId"],supports:{html:!1}},{name:C9}=S9,T9={icon:i9,edit:function({attributes:e,context:t}){const{className:n}=e,{commentId:r}=t,[o]=md("root","comment","content",r);return(0,tt.createElement)("div",VR(),(0,tt.createElement)("p",{className:n},o))}},x9=(0,tt.createElement)(mo,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,tt.createElement)(uo,{d:"M11.696 13.972c.356-.546.599-.958.728-1.235a1.79 1.79 0 00.203-.783c0-.264-.077-.47-.23-.618-.148-.153-.354-.23-.618-.23-.295 0-.569.07-.82.212a3.413 3.413 0 00-.738.571l-.147-1.188c.289-.234.59-.41.903-.526.313-.117.66-.175 1.041-.175.375 0 .695.08.959.24.264.153.46.362.59.626.135.265.203.556.203.876 0 .362-.08.734-.24 1.115-.154.381-.427.87-.82 1.466l-.756 1.152H14v1.106h-4l1.696-2.609z"}),(0,tt.createElement)(uo,{d:"M19.5 7h-15v12a.5.5 0 00.5.5h14a.5.5 0 00.5-.5V7zM3 7V5a2 2 0 012-2h14a2 2 0 012 2v14a2 2 0 01-2 2H5a2 2 0 01-2-2V7z"}));const z9={apiVersion:2,name:"core/post-comment-date",title:"Post Comment Date",category:"design",parent:["core/post-comment"],description:"Post comment date.",textdomain:"default",attributes:{format:{type:"string"}},usesContext:["commentId"],supports:{html:!1}},{name:O9}=z9,N9={icon:x9,edit:function({attributes:e,context:t,setAttributes:n}){const{className:r,format:o}=e,{commentId:a}=t,i=dV(),[s]=md("root","site","date_format"),[l]=md("root","comment","date",a),c=Object.values(i.formats).map((e=>({key:e,name:hV(e,l)}))),u=o||s||i.formats.date,d=VR({className:r});return(0,tt.createElement)(tt.Fragment,null,(0,tt.createElement)(FA,null,(0,tt.createElement)(BA,{title:er("Format settings")},(0,tt.createElement)(xz,{hideLabelFromVision:!0,label:er("Date Format"),options:c,onChange:({selectedItem:e})=>n({format:e.key}),value:c.find((e=>e.key===u))}))),(0,tt.createElement)("div",d,(0,tt.createElement)("time",{dateTime:hV("c",l)},hV(u,l))))}},D9=(0,tt.createElement)(mo,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,tt.createElement)(uo,{d:"M14 10.1V4c0-.6-.4-1-1-1H5c-.6 0-1 .4-1 1v8.3c0 .3.2.7.6.8.1.1.2.1.3.1.2 0 .5-.1.6-.3l1.8-1.8H13c.6 0 1-.4 1-1zm-1.5-.5H6.7l-1.2 1.2V4.5h7v5.1zM19 12h-8c-.6 0-1 .4-1 1v6.1c0 .6.4 1 1 1h5.7l1.8 1.8c.1.2.4.3.6.3.1 0 .2 0 .3-.1.4-.1.6-.5.6-.8V13c0-.6-.4-1-1-1zm-.5 7.8l-1.2-1.2h-5.8v-5.1h7v6.3z"}));function B9({postId:e}){return Tl((t=>{const n=t(yd).getEntityRecords("root","comment",{post:e});return n&&n.length?n.map((e=>(0,tt.createElement)(Pa,{className:"wp-block-post-comments__comment",key:e.id},e.content.rendered))):er("No comments.")}),[e])}const I9={apiVersion:2,name:"core/post-comments",title:"Post Comments",category:"theme",description:"Display a post's comments.",textdomain:"default",attributes:{textAlign:{type:"string"}},usesContext:["postId","postType"],supports:{html:!1,align:["wide","full"],typography:{fontSize:!0,lineHeight:!0},color:{gradients:!0,link:!0}},style:"wp-block-post-comments"},{name:P9}=I9,R9={icon:D9,edit:function({attributes:e,setAttributes:t,context:n}){const{postType:r,postId:o}=n,{textAlign:a}=e,i=VR({className:so()({[`has-text-align-${a}`]:a})});return r&&o?(0,tt.createElement)(tt.Fragment,null,(0,tt.createElement)(lk,{group:"block"},(0,tt.createElement)(gD,{value:a,onChange:e=>{t({textAlign:e})}})),(0,tt.createElement)("div",i,(0,tt.createElement)(B9,{postId:o}))):(0,tt.createElement)("div",i,(0,tt.createElement)(cR,null,er("Post comments block: no post found.")))}},Y9=(0,tt.createElement)(mo,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,tt.createElement)(uo,{d:"M13 8H4v1.5h9V8zM4 4v1.5h16V4H4zm9 8H5c-.6 0-1 .4-1 1v8.3c0 .3.2.7.6.8.1.1.2.1.3.1.2 0 .5-.1.6-.3l1.8-1.8H13c.6 0 1-.4 1-1V13c0-.6-.4-1-1-1zm-2.2 6.6H7l1.6-2.2c.3-.4.5-.7.6-.9.1-.2.2-.4.2-.5 0-.2-.1-.3-.1-.4-.1-.1-.2-.1-.4-.1s-.4 0-.6.1c-.3.1-.5.3-.7.4l-.2.2-.2-1.2.1-.1c.3-.2.5-.3.8-.4.3-.1.6-.1.9-.1.3 0 .6.1.9.2.2.1.4.3.6.5.1.2.2.5.2.7 0 .3-.1.6-.2.9-.1.3-.4.7-.7 1.1l-.5.6h1.6v1.2z"}));const W9={apiVersion:2,name:"core/post-comments-count",title:"Post Comments Count",category:"theme",description:"Display a post's comments count.",textdomain:"default",attributes:{textAlign:{type:"string"}},usesContext:["postId"],supports:{html:!1,color:{gradients:!0},typography:{fontSize:!0,lineHeight:!0}}},{name:H9}=W9,q9={icon:Y9,edit:function({attributes:e,context:t,setAttributes:n}){const{textAlign:r}=e,{postId:o}=t,[a,i]=(0,tt.useState)(),s=VR({className:so()({[`has-text-align-${r}`]:r})});return(0,tt.useEffect)((()=>{if(!o)return;const e=o;ec({path:Pl("/wp/v2/comments",{post:o}),parse:!1}).then((t=>{e===o&&i(t.headers.get("X-WP-Total"))}))}),[o]),(0,tt.createElement)(tt.Fragment,null,(0,tt.createElement)(lk,{group:"block"},(0,tt.createElement)(gD,{value:r,onChange:e=>{n({textAlign:e})}})),(0,tt.createElement)("div",s,o&&void 0!==a?a:(0,tt.createElement)(cR,null,er("Post Comments Count block: post not found."))))}},j9=(0,tt.createElement)(mo,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,tt.createElement)(uo,{d:"M13 8H4v1.5h9V8zM4 4v1.5h16V4H4zm9 8H5c-.6 0-1 .4-1 1v8.3c0 .3.2.7.6.8.1.1.2.1.3.1.2 0 .5-.1.6-.3l1.8-1.8H13c.6 0 1-.4 1-1V13c0-.6-.4-1-1-1zm-.5 6.6H6.7l-1.2 1.2v-6.3h7v5.1z"}));const F9={apiVersion:2,name:"core/post-comments-form",title:"Post Comments Form",category:"theme",description:"Display a post's comments form.",textdomain:"default",attributes:{textAlign:{type:"string"}},usesContext:["postId","postType"],supports:{html:!1,color:{gradients:!0,link:!0},typography:{fontSize:!0,lineHeight:!0}},style:"wp-block-post-comments-form"},{name:V9}=F9,X9={icon:j9,edit:function({attributes:e,context:t,setAttributes:n}){const{textAlign:r}=e,{postId:o,postType:a}=t,[i]=md("postType",a,"comment_status",o),s=VR({className:so()({[`has-text-align-${r}`]:r})});return(0,tt.createElement)(tt.Fragment,null,(0,tt.createElement)(lk,{group:"block"},(0,tt.createElement)(gD,{value:r,onChange:e=>{n({textAlign:e})}})),(0,tt.createElement)("div",s,!i&&(0,tt.createElement)(cR,null,er("Post Comments Form block: comments are not enabled for this post type.")),"open"!==i&&(0,tt.createElement)(cR,null,er("Post Comments Form block: comments to this post are not allowed.")),"open"===i&&er("Post Comments Form")))}};const U9=function({context:e,attributes:t,setAttributes:n}){const{textAlign:r}=t,{postType:o,postId:a}=e,[i,s]=(0,tt.useState)(),l=VR({className:so()({[`has-text-align-${r}`]:r})});(0,tt.useEffect)((()=>{if(!a)return;const e=a;ec({path:Pl("/wp/v2/comments",{post:a}),parse:!1}).then((t=>{e===a&&s(t.headers.get("X-WP-Total"))}))}),[a]);const c=Tl((e=>e(yd).getEditedEntityRecord("postType",o,a)),[o,a]);if(!c)return null;const{link:u}=c;let d;if(void 0!==i){const e=parseInt(i);d=0===e?er("No comments"):pn(nr("%s comment","%s comments",e),e.toLocaleString())}return(0,tt.createElement)(tt.Fragment,null,(0,tt.createElement)(lk,{group:"block"},(0,tt.createElement)(gD,{value:r,onChange:e=>{n({textAlign:e})}})),(0,tt.createElement)("div",l,u&&void 0!==d?(0,tt.createElement)("a",{href:u+"#comments",onClick:e=>e.preventDefault()},d):(0,tt.createElement)(cR,null,er("Post Comments Link block: post not found."))))},$9={apiVersion:2,name:"core/post-comments-link",title:"Post Comments Link",category:"theme",description:"Displays the link to the current post comments.",textdomain:"default",usesContext:["postType","postId"],attributes:{textAlign:{type:"string"}},supports:{html:!1,color:{link:!0,text:!1},typography:{fontSize:!0,lineHeight:!0}}},{name:K9}=$9,G9={edit:U9,icon:Y9};n(6063);var J9=n(9368);const Q9="dddd, LL";function Z9({day:e,events:t=[]}){const n=(0,tt.useRef)();return(0,tt.useEffect)((()=>{var r;if(null==n||null===(r=n.current)||void 0===r||!r.parentNode)return;const{parentNode:o}=n.current,a=sV()(e).format(Q9);if(!t.length)return void o.setAttribute("aria-label",a);const i=pn(nr("%1$s. There is %2$d event.","%1$s. There are %2$d events.",t.length),a,t.length);o.setAttribute("aria-label",i)}),[t.length]),(0,tt.createElement)("div",{ref:n,className:so()("components-datetime__date__day",{"has-events":null==t?void 0:t.length})},e.format("D"))}class eee extends tt.Component{constructor(){super(...arguments),this.onChangeMoment=this.onChangeMoment.bind(this),this.nodeRef=(0,tt.createRef)(),this.onMonthPreviewedHandler=this.onMonthPreviewedHandler.bind(this)}onMonthPreviewedHandler(e){var t,n;null===(t=(n=this.props).onMonthPreviewed)||void 0===t||t.call(n,e.toISOString()),this.keepFocusInside()}keepFocusInside(){if(!this.nodeRef.current)return;const{ownerDocument:e}=this.nodeRef.current,{activeElement:t}=e;if(!t||!this.nodeRef.current.contains(e.activeElement)){const e=this.nodeRef.current.querySelector(".DayPicker_focusRegion");if(!e)return;e.focus()}}onChangeMoment(e){const{currentDate:t,onChange:n}=this.props,r=t?sV()(t):sV()(),o={hours:r.hours(),minutes:r.minutes(),seconds:0};n(e.set(o).format("YYYY-MM-DDTHH:mm:ss")),this.keepFocusInside()}getMomentDate(e){return null===e?null:e?sV()(e):sV()()}getEventsPerDay(e){var t;return null!==(t=this.props.events)&&void 0!==t&&t.length?this.props.events.filter((t=>e.isSame(t.date,"day"))):[]}render(){const{currentDate:e,isInvalidDate:t}=this.props,n=this.getMomentDate(e);return(0,tt.createElement)("div",{className:"components-datetime__date",ref:this.nodeRef},(0,tt.createElement)(J9.Z,{date:n,daySize:30,focused:!0,hideKeyboardShortcutsPanel:!0,key:`datepicker-controller-${n?n.format("MM-YYYY"):"null"}`,noBorder:!0,numberOfMonths:1,onDateChange:this.onChangeMoment,transitionDuration:0,weekDayFormat:"ddd",dayAriaLabelFormat:Q9,isRTL:rr(),isOutsideRange:e=>t&&t(e.toDate()),onPrevMonthClick:this.onMonthPreviewedHandler,onNextMonthClick:this.onMonthPreviewedHandler,renderDayContents:e=>(0,tt.createElement)(Z9,{day:e,events:this.getEventsPerDay(e)})}))}}const tee=eee,nee=()=>{const{timezone:e}=dV(),t=(new Date).getTimezoneOffset()/60*-1;if(Number(e.offset)===t)return null;const n=e.offset>=0?"+":"",r=""!==e.abbr&&isNaN(e.abbr)?e.abbr:`UTC${n}${e.offset}`,o="UTC"===e.string?er("Coordinated Universal Time"):`(${r}) ${e.string.replace("_"," ")}`;return(0,tt.createElement)(Sf,{position:"top center",text:o},(0,tt.createElement)("div",{className:"components-datetime__timezone"},r))};function ree({as:e,value:t,onUpdate:n,...r}){return(0,tt.createElement)(e||"input",{key:t,defaultValue:t,onBlur:function(e){const{target:o}=e;if(t===o.value)return;const a=parseInt(o.value,10);!(0,at.isInteger)(a)||void 0!==r.max&&a>r.max||void 0!==r.min&&asV()(t).startOf("minutes")));(0,tt.useEffect)((()=>{o(t?sV()(t).startOf("minutes"):sV()())}),[t]);const{day:a,month:i,year:s,minutes:l,hours:c,am:u}=(0,tt.useMemo)((()=>({day:r.format("DD"),month:r.format("MM"),year:r.format("YYYY"),minutes:r.format("mm"),hours:r.format(e?"hh":"HH"),am:r.format("H")<=11?"AM":"PM"})),[r,e]);function d(e){o(e),n(e.format("YYYY-MM-DDTHH:mm:ss"))}function p(e,t){d(r.clone()[e](t))}function m(e){return()=>{if(u===e)return;const t=parseInt(c,10);d(r.clone().hours("PM"===e?(t%12+12)%24:t%12))}}const f=(0,tt.createElement)("div",{className:"components-datetime__time-field components-datetime__time-field-day"},(0,tt.createElement)(ree,{"aria-label":er("Day"),className:"components-datetime__time-field-day-input",type:"number",name:"date",value:a,step:1,min:1,max:31,onUpdate:p})),h=(0,tt.createElement)("div",{className:"components-datetime__time-field components-datetime__time-field-month"},(0,tt.createElement)(ree,{as:"select","aria-label":er("Month"),className:"components-datetime__time-field-month-select",name:"month",value:i,onUpdate:(e,t)=>p(e,t-1)},(0,tt.createElement)("option",{value:"01"},er("January")),(0,tt.createElement)("option",{value:"02"},er("February")),(0,tt.createElement)("option",{value:"03"},er("March")),(0,tt.createElement)("option",{value:"04"},er("April")),(0,tt.createElement)("option",{value:"05"},er("May")),(0,tt.createElement)("option",{value:"06"},er("June")),(0,tt.createElement)("option",{value:"07"},er("July")),(0,tt.createElement)("option",{value:"08"},er("August")),(0,tt.createElement)("option",{value:"09"},er("September")),(0,tt.createElement)("option",{value:"10"},er("October")),(0,tt.createElement)("option",{value:"11"},er("November")),(0,tt.createElement)("option",{value:"12"},er("December")))),g=e?(0,tt.createElement)(tt.Fragment,null,f,h):(0,tt.createElement)(tt.Fragment,null,h,f);return(0,tt.createElement)("div",{className:so()("components-datetime__time")},(0,tt.createElement)("fieldset",null,(0,tt.createElement)("legend",{className:"components-datetime__time-legend invisible"},er("Date")),(0,tt.createElement)("div",{className:"components-datetime__time-wrapper"},g,(0,tt.createElement)("div",{className:"components-datetime__time-field components-datetime__time-field-year"},(0,tt.createElement)(ree,{"aria-label":er("Year"),className:"components-datetime__time-field-year-input",type:"number",name:"year",step:1,min:0,max:9999,value:s,onUpdate:p})))),(0,tt.createElement)("fieldset",null,(0,tt.createElement)("legend",{className:"components-datetime__time-legend invisible"},er("Time")),(0,tt.createElement)("div",{className:"components-datetime__time-wrapper"},(0,tt.createElement)("div",{className:"components-datetime__time-field components-datetime__time-field-time"},(0,tt.createElement)(ree,{"aria-label":er("Hours"),className:"components-datetime__time-field-hours-input",type:"number",name:"hours",step:1,min:e?1:0,max:e?12:23,value:c,onUpdate:p}),(0,tt.createElement)("span",{className:"components-datetime__time-separator","aria-hidden":"true"},":"),(0,tt.createElement)(ree,{"aria-label":er("Minutes"),className:"components-datetime__time-field-minutes-input",type:"number",name:"minutes",step:1,min:0,max:59,value:l,onUpdate:p})),e&&(0,tt.createElement)(GA,{className:"components-datetime__time-field components-datetime__time-field-am-pm"},(0,tt.createElement)(Eh,{variant:"AM"===u?"primary":"secondary",onClick:m("AM"),className:"components-datetime__time-am-button"},er("AM")),(0,tt.createElement)(Eh,{variant:"PM"===u?"primary":"secondary",onClick:m("PM"),className:"components-datetime__time-pm-button"},er("PM"))),(0,tt.createElement)(nee,null))))};const aee=(0,tt.forwardRef)((function({currentDate:e,is12Hour:t,isInvalidDate:n,onMonthPreviewed:r=at.noop,onChange:o,events:a},i){const[s,l]=(0,tt.useState)(!1);return(0,tt.createElement)("div",{ref:i,className:"components-datetime"},!s&&(0,tt.createElement)(tt.Fragment,null,(0,tt.createElement)(oee,{currentTime:e,onChange:o,is12Hour:t}),(0,tt.createElement)(tee,{currentDate:e,onChange:o,isInvalidDate:n,events:a,onMonthPreviewed:r})),s&&(0,tt.createElement)(tt.Fragment,null,(0,tt.createElement)("div",{className:"components-datetime__calendar-help"},(0,tt.createElement)("h4",null,er("Click to Select")),(0,tt.createElement)("ul",null,(0,tt.createElement)("li",null,er("Click the right or left arrows to select other months in the past or the future.")),(0,tt.createElement)("li",null,er("Click the desired day to select it."))),(0,tt.createElement)("h4",null,er("Navigating with a keyboard")),(0,tt.createElement)("ul",null,(0,tt.createElement)("li",null,(0,tt.createElement)("abbr",{"aria-label":tr("Enter","keyboard button")},"↵")," ",(0,tt.createElement)("span",null,er("Select the date in focus."))),(0,tt.createElement)("li",null,(0,tt.createElement)("abbr",{"aria-label":er("Left and Right Arrows")},"←/→")," ",er("Move backward (left) or forward (right) by one day.")),(0,tt.createElement)("li",null,(0,tt.createElement)("abbr",{"aria-label":er("Up and Down Arrows")},"↑/↓")," ",er("Move backward (up) or forward (down) by one week.")),(0,tt.createElement)("li",null,(0,tt.createElement)("abbr",{"aria-label":er("Page Up and Page Down")},er("PgUp/PgDn"))," ",er("Move backward (PgUp) or forward (PgDn) by one month.")),(0,tt.createElement)("li",null,(0,tt.createElement)("abbr",{"aria-label":er("Home and End")},er("Home/End"))," ",er("Go to the first (home) or last (end) day of a week."))))),(0,tt.createElement)("div",{className:"components-datetime__buttons"},!s&&e&&(0,tt.createElement)(Eh,{className:"components-datetime__date-reset-button",variant:"link",onClick:()=>o(null)},er("Reset")),(0,tt.createElement)(Eh,{className:"components-datetime__date-help-toggle",variant:"link",onClick:function(){l(!s)}},er(s?"Close":"Calendar Help"))))}));const iee={apiVersion:2,name:"core/post-date",title:"Post Date",category:"theme",description:"Add the date of this post.",textdomain:"default",attributes:{textAlign:{type:"string"},format:{type:"string"},isLink:{type:"boolean",default:!1}},usesContext:["postId","postType","queryId"],supports:{html:!1,color:{gradients:!0,link:!0},typography:{fontSize:!0,lineHeight:!0}}},{name:see}=iee,lee={icon:x9,edit:function({attributes:{textAlign:e,format:t,isLink:n},context:{postId:r,postType:o,queryId:a},setAttributes:i}){const s=!!a,[l]=md("root","site","date_format"),[c,u]=md("postType",o,"date",r),[d,p]=(0,tt.useState)(!1),m=dV(),f=/a(?!\\)/i.test(m.formats.time.toLowerCase().replace(/\\\\/g,"").split("").reverse().join("")),h=Object.values(m.formats).map((e=>({key:e,name:hV(e,c)}))),g=t||l||m.formats.date,b=VR({className:so()({[`has-text-align-${e}`]:e})});let v=c?(0,tt.createElement)("time",{dateTime:hV("c",c)},hV(g,c),d&&(0,tt.createElement)(_f,{onClose:p.bind(null,!1)},(0,tt.createElement)(aee,{currentDate:c,onChange:u,is12Hour:f}))):er("No Date");return n&&c&&(v=(0,tt.createElement)("a",{href:"#post-date-pseudo-link",onClick:e=>e.preventDefault()},v)),(0,tt.createElement)(tt.Fragment,null,(0,tt.createElement)(lk,{group:"block"},(0,tt.createElement)(gD,{value:e,onChange:e=>{i({textAlign:e})}}),c&&!s&&(0,tt.createElement)(jg,{icon:Zq,title:er("Change Date"),onClick:()=>p((e=>!e))})),(0,tt.createElement)(FA,null,(0,tt.createElement)(BA,{title:er("Format settings")},(0,tt.createElement)(xz,{hideLabelFromVision:!0,label:er("Date Format"),options:h,onChange:({selectedItem:e})=>i({format:e.key}),value:h.find((e=>e.key===g))})),(0,tt.createElement)(BA,{title:er("Link settings")},(0,tt.createElement)(KN,{label:pn(er("Link to %s"),o),onChange:()=>i({isLink:!n}),checked:n}))),(0,tt.createElement)("div",b,v))}},cee=(0,tt.createElement)(mo,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,tt.createElement)(uo,{d:"M12.75 9.333c0 .521-.102.977-.327 1.354-.23.386-.555.628-.893.774-.545.234-1.183.227-1.544.222l-.12-.001v-1.5h.123c.414.001.715.002.948-.099a.395.395 0 00.199-.166c.05-.083.114-.253.114-.584V7.2H8.8V4h3.95v5.333zM7.95 9.333c0 .521-.102.977-.327 1.354-.23.386-.555.628-.893.774-.545.234-1.183.227-1.544.222l-.12-.001v-1.5h.123c.414.001.715.002.948-.099a.394.394 0 00.198-.166c.05-.083.115-.253.115-.584V7.2H4V4h3.95v5.333zM13 20H4v-1.5h9V20zM20 16H4v-1.5h16V16z"}));const uee={apiVersion:2,name:"core/post-excerpt",title:"Post Excerpt",category:"theme",description:"Display a post's excerpt.",textdomain:"default",attributes:{textAlign:{type:"string"},moreText:{type:"string"},showMoreOnNewLine:{type:"boolean",default:!0}},usesContext:["postId","postType","queryId"],supports:{html:!1,color:{gradients:!0,link:!0},typography:{fontSize:!0,lineHeight:!0}},editorStyle:"wp-block-post-excerpt-editor",style:"wp-block-post-excerpt"},{name:dee}=uee,pee={icon:cee,edit:function({attributes:{textAlign:e,moreText:t,showMoreOnNewLine:n},setAttributes:r,isSelected:o,context:{postId:a,postType:i,queryId:s}}){const l=!!s,c=n9("postType",i,a),u=c&&!l,[d,p,{rendered:m,protected:f}={}]=md("postType",i,"excerpt",a),h=VR({className:so()({[`has-text-align-${e}`]:e})}),g=(0,tt.useMemo)((()=>{if(!m)return"";const e=(new window.DOMParser).parseFromString(m,"text/html");return e.body.textContent||e.body.innerText||""}),[m]);if(!i||!a)return(0,tt.createElement)("div",h,(0,tt.createElement)(cR,null,er("Post excerpt block: no post found.")));if(f&&!c)return(0,tt.createElement)("div",h,(0,tt.createElement)(cR,null,er("There is no excerpt because this is a protected post.")));const b=(0,tt.createElement)(Cj,{className:"wp-block-post-excerpt__more-link",tagName:"a","aria-label":er('"Read more" link text'),placeholder:er('Add "read more" link text'),value:t,onChange:e=>r({moreText:e})}),v=u?(0,tt.createElement)(Cj,{className:!n&&"wp-block-post-excerpt__excerpt is-inline","aria-label":er("Post excerpt text"),value:d||g||(o?"":er("No post excerpt found")),onChange:p}):m&&(0,tt.createElement)(jP,null,(0,tt.createElement)(Pa,{key:"html"},m))||er("No post excerpt found");return(0,tt.createElement)(tt.Fragment,null,(0,tt.createElement)(lk,null,(0,tt.createElement)(bD,{value:e,onChange:e=>r({textAlign:e})})),(0,tt.createElement)(FA,null,(0,tt.createElement)(BA,{title:er("Post Excerpt Settings")},(0,tt.createElement)(KN,{label:er("Show link on new line"),checked:n,onChange:e=>r({showMoreOnNewLine:e})}))),(0,tt.createElement)("div",h,v,!n&&" ",n?(0,tt.createElement)("p",{className:"wp-block-post-excerpt__more-text"},b):b))}},mee=(0,tt.createElement)(mo,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,tt.createElement)(uo,{d:"M19 3H5c-.6 0-1 .4-1 1v7c0 .5.4 1 1 1h14c.5 0 1-.4 1-1V4c0-.6-.4-1-1-1zM5.5 10.5v-.4l1.8-1.3 1.3.8c.3.2.7.2.9-.1L11 8.1l2.4 2.4H5.5zm13 0h-2.9l-4-4c-.3-.3-.8-.3-1.1 0L8.9 8l-1.2-.8c-.3-.2-.6-.2-.9 0l-1.3 1V4.5h13v6zM4 20h9v-1.5H4V20zm0-4h16v-1.5H4V16z"})),fee=["image"],hee=(0,tt.createElement)("div",{className:"post-featured-image_placeholder"},(0,tt.createElement)(Tf,{icon:mee}),(0,tt.createElement)("p",null," ",er("Featured Image")));const gee=WK((function({attributes:{isLink:e},setAttributes:t,context:{postId:n,postType:r,queryId:o},noticeUI:a,noticeOperations:i}){const s=!!o,[l,c]=md("postType",r,"featured_media",n),u=Tl((e=>l&&e(yd).getEntityRecord("root","media",l,{context:"view"})),[l]),d=VR(),p=e=>{null!=e&&e.id&&c(e.id)};function m(e){i.removeAllNotices(),i.createErrorNotice(e)}let f;return!l&&s?(0,tt.createElement)("div",d,hee):(f=l?u?(0,tt.createElement)("img",{src:u.source_url,alt:u.alt_text||er("Featured image")}):hee:(0,tt.createElement)(oj,{icon:(0,tt.createElement)(MB,{icon:mee}),onSelect:p,notices:a,onError:m,accept:"image/*",allowedTypes:fee,labels:{title:er("Featured image"),instructions:er("Upload a media file or pick one from your media library.")}}),(0,tt.createElement)(tt.Fragment,null,(0,tt.createElement)(FA,null,(0,tt.createElement)(BA,{title:er("Link settings")},(0,tt.createElement)(KN,{label:pn(er("Link to %s"),r),onChange:()=>t({isLink:!e}),checked:e}))),!!u&&!s&&(0,tt.createElement)(lk,{group:"other"},(0,tt.createElement)(Jq,{mediaId:l,mediaURL:u.source_url,allowedTypes:fee,accept:"image/*",onSelect:p,onError:m})),(0,tt.createElement)("figure",d,f)))}));const bee={apiVersion:2,name:"core/post-featured-image",title:"Post Featured Image",category:"theme",description:"Display a post's featured image.",textdomain:"default",attributes:{isLink:{type:"boolean",default:!1}},usesContext:["postId","postType","queryId"],supports:{align:["left","right","center","wide","full"],html:!1},editorStyle:"wp-block-post-featured-image-editor",style:"wp-block-post-featured-image"},{name:vee}=bee,yee={icon:mee,edit:function(e){var t;const n=VR();return null!==(t=e.context)&&void 0!==t&&t.postId?(0,tt.createElement)(gee,e):(0,tt.createElement)("div",n,hee)}};const _ee=(0,tt.createElement)(mo,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,tt.createElement)(uo,{d:"M20 4H4v1.5h16V4zm-2 9h-3c-1.1 0-2 .9-2 2v3c0 1.1.9 2 2 2h3c1.1 0 2-.9 2-2v-3c0-1.1-.9-2-2-2zm.5 5c0 .3-.2.5-.5.5h-3c-.3 0-.5-.2-.5-.5v-3c0-.3.2-.5.5-.5h3c.3 0 .5.2.5.5v3zM4 9.5h9V8H4v1.5zM9 13H6c-1.1 0-2 .9-2 2v3c0 1.1.9 2 2 2h3c1.1 0 2-.9 2-2v-3c0-1.1-.9-2-2-2zm.5 5c0 .3-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5v-3c0-.3.2-.5.5-.5h3c.3 0 .5.2.5.5v3z",fillRule:"evenodd",clipRule:"evenodd"})),Mee=[{name:"category",title:er("Post Categories"),description:er("Display a post's categories."),icon:_ee,isDefault:!0,attributes:{term:"category"},isActive:e=>"category"===e.term},{name:"post_tag",title:er("Post Tags"),description:er("Display a post's tags."),icon:_ee,attributes:{term:"post_tag"},isActive:e=>"post_tag"===e.term}],kee={apiVersion:2,name:"core/post-terms",title:"Post Terms",category:"design",description:"Post terms.",textdomain:"default",attributes:{term:{type:"string"},textAlign:{type:"string"},separator:{type:"string",default:", "}},usesContext:["postId","postType"],supports:{html:!1,color:{gradients:!0,link:!0},typography:{lineHeight:!0,fontSize:!0}},style:"wp-block-post-terms"},{name:wee}=kee,Eee={variations:Mee,edit:function({attributes:e,context:t,setAttributes:n}){var r;const{term:o,textAlign:a,separator:i}=e,{postId:s,postType:l}=t,c=Tl((e=>{var t;if(!o)return{};const{getTaxonomy:n}=e(yd),r=n(o);return null!=r&&null!==(t=r.visibility)&&void 0!==t&&t.publicly_queryable?r:{}}),[o]),{postTerms:u,hasPostTerms:d,isLoading:p}=function({postId:e,postType:t,term:n}){var r;const{rest_base:o,slug:a}=n,[i]=md("postType",t,o,e);return Tl((e=>{var t;if(!(null==n||null===(t=n.visibility)||void 0===t?void 0:t.publicly_queryable))return{postTerms:[],_isLoading:!1,hasPostTerms:!1};if(!i)return{isLoading:!0};if(!i.length)return{isLoading:!1};const{getEntityRecords:r,isResolving:o}=e(yd),s=["taxonomy",a,{include:i,context:"view"}],l=r(...s);return{postTerms:l,isLoading:o("getEntityRecords",s),hasPostTerms:!(null==l||!l.length)}}),[i,null==n||null===(r=n.visibility)||void 0===r?void 0:r.publicly_queryable])}({postId:s,postType:l,term:c}),m=s&&l,f=VR({className:so()({[`has-text-align-${a}`]:a,[`taxonomy-${o}`]:o})});return m?o?(0,tt.createElement)(tt.Fragment,null,(0,tt.createElement)(lk,null,(0,tt.createElement)(bD,{value:a,onChange:e=>{n({textAlign:e})}})),(0,tt.createElement)(WA,null,(0,tt.createElement)(LA,{autoComplete:"off",label:er("Separator"),value:i||"",onChange:e=>{n({separator:e})},help:er("Enter character(s) used to separate terms.")})),(0,tt.createElement)("div",f,p&&(0,tt.createElement)(cq,null),!p&&d&&u.map((e=>(0,tt.createElement)("a",{key:e.id,href:e.link,onClick:e=>e.preventDefault()},e.name))).reduce(((e,t)=>(0,tt.createElement)(tt.Fragment,null,e,(0,tt.createElement)("span",{className:"wp-block-post-terms__separator"},i||" "),t))),!p&&!d&&((null==c||null===(r=c.labels)||void 0===r?void 0:r.no_terms)||er("Term items not found.")))):(0,tt.createElement)("div",f,er("Post Terms block: no term specified.")):(0,tt.createElement)("div",f,(0,tt.createElement)(cR,null,er("Post Terms block: post not found.")))}},Lee=(0,tt.createElement)(mo,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,tt.createElement)(uo,{stroke:"#1E1E1E",strokeWidth:"1.5",d:"M9 19.25h6M4 19.25h4M12 15.25h8M4 15.25h7"}),(0,tt.createElement)(uo,{d:"M8.994 10.103H6.08L5.417 12H4l2.846-8h1.383l2.845 8H9.657l-.663-1.897zm-.457-1.28l-.994-2.857-1.006 2.857h2z",fill:"#1E1E1E"}));const Aee={apiVersion:2,name:"core/term-description",title:"Term Description",category:"theme",description:"Display the description of categories, tags and custom taxonomies when viewing an archive.",textdomain:"default",attributes:{textAlign:{type:"string"}},supports:{align:["wide","full"],html:!1,color:{link:!0},typography:{fontSize:!0,lineHeight:!0}},editorStyle:"wp-block-term-description-editor"},{name:See}=Aee,Cee={icon:Lee,edit:function({attributes:e,setAttributes:t,mergedStyle:n}){const{textAlign:r}=e,o=VR({className:so()({[`has-text-align-${r}`]:r}),style:n});return(0,tt.createElement)(tt.Fragment,null,(0,tt.createElement)(lk,{group:"block"},(0,tt.createElement)(gD,{value:r,onChange:e=>{t({textAlign:e})}})),(0,tt.createElement)("div",o,(0,tt.createElement)("div",{className:"wp-block-term-description__placeholder"},(0,tt.createElement)("span",null,er("Term description.")))))}},Tee=e=>{if(!e)return;const{metadata:t,settings:n,name:r}=e;xo({name:r,...t},n)},xee=(e=(()=>[w,E,L,T,G,A,ue,x,z,O,N,D,B,I,P,R,Y,W,H,le,window.wp&&window.wp.oldEditor?be:null,q,j,U,$,J,Q,Z,ee,te,ne,ie,se,ce,ae,ve,ye,de,pe,ge,me,fe,he,_e,Me,ke,Ee,Le,Ae,Se,Ce,Te,xe,Oe,Ne,je,Fe,Ve,Xe,K])())=>{var t,n;e.forEach(Tee),t=BK,nn(Gr).setDefaultBlockName(t),window.wp&&window.wp.oldEditor&&(n=K6,nn(Gr).setFreeformFallbackBlockName(n)),function(e){nn(Gr).setUnregisteredFallbackBlockName(e)}(p4),function(e){nn(Gr).setGroupingBlockName(e)}(k5)},zee=(0,tt.createElement)(mo,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,tt.createElement)(uo,{d:"M14.7 11.3c1-.6 1.5-1.6 1.5-3 0-2.3-1.3-3.4-4-3.4H7v14h5.8c1.4 0 2.5-.3 3.3-1 .8-.7 1.2-1.7 1.2-2.9.1-1.9-.8-3.1-2.6-3.7zm-5.1-4h2.3c.6 0 1.1.1 1.4.4.3.3.5.7.5 1.2s-.2 1-.5 1.2c-.3.3-.8.4-1.4.4H9.6V7.3zm4.6 9c-.4.3-1 .4-1.7.4H9.6v-3.9h2.9c.7 0 1.3.2 1.7.5.4.3.6.8.6 1.5s-.2 1.2-.6 1.5z"})),Oee="core/bold",Nee=er("Bold"),Dee={name:Oee,title:Nee,tagName:"strong",className:null,edit({isActive:e,value:t,onChange:n,onFocus:r}){function o(){n(__(t,{type:Oee}))}return(0,tt.createElement)(tt.Fragment,null,(0,tt.createElement)(Oj,{type:"primary",character:"b",onUse:o}),(0,tt.createElement)(Nj,{name:"bold",icon:zee,title:Nee,onClick:function(){o(),r()},isActive:e,shortcutType:"primary",shortcutCharacter:"b"}),(0,tt.createElement)(Dj,{inputType:"formatBold",onInput:o}))}},Bee="core/code",Iee=er("Inline code"),Pee={name:Bee,title:Iee,tagName:"code",className:null,__unstableInputRule(e){const{start:t,text:n}=e;if("`"!==n.slice(t-1,t))return e;const r=n.slice(0,t-1).lastIndexOf("`");if(-1===r)return e;const o=r,a=t-2;return o===a?e:(e=t_(e,o,o+1),e=Ay(e=t_(e,a,a+1),{type:Bee},o,a))},edit:({value:e,onChange:t,onFocus:n,isActive:r})=>(0,tt.createElement)(Nj,{icon:NZ,title:Iee,onClick:function(){t(__(e,{type:Bee})),n()},isActive:r})},Ree=["image"],Yee="core/image",Wee=er("Inline image"),Hee={name:Yee,title:Wee,keywords:[er("photo"),er("media")],object:!0,tagName:"img",className:null,attributes:{className:"class",style:"style",url:"src",alt:"alt"},edit:function({value:e,onChange:t,onFocus:n,isObjectActive:r,activeObjectAttributes:o,contentRef:a}){const[i,s]=(0,tt.useState)(!1);function l(){s(!1)}return(0,tt.createElement)(Gq,null,(0,tt.createElement)(Nj,{icon:(0,tt.createElement)(mo,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,tt.createElement)(uo,{d:"M4 18.5h16V17H4v1.5zM16 13v1.5h4V13h-4zM5.1 15h7.8c.6 0 1.1-.5 1.1-1.1V6.1c0-.6-.5-1.1-1.1-1.1H5.1C4.5 5 4 5.5 4 6.1v7.8c0 .6.5 1.1 1.1 1.1zm.4-8.5h7V10l-1-1c-.3-.3-.8-.3-1 0l-1.6 1.5-1.2-.7c-.3-.2-.6-.2-.9 0l-1.3 1V6.5zm0 6.1l1.8-1.3 1.3.8c.3.2.7.2.9-.1l1.5-1.4 1.5 1.4v1.5h-7v-.9z"})),title:Wee,onClick:function(){s(!0)},isActive:r}),i&&(0,tt.createElement)(Kq,{allowedTypes:Ree,onSelect:({id:r,url:o,alt:a,width:i})=>{l(),t(function(e,t,n,r){return e_(e,{formats:[,],replacements:[t],text:xy},n,r)}(e,{type:Yee,attributes:{className:`wp-image-${r}`,style:`width: ${Math.min(i,150)}px;`,url:o,alt:a}})),n()},onClose:l,render:({open:e})=>(e(),null)}),r&&(0,tt.createElement)(qee,{value:e,onChange:t,activeObjectAttributes:o,contentRef:a}))}};function qee({value:e,onChange:t,activeObjectAttributes:n,contentRef:r}){const{style:o}=n,[a,i]=(0,tt.useState)(null==o?void 0:o.replace(/\D/g,"")),s=S_({ref:r,value:e,settings:Hee});return(0,tt.createElement)(_f,{position:"bottom center",focusOnMount:!1,anchorRef:s,className:"block-editor-format-toolbar__image-popover"},(0,tt.createElement)("form",{className:"block-editor-format-toolbar__image-container-content",onSubmit:r=>{const o=e.replacements.slice();o[e.start]={type:Yee,attributes:{...n,style:a?`width: ${a}px;`:""}},t({...e,replacements:o}),r.preventDefault()}},(0,tt.createElement)(LA,{className:"block-editor-format-toolbar__image-container-value",type:"number",label:er("Width"),value:a,min:1,onChange:e=>i(e)}),(0,tt.createElement)(Eh,{icon:uq,label:er("Apply"),type:"submit"})))}const jee=(0,tt.createElement)(mo,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,tt.createElement)(uo,{d:"M12.5 5L10 19h1.9l2.5-14z"})),Fee="core/italic",Vee=er("Italic"),Xee={name:Fee,title:Vee,tagName:"em",className:null,edit({isActive:e,value:t,onChange:n,onFocus:r}){function o(){n(__(t,{type:Fee}))}return(0,tt.createElement)(tt.Fragment,null,(0,tt.createElement)(Oj,{type:"primary",character:"i",onUse:o}),(0,tt.createElement)(Nj,{name:"italic",icon:jee,title:Vee,onClick:function(){o(),r()},isActive:e,shortcutType:"primary",shortcutCharacter:"i"}),(0,tt.createElement)(Dj,{inputType:"formatItalic",onInput:o}))}};function Uee(e){return!!e&&/^#[^\s#?\/]*$/.test(e)}function $ee(e){if(!e)return!1;const t=e.trim();if(!t)return!1;if(/^\S+:/.test(t)){const e=Aq(t);if(!function(e){return!!e&&/^[a-z\-.\+]+[0-9]*:$/i.test(e)}(e))return!1;if((0,at.startsWith)(e,"http")&&!/^https?:\/\/[^\/\s]/i.test(t))return!1;if(!function(e){return!!e&&/^[^\s#?]+$/.test(e)}(function(e){const t=/^[^\/\s:]+:(?:\/\/)?\/?([^\/\s#?]+)[\/#?]{0,1}\S*$/.exec(e);if(t)return t[1]}(t)))return!1;const n=SG(t);if(n&&!function(e){return!!e&&/^[^\s#?]+$/.test(e)}(n))return!1;const r=Bl(t);if(r&&!function(e){return!!e&&/^[^\s#?\/]+$/.test(e)}(r))return!1;const o=function(e){const t=/^\S+?(#[^\s\?]*)/.exec(e);if(t)return t[1]}(t);if(o&&!Uee(o))return!1}return!((0,at.startsWith)(t,"#")&&!Uee(t))}const Kee=pq((function({isActive:e,activeAttributes:t,addingLink:n,value:r,onChange:o,speak:a,stopAddingLink:i,contentRef:s}){const[l,c]=(0,tt.useState)(),u={url:t.url,type:t.type,id:t.id,opensInNewTab:"_blank"===t.target,...l},d=S_({ref:s,value:r,settings:Qee}),p=(0,tt.useRef)(!!n&&"firstElement");return(0,tt.createElement)(_f,{anchorRef:d,focusOnMount:p.current,onClose:i,position:"bottom center"},(0,tt.createElement)(Vq,{value:u,onChange:function(t){t={...l,...t};const n=u.opensInNewTab!==t.opensInNewTab&&u.url===t.url,s=n&&void 0===t.url;if(c(s?t:void 0),s)return;const d=xq(t.url),p=function({url:e,type:t,id:n,opensInNewWindow:r}){const o={type:"core/link",attributes:{url:e}};return t&&(o.attributes.type=t),n&&(o.attributes.id=n),r&&(o.attributes.target="_blank",o.attributes.rel="noreferrer noopener"),o}({url:d,type:t.type,id:void 0!==t.id&&null!==t.id?String(t.id):void 0,opensInNewWindow:t.opensInNewTab});if($y(r)&&!e){const e=t.title||d,n=Ay(Ny({text:e}),p,0,e.length);o(e_(r,n))}else{const e=Ay(r,p);e.start=e.end,e.activeFormats=[],o(e)}n||i(),$ee(d)?a(er(e?"Link edited.":"Link inserted."),"assertive"):a(er("Warning: the link has been inserted but may have errors. Please test it."),"assertive")},onRemove:function(){const e=Qy(r,"core/link");o(e),i(),a(er("Link removed."),"assertive")},forceIsEditingLink:n,hasRichPreviews:!0}))})),Gee="core/link",Jee=er("Link");const Qee={name:Gee,title:Jee,tagName:"a",className:null,attributes:{url:"href",type:"data-type",id:"data-id",target:"target"},__unstablePasteRule(e,{html:t,plainText:n}){if($y(e))return e;const r=(t||n).replace(/<[^>]+>/g,"").trim();return fq(r)?(window.console.log("Created link:\n\n",r),Ay(e,{type:Gee,attributes:{url:xa(r)}})):e},edit:function({isActive:e,activeAttributes:t,value:n,onChange:r,onFocus:o,contentRef:a}){const[i,s]=(0,tt.useState)(!1);function l(){const e=Fy(r_(n));e&&fq(e)&&$ee(e)?r(Ay(n,{type:Gee,attributes:{url:e}})):e&&Cq(e)?r(Ay(n,{type:Gee,attributes:{url:`mailto:${e}`}})):s(!0)}function c(){r(Qy(n,Gee)),fy(er("Link removed."),"assertive")}return(0,tt.createElement)(tt.Fragment,null,(0,tt.createElement)(Oj,{type:"primary",character:"k",onUse:l}),(0,tt.createElement)(Oj,{type:"primaryShift",character:"k",onUse:c}),e&&(0,tt.createElement)(Nj,{name:"link",icon:pT,title:er("Unlink"),onClick:c,isActive:e,shortcutType:"primaryShift",shortcutCharacter:"k"}),!e&&(0,tt.createElement)(Nj,{name:"link",icon:dT,title:Jee,onClick:l,isActive:e,shortcutType:"primary",shortcutCharacter:"k"}),(i||e)&&(0,tt.createElement)(Kee,{addingLink:i,stopAddingLink:function(){s(!1),o()},isActive:e,activeAttributes:t,value:n,onChange:r,contentRef:a}))}},Zee="core/strikethrough",ete=er("Strikethrough"),tte={name:Zee,title:ete,tagName:"s",className:null,edit:({isActive:e,value:t,onChange:n,onFocus:r})=>(0,tt.createElement)(Nj,{icon:ox,title:ete,onClick:function(){n(__(t,{type:Zee})),r()},isActive:e})},nte="core/underline",rte={name:nte,title:er("Underline"),tagName:"span",className:null,attributes:{style:"style"},edit({value:e,onChange:t}){const n=()=>{t(__(e,{type:nte,attributes:{style:"text-decoration: underline;"}}))};return(0,tt.createElement)(tt.Fragment,null,(0,tt.createElement)(Oj,{type:"primary",character:"u",onUse:n}),(0,tt.createElement)(Dj,{inputType:"formatUnderline",onInput:n}))}};function ote(e,t,n){const r=jy(t,e);if(!r)return;const o=r.attributes.style;if(o)return o.replace(new RegExp("^color:\\s*"),"");const a=r.attributes.class;if(a){const e=a.replace(/.*has-([^\s]*)-color.*/,"$1");return dC(n,e).color}}const ate=({name:e,value:t,onChange:n})=>{const r=Tl((e=>{const{getSettings:t}=e(nk);return(0,at.get)(t(),["colors"],[])})),o=(0,tt.useCallback)((o=>{if(o){const a=pC(r,o);n(Ay(t,{type:e,attributes:a?{class:mC("color",a.slug)}:{style:`color:${o}`}}))}else n(Qy(t,e))}),[r,n]),a=(0,tt.useMemo)((()=>ote(e,t,r)),[e,t,r]);return(0,tt.createElement)(WH,{value:a,onChange:o})};function ite({name:e,value:t,onChange:n,onClose:r,contentRef:o}){const a=S_({ref:o,value:t,settings:ute});return(0,tt.createElement)(nj,{value:t,onClose:r,className:"components-inline-color-popover",anchorRef:a},(0,tt.createElement)(ate,{name:e,value:t,onChange:n}))}const ste="core/text-color",lte=er("Text color"),cte=[];const ute={name:ste,title:lte,tagName:"span",className:"has-inline-color",attributes:{style:"style",class:"class"},edit:function({value:e,onChange:t,isActive:n,activeAttributes:r,contentRef:o}){const a=JL("color.custom"),i=JL("color.palette")||cte,[s,l]=(0,tt.useState)(!1),c=(0,tt.useCallback)((()=>l(!0)),[l]),u=(0,tt.useCallback)((()=>l(!1)),[l]),d=(0,tt.useMemo)((()=>{const t=ote(ste,e,i);if(t)return{backgroundColor:t}}),[e,i]),p=!(0,at.isEmpty)(i)||!a;return p||n?(0,tt.createElement)(tt.Fragment,null,(0,tt.createElement)(Nj,{key:n?"text-color":"text-color-not-active",className:"format-library-text-color-button",name:n?"text-color":void 0,icon:(0,tt.createElement)(tt.Fragment,null,(0,tt.createElement)($L,{icon:Uz}),n&&(0,tt.createElement)("span",{className:"format-library-text-color-button__indicator",style:d})),title:lte,onClick:p?c:()=>t(Qy(e,ste))}),s&&(0,tt.createElement)(ite,{name:ste,onClose:u,activeAttributes:r,value:e,onChange:t,contentRef:o})):null}},dte=(0,tt.createElement)(mo,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,tt.createElement)(uo,{d:"M16.9 18.3l.8-1.2c.4-.6.7-1.2.9-1.6.2-.4.3-.8.3-1.2 0-.3-.1-.7-.2-1-.1-.3-.4-.5-.6-.7-.3-.2-.6-.3-1-.3s-.8.1-1.1.2c-.3.1-.7.3-1 .6l.2 1.3c.3-.3.5-.5.8-.6s.6-.2.9-.2c.3 0 .5.1.7.2.2.2.2.4.2.7 0 .3-.1.5-.2.8-.1.3-.4.7-.8 1.3L15 19.4h4.3v-1.2h-2.4zM14.1 7.2h-2L9.5 11 6.9 7.2h-2l3.6 5.3L4.7 18h2l2.7-4 2.7 4h2l-3.8-5.5 3.8-5.3z"})),pte="core/subscript",mte=er("Subscript"),fte={name:pte,title:mte,tagName:"sub",className:null,edit:({isActive:e,value:t,onChange:n,onFocus:r})=>(0,tt.createElement)(Nj,{icon:dte,title:mte,onClick:function(){n(__(t,{type:pte})),r()},isActive:e})},hte=(0,tt.createElement)(mo,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,tt.createElement)(uo,{d:"M16.9 10.3l.8-1.3c.4-.6.7-1.2.9-1.6.2-.4.3-.8.3-1.2 0-.3-.1-.7-.2-1-.2-.2-.4-.4-.7-.6-.3-.2-.6-.3-1-.3s-.8.1-1.1.2c-.3.1-.7.3-1 .6l.1 1.3c.3-.3.5-.5.8-.6s.6-.2.9-.2c.3 0 .5.1.7.2.2.2.2.4.2.7 0 .3-.1.5-.2.8-.1.3-.4.7-.8 1.3l-1.8 2.8h4.3v-1.2h-2.2zm-2.8-3.1h-2L9.5 11 6.9 7.2h-2l3.6 5.3L4.7 18h2l2.7-4 2.7 4h2l-3.8-5.5 3.8-5.3z"})),gte="core/superscript",bte=er("Superscript"),vte={name:gte,title:bte,tagName:"sup",className:null,edit:({isActive:e,value:t,onChange:n,onFocus:r})=>(0,tt.createElement)(Nj,{icon:hte,title:bte,onClick:function(){n(__(t,{type:gte})),r()},isActive:e})},yte="core/keyboard",_te=er("Keyboard input");[Dee,Pee,Hee,Xee,Qee,tte,rte,ute,fte,vte,{name:yte,title:_te,tagName:"kbd",className:null,edit:({isActive:e,value:t,onChange:n,onFocus:r})=>(0,tt.createElement)(Nj,{icon:tZ,title:_te,onClick:function(){n(__(t,{type:yte})),r()},isActive:e})}].forEach((({name:e,...t})=>function(e,t){if("string"==typeof(t={name:e,...t}).name)if(/^[a-z][a-z0-9-]*\/[a-z][a-z0-9-]*$/.test(t.name))if(tn(ky).getFormatType(t.name))window.console.error('Format "'+t.name+'" is already registered.');else if("string"==typeof t.tagName&&""!==t.tagName)if("string"==typeof t.className&&""!==t.className||null===t.className)if(/^[_a-zA-Z]+[a-zA-Z0-9-]*$/.test(t.className)){if(null===t.className){const e=tn(ky).getFormatTypeForBareElement(t.tagName);if(e)return void window.console.error(`Format "${e.name}" is already registered to handle bare tag name "${t.tagName}".`)}else{const e=tn(ky).getFormatTypeForClassName(t.className);if(e)return void window.console.error(`Format "${e.name}" is already registered to handle class name "${t.className}".`)}if("title"in t&&""!==t.title)if("keywords"in t&&t.keywords.length>3)window.console.error('The format "'+t.name+'" can have a maximum of 3 keywords.');else{if("string"==typeof t.title)return nn(ky).addFormatTypes(t),t;window.console.error("Format titles must be strings.")}else window.console.error('The format "'+t.name+'" must have a title.')}else window.console.error("A class name must begin with a letter, followed by any number of hyphens, letters, or numbers.");else window.console.error("Format class names must be a string, or null to handle bare elements.");else window.console.error("Format tag names must be a string.");else window.console.error("Format names must contain a namespace prefix, include only lowercase alphanumeric characters or dashes, and start with a letter. Example: my-plugin/my-custom-format");else window.console.error("Format names must be strings.")}(e,t)));const Mte=["button","submit"];const kte=ri((e=>class extends tt.Component{constructor(){super(...arguments),this.bindNode=this.bindNode.bind(this),this.cancelBlurCheck=this.cancelBlurCheck.bind(this),this.queueBlurCheck=this.queueBlurCheck.bind(this),this.normalizeButtonFocus=this.normalizeButtonFocus.bind(this)}componentWillUnmount(){clearTimeout(this.blurCheckTimeout)}bindNode(e){e?this.node=e:(delete this.node,this.cancelBlurCheck())}queueBlurCheck(e){e.persist(),this.preventBlurCheck||(this.blurCheckTimeout=setTimeout((()=>{document.hasFocus()?"function"==typeof this.node.handleFocusOutside&&this.node.handleFocusOutside(e):e.preventDefault()}),0))}cancelBlurCheck(){clearTimeout(this.blurCheckTimeout),void 0!==this.node&&"function"==typeof this.node.handleFocus&&this.node.handleFocus(event)}normalizeButtonFocus(e){const{type:t,target:n}=e;(0,at.includes)(["mouseup","touchend"],t)?this.preventBlurCheck=!1:function(e){switch(e.nodeName){case"A":case"BUTTON":return!0;case"INPUT":return(0,at.includes)(Mte,e.type)}return!1}(n)&&(this.preventBlurCheck=!0)}render(){return(0,tt.createElement)("div",{onFocus:this.cancelBlurCheck,onMouseDown:this.normalizeButtonFocus,onMouseUp:this.normalizeButtonFocus,onTouchStart:this.normalizeButtonFocus,onTouchEnd:this.normalizeButtonFocus,onBlur:this.queueBlurCheck},(0,tt.createElement)(e,ot({ref:this.bindNode},this.props)))}}),"withFocusOutside")(class extends tt.Component{handleFocus(e){this.props.onFocus()}handleFocusOutside(e){const t=e.relatedTarget||e.target;t&&t.classList.contains("media-modal")||this.props.onOutside()}render(){return this.props.children}}),wte=(0,tt.createElement)(mo,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,tt.createElement)(uo,{fillRule:"evenodd",d:"M10.289 4.836A1 1 0 0111.275 4h1.306a1 1 0 01.987.836l.244 1.466c.787.26 1.503.679 2.108 1.218l1.393-.522a1 1 0 011.216.437l.653 1.13a1 1 0 01-.23 1.273l-1.148.944a6.025 6.025 0 010 2.435l1.149.946a1 1 0 01.23 1.272l-.653 1.13a1 1 0 01-1.216.437l-1.394-.522c-.605.54-1.32.958-2.108 1.218l-.244 1.466a1 1 0 01-.987.836h-1.306a1 1 0 01-.986-.836l-.244-1.466a5.995 5.995 0 01-2.108-1.218l-1.394.522a1 1 0 01-1.217-.436l-.653-1.131a1 1 0 01.23-1.272l1.149-.946a6.026 6.026 0 010-2.435l-1.148-.944a1 1 0 01-.23-1.272l.653-1.131a1 1 0 011.217-.437l1.393.522a5.994 5.994 0 012.108-1.218l.244-1.466zM14.929 12a3 3 0 11-6 0 3 3 0 016 0z",clipRule:"evenodd"}));const Ete=lS([QI(((e,{feature:t})=>({isActive:e("isolated/editor").isFeatureActive(t)}))),eP(((e,t)=>({onToggle(){e("isolated/editor").toggleFeature(t.feature),t.onClose()}}))),pq])((function({onToggle:e,isActive:t,label:n,info:r,messageActivated:o,messageDeactivated:a,speak:i}){return(0,tt.createElement)(zB,{icon:t&&kS,isSelected:t,onClick:(0,at.flow)(e,(()=>{i(t?a||er("Feature deactivated"):o||er("Feature activated"))})),role:"menuitemcheckbox",info:r},n)}));const Lte=lS([QI(((e,{option:t})=>({isActive:e("isolated/editor").isOptionActive(t)}))),eP(((e,t)=>({onToggle(){e("isolated/editor").toggleOption(t.option),t.onClose()}}))),pq])((function({onToggle:e,isActive:t,label:n,info:r}){return(0,tt.createElement)(zB,{icon:t&&kS,isSelected:t,onClick:e,role:"menuitemcheckbox",info:r},n)}));const Ate=function({onClose:e,settings:t}){var n;const{preview:r,fullscreen:o,topToolbar:a}=(null==t||null===(n=t.iso)||void 0===n?void 0:n.moreMenu)||{},{isFullscreen:i}=Tl((e=>({isFullscreen:e("isolated/editor").isOptionActive("fullscreenMode")})),[]);return o||r||a?(0,tt.createElement)(ON,{label:tr("View","noun")},a&&(0,tt.createElement)(tt.Fragment,null,(0,tt.createElement)(Ete,{feature:"fixedToolbar",label:er("Top toolbar"),info:er("Access all block and document tools in a single place."),messageActivated:er("Top toolbar activated"),messageDeactivated:er("Top toolbar deactivated"),onClose:e})),o&&(0,tt.createElement)(Lte,{option:"fullscreenMode",label:er("Fullscreen"),info:er("Show editor fullscreen."),onClose:e}),r&&!i&&(0,tt.createElement)(Lte,{option:"preview",label:er("Preview"),info:er("Preview the content before posting."),onClose:e})):null};const Ste=lS([QI((e=>{const{getEditorMode:t}=e("isolated/editor"),{codeEditingEnabled:n}=e("core/editor").getEditorSettings();return{editorMode:t(),isCodeEditingEnabled:n}})),eP((e=>({onSetMode(t){e("isolated/editor").setEditorMode(t)}})))])((function({onClose:e,editorMode:t,onSetMode:n,isCodeEditingEnabled:r,settings:o}){var a,i,s;const l=t=>{n(t),e()};return r&&!1!==(null==o||null===(a=o.iso)||void 0===a?void 0:a.moreMenu)&&null!=o&&null!==(i=o.iso)&&void 0!==i&&null!==(s=i.moreMenu)&&void 0!==s&&s.editor?(0,tt.createElement)(ON,{label:tr("Editor","noun")},(0,tt.createElement)(zB,{icon:"visual"===t&&kS,isSelected:"visual"===t,onClick:()=>l("visual"),role:"menuitemcheckbox"},er("Visual editor")),(0,tt.createElement)(zB,{icon:"text"===t&&kS,isSelected:"text"===t,onClick:()=>l("text"),role:"menuitemcheckbox"},er("Code editor"))):null}));const Cte=function({settings:e}){const{linkMenu:t=[]}=e.iso||{};return 0===t.length?null:(0,tt.createElement)(ON,{label:er("Links")},t.map((({title:e,url:t})=>(0,tt.createElement)(zB,{key:e},(0,tt.createElement)(CA,{href:t},e)))))},Tte={className:"edit-post-more-menu__content",position:"bottom left"},xte={tooltipPosition:"bottom"},zte=({settings:e,onClick:t,renderMoreMenu:n})=>(0,tt.createElement)(Zg,{className:"edit-post-more-menu",icon:OB,label:er("More tools & options"),popoverProps:Tte,toggleProps:{...xte,onClick:t}},(({onClose:t})=>(0,tt.createElement)(tt.Fragment,null,n&&n(e,t),(0,tt.createElement)(Ste,{onClose:t,settings:e}),(0,tt.createElement)(Ate,{onClose:t,settings:e}),(0,tt.createElement)(Cte,{settings:e})))),Ote=(0,tt.createElement)(mo,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,tt.createElement)(uo,{d:"M15.6 6.5l-1.1 1 2.9 3.3H8c-.9 0-1.7.3-2.3.9-1.4 1.5-1.4 4.2-1.4 5.6v.2h1.5v-.3c0-1.1 0-3.5 1-4.5.3-.3.7-.5 1.3-.5h9.2L14.5 15l1.1 1.1 4.6-4.6-4.6-5z"}));const Nte=(0,tt.forwardRef)((function(e,t){const n=Tl((e=>e("core/editor").hasEditorRedo()),[]),{redo:r}=ld("core/editor");return(0,tt.createElement)(Eh,ot({},e,{ref:t,icon:Ote,label:er("Redo"),shortcut:bm.primaryShift("z"),"aria-disabled":!n,onClick:n?r:void 0,className:"editor-history__redo"}))})),Dte=(0,tt.createElement)(mo,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,tt.createElement)(uo,{d:"M18.3 11.7c-.6-.6-1.4-.9-2.3-.9H6.7l2.9-3.3-1.1-1-4.5 5L8.5 16l1-1-2.7-2.7H16c.5 0 .9.2 1.3.5 1 1 1 3.4 1 4.5v.3h1.5v-.2c0-1.5 0-4.3-1.5-5.7z"}));const Bte=(0,tt.forwardRef)((function(e,t){const n=Tl((e=>e("isolated/editor").hasEditorUndo()),[]),{undo:r}=ld("isolated/editor");return(0,tt.createElement)(Eh,ot({},e,{ref:t,icon:Dte,label:er("Undo"),shortcut:bm.primary("z"),"aria-disabled":!n,onClick:n?r:void 0,className:"editor-history__undo"}))}));const Ite=function(e){const t=(0,tt.useRef)(),{setIsInserterOpened:n}=ld("isolated/editor"),r=Jp("medium","<"),{hasFixedToolbar:o,hasPeers:a,isInserterEnabled:i,isTextModeEnabled:s,previewDeviceType:l,isInserterOpened:c}=Tl((e=>{const{hasInserterItems:t,getBlockRootClientId:n,getBlockSelectionEnd:r}=e("core/block-editor");return{hasFixedToolbar:e("isolated/editor").isFeatureActive("fixedToolbar"),hasPeers:e("isolated/editor").hasPeers(),isInserterEnabled:"visual"===e("isolated/editor").getEditorMode()&&e("core/editor").getEditorSettings().richEditingEnabled&&t(n(r())),isTextModeEnabled:"text"===e("isolated/editor").getEditorMode(),previewDeviceType:"Desktop",isInserterOpened:e("isolated/editor").isInserterOpened()}}),[]),u=Jp("medium"),{inserter:d,toc:p,navigation:m,undo:f}=e.settings.iso.toolbar,h=f&&!a,g=!u||"Desktop"!==l||o,b=er(g?"Document and block tools":"Document tools");return(0,tt.createElement)(MY,{className:"edit-post-header-toolbar","aria-label":b},(d||h||m||p)&&(0,tt.createElement)("div",{className:"edit-post-header-toolbar__left"},d&&(0,tt.createElement)(Hg,{ref:t,as:Eh,className:"edit-post-header-toolbar__inserter-toggle",isPrimary:!0,isPressed:c,onMouseDown:e=>{e.preventDefault()},onClick:()=>{c?t.current.focus():n(!0)},disabled:!i,icon:OS,label:tr("Add block","Generic label for block inserter button")}),c&&(0,tt.createElement)(_f,{position:"bottom right",onClose:()=>n(!1),anchorRef:t.current},(0,tt.createElement)(uF,{showMostUsedBlocks:!1,showInserterHelpPanel:!0,onSelect:()=>{r&&n(!1)}})),h&&(0,tt.createElement)(Hg,{as:Bte}),h&&(0,tt.createElement)(Hg,{as:Nte}),m&&(0,tt.createElement)(Hg,{as:bH,isDisabled:s}),p&&(0,tt.createElement)(Hg,{as:hK,hasOutlineItemsDisabled:s})),g&&!s&&(0,tt.createElement)("div",{className:"edit-post-header-toolbar__block-toolbar"},(0,tt.createElement)(XY,{hideDragHandle:!0})))},Pte=({currentTab:e,setTab:t,documentTitle:n})=>{const r=(0,tt.createRef)(),o=(0,tt.createRef)();return(0,tt.useEffect)((()=>{"document"===e?r.current.focus():o.current.focus()}),[]),(0,tt.createElement)("div",{className:"components-panel__header interface-complementary-area-header edit-post-sidebar__panel-tabs"},(0,tt.createElement)("ul",null,(0,tt.createElement)("li",null,(0,tt.createElement)(Eh,{onClick:()=>t("document"),ref:r,className:so()("edit-post-sidebar__panel-tab","document"===e&&"is-active")},n)),(0,tt.createElement)("li",null,(0,tt.createElement)(Eh,{onClick:()=>t("block"),ref:o,className:so()("edit-post-sidebar__panel-tab","block"===e&&"is-active")},er("Block")))))},{Fill:Rte,Slot:Yte}=pf("PluginDocumentSettingPanel"),Wte=({children:e})=>(0,tt.createElement)(Rte,null,e);Wte.Slot=function(e){return(0,tt.createElement)(Yte,null,(e=>0===e.length?(0,tt.createElement)("span",{className:"block-editor-block-inspector__no-blocks"},er("Nothing to display")):e))};const Hte=Wte;const qte=function(e){const{documentInspector:t,blockSelected:n}=e,[r,o]=(0,tt.useState)(n||!t?"block":"document");return(0,tt.createElement)(_f,{position:"bottom",className:"iso-inspector"},t&&(0,tt.createElement)(Pte,{setTab:o,currentTab:r,documentTitle:t}),"block"===r&&(0,tt.createElement)(cF,null),"document"===r&&(0,tt.createElement)(Hte.Slot,null))},{Fill:jte,Slot:Fte}=pf("IsolatedToolbar"),Vte=({children:e})=>(0,tt.createElement)(jte,null,e);Vte.Slot=function(e){return(0,tt.createElement)(Fte,null,(e=>e))};const Xte=Vte,Ute=e=>{var t;const{settings:n,editorMode:r,renderMoreMenu:o}=e,{inspector:a,documentInspector:i}=(null===(t=n.iso)||void 0===t?void 0:t.toolbar)||{},{moreMenu:s}=n.iso||{},{setInspecting:l}=ld("isolated/editor"),{isInspecting:c,isBlockSelected:u}=Tl((e=>({isInspecting:e("isolated/editor").isInspecting(),isBlockSelected:!!e("core/block-editor").getBlockSelectionStart()})),[]);return(0,tt.useEffect)((()=>{c&&!u&&l(!1)}),[u]),(0,tt.createElement)("div",{className:"edit-post-editor-regions__header",role:"region",tabIndex:-1},(0,tt.createElement)("div",{className:"edit-post-header"},(0,tt.createElement)("div",{className:"edit-post-header__toolbar"},(0,tt.createElement)(Ite,{settings:n})),(0,tt.createElement)("div",{className:"edit-post-header__settings"},(0,tt.createElement)(Xte.Slot,null),a&&(0,tt.createElement)(Eh,{icon:wte,label:er("Settings"),onClick:()=>l(!c),isPressed:c,"aria-expanded":c,shortcut:"x",disabled:"text"===r}),c&&(0,tt.createElement)(qte,{documentInspector:i,blockSelected:u}),s&&(0,tt.createElement)(zte,{settings:n,onClick:()=>l(!1),renderMoreMenu:o}))))},$te=()=>{const e=Ym([(0,tt.useRef)(),GI(),C_((e=>{function t(t){if(t.target!==e)return;const n=Om.focusable.find(e),r=(0,at.findLast)(n,OF);if(!r)return;const{bottom:o}=r.getBoundingClientRect();t.clientY{e.addEventListener("mousedown",t)}}),[]),bF(),ZY(),fF()]);return(0,tt.createElement)("div",{className:"edit-post-visual-editor"},(0,tt.createElement)(_f.Slot,{name:"block-toolbar"}),(0,tt.createElement)("div",{className:"editor-styles-wrapper",ref:e},(0,tt.createElement)(zF,null,(0,tt.createElement)(nW,null))))};class Kte extends tt.Component{constructor(e){super(e),this.edit=this.edit.bind(this),this.stopEditing=this.stopEditing.bind(this),this.state={}}static getDerivedStateFromProps(e,t){return t.isDirty?null:{value:e.value,isDirty:!1}}edit(e){const t=e.target.value;this.props.onChange(t),this.setState({value:t,isDirty:!0})}stopEditing(){this.state.isDirty&&(this.props.onPersist(this.state.value),this.setState({isDirty:!1}))}render(){const{value:e}=this.state,{instanceId:t}=this.props;return(0,tt.createElement)(tt.Fragment,null,(0,tt.createElement)("label",{htmlFor:`post-content-${t}`,className:"screen-reader-text"},er("Type text or HTML")),(0,tt.createElement)(yR.Z,{autoComplete:"off",dir:"auto",value:e,onChange:this.edit,onBlur:this.stopEditing,className:"editor-post-text-editor",id:`post-content-${t}`,placeholder:er("Start writing with text or HTML")}))}}const Gte=lS([QI((e=>{const{getBlocks:t}=e("isolated/editor");return{value:gi(t())}})),eP((e=>{const{updateBlocksWithoutUndo:t}=e("isolated/editor");return{onChange(e){const n=ns(e);t(n)},onPersist(e){const n=ns(e);t(n)}}})),cS])(Kte);const Jte=function({}){return(0,tt.createElement)("div",{className:"edit-post-text-editor"},(0,tt.createElement)("div",{className:"edit-post-text-editor__body"},(0,tt.createElement)(Gte,null)))},Qte="is-fullscreen-mode";function Zte(){document.body.classList.remove(Qte),document.querySelector("html").classList.remove(Qte)}function ene(){const{fullscreenMode:e}=Tl((e=>({fullscreenMode:e("isolated/editor").isOptionActive("fullscreenMode")})),[]);return(0,tt.useEffect)((()=>(e?(document.body.classList.add(Qte),document.querySelector("html").classList.add(Qte)):Zte(),()=>{Zte()})),[e]),null}const tne=eP(((e,t,{select:n})=>{const r=n("isolated/editor").hasPeers,{redo:o,undo:a}=e("isolated/editor"),i=t=>()=>{if(r()){const t="isolated/undo-disabled";return e("core/notices").removeNotice(t),e("core/notices").createNotice("warning","Undo/redo is disabled while editing with other users.",{id:t})}return t()};return{redo:i(o),undo:i(a)}}))((function(e){const{isEditing:t,editorMode:n,children:r,undo:o,redo:a}=e;return(0,tt.createElement)(tt.Fragment,null,(0,tt.createElement)(ene,null),(0,tt.createElement)(Z$,null),t&&(0,tt.createElement)(tt.Fragment,null,(0,tt.createElement)(pF,null),(0,tt.createElement)(pF.Register,null)),(0,tt.createElement)(aS,{bindGlobal:!1,shortcuts:{[hm.primary("z")]:o,[hm.primaryShift("z")]:a}},"visual"===n&&(0,tt.createElement)($te,null),"text"===n&&(0,tt.createElement)(Jte,null)),r)}));const nne=function(e,t,n,r){if(void 0===e)return r;if(r&&r.length>0)return r;if(t){const n=((e,t)=>e&&e.find((e=>e.name===t)))(e,t);if(n)return ns(n.content)}return n?ml(r,n):[]};const rne=lS([QI((e=>{const{getBlocks:t,getEditorSelection:n,getEditorMode:r,isEditing:o}=e("isolated/editor");return{blocks:t(),selection:n(),isEditing:o(),editorMode:r()}})),eP((e=>{const{updateBlocksWithUndo:t,updateBlocksWithoutUndo:n}=e("isolated/editor");return{updateBlocksWithUndo:t,updateBlocksWithoutUndo:n}}))])((function(e){const{blocks:t,updateBlocksWithoutUndo:n,updateBlocksWithUndo:r,selection:o,isEditing:a,editorMode:i}=e,{children:s,settings:l,renderMoreMenu:c,onLoad:u}=e;return(0,tt.useEffect)((()=>{const e=function(e,t){return nne(e.iso.patterns,e.iso.currentPattern,e.editor.template,t)}(l,u?u(ns,Ns):[]);e.length>0&&(!t||0===t.length)&&n(e)}),[]),(0,tt.createElement)(IP,{value:t||[],onInput:n,onChange:r,useSubRegistry:!1,selection:o,settings:l.editor},(0,tt.createElement)(Ute,{editorMode:i,settings:l,renderMoreMenu:c}),(0,tt.createElement)(tne,{isEditing:a,editorMode:i},s),(0,tt.createElement)(_f.Slot,null))}));function one(e,t){const n=["core/block-editor","core/editor"];return{dispatch:t=>null===one.targetDispatch||-1===n.indexOf(t)?e.dispatch(t):one.targetDispatch(t),select:t=>null===one.targetSelect||-1===n.indexOf(t)?e.select(t):one.targetSelect(t)}}one.targetSelect=null,one.targetDispatch=null,one.setEditor=function(e,t){this.targetSelect=e,this.targetDispatch=t},one.resetEditor=function(){this.targetSelect=null,this.targetDispatch=null};const ane=one;const ine=lS([QI((e=>{const{isEditing:t}=e("isolated/editor");return{isEditing:t()}})),eP(((e,t,{select:n})=>({hotSwap:t=>{ane.resetEditor(),t&&ane.setEditor(n,e)}})))])((function({isEditing:e,hotSwap:t}){return(0,tt.useEffect)((()=>{t(e)}),[e]),null}));const sne=lS([QI((e=>{const{isEditorReady:t,getEditorMode:n,isEditing:r,isFeatureActive:o}=e("isolated/editor");return{isEditorReady:t(),editorMode:n(),isEditing:r(),hasFixedToolbar:o("fixedToolbar")}})),eP((e=>{const{setEditing:t}=e("isolated/editor");return{setEditing:t}}))])((function(e){const{children:t,settings:n,className:r,onError:o,renderMoreMenu:a,onLoad:i}=e,{isEditorReady:s,editorMode:l,isEditing:c,setEditing:u,hasFixedToolbar:d}=e,[p,{width:m}]=em(),f=so()(r,{"iso-editor":!0,"is-large":!!m&&m>=720,"is-medium":!m||m>=480&&m<720,"is-small":!!m&&m<480,"iso-editor__loading":!s,"iso-editor__selected":c,"block-editor":!0,"edit-post-layout":!0,"has-fixed-toolbar":d,["is-mode-"+l]:!0});return(0,tt.createElement)("div",{className:f},(0,tt.createElement)(nK,{onError:o},(0,tt.createElement)(ine,null),p,(0,tt.createElement)(kte,{onOutside:()=>u(!1),onFocus:()=>!c&&u(!0)},(0,tt.createElement)(rne,{settings:n,renderMoreMenu:a,onLoad:i},t))))}));let lne;const cne={getItem:e=>lne&&lne[e]?lne[e]:null,setItem(e,t){lne||cne.clear(),lne[e]=String(t)},clear(){lne=Object.create(null)}},une=cne;let dne;try{dne=window.localStorage,dne.setItem("__wpDataTestLocalStorage",""),dne.removeItem("__wpDataTestLocalStorage")}catch(e){dne=une}const pne=dne,mne="WP_DATA";function fne(e){const{storage:t=pne,storageKey:n=mne}=e;let r;return{get:function(){if(void 0===r){const e=t.getItem(n);if(null===e)r={};else try{r=JSON.parse(e)}catch(e){r={}}}return r},set:function(e,o){r={...r,[e]:o},t.setItem(n,JSON.stringify(r))}}}function hne(e,t){const n=fne(t);return{registerStore(t,r){if(!r.persist)return e.registerStore(t,r);const o=n.get()[t];if(void 0!==o){let e=r.reducer(r.initialState,{type:"@@WP/PERSISTENCE_RESTORE"});e=(0,at.isPlainObject)(e)&&(0,at.isPlainObject)(o)?(0,at.merge)({},e,o):o,r={...r,initialState:e}}const a=e.registerStore(t,r);return a.subscribe(function(e,t,r){let o;if(Array.isArray(r)){const e=r.reduce(((e,t)=>Object.assign(e,{[t]:(e,n)=>n.nextState[t]})),{});o=(e=>(t,n)=>n.nextState===t?t:e(t,n))(st()(e))}else o=(e,t)=>t.nextState;let a=o(void 0,{nextState:e()});return()=>{const r=o(a,{nextState:e()});r!==a&&(n.set(t,r),a=r)}}(a.getState,t,r.persist)),a}}}hne.__unstableMigrate=e=>{var t,n;const r=fne(e),o=r.get(),a=null===(t=o["core/editor"])||void 0===t||null===(n=t.preferences)||void 0===n?void 0:n.insertUsage;if(a){var i,s;const e=null===(i=o["core/block-editor"])||void 0===i||null===(s=i.preferences)||void 0===s?void 0:s.insertUsage;r.set("core/block-editor",{preferences:{insertUsage:{...a,...e}}})}let l=o["core/edit-post"];const c=Object.keys(o).length>0,u=(0,at.has)(o,["core/edit-post","preferences","features","fullscreenMode"]);c&&!u&&(l=(0,at.merge)({},l,{preferences:{features:{fullscreenMode:!1}}}));const d=(0,at.get)(o,["core/nux","preferences","areTipsEnabled"]),p=(0,at.has)(o,["core/edit-post","preferences","features","welcomeGuide"]);void 0===d||p||(l=(0,at.merge)({},l,{preferences:{features:{welcomeGuide:d}}})),l!==o["core/edit-post"]&&r.set("core/edit-post",l)};const gne=hne;var bne=n(1090);const vne={editCount:0,selection:null,blocks:null};function yne(e,t){return e.find((e=>e.clientId===t.clientId))}function _ne(e,t){const{type:n,selection:r}=e;if("UPDATE_BLOCKS_WITHOUT_UNDO"===n)return!1;if(!r)return!0;if(ni(r,t.selection)){const n=yne(t.blocks,r.selectionStart),o=yne(e.blocks,r.selectionStart);if(n&&o&&ni(n.attributes,o.attributes))return!1}return!0}const Mne=(0,bne.ZP)(((e=vne,t)=>{switch(t.type){case"UPDATE_BLOCKS_WITHOUT_UNDO":case"UPDATE_BLOCKS_WITH_UNDO":return{...e,editCount:_ne(t,e)?e.editCount+1:e.editCount,blocks:t.blocks,selection:t.selection}}return e}),{groupBy:(e,t,n)=>t.editCount}),kne={undo:()=>bne.zF.undo(),redo:()=>bne.zF.redo(),updateBlocksWithUndo:(e,t={})=>({type:"UPDATE_BLOCKS_WITH_UNDO",blocks:e,...t}),updateBlocksWithoutUndo:(e,t={})=>({type:"UPDATE_BLOCKS_WITHOUT_UNDO",blocks:e,...t})},wne={editorMode:"visual",isInserterOpened:!1,isEditing:!1,isInspecting:!1,isReady:!1,patterns:[],currentPattern:null,gutenbergTemplate:null,ignoredContent:[],settings:{preferencesKey:null,persistenceKey:null,blocks:{allowBlocks:[],disallowBlocks:[]},disallowEmbed:[],customStores:[],toolbar:{inserter:!0,toc:!1,undo:!0,inspector:!0,navigation:!1,documentInspector:!1},moreMenu:{editor:!1,fullscreen:!1,preview:!1,topToolbar:!1},linkMenu:[],currentPattern:null,patterns:[],defaultPreferences:{},allowApi:!1}};function Ene(e,t,n){const r=[gi(Ho("core/paragraph")),gi(Ho("core/paragraph",{className:""}))],o=((e,t)=>e&&e.find((e=>e.name===t)))(e,t);return o&&r.push(gi(ns(o.content))),n&&r.push(gi(ml([],n))),r}const Lne=(e=wne,t)=>{switch(t.type){case"SETUP_EDITOR":{const{currentPattern:n,patterns:r}=t.settings.iso;return{...e,patterns:r,currentPattern:n,ignoredContent:Ene(r,n,t.settings.editor.template),gutenbergTemplate:t.settings.editor.template,settings:{...e.settings,...t.settings.iso}}}case"SET_CURRENT_PATTERN":return{...e,currentPattern:t.pattern,ignoredContent:Ene(e.patterns,t.pattern,e.gutenbergTemplate),isInspecting:!1};case"SET_EDITOR_MODE":return{...e,editorMode:t.editorMode,isInspecting:!1};case"SET_INSERTER_OPEN":return{...e,isInserterOpened:t.isOpen,isInspecting:!1};case"SET_INSPECTOR_OPEN":return{...e,isInspecting:t.isOpen,isInserterOpened:!1};case"SET_EDITING":return{...e,isEditing:t.isEditing,isInspecting:!1};case"SET_EDITOR_READY":return{...e,isReady:t.isReady}}return e},Ane={setReady:e=>({type:"SET_EDITOR_READY",isReady:e}),setEditorMode:e=>({type:"SET_EDITOR_MODE",editorMode:e}),setupEditor:e=>({type:"SETUP_EDITOR",settings:e}),setCurrentPattern:e=>({type:"SET_CURRENT_PATTERN",pattern:e}),setIsInserterOpened:e=>({type:"SET_INSERTER_OPEN",isOpen:e}),setEditing:e=>({type:"SET_EDITING",isEditing:e}),setInspecting:e=>({type:"SET_INSPECTOR_OPEN",isOpen:e})},Sne=(e,t)=>{switch(t.type){case"TOGGLE_FEATURE":return{...e,[t.feature]:!e[t.feature]||!e[t.feature]}}return e},Cne={toggleFeature:e=>({type:"TOGGLE_FEATURE",feature:e})},Tne={},xne=(e=Tne,t)=>{switch(t.type){case"TOGGLE_OPTION":return{...e,[t.option]:!e[t.option]||!e[t.option]}}return e},zne={toggleOption:e=>({type:"TOGGLE_OPTION",option:e})},One=(e={},t)=>{switch(t.type){case"SET_PEER_SELECTION":return e[t.peerId]?{...e,[t.peerId]:{...e[t.peerId],...t.selection}}:e;case"SET_AVAILABLE_PEERS":return t.peers.reduce(((t,{id:n,name:r,color:o})=>(t[n]=e[n]||{name:r,color:o},t)),{})}return e};const Nne={setAvailablePeers:function(e){return{type:"SET_AVAILABLE_PEERS",peers:e}},setPeerSelection:function(e,t){return{type:"SET_PEER_SELECTION",peerId:e,selection:t}}};function Dne(e){return e.editor.editorMode}function Bne(e){return e.editor.settings}function Ine(e){return e.editor.isReady}function Pne(e){return e.editor.currentPattern}function Rne(e){const{currentPattern:t,patterns:n}=e.editor;if(t&&n)for(let e=0;ee.name===t));return r||(r=n.find((e=>e.name.replace("p2/","")===t)),r||null)}function Hne(e){return e.editor.isInserterOpened}function qne(e){return e.editor.isInspecting}function jne(e){return e.editor.isEditing}function Fne(e){return e.editor.patterns}function Vne(e){return e.blocks.present.blocks}function Xne(e){return e.blocks.present.selection}function Une(e){return e.blocks.past.length>0&&"visual"===Dne(e)}function $ne(e){return e.blocks.future.length>0&&"visual"===Dne(e)}function Kne(e){return e.blocks.present.editCount}function Gne(e,t){return!!e.preferences[t]&&e.preferences[t]}function Jne(e,t){return!!e.options[t]&&e.options[t]}function Qne(e){return e.peers}function Zne(e){return Object.keys(e.peers).length>0}const ere=function(e,t){return{reducer:st()({blocks:Mne,editor:Lne,preferences:Sne,options:xne,peers:One}),actions:{...kne,...Ane,...zne,...Cne,...Nne},selectors:{...Ke,...$e,...Ge,...Je,...Qe},persist:["preferences"],initialState:{preferences:e&&localStorage.getItem(e)?JSON.parse(localStorage.getItem(e)):t}}};var tre=n(2965),nre=n.n(tre);const rre={TOGGLE_FEATURE(e,t){const{getState:n}=t,{preferences:r,editor:o}=n();o.settings.preferencesKey&&localStorage.setItem(o.settings.preferencesKey,JSON.stringify(r))}};const ore=function(e){let t=()=>{throw new Error("Dispatching while constructing your middleware is not allowed. Other middleware would not be applied to this dispatch.")};const n={getState:e.getState,dispatch:(...e)=>t(...e)};return t=nre()({...rre})(n)(e.dispatch),e.dispatch=t,e};var are=n(2950);const{replaceBlocks:ire,selectBlock:sre,setTemplateValidity:lre,resetBlocks:cre,selectionChange:ure}=tk.actions,{getBlock:dre,getBlocks:pre,getSelectedBlockCount:mre,getTemplateLock:fre,getTemplate:hre,isValidTemplate:gre,getSelectionStart:bre}=tk.selectors;const vre={MERGE_BLOCKS(e,t){const{dispatch:n}=t,r=t.getState(),[o,a]=e.blocks,i=dre(r,o),s=Bo(i.name);if(!s.merge)return void n(sre(i.clientId));const l=dre(r,a),c=Bo(l.name),{clientId:u,attributeKey:d,offset:p}=bre(r),m=(u===o?s:c).attributes[d],f=(u===o||u===a)&&void 0!==d&&void 0!==p&&!!m;m||("number"==typeof d?window.console.error("RichText needs an identifier prop that is the block attribute key of the attribute it controls. Its type is expected to be a string, but was "+typeof d):window.console.error("The RichText identifier prop does not match any attributes defined by the block."));const h=Fo(i),g=Fo(l);if(f){const e=u===o?h:g,t=e.attributes[d],{multiline:n,__unstableMultilineWrapperTags:r,__unstablePreserveWhiteSpace:a}=m,i=e_(Ny({html:t,multilineTag:n,multilineWrapperTags:r,preserveWhiteSpace:a}),"",p,p);e.attributes[d]=u_({value:i,multilineTag:n,preserveWhiteSpace:a})}const b=i.name===l.name?[g]:Jo(g,i.name);if(!b||!b.length)return;const v=s.merge(h.attributes,b[0].attributes);if(f){const e=(0,at.findKey)(v,(e=>"string"==typeof e&&-1!==e.indexOf(""))),t=v[e],{multiline:r,__unstableMultilineWrapperTags:o,__unstablePreserveWhiteSpace:a}=s.attributes[e],l=Ny({html:t,multilineTag:r,multilineWrapperTags:o,preserveWhiteSpace:a}),c=l.text.indexOf(""),u=u_({value:t_(l,c,c+1),multilineTag:r,preserveWhiteSpace:a});v[e]=u,n(ure(i.clientId,e,c,c))}n(ire([i.clientId,l.clientId],[{...i,attributes:{...i.attributes,...v}},...b.slice(1)]))},RESET_BLOCKS:[function(e,t){const n=t.getState(),r=hre(n),o=fre(n),a=!r||"all"!==o||pl(e.blocks,r);if(a!==gre(n))return lre(a)}],MULTI_SELECT:(e,{getState:t})=>{const n=mre(t());fy(pn(nr("%s block selected.","%s blocks selected.",n),n),"assertive")},SYNCHRONIZE_TEMPLATE(e,{getState:t}){const n=t(),r=ml(pre(n),hre(n));return cre(r)},MARK_AUTOMATIC_CHANGE(e,t){const{setTimeout:n,requestIdleCallback:r=(e=>n(e,100))}=window;r((()=>{t.dispatch({type:"MARK_AUTOMATIC_CHANGE_FINAL"})}))}};const yre=function(e){const t=[nre()(vre),are.Z];let n=()=>{throw new Error("Dispatching while constructing your middleware is not allowed. Other middleware would not be applied to this dispatch.")},r=[];const o={getState:e.getState,dispatch:(...e)=>n(...e)};return r=t.map((e=>e(o))),n=(0,at.flowRight)(...r)(e.dispatch),e.dispatch=n,e};function*_re(e){yield function(e){return{type:"CONVERT_BLOCK_TO_STATIC",clientId:e}}(e)}function*Mre(e){yield function(e){return{type:"CONVERT_BLOCKS_TO_REUSABLE",clientIds:e}}(e)}function*kre(e){yield function(e){return{type:"DELETE_REUSABLE_BLOCK",id:e}}(e)}function wre(e,t){return{type:"SET_EDITING_REUSABLE_BLOCK",clientId:e,isEditing:t}}function Ere(e,t){return e.isEditingReusableBlock[t]}const Lre={actions:Ze,controls:{CONVERT_BLOCK_TO_STATIC:St((e=>({clientId:t})=>{const n=e.select("core/block-editor").getBlock(t),r=e.select("core").getEditedEntityRecord("postType","wp_block",n.attributes.ref),o=ns(r.content);e.dispatch("core/block-editor").replaceBlocks(n.clientId,o)})),CONVERT_BLOCKS_TO_REUSABLE:St((e=>async function({clientIds:t}){const n={title:er("Untitled Reusable Block"),content:gi(e.select("core/block-editor").getBlocksByClientId(t)),status:"publish"},r=Ho("core/block",{ref:(await e.dispatch("core").saveEntityRecord("postType","wp_block",n)).id});e.dispatch("core/block-editor").replaceBlocks(t,r),e.dispatch(reusableBlocksStore).__experimentalSetEditingReusableBlock(r.clientId,!0)})),DELETE_REUSABLE_BLOCK:St((e=>async function({id:t}){if(!e.select("core").getEditedEntityRecord("postType","wp_block",t))return;const n=e.select("core/block-editor").getBlocks().filter((e=>Yo(e)&&e.attributes.ref===t)).map((e=>e.clientId));n.length&&e.dispatch("core/block-editor").removeBlocks(n),await e.dispatch("core").deleteEntityRecord("postType","wp_block",t)}))},reducer:st()({isEditingReusableBlock:function(e={},t){return"SET_EDITING_REUSABLE_BLOCK"===(null==t?void 0:t.type)?{...e,[t.clientId]:t.isEditing}:e}}),selectors:et};let Are=[];const Sre=ri((e=>DP((t=>{const{registry:n,settings:r,...o}=t,a=function(e){var t,n,r,o,a,i,s,l,c,u,d,p,m,f,h;const{iso:g,editor:b}=e;return{iso:{preferencesKey:null!==(t=null==g?void 0:g.preferencesKey)&&void 0!==t?t:null,persistenceKey:null!==(n=null==g?void 0:g.persistenceKey)&&void 0!==n?n:null,disallowEmbed:null!==(r=null==g?void 0:g.disallowEmbed)&&void 0!==r?r:[],customStores:null!==(o=null==g?void 0:g.customStores)&&void 0!==o?o:[],blocks:{allowBlocks:null!==(a=null==g||null===(i=g.blocks)||void 0===i?void 0:i.allowBlocks)&&void 0!==a?a:[],disallowBlocks:null!==(s=null==g||null===(l=g.blocks)||void 0===l?void 0:l.disallowBlocks)&&void 0!==s?s:[]},toolbar:{inserter:!0,inspector:!1,navigation:!1,documentInspector:!1,toc:!1,undo:!0,...null!==(c=null==g?void 0:g.toolbar)&&void 0!==c?c:{}},moreMenu:(v=null==g?void 0:g.moreMenu,y={editor:!1,fullscreen:!1,preview:!1,topToolbar:!1,...null!==(u=null==g?void 0:g.moreMenu)&&void 0!==u?u:{}},!1!==v&&y),linkMenu:null!==(d=null==g?void 0:g.linkMenu)&&void 0!==d?d:[],defaultPreferences:{fixedToolbar:!0,...null!==(p=null==g?void 0:g.defaultPreferences)&&void 0!==p?p:{}},allowApi:null!==(m=null==g?void 0:g.allowApi)&&void 0!==m&&m,currentPattern:null!==(f=null==g?void 0:g.currentPattern)&&void 0!==f?f:null,patterns:null!==(h=null==g?void 0:g.patterns)&&void 0!==h?h:[]},editor:{alignWide:!0,disableCustomColors:!1,disableCustomFontSizes:!1,disablePostFormats:!0,titlePlaceholder:er("Add title"),bodyPlaceholder:er("Start writing or type / to choose a block"),isRTL:!1,autosaveInterval:60,maxUploadFileSize:0,allowedMimeTypes:[],styles:{css:"body { font-family: 'Noto Serif' }"},imageSizes:[],richEditingEnabled:!0,codeEditingEnabled:!1,allowedBlockTypes:!0,__experimentalCanUserUseUnfilteredHTML:!1,__experimentalBlockPatterns:[],reusableBlocks:[],fixedToolbar:!0,...b,availableLegacyWidgets:{},hasPermissionsToManageWidgets:!1,__experimentalFetchLinkSuggestions:null!=b&&b.__experimentalFetchLinkSuggestions?null==b?void 0:b.__experimentalFetchLinkSuggestions:()=>[]}};var v,y}(r),{persistenceKey:i,preferencesKey:s,defaultPreferences:l,customStores:c=[]}=a.iso||{},[u,d]=(0,tt.useState)(null);return(0,tt.useEffect)((()=>{const e=Zt({"core/reusable-blocks":Lre},n);i&&e.use(gne,{persistenceKey:i});const t=e.registerStore("isolated/editor",ere(s,l)),r=e.registerStore("core/block-editor",{...tk,persist:["preferences"]}),o=e.registerStore("core/editor",{...X$,selectors:{...X$.selectors,...(a=X$.selectors,u=e.select,{getEditedPostAttribute:(e,t)=>"content"===t?gi(u("core/block-editor").getBlocks()):a.getEditedPostAttribute(e,t),getEditedPostContent:()=>gi(u("core/block-editor").getBlocks())})},persist:["preferences"]});var a,u;return c.map((t=>{Are.push(e.registerStore(t.name,t.config))})),Are.push(t),Are.push(r),Are.push(o),ore(t),d(e),yre(r),function(){Are=Are.filter((e=>e!==t))}}),[n]),u?(0,tt.createElement)(kl,{value:u},(0,tt.createElement)(e,ot({},o,{settings:a}))):null}))),"withRegistryProvider");function Cre(e,t){return e&&e.allowBlocks&&e.allowBlocks.length>0?e.allowBlocks:t.map((e=>e.name))}function Tre(e,t,n,r){const o=(a=t.blocks)&&a.disallowBlocks?a.disallowBlocks:[];var a;return{...e,hasFixedToolbar:r,allowedBlockTypes:Cre(t.blocks,n).filter((e=>-1===o.indexOf(e))),mediaUpload:0===e.allowedMimeTypes.length?null:e.mediaUpload}}const xre=lS([QI(((e,{settings:t})=>{const{isEditing:n,isFeatureActive:r}=e("isolated/editor"),{getBlockTypes:o}=e("core/blocks"),a=o(),i=r("fixedToolbar"),s=e("core").getEntityRecords("postType","wp_block");return{isEditing:n(),topToolbar:i,currentSettings:(0,tt.useMemo)((()=>{var e;return{...t,editor:{...Tre(t.editor,t.iso,a,i||(null===(e=t.editor)||void 0===e?void 0:e.hasFixedToolbar)||!1),__experimentalReusableBlocks:[],__experimentalFetchReusableBlocks:!1}}}),[t,a,i,s])}})),eP((e=>{const{updateEditorSettings:t,setupEditorState:n}=e("core/editor"),{updateSettings:r}=e("core/block-editor"),{setupEditor:o}=e("isolated/editor");return{setupEditor:o,setupCoreEditor:n,updateSettings:({editor:e})=>{r(e),t(e)}}}))])((function(e){var t;const{currentSettings:n,updateSettings:r,setupEditor:o,isEditing:a,topToolbar:i,setupCoreEditor:s}=e;return(0,tt.useEffect)((()=>{o(n),r(n),s({id:0,type:"post"},[])}),[]),(0,tt.useEffect)((()=>{a&&r(n)}),[a,i,null==n||null===(t=n.editor)||void 0===t?void 0:t.reusableBlocks]),null}));const zre=lS([QI((e=>{const{getCurrentPattern:t}=e("isolated/editor");return{currentPattern:t()}})),eP((e=>{const{updateBlocksWithoutUndo:t}=e("isolated/editor");return{updateBlocksWithoutUndo:t}}))])((function(e){const{currentPattern:t,updateBlocksWithoutUndo:n}=e;return(0,tt.useEffect)((()=>{null!==t&&n(ns(t.content))}),[t]),null}));const Ore=function(e){const{onSaveBlocks:t,onSaveContent:n}=e,r=(0,tt.useRef)(!0),{setReady:o}=ld("isolated/editor"),{blocks:a,ignoredContent:i}=Tl((e=>({blocks:e("isolated/editor").getBlocks(),ignoredContent:e("isolated/editor").getIgnoredContent()})),[]);return(0,tt.useEffect)((()=>{a?r.current?(r.current=!1,o(!0)):(t&&t(a,i),n&&n(gi(a))):o(!0)}),[a]),null};const Nre=function(e){const t={OPTIONS:{"/wp/v2/blocks":{body:[]}},"/wp/v2/types?context=edit":{body:{post:{capabilities:{edit_post:"edit_post"},description:"",hierarchical:!1,viewable:!0,name:"Posts",slug:"post",labels:{name:"Posts",singular_name:"Post"},supports:{title:!1,editor:!0,author:!1,thumbnail:!1,excerpt:!1,trackbacks:!1,"custom-fields":!1,comments:!1,revisions:!1,"post-formats":!1,"geo-location":!1},taxonomies:[],rest_base:"posts"}}},"/wp/v2/posts/0?context=edit":{body:{id:0,type:"post"}}};ec.use(ec.createPreloadingMiddleware(t))};function Dre(){window.isoInitialisedBlocks||(window.isoInitialised||(xee(),window.isoInitialised=!0),on(ane,{}),In("editor.MediaUpload","isolated-block-editor/media-upload",(()=>wK)),Nre(),window.isoInitialisedBlocks=!0)}const Bre=Sre((function(e){const{children:t,onSaveContent:n,onSaveBlocks:r,settings:o,...a}=e;return Dre(),(0,tt.createElement)(tt.StrictMode,null,(0,tt.createElement)("div",{className:"interface-interface-skeleton__content"}),(0,tt.createElement)(Ore,{onSaveBlocks:r,onSaveContent:n}),(0,tt.createElement)(xre,{settings:o}),(0,tt.createElement)(zre,null),(0,tt.createElement)(df,null,(0,tt.createElement)(sne,ot({},a,{settings:o}),t)))})),Ire={iso:{moreMenu:!1}};window.wp={attachEditor:function(e){if("textarea"!==e.type.toLowerCase())return;const t=document.createElement("div");t.classList.add("editor"),e.parentNode.insertBefore(t,e.nextSibling),e.style.display="none",(0,rt.render)((0,tt.createElement)(Bre,{settings:Ire,onLoad:(t,n)=>function(e,t,n){return-1!==e.indexOf("\x3c!--")?t(e):n({HTML:e})}(e.value,t,n),onSaveContent:t=>function(e,t){t.value=e}(t,e),onError:()=>document.location.reload()}),t)},detachEditor:function(e){const t=e.nextSibling;t&&t.classList.contains("editor")&&((0,rt.unmountComponentAtNode)(t),e.style.display=null,t.parentNode.removeChild(t))}}})()})();
\ No newline at end of file
+`,sq=`calc( ( ${Lw.spinnerSize} - ${Lw.spinnerSize} * ( 2 / 3 ) ) / 2 )`,lq=yh("span",{target:"e1s472tg0"})("display:inline-block;background-color:",Gk.gray[600],";width:",Lw.spinnerSize,";height:",Lw.spinnerSize,";opacity:0.7;margin:5px 11px 0;border-radius:100%;position:relative;&::before{content:'';position:absolute;background-color:",Gk.white,";top:",sq,";left:",sq,";width:calc( ",Lw.spinnerSize," / 4.5 );height:calc( ",Lw.spinnerSize," / 4.5 );border-radius:100%;transform-origin:calc( ",Lw.spinnerSize," / 3 ) calc( ",Lw.spinnerSize," / 3 );animation:",iq," 1s infinite linear;}");function cq(){return(0,tt.createElement)(lq,{className:"components-spinner"})}const uq=(0,tt.createElement)(mo,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},(0,tt.createElement)(uo,{d:"M6.734 16.106l2.176-2.38-1.093-1.028-3.846 4.158 3.846 4.157 1.093-1.027-2.176-2.38h2.811c1.125 0 2.25.03 3.374 0 1.428-.001 3.362-.25 4.963-1.277 1.66-1.065 2.868-2.906 2.868-5.859 0-2.479-1.327-4.896-3.65-5.93-1.82-.813-3.044-.8-4.806-.788l-.567.002v1.5c.184 0 .368 0 .553-.002 1.82-.007 2.704-.014 4.21.657 1.854.827 2.76 2.657 2.76 4.561 0 2.472-.973 3.824-2.178 4.596-1.258.807-2.864 1.04-4.163 1.04h-.02c-1.115.03-2.229 0-3.344 0H6.734z"})),dq=({value:e,onChange:t=at.noop,settings:n})=>{if(!n||!n.length)return null;const r=n=>r=>{t({...e,[n.id]:r})},o=n.map((t=>(0,tt.createElement)(KN,{className:"block-editor-link-control__setting",key:t.id,label:t.title,onChange:r(t),checked:!!e&&!!e[t.id]})));return(0,tt.createElement)("fieldset",{className:"block-editor-link-control__settings"},(0,tt.createElement)(kh,{as:"legend"},er("Currently selected link settings")),o)},pq=ri((e=>t=>(0,tt.createElement)(e,ot({},t,{speak:fy,debouncedSpeak:jp(fy,500)}))),"withSpokenMessages"),mq=ri((e=>class extends tt.Component{constructor(e){super(e),this.timeouts=[],this.setTimeout=this.setTimeout.bind(this),this.clearTimeout=this.clearTimeout.bind(this)}componentWillUnmount(){this.timeouts.forEach(clearTimeout)}setTimeout(e,t){const n=setTimeout((()=>{e(),this.clearTimeout(n)}),t);return this.timeouts.push(n),n}clearTimeout(e){clearTimeout(e),this.timeouts=(0,at.without)(this.timeouts,e)}render(){const t={...this.props,setTimeout:this.setTimeout,clearTimeout:this.clearTimeout};return(0,tt.createElement)(e,t)}}),"withSafeTimeout");function fq(e){try{return new URL(e),!0}catch{return!1}}class hq extends tt.Component{constructor(e){super(e),this.onChange=this.onChange.bind(this),this.onFocus=this.onFocus.bind(this),this.onKeyDown=this.onKeyDown.bind(this),this.selectLink=this.selectLink.bind(this),this.handleOnClick=this.handleOnClick.bind(this),this.bindSuggestionNode=this.bindSuggestionNode.bind(this),this.autocompleteRef=e.autocompleteRef||(0,tt.createRef)(),this.inputRef=(0,tt.createRef)(),this.updateSuggestions=(0,at.debounce)(this.updateSuggestions.bind(this),200),this.suggestionNodes=[],this.isUpdatingSuggestions=!1,this.state={suggestions:[],showSuggestions:!1,selectedSuggestion:null,suggestionsListboxId:"",suggestionOptionIdPrefix:""}}componentDidUpdate(e){const{showSuggestions:t,selectedSuggestion:n}=this.state,{value:r}=this.props;t&&null!==n&&this.suggestionNodes[n]&&!this.scrollingIntoView&&(this.scrollingIntoView=!0,WR()(this.suggestionNodes[n],this.autocompleteRef.current,{onlyScrollIfNeeded:!0}),this.props.setTimeout((()=>{this.scrollingIntoView=!1}),100)),e.value!==r&&this.shouldShowInitialSuggestions()&&this.updateSuggestions()}componentDidMount(){this.shouldShowInitialSuggestions()&&this.updateSuggestions()}componentWillUnmount(){var e,t;null===(e=this.suggestionsRequest)||void 0===e||null===(t=e.cancel)||void 0===t||t.call(e),delete this.suggestionsRequest}bindSuggestionNode(e){return t=>{this.suggestionNodes[e]=t}}shouldShowInitialSuggestions(){const{suggestions:e}=this.state,{__experimentalShowInitialSuggestions:t=!1,value:n}=this.props;return!this.isUpdatingSuggestions&&t&&!(n&&n.length)&&!(e&&e.length)}updateSuggestions(e=""){const{__experimentalFetchLinkSuggestions:t,__experimentalHandleURLSuggestions:n}=this.props;if(!t)return;const r=!(e&&e.length);if(!r&&(e.length<2||!n&&fq(e)))return void this.setState({showSuggestions:!1,selectedSuggestion:null,loading:!1});this.isUpdatingSuggestions=!0,this.setState({selectedSuggestion:null,loading:!0});const o=t(e,{isInitialSuggestions:r});o.then((e=>{this.suggestionsRequest===o&&(this.setState({suggestions:e,loading:!1,showSuggestions:!!e.length}),e.length?this.props.debouncedSpeak(pn(nr("%d result found, use up and down arrow keys to navigate.","%d results found, use up and down arrow keys to navigate.",e.length),e.length),"assertive"):this.props.debouncedSpeak(er("No results."),"assertive"),this.isUpdatingSuggestions=!1)})).catch((()=>{this.suggestionsRequest===o&&(this.setState({loading:!1}),this.isUpdatingSuggestions=!1)})),this.suggestionsRequest=o}onChange(e){const t=e.target.value;this.props.onChange(t),this.props.disableSuggestions||this.updateSuggestions(t.trim())}onFocus(){const{suggestions:e}=this.state,{disableSuggestions:t,value:n}=this.props;!n||t||this.isUpdatingSuggestions||e&&e.length||this.updateSuggestions(n.trim())}onKeyDown(e){const{showSuggestions:t,selectedSuggestion:n,suggestions:r,loading:o}=this.state;if(!t||!r.length||o){switch(e.keyCode){case im:0!==e.target.selectionStart&&(e.preventDefault(),e.target.setSelectionRange(0,0));break;case lm:this.props.value.length!==e.target.selectionStart&&(e.preventDefault(),e.target.setSelectionRange(this.props.value.length,this.props.value.length));break;case rm:this.props.onSubmit&&this.props.onSubmit()}return}const a=this.state.suggestions[this.state.selectedSuggestion];switch(e.keyCode){case im:{e.preventDefault();const t=n?n-1:r.length-1;this.setState({selectedSuggestion:t});break}case lm:{e.preventDefault();const t=null===n||n===r.length-1?0:n+1;this.setState({selectedSuggestion:t});break}case 9:null!==this.state.selectedSuggestion&&(this.selectLink(a),this.props.speak(er("Link selected.")));break;case rm:null!==this.state.selectedSuggestion?(this.selectLink(a),this.props.onSubmit&&this.props.onSubmit(a)):this.props.onSubmit&&this.props.onSubmit()}}selectLink(e){this.props.onChange(e.url,e),this.setState({selectedSuggestion:null,showSuggestions:!1})}handleOnClick(e){this.selectLink(e),this.inputRef.current.focus()}static getDerivedStateFromProps({value:e,instanceId:t,disableSuggestions:n,__experimentalShowInitialSuggestions:r=!1},{showSuggestions:o}){let a=o;const i=e&&e.length;return r||i||(a=!1),!0===n&&(a=!1),{showSuggestions:a,suggestionsListboxId:`block-editor-url-input-suggestions-${t}`,suggestionOptionIdPrefix:`block-editor-url-input-suggestion-${t}`}}render(){return(0,tt.createElement)(tt.Fragment,null,this.renderControl(),this.renderSuggestions())}renderControl(){const{label:e,className:t,isFullWidth:n,instanceId:r,placeholder:o=er("Paste URL or type to search"),__experimentalRenderControl:a,value:i=""}=this.props,{loading:s,showSuggestions:l,selectedSuggestion:c,suggestionsListboxId:u,suggestionOptionIdPrefix:d}=this.state,p={id:`url-input-control-${r}`,label:e,className:so()("block-editor-url-input",t,{"is-full-width":n})},m={value:i,required:!0,className:"block-editor-url-input__input",type:"text",onChange:this.onChange,onFocus:this.onFocus,placeholder:o,onKeyDown:this.onKeyDown,role:"combobox","aria-label":er("URL"),"aria-expanded":l,"aria-autocomplete":"list","aria-owns":u,"aria-activedescendant":null!==c?`${d}-${c}`:void 0,ref:this.inputRef};return a?a(p,m,s):(0,tt.createElement)(EA,p,(0,tt.createElement)("input",m),s&&(0,tt.createElement)(cq,null))}renderSuggestions(){const{className:e,__experimentalRenderSuggestions:t,value:n="",__experimentalShowInitialSuggestions:r=!1}=this.props,{showSuggestions:o,suggestions:a,selectedSuggestion:i,suggestionsListboxId:s,suggestionOptionIdPrefix:l,loading:c}=this.state,u={id:s,ref:this.autocompleteRef,role:"listbox"},d=(e,t)=>({role:"option",tabIndex:"-1",id:`${l}-${t}`,ref:this.bindSuggestionNode(t),"aria-selected":t===i});return(0,at.isFunction)(t)&&o&&a.length?t({suggestions:a,selectedSuggestion:i,suggestionsListProps:u,buildSuggestionItemProps:d,isLoading:c,handleSuggestionClick:this.handleOnClick,isInitialSuggestions:r&&!(n&&n.length)}):!(0,at.isFunction)(t)&&o&&a.length?(0,tt.createElement)(_f,{position:"bottom",noArrow:!0,focusOnMount:!1},(0,tt.createElement)("div",ot({},u,{className:so()("block-editor-url-input__suggestions",`${e}__suggestions`)}),a.map(((e,t)=>(0,tt.createElement)(Eh,ot({},d(0,t),{key:e.id,className:so()("block-editor-url-input__suggestion",{"is-selected":t===i}),onClick:()=>this.handleOnClick(e)}),e.title))))):null}}const gq=lS(mq,pq,cS,QI(((e,t)=>{if((0,at.isFunction)(t.__experimentalFetchLinkSuggestions))return;const{getSettings:n}=e(nk);return{__experimentalFetchLinkSuggestions:n().__experimentalFetchLinkSuggestions}})))(hq),bq=({searchTerm:e,onClick:t,itemProps:n,isSelected:r,buttonText:o})=>{if(!e)return null;let a;return a=o?(0,at.isFunction)(o)?o(e):o:TP(pn(er("Create: %s "),e),{mark:(0,tt.createElement)("mark",null)}),(0,tt.createElement)(Eh,ot({},n,{className:so()("block-editor-link-control__search-create block-editor-link-control__search-item",{"is-selected":r}),onClick:t}),(0,tt.createElement)($L,{className:"block-editor-link-control__search-item-icon",icon:OS}),(0,tt.createElement)("span",{className:"block-editor-link-control__search-item-header"},(0,tt.createElement)("span",{className:"block-editor-link-control__search-item-title"},a)))};function vq(e,t=null){let n=e.replace(/^(?:https?:)\/\/(?:www\.)?/,"");n.match(/^[^\/]+\/$/)&&(n=n.replace("/",""));if(!t||n.length<=t||!n.match(/([\w|:])*\.(?:jpg|jpeg|gif|png|svg)/))return n;n=n.split("?")[0];const r=n.split("/"),o=r[r.length-1];if(o.length<=t)return"…"+n.slice(-t);const a=o.lastIndexOf("."),[i,s]=[o.slice(0,a),o.slice(a+1)],l=i.slice(-3)+"."+s;return o.slice(0,t-l.length-1)+"…"+l}function yq(e){try{return decodeURI(e)}catch(t){return e}}const _q=({text:e="",highlight:t=""})=>{const n=t.trim();if(!n)return e;const r=new RegExp(`(${(0,at.escapeRegExp)(n)})`,"gi");return TP(e.replace(r,"$& "),{mark:(0,tt.createElement)("mark",null)})},Mq=(0,tt.createElement)(mo,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},(0,tt.createElement)(uo,{d:"M9 0C4.03 0 0 4.03 0 9s4.03 9 9 9 9-4.03 9-9-4.03-9-9-9zM1.11 9.68h2.51c.04.91.167 1.814.38 2.7H1.84c-.403-.85-.65-1.764-.73-2.7zm8.57-5.4V1.19c.964.366 1.756 1.08 2.22 2 .205.347.386.708.54 1.08l-2.76.01zm3.22 1.35c.232.883.37 1.788.41 2.7H9.68v-2.7h3.22zM8.32 1.19v3.09H5.56c.154-.372.335-.733.54-1.08.462-.924 1.255-1.64 2.22-2.01zm0 4.44v2.7H4.7c.04-.912.178-1.817.41-2.7h3.21zm-4.7 2.69H1.11c.08-.936.327-1.85.73-2.7H4c-.213.886-.34 1.79-.38 2.7zM4.7 9.68h3.62v2.7H5.11c-.232-.883-.37-1.788-.41-2.7zm3.63 4v3.09c-.964-.366-1.756-1.08-2.22-2-.205-.347-.386-.708-.54-1.08l2.76-.01zm1.35 3.09v-3.04h2.76c-.154.372-.335.733-.54 1.08-.464.92-1.256 1.634-2.22 2v-.04zm0-4.44v-2.7h3.62c-.04.912-.178 1.817-.41 2.7H9.68zm4.71-2.7h2.51c-.08.936-.327 1.85-.73 2.7H14c.21-.87.337-1.757.38-2.65l.01-.05zm0-1.35c-.046-.894-.176-1.78-.39-2.65h2.16c.403.85.65 1.764.73 2.7l-2.5-.05zm1-4H13.6c-.324-.91-.793-1.76-1.39-2.52 1.244.56 2.325 1.426 3.14 2.52h.04zm-9.6-2.52c-.597.76-1.066 1.61-1.39 2.52H2.65c.815-1.094 1.896-1.96 3.14-2.52zm-3.15 12H4.4c.324.91.793 1.76 1.39 2.52-1.248-.567-2.33-1.445-3.14-2.55l-.01.03zm9.56 2.52c.597-.76 1.066-1.61 1.39-2.52h1.76c-.82 1.08-1.9 1.933-3.14 2.48l-.01.04z"})),kq=({itemProps:e,suggestion:t,isSelected:n=!1,onClick:r,isURL:o=!1,searchTerm:a="",shouldShowType:i=!1})=>(0,tt.createElement)(Eh,ot({},e,{onClick:r,className:so()("block-editor-link-control__search-item",{"is-selected":n,"is-url":o,"is-entity":!o})}),o&&(0,tt.createElement)($L,{className:"block-editor-link-control__search-item-icon",icon:Mq}),(0,tt.createElement)("span",{className:"block-editor-link-control__search-item-header"},(0,tt.createElement)("span",{className:"block-editor-link-control__search-item-title"},(0,tt.createElement)(_q,{text:t.title,highlight:a})),(0,tt.createElement)("span",{"aria-hidden":!o,className:"block-editor-link-control__search-item-info"},!o&&(vq(yq(t.url))||""),o&&er("Press ENTER to add this link"))),i&&t.type&&(0,tt.createElement)("span",{className:"block-editor-link-control__search-item-type"},"post_tag"===t.type?"tag":t.type)),wq="__CREATE__",Eq=[{id:"opensInNewTab",title:er("Open in new tab")}];function Lq({instanceId:e,withCreateSuggestion:t,currentInputValue:n,handleSuggestionClick:r,suggestionsListProps:o,buildSuggestionItemProps:a,suggestions:i,selectedSuggestion:s,isLoading:l,isInitialSuggestions:c,createSuggestionButtonText:u,suggestionsQuery:d}){const p=so()("block-editor-link-control__search-results",{"is-loading":l}),m=["url","mailto","tel","internal"],f=1===i.length&&m.includes(i[0].type.toLowerCase()),h=t&&!f&&!c,g=!(null!=d&&d.type),b=`block-editor-link-control-search-results-label-${e}`,v=c?er("Recently updated"):pn(er('Search results for "%s"'),n),y=(0,tt.createElement)(c?tt.Fragment:kh,{},(0,tt.createElement)("span",{className:"block-editor-link-control__search-results-label",id:b},v));return(0,tt.createElement)("div",{className:"block-editor-link-control__search-results-wrapper"},y,(0,tt.createElement)("div",ot({},o,{className:p,"aria-labelledby":b}),i.map(((e,t)=>h&&wq===e.type?(0,tt.createElement)(bq,{searchTerm:n,buttonText:u,onClick:()=>r(e),key:e.type,itemProps:a(e,t),isSelected:t===s}):wq===e.type?null:(0,tt.createElement)(kq,{key:`${e.id}-${e.type}`,itemProps:a(e,t),suggestion:e,index:t,onClick:()=>{r(e)},isSelected:t===s,isURL:m.includes(e.type.toLowerCase()),searchTerm:n,shouldShowType:g})))))}function Aq(e){const t=/^([^\s:]+:)/.exec(e);if(t)return t[1]}const Sq=/^(mailto:)?[a-z0-9._%+-]+@[a-z0-9][a-z0-9.-]*\.[a-z]{2,63}$/i;function Cq(e){return Sq.test(e)}const Tq=/^(?:[a-z]+:|#|\?|\.|\/)/i;function xq(e){return e?(e=e.trim(),Tq.test(e)||Cq(e)?e:"http://"+e):e}function zq(e){const t=(0,at.startsWith)(e,"#");return fq(e)||e&&e.includes("www.")||t}const Oq=()=>Promise.resolve([]),Nq=e=>{let t="URL";const n=Aq(e)||"";return n.includes("mailto")&&(t="mailto"),n.includes("tel")&&(t="tel"),(0,at.startsWith)(e,"#")&&(t="internal"),Promise.resolve([{id:e,title:e,url:"URL"===t?xq(e):e,type:t}])};function Dq(e,t,n,r){const{fetchSearchSuggestions:o}=Tl((e=>{const{getSettings:t}=e(nk);return{fetchSearchSuggestions:t().__experimentalFetchLinkSuggestions}}),[]),a=t?Nq:Oq;return(0,tt.useCallback)(((t,{isInitialSuggestions:i})=>zq(t)?a(t,{isInitialSuggestions:i}):(async(e,t,n,r,o,a)=>{const{isInitialSuggestions:i}=t;let s=await Promise.all([n(e,t),r(e)]);return s=e.includes(" ")||!a||i?s[0]:s[0].concat(s[1]),i||zq(e)||!o?s:s.concat({title:e,url:e,type:wq})})(t,{...e,isInitialSuggestions:i},o,a,n,r)),[a,o,n])}const Bq=()=>Promise.resolve([]),Iq=(0,tt.forwardRef)((({value:e,children:t,currentLink:n={},className:r=null,placeholder:o=null,withCreateSuggestion:a=!1,onCreateSuggestion:i=at.noop,onChange:s=at.noop,onSelect:l=at.noop,showSuggestions:c=!0,renderSuggestions:u=(e=>(0,tt.createElement)(Lq,e)),fetchSuggestions:d=null,allowDirectEntry:p=!0,showInitialSuggestions:m=!1,suggestionsQuery:f={},withURLSuggestion:h=!0,createSuggestionButtonText:g},b)=>{const v=Dq(f,p,a,h),y=c?d||v:Bq,_=Qk(Iq),[M,k]=(0,tt.useState)(),w=async e=>{let t=e;if(wq!==e.type)(p||t&&Object.keys(t).length>=1)&&l({...(0,at.omit)(n,"id","url"),...t},t);else try{var r;t=await i(e.title),null!==(r=t)&&void 0!==r&&r.url&&l(t)}catch(e){}};return(0,tt.createElement)("div",null,(0,tt.createElement)(gq,{className:r,value:e,onChange:(e,t)=>{s(e),k(t)},placeholder:null!=o?o:er("Search or type url"),__experimentalRenderSuggestions:c?t=>u({...t,instanceId:_,withCreateSuggestion:a,currentInputValue:e,createSuggestionButtonText:g,suggestionsQuery:f,handleSuggestionClick:e=>{t.handleSuggestionClick&&t.handleSuggestionClick(e),w(e)}}):null,__experimentalFetchLinkSuggestions:y,__experimentalHandleURLSuggestions:!0,__experimentalShowInitialSuggestions:m,onSubmit:t=>{w(t||M||{url:e})},ref:b}),t)})),Pq=Iq,{Slot:Rq,Fill:Yq}=pf("BlockEditorLinkControlViewer");function Wq(e,t){switch(t.type){case"RESOLVED":return{...e,isFetching:!1,richData:t.richData};case"ERROR":return{...e,isFetching:!1,richData:null};case"LOADING":return{...e,isFetching:!0};default:throw new Error(`Unexpected action type ${t.type}`)}}const Hq=function(e){const[t,n]=(0,tt.useReducer)(Wq,{richData:null,isFetching:!1}),{fetchRichUrlData:r}=Tl((e=>{const{getSettings:t}=e(nk);return{fetchRichUrlData:t().__experimentalFetchRichUrlData}}),[]);return(0,tt.useEffect)((()=>{if(null!=e&&e.length&&r&&"undefined"!=typeof AbortController){n({type:"LOADING"});const t=new window.AbortController,o=t.signal;return r(e,{signal:o}).then((e=>{n({type:"RESOLVED",richData:e})})).catch((()=>{o.aborted||n({type:"ERROR"})})),()=>{t.abort()}}}),[e]),t};function qq({value:e,onEditClick:t,hasRichPreviews:n=!1}){const r=n?null==e?void 0:e.url:null,{richData:o,isFetching:a}=Hq(r),i=o&&Object.keys(o).length,s=e&&vq(yq(e.url),16)||"";return(0,tt.createElement)("div",{"aria-label":er("Currently selected"),"aria-selected":"true",className:so()("block-editor-link-control__search-item",{"is-current":!0,"is-rich":i,"is-fetching":!!a,"is-preview":!0})},(0,tt.createElement)("div",{className:"block-editor-link-control__search-item-top"},(0,tt.createElement)("span",{className:"block-editor-link-control__search-item-header"},(0,tt.createElement)("span",{className:so()("block-editor-link-control__search-item-icon",{"is-image":null==o?void 0:o.icon})},null!=o&&o.icon?(0,tt.createElement)("img",{src:null==o?void 0:o.icon,alt:""}):(0,tt.createElement)($L,{icon:Mq})),(0,tt.createElement)("span",{className:"block-editor-link-control__search-item-details"},(0,tt.createElement)(CA,{className:"block-editor-link-control__search-item-title",href:e.url},(null==o?void 0:o.title)||(null==e?void 0:e.title)||s),(null==e?void 0:e.url)&&(0,tt.createElement)("span",{className:"block-editor-link-control__search-item-info"},s))),(0,tt.createElement)(Eh,{variant:"secondary",onClick:()=>t(),className:"block-editor-link-control__search-item-action"},er("Edit")),(0,tt.createElement)(Rq,{fillProps:e})),(i||a)&&(0,tt.createElement)("div",{className:"block-editor-link-control__search-item-bottom"},(0,tt.createElement)("div",{"aria-hidden":!(null!=o&&o.image),className:so()("block-editor-link-control__search-item-image",{"is-placeholder":!(null!=o&&o.image)})},(null==o?void 0:o.image)&&(0,tt.createElement)("img",{src:null==o?void 0:o.image,alt:""})),(0,tt.createElement)("div",{"aria-hidden":!(null!=o&&o.description),className:so()("block-editor-link-control__search-item-description",{"is-placeholder":!(null!=o&&o.description)})},(null==o?void 0:o.description)&&(0,tt.createElement)(Rw,{truncate:!0,numberOfLines:"2"},o.description))))}const jq=e=>{let t=!1;return{promise:new Promise(((n,r)=>{e.then((e=>t?r({isCanceled:!0}):n(e)),(e=>r(t?{isCanceled:!0}:e)))})),cancel(){t=!0}}};function Fq({searchInputPlaceholder:e,value:t,settings:n=Eq,onChange:r=at.noop,onRemove:o,noDirectEntry:a=!1,showSuggestions:i=!0,showInitialSuggestions:s,forceIsEditingLink:l,createSuggestion:c,withCreateSuggestion:u,inputValue:d="",suggestionsQuery:p={},noURLSuggestion:m=!1,createSuggestionButtonText:f,hasRichPreviews:h=!1}){void 0===u&&c&&(u=!0);const g=(0,tt.useRef)(!0),b=(0,tt.useRef)(),[v,y]=(0,tt.useState)(t&&t.url||""),_=d||v,[M,k]=(0,tt.useState)(void 0!==l?l:!t||!t.url),w=(0,tt.useRef)(!1);function E(){var e;w.current=!(null===(e=b.current)||void 0===e||!e.contains(b.current.ownerDocument.activeElement)),k(!1)}(0,tt.useEffect)((()=>{void 0!==l&&l!==M&&k(l)}),[l]),(0,tt.useEffect)((()=>{if(g.current)return void(g.current=!1);(Om.focusable.find(b.current)[0]||b.current).focus(),w.current=!1}),[M]);const{createPage:L,isCreatingPage:A,errorMessage:S}=function(e){const t=(0,tt.useRef)(),[n,r]=(0,tt.useState)(!1),[o,a]=(0,tt.useState)(null);return(0,tt.useEffect)((()=>()=>{t.current&&t.current.cancel()}),[]),{createPage:async function(n){r(!0),a(null);try{return t.current=jq(Promise.resolve(e(n))),await t.current.promise}catch(e){if(e&&e.isCanceled)return;throw a(e.message||er("An unknown error occurred during creation. Please try again.")),e}finally{r(!1)}},isCreatingPage:n,errorMessage:o}}(c),C=()=>{_!==(null==t?void 0:t.url)&&r({url:_}),E()},T=o&&t&&!M&&!A,x=!(null==n||!n.length);return(0,tt.createElement)("div",{tabIndex:-1,ref:b,className:"block-editor-link-control"},A&&(0,tt.createElement)("div",{className:"block-editor-link-control__loading"},(0,tt.createElement)(cq,null)," ",er("Creating"),"…"),(M||!t)&&!A&&(0,tt.createElement)(tt.Fragment,null,(0,tt.createElement)("div",{className:"block-editor-link-control__search-input-wrapper"},(0,tt.createElement)(Pq,{currentLink:t,className:"block-editor-link-control__search-input",placeholder:e,value:_,withCreateSuggestion:u,onCreateSuggestion:L,onChange:y,onSelect:e=>{r(e),E()},showInitialSuggestions:s,allowDirectEntry:!a,showSuggestions:i,suggestionsQuery:p,withURLSuggestion:!m,createSuggestionButtonText:f},(0,tt.createElement)("div",{className:"block-editor-link-control__search-actions"},(0,tt.createElement)(Eh,{onClick:()=>C(),onKeyDown:e=>{const{keyCode:t}=e;t===rm&&(e.preventDefault(),C())},label:er("Submit"),icon:uq,className:"block-editor-link-control__search-submit"})))),S&&(0,tt.createElement)(RT,{className:"block-editor-link-control__search-error",status:"error",isDismissible:!1},S)),t&&!M&&!A&&(0,tt.createElement)(qq,{key:null==t?void 0:t.url,value:t,onEditClick:()=>k(!0),hasRichPreviews:h}),(x||T)&&(0,tt.createElement)("div",{className:"block-editor-link-control__tools"},(0,tt.createElement)(dq,{value:t,settings:n,onChange:r}),T&&(0,tt.createElement)(Eh,{className:"block-editor-link-control__unlink",isDestructive:!0,variant:"link",onClick:o},er("Unlink"))))}Fq.ViewerFill=Yq;const Vq=Fq;const Xq=function({accept:e,children:t,multiple:n=!1,onChange:r,render:o,...a}){const i=(0,tt.useRef)(),s=()=>{i.current.click()},l=o?o({openFileDialog:s}):(0,tt.createElement)(Eh,ot({onClick:s},a),t);return(0,tt.createElement)("div",{className:"components-form-file-upload"},l,(0,tt.createElement)("input",{type:"file",ref:i,multiple:n,style:{display:"none"},accept:e,onChange:r}))},Uq=(0,tt.createElement)(mo,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,tt.createElement)(uo,{d:"M18.7 3H5.3C4 3 3 4 3 5.3v13.4C3 20 4 21 5.3 21h13.4c1.3 0 2.3-1 2.3-2.3V5.3C21 4 20 3 18.7 3zm.8 15.7c0 .4-.4.8-.8.8H5.3c-.4 0-.8-.4-.8-.8V5.3c0-.4.4-.8.8-.8h13.4c.4 0 .8.4.8.8v13.4zM10 15l5-3-5-3v6z"})),$q=(0,tt.createElement)(mo,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,tt.createElement)(uo,{d:"M18.5 15v3.5H13V6.7l4.5 4.1 1-1.1-6.2-5.8-5.8 5.8 1 1.1 4-4v11.7h-6V15H4v5h16v-5z"})),Kq=FP("editor.MediaUpload")((()=>null));const Gq=function({fallback:e=null,children:t}){return Tl((e=>{const{getSettings:t}=e(nk);return!!t().mediaUpload}),[])?t:e},Jq=lS([eP((e=>{const{createNotice:t,removeNotice:n}=e(UI);return{createNotice:t,removeNotice:n}})),FP("editor.MediaReplaceFlow")])((({mediaURL:e,mediaId:t,allowedTypes:n,accept:r,onSelect:o,onSelectURL:a,onFilesUpload:i=at.noop,name:s=er("Replace"),createNotice:l,removeNotice:c})=>{const[u,d]=(0,tt.useState)(e),p=Tl((e=>e(nk).getSettings().mediaUpload),[]),m=(0,tt.createRef)(),f=(0,at.uniqueId)("block-editor/media-replace-flow/error-notice/"),h=e=>{const t=document.createElement("div");t.innerHTML=ti(e);const n=t.textContent||t.innerText||"";setTimeout((()=>{l("error",n,{speak:!0,id:f,isDismissible:!0})}),1e3)},g=e=>{o(e),d(e.url),fy(er("The media file has been replaced")),c(f)},b=e=>{e.keyCode===lm&&(e.preventDefault(),e.target.click())};return(0,tt.createElement)(Xg,{popoverProps:{isAlternate:!0},contentClassName:"block-editor-media-replace-flow__options",renderToggle:({isOpen:e,onToggle:t})=>(0,tt.createElement)(jg,{ref:m,"aria-expanded":e,"aria-haspopup":"true",onClick:t,onKeyDown:b},s),renderContent:({onClose:e})=>(0,tt.createElement)(tt.Fragment,null,(0,tt.createElement)(Jg,{className:"block-editor-media-replace-flow__media-upload-menu"},(0,tt.createElement)(Kq,{value:t,onSelect:e=>g(e),allowedTypes:n,render:({open:e})=>(0,tt.createElement)(zB,{icon:Uq,onClick:e},er("Open Media Library"))}),(0,tt.createElement)(Gq,null,(0,tt.createElement)(Xq,{onChange:e=>{(e=>{const t=e.target.files;i(t),p({allowedTypes:n,filesList:t,onFileChange:([e])=>{g(e)},onError:h})})(e)},accept:r,render:({openFileDialog:e})=>(0,tt.createElement)(zB,{icon:$q,onClick:()=>{e()}},er("Upload"))}))),a&&(0,tt.createElement)("form",{className:"block-editor-media-flow__url-input"},(0,tt.createElement)("span",{className:"block-editor-media-replace-flow__image-url-label"},er("Current media URL:")),(0,tt.createElement)(Vq,{value:{url:u},settings:[],showSuggestions:!1,onChange:({url:e})=>{d(e),a(e),m.current.focus()}})))})}));function Qq({className:e,label:t,onFilesDrop:n,onHTMLDrop:r,onDrop:o}){const[a,i]=(0,tt.useState)(),[s,l]=(0,tt.useState)(),[c,u]=(0,tt.useState)(),d=rY({onDrop(e){const t=$I(e.dataTransfer),a=e.dataTransfer.getData("text/html");t.length&&n?n(t):a&&r?r(a):o&&o(e)},onDragStart(e){i(!0);let t="default";(0,at.includes)(e.dataTransfer.types,"Files")||$I(e.dataTransfer).length>0?t="file":(0,at.includes)(e.dataTransfer.types,"text/html")&&(t="html"),u(t)},onDragEnd(){i(!1),u()},onDragEnter(){l(!0)},onDragLeave(){l(!1)}});let p;s&&(p=(0,tt.createElement)("div",{className:"components-drop-zone__content"},(0,tt.createElement)($L,{icon:$q,className:"components-drop-zone__content-icon"}),(0,tt.createElement)("span",{className:"components-drop-zone__content-text"},t||er("Drop files to upload"))));const m=so()("components-drop-zone",e,{"is-active":(a||s)&&("file"===c&&n||"html"===c&&r||"default"===c&&o),"is-dragging-over-document":a,"is-dragging-over-element":s,[`is-dragging-${c}`]:!!c});return(0,tt.createElement)("div",{ref:d,className:m},p)}const Zq=(0,tt.createElement)(mo,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,tt.createElement)(uo,{d:"M20.1 5.1L16.9 2 6.2 12.7l-1.3 4.4 4.5-1.3L20.1 5.1zM4 20.8h8v-1.5H4v1.5z"}));function ej({url:e,urlLabel:t,className:n}){const r=so()(n,"block-editor-url-popover__link-viewer-url");return e?(0,tt.createElement)(CA,{className:r,href:e},t||vq(yq(e))):(0,tt.createElement)("span",{className:r})}function tj({additionalControls:e,children:t,renderSettings:n,position:r="bottom center",focusOnMount:o="firstElement",...a}){const[i,s]=(0,tt.useState)(!1),l=!!n&&i;return(0,tt.createElement)(_f,ot({className:"block-editor-url-popover",focusOnMount:o,position:r},a),(0,tt.createElement)("div",{className:"block-editor-url-popover__input-container"},(0,tt.createElement)("div",{className:"block-editor-url-popover__row"},t,!!n&&(0,tt.createElement)(Eh,{className:"block-editor-url-popover__settings-toggle",icon:OA,label:er("Link settings"),onClick:()=>{s(!i)},"aria-expanded":i})),l&&(0,tt.createElement)("div",{className:"block-editor-url-popover__row block-editor-url-popover__settings"},n())),e&&!l&&(0,tt.createElement)("div",{className:"block-editor-url-popover__additional-controls"},e))}tj.LinkEditor=function({autocompleteRef:e,className:t,onChangeInputValue:n,value:r,...o}){return(0,tt.createElement)("form",ot({className:so()("block-editor-url-popover__link-editor",t)},o),(0,tt.createElement)(gq,{value:r,onChange:n,autocompleteRef:e}),(0,tt.createElement)(Eh,{icon:uq,label:er("Apply"),type:"submit"}))},tj.LinkViewer=function({className:e,linkClassName:t,onEditLinkClick:n,url:r,urlLabel:o,...a}){return(0,tt.createElement)("div",ot({className:so()("block-editor-url-popover__link-viewer",e)},a),(0,tt.createElement)(ej,{url:r,urlLabel:o,className:t}),n&&(0,tt.createElement)(Eh,{icon:Zq,label:er("Edit"),onClick:n}))};const nj=tj,rj=({src:e,onChange:t,onSubmit:n,onClose:r})=>(0,tt.createElement)(nj,{onClose:r},(0,tt.createElement)("form",{className:"block-editor-media-placeholder__url-input-form",onSubmit:n},(0,tt.createElement)("input",{className:"block-editor-media-placeholder__url-input-field",type:"url","aria-label":er("URL"),placeholder:er("Paste or type URL"),onChange:t,value:e}),(0,tt.createElement)(Eh,{className:"block-editor-media-placeholder__url-input-submit-button",icon:uq,label:er("Apply"),type:"submit"})));const oj=FP("editor.MediaPlaceholder")((function({value:e={},allowedTypes:t,className:n,icon:r,labels:o={},mediaPreview:a,notices:i,isAppender:s,accept:l,addToGallery:c,multiple:u=!1,dropZoneUIOnly:d,disableDropZone:p,disableMediaButtons:m,onError:f,onSelect:h,onCancel:g,onSelectURL:b,onDoubleClick:v,onFilesPreUpload:y=at.noop,onHTMLDrop:_=at.noop,children:M}){const k=Tl((e=>{const{getSettings:t}=e(nk);return t().mediaUpload}),[]),[w,E]=(0,tt.useState)(""),[L,A]=(0,tt.useState)(!1);(0,tt.useEffect)((()=>{var t;E(null!==(t=null==e?void 0:e.src)&&void 0!==t?t:"")}),[null==e?void 0:e.src]);const S=e=>{E(e.target.value)},C=()=>{A(!0)},T=()=>{A(!1)},x=e=>{e.preventDefault(),w&&b&&(b(w),T())},z=n=>{let r;if(y(n),u)if(c){let t=[];r=n=>{const r=(null!=e?e:[]).filter((e=>e.id?!t.some((({id:t})=>Number(t)===Number(e.id))):!t.some((({urlSlug:t})=>e.url.includes(t)))));h(r.concat(n)),t=n.map((e=>{const t=e.url.lastIndexOf("."),n=e.url.slice(0,t);return{id:e.id,urlSlug:n}}))}}else r=h;else r=([e])=>h(e);k({allowedTypes:t,filesList:n,onFileChange:r,onError:f})},O=e=>{z(e.target.files)},N=(e,l)=>{let{instructions:c,title:u}=o;if(k||b||(c=er("To edit this block, you need permission to upload media.")),void 0===c||void 0===u){const e=null!=t?t:[],[n]=e,r=1===e.length,o=r&&"audio"===n,a=r&&"image"===n,i=r&&"video"===n;void 0===c&&k&&(c=er("Upload a media file or pick one from your media library."),o?c=er("Upload an audio file, pick one from your media library, or add one with a URL."):a?c=er("Upload an image file, pick one from your media library, or add one with a URL."):i&&(c=er("Upload a video file, pick one from your media library, or add one with a URL."))),void 0===u&&(u=er("Media"),o?u=er("Audio"):a?u=er("Image"):i&&(u=er("Video")))}const d=so()("block-editor-media-placeholder",n,{"is-appender":s});return(0,tt.createElement)(vH,{icon:r,label:u,instructions:c,className:d,notices:i,onClick:l,onDoubleClick:v,preview:a},e,M)},D=()=>p?null:(0,tt.createElement)(Qq,{onFilesDrop:z,onHTMLDrop:_}),B=()=>g&&(0,tt.createElement)(Eh,{className:"block-editor-media-placeholder__cancel-button",title:er("Cancel"),variant:"link",onClick:g},er("Cancel")),I=()=>b&&(0,tt.createElement)("div",{className:"block-editor-media-placeholder__url-input-container"},(0,tt.createElement)(Eh,{className:"block-editor-media-placeholder__button",onClick:C,isPressed:L,variant:"tertiary"},er("Insert from URL")),L&&(0,tt.createElement)(rj,{src:w,onChange:S,onSubmit:x,onClose:T}));return d||m?(d&&qp("wp.blockEditor.MediaPlaceholder dropZoneUIOnly prop",{since:"5.4",alternative:"disableMediaButtons"}),(0,tt.createElement)(Gq,null,D())):(0,tt.createElement)(Gq,{fallback:N(I())},(()=>{const n=(0,tt.createElement)(Kq,{addToGallery:c,gallery:u&&!(!t||0===t.length)&&t.every((e=>"image"===e||e.startsWith("image/"))),multiple:u,onSelect:h,allowedTypes:t,value:Array.isArray(e)?e.map((({id:e})=>e)):e.id,render:({open:e})=>(0,tt.createElement)(Eh,{variant:"tertiary",onClick:()=>{e()}},er("Media Library"))});if(k&&s)return(0,tt.createElement)(tt.Fragment,null,D(),(0,tt.createElement)(Xq,{onChange:O,accept:l,multiple:u,render:({openFileDialog:e})=>{const t=(0,tt.createElement)(tt.Fragment,null,(0,tt.createElement)(Eh,{variant:"primary",className:so()("block-editor-media-placeholder__button","block-editor-media-placeholder__upload-button")},er("Upload")),n,I(),B());return N(t,e)}}));if(k){const e=(0,tt.createElement)(tt.Fragment,null,D(),(0,tt.createElement)(Xq,{variant:"primary",className:so()("block-editor-media-placeholder__button","block-editor-media-placeholder__upload-button"),onChange:O,accept:l,multiple:u},er("Upload")),n,I(),B());return N(e)}return N(n)})())})),aj=({colorSettings:e,...t})=>{const n=e.map((({value:e,onChange:t,...n})=>({...n,colorValue:e,onColorChange:t})));return(0,tt.createElement)(IT,ot({settings:n,gradients:[],disableCustomGradients:!0},t))};function ij(e){return t=>{const[n,r]=(0,tt.useState)([]);return(0,tt.useLayoutEffect)((()=>{const{options:n,isDebounced:o}=e,a=(0,at.debounce)((()=>{const o=Promise.resolve("function"==typeof n?n(t):n).then((n=>{if(o.canceled)return;const a=n.map(((t,n)=>({key:`${e.name}-${n}`,value:t,label:e.getOptionLabel(t),keywords:e.getOptionKeywords?e.getOptionKeywords(t):[],isDisabled:!!e.isOptionDisabled&&e.isOptionDisabled(t)}))),i=new RegExp("(?:\\b|\\s|^)"+(0,at.escapeRegExp)(t),"i");r(function(e,t=[],n=10){const r=[];for(let o=0;oe.test((0,at.deburr)(t))))&&(r.push(a),r.length===n))break}return r}(i,a))}));return o}),o?250:0),i=a();return()=>{a.cancel(),i&&(i.canceled=!0)}}),[t]),[n]}}function sj({record:e,onChange:t,onReplace:n,completers:r,contentRef:o}){const a=jp(fy,500),i=Qk(sj),[s,l]=(0,tt.useState)(0),[c,u]=(0,tt.useState)([]),[d,p]=(0,tt.useState)(""),[m,f]=(0,tt.useState)(null),[h,g]=(0,tt.useState)(null),[b,v]=(0,tt.useState)(!1);function y(r){const{getOptionCompletion:o}=m||{};if(!r.isDisabled){if(o){const a=o(r.value,d),{action:i,value:s}=void 0===a.action||void 0===a.value?{action:"insert-at-caret",value:a}:a;if("replace"===i)return void n([s]);"insert-at-caret"===i&&function(n){const r=e.start,o=r-m.triggerPrefix.length-d.length,a=Ny({html:ti(n)});t(e_(e,a,o,r))}(s)}_()}}function _(){l(0),u([]),p(""),f(null),g(null)}let M;$y(e)&&(M=Fy(r_(e,0))),(0,tt.useEffect)((()=>{if(!M)return void _();const t=(0,at.deburr)(M),n=Fy(r_(e,void 0,Fy(e).length)),o=(0,at.find)(r,(({triggerPrefix:e,allowContext:r})=>{const o=t.lastIndexOf(e);if(-1===o)return!1;const a=t.slice(o+e.length);if(a.length>50)return!1;const i=0===c.length,s=1===a.split(/\s/).length,l=b&&a.split(/\s/).length<=3;return!(i&&!l&&!s)&&(!(r&&!r(t.slice(0,o),n))&&(!/^\s/.test(a)&&!/\s\s+$/.test(a)&&/[\u0000-\uFFFF]*$/.test(a)))}));if(!o)return void _();const a=(0,at.escapeRegExp)(o.triggerPrefix),i=t.slice(t.lastIndexOf(o.triggerPrefix)).match(new RegExp(`${a}([\0-]*)$`)),s=i&&i[1];f(o),g((()=>o!==m?function(e){const t=e.useItems?e.useItems:ij(e);return function({filterValue:e,instanceId:n,listBoxId:r,className:o,selectedIndex:a,onChangeOptions:i,onSelect:s,onReset:l,value:c,contentRef:u}){const[d]=t(e),p=S_({ref:u,value:c});return(0,tt.useLayoutEffect)((()=>{i(d)}),[d]),!d.length>0?null:(0,tt.createElement)(_f,{focusOnMount:!1,onClose:l,position:"top right",className:"components-autocomplete__popover",anchorRef:p},(0,tt.createElement)("div",{id:r,role:"listbox",className:"components-autocomplete__results"},(0,at.map)(d,((e,t)=>(0,tt.createElement)(Eh,{key:e.key,id:`components-autocomplete-item-${n}-${e.key}`,role:"option","aria-selected":t===a,disabled:e.isDisabled,className:so()("components-autocomplete__result",o,{"is-selected":t===a}),onClick:()=>s(e)},e.label)))))}}(o):h)),p(s)}),[M]);const{key:k=""}=c[s]||{},{className:w}=m||{},E=!!m&&c.length>0,L=E?`components-autocomplete-listbox-${i}`:null;return{listBoxId:L,activeId:E?`components-autocomplete-item-${i}-${k}`:null,onKeyDown:function(e){if(v(e.keyCode===nm),m&&0!==c.length&&!e.defaultPrevented){switch(e.keyCode){case im:l((0===s?c.length:s)-1);break;case lm:l((s+1)%c.length);break;case om:f(null),g(null),e.preventDefault();break;case rm:y(c[s]);break;case am:case sm:return void _();default:return}e.preventDefault()}},popover:void 0!==e.start&&h&&(0,tt.createElement)(h,{className:w,filterValue:d,instanceId:i,listBoxId:L,selectedIndex:s,onChangeOptions:function(e){l(e.length===c.length?s:0),u(e),function(e){a&&(e.length?a(pn(nr("%d result found, use up and down arrow keys to navigate.","%d results found, use up and down arrow keys to navigate.",e.length),e.length),"assertive"):a(er("No results."),"assertive"))}(e)},onSelect:y,value:e,contentRef:o,reset:_})}}const lj={name:"blocks",className:"block-editor-autocompleters__block",triggerPrefix:"/",useItems(e){const{rootClientId:t,selectedBlockName:n}=Tl((e=>{const{getSelectedBlockClientId:t,getBlockName:n,getBlockInsertionPoint:r}=e(nk),o=t();return{selectedBlockName:o?n(o):null,rootClientId:r().rootClientId}}),[]),[r,o,a]=yW(t,at.noop),i=(0,tt.useMemo)((()=>(e.trim()?VW(r,o,a,e):(0,at.orderBy)(r,["frecency"],["desc"])).filter((e=>e.name!==n)).slice(0,9)),[e,n,r,o,a]);return[(0,tt.useMemo)((()=>i.map((e=>{const{title:t,icon:n,isDisabled:r}=e;return{key:`block-${e.id}`,value:e,label:(0,tt.createElement)(tt.Fragment,null,(0,tt.createElement)(MB,{key:"icon",icon:n,showColors:!0}),t),isDisabled:r}}))),[i])]},allowContext:(e,t)=>!(/\S/.test(e)||/\S/.test(t)),getOptionCompletion(e){const{name:t,initialAttributes:n,innerBlocks:r}=e;return{action:"replace",value:Ho(t,n,qo(r))}}},cj=[];function uj({completers:e=cj}){const{name:t}=ob();return(0,tt.useMemo)((()=>{let n=e;return t===Do()&&(n=n.concat([lj])),Wn("editor.Autocomplete.completers")&&(n===e&&(n=n.map(at.clone)),n=Fn("editor.Autocomplete.completers",n,t)),n}),[e,t])}function dj(e){return function(e){const t=(0,tt.useRef)(),n=(0,tt.useRef)(),{popover:r,listBoxId:o,activeId:a,onKeyDown:i}=sj({...e,contentRef:t});return n.current=i,{ref:Ym([t,C_((e=>{function t(e){n.current(e)}return e.addEventListener("keydown",t),()=>{e.removeEventListener("keydown",t)}}),[])]),children:r,"aria-autocomplete":o?"list":void 0,"aria-owns":o,"aria-activedescendant":a}}({...e,completers:uj(e)})}const pj={position:"bottom right",isAlternate:!0},mj=()=>(0,tt.createElement)(tt.Fragment,null,["bold","italic","link","text-color"].map((e=>(0,tt.createElement)(uf,{name:`RichText.ToolbarControls.${e}`,key:e}))),(0,tt.createElement)(uf,{name:"RichText.ToolbarControls"},(e=>0!==e.length&&(0,tt.createElement)(Hg,null,(t=>(0,tt.createElement)(Zg,{icon:OA,label:er("More"),toggleProps:t,controls:(0,at.orderBy)(e.map((([{props:e}])=>e)),"title"),popoverProps:pj})))))),fj=({inline:e,anchorRef:t})=>e?(0,tt.createElement)(_f,{noArrow:!0,position:"top center",focusOnMount:!1,anchorRef:t,className:"block-editor-rich-text__inline-format-toolbar",__unstableSlotName:"block-toolbar"},(0,tt.createElement)("div",{className:"block-editor-rich-text__inline-format-toolbar-group"},(0,tt.createElement)(tb,null,(0,tt.createElement)(mj,null)))):(0,tt.createElement)(lk,{group:"inline"},(0,tt.createElement)(mj,null));function hj(){const{didAutomaticChange:e,getSettings:t}=Tl(nk);return C_((n=>{function r(n){const{keyCode:r}=n;n.defaultPrevented||r!==cm&&r!==nm&&r!==om||e()&&(n.preventDefault(),t().__experimentalUndo())}return n.addEventListener("keydown",r),()=>{n.removeEventListener("keydown",r)}}),[])}function gj(e){return e.filter((({type:e})=>/^image\/(?:jpe?g|png|gif)$/.test(e))).map((e=>` `)).join("")}function bj(e,t){if(null!=t&&t.length){let n=e.formats.length;for(;n--;)e.formats[n]=[...t,...e.formats[n]||[]]}}function vj(e){if(!0===e||"p"===e||"li"===e)return!0===e?"p":e}function yj({allowedFormats:e,formattingControls:t,disableFormats:n}){return n?yj.EMPTY_ARRAY:e||t?e||(qp("wp.blockEditor.RichText formattingControls prop",{since:"5.4",alternative:"allowedFormats"}),t.map((e=>`core/${e}`))):void 0}yj.EMPTY_ARRAY=[];function _j({value:e,pastedBlocks:t=[],onReplace:n,onSplit:r,onSplitMiddle:o,multilineTag:a}){if(!n||!r)return;const i=[],[s,l]=o_(e),c=t.length>0;let u=-1;const d=Ky(s)&&!Ky(l);c&&Ky(s)||(i.push(r(u_({value:s,multilineTag:a}),!d)),u+=1),c?(i.push(...t),u+=t.length):o&&i.push(o()),(c||o)&&Ky(l)||i.push(r(u_({value:l,multilineTag:a}),d));n(i,c?u:1,c?-1:0)}function Mj(e){const t=(0,tt.useRef)(e);return t.current=e,C_((e=>{function n(e){const{isSelected:n,disableFormats:r,onChange:o,value:a,formatTypes:i,tagName:s,onReplace:l,onSplit:c,onSplitMiddle:u,__unstableEmbedURLOnPaste:d,multilineTag:p,preserveWhiteSpace:m,pastePlainText:f}=t.current;if(!n)return void e.preventDefault();const{clipboardData:h}=e;let g="",b="";try{g=h.getData("text/plain"),b=h.getData("text/html")}catch(e){try{b=h.getData("Text")}catch(e){return}}if(e.preventDefault(),window.console.log("Received HTML:\n\n",b),window.console.log("Received plain text:\n\n",g),r)return void o(e_(a,g));const v=i.reduce(((e,{__unstablePasteRule:t})=>(t&&e===a&&(e=t(a,{html:b,plainText:g})),e)),a);if(v!==a)return void o(v);const y=[...$I(h)];if("true"===h.getData("rich-text")){const e=Ny({html:b,multilineTag:p,multilineWrapperTags:"li"===p?["ul","ol"]:void 0,preserveWhiteSpace:m});return bj(e,a.activeFormats),void o(e_(a,e))}if(f)return void o(e_(a,Ny({text:g})));if(y&&y.length&&!b){const e=dl({HTML:gj(y),mode:"BLOCKS",tagName:s,preserveWhiteSpace:m});return window.console.log("Received items:\n\n",y),void(l&&Ky(a)?l(e):_j({value:a,pastedBlocks:e,onReplace:l,onSplit:c,onSplitMiddle:u,multilineTag:p}))}let _=l&&c?"AUTO":"INLINE";var M;"AUTO"===_&&Ky(a)&&(M=g,Es(".*").test(M))&&(_="BLOCKS"),d&&Ky(a)&&fq(g.trim())&&(_="BLOCKS");const k=dl({HTML:b,plainText:g,mode:_,tagName:s,preserveWhiteSpace:m});if("string"==typeof k){let e=Ny({html:k});bj(e,a.activeFormats),p&&(e=n_(e,/\n+/g,Ty)),o(e_(a,e))}else k.length>0&&(l&&Ky(a)?l(k,k.length-1,-1):_j({value:a,pastedBlocks:k,onReplace:l,onSplit:c,onSplitMiddle:u,multilineTag:p}))}return e.addEventListener("paste",n),()=>{e.removeEventListener("paste",n)}}),[])}function kj(e){const{__unstableMarkLastChangeAsPersistent:t,__unstableMarkAutomaticChange:n}=ld(nk),r=(0,tt.useRef)(e);return r.current=e,C_((e=>{function o(){const{value:e,onReplace:t}=r.current;if(!t)return;const{start:o,text:a}=e;if(" "!==a.slice(o-1,o))return;const i=a.slice(0,o).trim(),s=Ko(Go("from").filter((({type:e})=>"prefix"===e)),(({prefix:e})=>i===e));if(!s)return;const l=u_({value:r_(e,o,a.length)});t([s.transform(l)]),n()}function a(e){const{inputType:a,type:i}=e,{value:s,onChange:l,__unstableAllowPrefixTransformations:c,formatTypes:u}=r.current;if("insertText"!==a&&"compositionend"!==i)return;c&&o&&o();const d=u.reduce(((e,{__unstableInputRule:t})=>(t&&(e=t(e)),e)),s);d!==s&&(t(),l({...d,activeFormats:s.activeFormats}),n())}return e.addEventListener("input",a),e.addEventListener("compositionend",a),()=>{e.removeEventListener("input",a),e.removeEventListener("compositionend",a)}}),[])}function wj(e){const{__unstableMarkAutomaticChange:t}=ld(nk),n=(0,tt.useRef)(e);return n.current=e,C_((e=>{function r(e){if(e.defaultPrevented)return;const{removeEditorOnlyFormats:r,value:o,onReplace:a,onSplit:i,onSplitMiddle:s,multilineTag:l,onChange:c,disableLineBreaks:u,onSplitAtEnd:d}=n.current;if(e.keyCode!==rm)return;e.preventDefault();const p={...o};p.formats=r(o);const m=a&&i;if(a){const e=Ko(Go("from").filter((({type:e})=>"enter"===e)),(e=>e.regExp.test(p.text)));e&&(a([e.transform({content:p.text})]),t())}if(l)e.shiftKey?u||c(e_(p,"\n")):m&&Gy(p)?_j({value:p,onReplace:a,onSplit:i,onSplitMiddle:s,multilineTag:l}):c(function(e,t=e.start,n=e.end){const r=e.text.slice(0,t).lastIndexOf(Ty),o=e.replacements[r];let a=[,];return o&&(a=[o]),e_(e,{formats:[,],replacements:a,text:Ty},t,n)}(p));else{const{text:t,start:n,end:r}=p,o=d&&n===r&&r===t.length;e.shiftKey||!m&&!o?u||c(e_(p,"\n")):!m&&o?d():m&&_j({value:p,onReplace:a,onSplit:i,onSplitMiddle:s,multilineTag:l})}}return e.addEventListener("keydown",r),()=>{e.removeEventListener("keydown",r)}}),[])}function Ej(e){return e(ky).getFormatTypes()}const Lj=new Set(["a","audio","button","details","embed","iframe","input","label","select","textarea","video"]);function Aj({formatTypes:e,onChange:t,onFocus:n,value:r,forwardedRef:o}){return e.map((e=>{const{name:a,edit:i}=e;if(!i)return null;const s=jy(r,a),l=void 0!==s,c=function({start:e,end:t,replacements:n,text:r}){if(e+1===t&&r[e]===xy)return n[e]}(r),u=void 0!==c&&c.type===a;return(0,tt.createElement)(i,{key:a,isActive:l,activeAttributes:l&&s.attributes||{},isObjectActive:u,activeObjectAttributes:u&&c.attributes||{},value:r,onChange:t,onFocus:n,contentRef:o})}))}const Sj=(0,tt.forwardRef)((function e({children:t,tagName:n="div",value:r="",onChange:o,isSelected:a,multiline:i,inlineToolbar:s,wrapperClassName:l,autocompleters:c,onReplace:u,placeholder:d,allowedFormats:p,formattingControls:m,withoutInteractiveFormatting:f,onRemove:h,onMerge:g,onSplit:b,__unstableOnSplitAtEnd:v,__unstableOnSplitMiddle:y,identifier:_,preserveWhiteSpace:M,__unstablePastePlainText:k,__unstableEmbedURLOnPaste:w,__unstableDisableFormats:E,disableLineBreaks:L,unstableOnFocus:A,__unstableAllowPrefixTransformations:S,...C},T){const x=Qk(e);_=_||x,C=function(e){return(0,at.omit)(e,["__unstableMobileNoFocusOnMount","deleteEnter","placeholderTextColor","textAlign","selectionColor","tagsToEliminate","rootTagsToEliminate","disableEditingMenu","fontSize","fontFamily","fontWeight","fontStyle","minWidth","maxWidth","setRef"])}(C);const z=(0,tt.useRef)(),{clientId:O}=ob(),{selectionStart:N,selectionEnd:D,isSelected:B,disabled:I}=Tl((e=>{const{getSelectionStart:t,getSelectionEnd:n,isMultiSelecting:r,hasMultiSelection:o}=e(nk),i=t(),s=n();let l;return void 0===a?l=i.clientId===O&&i.attributeKey===_:a&&(l=i.clientId===O),{selectionStart:l?i.offset:void 0,selectionEnd:l?s.offset:void 0,isSelected:l,disabled:r()||o()}})),{selectionChange:P}=ld(nk),R=vj(i),Y=yj({allowedFormats:p,formattingControls:m,disableFormats:E}),W=!Y||Y.length>0;let H=r,q=o;Array.isArray(r)&&(H=Vi.toHTML(r),q=e=>o(Vi.fromDOM(Sy(document,e).childNodes)));const j=(0,tt.useCallback)(((e,t)=>{P(O,_,e,t)}),[O,_]),{formatTypes:F,prepareHandlers:V,valueHandlers:X,changeHandlers:U,dependencies:$}=function({clientId:e,identifier:t,withoutInteractiveFormatting:n,allowedFormats:r}){const o=Tl(Ej,[]),a=(0,tt.useMemo)((()=>o.filter((({name:e,tagName:t})=>!(r&&!r.includes(e)||n&&Lj.has(t))))),[o,r,Lj]),i=Tl((n=>a.reduce(((r,o)=>(o.__experimentalGetPropsForEditableTreePreparation&&(r[o.name]=o.__experimentalGetPropsForEditableTreePreparation(n,{richTextIdentifier:t,blockClientId:e})),r)),{})),[a,e,t]),s=ld(),l=[],c=[],u=[],d=[];return a.forEach((n=>{if(n.__experimentalCreatePrepareEditableTree){const r=i[n.name],o=n.__experimentalCreatePrepareEditableTree(r,{richTextIdentifier:t,blockClientId:e});n.__experimentalCreateOnChangeEditableValue?c.push(o):l.push(o);for(const e in r)d.push(r[e])}if(n.__experimentalCreateOnChangeEditableValue){let r={};n.__experimentalGetPropsForEditableTreeChangeHandler&&(r=n.__experimentalGetPropsForEditableTreeChangeHandler(s,{richTextIdentifier:t,blockClientId:e})),u.push(n.__experimentalCreateOnChangeEditableValue({...i[n.name]||{},...r},{richTextIdentifier:t,blockClientId:e}))}})),{formatTypes:a,prepareHandlers:l,valueHandlers:c,changeHandlers:u,dependencies:d}}({clientId:O,identifier:_,withoutInteractiveFormatting:f,allowedFormats:Y});function K(e){return F.forEach((t=>{t.__experimentalCreatePrepareEditableTree&&(e=Qy(e,t.name,0,e.text.length))})),e.formats}const{value:G,onChange:J,onFocus:Q,ref:Z}=function({value:e="",selectionStart:t,selectionEnd:n,placeholder:r,preserveWhiteSpace:o,onSelectionChange:a,onChange:i,__unstableMultilineTag:s,__unstableDisableFormats:l,__unstableIsSelected:c,__unstableDependencies:u,__unstableAfterParse:d,__unstableBeforeSerialize:p,__unstableAddInvisibleFormats:m}){const[,f]=(0,tt.useReducer)((()=>({}))),h=(0,tt.useRef)();function g(){const{ownerDocument:{defaultView:e}}=h.current,t=e.getSelection(),n=t.rangeCount>0?t.getRangeAt(0):null;return Ny({element:h.current,range:n,multilineTag:s,multilineWrapperTags:"li"===s?["ul","ol"]:void 0,__unstableIsEditableTree:!0,preserveWhiteSpace:o})}function b(e,{domOnly:t}={}){R_({value:e,current:h.current,multilineTag:s,multilineWrapperTags:"li"===s?["ul","ol"]:void 0,prepareEditableTree:m,__unstableDomOnly:t,placeholder:r})}const v=(0,tt.useRef)(e),y=(0,tt.useRef)();function _(){v.current=e,y.current=Ny({html:e,multilineTag:s,multilineWrapperTags:"li"===s?["ul","ol"]:void 0,preserveWhiteSpace:o}),l&&(y.current.formats=Array(e.length),y.current.replacements=Array(e.length)),y.current.formats=d(y.current),y.current.start=t,y.current.end=n}const M=(0,tt.useRef)(!1);function k(e){b(e),v.current=l?e.text:u_({value:{...e,formats:p(e)},multilineTag:s,preserveWhiteSpace:o}),y.current=e;const{start:t,end:n,formats:r,text:c}=e;a(t,n),i(v.current,{__unstableFormats:r,__unstableText:c}),f()}function w(){_(),b(y.current)}y.current?t===y.current.start&&n===y.current.end||(M.current=c,y.current={...y.current,start:t,end:n}):_();const E=(0,tt.useRef)(!1);(0,tt.useLayoutEffect)((()=>{E.current&&e!==v.current&&w()}),[e]),(0,tt.useLayoutEffect)((()=>{M.current&&(w(),M.current=!1)}),[M.current]);const L=Ym([h,(0,tt.useCallback)((e=>{e&&(e.style.whiteSpace="pre-wrap",e.style.minWidth="1px")}),[]),W_({record:y}),H_({record:y,multilineTag:s,preserveWhiteSpace:o}),C_((e=>{function t(t){const{target:n}=t;if(n===e||n.textContent)return;const{ownerDocument:r}=n,{defaultView:o}=r,a=r.createRange(),i=o.getSelection();a.selectNode(n),i.removeAllRanges(),i.addRange(a)}return e.addEventListener("click",t),()=>{e.removeEventListener("click",t)}}),[]),j_({record:y,applyRecord:b}),K_({createRecord:g,handleChange:k,multilineTag:s}),F_({multilineTag:s,createRecord:g,handleChange:k}),U_({record:y,applyRecord:b,createRecord:g,handleChange:k,isSelected:c,onSelectionChange:a}),C_((()=>{w(),E.current=!0}),[r,...u])]);return{value:y.current,onChange:k,onFocus:function(){h.current.focus(),b(y.current)},ref:L}}({value:H,onChange(e,{__unstableFormats:t,__unstableText:n}){q(e),Object.values(U).forEach((e=>{e(t,n)}))},selectionStart:N,selectionEnd:D,onSelectionChange:j,placeholder:d,__unstableIsSelected:B,__unstableMultilineTag:R,__unstableDisableFormats:E,preserveWhiteSpace:M,__unstableDependencies:[...$,n],__unstableAfterParse:function(e){return X.reduce(((t,n)=>n(t,e.text)),e.formats)},__unstableBeforeSerialize:K,__unstableAddInvisibleFormats:function(e){return V.reduce(((t,n)=>n(t,e.text)),e.formats)}}),ee=dj({onReplace:u,completers:c,record:G,onChange:J});!function({value:e}){const t=e.activeFormats&&!!e.activeFormats.length,{isCaretWithinFormattedText:n}=Tl(nk),{enterFormattedText:r,exitFormattedText:o}=ld(nk);(0,tt.useEffect)((()=>{t?n()||r():n()&&o()}),[t])}({value:G}),function({html:e,value:t}){const n=(0,tt.useRef)(),r=t.activeFormats&&!!t.activeFormats.length,{__unstableMarkLastChangeAsPersistent:o}=ld(nk);(0,tt.useLayoutEffect)((()=>{if(n.current){if(n.current!==t.text){const e=window.setTimeout((()=>{o()}),1e3);return n.current=t.text,()=>{window.clearTimeout(e)}}o()}else n.current=t.text}),[e,r])}({html:H,value:G});const te=n,ne=(0,tt.createElement)(tt.Fragment,null,B&&t&&t({value:G,onChange:J,onFocus:Q}),B&&(0,tt.createElement)(Aj,{value:G,onChange:J,onFocus:Q,formatTypes:F,forwardedRef:z}),B&&W&&(0,tt.createElement)(fj,{inline:s,anchorRef:z.current}),(0,tt.createElement)(te,ot({role:"textbox","aria-multiline":!0,"aria-label":d},C,ee,{ref:Ym([ee.ref,C.ref,Z,kj({value:G,onChange:J,__unstableAllowPrefixTransformations:S,formatTypes:F,onReplace:u}),C_((e=>{function t(e){(ym.primary(e,"z")||ym.primary(e,"y")||ym.primaryShift(e,"z"))&&e.preventDefault()}return e.addEventListener("keydown",t),()=>{e.addEventListener("keydown",t)}}),[]),hj(),Mj({isSelected:B,disableFormats:E,onChange:J,value:G,formatTypes:F,tagName:n,onReplace:u,onSplit:b,onSplitMiddle:y,__unstableEmbedURLOnPaste:w,multilineTag:R,preserveWhiteSpace:M,pastePlainText:k}),wj({removeEditorOnlyFormats:K,value:G,onReplace:u,onSplit:b,onSplitMiddle:y,multilineTag:R,onChange:J,disableLineBreaks:L,onSplitAtEnd:v}),z,T]),contentEditable:!I||void 0,suppressContentEditableWarning:!I,className:so()("block-editor-rich-text__editable",C.className,"rich-text"),onFocus:A,onKeyDown:function(e){const{keyCode:t}=e;if(!e.defaultPrevented&&(t===cm||t===nm)){const{start:n,end:r,text:o}=G,a=t===nm,i=G.activeFormats&&!!G.activeFormats.length;if(!$y(G)||i||a&&0!==n||!a&&r!==o.length)return;g&&g(!a),h&&Ky(G)&&a&&h(!a),e.preventDefault()}}})));if(!l)return ne;qp("wp.blockEditor.RichText wrapperClassName prop",{since:"5.4",alternative:"className prop or create your own wrapper div"});const re=so()("block-editor-rich-text",l);return(0,tt.createElement)("div",{className:re},ne)}));Sj.Content=({value:e,tagName:t,multiline:n,...r})=>{Array.isArray(e)&&(e=Vi.toHTML(e));const o=vj(n);!e&&o&&(e=`<${o}>${o}>`);const a=(0,tt.createElement)(Pa,null,e);return t?(0,tt.createElement)(t,(0,at.omit)(r,["format"]),a):a},Sj.isEmpty=e=>!e||0===e.length;const Cj=Sj,Tj=(0,tt.forwardRef)(((e,t)=>(0,tt.createElement)(Cj,ot({ref:t},e,{__unstableDisableFormats:!0,preserveWhiteSpace:!0}))));Tj.Content=({value:e="",tagName:t="div",...n})=>(0,tt.createElement)(t,n,e);const xj=Tj,zj=(0,tt.forwardRef)((({__experimentalVersion:e,...t},n)=>{if(2===e)return(0,tt.createElement)(xj,ot({ref:n},t));const{className:r,onChange:o,...a}=t;return(0,tt.createElement)(yR.Z,ot({ref:n,className:so()("block-editor-plain-text",r),onChange:e=>o(e.target.value)},a))}));function Oj({character:e,type:t,onUse:n}){return rS(hm[t](e),(()=>(n(),!1)),{bindGlobal:!0}),null}function Nj({name:e,shortcutType:t,shortcutCharacter:n,...r}){let o,a="RichText.ToolbarControls";return e&&(a+=`.${e}`),t&&n&&(o=bm[t](n)),(0,tt.createElement)(cf,{name:a},(0,tt.createElement)(jg,ot({},r,{shortcut:o})))}class Dj extends tt.Component{constructor(){super(...arguments),this.onInput=this.onInput.bind(this)}onInput(e){e.inputType===this.props.inputType&&this.props.onInput()}componentDidMount(){document.addEventListener("input",this.onInput,!0)}componentWillUnmount(){document.removeEventListener("input",this.onInput,!0)}render(){return null}}function Bj({units:e,...t}){const n=Lk({availableUnits:JL("spacing.units")||["%","px","em","rem","vw"],units:e});return(0,tt.createElement)(UL,ot({units:n},t))}const Ij="none",Pj="custom",Rj="media",Yj="attachment",Wj=["noreferrer","noopener"],Hj=(0,tt.createElement)(mo,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,tt.createElement)(uo,{d:"M0,0h24v24H0V0z",fill:"none"}),(0,tt.createElement)(uo,{d:"m19 5v14h-14v-14h14m0-2h-14c-1.1 0-2 0.9-2 2v14c0 1.1 0.9 2 2 2h14c1.1 0 2-0.9 2-2v-14c0-1.1-0.9-2-2-2z"}),(0,tt.createElement)(uo,{d:"m14.14 11.86l-3 3.87-2.14-2.59-3 3.86h12l-3.86-5.14z"})),qj=({linkDestination:e,onChangeUrl:t,url:n,mediaType:r="image",mediaUrl:o,mediaLink:a,linkTarget:i,linkClass:s,rel:l})=>{const[c,u]=(0,tt.useState)(!1),d=(0,tt.useCallback)((()=>{u(!0)})),[p,m]=(0,tt.useState)(!1),[f,h]=(0,tt.useState)(null),g=(0,tt.useRef)(null),b=(0,tt.useCallback)((()=>{e!==Rj&&e!==Yj||h(""),m(!0)})),v=(0,tt.useCallback)((()=>{m(!1)})),y=(0,tt.useCallback)((()=>{h(null),v(),u(!1)})),_=e=>{let t=e;return void 0===e||(0,at.isEmpty)(t)||(0,at.isEmpty)(t)||((0,at.each)(Wj,(e=>{const n=new RegExp("\\b"+e+"\\b","gi");t=t.replace(n,"")})),t!==e&&(t=t.trim()),(0,at.isEmpty)(t)&&(t=void 0)),t},M=(0,tt.useCallback)((()=>e=>{const t=g.current;t&&t.contains(e.target)||(u(!1),h(null),v())})),k=(0,tt.useCallback)((()=>e=>{if(f){var n;const e=(null===(n=E().find((e=>e.url===f)))||void 0===n?void 0:n.linkDestination)||Pj;t({href:f,linkDestination:e})}v(),h(null),e.preventDefault()})),w=(0,tt.useCallback)((()=>{t({linkDestination:Ij,href:""})})),E=()=>{const e=[{linkDestination:Rj,title:er("Media File"),url:"image"===r?o:void 0,icon:Hj}];return"image"===r&&a&&e.push({linkDestination:Yj,title:er("Attachment Page"),url:"image"===r?a:void 0,icon:(0,tt.createElement)(mo,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,tt.createElement)(uo,{d:"M0 0h24v24H0V0z",fill:"none"}),(0,tt.createElement)(uo,{d:"M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zM6 20V4h7v5h5v11H6z"}))}),e},L=(0,tt.createElement)(tt.Fragment,null,(0,tt.createElement)(KN,{label:er("Open in new tab"),onChange:e=>{const n=(e=>{const t=e?"_blank":void 0;let n;return n=t||l?_(l):void 0,{linkTarget:t,rel:n}})(e);t(n)},checked:"_blank"===i}),(0,tt.createElement)(LA,{label:er("Link Rel"),value:_(l)||"",onChange:e=>{t({rel:e})}}),(0,tt.createElement)(LA,{label:er("Link CSS Class"),value:s||"",onChange:e=>{t({linkClass:e})}})),A=null!==f?f:n,S=((0,at.find)(E(),["linkDestination",e])||{}).title;return(0,tt.createElement)(tt.Fragment,null,(0,tt.createElement)(jg,{icon:dT,className:"components-toolbar__control",label:er(n?"Edit link":"Insert link"),"aria-expanded":c,onClick:d}),c&&(0,tt.createElement)(nj,{onFocusOutside:M(),onClose:y,renderSettings:()=>L,additionalControls:!A&&(0,tt.createElement)(Jg,null,(0,at.map)(E(),(e=>(0,tt.createElement)(zB,{key:e.linkDestination,icon:e.icon,onClick:()=>{h(null),(e=>{const n=E();let r;r=e?((0,at.find)(n,(t=>t.url===e))||{linkDestination:Pj}).linkDestination:Ij,t({linkDestination:r,href:e})})(e.url),v()}},e.title))))},(!n||p)&&(0,tt.createElement)(nj.LinkEditor,{className:"block-editor-format-toolbar__link-container-content",value:A,onChangeInputValue:h,onSubmit:k(),autocompleteRef:g}),n&&!p&&(0,tt.createElement)(tt.Fragment,null,(0,tt.createElement)(nj.LinkViewer,{className:"block-editor-format-toolbar__link-container-content",url:n,onEditLinkClick:b,urlLabel:S}),(0,tt.createElement)(Eh,{icon:Hm,label:er("Remove link"),onClick:w}))))},jj=QI((e=>({selectedBlockClientId:e(nk).getBlockSelectionStart()})))((({selectedBlockClientId:e})=>{const t=FT(e);return e?(0,tt.createElement)(Eh,{variant:"secondary",className:"block-editor-skip-to-selected-block",onClick:()=>{t.current.focus()}},er("Skip to the selected block")):null})),Fj={HTMLRegExp:/<\/?[a-z][^>]*?>/gi,HTMLcommentRegExp://g,spaceRegExp:/ | /gi,HTMLEntityRegExp:/&\S+?;/g,connectorRegExp:/--|\u2014/g,removeRegExp:new RegExp(["[","!-/:-@[-`{-~","-¿×÷"," -⯿","⸀-","]"].join(""),"g"),astralRegExp:/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,wordsRegExp:/\S\s+/g,characters_excluding_spacesRegExp:/\S/g,characters_including_spacesRegExp:/[^\f\n\r\t\v\u00AD\u2028\u2029]/g,l10n:{type:"words"}};function Vj(e,t){return t.replace(e.HTMLRegExp,"\n")}function Xj(e,t){return t.replace(e.astralRegExp,"a")}function Uj(e,t){return t.replace(e.HTMLEntityRegExp,"")}function $j(e,t){return t.replace(e.connectorRegExp," ")}function Kj(e,t){return t.replace(e.removeRegExp,"")}function Gj(e,t){return t.replace(e.HTMLcommentRegExp,"")}function Jj(e,t){return e.shortcodesRegExp?t.replace(e.shortcodesRegExp,"\n"):t}function Qj(e,t){return t.replace(e.spaceRegExp," ")}function Zj(e,t){return t.replace(e.HTMLEntityRegExp,"a")}function eF(e,t,n){var r,o;return e=(0,at.flow)(Vj.bind(null,n),Gj.bind(null,n),Jj.bind(null,n),Xj.bind(null,n),Qj.bind(null,n),Zj.bind(null,n))(e),null!==(r=null===(o=(e+="\n").match(t))||void 0===o?void 0:o.length)&&void 0!==r?r:0}function tF(e,t,n){const r=function(e,t){var n,r;const o=(0,at.extend)({},Fj,t);return o.shortcodes=null!==(n=null===(r=o.l10n)||void 0===r?void 0:r.shortcodes)&&void 0!==n?n:[],o.shortcodes&&o.shortcodes.length&&(o.shortcodesRegExp=new RegExp("\\[\\/?(?:"+o.shortcodes.join("|")+")[^\\]]*?\\]","g")),o.type=e,"characters_excluding_spaces"!==o.type&&"characters_including_spaces"!==o.type&&(o.type="words"),o}(t,n);let o;switch(r.type){case"words":return o=r.wordsRegExp,function(e,t,n){var r,o;return e=(0,at.flow)(Vj.bind(null,n),Gj.bind(null,n),Jj.bind(null,n),Qj.bind(null,n),Uj.bind(null,n),$j.bind(null,n),Kj.bind(null,n))(e),null!==(r=null===(o=(e+="\n").match(t))||void 0===o?void 0:o.length)&&void 0!==r?r:0}(e,o,r);case"characters_including_spaces":return o=r.characters_including_spacesRegExp,eF(e,o,r);case"characters_excluding_spaces":return o=r.characters_excluding_spacesRegExp,eF(e,o,r);default:return 0}}const nF=QI((e=>{const{getMultiSelectedBlocks:t}=e(nk);return{blocks:t()}}))((function({blocks:e}){const t=tF(gi(e),"words");return(0,tt.createElement)("div",{className:"block-editor-multi-selection-inspector__card"},(0,tt.createElement)(MB,{icon:CY,showColors:!0}),(0,tt.createElement)("div",{className:"block-editor-multi-selection-inspector__card-content"},(0,tt.createElement)("div",{className:"block-editor-multi-selection-inspector__card-title"},pn(nr("%d block","%d blocks",e.length),e.length)),(0,tt.createElement)("div",{className:"block-editor-multi-selection-inspector__card-description"},pn(nr("%d word","%d words",t),t))))}));function rF({blockName:e}){const{preferredStyle:t,onUpdatePreferredStyleVariations:n,styles:r}=Tl((t=>{var n,r;const o=t(nk).getSettings().__experimentalPreferredStyleVariations;return{preferredStyle:null==o||null===(n=o.value)||void 0===n?void 0:n[e],onUpdatePreferredStyleVariations:null!==(r=null==o?void 0:o.onChange)&&void 0!==r?r:null,styles:t(Gr).getBlockStyles(e)}}),[e]),o=(0,tt.useMemo)((()=>[{label:er("Not set"),value:""},...r.map((({label:e,name:t})=>({label:e,value:t})))]),[r]),a=(0,tt.useCallback)((t=>{n(e,t)}),[e,n]);return n&&(0,tt.createElement)(KS,{options:o,value:t||"",label:er("Default Style"),onChange:a})}function oF({choices:e=[],onHover:t=at.noop,onSelect:n,value:r}){return e.map((e=>{const o=r===e.value;return(0,tt.createElement)(zB,{key:e.value,role:"menuitemradio",icon:o&&kS,info:e.info,isSelected:o,shortcut:e.shortcut,className:"components-menu-items-choice",onClick:()=>{o||n(e.value)},onMouseEnter:()=>t(e.value),onMouseLeave:()=>t(null),"aria-label":e["aria-label"]},e.label)}))}const aF=(e,t)=>{if(!t||!e)return;const n=t.filter((({attributes:t})=>!(!t||!Object.keys(t).length)&&(0,at.isMatch)(e,t)));return 1===n.length?n[0]:void 0};const iF=function({blockClientId:e}){const[t,n]=(0,tt.useState)(),{updateBlockAttributes:r}=ld(nk),{variations:o,blockAttributes:a}=Tl((t=>{const{getBlockVariations:n}=t(Gr),{getBlockName:r,getBlockAttributes:o}=t(nk),a=e&&r(e);return{variations:a&&n(a,"transform"),blockAttributes:o(e)}}),[e]);if((0,tt.useEffect)((()=>{var e;n(null===(e=aF(a,o))||void 0===e?void 0:e.name)}),[a,o]),null==o||!o.length)return null;const i=o.map((({name:e,title:t,description:n})=>({value:e,label:t,info:n}))),s=t=>{r(e,{...o.find((({name:e})=>e===t)).attributes})},l="block-editor-block-variation-transforms";return(0,tt.createElement)(Zg,{className:l,label:er("Transform to variation"),text:er("Transform to variation"),popoverProps:{position:"bottom center",className:`${l}__popover`},icon:OA,toggleProps:{iconPosition:"right"}},(()=>(0,tt.createElement)("div",{className:`${l}__container`},(0,tt.createElement)(ON,null,(0,tt.createElement)(oF,{choices:i,value:t,onSelect:s})))))},sF=({clientId:e,blockName:t,hasBlockStyles:n,bubblesVirtually:r})=>{const o=QB(e);return(0,tt.createElement)("div",{className:"block-editor-block-inspector"},(0,tt.createElement)(NP,o),(0,tt.createElement)(iF,{blockClientId:e}),n&&(0,tt.createElement)("div",null,(0,tt.createElement)(BA,{title:er("Styles")},(0,tt.createElement)(NY,{clientId:e}),Ro(t,"defaultStylePicker",!0)&&(0,tt.createElement)(rF,{blockName:t}))),(0,tt.createElement)(FA.Slot,{bubblesVirtually:r}),(0,tt.createElement)("div",null,(0,tt.createElement)(lF,{slotName:WA.slotName,bubblesVirtually:r})),(0,tt.createElement)(jj,{key:"back"}))},lF=({slotName:e,bubblesVirtually:t})=>{const n=nf(e);return Boolean(n.fills&&n.fills.length)?(0,tt.createElement)(BA,{className:"block-editor-block-inspector__advanced",title:er("Advanced"),initialOpen:!1},(0,tt.createElement)(WA.Slot,{bubblesVirtually:t})):null},cF=({showNoBlockSelectedMessage:e=!0,bubblesVirtually:t=!0})=>{const{count:n,hasBlockStyles:r,selectedBlockName:o,selectedBlockClientId:a,blockType:i}=Tl((e=>{const{getSelectedBlockClientId:t,getSelectedBlockCount:n,getBlockName:r}=e(nk),{getBlockStyles:o}=e(Gr),a=t(),i=a&&r(a),s=i&&Bo(i),l=i&&o(i);return{count:n(),selectedBlockClientId:a,selectedBlockName:i,blockType:s,hasBlockStyles:l&&l.length>0}}),[]);if(n>1)return(0,tt.createElement)("div",{className:"block-editor-block-inspector"},(0,tt.createElement)(nF,null),(0,tt.createElement)(FA.Slot,{bubblesVirtually:t}));const s=o===No();return i&&a&&!s?(0,tt.createElement)(sF,{clientId:a,blockName:i.name,hasBlockStyles:r,bubblesVirtually:t}):e?(0,tt.createElement)("span",{className:"block-editor-block-inspector__no-blocks"},er("No block selected.")):null};const uF=function({rootClientId:e,clientId:t,isAppender:n,showInserterHelpPanel:r,showMostUsedBlocks:o=!1,__experimentalInsertionIndex:a,onSelect:i=at.noop,shouldFocusBlock:s=!1}){const l=Tl((n=>{const{getBlockRootClientId:r}=n(nk);return e||r(t)||void 0}),[t,e]);return(0,tt.createElement)(tH,{onSelect:i,rootClientId:l,clientId:t,isAppender:n,showInserterHelpPanel:r,showMostUsedBlocks:o,__experimentalInsertionIndex:a,shouldFocusBlock:s})};function dF(){return null}dF.Register=function(){const{registerShortcut:e}=ld(AI);return(0,tt.useEffect)((()=>{e({name:"core/block-editor/duplicate",category:"block",description:er("Duplicate the selected block(s)."),keyCombination:{modifier:"primaryShift",character:"d"}}),e({name:"core/block-editor/remove",category:"block",description:er("Remove the selected block(s)."),keyCombination:{modifier:"access",character:"z"}}),e({name:"core/block-editor/insert-before",category:"block",description:er("Insert a new block before the selected block(s)."),keyCombination:{modifier:"primaryAlt",character:"t"}}),e({name:"core/block-editor/insert-after",category:"block",description:er("Insert a new block after the selected block(s)."),keyCombination:{modifier:"primaryAlt",character:"y"}}),e({name:"core/block-editor/delete-multi-selection",category:"block",description:er("Remove multiple selected blocks."),keyCombination:{character:"del"},aliases:[{character:"backspace"}]}),e({name:"core/block-editor/select-all",category:"selection",description:er("Select all text when typing. Press again to select all blocks."),keyCombination:{modifier:"primary",character:"a"}}),e({name:"core/block-editor/unselect",category:"selection",description:er("Clear selection."),keyCombination:{character:"escape"}}),e({name:"core/block-editor/focus-toolbar",category:"global",description:er("Navigate to the nearest toolbar."),keyCombination:{modifier:"alt",character:"F10"}}),e({name:"core/block-editor/move-up",category:"block",description:er("Move the selected block(s) up."),keyCombination:{modifier:"secondary",character:"t"}}),e({name:"core/block-editor/move-down",category:"block",description:er("Move the selected block(s) down."),keyCombination:{modifier:"secondary",character:"y"}})}),[e]),null};const pF=dF,mF=new Set([im,sm,lm,am,rm,nm]);function fF(){const e=Tl((e=>e(nk).isTyping())),{startTyping:t,stopTyping:n}=ld(nk);return Ym([function(){const e=Tl((e=>e(nk).isTyping())),{stopTyping:t}=ld(nk);return C_((n=>{if(!e)return;const{ownerDocument:r}=n;let o,a;function i(e){const{clientX:n,clientY:r}=e;o&&a&&(o!==n||a!==r)&&t(),o=n,a=r}return r.addEventListener("mousemove",i),()=>{r.removeEventListener("mousemove",i)}}),[e,t])}(),C_((r=>{const{ownerDocument:o}=r,{defaultView:a}=o;if(e){let e;function t(t){const{target:r}=t;e=a.setTimeout((()=>{DI(r)||n()}))}function i(e){const{keyCode:t}=e;t!==om&&9!==t||n()}function s(){const e=a.getSelection();e.rangeCount>0&&e.getRangeAt(0).collapsed||n()}return r.addEventListener("focus",t),r.addEventListener("keydown",i),o.addEventListener("selectionchange",s),()=>{a.clearTimeout(e),r.removeEventListener("focus",t),r.removeEventListener("keydown",i),o.removeEventListener("selectionchange",s)}}function i(e){const{type:n,target:o}=e;DI(o)&&r.contains(o)&&("keydown"!==n||function(e){const{keyCode:t,shiftKey:n}=e;return!n&&mF.has(t)}(e))&&t()}return r.addEventListener("keypress",i),r.addEventListener("keydown",i),()=>{r.removeEventListener("keypress",i),r.removeEventListener("keydown",i)}}),[e,t,n])])}function hF(e){const t=e.getSelection();ps();const n=t.rangeCount?t.getRangeAt(0):null;return n?Fp(n):null}window.navigator.userAgent.indexOf("Trident");const gF=new Set([im,lm,am,sm]);function bF(){const e=Tl((e=>e(nk).hasSelectedBlock()));return C_((t=>{if(!e)return;const{ownerDocument:n}=t,{defaultView:r}=n;let o,a,i;function s(){o||(o=r.requestAnimationFrame((()=>{p(),o=null})))}function l(e){a&&r.cancelAnimationFrame(a),a=r.requestAnimationFrame((()=>{c(e),a=null}))}function c({keyCode:e}){if(!m())return;const o=hF(r);if(!o)return;if(!i)return void(i=o);if(gF.has(e))return void(i=o);const a=o.top-i.top;if(0===a)return;const s=IB(t);if(!s)return;const l=s===n.body,c=l?r.scrollY:s.scrollTop,u=l?0:s.getBoundingClientRect().top,d=l?i.top/r.innerHeight:(i.top-u)/(r.innerHeight-u);if(0===c&&d<.75&&function(){const e=t.querySelectorAll('[contenteditable="true"]');return e[e.length-1]===n.activeElement}())return void(i=o);const p=l?r.innerHeight:s.clientHeight;i.top+i.height>u+p||i.top{r.removeEventListener("scroll",s,!0),r.removeEventListener("resize",s,!0),t.removeEventListener("keydown",l),t.removeEventListener("keyup",c),t.removeEventListener("mousedown",u),t.removeEventListener("touchstart",u),n.removeEventListener("selectionchange",d),r.cancelAnimationFrame(o),r.cancelAnimationFrame(a)}}),[e])}function vF(e,t){const n="start"===t?"firstChild":"lastChild",r="start"===t?"nextSibling":"previousSibling";for(;e[n];)for(e=e[n];e.nodeType===e.TEXT_NODE&&/^[ \t\n]*$/.test(e.data)&&e[r];)e=e[r];return e}function yF(e){const{isMultiSelecting:t,getMultiSelectedBlockClientIds:n,hasMultiSelection:r,getSelectedBlockClientId:o}=e(nk);return{isMultiSelecting:t(),multiSelectedBlockClientIds:n(),hasMultiSelection:r(),selectedBlockClientId:o()}}function _F(){const e=(0,tt.useRef)(),{isMultiSelecting:t,multiSelectedBlockClientIds:n,hasMultiSelection:r,selectedBlockClientId:o}=Tl(yF,[]),a=FT(o),i=FT((0,at.first)(n)),s=FT((0,at.last)(n));return(0,tt.useEffect)((()=>{const{ownerDocument:l}=e.current,{defaultView:c}=l;if(!r||t){if(!o||t)return;const e=c.getSelection();if(e.rangeCount&&!e.isCollapsed){const t=a.current,{startContainer:n,endContainer:r}=e.getRangeAt(0);!t||t.contains(n)&&t.contains(r)||e.removeAllRanges()}return}const{length:u}=n;if(u<2)return;e.current.focus();const d=c.getSelection(),p=l.createRange(),m=vF(i.current,"start"),f=vF(s.current,"end");!function(e,t){Array.from(e.querySelectorAll(".rich-text")).forEach((e=>{t?e.setAttribute("contenteditable",!0):e.removeAttribute("contenteditable")}))}(e.current,!1),p.setStartBefore(m),p.setEndAfter(f),d.removeAllRanges(),d.addRange(p)}),[r,t,n,o]),e}function MF(e){const{tagName:t}=e;return"INPUT"===t||"BUTTON"===t||"SELECT"===t||"TEXTAREA"===t}function kF(e,t,n=!1){if(kR(e))return e.selectionStart===e.selectionEnd&&(t?0===e.selectionStart:e.value.length===e.selectionStart);if(!e.isContentEditable)return!0;const{ownerDocument:r}=e,{defaultView:o}=r;ps();const a=o.getSelection();if(!a||!a.rangeCount)return!1;const i=a.getRangeAt(0),s=i.cloneRange(),l=function(e){const{anchorNode:t,focusNode:n,anchorOffset:r,focusOffset:o}=e;ps(),ps();const a=t.compareDocumentPosition(n);return!(a&t.DOCUMENT_POSITION_PRECEDING)&&(!!(a&t.DOCUMENT_POSITION_FOLLOWING)||0!==a||r<=o)}(a),c=a.isCollapsed;c||s.collapse(!l);const u=Fp(s),d=Fp(i);if(!u||!d)return!1;const p=function(e){const t=Array.from(e.getClientRects());if(!t.length)return;const n=Math.min(...t.map((({top:e})=>e)));return Math.max(...t.map((({bottom:e})=>e)))-n}(i);if(!c&&p&&p>u.height&&l===t)return!1;const m=wR(e)?!t:t,f=e.getBoundingClientRect(),h=MR(r,m?f.left+1:f.right-1,t?f.top+1:f.bottom-1,e);if(!h)return!1;const g=Fp(h);if(!g)return!1;const b=t?"top":"bottom",v=m?"left":"right",y=g[b]-d[b],_=g[v]-u[v],M=Math.abs(y)<=1,k=Math.abs(_)<=1;return n?M:M&&k}function wF(e,t){return kF(e,t,!0)}function EF(e,t){return kF(e,t)}function LF(e,t,n,r=!0){if(!e)return;if(!n||!e.isContentEditable)return void LR(e,t);e.focus();const o=n.height/2,a=e.getBoundingClientRect(),i=n.left,s=t?a.bottom-o:a.top+o,{ownerDocument:l}=e,{defaultView:c}=l,u=MR(l,i,s,e);if(!u||!e.contains(u.startContainer))return!r||u&&u.startContainer&&u.startContainer.contains(e)?void LR(e,t):(e.scrollIntoView(t),void LF(e,t,n,!1));ps();const d=c.getSelection();ps(),d.removeAllRanges(),d.addRange(u)}function AF(e,t,n,r){let o,a=Om.focusable.find(n);return t&&(a=(0,at.reverse)(a)),a=a.slice(a.indexOf(e)+1),r&&(o=e.getBoundingClientRect()),(0,at.find)(a,(function(e){if(!Om.tabbable.isTabbableIndex(e))return!1;if(e.isContentEditable&&"true"!==e.contentEditable)return!1;if(r){const t=e.getBoundingClientRect();if(t.left>=o.right||t.right<=o.left)return!1}return!0}))}function SF(){const{getSelectedBlockClientId:e,getMultiSelectedBlocksStartClientId:t,getMultiSelectedBlocksEndClientId:n,getPreviousBlockClientId:r,getNextBlockClientId:o,getFirstMultiSelectedBlockClientId:a,getLastMultiSelectedBlockClientId:i,getSettings:s,hasMultiSelection:l}=Tl(nk),{multiSelect:c,selectBlock:u}=ld(nk);return C_((d=>{let p;function m(){p=null}function f(a){const i=e(),s=t(),l=n(),d=r(l||i),p=o(l||i),m=a?d:p;m&&(s===m?u(m):c(s||i,m))}function h(e){const t=a(),n=i(),r=e?t:n;r&&u(r)}function g(e,t){const n=AF(e,t,d);return!(n&&(r=e,o=n,r.closest(AR)===o.closest(AR)));var r,o}function b(t){const{keyCode:a,target:i}=t,c=a===im,u=a===am,m=c||u,b=u||a===sm,v=c||a===lm,y=b||v,_=t.shiftKey,M=_||t.ctrlKey||t.altKey||t.metaKey,k=v?wF:EF,{ownerDocument:w}=d,{defaultView:E}=w;if(l()){if(y){(_?f:h)(m),t.preventDefault()}return}if(v?p||(p=hF(E)):p=null,t.defaultPrevented)return;if(!y)return;if(!function(e,t,n){if((t===im||t===lm)&&!n)return!0;const{tagName:r}=e;return"INPUT"!==r&&"TEXTAREA"!==r}(i,a,M))return;const L=wR(i)?!m:m,{keepCaretInsideBlock:A}=s(),S=e();if(_){const e=n(),a=r(e||S),s=o(e||S);(m&&a||!m&&s)&&g(i,m)&&k(i,m)&&(f(m),t.preventDefault())}else if(v&&wF(i,m)&&!A){const e=AF(i,m,d,!0);e&&(LF(e,m,p),t.preventDefault())}else if(b&&E.getSelection().isCollapsed&&EF(i,L)&&!A){LR(AF(i,L,d),m),t.preventDefault()}}return d.addEventListener("mousedown",m),d.addEventListener("keydown",b),()=>{d.removeEventListener("mousedown",m),d.removeEventListener("keydown",b)}}),[])}function CF(e,t,n){let r=t;do{if(e===r)return!0;r=r[n]}while(r);return!1}function TF(){const{getBlockOrder:e,getSelectedBlockClientIds:t,getBlockRootClientId:n}=Tl(nk),{multiSelect:r}=ld(nk),o=function(){const{getAllShortcutKeyCombinations:e}=Tl(AI);return function(t,n){return e(t).some((({modifier:e,character:t})=>ym[e](n,t)))}}();return C_((a=>{function i(a){if(!o("core/block-editor/select-all",a))return;if(!function(e){if(kR(e))return 0===e.selectionStart&&e.value.length===e.selectionEnd;if(!e.isContentEditable)return!0;const{ownerDocument:t}=e,{defaultView:n}=t;ps();const r=n.getSelection();ps();const o=r.rangeCount?r.getRangeAt(0):null;if(!o)return!0;const{startContainer:a,endContainer:i,startOffset:s,endOffset:l}=o;if(a===e&&i===e&&0===s&&l===e.childNodes.length)return!0;e.lastChild,ps();const c=i.nodeType===i.TEXT_NODE?i.data.length:i.childNodes.length;return CF(a,e,"firstChild")&&CF(i,e,"lastChild")&&0===s&&l===c}(a.target))return;const i=t(),[s]=i,l=n(s);let c=e(l);i.length===c.length&&(c=e(n(l)));const u=(0,at.first)(c),d=(0,at.last)(c);u!==d&&(r(u,d),a.preventDefault())}return a.addEventListener("keydown",i),()=>{a.removeEventListener("keydown",i)}}),[])}function xF(){const[e,t,n]=function(){const e=(0,tt.useRef)(),t=(0,tt.useRef)(),n=(0,tt.useRef)(),r=(0,tt.useRef)(),{hasMultiSelection:o,getSelectedBlockClientId:a}=Tl(nk),{setNavigationMode:i}=ld(nk),s=Tl((e=>e(nk).isNavigationMode()),[])?void 0:"0",l=(0,tt.useRef)();function c(t){if(l.current)l.current=null;else if(o())e.current.focus();else if(a())r.current.focus();else{i(!0);const n=t.target.compareDocumentPosition(e.current)&t.target.DOCUMENT_POSITION_FOLLOWING?"findNext":"findPrevious";Om.tabbable[n](t.target).focus()}}const u=(0,tt.createElement)("div",{ref:t,tabIndex:s,onFocus:c}),d=(0,tt.createElement)("div",{ref:n,tabIndex:s,onFocus:c}),p=C_((s=>{function c(e){if(e.defaultPrevented)return;if(e.keyCode===om&&!o())return e.preventDefault(),void i(!0);if(9!==e.keyCode)return;const r=e.shiftKey,c=r?"findPrevious":"findNext";if(!o()&&!a())return void(e.target===s&&i(!0));if(MF(e.target)&&MF(Om.tabbable[c](e.target)))return;const u=r?t:n;l.current=!0,u.current.focus({preventScroll:!0})}function u(e){r.current=e.target}function d(r){var o;if(9!==r.keyCode)return;if("region"===(null===(o=r.target)||void 0===o?void 0:o.getAttribute("role")))return;if(e.current===r.target)return;const a=r.shiftKey?"findPrevious":"findNext",i=Om.tabbable[a](r.target);i!==t.current&&i!==n.current||(r.preventDefault(),i.focus({preventScroll:!0}))}return s.ownerDocument.defaultView.addEventListener("keydown",d),s.addEventListener("keydown",c),s.addEventListener("focusout",u),()=>{s.ownerDocument.defaultView.removeEventListener("keydown",d),s.removeEventListener("keydown",c),s.removeEventListener("focusout",u)}}),[]);return[u,Ym([e,p]),d]}(),r=Tl((e=>e(nk).hasMultiSelection()),[]);return[e,Ym([t,_F(),TF(),SF(),C_((e=>{if(e.tabIndex=-1,r)return e.setAttribute("aria-label",er("Multiple selected blocks")),()=>{e.removeAttribute("aria-label")}}),[r])]),n]}const zF=(0,tt.forwardRef)((function({children:e,...t},n){const[r,o,a]=xF();return(0,tt.createElement)(tt.Fragment,null,r,(0,tt.createElement)("div",ot({},t,{ref:Ym([o,n]),className:so()(t.className,"block-editor-writing-flow")}),e),a)})),OF=(0,at.overEvery)([DI,Om.tabbable.isTabbableIndex]);const NF=(0,tt.createContext)({});function DF(e,t=""){var n;const r=(0,tt.useContext)(NF),{name:o}=ob();t=t||o;const a=Boolean(null===(n=r[t])||void 0===n?void 0:n.has(e)),i=(0,tt.useMemo)((()=>function(e,t,n){const r={...e,[t]:e[t]?new Set(e[t]):new Set};return r[t].add(n),r}(r,t,e)),[r,t,e]);return[a,(0,tt.useCallback)((({children:e})=>(0,tt.createElement)(NF.Provider,{value:i},e)),[i])]}var BF=n(3692),IF=n.n(BF);const PF=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function RF(e,t){t=t||{};let n=1,r=1;function o(e){const t=e.match(/\n/g);t&&(n+=t.length);const o=e.lastIndexOf("\n");r=~o?e.length-o:r+e.length}function a(){const e={line:n,column:r};return function(t){return t.position=new i(e),m(),t}}function i(e){this.start=e,this.end={line:n,column:r},this.source=t.source}i.prototype.content=e;const s=[];function l(o){const a=new Error(t.source+":"+n+":"+r+": "+o);if(a.reason=o,a.filename=t.source,a.line=n,a.column=r,a.source=e,!t.silent)throw a;s.push(a)}function c(){return p(/^{\s*/)}function u(){return p(/^}/)}function d(){let t;const n=[];for(m(),f(n);e.length&&"}"!==e.charAt(0)&&(t=E()||L());)!1!==t&&(n.push(t),f(n));return n}function p(t){const n=t.exec(e);if(!n)return;const r=n[0];return o(r),e=e.slice(r.length),n}function m(){p(/^\s*/)}function f(e){let t;for(e=e||[];t=h();)!1!==t&&e.push(t);return e}function h(){const t=a();if("/"!==e.charAt(0)||"*"!==e.charAt(1))return;let n=2;for(;""!==e.charAt(n)&&("*"!==e.charAt(n)||"/"!==e.charAt(n+1));)++n;if(n+=2,""===e.charAt(n-1))return l("End of comment missing");const i=e.slice(2,n-2);return r+=2,o(i),e=e.slice(n),r+=2,t({type:"comment",comment:i})}function g(){const e=p(/^([^{]+)/);if(e)return YF(e[0]).replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g,"").replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g,(function(e){return e.replace(/,/g,"")})).split(/\s*(?![^(]*\)),\s*/).map((function(e){return e.replace(/\u200C/g,",")}))}function b(){const e=a();let t=p(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(!t)return;if(t=YF(t[0]),!p(/^:\s*/))return l("property missing ':'");const n=p(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),r=e({type:"declaration",property:t.replace(PF,""),value:n?YF(n[0]).replace(PF,""):""});return p(/^[;\s]*/),r}function v(){const e=[];if(!c())return l("missing '{'");let t;for(f(e);t=b();)!1!==t&&(e.push(t),f(e));return u()?e:l("missing '}'")}function y(){let e;const t=[],n=a();for(;e=p(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)t.push(e[1]),p(/^,\s*/);if(t.length)return n({type:"keyframe",values:t,declarations:v()})}const _=w("import"),M=w("charset"),k=w("namespace");function w(e){const t=new RegExp("^@"+e+"\\s*([^;]+);");return function(){const n=a(),r=p(t);if(!r)return;const o={type:e};return o[e]=r[1].trim(),n(o)}}function E(){if("@"===e[0])return function(){const e=a();let t=p(/^@([-\w]+)?keyframes\s*/);if(!t)return;const n=t[1];if(t=p(/^([-\w]+)\s*/),!t)return l("@keyframes missing name");const r=t[1];if(!c())return l("@keyframes missing '{'");let o,i=f();for(;o=y();)i.push(o),i=i.concat(f());return u()?e({type:"keyframes",name:r,vendor:n,keyframes:i}):l("@keyframes missing '}'")}()||function(){const e=a(),t=p(/^@media *([^{]+)/);if(!t)return;const n=YF(t[1]);if(!c())return l("@media missing '{'");const r=f().concat(d());return u()?e({type:"media",media:n,rules:r}):l("@media missing '}'")}()||function(){const e=a(),t=p(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(t)return e({type:"custom-media",name:YF(t[1]),media:YF(t[2])})}()||function(){const e=a(),t=p(/^@supports *([^{]+)/);if(!t)return;const n=YF(t[1]);if(!c())return l("@supports missing '{'");const r=f().concat(d());return u()?e({type:"supports",supports:n,rules:r}):l("@supports missing '}'")}()||_()||M()||k()||function(){const e=a(),t=p(/^@([-\w]+)?document *([^{]+)/);if(!t)return;const n=YF(t[1]),r=YF(t[2]);if(!c())return l("@document missing '{'");const o=f().concat(d());return u()?e({type:"document",document:r,vendor:n,rules:o}):l("@document missing '}'")}()||function(){const e=a();if(!p(/^@page */))return;const t=g()||[];if(!c())return l("@page missing '{'");let n,r=f();for(;n=b();)r.push(n),r=r.concat(f());return u()?e({type:"page",selectors:t,declarations:r}):l("@page missing '}'")}()||function(){const e=a();if(!p(/^@host\s*/))return;if(!c())return l("@host missing '{'");const t=f().concat(d());return u()?e({type:"host",rules:t}):l("@host missing '}'")}()||function(){const e=a();if(!p(/^@font-face\s*/))return;if(!c())return l("@font-face missing '{'");let t,n=f();for(;t=b();)n.push(t),n=n.concat(f());return u()?e({type:"font-face",declarations:n}):l("@font-face missing '}'")}()}function L(){const e=a(),t=g();return t?(f(),e({type:"rule",selectors:t,declarations:v()})):l("selector missing")}return WF(function(){const e=d();return{type:"stylesheet",stylesheet:{source:t.source,rules:e,parsingErrors:s}}}())}function YF(e){return e?e.replace(/^\s+|\s+$/g,""):""}function WF(e,t){const n=e&&"string"==typeof e.type,r=n?e:t;for(const t in e){const n=e[t];Array.isArray(n)?n.forEach((function(e){WF(e,r)})):n&&"object"==typeof n&&WF(n,r)}return n&&Object.defineProperty(e,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),e}var HF=n(5717),qF=n.n(HF);const jF=FF;function FF(e){this.options=e||{}}FF.prototype.emit=function(e){return e},FF.prototype.visit=function(e){return this[e.type](e)},FF.prototype.mapVisit=function(e,t){let n="";t=t||"";for(let r=0,o=e.length;rt=>{if("declaration"===t.type){const a=function(e){const t=/url\((\s*)(['"]?)(.+?)\2(\s*)\)/g;let n;const r=[];for(;null!==(n=t.exec(e));){const e={source:n[0],before:n[1],quote:n[2],value:n[3],after:n[4]};GF(e)&&r.push(e)}return r}(t.value).map((o=e,e=>({...e,newUrl:"url("+e.before+e.quote+JF(e.value,o)+e.quote+e.after+")"})));return{...t,value:(n=t.value,r=a,r.forEach((e=>{n=n.replace(e.source,e.newUrl)})),n)}}var n,r,o;return t},ZF=/^(body|html|:root).*$/,eV=(e,t=[])=>n=>{const r=n=>t.includes(n.trim())?n:n.match(ZF)?n.replace(/^(body|html|:root)/,e):e+" "+n;return"rule"===n.type?{...n,selectors:n.selectors.map(r)}:n},tV=(e,t="")=>(0,at.map)(e,(({css:e,baseURL:n,__experimentalNoWrapper:r=!1})=>{const o=[];return t&&!r&&o.push(eV(t)),n&&o.push(QF(n)),o.length?KF(e,lS(o)):e})),nV={insertUsage:{},isPublishSidebarEnabled:!0},rV={...ib,richEditingEnabled:!0,codeEditingEnabled:!0,enableCustomFields:!1,supportsLayout:!0};function oV(e){return e&&"object"==typeof e&&"raw"in e?e.raw:e}const aV=st()({postId:function(e=null,t){switch(t.type){case"SETUP_EDITOR_STATE":case"RESET_POST":return t.post.id}return e},postType:function(e=null,t){switch(t.type){case"SETUP_EDITOR_STATE":case"RESET_POST":return t.post.type}return e},preferences:function(e=nV,t){switch(t.type){case"ENABLE_PUBLISH_SIDEBAR":return{...e,isPublishSidebarEnabled:!0};case"DISABLE_PUBLISH_SIDEBAR":return{...e,isPublishSidebarEnabled:!1}}return e},saving:function(e={},t){switch(t.type){case"REQUEST_POST_UPDATE_START":case"REQUEST_POST_UPDATE_FINISH":return{pending:"REQUEST_POST_UPDATE_START"===t.type,options:t.options||{}}}return e},postLock:function(e={isLocked:!1},t){switch(t.type){case"UPDATE_POST_LOCK":return t.lock}return e},template:function(e={isValid:!0},t){switch(t.type){case"SET_TEMPLATE_VALIDITY":return{...e,isValid:t.isValid}}return e},postSavingLock:function(e={},t){switch(t.type){case"LOCK_POST_SAVING":return{...e,[t.lockName]:!0};case"UNLOCK_POST_SAVING":return(0,at.omit)(e,t.lockName)}return e},isReady:function(e=!1,t){switch(t.type){case"SETUP_EDITOR_STATE":return!0;case"TEAR_DOWN_EDITOR":return!1}return e},editorSettings:function(e=rV,t){switch(t.type){case"UPDATE_EDITOR_SETTINGS":return{...e,...t.settings}}return e},postAutosavingLock:function(e={},t){switch(t.type){case"LOCK_POST_AUTOSAVING":return{...e,[t.lockName]:!0};case"UNLOCK_POST_AUTOSAVING":return(0,at.omit)(e,t.lockName)}return e}});var iV=n(381),sV=n.n(iV);n(5177),n(5341);const lV="WP",cV=/^[+-][0-1][0-9](:?[0-9][0-9])?$/;let uV={l10n:{locale:"en",months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],weekdays:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],weekdaysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],meridiem:{am:"am",pm:"pm",AM:"AM",PM:"PM"},relative:{future:"%s from now",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"}},formats:{time:"g: i a",date:"F j, Y",datetime:"F j, Y g: i a",datetimeAbbreviated:"M j, Y g: i a"},timezone:{offset:"0",string:"",abbr:""}};function dV(){return uV}function pV(){sV().tz.add(sV().tz.pack({name:lV,abbrs:[lV],untils:[null],offsets:[60*-uV.timezone.offset||0]}))}const mV={d:"DD",D:"ddd",j:"D",l:"dddd",N:"E",S(e){const t=e.format("D");return e.format("Do").replace(t,"")},w:"d",z:e=>(parseInt(e.format("DDD"),10)-1).toString(),W:"W",F:"MMMM",m:"MM",M:"MMM",n:"M",t:e=>e.daysInMonth(),L:e=>e.isLeapYear()?"1":"0",o:"GGGG",Y:"YYYY",y:"YY",a:"a",A:"A",B(e){const t=sV()(e).utcOffset(60),n=parseInt(t.format("s"),10),r=parseInt(t.format("m"),10),o=parseInt(t.format("H"),10);return parseInt(((n+60*r+3600*o)/86.4).toString(),10)},g:"h",G:"H",h:"hh",H:"HH",i:"mm",s:"ss",u:"SSSSSS",v:"SSS",e:"zz",I:e=>e.isDST()?"1":"0",O:"ZZ",P:"Z",T:"z",Z(e){const t=e.format("Z"),n="-"===t[0]?-1:1,r=t.substring(1).split(":").map((e=>parseInt(e,10)));return n*(60*r[0]+r[1])*60},c:"YYYY-MM-DDTHH:mm:ssZ",r:"ddd, D MMM YYYY HH:mm:ss ZZ",U:"X"};function fV(e,t=new Date){let n,r;const o=[],a=sV()(t);for(n=0;n()=>e(yd).hasUndo())),OV=At((e=>()=>e(yd).hasRedo()));function NV(e){return"auto-draft"===RV(e).status}function DV(e){const t=jV(e);return"blocks"in t||"content"in t}const BV=At((e=>t=>{const n=YV(t),r=WV(t);return!!e(yd).hasEditsForEntityRecord("postType",n,r)})),IV=At((e=>t=>{const n=e(yd).__experimentalGetDirtyEntityRecords(),{type:r,id:o}=RV(t);return(0,at.some)(n,(e=>"postType"!==e.kind||e.name!==r||e.key!==o))}));function PV(e){return!BV(e)&&NV(e)}const RV=At((e=>t=>{const n=WV(t),r=YV(t),o=e(yd).getRawEntityRecord("postType",r,n);return o||TV}));function YV(e){return e.postType}function WV(e){return e.postId}function HV(e){return(0,at.get)(RV(e),["_links","version-history",0,"count"],0)}function qV(e){return(0,at.get)(RV(e),["_links","predecessor-version",0,"id"],null)}const jV=At((e=>t=>{const n=YV(t),r=WV(t);return e(yd).getEntityRecordEdits("postType",n,r)||TV})),FV=At((e=>()=>(qp("`wp.data.select( 'core/editor' ).getReferenceByDistinctEdits`",{since:"5.4",alternative:"`wp.data.select( 'core' ).getReferenceByDistinctEdits`"}),e(yd).getReferenceByDistinctEdits())));function VV(e,t){switch(t){case"type":return YV(e);case"id":return WV(e);default:const n=RV(e);if(!n.hasOwnProperty(t))break;return oV(n[t])}}function XV(e,t){switch(t){case"content":return hX(e)}const n=jV(e);return n.hasOwnProperty(t)?_V.has(t)?((e,t)=>{const n=jV(e);return n.hasOwnProperty(t)?{...VV(e,t),...n[t]}:VV(e,t)})(e,t):n[t]:VV(e,t)}const UV=At((e=>(t,n)=>{if(!(0,at.includes)(LV,n)&&"preview_link"!==n)return;const r=YV(t),o=WV(t),a=(0,at.get)(e(yd).getCurrentUser(),["id"]),i=e(yd).getAutosave(r,o,a);return i?oV(i[n]):void 0}));function $V(e){if("private"===XV(e,"status"))return"private";return XV(e,"password")?"password":"public"}function KV(e){return"pending"===RV(e).status}function GV(e,t){const n=t||RV(e);return-1!==["publish","private"].indexOf(n.status)||"future"===n.status&&!gV(new Date(Number(bV(n.date))-6e4))}function JV(e){return"future"===RV(e).status&&!GV(e)}function QV(e){const t=RV(e);return BV(e)||-1===["publish","private","future"].indexOf(t.status)}function ZV(e){return!iX(e)&&(!!XV(e,"title")||!!XV(e,"excerpt")||!eX(e)||"native"===_b.OS)}function eX(e){const t=TX(e);if(t.length){if(t.length>1)return!1;const e=t[0].name;if(e!==Do()&&e!==Oo())return!1}return!hX(e)}const tX=At((e=>t=>{if(!ZV(t))return!1;if(wX(t))return!1;const n=YV(t),r=WV(t),o=e(yd).hasFetchedAutosaves(n,r),a=(0,at.get)(e(yd).getCurrentUser(),["id"]),i=e(yd).getAutosave(n,r,a);return!!o&&(!i||(!!DV(t)||["title","excerpt"].some((e=>oV(i[e])!==XV(t,e)))))})),nX=At((e=>t=>{qp("`wp.data.select( 'core/editor' ).getAutosave()`",{since:"5.3",alternative:"`wp.data.select( 'core' ).getAutosave( postType, postId, userId )`"});const n=YV(t),r=WV(t),o=(0,at.get)(e(yd).getCurrentUser(),["id"]),a=e(yd).getAutosave(n,r,o);return(0,at.mapValues)((0,at.pick)(a,LV),oV)})),rX=At((e=>t=>{qp("`wp.data.select( 'core/editor' ).hasAutosave()`",{since:"5.3",alternative:"`!! wp.data.select( 'core' ).getAutosave( postType, postId, userId )`"});const n=YV(t),r=WV(t),o=(0,at.get)(e(yd).getCurrentUser(),["id"]);return!!e(yd).getAutosave(n,r,o)}));function oX(e){const t=XV(e,"date");return gV(new Date(Number(bV(t))-6e4))}function aX(e){const t=XV(e,"date"),n=XV(e,"modified"),r=RV(e).status;return("draft"===r||"auto-draft"===r||"pending"===r)&&(t===n||null===t)}const iX=At((e=>t=>{const n=YV(t),r=WV(t);return e(yd).isSavingEntityRecord("postType",n,r)})),sX=At((e=>t=>{const n=e(yd).__experimentalGetEntitiesBeingSaved(),{type:r,id:o}=RV(t);return(0,at.some)(n,(e=>"postType"!==e.kind||e.name!==r||e.key!==o))})),lX=At((e=>t=>{const n=YV(t),r=WV(t);return!e(yd).getLastEntitySaveError("postType",n,r)})),cX=At((e=>t=>{const n=YV(t),r=WV(t);return!!e(yd).getLastEntitySaveError("postType",n,r)}));function uX(e){return!!iX(e)&&!!(0,at.get)(e.saving,["options","isAutosave"])}function dX(e){return!!iX(e)&&!!e.saving.options.isPreview}function pX(e){if(e.saving.pending||iX(e))return;let t=UV(e,"preview_link");t||(t=XV(e,"link"),t&&(t=Pl(t,{preview:!0})));const n=XV(e,"featured_media");return t&&n?Pl(t,{_thumbnail_id:n}):t}function mX(e){const t=TX(e);if(t.length>2)return null;let n;if(1===t.length&&(n=t[0].name,"core/embed"===n)){var r;const e=null===(r=t[0].attributes)||void 0===r?void 0:r.providerNameSlug;["youtube","vimeo"].includes(e)?n="core/video":["spotify","soundcloud"].includes(e)&&(n="core/audio")}switch(2===t.length&&"core/paragraph"===t[1].name&&(n=t[0].name),n){case"core/image":return"image";case"core/quote":case"core/pullquote":return"quote";case"core/gallery":return"gallery";case"core/video":return"video";case"core/audio":return"audio";default:return null}}function fX(e){qp("`core/editor` getBlocksForSerialization selector",{since:"5.3",alternative:"getEditorBlocks",hint:"Blocks serialization pre-processing occurs at save time"});const t=e.editor.present.blocks.value;return 1===t.length&&vo(t[0])?[]:t}const hX=At((e=>t=>{const n=WV(t),r=YV(t),o=e(yd).getEditedEntityRecord("postType",r,n);if(o){if("function"==typeof o.content)return o.content(o);if(o.blocks)return hi(o.blocks);if(o.content)return o.content}return""}));function gX(e){return iX(e)&&!GV(e)&&"publish"===XV(e,"status")}function bX(e){const t=XV(e,"permalink_template");return EV.test(t)}function vX(e){const t=_X(e);if(!t)return null;const{prefix:n,postName:r,suffix:o}=t;return bX(e)?n+r+o:n}function yX(e){return XV(e,"slug")||function(e){return e?(0,at.trim)((0,at.deburr)(e).replace(/[\s\./]+/g,"-").replace(/[^\p{L}\p{N}_-]+/gu,"").toLowerCase(),"-"):""}(XV(e,"title"))||WV(e)}function _X(e){const t=XV(e,"permalink_template");if(!t)return null;const n=XV(e,"slug")||XV(e,"generated_slug"),[r,o]=t.split(EV);return{prefix:r,postName:n,suffix:o}}function MX(e){return e.postLock.isLocked}function kX(e){return Object.keys(e.postSavingLock).length>0}function wX(e){return Object.keys(e.postAutosavingLock).length>0}function EX(e){return e.postLock.isTakeover}function LX(e){return e.postLock.user}function AX(e){return e.postLock.activePostLock}function SX(e){return(0,at.has)(RV(e),["_links","wp:action-unfiltered-html"])}function CX(e){return e.preferences.hasOwnProperty("isPublishSidebarEnabled")?e.preferences.isPublishSidebarEnabled:nV.isPublishSidebarEnabled}function TX(e){return XV(e,"blocks")||xV}function xX(e){var t;return qp("select('core/editor').getEditorSelectionStart",{since:"10.0",plugin:"Gutenberg",alternative:"select('core/editor').getEditorSelection"}),null===(t=XV(e,"selection"))||void 0===t?void 0:t.selectionStart}function zX(e){var t;return qp("select('core/editor').getEditorSelectionStart",{since:"10.0",plugin:"Gutenberg",alternative:"select('core/editor').getEditorSelection"}),null===(t=XV(e,"selection"))||void 0===t?void 0:t.selectionEnd}function OX(e){return XV(e,"selection")}function NX(e){return e.isReady}function DX(e){return e.editorSettings}function BX(){return qp("select('core/editor').getStateBeforeOptimisticTransaction",{since:"5.7",hint:"No state history is kept on this store anymore"}),null}function IX(){return qp("select('core/editor').inSomeHistory",{since:"5.7",hint:"No state history is kept on this store anymore"}),!1}function PX(e){return At((t=>(n,...r)=>(qp("`wp.data.select( 'core/editor' )."+e+"`",{since:"5.3",alternative:"`wp.data.select( 'core/block-editor' )."+e+"`"}),t(nk)[e](...r))))}const RX=PX("getBlockName"),YX=PX("isBlockValid"),WX=PX("getBlockAttributes"),HX=PX("getBlock"),qX=PX("getBlocks"),jX=PX("__unstableGetBlockWithoutInnerBlocks"),FX=PX("getClientIdsOfDescendants"),VX=PX("getClientIdsWithDescendants"),XX=PX("getGlobalBlockCount"),UX=PX("getBlocksByClientId"),$X=PX("getBlockCount"),KX=PX("getBlockSelectionStart"),GX=PX("getBlockSelectionEnd"),JX=PX("getSelectedBlockCount"),QX=PX("hasSelectedBlock"),ZX=PX("getSelectedBlockClientId"),eU=PX("getSelectedBlock"),tU=PX("getBlockRootClientId"),nU=PX("getBlockHierarchyRootClientId"),rU=PX("getAdjacentBlockClientId"),oU=PX("getPreviousBlockClientId"),aU=PX("getNextBlockClientId"),iU=PX("getSelectedBlocksInitialCaretPosition"),sU=PX("getMultiSelectedBlockClientIds"),lU=PX("getMultiSelectedBlocks"),cU=PX("getFirstMultiSelectedBlockClientId"),uU=PX("getLastMultiSelectedBlockClientId"),dU=PX("isFirstMultiSelectedBlock"),pU=PX("isBlockMultiSelected"),mU=PX("isAncestorMultiSelected"),fU=PX("getMultiSelectedBlocksStartClientId"),hU=PX("getMultiSelectedBlocksEndClientId"),gU=PX("getBlockOrder"),bU=PX("getBlockIndex"),vU=PX("isBlockSelected"),yU=PX("hasSelectedInnerBlock"),_U=PX("isBlockWithinSelection"),MU=PX("hasMultiSelection"),kU=PX("isMultiSelecting"),wU=PX("isSelectionEnabled"),EU=PX("getBlockMode"),LU=PX("isTyping"),AU=PX("isCaretWithinFormattedText"),SU=PX("getBlockInsertionPoint"),CU=PX("isBlockInsertionPointVisible"),TU=PX("isValidTemplate"),xU=PX("getTemplate"),zU=PX("getTemplateLock"),OU=PX("canInsertBlockType"),NU=PX("getInserterItems"),DU=PX("hasInserterItems"),BU=PX("getBlockListSettings");function IU(e){var t;return null===(t=DX(e))||void 0===t?void 0:t.defaultTemplateTypes}const PU=gr((e=>{var t;const n=(null===(t=DX(e))||void 0===t?void 0:t.defaultTemplatePartAreas)||[];return null==n?void 0:n.map((e=>{return{...e,icon:(t=e.icon,"header"===t?AV:"footer"===t?SV:"sidebar"===t?CV:yH)};var t}))}),(e=>{var t;return[null===(t=DX(e))||void 0===t?void 0:t.defaultTemplatePartAreas]})),RU=gr(((e,t)=>(0,at.find)(IU(e),{slug:t})||{}),((e,t)=>[IU(e),t]));function YU(e,t){var n;if(!t)return{};const{excerpt:r,slug:o,title:a,area:i}=t,{title:s,description:l}=RU(e,o),c=(0,at.isString)(a)?a:null==a?void 0:a.rendered;return{title:c&&c!==o?c:s||o,description:((0,at.isString)(r)?r:null==r?void 0:r.raw)||l,icon:(null===(n=PU(e).find((e=>i===e.area)))||void 0===n?void 0:n.icon)||yH}}const WU=At((e=>t=>{var n;const r=YV(t),o=e(yd).getPostType(r);return null==o||null===(n=o.labels)||void 0===n?void 0:n.singular_name}));function*HU(e,t,n){let r;r=(0,at.has)(t,["content"])?t.content:e.content.raw;let o=ns(r);"auto-draft"===e.status&&n&&(o=ml(o,n)),yield jU(e),yield{type:"SETUP_EDITOR",post:e,edits:t,template:n},yield u$(o,{__unstableShouldCreateUndoLevel:!1}),yield $U(e),t&&Object.keys(t).some((n=>t[n]!==((0,at.has)(e,[n,"raw"])?e[n].raw:e[n])))&&(yield KU(t))}function qU(){return{type:"TEAR_DOWN_EDITOR"}}function jU(e){return{type:"RESET_POST",post:e}}function*FU(e){qp("resetAutosave action (`core/editor` store)",{since:"5.3",alternative:"receiveAutosaves action (`core` store)"});const t=yield zt.select(MV,"getCurrentPostId");return yield zt.dispatch(yd.name,"receiveAutosaves",t,e),{type:"__INERT__"}}function VU(e={}){return{type:"REQUEST_POST_UPDATE_START",options:e}}function XU(e={}){return{type:"REQUEST_POST_UPDATE_FINISH",options:e}}function UU(){return qp("wp.data.dispatch( 'core/editor' ).updatePost",{since:"5.7",alternative:"Use the core entities store instead"}),{type:"DO_NOTHING"}}function $U(e){return{type:"SETUP_EDITOR_STATE",post:e}}function*KU(e,t){const{id:n,type:r}=yield zt.select(MV,"getCurrentPost");yield zt.dispatch(yd.name,"editEntityRecord","postType",r,n,e,t)}function*GU(e={}){if(!(yield zt.select(MV,"isEditedPostSaveable")))return;let t={content:yield zt.select(MV,"getEditedPostContent")};e.isAutosave||(yield zt.dispatch(MV,"editPost",t,{undoIgnore:!0})),yield VU(e);const n=yield zt.select(MV,"getCurrentPost");t={id:n.id,...yield zt.select(yd.name,"getEntityRecordNonTransientEdits","postType",n.type,n.id),...t},yield zt.dispatch(yd.name,"saveEntityRecord","postType",n.type,t,e),yield XU(e);const r=yield zt.select(yd.name,"getLastEntitySaveError","postType",n.type,n.id);if(r){const e=function(e){const{post:t,edits:n,error:r}=e;if(r&&"rest_autosave_no_changes"===r.code)return[];const o=["publish","private","future"],a=-1!==o.indexOf(t.status),i={publish:er("Publishing failed."),private:er("Publishing failed."),future:er("Scheduling failed.")};let s=a||-1===o.indexOf(n.status)?er("Updating failed."):i[n.status];return r.message&&!/<\/?[^>]*>/.test(r.message)&&(s=[s,r.message].join(" ")),[s,{id:kV}]}({post:n,edits:t,error:r});e.length&&(yield zt.dispatch(UI,"createErrorNotice",...e))}else{const t=yield zt.select(MV,"getCurrentPost"),r=function(e){const{previousPost:t,post:n,postType:r}=e;if((0,at.get)(e.options,["isAutosave"]))return[];const o=["publish","private","future"],a=(0,at.includes)(o,t.status),i=(0,at.includes)(o,n.status);let s,l=(0,at.get)(r,["viewable"],!1);if(a||i?a&&!i?(s=r.labels.item_reverted_to_draft,l=!1):s=!a&&i?{publish:r.labels.item_published,private:r.labels.item_published_privately,future:r.labels.item_scheduled}[n.status]:r.labels.item_updated:s=null,s){const e=[];return l&&e.push({label:r.labels.view_item,url:n.link}),[s,{id:kV,type:"snackbar",actions:e}]}return[]}({previousPost:n,post:t,postType:yield zt.resolveSelect(yd.name,"getPostType",t.type),options:e});r.length&&(yield zt.dispatch(UI,"createSuccessNotice",...r)),e.isAutosave||(yield zt.dispatch(nk.name,"__unstableMarkLastChangeAsPersistent"))}}function*JU(){const e=yield zt.select(MV,"getCurrentPost"),t=yield zt.select(MV,"getCurrentPostType"),n=yield zt.resolveSelect(yd.name,"getPostType",t),r=yield tc({path:`/wp/v2/${n.rest_base}/${e.id}?context=edit&_timestamp=${Date.now()}`});yield zt.dispatch(MV,"resetPost",r)}function*QU(){const e=yield zt.select(MV,"getCurrentPostType"),t=yield zt.resolveSelect(yd.name,"getPostType",e);yield zt.dispatch(UI,"removeNotice",wV);try{const e=yield zt.select(MV,"getCurrentPost");yield tc({path:`/wp/v2/${t.rest_base}/${e.id}`,method:"DELETE"}),yield zt.dispatch(MV,"savePost")}catch(e){yield zt.dispatch(UI,"createErrorNotice",...(n={error:e},[n.error.message&&"unknown_error"!==n.error.code?n.error.message:er("Trashing failed"),{id:wV}]))}var n}function*ZU({local:e=!1,...t}={}){if(e){const e=yield zt.select(MV,"getCurrentPost"),t=yield zt.select(MV,"isEditedPostNew"),n=yield zt.select(MV,"getEditedPostAttribute","title"),r=yield zt.select(MV,"getEditedPostAttribute","content"),o=yield zt.select(MV,"getEditedPostAttribute","excerpt");yield{type:"LOCAL_AUTOSAVE_SET",postId:e.id,isPostNew:t,title:n,content:r,excerpt:o}}else yield zt.dispatch(MV,"savePost",{isAutosave:!0,...t})}function*e$(){yield zt.dispatch(yd.name,"redo")}function*t$(){yield zt.dispatch(yd.name,"undo")}function n$(){return{type:"CREATE_UNDO_LEVEL"}}function r$(e){return{type:"UPDATE_POST_LOCK",lock:e}}function o$(){return{type:"ENABLE_PUBLISH_SIDEBAR"}}function a$(){return{type:"DISABLE_PUBLISH_SIDEBAR"}}function i$(e){return{type:"LOCK_POST_SAVING",lockName:e}}function s$(e){return{type:"UNLOCK_POST_SAVING",lockName:e}}function l$(e){return{type:"LOCK_POST_AUTOSAVING",lockName:e}}function c$(e){return{type:"UNLOCK_POST_AUTOSAVING",lockName:e}}function*u$(e,t={}){const{__unstableShouldCreateUndoLevel:n,selection:r}=t,o={blocks:e,selection:r};if(!1!==n){const{id:e,type:t}=yield zt.select(MV,"getCurrentPost");if((yield zt.select(yd.name,"getEditedEntityRecord","postType",t,e)).blocks===o.blocks)return yield zt.dispatch(yd.name,"__unstableCreateUndoLevel","postType",t,e);o.content=({blocks:e=[]})=>hi(e)}yield*KU(o)}function d$(e){return{type:"UPDATE_EDITOR_SETTINGS",settings:e}}const p$=e=>function*(...t){qp("`wp.data.dispatch( 'core/editor' )."+e+"`",{since:"5.3",alternative:"`wp.data.dispatch( 'core/block-editor' )."+e+"`"}),yield zt.dispatch(nk.name,e,...t)},m$=p$("resetBlocks"),f$=p$("receiveBlocks"),h$=p$("updateBlock"),g$=p$("updateBlockAttributes"),b$=p$("selectBlock"),v$=p$("startMultiSelect"),y$=p$("stopMultiSelect"),_$=p$("multiSelect"),M$=p$("clearSelectedBlock"),k$=p$("toggleSelection"),w$=p$("replaceBlocks"),E$=p$("replaceBlock"),L$=p$("moveBlocksDown"),A$=p$("moveBlocksUp"),S$=p$("moveBlockToPosition"),C$=p$("insertBlock"),T$=p$("insertBlocks"),x$=p$("showInsertionPoint"),z$=p$("hideInsertionPoint"),O$=p$("setTemplateValidity"),N$=p$("synchronizeTemplate"),D$=p$("mergeBlocks"),B$=p$("removeBlocks"),I$=p$("removeBlock"),P$=p$("toggleBlockMode"),R$=p$("startTyping"),Y$=p$("stopTyping"),W$=p$("enterFormattedText"),H$=p$("exitFormattedText"),q$=p$("insertDefaultBlock"),j$=p$("updateBlockListSettings");function F$(e,t){return`wp-autosave-block-editor-post-${t?"auto-draft":e}`}const V$={LOCAL_AUTOSAVE_SET({postId:e,isPostNew:t,title:n,content:r,excerpt:o}){!function(e,t,n,r,o){window.sessionStorage.setItem(F$(e,t),JSON.stringify({post_title:n,content:r,excerpt:o}))}(e,t,n,r,o)}},X$={reducer:aV,selectors:M,actions:k,controls:{...rc,...V$}},U$=Jt(MV,{...X$,persist:["preferences"]});rn(MV,{...X$,persist:["preferences"]});function $$(e){const t=(0,at.mapValues)((0,at.pickBy)(e.attributes,{source:"meta"}),"meta");return(0,at.isEmpty)(t)||(e.edit=(e=>ri((t=>({attributes:n,setAttributes:r,...o})=>{const a=Tl((e=>e(U$).getCurrentPostType()),[]),[i,s]=md("postType",a,"meta"),l=(0,tt.useMemo)((()=>({...n,...(0,at.mapValues)(e,(e=>i[e]))})),[n,i]);return(0,tt.createElement)(t,ot({attributes:l,setAttributes:t=>{const n=(0,at.mapKeys)((0,at.pickBy)(t,((t,n)=>e[n])),((t,n)=>e[n]));(0,at.isEmpty)(n)||s(n),r(t)}},o))}),"withMetaAttributeSource"))(t)(e.edit)),e}function K$(e){const t=e.avatar_urls&&e.avatar_urls[24]?(0,tt.createElement)("img",{className:"editor-autocompleters__user-avatar",alt:"",src:e.avatar_urls[24]}):(0,tt.createElement)("span",{className:"editor-autocompleters__no-avatar"});return(0,tt.createElement)(tt.Fragment,null,t,(0,tt.createElement)("span",{className:"editor-autocompleters__user-name"},e.name),(0,tt.createElement)("span",{className:"editor-autocompleters__user-slug"},e.slug))}In("blocks.registerBlockType","core/editor/custom-sources-backwards-compatibility/shim-attribute-source",$$),tn(Gr).getBlockTypes().map((({name:e})=>tn(Gr).getBlockType(e))).forEach($$);const G$={name:"users",className:"editor-autocompleters__user",triggerPrefix:"@",useItems(e){const t=Tl((t=>{const{getUsers:n}=t(yd);return n({context:"view",search:encodeURIComponent(e)})}),[e]);return[(0,tt.useMemo)((()=>t?t.map((e=>({key:`user-${e.slug}`,value:e,label:K$(e)}))):[]),[t])]},getOptionCompletion:e=>`@${e.slug}`};In("editor.Autocomplete.completers","editor/autocompleters/set-default-completers",(function(e=[]){return e.push((0,at.clone)(G$)),e}));const J$=function({notices:e,onRemove:t=at.noop,className:n,children:r}){return n=so()("components-notice-list",n),(0,tt.createElement)("div",{className:n},r,[...e].reverse().map((e=>{return(0,tt.createElement)(RT,ot({},(0,at.omit)(e,["content"]),{key:e.id,onRemove:(n=e.id,()=>t(n))}),e.content);var n})))};const Q$=lS([QI((e=>({isValid:e(nk).isValidTemplate()}))),eP((e=>{const{setTemplateValidity:t,synchronizeTemplate:n}=e(nk);return{resetTemplateValidity:()=>t(!0),synchronizeTemplate:n}}))])((function({isValid:e,...t}){return e?null:(0,tt.createElement)(RT,{className:"editor-template-validation-notice",isDismissible:!1,status:"warning",actions:[{label:er("Keep it as is"),onClick:t.resetTemplateValidity},{label:er("Reset the template"),onClick:()=>{window.confirm(er("Resetting the template may result in loss of content, do you want to continue?"))&&t.synchronizeTemplate()}}]},er("The content of your post doesn’t match the template assigned to your post type."))}));const Z$=lS([QI((e=>({notices:e(UI).getNotices()}))),eP((e=>({onRemove:e(UI).removeNotice})))])((function({notices:e,onRemove:t}){const n=(0,at.filter)(e,{isDismissible:!0,type:"default"}),r=(0,at.filter)(e,{isDismissible:!1,type:"default"});return(0,tt.createElement)(tt.Fragment,null,(0,tt.createElement)(J$,{notices:r,className:"components-editor-notices__pinned"}),(0,tt.createElement)(J$,{notices:n,className:"components-editor-notices__dismissible",onRemove:t},(0,tt.createElement)(Q$,null)))}));function eK({text:e,children:t}){const n=zI(e);return(0,tt.createElement)(Eh,{variant:"secondary",ref:n},t)}class tK extends tt.Component{constructor(){super(...arguments),this.reboot=this.reboot.bind(this),this.getContent=this.getContent.bind(this),this.state={error:null}}componentDidCatch(e){this.setState({error:e})}reboot(){this.props.onError()}getContent(){try{return tn(U$).getEditedPostContent()}catch(e){}}render(){const{error:e}=this.state;return e?(0,tt.createElement)(cR,{className:"editor-error-boundary",actions:[(0,tt.createElement)(Eh,{key:"recovery",onClick:this.reboot,variant:"secondary"},er("Attempt Recovery")),(0,tt.createElement)(eK,{key:"copy-post",text:this.getContent},er("Copy Post Text")),(0,tt.createElement)(eK,{key:"copy-error",text:e.stack},er("Copy Error"))]},er("The editor has encountered an unexpected error.")):this.props.children}}const nK=tK,rK=(0,tt.createElement)(mo,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,tt.createElement)(uo,{d:"M12 3.2c-4.8 0-8.8 3.9-8.8 8.8 0 4.8 3.9 8.8 8.8 8.8 4.8 0 8.8-3.9 8.8-8.8 0-4.8-4-8.8-8.8-8.8zm0 16c-4 0-7.2-3.3-7.2-7.2C4.8 8 8 4.8 12 4.8s7.2 3.3 7.2 7.2c0 4-3.2 7.2-7.2 7.2zM11 17h2v-6h-2v6zm0-8h2V7h-2v2z"}));function oK(){const e=Tl((e=>e(U$).getEditedPostAttribute("content"))),t=tr("words","Word count type. Do not translate!");return(0,tt.createElement)("span",{className:"word-count"},tF(e,t))}const aK=({children:e,isValid:t,level:n,href:r,onSelect:o})=>(0,tt.createElement)("li",{className:so()("document-outline__item",`is-${n.toLowerCase()}`,{"is-invalid":!t})},(0,tt.createElement)("a",{href:r,className:"document-outline__button",onClick:o},(0,tt.createElement)("span",{className:"document-outline__emdash","aria-hidden":"true"}),(0,tt.createElement)("strong",{className:"document-outline__level"},n),(0,tt.createElement)("span",{className:"document-outline__item-content"},e))),iK=(0,tt.createElement)("em",null,er("(Empty heading)")),sK=[(0,tt.createElement)("br",{key:"incorrect-break"}),(0,tt.createElement)("em",{key:"incorrect-message"},er("(Incorrect heading level)"))],lK=[(0,tt.createElement)("br",{key:"incorrect-break-h1"}),(0,tt.createElement)("em",{key:"incorrect-message-h1"},er("(Your theme may already use a H1 for the post title)"))],cK=[(0,tt.createElement)("br",{key:"incorrect-break-multiple-h1"}),(0,tt.createElement)("em",{key:"incorrect-message-multiple-h1"},er("(Multiple H1 headings are not recommended)"))],uK=(e=[])=>(0,at.flatMap)(e,((e={})=>"core/heading"===e.name?{...e,level:e.attributes.level,isEmpty:dK(e)}:uK(e.innerBlocks))),dK=e=>!e.attributes.content||0===e.attributes.content.length,pK=lS(QI((e=>{const{getBlocks:t}=e(nk),{getEditedPostAttribute:n}=e(U$),{getPostType:r}=e(yd),o=r(n("type"));return{title:n("title"),blocks:t(),isTitleSupported:(0,at.get)(o,["supports","title"],!1)}})))((({blocks:e=[],title:t,onSelect:n,isTitleSupported:r,hasOutlineItemsDisabled:o})=>{const a=uK(e);if(a.length<1)return null;let i=1;const s=document.querySelector(".editor-post-title__input"),l=r&&t&&s,c=(0,at.countBy)(a,"level")[1]>1;return(0,tt.createElement)("div",{className:"document-outline"},(0,tt.createElement)("ul",null,l&&(0,tt.createElement)(aK,{level:er("Title"),isValid:!0,onSelect:n,href:`#${s.id}`,isDisabled:o},t),a.map(((e,t)=>{const r=e.level>i+1,a=!(e.isEmpty||r||!e.level||1===e.level&&(c||l));return i=e.level,(0,tt.createElement)(aK,{key:t,level:`H${e.level}`,isValid:a,isDisabled:o,href:`#block-${e.clientId}`,onSelect:n},e.isEmpty?iK:Fy(Ny({html:e.attributes.content})),r&&sK,1===e.level&&c&&cK,l&&1===e.level&&!c&&lK)}))))}));function mK(){return tF(Tl((e=>e(U$).getEditedPostAttribute("content"))),"characters_including_spaces")}const fK=function({hasOutlineItemsDisabled:e,onRequestClose:t}){const{headingCount:n,paragraphCount:r,numberOfBlocks:o}=Tl((e=>{const{getGlobalBlockCount:t}=e(nk);return{headingCount:t("core/heading"),paragraphCount:t("core/paragraph"),numberOfBlocks:t()}}),[]);return(0,tt.createElement)(tt.Fragment,null,(0,tt.createElement)("div",{className:"table-of-contents__wrapper",role:"note","aria-label":er("Document Statistics"),tabIndex:"0"},(0,tt.createElement)("ul",{role:"list",className:"table-of-contents__counts"},(0,tt.createElement)("li",{className:"table-of-contents__count"},er("Characters"),(0,tt.createElement)("span",{className:"table-of-contents__number"},(0,tt.createElement)(mK,null))),(0,tt.createElement)("li",{className:"table-of-contents__count"},er("Words"),(0,tt.createElement)(oK,null)),(0,tt.createElement)("li",{className:"table-of-contents__count"},er("Headings"),(0,tt.createElement)("span",{className:"table-of-contents__number"},n)),(0,tt.createElement)("li",{className:"table-of-contents__count"},er("Paragraphs"),(0,tt.createElement)("span",{className:"table-of-contents__number"},r)),(0,tt.createElement)("li",{className:"table-of-contents__count"},er("Blocks"),(0,tt.createElement)("span",{className:"table-of-contents__number"},o)))),n>0&&(0,tt.createElement)(tt.Fragment,null,(0,tt.createElement)("hr",null),(0,tt.createElement)("h2",{className:"table-of-contents__title"},er("Document Outline")),(0,tt.createElement)(pK,{onSelect:t,hasOutlineItemsDisabled:e})))};const hK=(0,tt.forwardRef)((function({hasOutlineItemsDisabled:e,repositionDropdown:t,...n},r){const o=Tl((e=>!!e(nk).getBlockCount()),[]);return(0,tt.createElement)(Xg,{position:t?"middle right right":"bottom",className:"table-of-contents",contentClassName:"table-of-contents__popover",renderToggle:({isOpen:e,onToggle:t})=>(0,tt.createElement)(Eh,ot({},n,{ref:r,onClick:o?t:void 0,icon:rK,"aria-expanded":e,"aria-haspopup":"true",label:er("Details"),tooltipPosition:"bottom","aria-disabled":!o})),renderContent:({onClose:t})=>(0,tt.createElement)(fK,{onRequestClose:t,hasOutlineItemsDisabled:e})})})),{wp:gK}=window,bK=[],vK=()=>gK.media.view.MediaFrame.Select.extend({featuredImageToolbar(e){this.createSelectToolbar(e,{text:gK.media.view.l10n.setFeaturedImage,state:this.options.state})},editState(){const e=this.state("featured-image").get("selection"),t=new gK.media.view.EditImage({model:e.single(),controller:this}).render();this.content.set(t),t.loadEditor()},createStates:function(){this.on("toolbar:create:featured-image",this.featuredImageToolbar,this),this.on("content:render:edit-image",this.editState,this),this.states.add([new gK.media.controller.FeaturedImage,new gK.media.controller.EditImage({model:this.options.editImage})])}}),yK=()=>gK.media.view.MediaFrame.Post.extend({galleryToolbar(){const e=this.state().get("editing");this.toolbar.set(new gK.media.view.Toolbar({controller:this,items:{insert:{style:"primary",text:e?gK.media.view.l10n.updateGallery:gK.media.view.l10n.insertGallery,priority:80,requires:{library:!0},click(){const e=this.controller,t=e.state();e.close(),t.trigger("update",t.get("library")),e.setState(e.options.state),e.reset()}}}}))},editState(){const e=this.state("gallery").get("selection"),t=new gK.media.view.EditImage({model:e.single(),controller:this}).render();this.content.set(t),t.loadEditor()},createStates:function(){this.on("toolbar:create:main-gallery",this.galleryToolbar,this),this.on("content:render:edit-image",this.editState,this),this.states.add([new gK.media.controller.Library({id:"gallery",title:gK.media.view.l10n.createGalleryTitle,priority:40,toolbar:"main-gallery",filterable:"uploaded",multiple:"add",editable:!1,library:gK.media.query((0,at.defaults)({type:"image"},this.options.library))}),new gK.media.controller.EditImage({model:this.options.editImage}),new gK.media.controller.GalleryEdit({library:this.options.selection,editing:this.options.editing,menu:"gallery",displaySettings:!1,multiple:!0}),new gK.media.controller.GalleryAdd])}}),_K=e=>(0,at.pick)(e,["sizes","mime","type","subtype","id","url","alt","link","caption"]),MK=e=>gK.media.query({order:"ASC",orderby:"post__in",post__in:e,posts_per_page:-1,query:!0,type:"image"});class kK extends tt.Component{constructor({allowedTypes:e,gallery:t=!1,unstableFeaturedImageFlow:n=!1,modalClass:r,multiple:o=!1,title:a=er("Select or Upload Media")}){if(super(...arguments),this.openModal=this.openModal.bind(this),this.onOpen=this.onOpen.bind(this),this.onSelect=this.onSelect.bind(this),this.onUpdate=this.onUpdate.bind(this),this.onClose=this.onClose.bind(this),t)this.buildAndSetGalleryFrame();else{const t={title:a,multiple:o};e&&(t.library={type:e}),this.frame=gK.media(t)}r&&this.frame.$el.addClass(r),n&&this.buildAndSetFeatureImageFrame(),this.initializeListeners()}initializeListeners(){this.frame.on("select",this.onSelect),this.frame.on("update",this.onUpdate),this.frame.on("open",this.onOpen),this.frame.on("close",this.onClose)}buildAndSetGalleryFrame(){const{addToGallery:e=!1,allowedTypes:t,multiple:n=!1,value:r=bK}=this.props;if(r===this.lastGalleryValue)return;let o;this.lastGalleryValue=r,this.frame&&this.frame.remove(),o=e?"gallery-library":r&&r.length?"gallery-edit":"gallery",this.GalleryDetailsMediaFrame||(this.GalleryDetailsMediaFrame=yK());const a=MK(r),i=new gK.media.model.Selection(a.models,{props:a.props.toJSON(),multiple:n});this.frame=new this.GalleryDetailsMediaFrame({mimeType:t,state:o,multiple:n,selection:i,editing:!(!r||!r.length)}),gK.media.frame=this.frame,this.initializeListeners()}buildAndSetFeatureImageFrame(){const e=vK(),t=MK(this.props.value),n=new gK.media.model.Selection(t.models,{props:t.props.toJSON()});this.frame=new e({mimeType:this.props.allowedTypes,state:"featured-image",multiple:this.props.multiple,selection:n,editing:!!this.props.value}),gK.media.frame=this.frame}componentWillUnmount(){this.frame.remove()}onUpdate(e){const{onSelect:t,multiple:n=!1}=this.props,r=this.frame.state(),o=e||r.get("selection");o&&o.models.length&&t(n?o.models.map((e=>_K(e.toJSON()))):_K(o.models[0].toJSON()))}onSelect(){const{onSelect:e,multiple:t=!1}=this.props,n=this.frame.state().get("selection").toJSON();e(t?n:n[0])}onOpen(){var e;this.updateCollection();if(Array.isArray(this.props.value)?!(null===(e=this.props.value)||void 0===e||!e.length):!!this.props.value){if(!this.props.gallery){const e=this.frame.state().get("selection");(0,at.castArray)(this.props.value).forEach((t=>{e.add(gK.media.attachment(t))}))}MK((0,at.castArray)(this.props.value)).more()}}onClose(){const{onClose:e}=this.props;e&&e()}updateCollection(){const e=this.frame.content.get();if(e&&e.collection){const t=e.collection;t.toArray().forEach((e=>e.trigger("destroy",e))),t.mirroring._hasMore=!0,t.more()}}openModal(){this.props.gallery&&this.buildAndSetGalleryFrame(),this.frame.open()}render(){return this.props.render({open:this.openModal})}}const wK=kK;const EK=(0,tt.createElement)(mo,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,tt.createElement)(uo,{d:"M18.3 4H9.9v-.1l-.9.2c-2.3.4-4 2.4-4 4.8s1.7 4.4 4 4.8l.7.1V20h1.5V5.5h2.9V20h1.5V5.5h2.7V4z"})),LK={className:!1},AK={align:{type:"string"},content:{type:"string",source:"html",selector:"p",default:""},dropCap:{type:"boolean",default:!1},placeholder:{type:"string"},textColor:{type:"string"},backgroundColor:{type:"string"},fontSize:{type:"string"},direction:{type:"string",enum:["ltr","rtl"]},style:{type:"object"}},SK=e=>{if(!e.customTextColor&&!e.customBackgroundColor&&!e.customFontSize)return e;const t={};return(e.customTextColor||e.customBackgroundColor)&&(t.color={}),e.customTextColor&&(t.color.text=e.customTextColor),e.customBackgroundColor&&(t.color.background=e.customBackgroundColor),e.customFontSize&&(t.typography={fontSize:e.customFontSize}),{...(0,at.omit)(e,["customTextColor","customBackgroundColor","customFontSize"]),style:t}},CK=[{supports:LK,attributes:{...(0,at.omit)(AK,["style"]),customTextColor:{type:"string"},customBackgroundColor:{type:"string"},customFontSize:{type:"number"}},migrate:SK,save({attributes:e}){const{align:t,content:n,dropCap:r,backgroundColor:o,textColor:a,customBackgroundColor:i,customTextColor:s,fontSize:l,customFontSize:c,direction:u}=e,d=mC("color",a),p=mC("background-color",o),m=Xz(l),f=so()({"has-text-color":a||s,"has-background":o||i,"has-drop-cap":r,[`has-text-align-${t}`]:t,[m]:m,[d]:d,[p]:p}),h={backgroundColor:p?void 0:i,color:d?void 0:s,fontSize:m?void 0:c};return(0,tt.createElement)(Cj.Content,{tagName:"p",style:h,className:f||void 0,value:n,dir:u})}},{supports:LK,attributes:{...(0,at.omit)(AK,["style"]),customTextColor:{type:"string"},customBackgroundColor:{type:"string"},customFontSize:{type:"number"}},migrate:SK,save({attributes:e}){const{align:t,content:n,dropCap:r,backgroundColor:o,textColor:a,customBackgroundColor:i,customTextColor:s,fontSize:l,customFontSize:c,direction:u}=e,d=mC("color",a),p=mC("background-color",o),m=Xz(l),f=so()({"has-text-color":a||s,"has-background":o||i,"has-drop-cap":r,[m]:m,[d]:d,[p]:p}),h={backgroundColor:p?void 0:i,color:d?void 0:s,fontSize:m?void 0:c,textAlign:t};return(0,tt.createElement)(Cj.Content,{tagName:"p",style:h,className:f||void 0,value:n,dir:u})}},{supports:LK,attributes:{...(0,at.omit)(AK,["style"]),customTextColor:{type:"string"},customBackgroundColor:{type:"string"},customFontSize:{type:"number"},width:{type:"string"}},migrate:SK,save({attributes:e}){const{width:t,align:n,content:r,dropCap:o,backgroundColor:a,textColor:i,customBackgroundColor:s,customTextColor:l,fontSize:c,customFontSize:u}=e,d=mC("color",i),p=mC("background-color",a),m=c&&`is-${c}-text`,f=so()({[`align${t}`]:t,"has-background":a||s,"has-drop-cap":o,[m]:m,[d]:d,[p]:p}),h={backgroundColor:p?void 0:s,color:d?void 0:l,fontSize:m?void 0:u,textAlign:n};return(0,tt.createElement)(Cj.Content,{tagName:"p",style:h,className:f||void 0,value:r})}},{supports:LK,attributes:(0,at.omit)({...AK,fontSize:{type:"number"}},["style"]),save({attributes:e}){const{width:t,align:n,content:r,dropCap:o,backgroundColor:a,textColor:i,fontSize:s}=e,l=so()({[`align${t}`]:t,"has-background":a,"has-drop-cap":o}),c={backgroundColor:a,color:i,fontSize:s,textAlign:n};return(0,tt.createElement)("p",{style:c,className:l||void 0},r)},migrate:e=>SK((0,at.omit)({...e,customFontSize:(0,at.isFinite)(e.fontSize)?e.fontSize:void 0,customTextColor:e.textColor&&"#"===e.textColor[0]?e.textColor:void 0,customBackgroundColor:e.backgroundColor&&"#"===e.backgroundColor[0]?e.backgroundColor:void 0}))},{supports:LK,attributes:{...AK,content:{type:"string",source:"html",default:""}},save:({attributes:e})=>(0,tt.createElement)(Pa,null,e.content),migrate:e=>e}],TK=(0,tt.createElement)(mo,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},(0,tt.createElement)(uo,{d:"M5.52 2h7.43c.55 0 1 .45 1 1s-.45 1-1 1h-1v13c0 .55-.45 1-1 1s-1-.45-1-1V5c0-.55-.45-1-1-1s-1 .45-1 1v12c0 .55-.45 1-1 1s-1-.45-1-1v-5.96h-.43C3.02 11.04 1 9.02 1 6.52S3.02 2 5.52 2zM14 14l5-4-5-4v8z"}));function xK({direction:e,setDirection:t}){return rr()&&(0,tt.createElement)(ck,{controls:[{icon:TK,title:tr("Left to right","editor button"),isActive:"ltr"===e,onClick(){t("ltr"===e?void 0:"ltr")}}]})}const zK=function({attributes:e,mergeBlocks:t,onReplace:n,onRemove:r,setAttributes:o,clientId:a}){const{align:i,content:s,direction:l,dropCap:c,placeholder:u}=e,d=JL("typography.dropCap"),p=VR({className:so()({"has-drop-cap":c,[`has-text-align-${i}`]:i}),style:{direction:l}});return(0,tt.createElement)(tt.Fragment,null,(0,tt.createElement)(lk,{group:"block"},(0,tt.createElement)(gD,{value:i,onChange:e=>o({align:e})}),(0,tt.createElement)(xK,{direction:l,setDirection:e=>o({direction:e})})),d&&(0,tt.createElement)(FA,null,(0,tt.createElement)(BA,{title:er("Text settings")},(0,tt.createElement)(KN,{label:er("Drop cap"),checked:!!c,onChange:()=>o({dropCap:!c}),help:er(c?"Showing large initial letter.":"Toggle to show a large initial letter.")}))),(0,tt.createElement)(Cj,ot({identifier:"content",tagName:"p"},p,{value:s,onChange:e=>o({content:e}),onSplit:(t,n)=>{let r;(n||t)&&(r={...e,content:t});const o=Ho("core/paragraph",r);return n&&(o.clientId=a),o},onMerge:t,onReplace:n,onRemove:r,"aria-label":er(s?"Paragraph block":"Empty block; start writing or type forward slash to choose a block"),"data-empty":!s,placeholder:u||er("Type / to choose a block"),__unstableEmbedURLOnPaste:!0,__unstableAllowPrefixTransformations:!0})))};const{name:OK}={apiVersion:2,name:"core/paragraph",title:"Paragraph",category:"text",description:"Start with the building block of all narrative.",keywords:["text"],textdomain:"default",attributes:{align:{type:"string"},content:{type:"string",source:"html",selector:"p",default:"",__experimentalRole:"content"},dropCap:{type:"boolean",default:!1},placeholder:{type:"string"},direction:{type:"string",enum:["ltr","rtl"]}},supports:{anchor:!0,className:!1,color:{link:!0},typography:{fontSize:!0,lineHeight:!0},__experimentalSelector:"p",__unstablePasteTextInline:!0},editorStyle:"wp-block-paragraph-editor",style:"wp-block-paragraph"},NK={from:[{type:"raw",priority:20,selector:"p",schema:({phrasingContentSchema:e,isPaste:t})=>({p:{children:e,attributes:t?[]:["style","id"]}}),transform(e){const t=Gi(OK,e.outerHTML),{textAlign:n}=e.style||{};return"left"!==n&&"center"!==n&&"right"!==n||(t.align=n),Ho(OK,t)}}]},DK={apiVersion:2,name:"core/paragraph",title:"Paragraph",category:"text",description:"Start with the building block of all narrative.",keywords:["text"],textdomain:"default",attributes:{align:{type:"string"},content:{type:"string",source:"html",selector:"p",default:"",__experimentalRole:"content"},dropCap:{type:"boolean",default:!1},placeholder:{type:"string"},direction:{type:"string",enum:["ltr","rtl"]}},supports:{anchor:!0,className:!1,color:{link:!0},typography:{fontSize:!0,lineHeight:!0},__experimentalSelector:"p",__unstablePasteTextInline:!0},editorStyle:"wp-block-paragraph-editor",style:"wp-block-paragraph"},{name:BK}=DK,IK={icon:EK,example:{attributes:{content:er("In a village of La Mancha, the name of which I have no desire to call to mind, there lived not long since one of those gentlemen that keep a lance in the lance-rack, an old buckler, a lean hack, and a greyhound for coursing."),style:{typography:{fontSize:28}},dropCap:!0}},__experimentalLabel(e,{context:t}){if("accessibility"===t){const{content:t}=e;return(0,at.isEmpty)(t)?er("Empty"):t}},transforms:NK,deprecated:CK,merge:(e,t)=>({content:(e.content||"")+(t.content||"")}),edit:zK,save:function({attributes:e}){const{align:t,content:n,dropCap:r,direction:o}=e,a=so()({"has-drop-cap":r,[`has-text-align-${t}`]:t});return(0,tt.createElement)("p",VR.save({className:a,dir:o}),(0,tt.createElement)(Cj.Content,{value:n}))}},PK=(0,tt.createElement)(mo,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,tt.createElement)(uo,{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM5 4.5h14c.3 0 .5.2.5.5v8.4l-3-2.9c-.3-.3-.8-.3-1 0L11.9 14 9 12c-.3-.2-.6-.2-.8 0l-3.6 2.6V5c-.1-.3.1-.5.4-.5zm14 15H5c-.3 0-.5-.2-.5-.5v-2.4l4.1-3 3 1.9c.3.2.7.2.9-.1L16 12l3.5 3.4V19c0 .3-.2.5-.5.5z"})),RK={align:{type:"string"},url:{type:"string",source:"attribute",selector:"img",attribute:"src"},alt:{type:"string",source:"attribute",selector:"img",attribute:"alt",default:""},caption:{type:"string",source:"html",selector:"figcaption"},href:{type:"string",source:"attribute",selector:"figure > a",attribute:"href"},rel:{type:"string",source:"attribute",selector:"figure > a",attribute:"rel"},linkClass:{type:"string",source:"attribute",selector:"figure > a",attribute:"class"},id:{type:"number"},width:{type:"number"},height:{type:"number"},linkDestination:{type:"string"},linkTarget:{type:"string",source:"attribute",selector:"figure > a",attribute:"target"}},YK=[{attributes:RK,save({attributes:e}){const{url:t,alt:n,caption:r,align:o,href:a,width:i,height:s,id:l}=e,c=so()({[`align${o}`]:o,"is-resized":i||s}),u=(0,tt.createElement)("img",{src:t,alt:n,className:l?`wp-image-${l}`:null,width:i,height:s});return(0,tt.createElement)("figure",{className:c},a?(0,tt.createElement)("a",{href:a},u):u,!Cj.isEmpty(r)&&(0,tt.createElement)(Cj.Content,{tagName:"figcaption",value:r}))}},{attributes:RK,save({attributes:e}){const{url:t,alt:n,caption:r,align:o,href:a,width:i,height:s,id:l}=e,c=(0,tt.createElement)("img",{src:t,alt:n,className:l?`wp-image-${l}`:null,width:i,height:s});return(0,tt.createElement)("figure",{className:o?`align${o}`:null},a?(0,tt.createElement)("a",{href:a},c):c,!Cj.isEmpty(r)&&(0,tt.createElement)(Cj.Content,{tagName:"figcaption",value:r}))}},{attributes:RK,save({attributes:e}){const{url:t,alt:n,caption:r,align:o,href:a,width:i,height:s}=e,l=i||s?{width:i,height:s}:{},c=(0,tt.createElement)("img",ot({src:t,alt:n},l));let u={};return i?u={width:i}:"left"!==o&&"right"!==o||(u={maxWidth:"50%"}),(0,tt.createElement)("figure",{className:o?`align${o}`:null,style:u},a?(0,tt.createElement)("a",{href:a},c):c,!Cj.isEmpty(r)&&(0,tt.createElement)(Cj.Content,{tagName:"figcaption",value:r}))}}],WK=ri((e=>{function t(t,r){const[o,a]=(0,tt.useState)([]),i=(0,tt.useMemo)((()=>{const e=e=>{const t=e.id?e:{...e,id:ao()};a((e=>[...e,t]))};return{createNotice:e,createErrorNotice:t=>{e({status:"error",content:t})},removeNotice:e=>{a((t=>t.filter((t=>t.id!==e))))},removeAllNotices:()=>{a([])}}}),[]),s={...t,noticeList:o,noticeOperations:i,noticeUI:o.length>0&&(0,tt.createElement)(J$,{className:"components-with-notices-ui",notices:o,onRemove:i.removeNotice})};return n?(0,tt.createElement)(e,ot({},s,{ref:r})):(0,tt.createElement)(e,s)}let n;const{render:r}=e;return"function"==typeof r?(n=!0,(0,tt.forwardRef)(t)):t})),HK=Ok("box-shadow:0 0 0 transparent;transition:box-shadow 0.1s linear;border-radius:",Lw.radiusBlockUi,";border:",Lw.borderWidth," solid ",Gk.ui.border,";",""),qK=Ok("border-color:var( --wp-admin-theme-color );box-shadow:0 0 0 calc( ",Lw.borderWidthFocus," - ",Lw.borderWidth," ) var( --wp-admin-theme-color );outline:2px solid transparent;",""),jK={huge:"1440px",wide:"1280px","x-large":"1080px",large:"960px",medium:"782px",small:"600px",mobile:"480px","zoomed-in":"280px"},FK=Ok("font-family:",vA("default.fontFamily"),";padding:6px 8px;",HK,";font-size:",vA("mobileTextMinFontSize"),";line-height:normal;",`@media (min-width: ${jK["small"]})`,"{font-size:",vA("default.fontSize"),";line-height:normal;}&:focus{",qK,";}&::-webkit-input-placeholder{color:",Gk.darkGray.placeholder,";}&::-moz-placeholder{opacity:1;color:",Gk.darkGray.placeholder,";}&:-ms-input-placeholder{color:",Gk.darkGray.placeholder,";}.is-dark-theme &{&::-webkit-input-placeholder{color:",Gk.lightGray.placeholder,";}&::-moz-placeholder{opacity:1;color:",Gk.lightGray.placeholder,";}&:-ms-input-placeholder{color:",Gk.lightGray.placeholder,";}}","");const VK=yh("textarea",{target:"ebk7yr50"})("width:100%;",FK,";");function XK({label:e,hideLabelFromVision:t,value:n,help:r,onChange:o,rows:a=4,className:i,...s}){const l=`inspector-textarea-control-${Qk(XK)}`;return(0,tt.createElement)(EA,{label:e,hideLabelFromVision:t,id:l,help:r,className:i},(0,tt.createElement)(VK,ot({className:"components-textarea-control__input",id:l,rows:a,onChange:e=>o(e.target.value),"aria-describedby":r?l+"__help":void 0,value:n},s)))}var UK=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),$K=function(){return($K=Object.assign||function(e){for(var t,n=1,r=arguments.length;n{s||(c(!1),d(!1))};(0,tt.useEffect)((()=>{if(!(null!==p||null!==m))return;const e=p!==h.current,r=m!==f.current;if(e||r){if(p&&!h.current&&m&&!f.current)return h.current=p,void(f.current=m);e&&(c(!0),h.current=p),r&&(d(!0),f.current=m),n({width:p,height:m}),g.current&&fG(g.current),g.current=hG(b,t)}}),[p,m]);return{label:function({axis:e,height:t,moveX:n=!1,moveY:r=!1,position:o=gG,showPx:a=!1,width:i}){if(!n&&!r)return null;if(o===bG)return`${i} x ${t}`;const s=a?" px":"";if(e){if("x"===e&&n)return`${i}${s}`;if("y"===e&&r)return`${t}${s}`}if(n&&r)return`${i} x ${t}`;if(n)return`${i}${s}`;if(r)return`${t}${s}`;return null}({axis:e,height:m,moveX:l,moveY:u,position:r,showPx:o,width:p}),resizeListener:a}}const yG=yh("div",{target:"ekdag503"})({name:"1cd7zoc",styles:"bottom:0;box-sizing:border-box;left:0;pointer-events:none;position:absolute;right:0;top:0"}),_G=yh("div",{target:"ekdag502"})({name:"ajymcs",styles:"align-items:center;box-sizing:border-box;display:inline-flex;justify-content:center;opacity:0;pointer-events:none;transition:opacity 120ms linear"}),MG=yh("div",{target:"ekdag501"})("background:",Gk.ui.border,";border-radius:2px;box-sizing:border-box;font-size:12px;color:",Gk.ui.textDark,";padding:4px 8px;position:relative;"),kG=yh(Rw,{target:"ekdag500"})({name:"1kboj1g",styles:"&&&{color:white;display:block;font-size:13px;line-height:1.4;}"});const wG=(0,tt.forwardRef)((function({label:e,position:t=bG,zIndex:n=1e3,...r},o){const a=!!e,i=t===bG;if(!a)return null;let s={opacity:a?1:null,zIndex:n},l={};return t===gG&&(s={...s,position:"absolute",bottom:-10,left:"50%",transform:"translate(-50%, 0)"},l={transform:"translate(0, 100%)"}),i&&(s={...s,position:"absolute",top:4,right:rr()?null:4,left:rr()?4:null}),(0,tt.createElement)(_G,ot({"aria-hidden":"true",className:"components-resizable-tooltip__tooltip-wrapper",isActive:a,ref:o,style:s},r),(0,tt.createElement)(MG,{className:"components-resizable-tooltip__tooltip",style:l},(0,tt.createElement)(kG,{as:"span"},e)))}));const EG=(0,tt.forwardRef)((function({axis:e,className:t,fadeTimeout:n=180,isVisible:r=!0,labelRef:o,onResize:a=at.noop,position:i=gG,showPx:s=!0,zIndex:l=1e3,...c},u){const{label:d,resizeListener:p}=vG({axis:e,fadeTimeout:n,onResize:a,showPx:s,position:i});if(!r)return null;const m=so()("components-resize-tooltip",t);return(0,tt.createElement)(yG,ot({"aria-hidden":"true",className:m,ref:u},c),p,(0,tt.createElement)(wG,{"aria-hidden":c["aria-hidden"],fadeTimeout:n,isVisible:r,label:d,position:i,ref:o,zIndex:l}))}));const LG=(0,tt.forwardRef)((function({className:e,children:t,showHandle:n=!0,__experimentalShowTooltip:r=!1,__experimentalTooltipProps:o={},...a},i){const s={width:null,height:null,top:null,right:null,bottom:null,left:null},l="components-resizable-box__handle",c="components-resizable-box__side-handle",u="components-resizable-box__corner-handle";return(0,tt.createElement)(mG,ot({className:so()("components-resizable-box__container",n&&"has-show-handle",e),handleClasses:{top:so()(l,c,"components-resizable-box__handle-top"),right:so()(l,c,"components-resizable-box__handle-right"),bottom:so()(l,c,"components-resizable-box__handle-bottom"),left:so()(l,c,"components-resizable-box__handle-left"),topLeft:so()(l,u,"components-resizable-box__handle-top","components-resizable-box__handle-left"),topRight:so()(l,u,"components-resizable-box__handle-top","components-resizable-box__handle-right"),bottomRight:so()(l,u,"components-resizable-box__handle-bottom","components-resizable-box__handle-right"),bottomLeft:so()(l,u,"components-resizable-box__handle-bottom","components-resizable-box__handle-left")},handleStyles:{top:s,right:s,bottom:s,left:s,topLeft:s,topRight:s,bottomRight:s,bottomLeft:s},ref:i},a),t,r&&(0,tt.createElement)(EG,o))}));function AG(e){const t=(0,tt.useRef)(void 0);return(0,tt.useEffect)((()=>{t.current=e}),[e]),t.current}function SG(e){const t=/^[^\/\s:]+:(?:\/\/)?[^\/\s#?]+[\/]([^\s#?]+)[#?]{0,1}\S*$/.exec(e);if(t)return t[1]}const CG=(0,tt.createElement)(mo,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,tt.createElement)(uo,{d:"M16.5 7.8v7H18v-7c0-1-.8-1.8-1.8-1.8h-7v1.5h7c.2 0 .3.1.3.3zm-8.7 8.7c-.1 0-.2-.1-.2-.2V2H6v4H2v1.5h4v8.8c0 1 .8 1.8 1.8 1.8h8.8v4H18v-4h4v-1.5H7.8z"})),TG=(0,tt.createElement)(mo,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,tt.createElement)(uo,{d:"M18 4H6c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12-9.8c.4 0 .8-.3.9-.7l1.1-3h3.6l.5 1.7h1.9L13 9h-2.2l-3.4 9.5H6c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h12c.3 0 .5.2.5.5v12H20V6c0-1.1-.9-2-2-2zm-6 7l1.4 3.9h-2.7L12 11z"})),xG=[{ratio:"2.33",className:"wp-embed-aspect-21-9"},{ratio:"2.00",className:"wp-embed-aspect-18-9"},{ratio:"1.78",className:"wp-embed-aspect-16-9"},{ratio:"1.33",className:"wp-embed-aspect-4-3"},{ratio:"1.00",className:"wp-embed-aspect-1-1"},{ratio:"0.56",className:"wp-embed-aspect-9-16"},{ratio:"0.50",className:"wp-embed-aspect-1-2"}],zG="wp-embed";var OG=n(1991),NG=n.n(OG);const{name:DG}={apiVersion:2,name:"core/embed",title:"Embed",category:"embed",description:"Add a block that displays content pulled from other sites, like Twitter or YouTube.",textdomain:"default",attributes:{url:{type:"string"},caption:{type:"string",source:"html",selector:"figcaption"},type:{type:"string"},providerNameSlug:{type:"string"},allowResponsive:{type:"boolean",default:!0},responsive:{type:"boolean",default:!1},previewable:{type:"boolean",default:!0}},supports:{align:!0},editorStyle:"wp-block-embed-editor",style:"wp-block-embed"},BG=e=>e&&e.includes('class="wp-embedded-content"'),IG=(e,t={})=>{var n;const{preview:r,attributes:o={}}=e,{url:a,providerNameSlug:i,type:s,...l}=o;if(!a||!Bo(DG))return;const c=(e=>{var t;return null===(t=Wo(DG))||void 0===t?void 0:t.find((({patterns:t})=>((e,t=[])=>t.some((t=>e.match(t))))(e,t)))})(a),u="wordpress"===i||s===zG;if(!u&&c&&(c.attributes.providerNameSlug!==i||!i))return Ho(DG,{url:a,...l,...c.attributes});const d=null===(n=Wo(DG))||void 0===n?void 0:n.find((({name:e})=>"wordpress"===e));return d&&r&&BG(r.html)&&!u?Ho(DG,{url:a,...d.attributes,...t}):void 0},PG=e=>{if(!e)return e;const t=xG.reduce(((e,{className:t})=>(e[t]=!1,e)),{"wp-has-aspect-ratio":!1});return NG()(e,t)};function RG(e,t,n=!0){if(!n)return PG(t);const r=document.implementation.createHTMLDocument("");r.body.innerHTML=e;const o=r.body.querySelector("iframe");if(o&&o.height&&o.width){const e=(o.width/o.height).toFixed(2);for(let n=0;n=r.ratio){return e-r.ratio>.1?PG(t):NG()(PG(t),r.className,"wp-has-aspect-ratio")}}}return t}const YG=ln()(((e,t,n,r,o=!0)=>{if(!e)return{};const a={};let{type:i="rich"}=e;const{html:s,provider_name:l}=e,c=(0,at.kebabCase)((l||t).toLowerCase());return BG(s)&&(i=zG),(s||"photo"===i)&&(a.type=i,a.providerNameSlug=c),a.className=RG(s,n,r&&o),a}));function WG(e,t){const[n,r]=(0,tt.useState)();function o(){r(e.current.clientWidth)}return(0,tt.useEffect)(o,t),(0,tt.useEffect)((()=>{const{defaultView:t}=e.current.ownerDocument;return t.addEventListener("resize",o),()=>{t.removeEventListener("resize",o)}}),[]),n}var HG=function(e,t){return(HG=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};var qG=function(){return(qG=Object.assign||function(e){for(var t,n=1,r=arguments.length;nu*o?{width:u*o,height:u}:{width:c,height:c/o}}function XG(e,t,n,r,o){void 0===o&&(o=0);var a=nJ(t.width,t.height,o),i=a.width,s=a.height;return{x:UG(e.x,i,n.width,r),y:UG(e.y,s,n.height,r)}}function UG(e,t,n,r){var o=t*r/2-n/2;return Math.min(o,Math.max(e,-o))}function $G(e,t){return Math.sqrt(Math.pow(e.y-t.y,2)+Math.pow(e.x-t.x,2))}function KG(e,t){return 180*Math.atan2(t.y-e.y,t.x-e.x)/Math.PI}function GG(e,t,n,r,o,a,i){void 0===a&&(a=0),void 0===i&&(i=!0);var s=i&&0===a?JG:QG,l={x:s(100,((t.width-n.width/o)/2-e.x/o)/t.width*100),y:s(100,((t.height-n.height/o)/2-e.y/o)/t.height*100),width:s(100,n.width/t.width*100/o),height:s(100,n.height/t.height*100/o)},c=Math.round(s(t.naturalWidth,l.width*t.naturalWidth/100)),u=Math.round(s(t.naturalHeight,l.height*t.naturalHeight/100)),d=t.naturalWidth>=t.naturalHeight*r?{width:Math.round(u*r),height:u}:{width:c,height:Math.round(c/r)};return{croppedAreaPercentages:l,croppedAreaPixels:qG(qG({},d),{x:Math.round(s(t.naturalWidth-d.width,l.x*t.naturalWidth/100)),y:Math.round(s(t.naturalHeight-d.height,l.y*t.naturalHeight/100))})}}function JG(e,t){return Math.min(e,Math.max(0,t))}function QG(e,t){return t}function ZG(e,t,n){var r=t.width/t.naturalWidth,o=function(e,t,n){var r=t.width/t.naturalWidth;if(n)return n.height>n.width?n.height/r/e.height:n.width/r/e.width;var o=e.width/e.height;return t.naturalWidth>=t.naturalHeight*o?t.naturalHeight/e.height:t.naturalWidth/e.width}(e,t,n),a=r*o;return{crop:{x:((t.naturalWidth-e.width)/2-e.x)*a,y:((t.naturalHeight-e.height)/2-e.y)*a},zoom:o}}function eJ(e,t){return{x:(t.x+e.x)/2,y:(t.y+e.y)/2}}function tJ(e,t,n,r,o){var a=Math.cos,i=Math.sin,s=o*Math.PI/180;return[(e-n)*a(s)-(t-r)*i(s)+n,(e-n)*i(s)+(t-r)*a(s)+r]}function nJ(e,t,n){var r=e/2,o=t/2,a=[tJ(0,0,r,o,n),tJ(e,0,r,o,n),tJ(e,t,r,o,n),tJ(0,t,r,o,n)],i=Math.min.apply(Math,a.map((function(e){return e[0]}))),s=Math.max.apply(Math,a.map((function(e){return e[0]}))),l=Math.min.apply(Math,a.map((function(e){return e[1]})));return{width:s-i,height:Math.max.apply(Math,a.map((function(e){return e[1]})))-l}}function rJ(){for(var e=[],t=0;t0})).join(" ").trim()}const oJ=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.imageRef=null,n.videoRef=null,n.containerRef=null,n.styleRef=null,n.containerRect=null,n.mediaSize={width:0,height:0,naturalWidth:0,naturalHeight:0},n.dragStartPosition={x:0,y:0},n.dragStartCrop={x:0,y:0},n.lastPinchDistance=0,n.lastPinchRotation=0,n.rafDragTimeout=null,n.rafPinchTimeout=null,n.wheelTimer=null,n.state={cropSize:null,hasWheelJustStarted:!1},n.preventZoomSafari=function(e){return e.preventDefault()},n.cleanEvents=function(){document.removeEventListener("mousemove",n.onMouseMove),document.removeEventListener("mouseup",n.onDragStopped),document.removeEventListener("touchmove",n.onTouchMove),document.removeEventListener("touchend",n.onDragStopped)},n.clearScrollEvent=function(){n.containerRef&&n.containerRef.removeEventListener("wheel",n.onWheel),n.wheelTimer&&clearTimeout(n.wheelTimer)},n.onMediaLoad=function(){n.computeSizes(),n.emitCropData(),n.setInitialCrop(),n.props.onMediaLoaded&&n.props.onMediaLoaded(n.mediaSize)},n.setInitialCrop=function(){var e=n.props,t=e.initialCroppedAreaPixels,r=e.cropSize;if(t){var o=ZG(t,n.mediaSize,r),a=o.crop,i=o.zoom;n.props.onCropChange(a),n.props.onZoomChange&&n.props.onZoomChange(i)}},n.computeSizes=function(){var e,t,r,o,a,i,s=n.imageRef||n.videoRef;if(s&&n.containerRef){n.containerRect=n.containerRef.getBoundingClientRect(),n.mediaSize={width:s.offsetWidth,height:s.offsetHeight,naturalWidth:(null===(e=n.imageRef)||void 0===e?void 0:e.naturalWidth)||(null===(t=n.videoRef)||void 0===t?void 0:t.videoWidth)||0,naturalHeight:(null===(r=n.imageRef)||void 0===r?void 0:r.naturalHeight)||(null===(o=n.videoRef)||void 0===o?void 0:o.videoHeight)||0};var l=n.props.cropSize?n.props.cropSize:VG(s.offsetWidth,s.offsetHeight,n.containerRect.width,n.containerRect.height,n.props.aspect,n.props.rotation);(null===(a=n.state.cropSize)||void 0===a?void 0:a.height)===l.height&&(null===(i=n.state.cropSize)||void 0===i?void 0:i.width)===l.width||n.props.onCropSizeChange&&n.props.onCropSizeChange(l),n.setState({cropSize:l},n.recomputeCropPosition)}},n.onMouseDown=function(e){e.preventDefault(),document.addEventListener("mousemove",n.onMouseMove),document.addEventListener("mouseup",n.onDragStopped),n.onDragStart(t.getMousePoint(e))},n.onMouseMove=function(e){return n.onDrag(t.getMousePoint(e))},n.onTouchStart=function(e){e.preventDefault(),document.addEventListener("touchmove",n.onTouchMove,{passive:!1}),document.addEventListener("touchend",n.onDragStopped),2===e.touches.length?n.onPinchStart(e):1===e.touches.length&&n.onDragStart(t.getTouchPoint(e.touches[0]))},n.onTouchMove=function(e){e.preventDefault(),2===e.touches.length?n.onPinchMove(e):1===e.touches.length&&n.onDrag(t.getTouchPoint(e.touches[0]))},n.onDragStart=function(e){var t,r,o=e.x,a=e.y;n.dragStartPosition={x:o,y:a},n.dragStartCrop=qG({},n.props.crop),null===(r=(t=n.props).onInteractionStart)||void 0===r||r.call(t)},n.onDrag=function(e){var t=e.x,r=e.y;n.rafDragTimeout&&window.cancelAnimationFrame(n.rafDragTimeout),n.rafDragTimeout=window.requestAnimationFrame((function(){if(n.state.cropSize&&void 0!==t&&void 0!==r){var e=t-n.dragStartPosition.x,o=r-n.dragStartPosition.y,a={x:n.dragStartCrop.x+e,y:n.dragStartCrop.y+o},i=n.props.restrictPosition?XG(a,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):a;n.props.onCropChange(i)}}))},n.onDragStopped=function(){var e,t;n.cleanEvents(),n.emitCropData(),null===(t=(e=n.props).onInteractionEnd)||void 0===t||t.call(e)},n.onWheel=function(e){e.preventDefault();var r=t.getMousePoint(e),o=FG()(e).pixelY,a=n.props.zoom-o*n.props.zoomSpeed/200;n.setNewZoom(a,r),n.state.hasWheelJustStarted||n.setState({hasWheelJustStarted:!0},(function(){var e,t;return null===(t=(e=n.props).onInteractionStart)||void 0===t?void 0:t.call(e)})),n.wheelTimer&&clearTimeout(n.wheelTimer),n.wheelTimer=window.setTimeout((function(){return n.setState({hasWheelJustStarted:!1},(function(){var e,t;return null===(t=(e=n.props).onInteractionEnd)||void 0===t?void 0:t.call(e)}))}),250)},n.getPointOnContainer=function(e){var t=e.x,r=e.y;if(!n.containerRect)throw new Error("The Cropper is not mounted");return{x:n.containerRect.width/2-(t-n.containerRect.left),y:n.containerRect.height/2-(r-n.containerRect.top)}},n.getPointOnMedia=function(e){var t=e.x,r=e.y,o=n.props,a=o.crop,i=o.zoom;return{x:(t+a.x)/i,y:(r+a.y)/i}},n.setNewZoom=function(e,t){if(n.state.cropSize&&n.props.onZoomChange){var r=n.getPointOnContainer(t),o=n.getPointOnMedia(r),a=Math.min(n.props.maxZoom,Math.max(e,n.props.minZoom)),i={x:o.x*a-r.x,y:o.y*a-r.y},s=n.props.restrictPosition?XG(i,n.mediaSize,n.state.cropSize,a,n.props.rotation):i;n.props.onCropChange(s),n.props.onZoomChange(a)}},n.getCropData=function(){return n.state.cropSize?GG(n.props.restrictPosition?XG(n.props.crop,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):n.props.crop,n.mediaSize,n.state.cropSize,n.getAspect(),n.props.zoom,n.props.rotation,n.props.restrictPosition):null},n.emitCropData=function(){var e=n.getCropData();if(e){var t=e.croppedAreaPercentages,r=e.croppedAreaPixels;n.props.onCropComplete&&n.props.onCropComplete(t,r),n.props.onCropAreaChange&&n.props.onCropAreaChange(t,r)}},n.emitCropAreaChange=function(){var e=n.getCropData();if(e){var t=e.croppedAreaPercentages,r=e.croppedAreaPixels;n.props.onCropAreaChange&&n.props.onCropAreaChange(t,r)}},n.recomputeCropPosition=function(){if(n.state.cropSize){var e=n.props.restrictPosition?XG(n.props.crop,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):n.props.crop;n.props.onCropChange(e),n.emitCropData()}},n}return function(e,t){function n(){this.constructor=e}HG(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,e),t.prototype.componentDidMount=function(){window.addEventListener("resize",this.computeSizes),this.containerRef&&(this.props.zoomWithScroll&&this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}),this.containerRef.addEventListener("gesturestart",this.preventZoomSafari),this.containerRef.addEventListener("gesturechange",this.preventZoomSafari)),this.props.disableAutomaticStylesInjection||(this.styleRef=document.createElement("style"),this.styleRef.setAttribute("type","text/css"),this.styleRef.innerHTML=".reactEasyCrop_Container {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n overflow: hidden;\n user-select: none;\n touch-action: none;\n cursor: move;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.reactEasyCrop_Image,\n.reactEasyCrop_Video {\n will-change: transform; /* this improves performances and prevent painting issues on iOS Chrome */\n}\n\n.reactEasyCrop_Contain {\n max-width: 100%;\n max-height: 100%;\n margin: auto;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n}\n.reactEasyCrop_Cover_Horizontal {\n width: 100%;\n height: auto;\n}\n.reactEasyCrop_Cover_Vertical {\n width: auto;\n height: 100%;\n}\n\n.reactEasyCrop_CropArea {\n position: absolute;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n border: 1px solid rgba(255, 255, 255, 0.5);\n box-sizing: border-box;\n box-shadow: 0 0 0 9999em;\n color: rgba(0, 0, 0, 0.5);\n overflow: hidden;\n}\n\n.reactEasyCrop_CropAreaRound {\n border-radius: 50%;\n}\n\n.reactEasyCrop_CropAreaGrid::before {\n content: ' ';\n box-sizing: border-box;\n position: absolute;\n border: 1px solid rgba(255, 255, 255, 0.5);\n top: 0;\n bottom: 0;\n left: 33.33%;\n right: 33.33%;\n border-top: 0;\n border-bottom: 0;\n}\n\n.reactEasyCrop_CropAreaGrid::after {\n content: ' ';\n box-sizing: border-box;\n position: absolute;\n border: 1px solid rgba(255, 255, 255, 0.5);\n top: 33.33%;\n bottom: 33.33%;\n left: 0;\n right: 0;\n border-left: 0;\n border-right: 0;\n}\n",document.head.appendChild(this.styleRef)),this.imageRef&&this.imageRef.complete&&this.onMediaLoad()},t.prototype.componentWillUnmount=function(){var e;window.removeEventListener("resize",this.computeSizes),this.containerRef&&(this.containerRef.removeEventListener("gesturestart",this.preventZoomSafari),this.containerRef.removeEventListener("gesturechange",this.preventZoomSafari)),this.styleRef&&(null===(e=this.styleRef.parentNode)||void 0===e||e.removeChild(this.styleRef)),this.cleanEvents(),this.props.zoomWithScroll&&this.clearScrollEvent()},t.prototype.componentDidUpdate=function(e){var t,n,r,o,a,i,s,l,c;e.rotation!==this.props.rotation?(this.computeSizes(),this.recomputeCropPosition()):e.aspect!==this.props.aspect?this.computeSizes():e.zoom!==this.props.zoom?this.recomputeCropPosition():(null===(t=e.cropSize)||void 0===t?void 0:t.height)!==(null===(n=this.props.cropSize)||void 0===n?void 0:n.height)||(null===(r=e.cropSize)||void 0===r?void 0:r.width)!==(null===(o=this.props.cropSize)||void 0===o?void 0:o.width)?this.computeSizes():(null===(a=e.crop)||void 0===a?void 0:a.x)===(null===(i=this.props.crop)||void 0===i?void 0:i.x)&&(null===(s=e.crop)||void 0===s?void 0:s.y)===(null===(l=this.props.crop)||void 0===l?void 0:l.y)||this.emitCropAreaChange(),e.zoomWithScroll!==this.props.zoomWithScroll&&this.containerRef&&(this.props.zoomWithScroll?this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}):this.clearScrollEvent()),e.video!==this.props.video&&(null===(c=this.videoRef)||void 0===c||c.load())},t.prototype.getAspect=function(){var e=this.props,t=e.cropSize,n=e.aspect;return t?t.width/t.height:n},t.prototype.onPinchStart=function(e){var n=t.getTouchPoint(e.touches[0]),r=t.getTouchPoint(e.touches[1]);this.lastPinchDistance=$G(n,r),this.lastPinchRotation=KG(n,r),this.onDragStart(eJ(n,r))},t.prototype.onPinchMove=function(e){var n=this,r=t.getTouchPoint(e.touches[0]),o=t.getTouchPoint(e.touches[1]),a=eJ(r,o);this.onDrag(a),this.rafPinchTimeout&&window.cancelAnimationFrame(this.rafPinchTimeout),this.rafPinchTimeout=window.requestAnimationFrame((function(){var e=$G(r,o),t=n.props.zoom*(e/n.lastPinchDistance);n.setNewZoom(t,a),n.lastPinchDistance=e;var i=KG(r,o),s=n.props.rotation+(i-n.lastPinchRotation);n.props.onRotationChange&&n.props.onRotationChange(s),n.lastPinchRotation=i}))},t.prototype.render=function(){var e=this,t=this.props,n=t.image,r=t.video,o=t.mediaProps,a=t.transform,i=t.crop,s=i.x,l=i.y,c=t.rotation,u=t.zoom,d=t.cropShape,p=t.showGrid,m=t.style,f=m.containerStyle,h=m.cropAreaStyle,g=m.mediaStyle,b=t.classes,v=b.containerClassName,y=b.cropAreaClassName,_=b.mediaClassName,M=t.objectFit;return nt().createElement("div",{onMouseDown:this.onMouseDown,onTouchStart:this.onTouchStart,ref:function(t){return e.containerRef=t},"data-testid":"container",style:f,className:rJ("reactEasyCrop_Container",v)},n?nt().createElement("img",qG({alt:"",className:rJ("reactEasyCrop_Image","contain"===M&&"reactEasyCrop_Contain","horizontal-cover"===M&&"reactEasyCrop_Cover_Horizontal","vertical-cover"===M&&"reactEasyCrop_Cover_Vertical",_)},o,{src:n,ref:function(t){return e.imageRef=t},style:qG(qG({},g),{transform:a||"translate("+s+"px, "+l+"px) rotate("+c+"deg) scale("+u+")"}),onLoad:this.onMediaLoad})):r&&nt().createElement("video",qG({autoPlay:!0,loop:!0,muted:!0,className:rJ("reactEasyCrop_Video","contain"===M&&"reactEasyCrop_Contain","horizontal-cover"===M&&"reactEasyCrop_Cover_Horizontal","vertical-cover"===M&&"reactEasyCrop_Cover_Vertical",_)},o,{ref:function(t){return e.videoRef=t},onLoadedMetadata:this.onMediaLoad,style:qG(qG({},g),{transform:a||"translate("+s+"px, "+l+"px) rotate("+c+"deg) scale("+u+")"}),controls:!1}),(Array.isArray(r)?r:[{src:r}]).map((function(e){return nt().createElement("source",qG({key:e.src},e))}))),this.state.cropSize&&nt().createElement("div",{style:qG(qG({},h),{width:this.state.cropSize.width,height:this.state.cropSize.height}),"data-testid":"cropper",className:rJ("reactEasyCrop_CropArea","round"===d&&"reactEasyCrop_CropAreaRound",p&&"reactEasyCrop_CropAreaGrid",y)}))},t.defaultProps={zoom:1,rotation:0,aspect:4/3,maxZoom:3,minZoom:1,cropShape:"rect",objectFit:"contain",showGrid:!0,style:{},classes:{},mediaProps:{},zoomSpeed:1,restrictPosition:!0,zoomWithScroll:!0},t.getMousePoint=function(e){return{x:Number(e.clientX),y:Number(e.clientY)}},t.getTouchPoint=function(e){return{x:Number(e.clientX),y:Number(e.clientY)}},t}(nt().Component),aJ={position:"bottom right",isAlternate:!0};function iJ(e,t){const n=function({url:e,naturalWidth:t,naturalHeight:n}){const[r,o]=(0,tt.useState)(),[a,i]=(0,tt.useState)(),[s,l]=(0,tt.useState)({x:0,y:0}),[c,u]=(0,tt.useState)(),[d,p]=(0,tt.useState)(),[m,f]=(0,tt.useState)(),[h,g]=(0,tt.useState)(),b=(0,tt.useCallback)((()=>{l({x:0,y:0}),u(100),p(0),f(t/n),g(t/n)}),[t,n,l,u,p,f,g]),v=(0,tt.useCallback)((()=>{const r=(d+90)%360;let a=t/n;if(d%180==90&&(a=n/t),0===r)return o(),p(r),f(1/m),void l({x:-s.y*a,y:s.x*a});const i=new window.Image;i.src=e,i.onload=function(e){const t=document.createElement("canvas");let n=0,i=0;r%180?(t.width=e.target.height,t.height=e.target.width):(t.width=e.target.width,t.height=e.target.height),90!==r&&180!==r||(n=t.width),270!==r&&180!==r||(i=t.height);const c=t.getContext("2d");c.translate(n,i),c.rotate(r*Math.PI/180),c.drawImage(e.target,0,0),t.toBlob((e=>{o(URL.createObjectURL(e)),p(r),f(1/m),l({x:-s.y*a,y:s.x*a})}))};const c=Fn("media.crossOrigin",void 0,e);"string"==typeof c&&(i.crossOrigin=c)}),[d,t,n,o,p,f,l]);return(0,tt.useMemo)((()=>({editedUrl:r,setEditedUrl:o,crop:a,setCrop:i,position:s,setPosition:l,zoom:c,setZoom:u,rotation:d,setRotation:p,rotateClockwise:v,aspect:m,setAspect:f,defaultAspect:h,initializeTransformValues:b})),[r,o,a,i,s,l,c,u,d,p,v,m,f,h,b])}(e),{initializeTransformValues:r}=n;return(0,tt.useEffect)((()=>{t&&r()}),[t,r]),n}const sJ=(0,tt.createContext)({}),lJ=()=>(0,tt.useContext)(sJ);function cJ({id:e,url:t,naturalWidth:n,naturalHeight:r,isEditing:o,onFinishEditing:a,onSaveImage:i,children:s}){const l=iJ({url:t,naturalWidth:n,naturalHeight:r},o),c=function({crop:e,rotation:t,height:n,width:r,aspect:o,url:a,id:i,onSaveImage:s,onFinishEditing:l}){const{createErrorNotice:c}=ld(UI),[u,d]=(0,tt.useState)(!1),p=(0,tt.useCallback)((()=>{d(!1),l()}),[d,l]),m=(0,tt.useCallback)((()=>{d(!0);let u={};(e.width<99.9||e.height<99.9)&&(u=e),t>0&&(u.rotation=t),u.src=a,ec({path:`/wp/v2/media/${i}/edit`,method:"POST",data:u}).then((e=>{s({id:e.id,url:e.source_url,height:n&&r?r/o:void 0})})).catch((e=>{c(pn(er("Could not edit image. %s"),e.message),{id:"image-editing-error",type:"snackbar"})})).finally((()=>{d(!1),l()}))}),[d,e,t,n,r,o,a,s,c,d,l]);return(0,tt.useMemo)((()=>({isInProgress:u,apply:m,cancel:p})),[u,m,p])}({id:e,url:t,onSaveImage:i,onFinishEditing:a,...l}),u=(0,tt.useMemo)((()=>({...l,...c})),[l,c]);return(0,tt.createElement)(sJ.Provider,{value:u},s)}function uJ({url:e,width:t,height:n,clientWidth:r,naturalHeight:o,naturalWidth:a}){const{isInProgress:i,editedUrl:s,position:l,zoom:c,aspect:u,setPosition:d,setCrop:p,setZoom:m,rotation:f}=lJ();let h=n||r*o/a;return f%180==90&&(h=r*a/o),(0,tt.createElement)("div",{className:so()("wp-block-image__crop-area",{"is-applying":i}),style:{width:t||r,height:h}},(0,tt.createElement)(oJ,{image:s||e,disabled:i,minZoom:1,maxZoom:3,crop:l,zoom:c/100,aspect:u,onCropChange:d,onCropComplete:e=>{p(e)},onZoomChange:e=>{m(100*e)}}),i&&(0,tt.createElement)(cq,null))}function dJ(){const{isInProgress:e,zoom:t,setZoom:n}=lJ();return(0,tt.createElement)(Xg,{contentClassName:"wp-block-image__zoom",popoverProps:aJ,renderToggle:({isOpen:t,onToggle:n})=>(0,tt.createElement)(jg,{icon:bP,label:er("Zoom"),onClick:n,"aria-expanded":t,disabled:e}),renderContent:()=>(0,tt.createElement)(rT,{label:er("Zoom"),min:100,max:300,value:Math.round(t),onChange:n})})}const pJ=(0,tt.createElement)(mo,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,tt.createElement)(uo,{d:"M18.5 5.5h-13c-1.1 0-2 .9-2 2v9c0 1.1.9 2 2 2h13c1.1 0 2-.9 2-2v-9c0-1.1-.9-2-2-2zm.5 11c0 .3-.2.5-.5.5h-13c-.3 0-.5-.2-.5-.5v-9c0-.3.2-.5.5-.5h13c.3 0 .5.2.5.5v9zM6.5 12H8v-2h2V8.5H6.5V12zm9.5 2h-2v1.5h3.5V12H16v2z"}));function mJ({aspectRatios:e,isDisabled:t,label:n,onClick:r,value:o}){return(0,tt.createElement)(ON,{label:n},e.map((({title:e,aspect:n})=>(0,tt.createElement)(zB,{key:n,disabled:t,onClick:()=>{r(n)},role:"menuitemradio",isSelected:n===o,icon:n===o?kS:void 0},e))))}function fJ({toggleProps:e}){const{isInProgress:t,aspect:n,setAspect:r,defaultAspect:o}=lJ();return(0,tt.createElement)(Zg,{icon:pJ,label:er("Aspect Ratio"),popoverProps:aJ,toggleProps:e,className:"wp-block-image__aspect-ratio"},(({onClose:e})=>(0,tt.createElement)(tt.Fragment,null,(0,tt.createElement)(mJ,{isDisabled:t,onClick:t=>{r(t),e()},value:n,aspectRatios:[{title:er("Original"),aspect:o},{title:er("Square"),aspect:1}]}),(0,tt.createElement)(mJ,{label:er("Landscape"),isDisabled:t,onClick:t=>{r(t),e()},value:n,aspectRatios:[{title:er("16:10"),aspect:1.6},{title:er("16:9"),aspect:16/9},{title:er("4:3"),aspect:4/3},{title:er("3:2"),aspect:1.5}]}),(0,tt.createElement)(mJ,{label:er("Portrait"),isDisabled:t,onClick:t=>{r(t),e()},value:n,aspectRatios:[{title:er("10:16"),aspect:.625},{title:er("9:16"),aspect:9/16},{title:er("3:4"),aspect:3/4},{title:er("2:3"),aspect:2/3}]}))))}const hJ=(0,tt.createElement)(mo,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,tt.createElement)(uo,{d:"M15.1 4.8l-3-2.5V4c-4.4 0-8 3.6-8 8 0 3.7 2.5 6.9 6 7.7.3.1.6.1 1 .2l.2-1.5c-.4 0-.7-.1-1.1-.2l-.1.2v-.2c-2.6-.8-4.5-3.3-4.5-6.2 0-3.6 2.9-6.5 6.5-6.5v1.8l3-2.5zM20 11c-.2-1.4-.7-2.7-1.6-3.8l-1.2.8c.7.9 1.1 2 1.3 3.1L20 11zm-1.5 1.8c-.1.5-.2 1.1-.4 1.6s-.5 1-.8 1.5l1.2.9c.4-.5.8-1.1 1-1.8s.5-1.3.5-2l-1.5-.2zm-5.6 5.6l.2 1.5c1.4-.2 2.7-.7 3.8-1.6l-.9-1.1c-.9.7-2 1.1-3.1 1.2z"}));function gJ(){const{isInProgress:e,rotateClockwise:t}=lJ();return(0,tt.createElement)(jg,{icon:hJ,label:er("Rotate"),onClick:t,disabled:e})}function bJ(){const{isInProgress:e,apply:t,cancel:n}=lJ();return(0,tt.createElement)(tt.Fragment,null,(0,tt.createElement)(jg,{onClick:t,disabled:e},er("Apply")),(0,tt.createElement)(jg,{onClick:n},er("Cancel")))}function vJ({url:e,width:t,height:n,clientWidth:r,naturalHeight:o,naturalWidth:a}){return(0,tt.createElement)(tt.Fragment,null,(0,tt.createElement)(uJ,{url:e,width:t,height:n,clientWidth:r,naturalHeight:o,naturalWidth:a}),(0,tt.createElement)(lk,null,(0,tt.createElement)(tb,null,(0,tt.createElement)(dJ,null),(0,tt.createElement)(Hg,null,(e=>(0,tt.createElement)(fJ,{toggleProps:e}))),(0,tt.createElement)(gJ,null)),(0,tt.createElement)(tb,null,(0,tt.createElement)(bJ,null))))}const yJ=20,_J="none",MJ="media",kJ="attachment",wJ="custom",EJ=["image"];function LJ({temporaryURL:e,attributes:{url:t="",alt:n,caption:r,align:o,id:a,href:i,rel:s,linkClass:l,linkDestination:c,title:u,width:d,height:p,linkTarget:m,sizeSlug:f},setAttributes:h,isSelected:g,insertBlocksAfter:b,onReplace:v,onSelectImage:y,onSelectURL:_,onUploadError:M,containerRef:k,clientId:w}){const E=(0,tt.useRef)(),L=AG(t),{image:A,multiImageSelection:S}=Tl((e=>{const{getMedia:t}=e(yd),{getMultiSelectedBlockClientIds:n,getBlockName:r}=e(nk),o=n();return{image:a&&g?t(a):null,multiImageSelection:o.length&&o.every((e=>"core/image"===r(e)))}}),[a,g]),{canInsertCover:C,getBlock:T,imageEditing:x,imageSizes:z,maxWidth:O,mediaUpload:N}=Tl((e=>{const{getBlock:t,getBlockRootClientId:n,getBlockTransformItems:r,getSettings:o}=e(nk),a=r([t(w)],n(w));return{...(0,at.pick)(o(),["imageEditing","imageSizes","maxWidth","mediaUpload"]),getBlock:t,canInsertCover:(null==a?void 0:a.length)&&!!a.find((({name:e})=>"core/cover"===e))}}),[w]),{replaceBlocks:D,toggleSelection:B}=ld(nk),{createErrorNotice:I,createSuccessNotice:P}=ld(UI),R=Jp("medium"),Y=(0,at.includes)(["wide","full"],o),[{naturalWidth:W,naturalHeight:H},q]=(0,tt.useState)({}),[j,F]=(0,tt.useState)(!1),[V,X]=(0,tt.useState)(),U=WG(k,[o]),$=!Y&&R,K=(0,at.map)((0,at.filter)(z,(({slug:e})=>(0,at.get)(A,["media_details","sizes",e,"source_url"]))),(({name:e,slug:t})=>({value:t,label:e})));(0,tt.useEffect)((()=>{AJ(a,t)&&g&&!V&&window.fetch(t).then((e=>e.blob())).then((e=>X(e))).catch((()=>{}))}),[a,t,g,V]),(0,tt.useEffect)((()=>{t&&!L&&g&&E.current.focus()}),[t,L]),(0,tt.useEffect)((()=>{g||F(!1)}),[g]);const G=a&&W&&H&&x,J=!S&&G&&!j;const Q=(0,tt.createElement)(tt.Fragment,null,(0,tt.createElement)(lk,{group:"block"},(0,tt.createElement)(uA,{value:o,onChange:function(e){const t=["wide","full"].includes(e)?{width:void 0,height:void 0}:{};h({...t,align:e})}}),!S&&!j&&(0,tt.createElement)(qj,{url:i||"",onChangeUrl:function(e){h(e)},linkDestination:c,mediaUrl:A&&A.source_url||t,mediaLink:A&&A.link,linkTarget:m,linkClass:l,rel:s}),J&&(0,tt.createElement)(jg,{onClick:()=>F(!0),icon:CG,label:er("Crop")}),V&&(0,tt.createElement)(jg,{onClick:function(){N({filesList:[V],onFileChange([e]){y(e),Qs(e.url)||(X(),P(er("Image uploaded."),{type:"snackbar"}))},allowedTypes:EJ,onError(e){I(e,{type:"snackbar"})}})},icon:$q,label:er("Upload external image")}),!S&&C&&(0,tt.createElement)(jg,{icon:TG,label:er("Add text over image"),onClick:function(){D(w,Jo(T(w),"core/cover"))}})),!S&&!j&&(0,tt.createElement)(lk,{group:"other"},(0,tt.createElement)(Jq,{mediaId:a,mediaURL:t,allowedTypes:EJ,accept:"image/*",onSelect:y,onSelectURL:_,onError:M})),(0,tt.createElement)(FA,null,(0,tt.createElement)(BA,{title:er("Image settings")},!S&&(0,tt.createElement)(XK,{label:er("Alt text (alternative text)"),value:n,onChange:function(e){h({alt:e})},help:(0,tt.createElement)(tt.Fragment,null,(0,tt.createElement)(CA,{href:"https://www.w3.org/WAI/tutorials/images/decision-tree"},er("Describe the purpose of the image")),er("Leave empty if the image is purely decorative."))}),(0,tt.createElement)(qH,{onChangeImage:function(e){const t=(0,at.get)(A,["media_details","sizes",e,"source_url"]);if(!t)return null;h({url:t,width:void 0,height:void 0,sizeSlug:e})},onChange:e=>h(e),slug:f,width:d,height:p,imageSizeOptions:K,isResizable:$,imageWidth:W,imageHeight:H}))),(0,tt.createElement)(WA,null,(0,tt.createElement)(LA,{label:er("Title attribute"),value:u||"",onChange:function(e){h({title:e})},help:(0,tt.createElement)(tt.Fragment,null,er("Describe the role of this image on the page."),(0,tt.createElement)(CA,{href:"https://www.w3.org/TR/html52/dom.html#the-title-attribute"},er("(Note: many devices and browsers do not display this text.)")))}))),Z=function(e){const t=SG(e);if(t)return(0,at.last)(t.split("/"))}(t);let ee;ee=n||(Z?pn(er("This image has an empty alt attribute; its file name is %s"),Z):er("This image has an empty alt attribute"));let te,ne,re=(0,tt.createElement)(tt.Fragment,null,(0,tt.createElement)("img",{src:e||t,alt:ee,onError:()=>function(){const e=IG({attributes:{url:t}});void 0!==e&&v(e)}(),onLoad:e=>{q((0,at.pick)(e.target,["naturalWidth","naturalHeight"]))}}),e&&(0,tt.createElement)(cq,null));if(U&&W&&H){const e=W>U,t=H/W;te=e?U:W,ne=e?U*t:H}if(G&&j)re=(0,tt.createElement)(vJ,{url:t,width:d,height:p,clientWidth:U,naturalHeight:H,naturalWidth:W});else if($&&te){const e=d||te,t=p||ne,n=W/H,r=W{B(!0),h({width:parseInt(e+a.width,10),height:parseInt(t+a.height,10)})}},re)}else re=(0,tt.createElement)("div",{style:{width:d,height:p}},re);return(0,tt.createElement)(cJ,{id:a,url:t,naturalWidth:W,naturalHeight:H,clientWidth:U,onSaveImage:e=>h(e),isEditing:j,onFinishEditing:()=>F(!1)},!e&&Q,re,(!Cj.isEmpty(r)||g)&&(0,tt.createElement)(Cj,{ref:E,tagName:"figcaption","aria-label":er("Image caption text"),placeholder:er("Add caption"),value:r,onChange:e=>h({caption:e}),inlineToolbar:!0,__unstableOnSplitAtEnd:()=>b(Ho("core/paragraph"))}))}const AJ=(e,t)=>t&&!e&&!Qs(t);const SJ=WK((function({attributes:e,setAttributes:t,isSelected:n,className:r,noticeUI:o,insertBlocksAfter:a,noticeOperations:i,onReplace:s,clientId:l}){const{url:c="",alt:u,caption:d,align:p,id:m,width:f,height:h,sizeSlug:g}=e,[b,v]=(0,tt.useState)(),y=(0,tt.useRef)();(0,tt.useEffect)((()=>{y.current=u}),[u]);const _=(0,tt.useRef)();(0,tt.useEffect)((()=>{_.current=d}),[d]);const M=(0,tt.useRef)(),{imageDefaultSize:k,mediaUpload:w}=Tl((e=>{const{getSettings:t}=e(nk);return(0,at.pick)(t(),["imageDefaultSize","mediaUpload"])}),[]);function E(e){i.removeAllNotices(),i.createErrorNotice(e)}function L(n){var r,o,a,i,s;if(!n||!n.url)return void t({url:void 0,alt:void 0,id:void 0,title:void 0,caption:void 0});if(Qs(n.url))return void v(n.url);v();let l,u=((e,t)=>{const n=(0,at.pick)(e,["alt","id","link","caption"]);return n.url=(0,at.get)(e,["sizes",t,"url"])||(0,at.get)(e,["media_details","sizes",t,"source_url"])||e.url,n})(n,k);var d,p;_.current&&!(0,at.get)(u,["caption"])&&(u=(0,at.omit)(u,["caption"])),l=n.id&&n.id===m?{url:c}:{width:void 0,height:void 0,sizeSlug:(d=n,p=k,(0,at.has)(d,["sizes",p,"url"])||(0,at.has)(d,["media_details","sizes",p,"source_url"])?k:"full")};let f,h=e.linkDestination;if(!h)switch((null===(r=wp)||void 0===r||null===(o=r.media)||void 0===o||null===(a=o.view)||void 0===a||null===(i=a.settings)||void 0===i||null===(s=i.defaultProps)||void 0===s?void 0:s.link)||_J){case"file":case MJ:h=MJ;break;case"post":case kJ:h=kJ;break;case wJ:h=wJ;break;case _J:h=_J}switch(h){case MJ:f=n.url;break;case kJ:f=n.link}u.href=f,t({...u,...l,linkDestination:h})}function A(e){e!==c&&t({url:e,id:void 0,width:void 0,height:void 0,sizeSlug:k})}const S=((e,t)=>!e&&Qs(t))(m,c);(0,tt.useEffect)((()=>{if(!S)return;const e=Gs(c);e&&w({filesList:[e],onFileChange:([e])=>{L(e)},allowedTypes:EJ,onError:e=>{i.createErrorNotice(e),t({src:void 0,id:void 0,url:void 0})}})}),[]),(0,tt.useEffect)((()=>{if(b)return()=>{Js(b)}}),[b]);const C=AJ(m,c)?c:void 0,T=!!c&&(0,tt.createElement)("img",{alt:er("Edit image"),title:er("Edit image"),className:"edit-image-preview",src:c}),x=VR({ref:M,className:so()(r,{"is-transient":b,"is-resized":!!f||!!h,[`size-${g}`]:g})});return(0,tt.createElement)("figure",x,(b||c)&&(0,tt.createElement)(LJ,{temporaryURL:b,attributes:e,setAttributes:t,isSelected:n,insertBlocksAfter:a,onReplace:s,onSelectImage:L,onSelectURL:A,onUploadError:E,containerRef:M,clientId:l}),!c&&(0,tt.createElement)(lk,{group:"block"},(0,tt.createElement)(uA,{value:p,onChange:function(e){const n=["wide","full"].includes(e)?{width:void 0,height:void 0}:{};t({...n,align:e})}})),(0,tt.createElement)(oj,{icon:(0,tt.createElement)(MB,{icon:PK}),onSelect:L,onSelectURL:A,notices:o,onError:E,accept:"image/*",allowedTypes:EJ,value:{id:m,src:C},mediaPreview:T,disableMediaButtons:b||c}))}));function CJ(e,t){const{body:n}=document.implementation.createHTMLDocument("");n.innerHTML=e;const{firstElementChild:r}=n;if(r&&"A"===r.nodeName)return r.getAttribute(t)||void 0}const TJ={img:{attributes:["src","alt","title"],classes:["alignleft","aligncenter","alignright","alignnone",/^wp-image-\d+$/]}},xJ={from:[{type:"raw",isMatch:e=>"FIGURE"===e.nodeName&&!!e.querySelector("img"),schema:({phrasingContentSchema:e})=>({figure:{require:["img"],children:{...TJ,a:{attributes:["href","rel","target"],children:TJ},figcaption:{children:e}}}}),transform:e=>{const t=e.className+" "+e.querySelector("img").className,n=/(?:^|\s)align(left|center|right)(?:$|\s)/.exec(t),r=""===e.id?void 0:e.id,o=n?n[1]:void 0,a=/(?:^|\s)wp-image-(\d+)(?:$|\s)/.exec(t),i=a?Number(a[1]):void 0,s=e.querySelector("a"),l=s&&s.href?"custom":void 0,c=s&&s.href?s.href:void 0,u=s&&s.rel?s.rel:void 0,d=s&&s.className?s.className:void 0;return Ho("core/image",Gi("core/image",e.outerHTML,{align:o,id:i,linkDestination:l,href:c,rel:u,linkClass:d,anchor:r}))}},{type:"files",isMatch:e=>1===e.length&&0===e[0].type.indexOf("image/"),transform:e=>Ho("core/image",{url:Ks(e[0])})},{type:"shortcode",tag:"caption",attributes:{url:{type:"string",source:"attribute",attribute:"src",selector:"img"},alt:{type:"string",source:"attribute",attribute:"alt",selector:"img"},caption:{shortcode:function(e,{shortcode:t}){const{body:n}=document.implementation.createHTMLDocument("");n.innerHTML=t.content;let r=n.querySelector("img");for(;r&&r.parentNode&&r.parentNode!==n;)r=r.parentNode;return r&&r.parentNode.removeChild(r),n.innerHTML.trim()}},href:{shortcode:(e,{shortcode:t})=>CJ(t.content,"href")},rel:{shortcode:(e,{shortcode:t})=>CJ(t.content,"rel")},linkClass:{shortcode:(e,{shortcode:t})=>CJ(t.content,"class")},id:{type:"number",shortcode:({named:{id:e}})=>{if(e)return parseInt(e.replace("attachment_",""),10)}},align:{type:"string",shortcode:({named:{align:e="alignnone"}})=>e.replace("align","")}}}]},zJ={apiVersion:2,name:"core/image",title:"Image",category:"media",description:"Insert an image to make a visual statement.",keywords:["img","photo","picture"],textdomain:"default",attributes:{align:{type:"string"},url:{type:"string",source:"attribute",selector:"img",attribute:"src"},alt:{type:"string",source:"attribute",selector:"img",attribute:"alt",default:""},caption:{type:"string",source:"html",selector:"figcaption"},title:{type:"string",source:"attribute",selector:"img",attribute:"title"},href:{type:"string",source:"attribute",selector:"figure > a",attribute:"href"},rel:{type:"string",source:"attribute",selector:"figure > a",attribute:"rel"},linkClass:{type:"string",source:"attribute",selector:"figure > a",attribute:"class"},id:{type:"number"},width:{type:"number"},height:{type:"number"},sizeSlug:{type:"string"},linkDestination:{type:"string"},linkTarget:{type:"string",source:"attribute",selector:"figure > a",attribute:"target"}},supports:{anchor:!0,color:{__experimentalDuotone:"img",text:!1,background:!1},__experimentalBorder:{radius:!0}},styles:[{name:"default",label:"Default",isDefault:!0},{name:"rounded",label:"Rounded"}],editorStyle:"wp-block-image-editor",style:"wp-block-image"},{name:OJ}=zJ,NJ={icon:PK,example:{attributes:{sizeSlug:"large",url:"https://s.w.org/images/core/5.3/MtBlanc1.jpg",caption:er("Mont Blanc appears—still, snowy, and serene.")}},__experimentalLabel(e,{context:t}){if("accessibility"===t){const{caption:t,alt:n,url:r}=e;return r?n?n+(t?". "+t:""):t||"":er("Empty")}},getEditWrapperProps:e=>({"data-align":e.align}),transforms:xJ,edit:SJ,save:function({attributes:e}){const{url:t,alt:n,caption:r,align:o,href:a,rel:i,linkClass:s,width:l,height:c,id:u,linkTarget:d,sizeSlug:p,title:m}=e,f=(0,at.isEmpty)(i)?void 0:i,h=so()({[`align${o}`]:o,[`size-${p}`]:p,"is-resized":l||c}),g=(0,tt.createElement)("img",{src:t,alt:n,className:u?`wp-image-${u}`:null,width:l,height:c,title:m}),b=(0,tt.createElement)(tt.Fragment,null,a?(0,tt.createElement)("a",{className:s,href:a,target:d,rel:f},g):g,!Cj.isEmpty(r)&&(0,tt.createElement)(Cj.Content,{tagName:"figcaption",value:r}));return"left"===o||"right"===o||"center"===o?(0,tt.createElement)("div",VR.save(),(0,tt.createElement)("figure",{className:h},b)):(0,tt.createElement)("figure",VR.save({className:h}),b)},deprecated:YK},DJ=(0,tt.createElement)(mo,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,tt.createElement)(uo,{d:"M6.2 5.2v13.4l5.8-4.8 5.8 4.8V5.2z"})),BJ={className:!1,anchor:!0},IJ={align:{type:"string"},content:{type:"string",source:"html",selector:"h1,h2,h3,h4,h5,h6",default:""},level:{type:"number",default:2},placeholder:{type:"string"}},PJ=e=>{if(!e.customTextColor)return e;const t={color:{text:e.customTextColor}};return{...(0,at.omit)(e,["customTextColor"]),style:t}},RJ=["left","right","center"],YJ=e=>{const{align:t,...n}=e;return RJ.includes(t)?{...n,textAlign:t}:e},WJ=[{supports:{align:["wide","full"],anchor:!0,className:!1,color:{link:!0},fontSize:!0,lineHeight:!0,__experimentalSelector:{"core/heading/h1":"h1","core/heading/h2":"h2","core/heading/h3":"h3","core/heading/h4":"h4","core/heading/h5":"h5","core/heading/h6":"h6"},__unstablePasteTextInline:!0},attributes:IJ,isEligible:({align:e})=>RJ.includes(e),migrate:YJ,save({attributes:e}){const{align:t,content:n,level:r}=e,o="h"+r,a=so()({[`has-text-align-${t}`]:t});return(0,tt.createElement)(o,VR.save({className:a}),(0,tt.createElement)(Cj.Content,{value:n}))}},{supports:BJ,attributes:{...IJ,customTextColor:{type:"string"},textColor:{type:"string"}},migrate:e=>PJ(YJ(e)),save({attributes:e}){const{align:t,content:n,customTextColor:r,level:o,textColor:a}=e,i="h"+o,s=mC("color",a),l=so()({[s]:s,"has-text-color":a||r,[`has-text-align-${t}`]:t});return(0,tt.createElement)(Cj.Content,{className:l||void 0,tagName:i,style:{color:s?void 0:r},value:n})}},{attributes:{...IJ,customTextColor:{type:"string"},textColor:{type:"string"}},migrate:e=>PJ(YJ(e)),save({attributes:e}){const{align:t,content:n,customTextColor:r,level:o,textColor:a}=e,i="h"+o,s=mC("color",a),l=so()({[s]:s,[`has-text-align-${t}`]:t});return(0,tt.createElement)(Cj.Content,{className:l||void 0,tagName:i,style:{color:s?void 0:r},value:n})},supports:BJ},{supports:BJ,attributes:{...IJ,customTextColor:{type:"string"},textColor:{type:"string"}},migrate:e=>PJ(YJ(e)),save({attributes:e}){const{align:t,level:n,content:r,textColor:o,customTextColor:a}=e,i="h"+n,s=mC("color",o),l=so()({[s]:s});return(0,tt.createElement)(Cj.Content,{className:l||void 0,tagName:i,style:{textAlign:t,color:s?void 0:a},value:r})}}];function HJ({level:e,isPressed:t=!1}){const n={1:"M9 5h2v10H9v-4H5v4H3V5h2v4h4V5zm6.6 0c-.6.9-1.5 1.7-2.6 2v1h2v7h2V5h-1.4z",2:"M7 5h2v10H7v-4H3v4H1V5h2v4h4V5zm8 8c.5-.4.6-.6 1.1-1.1.4-.4.8-.8 1.2-1.3.3-.4.6-.8.9-1.3.2-.4.3-.8.3-1.3 0-.4-.1-.9-.3-1.3-.2-.4-.4-.7-.8-1-.3-.3-.7-.5-1.2-.6-.5-.2-1-.2-1.5-.2-.4 0-.7 0-1.1.1-.3.1-.7.2-1 .3-.3.1-.6.3-.9.5-.3.2-.6.4-.8.7l1.2 1.2c.3-.3.6-.5 1-.7.4-.2.7-.3 1.2-.3s.9.1 1.3.4c.3.3.5.7.5 1.1 0 .4-.1.8-.4 1.1-.3.5-.6.9-1 1.2-.4.4-1 .9-1.6 1.4-.6.5-1.4 1.1-2.2 1.6V15h8v-2H15z",3:"M12.1 12.2c.4.3.8.5 1.2.7.4.2.9.3 1.4.3.5 0 1-.1 1.4-.3.3-.1.5-.5.5-.8 0-.2 0-.4-.1-.6-.1-.2-.3-.3-.5-.4-.3-.1-.7-.2-1-.3-.5-.1-1-.1-1.5-.1V9.1c.7.1 1.5-.1 2.2-.4.4-.2.6-.5.6-.9 0-.3-.1-.6-.4-.8-.3-.2-.7-.3-1.1-.3-.4 0-.8.1-1.1.3-.4.2-.7.4-1.1.6l-1.2-1.4c.5-.4 1.1-.7 1.6-.9.5-.2 1.2-.3 1.8-.3.5 0 1 .1 1.6.2.4.1.8.3 1.2.5.3.2.6.5.8.8.2.3.3.7.3 1.1 0 .5-.2.9-.5 1.3-.4.4-.9.7-1.5.9v.1c.6.1 1.2.4 1.6.8.4.4.7.9.7 1.5 0 .4-.1.8-.3 1.2-.2.4-.5.7-.9.9-.4.3-.9.4-1.3.5-.5.1-1 .2-1.6.2-.8 0-1.6-.1-2.3-.4-.6-.2-1.1-.6-1.6-1l1.1-1.4zM7 9H3V5H1v10h2v-4h4v4h2V5H7v4z",4:"M9 15H7v-4H3v4H1V5h2v4h4V5h2v10zm10-2h-1v2h-2v-2h-5v-2l4-6h3v6h1v2zm-3-2V7l-2.8 4H16z",5:"M12.1 12.2c.4.3.7.5 1.1.7.4.2.9.3 1.3.3.5 0 1-.1 1.4-.4.4-.3.6-.7.6-1.1 0-.4-.2-.9-.6-1.1-.4-.3-.9-.4-1.4-.4H14c-.1 0-.3 0-.4.1l-.4.1-.5.2-1-.6.3-5h6.4v1.9h-4.3L14 8.8c.2-.1.5-.1.7-.2.2 0 .5-.1.7-.1.5 0 .9.1 1.4.2.4.1.8.3 1.1.6.3.2.6.6.8.9.2.4.3.9.3 1.4 0 .5-.1 1-.3 1.4-.2.4-.5.8-.9 1.1-.4.3-.8.5-1.3.7-.5.2-1 .3-1.5.3-.8 0-1.6-.1-2.3-.4-.6-.2-1.1-.6-1.6-1-.1-.1 1-1.5 1-1.5zM9 15H7v-4H3v4H1V5h2v4h4V5h2v10z",6:"M9 15H7v-4H3v4H1V5h2v4h4V5h2v10zm8.6-7.5c-.2-.2-.5-.4-.8-.5-.6-.2-1.3-.2-1.9 0-.3.1-.6.3-.8.5l-.6.9c-.2.5-.2.9-.2 1.4.4-.3.8-.6 1.2-.8.4-.2.8-.3 1.3-.3.4 0 .8 0 1.2.2.4.1.7.3 1 .6.3.3.5.6.7.9.2.4.3.8.3 1.3s-.1.9-.3 1.4c-.2.4-.5.7-.8 1-.4.3-.8.5-1.2.6-1 .3-2 .3-3 0-.5-.2-1-.5-1.4-.9-.4-.4-.8-.9-1-1.5-.2-.6-.3-1.3-.3-2.1s.1-1.6.4-2.3c.2-.6.6-1.2 1-1.6.4-.4.9-.7 1.4-.9.6-.3 1.1-.4 1.7-.4.7 0 1.4.1 2 .3.5.2 1 .5 1.4.8 0 .1-1.3 1.4-1.3 1.4zm-2.4 5.8c.2 0 .4 0 .6-.1.2 0 .4-.1.5-.2.1-.1.3-.3.4-.5.1-.2.1-.5.1-.7 0-.4-.1-.8-.4-1.1-.3-.2-.7-.3-1.1-.3-.3 0-.7.1-1 .2-.4.2-.7.4-1 .7 0 .3.1.7.3 1 .1.2.3.4.4.6.2.1.3.3.5.3.2.1.5.2.7.1z"};return n.hasOwnProperty(e)?(0,tt.createElement)(mo,{width:"24",height:"24",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",isPressed:t},(0,tt.createElement)(uo,{d:n[e]})):null}const qJ=[1,2,3,4,5,6],jJ={className:"block-library-heading-level-dropdown",isAlternate:!0};function FJ({selectedLevel:e,onChange:t}){return(0,tt.createElement)(Xg,{popoverProps:jJ,renderToggle:({onToggle:t,isOpen:n})=>(0,tt.createElement)(jg,{"aria-expanded":n,"aria-haspopup":"true",icon:(0,tt.createElement)(HJ,{level:e}),label:er("Change heading level"),onClick:t,onKeyDown:e=>{n||e.keyCode!==lm||(e.preventDefault(),t())},showTooltip:!0}),renderContent:()=>(0,tt.createElement)(vY,{className:"block-library-heading-level-toolbar",label:er("Change heading level")},(0,tt.createElement)(tb,{isCollapsed:!1,controls:qJ.map((n=>{const r=n===e;return{icon:(0,tt.createElement)(HJ,{level:n,isPressed:r}),title:pn(er("Heading %d"),n),isActive:r,onClick(){t(n)}}}))}))})}const VJ=function({attributes:e,setAttributes:t,mergeBlocks:n,onReplace:r,style:o,clientId:a}){const{textAlign:i,content:s,level:l,placeholder:c}=e,u="h"+l,d=VR({className:so()({[`has-text-align-${i}`]:i}),style:o});return(0,tt.createElement)(tt.Fragment,null,(0,tt.createElement)(lk,{group:"block"},(0,tt.createElement)(FJ,{selectedLevel:l,onChange:e=>t({level:e})}),(0,tt.createElement)(gD,{value:i,onChange:e=>{t({textAlign:e})}})),(0,tt.createElement)(Cj,ot({identifier:"content",tagName:u,value:s,onChange:e=>t({content:e}),onMerge:n,onSplit:(t,n)=>{let r;return r=n||t?Ho("core/heading",{...e,content:t}):Ho("core/paragraph"),n&&(r.clientId=a),r},onReplace:r,onRemove:()=>r([]),"aria-label":er("Heading text"),placeholder:c||er("Heading"),textAlign:i},d)))};const{name:XJ}={apiVersion:2,name:"core/heading",title:"Heading",category:"text",description:"Introduce new sections and organize content to help visitors (and search engines) understand the structure of your content.",keywords:["title","subtitle"],textdomain:"default",attributes:{textAlign:{type:"string"},content:{type:"string",source:"html",selector:"h1,h2,h3,h4,h5,h6",default:"",__experimentalRole:"content"},level:{type:"number",default:2},placeholder:{type:"string"}},supports:{align:["wide","full"],anchor:!0,className:!1,color:{link:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontWeight:!0},__experimentalSelector:"h1,h2,h3,h4,h5,h6",__unstablePasteTextInline:!0},editorStyle:"wp-block-heading-editor",style:"wp-block-heading"},UJ={from:[{type:"block",isMultiBlock:!0,blocks:["core/paragraph"],transform:e=>e.map((({content:e,anchor:t})=>Ho(XJ,{content:e,anchor:t})))},{type:"raw",selector:"h1,h2,h3,h4,h5,h6",schema:({phrasingContentSchema:e,isPaste:t})=>{const n={children:e,attributes:t?[]:["style","id"]};return{h1:n,h2:n,h3:n,h4:n,h5:n,h6:n}},transform(e){const t=Gi(XJ,e.outerHTML),{textAlign:n}=e.style||{};var r;return t.level=(r=e.nodeName,Number(r.substr(1))),"left"!==n&&"center"!==n&&"right"!==n||(t.align=n),Ho(XJ,t)}},...[1,2,3,4,5,6].map((e=>({type:"prefix",prefix:Array(e+1).join("#"),transform:t=>Ho(XJ,{level:e,content:t})}))),...[1,2,3,4,5,6].map((e=>({type:"enter",regExp:new RegExp(`^/(h|H)${e}$`),transform:t=>Ho(XJ,{level:e,content:t})})))],to:[{type:"block",isMultiBlock:!0,blocks:["core/paragraph"],transform:e=>e.map((({content:e,anchor:t})=>Ho("core/paragraph",{content:e,anchor:t})))}]},$J={apiVersion:2,name:"core/heading",title:"Heading",category:"text",description:"Introduce new sections and organize content to help visitors (and search engines) understand the structure of your content.",keywords:["title","subtitle"],textdomain:"default",attributes:{textAlign:{type:"string"},content:{type:"string",source:"html",selector:"h1,h2,h3,h4,h5,h6",default:"",__experimentalRole:"content"},level:{type:"number",default:2},placeholder:{type:"string"}},supports:{align:["wide","full"],anchor:!0,className:!1,color:{link:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontWeight:!0},__experimentalSelector:"h1,h2,h3,h4,h5,h6",__unstablePasteTextInline:!0},editorStyle:"wp-block-heading-editor",style:"wp-block-heading"},{name:KJ}=$J,GJ={icon:DJ,example:{attributes:{content:er("Code is Poetry"),level:2}},__experimentalLabel(e,{context:t}){if("accessibility"===t){const{content:t,level:n}=e;return(0,at.isEmpty)(t)?pn(er("Level %s. Empty."),n):pn(er("Level %1$s. %2$s"),n,t)}},transforms:UJ,deprecated:WJ,merge:(e,t)=>({content:(e.content||"")+(t.content||"")}),edit:VJ,save:function({attributes:e}){const{textAlign:t,content:n,level:r}=e,o="h"+r,a=so()({[`has-text-align-${t}`]:t});return(0,tt.createElement)(o,VR.save({className:a}),(0,tt.createElement)(Cj.Content,{value:n}))}},JJ=(0,tt.createElement)(mo,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,tt.createElement)(uo,{d:"M13 6v6h5.2v4c0 .8-.2 1.4-.5 1.7-.6.6-1.6.6-2.5.5h-.3v1.5h.5c1 0 2.3-.1 3.3-1 .6-.6 1-1.6 1-2.8V6H13zm-9 6h5.2v4c0 .8-.2 1.4-.5 1.7-.6.6-1.6.6-2.5.5h-.3v1.5h.5c1 0 2.3-.1 3.3-1 .6-.6 1-1.6 1-2.8V6H4v6z"})),QJ={value:{type:"string",source:"html",selector:"blockquote",multiline:"p",default:""},citation:{type:"string",source:"html",selector:"cite",default:""},align:{type:"string"}},ZJ=[{attributes:QJ,save({attributes:e}){const{align:t,value:n,citation:r}=e;return(0,tt.createElement)("blockquote",{style:{textAlign:t||null}},(0,tt.createElement)(Cj.Content,{multiline:!0,value:n}),!Cj.isEmpty(r)&&(0,tt.createElement)(Cj.Content,{tagName:"cite",value:r}))}},{attributes:{...QJ,style:{type:"number",default:1}},migrate:e=>2===e.style?{...(0,at.omit)(e,["style"]),className:e.className?e.className+" is-style-large":"is-style-large"}:e,save({attributes:e}){const{align:t,value:n,citation:r,style:o}=e;return(0,tt.createElement)("blockquote",{className:2===o?"is-large":"",style:{textAlign:t||null}},(0,tt.createElement)(Cj.Content,{multiline:!0,value:n}),!Cj.isEmpty(r)&&(0,tt.createElement)(Cj.Content,{tagName:"cite",value:r}))}},{attributes:{...QJ,citation:{type:"string",source:"html",selector:"footer",default:""},style:{type:"number",default:1}},save({attributes:e}){const{align:t,value:n,citation:r,style:o}=e;return(0,tt.createElement)("blockquote",{className:`blocks-quote-style-${o}`,style:{textAlign:t||null}},(0,tt.createElement)(Cj.Content,{multiline:!0,value:n}),!Cj.isEmpty(r)&&(0,tt.createElement)(Cj.Content,{tagName:"footer",value:r}))}}],eQ="web"===_b.OS;const tQ={from:[{type:"block",isMultiBlock:!0,blocks:["core/paragraph"],transform:e=>Ho("core/quote",{value:u_({value:Jy(e.map((({content:e})=>Ny({html:e}))),"\u2028"),multilineTag:"p"}),anchor:e.anchor})},{type:"block",blocks:["core/heading"],transform:({content:e,anchor:t})=>Ho("core/quote",{value:`${e}
`,anchor:t})},{type:"block",blocks:["core/pullquote"],transform:({value:e,citation:t,anchor:n})=>Ho("core/quote",{value:e,citation:t,anchor:n})},{type:"prefix",prefix:">",transform:e=>Ho("core/quote",{value:`${e}
`})},{type:"raw",isMatch:e=>{const t=(()=>{let e=!1;return t=>"P"===t.nodeName||(e||"CITE"!==t.nodeName?void 0:(e=!0,!0))})();return"BLOCKQUOTE"===e.nodeName&&Array.from(e.childNodes).every(t)},schema:({phrasingContentSchema:e})=>({blockquote:{children:{p:{children:e},cite:{children:e}}}})}],to:[{type:"block",blocks:["core/paragraph"],transform:({value:e,citation:t})=>{const n=[];return e&&"
"!==e&&n.push(...o_(Ny({html:e,multilineTag:"p"}),"\u2028").map((e=>Ho("core/paragraph",{content:u_({value:e})})))),t&&"
"!==t&&n.push(Ho("core/paragraph",{content:t})),0===n.length?Ho("core/paragraph",{content:""}):n}},{type:"block",blocks:["core/heading"],transform:({value:e,citation:t,...n})=>{if("
"===e)return Ho("core/heading",{content:t});const r=o_(Ny({html:e,multilineTag:"p"}),"\u2028"),o=Ho("core/heading",{content:u_({value:r[0]})});if(!t&&1===r.length)return o;return[o,Ho("core/quote",{...n,citation:t,value:u_({value:r.slice(1).length?Jy(r.slice(1),"\u2028"):Ny(),multilineTag:"p"})})]}},{type:"block",blocks:["core/pullquote"],transform:({value:e,citation:t,anchor:n})=>Ho("core/pullquote",{value:e,citation:t,anchor:n})}]},nQ={apiVersion:2,name:"core/quote",title:"Quote",category:"text",description:'Give quoted text visual emphasis. "In quoting others, we cite ourselves." — Julio Cortázar',keywords:["blockquote","cite"],textdomain:"default",attributes:{value:{type:"string",source:"html",selector:"blockquote",multiline:"p",default:"",__experimentalRole:"content"},citation:{type:"string",source:"html",selector:"cite",default:"",__experimentalRole:"content"},align:{type:"string"}},supports:{anchor:!0},styles:[{name:"default",label:"Default",isDefault:!0},{name:"large",label:"Large"}],editorStyle:"wp-block-quote-editor",style:"wp-block-quote"},{name:rQ}=nQ,oQ={icon:JJ,example:{attributes:{value:""+er("In quoting others, we cite ourselves.")+"
",citation:"Julio Cortázar",className:"is-style-large"}},transforms:tQ,edit:function({attributes:e,setAttributes:t,isSelected:n,mergeBlocks:r,onReplace:o,className:a,insertBlocksAfter:i,style:s}){const{align:l,value:c,citation:u}=e,d=VR({className:so()(a,{[`has-text-align-${l}`]:l}),style:s});return(0,tt.createElement)(tt.Fragment,null,(0,tt.createElement)(lk,{group:"block"},(0,tt.createElement)(gD,{value:l,onChange:e=>{t({align:e})}})),(0,tt.createElement)("blockquote",d,(0,tt.createElement)(Cj,{identifier:"value",multiline:!0,value:c,onChange:e=>t({value:e}),onMerge:r,onRemove:e=>{const t=!u||0===u.length;!e&&t&&o([])},"aria-label":er("Quote text"),placeholder:er("Add quote"),onReplace:o,onSplit:t=>Ho("core/quote",{...e,value:t}),__unstableOnSplitMiddle:()=>Ho("core/paragraph"),textAlign:l}),(!Cj.isEmpty(u)||n)&&(0,tt.createElement)(Cj,{identifier:"citation",tagName:eQ?"cite":void 0,style:{display:"block"},value:u,onChange:e=>t({citation:e}),__unstableMobileNoFocusOnMount:!0,"aria-label":er("Quote citation text"),placeholder:er("Add citation"),className:"wp-block-quote__citation",textAlign:l,__unstableOnSplitAtEnd:()=>i(Ho("core/paragraph"))})))},save:function({attributes:e}){const{align:t,value:n,citation:r}=e,o=so()({[`has-text-align-${t}`]:t});return(0,tt.createElement)("blockquote",VR.save({className:o}),(0,tt.createElement)(Cj.Content,{multiline:!0,value:n}),!Cj.isEmpty(r)&&(0,tt.createElement)(Cj.Content,{tagName:"cite",value:r}))},merge:(e,{value:t,citation:n})=>(n||(n=e.citation),t&&"
"!==t?{...e,value:e.value+t,citation:n}:{...e,citation:n}),deprecated:ZJ},aQ=(0,tt.createElement)(mo,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,tt.createElement)(uo,{d:"M20.2 8v11c0 .7-.6 1.2-1.2 1.2H6v1.5h13c1.5 0 2.7-1.2 2.7-2.8V8h-1.5zM18 16.4V4.6c0-.9-.7-1.6-1.6-1.6H4.6C3.7 3 3 3.7 3 4.6v11.8c0 .9.7 1.6 1.6 1.6h11.8c.9 0 1.6-.7 1.6-1.6zM4.5 4.6c0-.1.1-.1.1-.1h11.8c.1 0 .1.1.1.1V12l-2.3-1.7c-.3-.2-.6-.2-.9 0l-2.9 2.1L8 11.3c-.2-.1-.5-.1-.7 0l-2.9 1.5V4.6zm0 11.8v-1.8l3.2-1.7 2.4 1.2c.2.1.5.1.8-.1l2.8-2 2.8 2v2.5c0 .1-.1.1-.1.1H4.6c0-.1-.1-.2-.1-.2z"}));function iQ(e){return Math.min(3,e.images.length)}const sQ=(e,t="large")=>{const n=(0,at.pick)(e,["alt","id","link","caption"]);n.url=(0,at.get)(e,["sizes",t,"url"])||(0,at.get)(e,["media_details","sizes",t,"source_url"])||e.url;const r=(0,at.get)(e,["sizes","full","url"])||(0,at.get)(e,["media_details","sizes","full","source_url"]);return r&&(n.fullUrl=r),n},lQ=[{attributes:{images:{type:"array",default:[],source:"query",selector:".blocks-gallery-item",query:{url:{type:"string",source:"attribute",selector:"img",attribute:"src"},fullUrl:{type:"string",source:"attribute",selector:"img",attribute:"data-full-url"},link:{type:"string",source:"attribute",selector:"img",attribute:"data-link"},alt:{type:"string",source:"attribute",selector:"img",attribute:"alt",default:""},id:{type:"string",source:"attribute",selector:"img",attribute:"data-id"},caption:{type:"string",source:"html",selector:".blocks-gallery-item__caption"}}},ids:{type:"array",items:{type:"number"},default:[]},columns:{type:"number",minimum:1,maximum:8},caption:{type:"string",source:"html",selector:".blocks-gallery-caption"},imageCrop:{type:"boolean",default:!0},linkTo:{type:"string",default:"none"},sizeSlug:{type:"string",default:"large"}},supports:{align:!0},isEligible:({linkTo:e})=>!e||"attachment"===e||"media"===e,migrate(e){let t=e.linkTo;return e.linkTo?"attachment"===e.linkTo?t="post":"media"===e.linkTo&&(t="file"):t="none",{...e,linkTo:t}},save({attributes:e}){const{images:t,columns:n=iQ(e),imageCrop:r,caption:o,linkTo:a}=e;return(0,tt.createElement)("figure",{className:`columns-${n} ${r?"is-cropped":""}`},(0,tt.createElement)("ul",{className:"blocks-gallery-grid"},t.map((e=>{let t;switch(a){case"media":t=e.fullUrl||e.url;break;case"attachment":t=e.link}const n=(0,tt.createElement)("img",{src:e.url,alt:e.alt,"data-id":e.id,"data-full-url":e.fullUrl,"data-link":e.link,className:e.id?`wp-image-${e.id}`:null});return(0,tt.createElement)("li",{key:e.id||e.url,className:"blocks-gallery-item"},(0,tt.createElement)("figure",null,t?(0,tt.createElement)("a",{href:t},n):n,!Cj.isEmpty(e.caption)&&(0,tt.createElement)(Cj.Content,{tagName:"figcaption",className:"blocks-gallery-item__caption",value:e.caption})))}))),!Cj.isEmpty(o)&&(0,tt.createElement)(Cj.Content,{tagName:"figcaption",className:"blocks-gallery-caption",value:o}))}},{attributes:{images:{type:"array",default:[],source:"query",selector:".blocks-gallery-item",query:{url:{source:"attribute",selector:"img",attribute:"src"},fullUrl:{source:"attribute",selector:"img",attribute:"data-full-url"},link:{source:"attribute",selector:"img",attribute:"data-link"},alt:{source:"attribute",selector:"img",attribute:"alt",default:""},id:{source:"attribute",selector:"img",attribute:"data-id"},caption:{type:"string",source:"html",selector:".blocks-gallery-item__caption"}}},ids:{type:"array",default:[]},columns:{type:"number"},caption:{type:"string",source:"html",selector:".blocks-gallery-caption"},imageCrop:{type:"boolean",default:!0},linkTo:{type:"string",default:"none"}},supports:{align:!0},isEligible:({ids:e})=>e&&e.some((e=>"string"==typeof e)),migrate:e=>({...e,ids:(0,at.map)(e.ids,(e=>{const t=parseInt(e,10);return Number.isInteger(t)?t:null}))}),save({attributes:e}){const{images:t,columns:n=iQ(e),imageCrop:r,caption:o,linkTo:a}=e;return(0,tt.createElement)("figure",{className:`columns-${n} ${r?"is-cropped":""}`},(0,tt.createElement)("ul",{className:"blocks-gallery-grid"},t.map((e=>{let t;switch(a){case"media":t=e.fullUrl||e.url;break;case"attachment":t=e.link}const n=(0,tt.createElement)("img",{src:e.url,alt:e.alt,"data-id":e.id,"data-full-url":e.fullUrl,"data-link":e.link,className:e.id?`wp-image-${e.id}`:null});return(0,tt.createElement)("li",{key:e.id||e.url,className:"blocks-gallery-item"},(0,tt.createElement)("figure",null,t?(0,tt.createElement)("a",{href:t},n):n,!Cj.isEmpty(e.caption)&&(0,tt.createElement)(Cj.Content,{tagName:"figcaption",className:"blocks-gallery-item__caption",value:e.caption})))}))),!Cj.isEmpty(o)&&(0,tt.createElement)(Cj.Content,{tagName:"figcaption",className:"blocks-gallery-caption",value:o}))}},{attributes:{images:{type:"array",default:[],source:"query",selector:"ul.wp-block-gallery .blocks-gallery-item",query:{url:{source:"attribute",selector:"img",attribute:"src"},fullUrl:{source:"attribute",selector:"img",attribute:"data-full-url"},alt:{source:"attribute",selector:"img",attribute:"alt",default:""},id:{source:"attribute",selector:"img",attribute:"data-id"},link:{source:"attribute",selector:"img",attribute:"data-link"},caption:{type:"array",source:"children",selector:"figcaption"}}},ids:{type:"array",default:[]},columns:{type:"number"},imageCrop:{type:"boolean",default:!0},linkTo:{type:"string",default:"none"}},supports:{align:!0},save({attributes:e}){const{images:t,columns:n=iQ(e),imageCrop:r,linkTo:o}=e;return(0,tt.createElement)("ul",{className:`columns-${n} ${r?"is-cropped":""}`},t.map((e=>{let t;switch(o){case"media":t=e.fullUrl||e.url;break;case"attachment":t=e.link}const n=(0,tt.createElement)("img",{src:e.url,alt:e.alt,"data-id":e.id,"data-full-url":e.fullUrl,"data-link":e.link,className:e.id?`wp-image-${e.id}`:null});return(0,tt.createElement)("li",{key:e.id||e.url,className:"blocks-gallery-item"},(0,tt.createElement)("figure",null,t?(0,tt.createElement)("a",{href:t},n):n,e.caption&&e.caption.length>0&&(0,tt.createElement)(Cj.Content,{tagName:"figcaption",value:e.caption})))})))}},{attributes:{images:{type:"array",default:[],source:"query",selector:"ul.wp-block-gallery .blocks-gallery-item",query:{url:{source:"attribute",selector:"img",attribute:"src"},alt:{source:"attribute",selector:"img",attribute:"alt",default:""},id:{source:"attribute",selector:"img",attribute:"data-id"},link:{source:"attribute",selector:"img",attribute:"data-link"},caption:{type:"array",source:"children",selector:"figcaption"}}},columns:{type:"number"},imageCrop:{type:"boolean",default:!0},linkTo:{type:"string",default:"none"}},isEligible:({images:e,ids:t})=>e&&e.length>0&&(!t&&e||t&&e&&t.length!==e.length||(0,at.some)(e,((e,n)=>!e&&null!==t[n]||parseInt(e,10)!==t[n]))),migrate:e=>({...e,ids:(0,at.map)(e.images,(({id:e})=>e?parseInt(e,10):null))}),supports:{align:!0},save({attributes:e}){const{images:t,columns:n=iQ(e),imageCrop:r,linkTo:o}=e;return(0,tt.createElement)("ul",{className:`columns-${n} ${r?"is-cropped":""}`},t.map((e=>{let t;switch(o){case"media":t=e.url;break;case"attachment":t=e.link}const n=(0,tt.createElement)("img",{src:e.url,alt:e.alt,"data-id":e.id,"data-link":e.link,className:e.id?`wp-image-${e.id}`:null});return(0,tt.createElement)("li",{key:e.id||e.url,className:"blocks-gallery-item"},(0,tt.createElement)("figure",null,t?(0,tt.createElement)("a",{href:t},n):n,e.caption&&e.caption.length>0&&(0,tt.createElement)(Cj.Content,{tagName:"figcaption",value:e.caption})))})))}},{attributes:{images:{type:"array",default:[],source:"query",selector:"div.wp-block-gallery figure.blocks-gallery-image img",query:{url:{source:"attribute",attribute:"src"},alt:{source:"attribute",attribute:"alt",default:""},id:{source:"attribute",attribute:"data-id"}}},columns:{type:"number"},imageCrop:{type:"boolean",default:!0},linkTo:{type:"string",default:"none"},align:{type:"string",default:"none"}},supports:{align:!0},save({attributes:e}){const{images:t,columns:n=iQ(e),align:r,imageCrop:o,linkTo:a}=e,i=so()(`columns-${n}`,{alignnone:"none"===r,"is-cropped":o});return(0,tt.createElement)("div",{className:i},t.map((e=>{let t;switch(a){case"media":t=e.url;break;case"attachment":t=e.link}const n=(0,tt.createElement)("img",{src:e.url,alt:e.alt,"data-id":e.id});return(0,tt.createElement)("figure",{key:e.id||e.url,className:"blocks-gallery-image"},t?(0,tt.createElement)("a",{href:t},n):n)})))}}];function cQ(e){return{type:"SET_IS_MATCHING",values:e}}function uQ(e,t){return-1===t.indexOf(" ")&&(t=">= "+t),!!e[t]}const dQ=Jt("core/viewport",{reducer:function(e={},t){switch(t.type){case"SET_IS_MATCHING":return t.values}return e},actions:S,selectors:C});an(dQ);const pQ=e=>ri((t=>JA((n=>{const r=(0,at.mapValues)(e,(e=>{let[t,n]=e.split(" ");return void 0===n&&(n=t,t=">="),Jp(n,t)}));return(0,tt.createElement)(t,ot({},n,r))}))),"withViewportMatch");((e,t)=>{const n=(0,at.debounce)((()=>{const e=(0,at.mapValues)(r,(e=>e.matches));nn(dQ).setIsMatching(e)}),{leading:!0}),r=(0,at.reduce)(e,((e,r,o)=>((0,at.forEach)(t,((t,a)=>{const i=window.matchMedia(`(${t}: ${r}px)`);i.addListener(n);const s=[a,o].join(" ");e[s]=i})),e)),{});window.addEventListener("orientationchange",n),n(),n.flush()})({huge:1440,wide:1280,large:960,medium:782,small:600,mobile:480},{"<":"max-width",">=":"min-width"});const mQ="div",fQ=(0,tt.createElement)(MB,{icon:aQ}),hQ="none",gQ="file",bQ="post";class vQ extends tt.Component{constructor(){super(...arguments),this.onSelectImage=this.onSelectImage.bind(this),this.onRemoveImage=this.onRemoveImage.bind(this),this.bindContainer=this.bindContainer.bind(this),this.onEdit=this.onEdit.bind(this),this.onSelectImageFromLibrary=this.onSelectImageFromLibrary.bind(this),this.onSelectCustomURL=this.onSelectCustomURL.bind(this),this.state={isEditing:!1}}bindContainer(e){this.container=e}onSelectImage(){this.props.isSelected||this.props.onSelect()}onRemoveImage(e){this.container===this.container.ownerDocument.activeElement&&this.props.isSelected&&-1!==[nm,cm].indexOf(e.keyCode)&&(e.preventDefault(),this.props.onRemove())}onEdit(){this.setState({isEditing:!0})}componentDidUpdate(){const{image:e,url:t,__unstableMarkNextChangeAsNotPersistent:n}=this.props;e&&!t&&(n(),this.props.setAttributes({url:e.source_url,alt:e.alt_text}))}deselectOnBlur(){this.props.onDeselect()}onSelectImageFromLibrary(e){const{setAttributes:t,id:n,url:r,alt:o,caption:a,sizeSlug:i}=this.props;if(!e||!e.url)return;let s=sQ(e,i);((e,t)=>!e&&Qs(t))(n,r)&&o&&(s=(0,at.omit)(s,["alt"])),a&&!(0,at.get)(s,["caption"])&&(s=(0,at.omit)(s,["caption"])),t(s),this.setState({isEditing:!1})}onSelectCustomURL(e){const{setAttributes:t,url:n}=this.props;e!==n&&(t({url:e,id:void 0}),this.setState({isEditing:!1}))}render(){const{url:e,alt:t,id:n,linkTo:r,link:o,isFirstItem:a,isLastItem:i,isSelected:s,caption:l,onRemove:c,onMoveForward:u,onMoveBackward:d,setAttributes:p,"aria-label":m}=this.props,{isEditing:f}=this.state;let h;switch(r){case gQ:h=e;break;case bQ:h=o}const g=(0,tt.createElement)(tt.Fragment,null,(0,tt.createElement)("img",{src:e,alt:t,"data-id":n,onKeyDown:this.onRemoveImage,tabIndex:"0","aria-label":m,ref:this.bindContainer}),Qs(e)&&(0,tt.createElement)(cq,null)),b=so()({"is-selected":s,"is-transient":Qs(e)});return(0,tt.createElement)("figure",{className:b,onClick:this.onSelectImage,onFocus:this.onSelectImage},!f&&(h?(0,tt.createElement)("a",{href:h},g):g),f&&(0,tt.createElement)(oj,{labels:{title:er("Edit gallery image")},icon:PK,onSelect:this.onSelectImageFromLibrary,onSelectURL:this.onSelectCustomURL,accept:"image/*",allowedTypes:["image"],value:{id:n,src:e}}),(0,tt.createElement)(GA,{className:"block-library-gallery-item__inline-menu is-left"},(0,tt.createElement)(Eh,{icon:jB,onClick:a?void 0:d,label:er("Move image backward"),"aria-disabled":a,disabled:!s}),(0,tt.createElement)(Eh,{icon:qB,onClick:i?void 0:u,label:er("Move image forward"),"aria-disabled":i,disabled:!s})),(0,tt.createElement)(GA,{className:"block-library-gallery-item__inline-menu is-right"},(0,tt.createElement)(Eh,{icon:Zq,onClick:this.onEdit,label:er("Replace image"),disabled:!s}),(0,tt.createElement)(Eh,{icon:gP,onClick:c,label:er("Remove image"),disabled:!s})),!f&&(s||l)&&(0,tt.createElement)(Cj,{tagName:"figcaption","aria-label":er("Image caption text"),placeholder:s?er("Add caption"):null,value:l,onChange:e=>p({caption:e}),inlineToolbar:!0}))}}const yQ=lS([QI(((e,t)=>{const{getMedia:n}=e(yd),{id:r}=t;return{image:r?n(parseInt(r,10)):null}})),eP((e=>{const{__unstableMarkNextChangeAsNotPersistent:t}=e(nk);return{__unstableMarkNextChangeAsNotPersistent:t}}))])(vQ);function _Q({isHidden:e,...t}){return e?(0,tt.createElement)(kh,ot({as:Cj},t)):(0,tt.createElement)(Cj,t)}const MQ=e=>{const{attributes:t,isSelected:n,setAttributes:r,selectedImage:o,mediaPlaceholder:a,onMoveBackward:i,onMoveForward:s,onRemoveImage:l,onSelectImage:c,onDeselectImage:u,onSetImageAttributes:d,insertBlocksAfter:p,blockProps:m}=e,{align:f,columns:h=iQ(t),caption:g,imageCrop:b,images:v}=t;return(0,tt.createElement)("figure",ot({},m,{className:so()(m.className,{[`align${f}`]:f,[`columns-${h}`]:h,"is-cropped":b})}),(0,tt.createElement)("ul",{className:"blocks-gallery-grid"},v.map(((e,r)=>{const a=pn(er("image %1$d of %2$d in gallery"),r+1,v.length);return(0,tt.createElement)("li",{className:"blocks-gallery-item",key:e.id?`${e.id}-${r}`:e.url},(0,tt.createElement)(yQ,{url:e.url,alt:e.alt,id:e.id,isFirstItem:0===r,isLastItem:r+1===v.length,isSelected:n&&o===r,onMoveBackward:i(r),onMoveForward:s(r),onRemove:l(r),onSelect:c(r),onDeselect:u(r),setAttributes:e=>d(r,e),caption:e.caption,"aria-label":a,sizeSlug:t.sizeSlug}))}))),a,(0,tt.createElement)(_Q,{isHidden:!n&&Cj.isEmpty(g),tagName:"figcaption",className:"blocks-gallery-caption","aria-label":er("Gallery caption text"),placeholder:er("Write gallery caption…"),value:g,onChange:e=>r({caption:e}),inlineToolbar:!0,__unstableOnSplitAtEnd:()=>p(Ho("core/paragraph"))}))},kQ=[{value:bQ,label:er("Attachment Page")},{value:gQ,label:er("Media File")},{value:hQ,label:er("None")}],wQ=["image"],EQ=_b.select({web:er("Drag images, upload new ones or select files from your library."),native:er("ADD MEDIA")}),LQ=_b.select({web:{},native:{type:"stepper"}});const AQ=lS([WK,pQ({isNarrow:"< small"})])((function(e){const{attributes:t,clientId:n,isSelected:r,noticeUI:o,noticeOperations:a,onFocus:i}=e,{columns:s=iQ(t),imageCrop:l,images:c,linkTo:u,sizeSlug:d}=t,[p,m]=(0,tt.useState)(),[f,h]=(0,tt.useState)(),{__unstableMarkNextChangeAsNotPersistent:g}=ld(nk),{imageSizes:b,mediaUpload:v,getMedia:y,wasBlockJustInserted:_}=Tl((e=>{const t=e(nk).getSettings();return{imageSizes:t.imageSizes,mediaUpload:t.mediaUpload,getMedia:e(yd).getMedia,wasBlockJustInserted:e(nk).wasBlockJustInserted(n,"inserter_menu")}})),M=(0,tt.useMemo)((()=>r?(0,at.reduce)(t.ids,((e,t)=>{if(!t)return e;const n=y(t),r=(0,at.reduce)(b,((e,t)=>{const r=(0,at.get)(n,["sizes",t.slug,"url"]),o=(0,at.get)(n,["media_details","sizes",t.slug,"source_url"]);return{...e,[t.slug]:r||o}}),{});return{...e,[parseInt(t,10)]:r}}),{}):{}),[r,t.ids,b]);function k(t){if(t.ids)throw new Error('The "ids" attribute should not be changed directly. It is managed automatically when "images" attribute changes');t.images&&(t={...t,ids:(0,at.map)(t.images,(({id:e})=>parseInt(e,10)))}),e.setAttributes(t)}function w(e,t){const n=[...c];n.splice(t,1,c[e]),n.splice(e,1,c[t]),m(t),k({images:n})}function E(e){const t=(0,at.toString)(e.id),n=(0,at.find)(c,{id:t}),r=n?n.caption:e.caption;if(!f)return r;const o=(0,at.find)(f,{id:t});return o&&o.caption!==e.caption?e.caption:r}function L(e){h(e.map((e=>({id:(0,at.toString)(e.id),caption:e.caption})))),k({images:e.map((e=>({...sQ(e,d),caption:E(e),id:(0,at.toString)(e.id)}))),columns:t.columns?Math.min(e.length,t.columns):t.columns})}(0,tt.useEffect)((()=>{if("web"===_b.OS&&c&&c.length>0&&(0,at.every)(c,(({url:e})=>Qs(e)))){const e=(0,at.map)(c,(({url:e})=>Gs(e)));(0,at.forEach)(c,(({url:e})=>Js(e))),v({filesList:e,onFileChange:L,allowedTypes:["image"]})}}),[]),(0,tt.useEffect)((()=>{r||m()}),[r]),(0,tt.useEffect)((()=>{var e,t,n,r,o,a;u||(g(),k({linkTo:(null===(e=window)||void 0===e||null===(t=e.wp)||void 0===t||null===(n=t.media)||void 0===n||null===(r=n.view)||void 0===r||null===(o=r.settings)||void 0===o||null===(a=o.defaultProps)||void 0===a?void 0:a.link)||hQ}))}),[u]);const A=!!c.length,S=A&&c.some((e=>!!e.id)),C=(0,tt.createElement)(oj,{addToGallery:S,isAppender:A,disableMediaButtons:A&&!r,icon:!A&&fQ,labels:{title:!A&&er("Gallery"),instructions:!A&&EQ},onSelect:L,accept:"image/*",allowedTypes:wQ,multiple:!0,value:S?c:{},onError:function(e){a.removeAllNotices(),a.createErrorNotice(e)},notices:A?void 0:o,onFocus:i,autoOpenMediaUpload:!A&&r&&_}),T=VR();if(!A)return(0,tt.createElement)(mQ,T,C);const x=(0,at.map)((0,at.filter)(b,(({slug:e})=>(0,at.some)(M,(t=>t[e])))),(({name:e,slug:t})=>({value:t,label:e}))),z=A&&!(0,at.isEmpty)(x);return(0,tt.createElement)(tt.Fragment,null,(0,tt.createElement)(FA,null,(0,tt.createElement)(BA,{title:er("Gallery settings")},c.length>1&&(0,tt.createElement)(rT,ot({label:er("Columns"),value:s,onChange:function(e){k({columns:e})},min:1,max:Math.min(8,c.length)},LQ,{required:!0})),(0,tt.createElement)(KN,{label:er("Crop images"),checked:!!l,onChange:function(){k({imageCrop:!l})},help:function(e){return er(e?"Thumbnails are cropped to align.":"Thumbnails are not cropped.")}}),(0,tt.createElement)(KS,{label:er("Link to"),value:u,onChange:function(e){k({linkTo:e})},options:kQ,hideCancelButton:!0}),z&&(0,tt.createElement)(KS,{label:er("Image size"),value:d,options:x,onChange:function(e){k({images:(0,at.map)(c,(t=>{if(!t.id)return t;const n=(0,at.get)(M,[parseInt(t.id,10),e]);return{...t,...n&&{url:n}}})),sizeSlug:e})},hideCancelButton:!0}))),o,(0,tt.createElement)(MQ,ot({},e,{selectedImage:p,mediaPlaceholder:C,onMoveBackward:function(e){return()=>{0!==e&&w(e,e-1)}},onMoveForward:function(e){return()=>{e!==c.length-1&&w(e,e+1)}},onRemoveImage:function(e){return()=>{const n=(0,at.filter)(c,((t,n)=>e!==n));m(),k({images:n,columns:t.columns?Math.min(n.length,t.columns):t.columns})}},onSelectImage:function(e){return()=>{m(e)}},onDeselectImage:function(){return()=>{m()}},onSetImageAttributes:function(e,t){c[e]&&k({images:[...c.slice(0,e),{...c[e],...t},...c.slice(e+1)]})},blockProps:T,onFocusGalleryCaption:function(){m()}})))}));const SQ=e=>e?e.split(",").map((e=>parseInt(e,10))):[],CQ={from:[{type:"block",isMultiBlock:!0,blocks:["core/image"],transform:e=>{let{align:t,sizeSlug:n}=e[0];t=(0,at.every)(e,["align",t])?t:void 0,n=(0,at.every)(e,["sizeSlug",n])?n:void 0;const r=(0,at.filter)(e,(({url:e})=>e));return Ho("core/gallery",{images:r.map((({id:e,url:t,alt:n,caption:r})=>({id:(0,at.toString)(e),url:t,alt:n,caption:r}))),ids:r.map((({id:e})=>parseInt(e,10))),align:t,sizeSlug:n})}},{type:"shortcode",tag:"gallery",attributes:{images:{type:"array",shortcode:({named:{ids:e}})=>SQ(e).map((e=>({id:(0,at.toString)(e)})))},ids:{type:"array",shortcode:({named:{ids:e}})=>SQ(e)},columns:{type:"number",shortcode:({named:{columns:e="3"}})=>parseInt(e,10)},linkTo:{type:"string",shortcode:({named:{link:e="post"}})=>e}},isMatch:({named:e})=>void 0!==e.ids},{type:"files",isMatch:e=>1!==e.length&&(0,at.every)(e,(e=>0===e.type.indexOf("image/"))),transform:e=>Ho("core/gallery",{images:e.map((e=>sQ({url:Ks(e)})))})}],to:[{type:"block",blocks:["core/image"],transform:({images:e,align:t,sizeSlug:n,ids:r})=>e.length>0?e.map((({url:e,alt:o,caption:a},i)=>Ho("core/image",{id:r[i],url:e,alt:o,caption:a,align:t,sizeSlug:n}))):Ho("core/image",{align:t})}]},TQ={apiVersion:2,name:"core/gallery",title:"Gallery",category:"media",description:"Display multiple images in a rich gallery.",keywords:["images","photos"],textdomain:"default",attributes:{images:{type:"array",default:[],source:"query",selector:".blocks-gallery-item",query:{url:{type:"string",source:"attribute",selector:"img",attribute:"src"},fullUrl:{type:"string",source:"attribute",selector:"img",attribute:"data-full-url"},link:{type:"string",source:"attribute",selector:"img",attribute:"data-link"},alt:{type:"string",source:"attribute",selector:"img",attribute:"alt",default:""},id:{type:"string",source:"attribute",selector:"img",attribute:"data-id"},caption:{type:"string",source:"html",selector:".blocks-gallery-item__caption"}}},ids:{type:"array",items:{type:"number"},default:[]},columns:{type:"number",minimum:1,maximum:8},caption:{type:"string",source:"html",selector:".blocks-gallery-caption"},imageCrop:{type:"boolean",default:!0},linkTo:{type:"string"},sizeSlug:{type:"string",default:"large"}},supports:{anchor:!0,align:!0},editorStyle:"wp-block-gallery-editor",style:"wp-block-gallery"},{name:xQ}=TQ,zQ={icon:aQ,example:{attributes:{columns:2,images:[{url:"https://s.w.org/images/core/5.3/Glacial_lakes%2C_Bhutan.jpg"},{url:"https://s.w.org/images/core/5.3/Sediment_off_the_Yucatan_Peninsula.jpg"}]}},transforms:CQ,edit:AQ,save:function({attributes:e}){const{images:t,columns:n=iQ(e),imageCrop:r,caption:o,linkTo:a}=e,i=`columns-${n} ${r?"is-cropped":""}`;return(0,tt.createElement)("figure",VR.save({className:i}),(0,tt.createElement)("ul",{className:"blocks-gallery-grid"},t.map((e=>{let t;switch(a){case gQ:t=e.fullUrl||e.url;break;case bQ:t=e.link}const n=(0,tt.createElement)("img",{src:e.url,alt:e.alt,"data-id":e.id,"data-full-url":e.fullUrl,"data-link":e.link,className:e.id?`wp-image-${e.id}`:null});return(0,tt.createElement)("li",{key:e.id||e.url,className:"blocks-gallery-item"},(0,tt.createElement)("figure",null,t?(0,tt.createElement)("a",{href:t},n):n,!Cj.isEmpty(e.caption)&&(0,tt.createElement)(Cj.Content,{tagName:"figcaption",className:"blocks-gallery-item__caption",value:e.caption})))}))),!Cj.isEmpty(o)&&(0,tt.createElement)(Cj.Content,{tagName:"figcaption",className:"blocks-gallery-caption",value:o}))},deprecated:lQ},OQ=(0,tt.createElement)(mo,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,tt.createElement)(uo,{d:"M19 6.2h-5.9l-.6-1.1c-.3-.7-1-1.1-1.8-1.1H5c-1.1 0-2 .9-2 2v11.8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V8.2c0-1.1-.9-2-2-2zm.5 11.6c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h5.8c.2 0 .4.1.4.3l1 2H19c.3 0 .5.2.5.5v9.5zM8 12.8h8v-1.5H8v1.5zm0 3h8v-1.5H8v1.5z"}));function NQ({className:e}){return(0,tt.createElement)(vH,{className:e},er("Block rendered as empty."))}function DQ({response:e,className:t}){const n=pn(er("Error loading block: %s"),e.errorMsg);return(0,tt.createElement)(vH,{className:t},n)}function BQ({className:e}){return(0,tt.createElement)(vH,{className:e},(0,tt.createElement)(cq,null))}function IQ(e){const{attributes:t,block:n,className:r,httpMethod:o="GET",urlQueryArgs:a,EmptyResponsePlaceholder:i=NQ,ErrorResponsePlaceholder:s=DQ,LoadingResponsePlaceholder:l=BQ}=e,c=(0,tt.useRef)(!0),u=(0,tt.useRef)(),[d,p]=(0,tt.useState)(null),m=AG(e);function f(){if(!c.current)return;null!==d&&p(null);const e=t&&ko(n,t),r="POST"===o,i=function(e,t=null,n={}){return Pl(`/wp/v2/block-renderer/${e}`,{context:"edit",...null!==t?{attributes:t}:{},...n})}(n,r?null:null!=e?e:null,a),s=r?{attributes:null!=e?e:null}:null,l=u.current=ec({path:i,data:s,method:r?"POST":"GET"}).then((e=>{c.current&&l===u.current&&e&&p(e.rendered)})).catch((e=>{c.current&&l===u.current&&p({error:!0,errorMsg:e.message})}));return l}const h=jp(f,500);return(0,tt.useEffect)((()=>()=>{c.current=!1}),[]),(0,tt.useEffect)((()=>{void 0===m?f():(0,at.isEqual)(m,e)||h()})),""===d?(0,tt.createElement)(i,e):d?d.error?(0,tt.createElement)(s,ot({response:d},e)):(0,tt.createElement)(Pa,{className:r},d):(0,tt.createElement)(l,e)}const PQ={},RQ=QI((e=>{const t=e("core/editor");if(t){const e=t.getCurrentPostId();if(e&&"number"==typeof e)return{currentPostId:e}}return PQ}))((({urlQueryArgs:e=PQ,currentPostId:t,...n})=>{const r=(0,tt.useMemo)((()=>t?{post_id:t,...e}:e),[t,e]);return(0,tt.createElement)(IQ,ot({urlQueryArgs:r},n))}));window&&window.wp&&window.wp.components&&(window.wp.components.ServerSideRender=(0,tt.forwardRef)(((e,t)=>(qp("wp.components.ServerSideRender",{since:"5.3",alternative:"wp.serverSideRender"}),(0,tt.createElement)(RQ,ot({},e,{ref:t}))))));const YQ=RQ;const WQ={apiVersion:2,name:"core/archives",title:"Archives",category:"widgets",description:"Display a monthly archive of your posts.",textdomain:"default",attributes:{displayAsDropdown:{type:"boolean",default:!1},showPostCounts:{type:"boolean",default:!1}},supports:{align:!0,html:!1},editorStyle:"wp-block-archives-editor"},{name:HQ}=WQ,qQ={icon:OQ,example:{},edit:function({attributes:e,setAttributes:t}){const{showPostCounts:n,displayAsDropdown:r}=e;return(0,tt.createElement)(tt.Fragment,null,(0,tt.createElement)(FA,null,(0,tt.createElement)(BA,{title:er("Archives settings")},(0,tt.createElement)(KN,{label:er("Display as dropdown"),checked:r,onChange:()=>t({displayAsDropdown:!r})}),(0,tt.createElement)(KN,{label:er("Show post counts"),checked:n,onChange:()=>t({showPostCounts:!n})}))),(0,tt.createElement)("div",VR(),(0,tt.createElement)(jP,null,(0,tt.createElement)(YQ,{block:"core/archives",attributes:e}))))}},jQ=(0,tt.createElement)(mo,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,tt.createElement)(uo,{d:"M17.7 4.3c-1.2 0-2.8 0-3.8 1-.6.6-.9 1.5-.9 2.6V14c-.6-.6-1.5-1-2.5-1C8.6 13 7 14.6 7 16.5S8.6 20 10.5 20c1.5 0 2.8-1 3.3-2.3.5-.8.7-1.8.7-2.5V7.9c0-.7.2-1.2.5-1.6.6-.6 1.8-.6 2.8-.6h.3V4.3h-.4z"})),FQ=[{attributes:{src:{type:"string",source:"attribute",selector:"audio",attribute:"src"},caption:{type:"string",source:"html",selector:"figcaption"},id:{type:"number"},autoplay:{type:"boolean",source:"attribute",selector:"audio",attribute:"autoplay"},loop:{type:"boolean",source:"attribute",selector:"audio",attribute:"loop"},preload:{type:"string",source:"attribute",selector:"audio",attribute:"preload"}},supports:{align:!0},save({attributes:e}){const{autoplay:t,caption:n,loop:r,preload:o,src:a}=e;return(0,tt.createElement)("figure",null,(0,tt.createElement)("audio",{controls:"controls",src:a,autoPlay:t,loop:r,preload:o}),!Cj.isEmpty(n)&&(0,tt.createElement)(Cj.Content,{tagName:"figcaption",value:n}))}}],VQ=["audio"];const XQ=WK((function({attributes:e,noticeOperations:t,setAttributes:n,onReplace:r,isSelected:o,noticeUI:a,insertBlocksAfter:i}){const{id:s,autoplay:l,caption:c,loop:u,preload:d,src:p}=e,m=VR(),f=Tl((e=>{const{getSettings:t}=e(nk);return t().mediaUpload}),[]);function h(e){return t=>{n({[e]:t})}}function g(e){if(e!==p){const t=IG({attributes:{url:e}});if(void 0!==t)return void r(t);n({src:e,id:void 0})}}function b(e){t.removeAllNotices(),t.createErrorNotice(e)}function v(e){e&&e.url?n({src:e.url,id:e.id}):n({src:void 0,id:void 0})}return(0,tt.useEffect)((()=>{if(!s&&Qs(p)){const e=Gs(p);e&&f({filesList:[e],onFileChange:([{id:e,url:t}])=>{n({id:e,src:t})},onError:e=>{n({src:void 0,id:void 0}),t.createErrorNotice(e)},allowedTypes:VQ})}}),[]),p?(0,tt.createElement)(tt.Fragment,null,(0,tt.createElement)(lk,{group:"other"},(0,tt.createElement)(Jq,{mediaId:s,mediaURL:p,allowedTypes:VQ,accept:"audio/*",onSelect:v,onSelectURL:g,onError:b})),(0,tt.createElement)(FA,null,(0,tt.createElement)(BA,{title:er("Audio settings")},(0,tt.createElement)(KN,{label:er("Autoplay"),onChange:h("autoplay"),checked:l,help:function(e){return e?er("Autoplay may cause usability issues for some users."):null}}),(0,tt.createElement)(KN,{label:er("Loop"),onChange:h("loop"),checked:u}),(0,tt.createElement)(KS,{label:er("Preload"),value:d||"",onChange:e=>n({preload:e||void 0}),options:[{value:"",label:er("Browser default")},{value:"auto",label:er("Auto")},{value:"metadata",label:er("Metadata")},{value:"none",label:er("None")}]}))),(0,tt.createElement)("figure",m,(0,tt.createElement)(jP,{isDisabled:!o},(0,tt.createElement)("audio",{controls:"controls",src:p})),(!Cj.isEmpty(c)||o)&&(0,tt.createElement)(Cj,{tagName:"figcaption","aria-label":er("Audio caption text"),placeholder:er("Add caption"),value:c,onChange:e=>n({caption:e}),inlineToolbar:!0,__unstableOnSplitAtEnd:()=>i(Ho("core/paragraph"))}))):(0,tt.createElement)("div",m,(0,tt.createElement)(oj,{icon:(0,tt.createElement)(MB,{icon:jQ}),onSelect:v,onSelectURL:g,accept:"audio/*",allowedTypes:VQ,value:e,notices:a,onError:b}))}));const UQ={from:[{type:"files",isMatch:e=>1===e.length&&0===e[0].type.indexOf("audio/"),transform:e=>Ho("core/audio",{src:Ks(e[0])})},{type:"shortcode",tag:"audio",attributes:{src:{type:"string",shortcode:({named:{src:e,mp3:t,m4a:n,ogg:r,wav:o,wma:a}})=>e||t||n||r||o||a},loop:{type:"string",shortcode:({named:{loop:e}})=>e},autoplay:{type:"string",shortcode:({named:{autoplay:e}})=>e},preload:{type:"string",shortcode:({named:{preload:e}})=>e}}}]},$Q={apiVersion:2,name:"core/audio",title:"Audio",category:"media",description:"Embed a simple audio player.",keywords:["music","sound","podcast","recording"],textdomain:"default",attributes:{src:{type:"string",source:"attribute",selector:"audio",attribute:"src"},caption:{type:"string",source:"html",selector:"figcaption"},id:{type:"number"},autoplay:{type:"boolean",source:"attribute",selector:"audio",attribute:"autoplay"},loop:{type:"boolean",source:"attribute",selector:"audio",attribute:"loop"},preload:{type:"string",source:"attribute",selector:"audio",attribute:"preload"}},supports:{anchor:!0,align:!0},editorStyle:"wp-block-audio-editor",style:"wp-block-audio"},{name:KQ}=$Q,GQ={icon:jQ,example:{attributes:{src:"https://upload.wikimedia.org/wikipedia/commons/d/dd/Armstrong_Small_Step.ogg"}},transforms:UQ,deprecated:FQ,edit:XQ,save:function({attributes:e}){const{autoplay:t,caption:n,loop:r,preload:o,src:a}=e;return a&&(0,tt.createElement)("figure",VR.save(),(0,tt.createElement)("audio",{controls:"controls",src:a,autoPlay:t,loop:r,preload:o}),!Cj.isEmpty(n)&&(0,tt.createElement)(Cj.Content,{tagName:"figcaption",value:n}))}},JQ=(0,tt.createElement)(mo,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,tt.createElement)(uo,{d:"M17 3H7c-1.1 0-2 .9-2 2v4c0 1.1.9 2 2 2h10c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm.5 6c0 .3-.2.5-.5.5H7c-.3 0-.5-.2-.5-.5V5c0-.3.2-.5.5-.5h10c.3 0 .5.2.5.5v4zm-8-1.2h5V6.2h-5v1.6zM17 13H7c-1.1 0-2 .9-2 2v4c0 1.1.9 2 2 2h10c1.1 0 2-.9 2-2v-4c0-1.1-.9-2-2-2zm.5 6c0 .3-.2.5-.5.5H7c-.3 0-.5-.2-.5-.5v-4c0-.3.2-.5.5-.5h10c.3 0 .5.2.5.5v4zm-8-1.2h5v-1.5h-5v1.5z"})),QQ=[{supports:{align:["center","left","right"],anchor:!0},save:()=>(0,tt.createElement)("div",null,(0,tt.createElement)(JH.Content,null)),isEligible:({align:e})=>e&&["center","left","right"].includes(e),migrate:e=>({...e,align:void 0,contentJustification:e.align})}],{name:ZQ}={apiVersion:2,name:"core/buttons",title:"Buttons",category:"design",description:"Prompt visitors to take action with a group of button-style links.",keywords:["link"],textdomain:"default",attributes:{contentJustification:{type:"string"},orientation:{type:"string",default:"horizontal"}},supports:{anchor:!0,align:["wide","full"]},editorStyle:"wp-block-buttons-editor",style:"wp-block-buttons"},eZ={from:[{type:"block",isMultiBlock:!0,blocks:["core/button"],transform:e=>Ho(ZQ,{},e.map((e=>Ho("core/button",e))))},{type:"block",isMultiBlock:!0,blocks:["core/paragraph"],transform:e=>Ho(ZQ,{},e.map((e=>{const t=Sy(document,e.content),n=t.innerText||"",r=t.querySelector("a");return Ho("core/button",{text:n,url:null==r?void 0:r.getAttribute("href")})}))),isMatch:e=>e.every((e=>{const t=Sy(document,e.content),n=t.innerText||"",r=t.querySelectorAll("a");return n.length<=30&&r.length<=1}))}]},tZ=(0,tt.createElement)(mo,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,tt.createElement)(uo,{d:"M19 6.5H5c-1.1 0-2 .9-2 2v7c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-7c0-1.1-.9-2-2-2zm.5 9c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5v-7c0-.3.2-.5.5-.5h14c.3 0 .5.2.5.5v7zM8 12.8h8v-1.5H8v1.5z"})),nZ=e=>{var t,n,r;const{borderRadius:o,...a}=e,i=[o,null===(t=a.style)||void 0===t||null===(n=t.border)||void 0===n?void 0:n.radius].find((e=>"number"==typeof e&&0!==e));return i?{...a,style:{...a.style,border:{...null===(r=a.style)||void 0===r?void 0:r.border,radius:`${i}px`}}}:a},rZ=e=>{if(!e.customTextColor&&!e.customBackgroundColor&&!e.customGradient)return e;const t={color:{}};return e.customTextColor&&(t.color.text=e.customTextColor),e.customBackgroundColor&&(t.color.background=e.customBackgroundColor),e.customGradient&&(t.color.gradient=e.customGradient),{...(0,at.omit)(e,["customTextColor","customBackgroundColor","customGradient"]),style:t}},oZ=e=>rZ((0,at.omit)({...e,customTextColor:e.textColor&&"#"===e.textColor[0]?e.textColor:void 0,customBackgroundColor:e.color&&"#"===e.color[0]?e.color:void 0},["color","textColor"])),aZ={url:{type:"string",source:"attribute",selector:"a",attribute:"href"},title:{type:"string",source:"attribute",selector:"a",attribute:"title"},text:{type:"string",source:"html",selector:"a"}},iZ=[{supports:{anchor:!0,align:!0,alignWide:!1,color:{__experimentalSkipSerialization:!0,gradients:!0},typography:{fontSize:!0,__experimentalFontFamily:!0},reusable:!1,__experimentalSelector:".wp-block-button__link"},attributes:{...aZ,linkTarget:{type:"string",source:"attribute",selector:"a",attribute:"target"},rel:{type:"string",source:"attribute",selector:"a",attribute:"rel"},placeholder:{type:"string"},backgroundColor:{type:"string"},textColor:{type:"string"},gradient:{type:"string"},width:{type:"number"}},isEligible({style:e}){var t;return"number"==typeof(null==e||null===(t=e.border)||void 0===t?void 0:t.radius)},save({attributes:e,className:t}){var n,r,o;const{fontSize:a,linkTarget:i,rel:s,style:l,text:c,title:u,url:d,width:p}=e;if(!c)return null;const m=null==l||null===(n=l.border)||void 0===n?void 0:n.radius,f=aD(e),h=so()("wp-block-button__link",f.className,{"no-border-radius":0===(null==l||null===(r=l.border)||void 0===r?void 0:r.radius)}),g={borderRadius:m||void 0,...f.style},b=so()(t,{[`has-custom-width wp-block-button__width-${p}`]:p,"has-custom-font-size":a||(null==l||null===(o=l.typography)||void 0===o?void 0:o.fontSize)});return(0,tt.createElement)("div",VR.save({className:b}),(0,tt.createElement)(Cj.Content,{tagName:"a",className:h,href:d,title:u,style:g,value:c,target:i,rel:s}))},migrate:nZ},{supports:{anchor:!0,align:!0,alignWide:!1,color:{__experimentalSkipSerialization:!0},reusable:!1,__experimentalSelector:".wp-block-button__link"},attributes:{...aZ,linkTarget:{type:"string",source:"attribute",selector:"a",attribute:"target"},rel:{type:"string",source:"attribute",selector:"a",attribute:"rel"},placeholder:{type:"string"},borderRadius:{type:"number"},backgroundColor:{type:"string"},textColor:{type:"string"},gradient:{type:"string"},style:{type:"object"},width:{type:"number"}},save({attributes:e,className:t}){const{borderRadius:n,linkTarget:r,rel:o,text:a,title:i,url:s,width:l}=e,c=aD(e),u=so()("wp-block-button__link",c.className,{"no-border-radius":0===n}),d={borderRadius:n?n+"px":void 0,...c.style},p=so()(t,{[`has-custom-width wp-block-button__width-${l}`]:l});return(0,tt.createElement)("div",VR.save({className:p}),(0,tt.createElement)(Cj.Content,{tagName:"a",className:u,href:s,title:i,style:d,value:a,target:r,rel:o}))},migrate:nZ},{supports:{anchor:!0,align:!0,alignWide:!1,color:{__experimentalSkipSerialization:!0},reusable:!1,__experimentalSelector:".wp-block-button__link"},attributes:{...aZ,linkTarget:{type:"string",source:"attribute",selector:"a",attribute:"target"},rel:{type:"string",source:"attribute",selector:"a",attribute:"rel"},placeholder:{type:"string"},borderRadius:{type:"number"},backgroundColor:{type:"string"},textColor:{type:"string"},gradient:{type:"string"},style:{type:"object"},width:{type:"number"}},save({attributes:e,className:t}){const{borderRadius:n,linkTarget:r,rel:o,text:a,title:i,url:s,width:l}=e,c=aD(e),u=so()("wp-block-button__link",c.className,{"no-border-radius":0===n}),d={borderRadius:n?n+"px":void 0,...c.style},p=so()(t,{[`has-custom-width wp-block-button__width-${l}`]:l});return(0,tt.createElement)("div",VR.save({className:p}),(0,tt.createElement)(Cj.Content,{tagName:"a",className:u,href:s,title:i,style:d,value:a,target:r,rel:o}))},migrate:nZ},{supports:{align:!0,alignWide:!1,color:{gradients:!0}},attributes:{...aZ,linkTarget:{type:"string",source:"attribute",selector:"a",attribute:"target"},rel:{type:"string",source:"attribute",selector:"a",attribute:"rel"},placeholder:{type:"string"},borderRadius:{type:"number"},backgroundColor:{type:"string"},textColor:{type:"string"},gradient:{type:"string"},style:{type:"object"}},save({attributes:e}){const{borderRadius:t,linkTarget:n,rel:r,text:o,title:a,url:i}=e,s=so()("wp-block-button__link",{"no-border-radius":0===t}),l={borderRadius:t?t+"px":void 0};return(0,tt.createElement)(Cj.Content,{tagName:"a",className:s,href:i,title:a,style:l,value:o,target:n,rel:r})},migrate:nZ},{supports:{align:!0,alignWide:!1},attributes:{...aZ,linkTarget:{type:"string",source:"attribute",selector:"a",attribute:"target"},rel:{type:"string",source:"attribute",selector:"a",attribute:"rel"},placeholder:{type:"string"},borderRadius:{type:"number"},backgroundColor:{type:"string"},textColor:{type:"string"},customBackgroundColor:{type:"string"},customTextColor:{type:"string"},customGradient:{type:"string"},gradient:{type:"string"}},isEligible:e=>!!e.customTextColor||!!e.customBackgroundColor||!!e.customGradient,migrate:lS(nZ,rZ),save({attributes:e}){const{backgroundColor:t,borderRadius:n,customBackgroundColor:r,customTextColor:o,customGradient:a,linkTarget:i,gradient:s,rel:l,text:c,textColor:u,title:d,url:p}=e,m=mC("color",u),f=!a&&mC("background-color",t),h=hC(s),g=so()("wp-block-button__link",{"has-text-color":u||o,[m]:m,"has-background":t||r||a||s,[f]:f,"no-border-radius":0===n,[h]:h}),b={background:a||void 0,backgroundColor:f||a||s?void 0:r,color:m?void 0:o,borderRadius:n?n+"px":void 0};return(0,tt.createElement)("div",null,(0,tt.createElement)(Cj.Content,{tagName:"a",className:g,href:p,title:d,style:b,value:c,target:i,rel:l}))}},{attributes:{...aZ,align:{type:"string",default:"none"},backgroundColor:{type:"string"},textColor:{type:"string"},customBackgroundColor:{type:"string"},customTextColor:{type:"string"},linkTarget:{type:"string",source:"attribute",selector:"a",attribute:"target"},rel:{type:"string",source:"attribute",selector:"a",attribute:"rel"},placeholder:{type:"string"}},isEligible:e=>e.className&&e.className.includes("is-style-squared"),migrate(e){let t=e.className;return t&&(t=t.replace(/is-style-squared[\s]?/,"").trim()),nZ(rZ({...e,className:t||void 0,borderRadius:0}))},save({attributes:e}){const{backgroundColor:t,customBackgroundColor:n,customTextColor:r,linkTarget:o,rel:a,text:i,textColor:s,title:l,url:c}=e,u=mC("color",s),d=mC("background-color",t),p=so()("wp-block-button__link",{"has-text-color":s||r,[u]:u,"has-background":t||n,[d]:d}),m={backgroundColor:d?void 0:n,color:u?void 0:r};return(0,tt.createElement)("div",null,(0,tt.createElement)(Cj.Content,{tagName:"a",className:p,href:c,title:l,style:m,value:i,target:o,rel:a}))}},{attributes:{...aZ,align:{type:"string",default:"none"},backgroundColor:{type:"string"},textColor:{type:"string"},customBackgroundColor:{type:"string"},customTextColor:{type:"string"}},migrate:oZ,save({attributes:e}){const{url:t,text:n,title:r,backgroundColor:o,textColor:a,customBackgroundColor:i,customTextColor:s}=e,l=mC("color",a),c=mC("background-color",o),u=so()("wp-block-button__link",{"has-text-color":a||s,[l]:l,"has-background":o||i,[c]:c}),d={backgroundColor:c?void 0:i,color:l?void 0:s};return(0,tt.createElement)("div",null,(0,tt.createElement)(Cj.Content,{tagName:"a",className:u,href:t,title:r,style:d,value:n}))}},{attributes:{...aZ,color:{type:"string"},textColor:{type:"string"},align:{type:"string",default:"none"}},save({attributes:e}){const{url:t,text:n,title:r,align:o,color:a,textColor:i}=e,s={backgroundColor:a,color:i};return(0,tt.createElement)("div",{className:`align${o}`},(0,tt.createElement)(Cj.Content,{tagName:"a",className:"wp-block-button__link",href:t,title:r,style:s,value:n}))},migrate:oZ},{attributes:{...aZ,color:{type:"string"},textColor:{type:"string"},align:{type:"string",default:"none"}},save({attributes:e}){const{url:t,text:n,title:r,align:o,color:a,textColor:i}=e;return(0,tt.createElement)("div",{className:`align${o}`,style:{backgroundColor:a}},(0,tt.createElement)(Cj.Content,{tagName:"a",href:t,title:r,style:{color:i},value:n}))},migrate:oZ}],sZ="noreferrer noopener";function lZ({selectedWidth:e,setAttributes:t}){return(0,tt.createElement)(BA,{title:er("Width settings")},(0,tt.createElement)(GA,{"aria-label":er("Button width")},[25,50,75,100].map((n=>(0,tt.createElement)(Eh,{key:n,isSmall:!0,variant:n===e?"primary":void 0,onClick:()=>{var r;t({width:e===(r=n)?void 0:r})}},n,"%")))))}function cZ({isSelected:e,url:t,setAttributes:n,opensInNewTab:r,onToggleOpenInNewTab:o,anchorRef:a}){const[i,s]=(0,tt.useState)(!1),l=!!t,c=l&&e,u=()=>(s(!0),!1),d=()=>{n({url:void 0,linkTarget:void 0,rel:void 0}),s(!1)},p=(i||c)&&(0,tt.createElement)(_f,{position:"bottom center",onClose:()=>s(!1),anchorRef:null==a?void 0:a.current},(0,tt.createElement)(Vq,{className:"wp-block-navigation-link__inline-link-input",value:{url:t,opensInNewTab:r},onChange:({url:e="",opensInNewTab:t})=>{n({url:e}),r!==t&&o(t)}}));return(0,tt.createElement)(tt.Fragment,null,(0,tt.createElement)(lk,{group:"block"},!l&&(0,tt.createElement)(jg,{name:"link",icon:dT,title:er("Link"),shortcut:bm.primary("k"),onClick:u}),c&&(0,tt.createElement)(jg,{name:"link",icon:pT,title:er("Unlink"),shortcut:bm.primaryShift("k"),onClick:d,isActive:!0})),e&&(0,tt.createElement)(aS,{bindGlobal:!0,shortcuts:{[hm.primary("k")]:u,[hm.primaryShift("k")]:d}}),p)}const uZ=function(e){var t;const{attributes:n,setAttributes:r,className:o,isSelected:a,onReplace:i,mergeBlocks:s}=e,{linkTarget:l,placeholder:c,rel:u,style:d,text:p,url:m,width:f}=n,h=(0,tt.useCallback)((e=>{r({rel:e})}),[r]),g=(0,tt.useCallback)((e=>{const t=e?"_blank":void 0;let n=u;t&&!u?n=sZ:t||u!==sZ||(n=void 0),r({linkTarget:t,rel:n})}),[u,r]),b=rD(n),v=iD(n),y=(0,tt.useRef)(),_=VR({ref:y});return(0,tt.createElement)(tt.Fragment,null,(0,tt.createElement)("div",ot({},_,{className:so()(_.className,{[`has-custom-width wp-block-button__width-${f}`]:f,"has-custom-font-size":_.style.fontSize})}),(0,tt.createElement)(Cj,{"aria-label":er("Button text"),placeholder:c||er("Add text…"),value:p,onChange:e=>{r({text:e.replace(/<\/?a[^>]*>/g,"")})},withoutInteractiveFormatting:!0,className:so()(o,"wp-block-button__link",v.className,b.className,{"no-border-radius":0===(null==d||null===(t=d.border)||void 0===t?void 0:t.radius)}),style:{...b.style,...v.style},onSplit:e=>Ho("core/button",{...n,text:e}),onReplace:i,onMerge:s,identifier:"text"})),(0,tt.createElement)(cZ,{url:m,setAttributes:r,isSelected:a,opensInNewTab:"_blank"===l,onToggleOpenInNewTab:g,anchorRef:y}),(0,tt.createElement)(FA,null,(0,tt.createElement)(lZ,{selectedWidth:f,setAttributes:r})),(0,tt.createElement)(WA,null,(0,tt.createElement)(LA,{label:er("Link rel"),value:u||"",onChange:h})))};const dZ={apiVersion:2,name:"core/button",title:"Button",category:"design",parent:["core/buttons"],description:"Prompt visitors to take action with a button-style link.",keywords:["link"],textdomain:"default",attributes:{url:{type:"string",source:"attribute",selector:"a",attribute:"href"},title:{type:"string",source:"attribute",selector:"a",attribute:"title"},text:{type:"string",source:"html",selector:"a"},linkTarget:{type:"string",source:"attribute",selector:"a",attribute:"target"},rel:{type:"string",source:"attribute",selector:"a",attribute:"rel"},placeholder:{type:"string"},backgroundColor:{type:"string"},textColor:{type:"string"},gradient:{type:"string"},width:{type:"number"}},supports:{anchor:!0,align:!0,alignWide:!1,color:{__experimentalSkipSerialization:!0,gradients:!0},typography:{fontSize:!0,__experimentalFontFamily:!0},reusable:!1,__experimentalBorder:{radius:!0,__experimentalSkipSerialization:!0},__experimentalSelector:".wp-block-button__link"},styles:[{name:"fill",label:"Fill",isDefault:!0},{name:"outline",label:"Outline"}],editorStyle:"wp-block-button-editor",style:"wp-block-button"},{name:pZ}=dZ,mZ={icon:tZ,example:{attributes:{className:"is-style-fill",text:er("Call to Action")}},edit:uZ,save:function({attributes:e,className:t}){var n,r;const{fontSize:o,linkTarget:a,rel:i,style:s,text:l,title:c,url:u,width:d}=e;if(!l)return null;const p=nD(e),m=aD(e),f=so()("wp-block-button__link",m.className,p.className,{"no-border-radius":0===(null==s||null===(n=s.border)||void 0===n?void 0:n.radius)}),h={...p.style,...m.style},g=so()(t,{[`has-custom-width wp-block-button__width-${d}`]:d,"has-custom-font-size":o||(null==s||null===(r=s.typography)||void 0===r?void 0:r.fontSize)});return(0,tt.createElement)("div",VR.save({className:g}),(0,tt.createElement)(Cj.Content,{tagName:"a",className:f,href:u,title:c,style:h,value:l,target:a,rel:i}))},deprecated:iZ,merge:(e,{text:t=""})=>({...e,text:(e.text||"")+t})},fZ=[pZ],hZ={type:"default",alignments:[]},gZ=["left","center","right"],bZ=["left","center","right","space-between"];const vZ=function({attributes:{contentJustification:e,orientation:t},setAttributes:n}){const r=VR({className:so()({[`is-content-justification-${e}`]:e,"is-vertical":"vertical"===t})}),o=Tl((e=>{var t;const n=e(nk).getSettings().__experimentalPreferredStyleVariations;return null==n||null===(t=n.value)||void 0===t?void 0:t[pZ]}),[]),a=GH(r,{allowedBlocks:fZ,template:[[pZ,{className:o&&`is-style-${o}`}]],orientation:t,__experimentalLayout:hZ,templateInsertUpdatesSelection:!0}),i="vertical"===t?gZ:bZ;return(0,tt.createElement)(tt.Fragment,null,(0,tt.createElement)(lk,{group:"block"},(0,tt.createElement)(oq,{allowedControls:i,value:e,onChange:e=>n({contentJustification:e}),popoverProps:{position:"bottom right",isAlternate:!0}})),(0,tt.createElement)("div",a))};const yZ=[{name:"buttons-horizontal",isDefault:!0,title:er("Horizontal"),description:er("Buttons shown in a row."),attributes:{orientation:"horizontal"},scope:["transform"]},{name:"buttons-vertical",title:er("Vertical"),description:er("Buttons shown in a column."),attributes:{orientation:"vertical"},scope:["transform"]}],_Z={apiVersion:2,name:"core/buttons",title:"Buttons",category:"design",description:"Prompt visitors to take action with a group of button-style links.",keywords:["link"],textdomain:"default",attributes:{contentJustification:{type:"string"},orientation:{type:"string",default:"horizontal"}},supports:{anchor:!0,align:["wide","full"]},editorStyle:"wp-block-buttons-editor",style:"wp-block-buttons"},{name:MZ}=_Z,kZ={icon:JQ,example:{innerBlocks:[{name:"core/button",attributes:{text:er("Find out more")}},{name:"core/button",attributes:{text:er("Contact us")}}]},deprecated:QQ,transforms:eZ,edit:vZ,save:function({attributes:{contentJustification:e,orientation:t}}){return(0,tt.createElement)("div",VR.save({className:so()({[`is-content-justification-${e}`]:e,"is-vertical":"vertical"===t})}),(0,tt.createElement)(JH.Content,null))},variations:yZ},wZ=(0,tt.createElement)(mo,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,tt.createElement)(uo,{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm.5 16c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5V7h15v12zM9 10H7v2h2v-2zm0 4H7v2h2v-2zm4-4h-2v2h2v-2zm4 0h-2v2h2v-2zm-4 4h-2v2h2v-2zm4 0h-2v2h2v-2z"})),EZ=ln()((e=>{if(!e)return{};const t=sV()(e);return{year:t.year(),month:t.month()+1}}));const LZ={apiVersion:2,name:"core/calendar",title:"Calendar",category:"widgets",description:"A calendar of your site’s posts.",keywords:["posts","archive"],textdomain:"default",attributes:{month:{type:"integer"},year:{type:"integer"}},supports:{align:!0},style:"wp-block-calendar"},{name:AZ}=LZ,SZ={icon:wZ,example:{},edit:function({attributes:e}){const t=VR(),{date:n,hasPosts:r,hasPostsResolved:o}=Tl((e=>{const{getEntityRecords:t,hasFinishedResolution:n}=e(yd),r={status:"publish",per_page:1},o=t("postType","post",r),a=n("getEntityRecords",["postType","post",r]);let i;const s=e("core/editor");if(s){"post"===s.getEditedPostAttribute("type")&&(i=s.getEditedPostAttribute("date"))}return{date:i,hasPostsResolved:a,hasPosts:a&&1===(null==o?void 0:o.length)}}),[]);return r?(0,tt.createElement)("div",t,(0,tt.createElement)(jP,null,(0,tt.createElement)(YQ,{block:"core/calendar",attributes:{...e,...EZ(n)}}))):(0,tt.createElement)("div",t,(0,tt.createElement)(vH,{icon:wZ,label:er("Calendar")},o?er("No published posts found."):(0,tt.createElement)(cq,null)))}},CZ=(0,tt.createElement)(mo,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,tt.createElement)(uo,{d:"M6 5.5h3a.5.5 0 01.5.5v3a.5.5 0 01-.5.5H6a.5.5 0 01-.5-.5V6a.5.5 0 01.5-.5zM4 6a2 2 0 012-2h3a2 2 0 012 2v3a2 2 0 01-2 2H6a2 2 0 01-2-2V6zm11-.5h3a.5.5 0 01.5.5v3a.5.5 0 01-.5.5h-3a.5.5 0 01-.5-.5V6a.5.5 0 01.5-.5zM13 6a2 2 0 012-2h3a2 2 0 012 2v3a2 2 0 01-2 2h-3a2 2 0 01-2-2V6zm5 8.5h-3a.5.5 0 00-.5.5v3a.5.5 0 00.5.5h3a.5.5 0 00.5-.5v-3a.5.5 0 00-.5-.5zM15 13a2 2 0 00-2 2v3a2 2 0 002 2h3a2 2 0 002-2v-3a2 2 0 00-2-2h-3zm-9 1.5h3a.5.5 0 01.5.5v3a.5.5 0 01-.5.5H6a.5.5 0 01-.5-.5v-3a.5.5 0 01.5-.5zM4 15a2 2 0 012-2h3a2 2 0 012 2v3a2 2 0 01-2 2H6a2 2 0 01-2-2v-3z",fillRule:"evenodd",clipRule:"evenodd"})),TZ=(0,tt.createElement)(mo,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},(0,tt.createElement)(uo,{d:"M10.44 3.02l1.82-1.82 6.36 6.35-1.83 1.82c-1.05-.68-2.48-.57-3.41.36l-.75.75c-.92.93-1.04 2.35-.35 3.41l-1.83 1.82-2.41-2.41-2.8 2.79c-.42.42-3.38 2.71-3.8 2.29s1.86-3.39 2.28-3.81l2.79-2.79L4.1 9.36l1.83-1.82c1.05.69 2.48.57 3.4-.36l.75-.75c.93-.92 1.05-2.35.36-3.41z"}));const xZ={apiVersion:2,name:"core/categories",title:"Categories",category:"widgets",description:"Display a list of all categories.",textdomain:"default",attributes:{displayAsDropdown:{type:"boolean",default:!1},showHierarchy:{type:"boolean",default:!1},showPostCounts:{type:"boolean",default:!1}},supports:{align:!0,html:!1},editorStyle:"wp-block-categories-editor",style:"wp-block-categories"},{name:zZ}=xZ,OZ={icon:CZ,example:{},edit:function e({attributes:{displayAsDropdown:t,showHierarchy:n,showPostCounts:r},setAttributes:o}){const a=Qk(e,"blocks-category-select"),{categories:i,isRequesting:s}=Tl((e=>{const{getEntityRecords:t,isResolving:n}=e(yd),r={per_page:-1,hide_empty:!0,context:"view"};return{categories:t("taxonomy","category",r),isRequesting:n("getEntityRecords",["taxonomy","category",r])}}),[]),l=e=>null!=i&&i.length?null===e?i:i.filter((({parent:t})=>t===e)):[],c=e=>`wp-block-categories__list wp-block-categories__list-level-${e}`,u=e=>t=>o({[e]:t}),d=e=>e?(0,at.unescape)(e).trim():er("(Untitled)"),p=(e,t)=>{const o=l(e.id),{id:a,link:i,count:s,name:u}=e;return(0,tt.createElement)("li",{key:a},(0,tt.createElement)("a",{href:i,target:"_blank",rel:"noreferrer noopener"},d(u)),r&&(0,tt.createElement)("span",{className:"wp-block-categories__post-count"},` (${s})`),n&&!!o.length&&(0,tt.createElement)("ul",{className:c(t+1)},o.map((e=>p(e,t+1)))))},m=(e,t)=>{const{id:o,count:a,name:i}=e,s=l(o);return[(0,tt.createElement)("option",{key:o},(0,at.times)(3*t,(()=>" ")),d(i),r&&` (${a})`),n&&!!s.length&&s.map((e=>m(e,t+1)))]};return(0,tt.createElement)("div",VR(),(0,tt.createElement)(FA,null,(0,tt.createElement)(BA,{title:er("Categories settings")},(0,tt.createElement)(KN,{label:er("Display as dropdown"),checked:t,onChange:u("displayAsDropdown")}),(0,tt.createElement)(KN,{label:er("Show hierarchy"),checked:n,onChange:u("showHierarchy")}),(0,tt.createElement)(KN,{label:er("Show post counts"),checked:r,onChange:u("showPostCounts")}))),s&&(0,tt.createElement)(vH,{icon:TZ,label:er("Categories")},(0,tt.createElement)(cq,null)),!s&&0===(null==i?void 0:i.length)&&(0,tt.createElement)("p",null,er("Your site does not have any posts, so there is nothing to display here at the moment.")),!s&&(null==i?void 0:i.length)>0&&(t?(()=>{const e=l(n?0:null);return(0,tt.createElement)(tt.Fragment,null,(0,tt.createElement)(kh,{as:"label",htmlFor:a},er("Categories")),(0,tt.createElement)("select",{id:a,className:"wp-block-categories__dropdown"},e.map((e=>m(e,0)))))})():(()=>{const e=l(n?0:null);return(0,tt.createElement)("ul",{className:c(0)},e.map((e=>p(e,0))))})()))}},NZ=(0,tt.createElement)(mo,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,tt.createElement)(uo,{d:"M20.8 10.7l-4.3-4.3-1.1 1.1 4.3 4.3c.1.1.1.3 0 .4l-4.3 4.3 1.1 1.1 4.3-4.3c.7-.8.7-1.9 0-2.6zM4.2 11.8l4.3-4.3-1-1-4.3 4.3c-.7.7-.7 1.8 0 2.5l4.3 4.3 1.1-1.1-4.3-4.3c-.2-.1-.2-.3-.1-.4z"}));function DZ(e){return e.replace(/\[/g,"[")}function BZ(e){return e.replace(/^(\s*https?:)\/\/([^\s<>"]+\s*)$/m,"$1//$2")}const IZ={from:[{type:"enter",regExp:/^```$/,transform:()=>Ho("core/code")},{type:"block",blocks:["core/html"],transform:({content:e})=>Ho("core/code",{content:e})},{type:"raw",isMatch:e=>"PRE"===e.nodeName&&1===e.children.length&&"CODE"===e.firstChild.nodeName,schema:{pre:{children:{code:{children:{"#text":{}}}}}}}]},PZ={apiVersion:2,name:"core/code",title:"Code",category:"text",description:"Display code snippets that respect your spacing and tabs.",textdomain:"default",attributes:{content:{type:"string",source:"html",selector:"code"}},supports:{anchor:!0,__experimentalSelector:".wp-block-code > code",typography:{fontSize:!0}},style:"wp-block-code"},{name:RZ}=PZ,YZ={icon:NZ,example:{attributes:{content:er('// A "block" is the abstract term used\n// to describe units of markup that\n// when composed together, form the\n// content or layout of a page.\nregisterBlockType( name, settings );')}},transforms:IZ,edit:function({attributes:e,setAttributes:t,onRemove:n}){const r=VR();return(0,tt.createElement)("pre",r,(0,tt.createElement)(Cj,{tagName:"code",value:e.content,onChange:e=>t({content:e}),onRemove:n,placeholder:er("Write code…"),"aria-label":er("Code"),preserveWhiteSpace:!0,__unstablePastePlainText:!0}))},save:function({attributes:e}){return(0,tt.createElement)("pre",VR.save(),(0,tt.createElement)(Cj.Content,{tagName:"code",value:(t=e.content,(0,at.flow)(DZ,BZ)(t||""))}));var t}},WZ=(0,tt.createElement)(mo,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,tt.createElement)(uo,{d:"M19 6H6c-1.1 0-2 .9-2 2v9c0 1.1.9 2 2 2h13c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zm-4.1 1.5v10H10v-10h4.9zM5.5 17V8c0-.3.2-.5.5-.5h2.5v10H6c-.3 0-.5-.2-.5-.5zm14 0c0 .3-.2.5-.5.5h-2.6v-10H19c.3 0 .5.2.5.5v9z"}));function HZ(e){let t,{doc:n}=HZ;n||(n=document.implementation.createHTMLDocument(""),HZ.doc=n),n.body.innerHTML=e;for(const e of n.body.firstChild.classList)if(t=e.match(/^layout-column-(\d+)$/))return Number(t[1])-1}const qZ=[{attributes:{verticalAlignment:{type:"string"},backgroundColor:{type:"string"},customBackgroundColor:{type:"string"},customTextColor:{type:"string"},textColor:{type:"string"}},migrate:e=>{if(!e.customTextColor&&!e.customBackgroundColor)return e;const t={color:{}};return e.customTextColor&&(t.color.text=e.customTextColor),e.customBackgroundColor&&(t.color.background=e.customBackgroundColor),{...(0,at.omit)(e,["customTextColor","customBackgroundColor"]),style:t,isStackedOnMobile:!0}},save({attributes:e}){const{verticalAlignment:t,backgroundColor:n,customBackgroundColor:r,textColor:o,customTextColor:a}=e,i=mC("background-color",n),s=mC("color",o),l=so()({"has-background":n||r,"has-text-color":o||a,[i]:i,[s]:s,[`are-vertically-aligned-${t}`]:t}),c={backgroundColor:i?void 0:r,color:s?void 0:a};return(0,tt.createElement)("div",{className:l||void 0,style:c},(0,tt.createElement)(JH.Content,null))}},{attributes:{columns:{type:"number",default:2}},isEligible:(e,t)=>!!t.some((e=>/layout-column-\d+/.test(e.originalContent)))&&t.some((e=>void 0!==HZ(e.originalContent))),migrate(e,t){const n=t.reduce(((e,t)=>{const{originalContent:n}=t;let r=HZ(n);return void 0===r&&(r=0),e[r]||(e[r]=[]),e[r].push(t),e}),[]).map((e=>Ho("core/column",{},e)));return[{...(0,at.omit)(e,["columns"]),isStackedOnMobile:!0},n]},save({attributes:e}){const{columns:t}=e;return(0,tt.createElement)("div",{className:`has-${t}-columns`},(0,tt.createElement)(JH.Content,null))}},{attributes:{columns:{type:"number",default:2}},migrate:(e,t)=>[e={...(0,at.omit)(e,["columns"]),isStackedOnMobile:!0},t],save({attributes:e}){const{verticalAlignment:t,columns:n}=e,r=so()(`has-${n}-columns`,{[`are-vertically-aligned-${t}`]:t});return(0,tt.createElement)("div",{className:r},(0,tt.createElement)(JH.Content,null))}}],jZ=e=>{const t=parseFloat(e);return Number.isFinite(t)?parseFloat(t.toFixed(2)):void 0};function FZ(e,t){const{width:n=100/t}=e.attributes;return jZ(n)}function VZ(e,t,n=e.length){const r=function(e,t=e.length){return(0,at.sumBy)(e,(e=>FZ(e,t)))}(e,n);return(0,at.mapValues)(function(e,t=e.length){return e.reduce(((e,n)=>{const r=FZ(n,t);return Object.assign(e,{[n.clientId]:r})}),{})}(e,n),(e=>jZ(t*e/r)))}function XZ(e,t){return e.map((e=>(0,at.merge)({},e,{attributes:{width:`${t[e.clientId]}%`}})))}const UZ=["core/column"];const $Z=eP(((e,t,n)=>({updateAlignment(r){const{clientId:o,setAttributes:a}=t,{updateBlockAttributes:i}=e(nk),{getBlockOrder:s}=n.select(nk);a({verticalAlignment:r});s(o).forEach((e=>{i(e,{verticalAlignment:r})}))},updateColumns(r,o){const{clientId:a}=t,{replaceInnerBlocks:i}=e(nk),{getBlocks:s}=n.select(nk);let l=s(a);const c=function(e){return e.every((e=>{var t;const n=e.attributes.width;return Number.isFinite(null!=n&&null!==(t=n.endsWith)&&void 0!==t&&t.call(n,"%")?parseFloat(n):n)}))}(l),u=o>r;if(u&&c){const e=jZ(100/o);l=[...XZ(l,VZ(l,100-e)),...(0,at.times)(o-r,(()=>Ho("core/column",{width:`${e}%`})))]}else if(u)l=[...l,...(0,at.times)(o-r,(()=>Ho("core/column")))];else if(l=(0,at.dropRight)(l,r-o),c){l=XZ(l,VZ(l,100))}i(a,l)}})))((function({attributes:e,setAttributes:t,updateAlignment:n,updateColumns:r,clientId:o}){const{isStackedOnMobile:a,verticalAlignment:i}=e,{count:s}=Tl((e=>({count:e(nk).getBlockCount(o)})),[o]),l=GH(VR({className:so()({[`are-vertically-aligned-${i}`]:i,"is-not-stacked-on-mobile":!a})}),{allowedBlocks:UZ,orientation:"horizontal",renderAppender:!1});return(0,tt.createElement)(tt.Fragment,null,(0,tt.createElement)(lk,null,(0,tt.createElement)(YH,{onChange:n,value:i})),(0,tt.createElement)(FA,null,(0,tt.createElement)(BA,null,(0,tt.createElement)(rT,{label:er("Columns"),value:s,onChange:e=>r(s,e),min:1,max:Math.max(6,s)}),s>6&&(0,tt.createElement)(RT,{status:"warning",isDismissible:!1},er("This column count exceeds the recommended amount and may cause visual breakage.")),(0,tt.createElement)(KN,{label:er("Stack on mobile"),checked:a,onChange:()=>t({isStackedOnMobile:!a})}))),(0,tt.createElement)("div",l))}));function KZ({clientId:e,name:t,setAttributes:n}){const{blockType:r,defaultVariation:o,variations:a}=Tl((e=>{const{getBlockVariations:n,getBlockType:r,getDefaultBlockVariation:o}=e(Gr);return{blockType:r(t),defaultVariation:o(t,"block"),variations:n(t,"block")}}),[t]),{replaceInnerBlocks:i}=ld(nk),s=VR();return(0,tt.createElement)("div",s,(0,tt.createElement)(_H,{icon:(0,at.get)(r,["icon","src"]),label:(0,at.get)(r,["title"]),variations:a,onSelect:(t=o)=>{t.attributes&&n(t.attributes),t.innerBlocks&&i(e,qo(t.innerBlocks),!0)},allowSkip:!0}))}const GZ=e=>{const{clientId:t}=e,n=Tl((e=>e(nk).getBlocks(t).length>0),[t])?$Z:KZ;return(0,tt.createElement)(n,e)};const JZ=[{name:"one-column-full",title:er("100"),description:er("One column"),icon:(0,tt.createElement)(mo,{width:"48",height:"48",viewBox:"0 0 48 48",xmlns:"http://www.w3.org/2000/svg"},(0,tt.createElement)(uo,{fillRule:"evenodd",clipRule:"evenodd",d:"m39.0625 14h-30.0625v20.0938h30.0625zm-30.0625-2c-1.10457 0-2 .8954-2 2v20.0938c0 1.1045.89543 2 2 2h30.0625c1.1046 0 2-.8955 2-2v-20.0938c0-1.1046-.8954-2-2-2z"})),innerBlocks:[["core/column"]],scope:["block"]},{name:"two-columns-equal",title:er("50 / 50"),description:er("Two columns; equal split"),icon:(0,tt.createElement)(mo,{width:"48",height:"48",viewBox:"0 0 48 48",xmlns:"http://www.w3.org/2000/svg"},(0,tt.createElement)(uo,{fillRule:"evenodd",clipRule:"evenodd",d:"M39 12C40.1046 12 41 12.8954 41 14V34C41 35.1046 40.1046 36 39 36H9C7.89543 36 7 35.1046 7 34V14C7 12.8954 7.89543 12 9 12H39ZM39 34V14H25V34H39ZM23 34H9V14H23V34Z"})),isDefault:!0,innerBlocks:[["core/column"],["core/column"]],scope:["block"]},{name:"two-columns-one-third-two-thirds",title:er("30 / 70"),description:er("Two columns; one-third, two-thirds split"),icon:(0,tt.createElement)(mo,{width:"48",height:"48",viewBox:"0 0 48 48",xmlns:"http://www.w3.org/2000/svg"},(0,tt.createElement)(uo,{fillRule:"evenodd",clipRule:"evenodd",d:"M39 12C40.1046 12 41 12.8954 41 14V34C41 35.1046 40.1046 36 39 36H9C7.89543 36 7 35.1046 7 34V14C7 12.8954 7.89543 12 9 12H39ZM39 34V14H20V34H39ZM18 34H9V14H18V34Z"})),innerBlocks:[["core/column",{width:"33.33%"}],["core/column",{width:"66.66%"}]],scope:["block"]},{name:"two-columns-two-thirds-one-third",title:er("70 / 30"),description:er("Two columns; two-thirds, one-third split"),icon:(0,tt.createElement)(mo,{width:"48",height:"48",viewBox:"0 0 48 48",xmlns:"http://www.w3.org/2000/svg"},(0,tt.createElement)(uo,{fillRule:"evenodd",clipRule:"evenodd",d:"M39 12C40.1046 12 41 12.8954 41 14V34C41 35.1046 40.1046 36 39 36H9C7.89543 36 7 35.1046 7 34V14C7 12.8954 7.89543 12 9 12H39ZM39 34V14H30V34H39ZM28 34H9V14H28V34Z"})),innerBlocks:[["core/column",{width:"66.66%"}],["core/column",{width:"33.33%"}]],scope:["block"]},{name:"three-columns-equal",title:er("33 / 33 / 33"),description:er("Three columns; equal split"),icon:(0,tt.createElement)(mo,{width:"48",height:"48",viewBox:"0 0 48 48",xmlns:"http://www.w3.org/2000/svg"},(0,tt.createElement)(uo,{fillRule:"evenodd",d:"M41 14a2 2 0 0 0-2-2H9a2 2 0 0 0-2 2v20a2 2 0 0 0 2 2h30a2 2 0 0 0 2-2V14zM28.5 34h-9V14h9v20zm2 0V14H39v20h-8.5zm-13 0H9V14h8.5v20z"})),innerBlocks:[["core/column"],["core/column"],["core/column"]],scope:["block"]},{name:"three-columns-wider-center",title:er("25 / 50 / 25"),description:er("Three columns; wide center column"),icon:(0,tt.createElement)(mo,{width:"48",height:"48",viewBox:"0 0 48 48",xmlns:"http://www.w3.org/2000/svg"},(0,tt.createElement)(uo,{fillRule:"evenodd",d:"M41 14a2 2 0 0 0-2-2H9a2 2 0 0 0-2 2v20a2 2 0 0 0 2 2h30a2 2 0 0 0 2-2V14zM31 34H17V14h14v20zm2 0V14h6v20h-6zm-18 0H9V14h6v20z"})),innerBlocks:[["core/column",{width:"25%"}],["core/column",{width:"50%"}],["core/column",{width:"25%"}]],scope:["block"]}],QZ={from:[{type:"block",isMultiBlock:!0,blocks:["*"],__experimentalConvert:e=>{const t=+(100/e.length).toFixed(2);return Ho("core/columns",{},qo(e.map((({name:e,attributes:n,innerBlocks:r})=>["core/column",{width:`${t}%`},[[e,{...n},r]]]))))},isMatch:({length:e})=>e&&e<=6},{type:"block",blocks:["core/media-text"],priority:1,transform:(e,t)=>{const{align:n,backgroundColor:r,textColor:o,style:a,mediaAlt:i,mediaId:s,mediaPosition:l,mediaSizeSlug:c,mediaType:u,mediaUrl:d,mediaWidth:p,verticalAlignment:m}=e;let f;if("image"!==u&&u)f=["core/video",{id:s,src:d}];else{f=["core/image",{...{id:s,alt:i,url:d,sizeSlug:c},...{href:e.href,linkClass:e.linkClass,linkDestination:e.linkDestination,linkTarget:e.linkTarget,rel:e.rel}}]}const h=[["core/column",{width:`${p}%`},[f]],["core/column",{width:100-p+"%"},t]];return"right"===l&&h.reverse(),Ho("core/columns",{align:n,backgroundColor:r,textColor:o,style:a,verticalAlignment:m},qo(h))}}]},ZZ={apiVersion:2,name:"core/columns",title:"Columns",category:"design",description:"Add a block that displays content in multiple columns, then add whatever content blocks you’d like.",textdomain:"default",attributes:{verticalAlignment:{type:"string"},isStackedOnMobile:{type:"boolean",default:!0}},supports:{anchor:!0,align:["wide","full"],html:!1,color:{gradients:!0,link:!0}},editorStyle:"wp-block-columns-editor",style:"wp-block-columns"},{name:e0}=ZZ,t0={icon:WZ,variations:JZ,example:{innerBlocks:[{name:"core/column",innerBlocks:[{name:"core/paragraph",attributes:{content:er("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent et eros eu felis.")}},{name:"core/image",attributes:{url:"https://s.w.org/images/core/5.3/Windbuchencom.jpg"}},{name:"core/paragraph",attributes:{content:er("Suspendisse commodo neque lacus, a dictum orci interdum et.")}}]},{name:"core/column",innerBlocks:[{name:"core/paragraph",attributes:{content:er("Etiam et egestas lorem. Vivamus sagittis sit amet dolor quis lobortis. Integer sed fermentum arcu, id vulputate lacus. Etiam fermentum sem eu quam hendrerit.")}},{name:"core/paragraph",attributes:{content:er("Nam risus massa, ullamcorper consectetur eros fermentum, porta aliquet ligula. Sed vel mauris nec enim.")}}]}]},deprecated:qZ,edit:GZ,save:function({attributes:e}){const{isStackedOnMobile:t,verticalAlignment:n}=e,r=so()({[`are-vertically-aligned-${n}`]:n,"is-not-stacked-on-mobile":!t});return(0,tt.createElement)("div",VR.save({className:r}),(0,tt.createElement)(JH.Content,null))},transforms:QZ},n0=(0,tt.createElement)(mo,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,tt.createElement)(uo,{d:"M19 6H6c-1.1 0-2 .9-2 2v9c0 1.1.9 2 2 2h13c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zM6 17.5c-.3 0-.5-.2-.5-.5V8c0-.3.2-.5.5-.5h3v10H6zm13.5-.5c0 .3-.2.5-.5.5h-3v-10h3c.3 0 .5.2.5.5v9z"})),r0=[{attributes:{verticalAlignment:{type:"string"},width:{type:"number",min:0,max:100}},isEligible:({width:e})=>isFinite(e),migrate:e=>({...e,width:`${e.width}%`}),save({attributes:e}){const{verticalAlignment:t,width:n}=e,r=so()({[`is-vertically-aligned-${t}`]:t}),o={flexBasis:n+"%"};return(0,tt.createElement)("div",{className:r,style:o},(0,tt.createElement)(JH.Content,null))}}];const o0=function({attributes:{verticalAlignment:e,width:t,templateLock:n=!1},setAttributes:r,clientId:o}){const a=so()("block-core-columns",{[`is-vertically-aligned-${e}`]:e}),i=Lk({availableUnits:JL("spacing.units")||["%","px","em","rem","vw"]}),{columnsIds:s,hasChildBlocks:l,rootClientId:c}=Tl((e=>{const{getBlockOrder:t,getBlockRootClientId:n}=e(nk),r=n(o);return{hasChildBlocks:t(o).length>0,rootClientId:r,columnsIds:t(r)}}),[o]),{updateBlockAttributes:u}=ld(nk),d=Number.isFinite(t)?t+"%":t,p=VR({className:a,style:d?{flexBasis:d}:void 0}),m=s.length,f=s.indexOf(o)+1,h=pn(er("%1$s (%2$d of %3$d)"),p["aria-label"],f,m),g=GH({...p,"aria-label":h},{templateLock:n,renderAppender:l?void 0:JH.ButtonBlockAppender});return(0,tt.createElement)(tt.Fragment,null,(0,tt.createElement)(lk,null,(0,tt.createElement)(YH,{onChange:e=>{r({verticalAlignment:e}),u(c,{verticalAlignment:null})},value:e})),(0,tt.createElement)(FA,null,(0,tt.createElement)(BA,{title:er("Column settings")},(0,tt.createElement)(UL,{label:er("Width"),labelPosition:"edge",__unstableInputWidth:"80px",value:t||"",onChange:e=>{e=0>parseFloat(e)?"0":e,r({width:e})},units:i}))),(0,tt.createElement)("div",g))};const a0={apiVersion:2,name:"core/column",title:"Column",category:"text",parent:["core/columns"],description:"A single column within a columns block.",textdomain:"default",attributes:{verticalAlignment:{type:"string"},width:{type:"string"},templateLock:{enum:["all","insert",!1]}},supports:{anchor:!0,reusable:!1,html:!1,color:{gradients:!0,link:!0},spacing:{padding:!0}}},{name:i0}=a0,s0={icon:n0,edit:o0,save:function({attributes:e}){const{verticalAlignment:t,width:n}=e,r=so()({[`is-vertically-aligned-${t}`]:t});let o;return n&&(o={flexBasis:Number.isFinite(n)?n+"%":n}),(0,tt.createElement)("div",VR.save({className:r,style:o}),(0,tt.createElement)(JH.Content,null))},deprecated:r0},l0=(0,tt.createElement)(mo,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,tt.createElement)(uo,{d:"M18.7 3H5.3C4 3 3 4 3 5.3v13.4C3 20 4 21 5.3 21h13.4c1.3 0 2.3-1 2.3-2.3V5.3C21 4 20 3 18.7 3zm.8 15.7c0 .4-.4.8-.8.8H5.3c-.4 0-.8-.4-.8-.8V5.3c0-.4.4-.8.8-.8h6.2v8.9l2.5-3.1 2.5 3.1V4.5h2.2c.4 0 .8.4.8.8v13.4z"})),c0={"top left":"is-position-top-left","top center":"is-position-top-center","top right":"is-position-top-right","center left":"is-position-center-left","center center":"is-position-center-center",center:"is-position-center-center","center right":"is-position-center-right","bottom left":"is-position-bottom-left","bottom center":"is-position-bottom-center","bottom right":"is-position-bottom-right"},u0="image",d0="video";function p0(e){return e?{backgroundImage:`url(${e})`}:{}}const m0=["image","video"];function f0(e){return 0!==e&&50!==e&&e?"has-background-dim-"+10*Math.round(e/10):null}function h0(e){return t=>{if(!t||!t.url)return void e({url:void 0,id:void 0});var n,r;let o;if(Qs(t.url)&&(t.type=(n=t.url,null===(r=Gs(n))||void 0===r?void 0:r.type.split("/")[0])),t.media_type)o=t.media_type===u0?u0:d0;else{if(t.type!==u0&&t.type!==d0)return;o=t.type}e({url:t.url,id:t.id,backgroundType:o,...o===d0?{focalPoint:void 0,hasParallax:void 0}:{}})}}function g0(e){return!e||"center center"===e||"center"===e}function b0(e){return g0(e)?"":c0[e]}const v0={url:{type:"string"},id:{type:"number"},hasParallax:{type:"boolean",default:!1},dimRatio:{type:"number",default:50},overlayColor:{type:"string"},customOverlayColor:{type:"string"},backgroundType:{type:"string",default:"image"},focalPoint:{type:"object"}},y0=[{attributes:{...v0,title:{type:"string",source:"html",selector:"p"},contentAlign:{type:"string",default:"center"},isRepeated:{type:"boolean",default:!1},minHeight:{type:"number"},minHeightUnit:{type:"string"},gradient:{type:"string"},customGradient:{type:"string"},contentPosition:{type:"string"}},supports:{align:!0},save({attributes:e}){const{backgroundType:t,gradient:n,contentPosition:r,customGradient:o,customOverlayColor:a,dimRatio:i,focalPoint:s,hasParallax:l,isRepeated:c,overlayColor:u,url:d,minHeight:p,minHeightUnit:m}=e,f=mC("background-color",u),h=hC(n),g=m?`${p}${m}`:p,b=u0===t,v=d0===t,y=b?p0(d):{},_={};let M;f||(y.backgroundColor=a),o&&!d&&(y.background=o),y.minHeight=g||void 0,s&&(M=`${Math.round(100*s.x)}% ${Math.round(100*s.y)}%`,b&&!l&&(y.backgroundPosition=M),v&&(_.objectPosition=M));const k=so()(f0(i),f,{"has-background-dim":0!==i,"has-parallax":l,"is-repeated":c,"has-background-gradient":n||o,[h]:!d&&h,"has-custom-content-position":!g0(r)},b0(r));return(0,tt.createElement)("div",VR.save({className:k,style:y}),d&&(n||o)&&0!==i&&(0,tt.createElement)("span",{"aria-hidden":"true",className:so()("wp-block-cover__gradient-background",h),style:o?{background:o}:void 0}),v&&d&&(0,tt.createElement)("video",{className:"wp-block-cover__video-background",autoPlay:!0,muted:!0,loop:!0,playsInline:!0,src:d,style:_}),(0,tt.createElement)("div",{className:"wp-block-cover__inner-container"},(0,tt.createElement)(JH.Content,null)))}},{attributes:{...v0,title:{type:"string",source:"html",selector:"p"},contentAlign:{type:"string",default:"center"},minHeight:{type:"number"},gradient:{type:"string"},customGradient:{type:"string"}},supports:{align:!0},save({attributes:e}){const{backgroundType:t,gradient:n,customGradient:r,customOverlayColor:o,dimRatio:a,focalPoint:i,hasParallax:s,overlayColor:l,url:c,minHeight:u}=e,d=mC("background-color",l),p=hC(n),m=t===u0?p0(c):{};d||(m.backgroundColor=o),i&&!s&&(m.backgroundPosition=`${Math.round(100*i.x)}% ${Math.round(100*i.y)}%`),r&&!c&&(m.background=r),m.minHeight=u||void 0;const f=so()(f0(a),d,{"has-background-dim":0!==a,"has-parallax":s,"has-background-gradient":r,[p]:!c&&p});return(0,tt.createElement)("div",{className:f,style:m},c&&(n||r)&&0!==a&&(0,tt.createElement)("span",{"aria-hidden":"true",className:so()("wp-block-cover__gradient-background",p),style:r?{background:r}:void 0}),d0===t&&c&&(0,tt.createElement)("video",{className:"wp-block-cover__video-background",autoPlay:!0,muted:!0,loop:!0,src:c}),(0,tt.createElement)("div",{className:"wp-block-cover__inner-container"},(0,tt.createElement)(JH.Content,null)))}},{attributes:{...v0,title:{type:"string",source:"html",selector:"p"},contentAlign:{type:"string",default:"center"},minHeight:{type:"number"},gradient:{type:"string"},customGradient:{type:"string"}},supports:{align:!0},save({attributes:e}){const{backgroundType:t,gradient:n,customGradient:r,customOverlayColor:o,dimRatio:a,focalPoint:i,hasParallax:s,overlayColor:l,url:c,minHeight:u}=e,d=mC("background-color",l),p=hC(n),m=t===u0?p0(c):{};d||(m.backgroundColor=o),i&&!s&&(m.backgroundPosition=`${100*i.x}% ${100*i.y}%`),r&&!c&&(m.background=r),m.minHeight=u||void 0;const f=so()(f0(a),d,{"has-background-dim":0!==a,"has-parallax":s,"has-background-gradient":r,[p]:!c&&p});return(0,tt.createElement)("div",{className:f,style:m},c&&(n||r)&&0!==a&&(0,tt.createElement)("span",{"aria-hidden":"true",className:so()("wp-block-cover__gradient-background",p),style:r?{background:r}:void 0}),d0===t&&c&&(0,tt.createElement)("video",{className:"wp-block-cover__video-background",autoPlay:!0,muted:!0,loop:!0,src:c}),(0,tt.createElement)("div",{className:"wp-block-cover__inner-container"},(0,tt.createElement)(JH.Content,null)))}},{attributes:{...v0,title:{type:"string",source:"html",selector:"p"},contentAlign:{type:"string",default:"center"}},supports:{align:!0},save({attributes:e}){const{backgroundType:t,contentAlign:n,customOverlayColor:r,dimRatio:o,focalPoint:a,hasParallax:i,overlayColor:s,title:l,url:c}=e,u=mC("background-color",s),d=t===u0?p0(c):{};u||(d.backgroundColor=r),a&&!i&&(d.backgroundPosition=`${100*a.x}% ${100*a.y}%`);const p=so()(f0(o),u,{"has-background-dim":0!==o,"has-parallax":i,[`has-${n}-content`]:"center"!==n});return(0,tt.createElement)("div",{className:p,style:d},d0===t&&c&&(0,tt.createElement)("video",{className:"wp-block-cover__video-background",autoPlay:!0,muted:!0,loop:!0,src:c}),!Cj.isEmpty(l)&&(0,tt.createElement)(Cj.Content,{tagName:"p",className:"wp-block-cover-text",value:l}))},migrate:e=>[(0,at.omit)(e,["title","contentAlign"]),[Ho("core/paragraph",{content:e.title,align:e.contentAlign,fontSize:"large",placeholder:er("Write title…")})]]},{attributes:{...v0,title:{type:"string",source:"html",selector:"p"},contentAlign:{type:"string",default:"center"},align:{type:"string"}},supports:{className:!1},save({attributes:e}){const{url:t,title:n,hasParallax:r,dimRatio:o,align:a,contentAlign:i,overlayColor:s,customOverlayColor:l}=e,c=mC("background-color",s),u=p0(t);c||(u.backgroundColor=l);const d=so()("wp-block-cover-image",f0(o),c,{"has-background-dim":0!==o,"has-parallax":r,[`has-${i}-content`]:"center"!==i},a?`align${a}`:null);return(0,tt.createElement)("div",{className:d,style:u},!Cj.isEmpty(n)&&(0,tt.createElement)(Cj.Content,{tagName:"p",className:"wp-block-cover-image-text",value:n}))},migrate:e=>[(0,at.omit)(e,["title","contentAlign","align"]),[Ho("core/paragraph",{content:e.title,align:e.contentAlign,fontSize:"large",placeholder:er("Write title…")})]]},{attributes:{...v0,title:{type:"string",source:"html",selector:"h2"},align:{type:"string"},contentAlign:{type:"string",default:"center"}},supports:{className:!1},save({attributes:e}){const{url:t,title:n,hasParallax:r,dimRatio:o,align:a}=e,i=p0(t),s=so()("wp-block-cover-image",f0(o),{"has-background-dim":0!==o,"has-parallax":r},a?`align${a}`:null);return(0,tt.createElement)("section",{className:s,style:i},(0,tt.createElement)(Cj.Content,{tagName:"h2",value:n}))},migrate:e=>[(0,at.omit)(e,["title","contentAlign","align"]),[Ho("core/paragraph",{content:e.title,align:e.contentAlign,fontSize:"large",placeholder:er("Write title…")})]]}];var _0=n(7667),M0=n.n(_0);const k0=yh("div",{target:"e11wezi78"})({name:"1g31405",styles:"background-color:transparent;box-sizing:border-box;text-align:center;width:100%"}),w0=yh("div",{target:"e11wezi77"})({name:"v0nrlz",styles:"align-items:center;box-sizing:border-box;box-shadow:0 0 0 1px rgba( 0, 0, 0, 0.2 );cursor:pointer;display:inline-flex;justify-content:center;margin:auto;position:relative;height:100%;img,video{box-sizing:border-box;display:block;height:auto;margin:0;max-height:100%;max-width:100%;pointer-events:none;user-select:none;width:auto;}"}),E0=yh("div",{target:"e11wezi76"})("background:",Gk.lightGray[300],";box-sizing:border-box;height:170px;max-width:280px;min-width:200px;width:100%;"),L0=yh(UL,{target:"e11wezi75"})({name:"1pzk433",styles:"width:100px"}),A0=yh(cw,{target:"e11wezi74"})({name:"ox4xcy",styles:"max-width:320px;padding:1em 0"}),S0=yh("div",{target:"e11wezi73"})("box-sizing:border-box;left:50%;opacity:0;overflow:hidden;pointer-events:none;position:absolute;top:50%;transform:translate3d( -50%, -50%, 0 );transition:opacity 120ms linear;z-index:1;",(({isActive:e})=>e&&"\n\t\topacity: 1;\n\t"),";"),C0=yh("div",{target:"e11wezi72"})({name:"1sy4ch9",styles:"box-sizing:border-box;background:white;box-shadow:0 0 2px rgba( 0, 0, 0, 0.6 );position:absolute;opacity:0.4;transform:translateZ( 0 )"}),T0=yh(C0,{target:"e11wezi71"})({name:"1qp910y",styles:"height:1px;left:0;right:0"}),x0=yh(C0,{target:"e11wezi70"})({name:"1oz3zka",styles:"width:1px;top:0;bottom:0"}),z0={top:0,left:0,bottom:0,right:0,width:0,height:0},O0=["avi","mpg","mpeg","mov","mp4","m4v","ogg","ogv","webm","wmv"];function N0(e){return Math.round(100*e)}function D0({onChange:e=at.noop,percentages:t={x:.5,y:.5}}){const n=N0(t.x),r=N0(t.y),o=(n,r)=>{const o=parseInt(n,10);isNaN(o)||e({...t,[r]:o/100})};return(0,tt.createElement)(A0,{className:"focal-point-picker__controls"},(0,tt.createElement)(B0,{label:er("Left"),value:n,onChange:e=>o(e,"x"),dragDirection:"e"}),(0,tt.createElement)(B0,{label:er("Top"),value:r,onChange:e=>o(e,"y"),dragDirection:"s"}))}function B0(e){return(0,tt.createElement)(L0,ot({className:"focal-point-picker__controls-position-unit-control",labelPosition:"side",max:100,min:0,unit:"%",units:[{value:"%",label:"%"}]},e))}const I0=yh("div",{target:"eas61re3"})("background-color:transparent;box-sizing:border-box;cursor:grab;height:30px;margin:-15px 0 0 -15px;opacity:0.8;position:absolute;user-select:none;width:30px;will-change:transform;z-index:10000;",(({isDragging:e})=>e&&"cursor: grabbing;"),";"),P0=yh(mo,{target:"eas61re2"})({name:"qkx60y",styles:"display:block;height:100%;left:0;position:absolute;top:0;width:100%"}),R0=yh(uo,{target:"eas61re1"})({name:"1b3qpiw",styles:"fill:white"}),Y0=yh(uo,{target:"eas61re0"})("fill:",Gk.blue.wordpress[700],";fill:",Gk.ui.theme,";");function W0({coordinates:e={left:"50%",top:"50%"},...t}){const n=so()("components-focal-point-picker__icon_container"),r={left:e.left,top:e.top};return(0,tt.createElement)(I0,ot({},t,{className:n,style:r}),(0,tt.createElement)(P0,{className:"components-focal-point-picker__icon",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 30 30"},(0,tt.createElement)(R0,{className:"components-focal-point-picker__icon-outline",d:"M15 1C7.3 1 1 7.3 1 15s6.3 14 14 14 14-6.3 14-14S22.7 1 15 1zm0 22c-4.4 0-8-3.6-8-8s3.6-8 8-8 8 3.6 8 8-3.6 8-8 8z"}),(0,tt.createElement)(Y0,{className:"components-focal-point-picker__icon-fill",d:"M15 3C8.4 3 3 8.4 3 15s5.4 12 12 12 12-5.4 12-12S21.6 3 15 3zm0 22C9.5 25 5 20.5 5 15S9.5 5 15 5s10 4.5 10 10-4.5 10-10 10z"})))}const{clearTimeout:H0,setTimeout:q0}="undefined"!=typeof window?window:{};function j0({bounds:e={},value:t,...n}){const r=function(e){const[t,n]=(0,tt.useState)(!1);return EL((()=>{n(!0);const e=q0((()=>{n(!1)}),600);return()=>H0(e)}),[e]),{isActive:t}}(t),o={width:e.width,height:e.height};return(0,tt.createElement)(S0,ot({},n,r,{className:"components-focal-point-picker__grid",style:o}),(0,tt.createElement)(T0,{style:{top:"33%"}}),(0,tt.createElement)(T0,{style:{top:"66%"}}),(0,tt.createElement)(x0,{style:{left:"33%"}}),(0,tt.createElement)(x0,{style:{left:"66%"}}))}function F0({alt:e,autoPlay:t,src:n,onLoad:r=at.noop,mediaRef:o,muted:a=!0,...i}){if(!n)return(0,tt.createElement)(V0,{className:"components-focal-point-picker__media components-focal-point-picker__media--placeholder",onLoad:r,mediaRef:o});return function(e=""){return!!e&&O0.includes(function(e=""){const t=e.split(".");return t[t.length-1]}(e))}(n)?(0,tt.createElement)("video",ot({},i,{autoPlay:t,className:"components-focal-point-picker__media components-focal-point-picker__media--video",loop:!0,muted:a,onLoadedData:r,ref:o,src:n})):(0,tt.createElement)("img",ot({},i,{alt:e,className:"components-focal-point-picker__media components-focal-point-picker__media--image",onLoad:r,ref:o,src:n}))}function V0({mediaRef:e,onLoad:t=at.noop,...n}){const r=(0,tt.useRef)(t);return(0,tt.useLayoutEffect)((()=>{window.requestAnimationFrame((()=>{r.current()}))}),[]),(0,tt.createElement)(E0,ot({ref:e},n))}class X0 extends tt.Component{constructor(e){super(...arguments),this.state={isDragging:!1,bounds:z0,percentages:e.value},this.containerRef=(0,tt.createRef)(),this.mediaRef=(0,tt.createRef)(),this.onMouseDown=this.startDrag.bind(this),this.onMouseUp=this.stopDrag.bind(this),this.onKeyDown=this.onKeyDown.bind(this),this.onMouseMove=this.doDrag.bind(this),this.ifDraggingStop=()=>{this.state.isDragging&&this.stopDrag()},this.onChangeAtControls=e=>{this.updateValue(e),this.props.onChange(e)},this.updateBounds=this.updateBounds.bind(this),this.updateValue=this.updateValue.bind(this)}componentDidMount(){const{defaultView:e}=this.containerRef.current.ownerDocument;e.addEventListener("resize",this.updateBounds),this.updateBounds()}componentDidUpdate(e){e.url!==this.props.url&&this.ifDraggingStop();const{isDragging:t,percentages:{x:n,y:r}}=this.state,{value:o}=this.props;t||o.x===n&&o.y===r||this.setState({percentages:this.props.value})}componentWillUnmount(){const{defaultView:e}=this.containerRef.current.ownerDocument;e.removeEventListener("resize",this.updateBounds),this.ifDraggingStop()}calculateBounds(){const e=z0;if(!this.mediaRef.current)return e;if(0===this.mediaRef.current.clientWidth||0===this.mediaRef.current.clientHeight)return e;const t=this.mediaRef.current.clientWidth,n=this.mediaRef.current.clientHeight,r=this.pickerDimensions(),o=r.width/t,a=r.height/n;return a>=o?(e.width=e.right=r.width,e.height=n*o,e.top=(r.height-e.height)/2,e.bottom=e.top+e.height):(e.height=e.bottom=r.height,e.width=t*a,e.left=(r.width-e.width)/2,e.right=e.left+e.width),e}updateValue(e={}){const{x:t,y:n}=e,r={x:parseFloat(t).toFixed(2),y:parseFloat(n).toFixed(2)};this.setState({percentages:r})}updateBounds(){this.setState({bounds:this.calculateBounds()})}startDrag(e){var t,n;e.persist(),this.containerRef.current.focus(),this.setState({isDragging:!0});const{ownerDocument:r}=this.containerRef.current;r.addEventListener("mouseup",this.onMouseUp),r.addEventListener("mousemove",this.onMouseMove);const o=this.getValueFromPoint({x:e.pageX,y:e.pageY},e.shiftKey);this.updateValue(o),null===(t=(n=this.props).onDragStart)||void 0===t||t.call(n,o,e)}stopDrag(e){var t,n;const{ownerDocument:r}=this.containerRef.current;r.removeEventListener("mouseup",this.onMouseUp),r.removeEventListener("mousemove",this.onMouseMove),this.setState({isDragging:!1},(()=>{this.props.onChange(this.state.percentages)})),null===(t=(n=this.props).onDragEnd)||void 0===t||t.call(n,e)}onKeyDown(e){const{keyCode:t,shiftKey:n}=e;if(![im,lm,am,sm].includes(t))return;e.preventDefault();const r={...this.state.percentages},o=n?.1:.01,a=t===im||t===am?-1*o:o,i=t===im||t===lm?"y":"x",s=parseFloat(r[i])+a;r[i]=NL(s,0,1,o),this.updateValue(r),this.props.onChange(r)}doDrag(e){var t,n;e.preventDefault();const r=this.getValueFromPoint({x:e.pageX,y:e.pageY},e.shiftKey);this.updateValue(r),null===(t=(n=this.props).onDrag)||void 0===t||t.call(n,r,e)}getValueFromPoint(e,t){const{bounds:n}=this.state,r=this.pickerDimensions(),o={left:e.x-r.left,top:e.y-r.top},a=Math.max(n.left,Math.min(o.left,n.right)),i=Math.max(n.top,Math.min(o.top,n.bottom));let s=(a-n.left)/(r.width-2*n.left),l=(i-n.top)/(r.height-2*n.top);const c=t?.1:.01;return s=NL(s,0,1,c),l=NL(l,0,1,c),{x:s,y:l}}pickerDimensions(){const e=this.containerRef.current;if(!e)return{width:0,height:0,left:0,top:0};const{clientHeight:t,clientWidth:n}=e,{top:r,left:o}=e.getBoundingClientRect();return{width:n,height:t,top:r+document.body.scrollTop,left:o}}iconCoordinates(){const{bounds:e,percentages:{x:t,y:n}}=this.state;if(void 0===e.left||void 0===e.top)return{left:"50%",top:"50%"};const{width:r,height:o}=this.pickerDimensions();return{left:t*(r-2*e.left)+e.left,top:n*(o-2*e.top)+e.top}}render(){const{autoPlay:e,className:t,help:n,instanceId:r,label:o,url:a}=this.props,{bounds:i,isDragging:s,percentages:l}=this.state,c=this.iconCoordinates(),u=so()("components-focal-point-picker-control",t),d=`inspector-focal-point-picker-control-${r}`;return(0,tt.createElement)(EA,{label:o,id:d,help:n,className:u},(0,tt.createElement)(k0,{className:"components-focal-point-picker-wrapper"},(0,tt.createElement)(w0,{className:"components-focal-point-picker",onKeyDown:this.onKeyDown,onMouseDown:this.onMouseDown,onBlur:this.ifDraggingStop,ref:this.containerRef,role:"button",tabIndex:"-1"},(0,tt.createElement)(j0,{bounds:i,value:l.x+l.y}),(0,tt.createElement)(F0,{alt:er("Media preview"),autoPlay:e,mediaRef:this.mediaRef,onLoad:this.updateBounds,src:a}),(0,tt.createElement)(W0,{coordinates:c,isDragging:s}))),(0,tt.createElement)(D0,{percentages:l,onChange:this.onChangeAtControls}))}}X0.defaultProps={autoPlay:!0,value:{x:.5,y:.5},url:null};const U0=cS(X0),$0=(0,tt.forwardRef)((({className:e,children:t},n)=>(0,tt.createElement)("div",{className:so()("components-panel__row",e),ref:n},t))),K0=[["core/paragraph",{align:"center",fontSize:"large",placeholder:er("Write title…")}]],{__Visualizer:G0}=lN;function J0(){return J0.fastAverageColor||(J0.fastAverageColor=new(M0())),J0.fastAverageColor}function Q0({onChange:e,onUnitChange:t,unit:n="px",value:r=""}){const[o,a]=(0,tt.useState)(null),i=`block-cover-height-input-${Qk(Bj)}`,s="px"===n,l=Lk({availableUnits:JL("spacing.units")||["px","em","rem","vw","vh"],defaultValues:{px:"430",em:"20",rem:"20",vw:"20",vh:"50"}}),c=null!==o?o:r,u=s?50:0;return(0,tt.createElement)(EA,{label:er("Minimum height of cover"),id:i},(0,tt.createElement)(Bj,{id:i,isResetValueOnUnitChange:!0,min:u,onBlur:()=>{null!==o&&a(null)},onChange:n=>{const r=""!==n?parseInt(n,10):void 0;isNaN(r)&&void 0!==r?a(n):(a(null),e(r),void 0===r&&t())},onUnitChange:t,step:"1",style:{maxWidth:80},unit:n,units:l,value:c}))}const Z0={top:!1,right:!1,bottom:!0,left:!1,topRight:!1,bottomRight:!1,bottomLeft:!1,topLeft:!1};function e1({className:e,onResizeStart:t,onResize:n,onResizeStop:r,...o}){const[a,i]=(0,tt.useState)(!1);return(0,tt.createElement)(LG,ot({className:so()(e,{"is-resizing":a}),enable:Z0,onResizeStart:(e,r,o)=>{t(o.clientHeight),n(o.clientHeight)},onResize:(e,t,r)=>{n(r.clientHeight),a||i(!0)},onResizeStop:(e,t,n)=>{r(n.clientHeight),i(!1)},minHeight:50},o))}function t1({x:e,y:t}){return`${Math.round(100*e)}% ${Math.round(100*t)}%`}function n1({disableMediaButtons:e=!1,children:t,noticeUI:n,noticeOperations:r,onSelectMedia:o}){const{removeAllNotices:a,createErrorNotice:i}=r;return(0,tt.createElement)(oj,{icon:(0,tt.createElement)(MB,{icon:l0}),labels:{title:er("Cover"),instructions:er("Upload an image or video file, or pick one from your media library.")},onSelect:o,accept:"image/*,video/*",allowedTypes:m0,notices:n,disableMediaButtons:e,onError:e=>{a(),i(e)}},t)}const r1=lS([eP((e=>{const{toggleSelection:t}=e(nk);return{toggleSelection:t}})),cD({overlayColor:"background-color"}),WK,cS])((function({attributes:e,clientId:t,isSelected:n,noticeUI:r,noticeOperations:o,overlayColor:a,setAttributes:i,setOverlayColor:s,toggleSelection:l}){var c,u;const{contentPosition:d,id:p,backgroundType:m,dimRatio:f,focalPoint:h,hasParallax:g,isRepeated:b,minHeight:v,minHeightUnit:y,style:_,url:M}=e,{gradientClass:k,gradientValue:w,setGradient:E}=function({gradientAttribute:e="gradient",customGradientAttribute:t="customGradient"}={}){const{clientId:n}=ob(),r=JL("color.gradients")||fC,{gradient:o,customGradient:a}=Tl((r=>{const{getBlockAttributes:o}=r(nk),a=o(n)||{};return{customGradient:a[t],gradient:a[e]}}),[n,e,t]),{updateBlockAttributes:i}=ld(nk),s=(0,tt.useCallback)((o=>{const a=vC(r,o);i(n,a?{[e]:a,[t]:void 0}:{[e]:void 0,[t]:o})}),[r,n,i]),l=hC(o);let c;return c=o?gC(r,o):a,{gradientClass:l,gradientValue:c,setGradient:s}}(),L=h0(i),A=((e,t)=>!e&&Qs(t))(p,M),[S,C]=(0,tt.useState)(v),[T,x]=(0,tt.useState)(y),z="vh"===y&&100===v,O=(0,tt.useRef)(),N=function(e,t=50,n,r){const[o,a]=(0,tt.useState)(!1);return(0,tt.useEffect)((()=>{e&&t<=50&&r.current&&J0().getColorAsync(r.current,(e=>{a(e.isDark)}))}),[e,e&&t<=50&&r.current,a]),(0,tt.useEffect)((()=>{if(t>50||!e){if(!n)return void a(!0);a(go()(n).isDark())}}),[n,t>50||!e,a]),(0,tt.useEffect)((()=>{e||n||a(!1)}),[!e&&!n,a]),o}(M,f,a.color,O),D=u0===m,B=d0===m,[I,P]=(0,tt.useState)(null),R=y?`${v}${y}`:v,Y=!(g||b),W={...D&&!Y?p0(M):{backgroundImage:w||void 0},backgroundColor:a.color,minHeight:I||R||void 0},H={objectPosition:h&&Y?t1(h):void 0},q=!!(M||a.color||w),j=B||D&&(!g||b),F=e=>{const[t,n]=O.current?[O.current.style,"objectPosition"]:[U.current.style,"backgroundPosition"];t[n]=t1(e)},V=Tl((e=>e(nk).getBlock(t).innerBlocks.length>0),[t]),X=(0,tt.createElement)(tt.Fragment,null,(0,tt.createElement)(lk,{group:"block"},(0,tt.createElement)(gB,{label:er("Change content position"),value:d,onChange:e=>i({contentPosition:e}),isDisabled:!V}),(0,tt.createElement)(yD,{isActive:z,onToggle:()=>z?i("vh"===T&&100===S?{minHeight:void 0,minHeightUnit:void 0}:{minHeight:S,minHeightUnit:T}):(C(v),x(y),i({minHeight:100,minHeightUnit:"vh"})),isDisabled:!V})),(0,tt.createElement)(lk,{group:"other"},(0,tt.createElement)(Jq,{mediaId:p,mediaURL:M,allowedTypes:m0,accept:"image/*,video/*",onSelect:L,name:er(M?"Replace":"Add Media")})),(0,tt.createElement)(FA,null,!!M&&(0,tt.createElement)(BA,{title:er("Media settings")},D&&(0,tt.createElement)(tt.Fragment,null,(0,tt.createElement)(KN,{label:er("Fixed background"),checked:g,onChange:()=>{i({hasParallax:!g,...g?{}:{focalPoint:void 0}})}}),(0,tt.createElement)(KN,{label:er("Repeated background"),checked:b,onChange:()=>{i({isRepeated:!b})}})),j&&(0,tt.createElement)(U0,{label:er("Focal point picker"),url:M,value:h,onDragStart:F,onDrag:F,onChange:e=>i({focalPoint:e})}),(0,tt.createElement)($0,null,(0,tt.createElement)(Eh,{variant:"secondary",isSmall:!0,className:"block-library-cover__reset-button",onClick:()=>i({url:void 0,id:void 0,backgroundType:void 0,dimRatio:void 0,focalPoint:void 0,hasParallax:void 0,isRepeated:void 0})},er("Clear Media")))),(0,tt.createElement)(BA,{title:er("Dimensions")},(0,tt.createElement)(Q0,{value:I||v,unit:y,onChange:e=>i({minHeight:e}),onUnitChange:e=>i({minHeightUnit:e})})),(0,tt.createElement)(IT,{title:er("Overlay"),initialOpen:!0,settings:[{colorValue:a.color,gradientValue:w,onColorChange:s,onGradientChange:E,label:er("Color")}]},!!M&&(0,tt.createElement)(rT,{label:er("Opacity"),value:f,onChange:e=>i({dimRatio:e}),min:0,max:100,step:10,required:!0})))),U=(0,tt.useRef)(),$=VR({ref:U}),K=GH({className:"wp-block-cover__inner-container"},{template:K0,templateInsertUpdatesSelection:!0});if(!V&&!q)return(0,tt.createElement)(tt.Fragment,null,X,(0,tt.createElement)("div",ot({},$,{className:so()("is-placeholder",$.className)}),(0,tt.createElement)(n1,{noticeUI:r,onSelectMedia:L,noticeOperations:o},(0,tt.createElement)("div",{className:"wp-block-cover__placeholder-background-options"},(0,tt.createElement)(WH,{disableCustomColors:!0,value:a.color,onChange:s,clearable:!1})))));const G=so()(f0(f),{"is-dark-theme":N,"has-background-dim":0!==f,"is-transient":A,"has-parallax":g,"is-repeated":b,[a.class]:a.class,"has-background-gradient":w,[k]:!M&&k,"has-custom-content-position":!g0(d)},b0(d));return(0,tt.createElement)(tt.Fragment,null,X,(0,tt.createElement)("div",ot({},$,{className:so()(G,$.className),style:{...W,...$.style},"data-url":M}),(0,tt.createElement)(G0,{values:null==_||null===(c=_.spacing)||void 0===c?void 0:c.padding,showValues:null==_||null===(u=_.visualizers)||void 0===u?void 0:u.padding}),(0,tt.createElement)(e1,{className:"block-library-cover__resize-container",onResizeStart:()=>{i({minHeightUnit:"px"}),l(!1)},onResize:P,onResizeStop:e=>{l(!0),i({minHeight:e}),P(null)},showHandle:n}),M&&w&&0!==f&&(0,tt.createElement)("span",{"aria-hidden":"true",className:so()("wp-block-cover__gradient-background",k),style:{backgroundImage:w}}),M&&D&&Y&&(0,tt.createElement)("img",{ref:O,className:"wp-block-cover__image-background",alt:"",src:M,style:H}),M&&B&&(0,tt.createElement)("video",{ref:O,className:"wp-block-cover__video-background",autoPlay:!0,muted:!0,loop:!0,src:M,style:H}),A&&(0,tt.createElement)(cq,null),(0,tt.createElement)(n1,{disableMediaButtons:!0,noticeUI:r,onSelectMedia:L,noticeOperations:o}),(0,tt.createElement)("div",K)))}));const o1={from:[{type:"block",blocks:["core/image"],transform:({caption:e,url:t,align:n,id:r,anchor:o,style:a})=>{var i;return Ho("core/cover",{url:t,align:n,id:r,anchor:o,style:{color:{duotone:null==a||null===(i=a.color)||void 0===i?void 0:i.duotone}}},[Ho("core/paragraph",{content:e,fontSize:"large"})])}},{type:"block",blocks:["core/video"],transform:({caption:e,src:t,align:n,id:r,anchor:o})=>Ho("core/cover",{url:t,align:n,id:r,backgroundType:d0,anchor:o},[Ho("core/paragraph",{content:e,fontSize:"large"})])},{type:"block",blocks:["core/group"],isMatch:({backgroundColor:e,gradient:t,style:n})=>{var r,o;return e||(null==n||null===(r=n.color)||void 0===r?void 0:r.background)||(null==n||null===(o=n.color)||void 0===o?void 0:o.gradient)||t},transform:({align:e,anchor:t,backgroundColor:n,gradient:r,style:o},a)=>{var i,s;return Ho("core/cover",{align:e,anchor:t,overlayColor:n,customOverlayColor:null==o||null===(i=o.color)||void 0===i?void 0:i.background,gradient:r,customGradient:null==o||null===(s=o.color)||void 0===s?void 0:s.gradient},a)}}],to:[{type:"block",blocks:["core/image"],isMatch:({backgroundType:e,url:t,overlayColor:n,customOverlayColor:r,gradient:o,customGradient:a})=>t?e===u0:!(n||r||o||a),transform:({title:e,url:t,align:n,id:r,anchor:o,style:a})=>{var i;return Ho("core/image",{caption:e,url:t,align:n,id:r,anchor:o,style:{color:{duotone:null==a||null===(i=a.color)||void 0===i?void 0:i.duotone}}})}},{type:"block",blocks:["core/video"],isMatch:({backgroundType:e,url:t,overlayColor:n,customOverlayColor:r,gradient:o,customGradient:a})=>t?e===d0:!(n||r||o||a),transform:({title:e,url:t,align:n,id:r,anchor:o})=>Ho("core/video",{caption:e,src:t,id:r,align:n,anchor:o})}]},a1={apiVersion:2,name:"core/cover",title:"Cover",category:"media",description:"Add an image or video with a text overlay — great for headers.",textdomain:"default",attributes:{url:{type:"string"},id:{type:"number"},hasParallax:{type:"boolean",default:!1},isRepeated:{type:"boolean",default:!1},dimRatio:{type:"number",default:50},overlayColor:{type:"string"},customOverlayColor:{type:"string"},backgroundType:{type:"string",default:"image"},focalPoint:{type:"object"},minHeight:{type:"number"},minHeightUnit:{type:"string"},gradient:{type:"string"},customGradient:{type:"string"},contentPosition:{type:"string"}},supports:{anchor:!0,align:!0,html:!1,spacing:{padding:!0},color:{__experimentalDuotone:"> .wp-block-cover__image-background, > .wp-block-cover__video-background",text:!1,background:!1}},editorStyle:"wp-block-cover-editor",style:"wp-block-cover"},{name:i1}=a1,s1={icon:l0,example:{attributes:{customOverlayColor:"#065174",dimRatio:40,url:"https://s.w.org/images/core/5.3/Windbuchencom.jpg"},innerBlocks:[{name:"core/paragraph",attributes:{customFontSize:48,content:er("Snow Patrol "),align:"center"}}]},transforms:o1,save:function({attributes:e}){const{backgroundType:t,gradient:n,contentPosition:r,customGradient:o,customOverlayColor:a,dimRatio:i,focalPoint:s,hasParallax:l,isRepeated:c,overlayColor:u,url:d,id:p,minHeight:m,minHeightUnit:f}=e,h=mC("background-color",u),g=hC(n),b=f?`${m}${f}`:m,v=u0===t,y=d0===t,_=!(l||c),M={...v&&!_?p0(d):{},backgroundColor:h?void 0:a,background:o&&!d?o:void 0,minHeight:b||void 0},k=s&&_?`${Math.round(100*s.x)}% ${Math.round(100*s.y)}%`:void 0,w=so()(f0(i),h,{"has-background-dim":0!==i,"has-parallax":l,"is-repeated":c,"has-background-gradient":n||o,[g]:!d&&g,"has-custom-content-position":!g0(r)},b0(r));return(0,tt.createElement)("div",VR.save({className:w,style:M}),d&&(n||o)&&0!==i&&(0,tt.createElement)("span",{"aria-hidden":"true",className:so()("wp-block-cover__gradient-background",g),style:o?{background:o}:void 0}),v&&_&&d&&(0,tt.createElement)("img",{className:so()("wp-block-cover__image-background",p?`wp-image-${p}`:null),alt:"",src:d,style:{objectPosition:k},"data-object-fit":"cover","data-object-position":k}),y&&d&&(0,tt.createElement)("video",{className:so()("wp-block-cover__video-background","intrinsic-ignore"),autoPlay:!0,muted:!0,loop:!0,playsInline:!0,src:d,style:{objectPosition:k},"data-object-fit":"cover","data-object-position":k}),(0,tt.createElement)("div",{className:"wp-block-cover__inner-container"},(0,tt.createElement)(JH.Content,null)))},edit:r1,deprecated:y0},l1=({blockSupportsResponsive:e,showEditButton:t,themeSupportsResponsive:n,allowResponsive:r,getResponsiveHelp:o,toggleResponsive:a,switchBackToURLInput:i})=>(0,tt.createElement)(tt.Fragment,null,(0,tt.createElement)(lk,null,(0,tt.createElement)(tb,null,t&&(0,tt.createElement)(jg,{className:"components-toolbar__control",label:er("Edit URL"),icon:Zq,onClick:i}))),n&&e&&(0,tt.createElement)(FA,null,(0,tt.createElement)(BA,{title:er("Media settings"),className:"blocks-responsive"},(0,tt.createElement)(KN,{label:er("Resize for smaller devices"),checked:r,help:o,onChange:a})))),c1=(0,tt.createElement)(mo,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,tt.createElement)(uo,{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm.5 16c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5V9.8l4.7-5.3H19c.3 0 .5.2.5.5v14zm-6-9.5L16 12l-2.5 2.8 1.1 1L18 12l-3.5-3.5-1 1zm-3 0l-1-1L6 12l3.5 3.8 1.1-1L8 12l2.5-2.5z"})),u1=(0,tt.createElement)(mo,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,tt.createElement)(uo,{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm.5 16c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5V9.8l4.7-5.3H19c.3 0 .5.2.5.5v14zM13.2 7.7c-.4.4-.7 1.1-.7 1.9v3.7c-.4-.3-.8-.4-1.3-.4-1.2 0-2.2 1-2.2 2.2 0 1.2 1 2.2 2.2 2.2.5 0 1-.2 1.4-.5.9-.6 1.4-1.6 1.4-2.6V9.6c0-.4.1-.6.2-.8.3-.3 1-.3 1.6-.3h.2V7h-.2c-.7 0-1.8 0-2.6.7z"})),d1=(0,tt.createElement)(mo,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,tt.createElement)(uo,{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM9.2 4.5H19c.3 0 .5.2.5.5v8.4l-3-2.9c-.3-.3-.8-.3-1 0L11.9 14 9 12c-.3-.2-.6-.2-.8 0l-3.6 2.6V9.8l4.6-5.3zm9.8 15H5c-.3 0-.5-.2-.5-.5v-2.4l4.1-3 3 1.9c.3.2.7.2.9-.1L16 12l3.5 3.4V19c0 .3-.2.5-.5.5z"})),p1=(0,tt.createElement)(mo,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,tt.createElement)(uo,{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm.5 16c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5V9.8l4.7-5.3H19c.3 0 .5.2.5.5v14zM10 15l5-3-5-3v6z"})),m1={foreground:"#1da1f2",src:(0,tt.createElement)(mo,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,tt.createElement)(co,null,(0,tt.createElement)(uo,{d:"M22.23 5.924c-.736.326-1.527.547-2.357.646.847-.508 1.498-1.312 1.804-2.27-.793.47-1.67.812-2.606.996C18.325 4.498 17.258 4 16.078 4c-2.266 0-4.103 1.837-4.103 4.103 0 .322.036.635.106.935-3.41-.17-6.433-1.804-8.457-4.287-.353.607-.556 1.312-.556 2.064 0 1.424.724 2.68 1.825 3.415-.673-.022-1.305-.207-1.86-.514v.052c0 1.988 1.415 3.647 3.293 4.023-.344.095-.707.145-1.08.145-.265 0-.522-.026-.773-.074.522 1.63 2.038 2.817 3.833 2.85-1.404 1.1-3.174 1.757-5.096 1.757-.332 0-.66-.02-.98-.057 1.816 1.164 3.973 1.843 6.29 1.843 7.547 0 11.675-6.252 11.675-11.675 0-.178-.004-.355-.012-.53.802-.578 1.497-1.3 2.047-2.124z"})))},f1={foreground:"#ff0000",src:(0,tt.createElement)(mo,{viewBox:"0 0 24 24"},(0,tt.createElement)(uo,{d:"M21.8 8s-.195-1.377-.795-1.984c-.76-.797-1.613-.8-2.004-.847-2.798-.203-6.996-.203-6.996-.203h-.01s-4.197 0-6.996.202c-.39.046-1.242.05-2.003.846C2.395 6.623 2.2 8 2.2 8S2 9.62 2 11.24v1.517c0 1.618.2 3.237.2 3.237s.195 1.378.795 1.985c.76.797 1.76.77 2.205.855 1.6.153 6.8.2 6.8.2s4.203-.005 7-.208c.392-.047 1.244-.05 2.005-.847.6-.607.795-1.985.795-1.985s.2-1.618.2-3.237v-1.517C22 9.62 21.8 8 21.8 8zM9.935 14.595v-5.62l5.403 2.82-5.403 2.8z"}))},h1={foreground:"#3b5998",src:(0,tt.createElement)(mo,{viewBox:"0 0 24 24"},(0,tt.createElement)(uo,{d:"M20 3H4c-.6 0-1 .4-1 1v16c0 .5.4 1 1 1h8.6v-7h-2.3v-2.7h2.3v-2c0-2.3 1.4-3.6 3.5-3.6 1 0 1.8.1 2.1.1v2.4h-1.4c-1.1 0-1.3.5-1.3 1.3v1.7h2.7l-.4 2.8h-2.3v7H20c.5 0 1-.4 1-1V4c0-.6-.4-1-1-1z"}))},g1=(0,tt.createElement)(mo,{viewBox:"0 0 24 24"},(0,tt.createElement)(co,null,(0,tt.createElement)(uo,{d:"M12 4.622c2.403 0 2.688.01 3.637.052.877.04 1.354.187 1.67.31.42.163.72.358 1.036.673.315.315.51.615.673 1.035.123.317.27.794.31 1.67.043.95.052 1.235.052 3.638s-.01 2.688-.052 3.637c-.04.877-.187 1.354-.31 1.67-.163.42-.358.72-.673 1.036-.315.315-.615.51-1.035.673-.317.123-.794.27-1.67.31-.95.043-1.234.052-3.638.052s-2.688-.01-3.637-.052c-.877-.04-1.354-.187-1.67-.31-.42-.163-.72-.358-1.036-.673-.315-.315-.51-.615-.673-1.035-.123-.317-.27-.794-.31-1.67-.043-.95-.052-1.235-.052-3.638s.01-2.688.052-3.637c.04-.877.187-1.354.31-1.67.163-.42.358-.72.673-1.036.315-.315.615-.51 1.035-.673.317-.123.794-.27 1.67-.31.95-.043 1.235-.052 3.638-.052M12 3c-2.444 0-2.75.01-3.71.054s-1.613.196-2.185.418c-.592.23-1.094.538-1.594 1.04-.5.5-.807 1-1.037 1.593-.223.572-.375 1.226-.42 2.184C3.01 9.25 3 9.555 3 12s.01 2.75.054 3.71.196 1.613.418 2.186c.23.592.538 1.094 1.038 1.594s1.002.808 1.594 1.038c.572.222 1.227.375 2.185.418.96.044 1.266.054 3.71.054s2.75-.01 3.71-.054 1.613-.196 2.186-.418c.592-.23 1.094-.538 1.594-1.038s.808-1.002 1.038-1.594c.222-.572.375-1.227.418-2.185.044-.96.054-1.266.054-3.71s-.01-2.75-.054-3.71-.196-1.613-.418-2.186c-.23-.592-.538-1.094-1.038-1.594s-1.002-.808-1.594-1.038c-.572-.222-1.227-.375-2.185-.418C14.75 3.01 14.445 3 12 3zm0 4.378c-2.552 0-4.622 2.07-4.622 4.622s2.07 4.622 4.622 4.622 4.622-2.07 4.622-4.622S14.552 7.378 12 7.378zM12 15c-1.657 0-3-1.343-3-3s1.343-3 3-3 3 1.343 3 3-1.343 3-3 3zm4.804-8.884c-.596 0-1.08.484-1.08 1.08s.484 1.08 1.08 1.08c.596 0 1.08-.484 1.08-1.08s-.483-1.08-1.08-1.08z"}))),b1={foreground:"#0073AA",src:(0,tt.createElement)(mo,{viewBox:"0 0 24 24"},(0,tt.createElement)(co,null,(0,tt.createElement)(uo,{d:"M12.158 12.786l-2.698 7.84c.806.236 1.657.365 2.54.365 1.047 0 2.05-.18 2.986-.51-.024-.037-.046-.078-.065-.123l-2.762-7.57zM3.008 12c0 3.56 2.07 6.634 5.068 8.092L3.788 8.342c-.5 1.117-.78 2.354-.78 3.658zm15.06-.454c0-1.112-.398-1.88-.74-2.48-.456-.74-.883-1.368-.883-2.11 0-.825.627-1.595 1.51-1.595.04 0 .078.006.116.008-1.598-1.464-3.73-2.36-6.07-2.36-3.14 0-5.904 1.613-7.512 4.053.21.008.41.012.58.012.94 0 2.395-.114 2.395-.114.484-.028.54.684.057.74 0 0-.487.058-1.03.086l3.275 9.74 1.968-5.902-1.4-3.838c-.485-.028-.944-.085-.944-.085-.486-.03-.43-.77.056-.742 0 0 1.484.114 2.368.114.94 0 2.397-.114 2.397-.114.486-.028.543.684.058.74 0 0-.488.058-1.03.086l3.25 9.665.897-2.997c.456-1.17.684-2.137.684-2.907zm1.82-3.86c.04.286.06.593.06.924 0 .912-.17 1.938-.683 3.22l-2.746 7.94c2.672-1.558 4.47-4.454 4.47-7.77 0-1.564-.4-3.033-1.1-4.314zM12 22C6.486 22 2 17.514 2 12S6.486 2 12 2s10 4.486 10 10-4.486 10-10 10z"})))},v1={foreground:"#1db954",src:(0,tt.createElement)(mo,{viewBox:"0 0 24 24"},(0,tt.createElement)(uo,{d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2m4.586 14.424c-.18.295-.563.387-.857.207-2.35-1.434-5.305-1.76-8.786-.963-.335.077-.67-.133-.746-.47-.077-.334.132-.67.47-.745 3.808-.87 7.076-.496 9.712 1.115.293.18.386.563.206.857M17.81 13.7c-.226.367-.706.482-1.072.257-2.687-1.652-6.785-2.13-9.965-1.166-.413.127-.848-.106-.973-.517-.125-.413.108-.848.52-.973 3.632-1.102 8.147-.568 11.234 1.328.366.226.48.707.256 1.072m.105-2.835C14.692 8.95 9.375 8.775 6.297 9.71c-.493.15-1.016-.13-1.166-.624-.148-.495.13-1.017.625-1.167 3.532-1.073 9.404-.866 13.115 1.337.445.264.59.838.327 1.282-.264.443-.838.59-1.282.325"}))},y1=(0,tt.createElement)(mo,{viewBox:"0 0 24 24"},(0,tt.createElement)(uo,{d:"m6.5 7c-2.75 0-5 2.25-5 5s2.25 5 5 5 5-2.25 5-5-2.25-5-5-5zm11 0c-2.75 0-5 2.25-5 5s2.25 5 5 5 5-2.25 5-5-2.25-5-5-5z"})),_1={foreground:"#1ab7ea",src:(0,tt.createElement)(mo,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,tt.createElement)(co,null,(0,tt.createElement)(uo,{d:"M22.396 7.164c-.093 2.026-1.507 4.8-4.245 8.32C15.323 19.16 12.93 21 10.97 21c-1.214 0-2.24-1.12-3.08-3.36-.56-2.052-1.118-4.105-1.68-6.158-.622-2.24-1.29-3.36-2.004-3.36-.156 0-.7.328-1.634.98l-.978-1.26c1.027-.903 2.04-1.806 3.037-2.71C6 3.95 7.03 3.328 7.716 3.265c1.62-.156 2.616.95 2.99 3.32.404 2.558.685 4.148.84 4.77.468 2.12.982 3.18 1.543 3.18.435 0 1.09-.687 1.963-2.064.872-1.376 1.34-2.422 1.402-3.142.125-1.187-.343-1.782-1.4-1.782-.5 0-1.013.115-1.542.34 1.023-3.35 2.977-4.976 5.862-4.883 2.14.063 3.148 1.45 3.024 4.16z"})))},M1=(0,tt.createElement)(mo,{viewBox:"0 0 24 24"},(0,tt.createElement)(uo,{d:"M22 11.816c0-1.256-1.02-2.277-2.277-2.277-.593 0-1.122.24-1.526.613-1.48-.965-3.455-1.594-5.647-1.69l1.17-3.702 3.18.75c.01 1.027.847 1.86 1.877 1.86 1.035 0 1.877-.84 1.877-1.877 0-1.035-.842-1.877-1.877-1.877-.77 0-1.43.466-1.72 1.13L13.55 3.92c-.204-.047-.4.067-.46.26l-1.35 4.27c-2.317.037-4.412.67-5.97 1.67-.402-.355-.917-.58-1.493-.58C3.02 9.54 2 10.56 2 11.815c0 .814.433 1.523 1.078 1.925-.037.222-.06.445-.06.673 0 3.292 4.01 5.97 8.94 5.97s8.94-2.678 8.94-5.97c0-.214-.02-.424-.052-.632.687-.39 1.154-1.12 1.154-1.964zm-3.224-7.422c.606 0 1.1.493 1.1 1.1s-.493 1.1-1.1 1.1-1.1-.494-1.1-1.1.493-1.1 1.1-1.1zm-16 7.422c0-.827.673-1.5 1.5-1.5.313 0 .598.103.838.27-.85.675-1.477 1.478-1.812 2.36-.32-.274-.525-.676-.525-1.13zm9.183 7.79c-4.502 0-8.165-2.33-8.165-5.193S7.457 9.22 11.96 9.22s8.163 2.33 8.163 5.193-3.663 5.193-8.164 5.193zM20.635 13c-.326-.89-.948-1.7-1.797-2.383.247-.186.55-.3.882-.3.827 0 1.5.672 1.5 1.5 0 .482-.23.91-.586 1.184zm-11.64 1.704c-.76 0-1.397-.616-1.397-1.376 0-.76.636-1.397 1.396-1.397.76 0 1.376.638 1.376 1.398 0 .76-.616 1.376-1.376 1.376zm7.405-1.376c0 .76-.615 1.376-1.375 1.376s-1.4-.616-1.4-1.376c0-.76.64-1.397 1.4-1.397.76 0 1.376.638 1.376 1.398zm-1.17 3.38c.15.152.15.398 0 .55-.675.674-1.728 1.002-3.22 1.002l-.01-.002-.012.002c-1.492 0-2.544-.328-3.218-1.002-.152-.152-.152-.398 0-.55.152-.152.4-.15.55 0 .52.52 1.394.775 2.67.775l.01.002.01-.002c1.276 0 2.15-.253 2.67-.775.15-.152.398-.152.55 0z"})),k1={foreground:"#35465c",src:(0,tt.createElement)(mo,{viewBox:"0 0 24 24"},(0,tt.createElement)(uo,{d:"M19 3H5a2 2 0 00-2 2v14c0 1.1.9 2 2 2h14a2 2 0 002-2V5a2 2 0 00-2-2zm-5.69 14.66c-2.72 0-3.1-1.9-3.1-3.16v-3.56H8.49V8.99c1.7-.62 2.54-1.99 2.64-2.87 0-.06.06-.41.06-.58h1.9v3.1h2.17v2.3h-2.18v3.1c0 .47.13 1.3 1.2 1.26h1.1v2.36c-1.01.02-2.07 0-2.07 0z"}))},w1=(0,tt.createElement)(mo,{viewBox:"0 0 24 24"},(0,tt.createElement)(uo,{d:"M18.42 14.58c-.51-.66-1.05-1.23-1.05-2.5V7.87c0-1.8.15-3.45-1.2-4.68-1.05-1.02-2.79-1.35-4.14-1.35-2.6 0-5.52.96-6.12 4.14-.06.36.18.54.4.57l2.66.3c.24-.03.42-.27.48-.5.24-1.12 1.17-1.63 2.2-1.63.56 0 1.22.21 1.55.7.4.56.33 1.31.33 1.97v.36c-1.59.18-3.66.27-5.16.93a4.63 4.63 0 0 0-2.93 4.44c0 2.82 1.8 4.23 4.1 4.23 1.95 0 3.03-.45 4.53-1.98.51.72.66 1.08 1.59 1.83.18.09.45.09.63-.1v.04l2.1-1.8c.24-.21.2-.48.03-.75zm-5.4-1.2c-.45.75-1.14 1.23-1.92 1.23-1.05 0-1.65-.81-1.65-1.98 0-2.31 2.1-2.73 4.08-2.73v.6c0 1.05.03 1.92-.5 2.88z"}),(0,tt.createElement)(uo,{d:"M21.69 19.2a17.62 17.62 0 0 1-21.6-1.57c-.23-.2 0-.5.28-.33a23.88 23.88 0 0 0 20.93 1.3c.45-.19.84.3.39.6z"}),(0,tt.createElement)(uo,{d:"M22.8 17.96c-.36-.45-2.22-.2-3.1-.12-.23.03-.3-.18-.05-.36 1.5-1.05 3.96-.75 4.26-.39.3.36-.1 2.82-1.5 4.02-.21.18-.42.1-.3-.15.3-.8 1.02-2.58.69-3z"})),E1=(0,tt.createElement)(mo,{viewBox:"0 0 24 24"},(0,tt.createElement)(uo,{d:"m.0206909 21 19.8160091-13.07806 3.5831 6.20826z",fill:"#4bc7ee"}),(0,tt.createElement)(uo,{d:"m23.7254 19.0205-10.1074-17.18468c-.6421-1.114428-1.7087-1.114428-2.3249 0l-11.2931 19.16418h22.5655c1.279 0 1.8019-.8905 1.1599-1.9795z",fill:"#d4cdcb"}),(0,tt.createElement)(uo,{d:"m.0206909 21 15.2439091-16.38571 4.3029 7.32271z",fill:"#c3d82e"}),(0,tt.createElement)(uo,{d:"m13.618 1.83582c-.6421-1.114428-1.7087-1.114428-2.3249 0l-11.2931 19.16418 15.2646-16.38573z",fill:"#e4ecb0"}),(0,tt.createElement)(uo,{d:"m.0206909 21 19.5468091-9.063 1.6621 2.8344z",fill:"#209dbd"}),(0,tt.createElement)(uo,{d:"m.0206909 21 17.9209091-11.82623 1.6259 2.76323z",fill:"#7cb3c9"})),L1=(0,tt.createElement)(mo,{viewBox:"0 0 24 24"},(0,tt.createElement)(uo,{d:"m12.1479 18.5957c-2.4949 0-4.28131-1.7558-4.28131-4.0658 0-2.2176 1.78641-4.0965 4.09651-4.0965 2.2793 0 4.0349 1.7864 4.0349 4.1581 0 2.2794-1.7556 4.0042-3.8501 4.0042zm8.3521-18.5957-4.5329 1v7c-1.1088-1.41691-2.8028-1.8787-4.8049-1.8787-2.09443 0-3.97329.76993-5.5133 2.27917-1.72483 1.66323-2.6489 3.78863-2.6489 6.16033 0 2.5873.98562 4.8049 2.89526 6.499 1.44763 1.2936 3.17251 1.9402 5.17454 1.9402 1.9713 0 3.4498-.5236 4.8973-1.9402v1.9402h4.5329c0-7.6359 0-15.3641 0-23z",fill:"#333436"})),A1=()=>(0,tt.createElement)("div",{className:"wp-block-embed is-loading"},(0,tt.createElement)(cq,null),(0,tt.createElement)("p",null,er("Embedding…"))),S1=({icon:e,label:t,value:n,onSubmit:r,onChange:o,cannotEmbed:a,fallback:i,tryAgain:s})=>(0,tt.createElement)(vH,{icon:(0,tt.createElement)(MB,{icon:e,showColors:!0}),label:t,className:"wp-block-embed",instructions:er("Paste a link to the content you want to display on your site.")},(0,tt.createElement)("form",{onSubmit:r},(0,tt.createElement)("input",{type:"url",value:n||"",className:"components-placeholder__input","aria-label":t,placeholder:er("Enter URL to embed here…"),onChange:o}),(0,tt.createElement)(Eh,{variant:"primary",type:"submit"},tr("Embed","button label"))),(0,tt.createElement)("div",{className:"components-placeholder__learn-more"},(0,tt.createElement)(CA,{href:er("https://wordpress.org/support/article/embeds/")},er("Learn more about embeds"))),a&&(0,tt.createElement)("div",{className:"components-placeholder__error"},(0,tt.createElement)("div",{className:"components-placeholder__instructions"},er("Sorry, this content could not be embedded.")),(0,tt.createElement)(Eh,{variant:"secondary",onClick:s},tr("Try again","button label"))," ",(0,tt.createElement)(Eh,{variant:"secondary",onClick:i},tr("Convert to link","button label"))));function C1({iframeRef:e,...t}){const n=(0,tt.useRef)(),r=Ym([e,n]);return(0,tt.useEffect)((()=>{const e=n.current,{ownerDocument:t}=e,{defaultView:r}=t;function o(){t.activeElement===e&&e.focus()}return r.addEventListener("blur",o),()=>{r.removeEventListener("blur",o)}}),[]),(0,tt.createElement)("iframe",ot({ref:r},t))}function T1({html:e="",title:t="",type:n,styles:r=[],scripts:o=[],onFocus:a}){const i=(0,tt.useRef)(),[s,l]=(0,tt.useState)(0),[c,u]=(0,tt.useState)(0);function d(a=!1){if(!function(){try{return!!i.current.contentDocument.body}catch(e){return!1}}())return;const{contentDocument:s,ownerDocument:l}=i.current,{body:c}=s;if(!a&&null!==c.getAttribute("data-resizable-iframe-connected"))return;const u=(0,tt.createElement)("html",{lang:l.documentElement.lang,className:n},(0,tt.createElement)("head",null,(0,tt.createElement)("title",null,t),(0,tt.createElement)("style",{dangerouslySetInnerHTML:{__html:"\n\tbody {\n\t\tmargin: 0;\n\t}\n\thtml,\n\tbody,\n\tbody > div,\n\tbody > div iframe {\n\t\twidth: 100%;\n\t}\n\thtml.wp-has-aspect-ratio,\n\tbody.wp-has-aspect-ratio,\n\tbody.wp-has-aspect-ratio > div,\n\tbody.wp-has-aspect-ratio > div iframe {\n\t\theight: 100%;\n\t\toverflow: hidden; /* If it has an aspect ratio, it shouldn't scroll. */\n\t}\n\tbody > div > * {\n\t\tmargin-top: 0 !important; /* Has to have !important to override inline styles. */\n\t\tmargin-bottom: 0 !important;\n\t}\n"}}),r.map(((e,t)=>(0,tt.createElement)("style",{key:t,dangerouslySetInnerHTML:{__html:e}})))),(0,tt.createElement)("body",{"data-resizable-iframe-connected":"data-resizable-iframe-connected",className:n},(0,tt.createElement)("div",{dangerouslySetInnerHTML:{__html:e}}),(0,tt.createElement)("script",{type:"text/javascript",dangerouslySetInnerHTML:{__html:"\n\t( function() {\n\t\tvar observer;\n\n\t\tif ( ! window.MutationObserver || ! document.body || ! window.parent ) {\n\t\t\treturn;\n\t\t}\n\n\t\tfunction sendResize() {\n\t\t\tvar clientBoundingRect = document.body.getBoundingClientRect();\n\n\t\t\twindow.parent.postMessage( {\n\t\t\t\taction: 'resize',\n\t\t\t\twidth: clientBoundingRect.width,\n\t\t\t\theight: clientBoundingRect.height,\n\t\t\t}, '*' );\n\t\t}\n\n\t\tobserver = new MutationObserver( sendResize );\n\t\tobserver.observe( document.body, {\n\t\t\tattributes: true,\n\t\t\tattributeOldValue: false,\n\t\t\tcharacterData: true,\n\t\t\tcharacterDataOldValue: false,\n\t\t\tchildList: true,\n\t\t\tsubtree: true\n\t\t} );\n\n\t\twindow.addEventListener( 'load', sendResize, true );\n\n\t\t// Hack: Remove viewport unit styles, as these are relative\n\t\t// the iframe root and interfere with our mechanism for\n\t\t// determining the unconstrained page bounds.\n\t\tfunction removeViewportStyles( ruleOrNode ) {\n\t\t\tif( ruleOrNode.style ) {\n\t\t\t\t[ 'width', 'height', 'minHeight', 'maxHeight' ].forEach( function( style ) {\n\t\t\t\t\tif ( /^\\d+(vmin|vmax|vh|vw)$/.test( ruleOrNode.style[ style ] ) ) {\n\t\t\t\t\t\truleOrNode.style[ style ] = '';\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t}\n\t\t}\n\n\t\tArray.prototype.forEach.call( document.querySelectorAll( '[style]' ), removeViewportStyles );\n\t\tArray.prototype.forEach.call( document.styleSheets, function( stylesheet ) {\n\t\t\tArray.prototype.forEach.call( stylesheet.cssRules || stylesheet.rules, removeViewportStyles );\n\t\t} );\n\n\t\tdocument.body.style.position = 'absolute';\n\t\tdocument.body.style.width = '100%';\n\t\tdocument.body.setAttribute( 'data-resizable-iframe-connected', '' );\n\n\t\tsendResize();\n\n\t\t// Resize events can change the width of elements with 100% width, but we don't\n\t\t// get an DOM mutations for that, so do the resize when the window is resized, too.\n\t\twindow.addEventListener( 'resize', sendResize, true );\n} )();"}}),o.map((e=>(0,tt.createElement)("script",{key:e,src:e})))));s.open(),s.write(""+ti(u)),s.close()}return(0,tt.useEffect)((()=>{function e(){d(!1)}function t(e){const t=i.current;if(!t||t.contentWindow!==e.source)return;let n=e.data||{};if("string"==typeof n)try{n=JSON.parse(n)}catch(e){}"resize"===n.action&&(l(n.width),u(n.height))}d();const{ownerDocument:n}=i.current,{defaultView:r}=n;return i.current.addEventListener("load",e,!1),r.addEventListener("message",t),()=>{var n;null===(n=i.current)||void 0===n||n.removeEventListener("load",e,!1),r.addEventListener("message",t)}}),[]),(0,tt.useEffect)((()=>{d()}),[t,n,r,o]),(0,tt.useEffect)((()=>{d(!0)}),[e]),(0,tt.createElement)(C1,{iframeRef:i,title:t,className:"components-sandbox",sandbox:"allow-scripts allow-same-origin allow-presentation",onFocus:a,width:Math.ceil(s),height:Math.ceil(c)})}function x1({html:e}){const t=(0,tt.useRef)();(0,tt.useEffect)((()=>{const{ownerDocument:e}=t.current,{defaultView:n}=e;function r({data:{secret:t,message:n,value:r}={}}){[t,n,r].some((e=>!e))||"height"!==n||e.querySelectorAll(`iframe[data-secret="${t}"`).forEach((e=>{+e.height!==r&&(e.height=r)}))}function o(){const{activeElement:n}=e;"IFRAME"===n.tagName&&n.parentNode===t.current&&n.focus()}return n.addEventListener("message",r),n.addEventListener("blur",o),()=>{n.removeEventListener("message",r),n.removeEventListener("blur",o)}}),[]);const n=(0,tt.useMemo)((()=>{const t=(new window.DOMParser).parseFromString(e,"text/html"),n=t.querySelector("iframe");n&&n.removeAttribute("style");const r=t.querySelector("blockquote");return r&&(r.style.display="none"),t.body.innerHTML}),[e]);return(0,tt.createElement)("div",{ref:t,className:"wp-block-embed__wrapper",dangerouslySetInnerHTML:{__html:n}})}class z1 extends tt.Component{constructor(){super(...arguments),this.hideOverlay=this.hideOverlay.bind(this),this.state={interactive:!1}}static getDerivedStateFromProps(e,t){return!e.isSelected&&t.interactive?{interactive:!1}:null}hideOverlay(){this.setState({interactive:!0})}render(){const{preview:e,previewable:t,url:n,type:r,caption:o,onCaptionChange:a,isSelected:i,className:s,icon:l,label:c,insertBlocksAfter:u}=this.props,{scripts:d}=e,{interactive:p}=this.state,m="photo"===r?(e=>{const t=e.thumbnail_url||e.url,n=(0,tt.createElement)("p",null,(0,tt.createElement)("img",{src:t,alt:e.title,width:"100%"}));return ti(n)})(e):e.html,f=new URL(n).host.split("."),h=f.splice(f.length-2,f.length-1).join("."),g=pn(er("Embedded content from %s"),h),b=NG()(r,s,"wp-block-embed__wrapper"),v="wp-embed"===r?(0,tt.createElement)(x1,{html:m}):(0,tt.createElement)("div",{className:"wp-block-embed__wrapper"},(0,tt.createElement)(T1,{html:m,scripts:d,title:g,type:b,onFocus:this.hideOverlay}),!p&&(0,tt.createElement)("div",{className:"block-library-embed__interactive-overlay",onMouseUp:this.hideOverlay}));return(0,tt.createElement)("figure",{className:NG()(s,"wp-block-embed",{"is-type-video":"video"===r})},t?v:(0,tt.createElement)(vH,{icon:(0,tt.createElement)(MB,{icon:l,showColors:!0}),label:c},(0,tt.createElement)("p",{className:"components-placeholder__error"},(0,tt.createElement)("a",{href:n},n)),(0,tt.createElement)("p",{className:"components-placeholder__error"},pn(er("Embedded content from %s can't be previewed in the editor."),h))),(!Cj.isEmpty(o)||i)&&(0,tt.createElement)(Cj,{tagName:"figcaption",placeholder:er("Add caption"),value:o,onChange:a,inlineToolbar:!0,__unstableOnSplitAtEnd:()=>u(Ho("core/paragraph"))}))}}const O1=z1;function N1(e){return er(e?"This embed will preserve its aspect ratio when the browser is resized.":"This embed may not preserve its aspect ratio when the browser is resized.")}const D1=e=>{const{attributes:{providerNameSlug:t,previewable:n,responsive:r,url:o},attributes:a,isSelected:i,onReplace:s,setAttributes:l,insertBlocksAfter:c,onFocus:u}=e,d={title:tr("Embed","block title"),icon:c1},{icon:p,title:m}=(e=>{var t;return null===(t=Wo(DG))||void 0===t?void 0:t.find((({name:t})=>t===e))})(t)||d,[f,h]=(0,tt.useState)(o),[g,b]=(0,tt.useState)(!1),{invalidateResolution:v}=ld(yd),{preview:y,fetching:_,themeSupportsResponsive:M,cannotEmbed:k}=Tl((e=>{var t;const{getEmbedPreview:n,isPreviewEmbedFallback:r,isRequestingEmbedPreview:a,getThemeSupports:i}=e(yd);if(!o)return{fetching:!1,cannotEmbed:!1};const s=n(o),l=r(o),c=!1===(null==s?void 0:s.html)&&void 0===(null==s?void 0:s.type),u=404===(null==s||null===(t=s.data)||void 0===t?void 0:t.status),d=!!s&&!c&&!u;return{preview:d?s:void 0,fetching:a(o),themeSupportsResponsive:i()["responsive-embeds"],cannotEmbed:!d||l}}),[o]),w=()=>{const{allowResponsive:e,className:t}=a;return{...a,...YG(y,m,t,r,e)}};(0,tt.useEffect)((()=>{if(null==y||!y.html||!k||_)return;const e=o.replace(/\/$/,"");h(e),b(!1),l({url:e})}),[null==y?void 0:y.html,o]),(0,tt.useEffect)((()=>{if(y&&!g&&(l(w()),s)){const t=IG(e,w());t&&s(t)}}),[y,g]);const E=VR();if(_)return(0,tt.createElement)(mQ,E,(0,tt.createElement)(A1,null));const L=pn(er("%s URL"),m);if(!y||k||g)return(0,tt.createElement)(mQ,E,(0,tt.createElement)(S1,{icon:p,label:L,onFocus:u,onSubmit:e=>{e&&e.preventDefault(),b(!1),l({url:f})},value:f,cannotEmbed:k,onChange:e=>h(e.target.value),fallback:()=>function(e,t){const n=(0,tt.createElement)("a",{href:e},e);t(Ho("core/paragraph",{content:ti(n)}))}(f,s),tryAgain:()=>{v("getEmbedPreview",[f])}}));const{caption:A,type:S,allowResponsive:C,className:T}=w(),x=so()(T,e.className);return(0,tt.createElement)(tt.Fragment,null,(0,tt.createElement)(l1,{showEditButton:y&&!k,themeSupportsResponsive:M,blockSupportsResponsive:r,allowResponsive:C,getResponsiveHelp:N1,toggleResponsive:()=>{const{allowResponsive:e,className:t}=a,{html:n}=y,o=!e;l({allowResponsive:o,className:RG(n,t,r&&o)})},switchBackToURLInput:()=>b(!0)}),(0,tt.createElement)(mQ,E,(0,tt.createElement)(O1,{preview:y,previewable:n,className:x,url:f,type:S,caption:A,onCaptionChange:e=>l({caption:e}),isSelected:i,icon:p,label:L,insertBlocksAfter:c})))};const{name:B1}={apiVersion:2,name:"core/embed",title:"Embed",category:"embed",description:"Add a block that displays content pulled from other sites, like Twitter or YouTube.",textdomain:"default",attributes:{url:{type:"string"},caption:{type:"string",source:"html",selector:"figcaption"},type:{type:"string"},providerNameSlug:{type:"string"},allowResponsive:{type:"boolean",default:!0},responsive:{type:"boolean",default:!1},previewable:{type:"boolean",default:!0}},supports:{align:!0},editorStyle:"wp-block-embed-editor",style:"wp-block-embed"},I1={from:[{type:"raw",isMatch:e=>{var t,n;return"P"===e.nodeName&&/^\s*(https?:\/\/\S+)\s*$/i.test(e.textContent)&&1===(null===(t=e.textContent)||void 0===t||null===(n=t.match(/https/gi))||void 0===n?void 0:n.length)},transform:e=>Ho(B1,{url:e.textContent.trim()})}],to:[{type:"block",blocks:["core/paragraph"],isMatch:({url:e})=>!!e,transform:({url:e,caption:t})=>{let n=`${e} `;return null!=t&&t.trim()&&(n+=` ${t}`),Ho("core/paragraph",{content:n})}}]},P1=[{name:"twitter",title:"Twitter",icon:m1,keywords:["tweet",er("social")],description:er("Embed a tweet."),patterns:[/^https?:\/\/(www\.)?twitter\.com\/.+/i],attributes:{providerNameSlug:"twitter",responsive:!0}},{name:"youtube",title:"YouTube",icon:f1,keywords:[er("music"),er("video")],description:er("Embed a YouTube video."),patterns:[/^https?:\/\/((m|www)\.)?youtube\.com\/.+/i,/^https?:\/\/youtu\.be\/.+/i],attributes:{providerNameSlug:"youtube",responsive:!0}},{name:"facebook",title:"Facebook",icon:h1,keywords:[er("social")],description:er("Embed a Facebook post."),scope:["block"],patterns:[],attributes:{providerNameSlug:"facebook",previewable:!1,responsive:!0}},{name:"instagram",title:"Instagram",icon:g1,keywords:[er("image"),er("social")],description:er("Embed an Instagram post."),scope:["block"],patterns:[],attributes:{providerNameSlug:"instagram",responsive:!0}},{name:"wordpress",title:"WordPress",icon:b1,keywords:[er("post"),er("blog")],description:er("Embed a WordPress post."),attributes:{providerNameSlug:"wordpress"}},{name:"soundcloud",title:"SoundCloud",icon:u1,keywords:[er("music"),er("audio")],description:er("Embed SoundCloud content."),patterns:[/^https?:\/\/(www\.)?soundcloud\.com\/.+/i],attributes:{providerNameSlug:"soundcloud",responsive:!0}},{name:"spotify",title:"Spotify",icon:v1,keywords:[er("music"),er("audio")],description:er("Embed Spotify content."),patterns:[/^https?:\/\/(open|play)\.spotify\.com\/.+/i],attributes:{providerNameSlug:"spotify",responsive:!0}},{name:"flickr",title:"Flickr",icon:y1,keywords:[er("image")],description:er("Embed Flickr content."),patterns:[/^https?:\/\/(www\.)?flickr\.com\/.+/i,/^https?:\/\/flic\.kr\/.+/i],attributes:{providerNameSlug:"flickr",responsive:!0}},{name:"vimeo",title:"Vimeo",icon:_1,keywords:[er("video")],description:er("Embed a Vimeo video."),patterns:[/^https?:\/\/(www\.)?vimeo\.com\/.+/i],attributes:{providerNameSlug:"vimeo",responsive:!0}},{name:"animoto",title:"Animoto",icon:E1,description:er("Embed an Animoto video."),patterns:[/^https?:\/\/(www\.)?(animoto|video214)\.com\/.+/i],attributes:{providerNameSlug:"animoto",responsive:!0}},{name:"cloudup",title:"Cloudup",icon:c1,description:er("Embed Cloudup content."),patterns:[/^https?:\/\/cloudup\.com\/.+/i],attributes:{providerNameSlug:"cloudup",responsive:!0}},{name:"collegehumor",title:"CollegeHumor",icon:p1,description:er("Embed CollegeHumor content."),scope:["block"],patterns:[],attributes:{providerNameSlug:"collegehumor",responsive:!0}},{name:"crowdsignal",title:"Crowdsignal",icon:c1,keywords:["polldaddy",er("survey")],description:er("Embed Crowdsignal (formerly Polldaddy) content."),patterns:[/^https?:\/\/((.+\.)?polldaddy\.com|poll\.fm|.+\.survey\.fm)\/.+/i],attributes:{providerNameSlug:"crowdsignal",responsive:!0}},{name:"dailymotion",title:"Dailymotion",icon:L1,keywords:[er("video")],description:er("Embed a Dailymotion video."),patterns:[/^https?:\/\/(www\.)?dailymotion\.com\/.+/i],attributes:{providerNameSlug:"dailymotion",responsive:!0}},{name:"imgur",title:"Imgur",icon:d1,description:er("Embed Imgur content."),patterns:[/^https?:\/\/(.+\.)?imgur\.com\/.+/i],attributes:{providerNameSlug:"imgur",responsive:!0}},{name:"issuu",title:"Issuu",icon:c1,description:er("Embed Issuu content."),patterns:[/^https?:\/\/(www\.)?issuu\.com\/.+/i],attributes:{providerNameSlug:"issuu",responsive:!0}},{name:"kickstarter",title:"Kickstarter",icon:c1,description:er("Embed Kickstarter content."),patterns:[/^https?:\/\/(www\.)?kickstarter\.com\/.+/i,/^https?:\/\/kck\.st\/.+/i],attributes:{providerNameSlug:"kickstarter",responsive:!0}},{name:"meetup-com",title:"Meetup.com",icon:c1,description:er("Embed Meetup.com content."),patterns:[/^https?:\/\/(www\.)?meetu(\.ps|p\.com)\/.+/i],attributes:{providerNameSlug:"meetup-com",responsive:!0}},{name:"mixcloud",title:"Mixcloud",icon:u1,keywords:[er("music"),er("audio")],description:er("Embed Mixcloud content."),patterns:[/^https?:\/\/(www\.)?mixcloud\.com\/.+/i],attributes:{providerNameSlug:"mixcloud",responsive:!0}},{name:"reddit",title:"Reddit",icon:M1,description:er("Embed a Reddit thread."),patterns:[/^https?:\/\/(www\.)?reddit\.com\/.+/i],attributes:{providerNameSlug:"reddit",responsive:!0}},{name:"reverbnation",title:"ReverbNation",icon:u1,description:er("Embed ReverbNation content."),patterns:[/^https?:\/\/(www\.)?reverbnation\.com\/.+/i],attributes:{providerNameSlug:"reverbnation",responsive:!0}},{name:"screencast",title:"Screencast",icon:p1,description:er("Embed Screencast content."),patterns:[/^https?:\/\/(www\.)?screencast\.com\/.+/i],attributes:{providerNameSlug:"screencast",responsive:!0}},{name:"scribd",title:"Scribd",icon:c1,description:er("Embed Scribd content."),patterns:[/^https?:\/\/(www\.)?scribd\.com\/.+/i],attributes:{providerNameSlug:"scribd",responsive:!0}},{name:"slideshare",title:"Slideshare",icon:c1,description:er("Embed Slideshare content."),patterns:[/^https?:\/\/(.+?\.)?slideshare\.net\/.+/i],attributes:{providerNameSlug:"slideshare",responsive:!0}},{name:"smugmug",title:"SmugMug",icon:d1,description:er("Embed SmugMug content."),patterns:[/^https?:\/\/(.+\.)?smugmug\.com\/.*/i],attributes:{providerNameSlug:"smugmug",previewable:!1,responsive:!0}},{name:"speaker-deck",title:"Speaker Deck",icon:c1,description:er("Embed Speaker Deck content."),patterns:[/^https?:\/\/(www\.)?speakerdeck\.com\/.+/i],attributes:{providerNameSlug:"speaker-deck",responsive:!0}},{name:"tiktok",title:"TikTok",icon:p1,keywords:[er("video")],description:er("Embed a TikTok video."),patterns:[/^https?:\/\/(www\.)?tiktok\.com\/.+/i],attributes:{providerNameSlug:"tiktok",responsive:!0}},{name:"ted",title:"TED",icon:p1,description:er("Embed a TED video."),patterns:[/^https?:\/\/(www\.|embed\.)?ted\.com\/.+/i],attributes:{providerNameSlug:"ted",responsive:!0}},{name:"tumblr",title:"Tumblr",icon:k1,keywords:[er("social")],description:er("Embed a Tumblr post."),patterns:[/^https?:\/\/(www\.)?tumblr\.com\/.+/i],attributes:{providerNameSlug:"tumblr",responsive:!0}},{name:"videopress",title:"VideoPress",icon:p1,keywords:[er("video")],description:er("Embed a VideoPress video."),patterns:[/^https?:\/\/videopress\.com\/.+/i],attributes:{providerNameSlug:"videopress",responsive:!0}},{name:"wordpress-tv",title:"WordPress.tv",icon:p1,description:er("Embed a WordPress.tv video."),patterns:[/^https?:\/\/wordpress\.tv\/.+/i],attributes:{providerNameSlug:"wordpress-tv",responsive:!0}},{name:"amazon-kindle",title:"Amazon Kindle",icon:w1,keywords:[er("ebook")],description:er("Embed Amazon Kindle content."),patterns:[/^https?:\/\/([a-z0-9-]+\.)?(amazon|amzn)(\.[a-z]{2,4})+\/.+/i,/^https?:\/\/(www\.)?(a\.co|z\.cn)\/.+/i],attributes:{providerNameSlug:"amazon-kindle"}}];P1.forEach((e=>{e.isActive||(e.isActive=(e,t)=>e.providerNameSlug===t.providerNameSlug)}));const R1=P1,{attributes:Y1}={apiVersion:2,name:"core/embed",title:"Embed",category:"embed",description:"Add a block that displays content pulled from other sites, like Twitter or YouTube.",textdomain:"default",attributes:{url:{type:"string"},caption:{type:"string",source:"html",selector:"figcaption"},type:{type:"string"},providerNameSlug:{type:"string"},allowResponsive:{type:"boolean",default:!0},responsive:{type:"boolean",default:!1},previewable:{type:"boolean",default:!0}},supports:{align:!0},editorStyle:"wp-block-embed-editor",style:"wp-block-embed"},W1=[{attributes:Y1,save({attributes:{url:e,caption:t,type:n,providerNameSlug:r}}){if(!e)return null;const o=so()("wp-block-embed",{[`is-type-${n}`]:n,[`is-provider-${r}`]:r});return(0,tt.createElement)("figure",{className:o},`\n${e}\n`,!Cj.isEmpty(t)&&(0,tt.createElement)(Cj.Content,{tagName:"figcaption",value:t}))}}],H1={apiVersion:2,name:"core/embed",title:"Embed",category:"embed",description:"Add a block that displays content pulled from other sites, like Twitter or YouTube.",textdomain:"default",attributes:{url:{type:"string"},caption:{type:"string",source:"html",selector:"figcaption"},type:{type:"string"},providerNameSlug:{type:"string"},allowResponsive:{type:"boolean",default:!0},responsive:{type:"boolean",default:!1},previewable:{type:"boolean",default:!0}},supports:{align:!0},editorStyle:"wp-block-embed-editor",style:"wp-block-embed"},{name:q1}=H1,j1={icon:c1,edit:D1,save:function({attributes:e}){const{url:t,caption:n,type:r,providerNameSlug:o}=e;if(!t)return null;const a=NG()("wp-block-embed",{[`is-type-${r}`]:r,[`is-provider-${o}`]:o,[`wp-block-embed-${o}`]:o});return(0,tt.createElement)("figure",VR.save({className:a}),(0,tt.createElement)("div",{className:"wp-block-embed__wrapper"},`\n${t}\n`),!Cj.isEmpty(n)&&(0,tt.createElement)(Cj.Content,{tagName:"figcaption",value:n}))},transforms:I1,variations:R1,deprecated:W1},F1=(0,tt.createElement)(mo,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,tt.createElement)(uo,{d:"M19 6.2h-5.9l-.6-1.1c-.3-.7-1-1.1-1.8-1.1H5c-1.1 0-2 .9-2 2v11.8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V8.2c0-1.1-.9-2-2-2zm.5 11.6c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h5.8c.2 0 .4.1.4.3l1 2H19c.3 0 .5.2.5.5v9.5z"}));function V1({hrefs:e,openInNewWindow:t,showDownloadButton:n,changeLinkDestinationOption:r,changeOpenInNewWindow:o,changeShowDownloadButton:a,displayPreview:i,changeDisplayPreview:s,previewHeight:l,changePreviewHeight:c}){const{href:u,textLinkHref:d,attachmentPage:p}=e;let m=[{value:u,label:er("URL")}];return p&&(m=[{value:u,label:er("Media file")},{value:p,label:er("Attachment page")}]),(0,tt.createElement)(tt.Fragment,null,(0,tt.createElement)(FA,null,u.endsWith(".pdf")&&(0,tt.createElement)(BA,{title:er("PDF settings")},(0,tt.createElement)(KN,{label:er("Show inline embed"),help:i?er("Note: Most phone and tablet browsers won't display embedded PDFs."):null,checked:!!i,onChange:s}),(0,tt.createElement)(rT,{label:er("Height in pixels"),min:$1,max:Math.max(K1,l),value:l,onChange:c})),(0,tt.createElement)(BA,{title:er("Text link settings")},(0,tt.createElement)(KS,{label:er("Link to"),value:d,options:m,onChange:r}),(0,tt.createElement)(KN,{label:er("Open in new tab"),checked:t,onChange:o})),(0,tt.createElement)(BA,{title:er("Download button settings")},(0,tt.createElement)(KN,{label:er("Show download button"),checked:n,onChange:a}))))}const X1=()=>!(window.navigator.userAgent.indexOf("Mobi")>-1)&&(!(window.navigator.userAgent.indexOf("Android")>-1)&&(!(window.navigator.userAgent.indexOf("Macintosh")>-1&&window.navigator.maxTouchPoints&&window.navigator.maxTouchPoints>2)&&!((window.ActiveXObject||"ActiveXObject"in window)&&!U1("AcroPDF.PDF")&&!U1("PDF.PdfCtrl")))),U1=e=>{let t;try{t=new window.ActiveXObject(e)}catch(e){t=void 0}return t},$1=200,K1=2e3;function G1({text:e,disabled:t}){const{createNotice:n}=ld(UI),r=zI(e,(()=>{n("info",er("Copied URL to clipboard."),{isDismissible:!0,type:"snackbar"})}));return(0,tt.createElement)(jg,{className:"components-clipboard-toolbar-button",ref:r,disabled:t},er("Copy URL"))}const J1=WK((function({attributes:e,isSelected:t,setAttributes:n,noticeUI:r,noticeOperations:o}){const{id:a,fileName:i,href:s,textLinkHref:l,textLinkTarget:c,showDownloadButton:u,downloadButtonText:d,displayPreview:p,previewHeight:m}=e,[f,h]=(0,tt.useState)(!1),{media:g,mediaUpload:b}=Tl((e=>({media:void 0===a?void 0:e(yd).getMedia(a),mediaUpload:e(nk).getSettings().mediaUpload})),[a]),{toggleSelection:v}=ld(nk);function y(e){if(e&&e.url){h(!1);const t=e.url.endsWith(".pdf");n({href:e.url,fileName:e.title,textLinkHref:e.url,id:e.id,displayPreview:!!t||void 0,previewHeight:t?600:void 0})}}function _(e){h(!0),o.removeAllNotices(),o.createErrorNotice(e)}function M(e){n({downloadButtonText:e.replace(/<\/?a[^>]*>/g,"")})}(0,tt.useEffect)((()=>{if(Qs(s)){const e=Gs(s);b({filesList:[e],onFileChange:([e])=>y(e),onError:e=>{h(!0),o.createErrorNotice(e)}}),Js(s)}void 0===d&&M(tr("Download","button label"))}),[]);const k=g&&g.link,w=VR({className:so()(Qs(s)&&ff({type:"loading"}),{"is-transient":Qs(s)})}),E=X1()&&p;return!s||f?(0,tt.createElement)("div",w,(0,tt.createElement)(oj,{icon:(0,tt.createElement)(MB,{icon:F1}),labels:{title:er("File"),instructions:er("Upload a file or pick one from your media library.")},onSelect:y,notices:r,onError:_,accept:"*"})):(0,tt.createElement)(tt.Fragment,null,(0,tt.createElement)(V1,{hrefs:{href:s,textLinkHref:l,attachmentPage:k},openInNewWindow:!!c,showDownloadButton:u,changeLinkDestinationOption:function(e){n({textLinkHref:e})},changeOpenInNewWindow:function(e){n({textLinkTarget:!!e&&"_blank"})},changeShowDownloadButton:function(e){n({showDownloadButton:e})},displayPreview:p,changeDisplayPreview:function(e){n({displayPreview:e})},previewHeight:m,changePreviewHeight:function(e){const t=Math.max(parseInt(e,10),$1);n({previewHeight:t})}}),(0,tt.createElement)(lk,{group:"other"},(0,tt.createElement)(Jq,{mediaId:a,mediaURL:s,accept:"*",onSelect:y,onError:_}),(0,tt.createElement)(G1,{text:s,disabled:Qs(s)})),(0,tt.createElement)("div",w,E&&(0,tt.createElement)(LG,{size:{height:m},minHeight:$1,maxHeight:K1,minWidth:"100%",grid:[10,10],enable:{top:!1,right:!1,bottom:!0,left:!1,topRight:!1,bottomRight:!1,bottomLeft:!1,topLeft:!1},onResizeStart:()=>v(!1),onResizeStop:function(e,t,r,o){v(!0);const a=parseInt(m+o.height,10);n({previewHeight:a})},showHandle:t},(0,tt.createElement)("object",{className:"wp-block-file__preview",data:s,type:"application/pdf","aria-label":er("Embed of the selected PDF file.")}),!t&&(0,tt.createElement)("div",{className:"wp-block-file__preview-overlay"})),(0,tt.createElement)("div",{className:"wp-block-file__content-wrapper"},(0,tt.createElement)(Cj,{tagName:"a",value:i,placeholder:er("Write file name…"),withoutInteractiveFormatting:!0,onChange:e=>n({fileName:e}),href:l}),u&&(0,tt.createElement)("div",{className:"wp-block-file__button-richtext-wrapper"},(0,tt.createElement)(Cj,{tagName:"div","aria-label":er("Download button text"),className:"wp-block-file__button",value:d,withoutInteractiveFormatting:!0,placeholder:er("Add text…"),onChange:e=>M(e)})))))}));const Q1={from:[{type:"files",isMatch:e=>e.length>0,priority:15,transform:e=>{const t=[];return e.forEach((e=>{const n=Ks(e);t.push(Ho("core/file",{href:n,fileName:e.name,textLinkHref:n}))})),t}},{type:"block",blocks:["core/audio"],transform:e=>Ho("core/file",{href:e.src,fileName:e.caption,textLinkHref:e.src,id:e.id,anchor:e.anchor})},{type:"block",blocks:["core/video"],transform:e=>Ho("core/file",{href:e.src,fileName:e.caption,textLinkHref:e.src,id:e.id,anchor:e.anchor})},{type:"block",blocks:["core/image"],transform:e=>Ho("core/file",{href:e.url,fileName:e.caption,textLinkHref:e.url,id:e.id,anchor:e.anchor})}],to:[{type:"block",blocks:["core/audio"],isMatch:({id:e})=>{if(!e)return!1;const{getMedia:t}=tn(yd),n=t(e);return!!n&&(0,at.includes)(n.mime_type,"audio")},transform:e=>Ho("core/audio",{src:e.href,caption:e.fileName,id:e.id,anchor:e.anchor})},{type:"block",blocks:["core/video"],isMatch:({id:e})=>{if(!e)return!1;const{getMedia:t}=tn(yd),n=t(e);return!!n&&(0,at.includes)(n.mime_type,"video")},transform:e=>Ho("core/video",{src:e.href,caption:e.fileName,id:e.id,anchor:e.anchor})},{type:"block",blocks:["core/image"],isMatch:({id:e})=>{if(!e)return!1;const{getMedia:t}=tn(yd),n=t(e);return!!n&&(0,at.includes)(n.mime_type,"image")},transform:e=>Ho("core/image",{url:e.href,caption:e.fileName,id:e.id,anchor:e.anchor})}]},Z1={apiVersion:2,name:"core/file",title:"File",category:"media",description:"Add a link to a downloadable file.",keywords:["document","pdf","download"],textdomain:"default",attributes:{id:{type:"number"},href:{type:"string"},fileName:{type:"string",source:"html",selector:"a:not([download])"},textLinkHref:{type:"string",source:"attribute",selector:"a:not([download])",attribute:"href"},textLinkTarget:{type:"string",source:"attribute",selector:"a:not([download])",attribute:"target"},showDownloadButton:{type:"boolean",default:!0},downloadButtonText:{type:"string",source:"html",selector:"a[download]"},displayPreview:{type:"boolean"},previewHeight:{type:"number",default:600}},supports:{anchor:!0,align:!0},viewScript:"file:./view.min.js",editorStyle:"wp-block-file-editor",style:"wp-block-file"},{name:e2}=Z1,t2={icon:F1,example:{attributes:{href:"https://upload.wikimedia.org/wikipedia/commons/d/dd/Armstrong_Small_Step.ogg",fileName:tr("Armstrong_Small_Step","Name of the file")}},transforms:Q1,edit:J1,save:function({attributes:e}){const{href:t,fileName:n,textLinkHref:r,textLinkTarget:o,showDownloadButton:a,downloadButtonText:i,displayPreview:s,previewHeight:l}=e,c=Cj.isEmpty(n)?er("PDF embed"):pn(er("Embed of %s."),n);return t&&(0,tt.createElement)("div",VR.save(),s&&(0,tt.createElement)(tt.Fragment,null,(0,tt.createElement)("object",{className:"wp-block-file__embed",data:t,type:"application/pdf",style:{width:"100%",height:`${l}px`},"aria-label":c})),!Cj.isEmpty(n)&&(0,tt.createElement)("a",{href:r,target:o,rel:o?"noreferrer noopener":void 0},(0,tt.createElement)(Cj.Content,{value:n})),a&&(0,tt.createElement)("a",{href:t,className:"wp-block-file__button",download:!0},(0,tt.createElement)(Cj.Content,{value:i})))}},n2=(0,tt.createElement)(mo,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,tt.createElement)(uo,{d:"M4.8 11.4H2.1V9H1v6h1.1v-2.6h2.7V15h1.1V9H4.8v2.4zm1.9-1.3h1.7V15h1.1v-4.9h1.7V9H6.7v1.1zM16.2 9l-1.5 2.7L13.3 9h-.9l-.8 6h1.1l.5-4 1.5 2.8 1.5-2.8.5 4h1.1L17 9h-.8zm3.8 5V9h-1.1v6h3.6v-1H20z"}));const r2={from:[{type:"block",blocks:["core/code"],transform:({content:e})=>Ho("core/html",{content:e})}]},o2={apiVersion:2,name:"core/html",title:"Custom HTML",category:"widgets",description:"Add custom HTML code and preview it as you edit.",keywords:["embed"],textdomain:"default",attributes:{content:{type:"string",source:"html"}},supports:{customClassName:!1,className:!1,html:!1},editorStyle:"wp-block-html-editor"},{name:a2}=o2,i2={icon:n2,example:{attributes:{content:""+er("Welcome to the wonderful world of blocks…")+" "}},edit:function({attributes:e,setAttributes:t,isSelected:n}){const[r,o]=(0,tt.useState)(),a=Tl((e=>["\n\t\t\thtml,body,:root {\n\t\t\t\tmargin: 0 !important;\n\t\t\t\tpadding: 0 !important;\n\t\t\t\toverflow: visible !important;\n\t\t\t\tmin-height: auto !important;\n\t\t\t}\n\t\t",...tV(e(nk).getSettings().styles)]),[]);return(0,tt.createElement)("div",VR({className:"block-library-html__edit"}),(0,tt.createElement)(lk,null,(0,tt.createElement)(tb,null,(0,tt.createElement)(jg,{className:"components-tab-button",isPressed:!r,onClick:function(){o(!1)}},(0,tt.createElement)("span",null,"HTML")),(0,tt.createElement)(jg,{className:"components-tab-button",isPressed:r,onClick:function(){o(!0)}},(0,tt.createElement)("span",null,er("Preview"))))),(0,tt.createElement)(jP.Consumer,null,(o=>r||o?(0,tt.createElement)(tt.Fragment,null,(0,tt.createElement)(T1,{html:e.content,styles:a}),!n&&(0,tt.createElement)("div",{className:"block-library-html__preview-overlay"})):(0,tt.createElement)(zj,{value:e.content,onChange:e=>t({content:e}),placeholder:er("Write HTML…"),"aria-label":er("HTML")}))))},save:function({attributes:e}){return(0,tt.createElement)(Pa,null,e.content)},transforms:r2},s2=(0,tt.createElement)(mo,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,tt.createElement)(uo,{d:"M3 18h8V6H3v12zM14 7.5V9h7V7.5h-7zm0 5.3h7v-1.5h-7v1.5zm0 3.7h7V15h-7v1.5z"})),l2=(0,tt.createElement)(mo,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,tt.createElement)(uo,{d:"M18 2l2 4h-2l-2-4h-3l2 4h-2l-2-4h-1a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V2zm2 12H10V4.4L11.8 8H20z"}),(0,tt.createElement)(uo,{d:"M14 20H4V10h3V8H4a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-3h-2z"}),(0,tt.createElement)(uo,{d:"M5 19h8l-1.59-2H9.24l-.84 1.1L7 16.3 5 19z"})),c2=["image","video"];function u2(e,t){return e?{backgroundImage:`url(${e})`,backgroundPosition:t?`${100*t.x}% ${100*t.y}%`:"50% 50%"}:{}}const d2=(0,tt.forwardRef)((({isSelected:e,isStackedOnMobile:t,...n},r)=>{const o=Jp("small","<");return(0,tt.createElement)(LG,ot({ref:r,showHandle:e&&(!o||!t)},n))}));function p2({mediaId:e,mediaUrl:t,onSelectMedia:n}){return(0,tt.createElement)(lk,{group:"other"},(0,tt.createElement)(Jq,{mediaId:e,mediaURL:t,allowedTypes:c2,accept:"image/*,video/*",onSelect:n}))}function m2({className:e,noticeOperations:t,noticeUI:n,mediaUrl:r,onSelectMedia:o}){return(0,tt.createElement)(oj,{icon:(0,tt.createElement)(MB,{icon:l2}),labels:{title:er("Media area")},className:e,onSelect:o,accept:"image/*,video/*",allowedTypes:c2,notices:n,onError:e=>{t.removeAllNotices(),t.createErrorNotice(e)},disableMediaButtons:r})}const f2=WK((0,tt.forwardRef)((function(e,t){const{className:n,commitWidthChange:r,focalPoint:o,imageFill:a,isSelected:i,isStackedOnMobile:s,mediaAlt:l,mediaId:c,mediaPosition:u,mediaType:d,mediaUrl:p,mediaWidth:m,onSelectMedia:f,onWidthChange:h}=e,g=!c&&Qs(p),{toggleSelection:b}=ld(nk);if(p){const v=()=>{b(!1)},y=(e,t,n)=>{h(parseInt(n.style.width))},_=(e,t,n)=>{b(!0),r(parseInt(n.style.width))},M={right:"left"===u,left:"right"===u},k="image"===d&&a?u2(p,o):{},w={image:()=>(0,tt.createElement)("img",{src:p,alt:l}),video:()=>(0,tt.createElement)("video",{controls:!0,src:p})};return(0,tt.createElement)(d2,{as:"figure",className:so()(n,"editor-media-container__resizer",{"is-transient":g}),style:k,size:{width:m+"%"},minWidth:"10%",maxWidth:"100%",enable:M,onResizeStart:v,onResize:y,onResizeStop:_,axis:"x",isSelected:i,isStackedOnMobile:s,ref:t},(0,tt.createElement)(p2,{onSelectMedia:f,mediaUrl:p,mediaId:c}),(w[d]||at.noop)(),g&&(0,tt.createElement)(cq,null),(0,tt.createElement)(m2,e))}return(0,tt.createElement)(m2,e)}))),h2=e=>{if(!e.customBackgroundColor)return e;const t={color:{background:e.customBackgroundColor}};return{...(0,at.omit)(e,["customBackgroundColor"]),style:t}},g2={align:{type:"string",default:"wide"},backgroundColor:{type:"string"},mediaAlt:{type:"string",source:"attribute",selector:"figure img",attribute:"alt",default:""},mediaPosition:{type:"string",default:"left"},mediaId:{type:"number"},mediaType:{type:"string"},mediaWidth:{type:"number",default:50},isStackedOnMobile:{type:"boolean",default:!0}},b2=[{attributes:{...g2,customBackgroundColor:{type:"string"},mediaLink:{type:"string"},linkDestination:{type:"string"},linkTarget:{type:"string",source:"attribute",selector:"figure a",attribute:"target"},href:{type:"string",source:"attribute",selector:"figure a",attribute:"href"},rel:{type:"string",source:"attribute",selector:"figure a",attribute:"rel"},linkClass:{type:"string",source:"attribute",selector:"figure a",attribute:"class"},verticalAlignment:{type:"string"},imageFill:{type:"boolean"},focalPoint:{type:"object"}},migrate:h2,save({attributes:e}){const{backgroundColor:t,customBackgroundColor:n,isStackedOnMobile:r,mediaAlt:o,mediaPosition:a,mediaType:i,mediaUrl:s,mediaWidth:l,mediaId:c,verticalAlignment:u,imageFill:d,focalPoint:p,linkClass:m,href:f,linkTarget:h,rel:g}=e,b=(0,at.isEmpty)(g)?void 0:g;let v=(0,tt.createElement)("img",{src:s,alt:o,className:c&&"image"===i?`wp-image-${c}`:null});f&&(v=(0,tt.createElement)("a",{className:m,href:f,target:h,rel:b},v));const y={image:()=>v,video:()=>(0,tt.createElement)("video",{controls:!0,src:s})},_=mC("background-color",t),M=so()({"has-media-on-the-right":"right"===a,"has-background":_||n,[_]:_,"is-stacked-on-mobile":r,[`is-vertically-aligned-${u}`]:u,"is-image-fill":d}),k=d?u2(s,p):{};let w;50!==l&&(w="right"===a?`auto ${l}%`:`${l}% auto`);const E={backgroundColor:_?void 0:n,gridTemplateColumns:w};return(0,tt.createElement)("div",{className:M,style:E},(0,tt.createElement)("figure",{className:"wp-block-media-text__media",style:k},(y[i]||at.noop)()),(0,tt.createElement)("div",{className:"wp-block-media-text__content"},(0,tt.createElement)(JH.Content,null)))}},{attributes:{...g2,customBackgroundColor:{type:"string"},mediaUrl:{type:"string",source:"attribute",selector:"figure video,figure img",attribute:"src"},verticalAlignment:{type:"string"},imageFill:{type:"boolean"},focalPoint:{type:"object"}},migrate:h2,save({attributes:e}){const{backgroundColor:t,customBackgroundColor:n,isStackedOnMobile:r,mediaAlt:o,mediaPosition:a,mediaType:i,mediaUrl:s,mediaWidth:l,mediaId:c,verticalAlignment:u,imageFill:d,focalPoint:p}=e,m={image:()=>(0,tt.createElement)("img",{src:s,alt:o,className:c&&"image"===i?`wp-image-${c}`:null}),video:()=>(0,tt.createElement)("video",{controls:!0,src:s})},f=mC("background-color",t),h=so()({"has-media-on-the-right":"right"===a,[f]:f,"is-stacked-on-mobile":r,[`is-vertically-aligned-${u}`]:u,"is-image-fill":d}),g=d?u2(s,p):{};let b;50!==l&&(b="right"===a?`auto ${l}%`:`${l}% auto`);const v={backgroundColor:f?void 0:n,gridTemplateColumns:b};return(0,tt.createElement)("div",{className:h,style:v},(0,tt.createElement)("figure",{className:"wp-block-media-text__media",style:g},(m[i]||at.noop)()),(0,tt.createElement)("div",{className:"wp-block-media-text__content"},(0,tt.createElement)(JH.Content,null)))}},{attributes:{...g2,customBackgroundColor:{type:"string"},mediaUrl:{type:"string",source:"attribute",selector:"figure video,figure img",attribute:"src"}},save({attributes:e}){const{backgroundColor:t,customBackgroundColor:n,isStackedOnMobile:r,mediaAlt:o,mediaPosition:a,mediaType:i,mediaUrl:s,mediaWidth:l}=e,c={image:()=>(0,tt.createElement)("img",{src:s,alt:o}),video:()=>(0,tt.createElement)("video",{controls:!0,src:s})},u=mC("background-color",t),d=so()({"has-media-on-the-right":"right"===a,[u]:u,"is-stacked-on-mobile":r});let p;50!==l&&(p="right"===a?`auto ${l}%`:`${l}% auto`);const m={backgroundColor:u?void 0:n,gridTemplateColumns:p};return(0,tt.createElement)("div",{className:d,style:m},(0,tt.createElement)("figure",{className:"wp-block-media-text__media"},(c[i]||at.noop)()),(0,tt.createElement)("div",{className:"wp-block-media-text__content"},(0,tt.createElement)(JH.Content,null)))}}],v2=(0,tt.createElement)(mo,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,tt.createElement)(uo,{d:"M4 18h6V6H4v12zm9-9.5V10h7V8.5h-7zm0 7h7V14h-7v1.5z"})),y2=(0,tt.createElement)(mo,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,tt.createElement)(uo,{d:"M14 6v12h6V6h-6zM4 10h7V8.5H4V10zm0 5.5h7V14H4v1.5z"})),_2="full",M2=[["core/paragraph",{fontSize:"large",placeholder:tr("Content…","content placeholder")}]],k2=e=>Math.max(15,Math.min(e,85));function w2(e,t){var n,r,o;return null==e||null===(n=e.media_details)||void 0===n||null===(r=n.sizes)||void 0===r||null===(o=r[t])||void 0===o?void 0:o.source_url}const E2=function({attributes:e,isSelected:t,setAttributes:n}){const{focalPoint:r,href:o,imageFill:a,isStackedOnMobile:i,linkClass:s,linkDestination:l,linkTarget:c,mediaAlt:u,mediaId:d,mediaPosition:p,mediaType:m,mediaUrl:f,mediaWidth:h,rel:g,verticalAlignment:b}=e,v=e.mediaSizeSlug||_2,y=Tl((e=>d&&t?e(yd).getMedia(d):null),[t,d]),_=(0,tt.useRef)(),M=e=>{const{style:t}=_.current.resizable,{x:n,y:r}=e;t.backgroundPosition=`${100*n}% ${100*r}%`},[k,w]=(0,tt.useState)(null),E=function({attributes:{linkDestination:e,href:t},setAttributes:n}){return r=>{let o,a;var i,s,l,c,u;o=r.media_type?"image"===r.media_type?"image":"video":r.type,"image"===o&&(a=(null===(i=r.sizes)||void 0===i||null===(s=i.large)||void 0===s?void 0:s.url)||(null===(l=r.media_details)||void 0===l||null===(c=l.sizes)||void 0===c||null===(u=c.large)||void 0===u?void 0:u.source_url));let d=t;"media"===e&&(d=r.url),"attachment"===e&&(d=r.link),n({mediaAlt:r.alt,mediaId:r.id,mediaType:o,mediaUrl:a||r.url,mediaLink:r.link||void 0,href:d,focalPoint:void 0})}}({attributes:e,setAttributes:n}),L=e=>{n({mediaWidth:k2(e)}),w(k2(e))},A=so()({"has-media-on-the-right":"right"===p,"is-selected":t,"is-stacked-on-mobile":i,[`is-vertically-aligned-${b}`]:b,"is-image-fill":a}),S=`${k||h}%`,C="right"===p?`1fr ${S}`:`${S} 1fr`,T={gridTemplateColumns:C,msGridColumns:C},x=Tl((e=>{const t=e(nk).getSettings();return null==t?void 0:t.imageSizes})),z=(0,at.map)((0,at.filter)(x,(({slug:e})=>w2(y,e))),(({name:e,slug:t})=>({value:t,label:e}))),O=(0,tt.createElement)(BA,{title:er("Media & Text settings")},(0,tt.createElement)(KN,{label:er("Stack on mobile"),checked:i,onChange:()=>n({isStackedOnMobile:!i})}),"image"===m&&(0,tt.createElement)(KN,{label:er("Crop image to fill entire column"),checked:a,onChange:()=>n({imageFill:!a})}),a&&f&&"image"===m&&(0,tt.createElement)(U0,{label:er("Focal point picker"),url:f,value:r,onChange:e=>n({focalPoint:e}),onDragStart:M,onDrag:M}),"image"===m&&(0,tt.createElement)(XK,{label:er("Alt text (alternative text)"),value:u,onChange:e=>{n({mediaAlt:e})},help:(0,tt.createElement)(tt.Fragment,null,(0,tt.createElement)(CA,{href:"https://www.w3.org/WAI/tutorials/images/decision-tree"},er("Describe the purpose of the image")),er("Leave empty if the image is purely decorative."))}),"image"===m&&(0,tt.createElement)(qH,{onChangeImage:e=>{const t=w2(y,e);if(!t)return null;n({mediaUrl:t,mediaSizeSlug:e})},slug:v,imageSizeOptions:z,isResizable:!1}),f&&(0,tt.createElement)(rT,{label:er("Media width"),value:k||h,onChange:L,min:15,max:85})),N=VR({className:A,style:T}),D=GH({className:"wp-block-media-text__content"},{template:M2});return(0,tt.createElement)(tt.Fragment,null,(0,tt.createElement)(FA,null,O),(0,tt.createElement)(lk,{group:"block"},(0,tt.createElement)(RH,{onChange:e=>{n({verticalAlignment:e})},value:b}),(0,tt.createElement)(jg,{icon:v2,title:er("Show media on left"),isActive:"left"===p,onClick:()=>n({mediaPosition:"left"})}),(0,tt.createElement)(jg,{icon:y2,title:er("Show media on right"),isActive:"right"===p,onClick:()=>n({mediaPosition:"right"})}),"image"===m&&(0,tt.createElement)(qj,{url:o||"",onChangeUrl:e=>{n(e)},linkDestination:l,mediaType:m,mediaUrl:y&&y.source_url,mediaLink:y&&y.link,linkTarget:c,linkClass:s,rel:g})),(0,tt.createElement)("div",N,(0,tt.createElement)(f2,{className:"wp-block-media-text__media",onSelectMedia:E,onWidthChange:e=>{w(k2(e))},commitWidthChange:L,ref:_,focalPoint:r,imageFill:a,isSelected:t,isStackedOnMobile:i,mediaAlt:u,mediaId:d,mediaPosition:p,mediaType:m,mediaUrl:f,mediaWidth:h}),(0,tt.createElement)("div",D)))};const L2={from:[{type:"block",blocks:["core/image"],transform:({alt:e,url:t,id:n,anchor:r})=>Ho("core/media-text",{mediaAlt:e,mediaId:n,mediaUrl:t,mediaType:"image",anchor:r})},{type:"block",blocks:["core/video"],transform:({src:e,id:t,anchor:n})=>Ho("core/media-text",{mediaId:t,mediaUrl:e,mediaType:"video",anchor:n})}],to:[{type:"block",blocks:["core/image"],isMatch:({mediaType:e,mediaUrl:t})=>!t||"image"===e,transform:({mediaAlt:e,mediaId:t,mediaUrl:n,anchor:r})=>Ho("core/image",{alt:e,id:t,url:n,anchor:r})},{type:"block",blocks:["core/video"],isMatch:({mediaType:e,mediaUrl:t})=>!t||"video"===e,transform:({mediaId:e,mediaUrl:t,anchor:n})=>Ho("core/video",{id:e,src:t,anchor:n})}]},A2={apiVersion:2,name:"core/media-text",title:"Media & Text",category:"media",description:"Set media and words side-by-side for a richer layout.",keywords:["image","video"],textdomain:"default",attributes:{align:{type:"string",default:"wide"},mediaAlt:{type:"string",source:"attribute",selector:"figure img",attribute:"alt",default:""},mediaPosition:{type:"string",default:"left"},mediaId:{type:"number"},mediaUrl:{type:"string",source:"attribute",selector:"figure video,figure img",attribute:"src"},mediaLink:{type:"string"},linkDestination:{type:"string"},linkTarget:{type:"string",source:"attribute",selector:"figure a",attribute:"target"},href:{type:"string",source:"attribute",selector:"figure a",attribute:"href"},rel:{type:"string",source:"attribute",selector:"figure a",attribute:"rel"},linkClass:{type:"string",source:"attribute",selector:"figure a",attribute:"class"},mediaType:{type:"string"},mediaWidth:{type:"number",default:50},mediaSizeSlug:{type:"string"},isStackedOnMobile:{type:"boolean",default:!0},verticalAlignment:{type:"string"},imageFill:{type:"boolean"},focalPoint:{type:"object"}},supports:{anchor:!0,align:["wide","full"],html:!1,color:{gradients:!0,link:!0}},editorStyle:"wp-block-media-text-editor",style:"wp-block-media-text"},{name:S2}=A2,C2={icon:s2,example:{attributes:{mediaType:"image",mediaUrl:"https://s.w.org/images/core/5.3/Biologia_Centrali-Americana_-_Cantorchilus_semibadius_1902.jpg"},innerBlocks:[{name:"core/paragraph",attributes:{content:er("The wren Earns his living Noiselessly.")}},{name:"core/paragraph",attributes:{content:er("— Kobayashi Issa (一茶)")}}]},transforms:L2,edit:E2,save:function({attributes:e}){const{isStackedOnMobile:t,mediaAlt:n,mediaPosition:r,mediaType:o,mediaUrl:a,mediaWidth:i,mediaId:s,verticalAlignment:l,imageFill:c,focalPoint:u,linkClass:d,href:p,linkTarget:m,rel:f}=e,h=e.mediaSizeSlug||_2,g=(0,at.isEmpty)(f)?void 0:f,b=so()({[`wp-image-${s}`]:s&&"image"===o,[`size-${h}`]:s&&"image"===o});let v=(0,tt.createElement)("img",{src:a,alt:n,className:b||null});p&&(v=(0,tt.createElement)("a",{className:d,href:p,target:m,rel:g},v));const y={image:()=>v,video:()=>(0,tt.createElement)("video",{controls:!0,src:a})},_=so()({"has-media-on-the-right":"right"===r,"is-stacked-on-mobile":t,[`is-vertically-aligned-${l}`]:l,"is-image-fill":c}),M=c?u2(a,u):{};let k;50!==i&&(k="right"===r?`auto ${i}%`:`${i}% auto`);const w={gridTemplateColumns:k};return(0,tt.createElement)("div",VR.save({className:_,style:w}),(0,tt.createElement)("figure",{className:"wp-block-media-text__media",style:M},(y[o]||at.noop)()),(0,tt.createElement)("div",{className:"wp-block-media-text__content"},(0,tt.createElement)(JH.Content,null)))},deprecated:b2},T2=(0,tt.createElement)(mo,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,tt.createElement)(uo,{d:"M12 4c-4.4 0-8 3.6-8 8s3.6 8 8 8 8-3.6 8-8-3.6-8-8-8zm0 14.5c-3.6 0-6.5-2.9-6.5-6.5S8.4 5.5 12 5.5s6.5 2.9 6.5 6.5-2.9 6.5-6.5 6.5zM9 16l4.5-3L15 8.4l-4.5 3L9 16z"}));function x2({clientId:e,__experimentalFeatures:t}){const n=Tl((t=>t(nk).__unstableGetClientIdsTree(e)),[e]);return(0,tt.createElement)(hH,{blocks:n,showAppender:!0,showBlockMovers:!0,showNestedBlocks:!0,__experimentalFeatures:t})}function z2(){const{menus:e,isResolvingMenus:t,hasResolvedMenus:n}=Tl((e=>{const{getMenus:t,isResolving:n,hasFinishedResolution:r}=e(yd),o=[{per_page:-1}];return{menus:t(...o),isResolvingMenus:n("getMenus",o),hasResolvedMenus:r("getMenus",o)}}),[]);return{menus:e,isResolvingMenus:t,hasResolvedMenus:n,hasMenus:!(!n||null==e||!e.length)}}function O2(e){const{menuItems:t,hasResolvedMenuItems:n}=Tl((t=>{const{getMenuItems:n,hasFinishedResolution:r}=t(yd),o=void 0!==e,a=o?[{menus:e,per_page:-1}]:void 0;return{menuItems:o?n(...a):void 0,hasResolvedMenuItems:!!o&&r("getMenuItems",a)}}),[e]);return{menuItems:t,hasResolvedMenuItems:n}}function N2(){const{pages:e,isResolvingPages:t,hasResolvedPages:n}=Tl((e=>{const{getEntityRecords:t,isResolving:n,hasFinishedResolution:r}=e(yd),o=["postType","page",{parent:0,order:"asc",orderby:"id",per_page:-1}];return{pages:t(...o)||null,isResolvingPages:n("getEntityRecords",o),hasResolvedPages:r("getEntityRecords",o)}}),[]);return{pages:e,isResolvingPages:t,hasResolvedPages:n,hasPages:!(!n||null==e||!e.length)}}const D2=()=>(0,tt.createElement)("ul",{className:"wp-block-navigation-placeholder__preview wp-block-navigation__container"},(0,tt.createElement)("li",{className:"wp-block-navigation-link"},""),(0,tt.createElement)("li",{className:"wp-block-navigation-link"},""),(0,tt.createElement)("li",{className:"wp-block-navigation-link"},""),(0,tt.createElement)($L,{icon:bP}));function B2(e){if(!e)return null;return I2(function(e,t="id",n="parent"){const r=Object.create(null),o=[];for(const n of e)r[n[t]]={...n,children:[]};for(const a of e)a[n]?r[a[n]].children.push(r[a[t]]):o.push(r[a[t]]);return o}(e))}function I2(e){let t={};return{innerBlocks:(0,at.sortBy)(e,"menu_order").map((e=>{var n;if("block"===e.type){const[t]=ns(e.content.raw);return t||Ho("core/freeform",{content:e.content})}const r=function({title:e,xfn:t,classes:n,attr_title:r,object:o,object_id:a,description:i,url:s,type:l,target:c}){var u;o&&"post_tag"===o&&(o="tag");return{label:(null==e?void 0:e.rendered)||"",...(null===(u=o)||void 0===u?void 0:u.length)&&{type:o},kind:(null==l?void 0:l.replace("_","-"))||"custom",url:s||"",...(null==t?void 0:t.length)&&t.join(" ").trim()&&{rel:t.join(" ").trim()},...(null==n?void 0:n.length)&&n.join(" ").trim()&&{className:n.join(" ").trim()},...(null==r?void 0:r.length)&&{title:r},...a&&"custom"!==o&&{id:a},...(null==i?void 0:i.length)&&{description:i},..."_blank"===c&&{opensInNewTab:!0}}}(e),{innerBlocks:o=[],mapping:a={}}=null!==(n=e.children)&&void 0!==n&&n.length?I2(e.children):{};t={...t,...a};const i=Ho("core/navigation-link",r,o);return t[e.id]=i.clientId,i})),mapping:t}}const P2=(0,tt.forwardRef)((function({onCreate:e},t){const[n,r]=(0,tt.useState)(),[o,a]=(0,tt.useState)(!1),{isResolvingPages:i,menus:s,isResolvingMenus:l,menuItems:c,hasResolvedMenuItems:u,hasPages:d,hasMenus:p}=(m=n,{...N2(),...z2(),...O2(m)});var m;const f=i||l,h=(0,tt.useCallback)((()=>{const{innerBlocks:t}=B2(c);e(t,!0)}));return(0,tt.useEffect)((()=>{o&&u&&(h(),a(!1))}),[o,u]),(0,tt.createElement)(vH,{className:"wp-block-navigation-placeholder"},(0,tt.createElement)(D2,null),(0,tt.createElement)("div",{className:"wp-block-navigation-placeholder__controls"},f&&(0,tt.createElement)("div",{ref:t},(0,tt.createElement)(cq,null)),!f&&(0,tt.createElement)("div",{ref:t,className:"wp-block-navigation-placeholder__actions"},(0,tt.createElement)("div",{className:"wp-block-navigation-placeholder__actions__indicator"},(0,tt.createElement)($L,{icon:T2})," ",er("Navigation")),p?(0,tt.createElement)(Zg,{text:er("Add existing menu"),icon:OA,toggleProps:{variant:"primary",className:"wp-block-navigation-placeholder__actions__dropdown"}},(({onClose:e})=>(0,tt.createElement)(ON,null,s.map((t=>(0,tt.createElement)(zB,{onClick:()=>{r(t.id),u?h():a(!0)},onClose:e,key:t.id},t.name)))))):void 0,d?(0,tt.createElement)(Eh,{variant:p?"tertiary":"primary",onClick:()=>{const t=[Ho("core/page-list")];e(t,!0)}},er("Add all pages")):void 0,(0,tt.createElement)(Eh,{variant:"tertiary",onClick:()=>{e([])}},er("Start empty")))))}));function R2({children:e,id:t,isOpen:n,isResponsive:r,onToggle:o}){if(!r)return e;const a=so()("wp-block-navigation__responsive-container",{"is-menu-open":n}),i=`${t}-modal`;return(0,tt.createElement)(tt.Fragment,null,!n&&(0,tt.createElement)(Eh,{"aria-haspopup":"true","aria-expanded":n,"aria-label":er("Open menu"),className:"wp-block-navigation__responsive-container-open",onClick:()=>o(!0)},(0,tt.createElement)(mo,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24",role:"img","aria-hidden":"true",focusable:"false"},(0,tt.createElement)(po,{x:"4",y:"7.5",width:"16",height:"1.5"}),(0,tt.createElement)(po,{x:"4",y:"15",width:"16",height:"1.5"}))),(0,tt.createElement)("div",{className:a,id:i,"aria-hidden":!n},(0,tt.createElement)("div",{className:"wp-block-navigation__responsive-close",tabIndex:"-1"},(0,tt.createElement)("div",{className:"wp-block-navigation__responsive-dialog",role:"dialog","aria-modal":"true","aria-labelledby":`${i}-title`},(0,tt.createElement)(Eh,{className:"wp-block-navigation__responsive-container-close","aria-label":er("Close menu"),onClick:()=>o(!1)},(0,tt.createElement)($L,{icon:Hm})),(0,tt.createElement)("div",{className:"wp-block-navigation__responsive-container-content",id:`${i}-content`},e)))))}const Y2=["core/navigation-link","core/search","core/social-links","core/page-list","core/spacer","core/home-link"],W2={type:"default",alignments:[]};function H2(e){return e.ownerDocument.defaultView.getComputedStyle(e)}function q2(e,t,n){if(!e)return;t(H2(e).color);let r=e,o=H2(r).backgroundColor;for(;"rgba(0, 0, 0, 0)"===o&&r.parentNode&&r.parentNode.nodeType===r.parentNode.ELEMENT_NODE;)r=r.parentNode,o=H2(r).backgroundColor;n(o)}const j2=lS([QI(((e,{clientId:t})=>{var n;const r=e(nk).getBlocks(t),{getClientIdsOfDescendants:o,hasSelectedInnerBlock:a,getSelectedBlockClientId:i}=e(nk),s=a(t,!1),l=i();return{isImmediateParentOfSelectedBlock:s,selectedBlockHasDescendants:!(null===(n=o([l]))||void 0===n||!n.length),hasExistingNavItems:!!r.length,isSelected:l===t}})),eP(((e,{clientId:t})=>({updateInnerBlocks(n){if(0===(null==n?void 0:n.length))return!1;e(nk).replaceInnerBlocks(t,n,!0)}}))),cD({textColor:"color"},{backgroundColor:"color"},{overlayBackgroundColor:"color"},{overlayTextColor:"color"})])((function({selectedBlockHasDescendants:e,attributes:t,setAttributes:n,clientId:r,hasExistingNavItems:o,isImmediateParentOfSelectedBlock:a,isSelected:i,updateInnerBlocks:s,className:l,backgroundColor:c,setBackgroundColor:u,textColor:d,setTextColor:p,overlayBackgroundColor:m,setOverlayBackgroundColor:f,overlayTextColor:h,setOverlayTextColor:g,hasSubmenuIndicatorSetting:b=!0,hasItemJustificationControls:v=!0,hasColorSettings:y=!0}){const[_,M]=(0,tt.useState)(!o),[k,w]=(0,tt.useState)(!1),{selectBlock:E}=ld(nk),L=(0,tt.useRef)(),A=VR({ref:L,className:so()(l,{[`items-justified-${t.itemsJustification}`]:t.itemsJustification,"is-vertical":"vertical"===t.orientation,"is-responsive":t.isResponsive,"has-text-color":!!d.color||!(null==d||!d.class),[mC("color",null==d?void 0:d.slug)]:!(null==d||!d.slug),"has-background":!!c.color||c.class,[mC("background-color",null==c?void 0:c.slug)]:!(null==c||!c.slug)}),style:{color:!(null!=d&&d.slug)&&(null==d?void 0:d.color),backgroundColor:!(null!=c&&c.slug)&&(null==c?void 0:c.color)}}),{navigatorToolbarButton:S,navigatorModal:C}=function(e,t){const[n,r]=(0,tt.useState)(!1);return{navigatorToolbarButton:(0,tt.createElement)(jg,{className:"components-toolbar__control",label:er("Open block navigation"),onClick:()=>r(!0),icon:kB}),navigatorModal:n&&(0,tt.createElement)(sR,{title:er("Navigation"),closeLabel:er("Close"),onRequestClose:()=>{r(!1)}},(0,tt.createElement)(x2,{clientId:e,__experimentalFeatures:t}))}}(r),T=(0,tt.useMemo)((()=>(0,tt.createElement)(D2,null)),[]),x=GH({className:"wp-block-navigation__container"},{allowedBlocks:Y2,orientation:t.orientation||"horizontal",renderAppender:!!(a&&!e||i)&&JH.DefaultAppender,__experimentalAppenderTagName:"li",__experimentalCaptureToolbars:!0,templateLock:!1,__experimentalLayout:W2,placeholder:T}),z="web"===_b.OS,[O,N]=(0,tt.useState)(),[D,B]=(0,tt.useState)(),[I,P]=(0,tt.useState)(),[R,Y]=(0,tt.useState)();if((0,tt.useEffect)((()=>{if(!z)return;q2(L.current,B,N);const e=L.current.querySelector('[data-type="core/navigation-link"] [data-type="core/navigation-link"]');e&&q2(e,Y,P)})),_)return(0,tt.createElement)("div",A,(0,tt.createElement)(P2,{onCreate:(e,t)=>{M(!1),s(e),t&&E(r)}}));const W="vertical"===t.orientation?["left","center","right"]:["left","center","right","space-between"];return(0,tt.createElement)(tt.Fragment,null,(0,tt.createElement)(lk,null,v&&(0,tt.createElement)(aq,{value:t.itemsJustification,allowedControls:W,onChange:e=>n({itemsJustification:e}),popoverProps:{position:"bottom right",isAlternate:!0}}),(0,tt.createElement)(tb,null,S)),C,(0,tt.createElement)(FA,null,b&&(0,tt.createElement)(BA,{title:er("Display settings")},(0,tt.createElement)(KN,{checked:t.showSubmenuIcon,onChange:e=>{n({showSubmenuIcon:e})},label:er("Show submenu indicator icons")}),(0,tt.createElement)(KN,{checked:t.isResponsive,onChange:e=>{n({isResponsive:e})},label:er("Enable responsive menu")})),y&&(0,tt.createElement)(aj,{title:er("Color"),initialOpen:!1,colorSettings:[{value:d.color,onChange:p,label:er("Text")},{value:c.color,onChange:u,label:er("Background")},{value:h.color,onChange:g,label:er("Overlay text")},{value:m.color,onChange:f,label:er("Overlay background")}]},z&&(0,tt.createElement)(tt.Fragment,null,(0,tt.createElement)(WT,{backgroundColor:O,textColor:D}),(0,tt.createElement)(WT,{backgroundColor:I,textColor:R})))),(0,tt.createElement)("nav",A,(0,tt.createElement)(R2,{id:r,onToggle:w,isOpen:k,isResponsive:t.isResponsive},(0,tt.createElement)("div",x))))}));const F2={fontStyle:"var:preset|font-style|",fontWeight:"var:preset|font-weight|",textDecoration:"var:preset|text-decoration|",textTransform:"var:preset|text-transform|"},V2=[{attributes:{orientation:{type:"string"},textColor:{type:"string"},customTextColor:{type:"string"},rgbTextColor:{type:"string"},backgroundColor:{type:"string"},customBackgroundColor:{type:"string"},rgbBackgroundColor:{type:"string"},itemsJustification:{type:"string"},showSubmenuIcon:{type:"boolean",default:!0}},supports:{align:["wide","full"],anchor:!0,html:!1,inserter:!0,fontSize:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalTextTransform:!0,color:!0,__experimentalFontFamily:!0,__experimentalTextDecoration:!0},save:()=>(0,tt.createElement)(JH.Content,null),isEligible(e){if(!e.style||!e.style.typography)return!1;for(const t in F2){const n=e.style.typography[t];if(n&&n.startsWith(F2[t]))return!0}return!1},migrate:e=>({...e,style:{...e.style,typography:(0,at.mapValues)(e.style.typography,((e,t)=>{const n=F2[t];if(n&&e.startsWith(n)){const r=e.slice(n.length);return"textDecoration"===t&&"strikethrough"===r?"line-through":r}return e}))}})},{attributes:{className:{type:"string"},textColor:{type:"string"},rgbTextColor:{type:"string"},backgroundColor:{type:"string"},rgbBackgroundColor:{type:"string"},fontSize:{type:"string"},customFontSize:{type:"number"},itemsJustification:{type:"string"},showSubmenuIcon:{type:"boolean"}},isEligible:e=>e.rgbTextColor||e.rgbBackgroundColor,supports:{align:["wide","full"],anchor:!0,html:!1,inserter:!0},migrate:e=>({...(0,at.omit)(e,["rgbTextColor","rgbBackgroundColor"]),customTextColor:e.textColor?void 0:e.rgbTextColor,customBackgroundColor:e.backgroundColor?void 0:e.rgbBackgroundColor}),save:()=>(0,tt.createElement)(JH.Content,null)}],X2=[{name:"horizontal",isDefault:!0,title:er("Navigation (horizontal)"),description:er("Links shown in a row."),attributes:{orientation:"horizontal"},scope:["inserter","transform"]},{name:"vertical",title:er("Navigation (vertical)"),description:er("Links shown in a column."),attributes:{orientation:"vertical"},scope:["inserter","transform"]}],U2={apiVersion:2,name:"core/navigation",title:"Navigation",category:"theme",description:"A collection of blocks that allow visitors to get around your site.",keywords:["menu","navigation","links"],textdomain:"default",attributes:{orientation:{type:"string"},textColor:{type:"string"},customTextColor:{type:"string"},rgbTextColor:{type:"string"},backgroundColor:{type:"string"},customBackgroundColor:{type:"string"},rgbBackgroundColor:{type:"string"},itemsJustification:{type:"string"},showSubmenuIcon:{type:"boolean",default:!0},isResponsive:{type:"boolean",default:!1},__unstableLocation:{type:"string"},overlayBackgroundColor:{type:"string"},customOverlayBackgroundColor:{type:"string"},overlayTextColor:{type:"string"},customOverlayTextColor:{type:"string"}},providesContext:{textColor:"textColor",customTextColor:"customTextColor",backgroundColor:"backgroundColor",customBackgroundColor:"customBackgroundColor",overlayTextColor:"overlayTextColor",customOverlayTextColor:"customOverlayTextColor",overlayBackgroundColor:"overlayBackgroundColor",customOverlayBackgroundColor:"customOverlayBackgroundColor",fontSize:"fontSize",customFontSize:"customFontSize",showSubmenuIcon:"showSubmenuIcon",style:"style",orientation:"orientation"},supports:{align:["wide","full"],anchor:!0,html:!1,inserter:!0,typography:{fontSize:!0,lineHeight:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalTextTransform:!0,__experimentalFontFamily:!0,__experimentalTextDecoration:!0}},viewScript:"file:./view.min.js",editorStyle:"wp-block-navigation-editor",style:"wp-block-navigation"},{name:$2}=U2,K2={icon:T2,variations:X2,example:{innerBlocks:[{name:"core/navigation-link",attributes:{label:er("Home"),url:"https://make.wordpress.org/"}},{name:"core/navigation-link",attributes:{label:er("About"),url:"https://make.wordpress.org/"}},{name:"core/navigation-link",attributes:{label:er("Contact"),url:"https://make.wordpress.org/"}}]},edit:j2,save:function(){return(0,tt.createElement)(JH.Content,null)},deprecated:V2},G2=(0,tt.createElement)(mo,{xmlns:"https://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,tt.createElement)(uo,{d:"M12.5 14.5h-1V16h1c2.2 0 4-1.8 4-4s-1.8-4-4-4h-1v1.5h1c1.4 0 2.5 1.1 2.5 2.5s-1.1 2.5-2.5 2.5zm-4 1.5v-1.5h-1C6.1 14.5 5 13.4 5 12s1.1-2.5 2.5-2.5h1V8h-1c-2.2 0-4 1.8-4 4s1.8 4 4 4h1zm-1-3.2h5v-1.5h-5v1.5zM18 4H9c-1.1 0-2 .9-2 2v.5h1.5V6c0-.3.2-.5.5-.5h9c.3 0 .5.2.5.5v12c0 .3-.2.5-.5.5H9c-.3 0-.5-.2-.5-.5v-.5H7v.5c0 1.1.9 2 2 2h9c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2z"})),J2=(0,tt.createElement)(mo,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,tt.createElement)(uo,{d:"M2 12c0 3.6 2.4 5.5 6 5.5h.5V19l3-2.5-3-2.5v2H8c-2.5 0-4.5-1.5-4.5-4s2-4.5 4.5-4.5h3.5V6H8c-3.6 0-6 2.4-6 6zm19.5-1h-8v1.5h8V11zm0 5h-8v1.5h8V16zm0-10h-8v1.5h8V6z"})),Q2=()=>(0,tt.createElement)(mo,{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 12 12",fill:"none"},(0,tt.createElement)(uo,{d:"M1.50002 4L6.00002 8L10.5 4",strokeWidth:"1.5"})),{name:Z2}={apiVersion:2,name:"core/navigation-link",title:"Custom Link",category:"design",parent:["core/navigation"],description:"Add a page, link, or another item to your navigation.",textdomain:"default",attributes:{label:{type:"string"},type:{type:"string"},description:{type:"string"},rel:{type:"string"},id:{type:"number"},opensInNewTab:{type:"boolean",default:!1},url:{type:"string"},title:{type:"string"},kind:{type:"string"},isTopLevelLink:{type:"boolean"}},usesContext:["textColor","customTextColor","backgroundColor","customBackgroundColor","overlayTextColor","customOverlayTextColor","overlayBackgroundColor","customOverlayBackgroundColor","fontSize","customFontSize","showSubmenuIcon","style"],supports:{reusable:!1,html:!1},editorStyle:"wp-block-navigation-link-editor",style:"wp-block-navigation-link"},e3=["core/navigation-link"];function t3(e,t){switch(e){case"post":case"page":return{type:"post",subtype:e};case"category":return{type:"term",subtype:"category"};case"tag":return{type:"term",subtype:"post_tag"};case"post_format":return{type:"post-format"};default:return"taxonomy"===t?{type:"term",subtype:e}:"post-type"===t?{type:"post",subtype:e}:{}}}function n3(e,t){var n,r;const{textColor:o,customTextColor:a,backgroundColor:i,customBackgroundColor:s,overlayTextColor:l,customOverlayTextColor:c,overlayBackgroundColor:u,customOverlayBackgroundColor:d,style:p}=e,m={};return t&&c?m.customTextColor=c:t&&l?m.textColor=l:a?m.customTextColor=a:o?m.textColor=o:null!=p&&null!==(n=p.color)&&void 0!==n&&n.text&&(m.customTextColor=p.color.text),t&&d?m.customBackgroundColor=d:t&&u?m.backgroundColor=u:s?m.customBackgroundColor=s:i?m.backgroundColor=i:null!=p&&null!==(r=p.color)&&void 0!==r&&r.background&&(m.customTextColor=p.color.background),m}const r3=(0,tt.createElement)(mo,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,tt.createElement)(uo,{d:"M4 14.5h16V16H4zM4 18.5h9V20H4zM4 4h3c2 0 3 .86 3 2.583 0 .891-.253 1.554-.76 1.988-.505.435-1.24.652-2.204.652H5.542V12H4V4zm2.855 4c.53 0 .924-.114 1.18-.343.266-.228.398-.579.398-1.051 0-.473-.132-.82-.397-1.04-.265-.229-.67-.343-1.217-.343H5.542V8h1.313z"})),o3=(0,tt.createElement)(mo,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,tt.createElement)(uo,{d:"M7 5.5h10a.5.5 0 01.5.5v12a.5.5 0 01-.5.5H7a.5.5 0 01-.5-.5V6a.5.5 0 01.5-.5zM17 4H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V6a2 2 0 00-2-2zm-1 3.75H8v1.5h8v-1.5zM8 11h8v1.5H8V11zm6 3.25H8v1.5h6v-1.5z"})),a3=(0,tt.createElement)(mo,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,tt.createElement)(uo,{d:"M20.1 11.2l-6.7-6.7c-.1-.1-.3-.2-.5-.2H5c-.4-.1-.8.3-.8.7v7.8c0 .2.1.4.2.5l6.7 6.7c.2.2.5.4.7.5s.6.2.9.2c.3 0 .6-.1.9-.2.3-.1.5-.3.8-.5l5.6-5.6c.4-.4.7-1 .7-1.6.1-.6-.2-1.2-.6-1.6zM19 13.4L13.4 19c-.1.1-.2.1-.3.2-.2.1-.4.1-.6 0-.1 0-.2-.1-.3-.2l-6.5-6.5V5.8h6.8l6.5 6.5c.2.2.2.4.2.6 0 .1 0 .3-.2.5zM9 8c-.6 0-1 .4-1 1s.4 1 1 1 1-.4 1-1-.4-1-1-1z"})),i3=(0,tt.createElement)(mo,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,tt.createElement)(uo,{d:"M4 20h9v-1.5H4V20zm0-5.5V16h16v-1.5H4zm.8-4l.7.7 2-2V12h1V9.2l2 2 .7-.7-2-2H12v-1H9.2l2-2-.7-.7-2 2V4h-1v2.8l-2-2-.7.7 2 2H4v1h2.8l-2 2z"})),s3=[{name:"link",isDefault:!0,title:er("Custom Link"),description:er("A link to a custom URL."),attributes:{}},{name:"post",icon:r3,title:er("Post Link"),description:er("A link to a post."),attributes:{type:"post",kind:"post-type"}},{name:"page",icon:o3,title:er("Page Link"),description:er("A link to a page."),attributes:{type:"page",kind:"post-type"}},{name:"category",icon:CZ,title:er("Category Link"),description:er("A link to a category."),attributes:{type:"category",kind:"taxonomy"}},{name:"tag",icon:a3,title:er("Tag Link"),description:er("A link to a tag."),attributes:{type:"tag",kind:"taxonomy"}}];s3.forEach((e=>{e.isActive||(e.isActive=(e,t)=>e.type===t.type)}));const l3=s3;function c3(e){switch(e){case"post":return r3;case"page":return o3;case"tag":return a3;case"category":return CZ;default:return i3}}const u3={apiVersion:2,name:"core/navigation-link",title:"Custom Link",category:"design",parent:["core/navigation"],description:"Add a page, link, or another item to your navigation.",textdomain:"default",attributes:{label:{type:"string"},type:{type:"string"},description:{type:"string"},rel:{type:"string"},id:{type:"number"},opensInNewTab:{type:"boolean",default:!1},url:{type:"string"},title:{type:"string"},kind:{type:"string"},isTopLevelLink:{type:"boolean"}},usesContext:["textColor","customTextColor","backgroundColor","customBackgroundColor","overlayTextColor","customOverlayTextColor","overlayBackgroundColor","customOverlayBackgroundColor","fontSize","customFontSize","showSubmenuIcon","style"],supports:{reusable:!1,html:!1},editorStyle:"wp-block-navigation-link-editor",style:"wp-block-navigation-link"},{name:d3}=u3,p3={icon:G2,__experimentalLabel:({label:e})=>e,merge:(e,{label:t=""})=>({...e,label:e.label+t}),edit:function({attributes:e,isSelected:t,setAttributes:n,insertBlocksAfter:r,mergeBlocks:o,onReplace:a,context:i,clientId:s}){const{label:l,type:c,opensInNewTab:u,url:d,description:p,rel:m,title:f,kind:h}=e,g={url:d,opensInNewTab:u},{showSubmenuIcon:b}=i,{saveEntityRecord:v}=ld(yd),{insertBlock:y}=ld(nk),[_,M]=(0,tt.useState)(!1),k=(0,tt.useRef)(null),w=(e=>{const[t,n]=(0,tt.useState)(!1);return(0,tt.useEffect)((()=>{const{ownerDocument:t}=e.current;function r(e){a(e)}function o(){n(!1)}function a(t){e.current.contains(t.target)?n(!0):n(!1)}return t.addEventListener("dragstart",r),t.addEventListener("dragend",o),t.addEventListener("dragenter",a),()=>{t.removeEventListener("dragstart",r),t.removeEventListener("dragend",o),t.removeEventListener("dragenter",a)}}),[]),t})(k),E=er("Add link…"),L=(0,tt.useRef)(),{isAtMaxNesting:A,isTopLevelLink:S,isParentOfSelectedBlock:C,isImmediateParentOfSelectedBlock:T,hasDescendants:x,selectedBlockHasDescendants:z,numberOfDescendants:O,userCanCreatePages:N,userCanCreatePosts:D}=Tl((e=>{var t;const{getClientIdsOfDescendants:n,hasSelectedInnerBlock:r,getSelectedBlockClientId:o,getBlockParentsByBlockName:a}=e(nk),i=o(),l=n([s]).length;return{isAtMaxNesting:a(s,Z2).length>=5,isTopLevelLink:0===a(s,Z2).length,isParentOfSelectedBlock:r(s,!0),isImmediateParentOfSelectedBlock:r(s,!1),hasDescendants:!!l,selectedBlockHasDescendants:!(null===(t=n([i]))||void 0===t||!t.length),numberOfDescendants:l,userCanCreatePages:e(yd).canUser("create","pages"),userCanCreatePosts:e(yd).canUser("create","posts")}}),[s]);(0,tt.useEffect)((()=>n({isTopLevelLink:S})),[S]),(0,tt.useEffect)((()=>{d||M(!0)}),[]),(0,tt.useEffect)((()=>{t||M(!1)}),[t]),(0,tt.useEffect)((()=>{_&&d&&(fq(xq(l))&&/^.+\.[a-z]+/.test(l)?function(){L.current.focus();const{ownerDocument:e}=L.current,{defaultView:t}=e,n=t.getSelection(),r=e.createRange();r.selectNodeContents(L.current),n.removeAllRanges(),n.addRange(r)}():LR(L.current,!0))}),[d]);let B=!1;c&&"page"!==c?"post"===c&&(B=D):B=N;const{textColor:I,customTextColor:P,backgroundColor:R,customBackgroundColor:Y}=n3(i,!S),W=VR({ref:k,className:so()({"is-editing":t||C,"is-dragging-within":w,"has-link":!!d,"has-child":x,"has-text-color":!!I||!!P,[mC("color",I)]:!!I,"has-background":!!R||Y,[mC("background-color",R)]:!!R}),style:{color:!I&&P,backgroundColor:!R&&Y}});d||(W.onClick=()=>M(!0));const H=n3(i,!0),q=GH({className:so()("wp-block-navigation-link__container",{"is-parent-of-selected-block":C,"has-text-color":!(!H.textColor&&!H.customTextColor),[`has-${H.textColor}-color`]:!!H.textColor,"has-background":!(!H.backgroundColor&&!H.customBackgroundColor),[`has-${H.backgroundColor}-background-color`]:!!H.backgroundColor}),style:{color:H.customTextColor,backgroundColor:H.customBackgroundColor}},{allowedBlocks:e3,renderAppender:!!(t&&x||T&&!z||x)&&JH.DefaultAppender}),j=so()("wp-block-navigation-link__content",{"wp-block-navigation-link__placeholder":!d});let F="";switch(c){case"post":F=er("Select post");break;case"page":F=er("Select page");break;case"category":F=er("Select category");break;case"tag":F=er("Select tag");break;default:F=er("Add link")}return(0,tt.createElement)(tt.Fragment,null,(0,tt.createElement)(lk,null,(0,tt.createElement)(tb,null,(0,tt.createElement)(aS,{bindGlobal:!0,shortcuts:{[hm.primary("k")]:()=>M(!0)}}),(0,tt.createElement)(jg,{name:"link",icon:dT,title:er("Link"),shortcut:bm.primary("k"),onClick:()=>M(!0)}),!A&&(0,tt.createElement)(jg,{name:"submenu",icon:J2,title:er("Add submenu"),onClick:function(){const e=O,t=Ho("core/navigation-link");y(t,e,s)}}))),(0,tt.createElement)(FA,null,(0,tt.createElement)(BA,{title:er("Link settings")},(0,tt.createElement)(XK,{value:p||"",onChange:e=>{n({description:e})},label:er("Description"),help:er("The description will be displayed in the menu if the current theme supports it.")}),(0,tt.createElement)(LA,{value:f||"",onChange:e=>{n({title:e})},label:er("Link title"),autoComplete:"off"}),(0,tt.createElement)(LA,{value:m||"",onChange:e=>{n({rel:e})},label:er("Link rel"),autoComplete:"off"}))),(0,tt.createElement)("div",W,(0,tt.createElement)("a",{className:j},d?(0,tt.createElement)(Cj,{ref:L,identifier:"label",className:"wp-block-navigation-link__label",value:l,onChange:e=>n({label:e}),onMerge:o,onReplace:a,__unstableOnSplitAtEnd:()=>r(Ho("core/navigation-link")),"aria-label":er("Navigation link text"),placeholder:E,withoutInteractiveFormatting:!0,allowedFormats:["core/bold","core/italic","core/image","core/strikethrough"],onClick:()=>{d||M(!0)}}):(0,tt.createElement)("div",{className:"wp-block-navigation-link__placeholder-text"},(0,tt.createElement)(aS,{shortcuts:{enter:()=>t&&M(!0)}}),F),_&&(0,tt.createElement)(_f,{position:"bottom center",onClose:()=>M(!1),anchorRef:k.current},(0,tt.createElement)(aS,{bindGlobal:!0,shortcuts:{escape:()=>M(!1)}}),(0,tt.createElement)(Vq,{className:"wp-block-navigation-link__inline-link-input",value:g,showInitialSuggestions:!0,withCreateSuggestion:B,createSuggestion:async function(e){const t=c||"page",n=await v("postType",t,{title:e,status:"draft"});return{id:n.id,type:t,title:n.title.rendered,url:n.link,kind:"post-type"}},createSuggestionButtonText:e=>{let t;return t=er("post"===c?"Create draft post: %s ":"Create draft page: %s "),TP(pn(t,e),{mark:(0,tt.createElement)("mark",null)})},noDirectEntry:!!c,noURLSuggestion:!!c,suggestionsQuery:t3(c,h),onChange:t=>((e={},t,n={})=>{const{label:r="",kind:o="",type:a=""}=n,{title:i="",url:s="",opensInNewTab:l,id:c,kind:u=o,type:d=a}=e,p=i.replace(/http(s?):\/\//gi,""),m=s.replace(/http(s?):\/\//gi,""),f=""!==i&&p!==m&&r!==i?(0,at.escape)(i):r||(0,at.escape)(m),h="post_tag"===d?"tag":d.replace("-","_"),g=["post","page","tag","category"].indexOf(h)>-1,b=!u&&!g||"custom"===u?"custom":u;t({...s&&{url:encodeURI(yq(s))},...f&&{label:f},...void 0!==l&&{opensInNewTab:l},...c&&Number.isInteger(c)&&{id:c},...b&&{kind:b},...h&&"URL"!==h&&{type:h}})})(t,n,e)})),x&&b&&(0,tt.createElement)("span",{className:"wp-block-navigation-link__submenu-icon"},(0,tt.createElement)(Q2,null))),(0,tt.createElement)("div",q)))},save:function(){return(0,tt.createElement)(JH.Content,null)},example:{attributes:{label:tr("Example Link","navigation link preview example"),url:"https://example.com"}},deprecated:[{isEligible:e=>e.nofollow,attributes:{label:{type:"string"},type:{type:"string"},nofollow:{type:"boolean"},description:{type:"string"},id:{type:"number"},opensInNewTab:{type:"boolean",default:!1},url:{type:"string"}},migrate:({nofollow:e,...t})=>({rel:e?"nofollow":"",...t}),save:()=>(0,tt.createElement)(JH.Content,null)}]};In("blocks.registerBlockType","core/navigation-link",(function(e,t){if("core/navigation-link"!==t)return e;if(!e.variations)return{...e,variations:l3};if(e.variations){const t=(e,t)=>e.type===t.type,n=e.variations.map((e=>({...e,...!e.icon&&{icon:c3(e.name)},...!e.isActive&&{isActive:t}})));return{...e,variations:n}}return e}));const m3=(0,tt.createElement)(mo,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,tt.createElement)(uo,{d:"M12 4L4 7.9V20h16V7.9L12 4zm6.5 14.5H14V13h-4v5.5H5.5V8.8L12 5.7l6.5 3.1v9.7z"})),f3=e=>e.preventDefault();const h3={apiVersion:2,name:"core/home-link",category:"design",parent:["core/navigation"],title:"Home Link",description:"Create a link that always points to the homepage of the site. Usually not necessary if there is already a site title link present in the header.",textdomain:"default",attributes:{label:{type:"string"}},usesContext:["textColor","customTextColor","backgroundColor","customBackgroundColor","fontSize","customFontSize","style"],supports:{reusable:!1,html:!1},editorStyle:"wp-block-home-link-editor",style:"wp-block-home-link"},{name:g3}=h3,b3={icon:m3,edit:function({attributes:e,setAttributes:t,context:n,clientId:r}){var o,a,i,s;const{homeUrl:l}=Tl((e=>{var t;const{getUnstableBase:n}=e(yd);return{homeUrl:null===(t=n())||void 0===t?void 0:t.home}}),[r]),{textColor:c,backgroundColor:u,style:d}=n,p=VR({className:so()({"has-text-color":!!c||!(null==d||null===(o=d.color)||void 0===o||!o.text),[`has-${c}-color`]:!!c,"has-background":!!u||!(null==d||null===(a=d.color)||void 0===a||!a.background),[`has-${u}-background-color`]:!!u}),style:{color:null==d||null===(i=d.color)||void 0===i?void 0:i.text,backgroundColor:null==d||null===(s=d.color)||void 0===s?void 0:s.background}}),{label:m}=e;return(0,tt.useEffect)((()=>{void 0===m&&t({label:er("Home")})}),[r,m]),(0,tt.createElement)(tt.Fragment,null,(0,tt.createElement)("div",p,(0,tt.createElement)("a",{className:"wp-block-home-link__content",href:l,onClick:f3},(0,tt.createElement)(Cj,{identifier:"label",className:"wp-block-home-link__label",value:m,onChange:e=>{t({label:e})},"aria-label":er("Home link text"),placeholder:er("Add home link"),withoutInteractiveFormatting:!0,allowedFormats:["core/bold","core/italic","core/image","core/strikethrough"]}))))},save:function(){return(0,tt.createElement)(JH.Content,null)},example:{attributes:{label:tr("Home Link","block example")}}},v3=(0,tt.createElement)(mo,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,tt.createElement)(uo,{d:"M18 4H6c-1.1 0-2 .9-2 2v12.9c0 .6.5 1.1 1.1 1.1.3 0 .5-.1.8-.3L8.5 17H18c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm.5 11c0 .3-.2.5-.5.5H7.9l-2.4 2.4V6c0-.3.2-.5.5-.5h12c.3 0 .5.2.5.5v9z"}));const y3={apiVersion:2,name:"core/latest-comments",title:"Latest Comments",category:"widgets",description:"Display a list of your most recent comments.",keywords:["recent comments"],textdomain:"default",attributes:{commentsToShow:{type:"number",default:5,minimum:1,maximum:100},displayAvatar:{type:"boolean",default:!0},displayDate:{type:"boolean",default:!0},displayExcerpt:{type:"boolean",default:!0}},supports:{align:!0,html:!1},editorStyle:"wp-block-latest-comments-editor",style:"wp-block-latest-comments"},{name:_3}=y3,M3={icon:v3,example:{},edit:function({attributes:e,setAttributes:t}){const{commentsToShow:n,displayAvatar:r,displayDate:o,displayExcerpt:a}=e;return(0,tt.createElement)("div",VR(),(0,tt.createElement)(FA,null,(0,tt.createElement)(BA,{title:er("Latest comments settings")},(0,tt.createElement)(KN,{label:er("Display avatar"),checked:r,onChange:()=>t({displayAvatar:!r})}),(0,tt.createElement)(KN,{label:er("Display date"),checked:o,onChange:()=>t({displayDate:!o})}),(0,tt.createElement)(KN,{label:er("Display excerpt"),checked:a,onChange:()=>t({displayExcerpt:!a})}),(0,tt.createElement)(rT,{label:er("Number of comments"),value:n,onChange:e=>t({commentsToShow:e}),min:1,max:100,required:!0}))),(0,tt.createElement)(jP,null,(0,tt.createElement)(YQ,{block:"core/latest-comments",attributes:e})))}},k3=(0,tt.createElement)(mo,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,tt.createElement)(uo,{d:"M18 4H6c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm.5 14c0 .3-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h12c.3 0 .5.2.5.5v12zM7 11h2V9H7v2zm0 4h2v-2H7v2zm3-4h7V9h-7v2zm0 4h7v-2h-7v2z"})),{attributes:w3}={apiVersion:2,name:"core/latest-posts",title:"Latest Posts",category:"widgets",description:"Display a list of your most recent posts.",keywords:["recent posts"],textdomain:"default",attributes:{categories:{type:"array",items:{type:"object"}},selectedAuthor:{type:"number"},postsToShow:{type:"number",default:5},displayPostContent:{type:"boolean",default:!1},displayPostContentRadio:{type:"string",default:"excerpt"},excerptLength:{type:"number",default:55},displayAuthor:{type:"boolean",default:!1},displayPostDate:{type:"boolean",default:!1},postLayout:{type:"string",default:"list"},columns:{type:"number",default:3},order:{type:"string",default:"desc"},orderBy:{type:"string",default:"date"},displayFeaturedImage:{type:"boolean",default:!1},featuredImageAlign:{type:"string",enum:["left","center","right"]},featuredImageSizeSlug:{type:"string",default:"thumbnail"},featuredImageSizeWidth:{type:"number",default:null},featuredImageSizeHeight:{type:"number",default:null},addLinkToFeaturedImage:{type:"boolean",default:!1}},supports:{align:!0,html:!1},editorStyle:"wp-block-latest-posts-editor",style:"wp-block-latest-posts"},E3=[{attributes:{...w3,categories:{type:"string"}},supports:{align:!0,html:!1},migrate:e=>({...e,categories:[{id:Number(e.categories)}]}),isEligible:({categories:e})=>e&&"string"==typeof e,save:()=>null}];function L3({label:e,className:t,selected:n,help:r,onChange:o,hideLabelFromVision:a,options:i=[],...s}){const l=`inspector-radio-control-${Qk(L3)}`,c=e=>o(e.target.value);return!(0,at.isEmpty)(i)&&(0,tt.createElement)(EA,{label:e,id:l,hideLabelFromVision:a,help:r,className:so()(t,"components-radio-control")},i.map(((e,t)=>(0,tt.createElement)("div",{key:`${l}-${t}`,className:"components-radio-control__option"},(0,tt.createElement)("input",ot({id:`${l}-${t}`,className:"components-radio-control__input",type:"radio",name:l,value:e.value,onChange:c,checked:e.value===n,"aria-describedby":r?`${l}__help`:void 0},s)),(0,tt.createElement)("label",{htmlFor:`${l}-${t}`},e.label)))))}function A3(e){const t=e.map((e=>({children:[],parent:null,...e}))),n=(0,at.groupBy)(t,"parent");if(n.null&&n.null.length)return t;const r=e=>e.map((e=>{const t=n[e.id];return{...e,children:t&&t.length?r(t):[]}}));return r(n[0]||[])}function S3(e,t=0){return(0,at.flatMap)(e,(e=>[{value:e.id,label:(0,at.repeat)(" ",3*t)+(0,at.unescape)(e.name)},...S3(e.children||[],t+1)]))}function C3({label:e,noOptionLabel:t,onChange:n,selectedId:r,tree:o,...a}){const i=(0,tt.useMemo)((()=>(0,at.compact)([t&&{value:"",label:t},...S3(o)])),[t,o]);return(0,tt.createElement)(KS,ot({label:e,options:i,onChange:n,value:r},a))}function T3({label:e,noOptionLabel:t,categoriesList:n,selectedCategoryId:r,onChange:o,...a}){const i=(0,tt.useMemo)((()=>A3(n)),[n]);return(0,tt.createElement)(C3,ot({label:e,noOptionLabel:t,onChange:o,tree:i,selectedId:r},a))}function x3({value:e,status:t,title:n,displayTransform:r,isBorderless:o=!1,disabled:a=!1,onClickRemove:i=at.noop,onMouseEnter:s,onMouseLeave:l,messages:c,termPosition:u,termsCount:d}){const p=Qk(x3),m=so()("components-form-token-field__token",{"is-error":"error"===t,"is-success":"success"===t,"is-validating":"validating"===t,"is-borderless":o,"is-disabled":a}),f=r(e),h=pn(er("%1$s (%2$s of %3$s)"),f,u,d);return(0,tt.createElement)("span",{className:m,onMouseEnter:s,onMouseLeave:l,title:n},(0,tt.createElement)("span",{className:"components-form-token-field__token-text",id:`components-form-token-field__token-text-${p}`},(0,tt.createElement)(kh,{as:"span"},h),(0,tt.createElement)("span",{"aria-hidden":"true"},f)),(0,tt.createElement)(Eh,{className:"components-form-token-field__remove-token",icon:gP,onClick:!a&&(()=>i({value:e})),label:c.remove,"aria-describedby":`components-form-token-field__token-text-${p}`}))}class z3 extends tt.Component{constructor(){super(...arguments),this.onChange=this.onChange.bind(this),this.bindInput=this.bindInput.bind(this)}focus(){this.input.focus()}hasFocus(){return this.input===this.input.ownerDocument.activeElement}bindInput(e){this.input=e}onChange(e){this.props.onChange({value:e.target.value})}render(){const{value:e,isExpanded:t,instanceId:n,selectedSuggestionIndex:r,className:o,...a}=this.props,i=e?e.length+1:0;return(0,tt.createElement)("input",ot({ref:this.bindInput,id:`components-form-token-input-${n}`,type:"text"},a,{value:e||"",onChange:this.onChange,size:i,className:so()(o,"components-form-token-field__input"),autoComplete:"off",role:"combobox","aria-expanded":t,"aria-autocomplete":"list","aria-owns":t?`components-form-token-suggestions-${n}`:void 0,"aria-activedescendant":-1!==r?`components-form-token-suggestions-${n}-${r}`:void 0,"aria-describedby":`components-form-token-suggestions-howto-${n}`}))}}const O3=z3;class N3 extends tt.Component{constructor(){super(...arguments),this.handleMouseDown=this.handleMouseDown.bind(this),this.bindList=this.bindList.bind(this)}componentDidUpdate(){this.props.selectedIndex>-1&&this.props.scrollIntoView&&this.list.children[this.props.selectedIndex]&&(this.scrollingIntoView=!0,WR()(this.list.children[this.props.selectedIndex],this.list,{onlyScrollIfNeeded:!0}),this.props.setTimeout((()=>{this.scrollingIntoView=!1}),100))}bindList(e){this.list=e}handleHover(e){return()=>{this.scrollingIntoView||this.props.onHover(e)}}handleClick(e){return()=>{this.props.onSelect(e)}}handleMouseDown(e){e.preventDefault()}computeSuggestionMatch(e){const t=this.props.displayTransform(this.props.match||"").toLocaleLowerCase();if(0===t.length)return null;const n=(e=this.props.displayTransform(e)).toLocaleLowerCase().indexOf(t);return{suggestionBeforeMatch:e.substring(0,n),suggestionMatch:e.substring(n,n+t.length),suggestionAfterMatch:e.substring(n+t.length)}}render(){return(0,tt.createElement)("ul",{ref:this.bindList,className:"components-form-token-field__suggestions-list",id:`components-form-token-suggestions-${this.props.instanceId}`,role:"listbox"},(0,at.map)(this.props.suggestions,((e,t)=>{const n=this.computeSuggestionMatch(e),r=so()("components-form-token-field__suggestion",{"is-selected":t===this.props.selectedIndex});return(0,tt.createElement)("li",{id:`components-form-token-suggestions-${this.props.instanceId}-${t}`,role:"option",className:r,key:null!=e&&e.value?e.value:this.props.displayTransform(e),onMouseDown:this.handleMouseDown,onClick:this.handleClick(e),onMouseEnter:this.handleHover(e),"aria-selected":t===this.props.selectedIndex},n?(0,tt.createElement)("span",{"aria-label":this.props.displayTransform(e)},n.suggestionBeforeMatch,(0,tt.createElement)("strong",{className:"components-form-token-field__suggestion-match"},n.suggestionMatch),n.suggestionAfterMatch):this.props.displayTransform(e))})))}}N3.defaultProps={match:"",onHover:()=>{},onSelect:()=>{},suggestions:Object.freeze([])};const D3=mq(N3),B3={incompleteTokenValue:"",inputOffsetFromEnd:0,isActive:!1,isExpanded:!1,selectedSuggestionIndex:-1,selectedSuggestionScroll:!1};class I3 extends tt.Component{constructor(){super(...arguments),this.state=B3,this.onKeyDown=this.onKeyDown.bind(this),this.onKeyPress=this.onKeyPress.bind(this),this.onFocus=this.onFocus.bind(this),this.onBlur=this.onBlur.bind(this),this.deleteTokenBeforeInput=this.deleteTokenBeforeInput.bind(this),this.deleteTokenAfterInput=this.deleteTokenAfterInput.bind(this),this.addCurrentToken=this.addCurrentToken.bind(this),this.onContainerTouched=this.onContainerTouched.bind(this),this.renderToken=this.renderToken.bind(this),this.onTokenClickRemove=this.onTokenClickRemove.bind(this),this.onSuggestionHovered=this.onSuggestionHovered.bind(this),this.onSuggestionSelected=this.onSuggestionSelected.bind(this),this.onInputChange=this.onInputChange.bind(this),this.bindInput=this.bindInput.bind(this),this.bindTokensAndInput=this.bindTokensAndInput.bind(this),this.updateSuggestions=this.updateSuggestions.bind(this)}componentDidUpdate(e){this.state.isActive&&!this.input.hasFocus()&&this.input.focus();const{suggestions:t,value:n}=this.props,r=!ni(t,e.suggestions);(r||n!==e.value)&&this.updateSuggestions(r)}static getDerivedStateFromProps(e,t){return e.disabled&&t.isActive?{isActive:!1,incompleteTokenValue:""}:null}bindInput(e){this.input=e}bindTokensAndInput(e){this.tokensAndInput=e}onFocus(e){const{__experimentalExpandOnFocus:t}=this.props;this.input.hasFocus()||e.target===this.tokensAndInput?this.setState({isActive:!0,isExpanded:!!t||this.state.isExpanded}):this.setState({isActive:!1}),"function"==typeof this.props.onFocus&&this.props.onFocus(e)}onBlur(){this.inputHasValidValue()?this.setState({isActive:!1}):this.setState(B3)}onKeyDown(e){let t=!1;if(!e.defaultPrevented){switch(e.keyCode){case nm:t=this.handleDeleteKey(this.deleteTokenBeforeInput);break;case rm:t=this.addCurrentToken();break;case am:t=this.handleLeftArrowKey();break;case im:t=this.handleUpArrowKey();break;case sm:t=this.handleRightArrowKey();break;case lm:t=this.handleDownArrowKey();break;case cm:t=this.handleDeleteKey(this.deleteTokenAfterInput);break;case 32:this.props.tokenizeOnSpace&&(t=this.addCurrentToken());break;case om:t=this.handleEscapeKey(e)}t&&e.preventDefault()}}onKeyPress(e){let t=!1;switch(e.charCode){case 44:t=this.handleCommaKey()}t&&e.preventDefault()}onContainerTouched(e){e.target===this.tokensAndInput&&this.state.isActive&&e.preventDefault()}onTokenClickRemove(e){this.deleteToken(e.value),this.input.focus()}onSuggestionHovered(e){const t=this.getMatchingSuggestions().indexOf(e);t>=0&&this.setState({selectedSuggestionIndex:t,selectedSuggestionScroll:!1})}onSuggestionSelected(e){this.addNewToken(e)}onInputChange(e){const t=e.value,n=this.props.tokenizeOnSpace?/[ ,\t]+/:/[,\t]+/,r=t.split(n),o=(0,at.last)(r)||"";r.length>1&&this.addNewTokens(r.slice(0,-1)),this.setState({incompleteTokenValue:o},this.updateSuggestions),this.props.onInputChange(o)}handleDeleteKey(e){let t=!1;return this.input.hasFocus()&&this.isInputEmpty()&&(e(),t=!0),t}handleLeftArrowKey(){let e=!1;return this.isInputEmpty()&&(this.moveInputBeforePreviousToken(),e=!0),e}handleRightArrowKey(){let e=!1;return this.isInputEmpty()&&(this.moveInputAfterNextToken(),e=!0),e}handleUpArrowKey(){return this.setState(((e,t)=>({selectedSuggestionIndex:(0===e.selectedSuggestionIndex?this.getMatchingSuggestions(e.incompleteTokenValue,t.suggestions,t.value,t.maxSuggestions,t.saveTransform).length:e.selectedSuggestionIndex)-1,selectedSuggestionScroll:!0}))),!0}handleDownArrowKey(){return this.setState(((e,t)=>({selectedSuggestionIndex:(e.selectedSuggestionIndex+1)%this.getMatchingSuggestions(e.incompleteTokenValue,t.suggestions,t.value,t.maxSuggestions,t.saveTransform).length,selectedSuggestionScroll:!0}))),!0}handleEscapeKey(e){return this.setState({incompleteTokenValue:e.target.value,isExpanded:!1,selectedSuggestionIndex:-1,selectedSuggestionScroll:!1}),!0}handleCommaKey(){return this.inputHasValidValue()&&this.addNewToken(this.state.incompleteTokenValue),!0}moveInputToIndex(e){this.setState(((t,n)=>({inputOffsetFromEnd:n.value.length-Math.max(e,-1)-1})))}moveInputBeforePreviousToken(){this.setState(((e,t)=>({inputOffsetFromEnd:Math.min(e.inputOffsetFromEnd+1,t.value.length)})))}moveInputAfterNextToken(){this.setState((e=>({inputOffsetFromEnd:Math.max(e.inputOffsetFromEnd-1,0)})))}deleteTokenBeforeInput(){const e=this.getIndexOfInput()-1;e>-1&&this.deleteToken(this.props.value[e])}deleteTokenAfterInput(){const e=this.getIndexOfInput();e!this.valueContainsToken(e))));if(t.length>0){const e=(0,at.clone)(this.props.value);e.splice.apply(e,[this.getIndexOfInput(),0].concat(t)),this.props.onChange(e)}}addNewToken(e){const{__experimentalExpandOnFocus:t,__experimentalValidateInput:n}=this.props;n(e)?(this.addNewTokens([e]),this.props.speak(this.props.messages.added,"assertive"),this.setState({incompleteTokenValue:"",selectedSuggestionIndex:-1,selectedSuggestionScroll:!1,isExpanded:!t}),this.state.isActive&&this.input.focus()):this.props.speak(this.props.messages.__experimentalInvalid,"assertive")}deleteToken(e){const t=this.props.value.filter((t=>this.getTokenValue(t)!==this.getTokenValue(e)));this.props.onChange(t),this.props.speak(this.props.messages.removed,"assertive")}getTokenValue(e){return"object"==typeof e?e.value:e}getMatchingSuggestions(e=this.state.incompleteTokenValue,t=this.props.suggestions,n=this.props.value,r=this.props.maxSuggestions,o=this.props.saveTransform){let a=o(e);const i=[],s=[];return 0===a.length?t=(0,at.difference)(t,n):(a=a.toLocaleLowerCase(),(0,at.each)(t,(e=>{const t=e.toLocaleLowerCase().indexOf(a);-1===n.indexOf(e)&&(0===t?i.push(e):t>0&&s.push(e))})),t=i.concat(s)),(0,at.take)(t,r)}getSelectedSuggestion(){if(-1!==this.state.selectedSuggestionIndex)return this.getMatchingSuggestions()[this.state.selectedSuggestionIndex]}valueContainsToken(e){return(0,at.some)(this.props.value,(t=>this.getTokenValue(e)===this.getTokenValue(t)))}getIndexOfInput(){return this.props.value.length-this.state.inputOffsetFromEnd}isInputEmpty(){return 0===this.state.incompleteTokenValue.length}inputHasValidValue(){return this.props.saveTransform(this.state.incompleteTokenValue).length>0}updateSuggestions(e=!0){const{__experimentalExpandOnFocus:t}=this.props,{incompleteTokenValue:n}=this.state,r=n.trim().length>1,o=this.getMatchingSuggestions(n),a=o.length>0,i={isExpanded:t||r&&a};if(e&&(i.selectedSuggestionIndex=-1,i.selectedSuggestionScroll=!1),this.setState(i),r){const{debouncedSpeak:e}=this.props;e(a?pn(nr("%d result found, use up and down arrow keys to navigate.","%d results found, use up and down arrow keys to navigate.",o.length),o.length):er("No results."),"assertive")}}renderTokensAndInput(){const e=(0,at.map)(this.props.value,this.renderToken);return e.splice(this.getIndexOfInput(),0,this.renderInput()),e}renderToken(e,t,n){const r=this.getTokenValue(e),o=e.status?e.status:void 0,a=t+1,i=n.length;return(0,tt.createElement)(x3,{key:"token-"+r,value:r,status:o,title:e.title,displayTransform:this.props.displayTransform,onClickRemove:this.onTokenClickRemove,isBorderless:e.isBorderless||this.props.isBorderless,onMouseEnter:e.onMouseEnter,onMouseLeave:e.onMouseLeave,disabled:"error"!==o&&this.props.disabled,messages:this.props.messages,termsCount:i,termPosition:a})}renderInput(){const{autoCapitalize:e,autoComplete:t,maxLength:n,placeholder:r,value:o,instanceId:a}=this.props;let i={instanceId:a,autoCapitalize:e,autoComplete:t,placeholder:0===o.length?r:"",ref:this.bindInput,key:"input",disabled:this.props.disabled,value:this.state.incompleteTokenValue,onBlur:this.onBlur,isExpanded:this.state.isExpanded,selectedSuggestionIndex:this.state.selectedSuggestionIndex};return n&&o.length>=n||(i={...i,onChange:this.onInputChange}),(0,tt.createElement)(O3,i)}render(){const{disabled:e,label:t=er("Add item"),instanceId:n,className:r,__experimentalShowHowTo:o}=this.props,{isExpanded:a}=this.state,i=so()(r,"components-form-token-field__input-container",{"is-active":this.state.isActive,"is-disabled":e});let s={className:"components-form-token-field",tabIndex:"-1"};const l=this.getMatchingSuggestions();return e||(s=Object.assign({},s,{onKeyDown:this.onKeyDown,onKeyPress:this.onKeyPress,onFocus:this.onFocus})),(0,tt.createElement)("div",s,(0,tt.createElement)("label",{htmlFor:`components-form-token-input-${n}`,className:"components-form-token-field__label"},t),(0,tt.createElement)("div",{ref:this.bindTokensAndInput,className:i,tabIndex:"-1",onMouseDown:this.onContainerTouched,onTouchStart:this.onContainerTouched},this.renderTokensAndInput(),a&&(0,tt.createElement)(D3,{instanceId:n,match:this.props.saveTransform(this.state.incompleteTokenValue),displayTransform:this.props.displayTransform,suggestions:l,selectedIndex:this.state.selectedSuggestionIndex,scrollIntoView:this.state.selectedSuggestionScroll,onHover:this.onSuggestionHovered,onSelect:this.onSuggestionSelected})),o&&(0,tt.createElement)("p",{id:`components-form-token-suggestions-howto-${n}`,className:"components-form-token-field__help"},this.props.tokenizeOnSpace?er("Separate with commas, spaces, or the Enter key."):er("Separate with commas or the Enter key.")))}}I3.defaultProps={suggestions:Object.freeze([]),maxSuggestions:100,value:Object.freeze([]),displayTransform:at.identity,saveTransform:e=>e.trim(),onChange:()=>{},onInputChange:()=>{},isBorderless:!1,disabled:!1,tokenizeOnSpace:!1,messages:{added:er("Item added."),removed:er("Item removed."),remove:er("Remove item"),__experimentalInvalid:er("Invalid item")},__experimentalExpandOnFocus:!1,__experimentalValidateInput:()=>!0,__experimentalShowHowTo:!0};const P3=pq(cS(I3));function R3({label:e,noOptionLabel:t,authorList:n,selectedAuthorId:r,onChange:o}){if(!n)return null;const a=A3(n);return(0,tt.createElement)(C3,{label:e,noOptionLabel:t,onChange:o,tree:a,selectedId:r})}function Y3({authorList:e,selectedAuthorId:t,categoriesList:n,selectedCategoryId:r,categorySuggestions:o,selectedCategories:a,numberOfItems:i,order:s,orderBy:l,maxItems:c=100,minItems:u=1,onCategoryChange:d,onAuthorChange:p,onNumberOfItemsChange:m,onOrderChange:f,onOrderByChange:h}){return[f&&h&&(0,tt.createElement)(KS,{key:"query-controls-order-select",label:er("Order by"),value:`${l}/${s}`,options:[{label:er("Newest to oldest"),value:"date/desc"},{label:er("Oldest to newest"),value:"date/asc"},{label:er("A → Z"),value:"title/asc"},{label:er("Z → A"),value:"title/desc"}],onChange:e=>{const[t,n]=e.split("/");n!==s&&f(n),t!==l&&h(t)}}),n&&d&&(0,tt.createElement)(T3,{key:"query-controls-category-select",categoriesList:n,label:er("Category"),noOptionLabel:er("All"),selectedCategoryId:r,onChange:d}),o&&d&&(0,tt.createElement)(P3,{key:"query-controls-categories-select",label:er("Categories"),value:a&&a.map((e=>({id:e.id,value:e.name||e.value}))),suggestions:Object.keys(o),onChange:d,maxSuggestions:20}),p&&(0,tt.createElement)(R3,{key:"query-controls-author-select",authorList:e,label:er("Author"),noOptionLabel:er("All"),selectedAuthorId:t,onChange:p}),m&&(0,tt.createElement)(rT,{key:"query-controls-range-control",label:er("Number of items"),value:i,onChange:m,min:u,max:c,required:!0})]}const W3=(0,tt.createElement)(mo,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,tt.createElement)(uo,{d:"M4 4v1.5h16V4H4zm8 8.5h8V11h-8v1.5zM4 20h16v-1.5H4V20zm4-8c0-1.1-.9-2-2-2s-2 .9-2 2 .9 2 2 2 2-.9 2-2z"})),H3={per_page:-1,context:"view"},q3={per_page:-1,has_published_posts:["post"],context:"view"};const j3={apiVersion:2,name:"core/latest-posts",title:"Latest Posts",category:"widgets",description:"Display a list of your most recent posts.",keywords:["recent posts"],textdomain:"default",attributes:{categories:{type:"array",items:{type:"object"}},selectedAuthor:{type:"number"},postsToShow:{type:"number",default:5},displayPostContent:{type:"boolean",default:!1},displayPostContentRadio:{type:"string",default:"excerpt"},excerptLength:{type:"number",default:55},displayAuthor:{type:"boolean",default:!1},displayPostDate:{type:"boolean",default:!1},postLayout:{type:"string",default:"list"},columns:{type:"number",default:3},order:{type:"string",default:"desc"},orderBy:{type:"string",default:"date"},displayFeaturedImage:{type:"boolean",default:!1},featuredImageAlign:{type:"string",enum:["left","center","right"]},featuredImageSizeSlug:{type:"string",default:"thumbnail"},featuredImageSizeWidth:{type:"number",default:null},featuredImageSizeHeight:{type:"number",default:null},addLinkToFeaturedImage:{type:"boolean",default:!1}},supports:{align:!0,html:!1},editorStyle:"wp-block-latest-posts-editor",style:"wp-block-latest-posts"},{name:F3}=j3,V3={icon:k3,example:{},edit:function({attributes:e,setAttributes:t}){var n;const{postsToShow:r,order:o,orderBy:a,categories:i,selectedAuthor:s,displayFeaturedImage:l,displayPostContentRadio:c,displayPostContent:u,displayPostDate:d,displayAuthor:p,postLayout:m,columns:f,excerptLength:h,featuredImageAlign:g,featuredImageSizeSlug:b,featuredImageSizeWidth:v,featuredImageSizeHeight:y,addLinkToFeaturedImage:_}=e,{imageSizeOptions:M,latestPosts:k,defaultImageWidth:w,defaultImageHeight:E,categoriesList:L,authorList:A}=Tl((e=>{const{getEntityRecords:t,getMedia:n,getUsers:l}=e(yd),{getSettings:c}=e(nk),{imageSizes:u,imageDimensions:d}=c(),p=i&&i.length>0?i.map((e=>e.id)):[],m=t("postType","post",(0,at.pickBy)({categories:p,author:s,order:o,orderby:a,per_page:r},(e=>!(0,at.isUndefined)(e))));return{defaultImageWidth:(0,at.get)(d,[b,"width"],0),defaultImageHeight:(0,at.get)(d,[b,"height"],0),imageSizeOptions:u.filter((({slug:e})=>"full"!==e)).map((({name:e,slug:t})=>({value:t,label:e}))),latestPosts:Array.isArray(m)?m.map((e=>{if(!e.featured_media)return e;const t=n(e.featured_media);let r=(0,at.get)(t,["media_details","sizes",b,"source_url"],null);r||(r=(0,at.get)(t,"source_url",null));const o={url:r,alt:null==t?void 0:t.alt_text};return{...e,featuredImageInfo:o}})):m,categoriesList:t("taxonomy","category",H3),authorList:l(q3)}}),[b,r,o,a,i,s]),S=null!==(n=null==L?void 0:L.reduce(((e,t)=>({...e,[t.name]:t})),{}))&&void 0!==n?n:{},C=!(null==k||!k.length),T=(0,tt.createElement)(FA,null,(0,tt.createElement)(BA,{title:er("Post content settings")},(0,tt.createElement)(KN,{label:er("Post content"),checked:u,onChange:e=>t({displayPostContent:e})}),u&&(0,tt.createElement)(L3,{label:er("Show:"),selected:c,options:[{label:er("Excerpt"),value:"excerpt"},{label:er("Full post"),value:"full_post"}],onChange:e=>t({displayPostContentRadio:e})}),u&&"excerpt"===c&&(0,tt.createElement)(rT,{label:er("Max number of words in excerpt"),value:h,onChange:e=>t({excerptLength:e}),min:10,max:100})),(0,tt.createElement)(BA,{title:er("Post meta settings")},(0,tt.createElement)(KN,{label:er("Display author name"),checked:p,onChange:e=>t({displayAuthor:e})}),(0,tt.createElement)(KN,{label:er("Display post date"),checked:d,onChange:e=>t({displayPostDate:e})})),(0,tt.createElement)(BA,{title:er("Featured image settings")},(0,tt.createElement)(KN,{label:er("Display featured image"),checked:l,onChange:e=>t({displayFeaturedImage:e})}),l&&(0,tt.createElement)(tt.Fragment,null,(0,tt.createElement)(qH,{onChange:e=>{const n={};e.hasOwnProperty("width")&&(n.featuredImageSizeWidth=e.width),e.hasOwnProperty("height")&&(n.featuredImageSizeHeight=e.height),t(n)},slug:b,width:v,height:y,imageWidth:w,imageHeight:E,imageSizeOptions:M,onChangeImage:e=>t({featuredImageSizeSlug:e,featuredImageSizeWidth:void 0,featuredImageSizeHeight:void 0})}),(0,tt.createElement)(EA,{className:"block-editor-image-alignment-control__row"},(0,tt.createElement)(EA.VisualLabel,null,er("Image alignment")),(0,tt.createElement)(dA,{value:g,onChange:e=>t({featuredImageAlign:e}),controls:["left","center","right"],isCollapsed:!1})),(0,tt.createElement)(KN,{label:er("Add link to featured image"),checked:_,onChange:e=>t({addLinkToFeaturedImage:e})}))),(0,tt.createElement)(BA,{title:er("Sorting and filtering")},(0,tt.createElement)(Y3,{order:o,orderBy:a,numberOfItems:r,onOrderChange:e=>t({order:e}),onOrderByChange:e=>t({orderBy:e}),onNumberOfItemsChange:e=>t({postsToShow:e}),categorySuggestions:S,onCategoryChange:e=>{if(e.some((e=>"string"==typeof e&&!S[e])))return;const n=e.map((e=>"string"==typeof e?S[e]:e));if((0,at.includes)(n,null))return!1;t({categories:n})},selectedCategories:i,onAuthorChange:e=>t({selectedAuthor:""!==e?Number(e):void 0}),authorList:null!=A?A:[],selectedAuthorId:s}),"grid"===m&&(0,tt.createElement)(rT,{label:er("Columns"),value:f,onChange:e=>t({columns:e}),min:2,max:C?Math.min(6,k.length):6,required:!0}))),x=VR({className:so()({"wp-block-latest-posts__list":!0,"is-grid":"grid"===m,"has-dates":d,"has-author":p,[`columns-${f}`]:"grid"===m})});if(!C)return(0,tt.createElement)("div",x,T,(0,tt.createElement)(vH,{icon:TZ,label:er("Latest Posts")},Array.isArray(k)?er("No posts found."):(0,tt.createElement)(cq,null)));const z=k.length>r?k.slice(0,r):k,O=[{icon:W3,title:er("List view"),onClick:()=>t({postLayout:"list"}),isActive:"list"===m},{icon:MH,title:er("Grid view"),onClick:()=>t({postLayout:"grid"}),isActive:"grid"===m}],N=dV().formats.date;return(0,tt.createElement)("div",null,T,(0,tt.createElement)(lk,null,(0,tt.createElement)(tb,{controls:O})),(0,tt.createElement)("ul",x,z.map(((e,t)=>{const n=(0,at.invoke)(e,["title","rendered","trim"]);let r=e.excerpt.rendered;const o=null==A?void 0:A.find((t=>t.id===e.author)),a=document.createElement("div");a.innerHTML=r,r=a.textContent||a.innerText||"";const{featuredImageInfo:{url:i,alt:s}={}}=e,m=so()({"wp-block-latest-posts__featured-image":!0,[`align${g}`]:!!g}),f=l&&i,b=f&&(0,tt.createElement)("img",{src:i,alt:s,style:{maxWidth:v,maxHeight:y}}),M=ht({displayLoginAsForm:!n})}),(0,tt.createElement)(KN,{label:er("Redirect to current URL"),checked:r,onChange:()=>t({redirectToCurrent:!r})}))),(0,tt.createElement)("div",VR({className:"logged-in"}),(0,tt.createElement)("a",{href:"#login-pseudo-link"},er("Log out"))))}},G3=(0,tt.createElement)(mo,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,tt.createElement)(uo,{d:"M4 8.8h8.9V7.2H4v1.6zm0 7h8.9v-1.5H4v1.5zM18 13c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0-3c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2z"})),J3=(0,tt.createElement)(mo,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,tt.createElement)(uo,{d:"M11.1 15.8H20v-1.5h-8.9v1.5zm0-8.6v1.5H20V7.2h-8.9zM6 13c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0-7c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"})),Q3=(0,tt.createElement)(mo,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,tt.createElement)(uo,{d:"M3.8 15.8h8.9v-1.5H3.8v1.5zm0-7h8.9V7.2H3.8v1.6zm14.7-2.1V10h1V5.3l-2.2.7.3 1 .9-.3zm1.2 6.1c-.5-.6-1.2-.5-1.7-.4-.3.1-.5.2-.7.3l.1 1.1c.2-.2.5-.4.8-.5.3-.1.6 0 .7.1.2.3 0 .8-.2 1.1-.5.8-.9 1.6-1.4 2.5H20v-1h-.9c.3-.6.8-1.4.9-2.1 0-.3 0-.8-.3-1.1z"})),Z3=(0,tt.createElement)(mo,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,tt.createElement)(uo,{d:"M11.1 15.8H20v-1.5h-8.9v1.5zm0-8.6v1.5H20V7.2h-8.9zM5 6.7V10h1V5.3L3.8 6l.4 1 .8-.3zm-.4 5.7c-.3.1-.5.2-.7.3l.1 1.1c.2-.2.5-.4.8-.5.3-.1.6 0 .7.1.2.3 0 .8-.2 1.1-.5.8-.9 1.6-1.4 2.5h2.7v-1h-1c.3-.6.8-1.4.9-2.1.1-.3 0-.8-.2-1.1-.5-.6-1.3-.5-1.7-.4z"})),e4=(0,tt.createElement)(mo,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,tt.createElement)(uo,{d:"M20 5.5H4V4H20V5.5ZM12 12.5H4V11H12V12.5ZM20 20V18.5H4V20H20ZM15.4697 14.9697L18.4393 12L15.4697 9.03033L16.5303 7.96967L20.0303 11.4697L20.5607 12L20.0303 12.5303L16.5303 16.0303L15.4697 14.9697Z"})),t4=(0,tt.createElement)(mo,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,tt.createElement)(uo,{d:"M4 7.2v1.5h16V7.2H4zm8 8.6h8v-1.5h-8v1.5zm-4-4.6l-4 4 4 4 1-1-3-3 3-3-1-1z"})),n4=(0,tt.createElement)(mo,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,tt.createElement)(uo,{d:"M20 5.5H4V4H20V5.5ZM12 12.5H4V11H12V12.5ZM20 20V18.5H4V20H20ZM20.0303 9.03033L17.0607 12L20.0303 14.9697L18.9697 16.0303L15.4697 12.5303L14.9393 12L15.4697 11.4697L18.9697 7.96967L20.0303 9.03033Z"})),r4=(0,tt.createElement)(mo,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,tt.createElement)(uo,{d:"M4 7.2v1.5h16V7.2H4zm8 8.6h8v-1.5h-8v1.5zm-8-3.5l3 3-3 3 1 1 4-4-4-4-1 1z"})),o4=({setAttributes:e,reversed:t,start:n})=>(0,tt.createElement)(FA,null,(0,tt.createElement)(BA,{title:er("Ordered list settings")},(0,tt.createElement)(LA,{label:er("Start value"),type:"number",onChange:t=>{const n=parseInt(t,10);e({start:isNaN(n)?void 0:n})},value:Number.isInteger(n)?n.toString(10):"",step:"1"}),(0,tt.createElement)(KN,{label:er("Reverse list numbering"),checked:t||!1,onChange:t=>{e({reversed:t||void 0})}})));function a4({phrasingContentSchema:e}){const t={...e,ul:{},ol:{attributes:["type","start","reversed"]}};return["ul","ol"].forEach((e=>{t[e].children={li:{children:t}}})),t}const i4={from:[{type:"block",isMultiBlock:!0,blocks:["core/paragraph","core/heading"],transform:e=>Ho("core/list",{values:u_({value:Jy(e.map((({content:t})=>{const n=Ny({html:t});return e.length>1?n:n_(n,/\n/g,Ty)})),Ty),multilineTag:"li"}),anchor:e.anchor})},{type:"block",blocks:["core/quote","core/pullquote"],transform:({value:e,anchor:t})=>Ho("core/list",{values:u_({value:Ny({html:e,multilineTag:"p"}),multilineTag:"li"}),anchor:t})},{type:"raw",selector:"ol,ul",schema:e=>({ol:a4(e).ol,ul:a4(e).ul}),transform(e){const t={ordered:"OL"===e.nodeName,anchor:""===e.id?void 0:e.id};if(t.ordered){const n=e.getAttribute("type");n&&(t.type=n),null!==e.getAttribute("reversed")&&(t.reversed=!0);const r=parseInt(e.getAttribute("start"),10);isNaN(r)||1===r&&!t.reversed||(t.start=r)}return Ho("core/list",{...Gi("core/list",e.outerHTML),...t})}},...["*","-"].map((e=>({type:"prefix",prefix:e,transform:e=>Ho("core/list",{values:`${e} `})}))),...["1.","1)"].map((e=>({type:"prefix",prefix:e,transform:e=>Ho("core/list",{ordered:!0,values:`${e} `})})))],to:[{type:"block",blocks:["core/paragraph"],transform:({values:e})=>o_(Ny({html:e,multilineTag:"li",multilineWrapperTags:["ul","ol"]}),Ty).map((e=>Ho("core/paragraph",{content:u_({value:e})})))},{type:"block",blocks:["core/heading"],transform:({values:e})=>o_(Ny({html:e,multilineTag:"li",multilineWrapperTags:["ul","ol"]}),Ty).map((e=>Ho("core/heading",{content:u_({value:e})})))},{type:"block",blocks:["core/quote"],transform:({values:e,anchor:t})=>Ho("core/quote",{value:u_({value:Ny({html:e,multilineTag:"li",multilineWrapperTags:["ul","ol"]}),multilineTag:"p"}),anchor:t})},{type:"block",blocks:["core/pullquote"],transform:({values:e,anchor:t})=>Ho("core/pullquote",{value:u_({value:Ny({html:e,multilineTag:"li",multilineWrapperTags:["ul","ol"]}),multilineTag:"p"}),anchor:t})}]},s4={apiVersion:2,name:"core/list",title:"List",category:"text",description:"Create a bulleted or numbered list.",keywords:["bullet list","ordered list","numbered list"],textdomain:"default",attributes:{ordered:{type:"boolean",default:!1,__experimentalRole:"content"},values:{type:"string",source:"html",selector:"ol,ul",multiline:"li",__unstableMultilineWrapperTags:["ol","ul"],default:"",__experimentalRole:"content"},type:{type:"string"},start:{type:"number"},reversed:{type:"boolean"},placeholder:{type:"string"}},supports:{anchor:!0,className:!1,typography:{fontSize:!0,__experimentalFontFamily:!0},color:{gradients:!0,link:!0},__unstablePasteTextInline:!0,__experimentalSelector:"ol,ul"},editorStyle:"wp-block-list-editor",style:"wp-block-list"},{name:l4}=s4,c4={icon:W3,example:{attributes:{values:"Alice. The White Rabbit. The Cheshire Cat. The Mad Hatter. The Queen of Hearts. "}},transforms:i4,merge(e,t){const{values:n}=t;return n&&" "!==n?{...e,values:e.values+n}:e},edit:function({attributes:e,setAttributes:t,mergeBlocks:n,onReplace:r,style:o}){const{ordered:a,values:i,type:s,reversed:l,start:c,placeholder:u}=e,d=a?"ol":"ul",p=VR({style:o});return(0,tt.createElement)(tt.Fragment,null,(0,tt.createElement)(Cj,ot({identifier:"values",multiline:"li",tagName:d,onChange:e=>t({values:e}),value:i,"aria-label":er("List text"),placeholder:u||er("List"),onMerge:n,onSplit:t=>Ho(l4,{...e,values:t}),__unstableOnSplitMiddle:()=>Ho("core/paragraph"),onReplace:r,onRemove:()=>r([]),start:c,reversed:l,type:s},p),(({value:e,onChange:n,onFocus:r})=>(0,tt.createElement)(tt.Fragment,null,(0,tt.createElement)(Oj,{type:"primary",character:"[",onUse:()=>{n(L_(e))}}),(0,tt.createElement)(Oj,{type:"primary",character:"]",onUse:()=>{n(w_(e,{type:d}))}}),(0,tt.createElement)(Oj,{type:"primary",character:"m",onUse:()=>{n(w_(e,{type:d}))}}),(0,tt.createElement)(Oj,{type:"primaryShift",character:"m",onUse:()=>{n(L_(e))}}),(0,tt.createElement)(lk,{group:"block"},(0,tt.createElement)(jg,{icon:rr()?G3:J3,title:er("Unordered"),describedBy:er("Convert to unordered list"),isActive:Uy(e,"ul",d),onClick:()=>{n(A_(e,{type:"ul"})),r(),Xy(e)&&t({ordered:!1})}}),(0,tt.createElement)(jg,{icon:rr()?Q3:Z3,title:er("Ordered"),describedBy:er("Convert to ordered list"),isActive:Uy(e,"ol",d),onClick:()=>{n(A_(e,{type:"ol"})),r(),Xy(e)&&t({ordered:!0})}}),(0,tt.createElement)(jg,{icon:rr()?e4:t4,title:er("Outdent"),describedBy:er("Outdent list item"),shortcut:tr("Backspace","keyboard key"),isDisabled:!k_(e),onClick:()=>{n(L_(e)),r()}}),(0,tt.createElement)(jg,{icon:rr()?n4:r4,title:er("Indent"),describedBy:er("Indent list item"),shortcut:tr("Space","keyboard key"),isDisabled:!M_(e),onClick:()=>{n(w_(e,{type:d})),r()}}))))),a&&(0,tt.createElement)(o4,{setAttributes:t,ordered:a,reversed:l,start:c,placeholder:u}))},save:function({attributes:e}){const{ordered:t,values:n,type:r,reversed:o,start:a}=e,i=t?"ol":"ul";return(0,tt.createElement)(i,VR.save({type:r,reversed:o,start:a}),(0,tt.createElement)(Cj.Content,{value:n,multiline:"li"}))}};const u4=eP(((e,{clientId:t,attributes:n})=>{const{replaceBlock:r}=e(nk);return{convertToHTML(){r(t,Ho("core/html",{content:n.originalUndelimitedContent}))}}}))((function({attributes:e,convertToHTML:t}){const{originalName:n,originalUndelimitedContent:r}=e,o=!!r,a=Bo("core/html"),i=[];let s;return o&&a?(s=pn(er('Your site doesn’t include support for the "%s" block. You can leave this block intact, convert its content to a Custom HTML block, or remove it entirely.'),n),i.push((0,tt.createElement)(Eh,{key:"convert",onClick:t,variant:"primary"},er("Keep as HTML")))):s=pn(er('Your site doesn’t include support for the "%s" block. You can leave this block intact or remove it entirely.'),n),(0,tt.createElement)("div",VR({className:"has-warning"}),(0,tt.createElement)(cR,{actions:i},s),(0,tt.createElement)(Pa,null,VP(r)))}));const d4={apiVersion:2,name:"core/missing",title:"Unsupported",category:"text",description:"Your site doesn’t include support for this block.",textdomain:"default",attributes:{originalName:{type:"string"},originalUndelimitedContent:{type:"string"},originalContent:{type:"string",source:"html"}},supports:{className:!1,customClassName:!1,inserter:!1,html:!1,reusable:!1}},{name:p4}=d4,m4={name:p4,__experimentalLabel(e,{context:t}){if("accessibility"===t){const{originalName:t}=e,n=t?Bo(t):void 0;return n?n.settings.title||t:""}},edit:u4,save:function({attributes:e}){return(0,tt.createElement)(Pa,null,e.originalContent)}},f4=(0,tt.createElement)(mo,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,tt.createElement)(uo,{d:"M4 9v1.5h16V9H4zm12 5.5h4V13h-4v1.5zm-6 0h4V13h-4v1.5zm-6 0h4V13H4v1.5z"})),h4=er("Read more");const g4={from:[{type:"raw",schema:{"wp-block":{attributes:["data-block"]}},isMatch:e=>e.dataset&&"core/more"===e.dataset.block,transform(e){const{customText:t,noTeaser:n}=e.dataset,r={};return t&&(r.customText=t),""===n&&(r.noTeaser=!0),Ho("core/more",r)}}]},b4={apiVersion:2,name:"core/more",title:"More",category:"design",description:"Content before this block will be shown in the excerpt on your archives page.",keywords:["read more"],textdomain:"default",attributes:{customText:{type:"string"},noTeaser:{type:"boolean",default:!1}},supports:{customClassName:!1,className:!1,html:!1,multiple:!1},editorStyle:"wp-block-more-editor"},{name:v4}=b4,y4={icon:f4,example:{},__experimentalLabel(e,{context:t}){if("accessibility"===t)return e.customText},transforms:g4,edit:function({attributes:{customText:e,noTeaser:t},insertBlocksAfter:n,setAttributes:r}){const o={width:`${(e||h4).length+1.2}em`};return(0,tt.createElement)(tt.Fragment,null,(0,tt.createElement)(FA,null,(0,tt.createElement)(BA,null,(0,tt.createElement)(KN,{label:er("Hide the excerpt on the full content page"),checked:!!t,onChange:()=>r({noTeaser:!t}),help:e=>er(e?"The excerpt is hidden.":"The excerpt is visible.")}))),(0,tt.createElement)("div",VR(),(0,tt.createElement)("div",{className:"wp-block-more"},(0,tt.createElement)("input",{"aria-label":er("Read more link text"),type:"text",value:e,placeholder:h4,onChange:e=>{r({customText:""!==e.target.value?e.target.value:void 0})},onKeyDown:({keyCode:e})=>{e===rm&&n([Ho(Do())])},style:o}))))},save:function({attributes:{customText:e,noTeaser:t}}){const n=e?`\x3c!--more ${e}--\x3e`:"\x3c!--more--\x3e",r=t?"\x3c!--noteaser--\x3e":"";return(0,tt.createElement)(Pa,null,(0,at.compact)([n,r]).join("\n"))}},_4=(0,tt.createElement)(mo,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,tt.createElement)(uo,{d:"M7.8 6c0-.7.6-1.2 1.2-1.2h6c.7 0 1.2.6 1.2 1.2v3h1.5V6c0-1.5-1.2-2.8-2.8-2.8H9C7.5 3.2 6.2 4.5 6.2 6v3h1.5V6zm8.4 11c0 .7-.6 1.2-1.2 1.2H9c-.7 0-1.2-.6-1.2-1.2v-3H6.2v3c0 1.5 1.2 2.8 2.8 2.8h6c1.5 0 2.8-1.2 2.8-2.8v-3h-1.5v3zM4 11v1h16v-1H4z"}));const M4={from:[{type:"raw",schema:{"wp-block":{attributes:["data-block"]}},isMatch:e=>e.dataset&&"core/nextpage"===e.dataset.block,transform:()=>Ho("core/nextpage",{})}]},k4={apiVersion:2,name:"core/nextpage",title:"Page Break",category:"design",description:"Separate your content into a multi-page experience.",keywords:["next page","pagination"],parent:["core/post-content"],textdomain:"default",supports:{customClassName:!1,className:!1,html:!1},editorStyle:"wp-block-nextpage-editor"},{name:w4}=k4,E4={icon:_4,example:{},transforms:M4,edit:function(){return(0,tt.createElement)("div",VR(),(0,tt.createElement)("div",{className:"wp-block-nextpage"},(0,tt.createElement)("span",null,er("Page break"))))},save:function(){return(0,tt.createElement)(Pa,null,"\x3c!--nextpage--\x3e")}},L4=(0,tt.createElement)(mo,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,tt.createElement)(uo,{d:"M7 13.8h6v-1.5H7v1.5zM18 16V4c0-1.1-.9-2-2-2H6c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h10c1.1 0 2-.9 2-2zM5.5 16V4c0-.3.2-.5.5-.5h10c.3 0 .5.2.5.5v12c0 .3-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5zM7 10.5h8V9H7v1.5zm0-3.3h8V5.8H7v1.4zM20.2 6v13c0 .7-.6 1.2-1.2 1.2H8v1.5h11c1.5 0 2.7-1.2 2.7-2.8V6h-1.5z"})),A4=["id","title","link","type","parent"],S4=({pages:e,clientId:t,replaceBlock:n,createBlock:r})=>()=>{if(!e)return;const o={},a=[];e.forEach((({id:e,title:t,link:n,type:i,parent:s})=>{var l,c;const u=null!==(l=null===(c=o[e])||void 0===c?void 0:c.innerBlocks)&&void 0!==l?l:[];if(o[e]=r("core/navigation-link",{id:e,label:t.rendered,url:n,type:i,kind:"post-type"},u),s){o[s]||(o[s]={innerBlocks:[]});o[s].innerBlocks.push(o[e])}else a.push(o[e])})),n(t,a)};function C4({onClose:e,clientId:t}){const{pages:n,pagesFinished:r}=Tl((e=>{const{getEntityRecords:t,hasFinishedResolution:n}=e(yd),r=["postType","page",{per_page:100,_fields:A4,orderby:"menu_order",order:"asc"}];return{pages:t(...r),pagesFinished:n("getEntityRecords",r)}}),[t]),{replaceBlock:o}=ld(nk);return(0,tt.createElement)(sR,{closeLabel:er("Close"),onRequestClose:e,title:er("Convert to links"),className:"wp-block-page-list-modal",aria:{describedby:"wp-block-page-list-modal__description"}},(0,tt.createElement)("p",{id:"wp-block-page-list-modal__description"},er("To edit this navigation menu, convert it to single page links. This allows you to add, re-order, remove items, or edit their labels.")),(0,tt.createElement)("p",null,er("Note: if you add new pages to your site, you'll need to add them to your navigation menu.")),(0,tt.createElement)("div",{className:"wp-block-page-list-modal-buttons"},(0,tt.createElement)(Eh,{variant:"tertiary",onClick:e},er("Cancel")),(0,tt.createElement)(Eh,{variant:"primary",disabled:!r,onClick:S4({pages:n,replaceBlock:o,clientId:t,createBlock:Ho})},er("Convert"))))}const T4={apiVersion:2,name:"core/page-list",title:"Page List",category:"widgets",description:"Display a list of all pages.",keywords:["menu","navigation"],textdomain:"default",attributes:{textColor:{type:"string"},customTextColor:{type:"string"},backgroundColor:{type:"string"},customBackgroundColor:{type:"string"},overlayBackgroundColor:{type:"string"},customOverlayBackgroundColor:{type:"string"},overlayTextColor:{type:"string"},customOverlayTextColor:{type:"string"}},usesContext:["textColor","customTextColor","backgroundColor","customBackgroundColor","overlayTextColor","customOverlayTextColor","overlayBackgroundColor","customOverlayBackgroundColor","fontSize","customFontSize","showSubmenuIcon","style"],supports:{reusable:!1,html:!1},editorStyle:"wp-block-page-list-editor",style:"wp-block-page-list"},{name:x4}=T4,z4={icon:L4,example:{},edit:function({context:e,clientId:t,attributes:n,setAttributes:r}){(0,tt.useEffect)((()=>{const{textColor:t,customTextColor:n,backgroundColor:o,customBackgroundColor:a,overlayTextColor:i,customOverlayTextColor:s,overlayBackgroundColor:l,customOverlayBackgroundColor:c}=e;r({textColor:t,customTextColor:n,backgroundColor:o,customBackgroundColor:a,overlayTextColor:i,customOverlayTextColor:s,overlayBackgroundColor:l,customOverlayBackgroundColor:c})}),[e.textColor,e.customTextColor,e.backgroundColor,e.customBackgroundColor,e.overlayTextColor,e.customOverlayTextColor,e.overlayBackgroundColor,e.customOverlayBackgroundColor]);const{textColor:o,backgroundColor:a,showSubmenuIcon:i,style:s}=e||{},[l,c]=(0,tt.useState)(!1),u=VR({className:so()({"has-text-color":!!o,[mC("color",o)]:!!o,"has-background":!!a,[mC("background-color",a)]:!!a,"show-submenu-icons":!!i}),style:{...null==s?void 0:s.color}}),d=Tl((e=>{const{getBlockParentsByBlockName:n}=e(nk);return n(t,"core/navigation").length>0}),[t]);(0,tt.useEffect)((()=>{d?ec({path:Pl("/wp/v2/pages",{per_page:1,_fields:["id"]}),parse:!1}).then((e=>{c(e.headers.get("X-WP-Total")<=100)})):c(!1)}),[d]);const[p,m]=(0,tt.useState)(!1);return(0,tt.createElement)(tt.Fragment,null,l&&(0,tt.createElement)(lk,{group:"other"},(0,tt.createElement)(jg,{title:er("Edit"),onClick:()=>m(!0)},er("Edit"))),l&&p&&(0,tt.createElement)(C4,{onClose:()=>m(!1),clientId:t}),(0,tt.createElement)("div",u,(0,tt.createElement)(YQ,{block:"core/page-list",attributes:n})))}},O4=(0,tt.createElement)(mo,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,tt.createElement)(uo,{d:"M18 4H6c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm.5 14c0 .3-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h12c.3 0 .5.2.5.5v12zM7 16.5h6V15H7v1.5zm4-4h6V11h-6v1.5zM9 11H7v1.5h2V11zm6 5.5h2V15h-2v1.5z"}));const N4={from:[{type:"block",blocks:["core/code","core/paragraph"],transform:({content:e,anchor:t})=>Ho("core/preformatted",{content:e,anchor:t})},{type:"raw",isMatch:e=>"PRE"===e.nodeName&&!(1===e.children.length&&"CODE"===e.firstChild.nodeName),schema:({phrasingContentSchema:e})=>({pre:{children:e}})}],to:[{type:"block",blocks:["core/paragraph"],transform:e=>Ho("core/paragraph",e)},{type:"block",blocks:["core/code"],transform:e=>Ho("core/code",e)}]},D4={apiVersion:2,name:"core/preformatted",title:"Preformatted",category:"text",description:"Add text that respects your spacing and tabs, and also allows styling.",textdomain:"default",attributes:{content:{type:"string",source:"html",selector:"pre",default:"",__unstablePreserveWhiteSpace:!0,__experimentalRole:"content"}},supports:{anchor:!0,color:{gradients:!0},typography:{fontSize:!0}},style:"wp-block-preformatted"},{name:B4}=D4,I4={icon:O4,example:{attributes:{content:er("EXT. XANADU - FAINT DAWN - 1940 (MINIATURE)\nWindow, very small in the distance, illuminated.\nAll around this is an almost totally black screen. Now, as the camera moves slowly towards the window which is almost a postage stamp in the frame, other forms appear;")}},transforms:N4,edit:function({attributes:e,mergeBlocks:t,setAttributes:n,onRemove:r}){const{content:o}=e,a=VR();return(0,tt.createElement)(Cj,ot({tagName:"pre",identifier:"content",preserveWhiteSpace:!0,value:o,onChange:e=>{n({content:e})},onRemove:r,"aria-label":er("Preformatted text"),placeholder:er("Write preformatted text…"),onMerge:t},a,{__unstablePastePlainText:!0}))},save:function({attributes:e}){const{content:t}=e;return(0,tt.createElement)("pre",VR.save(),(0,tt.createElement)(Cj.Content,{value:t}))},merge:(e,t)=>({content:e.content+t.content})},P4=(0,tt.createElement)(mo,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,tt.createElement)(uo,{d:"M18 8H6c-1.1 0-2 .9-2 2v4c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2v-4c0-1.1-.9-2-2-2zm.5 6c0 .3-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5v-4c0-.3.2-.5.5-.5h12c.3 0 .5.2.5.5v4zM4 4v1.5h16V4H4zm0 16h16v-1.5H4V20z"})),R4="is-style-solid-color",Y4={value:{type:"string",source:"html",selector:"blockquote",multiline:"p"},citation:{type:"string",source:"html",selector:"cite",default:""},mainColor:{type:"string"},customMainColor:{type:"string"},textColor:{type:"string"},customTextColor:{type:"string"}};function W4(e){if(!e)return;const t=e.match(/border-color:([^;]+)[;]?/);return t&&t[1]?t[1]:void 0}const H4=[{attributes:{...Y4},save({attributes:e}){const{mainColor:t,customMainColor:n,customTextColor:r,textColor:o,value:a,citation:i,className:s}=e;let l,c;if((0,at.includes)(s,R4)){const e=mC("background-color",t);l=so()({"has-background":e||n,[e]:e}),c={backgroundColor:e?void 0:n}}else n&&(c={borderColor:n});const u=mC("color",o),d=so()({"has-text-color":o||r,[u]:u}),p=u?void 0:{color:r};return(0,tt.createElement)("figure",VR.save({className:l,style:c}),(0,tt.createElement)("blockquote",{className:d,style:p},(0,tt.createElement)(Cj.Content,{value:a,multiline:!0}),!Cj.isEmpty(i)&&(0,tt.createElement)(Cj.Content,{tagName:"cite",value:i})))},migrate({className:e,mainColor:t,customMainColor:n,customTextColor:r,...o}){const a=(0,at.includes)(e,R4);let i;return n&&(i=a?{color:{background:n}}:{border:{color:n}}),r&&i&&(i.color={...i.color,text:r}),{className:e,backgroundColor:a?t:void 0,borderColor:a?void 0:t,textAlign:a?"left":void 0,style:i,...o}}},{attributes:{...Y4,figureStyle:{source:"attribute",selector:"figure",attribute:"style"}},save({attributes:e}){const{mainColor:t,customMainColor:n,textColor:r,customTextColor:o,value:a,citation:i,className:s,figureStyle:l}=e;let c,u;if((0,at.includes)(s,R4)){const e=mC("background-color",t);c=so()({"has-background":e||n,[e]:e}),u={backgroundColor:e?void 0:n}}else if(n)u={borderColor:n};else if(t){u={borderColor:W4(l)}}const d=mC("color",r),p=(r||o)&&so()("has-text-color",{[d]:d}),m=d?void 0:{color:o};return(0,tt.createElement)("figure",{className:c,style:u},(0,tt.createElement)("blockquote",{className:p,style:m},(0,tt.createElement)(Cj.Content,{value:a,multiline:!0}),!Cj.isEmpty(i)&&(0,tt.createElement)(Cj.Content,{tagName:"cite",value:i})))},migrate({className:e,figureStyle:t,mainColor:n,customMainColor:r,customTextColor:o,...a}){const i=(0,at.includes)(e,R4);let s;if(r&&(s=i?{color:{background:r}}:{border:{color:r}}),o&&s&&(s.color={...s.color,text:o}),!i&&n&&t){const n=W4(t);if(n)return{...a,className:e,style:{border:{color:n}}}}return{className:e,backgroundColor:i?n:void 0,borderColor:i?void 0:n,textAlign:i?"left":void 0,style:s,...a}}},{attributes:Y4,save({attributes:e}){const{mainColor:t,customMainColor:n,textColor:r,customTextColor:o,value:a,citation:i,className:s}=e;let l,c;if((0,at.includes)(s,R4))l=mC("background-color",t),l||(c={backgroundColor:n});else if(n)c={borderColor:n};else if(t){const e=(0,at.get)(tn(nk).getSettings(),["colors"],[]);c={borderColor:dC(e,t).color}}const u=mC("color",r),d=r||o?so()("has-text-color",{[u]:u}):void 0,p=u?void 0:{color:o};return(0,tt.createElement)("figure",{className:l,style:c},(0,tt.createElement)("blockquote",{className:d,style:p},(0,tt.createElement)(Cj.Content,{value:a,multiline:!0}),!Cj.isEmpty(i)&&(0,tt.createElement)(Cj.Content,{tagName:"cite",value:i})))},migrate({className:e,mainColor:t,customMainColor:n,customTextColor:r,...o}){const a=(0,at.includes)(e,R4);let i={};return n&&(i=a?{color:{background:n}}:{border:{color:n}}),r&&i&&(i.color={...i.color,text:r}),{className:e,backgroundColor:a?t:void 0,borderColor:a?void 0:t,textAlign:a?"left":void 0,style:i,...o}}},{attributes:{...Y4},save({attributes:e}){const{value:t,citation:n}=e;return(0,tt.createElement)("blockquote",null,(0,tt.createElement)(Cj.Content,{value:t,multiline:!0}),!Cj.isEmpty(n)&&(0,tt.createElement)(Cj.Content,{tagName:"cite",value:n}))}},{attributes:{...Y4,citation:{type:"string",source:"html",selector:"footer"},align:{type:"string",default:"none"}},save({attributes:e}){const{value:t,citation:n,align:r}=e;return(0,tt.createElement)("blockquote",{className:`align${r}`},(0,tt.createElement)(Cj.Content,{value:t,multiline:!0}),!Cj.isEmpty(n)&&(0,tt.createElement)(Cj.Content,{tagName:"footer",value:n}))}}];const q4=function({attributes:e,setAttributes:t,isSelected:n,insertBlocksAfter:r}){const{textAlign:o,citation:a,value:i}=e,s=VR({className:so()({[`has-text-align-${o}`]:o})}),l=!Cj.isEmpty(a)||n;return(0,tt.createElement)(tt.Fragment,null,(0,tt.createElement)(lk,{group:"block"},(0,tt.createElement)(gD,{value:o,onChange:e=>{t({textAlign:e})}})),(0,tt.createElement)("figure",s,(0,tt.createElement)("blockquote",null,(0,tt.createElement)(Cj,{identifier:"value",multiline:!0,value:i,onChange:e=>t({value:e}),"aria-label":er("Pullquote text"),placeholder:er("Add quote"),textAlign:"center"}),l&&(0,tt.createElement)(Cj,{identifier:"citation",value:a,"aria-label":er("Pullquote citation text"),placeholder:er("Add citation"),onChange:e=>t({citation:e}),className:"wp-block-pullquote__citation",__unstableMobileNoFocusOnMount:!0,textAlign:"center",__unstableOnSplitAtEnd:()=>r(Ho("core/paragraph"))}))))};const j4={from:[{type:"block",isMultiBlock:!0,blocks:["core/paragraph"],transform:e=>Ho("core/pullquote",{value:u_({value:Jy(e.map((({content:e})=>Ny({html:e}))),"\u2028"),multilineTag:"p"}),anchor:e.anchor})},{type:"block",blocks:["core/heading"],transform:({content:e,anchor:t})=>Ho("core/pullquote",{value:`${e}
`,anchor:t})}],to:[{type:"block",blocks:["core/paragraph"],transform:({value:e,citation:t})=>{const n=[];return e&&"
"!==e&&n.push(...o_(Ny({html:e,multilineTag:"p"}),"\u2028").map((e=>Ho("core/paragraph",{content:u_({value:e})})))),t&&"
"!==t&&n.push(Ho("core/paragraph",{content:t})),0===n.length?Ho("core/paragraph",{content:""}):n}},{type:"block",blocks:["core/heading"],transform:({value:e,citation:t,...n})=>{if("
"===e)return Ho("core/heading",{content:t});const r=o_(Ny({html:e,multilineTag:"p"}),"\u2028"),o=Ho("core/heading",{content:u_({value:r[0]})});if(!t&&1===r.length)return o;return[o,Ho("core/pullquote",{...n,citation:t,value:u_({value:r.slice(1).length?Jy(r.slice(1),"\u2028"):Ny(),multilineTag:"p"})})]}}]},F4={apiVersion:2,name:"core/pullquote",title:"Pullquote",category:"text",description:"Give special visual emphasis to a quote from your text.",textdomain:"default",attributes:{value:{type:"string",source:"html",selector:"blockquote",multiline:"p",__experimentalRole:"content"},citation:{type:"string",source:"html",selector:"cite",default:"",__experimentalRole:"content"},textAlign:{type:"string"}},supports:{anchor:!0,align:["left","right","wide","full"],color:{gradients:!0,background:!0,link:!0},__experimentalBorder:{color:!0,radius:!0,style:!0,width:!0}},editorStyle:"wp-block-pullquote-editor",style:"wp-block-pullquote"},{name:V4}=F4,X4={icon:P4,example:{attributes:{value:""+er("One of the hardest things to do in technology is disrupt yourself.")+"
",citation:er("Matt Mullenweg")}},transforms:j4,edit:q4,save:function({attributes:e}){const{textAlign:t,citation:n,value:r}=e,o=!Cj.isEmpty(n);return(0,tt.createElement)("figure",VR.save({className:so()({[`has-text-align-${t}`]:t})}),(0,tt.createElement)("blockquote",null,(0,tt.createElement)(Cj.Content,{value:r,multiline:!0}),o&&(0,tt.createElement)(Cj.Content,{tagName:"cite",value:n})))},deprecated:H4};function*U4(e){yield function(e){return{type:"CONVERT_BLOCK_TO_STATIC",clientId:e}}(e)}function*$4(e,t){yield function(e,t){return{type:"CONVERT_BLOCKS_TO_REUSABLE",clientIds:e,title:t}}(e,t)}function*K4(e){yield function(e){return{type:"DELETE_REUSABLE_BLOCK",id:e}}(e)}function G4(e,t){return{type:"SET_EDITING_REUSABLE_BLOCK",clientId:e,isEditing:t}}function J4(e,t){return e.isEditingReusableBlock[t]}const Q4=Jt("core/reusable-blocks",{actions:re,controls:{CONVERT_BLOCK_TO_STATIC:St((e=>({clientId:t})=>{const n=e.select(nk).getBlock(t),r=e.select("core").getEditedEntityRecord("postType","wp_block",n.attributes.ref),o=ns((0,at.isFunction)(r.content)?r.content(r):r.content);e.dispatch(nk).replaceBlocks(n.clientId,o)})),CONVERT_BLOCKS_TO_REUSABLE:St((e=>async function({clientIds:t,title:n}){const r={title:n||er("Untitled Reusable block"),content:gi(e.select(nk).getBlocksByClientId(t)),status:"publish"},o=Ho("core/block",{ref:(await e.dispatch("core").saveEntityRecord("postType","wp_block",r)).id});e.dispatch(nk).replaceBlocks(t,o),e.dispatch(Q4).__experimentalSetEditingReusableBlock(o.clientId,!0)})),DELETE_REUSABLE_BLOCK:St((e=>async function({id:t}){if(!e.select("core").getEditedEntityRecord("postType","wp_block",t))return;const n=e.select(nk).getBlocks().filter((e=>Yo(e)&&e.attributes.ref===t)).map((e=>e.clientId));n.length&&e.dispatch(nk).removeBlocks(n),await e.dispatch("core").deleteEntityRecord("postType","wp_block",t)}))},reducer:st()({isEditingReusableBlock:function(e={},t){return"SET_EDITING_REUSABLE_BLOCK"===(null==t?void 0:t.type)?{...e,[t.clientId]:t.isEditing}:e}}),selectors:oe});an(Q4);const Z4=(0,tt.createElement)(mo,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,tt.createElement)(uo,{d:"M18 4h-7c-1.1 0-2 .9-2 2v7c0 1.1.9 2 2 2h7c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm.5 9c0 .3-.2.5-.5.5h-7c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h7c.3 0 .5.2.5.5v7zm-5 5c0 .3-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5v-7c0-.3.2-.5.5-.5h1V9H6c-1.1 0-2 .9-2 2v7c0 1.1.9 2 2 2h7c1.1 0 2-.9 2-2v-1h-1.5v1z"}));const e5={apiVersion:2,name:"core/block",title:"Reusable block",category:"reusable",description:"Create and save content to reuse across your site. Update the block, and the changes apply everywhere it’s used.",textdomain:"default",attributes:{ref:{type:"number"}},supports:{customClassName:!1,html:!1,inserter:!1},editorStyle:"wp-block-editor"},{name:t5}=e5,n5={edit:function({attributes:{ref:e},clientId:t}){const[n,r]=DF(e),{isMissing:o,hasResolved:a}=Tl((t=>{const n=t(yd).getEntityRecord("postType","wp_block",e),r=t(yd).hasFinishedResolution("getEntityRecord",["postType","wp_block",e]);return{hasResolved:r,isMissing:r&&!n}}),[e,t]),{__experimentalConvertBlockToStatic:i}=ld(Q4),[s,l,c]=fd("postType","wp_block",{id:e}),[u,d]=md("postType","wp_block","title",e),p=VR(),m=GH({},{value:s,onInput:l,onChange:c,renderAppender:null!=s&&s.length?void 0:JH.ButtonBlockAppender});return n?(0,tt.createElement)("div",p,(0,tt.createElement)(cR,null,er("Block cannot be rendered inside itself."))):o?(0,tt.createElement)("div",p,(0,tt.createElement)(cR,null,er("Block has been deleted or is unavailable."))):a?(0,tt.createElement)(r,null,(0,tt.createElement)("div",p,(0,tt.createElement)(lk,null,(0,tt.createElement)(tb,null,(0,tt.createElement)(jg,{onClick:()=>i(t),label:er("Convert to regular blocks"),icon:Z4,showTooltip:!0}))),(0,tt.createElement)(FA,null,(0,tt.createElement)(BA,null,(0,tt.createElement)(LA,{label:er("Name"),value:u,onChange:d}))),(0,tt.createElement)(bB,{clientId:t,wrapperProps:m,className:"block-library-block__reusable-block-container"}))):(0,tt.createElement)("div",p,(0,tt.createElement)(vH,null,(0,tt.createElement)(cq,null)))}},r5=(0,tt.createElement)(mo,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,tt.createElement)(uo,{d:"M5 10.2h-.8v1.5H5c1.9 0 3.8.8 5.1 2.1 1.4 1.4 2.1 3.2 2.1 5.1v.8h1.5V19c0-2.3-.9-4.5-2.6-6.2-1.6-1.6-3.8-2.6-6.1-2.6zm10.4-1.6C12.6 5.8 8.9 4.2 5 4.2h-.8v1.5H5c3.5 0 6.9 1.4 9.4 3.9s3.9 5.8 3.9 9.4v.8h1.5V19c0-3.9-1.6-7.6-4.4-10.4zM4 20h3v-3H4v3z"}));const o5={apiVersion:2,name:"core/rss",title:"RSS",category:"widgets",description:"Display entries from any RSS or Atom feed.",keywords:["atom","feed"],textdomain:"default",attributes:{columns:{type:"number",default:2},blockLayout:{type:"string",default:"list"},feedURL:{type:"string",default:""},itemsToShow:{type:"number",default:5},displayExcerpt:{type:"boolean",default:!1},displayAuthor:{type:"boolean",default:!1},displayDate:{type:"boolean",default:!1},excerptLength:{type:"number",default:55}},supports:{align:!0,html:!1},editorStyle:"wp-block-rss-editor",style:"wp-block-rss"},{name:a5}=o5,i5={icon:r5,example:{attributes:{feedURL:"https://wordpress.org"}},edit:function({attributes:e,setAttributes:t}){const[n,r]=(0,tt.useState)(!e.feedURL),{blockLayout:o,columns:a,displayAuthor:i,displayDate:s,displayExcerpt:l,excerptLength:c,feedURL:u,itemsToShow:d}=e;function p(n){return()=>{const r=e[n];t({[n]:!r})}}const m=VR();if(n)return(0,tt.createElement)("div",m,(0,tt.createElement)(vH,{icon:r5,label:"RSS"},(0,tt.createElement)("form",{onSubmit:function(e){e.preventDefault(),u&&r(!1)},className:"wp-block-rss__placeholder-form"},(0,tt.createElement)(LA,{placeholder:er("Enter URL here…"),value:u,onChange:e=>t({feedURL:e}),className:"wp-block-rss__placeholder-input"}),(0,tt.createElement)(Eh,{variant:"primary",type:"submit"},er("Use URL")))));const f=[{icon:Zq,title:er("Edit RSS URL"),onClick:()=>r(!0)},{icon:W3,title:er("List view"),onClick:()=>t({blockLayout:"list"}),isActive:"list"===o},{icon:MH,title:er("Grid view"),onClick:()=>t({blockLayout:"grid"}),isActive:"grid"===o}];return(0,tt.createElement)(tt.Fragment,null,(0,tt.createElement)(lk,null,(0,tt.createElement)(tb,{controls:f})),(0,tt.createElement)(FA,null,(0,tt.createElement)(BA,{title:er("RSS settings")},(0,tt.createElement)(rT,{label:er("Number of items"),value:d,onChange:e=>t({itemsToShow:e}),min:1,max:10,required:!0}),(0,tt.createElement)(KN,{label:er("Display author"),checked:i,onChange:p("displayAuthor")}),(0,tt.createElement)(KN,{label:er("Display date"),checked:s,onChange:p("displayDate")}),(0,tt.createElement)(KN,{label:er("Display excerpt"),checked:l,onChange:p("displayExcerpt")}),l&&(0,tt.createElement)(rT,{label:er("Max number of words in excerpt"),value:c,onChange:e=>t({excerptLength:e}),min:10,max:100,required:!0}),"grid"===o&&(0,tt.createElement)(rT,{label:er("Columns"),value:a,onChange:e=>t({columns:e}),min:2,max:6,required:!0}))),(0,tt.createElement)("div",m,(0,tt.createElement)(jP,null,(0,tt.createElement)(YQ,{block:"core/rss",attributes:e}))))}},s5=(0,tt.createElement)(mo,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,tt.createElement)(po,{x:"7",y:"10",width:"10",height:"4",rx:"1",fill:"currentColor"})),l5=(0,tt.createElement)(mo,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,tt.createElement)(po,{x:"4.75",y:"15.25",width:"6.5",height:"9.5",transform:"rotate(-90 4.75 15.25)",stroke:"currentColor",strokeWidth:"1.5",fill:"none"}),(0,tt.createElement)(po,{x:"16",y:"10",width:"4",height:"4",rx:"1",fill:"currentColor"})),c5=(0,tt.createElement)(mo,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,tt.createElement)(po,{x:"4.75",y:"15.25",width:"6.5",height:"14.5",transform:"rotate(-90 4.75 15.25)",stroke:"currentColor",strokeWidth:"1.5",fill:"none"}),(0,tt.createElement)(po,{x:"14",y:"10",width:"4",height:"4",rx:"1",fill:"currentColor"})),u5=(0,tt.createElement)(mo,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,tt.createElement)(po,{x:"4.75",y:"15.25",width:"6.5",height:"14.5",transform:"rotate(-90 4.75 15.25)",stroke:"currentColor",fill:"none",strokeWidth:"1.5"})),d5=(0,tt.createElement)(mo,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,tt.createElement)(po,{x:"4.75",y:"7.75",width:"14.5",height:"8.5",rx:"1.25",stroke:"currentColor",fill:"none",strokeWidth:"1.5"}),(0,tt.createElement)(po,{x:"8",y:"11",width:"8",height:"2",fill:"currentColor"})),p5=(0,tt.createElement)(mo,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,tt.createElement)(po,{x:"4.75",y:"17.25",width:"5.5",height:"14.5",transform:"rotate(-90 4.75 17.25)",stroke:"currentColor",fill:"none",strokeWidth:"1.5"}),(0,tt.createElement)(po,{x:"4",y:"7",width:"10",height:"2",fill:"currentColor"}));const m5=[{name:"default",isDefault:!0,attributes:{buttonText:er("Search"),label:er("Search")}}],f5={apiVersion:2,name:"core/search",title:"Search",category:"widgets",description:"Help visitors find your content.",keywords:["find"],textdomain:"default",attributes:{label:{type:"string",__experimentalRole:"content"},showLabel:{type:"boolean",default:!0},placeholder:{type:"string",default:"",__experimentalRole:"content"},width:{type:"number"},widthUnit:{type:"string"},buttonText:{type:"string",__experimentalRole:"content"},buttonPosition:{type:"string",default:"button-outside"},buttonUseIcon:{type:"boolean",default:!1}},supports:{align:["left","center","right"],color:{gradients:!0,__experimentalSkipSerialization:!0},__experimentalBorder:{color:!0,radius:!0,__experimentalSkipSerialization:!0},html:!1},editorStyle:"wp-block-search-editor",style:"wp-block-search"},{name:h5}=f5,g5={icon:bP,example:{},variations:m5,edit:function({className:e,attributes:t,setAttributes:n,toggleSelection:r,isSelected:o}){var a,i;const{label:s,showLabel:l,placeholder:c,width:u,widthUnit:d,align:p,buttonText:m,buttonPosition:f,buttonUseIcon:h,style:g}=t,b=null==g||null===(a=g.border)||void 0===a?void 0:a.radius,v=null==g||null===(i=g.border)||void 0===i?void 0:i.color,y=rD(t);"number"==typeof b&&(y.style.borderRadius=`${b}px`);const _=iD(t),M=`wp-block-search__width-${Qk(Bj)}`,k="button-inside"===f,w="button-outside"===f,E="no-button"===f,L="button-only"===f,A=Lk({availableUnits:["%","px"],defaultValues:{"%":50,px:350}}),S=[{role:"menuitemradio",title:er("Button outside"),isActive:"button-outside"===f,icon:l5,onClick:()=>{n({buttonPosition:"button-outside"})}},{role:"menuitemradio",title:er("Button inside"),isActive:"button-inside"===f,icon:c5,onClick:()=>{n({buttonPosition:"button-inside"})}},{role:"menuitemradio",title:er("No button"),isActive:"no-button"===f,icon:u5,onClick:()=>{n({buttonPosition:"no-button"})}}],C=()=>{const e=so()("wp-block-search__input",k?void 0:y.className),t=k?{borderRadius:b}:y.style;return(0,tt.createElement)("input",{className:e,style:t,"aria-label":er("Optional placeholder text"),placeholder:c?void 0:er("Optional placeholder…"),value:c,onChange:e=>n({placeholder:e.target.value})})},T=()=>{const e=so()("wp-block-search__button",_.className,k?void 0:y.className),t={..._.style,...k?{borderRadius:b}:y.style};return(0,tt.createElement)(tt.Fragment,null,h&&(0,tt.createElement)(Eh,{icon:bP,className:e,style:t}),!h&&(0,tt.createElement)(Cj,{className:e,style:t,"aria-label":er("Button text"),placeholder:er("Add button text…"),withoutInteractiveFormatting:!0,value:m,onChange:e=>n({buttonText:e})}))},x=(0,tt.createElement)(tt.Fragment,null,(0,tt.createElement)(lk,null,(0,tt.createElement)(tb,null,(0,tt.createElement)(jg,{title:er("Toggle search label"),icon:p5,onClick:()=>{n({showLabel:!l})},className:l?"is-pressed":void 0}),(0,tt.createElement)(ck,{icon:(()=>{switch(f){case"button-inside":return c5;case"button-outside":return l5;case"no-button":return u5;case"button-only":return s5}})(),label:er("Change button position"),controls:S}),!E&&(0,tt.createElement)(jg,{title:er("Use button with icon"),icon:d5,onClick:()=>{n({buttonUseIcon:!h})},className:h?"is-pressed":void 0}))),(0,tt.createElement)(FA,null,(0,tt.createElement)(BA,{title:er("Display Settings")},(0,tt.createElement)(EA,{label:er("Width"),id:M},(0,tt.createElement)(Bj,{id:M,min:"220px",onChange:e=>{const t="%"===d&&parseInt(e,10)>100?100:e;n({width:parseInt(t,10)})},onUnitChange:e=>{n({width:"%"===e?50:350,widthUnit:e})},style:{maxWidth:80},value:`${u}${d}`,unit:d,units:A}),(0,tt.createElement)(GA,{className:"wp-block-search__components-button-group","aria-label":er("Percentage Width")},[25,50,75,100].map((e=>(0,tt.createElement)(Eh,{key:e,isSmall:!0,variant:`${e}%`==`${u}${d}`?0:void 0,onClick:()=>n({width:e,widthUnit:"%"})},e,"%")))))))),z=e=>e?`calc(${e} + 4px)`:void 0,O=VR({className:so()(e,k?void 0:y.className,k?"wp-block-search__button-inside":void 0,w?"wp-block-search__button-outside":void 0,E?"wp-block-search__no-button":void 0,L?"wp-block-search__button-only":void 0,h||E?void 0:"wp-block-search__text-button",h&&!E?"wp-block-search__icon-button":void 0)});return(0,tt.createElement)("div",O,x,l&&(0,tt.createElement)(Cj,{className:"wp-block-search__label","aria-label":er("Label text"),placeholder:er("Add label…"),withoutInteractiveFormatting:!0,value:s,onChange:e=>n({label:e})}),(0,tt.createElement)(LG,{size:{width:`${u}${d}`},className:so()("wp-block-search__inside-wrapper",k?y.className:void 0),style:(()=>{const e={borderColor:v},t=0!==parseInt(b,10);if(k&&t){if("object"==typeof b){const{topLeft:t,topRight:n,bottomLeft:r,bottomRight:o}=b;return{borderTopLeftRadius:z(t),borderTopRightRadius:z(n),borderBottomLeftRadius:z(r),borderBottomRightRadius:z(o),...e}}const t=Number.isInteger(b)?`${b}px`:b;e.borderRadius=`calc(${t} + 4px)`}return e})(),minWidth:220,enable:L?{}:{right:"right"!==p,left:"right"===p},onResizeStart:(e,t,o)=>{n({width:parseInt(o.offsetWidth,10),widthUnit:"px"}),r(!1)},onResizeStop:(e,t,o,a)=>{n({width:parseInt(u+a.width,10)}),r(!0)},showHandle:o},(k||w)&&(0,tt.createElement)(tt.Fragment,null,C(),T()),L&&T(),E&&C()))}},b5=(0,tt.createElement)(mo,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,tt.createElement)(uo,{d:"M18 4h-7c-1.1 0-2 .9-2 2v3H6c-1.1 0-2 .9-2 2v7c0 1.1.9 2 2 2h7c1.1 0 2-.9 2-2v-3h3c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm-4.5 14c0 .3-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5v-7c0-.3.2-.5.5-.5h3V13c0 1.1.9 2 2 2h2.5v3zm0-4.5H11c-.3 0-.5-.2-.5-.5v-2.5H13c.3 0 .5.2.5.5v2.5zm5-.5c0 .3-.2.5-.5.5h-3V11c0-1.1-.9-2-2-2h-2.5V6c0-.3.2-.5.5-.5h7c.3 0 .5.2.5.5v7z"})),v5=e=>{if(e.tagName||(e={...e,tagName:"div"}),!e.customTextColor&&!e.customBackgroundColor)return e;const t={color:{}};return e.customTextColor&&(t.color.text=e.customTextColor),e.customBackgroundColor&&(t.color.background=e.customBackgroundColor),{...(0,at.omit)(e,["customTextColor","customBackgroundColor"]),style:t}},y5=[{attributes:{tagName:{type:"string",default:"div"},templateLock:{type:"string"}},supports:{align:["wide","full"],anchor:!0,color:{gradients:!0,link:!0},spacing:{padding:!0},__experimentalBorder:{radius:!0}},save({attributes:e}){const{tagName:t}=e;return(0,tt.createElement)(t,VR.save(),(0,tt.createElement)("div",{className:"wp-block-group__inner-container"},(0,tt.createElement)(JH.Content,null)))}},{attributes:{backgroundColor:{type:"string"},customBackgroundColor:{type:"string"},textColor:{type:"string"},customTextColor:{type:"string"}},supports:{align:["wide","full"],anchor:!0,html:!1},migrate:v5,save({attributes:e}){const{backgroundColor:t,customBackgroundColor:n,textColor:r,customTextColor:o}=e,a=mC("background-color",t),i=mC("color",r),s=so()(a,i,{"has-text-color":r||o,"has-background":t||n}),l={backgroundColor:a?void 0:n,color:i?void 0:o};return(0,tt.createElement)("div",{className:s,style:l},(0,tt.createElement)("div",{className:"wp-block-group__inner-container"},(0,tt.createElement)(JH.Content,null)))}},{attributes:{backgroundColor:{type:"string"},customBackgroundColor:{type:"string"},textColor:{type:"string"},customTextColor:{type:"string"}},migrate:v5,supports:{align:["wide","full"],anchor:!0,html:!1},save({attributes:e}){const{backgroundColor:t,customBackgroundColor:n,textColor:r,customTextColor:o}=e,a=mC("background-color",t),i=mC("color",r),s=so()(a,{"has-text-color":r||o,"has-background":t||n}),l={backgroundColor:a?void 0:n,color:i?void 0:o};return(0,tt.createElement)("div",{className:s,style:l},(0,tt.createElement)("div",{className:"wp-block-group__inner-container"},(0,tt.createElement)(JH.Content,null)))}},{attributes:{backgroundColor:{type:"string"},customBackgroundColor:{type:"string"}},supports:{align:["wide","full"],anchor:!0,html:!1},migrate:v5,save({attributes:e}){const{backgroundColor:t,customBackgroundColor:n}=e,r=mC("background-color",t),o=so()(r,{"has-background":t||n}),a={backgroundColor:r?void 0:n};return(0,tt.createElement)("div",{className:o,style:a},(0,tt.createElement)(JH.Content,null))}}];const _5=function({attributes:e,setAttributes:t,clientId:n}){const{hasInnerBlocks:r,themeSupportsLayout:o}=Tl((e=>{var t;const{getBlock:r,getSettings:o}=e(nk),a=r(n);return{hasInnerBlocks:!(!a||!a.innerBlocks.length),themeSupportsLayout:null===(t=o())||void 0===t?void 0:t.supportsLayout}}),[n]),a=JL("layout")||{},{tagName:i="div",templateLock:s,layout:l={}}=e,c=l&&l.inherit?a:l,u=VR(),d=GH(o?u:{className:"wp-block-group__inner-container"},{templateLock:s,renderAppender:r?void 0:JH.ButtonBlockAppender,__experimentalLayout:o?c:void 0});return(0,tt.createElement)(tt.Fragment,null,(0,tt.createElement)(WA,null,(0,tt.createElement)(KS,{label:er("HTML element"),options:[{label:er("Default ()"),value:"div"},{label:"
",value:"header"},{label:"",value:"main"},{label:"",value:"section"},{label:"",value:"article"},{label:"",value:"aside"},{label:"",value:"footer"}],value:i,onChange:e=>t({tagName:e})})),o&&(0,tt.createElement)(i,d),!o&&(0,tt.createElement)(i,u,(0,tt.createElement)("div",d)))};const M5={apiVersion:2,name:"core/group",title:"Group",category:"design",description:"Combine blocks into a group.",keywords:["container","wrapper","row","section"],textdomain:"default",attributes:{tagName:{type:"string",default:"div"},templateLock:{enum:["all","insert",!1]}},supports:{align:["wide","full"],anchor:!0,html:!1,color:{gradients:!0,link:!0},spacing:{padding:!0},__experimentalBorder:{color:!0,radius:!0,style:!0,width:!0},__experimentalLayout:!0},editorStyle:"wp-block-group-editor",style:"wp-block-group"},{name:k5}=M5,w5={icon:b5,example:{attributes:{style:{color:{text:"#000000",background:"#ffffff"}}},innerBlocks:[{name:"core/paragraph",attributes:{customTextColor:"#cf2e2e",fontSize:"large",content:er("One.")}},{name:"core/paragraph",attributes:{customTextColor:"#ff6900",fontSize:"large",content:er("Two.")}},{name:"core/paragraph",attributes:{customTextColor:"#fcb900",fontSize:"large",content:er("Three.")}},{name:"core/paragraph",attributes:{customTextColor:"#00d084",fontSize:"large",content:er("Four.")}},{name:"core/paragraph",attributes:{customTextColor:"#0693e3",fontSize:"large",content:er("Five.")}},{name:"core/paragraph",attributes:{customTextColor:"#9b51e0",fontSize:"large",content:er("Six.")}}]},transforms:{from:[{type:"block",isMultiBlock:!0,blocks:["*"],__experimentalConvert(e){if(1===e.length&&"core/group"===e[0].name)return;const t=["wide","full"],n=e.reduce(((e,n)=>{const{align:r}=n.attributes;return t.indexOf(r)>t.indexOf(e)?r:e}),void 0),r=e.map((e=>Ho(e.name,e.attributes,e.innerBlocks)));return Ho("core/group",{align:n},r)}}]},edit:_5,save:function({attributes:e}){const{tagName:t}=e;return(0,tt.createElement)(t,VR.save(),(0,tt.createElement)(JH.Content,null))},deprecated:y5},E5=(0,tt.createElement)(mo,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,tt.createElement)(uo,{d:"M20.2 7v4H3.8V7H2.2v9h1.6v-3.5h16.4V16h1.6V7z"})),L5=({color:e,setColor:t})=>(0,tt.createElement)(FA,null,(0,tt.createElement)(aj,{title:er("Color"),colorSettings:[{value:e.color,onChange:t,label:er("Color")}]}));const A5=cD("color",{textColor:"color"})((function({color:e,setColor:t,className:n}){return(0,tt.createElement)(tt.Fragment,null,(0,tt.createElement)("hr",VR({className:so()(n,{"has-background":e.color,[e.class]:e.class}),style:{backgroundColor:e.color,color:e.color}})),(0,tt.createElement)(L5,{color:e,setColor:t}))}));const S5={from:[{type:"enter",regExp:/^-{3,}$/,transform:()=>Ho("core/separator")},{type:"raw",selector:"hr",schema:{hr:{}}}]},C5={apiVersion:2,name:"core/separator",title:"Separator",category:"design",description:"Create a break between ideas or sections with a horizontal separator.",keywords:["horizontal-line","hr","divider"],textdomain:"default",attributes:{color:{type:"string"},customColor:{type:"string"}},supports:{anchor:!0,align:["center","wide","full"]},styles:[{name:"default",label:"Default",isDefault:!0},{name:"wide",label:"Wide Line"},{name:"dots",label:"Dots"}],editorStyle:"wp-block-separator-editor",style:"wp-block-separator"},{name:T5}=C5,x5={icon:E5,example:{attributes:{customColor:"#065174",className:"is-style-wide"}},transforms:S5,edit:A5,save:function({attributes:e}){const{color:t,customColor:n}=e,r=mC("background-color",t),o=mC("color",t),a=so()({"has-text-color has-background":t||n,[r]:r,[o]:o}),i={backgroundColor:r?void 0:n,color:o?void 0:n};return(0,tt.createElement)("hr",VR.save({className:a,style:i}))}},z5=(0,tt.createElement)(mo,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,tt.createElement)(uo,{d:"M16 4.2v1.5h2.5v12.5H16v1.5h4V4.2h-4zM4.2 19.8h4v-1.5H5.8V5.8h2.5V4.2h-4l-.1 15.6zm5.1-3.1l1.4.6 4-10-1.4-.6-4 10z"}));const O5={from:[{type:"shortcode",tag:"[a-z][a-z0-9_-]*",attributes:{text:{type:"string",shortcode:(e,{content:t})=>sa(ia(t))}},priority:20}]},N5={apiVersion:2,name:"core/shortcode",title:"Shortcode",category:"widgets",description:"Insert additional custom elements with a WordPress shortcode.",textdomain:"default",attributes:{text:{type:"string",source:"html"}},supports:{className:!1,customClassName:!1,html:!1},editorStyle:"wp-block-shortcode-editor"},{name:D5}=N5,B5={icon:z5,transforms:O5,edit:function e({attributes:t,setAttributes:n}){const r=`blocks-shortcode-input-${Qk(e)}`;return(0,tt.createElement)("div",VR({className:"components-placeholder"}),(0,tt.createElement)("label",{htmlFor:r,className:"components-placeholder__label"},(0,tt.createElement)($L,{icon:z5}),er("Shortcode")),(0,tt.createElement)(zj,{className:"blocks-shortcode__textarea",id:r,value:t.text,"aria-label":er("Shortcode text"),placeholder:er("Write shortcode here…"),onChange:e=>n({text:e})}))},save:function({attributes:e}){return(0,tt.createElement)(Pa,null,e.text)}},I5=(0,tt.createElement)(mo,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,tt.createElement)(uo,{d:"M12.5 4.2v1.6h4.7L5.8 17.2V12H4.2v7.8H12v-1.6H6.8L18.2 6.8v4.7h1.6V4.2z"})),P5=lS([eP((e=>{const{toggleSelection:t}=e(nk);return{onResizeStart:()=>t(!1),onResizeStop:()=>t(!0)}})),cS])((({attributes:e,isSelected:t,setAttributes:n,onResizeStart:r,onResizeStop:o,context:a})=>{const{orientation:i}=a,[s,l]=(0,tt.useState)(!1),{height:c,width:u}=e,d=e=>{n({height:e})},p=e=>{n({width:e})},m=(...e)=>{r(...e),l(!0)},f=(e,t,n,r)=>{o();const a=Math.min(parseInt(c+r.height,10),500);d(a),l(!1)},h=(e,t,n,r)=>{o();const a=Math.min(parseInt(u+r.width,10),500);p(a),l(!1)};return(0,tt.useEffect)((()=>{"horizontal"!==i||u||(p(72),d(0))}),[]),(0,tt.createElement)(tt.Fragment,null,(0,tt.createElement)(mQ,VR(),"horizontal"===i?(0,tt.createElement)(LG,{className:so()("block-library-spacer__resize-container","resize-horizontal",{"is-selected":t}),size:{width:u,height:24},minWidth:1,enable:{top:!1,right:!0,bottom:!1,left:!1,topRight:!1,bottomRight:!1,bottomLeft:!1,topLeft:!1},onResizeStart:m,onResizeStop:h,showHandle:t,__experimentalShowTooltip:!0,__experimentalTooltipProps:{axis:"x",position:"corner",isVisible:s}}):(0,tt.createElement)(LG,{className:so()("block-library-spacer__resize-container",{"is-selected":t}),size:{height:c},minHeight:1,enable:{top:!1,right:!1,bottom:!0,left:!1,topRight:!1,bottomRight:!1,bottomLeft:!1,topLeft:!1},onResizeStart:m,onResizeStop:f,showHandle:t,__experimentalShowTooltip:!0,__experimentalTooltipProps:{axis:"y",position:"bottom",isVisible:s}})),(0,tt.createElement)(FA,null,(0,tt.createElement)(BA,{title:er("Spacer settings")},"horizontal"===i&&(0,tt.createElement)(rT,{label:er("Width in pixels"),min:1,max:Math.max(500,u),value:u,onChange:p}),"horizontal"!==i&&(0,tt.createElement)(rT,{label:er("Height in pixels"),min:1,max:Math.max(500,c),value:c,onChange:d}))))}));const R5={apiVersion:2,name:"core/spacer",title:"Spacer",category:"design",description:"Add white space between blocks and customize its height.",textdomain:"default",attributes:{height:{type:"number",default:100},width:{type:"number"}},usesContext:["orientation"],supports:{anchor:!0},editorStyle:"wp-block-spacer-editor",style:"wp-block-spacer"},{name:Y5}=R5,W5={icon:I5,edit:P5,save:function({attributes:e}){return(0,tt.createElement)("div",VR.save({style:{height:e.height,width:e.width},"aria-hidden":!0}))}},H5=(0,tt.createElement)(mo,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,tt.createElement)(uo,{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM5 4.5h14c.3 0 .5.2.5.5v3.5h-15V5c0-.3.2-.5.5-.5zm8 5.5h6.5v3.5H13V10zm-1.5 3.5h-7V10h7v3.5zm-7 5.5v-4h7v4.5H5c-.3 0-.5-.2-.5-.5zm14.5.5h-6V15h6.5v4c0 .3-.2.5-.5.5z"})),q5={"subtle-light-gray":"#f3f4f5","subtle-pale-green":"#e9fbe5","subtle-pale-blue":"#e7f5fe","subtle-pale-pink":"#fcf0ef"},j5=[{attributes:{hasFixedLayout:{type:"boolean",default:!1},backgroundColor:{type:"string"},caption:{type:"string",source:"html",selector:"figcaption",default:""},head:{type:"array",default:[],source:"query",selector:"thead tr",query:{cells:{type:"array",default:[],source:"query",selector:"td,th",query:{content:{type:"string",source:"html"},tag:{type:"string",default:"td",source:"tag"},scope:{type:"string",source:"attribute",attribute:"scope"},align:{type:"string",source:"attribute",attribute:"data-align"}}}}},body:{type:"array",default:[],source:"query",selector:"tbody tr",query:{cells:{type:"array",default:[],source:"query",selector:"td,th",query:{content:{type:"string",source:"html"},tag:{type:"string",default:"td",source:"tag"},scope:{type:"string",source:"attribute",attribute:"scope"},align:{type:"string",source:"attribute",attribute:"data-align"}}}}},foot:{type:"array",default:[],source:"query",selector:"tfoot tr",query:{cells:{type:"array",default:[],source:"query",selector:"td,th",query:{content:{type:"string",source:"html"},tag:{type:"string",default:"td",source:"tag"},scope:{type:"string",source:"attribute",attribute:"scope"},align:{type:"string",source:"attribute",attribute:"data-align"}}}}}},supports:{anchor:!0,align:!0,__experimentalSelector:".wp-block-table > table"},save:({attributes:e})=>{const{hasFixedLayout:t,head:n,body:r,foot:o,backgroundColor:a,caption:i}=e;if(!n.length&&!r.length&&!o.length)return null;const s=mC("background-color",a),l=so()(s,{"has-fixed-layout":t,"has-background":!!s}),c=!Cj.isEmpty(i),u=({type:e,rows:t})=>{if(!t.length)return null;const n=`t${e}`;return(0,tt.createElement)(n,null,t.map((({cells:e},t)=>(0,tt.createElement)("tr",{key:t},e.map((({content:e,tag:t,scope:n,align:r},o)=>{const a=so()({[`has-text-align-${r}`]:r});return(0,tt.createElement)(Cj.Content,{className:a||void 0,"data-align":r,tagName:t,value:e,key:o,scope:"th"===t?n:void 0})}))))))};return(0,tt.createElement)("figure",VR.save(),(0,tt.createElement)("table",{className:""===l?void 0:l},(0,tt.createElement)(u,{type:"head",rows:n}),(0,tt.createElement)(u,{type:"body",rows:r}),(0,tt.createElement)(u,{type:"foot",rows:o})),c&&(0,tt.createElement)(Cj.Content,{tagName:"figcaption",value:i}))},isEligible:e=>e.backgroundColor&&!e.style,migrate:e=>({...e,backgroundColor:void 0,style:{color:{background:q5[e.backgroundColor]}}})},{attributes:{hasFixedLayout:{type:"boolean",default:!1},backgroundColor:{type:"string"},head:{type:"array",default:[],source:"query",selector:"thead tr",query:{cells:{type:"array",default:[],source:"query",selector:"td,th",query:{content:{type:"string",source:"html"},tag:{type:"string",default:"td",source:"tag"},scope:{type:"string",source:"attribute",attribute:"scope"}}}}},body:{type:"array",default:[],source:"query",selector:"tbody tr",query:{cells:{type:"array",default:[],source:"query",selector:"td,th",query:{content:{type:"string",source:"html"},tag:{type:"string",default:"td",source:"tag"},scope:{type:"string",source:"attribute",attribute:"scope"}}}}},foot:{type:"array",default:[],source:"query",selector:"tfoot tr",query:{cells:{type:"array",default:[],source:"query",selector:"td,th",query:{content:{type:"string",source:"html"},tag:{type:"string",default:"td",source:"tag"},scope:{type:"string",source:"attribute",attribute:"scope"}}}}}},supports:{align:!0},save({attributes:e}){const{hasFixedLayout:t,head:n,body:r,foot:o,backgroundColor:a}=e;if(!n.length&&!r.length&&!o.length)return null;const i=mC("background-color",a),s=so()(i,{"has-fixed-layout":t,"has-background":!!i}),l=({type:e,rows:t})=>{if(!t.length)return null;const n=`t${e}`;return(0,tt.createElement)(n,null,t.map((({cells:e},t)=>(0,tt.createElement)("tr",{key:t},e.map((({content:e,tag:t,scope:n},r)=>(0,tt.createElement)(Cj.Content,{tagName:t,value:e,key:r,scope:"th"===t?n:void 0})))))))};return(0,tt.createElement)("table",{className:s},(0,tt.createElement)(l,{type:"head",rows:n}),(0,tt.createElement)(l,{type:"body",rows:r}),(0,tt.createElement)(l,{type:"foot",rows:o}))}}],F5=(0,tt.createElement)(mo,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},(0,tt.createElement)(uo,{d:"M6.656 6.464h2.88v2.88h1.408v-2.88h2.88V5.12h-2.88V2.24H9.536v2.88h-2.88zM0 17.92V0h20.48v17.92H0zm7.68-2.56h5.12v-3.84H7.68v3.84zm-6.4 0H6.4v-3.84H1.28v3.84zM19.2 1.28H1.28v9.024H19.2V1.28zm0 10.24h-5.12v3.84h5.12v-3.84zM6.656 6.464h2.88v2.88h1.408v-2.88h2.88V5.12h-2.88V2.24H9.536v2.88h-2.88zM0 17.92V0h20.48v17.92H0zm7.68-2.56h5.12v-3.84H7.68v3.84zm-6.4 0H6.4v-3.84H1.28v3.84zM19.2 1.28H1.28v9.024H19.2V1.28zm0 10.24h-5.12v3.84h5.12v-3.84z"})),V5=(0,tt.createElement)(mo,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},(0,tt.createElement)(uo,{d:"M13.824 10.176h-2.88v-2.88H9.536v2.88h-2.88v1.344h2.88v2.88h1.408v-2.88h2.88zM0 17.92V0h20.48v17.92H0zM6.4 1.28H1.28v3.84H6.4V1.28zm6.4 0H7.68v3.84h5.12V1.28zm6.4 0h-5.12v3.84h5.12V1.28zm0 5.056H1.28v9.024H19.2V6.336z"})),X5=(0,tt.createElement)(mo,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},(0,tt.createElement)(uo,{d:"M17.728 11.456L14.592 8.32l3.2-3.2-1.536-1.536-3.2 3.2L9.92 3.648 8.384 5.12l3.2 3.2-3.264 3.264 1.536 1.536 3.264-3.264 3.136 3.136 1.472-1.536zM0 17.92V0h20.48v17.92H0zm19.2-6.4h-.448l-1.28-1.28H19.2V6.4h-1.792l1.28-1.28h.512V1.28H1.28v3.84h6.208l1.28 1.28H1.28v3.84h7.424l-1.28 1.28H1.28v3.84H19.2v-3.84z"})),U5=(0,tt.createElement)(mo,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},(0,tt.createElement)(uo,{d:"M6.4 3.776v3.648H2.752v1.792H6.4v3.648h1.728V9.216h3.712V7.424H8.128V3.776zM0 17.92V0h20.48v17.92H0zM12.8 1.28H1.28v14.08H12.8V1.28zm6.4 0h-5.12v3.84h5.12V1.28zm0 5.12h-5.12v3.84h5.12V6.4zm0 5.12h-5.12v3.84h5.12v-3.84z"})),$5=(0,tt.createElement)(mo,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},(0,tt.createElement)(uo,{d:"M14.08 12.864V9.216h3.648V7.424H14.08V3.776h-1.728v3.648H8.64v1.792h3.712v3.648zM0 17.92V0h20.48v17.92H0zM6.4 1.28H1.28v3.84H6.4V1.28zm0 5.12H1.28v3.84H6.4V6.4zm0 5.12H1.28v3.84H6.4v-3.84zM19.2 1.28H7.68v14.08H19.2V1.28z"})),K5=(0,tt.createElement)(mo,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},(0,tt.createElement)(uo,{d:"M6.4 9.98L7.68 8.7v-.256L6.4 7.164V9.98zm6.4-1.532l1.28-1.28V9.92L12.8 8.64v-.192zm7.68 9.472V0H0v17.92h20.48zm-1.28-2.56h-5.12v-1.024l-.256.256-1.024-1.024v1.792H7.68v-1.792l-1.024 1.024-.256-.256v1.024H1.28V1.28H6.4v2.368l.704-.704.576.576V1.216h5.12V3.52l.96-.96.32.32V1.216h5.12V15.36zm-5.76-2.112l-3.136-3.136-3.264 3.264-1.536-1.536 3.264-3.264L5.632 5.44l1.536-1.536 3.136 3.136 3.2-3.2 1.536 1.536-3.2 3.2 3.136 3.136-1.536 1.536z"})),G5=(0,tt.createElement)(mo,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,tt.createElement)(uo,{d:"M4 6v11.5h16V6H4zm1.5 1.5h6V11h-6V7.5zm0 8.5v-3.5h6V16h-6zm13 0H13v-3.5h5.5V16zM13 11V7.5h5.5V11H13z"})),J5=["align"];function Q5(e,t,n){if(!t)return e;const r=(0,at.pick)(e,["head","body","foot"]),{sectionName:o,rowIndex:a}=t;return(0,at.mapValues)(r,((e,r)=>o&&o!==r?e:e.map(((e,o)=>a&&a!==o?e:{cells:e.cells.map(((e,a)=>function(e,t){if(!e||!t)return!1;switch(t.type){case"column":return"column"===t.type&&e.columnIndex===t.columnIndex;case"cell":return"cell"===t.type&&e.sectionName===t.sectionName&&e.columnIndex===t.columnIndex&&e.rowIndex===t.rowIndex}}({sectionName:r,columnIndex:a,rowIndex:o},t)?n(e):e))}))))}function Z5(e,{sectionName:t,rowIndex:n,columnCount:r}){const o=function(e){return t6(e.head)?t6(e.body)?t6(e.foot)?void 0:e.foot[0]:e.body[0]:e.head[0]}(e),a=void 0===r?(0,at.get)(o,["cells","length"]):r;return a?{[t]:[...e[t].slice(0,n),{cells:(0,at.times)(a,(e=>{const n=(0,at.get)(o,["cells",e],{});return{...(0,at.pick)(n,J5),content:"",tag:"head"===t?"th":"td"}}))},...e[t].slice(n)]}:e}function e6(e,t){if(!t6(e[t]))return{[t]:[]};return Z5(e,{sectionName:t,rowIndex:0,columnCount:(0,at.get)(e,["body",0,"cells","length"],1)})}function t6(e){return!e||!e.length||(0,at.every)(e,n6)}function n6(e){return!(e.cells&&e.cells.length)}const r6=[{icon:uD,title:er("Align column left"),align:"left"},{icon:dD,title:er("Align column center"),align:"center"},{icon:pD,title:er("Align column right"),align:"right"}],o6={head:er("Header cell text"),body:er("Body cell text"),foot:er("Footer cell text")},a6={head:er("Header label"),foot:er("Footer label")};function i6({name:e,...t}){const n=`t${e}`;return(0,tt.createElement)(n,t)}const s6=function({attributes:e,setAttributes:t,insertBlocksAfter:n,isSelected:r}){const{hasFixedLayout:o,caption:a,head:i,foot:s}=e,[l,c]=(0,tt.useState)(2),[u,d]=(0,tt.useState)(2),[p,m]=(0,tt.useState)(),f=iD(e),h=rD(e);function g(n){p&&t(Q5(e,p,(e=>({...e,content:n}))))}function b(n){if(!p)return;const{sectionName:r,rowIndex:o}=p,a=o+n;t(Z5(e,{sectionName:r,rowIndex:a})),m({sectionName:r,rowIndex:a,columnIndex:0,type:"cell"})}function v(n=0){if(!p)return;const{columnIndex:r}=p,o=r+n;t(function(e,{columnIndex:t}){const n=(0,at.pick)(e,["head","body","foot"]);return(0,at.mapValues)(n,((e,n)=>t6(e)?e:e.map((e=>n6(e)||e.cells.length{r||m()}),[r]);const y=["head","body","foot"].filter((t=>!t6(e[t]))),_=[{icon:F5,title:er("Insert row before"),isDisabled:!p,onClick:function(){b(0)}},{icon:V5,title:er("Insert row after"),isDisabled:!p,onClick:function(){b(1)}},{icon:X5,title:er("Delete row"),isDisabled:!p,onClick:function(){if(!p)return;const{sectionName:n,rowIndex:r}=p;m(),t(function(e,{sectionName:t,rowIndex:n}){return{[t]:e[t].filter(((e,t)=>t!==n))}}(e,{sectionName:n,rowIndex:r}))}},{icon:U5,title:er("Insert column before"),isDisabled:!p,onClick:function(){v(0)}},{icon:$5,title:er("Insert column after"),isDisabled:!p,onClick:function(){v(1)}},{icon:K5,title:er("Delete column"),isDisabled:!p,onClick:function(){if(!p)return;const{sectionName:n,columnIndex:r}=p;m(),t(function(e,{columnIndex:t}){const n=(0,at.pick)(e,["head","body","foot"]);return(0,at.mapValues)(n,(e=>t6(e)?e:e.map((e=>({cells:e.cells.length>=t?e.cells.filter(((e,n)=>n!==t)):e.cells}))).filter((e=>e.cells.length))))}(e,{sectionName:n,columnIndex:r}))}}],M=["head","body","foot"].map((t=>(0,tt.createElement)(i6,{name:t,key:t},e[t].map((({cells:e},n)=>(0,tt.createElement)("tr",{key:n},e.map((({content:e,tag:r,scope:o,align:a},i)=>(0,tt.createElement)(Cj,{tagName:r,key:i,className:so()({[`has-text-align-${a}`]:a},"wp-block-table__cell-content"),scope:"th"===r?o:void 0,value:e,onChange:g,unstableOnFocus:()=>{m({sectionName:t,rowIndex:n,columnIndex:i,type:"cell"})},"aria-label":o6[t],placeholder:a6[t]}))))))))),k=!y.length;return(0,tt.createElement)("figure",VR(),!k&&(0,tt.createElement)(tt.Fragment,null,(0,tt.createElement)(lk,{group:"block"},(0,tt.createElement)(gD,{label:er("Change column alignment"),alignmentControls:r6,value:function(){if(p)return function(e,t,n){const{sectionName:r,rowIndex:o,columnIndex:a}=t;return(0,at.get)(e,[r,o,"cells",a,n])}(e,p,"align")}(),onChange:n=>function(n){if(!p)return;const r={type:"column",columnIndex:p.columnIndex},o=Q5(e,r,(e=>({...e,align:n})));t(o)}(n)})),(0,tt.createElement)(lk,{group:"other"},(0,tt.createElement)(ck,{hasArrowIndicator:!0,icon:G5,label:er("Edit table"),controls:_}))),!k&&(0,tt.createElement)(FA,null,(0,tt.createElement)(BA,{title:er("Table settings"),className:"blocks-table-settings"},(0,tt.createElement)(KN,{label:er("Fixed width table cells"),checked:!!o,onChange:function(){t({hasFixedLayout:!o})}}),(0,tt.createElement)(KN,{label:er("Header section"),checked:!(!i||!i.length),onChange:function(){t(e6(e,"head"))}}),(0,tt.createElement)(KN,{label:er("Footer section"),checked:!(!s||!s.length),onChange:function(){t(e6(e,"foot"))}}))),!k&&(0,tt.createElement)("table",{className:so()(f.className,h.className,{"has-fixed-layout":o}),style:{...f.style,...h.style}},M),!k&&(0,tt.createElement)(Cj,{tagName:"figcaption","aria-label":er("Table caption text"),placeholder:er("Add caption"),value:a,onChange:e=>t({caption:e}),unstableOnFocus:()=>m(),__unstableOnSplitAtEnd:()=>n(Ho("core/paragraph"))}),k&&(0,tt.createElement)(vH,{label:er("Table"),icon:(0,tt.createElement)(MB,{icon:H5,showColors:!0}),instructions:er("Insert a table for sharing data.")},(0,tt.createElement)("form",{className:"blocks-table__placeholder-form",onSubmit:function(e){e.preventDefault(),t(function({rowCount:e,columnCount:t}){return{body:(0,at.times)(e,(()=>({cells:(0,at.times)(t,(()=>({content:"",tag:"td"})))})))}}({rowCount:parseInt(l,10)||2,columnCount:parseInt(u,10)||2}))}},(0,tt.createElement)(LA,{type:"number",label:er("Column count"),value:u,onChange:function(e){d(e)},min:"1",className:"blocks-table__placeholder-input"}),(0,tt.createElement)(LA,{type:"number",label:er("Row count"),value:l,onChange:function(e){c(e)},min:"1",className:"blocks-table__placeholder-input"}),(0,tt.createElement)(Eh,{className:"blocks-table__placeholder-button",variant:"primary",type:"submit"},er("Create Table")))))};const l6=({phrasingContentSchema:e})=>({tr:{allowEmpty:!0,children:{th:{allowEmpty:!0,children:e,attributes:["scope"]},td:{allowEmpty:!0,children:e}}}}),c6={from:[{type:"raw",selector:"table",schema:e=>({table:{children:{thead:{allowEmpty:!0,children:l6(e)},tfoot:{allowEmpty:!0,children:l6(e)},tbody:{allowEmpty:!0,children:l6(e)}}}})}]},u6={apiVersion:2,name:"core/table",title:"Table",category:"text",description:"Insert a table — perfect for sharing charts and data.",textdomain:"default",attributes:{hasFixedLayout:{type:"boolean",default:!1},caption:{type:"string",source:"html",selector:"figcaption",default:""},head:{type:"array",default:[],source:"query",selector:"thead tr",query:{cells:{type:"array",default:[],source:"query",selector:"td,th",query:{content:{type:"string",source:"html"},tag:{type:"string",default:"td",source:"tag"},scope:{type:"string",source:"attribute",attribute:"scope"},align:{type:"string",source:"attribute",attribute:"data-align"}}}}},body:{type:"array",default:[],source:"query",selector:"tbody tr",query:{cells:{type:"array",default:[],source:"query",selector:"td,th",query:{content:{type:"string",source:"html"},tag:{type:"string",default:"td",source:"tag"},scope:{type:"string",source:"attribute",attribute:"scope"},align:{type:"string",source:"attribute",attribute:"data-align"}}}}},foot:{type:"array",default:[],source:"query",selector:"tfoot tr",query:{cells:{type:"array",default:[],source:"query",selector:"td,th",query:{content:{type:"string",source:"html"},tag:{type:"string",default:"td",source:"tag"},scope:{type:"string",source:"attribute",attribute:"scope"},align:{type:"string",source:"attribute",attribute:"data-align"}}}}}},supports:{anchor:!0,align:!0,color:{__experimentalSkipSerialization:!0,gradients:!0},__experimentalBorder:{__experimentalSkipSerialization:!0,color:!0,style:!0,width:!0},__experimentalSelector:".wp-block-table > table"},styles:[{name:"regular",label:"Default",isDefault:!0},{name:"stripes",label:"Stripes"}],editorStyle:"wp-block-table-editor",style:"wp-block-table"},{name:d6}=u6,p6={icon:H5,example:{attributes:{head:[{cells:[{content:er("Version"),tag:"th"},{content:er("Jazz Musician"),tag:"th"},{content:er("Release Date"),tag:"th"}]}],body:[{cells:[{content:"5.2",tag:"td"},{content:"Jaco Pastorius",tag:"td"},{content:er("May 7, 2019"),tag:"td"}]},{cells:[{content:"5.1",tag:"td"},{content:"Betty Carter",tag:"td"},{content:er("February 21, 2019"),tag:"td"}]},{cells:[{content:"5.0",tag:"td"},{content:"Bebo Valdés",tag:"td"},{content:er("December 6, 2018"),tag:"td"}]}]}},transforms:c6,edit:s6,save:function({attributes:e}){const{hasFixedLayout:t,head:n,body:r,foot:o,caption:a}=e;if(!n.length&&!r.length&&!o.length)return null;const i=aD(e),s=nD(e),l=so()(i.className,s.className,{"has-fixed-layout":t}),c=!Cj.isEmpty(a),u=({type:e,rows:t})=>{if(!t.length)return null;const n=`t${e}`;return(0,tt.createElement)(n,null,t.map((({cells:e},t)=>(0,tt.createElement)("tr",{key:t},e.map((({content:e,tag:t,scope:n,align:r},o)=>{const a=so()({[`has-text-align-${r}`]:r});return(0,tt.createElement)(Cj.Content,{className:a||void 0,"data-align":r,tagName:t,value:e,key:o,scope:"th"===t?n:void 0})}))))))};return(0,tt.createElement)("figure",VR.save(),(0,tt.createElement)("table",{className:""===l?void 0:l,style:{...i.style,...s.style}},(0,tt.createElement)(u,{type:"head",rows:n}),(0,tt.createElement)(u,{type:"body",rows:r}),(0,tt.createElement)(u,{type:"foot",rows:o})),c&&(0,tt.createElement)(Cj.Content,{tagName:"figcaption",value:a}))},deprecated:j5};const m6={to:[{type:"block",blocks:["core/columns"],transform:({className:e,columns:t,content:n,width:r})=>Ho("core/columns",{align:"wide"===r||"full"===r?r:void 0,className:e,columns:t},n.map((({children:e})=>Ho("core/column",{},[Ho("core/paragraph",{content:e})]))))}]},f6={apiVersion:2,name:"core/text-columns",title:"Text Columns (deprecated)",icon:"columns",category:"design",description:"This block is deprecated. Please use the Columns block instead.",textdomain:"default",attributes:{content:{type:"array",source:"query",selector:"p",query:{children:{type:"string",source:"html"}},default:[{},{}]},columns:{type:"number",default:2},width:{type:"string"}},supports:{inserter:!1},editorStyle:"wp-block-text-columns-editor",style:"wp-block-text-columns"},{name:h6}=f6,g6={transforms:m6,getEditWrapperProps(e){const{width:t}=e;if("wide"===t||"full"===t)return{"data-align":t}},edit:function({attributes:e,setAttributes:t}){const{width:n,content:r,columns:o}=e;return qp("The Text Columns block",{since:"5.3",alternative:"the Columns block"}),(0,tt.createElement)(tt.Fragment,null,(0,tt.createElement)(lk,null,(0,tt.createElement)(dA,{value:n,onChange:e=>t({width:e}),controls:["center","wide","full"]})),(0,tt.createElement)(FA,null,(0,tt.createElement)(BA,null,(0,tt.createElement)(rT,{label:er("Columns"),value:o,onChange:e=>t({columns:e}),min:2,max:4,required:!0}))),(0,tt.createElement)("div",VR({className:`align${n} columns-${o}`}),(0,at.times)(o,(e=>(0,tt.createElement)("div",{className:"wp-block-column",key:`column-${e}`},(0,tt.createElement)(Cj,{tagName:"p",value:(0,at.get)(r,[e,"children"]),onChange:n=>{t({content:[...r.slice(0,e),{children:n},...r.slice(e+1)]})},"aria-label":pn(er("Column %d text"),e+1),placeholder:er("New Column")}))))))},save:function({attributes:e}){const{width:t,content:n,columns:r}=e;return(0,tt.createElement)("div",VR.save({className:`align${t} columns-${r}`}),(0,at.times)(r,(e=>(0,tt.createElement)("div",{className:"wp-block-column",key:`column-${e}`},(0,tt.createElement)(Cj.Content,{tagName:"p",value:(0,at.get)(n,[e,"children"])})))))}},b6=(0,tt.createElement)(mo,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,tt.createElement)(uo,{d:"M17.8 2l-.9.3c-.1 0-3.6 1-5.2 2.1C10 5.5 9.3 6.5 8.9 7.1c-.6.9-1.7 4.7-1.7 6.3l-.9 2.3c-.2.4 0 .8.4 1 .1 0 .2.1.3.1.3 0 .6-.2.7-.5l.6-1.5c.3 0 .7-.1 1.2-.2.7-.1 1.4-.3 2.2-.5.8-.2 1.6-.5 2.4-.8.7-.3 1.4-.7 1.9-1.2s.8-1.2 1-1.9c.2-.7.3-1.6.4-2.4.1-.8.1-1.7.2-2.5 0-.8.1-1.5.2-2.1V2zm-1.9 5.6c-.1.8-.2 1.5-.3 2.1-.2.6-.4 1-.6 1.3-.3.3-.8.6-1.4.9-.7.3-1.4.5-2.2.8-.6.2-1.3.3-1.8.4L15 7.5c.3-.3.6-.7 1-1.1 0 .4 0 .8-.1 1.2zM6 20h8v-1.5H6V20z"})),v6=[{attributes:{content:{type:"string",source:"html",selector:"pre",default:""},textAlign:{type:"string"}},save({attributes:e}){const{textAlign:t,content:n}=e;return(0,tt.createElement)(Cj.Content,{tagName:"pre",style:{textAlign:t},value:n})}}];const y6={from:[{type:"block",blocks:["core/paragraph"],transform:e=>Ho("core/verse",e)}],to:[{type:"block",blocks:["core/paragraph"],transform:e=>Ho("core/paragraph",e)}]},_6={apiVersion:2,name:"core/verse",title:"Verse",category:"text",description:"Insert poetry. Use special spacing formats. Or quote song lyrics.",keywords:["poetry","poem"],textdomain:"default",attributes:{content:{type:"string",source:"html",selector:"pre",default:"",__unstablePreserveWhiteSpace:!0,__experimentalRole:"content"},textAlign:{type:"string"}},supports:{anchor:!0,color:{gradients:!0,link:!0},typography:{fontSize:!0,__experimentalFontFamily:!0},spacing:{padding:!0}},style:"wp-block-verse",editorStyle:"wp-block-verse-editor"},{name:M6}=_6,k6={icon:b6,example:{attributes:{content:er("WHAT was he doing, the great god Pan,\n\tDown in the reeds by the river?\nSpreading ruin and scattering ban,\nSplashing and paddling with hoofs of a goat,\nAnd breaking the golden lilies afloat\n With the dragon-fly on the river.")}},transforms:y6,deprecated:v6,merge:(e,t)=>({content:e.content+t.content}),edit:function({attributes:e,setAttributes:t,mergeBlocks:n,onRemove:r,style:o}){const{textAlign:a,content:i}=e,s=VR({className:so()({[`has-text-align-${a}`]:a}),style:o});return(0,tt.createElement)(tt.Fragment,null,(0,tt.createElement)(lk,null,(0,tt.createElement)(bD,{value:a,onChange:e=>{t({textAlign:e})}})),(0,tt.createElement)(Cj,ot({tagName:"pre",identifier:"content",preserveWhiteSpace:!0,value:i,onChange:e=>{t({content:e})},"aria-label":er("Verse text"),placeholder:er("Write verse…"),onRemove:r,onMerge:n,textAlign:a},s,{__unstablePastePlainText:!0})))},save:function({attributes:e}){const{textAlign:t,content:n}=e,r=so()({[`has-text-align-${t}`]:t});return(0,tt.createElement)("pre",VR.save({className:r}),(0,tt.createElement)(Cj.Content,{value:n}))}},w6=(0,tt.createElement)(mo,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,tt.createElement)(uo,{d:"M18.7 3H5.3C4 3 3 4 3 5.3v13.4C3 20 4 21 5.3 21h13.4c1.3 0 2.3-1 2.3-2.3V5.3C21 4 20 3 18.7 3zm.8 15.7c0 .4-.4.8-.8.8H5.3c-.4 0-.8-.4-.8-.8V5.3c0-.4.4-.8.8-.8h13.4c.4 0 .8.4.8.8v13.4zM10 15l5-3-5-3v6z"})),E6=[{value:"auto",label:er("Auto")},{value:"metadata",label:er("Metadata")},{value:"none",label:er("None")}],L6=({setAttributes:e,attributes:t})=>{const{autoplay:n,controls:r,loop:o,muted:a,playsInline:i,preload:s}=t,l=er("Autoplay may cause usability issues for some users."),c=_b.select({web:(0,tt.useCallback)((e=>e?l:null),[]),native:l}),u=(0,tt.useMemo)((()=>{const t=t=>n=>{e({[t]:n})};return{autoplay:t("autoplay"),loop:t("loop"),muted:t("muted"),controls:t("controls"),playsInline:t("playsInline")}}),[]),d=(0,tt.useCallback)((t=>{e({preload:t})}),[]);return(0,tt.createElement)(tt.Fragment,null,(0,tt.createElement)(KN,{label:er("Autoplay"),onChange:u.autoplay,checked:n,help:c}),(0,tt.createElement)(KN,{label:er("Loop"),onChange:u.loop,checked:o}),(0,tt.createElement)(KN,{label:er("Muted"),onChange:u.muted,checked:a}),(0,tt.createElement)(KN,{label:er("Playback controls"),onChange:u.controls,checked:r}),(0,tt.createElement)(KN,{label:er("Play inline"),onChange:u.playsInline,checked:i}),(0,tt.createElement)(KS,{label:er("Preload"),value:s,onChange:d,options:E6,hideCancelButton:!0}))},A6=["text/vtt"],S6="subtitles",C6=[{label:er("Subtitles"),value:"subtitles"},{label:er("Captions"),value:"captions"},{label:er("Descriptions"),value:"descriptions"},{label:er("Chapters"),value:"chapters"},{label:er("Metadata"),value:"metadata"}],T6=(0,tt.createElement)(mo,{width:"18",height:"14",viewBox:"0 0 18 14",role:"img",fill:"none"},(0,tt.createElement)(po,{x:"0.75",y:"0.75",width:"16.5",height:"12.5",rx:"1.25",stroke:"black",strokeWidth:"1.5",fill:"none"}),(0,tt.createElement)(uo,{d:"M3 7H15",stroke:"black",strokeWidth:"1.5"}),(0,tt.createElement)(uo,{d:"M3 10L15 10",stroke:"black",strokeWidth:"1.5"}));function x6({tracks:e,onEditPress:t}){let n;return n=0===e.length?(0,tt.createElement)("p",{className:"block-library-video-tracks-editor__tracks-informative-message"},er("Tracks can be subtitles, captions, chapters, or descriptions. They help make your content more accessible to a wider range of users.")):e.map(((e,n)=>(0,tt.createElement)("div",{key:n,className:"block-library-video-tracks-editor__track-list-track"},(0,tt.createElement)("span",null,e.label," "),(0,tt.createElement)(Eh,{variant:"tertiary",onClick:()=>t(n),"aria-label":pn(er("Edit %s"),e.label)},er("Edit"))))),(0,tt.createElement)(ON,{label:er("Text tracks"),className:"block-library-video-tracks-editor__track-list"},n)}function z6({track:e,onChange:t,onClose:n,onRemove:r}){const{src:o="",label:a="",srcLang:i="",kind:s=S6}=e,l=o.startsWith("blob:")?"":o.substring(o.lastIndexOf("/")+1);return(0,tt.createElement)(Jg,null,(0,tt.createElement)("div",{className:"block-library-video-tracks-editor__single-track-editor"},(0,tt.createElement)("span",{className:"block-library-video-tracks-editor__single-track-editor-edit-track-label"},er("Edit track")),(0,tt.createElement)("span",null,er("File"),": ",(0,tt.createElement)("b",null,l)),(0,tt.createElement)("div",{className:"block-library-video-tracks-editor__single-track-editor-label-language"},(0,tt.createElement)(LA,{autoFocus:!0,onChange:n=>t({...e,label:n}),label:er("Label"),value:a,help:er("Title of track")}),(0,tt.createElement)(LA,{onChange:n=>t({...e,srcLang:n}),label:er("Source language"),value:i,help:er("Language tag (en, fr, etc.)")})),(0,tt.createElement)(KS,{className:"block-library-video-tracks-editor__single-track-editor-kind-select",options:C6,value:s,label:er("Kind"),onChange:n=>{t({...e,kind:n})}}),(0,tt.createElement)("div",{className:"block-library-video-tracks-editor__single-track-editor-buttons-container"},(0,tt.createElement)(Eh,{variant:"secondary",onClick:()=>{const r={};let o=!1;""===a&&(r.label=er("English"),o=!0),""===i&&(r.srcLang="en",o=!0),void 0===e.kind&&(r.kind=S6,o=!0),o&&t({...e,...r}),n()}},er("Close")),(0,tt.createElement)(Eh,{isDestructive:!0,variant:"link",onClick:r},er("Remove track")))))}function O6({tracks:e=[],onChange:t}){const n=Tl((e=>e(nk).getSettings().mediaUpload),[]),[r,o]=(0,tt.useState)(null);return n?(0,tt.createElement)(Xg,{contentClassName:"block-library-video-tracks-editor",renderToggle:({isOpen:e,onToggle:t})=>(0,tt.createElement)(jg,{label:er("Text tracks"),showTooltip:!0,"aria-expanded":e,"aria-haspopup":"true",onClick:t,icon:T6}),renderContent:({})=>null!==r?(0,tt.createElement)(z6,{track:e[r],onChange:n=>{const o=[...e];o[r]=n,t(o)},onClose:()=>o(null),onRemove:()=>{t(e.filter(((e,t)=>t!==r))),o(null)}}):(0,tt.createElement)(tt.Fragment,null,(0,tt.createElement)(Jg,null,(0,tt.createElement)(x6,{tracks:e,onEditPress:o}),(0,tt.createElement)(ON,{className:"block-library-video-tracks-editor__add-tracks-container",label:er("Add tracks")},(0,tt.createElement)(Kq,{onSelect:({url:n})=>{const r=e.length;t([...e,{src:n}]),o(r)},allowedTypes:A6,render:({open:e})=>(0,tt.createElement)(zB,{icon:Uq,onClick:e},er("Open Media Library"))}),(0,tt.createElement)(Gq,null,(0,tt.createElement)(Xq,{onChange:r=>{const a=r.target.files,i=e.length;n({allowedTypes:A6,filesList:a,onFileChange:([{url:n}])=>{const r=[...e];r[i]||(r[i]={}),r[i]={...e[i],src:n},t(r),o(i)}})},accept:".vtt,text/vtt",render:({openFileDialog:e})=>(0,tt.createElement)(zB,{icon:$q,onClick:()=>{e()}},er("Upload"))})))))}):null}function N6({tracks:e=[]}){return e.map((e=>(0,tt.createElement)("track",ot({key:e.src},e))))}const D6=["video"],B6=["image"];const I6=WK((function e({isSelected:t,noticeUI:n,attributes:r,className:o,setAttributes:a,insertBlocksAfter:i,onReplace:s,noticeOperations:l}){const c=Qk(e),u=(0,tt.useRef)(),d=(0,tt.useRef)(),{id:p,caption:m,controls:f,poster:h,src:g,tracks:b}=r,v=!p&&Qs(g),y=Tl((e=>e(nk).getSettings().mediaUpload));function _(e){e&&e.url?a({src:e.url,id:e.id}):a({src:void 0,id:void 0})}function M(e){if(e!==g){const t=IG({attributes:{url:e}});if(void 0!==t)return void s(t);a({src:e,id:void 0})}}function k(e){l.removeAllNotices(),l.createErrorNotice(e)}(0,tt.useEffect)((()=>{if(!p&&Qs(g)){const e=Gs(g);e&&y({filesList:[e],onFileChange:([{url:e}])=>{a({src:e})},onError:e=>{l.createErrorNotice(e)},allowedTypes:D6})}}),[]),(0,tt.useEffect)((()=>{u.current&&u.current.load()}),[h]);const w=VR({className:so()(o,{"is-transient":v})});if(!g)return(0,tt.createElement)("div",w,(0,tt.createElement)(oj,{icon:(0,tt.createElement)(MB,{icon:w6}),onSelect:_,onSelectURL:M,accept:"video/*",allowedTypes:D6,value:r,notices:n,onError:k}));const E=`video-block__poster-image-description-${c}`;return(0,tt.createElement)(tt.Fragment,null,(0,tt.createElement)(lk,{group:"block"},(0,tt.createElement)(O6,{tracks:b,onChange:e=>{a({tracks:e})}})),(0,tt.createElement)(lk,{group:"other"},(0,tt.createElement)(Jq,{mediaId:p,mediaURL:g,allowedTypes:D6,accept:"video/*",onSelect:_,onSelectURL:M,onError:k})),(0,tt.createElement)(FA,null,(0,tt.createElement)(BA,{title:er("Video settings")},(0,tt.createElement)(L6,{setAttributes:a,attributes:r}),(0,tt.createElement)(Gq,null,(0,tt.createElement)(EA,{className:"editor-video-poster-control"},(0,tt.createElement)(EA.VisualLabel,null,er("Poster image")),(0,tt.createElement)(Kq,{title:er("Select poster image"),onSelect:function(e){a({poster:e.url})},allowedTypes:B6,render:({open:e})=>(0,tt.createElement)(Eh,{variant:"primary",onClick:e,ref:d,"aria-describedby":E},er(h?"Replace":"Select"))}),(0,tt.createElement)("p",{id:E,hidden:!0},h?pn(er("The current poster image url is %s"),h):er("There is no poster image currently selected")),!!h&&(0,tt.createElement)(Eh,{onClick:function(){a({poster:""}),this.posterImageButton.current.focus()},variant:"tertiary"},er("Remove")))))),(0,tt.createElement)("figure",w,(0,tt.createElement)(jP,{isDisabled:!t},(0,tt.createElement)("video",{controls:f,poster:h,src:g,ref:u},(0,tt.createElement)(N6,{tracks:b}))),v&&(0,tt.createElement)(cq,null),(!Cj.isEmpty(m)||t)&&(0,tt.createElement)(Cj,{tagName:"figcaption","aria-label":er("Video caption text"),placeholder:er("Add caption"),value:m,onChange:e=>a({caption:e}),inlineToolbar:!0,__unstableOnSplitAtEnd:()=>i(Ho("core/paragraph"))})))}));const P6={from:[{type:"files",isMatch:e=>1===e.length&&0===e[0].type.indexOf("video/"),transform:e=>Ho("core/video",{src:Ks(e[0])})},{type:"shortcode",tag:"video",attributes:{src:{type:"string",shortcode:({named:{src:e,mp4:t,m4v:n,webm:r,ogv:o,flv:a}})=>e||t||n||r||o||a},poster:{type:"string",shortcode:({named:{poster:e}})=>e},loop:{type:"string",shortcode:({named:{loop:e}})=>e},autoplay:{type:"string",shortcode:({named:{autoplay:e}})=>e},preload:{type:"string",shortcode:({named:{preload:e}})=>e}}}]},R6={apiVersion:2,name:"core/video",title:"Video",category:"media",description:"Embed a video from your media library or upload a new one.",keywords:["movie"],textdomain:"default",attributes:{autoplay:{type:"boolean",source:"attribute",selector:"video",attribute:"autoplay"},caption:{type:"string",source:"html",selector:"figcaption"},controls:{type:"boolean",source:"attribute",selector:"video",attribute:"controls",default:!0},id:{type:"number"},loop:{type:"boolean",source:"attribute",selector:"video",attribute:"loop"},muted:{type:"boolean",source:"attribute",selector:"video",attribute:"muted"},poster:{type:"string",source:"attribute",selector:"video",attribute:"poster"},preload:{type:"string",source:"attribute",selector:"video",attribute:"preload",default:"metadata"},src:{type:"string",source:"attribute",selector:"video",attribute:"src"},playsInline:{type:"boolean",source:"attribute",selector:"video",attribute:"playsinline"},tracks:{type:"array",items:{type:"object"},default:[]}},supports:{anchor:!0,align:!0},editorStyle:"wp-block-video-editor",style:"wp-block-video"},{name:Y6}=R6,W6={icon:w6,example:{attributes:{src:"https://upload.wikimedia.org/wikipedia/commons/c/ca/Wood_thrush_in_Central_Park_switch_sides_%2816510%29.webm",caption:er("Wood thrush singing in Central Park, NYC.")}},transforms:P6,edit:I6,save:function({attributes:e}){const{autoplay:t,caption:n,controls:r,loop:o,muted:a,poster:i,preload:s,src:l,playsInline:c,tracks:u}=e;return(0,tt.createElement)("figure",VR.save(),l&&(0,tt.createElement)("video",{autoPlay:t,controls:r,loop:o,muted:a,poster:i,preload:"metadata"!==s?s:void 0,src:l,playsInline:c},(0,tt.createElement)(N6,{tracks:u})),!Cj.isEmpty(n)&&(0,tt.createElement)(Cj.Content,{tagName:"figcaption",value:n}))}};const H6=QI((e=>({taxonomies:e(yd).getTaxonomies({per_page:-1})})))((function({attributes:e,setAttributes:t,taxonomies:n}){const{taxonomy:r,showTagCounts:o,numberOfTags:a}=e,i=(0,tt.createElement)(FA,null,(0,tt.createElement)(BA,{title:er("Tag Cloud settings")},(0,tt.createElement)(KS,{label:er("Taxonomy"),options:[{label:er("- Select -"),value:"",disabled:!0},...(0,at.map)((0,at.filter)(n,"show_cloud"),(e=>({value:e.slug,label:e.name})))],value:r,onChange:e=>t({taxonomy:e})}),(0,tt.createElement)(KN,{label:er("Show post counts"),checked:o,onChange:()=>t({showTagCounts:!o})}),(0,tt.createElement)(rT,{label:er("Number of tags"),value:a,onChange:e=>t({numberOfTags:e}),min:1,max:100,required:!0})));return(0,tt.createElement)(tt.Fragment,null,i,(0,tt.createElement)("div",VR(),(0,tt.createElement)(YQ,{key:"tag-cloud",block:"core/tag-cloud",attributes:e})))})),q6={apiVersion:2,name:"core/tag-cloud",title:"Tag Cloud",category:"widgets",description:"A cloud of your most used tags.",textdomain:"default",attributes:{numberOfTags:{type:"number",default:45,minimum:1,maximum:100},taxonomy:{type:"string",default:"post_tag"},showTagCounts:{type:"boolean",default:!1}},supports:{html:!1,align:!0},editorStyle:"wp-block-tag-cloud-editor"},{name:j6}=q6,F6={icon:a3,example:{},edit:H6},V6=(0,tt.createElement)(mo,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,tt.createElement)(uo,{d:"M20 6H4c-1.1 0-2 .9-2 2v9c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zm.5 11c0 .3-.2.5-.5.5H4c-.3 0-.5-.2-.5-.5V8c0-.3.2-.5.5-.5h16c.3 0 .5.2.5.5v9zM10 10H8v2h2v-2zm-5 2h2v-2H5v2zm8-2h-2v2h2v-2zm-5 6h8v-2H8v2zm6-4h2v-2h-2v2zm3 0h2v-2h-2v2zm0 4h2v-2h-2v2zM5 16h2v-2H5v2z"})),X6=({clientId:e})=>{const{replaceBlocks:t}=ld(nk),n=Tl((t=>t(nk).getBlock(e)),[e]);return(0,tt.createElement)(jg,{onClick:()=>t(n.clientId,Ns({HTML:gi(n)}))},er("Convert to blocks"))},{wp:U6}=window;const $6={apiVersion:2,name:"core/freeform",title:"Classic",category:"text",description:"Use the classic WordPress editor.",textdomain:"default",attributes:{content:{type:"string",source:"html"}},supports:{className:!1,customClassName:!1,reusable:!1},editorStyle:"wp-block-freeform-editor"},{name:K6}=$6,G6={icon:V6,edit:function({clientId:e,attributes:{content:t},setAttributes:n,onReplace:r}){const o=(0,tt.useRef)(!1);return(0,tt.useEffect)((()=>{if(!o.current)return;const n=window.tinymce.get(`editor-${e}`);(null==n?void 0:n.getContent())!==t&&n.setContent(t||"")}),[t]),(0,tt.useEffect)((()=>{const{baseURL:a,suffix:i}=window.wpEditorL10n.tinymce;function s(e){let o;t&&e.on("loadContent",(()=>e.setContent(t))),e.on("blur",(()=>{o=e.selection.getBookmark(2,!0);const t=document.querySelector(".interface-interface-skeleton__content"),r=t.scrollTop;return n({content:e.getContent()}),e.once("focus",(()=>{o&&(e.selection.moveToBookmark(o),t.scrollTop!==r&&(t.scrollTop=r))})),!1})),e.on("mousedown touchstart",(()=>{o=null}));const a=(0,at.debounce)((()=>{const t=e.getContent();t!==e._lastChange&&(e._lastChange=t,n({content:t}))}),250);e.on("Paste Change input Undo Redo",a),e.on("remove",a.cancel),e.on("keydown",(t=>{ym.primary(t,"z")&&t.stopPropagation(),t.keyCode!==nm&&t.keyCode!==cm||!function(e){const t=e.getBody();return!(t.childNodes.length>1)&&(0===t.childNodes.length||!(t.childNodes[0].childNodes.length>1)&&/^\n?$/.test(t.innerText||t.textContent))}(e)||(r([]),t.preventDefault(),t.stopImmediatePropagation());const{altKey:n}=t;n&&121===t.keyCode&&t.stopPropagation()})),e.on("init",(()=>{const t=e.getBody();t.ownerDocument.activeElement===t&&(t.blur(),e.focus())}))}function l(){const{settings:t}=window.wpEditorL10n.tinymce;U6.oldEditor.initialize(`editor-${e}`,{tinymce:{...t,inline:!0,content_css:!1,fixed_toolbar_container:`#toolbar-${e}`,setup:s}})}function c(){"complete"===document.readyState&&l()}return o.current=!0,window.tinymce.EditorManager.overrideDefaults({base_url:a,suffix:i}),"complete"===document.readyState?l():document.addEventListener("readystatechange",c),()=>{document.removeEventListener("readystatechange",c),U6.oldEditor.remove(`editor-${e}`)}}),[]),(0,tt.createElement)(tt.Fragment,null,(0,tt.createElement)(lk,null,(0,tt.createElement)(tb,null,(0,tt.createElement)(X6,{clientId:e}))),(0,tt.createElement)("div",VR(),(0,tt.createElement)("div",{key:"toolbar",id:`toolbar-${e}`,className:"block-library-classic__toolbar",onClick:function(){const t=window.tinymce.get(`editor-${e}`);t&&t.focus()},"data-placeholder":er("Classic"),onKeyDown:function(e){e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()}}),(0,tt.createElement)("div",{key:"editor",id:`editor-${e}`,className:"wp-block-freeform block-library-rich-text__tinymce"})))},save:function({attributes:e}){const{content:t}=e;return(0,tt.createElement)(Pa,null,t)}},J6=(0,tt.createElement)(mo,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,tt.createElement)(uo,{d:"M9 11.8l6.1-4.5c.1.4.4.7.9.7h2c.6 0 1-.4 1-1V5c0-.6-.4-1-1-1h-2c-.6 0-1 .4-1 1v.4l-6.4 4.8c-.2-.1-.4-.2-.6-.2H6c-.6 0-1 .4-1 1v2c0 .6.4 1 1 1h2c.2 0 .4-.1.6-.2l6.4 4.8v.4c0 .6.4 1 1 1h2c.6 0 1-.4 1-1v-2c0-.6-.4-1-1-1h-2c-.5 0-.8.3-.9.7L9 12.2v-.4z"})),Q6=[{attributes:{iconColor:{type:"string"},customIconColor:{type:"string"},iconColorValue:{type:"string"},iconBackgroundColor:{type:"string"},customIconBackgroundColor:{type:"string"},iconBackgroundColorValue:{type:"string"},openInNewTab:{type:"boolean",default:!1},size:{type:"string"}},providesContext:{openInNewTab:"openInNewTab"},supports:{align:["left","center","right"],anchor:!0},save:e=>{const{attributes:{iconBackgroundColorValue:t,iconColorValue:n,itemsJustification:r,size:o}}=e,a=so()(o,{"has-icon-color":n,"has-icon-background-color":t,[`items-justified-${r}`]:r}),i={"--wp--social-links--icon-color":n,"--wp--social-links--icon-background-color":t};return(0,tt.createElement)("ul",VR.save({className:a,style:i}),(0,tt.createElement)(JH.Content,null))}}],Z6=["core/social-link"],e7=[{name:er("Small"),value:"has-small-icon-size"},{name:er("Normal"),value:"has-normal-icon-size"},{name:er("Large"),value:"has-large-icon-size"},{name:er("Huge"),value:"has-huge-icon-size"}];const t7=cD({iconColor:"icon-color",iconBackgroundColor:"icon-background-color"})((function(e){var t;const{attributes:n,iconBackgroundColor:r,iconColor:o,isSelected:a,setAttributes:i,setIconBackgroundColor:s,setIconColor:l}=e,{iconBackgroundColorValue:c,iconColorValue:u,itemsJustification:d,openInNewTab:p,size:m}=n,f=(null===(t=n.className)||void 0===t?void 0:t.indexOf("is-style-logos-only"))>=0;(0,tt.useEffect)((()=>{f&&i({iconBackgroundColor:void 0,customIconBackgroundColor:void 0,iconBackgroundColorValue:void 0})}),[f,i]);const h=(0,tt.createElement)("li",{className:"wp-block-social-links__social-placeholder"},(0,tt.createElement)("div",{className:"wp-social-link"}),(0,tt.createElement)("div",{className:"wp-block-social-links__social-placeholder-icons"},(0,tt.createElement)("div",{className:"wp-social-link wp-social-link-twitter"}),(0,tt.createElement)("div",{className:"wp-social-link wp-social-link-facebook"}),(0,tt.createElement)("div",{className:"wp-social-link wp-social-link-instagram"}))),g=(0,tt.createElement)("li",{className:"wp-block-social-links__social-prompt"},er("Click plus to add")),b=GH(VR({className:so()(m,{"has-icon-color":o.color||u,"has-icon-background-color":r.color||c,[`items-justified-${d}`]:d})}),{allowedBlocks:Z6,orientation:"horizontal",placeholder:a?g:h,templateLock:!1,__experimentalAppenderTagName:"li"});return(0,tt.createElement)(tt.Fragment,null,(0,tt.createElement)(lk,{group:"block"},(0,tt.createElement)(oq,{allowedControls:["left","center","right","space-between"],value:d,onChange:e=>i({itemsJustification:e}),popoverProps:{position:"bottom right",isAlternate:!0}})),(0,tt.createElement)(lk,{group:"other"},(0,tt.createElement)(ck,{label:er("Size"),text:er("Size"),icon:null,popoverProps:{position:"bottom right"}},(({onClose:e})=>(0,tt.createElement)(ON,null,e7.map((t=>(0,tt.createElement)(zB,{icon:(m===t.value||!m&&"has-normal-icon-size"===t.value)&&kS,isSelected:m===t.value,key:t.value,onClick:()=>{i({size:t.value})},onClose:e,role:"menuitemradio"},t.name))))))),(0,tt.createElement)(FA,null,(0,tt.createElement)(BA,{title:er("Link settings")},(0,tt.createElement)(KN,{label:er("Open links in new tab"),checked:p,onChange:()=>i({openInNewTab:!p})})),(0,tt.createElement)(aj,{title:er("Color"),colorSettings:[{value:o.color||u,onChange:e=>{l(e),i({iconColorValue:e})},label:er("Icon color")},!f&&{value:r.color||c,onChange:e=>{s(e),i({iconBackgroundColorValue:e})},label:er("Icon background color")}]}),!f&&(0,tt.createElement)(WT,{textColor:u,backgroundColor:c,isLargeText:!1})),(0,tt.createElement)("ul",b))}));const n7={apiVersion:2,name:"core/social-links",title:"Social Icons",category:"widgets",description:"Display icons linking to your social media profiles or websites.",keywords:["links"],textdomain:"default",attributes:{iconColor:{type:"string"},customIconColor:{type:"string"},iconColorValue:{type:"string"},iconBackgroundColor:{type:"string"},customIconBackgroundColor:{type:"string"},iconBackgroundColorValue:{type:"string"},openInNewTab:{type:"boolean",default:!1},size:{type:"string"}},providesContext:{openInNewTab:"openInNewTab",iconColorValue:"iconColorValue",iconBackgroundColorValue:"iconBackgroundColorValue"},supports:{align:["left","center","right"],anchor:!0},styles:[{name:"default",label:"Default",isDefault:!0},{name:"logos-only",label:"Logos Only"},{name:"pill-shape",label:"Pill Shape"}],editorStyle:"wp-block-social-links-editor",style:"wp-block-social-links"},{name:r7}=n7,o7={example:{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:"twitter",url:"https://twitter.com/WordPress"}}]},icon:J6,edit:t7,save:function(e){const{attributes:{iconBackgroundColorValue:t,iconColorValue:n,itemsJustification:r,size:o}}=e,a=so()(o,{"has-icon-color":n,"has-icon-background-color":t,[`items-justified-${r}`]:r});return(0,tt.createElement)("ul",VR.save({className:a}),(0,tt.createElement)(JH.Content,null))},deprecated:Q6},a7=()=>(0,tt.createElement)(mo,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1"},(0,tt.createElement)(uo,{d:"M19.647,16.706a1.134,1.134,0,0,0-.343-.833l-2.549-2.549a1.134,1.134,0,0,0-.833-.343,1.168,1.168,0,0,0-.883.392l.233.226q.2.189.264.264a2.922,2.922,0,0,1,.184.233.986.986,0,0,1,.159.312,1.242,1.242,0,0,1,.043.337,1.172,1.172,0,0,1-1.176,1.176,1.237,1.237,0,0,1-.337-.043,1,1,0,0,1-.312-.159,2.76,2.76,0,0,1-.233-.184q-.073-.068-.264-.264l-.226-.233a1.19,1.19,0,0,0-.4.895,1.134,1.134,0,0,0,.343.833L15.837,19.3a1.13,1.13,0,0,0,.833.331,1.18,1.18,0,0,0,.833-.318l1.8-1.789a1.12,1.12,0,0,0,.343-.821Zm-8.615-8.64a1.134,1.134,0,0,0-.343-.833L8.163,4.7a1.134,1.134,0,0,0-.833-.343,1.184,1.184,0,0,0-.833.331L4.7,6.473a1.12,1.12,0,0,0-.343.821,1.134,1.134,0,0,0,.343.833l2.549,2.549a1.13,1.13,0,0,0,.833.331,1.184,1.184,0,0,0,.883-.38L8.728,10.4q-.2-.189-.264-.264A2.922,2.922,0,0,1,8.28,9.9a.986.986,0,0,1-.159-.312,1.242,1.242,0,0,1-.043-.337A1.172,1.172,0,0,1,9.254,8.079a1.237,1.237,0,0,1,.337.043,1,1,0,0,1,.312.159,2.761,2.761,0,0,1,.233.184q.073.068.264.264l.226.233a1.19,1.19,0,0,0,.4-.895ZM22,16.706a3.343,3.343,0,0,1-1.042,2.488l-1.8,1.789a3.536,3.536,0,0,1-4.988-.025l-2.525-2.537a3.384,3.384,0,0,1-1.017-2.488,3.448,3.448,0,0,1,1.078-2.561l-1.078-1.078a3.434,3.434,0,0,1-2.549,1.078,3.4,3.4,0,0,1-2.5-1.029L3.029,9.794A3.4,3.4,0,0,1,2,7.294,3.343,3.343,0,0,1,3.042,4.806l1.8-1.789A3.384,3.384,0,0,1,7.331,2a3.357,3.357,0,0,1,2.5,1.042l2.525,2.537a3.384,3.384,0,0,1,1.017,2.488,3.448,3.448,0,0,1-1.078,2.561l1.078,1.078a3.551,3.551,0,0,1,5.049-.049l2.549,2.549A3.4,3.4,0,0,1,22,16.706Z"})),i7=[{isDefault:!0,name:"wordpress",attributes:{service:"wordpress"},title:"WordPress",icon:()=>(0,tt.createElement)(mo,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},(0,tt.createElement)(uo,{d:"M12.158,12.786L9.46,20.625c0.806,0.237,1.657,0.366,2.54,0.366c1.047,0,2.051-0.181,2.986-0.51 c-0.024-0.038-0.046-0.079-0.065-0.124L12.158,12.786z M3.009,12c0,3.559,2.068,6.634,5.067,8.092L3.788,8.341 C3.289,9.459,3.009,10.696,3.009,12z M18.069,11.546c0-1.112-0.399-1.881-0.741-2.48c-0.456-0.741-0.883-1.368-0.883-2.109 c0-0.826,0.627-1.596,1.51-1.596c0.04,0,0.078,0.005,0.116,0.007C16.472,3.904,14.34,3.009,12,3.009 c-3.141,0-5.904,1.612-7.512,4.052c0.211,0.007,0.41,0.011,0.579,0.011c0.94,0,2.396-0.114,2.396-0.114 C7.947,6.93,8.004,7.642,7.52,7.699c0,0-0.487,0.057-1.029,0.085l3.274,9.739l1.968-5.901l-1.401-3.838 C9.848,7.756,9.389,7.699,9.389,7.699C8.904,7.67,8.961,6.93,9.446,6.958c0,0,1.484,0.114,2.368,0.114 c0.94,0,2.397-0.114,2.397-0.114c0.485-0.028,0.542,0.684,0.057,0.741c0,0-0.488,0.057-1.029,0.085l3.249,9.665l0.897-2.996 C17.841,13.284,18.069,12.316,18.069,11.546z M19.889,7.686c0.039,0.286,0.06,0.593,0.06,0.924c0,0.912-0.171,1.938-0.684,3.22 l-2.746,7.94c2.673-1.558,4.47-4.454,4.47-7.771C20.991,10.436,20.591,8.967,19.889,7.686z M12,22C6.486,22,2,17.514,2,12 C2,6.486,6.486,2,12,2c5.514,0,10,4.486,10,10C22,17.514,17.514,22,12,22z"}))},{name:"fivehundredpx",attributes:{service:"fivehundredpx"},title:"500px",icon:()=>(0,tt.createElement)(mo,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1"},(0,tt.createElement)(uo,{d:"M6.94026,15.1412c.00437.01213.108.29862.168.44064a6.55008,6.55008,0,1,0,6.03191-9.09557,6.68654,6.68654,0,0,0-2.58357.51467A8.53914,8.53914,0,0,0,8.21268,8.61344L8.209,8.61725V3.22948l9.0504-.00008c.32934-.0036.32934-.46353.32934-.61466s0-.61091-.33035-.61467L7.47248,2a.43.43,0,0,0-.43131.42692v7.58355c0,.24466.30476.42131.58793.4819.553.11812.68074-.05864.81617-.2457l.018-.02481A10.52673,10.52673,0,0,1,9.32258,9.258a5.35268,5.35268,0,1,1,7.58985,7.54976,5.417,5.417,0,0,1-3.80867,1.56365,5.17483,5.17483,0,0,1-2.69822-.74478l.00342-4.61111a2.79372,2.79372,0,0,1,.71372-1.78792,2.61611,2.61611,0,0,1,1.98282-.89477,2.75683,2.75683,0,0,1,1.95525.79477,2.66867,2.66867,0,0,1,.79656,1.909,2.724,2.724,0,0,1-2.75849,2.748,4.94651,4.94651,0,0,1-.86254-.13719c-.31234-.093-.44519.34058-.48892.48349-.16811.54966.08453.65862.13687.67489a3.75751,3.75751,0,0,0,1.25234.18375,3.94634,3.94634,0,1,0-2.82444-6.742,3.67478,3.67478,0,0,0-1.13028,2.584l-.00041.02323c-.0035.11667-.00579,2.881-.00644,3.78811l-.00407-.00451a6.18521,6.18521,0,0,1-1.0851-1.86092c-.10544-.27856-.34358-.22925-.66857-.12917-.14192.04372-.57386.17677-.47833.489Zm4.65165-1.08338a.51346.51346,0,0,0,.19513.31818l.02276.022a.52945.52945,0,0,0,.3517.18416.24242.24242,0,0,0,.16577-.0611c.05473-.05082.67382-.67812.73287-.738l.69041.68819a.28978.28978,0,0,0,.21437.11032.53239.53239,0,0,0,.35708-.19486c.29792-.30419.14885-.46821.07676-.54751l-.69954-.69975.72952-.73469c.16-.17311.01874-.35708-.12218-.498-.20461-.20461-.402-.25742-.52855-.14083l-.7254.72665-.73354-.73375a.20128.20128,0,0,0-.14179-.05695.54135.54135,0,0,0-.34379.19648c-.22561.22555-.274.38149-.15656.5059l.73374.7315-.72942.73072A.26589.26589,0,0,0,11.59191,14.05782Zm1.59866-9.915A8.86081,8.86081,0,0,0,9.854,4.776a.26169.26169,0,0,0-.16938.22759.92978.92978,0,0,0,.08619.42094c.05682.14524.20779.531.50006.41955a8.40969,8.40969,0,0,1,2.91968-.55484,7.87875,7.87875,0,0,1,3.086.62286,8.61817,8.61817,0,0,1,2.30562,1.49315.2781.2781,0,0,0,.18318.07586c.15529,0,.30425-.15253.43167-.29551.21268-.23861.35873-.4369.1492-.63538a8.50425,8.50425,0,0,0-2.62312-1.694A9.0177,9.0177,0,0,0,13.19058,4.14283ZM19.50945,18.6236h0a.93171.93171,0,0,0-.36642-.25406.26589.26589,0,0,0-.27613.06613l-.06943.06929A7.90606,7.90606,0,0,1,7.60639,18.505a7.57284,7.57284,0,0,1-1.696-2.51537,8.58715,8.58715,0,0,1-.5147-1.77754l-.00871-.04864c-.04939-.25873-.28755-.27684-.62981-.22448-.14234.02178-.5755.088-.53426.39969l.001.00712a9.08807,9.08807,0,0,0,15.406,4.99094c.00193-.00192.04753-.04718.0725-.07436C19.79425,19.16234,19.87422,18.98728,19.50945,18.6236Z"}))},{name:"amazon",attributes:{service:"amazon"},title:"Amazon",icon:()=>(0,tt.createElement)(mo,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1"},(0,tt.createElement)(uo,{d:"M13.582,8.182C11.934,8.367,9.78,8.49,8.238,9.166c-1.781,0.769-3.03,2.337-3.03,4.644 c0,2.953,1.86,4.429,4.253,4.429c2.02,0,3.125-0.477,4.685-2.065c0.516,0.747,0.685,1.109,1.629,1.894 c0.212,0.114,0.483,0.103,0.672-0.066l0.006,0.006c0.567-0.505,1.599-1.401,2.18-1.888c0.231-0.188,0.19-0.496,0.009-0.754 c-0.52-0.718-1.072-1.303-1.072-2.634V8.305c0-1.876,0.133-3.599-1.249-4.891C15.23,2.369,13.422,2,12.04,2 C9.336,2,6.318,3.01,5.686,6.351C5.618,6.706,5.877,6.893,6.109,6.945l2.754,0.298C9.121,7.23,9.308,6.977,9.357,6.72 c0.236-1.151,1.2-1.706,2.284-1.706c0.584,0,1.249,0.215,1.595,0.738c0.398,0.584,0.346,1.384,0.346,2.061V8.182z M13.049,14.088 c-0.451,0.8-1.169,1.291-1.967,1.291c-1.09,0-1.728-0.83-1.728-2.061c0-2.42,2.171-2.86,4.227-2.86v0.615 C13.582,12.181,13.608,13.104,13.049,14.088z M20.683,19.339C18.329,21.076,14.917,22,11.979,22c-4.118,0-7.826-1.522-10.632-4.057 c-0.22-0.199-0.024-0.471,0.241-0.317c3.027,1.762,6.771,2.823,10.639,2.823c2.608,0,5.476-0.541,8.115-1.66 C20.739,18.62,21.072,19.051,20.683,19.339z M21.336,21.043c-0.194,0.163-0.379,0.076-0.293-0.139 c0.284-0.71,0.92-2.298,0.619-2.684c-0.301-0.386-1.99-0.183-2.749-0.092c-0.23,0.027-0.266-0.173-0.059-0.319 c1.348-0.946,3.555-0.673,3.811-0.356C22.925,17.773,22.599,19.986,21.336,21.043z"}))},{name:"bandcamp",attributes:{service:"bandcamp"},title:"Bandcamp",icon:()=>(0,tt.createElement)(mo,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1"},(0,tt.createElement)(uo,{d:"M15.27 17.289 3 17.289 8.73 6.711 21 6.711 15.27 17.289"}))},{name:"behance",attributes:{service:"behance"},title:"Behance",icon:()=>(0,tt.createElement)(mo,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1"},(0,tt.createElement)(uo,{d:"M7.799,5.698c0.589,0,1.12,0.051,1.606,0.156c0.482,0.102,0.894,0.273,1.241,0.507c0.344,0.235,0.612,0.546,0.804,0.938 c0.188,0.387,0.281,0.871,0.281,1.443c0,0.619-0.141,1.137-0.421,1.551c-0.284,0.413-0.7,0.751-1.255,1.014 c0.756,0.218,1.317,0.601,1.689,1.146c0.374,0.549,0.557,1.205,0.557,1.975c0,0.623-0.12,1.161-0.359,1.612 c-0.241,0.457-0.569,0.828-0.973,1.114c-0.408,0.288-0.876,0.5-1.399,0.637C9.052,17.931,8.514,18,7.963,18H2V5.698H7.799 M7.449,10.668c0.481,0,0.878-0.114,1.192-0.345c0.311-0.228,0.463-0.603,0.463-1.119c0-0.286-0.051-0.523-0.152-0.707 C8.848,8.315,8.711,8.171,8.536,8.07C8.362,7.966,8.166,7.894,7.94,7.854c-0.224-0.044-0.457-0.06-0.697-0.06H4.709v2.874H7.449z M7.6,15.905c0.267,0,0.521-0.024,0.759-0.077c0.243-0.053,0.457-0.137,0.637-0.261c0.182-0.12,0.332-0.283,0.441-0.491 C9.547,14.87,9.6,14.602,9.6,14.278c0-0.633-0.18-1.084-0.533-1.357c-0.356-0.27-0.83-0.404-1.413-0.404H4.709v3.388L7.6,15.905z M16.162,15.864c0.367,0.358,0.897,0.538,1.583,0.538c0.493,0,0.92-0.125,1.277-0.374c0.354-0.248,0.571-0.514,0.654-0.79h2.155 c-0.347,1.072-0.872,1.838-1.589,2.299C19.534,18,18.67,18.23,17.662,18.23c-0.701,0-1.332-0.113-1.899-0.337 c-0.567-0.227-1.041-0.544-1.439-0.958c-0.389-0.415-0.689-0.907-0.904-1.484c-0.213-0.574-0.32-1.21-0.32-1.899 c0-0.666,0.11-1.288,0.329-1.863c0.222-0.577,0.529-1.075,0.933-1.492c0.406-0.42,0.885-0.751,1.444-0.994 c0.558-0.241,1.175-0.363,1.857-0.363c0.754,0,1.414,0.145,1.98,0.44c0.563,0.291,1.026,0.686,1.389,1.181 c0.363,0.493,0.622,1.057,0.783,1.69c0.16,0.632,0.217,1.292,0.171,1.983h-6.428C15.557,14.84,15.795,15.506,16.162,15.864 M18.973,11.184c-0.291-0.321-0.783-0.496-1.384-0.496c-0.39,0-0.714,0.066-0.973,0.2c-0.254,0.132-0.461,0.297-0.621,0.491 c-0.157,0.197-0.265,0.405-0.328,0.628c-0.063,0.217-0.101,0.413-0.111,0.587h3.98C19.478,11.969,19.265,11.509,18.973,11.184z M15.057,7.738h4.985V6.524h-4.985L15.057,7.738z"}))},{name:"chain",attributes:{service:"chain"},title:"Link",icon:a7},{name:"codepen",attributes:{service:"codepen"},title:"CodePen",icon:()=>(0,tt.createElement)(mo,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1"},(0,tt.createElement)(uo,{d:"M22.016,8.84c-0.002-0.013-0.005-0.025-0.007-0.037c-0.005-0.025-0.008-0.048-0.015-0.072 c-0.003-0.015-0.01-0.028-0.013-0.042c-0.008-0.02-0.015-0.04-0.023-0.062c-0.007-0.015-0.013-0.028-0.02-0.042 c-0.008-0.02-0.018-0.037-0.03-0.057c-0.007-0.013-0.017-0.027-0.025-0.038c-0.012-0.018-0.023-0.035-0.035-0.052 c-0.01-0.013-0.02-0.025-0.03-0.037c-0.015-0.017-0.028-0.032-0.043-0.045c-0.01-0.012-0.022-0.023-0.035-0.035 c-0.015-0.015-0.032-0.028-0.048-0.04c-0.012-0.01-0.025-0.02-0.037-0.03c-0.005-0.003-0.01-0.008-0.015-0.012l-9.161-6.096 c-0.289-0.192-0.666-0.192-0.955,0L2.359,8.237C2.354,8.24,2.349,8.245,2.344,8.249L2.306,8.277 c-0.017,0.013-0.033,0.027-0.048,0.04C2.246,8.331,2.234,8.342,2.222,8.352c-0.015,0.015-0.028,0.03-0.042,0.047 c-0.012,0.013-0.022,0.023-0.03,0.037C2.139,8.453,2.125,8.471,2.115,8.488C2.107,8.501,2.099,8.514,2.09,8.526 C2.079,8.548,2.069,8.565,2.06,8.585C2.054,8.6,2.047,8.613,2.04,8.626C2.032,8.648,2.025,8.67,2.019,8.69 c-0.005,0.013-0.01,0.027-0.013,0.042C1.999,8.755,1.995,8.778,1.99,8.803C1.989,8.817,1.985,8.828,1.984,8.84 C1.978,8.879,1.975,8.915,1.975,8.954v6.093c0,0.037,0.003,0.075,0.008,0.112c0.002,0.012,0.005,0.025,0.007,0.038 c0.005,0.023,0.008,0.047,0.015,0.072c0.003,0.015,0.008,0.028,0.013,0.04c0.007,0.022,0.013,0.042,0.022,0.063 c0.007,0.015,0.013,0.028,0.02,0.04c0.008,0.02,0.018,0.038,0.03,0.058c0.007,0.013,0.015,0.027,0.025,0.038 c0.012,0.018,0.023,0.035,0.035,0.052c0.01,0.013,0.02,0.025,0.03,0.037c0.013,0.015,0.028,0.032,0.042,0.045 c0.012,0.012,0.023,0.023,0.035,0.035c0.015,0.013,0.032,0.028,0.048,0.04l0.038,0.03c0.005,0.003,0.01,0.007,0.013,0.01 l9.163,6.095C11.668,21.953,11.833,22,12,22c0.167,0,0.332-0.047,0.478-0.144l9.163-6.095l0.015-0.01 c0.013-0.01,0.027-0.02,0.037-0.03c0.018-0.013,0.035-0.028,0.048-0.04c0.013-0.012,0.025-0.023,0.035-0.035 c0.017-0.015,0.03-0.032,0.043-0.045c0.01-0.013,0.02-0.025,0.03-0.037c0.013-0.018,0.025-0.035,0.035-0.052 c0.008-0.013,0.018-0.027,0.025-0.038c0.012-0.02,0.022-0.038,0.03-0.058c0.007-0.013,0.013-0.027,0.02-0.04 c0.008-0.022,0.015-0.042,0.023-0.063c0.003-0.013,0.01-0.027,0.013-0.04c0.007-0.025,0.01-0.048,0.015-0.072 c0.002-0.013,0.005-0.027,0.007-0.037c0.003-0.042,0.007-0.079,0.007-0.117V8.954C22.025,8.915,22.022,8.879,22.016,8.84z M12.862,4.464l6.751,4.49l-3.016,2.013l-3.735-2.492V4.464z M11.138,4.464v4.009l-3.735,2.494L4.389,8.954L11.138,4.464z M3.699,10.562L5.853,12l-2.155,1.438V10.562z M11.138,19.536l-6.749-4.491l3.015-2.011l3.735,2.492V19.536z M12,14.035L8.953,12 L12,9.966L15.047,12L12,14.035z M12.862,19.536v-4.009l3.735-2.492l3.016,2.011L12.862,19.536z M20.303,13.438L18.147,12 l2.156-1.438L20.303,13.438z"}))},{name:"deviantart",attributes:{service:"deviantart"},title:"DeviantArt",icon:()=>(0,tt.createElement)(mo,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1"},(0,tt.createElement)(uo,{d:"M 18.19 5.636 18.19 2 18.188 2 14.553 2 14.19 2.366 12.474 5.636 11.935 6 5.81 6 5.81 10.994 9.177 10.994 9.477 11.357 5.81 18.363 5.81 22 5.811 22 9.447 22 9.81 21.634 11.526 18.364 12.065 18 18.19 18 18.19 13.006 14.823 13.006 14.523 12.641 18.19 5.636z"}))},{name:"dribbble",attributes:{service:"dribbble"},title:"Dribbble",icon:()=>(0,tt.createElement)(mo,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1"},(0,tt.createElement)(uo,{d:"M12,22C6.486,22,2,17.514,2,12S6.486,2,12,2c5.514,0,10,4.486,10,10S17.514,22,12,22z M20.434,13.369 c-0.292-0.092-2.644-0.794-5.32-0.365c1.117,3.07,1.572,5.57,1.659,6.09C18.689,17.798,20.053,15.745,20.434,13.369z M15.336,19.876c-0.127-0.749-0.623-3.361-1.822-6.477c-0.019,0.006-0.038,0.013-0.056,0.019c-4.818,1.679-6.547,5.02-6.701,5.334 c1.448,1.129,3.268,1.803,5.243,1.803C13.183,20.555,14.311,20.313,15.336,19.876z M5.654,17.724 c0.193-0.331,2.538-4.213,6.943-5.637c0.111-0.036,0.224-0.07,0.337-0.102c-0.214-0.485-0.448-0.971-0.692-1.45 c-4.266,1.277-8.405,1.223-8.778,1.216c-0.003,0.087-0.004,0.174-0.004,0.261C3.458,14.207,4.29,16.21,5.654,17.724z M3.639,10.264 c0.382,0.005,3.901,0.02,7.897-1.041c-1.415-2.516-2.942-4.631-3.167-4.94C5.979,5.41,4.193,7.613,3.639,10.264z M9.998,3.709 c0.236,0.316,1.787,2.429,3.187,5c3.037-1.138,4.323-2.867,4.477-3.085C16.154,4.286,14.17,3.471,12,3.471 C11.311,3.471,10.641,3.554,9.998,3.709z M18.612,6.612C18.432,6.855,17,8.69,13.842,9.979c0.199,0.407,0.389,0.821,0.567,1.237 c0.063,0.148,0.124,0.295,0.184,0.441c2.842-0.357,5.666,0.215,5.948,0.275C20.522,9.916,19.801,8.065,18.612,6.612z"}))},{name:"dropbox",attributes:{service:"dropbox"},title:"Dropbox",icon:()=>(0,tt.createElement)(mo,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1"},(0,tt.createElement)(uo,{d:"M12,6.134L6.069,9.797L2,6.54l5.883-3.843L12,6.134z M2,13.054l5.883,3.843L12,13.459L6.069,9.797L2,13.054z M12,13.459 l4.116,3.439L22,13.054l-4.069-3.257L12,13.459z M22,6.54l-5.884-3.843L12,6.134l5.931,3.663L22,6.54z M12.011,14.2l-4.129,3.426 l-1.767-1.153v1.291l5.896,3.539l5.897-3.539v-1.291l-1.769,1.153L12.011,14.2z"}))},{name:"etsy",attributes:{service:"etsy"},title:"Etsy",icon:()=>(0,tt.createElement)(mo,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1"},(0,tt.createElement)(uo,{d:"M9.16033,4.038c0-.27174.02717-.43478.48913-.43478h6.22283c1.087,0,1.68478.92391,2.11957,2.663l.35326,1.38587h1.05978C19.59511,3.712,19.75815,2,19.75815,2s-2.663.29891-4.23913.29891h-7.962L3.29076,2.163v1.1413L4.731,3.57609c1.00543.19022,1.25.40761,1.33152,1.33152,0,0,.08152,2.71739.08152,7.20109s-.08152,7.17391-.08152,7.17391c0,.81522-.32609,1.11413-1.33152,1.30435l-1.44022.27174V22l4.2663-.13587h7.11957c1.60326,0,5.32609.13587,5.32609.13587.08152-.97826.625-5.40761.70652-5.89674H19.7038L18.644,18.52174c-.84239,1.90217-2.06522,2.038-3.42391,2.038H11.1712c-1.3587,0-2.01087-.54348-2.01087-1.712V12.65217s3.0163,0,3.99457.08152c.76087.05435,1.22283.27174,1.46739,1.33152l.32609,1.413h1.16848l-.08152-3.55978.163-3.587H15.02989l-.38043,1.57609c-.24457,1.03261-.40761,1.22283-1.46739,1.33152-1.38587.13587-4.02174.1087-4.02174.1087Z"}))},{name:"facebook",attributes:{service:"facebook"},title:"Facebook",icon:()=>(0,tt.createElement)(mo,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1"},(0,tt.createElement)(uo,{d:"M12 2C6.5 2 2 6.5 2 12c0 5 3.7 9.1 8.4 9.9v-7H7.9V12h2.5V9.8c0-2.5 1.5-3.9 3.8-3.9 1.1 0 2.2.2 2.2.2v2.5h-1.3c-1.2 0-1.6.8-1.6 1.6V12h2.8l-.4 2.9h-2.3v7C18.3 21.1 22 17 22 12c0-5.5-4.5-10-10-10z"}))},{name:"feed",attributes:{service:"feed"},title:"RSS Feed",icon:()=>(0,tt.createElement)(mo,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1"},(0,tt.createElement)(uo,{d:"M2,8.667V12c5.515,0,10,4.485,10,10h3.333C15.333,14.637,9.363,8.667,2,8.667z M2,2v3.333 c9.19,0,16.667,7.477,16.667,16.667H22C22,10.955,13.045,2,2,2z M4.5,17C3.118,17,2,18.12,2,19.5S3.118,22,4.5,22S7,20.88,7,19.5 S5.882,17,4.5,17z"}))},{name:"flickr",attributes:{service:"flickr"},title:"Flickr",icon:()=>(0,tt.createElement)(mo,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1"},(0,tt.createElement)(uo,{d:"M6.5,7c-2.75,0-5,2.25-5,5s2.25,5,5,5s5-2.25,5-5S9.25,7,6.5,7z M17.5,7c-2.75,0-5,2.25-5,5s2.25,5,5,5s5-2.25,5-5 S20.25,7,17.5,7z"}))},{name:"foursquare",attributes:{service:"foursquare"},title:"Foursquare",icon:()=>(0,tt.createElement)(mo,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1"},(0,tt.createElement)(uo,{d:"M17.573,2c0,0-9.197,0-10.668,0S5,3.107,5,3.805s0,16.948,0,16.948c0,0.785,0.422,1.077,0.66,1.172 c0.238,0.097,0.892,0.177,1.285-0.275c0,0,5.035-5.843,5.122-5.93c0.132-0.132,0.132-0.132,0.262-0.132h3.26 c1.368,0,1.588-0.977,1.732-1.552c0.078-0.318,0.692-3.428,1.225-6.122l0.675-3.368C19.56,2.893,19.14,2,17.573,2z M16.495,7.22 c-0.053,0.252-0.372,0.518-0.665,0.518c-0.293,0-4.157,0-4.157,0c-0.467,0-0.802,0.318-0.802,0.787v0.508 c0,0.467,0.337,0.798,0.805,0.798c0,0,3.197,0,3.528,0s0.655,0.362,0.583,0.715c-0.072,0.353-0.407,2.102-0.448,2.295 c-0.04,0.193-0.262,0.523-0.655,0.523c-0.33,0-2.88,0-2.88,0c-0.523,0-0.683,0.068-1.033,0.503 c-0.35,0.437-3.505,4.223-3.505,4.223c-0.032,0.035-0.063,0.027-0.063-0.015V4.852c0-0.298,0.26-0.648,0.648-0.648 c0,0,8.228,0,8.562,0c0.315,0,0.61,0.297,0.528,0.683L16.495,7.22z"}))},{name:"goodreads",attributes:{service:"goodreads"},title:"Goodreads",icon:()=>(0,tt.createElement)(mo,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1"},(0,tt.createElement)(uo,{d:"M17.3,17.5c-0.2,0.8-0.5,1.4-1,1.9c-0.4,0.5-1,0.9-1.7,1.2C13.9,20.9,13.1,21,12,21c-0.6,0-1.3-0.1-1.9-0.2 c-0.6-0.1-1.1-0.4-1.6-0.7c-0.5-0.3-0.9-0.7-1.2-1.2c-0.3-0.5-0.5-1.1-0.5-1.7h1.5c0.1,0.5,0.2,0.9,0.5,1.2 c0.2,0.3,0.5,0.6,0.9,0.8c0.3,0.2,0.7,0.3,1.1,0.4c0.4,0.1,0.8,0.1,1.2,0.1c1.4,0,2.5-0.4,3.1-1.2c0.6-0.8,1-2,1-3.5v-1.7h0 c-0.4,0.8-0.9,1.4-1.6,1.9c-0.7,0.5-1.5,0.7-2.4,0.7c-1,0-1.9-0.2-2.6-0.5C8.7,15,8.1,14.5,7.7,14c-0.5-0.6-0.8-1.3-1-2.1 c-0.2-0.8-0.3-1.6-0.3-2.5c0-0.9,0.1-1.7,0.4-2.5c0.3-0.8,0.6-1.5,1.1-2c0.5-0.6,1.1-1,1.8-1.4C10.3,3.2,11.1,3,12,3 c0.5,0,0.9,0.1,1.3,0.2c0.4,0.1,0.8,0.3,1.1,0.5c0.3,0.2,0.6,0.5,0.9,0.8c0.3,0.3,0.5,0.6,0.6,1h0V3.4h1.5V15 C17.6,15.9,17.5,16.7,17.3,17.5z M13.8,14.1c0.5-0.3,0.9-0.7,1.3-1.1c0.3-0.5,0.6-1,0.8-1.6c0.2-0.6,0.3-1.2,0.3-1.9 c0-0.6-0.1-1.2-0.2-1.9c-0.1-0.6-0.4-1.2-0.7-1.7c-0.3-0.5-0.7-0.9-1.3-1.2c-0.5-0.3-1.1-0.5-1.9-0.5s-1.4,0.2-1.9,0.5 c-0.5,0.3-1,0.7-1.3,1.2C8.5,6.4,8.3,7,8.1,7.6C8,8.2,7.9,8.9,7.9,9.5c0,0.6,0.1,1.3,0.2,1.9C8.3,12,8.6,12.5,8.9,13 c0.3,0.5,0.8,0.8,1.3,1.1c0.5,0.3,1.1,0.4,1.9,0.4C12.7,14.5,13.3,14.4,13.8,14.1z"}))},{name:"google",attributes:{service:"google"},title:"Google",icon:()=>(0,tt.createElement)(mo,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1"},(0,tt.createElement)(uo,{d:"M12.02,10.18v3.72v0.01h5.51c-0.26,1.57-1.67,4.22-5.5,4.22c-3.31,0-6.01-2.75-6.01-6.12s2.7-6.12,6.01-6.12 c1.87,0,3.13,0.8,3.85,1.48l2.84-2.76C16.99,2.99,14.73,2,12.03,2c-5.52,0-10,4.48-10,10s4.48,10,10,10c5.77,0,9.6-4.06,9.6-9.77 c0-0.83-0.11-1.42-0.25-2.05H12.02z"}))},{name:"github",attributes:{service:"github"},title:"GitHub",icon:()=>(0,tt.createElement)(mo,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1"},(0,tt.createElement)(uo,{d:"M12,2C6.477,2,2,6.477,2,12c0,4.419,2.865,8.166,6.839,9.489c0.5,0.09,0.682-0.218,0.682-0.484 c0-0.236-0.009-0.866-0.014-1.699c-2.782,0.602-3.369-1.34-3.369-1.34c-0.455-1.157-1.11-1.465-1.11-1.465 c-0.909-0.62,0.069-0.608,0.069-0.608c1.004,0.071,1.532,1.03,1.532,1.03c0.891,1.529,2.341,1.089,2.91,0.833 c0.091-0.647,0.349-1.086,0.635-1.337c-2.22-0.251-4.555-1.111-4.555-4.943c0-1.091,0.39-1.984,1.03-2.682 C6.546,8.54,6.202,7.524,6.746,6.148c0,0,0.84-0.269,2.75,1.025C10.295,6.95,11.15,6.84,12,6.836 c0.85,0.004,1.705,0.114,2.504,0.336c1.909-1.294,2.748-1.025,2.748-1.025c0.546,1.376,0.202,2.394,0.1,2.646 c0.64,0.699,1.026,1.591,1.026,2.682c0,3.841-2.337,4.687-4.565,4.935c0.359,0.307,0.679,0.917,0.679,1.852 c0,1.335-0.012,2.415-0.012,2.741c0,0.269,0.18,0.579,0.688,0.481C19.138,20.161,22,16.416,22,12C22,6.477,17.523,2,12,2z"}))},{name:"instagram",attributes:{service:"instagram"},title:"Instagram",icon:()=>(0,tt.createElement)(mo,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1"},(0,tt.createElement)(uo,{d:"M12,4.622c2.403,0,2.688,0.009,3.637,0.052c0.877,0.04,1.354,0.187,1.671,0.31c0.42,0.163,0.72,0.358,1.035,0.673 c0.315,0.315,0.51,0.615,0.673,1.035c0.123,0.317,0.27,0.794,0.31,1.671c0.043,0.949,0.052,1.234,0.052,3.637 s-0.009,2.688-0.052,3.637c-0.04,0.877-0.187,1.354-0.31,1.671c-0.163,0.42-0.358,0.72-0.673,1.035 c-0.315,0.315-0.615,0.51-1.035,0.673c-0.317,0.123-0.794,0.27-1.671,0.31c-0.949,0.043-1.233,0.052-3.637,0.052 s-2.688-0.009-3.637-0.052c-0.877-0.04-1.354-0.187-1.671-0.31c-0.42-0.163-0.72-0.358-1.035-0.673 c-0.315-0.315-0.51-0.615-0.673-1.035c-0.123-0.317-0.27-0.794-0.31-1.671C4.631,14.688,4.622,14.403,4.622,12 s0.009-2.688,0.052-3.637c0.04-0.877,0.187-1.354,0.31-1.671c0.163-0.42,0.358-0.72,0.673-1.035 c0.315-0.315,0.615-0.51,1.035-0.673c0.317-0.123,0.794-0.27,1.671-0.31C9.312,4.631,9.597,4.622,12,4.622 M12,3 C9.556,3,9.249,3.01,8.289,3.054C7.331,3.098,6.677,3.25,6.105,3.472C5.513,3.702,5.011,4.01,4.511,4.511 c-0.5,0.5-0.808,1.002-1.038,1.594C3.25,6.677,3.098,7.331,3.054,8.289C3.01,9.249,3,9.556,3,12c0,2.444,0.01,2.751,0.054,3.711 c0.044,0.958,0.196,1.612,0.418,2.185c0.23,0.592,0.538,1.094,1.038,1.594c0.5,0.5,1.002,0.808,1.594,1.038 c0.572,0.222,1.227,0.375,2.185,0.418C9.249,20.99,9.556,21,12,21s2.751-0.01,3.711-0.054c0.958-0.044,1.612-0.196,2.185-0.418 c0.592-0.23,1.094-0.538,1.594-1.038c0.5-0.5,0.808-1.002,1.038-1.594c0.222-0.572,0.375-1.227,0.418-2.185 C20.99,14.751,21,14.444,21,12s-0.01-2.751-0.054-3.711c-0.044-0.958-0.196-1.612-0.418-2.185c-0.23-0.592-0.538-1.094-1.038-1.594 c-0.5-0.5-1.002-0.808-1.594-1.038c-0.572-0.222-1.227-0.375-2.185-0.418C14.751,3.01,14.444,3,12,3L12,3z M12,7.378 c-2.552,0-4.622,2.069-4.622,4.622S9.448,16.622,12,16.622s4.622-2.069,4.622-4.622S14.552,7.378,12,7.378z M12,15 c-1.657,0-3-1.343-3-3s1.343-3,3-3s3,1.343,3,3S13.657,15,12,15z M16.804,6.116c-0.596,0-1.08,0.484-1.08,1.08 s0.484,1.08,1.08,1.08c0.596,0,1.08-0.484,1.08-1.08S17.401,6.116,16.804,6.116z"}))},{name:"lastfm",attributes:{service:"lastfm"},title:"Last.fm",icon:()=>(0,tt.createElement)(mo,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1"},(0,tt.createElement)(uo,{d:"M 12.0002 1.5 C 6.2006 1.5 1.5 6.2011 1.5 11.9998 C 1.5 17.799 6.2006 22.5 12.0002 22.5 C 17.799 22.5 22.5 17.799 22.5 11.9998 C 22.5 6.2011 17.799 1.5 12.0002 1.5 Z M 16.1974 16.2204 C 14.8164 16.2152 13.9346 15.587 13.3345 14.1859 L 13.1816 13.8451 L 11.8541 10.8101 C 11.4271 9.7688 10.3526 9.0712 9.1801 9.0712 C 7.5695 9.0712 6.2593 10.3851 6.2593 12.001 C 6.2593 13.6165 7.5695 14.9303 9.1801 14.9303 C 10.272 14.9303 11.2651 14.3275 11.772 13.3567 C 11.7893 13.3235 11.8239 13.302 11.863 13.3038 C 11.9007 13.3054 11.9353 13.3288 11.9504 13.3632 L 12.4865 14.6046 C 12.5016 14.639 12.4956 14.6778 12.4723 14.7069 C 11.6605 15.6995 10.4602 16.2683 9.1801 16.2683 C 6.8331 16.2683 4.9234 14.3536 4.9234 12.001 C 4.9234 9.6468 6.833 7.732 9.1801 7.732 C 10.9572 7.732 12.3909 8.6907 13.1138 10.3636 C 13.1206 10.3802 13.8412 12.0708 14.4744 13.5191 C 14.8486 14.374 15.1462 14.896 16.1288 14.9292 C 17.0663 14.9613 17.7538 14.4122 17.7538 13.6485 C 17.7538 12.9691 17.3321 12.8004 16.3803 12.4822 C 14.7365 11.9398 13.845 11.3861 13.845 10.0182 C 13.845 8.6809 14.7667 7.8162 16.192 7.8162 C 17.1288 7.8162 17.8155 8.2287 18.2921 9.0768 C 18.305 9.1006 18.3079 9.1281 18.3004 9.1542 C 18.2929 9.1803 18.2748 9.2021 18.2507 9.2138 L 17.3614 9.669 C 17.3178 9.692 17.2643 9.6781 17.2356 9.6385 C 16.9329 9.2135 16.5956 9.0251 16.1423 9.0251 C 15.5512 9.0251 15.122 9.429 15.122 9.9865 C 15.122 10.6738 15.6529 10.8414 16.5339 11.1192 C 16.6491 11.1558 16.7696 11.194 16.8939 11.2343 C 18.2763 11.6865 19.0768 12.2311 19.0768 13.6836 C 19.0769 15.1297 17.8389 16.2204 16.1974 16.2204 Z"}))},{name:"linkedin",attributes:{service:"linkedin"},title:"LinkedIn",icon:()=>(0,tt.createElement)(mo,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1"},(0,tt.createElement)(uo,{d:"M19.7,3H4.3C3.582,3,3,3.582,3,4.3v15.4C3,20.418,3.582,21,4.3,21h15.4c0.718,0,1.3-0.582,1.3-1.3V4.3 C21,3.582,20.418,3,19.7,3z M8.339,18.338H5.667v-8.59h2.672V18.338z M7.004,8.574c-0.857,0-1.549-0.694-1.549-1.548 c0-0.855,0.691-1.548,1.549-1.548c0.854,0,1.547,0.694,1.547,1.548C8.551,7.881,7.858,8.574,7.004,8.574z M18.339,18.338h-2.669 v-4.177c0-0.996-0.017-2.278-1.387-2.278c-1.389,0-1.601,1.086-1.601,2.206v4.249h-2.667v-8.59h2.559v1.174h0.037 c0.356-0.675,1.227-1.387,2.526-1.387c2.703,0,3.203,1.779,3.203,4.092V18.338z"}))},{name:"mail",attributes:{service:"mail"},title:"Mail",keywords:["email","e-mail"],icon:()=>(0,tt.createElement)(mo,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1"},(0,tt.createElement)(uo,{d:"M20,4H4C2.895,4,2,4.895,2,6v12c0,1.105,0.895,2,2,2h16c1.105,0,2-0.895,2-2V6C22,4.895,21.105,4,20,4z M20,8.236l-8,4.882 L4,8.236V6h16V8.236z"}))},{name:"mastodon",attributes:{service:"mastodon"},title:"Mastodon",icon:()=>(0,tt.createElement)(mo,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1"},(0,tt.createElement)(uo,{d:"M23.193 7.879c0-5.206-3.411-6.732-3.411-6.732C18.062.357 15.108.025 12.041 0h-.076c-3.068.025-6.02.357-7.74 1.147 0 0-3.411 1.526-3.411 6.732 0 1.192-.023 2.618.015 4.129.124 5.092.934 10.109 5.641 11.355 2.17.574 4.034.695 5.535.612 2.722-.15 4.25-.972 4.25-.972l-.09-1.975s-1.945.613-4.129.539c-2.165-.074-4.449-.233-4.799-2.891a5.499 5.499 0 0 1-.048-.745s2.125.52 4.817.643c1.646.075 3.19-.097 4.758-.283 3.007-.359 5.625-2.212 5.954-3.905.517-2.665.475-6.507.475-6.507zm-4.024 6.709h-2.497V8.469c0-1.29-.543-1.944-1.628-1.944-1.2 0-1.802.776-1.802 2.312v3.349h-2.483v-3.35c0-1.536-.602-2.312-1.802-2.312-1.085 0-1.628.655-1.628 1.944v6.119H4.832V8.284c0-1.289.328-2.313.987-3.07.68-.758 1.569-1.146 2.674-1.146 1.278 0 2.246.491 2.886 1.474L12 6.585l.622-1.043c.64-.983 1.608-1.474 2.886-1.474 1.104 0 1.994.388 2.674 1.146.658.757.986 1.781.986 3.07v6.304z"}))},{name:"meetup",attributes:{service:"meetup"},title:"Meetup",icon:()=>(0,tt.createElement)(mo,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1"},(0,tt.createElement)(uo,{d:"M19.24775,14.722a3.57032,3.57032,0,0,1-2.94457,3.52073,3.61886,3.61886,0,0,1-.64652.05634c-.07314-.0008-.10187.02846-.12507.09547A2.38881,2.38881,0,0,1,13.49453,20.094a2.33092,2.33092,0,0,1-1.827-.50716.13635.13635,0,0,0-.19878-.00408,3.191,3.191,0,0,1-2.104.60248,3.26309,3.26309,0,0,1-3.00324-2.71993,2.19076,2.19076,0,0,1-.03512-.30865c-.00156-.08579-.03413-.1189-.11608-.13493a2.86421,2.86421,0,0,1-1.23189-.56111,2.945,2.945,0,0,1-1.166-2.05749,2.97484,2.97484,0,0,1,.87524-2.50774.112.112,0,0,0,.02091-.16107,2.7213,2.7213,0,0,1-.36648-1.48A2.81256,2.81256,0,0,1,6.57673,7.58838a.35764.35764,0,0,0,.28869-.22819,4.2208,4.2208,0,0,1,6.02892-1.90111.25161.25161,0,0,0,.22023.0243,3.65608,3.65608,0,0,1,3.76031.90678A3.57244,3.57244,0,0,1,17.95918,8.626a2.97339,2.97339,0,0,1,.01829.57356.10637.10637,0,0,0,.0853.12792,1.97669,1.97669,0,0,1,1.27939,1.33733,2.00266,2.00266,0,0,1-.57112,2.12652c-.05284.05166-.04168.08328-.01173.13489A3.51189,3.51189,0,0,1,19.24775,14.722Zm-6.35959-.27836a1.6984,1.6984,0,0,0,1.14556,1.61113,3.82039,3.82039,0,0,0,1.036.17935,1.46888,1.46888,0,0,0,.73509-.12255.44082.44082,0,0,0,.26057-.44274.45312.45312,0,0,0-.29211-.43375.97191.97191,0,0,0-.20678-.063c-.21326-.03806-.42754-.0701-.63973-.11215a.54787.54787,0,0,1-.50172-.60926,2.75864,2.75864,0,0,1,.1773-.901c.1763-.535.414-1.045.64183-1.55913A12.686,12.686,0,0,0,15.85,10.47863a1.58461,1.58461,0,0,0,.04861-.87208,1.04531,1.04531,0,0,0-.85432-.83981,1.60658,1.60658,0,0,0-1.23654.16594.27593.27593,0,0,1-.36286-.03413c-.085-.0747-.16594-.15379-.24918-.23055a.98682.98682,0,0,0-1.33577-.04933,6.1468,6.1468,0,0,1-.4989.41615.47762.47762,0,0,1-.51535.03566c-.17448-.09307-.35512-.175-.53531-.25665a1.74949,1.74949,0,0,0-.56476-.2016,1.69943,1.69943,0,0,0-1.61654.91787,8.05815,8.05815,0,0,0-.32952.80126c-.45471,1.2557-.82507,2.53825-1.20838,3.81639a1.24151,1.24151,0,0,0,.51532,1.44389,1.42659,1.42659,0,0,0,1.22008.17166,1.09728,1.09728,0,0,0,.66994-.69764c.44145-1.04111.839-2.09989,1.25981-3.14926.11581-.28876.22792-.57874.35078-.86438a.44548.44548,0,0,1,.69189-.19539.50521.50521,0,0,1,.15044.43836,1.75625,1.75625,0,0,1-.14731.50453c-.27379.69219-.55265,1.38236-.82766,2.074a2.0836,2.0836,0,0,0-.14038.42876.50719.50719,0,0,0,.27082.57722.87236.87236,0,0,0,.66145.02739.99137.99137,0,0,0,.53406-.532q.61571-1.20914,1.228-2.42031.28423-.55863.57585-1.1133a.87189.87189,0,0,1,.29055-.35253.34987.34987,0,0,1,.37634-.01265.30291.30291,0,0,1,.12434.31459.56716.56716,0,0,1-.04655.1915c-.05318.12739-.10286.25669-.16183.38156-.34118.71775-.68754,1.43273-1.02568,2.152A2.00213,2.00213,0,0,0,12.88816,14.44366Zm4.78568,5.28972a.88573.88573,0,0,0-1.77139.00465.8857.8857,0,0,0,1.77139-.00465Zm-14.83838-7.296a.84329.84329,0,1,0,.00827-1.68655.8433.8433,0,0,0-.00827,1.68655Zm10.366-9.43673a.83506.83506,0,1,0-.0091,1.67.83505.83505,0,0,0,.0091-1.67Zm6.85014,5.22a.71651.71651,0,0,0-1.433.0093.71656.71656,0,0,0,1.433-.0093ZM5.37528,6.17908A.63823.63823,0,1,0,6.015,5.54483.62292.62292,0,0,0,5.37528,6.17908Zm6.68214,14.80843a.54949.54949,0,1,0-.55052.541A.54556.54556,0,0,0,12.05742,20.98752Zm8.53235-8.49689a.54777.54777,0,0,0-.54027.54023.53327.53327,0,0,0,.532.52293.51548.51548,0,0,0,.53272-.5237A.53187.53187,0,0,0,20.58977,12.49063ZM7.82846,2.4715a.44927.44927,0,1,0,.44484.44766A.43821.43821,0,0,0,7.82846,2.4715Zm13.775,7.60492a.41186.41186,0,0,0-.40065.39623.40178.40178,0,0,0,.40168.40168A.38994.38994,0,0,0,22,10.48172.39946.39946,0,0,0,21.60349,10.07642ZM5.79193,17.96207a.40469.40469,0,0,0-.397-.39646.399.399,0,0,0-.396.405.39234.39234,0,0,0,.39939.389A.39857.39857,0,0,0,5.79193,17.96207Z"}))},{name:"medium",attributes:{service:"medium"},title:"Medium",icon:()=>(0,tt.createElement)(mo,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1"},(0,tt.createElement)(uo,{d:"M20.962,7.257l-5.457,8.867l-3.923-6.375l3.126-5.08c0.112-0.182,0.319-0.286,0.527-0.286c0.05,0,0.1,0.008,0.149,0.02 c0.039,0.01,0.078,0.023,0.114,0.041l5.43,2.715l0.006,0.003c0.004,0.002,0.007,0.006,0.011,0.008 C20.971,7.191,20.98,7.227,20.962,7.257z M9.86,8.592v5.783l5.14,2.57L9.86,8.592z M15.772,17.331l4.231,2.115 C20.554,19.721,21,19.529,21,19.016V8.835L15.772,17.331z M8.968,7.178L3.665,4.527C3.569,4.479,3.478,4.456,3.395,4.456 C3.163,4.456,3,4.636,3,4.938v11.45c0,0.306,0.224,0.669,0.498,0.806l4.671,2.335c0.12,0.06,0.234,0.088,0.337,0.088 c0.29,0,0.494-0.225,0.494-0.602V7.231C9,7.208,8.988,7.188,8.968,7.178z"}))},{name:"patreon",attributes:{service:"patreon"},title:"Patreon",icon:()=>(0,tt.createElement)(mo,{width:"24",height:"24",viewBox:"0 0 569 546",version:"1.1"},(0,tt.createElement)(lo,{cx:"363",cy:"205",r:"205"}),(0,tt.createElement)(po,{width:"100",height:"546",x:"0",y:"0"}))},{name:"pinterest",attributes:{service:"pinterest"},title:"Pinterest",icon:()=>(0,tt.createElement)(mo,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1"},(0,tt.createElement)(uo,{d:"M12.289,2C6.617,2,3.606,5.648,3.606,9.622c0,1.846,1.025,4.146,2.666,4.878c0.25,0.111,0.381,0.063,0.439-0.169 c0.044-0.175,0.267-1.029,0.365-1.428c0.032-0.128,0.017-0.237-0.091-0.362C6.445,11.911,6.01,10.75,6.01,9.668 c0-2.777,2.194-5.464,5.933-5.464c3.23,0,5.49,2.108,5.49,5.122c0,3.407-1.794,5.768-4.13,5.768c-1.291,0-2.257-1.021-1.948-2.277 c0.372-1.495,1.089-3.112,1.089-4.191c0-0.967-0.542-1.775-1.663-1.775c-1.319,0-2.379,1.309-2.379,3.059 c0,1.115,0.394,1.869,0.394,1.869s-1.302,5.279-1.54,6.261c-0.405,1.666,0.053,4.368,0.094,4.604 c0.021,0.126,0.167,0.169,0.25,0.063c0.129-0.165,1.699-2.419,2.142-4.051c0.158-0.59,0.817-2.995,0.817-2.995 c0.43,0.784,1.681,1.446,3.013,1.446c3.963,0,6.822-3.494,6.822-7.833C20.394,5.112,16.849,2,12.289,2"}))},{name:"pocket",attributes:{service:"pocket"},title:"Pocket",icon:()=>(0,tt.createElement)(mo,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1"},(0,tt.createElement)(uo,{d:"M21.927,4.194C21.667,3.48,20.982,3,20.222,3h-0.01h-1.721H3.839C3.092,3,2.411,3.47,2.145,4.17 C2.066,4.378,2.026,4.594,2.026,4.814v6.035l0.069,1.2c0.29,2.73,1.707,5.115,3.899,6.778c0.039,0.03,0.079,0.059,0.119,0.089 l0.025,0.018c1.175,0.859,2.491,1.441,3.91,1.727c0.655,0.132,1.325,0.2,1.991,0.2c0.615,0,1.232-0.057,1.839-0.17 c0.073-0.014,0.145-0.028,0.219-0.044c0.02-0.004,0.042-0.012,0.064-0.023c1.359-0.297,2.621-0.864,3.753-1.691l0.025-0.018 c0.04-0.029,0.08-0.058,0.119-0.089c2.192-1.664,3.609-4.049,3.898-6.778l0.069-1.2V4.814C22.026,4.605,22,4.398,21.927,4.194z M17.692,10.481l-4.704,4.512c-0.266,0.254-0.608,0.382-0.949,0.382c-0.342,0-0.684-0.128-0.949-0.382l-4.705-4.512 C5.838,9.957,5.82,9.089,6.344,8.542c0.524-0.547,1.392-0.565,1.939-0.04l3.756,3.601l3.755-3.601 c0.547-0.524,1.415-0.506,1.939,0.04C18.256,9.089,18.238,9.956,17.692,10.481z"}))},{name:"reddit",attributes:{service:"reddit"},title:"Reddit",icon:()=>(0,tt.createElement)(mo,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1"},(0,tt.createElement)(uo,{d:"M22,11.816c0-1.256-1.021-2.277-2.277-2.277c-0.593,0-1.122,0.24-1.526,0.614c-1.481-0.965-3.455-1.594-5.647-1.69 l1.171-3.702l3.18,0.748c0.008,1.028,0.846,1.862,1.876,1.862c1.035,0,1.877-0.842,1.877-1.878c0-1.035-0.842-1.877-1.877-1.877 c-0.769,0-1.431,0.466-1.72,1.13l-3.508-0.826c-0.203-0.047-0.399,0.067-0.46,0.261l-1.35,4.268 c-2.316,0.038-4.411,0.67-5.97,1.671C5.368,9.765,4.853,9.539,4.277,9.539C3.021,9.539,2,10.56,2,11.816 c0,0.814,0.433,1.523,1.078,1.925c-0.037,0.221-0.061,0.444-0.061,0.672c0,3.292,4.011,5.97,8.941,5.97s8.941-2.678,8.941-5.97 c0-0.214-0.02-0.424-0.053-0.632C21.533,13.39,22,12.661,22,11.816z M18.776,4.394c0.606,0,1.1,0.493,1.1,1.1s-0.493,1.1-1.1,1.1 s-1.1-0.494-1.1-1.1S18.169,4.394,18.776,4.394z M2.777,11.816c0-0.827,0.672-1.5,1.499-1.5c0.313,0,0.598,0.103,0.838,0.269 c-0.851,0.676-1.477,1.479-1.812,2.36C2.983,12.672,2.777,12.27,2.777,11.816z M11.959,19.606c-4.501,0-8.164-2.329-8.164-5.193 S7.457,9.22,11.959,9.22s8.164,2.329,8.164,5.193S16.46,19.606,11.959,19.606z M20.636,13.001c-0.326-0.89-0.948-1.701-1.797-2.384 c0.248-0.186,0.55-0.301,0.883-0.301c0.827,0,1.5,0.673,1.5,1.5C21.223,12.299,20.992,12.727,20.636,13.001z M8.996,14.704 c-0.76,0-1.397-0.616-1.397-1.376c0-0.76,0.637-1.397,1.397-1.397c0.76,0,1.376,0.637,1.376,1.397 C10.372,14.088,9.756,14.704,8.996,14.704z M16.401,13.328c0,0.76-0.616,1.376-1.376,1.376c-0.76,0-1.399-0.616-1.399-1.376 c0-0.76,0.639-1.397,1.399-1.397C15.785,11.931,16.401,12.568,16.401,13.328z M15.229,16.708c0.152,0.152,0.152,0.398,0,0.55 c-0.674,0.674-1.727,1.002-3.219,1.002c-0.004,0-0.007-0.002-0.011-0.002c-0.004,0-0.007,0.002-0.011,0.002 c-1.492,0-2.544-0.328-3.218-1.002c-0.152-0.152-0.152-0.398,0-0.55c0.152-0.152,0.399-0.151,0.55,0 c0.521,0.521,1.394,0.775,2.669,0.775c0.004,0,0.007,0.002,0.011,0.002c0.004,0,0.007-0.002,0.011-0.002 c1.275,0,2.148-0.253,2.669-0.775C14.831,16.556,15.078,16.556,15.229,16.708z"}))},{name:"skype",attributes:{service:"skype"},title:"Skype",icon:()=>(0,tt.createElement)(mo,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1"},(0,tt.createElement)(uo,{d:"M10.113,2.699c0.033-0.006,0.067-0.013,0.1-0.02c0.033,0.017,0.066,0.033,0.098,0.051L10.113,2.699z M2.72,10.223 c-0.006,0.034-0.011,0.069-0.017,0.103c0.018,0.032,0.033,0.064,0.051,0.095L2.72,10.223z M21.275,13.771 c0.007-0.035,0.011-0.071,0.018-0.106c-0.018-0.031-0.033-0.064-0.052-0.095L21.275,13.771z M13.563,21.199 c0.032,0.019,0.065,0.035,0.096,0.053c0.036-0.006,0.071-0.011,0.105-0.017L13.563,21.199z M22,16.386 c0,1.494-0.581,2.898-1.637,3.953c-1.056,1.057-2.459,1.637-3.953,1.637c-0.967,0-1.914-0.251-2.75-0.725 c0.036-0.006,0.071-0.011,0.105-0.017l-0.202-0.035c0.032,0.019,0.065,0.035,0.096,0.053c-0.543,0.096-1.099,0.147-1.654,0.147 c-1.275,0-2.512-0.25-3.676-0.743c-1.125-0.474-2.135-1.156-3.002-2.023c-0.867-0.867-1.548-1.877-2.023-3.002 c-0.493-1.164-0.743-2.401-0.743-3.676c0-0.546,0.049-1.093,0.142-1.628c0.018,0.032,0.033,0.064,0.051,0.095L2.72,10.223 c-0.006,0.034-0.011,0.069-0.017,0.103C2.244,9.5,2,8.566,2,7.615c0-1.493,0.582-2.898,1.637-3.953 c1.056-1.056,2.46-1.638,3.953-1.638c0.915,0,1.818,0.228,2.622,0.655c-0.033,0.007-0.067,0.013-0.1,0.02l0.199,0.031 c-0.032-0.018-0.066-0.034-0.098-0.051c0.002,0,0.003-0.001,0.004-0.001c0.586-0.112,1.187-0.169,1.788-0.169 c1.275,0,2.512,0.249,3.676,0.742c1.124,0.476,2.135,1.156,3.002,2.024c0.868,0.867,1.548,1.877,2.024,3.002 c0.493,1.164,0.743,2.401,0.743,3.676c0,0.575-0.054,1.15-0.157,1.712c-0.018-0.031-0.033-0.064-0.052-0.095l0.034,0.201 c0.007-0.035,0.011-0.071,0.018-0.106C21.754,14.494,22,15.432,22,16.386z M16.817,14.138c0-1.331-0.613-2.743-3.033-3.282 l-2.209-0.49c-0.84-0.192-1.807-0.444-1.807-1.237c0-0.794,0.679-1.348,1.903-1.348c2.468,0,2.243,1.696,3.468,1.696 c0.645,0,1.209-0.379,1.209-1.031c0-1.521-2.435-2.663-4.5-2.663c-2.242,0-4.63,0.952-4.63,3.488c0,1.221,0.436,2.521,2.839,3.123 l2.984,0.745c0.903,0.223,1.129,0.731,1.129,1.189c0,0.762-0.758,1.507-2.129,1.507c-2.679,0-2.307-2.062-3.743-2.062 c-0.645,0-1.113,0.444-1.113,1.078c0,1.236,1.501,2.886,4.856,2.886C15.236,17.737,16.817,16.199,16.817,14.138z"}))},{name:"snapchat",attributes:{service:"snapchat"},title:"Snapchat",icon:()=>(0,tt.createElement)(mo,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1"},(0,tt.createElement)(uo,{d:"M12.065,2a5.526,5.526,0,0,1,3.132.892A5.854,5.854,0,0,1,17.326,5.4a5.821,5.821,0,0,1,.351,2.33q0,.612-.117,2.487a.809.809,0,0,0,.365.091,1.93,1.93,0,0,0,.664-.176,1.93,1.93,0,0,1,.664-.176,1.3,1.3,0,0,1,.729.234.7.7,0,0,1,.351.6.839.839,0,0,1-.41.7,2.732,2.732,0,0,1-.9.41,3.192,3.192,0,0,0-.9.378.728.728,0,0,0-.41.618,1.575,1.575,0,0,0,.156.56,6.9,6.9,0,0,0,1.334,1.953,5.6,5.6,0,0,0,1.881,1.315,5.875,5.875,0,0,0,1.042.3.42.42,0,0,1,.365.456q0,.911-2.852,1.341a1.379,1.379,0,0,0-.143.507,1.8,1.8,0,0,1-.182.605.451.451,0,0,1-.429.241,5.878,5.878,0,0,1-.807-.085,5.917,5.917,0,0,0-.833-.085,4.217,4.217,0,0,0-.807.065,2.42,2.42,0,0,0-.82.293,6.682,6.682,0,0,0-.755.5q-.351.267-.755.527a3.886,3.886,0,0,1-.989.436A4.471,4.471,0,0,1,11.831,22a4.307,4.307,0,0,1-1.256-.176,3.784,3.784,0,0,1-.976-.436q-.4-.26-.749-.527a6.682,6.682,0,0,0-.755-.5,2.422,2.422,0,0,0-.807-.293,4.432,4.432,0,0,0-.82-.065,5.089,5.089,0,0,0-.853.1,5,5,0,0,1-.762.1.474.474,0,0,1-.456-.241,1.819,1.819,0,0,1-.182-.618,1.411,1.411,0,0,0-.143-.521q-2.852-.429-2.852-1.341a.42.42,0,0,1,.365-.456,5.793,5.793,0,0,0,1.042-.3,5.524,5.524,0,0,0,1.881-1.315,6.789,6.789,0,0,0,1.334-1.953A1.575,1.575,0,0,0,6,12.9a.728.728,0,0,0-.41-.618,3.323,3.323,0,0,0-.9-.384,2.912,2.912,0,0,1-.9-.41.814.814,0,0,1-.41-.684.71.71,0,0,1,.338-.593,1.208,1.208,0,0,1,.716-.241,1.976,1.976,0,0,1,.625.169,2.008,2.008,0,0,0,.69.169.919.919,0,0,0,.416-.091q-.117-1.849-.117-2.474A5.861,5.861,0,0,1,6.385,5.4,5.516,5.516,0,0,1,8.625,2.819,7.075,7.075,0,0,1,12.062,2Z"}))},{name:"soundcloud",attributes:{service:"soundcloud"},title:"SoundCloud",icon:()=>(0,tt.createElement)(mo,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1"},(0,tt.createElement)(uo,{d:"M8.9,16.1L9,14L8.9,9.5c0-0.1,0-0.1-0.1-0.1c0,0-0.1-0.1-0.1-0.1c-0.1,0-0.1,0-0.1,0.1c0,0-0.1,0.1-0.1,0.1L8.3,14l0.1,2.1 c0,0.1,0,0.1,0.1,0.1c0,0,0.1,0.1,0.1,0.1C8.8,16.3,8.9,16.3,8.9,16.1z M11.4,15.9l0.1-1.8L11.4,9c0-0.1,0-0.2-0.1-0.2 c0,0-0.1,0-0.1,0s-0.1,0-0.1,0c-0.1,0-0.1,0.1-0.1,0.2l0,0.1l-0.1,5c0,0,0,0.7,0.1,2v0c0,0.1,0,0.1,0.1,0.1c0.1,0.1,0.1,0.1,0.2,0.1 c0.1,0,0.1,0,0.2-0.1c0.1,0,0.1-0.1,0.1-0.2L11.4,15.9z M2.4,12.9L2.5,14l-0.2,1.1c0,0.1,0,0.1-0.1,0.1c0,0-0.1,0-0.1-0.1L2.1,14 l0.1-1.1C2.2,12.9,2.3,12.9,2.4,12.9C2.3,12.9,2.4,12.9,2.4,12.9z M3.1,12.2L3.3,14l-0.2,1.8c0,0.1,0,0.1-0.1,0.1 c-0.1,0-0.1,0-0.1-0.1L2.8,14L3,12.2C3,12.2,3,12.2,3.1,12.2C3.1,12.2,3.1,12.2,3.1,12.2z M3.9,11.9L4.1,14l-0.2,2.1 c0,0.1,0,0.1-0.1,0.1c-0.1,0-0.1,0-0.1-0.1L3.5,14l0.2-2.1c0-0.1,0-0.1,0.1-0.1C3.9,11.8,3.9,11.8,3.9,11.9z M4.7,11.9L4.9,14 l-0.2,2.1c0,0.1-0.1,0.1-0.1,0.1c-0.1,0-0.1,0-0.1-0.1L4.3,14l0.2-2.2c0-0.1,0-0.1,0.1-0.1C4.7,11.7,4.7,11.8,4.7,11.9z M5.6,12 l0.2,2l-0.2,2.1c0,0.1-0.1,0.1-0.1,0.1c0,0-0.1,0-0.1,0c0,0,0-0.1,0-0.1L5.1,14l0.2-2c0,0,0-0.1,0-0.1s0.1,0,0.1,0 C5.5,11.9,5.5,11.9,5.6,12L5.6,12z M6.4,10.7L6.6,14l-0.2,2.1c0,0,0,0.1,0,0.1c0,0-0.1,0-0.1,0c-0.1,0-0.1-0.1-0.2-0.2L5.9,14 l0.2-3.3c0-0.1,0.1-0.2,0.2-0.2c0,0,0.1,0,0.1,0C6.4,10.7,6.4,10.7,6.4,10.7z M7.2,10l0.2,4.1l-0.2,2.1c0,0,0,0.1,0,0.1 c0,0-0.1,0-0.1,0c-0.1,0-0.2-0.1-0.2-0.2l-0.1-2.1L6.8,10c0-0.1,0.1-0.2,0.2-0.2c0,0,0.1,0,0.1,0S7.2,9.9,7.2,10z M8,9.6L8.2,14 L8,16.1c0,0.1-0.1,0.2-0.2,0.2c-0.1,0-0.2-0.1-0.2-0.2L7.5,14l0.1-4.4c0-0.1,0-0.1,0.1-0.1c0,0,0.1-0.1,0.1-0.1c0.1,0,0.1,0,0.1,0.1 C8,9.6,8,9.6,8,9.6z M11.4,16.1L11.4,16.1L11.4,16.1z M9.7,9.6L9.8,14l-0.1,2.1c0,0.1,0,0.1-0.1,0.2s-0.1,0.1-0.2,0.1 c-0.1,0-0.1,0-0.1-0.1s-0.1-0.1-0.1-0.2L9.2,14l0.1-4.4c0-0.1,0-0.1,0.1-0.2s0.1-0.1,0.2-0.1c0.1,0,0.1,0,0.2,0.1S9.7,9.5,9.7,9.6 L9.7,9.6z M10.6,9.8l0.1,4.3l-0.1,2c0,0.1,0,0.1-0.1,0.2c0,0-0.1,0.1-0.2,0.1c-0.1,0-0.1,0-0.2-0.1c0,0-0.1-0.1-0.1-0.2L10,14 l0.1-4.3c0-0.1,0-0.1,0.1-0.2c0,0,0.1-0.1,0.2-0.1c0.1,0,0.1,0,0.2,0.1S10.6,9.7,10.6,9.8z M12.4,14l-0.1,2c0,0.1,0,0.1-0.1,0.2 c-0.1,0.1-0.1,0.1-0.2,0.1c-0.1,0-0.1,0-0.2-0.1c-0.1-0.1-0.1-0.1-0.1-0.2l-0.1-1l-0.1-1l0.1-5.5v0c0-0.1,0-0.2,0.1-0.2 c0.1,0,0.1-0.1,0.2-0.1c0,0,0.1,0,0.1,0c0.1,0,0.1,0.1,0.1,0.2L12.4,14z M22.1,13.9c0,0.7-0.2,1.3-0.7,1.7c-0.5,0.5-1.1,0.7-1.7,0.7 h-6.8c-0.1,0-0.1,0-0.2-0.1c-0.1-0.1-0.1-0.1-0.1-0.2V8.2c0-0.1,0.1-0.2,0.2-0.3c0.5-0.2,1-0.3,1.6-0.3c1.1,0,2.1,0.4,2.9,1.1 c0.8,0.8,1.3,1.7,1.4,2.8c0.3-0.1,0.6-0.2,1-0.2c0.7,0,1.3,0.2,1.7,0.7C21.8,12.6,22.1,13.2,22.1,13.9L22.1,13.9z"}))},{name:"spotify",attributes:{service:"spotify"},title:"Spotify",icon:()=>(0,tt.createElement)(mo,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1"},(0,tt.createElement)(uo,{d:"M12,2C6.477,2,2,6.477,2,12c0,5.523,4.477,10,10,10c5.523,0,10-4.477,10-10C22,6.477,17.523,2,12,2 M16.586,16.424 c-0.18,0.295-0.563,0.387-0.857,0.207c-2.348-1.435-5.304-1.76-8.785-0.964c-0.335,0.077-0.67-0.133-0.746-0.469 c-0.077-0.335,0.132-0.67,0.469-0.746c3.809-0.871,7.077-0.496,9.713,1.115C16.673,15.746,16.766,16.13,16.586,16.424 M17.81,13.7 c-0.226,0.367-0.706,0.482-1.072,0.257c-2.687-1.652-6.785-2.131-9.965-1.166C6.36,12.917,5.925,12.684,5.8,12.273 C5.675,11.86,5.908,11.425,6.32,11.3c3.632-1.102,8.147-0.568,11.234,1.328C17.92,12.854,18.035,13.335,17.81,13.7 M17.915,10.865 c-3.223-1.914-8.54-2.09-11.618-1.156C5.804,9.859,5.281,9.58,5.131,9.086C4.982,8.591,5.26,8.069,5.755,7.919 c3.532-1.072,9.404-0.865,13.115,1.338c0.445,0.264,0.59,0.838,0.327,1.282C18.933,10.983,18.359,11.129,17.915,10.865"}))},{name:"telegram",attributes:{service:"telegram"},title:"Telegram",icon:()=>(0,tt.createElement)(mo,{width:"24",height:"24",viewBox:"0 0 128 128",version:"1.1"},(0,tt.createElement)(uo,{d:"M28.9700376,63.3244248 C47.6273373,55.1957357 60.0684594,49.8368063 66.2934036,47.2476366 C84.0668845,39.855031 87.7600616,38.5708563 90.1672227,38.528 C90.6966555,38.5191258 91.8804274,38.6503351 92.6472251,39.2725385 C93.294694,39.7979149 93.4728387,40.5076237 93.5580865,41.0057381 C93.6433345,41.5038525 93.7494885,42.63857 93.6651041,43.5252052 C92.7019529,53.6451182 88.5344133,78.2034783 86.4142057,89.5379542 C85.5170662,94.3339958 83.750571,95.9420841 82.0403991,96.0994568 C78.3237996,96.4414641 75.5015827,93.6432685 71.9018743,91.2836143 C66.2690414,87.5912212 63.0868492,85.2926952 57.6192095,81.6896017 C51.3004058,77.5256038 55.3966232,75.2369981 58.9976911,71.4967761 C59.9401076,70.5179421 76.3155302,55.6232293 76.6324771,54.2720454 C76.6721165,54.1030573 76.7089039,53.4731496 76.3346867,53.1405352 C75.9604695,52.8079208 75.4081573,52.921662 75.0095933,53.0121213 C74.444641,53.1403447 65.4461175,59.0880351 48.0140228,70.8551922 C45.4598218,72.6091037 43.1463059,73.4636682 41.0734751,73.4188859 C38.7883453,73.3695169 34.3926725,72.1268388 31.1249416,71.0646282 C27.1169366,69.7617838 23.931454,69.0729605 24.208838,66.8603276 C24.3533167,65.7078514 25.9403832,64.5292172 28.9700376,63.3244248 Z"}))},{name:"tiktok",attributes:{service:"tiktok"},title:"TikTok",icon:()=>(0,tt.createElement)(mo,{width:"24",height:"24",viewBox:"0 0 32 32",version:"1.1"},(0,tt.createElement)(uo,{d:"M16.708 0.027c1.745-0.027 3.48-0.011 5.213-0.027 0.105 2.041 0.839 4.12 2.333 5.563 1.491 1.479 3.6 2.156 5.652 2.385v5.369c-1.923-0.063-3.855-0.463-5.6-1.291-0.76-0.344-1.468-0.787-2.161-1.24-0.009 3.896 0.016 7.787-0.025 11.667-0.104 1.864-0.719 3.719-1.803 5.255-1.744 2.557-4.771 4.224-7.88 4.276-1.907 0.109-3.812-0.411-5.437-1.369-2.693-1.588-4.588-4.495-4.864-7.615-0.032-0.667-0.043-1.333-0.016-1.984 0.24-2.537 1.495-4.964 3.443-6.615 2.208-1.923 5.301-2.839 8.197-2.297 0.027 1.975-0.052 3.948-0.052 5.923-1.323-0.428-2.869-0.308-4.025 0.495-0.844 0.547-1.485 1.385-1.819 2.333-0.276 0.676-0.197 1.427-0.181 2.145 0.317 2.188 2.421 4.027 4.667 3.828 1.489-0.016 2.916-0.88 3.692-2.145 0.251-0.443 0.532-0.896 0.547-1.417 0.131-2.385 0.079-4.76 0.095-7.145 0.011-5.375-0.016-10.735 0.025-16.093z"}))},{name:"tumblr",attributes:{service:"tumblr"},title:"Tumblr",icon:()=>(0,tt.createElement)(mo,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1"},(0,tt.createElement)(uo,{d:"M17.04 21.28h-3.28c-2.84 0-4.94-1.37-4.94-5.02v-5.67H6.08V7.5c2.93-.73 4.11-3.3 4.3-5.48h3.01v4.93h3.47v3.65H13.4v4.93c0 1.47.73 2.01 1.92 2.01h1.73v3.75z"}))},{name:"twitch",attributes:{service:"twitch"},title:"Twitch",icon:()=>(0,tt.createElement)(mo,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1"},(0,tt.createElement)(uo,{d:"M16.499,8.089h-1.636v4.91h1.636V8.089z M12,8.089h-1.637v4.91H12V8.089z M4.228,3.178L3,6.451v13.092h4.499V22h2.456 l2.454-2.456h3.681L21,14.636V3.178H4.228z M19.364,13.816l-2.864,2.865H12l-2.453,2.453V16.68H5.863V4.814h13.501V13.816z"}))},{name:"twitter",attributes:{service:"twitter"},title:"Twitter",icon:()=>(0,tt.createElement)(mo,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1"},(0,tt.createElement)(uo,{d:"M22.23,5.924c-0.736,0.326-1.527,0.547-2.357,0.646c0.847-0.508,1.498-1.312,1.804-2.27 c-0.793,0.47-1.671,0.812-2.606,0.996C18.324,4.498,17.257,4,16.077,4c-2.266,0-4.103,1.837-4.103,4.103 c0,0.322,0.036,0.635,0.106,0.935C8.67,8.867,5.647,7.234,3.623,4.751C3.27,5.357,3.067,6.062,3.067,6.814 c0,1.424,0.724,2.679,1.825,3.415c-0.673-0.021-1.305-0.206-1.859-0.513c0,0.017,0,0.034,0,0.052c0,1.988,1.414,3.647,3.292,4.023 c-0.344,0.094-0.707,0.144-1.081,0.144c-0.264,0-0.521-0.026-0.772-0.074c0.522,1.63,2.038,2.816,3.833,2.85 c-1.404,1.1-3.174,1.756-5.096,1.756c-0.331,0-0.658-0.019-0.979-0.057c1.816,1.164,3.973,1.843,6.29,1.843 c7.547,0,11.675-6.252,11.675-11.675c0-0.178-0.004-0.355-0.012-0.531C20.985,7.47,21.68,6.747,22.23,5.924z"}))},{name:"vimeo",attributes:{service:"vimeo"},title:"Vimeo",icon:()=>(0,tt.createElement)(mo,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1"},(0,tt.createElement)(uo,{d:"M22.396,7.164c-0.093,2.026-1.507,4.799-4.245,8.32C15.322,19.161,12.928,21,10.97,21c-1.214,0-2.24-1.119-3.079-3.359 c-0.56-2.053-1.119-4.106-1.68-6.159C5.588,9.243,4.921,8.122,4.206,8.122c-0.156,0-0.701,0.328-1.634,0.98L1.594,7.841 c1.027-0.902,2.04-1.805,3.037-2.708C6.001,3.95,7.03,3.327,7.715,3.264c1.619-0.156,2.616,0.951,2.99,3.321 c0.404,2.557,0.685,4.147,0.841,4.769c0.467,2.121,0.981,3.181,1.542,3.181c0.435,0,1.09-0.688,1.963-2.065 c0.871-1.376,1.338-2.422,1.401-3.142c0.125-1.187-0.343-1.782-1.401-1.782c-0.498,0-1.012,0.115-1.541,0.341 c1.023-3.35,2.977-4.977,5.862-4.884C21.511,3.066,22.52,4.453,22.396,7.164z"}))},{name:"vk",attributes:{service:"vk"},title:"VK",icon:()=>(0,tt.createElement)(mo,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1"},(0,tt.createElement)(uo,{d:"M22,7.1c0.2,0.4-0.4,1.5-1.6,3.1c-0.2,0.2-0.4,0.5-0.7,0.9c-0.5,0.7-0.9,1.1-0.9,1.4c-0.1,0.3-0.1,0.6,0.1,0.8 c0.1,0.1,0.4,0.4,0.8,0.9h0l0,0c1,0.9,1.6,1.7,2,2.3c0,0,0,0.1,0.1,0.1c0,0.1,0,0.1,0.1,0.3c0,0.1,0,0.2,0,0.4 c0,0.1-0.1,0.2-0.3,0.3c-0.1,0.1-0.4,0.1-0.6,0.1l-2.7,0c-0.2,0-0.4,0-0.6-0.1c-0.2-0.1-0.4-0.1-0.5-0.2l-0.2-0.1 c-0.2-0.1-0.5-0.4-0.7-0.7s-0.5-0.6-0.7-0.8c-0.2-0.2-0.4-0.4-0.6-0.6C14.8,15,14.6,15,14.4,15c0,0,0,0-0.1,0c0,0-0.1,0.1-0.2,0.2 c-0.1,0.1-0.2,0.2-0.2,0.3c-0.1,0.1-0.1,0.3-0.2,0.5c-0.1,0.2-0.1,0.5-0.1,0.8c0,0.1,0,0.2,0,0.3c0,0.1-0.1,0.2-0.1,0.2l0,0.1 c-0.1,0.1-0.3,0.2-0.6,0.2h-1.2c-0.5,0-1,0-1.5-0.2c-0.5-0.1-1-0.3-1.4-0.6s-0.7-0.5-1.1-0.7s-0.6-0.4-0.7-0.6l-0.3-0.3 c-0.1-0.1-0.2-0.2-0.3-0.3s-0.4-0.5-0.7-0.9s-0.7-1-1.1-1.6c-0.4-0.6-0.8-1.3-1.3-2.2C2.9,9.4,2.5,8.5,2.1,7.5C2,7.4,2,7.3,2,7.2 c0-0.1,0-0.1,0-0.2l0-0.1c0.1-0.1,0.3-0.2,0.6-0.2l2.9,0c0.1,0,0.2,0,0.2,0.1S5.9,6.9,5.9,7L6,7c0.1,0.1,0.2,0.2,0.3,0.3 C6.4,7.7,6.5,8,6.7,8.4C6.9,8.8,7,9,7.1,9.2l0.2,0.3c0.2,0.4,0.4,0.8,0.6,1.1c0.2,0.3,0.4,0.5,0.5,0.7s0.3,0.3,0.4,0.4 c0.1,0.1,0.3,0.1,0.4,0.1c0.1,0,0.2,0,0.3-0.1c0,0,0,0,0.1-0.1c0,0,0.1-0.1,0.1-0.2c0.1-0.1,0.1-0.3,0.1-0.5c0-0.2,0.1-0.5,0.1-0.8 c0-0.4,0-0.8,0-1.3c0-0.3,0-0.5-0.1-0.8c0-0.2-0.1-0.4-0.1-0.5L9.6,7.6C9.4,7.3,9.1,7.2,8.7,7.1C8.6,7.1,8.6,7,8.7,6.9 C8.9,6.7,9,6.6,9.1,6.5c0.4-0.2,1.2-0.3,2.5-0.3c0.6,0,1,0.1,1.4,0.1c0.1,0,0.3,0.1,0.3,0.1c0.1,0.1,0.2,0.1,0.2,0.3 c0,0.1,0.1,0.2,0.1,0.3s0,0.3,0,0.5c0,0.2,0,0.4,0,0.6c0,0.2,0,0.4,0,0.7c0,0.3,0,0.6,0,0.9c0,0.1,0,0.2,0,0.4c0,0.2,0,0.4,0,0.5 c0,0.1,0,0.3,0,0.4s0.1,0.3,0.1,0.4c0.1,0.1,0.1,0.2,0.2,0.3c0.1,0,0.1,0,0.2,0c0.1,0,0.2,0,0.3-0.1c0.1-0.1,0.2-0.2,0.4-0.4 s0.3-0.4,0.5-0.7c0.2-0.3,0.5-0.7,0.7-1.1c0.4-0.7,0.8-1.5,1.1-2.3c0-0.1,0.1-0.1,0.1-0.2c0-0.1,0.1-0.1,0.1-0.1l0,0l0.1,0 c0,0,0,0,0.1,0s0.2,0,0.2,0l3,0c0.3,0,0.5,0,0.7,0S21.9,7,21.9,7L22,7.1z"}))},{name:"yelp",attributes:{service:"yelp"},title:"Yelp",icon:()=>(0,tt.createElement)(mo,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1"},(0,tt.createElement)(uo,{d:"M12.271,16.718v1.417q-.011,3.257-.067,3.4a.707.707,0,0,1-.569.446,4.637,4.637,0,0,1-2.024-.424A4.609,4.609,0,0,1,7.8,20.565a.844.844,0,0,1-.19-.4.692.692,0,0,1,.044-.29,3.181,3.181,0,0,1,.379-.524q.335-.412,2.019-2.409.011,0,.669-.781a.757.757,0,0,1,.44-.274.965.965,0,0,1,.552.039.945.945,0,0,1,.418.324.732.732,0,0,1,.139.468Zm-1.662-2.8a.783.783,0,0,1-.58.781l-1.339.435q-3.067.981-3.257.981a.711.711,0,0,1-.6-.4,2.636,2.636,0,0,1-.19-.836,9.134,9.134,0,0,1,.011-1.857,3.559,3.559,0,0,1,.335-1.389.659.659,0,0,1,.625-.357,22.629,22.629,0,0,1,2.253.859q.781.324,1.283.524l.937.379a.771.771,0,0,1,.4.34A.982.982,0,0,1,10.609,13.917Zm9.213,3.313a4.467,4.467,0,0,1-1.021,1.8,4.559,4.559,0,0,1-1.512,1.417.671.671,0,0,1-.7-.078q-.156-.112-2.052-3.2l-.524-.859a.761.761,0,0,1-.128-.513.957.957,0,0,1,.217-.513.774.774,0,0,1,.926-.29q.011.011,1.327.446,2.264.736,2.7.887a2.082,2.082,0,0,1,.524.229.673.673,0,0,1,.245.68Zm-7.5-7.049q.056,1.137-.6,1.361-.647.19-1.272-.792L6.237,4.08a.7.7,0,0,1,.212-.691,5.788,5.788,0,0,1,2.314-1,5.928,5.928,0,0,1,2.5-.352.681.681,0,0,1,.547.5q.034.2.245,3.407T12.327,10.181Zm7.384,1.2a.679.679,0,0,1-.29.658q-.167.112-3.67.959-.747.167-1.015.257l.011-.022a.769.769,0,0,1-.513-.044.914.914,0,0,1-.413-.357.786.786,0,0,1,0-.971q.011-.011.836-1.137,1.394-1.908,1.673-2.275a2.423,2.423,0,0,1,.379-.435A.7.7,0,0,1,17.435,8a4.482,4.482,0,0,1,1.372,1.489,4.81,4.81,0,0,1,.9,1.868v.034Z"}))},{name:"youtube",attributes:{service:"youtube"},title:"YouTube",icon:()=>(0,tt.createElement)(mo,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1"},(0,tt.createElement)(uo,{d:"M21.8,8.001c0,0-0.195-1.378-0.795-1.985c-0.76-0.797-1.613-0.801-2.004-0.847c-2.799-0.202-6.997-0.202-6.997-0.202 h-0.009c0,0-4.198,0-6.997,0.202C4.608,5.216,3.756,5.22,2.995,6.016C2.395,6.623,2.2,8.001,2.2,8.001S2,9.62,2,11.238v1.517 c0,1.618,0.2,3.237,0.2,3.237s0.195,1.378,0.795,1.985c0.761,0.797,1.76,0.771,2.205,0.855c1.6,0.153,6.8,0.201,6.8,0.201 s4.203-0.006,7.001-0.209c0.391-0.047,1.243-0.051,2.004-0.847c0.6-0.607,0.795-1.985,0.795-1.985s0.2-1.618,0.2-3.237v-1.517 C22,9.62,21.8,8.001,21.8,8.001z M9.935,14.594l-0.001-5.62l5.404,2.82L9.935,14.594z"}))}];i7.forEach((e=>{e.isActive||(e.isActive=(e,t)=>e.service===t.service)}));const s7=i7,l7=({url:e,setAttributes:t,setPopover:n,anchorRef:r})=>(0,tt.createElement)(nj,{anchorRef:null==r?void 0:r.current,onClose:()=>n(!1)},(0,tt.createElement)("form",{className:"block-editor-url-popover__link-editor",onSubmit:e=>{e.preventDefault(),n(!1)}},(0,tt.createElement)("div",{className:"block-editor-url-input"},(0,tt.createElement)(gq,{value:e,onChange:e=>t({url:e}),placeholder:er("Enter address"),disableSuggestions:!0})),(0,tt.createElement)(Eh,{icon:uq,label:er("Apply"),type:"submit"}))),c7=({attributes:e,context:t,isSelected:n,setAttributes:r})=>{const{url:o,service:a,label:i}=e,{iconColorValue:s,iconBackgroundColorValue:l}=t,[c,u]=(0,tt.useState)(!1),d=so()("wp-social-link","wp-social-link-"+a,{"wp-social-link__is-incomplete":!o}),p=(0,tt.useRef)(),m=(e=>{const t=(0,at.find)(s7,{name:e});return t?t.icon:a7})(a),f=(e=>{const t=(0,at.find)(s7,{name:e});return t?t.title:er("Social Icon")})(a),h=VR({className:d,style:{color:s,backgroundColor:l}});return(0,tt.createElement)(tt.Fragment,null,(0,tt.createElement)(FA,null,(0,tt.createElement)(BA,{title:pn(er("%s label"),f),initialOpen:!1},(0,tt.createElement)($0,null,(0,tt.createElement)(LA,{label:er("Link label"),help:er("Briefly describe the link to help screen reader users."),value:i,onChange:e=>r({label:e})})))),(0,tt.createElement)("li",h,(0,tt.createElement)(Eh,{ref:p,onClick:()=>u(!0)},(0,tt.createElement)(m,null),n&&c&&(0,tt.createElement)(l7,{url:o,setAttributes:r,setPopover:u,anchorRef:p}))))},u7={apiVersion:2,name:"core/social-link",title:"Social Icon",category:"widgets",parent:["core/social-links"],description:"Display an icon linking to a social media profile or website.",textdomain:"default",attributes:{url:{type:"string"},service:{type:"string"},label:{type:"string"}},usesContext:["openInNewTab","iconColorValue","iconBackgroundColorValue"],supports:{reusable:!1,html:!1},editorStyle:"wp-block-social-link-editor"},{name:d7}=u7,p7={icon:J6,edit:c7,variations:s7},m7=(0,tt.createElement)(mo,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,tt.createElement)(uo,{d:"M12 3c-5 0-9 4-9 9s4 9 9 9 9-4 9-9-4-9-9-9zm0 1.5c4.1 0 7.5 3.4 7.5 7.5v.1c-1.4-.8-3.3-1.7-3.4-1.8-.2-.1-.5-.1-.8.1l-2.9 2.1L9 11.3c-.2-.1-.4 0-.6.1l-3.7 2.2c-.1-.5-.2-1-.2-1.5 0-4.2 3.4-7.6 7.5-7.6zm0 15c-3.1 0-5.7-1.9-6.9-4.5l3.7-2.2 3.5 1.2c.2.1.5 0 .7-.1l2.9-2.1c.8.4 2.5 1.2 3.5 1.9-.9 3.3-3.9 5.8-7.4 5.8z"})),f7=["image"],h7="image/*",g7=({alt:e,attributes:{align:t,width:n,height:r,isLink:o,linkTarget:a},containerRef:i,isSelected:s,setAttributes:l,logoUrl:c,siteUrl:u})=>{const d=WG(i,[t]),p=Jp("medium"),m=!(0,at.includes)(["wide","full"],t)&&p,[{naturalWidth:f,naturalHeight:h},g]=(0,tt.useState)({}),{toggleSelection:b}=ld(nk),v=so()("custom-logo-link",{"is-transient":Qs(c)}),{maxWidth:y,title:_}=Tl((e=>{const{getSettings:t}=e(nk);return{title:e(yd).getEditedEntityRecord("root","site").title,...(0,at.pick)(t(),["imageSizes","maxWidth"])}}),[]);const M=(0,tt.createElement)("img",{className:"custom-logo",src:c,alt:e,onLoad:e=>{g((0,at.pick)(e.target,["naturalWidth","naturalHeight"]))}});let k,w=M;if(o&&(w=(0,tt.createElement)("a",{href:u,className:v,rel:"home",title:_,onClick:e=>e.preventDefault()},M)),d&&f&&h){k=f>d?d:f}if(!m||!k)return(0,tt.createElement)("div",{style:{width:n,height:r}},w);const E=n||k,L=f/h,A=E/L,S=fl({width:e}),min:S,max:T,initialPosition:Math.min(120,T),value:n||"",disabled:!m}),(0,tt.createElement)(KN,{label:er("Link image to home"),onChange:()=>l({isLink:!o}),checked:o}),o&&(0,tt.createElement)(tt.Fragment,null,(0,tt.createElement)(KN,{label:er("Open in new tab"),onChange:e=>l({linkTarget:e?"_blank":"_self"}),checked:"_blank"===a})))),(0,tt.createElement)(LG,{size:{width:n,height:r},showHandle:s,minWidth:S,maxWidth:T,minHeight:C,maxHeight:T/L,lockAspectRatio:!0,enable:{top:!1,right:x,bottom:!0,left:z},onResizeStart:function(){b(!1)},onResizeStop:(e,t,n,r)=>{b(!0),l({width:parseInt(E+r.width,10),height:parseInt(A+r.height,10)})}},w))};const b7={apiVersion:2,name:"core/site-logo",title:"Site Logo",category:"layout",description:"Useful for displaying a graphic mark, design, or symbol to represent the site. Once a site logo is set, it can be reused in different places and templates. It should not be confused with the site icon, which is the small image used in the dashboard, browser tabs, public search results, etc, to help recognize a site.",textdomain:"default",attributes:{align:{type:"string"},width:{type:"number"},isLink:{type:"boolean",default:!0},linkTarget:{type:"string",default:"_self"}},supports:{html:!1,align:!0,alignWide:!1},styles:[{name:"default",label:"Default",isDefault:!0},{name:"rounded",label:"Rounded"}],editorStyle:"wp-block-site-logo-editor",style:"wp-block-site-logo"},{name:v7}=b7,y7={icon:m7,edit:function({attributes:e,className:t,setAttributes:n,isSelected:r}){const{width:o}=e,[a,i]=(0,tt.useState)(),[s,l]=(0,tt.useState)(),c=(0,tt.useRef)(),{siteLogoId:u,canUserEdit:d,url:p,mediaItemData:m,isRequestingMediaItem:f}=Tl((e=>{const{canUser:t,getEntityRecord:n,getEditedEntityRecord:r}=e(yd),o=r("root","site"),a=n("root","__unstableBase"),i=null==o?void 0:o.site_logo,s=null==a?void 0:a.site_logo,l=t("update","settings"),c=i||s,u=c&&e(yd).getEntityRecord("root","media",c,{context:"view"}),d=c&&!e(yd).hasFinishedResolution("getEntityRecord",["root","media",c,{context:"view"}]);return{siteLogoId:c,canUserEdit:l,url:null==a?void 0:a.url,mediaItemData:u&&{url:u.source_url,alt:u.alt_text},isRequestingMediaItem:d}}),[]),{editEntityRecord:h}=ld(yd),g=e=>h("root","site",void 0,{site_logo:e});let b=null;m&&(b=m.alt,a!==m.url&&i(m.url));const v=e=>{if(e)return!e.id&&e.url?(g(void 0),l(null),void i(e.url)):void g(e.id)},y=e=>{l(e[2]?e[2]:null)},_=d&&a&&(0,tt.createElement)(lk,{group:"other"},(0,tt.createElement)(Jq,{mediaURL:a,allowedTypes:f7,accept:h7,onSelect:v,onError:y})),M=er("Site Logo");let k;const w=void 0===u||f;w&&(k=(0,tt.createElement)(cq,null)),a&&(k=(0,tt.createElement)(g7,{alt:b,attributes:e,className:t,containerRef:c,isSelected:r,setAttributes:n,logoUrl:a,siteUrl:p}));const E=VR({ref:c,className:so()(t,{"is-default-size":!o})});return(0,tt.createElement)("div",E,_,!!a&&k,!a&&!d&&(0,tt.createElement)(vH,{className:"site-logo_placeholder",icon:m7,label:M},w&&(0,tt.createElement)("span",{className:"components-placeholder__preview"},(0,tt.createElement)(cq,null))),!a&&d&&(0,tt.createElement)(oj,{icon:(0,tt.createElement)(MB,{icon:m7}),labels:{title:M,instructions:er("Upload an image, or pick one from your media library, to be your site logo")},onSelect:v,accept:h7,allowedTypes:f7,mediaPreview:k,notices:s&&(0,tt.createElement)(RT,{status:"error",isDismissible:!1},s),onError:y}))}};const _7=(0,tt.createElement)(mo,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24"},(0,tt.createElement)(uo,{fill:"none",d:"M0 0h24v24H0z"}),(0,tt.createElement)(uo,{d:"M4 9h16v2H4V9zm0 4h10v2H4v-2z"})),M7={apiVersion:2,name:"core/site-tagline",title:"Site Tagline",category:"design",description:"Describe in a few words what the website is about. The tagline can be used in search results or when sharing on social networks even if it's not displayed in the theme design.",keywords:["description"],textdomain:"default",attributes:{textAlign:{type:"string"}},supports:{html:!1,color:{gradients:!0},spacing:{margin:!0,padding:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalTextTransform:!0,__experimentalLetterSpacing:!0}},editorStyle:"wp-block-site-tagline-editor"},{name:k7}=M7,w7={icon:_7,edit:function({attributes:e,setAttributes:t}){const{textAlign:n}=e,[r,o]=md("root","site","description"),{canUserEdit:a,readOnlySiteTagLine:i}=Tl((e=>{const{canUser:t,getEntityRecord:n}=e(yd),r=n("root","__unstableBase");return{canUserEdit:t("update","settings"),readOnlySiteTagLine:null==r?void 0:r.description}}),[]),s=VR({className:so()({[`has-text-align-${n}`]:n,"wp-block-site-tagline__placeholder":!a&&!i})}),l=a?(0,tt.createElement)(Cj,ot({allowedFormats:[],onChange:o,"aria-label":er("Site tagline text"),placeholder:er("Write site tagline…"),tagName:"p",value:r},s)):(0,tt.createElement)("p",s,i||er("Site Tagline placeholder"));return(0,tt.createElement)(tt.Fragment,null,(0,tt.createElement)(lk,{group:"block"},(0,tt.createElement)(gD,{onChange:e=>t({textAlign:e}),value:n})),l)}},E7=(0,tt.createElement)(mo,{xmlns:"https://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,tt.createElement)(uo,{d:"M12 9c-.8 0-1.5.7-1.5 1.5S11.2 12 12 12s1.5-.7 1.5-1.5S12.8 9 12 9zm0-5c-3.6 0-6.5 2.8-6.5 6.2 0 .8.3 1.8.9 3.1.5 1.1 1.2 2.3 2 3.6.7 1 3 3.8 3.2 3.9l.4.5.4-.5c.2-.2 2.6-2.9 3.2-3.9.8-1.2 1.5-2.5 2-3.6.6-1.3.9-2.3.9-3.1C18.5 6.8 15.6 4 12 4zm4.3 8.7c-.5 1-1.1 2.2-1.9 3.4-.5.7-1.7 2.2-2.4 3-.7-.8-1.9-2.3-2.4-3-.8-1.2-1.4-2.3-1.9-3.3-.6-1.4-.7-2.2-.7-2.5 0-2.6 2.2-4.7 5-4.7s5 2.1 5 4.7c0 .2-.1 1-.7 2.4z"}));function L7({level:e,isPressed:t=!1}){if(0===e)return EK;return(0,tt.createElement)(mo,{width:"20",height:"20",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",isPressed:t},(0,tt.createElement)(uo,{d:{1:"M9 5h2v10H9v-4H5v4H3V5h2v4h4V5zm6.6 0c-.6.9-1.5 1.7-2.6 2v1h2v7h2V5h-1.4z",2:"M7 5h2v10H7v-4H3v4H1V5h2v4h4V5zm8 8c.5-.4.6-.6 1.1-1.1.4-.4.8-.8 1.2-1.3.3-.4.6-.8.9-1.3.2-.4.3-.8.3-1.3 0-.4-.1-.9-.3-1.3-.2-.4-.4-.7-.8-1-.3-.3-.7-.5-1.2-.6-.5-.2-1-.2-1.5-.2-.4 0-.7 0-1.1.1-.3.1-.7.2-1 .3-.3.1-.6.3-.9.5-.3.2-.6.4-.8.7l1.2 1.2c.3-.3.6-.5 1-.7.4-.2.7-.3 1.2-.3s.9.1 1.3.4c.3.3.5.7.5 1.1 0 .4-.1.8-.4 1.1-.3.5-.6.9-1 1.2-.4.4-1 .9-1.6 1.4-.6.5-1.4 1.1-2.2 1.6V15h8v-2H15z",3:"M12.1 12.2c.4.3.8.5 1.2.7.4.2.9.3 1.4.3.5 0 1-.1 1.4-.3.3-.1.5-.5.5-.8 0-.2 0-.4-.1-.6-.1-.2-.3-.3-.5-.4-.3-.1-.7-.2-1-.3-.5-.1-1-.1-1.5-.1V9.1c.7.1 1.5-.1 2.2-.4.4-.2.6-.5.6-.9 0-.3-.1-.6-.4-.8-.3-.2-.7-.3-1.1-.3-.4 0-.8.1-1.1.3-.4.2-.7.4-1.1.6l-1.2-1.4c.5-.4 1.1-.7 1.6-.9.5-.2 1.2-.3 1.8-.3.5 0 1 .1 1.6.2.4.1.8.3 1.2.5.3.2.6.5.8.8.2.3.3.7.3 1.1 0 .5-.2.9-.5 1.3-.4.4-.9.7-1.5.9v.1c.6.1 1.2.4 1.6.8.4.4.7.9.7 1.5 0 .4-.1.8-.3 1.2-.2.4-.5.7-.9.9-.4.3-.9.4-1.3.5-.5.1-1 .2-1.6.2-.8 0-1.6-.1-2.3-.4-.6-.2-1.1-.6-1.6-1l1.1-1.4zM7 9H3V5H1v10h2v-4h4v4h2V5H7v4z",4:"M9 15H7v-4H3v4H1V5h2v4h4V5h2v10zm10-2h-1v2h-2v-2h-5v-2l4-6h3v6h1v2zm-3-2V7l-2.8 4H16z",5:"M12.1 12.2c.4.3.7.5 1.1.7.4.2.9.3 1.3.3.5 0 1-.1 1.4-.4.4-.3.6-.7.6-1.1 0-.4-.2-.9-.6-1.1-.4-.3-.9-.4-1.4-.4H14c-.1 0-.3 0-.4.1l-.4.1-.5.2-1-.6.3-5h6.4v1.9h-4.3L14 8.8c.2-.1.5-.1.7-.2.2 0 .5-.1.7-.1.5 0 .9.1 1.4.2.4.1.8.3 1.1.6.3.2.6.6.8.9.2.4.3.9.3 1.4 0 .5-.1 1-.3 1.4-.2.4-.5.8-.9 1.1-.4.3-.8.5-1.3.7-.5.2-1 .3-1.5.3-.8 0-1.6-.1-2.3-.4-.6-.2-1.1-.6-1.6-1-.1-.1 1-1.5 1-1.5zM9 15H7v-4H3v4H1V5h2v4h4V5h2v10z",6:"M9 15H7v-4H3v4H1V5h2v4h4V5h2v10zm8.6-7.5c-.2-.2-.5-.4-.8-.5-.6-.2-1.3-.2-1.9 0-.3.1-.6.3-.8.5l-.6.9c-.2.5-.2.9-.2 1.4.4-.3.8-.6 1.2-.8.4-.2.8-.3 1.3-.3.4 0 .8 0 1.2.2.4.1.7.3 1 .6.3.3.5.6.7.9.2.4.3.8.3 1.3s-.1.9-.3 1.4c-.2.4-.5.7-.8 1-.4.3-.8.5-1.2.6-1 .3-2 .3-3 0-.5-.2-1-.5-1.4-.9-.4-.4-.8-.9-1-1.5-.2-.6-.3-1.3-.3-2.1s.1-1.6.4-2.3c.2-.6.6-1.2 1-1.6.4-.4.9-.7 1.4-.9.6-.3 1.1-.4 1.7-.4.7 0 1.4.1 2 .3.5.2 1 .5 1.4.8 0 .1-1.3 1.4-1.3 1.4zm-2.4 5.8c.2 0 .4 0 .6-.1.2 0 .4-.1.5-.2.1-.1.3-.3.4-.5.1-.2.1-.5.1-.7 0-.4-.1-.8-.4-1.1-.3-.2-.7-.3-1.1-.3-.3 0-.7.1-1 .2-.4.2-.7.4-1 .7 0 .3.1.7.3 1 .1.2.3.4.4.6.2.1.3.3.5.3.2.1.5.2.7.1z"}[e]}))}function A7({level:e,onChange:t}){const n=[1,2,3,4,5,6,0].map((n=>{const r=n===e;return{icon:(0,tt.createElement)(L7,{level:n,isPressed:r}),title:0===n?er("Paragraph"):pn(er("Heading %d"),n),isActive:r,onClick:()=>t(n)}}));return(0,tt.createElement)(ck,{label:er("Change heading level"),icon:(0,tt.createElement)(L7,{level:e}),controls:n})}const S7={apiVersion:2,name:"core/site-title",title:"Site Title",category:"design",description:"Displays and allows editing the name of the site. The site title usually appears in the browser title bar, in search results, and more. Also available in Settings > General.",textdomain:"default",attributes:{level:{type:"number",default:1},textAlign:{type:"string"}},supports:{align:["wide","full"],html:!1,color:{gradients:!0,text:!1,link:!0},spacing:{padding:!0,margin:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalTextTransform:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalLetterSpacing:!0}},editorStyle:"wp-block-site-title-editor"},{name:C7}=S7,T7={icon:E7,edit:function({attributes:e,setAttributes:t,insertBlocksAfter:n}){const{level:r,textAlign:o}=e,[a,i]=md("root","site","title"),{canUserEdit:s,readOnlyTitle:l}=Tl((e=>{const{canUser:t,getEntityRecord:n}=e(yd),r=n("root","__unstableBase");return{canUserEdit:t("update","settings"),readOnlyTitle:xa(null==r?void 0:r.name)}}),[]),c=0===r?"p":`h${r}`,u=VR({className:so()({[`has-text-align-${o}`]:o,"wp-block-site-title__placeholder":!s&&!l})}),d=s?(0,tt.createElement)(c,u,(0,tt.createElement)(Cj,{tagName:"a","aria-label":er("Site title text"),placeholder:er("Write site title…"),value:a||l,onChange:i,allowedFormats:[],disableLineBreaks:!0,__unstableOnSplitAtEnd:()=>n(Ho(Do()))})):(0,tt.createElement)(c,u,(0,tt.createElement)("a",{href:"#site-title-pseudo-link",onClick:e=>e.preventDefault()},l||er("Site Title placeholder")));return(0,tt.createElement)(tt.Fragment,null,(0,tt.createElement)(lk,{group:"block"},(0,tt.createElement)(A7,{level:r,onChange:e=>t({level:e})}),(0,tt.createElement)(gD,{value:o,onChange:e=>{t({textAlign:e})}})),d)}};function x7(e,t){return e&&t?e+"//"+t:null}function z7(e){return pn(er("Area: %s"),e)}function O7(){return(0,tt.createElement)("div",{className:"wp-block-template-part__selection-preview-item is-placeholder",tabIndex:0})}function N7({templatePart:e,setAttributes:t,onClose:n,composite:r}){const{slug:o,theme:a,title:{rendered:i}}=e,s=e.content.raw||"",l=(0,tt.useMemo)((()=>ns(s)),[s]),{createSuccessNotice:c}=ld(UI),u=(0,tt.useCallback)((()=>{t({slug:o,theme:a,area:void 0}),c(pn(er('Template Part "%s" inserted.'),i||o),{type:"snackbar"}),n()}),[o,a]);return(0,tt.createElement)(Pg,ot({as:"div",className:"wp-block-template-part__selection-preview-item",role:"option",onClick:u,onKeyDown:e=>{rm!==e.keyCode&&32!==e.keyCode||u()},tabIndex:0,"aria-label":i||o},r),(0,tt.createElement)(lW,{blocks:l}),(0,tt.createElement)("div",{className:"wp-block-template-part__selection-preview-item-title"},i||o))}function D7({title:e,icon:t,children:n}){return(0,tt.createElement)(tt.Fragment,null,(0,tt.createElement)("div",{className:"wp-block-template-part__selection-panel-group-header"},(0,tt.createElement)("span",{className:"wp-block-template-part__selection-panel-group-title"},e),(0,tt.createElement)(Tf,{icon:t})),(0,tt.createElement)("div",{className:"wp-block-template-part__selection-panel-group-content"},n))}function B7({templateParts:e,setAttributes:t,onClose:n,composite:r,area:o="uncategorized",labelsByArea:a}){const{templatePartsByArea:i,templatePartsToShow:s}=(0,tt.useMemo)((()=>{const t=e.filter((e=>"uncategorized"===o||e.area===o))||[];return{templatePartsByArea:Object.values((0,at.groupBy)(t,"area")),templatePartsToShow:(0,at.flatten)(t)}}),[e,o]),l=kW(s);return s.length?i.map((e=>(0,tt.createElement)(D7,{key:e[0].area,title:z7(a[e[0].area]||a.uncategorized)},e.map((e=>l.includes(e)?(0,tt.createElement)(N7,{key:e.id,templatePart:e,setAttributes:t,onClose:n,composite:r}):(0,tt.createElement)(O7,{key:e.id})))))):(0,tt.createElement)(D7,{title:z7(a[o]||a.uncategorized)},pn("There is no other %s available. If you are looking for another type of template part, try searching for it using the input above.",o&&"uncategorized"!==o?a[o]||o:er("Template Part")))}function I7({templateParts:e,setAttributes:t,filterValue:n,onClose:r,composite:o,labelsByArea:a}){const{filteredTPs:i,groupedResults:s}=(0,tt.useMemo)((()=>{const t=(0,at.deburr)(n).toLowerCase(),r=e.filter((({title:{rendered:e},area:n})=>(0,at.deburr)(e).toLowerCase().includes(t)||(0,at.deburr)(a[n]).toLowerCase().includes(t)));r.sort(((e,n)=>{const r=(0,at.deburr)(e.title.rendered).toLowerCase().indexOf(t),o=(0,at.deburr)(n.title.rendered).toLowerCase().indexOf(t);return-1!==r&&-1!==o?r-o:-1!==r?-1:-1!==o?1:(0,at.deburr)(a[e.area]).toLowerCase().indexOf(t)-(0,at.deburr)(a[n.area]).toLowerCase().indexOf(t)}));const o=[];for(let e=0;e(0,tt.createElement)(D7,{key:e[0].id,title:z7(a[e[0].area]||a.uncategorized)},e.map((e=>l.includes(e)?(0,tt.createElement)(N7,{key:e.id,templatePart:e,setAttributes:t,onClose:r,composite:o}):(0,tt.createElement)(O7,{key:e.id}))))))}function P7({setAttributes:e,filterValue:t,onClose:n,area:r,templatePartId:o}){const a=eB(),{templateParts:i,labelsByArea:s}=Tl((e=>{const t=(e(yd).getEntityRecords("postType","wp_template_part",{per_page:-1})||[]).filter((e=>x7(e.theme,e.slug)!==o)),n=e("core/editor").__experimentalGetDefaultTemplatePartAreas(),r={};return n.forEach((e=>{r[e.area]=e.label})),{templateParts:t,labelsByArea:r}}),[]);return i&&i.length?t?(0,tt.createElement)(cB,ot({},a,{role:"listbox","aria-label":er("List of template parts")}),(0,tt.createElement)(I7,{templateParts:i,setAttributes:e,filterValue:t,onClose:n,composite:a,labelsByArea:s})):(0,tt.createElement)(cB,ot({},a,{role:"listbox","aria-label":er("List of template parts")}),(0,tt.createElement)(B7,{templateParts:i,setAttributes:e,onClose:n,composite:a,area:r,labelsByArea:s})):(0,tt.createElement)(D7,null,er("There are no existing template parts to select."))}function R7({setAttributes:e,onClose:t,area:n,templatePartId:r=null}){const[o,a]=(0,tt.useState)("");return(0,tt.createElement)("div",null,(0,tt.createElement)(vP,{value:o,onChange:a,className:"wp-block-template-part__selection-preview-search-form"}),(0,tt.createElement)("div",{className:"wp-block-template-part__selection-preview-container"},(0,tt.createElement)(P7,{setAttributes:e,filterValue:o,onClose:t,area:n,templatePartId:r})))}function Y7({area:e,clientId:t,onCreate:n}){const r=e?`core/template-part/${e}`:"core/template-part";return(0,tt.createElement)(zH,{clientId:t,startBlankComponent:(0,tt.createElement)(W7,{onCreate:n}),onBlockPatternSelect:n,filterPatternsFn:e=>{var t,n;return null==e||null===(t=e.blockTypes)||void 0===t||null===(n=t.some)||void 0===n?void 0:n.call(t,(e=>e===r))}})}function W7({onCreate:e}){return(0,tt.useEffect)((()=>{e()}),[]),null}const H7=1,q7=2;function j7({area:e,clientId:t,setAttributes:n,enableSelection:r,hasResolvedReplacements:o}){const{saveEntityRecord:a}=ld(yd),[i,s]=(0,tt.useState)(H7),{areaIcon:l,areaLabel:c}=Tl((t=>{const n=t("core/editor").__experimentalGetDefaultTemplatePartAreas(),r=(0,at.find)(n,{area:e}),o=(0,at.find)(n,{area:"uncategorized"});return{areaIcon:(null==r?void 0:r.icon)||(null==o?void 0:o.icon),areaLabel:(null==r?void 0:r.label)||er("Template Part")}}),[e]),u=(0,tt.useCallback)((async(t=[])=>{const r={title:er("Untitled Template Part"),slug:"template-part",content:gi(t),area:e},o=await a("postType","wp_template_part",r);n({slug:o.slug,theme:o.theme,area:void 0})}),[n,e]);return(0,tt.createElement)(tt.Fragment,null,i===H7&&(0,tt.createElement)(vH,{icon:l,label:c,instructions:pn(r?"Choose an existing %s or create a new one.":"Create a new %s.",c.toLowerCase())},o?(0,tt.createElement)(Xg,{contentClassName:"wp-block-template-part__placeholder-preview-dropdown-content",position:"bottom right left",renderToggle:({isOpen:e,onToggle:t})=>(0,tt.createElement)(tt.Fragment,null,r&&(0,tt.createElement)(Eh,{variant:"primary",onClick:t,"aria-expanded":e},er("Choose existing")),(0,tt.createElement)(Eh,{variant:r?"tertiary":"primary",onClick:()=>s(q7)},pn("New %s",c.toLowerCase()))),renderContent:({onClose:t})=>(0,tt.createElement)(R7,{setAttributes:n,onClose:t,area:e})}):(0,tt.createElement)(cq,null)),i===q7&&(0,tt.createElement)(Y7,{area:e,onCreate:u,clientId:t}))}function F7({tagName:e,setAttributes:t,isEntityAvailable:n,templatePartId:r,defaultWrapper:o}){const[a,i]=md("postType","wp_template_part","area",r),[s,l]=md("postType","wp_template_part","title",r),{areaOptions:c}=Tl((e=>({areaOptions:e("core/editor").__experimentalGetDefaultTemplatePartAreas().map((({label:e,area:t})=>({label:e,value:t})))})),[]);return(0,tt.createElement)(WA,null,n&&(0,tt.createElement)(tt.Fragment,null,(0,tt.createElement)(LA,{label:er("Title"),value:s,onChange:e=>{l(e)},onFocus:e=>e.target.select()}),(0,tt.createElement)(KS,{label:er("Area"),labelPosition:"top",options:c,value:a,onChange:i})),(0,tt.createElement)(KS,{label:er("HTML element"),options:[{label:pn(er("Default based on area (%s)"),`<${o}>`),value:""},{label:"",value:"header"},{label:"",value:"main"},{label:"",value:"section"},{label:"",value:"article"},{label:"",value:"aside"},{label:"",value:"footer"},{label:"",value:"div"}],value:e||"",onChange:e=>t({tagName:e})}))}function V7({postId:e,hasInnerBlocks:t,layout:n,tagName:r,blockProps:o,clientId:a}){const i=Tl((e=>{var t;const{getSettings:n}=e(nk);return null===(t=n())||void 0===t?void 0:t.supportsLayout}),[]),s=JL("layout")||{},l=n&&n.inherit?s:n,[c,u,d]=fd("postType","wp_template_part",{id:e}),p=GH(o,{value:c,onInput:u,onChange:d,renderAppender:t?void 0:JH.ButtonBlockAppender,__experimentalLayout:i?l:void 0});return(0,tt.createElement)(bB,{clientId:a,tagName:r,wrapperProps:p})}const X7=[{name:"header",icon:AV,title:er("Header"),description:er("The Header template defines a page area that typically contains a title, logo, and main navigation."),attributes:{area:"header"},scope:["inserter"]},{name:"footer",icon:SV,title:er("Footer"),description:er("The Footer template defines a page area that typically contains site credits, social links, or any other combination of blocks."),attributes:{area:"footer"},scope:["inserter"]}];X7.forEach((e=>{e.isActive||(e.isActive=(e,t)=>{const{area:n,theme:r,slug:o}=e;if(n)return n===t.area;if(!o)return!1;const a=tn(yd).getEntityRecord("postType","wp_template_part",`${r}//${o}`);return(null==a?void 0:a.area)===t.area})}));const U7=X7;const $7={apiVersion:2,name:"core/template-part",title:"Template Part",category:"theme",description:"Edit the different global regions of your site, like the header, footer, sidebar, or create your own.",textdomain:"default",attributes:{slug:{type:"string"},theme:{type:"string"},tagName:{type:"string"},area:{type:"string"}},supports:{align:!0,html:!1,color:{gradients:!0,link:!0},spacing:{padding:!0},__experimentalLayout:!0},editorStyle:"wp-block-template-part-editor"},{name:K7}=$7,G7={icon:yH,__experimentalLabel:({slug:e,theme:t})=>{var n;if(!e)return;const r=tn(yd).getEntityRecord("postType","wp_template_part",t+"//"+e);return r?(0,at.startCase)((null===(n=r.title)||void 0===n?void 0:n.rendered)||r.slug):void 0},edit:function({attributes:e,setAttributes:t,clientId:n}){const{slug:r,theme:o,tagName:a,layout:i={}}=e,s=x7(o,r),[l,c]=DF(s),{isResolved:u,innerBlocks:d,isMissing:p,defaultWrapper:m,area:f,enableSelection:h,hasResolvedReplacements:g}=Tl((t=>{var r;const{getEditedEntityRecord:o,getEntityRecords:a,hasFinishedResolution:i}=t(yd),{getBlocks:l}=t(nk),c=["postType","wp_template_part",s],u=s?o(...c):null,d=(null==u?void 0:u.area)||e.area,p=["postType","wp_template_part",d&&"uncategorized"!==d&&{area:d}],m=a(...p),f=s?(null==m?void 0:m.length)>1:(null==m?void 0:m.length)>0,h=!!s&&i("getEditedEntityRecord",c),g=null===(r=t("core/editor").__experimentalGetDefaultTemplatePartAreas().find((({area:e})=>e===d)))||void 0===r?void 0:r.area_tag;return{innerBlocks:l(n),isResolved:h,isMissing:h&&!u,defaultWrapper:g||"div",area:d,enableSelection:f,hasResolvedReplacements:i("getEntityRecords",p)}}),[s,n]),b=VR(),v=!r,y=!v&&!p&&u,_=a||m;return 0===d.length&&(r&&!o||r&&p)?(0,tt.createElement)(_,b,(0,tt.createElement)(cR,null,pn(er("Template part has been deleted or is unavailable: %s"),r))):y&&l?(0,tt.createElement)(_,b,(0,tt.createElement)(cR,null,er("Block cannot be rendered inside itself."))):(0,tt.createElement)(c,null,(0,tt.createElement)(F7,{tagName:a,setAttributes:t,isEntityAvailable:y,templatePartId:s,defaultWrapper:m}),v&&(0,tt.createElement)(_,b,(0,tt.createElement)(j7,{area:e.area,clientId:n,setAttributes:t,enableSelection:h,hasResolvedReplacements:g})),y&&h&&(0,tt.createElement)(lk,null,(0,tt.createElement)(tb,{className:"wp-block-template-part__block-control-group"},(0,tt.createElement)(Xg,{className:"wp-block-template-part__preview-dropdown-button",contentClassName:"wp-block-template-part__preview-dropdown-content",position:"bottom right left",renderToggle:({isOpen:e,onToggle:t})=>(0,tt.createElement)(jg,{"aria-expanded":e,onClick:t,disabled:e},er("Replace")),renderContent:({onClose:e})=>(0,tt.createElement)(R7,{setAttributes:t,onClose:e,area:f,templatePartId:s})}))),y&&(0,tt.createElement)(V7,{clientId:n,tagName:_,blockProps:b,postId:s,hasInnerBlocks:d.length>0,layout:i}),!v&&!u&&(0,tt.createElement)(_,b,(0,tt.createElement)(cq,null)))}};In("blocks.registerBlockType","core/template-part",(function(e,t){if("core/template-part"!==t)return e;if(!e.variations||!e.variations.length)return{...e,variations:U7};if(e.variations){const t=(e,t)=>{const{area:n,theme:r,slug:o}=e;if(n)return n===t.area;if(!o)return!1;const a=tn(yd).getEntityRecord("postType","wp_template_part",`${r}//${o}`);return(null==a?void 0:a.area)===t.area},n=e.variations.map((e=>{return{...e,...!e.isActive&&{isActive:t},..."string"==typeof e.icon&&{icon:(n=e.icon,"header"===n?AV:"footer"===n?SV:"sidebar"===n?CV:yH)}};var n}));return{...e,variations:n}}return e}));const J7=(0,tt.createElement)(mo,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,tt.createElement)(uo,{d:"M18.1823 11.6392C18.1823 13.0804 17.0139 14.2487 15.5727 14.2487C14.3579 14.2487 13.335 13.4179 13.0453 12.2922L13.0377 12.2625L13.0278 12.2335L12.3985 10.377L12.3942 10.3785C11.8571 8.64997 10.246 7.39405 8.33961 7.39405C5.99509 7.39405 4.09448 9.29465 4.09448 11.6392C4.09448 13.9837 5.99509 15.8843 8.33961 15.8843C8.88499 15.8843 9.40822 15.781 9.88943 15.5923L9.29212 14.0697C8.99812 14.185 8.67729 14.2487 8.33961 14.2487C6.89838 14.2487 5.73003 13.0804 5.73003 11.6392C5.73003 10.1979 6.89838 9.02959 8.33961 9.02959C9.55444 9.02959 10.5773 9.86046 10.867 10.9862L10.8772 10.9836L11.4695 12.7311C11.9515 14.546 13.6048 15.8843 15.5727 15.8843C17.9172 15.8843 19.8178 13.9837 19.8178 11.6392C19.8178 9.29465 17.9172 7.39404 15.5727 7.39404C15.0287 7.39404 14.5066 7.4968 14.0264 7.6847L14.6223 9.20781C14.9158 9.093 15.2358 9.02959 15.5727 9.02959C17.0139 9.02959 18.1823 10.1979 18.1823 11.6392Z"})),Q7=(0,tt.createElement)(mo,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,tt.createElement)(uo,{d:"M17 4h-2v4.5h2V7h3V5.5h-3V4zM4 5.5h9V7H4V5.5zm16 5.75h-9v1.5h9v-1.5zm-16 0h3V10h2v4.25H7v-1.5H4v-1.5zM9 17H4v1.5h5V17zm4 0h7v1.5h-7V20h-2v-4.25h2V17z"}));function Z7({attributes:{query:e,displayLayout:t},setQuery:n,setDisplayLayout:r}){const o=Qk(Z7,"blocks-query-pagination-max-page-input"),a=[{icon:W3,title:er("List view"),onClick:()=>r({type:"list"}),isActive:"list"===(null==t?void 0:t.type)},{icon:MH,title:er("Grid view"),onClick:()=>r({type:"flex",columns:(null==t?void 0:t.columns)||3}),isActive:"flex"===(null==t?void 0:t.type)}];return(0,tt.createElement)(tt.Fragment,null,!e.inherit&&(0,tt.createElement)(tb,null,(0,tt.createElement)(Xg,{contentClassName:"block-library-query-toolbar__popover",renderToggle:({onToggle:e})=>(0,tt.createElement)(jg,{icon:Q7,label:er("Display settings"),onClick:e}),renderContent:()=>(0,tt.createElement)(tt.Fragment,null,(0,tt.createElement)(EA,null,(0,tt.createElement)(BL,{__unstableInputWidth:"60px",label:er("Items per Page"),labelPosition:"edge",min:1,max:100,onChange:e=>{isNaN(e)||e<1||e>100||n({perPage:e})},step:"1",value:e.perPage,isDragEnabled:!1})),(0,tt.createElement)(EA,null,(0,tt.createElement)(BL,{__unstableInputWidth:"60px",label:er("Offset"),labelPosition:"edge",min:0,max:100,onChange:e=>{isNaN(e)||e<0||e>100||n({offset:e})},step:"1",value:e.offset,isDragEnabled:!1})),(0,tt.createElement)(EA,{id:o,help:er("Limit the pages you want to show, even if the query has more results. To show all pages use 0 (zero).")},(0,tt.createElement)(BL,{id:o,__unstableInputWidth:"60px",label:er("Max page to show"),labelPosition:"edge",min:0,onChange:e=>{isNaN(e)||e<0||n({pages:e})},step:"1",value:e.pages,isDragEnabled:!1})))})),(0,tt.createElement)(tb,{controls:a}))}const e8=e=>{const t=null==e?void 0:e.reduce(((e,t)=>{const{mapById:n,mapByName:r,names:o}=e;return n[t.id]=t,r[t.name]=t,o.push(t.name),e}),{mapById:{},mapByName:{},names:[]});return{terms:e,...t}},t8=[{label:er("Include"),value:""},{label:er("Exclude"),value:"exclude"},{label:er("Only"),value:"only"}];function n8({attributes:{query:e,displayLayout:t},setQuery:n,setDisplayLayout:r}){var o,a;const{order:i,orderBy:s,author:l,postType:c,sticky:u,inherit:d}=e,[p,m]=(0,tt.useState)(!0),[f,h]=(0,tt.useState)(!0),[g,b]=(0,tt.useState)("post"===c),{postTypesTaxonomiesMap:v,postTypesSelectOptions:y}=(()=>{const{postTypes:e}=Tl((e=>{var t;const{getPostTypes:n}=e(yd),r=["attachment"];return{postTypes:null===(t=n({per_page:-1}))||void 0===t?void 0:t.filter((({viewable:e,slug:t})=>e&&!r.includes(t)))}}),[]);return{postTypesTaxonomiesMap:(0,tt.useMemo)((()=>{if(null!=e&&e.length)return e.reduce(((e,t)=>(e[t.slug]=t.taxonomies,e)),{})}),[e]),postTypesSelectOptions:(0,tt.useMemo)((()=>(e||[]).map((({labels:e,slug:t})=>({label:e.singular_name,value:t})))),[e])}})(),{authorList:_,categories:M,tags:k}=Tl((e=>{const{getEntityRecords:t}=e(yd),n={per_page:100},r=t("taxonomy","category",n),o=t("taxonomy","post_tag",n);return{categories:e8(r),tags:e8(o),authorList:t("root","user",{per_page:-1})}}),[]);(0,tt.useEffect)((()=>{if(!v)return;const e=v[c];m(e.includes("category")),h(e.includes("post_tag"))}),[c,v]),(0,tt.useEffect)((()=>{b("post"===c)}),[c]);const w=(e,t)=>r=>{const o=Array.from(r.reduce(((t,n)=>{const r=((e,t)=>{var n;const r=(null==t?void 0:t.id)||(null===(n=e[t])||void 0===n?void 0:n.id);if(r)return r;const o=t.toLocaleLowerCase();for(const t in e)if(t.toLocaleLowerCase()===o)return e[t].id})(e.mapByName,n);return r&&t.add(r),t}),new Set));n({[t]:o})},E=w(M,"categoryIds"),L=w(k,"tagIds"),[A,S]=(0,tt.useState)(e.search),C=(0,tt.useCallback)((0,at.debounce)((()=>{e.search!==A&&n({search:A})}),250),[A,e.search]);(0,tt.useEffect)((()=>(C(),C.cancel)),[A,C]);const T=t=>{const n={category:{queryProp:"categoryIds",terms:M},post_tag:{queryProp:"tagIds",terms:k}}[t];return(e[n.queryProp]||[]).reduce(((e,t)=>{const r=n.terms.mapById[t];return r&&e.push({id:t,value:r.name}),e}),[])};return(0,tt.createElement)(FA,null,(0,tt.createElement)(BA,{title:er("Settings")},(0,tt.createElement)(KN,{label:er("Inherit query from template"),help:er("Toggle to use the global query context that is set with the current template, such as an archive or search. Disable to customize the settings independently."),checked:!!d,onChange:e=>n({inherit:!!e})}),!d&&(0,tt.createElement)(KS,{options:y,value:c,label:er("Post Type"),onChange:e=>{const t={postType:e};v[e].includes("category")||(t.categoryIds=[]),v[e].includes("post_tag")||(t.tagIds=[]),"post"!==e&&(t.sticky=""),n(t)},help:er('WordPress contains different types of content and they are divided into collections called "Post Types". By default there are a few different ones such as blog posts and pages, but plugins could add more.')}),"flex"===(null==t?void 0:t.type)&&(0,tt.createElement)(tt.Fragment,null,(0,tt.createElement)(rT,{label:er("Columns"),value:t.columns,onChange:e=>r({columns:e}),min:2,max:Math.max(6,t.columns)}),t.columns>6&&(0,tt.createElement)(RT,{status:"warning",isDismissible:!1},er("This column count exceeds the recommended amount and may cause visual breakage."))),!d&&(0,tt.createElement)(Y3,{order:i,orderBy:s,onOrderChange:e=>n({order:e}),onOrderByChange:e=>n({orderBy:e})}),g&&(0,tt.createElement)(KS,{label:er("Sticky posts"),options:t8,value:u,onChange:e=>n({sticky:e}),help:er('Blog posts can be "stickied", a feature that places them at the top of the front page of posts, keeping it there until new sticky posts are published.')})),!d&&(0,tt.createElement)(BA,{title:er("Filters")},p&&(null==M||null===(o=M.terms)||void 0===o?void 0:o.length)>0&&(0,tt.createElement)(P3,{label:er("Categories"),value:T("category"),suggestions:M.names,onChange:E}),f&&(null==k||null===(a=k.terms)||void 0===a?void 0:a.length)>0&&(0,tt.createElement)(P3,{label:er("Tags"),value:T("post_tag"),suggestions:k.names,onChange:L}),(0,tt.createElement)(Y3,{selectedAuthorId:l,authorList:_,onAuthorChange:e=>n({author:""!==e?+e:void 0})}),(0,tt.createElement)(LA,{label:er("Keyword"),value:A,onChange:S})))}const r8=({clientId:e,name:t,attributes:n,setAttributes:r})=>{var o;const{blockType:a,defaultVariation:i,scopeVariations:s,allVariations:l}=Tl((e=>{const{getBlockVariations:n,getBlockType:r,getDefaultBlockVariation:o}=e(Gr);return{blockType:r(t),defaultVariation:o(t,"block"),scopeVariations:n(t,"block"),allVariations:n(t)}}),[t]),{replaceInnerBlocks:c}=ld(nk),u=VR(),d=aF(n,l),p=(null==d?void 0:d.icon)||(null==a||null===(o=a.icon)||void 0===o?void 0:o.src),m=(null==d?void 0:d.title)||(null==a?void 0:a.title);return(0,tt.createElement)("div",u,(0,tt.createElement)(_H,{icon:p,label:m,variations:s,onSelect:(t=i)=>{t.attributes&&r(t.attributes),t.innerBlocks&&c(e,qo(t.innerBlocks),!1)}}))},o8=[["core/post-template"]];function a8({attributes:e,setAttributes:t}){const{queryId:n,query:r,displayLayout:o,tagName:a="div",layout:i={}}=e,{__unstableMarkNextChangeAsNotPersistent:s}=ld(nk),l=Qk(a8),{themeSupportsLayout:c}=Tl((e=>{var t;const{getSettings:n}=e(nk);return{themeSupportsLayout:null===(t=n())||void 0===t?void 0:t.supportsLayout}}),[]),u=JL("layout")||{},d=i&&i.inherit?u:i,p=GH(VR(),{template:o8,__experimentalLayout:c?d:void 0}),{postsPerPage:m}=Tl((e=>{const{getSettings:t}=e(nk);return{postsPerPage:+t().postsPerPage||3}}),[]);(0,tt.useEffect)((()=>{const e={};!r.perPage&&m&&(e.perPage=m),Object.keys(e).length&&(s(),f(e))}),[r.perPage]),(0,tt.useEffect)((()=>{n||(s(),t({queryId:l}))}),[n,l]);const f=e=>t({query:{...r,...e}}),h=e=>t({displayLayout:{...o,...e}});return(0,tt.createElement)(tt.Fragment,null,(0,tt.createElement)(n8,{attributes:e,setQuery:f,setDisplayLayout:h}),(0,tt.createElement)(lk,null,(0,tt.createElement)(Z7,{attributes:e,setQuery:f,setDisplayLayout:h})),(0,tt.createElement)(WA,null,(0,tt.createElement)(KS,{label:er("HTML element"),options:[{label:er("Default (
)"),value:"div"},{label:"
",value:"main"},{label:"",value:"section"},{label:"",value:"aside"}],value:a,onChange:e=>t({tagName:e})})),(0,tt.createElement)(a,p))}function i8(e){const{clientId:t,name:n}=e,r=VR(),{replaceBlock:o,selectBlock:a}=ld(nk);return(0,tt.createElement)("div",r,(0,tt.createElement)(zH,{blockName:n,clientId:t,startBlankComponent:(0,tt.createElement)(r8,e),onBlockPatternSelect:e=>{const n=e.map((e=>Fo(e))),r=(e=>{const t=[...e];for(;t.length>0;){var n;const e=t.shift();if("core/query"===e.name)return e.clientId;null===(n=e.innerBlocks)||void 0===n||n.forEach((e=>{t.push(e)}))}})(n);o(t,n),r&&a(r)}}))}const s8=e=>{const{clientId:t}=e,n=Tl((e=>!!e(nk).getBlocks(t).length),[t])?a8:i8;return(0,tt.createElement)(n,e)};const l8=(0,tt.createElement)(mo,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 48 48"},(0,tt.createElement)(uo,{d:"M41 9H7v3h34V9zm-22 5H7v1h12v-1zM7 26h12v1H7v-1zm34-5H7v3h34v-3zM7 38h12v1H7v-1zm34-5H7v3h34v-3z"})),c8=(0,tt.createElement)(mo,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 48 48"},(0,tt.createElement)(uo,{d:"M41 9H7v3h34V9zm-4 5H7v1h30v-1zm4 3H7v1h34v-1zM7 20h30v1H7v-1zm0 12h30v1H7v-1zm34 3H7v1h34v-1zM7 38h30v1H7v-1zm34-11H7v3h34v-3z"})),u8=(0,tt.createElement)(mo,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 48 48"},(0,tt.createElement)(uo,{d:"M41 9H7v3h34V9zm-22 5H7v1h12v-1zm22 3H7v1h34v-1zM7 20h34v1H7v-1zm0 12h12v1H7v-1zm34 3H7v1h34v-1zM7 38h34v1H7v-1zm34-11H7v3h34v-3z"})),d8=(0,tt.createElement)(mo,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 48 48"},(0,tt.createElement)(uo,{d:"M7 9h34v6H7V9zm12 8H7v1h12v-1zm18 3H7v1h30v-1zm0 18H7v1h30v-1zM7 35h12v1H7v-1zm34-8H7v6h34v-6z"})),p8={query:{perPage:3,pages:0,offset:0,postType:"post",categoryIds:[],tagIds:[],order:"desc",orderBy:"date",author:"",search:"",exclude:[],sticky:"",inherit:!1}},m8=[{name:"posts-list",title:er("Posts List"),description:er("Display a list of your most recent posts, excluding sticky posts."),icon:k3,attributes:{query:{perPage:4,pages:1,offset:0,postType:"post",categoryIds:[],tagIds:[],order:"desc",orderBy:"date",author:"",search:"",sticky:"exclude",inherit:!1}},scope:["inserter"]},{name:"title-date",title:er("Title & Date"),icon:l8,attributes:{...p8},innerBlocks:[["core/post-template",{},[["core/post-title"],["core/post-date"]]]],scope:["block"]},{name:"title-excerpt",title:er("Title & Excerpt"),icon:c8,attributes:{...p8},innerBlocks:[["core/post-template",{},[["core/post-title"],["core/post-excerpt"]]]],scope:["block"]},{name:"title-date-excerpt",title:er("Title, Date, & Excerpt"),icon:u8,attributes:{...p8},innerBlocks:[["core/post-template",{},[["core/post-title"],["core/post-date"],["core/post-excerpt"]]]],scope:["block"]},{name:"image-date-title",title:er("Image, Date, & Title"),icon:d8,attributes:{...p8},innerBlocks:[["core/post-template",{},[["core/post-featured-image"],["core/post-date"],["core/post-title"]]]],scope:["block"]}],f8=[{attributes:{queryId:{type:"number"},query:{type:"object",default:{perPage:null,pages:0,offset:0,postType:"post",categoryIds:[],tagIds:[],order:"desc",orderBy:"date",author:"",search:"",exclude:[],sticky:"",inherit:!0}},layout:{type:"object",default:{type:"list"}}},supports:{html:!1},migrate:e=>({...(0,at.omit)(e,["layout"]),displayLayout:e.layout}),save:()=>(0,tt.createElement)(JH.Content,null)}],h8=({attributes:{query:{postType:e}={}}={}})=>{if(!e)return null;const t=Pl("post-new.php",{post_type:e});return(0,tt.createElement)("div",{className:"wp-block-query__create-new-link"},TP(er("Create a new post for this feed."),{a:(0,tt.createElement)("a",{href:t})}))},g8=ri((e=>t=>{const{name:n,isSelected:r}=t;return"core/query"===n&&r?(0,tt.createElement)(tt.Fragment,null,(0,tt.createElement)(FA,null,(0,tt.createElement)(h8,t)),(0,tt.createElement)(e,ot({key:"edit"},t))):(0,tt.createElement)(e,ot({key:"edit"},t))}),"withInspectorControls"),b8={apiVersion:2,name:"core/query",title:"Query Loop",category:"theme",description:"An advanced block that allows displaying post types based on different query parameters and visual configurations.",textdomain:"default",attributes:{queryId:{type:"number"},query:{type:"object",default:{perPage:null,pages:0,offset:0,postType:"post",categoryIds:[],tagIds:[],order:"desc",orderBy:"date",author:"",search:"",exclude:[],sticky:"",inherit:!0}},tagName:{type:"string",default:"div"},displayLayout:{type:"object",default:{type:"list"}}},providesContext:{queryId:"queryId",query:"query",displayLayout:"displayLayout"},supports:{align:["wide","full"],html:!1,color:{gradients:!0,link:!0},__experimentalLayout:!0},editorStyle:"wp-block-query-editor"},{name:v8}=b8,y8={icon:J7,edit:s8,save:function({attributes:{tagName:e="div"}}){return(0,tt.createElement)(e,VR.save(),(0,tt.createElement)(JH.Content,null))},variations:m8,deprecated:f8};In("editor.BlockEdit","core/query",g8);const _8=[["core/post-title"],["core/post-date"],["core/post-excerpt"]];const M8={apiVersion:2,name:"core/post-template",title:"Post Template",category:"design",parent:["core/query"],description:"Contains the block elements used to render a post, like the title, date, featured image, content or excerpt, and more.",textdomain:"default",usesContext:["queryId","query","queryContext","displayLayout","templateSlug"],supports:{reusable:!1,html:!1,align:!0},style:"wp-block-post-template",editorStyle:"wp-block-post-template-editor"},{name:k8}=M8,w8={icon:J7,edit:function({clientId:e,context:{query:{perPage:t,offset:n,categoryIds:r=[],postType:o,tagIds:a=[],order:i,orderBy:s,author:l,search:c,exclude:u,sticky:d,inherit:p}={},queryContext:m=[{page:1}],templateSlug:f,displayLayout:{type:h="flex",columns:g=1}={}}}){const[{page:b}]=m,[v,y]=(0,tt.useState)(),{posts:_,blocks:M}=Tl((m=>{const{getEntityRecords:h}=m(yd),{getBlocks:g}=m(nk),v={offset:t?t*(b-1)+n:0,categories:r,tags:a,order:i,orderby:s};return t&&(v.per_page=t),l&&(v.author=l),c&&(v.search=c),null!=u&&u.length&&(v.exclude=u),d&&(v.sticky="only"===d),p&&null!=f&&f.startsWith("archive-")&&(v.postType=f.replace("archive-",""),o=v.postType),{posts:h("postType",o,v),blocks:g(e)}}),[t,b,n,r,a,i,s,e,l,c,o,u,d,p,f]),k=(0,tt.useMemo)((()=>null==_?void 0:_.map((e=>({postType:e.type,postId:e.id})))),[_]),w="flex"===h&&g>1,E=VR({className:so()({"is-flex-container":w,[`columns-${g}`]:w})}),L=GH({},{template:_8});return _?_.length?(0,tt.createElement)("ul",E,k&&k.map((e=>(0,tt.createElement)(yB,{key:e.postId,value:e},e===(v||k[0])?(0,tt.createElement)("li",L):(0,tt.createElement)("li",null,(0,tt.createElement)(lW,{blocks:M,__experimentalLive:!0,__experimentalOnClick:()=>y(e)})))))):(0,tt.createElement)("p",E," ",er("No results found.")):(0,tt.createElement)("p",E,(0,tt.createElement)(cq,null))},save:function(){return(0,tt.createElement)(JH.Content,null)}},E8=["archive"];const L8=(0,tt.createElement)(mo,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,tt.createElement)(uo,{stroke:"#1E1E1E",strokeWidth:"1.5",d:"M4 19.25h9M4 15.25h16"}),(0,tt.createElement)(uo,{d:"M8.994 10.103H6.08L5.417 12H4l2.846-8h1.383l2.845 8H9.657l-.663-1.897zm-.457-1.28l-.994-2.857-1.006 2.857h2z",fill:"#1E1E1E"})),A8=[{isDefault:!0,name:"archive-title",title:er("Archive Title"),description:er("Display the archive title based on the queried object."),icon:L8,attributes:{type:"archive"},scope:["inserter"]}];A8.forEach((e=>{e.isActive||(e.isActive=(e,t)=>e.type===t.type)}));const S8=A8,C8={apiVersion:2,name:"core/query-title",title:"Query Title",category:"design",description:"Display the query title.",textdomain:"default",attributes:{type:{type:"string"},textAlign:{type:"string"},level:{type:"number",default:1}},supports:{align:["wide","full"],html:!1,color:{gradients:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0}},editorStyle:"wp-block-query-title-editor"},{name:T8}=C8,x8={edit:function({attributes:{type:e,level:t,textAlign:n},setAttributes:r}){const o=`h${t}`,a=VR({className:so()({[`has-text-align-${n}`]:n,"wp-block-query-title__placeholder":"archive"===e})});if(!E8.includes(e))return(0,tt.createElement)("div",a,(0,tt.createElement)(cR,null,er("Provided type is not supported.")));let i;return"archive"===e&&(i=(0,tt.createElement)(o,a,er("Archive title"))),(0,tt.createElement)(tt.Fragment,null,(0,tt.createElement)(lk,{group:"block"},(0,tt.createElement)(FJ,{selectedLevel:t,onChange:e=>r({level:e})}),(0,tt.createElement)(gD,{value:n,onChange:e=>{r({textAlign:e})}})),i)},variations:S8},z8=(0,tt.createElement)(mo,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,tt.createElement)(po,{x:"4",y:"10.5",width:"6",height:"3",rx:"1.5",fill:"#000"}),(0,tt.createElement)(po,{x:"12",y:"10.5",width:"3",height:"3",rx:"1.5",fill:"#000"}),(0,tt.createElement)(po,{x:"17",y:"10.5",width:"3",height:"3",rx:"1.5",fill:"#000"})),O8=[["core/query-pagination-previous"],["core/query-pagination-numbers"],["core/query-pagination-next"]];const N8={apiVersion:2,name:"core/query-pagination",title:"Query Pagination",category:"design",parent:["core/query"],description:"Displays a paginated navigation to next/previous set of posts, when applicable.",textdomain:"default",usesContext:["queryId","query"],supports:{align:!0,reusable:!1,html:!1,color:{gradients:!0,link:!0}},editorStyle:"wp-block-query-pagination-editor",style:"wp-block-query-pagination"},{name:D8}=N8,B8={icon:z8,edit:function(){const e=GH(VR(),{template:O8,allowedBlocks:["core/query-pagination-previous","core/query-pagination-numbers","core/query-pagination-next"],orientation:"horizontal"});return(0,tt.createElement)("div",e)},save:function(){return(0,tt.createElement)("div",VR.save(),(0,tt.createElement)(JH.Content,null))}},I8=(0,tt.createElement)(mo,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,tt.createElement)(po,{x:"6",y:"10.5",width:"3",height:"3",rx:"1.5",fill:"#000"}),(0,tt.createElement)(po,{x:"11",y:"10.5",width:"3",height:"3",rx:"1.5",fill:"#000"}),(0,tt.createElement)(uo,{d:"M16.5 9.5L19 12l-2.5 2.5",stroke:"#1E1E1E",strokeWidth:"1.5"}));const P8={apiVersion:2,name:"core/query-pagination-next",title:"Query Pagination Next",category:"design",parent:["core/query-pagination"],description:"Displays the next posts page link.",textdomain:"default",attributes:{label:{type:"string"}},usesContext:["queryId","query"],supports:{reusable:!1,html:!1,color:{gradients:!0,link:!0},typography:{fontSize:!0,lineHeight:!0}}},{name:R8}=P8,Y8={icon:I8,edit:function({attributes:{label:e},setAttributes:t}){return(0,tt.createElement)(zj,ot({__experimentalVersion:2,tagName:"a","aria-label":er("Next page link"),placeholder:er("Next Page"),value:e,onChange:e=>t({label:e})},VR()))}},W8=(0,tt.createElement)(mo,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,tt.createElement)(po,{x:"4",y:"10.5",width:"6",height:"3",rx:"1.5",fill:"#000"}),(0,tt.createElement)(uo,{d:"M13.5 14v-4l-1.5.5",stroke:"#1E1E1E"}),(0,tt.createElement)(uo,{d:"M19.266 9.805c-.473-.611-1.22-.51-1.702-.367a3.854 3.854 0 00-.718.307l.13 1.082c.192-.17.47-.422.782-.515.34-.1.578.025.668.141.21.27-.034.835-.16 1.055-.49.85-.93 1.594-1.45 2.492H19.5v-1h-.914c.277-.574.814-1.443.914-2.106.052-.343.02-.762-.234-1.09z",fill:"#1E1E1E"})),H8=(e,t="a",n="")=>(0,tt.createElement)(t,{className:`page-numbers ${n}`},e);const q8={apiVersion:2,name:"core/query-pagination-numbers",title:"Query Pagination Numbers",category:"design",parent:["core/query-pagination"],description:"Displays a list of page numbers for pagination",textdomain:"default",usesContext:["queryId","query"],supports:{reusable:!1,html:!1},editorStyle:"query-pagination-numbers-editor"},{name:j8}=q8,F8={icon:W8,edit:function(){const e=(0,tt.createElement)(tt.Fragment,null,H8(1),H8(2),H8(3,"span","current"),H8(4),H8(5),H8("...","span","dots"),H8(8));return(0,tt.createElement)("div",VR(),e)}},V8=(0,tt.createElement)(mo,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,tt.createElement)(po,{x:"18",y:"13.5",width:"3",height:"3",rx:"1.5",transform:"rotate(-180 18 13.5)",fill:"#000"}),(0,tt.createElement)(po,{x:"13",y:"13.5",width:"3",height:"3",rx:"1.5",transform:"rotate(-180 13 13.5)",fill:"#000"}),(0,tt.createElement)(uo,{d:"M7.5 14.5L5 12l2.5-2.5",stroke:"#1E1E1E",strokeWidth:"1.5"}));const X8={apiVersion:2,name:"core/query-pagination-previous",title:"Query Pagination Previous",category:"design",parent:["core/query-pagination"],description:"Displays the previous posts page link.",textdomain:"default",attributes:{label:{type:"string"}},usesContext:["queryId","query"],supports:{reusable:!1,html:!1,color:{gradients:!0,link:!0},typography:{fontSize:!0,lineHeight:!0}}},{name:U8}=X8,$8={icon:V8,edit:function({attributes:{label:e},setAttributes:t}){return(0,tt.createElement)(zj,ot({__experimentalVersion:2,tagName:"a","aria-label":er("Previous page link"),placeholder:er("Previous Page"),value:e,onChange:e=>t({label:e})},VR()))}};const K8=(0,tt.createElement)(mo,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,tt.createElement)(uo,{d:"M6.6 6L5.4 7l4.5 5-4.5 5 1.1 1 5.5-6-5.4-6zm6 0l-1.1 1 4.5 5-4.5 5 1.1 1 5.5-6-5.5-6z"})),G8=(0,tt.createElement)(mo,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,tt.createElement)(uo,{d:"M11.6 7l-1.1-1L5 12l5.5 6 1.1-1L7 12l4.6-5zm6 0l-1.1-1-5.5 6 5.5 6 1.1-1-4.6-5 4.6-5z"})),J8=[{isDefault:!0,name:"post-next",title:er("Next post"),description:er("Displays the post link that follows the current post."),icon:K8,attributes:{type:"next"},scope:["inserter","transform"]},{name:"post-previous",title:er("Previous post"),description:er("Displays the post link that precedes the current post."),icon:G8,attributes:{type:"previous"},scope:["inserter","transform"]}];J8.forEach((e=>{e.isActive||(e.isActive=(e,t)=>e.type===t.type)}));const Q8=J8,Z8={apiVersion:2,name:"core/post-navigation-link",title:"Post Navigation Link",category:"theme",description:"Displays the next or previous post link that is adjacent to the current post.",textdomain:"default",attributes:{textAlign:{type:"string"},type:{type:"string",default:"next"},label:{type:"string"},showTitle:{type:"boolean",default:!1}},supports:{reusable:!1,html:!1}},{name:e9}=Z8,t9={edit:function({attributes:{type:e,label:t,showTitle:n,textAlign:r},setAttributes:o}){const a="next"===e,i=er(a?"Next":"Previous"),s=er(a?"Next post":"Previous post"),l=VR({className:so()({[`has-text-align-${r}`]:r})});return(0,tt.createElement)(tt.Fragment,null,(0,tt.createElement)(FA,null,(0,tt.createElement)(BA,null,(0,tt.createElement)(KN,{label:er("Display the title as a link"),help:er("If you have entered a custom label, it will be prepended before the title."),checked:!!n,onChange:()=>o({showTitle:!n})}))),(0,tt.createElement)(lk,null,(0,tt.createElement)(bD,{value:r,onChange:e=>{o({textAlign:e})}})),(0,tt.createElement)("div",l,(0,tt.createElement)(Cj,{tagName:"a","aria-label":s,placeholder:i,value:t,allowedFormats:["core/bold","core/italic"],onChange:e=>o({label:e})})))},variations:Q8};function n9(e,t,n){return Tl((r=>r(yd).canUserEditEntityRecord(e,t,n)),[e,t,n])}const r9={apiVersion:2,name:"core/post-title",title:"Post Title",category:"theme",description:"Displays the title of a post, page, or any other content-type.",textdomain:"default",usesContext:["postId","postType","queryId"],attributes:{textAlign:{type:"string"},level:{type:"number",default:2},isLink:{type:"boolean",default:!1},rel:{type:"string",attribute:"rel",default:""},linkTarget:{type:"string",default:"_self"}},supports:{align:["wide","full"],html:!1,color:{gradients:!0,link:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0}},style:"wp-block-post-title"},{name:o9}=r9,a9={icon:r3,edit:function({attributes:{level:e,textAlign:t,isLink:n,rel:r,linkTarget:o},setAttributes:a,context:{postType:i,postId:s,queryId:l}}){const c=0===e?"p":"h"+e,u=!!l,d=n9("postType",i,s),[p="",m,f]=md("postType",i,"title",s),[h]=md("postType",i,"link",s),g=VR({className:so()({[`has-text-align-${t}`]:t})});let b=(0,tt.createElement)(c,n?{}:g,er("An example title"));return i&&s&&(b=d&&!u?(0,tt.createElement)(zj,ot({tagName:c,placeholder:er("No Title"),value:p,onChange:m,__experimentalVersion:2},n?{}:g)):(0,tt.createElement)(c,n?{}:g,(0,tt.createElement)(Pa,{key:"html"},f.rendered))),n&&(b=d&&!u?(0,tt.createElement)(c,g,(0,tt.createElement)(zj,{tagName:"a",href:h,target:o,rel:r,placeholder:p.length?null:er("No Title"),value:p,onChange:m,__experimentalVersion:2})):(0,tt.createElement)(c,g,(0,tt.createElement)("a",{href:h,target:o,rel:r,onClick:e=>e.preventDefault()},(0,tt.createElement)(Pa,{key:"html"},f.rendered)))),(0,tt.createElement)(tt.Fragment,null,(0,tt.createElement)(lk,{group:"block"},(0,tt.createElement)(FJ,{selectedLevel:e,onChange:e=>a({level:e})}),(0,tt.createElement)(gD,{value:t,onChange:e=>{a({textAlign:e})}})),(0,tt.createElement)(FA,null,(0,tt.createElement)(BA,{title:er("Link settings")},(0,tt.createElement)(KN,{label:er("Make title a link"),onChange:()=>a({isLink:!n}),checked:n}),n&&(0,tt.createElement)(tt.Fragment,null,(0,tt.createElement)(KN,{label:er("Open in new tab"),onChange:e=>a({linkTarget:e?"_blank":"_self"}),checked:"_blank"===o}),(0,tt.createElement)(LA,{label:er("Link rel"),value:r,onChange:e=>a({rel:e})})))),b)}},i9=(0,tt.createElement)(mo,{xmlns:"https://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,tt.createElement)(uo,{d:"M4 20h16v-1.5H4V20zm0-4.8h16v-1.5H4v1.5zm0-6.4v1.5h16V8.8H4zM16 4H4v1.5h12V4z"}));function s9({userCanEdit:e,postType:t,postId:n}){const[,,r]=md("postType",t,"content",n),o=VR();return null!=r&&r.protected&&!e?(0,tt.createElement)("div",o,(0,tt.createElement)(cR,null,er("This content is password protected."))):(0,tt.createElement)("div",o,(0,tt.createElement)(Pa,{key:"html"},null==r?void 0:r.rendered))}function l9({layout:e,context:t={}}){const{postType:n,postId:r}=t,o=Tl((e=>{var t;const{getSettings:n}=e(nk);return null===(t=n())||void 0===t?void 0:t.supportsLayout}),[]),a=JL("layout")||{},i=e&&e.inherit?a:e,[s,l,c]=fd("postType",n,{id:r}),u=GH(VR({className:"entry-content"}),{value:s,onInput:l,onChange:c,__experimentalLayout:o?i:void 0});return(0,tt.createElement)("div",u)}function c9(e){const{context:{queryId:t,postType:n,postId:r}={}}=e,o=!!t,a=n9("postType",n,r);return a&&!o?(0,tt.createElement)(l9,e):(0,tt.createElement)(s9,{userCanEdit:a,postType:n,postId:r})}function u9(){const e=VR();return(0,tt.createElement)("div",e,(0,tt.createElement)("div",{className:"wp-block-post-content__placeholder"},(0,tt.createElement)("span",null,er("This is a placeholder for post content."))))}function d9(){const e=VR();return(0,tt.createElement)("div",e,(0,tt.createElement)(cR,null,er("Block cannot be rendered inside itself.")))}const p9={apiVersion:2,name:"core/post-content",title:"Post Content",category:"theme",description:"Displays the contents of a post or page.",textdomain:"default",usesContext:["postId","postType","queryId"],supports:{align:["wide","full"],html:!1,__experimentalLayout:!0},editorStyle:"wp-block-post-content-editor"},{name:m9}=p9,f9={icon:i9,edit:function({context:e,attributes:t}){const{postId:n,postType:r}=e,{layout:o={}}=t,[a,i]=DF(n);return n&&r&&a?(0,tt.createElement)(d9,null):(0,tt.createElement)(i,null,n&&r?(0,tt.createElement)(c9,{context:e,layout:o}):(0,tt.createElement)(u9,null))}};const h9=function({isSelected:e,context:{postType:t,postId:n,queryId:r},attributes:o,setAttributes:a}){const i=!!r,{authorId:s,authorDetails:l,authors:c}=Tl((e=>{var r;const{getEditedEntityRecord:o,getUser:a,getUsers:i}=e(yd),s=null===(r=o("postType",t,n))||void 0===r?void 0:r.author;return{authorId:s,authorDetails:s?a(s):null,authors:i({who:"authors"})}}),[t,n]),{editEntityRecord:u}=ld(yd),{textAlign:d,showAvatar:p,showBio:m,byline:f}=o,h=[];l&&(0,at.forEach)(l.avatar_urls,((e,t)=>{h.push({value:t,label:`${t} x ${t}`})}));const g=VR({className:so()({[`has-text-align-${d}`]:d})});return(0,tt.createElement)(tt.Fragment,null,(0,tt.createElement)(FA,null,(0,tt.createElement)(BA,{title:er("Author Settings")},!i&&!(null==c||!c.length)&&(0,tt.createElement)(KS,{label:er("Author"),value:s,options:c.map((({id:e,name:t})=>({value:e,label:t}))),onChange:e=>{u("postType",t,n,{author:e})}}),(0,tt.createElement)(KN,{label:er("Show avatar"),checked:p,onChange:()=>a({showAvatar:!p})}),p&&(0,tt.createElement)(KS,{label:er("Avatar size"),value:o.avatarSize,options:h,onChange:e=>{a({avatarSize:Number(e)})}}),(0,tt.createElement)(KN,{label:er("Show bio"),checked:m,onChange:()=>a({showBio:!m})}))),(0,tt.createElement)(lk,{group:"block"},(0,tt.createElement)(gD,{value:d,onChange:e=>{a({textAlign:e})}})),(0,tt.createElement)("div",g,p&&l&&(0,tt.createElement)("div",{className:"wp-block-post-author__avatar"},(0,tt.createElement)("img",{width:o.avatarSize,src:l.avatar_urls[o.avatarSize],alt:l.name})),(0,tt.createElement)("div",{className:"wp-block-post-author__content"},(!Cj.isEmpty(f)||e)&&(0,tt.createElement)(Cj,{className:"wp-block-post-author__byline",multiline:!1,"aria-label":er("Post author byline text"),placeholder:er("Write byline…"),value:f,onChange:e=>a({byline:e})}),(0,tt.createElement)("p",{className:"wp-block-post-author__name"},(null==l?void 0:l.name)||er("Post Author")),m&&(0,tt.createElement)("p",{className:"wp-block-post-author__bio"},null==l?void 0:l.description))))},g9=(0,tt.createElement)(mo,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,tt.createElement)(uo,{d:"M10 4.5a1 1 0 11-2 0 1 1 0 012 0zm1.5 0a2.5 2.5 0 11-5 0 2.5 2.5 0 015 0zm2.25 7.5v-1A2.75 2.75 0 0011 8.25H7A2.75 2.75 0 004.25 11v1h1.5v-1c0-.69.56-1.25 1.25-1.25h4c.69 0 1.25.56 1.25 1.25v1h1.5zM4 20h9v-1.5H4V20zm16-4H4v-1.5h16V16z",fillRule:"evenodd",clipRule:"evenodd"})),b9={apiVersion:2,name:"core/post-author",title:"Post Author",category:"theme",description:"Add the author of this post.",textdomain:"default",attributes:{textAlign:{type:"string"},avatarSize:{type:"number",default:48},showAvatar:{type:"boolean",default:!0},showBio:{type:"boolean"},byline:{type:"string"}},usesContext:["postType","postId","queryId"],supports:{html:!1,typography:{fontSize:!0,lineHeight:!0},color:{gradients:!0,link:!0}},editorStyle:"wp-block-post-author-editor",style:"wp-block-post-author"},{name:v9}=b9,y9={icon:g9,edit:h9},_9=["core/post-comment-content","core/post-comment-author"];const M9={apiVersion:2,name:"core/post-comment",title:"Post Comment",category:"theme",description:"Post comment.",textdomain:"default",attributes:{commentId:{type:"number"}},providesContext:{commentId:"commentId"},supports:{html:!1}},{name:k9}=M9,w9={icon:v3,edit:function({attributes:e,setAttributes:t}){const{commentId:n}=e,[r,o]=(0,tt.useState)(n),a=VR();return n?(0,tt.createElement)("div",a,(0,tt.createElement)(JH,{allowedBlocks:_9})):(0,tt.createElement)("div",a,(0,tt.createElement)(vH,{icon:fo,label:er("Post Comment"),instructions:er("To show a comment, input the comment ID.")},(0,tt.createElement)(LA,{value:n,onChange:e=>o(parseInt(e))}),(0,tt.createElement)(Eh,{variant:"primary",onClick:()=>{t({commentId:r})}},er("Save"))))},save:function(){return(0,tt.createElement)("div",VR.save(),(0,tt.createElement)(JH.Content,null))}};const E9={apiVersion:2,name:"core/post-comment-author",title:"Post Comment Author",category:"design",parent:["core/post-comment"],description:"Post comment author.",textdomain:"default",usesContext:["commentId"],supports:{html:!1}},{name:L9}=E9,A9={icon:g9,edit:function({attributes:e,context:t}){const{className:n}=e,{commentId:r}=t,o=Tl((e=>{const{getEntityRecord:t}=e(yd),n=t("root","comment",r),o=null==n?void 0:n.author_name;if(n&&!o){var a;const e=t("root","user",n.author);return null!==(a=null==e?void 0:e.name)&&void 0!==a?a:er("Anonymous")}return null!=o?o:""}));return(0,tt.createElement)("div",VR(),(0,tt.createElement)("p",{className:n},o))}};const S9={apiVersion:2,name:"core/post-comment-content",title:"Post Comment Content",category:"design",parent:["core/post-comment"],description:"Post comment content",textdomain:"default",usesContext:["commentId"],supports:{html:!1}},{name:C9}=S9,T9={icon:i9,edit:function({attributes:e,context:t}){const{className:n}=e,{commentId:r}=t,[o]=md("root","comment","content",r);return(0,tt.createElement)("div",VR(),(0,tt.createElement)("p",{className:n},o))}},x9=(0,tt.createElement)(mo,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,tt.createElement)(uo,{d:"M11.696 13.972c.356-.546.599-.958.728-1.235a1.79 1.79 0 00.203-.783c0-.264-.077-.47-.23-.618-.148-.153-.354-.23-.618-.23-.295 0-.569.07-.82.212a3.413 3.413 0 00-.738.571l-.147-1.188c.289-.234.59-.41.903-.526.313-.117.66-.175 1.041-.175.375 0 .695.08.959.24.264.153.46.362.59.626.135.265.203.556.203.876 0 .362-.08.734-.24 1.115-.154.381-.427.87-.82 1.466l-.756 1.152H14v1.106h-4l1.696-2.609z"}),(0,tt.createElement)(uo,{d:"M19.5 7h-15v12a.5.5 0 00.5.5h14a.5.5 0 00.5-.5V7zM3 7V5a2 2 0 012-2h14a2 2 0 012 2v14a2 2 0 01-2 2H5a2 2 0 01-2-2V7z"}));const z9={apiVersion:2,name:"core/post-comment-date",title:"Post Comment Date",category:"design",parent:["core/post-comment"],description:"Post comment date.",textdomain:"default",attributes:{format:{type:"string"}},usesContext:["commentId"],supports:{html:!1}},{name:O9}=z9,N9={icon:x9,edit:function({attributes:e,context:t,setAttributes:n}){const{className:r,format:o}=e,{commentId:a}=t,i=dV(),[s]=md("root","site","date_format"),[l]=md("root","comment","date",a),c=Object.values(i.formats).map((e=>({key:e,name:hV(e,l)}))),u=o||s||i.formats.date,d=VR({className:r});return(0,tt.createElement)(tt.Fragment,null,(0,tt.createElement)(FA,null,(0,tt.createElement)(BA,{title:er("Format settings")},(0,tt.createElement)(xz,{hideLabelFromVision:!0,label:er("Date Format"),options:c,onChange:({selectedItem:e})=>n({format:e.key}),value:c.find((e=>e.key===u))}))),(0,tt.createElement)("div",d,(0,tt.createElement)("time",{dateTime:hV("c",l)},hV(u,l))))}},D9=(0,tt.createElement)(mo,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,tt.createElement)(uo,{d:"M14 10.1V4c0-.6-.4-1-1-1H5c-.6 0-1 .4-1 1v8.3c0 .3.2.7.6.8.1.1.2.1.3.1.2 0 .5-.1.6-.3l1.8-1.8H13c.6 0 1-.4 1-1zm-1.5-.5H6.7l-1.2 1.2V4.5h7v5.1zM19 12h-8c-.6 0-1 .4-1 1v6.1c0 .6.4 1 1 1h5.7l1.8 1.8c.1.2.4.3.6.3.1 0 .2 0 .3-.1.4-.1.6-.5.6-.8V13c0-.6-.4-1-1-1zm-.5 7.8l-1.2-1.2h-5.8v-5.1h7v6.3z"}));function B9({postId:e}){return Tl((t=>{const n=t(yd).getEntityRecords("root","comment",{post:e});return n&&n.length?n.map((e=>(0,tt.createElement)(Pa,{className:"wp-block-post-comments__comment",key:e.id},e.content.rendered))):er("No comments.")}),[e])}const I9={apiVersion:2,name:"core/post-comments",title:"Post Comments",category:"theme",description:"Display a post's comments.",textdomain:"default",attributes:{textAlign:{type:"string"}},usesContext:["postId","postType"],supports:{html:!1,align:["wide","full"],typography:{fontSize:!0,lineHeight:!0},color:{gradients:!0,link:!0}},style:"wp-block-post-comments"},{name:P9}=I9,R9={icon:D9,edit:function({attributes:e,setAttributes:t,context:n}){const{postType:r,postId:o}=n,{textAlign:a}=e,i=VR({className:so()({[`has-text-align-${a}`]:a})});return r&&o?(0,tt.createElement)(tt.Fragment,null,(0,tt.createElement)(lk,{group:"block"},(0,tt.createElement)(gD,{value:a,onChange:e=>{t({textAlign:e})}})),(0,tt.createElement)("div",i,(0,tt.createElement)(B9,{postId:o}))):(0,tt.createElement)("div",i,(0,tt.createElement)(cR,null,er("Post comments block: no post found.")))}},Y9=(0,tt.createElement)(mo,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,tt.createElement)(uo,{d:"M13 8H4v1.5h9V8zM4 4v1.5h16V4H4zm9 8H5c-.6 0-1 .4-1 1v8.3c0 .3.2.7.6.8.1.1.2.1.3.1.2 0 .5-.1.6-.3l1.8-1.8H13c.6 0 1-.4 1-1V13c0-.6-.4-1-1-1zm-2.2 6.6H7l1.6-2.2c.3-.4.5-.7.6-.9.1-.2.2-.4.2-.5 0-.2-.1-.3-.1-.4-.1-.1-.2-.1-.4-.1s-.4 0-.6.1c-.3.1-.5.3-.7.4l-.2.2-.2-1.2.1-.1c.3-.2.5-.3.8-.4.3-.1.6-.1.9-.1.3 0 .6.1.9.2.2.1.4.3.6.5.1.2.2.5.2.7 0 .3-.1.6-.2.9-.1.3-.4.7-.7 1.1l-.5.6h1.6v1.2z"}));const W9={apiVersion:2,name:"core/post-comments-count",title:"Post Comments Count",category:"theme",description:"Display a post's comments count.",textdomain:"default",attributes:{textAlign:{type:"string"}},usesContext:["postId"],supports:{html:!1,color:{gradients:!0},typography:{fontSize:!0,lineHeight:!0}}},{name:H9}=W9,q9={icon:Y9,edit:function({attributes:e,context:t,setAttributes:n}){const{textAlign:r}=e,{postId:o}=t,[a,i]=(0,tt.useState)(),s=VR({className:so()({[`has-text-align-${r}`]:r})});return(0,tt.useEffect)((()=>{if(!o)return;const e=o;ec({path:Pl("/wp/v2/comments",{post:o}),parse:!1}).then((t=>{e===o&&i(t.headers.get("X-WP-Total"))}))}),[o]),(0,tt.createElement)(tt.Fragment,null,(0,tt.createElement)(lk,{group:"block"},(0,tt.createElement)(gD,{value:r,onChange:e=>{n({textAlign:e})}})),(0,tt.createElement)("div",s,o&&void 0!==a?a:(0,tt.createElement)(cR,null,er("Post Comments Count block: post not found."))))}},j9=(0,tt.createElement)(mo,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,tt.createElement)(uo,{d:"M13 8H4v1.5h9V8zM4 4v1.5h16V4H4zm9 8H5c-.6 0-1 .4-1 1v8.3c0 .3.2.7.6.8.1.1.2.1.3.1.2 0 .5-.1.6-.3l1.8-1.8H13c.6 0 1-.4 1-1V13c0-.6-.4-1-1-1zm-.5 6.6H6.7l-1.2 1.2v-6.3h7v5.1z"}));const F9={apiVersion:2,name:"core/post-comments-form",title:"Post Comments Form",category:"theme",description:"Display a post's comments form.",textdomain:"default",attributes:{textAlign:{type:"string"}},usesContext:["postId","postType"],supports:{html:!1,color:{gradients:!0,link:!0},typography:{fontSize:!0,lineHeight:!0}},style:"wp-block-post-comments-form"},{name:V9}=F9,X9={icon:j9,edit:function({attributes:e,context:t,setAttributes:n}){const{textAlign:r}=e,{postId:o,postType:a}=t,[i]=md("postType",a,"comment_status",o),s=VR({className:so()({[`has-text-align-${r}`]:r})});return(0,tt.createElement)(tt.Fragment,null,(0,tt.createElement)(lk,{group:"block"},(0,tt.createElement)(gD,{value:r,onChange:e=>{n({textAlign:e})}})),(0,tt.createElement)("div",s,!i&&(0,tt.createElement)(cR,null,er("Post Comments Form block: comments are not enabled for this post type.")),"open"!==i&&(0,tt.createElement)(cR,null,er("Post Comments Form block: comments to this post are not allowed.")),"open"===i&&er("Post Comments Form")))}};const U9=function({context:e,attributes:t,setAttributes:n}){const{textAlign:r}=t,{postType:o,postId:a}=e,[i,s]=(0,tt.useState)(),l=VR({className:so()({[`has-text-align-${r}`]:r})});(0,tt.useEffect)((()=>{if(!a)return;const e=a;ec({path:Pl("/wp/v2/comments",{post:a}),parse:!1}).then((t=>{e===a&&s(t.headers.get("X-WP-Total"))}))}),[a]);const c=Tl((e=>e(yd).getEditedEntityRecord("postType",o,a)),[o,a]);if(!c)return null;const{link:u}=c;let d;if(void 0!==i){const e=parseInt(i);d=0===e?er("No comments"):pn(nr("%s comment","%s comments",e),e.toLocaleString())}return(0,tt.createElement)(tt.Fragment,null,(0,tt.createElement)(lk,{group:"block"},(0,tt.createElement)(gD,{value:r,onChange:e=>{n({textAlign:e})}})),(0,tt.createElement)("div",l,u&&void 0!==d?(0,tt.createElement)("a",{href:u+"#comments",onClick:e=>e.preventDefault()},d):(0,tt.createElement)(cR,null,er("Post Comments Link block: post not found."))))},$9={apiVersion:2,name:"core/post-comments-link",title:"Post Comments Link",category:"theme",description:"Displays the link to the current post comments.",textdomain:"default",usesContext:["postType","postId"],attributes:{textAlign:{type:"string"}},supports:{html:!1,color:{link:!0,text:!1},typography:{fontSize:!0,lineHeight:!0}}},{name:K9}=$9,G9={edit:U9,icon:Y9};n(6063);var J9=n(9368);const Q9="dddd, LL";function Z9({day:e,events:t=[]}){const n=(0,tt.useRef)();return(0,tt.useEffect)((()=>{var r;if(null==n||null===(r=n.current)||void 0===r||!r.parentNode)return;const{parentNode:o}=n.current,a=sV()(e).format(Q9);if(!t.length)return void o.setAttribute("aria-label",a);const i=pn(nr("%1$s. There is %2$d event.","%1$s. There are %2$d events.",t.length),a,t.length);o.setAttribute("aria-label",i)}),[t.length]),(0,tt.createElement)("div",{ref:n,className:so()("components-datetime__date__day",{"has-events":null==t?void 0:t.length})},e.format("D"))}class eee extends tt.Component{constructor(){super(...arguments),this.onChangeMoment=this.onChangeMoment.bind(this),this.nodeRef=(0,tt.createRef)(),this.onMonthPreviewedHandler=this.onMonthPreviewedHandler.bind(this)}onMonthPreviewedHandler(e){var t,n;null===(t=(n=this.props).onMonthPreviewed)||void 0===t||t.call(n,e.toISOString()),this.keepFocusInside()}keepFocusInside(){if(!this.nodeRef.current)return;const{ownerDocument:e}=this.nodeRef.current,{activeElement:t}=e;if(!t||!this.nodeRef.current.contains(e.activeElement)){const e=this.nodeRef.current.querySelector(".DayPicker_focusRegion");if(!e)return;e.focus()}}onChangeMoment(e){const{currentDate:t,onChange:n}=this.props,r=t?sV()(t):sV()(),o={hours:r.hours(),minutes:r.minutes(),seconds:0};n(e.set(o).format("YYYY-MM-DDTHH:mm:ss")),this.keepFocusInside()}getMomentDate(e){return null===e?null:e?sV()(e):sV()()}getEventsPerDay(e){var t;return null!==(t=this.props.events)&&void 0!==t&&t.length?this.props.events.filter((t=>e.isSame(t.date,"day"))):[]}render(){const{currentDate:e,isInvalidDate:t}=this.props,n=this.getMomentDate(e);return(0,tt.createElement)("div",{className:"components-datetime__date",ref:this.nodeRef},(0,tt.createElement)(J9.Z,{date:n,daySize:30,focused:!0,hideKeyboardShortcutsPanel:!0,key:`datepicker-controller-${n?n.format("MM-YYYY"):"null"}`,noBorder:!0,numberOfMonths:1,onDateChange:this.onChangeMoment,transitionDuration:0,weekDayFormat:"ddd",dayAriaLabelFormat:Q9,isRTL:rr(),isOutsideRange:e=>t&&t(e.toDate()),onPrevMonthClick:this.onMonthPreviewedHandler,onNextMonthClick:this.onMonthPreviewedHandler,renderDayContents:e=>(0,tt.createElement)(Z9,{day:e,events:this.getEventsPerDay(e)})}))}}const tee=eee,nee=()=>{const{timezone:e}=dV(),t=(new Date).getTimezoneOffset()/60*-1;if(Number(e.offset)===t)return null;const n=e.offset>=0?"+":"",r=""!==e.abbr&&isNaN(e.abbr)?e.abbr:`UTC${n}${e.offset}`,o="UTC"===e.string?er("Coordinated Universal Time"):`(${r}) ${e.string.replace("_"," ")}`;return(0,tt.createElement)(Sf,{position:"top center",text:o},(0,tt.createElement)("div",{className:"components-datetime__timezone"},r))};function ree({as:e,value:t,onUpdate:n,...r}){return(0,tt.createElement)(e||"input",{key:t,defaultValue:t,onBlur:function(e){const{target:o}=e;if(t===o.value)return;const a=parseInt(o.value,10);!(0,at.isInteger)(a)||void 0!==r.max&&a>r.max||void 0!==r.min&&asV()(t).startOf("minutes")));(0,tt.useEffect)((()=>{o(t?sV()(t).startOf("minutes"):sV()())}),[t]);const{day:a,month:i,year:s,minutes:l,hours:c,am:u}=(0,tt.useMemo)((()=>({day:r.format("DD"),month:r.format("MM"),year:r.format("YYYY"),minutes:r.format("mm"),hours:r.format(e?"hh":"HH"),am:r.format("H")<=11?"AM":"PM"})),[r,e]);function d(e){o(e),n(e.format("YYYY-MM-DDTHH:mm:ss"))}function p(e,t){d(r.clone()[e](t))}function m(e){return()=>{if(u===e)return;const t=parseInt(c,10);d(r.clone().hours("PM"===e?(t%12+12)%24:t%12))}}const f=(0,tt.createElement)("div",{className:"components-datetime__time-field components-datetime__time-field-day"},(0,tt.createElement)(ree,{"aria-label":er("Day"),className:"components-datetime__time-field-day-input",type:"number",name:"date",value:a,step:1,min:1,max:31,onUpdate:p})),h=(0,tt.createElement)("div",{className:"components-datetime__time-field components-datetime__time-field-month"},(0,tt.createElement)(ree,{as:"select","aria-label":er("Month"),className:"components-datetime__time-field-month-select",name:"month",value:i,onUpdate:(e,t)=>p(e,t-1)},(0,tt.createElement)("option",{value:"01"},er("January")),(0,tt.createElement)("option",{value:"02"},er("February")),(0,tt.createElement)("option",{value:"03"},er("March")),(0,tt.createElement)("option",{value:"04"},er("April")),(0,tt.createElement)("option",{value:"05"},er("May")),(0,tt.createElement)("option",{value:"06"},er("June")),(0,tt.createElement)("option",{value:"07"},er("July")),(0,tt.createElement)("option",{value:"08"},er("August")),(0,tt.createElement)("option",{value:"09"},er("September")),(0,tt.createElement)("option",{value:"10"},er("October")),(0,tt.createElement)("option",{value:"11"},er("November")),(0,tt.createElement)("option",{value:"12"},er("December")))),g=e?(0,tt.createElement)(tt.Fragment,null,f,h):(0,tt.createElement)(tt.Fragment,null,h,f);return(0,tt.createElement)("div",{className:so()("components-datetime__time")},(0,tt.createElement)("fieldset",null,(0,tt.createElement)("legend",{className:"components-datetime__time-legend invisible"},er("Date")),(0,tt.createElement)("div",{className:"components-datetime__time-wrapper"},g,(0,tt.createElement)("div",{className:"components-datetime__time-field components-datetime__time-field-year"},(0,tt.createElement)(ree,{"aria-label":er("Year"),className:"components-datetime__time-field-year-input",type:"number",name:"year",step:1,min:0,max:9999,value:s,onUpdate:p})))),(0,tt.createElement)("fieldset",null,(0,tt.createElement)("legend",{className:"components-datetime__time-legend invisible"},er("Time")),(0,tt.createElement)("div",{className:"components-datetime__time-wrapper"},(0,tt.createElement)("div",{className:"components-datetime__time-field components-datetime__time-field-time"},(0,tt.createElement)(ree,{"aria-label":er("Hours"),className:"components-datetime__time-field-hours-input",type:"number",name:"hours",step:1,min:e?1:0,max:e?12:23,value:c,onUpdate:p}),(0,tt.createElement)("span",{className:"components-datetime__time-separator","aria-hidden":"true"},":"),(0,tt.createElement)(ree,{"aria-label":er("Minutes"),className:"components-datetime__time-field-minutes-input",type:"number",name:"minutes",step:1,min:0,max:59,value:l,onUpdate:p})),e&&(0,tt.createElement)(GA,{className:"components-datetime__time-field components-datetime__time-field-am-pm"},(0,tt.createElement)(Eh,{variant:"AM"===u?"primary":"secondary",onClick:m("AM"),className:"components-datetime__time-am-button"},er("AM")),(0,tt.createElement)(Eh,{variant:"PM"===u?"primary":"secondary",onClick:m("PM"),className:"components-datetime__time-pm-button"},er("PM"))),(0,tt.createElement)(nee,null))))};const aee=(0,tt.forwardRef)((function({currentDate:e,is12Hour:t,isInvalidDate:n,onMonthPreviewed:r=at.noop,onChange:o,events:a},i){const[s,l]=(0,tt.useState)(!1);return(0,tt.createElement)("div",{ref:i,className:"components-datetime"},!s&&(0,tt.createElement)(tt.Fragment,null,(0,tt.createElement)(oee,{currentTime:e,onChange:o,is12Hour:t}),(0,tt.createElement)(tee,{currentDate:e,onChange:o,isInvalidDate:n,events:a,onMonthPreviewed:r})),s&&(0,tt.createElement)(tt.Fragment,null,(0,tt.createElement)("div",{className:"components-datetime__calendar-help"},(0,tt.createElement)("h4",null,er("Click to Select")),(0,tt.createElement)("ul",null,(0,tt.createElement)("li",null,er("Click the right or left arrows to select other months in the past or the future.")),(0,tt.createElement)("li",null,er("Click the desired day to select it."))),(0,tt.createElement)("h4",null,er("Navigating with a keyboard")),(0,tt.createElement)("ul",null,(0,tt.createElement)("li",null,(0,tt.createElement)("abbr",{"aria-label":tr("Enter","keyboard button")},"↵")," ",(0,tt.createElement)("span",null,er("Select the date in focus."))),(0,tt.createElement)("li",null,(0,tt.createElement)("abbr",{"aria-label":er("Left and Right Arrows")},"←/→")," ",er("Move backward (left) or forward (right) by one day.")),(0,tt.createElement)("li",null,(0,tt.createElement)("abbr",{"aria-label":er("Up and Down Arrows")},"↑/↓")," ",er("Move backward (up) or forward (down) by one week.")),(0,tt.createElement)("li",null,(0,tt.createElement)("abbr",{"aria-label":er("Page Up and Page Down")},er("PgUp/PgDn"))," ",er("Move backward (PgUp) or forward (PgDn) by one month.")),(0,tt.createElement)("li",null,(0,tt.createElement)("abbr",{"aria-label":er("Home and End")},er("Home/End"))," ",er("Go to the first (home) or last (end) day of a week."))))),(0,tt.createElement)("div",{className:"components-datetime__buttons"},!s&&e&&(0,tt.createElement)(Eh,{className:"components-datetime__date-reset-button",variant:"link",onClick:()=>o(null)},er("Reset")),(0,tt.createElement)(Eh,{className:"components-datetime__date-help-toggle",variant:"link",onClick:function(){l(!s)}},er(s?"Close":"Calendar Help"))))}));const iee={apiVersion:2,name:"core/post-date",title:"Post Date",category:"theme",description:"Add the date of this post.",textdomain:"default",attributes:{textAlign:{type:"string"},format:{type:"string"},isLink:{type:"boolean",default:!1}},usesContext:["postId","postType","queryId"],supports:{html:!1,color:{gradients:!0,link:!0},typography:{fontSize:!0,lineHeight:!0}}},{name:see}=iee,lee={icon:x9,edit:function({attributes:{textAlign:e,format:t,isLink:n},context:{postId:r,postType:o,queryId:a},setAttributes:i}){const s=!!a,[l]=md("root","site","date_format"),[c,u]=md("postType",o,"date",r),[d,p]=(0,tt.useState)(!1),m=dV(),f=/a(?!\\)/i.test(m.formats.time.toLowerCase().replace(/\\\\/g,"").split("").reverse().join("")),h=Object.values(m.formats).map((e=>({key:e,name:hV(e,c)}))),g=t||l||m.formats.date,b=VR({className:so()({[`has-text-align-${e}`]:e})});let v=c?(0,tt.createElement)("time",{dateTime:hV("c",c)},hV(g,c),d&&(0,tt.createElement)(_f,{onClose:p.bind(null,!1)},(0,tt.createElement)(aee,{currentDate:c,onChange:u,is12Hour:f}))):er("No Date");return n&&c&&(v=(0,tt.createElement)("a",{href:"#post-date-pseudo-link",onClick:e=>e.preventDefault()},v)),(0,tt.createElement)(tt.Fragment,null,(0,tt.createElement)(lk,{group:"block"},(0,tt.createElement)(gD,{value:e,onChange:e=>{i({textAlign:e})}}),c&&!s&&(0,tt.createElement)(jg,{icon:Zq,title:er("Change Date"),onClick:()=>p((e=>!e))})),(0,tt.createElement)(FA,null,(0,tt.createElement)(BA,{title:er("Format settings")},(0,tt.createElement)(xz,{hideLabelFromVision:!0,label:er("Date Format"),options:h,onChange:({selectedItem:e})=>i({format:e.key}),value:h.find((e=>e.key===g))})),(0,tt.createElement)(BA,{title:er("Link settings")},(0,tt.createElement)(KN,{label:pn(er("Link to %s"),o),onChange:()=>i({isLink:!n}),checked:n}))),(0,tt.createElement)("div",b,v))}},cee=(0,tt.createElement)(mo,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,tt.createElement)(uo,{d:"M12.75 9.333c0 .521-.102.977-.327 1.354-.23.386-.555.628-.893.774-.545.234-1.183.227-1.544.222l-.12-.001v-1.5h.123c.414.001.715.002.948-.099a.395.395 0 00.199-.166c.05-.083.114-.253.114-.584V7.2H8.8V4h3.95v5.333zM7.95 9.333c0 .521-.102.977-.327 1.354-.23.386-.555.628-.893.774-.545.234-1.183.227-1.544.222l-.12-.001v-1.5h.123c.414.001.715.002.948-.099a.394.394 0 00.198-.166c.05-.083.115-.253.115-.584V7.2H4V4h3.95v5.333zM13 20H4v-1.5h9V20zM20 16H4v-1.5h16V16z"}));const uee={apiVersion:2,name:"core/post-excerpt",title:"Post Excerpt",category:"theme",description:"Display a post's excerpt.",textdomain:"default",attributes:{textAlign:{type:"string"},moreText:{type:"string"},showMoreOnNewLine:{type:"boolean",default:!0}},usesContext:["postId","postType","queryId"],supports:{html:!1,color:{gradients:!0,link:!0},typography:{fontSize:!0,lineHeight:!0}},editorStyle:"wp-block-post-excerpt-editor",style:"wp-block-post-excerpt"},{name:dee}=uee,pee={icon:cee,edit:function({attributes:{textAlign:e,moreText:t,showMoreOnNewLine:n},setAttributes:r,isSelected:o,context:{postId:a,postType:i,queryId:s}}){const l=!!s,c=n9("postType",i,a),u=c&&!l,[d,p,{rendered:m,protected:f}={}]=md("postType",i,"excerpt",a),h=VR({className:so()({[`has-text-align-${e}`]:e})}),g=(0,tt.useMemo)((()=>{if(!m)return"";const e=(new window.DOMParser).parseFromString(m,"text/html");return e.body.textContent||e.body.innerText||""}),[m]);if(!i||!a)return(0,tt.createElement)("div",h,(0,tt.createElement)(cR,null,er("Post excerpt block: no post found.")));if(f&&!c)return(0,tt.createElement)("div",h,(0,tt.createElement)(cR,null,er("There is no excerpt because this is a protected post.")));const b=(0,tt.createElement)(Cj,{className:"wp-block-post-excerpt__more-link",tagName:"a","aria-label":er('"Read more" link text'),placeholder:er('Add "read more" link text'),value:t,onChange:e=>r({moreText:e})}),v=u?(0,tt.createElement)(Cj,{className:!n&&"wp-block-post-excerpt__excerpt is-inline","aria-label":er("Post excerpt text"),value:d||g||(o?"":er("No post excerpt found")),onChange:p}):m&&(0,tt.createElement)(jP,null,(0,tt.createElement)(Pa,{key:"html"},m))||er("No post excerpt found");return(0,tt.createElement)(tt.Fragment,null,(0,tt.createElement)(lk,null,(0,tt.createElement)(bD,{value:e,onChange:e=>r({textAlign:e})})),(0,tt.createElement)(FA,null,(0,tt.createElement)(BA,{title:er("Post Excerpt Settings")},(0,tt.createElement)(KN,{label:er("Show link on new line"),checked:n,onChange:e=>r({showMoreOnNewLine:e})}))),(0,tt.createElement)("div",h,v,!n&&" ",n?(0,tt.createElement)("p",{className:"wp-block-post-excerpt__more-text"},b):b))}},mee=(0,tt.createElement)(mo,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,tt.createElement)(uo,{d:"M19 3H5c-.6 0-1 .4-1 1v7c0 .5.4 1 1 1h14c.5 0 1-.4 1-1V4c0-.6-.4-1-1-1zM5.5 10.5v-.4l1.8-1.3 1.3.8c.3.2.7.2.9-.1L11 8.1l2.4 2.4H5.5zm13 0h-2.9l-4-4c-.3-.3-.8-.3-1.1 0L8.9 8l-1.2-.8c-.3-.2-.6-.2-.9 0l-1.3 1V4.5h13v6zM4 20h9v-1.5H4V20zm0-4h16v-1.5H4V16z"})),fee=["image"],hee=(0,tt.createElement)("div",{className:"post-featured-image_placeholder"},(0,tt.createElement)(Tf,{icon:mee}),(0,tt.createElement)("p",null," ",er("Featured Image")));const gee=WK((function({attributes:{isLink:e},setAttributes:t,context:{postId:n,postType:r,queryId:o},noticeUI:a,noticeOperations:i}){const s=!!o,[l,c]=md("postType",r,"featured_media",n),u=Tl((e=>l&&e(yd).getEntityRecord("root","media",l,{context:"view"})),[l]),d=VR(),p=e=>{null!=e&&e.id&&c(e.id)};function m(e){i.removeAllNotices(),i.createErrorNotice(e)}let f;return!l&&s?(0,tt.createElement)("div",d,hee):(f=l?u?(0,tt.createElement)("img",{src:u.source_url,alt:u.alt_text||er("Featured image")}):hee:(0,tt.createElement)(oj,{icon:(0,tt.createElement)(MB,{icon:mee}),onSelect:p,notices:a,onError:m,accept:"image/*",allowedTypes:fee,labels:{title:er("Featured image"),instructions:er("Upload a media file or pick one from your media library.")}}),(0,tt.createElement)(tt.Fragment,null,(0,tt.createElement)(FA,null,(0,tt.createElement)(BA,{title:er("Link settings")},(0,tt.createElement)(KN,{label:pn(er("Link to %s"),r),onChange:()=>t({isLink:!e}),checked:e}))),!!u&&!s&&(0,tt.createElement)(lk,{group:"other"},(0,tt.createElement)(Jq,{mediaId:l,mediaURL:u.source_url,allowedTypes:fee,accept:"image/*",onSelect:p,onError:m})),(0,tt.createElement)("figure",d,f)))}));const bee={apiVersion:2,name:"core/post-featured-image",title:"Post Featured Image",category:"theme",description:"Display a post's featured image.",textdomain:"default",attributes:{isLink:{type:"boolean",default:!1}},usesContext:["postId","postType","queryId"],supports:{align:["left","right","center","wide","full"],html:!1},editorStyle:"wp-block-post-featured-image-editor",style:"wp-block-post-featured-image"},{name:vee}=bee,yee={icon:mee,edit:function(e){var t;const n=VR();return null!==(t=e.context)&&void 0!==t&&t.postId?(0,tt.createElement)(gee,e):(0,tt.createElement)("div",n,hee)}};const _ee=(0,tt.createElement)(mo,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,tt.createElement)(uo,{d:"M20 4H4v1.5h16V4zm-2 9h-3c-1.1 0-2 .9-2 2v3c0 1.1.9 2 2 2h3c1.1 0 2-.9 2-2v-3c0-1.1-.9-2-2-2zm.5 5c0 .3-.2.5-.5.5h-3c-.3 0-.5-.2-.5-.5v-3c0-.3.2-.5.5-.5h3c.3 0 .5.2.5.5v3zM4 9.5h9V8H4v1.5zM9 13H6c-1.1 0-2 .9-2 2v3c0 1.1.9 2 2 2h3c1.1 0 2-.9 2-2v-3c0-1.1-.9-2-2-2zm.5 5c0 .3-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5v-3c0-.3.2-.5.5-.5h3c.3 0 .5.2.5.5v3z",fillRule:"evenodd",clipRule:"evenodd"})),Mee=[{name:"category",title:er("Post Categories"),description:er("Display a post's categories."),icon:_ee,isDefault:!0,attributes:{term:"category"},isActive:e=>"category"===e.term},{name:"post_tag",title:er("Post Tags"),description:er("Display a post's tags."),icon:_ee,attributes:{term:"post_tag"},isActive:e=>"post_tag"===e.term}],kee={apiVersion:2,name:"core/post-terms",title:"Post Terms",category:"design",description:"Post terms.",textdomain:"default",attributes:{term:{type:"string"},textAlign:{type:"string"},separator:{type:"string",default:", "}},usesContext:["postId","postType"],supports:{html:!1,color:{gradients:!0,link:!0},typography:{lineHeight:!0,fontSize:!0}},style:"wp-block-post-terms"},{name:wee}=kee,Eee={variations:Mee,edit:function({attributes:e,context:t,setAttributes:n}){var r;const{term:o,textAlign:a,separator:i}=e,{postId:s,postType:l}=t,c=Tl((e=>{var t;if(!o)return{};const{getTaxonomy:n}=e(yd),r=n(o);return null!=r&&null!==(t=r.visibility)&&void 0!==t&&t.publicly_queryable?r:{}}),[o]),{postTerms:u,hasPostTerms:d,isLoading:p}=function({postId:e,postType:t,term:n}){var r;const{rest_base:o,slug:a}=n,[i]=md("postType",t,o,e);return Tl((e=>{var t;if(!(null==n||null===(t=n.visibility)||void 0===t?void 0:t.publicly_queryable))return{postTerms:[],_isLoading:!1,hasPostTerms:!1};if(!i)return{isLoading:!0};if(!i.length)return{isLoading:!1};const{getEntityRecords:r,isResolving:o}=e(yd),s=["taxonomy",a,{include:i,context:"view"}],l=r(...s);return{postTerms:l,isLoading:o("getEntityRecords",s),hasPostTerms:!(null==l||!l.length)}}),[i,null==n||null===(r=n.visibility)||void 0===r?void 0:r.publicly_queryable])}({postId:s,postType:l,term:c}),m=s&&l,f=VR({className:so()({[`has-text-align-${a}`]:a,[`taxonomy-${o}`]:o})});return m?o?(0,tt.createElement)(tt.Fragment,null,(0,tt.createElement)(lk,null,(0,tt.createElement)(bD,{value:a,onChange:e=>{n({textAlign:e})}})),(0,tt.createElement)(WA,null,(0,tt.createElement)(LA,{autoComplete:"off",label:er("Separator"),value:i||"",onChange:e=>{n({separator:e})},help:er("Enter character(s) used to separate terms.")})),(0,tt.createElement)("div",f,p&&(0,tt.createElement)(cq,null),!p&&d&&u.map((e=>(0,tt.createElement)("a",{key:e.id,href:e.link,onClick:e=>e.preventDefault()},e.name))).reduce(((e,t)=>(0,tt.createElement)(tt.Fragment,null,e,(0,tt.createElement)("span",{className:"wp-block-post-terms__separator"},i||" "),t))),!p&&!d&&((null==c||null===(r=c.labels)||void 0===r?void 0:r.no_terms)||er("Term items not found.")))):(0,tt.createElement)("div",f,er("Post Terms block: no term specified.")):(0,tt.createElement)("div",f,(0,tt.createElement)(cR,null,er("Post Terms block: post not found.")))}},Lee=(0,tt.createElement)(mo,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,tt.createElement)(uo,{stroke:"#1E1E1E",strokeWidth:"1.5",d:"M9 19.25h6M4 19.25h4M12 15.25h8M4 15.25h7"}),(0,tt.createElement)(uo,{d:"M8.994 10.103H6.08L5.417 12H4l2.846-8h1.383l2.845 8H9.657l-.663-1.897zm-.457-1.28l-.994-2.857-1.006 2.857h2z",fill:"#1E1E1E"}));const Aee={apiVersion:2,name:"core/term-description",title:"Term Description",category:"theme",description:"Display the description of categories, tags and custom taxonomies when viewing an archive.",textdomain:"default",attributes:{textAlign:{type:"string"}},supports:{align:["wide","full"],html:!1,color:{link:!0},typography:{fontSize:!0,lineHeight:!0}},editorStyle:"wp-block-term-description-editor"},{name:See}=Aee,Cee={icon:Lee,edit:function({attributes:e,setAttributes:t,mergedStyle:n}){const{textAlign:r}=e,o=VR({className:so()({[`has-text-align-${r}`]:r}),style:n});return(0,tt.createElement)(tt.Fragment,null,(0,tt.createElement)(lk,{group:"block"},(0,tt.createElement)(gD,{value:r,onChange:e=>{t({textAlign:e})}})),(0,tt.createElement)("div",o,(0,tt.createElement)("div",{className:"wp-block-term-description__placeholder"},(0,tt.createElement)("span",null,er("Term description.")))))}},Tee=e=>{if(!e)return;const{metadata:t,settings:n,name:r}=e;xo({name:r,...t},n)},xee=(e=(()=>[w,E,L,T,G,A,ue,x,z,O,N,D,B,I,P,R,Y,W,H,le,window.wp&&window.wp.oldEditor?be:null,q,j,U,$,J,Q,Z,ee,te,ne,ie,se,ce,ae,ve,ye,de,pe,ge,me,fe,he,_e,Me,ke,Ee,Le,Ae,Se,Ce,Te,xe,Oe,Ne,je,Fe,Ve,Xe,K])())=>{var t,n;e.forEach(Tee),t=BK,nn(Gr).setDefaultBlockName(t),window.wp&&window.wp.oldEditor&&(n=K6,nn(Gr).setFreeformFallbackBlockName(n)),function(e){nn(Gr).setUnregisteredFallbackBlockName(e)}(p4),function(e){nn(Gr).setGroupingBlockName(e)}(k5)},zee=(0,tt.createElement)(mo,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,tt.createElement)(uo,{d:"M14.7 11.3c1-.6 1.5-1.6 1.5-3 0-2.3-1.3-3.4-4-3.4H7v14h5.8c1.4 0 2.5-.3 3.3-1 .8-.7 1.2-1.7 1.2-2.9.1-1.9-.8-3.1-2.6-3.7zm-5.1-4h2.3c.6 0 1.1.1 1.4.4.3.3.5.7.5 1.2s-.2 1-.5 1.2c-.3.3-.8.4-1.4.4H9.6V7.3zm4.6 9c-.4.3-1 .4-1.7.4H9.6v-3.9h2.9c.7 0 1.3.2 1.7.5.4.3.6.8.6 1.5s-.2 1.2-.6 1.5z"})),Oee="core/bold",Nee=er("Bold"),Dee={name:Oee,title:Nee,tagName:"strong",className:null,edit({isActive:e,value:t,onChange:n,onFocus:r}){function o(){n(__(t,{type:Oee}))}return(0,tt.createElement)(tt.Fragment,null,(0,tt.createElement)(Oj,{type:"primary",character:"b",onUse:o}),(0,tt.createElement)(Nj,{name:"bold",icon:zee,title:Nee,onClick:function(){o(),r()},isActive:e,shortcutType:"primary",shortcutCharacter:"b"}),(0,tt.createElement)(Dj,{inputType:"formatBold",onInput:o}))}},Bee="core/code",Iee=er("Inline code"),Pee={name:Bee,title:Iee,tagName:"code",className:null,__unstableInputRule(e){const{start:t,text:n}=e;if("`"!==n.slice(t-1,t))return e;const r=n.slice(0,t-1).lastIndexOf("`");if(-1===r)return e;const o=r,a=t-2;return o===a?e:(e=t_(e,o,o+1),e=Ay(e=t_(e,a,a+1),{type:Bee},o,a))},edit:({value:e,onChange:t,onFocus:n,isActive:r})=>(0,tt.createElement)(Nj,{icon:NZ,title:Iee,onClick:function(){t(__(e,{type:Bee})),n()},isActive:r})},Ree=["image"],Yee="core/image",Wee=er("Inline image"),Hee={name:Yee,title:Wee,keywords:[er("photo"),er("media")],object:!0,tagName:"img",className:null,attributes:{className:"class",style:"style",url:"src",alt:"alt"},edit:function({value:e,onChange:t,onFocus:n,isObjectActive:r,activeObjectAttributes:o,contentRef:a}){const[i,s]=(0,tt.useState)(!1);function l(){s(!1)}return(0,tt.createElement)(Gq,null,(0,tt.createElement)(Nj,{icon:(0,tt.createElement)(mo,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,tt.createElement)(uo,{d:"M4 18.5h16V17H4v1.5zM16 13v1.5h4V13h-4zM5.1 15h7.8c.6 0 1.1-.5 1.1-1.1V6.1c0-.6-.5-1.1-1.1-1.1H5.1C4.5 5 4 5.5 4 6.1v7.8c0 .6.5 1.1 1.1 1.1zm.4-8.5h7V10l-1-1c-.3-.3-.8-.3-1 0l-1.6 1.5-1.2-.7c-.3-.2-.6-.2-.9 0l-1.3 1V6.5zm0 6.1l1.8-1.3 1.3.8c.3.2.7.2.9-.1l1.5-1.4 1.5 1.4v1.5h-7v-.9z"})),title:Wee,onClick:function(){s(!0)},isActive:r}),i&&(0,tt.createElement)(Kq,{allowedTypes:Ree,onSelect:({id:r,url:o,alt:a,width:i})=>{l(),t(function(e,t,n,r){return e_(e,{formats:[,],replacements:[t],text:xy},n,r)}(e,{type:Yee,attributes:{className:`wp-image-${r}`,style:`width: ${Math.min(i,150)}px;`,url:o,alt:a}})),n()},onClose:l,render:({open:e})=>(e(),null)}),r&&(0,tt.createElement)(qee,{value:e,onChange:t,activeObjectAttributes:o,contentRef:a}))}};function qee({value:e,onChange:t,activeObjectAttributes:n,contentRef:r}){const{style:o}=n,[a,i]=(0,tt.useState)(null==o?void 0:o.replace(/\D/g,"")),s=S_({ref:r,value:e,settings:Hee});return(0,tt.createElement)(_f,{position:"bottom center",focusOnMount:!1,anchorRef:s,className:"block-editor-format-toolbar__image-popover"},(0,tt.createElement)("form",{className:"block-editor-format-toolbar__image-container-content",onSubmit:r=>{const o=e.replacements.slice();o[e.start]={type:Yee,attributes:{...n,style:a?`width: ${a}px;`:""}},t({...e,replacements:o}),r.preventDefault()}},(0,tt.createElement)(LA,{className:"block-editor-format-toolbar__image-container-value",type:"number",label:er("Width"),value:a,min:1,onChange:e=>i(e)}),(0,tt.createElement)(Eh,{icon:uq,label:er("Apply"),type:"submit"})))}const jee=(0,tt.createElement)(mo,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,tt.createElement)(uo,{d:"M12.5 5L10 19h1.9l2.5-14z"})),Fee="core/italic",Vee=er("Italic"),Xee={name:Fee,title:Vee,tagName:"em",className:null,edit({isActive:e,value:t,onChange:n,onFocus:r}){function o(){n(__(t,{type:Fee}))}return(0,tt.createElement)(tt.Fragment,null,(0,tt.createElement)(Oj,{type:"primary",character:"i",onUse:o}),(0,tt.createElement)(Nj,{name:"italic",icon:jee,title:Vee,onClick:function(){o(),r()},isActive:e,shortcutType:"primary",shortcutCharacter:"i"}),(0,tt.createElement)(Dj,{inputType:"formatItalic",onInput:o}))}};function Uee(e){return!!e&&/^#[^\s#?\/]*$/.test(e)}function $ee(e){if(!e)return!1;const t=e.trim();if(!t)return!1;if(/^\S+:/.test(t)){const e=Aq(t);if(!function(e){return!!e&&/^[a-z\-.\+]+[0-9]*:$/i.test(e)}(e))return!1;if((0,at.startsWith)(e,"http")&&!/^https?:\/\/[^\/\s]/i.test(t))return!1;if(!function(e){return!!e&&/^[^\s#?]+$/.test(e)}(function(e){const t=/^[^\/\s:]+:(?:\/\/)?\/?([^\/\s#?]+)[\/#?]{0,1}\S*$/.exec(e);if(t)return t[1]}(t)))return!1;const n=SG(t);if(n&&!function(e){return!!e&&/^[^\s#?]+$/.test(e)}(n))return!1;const r=Bl(t);if(r&&!function(e){return!!e&&/^[^\s#?\/]+$/.test(e)}(r))return!1;const o=function(e){const t=/^\S+?(#[^\s\?]*)/.exec(e);if(t)return t[1]}(t);if(o&&!Uee(o))return!1}return!((0,at.startsWith)(t,"#")&&!Uee(t))}const Kee=pq((function({isActive:e,activeAttributes:t,addingLink:n,value:r,onChange:o,speak:a,stopAddingLink:i,contentRef:s}){const[l,c]=(0,tt.useState)(),u={url:t.url,type:t.type,id:t.id,opensInNewTab:"_blank"===t.target,...l},d=S_({ref:s,value:r,settings:Qee}),p=(0,tt.useRef)(!!n&&"firstElement");return(0,tt.createElement)(_f,{anchorRef:d,focusOnMount:p.current,onClose:i,position:"bottom center"},(0,tt.createElement)(Vq,{value:u,onChange:function(t){t={...l,...t};const n=u.opensInNewTab!==t.opensInNewTab&&u.url===t.url,s=n&&void 0===t.url;if(c(s?t:void 0),s)return;const d=xq(t.url),p=function({url:e,type:t,id:n,opensInNewWindow:r}){const o={type:"core/link",attributes:{url:e}};return t&&(o.attributes.type=t),n&&(o.attributes.id=n),r&&(o.attributes.target="_blank",o.attributes.rel="noreferrer noopener"),o}({url:d,type:t.type,id:void 0!==t.id&&null!==t.id?String(t.id):void 0,opensInNewWindow:t.opensInNewTab});if($y(r)&&!e){const e=t.title||d,n=Ay(Ny({text:e}),p,0,e.length);o(e_(r,n))}else{const e=Ay(r,p);e.start=e.end,e.activeFormats=[],o(e)}n||i(),$ee(d)?a(er(e?"Link edited.":"Link inserted."),"assertive"):a(er("Warning: the link has been inserted but may have errors. Please test it."),"assertive")},onRemove:function(){const e=Qy(r,"core/link");o(e),i(),a(er("Link removed."),"assertive")},forceIsEditingLink:n,hasRichPreviews:!0}))})),Gee="core/link",Jee=er("Link");const Qee={name:Gee,title:Jee,tagName:"a",className:null,attributes:{url:"href",type:"data-type",id:"data-id",target:"target"},__unstablePasteRule(e,{html:t,plainText:n}){if($y(e))return e;const r=(t||n).replace(/<[^>]+>/g,"").trim();return fq(r)?(window.console.log("Created link:\n\n",r),Ay(e,{type:Gee,attributes:{url:xa(r)}})):e},edit:function({isActive:e,activeAttributes:t,value:n,onChange:r,onFocus:o,contentRef:a}){const[i,s]=(0,tt.useState)(!1);function l(){const e=Fy(r_(n));e&&fq(e)&&$ee(e)?r(Ay(n,{type:Gee,attributes:{url:e}})):e&&Cq(e)?r(Ay(n,{type:Gee,attributes:{url:`mailto:${e}`}})):s(!0)}function c(){r(Qy(n,Gee)),fy(er("Link removed."),"assertive")}return(0,tt.createElement)(tt.Fragment,null,(0,tt.createElement)(Oj,{type:"primary",character:"k",onUse:l}),(0,tt.createElement)(Oj,{type:"primaryShift",character:"k",onUse:c}),e&&(0,tt.createElement)(Nj,{name:"link",icon:pT,title:er("Unlink"),onClick:c,isActive:e,shortcutType:"primaryShift",shortcutCharacter:"k"}),!e&&(0,tt.createElement)(Nj,{name:"link",icon:dT,title:Jee,onClick:l,isActive:e,shortcutType:"primary",shortcutCharacter:"k"}),(i||e)&&(0,tt.createElement)(Kee,{addingLink:i,stopAddingLink:function(){s(!1),o()},isActive:e,activeAttributes:t,value:n,onChange:r,contentRef:a}))}},Zee="core/strikethrough",ete=er("Strikethrough"),tte={name:Zee,title:ete,tagName:"s",className:null,edit:({isActive:e,value:t,onChange:n,onFocus:r})=>(0,tt.createElement)(Nj,{icon:ox,title:ete,onClick:function(){n(__(t,{type:Zee})),r()},isActive:e})},nte="core/underline",rte={name:nte,title:er("Underline"),tagName:"span",className:null,attributes:{style:"style"},edit({value:e,onChange:t}){const n=()=>{t(__(e,{type:nte,attributes:{style:"text-decoration: underline;"}}))};return(0,tt.createElement)(tt.Fragment,null,(0,tt.createElement)(Oj,{type:"primary",character:"u",onUse:n}),(0,tt.createElement)(Dj,{inputType:"formatUnderline",onInput:n}))}};function ote(e,t,n){const r=jy(t,e);if(!r)return;const o=r.attributes.style;if(o)return o.replace(new RegExp("^color:\\s*"),"");const a=r.attributes.class;if(a){const e=a.replace(/.*has-([^\s]*)-color.*/,"$1");return dC(n,e).color}}const ate=({name:e,value:t,onChange:n})=>{const r=Tl((e=>{const{getSettings:t}=e(nk);return(0,at.get)(t(),["colors"],[])})),o=(0,tt.useCallback)((o=>{if(o){const a=pC(r,o);n(Ay(t,{type:e,attributes:a?{class:mC("color",a.slug)}:{style:`color:${o}`}}))}else n(Qy(t,e))}),[r,n]),a=(0,tt.useMemo)((()=>ote(e,t,r)),[e,t,r]);return(0,tt.createElement)(WH,{value:a,onChange:o})};function ite({name:e,value:t,onChange:n,onClose:r,contentRef:o}){const a=S_({ref:o,value:t,settings:ute});return(0,tt.createElement)(nj,{value:t,onClose:r,className:"components-inline-color-popover",anchorRef:a},(0,tt.createElement)(ate,{name:e,value:t,onChange:n}))}const ste="core/text-color",lte=er("Text color"),cte=[];const ute={name:ste,title:lte,tagName:"span",className:"has-inline-color",attributes:{style:"style",class:"class"},edit:function({value:e,onChange:t,isActive:n,activeAttributes:r,contentRef:o}){const a=JL("color.custom"),i=JL("color.palette")||cte,[s,l]=(0,tt.useState)(!1),c=(0,tt.useCallback)((()=>l(!0)),[l]),u=(0,tt.useCallback)((()=>l(!1)),[l]),d=(0,tt.useMemo)((()=>{const t=ote(ste,e,i);if(t)return{backgroundColor:t}}),[e,i]),p=!(0,at.isEmpty)(i)||!a;return p||n?(0,tt.createElement)(tt.Fragment,null,(0,tt.createElement)(Nj,{key:n?"text-color":"text-color-not-active",className:"format-library-text-color-button",name:n?"text-color":void 0,icon:(0,tt.createElement)(tt.Fragment,null,(0,tt.createElement)($L,{icon:Uz}),n&&(0,tt.createElement)("span",{className:"format-library-text-color-button__indicator",style:d})),title:lte,onClick:p?c:()=>t(Qy(e,ste))}),s&&(0,tt.createElement)(ite,{name:ste,onClose:u,activeAttributes:r,value:e,onChange:t,contentRef:o})):null}},dte=(0,tt.createElement)(mo,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,tt.createElement)(uo,{d:"M16.9 18.3l.8-1.2c.4-.6.7-1.2.9-1.6.2-.4.3-.8.3-1.2 0-.3-.1-.7-.2-1-.1-.3-.4-.5-.6-.7-.3-.2-.6-.3-1-.3s-.8.1-1.1.2c-.3.1-.7.3-1 .6l.2 1.3c.3-.3.5-.5.8-.6s.6-.2.9-.2c.3 0 .5.1.7.2.2.2.2.4.2.7 0 .3-.1.5-.2.8-.1.3-.4.7-.8 1.3L15 19.4h4.3v-1.2h-2.4zM14.1 7.2h-2L9.5 11 6.9 7.2h-2l3.6 5.3L4.7 18h2l2.7-4 2.7 4h2l-3.8-5.5 3.8-5.3z"})),pte="core/subscript",mte=er("Subscript"),fte={name:pte,title:mte,tagName:"sub",className:null,edit:({isActive:e,value:t,onChange:n,onFocus:r})=>(0,tt.createElement)(Nj,{icon:dte,title:mte,onClick:function(){n(__(t,{type:pte})),r()},isActive:e})},hte=(0,tt.createElement)(mo,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,tt.createElement)(uo,{d:"M16.9 10.3l.8-1.3c.4-.6.7-1.2.9-1.6.2-.4.3-.8.3-1.2 0-.3-.1-.7-.2-1-.2-.2-.4-.4-.7-.6-.3-.2-.6-.3-1-.3s-.8.1-1.1.2c-.3.1-.7.3-1 .6l.1 1.3c.3-.3.5-.5.8-.6s.6-.2.9-.2c.3 0 .5.1.7.2.2.2.2.4.2.7 0 .3-.1.5-.2.8-.1.3-.4.7-.8 1.3l-1.8 2.8h4.3v-1.2h-2.2zm-2.8-3.1h-2L9.5 11 6.9 7.2h-2l3.6 5.3L4.7 18h2l2.7-4 2.7 4h2l-3.8-5.5 3.8-5.3z"})),gte="core/superscript",bte=er("Superscript"),vte={name:gte,title:bte,tagName:"sup",className:null,edit:({isActive:e,value:t,onChange:n,onFocus:r})=>(0,tt.createElement)(Nj,{icon:hte,title:bte,onClick:function(){n(__(t,{type:gte})),r()},isActive:e})},yte="core/keyboard",_te=er("Keyboard input");[Dee,Pee,Hee,Xee,Qee,tte,rte,ute,fte,vte,{name:yte,title:_te,tagName:"kbd",className:null,edit:({isActive:e,value:t,onChange:n,onFocus:r})=>(0,tt.createElement)(Nj,{icon:tZ,title:_te,onClick:function(){n(__(t,{type:yte})),r()},isActive:e})}].forEach((({name:e,...t})=>function(e,t){if("string"==typeof(t={name:e,...t}).name)if(/^[a-z][a-z0-9-]*\/[a-z][a-z0-9-]*$/.test(t.name))if(tn(ky).getFormatType(t.name))window.console.error('Format "'+t.name+'" is already registered.');else if("string"==typeof t.tagName&&""!==t.tagName)if("string"==typeof t.className&&""!==t.className||null===t.className)if(/^[_a-zA-Z]+[a-zA-Z0-9-]*$/.test(t.className)){if(null===t.className){const e=tn(ky).getFormatTypeForBareElement(t.tagName);if(e)return void window.console.error(`Format "${e.name}" is already registered to handle bare tag name "${t.tagName}".`)}else{const e=tn(ky).getFormatTypeForClassName(t.className);if(e)return void window.console.error(`Format "${e.name}" is already registered to handle class name "${t.className}".`)}if("title"in t&&""!==t.title)if("keywords"in t&&t.keywords.length>3)window.console.error('The format "'+t.name+'" can have a maximum of 3 keywords.');else{if("string"==typeof t.title)return nn(ky).addFormatTypes(t),t;window.console.error("Format titles must be strings.")}else window.console.error('The format "'+t.name+'" must have a title.')}else window.console.error("A class name must begin with a letter, followed by any number of hyphens, letters, or numbers.");else window.console.error("Format class names must be a string, or null to handle bare elements.");else window.console.error("Format tag names must be a string.");else window.console.error("Format names must contain a namespace prefix, include only lowercase alphanumeric characters or dashes, and start with a letter. Example: my-plugin/my-custom-format");else window.console.error("Format names must be strings.")}(e,t)));const Mte=["button","submit"];const kte=ri((e=>class extends tt.Component{constructor(){super(...arguments),this.bindNode=this.bindNode.bind(this),this.cancelBlurCheck=this.cancelBlurCheck.bind(this),this.queueBlurCheck=this.queueBlurCheck.bind(this),this.normalizeButtonFocus=this.normalizeButtonFocus.bind(this)}componentWillUnmount(){clearTimeout(this.blurCheckTimeout)}bindNode(e){e?this.node=e:(delete this.node,this.cancelBlurCheck())}queueBlurCheck(e){e.persist(),this.preventBlurCheck||(this.blurCheckTimeout=setTimeout((()=>{document.hasFocus()?"function"==typeof this.node.handleFocusOutside&&this.node.handleFocusOutside(e):e.preventDefault()}),0))}cancelBlurCheck(){clearTimeout(this.blurCheckTimeout),void 0!==this.node&&"function"==typeof this.node.handleFocus&&this.node.handleFocus(event)}normalizeButtonFocus(e){const{type:t,target:n}=e;(0,at.includes)(["mouseup","touchend"],t)?this.preventBlurCheck=!1:function(e){switch(e.nodeName){case"A":case"BUTTON":return!0;case"INPUT":return(0,at.includes)(Mte,e.type)}return!1}(n)&&(this.preventBlurCheck=!0)}render(){return(0,tt.createElement)("div",{onFocus:this.cancelBlurCheck,onMouseDown:this.normalizeButtonFocus,onMouseUp:this.normalizeButtonFocus,onTouchStart:this.normalizeButtonFocus,onTouchEnd:this.normalizeButtonFocus,onBlur:this.queueBlurCheck},(0,tt.createElement)(e,ot({ref:this.bindNode},this.props)))}}),"withFocusOutside")(class extends tt.Component{handleFocus(e){this.props.onFocus()}handleFocusOutside(e){const t=e.relatedTarget||e.target;t&&t.classList.contains("media-modal")||this.props.onOutside()}render(){return this.props.children}}),wte=(0,tt.createElement)(mo,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,tt.createElement)(uo,{fillRule:"evenodd",d:"M10.289 4.836A1 1 0 0111.275 4h1.306a1 1 0 01.987.836l.244 1.466c.787.26 1.503.679 2.108 1.218l1.393-.522a1 1 0 011.216.437l.653 1.13a1 1 0 01-.23 1.273l-1.148.944a6.025 6.025 0 010 2.435l1.149.946a1 1 0 01.23 1.272l-.653 1.13a1 1 0 01-1.216.437l-1.394-.522c-.605.54-1.32.958-2.108 1.218l-.244 1.466a1 1 0 01-.987.836h-1.306a1 1 0 01-.986-.836l-.244-1.466a5.995 5.995 0 01-2.108-1.218l-1.394.522a1 1 0 01-1.217-.436l-.653-1.131a1 1 0 01.23-1.272l1.149-.946a6.026 6.026 0 010-2.435l-1.148-.944a1 1 0 01-.23-1.272l.653-1.131a1 1 0 011.217-.437l1.393.522a5.994 5.994 0 012.108-1.218l.244-1.466zM14.929 12a3 3 0 11-6 0 3 3 0 016 0z",clipRule:"evenodd"}));const Ete=lS([QI(((e,{feature:t})=>({isActive:e("isolated/editor").isFeatureActive(t)}))),eP(((e,t)=>({onToggle(){e("isolated/editor").toggleFeature(t.feature),t.onClose()}}))),pq])((function({onToggle:e,isActive:t,label:n,info:r,messageActivated:o,messageDeactivated:a,speak:i}){return(0,tt.createElement)(zB,{icon:t&&kS,isSelected:t,onClick:(0,at.flow)(e,(()=>{i(t?a||er("Feature deactivated"):o||er("Feature activated"))})),role:"menuitemcheckbox",info:r},n)}));const Lte=lS([QI(((e,{option:t})=>({isActive:e("isolated/editor").isOptionActive(t)}))),eP(((e,t)=>({onToggle(){e("isolated/editor").toggleOption(t.option),t.onClose()}}))),pq])((function({onToggle:e,isActive:t,label:n,info:r}){return(0,tt.createElement)(zB,{icon:t&&kS,isSelected:t,onClick:e,role:"menuitemcheckbox",info:r},n)}));const Ate=function({onClose:e,settings:t}){var n;const{preview:r,fullscreen:o,topToolbar:a}=(null==t||null===(n=t.iso)||void 0===n?void 0:n.moreMenu)||{},{isFullscreen:i}=Tl((e=>({isFullscreen:e("isolated/editor").isOptionActive("fullscreenMode")})),[]);return o||r||a?(0,tt.createElement)(ON,{label:tr("View","noun")},a&&(0,tt.createElement)(tt.Fragment,null,(0,tt.createElement)(Ete,{feature:"fixedToolbar",label:er("Top toolbar"),info:er("Access all block and document tools in a single place."),messageActivated:er("Top toolbar activated"),messageDeactivated:er("Top toolbar deactivated"),onClose:e})),o&&(0,tt.createElement)(Lte,{option:"fullscreenMode",label:er("Fullscreen"),info:er("Show editor fullscreen."),onClose:e}),r&&!i&&(0,tt.createElement)(Lte,{option:"preview",label:er("Preview"),info:er("Preview the content before posting."),onClose:e})):null};const Ste=lS([QI((e=>{const{getEditorMode:t}=e("isolated/editor"),{codeEditingEnabled:n}=e("core/editor").getEditorSettings();return{editorMode:t(),isCodeEditingEnabled:n}})),eP((e=>({onSetMode(t){e("isolated/editor").setEditorMode(t)}})))])((function({onClose:e,editorMode:t,onSetMode:n,isCodeEditingEnabled:r,settings:o}){var a,i,s;const l=t=>{n(t),e()};return r&&!1!==(null==o||null===(a=o.iso)||void 0===a?void 0:a.moreMenu)&&null!=o&&null!==(i=o.iso)&&void 0!==i&&null!==(s=i.moreMenu)&&void 0!==s&&s.editor?(0,tt.createElement)(ON,{label:tr("Editor","noun")},(0,tt.createElement)(zB,{icon:"visual"===t&&kS,isSelected:"visual"===t,onClick:()=>l("visual"),role:"menuitemcheckbox"},er("Visual editor")),(0,tt.createElement)(zB,{icon:"text"===t&&kS,isSelected:"text"===t,onClick:()=>l("text"),role:"menuitemcheckbox"},er("Code editor"))):null}));const Cte=function({settings:e}){const{linkMenu:t=[]}=e.iso||{};return 0===t.length?null:(0,tt.createElement)(ON,{label:er("Links")},t.map((({title:e,url:t})=>(0,tt.createElement)(zB,{key:e},(0,tt.createElement)(CA,{href:t},e)))))},Tte={className:"edit-post-more-menu__content",position:"bottom left"},xte={tooltipPosition:"bottom"},zte=({settings:e,onClick:t,renderMoreMenu:n})=>(0,tt.createElement)(Zg,{className:"edit-post-more-menu",icon:OB,label:er("More tools & options"),popoverProps:Tte,toggleProps:{...xte,onClick:t}},(({onClose:t})=>(0,tt.createElement)(tt.Fragment,null,n&&n(e,t),(0,tt.createElement)(Ste,{onClose:t,settings:e}),(0,tt.createElement)(Ate,{onClose:t,settings:e}),(0,tt.createElement)(Cte,{settings:e})))),Ote=(0,tt.createElement)(mo,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,tt.createElement)(uo,{d:"M15.6 6.5l-1.1 1 2.9 3.3H8c-.9 0-1.7.3-2.3.9-1.4 1.5-1.4 4.2-1.4 5.6v.2h1.5v-.3c0-1.1 0-3.5 1-4.5.3-.3.7-.5 1.3-.5h9.2L14.5 15l1.1 1.1 4.6-4.6-4.6-5z"}));const Nte=(0,tt.forwardRef)((function(e,t){const n=Tl((e=>e("core/editor").hasEditorRedo()),[]),{redo:r}=ld("core/editor");return(0,tt.createElement)(Eh,ot({},e,{ref:t,icon:Ote,label:er("Redo"),shortcut:bm.primaryShift("z"),"aria-disabled":!n,onClick:n?r:void 0,className:"editor-history__redo"}))})),Dte=(0,tt.createElement)(mo,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,tt.createElement)(uo,{d:"M18.3 11.7c-.6-.6-1.4-.9-2.3-.9H6.7l2.9-3.3-1.1-1-4.5 5L8.5 16l1-1-2.7-2.7H16c.5 0 .9.2 1.3.5 1 1 1 3.4 1 4.5v.3h1.5v-.2c0-1.5 0-4.3-1.5-5.7z"}));const Bte=(0,tt.forwardRef)((function(e,t){const n=Tl((e=>e("isolated/editor").hasEditorUndo()),[]),{undo:r}=ld("isolated/editor");return(0,tt.createElement)(Eh,ot({},e,{ref:t,icon:Dte,label:er("Undo"),shortcut:bm.primary("z"),"aria-disabled":!n,onClick:n?r:void 0,className:"editor-history__undo"}))}));const Ite=function(e){const t=(0,tt.useRef)(),{setIsInserterOpened:n}=ld("isolated/editor"),r=Jp("medium","<"),{hasFixedToolbar:o,hasPeers:a,isInserterEnabled:i,isTextModeEnabled:s,previewDeviceType:l,isInserterOpened:c}=Tl((e=>{const{hasInserterItems:t,getBlockRootClientId:n,getBlockSelectionEnd:r}=e("core/block-editor");return{hasFixedToolbar:e("isolated/editor").isFeatureActive("fixedToolbar"),hasPeers:e("isolated/editor").hasPeers(),isInserterEnabled:"visual"===e("isolated/editor").getEditorMode()&&e("core/editor").getEditorSettings().richEditingEnabled&&t(n(r())),isTextModeEnabled:"text"===e("isolated/editor").getEditorMode(),previewDeviceType:"Desktop",isInserterOpened:e("isolated/editor").isInserterOpened()}}),[]),u=Jp("medium"),{inserter:d,toc:p,navigation:m,undo:f}=e.settings.iso.toolbar,h=f&&!a,g=!u||"Desktop"!==l||o,b=er(g?"Document and block tools":"Document tools");return(0,tt.createElement)(MY,{className:"edit-post-header-toolbar","aria-label":b},(d||h||m||p)&&(0,tt.createElement)("div",{className:"edit-post-header-toolbar__left"},d&&(0,tt.createElement)(Hg,{ref:t,as:Eh,className:"edit-post-header-toolbar__inserter-toggle",isPrimary:!0,isPressed:c,onMouseDown:e=>{e.preventDefault()},onClick:()=>{c?t.current.focus():n(!0)},disabled:!i,icon:OS,label:tr("Add block","Generic label for block inserter button")}),c&&(0,tt.createElement)(_f,{position:"bottom right",onClose:()=>n(!1),anchorRef:t.current},(0,tt.createElement)(uF,{showMostUsedBlocks:!1,showInserterHelpPanel:!0,onSelect:()=>{r&&n(!1)}})),h&&(0,tt.createElement)(Hg,{as:Bte}),h&&(0,tt.createElement)(Hg,{as:Nte}),m&&(0,tt.createElement)(Hg,{as:bH,isDisabled:s}),p&&(0,tt.createElement)(Hg,{as:hK,hasOutlineItemsDisabled:s})),g&&!s&&(0,tt.createElement)("div",{className:"edit-post-header-toolbar__block-toolbar"},(0,tt.createElement)(XY,{hideDragHandle:!0})))},Pte=({currentTab:e,setTab:t,documentTitle:n})=>{const r=(0,tt.createRef)(),o=(0,tt.createRef)();return(0,tt.useEffect)((()=>{"document"===e?r.current.focus():o.current.focus()}),[]),(0,tt.createElement)("div",{className:"components-panel__header interface-complementary-area-header edit-post-sidebar__panel-tabs"},(0,tt.createElement)("ul",null,(0,tt.createElement)("li",null,(0,tt.createElement)(Eh,{onClick:()=>t("document"),ref:r,className:so()("edit-post-sidebar__panel-tab","document"===e&&"is-active")},n)),(0,tt.createElement)("li",null,(0,tt.createElement)(Eh,{onClick:()=>t("block"),ref:o,className:so()("edit-post-sidebar__panel-tab","block"===e&&"is-active")},er("Block")))))},{Fill:Rte,Slot:Yte}=pf("PluginDocumentSettingPanel"),Wte=({children:e})=>(0,tt.createElement)(Rte,null,e);Wte.Slot=function(e){return(0,tt.createElement)(Yte,null,(e=>0===e.length?(0,tt.createElement)("span",{className:"block-editor-block-inspector__no-blocks"},er("Nothing to display")):e))};const Hte=Wte;const qte=function(e){const{documentInspector:t,blockSelected:n}=e,[r,o]=(0,tt.useState)(n||!t?"block":"document");return(0,tt.createElement)(_f,{position:"bottom",className:"iso-inspector"},t&&(0,tt.createElement)(Pte,{setTab:o,currentTab:r,documentTitle:t}),"block"===r&&(0,tt.createElement)(cF,null),"document"===r&&(0,tt.createElement)(Hte.Slot,null))},{Fill:jte,Slot:Fte}=pf("IsolatedToolbar"),Vte=({children:e})=>(0,tt.createElement)(jte,null,e);Vte.Slot=function(e){return(0,tt.createElement)(Fte,null,(e=>e))};const Xte=Vte,Ute=e=>{var t;const{settings:n,editorMode:r,renderMoreMenu:o}=e,{inspector:a,documentInspector:i}=(null===(t=n.iso)||void 0===t?void 0:t.toolbar)||{},{moreMenu:s}=n.iso||{},{setInspecting:l}=ld("isolated/editor"),{isInspecting:c,isBlockSelected:u}=Tl((e=>({isInspecting:e("isolated/editor").isInspecting(),isBlockSelected:!!e("core/block-editor").getBlockSelectionStart()})),[]);return(0,tt.useEffect)((()=>{c&&!u&&l(!1)}),[u]),(0,tt.createElement)("div",{className:"edit-post-editor-regions__header",role:"region",tabIndex:-1},(0,tt.createElement)("div",{className:"edit-post-header"},(0,tt.createElement)("div",{className:"edit-post-header__toolbar"},(0,tt.createElement)(Ite,{settings:n})),(0,tt.createElement)("div",{className:"edit-post-header__settings"},(0,tt.createElement)(Xte.Slot,null),a&&(0,tt.createElement)(Eh,{icon:wte,label:er("Settings"),onClick:()=>l(!c),isPressed:c,"aria-expanded":c,shortcut:"x",disabled:"text"===r}),c&&(0,tt.createElement)(qte,{documentInspector:i,blockSelected:u}),s&&(0,tt.createElement)(zte,{settings:n,onClick:()=>l(!1),renderMoreMenu:o}))))},$te=()=>{const e=Ym([(0,tt.useRef)(),GI(),C_((e=>{function t(t){if(t.target!==e)return;const n=Om.focusable.find(e),r=(0,at.findLast)(n,OF);if(!r)return;const{bottom:o}=r.getBoundingClientRect();t.clientY{e.addEventListener("mousedown",t)}}),[]),bF(),ZY(),fF()]);return(0,tt.createElement)("div",{className:"edit-post-visual-editor"},(0,tt.createElement)(_f.Slot,{name:"block-toolbar"}),(0,tt.createElement)("div",{className:"editor-styles-wrapper",ref:e},(0,tt.createElement)(zF,null,(0,tt.createElement)(nW,null))))};class Kte extends tt.Component{constructor(e){super(e),this.edit=this.edit.bind(this),this.stopEditing=this.stopEditing.bind(this),this.state={}}static getDerivedStateFromProps(e,t){return t.isDirty?null:{value:e.value,isDirty:!1}}edit(e){const t=e.target.value;this.props.onChange(t),this.setState({value:t,isDirty:!0})}stopEditing(){this.state.isDirty&&(this.props.onPersist(this.state.value),this.setState({isDirty:!1}))}render(){const{value:e}=this.state,{instanceId:t}=this.props;return(0,tt.createElement)(tt.Fragment,null,(0,tt.createElement)("label",{htmlFor:`post-content-${t}`,className:"screen-reader-text"},er("Type text or HTML")),(0,tt.createElement)(yR.Z,{autoComplete:"off",dir:"auto",value:e,onChange:this.edit,onBlur:this.stopEditing,className:"editor-post-text-editor",id:`post-content-${t}`,placeholder:er("Start writing with text or HTML")}))}}const Gte=lS([QI((e=>{const{getBlocks:t}=e("isolated/editor");return{value:gi(t())}})),eP((e=>{const{updateBlocksWithoutUndo:t}=e("isolated/editor");return{onChange(e){const n=ns(e);t(n)},onPersist(e){const n=ns(e);t(n)}}})),cS])(Kte);const Jte=function({}){return(0,tt.createElement)("div",{className:"edit-post-text-editor"},(0,tt.createElement)("div",{className:"edit-post-text-editor__body"},(0,tt.createElement)(Gte,null)))},Qte="is-fullscreen-mode";function Zte(){document.body.classList.remove(Qte),document.querySelector("html").classList.remove(Qte)}function ene(){const{fullscreenMode:e}=Tl((e=>({fullscreenMode:e("isolated/editor").isOptionActive("fullscreenMode")})),[]);return(0,tt.useEffect)((()=>(e?(document.body.classList.add(Qte),document.querySelector("html").classList.add(Qte)):Zte(),()=>{Zte()})),[e]),null}const tne=eP(((e,t,{select:n})=>{const r=n("isolated/editor").hasPeers,{redo:o,undo:a}=e("isolated/editor"),i=t=>()=>{if(r()){const t="isolated/undo-disabled";return e("core/notices").removeNotice(t),e("core/notices").createNotice("warning","Undo/redo is disabled while editing with other users.",{id:t})}return t()};return{redo:i(o),undo:i(a)}}))((function(e){const{isEditing:t,editorMode:n,children:r,undo:o,redo:a}=e;return(0,tt.createElement)(tt.Fragment,null,(0,tt.createElement)(ene,null),(0,tt.createElement)(Z$,null),t&&(0,tt.createElement)(tt.Fragment,null,(0,tt.createElement)(pF,null),(0,tt.createElement)(pF.Register,null)),(0,tt.createElement)(aS,{bindGlobal:!1,shortcuts:{[hm.primary("z")]:o,[hm.primaryShift("z")]:a}},"visual"===n&&(0,tt.createElement)($te,null),"text"===n&&(0,tt.createElement)(Jte,null)),r)}));const nne=function(e,t,n,r){if(void 0===e)return r;if(r&&r.length>0)return r;if(t){const n=((e,t)=>e&&e.find((e=>e.name===t)))(e,t);if(n)return ns(n.content)}return n?ml(r,n):[]};const rne=lS([QI((e=>{const{getBlocks:t,getEditorSelection:n,getEditorMode:r,isEditing:o}=e("isolated/editor");return{blocks:t(),selection:n(),isEditing:o(),editorMode:r()}})),eP((e=>{const{updateBlocksWithUndo:t,updateBlocksWithoutUndo:n}=e("isolated/editor");return{updateBlocksWithUndo:t,updateBlocksWithoutUndo:n}}))])((function(e){const{blocks:t,updateBlocksWithoutUndo:n,updateBlocksWithUndo:r,selection:o,isEditing:a,editorMode:i}=e,{children:s,settings:l,renderMoreMenu:c,onLoad:u}=e;return(0,tt.useEffect)((()=>{const e=function(e,t){return nne(e.iso.patterns,e.iso.currentPattern,e.editor.template,t)}(l,u?u(ns,Ns):[]);e.length>0&&(!t||0===t.length)&&n(e)}),[]),(0,tt.createElement)(IP,{value:t||[],onInput:n,onChange:r,useSubRegistry:!1,selection:o,settings:l.editor},(0,tt.createElement)(Ute,{editorMode:i,settings:l,renderMoreMenu:c}),(0,tt.createElement)(tne,{isEditing:a,editorMode:i},s),(0,tt.createElement)(_f.Slot,null))}));function one(e,t){const n=["core/block-editor","core/editor"];return{dispatch:t=>null===one.targetDispatch||-1===n.indexOf(t)?e.dispatch(t):one.targetDispatch(t),select:t=>null===one.targetSelect||-1===n.indexOf(t)?e.select(t):one.targetSelect(t)}}one.targetSelect=null,one.targetDispatch=null,one.setEditor=function(e,t){this.targetSelect=e,this.targetDispatch=t},one.resetEditor=function(){this.targetSelect=null,this.targetDispatch=null};const ane=one;const ine=lS([QI((e=>{const{isEditing:t}=e("isolated/editor");return{isEditing:t()}})),eP(((e,t,{select:n})=>({hotSwap:t=>{ane.resetEditor(),t&&ane.setEditor(n,e)}})))])((function({isEditing:e,hotSwap:t}){return(0,tt.useEffect)((()=>{t(e)}),[e]),null}));const sne=lS([QI((e=>{const{isEditorReady:t,getEditorMode:n,isEditing:r,isFeatureActive:o}=e("isolated/editor");return{isEditorReady:t(),editorMode:n(),isEditing:r(),hasFixedToolbar:o("fixedToolbar")}})),eP((e=>{const{setEditing:t}=e("isolated/editor");return{setEditing:t}}))])((function(e){const{children:t,settings:n,className:r,onError:o,renderMoreMenu:a,onLoad:i}=e,{isEditorReady:s,editorMode:l,isEditing:c,setEditing:u,hasFixedToolbar:d}=e,[p,{width:m}]=em(),f=so()(r,{"iso-editor":!0,"is-large":!!m&&m>=720,"is-medium":!m||m>=480&&m<720,"is-small":!!m&&m<480,"iso-editor__loading":!s,"iso-editor__selected":c,"block-editor":!0,"edit-post-layout":!0,"has-fixed-toolbar":d,["is-mode-"+l]:!0});return(0,tt.createElement)("div",{className:f},(0,tt.createElement)(nK,{onError:o},(0,tt.createElement)(ine,null),p,(0,tt.createElement)(kte,{onOutside:()=>u(!1),onFocus:()=>!c&&u(!0)},(0,tt.createElement)(rne,{settings:n,renderMoreMenu:a,onLoad:i},t))))}));let lne;const cne={getItem:e=>lne&&lne[e]?lne[e]:null,setItem(e,t){lne||cne.clear(),lne[e]=String(t)},clear(){lne=Object.create(null)}},une=cne;let dne;try{dne=window.localStorage,dne.setItem("__wpDataTestLocalStorage",""),dne.removeItem("__wpDataTestLocalStorage")}catch(e){dne=une}const pne=dne,mne="WP_DATA";function fne(e){const{storage:t=pne,storageKey:n=mne}=e;let r;return{get:function(){if(void 0===r){const e=t.getItem(n);if(null===e)r={};else try{r=JSON.parse(e)}catch(e){r={}}}return r},set:function(e,o){r={...r,[e]:o},t.setItem(n,JSON.stringify(r))}}}function hne(e,t){const n=fne(t);return{registerStore(t,r){if(!r.persist)return e.registerStore(t,r);const o=n.get()[t];if(void 0!==o){let e=r.reducer(r.initialState,{type:"@@WP/PERSISTENCE_RESTORE"});e=(0,at.isPlainObject)(e)&&(0,at.isPlainObject)(o)?(0,at.merge)({},e,o):o,r={...r,initialState:e}}const a=e.registerStore(t,r);return a.subscribe(function(e,t,r){let o;if(Array.isArray(r)){const e=r.reduce(((e,t)=>Object.assign(e,{[t]:(e,n)=>n.nextState[t]})),{});o=(e=>(t,n)=>n.nextState===t?t:e(t,n))(st()(e))}else o=(e,t)=>t.nextState;let a=o(void 0,{nextState:e()});return()=>{const r=o(a,{nextState:e()});r!==a&&(n.set(t,r),a=r)}}(a.getState,t,r.persist)),a}}}hne.__unstableMigrate=e=>{var t,n;const r=fne(e),o=r.get(),a=null===(t=o["core/editor"])||void 0===t||null===(n=t.preferences)||void 0===n?void 0:n.insertUsage;if(a){var i,s;const e=null===(i=o["core/block-editor"])||void 0===i||null===(s=i.preferences)||void 0===s?void 0:s.insertUsage;r.set("core/block-editor",{preferences:{insertUsage:{...a,...e}}})}let l=o["core/edit-post"];const c=Object.keys(o).length>0,u=(0,at.has)(o,["core/edit-post","preferences","features","fullscreenMode"]);c&&!u&&(l=(0,at.merge)({},l,{preferences:{features:{fullscreenMode:!1}}}));const d=(0,at.get)(o,["core/nux","preferences","areTipsEnabled"]),p=(0,at.has)(o,["core/edit-post","preferences","features","welcomeGuide"]);void 0===d||p||(l=(0,at.merge)({},l,{preferences:{features:{welcomeGuide:d}}})),l!==o["core/edit-post"]&&r.set("core/edit-post",l)};const gne=hne;var bne=n(1090);const vne={editCount:0,selection:null,blocks:null};function yne(e,t){return e.find((e=>e.clientId===t.clientId))}function _ne(e,t){const{type:n,selection:r}=e;if("UPDATE_BLOCKS_WITHOUT_UNDO"===n)return!1;if(!r)return!0;if(ni(r,t.selection)){const n=yne(t.blocks,r.selectionStart),o=yne(e.blocks,r.selectionStart);if(n&&o&&ni(n.attributes,o.attributes))return!1}return!0}const Mne=(0,bne.ZP)(((e=vne,t)=>{switch(t.type){case"UPDATE_BLOCKS_WITHOUT_UNDO":case"UPDATE_BLOCKS_WITH_UNDO":return{...e,editCount:_ne(t,e)?e.editCount+1:e.editCount,blocks:t.blocks,selection:t.selection}}return e}),{groupBy:(e,t,n)=>t.editCount}),kne={undo:()=>bne.zF.undo(),redo:()=>bne.zF.redo(),updateBlocksWithUndo:(e,t={})=>({type:"UPDATE_BLOCKS_WITH_UNDO",blocks:e,...t}),updateBlocksWithoutUndo:(e,t={})=>({type:"UPDATE_BLOCKS_WITHOUT_UNDO",blocks:e,...t})},wne={editorMode:"visual",isInserterOpened:!1,isEditing:!1,isInspecting:!1,isReady:!1,patterns:[],currentPattern:null,gutenbergTemplate:null,ignoredContent:[],settings:{preferencesKey:null,persistenceKey:null,blocks:{allowBlocks:[],disallowBlocks:[]},disallowEmbed:[],customStores:[],toolbar:{inserter:!0,toc:!1,undo:!0,inspector:!0,navigation:!1,documentInspector:!1},moreMenu:{editor:!1,fullscreen:!1,preview:!1,topToolbar:!1},linkMenu:[],currentPattern:null,patterns:[],defaultPreferences:{},allowApi:!1}};function Ene(e,t,n){const r=[gi(Ho("core/paragraph")),gi(Ho("core/paragraph",{className:""}))],o=((e,t)=>e&&e.find((e=>e.name===t)))(e,t);return o&&r.push(gi(ns(o.content))),n&&r.push(gi(ml([],n))),r}const Lne=(e=wne,t)=>{switch(t.type){case"SETUP_EDITOR":{const{currentPattern:n,patterns:r}=t.settings.iso;return{...e,patterns:r,currentPattern:n,ignoredContent:Ene(r,n,t.settings.editor.template),gutenbergTemplate:t.settings.editor.template,settings:{...e.settings,...t.settings.iso}}}case"SET_CURRENT_PATTERN":return{...e,currentPattern:t.pattern,ignoredContent:Ene(e.patterns,t.pattern,e.gutenbergTemplate),isInspecting:!1};case"SET_EDITOR_MODE":return{...e,editorMode:t.editorMode,isInspecting:!1};case"SET_INSERTER_OPEN":return{...e,isInserterOpened:t.isOpen,isInspecting:!1};case"SET_INSPECTOR_OPEN":return{...e,isInspecting:t.isOpen,isInserterOpened:!1};case"SET_EDITING":return{...e,isEditing:t.isEditing,isInspecting:!1};case"SET_EDITOR_READY":return{...e,isReady:t.isReady}}return e},Ane={setReady:e=>({type:"SET_EDITOR_READY",isReady:e}),setEditorMode:e=>({type:"SET_EDITOR_MODE",editorMode:e}),setupEditor:e=>({type:"SETUP_EDITOR",settings:e}),setCurrentPattern:e=>({type:"SET_CURRENT_PATTERN",pattern:e}),setIsInserterOpened:e=>({type:"SET_INSERTER_OPEN",isOpen:e}),setEditing:e=>({type:"SET_EDITING",isEditing:e}),setInspecting:e=>({type:"SET_INSPECTOR_OPEN",isOpen:e})},Sne=(e,t)=>{switch(t.type){case"TOGGLE_FEATURE":return{...e,[t.feature]:!e[t.feature]||!e[t.feature]}}return e},Cne={toggleFeature:e=>({type:"TOGGLE_FEATURE",feature:e})},Tne={},xne=(e=Tne,t)=>{switch(t.type){case"TOGGLE_OPTION":return{...e,[t.option]:!e[t.option]||!e[t.option]}}return e},zne={toggleOption:e=>({type:"TOGGLE_OPTION",option:e})},One=(e={},t)=>{switch(t.type){case"SET_PEER_SELECTION":return e[t.peerId]?{...e,[t.peerId]:{...e[t.peerId],...t.selection}}:e;case"SET_AVAILABLE_PEERS":return t.peers.reduce(((t,{id:n,name:r,color:o,avatarUrl:a})=>(t[n]=e[n]||{name:r,color:o,avatarUrl:a},t)),{})}return e};const Nne={setAvailablePeers:function(e){return{type:"SET_AVAILABLE_PEERS",peers:e}},setPeerSelection:function(e,t){return{type:"SET_PEER_SELECTION",peerId:e,selection:t}}};function Dne(e){return e.editor.editorMode}function Bne(e){return e.editor.settings}function Ine(e){return e.editor.isReady}function Pne(e){return e.editor.currentPattern}function Rne(e){const{currentPattern:t,patterns:n}=e.editor;if(t&&n)for(let e=0;ee.name===t));return r||(r=n.find((e=>e.name.replace("p2/","")===t)),r||null)}function Hne(e){return e.editor.isInserterOpened}function qne(e){return e.editor.isInspecting}function jne(e){return e.editor.isEditing}function Fne(e){return e.editor.patterns}function Vne(e){return e.blocks.present.blocks}function Xne(e){return e.blocks.present.selection}function Une(e){return e.blocks.past.length>0&&"visual"===Dne(e)}function $ne(e){return e.blocks.future.length>0&&"visual"===Dne(e)}function Kne(e){return e.blocks.present.editCount}function Gne(e,t){return!!e.preferences[t]&&e.preferences[t]}function Jne(e,t){return!!e.options[t]&&e.options[t]}function Qne(e){return e.peers}function Zne(e){return Object.keys(e.peers).length>0}const ere=function(e,t){return{reducer:st()({blocks:Mne,editor:Lne,preferences:Sne,options:xne,peers:One}),actions:{...kne,...Ane,...zne,...Cne,...Nne},selectors:{...Ke,...$e,...Ge,...Je,...Qe},persist:["preferences"],initialState:{preferences:e&&localStorage.getItem(e)?JSON.parse(localStorage.getItem(e)):t}}};var tre=n(2965),nre=n.n(tre);const rre={TOGGLE_FEATURE(e,t){const{getState:n}=t,{preferences:r,editor:o}=n();o.settings.preferencesKey&&localStorage.setItem(o.settings.preferencesKey,JSON.stringify(r))}};const ore=function(e){let t=()=>{throw new Error("Dispatching while constructing your middleware is not allowed. Other middleware would not be applied to this dispatch.")};const n={getState:e.getState,dispatch:(...e)=>t(...e)};return t=nre()({...rre})(n)(e.dispatch),e.dispatch=t,e};var are=n(2950);const{replaceBlocks:ire,selectBlock:sre,setTemplateValidity:lre,resetBlocks:cre,selectionChange:ure}=tk.actions,{getBlock:dre,getBlocks:pre,getSelectedBlockCount:mre,getTemplateLock:fre,getTemplate:hre,isValidTemplate:gre,getSelectionStart:bre}=tk.selectors;const vre={MERGE_BLOCKS(e,t){const{dispatch:n}=t,r=t.getState(),[o,a]=e.blocks,i=dre(r,o),s=Bo(i.name);if(!s.merge)return void n(sre(i.clientId));const l=dre(r,a),c=Bo(l.name),{clientId:u,attributeKey:d,offset:p}=bre(r),m=(u===o?s:c).attributes[d],f=(u===o||u===a)&&void 0!==d&&void 0!==p&&!!m;m||("number"==typeof d?window.console.error("RichText needs an identifier prop that is the block attribute key of the attribute it controls. Its type is expected to be a string, but was "+typeof d):window.console.error("The RichText identifier prop does not match any attributes defined by the block."));const h=Fo(i),g=Fo(l);if(f){const e=u===o?h:g,t=e.attributes[d],{multiline:n,__unstableMultilineWrapperTags:r,__unstablePreserveWhiteSpace:a}=m,i=e_(Ny({html:t,multilineTag:n,multilineWrapperTags:r,preserveWhiteSpace:a}),"",p,p);e.attributes[d]=u_({value:i,multilineTag:n,preserveWhiteSpace:a})}const b=i.name===l.name?[g]:Jo(g,i.name);if(!b||!b.length)return;const v=s.merge(h.attributes,b[0].attributes);if(f){const e=(0,at.findKey)(v,(e=>"string"==typeof e&&-1!==e.indexOf(""))),t=v[e],{multiline:r,__unstableMultilineWrapperTags:o,__unstablePreserveWhiteSpace:a}=s.attributes[e],l=Ny({html:t,multilineTag:r,multilineWrapperTags:o,preserveWhiteSpace:a}),c=l.text.indexOf(""),u=u_({value:t_(l,c,c+1),multilineTag:r,preserveWhiteSpace:a});v[e]=u,n(ure(i.clientId,e,c,c))}n(ire([i.clientId,l.clientId],[{...i,attributes:{...i.attributes,...v}},...b.slice(1)]))},RESET_BLOCKS:[function(e,t){const n=t.getState(),r=hre(n),o=fre(n),a=!r||"all"!==o||pl(e.blocks,r);if(a!==gre(n))return lre(a)}],MULTI_SELECT:(e,{getState:t})=>{const n=mre(t());fy(pn(nr("%s block selected.","%s blocks selected.",n),n),"assertive")},SYNCHRONIZE_TEMPLATE(e,{getState:t}){const n=t(),r=ml(pre(n),hre(n));return cre(r)},MARK_AUTOMATIC_CHANGE(e,t){const{setTimeout:n,requestIdleCallback:r=(e=>n(e,100))}=window;r((()=>{t.dispatch({type:"MARK_AUTOMATIC_CHANGE_FINAL"})}))}};const yre=function(e){const t=[nre()(vre),are.Z];let n=()=>{throw new Error("Dispatching while constructing your middleware is not allowed. Other middleware would not be applied to this dispatch.")},r=[];const o={getState:e.getState,dispatch:(...e)=>n(...e)};return r=t.map((e=>e(o))),n=(0,at.flowRight)(...r)(e.dispatch),e.dispatch=n,e};function*_re(e){yield function(e){return{type:"CONVERT_BLOCK_TO_STATIC",clientId:e}}(e)}function*Mre(e){yield function(e){return{type:"CONVERT_BLOCKS_TO_REUSABLE",clientIds:e}}(e)}function*kre(e){yield function(e){return{type:"DELETE_REUSABLE_BLOCK",id:e}}(e)}function wre(e,t){return{type:"SET_EDITING_REUSABLE_BLOCK",clientId:e,isEditing:t}}function Ere(e,t){return e.isEditingReusableBlock[t]}const Lre={actions:Ze,controls:{CONVERT_BLOCK_TO_STATIC:St((e=>({clientId:t})=>{const n=e.select("core/block-editor").getBlock(t),r=e.select("core").getEditedEntityRecord("postType","wp_block",n.attributes.ref),o=ns(r.content);e.dispatch("core/block-editor").replaceBlocks(n.clientId,o)})),CONVERT_BLOCKS_TO_REUSABLE:St((e=>async function({clientIds:t}){const n={title:er("Untitled Reusable Block"),content:gi(e.select("core/block-editor").getBlocksByClientId(t)),status:"publish"},r=Ho("core/block",{ref:(await e.dispatch("core").saveEntityRecord("postType","wp_block",n)).id});e.dispatch("core/block-editor").replaceBlocks(t,r),e.dispatch(reusableBlocksStore).__experimentalSetEditingReusableBlock(r.clientId,!0)})),DELETE_REUSABLE_BLOCK:St((e=>async function({id:t}){if(!e.select("core").getEditedEntityRecord("postType","wp_block",t))return;const n=e.select("core/block-editor").getBlocks().filter((e=>Yo(e)&&e.attributes.ref===t)).map((e=>e.clientId));n.length&&e.dispatch("core/block-editor").removeBlocks(n),await e.dispatch("core").deleteEntityRecord("postType","wp_block",t)}))},reducer:st()({isEditingReusableBlock:function(e={},t){return"SET_EDITING_REUSABLE_BLOCK"===(null==t?void 0:t.type)?{...e,[t.clientId]:t.isEditing}:e}}),selectors:et};let Are=[];const Sre=ri((e=>DP((t=>{const{registry:n,settings:r,...o}=t,a=function(e){var t,n,r,o,a,i,s,l,c,u,d,p,m,f,h;const{iso:g,editor:b}=e;return{iso:{preferencesKey:null!==(t=null==g?void 0:g.preferencesKey)&&void 0!==t?t:null,persistenceKey:null!==(n=null==g?void 0:g.persistenceKey)&&void 0!==n?n:null,disallowEmbed:null!==(r=null==g?void 0:g.disallowEmbed)&&void 0!==r?r:[],customStores:null!==(o=null==g?void 0:g.customStores)&&void 0!==o?o:[],blocks:{allowBlocks:null!==(a=null==g||null===(i=g.blocks)||void 0===i?void 0:i.allowBlocks)&&void 0!==a?a:[],disallowBlocks:null!==(s=null==g||null===(l=g.blocks)||void 0===l?void 0:l.disallowBlocks)&&void 0!==s?s:[]},toolbar:{inserter:!0,inspector:!1,navigation:!1,documentInspector:!1,toc:!1,undo:!0,...null!==(c=null==g?void 0:g.toolbar)&&void 0!==c?c:{}},moreMenu:(v=null==g?void 0:g.moreMenu,y={editor:!1,fullscreen:!1,preview:!1,topToolbar:!1,...null!==(u=null==g?void 0:g.moreMenu)&&void 0!==u?u:{}},!1!==v&&y),linkMenu:null!==(d=null==g?void 0:g.linkMenu)&&void 0!==d?d:[],defaultPreferences:{fixedToolbar:!0,...null!==(p=null==g?void 0:g.defaultPreferences)&&void 0!==p?p:{}},allowApi:null!==(m=null==g?void 0:g.allowApi)&&void 0!==m&&m,currentPattern:null!==(f=null==g?void 0:g.currentPattern)&&void 0!==f?f:null,patterns:null!==(h=null==g?void 0:g.patterns)&&void 0!==h?h:[]},editor:{alignWide:!0,disableCustomColors:!1,disableCustomFontSizes:!1,disablePostFormats:!0,titlePlaceholder:er("Add title"),bodyPlaceholder:er("Start writing or type / to choose a block"),isRTL:!1,autosaveInterval:60,maxUploadFileSize:0,allowedMimeTypes:[],styles:{css:"body { font-family: 'Noto Serif' }"},imageSizes:[],richEditingEnabled:!0,codeEditingEnabled:!1,allowedBlockTypes:!0,__experimentalCanUserUseUnfilteredHTML:!1,__experimentalBlockPatterns:[],reusableBlocks:[],fixedToolbar:!0,...b,availableLegacyWidgets:{},hasPermissionsToManageWidgets:!1,__experimentalFetchLinkSuggestions:null!=b&&b.__experimentalFetchLinkSuggestions?null==b?void 0:b.__experimentalFetchLinkSuggestions:()=>[]}};var v,y}(r),{persistenceKey:i,preferencesKey:s,defaultPreferences:l,customStores:c=[]}=a.iso||{},[u,d]=(0,tt.useState)(null);return(0,tt.useEffect)((()=>{const e=Zt({"core/reusable-blocks":Lre},n);i&&e.use(gne,{persistenceKey:i});const t=e.registerStore("isolated/editor",ere(s,l)),r=e.registerStore("core/block-editor",{...tk,persist:["preferences"]}),o=e.registerStore("core/editor",{...X$,selectors:{...X$.selectors,...(a=X$.selectors,u=e.select,{getEditedPostAttribute:(e,t)=>"content"===t?gi(u("core/block-editor").getBlocks()):a.getEditedPostAttribute(e,t),getEditedPostContent:()=>gi(u("core/block-editor").getBlocks())})},persist:["preferences"]});var a,u;return c.map((t=>{Are.push(e.registerStore(t.name,t.config))})),Are.push(t),Are.push(r),Are.push(o),ore(t),d(e),yre(r),function(){Are=Are.filter((e=>e!==t))}}),[n]),u?(0,tt.createElement)(kl,{value:u},(0,tt.createElement)(e,ot({},o,{settings:a}))):null}))),"withRegistryProvider");function Cre(e,t){return e&&e.allowBlocks&&e.allowBlocks.length>0?e.allowBlocks:t.map((e=>e.name))}function Tre(e,t,n,r){const o=(a=t.blocks)&&a.disallowBlocks?a.disallowBlocks:[];var a;return{...e,hasFixedToolbar:r,allowedBlockTypes:Cre(t.blocks,n).filter((e=>-1===o.indexOf(e))),mediaUpload:0===e.allowedMimeTypes.length?null:e.mediaUpload}}const xre=lS([QI(((e,{settings:t})=>{const{isEditing:n,isFeatureActive:r}=e("isolated/editor"),{getBlockTypes:o}=e("core/blocks"),a=o(),i=r("fixedToolbar"),s=e("core").getEntityRecords("postType","wp_block");return{isEditing:n(),topToolbar:i,currentSettings:(0,tt.useMemo)((()=>{var e;return{...t,editor:{...Tre(t.editor,t.iso,a,i||(null===(e=t.editor)||void 0===e?void 0:e.hasFixedToolbar)||!1),__experimentalReusableBlocks:[],__experimentalFetchReusableBlocks:!1}}}),[t,a,i,s])}})),eP((e=>{const{updateEditorSettings:t,setupEditorState:n}=e("core/editor"),{updateSettings:r}=e("core/block-editor"),{setupEditor:o}=e("isolated/editor");return{setupEditor:o,setupCoreEditor:n,updateSettings:({editor:e})=>{r(e),t(e)}}}))])((function(e){var t;const{currentSettings:n,updateSettings:r,setupEditor:o,isEditing:a,topToolbar:i,setupCoreEditor:s}=e;return(0,tt.useEffect)((()=>{o(n),r(n),s({id:0,type:"post"},[])}),[]),(0,tt.useEffect)((()=>{a&&r(n)}),[a,i,null==n||null===(t=n.editor)||void 0===t?void 0:t.reusableBlocks]),null}));const zre=lS([QI((e=>{const{getCurrentPattern:t}=e("isolated/editor");return{currentPattern:t()}})),eP((e=>{const{updateBlocksWithoutUndo:t}=e("isolated/editor");return{updateBlocksWithoutUndo:t}}))])((function(e){const{currentPattern:t,updateBlocksWithoutUndo:n}=e;return(0,tt.useEffect)((()=>{null!==t&&n(ns(t.content))}),[t]),null}));const Ore=function(e){const{onSaveBlocks:t,onSaveContent:n}=e,r=(0,tt.useRef)(!0),{setReady:o}=ld("isolated/editor"),{blocks:a,ignoredContent:i}=Tl((e=>({blocks:e("isolated/editor").getBlocks(),ignoredContent:e("isolated/editor").getIgnoredContent()})),[]);return(0,tt.useEffect)((()=>{a?r.current?(r.current=!1,o(!0)):(t&&t(a,i),n&&n(gi(a))):o(!0)}),[a]),null};const Nre=function(e){const t={OPTIONS:{"/wp/v2/blocks":{body:[]}},"/wp/v2/types?context=edit":{body:{post:{capabilities:{edit_post:"edit_post"},description:"",hierarchical:!1,viewable:!0,name:"Posts",slug:"post",labels:{name:"Posts",singular_name:"Post"},supports:{title:!1,editor:!0,author:!1,thumbnail:!1,excerpt:!1,trackbacks:!1,"custom-fields":!1,comments:!1,revisions:!1,"post-formats":!1,"geo-location":!1},taxonomies:[],rest_base:"posts"}}},"/wp/v2/posts/0?context=edit":{body:{id:0,type:"post"}}};ec.use(ec.createPreloadingMiddleware(t))};function Dre(){window.isoInitialisedBlocks||(window.isoInitialised||(xee(),window.isoInitialised=!0),on(ane,{}),In("editor.MediaUpload","isolated-block-editor/media-upload",(()=>wK)),Nre(),window.isoInitialisedBlocks=!0)}const Bre=Sre((function(e){const{children:t,onSaveContent:n,onSaveBlocks:r,settings:o,...a}=e;return Dre(),(0,tt.createElement)(tt.StrictMode,null,(0,tt.createElement)("div",{className:"interface-interface-skeleton__content"}),(0,tt.createElement)(Ore,{onSaveBlocks:r,onSaveContent:n}),(0,tt.createElement)(xre,{settings:o}),(0,tt.createElement)(zre,null),(0,tt.createElement)(df,null,(0,tt.createElement)(sne,ot({},a,{settings:o}),t)))})),Ire={iso:{moreMenu:!1}};window.wp={attachEditor:function(e){if("textarea"!==e.type.toLowerCase())return;const t=document.createElement("div");t.classList.add("editor"),e.parentNode.insertBefore(t,e.nextSibling),e.style.display="none",(0,rt.render)((0,tt.createElement)(Bre,{settings:Ire,onLoad:(t,n)=>function(e,t,n){return-1!==e.indexOf("\x3c!--")?t(e):n({HTML:e})}(e.value,t,n),onSaveContent:t=>function(e,t){t.value=e}(t,e),onError:()=>document.location.reload()}),t)},detachEditor:function(e){const t=e.nextSibling;t&&t.classList.contains("editor")&&((0,rt.unmountComponentAtNode)(t),e.style.display=null,t.parentNode.removeChild(t))}}})()})();
\ No newline at end of file
diff --git a/build-module/components/block-editor-contents/use-yjs/README.md b/build-module/components/block-editor-contents/use-yjs/README.md
deleted file mode 100644
index 3d09be6f2..000000000
--- a/build-module/components/block-editor-contents/use-yjs/README.md
+++ /dev/null
@@ -1,19 +0,0 @@
-# Real-time collaborative editing
-
-`useYjs` is an experimental, opt-in React hook that adds support for real-time collaborative editing, powered by the [Yjs](https://github.com/yjs/yjs) CRDT framework. This feature enables multiple peers to simultaneously edit the same content without having to manually resolve any conflicts.
-
-## Implementing a transport module
-
-`useYjs` is transport-agnostic, meaning that it does not care how peers communicate with each other. You will need to implement a compatible transport module that handles the communication between peers, and pass that into `` via the `settings.collab.transport` prop.
-
-In most cases, you would want some kind of WebSocket server or WebRTC signaling server, and implement a transport module to talk to that. However, you could also implement a transport module that only passes messages locally across browser tabs, which is what can be seen in the Storybook demo (run `yarn storybook` to try it).
-
-A `CollaborationTransport` will need to implement the following methods:
-
-- _connect_ `(options: CollaborationTransportConnectOpts) => Promise<{isFirstInChannel: boolean}>` - Join the group of peers, and return whether or not this is the first peer to join. Here you should also set up event handlers to call the provided callbacks whenever messages are received or peers change.
- - _options.user_ `object` - Information about the joined user that should be sent to every peer.
- - _options.onReceiveMessage_ `(message: object) => void` - Callback to be called whenever a message is received from a peer.
- - _options.setAvailablePeers_ `(peers: AvailablePeer[]) => void` - Callback to be called whenever a peer joins or leaves.
- - _options.channelId_ `[string]` - Identifies the group of peers.
-- _sendMessage_ `(message: object) => void` - Send message to peers. A message contains information about content or selection changes.
-- _disconnect_ `() => Promise` - Leave the group of peers. Called when `` unmounts.
\ No newline at end of file
diff --git a/build-module/components/block-editor-contents/use-yjs/algorithms/yjs.js b/build-module/components/block-editor-contents/use-yjs/algorithms/yjs.js
deleted file mode 100644
index ede53f2ee..000000000
--- a/build-module/components/block-editor-contents/use-yjs/algorithms/yjs.js
+++ /dev/null
@@ -1,231 +0,0 @@
-// @ts-nocheck TODO
-import * as yjs from 'yjs';
-import { isEqual } from 'lodash';
-/**
- * Returns information for splicing array `a` into array `b`,
- * by swapping the minimum slice of disagreement.
- *
- * @param {Array} a
- * @param {Array} b
- * @return {Object} diff.
- */
-
-function simpleDiff(a, b) {
- let left = 0;
- let right = 0;
-
- while (left < a.length && left < b.length && a[left] === b[left]) {
- left++;
- }
-
- if (left !== a.length || left !== b.length) {
- while (right + left < a.length && right + left < b.length && a[a.length - right - 1] === b[b.length - right - 1]) {
- right++;
- }
- }
-
- return {
- index: left,
- remove: a.length - left - right,
- insert: b.slice(left, b.length - right)
- };
-}
-/**
- * Updates the block doc with the local blocks block changes.
- *
- * @param {yjs.Map} yDocBlocks Blocks doc.
- * @param {Array} blocks Updated blocks.
- * @param {string} clientId Current clientId.
- */
-
-
-export function updateBlocksDoc(yDocBlocks, blocks, clientId = '') {
- if (!yDocBlocks.has('order')) {
- yDocBlocks.set('order', new yjs.Map());
- }
-
- let order = yDocBlocks.get('order');
- if (!order.has(clientId)) order.set(clientId, new yjs.Array());
- order = order.get(clientId);
-
- if (!yDocBlocks.has('byClientId')) {
- yDocBlocks.set('byClientId', new yjs.Map());
- }
-
- const byClientId = yDocBlocks.get('byClientId');
- const currentOrder = order.toArray();
- const orderDiff = simpleDiff(currentOrder, blocks.map(block => block.clientId));
- currentOrder.slice(orderDiff.index, orderDiff.remove).forEach(_clientId => !orderDiff.insert.includes(_clientId) && byClientId.delete(_clientId));
- order.delete(orderDiff.index, orderDiff.remove);
- order.insert(orderDiff.index, orderDiff.insert);
-
- for (const _block of blocks) {
- const {
- innerBlocks,
- ...block
- } = _block;
-
- if (!byClientId.has(block.clientId) || !isEqual(byClientId.get(block.clientId), block)) {
- byClientId.set(block.clientId, block);
- }
-
- updateBlocksDoc(yDocBlocks, innerBlocks, block.clientId);
- }
-}
-/**
- * Updates the comments doc with the local comments changes.
- *
- * @param {yjs.Doc} commentsDoc comments doc.
- * @param {Object} comments Updated comments.
- */
-
-export function updateCommentsDoc(commentsDoc, comments = []) {
- comments.forEach(comment => {
- let currentDoc = commentsDoc.get(comment._id);
- const isNewDoc = !currentDoc;
-
- if (!currentDoc) {
- commentsDoc.set(comment._id, new yjs.Map());
- }
-
- currentDoc = commentsDoc.get(comment._id); // Update regular fields
-
- ['type', 'content', 'createdAt', 'status', 'start', 'end', 'authorId', 'authorName'].forEach(field => {
- if (isNewDoc || currentDoc.get(field) !== comment[field]) {
- currentDoc.set(field, comment[field]);
- }
- });
-
- if (isNewDoc) {
- currentDoc.set('replies', new yjs.Map());
- }
-
- updateCommentRepliesDoc(currentDoc.get('replies'), comment.replies);
- });
-}
-/**
- * Updates the replies doc with the local replies changes.
- *
- * @param {yjs.Doc} repliesDoc replies doc.
- * @param {Object} replies Updated replies.
- */
-
-export function updateCommentRepliesDoc(repliesDoc, replies = []) {
- replies.forEach(reply => {
- let currentReplyDoc = repliesDoc.get(reply._id);
- const isNewDoc = !currentReplyDoc;
-
- if (!currentReplyDoc) {
- repliesDoc.set(reply._id, new yjs.Map());
- }
-
- currentReplyDoc = repliesDoc.get(reply._id);
- ['content', 'createdAt', 'authorId', 'authorName'].forEach(field => {
- if (isNewDoc || currentReplyDoc.get(field) !== reply[field]) {
- currentReplyDoc.set(field, reply[field]);
- }
- });
- });
-}
-/**
- * Updates the post doc with the local post changes.
- *
- * @param {yjs.Doc} doc Shared doc.
- * @param {Object} newPost Updated post.
- */
-
-export function updatePostDoc(doc, newPost) {
- const postDoc = doc.get('post', yjs.Map);
-
- if (postDoc.get('title') !== newPost.title) {
- postDoc.set('title', newPost.title);
- }
-
- if (!postDoc.get('blocks', yjs.Map)) {
- postDoc.set('blocks', new yjs.Map());
- }
-
- updateBlocksDoc(postDoc.get('blocks'), newPost.blocks || []);
-
- if (!postDoc.get('comments', yjs.Map)) {
- postDoc.set('comments', new yjs.Map());
- }
-
- updateCommentsDoc(postDoc.get('comments'), newPost.comments);
-}
-/**
- * Converts the comments doc into a comment list.
- *
- * @param {yjs.Map} commentsDoc Comments doc.
- * @return {Array} Comment list.
- */
-
-export function commentsDocToArray(commentsDoc) {
- if (!commentsDoc) {
- return [];
- }
-
- return Object.entries(commentsDoc.toJSON()).map(([id, commentDoc]) => {
- return {
- _id: id,
- type: commentDoc.type,
- content: commentDoc.content,
- createdAt: commentDoc.createdAt,
- status: commentDoc.status,
- start: commentDoc.start,
- end: commentDoc.end,
- authorId: commentDoc.authorId,
- authorName: commentDoc.authorName,
- replies: Object.entries(commentDoc.replies).map(([replyId, entryDoc]) => {
- return {
- _id: replyId,
- content: entryDoc.content,
- createdAt: entryDoc.createdAt,
- authorId: entryDoc.authorId,
- authorName: entryDoc.authorName
- };
- }).sort((a, b) => a.createdAt - b.createdAt)
- };
- });
-}
-/**
- * Converts the block doc into a block list.
- *
- * @param {yjs.Map} yDocBlocks Block doc.
- * @param {string} clientId Current block clientId.
- * @return {Array} Block list.
- */
-
-export function blocksDocToArray(yDocBlocks, clientId = '') {
- var _order$get;
-
- if (!yDocBlocks) {
- return [];
- }
-
- let order = yDocBlocks.get('order');
- order = (_order$get = order.get(clientId)) === null || _order$get === void 0 ? void 0 : _order$get.toArray();
- if (!order) return [];
- const byClientId = yDocBlocks.get('byClientId');
- return order.map(_clientId => ({ ...byClientId.get(_clientId),
- innerBlocks: blocksDocToArray(yDocBlocks, _clientId)
- }));
-}
-/**
- * Converts the post doc into a post object.
- *
- * @param {yjs.Map} doc Shared doc.
- * @return {Object} Post object.
- */
-
-export function postDocToObject(doc) {
- const postDoc = doc.get('post', yjs.Map);
- const blocks = blocksDocToArray(postDoc.get('blocks'));
- const comments = commentsDocToArray(postDoc.get('comments'));
- return {
- title: postDoc.get('title') || '',
- blocks,
- comments
- };
-}
-//# sourceMappingURL=yjs.js.map
\ No newline at end of file
diff --git a/build-module/components/block-editor-contents/use-yjs/algorithms/yjs.js.map b/build-module/components/block-editor-contents/use-yjs/algorithms/yjs.js.map
deleted file mode 100644
index 447662813..000000000
--- a/build-module/components/block-editor-contents/use-yjs/algorithms/yjs.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"sources":["../../../../../src/components/block-editor-contents/use-yjs/algorithms/yjs.js"],"names":["yjs","isEqual","simpleDiff","a","b","left","right","length","index","remove","insert","slice","updateBlocksDoc","yDocBlocks","blocks","clientId","has","set","Map","order","get","Array","byClientId","currentOrder","toArray","orderDiff","map","block","forEach","_clientId","includes","delete","_block","innerBlocks","updateCommentsDoc","commentsDoc","comments","comment","currentDoc","_id","isNewDoc","field","updateCommentRepliesDoc","replies","repliesDoc","reply","currentReplyDoc","updatePostDoc","doc","newPost","postDoc","title","commentsDocToArray","Object","entries","toJSON","id","commentDoc","type","content","createdAt","status","start","end","authorId","authorName","replyId","entryDoc","sort","blocksDocToArray","postDocToObject"],"mappings":"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","sourcesContent":["// @ts-nocheck TODO\n\nimport * as yjs from 'yjs';\nimport { isEqual } from 'lodash';\n\n/**\n * Returns information for splicing array `a` into array `b`,\n * by swapping the minimum slice of disagreement.\n *\n * @param {Array} a\n * @param {Array} b\n * @return {Object} diff.\n */\nfunction simpleDiff( a, b ) {\n\tlet left = 0;\n\tlet right = 0;\n\twhile ( left < a.length && left < b.length && a[ left ] === b[ left ] ) {\n\t\tleft++;\n\t}\n\tif ( left !== a.length || left !== b.length ) {\n\t\twhile (\n\t\t\tright + left < a.length &&\n\t\t\tright + left < b.length &&\n\t\t\ta[ a.length - right - 1 ] === b[ b.length - right - 1 ]\n\t\t) {\n\t\t\tright++;\n\t\t}\n\t}\n\treturn {\n\t\tindex: left,\n\t\tremove: a.length - left - right,\n\t\tinsert: b.slice( left, b.length - right ),\n\t};\n}\n\n/**\n * Updates the block doc with the local blocks block changes.\n *\n * @param {yjs.Map} yDocBlocks Blocks doc.\n * @param {Array} blocks Updated blocks.\n * @param {string} clientId Current clientId.\n */\nexport function updateBlocksDoc( yDocBlocks, blocks, clientId = '' ) {\n\tif ( ! yDocBlocks.has( 'order' ) ) {\n\t\tyDocBlocks.set( 'order', new yjs.Map() );\n\t}\n\tlet order = yDocBlocks.get( 'order' );\n\tif ( ! order.has( clientId ) ) order.set( clientId, new yjs.Array() );\n\torder = order.get( clientId );\n\tif ( ! yDocBlocks.has( 'byClientId' ) ) {\n\t\tyDocBlocks.set( 'byClientId', new yjs.Map() );\n\t}\n\tconst byClientId = yDocBlocks.get( 'byClientId' );\n\tconst currentOrder = order.toArray();\n\tconst orderDiff = simpleDiff(\n\t\tcurrentOrder,\n\t\tblocks.map( ( block ) => block.clientId )\n\t);\n\tcurrentOrder\n\t\t.slice( orderDiff.index, orderDiff.remove )\n\t\t.forEach(\n\t\t\t( _clientId ) =>\n\t\t\t\t! orderDiff.insert.includes( _clientId ) &&\n\t\t\t\tbyClientId.delete( _clientId )\n\t\t);\n\torder.delete( orderDiff.index, orderDiff.remove );\n\torder.insert( orderDiff.index, orderDiff.insert );\n\n\tfor ( const _block of blocks ) {\n\t\tconst { innerBlocks, ...block } = _block;\n\t\tif (\n\t\t\t! byClientId.has( block.clientId ) ||\n\t\t\t! isEqual( byClientId.get( block.clientId ), block )\n\t\t) {\n\t\t\tbyClientId.set( block.clientId, block );\n\t\t}\n\n\t\tupdateBlocksDoc( yDocBlocks, innerBlocks, block.clientId );\n\t}\n}\n\n/**\n * Updates the comments doc with the local comments changes.\n *\n * @param {yjs.Doc} commentsDoc comments doc.\n * @param {Object} comments Updated comments.\n */\nexport function updateCommentsDoc( commentsDoc, comments = [] ) {\n\tcomments.forEach( ( comment ) => {\n\t\tlet currentDoc = commentsDoc.get( comment._id );\n\t\tconst isNewDoc = ! currentDoc;\n\t\tif ( ! currentDoc ) {\n\t\t\tcommentsDoc.set( comment._id, new yjs.Map() );\n\t\t}\n\t\tcurrentDoc = commentsDoc.get( comment._id );\n\t\t// Update regular fields\n\t\t[\n\t\t\t'type',\n\t\t\t'content',\n\t\t\t'createdAt',\n\t\t\t'status',\n\t\t\t'start',\n\t\t\t'end',\n\t\t\t'authorId',\n\t\t\t'authorName',\n\t\t].forEach( ( field ) => {\n\t\t\tif ( isNewDoc || currentDoc.get( field ) !== comment[ field ] ) {\n\t\t\t\tcurrentDoc.set( field, comment[ field ] );\n\t\t\t}\n\t\t} );\n\n\t\tif ( isNewDoc ) {\n\t\t\tcurrentDoc.set( 'replies', new yjs.Map() );\n\t\t}\n\n\t\tupdateCommentRepliesDoc( currentDoc.get( 'replies' ), comment.replies );\n\t} );\n}\n\n/**\n * Updates the replies doc with the local replies changes.\n *\n * @param {yjs.Doc} repliesDoc replies doc.\n * @param {Object} replies Updated replies.\n */\nexport function updateCommentRepliesDoc( repliesDoc, replies = [] ) {\n\treplies.forEach( ( reply ) => {\n\t\tlet currentReplyDoc = repliesDoc.get( reply._id );\n\t\tconst isNewDoc = ! currentReplyDoc;\n\t\tif ( ! currentReplyDoc ) {\n\t\t\trepliesDoc.set( reply._id, new yjs.Map() );\n\t\t}\n\t\tcurrentReplyDoc = repliesDoc.get( reply._id );\n\t\t[ 'content', 'createdAt', 'authorId', 'authorName' ].forEach(\n\t\t\t( field ) => {\n\t\t\t\tif (\n\t\t\t\t\tisNewDoc ||\n\t\t\t\t\tcurrentReplyDoc.get( field ) !== reply[ field ]\n\t\t\t\t) {\n\t\t\t\t\tcurrentReplyDoc.set( field, reply[ field ] );\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t} );\n}\n\n/**\n * Updates the post doc with the local post changes.\n *\n * @param {yjs.Doc} doc Shared doc.\n * @param {Object} newPost Updated post.\n */\nexport function updatePostDoc( doc, newPost ) {\n\tconst postDoc = doc.get( 'post', yjs.Map );\n\tif ( postDoc.get( 'title' ) !== newPost.title ) {\n\t\tpostDoc.set( 'title', newPost.title );\n\t}\n\tif ( ! postDoc.get( 'blocks', yjs.Map ) ) {\n\t\tpostDoc.set( 'blocks', new yjs.Map() );\n\t}\n\tupdateBlocksDoc( postDoc.get( 'blocks' ), newPost.blocks || [] );\n\tif ( ! postDoc.get( 'comments', yjs.Map ) ) {\n\t\tpostDoc.set( 'comments', new yjs.Map() );\n\t}\n\tupdateCommentsDoc( postDoc.get( 'comments' ), newPost.comments );\n}\n\n/**\n * Converts the comments doc into a comment list.\n *\n * @param {yjs.Map} commentsDoc Comments doc.\n * @return {Array} Comment list.\n */\nexport function commentsDocToArray( commentsDoc ) {\n\tif ( ! commentsDoc ) {\n\t\treturn [];\n\t}\n\n\treturn Object.entries( commentsDoc.toJSON() ).map(\n\t\t( [ id, commentDoc ] ) => {\n\t\t\treturn {\n\t\t\t\t_id: id,\n\t\t\t\ttype: commentDoc.type,\n\t\t\t\tcontent: commentDoc.content,\n\t\t\t\tcreatedAt: commentDoc.createdAt,\n\t\t\t\tstatus: commentDoc.status,\n\t\t\t\tstart: commentDoc.start,\n\t\t\t\tend: commentDoc.end,\n\t\t\t\tauthorId: commentDoc.authorId,\n\t\t\t\tauthorName: commentDoc.authorName,\n\t\t\t\treplies: Object.entries( commentDoc.replies )\n\t\t\t\t\t.map( ( [ replyId, entryDoc ] ) => {\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t_id: replyId,\n\t\t\t\t\t\t\tcontent: entryDoc.content,\n\t\t\t\t\t\t\tcreatedAt: entryDoc.createdAt,\n\t\t\t\t\t\t\tauthorId: entryDoc.authorId,\n\t\t\t\t\t\t\tauthorName: entryDoc.authorName,\n\t\t\t\t\t\t};\n\t\t\t\t\t} )\n\t\t\t\t\t.sort( ( a, b ) => a.createdAt - b.createdAt ),\n\t\t\t};\n\t\t}\n\t);\n}\n\n/**\n * Converts the block doc into a block list.\n *\n * @param {yjs.Map} yDocBlocks Block doc.\n * @param {string} clientId Current block clientId.\n * @return {Array} Block list.\n */\nexport function blocksDocToArray( yDocBlocks, clientId = '' ) {\n\tif ( ! yDocBlocks ) {\n\t\treturn [];\n\t}\n\tlet order = yDocBlocks.get( 'order' );\n\torder = order.get( clientId )?.toArray();\n\tif ( ! order ) return [];\n\tconst byClientId = yDocBlocks.get( 'byClientId' );\n\n\treturn order.map( ( _clientId ) => ( {\n\t\t...byClientId.get( _clientId ),\n\t\tinnerBlocks: blocksDocToArray( yDocBlocks, _clientId ),\n\t} ) );\n}\n\n/**\n * Converts the post doc into a post object.\n *\n * @param {yjs.Map} doc Shared doc.\n * @return {Object} Post object.\n */\nexport function postDocToObject( doc ) {\n\tconst postDoc = doc.get( 'post', yjs.Map );\n\tconst blocks = blocksDocToArray( postDoc.get( 'blocks' ) );\n\tconst comments = commentsDocToArray( postDoc.get( 'comments' ) );\n\n\treturn {\n\t\ttitle: postDoc.get( 'title' ) || '',\n\t\tblocks,\n\t\tcomments,\n\t};\n}\n"],"file":"yjs.js"}
\ No newline at end of file
diff --git a/build-module/components/block-editor-contents/use-yjs/filters/block-selection/index.js b/build-module/components/block-editor-contents/use-yjs/filters/block-selection/index.js
deleted file mode 100644
index d1ba30f74..000000000
--- a/build-module/components/block-editor-contents/use-yjs/filters/block-selection/index.js
+++ /dev/null
@@ -1,36 +0,0 @@
-import _extends from "@babel/runtime/helpers/extends";
-import { createElement } from "@wordpress/element";
-
-/**
- * WordPress dependencies
- */
-import { addFilter } from '@wordpress/hooks';
-import { useSelect } from '@wordpress/data';
-import './style.scss';
-/**
- * Adds peer selected className to the block-list-block component.
- *
- * @param {Object} OriginalComponent The original BlockListBlock component.
- * @return {Object} The enhanced component.
- */
-
-const addSelectionBorders = OriginalComponent => {
- return props => {
- const isSelected = useSelect(select => {
- const peers = select('isolated/editor').getPeers();
- return Object.values(peers).some(peer => {
- var _peer$start, _peer$end;
-
- return ((_peer$start = peer.start) === null || _peer$start === void 0 ? void 0 : _peer$start.clientId) === props.clientId && ((_peer$end = peer.end) === null || _peer$end === void 0 ? void 0 : _peer$end.clientId) === props.clientId;
- });
- }, [props.clientId]);
- return createElement(OriginalComponent, _extends({}, props, {
- className: isSelected ? 'is-iso-editor-collab-peer-selected' : undefined
- }));
- };
-};
-
-export const addFilterCollabBlockSelection = () => {
- addFilter('editor.BlockListBlock', 'isolated-block-editor', addSelectionBorders);
-};
-//# sourceMappingURL=index.js.map
\ No newline at end of file
diff --git a/build-module/components/block-editor-contents/use-yjs/filters/block-selection/index.js.map b/build-module/components/block-editor-contents/use-yjs/filters/block-selection/index.js.map
deleted file mode 100644
index f1a9bc3d2..000000000
--- a/build-module/components/block-editor-contents/use-yjs/filters/block-selection/index.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"sources":["../../../../../../src/components/block-editor-contents/use-yjs/filters/block-selection/index.js"],"names":["addFilter","useSelect","addSelectionBorders","OriginalComponent","props","isSelected","select","peers","getPeers","Object","values","some","peer","start","clientId","end","undefined","addFilterCollabBlockSelection"],"mappings":";;;AAAA;AACA;AACA;AACA,SAASA,SAAT,QAA0B,kBAA1B;AACA,SAASC,SAAT,QAA0B,iBAA1B;AAEA,OAAO,cAAP;AAEA;AACA;AACA;AACA;AACA;AACA;;AACA,MAAMC,mBAAmB,GAAKC,iBAAF,IAAyB;AACpD,SAASC,KAAF,IAAa;AACnB,UAAMC,UAAU,GAAGJ,SAAS,CACzBK,MAAF,IAAc;AACb,YAAMC,KAAK,GAAGD,MAAM,CAAE,iBAAF,CAAN,CAA4BE,QAA5B,EAAd;AACA,aAAOC,MAAM,CAACC,MAAP,CAAeH,KAAf,EAAuBI,IAAvB,CACJC,IAAF;AAAA;;AAAA,eAAY,gBAAAA,IAAI,CAACC,KAAL,4DAAYC,QAAZ,MAAyBV,KAAK,CAACU,QAA/B,IAA2C,cAAAF,IAAI,CAACG,GAAL,wDAAUD,QAAV,MAAuBV,KAAK,CAACU,QAApF;AAAA,OADM,CAAP;AAGA,KAN0B,EAO3B,CAAEV,KAAK,CAACU,QAAR,CAP2B,CAA5B;AASA,WACC,cAAC,iBAAD,eACMV,KADN;AAEC,MAAA,SAAS,EAAGC,UAAU,GAAG,oCAAH,GAA0CW;AAFjE,OADD;AAMA,GAhBD;AAiBA,CAlBD;;AAoBA,OAAO,MAAMC,6BAA6B,GAAG,MAAM;AAClDjB,EAAAA,SAAS,CAAE,uBAAF,EAA2B,uBAA3B,EAAoDE,mBAApD,CAAT;AACA,CAFM","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { addFilter } from '@wordpress/hooks';\nimport { useSelect } from '@wordpress/data';\n\nimport './style.scss';\n\n/**\n * Adds peer selected className to the block-list-block component.\n *\n * @param {Object} OriginalComponent The original BlockListBlock component.\n * @return {Object} The enhanced component.\n */\nconst addSelectionBorders = ( OriginalComponent ) => {\n\treturn ( props ) => {\n\t\tconst isSelected = useSelect(\n\t\t\t( select ) => {\n\t\t\t\tconst peers = select( 'isolated/editor' ).getPeers();\n\t\t\t\treturn Object.values( peers ).some(\n\t\t\t\t\t( peer ) => peer.start?.clientId === props.clientId && peer.end?.clientId === props.clientId\n\t\t\t\t);\n\t\t\t},\n\t\t\t[ props.clientId ]\n\t\t);\n\t\treturn (\n\t\t\t \n\t\t);\n\t};\n};\n\nexport const addFilterCollabBlockSelection = () => {\n\taddFilter( 'editor.BlockListBlock', 'isolated-block-editor', addSelectionBorders );\n};\n"],"file":"index.js"}
\ No newline at end of file
diff --git a/build-module/components/block-editor-contents/use-yjs/filters/block-selection/style.scss b/build-module/components/block-editor-contents/use-yjs/filters/block-selection/style.scss
deleted file mode 100644
index fcac6cfc9..000000000
--- a/build-module/components/block-editor-contents/use-yjs/filters/block-selection/style.scss
+++ /dev/null
@@ -1,3 +0,0 @@
-.wp-block.is-iso-editor-collab-peer-selected {
- outline: 1px dashed currentColor;
-}
diff --git a/build-module/components/block-editor-contents/use-yjs/filters/index.js b/build-module/components/block-editor-contents/use-yjs/filters/index.js
deleted file mode 100644
index 5858432d7..000000000
--- a/build-module/components/block-editor-contents/use-yjs/filters/index.js
+++ /dev/null
@@ -1,5 +0,0 @@
-import { addFilterCollabBlockSelection } from './block-selection';
-export const addCollabFilters = () => {
- addFilterCollabBlockSelection();
-};
-//# sourceMappingURL=index.js.map
\ No newline at end of file
diff --git a/build-module/components/block-editor-contents/use-yjs/filters/index.js.map b/build-module/components/block-editor-contents/use-yjs/filters/index.js.map
deleted file mode 100644
index 4e0f9e2b7..000000000
--- a/build-module/components/block-editor-contents/use-yjs/filters/index.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"sources":["../../../../../src/components/block-editor-contents/use-yjs/filters/index.js"],"names":["addFilterCollabBlockSelection","addCollabFilters"],"mappings":"AAAA,SAASA,6BAAT,QAA8C,mBAA9C;AAEA,OAAO,MAAMC,gBAAgB,GAAG,MAAM;AACrCD,EAAAA,6BAA6B;AAC7B,CAFM","sourcesContent":["import { addFilterCollabBlockSelection } from './block-selection';\n\nexport const addCollabFilters = () => {\n\taddFilterCollabBlockSelection();\n};\n"],"file":"index.js"}
\ No newline at end of file
diff --git a/build-module/components/block-editor-contents/use-yjs/formats/collab-caret/index.js b/build-module/components/block-editor-contents/use-yjs/formats/collab-caret/index.js
deleted file mode 100644
index 8e8cf726b..000000000
--- a/build-module/components/block-editor-contents/use-yjs/formats/collab-caret/index.js
+++ /dev/null
@@ -1,116 +0,0 @@
-/**
- * External dependencies
- */
-import memoize from 'memize';
-import classnames from 'classnames';
-/**
- * WordPress dependencies
- */
-
-import { applyFormat, registerFormatType } from '@wordpress/rich-text';
-/**
- * Internal dependencies
- */
-
-import './style.scss';
-const FORMAT_NAME = 'isolated/collab-caret';
-/**
- * Applies given carets to the given record.
- *
- * @param {Object} record The record to apply carets to.
- * @param {Array} carets The carets to apply.
- * @return {Object} A record with the carets applied.
- */
-
-export function applyCarets(record, carets = []) {
- carets.forEach(caret => {
- let {
- start,
- end,
- id,
- color,
- label
- } = caret;
- const isCollapsed = start === end;
- const isShifted = isCollapsed && end >= record.text.length;
-
- if (isShifted) {
- start = record.text.length - 1;
- }
-
- if (isCollapsed) {
- end = start + 1;
- }
-
- record = applyFormat(record, {
- type: FORMAT_NAME,
- attributes: {
- id: 'iso-editor-collab-caret-' + id,
- class: classnames({
- 'is-collapsed': isCollapsed,
- 'is-shifted': isShifted
- }),
- title: label,
- style: `--iso-editor-collab-caret-color: ${color || '#2e3d48'}`
- }
- }, start, end);
- });
- return record;
-}
-const getCarets = memoize((peers, richTextIdentifier, blockClientId) => {
- return Object.entries(peers).filter(([, peer]) => {
- var _peer$start, _peer$end;
-
- return (peer === null || peer === void 0 ? void 0 : (_peer$start = peer.start) === null || _peer$start === void 0 ? void 0 : _peer$start.clientId) === blockClientId && (peer === null || peer === void 0 ? void 0 : (_peer$end = peer.end) === null || _peer$end === void 0 ? void 0 : _peer$end.clientId) === blockClientId && peer.start.attributeKey === richTextIdentifier;
- }).map(([id, peer]) => ({
- id,
- label: peer.name,
- start: peer.start.offset,
- end: peer.end.offset,
- color: peer.color
- }));
-});
-export const settings = {
- title: 'Collaboration peer caret',
- tagName: 'mark',
- className: 'iso-editor-collab-caret',
- attributes: {
- id: 'id',
- className: 'class'
- },
-
- edit() {
- return null;
- },
-
- __experimentalGetPropsForEditableTreePreparation(select, {
- richTextIdentifier,
- blockClientId
- }) {
- return {
- carets: getCarets(select('isolated/editor').getPeers(), richTextIdentifier, blockClientId)
- };
- },
-
- __experimentalCreatePrepareEditableTree({
- carets
- }) {
- return (formats, text) => {
- if (!(carets !== null && carets !== void 0 && carets.length)) {
- return formats;
- }
-
- let record = {
- formats,
- text
- };
- record = applyCarets(record, carets);
- return record.formats;
- };
- }
-
-};
-export const registerFormatCollabCaret = () => {
- registerFormatType(FORMAT_NAME, settings);
-};
-//# sourceMappingURL=index.js.map
\ No newline at end of file
diff --git a/build-module/components/block-editor-contents/use-yjs/formats/collab-caret/index.js.map b/build-module/components/block-editor-contents/use-yjs/formats/collab-caret/index.js.map
deleted file mode 100644
index 69b9e9502..000000000
--- a/build-module/components/block-editor-contents/use-yjs/formats/collab-caret/index.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"sources":["../../../../../../src/components/block-editor-contents/use-yjs/formats/collab-caret/index.js"],"names":["memoize","classnames","applyFormat","registerFormatType","FORMAT_NAME","applyCarets","record","carets","forEach","caret","start","end","id","color","label","isCollapsed","isShifted","text","length","type","attributes","class","title","style","getCarets","peers","richTextIdentifier","blockClientId","Object","entries","filter","peer","clientId","attributeKey","map","name","offset","settings","tagName","className","edit","__experimentalGetPropsForEditableTreePreparation","select","getPeers","__experimentalCreatePrepareEditableTree","formats","registerFormatCollabCaret"],"mappings":"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","sourcesContent":["/**\n * External dependencies\n */\nimport memoize from 'memize';\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { applyFormat, registerFormatType } from '@wordpress/rich-text';\n\n/**\n * Internal dependencies\n */\nimport './style.scss';\n\nconst FORMAT_NAME = 'isolated/collab-caret';\n\n/**\n * Applies given carets to the given record.\n *\n * @param {Object} record The record to apply carets to.\n * @param {Array} carets The carets to apply.\n * @return {Object} A record with the carets applied.\n */\nexport function applyCarets( record, carets = [] ) {\n\tcarets.forEach( ( caret ) => {\n\t\tlet { start, end, id, color, label } = caret;\n\t\tconst isCollapsed = start === end;\n\t\tconst isShifted = isCollapsed && end >= record.text.length;\n\n\t\tif ( isShifted ) {\n\t\t\tstart = record.text.length - 1;\n\t\t}\n\n\t\tif ( isCollapsed ) {\n\t\t\tend = start + 1;\n\t\t}\n\n\t\trecord = applyFormat(\n\t\t\trecord,\n\t\t\t{\n\t\t\t\ttype: FORMAT_NAME,\n\t\t\t\tattributes: {\n\t\t\t\t\tid: 'iso-editor-collab-caret-' + id,\n\t\t\t\t\tclass: classnames( {\n\t\t\t\t\t\t'is-collapsed': isCollapsed,\n\t\t\t\t\t\t'is-shifted': isShifted,\n\t\t\t\t\t} ),\n\t\t\t\t\ttitle: label,\n\t\t\t\t\tstyle: `--iso-editor-collab-caret-color: ${ color || '#2e3d48' }`,\n\t\t\t\t},\n\t\t\t},\n\t\t\tstart,\n\t\t\tend\n\t\t);\n\t} );\n\n\treturn record;\n}\n\nconst getCarets = memoize( ( peers, richTextIdentifier, blockClientId ) => {\n\treturn Object.entries( peers )\n\t\t.filter( ( [ , peer ] ) => {\n\t\t\treturn (\n\t\t\t\tpeer?.start?.clientId === blockClientId &&\n\t\t\t\tpeer?.end?.clientId === blockClientId &&\n\t\t\t\tpeer.start.attributeKey === richTextIdentifier\n\t\t\t);\n\t\t} )\n\t\t.map( ( [ id, peer ] ) => ( {\n\t\t\tid,\n\t\t\tlabel: peer.name,\n\t\t\tstart: peer.start.offset,\n\t\t\tend: peer.end.offset,\n\t\t\tcolor: peer.color,\n\t\t} ) );\n} );\n\nexport const settings = {\n\ttitle: 'Collaboration peer caret',\n\ttagName: 'mark',\n\tclassName: 'iso-editor-collab-caret',\n\tattributes: {\n\t\tid: 'id',\n\t\tclassName: 'class',\n\t},\n\tedit() {\n\t\treturn null;\n\t},\n\t__experimentalGetPropsForEditableTreePreparation( select, { richTextIdentifier, blockClientId } ) {\n\t\treturn {\n\t\t\tcarets: getCarets( select( 'isolated/editor' ).getPeers(), richTextIdentifier, blockClientId ),\n\t\t};\n\t},\n\t__experimentalCreatePrepareEditableTree( { carets } ) {\n\t\treturn ( formats, text ) => {\n\t\t\tif ( ! carets?.length ) {\n\t\t\t\treturn formats;\n\t\t\t}\n\n\t\t\tlet record = { formats, text };\n\t\t\trecord = applyCarets( record, carets );\n\t\t\treturn record.formats;\n\t\t};\n\t},\n};\n\nexport const registerFormatCollabCaret = () => {\n\tregisterFormatType( FORMAT_NAME, settings );\n};\n"],"file":"index.js"}
\ No newline at end of file
diff --git a/build-module/components/block-editor-contents/use-yjs/formats/collab-caret/style.scss b/build-module/components/block-editor-contents/use-yjs/formats/collab-caret/style.scss
deleted file mode 100644
index 5969efcfa..000000000
--- a/build-module/components/block-editor-contents/use-yjs/formats/collab-caret/style.scss
+++ /dev/null
@@ -1,48 +0,0 @@
-mark.iso-editor-collab-caret {
- position: relative;
- background: #eee;
- color: currentColor;
-}
-
-mark.iso-editor-collab-caret.is-collapsed {
- background: none;
-}
-
-mark.iso-editor-collab-caret::before {
- left: -1px;
- top: 0;
- bottom: 0;
- position: absolute;
- content: '';
- font-size: 1em;
- width: 2px;
- background: var( --iso-editor-collab-caret-color );
-}
-
-mark.iso-editor-collab-caret.is-shifted::before {
- left: auto;
- right: -1px;
-}
-
-mark.iso-editor-collab-caret::after {
- position: absolute;
- top: -14px;
- right: -4px;
- overflow: hidden;
- min-width: 8px;
- max-width: 140px;
- text-overflow: ellipsis;
- min-height: 8px;
- padding: 2px 4px 3px;
- content: attr( title ); // identity
- color: white;
- vertical-align: top;
- font-size: 10px;
- line-height: 1;
- white-space: nowrap;
- background: var( --iso-editor-collab-caret-color );
-
- // Ensure that bold/italic isn't inherited from the editor selection
- font-style: normal;
- font-weight: normal;
-}
diff --git a/build-module/components/block-editor-contents/use-yjs/formats/index.js b/build-module/components/block-editor-contents/use-yjs/formats/index.js
deleted file mode 100644
index d345ffdf1..000000000
--- a/build-module/components/block-editor-contents/use-yjs/formats/index.js
+++ /dev/null
@@ -1,5 +0,0 @@
-import { registerFormatCollabCaret } from './collab-caret';
-export const registerCollabFormats = () => {
- registerFormatCollabCaret();
-};
-//# sourceMappingURL=index.js.map
\ No newline at end of file
diff --git a/build-module/components/block-editor-contents/use-yjs/formats/index.js.map b/build-module/components/block-editor-contents/use-yjs/formats/index.js.map
deleted file mode 100644
index 33157459a..000000000
--- a/build-module/components/block-editor-contents/use-yjs/formats/index.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"sources":["../../../../../src/components/block-editor-contents/use-yjs/formats/index.js"],"names":["registerFormatCollabCaret","registerCollabFormats"],"mappings":"AAAA,SAASA,yBAAT,QAA0C,gBAA1C;AAEA,OAAO,MAAMC,qBAAqB,GAAG,MAAM;AAC1CD,EAAAA,yBAAyB;AACzB,CAFM","sourcesContent":["import { registerFormatCollabCaret } from './collab-caret';\n\nexport const registerCollabFormats = () => {\n\tregisterFormatCollabCaret();\n};\n"],"file":"index.js"}
\ No newline at end of file
diff --git a/build-module/components/block-editor-contents/use-yjs/index.js b/build-module/components/block-editor-contents/use-yjs/index.js
deleted file mode 100644
index a9a0599ae..000000000
--- a/build-module/components/block-editor-contents/use-yjs/index.js
+++ /dev/null
@@ -1,235 +0,0 @@
-/**
- * External dependencies
- */
-import { v4 as uuidv4 } from 'uuid';
-import { noop, sample } from 'lodash';
-import { createDocument } from './yjs-doc';
-import { postDocToObject, updatePostDoc } from './algorithms/yjs';
-/**
- * WordPress dependencies
- */
-
-import { useDispatch, useSelect } from '@wordpress/data';
-import { useEffect, useRef } from '@wordpress/element';
-/**
- * Internal dependencies
- */
-
-import { addCollabFilters } from './filters';
-import { registerCollabFormats } from './formats';
-
-const debug = require('debug')('iso-editor:collab');
-/** @typedef {import('../../..').CollaborationSettings} CollaborationSettings */
-
-/** @typedef {import('../../..').CollaborationTransport} CollaborationTransport */
-
-/** @typedef {import('../../..').CollaborationTransportDocMessage} CollaborationTransportDocMessage */
-
-/** @typedef {import('../../..').CollaborationTransportSelectionMessage} CollaborationTransportSelectionMessage */
-
-/** @typedef {import('../../..').EditorSelection} EditorSelection */
-
-/** @typedef {import('..').OnUpdate} OnUpdate */
-
-
-const defaultColors = ['#4676C0', '#6F6EBE', '#9063B6', '#C3498D', '#9E6D14', '#3B4856', '#4A807A'];
-/**
- * @param {object} opts - Hook options
- * @param {() => object[]} opts.getBlocks - Content to initialize the Yjs doc with.
- * @param {OnUpdate} opts.onRemoteDataChange - Function to update editor blocks in redux state.
- * @param {CollaborationSettings} opts.settings
- * @param {() => IsoEditorSelection} opts.getSelection
- * @param {import('../../../store/peers/actions').setAvailablePeers} opts.setAvailablePeers
- * @param {import('../../../store/peers/actions').setPeerSelection} opts.setPeerSelection
- *
- * @typedef IsoEditorSelection
- * @property {object} selectionStart
- * @property {object} selectionEnd
- */
-
-async function initYDoc({
- getBlocks,
- onRemoteDataChange,
- settings,
- getSelection,
- setPeerSelection,
- setAvailablePeers
-}) {
- const {
- channelId,
- transport
- } = settings;
- /** @type string */
-
- const identity = uuidv4();
- debug(`initYDoc (identity: ${identity})`);
- const doc = createDocument({
- identity,
- applyDataChanges: updatePostDoc,
- getData: postDocToObject,
-
- /** @param {object} message */
- sendMessage: message => {
- debug('sendDocMessage', message);
- transport.sendMessage({
- type: 'doc',
- identity,
- message
- });
- const {
- selectionStart,
- selectionEnd
- } = getSelection() || {};
- debug('sendSelection', selectionStart, selectionEnd);
- transport.sendMessage({
- type: 'selection',
- identity,
- selection: {
- start: selectionStart,
- end: selectionEnd
- }
- });
- }
- });
- /** @param {CollaborationTransportDocMessage|CollaborationTransportSelectionMessage} data */
-
- const onReceiveMessage = data => {
- debug('remote change received by transport', data);
-
- switch (data.type) {
- case 'doc':
- {
- doc.receiveMessage(data.message);
- break;
- }
-
- case 'selection':
- {
- setPeerSelection(data.identity, data.selection);
- break;
- }
- }
- };
-
- doc.onRemoteDataChange(changes => {
- debug('remote change received by ydoc', changes);
- onRemoteDataChange(changes.blocks);
- });
- return transport.connect({
- user: {
- identity,
- name: settings.username,
- color: settings.caretColor || sample(defaultColors)
- },
- onReceiveMessage,
- setAvailablePeers: peers => {
- debug('setAvailablePeers', peers);
- setAvailablePeers(peers);
- },
- channelId
- }).then(({
- isFirstInChannel
- }) => {
- debug(`connected (channelId: ${channelId})`);
-
- if (isFirstInChannel) {
- debug('first in channel'); // Fetching the blocks from redux now, after the transport has successfully connected,
- // ensures that we don't initialize the Yjs doc with stale blocks.
- // (This can happen if is given an onLoad handler.)
-
- doc.startSharing({
- title: '',
- blocks: getBlocks()
- });
- } else {
- doc.connect();
- }
-
- const disconnect = () => {
- transport.disconnect();
- doc.disconnect();
- };
-
- window.addEventListener('beforeunload', () => disconnect());
- return {
- doc,
- disconnect
- };
- });
-}
-/**
- * @param {object} opts - Hook options
- * @param {object[]} opts.blocks
- * @param {OnUpdate} opts.onRemoteDataChange
- * @param {CollaborationSettings} [opts.settings]
- */
-
-
-export default function useYjs({
- blocks,
- onRemoteDataChange,
- settings
-}) {
- const applyChangesToYjs = useRef(noop);
- const {
- getBlocks,
- getSelection
- } = useSelect(select => {
- return {
- getSelection: select('isolated/editor').getEditorSelection,
- getBlocks: select('isolated/editor').getBlocks
- };
- }, []);
- const {
- setAvailablePeers,
- setPeerSelection
- } = useDispatch('isolated/editor');
- useEffect(() => {
- if (!(settings !== null && settings !== void 0 && settings.enabled)) {
- return;
- }
-
- if (!settings.transport) {
- console.error(`Collaborative editor is disabled because a transport module wasn't provided.`);
- return;
- }
-
- debug('registered collab formats');
- registerCollabFormats();
- debug('added collab filters');
- addCollabFilters();
- let onUnmount = noop;
- initYDoc({
- onRemoteDataChange,
- settings,
- getBlocks,
- getSelection,
- setPeerSelection,
- setAvailablePeers
- }).then(({
- doc,
- disconnect
- }) => {
- onUnmount = () => {
- debug('unmount');
- disconnect();
- };
-
- applyChangesToYjs.current = blocks => {
- if (doc.getState() !== 'on') {
- return;
- }
-
- debug('local changes applied to ydoc');
- doc.applyDataChanges({
- blocks
- });
- };
- });
- return () => onUnmount();
- }, []);
- useEffect(() => {
- applyChangesToYjs.current(blocks);
- }, [blocks]);
-}
-//# sourceMappingURL=index.js.map
\ No newline at end of file
diff --git a/build-module/components/block-editor-contents/use-yjs/index.js.map b/build-module/components/block-editor-contents/use-yjs/index.js.map
deleted file mode 100644
index 53383d586..000000000
--- a/build-module/components/block-editor-contents/use-yjs/index.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"sources":["../../../../src/components/block-editor-contents/use-yjs/index.js"],"names":["v4","uuidv4","noop","sample","createDocument","postDocToObject","updatePostDoc","useDispatch","useSelect","useEffect","useRef","addCollabFilters","registerCollabFormats","debug","require","defaultColors","initYDoc","getBlocks","onRemoteDataChange","settings","getSelection","setPeerSelection","setAvailablePeers","channelId","transport","identity","doc","applyDataChanges","getData","sendMessage","message","type","selectionStart","selectionEnd","selection","start","end","onReceiveMessage","data","receiveMessage","changes","blocks","connect","user","name","username","color","caretColor","peers","then","isFirstInChannel","startSharing","title","disconnect","window","addEventListener","useYjs","applyChangesToYjs","select","getEditorSelection","enabled","console","error","onUnmount","current","getState"],"mappings":"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","sourcesContent":["/**\n * External dependencies\n */\nimport { v4 as uuidv4 } from 'uuid';\nimport { noop, sample } from 'lodash';\nimport { createDocument } from './yjs-doc';\nimport { postDocToObject, updatePostDoc } from './algorithms/yjs';\n\n/**\n * WordPress dependencies\n */\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { useEffect, useRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { addCollabFilters } from './filters';\nimport { registerCollabFormats } from './formats';\n\nconst debug = require( 'debug' )( 'iso-editor:collab' );\n\n/** @typedef {import('../../..').CollaborationSettings} CollaborationSettings */\n/** @typedef {import('../../..').CollaborationTransport} CollaborationTransport */\n/** @typedef {import('../../..').CollaborationTransportDocMessage} CollaborationTransportDocMessage */\n/** @typedef {import('../../..').CollaborationTransportSelectionMessage} CollaborationTransportSelectionMessage */\n/** @typedef {import('../../..').EditorSelection} EditorSelection */\n/** @typedef {import('..').OnUpdate} OnUpdate */\n\nconst defaultColors = [ '#4676C0', '#6F6EBE', '#9063B6', '#C3498D', '#9E6D14', '#3B4856', '#4A807A' ];\n\n/**\n * @param {object} opts - Hook options\n * @param {() => object[]} opts.getBlocks - Content to initialize the Yjs doc with.\n * @param {OnUpdate} opts.onRemoteDataChange - Function to update editor blocks in redux state.\n * @param {CollaborationSettings} opts.settings\n * @param {() => IsoEditorSelection} opts.getSelection\n * @param {import('../../../store/peers/actions').setAvailablePeers} opts.setAvailablePeers\n * @param {import('../../../store/peers/actions').setPeerSelection} opts.setPeerSelection\n *\n * @typedef IsoEditorSelection\n * @property {object} selectionStart\n * @property {object} selectionEnd\n */\nasync function initYDoc( {\n\tgetBlocks,\n\tonRemoteDataChange,\n\tsettings,\n\tgetSelection,\n\tsetPeerSelection,\n\tsetAvailablePeers,\n} ) {\n\tconst { channelId, transport } = settings;\n\n\t/** @type string */\n\tconst identity = uuidv4();\n\n\tdebug( `initYDoc (identity: ${ identity })` );\n\n\tconst doc = createDocument( {\n\t\tidentity,\n\t\tapplyDataChanges: updatePostDoc,\n\t\tgetData: postDocToObject,\n\t\t/** @param {object} message */\n\t\tsendMessage: ( message ) => {\n\t\t\tdebug( 'sendDocMessage', message );\n\t\t\ttransport.sendMessage( { type: 'doc', identity, message } );\n\n\t\t\tconst { selectionStart, selectionEnd } = getSelection() || {};\n\t\t\tdebug( 'sendSelection', selectionStart, selectionEnd );\n\t\t\ttransport.sendMessage( {\n\t\t\t\ttype: 'selection',\n\t\t\t\tidentity,\n\t\t\t\tselection: {\n\t\t\t\t\tstart: selectionStart,\n\t\t\t\t\tend: selectionEnd,\n\t\t\t\t},\n\t\t\t} );\n\t\t},\n\t} );\n\n\t/** @param {CollaborationTransportDocMessage|CollaborationTransportSelectionMessage} data */\n\tconst onReceiveMessage = ( data ) => {\n\t\tdebug( 'remote change received by transport', data );\n\n\t\tswitch ( data.type ) {\n\t\t\tcase 'doc': {\n\t\t\t\tdoc.receiveMessage( data.message );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase 'selection': {\n\t\t\t\tsetPeerSelection( data.identity, data.selection );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t};\n\n\tdoc.onRemoteDataChange( ( changes ) => {\n\t\tdebug( 'remote change received by ydoc', changes );\n\t\tonRemoteDataChange( changes.blocks );\n\t} );\n\n\treturn transport\n\t\t.connect( {\n\t\t\tuser: {\n\t\t\t\tidentity,\n\t\t\t\tname: settings.username,\n\t\t\t\tcolor: settings.caretColor || sample( defaultColors ),\n\t\t\t},\n\t\t\tonReceiveMessage,\n\t\t\tsetAvailablePeers: ( peers ) => {\n\t\t\t\tdebug( 'setAvailablePeers', peers );\n\t\t\t\tsetAvailablePeers( peers );\n\t\t\t},\n\t\t\tchannelId,\n\t\t} )\n\t\t.then( ( { isFirstInChannel } ) => {\n\t\t\tdebug( `connected (channelId: ${ channelId })` );\n\n\t\t\tif ( isFirstInChannel ) {\n\t\t\t\tdebug( 'first in channel' );\n\n\t\t\t\t// Fetching the blocks from redux now, after the transport has successfully connected,\n\t\t\t\t// ensures that we don't initialize the Yjs doc with stale blocks.\n\t\t\t\t// (This can happen if is given an onLoad handler.)\n\t\t\t\tdoc.startSharing( { title: '', blocks: getBlocks() } );\n\t\t\t} else {\n\t\t\t\tdoc.connect();\n\t\t\t}\n\n\t\t\tconst disconnect = () => {\n\t\t\t\ttransport.disconnect();\n\t\t\t\tdoc.disconnect();\n\t\t\t};\n\n\t\t\twindow.addEventListener( 'beforeunload', () => disconnect() );\n\n\t\t\treturn { doc, disconnect };\n\t\t} );\n}\n\n/**\n * @param {object} opts - Hook options\n * @param {object[]} opts.blocks\n * @param {OnUpdate} opts.onRemoteDataChange\n * @param {CollaborationSettings} [opts.settings]\n */\nexport default function useYjs( { blocks, onRemoteDataChange, settings } ) {\n\tconst applyChangesToYjs = useRef( noop );\n\n\tconst { getBlocks, getSelection } = useSelect( ( select ) => {\n\t\treturn {\n\t\t\tgetSelection: select( 'isolated/editor' ).getEditorSelection,\n\t\t\tgetBlocks: select( 'isolated/editor' ).getBlocks,\n\t\t};\n\t}, [] );\n\n\tconst { setAvailablePeers, setPeerSelection } = useDispatch( 'isolated/editor' );\n\n\tuseEffect( () => {\n\t\tif ( ! settings?.enabled ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( ! settings.transport ) {\n\t\t\tconsole.error( `Collaborative editor is disabled because a transport module wasn't provided.` );\n\t\t\treturn;\n\t\t}\n\n\t\tdebug( 'registered collab formats' );\n\t\tregisterCollabFormats();\n\n\t\tdebug( 'added collab filters' );\n\t\taddCollabFilters();\n\n\t\tlet onUnmount = noop;\n\n\t\tinitYDoc( {\n\t\t\tonRemoteDataChange,\n\t\t\tsettings,\n\t\t\tgetBlocks,\n\t\t\tgetSelection,\n\t\t\tsetPeerSelection,\n\t\t\tsetAvailablePeers,\n\t\t} ).then( ( { doc, disconnect } ) => {\n\t\t\tonUnmount = () => {\n\t\t\t\tdebug( 'unmount' );\n\t\t\t\tdisconnect();\n\t\t\t};\n\n\t\t\tapplyChangesToYjs.current = ( blocks ) => {\n\t\t\t\tif ( doc.getState() !== 'on' ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tdebug( 'local changes applied to ydoc' );\n\t\t\t\tdoc.applyDataChanges( { blocks } );\n\t\t\t};\n\t\t} );\n\n\t\treturn () => onUnmount();\n\t}, [] );\n\n\tuseEffect( () => {\n\t\tapplyChangesToYjs.current( blocks );\n\t}, [ blocks ] );\n}\n"],"file":"index.js"}
\ No newline at end of file
diff --git a/build-module/components/block-editor-contents/use-yjs/yjs-doc.js b/build-module/components/block-editor-contents/use-yjs/yjs-doc.js
deleted file mode 100644
index 101dec2dd..000000000
--- a/build-module/components/block-editor-contents/use-yjs/yjs-doc.js
+++ /dev/null
@@ -1,146 +0,0 @@
-import * as yjs from 'yjs';
-
-const encodeArray = array => array.toString();
-
-const decodeArray = string => new Uint8Array(string.split(','));
-
-export function createDocument({
- identity,
- applyDataChanges,
- getData,
- sendMessage
-}) {
- const doc = new yjs.Doc();
- let state = 'off';
- let listeners = [];
- let stateListeners = [];
- doc.on('update', (update, origin) => {
- if (origin === identity && state === 'on') {
- sendMessage({
- protocol: 'yjs1',
- messageType: 'syncUpdate',
- update: encodeArray(update)
- });
- }
-
- if (origin !== identity) {
- const newData = getData(doc);
- listeners.forEach(listener => listener(newData));
- }
- });
-
- const setState = newState => {
- state = newState;
- stateListeners.forEach(listener => listener(newState));
- };
-
- const sync = (destination, isReply) => {
- const stateVector = yjs.encodeStateVector(doc);
- sendMessage({
- protocol: 'yjs1',
- messageType: 'sync1',
- stateVector: encodeArray(stateVector),
- origin: identity,
- destination,
- isReply
- });
- };
-
- return {
- applyDataChanges(data) {
- if (state !== 'on') {
- throw 'wrong state';
- }
-
- doc.transact(() => {
- applyDataChanges(doc, data);
- }, identity);
- },
-
- connect() {
- if (state === 'on') {
- throw 'wrong state';
- }
-
- setState('connecting');
- sync();
- },
-
- disconnect() {
- setState('off');
- },
-
- startSharing(data) {
- if (state === 'on') {
- throw 'wrong state';
- }
-
- setState('on');
- this.applyDataChanges(data);
- },
-
- receiveMessage({
- protocol,
- messageType,
- origin,
- ...content
- }) {
- if (protocol !== 'yjs1') {
- throw 'wrong protocol';
- }
-
- switch (messageType) {
- case 'sync1':
- if (content.destination && content.destination !== identity) {
- return;
- }
-
- sendMessage({
- protocol: 'yjs1',
- messageType: 'sync2',
- update: encodeArray(yjs.encodeStateAsUpdate(doc, decodeArray(content.stateVector))),
- destination: origin
- });
-
- if (!content.isReply) {
- sync(origin, true);
- }
-
- break;
-
- case 'sync2':
- if (content.destination !== identity) {
- return;
- }
-
- yjs.applyUpdate(doc, decodeArray(content.update), origin);
- setState('on');
- break;
-
- case 'syncUpdate':
- yjs.applyUpdate(doc, decodeArray(content.update), origin);
- break;
- }
- },
-
- onRemoteDataChange(listener) {
- listeners.push(listener);
- return () => {
- listeners = listeners.filter(l => l !== listener);
- };
- },
-
- onStateChange(listener) {
- stateListeners.push(listener);
- return () => {
- stateListeners = stateListeners.filter(l => l !== listener);
- };
- },
-
- getState() {
- return state;
- }
-
- };
-}
-//# sourceMappingURL=yjs-doc.js.map
\ No newline at end of file
diff --git a/build-module/components/block-editor-contents/use-yjs/yjs-doc.js.map b/build-module/components/block-editor-contents/use-yjs/yjs-doc.js.map
deleted file mode 100644
index 5a5d02d6e..000000000
--- a/build-module/components/block-editor-contents/use-yjs/yjs-doc.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"sources":["../../../../src/components/block-editor-contents/use-yjs/yjs-doc.js"],"names":["yjs","encodeArray","array","toString","decodeArray","string","Uint8Array","split","createDocument","identity","applyDataChanges","getData","sendMessage","doc","Doc","state","listeners","stateListeners","on","update","origin","protocol","messageType","newData","forEach","listener","setState","newState","sync","destination","isReply","stateVector","encodeStateVector","data","transact","connect","disconnect","startSharing","receiveMessage","content","encodeStateAsUpdate","applyUpdate","onRemoteDataChange","push","filter","l","onStateChange","getState"],"mappings":"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","sourcesContent":["import * as yjs from 'yjs';\n\nconst encodeArray = ( array ) => array.toString();\nconst decodeArray = ( string ) => new Uint8Array( string.split( ',' ) );\n\nexport function createDocument( {\n\tidentity,\n\tapplyDataChanges,\n\tgetData,\n\tsendMessage,\n} ) {\n\tconst doc = new yjs.Doc();\n\tlet state = 'off';\n\tlet listeners = [];\n\tlet stateListeners = [];\n\n\tdoc.on( 'update', ( update, origin ) => {\n\t\tif ( origin === identity && state === 'on' ) {\n\t\t\tsendMessage( {\n\t\t\t\tprotocol: 'yjs1',\n\t\t\t\tmessageType: 'syncUpdate',\n\t\t\t\tupdate: encodeArray( update ),\n\t\t\t} );\n\t\t}\n\n\t\tif ( origin !== identity ) {\n\t\t\tconst newData = getData( doc );\n\t\t\tlisteners.forEach( ( listener ) => listener( newData ) );\n\t\t}\n\t} );\n\n\tconst setState = ( newState ) => {\n\t\tstate = newState;\n\t\tstateListeners.forEach( ( listener ) => listener( newState ) );\n\t};\n\n\tconst sync = ( destination, isReply ) => {\n\t\tconst stateVector = yjs.encodeStateVector( doc );\n\t\tsendMessage( {\n\t\t\tprotocol: 'yjs1',\n\t\t\tmessageType: 'sync1',\n\t\t\tstateVector: encodeArray( stateVector ),\n\t\t\torigin: identity,\n\t\t\tdestination,\n\t\t\tisReply,\n\t\t} );\n\t};\n\n\treturn {\n\t\tapplyDataChanges( data ) {\n\t\t\tif ( state !== 'on' ) {\n\t\t\t\tthrow 'wrong state';\n\t\t\t}\n\t\t\tdoc.transact( () => {\n\t\t\t\tapplyDataChanges( doc, data );\n\t\t\t}, identity );\n\t\t},\n\n\t\tconnect() {\n\t\t\tif ( state === 'on' ) {\n\t\t\t\tthrow 'wrong state';\n\t\t\t}\n\n\t\t\tsetState( 'connecting' );\n\t\t\tsync();\n\t\t},\n\n\t\tdisconnect() {\n\t\t\tsetState( 'off' );\n\t\t},\n\n\t\tstartSharing( data ) {\n\t\t\tif ( state === 'on' ) {\n\t\t\t\tthrow 'wrong state';\n\t\t\t}\n\n\t\t\tsetState( 'on' );\n\t\t\tthis.applyDataChanges( data );\n\t\t},\n\n\t\treceiveMessage( { protocol, messageType, origin, ...content } ) {\n\t\t\tif ( protocol !== 'yjs1' ) {\n\t\t\t\tthrow 'wrong protocol';\n\t\t\t}\n\n\t\t\tswitch ( messageType ) {\n\t\t\t\tcase 'sync1':\n\t\t\t\t\tif (\n\t\t\t\t\t\tcontent.destination &&\n\t\t\t\t\t\tcontent.destination !== identity\n\t\t\t\t\t) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tsendMessage( {\n\t\t\t\t\t\tprotocol: 'yjs1',\n\t\t\t\t\t\tmessageType: 'sync2',\n\t\t\t\t\t\tupdate: encodeArray(\n\t\t\t\t\t\t\tyjs.encodeStateAsUpdate(\n\t\t\t\t\t\t\t\tdoc,\n\t\t\t\t\t\t\t\tdecodeArray( content.stateVector )\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t),\n\t\t\t\t\t\tdestination: origin,\n\t\t\t\t\t} );\n\t\t\t\t\tif ( ! content.isReply ) {\n\t\t\t\t\t\tsync( origin, true );\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'sync2':\n\t\t\t\t\tif ( content.destination !== identity ) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tyjs.applyUpdate(\n\t\t\t\t\t\tdoc,\n\t\t\t\t\t\tdecodeArray( content.update ),\n\t\t\t\t\t\torigin\n\t\t\t\t\t);\n\t\t\t\t\tsetState( 'on' );\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'syncUpdate':\n\t\t\t\t\tyjs.applyUpdate(\n\t\t\t\t\t\tdoc,\n\t\t\t\t\t\tdecodeArray( content.update ),\n\t\t\t\t\t\torigin\n\t\t\t\t\t);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t},\n\n\t\tonRemoteDataChange( listener ) {\n\t\t\tlisteners.push( listener );\n\n\t\t\treturn () => {\n\t\t\t\tlisteners = listeners.filter( ( l ) => l !== listener );\n\t\t\t};\n\t\t},\n\n\t\tonStateChange( listener ) {\n\t\t\tstateListeners.push( listener );\n\n\t\t\treturn () => {\n\t\t\t\tstateListeners = stateListeners.filter(\n\t\t\t\t\t( l ) => l !== listener\n\t\t\t\t);\n\t\t\t};\n\t\t},\n\n\t\tgetState() {\n\t\t\treturn state;\n\t\t},\n\t};\n}\n"],"file":"yjs-doc.js"}
\ No newline at end of file
diff --git a/build-module/components/block-editor-toolbar/style.scss b/build-module/components/block-editor-toolbar/style.scss
index f130f9134..85352522d 100644
--- a/build-module/components/block-editor-toolbar/style.scss
+++ b/build-module/components/block-editor-toolbar/style.scss
@@ -68,7 +68,6 @@
.edit-post-header__settings {
display: inline-flex;
align-items: center;
- flex-wrap: wrap;
button.components-button.has-icon {
margin-right: 0;
diff --git a/build-module/components/collaborative-editing/README.md b/build-module/components/collaborative-editing/README.md
index 5b697cc48..b751ca684 100644
--- a/build-module/components/collaborative-editing/README.md
+++ b/build-module/components/collaborative-editing/README.md
@@ -8,6 +8,7 @@
- _settings.channelId_ `[string]` - Optional channel id to pass to `transport.connect()`.
- _settings.username_ `string` - Name displayed to peers. Required if collab is enabled.
- _settings.caretColor_ `[string]` - Color of the caret indicator displayed to peers. If unspecified, a random color will be selected.
+- _settings.avatarUrl_ `[string]` - Presence avatar displayed to peers. If unspecified, the first character of the username will be shown.
- _settings.transport_ `CollaborationTransport` - Transport module to handle messaging between peers. See the section below for how this should be implemented.
## Implementing a transport module
diff --git a/build-module/components/collaborative-editing/components/avatars/Avatars.stories.tsx b/build-module/components/collaborative-editing/components/avatars/Avatars.stories.tsx
new file mode 100644
index 000000000..c2194058a
--- /dev/null
+++ b/build-module/components/collaborative-editing/components/avatars/Avatars.stories.tsx
@@ -0,0 +1,49 @@
+import { sample } from 'lodash';
+
+import { CollaborativeEditingAvatars, CollaborativeEditingAvatar } from '.';
+import { defaultColors } from '../../use-yjs';
+
+import type { Story } from '@storybook/react';
+
+export default {
+ title: 'Collaboration/Components/Avatars',
+ component: CollaborativeEditingAvatars,
+};
+
+const generateRandomPeers = ( count ) => {
+ return count
+ ? [ ...Array( count ) ].map( ( peer, index ) => ( {
+ id: index.toString(),
+ name: `Peery Collabson ${ index }`,
+ avatarUrl: `https://i.pravatar.cc/64?cacheBust=${ Math.random() }`,
+ color: sample( defaultColors ) as string,
+ } ) )
+ : [];
+};
+
+type Props = {
+ peerCount: number;
+};
+
+const Template: Story< Props > = ( { peerCount } ) => {
+ return ;
+};
+
+export const Default = Template.bind( {} );
+Default.args = {
+ peerCount: 25,
+};
+
+export const Empty = Template.bind( {} );
+Empty.args = {
+ peerCount: 0,
+};
+
+export const NoImage = ( args ) => {
+ return ;
+};
+NoImage.args = {
+ id: 0,
+ name: 'Peery Collabson',
+ color: sample( defaultColors ),
+};
diff --git a/build-module/components/collaborative-editing/components/avatars/index.js b/build-module/components/collaborative-editing/components/avatars/index.js
new file mode 100644
index 000000000..33c67dfef
--- /dev/null
+++ b/build-module/components/collaborative-editing/components/avatars/index.js
@@ -0,0 +1,94 @@
+import { createElement, Fragment } from "@wordpress/element";
+
+/**
+ * WordPress dependencies
+ */
+import { Popover, VisuallyHidden } from '@wordpress/components';
+import { withSelect } from '@wordpress/data';
+import { useState } from '@wordpress/element';
+import { __, sprintf } from '@wordpress/i18n';
+import './style.scss';
+/**
+ * @param {object} props
+ * @param {import("../..").AvailablePeer[]} props.peers
+ */
+
+export function CollaborativeEditingAvatars({
+ peers
+}) {
+ const MAX_AVATAR_COUNT = 3;
+ return createElement("div", {
+ className: "iso-editor-collab-avatars"
+ }, createElement(VisuallyHidden, null, "Currently editing:"), peers.slice(0, MAX_AVATAR_COUNT).map(peer => createElement(CollaborativeEditingAvatar, {
+ key: peer.id,
+ peer: peer
+ })), peers.length > MAX_AVATAR_COUNT && createElement(CollaborativeEditingAvatarsOverflow, {
+ peers: peers === null || peers === void 0 ? void 0 : peers.slice(MAX_AVATAR_COUNT)
+ }));
+}
+export function CollaborativeEditingAvatar({
+ peer
+}) {
+ const [isVisible, setIsVisible] = useState(false);
+ return createElement("div", {
+ className: "iso-editor-collab-avatars__avatar",
+ "aria-label": peer.name,
+ onMouseEnter: () => setIsVisible(true),
+ onMouseLeave: () => setIsVisible(false),
+ style: {
+ borderColor: peer.color,
+ background: peer.color
+ }
+ }, isVisible && createElement(Popover, {
+ className: "iso-editor-collab-avatars__popover",
+ animate: false
+ }, peer.name), peer.avatarUrl ? createElement("img", {
+ className: "iso-editor-collab-avatars__image",
+ src: peer.avatarUrl,
+ alt: ""
+ }) : createElement("span", {
+ className: "iso-editor-collab-avatars__name-initial"
+ }, peer.name.charAt(0)));
+}
+export function CollaborativeEditingAvatarsOverflow({
+ peers
+}) {
+ const MAX_NAME_COUNT = 20;
+ const [isVisible, setIsVisible] = useState(false);
+
+ const NameList = () => {
+ return createElement(Fragment, null, createElement("ul", {
+ className: "iso-editor-collab-avatars__overflow-list"
+ }, peers.slice(0, MAX_NAME_COUNT).map(peer => createElement("li", {
+ className: "iso-editor-collab-avatars__overflow-list-item",
+ key: peer.id
+ }, peer.name))), peers.length > MAX_NAME_COUNT && createElement("p", {
+ className: "iso-editor-collab-avatars__overflow-more"
+ }, sprintf(
+ /* translators: %s: number of how many more users there are */
+ __('and %s more'), peers.length - MAX_NAME_COUNT)));
+ };
+
+ return createElement("div", {
+ className: "iso-editor-collab-avatars__overflow"
+ }, isVisible && createElement(Popover, {
+ className: "iso-editor-collab-avatars__popover",
+ animate: false
+ }, createElement(NameList, null)), createElement("span", {
+ "aria-hidden": "true",
+ onMouseEnter: () => setIsVisible(true),
+ onMouseLeave: () => setIsVisible(false)
+ }, `+${peers.length}`), createElement(VisuallyHidden, null, createElement(NameList, null)));
+}
+export default withSelect(select => {
+ const peers = select('isolated/editor').getPeers();
+ return {
+ peers: Object.keys(peers).map(id => {
+ return {
+ id,
+ ...peers[id]
+ };
+ })
+ };
+})(CollaborativeEditingAvatars);
+//# sourceMappingURL=index.js.map
\ No newline at end of file
diff --git a/build-module/components/collaborative-editing/components/avatars/index.js.map b/build-module/components/collaborative-editing/components/avatars/index.js.map
new file mode 100644
index 000000000..4be1ea434
--- /dev/null
+++ b/build-module/components/collaborative-editing/components/avatars/index.js.map
@@ -0,0 +1 @@
+{"version":3,"sources":["../../../../../src/components/collaborative-editing/components/avatars/index.js"],"names":["Popover","VisuallyHidden","withSelect","useState","__","sprintf","CollaborativeEditingAvatars","peers","MAX_AVATAR_COUNT","slice","map","peer","id","length","CollaborativeEditingAvatar","isVisible","setIsVisible","name","borderColor","color","background","avatarUrl","charAt","CollaborativeEditingAvatarsOverflow","MAX_NAME_COUNT","NameList","select","getPeers","Object","keys"],"mappings":"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","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Popover, VisuallyHidden } from '@wordpress/components';\nimport { withSelect } from '@wordpress/data';\nimport { useState } from '@wordpress/element';\nimport { __, sprintf } from '@wordpress/i18n';\n\nimport './style.scss';\n\n/**\n * @param {object} props\n * @param {import(\"../..\").AvailablePeer[]} props.peers\n */\nexport function CollaborativeEditingAvatars( { peers } ) {\n\tconst MAX_AVATAR_COUNT = 3;\n\n\treturn (\n\t\t\n\t\t\tCurrently editing: \n\n\t\t\t{ peers.slice( 0, MAX_AVATAR_COUNT ).map( ( peer ) => (\n\t\t\t\t \n\t\t\t) ) }\n\n\t\t\t{ peers.length > MAX_AVATAR_COUNT && (\n\t\t\t\t \n\t\t\t) }\n\t\t
\n\t);\n}\n\nexport function CollaborativeEditingAvatar( { peer } ) {\n\tconst [ isVisible, setIsVisible ] = useState( false );\n\n\treturn (\n\t\t setIsVisible( true ) }\n\t\t\tonMouseLeave={ () => setIsVisible( false ) }\n\t\t\tstyle={ {\n\t\t\t\tborderColor: peer.color,\n\t\t\t\tbackground: peer.color,\n\t\t\t} }\n\t\t>\n\t\t\t{ isVisible && (\n\t\t\t\t
\n\t\t\t\t\t{ peer.name }\n\t\t\t\t \n\t\t\t) }\n\t\t\t{ peer.avatarUrl ? (\n\t\t\t\t
\n\t\t\t) : (\n\t\t\t\t
{ peer.name.charAt( 0 ) } \n\t\t\t) }\n\t\t
\n\t);\n}\n\nexport function CollaborativeEditingAvatarsOverflow( { peers } ) {\n\tconst MAX_NAME_COUNT = 20;\n\tconst [ isVisible, setIsVisible ] = useState( false );\n\n\tconst NameList = () => {\n\t\treturn (\n\t\t\t<>\n\t\t\t\t\n\t\t\t\t\t{ peers.slice( 0, MAX_NAME_COUNT ).map( ( peer ) => (\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t{ peer.name }\n\t\t\t\t\t\t \n\t\t\t\t\t) ) }\n\t\t\t\t \n\t\t\t\t{ peers.length > MAX_NAME_COUNT && (\n\t\t\t\t\t\n\t\t\t\t\t\t{ sprintf(\n\t\t\t\t\t\t\t/* translators: %s: number of how many more users there are */\n\t\t\t\t\t\t\t__( 'and %s more' ),\n\t\t\t\t\t\t\tpeers.length - MAX_NAME_COUNT\n\t\t\t\t\t\t) }\n\t\t\t\t\t
\n\t\t\t\t) }\n\t\t\t>\n\t\t);\n\t};\n\n\treturn (\n\t\t\n\t\t\t{ isVisible && (\n\t\t\t\t
\n\t\t\t\t\t \n\t\t\t\t \n\t\t\t) }\n\t\t\t
setIsVisible( true ) }\n\t\t\t\tonMouseLeave={ () => setIsVisible( false ) }\n\t\t\t>\n\t\t\t\t{ `+${ peers.length }` }\n\t\t\t \n\t\t\t
\n\t\t\t\t \n\t\t\t \n\t\t
\n\t);\n}\n\nexport default withSelect( ( select ) => {\n\tconst peers = select( 'isolated/editor' ).getPeers();\n\n\treturn {\n\t\tpeers: Object.keys( peers ).map( ( id ) => {\n\t\t\treturn {\n\t\t\t\tid,\n\t\t\t\t...peers[ id ],\n\t\t\t};\n\t\t} ),\n\t};\n} )( CollaborativeEditingAvatars );\n"],"file":"index.js"}
\ No newline at end of file
diff --git a/build-module/components/collaborative-editing/components/avatars/style.scss b/build-module/components/collaborative-editing/components/avatars/style.scss
new file mode 100644
index 000000000..b0aa98dee
--- /dev/null
+++ b/build-module/components/collaborative-editing/components/avatars/style.scss
@@ -0,0 +1,87 @@
+@import '@wordpress/base-styles/_colors';
+@import '@wordpress/base-styles/_variables';
+
+$avatarSize: 32px;
+
+.iso-editor-collab-avatars {
+ display: flex;
+ align-items: center;
+ margin: 0 8px;
+}
+
+.iso-editor-collab-avatars__avatar {
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ width: $avatarSize;
+ height: $avatarSize;
+ border-radius: 50%;
+ border-width: 2px;
+ border-style: solid;
+
+ & + & {
+ margin-left: -4px;
+ box-shadow: 0 0 0 2px $white;
+ }
+}
+
+.iso-editor-collab-avatars__popover {
+ // Mostly mimic styles for the core Tooltip component.
+ // (We could've simply used core Tooltip if the delay was shorter
+ // and it accepted multi-line text.)
+ .components-popover__content {
+ transform: translateY( 8px );
+ background: $gray-900;
+ border-radius: $radius-block-ui;
+ border-width: 0;
+ color: $white;
+ white-space: nowrap;
+ line-height: 1.4;
+ font-size: 12px;
+ box-shadow: none;
+
+ > div {
+ padding: $grid-unit-05 $grid-unit-10;
+ }
+ }
+}
+
+.iso-editor-collab-avatars__image {
+ width: inherit;
+ height: inherit;
+ border-radius: inherit;
+}
+
+.iso-editor-collab-avatars__name-initial {
+ font-size: 20px;
+ line-height: 1;
+ color: $white;
+ text-transform: uppercase;
+ cursor: default;
+}
+
+.iso-editor-collab-avatars__overflow {
+ margin-left: 4px;
+ height: 100%;
+ cursor: default;
+}
+
+.iso-editor-collab-avatars__overflow-list {
+ margin: 0;
+ padding: 0;
+ list-style: none;
+}
+
+.iso-editor-collab-avatars__overflow-list-item {
+ margin: 0;
+ line-height: 1;
+
+ & + & {
+ margin-top: 6px;
+ }
+}
+
+.iso-editor-collab-avatars__overflow-more {
+ margin: 6px 0 0;
+ line-height: 1;
+}
diff --git a/build-module/components/collaborative-editing/index.js b/build-module/components/collaborative-editing/index.js
index 6725124a5..42d5711ec 100644
--- a/build-module/components/collaborative-editing/index.js
+++ b/build-module/components/collaborative-editing/index.js
@@ -1,7 +1,11 @@
+import { createElement } from "@wordpress/element";
+
/**
* Internal dependencies
*/
+import { ToolbarSlot } from '../..';
import useYjs from './use-yjs';
+import CollaborativeEditingAvatars from './components/avatars';
/**
* Real-time collaboration settings
* @typedef CollaborationSettings
@@ -9,6 +13,7 @@ import useYjs from './use-yjs';
* @property {string} [channelId] Optional channel id to pass to transport.connect().
* @property {string} username Name displayed to peers. Required if collab is enabled.
* @property {string} [caretColor] Color of the caret indicator displayed to peers. If unspecified, a random color will be selected.
+ * @property {string} [avatarUrl] Url of the avatar image diplayed to peers.
* @property {CollaborationTransport} transport Required if collab is enabled.
*/
@@ -23,6 +28,7 @@ import useYjs from './use-yjs';
* @property {object} user
* @property {string} user.identity
* @property {string} user.name
+ * @property {string} [user.avatarUrl]
* @property {string} [user.color] Color of the caret indicator displayed to peers.
* @property {(message: object) => void} onReceiveMessage Callback to run when a message is received.
* @property {(peers: AvailablePeer[]) => void} setAvailablePeers Callback to run when peers change.
@@ -32,6 +38,7 @@ import useYjs from './use-yjs';
* @property {string} id
* @property {string} name
* @property {string} color
+ * @property {string} [avatarUrl]
*
* @typedef CollaborationTransportDocMessage
* @property {string} identity
@@ -59,7 +66,7 @@ function CollaborativeEditing({
useYjs({
settings
});
- return null;
+ return createElement(ToolbarSlot, null, createElement(CollaborativeEditingAvatars, null));
}
export default CollaborativeEditing;
diff --git a/build-module/components/collaborative-editing/index.js.map b/build-module/components/collaborative-editing/index.js.map
index 1bc660cbd..a0a457c72 100644
--- a/build-module/components/collaborative-editing/index.js.map
+++ b/build-module/components/collaborative-editing/index.js.map
@@ -1 +1 @@
-{"version":3,"sources":["../../../src/components/collaborative-editing/index.js"],"names":["useYjs","CollaborativeEditing","settings"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,MAAP,MAAmB,WAAnB;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AACA,SAASC,oBAAT,CAA+B;AAAEC,EAAAA;AAAF,CAA/B,EAA8C;AAC7CF,EAAAA,MAAM,CAAE;AACPE,IAAAA;AADO,GAAF,CAAN;AAIA,SAAO,IAAP;AACA;;AAED,eAAeD,oBAAf","sourcesContent":["/**\n * Internal dependencies\n */\nimport useYjs from './use-yjs';\n\n/**\n * Real-time collaboration settings\n * @typedef CollaborationSettings\n * @property {boolean} enabled\n * @property {string} [channelId] Optional channel id to pass to transport.connect().\n * @property {string} username Name displayed to peers. Required if collab is enabled.\n * @property {string} [caretColor] Color of the caret indicator displayed to peers. If unspecified, a random color will be selected.\n * @property {CollaborationTransport} transport Required if collab is enabled.\n */\n\n/**\n * Transport module for real-time collaboration\n * @typedef CollaborationTransport\n * @property {(message: CollaborationTransportDocMessage|CollaborationTransportSelectionMessage) => void} sendMessage\n * @property {(options: CollaborationTransportConnectOpts) => Promise<{isFirstInChannel: boolean}>} connect\n * @property {() => Promise} disconnect\n *\n * @typedef CollaborationTransportConnectOpts\n * @property {object} user\n * @property {string} user.identity\n * @property {string} user.name\n * @property {string} [user.color] Color of the caret indicator displayed to peers.\n * @property {(message: object) => void} onReceiveMessage Callback to run when a message is received.\n * @property {(peers: AvailablePeer[]) => void} setAvailablePeers Callback to run when peers change.\n * @property {string} [channelId]\n *\n * @typedef AvailablePeer\n * @property {string} id\n * @property {string} name\n * @property {string} color\n *\n * @typedef CollaborationTransportDocMessage\n * @property {string} identity\n * @property {'doc'} type\n * @property {object} message\n *\n * @typedef CollaborationTransportSelectionMessage\n * @property {string} identity\n * @property {'selection'} type\n * @property {EditorSelection} selection\n *\n * @typedef EditorSelection\n * @property {object} start\n * @property {object} end\n */\n\n/**\n * @param {object} props\n * @param {CollaborationSettings} props.settings\n */\nfunction CollaborativeEditing( { settings } ) {\n\tuseYjs( {\n\t\tsettings,\n\t} );\n\n\treturn null;\n}\n\nexport default CollaborativeEditing;\n"],"file":"index.js"}
\ No newline at end of file
+{"version":3,"sources":["../../../src/components/collaborative-editing/index.js"],"names":["ToolbarSlot","useYjs","CollaborativeEditingAvatars","CollaborativeEditing","settings"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,WAAT,QAA4B,OAA5B;AACA,OAAOC,MAAP,MAAmB,WAAnB;AACA,OAAOC,2BAAP,MAAwC,sBAAxC;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AACA,SAASC,oBAAT,CAA+B;AAAEC,EAAAA;AAAF,CAA/B,EAA8C;AAC7CH,EAAAA,MAAM,CAAE;AACPG,IAAAA;AADO,GAAF,CAAN;AAIA,SACC,cAAC,WAAD,QACC,cAAC,2BAAD,OADD,CADD;AAKA;;AAED,eAAeD,oBAAf","sourcesContent":["/**\n * Internal dependencies\n */\nimport { ToolbarSlot } from '../..';\nimport useYjs from './use-yjs';\nimport CollaborativeEditingAvatars from './components/avatars';\n\n/**\n * Real-time collaboration settings\n * @typedef CollaborationSettings\n * @property {boolean} enabled\n * @property {string} [channelId] Optional channel id to pass to transport.connect().\n * @property {string} username Name displayed to peers. Required if collab is enabled.\n * @property {string} [caretColor] Color of the caret indicator displayed to peers. If unspecified, a random color will be selected.\n * @property {string} [avatarUrl] Url of the avatar image diplayed to peers.\n * @property {CollaborationTransport} transport Required if collab is enabled.\n */\n\n/**\n * Transport module for real-time collaboration\n * @typedef CollaborationTransport\n * @property {(message: CollaborationTransportDocMessage|CollaborationTransportSelectionMessage) => void} sendMessage\n * @property {(options: CollaborationTransportConnectOpts) => Promise<{isFirstInChannel: boolean}>} connect\n * @property {() => Promise} disconnect\n *\n * @typedef CollaborationTransportConnectOpts\n * @property {object} user\n * @property {string} user.identity\n * @property {string} user.name\n * @property {string} [user.avatarUrl]\n * @property {string} [user.color] Color of the caret indicator displayed to peers.\n * @property {(message: object) => void} onReceiveMessage Callback to run when a message is received.\n * @property {(peers: AvailablePeer[]) => void} setAvailablePeers Callback to run when peers change.\n * @property {string} [channelId]\n *\n * @typedef AvailablePeer\n * @property {string} id\n * @property {string} name\n * @property {string} color\n * @property {string} [avatarUrl]\n *\n * @typedef CollaborationTransportDocMessage\n * @property {string} identity\n * @property {'doc'} type\n * @property {object} message\n *\n * @typedef CollaborationTransportSelectionMessage\n * @property {string} identity\n * @property {'selection'} type\n * @property {EditorSelection} selection\n *\n * @typedef EditorSelection\n * @property {object} start\n * @property {object} end\n */\n\n/**\n * @param {object} props\n * @param {CollaborationSettings} props.settings\n */\nfunction CollaborativeEditing( { settings } ) {\n\tuseYjs( {\n\t\tsettings,\n\t} );\n\n\treturn (\n\t\t\n\t\t\t \n\t\t \n\t);\n}\n\nexport default CollaborativeEditing;\n"],"file":"index.js"}
\ No newline at end of file
diff --git a/build-module/components/collaborative-editing/use-yjs/index.js b/build-module/components/collaborative-editing/use-yjs/index.js
index daffd8507..0df75e78d 100644
--- a/build-module/components/collaborative-editing/use-yjs/index.js
+++ b/build-module/components/collaborative-editing/use-yjs/index.js
@@ -32,7 +32,7 @@ const debug = require('debug')('iso-editor:collab');
/** @typedef {import('../../block-editor-contents').OnUpdate} OnUpdate */
-const defaultColors = ['#4676C0', '#6F6EBE', '#9063B6', '#C3498D', '#9E6D14', '#3B4856', '#4A807A'];
+export const defaultColors = ['#4676C0', '#6F6EBE', '#9063B6', '#C3498D', '#9E6D14', '#3B4856', '#4A807A'];
/**
* @param {object} opts - Hook options
* @param {() => object[]} opts.getBlocks - Content to initialize the Yjs doc with.
@@ -119,7 +119,8 @@ async function initYDoc({
user: {
identity,
name: settings.username,
- color: settings.caretColor || sample(defaultColors)
+ color: settings.caretColor || sample(defaultColors),
+ avatarUrl: settings.avatarUrl
},
onReceiveMessage,
setAvailablePeers: peers => {
diff --git a/build-module/components/collaborative-editing/use-yjs/index.js.map b/build-module/components/collaborative-editing/use-yjs/index.js.map
index a3eb709d0..2dc0b081c 100644
--- a/build-module/components/collaborative-editing/use-yjs/index.js.map
+++ b/build-module/components/collaborative-editing/use-yjs/index.js.map
@@ -1 +1 @@
-{"version":3,"sources":["../../../../src/components/collaborative-editing/use-yjs/index.js"],"names":["v4","uuidv4","noop","sample","createDocument","postDocToObject","updatePostDoc","useDispatch","useSelect","useEffect","useRef","addCollabFilters","registerCollabFormats","debug","require","defaultColors","initYDoc","getBlocks","onRemoteDataChange","settings","getSelection","setPeerSelection","setAvailablePeers","channelId","transport","identity","doc","applyDataChanges","getData","sendMessage","message","type","selectionStart","selectionEnd","selection","start","end","onReceiveMessage","data","receiveMessage","changes","blocks","connect","user","name","username","color","caretColor","peers","then","isFirstInChannel","startSharing","title","disconnect","window","addEventListener","useYjs","applyChangesToYjs","select","getEditorSelection","updateBlocksWithUndo","enabled","console","error","onUnmount","current","getState"],"mappings":"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","sourcesContent":["/**\n * External dependencies\n */\nimport { v4 as uuidv4 } from 'uuid';\nimport { noop, sample } from 'lodash';\nimport { createDocument } from './yjs-doc';\nimport { postDocToObject, updatePostDoc } from './algorithms/yjs';\n\n/**\n * WordPress dependencies\n */\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { useEffect, useRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { addCollabFilters } from './filters';\nimport { registerCollabFormats } from './formats';\n\nconst debug = require( 'debug' )( 'iso-editor:collab' );\n\n/** @typedef {import('..').CollaborationSettings} CollaborationSettings */\n/** @typedef {import('..').CollaborationTransport} CollaborationTransport */\n/** @typedef {import('..').CollaborationTransportDocMessage} CollaborationTransportDocMessage */\n/** @typedef {import('..').CollaborationTransportSelectionMessage} CollaborationTransportSelectionMessage */\n/** @typedef {import('..').EditorSelection} EditorSelection */\n/** @typedef {import('../../block-editor-contents').OnUpdate} OnUpdate */\n\nconst defaultColors = [ '#4676C0', '#6F6EBE', '#9063B6', '#C3498D', '#9E6D14', '#3B4856', '#4A807A' ];\n\n/**\n * @param {object} opts - Hook options\n * @param {() => object[]} opts.getBlocks - Content to initialize the Yjs doc with.\n * @param {OnUpdate} opts.onRemoteDataChange - Function to update editor blocks in redux state.\n * @param {CollaborationSettings} opts.settings\n * @param {() => IsoEditorSelection} opts.getSelection\n * @param {import('../../../store/peers/actions').setAvailablePeers} opts.setAvailablePeers\n * @param {import('../../../store/peers/actions').setPeerSelection} opts.setPeerSelection\n *\n * @typedef IsoEditorSelection\n * @property {object} selectionStart\n * @property {object} selectionEnd\n */\nasync function initYDoc( {\n\tgetBlocks,\n\tonRemoteDataChange,\n\tsettings,\n\tgetSelection,\n\tsetPeerSelection,\n\tsetAvailablePeers,\n} ) {\n\tconst { channelId, transport } = settings;\n\n\t/** @type string */\n\tconst identity = uuidv4();\n\n\tdebug( `initYDoc (identity: ${ identity })` );\n\n\tconst doc = createDocument( {\n\t\tidentity,\n\t\tapplyDataChanges: updatePostDoc,\n\t\tgetData: postDocToObject,\n\t\t/** @param {object} message */\n\t\tsendMessage: ( message ) => {\n\t\t\tdebug( 'sendDocMessage', message );\n\t\t\ttransport.sendMessage( { type: 'doc', identity, message } );\n\n\t\t\tconst { selectionStart, selectionEnd } = getSelection() || {};\n\t\t\tdebug( 'sendSelection', selectionStart, selectionEnd );\n\t\t\ttransport.sendMessage( {\n\t\t\t\ttype: 'selection',\n\t\t\t\tidentity,\n\t\t\t\tselection: {\n\t\t\t\t\tstart: selectionStart,\n\t\t\t\t\tend: selectionEnd,\n\t\t\t\t},\n\t\t\t} );\n\t\t},\n\t} );\n\n\t/** @param {CollaborationTransportDocMessage|CollaborationTransportSelectionMessage} data */\n\tconst onReceiveMessage = ( data ) => {\n\t\tdebug( 'remote change received by transport', data );\n\n\t\tswitch ( data.type ) {\n\t\t\tcase 'doc': {\n\t\t\t\tdoc.receiveMessage( data.message );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase 'selection': {\n\t\t\t\tsetPeerSelection( data.identity, data.selection );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t};\n\n\tdoc.onRemoteDataChange( ( changes ) => {\n\t\tdebug( 'remote change received by ydoc', changes );\n\t\tonRemoteDataChange( changes.blocks );\n\t} );\n\n\treturn transport\n\t\t.connect( {\n\t\t\tuser: {\n\t\t\t\tidentity,\n\t\t\t\tname: settings.username,\n\t\t\t\tcolor: settings.caretColor || sample( defaultColors ),\n\t\t\t},\n\t\t\tonReceiveMessage,\n\t\t\tsetAvailablePeers: ( peers ) => {\n\t\t\t\tdebug( 'setAvailablePeers', peers );\n\t\t\t\tsetAvailablePeers( peers );\n\t\t\t},\n\t\t\tchannelId,\n\t\t} )\n\t\t.then( ( { isFirstInChannel } ) => {\n\t\t\tdebug( `connected (channelId: ${ channelId })` );\n\n\t\t\tif ( isFirstInChannel ) {\n\t\t\t\tdebug( 'first in channel' );\n\n\t\t\t\t// Fetching the blocks from redux now, after the transport has successfully connected,\n\t\t\t\t// ensures that we don't initialize the Yjs doc with stale blocks.\n\t\t\t\t// (This can happen if is given an onLoad handler.)\n\t\t\t\tdoc.startSharing( { title: '', blocks: getBlocks() } );\n\t\t\t} else {\n\t\t\t\tdoc.connect();\n\t\t\t}\n\n\t\t\tconst disconnect = () => {\n\t\t\t\ttransport.disconnect();\n\t\t\t\tdoc.disconnect();\n\t\t\t};\n\n\t\t\twindow.addEventListener( 'beforeunload', () => disconnect() );\n\n\t\t\treturn { doc, disconnect };\n\t\t} );\n}\n\n/**\n * @param {object} opts - Hook options\n * @param {CollaborationSettings} [opts.settings]\n */\nexport default function useYjs( { settings } ) {\n\tconst applyChangesToYjs = useRef( noop );\n\n\tconst { blocks, getBlocks, getSelection } = useSelect( ( select ) => {\n\t\treturn {\n\t\t\tblocks: select( 'isolated/editor' ).getBlocks(),\n\t\t\tgetBlocks: select( 'isolated/editor' ).getBlocks,\n\t\t\tgetSelection: select( 'isolated/editor' ).getEditorSelection,\n\t\t};\n\t}, [] );\n\n\tconst { setAvailablePeers, setPeerSelection, updateBlocksWithUndo } = useDispatch( 'isolated/editor' );\n\n\tuseEffect( () => {\n\t\tif ( ! settings?.enabled ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( ! settings.transport ) {\n\t\t\tconsole.error( `Collaborative editor is disabled because a transport module wasn't provided.` );\n\t\t\treturn;\n\t\t}\n\n\t\tdebug( 'registered collab formats' );\n\t\tregisterCollabFormats();\n\n\t\tdebug( 'added collab filters' );\n\t\taddCollabFilters();\n\n\t\tlet onUnmount = noop;\n\n\t\tinitYDoc( {\n\t\t\tonRemoteDataChange: updateBlocksWithUndo,\n\t\t\tsettings,\n\t\t\tgetBlocks,\n\t\t\tgetSelection,\n\t\t\tsetPeerSelection,\n\t\t\tsetAvailablePeers,\n\t\t} ).then( ( { doc, disconnect } ) => {\n\t\t\tonUnmount = () => {\n\t\t\t\tdebug( 'unmount' );\n\t\t\t\tdisconnect();\n\t\t\t};\n\n\t\t\tapplyChangesToYjs.current = ( blocks ) => {\n\t\t\t\tif ( doc.getState() !== 'on' ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tdebug( 'local changes applied to ydoc' );\n\t\t\t\tdoc.applyDataChanges( { blocks } );\n\t\t\t};\n\t\t} );\n\n\t\treturn () => onUnmount();\n\t}, [] );\n\n\tuseEffect( () => {\n\t\tapplyChangesToYjs.current( blocks );\n\t}, [ blocks ] );\n}\n"],"file":"index.js"}
\ No newline at end of file
+{"version":3,"sources":["../../../../src/components/collaborative-editing/use-yjs/index.js"],"names":["v4","uuidv4","noop","sample","createDocument","postDocToObject","updatePostDoc","useDispatch","useSelect","useEffect","useRef","addCollabFilters","registerCollabFormats","debug","require","defaultColors","initYDoc","getBlocks","onRemoteDataChange","settings","getSelection","setPeerSelection","setAvailablePeers","channelId","transport","identity","doc","applyDataChanges","getData","sendMessage","message","type","selectionStart","selectionEnd","selection","start","end","onReceiveMessage","data","receiveMessage","changes","blocks","connect","user","name","username","color","caretColor","avatarUrl","peers","then","isFirstInChannel","startSharing","title","disconnect","window","addEventListener","useYjs","applyChangesToYjs","select","getEditorSelection","updateBlocksWithUndo","enabled","console","error","onUnmount","current","getState"],"mappings":"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","sourcesContent":["/**\n * External dependencies\n */\nimport { v4 as uuidv4 } from 'uuid';\nimport { noop, sample } from 'lodash';\nimport { createDocument } from './yjs-doc';\nimport { postDocToObject, updatePostDoc } from './algorithms/yjs';\n\n/**\n * WordPress dependencies\n */\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { useEffect, useRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { addCollabFilters } from './filters';\nimport { registerCollabFormats } from './formats';\n\nconst debug = require( 'debug' )( 'iso-editor:collab' );\n\n/** @typedef {import('..').CollaborationSettings} CollaborationSettings */\n/** @typedef {import('..').CollaborationTransport} CollaborationTransport */\n/** @typedef {import('..').CollaborationTransportDocMessage} CollaborationTransportDocMessage */\n/** @typedef {import('..').CollaborationTransportSelectionMessage} CollaborationTransportSelectionMessage */\n/** @typedef {import('..').EditorSelection} EditorSelection */\n/** @typedef {import('../../block-editor-contents').OnUpdate} OnUpdate */\n\nexport const defaultColors = [ '#4676C0', '#6F6EBE', '#9063B6', '#C3498D', '#9E6D14', '#3B4856', '#4A807A' ];\n\n/**\n * @param {object} opts - Hook options\n * @param {() => object[]} opts.getBlocks - Content to initialize the Yjs doc with.\n * @param {OnUpdate} opts.onRemoteDataChange - Function to update editor blocks in redux state.\n * @param {CollaborationSettings} opts.settings\n * @param {() => IsoEditorSelection} opts.getSelection\n * @param {import('../../../store/peers/actions').setAvailablePeers} opts.setAvailablePeers\n * @param {import('../../../store/peers/actions').setPeerSelection} opts.setPeerSelection\n *\n * @typedef IsoEditorSelection\n * @property {object} selectionStart\n * @property {object} selectionEnd\n */\nasync function initYDoc( {\n\tgetBlocks,\n\tonRemoteDataChange,\n\tsettings,\n\tgetSelection,\n\tsetPeerSelection,\n\tsetAvailablePeers,\n} ) {\n\tconst { channelId, transport } = settings;\n\n\t/** @type string */\n\tconst identity = uuidv4();\n\n\tdebug( `initYDoc (identity: ${ identity })` );\n\n\tconst doc = createDocument( {\n\t\tidentity,\n\t\tapplyDataChanges: updatePostDoc,\n\t\tgetData: postDocToObject,\n\t\t/** @param {object} message */\n\t\tsendMessage: ( message ) => {\n\t\t\tdebug( 'sendDocMessage', message );\n\t\t\ttransport.sendMessage( { type: 'doc', identity, message } );\n\n\t\t\tconst { selectionStart, selectionEnd } = getSelection() || {};\n\t\t\tdebug( 'sendSelection', selectionStart, selectionEnd );\n\t\t\ttransport.sendMessage( {\n\t\t\t\ttype: 'selection',\n\t\t\t\tidentity,\n\t\t\t\tselection: {\n\t\t\t\t\tstart: selectionStart,\n\t\t\t\t\tend: selectionEnd,\n\t\t\t\t},\n\t\t\t} );\n\t\t},\n\t} );\n\n\t/** @param {CollaborationTransportDocMessage|CollaborationTransportSelectionMessage} data */\n\tconst onReceiveMessage = ( data ) => {\n\t\tdebug( 'remote change received by transport', data );\n\n\t\tswitch ( data.type ) {\n\t\t\tcase 'doc': {\n\t\t\t\tdoc.receiveMessage( data.message );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase 'selection': {\n\t\t\t\tsetPeerSelection( data.identity, data.selection );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t};\n\n\tdoc.onRemoteDataChange( ( changes ) => {\n\t\tdebug( 'remote change received by ydoc', changes );\n\t\tonRemoteDataChange( changes.blocks );\n\t} );\n\n\treturn transport\n\t\t.connect( {\n\t\t\tuser: {\n\t\t\t\tidentity,\n\t\t\t\tname: settings.username,\n\t\t\t\tcolor: settings.caretColor || sample( defaultColors ),\n\t\t\t\tavatarUrl: settings.avatarUrl,\n\t\t\t},\n\t\t\tonReceiveMessage,\n\t\t\tsetAvailablePeers: ( peers ) => {\n\t\t\t\tdebug( 'setAvailablePeers', peers );\n\t\t\t\tsetAvailablePeers( peers );\n\t\t\t},\n\t\t\tchannelId,\n\t\t} )\n\t\t.then( ( { isFirstInChannel } ) => {\n\t\t\tdebug( `connected (channelId: ${ channelId })` );\n\n\t\t\tif ( isFirstInChannel ) {\n\t\t\t\tdebug( 'first in channel' );\n\n\t\t\t\t// Fetching the blocks from redux now, after the transport has successfully connected,\n\t\t\t\t// ensures that we don't initialize the Yjs doc with stale blocks.\n\t\t\t\t// (This can happen if is given an onLoad handler.)\n\t\t\t\tdoc.startSharing( { title: '', blocks: getBlocks() } );\n\t\t\t} else {\n\t\t\t\tdoc.connect();\n\t\t\t}\n\n\t\t\tconst disconnect = () => {\n\t\t\t\ttransport.disconnect();\n\t\t\t\tdoc.disconnect();\n\t\t\t};\n\n\t\t\twindow.addEventListener( 'beforeunload', () => disconnect() );\n\n\t\t\treturn { doc, disconnect };\n\t\t} );\n}\n\n/**\n * @param {object} opts - Hook options\n * @param {CollaborationSettings} [opts.settings]\n */\nexport default function useYjs( { settings } ) {\n\tconst applyChangesToYjs = useRef( noop );\n\n\tconst { blocks, getBlocks, getSelection } = useSelect( ( select ) => {\n\t\treturn {\n\t\t\tblocks: select( 'isolated/editor' ).getBlocks(),\n\t\t\tgetBlocks: select( 'isolated/editor' ).getBlocks,\n\t\t\tgetSelection: select( 'isolated/editor' ).getEditorSelection,\n\t\t};\n\t}, [] );\n\n\tconst { setAvailablePeers, setPeerSelection, updateBlocksWithUndo } = useDispatch( 'isolated/editor' );\n\n\tuseEffect( () => {\n\t\tif ( ! settings?.enabled ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( ! settings.transport ) {\n\t\t\tconsole.error( `Collaborative editor is disabled because a transport module wasn't provided.` );\n\t\t\treturn;\n\t\t}\n\n\t\tdebug( 'registered collab formats' );\n\t\tregisterCollabFormats();\n\n\t\tdebug( 'added collab filters' );\n\t\taddCollabFilters();\n\n\t\tlet onUnmount = noop;\n\n\t\tinitYDoc( {\n\t\t\tonRemoteDataChange: updateBlocksWithUndo,\n\t\t\tsettings,\n\t\t\tgetBlocks,\n\t\t\tgetSelection,\n\t\t\tsetPeerSelection,\n\t\t\tsetAvailablePeers,\n\t\t} ).then( ( { doc, disconnect } ) => {\n\t\t\tonUnmount = () => {\n\t\t\t\tdebug( 'unmount' );\n\t\t\t\tdisconnect();\n\t\t\t};\n\n\t\t\tapplyChangesToYjs.current = ( blocks ) => {\n\t\t\t\tif ( doc.getState() !== 'on' ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tdebug( 'local changes applied to ydoc' );\n\t\t\t\tdoc.applyDataChanges( { blocks } );\n\t\t\t};\n\t\t} );\n\n\t\treturn () => onUnmount();\n\t}, [] );\n\n\tuseEffect( () => {\n\t\tapplyChangesToYjs.current( blocks );\n\t}, [ blocks ] );\n}\n"],"file":"index.js"}
\ No newline at end of file
diff --git a/build-module/components/formats/collab-caret/index.js b/build-module/components/formats/collab-caret/index.js
deleted file mode 100644
index 8e8cf726b..000000000
--- a/build-module/components/formats/collab-caret/index.js
+++ /dev/null
@@ -1,116 +0,0 @@
-/**
- * External dependencies
- */
-import memoize from 'memize';
-import classnames from 'classnames';
-/**
- * WordPress dependencies
- */
-
-import { applyFormat, registerFormatType } from '@wordpress/rich-text';
-/**
- * Internal dependencies
- */
-
-import './style.scss';
-const FORMAT_NAME = 'isolated/collab-caret';
-/**
- * Applies given carets to the given record.
- *
- * @param {Object} record The record to apply carets to.
- * @param {Array} carets The carets to apply.
- * @return {Object} A record with the carets applied.
- */
-
-export function applyCarets(record, carets = []) {
- carets.forEach(caret => {
- let {
- start,
- end,
- id,
- color,
- label
- } = caret;
- const isCollapsed = start === end;
- const isShifted = isCollapsed && end >= record.text.length;
-
- if (isShifted) {
- start = record.text.length - 1;
- }
-
- if (isCollapsed) {
- end = start + 1;
- }
-
- record = applyFormat(record, {
- type: FORMAT_NAME,
- attributes: {
- id: 'iso-editor-collab-caret-' + id,
- class: classnames({
- 'is-collapsed': isCollapsed,
- 'is-shifted': isShifted
- }),
- title: label,
- style: `--iso-editor-collab-caret-color: ${color || '#2e3d48'}`
- }
- }, start, end);
- });
- return record;
-}
-const getCarets = memoize((peers, richTextIdentifier, blockClientId) => {
- return Object.entries(peers).filter(([, peer]) => {
- var _peer$start, _peer$end;
-
- return (peer === null || peer === void 0 ? void 0 : (_peer$start = peer.start) === null || _peer$start === void 0 ? void 0 : _peer$start.clientId) === blockClientId && (peer === null || peer === void 0 ? void 0 : (_peer$end = peer.end) === null || _peer$end === void 0 ? void 0 : _peer$end.clientId) === blockClientId && peer.start.attributeKey === richTextIdentifier;
- }).map(([id, peer]) => ({
- id,
- label: peer.name,
- start: peer.start.offset,
- end: peer.end.offset,
- color: peer.color
- }));
-});
-export const settings = {
- title: 'Collaboration peer caret',
- tagName: 'mark',
- className: 'iso-editor-collab-caret',
- attributes: {
- id: 'id',
- className: 'class'
- },
-
- edit() {
- return null;
- },
-
- __experimentalGetPropsForEditableTreePreparation(select, {
- richTextIdentifier,
- blockClientId
- }) {
- return {
- carets: getCarets(select('isolated/editor').getPeers(), richTextIdentifier, blockClientId)
- };
- },
-
- __experimentalCreatePrepareEditableTree({
- carets
- }) {
- return (formats, text) => {
- if (!(carets !== null && carets !== void 0 && carets.length)) {
- return formats;
- }
-
- let record = {
- formats,
- text
- };
- record = applyCarets(record, carets);
- return record.formats;
- };
- }
-
-};
-export const registerFormatCollabCaret = () => {
- registerFormatType(FORMAT_NAME, settings);
-};
-//# sourceMappingURL=index.js.map
\ No newline at end of file
diff --git a/build-module/components/formats/collab-caret/index.js.map b/build-module/components/formats/collab-caret/index.js.map
deleted file mode 100644
index d0df41240..000000000
--- a/build-module/components/formats/collab-caret/index.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"sources":["../../../../src/components/formats/collab-caret/index.js"],"names":["memoize","classnames","applyFormat","registerFormatType","FORMAT_NAME","applyCarets","record","carets","forEach","caret","start","end","id","color","label","isCollapsed","isShifted","text","length","type","attributes","class","title","style","getCarets","peers","richTextIdentifier","blockClientId","Object","entries","filter","peer","clientId","attributeKey","map","name","offset","settings","tagName","className","edit","__experimentalGetPropsForEditableTreePreparation","select","getPeers","__experimentalCreatePrepareEditableTree","formats","registerFormatCollabCaret"],"mappings":"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","sourcesContent":["/**\n * External dependencies\n */\nimport memoize from 'memize';\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { applyFormat, registerFormatType } from '@wordpress/rich-text';\n\n/**\n * Internal dependencies\n */\nimport './style.scss';\n\nconst FORMAT_NAME = 'isolated/collab-caret';\n\n/**\n * Applies given carets to the given record.\n *\n * @param {Object} record The record to apply carets to.\n * @param {Array} carets The carets to apply.\n * @return {Object} A record with the carets applied.\n */\nexport function applyCarets( record, carets = [] ) {\n\tcarets.forEach( ( caret ) => {\n\t\tlet { start, end, id, color, label } = caret;\n\t\tconst isCollapsed = start === end;\n\t\tconst isShifted = isCollapsed && end >= record.text.length;\n\n\t\tif ( isShifted ) {\n\t\t\tstart = record.text.length - 1;\n\t\t}\n\n\t\tif ( isCollapsed ) {\n\t\t\tend = start + 1;\n\t\t}\n\n\t\trecord = applyFormat(\n\t\t\trecord,\n\t\t\t{\n\t\t\t\ttype: FORMAT_NAME,\n\t\t\t\tattributes: {\n\t\t\t\t\tid: 'iso-editor-collab-caret-' + id,\n\t\t\t\t\tclass: classnames( {\n\t\t\t\t\t\t'is-collapsed': isCollapsed,\n\t\t\t\t\t\t'is-shifted': isShifted,\n\t\t\t\t\t} ),\n\t\t\t\t\ttitle: label,\n\t\t\t\t\tstyle: `--iso-editor-collab-caret-color: ${ color || '#2e3d48' }`,\n\t\t\t\t},\n\t\t\t},\n\t\t\tstart,\n\t\t\tend\n\t\t);\n\t} );\n\n\treturn record;\n}\n\nconst getCarets = memoize( ( peers, richTextIdentifier, blockClientId ) => {\n\treturn Object.entries( peers )\n\t\t.filter( ( [ , peer ] ) => {\n\t\t\treturn (\n\t\t\t\tpeer?.start?.clientId === blockClientId &&\n\t\t\t\tpeer?.end?.clientId === blockClientId &&\n\t\t\t\tpeer.start.attributeKey === richTextIdentifier\n\t\t\t);\n\t\t} )\n\t\t.map( ( [ id, peer ] ) => ( {\n\t\t\tid,\n\t\t\tlabel: peer.name,\n\t\t\tstart: peer.start.offset,\n\t\t\tend: peer.end.offset,\n\t\t\tcolor: peer.color,\n\t\t} ) );\n} );\n\nexport const settings = {\n\ttitle: 'Collaboration peer caret',\n\ttagName: 'mark',\n\tclassName: 'iso-editor-collab-caret',\n\tattributes: {\n\t\tid: 'id',\n\t\tclassName: 'class',\n\t},\n\tedit() {\n\t\treturn null;\n\t},\n\t__experimentalGetPropsForEditableTreePreparation( select, { richTextIdentifier, blockClientId } ) {\n\t\treturn {\n\t\t\tcarets: getCarets( select( 'isolated/editor' ).getPeers(), richTextIdentifier, blockClientId ),\n\t\t};\n\t},\n\t__experimentalCreatePrepareEditableTree( { carets } ) {\n\t\treturn ( formats, text ) => {\n\t\t\tif ( ! carets?.length ) {\n\t\t\t\treturn formats;\n\t\t\t}\n\n\t\t\tlet record = { formats, text };\n\t\t\trecord = applyCarets( record, carets );\n\t\t\treturn record.formats;\n\t\t};\n\t},\n};\n\nexport const registerFormatCollabCaret = () => {\n\tregisterFormatType( FORMAT_NAME, settings );\n};\n"],"file":"index.js"}
\ No newline at end of file
diff --git a/build-module/components/formats/collab-caret/style.scss b/build-module/components/formats/collab-caret/style.scss
deleted file mode 100644
index 5969efcfa..000000000
--- a/build-module/components/formats/collab-caret/style.scss
+++ /dev/null
@@ -1,48 +0,0 @@
-mark.iso-editor-collab-caret {
- position: relative;
- background: #eee;
- color: currentColor;
-}
-
-mark.iso-editor-collab-caret.is-collapsed {
- background: none;
-}
-
-mark.iso-editor-collab-caret::before {
- left: -1px;
- top: 0;
- bottom: 0;
- position: absolute;
- content: '';
- font-size: 1em;
- width: 2px;
- background: var( --iso-editor-collab-caret-color );
-}
-
-mark.iso-editor-collab-caret.is-shifted::before {
- left: auto;
- right: -1px;
-}
-
-mark.iso-editor-collab-caret::after {
- position: absolute;
- top: -14px;
- right: -4px;
- overflow: hidden;
- min-width: 8px;
- max-width: 140px;
- text-overflow: ellipsis;
- min-height: 8px;
- padding: 2px 4px 3px;
- content: attr( title ); // identity
- color: white;
- vertical-align: top;
- font-size: 10px;
- line-height: 1;
- white-space: nowrap;
- background: var( --iso-editor-collab-caret-color );
-
- // Ensure that bold/italic isn't inherited from the editor selection
- font-style: normal;
- font-weight: normal;
-}
diff --git a/build-module/store/peers/reducer.js b/build-module/store/peers/reducer.js
index f2a6d8fac..7afc11dea 100644
--- a/build-module/store/peers/reducer.js
+++ b/build-module/store/peers/reducer.js
@@ -18,11 +18,13 @@ const reducer = (state = {}, action) => {
return action.peers.reduce((acc, {
id,
name,
- color
+ color,
+ avatarUrl
}) => {
acc[id] = state[id] || {
name,
- color
+ color,
+ avatarUrl
};
return acc;
}, {});
diff --git a/build-module/store/peers/reducer.js.map b/build-module/store/peers/reducer.js.map
index 50f14dd85..79b464c39 100644
--- a/build-module/store/peers/reducer.js.map
+++ b/build-module/store/peers/reducer.js.map
@@ -1 +1 @@
-{"version":3,"sources":["../../../src/store/peers/reducer.js"],"names":["reducer","state","action","type","peerId","selection","peers","reduce","acc","id","name","color"],"mappings":"AAAA,MAAMA,OAAO,GAAG,CAAEC,KAAK,GAAG,EAAV,EAAcC,MAAd,KAA0B;AACzC,UAASA,MAAM,CAACC,IAAhB;AACC,SAAK,oBAAL;AAA2B;AAC1B,YAAK,CAAEF,KAAK,CAAEC,MAAM,CAACE,MAAT,CAAZ,EAAgC;AAC/B,iBAAOH,KAAP;AACA;;AACD,eAAO,EACN,GAAGA,KADG;AAEN,WAAEC,MAAM,CAACE,MAAT,GAAmB,EAClB,GAAGH,KAAK,CAAEC,MAAM,CAACE,MAAT,CADU;AAElB,eAAGF,MAAM,CAACG;AAFQ;AAFb,SAAP;AAOA;;AAED,SAAK,qBAAL;AAA4B;AAC3B,eAAOH,MAAM,CAACI,KAAP,CAAaC,MAAb,CAAqB,CAAEC,GAAF,EAAO;AAAEC,UAAAA,EAAF;AAAMC,UAAAA,IAAN;AAAYC,UAAAA;AAAZ,SAAP,KAAgC;AAC3DH,UAAAA,GAAG,CAAEC,EAAF,CAAH,GAAYR,KAAK,CAAEQ,EAAF,CAAL,IAAe;AAAEC,YAAAA,IAAF;AAAQC,YAAAA;AAAR,WAA3B;AACA,iBAAOH,GAAP;AACA,SAHM,EAGJ,EAHI,CAAP;AAIA;AAnBF;;AAsBA,SAAOP,KAAP;AACA,CAxBD;;AA0BA,eAAeD,OAAf","sourcesContent":["const reducer = ( state = {}, action ) => {\n\tswitch ( action.type ) {\n\t\tcase 'SET_PEER_SELECTION': {\n\t\t\tif ( ! state[ action.peerId ] ) {\n\t\t\t\treturn state;\n\t\t\t}\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\t[ action.peerId ]: {\n\t\t\t\t\t...state[ action.peerId ],\n\t\t\t\t\t...action.selection,\n\t\t\t\t},\n\t\t\t};\n\t\t}\n\n\t\tcase 'SET_AVAILABLE_PEERS': {\n\t\t\treturn action.peers.reduce( ( acc, { id, name, color } ) => {\n\t\t\t\tacc[ id ] = state[ id ] || { name, color };\n\t\t\t\treturn acc;\n\t\t\t}, {} );\n\t\t}\n\t}\n\n\treturn state;\n};\n\nexport default reducer;\n"],"file":"reducer.js"}
\ No newline at end of file
+{"version":3,"sources":["../../../src/store/peers/reducer.js"],"names":["reducer","state","action","type","peerId","selection","peers","reduce","acc","id","name","color","avatarUrl"],"mappings":"AAAA,MAAMA,OAAO,GAAG,CAAEC,KAAK,GAAG,EAAV,EAAcC,MAAd,KAA0B;AACzC,UAASA,MAAM,CAACC,IAAhB;AACC,SAAK,oBAAL;AAA2B;AAC1B,YAAK,CAAEF,KAAK,CAAEC,MAAM,CAACE,MAAT,CAAZ,EAAgC;AAC/B,iBAAOH,KAAP;AACA;;AACD,eAAO,EACN,GAAGA,KADG;AAEN,WAAEC,MAAM,CAACE,MAAT,GAAmB,EAClB,GAAGH,KAAK,CAAEC,MAAM,CAACE,MAAT,CADU;AAElB,eAAGF,MAAM,CAACG;AAFQ;AAFb,SAAP;AAOA;;AAED,SAAK,qBAAL;AAA4B;AAC3B,eAAOH,MAAM,CAACI,KAAP,CAAaC,MAAb,CAAqB,CAAEC,GAAF,EAAO;AAAEC,UAAAA,EAAF;AAAMC,UAAAA,IAAN;AAAYC,UAAAA,KAAZ;AAAmBC,UAAAA;AAAnB,SAAP,KAA2C;AACtEJ,UAAAA,GAAG,CAAEC,EAAF,CAAH,GAAYR,KAAK,CAAEQ,EAAF,CAAL,IAAe;AAAEC,YAAAA,IAAF;AAAQC,YAAAA,KAAR;AAAeC,YAAAA;AAAf,WAA3B;AACA,iBAAOJ,GAAP;AACA,SAHM,EAGJ,EAHI,CAAP;AAIA;AAnBF;;AAsBA,SAAOP,KAAP;AACA,CAxBD;;AA0BA,eAAeD,OAAf","sourcesContent":["const reducer = ( state = {}, action ) => {\n\tswitch ( action.type ) {\n\t\tcase 'SET_PEER_SELECTION': {\n\t\t\tif ( ! state[ action.peerId ] ) {\n\t\t\t\treturn state;\n\t\t\t}\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\t[ action.peerId ]: {\n\t\t\t\t\t...state[ action.peerId ],\n\t\t\t\t\t...action.selection,\n\t\t\t\t},\n\t\t\t};\n\t\t}\n\n\t\tcase 'SET_AVAILABLE_PEERS': {\n\t\t\treturn action.peers.reduce( ( acc, { id, name, color, avatarUrl } ) => {\n\t\t\t\tacc[ id ] = state[ id ] || { name, color, avatarUrl };\n\t\t\t\treturn acc;\n\t\t\t}, {} );\n\t\t}\n\t}\n\n\treturn state;\n};\n\nexport default reducer;\n"],"file":"reducer.js"}
\ No newline at end of file
diff --git a/build-types/components/block-editor-contents/use-yjs/algorithms/yjs.d.ts b/build-types/components/block-editor-contents/use-yjs/algorithms/yjs.d.ts
deleted file mode 100644
index 23afd9229..000000000
--- a/build-types/components/block-editor-contents/use-yjs/algorithms/yjs.d.ts
+++ /dev/null
@@ -1,53 +0,0 @@
-/**
- * Updates the block doc with the local blocks block changes.
- *
- * @param {yjs.Map} yDocBlocks Blocks doc.
- * @param {Array} blocks Updated blocks.
- * @param {string} clientId Current clientId.
- */
-export function updateBlocksDoc(yDocBlocks: yjs.Map, blocks: any[], clientId?: string): void;
-/**
- * Updates the comments doc with the local comments changes.
- *
- * @param {yjs.Doc} commentsDoc comments doc.
- * @param {Object} comments Updated comments.
- */
-export function updateCommentsDoc(commentsDoc: yjs.Doc, comments?: any): void;
-/**
- * Updates the replies doc with the local replies changes.
- *
- * @param {yjs.Doc} repliesDoc replies doc.
- * @param {Object} replies Updated replies.
- */
-export function updateCommentRepliesDoc(repliesDoc: yjs.Doc, replies?: any): void;
-/**
- * Updates the post doc with the local post changes.
- *
- * @param {yjs.Doc} doc Shared doc.
- * @param {Object} newPost Updated post.
- */
-export function updatePostDoc(doc: yjs.Doc, newPost: any): void;
-/**
- * Converts the comments doc into a comment list.
- *
- * @param {yjs.Map} commentsDoc Comments doc.
- * @return {Array} Comment list.
- */
-export function commentsDocToArray(commentsDoc: yjs.Map): any[];
-/**
- * Converts the block doc into a block list.
- *
- * @param {yjs.Map} yDocBlocks Block doc.
- * @param {string} clientId Current block clientId.
- * @return {Array} Block list.
- */
-export function blocksDocToArray(yDocBlocks: yjs.Map, clientId?: string): any[];
-/**
- * Converts the post doc into a post object.
- *
- * @param {yjs.Map} doc Shared doc.
- * @return {Object} Post object.
- */
-export function postDocToObject(doc: yjs.Map): any;
-import * as yjs from "yjs";
-//# sourceMappingURL=yjs.d.ts.map
\ No newline at end of file
diff --git a/build-types/components/block-editor-contents/use-yjs/algorithms/yjs.d.ts.map b/build-types/components/block-editor-contents/use-yjs/algorithms/yjs.d.ts.map
deleted file mode 100644
index 45367f986..000000000
--- a/build-types/components/block-editor-contents/use-yjs/algorithms/yjs.d.ts.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"yjs.d.ts","sourceRoot":"","sources":["../../../../../src/components/block-editor-contents/use-yjs/algorithms/yjs.js"],"names":[],"mappings":"AAmCA;;;;;;GAMG;AACH,oFAFW,MAAM,QAuChB;AAED;;;;;GAKG;AACH,+CAHW,IAAI,GAAG,wBAiCjB;AAED;;;;;GAKG;AACH,oDAHW,IAAI,GAAG,uBAsBjB;AAED;;;;;GAKG;AACH,mCAHW,IAAI,GAAG,sBAgBjB;AAED;;;;;GAKG;AACH,qEA+BC;AAED;;;;;;GAMG;AACH,sEAHW,MAAM,SAgBhB;AAED;;;;;GAKG;AACH,wDAUC"}
\ No newline at end of file
diff --git a/build-types/components/block-editor-contents/use-yjs/filters/block-selection/index.d.ts b/build-types/components/block-editor-contents/use-yjs/filters/block-selection/index.d.ts
deleted file mode 100644
index 164d4a7da..000000000
--- a/build-types/components/block-editor-contents/use-yjs/filters/block-selection/index.d.ts
+++ /dev/null
@@ -1,2 +0,0 @@
-export function addFilterCollabBlockSelection(): void;
-//# sourceMappingURL=index.d.ts.map
\ No newline at end of file
diff --git a/build-types/components/block-editor-contents/use-yjs/filters/block-selection/index.d.ts.map b/build-types/components/block-editor-contents/use-yjs/filters/block-selection/index.d.ts.map
deleted file mode 100644
index 01b4355b9..000000000
--- a/build-types/components/block-editor-contents/use-yjs/filters/block-selection/index.d.ts.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/block-editor-contents/use-yjs/filters/block-selection/index.js"],"names":[],"mappings":"AAkCO,sDAEN"}
\ No newline at end of file
diff --git a/build-types/components/block-editor-contents/use-yjs/filters/index.d.ts b/build-types/components/block-editor-contents/use-yjs/filters/index.d.ts
deleted file mode 100644
index d80be1127..000000000
--- a/build-types/components/block-editor-contents/use-yjs/filters/index.d.ts
+++ /dev/null
@@ -1,2 +0,0 @@
-export function addCollabFilters(): void;
-//# sourceMappingURL=index.d.ts.map
\ No newline at end of file
diff --git a/build-types/components/block-editor-contents/use-yjs/filters/index.d.ts.map b/build-types/components/block-editor-contents/use-yjs/filters/index.d.ts.map
deleted file mode 100644
index da7e91d79..000000000
--- a/build-types/components/block-editor-contents/use-yjs/filters/index.d.ts.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/block-editor-contents/use-yjs/filters/index.js"],"names":[],"mappings":"AAEO,yCAEN"}
\ No newline at end of file
diff --git a/build-types/components/block-editor-contents/use-yjs/formats/collab-caret/index.d.ts b/build-types/components/block-editor-contents/use-yjs/formats/collab-caret/index.d.ts
deleted file mode 100644
index 678f56529..000000000
--- a/build-types/components/block-editor-contents/use-yjs/formats/collab-caret/index.d.ts
+++ /dev/null
@@ -1,52 +0,0 @@
-/**
- * Applies given carets to the given record.
- *
- * @param {Object} record The record to apply carets to.
- * @param {Array} carets The carets to apply.
- * @return {Object} A record with the carets applied.
- */
-export function applyCarets(record: any, carets?: any[]): any;
-export namespace settings {
- const title: string;
- const tagName: string;
- const className: string;
- namespace attributes {
- export const id: string;
- const className_1: string;
- export { className_1 as className };
- }
- function edit(): null;
- function edit(): null;
- function __experimentalGetPropsForEditableTreePreparation(select: any, { richTextIdentifier, blockClientId }: {
- richTextIdentifier: any;
- blockClientId: any;
- }): {
- carets: {
- id: string;
- label: any;
- start: any;
- end: any;
- color: any;
- }[];
- };
- function __experimentalGetPropsForEditableTreePreparation(select: any, { richTextIdentifier, blockClientId }: {
- richTextIdentifier: any;
- blockClientId: any;
- }): {
- carets: {
- id: string;
- label: any;
- start: any;
- end: any;
- color: any;
- }[];
- };
- function __experimentalCreatePrepareEditableTree({ carets }: {
- carets: any;
- }): (formats: any, text: any) => any;
- function __experimentalCreatePrepareEditableTree({ carets }: {
- carets: any;
- }): (formats: any, text: any) => any;
-}
-export function registerFormatCollabCaret(): void;
-//# sourceMappingURL=index.d.ts.map
\ No newline at end of file
diff --git a/build-types/components/block-editor-contents/use-yjs/formats/collab-caret/index.d.ts.map b/build-types/components/block-editor-contents/use-yjs/formats/collab-caret/index.d.ts.map
deleted file mode 100644
index 69f0a26f1..000000000
--- a/build-types/components/block-editor-contents/use-yjs/formats/collab-caret/index.d.ts.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/block-editor-contents/use-yjs/formats/collab-caret/index.js"],"names":[],"mappings":"AAkBA;;;;;;GAMG;AACH,8DAkCC;;;;;;;;;;IA4BA,sBAEC;IAFD,sBAEC;IACD;;;;;;;;;;;MAIC;IAJD;;;;;;;;;;;MAIC;IACD;;yCAUC;IAVD;;yCAUC;;AAGK,kDAEN"}
\ No newline at end of file
diff --git a/build-types/components/block-editor-contents/use-yjs/formats/index.d.ts b/build-types/components/block-editor-contents/use-yjs/formats/index.d.ts
deleted file mode 100644
index 8cc184ed5..000000000
--- a/build-types/components/block-editor-contents/use-yjs/formats/index.d.ts
+++ /dev/null
@@ -1,2 +0,0 @@
-export function registerCollabFormats(): void;
-//# sourceMappingURL=index.d.ts.map
\ No newline at end of file
diff --git a/build-types/components/block-editor-contents/use-yjs/formats/index.d.ts.map b/build-types/components/block-editor-contents/use-yjs/formats/index.d.ts.map
deleted file mode 100644
index a7a9abf64..000000000
--- a/build-types/components/block-editor-contents/use-yjs/formats/index.d.ts.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/block-editor-contents/use-yjs/formats/index.js"],"names":[],"mappings":"AAEO,8CAEN"}
\ No newline at end of file
diff --git a/build-types/components/block-editor-contents/use-yjs/index.d.ts b/build-types/components/block-editor-contents/use-yjs/index.d.ts
deleted file mode 100644
index 894cf0b6d..000000000
--- a/build-types/components/block-editor-contents/use-yjs/index.d.ts
+++ /dev/null
@@ -1,22 +0,0 @@
-/**
- * @param {object} opts - Hook options
- * @param {object[]} opts.blocks
- * @param {OnUpdate} opts.onRemoteDataChange
- * @param {CollaborationSettings} [opts.settings]
- */
-export default function useYjs({ blocks, onRemoteDataChange, settings }: {
- blocks: object[];
- onRemoteDataChange: OnUpdate;
- settings?: import("../../..").CollaborationSettings | undefined;
-}): void;
-export type IsoEditorSelection = {
- selectionStart: object;
- selectionEnd: object;
-};
-export type CollaborationSettings = import('../../..').CollaborationSettings;
-export type CollaborationTransport = import('../../..').CollaborationTransport;
-export type CollaborationTransportDocMessage = import('../../..').CollaborationTransportDocMessage;
-export type CollaborationTransportSelectionMessage = import('../../..').CollaborationTransportSelectionMessage;
-export type EditorSelection = import('../../..').EditorSelection;
-export type OnUpdate = import('..').OnUpdate;
-//# sourceMappingURL=index.d.ts.map
\ No newline at end of file
diff --git a/build-types/components/block-editor-contents/use-yjs/index.d.ts.map b/build-types/components/block-editor-contents/use-yjs/index.d.ts.map
deleted file mode 100644
index 8ae9f4933..000000000
--- a/build-types/components/block-editor-contents/use-yjs/index.d.ts.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/block-editor-contents/use-yjs/index.js"],"names":[],"mappings":"AA6IA;;;;;GAKG;AACH;IAJ0B,MAAM,EAArB,MAAM,EAAE;IACO,kBAAkB,EAAjC,QAAQ;IACqB,QAAQ;SA4D/C;;oBApKa,MAAM;kBACN,MAAM;;oCApBN,OAAO,UAAU,EAAE,qBAAqB;qCACxC,OAAO,UAAU,EAAE,sBAAsB;+CACzC,OAAO,UAAU,EAAE,gCAAgC;qDACnD,OAAO,UAAU,EAAE,sCAAsC;8BACzD,OAAO,UAAU,EAAE,eAAe;uBAClC,OAAO,IAAI,EAAE,QAAQ"}
\ No newline at end of file
diff --git a/build-types/components/block-editor-contents/use-yjs/yjs-doc.d.ts b/build-types/components/block-editor-contents/use-yjs/yjs-doc.d.ts
deleted file mode 100644
index 7655e1ce0..000000000
--- a/build-types/components/block-editor-contents/use-yjs/yjs-doc.d.ts
+++ /dev/null
@@ -1,21 +0,0 @@
-export function createDocument({ identity, applyDataChanges, getData, sendMessage, }: {
- identity: any;
- applyDataChanges: any;
- getData: any;
- sendMessage: any;
-}): {
- applyDataChanges(data: any): void;
- connect(): void;
- disconnect(): void;
- startSharing(data: any): void;
- receiveMessage({ protocol, messageType, origin, ...content }: {
- [x: string]: any;
- protocol: any;
- messageType: any;
- origin: any;
- }): void;
- onRemoteDataChange(listener: any): () => void;
- onStateChange(listener: any): () => void;
- getState(): string;
-};
-//# sourceMappingURL=yjs-doc.d.ts.map
\ No newline at end of file
diff --git a/build-types/components/block-editor-contents/use-yjs/yjs-doc.d.ts.map b/build-types/components/block-editor-contents/use-yjs/yjs-doc.d.ts.map
deleted file mode 100644
index 75ce7a4c1..000000000
--- a/build-types/components/block-editor-contents/use-yjs/yjs-doc.d.ts.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"yjs-doc.d.ts","sourceRoot":"","sources":["../../../../src/components/block-editor-contents/use-yjs/yjs-doc.js"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;;;;;;EAkJC"}
\ No newline at end of file
diff --git a/build-types/components/collaborative-editing/components/avatars/Avatars.stories.d.ts b/build-types/components/collaborative-editing/components/avatars/Avatars.stories.d.ts
new file mode 100644
index 000000000..f5a63e35a
--- /dev/null
+++ b/build-types/components/collaborative-editing/components/avatars/Avatars.stories.d.ts
@@ -0,0 +1,21 @@
+import { CollaborativeEditingAvatars } from '.';
+import type { Story } from '@storybook/react';
+declare const _default: {
+ title: string;
+ component: typeof CollaborativeEditingAvatars;
+};
+export default _default;
+declare type Props = {
+ peerCount: number;
+};
+export declare const Default: Story;
+export declare const Empty: Story;
+export declare const NoImage: {
+ (args: any): JSX.Element;
+ args: {
+ id: number;
+ name: string;
+ color: string | undefined;
+ };
+};
+//# sourceMappingURL=Avatars.stories.d.ts.map
\ No newline at end of file
diff --git a/build-types/components/collaborative-editing/components/avatars/Avatars.stories.d.ts.map b/build-types/components/collaborative-editing/components/avatars/Avatars.stories.d.ts.map
new file mode 100644
index 000000000..d2a6e9d97
--- /dev/null
+++ b/build-types/components/collaborative-editing/components/avatars/Avatars.stories.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"Avatars.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/collaborative-editing/components/avatars/Avatars.stories.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,2BAA2B,EAA8B,MAAM,GAAG,CAAC;AAG5E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;;;;;AAE9C,wBAGE;AAaF,aAAK,KAAK,GAAG;IACZ,SAAS,EAAE,MAAM,CAAC;CAClB,CAAC;AAMF,eAAO,MAAM,OAAO,cAAsB,CAAC;AAK3C,eAAO,MAAM,KAAK,cAAsB,CAAC;AAKzC,eAAO,MAAM,OAAO;;;;;;;CAEnB,CAAC"}
\ No newline at end of file
diff --git a/build-types/components/collaborative-editing/components/avatars/index.d.ts b/build-types/components/collaborative-editing/components/avatars/index.d.ts
new file mode 100644
index 000000000..34ce38b4f
--- /dev/null
+++ b/build-types/components/collaborative-editing/components/avatars/index.d.ts
@@ -0,0 +1,16 @@
+/**
+ * @param {object} props
+ * @param {import("../..").AvailablePeer[]} props.peers
+ */
+export function CollaborativeEditingAvatars({ peers }: {
+ peers: import("../..").AvailablePeer[];
+}): JSX.Element;
+export function CollaborativeEditingAvatar({ peer }: {
+ peer: any;
+}): JSX.Element;
+export function CollaborativeEditingAvatarsOverflow({ peers }: {
+ peers: any;
+}): JSX.Element;
+declare var _default: any;
+export default _default;
+//# sourceMappingURL=index.d.ts.map
\ No newline at end of file
diff --git a/build-types/components/collaborative-editing/components/avatars/index.d.ts.map b/build-types/components/collaborative-editing/components/avatars/index.d.ts.map
new file mode 100644
index 000000000..9ee480549
--- /dev/null
+++ b/build-types/components/collaborative-editing/components/avatars/index.d.ts.map
@@ -0,0 +1 @@
+{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/collaborative-editing/components/avatars/index.js"],"names":[],"mappings":"AAUA;;;GAGG;AACH;IAFkD,KAAK,EAA5C,OAAO,OAAO,EAAE,aAAa,EAAE;gBAkBzC;AAED;;gBA0BC;AAED;;gBA8CC"}
\ No newline at end of file
diff --git a/build-types/components/collaborative-editing/index.d.ts b/build-types/components/collaborative-editing/index.d.ts
index 7e5914234..e60b46efb 100644
--- a/build-types/components/collaborative-editing/index.d.ts
+++ b/build-types/components/collaborative-editing/index.d.ts
@@ -16,6 +16,10 @@ export type CollaborationSettings = {
* Color of the caret indicator displayed to peers. If unspecified, a random color will be selected.
*/
caretColor?: string | undefined;
+ /**
+ * Url of the avatar image diplayed to peers.
+ */
+ avatarUrl?: string | undefined;
/**
* Required if collab is enabled.
*/
@@ -38,6 +42,7 @@ export type CollaborationTransportConnectOpts = {
user: {
identity: string;
name: string;
+ avatarUrl?: string | undefined;
color?: string | undefined;
};
/**
@@ -57,6 +62,7 @@ export type AvailablePeer = {
id: string;
name: string;
color: string;
+ avatarUrl?: string | undefined;
};
/**
* Transport module for real-time collaboration
@@ -88,6 +94,7 @@ export type EditorSelection = {
* @property {string} [channelId] Optional channel id to pass to transport.connect().
* @property {string} username Name displayed to peers. Required if collab is enabled.
* @property {string} [caretColor] Color of the caret indicator displayed to peers. If unspecified, a random color will be selected.
+ * @property {string} [avatarUrl] Url of the avatar image diplayed to peers.
* @property {CollaborationTransport} transport Required if collab is enabled.
*/
/**
@@ -101,6 +108,7 @@ export type EditorSelection = {
* @property {object} user
* @property {string} user.identity
* @property {string} user.name
+ * @property {string} [user.avatarUrl]
* @property {string} [user.color] Color of the caret indicator displayed to peers.
* @property {(message: object) => void} onReceiveMessage Callback to run when a message is received.
* @property {(peers: AvailablePeer[]) => void} setAvailablePeers Callback to run when peers change.
@@ -110,6 +118,7 @@ export type EditorSelection = {
* @property {string} id
* @property {string} name
* @property {string} color
+ * @property {string} [avatarUrl]
*
* @typedef CollaborationTransportDocMessage
* @property {string} identity
@@ -131,5 +140,5 @@ export type EditorSelection = {
*/
declare function CollaborativeEditing({ settings }: {
settings: CollaborationSettings;
-}): null;
+}): JSX.Element;
//# sourceMappingURL=index.d.ts.map
\ No newline at end of file
diff --git a/build-types/components/collaborative-editing/index.d.ts.map b/build-types/components/collaborative-editing/index.d.ts.map
index 31016b529..7b89e8763 100644
--- a/build-types/components/collaborative-editing/index.d.ts.map
+++ b/build-types/components/collaborative-editing/index.d.ts.map
@@ -1 +1 @@
-{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/collaborative-editing/index.js"],"names":[],"mappings":";;;;;aAQc,OAAO;;;;;;;;cAEP,MAAM;;;;;;;;eAEN,sBAAsB;;;;;;2BAMZ,gCAAgC,GAAC,sCAAsC,KAAK,IAAI;uBAChF,iCAAiC,KAAK,QAAQ;QAAC,gBAAgB,EAAE,OAAO,CAAA;KAAC,CAAC;gBACpF,MAAM,QAAQ,IAAI,CAAC;;;;;;;QAIN,QAAQ,EAArB,MAAM;QACO,IAAI,EAAjB,MAAM;QACQ,KAAK;;;;;gCACT,MAAM,KAAK,IAAI;;;;+BACjB,aAAa,EAAE,KAAK,IAAI;;;;;;;QAIhC,MAAM;UACN,MAAM;WACN,MAAM;;;;;;cAGN,MAAM;UACN,KAAK;aACL,MAAM;;;;;;cAGN,MAAM;UACN,WAAW;eACX,eAAe;;;;;;WAGf,MAAM;SACN,MAAM;;AA3CpB;;;;;;;;GAQG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAEH;;;GAGG;AACH;IAFwC,QAAQ,EAArC,qBAAqB;SAQ/B"}
\ No newline at end of file
+{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/collaborative-editing/index.js"],"names":[],"mappings":";;;;;aAUc,OAAO;;;;;;;;cAEP,MAAM;;;;;;;;;;;;eAGN,sBAAsB;;;;;;2BAMZ,gCAAgC,GAAC,sCAAsC,KAAK,IAAI;uBAChF,iCAAiC,KAAK,QAAQ;QAAC,gBAAgB,EAAE,OAAO,CAAA;KAAC,CAAC;gBACpF,MAAM,QAAQ,IAAI,CAAC;;;;;;;QAIN,QAAQ,EAArB,MAAM;QACO,IAAI,EAAjB,MAAM;QACQ,SAAS;QACT,KAAK;;;;;gCACT,MAAM,KAAK,IAAI;;;;+BACjB,aAAa,EAAE,KAAK,IAAI;;;;;;;QAIhC,MAAM;UACN,MAAM;WACN,MAAM;;;;;;;cAIN,MAAM;UACN,KAAK;aACL,MAAM;;;;;;cAGN,MAAM;UACN,WAAW;eACX,eAAe;;;;;;WAGf,MAAM;SACN,MAAM;;AA9CpB;;;;;;;;;GASG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAEH;;;GAGG;AACH;IAFwC,QAAQ,EAArC,qBAAqB;gBAY/B"}
\ No newline at end of file
diff --git a/build-types/components/collaborative-editing/use-yjs/index.d.ts b/build-types/components/collaborative-editing/use-yjs/index.d.ts
index 53fbb6e9b..33a020d49 100644
--- a/build-types/components/collaborative-editing/use-yjs/index.d.ts
+++ b/build-types/components/collaborative-editing/use-yjs/index.d.ts
@@ -5,6 +5,13 @@
export default function useYjs({ settings }: {
settings?: import("..").CollaborationSettings | undefined;
}): void;
+/** @typedef {import('..').CollaborationSettings} CollaborationSettings */
+/** @typedef {import('..').CollaborationTransport} CollaborationTransport */
+/** @typedef {import('..').CollaborationTransportDocMessage} CollaborationTransportDocMessage */
+/** @typedef {import('..').CollaborationTransportSelectionMessage} CollaborationTransportSelectionMessage */
+/** @typedef {import('..').EditorSelection} EditorSelection */
+/** @typedef {import('../../block-editor-contents').OnUpdate} OnUpdate */
+export const defaultColors: string[];
export type IsoEditorSelection = {
selectionStart: object;
selectionEnd: object;
diff --git a/build-types/components/collaborative-editing/use-yjs/index.d.ts.map b/build-types/components/collaborative-editing/use-yjs/index.d.ts.map
index d30ec6f47..33f8bd549 100644
--- a/build-types/components/collaborative-editing/use-yjs/index.d.ts.map
+++ b/build-types/components/collaborative-editing/use-yjs/index.d.ts.map
@@ -1 +1 @@
-{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/collaborative-editing/use-yjs/index.js"],"names":[],"mappings":"AA6IA;;;GAGG;AACH;IAFwC,QAAQ;SA6D/C;;oBAnKa,MAAM;kBACN,MAAM;;oCApBN,OAAO,IAAI,EAAE,qBAAqB;qCAClC,OAAO,IAAI,EAAE,sBAAsB;+CACnC,OAAO,IAAI,EAAE,gCAAgC;qDAC7C,OAAO,IAAI,EAAE,sCAAsC;8BACnD,OAAO,IAAI,EAAE,eAAe;uBAC5B,OAAO,6BAA6B,EAAE,QAAQ"}
\ No newline at end of file
+{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/collaborative-editing/use-yjs/index.js"],"names":[],"mappings":"AA8IA;;;GAGG;AACH;IAFwC,QAAQ;SA6D/C;AAvLD,0EAA0E;AAC1E,4EAA4E;AAC5E,gGAAgG;AAChG,4GAA4G;AAC5G,8DAA8D;AAC9D,yEAAyE;AAEzE,qCAA6G;;oBAY/F,MAAM;kBACN,MAAM;;oCApBN,OAAO,IAAI,EAAE,qBAAqB;qCAClC,OAAO,IAAI,EAAE,sBAAsB;+CACnC,OAAO,IAAI,EAAE,gCAAgC;qDAC7C,OAAO,IAAI,EAAE,sCAAsC;8BACnD,OAAO,IAAI,EAAE,eAAe;uBAC5B,OAAO,6BAA6B,EAAE,QAAQ"}
\ No newline at end of file
diff --git a/build-types/components/formats/collab-caret/index.d.ts b/build-types/components/formats/collab-caret/index.d.ts
deleted file mode 100644
index 678f56529..000000000
--- a/build-types/components/formats/collab-caret/index.d.ts
+++ /dev/null
@@ -1,52 +0,0 @@
-/**
- * Applies given carets to the given record.
- *
- * @param {Object} record The record to apply carets to.
- * @param {Array} carets The carets to apply.
- * @return {Object} A record with the carets applied.
- */
-export function applyCarets(record: any, carets?: any[]): any;
-export namespace settings {
- const title: string;
- const tagName: string;
- const className: string;
- namespace attributes {
- export const id: string;
- const className_1: string;
- export { className_1 as className };
- }
- function edit(): null;
- function edit(): null;
- function __experimentalGetPropsForEditableTreePreparation(select: any, { richTextIdentifier, blockClientId }: {
- richTextIdentifier: any;
- blockClientId: any;
- }): {
- carets: {
- id: string;
- label: any;
- start: any;
- end: any;
- color: any;
- }[];
- };
- function __experimentalGetPropsForEditableTreePreparation(select: any, { richTextIdentifier, blockClientId }: {
- richTextIdentifier: any;
- blockClientId: any;
- }): {
- carets: {
- id: string;
- label: any;
- start: any;
- end: any;
- color: any;
- }[];
- };
- function __experimentalCreatePrepareEditableTree({ carets }: {
- carets: any;
- }): (formats: any, text: any) => any;
- function __experimentalCreatePrepareEditableTree({ carets }: {
- carets: any;
- }): (formats: any, text: any) => any;
-}
-export function registerFormatCollabCaret(): void;
-//# sourceMappingURL=index.d.ts.map
\ No newline at end of file
diff --git a/build-types/components/formats/collab-caret/index.d.ts.map b/build-types/components/formats/collab-caret/index.d.ts.map
deleted file mode 100644
index 258f5571f..000000000
--- a/build-types/components/formats/collab-caret/index.d.ts.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/formats/collab-caret/index.js"],"names":[],"mappings":"AAkBA;;;;;;GAMG;AACH,8DAkCC;;;;;;;;;;IA4BA,sBAEC;IAFD,sBAEC;IACD;;;;;;;;;;;MAIC;IAJD;;;;;;;;;;;MAIC;IACD;;yCAUC;IAVD;;yCAUC;;AAGK,kDAEN"}
\ No newline at end of file
diff --git a/build/components/block-editor-contents/use-yjs/README.md b/build/components/block-editor-contents/use-yjs/README.md
deleted file mode 100644
index 3d09be6f2..000000000
--- a/build/components/block-editor-contents/use-yjs/README.md
+++ /dev/null
@@ -1,19 +0,0 @@
-# Real-time collaborative editing
-
-`useYjs` is an experimental, opt-in React hook that adds support for real-time collaborative editing, powered by the [Yjs](https://github.com/yjs/yjs) CRDT framework. This feature enables multiple peers to simultaneously edit the same content without having to manually resolve any conflicts.
-
-## Implementing a transport module
-
-`useYjs` is transport-agnostic, meaning that it does not care how peers communicate with each other. You will need to implement a compatible transport module that handles the communication between peers, and pass that into `` via the `settings.collab.transport` prop.
-
-In most cases, you would want some kind of WebSocket server or WebRTC signaling server, and implement a transport module to talk to that. However, you could also implement a transport module that only passes messages locally across browser tabs, which is what can be seen in the Storybook demo (run `yarn storybook` to try it).
-
-A `CollaborationTransport` will need to implement the following methods:
-
-- _connect_ `(options: CollaborationTransportConnectOpts) => Promise<{isFirstInChannel: boolean}>` - Join the group of peers, and return whether or not this is the first peer to join. Here you should also set up event handlers to call the provided callbacks whenever messages are received or peers change.
- - _options.user_ `object` - Information about the joined user that should be sent to every peer.
- - _options.onReceiveMessage_ `(message: object) => void` - Callback to be called whenever a message is received from a peer.
- - _options.setAvailablePeers_ `(peers: AvailablePeer[]) => void` - Callback to be called whenever a peer joins or leaves.
- - _options.channelId_ `[string]` - Identifies the group of peers.
-- _sendMessage_ `(message: object) => void` - Send message to peers. A message contains information about content or selection changes.
-- _disconnect_ `() => Promise` - Leave the group of peers. Called when `` unmounts.
\ No newline at end of file
diff --git a/build/components/block-editor-contents/use-yjs/algorithms/yjs.js b/build/components/block-editor-contents/use-yjs/algorithms/yjs.js
deleted file mode 100644
index 37ba9fbce..000000000
--- a/build/components/block-editor-contents/use-yjs/algorithms/yjs.js
+++ /dev/null
@@ -1,306 +0,0 @@
-"use strict";
-
-var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
-
-var _typeof = require("@babel/runtime/helpers/typeof");
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-exports.updateBlocksDoc = updateBlocksDoc;
-exports.updateCommentsDoc = updateCommentsDoc;
-exports.updateCommentRepliesDoc = updateCommentRepliesDoc;
-exports.updatePostDoc = updatePostDoc;
-exports.commentsDocToArray = commentsDocToArray;
-exports.blocksDocToArray = blocksDocToArray;
-exports.postDocToObject = postDocToObject;
-
-var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
-
-var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
-
-var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
-
-var yjs = _interopRequireWildcard(require("yjs"));
-
-var _lodash = require("lodash");
-
-var _excluded = ["innerBlocks"];
-
-function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
-
-function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
-
-function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
-
-function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
-
-function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
-
-function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
-
-function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
-
-/**
- * Returns information for splicing array `a` into array `b`,
- * by swapping the minimum slice of disagreement.
- *
- * @param {Array} a
- * @param {Array} b
- * @return {Object} diff.
- */
-function simpleDiff(a, b) {
- var left = 0;
- var right = 0;
-
- while (left < a.length && left < b.length && a[left] === b[left]) {
- left++;
- }
-
- if (left !== a.length || left !== b.length) {
- while (right + left < a.length && right + left < b.length && a[a.length - right - 1] === b[b.length - right - 1]) {
- right++;
- }
- }
-
- return {
- index: left,
- remove: a.length - left - right,
- insert: b.slice(left, b.length - right)
- };
-}
-/**
- * Updates the block doc with the local blocks block changes.
- *
- * @param {yjs.Map} yDocBlocks Blocks doc.
- * @param {Array} blocks Updated blocks.
- * @param {string} clientId Current clientId.
- */
-
-
-function updateBlocksDoc(yDocBlocks, blocks) {
- var clientId = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
-
- if (!yDocBlocks.has('order')) {
- yDocBlocks.set('order', new yjs.Map());
- }
-
- var order = yDocBlocks.get('order');
- if (!order.has(clientId)) order.set(clientId, new yjs.Array());
- order = order.get(clientId);
-
- if (!yDocBlocks.has('byClientId')) {
- yDocBlocks.set('byClientId', new yjs.Map());
- }
-
- var byClientId = yDocBlocks.get('byClientId');
- var currentOrder = order.toArray();
- var orderDiff = simpleDiff(currentOrder, blocks.map(function (block) {
- return block.clientId;
- }));
- currentOrder.slice(orderDiff.index, orderDiff.remove).forEach(function (_clientId) {
- return !orderDiff.insert.includes(_clientId) && byClientId["delete"](_clientId);
- });
- order["delete"](orderDiff.index, orderDiff.remove);
- order.insert(orderDiff.index, orderDiff.insert);
-
- var _iterator = _createForOfIteratorHelper(blocks),
- _step;
-
- try {
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
- var _block = _step.value;
- var innerBlocks = _block.innerBlocks,
- block = (0, _objectWithoutProperties2["default"])(_block, _excluded);
-
- if (!byClientId.has(block.clientId) || !(0, _lodash.isEqual)(byClientId.get(block.clientId), block)) {
- byClientId.set(block.clientId, block);
- }
-
- updateBlocksDoc(yDocBlocks, innerBlocks, block.clientId);
- }
- } catch (err) {
- _iterator.e(err);
- } finally {
- _iterator.f();
- }
-}
-/**
- * Updates the comments doc with the local comments changes.
- *
- * @param {yjs.Doc} commentsDoc comments doc.
- * @param {Object} comments Updated comments.
- */
-
-
-function updateCommentsDoc(commentsDoc) {
- var comments = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
- comments.forEach(function (comment) {
- var currentDoc = commentsDoc.get(comment._id);
- var isNewDoc = !currentDoc;
-
- if (!currentDoc) {
- commentsDoc.set(comment._id, new yjs.Map());
- }
-
- currentDoc = commentsDoc.get(comment._id); // Update regular fields
-
- ['type', 'content', 'createdAt', 'status', 'start', 'end', 'authorId', 'authorName'].forEach(function (field) {
- if (isNewDoc || currentDoc.get(field) !== comment[field]) {
- currentDoc.set(field, comment[field]);
- }
- });
-
- if (isNewDoc) {
- currentDoc.set('replies', new yjs.Map());
- }
-
- updateCommentRepliesDoc(currentDoc.get('replies'), comment.replies);
- });
-}
-/**
- * Updates the replies doc with the local replies changes.
- *
- * @param {yjs.Doc} repliesDoc replies doc.
- * @param {Object} replies Updated replies.
- */
-
-
-function updateCommentRepliesDoc(repliesDoc) {
- var replies = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
- replies.forEach(function (reply) {
- var currentReplyDoc = repliesDoc.get(reply._id);
- var isNewDoc = !currentReplyDoc;
-
- if (!currentReplyDoc) {
- repliesDoc.set(reply._id, new yjs.Map());
- }
-
- currentReplyDoc = repliesDoc.get(reply._id);
- ['content', 'createdAt', 'authorId', 'authorName'].forEach(function (field) {
- if (isNewDoc || currentReplyDoc.get(field) !== reply[field]) {
- currentReplyDoc.set(field, reply[field]);
- }
- });
- });
-}
-/**
- * Updates the post doc with the local post changes.
- *
- * @param {yjs.Doc} doc Shared doc.
- * @param {Object} newPost Updated post.
- */
-
-
-function updatePostDoc(doc, newPost) {
- var postDoc = doc.get('post', yjs.Map);
-
- if (postDoc.get('title') !== newPost.title) {
- postDoc.set('title', newPost.title);
- }
-
- if (!postDoc.get('blocks', yjs.Map)) {
- postDoc.set('blocks', new yjs.Map());
- }
-
- updateBlocksDoc(postDoc.get('blocks'), newPost.blocks || []);
-
- if (!postDoc.get('comments', yjs.Map)) {
- postDoc.set('comments', new yjs.Map());
- }
-
- updateCommentsDoc(postDoc.get('comments'), newPost.comments);
-}
-/**
- * Converts the comments doc into a comment list.
- *
- * @param {yjs.Map} commentsDoc Comments doc.
- * @return {Array} Comment list.
- */
-
-
-function commentsDocToArray(commentsDoc) {
- if (!commentsDoc) {
- return [];
- }
-
- return Object.entries(commentsDoc.toJSON()).map(function (_ref) {
- var _ref2 = (0, _slicedToArray2["default"])(_ref, 2),
- id = _ref2[0],
- commentDoc = _ref2[1];
-
- return {
- _id: id,
- type: commentDoc.type,
- content: commentDoc.content,
- createdAt: commentDoc.createdAt,
- status: commentDoc.status,
- start: commentDoc.start,
- end: commentDoc.end,
- authorId: commentDoc.authorId,
- authorName: commentDoc.authorName,
- replies: Object.entries(commentDoc.replies).map(function (_ref3) {
- var _ref4 = (0, _slicedToArray2["default"])(_ref3, 2),
- replyId = _ref4[0],
- entryDoc = _ref4[1];
-
- return {
- _id: replyId,
- content: entryDoc.content,
- createdAt: entryDoc.createdAt,
- authorId: entryDoc.authorId,
- authorName: entryDoc.authorName
- };
- }).sort(function (a, b) {
- return a.createdAt - b.createdAt;
- })
- };
- });
-}
-/**
- * Converts the block doc into a block list.
- *
- * @param {yjs.Map} yDocBlocks Block doc.
- * @param {string} clientId Current block clientId.
- * @return {Array} Block list.
- */
-
-
-function blocksDocToArray(yDocBlocks) {
- var _order$get;
-
- var clientId = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
-
- if (!yDocBlocks) {
- return [];
- }
-
- var order = yDocBlocks.get('order');
- order = (_order$get = order.get(clientId)) === null || _order$get === void 0 ? void 0 : _order$get.toArray();
- if (!order) return [];
- var byClientId = yDocBlocks.get('byClientId');
- return order.map(function (_clientId) {
- return _objectSpread(_objectSpread({}, byClientId.get(_clientId)), {}, {
- innerBlocks: blocksDocToArray(yDocBlocks, _clientId)
- });
- });
-}
-/**
- * Converts the post doc into a post object.
- *
- * @param {yjs.Map} doc Shared doc.
- * @return {Object} Post object.
- */
-
-
-function postDocToObject(doc) {
- var postDoc = doc.get('post', yjs.Map);
- var blocks = blocksDocToArray(postDoc.get('blocks'));
- var comments = commentsDocToArray(postDoc.get('comments'));
- return {
- title: postDoc.get('title') || '',
- blocks: blocks,
- comments: comments
- };
-}
-//# sourceMappingURL=yjs.js.map
\ No newline at end of file
diff --git a/build/components/block-editor-contents/use-yjs/algorithms/yjs.js.map b/build/components/block-editor-contents/use-yjs/algorithms/yjs.js.map
deleted file mode 100644
index bf86fa272..000000000
--- a/build/components/block-editor-contents/use-yjs/algorithms/yjs.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"sources":["../../../../../src/components/block-editor-contents/use-yjs/algorithms/yjs.js"],"names":["simpleDiff","a","b","left","right","length","index","remove","insert","slice","updateBlocksDoc","yDocBlocks","blocks","clientId","has","set","yjs","Map","order","get","Array","byClientId","currentOrder","toArray","orderDiff","map","block","forEach","_clientId","includes","_block","innerBlocks","updateCommentsDoc","commentsDoc","comments","comment","currentDoc","_id","isNewDoc","field","updateCommentRepliesDoc","replies","repliesDoc","reply","currentReplyDoc","updatePostDoc","doc","newPost","postDoc","title","commentsDocToArray","Object","entries","toJSON","id","commentDoc","type","content","createdAt","status","start","end","authorId","authorName","replyId","entryDoc","sort","blocksDocToArray","postDocToObject"],"mappings":"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","sourcesContent":["// @ts-nocheck TODO\n\nimport * as yjs from 'yjs';\nimport { isEqual } from 'lodash';\n\n/**\n * Returns information for splicing array `a` into array `b`,\n * by swapping the minimum slice of disagreement.\n *\n * @param {Array} a\n * @param {Array} b\n * @return {Object} diff.\n */\nfunction simpleDiff( a, b ) {\n\tlet left = 0;\n\tlet right = 0;\n\twhile ( left < a.length && left < b.length && a[ left ] === b[ left ] ) {\n\t\tleft++;\n\t}\n\tif ( left !== a.length || left !== b.length ) {\n\t\twhile (\n\t\t\tright + left < a.length &&\n\t\t\tright + left < b.length &&\n\t\t\ta[ a.length - right - 1 ] === b[ b.length - right - 1 ]\n\t\t) {\n\t\t\tright++;\n\t\t}\n\t}\n\treturn {\n\t\tindex: left,\n\t\tremove: a.length - left - right,\n\t\tinsert: b.slice( left, b.length - right ),\n\t};\n}\n\n/**\n * Updates the block doc with the local blocks block changes.\n *\n * @param {yjs.Map} yDocBlocks Blocks doc.\n * @param {Array} blocks Updated blocks.\n * @param {string} clientId Current clientId.\n */\nexport function updateBlocksDoc( yDocBlocks, blocks, clientId = '' ) {\n\tif ( ! yDocBlocks.has( 'order' ) ) {\n\t\tyDocBlocks.set( 'order', new yjs.Map() );\n\t}\n\tlet order = yDocBlocks.get( 'order' );\n\tif ( ! order.has( clientId ) ) order.set( clientId, new yjs.Array() );\n\torder = order.get( clientId );\n\tif ( ! yDocBlocks.has( 'byClientId' ) ) {\n\t\tyDocBlocks.set( 'byClientId', new yjs.Map() );\n\t}\n\tconst byClientId = yDocBlocks.get( 'byClientId' );\n\tconst currentOrder = order.toArray();\n\tconst orderDiff = simpleDiff(\n\t\tcurrentOrder,\n\t\tblocks.map( ( block ) => block.clientId )\n\t);\n\tcurrentOrder\n\t\t.slice( orderDiff.index, orderDiff.remove )\n\t\t.forEach(\n\t\t\t( _clientId ) =>\n\t\t\t\t! orderDiff.insert.includes( _clientId ) &&\n\t\t\t\tbyClientId.delete( _clientId )\n\t\t);\n\torder.delete( orderDiff.index, orderDiff.remove );\n\torder.insert( orderDiff.index, orderDiff.insert );\n\n\tfor ( const _block of blocks ) {\n\t\tconst { innerBlocks, ...block } = _block;\n\t\tif (\n\t\t\t! byClientId.has( block.clientId ) ||\n\t\t\t! isEqual( byClientId.get( block.clientId ), block )\n\t\t) {\n\t\t\tbyClientId.set( block.clientId, block );\n\t\t}\n\n\t\tupdateBlocksDoc( yDocBlocks, innerBlocks, block.clientId );\n\t}\n}\n\n/**\n * Updates the comments doc with the local comments changes.\n *\n * @param {yjs.Doc} commentsDoc comments doc.\n * @param {Object} comments Updated comments.\n */\nexport function updateCommentsDoc( commentsDoc, comments = [] ) {\n\tcomments.forEach( ( comment ) => {\n\t\tlet currentDoc = commentsDoc.get( comment._id );\n\t\tconst isNewDoc = ! currentDoc;\n\t\tif ( ! currentDoc ) {\n\t\t\tcommentsDoc.set( comment._id, new yjs.Map() );\n\t\t}\n\t\tcurrentDoc = commentsDoc.get( comment._id );\n\t\t// Update regular fields\n\t\t[\n\t\t\t'type',\n\t\t\t'content',\n\t\t\t'createdAt',\n\t\t\t'status',\n\t\t\t'start',\n\t\t\t'end',\n\t\t\t'authorId',\n\t\t\t'authorName',\n\t\t].forEach( ( field ) => {\n\t\t\tif ( isNewDoc || currentDoc.get( field ) !== comment[ field ] ) {\n\t\t\t\tcurrentDoc.set( field, comment[ field ] );\n\t\t\t}\n\t\t} );\n\n\t\tif ( isNewDoc ) {\n\t\t\tcurrentDoc.set( 'replies', new yjs.Map() );\n\t\t}\n\n\t\tupdateCommentRepliesDoc( currentDoc.get( 'replies' ), comment.replies );\n\t} );\n}\n\n/**\n * Updates the replies doc with the local replies changes.\n *\n * @param {yjs.Doc} repliesDoc replies doc.\n * @param {Object} replies Updated replies.\n */\nexport function updateCommentRepliesDoc( repliesDoc, replies = [] ) {\n\treplies.forEach( ( reply ) => {\n\t\tlet currentReplyDoc = repliesDoc.get( reply._id );\n\t\tconst isNewDoc = ! currentReplyDoc;\n\t\tif ( ! currentReplyDoc ) {\n\t\t\trepliesDoc.set( reply._id, new yjs.Map() );\n\t\t}\n\t\tcurrentReplyDoc = repliesDoc.get( reply._id );\n\t\t[ 'content', 'createdAt', 'authorId', 'authorName' ].forEach(\n\t\t\t( field ) => {\n\t\t\t\tif (\n\t\t\t\t\tisNewDoc ||\n\t\t\t\t\tcurrentReplyDoc.get( field ) !== reply[ field ]\n\t\t\t\t) {\n\t\t\t\t\tcurrentReplyDoc.set( field, reply[ field ] );\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t} );\n}\n\n/**\n * Updates the post doc with the local post changes.\n *\n * @param {yjs.Doc} doc Shared doc.\n * @param {Object} newPost Updated post.\n */\nexport function updatePostDoc( doc, newPost ) {\n\tconst postDoc = doc.get( 'post', yjs.Map );\n\tif ( postDoc.get( 'title' ) !== newPost.title ) {\n\t\tpostDoc.set( 'title', newPost.title );\n\t}\n\tif ( ! postDoc.get( 'blocks', yjs.Map ) ) {\n\t\tpostDoc.set( 'blocks', new yjs.Map() );\n\t}\n\tupdateBlocksDoc( postDoc.get( 'blocks' ), newPost.blocks || [] );\n\tif ( ! postDoc.get( 'comments', yjs.Map ) ) {\n\t\tpostDoc.set( 'comments', new yjs.Map() );\n\t}\n\tupdateCommentsDoc( postDoc.get( 'comments' ), newPost.comments );\n}\n\n/**\n * Converts the comments doc into a comment list.\n *\n * @param {yjs.Map} commentsDoc Comments doc.\n * @return {Array} Comment list.\n */\nexport function commentsDocToArray( commentsDoc ) {\n\tif ( ! commentsDoc ) {\n\t\treturn [];\n\t}\n\n\treturn Object.entries( commentsDoc.toJSON() ).map(\n\t\t( [ id, commentDoc ] ) => {\n\t\t\treturn {\n\t\t\t\t_id: id,\n\t\t\t\ttype: commentDoc.type,\n\t\t\t\tcontent: commentDoc.content,\n\t\t\t\tcreatedAt: commentDoc.createdAt,\n\t\t\t\tstatus: commentDoc.status,\n\t\t\t\tstart: commentDoc.start,\n\t\t\t\tend: commentDoc.end,\n\t\t\t\tauthorId: commentDoc.authorId,\n\t\t\t\tauthorName: commentDoc.authorName,\n\t\t\t\treplies: Object.entries( commentDoc.replies )\n\t\t\t\t\t.map( ( [ replyId, entryDoc ] ) => {\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t_id: replyId,\n\t\t\t\t\t\t\tcontent: entryDoc.content,\n\t\t\t\t\t\t\tcreatedAt: entryDoc.createdAt,\n\t\t\t\t\t\t\tauthorId: entryDoc.authorId,\n\t\t\t\t\t\t\tauthorName: entryDoc.authorName,\n\t\t\t\t\t\t};\n\t\t\t\t\t} )\n\t\t\t\t\t.sort( ( a, b ) => a.createdAt - b.createdAt ),\n\t\t\t};\n\t\t}\n\t);\n}\n\n/**\n * Converts the block doc into a block list.\n *\n * @param {yjs.Map} yDocBlocks Block doc.\n * @param {string} clientId Current block clientId.\n * @return {Array} Block list.\n */\nexport function blocksDocToArray( yDocBlocks, clientId = '' ) {\n\tif ( ! yDocBlocks ) {\n\t\treturn [];\n\t}\n\tlet order = yDocBlocks.get( 'order' );\n\torder = order.get( clientId )?.toArray();\n\tif ( ! order ) return [];\n\tconst byClientId = yDocBlocks.get( 'byClientId' );\n\n\treturn order.map( ( _clientId ) => ( {\n\t\t...byClientId.get( _clientId ),\n\t\tinnerBlocks: blocksDocToArray( yDocBlocks, _clientId ),\n\t} ) );\n}\n\n/**\n * Converts the post doc into a post object.\n *\n * @param {yjs.Map} doc Shared doc.\n * @return {Object} Post object.\n */\nexport function postDocToObject( doc ) {\n\tconst postDoc = doc.get( 'post', yjs.Map );\n\tconst blocks = blocksDocToArray( postDoc.get( 'blocks' ) );\n\tconst comments = commentsDocToArray( postDoc.get( 'comments' ) );\n\n\treturn {\n\t\ttitle: postDoc.get( 'title' ) || '',\n\t\tblocks,\n\t\tcomments,\n\t};\n}\n"],"file":"yjs.js"}
\ No newline at end of file
diff --git a/build/components/block-editor-contents/use-yjs/filters/block-selection/index.js b/build/components/block-editor-contents/use-yjs/filters/block-selection/index.js
deleted file mode 100644
index 243c11d7b..000000000
--- a/build/components/block-editor-contents/use-yjs/filters/block-selection/index.js
+++ /dev/null
@@ -1,51 +0,0 @@
-"use strict";
-
-var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-exports.addFilterCollabBlockSelection = void 0;
-
-var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
-
-var _hooks = require("@wordpress/hooks");
-
-var _data = require("@wordpress/data");
-
-require("./style.scss");
-
-import { createElement } from "@wordpress/element";
-
-/**
- * WordPress dependencies
- */
-
-/**
- * Adds peer selected className to the block-list-block component.
- *
- * @param {Object} OriginalComponent The original BlockListBlock component.
- * @return {Object} The enhanced component.
- */
-var addSelectionBorders = function addSelectionBorders(OriginalComponent) {
- return function (props) {
- var isSelected = (0, _data.useSelect)(function (select) {
- var peers = select('isolated/editor').getPeers();
- return Object.values(peers).some(function (peer) {
- var _peer$start, _peer$end;
-
- return ((_peer$start = peer.start) === null || _peer$start === void 0 ? void 0 : _peer$start.clientId) === props.clientId && ((_peer$end = peer.end) === null || _peer$end === void 0 ? void 0 : _peer$end.clientId) === props.clientId;
- });
- }, [props.clientId]);
- return createElement(OriginalComponent, (0, _extends2["default"])({}, props, {
- className: isSelected ? 'is-iso-editor-collab-peer-selected' : undefined
- }));
- };
-};
-
-var addFilterCollabBlockSelection = function addFilterCollabBlockSelection() {
- (0, _hooks.addFilter)('editor.BlockListBlock', 'isolated-block-editor', addSelectionBorders);
-};
-
-exports.addFilterCollabBlockSelection = addFilterCollabBlockSelection;
-//# sourceMappingURL=index.js.map
\ No newline at end of file
diff --git a/build/components/block-editor-contents/use-yjs/filters/block-selection/index.js.map b/build/components/block-editor-contents/use-yjs/filters/block-selection/index.js.map
deleted file mode 100644
index 2f904f721..000000000
--- a/build/components/block-editor-contents/use-yjs/filters/block-selection/index.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"sources":["../../../../../../src/components/block-editor-contents/use-yjs/filters/block-selection/index.js"],"names":["addSelectionBorders","OriginalComponent","props","isSelected","select","peers","getPeers","Object","values","some","peer","start","clientId","end","undefined","addFilterCollabBlockSelection"],"mappings":";;;;;;;;;;;AAGA;;AACA;;AAEA;;;;AANA;AACA;AACA;;AAMA;AACA;AACA;AACA;AACA;AACA;AACA,IAAMA,mBAAmB,GAAG,SAAtBA,mBAAsB,CAAEC,iBAAF,EAAyB;AACpD,SAAO,UAAEC,KAAF,EAAa;AACnB,QAAMC,UAAU,GAAG,qBAClB,UAAEC,MAAF,EAAc;AACb,UAAMC,KAAK,GAAGD,MAAM,CAAE,iBAAF,CAAN,CAA4BE,QAA5B,EAAd;AACA,aAAOC,MAAM,CAACC,MAAP,CAAeH,KAAf,EAAuBI,IAAvB,CACN,UAAEC,IAAF;AAAA;;AAAA,eAAY,gBAAAA,IAAI,CAACC,KAAL,4DAAYC,QAAZ,MAAyBV,KAAK,CAACU,QAA/B,IAA2C,cAAAF,IAAI,CAACG,GAAL,wDAAUD,QAAV,MAAuBV,KAAK,CAACU,QAApF;AAAA,OADM,CAAP;AAGA,KANiB,EAOlB,CAAEV,KAAK,CAACU,QAAR,CAPkB,CAAnB;AASA,WACC,cAAC,iBAAD,gCACMV,KADN;AAEC,MAAA,SAAS,EAAGC,UAAU,GAAG,oCAAH,GAA0CW;AAFjE,OADD;AAMA,GAhBD;AAiBA,CAlBD;;AAoBO,IAAMC,6BAA6B,GAAG,SAAhCA,6BAAgC,GAAM;AAClD,wBAAW,uBAAX,EAAoC,uBAApC,EAA6Df,mBAA7D;AACA,CAFM","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { addFilter } from '@wordpress/hooks';\nimport { useSelect } from '@wordpress/data';\n\nimport './style.scss';\n\n/**\n * Adds peer selected className to the block-list-block component.\n *\n * @param {Object} OriginalComponent The original BlockListBlock component.\n * @return {Object} The enhanced component.\n */\nconst addSelectionBorders = ( OriginalComponent ) => {\n\treturn ( props ) => {\n\t\tconst isSelected = useSelect(\n\t\t\t( select ) => {\n\t\t\t\tconst peers = select( 'isolated/editor' ).getPeers();\n\t\t\t\treturn Object.values( peers ).some(\n\t\t\t\t\t( peer ) => peer.start?.clientId === props.clientId && peer.end?.clientId === props.clientId\n\t\t\t\t);\n\t\t\t},\n\t\t\t[ props.clientId ]\n\t\t);\n\t\treturn (\n\t\t\t \n\t\t);\n\t};\n};\n\nexport const addFilterCollabBlockSelection = () => {\n\taddFilter( 'editor.BlockListBlock', 'isolated-block-editor', addSelectionBorders );\n};\n"],"file":"index.js"}
\ No newline at end of file
diff --git a/build/components/block-editor-contents/use-yjs/filters/block-selection/style.scss b/build/components/block-editor-contents/use-yjs/filters/block-selection/style.scss
deleted file mode 100644
index fcac6cfc9..000000000
--- a/build/components/block-editor-contents/use-yjs/filters/block-selection/style.scss
+++ /dev/null
@@ -1,3 +0,0 @@
-.wp-block.is-iso-editor-collab-peer-selected {
- outline: 1px dashed currentColor;
-}
diff --git a/build/components/block-editor-contents/use-yjs/filters/index.js b/build/components/block-editor-contents/use-yjs/filters/index.js
deleted file mode 100644
index 13e65e4de..000000000
--- a/build/components/block-editor-contents/use-yjs/filters/index.js
+++ /dev/null
@@ -1,15 +0,0 @@
-"use strict";
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-exports.addCollabFilters = void 0;
-
-var _blockSelection = require("./block-selection");
-
-var addCollabFilters = function addCollabFilters() {
- (0, _blockSelection.addFilterCollabBlockSelection)();
-};
-
-exports.addCollabFilters = addCollabFilters;
-//# sourceMappingURL=index.js.map
\ No newline at end of file
diff --git a/build/components/block-editor-contents/use-yjs/filters/index.js.map b/build/components/block-editor-contents/use-yjs/filters/index.js.map
deleted file mode 100644
index 9f594c98b..000000000
--- a/build/components/block-editor-contents/use-yjs/filters/index.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"sources":["../../../../../src/components/block-editor-contents/use-yjs/filters/index.js"],"names":["addCollabFilters"],"mappings":";;;;;;;AAAA;;AAEO,IAAMA,gBAAgB,GAAG,SAAnBA,gBAAmB,GAAM;AACrC;AACA,CAFM","sourcesContent":["import { addFilterCollabBlockSelection } from './block-selection';\n\nexport const addCollabFilters = () => {\n\taddFilterCollabBlockSelection();\n};\n"],"file":"index.js"}
\ No newline at end of file
diff --git a/build/components/block-editor-contents/use-yjs/formats/collab-caret/index.js b/build/components/block-editor-contents/use-yjs/formats/collab-caret/index.js
deleted file mode 100644
index c253d53e7..000000000
--- a/build/components/block-editor-contents/use-yjs/formats/collab-caret/index.js
+++ /dev/null
@@ -1,139 +0,0 @@
-"use strict";
-
-var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-exports.applyCarets = applyCarets;
-exports.registerFormatCollabCaret = exports.settings = void 0;
-
-var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
-
-var _memize = _interopRequireDefault(require("memize"));
-
-var _classnames = _interopRequireDefault(require("classnames"));
-
-var _richText = require("@wordpress/rich-text");
-
-require("./style.scss");
-
-/**
- * External dependencies
- */
-
-/**
- * WordPress dependencies
- */
-
-/**
- * Internal dependencies
- */
-var FORMAT_NAME = 'isolated/collab-caret';
-/**
- * Applies given carets to the given record.
- *
- * @param {Object} record The record to apply carets to.
- * @param {Array} carets The carets to apply.
- * @return {Object} A record with the carets applied.
- */
-
-function applyCarets(record) {
- var carets = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
- carets.forEach(function (caret) {
- var start = caret.start,
- end = caret.end,
- id = caret.id,
- color = caret.color,
- label = caret.label;
- var isCollapsed = start === end;
- var isShifted = isCollapsed && end >= record.text.length;
-
- if (isShifted) {
- start = record.text.length - 1;
- }
-
- if (isCollapsed) {
- end = start + 1;
- }
-
- record = (0, _richText.applyFormat)(record, {
- type: FORMAT_NAME,
- attributes: {
- id: 'iso-editor-collab-caret-' + id,
- "class": (0, _classnames["default"])({
- 'is-collapsed': isCollapsed,
- 'is-shifted': isShifted
- }),
- title: label,
- style: "--iso-editor-collab-caret-color: ".concat(color || '#2e3d48')
- }
- }, start, end);
- });
- return record;
-}
-
-var getCarets = (0, _memize["default"])(function (peers, richTextIdentifier, blockClientId) {
- return Object.entries(peers).filter(function (_ref) {
- var _peer$start, _peer$end;
-
- var _ref2 = (0, _slicedToArray2["default"])(_ref, 2),
- peer = _ref2[1];
-
- return (peer === null || peer === void 0 ? void 0 : (_peer$start = peer.start) === null || _peer$start === void 0 ? void 0 : _peer$start.clientId) === blockClientId && (peer === null || peer === void 0 ? void 0 : (_peer$end = peer.end) === null || _peer$end === void 0 ? void 0 : _peer$end.clientId) === blockClientId && peer.start.attributeKey === richTextIdentifier;
- }).map(function (_ref3) {
- var _ref4 = (0, _slicedToArray2["default"])(_ref3, 2),
- id = _ref4[0],
- peer = _ref4[1];
-
- return {
- id: id,
- label: peer.name,
- start: peer.start.offset,
- end: peer.end.offset,
- color: peer.color
- };
- });
-});
-var settings = {
- title: 'Collaboration peer caret',
- tagName: 'mark',
- className: 'iso-editor-collab-caret',
- attributes: {
- id: 'id',
- className: 'class'
- },
- edit: function edit() {
- return null;
- },
- __experimentalGetPropsForEditableTreePreparation: function __experimentalGetPropsForEditableTreePreparation(select, _ref5) {
- var richTextIdentifier = _ref5.richTextIdentifier,
- blockClientId = _ref5.blockClientId;
- return {
- carets: getCarets(select('isolated/editor').getPeers(), richTextIdentifier, blockClientId)
- };
- },
- __experimentalCreatePrepareEditableTree: function __experimentalCreatePrepareEditableTree(_ref6) {
- var carets = _ref6.carets;
- return function (formats, text) {
- if (!(carets !== null && carets !== void 0 && carets.length)) {
- return formats;
- }
-
- var record = {
- formats: formats,
- text: text
- };
- record = applyCarets(record, carets);
- return record.formats;
- };
- }
-};
-exports.settings = settings;
-
-var registerFormatCollabCaret = function registerFormatCollabCaret() {
- (0, _richText.registerFormatType)(FORMAT_NAME, settings);
-};
-
-exports.registerFormatCollabCaret = registerFormatCollabCaret;
-//# sourceMappingURL=index.js.map
\ No newline at end of file
diff --git a/build/components/block-editor-contents/use-yjs/formats/collab-caret/index.js.map b/build/components/block-editor-contents/use-yjs/formats/collab-caret/index.js.map
deleted file mode 100644
index 68b2f2cca..000000000
--- a/build/components/block-editor-contents/use-yjs/formats/collab-caret/index.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"sources":["../../../../../../src/components/block-editor-contents/use-yjs/formats/collab-caret/index.js"],"names":["FORMAT_NAME","applyCarets","record","carets","forEach","caret","start","end","id","color","label","isCollapsed","isShifted","text","length","type","attributes","title","style","getCarets","peers","richTextIdentifier","blockClientId","Object","entries","filter","peer","clientId","attributeKey","map","name","offset","settings","tagName","className","edit","__experimentalGetPropsForEditableTreePreparation","select","getPeers","__experimentalCreatePrepareEditableTree","formats","registerFormatCollabCaret"],"mappings":"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","sourcesContent":["/**\n * External dependencies\n */\nimport memoize from 'memize';\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { applyFormat, registerFormatType } from '@wordpress/rich-text';\n\n/**\n * Internal dependencies\n */\nimport './style.scss';\n\nconst FORMAT_NAME = 'isolated/collab-caret';\n\n/**\n * Applies given carets to the given record.\n *\n * @param {Object} record The record to apply carets to.\n * @param {Array} carets The carets to apply.\n * @return {Object} A record with the carets applied.\n */\nexport function applyCarets( record, carets = [] ) {\n\tcarets.forEach( ( caret ) => {\n\t\tlet { start, end, id, color, label } = caret;\n\t\tconst isCollapsed = start === end;\n\t\tconst isShifted = isCollapsed && end >= record.text.length;\n\n\t\tif ( isShifted ) {\n\t\t\tstart = record.text.length - 1;\n\t\t}\n\n\t\tif ( isCollapsed ) {\n\t\t\tend = start + 1;\n\t\t}\n\n\t\trecord = applyFormat(\n\t\t\trecord,\n\t\t\t{\n\t\t\t\ttype: FORMAT_NAME,\n\t\t\t\tattributes: {\n\t\t\t\t\tid: 'iso-editor-collab-caret-' + id,\n\t\t\t\t\tclass: classnames( {\n\t\t\t\t\t\t'is-collapsed': isCollapsed,\n\t\t\t\t\t\t'is-shifted': isShifted,\n\t\t\t\t\t} ),\n\t\t\t\t\ttitle: label,\n\t\t\t\t\tstyle: `--iso-editor-collab-caret-color: ${ color || '#2e3d48' }`,\n\t\t\t\t},\n\t\t\t},\n\t\t\tstart,\n\t\t\tend\n\t\t);\n\t} );\n\n\treturn record;\n}\n\nconst getCarets = memoize( ( peers, richTextIdentifier, blockClientId ) => {\n\treturn Object.entries( peers )\n\t\t.filter( ( [ , peer ] ) => {\n\t\t\treturn (\n\t\t\t\tpeer?.start?.clientId === blockClientId &&\n\t\t\t\tpeer?.end?.clientId === blockClientId &&\n\t\t\t\tpeer.start.attributeKey === richTextIdentifier\n\t\t\t);\n\t\t} )\n\t\t.map( ( [ id, peer ] ) => ( {\n\t\t\tid,\n\t\t\tlabel: peer.name,\n\t\t\tstart: peer.start.offset,\n\t\t\tend: peer.end.offset,\n\t\t\tcolor: peer.color,\n\t\t} ) );\n} );\n\nexport const settings = {\n\ttitle: 'Collaboration peer caret',\n\ttagName: 'mark',\n\tclassName: 'iso-editor-collab-caret',\n\tattributes: {\n\t\tid: 'id',\n\t\tclassName: 'class',\n\t},\n\tedit() {\n\t\treturn null;\n\t},\n\t__experimentalGetPropsForEditableTreePreparation( select, { richTextIdentifier, blockClientId } ) {\n\t\treturn {\n\t\t\tcarets: getCarets( select( 'isolated/editor' ).getPeers(), richTextIdentifier, blockClientId ),\n\t\t};\n\t},\n\t__experimentalCreatePrepareEditableTree( { carets } ) {\n\t\treturn ( formats, text ) => {\n\t\t\tif ( ! carets?.length ) {\n\t\t\t\treturn formats;\n\t\t\t}\n\n\t\t\tlet record = { formats, text };\n\t\t\trecord = applyCarets( record, carets );\n\t\t\treturn record.formats;\n\t\t};\n\t},\n};\n\nexport const registerFormatCollabCaret = () => {\n\tregisterFormatType( FORMAT_NAME, settings );\n};\n"],"file":"index.js"}
\ No newline at end of file
diff --git a/build/components/block-editor-contents/use-yjs/formats/collab-caret/style.scss b/build/components/block-editor-contents/use-yjs/formats/collab-caret/style.scss
deleted file mode 100644
index 5969efcfa..000000000
--- a/build/components/block-editor-contents/use-yjs/formats/collab-caret/style.scss
+++ /dev/null
@@ -1,48 +0,0 @@
-mark.iso-editor-collab-caret {
- position: relative;
- background: #eee;
- color: currentColor;
-}
-
-mark.iso-editor-collab-caret.is-collapsed {
- background: none;
-}
-
-mark.iso-editor-collab-caret::before {
- left: -1px;
- top: 0;
- bottom: 0;
- position: absolute;
- content: '';
- font-size: 1em;
- width: 2px;
- background: var( --iso-editor-collab-caret-color );
-}
-
-mark.iso-editor-collab-caret.is-shifted::before {
- left: auto;
- right: -1px;
-}
-
-mark.iso-editor-collab-caret::after {
- position: absolute;
- top: -14px;
- right: -4px;
- overflow: hidden;
- min-width: 8px;
- max-width: 140px;
- text-overflow: ellipsis;
- min-height: 8px;
- padding: 2px 4px 3px;
- content: attr( title ); // identity
- color: white;
- vertical-align: top;
- font-size: 10px;
- line-height: 1;
- white-space: nowrap;
- background: var( --iso-editor-collab-caret-color );
-
- // Ensure that bold/italic isn't inherited from the editor selection
- font-style: normal;
- font-weight: normal;
-}
diff --git a/build/components/block-editor-contents/use-yjs/formats/index.js b/build/components/block-editor-contents/use-yjs/formats/index.js
deleted file mode 100644
index 3f23c08c5..000000000
--- a/build/components/block-editor-contents/use-yjs/formats/index.js
+++ /dev/null
@@ -1,15 +0,0 @@
-"use strict";
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-exports.registerCollabFormats = void 0;
-
-var _collabCaret = require("./collab-caret");
-
-var registerCollabFormats = function registerCollabFormats() {
- (0, _collabCaret.registerFormatCollabCaret)();
-};
-
-exports.registerCollabFormats = registerCollabFormats;
-//# sourceMappingURL=index.js.map
\ No newline at end of file
diff --git a/build/components/block-editor-contents/use-yjs/formats/index.js.map b/build/components/block-editor-contents/use-yjs/formats/index.js.map
deleted file mode 100644
index 333dc6928..000000000
--- a/build/components/block-editor-contents/use-yjs/formats/index.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"sources":["../../../../../src/components/block-editor-contents/use-yjs/formats/index.js"],"names":["registerCollabFormats"],"mappings":";;;;;;;AAAA;;AAEO,IAAMA,qBAAqB,GAAG,SAAxBA,qBAAwB,GAAM;AAC1C;AACA,CAFM","sourcesContent":["import { registerFormatCollabCaret } from './collab-caret';\n\nexport const registerCollabFormats = () => {\n\tregisterFormatCollabCaret();\n};\n"],"file":"index.js"}
\ No newline at end of file
diff --git a/build/components/block-editor-contents/use-yjs/index.js b/build/components/block-editor-contents/use-yjs/index.js
deleted file mode 100644
index b9d1977c1..000000000
--- a/build/components/block-editor-contents/use-yjs/index.js
+++ /dev/null
@@ -1,274 +0,0 @@
-"use strict";
-
-var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-exports["default"] = useYjs;
-
-var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
-
-var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
-
-var _uuid = require("uuid");
-
-var _lodash = require("lodash");
-
-var _yjsDoc = require("./yjs-doc");
-
-var _yjs = require("./algorithms/yjs");
-
-var _data = require("@wordpress/data");
-
-var _element = require("@wordpress/element");
-
-var _filters = require("./filters");
-
-var _formats = require("./formats");
-
-/**
- * External dependencies
- */
-
-/**
- * WordPress dependencies
- */
-
-/**
- * Internal dependencies
- */
-var debug = require('debug')('iso-editor:collab');
-/** @typedef {import('../../..').CollaborationSettings} CollaborationSettings */
-
-/** @typedef {import('../../..').CollaborationTransport} CollaborationTransport */
-
-/** @typedef {import('../../..').CollaborationTransportDocMessage} CollaborationTransportDocMessage */
-
-/** @typedef {import('../../..').CollaborationTransportSelectionMessage} CollaborationTransportSelectionMessage */
-
-/** @typedef {import('../../..').EditorSelection} EditorSelection */
-
-/** @typedef {import('..').OnUpdate} OnUpdate */
-
-
-var defaultColors = ['#4676C0', '#6F6EBE', '#9063B6', '#C3498D', '#9E6D14', '#3B4856', '#4A807A'];
-/**
- * @param {object} opts - Hook options
- * @param {() => object[]} opts.getBlocks - Content to initialize the Yjs doc with.
- * @param {OnUpdate} opts.onRemoteDataChange - Function to update editor blocks in redux state.
- * @param {CollaborationSettings} opts.settings
- * @param {() => IsoEditorSelection} opts.getSelection
- * @param {import('../../../store/peers/actions').setAvailablePeers} opts.setAvailablePeers
- * @param {import('../../../store/peers/actions').setPeerSelection} opts.setPeerSelection
- *
- * @typedef IsoEditorSelection
- * @property {object} selectionStart
- * @property {object} selectionEnd
- */
-
-function initYDoc(_x) {
- return _initYDoc.apply(this, arguments);
-}
-/**
- * @param {object} opts - Hook options
- * @param {object[]} opts.blocks
- * @param {OnUpdate} opts.onRemoteDataChange
- * @param {CollaborationSettings} [opts.settings]
- */
-
-
-function _initYDoc() {
- _initYDoc = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(_ref) {
- var getBlocks, onRemoteDataChange, settings, getSelection, setPeerSelection, _setAvailablePeers, channelId, transport, identity, doc, onReceiveMessage;
-
- return _regenerator["default"].wrap(function _callee$(_context) {
- while (1) {
- switch (_context.prev = _context.next) {
- case 0:
- getBlocks = _ref.getBlocks, onRemoteDataChange = _ref.onRemoteDataChange, settings = _ref.settings, getSelection = _ref.getSelection, setPeerSelection = _ref.setPeerSelection, _setAvailablePeers = _ref.setAvailablePeers;
- channelId = settings.channelId, transport = settings.transport;
- /** @type string */
-
- identity = (0, _uuid.v4)();
- debug("initYDoc (identity: ".concat(identity, ")"));
- doc = (0, _yjsDoc.createDocument)({
- identity: identity,
- applyDataChanges: _yjs.updatePostDoc,
- getData: _yjs.postDocToObject,
-
- /** @param {object} message */
- sendMessage: function sendMessage(message) {
- debug('sendDocMessage', message);
- transport.sendMessage({
- type: 'doc',
- identity: identity,
- message: message
- });
-
- var _ref4 = getSelection() || {},
- selectionStart = _ref4.selectionStart,
- selectionEnd = _ref4.selectionEnd;
-
- debug('sendSelection', selectionStart, selectionEnd);
- transport.sendMessage({
- type: 'selection',
- identity: identity,
- selection: {
- start: selectionStart,
- end: selectionEnd
- }
- });
- }
- });
- /** @param {CollaborationTransportDocMessage|CollaborationTransportSelectionMessage} data */
-
- onReceiveMessage = function onReceiveMessage(data) {
- debug('remote change received by transport', data);
-
- switch (data.type) {
- case 'doc':
- {
- doc.receiveMessage(data.message);
- break;
- }
-
- case 'selection':
- {
- setPeerSelection(data.identity, data.selection);
- break;
- }
- }
- };
-
- doc.onRemoteDataChange(function (changes) {
- debug('remote change received by ydoc', changes);
- onRemoteDataChange(changes.blocks);
- });
- return _context.abrupt("return", transport.connect({
- user: {
- identity: identity,
- name: settings.username,
- color: settings.caretColor || (0, _lodash.sample)(defaultColors)
- },
- onReceiveMessage: onReceiveMessage,
- setAvailablePeers: function setAvailablePeers(peers) {
- debug('setAvailablePeers', peers);
-
- _setAvailablePeers(peers);
- },
- channelId: channelId
- }).then(function (_ref5) {
- var isFirstInChannel = _ref5.isFirstInChannel;
- debug("connected (channelId: ".concat(channelId, ")"));
-
- if (isFirstInChannel) {
- debug('first in channel'); // Fetching the blocks from redux now, after the transport has successfully connected,
- // ensures that we don't initialize the Yjs doc with stale blocks.
- // (This can happen if is given an onLoad handler.)
-
- // Fetching the blocks from redux now, after the transport has successfully connected,
- // ensures that we don't initialize the Yjs doc with stale blocks.
- // (This can happen if is given an onLoad handler.)
- doc.startSharing({
- title: '',
- blocks: getBlocks()
- });
- } else {
- doc.connect();
- }
-
- var disconnect = function disconnect() {
- transport.disconnect();
- doc.disconnect();
- };
-
- window.addEventListener('beforeunload', function () {
- return disconnect();
- });
- return {
- doc: doc,
- disconnect: disconnect
- };
- }));
-
- case 8:
- case "end":
- return _context.stop();
- }
- }
- }, _callee);
- }));
- return _initYDoc.apply(this, arguments);
-}
-
-function useYjs(_ref2) {
- var blocks = _ref2.blocks,
- onRemoteDataChange = _ref2.onRemoteDataChange,
- settings = _ref2.settings;
- var applyChangesToYjs = (0, _element.useRef)(_lodash.noop);
-
- var _useSelect = (0, _data.useSelect)(function (select) {
- return {
- getSelection: select('isolated/editor').getEditorSelection,
- getBlocks: select('isolated/editor').getBlocks
- };
- }, []),
- getBlocks = _useSelect.getBlocks,
- getSelection = _useSelect.getSelection;
-
- var _useDispatch = (0, _data.useDispatch)('isolated/editor'),
- setAvailablePeers = _useDispatch.setAvailablePeers,
- setPeerSelection = _useDispatch.setPeerSelection;
-
- (0, _element.useEffect)(function () {
- if (!(settings !== null && settings !== void 0 && settings.enabled)) {
- return;
- }
-
- if (!settings.transport) {
- console.error("Collaborative editor is disabled because a transport module wasn't provided.");
- return;
- }
-
- debug('registered collab formats');
- (0, _formats.registerCollabFormats)();
- debug('added collab filters');
- (0, _filters.addCollabFilters)();
- var onUnmount = _lodash.noop;
- initYDoc({
- onRemoteDataChange: onRemoteDataChange,
- settings: settings,
- getBlocks: getBlocks,
- getSelection: getSelection,
- setPeerSelection: setPeerSelection,
- setAvailablePeers: setAvailablePeers
- }).then(function (_ref3) {
- var doc = _ref3.doc,
- disconnect = _ref3.disconnect;
-
- onUnmount = function onUnmount() {
- debug('unmount');
- disconnect();
- };
-
- applyChangesToYjs.current = function (blocks) {
- if (doc.getState() !== 'on') {
- return;
- }
-
- debug('local changes applied to ydoc');
- doc.applyDataChanges({
- blocks: blocks
- });
- };
- });
- return function () {
- return onUnmount();
- };
- }, []);
- (0, _element.useEffect)(function () {
- applyChangesToYjs.current(blocks);
- }, [blocks]);
-}
-//# sourceMappingURL=index.js.map
\ No newline at end of file
diff --git a/build/components/block-editor-contents/use-yjs/index.js.map b/build/components/block-editor-contents/use-yjs/index.js.map
deleted file mode 100644
index adc22e4cd..000000000
--- a/build/components/block-editor-contents/use-yjs/index.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"sources":["../../../../src/components/block-editor-contents/use-yjs/index.js"],"names":["debug","require","defaultColors","initYDoc","getBlocks","onRemoteDataChange","settings","getSelection","setPeerSelection","setAvailablePeers","channelId","transport","identity","doc","applyDataChanges","updatePostDoc","getData","postDocToObject","sendMessage","message","type","selectionStart","selectionEnd","selection","start","end","onReceiveMessage","data","receiveMessage","changes","blocks","connect","user","name","username","color","caretColor","peers","then","isFirstInChannel","startSharing","title","disconnect","window","addEventListener","useYjs","applyChangesToYjs","noop","select","getEditorSelection","enabled","console","error","onUnmount","current","getState"],"mappings":"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","sourcesContent":["/**\n * External dependencies\n */\nimport { v4 as uuidv4 } from 'uuid';\nimport { noop, sample } from 'lodash';\nimport { createDocument } from './yjs-doc';\nimport { postDocToObject, updatePostDoc } from './algorithms/yjs';\n\n/**\n * WordPress dependencies\n */\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { useEffect, useRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { addCollabFilters } from './filters';\nimport { registerCollabFormats } from './formats';\n\nconst debug = require( 'debug' )( 'iso-editor:collab' );\n\n/** @typedef {import('../../..').CollaborationSettings} CollaborationSettings */\n/** @typedef {import('../../..').CollaborationTransport} CollaborationTransport */\n/** @typedef {import('../../..').CollaborationTransportDocMessage} CollaborationTransportDocMessage */\n/** @typedef {import('../../..').CollaborationTransportSelectionMessage} CollaborationTransportSelectionMessage */\n/** @typedef {import('../../..').EditorSelection} EditorSelection */\n/** @typedef {import('..').OnUpdate} OnUpdate */\n\nconst defaultColors = [ '#4676C0', '#6F6EBE', '#9063B6', '#C3498D', '#9E6D14', '#3B4856', '#4A807A' ];\n\n/**\n * @param {object} opts - Hook options\n * @param {() => object[]} opts.getBlocks - Content to initialize the Yjs doc with.\n * @param {OnUpdate} opts.onRemoteDataChange - Function to update editor blocks in redux state.\n * @param {CollaborationSettings} opts.settings\n * @param {() => IsoEditorSelection} opts.getSelection\n * @param {import('../../../store/peers/actions').setAvailablePeers} opts.setAvailablePeers\n * @param {import('../../../store/peers/actions').setPeerSelection} opts.setPeerSelection\n *\n * @typedef IsoEditorSelection\n * @property {object} selectionStart\n * @property {object} selectionEnd\n */\nasync function initYDoc( {\n\tgetBlocks,\n\tonRemoteDataChange,\n\tsettings,\n\tgetSelection,\n\tsetPeerSelection,\n\tsetAvailablePeers,\n} ) {\n\tconst { channelId, transport } = settings;\n\n\t/** @type string */\n\tconst identity = uuidv4();\n\n\tdebug( `initYDoc (identity: ${ identity })` );\n\n\tconst doc = createDocument( {\n\t\tidentity,\n\t\tapplyDataChanges: updatePostDoc,\n\t\tgetData: postDocToObject,\n\t\t/** @param {object} message */\n\t\tsendMessage: ( message ) => {\n\t\t\tdebug( 'sendDocMessage', message );\n\t\t\ttransport.sendMessage( { type: 'doc', identity, message } );\n\n\t\t\tconst { selectionStart, selectionEnd } = getSelection() || {};\n\t\t\tdebug( 'sendSelection', selectionStart, selectionEnd );\n\t\t\ttransport.sendMessage( {\n\t\t\t\ttype: 'selection',\n\t\t\t\tidentity,\n\t\t\t\tselection: {\n\t\t\t\t\tstart: selectionStart,\n\t\t\t\t\tend: selectionEnd,\n\t\t\t\t},\n\t\t\t} );\n\t\t},\n\t} );\n\n\t/** @param {CollaborationTransportDocMessage|CollaborationTransportSelectionMessage} data */\n\tconst onReceiveMessage = ( data ) => {\n\t\tdebug( 'remote change received by transport', data );\n\n\t\tswitch ( data.type ) {\n\t\t\tcase 'doc': {\n\t\t\t\tdoc.receiveMessage( data.message );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase 'selection': {\n\t\t\t\tsetPeerSelection( data.identity, data.selection );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t};\n\n\tdoc.onRemoteDataChange( ( changes ) => {\n\t\tdebug( 'remote change received by ydoc', changes );\n\t\tonRemoteDataChange( changes.blocks );\n\t} );\n\n\treturn transport\n\t\t.connect( {\n\t\t\tuser: {\n\t\t\t\tidentity,\n\t\t\t\tname: settings.username,\n\t\t\t\tcolor: settings.caretColor || sample( defaultColors ),\n\t\t\t},\n\t\t\tonReceiveMessage,\n\t\t\tsetAvailablePeers: ( peers ) => {\n\t\t\t\tdebug( 'setAvailablePeers', peers );\n\t\t\t\tsetAvailablePeers( peers );\n\t\t\t},\n\t\t\tchannelId,\n\t\t} )\n\t\t.then( ( { isFirstInChannel } ) => {\n\t\t\tdebug( `connected (channelId: ${ channelId })` );\n\n\t\t\tif ( isFirstInChannel ) {\n\t\t\t\tdebug( 'first in channel' );\n\n\t\t\t\t// Fetching the blocks from redux now, after the transport has successfully connected,\n\t\t\t\t// ensures that we don't initialize the Yjs doc with stale blocks.\n\t\t\t\t// (This can happen if is given an onLoad handler.)\n\t\t\t\tdoc.startSharing( { title: '', blocks: getBlocks() } );\n\t\t\t} else {\n\t\t\t\tdoc.connect();\n\t\t\t}\n\n\t\t\tconst disconnect = () => {\n\t\t\t\ttransport.disconnect();\n\t\t\t\tdoc.disconnect();\n\t\t\t};\n\n\t\t\twindow.addEventListener( 'beforeunload', () => disconnect() );\n\n\t\t\treturn { doc, disconnect };\n\t\t} );\n}\n\n/**\n * @param {object} opts - Hook options\n * @param {object[]} opts.blocks\n * @param {OnUpdate} opts.onRemoteDataChange\n * @param {CollaborationSettings} [opts.settings]\n */\nexport default function useYjs( { blocks, onRemoteDataChange, settings } ) {\n\tconst applyChangesToYjs = useRef( noop );\n\n\tconst { getBlocks, getSelection } = useSelect( ( select ) => {\n\t\treturn {\n\t\t\tgetSelection: select( 'isolated/editor' ).getEditorSelection,\n\t\t\tgetBlocks: select( 'isolated/editor' ).getBlocks,\n\t\t};\n\t}, [] );\n\n\tconst { setAvailablePeers, setPeerSelection } = useDispatch( 'isolated/editor' );\n\n\tuseEffect( () => {\n\t\tif ( ! settings?.enabled ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( ! settings.transport ) {\n\t\t\tconsole.error( `Collaborative editor is disabled because a transport module wasn't provided.` );\n\t\t\treturn;\n\t\t}\n\n\t\tdebug( 'registered collab formats' );\n\t\tregisterCollabFormats();\n\n\t\tdebug( 'added collab filters' );\n\t\taddCollabFilters();\n\n\t\tlet onUnmount = noop;\n\n\t\tinitYDoc( {\n\t\t\tonRemoteDataChange,\n\t\t\tsettings,\n\t\t\tgetBlocks,\n\t\t\tgetSelection,\n\t\t\tsetPeerSelection,\n\t\t\tsetAvailablePeers,\n\t\t} ).then( ( { doc, disconnect } ) => {\n\t\t\tonUnmount = () => {\n\t\t\t\tdebug( 'unmount' );\n\t\t\t\tdisconnect();\n\t\t\t};\n\n\t\t\tapplyChangesToYjs.current = ( blocks ) => {\n\t\t\t\tif ( doc.getState() !== 'on' ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tdebug( 'local changes applied to ydoc' );\n\t\t\t\tdoc.applyDataChanges( { blocks } );\n\t\t\t};\n\t\t} );\n\n\t\treturn () => onUnmount();\n\t}, [] );\n\n\tuseEffect( () => {\n\t\tapplyChangesToYjs.current( blocks );\n\t}, [ blocks ] );\n}\n"],"file":"index.js"}
\ No newline at end of file
diff --git a/build/components/block-editor-contents/use-yjs/yjs-doc.js b/build/components/block-editor-contents/use-yjs/yjs-doc.js
deleted file mode 100644
index 9c3fd86f8..000000000
--- a/build/components/block-editor-contents/use-yjs/yjs-doc.js
+++ /dev/null
@@ -1,168 +0,0 @@
-"use strict";
-
-var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
-
-var _typeof = require("@babel/runtime/helpers/typeof");
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-exports.createDocument = createDocument;
-
-var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
-
-var yjs = _interopRequireWildcard(require("yjs"));
-
-var _excluded = ["protocol", "messageType", "origin"];
-
-function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
-
-function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
-
-var encodeArray = function encodeArray(array) {
- return array.toString();
-};
-
-var decodeArray = function decodeArray(string) {
- return new Uint8Array(string.split(','));
-};
-
-function createDocument(_ref) {
- var identity = _ref.identity,
- _applyDataChanges = _ref.applyDataChanges,
- getData = _ref.getData,
- sendMessage = _ref.sendMessage;
- var doc = new yjs.Doc();
- var state = 'off';
- var listeners = [];
- var stateListeners = [];
- doc.on('update', function (update, origin) {
- if (origin === identity && state === 'on') {
- sendMessage({
- protocol: 'yjs1',
- messageType: 'syncUpdate',
- update: encodeArray(update)
- });
- }
-
- if (origin !== identity) {
- var newData = getData(doc);
- listeners.forEach(function (listener) {
- return listener(newData);
- });
- }
- });
-
- var setState = function setState(newState) {
- state = newState;
- stateListeners.forEach(function (listener) {
- return listener(newState);
- });
- };
-
- var sync = function sync(destination, isReply) {
- var stateVector = yjs.encodeStateVector(doc);
- sendMessage({
- protocol: 'yjs1',
- messageType: 'sync1',
- stateVector: encodeArray(stateVector),
- origin: identity,
- destination: destination,
- isReply: isReply
- });
- };
-
- return {
- applyDataChanges: function applyDataChanges(data) {
- if (state !== 'on') {
- throw 'wrong state';
- }
-
- doc.transact(function () {
- _applyDataChanges(doc, data);
- }, identity);
- },
- connect: function connect() {
- if (state === 'on') {
- throw 'wrong state';
- }
-
- setState('connecting');
- sync();
- },
- disconnect: function disconnect() {
- setState('off');
- },
- startSharing: function startSharing(data) {
- if (state === 'on') {
- throw 'wrong state';
- }
-
- setState('on');
- this.applyDataChanges(data);
- },
- receiveMessage: function receiveMessage(_ref2) {
- var protocol = _ref2.protocol,
- messageType = _ref2.messageType,
- origin = _ref2.origin,
- content = (0, _objectWithoutProperties2["default"])(_ref2, _excluded);
-
- if (protocol !== 'yjs1') {
- throw 'wrong protocol';
- }
-
- switch (messageType) {
- case 'sync1':
- if (content.destination && content.destination !== identity) {
- return;
- }
-
- sendMessage({
- protocol: 'yjs1',
- messageType: 'sync2',
- update: encodeArray(yjs.encodeStateAsUpdate(doc, decodeArray(content.stateVector))),
- destination: origin
- });
-
- if (!content.isReply) {
- sync(origin, true);
- }
-
- break;
-
- case 'sync2':
- if (content.destination !== identity) {
- return;
- }
-
- yjs.applyUpdate(doc, decodeArray(content.update), origin);
- setState('on');
- break;
-
- case 'syncUpdate':
- yjs.applyUpdate(doc, decodeArray(content.update), origin);
- break;
- }
- },
- onRemoteDataChange: function onRemoteDataChange(listener) {
- listeners.push(listener);
- return function () {
- listeners = listeners.filter(function (l) {
- return l !== listener;
- });
- };
- },
- onStateChange: function onStateChange(listener) {
- stateListeners.push(listener);
- return function () {
- stateListeners = stateListeners.filter(function (l) {
- return l !== listener;
- });
- };
- },
- getState: function getState() {
- return state;
- }
- };
-}
-//# sourceMappingURL=yjs-doc.js.map
\ No newline at end of file
diff --git a/build/components/block-editor-contents/use-yjs/yjs-doc.js.map b/build/components/block-editor-contents/use-yjs/yjs-doc.js.map
deleted file mode 100644
index 3040ff5cf..000000000
--- a/build/components/block-editor-contents/use-yjs/yjs-doc.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"sources":["../../../../src/components/block-editor-contents/use-yjs/yjs-doc.js"],"names":["encodeArray","array","toString","decodeArray","string","Uint8Array","split","createDocument","identity","applyDataChanges","getData","sendMessage","doc","yjs","Doc","state","listeners","stateListeners","on","update","origin","protocol","messageType","newData","forEach","listener","setState","newState","sync","destination","isReply","stateVector","encodeStateVector","data","transact","connect","disconnect","startSharing","receiveMessage","content","encodeStateAsUpdate","applyUpdate","onRemoteDataChange","push","filter","l","onStateChange","getState"],"mappings":"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","sourcesContent":["import * as yjs from 'yjs';\n\nconst encodeArray = ( array ) => array.toString();\nconst decodeArray = ( string ) => new Uint8Array( string.split( ',' ) );\n\nexport function createDocument( {\n\tidentity,\n\tapplyDataChanges,\n\tgetData,\n\tsendMessage,\n} ) {\n\tconst doc = new yjs.Doc();\n\tlet state = 'off';\n\tlet listeners = [];\n\tlet stateListeners = [];\n\n\tdoc.on( 'update', ( update, origin ) => {\n\t\tif ( origin === identity && state === 'on' ) {\n\t\t\tsendMessage( {\n\t\t\t\tprotocol: 'yjs1',\n\t\t\t\tmessageType: 'syncUpdate',\n\t\t\t\tupdate: encodeArray( update ),\n\t\t\t} );\n\t\t}\n\n\t\tif ( origin !== identity ) {\n\t\t\tconst newData = getData( doc );\n\t\t\tlisteners.forEach( ( listener ) => listener( newData ) );\n\t\t}\n\t} );\n\n\tconst setState = ( newState ) => {\n\t\tstate = newState;\n\t\tstateListeners.forEach( ( listener ) => listener( newState ) );\n\t};\n\n\tconst sync = ( destination, isReply ) => {\n\t\tconst stateVector = yjs.encodeStateVector( doc );\n\t\tsendMessage( {\n\t\t\tprotocol: 'yjs1',\n\t\t\tmessageType: 'sync1',\n\t\t\tstateVector: encodeArray( stateVector ),\n\t\t\torigin: identity,\n\t\t\tdestination,\n\t\t\tisReply,\n\t\t} );\n\t};\n\n\treturn {\n\t\tapplyDataChanges( data ) {\n\t\t\tif ( state !== 'on' ) {\n\t\t\t\tthrow 'wrong state';\n\t\t\t}\n\t\t\tdoc.transact( () => {\n\t\t\t\tapplyDataChanges( doc, data );\n\t\t\t}, identity );\n\t\t},\n\n\t\tconnect() {\n\t\t\tif ( state === 'on' ) {\n\t\t\t\tthrow 'wrong state';\n\t\t\t}\n\n\t\t\tsetState( 'connecting' );\n\t\t\tsync();\n\t\t},\n\n\t\tdisconnect() {\n\t\t\tsetState( 'off' );\n\t\t},\n\n\t\tstartSharing( data ) {\n\t\t\tif ( state === 'on' ) {\n\t\t\t\tthrow 'wrong state';\n\t\t\t}\n\n\t\t\tsetState( 'on' );\n\t\t\tthis.applyDataChanges( data );\n\t\t},\n\n\t\treceiveMessage( { protocol, messageType, origin, ...content } ) {\n\t\t\tif ( protocol !== 'yjs1' ) {\n\t\t\t\tthrow 'wrong protocol';\n\t\t\t}\n\n\t\t\tswitch ( messageType ) {\n\t\t\t\tcase 'sync1':\n\t\t\t\t\tif (\n\t\t\t\t\t\tcontent.destination &&\n\t\t\t\t\t\tcontent.destination !== identity\n\t\t\t\t\t) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tsendMessage( {\n\t\t\t\t\t\tprotocol: 'yjs1',\n\t\t\t\t\t\tmessageType: 'sync2',\n\t\t\t\t\t\tupdate: encodeArray(\n\t\t\t\t\t\t\tyjs.encodeStateAsUpdate(\n\t\t\t\t\t\t\t\tdoc,\n\t\t\t\t\t\t\t\tdecodeArray( content.stateVector )\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t),\n\t\t\t\t\t\tdestination: origin,\n\t\t\t\t\t} );\n\t\t\t\t\tif ( ! content.isReply ) {\n\t\t\t\t\t\tsync( origin, true );\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'sync2':\n\t\t\t\t\tif ( content.destination !== identity ) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tyjs.applyUpdate(\n\t\t\t\t\t\tdoc,\n\t\t\t\t\t\tdecodeArray( content.update ),\n\t\t\t\t\t\torigin\n\t\t\t\t\t);\n\t\t\t\t\tsetState( 'on' );\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'syncUpdate':\n\t\t\t\t\tyjs.applyUpdate(\n\t\t\t\t\t\tdoc,\n\t\t\t\t\t\tdecodeArray( content.update ),\n\t\t\t\t\t\torigin\n\t\t\t\t\t);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t},\n\n\t\tonRemoteDataChange( listener ) {\n\t\t\tlisteners.push( listener );\n\n\t\t\treturn () => {\n\t\t\t\tlisteners = listeners.filter( ( l ) => l !== listener );\n\t\t\t};\n\t\t},\n\n\t\tonStateChange( listener ) {\n\t\t\tstateListeners.push( listener );\n\n\t\t\treturn () => {\n\t\t\t\tstateListeners = stateListeners.filter(\n\t\t\t\t\t( l ) => l !== listener\n\t\t\t\t);\n\t\t\t};\n\t\t},\n\n\t\tgetState() {\n\t\t\treturn state;\n\t\t},\n\t};\n}\n"],"file":"yjs-doc.js"}
\ No newline at end of file
diff --git a/build/components/block-editor-toolbar/style.scss b/build/components/block-editor-toolbar/style.scss
index f130f9134..85352522d 100644
--- a/build/components/block-editor-toolbar/style.scss
+++ b/build/components/block-editor-toolbar/style.scss
@@ -68,7 +68,6 @@
.edit-post-header__settings {
display: inline-flex;
align-items: center;
- flex-wrap: wrap;
button.components-button.has-icon {
margin-right: 0;
diff --git a/build/components/collaborative-editing/README.md b/build/components/collaborative-editing/README.md
index 5b697cc48..b751ca684 100644
--- a/build/components/collaborative-editing/README.md
+++ b/build/components/collaborative-editing/README.md
@@ -8,6 +8,7 @@
- _settings.channelId_ `[string]` - Optional channel id to pass to `transport.connect()`.
- _settings.username_ `string` - Name displayed to peers. Required if collab is enabled.
- _settings.caretColor_ `[string]` - Color of the caret indicator displayed to peers. If unspecified, a random color will be selected.
+- _settings.avatarUrl_ `[string]` - Presence avatar displayed to peers. If unspecified, the first character of the username will be shown.
- _settings.transport_ `CollaborationTransport` - Transport module to handle messaging between peers. See the section below for how this should be implemented.
## Implementing a transport module
diff --git a/build/components/collaborative-editing/components/avatars/Avatars.stories.tsx b/build/components/collaborative-editing/components/avatars/Avatars.stories.tsx
new file mode 100644
index 000000000..c2194058a
--- /dev/null
+++ b/build/components/collaborative-editing/components/avatars/Avatars.stories.tsx
@@ -0,0 +1,49 @@
+import { sample } from 'lodash';
+
+import { CollaborativeEditingAvatars, CollaborativeEditingAvatar } from '.';
+import { defaultColors } from '../../use-yjs';
+
+import type { Story } from '@storybook/react';
+
+export default {
+ title: 'Collaboration/Components/Avatars',
+ component: CollaborativeEditingAvatars,
+};
+
+const generateRandomPeers = ( count ) => {
+ return count
+ ? [ ...Array( count ) ].map( ( peer, index ) => ( {
+ id: index.toString(),
+ name: `Peery Collabson ${ index }`,
+ avatarUrl: `https://i.pravatar.cc/64?cacheBust=${ Math.random() }`,
+ color: sample( defaultColors ) as string,
+ } ) )
+ : [];
+};
+
+type Props = {
+ peerCount: number;
+};
+
+const Template: Story< Props > = ( { peerCount } ) => {
+ return ;
+};
+
+export const Default = Template.bind( {} );
+Default.args = {
+ peerCount: 25,
+};
+
+export const Empty = Template.bind( {} );
+Empty.args = {
+ peerCount: 0,
+};
+
+export const NoImage = ( args ) => {
+ return ;
+};
+NoImage.args = {
+ id: 0,
+ name: 'Peery Collabson',
+ color: sample( defaultColors ),
+};
diff --git a/build/components/collaborative-editing/components/avatars/index.js b/build/components/collaborative-editing/components/avatars/index.js
new file mode 100644
index 000000000..8a0b3135d
--- /dev/null
+++ b/build/components/collaborative-editing/components/avatars/index.js
@@ -0,0 +1,137 @@
+"use strict";
+
+var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.CollaborativeEditingAvatars = CollaborativeEditingAvatars;
+exports.CollaborativeEditingAvatar = CollaborativeEditingAvatar;
+exports.CollaborativeEditingAvatarsOverflow = CollaborativeEditingAvatarsOverflow;
+exports["default"] = void 0;
+
+var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
+
+var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
+
+var _components = require("@wordpress/components");
+
+var _data = require("@wordpress/data");
+
+var _element = require("@wordpress/element");
+
+var _i18n = require("@wordpress/i18n");
+
+require("./style.scss");
+
+import { createElement, Fragment } from "@wordpress/element";
+
+function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
+
+function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
+
+/**
+ * @param {object} props
+ * @param {import("../..").AvailablePeer[]} props.peers
+ */
+function CollaborativeEditingAvatars(_ref) {
+ var peers = _ref.peers;
+ var MAX_AVATAR_COUNT = 3;
+ return createElement("div", {
+ className: "iso-editor-collab-avatars"
+ }, createElement(_components.VisuallyHidden, null, "Currently editing:"), peers.slice(0, MAX_AVATAR_COUNT).map(function (peer) {
+ return createElement(CollaborativeEditingAvatar, {
+ key: peer.id,
+ peer: peer
+ });
+ }), peers.length > MAX_AVATAR_COUNT && createElement(CollaborativeEditingAvatarsOverflow, {
+ peers: peers === null || peers === void 0 ? void 0 : peers.slice(MAX_AVATAR_COUNT)
+ }));
+}
+
+function CollaborativeEditingAvatar(_ref2) {
+ var peer = _ref2.peer;
+
+ var _useState = (0, _element.useState)(false),
+ _useState2 = (0, _slicedToArray2["default"])(_useState, 2),
+ isVisible = _useState2[0],
+ setIsVisible = _useState2[1];
+
+ return createElement("div", {
+ className: "iso-editor-collab-avatars__avatar",
+ "aria-label": peer.name,
+ onMouseEnter: function onMouseEnter() {
+ return setIsVisible(true);
+ },
+ onMouseLeave: function onMouseLeave() {
+ return setIsVisible(false);
+ },
+ style: {
+ borderColor: peer.color,
+ background: peer.color
+ }
+ }, isVisible && createElement(_components.Popover, {
+ className: "iso-editor-collab-avatars__popover",
+ animate: false
+ }, peer.name), peer.avatarUrl ? createElement("img", {
+ className: "iso-editor-collab-avatars__image",
+ src: peer.avatarUrl,
+ alt: ""
+ }) : createElement("span", {
+ className: "iso-editor-collab-avatars__name-initial"
+ }, peer.name.charAt(0)));
+}
+
+function CollaborativeEditingAvatarsOverflow(_ref3) {
+ var peers = _ref3.peers;
+ var MAX_NAME_COUNT = 20;
+
+ var _useState3 = (0, _element.useState)(false),
+ _useState4 = (0, _slicedToArray2["default"])(_useState3, 2),
+ isVisible = _useState4[0],
+ setIsVisible = _useState4[1];
+
+ var NameList = function NameList() {
+ return createElement(Fragment, null, createElement("ul", {
+ className: "iso-editor-collab-avatars__overflow-list"
+ }, peers.slice(0, MAX_NAME_COUNT).map(function (peer) {
+ return createElement("li", {
+ className: "iso-editor-collab-avatars__overflow-list-item",
+ key: peer.id
+ }, peer.name);
+ })), peers.length > MAX_NAME_COUNT && createElement("p", {
+ className: "iso-editor-collab-avatars__overflow-more"
+ }, (0, _i18n.sprintf)(
+ /* translators: %s: number of how many more users there are */
+ (0, _i18n.__)('and %s more'), peers.length - MAX_NAME_COUNT)));
+ };
+
+ return createElement("div", {
+ className: "iso-editor-collab-avatars__overflow"
+ }, isVisible && createElement(_components.Popover, {
+ className: "iso-editor-collab-avatars__popover",
+ animate: false
+ }, createElement(NameList, null)), createElement("span", {
+ "aria-hidden": "true",
+ onMouseEnter: function onMouseEnter() {
+ return setIsVisible(true);
+ },
+ onMouseLeave: function onMouseLeave() {
+ return setIsVisible(false);
+ }
+ }, "+".concat(peers.length)), createElement(_components.VisuallyHidden, null, createElement(NameList, null)));
+}
+
+var _default = (0, _data.withSelect)(function (select) {
+ var peers = select('isolated/editor').getPeers();
+ return {
+ peers: Object.keys(peers).map(function (id) {
+ return _objectSpread({
+ id: id
+ }, peers[id]);
+ })
+ };
+})(CollaborativeEditingAvatars);
+
+exports["default"] = _default;
+//# sourceMappingURL=index.js.map
\ No newline at end of file
diff --git a/build/components/collaborative-editing/components/avatars/index.js.map b/build/components/collaborative-editing/components/avatars/index.js.map
new file mode 100644
index 000000000..42e4d42e0
--- /dev/null
+++ b/build/components/collaborative-editing/components/avatars/index.js.map
@@ -0,0 +1 @@
+{"version":3,"sources":["../../../../../src/components/collaborative-editing/components/avatars/index.js"],"names":["CollaborativeEditingAvatars","peers","MAX_AVATAR_COUNT","slice","map","peer","id","length","CollaborativeEditingAvatar","isVisible","setIsVisible","name","borderColor","color","background","avatarUrl","charAt","CollaborativeEditingAvatarsOverflow","MAX_NAME_COUNT","NameList","select","getPeers","Object","keys"],"mappings":"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","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Popover, VisuallyHidden } from '@wordpress/components';\nimport { withSelect } from '@wordpress/data';\nimport { useState } from '@wordpress/element';\nimport { __, sprintf } from '@wordpress/i18n';\n\nimport './style.scss';\n\n/**\n * @param {object} props\n * @param {import(\"../..\").AvailablePeer[]} props.peers\n */\nexport function CollaborativeEditingAvatars( { peers } ) {\n\tconst MAX_AVATAR_COUNT = 3;\n\n\treturn (\n\t\t\n\t\t\tCurrently editing: \n\n\t\t\t{ peers.slice( 0, MAX_AVATAR_COUNT ).map( ( peer ) => (\n\t\t\t\t \n\t\t\t) ) }\n\n\t\t\t{ peers.length > MAX_AVATAR_COUNT && (\n\t\t\t\t \n\t\t\t) }\n\t\t
\n\t);\n}\n\nexport function CollaborativeEditingAvatar( { peer } ) {\n\tconst [ isVisible, setIsVisible ] = useState( false );\n\n\treturn (\n\t\t setIsVisible( true ) }\n\t\t\tonMouseLeave={ () => setIsVisible( false ) }\n\t\t\tstyle={ {\n\t\t\t\tborderColor: peer.color,\n\t\t\t\tbackground: peer.color,\n\t\t\t} }\n\t\t>\n\t\t\t{ isVisible && (\n\t\t\t\t
\n\t\t\t\t\t{ peer.name }\n\t\t\t\t \n\t\t\t) }\n\t\t\t{ peer.avatarUrl ? (\n\t\t\t\t
\n\t\t\t) : (\n\t\t\t\t
{ peer.name.charAt( 0 ) } \n\t\t\t) }\n\t\t
\n\t);\n}\n\nexport function CollaborativeEditingAvatarsOverflow( { peers } ) {\n\tconst MAX_NAME_COUNT = 20;\n\tconst [ isVisible, setIsVisible ] = useState( false );\n\n\tconst NameList = () => {\n\t\treturn (\n\t\t\t<>\n\t\t\t\t\n\t\t\t\t\t{ peers.slice( 0, MAX_NAME_COUNT ).map( ( peer ) => (\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t{ peer.name }\n\t\t\t\t\t\t \n\t\t\t\t\t) ) }\n\t\t\t\t \n\t\t\t\t{ peers.length > MAX_NAME_COUNT && (\n\t\t\t\t\t\n\t\t\t\t\t\t{ sprintf(\n\t\t\t\t\t\t\t/* translators: %s: number of how many more users there are */\n\t\t\t\t\t\t\t__( 'and %s more' ),\n\t\t\t\t\t\t\tpeers.length - MAX_NAME_COUNT\n\t\t\t\t\t\t) }\n\t\t\t\t\t
\n\t\t\t\t) }\n\t\t\t>\n\t\t);\n\t};\n\n\treturn (\n\t\t\n\t\t\t{ isVisible && (\n\t\t\t\t
\n\t\t\t\t\t \n\t\t\t\t \n\t\t\t) }\n\t\t\t
setIsVisible( true ) }\n\t\t\t\tonMouseLeave={ () => setIsVisible( false ) }\n\t\t\t>\n\t\t\t\t{ `+${ peers.length }` }\n\t\t\t \n\t\t\t
\n\t\t\t\t \n\t\t\t \n\t\t
\n\t);\n}\n\nexport default withSelect( ( select ) => {\n\tconst peers = select( 'isolated/editor' ).getPeers();\n\n\treturn {\n\t\tpeers: Object.keys( peers ).map( ( id ) => {\n\t\t\treturn {\n\t\t\t\tid,\n\t\t\t\t...peers[ id ],\n\t\t\t};\n\t\t} ),\n\t};\n} )( CollaborativeEditingAvatars );\n"],"file":"index.js"}
\ No newline at end of file
diff --git a/build/components/collaborative-editing/components/avatars/style.scss b/build/components/collaborative-editing/components/avatars/style.scss
new file mode 100644
index 000000000..b0aa98dee
--- /dev/null
+++ b/build/components/collaborative-editing/components/avatars/style.scss
@@ -0,0 +1,87 @@
+@import '@wordpress/base-styles/_colors';
+@import '@wordpress/base-styles/_variables';
+
+$avatarSize: 32px;
+
+.iso-editor-collab-avatars {
+ display: flex;
+ align-items: center;
+ margin: 0 8px;
+}
+
+.iso-editor-collab-avatars__avatar {
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ width: $avatarSize;
+ height: $avatarSize;
+ border-radius: 50%;
+ border-width: 2px;
+ border-style: solid;
+
+ & + & {
+ margin-left: -4px;
+ box-shadow: 0 0 0 2px $white;
+ }
+}
+
+.iso-editor-collab-avatars__popover {
+ // Mostly mimic styles for the core Tooltip component.
+ // (We could've simply used core Tooltip if the delay was shorter
+ // and it accepted multi-line text.)
+ .components-popover__content {
+ transform: translateY( 8px );
+ background: $gray-900;
+ border-radius: $radius-block-ui;
+ border-width: 0;
+ color: $white;
+ white-space: nowrap;
+ line-height: 1.4;
+ font-size: 12px;
+ box-shadow: none;
+
+ > div {
+ padding: $grid-unit-05 $grid-unit-10;
+ }
+ }
+}
+
+.iso-editor-collab-avatars__image {
+ width: inherit;
+ height: inherit;
+ border-radius: inherit;
+}
+
+.iso-editor-collab-avatars__name-initial {
+ font-size: 20px;
+ line-height: 1;
+ color: $white;
+ text-transform: uppercase;
+ cursor: default;
+}
+
+.iso-editor-collab-avatars__overflow {
+ margin-left: 4px;
+ height: 100%;
+ cursor: default;
+}
+
+.iso-editor-collab-avatars__overflow-list {
+ margin: 0;
+ padding: 0;
+ list-style: none;
+}
+
+.iso-editor-collab-avatars__overflow-list-item {
+ margin: 0;
+ line-height: 1;
+
+ & + & {
+ margin-top: 6px;
+ }
+}
+
+.iso-editor-collab-avatars__overflow-more {
+ margin: 6px 0 0;
+ line-height: 1;
+}
diff --git a/build/components/collaborative-editing/index.js b/build/components/collaborative-editing/index.js
index 820f07369..50e157f04 100644
--- a/build/components/collaborative-editing/index.js
+++ b/build/components/collaborative-editing/index.js
@@ -7,8 +7,14 @@ Object.defineProperty(exports, "__esModule", {
});
exports["default"] = void 0;
+var _ = require("../..");
+
var _useYjs = _interopRequireDefault(require("./use-yjs"));
+var _avatars = _interopRequireDefault(require("./components/avatars"));
+
+import { createElement } from "@wordpress/element";
+
/**
* Internal dependencies
*/
@@ -20,6 +26,7 @@ var _useYjs = _interopRequireDefault(require("./use-yjs"));
* @property {string} [channelId] Optional channel id to pass to transport.connect().
* @property {string} username Name displayed to peers. Required if collab is enabled.
* @property {string} [caretColor] Color of the caret indicator displayed to peers. If unspecified, a random color will be selected.
+ * @property {string} [avatarUrl] Url of the avatar image diplayed to peers.
* @property {CollaborationTransport} transport Required if collab is enabled.
*/
@@ -34,6 +41,7 @@ var _useYjs = _interopRequireDefault(require("./use-yjs"));
* @property {object} user
* @property {string} user.identity
* @property {string} user.name
+ * @property {string} [user.avatarUrl]
* @property {string} [user.color] Color of the caret indicator displayed to peers.
* @property {(message: object) => void} onReceiveMessage Callback to run when a message is received.
* @property {(peers: AvailablePeer[]) => void} setAvailablePeers Callback to run when peers change.
@@ -43,6 +51,7 @@ var _useYjs = _interopRequireDefault(require("./use-yjs"));
* @property {string} id
* @property {string} name
* @property {string} color
+ * @property {string} [avatarUrl]
*
* @typedef CollaborationTransportDocMessage
* @property {string} identity
@@ -68,7 +77,7 @@ function CollaborativeEditing(_ref) {
(0, _useYjs["default"])({
settings: settings
});
- return null;
+ return createElement(_.ToolbarSlot, null, createElement(_avatars["default"], null));
}
var _default = CollaborativeEditing;
diff --git a/build/components/collaborative-editing/index.js.map b/build/components/collaborative-editing/index.js.map
index 829090c0e..46d669fbd 100644
--- a/build/components/collaborative-editing/index.js.map
+++ b/build/components/collaborative-editing/index.js.map
@@ -1 +1 @@
-{"version":3,"sources":["../../../src/components/collaborative-editing/index.js"],"names":["CollaborativeEditing","settings"],"mappings":";;;;;;;;;AAGA;;AAHA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,SAASA,oBAAT,OAA8C;AAAA,MAAbC,QAAa,QAAbA,QAAa;AAC7C,0BAAQ;AACPA,IAAAA,QAAQ,EAARA;AADO,GAAR;AAIA,SAAO,IAAP;AACA;;eAEcD,oB","sourcesContent":["/**\n * Internal dependencies\n */\nimport useYjs from './use-yjs';\n\n/**\n * Real-time collaboration settings\n * @typedef CollaborationSettings\n * @property {boolean} enabled\n * @property {string} [channelId] Optional channel id to pass to transport.connect().\n * @property {string} username Name displayed to peers. Required if collab is enabled.\n * @property {string} [caretColor] Color of the caret indicator displayed to peers. If unspecified, a random color will be selected.\n * @property {CollaborationTransport} transport Required if collab is enabled.\n */\n\n/**\n * Transport module for real-time collaboration\n * @typedef CollaborationTransport\n * @property {(message: CollaborationTransportDocMessage|CollaborationTransportSelectionMessage) => void} sendMessage\n * @property {(options: CollaborationTransportConnectOpts) => Promise<{isFirstInChannel: boolean}>} connect\n * @property {() => Promise} disconnect\n *\n * @typedef CollaborationTransportConnectOpts\n * @property {object} user\n * @property {string} user.identity\n * @property {string} user.name\n * @property {string} [user.color] Color of the caret indicator displayed to peers.\n * @property {(message: object) => void} onReceiveMessage Callback to run when a message is received.\n * @property {(peers: AvailablePeer[]) => void} setAvailablePeers Callback to run when peers change.\n * @property {string} [channelId]\n *\n * @typedef AvailablePeer\n * @property {string} id\n * @property {string} name\n * @property {string} color\n *\n * @typedef CollaborationTransportDocMessage\n * @property {string} identity\n * @property {'doc'} type\n * @property {object} message\n *\n * @typedef CollaborationTransportSelectionMessage\n * @property {string} identity\n * @property {'selection'} type\n * @property {EditorSelection} selection\n *\n * @typedef EditorSelection\n * @property {object} start\n * @property {object} end\n */\n\n/**\n * @param {object} props\n * @param {CollaborationSettings} props.settings\n */\nfunction CollaborativeEditing( { settings } ) {\n\tuseYjs( {\n\t\tsettings,\n\t} );\n\n\treturn null;\n}\n\nexport default CollaborativeEditing;\n"],"file":"index.js"}
\ No newline at end of file
+{"version":3,"sources":["../../../src/components/collaborative-editing/index.js"],"names":["CollaborativeEditing","settings"],"mappings":";;;;;;;;;AAGA;;AACA;;AACA;;;;AALA;AACA;AACA;;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,SAASA,oBAAT,OAA8C;AAAA,MAAbC,QAAa,QAAbA,QAAa;AAC7C,0BAAQ;AACPA,IAAAA,QAAQ,EAARA;AADO,GAAR;AAIA,SACC,cAAC,aAAD,QACC,cAAC,mBAAD,OADD,CADD;AAKA;;eAEcD,oB","sourcesContent":["/**\n * Internal dependencies\n */\nimport { ToolbarSlot } from '../..';\nimport useYjs from './use-yjs';\nimport CollaborativeEditingAvatars from './components/avatars';\n\n/**\n * Real-time collaboration settings\n * @typedef CollaborationSettings\n * @property {boolean} enabled\n * @property {string} [channelId] Optional channel id to pass to transport.connect().\n * @property {string} username Name displayed to peers. Required if collab is enabled.\n * @property {string} [caretColor] Color of the caret indicator displayed to peers. If unspecified, a random color will be selected.\n * @property {string} [avatarUrl] Url of the avatar image diplayed to peers.\n * @property {CollaborationTransport} transport Required if collab is enabled.\n */\n\n/**\n * Transport module for real-time collaboration\n * @typedef CollaborationTransport\n * @property {(message: CollaborationTransportDocMessage|CollaborationTransportSelectionMessage) => void} sendMessage\n * @property {(options: CollaborationTransportConnectOpts) => Promise<{isFirstInChannel: boolean}>} connect\n * @property {() => Promise} disconnect\n *\n * @typedef CollaborationTransportConnectOpts\n * @property {object} user\n * @property {string} user.identity\n * @property {string} user.name\n * @property {string} [user.avatarUrl]\n * @property {string} [user.color] Color of the caret indicator displayed to peers.\n * @property {(message: object) => void} onReceiveMessage Callback to run when a message is received.\n * @property {(peers: AvailablePeer[]) => void} setAvailablePeers Callback to run when peers change.\n * @property {string} [channelId]\n *\n * @typedef AvailablePeer\n * @property {string} id\n * @property {string} name\n * @property {string} color\n * @property {string} [avatarUrl]\n *\n * @typedef CollaborationTransportDocMessage\n * @property {string} identity\n * @property {'doc'} type\n * @property {object} message\n *\n * @typedef CollaborationTransportSelectionMessage\n * @property {string} identity\n * @property {'selection'} type\n * @property {EditorSelection} selection\n *\n * @typedef EditorSelection\n * @property {object} start\n * @property {object} end\n */\n\n/**\n * @param {object} props\n * @param {CollaborationSettings} props.settings\n */\nfunction CollaborativeEditing( { settings } ) {\n\tuseYjs( {\n\t\tsettings,\n\t} );\n\n\treturn (\n\t\t\n\t\t\t \n\t\t \n\t);\n}\n\nexport default CollaborativeEditing;\n"],"file":"index.js"}
\ No newline at end of file
diff --git a/build/components/collaborative-editing/use-yjs/index.js b/build/components/collaborative-editing/use-yjs/index.js
index 808b89114..030c976c1 100644
--- a/build/components/collaborative-editing/use-yjs/index.js
+++ b/build/components/collaborative-editing/use-yjs/index.js
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = useYjs;
+exports.defaultColors = void 0;
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
@@ -67,6 +68,8 @@ var defaultColors = ['#4676C0', '#6F6EBE', '#9063B6', '#C3498D', '#9E6D14', '#3B
* @property {object} selectionEnd
*/
+exports.defaultColors = defaultColors;
+
function initYDoc(_x) {
return _initYDoc.apply(this, arguments);
}
@@ -147,7 +150,8 @@ function _initYDoc() {
user: {
identity: identity,
name: settings.username,
- color: settings.caretColor || (0, _lodash.sample)(defaultColors)
+ color: settings.caretColor || (0, _lodash.sample)(defaultColors),
+ avatarUrl: settings.avatarUrl
},
onReceiveMessage: onReceiveMessage,
setAvailablePeers: function setAvailablePeers(peers) {
diff --git a/build/components/collaborative-editing/use-yjs/index.js.map b/build/components/collaborative-editing/use-yjs/index.js.map
index b716d0a3f..a3c61468f 100644
--- a/build/components/collaborative-editing/use-yjs/index.js.map
+++ b/build/components/collaborative-editing/use-yjs/index.js.map
@@ -1 +1 @@
-{"version":3,"sources":["../../../../src/components/collaborative-editing/use-yjs/index.js"],"names":["debug","require","defaultColors","initYDoc","getBlocks","onRemoteDataChange","settings","getSelection","setPeerSelection","setAvailablePeers","channelId","transport","identity","doc","applyDataChanges","updatePostDoc","getData","postDocToObject","sendMessage","message","type","selectionStart","selectionEnd","selection","start","end","onReceiveMessage","data","receiveMessage","changes","blocks","connect","user","name","username","color","caretColor","peers","then","isFirstInChannel","startSharing","title","disconnect","window","addEventListener","useYjs","applyChangesToYjs","noop","select","getEditorSelection","updateBlocksWithUndo","enabled","console","error","onUnmount","current","getState"],"mappings":"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","sourcesContent":["/**\n * External dependencies\n */\nimport { v4 as uuidv4 } from 'uuid';\nimport { noop, sample } from 'lodash';\nimport { createDocument } from './yjs-doc';\nimport { postDocToObject, updatePostDoc } from './algorithms/yjs';\n\n/**\n * WordPress dependencies\n */\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { useEffect, useRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { addCollabFilters } from './filters';\nimport { registerCollabFormats } from './formats';\n\nconst debug = require( 'debug' )( 'iso-editor:collab' );\n\n/** @typedef {import('..').CollaborationSettings} CollaborationSettings */\n/** @typedef {import('..').CollaborationTransport} CollaborationTransport */\n/** @typedef {import('..').CollaborationTransportDocMessage} CollaborationTransportDocMessage */\n/** @typedef {import('..').CollaborationTransportSelectionMessage} CollaborationTransportSelectionMessage */\n/** @typedef {import('..').EditorSelection} EditorSelection */\n/** @typedef {import('../../block-editor-contents').OnUpdate} OnUpdate */\n\nconst defaultColors = [ '#4676C0', '#6F6EBE', '#9063B6', '#C3498D', '#9E6D14', '#3B4856', '#4A807A' ];\n\n/**\n * @param {object} opts - Hook options\n * @param {() => object[]} opts.getBlocks - Content to initialize the Yjs doc with.\n * @param {OnUpdate} opts.onRemoteDataChange - Function to update editor blocks in redux state.\n * @param {CollaborationSettings} opts.settings\n * @param {() => IsoEditorSelection} opts.getSelection\n * @param {import('../../../store/peers/actions').setAvailablePeers} opts.setAvailablePeers\n * @param {import('../../../store/peers/actions').setPeerSelection} opts.setPeerSelection\n *\n * @typedef IsoEditorSelection\n * @property {object} selectionStart\n * @property {object} selectionEnd\n */\nasync function initYDoc( {\n\tgetBlocks,\n\tonRemoteDataChange,\n\tsettings,\n\tgetSelection,\n\tsetPeerSelection,\n\tsetAvailablePeers,\n} ) {\n\tconst { channelId, transport } = settings;\n\n\t/** @type string */\n\tconst identity = uuidv4();\n\n\tdebug( `initYDoc (identity: ${ identity })` );\n\n\tconst doc = createDocument( {\n\t\tidentity,\n\t\tapplyDataChanges: updatePostDoc,\n\t\tgetData: postDocToObject,\n\t\t/** @param {object} message */\n\t\tsendMessage: ( message ) => {\n\t\t\tdebug( 'sendDocMessage', message );\n\t\t\ttransport.sendMessage( { type: 'doc', identity, message } );\n\n\t\t\tconst { selectionStart, selectionEnd } = getSelection() || {};\n\t\t\tdebug( 'sendSelection', selectionStart, selectionEnd );\n\t\t\ttransport.sendMessage( {\n\t\t\t\ttype: 'selection',\n\t\t\t\tidentity,\n\t\t\t\tselection: {\n\t\t\t\t\tstart: selectionStart,\n\t\t\t\t\tend: selectionEnd,\n\t\t\t\t},\n\t\t\t} );\n\t\t},\n\t} );\n\n\t/** @param {CollaborationTransportDocMessage|CollaborationTransportSelectionMessage} data */\n\tconst onReceiveMessage = ( data ) => {\n\t\tdebug( 'remote change received by transport', data );\n\n\t\tswitch ( data.type ) {\n\t\t\tcase 'doc': {\n\t\t\t\tdoc.receiveMessage( data.message );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase 'selection': {\n\t\t\t\tsetPeerSelection( data.identity, data.selection );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t};\n\n\tdoc.onRemoteDataChange( ( changes ) => {\n\t\tdebug( 'remote change received by ydoc', changes );\n\t\tonRemoteDataChange( changes.blocks );\n\t} );\n\n\treturn transport\n\t\t.connect( {\n\t\t\tuser: {\n\t\t\t\tidentity,\n\t\t\t\tname: settings.username,\n\t\t\t\tcolor: settings.caretColor || sample( defaultColors ),\n\t\t\t},\n\t\t\tonReceiveMessage,\n\t\t\tsetAvailablePeers: ( peers ) => {\n\t\t\t\tdebug( 'setAvailablePeers', peers );\n\t\t\t\tsetAvailablePeers( peers );\n\t\t\t},\n\t\t\tchannelId,\n\t\t} )\n\t\t.then( ( { isFirstInChannel } ) => {\n\t\t\tdebug( `connected (channelId: ${ channelId })` );\n\n\t\t\tif ( isFirstInChannel ) {\n\t\t\t\tdebug( 'first in channel' );\n\n\t\t\t\t// Fetching the blocks from redux now, after the transport has successfully connected,\n\t\t\t\t// ensures that we don't initialize the Yjs doc with stale blocks.\n\t\t\t\t// (This can happen if is given an onLoad handler.)\n\t\t\t\tdoc.startSharing( { title: '', blocks: getBlocks() } );\n\t\t\t} else {\n\t\t\t\tdoc.connect();\n\t\t\t}\n\n\t\t\tconst disconnect = () => {\n\t\t\t\ttransport.disconnect();\n\t\t\t\tdoc.disconnect();\n\t\t\t};\n\n\t\t\twindow.addEventListener( 'beforeunload', () => disconnect() );\n\n\t\t\treturn { doc, disconnect };\n\t\t} );\n}\n\n/**\n * @param {object} opts - Hook options\n * @param {CollaborationSettings} [opts.settings]\n */\nexport default function useYjs( { settings } ) {\n\tconst applyChangesToYjs = useRef( noop );\n\n\tconst { blocks, getBlocks, getSelection } = useSelect( ( select ) => {\n\t\treturn {\n\t\t\tblocks: select( 'isolated/editor' ).getBlocks(),\n\t\t\tgetBlocks: select( 'isolated/editor' ).getBlocks,\n\t\t\tgetSelection: select( 'isolated/editor' ).getEditorSelection,\n\t\t};\n\t}, [] );\n\n\tconst { setAvailablePeers, setPeerSelection, updateBlocksWithUndo } = useDispatch( 'isolated/editor' );\n\n\tuseEffect( () => {\n\t\tif ( ! settings?.enabled ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( ! settings.transport ) {\n\t\t\tconsole.error( `Collaborative editor is disabled because a transport module wasn't provided.` );\n\t\t\treturn;\n\t\t}\n\n\t\tdebug( 'registered collab formats' );\n\t\tregisterCollabFormats();\n\n\t\tdebug( 'added collab filters' );\n\t\taddCollabFilters();\n\n\t\tlet onUnmount = noop;\n\n\t\tinitYDoc( {\n\t\t\tonRemoteDataChange: updateBlocksWithUndo,\n\t\t\tsettings,\n\t\t\tgetBlocks,\n\t\t\tgetSelection,\n\t\t\tsetPeerSelection,\n\t\t\tsetAvailablePeers,\n\t\t} ).then( ( { doc, disconnect } ) => {\n\t\t\tonUnmount = () => {\n\t\t\t\tdebug( 'unmount' );\n\t\t\t\tdisconnect();\n\t\t\t};\n\n\t\t\tapplyChangesToYjs.current = ( blocks ) => {\n\t\t\t\tif ( doc.getState() !== 'on' ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tdebug( 'local changes applied to ydoc' );\n\t\t\t\tdoc.applyDataChanges( { blocks } );\n\t\t\t};\n\t\t} );\n\n\t\treturn () => onUnmount();\n\t}, [] );\n\n\tuseEffect( () => {\n\t\tapplyChangesToYjs.current( blocks );\n\t}, [ blocks ] );\n}\n"],"file":"index.js"}
\ No newline at end of file
+{"version":3,"sources":["../../../../src/components/collaborative-editing/use-yjs/index.js"],"names":["debug","require","defaultColors","initYDoc","getBlocks","onRemoteDataChange","settings","getSelection","setPeerSelection","setAvailablePeers","channelId","transport","identity","doc","applyDataChanges","updatePostDoc","getData","postDocToObject","sendMessage","message","type","selectionStart","selectionEnd","selection","start","end","onReceiveMessage","data","receiveMessage","changes","blocks","connect","user","name","username","color","caretColor","avatarUrl","peers","then","isFirstInChannel","startSharing","title","disconnect","window","addEventListener","useYjs","applyChangesToYjs","noop","select","getEditorSelection","updateBlocksWithUndo","enabled","console","error","onUnmount","current","getState"],"mappings":"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","sourcesContent":["/**\n * External dependencies\n */\nimport { v4 as uuidv4 } from 'uuid';\nimport { noop, sample } from 'lodash';\nimport { createDocument } from './yjs-doc';\nimport { postDocToObject, updatePostDoc } from './algorithms/yjs';\n\n/**\n * WordPress dependencies\n */\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { useEffect, useRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { addCollabFilters } from './filters';\nimport { registerCollabFormats } from './formats';\n\nconst debug = require( 'debug' )( 'iso-editor:collab' );\n\n/** @typedef {import('..').CollaborationSettings} CollaborationSettings */\n/** @typedef {import('..').CollaborationTransport} CollaborationTransport */\n/** @typedef {import('..').CollaborationTransportDocMessage} CollaborationTransportDocMessage */\n/** @typedef {import('..').CollaborationTransportSelectionMessage} CollaborationTransportSelectionMessage */\n/** @typedef {import('..').EditorSelection} EditorSelection */\n/** @typedef {import('../../block-editor-contents').OnUpdate} OnUpdate */\n\nexport const defaultColors = [ '#4676C0', '#6F6EBE', '#9063B6', '#C3498D', '#9E6D14', '#3B4856', '#4A807A' ];\n\n/**\n * @param {object} opts - Hook options\n * @param {() => object[]} opts.getBlocks - Content to initialize the Yjs doc with.\n * @param {OnUpdate} opts.onRemoteDataChange - Function to update editor blocks in redux state.\n * @param {CollaborationSettings} opts.settings\n * @param {() => IsoEditorSelection} opts.getSelection\n * @param {import('../../../store/peers/actions').setAvailablePeers} opts.setAvailablePeers\n * @param {import('../../../store/peers/actions').setPeerSelection} opts.setPeerSelection\n *\n * @typedef IsoEditorSelection\n * @property {object} selectionStart\n * @property {object} selectionEnd\n */\nasync function initYDoc( {\n\tgetBlocks,\n\tonRemoteDataChange,\n\tsettings,\n\tgetSelection,\n\tsetPeerSelection,\n\tsetAvailablePeers,\n} ) {\n\tconst { channelId, transport } = settings;\n\n\t/** @type string */\n\tconst identity = uuidv4();\n\n\tdebug( `initYDoc (identity: ${ identity })` );\n\n\tconst doc = createDocument( {\n\t\tidentity,\n\t\tapplyDataChanges: updatePostDoc,\n\t\tgetData: postDocToObject,\n\t\t/** @param {object} message */\n\t\tsendMessage: ( message ) => {\n\t\t\tdebug( 'sendDocMessage', message );\n\t\t\ttransport.sendMessage( { type: 'doc', identity, message } );\n\n\t\t\tconst { selectionStart, selectionEnd } = getSelection() || {};\n\t\t\tdebug( 'sendSelection', selectionStart, selectionEnd );\n\t\t\ttransport.sendMessage( {\n\t\t\t\ttype: 'selection',\n\t\t\t\tidentity,\n\t\t\t\tselection: {\n\t\t\t\t\tstart: selectionStart,\n\t\t\t\t\tend: selectionEnd,\n\t\t\t\t},\n\t\t\t} );\n\t\t},\n\t} );\n\n\t/** @param {CollaborationTransportDocMessage|CollaborationTransportSelectionMessage} data */\n\tconst onReceiveMessage = ( data ) => {\n\t\tdebug( 'remote change received by transport', data );\n\n\t\tswitch ( data.type ) {\n\t\t\tcase 'doc': {\n\t\t\t\tdoc.receiveMessage( data.message );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase 'selection': {\n\t\t\t\tsetPeerSelection( data.identity, data.selection );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t};\n\n\tdoc.onRemoteDataChange( ( changes ) => {\n\t\tdebug( 'remote change received by ydoc', changes );\n\t\tonRemoteDataChange( changes.blocks );\n\t} );\n\n\treturn transport\n\t\t.connect( {\n\t\t\tuser: {\n\t\t\t\tidentity,\n\t\t\t\tname: settings.username,\n\t\t\t\tcolor: settings.caretColor || sample( defaultColors ),\n\t\t\t\tavatarUrl: settings.avatarUrl,\n\t\t\t},\n\t\t\tonReceiveMessage,\n\t\t\tsetAvailablePeers: ( peers ) => {\n\t\t\t\tdebug( 'setAvailablePeers', peers );\n\t\t\t\tsetAvailablePeers( peers );\n\t\t\t},\n\t\t\tchannelId,\n\t\t} )\n\t\t.then( ( { isFirstInChannel } ) => {\n\t\t\tdebug( `connected (channelId: ${ channelId })` );\n\n\t\t\tif ( isFirstInChannel ) {\n\t\t\t\tdebug( 'first in channel' );\n\n\t\t\t\t// Fetching the blocks from redux now, after the transport has successfully connected,\n\t\t\t\t// ensures that we don't initialize the Yjs doc with stale blocks.\n\t\t\t\t// (This can happen if is given an onLoad handler.)\n\t\t\t\tdoc.startSharing( { title: '', blocks: getBlocks() } );\n\t\t\t} else {\n\t\t\t\tdoc.connect();\n\t\t\t}\n\n\t\t\tconst disconnect = () => {\n\t\t\t\ttransport.disconnect();\n\t\t\t\tdoc.disconnect();\n\t\t\t};\n\n\t\t\twindow.addEventListener( 'beforeunload', () => disconnect() );\n\n\t\t\treturn { doc, disconnect };\n\t\t} );\n}\n\n/**\n * @param {object} opts - Hook options\n * @param {CollaborationSettings} [opts.settings]\n */\nexport default function useYjs( { settings } ) {\n\tconst applyChangesToYjs = useRef( noop );\n\n\tconst { blocks, getBlocks, getSelection } = useSelect( ( select ) => {\n\t\treturn {\n\t\t\tblocks: select( 'isolated/editor' ).getBlocks(),\n\t\t\tgetBlocks: select( 'isolated/editor' ).getBlocks,\n\t\t\tgetSelection: select( 'isolated/editor' ).getEditorSelection,\n\t\t};\n\t}, [] );\n\n\tconst { setAvailablePeers, setPeerSelection, updateBlocksWithUndo } = useDispatch( 'isolated/editor' );\n\n\tuseEffect( () => {\n\t\tif ( ! settings?.enabled ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( ! settings.transport ) {\n\t\t\tconsole.error( `Collaborative editor is disabled because a transport module wasn't provided.` );\n\t\t\treturn;\n\t\t}\n\n\t\tdebug( 'registered collab formats' );\n\t\tregisterCollabFormats();\n\n\t\tdebug( 'added collab filters' );\n\t\taddCollabFilters();\n\n\t\tlet onUnmount = noop;\n\n\t\tinitYDoc( {\n\t\t\tonRemoteDataChange: updateBlocksWithUndo,\n\t\t\tsettings,\n\t\t\tgetBlocks,\n\t\t\tgetSelection,\n\t\t\tsetPeerSelection,\n\t\t\tsetAvailablePeers,\n\t\t} ).then( ( { doc, disconnect } ) => {\n\t\t\tonUnmount = () => {\n\t\t\t\tdebug( 'unmount' );\n\t\t\t\tdisconnect();\n\t\t\t};\n\n\t\t\tapplyChangesToYjs.current = ( blocks ) => {\n\t\t\t\tif ( doc.getState() !== 'on' ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tdebug( 'local changes applied to ydoc' );\n\t\t\t\tdoc.applyDataChanges( { blocks } );\n\t\t\t};\n\t\t} );\n\n\t\treturn () => onUnmount();\n\t}, [] );\n\n\tuseEffect( () => {\n\t\tapplyChangesToYjs.current( blocks );\n\t}, [ blocks ] );\n}\n"],"file":"index.js"}
\ No newline at end of file
diff --git a/build/components/formats/collab-caret/index.js b/build/components/formats/collab-caret/index.js
deleted file mode 100644
index c253d53e7..000000000
--- a/build/components/formats/collab-caret/index.js
+++ /dev/null
@@ -1,139 +0,0 @@
-"use strict";
-
-var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-exports.applyCarets = applyCarets;
-exports.registerFormatCollabCaret = exports.settings = void 0;
-
-var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
-
-var _memize = _interopRequireDefault(require("memize"));
-
-var _classnames = _interopRequireDefault(require("classnames"));
-
-var _richText = require("@wordpress/rich-text");
-
-require("./style.scss");
-
-/**
- * External dependencies
- */
-
-/**
- * WordPress dependencies
- */
-
-/**
- * Internal dependencies
- */
-var FORMAT_NAME = 'isolated/collab-caret';
-/**
- * Applies given carets to the given record.
- *
- * @param {Object} record The record to apply carets to.
- * @param {Array} carets The carets to apply.
- * @return {Object} A record with the carets applied.
- */
-
-function applyCarets(record) {
- var carets = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
- carets.forEach(function (caret) {
- var start = caret.start,
- end = caret.end,
- id = caret.id,
- color = caret.color,
- label = caret.label;
- var isCollapsed = start === end;
- var isShifted = isCollapsed && end >= record.text.length;
-
- if (isShifted) {
- start = record.text.length - 1;
- }
-
- if (isCollapsed) {
- end = start + 1;
- }
-
- record = (0, _richText.applyFormat)(record, {
- type: FORMAT_NAME,
- attributes: {
- id: 'iso-editor-collab-caret-' + id,
- "class": (0, _classnames["default"])({
- 'is-collapsed': isCollapsed,
- 'is-shifted': isShifted
- }),
- title: label,
- style: "--iso-editor-collab-caret-color: ".concat(color || '#2e3d48')
- }
- }, start, end);
- });
- return record;
-}
-
-var getCarets = (0, _memize["default"])(function (peers, richTextIdentifier, blockClientId) {
- return Object.entries(peers).filter(function (_ref) {
- var _peer$start, _peer$end;
-
- var _ref2 = (0, _slicedToArray2["default"])(_ref, 2),
- peer = _ref2[1];
-
- return (peer === null || peer === void 0 ? void 0 : (_peer$start = peer.start) === null || _peer$start === void 0 ? void 0 : _peer$start.clientId) === blockClientId && (peer === null || peer === void 0 ? void 0 : (_peer$end = peer.end) === null || _peer$end === void 0 ? void 0 : _peer$end.clientId) === blockClientId && peer.start.attributeKey === richTextIdentifier;
- }).map(function (_ref3) {
- var _ref4 = (0, _slicedToArray2["default"])(_ref3, 2),
- id = _ref4[0],
- peer = _ref4[1];
-
- return {
- id: id,
- label: peer.name,
- start: peer.start.offset,
- end: peer.end.offset,
- color: peer.color
- };
- });
-});
-var settings = {
- title: 'Collaboration peer caret',
- tagName: 'mark',
- className: 'iso-editor-collab-caret',
- attributes: {
- id: 'id',
- className: 'class'
- },
- edit: function edit() {
- return null;
- },
- __experimentalGetPropsForEditableTreePreparation: function __experimentalGetPropsForEditableTreePreparation(select, _ref5) {
- var richTextIdentifier = _ref5.richTextIdentifier,
- blockClientId = _ref5.blockClientId;
- return {
- carets: getCarets(select('isolated/editor').getPeers(), richTextIdentifier, blockClientId)
- };
- },
- __experimentalCreatePrepareEditableTree: function __experimentalCreatePrepareEditableTree(_ref6) {
- var carets = _ref6.carets;
- return function (formats, text) {
- if (!(carets !== null && carets !== void 0 && carets.length)) {
- return formats;
- }
-
- var record = {
- formats: formats,
- text: text
- };
- record = applyCarets(record, carets);
- return record.formats;
- };
- }
-};
-exports.settings = settings;
-
-var registerFormatCollabCaret = function registerFormatCollabCaret() {
- (0, _richText.registerFormatType)(FORMAT_NAME, settings);
-};
-
-exports.registerFormatCollabCaret = registerFormatCollabCaret;
-//# sourceMappingURL=index.js.map
\ No newline at end of file
diff --git a/build/components/formats/collab-caret/index.js.map b/build/components/formats/collab-caret/index.js.map
deleted file mode 100644
index 6d0957c4e..000000000
--- a/build/components/formats/collab-caret/index.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"sources":["../../../../src/components/formats/collab-caret/index.js"],"names":["FORMAT_NAME","applyCarets","record","carets","forEach","caret","start","end","id","color","label","isCollapsed","isShifted","text","length","type","attributes","title","style","getCarets","peers","richTextIdentifier","blockClientId","Object","entries","filter","peer","clientId","attributeKey","map","name","offset","settings","tagName","className","edit","__experimentalGetPropsForEditableTreePreparation","select","getPeers","__experimentalCreatePrepareEditableTree","formats","registerFormatCollabCaret"],"mappings":"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","sourcesContent":["/**\n * External dependencies\n */\nimport memoize from 'memize';\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { applyFormat, registerFormatType } from '@wordpress/rich-text';\n\n/**\n * Internal dependencies\n */\nimport './style.scss';\n\nconst FORMAT_NAME = 'isolated/collab-caret';\n\n/**\n * Applies given carets to the given record.\n *\n * @param {Object} record The record to apply carets to.\n * @param {Array} carets The carets to apply.\n * @return {Object} A record with the carets applied.\n */\nexport function applyCarets( record, carets = [] ) {\n\tcarets.forEach( ( caret ) => {\n\t\tlet { start, end, id, color, label } = caret;\n\t\tconst isCollapsed = start === end;\n\t\tconst isShifted = isCollapsed && end >= record.text.length;\n\n\t\tif ( isShifted ) {\n\t\t\tstart = record.text.length - 1;\n\t\t}\n\n\t\tif ( isCollapsed ) {\n\t\t\tend = start + 1;\n\t\t}\n\n\t\trecord = applyFormat(\n\t\t\trecord,\n\t\t\t{\n\t\t\t\ttype: FORMAT_NAME,\n\t\t\t\tattributes: {\n\t\t\t\t\tid: 'iso-editor-collab-caret-' + id,\n\t\t\t\t\tclass: classnames( {\n\t\t\t\t\t\t'is-collapsed': isCollapsed,\n\t\t\t\t\t\t'is-shifted': isShifted,\n\t\t\t\t\t} ),\n\t\t\t\t\ttitle: label,\n\t\t\t\t\tstyle: `--iso-editor-collab-caret-color: ${ color || '#2e3d48' }`,\n\t\t\t\t},\n\t\t\t},\n\t\t\tstart,\n\t\t\tend\n\t\t);\n\t} );\n\n\treturn record;\n}\n\nconst getCarets = memoize( ( peers, richTextIdentifier, blockClientId ) => {\n\treturn Object.entries( peers )\n\t\t.filter( ( [ , peer ] ) => {\n\t\t\treturn (\n\t\t\t\tpeer?.start?.clientId === blockClientId &&\n\t\t\t\tpeer?.end?.clientId === blockClientId &&\n\t\t\t\tpeer.start.attributeKey === richTextIdentifier\n\t\t\t);\n\t\t} )\n\t\t.map( ( [ id, peer ] ) => ( {\n\t\t\tid,\n\t\t\tlabel: peer.name,\n\t\t\tstart: peer.start.offset,\n\t\t\tend: peer.end.offset,\n\t\t\tcolor: peer.color,\n\t\t} ) );\n} );\n\nexport const settings = {\n\ttitle: 'Collaboration peer caret',\n\ttagName: 'mark',\n\tclassName: 'iso-editor-collab-caret',\n\tattributes: {\n\t\tid: 'id',\n\t\tclassName: 'class',\n\t},\n\tedit() {\n\t\treturn null;\n\t},\n\t__experimentalGetPropsForEditableTreePreparation( select, { richTextIdentifier, blockClientId } ) {\n\t\treturn {\n\t\t\tcarets: getCarets( select( 'isolated/editor' ).getPeers(), richTextIdentifier, blockClientId ),\n\t\t};\n\t},\n\t__experimentalCreatePrepareEditableTree( { carets } ) {\n\t\treturn ( formats, text ) => {\n\t\t\tif ( ! carets?.length ) {\n\t\t\t\treturn formats;\n\t\t\t}\n\n\t\t\tlet record = { formats, text };\n\t\t\trecord = applyCarets( record, carets );\n\t\t\treturn record.formats;\n\t\t};\n\t},\n};\n\nexport const registerFormatCollabCaret = () => {\n\tregisterFormatType( FORMAT_NAME, settings );\n};\n"],"file":"index.js"}
\ No newline at end of file
diff --git a/build/components/formats/collab-caret/style.scss b/build/components/formats/collab-caret/style.scss
deleted file mode 100644
index 5969efcfa..000000000
--- a/build/components/formats/collab-caret/style.scss
+++ /dev/null
@@ -1,48 +0,0 @@
-mark.iso-editor-collab-caret {
- position: relative;
- background: #eee;
- color: currentColor;
-}
-
-mark.iso-editor-collab-caret.is-collapsed {
- background: none;
-}
-
-mark.iso-editor-collab-caret::before {
- left: -1px;
- top: 0;
- bottom: 0;
- position: absolute;
- content: '';
- font-size: 1em;
- width: 2px;
- background: var( --iso-editor-collab-caret-color );
-}
-
-mark.iso-editor-collab-caret.is-shifted::before {
- left: auto;
- right: -1px;
-}
-
-mark.iso-editor-collab-caret::after {
- position: absolute;
- top: -14px;
- right: -4px;
- overflow: hidden;
- min-width: 8px;
- max-width: 140px;
- text-overflow: ellipsis;
- min-height: 8px;
- padding: 2px 4px 3px;
- content: attr( title ); // identity
- color: white;
- vertical-align: top;
- font-size: 10px;
- line-height: 1;
- white-space: nowrap;
- background: var( --iso-editor-collab-caret-color );
-
- // Ensure that bold/italic isn't inherited from the editor selection
- font-style: normal;
- font-weight: normal;
-}
diff --git a/build/store/peers/reducer.js b/build/store/peers/reducer.js
index 3557717a4..ff818add2 100644
--- a/build/store/peers/reducer.js
+++ b/build/store/peers/reducer.js
@@ -32,10 +32,12 @@ var reducer = function reducer() {
return action.peers.reduce(function (acc, _ref) {
var id = _ref.id,
name = _ref.name,
- color = _ref.color;
+ color = _ref.color,
+ avatarUrl = _ref.avatarUrl;
acc[id] = state[id] || {
name: name,
- color: color
+ color: color,
+ avatarUrl: avatarUrl
};
return acc;
}, {});
diff --git a/build/store/peers/reducer.js.map b/build/store/peers/reducer.js.map
index 7abf8ccd9..cad31fe59 100644
--- a/build/store/peers/reducer.js.map
+++ b/build/store/peers/reducer.js.map
@@ -1 +1 @@
-{"version":3,"sources":["../../../src/store/peers/reducer.js"],"names":["reducer","state","action","type","peerId","selection","peers","reduce","acc","id","name","color"],"mappings":";;;;;;;;;;;;;;;AAAA,IAAMA,OAAO,GAAG,SAAVA,OAAU,GAA0B;AAAA,MAAxBC,KAAwB,uEAAhB,EAAgB;AAAA,MAAZC,MAAY;;AACzC,UAASA,MAAM,CAACC,IAAhB;AACC,SAAK,oBAAL;AAA2B;AAC1B,YAAK,CAAEF,KAAK,CAAEC,MAAM,CAACE,MAAT,CAAZ,EAAgC;AAC/B,iBAAOH,KAAP;AACA;;AACD,+CACIA,KADJ,4CAEGC,MAAM,CAACE,MAFV,kCAGKH,KAAK,CAAEC,MAAM,CAACE,MAAT,CAHV,GAIKF,MAAM,CAACG,SAJZ;AAOA;;AAED,SAAK,qBAAL;AAA4B;AAC3B,eAAOH,MAAM,CAACI,KAAP,CAAaC,MAAb,CAAqB,UAAEC,GAAF,QAAgC;AAAA,cAAvBC,EAAuB,QAAvBA,EAAuB;AAAA,cAAnBC,IAAmB,QAAnBA,IAAmB;AAAA,cAAbC,KAAa,QAAbA,KAAa;AAC3DH,UAAAA,GAAG,CAAEC,EAAF,CAAH,GAAYR,KAAK,CAAEQ,EAAF,CAAL,IAAe;AAAEC,YAAAA,IAAI,EAAJA,IAAF;AAAQC,YAAAA,KAAK,EAALA;AAAR,WAA3B;AACA,iBAAOH,GAAP;AACA,SAHM,EAGJ,EAHI,CAAP;AAIA;AAnBF;;AAsBA,SAAOP,KAAP;AACA,CAxBD;;eA0BeD,O","sourcesContent":["const reducer = ( state = {}, action ) => {\n\tswitch ( action.type ) {\n\t\tcase 'SET_PEER_SELECTION': {\n\t\t\tif ( ! state[ action.peerId ] ) {\n\t\t\t\treturn state;\n\t\t\t}\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\t[ action.peerId ]: {\n\t\t\t\t\t...state[ action.peerId ],\n\t\t\t\t\t...action.selection,\n\t\t\t\t},\n\t\t\t};\n\t\t}\n\n\t\tcase 'SET_AVAILABLE_PEERS': {\n\t\t\treturn action.peers.reduce( ( acc, { id, name, color } ) => {\n\t\t\t\tacc[ id ] = state[ id ] || { name, color };\n\t\t\t\treturn acc;\n\t\t\t}, {} );\n\t\t}\n\t}\n\n\treturn state;\n};\n\nexport default reducer;\n"],"file":"reducer.js"}
\ No newline at end of file
+{"version":3,"sources":["../../../src/store/peers/reducer.js"],"names":["reducer","state","action","type","peerId","selection","peers","reduce","acc","id","name","color","avatarUrl"],"mappings":";;;;;;;;;;;;;;;AAAA,IAAMA,OAAO,GAAG,SAAVA,OAAU,GAA0B;AAAA,MAAxBC,KAAwB,uEAAhB,EAAgB;AAAA,MAAZC,MAAY;;AACzC,UAASA,MAAM,CAACC,IAAhB;AACC,SAAK,oBAAL;AAA2B;AAC1B,YAAK,CAAEF,KAAK,CAAEC,MAAM,CAACE,MAAT,CAAZ,EAAgC;AAC/B,iBAAOH,KAAP;AACA;;AACD,+CACIA,KADJ,4CAEGC,MAAM,CAACE,MAFV,kCAGKH,KAAK,CAAEC,MAAM,CAACE,MAAT,CAHV,GAIKF,MAAM,CAACG,SAJZ;AAOA;;AAED,SAAK,qBAAL;AAA4B;AAC3B,eAAOH,MAAM,CAACI,KAAP,CAAaC,MAAb,CAAqB,UAAEC,GAAF,QAA2C;AAAA,cAAlCC,EAAkC,QAAlCA,EAAkC;AAAA,cAA9BC,IAA8B,QAA9BA,IAA8B;AAAA,cAAxBC,KAAwB,QAAxBA,KAAwB;AAAA,cAAjBC,SAAiB,QAAjBA,SAAiB;AACtEJ,UAAAA,GAAG,CAAEC,EAAF,CAAH,GAAYR,KAAK,CAAEQ,EAAF,CAAL,IAAe;AAAEC,YAAAA,IAAI,EAAJA,IAAF;AAAQC,YAAAA,KAAK,EAALA,KAAR;AAAeC,YAAAA,SAAS,EAATA;AAAf,WAA3B;AACA,iBAAOJ,GAAP;AACA,SAHM,EAGJ,EAHI,CAAP;AAIA;AAnBF;;AAsBA,SAAOP,KAAP;AACA,CAxBD;;eA0BeD,O","sourcesContent":["const reducer = ( state = {}, action ) => {\n\tswitch ( action.type ) {\n\t\tcase 'SET_PEER_SELECTION': {\n\t\t\tif ( ! state[ action.peerId ] ) {\n\t\t\t\treturn state;\n\t\t\t}\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\t[ action.peerId ]: {\n\t\t\t\t\t...state[ action.peerId ],\n\t\t\t\t\t...action.selection,\n\t\t\t\t},\n\t\t\t};\n\t\t}\n\n\t\tcase 'SET_AVAILABLE_PEERS': {\n\t\t\treturn action.peers.reduce( ( acc, { id, name, color, avatarUrl } ) => {\n\t\t\t\tacc[ id ] = state[ id ] || { name, color, avatarUrl };\n\t\t\t\treturn acc;\n\t\t\t}, {} );\n\t\t}\n\t}\n\n\treturn state;\n};\n\nexport default reducer;\n"],"file":"reducer.js"}
\ No newline at end of file
diff --git a/package.json b/package.json
index ff127bfb3..a7c2cc634 100644
--- a/package.json
+++ b/package.json
@@ -38,6 +38,7 @@
"@wordpress/annotations": "^2.2.1",
"@wordpress/api-fetch": "^5.2.1",
"@wordpress/autop": "^3.2.1",
+ "@wordpress/base-styles": "^3.6.0",
"@wordpress/blob": "^3.2.1",
"@wordpress/block-editor": "^7.0.0",
"@wordpress/block-library": "^5.0.0",
diff --git a/src/components/block-editor-toolbar/style.scss b/src/components/block-editor-toolbar/style.scss
index f130f9134..85352522d 100644
--- a/src/components/block-editor-toolbar/style.scss
+++ b/src/components/block-editor-toolbar/style.scss
@@ -68,7 +68,6 @@
.edit-post-header__settings {
display: inline-flex;
align-items: center;
- flex-wrap: wrap;
button.components-button.has-icon {
margin-right: 0;
diff --git a/src/components/collaborative-editing/README.md b/src/components/collaborative-editing/README.md
index 5b697cc48..b751ca684 100644
--- a/src/components/collaborative-editing/README.md
+++ b/src/components/collaborative-editing/README.md
@@ -8,6 +8,7 @@
- _settings.channelId_ `[string]` - Optional channel id to pass to `transport.connect()`.
- _settings.username_ `string` - Name displayed to peers. Required if collab is enabled.
- _settings.caretColor_ `[string]` - Color of the caret indicator displayed to peers. If unspecified, a random color will be selected.
+- _settings.avatarUrl_ `[string]` - Presence avatar displayed to peers. If unspecified, the first character of the username will be shown.
- _settings.transport_ `CollaborationTransport` - Transport module to handle messaging between peers. See the section below for how this should be implemented.
## Implementing a transport module
diff --git a/src/components/collaborative-editing/components/avatars/Avatars.stories.tsx b/src/components/collaborative-editing/components/avatars/Avatars.stories.tsx
new file mode 100644
index 000000000..c2194058a
--- /dev/null
+++ b/src/components/collaborative-editing/components/avatars/Avatars.stories.tsx
@@ -0,0 +1,49 @@
+import { sample } from 'lodash';
+
+import { CollaborativeEditingAvatars, CollaborativeEditingAvatar } from '.';
+import { defaultColors } from '../../use-yjs';
+
+import type { Story } from '@storybook/react';
+
+export default {
+ title: 'Collaboration/Components/Avatars',
+ component: CollaborativeEditingAvatars,
+};
+
+const generateRandomPeers = ( count ) => {
+ return count
+ ? [ ...Array( count ) ].map( ( peer, index ) => ( {
+ id: index.toString(),
+ name: `Peery Collabson ${ index }`,
+ avatarUrl: `https://i.pravatar.cc/64?cacheBust=${ Math.random() }`,
+ color: sample( defaultColors ) as string,
+ } ) )
+ : [];
+};
+
+type Props = {
+ peerCount: number;
+};
+
+const Template: Story< Props > = ( { peerCount } ) => {
+ return ;
+};
+
+export const Default = Template.bind( {} );
+Default.args = {
+ peerCount: 25,
+};
+
+export const Empty = Template.bind( {} );
+Empty.args = {
+ peerCount: 0,
+};
+
+export const NoImage = ( args ) => {
+ return ;
+};
+NoImage.args = {
+ id: 0,
+ name: 'Peery Collabson',
+ color: sample( defaultColors ),
+};
diff --git a/src/components/collaborative-editing/components/avatars/index.js b/src/components/collaborative-editing/components/avatars/index.js
new file mode 100644
index 000000000..1db3238d4
--- /dev/null
+++ b/src/components/collaborative-editing/components/avatars/index.js
@@ -0,0 +1,120 @@
+/**
+ * WordPress dependencies
+ */
+import { Popover, VisuallyHidden } from '@wordpress/components';
+import { withSelect } from '@wordpress/data';
+import { useState } from '@wordpress/element';
+import { __, sprintf } from '@wordpress/i18n';
+
+import './style.scss';
+
+/**
+ * @param {object} props
+ * @param {import("../..").AvailablePeer[]} props.peers
+ */
+export function CollaborativeEditingAvatars( { peers } ) {
+ const MAX_AVATAR_COUNT = 3;
+
+ return (
+
+ Currently editing:
+
+ { peers.slice( 0, MAX_AVATAR_COUNT ).map( ( peer ) => (
+
+ ) ) }
+
+ { peers.length > MAX_AVATAR_COUNT && (
+
+ ) }
+
+ );
+}
+
+export function CollaborativeEditingAvatar( { peer } ) {
+ const [ isVisible, setIsVisible ] = useState( false );
+
+ return (
+ setIsVisible( true ) }
+ onMouseLeave={ () => setIsVisible( false ) }
+ style={ {
+ borderColor: peer.color,
+ background: peer.color,
+ } }
+ >
+ { isVisible && (
+
+ { peer.name }
+
+ ) }
+ { peer.avatarUrl ? (
+
+ ) : (
+
{ peer.name.charAt( 0 ) }
+ ) }
+
+ );
+}
+
+export function CollaborativeEditingAvatarsOverflow( { peers } ) {
+ const MAX_NAME_COUNT = 20;
+ const [ isVisible, setIsVisible ] = useState( false );
+
+ const NameList = () => {
+ return (
+ <>
+
+ { peers.slice( 0, MAX_NAME_COUNT ).map( ( peer ) => (
+
+ { peer.name }
+
+ ) ) }
+
+ { peers.length > MAX_NAME_COUNT && (
+
+ { sprintf(
+ /* translators: %s: number of how many more users there are */
+ __( 'and %s more' ),
+ peers.length - MAX_NAME_COUNT
+ ) }
+
+ ) }
+ >
+ );
+ };
+
+ return (
+
+ { isVisible && (
+
+
+
+ ) }
+
setIsVisible( true ) }
+ onMouseLeave={ () => setIsVisible( false ) }
+ >
+ { `+${ peers.length }` }
+
+
+
+
+
+ );
+}
+
+export default withSelect( ( select ) => {
+ const peers = select( 'isolated/editor' ).getPeers();
+
+ return {
+ peers: Object.keys( peers ).map( ( id ) => {
+ return {
+ id,
+ ...peers[ id ],
+ };
+ } ),
+ };
+} )( CollaborativeEditingAvatars );
diff --git a/src/components/collaborative-editing/components/avatars/style.scss b/src/components/collaborative-editing/components/avatars/style.scss
new file mode 100644
index 000000000..b0aa98dee
--- /dev/null
+++ b/src/components/collaborative-editing/components/avatars/style.scss
@@ -0,0 +1,87 @@
+@import '@wordpress/base-styles/_colors';
+@import '@wordpress/base-styles/_variables';
+
+$avatarSize: 32px;
+
+.iso-editor-collab-avatars {
+ display: flex;
+ align-items: center;
+ margin: 0 8px;
+}
+
+.iso-editor-collab-avatars__avatar {
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ width: $avatarSize;
+ height: $avatarSize;
+ border-radius: 50%;
+ border-width: 2px;
+ border-style: solid;
+
+ & + & {
+ margin-left: -4px;
+ box-shadow: 0 0 0 2px $white;
+ }
+}
+
+.iso-editor-collab-avatars__popover {
+ // Mostly mimic styles for the core Tooltip component.
+ // (We could've simply used core Tooltip if the delay was shorter
+ // and it accepted multi-line text.)
+ .components-popover__content {
+ transform: translateY( 8px );
+ background: $gray-900;
+ border-radius: $radius-block-ui;
+ border-width: 0;
+ color: $white;
+ white-space: nowrap;
+ line-height: 1.4;
+ font-size: 12px;
+ box-shadow: none;
+
+ > div {
+ padding: $grid-unit-05 $grid-unit-10;
+ }
+ }
+}
+
+.iso-editor-collab-avatars__image {
+ width: inherit;
+ height: inherit;
+ border-radius: inherit;
+}
+
+.iso-editor-collab-avatars__name-initial {
+ font-size: 20px;
+ line-height: 1;
+ color: $white;
+ text-transform: uppercase;
+ cursor: default;
+}
+
+.iso-editor-collab-avatars__overflow {
+ margin-left: 4px;
+ height: 100%;
+ cursor: default;
+}
+
+.iso-editor-collab-avatars__overflow-list {
+ margin: 0;
+ padding: 0;
+ list-style: none;
+}
+
+.iso-editor-collab-avatars__overflow-list-item {
+ margin: 0;
+ line-height: 1;
+
+ & + & {
+ margin-top: 6px;
+ }
+}
+
+.iso-editor-collab-avatars__overflow-more {
+ margin: 6px 0 0;
+ line-height: 1;
+}
diff --git a/src/components/collaborative-editing/index.js b/src/components/collaborative-editing/index.js
index e63b1273f..26730e628 100644
--- a/src/components/collaborative-editing/index.js
+++ b/src/components/collaborative-editing/index.js
@@ -1,7 +1,9 @@
/**
* Internal dependencies
*/
+import { ToolbarSlot } from '../..';
import useYjs from './use-yjs';
+import CollaborativeEditingAvatars from './components/avatars';
/**
* Real-time collaboration settings
@@ -10,6 +12,7 @@ import useYjs from './use-yjs';
* @property {string} [channelId] Optional channel id to pass to transport.connect().
* @property {string} username Name displayed to peers. Required if collab is enabled.
* @property {string} [caretColor] Color of the caret indicator displayed to peers. If unspecified, a random color will be selected.
+ * @property {string} [avatarUrl] Url of the avatar image diplayed to peers.
* @property {CollaborationTransport} transport Required if collab is enabled.
*/
@@ -24,6 +27,7 @@ import useYjs from './use-yjs';
* @property {object} user
* @property {string} user.identity
* @property {string} user.name
+ * @property {string} [user.avatarUrl]
* @property {string} [user.color] Color of the caret indicator displayed to peers.
* @property {(message: object) => void} onReceiveMessage Callback to run when a message is received.
* @property {(peers: AvailablePeer[]) => void} setAvailablePeers Callback to run when peers change.
@@ -33,6 +37,7 @@ import useYjs from './use-yjs';
* @property {string} id
* @property {string} name
* @property {string} color
+ * @property {string} [avatarUrl]
*
* @typedef CollaborationTransportDocMessage
* @property {string} identity
@@ -58,7 +63,11 @@ function CollaborativeEditing( { settings } ) {
settings,
} );
- return null;
+ return (
+
+
+
+ );
}
export default CollaborativeEditing;
diff --git a/src/components/collaborative-editing/use-yjs/index.js b/src/components/collaborative-editing/use-yjs/index.js
index e8f991e44..ebdba282f 100644
--- a/src/components/collaborative-editing/use-yjs/index.js
+++ b/src/components/collaborative-editing/use-yjs/index.js
@@ -27,7 +27,7 @@ const debug = require( 'debug' )( 'iso-editor:collab' );
/** @typedef {import('..').EditorSelection} EditorSelection */
/** @typedef {import('../../block-editor-contents').OnUpdate} OnUpdate */
-const defaultColors = [ '#4676C0', '#6F6EBE', '#9063B6', '#C3498D', '#9E6D14', '#3B4856', '#4A807A' ];
+export const defaultColors = [ '#4676C0', '#6F6EBE', '#9063B6', '#C3498D', '#9E6D14', '#3B4856', '#4A807A' ];
/**
* @param {object} opts - Hook options
@@ -106,6 +106,7 @@ async function initYDoc( {
identity,
name: settings.username,
color: settings.caretColor || sample( defaultColors ),
+ avatarUrl: settings.avatarUrl,
},
onReceiveMessage,
setAvailablePeers: ( peers ) => {
diff --git a/src/store/peers/reducer.js b/src/store/peers/reducer.js
index a13eb82cd..a3001cdd1 100644
--- a/src/store/peers/reducer.js
+++ b/src/store/peers/reducer.js
@@ -14,8 +14,8 @@ const reducer = ( state = {}, action ) => {
}
case 'SET_AVAILABLE_PEERS': {
- return action.peers.reduce( ( acc, { id, name, color } ) => {
- acc[ id ] = state[ id ] || { name, color };
+ return action.peers.reduce( ( acc, { id, name, color, avatarUrl } ) => {
+ acc[ id ] = state[ id ] || { name, color, avatarUrl };
return acc;
}, {} );
}
diff --git a/stories/collab/Collaboration.stories.tsx b/stories/collab/Collaboration.stories.tsx
index a4566b1b4..6059e82c1 100644
--- a/stories/collab/Collaboration.stories.tsx
+++ b/stories/collab/Collaboration.stories.tsx
@@ -75,6 +75,7 @@ Default.args = {
channelId: 'default',
transport: mockTransport( 'default' ),
username,
+ avatarUrl: `https://i.pravatar.cc/64?cacheBust=${ Math.random() }`,
},
};
diff --git a/stories/collab/mock-transport.js b/stories/collab/mock-transport.js
index b59b95ad4..160fd528c 100644
--- a/stories/collab/mock-transport.js
+++ b/stories/collab/mock-transport.js
@@ -6,7 +6,7 @@ const mockTransport = ( channelId ) => ( {
sendMessage: ( data ) => {
window.localStorage.setItem( `isoEditorYjsMessage-${ channelId }`, JSON.stringify( data ) );
},
- connect: ( { user: { identity, name, color }, onReceiveMessage, setAvailablePeers, channelId } ) => {
+ connect: ( { user: { identity, name, color, avatarUrl }, onReceiveMessage, setAvailablePeers, channelId } ) => {
listeners.push(
{
event: 'storage',
@@ -39,7 +39,7 @@ const mockTransport = ( channelId ) => ( {
window.localStorage.setItem(
`isoEditorYjsPeers-${ channelId }`,
- JSON.stringify( [ ...peers, { id: identity, name, color } ] )
+ JSON.stringify( [ ...peers, { id: identity, name, color, avatarUrl } ] )
);
disconnectHandlers.push( () => {