>=1;return(f&h-1)+h}function u(f,m,h,g,v){do g-=h,f[m+g]=new s(v.bits,v.value);while(g>0)}function d(f,m,h){for(var g=1<0;--E[y])_=new s(y&255,k[w++]&65535),u(f,m+S,x,R,_),S=c(S,y);for(A=N-1,C=-1,y=h+1,x=2;y<=l;++y,x<<=1)for(;E[y]>0;--E[y])(S&A)!==C&&(m+=R,P=d(E,y,h),R=1<>h),x,R,_),S=c(S,y);return N}},{}],8:[function(o,n,i){"use strict";i.byteLength=h,i.toByteArray=v,i.fromByteArray=y;for(var s=[],l=[],c=typeof Uint8Array<"u"?Uint8Array:Array,u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",d=0,f=u.length;d0)throw new Error("Invalid string. Length must be a multiple of 4");var x=w.indexOf("=");x===-1&&(x=S);var C=x===S?0:4-x%4;return[x,C]}function h(w){var S=m(w),x=S[0],C=S[1];return(x+C)*3/4-C}function g(w,S,x){return(S+x)*3/4-x}function v(w){for(var S,x=m(w),C=x[0],A=x[1],P=new c(g(w,C,A)),R=0,N=A>0?C-4:C,k=0;k>16&255,P[R++]=S>>8&255,P[R++]=S&255;return A===2&&(S=l[w.charCodeAt(k)]<<2|l[w.charCodeAt(k+1)]>>4,P[R++]=S&255),A===1&&(S=l[w.charCodeAt(k)]<<10|l[w.charCodeAt(k+1)]<<4|l[w.charCodeAt(k+2)]>>2,P[R++]=S>>8&255,P[R++]=S&255),P}function b(w){return s[w>>18&63]+s[w>>12&63]+s[w>>6&63]+s[w&63]}function _(w,S,x){for(var C,A=[],P=S;PN?N:R+P));return C===1?(S=w[x-1],A.push(s[S>>2]+s[S<<4&63]+"==")):C===2&&(S=(w[x-2]<<8)+w[x-1],A.push(s[S>>10]+s[S>>4&63]+s[S<<2&63]+"=")),A.join("")}},{}],9:[function(o,n,i){function s(l,c){this.offset=l,this.nbits=c}i.kBlockLengthPrefixCode=[new s(1,2),new s(5,2),new s(9,2),new s(13,2),new s(17,3),new s(25,3),new s(33,3),new s(41,3),new s(49,4),new s(65,4),new s(81,4),new s(97,4),new s(113,5),new s(145,5),new s(177,5),new s(209,5),new s(241,6),new s(305,6),new s(369,7),new s(497,8),new s(753,9),new s(1265,10),new s(2289,11),new s(4337,12),new s(8433,13),new s(16625,24)],i.kInsertLengthPrefixCode=[new s(0,0),new s(1,0),new s(2,0),new s(3,0),new s(4,0),new s(5,0),new s(6,1),new s(8,1),new s(10,2),new s(14,2),new s(18,3),new s(26,3),new s(34,4),new s(50,4),new s(66,5),new s(98,5),new s(130,6),new s(194,7),new s(322,8),new s(578,9),new s(1090,10),new s(2114,12),new s(6210,14),new s(22594,24)],i.kCopyLengthPrefixCode=[new s(2,0),new s(3,0),new s(4,0),new s(5,0),new s(6,0),new s(7,0),new s(8,0),new s(9,0),new s(10,1),new s(12,1),new s(14,2),new s(18,2),new s(22,3),new s(30,3),new s(38,4),new s(54,4),new s(70,5),new s(102,5),new s(134,6),new s(198,7),new s(326,8),new s(582,9),new s(1094,10),new s(2118,24)],i.kInsertRangeLut=[0,0,8,8,0,16,8,16,16],i.kCopyRangeLut=[0,8,0,8,16,0,16,8,16]},{}],10:[function(o,n,i){function s(c){this.buffer=c,this.pos=0}s.prototype.read=function(c,u,d){this.pos+d>this.buffer.length&&(d=this.buffer.length-this.pos);for(var f=0;fthis.buffer.length)throw new Error("Output buffer is not large enough");return this.buffer.set(c.subarray(0,u),this.pos),this.pos+=u,u},i.BrotliOutput=l},{}],11:[function(o,n,i){var s=o("./dictionary"),l=0,c=1,u=2,d=3,f=4,m=5,h=6,g=7,v=8,b=9,_=10,y=11,w=12,S=13,x=14,C=15,A=16,P=17,R=18,N=19,k=20;function E(F,D,z){this.prefix=new Uint8Array(F.length),this.transform=D,this.suffix=new Uint8Array(z.length);for(var L=0;L'),new E("",l,`
`),new E("",d,""),new E("",l,"]"),new E("",l," for "),new E("",x,""),new E("",u,""),new E("",l," a "),new E("",l," that "),new E(" ",_,""),new E("",l,". "),new E(".",l,""),new E(" ",l,", "),new E("",C,""),new E("",l," with "),new E("",l,"'"),new E("",l," from "),new E("",l," by "),new E("",A,""),new E("",P,""),new E(" the ",l,""),new E("",f,""),new E("",l,". The "),new E("",y,""),new E("",l," on "),new E("",l," as "),new E("",l," is "),new E("",g,""),new E("",c,"ing "),new E("",l,`
`),new E("",l,":"),new E(" ",l,". "),new E("",l,"ed "),new E("",k,""),new E("",R,""),new E("",h,""),new E("",l,"("),new E("",_,", "),new E("",v,""),new E("",l," at "),new E("",l,"ly "),new E(" the ",l," of "),new E("",m,""),new E("",b,""),new E(" ",_,", "),new E("",_,'"'),new E(".",l,"("),new E("",y," "),new E("",_,'">'),new E("",l,'="'),new E(" ",l,"."),new E(".com/",l,""),new E(" the ",l," of the "),new E("",_,"'"),new E("",l,". This "),new E("",l,","),new E(".",l," "),new E("",_,"("),new E("",_,"."),new E("",l," not "),new E(" ",l,'="'),new E("",l,"er "),new E(" ",y," "),new E("",l,"al "),new E(" ",y,""),new E("",l,"='"),new E("",y,'"'),new E("",_,". "),new E(" ",l,"("),new E("",l,"ful "),new E(" ",_,". "),new E("",l,"ive "),new E("",l,"less "),new E("",y,"'"),new E("",l,"est "),new E(" ",_,"."),new E("",y,'">'),new E(" ",l,"='"),new E("",_,","),new E("",l,"ize "),new E("",y,"."),new E("\xC2\xA0",l,""),new E(" ",l,","),new E("",_,'="'),new E("",y,'="'),new E("",l,"ous "),new E("",y,", "),new E("",_,"='"),new E(" ",_,","),new E(" ",y,'="'),new E(" ",y,", "),new E("",y,","),new E("",y,"("),new E("",y,". "),new E(" ",y,"."),new E("",y,"='"),new E(" ",y,". "),new E(" ",_,'="'),new E(" ",y,"='"),new E(" ",_,"='")];i.kTransforms=M,i.kNumTransforms=M.length;function V(F,D){return F[D]<192?(F[D]>=97&&F[D]<=122&&(F[D]^=32),1):F[D]<224?(F[D+1]^=32,2):(F[D+2]^=5,3)}i.transformDictionaryWord=function(F,D,z,L,O){var B=M[O].prefix,W=M[O].suffix,K=M[O].transform,Z=KL&&(Z=L);for(var de=0;de0;){var pe=V(F,te);te+=pe,L-=pe}for(var $=0;$typeof ra<"u"?ra:typeof Proxy<"u"?new Proxy(e,{get:(t,r)=>(typeof ra<"u"?ra:t)[r]}):e)(function(e){if(typeof ra<"u")return ra.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')}),Nbe=(function(){var e,t,r;return(function(){function o(n,i,s){function l(d,f){if(!i[d]){if(!n[d]){var m=typeof PM=="function"&&PM;if(!f&&m)return m(d,!0);if(c)return c(d,!0);var h=new Error("Cannot find module '"+d+"'");throw h.code="MODULE_NOT_FOUND",h}var g=i[d]={exports:{}};n[d][0].call(g.exports,function(v){var b=n[d][1][v];return l(b||v)},g,g.exports,o,n,i,s)}return i[d].exports}for(var c=typeof PM=="function"&&PM,u=0;u=252?6:d>=248?5:d>=240?4:d>=224?3:d>=192?2:1;u[254]=u[254]=1,i.string2buf=function(m){var h,g,v,b,_,y=m.length,w=0;for(b=0;b>>6,h[_++]=128|g&63):g<65536?(h[_++]=224|g>>>12,h[_++]=128|g>>>6&63,h[_++]=128|g&63):(h[_++]=240|g>>>18,h[_++]=128|g>>>12&63,h[_++]=128|g>>>6&63,h[_++]=128|g&63);return h};function f(m,h){if(h<65534&&(m.subarray&&c||!m.subarray&&l))return String.fromCharCode.apply(null,s.shrinkBuf(m,h));for(var g="",v=0;v4){w[v++]=65533,g+=_-1;continue}for(b&=_===2?31:_===3?15:7;_>1&&g1){w[v++]=65533;continue}b<65536?w[v++]=b:(b-=65536,w[v++]=55296|b>>10&1023,w[v++]=56320|b&1023)}return f(w,v)},i.utf8border=function(m,h){var g;for(h=h||m.length,h>m.length&&(h=m.length),g=h-1;g>=0&&(m[g]&192)===128;)g--;return g<0||g===0?h:g+u[m[g]]>h?g:h}},{"./common":1}],3:[function(o,n,i){"use strict";function s(l,c,u,d){for(var f=l&65535|0,m=l>>>16&65535|0,h=0;u!==0;){h=u>2e3?2e3:u,u-=h;do f=f+c[d++]|0,m=m+f|0;while(--h);f%=65521,m%=65521}return f|m<<16|0}n.exports=s},{}],4:[function(o,n,i){"use strict";n.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],5:[function(o,n,i){"use strict";function s(){for(var u,d=[],f=0;f<256;f++){u=f;for(var m=0;m<8;m++)u=u&1?3988292384^u>>>1:u>>>1;d[f]=u}return d}var l=s();function c(u,d,f,m){var h=l,g=m+f;u^=-1;for(var v=m;v>>8^h[(u^d[v])&255];return u^-1}n.exports=c},{}],6:[function(o,n,i){"use strict";function s(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}n.exports=s},{}],7:[function(o,n,i){"use strict";var s=30,l=12;n.exports=function(u,d){var f,m,h,g,v,b,_,y,w,S,x,C,A,P,R,N,k,E,M,V,F,D,z,L,O;f=u.state,m=u.next_in,L=u.input,h=m+(u.avail_in-5),g=u.next_out,O=u.output,v=g-(d-u.avail_out),b=g+(u.avail_out-257),_=f.dmax,y=f.wsize,w=f.whave,S=f.wnext,x=f.window,C=f.hold,A=f.bits,P=f.lencode,R=f.distcode,N=(1<>>24,C>>>=M,A-=M,M=E>>>16&255,M===0)O[g++]=E&65535;else if(M&16){V=E&65535,M&=15,M&&(A>>=M,A-=M),A<15&&(C+=L[m++]<>>24,C>>>=M,A-=M,M=E>>>16&255,M&16){if(F=E&65535,M&=15,A_){u.msg="invalid distance too far back",f.mode=s;break e}if(C>>>=M,A-=M,M=g-v,F>M){if(M=F-M,M>w&&f.sane){u.msg="invalid distance too far back",f.mode=s;break e}if(D=0,z=x,S===0){if(D+=y-M,M2;)O[g++]=z[D++],O[g++]=z[D++],O[g++]=z[D++],V-=3;V&&(O[g++]=z[D++],V>1&&(O[g++]=z[D++]))}else{D=g-F;do O[g++]=O[D++],O[g++]=O[D++],O[g++]=O[D++],V-=3;while(V>2);V&&(O[g++]=O[D++],V>1&&(O[g++]=O[D++]))}}else if((M&64)===0){E=R[(E&65535)+(C&(1<>3,m-=V,A-=V<<3,C&=(1<>>24&255)+(se>>>8&65280)+((se&65280)<<8)+((se&255)<<24)}function Ue(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new s.Buf16(320),this.work=new s.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function Ye(se){var Se;return!se||!se.state?S:(Se=se.state,se.total_in=se.total_out=Se.total=0,se.msg="",Se.wrap&&(se.adler=Se.wrap&1),Se.mode=R,Se.last=0,Se.havedict=0,Se.dmax=32768,Se.head=null,Se.hold=0,Se.bits=0,Se.lencode=Se.lendyn=new s.Buf32(Me),Se.distcode=Se.distdyn=new s.Buf32(Ne),Se.sane=1,Se.back=-1,_)}function st(se){var Se;return!se||!se.state?S:(Se=se.state,Se.wsize=0,Se.whave=0,Se.wnext=0,Ye(se))}function St(se,Se){var H,Pe;return!se||!se.state||(Pe=se.state,Se<0?(H=0,Se=-Se):(H=(Se>>4)+1,Se<48&&(Se&=15)),Se&&(Se<8||Se>15))?S:(Pe.window!==null&&Pe.wbits!==Se&&(Pe.window=null),Pe.wrap=H,Pe.wbits=Se,st(se))}function dt(se,Se){var H,Pe;return se?(Pe=new Ue,se.state=Pe,Pe.window=null,H=St(se,Se),H!==_&&(se.state=null),H):S}function xt(se){return dt(se,X)}var Xt=!0,Xe,ps;function Ga(se){if(Xt){var Se;for(Xe=new s.Buf32(512),ps=new s.Buf32(32),Se=0;Se<144;)se.lens[Se++]=8;for(;Se<256;)se.lens[Se++]=9;for(;Se<280;)se.lens[Se++]=7;for(;Se<288;)se.lens[Se++]=8;for(d(m,se.lens,0,288,Xe,0,se.work,{bits:9}),Se=0;Se<32;)se.lens[Se++]=5;d(h,se.lens,0,32,ps,0,se.work,{bits:5}),Xt=!1}se.lencode=Xe,se.lenbits=9,se.distcode=ps,se.distbits=5}function kr(se,Se,H,Pe){var Bt,Te=se.state;return Te.window===null&&(Te.wsize=1<=Te.wsize?(s.arraySet(Te.window,Se,H-Te.wsize,Te.wsize,0),Te.wnext=0,Te.whave=Te.wsize):(Bt=Te.wsize-Te.wnext,Bt>Pe&&(Bt=Pe),s.arraySet(Te.window,Se,H-Pe,Bt,Te.wnext),Pe-=Bt,Pe?(s.arraySet(Te.window,Se,H-Pe,Pe,0),Te.wnext=Pe,Te.whave=Te.wsize):(Te.wnext+=Bt,Te.wnext===Te.wsize&&(Te.wnext=0),Te.whave>>8&255,H.check=c(H.check,Ao,2,0),me=0,he=0,H.mode=N;break}if(H.flags=0,H.head&&(H.head.done=!1),!(H.wrap&1)||(((me&255)<<8)+(me>>8))%31){se.msg="incorrect header check",H.mode=ie;break}if((me&15)!==P){se.msg="unknown compression method",H.mode=ie;break}if(me>>>=4,he-=4,go=(me&15)+8,H.wbits===0)H.wbits=go;else if(go>H.wbits){se.msg="invalid window size",H.mode=ie;break}H.dmax=1<>8&1),H.flags&512&&(Ao[0]=me&255,Ao[1]=me>>>8&255,H.check=c(H.check,Ao,2,0)),me=0,he=0,H.mode=k;case k:for(;he<32;){if(Ie===0)break e;Ie--,me+=Pe[Te++]<>>8&255,Ao[2]=me>>>16&255,Ao[3]=me>>>24&255,H.check=c(H.check,Ao,4,0)),me=0,he=0,H.mode=E;case E:for(;he<16;){if(Ie===0)break e;Ie--,me+=Pe[Te++]<>8),H.flags&512&&(Ao[0]=me&255,Ao[1]=me>>>8&255,H.check=c(H.check,Ao,2,0)),me=0,he=0,H.mode=M;case M:if(H.flags&1024){for(;he<16;){if(Ie===0)break e;Ie--,me+=Pe[Te++]<>>8&255,H.check=c(H.check,Ao,2,0)),me=0,he=0}else H.head&&(H.head.extra=null);H.mode=V;case V:if(H.flags&1024&&(He=H.length,He>Ie&&(He=Ie),He&&(H.head&&(go=H.head.extra_len-H.length,H.head.extra||(H.head.extra=new Array(H.head.extra_len)),s.arraySet(H.head.extra,Pe,Te,He,go)),H.flags&512&&(H.check=c(H.check,Pe,He,Te)),Ie-=He,Te+=He,H.length-=He),H.length))break e;H.length=0,H.mode=F;case F:if(H.flags&2048){if(Ie===0)break e;He=0;do go=Pe[Te+He++],H.head&&go&&H.length<65536&&(H.head.name+=String.fromCharCode(go));while(go&&He>9&1,H.head.done=!0),se.adler=H.check=0,H.mode=B;break;case L:for(;he<32;){if(Ie===0)break e;Ie--,me+=Pe[Te++]<>>=he&7,he-=he&7,H.mode=ne;break}for(;he<3;){if(Ie===0)break e;Ie--,me+=Pe[Te++]<>>=1,he-=1,me&3){case 0:H.mode=K;break;case 1:if(Ga(H),H.mode=pe,Se===b){me>>>=2,he-=2;break e}break;case 2:H.mode=ue;break;case 3:se.msg="invalid block type",H.mode=ie}me>>>=2,he-=2;break;case K:for(me>>>=he&7,he-=he&7;he<32;){if(Ie===0)break e;Ie--,me+=Pe[Te++]<>>16^65535)){se.msg="invalid stored block lengths",H.mode=ie;break}if(H.length=me&65535,me=0,he=0,H.mode=Z,Se===b)break e;case Z:H.mode=Q;case Q:if(He=H.length,He){if(He>Ie&&(He=Ie),He>mr&&(He=mr),He===0)break e;s.arraySet(Bt,Pe,Te,He,Ro),Ie-=He,Te+=He,mr-=He,Ro+=He,H.length-=He;break}H.mode=B;break;case ue:for(;he<14;){if(Ie===0)break e;Ie--,me+=Pe[Te++]<>>=5,he-=5,H.ndist=(me&31)+1,me>>>=5,he-=5,H.ncode=(me&15)+4,me>>>=4,he-=4,H.nlen>286||H.ndist>30){se.msg="too many length or distance symbols",H.mode=ie;break}H.have=0,H.mode=te;case te:for(;H.have>>=3,he-=3}for(;H.have<19;)H.lens[u0[H.have++]]=0;if(H.lencode=H.lendyn,H.lenbits=7,hs={bits:H.lenbits},ms=d(f,H.lens,0,19,H.lencode,0,H.work,hs),H.lenbits=hs.bits,ms){se.msg="invalid code lengths set",H.mode=ie;break}H.have=0,H.mode=de;case de:for(;H.have>>24,Rr=ht>>>16&255,Gr=ht&65535,!(bt<=he);){if(Ie===0)break e;Ie--,me+=Pe[Te++]<>>=bt,he-=bt,H.lens[H.have++]=Gr;else{if(Gr===16){for(ea=bt+2;he>>=bt,he-=bt,H.have===0){se.msg="invalid bit length repeat",H.mode=ie;break}go=H.lens[H.have-1],He=3+(me&3),me>>>=2,he-=2}else if(Gr===17){for(ea=bt+3;he>>=bt,he-=bt,go=0,He=3+(me&7),me>>>=3,he-=3}else{for(ea=bt+7;he>>=bt,he-=bt,go=0,He=11+(me&127),me>>>=7,he-=7}if(H.have+He>H.nlen+H.ndist){se.msg="invalid bit length repeat",H.mode=ie;break}for(;He--;)H.lens[H.have++]=go}}if(H.mode===ie)break;if(H.lens[256]===0){se.msg="invalid code -- missing end-of-block",H.mode=ie;break}if(H.lenbits=9,hs={bits:H.lenbits},ms=d(m,H.lens,0,H.nlen,H.lencode,0,H.work,hs),H.lenbits=hs.bits,ms){se.msg="invalid literal/lengths set",H.mode=ie;break}if(H.distbits=6,H.distcode=H.distdyn,hs={bits:H.distbits},ms=d(h,H.lens,H.nlen,H.ndist,H.distcode,0,H.work,hs),H.distbits=hs.bits,ms){se.msg="invalid distances set",H.mode=ie;break}if(H.mode=pe,Se===b)break e;case pe:H.mode=$;case $:if(Ie>=6&&mr>=258){se.next_out=Ro,se.avail_out=mr,se.next_in=Te,se.avail_in=Ie,H.hold=me,H.bits=he,u(se,Gt),Ro=se.next_out,Bt=se.output,mr=se.avail_out,Te=se.next_in,Pe=se.input,Ie=se.avail_in,me=H.hold,he=H.bits,H.mode===B&&(H.back=-1);break}for(H.back=0;ht=H.lencode[me&(1<>>24,Rr=ht>>>16&255,Gr=ht&65535,!(bt<=he);){if(Ie===0)break e;Ie--,me+=Pe[Te++]<>ro)],bt=ht>>>24,Rr=ht>>>16&255,Gr=ht&65535,!(ro+bt<=he);){if(Ie===0)break e;Ie--,me+=Pe[Te++]<>>=ro,he-=ro,H.back+=ro}if(me>>>=bt,he-=bt,H.back+=bt,H.length=Gr,Rr===0){H.mode=ee;break}if(Rr&32){H.back=-1,H.mode=B;break}if(Rr&64){se.msg="invalid literal/length code",H.mode=ie;break}H.extra=Rr&15,H.mode=oe;case oe:if(H.extra){for(ea=H.extra;he>>=H.extra,he-=H.extra,H.back+=H.extra}H.was=H.length,H.mode=fe;case fe:for(;ht=H.distcode[me&(1<>>24,Rr=ht>>>16&255,Gr=ht&65535,!(bt<=he);){if(Ie===0)break e;Ie--,me+=Pe[Te++]<>ro)],bt=ht>>>24,Rr=ht>>>16&255,Gr=ht&65535,!(ro+bt<=he);){if(Ie===0)break e;Ie--,me+=Pe[Te++]<>>=ro,he-=ro,H.back+=ro}if(me>>>=bt,he-=bt,H.back+=bt,Rr&64){se.msg="invalid distance code",H.mode=ie;break}H.offset=Gr,H.extra=Rr&15,H.mode=ve;case ve:if(H.extra){for(ea=H.extra;he>>=H.extra,he-=H.extra,H.back+=H.extra}if(H.offset>H.dmax){se.msg="invalid distance too far back",H.mode=ie;break}H.mode=Oe;case Oe:if(mr===0)break e;if(He=Gt-mr,H.offset>He){if(He=H.offset-He,He>H.whave&&H.sane){se.msg="invalid distance too far back",H.mode=ie;break}He>H.wnext?(He-=H.wnext,xe=H.wsize-He):xe=H.wnext-He,He>H.length&&(He=H.length),it=H.window}else it=Bt,xe=Ro-H.offset,He=H.length;He>mr&&(He=mr),mr-=He,H.length-=He;do Bt[Ro++]=it[xe++];while(--He);H.length===0&&(H.mode=$);break;case ee:if(mr===0)break e;Bt[Ro++]=H.length,mr--,H.mode=$;break;case ne:if(H.wrap){for(;he<32;){if(Ie===0)break e;Ie--,me|=Pe[Te++]<=1&&$[V]===0;V--);if(F>V&&(F=V),V===0)return C[A++]=1<<24|64<<16|0,C[A++]=1<<24|64<<16|0,R.bits=1,0;for(M=1;M0&&(y===d||V!==1))return-1;for(oe[1]=0,k=1;kc||y===m&&O>u)return 1;for(;;){Oe=k-z,P[E]pe?(ee=fe[ve+P[E]],ne=te[de+P[E]]):(ee=96,ne=0),W=1<>z)+K]=Oe<<24|ee<<16|ne|0;while(K!==0);for(W=1<>=1;if(W!==0?(B&=W-1,B+=W):B=0,E++,--$[k]===0){if(k===V)break;k=w[S+P[E]]}if(k>F&&(B&Q)!==Z){for(z===0&&(z=F),ue+=M,D=k-z,L=1<c||y===m&&O>u)return 1;Z=B&Q,C[Z]=F<<24|D<<16|ue-A|0}}return B!==0&&(C[ue+B]=k-z<<24|64<<16|0),R.bits=F,0}},{"../utils/common":1}],10:[function(o,n,i){"use strict";n.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],11:[function(o,n,i){"use strict";function s(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}n.exports=s},{}],"/lib/inflate.js":[function(o,n,i){"use strict";var s=o("./zlib/inflate"),l=o("./utils/common"),c=o("./utils/strings"),u=o("./zlib/constants"),d=o("./zlib/messages"),f=o("./zlib/zstream"),m=o("./zlib/gzheader"),h=Object.prototype.toString;function g(_){if(!(this instanceof g))return new g(_);this.options=l.assign({chunkSize:16384,windowBits:0,to:""},_||{});var y=this.options;y.raw&&y.windowBits>=0&&y.windowBits<16&&(y.windowBits=-y.windowBits,y.windowBits===0&&(y.windowBits=-15)),y.windowBits>=0&&y.windowBits<16&&!(_&&_.windowBits)&&(y.windowBits+=32),y.windowBits>15&&y.windowBits<48&&(y.windowBits&15)===0&&(y.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new f,this.strm.avail_out=0;var w=s.inflateInit2(this.strm,y.windowBits);if(w!==u.Z_OK)throw new Error(d[w]);if(this.header=new m,s.inflateGetHeader(this.strm,this.header),y.dictionary&&(typeof y.dictionary=="string"?y.dictionary=c.string2buf(y.dictionary):h.call(y.dictionary)==="[object ArrayBuffer]"&&(y.dictionary=new Uint8Array(y.dictionary)),y.raw&&(w=s.inflateSetDictionary(this.strm,y.dictionary),w!==u.Z_OK)))throw new Error(d[w])}g.prototype.push=function(_,y){var w=this.strm,S=this.options.chunkSize,x=this.options.dictionary,C,A,P,R,N,k=!1;if(this.ended)return!1;A=y===~~y?y:y===!0?u.Z_FINISH:u.Z_NO_FLUSH,typeof _=="string"?w.input=c.binstring2buf(_):h.call(_)==="[object ArrayBuffer]"?w.input=new Uint8Array(_):w.input=_,w.next_in=0,w.avail_in=w.input.length;do{if(w.avail_out===0&&(w.output=new l.Buf8(S),w.next_out=0,w.avail_out=S),C=s.inflate(w,u.Z_NO_FLUSH),C===u.Z_NEED_DICT&&x&&(C=s.inflateSetDictionary(this.strm,x)),C===u.Z_BUF_ERROR&&k===!0&&(C=u.Z_OK,k=!1),C!==u.Z_STREAM_END&&C!==u.Z_OK)return this.onEnd(C),this.ended=!0,!1;w.next_out&&(w.avail_out===0||C===u.Z_STREAM_END||w.avail_in===0&&(A===u.Z_FINISH||A===u.Z_SYNC_FLUSH))&&(this.options.to==="string"?(P=c.utf8border(w.output,w.next_out),R=w.next_out-P,N=c.buf2string(w.output,P),w.next_out=R,w.avail_out=S-R,R&&l.arraySet(w.output,w.output,P,R,0),this.onData(N)):this.onData(l.shrinkBuf(w.output,w.next_out))),w.avail_in===0&&w.avail_out===0&&(k=!0)}while((w.avail_in>0||w.avail_out===0)&&C!==u.Z_STREAM_END);return C===u.Z_STREAM_END&&(A=u.Z_FINISH),A===u.Z_FINISH?(C=s.inflateEnd(this.strm),this.onEnd(C),this.ended=!0,C===u.Z_OK):(A===u.Z_SYNC_FLUSH&&(this.onEnd(u.Z_OK),w.avail_out=0),!0)},g.prototype.onData=function(_){this.chunks.push(_)},g.prototype.onEnd=function(_){_===u.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=l.flattenChunks(this.chunks)),this.chunks=[],this.err=_,this.msg=this.strm.msg};function v(_,y){var w=new g(y);if(w.push(_,!0),w.err)throw w.msg||d[w.err];return w.result}function b(_,y){return y=y||{},y.raw=!0,v(_,y)}i.Inflate=g,i.inflate=v,i.inflateRaw=b,i.ungzip=v},{"./utils/common":1,"./utils/strings":2,"./zlib/constants":4,"./zlib/gzheader":6,"./zlib/inflate":8,"./zlib/messages":10,"./zlib/zstream":11}]},{},[])("/lib/inflate.js")})();var cJt=globalThis.fetch,kM=class{constructor(e,t={},r){this.type=e,this.detail=t,this.msg=r,Object.defineProperty(this,"__mayPropagate",{enumerable:!1,writable:!0}),this.__mayPropagate=!0}preventDefault(){}stopPropagation(){this.__mayPropagate=!1}valueOf(){return this}toString(){return this.msg?`[${this.type} event]: ${this.msg}`:`[${this.type} event]`}},nXe=class{constructor(){this.listeners={}}addEventListener(e,t,r){let o=this.listeners[e]||[];r?o.unshift(t):o.push(t),this.listeners[e]=o}removeEventListener(e,t){let r=this.listeners[e]||[],o=r.findIndex(n=>n===t);o>-1&&(r.splice(o,1),this.listeners[e]=r)}dispatch(e){let t=this.listeners[e.type];if(t)for(let r=0,o=t.length;rString.fromCharCode(t)).join("")}var aXe=class{constructor(e,t,r){this.name=(r||e.tag||"").trim(),this.length=e.length,this.start=e.offset,this.offset=0,this.data=t,["getInt8","getUint8","getInt16","getUint16","getInt32","getUint32","getBigInt64","getBigUint64"].forEach(o=>{let n=o.replace(/get(Big)?/,"").toLowerCase(),i=parseInt(o.replace(/[^\d]/g,""))/8;Object.defineProperty(this,n,{get:()=>this.getValue(o,i)})})}get currentPosition(){return this.start+this.offset}set currentPosition(e){this.start=e,this.offset=0}skip(e=0,t=8){this.offset+=e*t/8}getValue(e,t){let r=this.start+this.offset;this.offset+=t;try{return this.data[e](r)}catch(o){throw console.error("parser",e,t,this),console.error("parser",this.start,this.offset),o}}flags(e){if(e===8||e===16||e===32||e===64)return this[`uint${e}`].toString(2).padStart(e,0).split("").map(t=>t==="1");console.error("Error parsing flags: flag types can only be 1, 2, 4, or 8 bytes long"),console.trace()}get tag(){let e=this.uint32;return sXe([e>>24&255,e>>16&255,e>>8&255,e&255])}get fixed(){let e=this.int16,t=Math.round(1e3*this.uint16/65356);return e+t/1e3}get legacyFixed(){let e=this.uint16,t=this.uint16.toString(16).padStart(4,0);return parseFloat(`${e}.${t}`)}get uint24(){return(this.uint8<<16)+(this.uint8<<8)+this.uint8}get uint128(){let e=0;for(let t=0;t<5;t++){let r=this.uint8;if(e=e*128+(r&127),r<128)break}return e}get longdatetime(){return new Date(iXe+1e3*parseInt(this.int64.toString()))}get fword(){return this.int16}get ufword(){return this.uint16}get Offset16(){return this.uint16}get Offset32(){return this.uint32}get F2DOT14(){let e=p.uint16,t=[0,1,-2,-1][e>>14],r=e&16383;return t+r/16384}verifyLength(){this.offset!=this.length&&console.error(`unexpected parsed table size (${this.offset}) for "${this.name}" (expected ${this.length})`)}readBytes(e=0,t=0,r=8,o=!1){if(e=e||this.length,e===0)return[];t&&(this.currentPosition=t);let n=`${o?"":"u"}int${r}`,i=[];for(;e--;)i.push(this[n]);return i}},Eo=class{constructor(e){Object.defineProperty(this,"parser",{enumerable:!1,get:()=>e});let r=e.currentPosition;Object.defineProperty(this,"start",{enumerable:!1,get:()=>r})}load(e){Object.keys(e).forEach(t=>{let r=Object.getOwnPropertyDescriptor(e,t);r.get?this[t]=r.get.bind(this):r.value!==void 0&&(this[t]=r.value)}),this.parser.length&&this.parser.verifyLength()}},yt=class extends Eo{constructor(e,t,r){let{parser:o,start:n}=super(new aXe(e,t,r));Object.defineProperty(this,"p",{enumerable:!1,get:()=>o}),Object.defineProperty(this,"tableStart",{enumerable:!1,get:()=>n})}};function ze(e,t,r){let o;Object.defineProperty(e,t,{get:()=>o||(o=r(),o),enumerable:!0})}var lXe=class extends yt{constructor(e,t,r){let{p:o}=super({offset:0,length:12},t,"sfnt");this.version=o.uint32,this.numTables=o.uint16,this.searchRange=o.uint16,this.entrySelector=o.uint16,this.rangeShift=o.uint16,o.verifyLength(),this.directory=[...new Array(this.numTables)].map(n=>new cXe(o)),this.tables={},this.directory.forEach(n=>{let i=()=>r(this.tables,{tag:n.tag,offset:n.offset,length:n.length},t);ze(this.tables,n.tag.trim(),i)})}},cXe=class{constructor(e){this.tag=e.tag,this.checksum=e.uint32,this.offset=e.uint32,this.length=e.uint32}},Mbe=Nbe.inflate||void 0,Fbe=void 0,uXe=class extends yt{constructor(e,t,r){let{p:o}=super({offset:0,length:44},t,"woff");this.signature=o.tag,this.flavor=o.uint32,this.length=o.uint32,this.numTables=o.uint16,o.uint16,this.totalSfntSize=o.uint32,this.majorVersion=o.uint16,this.minorVersion=o.uint16,this.metaOffset=o.uint32,this.metaLength=o.uint32,this.metaOrigLength=o.uint32,this.privOffset=o.uint32,this.privLength=o.uint32,o.verifyLength(),this.directory=[...new Array(this.numTables)].map(n=>new dXe(o)),fXe(this,t,r)}},dXe=class{constructor(e){this.tag=e.tag,this.offset=e.uint32,this.compLength=e.uint32,this.origLength=e.uint32,this.origChecksum=e.uint32}};function fXe(e,t,r){e.tables={},e.directory.forEach(o=>{ze(e.tables,o.tag.trim(),()=>{let n=0,i=t;if(o.compLength!==o.origLength){let s=t.buffer.slice(o.offset,o.offset+o.compLength),l;if(Mbe)l=Mbe(new Uint8Array(s));else if(Fbe)l=Fbe(new Uint8Array(s));else{let c="no brotli decoder available to decode WOFF2 font";throw font.onerror&&font.onerror(c),new Error(c)}i=new DataView(l.buffer)}else n=o.offset;return r(e.tables,{tag:o.tag,offset:n,length:o.origLength},i)})})}var Dbe=Obe,Lbe=void 0,pXe=class extends yt{constructor(e,t,r){let{p:o}=super({offset:0,length:48},t,"woff2");this.signature=o.tag,this.flavor=o.uint32,this.length=o.uint32,this.numTables=o.uint16,o.uint16,this.totalSfntSize=o.uint32,this.totalCompressedSize=o.uint32,this.majorVersion=o.uint16,this.minorVersion=o.uint16,this.metaOffset=o.uint32,this.metaLength=o.uint32,this.metaOrigLength=o.uint32,this.privOffset=o.uint32,this.privLength=o.uint32,o.verifyLength(),this.directory=[...new Array(this.numTables)].map(l=>new mXe(o));let n=o.currentPosition;this.directory[0].offset=0,this.directory.forEach((l,c)=>{let u=this.directory[c+1];u&&(u.offset=l.offset+(l.transformLength!==void 0?l.transformLength:l.origLength))});let i,s=t.buffer.slice(n);if(Dbe)i=Dbe(new Uint8Array(s));else if(Lbe)i=new Uint8Array(Lbe(s));else{let l="no brotli decoder available to decode WOFF2 font";throw e.onerror&&e.onerror(l),new Error(l)}hXe(this,i,r)}},mXe=class{constructor(e){this.flags=e.uint8;let t=this.tagNumber=this.flags&63;t===63?this.tag=e.tag:this.tag=gXe(t);let o=(this.transformVersion=(this.flags&192)>>6)!==0;(this.tag==="glyf"||this.tag==="loca")&&(o=this.transformVersion!==3),this.origLength=e.uint128,o&&(this.transformLength=e.uint128)}};function hXe(e,t,r){e.tables={},e.directory.forEach(o=>{ze(e.tables,o.tag.trim(),()=>{let n=o.offset,i=n+(o.transformLength?o.transformLength:o.origLength),s=new DataView(t.slice(n,i).buffer);try{return r(e.tables,{tag:o.tag,offset:0,length:o.origLength},s)}catch(l){console.error(l)}})})}function gXe(e){return["cmap","head","hhea","hmtx","maxp","name","OS/2","post","cvt ","fpgm","glyf","loca","prep","CFF ","VORG","EBDT","EBLC","gasp","hdmx","kern","LTSH","PCLT","VDMX","vhea","vmtx","BASE","GDEF","GPOS","GSUB","EBSC","JSTF","MATH","CBDT","CBLC","COLR","CPAL","SVG ","sbix","acnt","avar","bdat","bloc","bsln","cvar","fdsc","feat","fmtx","fvar","gvar","hsty","just","lcar","mort","morx","opbd","prop","trak","Zapf","Silf","Glat","Gloc","Feat","Sill"][e&63]}var Wbe={},Gbe=!1;Promise.all([Promise.resolve().then(function(){return WXe}),Promise.resolve().then(function(){return YXe}),Promise.resolve().then(function(){return KXe}),Promise.resolve().then(function(){return QXe}),Promise.resolve().then(function(){return $Xe}),Promise.resolve().then(function(){return nQe}),Promise.resolve().then(function(){return sQe}),Promise.resolve().then(function(){return lQe}),Promise.resolve().then(function(){return bQe}),Promise.resolve().then(function(){return RQe}),Promise.resolve().then(function(){return gJe}),Promise.resolve().then(function(){return bJe}),Promise.resolve().then(function(){return SJe}),Promise.resolve().then(function(){return TJe}),Promise.resolve().then(function(){return kJe}),Promise.resolve().then(function(){return AJe}),Promise.resolve().then(function(){return NJe}),Promise.resolve().then(function(){return FJe}),Promise.resolve().then(function(){return LJe}),Promise.resolve().then(function(){return BJe}),Promise.resolve().then(function(){return zJe}),Promise.resolve().then(function(){return UJe}),Promise.resolve().then(function(){return YJe}),Promise.resolve().then(function(){return ZJe}),Promise.resolve().then(function(){return XJe}),Promise.resolve().then(function(){return JJe}),Promise.resolve().then(function(){return e$e}),Promise.resolve().then(function(){return r$e}),Promise.resolve().then(function(){return n$e}),Promise.resolve().then(function(){return a$e}),Promise.resolve().then(function(){return p$e}),Promise.resolve().then(function(){return v$e}),Promise.resolve().then(function(){return w$e}),Promise.resolve().then(function(){return C$e}),Promise.resolve().then(function(){return T$e}),Promise.resolve().then(function(){return k$e}),Promise.resolve().then(function(){return I$e}),Promise.resolve().then(function(){return N$e}),Promise.resolve().then(function(){return V$e}),Promise.resolve().then(function(){return j$e}),Promise.resolve().then(function(){return U$e})]).then(e=>{e.forEach(t=>{let r=Object.keys(t)[0];Wbe[r]=t[r]}),Gbe=!0});function vXe(e,t,r){let o=t.tag.replace(/[^\w\d]/g,""),n=Wbe[o];return n?new n(t,r,e):(console.warn(`lib-font has no definition for ${o}. The table was skipped.`),{})}function bXe(){let e=0;function t(r,o){if(!Gbe)return e>10?o(new Error("loading took too long")):(e++,setTimeout(()=>t(r),250));r(vXe)}return new Promise((r,o)=>t(r))}function yXe(e,t){let r=e.lastIndexOf("."),o=(e.substring(r+1)||"").toLowerCase(),n={ttf:"truetype",otf:"opentype",woff:"woff",woff2:"woff2"}[o];if(n)return n;let i={eot:"The .eot format is not supported: it died in January 12, 2016, when Microsoft retired all versions of IE that didn't already support WOFF.",svg:"The .svg format is not supported: SVG fonts (not to be confused with OpenType with embedded SVG) were so bad we took the entire fonts chapter out of the SVG specification again.",fon:"The .fon format is not supported: this is an ancient Windows bitmap font format.",ttc:"Based on the current CSS specification, font collections are not (yet?) supported."}[o];if(i||(i=`${e} is not a known webfont format.`),t)throw new Error(i);console.warn(`Could not load font: ${i}`)}async function wXe(e,t,r={}){if(!globalThis.document)return;let o=yXe(t,r.errorOnStyle);if(!o)return;let n=document.createElement("style");n.className="injected-by-Font-js";let i=[];return r.styleRules&&(i=Object.entries(r.styleRules).map(([s,l])=>`${s}: ${l};`)),n.textContent=`
@font-face {
font-family: "${e}";
${i.join(`
`)}
src: url("${t}") format("${o}");
}`,globalThis.document.head.appendChild(n),n}var _Xe=[0,1,0,0],SXe=[79,84,84,79],xXe=[119,79,70,70],CXe=[119,79,70,50];function RM(e,t){if(e.length===t.length){for(let r=0;r(globalThis.document&&!this.options.skipStyleSheet&&await wXe(this.name,e,this.options),this.loadFont(e)))()}async loadFont(e,t){fetch(e).then(r=>TXe(r)&&r.arrayBuffer()).then(r=>this.fromDataBuffer(r,t||e)).catch(r=>{let o=new kM("error",r,`Failed to load font at ${t||e}`);this.dispatch(o),this.onerror&&this.onerror(o)})}async fromDataBuffer(e,t){this.fontData=new DataView(e);let r=EXe(this.fontData);if(!r)throw new Error(`${t} is either an unsupported font format, or not a font at all.`);await this.parseBasicData(r);let o=new kM("load",{font:this});this.dispatch(o),this.onload&&this.onload(o)}async parseBasicData(e){return bXe().then(t=>(e==="SFNT"&&(this.opentype=new lXe(this,this.fontData,t)),e==="WOFF"&&(this.opentype=new uXe(this,this.fontData,t)),e==="WOFF2"&&(this.opentype=new pXe(this,this.fontData,t)),this.opentype))}getGlyphId(e){return this.opentype.tables.cmap.getGlyphId(e)}reverse(e){return this.opentype.tables.cmap.reverse(e)}supports(e){return this.getGlyphId(e)!==0}supportsVariation(e){return this.opentype.tables.cmap.supportsVariation(e)!==!1}measureText(e,t=16){if(this.__unloaded)throw new Error("Cannot measure text: font was unloaded. Please reload before calling measureText()");let r=document.createElement("div");r.textContent=e,r.style.fontFamily=this.name,r.style.fontSize=`${t}px`,r.style.color="transparent",r.style.background="transparent",r.style.top="0",r.style.left="0",r.style.position="absolute",document.body.appendChild(r);let o=r.getBoundingClientRect();document.body.removeChild(r);let n=this.opentype.tables["OS/2"];return o.fontSize=t,o.ascender=n.sTypoAscender,o.descender=n.sTypoDescender,o}unload(){if(this.styleElement.parentNode){this.styleElement.parentNode.removeElement(this.styleElement);let e=new kM("unload",{font:this});this.dispatch(e),this.onunload&&this.onunload(e)}this._unloaded=!0}load(){if(this.__unloaded){delete this.__unloaded,document.head.appendChild(this.styleElement);let e=new kM("load",{font:this});this.dispatch(e),this.onload&&this.onload(e)}}};globalThis.Font=IM;var Sp=class extends Eo{constructor(e,t,r){super(e),this.plaformID=t,this.encodingID=r}},PXe=class extends Sp{constructor(e,t,r){super(e,t,r),this.format=0,this.length=e.uint16,this.language=e.uint16,this.glyphIdArray=[...new Array(256)].map(o=>e.uint8)}supports(e){return e.charCodeAt&&(e=-1,console.warn("supports(character) not implemented for cmap subtable format 0. only supports(id) is implemented.")),0<=e&&e<=255}reverse(e){return console.warn("reverse not implemented for cmap subtable format 0"),{}}getSupportedCharCodes(){return[{start:1,end:256}]}},kXe=class extends Sp{constructor(e,t,r){super(e,t,r),this.format=2,this.length=e.uint16,this.language=e.uint16,this.subHeaderKeys=[...new Array(256)].map(s=>e.uint16);let o=Math.max(...this.subHeaderKeys),n=e.currentPosition;ze(this,"subHeaders",()=>(e.currentPosition=n,[...new Array(o)].map(s=>new RXe(e))));let i=n+o*8;ze(this,"glyphIndexArray",()=>(e.currentPosition=i,[...new Array(o)].map(s=>e.uint16)))}supports(e){e.charCodeAt&&(e=-1,console.warn("supports(character) not implemented for cmap subtable format 2. only supports(id) is implemented."));let t=e&&255,r=e&&65280,o=this.subHeaders[r],n=this.subHeaders[o],i=n.firstCode,s=i+n.entryCount;return i<=t&&t<=s}reverse(e){return console.warn("reverse not implemented for cmap subtable format 2"),{}}getSupportedCharCodes(e=!1){return e?this.subHeaders.map(t=>({firstCode:t.firstCode,lastCode:t.lastCode})):this.subHeaders.map(t=>({start:t.firstCode,end:t.lastCode}))}},RXe=class{constructor(e){this.firstCode=e.uint16,this.entryCount=e.uint16,this.lastCode=this.first+this.entryCount,this.idDelta=e.int16,this.idRangeOffset=e.uint16}},AXe=class extends Sp{constructor(e,t,r){super(e,t,r),this.format=4,this.length=e.uint16,this.language=e.uint16,this.segCountX2=e.uint16,this.segCount=this.segCountX2/2,this.searchRange=e.uint16,this.entrySelector=e.uint16,this.rangeShift=e.uint16;let o=e.currentPosition;ze(this,"endCode",()=>e.readBytes(this.segCount,o,16));let n=o+2+this.segCountX2;ze(this,"startCode",()=>e.readBytes(this.segCount,n,16));let i=n+this.segCountX2;ze(this,"idDelta",()=>e.readBytes(this.segCount,i,16,!0));let s=i+this.segCountX2;ze(this,"idRangeOffset",()=>e.readBytes(this.segCount,s,16));let l=s+this.segCountX2,c=this.length-(l-this.tableStart);ze(this,"glyphIdArray",()=>e.readBytes(c,l,16)),ze(this,"segments",()=>this.buildSegments(s,l,e))}buildSegments(e,t,r){let o=(n,i)=>{let s=this.startCode[i],l=this.endCode[i],c=this.idDelta[i],u=this.idRangeOffset[i],d=e+2*i,f=[];if(u===0)for(let m=s+c,h=l+c;m<=h;m++)f.push(m);else for(let m=0,h=l-s;m<=h;m++)r.currentPosition=d+u+m*2,f.push(r.uint16);return{startCode:s,endCode:l,idDelta:c,idRangeOffset:u,glyphIDs:f}};return[...new Array(this.segCount)].map(o)}reverse(e){let t=this.segments.find(o=>o.glyphIDs.includes(e));if(!t)return{};let r=t.startCode+t.glyphIDs.indexOf(e);return{code:r,unicode:String.fromCodePoint(r)}}getGlyphId(e){if(e.charCodeAt&&(e=e.charCodeAt(0)),55296<=e&&e<=57343||(e&65534)===65534||(e&65535)===65535)return 0;let t=this.segments.find(r=>r.startCode<=e&&e<=r.endCode);return t?t.glyphIDs[e-t.startCode]:0}supports(e){return this.getGlyphId(e)!==0}getSupportedCharCodes(e=!1){return e?this.segments:this.segments.map(t=>({start:t.startCode,end:t.endCode}))}},IXe=class extends Sp{constructor(e,t,r){super(e,t,r),this.format=6,this.length=e.uint16,this.language=e.uint16,this.firstCode=e.uint16,this.entryCount=e.uint16,this.lastCode=this.firstCode+this.entryCount-1,ze(this,"glyphIdArray",()=>[...new Array(this.entryCount)].map(n=>e.uint16))}supports(e){if(e.charCodeAt&&(e=-1,console.warn("supports(character) not implemented for cmap subtable format 6. only supports(id) is implemented.")),ethis.firstCode+this.entryCount)return{};let t=e-this.firstCode;return{code:t,unicode:String.fromCodePoint(t)}}reverse(e){let t=this.glyphIdArray.indexOf(e);if(t>-1)return this.firstCode+t}getSupportedCharCodes(e=!1){return e?[{firstCode:this.firstCode,lastCode:this.lastCode}]:[{start:this.firstCode,end:this.lastCode}]}},OXe=class extends Sp{constructor(e,t,r){super(e,t,r),this.format=8,e.uint16,this.length=e.uint32,this.language=e.uint32,this.is32=[...new Array(8192)].map(n=>e.uint8),this.numGroups=e.uint32,ze(this,"groups",()=>[...new Array(this.numGroups)].map(n=>new NXe(e)))}supports(e){return e.charCodeAt&&(e=-1,console.warn("supports(character) not implemented for cmap subtable format 8. only supports(id) is implemented.")),this.groups.findIndex(t=>t.startcharCode<=e&&e<=t.endcharCode)!==-1}reverse(e){return console.warn("reverse not implemented for cmap subtable format 8"),{}}getSupportedCharCodes(e=!1){return e?this.groups:this.groups.map(t=>({start:t.startcharCode,end:t.endcharCode}))}},NXe=class{constructor(e){this.startcharCode=e.uint32,this.endcharCode=e.uint32,this.startGlyphID=e.uint32}},MXe=class extends Sp{constructor(e,t,r){super(e,t,r),this.format=10,e.uint16,this.length=e.uint32,this.language=e.uint32,this.startCharCode=e.uint32,this.numChars=e.uint32,this.endCharCode=this.startCharCode+this.numChars,ze(this,"glyphs",()=>[...new Array(this.numChars)].map(n=>e.uint16))}supports(e){return e.charCodeAt&&(e=-1,console.warn("supports(character) not implemented for cmap subtable format 10. only supports(id) is implemented.")),ethis.startCharCode+this.numChars?!1:e-this.startCharCode}reverse(e){return console.warn("reverse not implemented for cmap subtable format 10"),{}}getSupportedCharCodes(e=!1){return e?[{startCharCode:this.startCharCode,endCharCode:this.endCharCode}]:[{start:this.startCharCode,end:this.endCharCode}]}},FXe=class extends Sp{constructor(e,t,r){super(e,t,r),this.format=12,e.uint16,this.length=e.uint32,this.language=e.uint32,this.numGroups=e.uint32,ze(this,"groups",()=>[...new Array(this.numGroups)].map(n=>new DXe(e)))}supports(e){return e.charCodeAt&&(e=e.charCodeAt(0)),55296<=e&&e<=57343||(e&65534)===65534||(e&65535)===65535?0:this.groups.findIndex(t=>t.startCharCode<=e&&e<=t.endCharCode)!==-1}reverse(e){for(let t of this.groups){let r=t.startGlyphID;if(r>e)continue;if(r===e)return t.startCharCode;if(r+(t.endCharCode-t.startCharCode)({start:t.startCharCode,end:t.endCharCode}))}},DXe=class{constructor(e){this.startCharCode=e.uint32,this.endCharCode=e.uint32,this.startGlyphID=e.uint32}},LXe=class extends Sp{constructor(e,t,r){super(e,t,r),this.format=13,e.uint16,this.length=e.uint32,this.language=e.uint32,this.numGroups=e.uint32;let o=[...new Array(this.numGroups)].map(n=>new VXe(e));ze(this,"groups",o)}supports(e){return e.charCodeAt&&(e=e.charCodeAt(0)),this.groups.findIndex(t=>t.startCharCode<=e&&e<=t.endCharCode)!==-1}reverse(e){return console.warn("reverse not implemented for cmap subtable format 13"),{}}getSupportedCharCodes(e=!1){return e?this.groups:this.groups.map(t=>({start:t.startCharCode,end:t.endCharCode}))}},VXe=class{constructor(e){this.startCharCode=e.uint32,this.endCharCode=e.uint32,this.glyphID=e.uint32}},BXe=class extends Sp{constructor(e,t,r){super(e,t,r),this.subTableStart=e.currentPosition,this.format=14,this.length=e.uint32,this.numVarSelectorRecords=e.uint32,ze(this,"varSelectors",()=>[...new Array(this.numVarSelectorRecords)].map(o=>new jXe(e)))}supports(){return console.warn("supports not implemented for cmap subtable format 14"),0}getSupportedCharCodes(){return console.warn("getSupportedCharCodes not implemented for cmap subtable format 14"),[]}reverse(e){return console.warn("reverse not implemented for cmap subtable format 14"),{}}supportsVariation(e){let t=this.varSelector.find(r=>r.varSelector===e);return t||!1}getSupportedVariations(){return this.varSelectors.map(e=>e.varSelector)}},jXe=class{constructor(e){this.varSelector=e.uint24,this.defaultUVSOffset=e.Offset32,this.nonDefaultUVSOffset=e.Offset32}};function zXe(e,t,r){let o=e.uint16;return o===0?new PXe(e,t,r):o===2?new kXe(e,t,r):o===4?new AXe(e,t,r):o===6?new IXe(e,t,r):o===8?new OXe(e,t,r):o===10?new MXe(e,t,r):o===12?new FXe(e,t,r):o===13?new LXe(e,t,r):o===14?new BXe(e,t,r):{}}var HXe=class extends yt{constructor(e,t){let{p:r}=super(e,t);this.version=r.uint16,this.numTables=r.uint16,this.encodingRecords=[...new Array(this.numTables)].map(o=>new UXe(r,this.tableStart))}getSubTable(e){return this.encodingRecords[e].table}getSupportedEncodings(){return this.encodingRecords.map(e=>({platformID:e.platformID,encodingId:e.encodingID}))}getSupportedCharCodes(e,t){let r=this.encodingRecords.findIndex(n=>n.platformID===e&&n.encodingID===t);return r===-1?!1:this.getSubTable(r).getSupportedCharCodes()}reverse(e){for(let t=0;t{let n=this.getSubTable(o);return n.getGlyphId?(t=n.getGlyphId(e),t!==0):!1}),t}supports(e){return this.encodingRecords.some((t,r)=>{let o=this.getSubTable(r);return o.supports&&o.supports(e)!==!1})}supportsVariation(e){return this.encodingRecords.some((t,r)=>{let o=this.getSubTable(r);return o.supportsVariation&&o.supportsVariation(e)!==!1})}},UXe=class{constructor(e,t){let r=this.platformID=e.uint16,o=this.encodingID=e.uint16,n=this.offset=e.Offset32;ze(this,"table",()=>(e.currentPosition=t+n,zXe(e,r,o)))}},WXe=Object.freeze({__proto__:null,cmap:HXe}),GXe=class extends yt{constructor(e,t){let{p:r}=super(e,t);this.load({majorVersion:r.uint16,minorVersion:r.uint16,fontRevision:r.fixed,checkSumAdjustment:r.uint32,magicNumber:r.uint32,flags:r.flags(16),unitsPerEm:r.uint16,created:r.longdatetime,modified:r.longdatetime,xMin:r.int16,yMin:r.int16,xMax:r.int16,yMax:r.int16,macStyle:r.flags(16),lowestRecPPEM:r.uint16,fontDirectionHint:r.uint16,indexToLocFormat:r.uint16,glyphDataFormat:r.uint16})}},YXe=Object.freeze({__proto__:null,head:GXe}),qXe=class extends yt{constructor(e,t){let{p:r}=super(e,t);this.majorVersion=r.uint16,this.minorVersion=r.uint16,this.ascender=r.fword,this.descender=r.fword,this.lineGap=r.fword,this.advanceWidthMax=r.ufword,this.minLeftSideBearing=r.fword,this.minRightSideBearing=r.fword,this.xMaxExtent=r.fword,this.caretSlopeRise=r.int16,this.caretSlopeRun=r.int16,this.caretOffset=r.int16,r.int16,r.int16,r.int16,r.int16,this.metricDataFormat=r.int16,this.numberOfHMetrics=r.uint16,r.verifyLength()}},KXe=Object.freeze({__proto__:null,hhea:qXe}),ZXe=class extends yt{constructor(e,t,r){let{p:o}=super(e,t),n=r.hhea.numberOfHMetrics,i=r.maxp.numGlyphs,s=o.currentPosition;if(ze(this,"hMetrics",()=>(o.currentPosition=s,[...new Array(n)].map(l=>new XXe(o.uint16,o.int16)))),n(o.currentPosition=l,[...new Array(i-n)].map(c=>o.int16)))}}},XXe=class{constructor(e,t){this.advanceWidth=e,this.lsb=t}},QXe=Object.freeze({__proto__:null,hmtx:ZXe}),JXe=class extends yt{constructor(e,t){let{p:r}=super(e,t);this.version=r.legacyFixed,this.numGlyphs=r.uint16,this.version===1&&(this.maxPoints=r.uint16,this.maxContours=r.uint16,this.maxCompositePoints=r.uint16,this.maxCompositeContours=r.uint16,this.maxZones=r.uint16,this.maxTwilightPoints=r.uint16,this.maxStorage=r.uint16,this.maxFunctionDefs=r.uint16,this.maxInstructionDefs=r.uint16,this.maxStackElements=r.uint16,this.maxSizeOfInstructions=r.uint16,this.maxComponentElements=r.uint16,this.maxComponentDepth=r.uint16),r.verifyLength()}},$Xe=Object.freeze({__proto__:null,maxp:JXe}),eQe=class extends yt{constructor(e,t){let{p:r}=super(e,t);this.format=r.uint16,this.count=r.uint16,this.stringOffset=r.Offset16,this.nameRecords=[...new Array(this.count)].map(o=>new rQe(r,this)),this.format===1&&(this.langTagCount=r.uint16,this.langTagRecords=[...new Array(this.langTagCount)].map(o=>new tQe(r.uint16,r.Offset16))),this.stringStart=this.tableStart+this.stringOffset}get(e){let t=this.nameRecords.find(r=>r.nameID===e);if(t)return t.string}},tQe=class{constructor(e,t){this.length=e,this.offset=t}},rQe=class{constructor(e,t){this.platformID=e.uint16,this.encodingID=e.uint16,this.languageID=e.uint16,this.nameID=e.uint16,this.length=e.uint16,this.offset=e.Offset16,ze(this,"string",()=>(e.currentPosition=t.stringStart+this.offset,oQe(e,this)))}};function oQe(e,t){let{platformID:r,length:o}=t;if(o===0)return"";if(r===0||r===3){let s=[];for(let l=0,c=o/2;lr.uint8),this.ulUnicodeRange1=r.flags(32),this.ulUnicodeRange2=r.flags(32),this.ulUnicodeRange3=r.flags(32),this.ulUnicodeRange4=r.flags(32),this.achVendID=r.tag,this.fsSelection=r.uint16,this.usFirstCharIndex=r.uint16,this.usLastCharIndex=r.uint16,this.sTypoAscender=r.int16,this.sTypoDescender=r.int16,this.sTypoLineGap=r.int16,this.usWinAscent=r.uint16,this.usWinDescent=r.uint16,this.version===0||(this.ulCodePageRange1=r.flags(32),this.ulCodePageRange2=r.flags(32),this.version===1)||(this.sxHeight=r.int16,this.sCapHeight=r.int16,this.usDefaultChar=r.uint16,this.usBreakChar=r.uint16,this.usMaxContext=r.uint16,this.version<=4)||(this.usLowerOpticalPointSize=r.uint16,this.usUpperOpticalPointSize=r.uint16,this.version===5))return r.verifyLength()}},sQe=Object.freeze({__proto__:null,OS2:iQe}),aQe=class extends yt{constructor(e,t){let{p:r}=super(e,t);if(this.version=r.legacyFixed,this.italicAngle=r.fixed,this.underlinePosition=r.fword,this.underlineThickness=r.fword,this.isFixedPitch=r.uint32,this.minMemType42=r.uint32,this.maxMemType42=r.uint32,this.minMemType1=r.uint32,this.maxMemType1=r.uint32,this.version===1||this.version===3)return r.verifyLength();if(this.numGlyphs=r.uint16,this.version===2){this.glyphNameIndex=[...new Array(this.numGlyphs)].map(o=>r.uint16),this.namesOffset=r.currentPosition,this.glyphNameOffsets=[1];for(let o=0;or.int8))}getGlyphName(e){if(this.version!==2)return console.warn(`post table version ${this.version} does not support glyph name lookups`),"";let t=this.glyphNameIndex[e];if(t<258)return Vbe[t];let r=this.glyphNameOffsets[e],n=this.glyphNameOffsets[e+1]-r-1;return n===0?".notdef.":(this.parser.currentPosition=this.namesOffset+r,this.parser.readBytes(n,this.namesOffset+r,8,!0).map(s=>String.fromCharCode(s)).join(""))}},Vbe=[".notdef",".null","nonmarkingreturn","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quotesingle","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","grave","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","Adieresis","Aring","Ccedilla","Eacute","Ntilde","Odieresis","Udieresis","aacute","agrave","acircumflex","adieresis","atilde","aring","ccedilla","eacute","egrave","ecircumflex","edieresis","iacute","igrave","icircumflex","idieresis","ntilde","oacute","ograve","ocircumflex","odieresis","otilde","uacute","ugrave","ucircumflex","udieresis","dagger","degree","cent","sterling","section","bullet","paragraph","germandbls","registered","copyright","trademark","acute","dieresis","notequal","AE","Oslash","infinity","plusminus","lessequal","greaterequal","yen","mu","partialdiff","summation","product","pi","integral","ordfeminine","ordmasculine","Omega","ae","oslash","questiondown","exclamdown","logicalnot","radical","florin","approxequal","Delta","guillemotleft","guillemotright","ellipsis","nonbreakingspace","Agrave","Atilde","Otilde","OE","oe","endash","emdash","quotedblleft","quotedblright","quoteleft","quoteright","divide","lozenge","ydieresis","Ydieresis","fraction","currency","guilsinglleft","guilsinglright","fi","fl","daggerdbl","periodcentered","quotesinglbase","quotedblbase","perthousand","Acircumflex","Ecircumflex","Aacute","Edieresis","Egrave","Iacute","Icircumflex","Idieresis","Igrave","Oacute","Ocircumflex","apple","Ograve","Uacute","Ucircumflex","Ugrave","dotlessi","circumflex","tilde","macron","breve","dotaccent","ring","cedilla","hungarumlaut","ogonek","caron","Lslash","lslash","Scaron","scaron","Zcaron","zcaron","brokenbar","Eth","eth","Yacute","yacute","Thorn","thorn","minus","multiply","onesuperior","twosuperior","threesuperior","onehalf","onequarter","threequarters","franc","Gbreve","gbreve","Idotaccent","Scedilla","scedilla","Cacute","cacute","Ccaron","ccaron","dcroat"],lQe=Object.freeze({__proto__:null,post:aQe}),cQe=class extends yt{constructor(e,t){let{p:r}=super(e,t);this.majorVersion=r.uint16,this.minorVersion=r.uint16,this.horizAxisOffset=r.Offset16,this.vertAxisOffset=r.Offset16,ze(this,"horizAxis",()=>new iG({offset:e.offset+this.horizAxisOffset},t)),ze(this,"vertAxis",()=>new iG({offset:e.offset+this.vertAxisOffset},t)),this.majorVersion===1&&this.minorVersion===1&&(this.itemVarStoreOffset=r.Offset32,ze(this,"itemVarStore",()=>new iG({offset:e.offset+this.itemVarStoreOffset},t)))}},iG=class extends yt{constructor(e,t){let{p:r}=super(e,t,"AxisTable");this.baseTagListOffset=r.Offset16,this.baseScriptListOffset=r.Offset16,ze(this,"baseTagList",()=>new uQe({offset:e.offset+this.baseTagListOffset},t)),ze(this,"baseScriptList",()=>new dQe({offset:e.offset+this.baseScriptListOffset},t))}},uQe=class extends yt{constructor(e,t){let{p:r}=super(e,t,"BaseTagListTable");this.baseTagCount=r.uint16,this.baselineTags=[...new Array(this.baseTagCount)].map(o=>r.tag)}},dQe=class extends yt{constructor(e,t){let{p:r}=super(e,t,"BaseScriptListTable");this.baseScriptCount=r.uint16;let o=r.currentPosition;ze(this,"baseScriptRecords",()=>(r.currentPosition=o,[...new Array(this.baseScriptCount)].map(n=>new fQe(this.start,r))))}},fQe=class{constructor(e,t){this.baseScriptTag=t.tag,this.baseScriptOffset=t.Offset16,ze(this,"baseScriptTable",()=>(t.currentPosition=e+this.baseScriptOffset,new pQe(t)))}},pQe=class{constructor(e){this.start=e.currentPosition,this.baseValuesOffset=e.Offset16,this.defaultMinMaxOffset=e.Offset16,this.baseLangSysCount=e.uint16,this.baseLangSysRecords=[...new Array(this.baseLangSysCount)].map(t=>new mQe(this.start,e)),ze(this,"baseValues",()=>(e.currentPosition=this.start+this.baseValuesOffset,new hQe(e))),ze(this,"defaultMinMax",()=>(e.currentPosition=this.start+this.defaultMinMaxOffset,new Ybe(e)))}},mQe=class{constructor(e,t){this.baseLangSysTag=t.tag,this.minMaxOffset=t.Offset16,ze(this,"minMax",()=>(t.currentPosition=e+this.minMaxOffset,new Ybe(t)))}},hQe=class{constructor(e){this.parser=e,this.start=e.currentPosition,this.defaultBaselineIndex=e.uint16,this.baseCoordCount=e.uint16,this.baseCoords=[...new Array(this.baseCoordCount)].map(t=>e.Offset16)}getTable(e){return this.parser.currentPosition=this.start+this.baseCoords[e],new vQe(this.parser)}},Ybe=class{constructor(e){this.minCoord=e.Offset16,this.maxCoord=e.Offset16,this.featMinMaxCount=e.uint16;let t=e.currentPosition;ze(this,"featMinMaxRecords",()=>(e.currentPosition=t,[...new Array(this.featMinMaxCount)].map(r=>new gQe(e))))}},gQe=class{constructor(e){this.featureTableTag=e.tag,this.minCoord=e.Offset16,this.maxCoord=e.Offset16}},vQe=class{constructor(e){this.baseCoordFormat=e.uint16,this.coordinate=e.int16,this.baseCoordFormat===2&&(this.referenceGlyph=e.uint16,this.baseCoordPoint=e.uint16),this.baseCoordFormat===3&&(this.deviceTable=e.Offset16)}},bQe=Object.freeze({__proto__:null,BASE:cQe}),Bbe=class{constructor(e){this.classFormat=e.uint16,this.classFormat===1&&(this.startGlyphID=e.uint16,this.glyphCount=e.uint16,this.classValueArray=[...new Array(this.glyphCount)].map(t=>e.uint16)),this.classFormat===2&&(this.classRangeCount=e.uint16,this.classRangeRecords=[...new Array(this.classRangeCount)].map(t=>new yQe(e)))}},yQe=class{constructor(e){this.startGlyphID=e.uint16,this.endGlyphID=e.uint16,this.class=e.uint16}},_T=class extends Eo{constructor(e){super(e),this.coverageFormat=e.uint16,this.coverageFormat===1&&(this.glyphCount=e.uint16,this.glyphArray=[...new Array(this.glyphCount)].map(t=>e.uint16)),this.coverageFormat===2&&(this.rangeCount=e.uint16,this.rangeRecords=[...new Array(this.rangeCount)].map(t=>new wQe(e)))}},wQe=class{constructor(e){this.startGlyphID=e.uint16,this.endGlyphID=e.uint16,this.startCoverageIndex=e.uint16}},_Qe=class{constructor(e,t){this.table=e,this.parser=t,this.start=t.currentPosition,this.format=t.uint16,this.variationRegionListOffset=t.Offset32,this.itemVariationDataCount=t.uint16,this.itemVariationDataOffsets=[...new Array(this.itemVariationDataCount)].map(r=>t.Offset32)}},SQe=class extends yt{constructor(e,t){let{p:r}=super(e,t);this.majorVersion=r.uint16,this.minorVersion=r.uint16,this.glyphClassDefOffset=r.Offset16,ze(this,"glyphClassDefs",()=>{if(this.glyphClassDefOffset!==0)return r.currentPosition=this.tableStart+this.glyphClassDefOffset,new Bbe(r)}),this.attachListOffset=r.Offset16,ze(this,"attachList",()=>{if(this.attachListOffset!==0)return r.currentPosition=this.tableStart+this.attachListOffset,new xQe(r)}),this.ligCaretListOffset=r.Offset16,ze(this,"ligCaretList",()=>{if(this.ligCaretListOffset!==0)return r.currentPosition=this.tableStart+this.ligCaretListOffset,new EQe(r)}),this.markAttachClassDefOffset=r.Offset16,ze(this,"markAttachClassDef",()=>{if(this.markAttachClassDefOffset!==0)return r.currentPosition=this.tableStart+this.markAttachClassDefOffset,new Bbe(r)}),this.minorVersion>=2&&(this.markGlyphSetsDefOffset=r.Offset16,ze(this,"markGlyphSetsDef",()=>{if(this.markGlyphSetsDefOffset!==0)return r.currentPosition=this.tableStart+this.markGlyphSetsDefOffset,new kQe(r)})),this.minorVersion===3&&(this.itemVarStoreOffset=r.Offset32,ze(this,"itemVarStore",()=>{if(this.itemVarStoreOffset!==0)return r.currentPosition=this.tableStart+this.itemVarStoreOffset,new _Qe(r)}))}},xQe=class extends Eo{constructor(e){super(e),this.coverageOffset=e.Offset16,this.glyphCount=e.uint16,this.attachPointOffsets=[...new Array(this.glyphCount)].map(t=>e.Offset16)}getPoint(e){return this.parser.currentPosition=this.start+this.attachPointOffsets[e],new CQe(this.parser)}},CQe=class{constructor(e){this.pointCount=e.uint16,this.pointIndices=[...new Array(this.pointCount)].map(t=>e.uint16)}},EQe=class extends Eo{constructor(e){super(e),this.coverageOffset=e.Offset16,ze(this,"coverage",()=>(e.currentPosition=this.start+this.coverageOffset,new _T(e))),this.ligGlyphCount=e.uint16,this.ligGlyphOffsets=[...new Array(this.ligGlyphCount)].map(t=>e.Offset16)}getLigGlyph(e){return this.parser.currentPosition=this.start+this.ligGlyphOffsets[e],new TQe(this.parser)}},TQe=class extends Eo{constructor(e){super(e),this.caretCount=e.uint16,this.caretValueOffsets=[...new Array(this.caretCount)].map(t=>e.Offset16)}getCaretValue(e){return this.parser.currentPosition=this.start+this.caretValueOffsets[e],new PQe(this.parser)}},PQe=class{constructor(e){this.caretValueFormat=e.uint16,this.caretValueFormat===1&&(this.coordinate=e.int16),this.caretValueFormat===2&&(this.caretValuePointIndex=e.uint16),this.caretValueFormat===3&&(this.coordinate=e.int16,this.deviceOffset=e.Offset16)}},kQe=class extends Eo{constructor(e){super(e),this.markGlyphSetTableFormat=e.uint16,this.markGlyphSetCount=e.uint16,this.coverageOffsets=[...new Array(this.markGlyphSetCount)].map(t=>e.Offset32)}getMarkGlyphSet(e){return this.parser.currentPosition=this.start+this.coverageOffsets[e],new _T(this.parser)}},RQe=Object.freeze({__proto__:null,GDEF:SQe}),jbe=class extends Eo{static EMPTY={scriptCount:0,scriptRecords:[]};constructor(e){super(e),this.scriptCount=e.uint16,this.scriptRecords=[...new Array(this.scriptCount)].map(t=>new AQe(e))}},AQe=class{constructor(e){this.scriptTag=e.tag,this.scriptOffset=e.Offset16}},IQe=class extends Eo{constructor(e){super(e),this.defaultLangSys=e.Offset16,this.langSysCount=e.uint16,this.langSysRecords=[...new Array(this.langSysCount)].map(t=>new OQe(e))}},OQe=class{constructor(e){this.langSysTag=e.tag,this.langSysOffset=e.Offset16}},zbe=class{constructor(e){this.lookupOrder=e.Offset16,this.requiredFeatureIndex=e.uint16,this.featureIndexCount=e.uint16,this.featureIndices=[...new Array(this.featureIndexCount)].map(t=>e.uint16)}},Hbe=class extends Eo{static EMPTY={featureCount:0,featureRecords:[]};constructor(e){super(e),this.featureCount=e.uint16,this.featureRecords=[...new Array(this.featureCount)].map(t=>new NQe(e))}},NQe=class{constructor(e){this.featureTag=e.tag,this.featureOffset=e.Offset16}},MQe=class extends Eo{constructor(e){super(e),this.featureParams=e.Offset16,this.lookupIndexCount=e.uint16,this.lookupListIndices=[...new Array(this.lookupIndexCount)].map(t=>e.uint16)}getFeatureParams(){if(this.featureParams>0){let e=this.parser;e.currentPosition=this.start+this.featureParams;let t=this.featureTag;if(t==="size")return new DQe(e);if(t.startsWith("cc"))return new FQe(e);if(t.startsWith("ss"))return new LQe(e)}}},FQe=class{constructor(e){this.format=e.uint16,this.featUiLabelNameId=e.uint16,this.featUiTooltipTextNameId=e.uint16,this.sampleTextNameId=e.uint16,this.numNamedParameters=e.uint16,this.firstParamUiLabelNameId=e.uint16,this.charCount=e.uint16,this.character=[...new Array(this.charCount)].map(t=>e.uint24)}},DQe=class{constructor(e){this.designSize=e.uint16,this.subfamilyIdentifier=e.uint16,this.subfamilyNameID=e.uint16,this.smallEnd=e.uint16,this.largeEnd=e.uint16}},LQe=class{constructor(e){this.version=e.uint16,this.UINameID=e.uint16}};function qbe(e){e.parser.currentPosition-=2,delete e.coverageOffset,delete e.getCoverageTable}var $b=class extends Eo{constructor(e){super(e),this.substFormat=e.uint16,this.coverageOffset=e.Offset16}getCoverageTable(){let e=this.parser;return e.currentPosition=this.start+this.coverageOffset,new _T(e)}},aG=class{constructor(e){this.glyphSequenceIndex=e.uint16,this.lookupListIndex=e.uint16}},VQe=class extends $b{constructor(e){super(e),this.deltaGlyphID=e.int16}},BQe=class extends $b{constructor(e){super(e),this.sequenceCount=e.uint16,this.sequenceOffsets=[...new Array(this.sequenceCount)].map(t=>e.Offset16)}getSequence(e){let t=this.parser;return t.currentPosition=this.start+this.sequenceOffsets[e],new jQe(t)}},jQe=class{constructor(e){this.glyphCount=e.uint16,this.substituteGlyphIDs=[...new Array(this.glyphCount)].map(t=>e.uint16)}},zQe=class extends $b{constructor(e){super(e),this.alternateSetCount=e.uint16,this.alternateSetOffsets=[...new Array(this.alternateSetCount)].map(t=>e.Offset16)}getAlternateSet(e){let t=this.parser;return t.currentPosition=this.start+this.alternateSetOffsets[e],new HQe(t)}},HQe=class{constructor(e){this.glyphCount=e.uint16,this.alternateGlyphIDs=[...new Array(this.glyphCount)].map(t=>e.uint16)}},UQe=class extends $b{constructor(e){super(e),this.ligatureSetCount=e.uint16,this.ligatureSetOffsets=[...new Array(this.ligatureSetCount)].map(t=>e.Offset16)}getLigatureSet(e){let t=this.parser;return t.currentPosition=this.start+this.ligatureSetOffsets[e],new WQe(t)}},WQe=class extends Eo{constructor(e){super(e),this.ligatureCount=e.uint16,this.ligatureOffsets=[...new Array(this.ligatureCount)].map(t=>e.Offset16)}getLigature(e){let t=this.parser;return t.currentPosition=this.start+this.ligatureOffsets[e],new GQe(t)}},GQe=class{constructor(e){this.ligatureGlyph=e.uint16,this.componentCount=e.uint16,this.componentGlyphIDs=[...new Array(this.componentCount-1)].map(t=>e.uint16)}},YQe=class extends $b{constructor(e){super(e),this.substFormat===1&&(this.subRuleSetCount=e.uint16,this.subRuleSetOffsets=[...new Array(this.subRuleSetCount)].map(t=>e.Offset16)),this.substFormat===2&&(this.classDefOffset=e.Offset16,this.subClassSetCount=e.uint16,this.subClassSetOffsets=[...new Array(this.subClassSetCount)].map(t=>e.Offset16)),this.substFormat===3&&(qbe(this),this.glyphCount=e.uint16,this.substitutionCount=e.uint16,this.coverageOffsets=[...new Array(this.glyphCount)].map(t=>e.Offset16),this.substLookupRecords=[...new Array(this.substitutionCount)].map(t=>new aG(e)))}getSubRuleSet(e){if(this.substFormat!==1)throw new Error(`lookup type 5.${this.substFormat} has no subrule sets.`);let t=this.parser;return t.currentPosition=this.start+this.subRuleSetOffsets[e],new qQe(t)}getSubClassSet(e){if(this.substFormat!==2)throw new Error(`lookup type 5.${this.substFormat} has no subclass sets.`);let t=this.parser;return t.currentPosition=this.start+this.subClassSetOffsets[e],new KQe(t)}getCoverageTable(e){if(this.substFormat!==3&&!e)return super.getCoverageTable();if(!e)throw new Error(`lookup type 5.${this.substFormat} requires an coverage table index.`);let t=this.parser;return t.currentPosition=this.start+this.coverageOffsets[e],new _T(t)}},qQe=class extends Eo{constructor(e){super(e),this.subRuleCount=e.uint16,this.subRuleOffsets=[...new Array(this.subRuleCount)].map(t=>e.Offset16)}getSubRule(e){let t=this.parser;return t.currentPosition=this.start+this.subRuleOffsets[e],new Kbe(t)}},Kbe=class{constructor(e){this.glyphCount=e.uint16,this.substitutionCount=e.uint16,this.inputSequence=[...new Array(this.glyphCount-1)].map(t=>e.uint16),this.substLookupRecords=[...new Array(this.substitutionCount)].map(t=>new aG(e))}},KQe=class extends Eo{constructor(e){super(e),this.subClassRuleCount=e.uint16,this.subClassRuleOffsets=[...new Array(this.subClassRuleCount)].map(t=>e.Offset16)}getSubClass(e){let t=this.parser;return t.currentPosition=this.start+this.subClassRuleOffsets[e],new ZQe(t)}},ZQe=class extends Kbe{constructor(e){super(e)}},XQe=class extends $b{constructor(e){super(e),this.substFormat===1&&(this.chainSubRuleSetCount=e.uint16,this.chainSubRuleSetOffsets=[...new Array(this.chainSubRuleSetCount)].map(t=>e.Offset16)),this.substFormat===2&&(this.backtrackClassDefOffset=e.Offset16,this.inputClassDefOffset=e.Offset16,this.lookaheadClassDefOffset=e.Offset16,this.chainSubClassSetCount=e.uint16,this.chainSubClassSetOffsets=[...new Array(this.chainSubClassSetCount)].map(t=>e.Offset16)),this.substFormat===3&&(qbe(this),this.backtrackGlyphCount=e.uint16,this.backtrackCoverageOffsets=[...new Array(this.backtrackGlyphCount)].map(t=>e.Offset16),this.inputGlyphCount=e.uint16,this.inputCoverageOffsets=[...new Array(this.inputGlyphCount)].map(t=>e.Offset16),this.lookaheadGlyphCount=e.uint16,this.lookaheadCoverageOffsets=[...new Array(this.lookaheadGlyphCount)].map(t=>e.Offset16),this.seqLookupCount=e.uint16,this.seqLookupRecords=[...new Array(this.substitutionCount)].map(t=>new Zbe(e)))}getChainSubRuleSet(e){if(this.substFormat!==1)throw new Error(`lookup type 6.${this.substFormat} has no chainsubrule sets.`);let t=this.parser;return t.currentPosition=this.start+this.chainSubRuleSetOffsets[e],new QQe(t)}getChainSubClassSet(e){if(this.substFormat!==2)throw new Error(`lookup type 6.${this.substFormat} has no chainsubclass sets.`);let t=this.parser;return t.currentPosition=this.start+this.chainSubClassSetOffsets[e],new $Qe(t)}getCoverageFromOffset(e){if(this.substFormat!==3)throw new Error(`lookup type 6.${this.substFormat} does not use contextual coverage offsets.`);let t=this.parser;return t.currentPosition=this.start+e,new _T(t)}},QQe=class extends Eo{constructor(e){super(e),this.chainSubRuleCount=e.uint16,this.chainSubRuleOffsets=[...new Array(this.chainSubRuleCount)].map(t=>e.Offset16)}getSubRule(e){let t=this.parser;return t.currentPosition=this.start+this.chainSubRuleOffsets[e],new JQe(t)}},JQe=class{constructor(e){this.backtrackGlyphCount=e.uint16,this.backtrackSequence=[...new Array(this.backtrackGlyphCount)].map(t=>e.uint16),this.inputGlyphCount=e.uint16,this.inputSequence=[...new Array(this.inputGlyphCount-1)].map(t=>e.uint16),this.lookaheadGlyphCount=e.uint16,this.lookAheadSequence=[...new Array(this.lookAheadGlyphCount)].map(t=>e.uint16),this.substitutionCount=e.uint16,this.substLookupRecords=[...new Array(this.SubstCount)].map(t=>new aG(e))}},$Qe=class extends Eo{constructor(e){super(e),this.chainSubClassRuleCount=e.uint16,this.chainSubClassRuleOffsets=[...new Array(this.chainSubClassRuleCount)].map(t=>e.Offset16)}getSubClass(e){let t=this.parser;return t.currentPosition=this.start+this.chainSubRuleOffsets[e],new eJe(t)}},eJe=class{constructor(e){this.backtrackGlyphCount=e.uint16,this.backtrackSequence=[...new Array(this.backtrackGlyphCount)].map(t=>e.uint16),this.inputGlyphCount=e.uint16,this.inputSequence=[...new Array(this.inputGlyphCount-1)].map(t=>e.uint16),this.lookaheadGlyphCount=e.uint16,this.lookAheadSequence=[...new Array(this.lookAheadGlyphCount)].map(t=>e.uint16),this.substitutionCount=e.uint16,this.substLookupRecords=[...new Array(this.substitutionCount)].map(t=>new Zbe(e))}},Zbe=class extends Eo{constructor(e){super(e),this.sequenceIndex=e.uint16,this.lookupListIndex=e.uint16}},tJe=class extends Eo{constructor(e){super(e),this.substFormat=e.uint16,this.extensionLookupType=e.uint16,this.extensionOffset=e.Offset32}},rJe=class extends $b{constructor(e){super(e),this.backtrackGlyphCount=e.uint16,this.backtrackCoverageOffsets=[...new Array(this.backtrackGlyphCount)].map(t=>e.Offset16),this.lookaheadGlyphCount=e.uint16,this.lookaheadCoverageOffsets=[new Array(this.lookaheadGlyphCount)].map(t=>e.Offset16),this.glyphCount=e.uint16,this.substituteGlyphIDs=[...new Array(this.glyphCount)].map(t=>e.uint16)}},oJe={buildSubtable:function(e,t){let r=new[void 0,VQe,BQe,zQe,UQe,YQe,XQe,tJe,rJe][e](t);return r.type=e,r}},xp=class extends Eo{constructor(e){super(e)}},nJe=class extends xp{constructor(e){super(e),console.log("lookup type 1")}},iJe=class extends xp{constructor(e){super(e),console.log("lookup type 2")}},sJe=class extends xp{constructor(e){super(e),console.log("lookup type 3")}},aJe=class extends xp{constructor(e){super(e),console.log("lookup type 4")}},lJe=class extends xp{constructor(e){super(e),console.log("lookup type 5")}},cJe=class extends xp{constructor(e){super(e),console.log("lookup type 6")}},uJe=class extends xp{constructor(e){super(e),console.log("lookup type 7")}},dJe=class extends xp{constructor(e){super(e),console.log("lookup type 8")}},fJe=class extends xp{constructor(e){super(e),console.log("lookup type 9")}},pJe={buildSubtable:function(e,t){let r=new[void 0,nJe,iJe,sJe,aJe,lJe,cJe,uJe,dJe,fJe][e](t);return r.type=e,r}},Ube=class extends Eo{static EMPTY={lookupCount:0,lookups:[]};constructor(e){super(e),this.lookupCount=e.uint16,this.lookups=[...new Array(this.lookupCount)].map(t=>e.Offset16)}},mJe=class extends Eo{constructor(e,t){super(e),this.ctType=t,this.lookupType=e.uint16,this.lookupFlag=e.uint16,this.subTableCount=e.uint16,this.subtableOffsets=[...new Array(this.subTableCount)].map(r=>e.Offset16),this.markFilteringSet=e.uint16}get rightToLeft(){return this.lookupFlag&!0}get ignoreBaseGlyphs(){return this.lookupFlag&!0}get ignoreLigatures(){return this.lookupFlag&!0}get ignoreMarks(){return this.lookupFlag&!0}get useMarkFilteringSet(){return this.lookupFlag&!0}get markAttachmentType(){return this.lookupFlag&!0}getSubTable(e){let t=this.ctType==="GSUB"?oJe:pJe;return this.parser.currentPosition=this.start+this.subtableOffsets[e],t.buildSubtable(this.lookupType,this.parser)}},Xbe=class extends yt{constructor(e,t,r){let{p:o,tableStart:n}=super(e,t,r);this.majorVersion=o.uint16,this.minorVersion=o.uint16,this.scriptListOffset=o.Offset16,this.featureListOffset=o.Offset16,this.lookupListOffset=o.Offset16,this.majorVersion===1&&this.minorVersion===1&&(this.featureVariationsOffset=o.Offset32);let i=!(this.scriptListOffset||this.featureListOffset||this.lookupListOffset);ze(this,"scriptList",()=>i?jbe.EMPTY:(o.currentPosition=n+this.scriptListOffset,new jbe(o))),ze(this,"featureList",()=>i?Hbe.EMPTY:(o.currentPosition=n+this.featureListOffset,new Hbe(o))),ze(this,"lookupList",()=>i?Ube.EMPTY:(o.currentPosition=n+this.lookupListOffset,new Ube(o))),this.featureVariationsOffset&&ze(this,"featureVariations",()=>i?FeatureVariations.EMPTY:(o.currentPosition=n+this.featureVariationsOffset,new FeatureVariations(o)))}getSupportedScripts(){return this.scriptList.scriptRecords.map(e=>e.scriptTag)}getScriptTable(e){let t=this.scriptList.scriptRecords.find(o=>o.scriptTag===e);this.parser.currentPosition=this.scriptList.start+t.scriptOffset;let r=new IQe(this.parser);return r.scriptTag=e,r}ensureScriptTable(e){return typeof e=="string"?this.getScriptTable(e):e}getSupportedLangSys(e){e=this.ensureScriptTable(e);let t=e.defaultLangSys!==0,r=e.langSysRecords.map(o=>o.langSysTag);return t&&r.unshift("dflt"),r}getDefaultLangSysTable(e){e=this.ensureScriptTable(e);let t=e.defaultLangSys;if(t!==0){this.parser.currentPosition=e.start+t;let r=new zbe(this.parser);return r.langSysTag="",r.defaultForScript=e.scriptTag,r}}getLangSysTable(e,t="dflt"){if(t==="dflt")return this.getDefaultLangSysTable(e);e=this.ensureScriptTable(e);let r=e.langSysRecords.find(n=>n.langSysTag===t);this.parser.currentPosition=e.start+r.langSysOffset;let o=new zbe(this.parser);return o.langSysTag=t,o}getFeatures(e){return e.featureIndices.map(t=>this.getFeature(t))}getFeature(e){let t;if(parseInt(e)==e?t=this.featureList.featureRecords[e]:t=this.featureList.featureRecords.find(o=>o.featureTag===e),!t)return;this.parser.currentPosition=this.featureList.start+t.featureOffset;let r=new MQe(this.parser);return r.featureTag=t.featureTag,r}getLookups(e){return e.lookupListIndices.map(t=>this.getLookup(t))}getLookup(e,t){let r=this.lookupList.lookups[e];return this.parser.currentPosition=this.lookupList.start+r,new mJe(this.parser,t)}},hJe=class extends Xbe{constructor(e,t){super(e,t,"GSUB")}getLookup(e){return super.getLookup(e,"GSUB")}},gJe=Object.freeze({__proto__:null,GSUB:hJe}),vJe=class extends Xbe{constructor(e,t){super(e,t,"GPOS")}getLookup(e){return super.getLookup(e,"GPOS")}},bJe=Object.freeze({__proto__:null,GPOS:vJe}),yJe=class extends yt{constructor(e,t){let{p:r}=super(e,t);this.version=r.uint16,this.offsetToSVGDocumentList=r.Offset32,r.currentPosition=this.tableStart+this.offsetToSVGDocumentList,this.documentList=new wJe(r)}},wJe=class extends Eo{constructor(e){super(e),this.numEntries=e.uint16,this.documentRecords=[...new Array(this.numEntries)].map(t=>new _Je(e))}getDocument(e){let t=this.documentRecords[e];if(!t)return"";let r=this.start+t.svgDocOffset;return this.parser.currentPosition=r,this.parser.readBytes(t.svgDocLength)}getDocumentForGlyph(e){let t=this.documentRecords.findIndex(r=>r.startGlyphID<=e&&e<=r.endGlyphID);return t===-1?"":this.getDocument(t)}},_Je=class{constructor(e){this.startGlyphID=e.uint16,this.endGlyphID=e.uint16,this.svgDocOffset=e.Offset32,this.svgDocLength=e.uint32}},SJe=Object.freeze({__proto__:null,SVG:yJe}),xJe=class extends yt{constructor(e,t){let{p:r}=super(e,t);this.majorVersion=r.uint16,this.minorVersion=r.uint16,this.axesArrayOffset=r.Offset16,r.uint16,this.axisCount=r.uint16,this.axisSize=r.uint16,this.instanceCount=r.uint16,this.instanceSize=r.uint16;let o=this.tableStart+this.axesArrayOffset;ze(this,"axes",()=>(r.currentPosition=o,[...new Array(this.axisCount)].map(i=>new CJe(r))));let n=o+this.axisCount*this.axisSize;ze(this,"instances",()=>{let i=[];for(let s=0;se.tag)}getAxis(e){return this.axes.find(t=>t.tag===e)}},CJe=class{constructor(e){this.tag=e.tag,this.minValue=e.fixed,this.defaultValue=e.fixed,this.maxValue=e.fixed,this.flags=e.flags(16),this.axisNameID=e.uint16}},EJe=class{constructor(e,t,r){let o=e.currentPosition;this.subfamilyNameID=e.uint16,e.uint16,this.coordinates=[...new Array(t)].map(n=>e.fixed),e.currentPosition-o[...new Array(o)].map(n=>r.fword))}},kJe=Object.freeze({__proto__:null,cvt:PJe}),RJe=class extends yt{constructor(e,t){let{p:r}=super(e,t);ze(this,"instructions",()=>[...new Array(e.length)].map(o=>r.uint8))}},AJe=Object.freeze({__proto__:null,fpgm:RJe}),IJe=class extends yt{constructor(e,t){let{p:r}=super(e,t);this.version=r.uint16,this.numRanges=r.uint16,ze(this,"gaspRanges",()=>[...new Array(this.numRanges)].map(n=>new OJe(r)))}},OJe=class{constructor(e){this.rangeMaxPPEM=e.uint16,this.rangeGaspBehavior=e.uint16}},NJe=Object.freeze({__proto__:null,gasp:IJe}),MJe=class extends yt{constructor(e,t){super(e,t)}getGlyphData(e,t){return this.parser.currentPosition=this.tableStart+e,this.parser.readBytes(t)}},FJe=Object.freeze({__proto__:null,glyf:MJe}),DJe=class extends yt{constructor(e,t,r){let{p:o}=super(e,t),n=r.maxp.numGlyphs+1;r.head.indexToLocFormat===0?(this.x2=!0,ze(this,"offsets",()=>[...new Array(n)].map(i=>o.Offset16))):ze(this,"offsets",()=>[...new Array(n)].map(i=>o.Offset32))}getGlyphDataOffsetAndLength(e){let t=this.offsets[e]*this.x2?2:1,r=this.offsets[e+1]*this.x2?2:1;return{offset:t,length:r-t}}},LJe=Object.freeze({__proto__:null,loca:DJe}),VJe=class extends yt{constructor(e,t){let{p:r}=super(e,t);ze(this,"instructions",()=>[...new Array(e.length)].map(o=>r.uint8))}},BJe=Object.freeze({__proto__:null,prep:VJe}),jJe=class extends yt{constructor(e,t){let{p:r}=super(e,t);ze(this,"data",()=>r.readBytes())}},zJe=Object.freeze({__proto__:null,CFF:jJe}),HJe=class extends yt{constructor(e,t){let{p:r}=super(e,t);ze(this,"data",()=>r.readBytes())}},UJe=Object.freeze({__proto__:null,CFF2:HJe}),WJe=class extends yt{constructor(e,t){let{p:r}=super(e,t);this.majorVersion=r.uint16,this.minorVersion=r.uint16,this.defaultVertOriginY=r.int16,this.numVertOriginYMetrics=r.uint16,ze(this,"vertORiginYMetrics",()=>[...new Array(this.numVertOriginYMetrics)].map(o=>new GJe(r)))}},GJe=class{constructor(e){this.glyphIndex=e.uint16,this.vertOriginY=e.int16}},YJe=Object.freeze({__proto__:null,VORG:WJe}),qJe=class{constructor(e){this.indexSubTableArrayOffset=e.Offset32,this.indexTablesSize=e.uint32,this.numberofIndexSubTables=e.uint32,this.colorRef=e.uint32,this.hori=new AM(e),this.vert=new AM(e),this.startGlyphIndex=e.uint16,this.endGlyphIndex=e.uint16,this.ppemX=e.uint8,this.ppemY=e.uint8,this.bitDepth=e.uint8,this.flags=e.int8}},KJe=class{constructor(e){this.hori=new AM(e),this.vert=new AM(e),this.ppemX=e.uint8,this.ppemY=e.uint8,this.substitutePpemX=e.uint8,this.substitutePpemY=e.uint8}},AM=class{constructor(e){this.ascender=e.int8,this.descender=e.int8,this.widthMax=e.uint8,this.caretSlopeNumerator=e.int8,this.caretSlopeDenominator=e.int8,this.caretOffset=e.int8,this.minOriginSB=e.int8,this.minAdvanceSB=e.int8,this.maxBeforeBL=e.int8,this.minAfterBL=e.int8,this.pad1=e.int8,this.pad2=e.int8}},Qbe=class extends yt{constructor(e,t,r){let{p:o}=super(e,t,r);this.majorVersion=o.uint16,this.minorVersion=o.uint16,this.numSizes=o.uint32,ze(this,"bitMapSizes",()=>[...new Array(this.numSizes)].map(n=>new qJe(o)))}},ZJe=Object.freeze({__proto__:null,EBLC:Qbe}),Jbe=class extends yt{constructor(e,t,r){let{p:o}=super(e,t,r);this.majorVersion=o.uint16,this.minorVersion=o.uint16}},XJe=Object.freeze({__proto__:null,EBDT:Jbe}),QJe=class extends yt{constructor(e,t){let{p:r}=super(e,t);this.majorVersion=r.uint16,this.minorVersion=r.uint16,this.numSizes=r.uint32,ze(this,"bitmapScales",()=>[...new Array(this.numSizes)].map(o=>new KJe(r)))}},JJe=Object.freeze({__proto__:null,EBSC:QJe}),$Je=class extends Qbe{constructor(e,t){super(e,t,"CBLC")}},e$e=Object.freeze({__proto__:null,CBLC:$Je}),t$e=class extends Jbe{constructor(e,t){super(e,t,"CBDT")}},r$e=Object.freeze({__proto__:null,CBDT:t$e}),o$e=class extends yt{constructor(e,t){let{p:r}=super(e,t);this.version=r.uint16,this.flags=r.flags(16),this.numStrikes=r.uint32,ze(this,"strikeOffsets",()=>[...new Array(this.numStrikes)].map(o=>r.Offset32))}},n$e=Object.freeze({__proto__:null,sbix:o$e}),i$e=class extends yt{constructor(e,t){let{p:r}=super(e,t);this.version=r.uint16,this.numBaseGlyphRecords=r.uint16,this.baseGlyphRecordsOffset=r.Offset32,this.layerRecordsOffset=r.Offset32,this.numLayerRecords=r.uint16}getBaseGlyphRecord(e){let t=this.tableStart+this.baseGlyphRecordsOffset;this.parser.currentPosition=t;let r=new sG(this.parser),o=r.gID,n=this.tableStart+this.layerRecordsOffset-6;this.parser.currentPosition=n;let i=new sG(this.parser),s=i.gID;if(o===e)return r;if(s===e)return i;for(;t!==n;){let l=t+(n-t)/12;this.parser.currentPosition=l;let c=new sG(this.parser),u=c.gID;if(u===e)return c;u>e?n=l:unew s$e(p))}},sG=class{constructor(e){this.gID=e.uint16,this.firstLayerIndex=e.uint16,this.numLayers=e.uint16}},s$e=class{constructor(e){this.gID=e.uint16,this.paletteIndex=e.uint16}},a$e=Object.freeze({__proto__:null,COLR:i$e}),l$e=class extends yt{constructor(e,t){let{p:r}=super(e,t);this.version=r.uint16,this.numPaletteEntries=r.uint16;let o=this.numPalettes=r.uint16;this.numColorRecords=r.uint16,this.offsetFirstColorRecord=r.Offset32,this.colorRecordIndices=[...new Array(this.numPalettes)].map(n=>r.uint16),ze(this,"colorRecords",()=>(r.currentPosition=this.tableStart+this.offsetFirstColorRecord,[...new Array(this.numColorRecords)].map(n=>new c$e(r)))),this.version===1&&(this.offsetPaletteTypeArray=r.Offset32,this.offsetPaletteLabelArray=r.Offset32,this.offsetPaletteEntryLabelArray=r.Offset32,ze(this,"paletteTypeArray",()=>(r.currentPosition=this.tableStart+this.offsetPaletteTypeArray,new u$e(r,o))),ze(this,"paletteLabelArray",()=>(r.currentPosition=this.tableStart+this.offsetPaletteLabelArray,new d$e(r,o))),ze(this,"paletteEntryLabelArray",()=>(r.currentPosition=this.tableStart+this.offsetPaletteEntryLabelArray,new f$e(r,o))))}},c$e=class{constructor(e){this.blue=e.uint8,this.green=e.uint8,this.red=e.uint8,this.alpha=e.uint8}},u$e=class{constructor(e,t){this.paletteTypes=[...new Array(t)].map(r=>e.uint32)}},d$e=class{constructor(e,t){this.paletteLabels=[...new Array(t)].map(r=>e.uint16)}},f$e=class{constructor(e,t){this.paletteEntryLabels=[...new Array(t)].map(r=>e.uint16)}},p$e=Object.freeze({__proto__:null,CPAL:l$e}),m$e=class extends yt{constructor(e,t){let{p:r}=super(e,t);this.version=r.uint32,this.numSignatures=r.uint16,this.flags=r.uint16,this.signatureRecords=[...new Array(this.numSignatures)].map(o=>new h$e(r))}getData(e){let t=this.signatureRecords[e];return this.parser.currentPosition=this.tableStart+t.offset,new g$e(this.parser)}},h$e=class{constructor(e){this.format=e.uint32,this.length=e.uint32,this.offset=e.Offset32}},g$e=class{constructor(e){e.uint16,e.uint16,this.signatureLength=e.uint32,this.signature=e.readBytes(this.signatureLength)}},v$e=Object.freeze({__proto__:null,DSIG:m$e}),b$e=class extends yt{constructor(e,t,r){let{p:o}=super(e,t),n=r.hmtx.numGlyphs;this.version=o.uint16,this.numRecords=o.int16,this.sizeDeviceRecord=o.int32,this.records=[...new Array(numRecords)].map(i=>new y$e(o,n))}},y$e=class{constructor(e,t){this.pixelSize=e.uint8,this.maxWidth=e.uint8,this.widths=e.readBytes(t)}},w$e=Object.freeze({__proto__:null,hdmx:b$e}),_$e=class extends yt{constructor(e,t){let{p:r}=super(e,t);this.version=r.uint16,this.nTables=r.uint16,ze(this,"tables",()=>{let o=this.tableStart+4,n=[];for(let i=0;i[...new Array(this.nPairs)].map(t=>new x$e(e)))),this.format===2&&console.warn("Kern subtable format 2 is not supported: this parser currently only parses universal table data.")}get horizontal(){return this.coverage[0]}get minimum(){return this.coverage[1]}get crossstream(){return this.coverage[2]}get override(){return this.coverage[3]}},x$e=class{constructor(e){this.left=e.uint16,this.right=e.uint16,this.value=e.fword}},C$e=Object.freeze({__proto__:null,kern:_$e}),E$e=class extends yt{constructor(e,t){let{p:r}=super(e,t);this.version=r.uint16,this.numGlyphs=r.uint16,this.yPels=r.readBytes(this.numGlyphs)}},T$e=Object.freeze({__proto__:null,LTSH:E$e}),P$e=class extends yt{constructor(e,t){let{p:r}=super(e,t);this.version=r.uint16,this.mergeClassCount=r.uint16,this.mergeDataOffset=r.Offset16,this.classDefCount=r.uint16,this.offsetToClassDefOffsets=r.Offset16,ze(this,"mergeEntryMatrix",()=>[...new Array(this.mergeClassCount)].map(o=>r.readBytes(this.mergeClassCount))),console.warn("Full MERG parsing is currently not supported."),console.warn("If you need this table parsed, please file an issue, or better yet, a PR.")}},k$e=Object.freeze({__proto__:null,MERG:P$e}),R$e=class extends yt{constructor(e,t){let{p:r}=super(e,t);this.version=r.uint32,this.flags=r.uint32,r.uint32,this.dataMapsCount=r.uint32,this.dataMaps=[...new Array(this.dataMapsCount)].map(o=>new A$e(this.tableStart,r))}},A$e=class{constructor(e,t){this.tableStart=e,this.parser=t,this.tag=t.tag,this.dataOffset=t.Offset32,this.dataLength=t.uint32}getData(){return this.parser.currentField=this.tableStart+this.dataOffset,this.parser.readBytes(this.dataLength)}},I$e=Object.freeze({__proto__:null,meta:R$e}),O$e=class extends yt{constructor(e,t){super(e,t),console.warn("This font uses a PCLT table, which is currently not supported by this parser."),console.warn("If you need this table parsed, please file an issue, or better yet, a PR.")}},N$e=Object.freeze({__proto__:null,PCLT:O$e}),M$e=class extends yt{constructor(e,t){let{p:r}=super(e,t);this.version=r.uint16,this.numRecs=r.uint16,this.numRatios=r.uint16,this.ratRanges=[...new Array(this.numRatios)].map(o=>new F$e(r)),this.offsets=[...new Array(this.numRatios)].map(o=>r.Offset16),this.VDMXGroups=[...new Array(this.numRecs)].map(o=>new D$e(r))}},F$e=class{constructor(e){this.bCharSet=e.uint8,this.xRatio=e.uint8,this.yStartRatio=e.uint8,this.yEndRatio=e.uint8}},D$e=class{constructor(e){this.recs=e.uint16,this.startsz=e.uint8,this.endsz=e.uint8,this.records=[...new Array(this.recs)].map(t=>new L$e(e))}},L$e=class{constructor(e){this.yPelHeight=e.uint16,this.yMax=e.int16,this.yMin=e.int16}},V$e=Object.freeze({__proto__:null,VDMX:M$e}),B$e=class extends yt{constructor(e,t){let{p:r}=super(e,t);this.version=r.fixed,this.ascent=this.vertTypoAscender=r.int16,this.descent=this.vertTypoDescender=r.int16,this.lineGap=this.vertTypoLineGap=r.int16,this.advanceHeightMax=r.int16,this.minTopSideBearing=r.int16,this.minBottomSideBearing=r.int16,this.yMaxExtent=r.int16,this.caretSlopeRise=r.int16,this.caretSlopeRun=r.int16,this.caretOffset=r.int16,this.reserved=r.int16,this.reserved=r.int16,this.reserved=r.int16,this.reserved=r.int16,this.metricDataFormat=r.int16,this.numOfLongVerMetrics=r.uint16,r.verifyLength()}},j$e=Object.freeze({__proto__:null,vhea:B$e}),z$e=class extends yt{constructor(e,t,r){super(e,t);let o=r.vhea.numOfLongVerMetrics,n=r.maxp.numGlyphs,i=p.currentPosition;if(lazy(this,"vMetrics",()=>(p.currentPosition=i,[...new Array(o)].map(s=>new H$e(p.uint16,p.int16)))),o(p.currentPosition=s,[...new Array(n-o)].map(l=>p.int16)))}}},H$e=class{constructor(e,t){this.advanceHeight=e,this.topSideBearing=t}},U$e=Object.freeze({__proto__:null,vmtx:z$e});var $be=a(G(),1);var{kebabCase:W$e}=Tt($be.privateApis);function eye(e){let t=e.reduce((r,o)=>(r[o.fontFamily]||(r[o.fontFamily]={name:o.fontFamily,fontFamily:o.fontFamily,slug:W$e(o.fontFamily.toLowerCase()),fontFace:[]}),r[o.fontFamily].fontFace.push(o),r),{});return Object.values(t)}var Ra=a(T(),1);function G$e(){let{installFonts:e}=(0,ST.useContext)(Si),[t,r]=(0,ST.useState)(!1),[o,n]=(0,ST.useState)(null),i=h=>{l(h)},s=h=>{l(h.target.files)},l=async h=>{if(!h)return;n(null),r(!0);let g=new Set,v=[...h],b=!1,_=v.map(async w=>{if(!await u(w))return b=!0,null;if(g.has(w.name))return null;let x=(((w.name??"").split(".")??[]).pop()??"").toLowerCase();return tG.includes(x)?(g.add(w.name),w):null}),y=(await Promise.all(_)).filter(w=>w!==null);if(y.length>0)c(y);else{let w=b?(0,O_.__)("Sorry, you are not allowed to upload this file type."):(0,O_.__)("No fonts found to install.");n({type:"error",message:w}),r(!1)}},c=async h=>{let g=await Promise.all(h.map(async v=>{let b=await f(v);return await ng(b,b.file,"all"),b}));m(g)};async function u(h){let g=new IM("Uploaded Font");try{let v=await d(h);return await g.fromDataBuffer(v,"font"),!0}catch{return!1}}async function d(h){return new Promise((g,v)=>{let b=new window.FileReader;b.readAsArrayBuffer(h),b.onload=()=>g(b.result),b.onerror=v})}let f=async h=>{let g=await d(h),v=new IM("Uploaded Font");v.fromDataBuffer(g,h.name);let _=(await new Promise(R=>v.onload=R)).detail.font,{name:y}=_.opentype.tables,w=y.get(16)||y.get(1),S=y.get(2).toLowerCase().includes("italic"),x=_.opentype.tables["OS/2"].usWeightClass||"normal",A=!!_.opentype.tables.fvar&&_.opentype.tables.fvar.axes.find(({tag:R})=>R==="wght"),P=A?`${A.minValue} ${A.maxValue}`:null;return{file:h,fontFamily:w,fontStyle:S?"italic":"normal",fontWeight:P||x}},m=async h=>{let g=eye(h);try{await e(g),n({type:"success",message:(0,O_.__)("Fonts were installed successfully.")})}catch(v){let b=v;n({type:"error",message:b.message,errors:b?.installationErrors})}r(!1)};return(0,Ra.jsxs)("div",{className:"font-library__tabpanel-layout",children:[(0,Ra.jsx)(ns.DropZone,{onFilesDrop:i}),(0,Ra.jsxs)(ns.__experimentalVStack,{className:"font-library__local-fonts",justify:"start",children:[o&&(0,Ra.jsxs)(ns.Notice,{status:o.type,__unstableHTML:!0,onRemove:()=>n(null),children:[o.message,o.errors&&(0,Ra.jsx)("ul",{children:o.errors.map((h,g)=>(0,Ra.jsx)("li",{children:h},g))})]}),t&&(0,Ra.jsx)(ns.FlexItem,{children:(0,Ra.jsx)("div",{className:"font-library__upload-area",children:(0,Ra.jsx)(ns.ProgressBar,{})})}),!t&&(0,Ra.jsx)(ns.FormFileUpload,{accept:tG.map(h=>`.${h}`).join(","),multiple:!0,onChange:s,render:({openFileDialog:h})=>(0,Ra.jsx)(ns.Button,{__next40pxDefaultSize:!0,className:"font-library__upload-area",onClick:h,children:(0,O_.__)("Upload font")})}),(0,Ra.jsx)(ns.__experimentalText,{className:"font-library__upload-area__text",children:(0,O_.__)("Uploaded fonts appear in your library and can be used in your theme. Supported formats: .ttf, .otf, .woff, and .woff2.")})]})]})}var OM=G$e;var eu=a(T(),1),{Tabs:NM}=Tt(MM.privateApis),Y$e={id:"installed-fonts",title:(0,N_._x)("Library","Font library")},q$e={id:"upload-fonts",title:(0,N_._x)("Upload","noun")},K$e=e=>e.map(({slug:t,name:r})=>({id:t,title:e.length===1&&t==="google-fonts"?(0,N_.__)("Install Fonts"):r}));function Z$e({onRequestClose:e,defaultTabId:t="installed-fonts"}){let{records:r=[]}=(0,FM.useEntityRecords)("root","fontCollection",{_fields:"slug,name,description"}),o=(0,tye.useSelect)(i=>i(FM.store).canUser("create",{kind:"postType",name:"wp_font_family"}),[]),n=[Y$e];return o&&(n.push(q$e),n.push(...K$e(r||[]))),(0,eu.jsx)(MM.Modal,{title:(0,N_.__)("Fonts"),onRequestClose:e,isFullScreen:!0,className:"font-library-modal",children:(0,eu.jsxs)(NM,{defaultTabId:t,children:[(0,eu.jsx)("div",{className:"font-library-modal__tablist-container",children:(0,eu.jsx)(NM.TabList,{children:n.map(({id:i,title:s})=>(0,eu.jsx)(NM.Tab,{tabId:i,children:s},i))})}),n.map(({id:i})=>{let s;switch(i){case"upload-fonts":s=(0,eu.jsx)(OM,{});break;case"installed-fonts":s=(0,eu.jsx)(xM,{});break;default:s=(0,eu.jsx)(EM,{slug:i})}return(0,eu.jsx)(NM.TabPanel,{tabId:i,focusable:!1,className:"font-library-modal__tab-panel",children:s},i)})]})})}var rye=Z$e;var DM=a(j(),1),ey=a(G(),1),oye=a(U(),1);var M_=a(T(),1);function X$e({font:e}){let{handleSetLibraryFontSelected:t,setModalTabOpen:r}=(0,oye.useContext)(Si),o=e?.fontFace?.length||1,n=()=>{t?.(e),r?.("installed-fonts")},i=Gb(e);return(0,M_.jsx)(ey.__experimentalItem,{onClick:n,children:(0,M_.jsxs)(ey.__experimentalHStack,{justify:"space-between",children:[(0,M_.jsx)(ey.FlexItem,{style:i,children:e.name}),(0,M_.jsx)(ey.FlexItem,{className:"global-styles-ui-screen-typography__font-variants-count",children:(0,DM.sprintf)((0,DM._n)("%d variant","%d variants",o),o)})]})})}var nye=X$e;var yn=a(T(),1);function iye(e,t){return e?e.map(r=>wp(r,{source:t})):[]}function Q$e(){let{baseCustomFonts:e,modalTabOpen:t,setModalTabOpen:r}=(0,sye.useContext)(Si),[o]=Le("typography.fontFamilies"),[n]=Le("typography.fontFamilies",void 0,"base"),i=iye(o?.theme,"theme"),s=iye(o?.custom,"custom"),l=[...i,...s].sort((d,f)=>d.name.localeCompare(f.name)),c=00||(e?.length??0)>0;return(0,yn.jsxs)(yn.Fragment,{children:[!!t&&(0,yn.jsx)(rye,{onRequestClose:()=>r?.(""),defaultTabId:t}),(0,yn.jsxs)(tu.__experimentalVStack,{spacing:2,children:[(0,yn.jsxs)(tu.__experimentalHStack,{justify:"space-between",children:[(0,yn.jsx)(Uo,{level:3,children:(0,ty.__)("Fonts")}),(0,yn.jsx)(tu.Button,{onClick:()=>r?.("installed-fonts"),label:(0,ty.__)("Manage fonts"),icon:HB,size:"small"})]}),l.length>0&&(0,yn.jsx)(yn.Fragment,{children:(0,yn.jsx)(tu.__experimentalItemGroup,{size:"large",isBordered:!0,isSeparated:!0,children:l.map(d=>(0,yn.jsx)(nye,{font:d},d.slug))})}),!c&&(0,yn.jsxs)(yn.Fragment,{children:[(0,yn.jsx)(tu.__experimentalText,{as:"p",children:u?(0,ty.__)("No fonts activated."):(0,ty.__)("No fonts installed.")}),(0,yn.jsx)(tu.Button,{className:"global-styles-ui-font-families__manage-fonts",variant:"secondary",__next40pxDefaultSize:!0,onClick:()=>{r?.(u?"installed-fonts":"upload-fonts")},children:u?(0,ty.__)("Manage fonts"):(0,ty.__)("Add fonts")})]})]})]})}function aye({...e}){return(0,yn.jsx)(vM,{children:(0,yn.jsx)(Q$e,{...e})})}var xT=a(j(),1),Cp=a(G(),1);var Ld=a(T(),1);function J$e(){return(0,Ld.jsxs)(Cp.__experimentalVStack,{spacing:2,children:[(0,Ld.jsx)(Cp.__experimentalHStack,{justify:"space-between",children:(0,Ld.jsx)(Uo,{level:3,children:(0,xT.__)("Font Sizes")})}),(0,Ld.jsx)(Cp.__experimentalItemGroup,{isBordered:!0,isSeparated:!0,children:(0,Ld.jsx)(xo,{path:"/typography/font-sizes",children:(0,Ld.jsxs)(Cp.__experimentalHStack,{direction:"row",children:[(0,Ld.jsx)(Cp.FlexItem,{children:(0,xT.__)("Font size presets")}),(0,Ld.jsx)(En,{icon:(0,xT.isRTL)()?Ar:hr})]})})})]})}var lye=J$e;var tc=a(T(),1);function $$e(){let{fontLibraryEnabled:e}=(0,uye.useContext)(on);return(0,tc.jsxs)(tc.Fragment,{children:[(0,tc.jsx)(sr,{title:(0,LM.__)("Typography"),description:(0,LM.__)("Available fonts, typographic styles, and the application of those styles.")}),(0,tc.jsx)(tg,{children:(0,tc.jsxs)(cye.__experimentalVStack,{spacing:7,children:[(0,tc.jsx)(k_,{title:(0,LM.__)("Typesets")}),e&&(0,tc.jsx)(aye,{}),(0,tc.jsx)(Jve,{}),(0,tc.jsx)(lye,{})]})})]})}var dye=$$e;var Or=a(j(),1),pl=a(G(),1),bye=a(U(),1);var fye=a(be(),1);var pye=a(T(),1),{useSettingsForBlockElement:eet,TypographyPanel:tet}=Tt(fye.privateApis);function mye({element:e,headingLevel:t}){let r=[];e==="heading"?r=r.concat(["elements",t]):e&&e!=="text"&&(r=r.concat(["elements",e]));let o=r.join("."),[n]=qe(o,"","user",!1),[i,s]=qe(o,"","merged",!1),[l]=Le(""),u=eet(l,void 0,e==="heading"?t:e);return(0,pye.jsx)(tet,{inheritedValue:i,value:n,onChange:s,settings:u,showInheritanceLabelIndicators:!1})}var hye=a(T(),1);function gye({name:e,element:t,headingLevel:r}){let o="";t==="heading"?o=`elements.${r}.`:t&&t!=="text"&&(o=`elements.${t}.`);let[n]=qe(o+"typography.fontFamily",e),[i]=qe(o+"color.gradient",e),[s]=qe(o+"color.background",e),[l]=qe("color.background"),[c]=qe(o+"color.text",e),[u]=qe(o+"typography.fontSize",e),[d]=qe(o+"typography.fontStyle",e),[f]=qe(o+"typography.fontWeight",e),[m]=qe(o+"typography.letterSpacing",e);return(0,hye.jsx)("div",{className:"global-styles-ui-typography-preview",style:{fontFamily:n??"serif",background:i??s??l,color:c,fontSize:u,fontStyle:d,fontWeight:f,letterSpacing:m,...t==="link"?{textDecoration:"underline"}:{}},children:"Aa"})}var ti=a(T(),1),vye={text:{description:(0,Or.__)("Manage the fonts used on the site."),title:(0,Or.__)("Text")},link:{description:(0,Or.__)("Manage the fonts and typography used on the links."),title:(0,Or.__)("Links")},heading:{description:(0,Or.__)("Manage the fonts and typography used on headings."),title:(0,Or.__)("Headings")},caption:{description:(0,Or.__)("Manage the fonts and typography used on captions."),title:(0,Or.__)("Captions")},button:{description:(0,Or.__)("Manage the fonts and typography used on buttons."),title:(0,Or.__)("Buttons")}};function ret({element:e}){let[t,r]=(0,bye.useState)("heading");return(0,ti.jsxs)(ti.Fragment,{children:[(0,ti.jsx)(sr,{title:vye[e].title,description:vye[e].description}),(0,ti.jsx)(pl.__experimentalSpacer,{marginX:4,children:(0,ti.jsx)(gye,{element:e,headingLevel:t})}),e==="heading"&&(0,ti.jsx)(pl.__experimentalSpacer,{marginX:4,marginBottom:"1em",children:(0,ti.jsxs)(pl.__experimentalToggleGroupControl,{label:(0,Or.__)("Select heading level"),hideLabelFromVision:!0,value:t,onChange:o=>r(o),isBlock:!0,children:[(0,ti.jsx)(pl.__experimentalToggleGroupControlOption,{value:"heading",showTooltip:!0,"aria-label":(0,Or.__)("All headings"),label:(0,Or._x)("All","heading levels")}),(0,ti.jsx)(pl.__experimentalToggleGroupControlOption,{value:"h1",showTooltip:!0,"aria-label":(0,Or.__)("Heading 1"),label:(0,Or.__)("H1")}),(0,ti.jsx)(pl.__experimentalToggleGroupControlOption,{value:"h2",showTooltip:!0,"aria-label":(0,Or.__)("Heading 2"),label:(0,Or.__)("H2")}),(0,ti.jsx)(pl.__experimentalToggleGroupControlOption,{value:"h3",showTooltip:!0,"aria-label":(0,Or.__)("Heading 3"),label:(0,Or.__)("H3")}),(0,ti.jsx)(pl.__experimentalToggleGroupControlOption,{value:"h4",showTooltip:!0,"aria-label":(0,Or.__)("Heading 4"),label:(0,Or.__)("H4")}),(0,ti.jsx)(pl.__experimentalToggleGroupControlOption,{value:"h5",showTooltip:!0,"aria-label":(0,Or.__)("Heading 5"),label:(0,Or.__)("H5")}),(0,ti.jsx)(pl.__experimentalToggleGroupControlOption,{value:"h6",showTooltip:!0,"aria-label":(0,Or.__)("Heading 6"),label:(0,Or.__)("H6")})]})}),(0,ti.jsx)(mye,{element:e,headingLevel:t})]})}var F_=ret;var lG=a(j(),1),Cye=a(G(),1),Eye=a(be(),1);var ml=a(G(),1),D_=a(j(),1);var Sye=a(U(),1);var yye=a(G(),1),wye=a(T(),1);function oet({className:e,children:t,...r}){return(0,wye.jsx)(yye.Flex,{className:J("global-styles-ui__color-indicator-wrapper",e),...r,children:t})}var _ye=oet;var is=a(T(),1),VM=[];function net({name:e}){let[t]=Le("color.palette.custom"),[r]=Le("color.palette.theme"),[o]=Le("color.palette.default"),[n]=Le("color.defaultPalette",e),i=t||VM,s=r||VM,l=o||VM,c=n??!0,u=(0,Sye.useMemo)(()=>[...i,...s,...l&&c?l:VM],[i,s,l,c]),d=e?"/blocks/"+encodeURIComponent(e)+"/colors/palette":"/colors/palette";return(0,is.jsxs)(ml.__experimentalVStack,{spacing:3,children:[(0,is.jsx)(Uo,{level:3,children:(0,D_.__)("Palette")}),(0,is.jsx)(ml.__experimentalItemGroup,{isBordered:!0,isSeparated:!0,children:(0,is.jsx)(xo,{path:d,children:(0,is.jsxs)(ml.__experimentalHStack,{direction:"row",children:[u.length>0?(0,is.jsxs)(is.Fragment,{children:[(0,is.jsx)(ml.__experimentalZStack,{isLayered:!1,offset:-8,children:u.slice(0,5).map(({color:f},m)=>(0,is.jsx)(_ye,{children:(0,is.jsx)(ml.ColorIndicator,{colorValue:f})},`${f}-${m}`))}),(0,is.jsx)(ml.FlexItem,{isBlock:!0,children:(0,D_.__)("Edit palette")})]}):(0,is.jsx)(ml.FlexItem,{children:(0,D_.__)("Add colors")}),(0,is.jsx)(En,{icon:(0,D_.isRTL)()?Ar:hr})]})})})]})}var xye=net;var Vd=a(T(),1),{useSettingsForBlockElement:iet,ColorPanel:set}=Tt(Eye.privateApis);function aet(){let[e,t]=qe("",void 0,"user",!1),[r]=qe("",void 0,"merged",!1),[o]=Le(""),n=iet(o);return(0,Vd.jsxs)(Vd.Fragment,{children:[(0,Vd.jsx)(sr,{title:(0,lG.__)("Colors"),description:(0,lG.__)("Palette colors and the application of those colors on site elements.")}),(0,Vd.jsx)(tg,{children:(0,Vd.jsx)(Cye.__experimentalVStack,{spacing:7,children:(0,Vd.jsx)(xye,{})})}),(0,Vd.jsx)(set,{inheritedValue:r,value:e,onChange:t,settings:n,showInheritanceLabelIndicators:!1})]})}var Tye=aet;var TT=a(j(),1);var Iye=a(Ce(),1),Tp=a(G(),1),V_=a(j(),1);var jM=a(G(),1);var BM=a(G(),1);var Pye=a(T(),1);function kye(){let{paletteColors:e}=x_();return e.slice(0,4).map(({slug:t,color:r},o)=>(0,Pye.jsx)("div",{style:{flexGrow:1,height:"100%",background:r}},`${t}-${o}`))}var CT=a(T(),1),cet={start:{scale:1,opacity:1},hover:{scale:0,opacity:0}},uet=({label:e,isFocused:t,withHoverView:r})=>(0,CT.jsx)(E_,{label:e,isFocused:t,withHoverView:r,children:({key:o})=>(0,CT.jsx)(BM.__unstableMotion.div,{variants:cet,style:{height:"100%",overflow:"hidden"},children:(0,CT.jsx)(BM.__experimentalHStack,{spacing:0,justify:"center",style:{height:"100%",overflow:"hidden"},children:(0,CT.jsx)(kye,{})})},o)}),Rye=uet;var ry=a(T(),1),Aye=["color"];function L_({title:e,gap:t=2}){let r=iM(Aye);return r?.length<=1?null:(0,ry.jsxs)(jM.__experimentalVStack,{spacing:3,children:[e&&(0,ry.jsx)(Uo,{level:3,children:e}),(0,ry.jsx)(jM.__experimentalGrid,{gap:t,children:r.map((o,n)=>(0,ry.jsx)(P_,{variation:o,isPill:!0,properties:Aye,showTooltip:!0,children:()=>(0,ry.jsx)(Rye,{})},n))})]})}var Ep=a(T(),1),det={placement:"bottom-start",offset:8};function Oye({name:e}){let[t,r]=Le("color.palette.theme",e),[o]=Le("color.palette.theme",e,"base"),[n,i]=Le("color.palette.default",e),[s]=Le("color.palette.default",e,"base"),[l,c]=Le("color.palette.custom",e),[u]=Le("color.defaultPalette",e),f=(0,Iye.useViewportMatch)("small","<")?det:void 0,[m]=gve(e);return(0,Ep.jsxs)(Tp.__experimentalVStack,{className:"global-styles-ui-color-palette-panel",spacing:8,children:[(0,Ep.jsxs)(Tp.__experimentalVStack,{spacing:4,children:[!!t&&!!t.length&&(0,Ep.jsx)(Tp.__experimentalPaletteEdit,{canReset:t!==o,canOnlyChangeValues:!0,colors:t,onChange:r,paletteLabel:(0,V_.__)("Theme"),paletteLabelHeadingLevel:3,popoverProps:f}),window.__experimentalEnableColorRandomizer&&t?.length>0&&m&&(0,Ep.jsx)(Tp.Button,{__next40pxDefaultSize:!0,variant:"secondary",icon:GB,onClick:m,children:(0,V_.__)("Randomize colors")})]}),!!n&&!!n.length&&!!u&&(0,Ep.jsx)(Tp.__experimentalPaletteEdit,{canReset:n!==s,canOnlyChangeValues:!0,colors:n,onChange:i,paletteLabel:(0,V_.__)("Default"),paletteLabelHeadingLevel:3,popoverProps:f}),(0,Ep.jsx)(Tp.__experimentalPaletteEdit,{colors:l,onChange:c,paletteLabel:(0,V_.__)("Custom"),paletteLabelHeadingLevel:3,slugPrefix:"custom-",popoverProps:f}),(0,Ep.jsx)(L_,{title:(0,V_.__)("Palettes")})]})}var Nye=a(Ce(),1),jd=a(G(),1),ET=a(j(),1);var Bd=a(T(),1),fet={placement:"bottom-start",offset:8},pet=()=>{};function Mye({name:e}){let[t,r]=Le("color.gradients.theme",e),[o]=Le("color.gradients.theme",e,"base"),[n,i]=Le("color.gradients.default",e),[s]=Le("color.gradients.default",e,"base"),[l,c]=Le("color.gradients.custom",e),[u]=Le("color.defaultGradients",e),[d]=Le("color.duotone.custom")||[],[f]=Le("color.duotone.default")||[],[m]=Le("color.duotone.theme")||[],[h]=Le("color.defaultDuotone"),g=[...d||[],...m||[],...f&&h?f:[]],b=(0,Nye.useViewportMatch)("small","<")?fet:void 0;return(0,Bd.jsxs)(jd.__experimentalVStack,{className:"global-styles-ui-gradient-palette-panel",spacing:8,children:[!!t&&!!t.length&&(0,Bd.jsx)(jd.__experimentalPaletteEdit,{canReset:t!==o,canOnlyChangeValues:!0,gradients:t,onChange:r,paletteLabel:(0,ET.__)("Theme"),paletteLabelHeadingLevel:3,popoverProps:b}),!!n&&!!n.length&&!!u&&(0,Bd.jsx)(jd.__experimentalPaletteEdit,{canReset:n!==s,canOnlyChangeValues:!0,gradients:n,onChange:i,paletteLabel:(0,ET.__)("Default"),paletteLabelHeadingLevel:3,popoverProps:b}),(0,Bd.jsx)(jd.__experimentalPaletteEdit,{gradients:l,onChange:c,paletteLabel:(0,ET.__)("Custom"),paletteLabelHeadingLevel:3,slugPrefix:"custom-",popoverProps:b}),!!g&&!!g.length&&(0,Bd.jsxs)("div",{children:[(0,Bd.jsx)(Uo,{level:3,children:(0,ET.__)("Duotone")}),(0,Bd.jsx)(jd.__experimentalSpacer,{margin:3}),(0,Bd.jsx)(jd.DuotonePicker,{duotonePalette:g,disableCustomDuotone:!0,disableCustomColors:!0,clearable:!1,onChange:pet,colorPalette:[]})]})]})}var Ys=a(T(),1);function met({name:e}){return(0,Ys.jsxs)(Ys.Fragment,{children:[(0,Ys.jsx)(sr,{title:(0,TT.__)("Edit palette"),description:(0,TT.__)("The combination of colors used across the site and in color pickers.")}),(0,Ys.jsxs)(Pn.Root,{defaultValue:"color",children:[(0,Ys.jsx)("div",{className:"global-styles-ui-color-palette__tablist-container",children:(0,Ys.jsxs)(Pn.List,{className:"global-styles-ui-color-palette__tablist",children:[(0,Ys.jsx)(Pn.Tab,{value:"color",children:(0,TT.__)("Color")}),(0,Ys.jsx)(Pn.Tab,{value:"gradient",children:(0,TT.__)("Gradient")})]})}),(0,Ys.jsx)(Pn.Panel,{value:"color",tabIndex:-1,children:(0,Ys.jsx)(Oye,{name:e})}),(0,Ys.jsx)(Pn.Panel,{value:"gradient",tabIndex:-1,children:(0,Ys.jsx)(Mye,{name:e})})]})]})}var Fye=met;var cG=a(j(),1),Bye=a(be(),1),jye=a(G(),1);var Dye=a(be(),1);var Lye=a(T(),1),het={backgroundSize:"auto"},{BackgroundPanel:get}=Tt(Dye.privateApis);function Vye(){let[e]=qe("",void 0,"user",!1),[t,r]=qe("",void 0,"merged",!1),[o]=Le("");return(0,Lye.jsx)(get,{inheritedValue:t,value:e,onChange:r,settings:o,defaultValues:het,showInheritanceLabelIndicators:!1})}var ag=a(T(),1),{useHasBackgroundPanel:vet}=Tt(Bye.privateApis);function bet(){let[e]=Le(""),t=vet(e);return(0,ag.jsxs)(ag.Fragment,{children:[(0,ag.jsx)(sr,{title:(0,cG.__)("Background"),description:(0,ag.jsx)(jye.__experimentalText,{children:(0,cG.__)("Set styles for the site's background.")})}),t&&(0,ag.jsx)(Vye,{})]})}var zye=bet;var as=a(G(),1),ss=a(j(),1);var Yye=a(U(),1);var Hye=a(G(),1),Uye=a(j(),1),Wye=a(T(),1);function yet({text:e,confirmButtonText:t,isOpen:r,toggleOpen:o,onConfirm:n}){let i=async()=>{o(),n()},s=()=>{o()};return(0,Wye.jsx)(Hye.__experimentalConfirmDialog,{isOpen:r,cancelButtonText:(0,Uye.__)("Cancel"),confirmButtonText:t,onCancel:s,onConfirm:i,size:"medium",children:e})}var Gye=yet;var _r=a(T(),1),{Menu:PT}=Tt(as.privateApis),dG="6px 6px 9px rgba(0, 0, 0, 0.2)";function qye(){let[e]=Le("shadow.presets.default"),[t]=Le("shadow.defaultPresets"),[r]=Le("shadow.presets.theme"),[o,n]=Le("shadow.presets.custom"),i=d=>{n([...o||[],d])},s=()=>{n([])},[l,c]=(0,Yye.useState)(!1),u=()=>c(!l);return(0,_r.jsxs)(_r.Fragment,{children:[l&&(0,_r.jsx)(Gye,{text:(0,ss.__)("Are you sure you want to remove all custom shadows?"),confirmButtonText:(0,ss.__)("Remove"),isOpen:l,toggleOpen:u,onConfirm:s}),(0,_r.jsx)(sr,{title:(0,ss.__)("Shadows"),description:(0,ss.__)("Manage and create shadow styles for use across the site.")}),(0,_r.jsx)(tg,{children:(0,_r.jsxs)(as.__experimentalVStack,{className:"global-styles-ui__shadows-panel",spacing:7,children:[t&&(0,_r.jsx)(uG,{label:(0,ss.__)("Default"),shadows:e||[],category:"default"}),r&&r.length>0&&(0,_r.jsx)(uG,{label:(0,ss.__)("Theme"),shadows:r||[],category:"theme"}),(0,_r.jsx)(uG,{label:(0,ss.__)("Custom"),shadows:o||[],category:"custom",canCreate:!0,onCreate:i,onReset:u})]})})]})}function uG({label:e,shadows:t,category:r,canCreate:o,onCreate:n,onReset:i}){let s=()=>{let l=nM(t,"shadow-");n?.({name:(0,ss.sprintf)((0,ss.__)("Shadow %d"),l),shadow:dG,slug:`shadow-${l}`})};return(0,_r.jsxs)(as.__experimentalVStack,{spacing:2,children:[(0,_r.jsxs)(as.__experimentalHStack,{justify:"space-between",children:[(0,_r.jsx)(Uo,{level:3,children:e}),(0,_r.jsxs)(as.FlexItem,{className:"global-styles-ui__shadows-panel__options-container",children:[o&&(0,_r.jsx)(as.Button,{size:"small",icon:Ec,label:(0,ss.__)("Add shadow"),onClick:()=>{s()}}),!!t?.length&&r==="custom"&&(0,_r.jsxs)(PT,{children:[(0,_r.jsx)(PT.TriggerButton,{render:(0,_r.jsx)(as.Button,{size:"small",icon:bo,label:(0,ss.__)("Shadow options")})}),(0,_r.jsx)(PT.Popover,{children:(0,_r.jsx)(PT.Item,{onClick:i,children:(0,_r.jsx)(PT.ItemLabel,{children:(0,ss.__)("Remove all custom shadows")})})})]})]})]}),t.length>0&&(0,_r.jsx)(as.__experimentalItemGroup,{isBordered:!0,isSeparated:!0,children:t.map(l=>(0,_r.jsx)(wet,{shadow:l,category:r},l.slug))})]})}function wet({shadow:e,category:t}){return(0,_r.jsx)(xo,{path:`/shadows/edit/${t}/${e.slug}`,children:(0,_r.jsxs)(as.__experimentalHStack,{children:[(0,_r.jsx)(as.FlexItem,{children:e.name}),(0,_r.jsx)(En,{icon:(0,ss.isRTL)()?Ar:hr})]})})}var ot=a(G(),1),zr=a(j(),1);var hl=a(U(),1);function Kye(e){return(e.match(/(?:[^,(]|\([^)]*\))+/g)||[]).map(r=>r.trim())}function Zye(e){let t={x:"0",y:"0",blur:"0",spread:"0",color:"#000",inset:!1};if(!e||e.includes("none"))return t;let r=/((?:^|\s+)(-?\d*\.?\d+(?:px|%|in|cm|mm|em|rem|ex|pt|pc|vh|vw|vmin|vmax|ch|lh)?)(?=\s|$)(?![^(]*\))){1,4}/g,o=e.match(r)||[];if(o.length!==1)return t;let n=o[0].split(" ").map(g=>g.trim()).filter(g=>g);if(n.length<2)return t;let i=e.match(/inset/gi)||[];if(i.length>1)return t;let s=i.length===1,l=e.replace(r,"").trim();s&&(l=l.replace("inset","").replace("INSET","").trim());let c=/^#([0-9a-f]{3}){1,2}$|^#([0-9a-f]{4}){1,2}$|^(?:rgb|hsl)a?\(?[\d*\.?\d+%?,?\/?\s]*\)$/gi,u=(l.match(c)||[]).map(g=>g?.trim()).filter(g=>g);if(u.length>1)return t;if(u.length===0&&(u=l.trim().split(" ").filter(g=>g),u.length>1))return t;let[d,f,m,h]=n;return{x:d,y:f,blur:m||t.blur,spread:h||t.spread,inset:s,color:l||t.color}}function Xye(e){let t=`${e.x||"0px"} ${e.y||"0px"} ${e.blur||"0px"} ${e.spread||"0px"}`;return`${e.inset?"inset":""} ${t} ${e.color||""}`.trim()}var We=a(T(),1),{Menu:kT}=Tt(ot.privateApis),_et=[{label:(0,zr.__)("Rename"),action:"rename"},{label:(0,zr.__)("Delete"),action:"delete"}],xet=[{label:(0,zr.__)("Reset"),action:"reset"}];function Qye(){let{goBack:e,params:t}=(0,ot.useNavigator)(),{category:r,slug:o}=t,[n,i]=Le(`shadow.presets.${r}`);(0,hl.useEffect)(()=>{let S=n?.some(x=>x.slug===o);o&&!S&&e()},[n,o,e]);let[s]=Le(`shadow.presets.${r}`,void 0,"base"),[l,c]=(0,hl.useState)(()=>(n||[]).find(S=>S.slug===o)),u=(0,hl.useMemo)(()=>(s||[]).find(S=>S.slug===o),[s,o]),[d,f]=(0,hl.useState)(!1),[m,h]=(0,hl.useState)(!1),[g,v]=(0,hl.useState)(l?.name);if(!r||!o)return null;let b=S=>{c({...l,shadow:S});let x=n.map(C=>C.slug===o?{...l,shadow:S}:C);i(x)},_=S=>{if(S==="reset"){let x=n.map(C=>C.slug===o?u:C);c(u),i(x)}else S==="delete"?f(!0):S==="rename"&&h(!0)},y=()=>{i(n.filter(S=>S.slug!==o))},w=S=>{if(!S)return;let x=n.map(C=>C.slug===o?{...l,name:S}:C);c({...l,name:S}),i(x)};return l?(0,We.jsxs)(We.Fragment,{children:[(0,We.jsxs)(ot.__experimentalHStack,{justify:"space-between",children:[(0,We.jsx)(sr,{title:l.name}),(0,We.jsx)(ot.FlexItem,{children:(0,We.jsx)(ot.__experimentalSpacer,{marginTop:2,marginBottom:0,paddingX:4,children:(0,We.jsxs)(kT,{children:[(0,We.jsx)(kT.TriggerButton,{render:(0,We.jsx)(ot.Button,{size:"small",icon:bo,label:(0,zr.__)("Menu")})}),(0,We.jsx)(kT.Popover,{children:(r==="custom"?_et:xet).map(S=>(0,We.jsx)(kT.Item,{onClick:()=>_(S.action),disabled:S.action==="reset"&&l.shadow===u?.shadow,children:(0,We.jsx)(kT.ItemLabel,{children:S.label})},S.action))})]})})})]}),(0,We.jsxs)(tg,{children:[(0,We.jsx)(Cet,{shadow:l.shadow}),(0,We.jsx)(Eet,{shadow:l.shadow,onChange:b})]}),d&&(0,We.jsx)(ot.__experimentalConfirmDialog,{isOpen:!0,onConfirm:()=>{y(),f(!1)},onCancel:()=>{f(!1)},confirmButtonText:(0,zr.__)("Delete"),size:"medium",children:(0,zr.sprintf)((0,zr.__)('Are you sure you want to delete "%s" shadow preset?'),l.name)}),m&&(0,We.jsx)(ot.Modal,{title:(0,zr.__)("Rename"),onRequestClose:()=>h(!1),size:"small",children:(0,We.jsxs)("form",{onSubmit:S=>{S.preventDefault(),w(g),h(!1)},children:[(0,We.jsx)(ot.__experimentalInputControl,{autoComplete:"off",label:(0,zr.__)("Name"),placeholder:(0,zr.__)("Shadow name"),value:g??"",onChange:v}),(0,We.jsx)(ot.__experimentalSpacer,{marginBottom:6}),(0,We.jsxs)(ot.Flex,{className:"block-editor-shadow-edit-modal__actions",justify:"flex-end",expanded:!1,children:[(0,We.jsx)(ot.FlexItem,{children:(0,We.jsx)(ot.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:()=>h(!1),children:(0,zr.__)("Cancel")})}),(0,We.jsx)(ot.FlexItem,{children:(0,We.jsx)(ot.Button,{__next40pxDefaultSize:!0,variant:"primary",type:"submit",children:(0,zr.__)("Save")})})]})]})})]}):(0,We.jsx)(sr,{title:""})}function Cet({shadow:e}){return(0,We.jsx)(ot.__experimentalSpacer,{marginBottom:4,marginTop:-2,children:(0,We.jsx)(ot.__experimentalHStack,{alignment:"center",justify:"center",className:"global-styles-ui__shadow-preview-panel",children:(0,We.jsx)("div",{className:"global-styles-ui__shadow-preview-block",style:{boxShadow:e}})})})}function Eet({shadow:e,onChange:t}){let r=(0,hl.useRef)(null),o=(0,hl.useMemo)(()=>Kye(e),[e]),n=(l,c)=>{let u=[...o];u[l]=c,t(u.join(", "))},i=()=>{t([...o,dG].join(", "))},s=l=>{t(o.filter((c,u)=>u!==l).join(", ")),r.current?.focus()};return(0,We.jsxs)(We.Fragment,{children:[(0,We.jsx)(ot.__experimentalVStack,{spacing:2,children:(0,We.jsxs)(ot.__experimentalHStack,{justify:"space-between",children:[(0,We.jsx)(Uo,{level:3,children:(0,zr.__)("Shadows")}),(0,We.jsx)(ot.FlexItem,{className:"global-styles-ui__shadows-panel__options-container",children:(0,We.jsx)(ot.Button,{size:"small",icon:Ec,label:(0,zr.__)("Add shadow"),onClick:()=>{i()},ref:r})})]})}),(0,We.jsx)(ot.__experimentalSpacer,{}),(0,We.jsx)(ot.__experimentalItemGroup,{isBordered:!0,isSeparated:!0,children:o.map((l,c)=>(0,We.jsx)(Tet,{shadow:l,onChange:u=>n(c,u),canRemove:o.length>1,onRemove:()=>s(c)},c))})]})}function Tet({shadow:e,onChange:t,canRemove:r,onRemove:o}){let n={placement:"left-start",offset:36,shift:!0},i=(0,hl.useMemo)(()=>Zye(e),[e]),s=l=>{t(Xye(l))};return(0,We.jsx)(ot.Dropdown,{popoverProps:n,className:"global-styles-ui__shadow-editor__dropdown",renderToggle:({onToggle:l,isOpen:c})=>{let u={onClick:l,className:J("global-styles-ui__shadow-editor__dropdown-toggle",{"is-open":c}),"aria-expanded":c},d={onClick:()=>{c&&l(),o()},className:J("global-styles-ui__shadow-editor__remove-button",{"is-open":c}),label:(0,zr.__)("Remove shadow")};return(0,We.jsxs)(We.Fragment,{children:[(0,We.jsx)(ot.Button,{__next40pxDefaultSize:!0,icon:E1,...u,children:i.inset?(0,zr.__)("Inner shadow"):(0,zr.__)("Drop shadow")}),r&&(0,We.jsx)(ot.Button,{size:"small",icon:FB,...d})]})},renderContent:()=>(0,We.jsx)(ot.__experimentalDropdownContentWrapper,{paddingSize:"medium",className:"global-styles-ui__shadow-editor__dropdown-content",children:(0,We.jsx)(Pet,{shadowObj:i,onChange:s})})})}function Pet({shadowObj:e,onChange:t}){let n=(i,s)=>{let l={...e,[i]:s};t(l)};return(0,We.jsxs)(ot.__experimentalVStack,{spacing:4,className:"global-styles-ui__shadow-editor-panel",children:[(0,We.jsx)(ot.ColorPalette,{clearable:!1,enableAlpha:!0,__experimentalIsRenderedInSidebar:!0,value:e.color,onChange:i=>n("color",i)}),(0,We.jsxs)(ot.__experimentalToggleGroupControl,{label:(0,zr.__)("Shadow Type"),value:e.inset?"inset":"outset",isBlock:!0,onChange:i=>n("inset",i==="inset"),hideLabelFromVision:!0,children:[(0,We.jsx)(ot.__experimentalToggleGroupControlOption,{value:"outset",label:(0,zr.__)("Outset")}),(0,We.jsx)(ot.__experimentalToggleGroupControlOption,{value:"inset",label:(0,zr.__)("Inset")})]}),(0,We.jsxs)(ot.__experimentalGrid,{columns:2,gap:4,children:[(0,We.jsx)(zM,{label:(0,zr.__)("X Position"),value:e.x,onChange:i=>n("x",i)}),(0,We.jsx)(zM,{label:(0,zr.__)("Y Position"),value:e.y,onChange:i=>n("y",i)}),(0,We.jsx)(zM,{label:(0,zr.__)("Blur"),value:e.blur,onChange:i=>n("blur",i)}),(0,We.jsx)(zM,{label:(0,zr.__)("Spread"),value:e.spread,onChange:i=>n("spread",i)})]})]})}function zM({label:e,value:t,onChange:r}){return(0,We.jsx)(ot.__experimentalUnitControl,{label:e,value:t,onChange:n=>{let s=n!==void 0&&!isNaN(parseFloat(n))?n:"0px";r(s)}})}var fG=a(T(),1);function Jye(){return(0,fG.jsx)(qye,{})}function $ye(){return(0,fG.jsx)(Qye,{})}var o0e=a(j(),1),n0e=a(be(),1);var e0e=a(be(),1),pG=a(U(),1);var t0e=a(T(),1),{useSettingsForBlockElement:ket,DimensionsPanel:Ret}=Tt(e0e.privateApis),Aet={contentSize:!0,wideSize:!0,padding:!0,margin:!0,blockGap:!0,height:!0,minHeight:!0,minWidth:!0,width:!0,childLayout:!1};function r0e(){let[e]=qe("",void 0,"user",!1),[t,r]=qe("",void 0,"merged",!1),[o]=Le("",void 0,"user"),[n,i]=Le(""),s=ket(n),l=(0,pG.useMemo)(()=>({...t,layout:s.layout}),[t,s.layout]),c=(0,pG.useMemo)(()=>({...e,layout:o.layout}),[e,o.layout]);return(0,t0e.jsx)(Ret,{inheritedValue:l,value:c,onChange:d=>{let f={...d};if(delete f.layout,r(f),d.layout!==o.layout){let m={...o,layout:d.layout};m.layout?.definitions&&delete m.layout.definitions,i(m)}},settings:s,includeLayoutControls:!0,defaultControls:Aet,showInheritanceLabelIndicators:!1})}var oy=a(T(),1),{useHasDimensionsPanel:Iet,useSettingsForBlockElement:Oet}=Tt(n0e.privateApis);function Net(){let[e]=Le(""),t=Oet(e),r=Iet(t);return(0,oy.jsxs)(oy.Fragment,{children:[(0,oy.jsx)(sr,{title:(0,o0e.__)("Layout")}),r&&(0,oy.jsx)(r0e,{})]})}var i0e=Net;var GM=a(G(),1),hG=a(j(),1);var mG=a(j(),1),u0e=a(G(),1);var s0e=a(ae(),1),a0e=a(Y(),1),UM=a(U(),1),l0e=a(G(),1),c0e=a(j(),1);var HM=a(T(),1);function Met({gap:e=2}){let{user:t}=(0,UM.useContext)(on),r=t?.styles,n=(0,a0e.useSelect)(s=>{let l=s(s0e.store).__experimentalGetCurrentThemeGlobalStylesVariations();return Array.isArray(l)?l:void 0},[])?.filter(s=>!fT(s,["color"])&&!fT(s,["typography","spacing"])),i=(0,UM.useMemo)(()=>[...[{title:(0,c0e.__)("Default"),settings:{},styles:{}},...n??[]].map(l=>{let c=l?.styles?.blocks?{...l.styles.blocks}:{};r?.blocks&&Object.keys(r.blocks).forEach(m=>{if(r.blocks?.[m]?.css){let h=c[m]||{},g={css:`${c[m]?.css||""} ${r.blocks?.[m]?.css?.trim()||""}`};c[m]={...h,...g}}});let u=r?.css||l.styles?.css?{css:`${l.styles?.css||""} ${r?.css||""}`}:{},d=Object.keys(c).length>0?{blocks:c}:{},f={...l.styles,...u,...d};return{...l,settings:l.settings??{},styles:f}})],[n,r?.blocks,r?.css]);return!n||n.length<1?null:(0,HM.jsx)(l0e.__experimentalGrid,{columns:2,className:"global-styles-ui-style-variations-container",gap:e,children:i.map((s,l)=>(0,HM.jsx)(P_,{variation:s,children:c=>(0,HM.jsx)(aM,{label:s?.title,withHoverView:!0,isFocused:c,variation:s})},l))})}var WM=Met;var B_=a(T(),1);function d0e(){return(0,B_.jsxs)(u0e.__experimentalVStack,{spacing:10,className:"global-styles-ui-variation-container",children:[(0,B_.jsx)(WM,{gap:3}),(0,B_.jsx)(L_,{title:(0,mG.__)("Color Variations"),gap:3}),(0,B_.jsx)(k_,{title:(0,mG.__)("Typography"),gap:3})]})}var Pp=a(T(),1);function Fet(){return(0,Pp.jsxs)(Pp.Fragment,{children:[(0,Pp.jsx)(sr,{title:(0,hG.__)("Browse styles"),description:(0,hG.__)("Choose a variation to change the look of the site.")}),(0,Pp.jsx)(GM.Card,{size:"small",isBorderless:!0,className:"global-styles-ui-screen-style-variations",children:(0,Pp.jsx)(GM.CardBody,{children:(0,Pp.jsx)(d0e,{})})})]})}var f0e=Fet;var RT=a(j(),1),p0e=a(G(),1),m0e=a(be(),1);var rc=a(T(),1),{AdvancedPanel:Det}=Tt(m0e.privateApis);function Let(){let[e]=qe("",void 0,"user",!1),[t,r]=qe("",void 0,"merged",!1);return(0,rc.jsxs)(rc.Fragment,{children:[(0,rc.jsx)(sr,{title:(0,RT.__)("Additional CSS"),description:(0,rc.jsxs)(rc.Fragment,{children:[(0,RT.__)("You can add custom CSS to further customize the appearance and layout of your site."),(0,rc.jsx)("br",{}),(0,rc.jsx)(p0e.ExternalLink,{href:(0,RT.__)("https://developer.wordpress.org/advanced-administration/wordpress/css/"),className:"global-styles-ui-screen-css-help-link",children:(0,RT.__)("Learn more about CSS")})]})}),(0,rc.jsx)("div",{className:"global-styles-ui-screen-css",children:(0,rc.jsx)(Det,{value:e,onChange:r,inheritedValue:t})})]})}var h0e=Let;var kp=a(j(),1),j_=a(G(),1),sy=a(U(),1);var g0e=a(Y(),1),v0e=a(ae(),1),AT=a(U(),1);var Vet={per_page:-1,_fields:"id,name,avatar_urls",context:"view",capabilities:["edit_theme_options"]},Bet={per_page:100,page:1},YM=[];function ny({query:e}={}){let{user:t}=(0,AT.useContext)(on),r=(0,AT.useMemo)(()=>({...Bet,...e}),[e]),{authors:o,currentUser:n,isDirty:i,revisions:s,isLoadingGlobalStylesRevisions:l,revisionsCount:c}=(0,g0e.useSelect)(u=>{let{__experimentalGetDirtyEntityRecords:d,getCurrentUser:f,getUsers:m,getRevisions:h,__experimentalGetCurrentGlobalStylesId:g,getEntityRecord:v,isResolving:b}=u(v0e.store),_=d()||[],y=f(),w=_.length>0,S=g(),C=(S?v("root","globalStyles",S):void 0)?._links?.["version-history"]?.[0]?.count??0,A=S&&h("root","globalStyles",S,r)||YM,P=m(Vet)||YM,R=S?b("getRevisions",["root","globalStyles",S,r]):!1;return{authors:P,currentUser:y,isDirty:w,revisions:A,isLoadingGlobalStylesRevisions:R,revisionsCount:C}},[r]);return(0,AT.useMemo)(()=>{if(!o.length||l)return{revisions:YM,hasUnsavedChanges:i,isLoading:!0,revisionsCount:c};let u=s.map(f=>({...f,author:o.find(m=>m.id===f.author)}));if(s.length){if(u[0].id!=="unsaved"&&r.page===1&&(u[0].isLatest=!0),i&&t&&Object.keys(t).length>0&&n&&r.page===1){let f={id:"unsaved",styles:t?.styles,settings:t?.settings,_links:t?._links,author:{name:n?.name||"",avatar_urls:n?.avatar_urls||{}},modified:new Date};u.unshift(f)}r.per_page&&r.page===Math.ceil(c/r.per_page)&&u.push({id:"parent",styles:{},settings:{}})}return{revisions:u,hasUnsavedChanges:i,isLoading:!1,revisionsCount:c}},[i,s,n,o,t,l,c,r.page,r.per_page])}var xi=a(j(),1),iy=a(G(),1),zd=a(cn(),1),b0e=a(ae(),1),y0e=a(Y(),1);var qM=a(Mo(),1);var ri=a(T(),1),{Badge:jet}=Tt(iy.privateApis),zet=3600*1e3*24;function Het({revision:e,previousRevision:t}){let r=N1(e,t,{maxResults:7});return r.length?(0,ri.jsx)("ul",{"data-testid":"global-styles-revision-changes",className:"global-styles-ui-screen-revisions__changes",children:r.map(o=>(0,ri.jsx)("li",{children:o},o))}):null}function Uet(e,t,r,o){return e==="parent"?(0,xi.__)("Reset the styles to the theme defaults"):e==="unsaved"?(0,xi.sprintf)((0,xi.__)("Unsaved changes by %s"),t):o?(0,xi.sprintf)((0,xi.__)("Changes saved by %1$s on %2$s. This revision matches current editor styles."),t,r):(0,xi.sprintf)((0,xi.__)("Changes saved by %1$s on %2$s"),t,r)}function Wet({userRevisions:e,selectedRevisionId:t,onChange:r,canApplyRevision:o,onApplyRevision:n}){let{currentThemeName:i,currentUser:s}=(0,y0e.useSelect)(u=>{let{getCurrentTheme:d,getCurrentUser:f}=u(b0e.store),m=d();return{currentThemeName:m?.name?.rendered||m?.stylesheet,currentUser:f()}},[]),l=(0,zd.getDate)(null).getTime(),{datetimeAbbreviated:c}=(0,zd.getSettings)().formats;return(0,ri.jsx)(iy.Composite,{orientation:"vertical",className:"global-styles-ui-screen-revisions__revisions-list","aria-label":(0,xi.__)("Global styles revisions list"),role:"listbox",children:e.map((u,d)=>{let{id:f,author:m,modified:h}=u,g=f==="unsaved",v=g?s:m,b=v?.name||(0,xi.__)("User"),_=v?.avatar_urls?.["48"],w=t?t===f:d===0,S=!o&&w,x=f==="parent",C=h instanceof Date?h.toISOString():h,A=(0,zd.getDate)(C??null),P=C&&l-A.getTime()>zet?(0,zd.dateI18n)(c,A):(0,zd.humanTimeDiff)(C??A,void 0),R=Uet(f,b,(0,zd.dateI18n)(c,A),S);return(0,ri.jsxs)(iy.Composite.Item,{className:"global-styles-ui-screen-revisions__revision-item","aria-current":w,role:"option",onKeyDown:N=>{let{keyCode:k}=N;(k===qM.ENTER||k===qM.SPACE)&&r(u)},onClick:N=>{N.preventDefault(),r(u)},"aria-selected":w,"aria-label":R,render:(0,ri.jsx)("div",{}),children:[(0,ri.jsx)("span",{className:"global-styles-ui-screen-revisions__revision-item-wrapper",children:x?(0,ri.jsxs)("span",{className:"global-styles-ui-screen-revisions__description",children:[(0,xi.__)("Default styles"),(0,ri.jsx)("span",{className:"global-styles-ui-screen-revisions__meta",children:i})]}):(0,ri.jsxs)("span",{className:"global-styles-ui-screen-revisions__description",children:[g?(0,ri.jsx)("span",{className:"global-styles-ui-screen-revisions__date",children:(0,xi.__)("(Unsaved)")}):(0,ri.jsx)("time",{className:"global-styles-ui-screen-revisions__date",dateTime:C,children:P}),(0,ri.jsxs)("span",{className:"global-styles-ui-screen-revisions__meta",children:[(0,ri.jsx)("img",{alt:b,src:_}),b]}),w&&(0,ri.jsx)(Het,{revision:u,previousRevision:dr(1),accessibleWhenDisabled:!0,disabled:i||e===1,label:(0,oi.__)("First page"),icon:(0,oi.isRTL)()?Rl:Al,size:"compact"}),(0,ru.jsx)(oc.Button,{variant:s,onClick:()=>r(e-1),accessibleWhenDisabled:!0,disabled:i||e===1,label:(0,oi.__)("Previous page"),icon:(0,oi.isRTL)()?hr:Ar,size:"compact"})]}),(0,ru.jsx)(oc.__experimentalText,{variant:"muted",children:(0,oi.sprintf)((0,oi._x)("%1$d of %2$d","paging"),e,t)}),(0,ru.jsxs)(oc.__experimentalHStack,{expanded:!1,spacing:1,children:[(0,ru.jsx)(oc.Button,{variant:s,onClick:()=>r(e+1),accessibleWhenDisabled:!0,disabled:i||e===t,label:(0,oi.__)("Next page"),icon:(0,oi.isRTL)()?Ar:hr,size:"compact"}),(0,ru.jsx)(oc.Button,{variant:s,onClick:()=>r(t),accessibleWhenDisabled:!0,disabled:i||e===t,label:(0,oi.__)("Last page"),icon:(0,oi.isRTL)()?Al:Rl,size:"compact"})]})]})}var ou=a(T(),1),S0e=10;function Get({onClose:e}={}){let{user:t,onChange:r}=(0,sy.useContext)(on),{params:o,goTo:n}=(0,j_.useNavigator)(),{revisionId:i}=o,[s,l]=(0,sy.useState)(1),{revisions:c,isLoading:u,hasUnsavedChanges:d,revisionsCount:f}=ny({query:{per_page:S0e,page:s}}),m=Math.ceil(f/S0e),[h,g]=(0,sy.useState)(!1),v=(0,sy.useMemo)(()=>i&&c.find(P=>String(P.id)===String(i))||t,[i,c,t]),b=yv(v,t),_=()=>{e&&e()},y=A=>{r(A),g(!1),_()},w=A=>{n(`/revisions/${A.id}`)},S=v?.id??c[0]?.id,x=!!S&&S!=="unsaved"&&!b,C=!!c.length;return(0,ou.jsxs)(ou.Fragment,{children:[(0,ou.jsx)(sr,{title:f?(0,kp.sprintf)((0,kp.__)("Revisions (%d)"),f):(0,kp.__)("Revisions"),description:(0,kp.__)(`Click on previously saved styles to preview them. To restore a selected version to the editor, hit "Apply." When you're ready, use the Save button to save your changes.`),onBack:_}),!C&&(0,ou.jsx)(j_.Spinner,{className:"global-styles-ui-screen-revisions__loading"}),(0,ou.jsx)(w0e,{onChange:w,selectedRevisionId:S,userRevisions:c,canApplyRevision:x,onApplyRevision:()=>d?g(!0):y(v)}),m>1&&(0,ou.jsx)("div",{className:"global-styles-ui-screen-revisions__footer",children:(0,ou.jsx)(_0e,{className:"global-styles-ui-screen-revisions__pagination",currentPage:s,numPages:m,changePage:l,totalItems:f,disabled:u,label:(0,kp.__)("Global Styles pagination")})}),h&&(0,ou.jsx)(j_.__experimentalConfirmDialog,{isOpen:h,confirmButtonText:(0,kp.__)("Apply"),onConfirm:()=>y(v),onCancel:()=>g(!1),size:"medium",children:(0,kp.__)("Are you sure you want to apply this revision? Any unsaved changes will be lost.")})]})}var x0e=Get;var Mn=a(j(),1),Wo=a(G(),1);var k0e=a(U(),1);var C0e=a(G(),1),E0e=a(j(),1),T0e=a(T(),1);function Yet({text:e,confirmButtonText:t,isOpen:r,toggleOpen:o,onConfirm:n}){let i=async()=>{o(),n()},s=()=>{o()};return(0,T0e.jsx)(C0e.__experimentalConfirmDialog,{isOpen:r,cancelButtonText:(0,E0e.__)("Cancel"),confirmButtonText:t,onCancel:s,onConfirm:i,size:"medium",children:e})}var P0e=Yet;var ar=a(T(),1),{Menu:IT}=Tt(Wo.privateApis);function gG({label:e,origin:t,sizes:r,handleAddFontSize:o,handleResetFontSizes:n}){let[i,s]=(0,k0e.useState)(!1),l=()=>s(!i),c=t==="custom"?(0,Mn.__)("Are you sure you want to remove all custom font size presets?"):(0,Mn.__)("Are you sure you want to reset all font size presets to their default values?");return(0,ar.jsxs)(ar.Fragment,{children:[n&&i&&(0,ar.jsx)(P0e,{text:c,confirmButtonText:t==="custom"?(0,Mn.__)("Remove"):(0,Mn.__)("Reset"),isOpen:i,toggleOpen:l,onConfirm:n}),(0,ar.jsxs)(Wo.__experimentalVStack,{spacing:4,children:[(0,ar.jsxs)(Wo.__experimentalHStack,{children:[(0,ar.jsx)(Uo,{level:3,children:e}),(0,ar.jsxs)(Wo.FlexItem,{className:"global-styles-ui__typography-panel__options-container",children:[t==="custom"&&(0,ar.jsx)(Wo.Button,{label:(0,Mn.__)("Add font size"),icon:Ec,size:"small",onClick:o}),!!n&&(0,ar.jsxs)(IT,{children:[(0,ar.jsx)(IT.TriggerButton,{render:(0,ar.jsx)(Wo.Button,{size:"small",icon:bo,label:(0,Mn.__)("Font size presets options")})}),(0,ar.jsx)(IT.Popover,{children:(0,ar.jsx)(IT.Item,{onClick:l,children:(0,ar.jsx)(IT.ItemLabel,{children:t==="custom"?(0,Mn.__)("Remove font size presets"):(0,Mn.__)("Reset font size presets")})})})]})]})]}),!!r.length&&(0,ar.jsx)(Wo.__experimentalItemGroup,{isBordered:!0,isSeparated:!0,children:r.map(u=>(0,ar.jsx)(xo,{path:`/typography/font-sizes/${t}/${u.slug}`,children:(0,ar.jsxs)(Wo.__experimentalHStack,{children:[(0,ar.jsx)(Wo.FlexItem,{className:"global-styles-ui-font-size__item",children:u.name}),(0,ar.jsx)(Wo.FlexItem,{display:"flex",children:(0,ar.jsx)(En,{icon:(0,Mn.isRTL)()?Ar:hr})})]})},u.slug))})]})]})}function qet(){let[e,t]=Le("typography.fontSizes.theme"),[r]=Le("typography.fontSizes.theme","base"),[o,n]=Le("typography.fontSizes.default"),[i]=Le("typography.fontSizes.default","base"),[s=[],l]=Le("typography.fontSizes.custom"),[c]=Le("typography.defaultFontSizes"),u=()=>{let f=nM(s,"custom-"),m={name:(0,Mn.sprintf)((0,Mn.__)("New Font Size %d"),f),size:"16px",slug:`custom-${f}`};l([...s,m])},d=(f,m)=>f.map(h=>h.size).join("")===m.map(h=>h.size).join("");return(0,ar.jsxs)(Wo.__experimentalVStack,{spacing:2,children:[(0,ar.jsx)(sr,{title:(0,Mn.__)("Font size presets"),description:(0,Mn.__)("Create and edit the presets used for font sizes across the site.")}),(0,ar.jsx)(Wo.__experimentalView,{children:(0,ar.jsx)(Wo.__experimentalSpacer,{paddingX:4,children:(0,ar.jsxs)(Wo.__experimentalVStack,{spacing:8,children:[!!e?.length&&(0,ar.jsx)(gG,{label:(0,Mn.__)("Theme"),origin:"theme",sizes:e,handleAddFontSize:u,handleResetFontSizes:d(e,r)?void 0:()=>t(r)}),c&&!!o?.length&&(0,ar.jsx)(gG,{label:(0,Mn.__)("Default"),origin:"default",sizes:o,handleAddFontSize:u,handleResetFontSizes:d(o,i)?void 0:()=>n(i)}),(0,ar.jsx)(gG,{label:(0,Mn.__)("Custom"),origin:"custom",sizes:s,handleAddFontSize:u,handleResetFontSizes:s.length>0?()=>l([]):void 0})]})})})]})}var R0e=qet;var Aa=a(j(),1),Go=a(G(),1);var OT=a(U(),1);var A0e=a(be(),1),I0e=a(j(),1);var O0e=a(T(),1);function Ket({fontSize:e}){let[t]=qe("typography"),r=typeof e?.fluid=="object"&&e?.fluid?.min&&e?.fluid?.max?{minimumFontSize:e.fluid.min,maximumFontSize:e.fluid.max}:{fontSize:e.size},o=(0,A0e.getComputedFluidTypographyValue)(r);return(0,O0e.jsx)("div",{className:"global-styles-ui-typography-preview",style:{fontSize:o,fontFamily:t?.fontFamily??"serif"},children:(0,I0e.__)("Aa")})}var N0e=Ket;var M0e=a(G(),1),z_=a(j(),1),F0e=a(T(),1);function Zet({fontSize:e,isOpen:t,toggleOpen:r,handleRemoveFontSize:o}){let n=async()=>{r(),o(e)},i=()=>{r()};return(0,F0e.jsx)(M0e.__experimentalConfirmDialog,{isOpen:t,cancelButtonText:(0,z_.__)("Cancel"),confirmButtonText:(0,z_.__)("Delete"),onCancel:i,onConfirm:n,size:"medium",children:e&&(0,z_.sprintf)((0,z_.__)('Are you sure you want to delete "%s" font size preset?'),e.name)})}var D0e=Zet;var nu=a(G(),1),H_=a(j(),1),L0e=a(U(),1),Rp=a(T(),1);function Xet({fontSize:e,toggleOpen:t,handleRename:r}){let[o,n]=(0,L0e.useState)(e.name),i=()=>{o&&o.trim()&&r(o),t()};return(0,Rp.jsx)(nu.Modal,{onRequestClose:t,focusOnMount:"firstContentElement",title:(0,H_.__)("Rename"),size:"small",children:(0,Rp.jsx)("form",{onSubmit:s=>{s.preventDefault(),i(),t()},children:(0,Rp.jsxs)(nu.__experimentalVStack,{spacing:"3",children:[(0,Rp.jsx)(nu.__experimentalInputControl,{autoComplete:"off",value:o,onChange:n,label:(0,H_.__)("Name"),placeholder:(0,H_.__)("Font size preset name")}),(0,Rp.jsxs)(nu.__experimentalHStack,{justify:"right",children:[(0,Rp.jsx)(nu.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:t,children:(0,H_.__)("Cancel")}),(0,Rp.jsx)(nu.Button,{__next40pxDefaultSize:!0,variant:"primary",type:"submit",children:(0,H_.__)("Save")})]})]})})})}var V0e=Xet;var Fn=a(G(),1),Ap=a(T(),1),Qet=["px","em","rem","vw","vh"];function KM(e){let{baseControlProps:t}=(0,Fn.useBaseControlProps)(e),{value:r,onChange:o,fallbackValue:n,disabled:i,label:s}=e,l=(0,Fn.__experimentalUseCustomUnits)({availableUnits:Qet}),[c,u="px"]=(0,Fn.__experimentalParseQuantityAndUnitFromRawValue)(r,l),d=!!u&&["em","rem","vw","vh"].includes(u);return(0,Ap.jsx)(Fn.BaseControl,{...t,children:(0,Ap.jsxs)(Fn.Flex,{children:[(0,Ap.jsx)(Fn.FlexItem,{isBlock:!0,children:(0,Ap.jsx)(Fn.__experimentalUnitControl,{label:s,hideLabelFromVision:!0,value:r,onChange:h=>{o?.(h)},units:l,min:0,disabled:i})}),(0,Ap.jsx)(Fn.FlexItem,{isBlock:!0,children:(0,Ap.jsx)(Fn.__experimentalSpacer,{marginX:2,marginBottom:0,children:(0,Ap.jsx)(Fn.RangeControl,{label:s,hideLabelFromVision:!0,value:c,initialPosition:n,withInputField:!1,onChange:h=>{o?.(h!==void 0?h+u:void 0)},min:0,max:d?10:100,step:d?.1:1,disabled:i})})})]})})}var rr=a(T(),1),{Menu:ay}=Tt(Go.privateApis);function Jet(){let[e,t]=(0,OT.useState)(!1),[r,o]=(0,OT.useState)(!1),{params:{origin:n,slug:i},goBack:s}=(0,Go.useNavigator)(),[l,c]=Le("typography.fontSizes"),[u]=Le("typography.fluid"),d=l?.[n]??[],f=d.find(P=>P.slug===i);if((0,OT.useEffect)(()=>{i&&!f&&s()},[i,f,s]),!n||!i||!f)return null;let m=f?.fluid!==void 0?!!f.fluid:!!u,h=typeof f?.fluid=="object",g=P=>{S("name",P)},v=P=>{S("size",P)},b=P=>{S("fluid",P)},_=P=>{P?S("fluid",{min:f.size,max:f.size}):S("fluid",!0)},y=P=>{let R=typeof f.fluid=="object"?f.fluid:{};S("fluid",{...R,min:P})},w=P=>{let R=typeof f.fluid=="object"?f.fluid:{};S("fluid",{...R,max:P})},S=(P,R)=>{let N=d.map(k=>k.slug===i?{...k,[P]:R}:k);c({...l,[n]:N})},x=()=>{let P=d.filter(R=>R.slug!==i);c({...l,[n]:P})},C=()=>{t(!e)},A=()=>{o(!r)};return(0,rr.jsxs)(rr.Fragment,{children:[(0,rr.jsx)(D0e,{fontSize:f,isOpen:e,toggleOpen:C,handleRemoveFontSize:x}),r&&(0,rr.jsx)(V0e,{fontSize:f,toggleOpen:A,handleRename:g}),(0,rr.jsxs)(Go.__experimentalVStack,{spacing:4,children:[(0,rr.jsxs)(Go.__experimentalHStack,{justify:"space-between",alignment:"flex-start",children:[(0,rr.jsx)(sr,{title:f.name,description:(0,Aa.sprintf)((0,Aa.__)("Manage the font size %s."),f.name)}),n==="custom"&&(0,rr.jsx)(Go.FlexItem,{children:(0,rr.jsx)(Go.__experimentalSpacer,{marginTop:3,marginBottom:0,paddingX:4,children:(0,rr.jsxs)(ay,{children:[(0,rr.jsx)(ay.TriggerButton,{render:(0,rr.jsx)(Go.Button,{size:"small",icon:bo,label:(0,Aa.__)("Font size options")})}),(0,rr.jsxs)(ay.Popover,{children:[(0,rr.jsx)(ay.Item,{onClick:A,children:(0,rr.jsx)(ay.ItemLabel,{children:(0,Aa.__)("Rename")})}),(0,rr.jsx)(ay.Item,{onClick:C,children:(0,rr.jsx)(ay.ItemLabel,{children:(0,Aa.__)("Delete")})})]})]})})})]}),(0,rr.jsx)(Go.__experimentalView,{children:(0,rr.jsx)(Go.__experimentalSpacer,{paddingX:4,marginBottom:0,paddingBottom:6,children:(0,rr.jsxs)(Go.__experimentalVStack,{spacing:4,children:[(0,rr.jsx)(Go.FlexItem,{children:(0,rr.jsx)(N0e,{fontSize:f})}),(0,rr.jsx)(KM,{label:(0,Aa.__)("Size"),value:!h&&f.size?String(f.size):"",onChange:v,disabled:h}),(0,rr.jsx)(Go.ToggleControl,{label:(0,Aa.__)("Fluid typography"),help:(0,Aa.__)("Scale the font size dynamically to fit the screen or viewport."),checked:m,onChange:b}),m&&(0,rr.jsx)(Go.ToggleControl,{label:(0,Aa.__)("Custom fluid values"),help:(0,Aa.__)("Set custom min and max values for the fluid font size."),checked:h,onChange:_}),h&&(0,rr.jsxs)(rr.Fragment,{children:[(0,rr.jsx)(KM,{label:(0,Aa.__)("Minimum"),value:typeof f?.fluid=="object"?f.fluid?.min:void 0,onChange:y}),(0,rr.jsx)(KM,{label:(0,Aa.__)("Maximum"),value:typeof f?.fluid=="object"?f.fluid?.max:void 0,onChange:w})]})]})})})]})]})}var B0e=Jet;var $e=a(T(),1);function $et({parentMenu:e,blockStyles:t,blockName:r,selectedViewport:o,showResponsiveStateControls:n,showBlockStateControls:i}){return(0,$e.jsx)($e.Fragment,{children:t.map((s,l)=>(0,$e.jsx)(U_.Navigator.Screen,{path:e+"/variations/"+s.name,children:(0,$e.jsx)($W,{name:r,variation:s.name,selectedViewport:o,showResponsiveStateControls:n,showBlockStateControls:i})},l))})}function ett({name:e,parentMenu:t="",selectedViewport:r,showResponsiveStateControls:o,showBlockStateControls:n}){let i=(0,j0e.useSelect)(s=>{if(!e)return[];let{getBlockStyles:l}=s(ZM.store);return l(e)},[e]);return i?.length?(0,$e.jsx)($et,{parentMenu:t,blockStyles:i,blockName:e||"",selectedViewport:r,showResponsiveStateControls:o,showBlockStateControls:n}):null}function bG({value:e,baseValue:t,onChange:r,path:o,onPathChange:n,fontLibraryEnabled:i=!1,serverCSS:s,serverSettings:l,selectedViewport:c,showResponsiveStateControls:u=!0,showBlockStateControls:d=!0}){let f=(0,ZM.getBlockTypes)(),m=(0,lg.useMemo)(()=>Di(t,e),[t,e]),[h,g]=wv(m,[],{styleOptions:{variationStyles:!0}}),v=(0,lg.useMemo)(()=>[...s??[],...h??[]],[s,h]),b=(0,lg.useMemo)(()=>({...l,__experimentalFeatures:g,styles:v}),[g,l,v]);return(0,$e.jsx)(uT,{value:e,baseValue:t,onChange:r,fontLibraryEnabled:i,children:(0,$e.jsx)(z0e.BlockEditorProvider,{settings:b,children:(0,$e.jsxs)(U_.Navigator,{className:"global-styles-ui-sidebar__navigator-provider",initialPath:o||"/",children:[(o||n)&&(0,$e.jsx)(ttt,{path:o,onPathChange:n}),(0,$e.jsx)(wn,{path:"/",children:(0,$e.jsx)(Ave,{})}),(0,$e.jsx)(wn,{path:"/colors",children:(0,$e.jsx)(Tye,{})}),(0,$e.jsx)(wn,{path:"/typography",children:(0,$e.jsx)(dye,{})}),(0,$e.jsx)(wn,{path:"/typography/font-sizes",children:(0,$e.jsx)(R0e,{})}),(0,$e.jsx)(wn,{path:"/typography/font-sizes/:origin/:slug",children:(0,$e.jsx)(B0e,{})}),(0,$e.jsx)(wn,{path:"/layout",children:(0,$e.jsx)(i0e,{})}),(0,$e.jsx)(wn,{path:"/colors/palette",children:(0,$e.jsx)(Fye,{})}),(0,$e.jsx)(wn,{path:"/variations",children:(0,$e.jsx)(f0e,{})}),(0,$e.jsx)(wn,{path:"/css",children:(0,$e.jsx)(h0e,{})}),(0,$e.jsx)(wn,{path:"/revisions/:revisionId?",children:(0,$e.jsx)(x0e,{})}),(0,$e.jsx)(wn,{path:"/shadows",children:(0,$e.jsx)(Jye,{})}),(0,$e.jsx)(wn,{path:"/shadows/edit/:category/:slug",children:(0,$e.jsx)($ye,{})}),(0,$e.jsx)(wn,{path:"/background",children:(0,$e.jsx)(zye,{})}),(0,$e.jsx)(wn,{path:"/typography/text",children:(0,$e.jsx)(F_,{element:"text"})}),(0,$e.jsx)(wn,{path:"/typography/link",children:(0,$e.jsx)(F_,{element:"link"})}),(0,$e.jsx)(wn,{path:"/typography/heading",children:(0,$e.jsx)(F_,{element:"heading"})}),(0,$e.jsx)(wn,{path:"/typography/caption",children:(0,$e.jsx)(F_,{element:"caption"})}),(0,$e.jsx)(wn,{path:"/typography/button",children:(0,$e.jsx)(F_,{element:"button"})}),(0,$e.jsx)(wn,{path:"/blocks",children:(0,$e.jsx)(Vve,{})}),f.map(_=>(0,$e.jsxs)(lg.Fragment,{children:[(0,$e.jsx)(wn,{path:"/blocks/"+encodeURIComponent(_.name),children:(0,$e.jsx)($W,{name:_.name,selectedViewport:c,showResponsiveStateControls:u,showBlockStateControls:d})}),(0,$e.jsx)(ett,{name:_.name,parentMenu:"/blocks/"+encodeURIComponent(_.name),selectedViewport:c,showResponsiveStateControls:u,showBlockStateControls:d})]},_.name))]})})})}function wn({path:e,children:t}){return(0,$e.jsx)(U_.Navigator.Screen,{className:"global-styles-ui-sidebar__navigator-screen",path:e,children:t})}function ttt({path:e,onPathChange:t}){let r=(0,U_.useNavigator)(),{path:o}=r.location,n=(0,vG.usePrevious)(e),i=(0,vG.usePrevious)(o);return(0,lg.useEffect)(()=>{e&&e!==o&&(e!==n?r.goTo(e):o!==i&&t&&t(o??"/"))},[t,e,i,n,o,r]),null}var yG=a(T(),1);function W_(e){return function({value:r,baseValue:o,onChange:n,...i}){return(0,yG.jsx)(uT,{value:r,baseValue:o,onChange:n,children:(0,yG.jsx)(e,{...i})})}}var rtt=W_(WM);var ott=W_(L_);var ntt=W_(k_);var itt=a(T(),1);var X0e=a(Ef(),1);var H0e=a(Y(),1),U0e=a(U(),1),W0e=a(be(),1),G0e=a(Ce(),1);function Y0e({path:e,onPathChange:t}){let{selectedBlockName:r,selectedBlockClientId:o}=(0,H0e.useSelect)(s=>{let{getSelectedBlockClientId:l,getBlockName:c}=s(W0e.store),u=l();return{selectedBlockName:c(u),selectedBlockClientId:u}},[]),n=!0,i=(0,G0e.usePrevious)(o);return(0,U0e.useEffect)(()=>{if(o===i||!o||!n||!e||e!=="/blocks"&&!e.startsWith("/blocks/"))return;let s="/blocks/"+encodeURIComponent(r);s!==e&&t?.(s)},[o,i,r,n,e,t]),null}var ly=a(U(),1);var G_=a(ae(),1),Y_=a(Y(),1),q0e=a(be(),1);var{cleanEmptyObject:wG}=q(q0e.privateApis);function stt(){let{globalStylesId:e,isReady:t,settings:r,styles:o,_links:n}=(0,Y_.useSelect)(u=>{let{getEntityRecord:d,getEditedEntityRecord:f,hasFinishedResolution:m,canUser:h}=u(G_.store),g=u(G_.store).__experimentalGetCurrentGlobalStylesId(),v,b=g?h("update",{kind:"root",name:"globalStyles",id:g}):null;g&&typeof b=="boolean"&&(b?v=f("root","globalStyles",g):v=d("root","globalStyles",g,{context:"view"}));let _=!1;return m("__experimentalGetCurrentGlobalStylesId")&&(g?_=b?m("getEditedEntityRecord",["root","globalStyles",g]):m("getEntityRecord",["root","globalStyles",g,{context:"view"}]):_=!0),{globalStylesId:g,isReady:_,settings:v?.settings,styles:v?.styles,_links:v?._links}},[]),{getEditedEntityRecord:i}=(0,Y_.useSelect)(G_.store),{editEntityRecord:s}=(0,Y_.useDispatch)(G_.store),l=(0,ly.useMemo)(()=>({settings:r??{},styles:o??{},_links:n??{}}),[r,o,n]),c=(0,ly.useCallback)((u,d={})=>{let f=i("root","globalStyles",e),m={styles:f?.styles??{},settings:f?.settings??{},_links:f?._links??{}},h=typeof u=="function"?u(m):u;s("root","globalStyles",e,{styles:wG(h.styles)||{},settings:wG(h.settings)||{},_links:wG(h._links)||{}},d)},[e,s,i]);return[t,l,c]}function att(){let e=(0,Y_.useSelect)(t=>t(G_.store).__experimentalGetCurrentThemeBaseGlobalStyles(),[]);return[!!e,e]}function Hr(){let[e,t,r]=stt(),[o,n]=att();return{merged:(0,ly.useMemo)(()=>!e||!o?{}:Di(n||{},t),[e,o,n,t]),base:n||{},user:t,setUser:r,isReady:e&&o}}function cg(e,t){let{merged:r}=Hr();return(0,ly.useMemo)(()=>bm(r,e,t),[r,e,t])}function _G(e,t){let{merged:r}=Hr();return(0,ly.useMemo)(()=>vv(r,e,t),[r,e,t])}var cy=a(T(),1);function ltt(e){let t=e?.styles,r=e?.__unstableResolvedAssets,o=e?.colors,n=e?.gradients,i=e?.__experimentalDiscussionSettings,s=e?.fontLibraryEnabled??!0,l=e?.responsiveEditingEnabled??!0,c=e?.blockStatesEditingEnabled??!0,u=(0,Z0e.useSelect)(m=>{let{canUser:h}=m(K0e.store);return h("create",{kind:"postType",name:"attachment"})?X0e.uploadMedia:void 0},[]),d=(0,SG.useMemo)(()=>t?t.filter(m=>!m.isGlobalStyles):[],[t]),f=(0,SG.useMemo)(()=>({__unstableResolvedAssets:r,settings:{color:{palette:{theme:o??[]},gradients:{theme:n??[]},duotone:{theme:[]}}},__experimentalDiscussionSettings:i,mediaUpload:u}),[r,o,n,i,u]);return{serverCSS:d,serverSettings:f,fontLibraryEnabled:s,responsiveEditingEnabled:l,blockStatesEditingEnabled:c}}function XM({path:e,onPathChange:t,settings:r,selectedViewport:o,showResponsiveStateControls:n=!0}){let{user:i,base:s,setUser:l,isReady:c}=Hr(),{serverCSS:u,serverSettings:d,fontLibraryEnabled:f,responsiveEditingEnabled:m,blockStatesEditingEnabled:h}=ltt(r);return c?(0,cy.jsxs)(cy.Fragment,{children:[(0,cy.jsx)(bG,{value:i,baseValue:s||{},onChange:l,path:e,onPathChange:t,fontLibraryEnabled:f,serverCSS:u,serverSettings:d,selectedViewport:o,showResponsiveStateControls:n&&m,showBlockStateControls:h}),(0,cy.jsx)(Y0e,{path:e,onPathChange:t})]}):null}var{store:ctt}=q(S_),Q0e={};function utt(e){let{RECEIVE_INTERMEDIATE_RESULTS:t}=q(Ia.privateApis),{getEntityRecords:r}=e(Ia.store);return r("postType","wp_block",{per_page:-1,[t]:!0})}function dtt(e){return e(Ia.store).getUserPatternCategories()}var ftt=["__experimentalBlockBindingsSupportedAttributes","__experimentalBlockDirectory","__experimentalDiscussionSettings","__experimentalFeatures","__experimentalGlobalStylesBaseStyles","allImageSizes","alignWide","blockStatesEditingEnabled","blockInspectorTabs","maxUploadFileSize","allowedMimeTypes","bodyPlaceholder","canEditCSS","canLockBlocks","canUpdateBlockBindings","capabilities","clearBlockSelection","codeEditingEnabled","colors","disableContentOnlyForTemplateParts","disableContentOnlyForUnsyncedPatterns","disableCustomColors","disableCustomFontSizes","disableCustomSpacingSizes","disableCustomGradients","disableLayoutStyles","enableCustomLineHeight","enableCustomSpacing","enableCustomUnits","enableOpenverseMediaCategory","fontSizes","gradients","generateAnchors","onNavigateToEntityRecord","imageDefaultSize","imageDimensions","imageEditing","imageSizes","isPreviewMode","isRTL","locale","maxWidth","postContentAttributes","postsPerPage","readOnly","styles","titlePlaceholder","supportsLayout","widgetTypesToHideFromLegacyWidgetBlock","__unstableHasCustomAppender","__unstableResolvedAssets","__unstableIsBlockBasedTheme"],{globalStylesDataKey:ptt,globalStylesLinksDataKey:mtt,selectBlockPatternsKey:htt,reusableBlocksSelectKey:gtt,userPatternCategoriesSelectKey:vtt,sectionRootClientIdKey:btt,mediaEditKey:ytt,getMediaSelectKey:wtt,isIsolatedEditorKey:_tt,deviceTypeKey:Stt,isNavigationOverlayContextKey:xtt,isNavigationPostEditorKey:Ctt,mediaUploadOnSuccessKey:Ett,mediaSideloadFromUrlKey:Ttt,openMediaEditorModalKey:Ptt}=q(QM.privateApis);function ktt(e,t,r,o){let n=(0,ewe.useViewportMatch)("medium"),{allImageSizes:i,bigImageSizeThreshold:s,imageStripMeta:l,imageMaxBitDepth:c,allowRightClickOverrides:u,blockTypes:d,focusMode:f,hasFixedToolbar:m,isDistractionFree:h,keepCaretInsideBlock:g,hasUploadPermissions:v,hiddenBlockTypes:b,canUseUnfilteredHTML:_,userCanCreatePages:y,pageOnFront:w,pageForPosts:S,restBlockPatternCategories:x,sectionRootClientId:C,deviceType:A,isNavigationOverlayContext:P,isRevisionsMode:R,viewablePostTypeLabel:N,currentPostId:k}=(0,uy.useSelect)(pe=>{let{canUser:$,getRawEntityRecord:oe,getEntityRecord:fe,getBlockPatternCategories:ve,getPostType:Oe}=pe(Ia.store),{get:ee}=pe($0e.store),{getBlockTypes:ne}=pe(twe.store),{getCurrentPostId:ce,getCurrentPostType:re}=pe(I),{getDeviceType:ie,isRevisionsMode:Ee}=q(pe(I)),{getBlocksByName:ke,getBlockAttributes:Me}=pe(QM.store),Ne=$("read",{kind:"root",name:"site"})?fe("root","site"):void 0,Fe=fe("root","__unstableBase"),X=re(),ge=X?Oe(X):void 0;function Ue(){return o==="template-locked"?ke("core/post-content")?.[0]??"":ke("core/group").find(Ye=>Me(Ye)?.tagName==="main")??""}return{allImageSizes:Fe?.image_sizes,bigImageSizeThreshold:Fe?.image_size_threshold,imageStripMeta:Fe?.image_strip_meta,imageMaxBitDepth:Fe?.image_max_bit_depth,allowRightClickOverrides:ee("core","allowRightClickOverrides"),blockTypes:ne(),canUseUnfilteredHTML:oe("postType",t,r)?._links?.hasOwnProperty("wp:action-unfiltered-html"),focusMode:ee("core","focusMode"),hasFixedToolbar:ee("core","fixedToolbar")||!n,hiddenBlockTypes:ee("core","hiddenBlockTypes"),isDistractionFree:ee("core","distractionFree"),keepCaretInsideBlock:ee("core","keepCaretInsideBlock"),hasUploadPermissions:$("create",{kind:"postType",name:"attachment"})??!0,userCanCreatePages:$("create",{kind:"postType",name:"page"}),pageOnFront:Ne?.page_on_front,pageForPosts:Ne?.page_for_posts,viewablePostTypeLabel:ge?.viewable?ge?.labels?.singular_name:void 0,currentPostId:ce(),restBlockPatternCategories:ve(),sectionRootClientId:Ue(),deviceType:ie(),isNavigationOverlayContext:t==="wp_template_part"&&r?fe("postType","wp_template_part",r)?.area==="navigation-overlay":!1,isRevisionsMode:Ee()}},[t,r,n,o]),{merged:E}=Hr(),M=E.styles??Q0e,V=E._links??Q0e,F=e.__experimentalAdditionalBlockPatterns??e.__experimentalBlockPatterns,D=e.__experimentalAdditionalBlockPatternCategories??e.__experimentalBlockPatternCategories,z=(0,ug.useMemo)(()=>[...F||[]].filter(({postTypes:pe})=>!pe||Array.isArray(pe)&&pe.includes(t)),[F,t]),L=(0,ug.useMemo)(()=>[...D||[],...x||[]].filter((pe,$,oe)=>$===oe.findIndex(fe=>pe.name===fe.name)),[D,x]),{undo:O,setIsInserterOpened:B}=(0,uy.useDispatch)(I),{editMediaEntity:W}=q((0,uy.useDispatch)(Ia.store)),{saveEntityRecord:K}=(0,uy.useDispatch)(Ia.store),{openMediaEditorModal:Z}=(0,uy.useDispatch)(ctt),Q=(0,ug.useCallback)(pe=>y?K("postType","page",pe):Promise.reject({message:(0,J0e.__)("You do not have permission to create Pages.")}),[K,y]),ue=(0,ug.useMemo)(()=>b&&b.length>0?(e.allowedBlockTypes===!0?d.map(({name:$})=>$):e.allowedBlockTypes||[]).filter($=>!b.includes($)):e.allowedBlockTypes,[e.allowedBlockTypes,b,d]),te=e.focusMode===!1,de=(0,ug.useMemo)(()=>Lge(k,N),[k,N]);return(0,ug.useMemo)(()=>{let pe={...Object.fromEntries(Object.entries(e).filter(([$])=>ftt.includes($))),[ptt]:M,[mtt]:V,allImageSizes:i,bigImageSizeThreshold:s,imageStripMeta:l,imageMaxBitDepth:c,allowedBlockTypes:ue,allowRightClickOverrides:u,focusMode:f&&!te,hasFixedToolbar:m,isDistractionFree:h,keepCaretInsideBlock:g,[wtt]:($,oe)=>$(Ia.store).getEntityRecord("postType","attachment",oe),[ytt]:v?W:void 0,[Ptt]:({id:$,onUpdate:oe,onClose:fe})=>Z({id:$,onUpdate:oe,onClose:fe}),mediaUpload:v?D2:void 0,[Ett]:v?Gge:void 0,mediaSideload:v?qge:void 0,[Ttt]:v?Qge:void 0,mediaFinalize:v?eve:void 0,mediaDelete:v?rve:void 0,__experimentalBlockPatterns:z,[htt]:$=>{let{hasFinishedResolution:oe,getBlockPatternsForPostType:fe}=q($(Ia.store)),ve=fe(t);return oe("getBlockPatterns")?ve:void 0},[gtt]:utt,[vtt]:dtt,__experimentalBlockPatternCategories:L,__experimentalFetchLinkSuggestions:($,oe)=>(0,Ia.__experimentalFetchLinkSuggestions)($,oe,e),inserterMediaCategories:de,__experimentalFetchRichUrlData:Ia.__experimentalFetchUrlData,__experimentalCanUserUseUnfilteredHTML:_,__experimentalUndo:O,outlineMode:!h&&t==="wp_template",__experimentalCreatePageEntity:Q,__experimentalUserCanCreatePages:y,pageOnFront:w,pageForPosts:S,__experimentalPreferPatternsOnRoot:t==="wp_template",templateLock:t==="wp_navigation"?"insert":e.templateLock,template:t==="wp_navigation"?[["core/navigation",{},[]]]:e.template,__experimentalSetIsInserterOpened:B,[btt]:C,editorTool:o==="post-only"&&t!=="wp_template"?"edit":void 0,[_tt]:["wp_template_part","wp_block","wp_navigation"].includes(t),[Ctt]:t==="wp_navigation",disableContentOnlyForTemplateParts:o==="template-locked"||e.disableContentOnlyForTemplateParts,...A?{[Stt]:A}:{},[xtt]:P};return R&&(pe.isPreviewMode=!0),pe},[R,ue,u,f,te,m,h,g,e,v,z,L,de,_,O,Q,y,w,S,t,B,C,M,V,o,W,Z,A,i,s,l,c,P])}var rwe=ktt;var NT=a(Y(),1),q_=a(be(),1),$M=a(U(),1);var owe=a(U(),1),nwe=a(zn(),1),Rtt=["core/post-title","core/post-featured-image","core/post-content"];function JM(){return(0,owe.useMemo)(()=>[...(0,nwe.applyFilters)("editor.postContentBlockTypes",Rtt)],[])}function iwe(){let e=JM(),{contentOnlyIds:t,templateParts:r}=(0,NT.useSelect)(i=>{let{getPostBlocksByName:s}=q(i(I)),{getBlocksByName:l}=i(q_.store);return{contentOnlyIds:s(e),templateParts:l("core/template-part")}},[e]),o=(0,NT.useSelect)(i=>{let{getBlockOrder:s}=i(q_.store);return r.flatMap(l=>s(l))},[r]),n=(0,NT.useRegistry)();return(0,$M.useEffect)(()=>{let{setBlockEditingMode:i,unsetBlockEditingMode:s,__unstableMarkNextChangeAsNotPersistent:l}=n.dispatch(q_.store);return l(),i("","disabled"),()=>{l(),s("")}},[n]),(0,$M.useEffect)(()=>{let{setBlockEditingMode:i,unsetBlockEditingMode:s,__unstableMarkNextChangeAsNotPersistent:l}=n.dispatch(q_.store);return n.batch(()=>{for(let c of r)l(),i(c,"contentOnly")}),()=>{n.batch(()=>{for(let c of r)l(),s(c)})}},[r,n]),(0,$M.useEffect)(()=>{let{setBlockEditingMode:i,unsetBlockEditingMode:s,__unstableMarkNextChangeAsNotPersistent:l}=n.dispatch(q_.store),c=new Set(t);return n.batch(()=>{for(let u of t)l(),i(u,"contentOnly");for(let u of o)c.has(u)||(l(),i(u,"disabled"))}),()=>{n.batch(()=>{for(let u of t)l(),s(u);for(let u of o)c.has(u)||(l(),s(u))})}},[t,o,n]),null}var swe=a(U(),1),e3=a(Y(),1),xG=a(be(),1);function awe(){let e=(0,e3.useRegistry)(),t=(0,e3.useSelect)(r=>r(xG.store).getBlockOrder()?.[0],[]);(0,swe.useEffect)(()=>{if(!t)return;let{setBlockEditingMode:r,unsetBlockEditingMode:o,__unstableMarkNextChangeAsNotPersistent:n}=e.dispatch(xG.store);return n(),r(t,"contentOnly"),()=>{n(),o(t)}},[e,t])}var cwe=a(U(),1),K_=a(zn(),1),lwe=["wp_block","wp_template","wp_template_part"];function uwe(e,t){(0,cwe.useEffect)(()=>((0,K_.addFilter)("blockEditor.__unstableCanInsertBlockType","removeTemplatePartsFromInserter",(r,o)=>!lwe.includes(e)&&o.name==="core/template-part"&&t==="post-only"?!1:r),(0,K_.addFilter)("blockEditor.__unstableCanInsertBlockType","removePostContentFromInserter",(r,o,n,{getBlockParentsByBlockName:i})=>!lwe.includes(e)&&o.name==="core/post-content"?i(n,"core/query").length>0:r),()=>{(0,K_.removeFilter)("blockEditor.__unstableCanInsertBlockType","removeTemplatePartsFromInserter"),(0,K_.removeFilter)("blockEditor.__unstableCanInsertBlockType","removePostContentFromInserter")}),[e,t])}var Twe=a(Y(),1),a3=a(U(),1),l3=a(Pt(),1);var nc=class{diff(t,r,o={}){let n;typeof o=="function"?(n=o,o={}):"callback"in o&&(n=o.callback);let i=this.castInput(t,o),s=this.castInput(r,o),l=this.removeEmpty(this.tokenize(i,o)),c=this.removeEmpty(this.tokenize(s,o));return this.diffWithOptionsObj(l,c,o,n)}diffWithOptionsObj(t,r,o,n){var i;let s=y=>{if(y=this.postProcess(y,o),n){setTimeout(function(){n(y)},0);return}else return y},l=r.length,c=t.length,u=1,d=l+c;o.maxEditLength!=null&&(d=Math.min(d,o.maxEditLength));let f=(i=o.timeout)!==null&&i!==void 0?i:1/0,m=Date.now()+f,h=[{oldPos:-1,lastComponent:void 0}],g=this.extractCommon(h[0],r,t,0,o);if(h[0].oldPos+1>=c&&g+1>=l)return s(this.buildValues(h[0].lastComponent,r,t));let v=-1/0,b=1/0,_=()=>{for(let y=Math.max(v,-u);y<=Math.min(b,u);y+=2){let w,S=h[y-1],x=h[y+1];S&&(h[y-1]=void 0);let C=!1;if(x){let P=x.oldPos-y;C=x&&0<=P&&P=c&&g+1>=l)return s(this.buildValues(w.lastComponent,r,t))||!0;h[y]=w,w.oldPos+1>=c&&(b=Math.min(b,y-1)),g+1>=l&&(v=Math.max(v,y+1))}u++};if(n)(function y(){setTimeout(function(){if(u>d||Date.now()>m)return n(void 0);_()||y()},0)})();else for(;u<=d&&Date.now()<=m;){let y=_();if(y)return y}}addToPath(t,r,o,n,i){let s=t.lastComponent;return s&&!i.oneChangePerToken&&s.added===r&&s.removed===o?{oldPos:t.oldPos+n,lastComponent:{count:s.count+1,added:r,removed:o,previousComponent:s.previousComponent}}:{oldPos:t.oldPos+n,lastComponent:{count:1,added:r,removed:o,previousComponent:s}}}extractCommon(t,r,o,n,i){let s=r.length,l=o.length,c=t.oldPos,u=c-n,d=0;for(;u+1m.length?g:m}),d.value=this.join(f)}else d.value=this.join(r.slice(c,c+d.count));c+=d.count,d.added||(u+=d.count)}}return n}};var CG=class extends nc{},Att=new CG;function EG(e,t,r){return Att.diff(e,t,r)}function TG(e,t){let r;for(r=0;rt.length&&(r=e.length-t.length);let o=t.length;e.length0&&t[s]!=t[i];)i=n[i];t[s]==t[i]&&i++}i=0;for(let s=r;s0&&e[s]!=t[i];)i=n[i];e[s]==t[i]&&i++}return i}function RG(e,t){let r=[];for(let o of Array.from(t.segment(e))){let n=o.segment;r.length&&/\s/.test(r[r.length-1])&&/\s/.test(n)?r[r.length-1]+=n:r.push(n)}return r}function o3(e,t){if(t)return X_(e,t)[1];let r;for(r=e.length-1;r>=0&&e[r].match(/\s/);r--);return e.substring(r+1)}function dy(e,t){if(t)return X_(e,t)[0];let r=e.match(/^\s*/);return r?r[0]:""}function X_(e,t){if(!t)return[dy(e),o3(e)];if(t.resolvedOptions().granularity!="word")throw new Error('The segmenter passed must have a granularity of "word"');let r=RG(e,t),o=r[0],n=r[r.length-1],i=/\s/.test(o)?o:"",s=/\s/.test(n)?n:"";return[i,s]}var n3="a-zA-Z0-9_\\u{AD}\\u{C0}-\\u{D6}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}",Ott=new RegExp(`[${n3}]+|\\s+|[^${n3}]`,"ug"),AG=class extends nc{equals(t,r,o){return o.ignoreCase&&(t=t.toLowerCase(),r=r.toLowerCase()),t.trim()===r.trim()}tokenize(t,r={}){let o;if(r.intlSegmenter){let s=r.intlSegmenter;if(s.resolvedOptions().granularity!="word")throw new Error('The segmenter passed must have a granularity of "word"');o=RG(t,s)}else o=t.match(Ott)||[];let n=[],i=null;return o.forEach(s=>{/\s/.test(s)?i==null?n.push(s):n.push(n.pop()+s):i!=null&&/\s/.test(i)?n[n.length-1]==i?n.push(n.pop()+s):n.push(i+s):n.push(s),i=s}),n}join(t){return t.map((r,o)=>o==0?r:r.replace(/^\s+/,"")).join("")}postProcess(t,r){if(!t||r.oneChangePerToken)return t;let o=null,n=null,i=null;return t.forEach(s=>{s.added?n=s:s.removed?i=s:((n||i)&&dwe(o,i,n,s,r.intlSegmenter),o=s,n=null,i=null)}),(n||i)&&dwe(o,i,n,null,r.intlSegmenter),t}},Ntt=new AG;function dwe(e,t,r,o,n){if(t&&r){let[i,s]=X_(t.value,n),[l,c]=X_(r.value,n);if(e){let u=TG(i,l);e.value=r3(e.value,l,u),t.value=Z_(t.value,u),r.value=Z_(r.value,u)}if(o){let u=PG(s,c);o.value=t3(o.value,c,u),t.value=MT(t.value,u),r.value=MT(r.value,u)}}else if(r){if(e){let i=dy(r.value,n);r.value=r.value.substring(i.length)}if(o){let i=dy(o.value,n);o.value=o.value.substring(i.length)}}else if(e&&o){let i=dy(o.value,n),[s,l]=X_(t.value,n),c=TG(i,s);t.value=Z_(t.value,c);let u=PG(Z_(i,c),l);t.value=MT(t.value,u),o.value=t3(o.value,i,u),e.value=r3(e.value,i,i.slice(0,i.length-u.length))}else if(o){let i=dy(o.value,n),s=o3(t.value,n),l=kG(s,i);t.value=MT(t.value,l)}else if(e){let i=o3(e.value,n),s=dy(t.value,n),l=kG(i,s);t.value=Z_(t.value,l)}}var IG=class extends nc{tokenize(t){let r=new RegExp(`(\\r?\\n)|[${n3}]+|[^\\S\\n\\r]+|[^${n3}]`,"ug");return t.match(r)||[]}},fwe=new IG;function Q_(e,t,r){return fwe.diff(e,t,r)}var OG=class extends nc{constructor(){super(...arguments),this.tokenize=Ftt}equals(t,r,o){return o.ignoreWhitespace?((!o.newlineIsToken||!t.includes(`
`))&&(t=t.trim()),(!o.newlineIsToken||!r.includes(`
`))&&(r=r.trim())):o.ignoreNewlineAtEof&&!o.newlineIsToken&&(t.endsWith(`
`)&&(t=t.slice(0,-1)),r.endsWith(`
`)&&(r=r.slice(0,-1))),super.equals(t,r,o)}},Mtt=new OG;function pwe(e,t,r){return Mtt.diff(e,t,r)}function Ftt(e,t){t.stripTrailingCr&&(e=e.replace(/\r\n/g,`
`));let r=[],o=e.split(/(\n|\r\n)/);o[o.length-1]||o.pop();for(let n=0;nnull})}function ywe(){for(let e of vwe)(0,i3.unregisterFormatType)(e.name)}var{parseRawBlock:Swe}=q(s3.privateApis);function wwe(e){return e.blockName===null&&(!e.innerHTML||!e.innerHTML.trim())}function _we(e){return e==null?"":typeof e=="object"?JSON.stringify(e,null,2):String(e)}function Dtt(e,t){if(!e&&!t)return 1;if(!e||!t)return 0;let r=new Intl.Segmenter(void 0,{granularity:"word"}),o=/[\p{L}\p{N}]/u,n=d=>{let f=[];for(let{segment:m,isWordLike:h}of r.segment(d))(h||o.test(m))&&f.push(m);return f},i=n(e),s=n(t);if(i.length===0&&s.length===0)return 1;let l=new Set(i),c=0;for(let d of s)l.has(d)&&c++;let u=Math.max(i.length,s.length);return u>0?c/u:0}function Ltt(e){let t=[],r=[];if(e.forEach((d,f)=>{let m=d.__revisionDiffStatus?.status;m==="removed"?t.push({block:d,index:f}):m==="added"&&r.push({block:d,index:f})}),t.length===0||r.length===0)return e;let o=new Set,n=new Set,i=new Map,s=.5,l=new Map;for(let d of r){let f=d.block.blockName;l.has(f)||l.set(f,[]),l.get(f).push(d)}let c=new Map;for(let d of t){let f=d.block.blockName;c.has(f)||c.set(f,[]),c.get(f).push(d)}let u=-1;for(let d of t){let f=l.get(d.block.blockName)||[],m=c.get(d.block.blockName)||[],h=f.filter(v=>!i.has(v.index)&&v.index>u);if(h.length===0)continue;let g=null;if(m.length===1&&h.length===1){let v=h[0],b=JSON.stringify(d.block.attrs)===JSON.stringify(v.block.attrs);(!((d.block.innerHTML||"")===(v.block.innerHTML||""))||!b)&&(g=v)}else{let v=0;for(let b of h){let _=Dtt(d.block.innerHTML||"",b.block.innerHTML||""),y=JSON.stringify(d.block.attrs)===JSON.stringify(b.block.attrs);_>v&&_>s&&(_<1||!y)&&(v=_,g=b)}}if(g){u=g.index;let v={...g.block,__revisionDiffStatus:{status:"modified"},__previousRawBlock:d.block},b=Math.min(d.index,g.index),_=Math.max(d.index,g.index),y=!1;for(let w=b+1;w<_;w++){let S=e[w].__revisionDiffStatus?.status;if(S===void 0){y=!0;break}if(S==="added"&&!n.has(w)){y=!0;break}}y?(i.set(g.index,v),o.add(d.index)):(i.set(d.index,v),n.add(g.index))}}return e.map((d,f)=>o.has(f)||n.has(f)?null:i.has(f)?i.get(f):d).filter(Boolean)}function xwe(e,t){e=e.filter(u=>!wwe(u)),t=t.filter(u=>!wwe(u));let r=u=>JSON.stringify({name:u.blockName,attrs:u.attrs,html:(u.innerContent||[]).filter(d=>d!==null&&d.trim()!=="")}),o=e.map(r),n=t.map(r),i=FT(n,o),s=[],l=0,c=0;for(let u of i)if(u.added)for(let d=0;dc.type===s.type&&JSON.stringify(c.attributes)===JSON.stringify(s.attributes)))return!0;return!1}function Btt(e,t,r,o){let n=e[r]||[],i=t[o]||[],s=0,l=0,c=0;for(let d of n){let f=i.find(m=>m.type===d.type);f?JSON.stringify(d.attributes)!==JSON.stringify(f.attributes)&&c++:s++}for(let d of i)n.find(m=>m.type===d.type)||l++;if(s>0&&l===0&&c===0)return{type:"added",description:(0,Oa.sprintf)((0,Oa._n)("%d format added","%d formats added",s),s)};if(l>0&&s===0&&c===0)return{type:"removed",description:(0,Oa.sprintf)((0,Oa._n)("%d format removed","%d formats removed",l),l)};let u=[];return s>0&&u.push((0,Oa.sprintf)((0,Oa._n)("%d format added","%d formats added",s),s)),l>0&&u.push((0,Oa.sprintf)((0,Oa._n)("%d format removed","%d formats removed",l),l)),c>0&&u.push((0,Oa.sprintf)((0,Oa._n)("%d format changed","%d formats changed",c),c)),{type:"changed",description:u.join(", ")||(0,Oa.__)("Formatting changed")}}function jtt(e,t){let r=e.toPlainText(),o=t.toPlainText(),n=Q_(o,r),i=(0,Dn.create)({text:""}),s=0,l=0;for(let c of n)if(c.removed){let u=(0,Dn.slice)(t,l,l+c.value.length),d=(0,Dn.applyFormat)(u,{type:"revision/diff-removed",attributes:{"aria-describedby":ic.removed}},0,c.value.length);i=(0,Dn.concat)(i,d),l+=c.value.length}else if(c.added){let u=(0,Dn.slice)(e,s,s+c.value.length),d=(0,Dn.applyFormat)(u,{type:"revision/diff-added",attributes:{"aria-describedby":ic.added}},0,c.value.length);i=(0,Dn.concat)(i,d),s+=c.value.length}else{let u=e.formats||[],d=t.formats||[],f=c.value.length,m=v=>Vtt(u,d,s+v,l+v),h=0,g=m(0);for(let v=1;v<=f;v++){let b=v0&&(r.changedAttributes=n)}function Cwe(e,t){if(t.__revisionDiffStatus){if(t.__revisionDiffStatus.status==="modified"&&t.__previousRawBlock){let r=Swe(t.__previousRawBlock);r&&ztt(e,r,t.__revisionDiffStatus)}e.__revisionDiffStatus=t.__revisionDiffStatus,e.attributes.__revisionDiffStatus=t.__revisionDiffStatus}if(e.innerBlocks&&t.innerBlocks)for(let r=0;r{let s=Swe(i);return s&&Cwe(s,i),s}).filter(Boolean)}function FG(e,t){if(!t?.length||!e?.length)return e;let r=e.map(c=>c.name),o=t.map(c=>c.name),n=FT(o,r),i=0,s=0,l=[];for(let c of n)if(c.removed)s+=c.count;else if(c.added)for(let u=0;u{let{isRevisionsMode:c,isShowingRevisionDiff:u,getCurrentRevision:d,getPreviousRevision:f}=q(l(I)),{getCurrentPostType:m}=l(I),h=c();return{isInRevisionsMode:h,showDiff:u(),revision:h?d():void 0,previousRevision:h?f():void 0,postType:m()}},[]),i=(0,a3.useRef)([]);return(0,a3.useMemo)(()=>{if(!e)return i.current=[],null;if(!r)return[];let l=r?.content?.raw??"",c;if(t){let d=o?.content?.raw||"";c=Ewe(l,d)}else c=(0,l3.parse)(l);n==="wp_navigation"&&(c=[(0,l3.createBlock)("core/navigation",{templateLock:!1},c)]);let u=FG(c,i.current);return i.current=u,u},[e,r,r?.content?.raw,o?.content?.raw,n,t])}var ni=a(Y(),1),At=a(j(),1);var $_=a(DG(),1),BG=a(Lt(),1),Lwe=a(It(),1),VT=a(be(),1),eS=a(ae(),1);var c3=a(Nt(),1);var DT=a(Y(),1),Rwe=a(Ml(),1),Awe=a(ae(),1);var Iwe=a(T(),1),{RenamePatternModal:Htt}=q(Rwe.privateApis),LG="editor/pattern-rename";function Owe(){let e=(0,DT.useSelect)(n=>n(je).isModalActive(LG)),{record:t,postType:r}=(0,DT.useSelect)(n=>{if(!e)return{};let{getCurrentPostType:i,getCurrentPostId:s}=n(I),{getEditedEntityRecord:l}=n(Awe.store),c=i();return{record:l("postType",c,s()),postType:c}},[e]),{closeModal:o}=(0,DT.useDispatch)(je);return!e||r!==Fu?null:(0,Iwe.jsx)(Htt,{onClose:o,pattern:t})}var LT=a(Y(),1),Nwe=a(Ml(),1),Mwe=a(ae(),1);var Fwe=a(T(),1),{DuplicatePatternModal:Utt}=q(Nwe.privateApis),VG="editor/pattern-duplicate";function Dwe(){let e=(0,LT.useSelect)(n=>n(je).isModalActive(VG)),{record:t,postType:r}=(0,LT.useSelect)(n=>{if(!e)return{};let{getCurrentPostType:i,getCurrentPostId:s}=n(I),{getEditedEntityRecord:l}=n(Mwe.store),c=i();return{record:l("postType",c,s()),postType:c}},[e]),{closeModal:o}=(0,LT.useDispatch)(je);return!e||r!==Fu?null:(0,Fwe.jsx)(Utt,{onClose:o,onSuccess:()=>o(),pattern:t})}function Vwe({disableContentOnlyForPatternsAndTemplateParts:e,stopEditingContentOnlySection:t,updateEditorSettings:r}){return{name:"core/toggle-pattern-editing",label:e?(0,At.__)("Disable editing all patterns"):(0,At.__)("Enable editing all patterns"),icon:m0,category:"command",callback:({close:o})=>{let n=!e;t(),r({disableContentOnlyForUnsyncedPatterns:n,disableContentOnlyForTemplateParts:n}),o()}}}function Wtt(e,t){return!!t?.metadata?.patternName||e==="core/template-part"}var Gtt=()=>function(){let{editorMode:t,isListViewOpen:r,showBlockBreadcrumbs:o,isDistractionFree:n,isFocusMode:i,isPreviewMode:s,isViewable:l,isCodeEditingEnabled:c,isRichEditingEnabled:u,isPublishSidebarEnabled:d,disableContentOnlyForUnsyncedPatterns:f,disableContentOnlyForTemplateParts:m}=(0,ni.useSelect)(F=>{let{get:D}=F(BG.store),{isListViewOpened:z,getCurrentPostType:L,getEditorSettings:O}=F(I),{getSettings:B}=F(VT.store),{getPostType:W}=F(eS.store);return{editorMode:D("core","editorMode")??"visual",isListViewOpen:z(),showBlockBreadcrumbs:D("core","showBlockBreadcrumbs"),isDistractionFree:D("core","distractionFree"),isFocusMode:D("core","focusMode"),isPreviewMode:B().isPreviewMode,isViewable:W(L())?.viewable??!1,isCodeEditingEnabled:O().codeEditingEnabled,isRichEditingEnabled:O().richEditingEnabled,isPublishSidebarEnabled:F(I).isPublishSidebarEnabled(),disableContentOnlyForUnsyncedPatterns:!!O().disableContentOnlyForUnsyncedPatterns,disableContentOnlyForTemplateParts:!!O().disableContentOnlyForTemplateParts}},[]),{getActiveComplementaryArea:h}=(0,ni.useSelect)(je),{toggle:g}=(0,ni.useDispatch)(BG.store),{createInfoNotice:v}=(0,ni.useDispatch)(Lwe.store),{__unstableSaveForPreview:b,setIsListViewOpened:_,switchEditorMode:y,toggleDistractionFree:w,toggleSpotlightMode:S,toggleTopToolbar:x,updateEditorSettings:C}=(0,ni.useDispatch)(I),{stopEditingContentOnlySection:A}=q((0,ni.useDispatch)(VT.store)),{openModal:P,enableComplementaryArea:R,disableComplementaryArea:N}=(0,ni.useDispatch)(je),{getCurrentPostId:k}=(0,ni.useSelect)(I),E=c&&u;if(s)return{commands:[],isLoading:!1};let M=[],V=f&&m;return M.push({name:"core/open-shortcut-help",label:(0,At.__)("Keyboard shortcuts"),icon:p1,category:"view",callback:({close:F})=>{F(),P("editor/keyboard-shortcut-help")}}),M.push({name:"core/toggle-distraction-free",label:n?(0,At.__)("Exit Distraction free"):(0,At.__)("Enter Distraction free"),category:"command",callback:({close:F})=>{w(),F()}}),M.push({name:"core/open-preferences",label:(0,At.__)("Editor preferences"),category:"view",callback:({close:F})=>{F(),P("editor/preferences")}}),M.push({name:"core/toggle-spotlight-mode",label:i?(0,At.__)("Exit Spotlight mode"):(0,At.__)("Enter Spotlight mode"),category:"command",callback:({close:F})=>{S(),F()}}),M.push({name:"core/toggle-list-view",label:r?(0,At.__)("Close List View"):(0,At.__)("Open List View"),icon:m1,category:"command",callback:({close:F})=>{_(!r),F(),v(r?(0,At.__)("List View off."):(0,At.__)("List View on."),{id:"core/editor/toggle-list-view/notice",type:"snackbar"})}}),M.push({name:"core/toggle-top-toolbar",label:(0,At.__)("Top toolbar"),category:"command",callback:({close:F})=>{x(),F()}}),M.push(Vwe({disableContentOnlyForPatternsAndTemplateParts:V,stopEditingContentOnlySection:A,updateEditorSettings:C})),E&&M.push({name:"core/toggle-code-editor",label:t==="visual"?(0,At.__)("Open code editor"):(0,At.__)("Exit code editor"),icon:kV,category:"command",callback:({close:F})=>{y(t==="visual"?"text":"visual"),F()}}),M.push({name:"core/toggle-breadcrumbs",label:o?(0,At.__)("Hide block breadcrumbs"):(0,At.__)("Show block breadcrumbs"),category:"command",callback:({close:F})=>{g("core","showBlockBreadcrumbs"),F(),v(o?(0,At.__)("Breadcrumbs hidden."):(0,At.__)("Breadcrumbs visible."),{id:"core/editor/toggle-breadcrumbs/notice",type:"snackbar"})}}),M.push({name:"core/open-settings-sidebar",label:(0,At.__)("Show or hide the Settings panel"),icon:(0,At.isRTL)()?dv:wf,category:"command",callback:({close:F})=>{let D=h("core");F(),D==="edit-post/document"?N("core"):R("core","edit-post/document")}}),M.push({name:"core/open-block-inspector",label:(0,At.__)("Show or hide the Block settings panel"),icon:lV,category:"command",callback:({close:F})=>{let D=h("core");F(),D==="edit-post/block"?N("core"):R("core","edit-post/block")}}),M.push({name:"core/toggle-publish-sidebar",label:d?(0,At.__)("Disable pre-publish checks"):(0,At.__)("Enable pre-publish checks"),icon:l1,category:"command",callback:({close:F})=>{F(),g("core","isPublishSidebarEnabled"),v(d?(0,At.__)("Pre-publish checks disabled."):(0,At.__)("Pre-publish checks enabled."),{id:"core/editor/publish-sidebar/notice",type:"snackbar"})}}),l&&M.push({name:"core/preview-link",label:(0,At.__)("Preview in a new tab"),icon:gs,category:"view",callback:async({close:F})=>{F();let D=k(),z=await b();window.open(z,`wp-preview-${D}`)}}),{commands:M,isLoading:!1}},Ytt=()=>function({search:t}){let{disableContentOnlyForPatternsAndTemplateParts:r,hasPatternOrTemplatePartSelection:o,isPreviewMode:n}=(0,ni.useSelect)(l=>{let{getBlockAttributes:c,getBlockName:u,getBlockParents:d,getSelectedBlockClientId:f,getSelectedBlockClientIds:m,getSettings:h}=l(VT.store),{getEditorSettings:g}=l(I),v=g(),b=f(),_=m(),y=b&&_.length===1?[b,...d(b,!0)]:[];return{disableContentOnlyForPatternsAndTemplateParts:!!v.disableContentOnlyForUnsyncedPatterns&&!!v.disableContentOnlyForTemplateParts,hasPatternOrTemplatePartSelection:y.some(w=>Wtt(u(w),c(w))),isPreviewMode:h().isPreviewMode}},[]),{updateEditorSettings:i}=(0,ni.useDispatch)(I),{stopEditingContentOnlySection:s}=q((0,ni.useDispatch)(VT.store));return t||!o&&!r||n?{isLoading:!1,commands:[]}:{isLoading:!1,commands:[Vwe({disableContentOnlyForPatternsAndTemplateParts:r,stopEditingContentOnlySection:s,updateEditorSettings:i})]}},qtt=()=>function(){let{postType:t}=(0,ni.useSelect)(n=>{let{getCurrentPostType:i}=n(I);return{postType:i()}},[]),{openModal:r}=(0,ni.useDispatch)(je),o=[];return t===Fu&&(o.push({name:"core/rename-pattern",label:(0,At.__)("Rename pattern"),icon:y1,category:"edit",callback:({close:n})=>{r(LG),n()}}),o.push({name:"core/duplicate-pattern",label:(0,At.__)("Duplicate pattern"),icon:m0,category:"command",callback:({close:n})=>{r(VG),n()}})),{isLoading:!1,commands:o}},Ktt=()=>function(){let{onNavigateToEntityRecord:t,goBack:r,templateId:o,isPreviewMode:n,canEditTemplate:i}=(0,ni.useSelect)(u=>{let{getRenderingMode:d,getEditorSettings:f,getCurrentTemplateId:m}=q(u(I)),h=f(),g=m();return{isTemplateHidden:d()==="post-only",onNavigateToEntityRecord:h.onNavigateToEntityRecord,getEditorSettings:f,goBack:h.onNavigateToPreviousEntityRecord,templateId:g,isPreviewMode:h.isPreviewMode,canEditTemplate:!!g&&u(eS.store).canUser("update",{kind:"postType",name:"wp_template",id:g})}},[]),{editedRecord:s,hasResolved:l}=(0,eS.useEntityRecord)("postType","wp_template",o);if(n)return{isLoading:!1,commands:[]};let c=[];return o&&l&&i&&c.push({name:"core/switch-to-template-focus",label:(0,At.sprintf)((0,At.__)("Edit template: %s"),(0,c3.decodeEntities)(s.title)),icon:Ka,category:"edit",callback:({close:u})=>{t({postId:o,postType:"wp_template"}),u()}}),r&&c.push({name:"core/switch-to-previous-entity",label:(0,At.__)("Go back"),icon:mm,category:"view",callback:({close:u})=>{r(),u()}}),{isLoading:!1,commands:c}},Ztt=()=>function(){let{postType:t,postId:r}=(0,ni.useSelect)(l=>{let{getCurrentPostId:c,getCurrentPostType:u}=l(I);return{postType:u(),postId:c()}},[]),{editedRecord:o,hasResolved:n}=(0,eS.useEntityRecord)("postType",t,r),{revertTemplate:i}=q((0,ni.useDispatch)(I));if(!n||![Mi,Cr].includes(t))return{isLoading:!0,commands:[]};let s=[];if(F2(o)){let l=o.type===Cr?(0,At.sprintf)((0,At.__)("Reset template: %s"),(0,c3.decodeEntities)(o.title)):(0,At.sprintf)((0,At.__)("Reset template part: %s"),(0,c3.decodeEntities)(o.title));s.push({name:"core/reset-template",label:l,icon:(0,At.isRTL)()?S1:_1,category:"command",callback:({close:c})=>{i(o),c()}})}return{isLoading:!n,commands:s}};function Bwe(){(0,$_.useCommandLoader)({name:"core/editor/edit-ui",hook:Gtt()}),(0,$_.useCommandLoader)({name:"core/editor/contextual-commands",hook:qtt(),context:"entity-edit"}),(0,$_.useCommandLoader)({name:"core/editor/pattern-editing-contextual-commands",hook:Ytt(),context:"block-selection-edit"}),(0,$_.useCommandLoader)({name:"core/editor/page-content-focus",hook:Ktt(),context:"entity-edit"}),(0,$_.useCommandLoader)({name:"core/edit-site/manipulate-document",hook:Ztt()})}var d3=a(Y(),1),zwe=a(U(),1),Hwe=a(u3(),1);var tS="upload-in-progress";function Uwe(){let e=(0,d3.useSelect)(i=>i(Hwe.store).isUploading(),[]),{lockPostSaving:t,unlockPostSaving:r,lockPostAutosaving:o,unlockPostAutosaving:n}=(0,d3.useDispatch)(I);(0,zwe.useEffect)(()=>(e?(t(tS),o(tS)):(r(tS),n(tS)),()=>{r(tS),n(tS)}),[e,t,r,o,n])}var Wwe=a(U(),1),Gwe=a(Y(),1),jG=a(u3(),1);function Ywe(){let e=window.__clientSideMediaProcessing,t=(0,Gwe.useRegistry)();(0,Wwe.useEffect)(()=>{if(!e)return;let r=()=>{q(t.dispatch(jG.store)).pauseQueue()},o=()=>{q(t.dispatch(jG.store)).resumeQueue()};return window.addEventListener("offline",r),window.addEventListener("online",o),()=>{window.removeEventListener("offline",r),window.removeEventListener("online",o)}},[e,t])}var fy=a(j(),1),qwe=a(be(),1),Kwe=a(Y(),1),Zwe=a(U(),1);var Xwe=a(T(),1),{BlockRemovalWarningModal:Xtt}=q(qwe.privateApis),Qtt=["core/post-content","core/post-template","core/query"],Jtt=[{postTypes:["wp_template","wp_template_part"],callback(e){if(e.filter(({name:o})=>o==="core/post-content").length)return{description:(0,fy.__)("This block displays the content of posts and pages using this template."),warning:(0,fy.__)("If you delete it, posts or pages using this template will not display any content."),subtext:(0,fy.__)("Visitors will see blank pages."),requireConfirmation:!0};if(e.filter(({name:o})=>Qtt.includes(o)).length)return(0,fy._n)("Deleting this block will stop your post or page content from displaying on this template. It is not recommended.","Some of the deleted blocks will stop your post or page content from displaying on this template. It is not recommended.",e.length)}},{postTypes:["wp_block"],callback(e){if(e.filter(({attributes:r})=>r?.metadata?.bindings&&Object.values(r.metadata.bindings).some(o=>o.source==="core/pattern-overrides")).length)return(0,fy._n)("The deleted block allows instance overrides. Removing it may result in content not displaying where this pattern is used. Are you sure you want to proceed?","Some of the deleted blocks allow instance overrides. Removing them may result in content not displaying where this pattern is used. Are you sure you want to proceed?",e.length)}}];function Qwe(){let e=(0,Kwe.useSelect)(r=>r(I).getCurrentPostType(),[]),t=(0,Zwe.useMemo)(()=>Jtt.filter(r=>r.postTypes.includes(e)),[e]);return t?(0,Xwe.jsx)(Xtt,{rules:t}):null}var dg=a(G(),1),zG=a(j(),1),py=a(U(),1),f3=a(be(),1),Ud=a(Y(),1),HG=a(ae(),1),Jwe=a(Pt(),1),UG=a(Lt(),1);var Hd=a(T(),1);function $tt(){let{blockPatternsWithPostContentBlockType:e,postType:t}=(0,Ud.useSelect)(r=>{let{getPatternsByBlockTypes:o,getBlocksByName:n}=r(f3.store),{getCurrentPostType:i,getRenderingMode:s}=r(I),l=s()==="post-only"?"":n("core/post-content")?.[0];return{blockPatternsWithPostContentBlockType:o("core/post-content",l),postType:i()}},[]);return(0,py.useMemo)(()=>e?.length?e.filter(r=>t==="page"&&!r.postTypes||Array.isArray(r.postTypes)&&r.postTypes.includes(t)):[],[t,e])}function ert({blockPatterns:e,onChoosePattern:t}){let{editEntityRecord:r}=(0,Ud.useDispatch)(HG.store),{postType:o,postId:n}=(0,Ud.useSelect)(i=>{let{getCurrentPostType:s,getCurrentPostId:l}=i(I);return{postType:s(),postId:l()}},[]);return(0,Hd.jsx)(f3.__experimentalBlockPatternsList,{blockPatterns:e,onClickPattern:(i,s)=>{r("postType",o,n,{blocks:s,content:({blocks:l=[]})=>(0,Jwe.__unstableSerializeAndClean)(l)}),t()}})}function trt({onClose:e}){let[t,r]=(0,py.useState)(!0),{set:o}=(0,Ud.useDispatch)(UG.store),n=$tt();if(!(n.length>0))return null;function s(){e(),o("core","enableChoosePatternModal",t)}return(0,Hd.jsxs)(dg.Modal,{className:"editor-start-page-options__modal",title:(0,zG.__)("Choose a pattern"),isFullScreen:!0,onRequestClose:s,children:[(0,Hd.jsx)("div",{className:"editor-start-page-options__modal-content",children:(0,Hd.jsx)(ert,{blockPatterns:n,onChoosePattern:s})}),(0,Hd.jsx)(dg.Flex,{className:"editor-start-page-options__modal__actions",justify:"flex-start",expanded:!1,children:(0,Hd.jsx)(dg.FlexItem,{children:(0,Hd.jsx)(dg.CheckboxControl,{checked:t,label:(0,zG.__)("Always show starter patterns for new pages"),onChange:l=>{r(l)}})})})]})}function $we(){let[e,t]=(0,py.useState)(!1),{isEditedPostEmpty:r}=(0,Ud.useSelect)(I),{getEntityRecordNonTransientEdits:o}=(0,Ud.useSelect)(HG.store),{isModalActive:n}=(0,Ud.useSelect)(je),{enabled:i,postType:s,postId:l}=(0,Ud.useSelect)(c=>{let{getCurrentPostId:u,getCurrentPostType:d}=c(I),f=c(UG.store).get("core","enableChoosePatternModal"),m=d();return{postType:m,postId:u(),enabled:f&&kl!==m&&Cr!==m&&Mi!==m}},[]);return(0,py.useEffect)(()=>{let u=!(Object.keys(o("postType",s,l)??{}).length>0)&&r(),d=n("editor/preferences");!i||!u||d||t(!0)},[i,s,l,o,r,n]),e?(0,Hd.jsx)(trt,{onClose:()=>t(!1)}):null}var l_e=a(G(),1),Wd=a(j(),1),g3=a(xa(),1),BT=a(Y(),1);var sc=a(j(),1),e_e=[{keyCombination:{modifier:"primary",character:"b"},description:(0,sc.__)("Make the selected text bold.")},{keyCombination:{modifier:"primary",character:"i"},description:(0,sc.__)("Make the selected text italic.")},{keyCombination:{modifier:"primary",character:"k"},description:(0,sc.__)("Convert the selected text into a link.")},{keyCombination:{modifier:"primaryShift",character:"k"},description:(0,sc.__)("Remove a link.")},{keyCombination:{character:"[["},description:(0,sc.__)("Insert a link to a post or page.")},{keyCombination:{modifier:"primary",character:"u"},description:(0,sc.__)("Underline the selected text.")},{keyCombination:{modifier:"access",character:"d"},description:(0,sc.__)("Strikethrough the selected text.")},{keyCombination:{modifier:"access",character:"x"},description:(0,sc.__)("Make the selected text inline code.")},{keyCombination:{modifier:"access",character:"0"},aliases:[{modifier:"access",character:"7"}],description:(0,sc.__)("Convert the current heading to a paragraph.")},{keyCombination:{modifier:"access",character:"1-6"},description:(0,sc.__)("Convert the current paragraph or heading to a heading of level 1 to 6.")},{keyCombination:{modifier:"primaryShift",character:"SPACE"},description:(0,sc.__)("Add non breaking space.")}];var r_e=a(U(),1),p3=a(Mo(),1),ac=a(T(),1);function t_e({keyCombination:e,forceAriaLabel:t}){let r=e.modifier?p3.displayShortcutList[e.modifier](e.character):e.character,o=e.modifier?p3.shortcutAriaLabel[e.modifier](e.character):e.character;return(0,ac.jsx)("kbd",{className:"editor-keyboard-shortcut-help-modal__shortcut-key-combination","aria-label":t||o,children:(Array.isArray(r)?r:[r]).map((n,i)=>n==="+"?(0,ac.jsx)(r_e.Fragment,{children:n},i):(0,ac.jsx)("kbd",{className:"editor-keyboard-shortcut-help-modal__shortcut-key",children:n},i))})}function rrt({description:e,keyCombination:t,aliases:r=[],ariaLabel:o}){return(0,ac.jsxs)(ac.Fragment,{children:[(0,ac.jsx)("div",{className:"editor-keyboard-shortcut-help-modal__shortcut-description",children:e}),(0,ac.jsxs)("div",{className:"editor-keyboard-shortcut-help-modal__shortcut-term",children:[(0,ac.jsx)(t_e,{keyCombination:t,forceAriaLabel:o}),r.map((n,i)=>(0,ac.jsx)(t_e,{keyCombination:n,forceAriaLabel:o},i))]})]})}var m3=rrt;var o_e=a(Y(),1),n_e=a(xa(),1);var i_e=a(T(),1);function ort({name:e}){let{keyCombination:t,description:r,aliases:o}=(0,o_e.useSelect)(n=>{let{getShortcutKeyCombination:i,getShortcutDescription:s,getShortcutAliases:l}=n(n_e.store);return{keyCombination:i(e),aliases:l(e),description:s(e)}},[e]);return t?(0,i_e.jsx)(m3,{keyCombination:t,description:r,aliases:o}):null}var s_e=ort;var Ci=a(T(),1),a_e="editor/keyboard-shortcut-help",nrt=({shortcuts:e})=>(0,Ci.jsx)("ul",{className:"editor-keyboard-shortcut-help-modal__shortcut-list",role:"list",children:e.map((t,r)=>(0,Ci.jsx)("li",{className:"editor-keyboard-shortcut-help-modal__shortcut",children:typeof t=="string"?(0,Ci.jsx)(s_e,{name:t}):(0,Ci.jsx)(m3,{...t})},r))}),WG=({title:e,shortcuts:t,className:r})=>(0,Ci.jsxs)("section",{className:J("editor-keyboard-shortcut-help-modal__section",r),children:[!!e&&(0,Ci.jsx)("h2",{className:"editor-keyboard-shortcut-help-modal__section-title",children:e}),(0,Ci.jsx)(nrt,{shortcuts:t})]}),h3=({title:e,categoryName:t,additionalShortcuts:r=[]})=>{let o=(0,BT.useSelect)(n=>n(g3.store).getCategoryShortcuts(t),[t]);return(0,Ci.jsx)(WG,{title:e,shortcuts:o.concat(r)})};function irt(){let e=(0,BT.useSelect)(n=>n(je).isModalActive(a_e),[]),{openModal:t,closeModal:r}=(0,BT.useDispatch)(je),o=()=>{e?r():t(a_e)};return(0,g3.useShortcut)("core/editor/keyboard-shortcuts",o),e?(0,Ci.jsxs)(l_e.Modal,{className:"editor-keyboard-shortcut-help-modal",title:(0,Wd.__)("Keyboard shortcuts"),closeButtonLabel:(0,Wd.__)("Close"),onRequestClose:o,children:[(0,Ci.jsx)(WG,{className:"editor-keyboard-shortcut-help-modal__main-shortcuts",shortcuts:["core/editor/keyboard-shortcuts"]}),(0,Ci.jsx)(h3,{title:(0,Wd.__)("Global shortcuts"),categoryName:"global"}),(0,Ci.jsx)(h3,{title:(0,Wd.__)("Selection shortcuts"),categoryName:"selection"}),(0,Ci.jsx)(h3,{title:(0,Wd.__)("Block shortcuts"),categoryName:"block",additionalShortcuts:[{keyCombination:{character:"/"},description:(0,Wd.__)("Change the block type after adding a new paragraph."),ariaLabel:(0,Wd.__)("Forward-slash")}]}),(0,Ci.jsx)(WG,{title:(0,Wd.__)("Text formatting"),shortcuts:e_e}),(0,Ci.jsx)(h3,{title:(0,Wd.__)("List View shortcuts"),categoryName:"list-view"})]}):null}var c_e=irt;var fg=a(G(),1),jT=a(j(),1),rS=a(U(),1),u_e=a(be(),1),zT=a(Y(),1),GG=a(Pt(),1),my=a(ae(),1);var Gd=a(T(),1);function srt(e,t=!1){return(0,zT.useSelect)(r=>{let{getEntityRecord:o,getDefaultTemplateId:n}=r(my.store),i=n({slug:e,is_custom:t,ignore_empty:!0});return i?o("postType",Cr,i)?.content?.raw:void 0},[e,t])}function art(e){let{slug:t,patterns:r}=(0,zT.useSelect)(i=>{let{getCurrentPostType:s,getCurrentPostId:l}=i(I),{getEntityRecord:c,getBlockPatterns:u}=i(my.store),d=l(),f=s();return{slug:c("postType",f,d).slug,patterns:u()}},[]),o=(0,zT.useSelect)(i=>i(my.store).getCurrentTheme().stylesheet);function n(i){return i.innerBlocks.find(s=>s.name==="core/template-part")&&(i.innerBlocks=i.innerBlocks.map(s=>(s.name==="core/template-part"&&s.attributes.theme===void 0&&(s.attributes.theme=o),s))),i.name==="core/template-part"&&i.attributes.theme===void 0&&(i.attributes.theme=o),i}return(0,rS.useMemo)(()=>[{name:"fallback",blocks:(0,GG.parse)(e),title:(0,jT.__)("Fallback content")},...r.filter(i=>Array.isArray(i.templateTypes)&&i.templateTypes.some(s=>t.startsWith(s))).map(i=>({...i,blocks:(0,GG.parse)(i.content).map(s=>n(s))}))],[e,t,r])}function lrt({fallbackContent:e,onChoosePattern:t,postType:r}){let[,,o]=(0,my.useEntityBlockEditor)("postType",r),n=art(e);return(0,Gd.jsx)(u_e.__experimentalBlockPatternsList,{blockPatterns:n,onClickPattern:(i,s)=>{o(s,{selection:void 0}),t()}})}function crt({slug:e,isCustom:t,onClose:r,postType:o}){let n=srt(e,t);return n?(0,Gd.jsxs)(fg.Modal,{className:"editor-start-template-options__modal",title:(0,jT.__)("Choose a pattern"),closeLabel:(0,jT.__)("Cancel"),focusOnMount:"firstElement",onRequestClose:r,isFullScreen:!0,children:[(0,Gd.jsx)("div",{className:"editor-start-template-options__modal-content",children:(0,Gd.jsx)(lrt,{fallbackContent:n,slug:e,isCustom:t,postType:o,onChoosePattern:()=>{r()}})}),(0,Gd.jsx)(fg.Flex,{className:"editor-start-template-options__modal__actions",justify:"flex-end",expanded:!1,children:(0,Gd.jsx)(fg.FlexItem,{children:(0,Gd.jsx)(fg.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:r,children:(0,jT.__)("Skip")})})})]}):null}function d_e(){let[e,t]=(0,rS.useState)(!1),{shouldOpenModal:r,slug:o,isCustom:n,postType:i,postId:s}=(0,zT.useSelect)(l=>{let{getCurrentPostType:c,getCurrentPostId:u}=l(I),d=c(),f=u(),{getEditedEntityRecord:m,getEntityRecordNonTransientEdits:h}=l(my.store),g=m("postType",d,f);return{shouldOpenModal:!(Object.keys(h("postType",d,f)??{}).length>0)&&g.content===""&&Cr===d,slug:g.slug,isCustom:g.is_custom,postType:d,postId:f}},[]);return(0,rS.useEffect)(()=>{t(!1)},[i,s]),!r||e?null:(0,Gd.jsx)(crt,{slug:o,isCustom:n,postType:i,onClose:()=>t(!0)})}var pg=a(xa(),1),mg=a(Y(),1);var v3=a(be(),1);var{usesNativeUndo:f_e}=q(v3.privateApis);function oS(){let e=(0,mg.useSelect)(b=>{let{richEditingEnabled:_,codeEditingEnabled:y}=b(I).getEditorSettings();return!_||!y},[]),{getBlockSelectionStart:t}=(0,mg.useSelect)(v3.store),{getActiveComplementaryArea:r}=(0,mg.useSelect)(je),{enableComplementaryArea:o,disableComplementaryArea:n}=(0,mg.useDispatch)(je),{redo:i,undo:s,savePost:l,setIsListViewOpened:c,switchEditorMode:u,toggleDistractionFree:d}=(0,mg.useDispatch)(I),{isEditedPostDirty:f,isPostSavingLocked:m,isListViewOpened:h,getEditorMode:g,isSavingNonPostEntityChanges:v}=(0,mg.useSelect)(I);return(0,pg.useShortcut)("core/editor/toggle-mode",()=>{u(g()==="visual"?"text":"visual")},{isDisabled:e}),(0,pg.useShortcut)("core/editor/toggle-distraction-free",()=>{d()}),(0,pg.useShortcut)("core/editor/undo",b=>{f_e(b)||(s(),b.preventDefault())}),(0,pg.useShortcut)("core/editor/redo",b=>{f_e(b)||(i(),b.preventDefault())}),(0,pg.useShortcut)("core/editor/save",b=>{b.preventDefault(),!(m()||v())&&f()&&l()}),(0,pg.useShortcut)("core/editor/toggle-list-view",b=>{h()||(b.preventDefault(),c(!0))}),(0,pg.useShortcut)("core/editor/toggle-sidebar",b=>{if(b.preventDefault(),["edit-post/document","edit-post/block"].includes(r("core")))n("core");else{let y=t()?"edit-post/block":"edit-post/document";o("core",y)}}),null}var x_e=a(Y(),1),w3=a(be(),1);var HT=a(Y(),1),b3=a(be(),1),p_e=a(ae(),1),y3=a(G(),1),Yd=a(j(),1),m_e=a(Nt(),1),h_e=a(U(),1),hy=a(T(),1);function g_e({clientId:e,onClose:t}){let[r,o]=(0,h_e.useState)(!1),{getBlocks:n}=(0,HT.useSelect)(b3.store),{replaceBlocks:i}=(0,HT.useDispatch)(b3.store),{canRemove:s,templatePartTitle:l}=(0,HT.useSelect)(d=>{let{canRemoveBlock:f,getBlock:m}=d(b3.store),{getEntityRecord:h,getCurrentTheme:g}=d(p_e.store),v=m(e),{slug:b,theme:_}=v?.attributes??{},y=_||g()?.stylesheet,w=y&&b?`${y}//${b}`:null,S=w?h("postType","wp_template_part",w):null;return{canRemove:f(e),templatePartTitle:S?.title?.rendered?(0,m_e.decodeEntities)(S.title.rendered):null}},[e]);if(!s)return null;let c=l?(0,Yd.sprintf)((0,Yd.__)("Detach %s?"),l):(0,Yd.__)("Detach template part?"),u=l?(0,Yd.sprintf)((0,Yd.__)("The blocks will be separated from the original template part and will be fully editable. Future changes to the %s template part will not apply here."),l):(0,Yd.__)("The blocks will be separated from the original template part and will be fully editable. Future changes to the template part will not apply here.");return(0,hy.jsxs)(hy.Fragment,{children:[(0,hy.jsx)(y3.MenuItem,{onClick:()=>o(!0),children:(0,Yd.__)("Detach")}),(0,hy.jsx)(y3.__experimentalConfirmDialog,{isOpen:r,onConfirm:()=>{i(e,n(e)),t()},onCancel:()=>o(!1),confirmButtonText:(0,Yd.__)("Detach"),size:"medium",title:c,__experimentalHideHeader:!1,children:u})]})}var UT=a(Y(),1),YG=a(be(),1),v_e=a(G(),1),b_e=a(Pt(),1),qG=a(j(),1),y_e=a(U(),1),w_e=a(It(),1);var __e=a(ae(),1);var gy=a(T(),1);function S_e({clientIds:e,blocks:t}){let[r,o]=(0,y_e.useState)(!1),{replaceBlocks:n}=(0,UT.useDispatch)(YG.store),{createSuccessNotice:i}=(0,UT.useDispatch)(w_e.store),{isBlockBasedTheme:s,canCreate:l}=(0,UT.useSelect)(u=>({isBlockBasedTheme:u(__e.store).getCurrentTheme()?.is_block_theme,canCreate:u(YG.store).canInsertBlockType("core/template-part")}),[]);if(!s||!l)return null;let c=async u=>{n(e,(0,b_e.createBlock)("core/template-part",{slug:u.slug,theme:u.theme})),i((0,qG.__)("Template part created."),{type:"snackbar"})};return(0,gy.jsxs)(gy.Fragment,{children:[(0,gy.jsx)(v_e.MenuItem,{icon:hv,onClick:()=>{o(!0)},"aria-expanded":r,"aria-haspopup":"dialog",children:(0,qG.__)("Create template part")}),r&&(0,gy.jsx)(Tw,{closeModal:()=>{o(!1)},blocks:t,onCreate:c})]})}var WT=a(T(),1);function C_e(){return(0,WT.jsx)(w3.BlockSettingsMenuControls,{children:({selectedClientIds:e,onClose:t})=>(0,WT.jsx)(urt,{clientIds:e,onClose:t})})}function urt({clientIds:e,onClose:t}){let{blocks:r}=(0,x_e.useSelect)(o=>{let{getBlocksByClientId:n}=o(w3.store);return{blocks:n(e)}},[e]);return r.length===1&&r[0]?.name==="core/template-part"?(0,WT.jsx)(g_e,{clientId:e[0],onClose:t}):(0,WT.jsx)(S_e,{clientIds:e,blocks:r})}var T_e=a(be(),1),P_e=a(Y(),1),k_e=a(U(),1);var E_e=a(U(),1),_3=a(Y(),1);function drt({postType:e}){let{registerPostTypeSchema:t}=q((0,_3.useDispatch)(I));(0,E_e.useEffect)(()=>{t(e)},[t,e]);let{fields:r}=(0,_3.useSelect)(o=>{let{getEntityFields:n}=q(o(I));return{fields:n("postType",e)}},[e]);return r}var nS=drt;var KG=a(T(),1),{MediaEditorModal:frt,store:prt}=q(S_);function mrt(e){if(e==null)return NaN;let[t,r,...o]=String(e).split("/").map(Number);return t<=0||r<=0||Number.isNaN(t)||Number.isNaN(r)||o.length?NaN:r?t/r:t}function hrt({name:e,ratio:t}={}){let r=mrt(t);return!e||!Number.isFinite(r)||r<=0?null:{label:e,value:r}}function R_e(){return(0,P_e.useSelect)(t=>t(prt).isOpen(),[])?(0,KG.jsx)(grt,{}):null}function grt(){let e=nS({postType:"attachment"}),[t,r,o]=(0,T_e.useSettings)("dimensions.aspectRatios.default","dimensions.aspectRatios.theme","dimensions.defaultAspectRatios"),n=(0,k_e.useMemo)(()=>{if(!(Array.isArray(t)||Array.isArray(r)||typeof o=="boolean"))return;let l=[...o&&Array.isArray(t)?t:[],...Array.isArray(r)?r:[]].map(hrt).filter(Boolean);if(l.length||o===!1)return l},[t,r,o]);return(0,KG.jsx)(frt,{fields:e,aspectRatioPresets:n})}var Yo=a(T(),1),{ExperimentalBlockEditorProvider:vrt}=q(iS.privateApis),{PatternsMenuItems:brt}=q(I_e.privateApis),GT=()=>{},yrt=["wp_block","wp_navigation","wp_template_part"];function wrt(e,t,r){let o=Pwe(),n=r==="template-locked"?"template":"post",[i,s,l]=(0,Ip.useEntityBlockEditor)("postType",e.type,{id:e.id}),[c,u,d]=(0,Ip.useEntityBlockEditor)("postType",t?.type,{id:t?.id}),f=(0,gl.useMemo)(()=>{if(e.type==="wp_navigation")return[(0,O_e.createBlock)("core/navigation",{ref:e.id,templateLock:!1})]},[e.type,e.id]),m=(0,gl.useMemo)(()=>f||(n==="template"?c:i),[f,n,c,i]);return o!==null?[o,GT,GT]:!!t&&r==="template-locked"||e.type==="wp_navigation"?[m,GT,GT]:[m,n==="post"?s:u,n==="post"?l:d]}var XG=Rae(({post:e,settings:t,recovery:r,initialEdits:o,children:n,BlockEditorProviderComponent:i=vrt,__unstableTemplate:s})=>{let l=!!s,{editorSettings:c,selection:u,isReady:d,mode:f,defaultMode:m,postTypeEntities:h,isInRevisionsMode:g,currentRevisionId:v}=(0,hg.useSelect)(W=>{let{getEditorSettings:K,getRenderingMode:Z,__unstableIsEditorReady:Q,getDefaultRenderingMode:ue,isRevisionsMode:te,getCurrentRevisionId:de}=q(W(I)),{getEntitiesConfig:pe,getEntityRecordEdits:$}=W(Ip.store),oe=Z(),fe=ue(e.type),ve=fe==="template-locked"?l:fe!==void 0,Oe=fe!==void 0,ee=$("postType",e.type,e.id);return{editorSettings:K(),isReady:Q(),mode:Oe?oe:void 0,defaultMode:ve?fe:void 0,selection:ee?.selection,postTypeEntities:e.type==="wp_template"?pe("postType"):null,isInRevisionsMode:te(),currentRevisionId:de()}},[e.type,e.id,l]),b=l&&f!=="post-only",_=b?s:e,y=(0,gl.useMemo)(()=>{let W={};if(e.type==="wp_template"){if(e.slug==="page")W.postType="page";else if(e.slug==="single")W.postType="post";else if(e.slug.split("-")[0]==="single"){let K=h?.map(Q=>Q.name)||[],Z=e.slug.match(`^single-(${K.join("|")})(?:-.+)?$`);Z&&(W.postType=Z[1])}}else(!yrt.includes(_.type)||b)&&(W.postId=e.id,W.postType=e.type);return{...W,templateSlug:_.type==="wp_template"?_.slug:void 0}},[b,e.id,e.type,e.slug,_.type,_.slug,h]),{id:w,type:S}=_,x=rwe(c,S,w,f),[C,A,P]=wrt(e,s,f),{updatePostLock:R,setupEditor:N,updateEditorSettings:k,setCurrentTemplateId:E,setEditedPost:M,setRenderingMode:V,setCurrentRevisionId:F}=q((0,hg.useDispatch)(I)),{editEntityRecord:D}=(0,hg.useDispatch)(Ip.store),z=(0,hg.useRegistry)(),L=(0,gl.useCallback)(W=>{D("postType",e.type,e.id,{selection:W},{undoIgnore:!0})},[D,e.type,e.id]),{createWarningNotice:O,removeNotice:B}=(0,hg.useDispatch)(A_e.store);return(0,gl.useLayoutEffect)(()=>{if(!r&&(R(t.postLock),z.select(I).__unstableIsEditorReady()||N(e,o,t.template),t.autosave)){let W=Number((0,N_e.getQueryArg)(t.autosave.editLink,"revision"));O((0,ZG.__)("There is an autosave of this post that is more recent than the version below."),{id:"autosave-exists",actions:[{label:(0,ZG.__)("View the autosave"),...W?{onClick:()=>{let{disableVisualRevisions:K}=z.select(I).getEditorSettings();if(K){window.location.href=t.autosave.editLink;return}F(W)}}:{url:t.autosave.editLink}}]})}},[]),(0,gl.useEffect)(()=>(M(e.type,e.id),typeof window<"u"&&window.__experimentalTemplateActivate&&B("template-activate-notice"),()=>M(null,null)),[e.type,e.id,M,B]),(0,gl.useLayoutEffect)(()=>{k(t)},[t,k]),(0,gl.useEffect)(()=>{E(s?.id)},[s?.id,E]),(0,gl.useEffect)(()=>{m&&V(m)},[m,V]),uwe(e.type,f),Bwe(),Uwe(),Ywe(),!d||!f?null:(0,Yo.jsx)(Ip.EntityProvider,{kind:"root",type:"site",children:(0,Yo.jsx)(Ip.EntityProvider,{kind:"postType",type:e.type,id:e.id,revisionId:v??void 0,children:(0,Yo.jsx)(iS.BlockContextProvider,{value:y,children:(0,Yo.jsxs)(i,{value:C,onChange:P,onInput:A,selection:g?void 0:u,onChangeSelection:g?GT:L,settings:x,useSubRegistry:!1,children:[n,!t.isPreviewMode&&(0,Yo.jsxs)(Yo.Fragment,{children:[(0,Yo.jsx)(brt,{}),(0,Yo.jsx)(C_e,{}),f==="template-locked"&&(0,Yo.jsx)(iwe,{}),S==="wp_navigation"&&(0,Yo.jsx)(awe,{}),(0,Yo.jsx)(oS,{}),(0,Yo.jsx)(c_e,{}),(0,Yo.jsx)(Qwe,{}),(0,Yo.jsx)($we,{}),(0,Yo.jsx)(d_e,{}),(0,Yo.jsx)(Owe,{}),(0,Yo.jsx)(Dwe,{}),(0,Yo.jsx)(R_e,{})]})]})})})})});function QG(e){return(0,Yo.jsx)(XG,{...e,BlockEditorProviderComponent:iS.BlockEditorProvider,children:e.children})}var M_e=QG;var gg=a(T(),1);function _rt({template:e,post:t}){let[r="white"]=cg("color.background"),[o]=(0,YT.useEntityBlockEditor)("postType",t.type,{id:t.id}),[n]=(0,YT.useEntityBlockEditor)("postType",e?.type,{id:e?.id}),i=e&&n?n:o,s=!i?.length;return(0,gg.jsxs)("div",{className:"editor-fields-content-preview",style:{backgroundColor:r},children:[s&&(0,gg.jsx)("span",{className:"editor-fields-content-preview__empty",children:(0,F_e.__)("Empty content")}),!s&&(0,gg.jsx)(JG.BlockPreview.Async,{children:(0,gg.jsx)(JG.BlockPreview,{blocks:i})})]})}function L_e({item:e}){let{settings:t,template:r}=(0,D_e.useSelect)(o=>{let{canUser:n,getPostType:i,getTemplateId:s,getEntityRecord:l}=q(o(YT.store)),c=n("read",{kind:"postType",name:"wp_template"}),u=o(I).getEditorSettings(),d=u.supportsTemplateMode,f=i(e.type)?.viewable??!1,m=d&&f&&c?s(e.type,e.id):null;return{settings:u,template:m?l("postType","wp_template",m):void 0}},[e.type,e.id]);return(0,gg.jsx)(QG,{post:e,settings:t,__unstableTemplate:r,children:(0,gg.jsx)(_rt,{template:r,post:e})})}var Srt={type:"media",id:"content-preview",label:(0,V_e.__)("Content preview"),render:L_e,enableSorting:!1},B_e=Srt;function xrt(e){let t=e?.editor;return Array.isArray(t)?!!t[0]?.notes:!1}function Crt(e,t,r){return{type:"REGISTER_ENTITY_ACTION",kind:e,name:t,config:r}}function Ert(e,t,r){return{type:"UNREGISTER_ENTITY_ACTION",kind:e,name:t,actionId:r}}function Trt(e,t,r){return{type:"REGISTER_ENTITY_FIELD",kind:e,name:t,config:r}}function Prt(e,t,r){return{type:"UNREGISTER_ENTITY_FIELD",kind:e,name:t,fieldId:r}}function krt(e,t){return{type:"SET_IS_READY",kind:e,name:t}}var Rrt=[FH,NH,VH,zH,BH,jH,OH,U2,RH,MH,LH],Art=e=>async({registry:t})=>{if(q(t.select(I)).isEntityReady("postType",e))return;q(t.dispatch(I)).setIsReady("postType",e);let o=await t.resolveSelect(S3.store).getPostType(e),n=await t.resolveSelect(S3.store).canUser("create",{kind:"postType",name:e}),i=await t.resolveSelect(S3.store).getCurrentTheme(),{disablePostFormats:s}=t.select(I).getEditorSettings(),l=!["wp_block","wp_template_part"].includes(o.slug)&&n&&cH;o.slug!=="wp_template"&&(l=void 0),o.slug==="wp_template"&&!window?.__experimentalTemplateActivate&&(l=void 0);let c=[o.viewable?nH:void 0,o.supports?.revisions?bH:void 0,l,o.slug==="wp_template_part"&&n&&i?.is_block_theme?kH:void 0,n&&o.slug==="wp_block"?pH:void 0,o.supports?.title?dH:void 0,o.supports?.["page-attributes"]?sH:void 0,o.slug==="wp_block"?vH:void 0,_H,fH,TH,xH,wH].filter(Boolean),u;if(e===kl)u=Rrt;else{let d=o.slug,f=pm.includes(d),m=d==="wp_block";if(u=[o.supports?.thumbnail&&i?.theme_supports?.["post-thumbnails"]&&yz,!f&&o.supports?.author&&eE,d==="wp_template"&&jz,d==="wp_template_part"&&zz,!f&&Az,!f&&Fz,!f&&Dz,Lz,!f&&q8,!f&&o.supports?.excerpt&&Gz,m&&o.supports?.excerpt&&Rj,o.supports?.["page-attributes"]&&kz,o.supports?.comments&&Iz,o.supports?.trackbacks&&Nz,(o.supports?.comments||o.supports?.trackbacks)&&Mz,!f&&Cz,o.supports?.["post-formats"]&&!s&&Zz,(!f||m)&&o.supports?.editor&&Xz,!f&&Rz,d==="post"&&Jz,d==="wp_template"&&Kz,d==="wp_template"&&qz,d==="wp_template"&&oH,d==="wp_template"&&eH,d==="wp_template"&&tH,o.supports?.editor&&o.viewable&&B_e,xrt(o.supports)&&Hz,m&&Aj].filter(Boolean),o.supports?.title){let h;e==="page"?h=J8:e==="wp_template"?h=q1:["wp_block","wp_template_part"].includes(e)?h=RC:h=U2,u.push(h)}}t.batch(()=>{c.forEach(d=>{q(t.dispatch(I)).registerEntityAction("postType",e,d)}),u.forEach(d=>{q(t.dispatch(I)).registerEntityField("postType",e,d)})}),(0,j_e.doAction)("core.registerPostTypeSchema",e)};function Irt(e){return{type:"SET_CURRENT_TEMPLATE_ID",id:e}}var Ort=e=>async({select:t,dispatch:r,registry:o})=>{let n=await o.dispatch(sn.store).saveEntityRecord("postType","wp_template",e);return o.dispatch(sn.store).editEntityRecord("postType",t.getCurrentPostType(),t.getCurrentPostId(),{template:n.slug}),o.dispatch(ii.store).createSuccessNotice((0,zt.__)("Custom template created. You're in template mode now."),{type:"snackbar",actions:[{label:(0,zt.__)("Go back"),onClick:()=>r.setRenderingMode(t.getEditorSettings().defaultRenderingMode)}]}),n},Nrt=e=>({registry:t})=>{let o=(t.select(vy.store).get("core","hiddenBlockTypes")??[]).filter(n=>!(Array.isArray(e)?e:[e]).includes(n));t.dispatch(vy.store).set("core","hiddenBlockTypes",o)},Mrt=e=>({registry:t})=>{let r=t.select(vy.store).get("core","hiddenBlockTypes")??[],o=new Set([...r,...Array.isArray(e)?e:[e]]);t.dispatch(vy.store).set("core","hiddenBlockTypes",[...o])},Frt=({onSave:e,dirtyEntityRecords:t=[],entitiesToSkip:r=[],close:o,successNoticeContent:n}={})=>({registry:i})=>{let s=[{kind:"postType",name:"wp_navigation"}],l="site-editor-save-success",c=i.select(sn.store).getEntityRecord("root","__unstableBase")?.home;i.dispatch(ii.store).removeNotice(l);let u=t.filter(({kind:h,name:g,key:v,property:b})=>!r.some(_=>_.kind===h&&_.name===g&&_.key===v&&_.property===b));o?.(u);let d=[],f=[];return u.forEach(({kind:h,name:g,key:v,property:b})=>{h==="root"&&g==="site"?d.push(b):(s.some(_=>_.kind===h&&_.name===g)&&i.dispatch(sn.store).editEntityRecord(h,g,v,{status:"publish"}),f.push(i.dispatch(sn.store).saveEditedEntityRecord(h,g,v,{throwOnError:!0}).catch(m)))}),d.length&&f.push(i.dispatch(sn.store).__experimentalSaveSpecifiedEntityEdits("root","site",void 0,d,{throwOnError:!0}).catch(m)),i.dispatch(x3.store).__unstableMarkLastChangeAsPersistent(),Promise.all(f).then(async h=>(e&&await e(),h)).then(h=>{let g=h.filter(v=>v instanceof Error);if(g.length){let v=g.find(b=>b.message)?.message;i.dispatch(ii.store).createErrorNotice((0,qT.decodeEntities)(v||(0,zt.__)("Saving failed.")),{type:"snackbar",id:l})}else i.dispatch(ii.store).createSuccessNotice(n||(0,zt.__)("Site updated."),{type:"snackbar",id:l,actions:[{label:(0,zt.__)("View site"),url:c,openInNewTab:!0}]})}).catch(h=>i.dispatch(ii.store).createErrorNotice((0,qT.decodeEntities)(h?.message||(0,zt.__)("Saving failed.")),{type:"snackbar",id:l}));function m(h){if(h instanceof Error)return h;let g;if(h){if(typeof h.message=="string")g=h.message;else if(typeof h=="string")g=h;else if(Object.hasOwn(h,"toString")&&typeof h.toString=="function"){let v=h.toString();typeof v=="string"&&(g=v)}}return new Error(g,{cause:h})}},Drt=(e,{allowUndo:t=!0}={})=>async({registry:r})=>{let o="edit-site-template-reverted";if(r.dispatch(ii.store).removeNotice(o),!F2(e)){r.dispatch(ii.store).createErrorNotice((0,zt.__)("This template is not revertable."),{type:"snackbar"});return}try{let n=r.select(sn.store).getEntityConfig("postType",e.type);if(!n){r.dispatch(ii.store).createErrorNotice((0,zt.__)("The editor has encountered an unexpected error. Please reload."),{type:"snackbar"});return}let i=(0,eY.addQueryArgs)(`${n.baseURL}/${e.id}`,{context:"edit",source:e.origin}),s=await(0,tY.default)({path:i});if(!s){r.dispatch(ii.store).createErrorNotice((0,zt.__)("The editor has encountered an unexpected error. Please reload."),{type:"snackbar"});return}let l=({blocks:d=[]})=>(0,C3.__unstableSerializeAndClean)(d),c=r.select(sn.store).getEditedEntityRecord("postType",e.type,e.id);r.dispatch(sn.store).editEntityRecord("postType",e.type,e.id,{content:l,blocks:c.blocks,source:"custom"},{undoIgnore:!0});let u=(0,C3.parse)(s?.content?.raw);if(r.dispatch(sn.store).editEntityRecord("postType",e.type,s.id,{content:l,blocks:u,source:"theme"}),t){let d=()=>{r.dispatch(sn.store).editEntityRecord("postType",e.type,c.id,{content:l,blocks:c.blocks,source:"custom"})};r.dispatch(ii.store).createSuccessNotice((0,zt.__)("Template reset."),{type:"snackbar",id:o,actions:[{label:(0,zt.__)("Undo"),onClick:d}]})}}catch(n){let i=n.message&&n.code!=="unknown_error"?n.message:(0,zt.__)("Template revert failed. Please reload.");r.dispatch(ii.store).createErrorNotice(i,{type:"snackbar"})}},Lrt=e=>async({registry:t})=>{let r=e.every(n=>n?.has_theme_file),o=await Promise.allSettled(e.map(n=>t.dispatch(sn.store).deleteEntityRecord("postType",n.type,n.id,{force:!0},{throwOnError:!0})));if(o.every(({status:n})=>n==="fulfilled")){let n;if(e.length===1){let i;typeof e[0].title=="string"?i=e[0].title:typeof e[0].title?.rendered=="string"?i=e[0].title?.rendered:typeof e[0].title?.raw=="string"&&(i=e[0].title?.raw),n=r?(0,zt.sprintf)((0,zt.__)('"%s" reset.'),(0,qT.decodeEntities)(i)):(0,zt.sprintf)((0,zt._x)('"%s" deleted.',"template part"),(0,qT.decodeEntities)(i))}else n=r?(0,zt.__)("Items reset."):(0,zt.__)("Items deleted.");t.dispatch(ii.store).createSuccessNotice(n,{type:"snackbar",id:"editor-template-deleted-success"})}else{let n;if(o.length===1)o[0].reason?.message?n=o[0].reason.message:n=r?(0,zt.__)("An error occurred while reverting the item."):(0,zt.__)("An error occurred while deleting the item.");else{let i=new Set,s=o.filter(({status:l})=>l==="rejected");for(let l of s)l.reason?.message&&i.add(l.reason.message);i.size===0?n=(0,zt.__)("An error occurred while deleting the items."):i.size===1?n=r?(0,zt.sprintf)((0,zt.__)("An error occurred while reverting the items: %s"),[...i][0]):(0,zt.sprintf)((0,zt.__)("An error occurred while deleting the items: %s"),[...i][0]):n=r?(0,zt.sprintf)((0,zt.__)("Some errors occurred while reverting the items: %s"),[...i].join(",")):(0,zt.sprintf)((0,zt.__)("Some errors occurred while deleting the items: %s"),[...i].join(","))}t.dispatch(ii.store).createErrorNotice(n,{type:"snackbar"})}},Vrt=e=>({select:t,registry:r})=>{let o=t.getCurrentPostType(),n=r.select(sn.store).getCurrentTheme()?.stylesheet,i=r.select(vy.store).get("core","renderingModes")?.[n]??{};if(i[o]===e)return;let s={[n]:{...i,[o]:e}};r.dispatch(vy.store).set("core","renderingModes",s)};function Brt(e){return{type:"SET_STYLES_PATH",path:e}}function jrt(e){return{type:"SET_SHOW_STYLEBOOK",show:e}}function zrt(){return{type:"RESET_STYLES_NAVIGATION"}}function rY(e){return({dispatch:t,registry:r})=>{t({type:"SET_CANVAS_WIDTH",width:e});let o=q(r.select(x3.store));if(o.isResponsiveEditing()){let n=o.getSettings().__experimentalFeatures?.viewport,i=A2(e,n);q(r.dispatch(x3.store)).setStyleStateViewport(R2[i]??"default")}}}function Hrt(e){return{type:"SET_CURRENT_REVISION_ID",revisionId:e}}var Urt=e=>async({dispatch:t,select:r,registry:o})=>{let n=r.getCurrentPostType(),i=r.getCurrentPostId(),l=o.select(sn.store).getEntityConfig("postType",n)?.revisionKey||"id",c=await o.resolveSelect(sn.store).getRevisions("postType",n,i,_v(l,e));o.batch(()=>{t({type:"SET_REVISION_PAGE",page:e}),c?.length&&t.setCurrentRevisionId(c[0][l])})};function $G(e){e.dispatch(ii.store).createNotice("warning",(0,zt.__)("Revisions could not be loaded."),{type:"snackbar",id:"editor-revisions-load-failed"})}var Wrt=e=>async({dispatch:t,select:r,registry:o})=>{t.setCurrentRevisionId(e);let n=r.getCurrentPostType(),i=r.getCurrentPostId(),s=o.select(sn.store).getEntityConfig("postType",n),l=s?.revisionKey||"id",c=await o.resolveSelect(sn.store).getRevisions("postType",n,i,{per_page:-1,context:"edit",orderby:"date",order:"desc",_fields:l});if(r.getCurrentRevisionId()!==e)return;if(!c){$G(o);return}let u=c.findIndex(f=>f[l]===e);if(u===-1){let f;try{f=await(0,tY.default)({path:(0,eY.addQueryArgs)(s.getRevisionsUrl(i,e),{context:"edit"})})}catch(m){if(r.getCurrentRevisionId()!==e)return;if(m?.data?.status!==404){$G(o);return}t.setCurrentRevisionId(null),o.dispatch(ii.store).createNotice("warning",(0,zt.__)("Invalid revision ID."),{type:"snackbar",id:"editor-revision-invalid"});return}if(r.getCurrentRevisionId()!==e)return;if(!f){$G(o);return}await o.dispatch(sn.store).receiveRevisions("postType",n,i,f,{context:"edit"});return}let d=Math.floor(u/r.getRevisionsPerPage())+1;d!==r.getRevisionPage()&&t({type:"SET_REVISION_PAGE",page:d})};function Grt(e){return{type:"SET_SHOW_REVISION_DIFF",showDiff:e}}var Yrt=e=>async({select:t,dispatch:r,registry:o})=>{let n=t.getCurrentPostType(),i=t.getCurrentPostId(),l=o.select(sn.store).getEntityConfig("postType",n)?.revisionKey||"id",c=await o.resolveSelect(sn.store).getRevision("postType",n,i,e,{context:"edit",_fields:[...new Set(["id","date","modified","author","meta","title.raw","excerpt.raw","content.raw",l])].join()});if(!c)return;let u={blocks:void 0,content:c.content.raw};c.title?.raw!==void 0&&(u.title=c.title.raw),c.excerpt?.raw!==void 0&&(u.excerpt=c.excerpt.raw),c.meta!==void 0&&(u.meta=c.meta),r.editPost(u),r.setCurrentRevisionId(null),await r.savePost(),!t.didPostSaveRequestFail()&&(o.dispatch(ii.store).removeNotice("autosave-exists"),o.dispatch(ii.store).createSuccessNotice((0,zt.sprintf)((0,zt.__)("Restored to revision from %s."),(0,E3.dateI18n)((0,E3.getSettings)().formats.datetime,c.date)),{type:"snackbar",id:"editor-revision-restored"}))};function qrt(e,t={focus:!1}){return{type:"SELECT_NOTE",noteId:e,options:t}}var Krt=(e,t,r)=>({dispatch:o})=>{if(o.setEditedPost(e.type,e.id),e.status==="auto-draft"&&r){let i;"content"in t?i=t.content:i=e.content.raw;let s=(0,sS.parse)(i);s=(0,sS.synchronizeBlocksWithTemplate)(s,r),o.resetEditorBlocks(s,{__unstableShouldCreateUndoLevel:!1})}t&&Object.entries(t).some(([i,s])=>s!==(e[i]?.raw??e[i]))&&o.editPost(t)};function Zrt(){return(0,vg.default)("wp.data.dispatch( 'core/editor' ).__experimentalTearDownEditor",{since:"6.5"}),{type:"DO_NOTHING"}}function Xrt(){return(0,vg.default)("wp.data.dispatch( 'core/editor' ).resetPost",{since:"6.0",version:"6.3",alternative:"Initialize the editor with the setupEditorState action"}),{type:"DO_NOTHING"}}function Qrt(){return(0,vg.default)("wp.data.dispatch( 'core/editor' ).updatePost",{since:"5.7",alternative:"Use the core entities store instead"}),{type:"DO_NOTHING"}}function Jrt(e){return(0,vg.default)("wp.data.dispatch( 'core/editor' ).setupEditorState",{since:"6.5",alternative:"wp.data.dispatch( 'core/editor' ).setEditedPost"}),H_e(e.type,e.id)}function H_e(e,t){return{type:"SET_EDITED_POST",postType:e,postId:t}}var $rt=(e,t)=>({select:r,registry:o})=>{let{id:n,type:i}=r.getCurrentPost();o.dispatch(qs.store).editEntityRecord("postType",i,n,e,t)},eot=(e={})=>async({select:t,dispatch:r,registry:o})=>{if(!t.isEditedPostSaveable())return;let n=t.getEditedPostContent();r.editPost({content:n},{undoIgnore:!0});let i=t.getCurrentPost(),s={id:i.id,...o.select(qs.store).getEntityRecordNonTransientEdits("postType",i.type,i.id),content:n};r({type:"REQUEST_POST_UPDATE_START",options:e});let l=!1;try{s=await(0,aS.applyFiltersAsync)("editor.preSavePost",s,e)}catch(c){l=c}if(!l)try{await o.dispatch(qs.store).saveEntityRecord("postType",i.type,s,e)}catch(c){l=c.message&&c.code!=="unknown_error"?c.message:(0,_n.__)("An error occurred while updating.")}if(l||(l=o.select(qs.store).getLastEntitySaveError("postType",i.type,i.id)),!l)try{await(0,aS.applyFilters)("editor.__unstableSavePost",Promise.resolve(),e)}catch(c){l=c}if(!l)try{await(0,aS.doActionAsync)("editor.savePost",{id:i.id,type:i.type},e)}catch(c){l=c}if(r({type:"REQUEST_POST_UPDATE_FINISH",options:e}),typeof window<"u"&&window.__experimentalTemplateActivate&&!e.isAutosave&&i.type==="wp_template"&&(typeof i.id=="number"||/^\d+$/.test(i.id))&&tot({select:t,dispatch:r,registry:o}),l){let c=WX({post:i,edits:s,error:l});c.length&&o.dispatch(iu.store).createErrorNotice(...c)}else{let c=t.getCurrentPost(),u=UX({previousPost:i,post:c,postType:await o.resolveSelect(qs.store).getPostType(c.type),options:e});u.length&&o.dispatch(iu.store).createSuccessNotice(...u),e.isAutosave||o.dispatch(Op.store).__unstableMarkLastChangeAsPersistent()}};async function tot({select:e,registry:t}){if(e.getEditorSettings().onNavigateToPreviousEntityRecord)return;let{id:o,slug:n}=e.getCurrentPost();if((await t.select(qs.store).getEntityRecord("root","site")).active_templates[n]===o)return;let l=(await t.resolveSelect(qs.store).getCurrentTheme())?.default_template_types.find(c=>c.slug===n);await t.dispatch(iu.store).createNotice("info",(0,_n.sprintf)((0,_n.__)('Do you want to activate this "%s" template?'),l?.title??n),{id:"template-activate-notice",actions:[{label:(0,_n.__)("Activate"),onClick:async()=>{await t.dispatch(iu.store).createNotice("info",(0,_n.__)("Activating template\u2026"),{id:"template-activate-notice"});try{let c=await t.select(qs.store).getEntityRecord("root","site");await t.dispatch(qs.store).saveEntityRecord("root","site",{active_templates:{...c.active_templates,[n]:o}},{throwOnError:!0}),await t.dispatch(iu.store).createSuccessNotice((0,_n.__)("Template activated."),{id:"template-activate-notice"})}catch(c){throw await t.dispatch(iu.store).createErrorNotice((0,_n.__)("Template activation failed."),{id:"template-activate-notice"}),c}}}]})}function rot(){return(0,vg.default)("wp.data.dispatch( 'core/editor' ).refreshPost",{since:"6.0",version:"6.3",alternative:"Use the core entities store instead"}),{type:"DO_NOTHING"}}var oot=()=>async({select:e,dispatch:t,registry:r})=>{let o=e.getCurrentPostType(),n=await r.resolveSelect(qs.store).getPostType(o),{rest_base:i,rest_namespace:s="wp/v2"}=n;t({type:"REQUEST_POST_DELETE_START"});try{let l=e.getCurrentPost();await(0,z_e.default)({path:`/${s}/${i}/${l.id}`,method:"DELETE"}),await t.savePost()}catch(l){r.dispatch(iu.store).createErrorNotice(...GX({error:l}))}t({type:"REQUEST_POST_DELETE_FINISH"})},not=({local:e=!1,...t}={})=>async({select:r,dispatch:o})=>{let n=r.getCurrentPost();if(e){let i=r.isEditedPostNew(),s=r.getEditedPostAttribute("title"),l=r.getEditedPostAttribute("content"),c=r.getEditedPostAttribute("excerpt");HX(n.id,i,s,l,c)}else await o.savePost({isAutosave:!0,...t})},iot=({forceIsAutosaveable:e}={})=>async({select:t,dispatch:r})=>((e||t.isEditedPostAutosaveable())&&!t.isPostLocked()&&(["draft","auto-draft"].includes(t.getEditedPostAttribute("status"))?await r.savePost({isPreview:!0}):await r.autosave({isPreview:!0})),t.getEditedPostPreviewLink()),sot=()=>({registry:e})=>{e.dispatch(qs.store).redo()},aot=()=>({registry:e})=>{e.dispatch(qs.store).undo()};function lot(){return(0,vg.default)("wp.data.dispatch( 'core/editor' ).createUndoLevel",{since:"6.0",version:"6.3",alternative:"Use the core entities store instead"}),{type:"DO_NOTHING"}}function cot(e){return{type:"UPDATE_POST_LOCK",lock:e}}var uot=()=>({registry:e})=>{e.dispatch(an.store).set("core","isPublishSidebarEnabled",!0)},dot=()=>({registry:e})=>{e.dispatch(an.store).set("core","isPublishSidebarEnabled",!1)};function fot(e){return{type:"LOCK_POST_SAVING",lockName:e}}function pot(e){return{type:"UNLOCK_POST_SAVING",lockName:e}}function mot(e){return{type:"LOCK_POST_AUTOSAVING",lockName:e}}function hot(e){return{type:"UNLOCK_POST_AUTOSAVING",lockName:e}}var got=(e,t={})=>({select:r,dispatch:o,registry:n})=>{let{__unstableShouldCreateUndoLevel:i,selection:s}=t,l={blocks:e,selection:s};if(i!==!1){let{id:c,type:u}=r.getCurrentPost();if(n.select(qs.store).getEditedEntityRecord("postType",u,c).blocks===l.blocks){n.dispatch(qs.store).__unstableCreateUndoLevel("postType",u,c);return}l.content=({blocks:f=[]})=>(0,sS.__unstableSerializeAndClean)(f)}o.editPost(l)};function vot(e){return{type:"UPDATE_EDITOR_SETTINGS",settings:e}}var bot=e=>({dispatch:t,registry:r,select:o})=>{o.__unstableIsEditorReady()&&!o.getEditorSettings().isPreviewMode&&r.dispatch(Op.store).clearSelectedBlock(),t({type:"SET_RENDERING_MODE",mode:e})};function yot(e){return({dispatch:t,registry:r})=>{let o=q(r.select(Op.store)).getSettings().__experimentalFeatures?.viewport,n=kX(e,o);t(rY(n))}}var wot=e=>({registry:t})=>{let r=t.select(an.store).get("core","inactivePanels")??[],o=!!r?.includes(e),n;o?n=r.filter(i=>i!==e):n=[...r,e],t.dispatch(an.store).set("core","inactivePanels",n)},_ot=e=>({registry:t})=>{let r=t.select(an.store).get("core","openPanels")??[],o=!!r?.includes(e),n;o?n=r.filter(i=>i!==e):n=[...r,e],t.dispatch(an.store).set("core","openPanels",n)};function Sot(e){return{type:"REMOVE_PANEL",panelName:e}}var xot=e=>({dispatch:t,registry:r})=>{typeof e=="object"&&e.hasOwnProperty("rootClientId")&&e.hasOwnProperty("insertionIndex")&&q(r.dispatch(Op.store)).setInsertionPoint({rootClientId:e.rootClientId,index:e.insertionIndex}),t({type:"SET_IS_INSERTER_OPENED",value:e})};function Cot(e){return{type:"SET_IS_LIST_VIEW_OPENED",isOpen:e}}var Eot=({createNotice:e=!0}={})=>({dispatch:t,registry:r})=>{let o=r.select(an.store).get("core","distractionFree");o&&r.dispatch(an.store).set("core","fixedToolbar",!1),o||r.batch(()=>{r.dispatch(an.store).set("core","fixedToolbar",!0),t.setIsInserterOpened(!1),t.setIsListViewOpened(!1),q(r.dispatch(Op.store)).resetZoomLevel()}),r.batch(()=>{r.dispatch(an.store).set("core","distractionFree",!o),e&&r.dispatch(iu.store).createInfoNotice(o?(0,_n.__)("Distraction free mode deactivated."):(0,_n.__)("Distraction free mode activated."),{id:"core/editor/distraction-free-mode/notice",type:"snackbar",actions:[{label:(0,_n.__)("Undo"),onClick:()=>{r.batch(()=>{r.dispatch(an.store).set("core","fixedToolbar",o),r.dispatch(an.store).toggle("core","distractionFree")})}}]})})},Tot=()=>({registry:e})=>{e.dispatch(an.store).toggle("core","focusMode");let t=e.select(an.store).get("core","focusMode");e.dispatch(iu.store).createInfoNotice(t?(0,_n.__)("Spotlight mode activated."):(0,_n.__)("Spotlight mode deactivated."),{id:"core/editor/toggle-spotlight-mode/notice",type:"snackbar",actions:[{label:(0,_n.__)("Undo"),onClick:()=>{e.dispatch(an.store).toggle("core","focusMode")}}]})},Pot=()=>({registry:e})=>{e.dispatch(an.store).toggle("core","fixedToolbar");let t=e.select(an.store).get("core","fixedToolbar");e.dispatch(iu.store).createInfoNotice(t?(0,_n.__)("Top toolbar activated."):(0,_n.__)("Top toolbar deactivated."),{id:"core/editor/toggle-top-toolbar/notice",type:"snackbar",actions:[{label:(0,_n.__)("Undo"),onClick:()=>{e.dispatch(an.store).toggle("core","fixedToolbar")}}]})},kot=e=>({dispatch:t,registry:r})=>{r.dispatch(an.store).set("core","editorMode",e),e!=="visual"&&(r.dispatch(Op.store).clearSelectedBlock(),q(r.dispatch(Op.store)).resetZoomLevel()),e==="visual"?(0,nY.speak)((0,_n.__)("Visual editor selected"),"assertive"):e==="text"&&(r.select(an.store).get("core","distractionFree")&&t.toggleDistractionFree(),(0,nY.speak)((0,_n.__)("Code editor selected"),"assertive"))};function Rot(){return{type:"OPEN_PUBLISH_SIDEBAR"}}function Aot(){return{type:"CLOSE_PUBLISH_SIDEBAR"}}function Iot(){return{type:"TOGGLE_PUBLISH_SIDEBAR"}}var lr=e=>(...t)=>({registry:r})=>{(0,vg.default)("`wp.data.dispatch( 'core/editor' )."+e+"`",{since:"5.3",alternative:"`wp.data.dispatch( 'core/block-editor' )."+e+"`",version:"6.2"}),r.dispatch(Op.store)[e](...t)},Oot=lr("resetBlocks"),Not=lr("receiveBlocks"),Mot=lr("updateBlock"),Fot=lr("updateBlockAttributes"),Dot=lr("selectBlock"),Lot=lr("startMultiSelect"),Vot=lr("stopMultiSelect"),Bot=lr("multiSelect"),jot=lr("clearSelectedBlock"),zot=lr("toggleSelection"),Hot=lr("replaceBlocks"),Uot=lr("replaceBlock"),Wot=lr("moveBlocksDown"),Got=lr("moveBlocksUp"),Yot=lr("moveBlockToPosition"),qot=lr("insertBlock"),Kot=lr("insertBlocks"),Zot=lr("showInsertionPoint"),Xot=lr("hideInsertionPoint"),Qot=lr("setTemplateValidity"),Jot=lr("synchronizeTemplate"),$ot=lr("mergeBlocks"),ent=lr("removeBlocks"),tnt=lr("removeBlock"),rnt=lr("toggleBlockMode"),ont=lr("startTyping"),nnt=lr("stopTyping"),int=lr("enterFormattedText"),snt=lr("exitFormattedText"),ant=lr("insertDefaultBlock"),lnt=lr("updateBlockListSettings");var iE={reducer:gZ,selectors:V8,actions:iY},I=(0,T3.createReduxStore)(xZ,{...iE});(0,T3.register)(I);q(I).registerPrivateActions(oY);q(I).registerPrivateSelectors(Y8);var K_e=a(T(),1),cnt=e=>(0,Y_e.createHigherOrderComponent)(t=>({attributes:r,setAttributes:o,...n})=>{let i=(0,U_e.useSelect)(u=>u(I).getCurrentPostType(),[]),[s,l]=(0,W_e.useEntityProp)("postType",i,"meta"),c=(0,G_e.useMemo)(()=>({...r,...Object.fromEntries(Object.entries(e).map(([u,d])=>[u,s[d]]))}),[r,s]);return(0,K_e.jsx)(t,{attributes:c,setAttributes:u=>{let d=Object.fromEntries(Object.entries(u??{}).filter(([f])=>f in e).map(([f,m])=>[e[f],m]));Object.entries(d).length&&l(d),o(u)},...n})},"withMetaAttributeSource");function unt(e){let t=Object.fromEntries(Object.entries(e.attributes??{}).filter(([,{source:r}])=>r==="meta").map(([r,{meta:o}])=>[r,o]));return Object.entries(t).length&&(e.edit=cnt(t)(e.edit)),e}(0,q_e.addFilter)("blocks.registerBlockType","core/editor/custom-sources-backwards-compatibility/shim-attribute-source",unt);var oke=a(zn(),1);var Z_e=a(ju(),1),X_e=a(vo(),1);var Q_e=a(Nt(),1),by=a(T(),1),dnt=10,P3={name:"links",className:"editor-autocompleters__link",triggerPrefix:"[[",isDebounced:!0,async options(e){return(await(0,Z_e.default)({path:(0,X_e.addQueryArgs)("/wp/v2/search",{per_page:dnt,search:e,type:"post"})})).filter(r=>r.title!=="")},getOptionKeywords(e){return[...e.title.split(/\s+/)]},getOptionLabel(e){return(0,by.jsxs)(by.Fragment,{children:[(0,by.jsx)(En,{icon:e.subtype==="page"?mm:AB}),(0,Q_e.decodeEntities)(e.title)]})},getOptionCompletion(e){return(0,by.jsx)("a",{href:e.url,children:e.title})}};var J_e=a(U(),1),$_e=a(Y(),1),eSe=a(ae(),1),Np=a(T(),1);function sY(e){let t=e.avatar_urls&&e.avatar_urls[24]?(0,Np.jsx)("img",{className:"editor-autocompleters__user-avatar",alt:"",src:e.avatar_urls[24]}):(0,Np.jsx)("span",{className:"editor-autocompleters__no-avatar"});return(0,Np.jsxs)(Np.Fragment,{children:[t,(0,Np.jsx)("span",{className:"editor-autocompleters__user-name",children:e.name}),(0,Np.jsx)("span",{className:"editor-autocompleters__user-slug",children:e.slug})]})}var k3={name:"users",className:"editor-autocompleters__user",triggerPrefix:"@",useItems(e){let t=(0,$_e.useSelect)(o=>{let{getUsers:n}=o(eSe.store);return n({context:"view",search:e})},[e]);return[(0,J_e.useMemo)(()=>t?t.map(o=>({key:`user-${o.slug}`,value:o,label:sY(o)})):[],[t])]},getOptionCompletion(e){return`@${e.slug}`}};var cS=a(U(),1),lS=a(Y(),1),tSe=a(ae(),1);function fnt(e,t){let r=(0,cS.useRef)(e);(0,cS.useEffect)(()=>{r.current=e},[e]),(0,cS.useEffect)(()=>{if(!t)return;let o=setInterval(()=>r.current(),t*1e3);return()=>clearInterval(o)},[t])}function R3({interval:e,autosave:t}){let{autosave:r}=(0,lS.useDispatch)(I),o=t??r,{getReferenceByDistinctEdits:n}=(0,lS.useSelect)(tSe.store),{isEditedPostDirty:i,isEditedPostAutosaveable:s,isAutosavingPost:l}=(0,lS.useSelect)(I),c=(0,lS.useSelect)(d=>e!==void 0?e:d(I).getEditorSettings().autosaveInterval,[e]),u=(0,cS.useRef)();return fnt(()=>{if(!s())return;let d=n();d!==u.current&&i()&&!l()&&(u.current=d,o())},c),null}var Sg=a(j(),1),JT=a(Y(),1),lu=a(G(),1),$T=a(be(),1);var BSe=a(ae(),1),jSe=a(DG(),1),W3=a(U(),1),zSe=a(Ce(),1),HSe=a(Nt(),1),USe=a(Mp(),1);var aY=a(j(),1),oSe=a(Y(),1),nSe=a(ae(),1);function A3(e){let{isFrontPage:t,isPostsPage:r}=(0,oSe.useSelect)(o=>{let{canUser:n,getEditedEntityRecord:i}=o(nSe.store),s=n("read",{kind:"root",name:"site"})?i("root","site"):void 0,l=parseInt(e,10);return{isFrontPage:s?.page_on_front===l,isPostsPage:s?.page_for_posts===l}});return t?(0,aY.__)("Homepage"):r?(0,aY.__)("Posts Page"):!1}var OSe=a(G(),1),NSe=a(Mo(),1),H3=a(j(),1),QT=a(Y(),1);var U3=a(Ce(),1),MSe=a(Lt(),1);var ZT=a(U(),1);var wy=a(G(),1),su=a(j(),1),Ln=a(be(),1),_y=a(Y(),1);var Wr=a(U(),1),L3=a(Mo(),1),mSe=a(Ef(),1),hSe=a(ae(),1);var Ur=a(j(),1),uS=[{slug:"theme-colors",title:(0,Ur.__)("Theme Colors"),origin:"theme",type:"colors"},{slug:"theme-gradients",title:(0,Ur.__)("Theme Gradients"),origin:"theme",type:"gradients"},{slug:"custom-colors",title:(0,Ur.__)("Custom Colors"),origin:"custom",type:"colors"},{slug:"custom-gradients",title:(0,Ur.__)("Custom Gradients"),origin:"custom",type:"gradients"},{slug:"duotones",title:(0,Ur.__)("Duotones"),origin:"theme",type:"duotones"},{slug:"default-colors",title:(0,Ur.__)("Default Colors"),origin:"default",type:"colors"},{slug:"default-gradients",title:(0,Ur.__)("Default Gradients"),origin:"default",type:"gradients"}],I3=[{slug:"site-identity",title:(0,Ur.__)("Site Identity"),blocks:["core/site-logo","core/site-title","core/site-tagline"]},{slug:"design",title:(0,Ur.__)("Design"),blocks:["core/navigation","core/avatar","core/post-time-to-read"],exclude:["core/home-link","core/navigation-link"]},{slug:"posts",title:(0,Ur.__)("Posts"),blocks:["core/post-title","core/post-excerpt","core/post-author","core/post-author-name","core/post-author-biography","core/post-date","core/post-terms","core/term-description","core/query-title","core/query-no-results","core/query-pagination","core/query-numbers"]},{slug:"comments",title:(0,Ur.__)("Comments"),blocks:["core/comments-title","core/comments-pagination","core/comments-pagination-numbers","core/comments","core/comments-author-name","core/comment-content","core/comment-date","core/comment-edit-link","core/comment-reply-link","core/comment-template","core/post-comments-count","core/post-comments-link"]}],lY=[{slug:"overview",title:(0,Ur.__)("Overview"),blocks:[]},{slug:"text",title:(0,Ur.__)("Text"),blocks:["core/post-content","core/home-link","core/navigation-link"]},{slug:"colors",title:(0,Ur.__)("Colors"),blocks:[]},{slug:"theme",title:(0,Ur.__)("Theme"),subcategories:I3},{slug:"media",title:(0,Ur.__)("Media"),blocks:["core/post-featured-image"]},{slug:"widgets",title:(0,Ur.__)("Widgets"),blocks:[]},{slug:"embed",title:(0,Ur.__)("Embeds"),include:[]}],pnt=[...I3,{slug:"media",title:(0,Ur.__)("Media"),blocks:["core/post-featured-image"]},{slug:"widgets",title:(0,Ur.__)("Widgets"),blocks:[]},{slug:"embed",title:(0,Ur.__)("Embeds"),include:[]}],iSe=[{slug:"overview",title:(0,Ur.__)("Overview"),blocks:[]},{slug:"text",title:(0,Ur.__)("Text"),blocks:["core/post-content","core/home-link","core/navigation-link"]},{slug:"colors",title:(0,Ur.__)("Colors"),blocks:[]},{slug:"blocks",title:(0,Ur.__)("All Blocks"),blocks:[],subcategories:pnt}],mnt=`
.is-root-container {
display: flow-root;
}
`,sSe=`
body {
position: relative;
padding: 32px !important;
}
${mnt}
.editor-style-book__examples {
max-width: 1200px;
margin: 0 auto;
}
.editor-style-book__example {
max-width: 900px;
border-radius: 2px;
cursor: var(--wpds-cursor-control, pointer);
display: flex;
flex-direction: column;
gap: 40px;
padding: 16px;
width: 100%;
box-sizing: border-box;
scroll-margin-top: 32px;
scroll-margin-bottom: 32px;
margin: 0 auto 40px auto;
}
.editor-style-book__example.is-selected {
box-shadow: 0 0 0 1px var(--wp-components-color-accent, var(--wp-admin-theme-color, #007cba));
}
.editor-style-book__example.is-disabled-example {
pointer-events: none;
}
.editor-style-book__example:focus:not(:disabled) {
box-shadow: 0 0 0 var(--wp-admin-border-width-focus) var(--wp-components-color-accent, var(--wp-admin-theme-color, #007cba));
outline: 3px solid transparent;
}
.editor-style-book__duotone-example > div:first-child {
display: flex;
aspect-ratio: 16 / 9;
grid-row: span 1;
grid-column: span 2;
}
.editor-style-book__duotone-example img {
width: 100%;
height: 100%;
object-fit: cover;
}
.editor-style-book__duotone-example > div:not(:first-child) {
height: 20px;
border: 1px solid color-mix( in srgb, currentColor 10%, transparent );
}
.editor-style-book__color-example {
border: 1px solid color-mix( in srgb, currentColor 10%, transparent );
}
.editor-style-book__subcategory-title,
.editor-style-book__example-title {
font-family: -apple-system, system-ui, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
font-size: 13px;
font-weight: normal;
line-height: normal;
margin: 0;
text-align: left;
padding-top: 8px;
border-top: 1px solid color-mix( in srgb, currentColor 10%, transparent );
color: color-mix( in srgb, currentColor 60%, transparent );
}
.editor-style-book__subcategory-title {
font-size: 16px;
margin-bottom: 40px;
padding-bottom: 8px;
}
.editor-style-book__example-preview {
width: 100%;
}
.editor-style-book__example-preview .block-editor-block-list__insertion-point,
.editor-style-book__example-preview .block-list-appender {
display: none;
}
:where(.is-root-container > .wp-block:first-child) {
margin-top: 0;
}
:where(.is-root-container > .wp-block:last-child) {
margin-bottom: 0;
}
`;var aSe=a(Pt(),1);function KT(e,t){if(!e?.slug||!t?.length)return;let r=e?.subcategories??[];if(r.length)return r.reduce((s,l)=>{let c=KT(l,t);return c&&(s.subcategories||(s.subcategories=[]),s.subcategories=[...s.subcategories,c]),s},{title:e.title,slug:e.slug});let o=e?.blocks||[],n=e?.exclude||[],i=t.filter(s=>!n.includes(s.name)&&(s.category===e.slug||o.includes(s.name)));if(i.length)return{title:e.title,slug:e.slug,examples:i}}function cY(){let e=[...I3,...lY].map(({slug:o})=>o),r=(0,aSe.getCategories)().filter(({slug:o})=>!e.includes(o));return[...lY,...r]}var qd=a(j(),1),Ei=a(Pt(),1);var lSe=a(G(),1),O3=a(be(),1),uY=a(T(),1),hnt=({colors:e,type:t,templateColumns:r="1fr 1fr",itemHeight:o="52px"})=>e?(0,uY.jsx)(lSe.__experimentalGrid,{templateColumns:r,rowGap:8,columnGap:16,children:e.map(n=>{let i=t==="gradients"?(0,O3.__experimentalGetGradientClass)(n.slug):(0,O3.getColorClassName)("background-color",n.slug),s=J("editor-style-book__color-example",i);return(0,uY.jsx)("div",{className:s,style:{height:o}},n.slug)})}):null,dY=hnt;var fY=a(G(),1),yy=a(T(),1),gnt=({duotones:e})=>e?(0,yy.jsx)(fY.__experimentalGrid,{columns:2,rowGap:16,columnGap:16,children:e.map(t=>(0,yy.jsxs)(fY.__experimentalGrid,{className:"editor-style-book__duotone-example",columns:2,rowGap:8,columnGap:8,children:[(0,yy.jsx)("div",{children:(0,yy.jsx)("img",{alt:`Duotone example: ${t.slug}`,src:"https://s.w.org/images/core/5.3/MtBlanc1.jpg",style:{filter:`url(#wp-duotone-${t.slug})`}})}),t.colors.map(r=>(0,yy.jsx)("div",{className:"editor-style-book__color-example",style:{backgroundColor:r}},r))]},t.slug))}):null,cSe=gnt;var N3=a(T(),1);function vnt(e){if(!e)return[];let t=[];return uS.forEach(r=>{let o=e[r.type],n=Array.isArray(o)?o.find(i=>i.slug===r.origin):void 0;if(n?.[r.type]){let i={name:r.slug,title:r.title,category:"colors"};r.type==="duotones"?(i.content=(0,N3.jsx)(cSe,{duotones:n[r.type]}),t.push(i)):(i.content=(0,N3.jsx)(dY,{colors:n[r.type],type:r.type}),t.push(i))}}),t}function bnt(e){let t=[],r=Array.isArray(e?.colors)?e.colors.find(i=>i.slug==="theme"):void 0;if(r){let i={name:"theme-colors",title:(0,qd.__)("Colors"),category:"overview",content:(0,N3.jsx)(dY,{colors:r.colors,type:"colors",templateColumns:"repeat(auto-fill, minmax( 200px, 1fr ))",itemHeight:"32px"})};t.push(i)}let o=[];if((0,Ei.getBlockType)("core/heading")){let i=(0,Ei.createBlock)("core/heading",{content:(0,qd.__)("AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz0123456789X{(\u2026)},.-<>?!*&:/A@HELFO\u2122\xA9"),level:1});o.push(i)}if((0,Ei.getBlockType)("core/paragraph")){let i=(0,Ei.createBlock)("core/paragraph",{content:(0,qd.__)("A paragraph in a website refers to a distinct block of text that is used to present and organize information. It is a fundamental unit of content in web design and is typically composed of a group of related sentences or thoughts focused on a particular topic or idea. Paragraphs play a crucial role in improving the readability and user experience of a website. They break down the text into smaller, manageable chunks, allowing readers to scan the content more easily.")}),s=(0,Ei.createBlock)("core/paragraph",{content:(0,qd.__)("Additionally, paragraphs help structure the flow of information and provide logical breaks between different concepts or pieces of information. In terms of formatting, paragraphs in websites are commonly denoted by a vertical gap or indentation between each block of text. This visual separation helps visually distinguish one paragraph from another, creating a clear and organized layout that guides the reader through the content smoothly.")});if((0,Ei.getBlockType)("core/group")){let l=(0,Ei.createBlock)("core/group",{layout:{type:"grid",columnCount:2,minimumColumnWidth:"12rem"},style:{spacing:{blockGap:"1.5rem"}}},[i,s]);o.push(l)}else o.push(i)}return o.length&&t.push({name:"typography",title:(0,qd.__)("Typography"),category:"overview",blocks:o}),["core/image","core/separator","core/buttons","core/pullquote","core/search"].forEach(i=>{let s=(0,Ei.getBlockType)(i);if(s&&s.example){let l={name:i,title:s.title,category:"overview",blocks:(0,Ei.getBlockFromExample)(i,{...s.example,attributes:{...s.example.attributes,style:void 0}})};t.push(l)}}),t}function pY(e){let t=(0,Ei.getBlockTypes)().filter(s=>{let{name:l,example:c,supports:u}=s;return l!=="core/heading"&&!!c&&u?.inserter!==!1}).map(s=>({name:s.name,title:s.title,category:s.category,blocks:(0,Ei.getBlockFromExample)(s.name,{...s.example,attributes:{...s.example?.attributes,style:void 0}})}));if(!!!(0,Ei.getBlockType)("core/heading"))return t;let o={name:"core/heading",title:(0,qd.__)("Headings"),category:"text",blocks:[1,2,3,4,5,6].map(s=>(0,Ei.createBlock)("core/heading",{content:(0,qd.sprintf)((0,qd.__)("Heading %d"),s),level:s}))},n=vnt(e),i=bnt(e);return[o,...n,...t,...i]}var pSe=a(U(),1),F3=a(Y(),1);var M3=a(Pt(),1),uSe=a(Y(),1),dSe=a(U(),1);function dS(e={},t=!1){let o=_G("spacing.blockGap")!==null,n=!o,{disableLayoutStyles:i,getBlockStyles:s}=(0,uSe.useSelect)(l=>{let{getEditorSettings:c}=l(I),{getBlockStyles:u}=l(M3.store);return{disableLayoutStyles:!!c()?.disableLayoutStyles,getBlockStyles:u}},[]);return(0,dSe.useMemo)(()=>{if(!e?.styles||!e?.settings)return[[],{}];let l=(0,M3.getBlockTypes)();return wv(e,l,{hasBlockGapSupport:o,hasFallbackGapSupport:n,disableLayoutStyles:i,disableRootPadding:t,getBlockStyles:s})},[o,n,e,i,t,s])}function fSe(e=!1){let{merged:t}=Hr();return dS(t,e)}function ynt(e){let[t,r]=fSe(e),{getEditorSettings:o}=(0,F3.useSelect)(I),{updateEditorSettings:n}=(0,F3.useDispatch)(I);(0,pSe.useEffect)(()=>{if(!t||!r)return;let i=o(),s=Object.values(i.styles??[]).filter(l=>!l.isGlobalStyles);n({...i,styles:[...s,...t],__experimentalFeatures:r})},[t,r,n,o])}function D3({disableRootPadding:e}){return ynt(e),null}var Wt=a(T(),1),{ExperimentalBlockEditorProvider:wnt}=q(Ln.privateApis);function bg(e){return!e||Object.keys(e).length===0}var _nt=(e,t)=>{if(!e||!t||!t?.contentDocument)return;let r=e==="top"?t.contentDocument.body:t.contentDocument.getElementById(e);r&&r.scrollIntoView({behavior:"smooth"})},gSe=e=>e&&typeof e=="string"&&(e==="/"||e.startsWith("/typography")||e.startsWith("/colors")||e.startsWith("/blocks"))?{top:!0}:null;function vSe(){let{colors:e,gradients:t}=(0,Ln.__experimentalUseMultipleOriginColorsAndGradients)(),[r,o,n,i]=(0,Ln.useSettings)("color.defaultDuotone","color.duotone.custom","color.duotone.theme","color.duotone.default");return(0,Wr.useMemo)(()=>{let l={colors:e,gradients:t,duotones:[]};return n&&n.length&&l.duotones.push({name:(0,su._x)("Theme","Indicates these duotone filters come from the theme."),slug:"theme",duotones:n}),r&&i&&i.length&&l.duotones.push({name:(0,su._x)("Default","Indicates these duotone filters come from WordPress."),slug:"default",duotones:i}),o&&o.length&&l.duotones.push({name:(0,su._x)("Custom","Indicates these doutone filters are created by the user."),slug:"custom",duotones:o}),l},[e,t,o,n,i,r])}function bSe(e){let t=[],r=KT({slug:"overview"},e);t.push(...r.examples);let o=e.filter(n=>n.category!=="overview"&&!r.examples.find(i=>i.name===n.name));return t.push(...o),t}function Snt(e,t){return t?e.map(r=>({...r,variation:t,blocks:Array.isArray(r.blocks)?r.blocks.map(o=>({...o,attributes:{...o.attributes,style:void 0,className:`is-style-${t}`}})):{...r.blocks,attributes:{...r.blocks.attributes,style:void 0,className:`is-style-${t}`}}})):e}function xnt({isSelected:e,onClick:t,onSelect:r,showTabs:o=!0,userConfig:n={},path:i=""},s){let l=cg("color.text"),c=cg("color.background"),u=vSe(),d=(0,Wr.useMemo)(()=>pY(u),[u]),f=(0,Wr.useMemo)(()=>cY().filter(w=>d.some(S=>S.category===w.slug)),[d]),m=bSe(d),{base:h}=Hr(),g=gSe(i),v=(0,Wr.useMemo)(()=>!bg(n)&&!bg(h)?Di(h,n):{},[h,n]),b=(0,_y.useSelect)(w=>w(Ln.store).getSettings(),[]),[_]=dS(v),y=(0,Wr.useMemo)(()=>({...b,styles:!bg(_)&&!bg(n)?_:b.styles,isPreviewMode:!0}),[_,b,n]);return(0,Wt.jsx)("div",{ref:s,className:J("editor-style-book",{"is-button":!!t}),style:{color:l,background:c},children:o?(0,Wt.jsxs)(Pn.Root,{className:"editor-style-book__tabs",defaultValue:f[0]?.slug,children:[(0,Wt.jsx)("div",{className:"editor-style-book__tablist-container",children:(0,Wt.jsx)(Pn.List,{children:f.map(w=>(0,Wt.jsx)(Pn.Tab,{value:w.slug,children:w.title},w.slug))})}),f.map(w=>{let S=w.slug?cY().find(C=>C.slug===w.slug):null,x=S?KT(S,d):{examples:d};return(0,Wt.jsx)(Pn.Panel,{value:w.slug,tabIndex:-1,className:"editor-style-book__tabpanel",children:(0,Wt.jsx)(mY,{category:w.slug,examples:x,isSelected:e,onSelect:r,settings:y,title:w.title,goTo:g})},w.slug)})]}):(0,Wt.jsx)(mY,{examples:{examples:m},isSelected:e,onClick:t,onSelect:r,settings:y,goTo:g})})}var ySe=({userConfig:e={},isStatic:t=!1,path:r,onPathChange:o,settings:n})=>{let i=(0,_y.useSelect)(N=>n??N(I).getEditorSettings(),[n]),s=(0,_y.useSelect)(N=>N(hSe.store).canUser("create",{kind:"postType",name:"attachment"}),[]);(0,Wr.useEffect)(()=>{(0,_y.dispatch)(Ln.store).updateSettings({...i,mediaUpload:s?mSe.uploadMedia:void 0})},[i,s]);let[l,c]=(0,Wr.useState)("/"),u=r??l,d=o??c,f=N=>u===`/blocks/${encodeURIComponent(N)}`||u.startsWith(`/blocks/${encodeURIComponent(N)}/`),m=(N,k=!1)=>{if(uS.find(E=>E.slug===N)){d("/colors/palette");return}if(N==="typography"){d("/typography");return}k||d(`/blocks/${encodeURIComponent(N)}`)},h=vSe(),g=pY(h),v=bSe(g),b=null,_=null;if(u.includes("/colors"))b="colors";else if(u.includes("/typography"))b="text";else if(u.includes("/blocks")){b="blocks";let N=decodeURIComponent(u).split("/blocks/")[1];N?.includes("/variations")&&([N,_]=N.split("/variations/")),N&&g.find(k=>k.name===N)&&(b=N)}else t||(b="overview");let y=iSe.find(N=>N.slug===b),w=(0,Wr.useMemo)(()=>y?KT(y,g):{examples:[g.find(N=>N.name===b)]},[y,g,b]),S=(0,Wr.useMemo)(()=>b?_&&w?.examples?.length?{examples:Snt(w.examples,_)}:w:{examples:v},[b,v,_,w]),{base:x}=Hr(),C=gSe(u),A=(0,Wr.useMemo)(()=>!bg(e)&&!bg(x)?Di(x,e):{},[x,e]),[P]=dS(A),R=(0,Wr.useMemo)(()=>({...i,styles:!bg(P)&&!bg(e)?P:i.styles,isPreviewMode:!0}),[P,i,e]);return(0,Wt.jsx)("div",{className:"editor-style-book",children:(0,Wt.jsxs)(Ln.BlockEditorProvider,{settings:R,children:[(0,Wt.jsx)(D3,{disableRootPadding:!0}),(0,Wt.jsx)(mY,{examples:S,settings:R,goTo:C,isSelected:t?null:f,onSelect:t?null:m})]})})},mY=({examples:e,isSelected:t,onClick:r,onSelect:o,settings:n,title:i,goTo:s})=>{let[l,c]=(0,Wr.useState)(!1),[u,d]=(0,Wr.useState)(!1),f=(0,Wr.useRef)(null),m={role:"button",onFocus:()=>c(!0),onBlur:()=>c(!1),onKeyDown:g=>{if(g.defaultPrevented)return;let{keyCode:v}=g;r&&(v===L3.ENTER||v===L3.SPACE)&&(g.preventDefault(),r(g))},onClick:g=>{g.defaultPrevented||r&&(g.preventDefault(),r(g))},readonly:!0},h=()=>d(!0);return(0,Wr.useLayoutEffect)(()=>{u&&f.current&&s?.top&&_nt("top",f.current)},[s?.top,u]),(0,Wt.jsxs)(Ln.__unstableIframe,{onLoad:h,ref:f,className:J("editor-style-book__iframe",{"is-focused":l&&!!r,"is-button":!!r}),name:"style-book-canvas",tabIndex:0,...r?m:{},children:[(0,Wt.jsx)(Ln.__unstableEditorStyles,{styles:n.styles}),(0,Wt.jsxs)("style",{children:[sSe,!!r&&"body { cursor: var(--wpds-cursor-control, pointer); } body * { pointer-events: none; }"]}),(0,Wt.jsx)(Cnt,{className:"editor-style-book__examples",filteredExamples:e,label:i?(0,su.sprintf)((0,su.__)("Examples of blocks in the %s category"),i):(0,su.__)("Examples of blocks"),isSelected:t,onSelect:o},i)]})},Cnt=(0,Wr.memo)(({className:e,filteredExamples:t,label:r,isSelected:o,onSelect:n})=>(0,Wt.jsxs)(wy.Composite,{orientation:"vertical",className:e,"aria-label":r,role:"grid",children:[!!t?.examples?.length&&t.examples.map(i=>(0,Wt.jsx)(wSe,{id:`example-${i.name}`,title:i.title,content:i.content,blocks:i.blocks,isSelected:o?.(i.name),onClick:n?()=>n(i.name,!!i.variation):null},i.name)),!!t?.subcategories?.length&&t.subcategories.map(i=>(0,Wt.jsxs)(wy.Composite.Group,{className:"editor-style-book__subcategory",children:[(0,Wt.jsx)(wy.Composite.GroupLabel,{children:(0,Wt.jsx)("h2",{className:"editor-style-book__subcategory-title",children:i.title})}),(0,Wt.jsx)(Ent,{examples:i.examples,isSelected:o,onSelect:n})]},`subcategory-${i.slug}`))]})),Ent=({examples:e,isSelected:t,onSelect:r})=>!!e?.length&&e.map(o=>(0,Wt.jsx)(wSe,{id:`example-${o.name}`,title:o.title,content:o.content,blocks:o.blocks,isSelected:t?.(o.name),onClick:r?()=>r(o.name):null},o.name)),Tnt=["example-duotones"],wSe=({id:e,title:t,blocks:r,isSelected:o,onClick:n,content:i})=>{let s=(0,_y.useSelect)(d=>d(Ln.store).getSettings(),[]),l=(0,Wr.useMemo)(()=>({...s,focusMode:!1,isPreviewMode:!0}),[s]),c=(0,Wr.useMemo)(()=>Array.isArray(r)?r:[r],[r]),u=Tnt.includes(e)||!n?{disabled:!0,accessibleWhenDisabled:!!n}:{};return(0,Wt.jsx)("div",{role:"row",children:(0,Wt.jsx)("div",{role:"gridcell",children:(0,Wt.jsxs)(wy.Composite.Item,{className:J("editor-style-book__example",{"is-selected":o,"is-disabled-example":!!u?.disabled}),id:e,"aria-label":n?(0,su.sprintf)((0,su.__)("Open %s styles in Styles panel"),t):void 0,render:(0,Wt.jsx)("div",{}),role:n?"button":null,onClick:n,...u,children:[(0,Wt.jsx)("span",{className:"editor-style-book__example-title",children:t}),(0,Wt.jsx)("div",{className:"editor-style-book__example-preview","aria-hidden":!0,children:(0,Wt.jsx)(wy.Disabled,{className:"editor-style-book__example-preview__content",children:i||(0,Wt.jsxs)(wnt,{value:c,settings:l,children:[(0,Wt.jsx)(Ln.__unstableEditorStyles,{}),(0,Wt.jsx)(Ln.BlockList,{renderAppender:!1})]})})})]})})})},_Se=(0,Wr.forwardRef)(xnt);var XT=a(T(),1);function SSe({path:e,onPathChange:t,userConfig:r,forwardedRef:o}){return(0,XT.jsx)(_Se,{ref:o,path:e,userConfig:r,isSelected:n=>e===`/blocks/${encodeURIComponent(n)}`||e?.startsWith(`/blocks/${encodeURIComponent(n)}/`),onSelect:n=>{if(uS.find(i=>i.slug===n)){t?.("/colors/palette");return}if(n==="typography"){t?.("/typography");return}t?.("/blocks/"+encodeURIComponent(n))}})}function Pnt({path:e,onPathChange:t,forwardedRef:r}){let{user:o}=Hr(),{revisions:n,isLoading:i}=ny(),s=(0,ZT.useMemo)(()=>{let c=e?.match(/^\/revisions\/(.+)$/);return c?c[1]:null},[e]),l=(0,ZT.useMemo)(()=>!s||!n.length?null:n.find(c=>String(c.id)===String(s)),[s,n]);return i?null:(0,XT.jsx)(SSe,{forwardedRef:r,path:e,onPathChange:t,userConfig:l||o})}function knt({path:e,onPathChange:t},r){return e?.startsWith("/revisions")?(0,XT.jsx)(Pnt,{forwardedRef:r,path:e,onPathChange:t}):(0,XT.jsx)(SSe,{forwardedRef:r,path:e,onPathChange:t})}var xSe=(0,ZT.forwardRef)(knt);var CSe=a(G(),1),au=a(be(),1),hY=a(Y(),1),yg=a(U(),1);var Fp=a(T(),1),{ExperimentalBlockEditorProvider:Rnt,BlockStyleVariationOverridesWithConfig:Ant}=q(au.privateApis);function V3(e){return!e||Object.keys(e).length===0}function Int({path:e},t){let r=(0,hY.useSelect)(b=>b(au.store).getBlocks(),[]),{user:o,base:n}=Hr(),{revisions:i,isLoading:s}=ny(),l=(0,yg.useMemo)(()=>{let b=e?.match(/^\/revisions\/(.+)$/);return b?b[1]:null},[e]),u=(0,yg.useMemo)(()=>!l||!i.length?null:i.find(b=>String(b.id)===String(l)),[l,i])||o,d=(0,yg.useMemo)(()=>!V3(u)&&!V3(n)?Di(n,u):{},[n,u]),f=(0,yg.useMemo)(()=>Array.isArray(r)?r:[r],[r]),m=(0,hY.useSelect)(b=>b(au.store).getSettings(),[]),h=(0,yg.useMemo)(()=>({...m,isPreviewMode:!0}),[m]),[g]=dS(d),v=!V3(g)&&!V3(u)?g:h.styles;return s?null:(0,Fp.jsxs)(au.__unstableIframe,{ref:t,className:"editor-revisions__iframe",name:"revisions",tabIndex:0,children:[(0,Fp.jsx)("style",{children:".is-root-container { display: flow-root; }"}),(0,Fp.jsx)(CSe.Disabled,{className:"editor-revisions__example-preview__content",children:(0,Fp.jsxs)(Rnt,{value:f,settings:h,children:[(0,Fp.jsx)(au.BlockList,{renderAppender:!1}),(0,Fp.jsx)(au.__unstableEditorStyles,{styles:v}),(0,Fp.jsx)(Ant,{config:d})]})})]})}var ESe=(0,yg.forwardRef)(Int);var ASe=a(Y(),1),Sy=a(U(),1),z3=a(G(),1),ISe=a(Ce(),1);var B3=a(j(),1),wg=a(Mo(),1),PSe=a(G(),1);var Kd=a(T(),1),TSe=20;function gY({direction:e,resizeWidthBy:t}){function r(i){let{keyCode:s}=i;s!==wg.LEFT&&s!==wg.RIGHT||(i.preventDefault(),e==="left"&&s===wg.LEFT||e==="right"&&s===wg.RIGHT?t(TSe):(e==="left"&&s===wg.RIGHT||e==="right"&&s===wg.LEFT)&&t(-TSe))}let o={active:{opacity:1,scaleY:1.3}},n=`resizable-editor__resize-help-${e}`;return(0,Kd.jsxs)(Kd.Fragment,{children:[(0,Kd.jsxs)(Ze.Root,{children:[(0,Kd.jsx)(Ze.Trigger,{render:(0,Kd.jsx)(PSe.__unstableMotion.button,{className:`editor-resizable-editor__resize-handle is-${e}`,"aria-label":(0,B3.__)("Drag to resize"),"aria-describedby":n,onKeyDown:r,variants:o,whileFocus:"active",whileHover:"active",whileTap:"active",role:"separator","aria-orientation":"vertical"},"handle")}),(0,Kd.jsx)(Ze.Popup,{children:(0,B3.__)("Drag to resize")})]}),(0,Kd.jsx)(Yt,{id:n,children:(0,B3.__)("Use left and right arrow keys to resize the canvas.")})]})}var j3=a(T(),1),kSe={position:void 0,userSelect:void 0,cursor:void 0,width:void 0,height:void 0,top:void 0,right:void 0,bottom:void 0,left:void 0};function RSe(e,t,r=0){return t>0&&e>=t-r}function Ont({className:e,enableResizing:t,width:r="100%",height:o="100%",children:n}){let[i,s]=(0,Sy.useState)(!1),l=(0,ISe.useReducedMotion)(),{setCanvasWidth:c}=q((0,ASe.useDispatch)(I)),u=(0,Sy.useRef)(),d=(0,Sy.useCallback)(m=>{if(u.current){let h=RSe(u.current.offsetWidth+m,u.current.parentElement?.offsetWidth??0,80);c(h?void 0:u.current.offsetWidth+m)}},[c]),f=(0,Sy.useCallback)((m,h)=>{let g=m.offsetWidth,v=m.parentElement?.offsetWidth??0;c(h&&RSe(g,v,80)?void 0:g)},[c]);return(0,j3.jsx)(z3.ResizableBox,{as:z3.__unstableMotion.div,initial:!1,animate:{height:o},transition:{type:"tween",duration:i||l?0:.2,ease:"easeOut"},className:J("editor-resizable-editor",e,{"is-resizable":t,"is-resizing":i}),ref:m=>{u.current=m?.resizable},size:{width:r,height:o},onResizeStart:()=>{s(!0)},onResize:(m,h,g)=>{f(g)},onResizeStop:(m,h,g)=>{f(g,!0),s(!1)},minWidth:300,maxWidth:"100%",maxHeight:"100%",enable:{left:t,right:t},showHandle:t,resizeRatio:2,handleComponent:{left:(0,j3.jsx)(gY,{direction:"left",resizeWidthBy:d}),right:(0,j3.jsx)(gY,{direction:"right",resizeWidthBy:d})},handleClasses:void 0,handleStyles:{left:kSe,right:kSe},children:n})}var fS=Ont;var _g=a(T(),1);function vY(e,t){return t?(0,H3.__)("Style Book"):e?.startsWith("/revisions")?(0,H3.__)("Style Revisions"):""}function FSe(){let{stylesPath:e,showStylebook:t,showListViewByDefault:r}=(0,QT.useSelect)(m=>{let{getStylesPath:h,getShowStylebook:g}=q(m(I)),v=m(MSe.store).get("core","showListViewByDefault");return{stylesPath:h(),showStylebook:g(),showListViewByDefault:v}},[]),{resetStylesNavigation:o,setStylesPath:n}=q((0,QT.useDispatch)(I)),{setIsListViewOpened:i}=(0,QT.useDispatch)(I),s=(0,U3.useFocusOnMount)("firstElement"),l=(0,U3.useFocusReturn)(),c=null;t?c=(0,_g.jsx)(xSe,{path:e,onPathChange:n,ref:l}):e?.startsWith("/revisions")&&(c=(0,_g.jsx)(ESe,{path:e,ref:l}));let u=vY(e,t),d=()=>{i(r),o()};return(0,_g.jsx)("div",{className:"editor-styles-canvas",children:(0,_g.jsx)(fS,{enableResizing:!1,children:(0,_g.jsxs)("section",{className:"editor-styles-canvas__section",ref:s,onKeyDown:m=>{m.keyCode===NSe.ESCAPE&&!m.defaultPrevented&&(m.preventDefault(),d())},"aria-label":u,children:[(0,_g.jsx)(OSe.Button,{size:"compact",className:"editor-styles-canvas__close-button",icon:Fi,label:(0,H3.__)("Close"),onClick:d}),c]})})})}var DSe=a(Y(),1),bY=a(Nt(),1),yY=a(be(),1),LSe=a(ae(),1);function VSe(){return(0,DSe.useSelect)(e=>{let{getBlockAttributes:t,getBlockName:r,__experimentalGetParsedPattern:o}=e(yY.store),{getEditedEntityRecord:n,getCurrentTheme:i}=e(LSe.store),{getEditedContentOnlySection:s}=q(e(yY.store)),l=s();if(!l)return null;let c=t(l),u=c?.metadata?.patternName;if(u){let f=typeof o=="function"?o(u):null;return{patternName:u,patternTitle:f?.title||c?.metadata?.name,type:"pattern"}}let d=r(l);if(d==="core/block"&&c?.ref){let f=n("postType","wp_block",c.ref);if(f?.title)return{patternName:c.ref,patternTitle:(0,bY.decodeEntities)(f.title),type:"synced-pattern"}}if(d==="core/template-part"&&c?.slug){let f=c.theme||i()?.stylesheet,m=f?`${f}//${c.slug}`:null;if(m){let h=n("postType","wp_template_part",m);if(h?.title)return{patternName:c.slug,patternTitle:(0,bY.decodeEntities)(h.title),type:"template-part"}}}return null},[])}var Ks=a(T(),1),Nnt=lu.__unstableMotion.create(lu.Button);function G3(e){let{stopEditingContentOnlySection:t}=q((0,JT.useDispatch)($T.store)),r=VSe(),{postId:o,postType:n,postTypeLabel:i,documentTitle:s,isNotFound:l,templateTitle:c,onNavigateToPreviousEntityRecord:u,isTemplatePreview:d,stylesCanvasTitle:f}=(0,JT.useSelect)(C=>{let{getCurrentPostType:A,getCurrentPostId:P,getEditorSettings:R,getRenderingMode:N}=C(I),{getEditedEntityRecord:k,getPostType:E,getCurrentTheme:M,isResolving:V}=C(BSe.store),F=A(),D=P(),z=k("postType",F,D),{default_template_types:L=[]}=M()??{},O=Il({templateTypes:L,template:z}),B=E(F)?.labels?.singular_name,{getStylesPath:W,getShowStylebook:K}=q(C(I)),Z=W(),Q=K(),ue=vY(Z,Q);return{postId:D,postType:F,postTypeLabel:B,documentTitle:z.title,isNotFound:!z&&!V("getEditedEntityRecord","postType",F,D),templateTitle:O.title,onNavigateToPreviousEntityRecord:R().onNavigateToPreviousEntityRecord,isTemplatePreview:N()==="template-locked",stylesCanvasTitle:ue}},[]),{open:m}=(0,JT.useDispatch)(jSe.store),h=(0,zSe.useReducedMotion)(),g=z4.includes(n),v=!!u||!!r,b=g?c:s,_=r?.patternTitle||e.title||f||b,y=e.icon,w=C=>{C.stopPropagation(),r?t():u&&u()},S=A3(o),x=(0,W3.useRef)(!1);return(0,W3.useEffect)(()=>{x.current=!0},[]),(0,Ks.jsxs)("div",{className:J("editor-document-bar",{"has-back-button":v}),children:[(0,Ks.jsx)(lu.__unstableAnimatePresence,{children:v&&(0,Ks.jsx)(Nnt,{className:"editor-document-bar__back",icon:(0,Sg.isRTL)()?vV:mV,onClick:w,size:"compact",initial:x.current?{opacity:0,transform:"translateX(15%)"}:!1,animate:{opacity:1,transform:"translateX(0%)"},exit:{opacity:0,transform:"translateX(15%)"},transition:h?{duration:0}:void 0,children:(0,Sg.__)("Back")})}),!g&&d&&!v&&(0,Ks.jsx)($T.BlockIcon,{icon:Ka,className:"editor-document-bar__icon-layout"}),l?(0,Ks.jsx)(lu.__experimentalText,{children:(0,Sg.__)("Document not found")}):(0,Ks.jsx)(lu.Button,{className:"editor-document-bar__command",onClick:()=>m(),size:"compact",children:(0,Ks.jsxs)(lu.__unstableMotion.div,{className:"editor-document-bar__title",initial:x.current?{opacity:0,transform:v?"translateX(15%)":"translateX(-15%)"}:!1,animate:{opacity:1,transform:"translateX(0%)"},transition:h?{duration:0}:void 0,children:[y&&(0,Ks.jsx)($T.BlockIcon,{icon:y}),(0,Ks.jsxs)(lu.__experimentalText,{size:"body",as:"h1",children:[(0,Ks.jsx)("span",{className:"editor-document-bar__post-title",children:_?(0,USe.__unstableStripHTML)(_):(0,Sg.__)("No title")}),r&&(0,Ks.jsx)("span",{className:"editor-document-bar__post-type-label",children:r.type==="template-part"?`\xB7 ${(0,Sg.__)("Template Part")}`:`\xB7 ${(0,Sg.__)("Pattern")}`}),!r&&S&&(0,Ks.jsx)("span",{className:"editor-document-bar__post-type-label",children:`\xB7 ${S}`}),!r&&i&&!e.title&&!S&&(0,Ks.jsx)("span",{className:"editor-document-bar__post-type-label",children:`\xB7 ${(0,HSe.decodeEntities)(i)}`})]})]},v)})]})}var Cy=a(j(),1),pS=a(Y(),1),q3=a(U(),1),K3=a(vd(),1),Y3=a(be(),1),WSe=a(ae(),1),si=a(G(),1);var xy=a(T(),1),Mnt=({children:e,isValid:t,isDisabled:r,level:o,href:n,onSelect:i})=>{function s(l){if(r){l.preventDefault();return}i()}return(0,xy.jsx)("li",{className:J("document-outline__item",`is-${o.toLowerCase()}`,{"is-invalid":!t,"is-disabled":r}),children:(0,xy.jsxs)("a",{href:n,className:"document-outline__button","aria-disabled":r,onClick:s,children:[(0,xy.jsx)("span",{className:"document-outline__emdash","aria-hidden":"true"}),(0,xy.jsx)("strong",{className:"document-outline__level",children:o}),(0,xy.jsx)("span",{className:"document-outline__item-content",children:e})]})})},wY=Mnt;var dr=a(T(),1),Fnt=(0,dr.jsx)("em",{children:(0,Cy.__)("(Empty heading)")}),Dnt=[(0,dr.jsx)("br",{},"incorrect-break"),(0,dr.jsx)("em",{children:(0,Cy.__)("(Incorrect heading level)")},"incorrect-message")],Lnt=[(0,dr.jsx)("br",{},"incorrect-break-h1"),(0,dr.jsx)("em",{children:(0,Cy.__)("(Your theme may already use a H1 for the post title)")},"incorrect-message-h1")],Vnt=[(0,dr.jsx)("br",{},"incorrect-break-multiple-h1"),(0,dr.jsx)("em",{children:(0,Cy.__)("(Multiple H1 headings are not recommended)")},"incorrect-message-multiple-h1")];function Bnt(){return(0,dr.jsxs)(si.SVG,{width:"138",height:"148",viewBox:"0 0 138 148",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,dr.jsx)(si.Rect,{width:"138",height:"148",rx:"4",fill:"#F0F6FC"}),(0,dr.jsx)(si.Line,{x1:"44",y1:"28",x2:"24",y2:"28",stroke:"#DDDDDD"}),(0,dr.jsx)(si.Rect,{x:"48",y:"16",width:"27",height:"23",rx:"4",fill:"#DDDDDD"}),(0,dr.jsx)(si.Path,{d:"M54.7585 32V23.2727H56.6037V26.8736H60.3494V23.2727H62.1903V32H60.3494V28.3949H56.6037V32H54.7585ZM67.4574 23.2727V32H65.6122V25.0241H65.5611L63.5625 26.277V24.6406L65.723 23.2727H67.4574Z",fill:"black"}),(0,dr.jsx)(si.Line,{x1:"55",y1:"59",x2:"24",y2:"59",stroke:"#DDDDDD"}),(0,dr.jsx)(si.Rect,{x:"59",y:"47",width:"29",height:"23",rx:"4",fill:"#DDDDDD"}),(0,dr.jsx)(si.Path,{d:"M65.7585 63V54.2727H67.6037V57.8736H71.3494V54.2727H73.1903V63H71.3494V59.3949H67.6037V63H65.7585ZM74.6605 63V61.6705L77.767 58.794C78.0313 58.5384 78.2528 58.3082 78.4318 58.1037C78.6136 57.8991 78.7514 57.6989 78.8452 57.5028C78.9389 57.304 78.9858 57.0895 78.9858 56.8594C78.9858 56.6037 78.9276 56.3835 78.8111 56.1989C78.6946 56.0114 78.5355 55.8679 78.3338 55.7685C78.1321 55.6662 77.9034 55.6151 77.6477 55.6151C77.3807 55.6151 77.1477 55.669 76.9489 55.777C76.75 55.8849 76.5966 56.0398 76.4886 56.2415C76.3807 56.4432 76.3267 56.6832 76.3267 56.9616H74.5753C74.5753 56.3906 74.7045 55.8949 74.9631 55.4744C75.2216 55.054 75.5838 54.7287 76.0497 54.4986C76.5156 54.2685 77.0526 54.1534 77.6605 54.1534C78.2855 54.1534 78.8295 54.2642 79.2926 54.4858C79.7585 54.7045 80.1207 55.0085 80.3793 55.3977C80.6378 55.7869 80.767 56.233 80.767 56.7358C80.767 57.0653 80.7017 57.3906 80.571 57.7116C80.4432 58.0327 80.2145 58.3892 79.8849 58.7812C79.5554 59.1705 79.0909 59.6378 78.4915 60.1832L77.2173 61.4318V61.4915H80.8821V63H74.6605Z",fill:"black"}),(0,dr.jsx)(si.Line,{x1:"80",y1:"90",x2:"24",y2:"90",stroke:"#DDDDDD"}),(0,dr.jsx)(si.Rect,{x:"84",y:"78",width:"30",height:"23",rx:"4",fill:"#F0B849"}),(0,dr.jsx)(si.Path,{d:"M90.7585 94V85.2727H92.6037V88.8736H96.3494V85.2727H98.1903V94H96.3494V90.3949H92.6037V94H90.7585ZM99.5284 92.4659V91.0128L103.172 85.2727H104.425V87.2841H103.683L101.386 90.919V90.9872H106.564V92.4659H99.5284ZM103.717 94V92.0227L103.751 91.3793V85.2727H105.482V94H103.717Z",fill:"black"}),(0,dr.jsx)(si.Line,{x1:"66",y1:"121",x2:"24",y2:"121",stroke:"#DDDDDD"}),(0,dr.jsx)(si.Rect,{x:"70",y:"109",width:"29",height:"23",rx:"4",fill:"#DDDDDD"}),(0,dr.jsx)(si.Path,{d:"M76.7585 125V116.273H78.6037V119.874H82.3494V116.273H84.1903V125H82.3494V121.395H78.6037V125H76.7585ZM88.8864 125.119C88.25 125.119 87.6832 125.01 87.1861 124.791C86.6918 124.57 86.3011 124.266 86.0142 123.879C85.7301 123.49 85.5838 123.041 85.5753 122.533H87.4332C87.4446 122.746 87.5142 122.933 87.642 123.095C87.7727 123.254 87.946 123.378 88.1619 123.466C88.3778 123.554 88.6207 123.598 88.8906 123.598C89.1719 123.598 89.4205 123.548 89.6364 123.449C89.8523 123.349 90.0213 123.212 90.1435 123.036C90.2656 122.859 90.3267 122.656 90.3267 122.426C90.3267 122.193 90.2614 121.987 90.1307 121.808C90.0028 121.626 89.8182 121.484 89.5767 121.382C89.3381 121.28 89.054 121.229 88.7244 121.229H87.9105V119.874H88.7244C89.0028 119.874 89.2486 119.825 89.4616 119.729C89.6776 119.632 89.8452 119.499 89.9645 119.328C90.0838 119.155 90.1435 118.953 90.1435 118.723C90.1435 118.504 90.0909 118.312 89.9858 118.148C89.8835 117.98 89.7386 117.849 89.5511 117.756C89.3665 117.662 89.1506 117.615 88.9034 117.615C88.6534 117.615 88.4247 117.661 88.2173 117.751C88.0099 117.839 87.8438 117.966 87.7188 118.131C87.5938 118.295 87.527 118.489 87.5185 118.71H85.75C85.7585 118.207 85.902 117.764 86.1804 117.381C86.4588 116.997 86.8338 116.697 87.3054 116.482C87.7798 116.263 88.3153 116.153 88.9119 116.153C89.5142 116.153 90.0412 116.263 90.4929 116.482C90.9446 116.7 91.2955 116.996 91.5455 117.368C91.7983 117.737 91.9233 118.152 91.9205 118.612C91.9233 119.101 91.7713 119.509 91.4645 119.835C91.1605 120.162 90.7642 120.369 90.2756 120.457V120.526C90.9176 120.608 91.4063 120.831 91.7415 121.195C92.0795 121.555 92.2472 122.007 92.2443 122.55C92.2472 123.047 92.1037 123.489 91.8139 123.875C91.527 124.261 91.1307 124.565 90.625 124.787C90.1193 125.009 89.5398 125.119 88.8864 125.119Z",fill:"black"})]})}var jnt=(e=[])=>e.filter(t=>t.name==="core/heading").map(t=>({...t,level:t.attributes.level,isEmpty:znt(t)})),znt=e=>!e.attributes.content||e.attributes.content.trim().length===0;function mS({onSelect:e,hasOutlineItemsDisabled:t}){let{selectBlock:r}=(0,pS.useDispatch)(Y3.store),{title:o,isTitleSupported:n}=(0,pS.useSelect)(g=>{let{getEditedPostAttribute:v}=g(I),{getPostType:b}=g(WSe.store),_=b(v("type"));return{title:v("title"),isTitleSupported:_?.supports?.title??!1}}),i=(0,pS.useSelect)(g=>{let{getClientIdsWithDescendants:v,getBlock:b}=g(Y3.store);return v().map(y=>b(y))}),s=(0,pS.useSelect)(g=>{if(g(I).getRenderingMode()==="post-only")return;let{getBlocksByName:v,getClientIdsOfDescendants:b}=g(Y3.store),[_]=v("core/post-content");if(_)return b(_)},[]),l=(0,q3.useRef)(1),c=(0,q3.useMemo)(()=>jnt(i),[i]);if(c.length<1)return(0,dr.jsxs)("div",{className:"editor-document-outline has-no-headings",children:[(0,dr.jsx)(Bnt,{}),(0,dr.jsx)("p",{children:(0,Cy.__)("Navigate the structure of your document and address issues like empty or incorrect heading levels.")})]});let u=document.querySelector(".editor-post-title__input"),d=n&&o&&u,m=c.reduce((g,v)=>({...g,[v.level]:(g[v.level]||0)+1}),{})[1]>1;function h(g){return Array.isArray(s)?s.includes(g):!0}return(0,dr.jsx)("div",{className:"document-outline",children:(0,dr.jsxs)("ul",{children:[d&&(0,dr.jsx)(wY,{level:(0,Cy.__)("Title"),isValid:!0,onSelect:e,href:`#${u.id}`,isDisabled:t,children:o}),c.map(g=>{let v=g.level>l.current+1,b=!g.isEmpty&&!v&&!!g.level&&(g.level!==1||!m&&!d);return l.current=g.level,(0,dr.jsxs)(wY,{level:`H${g.level}`,isValid:b,isDisabled:t||!h(g.clientId),href:`#block-${g.clientId}`,onSelect:()=>{r(g.clientId),e?.()},children:[g.isEmpty?Fnt:(0,K3.getTextContent)((0,K3.create)({html:g.attributes.content})),v&&Dnt,g.level===1&&m&&Vnt,d&&g.level===1&&!m&&Lnt]},g.clientId)})]})})}var GSe=a(Y(),1),YSe=a(be(),1);function qSe({children:e}){return(0,GSe.useSelect)(r=>{let{getGlobalBlockCount:o}=r(YSe.store);return o("core/heading")>0})?e:null}var KSe=a(U(),1),ZSe=a(Y(),1),lc=a(j(),1),XSe=a(be(),1),QSe=a(xa(),1),JSe=a(Mo(),1),$Se=a(T(),1);function Hnt(){let{registerShortcut:e}=(0,ZSe.useDispatch)(QSe.store);return(0,KSe.useEffect)(()=>{e({name:"core/editor/toggle-mode",category:"global",description:(0,lc.__)("Switch between visual editor and code editor."),keyCombination:{modifier:"secondary",character:"m"}}),e({name:"core/editor/save",category:"global",description:(0,lc.__)("Save your changes."),keyCombination:{modifier:"primary",character:"s"}}),e({name:"core/editor/undo",category:"global",description:(0,lc.__)("Undo your last changes."),keyCombination:{modifier:"primary",character:"z"}}),e({name:"core/editor/redo",category:"global",description:(0,lc.__)("Redo your last undo."),keyCombination:{modifier:"primaryShift",character:"z"},aliases:(0,JSe.isAppleOS)()?[]:[{modifier:"primary",character:"y"}]}),e({name:"core/editor/toggle-list-view",category:"global",description:(0,lc.__)("Show or hide the List View."),keyCombination:{modifier:"access",character:"o"}}),e({name:"core/editor/toggle-distraction-free",category:"global",description:(0,lc.__)("Enter or exit distraction free mode."),keyCombination:{modifier:"primaryShift",character:"\\"}}),e({name:"core/editor/toggle-sidebar",category:"global",description:(0,lc.__)("Show or hide the Settings panel."),keyCombination:{modifier:"primaryShift",character:","}}),e({name:"core/editor/keyboard-shortcuts",category:"main",description:(0,lc.__)("Display these keyboard shortcuts."),keyCombination:{modifier:"access",character:"h"}}),e({name:"core/editor/new-note",category:"block",description:(0,lc.__)("Add a new note."),keyCombination:{modifier:"primaryAlt",character:"m"}}),e({name:"core/editor/next-region",category:"global",description:(0,lc.__)("Navigate to the next part of the editor."),keyCombination:{modifier:"ctrl",character:"`"},aliases:[{modifier:"access",character:"n"}]}),e({name:"core/editor/previous-region",category:"global",description:(0,lc.__)("Navigate to the previous part of the editor."),keyCombination:{modifier:"ctrlShift",character:"`"},aliases:[{modifier:"access",character:"p"},{modifier:"ctrlShift",character:"~"}]})},[e]),(0,$Se.jsx)(XSe.BlockEditorKeyboardShortcuts.Register,{})}var exe=Hnt;var Z3=a(j(),1),txe=a(G(),1),X3=a(Y(),1),eP=a(Mo(),1);var rxe=a(U(),1);var oxe=a(T(),1);function Unt(e,t){let r=(0,eP.isAppleOS)()?eP.displayShortcut.primaryShift("z"):eP.displayShortcut.primary("y"),o=(0,X3.useSelect)(i=>i(I).hasEditorRedo(),[]),{redo:n}=(0,X3.useDispatch)(I);return(0,oxe.jsx)(txe.Button,{__next40pxDefaultSize:!0,...e,ref:t,icon:(0,Z3.isRTL)()?gv:pv,label:(0,Z3.__)("Redo"),shortcut:r,"aria-disabled":!o,onClick:o?n:void 0,className:"editor-history__redo"})}var Q3=(0,rxe.forwardRef)(Unt);var J3=a(j(),1),nxe=a(G(),1),$3=a(Y(),1),ixe=a(Mo(),1);var sxe=a(U(),1);var axe=a(T(),1);function Wnt(e,t){let r=(0,$3.useSelect)(n=>n(I).hasEditorUndo(),[]),{undo:o}=(0,$3.useDispatch)(I);return(0,axe.jsx)(nxe.Button,{__next40pxDefaultSize:!0,...e,ref:t,icon:(0,J3.isRTL)()?pv:gv,label:(0,J3.__)("Undo"),shortcut:ixe.displayShortcut.primary("z"),"aria-disabled":!r,onClick:r?o:void 0,className:"editor-history__undo"})}var e6=(0,sxe.forwardRef)(Wnt);var cxe=a(qa(),1),uxe=a(Y(),1),dxe=a(be(),1),fxe=a(It(),1);var t6=a(G(),1),hS=a(j(),1),r6=a(Y(),1),lxe=a(U(),1),_Y=a(be(),1),Ey=a(T(),1);function o6(){let[e,t]=(0,lxe.useState)(!1),r=(0,r6.useSelect)(i=>i(_Y.store).isValidTemplate(),[]),{setTemplateValidity:o,synchronizeTemplate:n}=(0,r6.useDispatch)(_Y.store);return r?null:(0,Ey.jsxs)(Ey.Fragment,{children:[(0,Ey.jsx)(t6.Notice,{className:"editor-template-validation-notice",isDismissible:!1,status:"warning",actions:[{label:(0,hS.__)("Keep it as is"),onClick:()=>o(!0)},{label:(0,hS.__)("Reset the template"),onClick:()=>t(!0)}],children:(0,hS.__)("The content of your post doesn\u2019t match the template assigned to your post type.")}),(0,Ey.jsx)(t6.__experimentalConfirmDialog,{isOpen:e,confirmButtonText:(0,hS.__)("Reset"),onConfirm:()=>{t(!1),n()},onCancel:()=>t(!1),size:"medium",children:(0,hS.__)("Resetting the template may result in loss of content, do you want to continue?")})]})}var SY=a(T(),1);function Gnt(){(0,cxe.default)("wp.editor.EditorNotices",{since:"7.0",version:"7.2",alternative:"wp.notices.InlineNotices"});let e=(0,uxe.useSelect)(t=>t(dxe.store).isValidTemplate(),[]);return(0,SY.jsx)(fxe.InlineNotices,{pinnedNoticesClassName:"components-editor-notices__pinned",dismissibleNoticesClassName:"components-editor-notices__dismissible",children:!e&&(0,SY.jsx)(o6,{})})}var pxe=Gnt;var mxe=a(qa(),1),hxe=a(It(),1),gxe=a(T(),1);function vxe(){return(0,mxe.default)("wp.editor.EditorSnackbars",{since:"7.0",version:"7.2",alternative:"wp.notices.SnackbarNotices"}),(0,gxe.jsx)(hxe.SnackbarNotices,{className:"components-editor-notices__snackbar"})}var Bp=a(G(),1),Vp=a(j(),1),gS=a(U(),1),tP=a(Ce(),1),Cxe=a(Y(),1);var Ty=a(j(),1),EY=a(Y(),1),i6=a(G(),1),TY=a(ae(),1);var n6=a(G(),1),xY=a(j(),1),bxe=a(Y(),1),CY=a(ae(),1),yxe=a(Nt(),1);var Dp=a(T(),1);function wxe({record:e,checked:t,onChange:r}){let{name:o,kind:n,title:i,key:s}=e,{entityRecordTitle:l,hasPostMetaChanges:c}=(0,bxe.useSelect)(u=>{if(n!=="postType"||o!=="wp_template")return{entityRecordTitle:i,hasPostMetaChanges:q(u(I)).hasPostMetaChanges(o,s)};let d=u(CY.store).getEditedEntityRecord(n,o,s),{default_template_types:f=[]}=u(CY.store).getCurrentTheme()??{};return{entityRecordTitle:Il({template:d,templateTypes:f}).title,hasPostMetaChanges:q(u(I)).hasPostMetaChanges(o,s)}},[o,n,i,s]);return(0,Dp.jsxs)(Dp.Fragment,{children:[(0,Dp.jsx)(n6.PanelRow,{children:(0,Dp.jsx)(n6.CheckboxControl,{label:(0,yxe.decodeEntities)(l)||(0,xY.__)("Untitled"),checked:t,onChange:r,className:"entities-saved-states__change-control"})}),c&&(0,Dp.jsx)("ul",{className:"entities-saved-states__changes",children:(0,Dp.jsx)("li",{children:(0,xY.__)("Post Meta.")})})]})}var Lp=a(T(),1);function Ynt(e,t){switch(e){case"site":return t===1?(0,Ty.__)("This change will affect your whole site."):(0,Ty.__)("These changes will affect your whole site.");case"wp_template":return(0,Ty.__)("This change will affect other parts of your site that use this template.");case"page":case"post":return(0,Ty.__)("The following has been modified.")}}function qnt({record:e}){let{editedRecord:t,savedRecord:r}=(0,EY.useSelect)(n=>{let{getEditedEntityRecord:i,getEntityRecord:s}=n(TY.store);return{editedRecord:i(e.kind,e.name,e.key),savedRecord:s(e.kind,e.name,e.key)}},[e.kind,e.name,e.key]),o=N1(t,r,{maxResults:10});return o.length?(0,Lp.jsx)("ul",{className:"entities-saved-states__changes",children:o.map(n=>(0,Lp.jsx)("li",{children:n},n))}):null}function Knt({record:e,count:t}){if(e?.name==="globalStyles")return null;let r=Ynt(e?.name,t);return r?(0,Lp.jsx)(i6.PanelRow,{children:r}):null}function _xe({list:e,unselectedEntities:t,setUnselectedEntities:r}){let o=e.length,n=e[0],s=(0,EY.useSelect)(l=>l(TY.store).getEntityConfig(n.kind,n.name),[n.kind,n.name]).label;return n?.name==="wp_template_part"&&(s=o===1?(0,Ty.__)("Template Part"):(0,Ty.__)("Template Parts")),(0,Lp.jsxs)(i6.PanelBody,{title:s,initialOpen:!0,className:"entities-saved-states__panel-body",children:[(0,Lp.jsx)(Knt,{record:n,count:o}),e.map(l=>(0,Lp.jsx)(wxe,{record:l,checked:!t.some(c=>c.kind===l.kind&&c.name===l.name&&c.key===l.key&&c.property===l.property),onChange:c=>r(l,c)},l.key||l.property)),n?.name==="globalStyles"&&(0,Lp.jsx)(qnt,{record:n})]})}var Sxe=a(Y(),1),xxe=a(ae(),1),s6=a(U(),1),a6=()=>{let{editedEntities:e,siteEdits:t,siteEntityConfig:r}=(0,Sxe.useSelect)(c=>{let{__experimentalGetDirtyEntityRecords:u,getEntityRecordEdits:d,getEntityConfig:f}=c(xxe.store);return{editedEntities:u(),siteEdits:d("root","site"),siteEntityConfig:f("root","site")}},[]),o=(0,s6.useMemo)(()=>{let c=e.filter(_=>!(_.kind==="root"&&_.name==="site")),u=r?.meta?.labels??{},{title:d,description:f,site_logo:m,site_icon:h,...g}=t??{},b=[d!==void 0&&"title",f!==void 0&&"description",m!==void 0&&"site_logo",h!==void 0&&"site_icon",...Object.keys(g)].filter(Boolean).map(_=>({kind:"root",name:"site",title:u[_]||_,property:_}));return[...c,...b]},[e,t,r]),[n,i]=(0,s6.useState)([]),s=({kind:c,name:u,key:d,property:f},m)=>{i(m?n.filter(h=>h.kind!==c||h.name!==u||h.key!==d||h.property!==f):[...n,{kind:c,name:u,key:d,property:f}])},l=o.length-n.length>0;return{dirtyEntityRecords:o,isDirty:l,setUnselectedEntities:s,unselectedEntities:n}};var ai=a(T(),1);function l6({close:e,renderDialog:t,variant:r}){let o=a6();return(0,ai.jsx)(rP,{close:e,renderDialog:t,variant:r,...o})}function rP({additionalPrompt:e=void 0,close:t,onSave:r=void 0,saveEnabled:o=void 0,saveLabel:n=(0,Vp.__)("Save"),renderDialog:i,dirtyEntityRecords:s,isDirty:l,setUnselectedEntities:c,unselectedEntities:u,variant:d="default",successNoticeContent:f}){let m=(0,gS.useRef)(),{saveDirtyEntities:h}=q((0,Cxe.useDispatch)(I)),g=s.reduce((M,V)=>{let{name:F}=V;return M[F]||(M[F]=[]),M[F].push(V),M},{}),{site:v,wp_template:b,wp_template_part:_,...y}=g,w=[v,b,_,...Object.values(y)].filter(Array.isArray),S=o??l,x=(0,gS.useCallback)(()=>t(),[t]),[C,A]=(0,tP.__experimentalUseDialog)({onClose:()=>x()}),P=(0,tP.useInstanceId)(rP,"entities-saved-states__panel-label"),R=(0,tP.useInstanceId)(rP,"entities-saved-states__panel-description"),N=s.length?(0,Vp.__)("Select the items you want to save."):void 0,k=d==="inline",E=(0,ai.jsxs)(ai.Fragment,{children:[(0,ai.jsx)(Bp.FlexItem,{isBlock:!k,as:Bp.Button,variant:k?"tertiary":"secondary",size:k?void 0:"compact",onClick:x,children:(0,Vp.__)("Cancel")}),(0,ai.jsx)(Bp.FlexItem,{isBlock:!k,as:Bp.Button,ref:m,variant:"primary",size:k?void 0:"compact",disabled:!S,accessibleWhenDisabled:!0,onClick:()=>h({onSave:r,dirtyEntityRecords:s,entitiesToSkip:u,close:t,successNoticeContent:f}),className:"editor-entities-saved-states__save-button",children:n})]});return(0,ai.jsxs)("div",{ref:i?C:void 0,...i&&A,className:J("entities-saved-states__panel",{"is-inline":k}),role:i?"dialog":void 0,"aria-labelledby":i?P:void 0,"aria-describedby":i?R:void 0,children:[!k&&(0,ai.jsx)(Bp.Flex,{className:"entities-saved-states__panel-header",gap:2,children:E}),(0,ai.jsxs)("div",{className:"entities-saved-states__text-prompt",children:[(0,ai.jsx)("div",{className:"entities-saved-states__text-prompt--header-wrapper",children:(0,ai.jsx)("strong",{id:i?P:void 0,className:"entities-saved-states__text-prompt--header",children:(0,Vp.__)("Are you ready to save?")})}),(0,ai.jsxs)("div",{id:i?R:void 0,children:[e,(0,ai.jsx)("p",{className:"entities-saved-states__text-prompt--changes-count",children:l?(0,gS.createInterpolateElement)((0,Vp.sprintf)((0,Vp._n)("There is %d site change waiting to be saved.","There are %d site changes waiting to be saved.",s.length),s.length),{strong:(0,ai.jsx)("strong",{})}):N})]})]}),w.map(M=>(0,ai.jsx)(_xe,{list:M,unselectedEntities:u,setUnselectedEntities:c},M[0].name)),k&&(0,ai.jsx)(Bp.Flex,{direction:"row",justify:"flex-end",className:"entities-saved-states__panel-footer",children:E})]})}var Txe=a(U(),1),c6=a(j(),1),Py=a(G(),1),Pxe=a(Y(),1),kxe=a(Ce(),1),Rxe=a(zn(),1);var xg=a(T(),1);function Znt(){try{return(0,Pxe.select)(I).getEditedPostContent()}catch{}}function Exe({text:e,children:t,variant:r="secondary"}){let o=(0,kxe.useCopyToClipboard)(e);return(0,xg.jsx)(Py.Button,{__next40pxDefaultSize:!0,variant:r,ref:o,children:t})}var Xnt=class extends Txe.Component{constructor(){super(...arguments),this.state={error:null}}componentDidCatch(e){(0,Rxe.doAction)("editor.ErrorBoundary.errorLogged",e)}static getDerivedStateFromError(e){return{error:e}}render(){let{error:e}=this.state,{canCopyContent:t=!1}=this.props;return e?(0,xg.jsxs)(Py.__experimentalHStack,{className:"editor-error-boundary",alignment:"baseline",spacing:4,justify:"space-between",expanded:!1,wrap:!0,children:[(0,xg.jsx)(Py.__experimentalText,{as:"p",children:(0,c6.__)("The editor has encountered an unexpected error.")}),(0,xg.jsxs)(Py.__experimentalHStack,{expanded:!1,children:[t&&(0,xg.jsx)(Exe,{text:Znt,children:(0,c6.__)("Copy contents")}),(0,xg.jsx)(Exe,{variant:"primary",text:e?.stack,children:(0,c6.__)("Copy error")})]})]}):this.props.children}},Axe=Xnt;var jp=a(U(),1),nP=a(Ce(),1),Cg=a(Y(),1),PY=a(j(),1),Ixe=a(Pt(),1),Oxe=a(It(),1);var Nxe=a(T(),1),Qnt=window.requestIdleCallback?window.requestIdleCallback:window.requestAnimationFrame,oP,Jnt=()=>{if(oP!==void 0)return oP;try{window.sessionStorage.setItem("__wpEditorTestSessionStorage",""),window.sessionStorage.removeItem("__wpEditorTestSessionStorage"),oP=!0}catch{oP=!1}return oP};function $nt(){let e=(0,Cg.useRegistry)(),{postId:t,isEditedPostNew:r}=(0,Cg.useSelect)(o=>({postId:o(I).getCurrentPostId(),isEditedPostNew:o(I).isEditedPostNew()}),[]);(0,jp.useEffect)(()=>{let o=zX(t,r);if(!o)return;try{o=JSON.parse(o)}catch{return}let{post_title:n,content:i,excerpt:s}=o,l={title:n,content:i,excerpt:s},{getEditedPostAttribute:c,getEditorSettings:u}=e.select(I);if(!Object.keys(l).some(_=>l[_]!==c(_))){M2(t,r);return}if(!!u().autosave)return;let{createWarningNotice:m,removeNotice:h}=e.dispatch(Oxe.store),{editPost:g,resetEditorBlocks:v}=e.dispatch(I),b="wpEditorAutosaveRestore";m((0,PY.__)("The backup of this post in your browser is different from the version below."),{id:b,actions:[{label:(0,PY.__)("Restore the backup"),onClick(){let{content:_,...y}=l;g(y),v((0,Ixe.parse)(l.content)),h(b)}}]})},[e,t,r])}function eit(){let{postId:e,isEditedPostNew:t,isDirty:r,isAutosaving:o,didError:n}=(0,Cg.useSelect)(u=>({postId:u(I).getCurrentPostId(),isEditedPostNew:u(I).isEditedPostNew(),isDirty:u(I).isEditedPostDirty(),isAutosaving:u(I).isAutosavingPost(),didError:u(I).didPostSaveRequestFail()}),[]),i=(0,jp.useRef)(r),s=(0,jp.useRef)(o);(0,jp.useEffect)(()=>{!n&&(s.current&&!o||i.current&&!r)&&M2(e,t),i.current=r,s.current=o},[r,o,n]);let l=(0,nP.usePrevious)(t),c=(0,nP.usePrevious)(e);(0,jp.useEffect)(()=>{c===e&&l&&!t&&M2(e,!0)},[t,e])}function tit(){let{autosave:e}=(0,Cg.useDispatch)(I),t=(0,jp.useCallback)(()=>{Qnt(()=>e({local:!0}))},[]);$nt(),eit();let r=(0,Cg.useSelect)(o=>o(I).getEditorSettings().localAutosaveInterval,[]);return(0,Nxe.jsx)(R3,{interval:r,autosave:t})}var Mxe=(0,nP.ifCondition)(Jnt)(tit);var Fxe=a(Y(),1),Dxe=a(ae(),1);function rit({children:e}){return(0,Fxe.useSelect)(r=>{let{getEditedPostAttribute:o}=r(I),{getPostType:n}=r(Dxe.store);return!!n(o("type"))?.supports?.["page-attributes"]},[])?e:null}var vS=rit;var kY=a(j(),1),yS=a(G(),1),u6=a(Y(),1),Bxe=a(U(),1);var Lxe=a(Y(),1),Vxe=a(ae(),1);function oit(e={},t){if(e[t]!==void 0)return!!e[t];let[r,o]=t.split("."),[n]=Array.isArray(e[r])?e[r]:[];return Array.isArray(n)?n.includes(o):!!n?.[o]}function nit({children:e,supportKeys:t}){let r=(0,Lxe.useSelect)(n=>{let{getEditedPostAttribute:i}=n(I),{getPostType:s}=n(Vxe.store);return s(i("type"))},[]),o=!!r;return r&&(o=(Array.isArray(t)?t:[t]).some(n=>oit(r.supports,n))),o?e:null}var uo=nit;var bS=a(T(),1);function iit(){let e=(0,u6.useSelect)(s=>s(I).getEditedPostAttribute("menu_order")??0,[]),{editPost:t}=(0,u6.useDispatch)(I),[r,o]=(0,Bxe.useState)(null),n=s=>{o(s);let l=Number(s);Number.isInteger(l)&&s.trim?.()!==""&&t({menu_order:l})},i=r??e;return(0,bS.jsx)(yS.Flex,{children:(0,bS.jsx)(yS.FlexBlock,{children:(0,bS.jsx)(yS.__experimentalNumberControl,{label:(0,kY.__)("Order"),help:(0,kY.__)("Set the page order."),value:i,onChange:n,hideLabelFromVision:!0,onBlur:()=>{o(null)}})})})}function jxe(){return(0,bS.jsx)(uo,{supportKeys:"page-attributes",children:(0,bS.jsx)(iit,{})})}var Jxe=a(Y(),1),$xe=a(ae(),1);var AY=a(pw(),1),Ma=a(j(),1),Eg=a(G(),1),Yxe=a(Ce(),1),Zd=a(U(),1),_S=a(Y(),1),OY=a(Nt(),1),f6=a(ae(),1),qxe=a(be(),1),Kxe=a(vo(),1);var zxe=a(G(),1),Hxe=a(U(),1),iP=a(T(),1),sit=(0,Hxe.forwardRef)(({className:e,label:t,children:r},o)=>(0,iP.jsxs)(zxe.__experimentalHStack,{className:J("editor-post-panel__row",e),ref:o,children:[t&&(0,iP.jsx)("div",{className:"editor-post-panel__row-label",children:t}),(0,iP.jsx)("div",{className:"editor-post-panel__row-control",children:r})]})),fr=sit;var Uxe=a(Nt(),1);function d6(e){let t=e.map(n=>({children:[],parent:void 0,...n}));if(t.some(({parent:n})=>n===void 0))return t;let r=t.reduce((n,i)=>{let{parent:s}=i;return n[s]||(n[s]=[]),n[s].push(i),n},{}),o=n=>n.map(i=>{let s=r[i.id];return{...i,children:s&&s.length?o(s):[]}});return o(r[0]||[])}var wS=e=>(0,Uxe.decodeEntities)(e),RY=e=>({...e,name:wS(e.name)}),Wxe=e=>(e??[]).map(RY);var Na=a(T(),1);function IY(e){return e?.title?.rendered?(0,OY.decodeEntities)(e.title.rendered):`#${e.id} (${(0,Ma.__)("no title")})`}var Gxe=(e,t)=>{let r=(0,AY.default)(e||"").toLowerCase(),o=(0,AY.default)(t||"").toLowerCase();return r===o?0:r.startsWith(o)?r.length:1/0};function Zxe(){let{editPost:e}=(0,_S.useDispatch)(I),[t,r]=(0,Zd.useState)(""),{isHierarchical:o,parentPostId:n,parentPostTitle:i,pageItems:s,isLoading:l}=(0,_S.useSelect)(f=>{let{getPostType:m,getEntityRecords:h,getEntityRecord:g,isResolving:v}=f(f6.store),{getCurrentPostId:b,getEditedPostAttribute:_}=f(I),y=_("type"),w=_("parent"),S=m(y),x=b(),C=S?.hierarchical??!1,A={per_page:100,exclude:x,parent_exclude:x,orderby:"menu_order",order:"asc",_fields:"id,title,parent"};t&&(A.search=t,A.orderby="relevance",A.search_columns=["post_title"]);let P=w?g("postType",y,w):null;return{isHierarchical:C,parentPostId:w,parentPostTitle:P?IY(P):"",pageItems:C?h("postType",y,A):null,isLoading:C?v("getEntityRecords",["postType",y,A]):!1}},[t]),c=(0,Zd.useMemo)(()=>{let f=(v,b=0)=>v.map(w=>[{value:w.id,label:"\u2014 ".repeat(b)+(0,OY.decodeEntities)(w.name),rawName:w.name},...f(w.children||[],b+1)]).sort(([w],[S])=>{let x=Gxe(w.rawName,t),C=Gxe(S.rawName,t);return x>=C?1:-1}).flat();if(!s)return[];let m=s.map(v=>({id:v.id,parent:v.parent,name:IY(v)}));t||(m=d6(m));let h=f(m),g=h.find(v=>v.value===n);return i&&!g&&h.unshift({value:n,label:i}),h},[s,t,i,n]);if(!o)return null;let u=f=>{r(f)},d=f=>{e({parent:f})};return(0,Na.jsx)(Eg.ComboboxControl,{className:"editor-page-attributes__parent",label:(0,Ma.__)("Parent"),help:(0,Ma.__)("Choose a parent page."),value:n,options:c,onFilterValueChange:(0,Yxe.debounce)(u,300),onChange:d,hideLabelFromVision:!0,isLoading:l})}function ait({isOpen:e,onClick:t}){let r=(0,_S.useSelect)(n=>{let{getEditedPostAttribute:i}=n(I),s=i("parent");if(!s)return null;let{getEntityRecord:l}=n(f6.store),c=i("type");return l("postType",c,s)},[]),o=(0,Zd.useMemo)(()=>r?IY(r):(0,Ma.__)("None"),[r]);return(0,Na.jsx)(Eg.Button,{size:"compact",className:"editor-post-parent__panel-toggle",variant:"tertiary","aria-expanded":e,"aria-label":(0,Ma.sprintf)((0,Ma.__)("Change parent: %s"),o),onClick:t,children:o})}function Xxe(){let e=(0,_S.useSelect)(n=>n(f6.store).getEntityRecord("root","__unstableBase")?.home,[]),[t,r]=(0,Zd.useState)(null),o=(0,Zd.useMemo)(()=>({anchor:t,placement:"left-start",offset:36,shift:!0}),[t]);return(0,Na.jsx)(fr,{label:(0,Ma.__)("Parent"),ref:r,children:(0,Na.jsx)(Eg.Dropdown,{popoverProps:o,className:"editor-post-parent__panel-dropdown",contentClassName:"editor-post-parent__panel-dialog",focusOnMount:!0,renderToggle:({isOpen:n,onToggle:i})=>(0,Na.jsx)(ait,{isOpen:n,onClick:i}),renderContent:({onClose:n})=>(0,Na.jsxs)("div",{className:"editor-post-parent",children:[(0,Na.jsx)(qxe.__experimentalInspectorPopoverHeader,{title:(0,Ma.__)("Parent"),onClose:n}),(0,Na.jsxs)("div",{children:[(0,Zd.createInterpolateElement)((0,Ma.sprintf)((0,Ma.__)('Child pages inherit characteristics from their parent, such as URL structure. For instance, if "Pricing" is a child of "Services", its URL would be %s/services/pricing.'),(0,Kxe.filterURLForDisplay)(e).replace(/([/.])/g,"$1")),{wbr:(0,Na.jsx)("wbr",{})}),(0,Na.jsx)("p",{children:(0,Zd.createInterpolateElement)((0,Ma.__)("They also show up as sub-items in the default navigation menu. Learn more."),{a:(0,Na.jsx)(Eg.ExternalLink,{href:(0,Ma.__)("https://wordpress.org/documentation/article/page-post-settings-sidebar/#page-attributes")})})})]}),(0,Na.jsx)(Zxe,{})]})})})}var Qxe=Zxe;var p6=a(T(),1),lit="page-attributes";function cit(){let{isEnabled:e,postType:t}=(0,Jxe.useSelect)(r=>{let{getEditedPostAttribute:o,isEditorPanelEnabled:n}=r(I),{getPostType:i}=r($xe.store);return{isEnabled:n(lit),postType:i(o("type"))}},[]);return!e||!t?null:(0,p6.jsx)(Xxe,{})}function m6(){return(0,p6.jsx)(vS,{children:(0,p6.jsx)(cit,{})})}var cc=a(j(),1),Hp=a(G(),1),xS=a(Y(),1),DY=a(ae(),1),r1e=a(be(),1),CS=a(U(),1);var o1e=a(It(),1);var h6=a(Y(),1),MY=a(U(),1),cu=a(Pt(),1),uu=a(G(),1),ky=a(j(),1);var zp=a(T(),1),NY=(0,ky.__)("Custom Template");function Tg({onClose:e}){let{defaultBlockTemplate:t,onNavigateToEntityRecord:r}=(0,h6.useSelect)(d=>{let{getEditorSettings:f,getCurrentTemplateId:m}=d(I);return{defaultBlockTemplate:f().defaultBlockTemplate,onNavigateToEntityRecord:f().onNavigateToEntityRecord,getTemplateId:m}}),{createTemplate:o}=q((0,h6.useDispatch)(I)),[n,i]=(0,MY.useState)(""),[s,l]=(0,MY.useState)(!1),c=()=>{i(""),e()},u=async d=>{if(d.preventDefault(),s)return;l(!0);let f=t??(0,cu.serialize)([(0,cu.createBlock)("core/group",{tagName:"header",layout:{inherit:!0}},[(0,cu.createBlock)("core/site-title"),(0,cu.createBlock)("core/site-tagline")]),(0,cu.createBlock)("core/separator"),(0,cu.createBlock)("core/group",{tagName:"main"},[(0,cu.createBlock)("core/group",{layout:{inherit:!0}},[(0,cu.createBlock)("core/post-title")]),(0,cu.createBlock)("core/post-content",{layout:{inherit:!0}})])]),m=await o({slug:Jv(n||NY)||"wp-custom-template",content:f,title:n||NY,status:"publish"});l(!1),r({postId:m.id,postType:"wp_template"}),c()};return(0,zp.jsx)(uu.Modal,{title:(0,ky.__)("Create custom template"),onRequestClose:c,focusOnMount:"firstContentElement",size:"small",overlayClassName:"editor-post-template__create-template-modal",children:(0,zp.jsx)("form",{onSubmit:u,children:(0,zp.jsxs)(uu.__experimentalVStack,{spacing:"3",children:[(0,zp.jsx)(uu.TextControl,{label:(0,ky.__)("Name"),value:n,onChange:i,placeholder:NY,disabled:s,help:(0,ky.__)('Describe the template, e.g. "Post with sidebar". A custom template can be manually applied to any post or page.')}),(0,zp.jsxs)(uu.__experimentalHStack,{justify:"right",children:[(0,zp.jsx)(uu.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:c,children:(0,ky.__)("Cancel")}),(0,zp.jsx)(uu.Button,{__next40pxDefaultSize:!0,variant:"primary",type:"submit",isBusy:s,"aria-disabled":s,children:(0,ky.__)("Create")})]})]})})})}var Ry=a(Y(),1),e1e=a(U(),1),Pg=a(ae(),1),g6=a(j(),1);function Ay(){return(0,Ry.useSelect)(e=>{let{getCurrentPostId:t,getCurrentPostType:r}=e(I);return{postId:t(),postType:r()}},[])}function Iy(){let{postType:e,postId:t}=Ay();return(0,Ry.useSelect)(r=>{let{canUser:o,getEntityRecord:n,getEntityRecords:i}=r(Pg.store),s=o("read",{kind:"root",name:"site"})?n("root","site"):void 0,l=+t===s?.page_for_posts,c=e==="page"&&+t===s?.page_on_front,u=c?i("postType","wp_template",{per_page:-1}):[],d=c&&!!u?.some(({slug:f})=>f==="front-page");return!l&&!d},[t,e])}function t1e(e){return(0,Ry.useSelect)(t=>t(Pg.store).getEntityRecords("postType","wp_template",{per_page:-1,post_type:e}),[e])}function sP(){let{postType:e,postId:t}=Ay(),[r]=(0,Pg.useEntityProp)("postType",e,"slug",t),o=FY(),n=Iy(),i=t1e(e),s=(0,Ry.useSelect)(l=>{if(!window?.__experimentalDataFormInspector||!o)return null;let{getDefaultTemplateId:c,getEntityRecord:u}=l(Pg.store),d;r?d=e==="page"?`${e}-${r}`:`single-${e}-${r}`:d=e==="page"?"page":`single-${e}`;let f=c({slug:d});return f?u("postType","wp_template",f):null},[o,r,e]);return(0,e1e.useMemo)(()=>n&&[...(i||[]).filter(l=>l.is_custom&&l.slug!==o&&!!l.content.raw),s&&{...s,title:{rendered:(0,g6.sprintf)((0,g6.__)("%s (default)"),s.title.rendered)},isDefault:!0}].filter(Boolean),[i,s,o,n])}function SS(){return(0,Ry.useSelect)(e=>{let{getEditorSettings:t,getCurrentTemplateId:r,getCurrentPostType:o}=e(I),{getPostType:n,canUser:i}=e(Pg.store),s=o(),l=n(s),c=t(),u=c.__unstableIsBlockBasedTheme,d=!!c.availableTemplates&&Object.keys(c.availableTemplates).length>0,f;l?.viewable?d?f=!0:c.supportsTemplateMode?f=i("create",{kind:"postType",name:"wp_template"})??!1:f=!1:f=!1;let m=f?!!i("read",{kind:"postType",name:"wp_template"}):!1;return(!u||!m)&&f?"classic":u&&r()?"block-theme":null},[])}function FY(){let{postType:e,postId:t}=Ay(),r=t1e(e),o=(0,Ry.useSelect)(n=>n(Pg.store).getEditedEntityRecord("postType",e,t)?.template,[e,t]);if(o)return r?.find(n=>n.slug===o)?.slug}var Fa=a(T(),1);function uit({isOpen:e,onClick:t}){let r=(0,xS.useSelect)(o=>{let n=o(I).getEditedPostAttribute("template"),{supportsTemplateMode:i,availableTemplates:s}=o(I).getEditorSettings();if(!i&&s[n])return s[n];let l=o(DY.store).canUser("create",{kind:"postType",name:"wp_template"})&&o(I).getCurrentTemplateId();return l?.title||l?.slug||s?.[n]},[]);return(0,Fa.jsx)(Hp.Button,{__next40pxDefaultSize:!0,variant:"tertiary","aria-expanded":e,"aria-label":(0,cc.__)("Template options"),onClick:t,children:r??(0,cc.__)("Default template")})}function dit({onClose:e}){let t=Iy(),{availableTemplates:r,fetchedTemplates:o,selectedTemplateSlug:n,canCreate:i,canEdit:s,currentTemplateId:l,onNavigateToEntityRecord:c,getEditorSettings:u}=(0,xS.useSelect)(b=>{let{canUser:_,getEntityRecords:y}=b(DY.store),w=b(I).getEditorSettings(),S=_("create",{kind:"postType",name:"wp_template"}),x=b(I).getCurrentTemplateId();return{availableTemplates:w.availableTemplates,fetchedTemplates:S?y("postType","wp_template",{post_type:b(I).getCurrentPostType(),per_page:-1}):void 0,selectedTemplateSlug:b(I).getEditedPostAttribute("template"),canCreate:t&&S&&w.supportsTemplateMode,canEdit:t&&S&&w.supportsTemplateMode&&!!x,currentTemplateId:x,onNavigateToEntityRecord:w.onNavigateToEntityRecord,getEditorSettings:b(I).getEditorSettings}},[t]),d=(0,CS.useMemo)(()=>Object.entries({...r,...Object.fromEntries((o??[]).map(({slug:b,title:_})=>[b,_.rendered]))}).map(([b,_])=>({value:b,label:_})),[r,o]),f=d.find(b=>b.value===n)??d.find(b=>!b.value),{editPost:m}=(0,xS.useDispatch)(I),{createSuccessNotice:h}=(0,xS.useDispatch)(o1e.store),[g,v]=(0,CS.useState)(!1);return(0,Fa.jsxs)("div",{className:"editor-post-template__classic-theme-dropdown",children:[(0,Fa.jsx)(r1e.__experimentalInspectorPopoverHeader,{title:(0,cc.__)("Template"),help:(0,cc.__)("Templates define the way content is displayed when viewing your site."),actions:i?[{icon:U4,label:(0,cc.__)("Add template"),onClick:()=>v(!0)}]:[],onClose:e}),t?(0,Fa.jsx)(Hp.SelectControl,{hideLabelFromVision:!0,label:(0,cc.__)("Template"),value:f?.value??"",options:d,onChange:b=>m({template:b||""})}):(0,Fa.jsx)(Hp.Notice,{status:"warning",isDismissible:!1,children:(0,cc.__)("The posts page template cannot be changed.")}),s&&c&&(0,Fa.jsx)("p",{children:(0,Fa.jsx)(Hp.Button,{__next40pxDefaultSize:!0,variant:"link",onClick:()=>{c({postId:l,postType:"wp_template"}),e(),h((0,cc.__)("Editing template. Changes made here affect all posts and pages that use the template."),{type:"snackbar",actions:[{label:(0,cc.__)("Go back"),onClick:()=>u().onNavigateToPreviousEntityRecord()}]})},children:(0,cc.__)("Edit template")})}),g&&(0,Fa.jsx)(Tg,{onClose:()=>v(!1)})]})}function fit(){let[e,t]=(0,CS.useState)(null),r=(0,CS.useMemo)(()=>({anchor:e,className:"editor-post-template__dropdown",placement:"left-start",offset:36,shift:!0}),[e]);return(0,Fa.jsx)(fr,{label:(0,cc.__)("Template"),ref:t,children:(0,Fa.jsx)(Hp.Dropdown,{popoverProps:r,focusOnMount:!0,renderToggle:({isOpen:o,onToggle:n})=>(0,Fa.jsx)(uit,{isOpen:o,onClick:n}),renderContent:({onClose:o})=>(0,Fa.jsx)(dit,{onClose:o})})})}var v6=fit;var w6=a(G(),1),l1e=a(zh(),1),_6=a(Y(),1),c1e=a(ZU(),1);var s1e=a(G(),1);var b6=a(Y(),1),n1e=a(Lt(),1);var i1e=a(T(),1),{PreferenceBaseOption:pit}=q(n1e.privateApis);function kg(e){let{toggleEditorPanelEnabled:t}=(0,b6.useDispatch)(I),{isChecked:r,isRemoved:o}=(0,b6.useSelect)(n=>{let{isEditorPanelEnabled:i,isEditorPanelRemoved:s}=n(I);return{isChecked:i(e.panelName),isRemoved:s(e.panelName)}},[e.panelName]);return o?null:(0,i1e.jsx)(pit,{isChecked:r,onChange:()=>t(e.panelName),...e})}var LY=a(T(),1),{Fill:mit,Slot:hit}=(0,s1e.createSlotFill)("EnablePluginDocumentSettingPanelOption"),a1e=({label:e,panelName:t})=>(0,LY.jsx)(mit,{children:(0,LY.jsx)(kg,{label:e,panelName:t})});a1e.Slot=hit;var y6=a1e;var Rg=a(T(),1),{Fill:git,Slot:vit}=(0,w6.createSlotFill)("PluginDocumentSettingPanel"),u1e=({name:e,className:t,title:r,icon:o,children:n})=>{let{name:i}=(0,l1e.usePluginContext)(),s=`${i}/${e}`,{opened:l,isEnabled:c}=(0,_6.useSelect)(d=>{let{isEditorPanelOpened:f,isEditorPanelEnabled:m}=d(I);return{opened:f(s),isEnabled:m(s)}},[s]),{toggleEditorPanelOpened:u}=(0,_6.useDispatch)(I);return e===void 0&&(0,c1e.default)("PluginDocumentSettingPanel requires a name property."),(0,Rg.jsxs)(Rg.Fragment,{children:[(0,Rg.jsx)(y6,{label:r,panelName:s}),(0,Rg.jsx)(git,{children:c&&(0,Rg.jsx)(w6.PanelBody,{className:t,title:r,icon:o,opened:l,onToggle:()=>u(s),children:n})})]})};u1e.Slot=vit;var S6=u1e;var d1e=a(be(),1),f1e=a(G(),1),p1e=a(Ce(),1),VY=a(T(),1),bit=(e,t)=>e.filter(r=>!t.includes(r)).length===0,yit=(e,t)=>!Array.isArray(t)||bit(e,t),wit=({allowedBlocks:e,icon:t,label:r,onClick:o,small:n,role:i})=>(0,VY.jsx)(d1e.BlockSettingsMenuControls,{children:({selectedBlocks:s,onClose:l})=>yit(s,e)?(0,VY.jsx)(f1e.MenuItem,{onClick:(0,p1e.compose)(o,l),icon:t,label:n?r:void 0,role:i,children:!n&&r}):null}),m1e=wit;var h1e=a(G(),1),g1e=a(zh(),1);var v1e=a(T(),1);function b1e(e){let t=(0,g1e.usePluginContext)();return(0,v1e.jsx)(ql,{name:"core/plugin-more-menu",as:e.as??h1e.MenuItem,icon:e.icon||t.icon,...e})}var y1e=a(zh(),1),x6=a(G(),1),BY=a(T(),1),{Fill:_it,Slot:Sit}=(0,x6.createSlotFill)("PluginPostPublishPanel"),w1e=({children:e,className:t,title:r,initialOpen:o=!1,icon:n})=>{let{icon:i}=(0,y1e.usePluginContext)();return(0,BY.jsx)(_it,{children:(0,BY.jsx)(x6.PanelBody,{className:t,initialOpen:o||!r,title:r,icon:n??i,children:e})})};w1e.Slot=Sit;var C6=w1e;var E6=a(G(),1),jY=a(T(),1),{Fill:xit,Slot:Cit}=(0,E6.createSlotFill)("PluginPostStatusInfo"),_1e=({children:e,className:t})=>(0,jY.jsx)(xit,{children:(0,jY.jsx)(E6.PanelRow,{className:t,children:e})});_1e.Slot=Cit;var ES=_1e;var T6=a(G(),1),S1e=a(zh(),1),zY=a(T(),1),{Fill:Eit,Slot:Tit}=(0,T6.createSlotFill)("PluginPrePublishPanel"),x1e=({children:e,className:t,title:r,initialOpen:o=!1,icon:n})=>{let{icon:i}=(0,S1e.usePluginContext)();return(0,zY.jsx)(Eit,{children:(0,zY.jsx)(T6.PanelBody,{className:t,initialOpen:o||!r,title:r,icon:n??i,children:e})})};x1e.Slot=Tit;var P6=x1e;var C1e=a(G(),1),E1e=a(zh(),1);var T1e=a(T(),1);function P1e(e){let t=(0,E1e.usePluginContext)();return(0,T1e.jsx)(ql,{name:"core/plugin-preview-menu",as:e.as??C1e.MenuItem,icon:e.icon||t.icon,...e})}var k1e=a(T(),1);function Oy({className:e,...t}){return(0,k1e.jsx)(Zl,{panelClassName:e,className:"editor-sidebar",scope:"core",...t})}var R1e=a(T(),1);function A1e(e){return(0,R1e.jsx)(Uh,{__unstableExplicitMenuItem:!0,scope:"core",...e})}var Up=a(Y(),1),J1e=a(Nt(),1),Ag=a(G(),1),k6=a(U(),1),My=a(j(),1),RS=a(ae(),1);var $1e=a(It(),1),eCe=a(Lt(),1);var PS=a(U(),1),M1e=a(Nt(),1),F1e=a(be(),1),kS=a(G(),1),TS=a(j(),1),D1e=a(Y(),1),L1e=a(ae(),1),V1e=a(Pt(),1);var O1e=a(pw(),1);function I1e(e=""){return e=(0,O1e.default)(e),e=e.trim().toLowerCase(),e}function Pit(e,t){let r=I1e(t),o=I1e(e.title),n=0;return r===o?n+=30:o.startsWith(r)?n+=20:r.split(" ").every(l=>o.includes(l))&&(n+=10),n}function N1e(e=[],t=""){if(!t)return e;let r=e.map(o=>[o,Pit(o,t)]).filter(([,o])=>o>0);return r.sort(([,o],[,n])=>n-o),r.map(([o])=>o)}var Da=a(T(),1);function HY({onRequestClose:e,onSelect:t}){let{postType:r,postId:o}=Ay(),{editEntityRecord:n}=(0,D1e.useDispatch)(L1e.store),i=async s=>{n("postType",r,o,{template:s.isDefault?"":s.name},{undoIgnore:!0}),e(),t?.()};return(0,Da.jsx)(kS.Modal,{title:(0,TS.__)("Choose a template"),onRequestClose:e,overlayClassName:"editor-post-template__swap-template-modal",isFullScreen:!0,children:(0,Da.jsx)("div",{className:"editor-post-template__swap-template-modal-content",children:(0,Da.jsx)(kit,{onSelect:i})})})}function B1e({onClick:e}){let[t,r]=(0,PS.useState)(!1),o=sP();return(0,Da.jsxs)(Da.Fragment,{children:[(0,Da.jsx)(kS.MenuItem,{disabled:!o?.length,accessibleWhenDisabled:!0,onClick:()=>r(!0),children:(0,TS.__)("Change template")}),t&&(0,Da.jsx)(HY,{onRequestClose:()=>r(!1),onSelect:e})]})}function kit({onSelect:e}){let[t,r]=(0,PS.useState)(""),o=sP(),n=(0,PS.useMemo)(()=>o.map(s=>({name:s.slug,blocks:(0,V1e.parse)(s.content.raw),title:(0,M1e.decodeEntities)(s.title.rendered),id:s.id,isDefault:s.isDefault})),[o]),i=(0,PS.useMemo)(()=>N1e(n,t),[n,t]);return(0,Da.jsxs)(Da.Fragment,{children:[(0,Da.jsx)(kS.SearchControl,{onChange:r,value:t,label:(0,TS.__)("Search"),placeholder:(0,TS.__)("Search"),className:"editor-post-template__swap-template-search"}),(0,Da.jsx)(F1e.__experimentalBlockPatternsList,{label:(0,TS.__)("Templates"),blockPatterns:i,onClickPattern:e})]})}var j1e=a(G(),1),z1e=a(j(),1),H1e=a(Y(),1),U1e=a(ae(),1);var W1e=a(T(),1);function G1e({onClick:e}){let t=FY(),r=Iy(),{postType:o,postId:n}=Ay(),{editEntityRecord:i}=(0,H1e.useDispatch)(U1e.store);return!t||!r?null:(0,W1e.jsx)(j1e.MenuItem,{onClick:()=>{i("postType",o,n,{template:""},{undoIgnore:!0}),e()},children:(0,z1e.__)("Use default template")})}var Y1e=a(G(),1),q1e=a(j(),1),K1e=a(Y(),1),Z1e=a(ae(),1),X1e=a(U(),1);var Ny=a(T(),1);function Q1e(){let{canCreateTemplates:e}=(0,K1e.useSelect)(n=>{let{canUser:i}=n(Z1e.store);return{canCreateTemplates:i("create",{kind:"postType",name:"wp_template"})}},[]),[t,r]=(0,X1e.useState)(!1),o=Iy();return!e||!o?null:(0,Ny.jsxs)(Ny.Fragment,{children:[(0,Ny.jsx)(Y1e.MenuItem,{onClick:()=>{r(!0)},children:(0,q1e.__)("Create new template")}),t&&(0,Ny.jsx)(Tg,{onClose:()=>{r(!1)}})]})}var La=a(T(),1);function tCe(){let{isTemplateHidden:e,onNavigateToEntityRecord:t,getEditorSettings:r,hasGoBack:o,hasSpecificTemplate:n,id:i}=(0,Up.useSelect)(S=>{let{getRenderingMode:x,getEditorSettings:C,getCurrentPost:A,getCurrentTemplateId:P}=q(S(I)),R=C(),N=A();return{isTemplateHidden:x()==="post-only",onNavigateToEntityRecord:R.onNavigateToEntityRecord,getEditorSettings:C,hasGoBack:R.hasOwnProperty("onNavigateToPreviousEntityRecord"),hasSpecificTemplate:!!N.template,id:P()}},[]),{get:s}=(0,Up.useSelect)(eCe.store),{editedRecord:l,hasResolved:c}=(0,RS.useEntityRecord)("postType","wp_template",i),{getEntityRecord:u}=(0,Up.useSelect)(RS.store),{editEntityRecord:d}=(0,Up.useDispatch)(RS.store),{createSuccessNotice:f}=(0,Up.useDispatch)($1e.store),{setRenderingMode:m,setDefaultRenderingMode:h}=q((0,Up.useDispatch)(I)),g=(0,Up.useSelect)(S=>!!S(RS.store).canUser("create",{kind:"postType",name:"wp_template"}),[]),[v,b]=(0,k6.useState)(null),_=(0,k6.useMemo)(()=>({anchor:v,className:"editor-post-template__dropdown",placement:"left-start",offset:36,shift:!0}),[v]);if(!c)return null;let y=o?[{label:(0,My.__)("Go back"),onClick:()=>r().onNavigateToPreviousEntityRecord()}]:void 0,w=()=>{s("core/edit-site","welcomeGuideTemplate")||f((0,My.__)("Editing template. Changes made here affect all posts and pages that use the template."),{type:"snackbar",actions:y})};return(0,La.jsx)(fr,{label:(0,My.__)("Template"),ref:b,children:(0,La.jsx)(Ag.DropdownMenu,{popoverProps:_,focusOnMount:!0,toggleProps:{size:"compact",variant:"tertiary",tooltipPosition:"middle left"},label:(0,My.__)("Template options"),text:(0,J1e.decodeEntities)(l.title),icon:null,children:({onClose:S})=>(0,La.jsxs)(La.Fragment,{children:[(0,La.jsxs)(Ag.MenuGroup,{children:[g&&(0,La.jsx)(Ag.MenuItem,{onClick:async()=>{if(t({postId:l.id,postType:"wp_template"}),!n&&window?.__experimentalTemplateActivate){let x=await u("root","site").active_templates;x[l.slug]!==l.id&&d("root","site",void 0,{active_templates:{...x,[l.slug]:l.id}})}S(),w()},children:(0,My.__)("Edit template")}),(0,La.jsx)(B1e,{onClick:S}),(0,La.jsx)(G1e,{onClick:S}),g&&(0,La.jsx)(Q1e,{})]}),(0,La.jsx)(Ag.MenuGroup,{children:(0,La.jsx)(Ag.MenuItem,{icon:e?void 0:Io,isSelected:!e,role:"menuitemcheckbox",onClick:()=>{let x=e?"template-locked":"post-only";m(x),h(x)},children:(0,My.__)("Show template")})})]})})})}var UY=a(T(),1);function R6(){let e=SS();return e==="classic"?(0,UY.jsx)(v6,{}):e==="block-theme"?(0,UY.jsx)(tCe,{}):null}var bCe=a(Y(),1),yCe=a(ae(),1);var sCe=a(Ce(),1),aCe=a(U(),1),lCe=a(Y(),1),cCe=a(j(),1),uCe=a(G(),1);var rCe=a(j(),1),oCe=a(U(),1),nCe=a(Y(),1),WY=a(Nt(),1),iCe=a(ae(),1);var aP={_fields:"id,name",context:"view"},A6={who:"authors",per_page:100,...aP};function I6(e){let{authorId:t,authors:r,postAuthor:o,isLoading:n}=(0,nCe.useSelect)(s=>{let{getUser:l,getUsers:c,isResolving:u}=s(iCe.store),{getEditedPostAttribute:d}=s(I),f=d("author"),m={...A6};return e&&(m.search=e,m.search_columns=["name"]),{authorId:f,authors:c(m),postAuthor:l(f,aP),isLoading:u("getUsers",[m])}},[e]),i=(0,oCe.useMemo)(()=>{let s=(r??[]).map(u=>({value:u.id,label:(0,WY.decodeEntities)(u.name)})),l=s.findIndex(({value:u})=>o?.id===u),c=[];return l<0&&o?c=[{value:o.id,label:(0,WY.decodeEntities)(o.name)}]:l<0&&!o&&(c=[{value:0,label:(0,rCe.__)("(No author)")}]),[...c,...s]},[r,o]);return{authorId:t,authorOptions:i,postAuthor:o,isLoading:n}}var dCe=a(T(),1);function fCe(){let[e,t]=(0,aCe.useState)(),{editPost:r}=(0,lCe.useDispatch)(I),{authorId:o,authorOptions:n,isLoading:i}=I6(e),s=l=>{l&&r({author:l})};return(0,dCe.jsx)(uCe.ComboboxControl,{label:(0,cCe.__)("Author"),options:n,value:o,onFilterValueChange:(0,sCe.debounce)(t,300),onChange:s,allowReset:!1,hideLabelFromVision:!0,isLoading:i})}var pCe=a(j(),1),mCe=a(Y(),1),hCe=a(G(),1);var gCe=a(T(),1);function vCe(){let{editPost:e}=(0,mCe.useDispatch)(I),{authorId:t,authorOptions:r}=I6(),o=n=>{let i=Number(n);e({author:i})};return(0,gCe.jsx)(hCe.SelectControl,{className:"post-author-selector",label:(0,pCe.__)("Author"),options:r,onChange:o,value:t,hideLabelFromVision:!0})}var GY=a(T(),1),Rit=25;function Ait(){return(0,bCe.useSelect)(t=>t(yCe.store).getUsers(A6)?.length>=Rit,[])?(0,GY.jsx)(fCe,{}):(0,GY.jsx)(vCe,{})}var O6=Ait;var wCe=a(Y(),1);var _Ce=a(T(),1);function N6({children:e}){let{hasAssignAuthorAction:t}=(0,wCe.useSelect)(r=>({hasAssignAuthorAction:!!r(I).getCurrentPost()?._links?.["wp:action-assign-author"]}),[]);return t?(0,_Ce.jsx)(uo,{supportKeys:"author",children:e}):null}var Fy=a(j(),1),M6=a(G(),1),F6=a(U(),1),SCe=a(Nt(),1),xCe=a(be(),1),CCe=a(Y(),1),ECe=a(ae(),1);var Xd=a(T(),1);function Iit({isOpen:e,onClick:t}){let{postAuthor:r}=(0,CCe.useSelect)(n=>{let i=n(I).getEditedPostAttribute("author");return{postAuthor:n(ECe.store).getUser(i,aP)}},[]),o=(0,SCe.decodeEntities)(r?.name)||(0,Fy.__)("(No author)");return(0,Xd.jsx)(M6.Button,{size:"compact",variant:"tertiary","aria-expanded":e,"aria-label":(0,Fy.sprintf)((0,Fy.__)("Change author: %s"),o),onClick:t,children:o})}function Oit(){let[e,t]=(0,F6.useState)(null),r=(0,F6.useMemo)(()=>({anchor:e,placement:"left-start",offset:36,shift:!0}),[e]);return(0,Xd.jsx)(N6,{children:(0,Xd.jsx)(fr,{label:(0,Fy.__)("Author"),ref:t,children:(0,Xd.jsx)(M6.Dropdown,{popoverProps:r,contentClassName:"editor-post-author__panel-dialog",focusOnMount:!0,renderToggle:({isOpen:o,onToggle:n})=>(0,Xd.jsx)(Iit,{isOpen:o,onClick:n}),renderContent:({onClose:o})=>(0,Xd.jsxs)("div",{className:"editor-post-author",children:[(0,Xd.jsx)(xCe.__experimentalInspectorPopoverHeader,{title:(0,Fy.__)("Author"),onClose:o}),(0,Xd.jsx)(O6,{onClose:o})]})})})})}var D6=Oit;var Ig=a(j(),1),V6=a(G(),1),B6=a(Y(),1);var L6=a(T(),1),Nit=[{label:(0,Ig._x)("Open",'Adjective: e.g. "Comments are open"'),value:"open",description:(0,Ig.__)("Visitors can add new comments and replies.")},{label:(0,Ig.__)("Closed"),value:"closed",description:[(0,Ig.__)("Visitors cannot add new comments or replies."),(0,Ig.__)("Existing comments remain visible.")].join(" ")}];function Mit(){let e=(0,B6.useSelect)(o=>o(I).getEditedPostAttribute("comment_status")??"open",[]),{editPost:t}=(0,B6.useDispatch)(I),r=o=>t({comment_status:o});return(0,L6.jsx)("form",{children:(0,L6.jsx)(V6.__experimentalVStack,{spacing:4,children:(0,L6.jsx)(V6.RadioControl,{className:"editor-change-status__options",hideLabelFromVision:!0,label:(0,Ig.__)("Comment status"),options:Nit,onChange:r,selected:e})})})}var j6=Mit;var du=a(j(),1),AS=a(G(),1),qY=a(Y(),1),G6=a(U(),1),TCe=a(be(),1),PCe=a(ae(),1);var z6=a(j(),1),H6=a(G(),1),U6=a(Y(),1);var YY=a(T(),1);function Fit(){let e=(0,U6.useSelect)(o=>o(I).getEditedPostAttribute("ping_status")??"open",[]),{editPost:t}=(0,U6.useDispatch)(I),r=()=>t({ping_status:e==="open"?"closed":"open"});return(0,YY.jsx)(H6.CheckboxControl,{label:(0,z6.__)("Enable pingbacks & trackbacks"),checked:e==="open",onChange:r,help:(0,YY.jsx)(H6.ExternalLink,{href:(0,z6.__)("https://wordpress.org/documentation/article/trackbacks-and-pingbacks/"),children:(0,z6.__)("Learn more about pingbacks & trackbacks")})})}var W6=Fit;var Zs=a(T(),1),Dit="discussion-panel";function Lit({onClose:e}){return(0,Zs.jsxs)("div",{className:"editor-post-discussion",children:[(0,Zs.jsx)(TCe.__experimentalInspectorPopoverHeader,{title:(0,du.__)("Discussion"),onClose:e}),(0,Zs.jsxs)(AS.__experimentalVStack,{spacing:4,children:[(0,Zs.jsx)(uo,{supportKeys:"comments",children:(0,Zs.jsx)(j6,{})}),(0,Zs.jsx)(uo,{supportKeys:"trackbacks",children:(0,Zs.jsx)(W6,{})})]})]})}function Vit({isOpen:e,onClick:t}){let{commentStatus:r,pingStatus:o,commentsSupported:n,trackbacksSupported:i}=(0,qY.useSelect)(l=>{let{getEditedPostAttribute:c}=l(I),{getPostType:u}=l(PCe.store),d=u(c("type"));return{commentStatus:c("comment_status")??"open",pingStatus:c("ping_status")??"open",commentsSupported:!!d.supports.comments,trackbacksSupported:!!d.supports.trackbacks}},[]),s;return r==="open"?o==="open"?s=(0,du._x)("Open",'Adjective: e.g. "Comments are open"'):s=i?(0,du.__)("Comments only"):(0,du._x)("Open",'Adjective: e.g. "Comments are open"'):o==="open"?s=n?(0,du.__)("Pings only"):(0,du.__)("Pings enabled"):s=(0,du.__)("Closed"),(0,Zs.jsx)(AS.Button,{size:"compact",className:"editor-post-discussion__panel-toggle",variant:"tertiary","aria-label":(0,du.__)("Change discussion options"),"aria-expanded":e,onClick:t,children:s})}function Y6(){let{isEnabled:e}=(0,qY.useSelect)(n=>{let{isEditorPanelEnabled:i}=n(I);return{isEnabled:i(Dit)}},[]),[t,r]=(0,G6.useState)(null),o=(0,G6.useMemo)(()=>({anchor:t,placement:"left-start",offset:36,shift:!0}),[t]);return e?(0,Zs.jsx)(uo,{supportKeys:["comments","trackbacks"],children:(0,Zs.jsx)(fr,{label:(0,du.__)("Discussion"),ref:r,children:(0,Zs.jsx)(AS.Dropdown,{popoverProps:o,className:"editor-post-discussion__panel-dropdown",contentClassName:"editor-post-discussion__panel-dialog",focusOnMount:!0,renderToggle:({isOpen:n,onToggle:i})=>(0,Zs.jsx)(Vit,{isOpen:n,onClick:i}),renderContent:({onClose:n})=>(0,Zs.jsx)(Lit,{onClose:n})})})}):null}var IS=a(j(),1),K6=a(G(),1),Z6=a(Y(),1),kCe=a(U(),1),RCe=a(Nt(),1);var q6=a(T(),1);function lP({hideLabelFromVision:e=!1,updateOnBlur:t=!1}){let{excerpt:r,shouldUseDescriptionLabel:o,usedAttribute:n}=(0,Z6.useSelect)(d=>{let{getCurrentPostType:f,getEditedPostAttribute:m}=d(I),h=f(),g=["wp_template","wp_template_part"].includes(h)?"description":"excerpt";return{excerpt:m(g),shouldUseDescriptionLabel:["wp_template","wp_template_part","wp_block"].includes(h),usedAttribute:g}},[]),{editPost:i}=(0,Z6.useDispatch)(I),[s,l]=(0,kCe.useState)((0,RCe.decodeEntities)(r)),c=d=>{i({[n]:d})},u=o?(0,IS.__)("Write a description (optional)"):(0,IS.__)("Write an excerpt (optional)");return(0,q6.jsx)("div",{className:"editor-post-excerpt",children:(0,q6.jsx)(K6.TextareaControl,{label:u,hideLabelFromVision:e,className:"editor-post-excerpt__textarea",onChange:t?l:c,onBlur:t?()=>c(s):void 0,value:t?s:r,help:o?(0,IS.__)("Write a description"):(0,q6.jsx)(K6.ExternalLink,{href:(0,IS.__)("https://wordpress.org/documentation/article/page-post-settings-sidebar/#excerpt"),children:(0,IS.__)("Learn more about manual excerpts")})})})}var ACe=a(T(),1);function Bit({children:e}){return(0,ACe.jsx)(uo,{supportKeys:"excerpt",children:e})}var Dy=Bit;var Wp=a(j(),1),fu=a(G(),1),uP=a(Y(),1),J6=a(U(),1),OCe=a(be(),1),ZY=a(ae(),1),NCe=a(Nt(),1);var X6=a(G(),1),KY=a(T(),1),{Fill:jit,Slot:zit}=(0,X6.createSlotFill)("PluginPostExcerpt"),ICe=({children:e,className:t})=>(0,KY.jsx)(jit,{children:(0,KY.jsx)(X6.PanelRow,{className:t,children:e})});ICe.Slot=zit;var cP=ICe;var fo=a(T(),1),Q6="post-excerpt";function Hit(){let{isOpened:e,isEnabled:t,postType:r}=(0,uP.useSelect)(s=>{let{isEditorPanelOpened:l,isEditorPanelEnabled:c,getCurrentPostType:u}=s(I);return{isOpened:l(Q6),isEnabled:c(Q6),postType:u()}},[]),{toggleEditorPanelOpened:o}=(0,uP.useDispatch)(I),n=()=>o(Q6);if(!t)return null;let i=["wp_template","wp_template_part","wp_block"].includes(r);return(0,fo.jsx)(fu.PanelBody,{title:i?(0,Wp.__)("Description"):(0,Wp.__)("Excerpt"),opened:e,onToggle:n,children:(0,fo.jsx)(cP.Slot,{children:s=>(0,fo.jsxs)(fo.Fragment,{children:[(0,fo.jsx)(lP,{}),s]})})})}function MCe(){return(0,fo.jsx)(Dy,{children:(0,fo.jsx)(Hit,{})})}function FCe(){return(0,fo.jsx)(Dy,{children:(0,fo.jsx)(Uit,{})})}function Uit(){let{shouldRender:e,excerpt:t,shouldBeUsedAsDescription:r,allowEditing:o}=(0,uP.useSelect)(f=>{let{getCurrentPostType:m,getCurrentPostId:h,getEditedPostAttribute:g,isEditorPanelEnabled:v}=f(I),b=m(),_=["wp_template","wp_template_part"].includes(b),y=b==="wp_block",w=_||y,x=g(_?"description":"excerpt"),C=_&&f(ZY.store).getEntityRecord("postType",b,h()),A=!x&&_?Il({template:C,templateTypes:f(ZY.store).getCurrentTheme()?.default_template_types})?.description:void 0,P=v(Q6)||w;return{excerpt:x??A,shouldRender:P,shouldBeUsedAsDescription:w,allowEditing:P&&(!w||y||C&&C.source===Rk.custom&&!C.has_theme_file&&C.is_custom)}},[]),[n,i]=(0,J6.useState)(null),s=r?(0,Wp.__)("Description"):(0,Wp.__)("Excerpt"),l=(0,J6.useMemo)(()=>({anchor:n,"aria-label":s,headerTitle:s,placement:"left-start",offset:36,shift:!0}),[n,s]);if(!e)return!1;let c=!!t&&(0,fo.jsx)(fu.__experimentalText,{align:"left",numberOfLines:4,truncate:o,children:(0,NCe.decodeEntities)(t)});if(!o)return c;let u=r?(0,Wp.__)("Add a description\u2026"):(0,Wp.__)("Add an excerpt\u2026"),d=r?(0,Wp.__)("Edit description"):(0,Wp.__)("Edit excerpt");return(0,fo.jsxs)(fu.__experimentalVStack,{children:[c,(0,fo.jsx)(fu.Dropdown,{className:"editor-post-excerpt__dropdown",contentClassName:"editor-post-excerpt__dropdown__content",popoverProps:l,focusOnMount:!0,ref:i,renderToggle:({onToggle:f})=>(0,fo.jsx)(fu.Button,{__next40pxDefaultSize:!0,onClick:f,variant:"link",children:c?d:u}),renderContent:({onClose:f})=>(0,fo.jsxs)(fo.Fragment,{children:[(0,fo.jsx)(OCe.__experimentalInspectorPopoverHeader,{title:s,onClose:f}),(0,fo.jsx)(fu.__experimentalVStack,{spacing:4,children:(0,fo.jsx)(cP.Slot,{children:m=>(0,fo.jsxs)(fo.Fragment,{children:[(0,fo.jsx)(lP,{hideLabelFromVision:!0,updateOnBlur:!0}),m]})})})]})})]})}var vl=a(j(),1),QY=a(zn(),1),ls=a(G(),1),BCe=a(sI(),1),eF=a(U(),1),jCe=a(Ce(),1),OS=a(Y(),1),Ly=a(be(),1),zCe=a(ae(),1);var DCe=a(Y(),1),LCe=a(ae(),1);function $6({children:e,supportKeys:t}){let{postType:r,themeSupports:o}=(0,DCe.useSelect)(i=>({postType:i(I).getEditedPostAttribute("type"),themeSupports:i(LCe.store).getThemeSupports()}),[]);return(Array.isArray(t)?t:[t]).some(i=>{let s=o?.[i]??!1;return i==="post-thumbnails"&&Array.isArray(s)?s.includes(r):s})?e:null}var XY=a(T(),1);function Wit({children:e}){return(0,XY.jsx)($6,{supportKeys:"post-thumbnails",children:(0,XY.jsx)(uo,{supportKeys:"thumbnail",children:e})})}var Gp=Wit;var Ti=a(T(),1),VCe=["image"],Git=(0,vl.__)("Featured image"),Yit=(0,vl.__)("Add a featured image"),qit=(0,Ti.jsx)("p",{children:(0,vl.__)("To edit the featured image, you need permission to upload media.")});function Kit(e,t){if(!e)return{};let r=(0,QY.applyFilters)("editor.PostFeaturedImage.imageSize","large",e.id,t);if(r in(e?.media_details?.sizes??{}))return{mediaWidth:e.media_details.sizes[r].width,mediaHeight:e.media_details.sizes[r].height,mediaSourceUrl:e.media_details.sizes[r].source_url};let o=(0,QY.applyFilters)("editor.PostFeaturedImage.imageSize","thumbnail",e.id,t);return o in(e?.media_details?.sizes??{})?{mediaWidth:e.media_details.sizes[o].width,mediaHeight:e.media_details.sizes[o].height,mediaSourceUrl:e.media_details.sizes[o].source_url}:{mediaWidth:e.media_details.width,mediaHeight:e.media_details.height,mediaSourceUrl:e.source_url}}function Zit({currentPostId:e,featuredImageId:t,onUpdateImage:r,onRemoveImage:o,media:n,postType:i,noticeUI:s,noticeOperations:l,isRequestingFeaturedImageMedia:c}){let u=(0,eF.useRef)(!1),[d,f]=(0,eF.useState)(!1),{getSettings:m}=(0,OS.useSelect)(Ly.store),{mediaSourceUrl:h}=Kit(n,e);function g(y){m().mediaUpload({allowedTypes:VCe,filesList:y,onFileChange([w]){if((0,BCe.isBlobURL)(w?.url)){f(!0);return}w&&r(w),f(!1)},onError(w){l.removeAllNotices(),l.createErrorNotice(w)},multiple:!1})}function v(y){return y.alt_text?(0,vl.sprintf)((0,vl.__)("Current image: %s"),y.alt_text):(0,vl.sprintf)((0,vl.__)("The current image has no alternative text. The file name is: %s"),y.media_details.sizes?.full?.file||y.slug)}function b(y){u.current&&y&&(y.focus(),u.current=!1)}let _=!c&&!!t&&!n;return(0,Ti.jsxs)(Gp,{children:[s,(0,Ti.jsxs)("div",{className:"editor-post-featured-image",children:[n&&(0,Ti.jsx)("div",{id:`editor-post-featured-image-${t}-describedby`,className:"hidden",children:v(n)}),(0,Ti.jsx)(Ly.MediaUploadCheck,{fallback:qit,children:(0,Ti.jsx)(Ly.MediaUpload,{title:i?.labels?.featured_image||Git,onSelect:r,unstableFeaturedImageFlow:!0,allowedTypes:VCe,modalClass:"editor-post-featured-image__media-modal",render:({open:y})=>(0,Ti.jsxs)("div",{className:"editor-post-featured-image__container",children:[_?(0,Ti.jsx)(ls.Notice,{status:"warning",isDismissible:!1,children:(0,vl.__)("Could not retrieve the featured image data.")}):(0,Ti.jsxs)(ls.Button,{__next40pxDefaultSize:!0,ref:b,className:t?"editor-post-featured-image__preview":"editor-post-featured-image__toggle",onClick:y,"aria-label":t?(0,vl.__)("Edit or replace the featured image"):null,"aria-describedby":t?`editor-post-featured-image-${t}-describedby`:null,"aria-haspopup":"dialog",disabled:d,accessibleWhenDisabled:!0,children:[!!t&&n&&(0,Ti.jsx)("img",{className:"editor-post-featured-image__preview-image",src:h,alt:v(n)}),(d||c)&&(0,Ti.jsx)(ls.Spinner,{}),!t&&!d&&(i?.labels?.set_featured_image||Yit)]}),!!t&&(0,Ti.jsxs)(ls.__experimentalHStack,{className:J("editor-post-featured-image__actions",{"editor-post-featured-image__actions-missing-image":_,"editor-post-featured-image__actions-is-requesting-image":c}),children:[(0,Ti.jsx)(ls.Button,{__next40pxDefaultSize:!0,className:"editor-post-featured-image__action",onClick:y,"aria-haspopup":"dialog",variant:_?"secondary":void 0,children:(0,vl.__)("Replace")}),(0,Ti.jsx)(ls.Button,{__next40pxDefaultSize:!0,className:"editor-post-featured-image__action",onClick:()=>{o(),u.current=!0},variant:_?"secondary":void 0,isDestructive:_,children:(0,vl.__)("Remove")})]}),(0,Ti.jsx)(ls.DropZone,{onFilesDrop:g})]}),value:t})})]})]})}var Xit=(0,OS.withSelect)(e=>{let{getEntityRecord:t,getPostType:r,hasFinishedResolution:o}=e(zCe.store),{getCurrentPostId:n,getEditedPostAttribute:i}=e(I),s=i("featured_media");return{media:s?t("postType","attachment",s,{context:"view"}):null,currentPostId:n(),postType:r(i("type")),featuredImageId:s,isRequestingFeaturedImageMedia:!!s&&!o("getEntityRecord",["postType","attachment",s,{context:"view"}])}}),Qit=(0,OS.withDispatch)((e,{noticeOperations:t},{select:r})=>{let{editPost:o}=e(I);return{onUpdateImage(n){o({featured_media:n.id})},onDropImage(n){r(Ly.store).getSettings().mediaUpload({allowedTypes:["image"],filesList:n,onFileChange([i]){o({featured_media:i.id})},onError(i){t.removeAllNotices(),t.createErrorNotice(i)},multiple:!1})},onRemoveImage(){o({featured_media:0})}}}),dP=(0,jCe.compose)(ls.withNotices,Xit,Qit,(0,ls.withFilters)("editor.PostFeaturedImage"))(Zit);var HCe=a(j(),1),UCe=a(G(),1),tF=a(Y(),1),WCe=a(ae(),1);var NS=a(T(),1),JY="featured-image";function rF({withPanelBody:e=!0}){let{postType:t,isEnabled:r,isOpened:o}=(0,tF.useSelect)(i=>{let{getEditedPostAttribute:s,isEditorPanelEnabled:l,isEditorPanelOpened:c}=i(I),{getPostType:u}=i(WCe.store);return{postType:u(s("type")),isEnabled:l(JY),isOpened:c(JY)}},[]),{toggleEditorPanelOpened:n}=(0,tF.useDispatch)(I);return r?e?(0,NS.jsx)(Gp,{children:(0,NS.jsx)(UCe.PanelBody,{title:t?.labels?.featured_image??(0,HCe.__)("Featured image"),opened:o,onToggle:()=>n(JY),children:(0,NS.jsx)(dP,{})})}):(0,NS.jsx)(Gp,{children:(0,NS.jsx)(dP,{})}):null}var Xs=a(j(),1),oF=a(G(),1),nF=a(Y(),1),qCe=a(Ce(),1),KCe=a(ae(),1);var GCe=a(Y(),1);var YCe=a(T(),1);function MS({children:e}){return(0,GCe.useSelect)(r=>r(I).getEditorSettings().disablePostFormats,[])?null:(0,YCe.jsx)(uo,{supportKeys:"post-formats",children:e})}var Vy=a(T(),1),fP=[{id:"aside",caption:(0,Xs.__)("Aside")},{id:"audio",caption:(0,Xs.__)("Audio")},{id:"chat",caption:(0,Xs.__)("Chat")},{id:"gallery",caption:(0,Xs.__)("Gallery")},{id:"image",caption:(0,Xs.__)("Image")},{id:"link",caption:(0,Xs.__)("Link")},{id:"quote",caption:(0,Xs.__)("Quote")},{id:"standard",caption:(0,Xs.__)("Standard")},{id:"status",caption:(0,Xs.__)("Status")},{id:"video",caption:(0,Xs.__)("Video")}].sort((e,t)=>{let r=e.caption.toUpperCase(),o=t.caption.toUpperCase();return ro?1:0});function pP(){let t=`post-format-selector-${(0,qCe.useInstanceId)(pP)}`,{postFormat:r,suggestedFormat:o,supportedFormats:n}=(0,nF.useSelect)(u=>{let{getEditedPostAttribute:d,getSuggestedPostFormat:f}=u(I),m=d("format"),h=u(KCe.store).getThemeSupports();return{postFormat:m??"standard",suggestedFormat:f(),supportedFormats:h.formats}},[]),i=fP.filter(u=>n?.includes(u.id)||r===u.id),s=i.find(u=>u.id===o),{editPost:l}=(0,nF.useDispatch)(I),c=u=>l({format:u});return(0,Vy.jsx)(MS,{children:(0,Vy.jsxs)("div",{className:"editor-post-format",children:[(0,Vy.jsx)(oF.RadioControl,{className:"editor-post-format__options",label:(0,Xs.__)("Post Format"),selected:r,onChange:u=>c(u),id:t,options:i.map(u=>({label:u.caption,value:u.id})),hideLabelFromVision:!0}),s&&s.id!==r&&(0,Vy.jsx)("p",{className:"editor-post-format__suggestion",children:(0,Vy.jsx)(oF.Button,{__next40pxDefaultSize:!0,variant:"link",onClick:()=>c(s.id),children:(0,Xs.sprintf)((0,Xs.__)("Apply suggested format: %s"),s.caption)})})]})})}var Og=a(j(),1),$Y=a(G(),1),mP=a(Y(),1);var eq=a(vo(),1);var ZCe=a(Y(),1);var XCe=a(T(),1);function Jit({children:e}){let{lastRevisionId:t,revisionsCount:r}=(0,ZCe.useSelect)(o=>{let{getCurrentPostLastRevisionId:n,getCurrentPostRevisionsCount:i}=o(I);return{lastRevisionId:n(),revisionsCount:i()}},[]);return!t||r<2?null:(0,XCe.jsx)(uo,{supportKeys:"revisions",children:e})}var By=Jit;var FS=a(T(),1);function QCe(){return(0,mP.useSelect)(e=>{let{getCurrentPostLastRevisionId:t,getCurrentPostRevisionsCount:r,getEditorSettings:o}=e(I);return{lastRevisionId:t(),revisionsCount:r(),disableVisualRevisions:!!o().disableVisualRevisions}},[])}function $it(){let{lastRevisionId:e,revisionsCount:t,disableVisualRevisions:r}=QCe(),{setCurrentRevisionId:o}=q((0,mP.useDispatch)(I)),n=r?{href:(0,eq.addQueryArgs)("revision.php",{revision:e})}:{onClick:()=>o(e)};return(0,FS.jsx)(By,{children:(0,FS.jsx)($Y.Button,{__next40pxDefaultSize:!0,...n,className:"editor-post-last-revision__title",icon:yf,iconPosition:"right",text:(0,Og.sprintf)((0,Og.__)("Revisions (%s)"),t)})})}function JCe(){let{lastRevisionId:e,revisionsCount:t,disableVisualRevisions:r}=QCe(),{setCurrentRevisionId:o}=q((0,mP.useDispatch)(I)),n=r?{href:(0,eq.addQueryArgs)("revision.php",{revision:e})}:{onClick:()=>o(e)};return(0,FS.jsx)(By,{children:(0,FS.jsx)(fr,{label:(0,Og.__)("Revisions"),children:(0,FS.jsx)($Y.Button,{...n,className:"editor-private-post-last-revision__button",text:t,"aria-label":(0,Og.sprintf)((0,Og._n)("Open revisions screen: %d revision","Open revisions screen: %d revisions",t),t),variant:"tertiary",size:"compact"})})})}var iF=$it;var $Ce=a(G(),1);var sF=a(T(),1);function est(){return(0,sF.jsx)(By,{children:(0,sF.jsx)($Ce.PanelBody,{className:"editor-post-last-revision__panel",children:(0,sF.jsx)(iF,{})})})}var eEe=est;var li=a(j(),1),mu=a(G(),1),gP=a(Y(),1),oq=a(vo(),1),hP=a(U(),1),DS=a(zn(),1),iEe=a(Ce(),1),nq=a(ae(),1);var pu=a(j(),1),tst="authentication-failed",rst="connection-expired",ost="connection-limit-exceeded",tEe="document-size-limit-exceeded",rq="protocol-mismatch",rEe="unknown-error",tq={[tst]:{title:(0,pu.__)("Unable to connect"),description:(0,pu.__)("Real-time collaboration couldn't verify your permissions. Check that you have access to edit this post or contact your site administrator.")},[rst]:{title:(0,pu.__)("Connection expired"),description:(0,pu.__)("Your connection to real-time collaboration has timed out. Editing is paused to prevent conflicts with other editors.")},[ost]:{title:(0,pu.__)("Too many editors connected"),description:(0,pu.__)("Real-time collaboration has reached its connection limit. Try again later or contact your site administrator.")},[rq]:{title:(0,pu.__)("Protocol update"),description:(0,pu.__)("Real-time collaboration has been updated. Please refresh the page to continue editing.")},[rEe]:{title:(0,pu.__)("Connection lost"),description:(0,pu.__)("The connection to real-time collaboration was interrupted. Editing is paused to prevent conflicts with other editors.")}};function oEe(e){return e?.code&&tq[e?.code]?tq[e.code]:tq[rEe]}var Jr=a(T(),1);function nEe(){let{isCollaborationSupported:e,syncConnectionStatus:t}=(0,gP.useSelect)(r=>{let{isCollaborationSupported:o,getSyncConnectionStatus:n}=q(r(nq.store));return{isCollaborationSupported:o(),syncConnectionStatus:n()}},[]);return e?null:tEe===t?.error?.code?(0,Jr.jsx)("p",{children:(0,li.__)("Because this post is too large for real-time collaboration, only one person can edit at a time.")}):(0,Jr.jsx)("p",{children:(0,li.__)("Because this post uses plugins that aren\u2019t compatible with real-time collaboration, only one person can edit at a time.")})}function sEe(){let t="core/editor/post-locked-modal-"+(0,iEe.useInstanceId)(sEe),{autosave:r,updatePostLock:o}=(0,gP.useDispatch)(I),{isCollaborationEnabled:n,isLocked:i,isTakeover:s,user:l,postId:c,postLockUtils:u,activePostLock:d,postType:f,previewLink:m}=(0,gP.useSelect)(y=>{let{isPostLocked:w,isPostLockTakeover:S,getPostLockUser:x,getCurrentPostId:C,getActivePostLock:A,getEditedPostAttribute:P,getEditedPostPreviewLink:R,getEditorSettings:N,isCollaborationEnabledForCurrentPost:k}=q(y(I)),{getPostType:E}=y(nq.store);return{isCollaborationEnabled:k(),isLocked:w(),isTakeover:S(),user:x(),postId:C(),postLockUtils:N().postLockUtils,activePostLock:A(),postType:E(P("type")),previewLink:R()}},[]);if((0,hP.useEffect)(()=>{function y(x){i||(x["wp-refresh-post-lock"]={lock:d,post_id:c})}function w(x){if(!x["wp-refresh-post-lock"])return;let C=x["wp-refresh-post-lock"];C.lock_error?(r(),o({isLocked:!0,isTakeover:!0,user:{name:C.lock_error.name,avatar:C.lock_error.avatar_src_2x}})):C.new_lock&&o({isLocked:!1,activePostLock:C.new_lock})}function S(){if(i||!d)return;let x=new window.FormData;if(x.append("action","wp-remove-post-lock"),x.append("_wpnonce",u.unlockNonce),x.append("post_ID",c),x.append("active_post_lock",d),window.navigator.sendBeacon)window.navigator.sendBeacon(u.ajaxUrl,x);else{let C=new window.XMLHttpRequest;C.open("POST",u.ajaxUrl,!1),C.send(x)}}return(0,DS.addAction)("heartbeat.send",t,y),(0,DS.addAction)("heartbeat.tick",t,w),window.addEventListener("beforeunload",S),()=>{(0,DS.removeAction)("heartbeat.send",t),(0,DS.removeAction)("heartbeat.tick",t),window.removeEventListener("beforeunload",S)}},[]),!i||n)return null;let h=l.name,g=l.avatar,v=(0,oq.addQueryArgs)("post.php",{"get-post-lock":"1",lockKey:!0,post:c,action:"edit",_wpnonce:u.nonce}),b=(0,oq.addQueryArgs)("edit.php",{post_type:f?.slug}),_=(0,li.__)("Exit editor");return(0,Jr.jsx)(mu.Modal,{title:s?(0,li.__)("Someone else has taken over this post"):(0,li.__)("This post is already being edited"),focusOnMount:!0,shouldCloseOnClickOutside:!1,shouldCloseOnEsc:!1,isDismissible:!1,className:"editor-post-locked-modal",size:"medium",children:(0,Jr.jsxs)(mu.__experimentalHStack,{alignment:"top",spacing:6,children:[!!g&&(0,Jr.jsx)("img",{src:g,alt:(0,li.__)("Avatar"),className:"editor-post-locked-modal__avatar",width:64,height:64}),(0,Jr.jsxs)("div",{children:[!!s&&(0,Jr.jsxs)(Jr.Fragment,{children:[(0,Jr.jsx)("p",{children:(0,hP.createInterpolateElement)(h?(0,li.sprintf)((0,li.__)("%s now has editing control of this post (). Don\u2019t worry, your changes up to this moment have been saved."),h):(0,li.__)("Another user now has editing control of this post (). Don\u2019t worry, your changes up to this moment have been saved."),{strong:(0,Jr.jsx)("strong",{}),PreviewLink:(0,Jr.jsx)(mu.ExternalLink,{href:m,children:(0,li.__)("preview")})})}),(0,Jr.jsx)(nEe,{})]}),!s&&(0,Jr.jsxs)(Jr.Fragment,{children:[(0,Jr.jsx)("p",{children:(0,hP.createInterpolateElement)(h?(0,li.sprintf)((0,li.__)("%s is currently working on this post (), which means you cannot make changes, unless you take over."),h):(0,li.__)("Another user is currently working on this post (), which means you cannot make changes, unless you take over."),{strong:(0,Jr.jsx)("strong",{}),PreviewLink:(0,Jr.jsx)(mu.ExternalLink,{href:m,children:(0,li.__)("preview")})})}),(0,Jr.jsx)(nEe,{}),(0,Jr.jsx)("p",{children:(0,li.__)("If you take over, the other user will lose editing control to the post, but their changes will be saved.")})]}),(0,Jr.jsxs)(mu.__experimentalHStack,{className:"editor-post-locked-modal__buttons",justify:"flex-end",children:[!s&&(0,Jr.jsx)(mu.Button,{__next40pxDefaultSize:!0,variant:"tertiary",href:v,children:(0,li.__)("Take over")}),(0,Jr.jsx)(mu.Button,{__next40pxDefaultSize:!0,variant:"primary",href:b,children:_})]})]})]})})}var aEe=sEe;var cEe=a(j(),1),uEe=a(G(),1),lF=a(Y(),1);var lEe=a(Y(),1);function nst({children:e}){let{hasPublishAction:t,isPublished:r}=(0,lEe.useSelect)(o=>{let{isCurrentPostPublished:n,getCurrentPost:i}=o(I);return{hasPublishAction:i()._links?.["wp:action-publish"]??!1,isPublished:n()}},[]);return r||!t?null:e}var aF=nst;var iq=a(T(),1);function ist(){let e=(0,lF.useSelect)(o=>o(I).getEditedPostAttribute("status"),[]),{editPost:t}=(0,lF.useDispatch)(I),r=()=>{t({status:e==="pending"?"draft":"pending"})};return(0,iq.jsx)(aF,{children:(0,iq.jsx)(uEe.CheckboxControl,{label:(0,cEe.__)("Pending review"),checked:e==="pending",onChange:r})})}var dEe=ist;var fEe=a(U(),1),Yp=a(G(),1),jy=a(j(),1),cF=a(Y(),1),pEe=a(zn(),1),mEe=a(ae(),1);var Va=a(T(),1);function sst(){let e=(0,fEe.renderToString)((0,Va.jsxs)("div",{className:"editor-post-preview-button__interstitial-message",children:[(0,Va.jsxs)(Yp.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 96 96",children:[(0,Va.jsx)(Yp.Path,{className:"outer",d:"M48 12c19.9 0 36 16.1 36 36S67.9 84 48 84 12 67.9 12 48s16.1-36 36-36",fill:"none"}),(0,Va.jsx)(Yp.Path,{className:"inner",d:"M69.5 46.4c0-3.9-1.4-6.7-2.6-8.8-1.6-2.6-3.1-4.9-3.1-7.5 0-2.9 2.2-5.7 5.4-5.7h.4C63.9 19.2 56.4 16 48 16c-11.2 0-21 5.7-26.7 14.4h2.1c3.3 0 8.5-.4 8.5-.4 1.7-.1 1.9 2.4.2 2.6 0 0-1.7.2-3.7.3L40 67.5l7-20.9L42 33c-1.7-.1-3.3-.3-3.3-.3-1.7-.1-1.5-2.7.2-2.6 0 0 5.3.4 8.4.4 3.3 0 8.5-.4 8.5-.4 1.7-.1 1.9 2.4.2 2.6 0 0-1.7.2-3.7.3l11.5 34.3 3.3-10.4c1.6-4.5 2.4-7.8 2.4-10.5zM16.1 48c0 12.6 7.3 23.5 18 28.7L18.8 35c-1.7 4-2.7 8.4-2.7 13zm32.5 2.8L39 78.6c2.9.8 5.9 1.3 9 1.3 3.7 0 7.3-.6 10.6-1.8-.1-.1-.2-.3-.2-.4l-9.8-26.9zM76.2 36c0 3.2-.6 6.9-2.4 11.4L64 75.6c9.5-5.5 15.9-15.8 15.9-27.6 0-5.5-1.4-10.8-3.9-15.3.1 1 .2 2.1.2 3.3z",fill:"none"})]}),(0,Va.jsx)("p",{children:(0,jy.__)("Generating preview\u2026")})]}));return e+=`
`,e=(0,pEe.applyFilters)("editor.PostPreview.interstitialMarkup",e),e}function ast(e,t){e.write(t),e.title=(0,jy.__)("Generating preview\u2026"),e.close()}async function lst(e){try{return e.document}catch{}e.location="about:blank";let t=1e3,r=50,o=Date.now()+t;do{await new Promise(n=>setTimeout(n,r));try{return e.document}catch{}}while(Date.now(){let m=f(I),v=f(mEe.store).getPostType(m.getCurrentPostType("type"))?.viewable??!1;return v?{postId:m.getCurrentPostId(),currentPostLink:m.getCurrentPostAttribute("link"),previewLink:m.getEditedPostPreviewLink(),isSaveable:m.isEditedPostSaveable(),isViewable:v}:{isViewable:v}},[]),{__unstableSaveForPreview:l}=(0,cF.useDispatch)(I);if(!s)return null;let c=`wp-preview-${r}`;return{href:n||o,target:c,disabled:!i,onClick:async f=>{f.preventDefault();let m=window.open("",c);m.focus(),await cst(m);let h=await l({forceIsAutosaveable:e});m.location=h,t?.()}}}function gEe({forceIsAutosaveable:e,onPreview:t}){let r=hEe({forceIsAutosaveable:e,onPreview:t});return r?(0,Va.jsx)(Yp.MenuItem,{icon:gs,...r,children:(0,jy.__)("Preview in new tab")}):null}function LS({className:e,textContent:t,forceIsAutosaveable:r,role:o,onPreview:n}){let i=hEe({forceIsAutosaveable:r,onPreview:n});return i?(0,Va.jsx)(Yp.Button,{variant:e?void 0:"tertiary",className:e||"editor-post-preview",role:o,size:"compact",accessibleWhenDisabled:!0,...i,children:t||(0,Va.jsxs)(Va.Fragment,{children:[(0,jy._x)("Preview","imperative verb"),(0,Va.jsx)(Yt,{render:(0,Va.jsx)("span",{}),children:(0,jy.__)("(opens in a new tab)")})]})}):null}var wEe=a(G(),1),dF=a(Y(),1);var Ng=a(j(),1),vEe=a(Y(),1),bEe=a(Ce(),1);function uF(){let e=(0,bEe.useViewportMatch)("medium","<"),{isPublished:t,isBeingScheduled:r,isSaving:o,isPublishing:n,hasPublishAction:i,isAutosaving:s,hasNonPostEntityChanges:l,postStatusHasChanged:c,postStatus:u,isPostSavingLocked:d}=(0,vEe.useSelect)(f=>{let{isCurrentPostPublished:m,isEditedPostBeingScheduled:h,isSavingPost:g,isPublishingPost:v,getCurrentPost:b,isAutosavingPost:_,getPostEdits:y,getEditedPostAttribute:w}=f(I);return{isPublished:m(),isBeingScheduled:h(),isSaving:g(),isPublishing:v(),hasPublishAction:b()._links?.["wp:action-publish"]??!1,isAutosaving:_(),hasNonPostEntityChanges:f(I).hasNonPostEntityChanges(),isPostSavingLocked:f(I).isPostSavingLocked(),postStatusHasChanged:!!y()?.status,postStatus:w("status")}},[]);return n?(0,Ng.__)("Publishing\u2026"):(t||r)&&o&&!s?(0,Ng.__)("Saving\u2026"):i?l&&!d||t||c&&!["future","publish"].includes(u)||!c&&u==="future"?(0,Ng.__)("Save"):r?(0,Ng.__)("Schedule"):(0,Ng.__)("Publish"):e?(0,Ng.__)("Publish"):(0,Ng.__)("Submit for Review")}var sq=a(T(),1),yEe=()=>{};function ust({forceIsDirty:e,isOpen:t,isToggle:r,onSubmit:o=yEe,onToggle:n,setEntitiesSavedStatesCallback:i}){let{hasPublishAction:s,isBeingScheduled:l,isPostSavingLocked:c,isPublishable:u,isPublished:d,isSaveable:f,isSaving:m,isAutoSaving:h,visibility:g,hasNonPostEntityChanges:v,isSavingNonPostEntityChanges:b,postStatus:_,postStatusHasChanged:y,postType:w,postId:S}=(0,dF.useSelect)(z=>{let L=z(I);return{isSaving:L.isSavingPost(),isAutoSaving:L.isAutosavingPost(),isBeingScheduled:L.isEditedPostBeingScheduled(),visibility:L.getEditedPostVisibility(),isSaveable:L.isEditedPostSaveable(),isPostSavingLocked:L.isPostSavingLocked(),isPublishable:L.isEditedPostPublishable(),isPublished:L.isCurrentPostPublished(),hasPublishAction:!!L.getCurrentPost()?._links?.["wp:action-publish"],postType:L.getCurrentPostType(),postId:L.getCurrentPostId(),postStatus:L.getEditedPostAttribute("status"),postStatusHasChanged:L.getPostEdits()?.status,hasNonPostEntityChanges:L.hasNonPostEntityChanges(),isSavingNonPostEntityChanges:L.isSavingNonPostEntityChanges()}},[]),{editPost:x,savePost:C}=(0,dF.useDispatch)(I),A=z=>{x({status:z},{undoIgnore:!0}),C()},P=z=>(...L)=>{if(v&&i){let O=B=>{B&&B.some(W=>W.kind==="postType"&&W.name===w&&W.key===S)&&z(...L)};return i(()=>O),yEe}return z(...L)},R=c||b||(m||!f||!u&&!e)&&!v,N=c||b||(d||m||!f||!u&&!e)&&!v,k="publish";y?k=_:s?g==="private"?k="private":l&&(k="future"):k="pending";let E=()=>{R||(o(),A(k))},M=()=>{N||n()},V={"aria-disabled":R,className:"editor-post-publish-button",isBusy:!h&&m,variant:"primary",onClick:P(E),"aria-haspopup":v?"dialog":void 0},F={"aria-disabled":N,"aria-expanded":t,className:"editor-post-publish-panel__toggle",isBusy:m&&d,variant:"primary",size:"compact",onClick:P(M),"aria-haspopup":v?"dialog":void 0},D=r?F:V;return(0,sq.jsx)(wEe.Button,{...D,className:`${D.className} editor-post-publish-button__button`,size:"compact",children:(0,sq.jsx)(uF,{})})}var VS=ust;var kF=a(j(),1),YS=a(U(),1),Xy=a(G(),1),RF=a(Y(),1),Lg=a(Ce(),1);var hTe=a(ae(),1);var hu=a(j(),1),SP=a(G(),1),oTe=a(Y(),1);var nTe=a(vo(),1),iTe=a(ae(),1),sTe=a(Nt(),1);var BS=a(j(),1),_Ee=a(U(),1),jS=a(G(),1),SEe=a(Ce(),1),pF=a(Y(),1),xEe=a(be(),1);var zy=a(j(),1),fF=[{label:(0,zy.__)("Public"),value:"public",description:(0,zy.__)("Visible to everyone.")},{label:(0,zy.__)("Private"),value:"private",description:(0,zy.__)("Only visible to site admins and editors.")},{label:(0,zy.__)("Password protected"),value:"password",description:(0,zy.__)("Only visible to those who know the password.")}];var Hy=a(T(),1);function vP({onClose:e}){let t=(0,SEe.useInstanceId)(vP),{status:r,visibility:o,password:n}=(0,pF.useSelect)(d=>({status:d(I).getEditedPostAttribute("status"),visibility:d(I).getEditedPostVisibility(),password:d(I).getEditedPostAttribute("password")})),{editPost:i}=(0,pF.useDispatch)(I),[s,l]=(0,_Ee.useState)(!!n);function c(d){i({public:{status:o==="private"?"draft":r,password:""},private:{status:"private",password:""},password:{status:o==="private"?"draft":r,password:n||""}}[d]),l(d==="password")}let u=d=>{i({password:d})};return(0,Hy.jsxs)("div",{className:"editor-post-visibility",children:[(0,Hy.jsx)(xEe.__experimentalInspectorPopoverHeader,{title:(0,BS.__)("Visibility"),help:(0,BS.__)("Control how this post is viewed."),onClose:e}),(0,Hy.jsxs)(jS.__experimentalVStack,{spacing:4,children:[(0,Hy.jsx)(jS.RadioControl,{label:(0,BS.__)("Visibility"),hideLabelFromVision:!0,options:fF,selected:s?"password":o,onChange:c}),s&&(0,Hy.jsx)(jS.TextControl,{label:(0,BS.__)("Password"),onChange:u,value:n,placeholder:(0,BS.__)("Use a secure password"),type:"text",id:`editor-post-visibility__password-input-${t}`,maxLength:255})]})]})}var CEe=a(Y(),1);function mF(){return aq()}function aq(){let e=(0,CEe.useSelect)(t=>t(I).getEditedPostVisibility(),[]);return fF.find(t=>t.value===e)?.label}var EEe=a(cn(),1),TEe=a(j(),1),bP=a(Y(),1),PEe=a(be(),1),hF=a(U(),1),kEe=a(ae(),1);var lq=a(T(),1),{PrivatePublishDateTimePicker:dst}=q(PEe.privateApis);function zS(e){return(0,lq.jsx)(cq,{...e,showPopoverHeaderActions:!0,isCompact:!1})}function cq({onClose:e,showPopoverHeaderActions:t,isCompact:r}){let{postDate:o,postType:n}=(0,bP.useSelect)(h=>({postDate:h(I).getEditedPostAttribute("date"),postType:h(I).getCurrentPostType()}),[]),{editPost:i}=(0,bP.useDispatch)(I),s=h=>i({date:h}),[l,c]=(0,hF.useState)(IE(new Date(o))),u=(0,bP.useSelect)(h=>h(kEe.store).getEntityRecords("postType",n,{status:"publish,future",after:IE(l).toISOString(),before:nde(l).toISOString(),exclude:[h(I).getCurrentPostId()],per_page:100,_fields:"id,date"}),[l,n]),d=(0,hF.useMemo)(()=>(u||[]).map(({date:h})=>({date:new Date(h)})),[u]),f=(0,EEe.getSettings)(),m=/a(?!\\)/i.test(f.formats.time.toLowerCase().replace(/\\\\/g,"").split("").reverse().join(""));return(0,lq.jsx)(dst,{currentDate:o,onChange:s,is12Hour:m,dateOrder:(0,TEe._x)("dmy","date order"),events:d,onMonthPreviewed:h=>c(xde(h)),onClose:e,isCompact:r,showPopoverHeaderActions:t})}var Qs=a(j(),1),uc=a(cn(),1),AEe=a(Y(),1);function HS(e){return US(e)}function US({full:e=!1}={}){let{date:t,isFloating:r}=(0,AEe.useSelect)(o=>({date:o(I).getEditedPostAttribute("date"),isFloating:o(I).isEditedPostDateFloating()}),[]);return e?IEe(t):fst(t,{isFloating:r})}function IEe(e){let t=(0,uc.getDate)(e),r=pst(),o=(0,uc.dateI18n)((0,Qs._x)("F j, Y g:i\xA0a","post schedule full date format"),t);return(0,Qs.isRTL)()?`${r} ${o}`:`${o} ${r}`}function fst(e,{isFloating:t=!1,now:r=new Date}={}){if(!e||t)return(0,Qs.__)("Immediately");if(!mst(r))return IEe(e);let o=(0,uc.getDate)(e);if(REe(o,r))return(0,Qs.sprintf)((0,Qs.__)("Today at %s"),(0,uc.dateI18n)((0,Qs._x)("g:i\xA0a","post schedule time format"),o));let n=new Date(r);return n.setDate(n.getDate()+1),REe(o,n)?(0,Qs.sprintf)((0,Qs.__)("Tomorrow at %s"),(0,uc.dateI18n)((0,Qs._x)("g:i\xA0a","post schedule time format"),o)):o.getFullYear()===r.getFullYear()?(0,uc.dateI18n)((0,Qs._x)("F j g:i\xA0a","post schedule date format without year"),o):(0,uc.dateI18n)((0,Qs._x)("F j, Y g:i\xA0a","post schedule full date format"),o)}function pst(){let{timezone:e}=(0,uc.getSettings)();return e.abbr&&isNaN(Number(e.abbr))?e.abbr:`UTC${e.offset<0?"":"+"}${e.offsetFormatted}`}function mst(e){let{timezone:t}=(0,uc.getSettings)(),r=Number(t.offset),o=-1*(e.getTimezoneOffset()/60);return r===o}function REe(e,t){return e.getDate()===t.getDate()&&e.getMonth()===t.getMonth()&&e.getFullYear()===t.getFullYear()}var Yy=a(j(),1),zEe=a(U(),1),pq=a(Y(),1),HEe=a(G(),1),wF=a(ae(),1);var Pi=a(j(),1),Gy=a(U(),1),bF=a(G(),1);var Wy=a(Y(),1),vF=a(ae(),1),DEe=a(Ce(),1),LEe=a(Nl(),1),VEe=a(It(),1);var gF=a(G(),1),OEe=a(Y(),1),NEe=a(ae(),1);var Uy=a(T(),1),hst=3,gst={per_page:10,orderby:"count",order:"desc",hide_empty:!0,_fields:"id,name,count",context:"view"};function MEe({onSelect:e,taxonomy:t}){let{_terms:r,showTerms:o}=(0,OEe.useSelect)(i=>{let s=i(NEe.store).getEntityRecords("taxonomy",t.slug,gst);return{_terms:s,showTerms:s?.length>=hst}},[t.slug]);if(!o)return null;let n=Wxe(r);return(0,Uy.jsxs)("div",{className:"editor-post-taxonomies__flat-term-most-used",children:[(0,Uy.jsx)(gF.BaseControl.VisualLabel,{as:"h3",className:"editor-post-taxonomies__flat-term-most-used-label",children:t.labels.most_used}),(0,Uy.jsx)("ul",{role:"list",className:"editor-post-taxonomies__flat-term-most-used-list",children:n.map(i=>(0,Uy.jsx)("li",{children:(0,Uy.jsx)(gF.Button,{__next40pxDefaultSize:!0,variant:"link",onClick:()=>e(i),children:i.name})},i.id))})]})}var yP=a(T(),1),uq=[],BEe=100,FEe={per_page:BEe,_fields:"id,name",context:"view"},jEe=(e,t)=>wS(e).toLowerCase()===wS(t).toLowerCase(),dq=(e,t)=>e.map(r=>t.find(o=>jEe(o.name,r))?.id).filter(r=>r!==void 0);function fq({slug:e}){let[t,r]=(0,Gy.useState)([]),[o,n]=(0,Gy.useState)(""),i=(0,DEe.useDebounce)(n,500),{terms:s,termIds:l,taxonomy:c,hasAssignAction:u,hasCreateAction:d,hasResolvedTerms:f}=(0,Wy.useSelect)(N=>{let{getCurrentPost:k,getEditedPostAttribute:E}=N(I),{getEntityRecords:M,getEntityRecord:V,hasFinishedResolution:F}=N(vF.store),D=k(),z=V("root","taxonomy",e),L=z?E(z.rest_base):uq,O={...FEe,include:L?.join(","),per_page:-1};return{hasCreateAction:z?D._links?.["wp:action-create-"+z.rest_base]??!1:!1,hasAssignAction:z?D._links?.["wp:action-assign-"+z.rest_base]??!1:!1,taxonomy:z,termIds:L,terms:L?.length?M("taxonomy",e,O):uq,hasResolvedTerms:F("getEntityRecords",["taxonomy",e,O])}},[e]),{searchResults:m}=(0,Wy.useSelect)(N=>{let{getEntityRecords:k}=N(vF.store);return{searchResults:o?k("taxonomy",e,{...FEe,search:o}):uq}},[o,e]);(0,Gy.useEffect)(()=>{if(f){let N=(s??[]).map(k=>wS(k.name));r(N)}},[s,f]);let h=(0,Gy.useMemo)(()=>(m??[]).map(N=>wS(N.name)),[m]),{editPost:g}=(0,Wy.useDispatch)(I),{saveEntityRecord:v}=(0,Wy.useDispatch)(vF.store),{createErrorNotice:b}=(0,Wy.useDispatch)(VEe.store);if(!u)return null;async function _(N){try{let k=await v("taxonomy",e,N,{throwOnError:!0});return RY(k)}catch(k){if(k.code!=="term_exists")throw k;return{id:k.data.term_id,name:N.name}}}function y(N){g({[c.rest_base]:N})}function w(N){let k=[...s??[],...m??[]],E=N.reduce((V,F)=>(V.some(D=>D.toLowerCase()===F.toLowerCase())||V.push(F),V),[]),M=E.filter(V=>!k.find(F=>jEe(F.name,V)));if(r(E),M.length===0){y(dq(E,k));return}d&&Promise.all(M.map(V=>_({name:V}))).then(V=>{let F=k.concat(V);y(dq(E,F))}).catch(V=>{b(V.message,{type:"snackbar"}),y(dq(E,k))})}function S(N){if(l.includes(N.id))return;let k=[...l,N.id],E=e==="post_tag"?(0,Pi.__)("Tag"):(0,Pi.__)("Term"),M=(0,Pi.sprintf)((0,Pi._x)("%s added","term"),c?.labels?.singular_name??E);(0,LEe.speak)(M,"assertive"),y(k)}let x=c?.labels?.add_new_item??(e==="post_tag"?(0,Pi.__)("Add Tag"):(0,Pi.__)("Add Term")),C=c?.labels?.singular_name??(e==="post_tag"?(0,Pi.__)("Tag"):(0,Pi.__)("Term")),A=(0,Pi.sprintf)((0,Pi._x)("%s added","term"),C),P=(0,Pi.sprintf)((0,Pi._x)("%s removed","term"),C),R=(0,Pi.sprintf)((0,Pi._x)("Remove %s","term"),C);return(0,yP.jsxs)(le,{direction:"column",gap:"lg",children:[(0,yP.jsx)(bF.FormTokenField,{value:t,suggestions:h,onChange:w,onInputChange:i,maxSuggestions:BEe,label:x,messages:{added:A,removed:P,remove:R}}),(0,yP.jsx)(MEe,{taxonomy:c,onSelect:S})]})}var yF=(0,bF.withFilters)("editor.PostTaxonomyType")(fq);var qy=a(T(),1),vst=()=>{let e=(0,pq.useSelect)(n=>n(wF.store).getTaxonomy("post_tag")?.labels,[]),t=e?.add_new_item??(0,Yy.__)("Add tag"),r=e?.name??(0,Yy.__)("Tags"),o=[(0,Yy.__)("Suggestion:"),(0,qy.jsx)("span",{className:"editor-post-publish-panel__link",children:t},"label")];return(0,qy.jsxs)(HEe.PanelBody,{initialOpen:!1,title:o,children:[(0,qy.jsx)("p",{children:(0,Yy.sprintf)((0,Yy.__)("%s help users and search engines navigate your site and find your content. Add a few keywords to describe your post."),r)}),(0,qy.jsx)(yF,{slug:"post_tag"})]})},bst=()=>{let{postHasTags:e,siteHasTags:t,isPostTypeSupported:r}=(0,pq.useSelect)(n=>{let i=n(I).getCurrentPostType(),s=n(wF.store).getEntityRecord("root","taxonomy","post_tag"),l=s?.types?.includes(i),c=s!==void 0,u=s&&n(I).getEditedPostAttribute(s.rest_base),d=l?!!n(wF.store).getEntityRecords("taxonomy","post_tag",{per_page:1})?.length:!1;return{postHasTags:!!u?.length,siteHasTags:d,isPostTypeSupported:c&&l}},[]),[o]=(0,zEe.useState)(e);return!r||!t||o?null:(0,qy.jsx)(vst,{})},UEe=bst;var _F=a(G(),1),SF=a(Y(),1),Ky=a(j(),1),WEe=a(ae(),1);var Mg=a(T(),1),yst=(e,t)=>fP.filter(o=>e?.includes(o.id)).find(o=>o.id===t),wst=({suggestedPostFormat:e,suggestionText:t,onUpdatePostFormat:r})=>(0,Mg.jsx)(_F.Button,{__next40pxDefaultSize:!0,variant:"link",onClick:()=>r(e),children:t});function GEe(){let{currentPostFormat:e,suggestion:t}=(0,SF.useSelect)(i=>{let{getEditedPostAttribute:s,getSuggestedPostFormat:l}=i(I),c=i(WEe.store).getThemeSupports().formats??[];return{currentPostFormat:s("format"),suggestion:yst(c,l())}},[]),{editPost:r}=(0,SF.useDispatch)(I),o=i=>r({format:i}),n=[(0,Ky.__)("Suggestion:"),(0,Mg.jsx)("span",{className:"editor-post-publish-panel__link",children:(0,Ky.__)("Use a post format")},"label")];return!t||t.id===e?null:(0,Mg.jsxs)(_F.PanelBody,{initialOpen:!1,title:n,children:[(0,Mg.jsx)("p",{children:(0,Ky.__)("Your theme uses post formats to highlight different kinds of content, like images or videos. Apply a post format to see this special styling.")}),(0,Mg.jsx)("p",{children:(0,Mg.jsx)(wst,{onUpdatePostFormat:o,suggestedPostFormat:t.id,suggestionText:(0,Ky.sprintf)((0,Ky.__)('Apply the "%1$s" format.'),t.caption)})})]})}var CF=a(j(),1),JEe=a(Y(),1),$Ee=a(G(),1),gq=a(ae(),1),EF=a(U(),1);var ui=a(j(),1),qp=a(U(),1),ZEe=a(It(),1),po=a(G(),1),WS=a(Y(),1),XEe=a(Ce(),1),wP=a(ae(),1),mq=a(Nl(),1),QEe=a(Nt(),1);var ci=a(T(),1),{normalizeTextString:YEe}=q(po.privateApis),{RECEIVE_INTERMEDIATE_RESULTS:_st}=q(wP.privateApis),qEe={per_page:-1,orderby:"name",order:"asc",_fields:"id,name,parent",context:"view",[_st]:!0},Sst=8,KEe=[];function xst(e,t){let r=i=>t.indexOf(i.id)!==-1?!0:i.children===void 0?!1:i.children.map(r).filter(s=>s).length>0,o=(i,s)=>{let l=r(i),c=r(s);return l===c?0:l&&!c?-1:!l&&c?1:0},n=[...e];return n.sort(o),n}function Cst(e,t,r){return e.find(o=>(!o.parent&&!t||parseInt(o.parent)===parseInt(t))&&o.name.toLowerCase()===r.toLowerCase())}function Est(e){let t=r=>{if(e==="")return r;let o={...r};return o.children.length>0&&(o.children=o.children.map(t).filter(n=>n)),YEe(o.name).indexOf(YEe(e))!==-1||o.children.length>0?o:!1};return t}function hq({slug:e}){let[t,r]=(0,qp.useState)(!1),[o,n]=(0,qp.useState)(""),[i,s]=(0,qp.useState)(""),[l,c]=(0,qp.useState)(!1),[u,d]=(0,qp.useState)(""),[f,m]=(0,qp.useState)([]),h=(0,XEe.useDebounce)(mq.speak,500),{hasCreateAction:g,hasAssignAction:v,terms:b,loading:_,availableTerms:y,taxonomy:w}=(0,WS.useSelect)(te=>{let{getCurrentPost:de,getEditedPostAttribute:pe}=te(I),{getEntityRecord:$,getEntityRecords:oe,isResolving:fe}=te(wP.store),ve=$("root","taxonomy",e),Oe=de();return{hasCreateAction:ve?!!Oe._links?.["wp:action-create-"+ve.rest_base]:!1,hasAssignAction:ve?!!Oe._links?.["wp:action-assign-"+ve.rest_base]:!1,terms:ve?pe(ve.rest_base):KEe,loading:fe("getEntityRecords",["taxonomy",e,qEe]),availableTerms:oe("taxonomy",e,qEe)||KEe,taxonomy:ve}},[e]),{editPost:S}=(0,WS.useDispatch)(I),{saveEntityRecord:x}=(0,WS.useDispatch)(wP.store),C=(0,qp.useMemo)(()=>xst(d6(y),b),[y]),{createErrorNotice:A}=(0,WS.useDispatch)(ZEe.store);if(!v)return null;let P=te=>x("taxonomy",e,te,{throwOnError:!0}),R=te=>{S({[w.rest_base]:te})},N=te=>{let pe=b.includes(te)?b.filter($=>$!==te):[...b,te];R(pe)},k=te=>{n(te)},E=te=>{s(te)},M=()=>{c(!l)},V=async te=>{if(te.preventDefault(),o===""||t)return;let de=Cst(y,i,o);if(de){b.some(fe=>fe===de.id)||R([...b,de.id]),n(""),s("");return}r(!0);let pe;try{pe=await P({name:o,parent:i||void 0})}catch(fe){A(fe.message,{type:"snackbar"});return}let $=e==="category"?(0,ui.__)("Category"):(0,ui.__)("Term"),oe=(0,ui.sprintf)((0,ui._x)("%s added","term"),w?.labels?.singular_name??$);(0,mq.speak)(oe,"assertive"),r(!1),n(""),s(""),R([...b,pe.id])},F=te=>{let de=C.map(Est(te)).filter(fe=>fe),pe=fe=>{let ve=0;for(let Oe=0;Oete.map(de=>(0,ci.jsxs)("div",{className:"editor-post-taxonomies__hierarchical-terms-choice",children:[(0,ci.jsx)(po.CheckboxControl,{checked:b.indexOf(de.id)!==-1,onChange:()=>{let pe=parseInt(de.id,10);N(pe)},label:(0,QEe.decodeEntities)(de.name)}),!!de.children.length&&(0,ci.jsx)("div",{className:"editor-post-taxonomies__hierarchical-terms-subchoices",children:D(de.children)})]},de.id)),z=(te,de,pe)=>w?.labels?.[te]??(e==="category"?de:pe),L=z("add_new_item",(0,ui.__)("Add Category"),(0,ui.__)("Add Term")),O=z("new_item_name",(0,ui.__)("Add Category"),(0,ui.__)("Add Term")),B=z("parent_item",(0,ui.__)("Parent Category"),(0,ui.__)("Parent Term")),W=`\u2014 ${B} \u2014`,K=L,Z=w?.labels?.search_items??(0,ui.__)("Search Terms"),Q=w?.name??(0,ui.__)("Terms"),ue=y.length>=Sst;return(0,ci.jsxs)(po.Flex,{direction:"column",gap:"4",children:[ue&&!_&&(0,ci.jsx)(po.SearchControl,{label:Z,placeholder:Z,value:u,onChange:F}),_&&(0,ci.jsx)(po.Flex,{justify:"center",style:{height:"40px"},children:(0,ci.jsx)(po.Spinner,{})}),(0,ci.jsx)("div",{className:"editor-post-taxonomies__hierarchical-terms-list",tabIndex:"0",role:"group","aria-label":Q,children:D(u!==""?f:C)}),!_&&g&&(0,ci.jsx)(po.FlexItem,{children:(0,ci.jsx)(po.Button,{__next40pxDefaultSize:!0,onClick:M,className:"editor-post-taxonomies__hierarchical-terms-add","aria-expanded":l,variant:"link",children:L})}),l&&(0,ci.jsx)("form",{onSubmit:V,children:(0,ci.jsxs)(po.Flex,{direction:"column",gap:"4",children:[(0,ci.jsx)(po.TextControl,{className:"editor-post-taxonomies__hierarchical-terms-input",label:O,value:o,onChange:k,required:!0}),!!y.length&&(0,ci.jsx)(po.TreeSelect,{label:B,noOptionLabel:W,onChange:E,selectedId:i,tree:C}),(0,ci.jsx)(po.FlexItem,{children:(0,ci.jsx)(po.Button,{__next40pxDefaultSize:!0,variant:"secondary",type:"submit",className:"editor-post-taxonomies__hierarchical-terms-submit",children:K})})]})})]})}var xF=(0,po.withFilters)("editor.PostTaxonomyType")(hq);var GS=a(T(),1);function Tst(){let{hasNoCategory:e,hasSiteCategories:t}=(0,JEe.useSelect)(i=>{let s=i(I).getCurrentPostType(),{canUser:l,getEntityRecord:c}=i(gq.store),u=c("root","taxonomy","category"),d=l("read",{kind:"root",name:"site"})?c("root","site")?.default_category:void 0,f=d?c("taxonomy","category",d):void 0,m=u&&u.types.some(b=>b===s),h=u&&i(I).getEditedPostAttribute(u.rest_base),g=m?!!i(gq.store).getEntityRecords("taxonomy","category",{exclude:[d],per_page:1})?.length:!1;return{hasNoCategory:!!u&&!!f&&m&&(h?.length===0||h?.length===1&&f?.id===h[0]),hasSiteCategories:g}},[]),[r,o]=(0,EF.useState)(!1);if((0,EF.useEffect)(()=>{e&&o(!0)},[e]),!r||!t)return null;let n=[(0,CF.__)("Suggestion:"),(0,GS.jsx)("span",{className:"editor-post-publish-panel__link",children:(0,CF.__)("Assign a category")},"label")];return(0,GS.jsxs)($Ee.PanelBody,{initialOpen:!1,title:n,children:[(0,GS.jsx)("p",{children:(0,CF.__)("Categories provide a helpful way to group related posts together and to quickly tell readers what a post is about.")}),(0,GS.jsx)(xF,{slug:"category"})]})}var eTe=Tst;var Qd=a(G(),1),_P=a(Y(),1),Fg=a(j(),1),Zy=a(be(),1),TF=a(U(),1);var dc=a(T(),1),{mediaSideloadFromUrlKey:Pst}=q(Zy.privateApis);function tTe(e){let t=[];return e.forEach(r=>{t.push(r),t.push(...tTe(r.innerBlocks))}),t}function kst(e){if(e.name==="core/image"||e.name==="core/cover")return e.attributes.url&&!e.attributes.id;if(e.name==="core/media-text")return e.attributes.mediaUrl&&!e.attributes.mediaId}function vq(e){if(e.name==="core/image"||e.name==="core/cover"){let{url:t,alt:r,id:o}=e.attributes;return{url:t,alt:r,id:o}}if(e.name==="core/media-text"){let{mediaUrl:t,mediaAlt:r,mediaId:o}=e.attributes;return{url:t,alt:r,id:o}}return{}}function Rst({clientId:e,alt:t,url:r}){let{selectBlock:o}=(0,_P.useDispatch)(Zy.store);return(0,dc.jsx)(Qd.__unstableMotion.img,{tabIndex:0,role:"button","aria-label":(0,Fg.__)("Select image block."),onClick:()=>{o(e)},onKeyDown:n=>{(n.key==="Enter"||n.key===" ")&&(o(e),n.preventDefault())},alt:t,src:r,animate:{opacity:1},exit:{opacity:0,scale:0},style:{width:"32px",height:"32px",objectFit:"cover",borderRadius:"2px",cursor:"var(--wpds-cursor-control, pointer)"},whileHover:{scale:1.08}},e)}function rTe(){let[e,t]=(0,TF.useState)(!1),[r,o]=(0,TF.useState)(!1),[n,i]=(0,TF.useState)(!1),{editorBlocks:s,mediaSideloadFromUrl:l}=(0,_P.useSelect)(h=>({editorBlocks:h(Zy.store).getBlocks(),mediaSideloadFromUrl:h(Zy.store).getSettings()[Pst]}),[]),c=tTe(s).filter(h=>kst(h)),{updateBlockAttributes:u}=(0,_P.useDispatch)(Zy.store);if(!l||!c.length)return null;let d=[(0,Fg.__)("Suggestion:"),(0,dc.jsx)("span",{className:"editor-post-publish-panel__link",children:(0,Fg.__)("External media")},"label")];function f(h,g){(h.name==="core/image"||h.name==="core/cover")&&u(h.clientId,{id:g.id,url:g.url}),h.name==="core/media-text"&&u(h.clientId,{mediaId:g.id,mediaUrl:g.url})}function m(){t(!0),i(!1);let h=new Set(c.map(v=>{let{url:b}=vq(v);return b})),g=Object.fromEntries([...h].map(v=>{let b=new Promise((_,y)=>{l({url:v,onSuccess:w=>_(w),onError:()=>y()})});return[v,b]}));Promise.allSettled(c.map(v=>{let{url:b}=vq(v);return g[b].then(_=>f(v,_)).then(()=>o(!0)).catch(()=>i(!0))})).finally(()=>{t(!1)})}return(0,dc.jsxs)(Qd.PanelBody,{initialOpen:!0,title:d,children:[(0,dc.jsx)("p",{children:(0,Fg.__)("Upload external images to the Media Library. Images from different domains may load slowly, display incorrectly, or be removed unexpectedly.")}),(0,dc.jsxs)("div",{style:{display:"inline-flex",flexWrap:"wrap",gap:"8px"},children:[(0,dc.jsx)(Qd.__unstableAnimatePresence,{onExitComplete:()=>o(!1),children:c.map(h=>{let{url:g,alt:v}=vq(h);return(0,dc.jsx)(Rst,{clientId:h.clientId,url:g,alt:v},h.clientId)})}),e||r?(0,dc.jsx)(Qd.Spinner,{}):(0,dc.jsx)(Qd.Button,{size:"compact",variant:"primary",onClick:m,children:(0,Fg._x)("Upload","verb")})]}),n&&(0,dc.jsx)("p",{children:(0,Fg.__)("Upload failed, try again.")})]})}var Nr=a(T(),1);function Ast({children:e}){let{isBeingScheduled:t,isRequestingSiteIcon:r,hasPublishAction:o,siteIconUrl:n,siteTitle:i,siteHome:s}=(0,oTe.useSelect)(d=>{let{getCurrentPost:f,isEditedPostBeingScheduled:m}=d(I),{getEntityRecord:h,isResolving:g}=d(iTe.store),v=h("root","__unstableBase",void 0)||{};return{hasPublishAction:f()._links?.["wp:action-publish"]??!1,isBeingScheduled:m(),isRequestingSiteIcon:g("getEntityRecord",["root","__unstableBase",void 0]),siteIconUrl:v.site_icon_url,siteTitle:v.name,siteHome:v.home&&(0,nTe.filterURLForDisplay)(v.home)}},[]),l=(0,Nr.jsx)(SP.Icon,{className:"components-site-icon",size:"36px",icon:m8});n&&(l=(0,Nr.jsx)("img",{alt:(0,hu.__)("Site Icon"),className:"components-site-icon",src:n})),r&&(l=null);let c,u;return o?t?(c=(0,hu.__)("Are you ready to schedule?"),u=(0,hu.__)("Your work will be published at the specified date and time.")):(c=(0,hu.__)("Are you ready to publish?"),u=(0,hu.__)("Double-check your settings before publishing.")):(c=(0,hu.__)("Are you ready to submit for review?"),u=(0,hu.__)("Your work will be reviewed and then approved.")),(0,Nr.jsxs)("div",{className:"editor-post-publish-panel__prepublish",children:[(0,Nr.jsx)("div",{children:(0,Nr.jsx)("strong",{children:c})}),(0,Nr.jsx)("p",{children:u}),(0,Nr.jsxs)("div",{className:"components-site-card",children:[l,(0,Nr.jsxs)("div",{className:"components-site-info",children:[(0,Nr.jsx)("span",{className:"components-site-name",children:(0,sTe.decodeEntities)(i)||(0,hu.__)("(Untitled)")}),(0,Nr.jsx)("span",{className:"components-site-home",children:s})]})]}),(0,Nr.jsx)(rTe,{}),o&&(0,Nr.jsxs)(Nr.Fragment,{children:[(0,Nr.jsx)(SP.PanelBody,{initialOpen:!1,title:[(0,hu.__)("Visibility:"),(0,Nr.jsx)("span",{className:"editor-post-publish-panel__link",children:(0,Nr.jsx)(mF,{})},"label")],children:(0,Nr.jsx)(vP,{})}),(0,Nr.jsx)(SP.PanelBody,{initialOpen:!1,title:[(0,hu.__)("Publish:"),(0,Nr.jsx)("span",{className:"editor-post-publish-panel__link",children:(0,Nr.jsx)(HS,{})},"label")],children:(0,Nr.jsx)(zS,{})})]}),(0,Nr.jsx)(GEe,{}),(0,Nr.jsx)(UEe,{}),(0,Nr.jsx)(eTe,{}),e]})}var aTe=Ast;var vu=a(G(),1),gu=a(j(),1),Dg=a(U(),1),uTe=a(Y(),1),PF=a(vo(),1),dTe=a(Nt(),1),fTe=a(Ce(),1),pTe=a(ae(),1);var qo=a(T(),1),lTe="%postname%",cTe="%pagename%",Ist=e=>{let{slug:t}=e;return e.permalink_template.includes(lTe)?e.permalink_template.replace(lTe,t):e.permalink_template.includes(cTe)?e.permalink_template.replace(cTe,t):e.permalink_template};function Ost({text:e}){let[t,r]=(0,Dg.useState)(!1),o=(0,Dg.useRef)(),n=(0,fTe.useCopyToClipboard)(e,()=>{r(!0),o.current&&clearTimeout(o.current),o.current=setTimeout(()=>{r(!1)},4e3)});return(0,Dg.useEffect)(()=>()=>{o.current&&clearTimeout(o.current)},[]),(0,qo.jsx)(vu.Button,{__next40pxDefaultSize:!0,variant:"secondary",ref:n,children:t?(0,gu.__)("Copied!"):(0,gu.__)("Copy")})}function mTe({focusOnMount:e,children:t}){let{post:r,postType:o,isScheduled:n}=(0,uTe.useSelect)(m=>{let{getEditedPostAttribute:h,getCurrentPost:g,isCurrentPostScheduled:v}=m(I),{getPostType:b}=m(pTe.store);return{post:g(),postType:b(h("type")),isScheduled:v()}},[]),i=o?.labels?.singular_name,s=o?.labels?.view_item,l=o?.labels?.add_new_item,c=r.status==="future"?Ist(r):r.link,u=(0,PF.addQueryArgs)("post-new.php",{post_type:r.type}),d=(0,Dg.useCallback)(m=>{e&&m&&m.focus()},[e]),f=n?(0,qo.jsxs)(qo.Fragment,{children:[(0,gu.__)("is now scheduled. It will go live on")," ",(0,qo.jsx)(HS,{}),"."]}):(0,gu.__)("is now live.");return(0,qo.jsxs)("div",{className:"post-publish-panel__postpublish",children:[(0,qo.jsxs)(vu.PanelBody,{className:"post-publish-panel__postpublish-header",children:[(0,qo.jsx)(vu.ExternalLink,{ref:d,href:c,children:(0,dTe.decodeEntities)(r.title)||(0,gu.__)("(no title)")})," ",f]}),(0,qo.jsxs)(vu.PanelBody,{children:[(0,qo.jsx)("p",{className:"post-publish-panel__postpublish-subheader",children:(0,qo.jsx)("strong",{children:(0,gu.__)("What\u2019s next?")})}),(0,qo.jsxs)("div",{className:"post-publish-panel__postpublish-post-address-container",children:[(0,qo.jsx)(vu.TextControl,{className:"post-publish-panel__postpublish-post-address",readOnly:!0,label:(0,gu.sprintf)((0,gu.__)("%s address"),i),value:(0,PF.safeDecodeURIComponent)(c),onFocus:m=>m.target.select()}),(0,qo.jsx)("div",{className:"post-publish-panel__postpublish-post-address__copy-button-wrap",children:(0,qo.jsx)(Ost,{text:c})})]}),(0,qo.jsxs)("div",{className:"post-publish-panel__postpublish-buttons",children:[!n&&(0,qo.jsxs)(vu.Button,{variant:"primary",href:c,__next40pxDefaultSize:!0,icon:gs,iconPosition:"right",target:"_blank",children:[s,(0,qo.jsx)(Yt,{render:(0,qo.jsx)("span",{}),children:(0,gu.__)("(opens in a new tab)")})]}),(0,qo.jsx)(vu.Button,{variant:n?"primary":"secondary",__next40pxDefaultSize:!0,href:u,children:l})]})]}),t]})}var Sn=a(T(),1);function AF({forceIsDirty:e,onClose:t,PostPublishExtension:r,PrePublishExtension:o,...n}){let{hasPublishAction:i,isPostTypeViewable:s,isBeingScheduled:l,isDirty:c,isPublished:u,isPublishSidebarEnabled:d,isSaving:f,isSavingNonPostEntityChanges:m,isScheduled:h,currentPostId:g}=(0,RF.useSelect)(N=>{let{getPostType:k}=N(hTe.store),{getCurrentPost:E,getCurrentPostId:M,getEditedPostAttribute:V,isCurrentPostPublished:F,isCurrentPostScheduled:D,isEditedPostBeingScheduled:z,isEditedPostDirty:L,isAutosavingPost:O,isSavingPost:B,isSavingNonPostEntityChanges:W,isPublishSidebarEnabled:K}=N(I),Z=k(V("type"));return{hasPublishAction:E()._links?.["wp:action-publish"]??!1,isPostTypeViewable:Z?.viewable,isBeingScheduled:z(),isDirty:L(),isPublished:F(),isPublishSidebarEnabled:K(),isSaving:B()&&!O(),isSavingNonPostEntityChanges:W(),isScheduled:D(),currentPostId:M()}},[]),{disablePublishSidebar:v,enablePublishSidebar:b}=(0,RF.useDispatch)(I),_=(0,YS.useRef)(null),y=(0,Lg.useMergeRefs)([(0,Lg.useFocusReturn)(),(0,Lg.useConstrainedTabbing)()]);(0,YS.useEffect)(()=>{_.current?.focus()},[]);let w=(0,YS.useRef)(g),S=(0,Lg.useEvent)(t);(0,YS.useEffect)(()=>{let N=g!==w.current;w.current=g,(N||u&&!f&&c)&&S()},[u,f,c,g,S]);function x(){d?v():b()}function C(){(!i||!s)&&t()}let A=u||h&&l,P=!A&&!f,R=A&&!f;return(0,Sn.jsxs)("div",{ref:y,tabIndex:-1,className:"editor-post-publish-panel",...n,children:[(0,Sn.jsx)("div",{className:"editor-post-publish-panel__header",children:R?(0,Sn.jsx)(Xy.Button,{size:"compact",onClick:t,icon:Fi,label:(0,kF.__)("Close panel")}):(0,Sn.jsxs)(Sn.Fragment,{children:[(0,Sn.jsx)("div",{className:"editor-post-publish-panel__header-cancel-button",children:(0,Sn.jsx)(Xy.Button,{ref:_,accessibleWhenDisabled:!0,disabled:m,onClick:t,variant:"secondary",size:"compact",children:(0,kF.__)("Cancel")})}),(0,Sn.jsx)("div",{className:"editor-post-publish-panel__header-publish-button",children:(0,Sn.jsx)(VS,{onSubmit:C,forceIsDirty:e})})]})}),(0,Sn.jsxs)("div",{className:"editor-post-publish-panel__content",children:[P&&(0,Sn.jsx)(aTe,{children:o&&(0,Sn.jsx)(o,{})}),R&&(0,Sn.jsx)(mTe,{focusOnMount:!0,children:r&&(0,Sn.jsx)(r,{})}),f&&(0,Sn.jsx)(Xy.Spinner,{})]}),(0,Sn.jsx)("div",{className:"editor-post-publish-panel__footer",children:(0,Sn.jsx)(Xy.CheckboxControl,{label:(0,kF.__)("Always show pre-publish checks."),checked:d,onChange:x})})]})}var DF=a(G(),1),LF=a(Ce(),1),VF=a(Y(),1),BF=a(U(),1),Qy=a(j(),1);var _Te=a(Mo(),1),STe=a(Lt(),1);var bl=a(G(),1),Sr=a(j(),1),FF=a(Y(),1),xP=a(U(),1),bTe=a(ae(),1),yTe=a(be(),1),wTe=a(Ce(),1);var bq=a(j(),1),vTe=a(G(),1),OF=a(Y(),1);var gTe=a(Y(),1);function IF({children:e}){let{hasStickyAction:t,postType:r}=(0,gTe.useSelect)(o=>({hasStickyAction:o(I).getCurrentPost()._links?.["wp:action-sticky"]??!1,postType:o(I).getCurrentPostType()}),[]);return r!=="post"||!t?null:e}var yq=a(T(),1);function NF(){let e=(0,OF.useSelect)(r=>r(I).getEditedPostAttribute("sticky")??!1,[]),{editPost:t}=(0,OF.useDispatch)(I);return(0,yq.jsx)(IF,{children:(0,yq.jsx)(vTe.CheckboxControl,{className:"editor-post-sticky__checkbox-control",label:(0,bq.__)("Sticky"),help:(0,bq.__)("Pin this post to the top of the blog."),checked:e,onChange:()=>t({sticky:!e})})})}var xn=a(T(),1),MF={"auto-draft":{label:(0,Sr.__)("Draft"),icon:f0},draft:{label:(0,Sr.__)("Draft"),icon:f0},pending:{label:(0,Sr.__)("Pending"),icon:w1},private:{label:(0,Sr.__)("Private"),icon:g1},future:{label:(0,Sr.__)("Scheduled"),icon:hm},publish:{label:(0,Sr.__)("Published"),icon:fv}},wq=[{label:(0,Sr.__)("Draft"),value:"draft",description:(0,Sr.__)("Not ready to publish.")},{label:(0,Sr.__)("Pending"),value:"pending",description:(0,Sr.__)("Waiting for review before publishing.")},{label:(0,Sr.__)("Private"),value:"private",description:(0,Sr.__)("Only visible to site admins and editors.")},{label:(0,Sr.__)("Scheduled"),value:"future",description:(0,Sr.__)("Publish automatically on a chosen date.")},{label:(0,Sr.__)("Published"),value:"publish",description:(0,Sr.__)("Visible to everyone.")}];function _q(){let{status:e,date:t,password:r,postId:o,postType:n,canEdit:i}=(0,FF.useSelect)(b=>{let{getEditedPostAttribute:_,getCurrentPostId:y,getCurrentPostType:w,getCurrentPost:S}=b(I);return{status:_("status"),date:_("date"),password:_("password"),postId:y(),postType:w(),canEdit:S()._links?.["wp:action-publish"]??!1}},[]),[s,l]=(0,xP.useState)(!!r),c=(0,wTe.useInstanceId)(_q,"editor-change-status__password-input"),{editEntityRecord:u}=(0,FF.useDispatch)(bTe.store),[d,f]=(0,xP.useState)(null),m=(0,xP.useMemo)(()=>({anchor:d,"aria-label":(0,Sr.__)("Status & visibility"),headerTitle:(0,Sr.__)("Status & visibility"),placement:"left-start",offset:36,shift:!0}),[d]);if(pm.includes(n))return null;let h=({status:b=e,password:_=r,date:y=t})=>{u("postType",n,o,{status:b,date:y,password:_})},g=b=>{l(b),b||h({password:""})},v=b=>{let _=t,y=r;e==="future"&&new Date(t)>new Date&&(_=null),b==="private"&&r&&(y=""),h({status:b,date:_,password:y})};return(0,xn.jsx)(fr,{label:(0,Sr.__)("Status"),ref:f,children:i?(0,xn.jsx)(bl.Dropdown,{className:"editor-post-status",contentClassName:"editor-change-status__content",popoverProps:m,focusOnMount:!0,renderToggle:({onToggle:b,isOpen:_})=>(0,xn.jsx)(bl.Button,{className:"editor-post-status__toggle",variant:"tertiary",size:"compact",onClick:b,icon:MF[e]?.icon,"aria-label":(0,Sr.sprintf)((0,Sr.__)("Change status: %s"),MF[e]?.label),"aria-expanded":_,children:MF[e]?.label}),renderContent:({onClose:b})=>(0,xn.jsxs)(xn.Fragment,{children:[(0,xn.jsx)(yTe.__experimentalInspectorPopoverHeader,{title:(0,Sr.__)("Status & visibility"),onClose:b}),(0,xn.jsx)("form",{onSubmit:_=>{_.preventDefault(),b()},children:(0,xn.jsxs)(bl.__experimentalVStack,{spacing:4,children:[(0,xn.jsx)(bl.RadioControl,{className:"editor-change-status__options",hideLabelFromVision:!0,label:(0,Sr.__)("Status"),options:wq,onChange:v,selected:e==="auto-draft"?"draft":e}),e==="future"&&(0,xn.jsx)("div",{className:"editor-change-status__publish-date-wrapper",children:(0,xn.jsx)(cq,{showPopoverHeaderActions:!1,isCompact:!0})}),e!=="private"&&(0,xn.jsxs)(bl.__experimentalVStack,{as:"fieldset",spacing:4,className:"editor-change-status__password-fieldset",children:[(0,xn.jsx)(bl.CheckboxControl,{label:(0,Sr.__)("Password protected"),help:(0,Sr.__)("Only visible to those who know the password."),checked:s,onChange:g}),s&&(0,xn.jsx)("div",{className:"editor-change-status__password-input",children:(0,xn.jsx)(bl.TextControl,{label:(0,Sr.__)("Password"),onChange:_=>h({password:_}),value:r,placeholder:(0,Sr.__)("Use a secure password"),type:"text",id:c,maxLength:255})})]}),(0,xn.jsx)(NF,{})]})})]})}):(0,xn.jsx)("div",{className:"editor-post-status is-read-only",children:MF[e]?.label})})}var jF=a(T(),1);function zF({forceIsDirty:e}){let[t,r]=(0,BF.useState)(!1),o=(0,LF.useViewportMatch)("small"),{isAutosaving:n,isDirty:i,isNew:s,isPublished:l,isSaveable:c,isSaving:u,isSavingLocked:d,isSavingNonPostEntityChanges:f,isScheduled:m,hasPublishAction:h,showIconLabels:g,postStatus:v,postStatusHasChanged:b,postType:_}=(0,VF.useSelect)(E=>{let M=E(I),{get:V}=E(STe.store);return{isAutosaving:M.isAutosavingPost(),isDirty:e||M.isEditedPostDirty(),isNew:M.isEditedPostNew(),isPublished:M.isCurrentPostPublished(),isSaving:M.isSavingPost(),isSaveable:M.isEditedPostSaveable(),isSavingLocked:M.isPostSavingLocked(),isSavingNonPostEntityChanges:M.isSavingNonPostEntityChanges(),isScheduled:M.isCurrentPostScheduled(),hasPublishAction:!!M.getCurrentPost()?._links?.["wp:action-publish"],showIconLabels:V("core","showIconLabels"),postStatus:M.getEditedPostAttribute("status"),postStatusHasChanged:!!M.getPostEdits()?.status,postType:M.getCurrentPostType()}},[e]),y=v==="pending",{savePost:w}=(0,VF.useDispatch)(I),S=(0,LF.usePrevious)(u);if((0,BF.useEffect)(()=>{let E;return S&&!u&&(r(!0),E=setTimeout(()=>{r(!1)},1e3)),()=>clearTimeout(E)},[u]),_===kl||!h&&y)return null;let x=!["pending","draft","auto-draft"].includes(v)&&wq.map(({value:E})=>E).includes(v);if(l||m||x||b&&["pending","draft"].includes(v))return null;let C=y?(0,Qy.__)("Save as pending"):(0,Qy.__)("Save draft"),A=(0,Qy.__)("Save"),P=t||!s&&!i,R=u||P,N=u||P||!c||d||f,k;return u?k=n?(0,Qy.__)("Autosaving"):(0,Qy.__)("Saving"):P?k=(0,Qy.__)("Saved"):o?k=C:g&&(k=A),(0,jF.jsxs)(DF.Button,{className:c||u?J({"editor-post-save-draft":!R,"editor-post-saved-state":R,"is-saving":u,"is-autosaving":n,"is-saved":P,[(0,DF.__unstableGetAnimateClassName)({type:"loading"})]:u}):void 0,onClick:N?void 0:()=>w(),shortcut:N?void 0:_Te.displayShortcut.primary("s"),variant:"tertiary",size:"compact",icon:o?void 0:CV,label:k||C,"aria-disabled":N,children:[R&&(0,jF.jsx)(En,{icon:P?Io:TV}),k]})}var xTe=a(Y(),1);function HF({children:e}){return(0,xTe.useSelect)(r=>r(I).getCurrentPost()._links?.["wp:action-publish"]??!1,[])?e:null}var UF=a(G(),1),KS=a(j(),1),WF=a(U(),1),CTe=a(Y(),1);var qS=a(T(),1);function GF(){let[e,t]=(0,WF.useState)(null),r=(0,CTe.useSelect)(s=>s(I).getCurrentPostType(),[]),o=(0,WF.useMemo)(()=>({anchor:e,"aria-label":(0,KS.__)("Change publish date"),placement:"left-start",offset:36,shift:!0}),[e]),n=US(),i=US({full:!0});return pm.includes(r)?null:(0,qS.jsx)(HF,{children:(0,qS.jsx)(fr,{label:(0,KS.__)("Publish"),ref:t,children:(0,qS.jsx)(UF.Dropdown,{popoverProps:o,focusOnMount:!0,className:"editor-post-schedule__panel-dropdown",contentClassName:"editor-post-schedule__dialog",renderToggle:({onToggle:s,isOpen:l})=>(0,qS.jsx)(UF.Button,{size:"compact",className:"editor-post-schedule__dialog-toggle",variant:"tertiary",tooltipPosition:"middle left",onClick:s,"aria-label":(0,KS.sprintf)((0,KS.__)("Change date: %s"),n),label:i,showTooltip:n!==i,"aria-expanded":l,children:n}),renderContent:({onClose:s})=>(0,qS.jsx)(zS,{onClose:s})})})})}var YF=a(G(),1),ZS=a(j(),1),qF=a(Y(),1),ETe=a(U(),1),TTe=a(qa(),1);var Jy=a(T(),1);function PTe(){(0,TTe.default)("wp.editor.PostSwitchToDraftButton",{since:"6.7",version:"6.9"});let[e,t]=(0,ETe.useState)(!1),{editPost:r,savePost:o}=(0,qF.useDispatch)(I),{isSaving:n,isPublished:i,isScheduled:s}=(0,qF.useSelect)(f=>{let{isSavingPost:m,isCurrentPostPublished:h,isCurrentPostScheduled:g}=f(I);return{isSaving:m(),isPublished:h(),isScheduled:g()}},[]),l=n||!i&&!s,c,u;i?(c=(0,ZS.__)("Are you sure you want to unpublish this post?"),u=(0,ZS.__)("Unpublish")):s&&(c=(0,ZS.__)("Are you sure you want to unschedule this post?"),u=(0,ZS.__)("Unschedule"));let d=()=>{t(!1),r({status:"draft"}),o()};return(0,Jy.jsxs)(Jy.Fragment,{children:[(0,Jy.jsx)(YF.Button,{__next40pxDefaultSize:!0,className:"editor-post-switch-to-draft",onClick:()=>{l||t(!0)},"aria-disabled":l,variant:"secondary",style:{flexGrow:"1",justifyContent:"center"},children:(0,ZS.__)("Switch to draft")}),(0,Jy.jsx)(YF.__experimentalConfirmDialog,{isOpen:e,onConfirm:d,onCancel:()=>t(!1),confirmButtonText:u,children:c})]})}var kTe=a(Y(),1),CP=a(j(),1);var Sq=a(T(),1);function KF(){let{syncStatus:e,postType:t}=(0,kTe.useSelect)(r=>{let{getEditedPostAttribute:o}=r(I);return{syncStatus:o("meta")?.wp_pattern_sync_status==="unsynced"?"unsynced":o("wp_pattern_sync_status"),postType:o("type")}});return t!=="wp_block"?null:(0,Sq.jsx)(fr,{label:(0,CP.__)("Sync status"),children:(0,Sq.jsx)("div",{className:"editor-post-sync-status__value",children:e==="unsynced"?(0,CP._x)("Not synced","pattern (singular)"):(0,CP._x)("Synced","pattern (singular)")})})}var RTe=a(U(),1),ATe=a(Y(),1),ITe=a(ae(),1);var xq=a(T(),1),Nst=e=>e;function Mst({taxonomyWrapper:e=Nst}){let{postType:t,taxonomies:r}=(0,ATe.useSelect)(n=>({postType:n(I).getCurrentPostType(),taxonomies:n(ITe.store).getEntityRecords("root","taxonomy")}),[]);return(r??[]).filter(n=>n.types.includes(t)&&n.visibility?.show_ui).map(n=>{let i=n.hierarchical?xF:yF;return(0,xq.jsx)(RTe.Fragment,{children:e((0,xq.jsx)(i,{slug:n.slug}),n)},`taxonomy-${n.slug}`)})}var XS=Mst;var OTe=a(Y(),1),NTe=a(ae(),1);function ZF({children:e}){return(0,OTe.useSelect)(r=>{let o=r(I).getCurrentPostType();return r(NTe.store).getEntityRecords("root","taxonomy")?.some(i=>i.types.includes(o))},[])?e:null}var MTe=a(G(),1),XF=a(Y(),1);var EP=a(T(),1);function Fst({taxonomy:e,children:t}){let r=e?.slug,o=r?`taxonomy-panel-${r}`:"",{isEnabled:n,isOpened:i}=(0,XF.useSelect)(c=>{let{isEditorPanelEnabled:u,isEditorPanelOpened:d}=c(I);return{isEnabled:r?u(o):!1,isOpened:r?d(o):!1}},[o,r]),{toggleEditorPanelOpened:s}=(0,XF.useDispatch)(I);if(!n)return null;let l=e?.labels?.menu_name;return l?(0,EP.jsx)(MTe.PanelBody,{title:l,opened:i,onToggle:()=>s(o),children:t}):null}function QF(){return(0,EP.jsx)(ZF,{children:(0,EP.jsx)(XS,{taxonomyWrapper:(e,t)=>(0,EP.jsx)(Fst,{taxonomy:t,children:e})})})}var tPe=a(JTe(),1),QS=a(U(),1),Pq=a(j(),1),rPe=a(ae(),1),tD=a(Y(),1),oPe=a(Ce(),1);var $Te=1e3;function ePe(e,t){if(Math.max(e.length,t.length)<=$Te)return EG(e,t);let o=0,n=Math.min(e.length,t.length);for(;oo&&s>o&&e[i-1]===t[s-1];)i--,s--;let l=e.slice(o,i),c=t.slice(o,s),u=Math.max(l.length,c.length),d;return u<=$Te?d=EG(l,c):d=pwe(l,c),o>0&&d.unshift({value:e.slice(0,o)}),i{let{getCurrentPostType:d,getCurrentPostId:f,getEditedPostContent:m}=u(I);return{value:m(),type:d(),id:f()}},[]),{editEntityRecord:l}=(0,tD.useDispatch)(rPe.store);(0,QS.useLayoutEffect)(()=>{let u=t.current,d=r.current;if(r.current=n,!u||d===void 0||d===n||!o.current)return;let{selectionStart:f,selectionEnd:m,selectionDirection:h}=o.current,g=ePe(d,n),v=Tq(f,g,d,n),b=Tq(m,g,d,n);u.setSelectionRange(v,b,h),o.current={selectionStart:v,selectionEnd:b,selectionDirection:h}},[n]);let c=u=>{let{selectionStart:d,selectionEnd:f,selectionDirection:m}=u.target;o.current={selectionStart:d,selectionEnd:f,selectionDirection:m}};return(0,Vg.jsxs)(Vg.Fragment,{children:[(0,Vg.jsx)(Yt,{render:(0,Vg.jsx)("label",{htmlFor:`post-content-${e}`}),children:(0,Pq.__)("Type text or HTML")}),(0,Vg.jsx)(tPe.default,{autoComplete:"off",dir:"auto",ref:t,value:n,onChange:u=>{c(u),r.current=u.target.value,l("postType",i,s,{content:u.target.value,blocks:void 0,selection:void 0})},onFocus:c,onMouseUp:c,onKeyUp:c,className:"editor-post-text-editor",id:`post-content-${e}`,placeholder:(0,Pq.__)("Start writing with text or HTML")})]})}var iPe=a(j(),1),$S=a(U(),1),sPe=a(Nt(),1),lD=a(Y(),1),kq=a(be(),1),aPe=a(Mo(),1),lPe=a(Pt(),1),ex=a(vd(),1),cPe=a(Ce(),1),Rq=a(Mp(),1);var rD="wp-block wp-block-post-title block-editor-block-list__block editor-post-title editor-post-title__input rich-text",oD=/[\r\n]+/g;var JS=a(U(),1),nPe=a(Y(),1);function nD(e){let t=(0,JS.useRef)(),{isCleanNewPost:r}=(0,nPe.useSelect)(o=>{let{isCleanNewPost:n}=o(I);return{isCleanNewPost:n()}},[]);return(0,JS.useImperativeHandle)(e,()=>({focus:()=>{t?.current?.focus()}})),(0,JS.useEffect)(()=>{if(!t.current)return;let{defaultView:o}=t.current.ownerDocument,{name:n,parent:i}=o,s=n==="editor-canvas"?i.document:o.document,{activeElement:l,body:c}=s;r&&(!l||c===l)&&t.current.focus()},[r]),{ref:t}}var iD=a(Y(),1);function sD(){let{editPost:e}=(0,iD.useDispatch)(I),{title:t}=(0,iD.useSelect)(o=>{let{getEditedPostAttribute:n}=o(I);return{title:n("title")}},[]);function r(o){e({title:o})}return{title:t,setTitle:r}}var aD=a(T(),1),{useRichText:Kst}=q(ex.privateApis),Zst=(0,$S.forwardRef)((e,t)=>{let{placeholder:r,isEditingContentOnlySection:o,isPreview:n}=(0,lD.useSelect)(k=>{let{getSettings:E,getEditedContentOnlySection:M}=q(k(kq.store)),{titlePlaceholder:V,isPreviewMode:F}=E();return{placeholder:V,isEditingContentOnlySection:!!M(),isPreview:F}},[]),[i,s]=(0,$S.useState)(!1),{ref:l}=nD(t),{title:c,setTitle:u}=sD(),[d,f]=(0,$S.useState)({}),{clearSelectedBlock:m,insertBlocks:h,insertDefaultBlock:g}=(0,lD.useDispatch)(kq.store),v=(0,sPe.decodeEntities)(r)||(0,iPe.__)("Add title"),{value:b,onChange:_,ref:y}=Kst({value:c,onChange(k){u(k.replace(oD," "))},placeholder:v,selectionStart:d.start,selectionEnd:d.end,onSelectionChange(k,E){f(M=>{let{start:V,end:F}=M;return V===k&&F===E?M:{start:k,end:E}})},__unstableDisableFormats:!1});function w(k){h(k,0)}function S(){s(!0),m()}function x(){s(!1),f({})}function C(){g(void 0,void 0,0)}function A(k){k.keyCode===aPe.ENTER&&(k.preventDefault(),C())}function P(k){let E=k.clipboardData,M="",V="";try{M=E.getData("text/plain"),V=E.getData("text/html")}catch{return}let F=(0,lPe.pasteHandler)({HTML:V,plainText:M});if(k.preventDefault(),!!F.length)if(typeof F!="string"){let[D]=F;if(!c&&(D.name==="core/heading"||D.name==="core/paragraph")){let z=(0,Rq.__unstableStripHTML)(D.attributes.content);u(z),w(F.slice(1))}else w(F)}else{let D=(0,Rq.__unstableStripHTML)(F);_((0,ex.insert)(b,(0,ex.create)({html:D})))}}let R=J(rD,{"is-selected":i}),N=o?{opacity:.2}:void 0;return(0,aD.jsx)("h1",{ref:(0,cPe.useMergeRefs)([y,l]),contentEditable:!o&&!n,className:R,"aria-label":v,role:"textbox","aria-multiline":"true",onFocus:S,onBlur:x,onKeyDown:A,onPaste:P,style:N})}),cD=(0,$S.forwardRef)((e,t)=>(0,aD.jsx)(uo,{supportKeys:"title",children:(0,aD.jsx)(Zst,{ref:t})}));var uPe=a(G(),1),dPe=a(j(),1),fPe=a(Nt(),1),pPe=a(Y(),1),mPe=a(be(),1),uD=a(U(),1);var hPe=a(T(),1);function Xst(e,t){let{placeholder:r}=(0,pPe.useSelect)(h=>{let{getSettings:g}=h(mPe.store),{titlePlaceholder:v}=g();return{placeholder:v}},[]),[o,n]=(0,uD.useState)(!1),{title:i,setTitle:s}=sD(),{ref:l}=nD(t);function c(h){s(h.replace(oD," "))}function u(){n(!0)}function d(){n(!1)}let f=J(rD,{"is-selected":o,"is-raw-text":!0}),m=(0,fPe.decodeEntities)(r)||(0,dPe.__)("Add title");return(0,hPe.jsx)(uPe.TextareaControl,{ref:l,value:i,onChange:c,onFocus:u,onBlur:d,label:r,className:f,placeholder:m,hideLabelFromVision:!0,autoComplete:"off",dir:"auto",rows:1})}var dD=(0,uD.forwardRef)(Xst);var tx=a(j(),1),pD=a(G(),1),rx=a(Y(),1),bPe=a(U(),1);var gPe=a(Y(),1),vPe=a(ae(),1);function fD({children:e}){let{canTrashPost:t}=(0,gPe.useSelect)(r=>{let{isEditedPostNew:o,getCurrentPostId:n,getCurrentPostType:i}=r(I),{canUser:s}=r(vPe.store),l=i(),c=n(),u=o(),d=c?s("delete",{kind:"postType",name:l,id:c}):!1;return{canTrashPost:(!u||c)&&d&&!EZ.includes(l)}},[]);return t?e:null}var kP=a(T(),1);function ox({onActionPerformed:e}){let t=(0,rx.useRegistry)(),{isNew:r,isDeleting:o,postId:n,title:i}=(0,rx.useSelect)(d=>{let f=d(I);return{isNew:f.isEditedPostNew(),isDeleting:f.isDeletingPost(),postId:f.getCurrentPostId(),title:f.getCurrentPostAttribute("title")}},[]),{trashPost:s}=(0,rx.useDispatch)(I),[l,c]=(0,bPe.useState)(!1);if(r||!n)return null;let u=async()=>{c(!1),await s();let d=await t.resolveSelect(I).getCurrentPost();e?.("move-to-trash",[d])};return(0,kP.jsxs)(fD,{children:[(0,kP.jsx)(pD.Button,{__next40pxDefaultSize:!0,className:"editor-post-trash",isDestructive:!0,variant:"secondary",isBusy:o,"aria-disabled":o,onClick:o?void 0:()=>c(!0),children:(0,tx.__)("Move to trash")}),(0,kP.jsx)(pD.__experimentalConfirmDialog,{isOpen:l,onConfirm:u,onCancel:()=>c(!1),confirmButtonText:(0,tx.__)("Move to trash"),size:"small",children:(0,tx.sprintf)((0,tx.__)('Are you sure you want to move "%s" to the trash?'),i)})]})}var RP=a(Y(),1),AP=a(vo(),1),mD=a(U(),1),yPe=a(be(),1),$y=a(j(),1),Ba=a(G(),1),wPe=a(It(),1);var _Pe=a(ae(),1),hD=a(Ce(),1);var To=a(T(),1);function IP({onClose:e}){let{isEditable:t,postSlug:r,postLink:o,permalinkPrefix:n,permalinkSuffix:i,permalink:s}=(0,RP.useSelect)(h=>{let g=h(I).getCurrentPost(),v=h(I).getCurrentPostType(),b=h(_Pe.store).getPostType(v),_=h(I).getPermalinkParts(),y=g?._links?.["wp:action-publish"]??!1;return{isEditable:h(I).isPermalinkEditable()&&y,postSlug:(0,AP.safeDecodeURIComponent)(h(I).getEditedPostSlug()),viewPostLabel:b?.labels?.view_item,postLink:g.link,permalinkPrefix:_?.prefix,permalinkSuffix:_?.suffix,permalink:(0,AP.safeDecodeURIComponent)(h(I).getPermalink())}},[]),{editPost:l}=(0,RP.useDispatch)(I),{createNotice:c}=(0,RP.useDispatch)(wPe.store),[u,d]=(0,mD.useState)(!1),f=(0,hD.useCopyToClipboard)(s,()=>{c("info",(0,$y.__)("Copied Permalink to clipboard."),{isDismissible:!0,type:"snackbar"})}),m="editor-post-url__slug-description-"+(0,hD.useInstanceId)(IP);return(0,To.jsxs)("div",{className:"editor-post-url",children:[(0,To.jsx)(yPe.__experimentalInspectorPopoverHeader,{title:(0,$y.__)("Slug"),onClose:e}),(0,To.jsxs)(Ba.__experimentalVStack,{spacing:3,children:[t&&(0,To.jsx)("p",{className:"editor-post-url__intro",children:(0,mD.createInterpolateElement)((0,$y.__)("Customize the last part of the Permalink. Learn more."),{span:(0,To.jsx)("span",{id:m}),a:(0,To.jsx)(Ba.ExternalLink,{href:(0,$y.__)("https://wordpress.org/documentation/article/page-post-settings-sidebar/#permalink")})})}),(0,To.jsxs)("div",{children:[t&&(0,To.jsxs)(To.Fragment,{children:[(0,To.jsx)(Ba.__experimentalInputControl,{prefix:(0,To.jsx)(Ba.__experimentalInputControlPrefixWrapper,{children:"/"}),suffix:(0,To.jsx)(Ba.__experimentalInputControlSuffixWrapper,{variant:"control",children:(0,To.jsx)(Ba.Button,{icon:s1,ref:f,size:"small",label:"Copy"})}),label:(0,$y.__)("Slug"),hideLabelFromVision:!0,value:u?"":r,autoComplete:"off",spellCheck:"false",type:"text",className:"editor-post-url__input",onChange:h=>{if(l({slug:h}),!h){u||d(!0);return}u&&d(!1)},onBlur:h=>{l({slug:(0,AP.cleanForSlug)(h.target.value)}),u&&d(!1)},"aria-describedby":m}),(0,To.jsxs)("p",{className:"editor-post-url__permalink",children:[(0,To.jsx)("span",{className:"editor-post-url__permalink-visual-label",children:(0,$y.__)("Permalink:")}),(0,To.jsxs)(Ba.ExternalLink,{className:"editor-post-url__link",href:o,target:"_blank",children:[(0,To.jsx)("span",{className:"editor-post-url__link-prefix",children:n}),(0,To.jsx)("span",{className:"editor-post-url__link-slug",children:r}),(0,To.jsx)("span",{className:"editor-post-url__link-suffix",children:i})]})]})]}),!t&&(0,To.jsx)(Ba.ExternalLink,{className:"editor-post-url__link",href:o,target:"_blank",children:o})]})]})]})}var SPe=a(Y(),1),xPe=a(ae(),1);function gD({children:e}){return(0,SPe.useSelect)(r=>{let o=r(I).getCurrentPostType();return!(!r(xPe.store).getPostType(o)?.viewable||!r(I).getCurrentPost().link||!r(I).getPermalinkParts())},[])?e:null}var CPe=a(Y(),1),vD=a(vo(),1);function EPe(){return Aq()}function Aq(){let e=(0,CPe.useSelect)(t=>t(I).getPermalink(),[]);return(0,vD.filterURLForDisplay)((0,vD.safeDecodeURIComponent)(e))}var bD=a(U(),1),yD=a(Y(),1),ix=a(G(),1),nx=a(j(),1),TPe=a(vo(),1),PPe=a(ae(),1);var yl=a(T(),1);function wD(){let{isFrontPage:e}=(0,yD.useSelect)(i=>{let{getCurrentPostId:s}=i(I),{getEditedEntityRecord:l,canUser:c}=i(PPe.store),u=c("read",{kind:"root",name:"site"})?l("root","site"):void 0,d=s();return{isFrontPage:u?.page_on_front===d}},[]),[t,r]=(0,bD.useState)(null),o=(0,bD.useMemo)(()=>({anchor:t,placement:"left-start",offset:36,shift:!0}),[t]),n=e?(0,nx.__)("Link"):(0,nx.__)("Slug");return(0,yl.jsx)(gD,{children:(0,yl.jsxs)(fr,{label:n,ref:r,children:[!e&&(0,yl.jsx)(ix.Dropdown,{popoverProps:o,className:"editor-post-url__panel-dropdown",contentClassName:"editor-post-url__panel-dialog",focusOnMount:!0,renderToggle:({isOpen:i,onToggle:s})=>(0,yl.jsx)(Qst,{isOpen:i,onClick:s}),renderContent:({onClose:i})=>(0,yl.jsx)(IP,{onClose:i})}),e&&(0,yl.jsx)(Jst,{})]})})}function Qst({isOpen:e,onClick:t}){let{slug:r}=(0,yD.useSelect)(n=>({slug:n(I).getEditedPostSlug()}),[]),o=(0,TPe.safeDecodeURIComponent)(r);return(0,yl.jsx)(ix.Button,{size:"compact",className:"editor-post-url__panel-toggle",variant:"tertiary","aria-expanded":e,"aria-label":(0,nx.sprintf)((0,nx.__)("Change link: %s"),o),onClick:t,children:(0,yl.jsx)(yl.Fragment,{children:o})})}function Jst(){let{postLink:e}=(0,yD.useSelect)(t=>{let{getCurrentPost:r}=t(I);return{postLink:r()?.link}},[]);return(0,yl.jsx)(ix.ExternalLink,{className:"editor-post-url__front-page-link",href:e,target:"_blank",children:e})}var kPe=a(Y(),1);function RPe({render:e}){let t=(0,kPe.useSelect)(r=>r(I).getCurrentPost()._links?.["wp:action-publish"]??!1);return e({canEdit:t})}var zPe=a(j(),1),xD=a(G(),1),HPe=a(Y(),1);var UPe=a(U(),1),WPe=a(be(),1);var Zp=a(j(),1),VPe=a(Y(),1),BPe=a(be(),1);var APe=a(Y(),1),IPe=a(j(),1),OPe=a(_w(),1);var NPe=a(T(),1);function sx(){let e=(0,APe.useSelect)(r=>r(I).getEditedPostAttribute("content"),[]),t=(0,IPe._x)("words","Word count type. Do not translate!");return(0,NPe.jsx)("span",{className:"word-count",children:(0,OPe.count)(e,t)})}var MPe=a(Y(),1),Bg=a(j(),1),FPe=a(_w(),1),Iq=a(U(),1);var _D=a(T(),1),$st=189;function ax(){let e=(0,MPe.useSelect)(n=>n(I).getEditedPostAttribute("content"),[]),t=(0,Bg._x)("words","Word count type. Do not translate!"),r=Math.round((0,FPe.count)(e,t)/$st),o=r===0?(0,Iq.createInterpolateElement)((0,Bg.__)("< 1 minute"),{span:(0,_D.jsx)("span",{})}):(0,Iq.createInterpolateElement)((0,Bg.sprintf)((0,Bg._n)("%s minute","%s minutes",r),r),{span:(0,_D.jsx)("span",{})});return(0,_D.jsx)("span",{className:"time-to-read",children:o})}var DPe=a(Y(),1),LPe=a(_w(),1);function lx(){let e=(0,DPe.useSelect)(t=>t(I).getEditedPostAttribute("content"),[]);return(0,LPe.count)(e,"characters_including_spaces")}var $r=a(T(),1);function eat({hasOutlineItemsDisabled:e,onRequestClose:t}){let{headingCount:r,paragraphCount:o,numberOfBlocks:n}=(0,VPe.useSelect)(i=>{let{getGlobalBlockCount:s}=i(BPe.store);return{headingCount:s("core/heading"),paragraphCount:s("core/paragraph"),numberOfBlocks:s()}},[]);return(0,$r.jsxs)($r.Fragment,{children:[(0,$r.jsx)("div",{className:"table-of-contents__wrapper",role:"note","aria-label":(0,Zp.__)("Document Statistics"),tabIndex:"0",children:(0,$r.jsxs)("ul",{role:"list",className:"table-of-contents__counts",children:[(0,$r.jsxs)("li",{className:"table-of-contents__count",children:[(0,Zp.__)("Words"),(0,$r.jsx)(sx,{})]}),(0,$r.jsxs)("li",{className:"table-of-contents__count",children:[(0,Zp.__)("Characters"),(0,$r.jsx)("span",{className:"table-of-contents__number",children:(0,$r.jsx)(lx,{})})]}),(0,$r.jsxs)("li",{className:"table-of-contents__count",children:[(0,Zp.__)("Time to read"),(0,$r.jsx)(ax,{})]}),(0,$r.jsxs)("li",{className:"table-of-contents__count",children:[(0,Zp.__)("Headings"),(0,$r.jsx)("span",{className:"table-of-contents__number",children:r})]}),(0,$r.jsxs)("li",{className:"table-of-contents__count",children:[(0,Zp.__)("Paragraphs"),(0,$r.jsx)("span",{className:"table-of-contents__number",children:o})]}),(0,$r.jsxs)("li",{className:"table-of-contents__count",children:[(0,Zp.__)("Blocks"),(0,$r.jsx)("span",{className:"table-of-contents__number",children:n})]})]})}),r>0&&(0,$r.jsxs)($r.Fragment,{children:[(0,$r.jsx)("hr",{}),(0,$r.jsx)("h2",{className:"table-of-contents__title",children:(0,Zp.__)("Document Outline")}),(0,$r.jsx)(mS,{onSelect:t,hasOutlineItemsDisabled:e})]})]})}var jPe=eat;var SD=a(T(),1);function tat({hasOutlineItemsDisabled:e,repositionDropdown:t,...r},o){let n=(0,HPe.useSelect)(i=>!!i(WPe.store).getBlockCount(),[]);return(0,SD.jsx)(xD.Dropdown,{popoverProps:{placement:t?"right":"bottom"},className:"table-of-contents",contentClassName:"table-of-contents__popover",renderToggle:({isOpen:i,onToggle:s})=>(0,SD.jsx)(xD.Button,{__next40pxDefaultSize:!0,...r,ref:o,onClick:n?s:void 0,icon:lB,"aria-expanded":i,"aria-haspopup":"true",label:(0,zPe.__)("Details"),tooltipPosition:"bottom","aria-disabled":!n}),renderContent:({onClose:i})=>(0,SD.jsx)(jPe,{onRequestClose:i,hasOutlineItemsDisabled:e})})}var GPe=(0,UPe.forwardRef)(tat);var YPe=a(j(),1),qPe=a(U(),1),KPe=a(Y(),1),ZPe=a(ae(),1);function XPe(){let{__experimentalGetDirtyEntityRecords:e}=(0,KPe.useSelect)(ZPe.store);return(0,qPe.useEffect)(()=>{let t=r=>{if(e().length>0)return r.returnValue=(0,YPe.__)("You have unsaved changes. If you proceed, they will be lost."),r.returnValue};return window.addEventListener("beforeunload",t),()=>{window.removeEventListener("beforeunload",t)}},[e]),null}var Oq=a(qa(),1),$Pe=a(U(),1),ye=a(be(),1),eke=a(JPe(),1),tke=a(T(),1);function wt(e,t,r=[]){let o=(0,$Pe.forwardRef)((n,i)=>((0,Oq.default)("wp.editor."+e,{since:"5.3",alternative:"wp.blockEditor."+e,version:"6.2"}),(0,tke.jsx)(t,{ref:i,...n})));return r.forEach(n=>{o[n]=wt(e+"."+n,t[n])}),o}function Jd(e,t){return(...r)=>((0,Oq.default)("wp.editor."+e,{since:"5.3",alternative:"wp.blockEditor."+e,version:"6.2"}),t(...r))}var rke=wt("RichText",ye.RichText,["Content"]);rke.isEmpty=Jd("RichText.isEmpty",ye.RichText.isEmpty);var rat=wt("Autocomplete",ye.Autocomplete),oat=wt("AlignmentToolbar",ye.AlignmentToolbar),nat=wt("BlockAlignmentToolbar",ye.BlockAlignmentToolbar),iat=wt("BlockControls",ye.BlockControls,["Slot"]),sat=wt("BlockEdit",ye.BlockEdit),aat=wt("BlockEditorKeyboardShortcuts",ye.BlockEditorKeyboardShortcuts),lat=wt("BlockFormatControls",ye.BlockFormatControls,["Slot"]),cat=wt("BlockIcon",ye.BlockIcon),uat=wt("BlockInspector",ye.BlockInspector),dat=wt("BlockList",ye.BlockList),fat=wt("BlockMover",ye.BlockMover),pat=wt("BlockNavigationDropdown",ye.BlockNavigationDropdown),mat=wt("BlockSelectionClearer",ye.BlockSelectionClearer),hat=wt("BlockSettingsMenu",ye.BlockSettingsMenu),gat=wt("BlockTitle",ye.BlockTitle),vat=wt("BlockToolbar",ye.BlockToolbar),bat=wt("ColorPalette",ye.ColorPalette),yat=wt("ContrastChecker",ye.ContrastChecker),wat=wt("CopyHandler",ye.CopyHandler),_at=wt("DefaultBlockAppender",ye.DefaultBlockAppender),Sat=wt("FontSizePicker",ye.FontSizePicker),xat=wt("Inserter",ye.Inserter),Cat=wt("InnerBlocks",ye.InnerBlocks,["ButtonBlockAppender","DefaultBlockAppender","Content"]),Eat=wt("InspectorAdvancedControls",ye.InspectorAdvancedControls,["Slot"]),Tat=wt("InspectorControls",ye.InspectorControls,["Slot"]),Pat=wt("PanelColorSettings",ye.PanelColorSettings),kat=wt("PlainText",ye.PlainText),Rat=wt("RichTextShortcut",ye.RichTextShortcut),Aat=wt("RichTextToolbarButton",ye.RichTextToolbarButton),Iat=wt("__unstableRichTextInputEvent",ye.__unstableRichTextInputEvent),Oat=wt("MediaPlaceholder",ye.MediaPlaceholder),Nat=wt("MediaUpload",ye.MediaUpload),Mat=wt("MediaUploadCheck",ye.MediaUploadCheck),Fat=wt("MultiSelectScrollIntoView",ye.MultiSelectScrollIntoView),Dat=wt("NavigableToolbar",ye.NavigableToolbar),Lat=wt("ObserveTyping",ye.ObserveTyping),Vat=wt("SkipToSelectedBlock",ye.SkipToSelectedBlock),Bat=wt("URLInput",ye.URLInput),jat=wt("URLInputButton",ye.URLInputButton),zat=wt("URLPopover",ye.URLPopover),Hat=wt("Warning",ye.Warning),Uat=wt("WritingFlow",ye.WritingFlow),Wat=Jd("createCustomColorsHOC",ye.createCustomColorsHOC),Gat=Jd("getColorClassName",ye.getColorClassName),Yat=Jd("getColorObjectByAttributeValues",ye.getColorObjectByAttributeValues),qat=Jd("getColorObjectByColorValue",ye.getColorObjectByColorValue),Kat=Jd("getFontSize",ye.getFontSize),Zat=Jd("getFontSizeClass",ye.getFontSizeClass),Xat=Jd("withColorContext",ye.withColorContext),Qat=Jd("withColors",ye.withColors),Jat=Jd("withFontSizes",ye.withFontSizes);var $at=oS,elt=oS;function tlt(e=[]){return e.push({...P3},{...k3}),e}(0,oke.addFilter)("editor.Autocomplete.completers","editor/autocompleters/set-default-completers",tlt);var nke=a(U(),1),Nq=a(zn(),1),ike=a(qa(),1),CD=a(Ef(),1);var cx=a(T(),1),{MediaUploadModal:rlt}=q(CD.privateApis),olt=class extends nke.Component{constructor(e){super(e),this.state={isOpen:!1},this.openModal=this.openModal.bind(this),this.closeModal=this.closeModal.bind(this)}openModal(){this.setState({isOpen:!0})}closeModal(){this.setState({isOpen:!1}),this.props.onClose?.()}render(){let{allowedTypes:e,multiple:t,value:r,onSelect:o,title:n,modalClass:i,render:s}=this.props,{isOpen:l}=this.state;return(0,cx.jsxs)(cx.Fragment,{children:[s({open:this.openModal}),(0,cx.jsx)(rlt,{allowedTypes:e,multiple:t,value:r,onSelect:c=>{o(c),this.closeModal()},onClose:this.closeModal,title:n,isOpen:l,modalClass:i})]})}};window.__experimentalDataViewsMediaModal?(0,Nq.addFilter)("editor.MediaUpload","core/editor/components/media-upload",()=>((0,ike.default)("Extending MediaUpload as a class component",{since:"7.0",version:"7.2",hint:"MediaUpload will become a function component in WordPress 7.2 Please update any custom implementations to use function components instead."}),olt)):(0,Nq.addFilter)("editor.MediaUpload","core/editor/components/media-upload",()=>CD.MediaUpload);var ake=a(zn(),1),lke=a(Ml(),1),cke=a(Ce(),1),ED=a(be(),1),Mq=a(Y(),1),uke=a(Pt(),1);var bu=a(T(),1),{PatternOverridesControls:nlt,ResetOverridesControl:ilt,PATTERN_TYPES:slt,PATTERN_SYNC_TYPES:ske}=q(lke.privateApis),alt=(0,cke.createHigherOrderComponent)(e=>t=>{let r=(0,Mq.useSelect)(o=>{let{__experimentalBlockBindingsSupportedAttributes:n}=o(ED.store).getSettings();return!!n?.[t.name]},[t.name]);return(0,bu.jsxs)(bu.Fragment,{children:[(0,bu.jsx)(e,{...t},"edit"),t.isSelected&&r&&(0,bu.jsx)(llt,{...t})]})},"withPatternOverrideControls");function llt(e){let t=(0,ED.useBlockEditingMode)(),{hasPatternOverridesSource:r,isEditingSyncedPattern:o}=(0,Mq.useSelect)(c=>{let{getCurrentPostType:u,getEditedPostAttribute:d}=c(I);return{hasPatternOverridesSource:!!(0,uke.getBlockBindingsSource)("core/pattern-overrides"),isEditingSyncedPattern:u()===slt.user&&d("meta")?.wp_pattern_sync_status!==ske.unsynced&&d("wp_pattern_sync_status")!==ske.unsynced}},[]),n=e.attributes.metadata?.bindings,i=!!n&&Object.values(n).some(c=>c.source==="core/pattern-overrides"),s=o&&t==="default",l=!o&&!!e.attributes.metadata?.name&&t!=="disabled"&&i;return r?(0,bu.jsxs)(bu.Fragment,{children:[s&&(0,bu.jsx)(nlt,{...e}),l&&(0,bu.jsx)(ilt,{...e})]}):null}(0,ake.addFilter)("editor.BlockEdit","core/editor/with-pattern-override-controls",alt);var dke=a(zn(),1),fke=a(Ce(),1),pke=a(U(),1),Fq=a(j(),1),ux=a(be(),1),TD=a(G(),1),mke=a(Y(),1),$d=a(T(),1),clt=["core/navigation-link","core/navigation-submenu"];function ult({attributes:e}){let{kind:t,id:r,type:o}=e,n=(0,ux.useBlockEditingMode)(),i=(0,mke.useSelect)(l=>l(ux.store).getSettings().onNavigateToEntityRecord,[]),s=(0,pke.useCallback)(()=>{t==="post-type"&&o==="page"&&r&&i&&i({postId:r,postType:o})},[t,r,o,i]);return t!=="post-type"||o!=="page"||!r||!i||n!=="contentOnly"?null:(0,$d.jsx)(ux.__unstableBlockToolbarLastItem,{children:(0,$d.jsx)(TD.ToolbarGroup,{children:(0,$d.jsx)(TD.ToolbarButton,{name:"view",title:(0,Fq.__)("View"),onClick:s,children:(0,Fq.__)("View")})})})}var dlt=(0,fke.createHigherOrderComponent)(e=>t=>{let r=clt.includes(t.name);return(0,$d.jsxs)($d.Fragment,{children:[(0,$d.jsx)(e,{...t},"edit"),t.isSelected&&r&&(0,$d.jsx)(ult,{...t})]})},"withNavigationViewButton");(0,dke.addFilter)("editor.BlockEdit","core/editor/with-navigation-view-button",dlt);var hke=a(zn(),1),gke=a(Ce(),1),vke=a(U(),1),Dq=a(j(),1),dx=a(be(),1),PD=a(G(),1),jg=a(Y(),1);var ef=a(T(),1),flt="core/navigation",plt="core/template-part",mlt="edit-post/block";function hlt({clientId:e}){let t=(0,jg.useRegistry)(),{selectBlock:r,flashBlock:o}=(0,jg.useDispatch)(dx.store),{requestInspectorTab:n}=q((0,jg.useDispatch)(dx.store)),{enableComplementaryArea:i}=(0,jg.useDispatch)(je),{hasNavigationBlocks:s,firstNavigationBlockId:l,isNavigationEditable:c}=(0,jg.useSelect)(d=>{let{getClientIdsOfDescendants:f,getBlockName:m,getBlockEditingMode:h}=d(dx.store),v=f(e).filter(y=>m(y)===flt),b=v.length>0,_=b?v[0]:null;return{hasNavigationBlocks:b,firstNavigationBlockId:_,isNavigationEditable:h(_)!=="disabled"}},[e]),u=(0,vke.useCallback)(()=>{l&&t.batch(()=>{r(l),o(l,500),i("core",mlt),n("list",{openPanel:l})})},[l,t,r,o,i,n]);return!s||!c?null:(0,ef.jsx)(dx.__unstableBlockToolbarLastItem,{children:(0,ef.jsx)(PD.ToolbarGroup,{children:(0,ef.jsx)(PD.ToolbarButton,{label:(0,Dq.__)("Edit navigation"),onClick:u,children:(0,Dq.__)("Edit navigation")})})})}var glt=(0,gke.createHigherOrderComponent)(e=>t=>{let r=t.name===plt;return(0,ef.jsxs)(ef.Fragment,{children:[(0,ef.jsx)(e,{...t},"edit"),t.isSelected&&r&&(0,ef.jsx)(hlt,{clientId:t.clientId})]})},"withTemplatePartNavigationEditButton");(0,hke.addFilter)("editor.BlockEdit","core/editor/with-template-part-navigation-edit-button",glt);var Oke=a(zn(),1),Nke=a(Ce(),1),zg=a(be(),1),OP=a(G(),1),Qp=a(j(),1),Jp=a(Pt(),1),mx=a(U(),1),px=a(Y(),1),Mke=a(It(),1),Fke=a(ae(),1);function Lq(e,t,r){return!e||typeof e!="object"||t.reduce((o,n,i)=>(o[n]===void 0&&(Number.isInteger(t[i+1])?o[n]=[]:o[n]={}),i===t.length-1&&(o[n]=r),o[n]),e),e}var Pke=a(G(),1);var yu=a(j(),1),kke=a(Pt(),1),fx=a(U(),1);var Eke=a(U(),1);var xr=a(j(),1),bke={"typography.fontFamily":(0,xr.__)("Font family"),"typography.fontSize":(0,xr.__)("Font size"),"typography.fontStyle":(0,xr.__)("Font style"),"typography.fontWeight":(0,xr.__)("Font weight"),"typography.lineHeight":(0,xr.__)("Line height"),"typography.letterSpacing":(0,xr.__)("Letter spacing"),"typography.textDecoration":(0,xr.__)("Text decoration"),"typography.textTransform":(0,xr.__)("Letter case"),"typography.textColumns":(0,xr.__)("Text columns"),"typography.writingMode":(0,xr.__)("Orientation"),"color.text":(0,xr.__)("Text color"),"color.background":(0,xr.__)("Background color"),"color.gradient":(0,xr.__)("Gradient"),"elements.link.color.text":(0,xr.__)("Link color"),"spacing.padding":(0,xr.__)("Padding"),"spacing.margin":(0,xr.__)("Margin"),"spacing.blockGap":(0,xr.__)("Block spacing"),border:(0,xr.__)("Border"),"border.top":(0,xr.__)("Border top"),"border.right":(0,xr.__)("Border right"),"border.bottom":(0,xr.__)("Border bottom"),"border.left":(0,xr.__)("Border left"),"border.color":(0,xr.__)("Border color"),"border.width":(0,xr.__)("Border width"),"border.style":(0,xr.__)("Border style"),"border.radius":(0,xr.__)("Border radius"),"dimensions.minHeight":(0,xr.__)("Minimum height"),"dimensions.aspectRatio":(0,xr.__)("Aspect ratio")};function yke(e){let t=e.join(".");return bke[t]?bke[t]:YI(e[e.length-1]??"")}var tf="\u2014",vlt="var:preset|",blt=/^var\(\s*--wp--preset--[a-z0-9-]+?\s*(?:,[^)]*)?\)$/i;function ylt(e){if(e.startsWith(vlt))return e.split("|").pop();if(blt.test(e))return e.replace(/^var\(\s*/,"").replace(/\s*(?:,[^)]*)?\)$/,"").split("--").pop()}var Vn=e=>e!=null&&e!=="",wlt=["top","right","bottom","left"];function _lt(e){if(Vn(e.width)||Vn(e.style)||Vn(e.color))return e;let t=wlt.filter(o=>e[o]);if(!t.length)return e;let r=o=>{let n=t.map(i=>e[i]?.[o]);return n.every(i=>i===n[0])?n[0]:void 0};return{width:r("width"),style:r("style"),color:r("color")}}function e0(e){if(!Vn(e))return tf;if(typeof e=="string"){let t=ylt(e);return t?YI(t):e}if(typeof e=="number")return String(e);if(typeof e=="object")try{let t=JSON.stringify(e);return t&&t!=="{}"&&t!=="[]"?t:tf}catch{return tf}return String(e)}function wke(e){if(!e||typeof e!="object")return e0(e);let{width:t,style:r,color:o}=_lt(e),n=[t,r,o].filter(Vn).map(i=>e0(i));return n.length?n.join(" "):tf}var Slt=["topLeft","topRight","bottomRight","bottomLeft"];function _ke(e){if(e&&typeof e=="object"){let t=Slt.map(r=>e[r]).filter(Vn);return t.length?t.join(" "):tf}return e0(e)}function Ske(e,t=r=>r){let r=l=>e0(t(l));if(!e||typeof e!="object")return r(e);let{top:o,right:n,bottom:i,left:s}=e;return Vn(o)&&Vn(n)&&Vn(i)&&Vn(s)?o===n&&n===i&&i===s?r(o):o===i&&s===n?`${r(o)} ${r(s)}`:[o,n,i,s].map(r).join(" "):!Vn(o)&&!Vn(n)&&!Vn(i)&&!Vn(s)?tf:[o,n,i,s].map(l=>Vn(l)?r(l):tf).join(" ")}function xke(e,t=r=>r){let r=l=>e0(t(l));if(!e||typeof e!="object")return r(e);let{top:o,left:n}=e;if(!Vn(o)&&!Vn(n))return tf;if(o===n)return r(o);let i=Vn(o)?r(o):tf,s=Vn(n)?r(n):tf;return`${i} - ${s}`}function Cke(e,t,r){return e==="border"?wke(t):e==="borderRadius"?_ke(t):e==="spacing"?Ske(t,r):e==="blockGap"?xke(t,r):e0(t)}function Tke(e,t,r){return(0,Eke.useMemo)(()=>{let o=n=>bv(t,r,n);return e.map(n=>{let i=bm(t,n.primaryPath.join("."),r,!1);return{...n,label:yke(n.primaryPath),currentValue:i,formattedCurrentValue:Cke(n.format,i,o),formattedNewValue:Cke(n.format,n.newValue,o)}})},[e,t,r])}var Xp=a(T(),1),xlt={pickerTable:{}},Clt=e=>e.id;function Rke({name:e,rows:t,onApply:r,onRequestClose:o}){let{merged:n}=Hr(),i=Tke(t,n,e),[s,l]=(0,fx.useState)(()=>i.map(h=>h.id)),[c,u]=(0,fx.useState)(()=>({type:"pickerTable",titleField:"label",fields:["current","new"],page:1,perPage:i.length,layout:{enableMoving:!1}})),d=(0,fx.useMemo)(()=>[{id:"label",label:(0,yu.__)("Style"),enableSorting:!1,enableHiding:!1,filterBy:!1,getValue:({item:h})=>h.label,render:({item:h})=>h.label},{id:"current",label:(0,yu.__)("Current"),enableSorting:!1,enableHiding:!1,filterBy:!1,getValue:({item:h})=>h.formattedCurrentValue,render:({item:h})=>(0,Xp.jsx)("span",{className:"editor-push-changes-to-global-styles-modal__value",children:h.formattedCurrentValue})},{id:"new",label:(0,yu.__)("New"),enableSorting:!1,enableHiding:!1,filterBy:!1,getValue:({item:h})=>h.formattedNewValue,render:({item:h})=>(0,Xp.jsx)("span",{className:"editor-push-changes-to-global-styles-modal__value",children:h.formattedNewValue})}],[]),f=(0,fx.useMemo)(()=>[{id:"apply",label:(0,yu.__)("Apply"),isPrimary:!0,supportsBulk:!0,callback(h){r(h),o()}}],[r,o]),m=(0,kke.getBlockType)(e)?.title;return(0,Xp.jsxs)(Pke.Modal,{title:(0,yu.sprintf)((0,yu.__)("Apply %s styles globally"),m),onRequestClose:o,size:"large",className:"editor-push-changes-to-global-styles-modal",children:[(0,Xp.jsx)("p",{children:(0,yu.sprintf)((0,yu.__)("Choose which styles to make default for all %s blocks."),m)}),(0,Xp.jsxs)(lp,{data:i,fields:d,view:c,onChangeView:u,actions:f,selection:s,onChangeSelection:l,getItemId:Clt,paginationInfo:{totalItems:i.length,totalPages:1},defaultLayouts:xlt,search:!1,itemListLabel:(0,yu.__)("Styles to apply"),children:[(0,Xp.jsx)(lp.Layout,{}),(0,Xp.jsx)(lp.Footer,{})]})]})}var wl=a(T(),1),{cleanEmptyObject:Elt}=q(zg.privateApis),Vq={...Jp.__EXPERIMENTAL_STYLE_PROPERTY,blockGap:{value:["spacing","blockGap"]}},Tlt={"border.color":"color","color.background":"color","color.text":"color","elements.link.color.text":"color","elements.link.:hover.color.text":"color","elements.link.typography.fontFamily":"font-family","elements.link.typography.fontSize":"font-size","elements.button.color.text":"color","elements.button.color.background":"color","elements.button.typography.fontFamily":"font-family","elements.button.typography.fontSize":"font-size","elements.caption.color.text":"color","elements.heading.color":"color","elements.heading.color.background":"color","elements.heading.typography.fontFamily":"font-family","elements.heading.gradient":"gradient","elements.heading.color.gradient":"gradient","elements.h1.color":"color","elements.h1.color.background":"color","elements.h1.typography.fontFamily":"font-family","elements.h1.color.gradient":"gradient","elements.h2.color":"color","elements.h2.color.background":"color","elements.h2.typography.fontFamily":"font-family","elements.h2.color.gradient":"gradient","elements.h3.color":"color","elements.h3.color.background":"color","elements.h3.typography.fontFamily":"font-family","elements.h3.color.gradient":"gradient","elements.h4.color":"color","elements.h4.color.background":"color","elements.h4.typography.fontFamily":"font-family","elements.h4.color.gradient":"gradient","elements.h5.color":"color","elements.h5.color.background":"color","elements.h5.typography.fontFamily":"font-family","elements.h5.color.gradient":"gradient","elements.h6.color":"color","elements.h6.color.background":"color","elements.h6.typography.fontFamily":"font-family","elements.h6.color.gradient":"gradient","color.gradient":"gradient",blockGap:"spacing","typography.fontSize":"font-size","typography.fontFamily":"font-family"},Plt={"border.color":"borderColor","color.background":"backgroundColor","color.text":"textColor","color.gradient":"gradient","typography.fontSize":"fontSize","typography.fontFamily":"fontFamily"},klt=["border","color","spacing","typography"],Ake=(e,t)=>{let r=e;return t.forEach(o=>{r=r?.[o]}),r},Dke=["top","right","bottom","left"];function Rlt(e,t,r){let o=[],n=t.style?.border,i=r?.border,s=e.includes("borderColor"),l=e.includes("borderWidth"),c=e.includes("borderStyle"),u=t.borderColor,d=u?`var:preset|color|${u}`:n?.color,f=Ike({id:"border",primaryPath:["border"],side:null,color:s?d:void 0,width:l?n?.width:void 0,style:c?n?.style:void 0,userBorder:i,presetAttributes:u?["borderColor"]:[]});return f&&o.push(f),Dke.forEach(m=>{let h=n?.[m],g=Ike({id:`border.${m}`,primaryPath:["border",m],side:m,color:s?h?.color:void 0,width:l?h?.width:void 0,style:c?h?.style:void 0,userBorder:i,presetAttributes:[]});g&&o.push(g)}),e.includes("borderRadius")&&n?.radius!==void 0&&n?.radius!==""&&o.push({id:"border.radius",primaryPath:["border","radius"],paths:[{path:["border","radius"],value:n.radius}],presetAttributes:[],newValue:n.radius,format:"borderRadius"}),o}function Ike({id:e,primaryPath:t,side:r,color:o,width:n,style:i,userBorder:s,presetAttributes:l}){if(!o&&!n&&!i)return null;let c=[],u=r?[r]:Dke,d=(m,h)=>{h!==void 0&&(r||c.push({path:["border",m],value:h}),u.forEach(g=>{c.push({path:["border",g,m],value:h})}))};d("color",o),d("width",n),d("style",i);let f=i;if(!i&&(o||n)){let m=u.map(g=>s?.[g]?.style);u.forEach((g,v)=>{m[v]||c.push({path:["border",g,"style"],value:"solid"})}),f=(m.every(g=>g===m[0])?m[0]:void 0)||"solid"}return{id:e,primaryPath:t,paths:c,presetAttributes:l,newValue:{color:o,width:n,style:f},format:"border"}}function Alt(e,t,r){let o=[];return e.forEach(n=>{if(!Vq[n]||n.startsWith("border")||Vq[n].rootOnly)return;let{value:i}=Vq[n],s=i.join("."),l=Plt[s],c=l?t[l]:void 0,u=c?`var:preset|${Tlt[s]}|${c}`:Ake(t.style,i),d=c?[l]:[];if(n==="linkColor"){let f=u?[{path:i,value:u}]:[],m=["elements","link",":hover","color","text"],h=Ake(t.style,m);if(h&&f.push({path:m,value:h}),f.length===0)return;o.push({id:s,primaryPath:i,paths:f,presetAttributes:d,newValue:u??h});return}if(u){let f;n==="padding"||n==="margin"?f="spacing":n==="blockGap"&&(f="blockGap"),o.push({id:s,primaryPath:i,paths:[{path:i,value:u}],presetAttributes:d,newValue:u,format:f})}}),o.push(...Rlt(e,t,r)),o}function Ilt(e,t,r){let o=(0,px.useSelect)(i=>q(i(Jp.store)).getSupportedStyles(e),[e]),n=r?.styles?.blocks?.[e];return(0,mx.useMemo)(()=>Alt(o,t,n),[o,t,n])}function Olt({rowsToPush:e,attributes:t,userConfig:r,name:o}){if(!e||e.length===0)return null;let n=e.flatMap(u=>u.paths);if(n.length===0)return null;let{style:i}=t,s=structuredClone(i),l=structuredClone(r);for(let{path:u,value:d}of n)Lq(s,u,void 0),Lq(l,["styles","blocks",o,...u],d);let c={style:Elt(s)};for(let u of e.flatMap(d=>d.presetAttributes))c[u]=void 0;return{newBlockAttributes:c,newUserConfig:l}}function Nlt({name:e,attributes:t,setAttributes:r}){let{user:o,setUser:n}=Hr(),i=Ilt(e,t,o),[s,l]=(0,mx.useState)(!1),{__unstableMarkNextChangeAsNotPersistent:c}=(0,px.useDispatch)(zg.store),{createSuccessNotice:u}=(0,px.useDispatch)(Mke.store),d=(0,mx.useCallback)(f=>{let m=Olt({rowsToPush:f,attributes:t,userConfig:o,name:e});if(!m)return;let{newBlockAttributes:h,newUserConfig:g}=m;c(),r(h),n(g,{undoIgnore:!0}),u((0,Qp.sprintf)((0,Qp.__)("%s styles applied."),(0,Jp.getBlockType)(e).title),{type:"snackbar",actions:[{label:(0,Qp.__)("Undo"),onClick(){c(),r(t),n(o,{undoIgnore:!0})}}]})},[c,t,u,e,r,n,o]);return(0,wl.jsxs)(OP.BaseControl,{className:"editor-push-changes-to-global-styles-control",help:(0,Qp.sprintf)((0,Qp.__)("Review and apply this block\u2019s typography, spacing, dimensions, and color styles to all %s blocks."),(0,Jp.getBlockType)(e).title),children:[(0,wl.jsx)(OP.BaseControl.VisualLabel,{children:(0,Qp.__)("Styles")}),(0,wl.jsx)(OP.Button,{__next40pxDefaultSize:!0,variant:"secondary",accessibleWhenDisabled:!0,disabled:i.length===0,onClick:()=>l(!0),children:(0,Qp.__)("Apply globally")}),s&&(0,wl.jsx)(Rke,{name:e,rows:i,onApply:d,onRequestClose:()=>l(!1)})]})}function Mlt(e){let t=(0,zg.useBlockEditingMode)(),r=(0,px.useSelect)(i=>i(Fke.store).getCurrentTheme()?.is_block_theme,[]),o=klt.some(i=>(0,Jp.hasBlockSupport)(e.name,i));return t==="default"&&o&&r?(0,wl.jsx)(zg.InspectorAdvancedControls,{children:(0,wl.jsx)(Nlt,{...e})}):null}var Flt=(0,Nke.createHigherOrderComponent)(e=>t=>(0,wl.jsxs)(wl.Fragment,{children:[(0,wl.jsx)(e,{...t},"edit"),t.isSelected&&(0,wl.jsx)(Mlt,{...t})]}));(0,Oke.addFilter)("editor.BlockEdit","core/editor/push-changes-to-global-styles",Flt);var jke=a(vd(),1);var Lke=a(j(),1),Vke=a(U(),1),MP=a(Y(),1);var hx="edit-post/collab-history-sidebar",Hg="edit-post/collab-sidebar",NP=[hx,Hg];var kD="core/note",Bke={title:(0,Lke.__)("Note"),tagName:"mark",className:"wp-note",attributes:{"data-id":"data-id"},edit:Dlt};function Dlt({isActive:e,activeAttributes:t}){let{getActiveComplementaryArea:r}=(0,MP.useSelect)(je),{getSelectedNote:o}=q((0,MP.useSelect)(I)),{selectNote:n}=q((0,MP.useDispatch)(I)),i=t?.["data-id"];return(0,Vke.useEffect)(()=>{!e||!i||NP.includes(r("core"))&&String(o())!==String(i)&&n(Number(i))},[e,i,r,o,n]),null}(0,jke.registerFormatType)(kD,Bke);var FP=a(G(),1),zke=a(T(),1),Bq="__experimentalMainDashboardButton",Hke=()=>{let e=(0,FP.__experimentalUseSlotFills)(Bq);return!!(e&&e.length)},{Fill:Llt,Slot:Vlt}=(0,FP.createSlotFill)(Bq),Uke=Llt,Blt=()=>{let e=(0,FP.__experimentalUseSlotFills)(Bq);return(0,zke.jsx)(Vlt,{bubblesVirtually:!0,fillProps:{length:e?e.length:0}})};Uke.Slot=Blt;var RD=Uke;var U5e=a(Y(),1),W5e=a(ae(),1),G5e=a(G(),1),Y5e=a(j(),1);var $P=a(Y(),1),Jg=a(j(),1),PAe=a(Lt(),1),Px=a(be(),1),kAe=a(Ce(),1),AL=a(U(),1),RAe=a(Nt(),1),AAe=a(It(),1),IAe=a($9(),1);var _2e=a(be(),1),S2e=a(Y(),1),WP=a(Ce(),1),x2e=a(Lt(),1),C2e=a(U(),1);var gx=a(be(),1),Wke=a(U(),1),AD=a(G(),1),jq=a(j(),1);var Gke=a(Y(),1);var $p=a(T(),1),{useHasBlockToolbar:jlt}=q(gx.privateApis);function Yke({isCollapsed:e,onToggle:t}){let{blockSelectionStart:r}=(0,Gke.useSelect)(i=>({blockSelectionStart:i(gx.store).getBlockSelectionStart()}),[]),o=jlt(),n=!!r;return(0,Wke.useEffect)(()=>{r&&t(!1)},[r,t]),o?(0,$p.jsxs)($p.Fragment,{children:[(0,$p.jsx)("div",{className:J("editor-collapsible-block-toolbar",{"is-collapsed":e||!n}),children:(0,$p.jsx)(gx.BlockToolbar,{hideDragHandle:!0})}),(0,$p.jsx)(AD.Popover.Slot,{name:"block-toolbar"}),(0,$p.jsx)(AD.Button,{className:"editor-collapsible-block-toolbar__toggle",icon:e?Rl:Al,onClick:()=>{t(!e)},label:e?(0,jq.__)("Show block tools"):(0,jq.__)("Hide block tools"),size:"compact"})]}):null}var qke=a(Ce(),1),ID=a(Y(),1),t0=a(j(),1),Kke=a(be(),1),vx=a(G(),1);var zq=a(U(),1),Zke=a(xa(),1),Xke=a(Lt(),1);var wu=a(T(),1);function zlt({className:e,disableBlockTools:t=!1}){let{setIsInserterOpened:r,setIsListViewOpened:o}=(0,ID.useDispatch)(I),{isDistractionFree:n,isInserterOpened:i,isListViewOpen:s,listViewShortcut:l,inserterSidebarToggleRef:c,listViewToggleRef:u,showIconLabels:d}=(0,ID.useSelect)(y=>{let{get:w}=y(Xke.store),{isListViewOpened:S,getEditorMode:x,getInserterSidebarToggleRef:C,getListViewToggleRef:A}=q(y(I)),{getShortcutRepresentation:P}=y(Zke.store);return{isInserterOpened:y(I).isInserterOpened(),isListViewOpen:S(),listViewShortcut:P("core/editor/toggle-list-view"),inserterSidebarToggleRef:C(),listViewToggleRef:A(),showIconLabels:w("core","showIconLabels"),isDistractionFree:w("core","distractionFree"),isVisualMode:x()==="visual"}},[]),f=y=>{i&&y.preventDefault()},m=(0,qke.useViewportMatch)("wide"),h=(0,t0.__)("Document tools"),g=(0,zq.useCallback)(()=>o(!s),[o,s]),v=(0,zq.useCallback)(()=>r(!i),[i,r]),b=(0,t0._x)("Block Inserter","Generic label for block inserter button"),_=i?(0,t0.__)("Close"):(0,t0.__)("Add");return(0,wu.jsx)(Kke.NavigableToolbar,{className:J("editor-document-tools","edit-post-header-toolbar",e),"aria-label":h,variant:"unstyled",children:(0,wu.jsxs)("div",{className:"editor-document-tools__left",children:[!n&&(0,wu.jsx)(vx.ToolbarButton,{ref:c,className:"editor-document-tools__inserter-toggle",variant:"primary",isPressed:i,onMouseDown:f,onClick:v,disabled:t,icon:Ec,label:d?_:b,showTooltip:!d,"aria-expanded":i}),(m||!d)&&(0,wu.jsxs)(wu.Fragment,{children:[(0,wu.jsx)(vx.ToolbarItem,{as:e6,showTooltip:!d,variant:d?"tertiary":void 0,size:"compact"}),(0,wu.jsx)(vx.ToolbarItem,{as:Q3,showTooltip:!d,variant:d?"tertiary":void 0,size:"compact"}),!n&&(0,wu.jsx)(vx.ToolbarButton,{className:"editor-document-tools__document-overview-toggle",icon:m1,disabled:t,isPressed:s,label:(0,t0.__)("Document Overview"),onClick:g,shortcut:l,showTooltip:!d,variant:d?"tertiary":void 0,"aria-expanded":s,ref:u})]})]})})}var Qke=zlt;var DP=a(G(),1);var Ug=a(T(),1),Hq={distractionFreeDisabled:{y:"-50px"},distractionFreeHover:{y:0},distractionFreeHidden:{y:"-50px"},visible:{y:0},hidden:{y:0}},Hlt={distractionFreeDisabled:{x:"-100%"},distractionFreeHover:{x:0},distractionFreeHidden:{x:"-100%"},visible:{x:0},hidden:{x:0}};function OD({className:e,toolbar:t,center:r,settings:o}){let n=Hke();return(0,Ug.jsxs)("div",{className:J("editor-header edit-post-header",e),children:[n&&(0,Ug.jsx)(DP.__unstableMotion.div,{className:"editor-header__back-button",variants:Hlt,transition:{type:"tween"},children:(0,Ug.jsx)(RD.Slot,{})}),(0,Ug.jsx)(DP.__unstableMotion.div,{variants:Hq,className:"editor-header__toolbar",transition:{type:"tween"},children:t}),r&&(0,Ug.jsx)(DP.__unstableMotion.div,{variants:Hq,className:"editor-header__center",transition:{type:"tween"},children:r}),(0,Ug.jsx)(DP.__unstableMotion.div,{variants:Hq,transition:{type:"tween"},className:"editor-header__settings",children:o})]})}var Po=a(j(),1),bx=a(Y(),1),Gq=a(Mo(),1);var rf=a(G(),1),r0=a(Lt(),1);var Jke=a(G(),1),ND=a(Y(),1),Uq=a(j(),1),$ke=a(Ce(),1),eRe=a(It(),1);var tRe=a(T(),1);function rRe(){let{createNotice:e}=(0,ND.useDispatch)(eRe.store),{getEditedPostContent:t}=(0,ND.useSelect)(I);function r(){return t()}function o(){e("info",(0,Uq.__)("All content copied."),{isDismissible:!0,type:"snackbar"})}let n=(0,$ke.useCopyToClipboard)(r,o);return(0,tRe.jsx)(Jke.MenuItem,{ref:n,children:(0,Uq.__)("Copy all blocks")})}var LP=a(j(),1),MD=a(G(),1),FD=a(Y(),1),oRe=a(xa(),1);var Wq=a(T(),1),Ult=[{value:"visual",label:(0,LP.__)("Visual editor")},{value:"text",label:(0,LP.__)("Code editor")}];function Wlt(){let{shortcut:e,isRichEditingEnabled:t,isCodeEditingEnabled:r,mode:o}=(0,FD.useSelect)(l=>({shortcut:l(oRe.store).getShortcutRepresentation("core/editor/toggle-mode"),isRichEditingEnabled:l(I).getEditorSettings().richEditingEnabled,isCodeEditingEnabled:l(I).getEditorSettings().codeEditingEnabled,mode:l(I).getEditorMode()}),[]),{switchEditorMode:n}=(0,FD.useDispatch)(I),i=o;!t&&o==="visual"&&(i="text"),!r&&o==="text"&&(i="visual");let s=Ult.map(l=>(!r&&l.value==="text"&&(l={...l,disabled:!0}),!t&&l.value==="visual"&&(l={...l,disabled:!0,info:(0,LP.__)("You can enable the visual editor in your profile settings.")}),l.value!==i&&!l.disabled?{...l,shortcut:e}:l));return(0,Wq.jsx)(MD.MenuGroup,{label:(0,LP.__)("Editor"),children:(0,Wq.jsx)(MD.MenuItemsChoice,{choices:s,value:i,onSelect:n})})}var nRe=Wlt;var iRe=a(G(),1),sRe=a(T(),1),{Fill:aRe,Slot:Glt}=(0,iRe.createSlotFill)("ToolsMoreMenuGroup");aRe.Slot=({fillProps:e})=>(0,sRe.jsx)(Glt,{fillProps:e});var DD=aRe;var lRe=a(G(),1),cRe=a(T(),1),{Fill:uRe,Slot:Ylt}=(0,lRe.createSlotFill)(Symbol("ViewMoreMenuGroup"));uRe.Slot=({fillProps:e})=>(0,cRe.jsx)(Ylt,{fillProps:e});var LD=uRe;var mo=a(T(),1);function VD({disabled:e=!1}){let{openModal:t}=(0,bx.useDispatch)(je),{set:r}=(0,bx.useDispatch)(r0.store),{toggleDistractionFree:o}=(0,bx.useDispatch)(I),n=(0,bx.useSelect)(s=>s(r0.store).get("core","showIconLabels"),[]),i=()=>{r("core","distractionFree",!1)};return(0,mo.jsx)(mo.Fragment,{children:(0,mo.jsx)(rf.DropdownMenu,{icon:bo,label:(0,Po.__)("Options"),popoverProps:{placement:"bottom-end",className:"more-menu-dropdown__content"},toggleProps:{showTooltip:!n,...n&&{variant:"tertiary"},tooltipPosition:"bottom",size:"compact",disabled:e},children:({onClose:s})=>(0,mo.jsxs)(mo.Fragment,{children:[(0,mo.jsxs)(rf.MenuGroup,{label:(0,Po._x)("View","noun"),children:[(0,mo.jsx)(r0.PreferenceToggleMenuItem,{scope:"core",name:"fixedToolbar",onToggle:i,label:(0,Po.__)("Top toolbar"),info:(0,Po.__)("Access all block and document tools in a single place"),messageActivated:(0,Po.__)("Top toolbar activated."),messageDeactivated:(0,Po.__)("Top toolbar deactivated.")}),(0,mo.jsx)(r0.PreferenceToggleMenuItem,{scope:"core",name:"distractionFree",label:(0,Po.__)("Distraction free"),info:(0,Po.__)("Write with calmness"),handleToggling:!1,onToggle:()=>o({createNotice:!1}),messageActivated:(0,Po.__)("Distraction free mode activated."),messageDeactivated:(0,Po.__)("Distraction free mode deactivated."),shortcut:Gq.displayShortcut.primaryShift("\\")}),(0,mo.jsx)(r0.PreferenceToggleMenuItem,{scope:"core",name:"focusMode",label:(0,Po.__)("Spotlight mode"),info:(0,Po.__)("Focus on one block at a time"),messageActivated:(0,Po.__)("Spotlight mode activated."),messageDeactivated:(0,Po.__)("Spotlight mode deactivated.")}),(0,mo.jsx)(LD.Slot,{fillProps:{onClose:s}})]}),(0,mo.jsx)(nRe,{}),(0,mo.jsx)(ql.Slot,{name:"core/plugin-more-menu",label:(0,Po.__)("Panels"),fillProps:{onClick:s}}),(0,mo.jsxs)(rf.MenuGroup,{label:(0,Po.__)("Tools"),children:[(0,mo.jsx)(rf.MenuItem,{onClick:()=>t("editor/keyboard-shortcut-help"),shortcut:Gq.displayShortcut.access("h"),children:(0,Po.__)("Keyboard shortcuts")}),(0,mo.jsx)(rRe,{}),(0,mo.jsxs)(rf.MenuItem,{icon:gs,href:(0,Po.__)("https://wordpress.org/documentation/article/wordpress-block-editor/"),target:"_blank",rel:"noopener",children:[(0,Po.__)("Help"),(0,mo.jsx)(Yt,{render:(0,mo.jsx)("span",{}),children:(0,Po.__)("(opens in a new tab)")})]}),(0,mo.jsx)(DD.Slot,{fillProps:{onClose:s}})]}),(0,mo.jsx)(rf.MenuGroup,{children:(0,mo.jsx)(rf.MenuItem,{onClick:()=>t("editor/preferences"),children:(0,Po.__)("Preferences")})})]})})})}var fRe=a(Ce(),1),BD=a(Y(),1);var pRe=a(T(),1),dRe="toggle",Yq="button";function mRe({forceIsDirty:e,setEntitiesSavedStatesCallback:t}){let r,o=(0,fRe.useViewportMatch)("medium","<"),{togglePublishSidebar:n}=(0,BD.useDispatch)(I),{hasPublishAction:i,isBeingScheduled:s,isPending:l,isPublished:c,isPublishSidebarEnabled:u,isPublishSidebarOpened:d,isScheduled:f,postStatus:m,postStatusHasChanged:h,postType:g}=(0,BD.useSelect)(v=>({hasPublishAction:!!v(I).getCurrentPost()?._links?.["wp:action-publish"],isBeingScheduled:v(I).isEditedPostBeingScheduled(),isPending:v(I).isCurrentPostPending(),isPublished:v(I).isCurrentPostPublished(),isPublishSidebarEnabled:v(I).isPublishSidebarEnabled(),isPublishSidebarOpened:v(I).isPublishSidebarOpened(),isScheduled:v(I).isCurrentPostScheduled(),postStatus:v(I).getEditedPostAttribute("status"),postStatusHasChanged:v(I).getPostEdits()?.status,postType:v(I).getCurrentPostType()}),[]);return g===kl||c||h&&!["future","publish"].includes(m)||f&&s||l&&!i&&!o?r=Yq:o||u?r=dRe:r=Yq,(0,pRe.jsx)(VS,{forceIsDirty:e,isOpen:d,isToggle:r===dRe,onToggle:n,setEntitiesSavedStatesCallback:t})}var hRe=a(j(),1),gRe=a(G(),1);var vRe=a(ae(),1),bRe=a(Y(),1),yRe=a(Lt(),1);var wRe=a(T(),1);function _Re(){let{hasLoaded:e,permalink:t,isPublished:r,label:o,showIconLabels:n}=(0,bRe.useSelect)(i=>{let s=i(I).getCurrentPostType(),l=i(vRe.store).getPostType(s),{get:c}=i(yRe.store);return{permalink:i(I).getPermalink(),isPublished:i(I).isCurrentPostPublished(),label:l?.labels?.view_item,hasLoaded:!!l,showIconLabels:c("core","showIconLabels")}},[]);return!r||!t||!e?null:(0,wRe.jsx)(gRe.Button,{icon:gs,label:o||(0,hRe.__)("View post"),href:t,target:"_blank",showTooltip:!n,size:"compact"})}var SRe=a(Ce(),1),ja=a(G(),1),ki=a(j(),1);var yx=a(Y(),1),xRe=a(ae(),1),CRe=a(Lt(),1);var qq=a(be(),1);var cs={document:"edit-post/document",block:"edit-post/block"};var Bn=a(T(),1),{getViewportBreakpoints:qlt}=q(Vu);function ERe({forceIsAutosaveable:e,disabled:t}){let{deviceType:r,homeUrl:o,hasMobileViewport:n,hasTabletViewport:i,isTemplate:s,isViewable:l,showIconLabels:c,isTemplateHidden:u,templateId:d,isResponsiveEditing:f,isResponsiveEditingEnabled:m,hasBlockSelection:h,activeComplementaryArea:g}=(0,yx.useSelect)(V=>{let{getCurrentPostType:F,getCurrentTemplateId:D,getRenderingMode:z,getDeviceType:L,getEditorSettings:O}=q(V(I)),{isResponsiveEditing:B,getBlockSelectionStart:W,getSettings:K}=q(V(qq.store)),{getEntityRecord:Z,getPostType:Q}=V(xRe.store),{get:ue}=V(CRe.store),te=F(),de=qlt(K().__experimentalFeatures?.viewport);return{deviceType:L(),homeUrl:Z("root","__unstableBase")?.home,hasMobileViewport:de.mobile!==void 0,hasTabletViewport:de.tablet!==void 0,isTemplate:te==="wp_template",isViewable:Q(te)?.viewable??!1,showIconLabels:ue("core","showIconLabels"),isTemplateHidden:z()==="post-only",templateId:D(),isResponsiveEditing:B(),isResponsiveEditingEnabled:O().responsiveEditingEnabled,hasBlockSelection:!!W(),activeComplementaryArea:V(je).getActiveComplementaryArea("core")}},[]),{setDeviceType:v,setRenderingMode:b,setDefaultRenderingMode:_}=q((0,yx.useDispatch)(I)),{resetZoomLevel:y,setStyleStateViewport:w,setResponsiveEditing:S}=q((0,yx.useDispatch)(qq.store)),{enableComplementaryArea:x}=(0,yx.useDispatch)(je),C=V=>{v(V),y()},A=()=>{let V=!f;S(V),w(V?R2[r]??"default":"default"),V&&h&&!g&&x("core",cs.block)};if((0,SRe.useViewportMatch)("medium","<"))return null;let R={placement:"bottom-end"},N={className:"editor-preview-dropdown__toggle",iconPosition:"right",size:"compact",showTooltip:!c,disabled:t,accessibleWhenDisabled:t},k={"aria-label":(0,ki.__)("View options")},E={desktop:uR,mobile:p0,tablet:c2},M=[{value:"Desktop",label:(0,ki.__)("Desktop"),icon:uR,info:f?(0,ki.__)("Style all viewports."):(0,ki.__)("Preview desktop viewport.")},...i?[{value:"Tablet",label:(0,ki.__)("Tablet"),icon:c2,info:f?(0,ki.__)("Style tablet only."):(0,ki.__)("Preview tablet viewport.")}]:[],...n?[{value:"Mobile",label:(0,ki.__)("Mobile"),icon:p0,info:f?(0,ki.__)("Style mobile only."):(0,ki.__)("Preview mobile viewport.")}]:[]];return(0,Bn.jsx)(ja.DropdownMenu,{className:J("editor-preview-dropdown",`editor-preview-dropdown--${r.toLowerCase()}`,{"is-responsive-editing":f}),popoverProps:R,toggleProps:N,menuProps:k,icon:E[r.toLowerCase()],label:(0,ki.__)("View"),disableOpenOnArrowDown:t,children:({onClose:V})=>(0,Bn.jsxs)(Bn.Fragment,{children:[(0,Bn.jsx)(ja.MenuGroup,{children:(0,Bn.jsx)(ja.MenuItemsChoice,{choices:M,value:r,onSelect:C})}),m&&(0,Bn.jsx)(ja.MenuGroup,{children:(0,Bn.jsx)(ja.MenuItem,{icon:f?Io:void 0,isSelected:f,role:"menuitemcheckbox",onClick:A,info:(0,ki.__)("Style changes apply only to the selected viewport."),children:(0,ki.__)("Responsive styles")})}),s&&(0,Bn.jsx)(ja.MenuGroup,{children:(0,Bn.jsxs)(ja.MenuItem,{href:o,target:"_blank",icon:gs,onClick:V,children:[(0,ki.__)("View site"),(0,Bn.jsx)(Yt,{render:(0,Bn.jsx)("span",{}),children:(0,ki.__)("(opens in a new tab)")})]})}),!s&&!!d&&(0,Bn.jsx)(ja.MenuGroup,{children:(0,Bn.jsx)(ja.MenuItem,{icon:u?void 0:Io,isSelected:!u,role:"menuitemcheckbox",onClick:()=>{let F=u?"template-locked":"post-only";b(F),_(F),y()},children:(0,ki.__)("Show template")})}),l&&(0,Bn.jsx)(ja.MenuGroup,{children:(0,Bn.jsx)(gEe,{forceIsAutosaveable:e,onPreview:V})}),(0,Bn.jsx)(ql.Slot,{name:"core/plugin-preview-menu",fillProps:{onClick:V}})]})})}var TRe=a(G(),1),Kq=a(j(),1),PRe=a(U(),1),VP=a(Y(),1),Zq=a(be(),1);var Xq=a(Lt(),1),jD=a(xa(),1),kRe=a(Mo(),1);var RRe=a(T(),1),Klt=({disabled:e})=>{let{isZoomOut:t,showIconLabels:r,isDistractionFree:o}=(0,VP.useSelect)(u=>({isZoomOut:q(u(Zq.store)).isZoomOut(),showIconLabels:u(Xq.store).get("core","showIconLabels"),isDistractionFree:u(Xq.store).get("core","distractionFree")})),{resetZoomLevel:n,setZoomLevel:i}=q((0,VP.useDispatch)(Zq.store)),{registerShortcut:s,unregisterShortcut:l}=(0,VP.useDispatch)(jD.store);return(0,PRe.useEffect)(()=>(s({name:"core/editor/zoom",category:"global",description:(0,Kq.__)("Enter or exit zoom out."),keyCombination:{modifier:(0,kRe.isAppleOS)()?"primaryShift":"secondary",character:"0"}}),()=>{l("core/editor/zoom")}),[s,l]),(0,jD.useShortcut)("core/editor/zoom",()=>{t?n():i("auto-scaled")},{isDisabled:o}),(0,RRe.jsx)(TRe.Button,{accessibleWhenDisabled:!0,disabled:e,onClick:()=>{t?n():i("auto-scaled")},icon:KB,label:(0,Kq.__)("Zoom Out"),isPressed:t,size:"compact",showTooltip:!r,className:"editor-zoom-out-toggle"})},ARe=Klt;var y2e=a(G(),1),Cx=a(U(),1),w2e=a(ae(),1),rL=a(j(),1);var NRe=a(G(),1),MRe=a(U(),1);var wx=a(U(),1);function IRe(e){let[t,r]=(0,wx.useState)(e),[o,n]=(0,wx.useState)(e?"loading":"idle");t!==e&&(r(e),n(e?"loading":"idle"));let i=(0,wx.useCallback)(()=>n("loaded"),[]),s=(0,wx.useCallback)(()=>n("error"),[]);return{status:o,handleLoad:i,handleError:s}}var _u=a(T(),1);C2([rM]);var ORe="#1e1e1e",Zlt="#fff";function Xlt({className:e,src:t,name:r,label:o,variant:n,size:i="default",borderColor:s,dimmed:l=!1,statusIndicator:c,style:u,...d}){let{status:f,handleLoad:m,handleError:h}=IRe(t),g=f==="loaded",v=n==="badge"&&!!r,b=r?r.split(/\s+/).slice(0,2).map(S=>S[0]).join("").toUpperCase():void 0,_=(0,MRe.useMemo)(()=>s&&Oo(s).isReadable(ORe,{level:"AA",size:"normal"})?ORe:Zlt,[s]),y={...u,...s?{"--editor-avatar-outline-color":s,"--editor-avatar-name-color":_}:{}},w=(0,_u.jsxs)("div",{className:J("editor-avatar",e,{"has-avatar-border-color":!!s,"has-src":g,"is-badge":v,"is-small":i==="small","is-dimmed":l}),style:y,role:r?"img":void 0,"aria-label":r||void 0,...d,children:[(0,_u.jsxs)("span",{className:"editor-avatar__image",children:[t&&(0,_u.jsx)("img",{src:t,alt:"",crossOrigin:"anonymous",className:"editor-avatar__img",onLoad:m,onError:h}),!g&&b]}),l&&!!c&&(0,_u.jsx)("span",{className:"editor-avatar__status-indicator",children:(0,_u.jsx)(NRe.Icon,{icon:c})}),v&&(0,_u.jsx)("span",{className:"editor-avatar__name",children:o||r})]});return r&&(!v||o)?(0,_u.jsxs)(Ze.Root,{children:[(0,_u.jsx)(Ze.Trigger,{render:w}),(0,_u.jsx)(Ze.Popup,{children:r})]}):w}var em=Xlt;var FRe=a(U(),1),zD=a(j(),1),HD=a(T(),1);function Qlt({className:e,max:t=3,children:r,...o}){let n=FRe.Children.toArray(r),i=n.slice(0,t),s=n.length-t;return(0,HD.jsxs)("div",{role:"group",className:J("editor-avatar-group",e),...o,children:[i,s>0&&(0,HD.jsx)("span",{className:"editor-avatar-group__overflow","aria-label":(0,zD.sprintf)((0,zD._n)("%d more collaborator","%d more collaborators",s),s),children:`+${s}`})]})}var Qq=Qlt;var HP=a(j(),1),GD=a(G(),1);var XRe=a(Nl(),1);function tm(e){return e?.["48"]||e?.["96"]||e?.["24"]}var VRe=a(j(),1),Wg=a(vd(),1),BRe=a(Mp(),1);function jRe(e){return e.trim()}var BP=-16,Jlt=16,DRe=20,LRe=["#6F42C1","#D94145","#FBBF24","#FF35EE","#879F11","#0F766E","#00CFFF"];function za(e){return LRe[e%LRe.length]}function zRe(e,t=10){if(!e)return"";let r=(0,VRe._x)("words","Word count type. Do not translate!"),o=e.trim(),n="";if(r==="words")n=o.split(" ",t).join(" ");else if(r==="characters_excluding_spaces"){let s=o.split("",t).join(""),l=s.length-s.replaceAll(" ","").length;n=o.split("",t+l).join("")}else r==="characters_including_spaces"&&(n=o.split("",t).join(""));return n!==o?n+"\u2026":n}function Gg(e){let t=e?.noteId,r=Array.isArray(t)?t:[t],o=new Set;for(let n of r){let i=Number(n);Number.isFinite(i)&&i>0&&o.add(i)}return[...o]}function HRe(e,t){let r=new Set(Gg(e)),o=Number(t);return r.has(o)?e:(r.add(o),{...e,noteId:[...r]})}var jP="core/note";function $lt(e,t){if(t==null)return null;let r=null;if(e instanceof Wg.RichTextData?r=e.toHTMLString():typeof e=="string"&&(r=e),!r||r.indexOf("wp-note")===-1)return null;let o=String(t),i=(0,Wg.create)({html:r}).formats,s=-1;for(let l=0;ld.type===jP&&d.attributes&&d.attributes["data-id"]===o))s===-1&&(s=l);else if(s!==-1)return{start:s,end:l};return s!==-1?{start:s,end:i.length}:null}function UD(e,t){if(!e)return null;for(let r of Object.keys(e)){let o=$lt(e[r],t);if(o)return{attributeKey:r,start:o.start,end:o.end}}return null}function WD(e){return`mark.wp-note[data-id="${String(e).replace(/["\\\n\r\f]/g,r=>r==='"'||r==="\\"?`\\${r}`:`\\${r.codePointAt(0).toString(16)} `)}"]`}function URe(e){let t=e.ownerDocument.defaultView?.getSelection();if(!t||t.rangeCount===0||t.isCollapsed)return null;let r=t.getRangeAt(0);if(r.collapsed||!e.contains(r.commonAncestorContainer))return null;let o=(0,BRe.getRectangleFromRange)(r);return!o||o.width===0&&o.height===0?null:o}var ect=-1;function WRe(e,t){let r=UD(t,e?.id);return r?r.start:ect}function GRe(e,t,r,o){let n=e.formats.slice();for(let l=r;l{let c=i.get(l);return c?c.end-c.start:0};for(let l=0;lf.type===jP);if(u.length===0)continue;u.length>1&&u.sort((f,m)=>s(m.attributes?.["data-id"])-s(f.attributes?.["data-id"]));let d=c.filter(f=>f.type!==jP);n[l]=[...u,...d]}return{...e,formats:n}}function Jq(e,t){if(!(e instanceof Wg.RichTextData))return null;let r=String(t),o=(0,Wg.create)({html:e.toHTMLString()}),n=!1,i=o.formats.map(s=>{if(!s)return s;let l=s.filter(c=>!(c.type===jP&&c.attributes?.["data-id"]===r));return l.length===s.length?s:(n=!0,l.length?l:void 0)});return n?Wg.RichTextData.fromHTMLString(new Wg.RichTextData({...o,formats:i}).toHTMLString()):null}function zP(e){return e.find(t=>t.status==="hold")??e[0]??null}function YRe(e,t){let r=new Set(Gg(e));return r.delete(Number(t)),{...e,noteId:r.size>0?[...r]:void 0}}function qRe({threads:e,selectedNoteId:t,blockRects:r,heights:o,scrollTop:n=0}){let i={},s=[...e].sort((b,_)=>(r[b.id]?.top??Number.MAX_VALUE)-(r[_.id]?.top??Number.MAX_VALUE)),l=Math.max(0,s.findIndex(b=>b.id===t)),c=s[l];if(!c||!r[c.id])return{positions:{}};let d=r[c.id].top||0,f=o[c.id]||0;i[c.id]=BP;let m=d+BP,h=f;for(let b=l+1;b=0;b--){let _=s[b],y=r[_.id];if(!y)continue;let w=y.top||0,S=o[_.id]||0,x=BP;w+S>g&&(x=g-w-S-DRe),i[_.id]=x,g=w+x}let v={};for(let b of s){let _=r[b.id];_&&i[b.id]!==void 0&&(v[b.id]=_.top+n+i[b.id])}return{positions:v}}function KRe(e,t,r){if(!t)return Promise.resolve(null);let o=e&&e!=="new"?`[role=treeitem][id="note-thread-${e}"]`:"[role=treeitem]:not([id])",n=r?`${o} ${r}`:o;return new Promise(i=>{if(t.querySelector(n))return i(t.querySelector(n));let s=null,l=new window.MutationObserver(()=>{t.querySelector(n)&&(clearTimeout(s),l.disconnect(),i(t.querySelector(n)))});l.observe(t,{childList:!0,subtree:!0}),s=setTimeout(()=>{l.disconnect(),i(null)},3e3)})}function us(e,t,r){return KRe(e,t,r).then(o=>{o&&(o.focus(),o.scrollIntoView({block:"nearest"}))})}function ZRe(e,t){return KRe(e,t).then(r=>{r?.scrollIntoView({block:"nearest"})})}var Ha=a(T(),1);function QRe({activeCollaborators:e,popoverAnchor:t,setIsPopoverVisible:r,cursorRegistry:o}){let n=i=>{o.scrollToCursor(i,{behavior:"smooth",block:"center",highlightDuration:2e3})&&((0,XRe.speak)((0,HP.__)("Scrolled to cursor"),"polite"),r(!1))};return(0,Ha.jsx)(GD.Popover,{anchor:t,placement:"bottom",offset:8,className:"editor-collaborators-presence__list",onClose:()=>r(!1),children:(0,Ha.jsxs)("div",{className:"editor-collaborators-presence__list-content",children:[(0,Ha.jsxs)("div",{className:"editor-collaborators-presence__list-header",children:[(0,Ha.jsxs)("div",{className:"editor-collaborators-presence__list-header-title",children:[(0,HP.__)("Collaborators"),(0,Ha.jsx)("span",{children:e.length})]}),(0,Ha.jsx)("div",{className:"editor-collaborators-presence__list-header-action",children:(0,Ha.jsx)(GD.Button,{__next40pxDefaultSize:!0,icon:Fi,iconSize:24,label:(0,HP.__)("Close Collaborators List"),onClick:()=>r(!1)})})]}),(0,Ha.jsx)("div",{className:"editor-collaborators-presence__list-items",children:e.map(i=>{let s=i.isMe;return(0,Ha.jsxs)("button",{className:"editor-collaborators-presence__list-item",disabled:s,onClick:()=>n(i.clientId),children:[(0,Ha.jsx)(em,{src:tm(i.collaboratorInfo.avatar_urls),name:i.collaboratorInfo.name,borderColor:s?"var(--wp-admin-theme-color)":za(i.collaboratorInfo.id),dimmed:!i.isConnected}),(0,Ha.jsx)("div",{className:"editor-collaborators-presence__list-item-info",children:(0,Ha.jsx)("div",{className:"editor-collaborators-presence__list-item-name",children:s?(0,HP.__)("You"):i.collaboratorInfo.name})})]},i.clientId)})})]})})}function tct(e,t){e.classList.add("collaborators-overlay-cursor-highlighted"),setTimeout(()=>{e.classList.remove("collaborators-overlay-cursor-highlighted")},t)}function JRe(){let e=new Map;return{registerCursor(t,r){e.set(t,r)},unregisterCursor(t){e.delete(t)},scrollToCursor(t,r){let o=e.get(t);return o?(o.scrollIntoView({behavior:r?.behavior??"smooth",block:r?.block??"center",inline:r?.inline??"nearest"}),r?.highlightDuration&&tct(o,r.highlightDuration),!0):!1},removeAll(){e.clear()}}}var b2e=a(be(),1);var eL=a(Ce(),1),Su=a(U(),1),g2e=a(j(),1);var YD="0 1px 1px rgba(0, 0, 0, 0.03), 0 1px 2px rgba(0, 0, 0, 0.02), 0 3px 3px rgba(0, 0, 0, 0.02), 0 4px 4px rgba(0, 0, 0, 0.01)",$q="9999px",eK="32px",tK="24px",qD="4px",KD="8px",rK="1px",$Re="2px",Yg="#fff",e2e="11px",t2e="13px",oK="var(--wpds-typography-font-weight-emphasis, 600)",r2e="20px";var o2e=`
.editor-avatar {
position: relative;
display: inline-flex;
align-items: center;
border-radius: ${$q};
flex-shrink: 0;
box-shadow: 0 0 0 var(--wp-admin-border-width-focus, 2px) ${Yg}, ${YD};
}
.editor-avatar__image {
box-sizing: border-box;
position: relative;
width: ${eK};
height: ${eK};
border-radius: ${$q};
border: 0;
background-color: var(--wp-admin-theme-color, #3858e9);
overflow: hidden;
overflow: clip;
flex-shrink: 0;
font-size: 0;
color: ${Yg};
}
.is-small > .editor-avatar__image {
width: ${tK};
height: ${tK};
}
.has-avatar-border-color > .editor-avatar__image {
border: var(--wp-admin-border-width-focus, 2px) solid var(--editor-avatar-outline-color);
background-clip: padding-box;
}
.has-avatar-border-color > .editor-avatar__image::after {
content: "";
position: absolute;
inset: 0;
border-radius: inherit;
box-shadow: inset 0 0 0 var(--wp-admin-border-width-focus, 2px) ${Yg};
pointer-events: none;
z-index: 1;
}
.editor-avatar__img {
position: absolute;
inset: 0;
width: 100%;
height: 100%;
object-fit: cover;
border-radius: inherit;
opacity: 0;
}
.has-src > .editor-avatar__image > .editor-avatar__img {
opacity: 1;
}
.editor-avatar:not(.has-src) > .editor-avatar__image {
display: flex;
align-items: center;
justify-content: center;
font-size: ${e2e};
font-weight: ${oK};
border: 0;
background-clip: border-box;
}
.editor-avatar:not(.has-src) > .editor-avatar__image::after {
content: none;
}
.editor-avatar:not(.has-src).has-avatar-border-color > .editor-avatar__image {
background-color: var(--editor-avatar-outline-color);
}
.editor-avatar__name {
font-size: ${t2e};
font-weight: ${oK};
line-height: ${r2e};
color: var(--editor-avatar-name-color, ${Yg});
min-width: 0;
padding-bottom: 2px; /* $grid-unit-05 / 2 */
overflow: hidden;
opacity: 0;
white-space: nowrap;
transition: opacity 0.15s cubic-bezier(0.15, 0, 0.15, 1);
}
.editor-avatar.is-badge {
display: inline-grid;
grid-template-columns: min-content 0fr;
column-gap: 0;
padding-inline-end: 0;
background-color: var(--wp-admin-theme-color, #3858e9);
transition:
grid-template-columns 0.3s cubic-bezier(0.15, 0, 0.15, 1),
column-gap 0.3s cubic-bezier(0.15, 0, 0.15, 1),
padding-inline-end 0.3s cubic-bezier(0.15, 0, 0.15, 1);
}
.editor-avatar.is-badge:hover {
grid-template-columns: min-content 1fr;
column-gap: ${qD};
padding-inline-end: ${KD};
transition-timing-function: cubic-bezier(0.85, 0, 0.85, 1);
}
.editor-avatar.is-badge:hover .editor-avatar__name {
opacity: 1;
transition-timing-function: cubic-bezier(0.85, 0, 0.85, 1);
}
.editor-avatar.is-badge.has-avatar-border-color {
background-color: var(--editor-avatar-outline-color);
}
@media (prefers-reduced-motion: reduce) {
.editor-avatar.is-badge,
.editor-avatar__name {
transition: none;
}
}
`;var n2e=`
.block-canvas-cover {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
pointer-events: none;
z-index: 20000;
}
.block-canvas-cover .collaborators-overlay-full {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
.block-canvas-cover .collaborators-overlay-fixed {
position: fixed;
width: 100%;
height: 100%;
}
.collaborators-overlay-user {
position: absolute;
}
/* Cursor lines render below avatar labels across all users. The parent
.collaborators-overlay-user has no z-index so it does not create a
stacking context \u2014 children participate in the shared overlay context. */
.collaborators-overlay-user-cursor {
position: absolute;
z-index: 0;
width: ${$Re};
border-radius: ${rK};
outline: ${rK} solid ${Yg};
box-shadow: ${YD};
animation: collaborators-overlay-cursor-blink 1s infinite;
}
.collaborators-overlay-selection-rect {
position: absolute;
opacity: 0.15;
pointer-events: none;
border-radius: 2px;
}
/* Overlay-specific positioning applied to the Avatar cursor label. */
.collaborators-overlay-user-label.editor-avatar {
position: absolute;
z-index: 1;
transform: translate(-11px, -100%);
margin-top: -${qD};
pointer-events: auto;
overflow: visible;
width: max-content;
}
/* Avatar positioned above a highlighted block as a label. */
.collaborators-overlay-block-label.editor-avatar {
position: absolute;
z-index: 1;
transform: translateY(calc(-100% - ${KD}));
pointer-events: auto;
overflow: visible;
width: max-content;
}
@keyframes collaborators-overlay-cursor-blink {
0%, 45% { opacity: 1; }
55%, 95% { opacity: 0; }
100% { opacity: 1; }
}
.collaborators-overlay-cursor-highlighted .collaborators-overlay-user-cursor {
animation: collaborators-overlay-cursor-highlight 0.6s ease-in-out 3;
}
.collaborators-overlay-cursor-highlighted .collaborators-overlay-user-label {
animation: collaborators-overlay-label-highlight 0.6s ease-in-out 3;
}
@keyframes collaborators-overlay-cursor-highlight {
0%, 100% {
transform: scale(1);
filter: drop-shadow(0 0 0 transparent);
}
50% {
transform: scale(1.2);
filter: drop-shadow(0 0 8px currentColor);
}
}
@keyframes collaborators-overlay-label-highlight {
0%, 100% {
transform: translate(-11px, -100%) scale(1);
filter: drop-shadow(0 0 0 transparent);
}
50% {
transform: translate(-11px, -100%) scale(1.1);
filter: drop-shadow(0 0 6px currentColor);
}
}
.block-editor-block-list__block.is-collaborator-selected:not(:focus)::after {
content: "";
position: absolute;
pointer-events: none;
top: 0;
right: 0;
bottom: 0;
left: 0;
outline-color: var(--collaborator-outline-color);
outline-style: solid;
outline-width: calc(var(--wp-admin-border-width-focus) / var(--wp-block-editor-iframe-zoom-out-scale, 1));
outline-offset: calc(-1 * var(--wp-admin-border-width-focus) / var(--wp-block-editor-iframe-zoom-out-scale, 1));
box-shadow: inset 0 0 0 calc((var(--wp-admin-border-width-focus) / var(--wp-block-editor-iframe-zoom-out-scale, 1)) + 0.5px) rgba(${Yg}, 0.7);
z-index: 1;
}
@media (prefers-reduced-motion: reduce) {
.collaborators-overlay-user-label,
.collaborators-overlay-user-cursor {
animation: none;
}
}
`;function i2e(e,t){let r=null,o=()=>{try{e()}catch{}r=setTimeout(o,t)};return r=setTimeout(o,t),()=>{r&&clearTimeout(r)}}var iK=a(ae(),1),Sx=a(U(),1);var _x=a(U(),1);function ZD(e){let[t,r]=(0,_x.useState)(0),o=(0,_x.useRef)(null),n=(0,_x.useCallback)(()=>(o.current&&clearTimeout(o.current),o.current=setTimeout(()=>{r(i=>i+1)},e),()=>{o.current&&clearTimeout(o.current)}),[e]);return[t,n]}var{useActiveCollaborators:rct,useResolvedSelection:oct}=q(iK.privateApis),{SelectionType:nct}=q(iK.privateApis);function s2e(e,t,r,o,n){let i=(0,Sx.useRef)(new Set),s=rct(r??null,o??null),l=oct(r??null,o??null),[c,u]=(0,Sx.useState)([]),[d,f]=ZD(n);return(0,Sx.useEffect)(()=>{if(!t){u([]);return}let m=i.current,h=new Set,g=s.filter(y=>{let w=y.editorState?.selection?.type===nct.WholeBlock;return!y.isMe&&w}).map(y=>{let w;try{({localClientId:w}=l(y.editorState?.selection))}catch{return null}return w?{blockId:w,color:y.isMe?"var(--wp-admin-theme-color)":za(y.collaboratorInfo.id),userName:y.collaboratorInfo.name,avatarUrl:tm(y.collaboratorInfo.avatar_urls)}:null}).filter(y=>!y||h.has(y.blockId)?!1:(h.add(y.blockId),!0)),v=new Set(g.map(y=>y.blockId));for(let y of m)if(!v.has(y)){let w=nK(t,y);w&&(w.classList.remove("is-collaborator-selected"),w.style.removeProperty("--collaborator-outline-color")),m.delete(y)}let b=[],_=e?.getBoundingClientRect()??null;return g.forEach(y=>{let{color:w,blockId:S,userName:x,avatarUrl:C}=y,A=nK(t,S);if(A&&(A.classList.add("is-collaborator-selected"),A.style.setProperty("--collaborator-outline-color",w),m.add(S),_)){let P=A.getBoundingClientRect();b.push({blockId:S,userName:x,avatarUrl:C,color:w,x:P.left-_.left,y:P.top-_.top})}}),u(b),()=>{for(let y of m){let w=nK(t,y);w&&(w.classList.remove("is-collaborator-selected"),w.style.removeProperty("--collaborator-outline-color"))}m.clear()}},[s,t,e,d,l]),{highlights:c,rerenderHighlightsAfterDelay:f}}var nK=(e,t)=>e.querySelector(`[data-block="${t}"]`);var aK=a(ae(),1),f2e=a(Y(),1),$D=a(U(),1),p2e=a(Lt(),1);var u2e=a(ae(),1);var ict=500,XD=(e,t,r,o)=>e===null||!t?null:sct(t,e,r,o)??null,sct=(e,t,r,o)=>{let{node:n,offset:i}=sK(e,t,r),s=r.createRange();try{s.setStart(n,i)}catch{return null}s.collapse(!0);let l=s.getBoundingClientRect(),c=e.getBoundingClientRect(),u=0,d=0;l.x===0&&l.y===0&&l.width===0&&l.height===0?(u=c.left-o.left,d=c.top-o.top):(u=l.left-o.left,d=l.top-o.top);let f=l.height;if(f===0){let m=r.defaultView??window;f=parseInt(m.getComputedStyle(e).lineHeight,10)||c.height}return{x:u,y:d,height:f}},QD=(e,t,r,o,n)=>{let i=t,s=r;i>s&&([i,s]=[s,i]);let l=sK(e,i,o),c=sK(e,s,o),u=o.createRange();try{u.setStart(l.node,l.offset),u.setEnd(c.node,c.offset)}catch{return null}let d=u.getClientRects(),f=[];for(let m of d){if(m.width===0&&m.height===0)continue;let h=m.left-n.left,g=m.top-n.top;f.some(b=>b.x===h&&b.y===g&&b.width===m.width&&b.height===m.height)||f.push({x:h,y:g,width:m.width,height:m.height})}return f.length>0?f:null},a2e=(e,t,r)=>{let o=t.createRange();o.selectNodeContents(e);let n=o.getClientRects(),i=[];for(let s of n)s.width===0&&s.height===0||i.push({x:s.left-r.left,y:s.top-r.top,width:s.width,height:s.height});if(i.length===0){let s=e.getBoundingClientRect();s.width>0&&s.height>0&&i.push({x:s.left-r.left,y:s.top-r.top,width:s.width,height:s.height})}return i},l2e=(e,t,r)=>{let o=r.querySelectorAll("[data-block]"),n=-1,i=-1;for(let l=0;li&&([n,i]=[i,n]);let s=[];for(let l=n+1;l{let o=r.createTreeWalker(e,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT),n=0,i=null,s=null,l=1;for(;s=o.nextNode();){if(l++,l>ict)return i?{node:i,offset:0}:{node:e,offset:0};let c=s.nodeValue?.length??0;if(s.nodeType===Node.ELEMENT_NODE)if(s.nodeName==="BR"){if(n+1>=t){let u=o.nextNode();return u?.nodeType===Node.TEXT_NODE?{node:u,offset:0}:i?{node:i,offset:i.nodeValue?.length??0}:{node:e,offset:0}}n+=1;continue}else continue;if(c!==0){if(n+c>=t)return{node:s,offset:t-n};n+=c,s.nodeType===Node.TEXT_NODE&&(i=s)}}return i&&i.nodeValue?.length?{node:i,offset:i.nodeValue.length}:{node:e,offset:0}},c2e=(e,t)=>e.compareDocumentPosition(t)===Node.DOCUMENT_POSITION_FOLLOWING;var{SelectionDirection:act,SelectionType:JD}=q(u2e.privateApis);function UP(e,t){if(!t.localClientId)return null;let r=e.querySelector(`[data-block="${t.localClientId}"]`);if(!r||!t.attributeKey)return r;let o=CSS.escape(t.attributeKey);return r.querySelector(`[data-wp-block-attribute-key="${o}"]`)??r}function d2e(e,t,r,o){return e.type===JD.None||e.type===JD.WholeBlock?{}:e.type===JD.Cursor?lct(t,o):r?cct(e,t,r,o):{}}function lct(e,t){if(!e.localClientId)return{};let r=UP(t.editorDocument,e);return{coords:XD(e.richTextOffset,r,t.editorDocument,t.overlayRect)}}function cct(e,t,r,o){if(!t.localClientId||!r.localClientId||t.richTextOffset===null||r.richTextOffset===null)return{};let i=e.selectionDirection===act.Backward?t:r,s,l=null;if(e.type===JD.SelectionInOneBlock){let u=uct(t,r,o);s=u.rects,l=u.blockElement}else{let u=dct(t,r,o);s=u.rects,l=i.localClientId===u.firstBlockClientId?u.firstBlock:u.lastBlock}if(s.length>0)return{coords:XD(i.richTextOffset,l,o.editorDocument,o.overlayRect),selectionRects:s};let c=UP(o.editorDocument,t);return{coords:XD(t.richTextOffset,c,o.editorDocument,o.overlayRect)}}function uct(e,t,r){let o=UP(r.editorDocument,e);return!o||e.richTextOffset===null||t.richTextOffset===null?{rects:[],blockElement:null}:{rects:QD(o,e.richTextOffset,t.richTextOffset,r.editorDocument,r.overlayRect)??[],blockElement:o}}function dct(e,t,r){let o=e,n=t,i=UP(r.editorDocument,o),s=UP(r.editorDocument,n);if(i&&s&&c2e(s,i)&&(o=t,n=e,[i,s]=[s,i]),!i||!s||o.richTextOffset===null||n.richTextOffset===null||!o.localClientId||!n.localClientId)return{rects:[],firstBlock:null,lastBlock:null,firstBlockClientId:null};let l=[],c=QD(i,o.richTextOffset,Number.MAX_SAFE_INTEGER,r.editorDocument,r.overlayRect);c&&l.push(...c);let u=l2e(o.localClientId,n.localClientId,r.editorDocument);for(let f of u){let m=a2e(f,r.editorDocument,r.overlayRect);l.push(...m)}let d=QD(s,0,n.richTextOffset,r.editorDocument,r.overlayRect);return d&&l.push(...d),{rects:l,firstBlock:i,lastBlock:s,firstBlockClientId:o.localClientId}}var{useActiveCollaborators:fct,useResolvedSelection:pct}=q(aK.privateApis),{SelectionType:xx}=q(aK.privateApis);function m2e(e,t,r,o,n){let i=fct(r??null,o??null),s=pct(r??null,o??null),l=(0,f2e.useSelect)(m=>m(p2e.store).get("core","showCollaborationCursor"),[]),[c,u]=(0,$D.useState)([]),[d,f]=ZD(n);return(0,$D.useEffect)(()=>{if(!e||!t){u([]);return}let m=e.getBoundingClientRect(),h={editorDocument:t,overlayRect:m},g=[],v=i.some(b=>!b.isMe);i.forEach(b=>{if(b.isMe&&(!l||!v))return;let _=b.editorState?.selection??{type:xx.None},y={richTextOffset:null,localClientId:null,attributeKey:null},w;if(_.type===xx.Cursor)try{y=s(_)}catch{return}else if(_.type===xx.SelectionInOneBlock||_.type===xx.SelectionInMultipleBlocks)try{y=s({type:xx.Cursor,cursorPosition:_.cursorStartPosition}),w=s({type:xx.Cursor,cursorPosition:_.cursorEndPosition})}catch{return}let S=b.collaboratorInfo.name,x=b.clientId,C=b.isMe?"var(--wp-admin-theme-color)":za(b.collaboratorInfo.id),A=tm(b.collaboratorInfo.avatar_urls),P=d2e(_,y,w,h);if(P.coords){let R={userName:S,clientId:x,color:C,avatarUrl:A,isMe:b.isMe,...P.coords};P.selectionRects&&(R.selectionRects=P.selectionRects),g.push(R)}}),u(g)},[t,s,e,i,l,d]),{cursors:c,rerenderCursorsAfterDelay:f}}var of=a(T(),1),h2e=500,mct=1e4;function v2e({blockEditorDocument:e,postId:t,postType:r,cursorRegistry:o}){let[n,i]=(0,Su.useState)(null),{cursors:s,rerenderCursorsAfterDelay:l}=m2e(n,e??null,t??null,r??null,h2e),{highlights:c,rerenderHighlightsAfterDelay:u}=s2e(n,e??null,t??null,r??null,h2e),d=(0,Su.useCallback)(()=>{l(),u()},[l,u]),f=(0,eL.useResizeObserver)(d);(0,Su.useEffect)(()=>{let v=l(),b=u();return()=>{v(),b()}},[l,u]),(0,Su.useEffect)(()=>{if(s.length!==0)return i2e(l,mct)},[s.length,l]);let m=(0,eL.useMergeRefs)([i,f]),h=(0,Su.useRef)(new Map);(0,Su.useEffect)(()=>{if(!o)return;let v=h.current,b=new Set(s.map(_=>_.clientId));for(let _ of v.keys())b.has(_)||(o.unregisterCursor(_),v.delete(_));for(let[_,y]of v.entries())o.registerCursor(_,y);return()=>o.removeAll()},[s,o]);let g=(0,Su.useCallback)(v=>b=>{b?h.current.set(v,b):h.current.delete(v)},[]);return(0,of.jsxs)("div",{className:"collaborators-overlay-full",ref:m,children:[(0,of.jsx)("style",{children:o2e+n2e}),s.map(v=>(0,of.jsxs)("div",{children:[!v.isMe&&v.selectionRects?.map((b,_)=>(0,of.jsx)("div",{className:"collaborators-overlay-selection-rect",style:{left:`${b.x}px`,top:`${b.y}px`,width:`${b.width}px`,height:`${b.height}px`,backgroundColor:v.color}},`${v.clientId}-sel-${_}`)),(0,of.jsxs)("div",{ref:g(v.clientId),className:"collaborators-overlay-user",style:{left:`${v.x}px`,top:`${v.y}px`},children:[!v.isMe&&(0,of.jsx)("div",{className:"collaborators-overlay-user-cursor",style:{backgroundColor:v.color,height:`${v.height}px`}}),(0,of.jsx)(em,{className:"collaborators-overlay-user-label",variant:"badge",size:"small",src:v.avatarUrl,name:v.userName,label:v.isMe?(0,g2e.__)("You"):void 0,borderColor:v.color})]})]},v.clientId)),c.map(v=>(0,of.jsx)(em,{className:"collaborators-overlay-block-label",variant:"badge",size:"small",src:v.avatarUrl,name:v.userName,borderColor:v.color,style:{left:`${v.x}px`,top:`${v.y}px`}},v.blockId))]})}var lK=a(T(),1),{BlockCanvasCover:hct}=q(b2e.privateApis);function tL({postId:e,postType:t,cursorRegistry:r}){return(0,lK.jsx)(hct.Fill,{children:({containerRef:o})=>(0,lK.jsx)(v2e,{blockEditorDocument:o.current?.ownerDocument,postId:e,postType:t,cursorRegistry:r})})}var fc=a(T(),1),{useActiveCollaborators:gct}=q(w2e.privateApis);function cK({postId:e,postType:t}){let r=gct(e,t),o=r.filter(f=>!f.isMe),n=(0,Cx.useMemo)(()=>[...r].sort((f,m)=>f.isMe&&!m.isMe?-1:!f.isMe&&m.isMe?1:0),[r]),[i]=(0,Cx.useState)(JRe),[s,l]=(0,Cx.useState)(!1),[c,u]=(0,Cx.useState)(null);if(o.length===0)return null;let d=r.find(f=>f.isMe);return(0,fc.jsxs)(fc.Fragment,{children:[(0,fc.jsxs)("div",{className:"editor-collaborators-presence",children:[(0,fc.jsx)(y2e.Button,{__next40pxDefaultSize:!0,className:"editor-collaborators-presence__button",onClick:()=>l(!s),isPressed:s,ref:u,"aria-label":(0,rL.sprintf)((0,rL.__)("Collaborators list, %d online"),n.length),children:(0,fc.jsxs)(Qq,{max:4,children:[d&&(0,fc.jsx)(em,{src:tm(d.collaboratorInfo.avatar_urls),name:d.collaboratorInfo.name,borderColor:"var(--wp-admin-theme-color)",size:"small"},d.clientId),o.map(f=>(0,fc.jsx)(em,{src:tm(f.collaboratorInfo.avatar_urls),name:f.collaboratorInfo.name,borderColor:za(f.collaboratorInfo.id),size:"small"},f.clientId))]})}),s&&(0,fc.jsx)(QRe,{activeCollaborators:n,popoverAnchor:c,setIsPopoverVisible:l,cursorRegistry:i})]}),(0,fc.jsx)(tL,{postId:e,postType:t,cursorRegistry:i})]})}var ko=a(T(),1);function vct({customSaveButton:e,forceIsDirty:t,setEntitiesSavedStatesCallback:r}){let o=(0,WP.useViewportMatch)("large"),n=(0,WP.useViewportMatch)("medium"),i=(0,WP.useMediaQuery)("(max-width: 403px)"),{postId:s,postType:l,isTextEditor:c,isPublishSidebarOpened:u,showIconLabels:d,hasFixedToolbar:f,hasBlockSelection:m,hasSectionRootClientId:h,isStylesCanvasActive:g}=(0,S2e.useSelect)(w=>{let{get:S}=w(x2e.store),{getEditorMode:x,getCurrentPostType:C,getCurrentPostId:A,isPublishSidebarOpened:P}=w(I),{getStylesPath:R,getShowStylebook:N}=q(w(I)),{getBlockSelectionStart:k,getSectionRootClientId:E}=q(w(_2e.store));return{postId:A(),postType:C(),isTextEditor:x()==="text",isPublishSidebarOpened:P(),showIconLabels:S("core","showIconLabels"),hasFixedToolbar:S("core","fixedToolbar"),hasBlockSelection:!!k(),hasSectionRootClientId:!!E(),isStylesCanvasActive:!!R()?.startsWith("/revisions")||N()}},[]),v=["post","page","wp_template"].includes(l)&&h,[b,_]=(0,C2e.useState)(!0),y=!i&&(!f||f&&(!m||b));return(0,ko.jsx)(OD,{toolbar:(0,ko.jsxs)(ko.Fragment,{children:[(0,ko.jsx)(Qke,{disableBlockTools:g||c}),f&&n&&(0,ko.jsx)(Yke,{isCollapsed:b,onToggle:_})]}),center:y?(0,ko.jsxs)(ko.Fragment,{children:[(0,ko.jsx)(cK,{postType:l,postId:s}),(0,ko.jsx)(G3,{})]}):void 0,settings:(0,ko.jsxs)(ko.Fragment,{children:[!y&&!i&&(0,ko.jsx)(cK,{postType:l,postId:s}),!e&&!u&&(0,ko.jsx)(zF,{forceIsDirty:t}),(0,ko.jsx)(_Re,{}),(0,ko.jsx)(ERe,{forceIsAutosaveable:t,disabled:g}),(0,ko.jsx)(LS,{className:"editor-header__post-preview-button",forceIsAutosaveable:t}),o&&v&&(0,ko.jsx)(ARe,{disabled:g}),(o||!d)&&(0,ko.jsx)(Wh.Slot,{scope:"core"}),!e&&(0,ko.jsx)(mRe,{forceIsDirty:t,setEntitiesSavedStatesCallback:r}),e,(0,ko.jsx)(VD,{})]})})}var E2e=vct;var GP=a(Y(),1),nL=a(be(),1),T2e=a(Ce(),1),YP=a(U(),1),P2e=a(Lt(),1),k2e=a(Mo(),1);var oL=a(T(),1),{PrivateInserterLibrary:bct}=q(nL.privateApis);function R2e(){let{blockSectionRootClientId:e,inserterSidebarToggleRef:t,inserter:r,showMostUsedBlocks:o,sidebarIsOpened:n}=(0,GP.useSelect)(m=>{let{getInserterSidebarToggleRef:h,getInserter:g,isPublishSidebarOpened:v}=q(m(I)),{getBlockRootClientId:b,isZoomOut:_,getSectionRootClientId:y}=q(m(nL.store)),{get:w}=m(P2e.store),{getActiveComplementaryArea:S}=m(je),x=()=>{if(_()){let C=y();if(C)return C}return b()};return{inserterSidebarToggleRef:h(),inserter:g(),showMostUsedBlocks:w("core","mostUsedBlocks"),blockSectionRootClientId:x(),sidebarIsOpened:!!(S("core")||v())}},[]),{setIsInserterOpened:i}=(0,GP.useDispatch)(I),{disableComplementaryArea:s}=(0,GP.useDispatch)(je),l=(0,T2e.useViewportMatch)("medium","<"),c=(0,YP.useRef)(),u=(0,YP.useCallback)(()=>{i(!1),t.current?.focus()},[t,i]),d=(0,YP.useCallback)(m=>{m.keyCode===k2e.ESCAPE&&!m.defaultPrevented&&(m.preventDefault(),u())},[u]),f=(0,oL.jsx)("div",{className:"editor-inserter-sidebar__content",children:(0,oL.jsx)(bct,{showMostUsedBlocks:o,showInserterHelpPanel:!0,shouldFocusBlock:l,rootClientId:e??r.rootClientId,__experimentalInsertionIndex:r.insertionIndex,onSelect:r.onSelect,__experimentalInitialTab:r.tab,__experimentalInitialCategory:r.category,__experimentalFilterValue:r.filterValue,onPatternCategorySelection:n?()=>s("core"):void 0,ref:c,onClose:u})});return(0,oL.jsx)("div",{onKeyDown:d,className:"editor-inserter-sidebar",children:f})}var sL=a(be(),1),aL=a(Ce(),1),lL=a(Y(),1),uK=a(Mp(),1),xu=a(U(),1),KP=a(j(),1),I2e=a(xa(),1),O2e=a(Mo(),1);var qP=a(G(),1),iL=a(j(),1);var Ri=a(T(),1);function A2e(){return(0,Ri.jsxs)(Ri.Fragment,{children:[(0,Ri.jsxs)("div",{className:"editor-list-view-sidebar__outline",children:[(0,Ri.jsxs)("div",{children:[(0,Ri.jsx)(qP.__experimentalText,{children:(0,iL.__)("Characters:")}),(0,Ri.jsx)(qP.__experimentalText,{children:(0,Ri.jsx)(lx,{})})]}),(0,Ri.jsxs)("div",{children:[(0,Ri.jsx)(qP.__experimentalText,{children:(0,iL.__)("Words:")}),(0,Ri.jsx)(sx,{})]}),(0,Ri.jsxs)("div",{children:[(0,Ri.jsx)(qP.__experimentalText,{children:(0,iL.__)("Time to read:")}),(0,Ri.jsx)(ax,{})]})]}),(0,Ri.jsx)(mS,{})]})}var qg=a(T(),1),{TabbedSidebar:yct}=q(sL.privateApis);function N2e(){let{setIsListViewOpened:e}=(0,lL.useDispatch)(I),{getListViewToggleRef:t}=q((0,lL.useSelect)(I)),r=(0,aL.useFocusOnMount)("firstElement"),o=(0,xu.useCallback)(()=>{e(!1),t().current?.focus()},[t,e]),n=(0,xu.useCallback)(v=>{v.keyCode===O2e.ESCAPE&&!v.defaultPrevented&&(v.preventDefault(),o())},[o]),[i,s]=(0,xu.useState)(null),[l,c]=(0,xu.useState)("list-view"),u=(0,xu.useRef)(),d=(0,xu.useRef)(),f=(0,xu.useRef)(),m=(0,aL.useMergeRefs)([r,f,s]);function h(v){let b=uK.focus.tabbable.find(d.current)[0];if(v==="list-view"){let _=uK.focus.tabbable.find(f.current)[0];(u.current.contains(_)?_:b).focus()}else b.focus()}let g=(0,xu.useCallback)(()=>{u.current.contains(u.current.ownerDocument.activeElement)?o():h(l)},[o,l]);return(0,I2e.useShortcut)("core/editor/toggle-list-view",g),(0,qg.jsx)("div",{className:"editor-list-view-sidebar",onKeyDown:n,ref:u,children:(0,qg.jsx)(yct,{tabs:[{name:"list-view",title:(0,KP._x)("List View","Post overview"),panel:(0,qg.jsx)("div",{className:"editor-list-view-sidebar__list-view-container",children:(0,qg.jsx)("div",{className:"editor-list-view-sidebar__list-view-panel-content",children:(0,qg.jsx)(sL.__experimentalListView,{dropZoneElement:i})})}),panelRef:m},{name:"outline",title:(0,KP._x)("Outline","Post overview"),panel:(0,qg.jsx)("div",{className:"editor-list-view-sidebar__list-view-container",children:(0,qg.jsx)(A2e,{})})}],onClose:o,onSelect:v=>c(v),defaultTabId:"list-view",ref:d,closeButtonLabel:(0,KP.__)("Close")})})}var XP=a(Y(),1),ZP=a(G(),1);var Zg=a(j(),1);var cL=a(Y(),1),Kg=a(G(),1),M2e=a(ae(),1),rm=a(j(),1),uL=a(cn(),1),F2e=a(U(),1);var D2e=a(Ce(),1);var Cu=a(T(),1);function wct(){let{revisions:e,perPage:t,currentRevisionId:r,revisionKey:o,revisionPage:n,totalRevisions:i}=(0,cL.useSelect)(w=>{let{getCurrentRevisionId:S,getRevisionPage:x,getPageRevisions:C,getRevisionsPerPage:A}=q(w(I)),P=w(I).getCurrentPostType();if(!P)return{};let N=w(M2e.store).getEntityConfig("postType",P)?.revisionKey||"id",k=x();return{revisions:C(k),perPage:A(),currentRevisionId:S(),revisionKey:N,revisionPage:k,totalRevisions:w(I).getCurrentPostRevisionsCount()}},[]),{setCurrentRevisionId:s,setRevisionPage:l}=q((0,cL.useDispatch)(I)),c=(0,D2e.useFocusOnMount)(!0),u=!e,d=Math.ceil(i/t)||1,f=(0,F2e.useMemo)(()=>e&&[...e].reverse(),[e]),m=f?.findIndex(w=>w[o]===r),h=w=>{let S=f?.[w];S&&s(S[o])},g=(0,uL.getSettings)(),v=w=>{let S=f?.[w];return S?(0,uL.dateI18n)(g.formats.datetime,S.date):w},b=d>1;if(u&&!b)return(0,Cu.jsx)(Kg.Spinner,{});if(!u&&!f?.length)return(0,Cu.jsx)("span",{className:"editor-revisions-header__no-revisions",children:(0,rm.__)("No revisions found.")});if(i<=1)return(0,Cu.jsx)("span",{className:"editor-revisions-header__no-revisions",children:(0,rm.__)("Only one revision found.")});let _=w=>{let S=i-(w-1)*t,x=Math.max(1,S-t+1);return(0,rm.sprintf)((0,rm.__)("Revisions %1$s\u2013%2$s"),x,S)},y=u||m===-1?(0,Cu.jsx)(Kg.Spinner,{}):(0,Cu.jsx)(Kg.RangeControl,{ref:c,"aria-valuetext":v(m),className:"editor-revisions-header__slider",hideLabelFromVision:!0,label:(0,rm.__)("Revision"),max:f?.length-1,min:0,marks:!0,onChange:h,renderTooltipContent:v,value:m,withInputField:!1});return b?(0,Cu.jsxs)(le,{direction:"row",gap:"sm",align:"center",style:{flex:1},children:[(0,Cu.jsx)(Kg.Button,{icon:Ar,label:nl(n+1),disabled:u||n>=d,size:"compact",accessibleWhenDisabled:!0}),(0,Cu.jsx)("div",{style:{flex:1,minWidth:0,display:"flex",justifyContent:"center"},children:y}),(0,Cu.jsx)(Kg.Button,{icon:hr,label:n>1?_(n-1):(0,rm.__)("No newer revisions"),onClick:()=>l(n-1),disabled:u||n<=1,size:"compact",accessibleWhenDisabled:!0})]}):y}var L2e=wct;var _l=a(T(),1);function _ct({showDiff:e,onToggleDiff:t}){let{currentRevisionId:r,sidebarIsOpened:o}=(0,XP.useSelect)(d=>({currentRevisionId:q(d(I)).getCurrentRevisionId(),sidebarIsOpened:!!d(je).getActiveComplementaryArea("core")}),[]),{setCurrentRevisionId:n,restoreRevision:i}=q((0,XP.useDispatch)(I)),{enableComplementaryArea:s,disableComplementaryArea:l}=(0,XP.useDispatch)(je),c=!!r,u=()=>{r&&i(r)};return(0,_l.jsx)(OD,{className:"editor-revisions-header",toolbar:(0,_l.jsx)(ZP.Button,{__next40pxDefaultSize:!0,size:"compact",icon:mv,label:(0,Zg._x)("Show changes","revisions"),isPressed:e,onClick:t}),center:(0,_l.jsx)(L2e,{}),settings:(0,_l.jsxs)(_l.Fragment,{children:[(0,_l.jsx)(LS,{className:"editor-header__post-preview-button"}),(0,_l.jsx)(ZP.Button,{__next40pxDefaultSize:!0,icon:(0,Zg.isRTL)()?dv:wf,label:(0,Zg._x)("Settings","panel button label"),isPressed:o,"aria-expanded":o,onClick:()=>{o?l("core"):s("core",cs.document)},size:"compact"}),(0,_l.jsx)(ZP.Button,{__next40pxDefaultSize:!0,variant:"secondary",size:"compact",onClick:()=>n(null),children:(0,Zg.__)("Exit")}),(0,_l.jsx)(ZP.Button,{__next40pxDefaultSize:!0,accessibleWhenDisabled:!0,variant:"primary",size:"compact",className:"editor-revisions-header__restore-button",disabled:!c,onClick:u,children:(0,Zg.__)("Restore")}),(0,_l.jsx)(VD,{disabled:!0})]})})}var dK=_ct;var fAe=a(G(),1),pAe=a(be(),1),_K=a(Y(),1),CL=a(U(),1),mAe=a(zn(),1),hAe=a(Pt(),1),Cl=a(j(),1);var pc=a(be(),1),Sl=a(U(),1),wL=a(Y(),1),vK=a(Pt(),1),iAe=a(ae(),1),Tx=a(Ce(),1);var fK=a(Y(),1),V2e=a(ae(),1),dL=a(U(),1),pK=a(j(),1),B2e=a(G(),1);var j2e=a(T(),1);function z2e({contentRef:e}){let{onNavigateToEntityRecord:t,templateId:r}=(0,fK.useSelect)(s=>{let{getEditorSettings:l,getCurrentTemplateId:c}=s(I);return{onNavigateToEntityRecord:l().onNavigateToEntityRecord,templateId:c()}},[]),o=(0,fK.useSelect)(s=>!!s(V2e.store).canUser("create",{kind:"postType",name:"wp_template"}),[]),[n,i]=(0,dL.useState)(!1);return(0,dL.useEffect)(()=>{let s=c=>{o&&(!c.target.classList.contains("is-root-container")||c.target.dataset?.type==="core/template-part"||c.defaultPrevented||(c.preventDefault(),i(!0)))},l=e.current;return l?.addEventListener("dblclick",s),()=>{l?.removeEventListener("dblclick",s)}},[e,o]),o?(0,j2e.jsx)(B2e.__experimentalConfirmDialog,{isOpen:n,confirmButtonText:(0,pK.__)("Edit template"),onConfirm:()=>{i(!1),t({postId:r,postType:"wp_template"})},onCancel:()=>i(!1),size:"medium",children:(0,pK.__)("You\u2019ve tried to select a block that is part of a template that may be used elsewhere on your site. Would you like to edit the template?")}):null}var U2e=a(Ce(),1),fL=a(Y(),1),mK=a(be(),1);var Sct=500;function H2e(e,t,r){return Math.min(Math.max(e,t),r)}function xct(e,t,r){let o=e-H2e(e,r.left,r.right),n=t-H2e(t,r.top,r.bottom);return Math.sqrt(o*o+n*n)}function W2e({isEnabled:e=!0}={}){let{getEnabledClientIdsTree:t,getBlockName:r,getBlockOrder:o}=q((0,fL.useSelect)(mK.store)),{selectBlock:n}=(0,fL.useDispatch)(mK.store);return(0,U2e.useRefEffect)(i=>{if(!e)return;let s=(c,u)=>{let d=t().flatMap(({clientId:h})=>{let g=r(h);if(g==="core/template-part")return[];if(g==="core/post-content"){let v=o(h);if(v.length)return v}return[h]}),f=1/0,m=null;for(let h of d){let g=i.querySelector(`[data-block="${h}"]`);if(!g)continue;let v=g.getBoundingClientRect(),b=xct(c,u,v);b{(c.target===i||c.target.classList.contains("is-root-container"))&&s(c.clientX,c.clientY)};return i.addEventListener("click",l),()=>i.removeEventListener("click",l)},[e])}var pL=a(Y(),1),G2e=a(Ce(),1),hK=a(be(),1);function Y2e(){let{getSettings:e,isZoomOut:t}=q((0,pL.useSelect)(hK.store)),{resetZoomLevel:r}=q((0,pL.useDispatch)(hK.store));return(0,G2e.useRefEffect)(o=>{function n(i){if(t()&&!i.defaultPrevented){i.preventDefault();let{__experimentalSetIsInserterOpened:s}=e();typeof s=="function"&&s(!1),r()}}return o.addEventListener("dblclick",n),()=>{o.removeEventListener("dblclick",n)}},[e,t,r])}var q2e=a(Y(),1),K2e=a(Ce(),1),mL=a(be(),1),Z2e=a(Pt(),1),Cct=':root :where(.editor-styles-wrapper)::after {content: ""; display: block; height: 40vh;}';function X2e(e){let t=(0,q2e.useRegistry)(),r=(0,K2e.useRefEffect)(o=>{function n(s){if(s.target!==o&&s.target!==o.parentElement)return;let l=o.lastElementChild;if(!l)return;let c=l.getBoundingClientRect();if(s.clientY{i.removeEventListener("pointerdown",n)}},[t]);return e?[r,Cct]:[]}var hL=a(Y(),1),Q2e=a(Ce(),1),gK=a(be(),1);function J2e(){let{getEditedContentOnlySection:e}=q((0,hL.useSelect)(gK.store)),{stopEditingContentOnlySection:t}=q((0,hL.useDispatch)(gK.store));return(0,Q2e.useRefEffect)(r=>{function o(n){let i=e();if(!i)return;!n.target.closest(`[data-block="${i}"]`)&&!n.defaultPrevented&&(n.preventDefault(),t())}return r.addEventListener("click",o),()=>{r.removeEventListener("click",o)}},[e,t])}var gL=a(Y(),1),eAe=a(Ce(),1),tAe=a(Pt(),1),vL=a(ae(),1),bL=a(be(),1),nf=a(G(),1),rAe=a(zn(),1),Xg=a(U(),1),Tu=a(j(),1);var Ex=a(U(),1);function $2e(e){let[t,r]=(0,Ex.useState)(),o=(0,Ex.useRef)(!1);return(0,Ex.useEffect)(()=>{if(!e)return;if(e.status==="connected"){r(void 0),o.current=!1;return}if(e.status!=="disconnected"||!e.willAutoRetryInMs)return;let{willAutoRetryInMs:n}=e,i=Date.now()+n,s=o.current;o.current=!0,s&&r(0);let l=null,c=()=>{r(Math.ceil((i-Date.now())/1e3)),l=setInterval(()=>{let d=Math.ceil((i-Date.now())/1e3);r(Math.max(0,d)),d<=0&&l&&clearInterval(l)},1e3)},u=s?setTimeout(c,500):null;return u||c(),()=>{u&&clearTimeout(u),l&&clearInterval(l)}},[e]),{onManualRetry:()=>{r(0)},secondsRemaining:t}}var Eu=a(T(),1),{BlockCanvasCover:Ect}=q(bL.privateApis),{retrySyncConnection:Tct}=q(vL.privateApis),Pct=2e4;function oAe(){let[e,t]=(0,Xg.useState)(!1),[r,o]=(0,Xg.useState)(!1),[n,i]=(0,Xg.useState)(!1),{connectionStatus:s,isCollaborationEnabled:l,postType:c}=(0,gL.useSelect)(S=>{let{getSyncConnectionStatus:x,getPostType:C}=q(S(vL.store)),{getCurrentPostType:A,isCollaborationEnabledForCurrentPost:P}=q(S(I)),R=A();return{connectionStatus:x()||null,isCollaborationEnabled:P(),postType:R?C(R):null}},[]),{onManualRetry:u,secondsRemaining:d}=$2e(s),f=(0,eAe.useCopyToClipboard)(()=>{let S=(0,gL.select)(bL.store).getBlocks();return(0,tAe.serialize)(S)});(0,Xg.useEffect)(()=>{let S=setTimeout(()=>{t(!0)},Pct);return()=>clearTimeout(S)},[]),(0,Xg.useEffect)(()=>{s?.status!=="connecting"&&i(s!==null&&"canManuallyRetry"in s&&s.canManuallyRetry===!0)},[s]);let m=s&&s.status==="disconnected"&&(s.canManuallyRetry||s.willAutoRetryInMs);(0,Xg.useEffect)(()=>{if(s?.status==="connected"){o(!1);return}s?.status&&s.status!=="connecting"&&(!m||s.backgroundRetriesFailed)&&o(!0)},[s,m]);let h=s?.status==="disconnected"&&"error"in s&&s.error?.code===rq;if(!l||!e&&!h||!r)return null;let g=s&&"error"in s?s?.error:void 0;if(!m&&(0,rAe.applyFilters)("editor.isSyncConnectionErrorHandled",!1,g?.code)!==!1)return null;let v=n?()=>{u(),Tct()}:void 0,b=oEe(g),_="",y=!1;d&&d>0?_=(0,Tu.sprintf)((0,Tu._n)("Retrying connection in %d second\u2026","Retrying connection in %d seconds\u2026",d),d):d===0&&(y=!0,_=(0,Tu.__)("Retrying\u2026"));let w="edit.php";return c?.slug&&(w=`edit.php?post_type=${c.slug}`),(0,Eu.jsx)(Ect.Fill,{children:(0,Eu.jsx)(nf.Modal,{overlayClassName:"editor-sync-connection-error-modal",isDismissible:!1,onRequestClose:()=>{},shouldCloseOnClickOutside:!1,shouldCloseOnEsc:!1,size:"medium",title:b.title,children:(0,Eu.jsxs)(nf.__experimentalVStack,{spacing:6,children:[(0,Eu.jsx)("p",{children:b.description}),_&&(0,Eu.jsx)("p",{className:"editor-sync-connection-error-modal__retry-countdown",children:_}),(0,Eu.jsxs)(nf.__experimentalHStack,{justify:"right",children:[(0,Eu.jsx)(nf.Button,{__next40pxDefaultSize:!0,href:w,isDestructive:!0,variant:"tertiary",children:(0,Tu.sprintf)((0,Tu.__)("Back to %s"),c?.labels?.name??(0,Tu.__)("Posts"))}),(0,Eu.jsx)(nf.Button,{__next40pxDefaultSize:!0,ref:f,variant:v?"secondary":"primary",children:(0,Tu.__)("Copy Post Content")}),v&&(0,Eu.jsx)(nf.Button,{__next40pxDefaultSize:!0,accessibleWhenDisabled:!0,"aria-disabled":y,disabled:y,isBusy:y,variant:"primary",onClick:v,children:(0,Tu.__)("Retry")})]})]})})})}var di=a(T(),1),{LayoutStyle:yL,useLayoutClasses:kct,useLayoutStyles:Rct,ExperimentalBlockCanvas:Act,useFlashEditableBlocks:Ict}=q(pc.privateApis);function bK(e){for(let t=0;ti+(s-i)*l,o=1-Math.max(0,Math.min(1,(e-yK)/(t.width-yK))),n=r(t.width/t.height,Oct,o);return Math.min(Math.round(e/n),t.height)}function Mct({autoFocus:e,iframeProps:t,contentRef:r,className:o}){let n=(0,Tx.useViewportMatch)("small","<"),{renderingMode:i,postContentAttributes:s,editedPostTemplate:l={},wrapperBlockName:c,wrapperUniqueId:u,deviceType:d,isFocusedEntity:f,isDesignPostType:m,postType:h,isPreview:g,styles:v,hasCanvasWidth:b,canvasWidth:_}=(0,wL.useSelect)(ce=>{let{getCurrentPostId:re,getCurrentPostType:ie,getCurrentTemplateId:Ee,getEditorSettings:ke,getRenderingMode:Me,getDeviceType:Ne,getCanvasWidth:Fe}=q(ce(I)),{getPostType:X,getEditedEntityRecord:ge}=ce(iAe.store),Ue=ie(),Ye=Me(),st;Ue===Fu?st="core/block":Ye==="post-only"&&(st="core/post-content");let St=ke(),dt=St.supportsTemplateMode,xt=X(Ue),Xt=Ee(),Xe=Fe(),ps=Xt?ge("postType",Cr,Xt):void 0;return{renderingMode:Ye,postContentAttributes:St.postContentAttributes,isDesignPostType:pm.includes(Ue),editedPostTemplate:xt?.viewable&&dt?ps:void 0,wrapperBlockName:st,wrapperUniqueId:re(),deviceType:Ne(),isFocusedEntity:!!St.onNavigateToPreviousEntityRecord,postType:Ue,isPreview:St.isPreviewMode,styles:St.styles,hasCanvasWidth:Xe!==void 0,canvasWidth:Xe}},[]),{isCleanNewPost:y}=(0,wL.useSelect)(I),{hasRootPaddingAwareAlignments:w,themeHasDisabledLayoutStyles:S,themeSupportsLayout:x,isZoomedOut:C}=(0,wL.useSelect)(ce=>{let{getSettings:re,isZoomOut:ie}=q(ce(pc.store)),Ee=re();return{themeHasDisabledLayoutStyles:Ee.disableLayoutStyles,themeSupportsLayout:Ee.supportsLayout,hasRootPaddingAwareAlignments:Ee.__experimentalFeatures?.useRootPaddingAwareAlignments,isZoomedOut:ie()}},[]),A=(0,Sl.useRef)(),[P]=(0,pc.useSettings)("layout"),[R,N]=(0,Sl.useState)(),k=(0,Tx.useResizeObserver)(ce=>{let{width:re,height:ie}=ce[0].contentRect;N(Ee=>Ee?.width===re&&Ee?.height===ie?Ee:{width:re,height:ie})}),E=(0,Sl.useMemo)(()=>i!=="post-only"||m?{type:"default"}:x?{...P,type:"constrained"}:{type:"default"},[i,x,P,m]),M=(0,Sl.useMemo)(()=>{if(!l?.content&&!l?.blocks&&s)return s;if(l?.blocks)return bK(l?.blocks);let ce=typeof l?.content=="string"?l?.content:"";return bK((0,vK.parse)(ce))||{}},[l?.content,l?.blocks,s]),V=(0,Sl.useMemo)(()=>{if(!l?.content&&!l?.blocks)return!1;if(l?.blocks)return nAe(l?.blocks);let ce=typeof l?.content=="string"?l?.content:"";return nAe((0,vK.parse)(ce))||!1},[l?.content,l?.blocks]),{layout:F={},align:D=""}=M||{},z=kct(M,"core/post-content"),L=J({"is-layout-flow":!x},x&&z,D&&`align${D}`),O=Rct(M,"core/post-content",".block-editor-block-list__layout.is-root-container"),B=(0,Sl.useMemo)(()=>F&&(F?.type==="constrained"||F?.inherit||F?.contentSize||F?.wideSize)?{...P,...F,type:"constrained"}:{...P,...F,type:"default"},[F?.type,F?.inherit,F?.contentSize,F?.wideSize,P]),W=s?B:E,K=W?.type==="default"&&!V?E:W,Z=(0,Sl.useRef)();(0,Sl.useEffect)(()=>{!e||!y()||Z?.current?.focus()},[e,y]);let Q=`.is-root-container.alignwide { max-width: var(--wp--style--global--wide-size); margin-left: auto; margin-right: auto;}
.is-root-container.alignwide:where(.is-layout-flow) > :not(.alignleft):not(.alignright) { max-width: var(--wp--style--global--wide-size);}
.is-root-container.alignfull { max-width: none; margin-left: auto; margin-right: auto;}
.is-root-container.alignfull:where(.is-layout-flow) > :not(.alignleft):not(.alignright) { max-width: none;}`,ue=[kk,Mi,Fu].includes(h),te=ue&&!g&&!n&&!C||b,de=h===kk&&g,[pe,$]=X2e(!g&&i==="post-only"&&!m),fe=te&&_&&R?.height>0&&R?.width>yK?Nct(_,R):"100%",ve="display:flex;align-items:center;justify-content:center;",Oe=b&&!ue?"min-height:100vh;":"",ee=(0,Sl.useMemo)(()=>[...v??[],{css:`:where(.block-editor-iframe__body){display:flow-root;}.is-root-container{display:flow-root;${te||de?"min-height:0!important;":""}}
${$||""}
${te?`.block-editor-iframe__html{background:var(--wp-editor-canvas-background);min-height:100vh;${ve}}.block-editor-iframe__body{width:100%;${Oe}}`:""}${de?`.block-editor-iframe__body{${ve}padding:var(--wp--style--block-gap,2em);}`:""}`}],[v,te,ve,Oe,de,$]),ne=(0,pc.__unstableUseTypewriter)();return r=(0,Tx.useMergeRefs)([A,r,i==="post-only"?ne:null,Ict({isEnabled:i==="template-locked"}),W2e({isEnabled:i==="template-locked"}),Y2e(),pe,J2e()]),(0,di.jsxs)("div",{ref:k,className:J("editor-visual-editor","edit-post-visual-editor",o,{"has-vertical-padding":f||b,"has-horizontal-padding":f||te}),children:[(0,di.jsx)(oAe,{}),(0,di.jsx)(fS,{enableResizing:te,width:te&&_?_+"px":"100%",height:fe,children:(0,di.jsxs)(Act,{shouldIframe:!0,contentRef:r,styles:ee,height:"100%",iframeProps:{...t,style:t?.style},children:[x&&!S&&i==="post-only"&&!m&&(0,di.jsxs)(di.Fragment,{children:[(0,di.jsx)(yL,{selector:".editor-visual-editor__post-title-wrapper",layout:E}),(0,di.jsx)(yL,{selector:".block-editor-block-list__layout.is-root-container",layout:K}),D&&(0,di.jsx)(yL,{css:Q}),O&&(0,di.jsx)(yL,{layout:B,css:O})]}),i==="post-only"&&!m&&(0,di.jsx)("div",{className:J("editor-visual-editor__post-title-wrapper","edit-post-visual-editor__post-title-wrapper",{"has-global-padding":w}),contentEditable:!1,style:{marginTop:"4rem"},children:(0,di.jsx)(cD,{ref:Z})}),(0,di.jsxs)(pc.RecursionProvider,{blockName:c,uniqueId:u,children:[(0,di.jsx)(pc.BlockList,{className:J("is-"+d.toLowerCase()+"-preview",i!=="post-only"||m?"wp-site-blocks":`${L} wp-block-post-content`,{"has-global-padding":i==="post-only"&&!m&&w}),layout:W,dropZoneElement:A.current?.parentNode,__unstableDisableDropZone:i==="template-locked"}),i==="template-locked"&&(0,di.jsx)(z2e,{contentRef:A})]})]})})]})}var _L=Mct;var xl=a(U(),1),SL=a(Ce(),1),aAe=a(Y(),1),xL=a(be(),1),QP=a(j(),1);var Qg=a(T(),1),{useBlockElementRef:Fct}=q(xL.privateApis);function lAe(e){let t=[];for(let r of e)r.__revisionDiffStatus?.status&&t.push({clientId:r.clientId,status:r.__revisionDiffStatus.status}),r.innerBlocks?.length&&t.push(...lAe(r.innerBlocks));return t}var sAe={added:(0,QP.__)("Go to added block"),removed:(0,QP.__)("Go to removed block"),modified:(0,QP.__)("Go to modified block")};function wK(e){if(!e)return null;let t=e.ownerDocument,r=t.documentElement.scrollHeight,o=e.getBoundingClientRect(),n=t.documentElement.scrollTop;return{top:(o.top+n)/r*100,height:o.height/r*100}}function Dct({clientId:e,status:t,subscribe:r}){let o=(0,xl.useRef)();Fct(e,o);let[n,i]=(0,xl.useState)(()=>wK(o.current));return(0,xl.useEffect)(()=>r(()=>{i(wK(o.current))}),[r]),(0,xl.useEffect)(()=>{i(wK(o.current))},[t]),n?(0,Qg.jsxs)(Ze.Root,{children:[(0,Qg.jsx)(Ze.Trigger,{render:(0,Qg.jsx)("button",{className:`revision-diff-marker is-${t}`,style:{top:`${n.top}%`,height:`${Math.max(n.height,.5)}%`},onClick:()=>o.current?.focus(),"aria-label":sAe[t]})}),(0,Qg.jsx)(Ze.Popup,{children:sAe[t]})]}):null}function cAe(){let[e,t]=(0,xl.useState)(!1),r=(0,xl.useRef)(new Set),o=(0,aAe.useSelect)(l=>l(xL.store).getBlocks(),[]),n=(0,xl.useMemo)(()=>lAe(o),[o]),i=(0,xl.useCallback)(l=>(r.current.add(l),()=>r.current.delete(l)),[]),s=(0,SL.useRefEffect)(l=>{let{ownerDocument:c}=l,{defaultView:u}=c,d=new u.ResizeObserver(()=>{r.current.forEach(f=>f())});return d.observe(c.body),()=>{d.disconnect()}},[]);return[(0,SL.useMergeRefs)([s,t]),(0,Qg.jsx)("div",{className:"revision-diff-markers",role:"navigation","aria-label":(0,QP.__)("Document changes"),children:e&&n.map(({clientId:l,status:c})=>(0,Qg.jsx)(Dct,{clientId:l,status:c,subscribe:i},l))},"diff-markers")]}var ho=a(T(),1),{usePrivateStyleOverride:uAe,PrivateBlockContext:dAe}=q(pAe.privateApis),Lct=`
`,Vct=`
.is-revision-added {
box-shadow: inset 0 0 0 9999px color-mix(in srgb, currentColor 5%, #00a32a 15%), 0 0 0 4px color-mix(in srgb, currentColor 5%, #00a32a 15%);
outline: 3px solid #00a32a;
outline-offset: 2px;
}
.is-revision-removed,
.revision-diff-removed {
text-decoration: line-through;
filter: url(#revision-removed-filter);
}
.is-revision-removed {
outline: 3px dashed #d63638;
outline-offset: 2px;
}
.is-revision-modified {
outline: 3px dotted #9a7000 !important;
outline-offset: 2px;
}
.revision-diff-added {
background-color: color-mix(in srgb, currentColor 5%, #00a32a 15%);
text-decoration: none;
}
/* Reset UA styles so format markers keep the same look as before. */
mark.revision-diff-format-added,
mark.revision-diff-format-removed,
mark.revision-diff-format-changed {
background: transparent;
color: inherit;
padding: 0;
}
.revision-diff-format-added {
text-decoration: underline wavy color-mix(in srgb, currentColor 30%, #00a32a 70%);
text-decoration-thickness: 2px;
}
.revision-diff-format-removed {
text-decoration: underline wavy color-mix(in srgb, currentColor 20%, #d63638 80%);
text-decoration-thickness: 2px;
}
.revision-diff-format-changed {
text-decoration: underline wavy color-mix(in srgb, currentColor 30%, #dba617 70%);
text-decoration-thickness: 2px;
}
`;function Bct(e,t){switch(e){case"added":return(0,Cl.sprintf)((0,Cl.__)("Added block: %s"),t);case"removed":return(0,Cl.sprintf)((0,Cl.__)("Removed block: %s"),t);case"modified":return(0,Cl.sprintf)((0,Cl.__)("Modified block: %s"),t)}}function jct({status:e,name:t,attributes:r,children:o}){let n=(0,CL.useContext)(dAe),i=(0,_K.useSelect)(s=>{let{getActiveBlockVariation:l,getBlockType:c}=s(hAe.store);return l(t,r)?.title??c(t)?.title},[t,r]);return(0,ho.jsx)(dAe.Provider,{value:{...n,ariaLabel:i?Bct(e,i):void 0},children:o})}function zct(e){return function(r){let{block:o,className:n,name:i,attributes:s}=r,l=o?.__revisionDiffStatus?.status,c=J(n,{"is-revision-added":l==="added","is-revision-removed":l==="removed","is-revision-modified":l==="modified"});return l?(0,ho.jsx)(jct,{status:l,name:i,attributes:s,children:(0,ho.jsx)(e,{...r,className:c})}):(0,ho.jsx)(e,{...r,className:c})}}var Hct="editor/revisions-canvas/withRevisionDiffClasses";(0,mAe.addFilter)("editor.BlockListBlock",Hct,zct);function Uct({showDiff:e}){return uAe({css:e?Vct:""}),uAe({assets:e?Lct:"",__unstableType:"svgs"}),null}function Wct(){return(0,ho.jsxs)(Yt,{children:[(0,ho.jsx)("span",{id:ic.removed,children:(0,Cl.__)("Removed")}),(0,ho.jsx)("span",{id:ic.added,children:(0,Cl.__)("Added")}),(0,ho.jsx)("span",{id:ic.formatAdded,children:(0,Cl.__)("Format added")}),(0,ho.jsx)("span",{id:ic.formatRemoved,children:(0,Cl.__)("Format removed")}),(0,ho.jsx)("span",{id:ic.formatChanged,children:(0,Cl.__)("Format changed")})]})}function Gct({showDiff:e}){let[t,r]=cAe();return(0,ho.jsxs)(ho.Fragment,{children:[e&&(0,ho.jsx)(Wct,{}),(0,ho.jsx)(_L,{contentRef:t}),e&&r]})}function SK(){(0,CL.useEffect)(()=>(bwe(),()=>{ywe()}),[]);let{revision:e,showDiff:t}=(0,_K.useSelect)(r=>{let{getCurrentRevision:o,isShowingRevisionDiff:n}=q(r(I));return{revision:o(),showDiff:n()}},[]);return e?(0,ho.jsxs)(ho.Fragment,{children:[(0,ho.jsx)(Uct,{showDiff:t}),(0,ho.jsx)("div",{className:"editor-revisions-canvas__content",children:(0,ho.jsx)(Gct,{showDiff:t})})]}):(0,ho.jsx)("div",{className:"editor-revisions-canvas__loading",children:(0,ho.jsx)(fAe.Spinner,{})})}var TL=a(Y(),1),EL=a(U(),1),mc=a(j(),1),gAe=a(It(),1),vAe=a(ae(),1),bAe=a(Lt(),1);var{useOnCollaboratorJoin:Yct,useOnCollaboratorLeave:qct,useOnPostSave:Kct}=q(vAe.privateApis),xK={COLLAB_POST_UPDATED:"collab-post-updated",COLLAB_USER_ENTERED:"collab-user-entered",COLLAB_USER_EXITED:"collab-user-exited"},CK=["publish","private","future"];function Zct(e,t,r){return r?(0,mc.sprintf)((0,mc.__)("Post published by %s."),e):CK.includes(t)?(0,mc.sprintf)((0,mc.__)("Post updated by %s."),e):(0,mc.sprintf)((0,mc.__)("Draft saved by %s."),e)}function yAe(e,t){let{postStatus:r,isCollaborationEnabled:o,showJoinNotifications:n,showLeaveNotifications:i,showPostSaveNotifications:s}=(0,TL.useSelect)(y=>{let{getCurrentPostAttribute:w,isCollaborationEnabledForCurrentPost:S}=q(y(I)),x=C=>y(bAe.store).get("core",C)??!0;return{postStatus:w("status"),isCollaborationEnabled:S(),showJoinNotifications:x("showCollaborationJoinNotifications"),showLeaveNotifications:x("showCollaborationLeaveNotifications"),showPostSaveNotifications:x("showCollaborationPostSaveNotifications")}},[]),{createNotice:l}=(0,TL.useDispatch)(gAe.store),c=o&&n,u=o&&i,d=o&&s,f=y=>y?[e,t]:[null,null],[m,h]=f(c),[g,v]=f(u),[b,_]=f(d);Yct(m,h,(0,EL.useCallback)((y,w)=>{c&&(w&&y.collaboratorInfo.enteredAt{u&&l("info",(0,mc.sprintf)((0,mc.__)("%s has left the post."),y.collaboratorInfo.name),{id:`${xK.COLLAB_USER_EXITED}-${y.collaboratorInfo.id}`,type:"snackbar",isDismissible:!1})},[l,u])),Kct(b,_,(0,EL.useCallback)((y,w,S)=>{if(!d||!r)return;let x=y.postStatus??r??"draft",C=S?.postStatus??r,A=!(C&&CK.includes(C))&&CK.includes(x),P=Zct(w.collaboratorInfo.name,x,A);l("info",P,{id:`${xK.COLLAB_POST_UPDATED}-${w.collaboratorInfo.id}`,type:"snackbar",isDismissible:!1})},[l,r,d]))}var PL=a(Y(),1),JP=a(G(),1),EK=a(j(),1),wAe=a(U(),1);var hc=a(T(),1),{Fill:dSr,Slot:Xct}=(0,JP.createSlotFill)("ActionsPanel");function _Ae({setEntitiesSavedStatesCallback:e,closeEntitiesSavedStates:t,isEntitiesSavedStatesOpen:r,forceIsDirtyPublishPanel:o}){let{closePublishSidebar:n,togglePublishSidebar:i}=(0,PL.useDispatch)(I),{publishSidebarOpened:s,isPublishable:l,isDirty:c,hasOtherEntitiesChanges:u}=(0,PL.useSelect)(m=>{let{isPublishSidebarOpened:h,isEditedPostPublishable:g,isCurrentPostPublished:v,isEditedPostDirty:b,hasNonPostEntityChanges:_}=m(I),y=_();return{publishSidebarOpened:h(),isPublishable:!v()&&g(),isDirty:y||b(),hasOtherEntitiesChanges:y}},[]),d=(0,wAe.useCallback)(()=>e(!0),[]),f;return s?f=(0,hc.jsx)(AF,{onClose:n,forceIsDirty:o,PrePublishExtension:P6.Slot,PostPublishExtension:C6.Slot}):l&&!u?f=(0,hc.jsx)("div",{className:"editor-layout__toggle-publish-panel",children:(0,hc.jsx)(JP.Button,{__next40pxDefaultSize:!0,variant:"secondary",onClick:i,"aria-expanded":!1,children:(0,EK.__)("Open publish panel")})}):f=(0,hc.jsx)("div",{className:"editor-layout__toggle-entities-saved-states-panel",children:(0,hc.jsx)(JP.Button,{__next40pxDefaultSize:!0,variant:"secondary",onClick:d,"aria-expanded":!1,"aria-haspopup":"dialog",disabled:!c,accessibleWhenDisabled:!0,children:(0,EK.__)("Open save panel")})}),(0,hc.jsxs)(hc.Fragment,{children:[r&&(0,hc.jsx)(l6,{close:t,renderDialog:!0}),(0,hc.jsx)(Xct,{bubblesVirtually:!0}),!r&&f]})}var SAe=a(G(),1),kL=a(Y(),1),TK=a(j(),1),xAe=a(xa(),1),RL=a(U(),1);var om=a(T(),1);function CAe({autoFocus:e=!1}){let{switchEditorMode:t}=(0,kL.useDispatch)(I),{shortcut:r,isRichEditingEnabled:o}=(0,kL.useSelect)(i=>{let{getEditorSettings:s}=i(I),{getShortcutRepresentation:l}=i(xAe.store);return{shortcut:l("core/editor/toggle-mode"),isRichEditingEnabled:s().richEditingEnabled}},[]),n=(0,RL.useRef)();return(0,RL.useEffect)(()=>{e||n?.current?.focus()},[e]),(0,om.jsxs)("div",{className:"editor-text-editor",children:[o&&(0,om.jsxs)("div",{className:"editor-text-editor__toolbar",children:[(0,om.jsx)("h2",{children:(0,TK.__)("Editing code")}),(0,om.jsx)(SAe.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:()=>t("visual"),shortcut:r,children:(0,TK.__)("Exit code editor")})]}),(0,om.jsxs)("div",{className:"editor-text-editor__body",children:[(0,om.jsx)(dD,{ref:n}),(0,om.jsx)(PP,{})]})]})}var Pr=a(T(),1),EAe={header:(0,Jg.__)("Editor top bar"),body:(0,Jg.__)("Editor content"),sidebar:(0,Jg.__)("Editor settings"),actions:(0,Jg.__)("Editor publish"),footer:(0,Jg.__)("Editor footer")};function TAe(){let e=(0,$P.useSelect)(t=>t(Px.store).isValidTemplate(),[]);return(0,Pr.jsx)(IAe.ThemeProvider,{cornerRadius:"none",children:(0,Pr.jsx)(AAe.InlineNotices,{className:"editor-notices",pinnedNoticesClassName:"editor-notices__pinned",dismissibleNoticesClassName:"editor-notices__dismissible",children:!e&&(0,Pr.jsx)(o6,{})})})}function OAe({className:e,children:t,forceIsDirty:r,contentRef:o,autoFocus:n,customSaveButton:i,customSavePanel:s,forceDisableBlockTools:l,iframeProps:c}){let{mode:u,postId:d,postType:f,isInserterOpened:m,isListViewOpened:h,isDistractionFree:g,isPreviewMode:v,showBlockBreadcrumbs:b,postTypeLabel:_,stylesPath:y,showStylebook:w,isRevisionsMode:S,showDiff:x}=(0,$P.useSelect)(V=>{let{get:F}=V(PAe.store),{getEditorSettings:D,getPostTypeLabel:z,getCurrentPostType:L,getCurrentPostId:O}=V(I),{getStylesPath:B,getShowStylebook:W,isRevisionsMode:K,isShowingRevisionDiff:Z}=q(V(I)),Q=D(),ue=V(I).getEditorMode();return!Q.richEditingEnabled&&ue==="visual"&&(ue="text"),!Q.codeEditingEnabled&&ue==="text"&&(ue="visual"),{mode:ue,postId:O(),postType:L(),isInserterOpened:V(I).isInserterOpened(),isListViewOpened:V(I).isListViewOpened(),isDistractionFree:F("core","distractionFree"),isPreviewMode:Q.isPreviewMode,showBlockBreadcrumbs:F("core","showBlockBreadcrumbs"),postTypeLabel:z(),stylesPath:B(),showStylebook:W(),isRevisionsMode:K(),showDiff:Z()}},[]),{setShowRevisionDiff:C}=q((0,$P.useDispatch)(I));yAe(d,f);let A=(0,kAe.useViewportMatch)("medium"),P=h?(0,Jg.__)("Document Overview"):(0,Jg.__)("Block Library"),R=w||y?.startsWith("/revisions"),N=!R,[k,E]=(0,AL.useState)(!1),M=(0,AL.useCallback)(V=>{typeof k=="function"&&k(V),E(!1)},[k]);return S?(0,Pr.jsx)(Fb,{className:J("editor-editor-interface",e),labels:EAe,header:(0,Pr.jsx)(dK,{showDiff:x,onToggleDiff:()=>C(!x)}),content:(0,Pr.jsx)(SK,{}),sidebar:(0,Pr.jsx)(Zl.Slot,{scope:"core"})}):(0,Pr.jsx)(Fb,{isDistractionFree:g,className:J("editor-editor-interface",e,{"is-entity-save-view-open":!!k,"is-distraction-free":g&&!v}),labels:{...EAe,secondarySidebar:P},header:!v&&(0,Pr.jsx)(E2e,{forceIsDirty:r,setEntitiesSavedStatesCallback:E,customSaveButton:i,forceDisableBlockTools:l}),editorNotices:(0,Pr.jsx)(TAe,{}),secondarySidebar:!v&&u==="visual"&&(m&&(0,Pr.jsx)(R2e,{})||h&&(0,Pr.jsx)(N2e,{})),sidebar:!v&&!g&&(0,Pr.jsx)(Zl.Slot,{scope:"core"}),content:(0,Pr.jsxs)(Pr.Fragment,{children:[!g&&!v&&(0,Pr.jsx)(TAe,{}),R&&(0,Pr.jsx)(FSe,{}),N&&(0,Pr.jsxs)(Pr.Fragment,{children:[!v&&u==="text"&&(0,Pr.jsx)(CAe,{autoFocus:n}),!v&&!A&&u==="visual"&&(0,Pr.jsx)(Px.BlockToolbar,{hideDragHandle:!0}),(v||u==="visual")&&(0,Pr.jsx)(_L,{contentRef:o,autoFocus:n,iframeProps:c}),t,(0,Pr.jsx)(tL,{postId:d,postType:f})]})]}),footer:!v&&!g&&A&&b&&u==="visual"&&(0,Pr.jsx)(Px.BlockBreadcrumb,{rootLabelText:_?(0,RAe.decodeEntities)(_):void 0}),actions:v?void 0:s||(0,Pr.jsx)(_Ae,{closeEntitiesSavedStates:M,isEntitiesSavedStatesOpen:k,setEntitiesSavedStatesCallback:E,forceIsDirtyPublishPanel:r})})}var n4=a(be(),1),lk=a(Y(),1),iv=a(U(),1),Gx=a(j(),1);var HOe=a(xa(),1),UOe=a(G(),1);var NAe=a(Y(),1),MAe=a(Ml(),1);var FAe=a(T(),1),{OverridesPanel:Qct}=q(MAe.privateApis);function DAe(){return(0,NAe.useSelect)(t=>t(I).getCurrentPostType()==="wp_block",[])?(0,FAe.jsx)(Qct,{}):null}var wIe=a(Y(),1);var El=a(G(),1);var KAe=a(ae(),1),ZAe=a(Y(),1),XAe=a(U(),1),tv=a(j(),1),QAe=a(Mp(),1);var DL=a(Y(),1),tk=a(U(),1),GAe=a(j(),1),Ox=a(G(),1);var YAe=a(ae(),1);var ek=a(Y(),1),ML=a(U(),1),UAe=a(ae(),1);var gc=a(j(),1),LAe=a(U(),1),nm=a(G(),1),Rx=a(Y(),1),OL=a(ae(),1),VAe=a(It(),1);var IL=a(Nt(),1);function kx(e){return typeof e.title=="string"?(0,IL.decodeEntities)(e.title):e.title&&"rendered"in e.title?(0,IL.decodeEntities)(e.title.rendered):e.title&&"raw"in e.title?(0,IL.decodeEntities)(e.title.raw):""}var $g=a(T(),1),Jct=({items:e,closeModal:t})=>{let[r]=e,o=kx(r),{showOnFront:n,currentHomePage:i,isSaving:s}=(0,Rx.useSelect)(g=>{let{getEntityRecord:v,isSavingEntityRecord:b}=g(OL.store),_=v("root","site"),y=v("postType","page",_?.page_on_front);return{showOnFront:_?.show_on_front,currentHomePage:y,isSaving:b("root","site")}}),{saveEntityRecord:l}=(0,Rx.useDispatch)(OL.store),{createSuccessNotice:c,createErrorNotice:u}=(0,Rx.useDispatch)(VAe.store);async function d(g){g.preventDefault();try{await l("root","site",{page_on_front:r.id,show_on_front:"page"}),c((0,gc.__)("Homepage updated."),{type:"snackbar"})}catch(v){let b=v.message&&v.code!=="unknown_error"?v.message:(0,gc.__)("An error occurred while setting the homepage.");u(b,{type:"snackbar"})}finally{t?.()}}let f="";n==="posts"?f=(0,gc.__)("This will replace the current homepage which is set to display latest posts."):i&&(f=(0,gc.sprintf)((0,gc.__)('This will replace the current homepage: "%s"'),kx(i)));let m=(0,gc.sprintf)((0,gc.__)('Set "%1$s" as the site homepage? %2$s'),o,f).trim(),h=(0,gc.__)("Set homepage");return(0,$g.jsx)("form",{onSubmit:d,children:(0,$g.jsxs)(nm.__experimentalVStack,{spacing:"5",children:[(0,$g.jsx)(nm.__experimentalText,{children:m}),(0,$g.jsxs)(nm.__experimentalHStack,{justify:"right",children:[(0,$g.jsx)(nm.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:()=>{t?.()},disabled:s,accessibleWhenDisabled:!0,children:(0,gc.__)("Cancel")}),(0,$g.jsx)(nm.Button,{__next40pxDefaultSize:!0,variant:"primary",type:"submit",disabled:s,accessibleWhenDisabled:!0,children:h})]})]})})},BAe=()=>{let{pageOnFront:e,pageForPosts:t}=(0,Rx.useSelect)(r=>{let{getEntityRecord:o,canUser:n}=r(OL.store),i=n("read",{kind:"root",name:"site"})?o("root","site"):void 0;return{pageOnFront:i?.page_on_front,pageForPosts:i?.page_for_posts}});return(0,LAe.useMemo)(()=>({id:"set-as-homepage",label:(0,gc.__)("Set as homepage"),isEligible(r){return!(r.status!=="publish"||r.type!=="page"||e===r.id||t===r.id)},modalFocusOnMount:"firstContentElement",RenderModal:Jct}),[t,e])};var vc=a(j(),1),jAe=a(U(),1),im=a(G(),1),Ax=a(Y(),1),NL=a(ae(),1),zAe=a(It(),1);var ev=a(T(),1),$ct=({items:e,closeModal:t})=>{let[r]=e,o=kx(r),{currentPostsPage:n,isPageForPostsSet:i,isSaving:s}=(0,Ax.useSelect)(g=>{let{getEntityRecord:v,isSavingEntityRecord:b}=g(NL.store),_=v("root","site");return{currentPostsPage:v("postType","page",_?.page_for_posts),isPageForPostsSet:_?.page_for_posts!==0,isSaving:b("root","site")}}),{saveEntityRecord:l}=(0,Ax.useDispatch)(NL.store),{createSuccessNotice:c,createErrorNotice:u}=(0,Ax.useDispatch)(zAe.store);async function d(g){g.preventDefault();try{await l("root","site",{page_for_posts:r.id,show_on_front:"page"}),c((0,vc.__)("Posts page updated."),{type:"snackbar"})}catch(v){let b=v.message&&v.code!=="unknown_error"?v.message:(0,vc.__)("An error occurred while setting the posts page.");u(b,{type:"snackbar"})}finally{t?.()}}let f=i&&n?(0,vc.sprintf)((0,vc.__)('This will replace the current posts page: "%s"'),kx(n)):(0,vc.__)("This page will show the latest posts."),m=(0,vc.sprintf)((0,vc.__)('Set "%1$s" as the posts page? %2$s'),o,f),h=(0,vc.__)("Set posts page");return(0,ev.jsx)("form",{onSubmit:d,children:(0,ev.jsxs)(im.__experimentalVStack,{spacing:"5",children:[(0,ev.jsx)(im.__experimentalText,{children:m}),(0,ev.jsxs)(im.__experimentalHStack,{justify:"right",children:[(0,ev.jsx)(im.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:()=>{t?.()},disabled:s,accessibleWhenDisabled:!0,children:(0,vc.__)("Cancel")}),(0,ev.jsx)(im.Button,{__next40pxDefaultSize:!0,variant:"primary",type:"submit",disabled:s,accessibleWhenDisabled:!0,children:h})]})]})})},HAe=()=>{let{pageOnFront:e,pageForPosts:t}=(0,Ax.useSelect)(r=>{let{getEntityRecord:o,canUser:n}=r(NL.store),i=n("read",{kind:"root",name:"site"})?o("root","site"):void 0;return{pageOnFront:i?.page_on_front,pageForPosts:i?.page_for_posts}});return(0,jAe.useMemo)(()=>({id:"set-as-posts-page",label:(0,vc.__)("Set as posts page"),isEligible(r){return!(r.status!=="publish"||r.type!=="page"||e===r.id||t===r.id)},modalFocusOnMount:"firstContentElement",RenderModal:$ct}),[t,e])};var WAe=a(T(),1);function FL({postType:e,onActionPerformed:t,context:r}){let{defaultActions:o}=(0,ek.useSelect)(c=>{let{getEntityActions:u}=q(c(I));return{defaultActions:u("postType",e)}},[e]),n=(0,ek.useSelect)(c=>{if(e!=="page")return!1;let{getDefaultTemplateId:u,getEntityRecord:d,canUser:f}=c(UAe.store);if(!f("update",{kind:"root",name:"site"}))return!1;let h=u({slug:"front-page"});if(!h)return!0;let g=d("postType","wp_template",h);return g?g.slug!=="front-page":!0},[e]),i=BAe(),s=HAe(),{registerPostTypeSchema:l}=q((0,ek.useDispatch)(I));return(0,ML.useEffect)(()=>{l(e)},[l,e]),(0,ML.useMemo)(()=>{let c=[...o];if(n&&c.push(i,s),c=c.sort((u,d)=>d.id==="move-to-trash"?-1:0),c=c.filter(u=>u.context?u.context===r:!0),t)for(let u=0;u{d(f,{...m,onActionPerformed:h=>{m?.onActionPerformed&&m.onActionPerformed(h),t(c[u].id,h)}})}}}if(c[u].RenderModal){let d=c[u].RenderModal;c[u]={...c[u],RenderModal:f=>(0,WAe.jsx)(d,{...f,onActionPerformed:m=>{f.onActionPerformed&&f.onActionPerformed(m),t(c[u].id,m)}})}}}return c},[r,o,t,i,s,n])}var Ai=a(T(),1),{Menu:Ix,kebabCase:eut}=q(Ox.privateApis);function qAe({postType:e,postId:t,onActionPerformed:r}){let[o,n]=(0,tk.useState)(null),{item:i,permissions:s}=(0,DL.useSelect)(d=>{let{getEditedEntityRecord:f,getEntityRecordPermissions:m}=q(d(YAe.store));return{item:f("postType",e,t),permissions:m("postType",e,t)}},[t,e]),l=(0,tk.useMemo)(()=>({...i,permissions:s}),[i,s]),c=FL({postType:e,onActionPerformed:r}),u=(0,tk.useMemo)(()=>c.filter(d=>!d.isEligible||d.isEligible(l)),[c,l]);return(0,Ai.jsxs)(Ai.Fragment,{children:[(0,Ai.jsxs)(Ix,{placement:"bottom-end",children:[(0,Ai.jsx)(Ix.TriggerButton,{render:(0,Ai.jsx)(Ox.Button,{size:"small",icon:bo,label:(0,GAe.__)("Actions"),disabled:!u.length,accessibleWhenDisabled:!0,className:"editor-all-actions-button"})}),(0,Ai.jsx)(Ix.Popover,{children:(0,Ai.jsx)(out,{actions:u,items:[l],setActiveModalAction:n})})]}),!!o&&(0,Ai.jsx)(rut,{action:o,items:[l],closeModal:()=>n(null)})]})}function tut({action:e,onClick:t,items:r}){let o=typeof e.label=="string"?e.label:e.label(r);return(0,Ai.jsx)(Ix.Item,{onClick:t,children:(0,Ai.jsx)(Ix.ItemLabel,{children:o})})}function rut({action:e,items:t,closeModal:r}){let o=typeof e.label=="string"?e.label:e.label(t);return(0,Ai.jsx)(Ox.Modal,{title:e.modalHeader||o,__experimentalHideHeader:!!e.hideModalHeader,onRequestClose:r??(()=>{}),focusOnMount:"firstContentElement",size:"medium",overlayClassName:`editor-action-modal editor-action-modal__${eut(e.id)}`,children:(0,Ai.jsx)(e.RenderModal,{items:t,closeModal:r})})}function out({actions:e,items:t,setActiveModalAction:r}){let o=(0,DL.useRegistry)();return(0,Ai.jsx)(Ix.Group,{children:e.map(n=>(0,Ai.jsx)(tut,{action:n,onClick:()=>{if("RenderModal"in n){r(n);return}n.callback(t,{registry:o})},items:t},n.id))})}var Pu=a(T(),1),{Badge:nut}=q(El.privateApis);function rv({postType:e,postId:t,hideActions:r=!1,onActionPerformed:o,onClose:n}){let i=(0,XAe.useMemo)(()=>Array.isArray(t)?t:[t],[t]),{postTitle:s,icon:l,labels:c}=(0,ZAe.useSelect)(f=>{let{getEditedEntityRecord:m,getCurrentTheme:h,getPostType:g}=f(KAe.store),{getPostIcon:v,getCurrentPostType:b,isRevisionsMode:_,getCurrentRevision:y}=q(f(I)),w="";if(_()){let x=b(),C=y();return w=C?.title?.rendered||C?.title?.raw||"",{postTitle:w,icon:v(x,{area:C?.area}),labels:g(x)?.labels}}let S=m("postType",e,i[0]);if(i.length===1){let{default_template_types:x=[]}=h()??{};w=([Cr,Mi].includes(e)?Il({template:S,templateTypes:x}):{})?.title||S?.title}return{postTitle:w,icon:v(e,{area:S?.area}),labels:g(e)?.labels}},[i,e]),u=A3(t),d=(0,tv.__)("No title");return c?.name&&i.length>1?d=(0,tv.sprintf)((0,tv.__)("%1$d %2$s"),i.length,c?.name):s&&(d=(0,QAe.__unstableStripHTML)(s)),(0,Pu.jsxs)(El.__experimentalVStack,{spacing:1,className:"editor-post-card-panel",children:[(0,Pu.jsxs)(El.__experimentalHStack,{spacing:2,className:"editor-post-card-panel__header",alignment:"flex-start",children:[(0,Pu.jsx)(El.Icon,{className:"editor-post-card-panel__icon",icon:l}),(0,Pu.jsxs)(El.__experimentalText,{numberOfLines:2,truncate:!0,className:"editor-post-card-panel__title",as:"h2",children:[(0,Pu.jsx)("span",{className:"editor-post-card-panel__title-name",children:d}),u&&i.length===1&&(0,Pu.jsx)(nut,{children:u})]}),!r&&i.length===1&&(0,Pu.jsx)(qAe,{postType:e,postId:i[0],onActionPerformed:o}),n&&(0,Pu.jsx)(El.Button,{size:"small",icon:i1,label:(0,tv.__)("Close"),onClick:n})]}),i.length>1&&(0,Pu.jsx)(El.__experimentalText,{className:"editor-post-card-panel__description",children:(0,tv.sprintf)((0,tv.__)("Changes will be applied to all selected %s."),c?.name?.toLowerCase())})]})}var JAe=a(G(),1),$Ae=a(Y(),1),bc=a(j(),1),eIe=a(_w(),1),tIe=a(U(),1),PK=a(ae(),1);var LL=a(T(),1),iut=189;function rIe(){let e=(0,$Ae.useSelect)(t=>{let{getEditedPostAttribute:r,getCurrentPostType:o,getCurrentPostId:n}=t(I),{canUser:i}=t(PK.store),{getEntityRecord:s}=t(PK.store),l=i("read",{kind:"root",name:"site"})?s("root","site"):void 0,c=o();return!(+n()===l?.page_for_posts)&&![Cr,Mi].includes(c)&&r("content")},[]);return(0,LL.jsx)(kK,{postContent:e})}function kK({postContent:e}){let t=(0,bc._x)("words","Word count type. Do not translate!"),r=(0,tIe.useMemo)(()=>e?(0,eIe.count)(e,t):0,[e,t]);if(!r)return null;let o=Math.round(r/iut),n=(0,bc.sprintf)((0,bc._n)("%s word","%s words",r),r.toLocaleString()),i=o<=1?(0,bc.__)("1 minute"):(0,bc.sprintf)((0,bc._n)("%s minute","%s minutes",o),o.toLocaleString());return(0,LL.jsx)("div",{className:"editor-post-content-information",children:(0,LL.jsx)(JAe.__experimentalText,{children:(0,bc.sprintf)((0,bc.__)("%1$s, %2$s read time."),n,i)})})}var VL=a(G(),1),Nx=a(j(),1),oIe=a(Y(),1),BL=a(U(),1),nIe=a(be(),1);var sm=a(T(),1);function sut(){let{postFormat:e}=(0,oIe.useSelect)(i=>{let{getEditedPostAttribute:s}=i(I);return{postFormat:s("format")??"standard"}},[]),t=fP.find(i=>i.id===e),[r,o]=(0,BL.useState)(null),n=(0,BL.useMemo)(()=>({anchor:r,placement:"left-start",offset:36,shift:!0}),[r]);return(0,sm.jsx)(MS,{children:(0,sm.jsx)(fr,{label:(0,Nx.__)("Format"),ref:o,children:(0,sm.jsx)(VL.Dropdown,{popoverProps:n,contentClassName:"editor-post-format__dialog",focusOnMount:!0,renderToggle:({isOpen:i,onToggle:s})=>(0,sm.jsx)(VL.Button,{size:"compact",variant:"tertiary","aria-expanded":i,"aria-label":(0,Nx.sprintf)((0,Nx.__)("Change format: %s"),t?.caption),onClick:s,children:t?.caption}),renderContent:({onClose:i})=>(0,sm.jsxs)("div",{className:"editor-post-format__dialog-content",children:[(0,sm.jsx)(nIe.__experimentalInspectorPopoverHeader,{title:(0,Nx.__)("Format"),onClose:i}),(0,sm.jsx)(pP,{})]})})})})}var iIe=sut;var sIe=a(G(),1),aIe=a(Y(),1),jL=a(j(),1),lIe=a(cn(),1);var RK=a(T(),1);function cIe(){let e=(0,aIe.useSelect)(t=>t(I).getEditedPostAttribute("modified"),[]);return e?(0,RK.jsx)("div",{className:"editor-post-last-edited-panel",children:(0,RK.jsx)(sIe.__experimentalText,{children:(0,jL.sprintf)((0,jL.__)("Last edited %s."),(0,lIe.humanTimeDiff)(e))})}):null}var uIe=a(G(),1),dIe=a(T(),1);function aut({className:e,children:t}){return(0,dIe.jsx)(uIe.__experimentalVStack,{className:J("editor-post-panel__section",e),children:t})}var Mx=aut;var am=a(j(),1),fIe=a(Ce(),1),zL=a(Y(),1),AK=a(ae(),1),pIe=a(Nt(),1),Fx=a(G(),1),HL=a(U(),1),mIe=a(be(),1);var sf=a(T(),1),lut={};function hIe(){let{editEntityRecord:e}=(0,zL.useDispatch)(AK.store),{postsPageTitle:t,postsPageId:r,isTemplate:o,postSlug:n}=(0,zL.useSelect)(d=>{let{getEntityRecord:f,getEditedEntityRecord:m,canUser:h}=d(AK.store),g=h("read",{kind:"root",name:"site"})?f("root","site"):void 0,v=g?.page_for_posts?m("postType","page",g?.page_for_posts):lut,{getEditedPostAttribute:b,getCurrentPostType:_}=d(I);return{postsPageId:v?.id,postsPageTitle:v?.title,isTemplate:_()===Cr,postSlug:b("slug")}},[]),[i,s]=(0,HL.useState)(null),l=(0,HL.useMemo)(()=>({anchor:i,placement:"left-start",offset:36,shift:!0}),[i]);if(!o||!["home","index"].includes(n)||!r)return null;let c=d=>{e("postType","page",r,{title:d})},u=(0,pIe.decodeEntities)(t);return(0,sf.jsx)(fr,{label:(0,am.__)("Blog title"),ref:s,children:(0,sf.jsx)(Fx.Dropdown,{popoverProps:l,contentClassName:"editor-blog-title-dropdown__content",focusOnMount:!0,renderToggle:({isOpen:d,onToggle:f})=>(0,sf.jsx)(Fx.Button,{size:"compact",variant:"tertiary","aria-expanded":d,"aria-label":(0,am.sprintf)((0,am.__)("Change blog title: %s"),u),onClick:f,children:u}),renderContent:({onClose:d})=>(0,sf.jsxs)(sf.Fragment,{children:[(0,sf.jsx)(mIe.__experimentalInspectorPopoverHeader,{title:(0,am.__)("Blog title"),onClose:d}),(0,sf.jsx)(Fx.__experimentalInputControl,{placeholder:(0,am.__)("No title"),value:t,onChange:(0,fIe.debounce)(c,300),label:(0,am.__)("Blog title"),help:(0,am.__)("Set the Posts Page title. Appears in search results, and when the page is shared on social media."),hideLabelFromVision:!0})]})})})}var Dx=a(j(),1),UL=a(Y(),1),IK=a(ae(),1),Lx=a(G(),1),WL=a(U(),1),gIe=a(be(),1);var af=a(T(),1);function vIe(){let{editEntityRecord:e}=(0,UL.useDispatch)(IK.store),{postsPerPage:t,isTemplate:r,postSlug:o}=(0,UL.useSelect)(c=>{let{getEditedPostAttribute:u,getCurrentPostType:d}=c(I),{getEditedEntityRecord:f,canUser:m}=c(IK.store),h=m("read",{kind:"root",name:"site"})?f("root","site"):void 0;return{isTemplate:d()===Cr,postSlug:u("slug"),postsPerPage:h?.posts_per_page||1}},[]),[n,i]=(0,WL.useState)(null),s=(0,WL.useMemo)(()=>({anchor:n,placement:"left-start",offset:36,shift:!0}),[n]);if(!r||!["home","index"].includes(o))return null;let l=c=>{e("root","site",void 0,{posts_per_page:c})};return(0,af.jsx)(fr,{label:(0,Dx.__)("Posts per page"),ref:i,children:(0,af.jsx)(Lx.Dropdown,{popoverProps:s,contentClassName:"editor-posts-per-page-dropdown__content",focusOnMount:!0,renderToggle:({isOpen:c,onToggle:u})=>(0,af.jsx)(Lx.Button,{size:"compact",variant:"tertiary","aria-expanded":c,"aria-label":(0,Dx.__)("Change posts per page"),onClick:u,children:t}),renderContent:({onClose:c})=>(0,af.jsxs)(af.Fragment,{children:[(0,af.jsx)(gIe.__experimentalInspectorPopoverHeader,{title:(0,Dx.__)("Posts per page"),onClose:c}),(0,af.jsx)(Lx.__experimentalNumberControl,{placeholder:0,value:t,spinControls:"custom",step:"1",min:"1",onChange:l,label:(0,Dx.__)("Posts per page"),help:(0,Dx.__)("Set the default number of posts to display on blog pages, including categories and tags. Some templates may override this setting."),hideLabelFromVision:!0})]})})})}var Ua=a(j(),1),GL=a(Y(),1),OK=a(ae(),1),lf=a(G(),1),YL=a(U(),1),bIe=a(be(),1);var yc=a(T(),1),cut=[{label:(0,Ua._x)("Open",'Adjective: e.g. "Comments are open"'),value:"open",description:(0,Ua.__)("Visitors can add new comments and replies.")},{label:(0,Ua.__)("Closed"),value:"",description:[(0,Ua.__)("Visitors cannot add new comments or replies."),(0,Ua.__)("Existing comments remain visible.")].join(" ")}];function yIe(){let{editEntityRecord:e}=(0,GL.useDispatch)(OK.store),{allowCommentsOnNewPosts:t,isTemplate:r,postSlug:o}=(0,GL.useSelect)(c=>{let{getEditedPostAttribute:u,getCurrentPostType:d}=c(I),{getEditedEntityRecord:f,canUser:m}=c(OK.store),h=m("read",{kind:"root",name:"site"})?f("root","site"):void 0;return{isTemplate:d()===Cr,postSlug:u("slug"),allowCommentsOnNewPosts:h?.default_comment_status||""}},[]),[n,i]=(0,YL.useState)(null),s=(0,YL.useMemo)(()=>({anchor:n,placement:"left-start",offset:36,shift:!0}),[n]);if(!r||!["home","index"].includes(o))return null;let l=c=>{e("root","site",void 0,{default_comment_status:c?"open":null})};return(0,yc.jsx)(fr,{label:(0,Ua.__)("Discussion"),ref:i,children:(0,yc.jsx)(lf.Dropdown,{popoverProps:s,contentClassName:"editor-site-discussion-dropdown__content",focusOnMount:!0,renderToggle:({isOpen:c,onToggle:u})=>(0,yc.jsx)(lf.Button,{size:"compact",variant:"tertiary","aria-expanded":c,"aria-label":(0,Ua.__)("Change discussion settings"),onClick:u,children:t?(0,Ua.__)("Comments open"):(0,Ua.__)("Comments closed")}),renderContent:({onClose:c})=>(0,yc.jsxs)(yc.Fragment,{children:[(0,yc.jsx)(bIe.__experimentalInspectorPopoverHeader,{title:(0,Ua.__)("Discussion"),onClose:c}),(0,yc.jsxs)(lf.__experimentalVStack,{spacing:3,children:[(0,yc.jsx)(lf.__experimentalText,{children:(0,Ua.__)("Changes will apply to new posts only. Individual posts may override these settings.")}),(0,yc.jsx)(lf.RadioControl,{className:"editor-site-discussion__options",hideLabelFromVision:!0,label:(0,Ua.__)("Comment status"),options:cut,onChange:l,selected:t})]})]})})})}var pr=a(T(),1),uut="post-status";function _Ie({onActionPerformed:e}){let{isRemovedPostStatusPanel:t,postType:r,postId:o}=(0,wIe.useSelect)(n=>{let{isEditorPanelRemoved:i,getCurrentPostType:s,getCurrentPostId:l}=n(I);return{isRemovedPostStatusPanel:i(uut),postType:s(),postId:l()}},[]);return(0,pr.jsx)(Mx,{className:"editor-post-summary",children:(0,pr.jsx)(ES.Slot,{children:n=>(0,pr.jsx)(pr.Fragment,{children:(0,pr.jsxs)(le,{direction:"column",gap:"lg",children:[(0,pr.jsx)(rv,{postType:r,postId:o,onActionPerformed:e}),(0,pr.jsx)(rF,{withPanelBody:!1}),(0,pr.jsx)(FCe,{}),(0,pr.jsxs)(le,{direction:"column",gap:"xs",children:[(0,pr.jsx)(rIe,{}),(0,pr.jsx)(cIe,{})]}),!t&&(0,pr.jsxs)(le,{direction:"column",gap:"lg",children:[(0,pr.jsxs)(le,{direction:"column",gap:"xs",children:[(0,pr.jsx)(_q,{}),(0,pr.jsx)(GF,{}),(0,pr.jsx)(wD,{}),(0,pr.jsx)(D6,{}),(0,pr.jsx)(R6,{}),(0,pr.jsx)(Y6,{}),(0,pr.jsx)(JCe,{}),(0,pr.jsx)(m6,{}),(0,pr.jsx)(KF,{}),(0,pr.jsx)(hIe,{}),(0,pr.jsx)(vIe,{}),(0,pr.jsx)(yIe,{}),(0,pr.jsx)(iIe,{}),n]}),(0,pr.jsx)(ox,{onActionPerformed:e})]})]})})})})}var MIe=a(j(),1),lm=a(Y(),1),Vx=a(ae(),1);var rk=a(U(),1);var SIe=a(U(),1),xIe=a(Y(),1),mut=a(Lt(),1);var hut=a(Y(),1),gut=a(Lt(),1);var TIe=a(Y(),1),PIe=a(ae(),1);var CIe=a(xf(),1),{lock:u1r,unlock:EIe}=(0,CIe.__dangerousOptInToUnstableAPIsOnlyForCoreModules)("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/views");function NK({kind:e,name:t,fields:r}){let o=Array.isArray(r)?r:r?.split(","),n=o?[...o].sort().join(","):void 0;return(0,TIe.useSelect)(i=>EIe(i(PIe.store)).getViewConfig(e,t,n?{fields:n}:void 0),[e,t,n])}var OIe=a(j(),1);var kIe=a(G(),1),qL=a(Y(),1),KL=a(j(),1),RIe=a(vo(),1);var AIe=a(T(),1);function IIe(){let{lastRevisionId:e,revisionsCount:t,disableVisualRevisions:r}=(0,qL.useSelect)(i=>{let{getCurrentPostLastRevisionId:s,getCurrentPostRevisionsCount:l,getEditorSettings:c}=i(I);return{lastRevisionId:s(),revisionsCount:l(),disableVisualRevisions:!!c().disableVisualRevisions}},[]),{setCurrentRevisionId:o}=q((0,qL.useDispatch)(I)),n=r?{href:(0,RIe.addQueryArgs)("revision.php",{revision:e})}:{onClick:()=>o(e)};return(0,AIe.jsx)(kIe.Button,{...n,variant:"link",text:String(t),"aria-label":(0,KL.sprintf)((0,KL._n)("Open revisions screen: %d revision","Open revisions screen: %d revisions",t),t)})}var vut={id:"revisions",label:(0,OIe.__)("Revisions"),readOnly:!0,enableSorting:!1,render:IIe,isVisible:e=>{let t=e._links?.["version-history"]?.[0]?.count??0;return!!(e._links?.["predecessor-version"]?.[0]?.id??null)&&t>=2}},NIe=vut;var wc=a(T(),1),but={layout:{type:"panel"},fields:[]},yut=["form"];function wut(e){let{isPostStatusRemoved:t,featuredImageEnabled:r,excerptEnabled:o,discussionEnabled:n,pageAttributesEnabled:i}=(0,lm.useSelect)(l=>{let{isEditorPanelRemoved:c,isEditorPanelEnabled:u}=l(I);return{isPostStatusRemoved:c("post-status"),featuredImageEnabled:u("featured-image"),excerptEnabled:u("post-excerpt"),discussionEnabled:u("discussion-panel"),pageAttributesEnabled:u("page-attributes")}},[]);return(0,rk.useMemo)(()=>{if(!e.fields?.length)return e;let l={featured_media:r,excerpt:o,"post-content-info":!0,discussion:n&&!t,parent:i&&!t},c=d=>d in l?l[d]:!t,u=d=>d.reduce((f,m)=>{let h=typeof m=="string"?m:m.id;if(!c(h))return f;if(typeof m!="string"&&Array.isArray(m.children)){let g=u(m.children);return g.length&&f.push({...m,children:g}),f}return f.push(m),f},[]);return{...e,fields:u(e.fields)}},[e,t,r,o,n,i])}var ZL={wp_template:{root_site:{kind:"root",name:"site",fields:["posts_per_page","default_comment_status"],isVisible:e=>["home","index"].includes(e.slug??"")},posttype_page:{kind:"postType",name:"page",getId:e=>e(Vx.store).getEditedEntityRecord("root","site")?.page_for_posts,fields:["posts_page_title"],isVisible:e=>["home","index"].includes(e.slug??"")}}};function _ut(e,t,r=()=>!0){let o=n=>n?.[t]??{};return{...e,getValue:({item:n})=>e.getValue?e.getValue({item:o(n)}):o(n)[e.id],setValue:({item:n,value:i})=>({[t]:e.setValue({item:o(n),value:i})}),render:e.render?n=>e.render({...n,item:o(n.item)}):void 0,isVisible:n=>r(n)&&!!n[t]}}function FIe({onActionPerformed:e}){let{postType:t,postId:r,isPostStatusRemoved:o,availableTemplates:n}=(0,lm.useSelect)(_=>{let{getCurrentPostType:y,getCurrentPostId:w,isEditorPanelRemoved:S,getEditorSettings:x}=_(I),C=_(Vx.store).getCurrentTheme()?.is_block_theme?null:x().availableTemplates??null;return{postType:y(),postId:w(),isPostStatusRemoved:S("post-status"),availableTemplates:C}},[]),{form:i}=NK({kind:"postType",name:t,fields:yut}),s=wut(i??but),l=(0,lm.useSelect)(_=>!t||!r?null:_(Vx.store).getEditedEntityRecord("postType",t,r),[t,r]),c=SS(),u=(0,lm.useSelect)(_=>{let{getEditedEntityRecord:y,canUser:w}=_(Vx.store),S={};for(let[x,C]of Object.entries(ZL[t]??{})){if(!w("read",{kind:C.kind,name:C.name}))continue;let A=C.getId?C.getId(_):void 0;C.getId&&!A||(S[x]=y(C.kind,C.name,A))}return S},[t]),d=(0,rk.useMemo)(()=>{if(!l)return l;let _={...u};return n&&Object.keys(n).length&&(_.available_templates=n),{...l,..._}},[l,u,n]),{editEntityRecord:f}=(0,lm.useDispatch)(Vx.store),m=(0,lm.useRegistry)(),h=(0,rk.useMemo)(()=>{let _={};for(let[y,w]of Object.entries(ZL[t]??{}))for(let S of w.fields??[])_[S]=y;return _},[t]),g=nS({postType:t}),v=(0,rk.useMemo)(()=>g?.map(_=>{let y=h[_.id];return y?_ut(_,y,ZL[t]?.[y]?.isVisible):_.id==="status"?{..._,elements:_.elements.filter(w=>w.value!=="trash")}:_.id==="template"?c?c==="classic"&&Object.keys(n??{}).length===0?{..._,readOnly:!0,render:()=>(0,MIe.__)("Default template")}:_:null:_}).filter(Boolean).concat(NIe),[g,c,n,h,t]);return(0,wc.jsx)(Mx,{className:"editor-post-summary",children:(0,wc.jsxs)(le,{direction:"column",gap:"lg",children:[(0,wc.jsx)(rv,{postType:t,postId:r,onActionPerformed:e}),(0,wc.jsx)(GE,{data:d,fields:v,form:s,onChange:_=>{let y=ZL[t]??{},w={};for(let[S,x]of Object.entries(_)){let C=y[S];if(C){let A=C.getId?C.getId(m.select):void 0;f(C.kind,C.name,A,x)}else w[S]=x}Object.keys(w).length&&(w.status&&w.status!=="future"&&l?.status==="future"&&new Date(l.date)>new Date&&(w.date=null),w.status&&w.status==="private"&&l?.password&&(w.password=""),f("postType",t,r,w))}}),!o&&(0,wc.jsxs)(wc.Fragment,{children:[(0,wc.jsx)(ES.Slot,{children:_=>_.length>0&&(0,wc.jsx)(le,{direction:"column",gap:"xs",children:_})}),(0,wc.jsx)(ox,{onActionPerformed:e})]})]})})}var ZIe=a(Y(),1),JL=a(G(),1),XIe=a(j(),1),QIe=a(vo(),1);var XL=a(Y(),1),VIe=a(ae(),1);var cm=a(cn(),1),ku=a(U(),1),ov=a(j(),1);var _c=a(T(),1),Sut=10,DIe=[],xut={pickerActivity:!0},Cut={type:"pickerActivity",titleField:"date",descriptionField:"details",fields:["author"],layout:{density:"compact"},page:1,perPage:Sut},Eut=864e5;function LIe(e){let t=(0,cm.getDate)(null).getTime(),r=(0,cm.getDate)(e??null);return t-r.getTime()>Eut?(0,cm.dateI18n)((0,cm.getSettings)().formats.datetimeAbbreviated,r):(0,cm.humanTimeDiff)(r)}function BIe(e){return e.slug?.endsWith("-autosave-v1")??!1}function Tut({item:e}){return BIe(e)?(0,_c.jsx)(xC,{intent:"none",children:(0,ov.__)("Autosave")}):null}function jIe(){let{setCurrentRevisionId:e}=q((0,XL.useDispatch)(I)),[t,r]=(0,ku.useState)(Cut),{revisions:o,revisionKey:n,currentRevisionId:i}=(0,XL.useSelect)(h=>{let{getCurrentPostType:g}=h(I),{getCurrentRevisionId:v,getRevisionPage:b,getPageRevisions:_}=q(h(I)),{getEntityConfig:y}=h(VIe.store),w=g(),x=y("postType",w)?.revisionKey||"id",C=v();return{revisions:_(b()),revisionKey:x,currentRevisionId:C}},[]),s=!o,l=(0,ku.useMemo)(()=>[{id:"date",label:(0,ov.__)("Date"),getValue:({item:h})=>{let g=LIe(h.date);return BIe(h)?(0,ov.sprintf)((0,ov.__)("%1$s, %2$s"),g,(0,ov.__)("Autosave")):g},render:({item:h})=>(0,_c.jsxs)(le,{direction:"row",align:"center",gap:"sm",children:[(0,_c.jsx)(Ss,{variant:"heading-sm",render:(0,_c.jsx)("time",{dateTime:h.date}),children:LIe(h.date)}),(0,_c.jsx)(Tut,{item:h})]}),enableSorting:!1,enableHiding:!1},eE,{id:"details",label:(0,ov.__)("Details"),render:({item:h})=>String(h[n])!==String(i)?null:(0,_c.jsx)(kK,{postContent:h.content?.raw}),enableSorting:!1,enableHiding:!1}],[n,i]),{data:c,paginationInfo:u}=(0,ku.useMemo)(()=>vW(o||DIe,t,l),[o,t,l]);(0,ku.useEffect)(()=>{if(!i||!o)return;let h=o.findIndex(v=>String(v[n])===String(i));if(h<0)return;let g=Math.floor(h/t.perPage)+1;r(v=>v.page===g?v:{...v,page:g})},[i,o,n,t.perPage]);let d=(0,ku.useMemo)(()=>i?[String(i)]:DIe,[i]),f=(0,ku.useCallback)(h=>{if(h.length===0)return;let g=h[h.length-1];e(Number(g))},[e]),m=(0,ku.useCallback)(h=>String(h[n]),[n]);return(0,_c.jsx)("div",{className:"editor-post-revisions-timeline",children:(0,_c.jsxs)(lp,{view:t,onChangeView:r,fields:l,data:c,isLoading:s,paginationInfo:u,defaultLayouts:xut,getItemId:m,selection:d,onChangeSelection:f,children:[(0,_c.jsx)(lp.Layout,{}),(0,_c.jsx)(lp.Footer,{})]})})}var WIe=a(Y(),1),GIe=a(U(),1),YIe=a(j(),1);var zIe=a(G(),1);var nv=a(T(),1);function QL({title:e,entries:t,initialOpen:r,className:o}){if(!t)return null;let n=Object.entries(t).map(([i,s])=>(0,nv.jsx)(fr,{label:i,children:(0,nv.jsx)("span",{className:"editor-revision-fields-diff__value",children:s.map((l,c)=>l.added?(0,nv.jsx)("ins",{className:"editor-revision-fields-diff__added",children:l.value},c):l.removed?(0,nv.jsx)("del",{className:"editor-revision-fields-diff__removed",children:l.value},c):(0,nv.jsx)("span",{children:l.value},c))})},i));return(0,nv.jsx)(zIe.PanelBody,{title:e,initialOpen:r,children:(0,nv.jsx)("div",{className:o,children:n})})}var qIe=a(T(),1);function HIe(e){return e==null?"":typeof e=="object"?JSON.stringify(e,null,2):String(e)}function UIe(e){return!e||e==="[]"||e==="{}"}function KIe(){let{revision:e,previousRevision:t}=(0,WIe.useSelect)(o=>{let{getCurrentRevision:n,getPreviousRevision:i}=q(o(I));return{revision:n(),previousRevision:i()}},[]),r=(0,GIe.useMemo)(()=>{if(!e)return null;let o=e.meta??{},n=t?.meta??{},i=new Set([...Object.keys(o),...Object.keys(n)]),s={};for(let l of i){let c=HIe(o[l]),u=HIe(n[l]);UIe(c)&&UIe(u)||(s[l]=Q_(u,c))}return Object.keys(s).length===0?null:s},[e,t]);return(0,qIe.jsx)(QL,{title:(0,YIe.__)("Meta"),entries:r,initialOpen:!1,className:"editor-revision-meta-diff__content"})}var Ru=a(T(),1);function JIe(){let{revisionId:e,postId:t}=(0,ZIe.useSelect)(r=>{let{getCurrentRevisionId:o,getCurrentPostId:n}=q(r(I));return{revisionId:o(),postId:n()}},[]);return e?(0,Ru.jsxs)(Ru.Fragment,{children:[(0,Ru.jsx)(Mx,{className:"editor-post-summary",children:(0,Ru.jsxs)(JL.__experimentalVStack,{spacing:4,children:[(0,Ru.jsx)(rv,{postId:t,hideActions:!0}),(0,Ru.jsx)(JL.ExternalLink,{href:(0,QIe.addQueryArgs)("revision.php",{revision:e}),children:(0,XIe.__)("Open classic revisions screen")})]})}),(0,Ru.jsx)(KIe,{}),(0,Ru.jsx)(jIe,{})]}):null}var nk=a(Y(),1),FK=a(ae(),1),iOe=a(G(),1),DK=a(j(),1),sOe=a(be(),1),aOe=a(Pt(),1);var $Ie=a(Y(),1),eOe=a(U(),1),MK=a(ae(),1),tOe=a(Pt(),1),rOe=a(Ml(),1);var{EXCLUDED_PATTERN_SOURCES:Put,PATTERN_TYPES:kut}=q(rOe.privateApis);function oOe(e,t){return e.innerBlocks=e.innerBlocks.map(r=>oOe(r,t)),e.name==="core/template-part"&&e.attributes.theme===void 0&&(e.attributes.theme=t),e}function Rut(e,t){let r=(i,s,l)=>s===l.findIndex(c=>i.name===c.name),o=i=>t.area==="navigation-overlay"&&i.blockTypes?.includes("core/template-part/navigation-overlay")?!0:!Put.includes(i.source),n=i=>i.templateTypes?.includes(t.slug)||i.blockTypes?.includes("core/template-part/"+t.area);return e.filter((i,s,l)=>r(i,s,l)&&o(i)&&n(i))}function Aut(e,t){return e.map(r=>({...r,keywords:r.keywords||[],type:kut.theme,blocks:(0,tOe.parse)(r.content,{__unstableSkipMigrationLogs:!0}).map(o=>oOe(o,t))}))}function nOe({area:e,name:t,slug:r}){let{blockPatterns:o,restBlockPatterns:n,currentThemeStylesheet:i}=(0,$Ie.useSelect)(s=>{let{getEditorSettings:l}=s(I),c=l();return{blockPatterns:c.__experimentalAdditionalBlockPatterns??c.__experimentalBlockPatterns,restBlockPatterns:s(MK.store).getBlockPatterns(),currentThemeStylesheet:s(MK.store).getCurrentTheme().stylesheet}},[]);return(0,eOe.useMemo)(()=>{let s=[...o||[],...n||[]],l=Rut(s,{area:e,name:t,slug:r});return Aut(l,i)},[e,t,r,o,n,i])}var ok=a(T(),1);function Iut({availableTemplates:e,onSelect:t}){return!e||e?.length===0?null:(0,ok.jsx)(sOe.__experimentalBlockPatternsList,{label:(0,DK.__)("Templates"),blockPatterns:e,onClickPattern:t,showTitlesAsTooltip:!0})}function Out(){let{area:e,name:t,slug:r,postType:o,postId:n}=(0,nk.useSelect)(c=>{let{getCurrentPostType:u,getCurrentPostId:d}=c(I),{getEditedEntityRecord:f}=c(FK.store),m=u(),h=d(),g=f("postType",m,h);return{area:g?.area,name:g?.name,slug:g?.slug,postType:m,postId:h}},[]),{editEntityRecord:i}=(0,nk.useDispatch)(FK.store),s=nOe({area:e,name:t,slug:r}),l=async c=>{await i("postType",o,n,{blocks:c.blocks,content:(0,aOe.serialize)(c.blocks)})};return s?.length?(0,ok.jsx)(iOe.PanelBody,{title:(0,DK.__)("Design"),initialOpen:o===Mi,children:(0,ok.jsx)(Iut,{availableTemplates:s,onSelect:l})}):null}function lOe(){let{postType:e}=(0,nk.useSelect)(t=>{let{getCurrentPostType:r}=t(I);return{postType:r()}},[]);return[Mi,Cr].includes(e)?(0,ok.jsx)(Out,{}):null}var cOe=a(G(),1),ik=a(j(),1),uOe=a(Y(),1),dOe=a(U(),1),fOe=a(Nt(),1);var sk=a(T(),1),{Tabs:LK}=q(cOe.privateApis),Nut=(e,t)=>{let{postTypeLabel:r,isRevisionsMode:o}=(0,uOe.useSelect)(i=>{let{getPostTypeLabel:s}=i(I),{isRevisionsMode:l}=q(i(I));return{postTypeLabel:s(),isRevisionsMode:l()}},[]),n;return o?n=(0,ik.__)("Revision"):r?n=(0,fOe.decodeEntities)(r):n=(0,ik._x)("Document","noun, panel"),(0,sk.jsxs)(LK.TabList,{ref:t,children:[(0,sk.jsx)(LK.Tab,{tabId:cs.document,"data-tab-id":cs.document,children:n}),(0,sk.jsx)(LK.Tab,{tabId:cs.block,"data-tab-id":cs.block,children:(0,ik.__)("Block")})]})},pOe=(0,dOe.forwardRef)(Nut);var Bx=a(Y(),1),jx=a(ae(),1),VK=a(be(),1),dm=a(G(),1),BK=a(U(),1),um=a(j(),1),mOe=a(Nt(),1),$L=a(Mo(),1),hOe=a(It(),1),gOe=a(Lt(),1);var jn=a(T(),1);function vOe(){let e=(0,Bx.useSelect)(x=>x(I).getCurrentTemplateId(),[]),[t,r]=(0,BK.useState)(!1),[o,n]=(0,BK.useState)(!1),s=!!sP()?.length,{onNavigateToEntityRecord:l,canCreateTemplate:c,hasGoBack:u,getEditorSettings:d}=(0,Bx.useSelect)(x=>{let{getEditorSettings:C}=x(I),A=C();return{onNavigateToEntityRecord:A.onNavigateToEntityRecord,canCreateTemplate:!!x(jx.store).canUser("create",{kind:"postType",name:"wp_template"}),hasGoBack:A.hasOwnProperty("onNavigateToPreviousEntityRecord"),getEditorSettings:C}},[]),{get:f}=(0,Bx.useSelect)(gOe.store),{createSuccessNotice:m}=(0,Bx.useDispatch)(hOe.store),{editedRecord:h,hasResolved:g}=(0,jx.useEntityRecord)("postType","wp_template",e),[v]=(0,jx.useEntityBlockEditor)("postType","wp_template",{id:e});if(!g)return null;let b=u?[{label:(0,um.__)("Go back"),onClick:()=>d().onNavigateToPreviousEntityRecord()}]:void 0,_=()=>{f("core/edit-site","welcomeGuideTemplate")||m((0,um.__)("Editing template. Changes made here affect all posts and pages that use the template."),{type:"snackbar",actions:b})},y=(0,mOe.decodeEntities)(h.title),w=!!v?.length&&(0,jn.jsx)(VK.BlockPreview.Async,{children:(0,jn.jsx)(VK.BlockPreview,{blocks:v})}),S=()=>{if(!w)return null;if(s){let x=(0,um.__)("Change template");return(0,jn.jsxs)(Ze.Root,{children:[(0,jn.jsx)(Ze.Trigger,{render:(0,jn.jsx)("div",{className:"editor-template-actions-panel__preview",role:"button",tabIndex:0,"aria-label":x,onClick:()=>n(!0),onKeyDown:C=>{(C.keyCode===$L.ENTER||C.keyCode===$L.SPACE)&&(C.preventDefault(),n(!0))},children:w})}),(0,jn.jsx)(Ze.Popup,{children:x})]})}return(0,jn.jsx)("div",{className:"editor-template-actions-panel__preview",children:w})};return(0,jn.jsxs)(jn.Fragment,{children:[(0,jn.jsx)(dm.PanelBody,{title:(0,um.sprintf)((0,um.__)("Template: %s"),y),initialOpen:!1,children:(0,jn.jsxs)(dm.__experimentalVStack,{children:[S(),(0,jn.jsxs)(dm.__experimentalHStack,{children:[l&&(0,jn.jsx)(dm.Button,{className:"editor-template-actions-panel__action",__next40pxDefaultSize:!0,variant:"secondary",onClick:()=>{l({postId:h.id,postType:"wp_template"}),_()},children:(0,um.__)("Edit")}),c&&(0,jn.jsx)(dm.Button,{className:"editor-template-actions-panel__action",__next40pxDefaultSize:!0,variant:"secondary",onClick:()=>r(!0),children:(0,um.__)("Create new")})]})]})}),t&&(0,jn.jsx)(Tg,{onClose:()=>r(!1)}),o&&(0,jn.jsx)(HY,{onRequestClose:()=>n(!1)})]})}var zx=a(Y(),1),Hx=a(ae(),1),jK=a(be(),1),Iu=a(G(),1),bOe=a(U(),1),Au=a(j(),1),yOe=a(Nt(),1),wOe=a(It(),1),_Oe=a(Lt(),1);var Js=a(T(),1);function SOe(){let e=(0,zx.useSelect)(v=>v(I).getCurrentTemplateId(),[]),[t,r]=(0,bOe.useState)(!1),{onNavigateToEntityRecord:o,canCreateTemplate:n,hasGoBack:i,getEditorSettings:s}=(0,zx.useSelect)(v=>{let{getEditorSettings:b}=v(I),_=b();return{onNavigateToEntityRecord:_.onNavigateToEntityRecord,canCreateTemplate:!!v(Hx.store).canUser("create",{kind:"postType",name:"wp_template"})&&_.supportsTemplateMode,hasGoBack:_.hasOwnProperty("onNavigateToPreviousEntityRecord"),getEditorSettings:b}},[]),{get:l}=(0,zx.useSelect)(_Oe.store),{createSuccessNotice:c}=(0,zx.useDispatch)(wOe.store),{editedRecord:u}=(0,Hx.useEntityRecord)("postType","wp_template",e),[d]=(0,Hx.useEntityBlockEditor)("postType","wp_template",{id:e});if(!e&&!n)return null;let f=i?[{label:(0,Au.__)("Go back"),onClick:()=>s().onNavigateToPreviousEntityRecord()}]:void 0,m=()=>{l("core/edit-site","welcomeGuideTemplate")||c((0,Au.__)("Editing template. Changes made here affect all posts and pages that use the template."),{type:"snackbar",actions:f})},h=u?(0,yOe.decodeEntities)(u.title):void 0,g=!!d?.length&&(0,Js.jsx)(jK.BlockPreview.Async,{children:(0,Js.jsx)(jK.BlockPreview,{blocks:d})});return(0,Js.jsxs)(Js.Fragment,{children:[(0,Js.jsx)(Iu.PanelBody,{title:u?(0,Au.sprintf)((0,Au.__)("Template: %s"),h):(0,Au.__)("Template"),initialOpen:!1,children:(0,Js.jsxs)(Iu.__experimentalVStack,{children:[!e&&(0,Js.jsx)(Iu.__experimentalText,{children:(0,Au.__)("This page uses a classic template. To edit this template with blocks, create a block template.")}),u&&g&&(0,Js.jsx)("div",{className:"editor-template-actions-panel__preview",children:g}),(0,Js.jsxs)(Iu.__experimentalHStack,{children:[u&&o&&(0,Js.jsx)(Iu.Button,{className:"editor-template-actions-panel__action",__next40pxDefaultSize:!0,variant:"secondary",onClick:()=>{o({postId:u.id,postType:"wp_template"}),m()},children:(0,Au.__)("Edit")}),n&&(0,Js.jsx)(Iu.Button,{className:"editor-template-actions-panel__action",__next40pxDefaultSize:!0,variant:"secondary",onClick:()=>r(!0),children:e?(0,Au.__)("Create new"):(0,Au.__)("Create block template")})]})]})}),t&&(0,Js.jsx)(Tg,{onClose:()=>r(!1)})]})}var zK=a(T(),1);function xOe(){let e=SS();return e==="classic"?(0,zK.jsx)(SOe,{}):e==="block-theme"?(0,zK.jsx)(vOe,{}):null}var ak=a(Y(),1),COe=a(be(),1),EOe=a(G(),1),TOe=a(j(),1);var e4=a(T(),1),{BlockQuickNavigation:Mut}=q(COe.privateApis),Fut="core/template-part";function Dut({postType:e}){let t=JM(),r=(0,ak.useSelect)(n=>{let{getPostBlocksByName:i}=q(n(I));return i(Cr===e?Fut:t)},[e,t]),{enableComplementaryArea:o}=(0,ak.useDispatch)(je);return r.length===0?null:(0,e4.jsx)(EOe.PanelBody,{title:(0,TOe.__)("Content"),children:(0,e4.jsx)(Mut,{clientIds:r,onSelect:()=>{o("core","edit-post/document")}})})}function POe(){let{postType:e,renderingMode:t}=(0,ak.useSelect)(r=>{let{getCurrentPostType:o,getRenderingMode:n}=q(r(I));return{postType:o(),renderingMode:n()}},[]);return t==="post-only"&&e!==Cr?null:(0,e4.jsx)(Dut,{postType:e})}var t4=a(Y(),1),kOe=a(U(),1),ROe=a(Pt(),1),o4=a(be(),1),AOe=a(G(),1),IOe=a(j(),1);var r4=a(T(),1),{BlockQuickNavigation:Lut}=q(o4.privateApis);function Vut(){let e=(0,t4.useSelect)(o=>{let{getBlockTypes:n}=o(ROe.store);return n()},[]),t=(0,kOe.useMemo)(()=>e.filter(o=>o.category==="theme").map(({name:o})=>o),[e]),r=(0,t4.useSelect)(o=>{let{getBlocksByName:n}=o(o4.store);return n(t)},[t]);return r.length===0?null:(0,r4.jsx)(AOe.PanelBody,{title:(0,IOe.__)("Content"),children:(0,r4.jsx)(Lut,{clientIds:r})})}function OOe(){return(0,t4.useSelect)(t=>{let{getCurrentPostType:r}=t(I);return r()},[])!==Mi?null:(0,r4.jsx)(Vut,{})}var NOe=a(be(),1),MOe=a(Y(),1),FOe=a(j(),1);var DOe=a(T(),1);function LOe(){let{block:e}=(0,MOe.useSelect)(r=>{let{getSelectedBlock:o}=r(NOe.store);return{block:o()}},[]);if(!e)return null;let t=e.attributes?.__revisionDiffStatus?.changedAttributes;return(0,DOe.jsx)(QL,{title:(0,FOe.__)("Changed attributes"),entries:t,initialOpen:!0})}var Ux=a(Y(),1),VOe=a(U(),1),BOe=a(be(),1),jOe=a(Lt(),1);function But(){let{hasBlockSelection:e}=(0,Ux.useSelect)(n=>({hasBlockSelection:!!n(BOe.store).getBlockSelectionStart()}),[]),{getActiveComplementaryArea:t}=(0,Ux.useSelect)(je),{enableComplementaryArea:r}=(0,Ux.useDispatch)(je),{get:o}=(0,Ux.useSelect)(jOe.store);(0,VOe.useEffect)(()=>{let n=t("core"),i=["edit-post/document","edit-post/block"].includes(n),s=o("core","distractionFree");!i||s||(e?r("core","edit-post/block"):r("core","edit-post/document"))},[e,t,r,o])}var zOe=But;var eo=a(T(),1),{Tabs:Wx}=q(UOe.privateApis),jut=!0,zut=({tabName:e,keyboardShortcut:t,onActionPerformed:r,extraPanels:o})=>{let n=(0,iv.useRef)(null),i=(0,iv.useContext)(Wx.Context),s=(0,lk.useSelect)(c=>q(c(I)).isRevisionsMode());(0,iv.useEffect)(()=>{let c=Array.from(n.current?.querySelectorAll('[role="tab"]')||[]),u=c.find(m=>m.getAttribute("data-tab-id")===e),d=u?.ownerDocument.activeElement;c.some(m=>d&&d.id===m.id)&&u&&u.id!==d?.id&&u?.focus()},[e]);let l;if(s)l=(0,eo.jsx)(JIe,{});else{let c=window?.__experimentalDataFormInspector;l=(0,eo.jsxs)(eo.Fragment,{children:[c?(0,eo.jsx)(FIe,{onActionPerformed:r}):(0,eo.jsx)(_Ie,{onActionPerformed:r}),(0,eo.jsx)(S6.Slot,{}),(0,eo.jsx)(POe,{}),c&&(0,eo.jsx)(xOe,{}),(0,eo.jsx)(OOe,{}),(0,eo.jsx)(lOe,{}),(0,eo.jsx)(QF,{}),(0,eo.jsx)(DAe,{}),o]})}return(0,eo.jsx)(Oy,{identifier:e,header:(0,eo.jsx)(Wx.Context.Provider,{value:i,children:(0,eo.jsx)(pOe,{ref:n})}),closeLabel:(0,Gx.__)("Close Settings"),className:"editor-sidebar__panel",headerClassName:"editor-sidebar__panel-tabs",title:(0,Gx._x)("Settings","panel button label"),toggleShortcut:t,icon:(0,Gx.isRTL)()?dv:wf,isActiveByDefault:jut,children:(0,eo.jsxs)(Wx.Context.Provider,{value:i,children:[(0,eo.jsx)(Wx.TabPanel,{tabId:cs.document,focusable:!1,children:l}),(0,eo.jsxs)(Wx.TabPanel,{tabId:cs.block,focusable:!1,children:[(0,eo.jsx)(n4.BlockInspector,{}),s&&(0,eo.jsx)(LOe,{})]})]})})},Hut=({extraPanels:e,onActionPerformed:t})=>{zOe();let{tabName:r,keyboardShortcut:o}=(0,lk.useSelect)(s=>{let l=s(HOe.store).getShortcutRepresentation("core/editor/toggle-sidebar"),c=s(je).getActiveComplementaryArea("core"),u=[cs.block,cs.document].includes(c),d=c;return u||(d=s(n4.store).getBlockSelectionStart()?cs.block:cs.document),{tabName:d,keyboardShortcut:l}},[]),{enableComplementaryArea:n}=(0,lk.useDispatch)(je),i=(0,iv.useCallback)(s=>{s&&n("core",s)},[n]);return(0,eo.jsx)(Wx,{selectedTabId:r,onSelect:i,selectOnMove:!1,children:(0,eo.jsx)(zut,{tabName:r,keyboardShortcut:o,onActionPerformed:t,extraPanels:e})})},WOe=Hut;var w4=a(j(),1),mf=a(Y(),1),A5e=a(U(),1),I5e=a(Ce(),1),O5e=a(xa(),1);var YK=a(be(),1);var N5e=a(Lt(),1);var pf=a(U(),1),h4=a(j(),1),Xx=a(Y(),1);var pk=a(be(),1);var Kx=a(U(),1),d4=a(G(),1);var f4=a(Ce(),1),Ii=a(j(),1),fk=a(Y(),1),a5e=a(Mp(),1),p4=a(be(),1);var l4=a(j(),1),i5e=a(U(),1),s5e=a(Ce(),1),i0=a(Y(),1),ck=a(be(),1);var ZOe=a(G(),1);var i4=a(j(),1),cf=a(cn(),1),GOe=a(ae(),1),YOe=a(Y(),1),qOe=a(be(),1);var Sc=a(T(),1);function KOe({avatar:e,name:t,date:r,userId:o}){let n=!!e,i=(0,cf.getSettings)(),{currentUserAvatar:s,currentUserName:l,currentUserId:c,dateFormat:u=i.formats.date}=(0,YOe.useSelect)(v=>{let{canUser:b,getCurrentUser:_,getEntityRecord:y}=v(GOe.store),w=b("read",{kind:"root",name:"site"})?y("root","site"):void 0;if(n)return{dateFormat:w?.date_format};let{getSettings:S}=v(qOe.store),{__experimentalDiscussionSettings:x}=S(),C=x?.avatarURL,A=_();return{currentUserAvatar:A?.avatar_urls?.[48]??C,currentUserName:A?.name,currentUserId:A?.id,dateFormat:w?.date_format}},[n]),d=(0,cf.getDate)(r),f=(0,cf.dateI18n)("c",d),h=Math.floor((new Date-d)/(1e3*60*60*24))<30?(0,cf.humanTimeDiff)(d):(0,cf.dateI18n)(u,d),g=(0,cf.dateI18n)((0,i4._x)("F j, Y g:i\xA0a","Note date full date format"),r);return(0,Sc.jsxs)(Sc.Fragment,{children:[(0,Sc.jsx)("img",{src:e||s,className:"editor-collab-sidebar-panel__user-avatar",alt:(0,i4.__)("User avatar"),width:32,height:32,style:{borderColor:za(o??c)}}),(0,Sc.jsxs)(le,{direction:"column",children:[(0,Sc.jsx)("span",{className:"editor-collab-sidebar-panel__user-name",children:t??l}),r&&(0,Sc.jsxs)(Ze.Root,{children:[(0,Sc.jsx)(Ze.Trigger,{render:(0,Sc.jsx)("time",{dateTime:f,className:"editor-collab-sidebar-panel__user-time",children:h})}),(0,Sc.jsx)(Ze.Popup,{children:g})]})]})]})}var o0=a(T(),1);function Yx({note:e,actions:t,className:r,children:o,...n}){return(0,o0.jsxs)(le,{direction:"column",gap:"sm",className:r,...n,children:[(0,o0.jsxs)(le,{direction:"row",align:"center",justify:"flex-start",gap:"md",children:[(0,o0.jsx)(KOe,{avatar:e?.author_avatar_urls?.[48],name:e?.author_name,date:e?.date,userId:e?.author}),t&&(0,o0.jsx)(ZOe.FlexItem,{className:"editor-collab-sidebar-panel__note-actions",onClick:i=>i.stopPropagation(),children:(0,o0.jsx)(le,{direction:"row",align:"center",children:t})})]}),o]})}var HK=a(U(),1),qx=a(G(),1);var s4=a(j(),1),t5e=a(Ce(),1),r5e=a(Mo(),1);var o5e=a(Mp(),1);var XOe=a(U(),1),QOe=a(Y(),1),JOe=a(ae(),1);var $Oe=a(T(),1),Uut={name:"note-mentions",className:"editor-autocompleters__user editor-collab-sidebar-panel__mention-suggestion",triggerPrefix:"@",useItems(e){let t=(0,QOe.useSelect)(o=>{let{getUsers:n}=o(JOe.store);return n({context:"view",search:e})},[e]);return[(0,XOe.useMemo)(()=>t?t.map(o=>({key:`note-mention-${o.slug}`,value:o,label:sY(o)})):[],[t])]},getOptionCompletion(e){return{action:"insert-at-caret",value:(0,$Oe.jsx)("span",{className:`wp-note-mention user-${e.id}`,children:"@"+e.name})}}},e5e=Uut;var uf=a(T(),1),{RichTextControl:Wut}=q(gN),Gut=["core/bold","core/italic","core/link","core/code"],Yut=[e5e];function n0({onSubmit:e,onCancel:t,note:r,labels:o}){let[n,i]=(0,HK.useState)(r?.content?.raw??""),[s,l]=(0,HK.useState)(!1),c=(0,t5e.useInstanceId)(n0,"comment-input"),u=jRe((0,o5e.__unstableStripHTML)(n)),d=s||n===r?.content?.raw||!u.length;async function f(){if(d)return;l(!0);let m=n;await e(m)&&i(g=>g===m?"":g),l(!1)}return(0,uf.jsxs)(le,{className:"editor-collab-sidebar-panel__note-form",direction:"column",gap:"lg",render:(0,uf.jsx)("form",{}),onSubmit:m=>{m.preventDefault(),f()},onKeyDown:m=>{if(r5e.isKeyboardEvent.primary(m,"Enter")){m.preventDefault(),f();return}m.key==="Escape"&&!m.defaultPrevented&&(m.preventDefault(),t(m))},children:[(0,uf.jsx)(Wut,{id:c,label:o?.input??(0,s4.__)("Note"),hideLabelFromVision:!0,value:n,onChange:i,placeholder:o?.placeholder,allowedFormats:Gut,completers:Yut}),(0,uf.jsxs)(le,{direction:"row",align:"center",justify:"flex-end",gap:"sm",wrap:"wrap",children:[(0,uf.jsx)(qx.Button,{size:"compact",variant:"tertiary",onClick:t,children:(0,uf.jsx)(qx.__experimentalTruncate,{children:(0,s4.__)("Cancel")})}),(0,uf.jsx)(qx.Button,{size:"compact",accessibleWhenDisabled:!0,variant:"primary",type:"submit",disabled:d,children:(0,uf.jsx)(qx.__experimentalTruncate,{children:o?.submit??(0,s4.__)("Add note")})})]})]})}var n5e=a(T(),1);function a4({floating:e,className:t,style:r,children:o,...n}){let i=!!e;return(0,n5e.jsx)(le,{direction:"column",className:J(t,{"is-floating":i}),ref:i?e.ref:void 0,style:i?{top:e.y,...r}:r,...n,children:o})}var c4=a(T(),1),{useBlockElement:qut}=q(ck.privateApis);function uk({onSubmit:e,sidebarRef:t,floating:r}){let{clientId:o}=(0,i0.useSelect)(m=>{let{getSelectedBlockClientId:h}=m(ck.store);return{clientId:h()}},[]),n=(0,i0.useSelect)(m=>q(m(I)).getSelectedNote(),[]),i=qut(o),{toggleBlockSpotlight:s}=q((0,i0.useDispatch)(ck.store)),{selectNote:l}=q((0,i0.useDispatch)(I)),{getSelectedNote:c}=q((0,i0.useSelect)(I)),u=(0,i5e.useRef)(!1),d=(0,s5e.__experimentalUseFocusOutside)(m=>{m.relatedTarget?.closest(".editor-collab-sidebar-panel__add-note")||u.current||c()==="new"&&(s(o,!1),l(void 0))}),f=()=>{l(void 0),i?.focus(),s(o,!1)};return n!=="new"||!o?null:(0,c4.jsx)(a4,{floating:r,className:"editor-collab-sidebar-panel__add-note is-selected",gap:"md",tabIndex:0,"aria-label":(0,l4.__)("New note"),role:"treeitem",style:r?{opacity:r.y?void 0:0}:void 0,...d,children:(0,c4.jsx)(Yx,{children:(0,c4.jsx)(n0,{onSubmit:async m=>{u.current=!0;try{let h=await e({content:m});return h&&(l(h.id),us(h.id,t.current)),h}finally{u.current=!1}},onCancel:f,labels:{input:(0,l4.__)("New note"),placeholder:(0,l4.__)("Add a note or @ mention")}})})})}var df=a(U(),1),s0=a(G(),1);var Cn=a(j(),1);var fi=a(T(),1),{Menu:dk}=q(s0.privateApis);function Kut({items:e,buttonRef:t}){return(0,fi.jsxs)(dk,{placement:"bottom-end",children:[(0,fi.jsx)(dk.TriggerButton,{render:(0,fi.jsx)(s0.Button,{ref:t,size:"small",icon:bo,label:(0,Cn.__)("Actions"),disabled:!e.length,accessibleWhenDisabled:!0})}),(0,fi.jsx)(dk.Popover,{modal:!1,children:e.map(r=>(0,fi.jsx)(dk.Item,{onClick:r.onClick,children:(0,fi.jsx)(dk.ItemLabel,{children:r.title})},r.id))})]})}function u4({note:e,parentNote:t,isSelected:r,onEditNote:o,onDeleteNote:n,onResolve:i}){let[s,l]=(0,df.useState)(null),c=(0,df.useRef)(null),u=(0,df.useRef)(null),d=e?.content?.raw,[f,m]=(0,df.useState)(d),[h,g]=(0,df.useState)(!1),[v,b]=(0,df.useState)(!1);f!==d&&(m(d),g(!1)),(0,df.useLayoutEffect)(()=>{let R=u.current;R&&b(R.scrollHeight>R.clientHeight)},[d]);let _=e.parent===0,y=e.type==="note"&&e.meta&&(e.meta._wp_note_status==="resolved"||e.meta._wp_note_status==="reopen"),w=[{id:"edit",title:(0,Cn.__)("Edit"),isEligible:({status:R})=>R!=="approved",onClick:()=>l("edit")},{id:"reopen",title:(0,Cn._x)("Reopen","Reopen note"),isEligible:({status:R})=>R==="approved",onClick:()=>o({id:e.id,status:"hold"})},{id:"delete",title:(0,Cn.__)("Delete"),isEligible:()=>!0,onClick:()=>l("delete")}],S=t?.status!=="approved"?w.filter(R=>R.isEligible(e)):[],x=e.parent===0?(0,Cn.__)("Are you sure you want to delete this note? This will also delete all of this note's replies."):(0,Cn.__)("Are you sure you want to delete this reply?"),C=()=>{l(null),c.current?.focus()},A;if(s==="edit")A=(0,fi.jsx)(n0,{onSubmit:async R=>{let N=await o({id:e.id,content:R});return N&&C(),N},onCancel:C,note:e,labels:{submit:(0,Cn._x)("Update","verb"),input:(0,Cn.sprintf)((0,Cn.__)("Edit note %1$s by %2$s"),e.id,e.author_name)}});else{let R;if(y){let N=e.meta._wp_note_status==="resolved"?(0,Cn.__)("Marked as resolved"):(0,Cn.__)("Reopened"),k=e?.content?.raw;R=k&&typeof k=="string"&&k.trim()!==""?(0,Cn.sprintf)((0,Cn.__)("%1$s: %2$s"),N,k):N}else R=e?.content?.rendered;A=(0,fi.jsx)("div",{ref:u,className:J("editor-collab-sidebar-panel__note-content",{"editor-collab-sidebar-panel__resolution-text":y,"is-collapsed":!h}),dangerouslySetInnerHTML:{__html:R??""}})}let P=r?(0,fi.jsxs)(fi.Fragment,{children:[_&&i&&(0,fi.jsx)(s0.Button,{label:(0,Cn._x)("Resolve","Mark note as resolved"),size:"small",icon:fv,disabled:e.status==="approved",accessibleWhenDisabled:e.status==="approved",onClick:i}),(0,fi.jsx)(Kut,{items:S,buttonRef:c})]}):null;return(0,fi.jsxs)(Yx,{note:e,actions:P,role:e.parent!==0?"treeitem":void 0,children:[A,s==="delete"&&(0,fi.jsx)(s0.__experimentalConfirmDialog,{isOpen:!0,onConfirm:()=>{n(e),l(null)},onCancel:C,confirmButtonText:(0,Cn.__)("Delete"),children:x}),v&&s!=="edit"&&(0,fi.jsx)(Gte,{className:"editor-collab-sidebar-panel__show-more-button",variant:"unstyled",size:"small",onClick:()=>g(!h),children:h?(0,Cn.__)("Show less"):(0,Cn.__)("Show more")})]})}var Wa=a(T(),1),{useBlockElement:Zut}=q(p4.privateApis);function l5e({note:e,onEditNote:t,onAddReply:r,onDeleteNote:o,isSelected:n,sidebarRef:i,floating:s,onKeyDown:l}){let c=!!s,{toggleBlockHighlight:u,selectBlock:d,toggleBlockSpotlight:f}=q((0,fk.useDispatch)(p4.store)),{selectNote:m}=q((0,fk.useDispatch)(I)),{getSelectedNote:h}=q((0,fk.useSelect)(I)),g=Zut(e.blockClientId),v=(0,f4.useDebounce)(u,50),b=(0,Kx.useRef)(null),_=(0,Kx.useRef)(!1),y=s?.registerThread,w=s?.unregisterThread;(0,Kx.useEffect)(()=>{let D=b.current;return D&&y&&y(e.id,g,D),()=>w?.(e.id)},[g,e.id,y,w]),(0,Kx.useEffect)(()=>{!n||e.id==="new"||ZRe(e.id,i.current)},[n,s?.y,e.id,i]);let S=(0,f4.__experimentalUseFocusOutside)(D=>{let z=D.relatedTarget?.closest(".editor-collab-sidebar-panel__thread");z&&!_.current||(z||(v.cancel(),u(e.blockClientId,!1)),h()===e.id&&R())});function x(){v(e.blockClientId,!0)}function C(){v(e.blockClientId,!1)}function A(D){S.onFocus(D),v.cancel(),u(e.blockClientId,!0)}function P(){n||(m(e.id),us(e.id,i.current),f(e.blockClientId,!0),e.blockClientId&&d(e.blockClientId,null))}function R(){m(void 0),f(e.blockClientId,!1)}function N(){t({id:e.id,status:"approved"}),R(),c?g?.focus():us(e.id,i.current)}let k=e?.reply||[],E=k.length>0?k[k.length-1]:void 0,M=k.length>0?k.slice(0,-1):[],V=zRe((0,a5e.__unstableStripHTML)(e.content?.rendered),10),F=e.blockClientId?(0,Ii.sprintf)((0,Ii.__)("Note: %s"),V):(0,Ii.sprintf)((0,Ii.__)("Original block deleted. Note: %s"),V);return c&&e.id==="new"?(0,Wa.jsx)(uk,{onSubmit:r,sidebarRef:i,floating:{y:s.y,ref:b}}):(0,Wa.jsxs)(a4,{floating:c?{y:s.y,ref:b}:void 0,className:J("editor-collab-sidebar-panel__thread",{"is-selected":n}),id:`note-thread-${e.id}`,gap:"md",onClick:P,onMouseEnter:x,onMouseLeave:C,...S,onFocus:A,onKeyUp:D=>{D.key==="Tab"&&(_.current=!1)},onKeyDown:D=>{D.key==="Tab"?_.current=!0:l(D)},tabIndex:0,role:"treeitem","aria-label":F,"aria-expanded":n,children:[(0,Wa.jsx)(d4.Button,{className:"editor-collab-sidebar-panel__skip-to-note",variant:"secondary",size:"compact",onClick:()=>{us(e.id,i.current,'[role="textbox"]')},children:(0,Ii.__)("Add new reply")}),!e.blockClientId&&(0,Wa.jsx)("p",{className:"editor-collab-sidebar-panel__deleted-block-notice",children:(0,Ii.__)("Original block deleted.")}),(0,Wa.jsx)(u4,{note:e,isSelected:n,onEditNote:t,onDeleteNote:o,onResolve:N}),n&&k.map(D=>(0,Wa.jsx)(u4,{note:D,parentNote:e,isSelected:n,onEditNote:t,onDeleteNote:o},D.id)),!n&&M.length>0&&(0,Wa.jsx)(le,{direction:"row",align:"center",justify:"space-between",className:"editor-collab-sidebar-panel__more-reply-separator",children:(0,Wa.jsx)(d4.Button,{size:"compact",variant:"tertiary",className:"editor-collab-sidebar-panel__more-reply-button",onClick:D=>{D.stopPropagation(),P()},children:(0,Ii.sprintf)((0,Ii._n)("%s more reply","%s more replies",M.length),M.length)})}),!n&&E&&(0,Wa.jsx)(u4,{note:E,parentNote:e,isSelected:!1,onEditNote:t,onDeleteNote:o}),n&&(0,Wa.jsx)(Yx,{role:"treeitem",children:(0,Wa.jsx)(n0,{onSubmit:D=>e.status==="approved"?t({id:e.id,status:"hold",content:D}):r({content:D,parent:e.id}),onCancel:D=>{D.stopPropagation(),R(),us(e.id,i.current)},labels:{submit:e.status==="approved"?(0,Ii.__)("Reopen & Reply"):(0,Ii.__)("Reply"),input:(0,Ii.sprintf)((0,Ii.__)("Reply to note %1$s by %2$s"),e.id,e.author_name),placeholder:(0,Ii.__)("Reply or @ mention")}})}),!!e.blockClientId&&(0,Wa.jsx)(d4.Button,{className:"editor-collab-sidebar-panel__skip-to-block",variant:"secondary",size:"compact",onClick:D=>{D.stopPropagation(),g?.focus()},children:(0,Ii.__)("Back to block")})]})}var d5e=a(Nl(),1),sv=a(j(),1),ff=a(U(),1),m4=a(ae(),1),Ou=a(Y(),1),a0=a(be(),1),f5e=a(It(),1),p5e=a(Mp(),1),m5e=a(Nt(),1);var Zx=a(vd(),1);function c5e(){let e=new Set,t=new Map,r=new Map,o=new WeakMap,n={},i={};function s(){i={...n};for(let c of e)c()}let l=new window.ResizeObserver(c=>{let u=!1;for(let d of c){let f=o.get(d.target),m=d.borderBoxSize[0].blockSize;n[f]!==m&&(n[f]=m,u=!0)}u&&s()});return{subscribe(c){return e.add(c),()=>{e.delete(c),e.size===0&&l.disconnect()}},getSnapshot(){return i},registerThread(c,u,d){t.set(c,u);let f=r.get(c);f&&f!==d&&(l.unobserve(f),o.delete(f)),d&&(r.set(c,d),o.set(d,c),l.observe(d)),s()},unregisterThread(c){t.delete(c);let u=r.get(c);u&&(l.unobserve(u),o.delete(u),r.delete(c)),delete n[c]},getAnchorRects(){return Object.fromEntries(Array.from(t).flatMap(([c,u])=>{if(!u)return[];if(c==="new"){let f=URe(u)??u.getBoundingClientRect();return[[c,f]]}let d=u.querySelector(WD(c))??u;return[[c,d.getBoundingClientRect()]]}))},getFirstBlockElement(){return t.values().next().value??null}}}var{cleanEmptyObject:u5e}=q(a0.privateApis);function h5e(e){let t={post:e,type:"note",status:"all",per_page:-1},{records:r}=(0,m4.useEntityRecords)("root","comment",t,{enabled:!!e&&typeof e=="number"}),{getBlockAttributes:o}=(0,Ou.useSelect)(a0.store),{clientIds:n}=(0,Ou.useSelect)(l=>{let{getClientIdsWithDescendants:c}=l(a0.store);return{clientIds:c()}},[]),{notes:i,unresolvedNotes:s}=(0,ff.useMemo)(()=>{if(!r||r.length===0)return{notes:[],unresolvedNotes:[]};let l={},c=new Map;for(let g of n){let v=o(g)?.metadata,b=Gg(v);if(b.length>0){l[g]=b;for(let _ of b)c.set(_,g)}}let u=new Map,d=[];for(let g of r){let v={...g,reply:[],blockClientId:g.parent===0?c.get(g.id)??null:null};u.set(g.id,v),g.parent===0&&d.push(v)}for(let g of r)g.parent!==0&&u.get(g.parent)?.reply.unshift(u.get(g.id));if(d.length===0)return{notes:[],unresolvedNotes:[]};let f=[],m=[];for(let[g,v]of Object.entries(l)){let b=o(g),_=v.map(y=>{let w=u.get(y);return w?{thread:w,start:WRe(w,b)}:null}).filter(Boolean).sort((y,w)=>y.start!==w.start?y.start-w.start:y.thread.id-w.thread.id);for(let{thread:y}of _)y.status==="hold"?f.push(y):y.status==="approved"&&m.push(y)}let h=d.filter(g=>!g.blockClientId);return{notes:[...f,...h,...m],unresolvedNotes:f}},[n,r,o]);return{notes:i,unresolvedNotes:s}}function Xut(e,t){let r=e(),o=t();if(!r?.clientId||r.clientId!==o.clientId||!r.attributeKey||r.offset===void 0||o.offset===void 0||r.offset===o.offset)return null;let[n,i]=r.offset{let v=g.message&&g.code!=="unknown_error"?(0,m5e.decodeEntities)(g.message):(0,sv.__)("An error occurred while performing an update.");e("error",v,{type:"snackbar",isDismissible:!0})};return{onCreate:async({content:g,parent:v})=>{try{let b=v?null:Xut(l,c),_=v?null:b?.clientId||s(),y=await t("root","comment",{post:o(),content:g,status:"hold",type:"note",parent:v||0},{throwOnError:!0});if(!v&&y?.id&&_){let w=n(_),S=w?.metadata,x=HRe(S,y.id),C={metadata:u5e(x)};if(b){let A=Qut(w?.[b.attributeKey],y.id,b.start,b.end);A&&(C[b.attributeKey]=A)}u(_,C)}return e("snackbar",v?(0,sv.__)("Reply added."):(0,sv.__)("Note added."),{type:"snackbar",isDismissible:!0}),y}catch(b){d(b)}},onEdit:async({id:g,content:v,status:b})=>{try{if(b==="approved"||b==="hold"){await t("root","comment",{id:g,status:b},{throwOnError:!0});let w={post:o(),content:v||"",type:"note",status:b,parent:g,meta:{_wp_note_status:b==="approved"?"resolved":"reopen"}},S=await t("root","comment",w,{throwOnError:!0});return b==="approved"&&Jut(g,i,n,u),(0,d5e.speak)(b==="approved"?(0,sv.__)("Note marked as resolved."):(0,sv.__)("Note reopened.")),S}let y=await t("root","comment",{id:g,content:v,status:b},{throwOnError:!0});return e("snackbar",(0,sv.__)("Note updated."),{type:"snackbar",isDismissible:!0}),y}catch(_){d(_)}},onDelete:async g=>{try{let v=g.parent?null:g.blockClientId||s();if(await r("root","comment",g.id,void 0,{throwOnError:!0}),v){let b=n(v),_={metadata:u5e(YRe(b?.metadata,g.id))},y=UD(b,g.id);if(y){let w=Jq(b[y.attributeKey],g.id);w&&(_[y.attributeKey]=w)}u(v,_)}return e("snackbar",(0,sv.__)("Note deleted."),{type:"snackbar",isDismissible:!0}),!0}catch(v){d(v)}}}}function v5e(e=!1){let t=(0,Ou.useRegistry)();(0,ff.useEffect)(()=>{if(!e)return;let{getActiveComplementaryArea:r}=t.select(je),{disableComplementaryArea:o,enableComplementaryArea:n}=t.dispatch(je),i=t.subscribe(()=>{r("core")===null&&n("core",Hg)});return()=>{i(),r("core")===Hg&&o("core",Hg)}},[e,t])}function b5e({threads:e,selectedNoteId:t,isFloating:r,sidebarRef:o}){let[n,i]=(0,ff.useState)({}),[s]=(0,ff.useState)(c5e),l=(0,ff.useSyncExternalStore)(s.subscribe,s.getSnapshot);return(0,ff.useEffect)(()=>{if(!r||!o?.current)return;let c=o.current,u=s.getFirstBlockElement(),d=u?.closest(".is-root-container")??u,f=d?(0,p5e.getScrollContainer)(d):null,m=()=>{c.style.setProperty("--canvas-scroll",`${-(f?.scrollTop??0)}px`)},h,g=()=>{window.cancelAnimationFrame(h),h=window.requestAnimationFrame(()=>{let y=qRe({threads:e,selectedNoteId:t,blockRects:s.getAnchorRects(),heights:l,scrollTop:f?.scrollTop??0});i(y.positions),m()})};g();let v=new window.ResizeObserver(g);d&&v.observe(d);let b=f?.ownerDocument?.defaultView,_={passive:!0,capture:!0};return b?.addEventListener("scroll",m,_),()=>{window.cancelAnimationFrame(h),v.disconnect(),b?.removeEventListener("scroll",m,_)}},[o,l,r,t,s,e]),{notePositions:n,registerThread:s.registerThread,unregisterThread:s.unregisterThread}}var Tl=a(T(),1),{useBlockElement:$ut}=q(pk.privateApis);function UK({notes:e,sidebarRef:t,isFloating:r=!1,styles:o}){let{onCreate:n,onEdit:i,onDelete:s}=g5e(),{selectNote:l}=q((0,Xx.useDispatch)(I)),{selectBlock:c,toggleBlockSpotlight:u}=q((0,Xx.useDispatch)(pk.store)),{noteId:d,selectedBlockClientId:f,orderedBlockIds:m}=(0,Xx.useSelect)(N=>{let{getBlockAttributes:k,getSelectedBlockClientId:E,getClientIdsWithDescendants:M}=N(pk.store),V=E();return{noteId:V?k(V)?.metadata?.noteId:null,selectedBlockClientId:V,orderedBlockIds:M()}},[]),{selectedNote:h,noteFocused:g}=(0,Xx.useSelect)(N=>{let{getSelectedNote:k,isNoteFocused:E}=q(N(I));return{selectedNote:k(),noteFocused:E()}},[]),v=$ut(f),b=(0,pf.useMemo)(()=>{if(!r||h!=="new")return e;let N={id:"new",blockClientId:f,content:{rendered:""}},k=[];return m.forEach(E=>{let M=e.filter(V=>V.blockClientId===E);k.push(...M),E===f&&k.push(N)}),k},[e,r,h,f,m]),_=async N=>{let k=b.findIndex(D=>D.id===N.id),E=b[k+1],M=b[k-1];if(!await s(N))return;if(N.parent!==0){l(N.parent),us(N.parent,t.current);return}let F=E??M;F?(l(F.id),us(F.id,t.current),F.blockClientId&&(u(F.blockClientId,!0),c(F.blockClientId,null))):(l(void 0),u(N.blockClientId,!1),v?.focus())},y=(0,pf.useMemo)(()=>{let N=Gg({noteId:d}),k=e.filter(E=>N.includes(E.id));return zP(k)?.id},[d,e]),w=(0,pf.useRef)(f);(0,pf.useEffect)(()=>{w.current!==f&&(w.current=f,l(y))},[f,y,l]),(0,pf.useEffect)(()=>{g&&h&&(us(h,t.current,h==="new"?'[role="textbox"]':void 0),l(h))},[g,h,l,t]);let{notePositions:S,registerThread:x,unregisterThread:C}=b5e({threads:b,selectedNoteId:h,isFloating:r,sidebarRef:t}),A=Array.isArray(b)&&b.length>0,P=(N,k,E)=>{if(N.defaultPrevented)return;let M=b.findIndex(F=>F.id===k.id),V=N.currentTarget===N.target;(N.key==="Enter"||N.key==="ArrowRight")&&V&&!E?(l(k.id),k.blockClientId&&(c(k.blockClientId,null),u(k.blockClientId,!0))):(N.key==="Enter"||N.key==="ArrowLeft")&&V&&E||N.key==="Escape"?(l(void 0),k.blockClientId&&u(k.blockClientId,!1),us(k.id,t.current)):N.key==="ArrowDown"&&M0&&V?us(b[M-1].id,t.current):N.key==="Home"&&V?us(b[0].id,t.current):N.key==="End"&&V&&us(b[b.length-1].id,t.current)},R=r?-1:b.findIndex(N=>N.status==="approved"&&!!N.blockClientId);return(0,Tl.jsx)(le,{className:"editor-collab-sidebar-panel",style:o,role:"tree",direction:"column",gap:"md",justify:"flex-start",ref:N=>{N&&(t.current=N)},"aria-label":r?(0,h4.__)("Unresolved notes"):(0,h4.__)("All notes"),children:!A&&!r?(0,Tl.jsx)(uk,{onSubmit:n,sidebarRef:t}):(0,Tl.jsxs)(Tl.Fragment,{children:[!r&&h==="new"&&(0,Tl.jsx)(uk,{onSubmit:n,sidebarRef:t}),b.map((N,k)=>(0,Tl.jsxs)(pf.Fragment,{children:[k===R&&(0,Tl.jsx)(le,{direction:"row",align:"center",justify:"center",gap:"sm",className:"editor-collab-sidebar-panel__status-separator",children:(0,Tl.jsx)(Ss,{variant:"heading-sm",render:(0,Tl.jsx)("p",{}),children:(0,h4.__)("Resolved")})}),(0,Tl.jsx)(l5e,{note:N,onAddReply:n,onDeleteNote:_,onEditNote:i,isSelected:h===N.id,sidebarRef:t,floating:r?{y:S[N.id],registerThread:x,unregisterThread:C}:void 0,onKeyDown:E=>P(E,N,h===N.id)})]},N.id))]})})}var y5e=a(G(),1),g4=a(j(),1),b4=a(be(),1),WK=a(Y(),1),w5e=a(Pt(),1),_5e=a(xa(),1);var v4=a(T(),1),{NoteIconSlotFill:edt}=q(b4.privateApis);function tdt({clientId:e,onClick:t,isDistractionFree:r}){let o=(0,WK.useSelect)(l=>l(b4.store).getBlock(e),[e]),n=(0,WK.useSelect)(l=>l(_5e.store).getShortcutRepresentation("core/editor/new-note"),[]);if(!o?.isValid||o?.name===(0,w5e.getUnregisteredTypeHandlerName)())return null;let i=r||o?.name==="core/freeform",s;return r?s=(0,g4.__)("Notes are disabled in distraction free mode."):o?.name==="core/freeform"&&(s=(0,g4.__)("Convert to blocks to add notes.")),(0,v4.jsx)(y5e.MenuItem,{onClick:t,"aria-haspopup":"dialog",disabled:i,info:s,shortcut:n,children:(0,g4.__)("Add note")})}function GK({onClick:e,isDistractionFree:t}){return(0,v4.jsx)(edt.Fill,{children:({clientId:r,onClose:o})=>(0,v4.jsx)(tdt,{clientId:r,isDistractionFree:t,onClick:()=>{e(r),o()}})})}var S5e=a(G(),1);var Qx=a(j(),1),x5e=a(U(),1),y4=a(be(),1),C5e=a(Y(),1);var av=a(T(),1),{NoteIconToolbarSlotFill:rdt}=q(y4.privateApis);function odt({participants:e}){let t=(0,C5e.useSelect)(c=>{let{getSettings:u}=c(y4.store),{__experimentalDiscussionSettings:d}=u();return d?.avatarURL},[]),r=3,n=e.length>r?e.slice(0,r-1):e,i=Math.max(0,e.length-n.length),l=e.length>100&&i>0?(0,Qx.__)("100+"):(0,Qx.sprintf)((0,Qx.__)("+%s"),i);return(0,av.jsxs)(le,{direction:"row",align:"center",gap:"xs",children:[n.map(c=>(0,av.jsx)("img",{src:c.avatar||t,alt:c.name,className:"editor-note-indicator__avatar",style:{borderColor:za(c.id)}},c.id)),i>0&&(0,av.jsx)("span",{className:"editor-note-indicator__overflow",children:l})]})}function E5e({onClick:e,note:t}){let r=(0,x5e.useMemo)(()=>{if(!t)return[];let o=new Map,n=[t,...t.reply].sort((i,s)=>new Date(i.date)-new Date(s.date));for(let i of n)!i.author_name||o.has(i.author)||o.set(i.author,{id:i.author,name:i.author_name,avatar:i.author_avatar_urls?.["48"]||i.author_avatar_urls?.["96"]});return Array.from(o.values())},[t]);return r.length?(0,av.jsx)(rdt.Fill,{children:(0,av.jsx)(S5e.ToolbarButton,{className:"editor-note-indicator",label:(0,Qx.__)("View notes"),onClick:()=>e(),showTooltip:!0,children:(0,av.jsx)(odt,{participants:r})})}):null}var P5e=a(U(),1),k5e=a(be(),1);var ndt="40",T5e="80",idt="mark.wp-note{background-color:transparent;color:inherit;}";function sdt(e,t=null){let r=[idt];for(let o of e??[]){if(!o?.id)continue;let n=za(o.author??0),i=WD(o.id);r.push(`${i}{background-color:${n}${ndt};}`),r.push(`${i}:hover,${i}:focus-within{background-color:${n}${T5e};}`),t&&String(t)===String(o.id)&&r.push(`${i}{background-color:${n}${T5e};}`)}return r.join("")}function R5e({threads:e,selectedId:t}){let r=(0,P5e.useMemo)(()=>sdt(e,t),[e,t]);return(0,k5e.useStyleOverride)({id:"core-note-highlights",css:r}),null}var ds=a(T(),1);function adt({postId:e}){let{getActiveComplementaryArea:t}=(0,mf.useSelect)(je),{enableComplementaryArea:r}=(0,mf.useDispatch)(je),{toggleBlockSpotlight:o,selectBlock:n}=q((0,mf.useDispatch)(YK.store)),{selectNote:i}=q((0,mf.useDispatch)(I)),s=(0,I5e.useViewportMatch)("medium"),l=(0,A5e.useRef)(null),{clientId:c,noteId:u,isClassicBlock:d}=(0,mf.useSelect)(R=>{let{getBlockAttributes:N,getSelectedBlockClientId:k,getBlockName:E}=R(YK.store),M=k();return{clientId:M,noteId:M?N(M)?.metadata?.noteId:null,isClassicBlock:M?E(M)==="core/freeform":!1}},[]),f=Gg({noteId:u}),{isDistractionFree:m}=(0,mf.useSelect)(R=>{let{get:N}=R(N5e.store);return{isDistractionFree:N("core","distractionFree")}},[]),h=(0,mf.useSelect)(R=>q(R(I)).getSelectedNote(),[]),{notes:g,unresolvedNotes:v}=h5e(e),b=s,_=g.length>0||!b;v5e(b&&(v.length>0||h!==void 0));async function y({targetClientId:R,noteId:N,isApproved:k}){if(!R)return;let E=await t("core");k?r("core",hx):(!NP.includes(E)||!_)&&r("core",b?Hg:hx);let M=await t("core");NP.includes(M)&&(n(R,null),o(R,!0),i(N,{focus:!0}))}function w(R){let N=g.filter(E=>E.blockClientId===R),k=zP(N);return y({targetClientId:R,noteId:k?.id??"new",isApproved:k?.status==="approved"})}function S(R){return y({targetClientId:R,noteId:"new",isApproved:!1})}(0,O5e.useShortcut)("core/editor/new-note",R=>{R.preventDefault(),S(c)},{isDisabled:m||d||!c});let{merged:x}=Hr(),C=x?.styles?.color?.background,A=f.length>0?g.filter(R=>f.includes(R.id)):[],P=zP(A);return m?(0,ds.jsx)(GK,{isDistractionFree:!0}):(0,ds.jsxs)(ds.Fragment,{children:[(0,ds.jsx)(R5e,{threads:v,selectedId:h}),!!P&&(0,ds.jsx)(E5e,{note:P,onClick:()=>w(c)}),(0,ds.jsx)(GK,{onClick:R=>S(R)}),_&&(0,ds.jsx)(Oy,{identifier:hx,name:hx,title:(0,w4.__)("All notes"),header:(0,ds.jsx)("h2",{className:"interface-complementary-area-header__title",children:(0,w4.__)("All notes")}),icon:FV,closeLabel:(0,w4.__)("Close Notes"),children:(0,ds.jsx)(UK,{notes:g,sidebarRef:l})}),s&&(0,ds.jsx)(Oy,{isPinnable:!1,header:!1,identifier:Hg,className:"editor-collab-sidebar",headerClassName:"editor-collab-sidebar__header",backgroundColor:C,children:(0,ds.jsx)(UK,{notes:v,sidebarRef:l,styles:{backgroundColor:C},isFloating:!0})})]})}function M5e(){let{postId:e,editorMode:t,revisionsMode:r}=(0,mf.useSelect)(o=>{let{getCurrentPostId:n,getEditorMode:i,isRevisionsMode:s}=q(o(I));return{postId:n(),editorMode:i(),revisionsMode:s()}},[]);return!e||typeof e!="number"||t==="text"||r?null:(0,ds.jsx)(uo,{supportKeys:"editor.notes",children:(0,ds.jsx)(adt,{postId:e})})}var hf=a(G(),1),Jx=a(j(),1);var vk=a(Y(),1),KK=a(U(),1),B5e=a(Lt(),1),E4=a(Ce(),1),j5e=a(ae(),1);var z5e=a(be(),1);var fm=a(G(),1),_4=a(Y(),1),mk=a(j(),1),F5e=a(Lt(),1);var D5e=a(ae(),1);var Nu=a(T(),1);function S4({hideWelcomeGuide:e=!1,onChangePath:t}){let{user:r,setUser:o}=Hr(),n=!!r&&(Object.keys(r?.styles??{}).length>0||Object.keys(r?.settings??{}).length>0),i=()=>{o({styles:{},settings:{}})},{toggle:s}=(0,_4.useDispatch)(F5e.store),{canEditCSS:l}=(0,_4.useSelect)(u=>{let{getEntityRecord:d,__experimentalGetCurrentGlobalStylesId:f}=u(D5e.store),m=f();return{canEditCSS:!!(m?d("root","globalStyles",m):void 0)?._links?.["wp:action-edit-css"]}},[]),c=()=>{t("/css")};return(0,Nu.jsx)(fm.DropdownMenu,{icon:bo,label:(0,mk.__)("More"),toggleProps:{size:"compact"},children:({onClose:u})=>(0,Nu.jsxs)(Nu.Fragment,{children:[(0,Nu.jsxs)(fm.MenuGroup,{children:[l&&(0,Nu.jsx)(fm.MenuItem,{onClick:c,children:(0,mk.__)("Additional CSS")}),!e&&(0,Nu.jsx)(fm.MenuItem,{onClick:()=>{s("core/edit-site","welcomeGuideStyles"),u()},children:(0,mk.__)("Welcome Guide")})]}),(0,Nu.jsx)(fm.MenuGroup,{children:(0,Nu.jsx)(fm.MenuItem,{onClick:()=>{i(),u()},disabled:!n,children:(0,mk.__)("Reset styles")})})]})})}var l0=a(T(),1);function L5e({className:e,identifier:t,title:r,icon:o,children:n,closeLabel:i,header:s,headerClassName:l,panelClassName:c,isActiveByDefault:u}){return(0,l0.jsxs)(l0.Fragment,{children:[(0,l0.jsx)(Zl,{className:e,scope:"core",identifier:t,title:r,icon:o,closeLabel:i,header:s,headerClassName:l,panelClassName:c,isActiveByDefault:u,children:n}),(0,l0.jsx)(Uh,{scope:"core",identifier:t,icon:o,children:r})]})}var x4=a(Y(),1),C4=a(G(),1),xc=a(j(),1),qK=a(Lt(),1);var hk=a(T(),1);function gk({nonAnimatedSrc:e,animatedSrc:t}){return(0,hk.jsxs)("picture",{className:"editor-welcome-guide__image",children:[(0,hk.jsx)("source",{srcSet:e,media:"(prefers-reduced-motion: reduce)"}),(0,hk.jsx)("img",{src:t,width:"312",height:"240",alt:""})]})}var to=a(T(),1);function V5e(){let{toggle:e}=(0,x4.useDispatch)(qK.store),{isActive:t,isStylesOpen:r}=(0,x4.useSelect)(n=>{let i=n(je).getActiveComplementaryArea("core");return{isActive:!!n(qK.store).get("core/edit-site","welcomeGuideStyles"),isStylesOpen:i==="edit-site/global-styles"}},[]);if(!t||!r)return null;let o=(0,xc.__)("Welcome to Styles");return(0,to.jsx)(C4.Guide,{className:"editor-welcome-guide guide-styles",contentLabel:o,finishButtonText:(0,xc.__)("Get started"),onFinish:()=>e("core/edit-site","welcomeGuideStyles"),pages:[{image:(0,to.jsx)(gk,{nonAnimatedSrc:"https://s.w.org/images/block-editor/welcome-to-styles.svg?1",animatedSrc:"https://s.w.org/images/block-editor/welcome-to-styles.gif?1"}),content:(0,to.jsxs)(to.Fragment,{children:[(0,to.jsx)("h1",{className:"editor-welcome-guide__heading",children:o}),(0,to.jsx)("p",{className:"editor-welcome-guide__text",children:(0,xc.__)("Tweak your site, or give it a whole new look! Get creative \u2014 how about a new color palette for your buttons, or choosing a new font? Take a look at what you can do here.")})]})},{image:(0,to.jsx)(gk,{nonAnimatedSrc:"https://s.w.org/images/block-editor/set-the-design.svg?1",animatedSrc:"https://s.w.org/images/block-editor/set-the-design.gif?1"}),content:(0,to.jsxs)(to.Fragment,{children:[(0,to.jsx)("h1",{className:"editor-welcome-guide__heading",children:(0,xc.__)("Set the design")}),(0,to.jsx)("p",{className:"editor-welcome-guide__text",children:(0,xc.__)("You can customize your site as much as you like with different colors, typography, and layouts. Or if you prefer, just leave it up to your theme to handle!")})]})},{image:(0,to.jsx)(gk,{nonAnimatedSrc:"https://s.w.org/images/block-editor/personalize-blocks.svg?1",animatedSrc:"https://s.w.org/images/block-editor/personalize-blocks.gif?1"}),content:(0,to.jsxs)(to.Fragment,{children:[(0,to.jsx)("h1",{className:"editor-welcome-guide__heading",children:(0,xc.__)("Personalize blocks")}),(0,to.jsx)("p",{className:"editor-welcome-guide__text",children:(0,xc.__)("You can adjust your blocks to ensure a cohesive experience across your site \u2014 add your unique colors to a branded Button block, or adjust the Heading block to your preferred size.")})]})},{image:(0,to.jsx)(gk,{nonAnimatedSrc:"https://s.w.org/images/block-editor/welcome-documentation.svg",animatedSrc:"https://s.w.org/images/block-editor/welcome-documentation.gif"}),content:(0,to.jsxs)(to.Fragment,{children:[(0,to.jsx)("h1",{className:"editor-welcome-guide__heading",children:(0,xc.__)("Learn more")}),(0,to.jsxs)("p",{className:"editor-welcome-guide__text",children:[(0,xc.__)("New to block themes and styling your site?")," ",(0,to.jsx)(C4.ExternalLink,{href:(0,xc.__)("https://wordpress.org/documentation/article/styles-overview/"),children:(0,xc.__)("Here\u2019s a detailed guide to learn how to make the most of it.")})]})]})}]})}var Oi=a(T(),1);function H5e(){let{shouldResetNavigation:e,stylesPath:t,showStylebook:r,showListViewByDefault:o,hasRevisions:n,activeComplementaryArea:i,editorSettings:s,styleStateViewport:l}=(0,vk.useSelect)(y=>{let{getActiveComplementaryArea:w}=y(je),{getStylesPath:S,getShowStylebook:x}=q(y(I)),C=y(I).getEditorMode()==="visual",A=y(B5e.store).get("core","showListViewByDefault"),{getEntityRecord:P,__experimentalGetCurrentGlobalStylesId:R}=y(j5e.store),N=R(),k=N?P("root","globalStyles",N):void 0;return{stylesPath:S(),showStylebook:x(),shouldResetNavigation:w("core")!=="edit-site/global-styles"||!C,showListViewByDefault:A,hasRevisions:!!k?._links?.["version-history"]?.[0]?.count,activeComplementaryArea:y(je).getActiveComplementaryArea("core"),editorSettings:y(I).getEditorSettings(),styleStateViewport:q(y(z5e.store)).getStyleStateViewport()}},[]),{setStylesPath:c,setShowStylebook:u,resetStylesNavigation:d}=q((0,vk.useDispatch)(I)),f=(0,E4.useViewportMatch)("medium","<"),m=t.startsWith("/revisions")&&!r,h=t.startsWith("/revisions")&&r,g=(0,E4.usePrevious)(i);(0,KK.useEffect)(()=>{i==="edit-site/global-styles"&&g!=="edit-site/global-styles"&&d()},[i,g,d]),(0,KK.useEffect)(()=>{e&&d()},[e,d]);let{setIsListViewOpened:v}=(0,vk.useDispatch)(I),b=()=>{v(!1),c(m||h?"/":"/revisions")},_=()=>{v(r&&o),u(!r)};return(0,Oi.jsxs)(Oi.Fragment,{children:[(0,Oi.jsx)(L5e,{className:"editor-global-styles-sidebar",identifier:"edit-site/global-styles",title:(0,Jx.__)("Styles"),icon:e8,closeLabel:(0,Jx.__)("Close Styles"),panelClassName:"editor-global-styles-sidebar__panel",header:(0,Oi.jsxs)(hf.Flex,{className:"editor-global-styles-sidebar__header",gap:1,children:[(0,Oi.jsx)(hf.FlexItem,{children:(0,Oi.jsx)("h2",{className:"editor-global-styles-sidebar__header-title",children:(0,Jx.__)("Styles")})}),(0,Oi.jsxs)(hf.Flex,{justify:"flex-end",gap:1,className:"editor-global-styles-sidebar__header-actions",children:[!f&&(0,Oi.jsx)(hf.FlexItem,{children:(0,Oi.jsx)(hf.Button,{icon:mv,label:(0,Jx.__)("Style Book"),isPressed:r,accessibleWhenDisabled:!0,disabled:e,onClick:_,size:"compact"})}),(0,Oi.jsx)(hf.FlexItem,{children:(0,Oi.jsx)(hf.Button,{label:(0,Jx.__)("Revisions"),icon:yf,onClick:b,accessibleWhenDisabled:!0,disabled:!n,isPressed:m||h,size:"compact"})}),(0,Oi.jsx)(S4,{onChangePath:c})]})]}),children:(0,Oi.jsx)(XM,{path:t,onPathChange:c,settings:s,selectedViewport:l,showResponsiveStateControls:!1})}),(0,Oi.jsx)(V5e,{})]})}var Cc=a(T(),1);function ldt({postType:e,postId:t,templateId:r,settings:o,children:n,initialEdits:i,onActionPerformed:s,extraContent:l,extraSidebarPanels:c,...u}){let{post:d,template:f,hasLoadedPost:m,error:h,isBlockTheme:g,showGlobalStyles:v}=(0,U5e.useSelect)(b=>{let{getEntityRecord:_,getResolutionError:y,hasFinishedResolution:w,getCurrentTheme:S,__experimentalGetCurrentGlobalStylesId:x,canUser:C}=b(W5e.store),{getRenderingMode:A,getCurrentPostType:P}=b(I),R=["postType",e,t],N=A(),k=P(),E=S()?.is_block_theme,M=x(),V=M?C("update",{kind:"root",name:"globalStyles",id:M}):!1;return{post:_(...R),template:r?_("postType",Cr,r):void 0,hasLoadedPost:w("getEntityRecord",R),error:y("getEntityRecord",R)?.message,isBlockTheme:E,showGlobalStyles:E&&V&&(k==="wp_template"||N==="template-locked")}},[e,t,r]);return(0,Cc.jsxs)(Cc.Fragment,{children:[m&&!d&&(0,Cc.jsx)(G5e.Notice,{status:h?"error":"warning",isDismissible:!1,children:h||(0,Y5e.__)("You attempted to edit an item that doesn't exist. Perhaps it was deleted?")}),!!d&&(0,Cc.jsxs)(XG,{post:d,__unstableTemplate:f,settings:o,initialEdits:i,useSubRegistry:!1,children:[(0,Cc.jsx)(OAe,{...u,children:l}),n,(0,Cc.jsx)(WOe,{onActionPerformed:s,extraPanels:c}),(0,Cc.jsx)(M5e,{}),g&&(0,Cc.jsx)(D3,{}),v&&(0,Cc.jsx)(H5e,{})]})]})}var q5e=ldt;var Ge=a(j(),1),rNe=a(Ce(),1),c0=a(Y(),1),oNe=a(U(),1),bk=a(Lt(),1);var T4=a(Y(),1),K5e=a(Lt(),1);var Z5e=a(T(),1),{PreferenceBaseOption:cdt}=q(K5e.privateApis);function X5e(e){let t=(0,T4.useSelect)(n=>n(I).isPublishSidebarEnabled(),[]),{enablePublishSidebar:r,disablePublishSidebar:o}=(0,T4.useDispatch)(I);return(0,Z5e.jsx)(cdt,{isChecked:t,onChange:n=>n?r():o(),...e})}var P4=a(Y(),1),Q5e=a(Lt(),1),k4=a(Pt(),1),J5e=a(U(),1),$5e=a(G(),1),e1=a(j(),1),eNe=a(be(),1);var $x=a(T(),1),{BlockManager:udt}=q(eNe.privateApis),ddt=[];function tNe(){let{showBlockTypes:e,hideBlockTypes:t}=q((0,P4.useDispatch)(I)),{blockTypes:r,allowedBlockTypes:o,hiddenBlockTypes:n}=(0,P4.useSelect)(m=>({blockTypes:m(k4.store).getBlockTypes(),allowedBlockTypes:m(I).getEditorSettings().allowedBlockTypes,hiddenBlockTypes:m(Q5e.store).get("core","hiddenBlockTypes")??ddt}),[]),s=(0,J5e.useMemo)(()=>o===!0?r:r.filter(({name:m})=>o?.includes(m)),[o,r]).filter(m=>(0,k4.hasBlockSupport)(m,"inserter",!0)&&(!m.parent||m.parent.includes("core/post-content"))),l=n.filter(m=>s.some(h=>h.name===m)),c=s.filter(m=>!l.includes(m.name)),u=s.length-c.length;function d(){f(s)}let f=m=>{if(c.length>m.length){let h=c.filter(g=>!m.find(({name:v})=>v===g.name));t(h.map(({name:g})=>g))}else if(c.length!c.find(({name:v})=>v===g.name));e(h.map(({name:g})=>g))}};return(0,$x.jsxs)("div",{className:"editor-block-visibility",children:[!!u&&(0,$x.jsxs)("div",{className:"editor-block-visibility__disabled-blocks-count",children:[(0,e1.sprintf)((0,e1._n)("%d block is hidden.","%d blocks are hidden.",u),u),(0,$x.jsx)($5e.Button,{__next40pxDefaultSize:!0,variant:"link",onClick:d,children:(0,e1.__)("Reset")})]}),(0,$x.jsx)(udt,{blockTypes:s,selectedBlockTypes:c,onChange:f,showSelectAll:!1})]})}var nt=a(T(),1),{PreferencesModal:fdt,PreferencesModalTabs:pdt,PreferencesModalSection:gf,PreferenceToggleControl:fs}=q(bk.privateApis);function nNe({extraSections:e={}}){let t=(0,c0.useSelect)(o=>o(je).isModalActive("editor/preferences"),[]),{closeModal:r}=(0,c0.useDispatch)(je);return t?(0,nt.jsx)(fdt,{closeModal:r,children:(0,nt.jsx)(mdt,{extraSections:e})}):null}function mdt({extraSections:e={}}){let t=(0,rNe.useViewportMatch)("medium"),{showBlockBreadcrumbsOption:r,showCollaborationOptions:o}=(0,c0.useSelect)(c=>{let{getEditorSettings:u,isCollaborationEnabledForCurrentPost:d}=q(c(I)),{get:f}=c(bk.store),m=u().richEditingEnabled;return{showBlockBreadcrumbsOption:!f("core","distractionFree")&&t&&m,showCollaborationOptions:d()}},[t]),{setIsListViewOpened:n,setIsInserterOpened:i}=(0,c0.useDispatch)(I),{set:s}=(0,c0.useDispatch)(bk.store),l=(0,oNe.useMemo)(()=>[{name:"general",tabLabel:(0,Ge.__)("General"),content:(0,nt.jsxs)(nt.Fragment,{children:[(0,nt.jsxs)(gf,{title:(0,Ge.__)("Interface"),children:[(0,nt.jsx)(fs,{scope:"core",featureName:"showListViewByDefault",help:(0,Ge.__)("Opens the List View panel by default."),label:(0,Ge.__)("Always open List View")}),r&&(0,nt.jsx)(fs,{scope:"core",featureName:"showBlockBreadcrumbs",help:(0,Ge.__)("Display the block hierarchy trail at the bottom of the editor."),label:(0,Ge.__)("Show block breadcrumbs")}),(0,nt.jsx)(fs,{scope:"core",featureName:"allowRightClickOverrides",help:(0,Ge.__)("Allows contextual List View menus via right-click, overriding browser defaults."),label:(0,Ge.__)("Allow right-click contextual menus")}),(0,nt.jsx)(fs,{scope:"core",featureName:"enableChoosePatternModal",help:(0,Ge.__)("Pick from starter content when creating a new page."),label:(0,Ge.__)("Show starter patterns")}),o&&(0,nt.jsx)(fs,{scope:"core",featureName:"showCollaborationCursor",help:(0,Ge.__)("Show your own avatar inside blocks during collaborative editing sessions."),label:(0,Ge.__)("Show avatar in blocks")})]}),o&&(0,nt.jsxs)(gf,{title:(0,Ge.__)("Collaboration notifications"),children:[(0,nt.jsx)(fs,{scope:"core",featureName:"showCollaborationJoinNotifications",help:(0,Ge.__)("Show notifications when collaborators join the post."),label:(0,Ge.__)("Collaborator joined")}),(0,nt.jsx)(fs,{scope:"core",featureName:"showCollaborationLeaveNotifications",help:(0,Ge.__)("Show notifications when collaborators leave the post."),label:(0,Ge.__)("Collaborator left")}),(0,nt.jsx)(fs,{scope:"core",featureName:"showCollaborationPostSaveNotifications",help:(0,Ge.__)("Show notifications when collaborators save, update, or publish the post."),label:(0,Ge.__)("Post updated")})]}),(0,nt.jsxs)(gf,{title:(0,Ge.__)("Document settings"),description:(0,Ge.__)("Select what settings are shown in the document panel."),children:[(0,nt.jsx)(y6.Slot,{}),(0,nt.jsx)(XS,{taxonomyWrapper:(c,u)=>(0,nt.jsx)(kg,{label:u.labels.menu_name,panelName:`taxonomy-panel-${u.slug}`})}),(0,nt.jsx)(Gp,{children:(0,nt.jsx)(kg,{label:(0,Ge.__)("Featured image"),panelName:"featured-image"})}),(0,nt.jsx)(Dy,{children:(0,nt.jsx)(kg,{label:(0,Ge.__)("Excerpt"),panelName:"post-excerpt"})}),(0,nt.jsx)(uo,{supportKeys:["comments","trackbacks"],children:(0,nt.jsx)(kg,{label:(0,Ge.__)("Discussion"),panelName:"discussion-panel"})}),(0,nt.jsx)(vS,{children:(0,nt.jsx)(kg,{label:(0,Ge.__)("Page attributes"),panelName:"page-attributes"})})]}),t&&(0,nt.jsx)(gf,{title:(0,Ge.__)("Publishing"),children:(0,nt.jsx)(X5e,{help:(0,Ge.__)("Review settings, such as visibility and tags."),label:(0,Ge.__)("Enable pre-publish checks")})}),e?.general]})},{name:"appearance",tabLabel:(0,Ge.__)("Appearance"),content:(0,nt.jsxs)(gf,{title:(0,Ge.__)("Appearance"),description:(0,Ge.__)("Customize the editor interface to suit your needs."),children:[(0,nt.jsx)(fs,{scope:"core",featureName:"fixedToolbar",onToggle:()=>s("core","distractionFree",!1),help:(0,Ge.__)("Access all block and document tools in a single place."),label:(0,Ge.__)("Top toolbar")}),(0,nt.jsx)(fs,{scope:"core",featureName:"distractionFree",onToggle:()=>{s("core","fixedToolbar",!0),i(!1),n(!1)},help:(0,Ge.__)("Reduce visual distractions by hiding the toolbar and other elements to focus on writing."),label:(0,Ge.__)("Distraction free")}),(0,nt.jsx)(fs,{scope:"core",featureName:"focusMode",help:(0,Ge.__)("Highlights the current block and fades other content."),label:(0,Ge.__)("Spotlight mode")}),e?.appearance]})},{name:"accessibility",tabLabel:(0,Ge.__)("Accessibility"),content:(0,nt.jsxs)(nt.Fragment,{children:[(0,nt.jsx)(gf,{title:(0,Ge.__)("Navigation"),description:(0,Ge.__)("Optimize the editing experience for enhanced control."),children:(0,nt.jsx)(fs,{scope:"core",featureName:"keepCaretInsideBlock",help:(0,Ge.__)("Keeps the text cursor within blocks while navigating with arrow keys, preventing it from moving to other blocks and enhancing accessibility for keyboard users."),label:(0,Ge.__)("Contain text cursor inside block")})}),(0,nt.jsx)(gf,{title:(0,Ge.__)("Interface"),children:(0,nt.jsx)(fs,{scope:"core",featureName:"showIconLabels",label:(0,Ge.__)("Show button text labels"),help:(0,Ge.__)("Show text instead of icons on buttons across the interface.")})})]})},{name:"blocks",tabLabel:(0,Ge.__)("Blocks"),content:(0,nt.jsxs)(nt.Fragment,{children:[(0,nt.jsx)(gf,{title:(0,Ge.__)("Inserter"),children:(0,nt.jsx)(fs,{scope:"core",featureName:"mostUsedBlocks",help:(0,Ge.__)("Adds a category with the most frequently used blocks in the inserter."),label:(0,Ge.__)("Show most used blocks")})}),(0,nt.jsx)(gf,{title:(0,Ge.__)("Manage block visibility"),description:(0,Ge.__)("Disable blocks that you don't want to appear in the inserter. They can always be toggled back on later."),children:(0,nt.jsx)(tNe,{})})]})},window.__clientSideMediaProcessing&&{name:"media",tabLabel:(0,Ge.__)("Media"),content:(0,nt.jsx)(nt.Fragment,{children:(0,nt.jsxs)(gf,{title:(0,Ge.__)("General"),description:(0,Ge.__)("Customize options related to the media upload flow."),children:[(0,nt.jsx)(fs,{scope:"core/media",featureName:"optimizeOnUpload",help:(0,Ge.__)("Compress media items before uploading to the server."),label:(0,Ge.__)("Pre-upload compression")}),(0,nt.jsx)(fs,{scope:"core/media",featureName:"requireApproval",help:(0,Ge.__)("Require approval step when optimizing existing media."),label:(0,Ge.__)("Approval step")})]})})}].filter(Boolean),[r,o,e,i,n,s,t]);return(0,nt.jsx)(pdt,{sections:l})}var Sk=a(Pt(),1);var yk=a(be(),1),iNe="content",sNe={name:"core/pattern-overrides",getValues({select:e,clientId:t,context:r,bindings:o}){let n=r["pattern/overrides"],{getBlockAttributes:i}=e(yk.store),s=i(t),l={};for(let c of Object.keys(o)){let u=n?.[s?.metadata?.name]?.[c];if(u===void 0){l[c]=s?.[c];continue}else l[c]=u===""?void 0:u}return l},setValues({select:e,dispatch:t,clientId:r,bindings:o}){let{getBlockAttributes:n,getBlockParentsByBlockName:i,getBlocks:s}=e(yk.store),c=n(r)?.metadata?.name;if(!c)return;let[u]=i(r,"core/block",!0),d=Object.entries(o).reduce((m,[h,{newValue:g}])=>(m[h]=g,m),{});if(!u){let m=h=>{for(let g of h)g.attributes?.metadata?.name===c&&t(yk.store).updateBlockAttributes(g.clientId,d),m(g.innerBlocks)};m(s());return}let f=n(u)?.[iNe];t(yk.store).updateBlockAttributes(u,{[iNe]:{...f,[c]:{...f?.[c],...Object.entries(d).reduce((m,[h,g])=>(m[h]=g===void 0?"":g,m),{})}}})},canUserEditValue:()=>!0};var R4=a(j(),1),A4=a(ae(),1),wk=a(be(),1),ZK=["core/navigation-link","core/navigation-submenu"],aNe=[{label:(0,R4.__)("Post Date"),args:{field:"date"},type:"string"},{label:(0,R4.__)("Post Modified Date"),args:{field:"modified"},type:"string"},{label:(0,R4.__)("Post Link"),args:{field:"link"},type:"string"}],lNe={name:"core/post-data",getValues({select:e,context:t,bindings:r,clientId:o}){let{getBlockAttributes:n,getBlockName:i}=e(wk.store),s=i(o),l=ZK.includes(s),c,u;if(l){let h=n(o);c=h?.id,u=h?.type}else c=t?.postId,u=t?.postType;let{getEditedEntityRecord:d}=e(A4.store),f=d("postType",u,c),m={};for(let[h,g]of Object.entries(r)){let v=aNe.find(b=>b.args.field===g.args.field);v?f?m[h]=f[g.args.field]:m[h]=v.label:m[h]=g.args.field}return m},setValues({dispatch:e,context:t,bindings:r,clientId:o,select:n}){let{getBlockName:i}=n(wk.store),s=i(o);if(ZK.includes(s))return!1;let l={};Object.values(r).forEach(({args:c,newValue:u})=>{l[c.field]=u}),e(A4.store).editEntityRecord("postType",t?.postType,t?.postId,l)},canUserEditValue({select:e,context:t}){let{getBlockName:r,getSelectedBlockClientId:o}=e(wk.store),n=o(),i=r(n);return!(ZK.includes(i)||t?.query||t?.queryId||!t?.postType||!e(A4.store).canUser("update",{kind:"postType",name:t?.postType,id:t?.postId}))},getFieldsList({context:e,select:t}){return t(wk.store).getSelectedBlock()?.name!=="core/post-date"?[]:!e||!e.postId||!e.postType?[]:aNe}};var _k=a(ae(),1);function XK(e,t){let{getRegisteredPostMeta:r}=q(e(_k.store)),o=r(t?.postType),n=[];return Object.entries(o).forEach(([i,s])=>{i==="footnotes"||i.charAt(0)==="_"||n.push({label:s.title||i,args:{key:i},default:s.default,type:s.type})}),n}function hdt({select:e,context:t,args:r}){let n=XK(e,t).find(l=>l.args.key===r.key);if(!n)return r.key;if(!t?.postId)return n.default||n.label||r.key;let{getEditedEntityRecord:i}=e(_k.store);return i("postType",t?.postType,t?.postId).meta?.[r.key]??n?.label??r.key}var cNe={name:"core/post-meta",getValues({select:e,context:t,bindings:r}){let o={};for(let[n,i]of Object.entries(r))o[n]=hdt({select:e,context:t,args:i.args});return o},setValues({dispatch:e,context:t,bindings:r}){let o={};Object.values(r).forEach(({args:n,newValue:i})=>{o[n.key]=i}),e(_k.store).editEntityRecord("postType",t?.postType,t?.postId,{meta:o})},canUserEditValue({select:e,context:t,args:r}){return!(t?.query||t?.queryId||!t?.postType||!XK(e,t).some(l=>l.args.key===r.key)||e(I).getEditorSettings().enableCustomFields||!e(_k.store).canUser("update",{kind:"postType",name:t?.postType,id:t?.postId}))},getFieldsList({select:e,context:t}){return XK(e,t).map(({default:o,...n})=>({...n}))}};var lv=a(j(),1),uNe=a(ae(),1),I4=a(be(),1),QK=["core/navigation-link","core/navigation-submenu"],JK=[{label:(0,lv.__)("Term ID"),args:{field:"id"},type:"string"},{label:(0,lv.__)("Name"),args:{field:"name"},type:"string"},{label:(0,lv.__)("Slug"),args:{field:"slug"},type:"string"},{label:(0,lv.__)("Link"),args:{field:"link"},type:"string"},{label:(0,lv.__)("Description"),args:{field:"description"},type:"string"},{label:(0,lv.__)("Parent ID"),args:{field:"parent"},type:"string"},{label:(0,lv.__)("Count"),args:{field:"count"},type:"string"}],dNe={name:"core/term-data",usesContext:["taxonomy","termId","termData"],getValues({select:e,context:t,bindings:r,clientId:o}){let{getEntityRecord:n}=e(uNe.store),{getBlockAttributes:i,getBlockName:s}=e(I4.store),l=s(o),c=QK.includes(l),u;if(c){let f=i(o),m=f?.type;u=n("taxonomy",m==="tag"?"post_tag":m,f?.id)}else t.termId&&t.taxonomy&&(u=n("taxonomy",t.taxonomy,t.termId));!u&&t?.termData&&!c&&(u=t.termData);let d={};for(let[f,m]of Object.entries(r)){let h=JK.find(g=>g.args.field===m.args.field);h?!u||u[m.args.field]===void 0?d[f]=h.label:m.args.field==="count"?d[f]="("+u[m.args.field]+")":d[f]=u[m.args.field]:d[f]=m.args.field}return d},setValues({dispatch:e,context:t,bindings:r}){return!1},canUserEditValue({select:e,context:t}){let{getBlockName:r,getSelectedBlockClientId:o}=e(I4.store),n=o(),i=r(n);return QK.includes(i)||t?.termQuery||!t?.taxonomy||!t?.termId,!1},getFieldsList({context:e,select:t}){let{getBlockAttributes:r,getBlockName:o,getSelectedBlockClientId:n}=t(I4.store),i=n(),s=o(i);if(QK.includes(s)){let l=r(i);return!l||!l.id||!l.type?[]:JK}return e?e.taxonomy&&e.termId||e.termData?JK:[]:[]}};function fNe(){(0,Sk.registerBlockBindingsSource)(sNe),(0,Sk.registerBlockBindingsSource)(lNe),(0,Sk.registerBlockBindingsSource)(cNe),(0,Sk.registerBlockBindingsSource)(dNe)}var M4=a(Y(),1),Mu=a(U(),1),Pl=a(j(),1),N4=a(Nl(),1),$K=a(u3(),1),mNe=a(It(),1),F4=a(G(),1);var xk=a(T(),1),O4="upload-progress",gdt=3e3,pNe=40;function vdt(e){if(e.length<=pNe)return e;let t="\u2026",r=pNe-t.length,o=Math.ceil(r/2),n=Math.floor(r/2);return e.slice(0,o)+t+e.slice(e.length-n)}var bdt=(0,xk.jsx)("span",{className:"editor-upload-progress-snackbar__spinner","aria-hidden":"true",children:(0,xk.jsx)(F4.Spinner,{})}),ydt=(0,xk.jsx)("span",{className:"editor-upload-progress-snackbar__check","aria-hidden":"true",children:(0,xk.jsx)(F4.Icon,{icon:Io})});function hNe(){let{items:e,csmFailureCount:t}=(0,M4.useSelect)(v=>{let{getItems:b}=v($K.store),{getFailureCount:_}=q(v($K.store));return{items:b(),csmFailureCount:_()}},[]),r=uQ(),o=(0,Mu.useMemo)(()=>e.filter(v=>!v.parentId),[e]),n=o.length,i=r?r.total-r.completed:0,s=n+i,l=n+(r?r.total:0),c=(0,Mu.useRef)(0),{createNotice:u,removeNotice:d}=(0,M4.useDispatch)(mNe.store),f=(0,Mu.useRef)(!1),m=(0,Mu.useRef)(!1),h=(0,Mu.useRef)(0),g=(0,Mu.useRef)(null);return(0,Mu.useEffect)(()=>()=>{g.current&&clearTimeout(g.current)},[]),(0,Mu.useEffect)(()=>{let v=s>0,b=t+cQ();if(v&&!m.current)f.current=!1,h.current=b,(0,N4.speak)((0,Pl.__)("Media upload started"),"polite"),g.current&&(clearTimeout(g.current),g.current=null,c.current=0);else if(!v&&m.current){let x=c.current,C=Math.min(x,b-h.current),A=x-C;if(A===0)(0,N4.speak)((0,Pl.__)("Media upload failed"),"polite"),d(O4),c.current=0;else{let P=C===0,R=P?(0,Pl.__)("Upload complete"):(0,Pl.sprintf)((0,Pl.__)("Uploaded %1$d of %2$d"),A,x);(0,N4.speak)(P?(0,Pl.__)("Media upload complete"):R,"polite"),f.current?c.current=0:(u("info",R,{id:O4,type:"snackbar",isDismissible:!1,explicitDismiss:!1,speak:!1,icon:P?ydt:void 0,onDismiss:()=>{f.current=!0}}),g.current=setTimeout(()=>{d(O4),g.current=null,c.current=0},gdt))}}if(m.current=v,!v||f.current)return;l>c.current&&(c.current=l);let _=c.current,y=_-s+1,w=vdt(o[0]?.sourceFile?.name||r?.pending[0]||(0,Pl.__)("Uploading")),S=_===1?(0,Pl.sprintf)((0,Pl.__)("Uploading \u2014 %s"),w):(0,Pl.sprintf)((0,Pl.__)("Uploading %1$d of %2$d \u2014 %3$s"),y,_,w);u("info",S,{id:O4,type:"snackbar",isDismissible:!1,explicitDismiss:!0,speak:!1,icon:bdt,onDismiss:()=>{f.current=!0}})},[s,l,o,t,r,u,d]),null}var{store:wdt,..._dt}=CW,gNe={};AZ(gNe,{CreateTemplatePartModal:Tw,patternTitleField:RC,templateTitleField:q1,BackButton:RD,EntitiesSavedStatesExtensible:rP,Editor:q5e,PluginPostExcerpt:cP,PostCardPanel:rv,PreferencesModal:nNe,usePostActions:FL,usePostFields:nS,ToolsMoreMenuGroup:DD,ViewMoreMenuGroup:LD,ResizableEditor:fS,UploadProgressSnackbar:hNe,registerCoreBlockBindingsSources:fNe,getTemplateInfo:Il,GlobalStylesUIWrapper:XM,GlobalStylesActionMenu:S4,StyleBookPreview:ySe,useGlobalStyles:Hr,useStyle:cg,interfaceStore:wdt,..._dt});var Ck=a(Y(),1);function Sdt(e,t,r){let{registerEntityAction:o}=q((0,Ck.dispatch)(I))}function xdt(e,t,r){let{unregisterEntityAction:o}=q((0,Ck.dispatch)(I))}function Cdt(e,t,r){let{registerEntityField:o}=q((0,Ck.dispatch)(I))}function Edt(e,t,r){let{unregisterEntityField:o}=q((0,Ck.dispatch)(I))}var vNe=a(be(),1);return ENe(Tdt);})();
/*! Bundled license information:
use-sync-external-store/cjs/use-sync-external-store-shim.production.js:
(**
* @license React
* use-sync-external-store-shim.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*)
use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.js:
(**
* @license React
* use-sync-external-store-shim/with-selector.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*)
autosize/dist/autosize.js:
(*!
autosize 4.0.2
license: MIT
http://www.jacklmoore.com/autosize
*)
is-plain-object/dist/is-plain-object.mjs:
(*!
* is-plain-object
*
* Copyright (c) 2014-2017, Jon Schlinkert.
* Released under the MIT License.
*)
*/
(window.wp ||= {}).editor = wp.editor;
})();