�PNG  IHDR22?�� pHYs  �� OiCCPPhotoshop ICC profilexڝSgTS�=���BK���KoR RB���&*! J�!��Q�EEȠ�����Q, � ��!���������{�kּ������>���� �H3Q5� �B�������.@� $p�d!s�#�~<<+"��x� �M��0���B�\���t�8K�@z�B�@F���&S�`�cb�P-`'������{[�!�� e�Dh;��V�EX0fK�9�-0IWfH���� � 0Q��){`�##x��F�W<�+��*x��<�$9E�[-qWW.(�I+6aa�@.�y�2�4���������x����6��_-��"bb���ϫp@�t~��,/��;�m��%�h^ �u��f�@����W�p�~<�5�j>{�-�]c�K'Xt����o��(�h���w��?�G�%�fI�q^D$.Tʳ?�D��*�A��,���� �`6�B$��BB d�r`)��B(�Ͱ*`/�@4�Qh��p.�U�=p�a��(�� A�a!ڈb�X#����!�H�$ ɈQ"K�5H1R�T UH�=r9�\F��;�2����G1���Q=� �C��7�F� �dt1�����r�=�6��Ыhڏ>C�0��3�l0.��B�8, �c˱"� ���V����cϱw�E� 6wB aAHXLXN�H� $4� 7 �Q�'"��K�&���b21�XH,#��/{�C�7$�C2'��I��T��F�nR#�,��4H#���dk�9�, +ȅ����3��!�[ �b@q��S�(R�jJ��4�e�2AU��Rݨ�T5�ZB���R�Q��4u�9̓IK�����hh�i��t�ݕN��W���G���w ��Ljg(�gw��L�Ӌ�T071���oUX*�*|�� �J�&�*/T����ު U�U�T��^S}�FU3S� Ԗ�U��P�SSg�;���g�oT?�~Y��Y�L�OC�Q��_�� c�x,!k ��u�5�&���|v*�����=���9C3J3W�R�f?�q��tN �(���~���)�)�4L�1e\k����X�H�Q�G�6������E�Y��A�J'\'Gg����S�Sݧ �M=:��.�k���Dw�n��^��Lo��y���}/�T�m���G X� $� �<�5qo</���QC]�@C�a�a�ᄑ��<��F�F�i�\�$�m�mƣ&&!&KM�M�RM��)�;L;L���͢�֙5�=1�2��כ߷`ZxZ,����eI��Z�Yn�Z9Y�XUZ]�F���%ֻ�����N�N���gð�ɶ�����ۮ�m�}agbg�Ů��}�}��= ���Z~s�r:V:ޚΜ�?}����/gX���3��)�i�S��Ggg�s�󈋉K��.�>.���Ƚ�Jt�q]�z���������ۯ�6�i�ܟ�4�)�Y3s���C�Q��? ��0k߬~OCO�g��#/c/�W�װ��w��a�>�>r��>�<7�2�Y_�7��ȷ�O�o�_��C#�d�z����%g��A�[��z|!��?:�e����A���AA�������!h�쐭!��Α�i�P~���a�a��~ '���W�?�p�X�1�5w��Cs�D�D�Dޛg1O9�-J5*>�.j<�7�4�?�.fY��X�XIlK9.*�6nl������� �{�/�]py�����.,:�@L�N8��A*��%�w%� y��g"/�6ш�C\*N�H*Mz�쑼5y$�3�,幄'���L Lݛ:��v m2=:�1����qB�!M��g�g�fvˬe����n��/��k���Y- �B��TZ(�*�geWf�͉�9���+��̳�ې7�����ᒶ��KW-X潬j9�������(�x��oʿ�ܔ���Ĺd�f�f���-�[����n �ڴ �V����E�/��(ۻ��C���<��e����;?T�T�T�T6��ݵa��n��{��4���[���>ɾ�UUM�f�e�I���?�������m]�Nmq����#�׹���=TR��+�G�����w- 6 U����#pDy��� �� :�v�{���vg/jB��F�S��[b[�O�>����z�G��499�?r����C�d�&����ˮ/~�����јѡ�򗓿m|������������x31^�V���w�w��O�| (�h���SЧ��������c3-� cHRMz%������u0�`:�o�_�F5IDATx��ytUս�?�;���fN$$��@B�!�k��� -*�gE���j�O�kQ�ʠ`U�B_ �AÐ0%�Ȕ�@r3ޛ;߳��$�@��v����^�s����������$��ߢ !�W��5�̱'-٘������4�>�Rƫ$�G��0U�H}�_ _� #��k�MJ/=�9Du *ڲ�k�PQ;0��j|�*�$�^컂脛y���>�z×� B��� ��(�:$�ʔ_�6��C!B����MVx��a��ζyY����j��ƋY2�9�F�{r��r�딟F��Q��hY6��� x��[l��RC��������nt@��;P��3��� F�w��7��:�P���ɋ'���mj���Bƪ�$�Q�L��y��߷g��\���z����v5�p�v$�v櫻�`6~K �Y�X����,�:��"�o�e0II"(��,������l_�C���/4�+f�E�!q��:����u����c��樼.UE�@� �]K�W���$-�h]�JG���Dz)�`��.�A/ ���mᏣc�3jK� �!�>���$�Q�!�_�? \�C2(E �M$Z I{�U���s�ǣ���=��@Բe ޻��W�����@ �w����}�9v,)��.}*|"�s��di���,���G�]W�AC�������|<����[��ߕ������K�*�G nߴ!��‹��J�!��6(L�a)��Am��������;adf��:�xm��nh�;֦I��(���o�C~ډa?�=��s����h��E������xp����)���_���t��W�����´;8���`dz=(��@@�+,�;�`�fhl��XȌ�3,uI�~z(J����� �ZX�A����H'�À�㜦�82|��a�n�z2��I���� ���EY�h�ε<�0�q�{��C��v�˅��?"@��χ�x�WS+��N�~�KQ�J�8ل�� _.W��� !TU{�����,��"�� �;�������HI S� ��))�o�1�H�D� ���� (� ;����"Ҕ��,���� �F=���O��&�Ph>�`���y��߲ &S��P�<��'��1s�1cĂ�N����2)����@�u��tv��<�+�-&�����h��[!FSG���' � z z0��<����8d&�����E0�,��<��"!P�b4��� �{S�����X����.�囤���T��hEF��X�q0"-<����h���]�Py*����F⩍��@v�˂�Y08�� .q��a��s����(!<̫1�3�L�H��7sYW�`��qtu�\7��?�@�Y�� %Ka�x�GZ�*W�P��y�����N0r9��Z�c�%���q,��k�����!!,��>���IB��� �x1�Xu�Y���v-���ֺ��N������JP��a�2`�e5��w��u;�6�i���̃��(K���ťa��(l51��JL��O'%���]���ٖ뿉!��{*�p+f ���i8��D�ȑ���ܩ�M��V��ӟz��x�7Z�1i}�^͜���6e����x��)u�d�ˏ�V�eG�\�X1�����=n�U'�~Y����L�\,�(d!x ,�:�TW8� M`r���@��r+v�Q0��>^;˴�VbF��('����� �*O��i��j�Ӆ����^�S3&� ���{������.ی�� N;��NU%d0�Ce\r"�C�b��&t7N�7��� �ȪD�[%l�۪�$��'m?�A9tI�9>��NVL ��� 6v~M�����ъ�B���0����9$&=ώm��W�0���L���&��E���f�f��'+�9��hv��7,���M��6�D�&�^� �����8 D֮�����o��k^z��O��hP�8q�5d*��YVq3�{��������#LX4�?��jP=3�~�؅c�ݰ�̱�ұ��8̲��2�G�����j��έ�9��w7���U�X�w�85C��?!I&���o&����L���I#�^�eV�,�^t5�k� �xs˛\��U�8��."���{���ǵ�l4��ݼ�;��r"���G�/~���gJV�N糦��ZZ^k+NN�D��I$�=OE�z����|*�*{��%k���G��>�`9��b;�s���8,�qs��c��.b��q�%�>r��n�R�Ƨ�%�,�A��le#�8���}; 21�0�b�&�QX�f���q�00����$>�h�N�'�a3��A���/�r ��L5�8�GԲ'�����w;��c#�q1���h$*��V^�k��QĽ�b:i������� ����H F#�_���,��]g����Ը����`RUU���� ��"�qD���>-��ϤI�~��3�̴�����NZ[[555�eeek7�m����YF#[��Đ��R��i��L�H�r ��@��J-�Pŝ��_|�-��6y��ks�V�U~��6���w.����(��0A� 4��f��� /���C�xŊ�ٳ����z=6�����rg���mKo��o�/����a�g���?'9%9��P��斓��~���L{�� �H��{AW��B��$����v�1b�&Mb�ر��ر#�0`�`xMBp! )Z�Nmo�mZ�g�}�eذaWTVV ���'99��C5��&�&+5�bT>|8��PUUETT����&���t��~TE%��'������b�tEGG;RSS�S�N�v��ѯ��t����u1@�ޚ"f��͈���r'L�Ph��m��ƌ�74o��`�x�q�P���NRSS�X,�����l&&&��MFFA!-��`��ҷ�n��Yuu�����x<I�LB%����KԒ50�!�3�bz�����ʸKL���;---�l6[��`��������Ȏ;�����egg4��!D�T��jWujyZ��������K����%����p�^���X,6��sV=�ܖ����6�3�X ���4ҿ��A2�&����_k�;d�� �VfOIEND�B`� 0x0x
PHP 8.1.34
Preview: core-data.min.js Size: 245.94 KB
/home2/astrociv/public_html/vaastruelogy.in/WordPress-master/wp-includes/js/dist/core-data.min.js
/*! This file is auto-generated */
(function() {
"use strict";var wp;(wp||={}).coreData=(()=>{var Yg=Object.create;var ls=Object.defineProperty;var Hg=Object.getOwnPropertyDescriptor;var Gg=Object.getOwnPropertyNames;var zg=Object.getPrototypeOf,qg=Object.prototype.hasOwnProperty;var q=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Qe=(e,t)=>{for(var r in t)ls(e,r,{get:t[r],enumerable:!0})},Ru=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Gg(t))!qg.call(e,o)&&o!==r&&ls(e,o,{get:()=>t[o],enumerable:!(n=Hg(t,o))||n.enumerable});return e};var g=(e,t,r)=>(r=e!=null?Yg(zg(e)):{},Ru(t||!e||!e.__esModule?ls(r,"default",{value:e,enumerable:!0}):r,e)),Kg=e=>Ru(ls({},"__esModule",{value:!0}),e);var H=q((ZC,Tu)=>{Tu.exports=window.wp.data});var le=q((tx,Iu)=>{"use strict";Iu.exports=function e(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;var n,o,s;if(Array.isArray(t)){if(n=t.length,n!=r.length)return!1;for(o=n;o--!==0;)if(!e(t[o],r[o]))return!1;return!0}if(t instanceof Map&&r instanceof Map){if(t.size!==r.size)return!1;for(o of t.entries())if(!r.has(o[0]))return!1;for(o of t.entries())if(!e(o[1],r.get(o[0])))return!1;return!0}if(t instanceof Set&&r instanceof Set){if(t.size!==r.size)return!1;for(o of t.entries())if(!r.has(o[0]))return!1;return!0}if(ArrayBuffer.isView(t)&&ArrayBuffer.isView(r)){if(n=t.length,n!=r.length)return!1;for(o=n;o--!==0;)if(t[o]!==r[o])return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if(s=Object.keys(t),n=s.length,n!==Object.keys(r).length)return!1;for(o=n;o--!==0;)if(!Object.prototype.hasOwnProperty.call(r,s[o]))return!1;for(o=n;o--!==0;){var i=s[o];if(!e(t[i],r[i]))return!1}return!0}return t!==t&&r!==r}});var In=q((ex,Au)=>{Au.exports=window.wp.compose});var Du=q((rx,ku)=>{ku.exports=window.wp.undoManager});var Ft=q((wx,Mu)=>{Mu.exports=window.wp.apiFetch});var hi=q((y0,Ld)=>{Ld.exports=window.wp.hooks});var vi=q((bR,pp)=>{pp.exports=window.wp.warning});var Ne=q((jR,Sp)=>{Sp.exports=window.wp.blocks});var Pe=q((FR,_p)=>{_p.exports=window.wp.i18n});var Ir=q(($R,bp)=>{bp.exports=window.wp.blockEditor});var Np=q((cT,Mp)=>{Mp.exports=window.wp.privateApis});var Ro=q((pT,Yp)=>{Yp.exports=window.wp.richText});var jh=q((VI,Bh)=>{"use strict";function Lr(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Lr=function(t){return typeof t}:Lr=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Lr(e)}function b_(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ph(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function v_(e,t,r){return t&&Ph(e.prototype,t),r&&Ph(e,r),e}function Vh(e,t){var r=e._map,n=e._arrayTreeMap,o=e._objectTreeMap;if(r.has(t))return r.get(t);for(var s=Object.keys(t).sort(),i=Array.isArray(t)?n:o,a=0;a<s.length;a++){var c=s[a];if(i=i.get(c),i===void 0)return;var l=t[c];if(i=i.get(l),i===void 0)return}var u=i.get("_ekm_value");if(u)return r.delete(u[0]),u[0]=t,i.set("_ekm_value",u),r.set(t,u),u}var C_=(function(){function e(t){if(b_(this,e),this.clear(),t instanceof e){var r=[];t.forEach(function(o,s){r.push([s,o])}),t=r}if(t!=null)for(var n=0;n<t.length;n++)this.set(t[n][0],t[n][1])}return v_(e,[{key:"set",value:function(r,n){if(r===null||Lr(r)!=="object")return this._map.set(r,n),this;for(var o=Object.keys(r).sort(),s=[r,n],i=Array.isArray(r)?this._arrayTreeMap:this._objectTreeMap,a=0;a<o.length;a++){var c=o[a];i.has(c)||i.set(c,new e),i=i.get(c);var l=r[c];i.has(l)||i.set(l,new e),i=i.get(l)}var u=i.get("_ekm_value");return u&&this._map.delete(u[0]),i.set("_ekm_value",s),this._map.set(r,s),this}},{key:"get",value:function(r){if(r===null||Lr(r)!=="object")return this._map.get(r);var n=Vh(this,r);if(n)return n[1]}},{key:"has",value:function(r){return r===null||Lr(r)!=="object"?this._map.has(r):Vh(this,r)!==void 0}},{key:"delete",value:function(r){return this.has(r)?(this.set(r,void 0),!0):!1}},{key:"forEach",value:function(r){var n=this,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this;this._map.forEach(function(s,i){i!==null&&Lr(i)==="object"&&(s=s[1]),r.call(o,s,i,n)})}},{key:"clear",value:function(){this._map=new Map,this._arrayTreeMap=new Map,this._objectTreeMap=new Map}},{key:"size",get:function(){return this._map.size}}]),e})();Bh.exports=C_});var je=q((BI,Fh)=>{Fh.exports=window.wp.url});var Mr=q((oA,Xh)=>{Xh.exports=window.wp.deprecated});var Sm=q((UA,wm)=>{wm.exports=window.wp.notices});var Vo=q((LA,_m)=>{_m.exports=window.wp.htmlEntities});var Wt=q((l1,Gm)=>{Gm.exports=window.wp.element});var Qt=q((f1,qm)=>{qm.exports=window.ReactJSXRuntime});var Nr=q((ak,vg)=>{vg.exports=window.wp.primitives});var la=q((Tk,Tg)=>{Tg.exports=window.wp.components});var JC={};Qe(JC,{EntityProvider:()=>Km,PrivateEntityProvider:()=>Qi,__experimentalFetchLinkSuggestions:()=>Cm,__experimentalFetchUrlData:()=>Rm,__experimentalUseEntityRecord:()=>Xm,__experimentalUseEntityRecords:()=>eg,__experimentalUseResourcePermissions:()=>lg,fetchBlockPatterns:()=>Zl,privateApis:()=>Bg,store:()=>Ut,useEntityBlockEditor:()=>mg,useEntityId:()=>xn,useEntityProp:()=>gg,useEntityRecord:()=>su,useEntityRecords:()=>Zi,useResourcePermissions:()=>cg});var ga=g(H(),1);var kl=g(le(),1),Wh=g(In(),1),Po=g(H(),1),Qh=g(Du(),1);var Ou=g(le(),1);function An(e,t){return t?Object.fromEntries(Object.entries(e).map(([r,n])=>{let o=t[r]?.raw??t[r];return[r,(0,Ou.default)(n,o)?void 0:n]})):e}var Uu=g(le(),1);function Ea(e,t){if(!e)return t;let r=!1,n={};for(let o in t)(0,Uu.default)(e[o],t[o])?n[o]=e[o]:(r=!0,n[o]=t[o]);if(!r)return e;for(let o in e)n.hasOwnProperty(o)||(n[o]=e[o]);return n}function Wg(e){return typeof e=="string"?e.split(","):Array.isArray(e)?e:null}var nt=Wg;function Je(e,t,r){if(!e||typeof e!="object")return e;let n=Array.isArray(t)?t:t.split(".");return n.reduce((o,s,i)=>(o[s]===void 0&&(Number.isInteger(n[i+1])?o[s]=[]:o[s]={}),i===n.length-1&&(o[s]=r),o[s]),e),e}var Lu=new WeakMap;function us(e,t){let r=nt(t)??[],n=r.join(","),o=Lu.get(e);if(o){let i=o.get(n);if(i!==void 0)return i}else e!==null&&typeof e=="object"&&(o=new Map,Lu.set(e,o));let s={};for(let i=0;i<r.length;i++){let a=r[i].split("."),c=e;a.forEach(l=>{c=c?.[l]}),Je(s,a,c)}return o?.set(n,s),s}var Qg=e=>t=>(r,n)=>r===void 0||e(n)?t(r,n):r,kn=Qg;var Jg=e=>(...t)=>async({resolveSelect:r})=>{await r[e](...t)},Xe=Jg;var Xg=e=>t=>(r,n)=>t(r,e(n)),Dn=Xg;function Zg(e){let t=new WeakMap;return r=>{let n;return t.has(r)?n=t.get(r):(n=e(r),r!==null&&typeof r=="object"&&t.set(r,n)),n}}var wa=Zg;function Sa(e,t,r){if(!e||typeof e!="object"||typeof t!="string"&&!Array.isArray(t))return e;let n=Array.isArray(t)?t:t.split("."),o=e;return n.forEach(s=>{o=o?.[s]}),o!==void 0?o:r}function On(e){return/^\s*\d+\s*$/.test(e)}var Un=["create","read","update","delete"];function Ln(e){let t={},r={create:"POST",read:"GET",update:"PUT",delete:"DELETE"};for(let[n,o]of Object.entries(r))t[n]=e?e.includes(o):!1;return t}function Ze(e,t,r){return(typeof t=="object"?[e,t.kind,t.name,t.id]:[e,t,r]).filter(Boolean).join("/")}var Mn=Symbol("RECEIVE_INTERMEDIATE_RESULTS");function fs(e){if(!e)return;let t=Object.entries(e).filter(([r,n])=>(r==="context"||r==="_fields")&&n!==void 0&&n!==null);return t.length>0?Object.fromEntries(t):void 0}var Lh=g(Ft(),1);var xl=g(le(),1),Cn=g(H(),1);var b={};Qe(b,{AbsolutePosition:()=>Ws,AbstractConnector:()=>cc,AbstractStruct:()=>un,AbstractType:()=>K,Array:()=>mr,ContentAny:()=>Ue,ContentBinary:()=>wr,ContentDeleted:()=>fn,ContentDoc:()=>Sr,ContentEmbed:()=>me,ContentFormat:()=>W,ContentJSON:()=>fo,ContentString:()=>Ht,ContentType:()=>Vt,Doc:()=>ne,GC:()=>Et,ID:()=>de,Item:()=>N,Map:()=>gr,PermanentUserData:()=>uc,RelativePosition:()=>cn,Skip:()=>ct,Snapshot:()=>so,Text:()=>ln,Transaction:()=>Js,UndoManager:()=>dr,UpdateDecoderV1:()=>Rt,UpdateDecoderV2:()=>St,UpdateEncoderV1:()=>oe,UpdateEncoderV2:()=>At,XmlElement:()=>Er,XmlFragment:()=>yr,XmlHook:()=>uo,XmlText:()=>oi,YArrayEvent:()=>ti,YEvent:()=>hr,YMapEvent:()=>ei,YTextEvent:()=>ri,YXmlEvent:()=>ni,applyUpdate:()=>bc,applyUpdateV2:()=>Gt,cleanupYTextFormatting:()=>vd,compareIDs:()=>cr,compareRelativePositions:()=>YE,convertUpdateFormatV1ToV2:()=>lw,convertUpdateFormatV2ToV1:()=>id,createAbsolutePositionFromRelativePosition:()=>$E,createDeleteSet:()=>ii,createDeleteSetFromStructStore:()=>wc,createDocFromSnapshot:()=>KE,createID:()=>D,createRelativePositionFromJSON:()=>LE,createRelativePositionFromTypeIndex:()=>NE,createSnapshot:()=>Ic,decodeRelativePosition:()=>jE,decodeSnapshot:()=>zE,decodeSnapshotV2:()=>li,decodeStateVector:()=>Cc,decodeUpdate:()=>rw,decodeUpdateV2:()=>td,diffUpdate:()=>iw,diffUpdateV2:()=>Ac,emptySnapshot:()=>qE,encodeRelativePosition:()=>VE,encodeSnapshot:()=>GE,encodeSnapshotV2:()=>ci,encodeStateAsUpdate:()=>vc,encodeStateAsUpdateV2:()=>ge,encodeStateVector:()=>Rc,encodeStateVectorFromUpdate:()=>nw,encodeStateVectorFromUpdateV2:()=>rd,equalDeleteSets:()=>ai,equalSnapshots:()=>HE,findIndexSS:()=>Pt,findRootTypeKey:()=>Tc,getItem:()=>lr,getItemCleanEnd:()=>pc,getItemCleanStart:()=>yt,getState:()=>F,getTypeChildren:()=>pw,isDeleted:()=>_r,isParentOf:()=>oo,iterateDeletedStructs:()=>ur,logType:()=>OE,logUpdate:()=>ew,logUpdateV2:()=>Zf,mergeDeleteSets:()=>pe,mergeUpdates:()=>ed,mergeUpdatesV2:()=>pr,obfuscateUpdate:()=>aw,obfuscateUpdateV2:()=>cw,parseUpdateMeta:()=>ow,parseUpdateMetaV2:()=>nd,readUpdate:()=>IE,readUpdateV2:()=>_c,relativePositionToJSON:()=>UE,snapshot:()=>po,snapshotContainsUpdate:()=>QE,transact:()=>M,tryGc:()=>ZE,typeListToArraySnapshot:()=>hw,typeMapGetAllSnapshot:()=>Ed,typeMapGetSnapshot:()=>yw});var G=()=>new Map,ds=e=>{let t=G();return e.forEach((r,n)=>{t.set(n,r)}),t},mt=(e,t,r)=>{let n=e.get(t);return n===void 0&&e.set(t,n=r()),n},Nu=(e,t)=>{let r=[];for(let[n,o]of e)r.push(t(o,n));return r},Pu=(e,t)=>{for(let[r,n]of e)if(t(n,r))return!0;return!1};var Xt=()=>new Set;var ps=e=>e[e.length-1];var Vu=(e,t)=>{for(let r=0;r<t.length;r++)e.push(t[r])},$t=Array.from,hs=(e,t)=>{for(let r=0;r<e.length;r++)if(!t(e[r],r,e))return!1;return!0},Pn=(e,t)=>{for(let r=0;r<e.length;r++)if(t(e[r],r,e))return!0;return!1};var Bu=(e,t)=>{let r=new Array(e);for(let n=0;n<e;n++)r[n]=t(n,r);return r};var ue=Array.isArray;var ve=class{constructor(){this._observers=G()}on(t,r){return mt(this._observers,t,Xt).add(r),r}once(t,r){let n=(...o)=>{this.off(t,n),r(...o)};this.on(t,n)}off(t,r){let n=this._observers.get(t);n!==void 0&&(n.delete(r),n.size===0&&this._observers.delete(t))}emit(t,r){return $t((this._observers.get(t)||G()).values()).forEach(n=>n(...r))}destroy(){this._observers=G()}},ms=class{constructor(){this._observers=G()}on(t,r){mt(this._observers,t,Xt).add(r)}once(t,r){let n=(...o)=>{this.off(t,n),r(...o)};this.on(t,n)}off(t,r){let n=this._observers.get(t);n!==void 0&&(n.delete(r),n.size===0&&this._observers.delete(t))}emit(t,r){return $t((this._observers.get(t)||G()).values()).forEach(n=>n(...r))}destroy(){this._observers=G()}};var ot=Math.floor;var tr=Math.abs;var gs=(e,t)=>e<t?e:t,fe=(e,t)=>e>t?e:t,_x=Number.isNaN;var ys=e=>e!==0?e<0:1/e<0;var jr=Number.MAX_SAFE_INTEGER,ba=Number.MIN_SAFE_INTEGER,bx=1<<31;var ju=Number.isInteger||(e=>typeof e=="number"&&isFinite(e)&&ot(e)===e),vx=Number.isNaN,Cx=Number.parseInt;var Bn=String.fromCharCode,ty=String.fromCodePoint,xx=Bn(65535),ey=e=>e.toLowerCase(),ry=/^\s*/g,ny=e=>e.replace(ry,""),oy=/([A-Z])/g,Ca=(e,t)=>ny(e.replace(oy,r=>`${t}${ey(r)}`));var sy=e=>{let t=unescape(encodeURIComponent(e)),r=t.length,n=new Uint8Array(r);for(let o=0;o<r;o++)n[o]=t.codePointAt(o);return n},$r=typeof TextEncoder<"u"?new TextEncoder:null,iy=e=>$r.encode(e),Fu=$r?iy:sy;var Fr=typeof TextDecoder>"u"?null:new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0});Fr&&Fr.decode(new Uint8Array).length===1&&(Fr=null);var Es=(e,t)=>Bu(t,()=>e).join("");var er=class{constructor(){this.cpos=0,this.cbuf=new Uint8Array(100),this.bufs=[]}},Yt=()=>new er;var ay=e=>{let t=e.cpos;for(let r=0;r<e.bufs.length;r++)t+=e.bufs[r].length;return t};var gt=e=>{let t=new Uint8Array(ay(e)),r=0;for(let n=0;n<e.bufs.length;n++){let o=e.bufs[n];t.set(o,r),r+=o.length}return t.set(new Uint8Array(e.cbuf.buffer,0,e.cpos),r),t},cy=(e,t)=>{let r=e.cbuf.length;r-e.cpos<t&&(e.bufs.push(new Uint8Array(e.cbuf.buffer,0,e.cpos)),e.cbuf=new Uint8Array(fe(r,t)*2),e.cpos=0)},tt=(e,t)=>{let r=e.cbuf.length;e.cpos===r&&(e.bufs.push(e.cbuf),e.cbuf=new Uint8Array(r*2),e.cpos=0),e.cbuf[e.cpos++]=t};var qr=tt;var x=(e,t)=>{for(;t>127;)tt(e,128|127&t),t=ot(t/128);tt(e,127&t)},Fn=(e,t)=>{let r=ys(t);for(r&&(t=-t),tt(e,(t>63?128:0)|(r?64:0)|63&t),t=ot(t/64);t>0;)tt(e,(t>127?128:0)|127&t),t=ot(t/128)},xa=new Uint8Array(3e4),ly=xa.length/3,uy=(e,t)=>{if(t.length<ly){let r=$r.encodeInto(t,xa).written||0;x(e,r);for(let n=0;n<r;n++)tt(e,xa[n])}else st(e,Fu(t))},fy=(e,t)=>{let r=unescape(encodeURIComponent(t)),n=r.length;x(e,n);for(let o=0;o<n;o++)tt(e,r.codePointAt(o))},Ce=$r&&$r.encodeInto?uy:fy;var zu=(e,t)=>Kr(e,gt(t)),Kr=(e,t)=>{let r=e.cbuf.length,n=e.cpos,o=gs(r-n,t.length),s=t.length-o;e.cbuf.set(t.subarray(0,o),n),e.cpos+=o,s>0&&(e.bufs.push(e.cbuf),e.cbuf=new Uint8Array(fe(r*2,s)),e.cbuf.set(t.subarray(o)),e.cpos=s)},st=(e,t)=>{x(e,t.byteLength),Kr(e,t)},Ra=(e,t)=>{cy(e,t);let r=new DataView(e.cbuf.buffer,e.cpos,t);return e.cpos+=t,r},dy=(e,t)=>Ra(e,4).setFloat32(0,t,!1),py=(e,t)=>Ra(e,8).setFloat64(0,t,!1),hy=(e,t)=>Ra(e,8).setBigInt64(0,t,!1);var Yu=new DataView(new ArrayBuffer(4)),my=e=>(Yu.setFloat32(0,e),Yu.getFloat32(0)===e),Gr=(e,t)=>{switch(typeof t){case"string":tt(e,119),Ce(e,t);break;case"number":ju(t)&&tr(t)<=2147483647?(tt(e,125),Fn(e,t)):my(t)?(tt(e,124),dy(e,t)):(tt(e,123),py(e,t));break;case"bigint":tt(e,122),hy(e,t);break;case"object":if(t===null)tt(e,126);else if(ue(t)){tt(e,117),x(e,t.length);for(let r=0;r<t.length;r++)Gr(e,t[r])}else if(t instanceof Uint8Array)tt(e,116),st(e,t);else{tt(e,118);let r=Object.keys(t);x(e,r.length);for(let n=0;n<r.length;n++){let o=r[n];Ce(e,o),Gr(e,t[o])}}break;case"boolean":tt(e,t?120:121);break;default:tt(e,127)}},jn=class extends er{constructor(t){super(),this.w=t,this.s=null,this.count=0}write(t){this.s===t?this.count++:(this.count>0&&x(this,this.count-1),this.count=1,this.w(this,t),this.s=t)}};var Hu=e=>{e.count>0&&(Fn(e.encoder,e.count===1?e.s:-e.s),e.count>1&&x(e.encoder,e.count-2))},rr=class{constructor(){this.encoder=new er,this.s=0,this.count=0}write(t){this.s===t?this.count++:(Hu(this),this.count=1,this.s=t)}toUint8Array(){return Hu(this),gt(this.encoder)}};var Gu=e=>{if(e.count>0){let t=e.diff*2+(e.count===1?0:1);Fn(e.encoder,t),e.count>1&&x(e.encoder,e.count-2)}},zr=class{constructor(){this.encoder=new er,this.s=0,this.count=0,this.diff=0}write(t){this.diff===t-this.s?(this.s=t,this.count++):(Gu(this),this.count=1,this.diff=t-this.s,this.s=t)}toUint8Array(){return Gu(this),gt(this.encoder)}},ws=class{constructor(){this.sarr=[],this.s="",this.lensE=new rr}write(t){this.s+=t,this.s.length>19&&(this.sarr.push(this.s),this.s=""),this.lensE.write(t.length)}toUint8Array(){let t=new er;return this.sarr.push(this.s),this.s="",Ce(t,this.sarr.join("")),Kr(t,this.lensE.toUint8Array()),gt(t)}};var Tt=e=>new Error(e),It=()=>{throw Tt("Method unimplemented")},et=()=>{throw Tt("Unexpected case")};var qu=Tt("Unexpected end of array"),Ku=Tt("Integer out of Range"),Wr=class{constructor(t){this.arr=t,this.pos=0}},J=e=>new Wr(e),Aa=e=>e.pos!==e.arr.length;var gy=(e,t)=>{let r=new Uint8Array(e.arr.buffer,e.pos+e.arr.byteOffset,t);return e.pos+=t,r},it=e=>gy(e,O(e));var nr=e=>e.arr[e.pos++];var O=e=>{let t=0,r=1,n=e.arr.length;for(;e.pos<n;){let o=e.arr[e.pos++];if(t=t+(o&127)*r,r*=128,o<128)return t;if(t>jr)throw Ku}throw qu},Yn=e=>{let t=e.arr[e.pos++],r=t&63,n=64,o=(t&64)>0?-1:1;if((t&128)===0)return o*r;let s=e.arr.length;for(;e.pos<s;){if(t=e.arr[e.pos++],r=r+(t&127)*n,n*=128,t<128)return o*r;if(r>jr)throw Ku}throw qu};var yy=e=>{let t=O(e);if(t===0)return"";{let r=String.fromCodePoint(nr(e));if(--t<100)for(;t--;)r+=String.fromCodePoint(nr(e));else for(;t>0;){let n=t<1e4?t:1e4,o=e.arr.subarray(e.pos,e.pos+n);e.pos+=n,r+=String.fromCodePoint.apply(null,o),t-=n}return decodeURIComponent(escape(r))}},Ey=e=>Fr.decode(it(e)),Re=Fr?Ey:yy;var ka=(e,t)=>{let r=new DataView(e.arr.buffer,e.arr.byteOffset+e.pos,t);return e.pos+=t,r},wy=e=>ka(e,4).getFloat32(0,!1),Sy=e=>ka(e,8).getFloat64(0,!1),_y=e=>ka(e,8).getBigInt64(0,!1);var by=[e=>{},e=>null,Yn,wy,Sy,_y,e=>!1,e=>!0,Re,e=>{let t=O(e),r={};for(let n=0;n<t;n++){let o=Re(e);r[o]=Qr(e)}return r},e=>{let t=O(e),r=[];for(let n=0;n<t;n++)r.push(Qr(e));return r},it],Qr=e=>by[127-nr(e)](e),$n=class extends Wr{constructor(t,r){super(t),this.reader=r,this.s=null,this.count=0}read(){return this.count===0&&(this.s=this.reader(this),Aa(this)?this.count=O(this)+1:this.count=-1),this.count--,this.s}};var or=class extends Wr{constructor(t){super(t),this.s=0,this.count=0}read(){if(this.count===0){this.s=Yn(this);let t=ys(this.s);this.count=1,t&&(this.s=-this.s,this.count=O(this)+2)}return this.count--,this.s}};var Jr=class extends Wr{constructor(t){super(t),this.s=0,this.count=0,this.diff=0}read(){if(this.count===0){let t=Yn(this),r=t&1;this.diff=ot(t/2),this.count=1,r&&(this.count=O(this)+2)}return this.s+=this.diff,this.count--,this.s}},Ss=class{constructor(t){this.decoder=new or(t),this.str=Re(this.decoder),this.spos=0}read(){let t=this.spos+this.decoder.read(),r=this.str.slice(this.spos,t);return this.spos=t,r}};var Ix=crypto.subtle,Wu=crypto.getRandomValues.bind(crypto);var Oa=()=>Wu(new Uint32Array(1))[0];var vy="10000000-1000-4000-8000"+-1e11,Qu=()=>vy.replace(/[018]/g,e=>(e^Oa()&15>>e/4).toString(16));var Te=Date.now;var La=e=>new Promise(e);var Dx=Promise.all.bind(Promise);var Ma=e=>e===void 0?null:e;var Na=class{constructor(){this.map=new Map}setItem(t,r){this.map.set(t,r)}getItem(t){return this.map.get(t)}},Ju=new Na,Ty=!0;try{typeof localStorage<"u"&&localStorage&&(Ju=localStorage,Ty=!1)}catch{}var Xu=Ju;var sr=Symbol("Equality"),_s=(e,t)=>e===t||!!e?.[sr]?.(t)||!1;var Zu=e=>typeof e=="object",tf=Object.assign,Ay=Object.keys;var ef=(e,t)=>{for(let r in e)t(e[r],r)};var Hn=e=>Ay(e).length;var rf=e=>{for(let t in e)return!1;return!0},Xr=(e,t)=>{for(let r in e)if(!t(e[r],r))return!1;return!0},Gn=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),Va=(e,t)=>e===t||Hn(e)===Hn(t)&&Xr(e,(r,n)=>(r!==void 0||Gn(t,n))&&_s(t[n],r)),ky=Object.freeze,Ba=e=>{for(let t in e){let r=e[t];(typeof r=="object"||typeof r=="function")&&Ba(e[t])}return ky(e)};var zn=(e,t,r=0)=>{try{for(;r<e.length;r++)e[r](...t)}finally{r<e.length&&zn(e,t,r+1)}};var Fa=e=>e;var ir=(e,t)=>{if(e===t)return!0;if(e==null||t==null||e.constructor!==t.constructor&&(e.constructor||Object)!==(t.constructor||Object))return!1;if(e[sr]!=null)return e[sr](t);switch(e.constructor){case ArrayBuffer:e=new Uint8Array(e),t=new Uint8Array(t);case Uint8Array:{if(e.byteLength!==t.byteLength)return!1;for(let r=0;r<e.length;r++)if(e[r]!==t[r])return!1;break}case Set:{if(e.size!==t.size)return!1;for(let r of e)if(!t.has(r))return!1;break}case Map:{if(e.size!==t.size)return!1;for(let r of e.keys())if(!t.has(r)||!ir(e.get(r),t.get(r)))return!1;break}case void 0:case Object:if(Hn(e)!==Hn(t))return!1;for(let r in e)if(!Gn(e,r)||!ir(e[r],t[r]))return!1;break;case Array:if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(!ir(e[r],t[r]))return!1;break;default:return!1}return!0},nf=(e,t)=>t.includes(e);var Zr=typeof process<"u"&&process.release&&/node|io\.js/.test(process.release.name)&&Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]",vs=typeof window<"u"&&typeof document<"u"&&!Zr,Ox=typeof navigator<"u"?/Mac/.test(navigator.platform):!1,Zt,Dy=[],Oy=()=>{if(Zt===void 0)if(Zr){Zt=G();let e=process.argv,t=null;for(let r=0;r<e.length;r++){let n=e[r];n[0]==="-"?(t!==null&&Zt.set(t,""),t=n):t!==null?(Zt.set(t,n),t=null):Dy.push(n)}t!==null&&Zt.set(t,"")}else typeof location=="object"?(Zt=G(),(location.search||"?").slice(1).split("&").forEach(e=>{if(e.length!==0){let[t,r]=e.split("=");Zt.set(`--${Ca(t,"-")}`,r),Zt.set(`-${Ca(t,"-")}`,r)}})):Zt=G();return Zt},$a=e=>Oy().has(e);var qn=e=>Zr?Ma(process.env[e.toUpperCase().replaceAll("-","_")]):Ma(Xu.getItem(e));var of=e=>$a("--"+e)||qn(e)!==null,sf=of("production"),Uy=Zr&&nf(process.env.FORCE_COLOR,["true","1","2"]),af=Uy||!$a("--no-colors")&&!of("no-color")&&(!Zr||process.stdout.isTTY)&&(!Zr||$a("--color")||qn("COLORTERM")!==null||(qn("TERM")||"").includes("color"));var cf=e=>new Uint8Array(e),Ly=(e,t,r)=>new Uint8Array(e,t,r);var My=e=>{let t="";for(let r=0;r<e.byteLength;r++)t+=Bn(e[r]);return btoa(t)},Ny=e=>Buffer.from(e.buffer,e.byteOffset,e.byteLength).toString("base64"),Py=e=>{let t=atob(e),r=cf(t.length);for(let n=0;n<t.length;n++)r[n]=t.charCodeAt(n);return r},Vy=e=>{let t=Buffer.from(e,"base64");return Ly(t.buffer,t.byteOffset,t.byteLength)},xs=vs?My:Ny,Rs=vs?Py:Vy;var lf=e=>{let t=cf(e.byteLength);return t.set(e),t};var Ha=class{constructor(t,r){this.left=t,this.right=r}},te=(e,t)=>new Ha(e,t);var Ga=e=>e.next()>=.5,Ts=(e,t,r)=>ot(e.next()*(r+1-t)+t);var za=(e,t,r)=>ot(e.next()*(r+1-t)+t);var qa=(e,t,r)=>za(e,t,r);var jy=e=>Bn(qa(e,97,122)),uf=(e,t=0,r=20)=>{let n=qa(e,t,r),o="";for(let s=0;s<n;s++)o+=jy(e);return o};var Is=(e,t)=>t[qa(e,0,t.length-1)];var $y=Symbol("0schema"),Ka=class{constructor(){this._rerrs=[]}extend(t,r,n,o=null){this._rerrs.push({path:t,expected:r,has:n,message:o})}toString(){let t=[];for(let r=this._rerrs.length-1;r>0;r--){let n=this._rerrs[r];t.push(Es(" ",(this._rerrs.length-r)*2)+`${n.path!=null?`[${n.path}] `:""}${n.has} doesn't match ${n.expected}. ${n.message}`)}return t.join(`
`)}},Wa=(e,t)=>e===t?!0:e==null||t==null||e.constructor!==t.constructor?!1:e[sr]?_s(e,t):ue(e)?hs(e,r=>Pn(t,n=>Wa(r,n))):Zu(e)?Xr(e,(r,n)=>Wa(r,t[n])):!1,at=class{static _dilutes=!1;extends(t){let[r,n]=[this.shape,t.shape];return this.constructor._dilutes&&([n,r]=[r,n]),Wa(r,n)}equals(t){return this.constructor===t.constructor&&ir(this.shape,t.shape)}[$y](){return!0}[sr](t){return this.equals(t)}validate(t){return this.check(t)}check(t,r){It()}get nullable(){return on(this,js)}get optional(){return new As(this)}cast(t){return ff(t,this),t}expect(t){return ff(t,this),t}},Kn=class extends at{constructor(t,r){super(),this.shape=t,this._c=r}check(t,r=void 0){let n=t?.constructor===this.shape&&(this._c==null||this._c(t));return!n&&r?.extend(null,this.shape.name,t?.constructor.name,t?.constructor!==this.shape?"Constructor match failed":"Check failed"),n}},X=(e,t=null)=>new Kn(e,t),Lx=X(Kn),Wn=class extends at{constructor(t){super(),this.shape=t}check(t,r){let n=this.shape(t);return!n&&r?.extend(null,"custom prop",t?.constructor.name,"failed to check custom prop"),n}},Z=e=>new Wn(e),Mx=X(Wn),rn=class extends at{constructor(t){super(),this.shape=t}check(t,r){let n=this.shape.some(o=>o===t);return!n&&r?.extend(null,this.shape.join(" | "),t.toString()),n}},Vs=(...e)=>new rn(e),df=X(rn),Yy=RegExp.escape||(e=>e.replace(/[().|&,$^[\]]/g,t=>"\\"+t)),pf=e=>{if(nn.check(e))return[Yy(e)];if(df.check(e))return e.shape.map(t=>t+"");if(Ef.check(e))return["[+-]?\\d+.?\\d*"];if(wf.check(e))return[".*"];if(Ns.check(e))return e.shape.map(pf).flat(1);et()},Qa=class extends at{constructor(t){super(),this.shape=t,this._r=new RegExp("^"+t.map(pf).map(r=>`(${r.join("|")})`).join("")+"$")}check(t,r){let n=this._r.exec(t)!=null;return!n&&r?.extend(null,this._r.toString(),t.toString(),"String doesn't match string template."),n}};var Nx=X(Qa),Hy=Symbol("optional"),As=class extends at{constructor(t){super(),this.shape=t}check(t,r){let n=t===void 0||this.shape.check(t);return!n&&r?.extend(null,"undefined (optional)","()"),n}get[Hy](){return!0}},Gy=X(As),ks=class extends at{check(t,r){return r?.extend(null,"never",typeof t),!1}},Px=new ks,Vx=X(ks),Ds=class e extends at{constructor(t,r=!1){super(),this.shape=t,this._isPartial=r}static _dilutes=!0;get partial(){return new e(this.shape,!0)}check(t,r){return t==null?(r?.extend(null,"object","null"),!1):Xr(this.shape,(n,o)=>{let s=this._isPartial&&!Gn(t,o)||n.check(t[o],r);return!s&&r?.extend(o.toString(),n.toString(),typeof t[o],"Object property does not match"),s})}},zy=e=>new Ds(e),qy=X(Ds),Ky=Z(e=>e!=null&&(e.constructor===Object||e.constructor==null)),Os=class extends at{constructor(t,r){super(),this.shape={keys:t,values:r}}check(t,r){return t!=null&&Xr(t,(n,o)=>{let s=this.shape.keys.check(o,r);return!s&&r?.extend(o+"","Record",typeof t,s?"Key doesn't match schema":"Value doesn't match value"),s&&this.shape.values.check(n,r)})}},hf=(e,t)=>new Os(e,t),Wy=X(Os),Us=class extends at{constructor(t){super(),this.shape=t}check(t,r){return t!=null&&Xr(this.shape,(n,o)=>{let s=n.check(t[o],r);return!s&&r?.extend(o.toString(),"Tuple",typeof n),s})}},Qy=(...e)=>new Us(e),Bx=X(Us),Ls=class extends at{constructor(t){super(),this.shape=t.length===1?t[0]:new Qn(t)}check(t,r){let n=ue(t)&&hs(t,o=>this.shape.check(o));return!n&&r?.extend(null,"Array",""),n}},mf=(...e)=>new Ls(e),Jy=X(Ls),Xy=Z(e=>ue(e)),Ms=class extends at{constructor(t,r){super(),this.shape=t,this._c=r}check(t,r){let n=t instanceof this.shape&&(this._c==null||this._c(t));return!n&&r?.extend(null,this.shape.name,t?.constructor.name),n}},Zy=(e,t=null)=>new Ms(e,t),jx=X(Ms),tE=Zy(at),Ja=class extends at{constructor(t){super(),this.len=t.length-1,this.args=Qy(...t.slice(-1)),this.res=t[this.len]}check(t,r){let n=t.constructor===Function&&t.length<=this.len;return!n&&r?.extend(null,"function",typeof t),n}};var eE=X(Ja),rE=Z(e=>typeof e=="function"),Xa=class extends at{constructor(t){super(),this.shape=t}check(t,r){let n=hs(this.shape,o=>o.check(t,r));return!n&&r?.extend(null,"Intersectinon",typeof t),n}};var Fx=X(Xa,e=>e.shape.length>0),Qn=class extends at{static _dilutes=!0;constructor(t){super(),this.shape=t}check(t,r){let n=Pn(this.shape,o=>o.check(t,r));return r?.extend(null,"Union",typeof t),n}},on=(...e)=>e.findIndex(t=>Ns.check(t))>=0?on(...e.map(t=>Jn(t)).map(t=>Ns.check(t)?t.shape:[t]).flat(1)):e.length===1?e[0]:new Qn(e),Ns=X(Qn),gf=()=>!0,Ps=Z(gf),nE=X(Wn,e=>e.shape===gf),tc=Z(e=>typeof e=="bigint"),oE=Z(e=>e===tc),yf=Z(e=>typeof e=="symbol"),$x=Z(e=>e===yf),en=Z(e=>typeof e=="number"),Ef=Z(e=>e===en),nn=Z(e=>typeof e=="string"),wf=Z(e=>e===nn),Bs=Z(e=>typeof e=="boolean"),sE=Z(e=>e===Bs),Sf=Vs(void 0),Yx=X(rn,e=>e.shape.length===1&&e.shape[0]===void 0),Hx=Vs(void 0);var js=Vs(null),iE=X(rn,e=>e.shape.length===1&&e.shape[0]===null),Gx=X(Uint8Array),zx=X(Kn,e=>e.shape===Uint8Array),aE=on(en,nn,js,Sf,tc,Bs,yf),qx=(()=>{let e=mf(Ps),t=hf(nn,Ps),r=on(en,nn,js,Bs,e,t);return e.shape=r,t.shape.values=r,r})(),Jn=e=>{if(tE.check(e))return e;if(Ky.check(e)){let t={};for(let r in e)t[r]=Jn(e[r]);return zy(t)}else{if(Xy.check(e))return on(...e.map(Jn));if(aE.check(e))return Vs(e);if(rE.check(e))return X(e)}et()},ff=sf?()=>{}:(e,t)=>{let r=new Ka;if(!t.check(e,r))throw Tt(`Expected value to be of type ${t.constructor.name}.
${r.toString()}`)},Za=class{constructor(t){this.patterns=[],this.$state=t}if(t,r){return this.patterns.push({if:Jn(t),h:r}),this}else(t){return this.if(Ps,t)}done(){return(t,r)=>{for(let n=0;n<this.patterns.length;n++){let o=this.patterns[n];if(o.if.check(t))return o.h(t,r)}throw Tt("Unhandled pattern")}}},cE=e=>new Za(e),_f=cE(Ps).if(Ef,(e,t)=>Ts(t,ba,jr)).if(wf,(e,t)=>uf(t)).if(sE,(e,t)=>Ga(t)).if(oE,(e,t)=>BigInt(Ts(t,ba,jr))).if(Ns,(e,t)=>tn(t,Is(t,e.shape))).if(qy,(e,t)=>{let r={};for(let n in e.shape){let o=e.shape[n];if(Gy.check(o)){if(Ga(t))continue;o=o.shape}r[n]=_f(o,t)}return r}).if(Jy,(e,t)=>{let r=[],n=za(t,0,42);for(let o=0;o<n;o++)r.push(tn(t,e.shape));return r}).if(df,(e,t)=>Is(t,e.shape)).if(iE,(e,t)=>null).if(eE,(e,t)=>{let r=tn(t,e.res);return()=>r}).if(nE,(e,t)=>tn(t,Is(t,[en,nn,js,Sf,tc,Bs,mf(en),hf(on("a","b","c"),en)]))).if(Wy,(e,t)=>{let r={},n=Ts(t,0,3);for(let o=0;o<n;o++){let s=tn(t,e.shape.keys),i=tn(t,e.shape.values);r[s]=i}return r}).done(),tn=(e,t)=>_f(Jn(t),e);var ar=typeof document<"u"?document:{};var Kx=Z(e=>e.nodeType===pE);var Wx=typeof DOMParser<"u"?new DOMParser:null;var Qx=Z(e=>e.nodeType===uE);var Jx=Z(e=>e.nodeType===fE);var bf=e=>Nu(e,(t,r)=>`${r}:${t};`).join("");var uE=ar.ELEMENT_NODE,fE=ar.TEXT_NODE,Xx=ar.CDATA_SECTION_NODE,Zx=ar.COMMENT_NODE,dE=ar.DOCUMENT_NODE,t0=ar.DOCUMENT_TYPE_NODE,pE=ar.DOCUMENT_FRAGMENT_NODE,e0=Z(e=>e.nodeType===dE);var ee=Symbol;var Xn=ee(),Zn=ee(),ec=ee(),rc=ee(),nc=ee(),to=ee(),oc=ee(),sn=ee(),sc=ee(),vf=e=>{e.length===1&&e[0]?.constructor===Function&&(e=e[0]());let t=[],r=[],n=0;for(;n<e.length;n++){let o=e[n];if(o===void 0)break;if(o.constructor===String||o.constructor===Number)t.push(o);else if(o.constructor===Object)break}for(n>0&&r.push(t.join(""));n<e.length;n++){let o=e[n];o instanceof Symbol||r.push(o)}return r};var r0=Te();var yE={[Xn]:te("font-weight","bold"),[Zn]:te("font-weight","normal"),[ec]:te("color","blue"),[nc]:te("color","green"),[rc]:te("color","grey"),[to]:te("color","red"),[oc]:te("color","purple"),[sn]:te("color","orange"),[sc]:te("color","black")},EE=e=>{e.length===1&&e[0]?.constructor===Function&&(e=e[0]());let t=[],r=[],n=G(),o=[],s=0;for(;s<e.length;s++){let i=e[s],a=yE[i];if(a!==void 0)n.set(a.left,a.right);else{if(i===void 0)break;if(i.constructor===String||i.constructor===Number){let c=bf(n);s>0||c.length>0?(t.push("%c"+i),r.push(c)):t.push(i)}else break}}for(s>0&&(o=r,o.unshift(t.join("")));s<e.length;s++){let i=e[s];i instanceof Symbol||o.push(i)}return o},Cf=af?EE:vf,Fs=(...e)=>{console.log(...Cf(e)),xf.forEach(t=>t.print(e))},ic=(...e)=>{console.warn(...Cf(e)),e.unshift(sn),xf.forEach(t=>t.print(e))};var xf=Xt();var Rf=e=>({[Symbol.iterator](){return this},next:e}),Tf=(e,t)=>Rf(()=>{let r;do r=e.next();while(!r.done&&!t(r.value));return r}),$s=(e,t)=>Rf(()=>{let{done:r,value:n}=e.next();return{done:r,value:r?void 0:t(n)}});var cc=class extends ve{constructor(t,r){super(),this.doc=t,this.awareness=r}},ro=class{constructor(t,r){this.clock=t,this.len=r}},De=class{constructor(){this.clients=new Map}},ur=(e,t,r)=>t.clients.forEach((n,o)=>{let s=e.doc.store.clients.get(o);if(s!=null){let i=s[s.length-1],a=i.id.clock+i.length;for(let c=0,l=n[c];c<n.length&&l.clock<a;l=n[++c])Wf(e,s,l.clock,l.len,r)}}),vE=(e,t)=>{let r=0,n=e.length-1;for(;r<=n;){let o=ot((r+n)/2),s=e[o],i=s.clock;if(i<=t){if(t<i+s.len)return o;r=o+1}else n=o-1}return null},_r=(e,t)=>{let r=e.clients.get(t.client);return r!==void 0&&vE(r,t.clock)!==null},Ec=e=>{e.clients.forEach(t=>{t.sort((o,s)=>o.clock-s.clock);let r,n;for(r=1,n=1;r<t.length;r++){let o=t[n-1],s=t[r];o.clock+o.len>=s.clock?o.len=fe(o.len,s.clock+s.len-o.clock):(n<r&&(t[n]=s),n++)}t.length=n})},pe=e=>{let t=new De;for(let r=0;r<e.length;r++)e[r].clients.forEach((n,o)=>{if(!t.clients.has(o)){let s=n.slice();for(let i=r+1;i<e.length;i++)Vu(s,e[i].clients.get(o)||[]);t.clients.set(o,s)}});return Ec(t),t},no=(e,t,r,n)=>{mt(e.clients,t,()=>[]).push(new ro(r,n))},ii=()=>new De,wc=e=>{let t=ii();return e.clients.forEach((r,n)=>{let o=[];for(let s=0;s<r.length;s++){let i=r[s];if(i.deleted){let a=i.id.clock,c=i.length;if(s+1<r.length)for(let l=r[s+1];s+1<r.length&&l.deleted;l=r[++s+1])c+=l.length;o.push(new ro(a,c))}}o.length>0&&t.clients.set(n,o)}),t},re=(e,t)=>{x(e.restEncoder,t.clients.size),$t(t.clients.entries()).sort((r,n)=>n[0]-r[0]).forEach(([r,n])=>{e.resetDsCurVal(),x(e.restEncoder,r);let o=n.length;x(e.restEncoder,o);for(let s=0;s<o;s++){let i=n[s];e.writeDsClock(i.clock),e.writeDsLen(i.len)}})},he=e=>{let t=new De,r=O(e.restDecoder);for(let n=0;n<r;n++){e.resetDsCurVal();let o=O(e.restDecoder),s=O(e.restDecoder);if(s>0){let i=mt(t.clients,o,()=>[]);for(let a=0;a<s;a++)i.push(new ro(e.readDsClock(),e.readDsLen()))}}return t},kf=(e,t,r)=>{let n=new De,o=O(e.restDecoder);for(let s=0;s<o;s++){e.resetDsCurVal();let i=O(e.restDecoder),a=O(e.restDecoder),c=r.clients.get(i)||[],l=F(r,i);for(let u=0;u<a;u++){let f=e.readDsClock(),p=f+e.readDsLen();if(f<l){l<p&&no(n,i,l,p-l);let d=Pt(c,f),h=c[d];for(!h.deleted&&h.id.clock<f&&(c.splice(d+1,0,si(t,h,f-h.id.clock)),d++);d<c.length&&(h=c[d++],h.id.clock<p);)h.deleted||(p<h.id.clock+h.length&&c.splice(d,0,si(t,h,p-h.id.clock)),h.delete(t))}else no(n,i,f,p-f)}}if(n.clients.size>0){let s=new At;return x(s.restEncoder,0),re(s,n),s.toUint8Array()}return null},ai=(e,t)=>{if(e.clients.size!==t.clients.size)return!1;for(let[r,n]of e.clients.entries()){let o=t.clients.get(r);if(o===void 0||n.length!==o.length)return!1;for(let s=0;s<n.length;s++){let i=n[s],a=o[s];if(i.clock!==a.clock||i.len!==a.len)return!1}}return!0},Gf=Oa,ne=class e extends ve{constructor({guid:t=Qu(),collectionid:r=null,gc:n=!0,gcFilter:o=()=>!0,meta:s=null,autoLoad:i=!1,shouldLoad:a=!0}={}){super(),this.gc=n,this.gcFilter=o,this.clientID=Gf(),this.guid=t,this.collectionid=r,this.share=new Map,this.store=new Qs,this._transaction=null,this._transactionCleanups=[],this.subdocs=new Set,this._item=null,this.shouldLoad=a,this.autoLoad=i,this.meta=s,this.isLoaded=!1,this.isSynced=!1,this.isDestroyed=!1,this.whenLoaded=La(l=>{this.on("load",()=>{this.isLoaded=!0,l(this)})});let c=()=>La(l=>{let u=f=>{(f===void 0||f===!0)&&(this.off("sync",u),l())};this.on("sync",u)});this.on("sync",l=>{l===!1&&this.isSynced&&(this.whenSynced=c()),this.isSynced=l===void 0||l===!0,this.isSynced&&!this.isLoaded&&this.emit("load",[this])}),this.whenSynced=c()}load(){let t=this._item;t!==null&&!this.shouldLoad&&M(t.parent.doc,r=>{r.subdocsLoaded.add(this)},null,!0),this.shouldLoad=!0}getSubdocs(){return this.subdocs}getSubdocGuids(){return new Set($t(this.subdocs).map(t=>t.guid))}transact(t,r=null){return M(this,t,r)}get(t,r=K){let n=mt(this.share,t,()=>{let s=new r;return s._integrate(this,null),s}),o=n.constructor;if(r!==K&&o!==r)if(o===K){let s=new r;s._map=n._map,n._map.forEach(i=>{for(;i!==null;i=i.left)i.parent=s}),s._start=n._start;for(let i=s._start;i!==null;i=i.right)i.parent=s;return s._length=n._length,this.share.set(t,s),s._integrate(this,null),s}else throw new Error(`Type with the name ${t} has already been defined with a different constructor`);return n}getArray(t=""){return this.get(t,mr)}getText(t=""){return this.get(t,ln)}getMap(t=""){return this.get(t,gr)}getXmlElement(t=""){return this.get(t,Er)}getXmlFragment(t=""){return this.get(t,yr)}toJSON(){let t={};return this.share.forEach((r,n)=>{t[n]=r.toJSON()}),t}destroy(){this.isDestroyed=!0,$t(this.subdocs).forEach(r=>r.destroy());let t=this._item;if(t!==null){this._item=null;let r=t.content;r.doc=new e({guid:this.guid,...r.opts,shouldLoad:!1}),r.doc._item=t,M(t.parent.doc,n=>{let o=r.doc;t.deleted||n.subdocsAdded.add(o),n.subdocsRemoved.add(this)},null,!0)}this.emit("destroyed",[!0]),this.emit("destroy",[this]),super.destroy()}},fr=class{constructor(t){this.restDecoder=t}resetDsCurVal(){}readDsClock(){return O(this.restDecoder)}readDsLen(){return O(this.restDecoder)}},Rt=class extends fr{readLeftID(){return D(O(this.restDecoder),O(this.restDecoder))}readRightID(){return D(O(this.restDecoder),O(this.restDecoder))}readClient(){return O(this.restDecoder)}readInfo(){return nr(this.restDecoder)}readString(){return Re(this.restDecoder)}readParentInfo(){return O(this.restDecoder)===1}readTypeRef(){return O(this.restDecoder)}readLen(){return O(this.restDecoder)}readAny(){return Qr(this.restDecoder)}readBuf(){return lf(it(this.restDecoder))}readJSON(){return JSON.parse(Re(this.restDecoder))}readKey(){return Re(this.restDecoder)}},Ks=class{constructor(t){this.dsCurrVal=0,this.restDecoder=t}resetDsCurVal(){this.dsCurrVal=0}readDsClock(){return this.dsCurrVal+=O(this.restDecoder),this.dsCurrVal}readDsLen(){let t=O(this.restDecoder)+1;return this.dsCurrVal+=t,t}},St=class extends Ks{constructor(t){super(t),this.keys=[],O(t),this.keyClockDecoder=new Jr(it(t)),this.clientDecoder=new or(it(t)),this.leftClockDecoder=new Jr(it(t)),this.rightClockDecoder=new Jr(it(t)),this.infoDecoder=new $n(it(t),nr),this.stringDecoder=new Ss(it(t)),this.parentInfoDecoder=new $n(it(t),nr),this.typeRefDecoder=new or(it(t)),this.lenDecoder=new or(it(t))}readLeftID(){return new de(this.clientDecoder.read(),this.leftClockDecoder.read())}readRightID(){return new de(this.clientDecoder.read(),this.rightClockDecoder.read())}readClient(){return this.clientDecoder.read()}readInfo(){return this.infoDecoder.read()}readString(){return this.stringDecoder.read()}readParentInfo(){return this.parentInfoDecoder.read()===1}readTypeRef(){return this.typeRefDecoder.read()}readLen(){return this.lenDecoder.read()}readAny(){return Qr(this.restDecoder)}readBuf(){return it(this.restDecoder)}readJSON(){return Qr(this.restDecoder)}readKey(){let t=this.keyClockDecoder.read();if(t<this.keys.length)return this.keys[t];{let r=this.stringDecoder.read();return this.keys.push(r),r}}},Oe=class{constructor(){this.restEncoder=Yt()}toUint8Array(){return gt(this.restEncoder)}resetDsCurVal(){}writeDsClock(t){x(this.restEncoder,t)}writeDsLen(t){x(this.restEncoder,t)}},oe=class extends Oe{writeLeftID(t){x(this.restEncoder,t.client),x(this.restEncoder,t.clock)}writeRightID(t){x(this.restEncoder,t.client),x(this.restEncoder,t.clock)}writeClient(t){x(this.restEncoder,t)}writeInfo(t){qr(this.restEncoder,t)}writeString(t){Ce(this.restEncoder,t)}writeParentInfo(t){x(this.restEncoder,t?1:0)}writeTypeRef(t){x(this.restEncoder,t)}writeLen(t){x(this.restEncoder,t)}writeAny(t){Gr(this.restEncoder,t)}writeBuf(t){st(this.restEncoder,t)}writeJSON(t){Ce(this.restEncoder,JSON.stringify(t))}writeKey(t){Ce(this.restEncoder,t)}},an=class{constructor(){this.restEncoder=Yt(),this.dsCurrVal=0}toUint8Array(){return gt(this.restEncoder)}resetDsCurVal(){this.dsCurrVal=0}writeDsClock(t){let r=t-this.dsCurrVal;this.dsCurrVal=t,x(this.restEncoder,r)}writeDsLen(t){t===0&&et(),x(this.restEncoder,t-1),this.dsCurrVal+=t}},At=class extends an{constructor(){super(),this.keyMap=new Map,this.keyClock=0,this.keyClockEncoder=new zr,this.clientEncoder=new rr,this.leftClockEncoder=new zr,this.rightClockEncoder=new zr,this.infoEncoder=new jn(qr),this.stringEncoder=new ws,this.parentInfoEncoder=new jn(qr),this.typeRefEncoder=new rr,this.lenEncoder=new rr}toUint8Array(){let t=Yt();return x(t,0),st(t,this.keyClockEncoder.toUint8Array()),st(t,this.clientEncoder.toUint8Array()),st(t,this.leftClockEncoder.toUint8Array()),st(t,this.rightClockEncoder.toUint8Array()),st(t,gt(this.infoEncoder)),st(t,this.stringEncoder.toUint8Array()),st(t,gt(this.parentInfoEncoder)),st(t,this.typeRefEncoder.toUint8Array()),st(t,this.lenEncoder.toUint8Array()),Kr(t,gt(this.restEncoder)),gt(t)}writeLeftID(t){this.clientEncoder.write(t.client),this.leftClockEncoder.write(t.clock)}writeRightID(t){this.clientEncoder.write(t.client),this.rightClockEncoder.write(t.clock)}writeClient(t){this.clientEncoder.write(t)}writeInfo(t){this.infoEncoder.write(t)}writeString(t){this.stringEncoder.write(t)}writeParentInfo(t){this.parentInfoEncoder.write(t?1:0)}writeTypeRef(t){this.typeRefEncoder.write(t)}writeLen(t){this.lenEncoder.write(t)}writeAny(t){Gr(this.restEncoder,t)}writeBuf(t){st(this.restEncoder,t)}writeJSON(t){Gr(this.restEncoder,t)}writeKey(t){let r=this.keyMap.get(t);r===void 0?(this.keyClockEncoder.write(this.keyClock++),this.stringEncoder.write(t)):this.keyClockEncoder.write(r)}},CE=(e,t,r,n)=>{n=fe(n,t[0].id.clock);let o=Pt(t,n);x(e.restEncoder,t.length-o),e.writeClient(r),x(e.restEncoder,n);let s=t[o];s.write(e,n-s.id.clock);for(let i=o+1;i<t.length;i++)t[i].write(e,0)},Sc=(e,t,r)=>{let n=new Map;r.forEach((o,s)=>{F(t,s)>o&&n.set(s,o)}),ho(t).forEach((o,s)=>{r.has(s)||n.set(s,0)}),x(e.restEncoder,n.size),$t(n.entries()).sort((o,s)=>s[0]-o[0]).forEach(([o,s])=>{CE(e,t.clients.get(o),o,s)})},xE=(e,t)=>{let r=G(),n=O(e.restDecoder);for(let o=0;o<n;o++){let s=O(e.restDecoder),i=new Array(s),a=e.readClient(),c=O(e.restDecoder);r.set(a,{i:0,refs:i});for(let l=0;l<s;l++){let u=e.readInfo();switch(31&u){case 0:{let f=e.readLen();i[l]=new Et(D(a,c),f),c+=f;break}case 10:{let f=O(e.restDecoder);i[l]=new ct(D(a,c),f),c+=f;break}default:{let f=(u&192)===0,p=new N(D(a,c),null,(u&128)===128?e.readLeftID():null,null,(u&64)===64?e.readRightID():null,f?e.readParentInfo()?t.get(e.readString()):e.readLeftID():null,f&&(u&32)===32?e.readString():null,Rd(e,u));i[l]=p,c+=p.length}}}}return r},RE=(e,t,r)=>{let n=[],o=$t(r.keys()).sort((d,h)=>d-h);if(o.length===0)return null;let s=()=>{if(o.length===0)return null;let d=r.get(o[o.length-1]);for(;d.refs.length===d.i;)if(o.pop(),o.length>0)d=r.get(o[o.length-1]);else return null;return d},i=s();if(i===null)return null;let a=new Qs,c=new Map,l=(d,h)=>{let m=c.get(d);(m==null||m>h)&&c.set(d,h)},u=i.refs[i.i++],f=new Map,p=()=>{for(let d of n){let h=d.id.client,m=r.get(h);m?(m.i--,a.clients.set(h,m.refs.slice(m.i)),r.delete(h),m.i=0,m.refs=[]):a.clients.set(h,[d]),o=o.filter(y=>y!==h)}n.length=0};for(;;){if(u.constructor!==ct){let h=mt(f,u.id.client,()=>F(t,u.id.client))-u.id.clock;if(h<0)n.push(u),l(u.id.client,u.id.clock-1),p();else{let m=u.getMissing(e,t);if(m!==null){n.push(u);let y=r.get(m)||{refs:[],i:0};if(y.refs.length===y.i)l(m,F(t,m)),p();else{u=y.refs[y.i++];continue}}else(h===0||h<u.length)&&(u.integrate(e,h),f.set(u.id.client,u.id.clock+u.length))}}if(n.length>0)u=n.pop();else if(i!==null&&i.i<i.refs.length)u=i.refs[i.i++];else{if(i=s(),i===null)break;u=i.refs[i.i++]}}if(a.clients.size>0){let d=new At;return Sc(d,a,new Map),x(d.restEncoder,0),{missing:c,update:d.toUint8Array()}}return null},TE=(e,t)=>Sc(e,t.doc.store,t.beforeState),_c=(e,t,r,n=new St(e))=>M(t,o=>{o.local=!1;let s=!1,i=o.doc,a=i.store,c=xE(n,i),l=RE(o,a,c),u=a.pendingStructs;if(u){for(let[p,d]of u.missing)if(d<F(a,p)){s=!0;break}if(l){for(let[p,d]of l.missing){let h=u.missing.get(p);(h==null||h>d)&&u.missing.set(p,d)}u.update=pr([u.update,l.update])}}else a.pendingStructs=l;let f=kf(n,o,a);if(a.pendingDs){let p=new St(J(a.pendingDs));O(p.restDecoder);let d=kf(p,o,a);f&&d?a.pendingDs=pr([f,d]):a.pendingDs=f||d}else a.pendingDs=f;if(s){let p=a.pendingStructs.update;a.pendingStructs=null,Gt(o.doc,p)}},r,!1),IE=(e,t,r)=>_c(e,t,r,new Rt(e)),Gt=(e,t,r,n=St)=>{let o=J(t);_c(o,e,r,new n(o))},bc=(e,t,r)=>Gt(e,t,r,Rt),AE=(e,t,r=new Map)=>{Sc(e,t.store,r),re(e,wc(t.store))},ge=(e,t=new Uint8Array([0]),r=new At)=>{let n=Cc(t);AE(r,e,n);let o=[r.toUint8Array()];if(e.store.pendingDs&&o.push(e.store.pendingDs),e.store.pendingStructs&&o.push(Ac(e.store.pendingStructs.update,t)),o.length>1){if(r.constructor===oe)return ed(o.map((s,i)=>i===0?s:id(s)));if(r.constructor===At)return pr(o)}return o[0]},vc=(e,t)=>ge(e,t,new oe),zf=e=>{let t=new Map,r=O(e.restDecoder);for(let n=0;n<r;n++){let o=O(e.restDecoder),s=O(e.restDecoder);t.set(o,s)}return t},Cc=e=>zf(new fr(J(e))),xc=(e,t)=>(x(e.restEncoder,t.size),$t(t.entries()).sort((r,n)=>n[0]-r[0]).forEach(([r,n])=>{x(e.restEncoder,r),x(e.restEncoder,n)}),e),kE=(e,t)=>xc(e,ho(t.store)),DE=(e,t=new an)=>(e instanceof Map?xc(t,e):kE(t,e),t.toUint8Array()),Rc=e=>DE(e,new Oe),lc=class{constructor(){this.l=[]}},Df=()=>new lc,Of=(e,t)=>e.l.push(t),Uf=(e,t)=>{let r=e.l,n=r.length;e.l=r.filter(o=>t!==o),n===e.l.length&&console.error("[yjs] Tried to remove event handler that doesn't exist.")},qf=(e,t,r)=>zn(e.l,[t,r]),de=class{constructor(t,r){this.client=t,this.clock=r}},cr=(e,t)=>e===t||e!==null&&t!==null&&e.client===t.client&&e.clock===t.clock,D=(e,t)=>new de(e,t),Lf=(e,t)=>{x(e,t.client),x(e,t.clock)},Mf=e=>D(O(e),O(e)),Tc=e=>{for(let[t,r]of e.doc.share.entries())if(r===e)return t;throw et()},oo=(e,t)=>{for(;t!==null;){if(t.parent===e)return!0;t=t.parent._item}return!1},OE=e=>{let t=[],r=e._start;for(;r;)t.push(r),r=r.right;console.log("Children: ",t),console.log("Children content: ",t.filter(n=>!n.deleted).map(n=>n.content))},uc=class{constructor(t,r=t.getMap("users")){let n=new Map;this.yusers=r,this.doc=t,this.clients=new Map,this.dss=n;let o=(s,i)=>{let a=s.get("ds"),c=s.get("ids"),l=u=>this.clients.set(u,i);a.observe(u=>{u.changes.added.forEach(f=>{f.content.getContent().forEach(p=>{p instanceof Uint8Array&&this.dss.set(i,pe([this.dss.get(i)||ii(),he(new fr(J(p)))]))})})}),this.dss.set(i,pe(a.map(u=>he(new fr(J(u)))))),c.observe(u=>u.changes.added.forEach(f=>f.content.getContent().forEach(l))),c.forEach(l)};r.observe(s=>{s.keysChanged.forEach(i=>o(r.get(i),i))}),r.forEach(o)}setUserMapping(t,r,n,{filter:o=()=>!0}={}){let s=this.yusers,i=s.get(n);i||(i=new gr,i.set("ids",new mr),i.set("ds",new mr),s.set(n,i)),i.get("ids").push([r]),s.observe(a=>{setTimeout(()=>{let c=s.get(n);if(c!==i){i=c,this.clients.forEach((f,p)=>{n===f&&i.get("ids").push([p])});let l=new Oe,u=this.dss.get(n);u&&(re(l,u),i.get("ds").push([l.toUint8Array()]))}},0)}),t.on("afterTransaction",a=>{setTimeout(()=>{let c=i.get("ds"),l=a.deleteSet;if(a.local&&l.clients.size>0&&o(a,l)){let u=new Oe;re(u,l),c.push([u.toUint8Array()])}})})}getUserByClientId(t){return this.clients.get(t)||null}getUserByDeletedId(t){for(let[r,n]of this.dss.entries())if(_r(n,t))return r;return null}},cn=class{constructor(t,r,n,o=0){this.type=t,this.tname=r,this.item=n,this.assoc=o}},UE=e=>{let t={};return e.type&&(t.type=e.type),e.tname&&(t.tname=e.tname),e.item&&(t.item=e.item),e.assoc!=null&&(t.assoc=e.assoc),t},LE=e=>new cn(e.type==null?null:D(e.type.client,e.type.clock),e.tname??null,e.item==null?null:D(e.item.client,e.item.clock),e.assoc==null?0:e.assoc),Ws=class{constructor(t,r,n=0){this.type=t,this.index=r,this.assoc=n}},ME=(e,t,r=0)=>new Ws(e,t,r),Ys=(e,t,r)=>{let n=null,o=null;return e._item===null?o=Tc(e):n=D(e._item.id.client,e._item.id.clock),new cn(n,o,t,r)},NE=(e,t,r=0)=>{let n=e._start;if(r<0){if(t===0)return Ys(e,null,r);t--}for(;n!==null;){if(!n.deleted&&n.countable){if(n.length>t)return Ys(e,D(n.id.client,n.id.clock+t),r);t-=n.length}if(n.right===null&&r<0)return Ys(e,n.lastId,r);n=n.right}return Ys(e,null,r)},PE=(e,t)=>{let{type:r,tname:n,item:o,assoc:s}=t;if(o!==null)x(e,0),Lf(e,o);else if(n!==null)qr(e,1),Ce(e,n);else if(r!==null)qr(e,2),Lf(e,r);else throw et();return Fn(e,s),e},VE=e=>{let t=Yt();return PE(t,e),gt(t)},BE=e=>{let t=null,r=null,n=null;switch(O(e)){case 0:n=Mf(e);break;case 1:r=Re(e);break;case 2:t=Mf(e)}let o=Aa(e)?Yn(e):0;return new cn(t,r,n,o)},jE=e=>BE(J(e)),FE=(e,t)=>{let r=lr(e,t),n=t.clock-r.id.clock;return{item:r,diff:n}},$E=(e,t,r=!0)=>{let n=t.store,o=e.item,s=e.type,i=e.tname,a=e.assoc,c=null,l=0;if(o!==null){if(F(n,o.client)<=o.clock)return null;let u=r?gc(n,o):FE(n,o),f=u.item;if(!(f instanceof N))return null;if(c=f.parent,c._item===null||!c._item.deleted){l=f.deleted||!f.countable?0:u.diff+(a>=0?0:1);let p=f.left;for(;p!==null;)!p.deleted&&p.countable&&(l+=p.length),p=p.left}}else{if(i!==null)c=t.get(i);else if(s!==null){if(F(n,s.client)<=s.clock)return null;let{item:u}=r?gc(n,s):{item:lr(n,s)};if(u instanceof N&&u.content instanceof Vt)c=u.content.type;else return null}else throw et();a>=0?l=c._length:l=0}return ME(c,l,e.assoc)},YE=(e,t)=>e===t||e!==null&&t!==null&&e.tname===t.tname&&cr(e.item,t.item)&&cr(e.type,t.type)&&e.assoc===t.assoc,so=class{constructor(t,r){this.ds=t,this.sv=r}},HE=(e,t)=>{let r=e.ds.clients,n=t.ds.clients,o=e.sv,s=t.sv;if(o.size!==s.size||r.size!==n.size)return!1;for(let[i,a]of o.entries())if(s.get(i)!==a)return!1;for(let[i,a]of r.entries()){let c=n.get(i)||[];if(a.length!==c.length)return!1;for(let l=0;l<a.length;l++){let u=a[l],f=c[l];if(u.clock!==f.clock||u.len!==f.len)return!1}}return!0},ci=(e,t=new an)=>(re(t,e.ds),xc(t,e.sv),t.toUint8Array()),GE=e=>ci(e,new Oe),li=(e,t=new Ks(J(e)))=>new so(he(t),zf(t)),zE=e=>li(e,new fr(J(e))),Ic=(e,t)=>new so(e,t),qE=Ic(ii(),new Map),po=e=>Ic(wc(e.store),ho(e.store)),Ie=(e,t)=>t===void 0?!e.deleted:t.sv.has(e.id.client)&&(t.sv.get(e.id.client)||0)>e.id.clock&&!_r(t.ds,e.id),fc=(e,t)=>{let r=mt(e.meta,fc,Xt),n=e.doc.store;r.has(t)||(t.sv.forEach((o,s)=>{o<F(n,s)&&yt(e,D(s,o))}),ur(e,t.ds,o=>{}),r.add(t))},KE=(e,t,r=new ne)=>{if(e.gc)throw new Error("Garbage-collection must be disabled in `originDoc`!");let{sv:n,ds:o}=t,s=new At;return e.transact(i=>{let a=0;n.forEach(c=>{c>0&&a++}),x(s.restEncoder,a);for(let[c,l]of n){if(l===0)continue;l<F(e.store,c)&&yt(i,D(c,l));let u=e.store.clients.get(c)||[],f=Pt(u,l-1);x(s.restEncoder,f+1),s.writeClient(c),x(s.restEncoder,0);for(let p=0;p<=f;p++)u[p].write(s,0)}re(s,o)}),Gt(r,s.toUint8Array(),"snapshot"),r},WE=(e,t,r=St)=>{let n=new r(J(t)),o=new se(n,!1);for(let i=o.curr;i!==null;i=o.next())if((e.sv.get(i.id.client)||0)<i.id.clock+i.length)return!1;let s=pe([e.ds,he(n)]);return ai(e.ds,s)},QE=(e,t)=>WE(e,t,Rt),Qs=class{constructor(){this.clients=new Map,this.pendingStructs=null,this.pendingDs=null}},ho=e=>{let t=new Map;return e.clients.forEach((r,n)=>{let o=r[r.length-1];t.set(n,o.id.clock+o.length)}),t},F=(e,t)=>{let r=e.clients.get(t);if(r===void 0)return 0;let n=r[r.length-1];return n.id.clock+n.length},Kf=(e,t)=>{let r=e.clients.get(t.id.client);if(r===void 0)r=[],e.clients.set(t.id.client,r);else{let n=r[r.length-1];if(n.id.clock+n.length!==t.id.clock)throw et()}r.push(t)},Pt=(e,t)=>{let r=0,n=e.length-1,o=e[n],s=o.id.clock;if(s===t)return n;let i=ot(t/(s+o.length-1)*n);for(;r<=n;){if(o=e[i],s=o.id.clock,s<=t){if(t<s+o.length)return i;r=i+1}else n=i-1;i=ot((r+n)/2)}throw et()},JE=(e,t)=>{let r=e.clients.get(t.client);return r[Pt(r,t.clock)]},lr=JE,dc=(e,t,r)=>{let n=Pt(t,r),o=t[n];return o.id.clock<r&&o instanceof N?(t.splice(n+1,0,si(e,o,r-o.id.clock)),n+1):n},yt=(e,t)=>{let r=e.doc.store.clients.get(t.client);return r[dc(e,r,t.clock)]},pc=(e,t,r)=>{let n=t.clients.get(r.client),o=Pt(n,r.clock),s=n[o];return r.clock!==s.id.clock+s.length-1&&s.constructor!==Et&&n.splice(o+1,0,si(e,s,r.clock-s.id.clock+1)),s},XE=(e,t,r)=>{let n=e.clients.get(t.id.client);n[Pt(n,t.id.clock)]=r},Wf=(e,t,r,n,o)=>{if(n===0)return;let s=r+n,i=dc(e,t,r),a;do a=t[i++],s<a.id.clock+a.length&&dc(e,t,s),o(a);while(i<t.length&&t[i].id.clock<s)},Js=class{constructor(t,r,n){this.doc=t,this.deleteSet=new De,this.beforeState=ho(t.store),this.afterState=new Map,this.changed=new Map,this.changedParentTypes=new Map,this._mergeStructs=[],this.origin=r,this.meta=new Map,this.local=n,this.subdocsAdded=new Set,this.subdocsRemoved=new Set,this.subdocsLoaded=new Set,this._needFormattingCleanup=!1}},Nf=(e,t)=>t.deleteSet.clients.size===0&&!Pu(t.afterState,(r,n)=>t.beforeState.get(n)!==r)?!1:(Ec(t.deleteSet),TE(e,t),re(e,t.deleteSet),!0),Pf=(e,t,r)=>{let n=t._item;(n===null||n.id.clock<(e.beforeState.get(n.id.client)||0)&&!n.deleted)&&mt(e.changed,t,Xt).add(r)},zs=(e,t)=>{let r=e[t],n=e[t-1],o=t;for(;o>0;r=n,n=e[--o-1]){if(n.deleted===r.deleted&&n.constructor===r.constructor&&n.mergeWith(r)){r instanceof N&&r.parentSub!==null&&r.parent._map.get(r.parentSub)===r&&r.parent._map.set(r.parentSub,n);continue}break}let s=t-o;return s&&e.splice(t+1-s,s),s},Qf=(e,t,r)=>{for(let[n,o]of e.clients.entries()){let s=t.clients.get(n);for(let i=o.length-1;i>=0;i--){let a=o[i],c=a.clock+a.len;for(let l=Pt(s,a.clock),u=s[l];l<s.length&&u.id.clock<c;u=s[++l]){let f=s[l];if(a.clock+a.len<=f.id.clock)break;f instanceof N&&f.deleted&&!f.keep&&r(f)&&f.gc(t,!1)}}}},Jf=(e,t)=>{e.clients.forEach((r,n)=>{let o=t.clients.get(n);for(let s=r.length-1;s>=0;s--){let i=r[s],a=gs(o.length-1,1+Pt(o,i.clock+i.len-1));for(let c=a,l=o[c];c>0&&l.id.clock>=i.clock;l=o[c])c-=1+zs(o,c)}})},ZE=(e,t,r)=>{Qf(e,t,r),Jf(e,t)},Xf=(e,t)=>{if(t<e.length){let r=e[t],n=r.doc,o=n.store,s=r.deleteSet,i=r._mergeStructs;try{Ec(s),r.afterState=ho(r.doc.store),n.emit("beforeObserverCalls",[r,n]);let a=[];r.changed.forEach((c,l)=>a.push(()=>{(l._item===null||!l._item.deleted)&&l._callObserver(r,c)})),a.push(()=>{r.changedParentTypes.forEach((c,l)=>{l._dEH.l.length>0&&(l._item===null||!l._item.deleted)&&(c=c.filter(u=>u.target._item===null||!u.target._item.deleted),c.forEach(u=>{u.currentTarget=l,u._path=null}),c.sort((u,f)=>u.path.length-f.path.length),a.push(()=>{qf(l._dEH,c,r)}))}),a.push(()=>n.emit("afterTransaction",[r,n])),a.push(()=>{r._needFormattingCleanup&&_w(r)})}),zn(a,[])}finally{n.gc&&Qf(s,o,n.gcFilter),Jf(s,o),r.afterState.forEach((u,f)=>{let p=r.beforeState.get(f)||0;if(p!==u){let d=o.clients.get(f),h=fe(Pt(d,p),1);for(let m=d.length-1;m>=h;)m-=1+zs(d,m)}});for(let u=i.length-1;u>=0;u--){let{client:f,clock:p}=i[u].id,d=o.clients.get(f),h=Pt(d,p);h+1<d.length&&zs(d,h+1)>1||h>0&&zs(d,h)}if(!r.local&&r.afterState.get(n.clientID)!==r.beforeState.get(n.clientID)&&(Fs(sn,Xn,"[yjs] ",Zn,to,"Changed the client-id because another client seems to be using it."),n.clientID=Gf()),n.emit("afterTransactionCleanup",[r,n]),n._observers.has("update")){let u=new oe;Nf(u,r)&&n.emit("update",[u.toUint8Array(),r.origin,n,r])}if(n._observers.has("updateV2")){let u=new At;Nf(u,r)&&n.emit("updateV2",[u.toUint8Array(),r.origin,n,r])}let{subdocsAdded:a,subdocsLoaded:c,subdocsRemoved:l}=r;(a.size>0||l.size>0||c.size>0)&&(a.forEach(u=>{u.clientID=n.clientID,u.collectionid==null&&(u.collectionid=n.collectionid),n.subdocs.add(u)}),l.forEach(u=>n.subdocs.delete(u)),n.emit("subdocs",[{loaded:c,added:a,removed:l},n,r]),l.forEach(u=>u.destroy())),e.length<=t+1?(n._transactionCleanups=[],n.emit("afterAllTransactions",[n,e])):Xf(e,t+1)}}},M=(e,t,r=null,n=!0)=>{let o=e._transactionCleanups,s=!1,i=null;e._transaction===null&&(s=!0,e._transaction=new Js(e,r,n),o.push(e._transaction),o.length===1&&e.emit("beforeAllTransactions",[e]),e.emit("beforeTransaction",[e._transaction,e]));try{i=t(e._transaction)}finally{if(s){let a=e._transaction===o[0];e._transaction=null,a&&Xf(o,0)}}return i},hc=class{constructor(t,r){this.insertions=r,this.deletions=t,this.meta=new Map}},Vf=(e,t,r)=>{ur(e,r.deletions,n=>{n instanceof N&&t.scope.some(o=>o===e.doc||oo(o,n))&&Lc(n,!1)})},Bf=(e,t,r)=>{let n=null,o=e.doc,s=e.scope;M(o,a=>{for(;t.length>0&&e.currStackItem===null;){let c=o.store,l=t.pop(),u=new Set,f=[],p=!1;ur(a,l.insertions,d=>{if(d instanceof N){if(d.redone!==null){let{item:h,diff:m}=gc(c,d.id);m>0&&(h=yt(a,D(h.id.client,h.id.clock+m))),d=h}!d.deleted&&s.some(h=>h===a.doc||oo(h,d))&&f.push(d)}}),ur(a,l.deletions,d=>{d instanceof N&&s.some(h=>h===a.doc||oo(h,d))&&!_r(l.insertions,d.id)&&u.add(d)}),u.forEach(d=>{p=xd(a,d,u,l.insertions,e.ignoreRemoteMapChanges,e)!==null||p});for(let d=f.length-1;d>=0;d--){let h=f[d];e.deleteFilter(h)&&(h.delete(a),p=!0)}e.currStackItem=p?l:null}a.changed.forEach((c,l)=>{c.has(null)&&l._searchMarker&&(l._searchMarker.length=0)}),n=a},e);let i=e.currStackItem;if(i!=null){let a=n.changedParentTypes;e.emit("stack-item-popped",[{stackItem:i,type:r,changedParentTypes:a,origin:e},e]),e.currStackItem=null}return i},dr=class extends ve{constructor(t,{captureTimeout:r=500,captureTransaction:n=c=>!0,deleteFilter:o=()=>!0,trackedOrigins:s=new Set([null]),ignoreRemoteMapChanges:i=!1,doc:a=ue(t)?t[0].doc:t instanceof ne?t:t.doc}={}){super(),this.scope=[],this.doc=a,this.addToScope(t),this.deleteFilter=o,s.add(this),this.trackedOrigins=s,this.captureTransaction=n,this.undoStack=[],this.redoStack=[],this.undoing=!1,this.redoing=!1,this.currStackItem=null,this.lastChange=0,this.ignoreRemoteMapChanges=i,this.captureTimeout=r,this.afterTransactionHandler=c=>{if(!this.captureTransaction(c)||!this.scope.some(y=>c.changedParentTypes.has(y)||y===this.doc)||!this.trackedOrigins.has(c.origin)&&(!c.origin||!this.trackedOrigins.has(c.origin.constructor)))return;let l=this.undoing,u=this.redoing,f=l?this.redoStack:this.undoStack;l?this.stopCapturing():u||this.clear(!1,!0);let p=new De;c.afterState.forEach((y,E)=>{let w=c.beforeState.get(E)||0,S=y-w;S>0&&no(p,E,w,S)});let d=Te(),h=!1;if(this.lastChange>0&&d-this.lastChange<this.captureTimeout&&f.length>0&&!l&&!u){let y=f[f.length-1];y.deletions=pe([y.deletions,c.deleteSet]),y.insertions=pe([y.insertions,p])}else f.push(new hc(c.deleteSet,p)),h=!0;!l&&!u&&(this.lastChange=d),ur(c,c.deleteSet,y=>{y instanceof N&&this.scope.some(E=>E===c.doc||oo(E,y))&&Lc(y,!0)});let m=[{stackItem:f[f.length-1],origin:c.origin,type:l?"redo":"undo",changedParentTypes:c.changedParentTypes},this];h?this.emit("stack-item-added",m):this.emit("stack-item-updated",m)},this.doc.on("afterTransaction",this.afterTransactionHandler),this.doc.on("destroy",()=>{this.destroy()})}addToScope(t){let r=new Set(this.scope);t=ue(t)?t:[t],t.forEach(n=>{r.has(n)||(r.add(n),(n instanceof K?n.doc!==this.doc:n!==this.doc)&&ic("[yjs#509] Not same Y.Doc"),this.scope.push(n))})}addTrackedOrigin(t){this.trackedOrigins.add(t)}removeTrackedOrigin(t){this.trackedOrigins.delete(t)}clear(t=!0,r=!0){(t&&this.canUndo()||r&&this.canRedo())&&this.doc.transact(n=>{t&&(this.undoStack.forEach(o=>Vf(n,this,o)),this.undoStack=[]),r&&(this.redoStack.forEach(o=>Vf(n,this,o)),this.redoStack=[]),this.emit("stack-cleared",[{undoStackCleared:t,redoStackCleared:r}])})}stopCapturing(){this.lastChange=0}undo(){this.undoing=!0;let t;try{t=Bf(this,this.undoStack,"undo")}finally{this.undoing=!1}return t}redo(){this.redoing=!0;let t;try{t=Bf(this,this.redoStack,"redo")}finally{this.redoing=!1}return t}canUndo(){return this.undoStack.length>0}canRedo(){return this.redoStack.length>0}destroy(){this.trackedOrigins.delete(this),this.doc.off("afterTransaction",this.afterTransactionHandler),super.destroy()}};function*tw(e){let t=O(e.restDecoder);for(let r=0;r<t;r++){let n=O(e.restDecoder),o=e.readClient(),s=O(e.restDecoder);for(let i=0;i<n;i++){let a=e.readInfo();if(a===10){let c=O(e.restDecoder);yield new ct(D(o,s),c),s+=c}else if((31&a)!==0){let c=(a&192)===0,l=new N(D(o,s),null,(a&128)===128?e.readLeftID():null,null,(a&64)===64?e.readRightID():null,c?e.readParentInfo()?e.readString():e.readLeftID():null,c&&(a&32)===32?e.readString():null,Rd(e,a));yield l,s+=l.length}else{let c=e.readLen();yield new Et(D(o,s),c),s+=c}}}}var se=class{constructor(t,r){this.gen=tw(t),this.curr=null,this.done=!1,this.filterSkips=r,this.next()}next(){do this.curr=this.gen.next().value||null;while(this.filterSkips&&this.curr!==null&&this.curr.constructor===ct);return this.curr}},ew=e=>Zf(e,Rt),Zf=(e,t=St)=>{let r=[],n=new t(J(e)),o=new se(n,!1);for(let i=o.curr;i!==null;i=o.next())r.push(i);Fs("Structs: ",r);let s=he(n);Fs("DeleteSet: ",s)},rw=e=>td(e,Rt),td=(e,t=St)=>{let r=[],n=new t(J(e)),o=new se(n,!1);for(let s=o.curr;s!==null;s=o.next())r.push(s);return{structs:r,ds:he(n)}},io=class{constructor(t){this.currClient=0,this.startClock=0,this.written=0,this.encoder=t,this.clientStructs=[]}},ed=e=>pr(e,Rt,oe),rd=(e,t=an,r=St)=>{let n=new t,o=new se(new r(J(e)),!1),s=o.curr;if(s!==null){let i=0,a=s.id.client,c=s.id.clock!==0,l=c?0:s.id.clock+s.length;for(;s!==null;s=o.next())a!==s.id.client&&(l!==0&&(i++,x(n.restEncoder,a),x(n.restEncoder,l)),a=s.id.client,l=0,c=s.id.clock!==0),s.constructor===ct&&(c=!0),c||(l=s.id.clock+s.length);l!==0&&(i++,x(n.restEncoder,a),x(n.restEncoder,l));let u=Yt();return x(u,i),zu(u,n.restEncoder),n.restEncoder=u,n.toUint8Array()}else return x(n.restEncoder,0),n.toUint8Array()},nw=e=>rd(e,Oe,Rt),nd=(e,t=St)=>{let r=new Map,n=new Map,o=new se(new t(J(e)),!1),s=o.curr;if(s!==null){let i=s.id.client,a=s.id.clock;for(r.set(i,a);s!==null;s=o.next())i!==s.id.client&&(n.set(i,a),r.set(s.id.client,s.id.clock),i=s.id.client),a=s.id.clock+s.length;n.set(i,a)}return{from:r,to:n}},ow=e=>nd(e,Rt),sw=(e,t)=>{if(e.constructor===Et){let{client:r,clock:n}=e.id;return new Et(D(r,n+t),e.length-t)}else if(e.constructor===ct){let{client:r,clock:n}=e.id;return new ct(D(r,n+t),e.length-t)}else{let r=e,{client:n,clock:o}=r.id;return new N(D(n,o+t),null,D(n,o+t-1),null,r.rightOrigin,r.parent,r.parentSub,r.content.splice(t))}},pr=(e,t=St,r=At)=>{if(e.length===1)return e[0];let n=e.map(u=>new t(J(u))),o=n.map(u=>new se(u,!0)),s=null,i=new r,a=new io(i);for(;o=o.filter(p=>p.curr!==null),o.sort((p,d)=>{if(p.curr.id.client===d.curr.id.client){let h=p.curr.id.clock-d.curr.id.clock;return h===0?p.curr.constructor===d.curr.constructor?0:p.curr.constructor===ct?1:-1:h}else return d.curr.id.client-p.curr.id.client}),o.length!==0;){let u=o[0],f=u.curr.id.client;if(s!==null){let p=u.curr,d=!1;for(;p!==null&&p.id.clock+p.length<=s.struct.id.clock+s.struct.length&&p.id.client>=s.struct.id.client;)p=u.next(),d=!0;if(p===null||p.id.client!==f||d&&p.id.clock>s.struct.id.clock+s.struct.length)continue;if(f!==s.struct.id.client)Ae(a,s.struct,s.offset),s={struct:p,offset:0},u.next();else if(s.struct.id.clock+s.struct.length<p.id.clock)if(s.struct.constructor===ct)s.struct.length=p.id.clock+p.length-s.struct.id.clock;else{Ae(a,s.struct,s.offset);let h=p.id.clock-s.struct.id.clock-s.struct.length;s={struct:new ct(D(f,s.struct.id.clock+s.struct.length),h),offset:0}}else{let h=s.struct.id.clock+s.struct.length-p.id.clock;h>0&&(s.struct.constructor===ct?s.struct.length-=h:p=sw(p,h)),s.struct.mergeWith(p)||(Ae(a,s.struct,s.offset),s={struct:p,offset:0},u.next())}}else s={struct:u.curr,offset:0},u.next();for(let p=u.curr;p!==null&&p.id.client===f&&p.id.clock===s.struct.id.clock+s.struct.length&&p.constructor!==ct;p=u.next())Ae(a,s.struct,s.offset),s={struct:p,offset:0}}s!==null&&(Ae(a,s.struct,s.offset),s=null),kc(a);let c=n.map(u=>he(u)),l=pe(c);return re(i,l),i.toUint8Array()},Ac=(e,t,r=St,n=At)=>{let o=Cc(t),s=new n,i=new io(s),a=new r(J(e)),c=new se(a,!1);for(;c.curr;){let u=c.curr,f=u.id.client,p=o.get(f)||0;if(c.curr.constructor===ct){c.next();continue}if(u.id.clock+u.length>p)for(Ae(i,u,fe(p-u.id.clock,0)),c.next();c.curr&&c.curr.id.client===f;)Ae(i,c.curr,0),c.next();else for(;c.curr&&c.curr.id.client===f&&c.curr.id.clock+c.curr.length<=p;)c.next()}kc(i);let l=he(a);return re(s,l),s.toUint8Array()},iw=(e,t)=>Ac(e,t,Rt,oe),od=e=>{e.written>0&&(e.clientStructs.push({written:e.written,restEncoder:gt(e.encoder.restEncoder)}),e.encoder.restEncoder=Yt(),e.written=0)},Ae=(e,t,r)=>{e.written>0&&e.currClient!==t.id.client&&od(e),e.written===0&&(e.currClient=t.id.client,e.encoder.writeClient(t.id.client),x(e.encoder.restEncoder,t.id.clock+r)),t.write(e.encoder,r),e.written++},kc=e=>{od(e);let t=e.encoder.restEncoder;x(t,e.clientStructs.length);for(let r=0;r<e.clientStructs.length;r++){let n=e.clientStructs[r];x(t,n.written),Kr(t,n.restEncoder)}},ui=(e,t,r,n)=>{let o=new r(J(e)),s=new se(o,!1),i=new n,a=new io(i);for(let l=s.curr;l!==null;l=s.next())Ae(a,t(l),0);kc(a);let c=he(o);return re(i,c),i.toUint8Array()},sd=({formatting:e=!0,subdocs:t=!0,yxml:r=!0}={})=>{let n=0,o=G(),s=G(),i=G(),a=G();return a.set(null,null),c=>{switch(c.constructor){case Et:case ct:return c;case N:{let l=c,u=l.content;switch(u.constructor){case fn:break;case Vt:{if(r){let f=u.type;f instanceof Er&&(f.nodeName=mt(s,f.nodeName,()=>"node-"+n)),f instanceof uo&&(f.hookName=mt(s,f.hookName,()=>"hook-"+n))}break}case Ue:{let f=u;f.arr=f.arr.map(()=>n);break}case wr:{let f=u;f.content=new Uint8Array([n]);break}case Sr:{let f=u;t&&(f.opts={},f.doc.guid=n+"");break}case me:{let f=u;f.embed={};break}case W:{let f=u;e&&(f.key=mt(i,f.key,()=>n+""),f.value=mt(a,f.value,()=>({i:n})));break}case fo:{let f=u;f.arr=f.arr.map(()=>n);break}case Ht:{let f=u;f.str=Es(n%10+"",f.str.length);break}default:et()}return l.parentSub&&(l.parentSub=mt(o,l.parentSub,()=>n+"")),n++,c}default:et()}}},aw=(e,t)=>ui(e,sd(t),Rt,oe),cw=(e,t)=>ui(e,sd(t),St,At),lw=e=>ui(e,Fa,Rt,At),id=e=>ui(e,Fa,St,oe),jf="You must not compute changes after the event-handler fired.",hr=class{constructor(t,r){this.target=t,this.currentTarget=t,this.transaction=r,this._changes=null,this._keys=null,this._delta=null,this._path=null}get path(){return this._path||(this._path=uw(this.currentTarget,this.target))}deletes(t){return _r(this.transaction.deleteSet,t.id)}get keys(){if(this._keys===null){if(this.transaction.doc._transactionCleanups.length===0)throw Tt(jf);let t=new Map,r=this.target;this.transaction.changed.get(r).forEach(o=>{if(o!==null){let s=r._map.get(o),i,a;if(this.adds(s)){let c=s.left;for(;c!==null&&this.adds(c);)c=c.left;if(this.deletes(s))if(c!==null&&this.deletes(c))i="delete",a=ps(c.content.getContent());else return;else c!==null&&this.deletes(c)?(i="update",a=ps(c.content.getContent())):(i="add",a=void 0)}else if(this.deletes(s))i="delete",a=ps(s.content.getContent());else return;t.set(o,{action:i,oldValue:a})}}),this._keys=t}return this._keys}get delta(){return this.changes.delta}adds(t){return t.id.clock>=(this.transaction.beforeState.get(t.id.client)||0)}get changes(){let t=this._changes;if(t===null){if(this.transaction.doc._transactionCleanups.length===0)throw Tt(jf);let r=this.target,n=Xt(),o=Xt(),s=[];if(t={added:n,deleted:o,delta:s,keys:this.keys},this.transaction.changed.get(r).has(null)){let a=null,c=()=>{a&&s.push(a)};for(let l=r._start;l!==null;l=l.right)l.deleted?this.deletes(l)&&!this.adds(l)&&((a===null||a.delete===void 0)&&(c(),a={delete:0}),a.delete+=l.length,o.add(l)):this.adds(l)?((a===null||a.insert===void 0)&&(c(),a={insert:[]}),a.insert=a.insert.concat(l.content.getContent()),n.add(l)):((a===null||a.retain===void 0)&&(c(),a={retain:0}),a.retain+=l.length);a!==null&&a.retain===void 0&&c()}this._changes=t}return t}},uw=(e,t)=>{let r=[];for(;t._item!==null&&t!==e;){if(t._item.parentSub!==null)r.unshift(t._item.parentSub);else{let n=0,o=t._item.parent._start;for(;o!==t._item&&o!==null;)!o.deleted&&o.countable&&(n+=o.length),o=o.right;r.unshift(n)}t=t._item.parent}return r},lt=()=>{ic("Invalid access: Add Yjs type to a document before reading data.")},ad=80,Dc=0,mc=class{constructor(t,r){t.marker=!0,this.p=t,this.index=r,this.timestamp=Dc++}},fw=e=>{e.timestamp=Dc++},cd=(e,t,r)=>{e.p.marker=!1,e.p=t,t.marker=!0,e.index=r,e.timestamp=Dc++},dw=(e,t,r)=>{if(e.length>=ad){let n=e.reduce((o,s)=>o.timestamp<s.timestamp?o:s);return cd(n,t,r),n}else{let n=new mc(t,r);return e.push(n),n}},fi=(e,t)=>{if(e._start===null||t===0||e._searchMarker===null)return null;let r=e._searchMarker.length===0?null:e._searchMarker.reduce((s,i)=>tr(t-s.index)<tr(t-i.index)?s:i),n=e._start,o=0;for(r!==null&&(n=r.p,o=r.index,fw(r));n.right!==null&&o<t;){if(!n.deleted&&n.countable){if(t<o+n.length)break;o+=n.length}n=n.right}for(;n.left!==null&&o>t;)n=n.left,!n.deleted&&n.countable&&(o-=n.length);for(;n.left!==null&&n.left.id.client===n.id.client&&n.left.id.clock+n.left.length===n.id.clock;)n=n.left,!n.deleted&&n.countable&&(o-=n.length);return r!==null&&tr(r.index-o)<n.parent.length/ad?(cd(r,n,o),r):dw(e._searchMarker,n,o)},ao=(e,t,r)=>{for(let n=e.length-1;n>=0;n--){let o=e[n];if(r>0){let s=o.p;for(s.marker=!1;s&&(s.deleted||!s.countable);)s=s.left,s&&!s.deleted&&s.countable&&(o.index-=s.length);if(s===null||s.marker===!0){e.splice(n,1);continue}o.p=s,s.marker=!0}(t<o.index||r>0&&t===o.index)&&(o.index=fe(t,o.index+r))}},pw=e=>{e.doc??lt();let t=e._start,r=[];for(;t;)r.push(t),t=t.right;return r},di=(e,t,r)=>{let n=e,o=t.changedParentTypes;for(;mt(o,e,()=>[]).push(r),e._item!==null;)e=e._item.parent;qf(n._eH,r,t)},K=class{constructor(){this._item=null,this._map=new Map,this._start=null,this.doc=null,this._length=0,this._eH=Df(),this._dEH=Df(),this._searchMarker=null}get parent(){return this._item?this._item.parent:null}_integrate(t,r){this.doc=t,this._item=r}_copy(){throw It()}clone(){throw It()}_write(t){}get _first(){let t=this._start;for(;t!==null&&t.deleted;)t=t.right;return t}_callObserver(t,r){!t.local&&this._searchMarker&&(this._searchMarker.length=0)}observe(t){Of(this._eH,t)}observeDeep(t){Of(this._dEH,t)}unobserve(t){Uf(this._eH,t)}unobserveDeep(t){Uf(this._dEH,t)}toJSON(){}},ld=(e,t,r)=>{e.doc??lt(),t<0&&(t=e._length+t),r<0&&(r=e._length+r);let n=r-t,o=[],s=e._start;for(;s!==null&&n>0;){if(s.countable&&!s.deleted){let i=s.content.getContent();if(i.length<=t)t-=i.length;else{for(let a=t;a<i.length&&n>0;a++)o.push(i[a]),n--;t=0}}s=s.right}return o},ud=e=>{e.doc??lt();let t=[],r=e._start;for(;r!==null;){if(r.countable&&!r.deleted){let n=r.content.getContent();for(let o=0;o<n.length;o++)t.push(n[o])}r=r.right}return t},hw=(e,t)=>{let r=[],n=e._start;for(;n!==null;){if(n.countable&&Ie(n,t)){let o=n.content.getContent();for(let s=0;s<o.length;s++)r.push(o[s])}n=n.right}return r},co=(e,t)=>{let r=0,n=e._start;for(e.doc??lt();n!==null;){if(n.countable&&!n.deleted){let o=n.content.getContent();for(let s=0;s<o.length;s++)t(o[s],r++,e)}n=n.right}},fd=(e,t)=>{let r=[];return co(e,(n,o)=>{r.push(t(n,o,e))}),r},mw=e=>{let t=e._start,r=null,n=0;return{[Symbol.iterator](){return this},next:()=>{if(r===null){for(;t!==null&&t.deleted;)t=t.right;if(t===null)return{done:!0,value:void 0};r=t.content.getContent(),n=0,t=t.right}let o=r[n++];return r.length<=n&&(r=null),{done:!1,value:o}}}},dd=(e,t)=>{e.doc??lt();let r=fi(e,t),n=e._start;for(r!==null&&(n=r.p,t-=r.index);n!==null;n=n.right)if(!n.deleted&&n.countable){if(t<n.length)return n.content.getContent()[t];t-=n.length}},Xs=(e,t,r,n)=>{let o=r,s=e.doc,i=s.clientID,a=s.store,c=r===null?t._start:r.right,l=[],u=()=>{l.length>0&&(o=new N(D(i,F(a,i)),o,o&&o.lastId,c,c&&c.id,t,null,new Ue(l)),o.integrate(e,0),l=[])};n.forEach(f=>{if(f===null)l.push(f);else switch(f.constructor){case Number:case Object:case Boolean:case Array:case String:l.push(f);break;default:switch(u(),f.constructor){case Uint8Array:case ArrayBuffer:o=new N(D(i,F(a,i)),o,o&&o.lastId,c,c&&c.id,t,null,new wr(new Uint8Array(f))),o.integrate(e,0);break;case ne:o=new N(D(i,F(a,i)),o,o&&o.lastId,c,c&&c.id,t,null,new Sr(f)),o.integrate(e,0);break;default:if(f instanceof K)o=new N(D(i,F(a,i)),o,o&&o.lastId,c,c&&c.id,t,null,new Vt(f)),o.integrate(e,0);else throw new Error("Unexpected content type in insert operation")}}}),u()},pd=()=>Tt("Length exceeded!"),hd=(e,t,r,n)=>{if(r>t._length)throw pd();if(r===0)return t._searchMarker&&ao(t._searchMarker,r,n.length),Xs(e,t,null,n);let o=r,s=fi(t,r),i=t._start;for(s!==null&&(i=s.p,r-=s.index,r===0&&(i=i.prev,r+=i&&i.countable&&!i.deleted?i.length:0));i!==null;i=i.right)if(!i.deleted&&i.countable){if(r<=i.length){r<i.length&&yt(e,D(i.id.client,i.id.clock+r));break}r-=i.length}return t._searchMarker&&ao(t._searchMarker,o,n.length),Xs(e,t,i,n)},gw=(e,t,r)=>{let o=(t._searchMarker||[]).reduce((s,i)=>i.index>s.index?i:s,{index:0,p:t._start}).p;if(o)for(;o.right;)o=o.right;return Xs(e,t,o,r)},md=(e,t,r,n)=>{if(n===0)return;let o=r,s=n,i=fi(t,r),a=t._start;for(i!==null&&(a=i.p,r-=i.index);a!==null&&r>0;a=a.right)!a.deleted&&a.countable&&(r<a.length&&yt(e,D(a.id.client,a.id.clock+r)),r-=a.length);for(;n>0&&a!==null;)a.deleted||(n<a.length&&yt(e,D(a.id.client,a.id.clock+n)),a.delete(e),n-=a.length),a=a.right;if(n>0)throw pd();t._searchMarker&&ao(t._searchMarker,o,-s+n)},Zs=(e,t,r)=>{let n=t._map.get(r);n!==void 0&&n.delete(e)},Oc=(e,t,r,n)=>{let o=t._map.get(r)||null,s=e.doc,i=s.clientID,a;if(n==null)a=new Ue([n]);else switch(n.constructor){case Number:case Object:case Boolean:case Array:case String:case Date:case BigInt:a=new Ue([n]);break;case Uint8Array:a=new wr(n);break;case ne:a=new Sr(n);break;default:if(n instanceof K)a=new Vt(n);else throw new Error("Unexpected content type")}new N(D(i,F(s.store,i)),o,o&&o.lastId,null,null,t,r,a).integrate(e,0)},Uc=(e,t)=>{e.doc??lt();let r=e._map.get(t);return r!==void 0&&!r.deleted?r.content.getContent()[r.length-1]:void 0},gd=e=>{let t={};return e.doc??lt(),e._map.forEach((r,n)=>{r.deleted||(t[n]=r.content.getContent()[r.length-1])}),t},yd=(e,t)=>{e.doc??lt();let r=e._map.get(t);return r!==void 0&&!r.deleted},yw=(e,t,r)=>{let n=e._map.get(t)||null;for(;n!==null&&(!r.sv.has(n.id.client)||n.id.clock>=(r.sv.get(n.id.client)||0));)n=n.left;return n!==null&&Ie(n,r)?n.content.getContent()[n.length-1]:void 0},Ed=(e,t)=>{let r={};return e._map.forEach((n,o)=>{let s=n;for(;s!==null&&(!t.sv.has(s.id.client)||s.id.clock>=(t.sv.get(s.id.client)||0));)s=s.left;s!==null&&Ie(s,t)&&(r[o]=s.content.getContent()[s.length-1])}),r},Hs=e=>(e.doc??lt(),Tf(e._map.entries(),t=>!t[1].deleted)),ti=class extends hr{},mr=class e extends K{constructor(){super(),this._prelimContent=[],this._searchMarker=[]}static from(t){let r=new e;return r.push(t),r}_integrate(t,r){super._integrate(t,r),this.insert(0,this._prelimContent),this._prelimContent=null}_copy(){return new e}clone(){let t=new e;return t.insert(0,this.toArray().map(r=>r instanceof K?r.clone():r)),t}get length(){return this.doc??lt(),this._length}_callObserver(t,r){super._callObserver(t,r),di(this,t,new ti(this,t))}insert(t,r){this.doc!==null?M(this.doc,n=>{hd(n,this,t,r)}):this._prelimContent.splice(t,0,...r)}push(t){this.doc!==null?M(this.doc,r=>{gw(r,this,t)}):this._prelimContent.push(...t)}unshift(t){this.insert(0,t)}delete(t,r=1){this.doc!==null?M(this.doc,n=>{md(n,this,t,r)}):this._prelimContent.splice(t,r)}get(t){return dd(this,t)}toArray(){return ud(this)}slice(t=0,r=this.length){return ld(this,t,r)}toJSON(){return this.map(t=>t instanceof K?t.toJSON():t)}map(t){return fd(this,t)}forEach(t){co(this,t)}[Symbol.iterator](){return mw(this)}_write(t){t.writeTypeRef(Vw)}},Ew=e=>new mr,ei=class extends hr{constructor(t,r,n){super(t,r),this.keysChanged=n}},gr=class e extends K{constructor(t){super(),this._prelimContent=null,t===void 0?this._prelimContent=new Map:this._prelimContent=new Map(t)}_integrate(t,r){super._integrate(t,r),this._prelimContent.forEach((n,o)=>{this.set(o,n)}),this._prelimContent=null}_copy(){return new e}clone(){let t=new e;return this.forEach((r,n)=>{t.set(n,r instanceof K?r.clone():r)}),t}_callObserver(t,r){di(this,t,new ei(this,t,r))}toJSON(){this.doc??lt();let t={};return this._map.forEach((r,n)=>{if(!r.deleted){let o=r.content.getContent()[r.length-1];t[n]=o instanceof K?o.toJSON():o}}),t}get size(){return[...Hs(this)].length}keys(){return $s(Hs(this),t=>t[0])}values(){return $s(Hs(this),t=>t[1].content.getContent()[t[1].length-1])}entries(){return $s(Hs(this),t=>[t[0],t[1].content.getContent()[t[1].length-1]])}forEach(t){this.doc??lt(),this._map.forEach((r,n)=>{r.deleted||t(r.content.getContent()[r.length-1],n,this)})}[Symbol.iterator](){return this.entries()}delete(t){this.doc!==null?M(this.doc,r=>{Zs(r,this,t)}):this._prelimContent.delete(t)}set(t,r){return this.doc!==null?M(this.doc,n=>{Oc(n,this,t,r)}):this._prelimContent.set(t,r),r}get(t){return Uc(this,t)}has(t){return yd(this,t)}clear(){this.doc!==null?M(this.doc,t=>{this.forEach(function(r,n,o){Zs(t,o,n)})}):this._prelimContent.clear()}_write(t){t.writeTypeRef(Bw)}},ww=e=>new gr,ke=(e,t)=>e===t||typeof e=="object"&&typeof t=="object"&&e&&t&&Va(e,t),lo=class{constructor(t,r,n,o){this.left=t,this.right=r,this.index=n,this.currentAttributes=o}forward(){this.right===null&&et(),this.right.content.constructor===W?this.right.deleted||dn(this.currentAttributes,this.right.content):this.right.deleted||(this.index+=this.right.length),this.left=this.right,this.right=this.right.right}},Ff=(e,t,r)=>{for(;t.right!==null&&r>0;)t.right.content.constructor===W?t.right.deleted||dn(t.currentAttributes,t.right.content):t.right.deleted||(r<t.right.length&&yt(e,D(t.right.id.client,t.right.id.clock+r)),t.index+=t.right.length,r-=t.right.length),t.left=t.right,t.right=t.right.right;return t},Gs=(e,t,r,n)=>{let o=new Map,s=n?fi(t,r):null;if(s){let i=new lo(s.p.left,s.p,s.index,o);return Ff(e,i,r-s.index)}else{let i=new lo(null,t._start,0,o);return Ff(e,i,r)}},wd=(e,t,r,n)=>{for(;r.right!==null&&(r.right.deleted===!0||r.right.content.constructor===W&&ke(n.get(r.right.content.key),r.right.content.value));)r.right.deleted||n.delete(r.right.content.key),r.forward();let o=e.doc,s=o.clientID;n.forEach((i,a)=>{let c=r.left,l=r.right,u=new N(D(s,F(o.store,s)),c,c&&c.lastId,l,l&&l.id,t,null,new W(a,i));u.integrate(e,0),r.right=u,r.forward()})},dn=(e,t)=>{let{key:r,value:n}=t;n===null?e.delete(r):e.set(r,n)},Sd=(e,t)=>{for(;e.right!==null;){if(!(e.right.deleted||e.right.content.constructor===W&&ke(t[e.right.content.key]??null,e.right.content.value)))break;e.forward()}},_d=(e,t,r,n)=>{let o=e.doc,s=o.clientID,i=new Map;for(let a in n){let c=n[a],l=r.currentAttributes.get(a)??null;if(!ke(l,c)){i.set(a,l);let{left:u,right:f}=r;r.right=new N(D(s,F(o.store,s)),u,u&&u.lastId,f,f&&f.id,t,null,new W(a,c)),r.right.integrate(e,0),r.forward()}}return i},ac=(e,t,r,n,o)=>{r.currentAttributes.forEach((p,d)=>{o[d]===void 0&&(o[d]=null)});let s=e.doc,i=s.clientID;Sd(r,o);let a=_d(e,t,r,o),c=n.constructor===String?new Ht(n):n instanceof K?new Vt(n):new me(n),{left:l,right:u,index:f}=r;t._searchMarker&&ao(t._searchMarker,r.index,c.getLength()),u=new N(D(i,F(s.store,i)),l,l&&l.lastId,u,u&&u.id,t,null,c),u.integrate(e,0),r.right=u,r.index=f,r.forward(),wd(e,t,r,a)},$f=(e,t,r,n,o)=>{let s=e.doc,i=s.clientID;Sd(r,o);let a=_d(e,t,r,o);t:for(;r.right!==null&&(n>0||a.size>0&&(r.right.deleted||r.right.content.constructor===W));){if(!r.right.deleted)switch(r.right.content.constructor){case W:{let{key:c,value:l}=r.right.content,u=o[c];if(u!==void 0){if(ke(u,l))a.delete(c);else{if(n===0)break t;a.set(c,l)}r.right.delete(e)}else r.currentAttributes.set(c,l);break}default:n<r.right.length&&yt(e,D(r.right.id.client,r.right.id.clock+n)),n-=r.right.length;break}r.forward()}if(n>0){let c="";for(;n>0;n--)c+=`
`;r.right=new N(D(i,F(s.store,i)),r.left,r.left&&r.left.lastId,r.right,r.right&&r.right.id,t,null,new Ht(c)),r.right.integrate(e,0),r.forward()}wd(e,t,r,a)},bd=(e,t,r,n,o)=>{let s=t,i=G();for(;s&&(!s.countable||s.deleted);){if(!s.deleted&&s.content.constructor===W){let l=s.content;i.set(l.key,l)}s=s.right}let a=0,c=!1;for(;t!==s;){if(r===t&&(c=!0),!t.deleted){let l=t.content;if(l.constructor===W){let{key:u,value:f}=l,p=n.get(u)??null;(i.get(u)!==l||p===f)&&(t.delete(e),a++,!c&&(o.get(u)??null)===f&&p!==f&&(p===null?o.delete(u):o.set(u,p))),!c&&!t.deleted&&dn(o,l)}}t=t.right}return a},Sw=(e,t)=>{for(;t&&t.right&&(t.right.deleted||!t.right.countable);)t=t.right;let r=new Set;for(;t&&(t.deleted||!t.countable);){if(!t.deleted&&t.content.constructor===W){let n=t.content.key;r.has(n)?t.delete(e):r.add(n)}t=t.left}},vd=e=>{let t=0;return M(e.doc,r=>{let n=e._start,o=e._start,s=G(),i=ds(s);for(;o;)o.deleted===!1&&(o.content.constructor===W?dn(i,o.content):(t+=bd(r,n,o,s,i),s=ds(i),n=o)),o=o.right}),t},_w=e=>{let t=new Set,r=e.doc;for(let[n,o]of e.afterState.entries()){let s=e.beforeState.get(n)||0;o!==s&&Wf(e,r.store.clients.get(n),s,o,i=>{!i.deleted&&i.content.constructor===W&&i.constructor!==Et&&t.add(i.parent)})}M(r,n=>{ur(e,e.deleteSet,o=>{if(o instanceof Et||!o.parent._hasFormatting||t.has(o.parent))return;let s=o.parent;o.content.constructor===W?t.add(s):Sw(n,o)});for(let o of t)vd(o)})},Yf=(e,t,r)=>{let n=r,o=ds(t.currentAttributes),s=t.right;for(;r>0&&t.right!==null;){if(t.right.deleted===!1)switch(t.right.content.constructor){case Vt:case me:case Ht:r<t.right.length&&yt(e,D(t.right.id.client,t.right.id.clock+r)),r-=t.right.length,t.right.delete(e);break}t.forward()}s&&bd(e,s,t.right,o,t.currentAttributes);let i=(t.left||t.right).parent;return i._searchMarker&&ao(i._searchMarker,t.index,-n+r),t},ri=class extends hr{constructor(t,r,n){super(t,r),this.childListChanged=!1,this.keysChanged=new Set,n.forEach(o=>{o===null?this.childListChanged=!0:this.keysChanged.add(o)})}get changes(){if(this._changes===null){let t={keys:this.keys,delta:this.delta,added:new Set,deleted:new Set};this._changes=t}return this._changes}get delta(){if(this._delta===null){let t=this.target.doc,r=[];M(t,n=>{let o=new Map,s=new Map,i=this.target._start,a=null,c={},l="",u=0,f=0,p=()=>{if(a!==null){let d=null;switch(a){case"delete":f>0&&(d={delete:f}),f=0;break;case"insert":(typeof l=="object"||l.length>0)&&(d={insert:l},o.size>0&&(d.attributes={},o.forEach((h,m)=>{h!==null&&(d.attributes[m]=h)}))),l="";break;case"retain":u>0&&(d={retain:u},rf(c)||(d.attributes=tf({},c))),u=0;break}d&&r.push(d),a=null}};for(;i!==null;){switch(i.content.constructor){case Vt:case me:this.adds(i)?this.deletes(i)||(p(),a="insert",l=i.content.getContent()[0],p()):this.deletes(i)?(a!=="delete"&&(p(),a="delete"),f+=1):i.deleted||(a!=="retain"&&(p(),a="retain"),u+=1);break;case Ht:this.adds(i)?this.deletes(i)||(a!=="insert"&&(p(),a="insert"),l+=i.content.str):this.deletes(i)?(a!=="delete"&&(p(),a="delete"),f+=i.length):i.deleted||(a!=="retain"&&(p(),a="retain"),u+=i.length);break;case W:{let{key:d,value:h}=i.content;if(this.adds(i)){if(!this.deletes(i)){let m=o.get(d)??null;ke(m,h)?h!==null&&i.delete(n):(a==="retain"&&p(),ke(h,s.get(d)??null)?delete c[d]:c[d]=h)}}else if(this.deletes(i)){s.set(d,h);let m=o.get(d)??null;ke(m,h)||(a==="retain"&&p(),c[d]=m)}else if(!i.deleted){s.set(d,h);let m=c[d];m!==void 0&&(ke(m,h)?m!==null&&i.delete(n):(a==="retain"&&p(),h===null?delete c[d]:c[d]=h))}i.deleted||(a==="insert"&&p(),dn(o,i.content));break}}i=i.right}for(p();r.length>0;){let d=r[r.length-1];if(d.retain!==void 0&&d.attributes===void 0)r.pop();else break}}),this._delta=r}return this._delta}},ln=class e extends K{constructor(t){super(),this._pending=t!==void 0?[()=>this.insert(0,t)]:[],this._searchMarker=[],this._hasFormatting=!1}get length(){return this.doc??lt(),this._length}_integrate(t,r){super._integrate(t,r);try{this._pending.forEach(n=>n())}catch(n){console.error(n)}this._pending=null}_copy(){return new e}clone(){let t=new e;return t.applyDelta(this.toDelta()),t}_callObserver(t,r){super._callObserver(t,r);let n=new ri(this,t,r);di(this,t,n),!t.local&&this._hasFormatting&&(t._needFormattingCleanup=!0)}toString(){this.doc??lt();let t="",r=this._start;for(;r!==null;)!r.deleted&&r.countable&&r.content.constructor===Ht&&(t+=r.content.str),r=r.right;return t}toJSON(){return this.toString()}applyDelta(t,{sanitize:r=!0}={}){this.doc!==null?M(this.doc,n=>{let o=new lo(null,this._start,0,new Map);for(let s=0;s<t.length;s++){let i=t[s];if(i.insert!==void 0){let a=!r&&typeof i.insert=="string"&&s===t.length-1&&o.right===null&&i.insert.slice(-1)===`
`?i.insert.slice(0,-1):i.insert;(typeof a!="string"||a.length>0)&&ac(n,this,o,a,i.attributes||{})}else i.retain!==void 0?$f(n,this,o,i.retain,i.attributes||{}):i.delete!==void 0&&Yf(n,o,i.delete)}}):this._pending.push(()=>this.applyDelta(t))}toDelta(t,r,n){this.doc??lt();let o=[],s=new Map,i=this.doc,a="",c=this._start;function l(){if(a.length>0){let f={},p=!1;s.forEach((h,m)=>{p=!0,f[m]=h});let d={insert:a};p&&(d.attributes=f),o.push(d),a=""}}let u=()=>{for(;c!==null;){if(Ie(c,t)||r!==void 0&&Ie(c,r))switch(c.content.constructor){case Ht:{let f=s.get("ychange");t!==void 0&&!Ie(c,t)?(f===void 0||f.user!==c.id.client||f.type!=="removed")&&(l(),s.set("ychange",n?n("removed",c.id):{type:"removed"})):r!==void 0&&!Ie(c,r)?(f===void 0||f.user!==c.id.client||f.type!=="added")&&(l(),s.set("ychange",n?n("added",c.id):{type:"added"})):f!==void 0&&(l(),s.delete("ychange")),a+=c.content.str;break}case Vt:case me:{l();let f={insert:c.content.getContent()[0]};if(s.size>0){let p={};f.attributes=p,s.forEach((d,h)=>{p[h]=d})}o.push(f);break}case W:Ie(c,t)&&(l(),dn(s,c.content));break}c=c.right}l()};return t||r?M(i,f=>{t&&fc(f,t),r&&fc(f,r),u()},"cleanup"):u(),o}insert(t,r,n){if(r.length<=0)return;let o=this.doc;o!==null?M(o,s=>{let i=Gs(s,this,t,!n);n||(n={},i.currentAttributes.forEach((a,c)=>{n[c]=a})),ac(s,this,i,r,n)}):this._pending.push(()=>this.insert(t,r,n))}insertEmbed(t,r,n){let o=this.doc;o!==null?M(o,s=>{let i=Gs(s,this,t,!n);ac(s,this,i,r,n||{})}):this._pending.push(()=>this.insertEmbed(t,r,n||{}))}delete(t,r){if(r===0)return;let n=this.doc;n!==null?M(n,o=>{Yf(o,Gs(o,this,t,!0),r)}):this._pending.push(()=>this.delete(t,r))}format(t,r,n){if(r===0)return;let o=this.doc;o!==null?M(o,s=>{let i=Gs(s,this,t,!1);i.right!==null&&$f(s,this,i,r,n)}):this._pending.push(()=>this.format(t,r,n))}removeAttribute(t){this.doc!==null?M(this.doc,r=>{Zs(r,this,t)}):this._pending.push(()=>this.removeAttribute(t))}setAttribute(t,r){this.doc!==null?M(this.doc,n=>{Oc(n,this,t,r)}):this._pending.push(()=>this.setAttribute(t,r))}getAttribute(t){return Uc(this,t)}getAttributes(){return gd(this)}_write(t){t.writeTypeRef(jw)}},bw=e=>new ln,eo=class{constructor(t,r=()=>!0){this._filter=r,this._root=t,this._currentNode=t._start,this._firstCall=!0,t.doc??lt()}[Symbol.iterator](){return this}next(){let t=this._currentNode,r=t&&t.content&&t.content.type;if(t!==null&&(!this._firstCall||t.deleted||!this._filter(r)))do if(r=t.content.type,!t.deleted&&(r.constructor===Er||r.constructor===yr)&&r._start!==null)t=r._start;else for(;t!==null;){let n=t.next;if(n!==null){t=n;break}else t.parent===this._root?t=null:t=t.parent._item}while(t!==null&&(t.deleted||!this._filter(t.content.type)));return this._firstCall=!1,t===null?{value:void 0,done:!0}:(this._currentNode=t,{value:t.content.type,done:!1})}},yr=class e extends K{constructor(){super(),this._prelimContent=[]}get firstChild(){let t=this._first;return t?t.content.getContent()[0]:null}_integrate(t,r){super._integrate(t,r),this.insert(0,this._prelimContent),this._prelimContent=null}_copy(){return new e}clone(){let t=new e;return t.insert(0,this.toArray().map(r=>r instanceof K?r.clone():r)),t}get length(){return this.doc??lt(),this._prelimContent===null?this._length:this._prelimContent.length}createTreeWalker(t){return new eo(this,t)}querySelector(t){t=t.toUpperCase();let n=new eo(this,o=>o.nodeName&&o.nodeName.toUpperCase()===t).next();return n.done?null:n.value}querySelectorAll(t){return t=t.toUpperCase(),$t(new eo(this,r=>r.nodeName&&r.nodeName.toUpperCase()===t))}_callObserver(t,r){di(this,t,new ni(this,r,t))}toString(){return fd(this,t=>t.toString()).join("")}toJSON(){return this.toString()}toDOM(t=document,r={},n){let o=t.createDocumentFragment();return n!==void 0&&n._createAssociation(o,this),co(this,s=>{o.insertBefore(s.toDOM(t,r,n),null)}),o}insert(t,r){this.doc!==null?M(this.doc,n=>{hd(n,this,t,r)}):this._prelimContent.splice(t,0,...r)}insertAfter(t,r){if(this.doc!==null)M(this.doc,n=>{let o=t&&t instanceof K?t._item:t;Xs(n,this,o,r)});else{let n=this._prelimContent,o=t===null?0:n.findIndex(s=>s===t)+1;if(o===0&&t!==null)throw Tt("Reference item not found");n.splice(o,0,...r)}}delete(t,r=1){this.doc!==null?M(this.doc,n=>{md(n,this,t,r)}):this._prelimContent.splice(t,r)}toArray(){return ud(this)}push(t){this.insert(this.length,t)}unshift(t){this.insert(0,t)}get(t){return dd(this,t)}slice(t=0,r=this.length){return ld(this,t,r)}forEach(t){co(this,t)}_write(t){t.writeTypeRef($w)}},vw=e=>new yr,Er=class e extends yr{constructor(t="UNDEFINED"){super(),this.nodeName=t,this._prelimAttrs=new Map}get nextSibling(){let t=this._item?this._item.next:null;return t?t.content.type:null}get prevSibling(){let t=this._item?this._item.prev:null;return t?t.content.type:null}_integrate(t,r){super._integrate(t,r),this._prelimAttrs.forEach((n,o)=>{this.setAttribute(o,n)}),this._prelimAttrs=null}_copy(){return new e(this.nodeName)}clone(){let t=new e(this.nodeName),r=this.getAttributes();return ef(r,(n,o)=>{t.setAttribute(o,n)}),t.insert(0,this.toArray().map(n=>n instanceof K?n.clone():n)),t}toString(){let t=this.getAttributes(),r=[],n=[];for(let a in t)n.push(a);n.sort();let o=n.length;for(let a=0;a<o;a++){let c=n[a];r.push(c+'="'+t[c]+'"')}let s=this.nodeName.toLocaleLowerCase(),i=r.length>0?" "+r.join(" "):"";return`<${s}${i}>${super.toString()}</${s}>`}removeAttribute(t){this.doc!==null?M(this.doc,r=>{Zs(r,this,t)}):this._prelimAttrs.delete(t)}setAttribute(t,r){this.doc!==null?M(this.doc,n=>{Oc(n,this,t,r)}):this._prelimAttrs.set(t,r)}getAttribute(t){return Uc(this,t)}hasAttribute(t){return yd(this,t)}getAttributes(t){return t?Ed(this,t):gd(this)}toDOM(t=document,r={},n){let o=t.createElement(this.nodeName),s=this.getAttributes();for(let i in s){let a=s[i];typeof a=="string"&&o.setAttribute(i,a)}return co(this,i=>{o.appendChild(i.toDOM(t,r,n))}),n!==void 0&&n._createAssociation(o,this),o}_write(t){t.writeTypeRef(Fw),t.writeKey(this.nodeName)}},Cw=e=>new Er(e.readKey()),ni=class extends hr{constructor(t,r,n){super(t,n),this.childListChanged=!1,this.attributesChanged=new Set,r.forEach(o=>{o===null?this.childListChanged=!0:this.attributesChanged.add(o)})}},uo=class e extends gr{constructor(t){super(),this.hookName=t}_copy(){return new e(this.hookName)}clone(){let t=new e(this.hookName);return this.forEach((r,n)=>{t.set(n,r)}),t}toDOM(t=document,r={},n){let o=r[this.hookName],s;return o!==void 0?s=o.createDom(this):s=document.createElement(this.hookName),s.setAttribute("data-yjs-hook",this.hookName),n!==void 0&&n._createAssociation(s,this),s}_write(t){t.writeTypeRef(Yw),t.writeKey(this.hookName)}},xw=e=>new uo(e.readKey()),oi=class e extends ln{get nextSibling(){let t=this._item?this._item.next:null;return t?t.content.type:null}get prevSibling(){let t=this._item?this._item.prev:null;return t?t.content.type:null}_copy(){return new e}clone(){let t=new e;return t.applyDelta(this.toDelta()),t}toDOM(t=document,r,n){let o=t.createTextNode(this.toString());return n!==void 0&&n._createAssociation(o,this),o}toString(){return this.toDelta().map(t=>{let r=[];for(let o in t.attributes){let s=[];for(let i in t.attributes[o])s.push({key:i,value:t.attributes[o][i]});s.sort((i,a)=>i.key<a.key?-1:1),r.push({nodeName:o,attrs:s})}r.sort((o,s)=>o.nodeName<s.nodeName?-1:1);let n="";for(let o=0;o<r.length;o++){let s=r[o];n+=`<${s.nodeName}`;for(let i=0;i<s.attrs.length;i++){let a=s.attrs[i];n+=` ${a.key}="${a.value}"`}n+=">"}n+=t.insert;for(let o=r.length-1;o>=0;o--)n+=`</${r[o].nodeName}>`;return n}).join("")}toJSON(){return this.toString()}_write(t){t.writeTypeRef(Hw)}},Rw=e=>new oi,un=class{constructor(t,r){this.id=t,this.length=r}get deleted(){throw It()}mergeWith(t){return!1}write(t,r,n){throw It()}integrate(t,r){throw It()}},Tw=0,Et=class extends un{get deleted(){return!0}delete(){}mergeWith(t){return this.constructor!==t.constructor?!1:(this.length+=t.length,!0)}integrate(t,r){r>0&&(this.id.clock+=r,this.length-=r),Kf(t.doc.store,this)}write(t,r){t.writeInfo(Tw),t.writeLen(this.length-r)}getMissing(t,r){return null}},wr=class e{constructor(t){this.content=t}getLength(){return 1}getContent(){return[this.content]}isCountable(){return!0}copy(){return new e(this.content)}splice(t){throw It()}mergeWith(t){return!1}integrate(t,r){}delete(t){}gc(t){}write(t,r){t.writeBuf(this.content)}getRef(){return 3}},Iw=e=>new wr(e.readBuf()),fn=class e{constructor(t){this.len=t}getLength(){return this.len}getContent(){return[]}isCountable(){return!1}copy(){return new e(this.len)}splice(t){let r=new e(this.len-t);return this.len=t,r}mergeWith(t){return this.len+=t.len,!0}integrate(t,r){no(t.deleteSet,r.id.client,r.id.clock,this.len),r.markDeleted()}delete(t){}gc(t){}write(t,r){t.writeLen(this.len-r)}getRef(){return 1}},Aw=e=>new fn(e.readLen()),Cd=(e,t)=>new ne({guid:e,...t,shouldLoad:t.shouldLoad||t.autoLoad||!1}),Sr=class e{constructor(t){t._item&&console.error("This document was already integrated as a sub-document. You should create a second instance instead with the same guid."),this.doc=t;let r={};this.opts=r,t.gc||(r.gc=!1),t.autoLoad&&(r.autoLoad=!0),t.meta!==null&&(r.meta=t.meta)}getLength(){return 1}getContent(){return[this.doc]}isCountable(){return!0}copy(){return new e(Cd(this.doc.guid,this.opts))}splice(t){throw It()}mergeWith(t){return!1}integrate(t,r){this.doc._item=r,t.subdocsAdded.add(this.doc),this.doc.shouldLoad&&t.subdocsLoaded.add(this.doc)}delete(t){t.subdocsAdded.has(this.doc)?t.subdocsAdded.delete(this.doc):t.subdocsRemoved.add(this.doc)}gc(t){}write(t,r){t.writeString(this.doc.guid),t.writeAny(this.opts)}getRef(){return 9}},kw=e=>new Sr(Cd(e.readString(),e.readAny())),me=class e{constructor(t){this.embed=t}getLength(){return 1}getContent(){return[this.embed]}isCountable(){return!0}copy(){return new e(this.embed)}splice(t){throw It()}mergeWith(t){return!1}integrate(t,r){}delete(t){}gc(t){}write(t,r){t.writeJSON(this.embed)}getRef(){return 5}},Dw=e=>new me(e.readJSON()),W=class e{constructor(t,r){this.key=t,this.value=r}getLength(){return 1}getContent(){return[]}isCountable(){return!1}copy(){return new e(this.key,this.value)}splice(t){throw It()}mergeWith(t){return!1}integrate(t,r){let n=r.parent;n._searchMarker=null,n._hasFormatting=!0}delete(t){}gc(t){}write(t,r){t.writeKey(this.key),t.writeJSON(this.value)}getRef(){return 6}},Ow=e=>new W(e.readKey(),e.readJSON()),fo=class e{constructor(t){this.arr=t}getLength(){return this.arr.length}getContent(){return this.arr}isCountable(){return!0}copy(){return new e(this.arr)}splice(t){let r=new e(this.arr.slice(t));return this.arr=this.arr.slice(0,t),r}mergeWith(t){return this.arr=this.arr.concat(t.arr),!0}integrate(t,r){}delete(t){}gc(t){}write(t,r){let n=this.arr.length;t.writeLen(n-r);for(let o=r;o<n;o++){let s=this.arr[o];t.writeString(s===void 0?"undefined":JSON.stringify(s))}}getRef(){return 2}},Uw=e=>{let t=e.readLen(),r=[];for(let n=0;n<t;n++){let o=e.readString();o==="undefined"?r.push(void 0):r.push(JSON.parse(o))}return new fo(r)},Lw=qn("node_env")==="development",Ue=class e{constructor(t){this.arr=t,Lw&&Ba(t)}getLength(){return this.arr.length}getContent(){return this.arr}isCountable(){return!0}copy(){return new e(this.arr)}splice(t){let r=new e(this.arr.slice(t));return this.arr=this.arr.slice(0,t),r}mergeWith(t){return this.arr=this.arr.concat(t.arr),!0}integrate(t,r){}delete(t){}gc(t){}write(t,r){let n=this.arr.length;t.writeLen(n-r);for(let o=r;o<n;o++){let s=this.arr[o];t.writeAny(s)}}getRef(){return 8}},Mw=e=>{let t=e.readLen(),r=[];for(let n=0;n<t;n++)r.push(e.readAny());return new Ue(r)},Ht=class e{constructor(t){this.str=t}getLength(){return this.str.length}getContent(){return this.str.split("")}isCountable(){return!0}copy(){return new e(this.str)}splice(t){let r=new e(this.str.slice(t));this.str=this.str.slice(0,t);let n=this.str.charCodeAt(t-1);return n>=55296&&n<=56319&&(this.str=this.str.slice(0,t-1)+"\uFFFD",r.str="\uFFFD"+r.str.slice(1)),r}mergeWith(t){return this.str+=t.str,!0}integrate(t,r){}delete(t){}gc(t){}write(t,r){t.writeString(r===0?this.str:this.str.slice(r))}getRef(){return 4}},Nw=e=>new Ht(e.readString()),Pw=[Ew,ww,bw,Cw,vw,xw,Rw],Vw=0,Bw=1,jw=2,Fw=3,$w=4,Yw=5,Hw=6,Vt=class e{constructor(t){this.type=t}getLength(){return 1}getContent(){return[this.type]}isCountable(){return!0}copy(){return new e(this.type._copy())}splice(t){throw It()}mergeWith(t){return!1}integrate(t,r){this.type._integrate(t.doc,r)}delete(t){let r=this.type._start;for(;r!==null;)r.deleted?r.id.clock<(t.beforeState.get(r.id.client)||0)&&t._mergeStructs.push(r):r.delete(t),r=r.right;this.type._map.forEach(n=>{n.deleted?n.id.clock<(t.beforeState.get(n.id.client)||0)&&t._mergeStructs.push(n):n.delete(t)}),t.changed.delete(this.type)}gc(t){let r=this.type._start;for(;r!==null;)r.gc(t,!0),r=r.right;this.type._start=null,this.type._map.forEach(n=>{for(;n!==null;)n.gc(t,!0),n=n.left}),this.type._map=new Map}write(t,r){this.type._write(t)}getRef(){return 7}},Gw=e=>new Vt(Pw[e.readTypeRef()](e)),gc=(e,t)=>{let r=t,n=0,o;do n>0&&(r=D(r.client,r.clock+n)),o=lr(e,r),n=r.clock-o.id.clock,r=o.redone;while(r!==null&&o instanceof N);return{item:o,diff:n}},Lc=(e,t)=>{for(;e!==null&&e.keep!==t;)e.keep=t,e=e.parent._item},si=(e,t,r)=>{let{client:n,clock:o}=t.id,s=new N(D(n,o+r),t,D(n,o+r-1),t.right,t.rightOrigin,t.parent,t.parentSub,t.content.splice(r));return t.deleted&&s.markDeleted(),t.keep&&(s.keep=!0),t.redone!==null&&(s.redone=D(t.redone.client,t.redone.clock+r)),t.right=s,s.right!==null&&(s.right.left=s),e._mergeStructs.push(s),s.parentSub!==null&&s.right===null&&s.parent._map.set(s.parentSub,s),t.length=r,s},Hf=(e,t)=>Pn(e,r=>_r(r.deletions,t)),xd=(e,t,r,n,o,s)=>{let i=e.doc,a=i.store,c=i.clientID,l=t.redone;if(l!==null)return yt(e,l);let u=t.parent._item,f=null,p;if(u!==null&&u.deleted===!0){if(u.redone===null&&(!r.has(u)||xd(e,u,r,n,o,s)===null))return null;for(;u.redone!==null;)u=yt(e,u.redone)}let d=u===null?t.parent:u.content.type;if(t.parentSub===null){for(f=t.left,p=t;f!==null;){let E=f;for(;E!==null&&E.parent._item!==u;)E=E.redone===null?null:yt(e,E.redone);if(E!==null&&E.parent._item===u){f=E;break}f=f.left}for(;p!==null;){let E=p;for(;E!==null&&E.parent._item!==u;)E=E.redone===null?null:yt(e,E.redone);if(E!==null&&E.parent._item===u){p=E;break}p=p.right}}else if(p=null,t.right&&!o){for(f=t;f!==null&&f.right!==null&&(f.right.redone||_r(n,f.right.id)||Hf(s.undoStack,f.right.id)||Hf(s.redoStack,f.right.id));)for(f=f.right;f.redone;)f=yt(e,f.redone);if(f&&f.right!==null)return null}else f=d._map.get(t.parentSub)||null;let h=F(a,c),m=D(c,h),y=new N(m,f,f&&f.lastId,p,p&&p.id,d,t.parentSub,t.content.copy());return t.redone=m,Lc(y,!0),y.integrate(e,0),y},N=class e extends un{constructor(t,r,n,o,s,i,a,c){super(t,c.getLength()),this.origin=n,this.left=r,this.right=o,this.rightOrigin=s,this.parent=i,this.parentSub=a,this.redone=null,this.content=c,this.info=this.content.isCountable()?2:0}set marker(t){(this.info&8)>0!==t&&(this.info^=8)}get marker(){return(this.info&8)>0}get keep(){return(this.info&1)>0}set keep(t){this.keep!==t&&(this.info^=1)}get countable(){return(this.info&2)>0}get deleted(){return(this.info&4)>0}set deleted(t){this.deleted!==t&&(this.info^=4)}markDeleted(){this.info|=4}getMissing(t,r){if(this.origin&&this.origin.client!==this.id.client&&this.origin.clock>=F(r,this.origin.client))return this.origin.client;if(this.rightOrigin&&this.rightOrigin.client!==this.id.client&&this.rightOrigin.clock>=F(r,this.rightOrigin.client))return this.rightOrigin.client;if(this.parent&&this.parent.constructor===de&&this.id.client!==this.parent.client&&this.parent.clock>=F(r,this.parent.client))return this.parent.client;if(this.origin&&(this.left=pc(t,r,this.origin),this.origin=this.left.lastId),this.rightOrigin&&(this.right=yt(t,this.rightOrigin),this.rightOrigin=this.right.id),this.left&&this.left.constructor===Et||this.right&&this.right.constructor===Et)this.parent=null;else if(!this.parent)this.left&&this.left.constructor===e?(this.parent=this.left.parent,this.parentSub=this.left.parentSub):this.right&&this.right.constructor===e&&(this.parent=this.right.parent,this.parentSub=this.right.parentSub);else if(this.parent.constructor===de){let n=lr(r,this.parent);n.constructor===Et?this.parent=null:this.parent=n.content.type}return null}integrate(t,r){if(r>0&&(this.id.clock+=r,this.left=pc(t,t.doc.store,D(this.id.client,this.id.clock-1)),this.origin=this.left.lastId,this.content=this.content.splice(r),this.length-=r),this.parent){if(!this.left&&(!this.right||this.right.left!==null)||this.left&&this.left.right!==this.right){let n=this.left,o;if(n!==null)o=n.right;else if(this.parentSub!==null)for(o=this.parent._map.get(this.parentSub)||null;o!==null&&o.left!==null;)o=o.left;else o=this.parent._start;let s=new Set,i=new Set;for(;o!==null&&o!==this.right;){if(i.add(o),s.add(o),cr(this.origin,o.origin)){if(o.id.client<this.id.client)n=o,s.clear();else if(cr(this.rightOrigin,o.rightOrigin))break}else if(o.origin!==null&&i.has(lr(t.doc.store,o.origin)))s.has(lr(t.doc.store,o.origin))||(n=o,s.clear());else break;o=o.right}this.left=n}if(this.left!==null){let n=this.left.right;this.right=n,this.left.right=this}else{let n;if(this.parentSub!==null)for(n=this.parent._map.get(this.parentSub)||null;n!==null&&n.left!==null;)n=n.left;else n=this.parent._start,this.parent._start=this;this.right=n}this.right!==null?this.right.left=this:this.parentSub!==null&&(this.parent._map.set(this.parentSub,this),this.left!==null&&this.left.delete(t)),this.parentSub===null&&this.countable&&!this.deleted&&(this.parent._length+=this.length),Kf(t.doc.store,this),this.content.integrate(t,this),Pf(t,this.parent,this.parentSub),(this.parent._item!==null&&this.parent._item.deleted||this.parentSub!==null&&this.right!==null)&&this.delete(t)}else new Et(this.id,this.length).integrate(t,0)}get next(){let t=this.right;for(;t!==null&&t.deleted;)t=t.right;return t}get prev(){let t=this.left;for(;t!==null&&t.deleted;)t=t.left;return t}get lastId(){return this.length===1?this.id:D(this.id.client,this.id.clock+this.length-1)}mergeWith(t){if(this.constructor===t.constructor&&cr(t.origin,this.lastId)&&this.right===t&&cr(this.rightOrigin,t.rightOrigin)&&this.id.client===t.id.client&&this.id.clock+this.length===t.id.clock&&this.deleted===t.deleted&&this.redone===null&&t.redone===null&&this.content.constructor===t.content.constructor&&this.content.mergeWith(t.content)){let r=this.parent._searchMarker;return r&&r.forEach(n=>{n.p===t&&(n.p=this,!this.deleted&&this.countable&&(n.index-=this.length))}),t.keep&&(this.keep=!0),this.right=t.right,this.right!==null&&(this.right.left=this),this.length+=t.length,!0}return!1}delete(t){if(!this.deleted){let r=this.parent;this.countable&&this.parentSub===null&&(r._length-=this.length),this.markDeleted(),no(t.deleteSet,this.id.client,this.id.clock,this.length),Pf(t,r,this.parentSub),this.content.delete(t)}}gc(t,r){if(!this.deleted)throw et();this.content.gc(t),r?XE(t,this,new Et(this.id,this.length)):this.content=new fn(this.length)}write(t,r){let n=r>0?D(this.id.client,this.id.clock+r-1):this.origin,o=this.rightOrigin,s=this.parentSub,i=this.content.getRef()&31|(n===null?0:128)|(o===null?0:64)|(s===null?0:32);if(t.writeInfo(i),n!==null&&t.writeLeftID(n),o!==null&&t.writeRightID(o),n===null&&o===null){let a=this.parent;if(a._item!==void 0){let c=a._item;if(c===null){let l=Tc(a);t.writeParentInfo(!0),t.writeString(l)}else t.writeParentInfo(!1),t.writeLeftID(c.id)}else a.constructor===String?(t.writeParentInfo(!0),t.writeString(a)):a.constructor===de?(t.writeParentInfo(!1),t.writeLeftID(a)):et();s!==null&&t.writeString(s)}this.content.write(t,r)}},Rd=(e,t)=>zw[t&31](e),zw=[()=>{et()},Aw,Uw,Iw,Nw,Dw,Ow,Gw,Mw,kw,()=>{et()}],qw=10,ct=class extends un{get deleted(){return!0}delete(){}mergeWith(t){return this.constructor!==t.constructor?!1:(this.length+=t.length,!0)}integrate(t,r){et()}write(t,r){t.writeInfo(qw),x(t.restEncoder,this.length-r)}getMissing(t,r){return null}},Td=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:{},Id="__ $YJS$ __";Td[Id]===!0&&console.error("Yjs was already imported. This breaks constructor checks and will lead to issues! - https://github.com/yjs/yjs/issues/438");Td[Id]=!0;var Mc=3e4,br=class extends ms{constructor(t){super(),this.doc=t,this.clientID=t.clientID,this.states=new Map,this.meta=new Map,this._checkInterval=setInterval(()=>{let r=Te();this.getLocalState()!==null&&Mc/2<=r-this.meta.get(this.clientID).lastUpdated&&this.setLocalState(this.getLocalState());let n=[];this.meta.forEach((o,s)=>{s!==this.clientID&&Mc<=r-o.lastUpdated&&this.states.has(s)&&n.push(s)}),n.length>0&&Nc(this,n,"timeout")},ot(Mc/10)),t.on("destroy",()=>{this.destroy()}),this.setLocalState({})}destroy(){this.emit("destroy",[this]),this.setLocalState(null),super.destroy(),clearInterval(this._checkInterval)}getLocalState(){return this.states.get(this.clientID)||null}setLocalState(t){let r=this.clientID,n=this.meta.get(r),o=n===void 0?0:n.clock+1,s=this.states.get(r);t===null?this.states.delete(r):this.states.set(r,t),this.meta.set(r,{clock:o,lastUpdated:Te()});let i=[],a=[],c=[],l=[];t===null?l.push(r):s==null?t!=null&&i.push(r):(a.push(r),ir(s,t)||c.push(r)),(i.length>0||c.length>0||l.length>0)&&this.emit("change",[{added:i,updated:c,removed:l},"local"]),this.emit("update",[{added:i,updated:a,removed:l},"local"])}setLocalStateField(t,r){let n=this.getLocalState();n!==null&&this.setLocalState({...n,[t]:r})}getStates(){return this.states}},Nc=(e,t,r)=>{let n=[];for(let o=0;o<t.length;o++){let s=t[o];if(e.states.has(s)){if(e.states.delete(s),s===e.clientID){let i=e.meta.get(s);e.meta.set(s,{clock:i.clock+1,lastUpdated:Te()})}n.push(s)}}n.length>0&&(e.emit("change",[{added:[],updated:[],removed:n},r]),e.emit("update",[{added:[],updated:[],removed:n},r]))};var Ad=1,pn="fromPersistence",kt="document",hn="state",vr="savedAt",kd="savedBy",Dd="version",mo="gutenberg",Pc="syncManager",go="gutenberg-undo-ignored";var ye=(e=>(e.AUTHENTICATION_FAILED="authentication-failed",e.CONNECTION_EXPIRED="connection-expired",e.CONNECTION_LIMIT_EXCEEDED="connection-limit-exceeded",e.DOCUMENT_SIZE_LIMIT_EXCEEDED="document-size-limit-exceeded",e.PROTOCOL_MISMATCH="protocol-mismatch",e.UNKNOWN_ERROR="unknown-error",e))(ye||{}),pi=class extends Error{constructor(e="unknown-error",t){super(t),this.code=e,this.name="ConnectionError"}};function Od(e){return function(...t){let r=performance.now(),n=e.apply(this,t),o=performance.now();return console.log(`[SyncManager][performance]: ${e.name} took ${(o-r).toFixed(2)} ms`),n}}function Ud(e){return((...t)=>e(...t))}var rp=g(hi(),1);var Jd=g(hi(),1);var Md=0,Nd=1,Kw=2,Pd=(e,t)=>{x(e,Md);let r=Rc(t);st(e,r)},Ww=(e,t,r)=>{x(e,Nd),st(e,vc(t,r))},Qw=(e,t,r)=>Ww(t,r,it(e)),Vd=(e,t,r,n)=>{try{bc(t,it(e),r)}catch(o){n?.(o),console.error("Caught error while handling a Yjs update",o)}};var Jw=Vd,Vc=(e,t,r,n,o)=>{let s=O(e);switch(s){case Md:Qw(e,t,r);break;case Nd:Vd(e,r,n,o);break;case Kw:Jw(e,r,n,o);break;default:throw new Error("Unknown message type")}return s};var Bd=g(hi(),1),Bc=3,jc=[2e3,4e3,8e3,12e3],Fc=[1e3,2e3,4e3,8e3],jd=3e4,Fd=15e3,Zw=1*1024*1024,$c=Math.floor(Zw/4)*3,yo=50,mi=15*1024*1024,$d=2*1024*1024,tS=4e3,eS=1e3;function Yd(e,t){let r=(0,Bd.applyFilters)(e,t);return typeof r!="number"||!Number.isFinite(r)||r<=0?t:Math.min(r,t)}var Yc=Yd("sync.pollingManager.pollingInterval",tS),Hd=Yd("sync.pollingManager.pollingIntervalWithCollaborators",eS),Gd=25*1e3;var _t=(e=>(e.COMPACTION="compaction",e.SYNC_STEP_1="sync_step1",e.SYNC_STEP_2="sync_step2",e.UPDATE="update",e))(_t||{});var Hc=g(Ft(),1);var zd="/wp-sync/v1/updates";function rS(e){let t="",r=e.byteLength;for(let n=0;n<r;n++)t+=String.fromCharCode(e[n]);return globalThis.btoa(t)}function Gc(e){let t=globalThis.atob(e),r=t.length,n=new Uint8Array(r);for(let o=0;o<r;o++)n[o]=t.charCodeAt(o);return n}function mn(e,t){return{data:rS(e),type:t}}function qd(e=[],t=!0){let r=t,n=[...e];return{add(o){n.push(o)},addBulk(o){o.length!==0&&n.push(...o)},clear(){n.splice(0,n.length)},get(){return r?[]:n.splice(0,n.length)},pause(){r=!0},peek(){return r?[]:[...n]},restore(o){let s=o.filter(i=>i.type!==_t.COMPACTION);s.length!==0&&n.unshift(...s)},restoreExact(o){o.length!==0&&n.unshift(...o)},resume(){r=!1},size(){return n.length},take(o){return r||o<=0?[]:n.splice(0,o)}}}function Kd(e){return(0,Hc.default)({method:"POST",path:zd,data:e})}function zc(e){e.rooms.length!==0&&(0,Hc.default)({method:"POST",path:zd,data:e,keepalive:!0}).catch(()=>{})}function Wd(e,t){let r=parseInt(String(e),10);return isNaN(r)?t:r}function Qd(e,t,r){if(e.length===0)return{window:[],nextOffset:0};let n=(t%e.length+e.length)%e.length;return{window:[...e.slice(n),...e.slice(0,n)].slice(0,Math.max(0,r)),nextOffset:(n+Math.max(0,r))%e.length}}var _o="polling-manager";function nS(e){return e?.data?.status===403}function oS(e){return e?.data?.status===413&&e?.code==="rest_sync_body_too_large"}function sS(e){return e?.code==="rest_sync_protocol_mismatch"}function iS(e,t){let r=new Set(t.map(o=>o.room)),n=Array.isArray(e.data.rooms)?e.data.rooms.filter(o=>r.has(o)):[];if(n.length>0){for(let o of n){let s=P.get(o);s&&(s.log("Permission denied, unregistering room",{error:e},"error",!0),gn(o,{sendDisconnectSignal:!1}))}for(let o of t){if(n.includes(o.room)||!P.has(o.room))continue;let s=P.get(o.room);o.updates.length>0&&s.updateQueue.restore(o.updates)}}else{let o=[...P.keys()];for(let s of o){let i=P.get(s);i&&(i.log("Permission denied, unregistering room",{error:e},"error",!0),gn(s,{sendDisconnectSignal:!1}))}}}var P=new Map;function aS(e){let t=e.filter(r=>[_t.COMPACTION,_t.UPDATE].includes(r.type)).map(r=>Gc(r.data));return mn(pr(t),_t.COMPACTION)}function cS(e){let t=Yt();return Pd(t,e),mn(gt(t),_t.SYNC_STEP_1)}function lS(e,t){let r=J(t),n=Yt();return Vc(r,n,e,_o),mn(gt(n),_t.SYNC_STEP_2)}function uS(e,t){let r=t.getStates(),n=new Set,o=new Set,s=new Set(Array.from(r.keys()).filter(i=>!e[i]));Object.entries(e).forEach(([i,a])=>{let c=Number(i);if(c===t.clientID)return;if(a===null){r.delete(c),s.add(c);return}if(!r.has(c)){r.set(c,a),n.add(c);return}let l=r.get(c);JSON.stringify(l)!==JSON.stringify(a)&&(r.set(c,a),o.add(c))}),n.size+o.size>0&&t.emit("change",[{added:Array.from(n),updated:Array.from(o),removed:[]}]),s.size>0&&Nc(t,Array.from(s),_o)}function fS(e,t){let r=Gc(e.data);switch(e.type){case _t.SYNC_STEP_1:return lS(t,r);case _t.SYNC_STEP_2:{let n=J(r),o=Yt();Vc(n,o,t,_o);return}case _t.COMPACTION:case _t.UPDATE:Gt(t,r,_o)}}function dS(e,t){if(!t.isPrimaryRoom||qc)return!1;qc=!0;let r=(0,Jd.applyFilters)("sync.pollingProvider.maxClientsPerRoom",Bc,t.room),n=Object.keys(e).length,o=Wd(r,Bc);return n>o?(t.log("Connection limit exceeded",{clientCount:n,maxClientsPerRoom:o,room:t.room}),!0):!1}var yi=!1,Cr=0,qc=!1,gi=!1,Eo=!1,So=document.visibilityState==="visible",wo=!1,Kc=!1,zt=Yc,Le=null,xr=mi,Wc=0;function Xd(){Kc=!0}function Zd(){let e=Array.from(P.entries()).map(([t,r])=>({after:0,awareness:null,client_id:r.clientId,room:t,updates:[]}));for(let t=0;t<e.length;t+=yo)zc({rooms:e.slice(t,t+yo)})}function tp(){let e=So;So=document.visibilityState==="visible",So&&!e&&Le&&(clearTimeout(Le),Le=null,Ei())}function pS(){let e=Array.from(P.values());if(e.length<=yo)return e;let t=e.find(i=>i.isPrimaryRoom),r=e.filter(i=>i!==t),n=yo-(t?1:0),{window:o,nextOffset:s}=Qd(r,Wc,n);return Wc=s,t?[t,...o]:o}var hS=new TextEncoder;function Qc(e){return hS.encode(JSON.stringify(e)).byteLength}function mS(e,t=[]){return{after:e.endCursor??0,awareness:e.localAwarenessState,client_id:e.clientId,room:e.room,updates:t}}function gS(e,t){return(e===0?0:1)+Qc(t)}function yS(e){let t={rooms:[]},r=[];for(let a of e){let c=mS(a),l={rooms:[...t.rooms,c]};if(t.rooms.length>0&&Qc(l)>xr)break;t.rooms.push(c),r.push(a)}let n=r.map(a=>a.updateQueue.peek()),o=r.map(()=>0),s=Qc(t),i=!0;for(;i;){i=!1;for(let a=0;a<r.length;a++){let c=n[a][o[a]];if(!c)continue;let l=gS(o[a],c);s+l>xr||(o[a]++,s+=l,i=!0)}}for(let a=0;a<r.length;a++)t.rooms[a].updates=r[a].updateQueue.take(o[a]);return{payload:t,roomsInRequest:r}}function ES(e){for(let t of e.rooms)!P.has(t.room)||t.updates.length===0||P.get(t.room).updateQueue.restoreExact(t.updates)}function Ei(){wo=!0,Le=null;async function e(){if(P.size===0){wo=!1;return}Kc=!1;let{payload:t,roomsInRequest:r}=yS(pS());r.forEach(n=>{n.onStatusChange({status:"connecting"})});try{let{rooms:n}=await Kd(t);Cr=0,gi=!1,xr=mi,r.forEach(o=>{P.get(o.room)===o&&o.onStatusChange({status:"connected"})}),Eo=!1,n.forEach(o=>{if(!P.has(o.room))return;let s=P.get(o.room);if(s.endCursor=o.end_cursor,dS(o.awareness,s)){s.onStatusChange({status:"disconnected",error:new pi(ye.CONNECTION_LIMIT_EXCEEDED,"Connection limit exceeded")}),gn(o.room);return}s.processAwarenessUpdate(o.awareness),s.isPrimaryRoom&&Object.keys(o.awareness).length>1&&(Eo=!0,P.forEach(a=>{a.updateQueue.resume()}));let i=[];for(let a of o.updates)try{let c=s.processDocUpdate(a);c&&i.push(c)}catch(c){s.log("Failed to apply sync update",{error:c,update:a},"error",!0)}s.updateQueue.addBulk(i),o.should_compact?(s.log("Server requested compaction update"),s.updateQueue.clear(),s.updateQueue.add(s.createCompactionUpdate())):o.compaction_request&&(s.log("Server requested (old) compaction update"),s.updateQueue.add(aS(o.compaction_request)))}),So&&Eo?zt=Hd:So?zt=Yc:zt=Gd}catch(n){if(nS(n)){if(iS(n,t.rooms),P.size===0){wo=!1;return}}else if(oS(n)){xr=Math.max($d,Math.floor(xr/2)),zt=Eo?Fc[0]:jc[0],ES(t);for(let o of t.rooms)P.has(o.room)&&P.get(o.room).log("Sync request body too large, retrying with smaller batches",{error:n,nextPoll:zt,syncRequestBodySizeLimit:xr},"error",!0)}else if(sS(n)){let o=[...P.entries()];for(let[,s]of o)s.onStatusChange({status:"disconnected",error:new pi(ye.PROTOCOL_MISMATCH,"Protocol mismatch between client and server")});for(let[s]of o)gn(s,{sendDisconnectSignal:!1});wo=!1;return}else{Cr++;let o=Eo?Fc:jc;Cr<=o.length?zt=o[Cr-1]:zt=jd,gi&&(zt=Fd,gi=!1);for(let s of t.rooms){if(!P.has(s.room))continue;let i=P.get(s.room);s.updates.length>0&&i.endCursor>0?(i.updateQueue.clear(),i.updateQueue.add(i.createCompactionUpdate())):s.updates.length>0&&i.updateQueue.restore(s.updates),i.log("Error posting sync update, will retry with backoff",{error:n,nextPoll:zt},"error",!0)}if(!Kc){let s=Cr>o.length;r.forEach(i=>{P.get(i.room)===i&&i.onStatusChange({status:"disconnected",canManuallyRetry:!0,consecutiveFailures:Cr,backgroundRetriesFailed:s,willAutoRetryInMs:zt})})}}}Le=setTimeout(Ei,zt)}e()}function wS({room:e,doc:t,awareness:r,log:n,onStatusChange:o}){if(P.has(e))return;let s=qd([cS(t)]),i=P.size===0;function a(){u.localAwarenessState=r.getLocalState()??{}}function c(f,p){if(_o!==p){if(f.byteLength>$c){let d=P.get(e);if(!d)return;d.log("Document size limit exceeded",{maxUpdateSizeInBytes:$c,updateSizeInBytes:f.byteLength}),d.onStatusChange({status:"disconnected",error:new pi(ye.DOCUMENT_SIZE_LIMIT_EXCEEDED,"Document size limit exceeded")}),gn(e);return}s.add(mn(f,_t.UPDATE))}}function l(){t.off("updateV2",c),r.off("change",a),s.clear()}let u={clientId:t.clientID,createCompactionUpdate:()=>mn(ge(t),_t.COMPACTION),endCursor:0,isPrimaryRoom:i,localAwarenessState:r.getLocalState()??{},log:n,onStatusChange:o,processAwarenessUpdate:f=>uS(f,r),processDocUpdate:f=>fS(f,t),room:e,unregister:l,updateQueue:s};t.on("updateV2",c),r.on("change",a),P.set(e,u),yi||(window.addEventListener("beforeunload",Xd),window.addEventListener("pagehide",Zd),document.addEventListener("visibilitychange",tp),yi=!0),wo||Ei()}function gn(e,{sendDisconnectSignal:t=!0}={}){let r=P.get(e);if(r){if(t){let n=[{after:0,awareness:null,client_id:r.clientId,room:e,updates:[]}];zc({rooms:n})}r.unregister(),P.delete(e)}P.size===0&&yi&&(window.removeEventListener("beforeunload",Xd),window.removeEventListener("pagehide",Zd),document.removeEventListener("visibilitychange",tp),yi=!1,qc=!1,Cr=0,Wc=0,xr=mi)}function SS(){gi=!0,Le&&(clearTimeout(Le),Le=null,Ei())}function wi(){Si.retryNow()}var Si={registerRoom:wS,retryNow:SS,unregisterRoom:gn};var _S=class extends ve{constructor(e){super(),this.options=e,this.log("Initializing",{room:e.room}),this.awareness=e.awareness??new br(e.ydoc),this.connect()}awareness;status="disconnected";connect(){this.log("Connecting"),Si.registerRoom({room:this.options.room,doc:this.options.ydoc,awareness:this.awareness,log:this.log,onStatusChange:this.emitStatus})}destroy(){this.disconnect(),super.destroy()}disconnect(){this.log("Disconnecting"),Si.unregisterRoom(this.options.room),this.emitStatus({status:"disconnected"})}emitStatus=e=>{let{status:t}=e,r=t==="disconnected"?e.error:void 0;this.status===t&&!r||t==="connecting"&&this.status!=="disconnected"||(this.log("Status change",{status:t,error:r}),this.status=t,this.emit("status",[e]))};log=(e,t={},r="log",n=!1)=>{if(!this.options.debug&&!n)return;(console[r]||console.log)(`[${this.constructor.name}]: ${e}`,{room:this.options.room,...t})}};function ep(){return async({awareness:e,objectType:t,objectId:r,ydoc:n})=>{let o=r?`${t}:${r}`:t,s=new _S({awareness:e,room:o,ydoc:n});return{destroy:()=>s.destroy(),on:(i,a)=>{s.on(i,a)}}}}var yn=null;function bS(){return window.__experimentalEnableRealTimeCollaboration?[ep()]:[]}function vS(e){return typeof e=="function"}function Jc(){if(yn)return yn;if(!window.__experimentalEnableRealTimeCollaboration)return[];let e=(0,rp.applyFilters)("sync.providers",bS());return Array.isArray(e)?(yn=e.filter(vS),yn):(yn=[],yn)}function np(e,t,r){let n=!1,o=new dr(t,{captureTimeout:500,trackedOrigins:new Set([mo])});o.on("stack-item-added",i=>{r.addUndoMeta(e,i.stackItem.meta),i.type==="undo"&&!n&&r.onUndoLevelOpened?.()}),o.on("stack-item-popped",i=>{r.restoreUndoMeta(e,i.stackItem.meta)});let s=i=>{n=!0;try{return(i==="undo"?o.undo():o.redo())!==null}finally{n=!1}};return{clearRedo:()=>o.clear(!1,!0),hasRedo:()=>o.canRedo(),hasUndo:()=>o.canUndo(),redo:()=>s("redo"),stopCapturing:()=>o.stopCapturing(),undo:()=>s("undo")}}function op(e){return xs(ci(po(e)))}function sp(e,t){let r;try{r=li(Rs(t))}catch{return!1}let n=po(e);for(let[i,a]of r.sv)if((n.sv.get(i)??0)<a)return!1;let o=po(e).ds,s=pe([o,r.ds]);return ai(n.ds,s)}function bo(e={}){let t=new Map(Object.entries(e));return new ne({meta:t})}function Xc(e){e.getMap(hn).set(Dd,Ad)}function Zc(e){let t=e.getMap(hn);t.set(vr,Date.now()),t.set(kd,e.clientID)}function ip(){return Math.floor(Math.random()*1e9)}function ap(e){let t=bo();Gt(t,ge(e));let r=ge(t);return t.destroy(),JSON.stringify({document:xs(r),updateId:ip()})}function cp(e){try{let{document:t}=JSON.parse(e),r={[pn]:!0},n=bo(r),o=Rs(t);return Gt(n,o),n.clientID=ip(),n}catch{return null}}function Dt(e,t){return`${e}_${t}`}function tl(e=!1){let t=e?Od:Ud,r=new Map,n=new Map,o={undo(_,T){return y(),n.get(Dt(_,T))?.undoManager.undo()??!1},redo(_,T){return y(),n.get(Dt(_,T))?.undoManager.redo()??!1},hasUndo(){return[...n.values()].some(_=>_.undoManager.hasUndo())},hasRedo(){return[...n.values()].some(_=>_.undoManager.hasRedo())},stopCapturing(){y(),n.forEach(_=>_.undoManager.stopCapturing())},clearRedo(){y(),n.forEach(_=>_.undoManager.clearRedo())}};function s(_,T,C,R={}){e&&console.log(`[SyncManager][${_}]: ${T}`,{...R,entityId:C})}async function i(_,T,C,R,A){let V=Jc(),j=Dt(T,C);if(V.length===0){s("loadEntity","no providers, skipping",j);return}if(n.has(j)){s("loadEntity","already loaded",j);return}if(_.shouldSync?.(T,C)===!1){s("loadEntity","shouldSync false, skipping",j);return}s("loadEntity","loading",j),A={addUndoMeta:t(A.addUndoMeta),editRecord:t(A.editRecord),getEditedRecord:t(A.getEditedRecord),onStatusChange:t(A.onStatusChange),persistCRDTDoc:t(A.persistCRDTDoc),refetchRecord:t(A.refetchRecord),restoreUndoMeta:t(A.restoreUndoMeta),onUndoLevelOpened:A.onUndoLevelOpened?t(A.onUndoLevelOpened):void 0};let Y=bo({objectType:T}),Ct=Y.getMap(kt),ht=Y.getMap(hn),_e=Date.now(),xt=!1,qe=!1,Ke=()=>{s("loadEntity","unloading",j),qe=!0,ya?.forEach(Mt=>Mt.destroy()),A.onStatusChange(null),xt&&(Ct.unobserveDeep(Lt),ht.unobserve(ce)),Y.destroy(),n.delete(j)},be=_.createAwareness?.(Y,C),Lt=(Mt,We)=>{We.local&&!(We.origin instanceof dr)||vt.updateEntityRecord(T,C)},ce=(Mt,We)=>{We.local||Mt.keysChanged.forEach($g=>{if($g===vr){let xu=ht.get(vr);typeof xu=="number"&&xu>_e&&(s("loadEntity","refetching record",j),A.refetchRecord().catch(()=>{}))}})},{addUndoMeta:Vr,onUndoLevelOpened:cs,restoreUndoMeta:jg}=A,Cu=np(Y,Ct,{addUndoMeta:Vr,restoreUndoMeta:jg,onUndoLevelOpened:()=>{n.forEach(Mt=>{Mt.undoManager!==Cu&&(Mt.undoManager.stopCapturing(),Mt.undoManager.clearRedo())}),cs?.()}}),ya,Fg={awareness:be,handlers:A,objectId:C,objectType:T,syncConfig:_,undoManager:Cu,unload:Ke,ydoc:Y};if(n.set(j,Fg),s("loadEntity","connecting",j),ya=await Promise.all(V.map(async Mt=>{let We=await Mt({objectType:T,objectId:C,ydoc:Y,awareness:be,Y:b});return We.on("status",A.onStatusChange),We})),qe){s("loadEntity","unloaded during connect, aborting",j),ya.forEach(Mt=>Mt.destroy());return}Xc(Y),vt.applyPersistedCrdtDoc(T,C,R),Ct.observeDeep(Lt),ht.observe(ce),xt=!0}async function a(_,T,C){let R=Jc(),A=Dt(T,null);if(R.length===0){s("loadCollection","no providers, skipping",A);return}if(r.has(T)){s("loadCollection","already loaded",A);return}if(_.shouldSync?.(T,null)===!1){s("loadCollection","shouldSync false, skipping",A);return}s("loadCollection","loading",A);let V=bo({collection:!0,objectType:T}),j=V.getMap(hn),Y=Date.now(),Ct=!1,ht=!1,_e=()=>{s("loadCollection","unloading",A),ht=!0,Ke?.forEach(Lt=>Lt.destroy()),C.onStatusChange(null),Ct&&j.unobserve(xt),V.destroy(),r.delete(T)},xt=(Lt,ce)=>{ce.local||Lt.keysChanged.forEach(Vr=>{if(Vr===vr){let cs=j.get(vr);typeof cs=="number"&&cs>Y&&C.refetchRecords().catch(()=>{})}})},qe=_.createAwareness?.(V),Ke,be={awareness:qe,handlers:C,syncConfig:_,unload:_e,ydoc:V};if(r.set(T,be),s("loadCollection","connecting",A),Ke=await Promise.all(R.map(async Lt=>{let ce=await Lt({awareness:qe,objectType:T,objectId:null,ydoc:V,Y:b});return ce.on("status",C.onStatusChange),ce})),ht){s("loadCollection","unloaded during connect, aborting",A),Ke.forEach(Lt=>Lt.destroy());return}j.observe(xt),Ct=!0,Xc(V)}function c(_,T){return n.has(Dt(_,T))}function l(_,T){let C=Dt(_,T);s("unloadEntity","unloading",C),n.get(C)?.unload(),d(_,null,{},origin,{isSave:!0})}function u(){s("unloadAll","unloading all entities","all");for(let[,_]of[...n])_.unload();n.clear();for(let[,_]of[...r])_.unload();r.clear()}function f(_,T){let C=Dt(_,T),R=n.get(C);if(!(!R||!R.awareness))return R.awareness}function p(_,T,C){let R=Dt(_,T),A=n.get(R);if(!A){s("applyPersistedCrdtDoc","no entity state",R);return}let{handlers:V,syncConfig:{applyChangesToCRDTDoc:j,getChangesFromCRDTDoc:Y,getPersistedCRDTDoc:Ct},ydoc:ht}=A,_e=Ct?.(C),xt=_e?cp(_e):null;if(!xt){s("applyPersistedCrdtDoc","no persisted doc",R),ht.transact(()=>{j(ht,C),V.persistCRDTDoc()},Pc);return}let qe=ge(xt);Gt(ht,qe);let Ke=Y(xt,C),be=Object.keys(Ke);if(xt.destroy(),be.length===0){s("applyPersistedCrdtDoc","valid persisted doc",R);return}s("applyPersistedCrdtDoc","invalidated keys",R,{invalidatedKeys:be});let Lt=be.reduce((ce,Vr)=>Object.assign(ce,{[Vr]:C[Vr]}),{});ht.transact(()=>{j(ht,Lt),V.persistCRDTDoc()},Pc)}function d(_,T,C,R,A={}){let{isSave:V=!1,isNewUndoLevel:j=!1}=A,Y=Dt(_,T),Ct=n.get(Y),ht=r.get(_);if(Ct){let{syncConfig:_e,ydoc:xt}=Ct;j&&o.stopCapturing(),xt.transact(()=>{s("updateCRDTDoc","applying changes",Y,{changedKeys:Object.keys(C)}),_e.applyChangesToCRDTDoc(xt,C),V&&Zc(xt)},R)}ht&&V&&ht.ydoc.transact(()=>{Zc(ht.ydoc)},R)}let h=[],m=!1;function y(){if(!m){m=!0;try{for(;h.length>0;){let _=h.shift();_&&d(..._)}}finally{m=!1}}}function E(..._){h.push(_),setTimeout(y,0)}function w(_,T,C,R,A={}){if((f(_,T)?.getStates().size??0)>1){y(),d(_,T,C,R,A);return}E(_,T,C,R,A)}function S(_,T){let C=Dt(_,T),R=n.get(C);if(!R){s("getEntitySnapshot","no entity state",C);return}return y(),op(R.ydoc)}function k(_,T,C){let R=Dt(_,T),A=n.get(R);return A?(y(),sp(A.ydoc,C)):!1}async function I(_,T){let C=Dt(_,T),R=n.get(C);if(!R){s("updateEntityRecord","no entity state",C);return}let{handlers:A,syncConfig:V,ydoc:j}=R,Y=V.getChangesFromCRDTDoc(j,await A.getEditedRecord()),Ct=Object.keys(Y);Ct.length!==0&&(s("updateEntityRecord","changes",C,{changedKeys:Ct}),A.editRecord(Y))}async function Q(_,T){let C=Dt(_,T),R=n.get(C);return R?.ydoc?(y(),ap(R.ydoc)):null}let vt={applyPersistedCrdtDoc:t(p),updateEntityRecord:t(I)};return{createPersistedCRDTDoc:t(Q),entityContainsSnapshot:t(k),getAwareness:f,getEntitySnapshot:t(S),isLoaded:c,load:t(i),loadCollection:t(a),undoManager:o,unload:t(l),unloadAll:t(u),update:t(w)}}var Rr=class{diff(t,r,n={}){let o;typeof n=="function"?(o=n,n={}):"callback"in n&&(o=n.callback);let s=this.castInput(t,n),i=this.castInput(r,n),a=this.removeEmpty(this.tokenize(s,n)),c=this.removeEmpty(this.tokenize(i,n));return this.diffWithOptionsObj(a,c,n,o)}diffWithOptionsObj(t,r,n,o){var s;let i=w=>{if(w=this.postProcess(w,n),o){setTimeout(function(){o(w)},0);return}else return w},a=r.length,c=t.length,l=1,u=a+c;n.maxEditLength!=null&&(u=Math.min(u,n.maxEditLength));let f=(s=n.timeout)!==null&&s!==void 0?s:1/0,p=Date.now()+f,d=[{oldPos:-1,lastComponent:void 0}],h=this.extractCommon(d[0],r,t,0,n);if(d[0].oldPos+1>=c&&h+1>=a)return i(this.buildValues(d[0].lastComponent,r,t));let m=-1/0,y=1/0,E=()=>{for(let w=Math.max(m,-l);w<=Math.min(y,l);w+=2){let S,k=d[w-1],I=d[w+1];k&&(d[w-1]=void 0);let Q=!1;if(I){let _=I.oldPos-w;Q=I&&0<=_&&_<a}let vt=k&&k.oldPos+1<c;if(!Q&&!vt){d[w]=void 0;continue}if(!vt||Q&&k.oldPos<I.oldPos?S=this.addToPath(I,!0,!1,0,n):S=this.addToPath(k,!1,!0,1,n),h=this.extractCommon(S,r,t,w,n),S.oldPos+1>=c&&h+1>=a)return i(this.buildValues(S.lastComponent,r,t))||!0;d[w]=S,S.oldPos+1>=c&&(y=Math.min(y,w-1)),h+1>=a&&(m=Math.max(m,w+1))}l++};if(o)(function w(){setTimeout(function(){if(l>u||Date.now()>p)return o(void 0);E()||w()},0)})();else for(;l<=u&&Date.now()<=p;){let w=E();if(w)return w}}addToPath(t,r,n,o,s){let i=t.lastComponent;return i&&!s.oneChangePerToken&&i.added===r&&i.removed===n?{oldPos:t.oldPos+o,lastComponent:{count:i.count+1,added:r,removed:n,previousComponent:i.previousComponent}}:{oldPos:t.oldPos+o,lastComponent:{count:1,added:r,removed:n,previousComponent:i}}}extractCommon(t,r,n,o,s){let i=r.length,a=n.length,c=t.oldPos,l=c-o,u=0;for(;l+1<i&&c+1<a&&this.equals(n[c+1],r[l+1],s);)l++,c++,u++,s.oneChangePerToken&&(t.lastComponent={count:1,previousComponent:t.lastComponent,added:!1,removed:!1});return u&&!s.oneChangePerToken&&(t.lastComponent={count:u,previousComponent:t.lastComponent,added:!1,removed:!1}),t.oldPos=c,l}equals(t,r,n){return n.comparator?n.comparator(t,r):t===r||!!n.ignoreCase&&t.toLowerCase()===r.toLowerCase()}removeEmpty(t){let r=[];for(let n=0;n<t.length;n++)t[n]&&r.push(t[n]);return r}castInput(t,r){return t}tokenize(t,r){return Array.from(t)}join(t){return t.join("")}postProcess(t,r){return t}get useLongestToken(){return!1}buildValues(t,r,n){let o=[],s;for(;t;)o.push(t),s=t.previousComponent,delete t.previousComponent,t=s;o.reverse();let i=o.length,a=0,c=0,l=0;for(;a<i;a++){let u=o[a];if(u.removed)u.value=this.join(n.slice(l,l+u.count)),l+=u.count;else{if(!u.added&&this.useLongestToken){let f=r.slice(c,c+u.count);f=f.map(function(p,d){let h=n[l+d];return h.length>p.length?h:p}),u.value=this.join(f)}else u.value=this.join(r.slice(c,c+u.count));c+=u.count,u.added||(l+=u.count)}}return o}};var el=class extends Rr{},lp=new el;function _i(e,t,r){return lp.diff(e,t,r)}var rl=class extends Rr{constructor(){super(...arguments),this.tokenize=CS}equals(t,r,n){return n.ignoreWhitespace?((!n.newlineIsToken||!t.includes(`
`))&&(t=t.trim()),(!n.newlineIsToken||!r.includes(`
`))&&(r=r.trim())):n.ignoreNewlineAtEof&&!n.newlineIsToken&&(t.endsWith(`
`)&&(t=t.slice(0,-1)),r.endsWith(`
`)&&(r=r.slice(0,-1))),super.equals(t,r,n)}},up=new rl;function nl(e,t,r){return up.diff(e,t,r)}function CS(e,t){t.stripTrailingCr&&(e=e.replace(/\r\n/g,`
`));let r=[],n=e.split(/(\n|\r\n)/);n[n.length-1]||n.pop();for(let o=0;o<n.length;o++){let s=n[o];o%2&&!t.newlineIsToken?r[r.length-1]+=s:r.push(s)}return r}var bi=g(le(),1);var fp=g(le(),1);function xS(e){return JSON.parse(JSON.stringify(e))}var ol;(e=>{function t(s={},i={},a=!1){typeof s!="object"&&(s={}),typeof i!="object"&&(i={});let c=xS(i);a||(c=Object.keys(c).reduce((l,u)=>((c[u]!==null||c[u]!==void 0)&&(l[u]=c[u]),l),{}));for(let l in s)s[l]!==void 0&&i[l]===void 0&&(c[l]=s[l]);return Object.keys(c).length>0?c:void 0}e.compose=t;function r(s={},i={}){typeof s!="object"&&(s={}),typeof i!="object"&&(i={});let a=Object.keys(s).concat(Object.keys(i)).reduce((c,l)=>((0,fp.default)(s[l],i[l])||(c[l]=i[l]===void 0?null:i[l]),c),{});return Object.keys(a).length>0?a:void 0}e.diff=r;function n(s={},i={}){s=s||{};let a=Object.keys(i).reduce((c,l)=>(i[l]!==s[l]&&s[l]!==void 0&&(c[l]=i[l]),c),{});return Object.keys(s).reduce((c,l)=>(s[l]!==i[l]&&i[l]===void 0&&(c[l]=null),c),a)}e.invert=n;function o(s,i,a=!1){if(typeof s!="object")return i;if(typeof i!="object")return;if(!a)return i;let c=Object.keys(i).reduce((l,u)=>(s[u]===void 0&&(l[u]=i[u]),l),{});return Object.keys(c).length>0?c:void 0}e.transform=o})(ol||(ol={}));var Tr=ol;var sl;(e=>{function t(r){return typeof r.delete=="number"?r.delete:typeof r.retain=="number"?r.retain:typeof r.retain=="object"&&r.retain!==null?1:typeof r.insert=="string"?r.insert.length:1}e.length=t})(sl||(sl={}));var Bt=sl;var wt=class{ops;index;offset;constructor(e){this.ops=e,this.index=0,this.offset=0}hasNext(){return this.peekLength()<1/0}next(e){e||(e=1/0);let t=this.ops[this.index];if(t){let r=this.offset,n=Bt.length(t);if(e>=n-r?(e=n-r,this.index+=1,this.offset=0):this.offset+=e,typeof t.delete=="number")return{delete:e};let o={};return t.attributes&&(o.attributes=t.attributes),typeof t.retain=="number"?o.retain=e:typeof t.retain=="object"&&t.retain!==null?o.retain=t.retain:typeof t.insert=="string"?o.insert=t.insert.substr(r,e):o.insert=t.insert,o}return{retain:1/0}}peek(){return this.ops[this.index]}peekLength(){return this.ops[this.index]?Bt.length(this.ops[this.index])-this.offset:1/0}peekType(){let e=this.ops[this.index];return e?typeof e.delete=="number"?"delete":typeof e.retain=="number"||typeof e.retain=="object"&&e.retain!==null?"retain":"insert":"retain"}rest(){if(this.hasNext()){if(this.offset===0)return this.ops.slice(this.index)}else return[];let e=this.offset,t=this.index,r=this.next(),n=this.ops.slice(this.index);return this.offset=e,this.index=t,[r].concat(n)}};function RS(e){return JSON.parse(JSON.stringify(e))}var TS="\0",IS=1e4;function il(e){return e.map(t=>({...t,count:t.value.length}))}var dp=(e,t)=>{if(typeof e!="object"||e===null)throw new Error(`cannot retain a ${typeof e}`);if(typeof t!="object"||t===null)throw new Error(`cannot retain a ${typeof t}`);let r=Object.keys(e)[0];if(!r||r!==Object.keys(t)[0])throw new Error(`embed types not matched: ${r} != ${Object.keys(t)[0]}`);return[r,e[r],t[r]]},AS=class bt{static Op=Bt;static OpIterator=wt;static AttributeMap=Tr;static handlers={};static registerEmbed(t,r){this.handlers[t]=r}static unregisterEmbed(t){delete this.handlers[t]}static getHandler(t){let r=this.handlers[t];if(!r)throw new Error(`no handlers for embed type "${t}"`);return r}ops;constructor(t){Array.isArray(t)?this.ops=t:t!=null&&Array.isArray(t.ops)?this.ops=t.ops:this.ops=[]}insert(t,r){let n={};return typeof t=="string"&&t.length===0?this:(n.insert=t,r!=null&&typeof r=="object"&&Object.keys(r).length>0&&(n.attributes=r),this.push(n))}delete(t){return t<=0?this:this.push({delete:t})}retain(t,r){if(typeof t=="number"&&t<=0)return this;let n={retain:t};return r!=null&&typeof r=="object"&&Object.keys(r).length>0&&(n.attributes=r),this.push(n)}push(t){let r=this.ops.length,n=this.ops[r-1];if(t=RS(t),typeof n=="object"){if(typeof t.delete=="number"&&typeof n.delete=="number")return this.ops[r-1]={delete:n.delete+t.delete},this;if(typeof n.delete=="number"&&t.insert!==null&&t.insert!==void 0&&(r-=1,n=this.ops[r-1],typeof n!="object"))return this.ops.unshift(t),this;if((0,bi.default)(t.attributes,n.attributes)){if(typeof t.insert=="string"&&typeof n.insert=="string")return this.ops[r-1]={insert:n.insert+t.insert},typeof t.attributes=="object"&&(this.ops[r-1].attributes=t.attributes),this;if(typeof t.retain=="number"&&typeof n.retain=="number")return this.ops[r-1]={retain:n.retain+t.retain},typeof t.attributes=="object"&&(this.ops[r-1].attributes=t.attributes),this}}return r===this.ops.length?this.ops.push(t):this.ops.splice(r,0,t),this}chop(){let t=this.ops[this.ops.length-1];return t&&typeof t.retain=="number"&&!t.attributes&&this.ops.pop(),this}filter(t){return this.ops.filter(t)}forEach(t){this.ops.forEach(t)}map(t){return this.ops.map(t)}partition(t){let r=[],n=[];return this.forEach(o=>{(t(o)?r:n).push(o)}),[r,n]}reduce(t,r){return this.ops.reduce(t,r)}changeLength(){return this.reduce((t,r)=>r.insert?t+Bt.length(r):r.delete?t-r.delete:t,0)}length(){return this.reduce((t,r)=>t+Bt.length(r),0)}slice(t=0,r=1/0){let n=[],o=new wt(this.ops),s=0;for(;s<r&&o.hasNext();){let i;s<t?i=o.next(t-s):(i=o.next(r-s),n.push(i)),s+=Bt.length(i)}return new bt(n)}compose(t){let r=new wt(this.ops),n=new wt(t.ops),o=[],s=n.peek();if(s!=null&&typeof s.retain=="number"&&(s.attributes===null||s.attributes===void 0)){let a=s.retain;for(;r.peekType()==="insert"&&r.peekLength()<=a;)a-=r.peekLength(),o.push(r.next());s.retain-a>0&&n.next(s.retain-a)}let i=new bt(o);for(;r.hasNext()||n.hasNext();)if(n.peekType()==="insert")i.push(n.next());else if(r.peekType()==="delete")i.push(r.next());else{let a=Math.min(r.peekLength(),n.peekLength()),c=r.next(a),l=n.next(a);if(l.retain){let u={};if(typeof c.retain=="number")u.retain=typeof l.retain=="number"?a:l.retain;else if(typeof l.retain=="number")c.retain===null||c.retain===void 0?u.insert=c.insert:u.retain=c.retain;else{let p=c.retain===null||c.retain===void 0?"insert":"retain",[d,h,m]=dp(c[p],l.retain),y=bt.getHandler(d);u[p]={[d]:y.compose(h,m,p==="retain")}}let f=Tr.compose(c.attributes,l.attributes,typeof c.retain=="number");if(f&&(u.attributes=f),i.push(u),!n.hasNext()&&(0,bi.default)(i.ops[i.ops.length-1],u)){let p=new bt(r.rest());return i.concat(p).chop()}}else typeof l.delete=="number"&&(typeof c.retain=="number"||typeof c.retain=="object"&&c.retain!==null)&&i.push(l)}return i.chop()}concat(t){let r=new bt(this.ops.slice());return t.ops.length>0&&(r.push(t.ops[0]),r.ops=r.ops.concat(t.ops.slice(1))),r}diff(t){if(this.ops===t.ops)return new bt;let r=this.deltasToStrings(t),n=il(_i(r[0],r[1])),o=new wt(this.ops),s=new wt(t.ops);return this.convertChangesToDelta(n,o,s).chop()}eachLine(t,r=`
`){let n=new wt(this.ops),o=new bt,s=0;for(;n.hasNext();){if(n.peekType()!=="insert")return;let i=n.peek(),a=Bt.length(i)-n.peekLength(),c=typeof i.insert=="string"?i.insert.indexOf(r,a)-a:-1;if(c<0)o.push(n.next());else if(c>0)o.push(n.next(c));else{if(t(o,n.next(1).attributes||{},s)===!1)return;s+=1,o=new bt}}o.length()>0&&t(o,{},s)}invert(t){let r=new bt;return this.reduce((n,o)=>{if(o.insert)r.delete(Bt.length(o));else{if(typeof o.retain=="number"&&(o.attributes===null||o.attributes===void 0))return r.retain(o.retain),n+o.retain;if(o.delete||typeof o.retain=="number"){let s=o.delete||o.retain;return t.slice(n,n+s).forEach(a=>{o.delete?r.push(a):o.retain&&o.attributes&&r.retain(Bt.length(a),Tr.invert(o.attributes,a.attributes))}),n+s}else if(typeof o.retain=="object"&&o.retain!==null){let s=t.slice(n,n+1),i=new wt(s.ops).next(),[a,c,l]=dp(o.retain,i.insert),u=bt.getHandler(a);return r.retain({[a]:u.invert(c,l)},Tr.invert(o.attributes,i.attributes)),n+1}}return n},0),r.chop()}transform(t,r=!1){if(r=!!r,typeof t=="number")return this.transformPosition(t,r);let n=t,o=new wt(this.ops),s=new wt(n.ops),i=new bt;for(;o.hasNext()||s.hasNext();)if(o.peekType()==="insert"&&(r||s.peekType()!=="insert"))i.retain(Bt.length(o.next()));else if(s.peekType()==="insert")i.push(s.next());else{let a=Math.min(o.peekLength(),s.peekLength()),c=o.next(a),l=s.next(a);if(c.delete)continue;if(l.delete)i.push(l);else{let u=c.retain,f=l.retain,p=typeof f=="object"&&f!==null?f:a;if(typeof u=="object"&&u!==null&&typeof f=="object"&&f!==null){let d=Object.keys(u)[0];if(d===Object.keys(f)[0]){let h=bt.getHandler(d);h&&(p={[d]:h.transform(u[d],f[d],r)})}}i.retain(p,Tr.transform(c.attributes,l.attributes,r))}}return i.chop()}transformPosition(t,r=!1){r=!!r;let n=new wt(this.ops),o=0;for(;n.hasNext()&&o<=t;){let s=n.peekLength(),i=n.peekType();if(n.next(),i==="delete"){t-=Math.min(s,t-o);continue}else i==="insert"&&(o<t||!r)&&(t+=s);o+=s}return t}diffWithCursor(t,r){if(this.ops===t.ops)return new bt;let n=this.deltasToStrings(t);if(Math.max(...n.map(f=>f.length))>IS){let f=il(nl(n[0],n[1])),p=new wt(this.ops),d=new wt(t.ops);return this.convertChangesToDelta(f,p,d).chop()}else if(r===null)return this.diff(t);let s=il(_i(n[0],n[1])),i=0,a=[];for(let f=0;f<s.length;f++){let p=s[f],d=i,h=i+(p.count??0),m=r>d&&r<=h,y=!p.added&&!p.removed,E=p.removed&&!p.added,w=s[f+1],S=w&&w.added&&!w.removed;if(y&&m&&S){let k=this.tryMoveInsertionToCursor(p,w,r,d);if(k){a.push(...k),f++,i=h;continue}}if(E){let k=this.tryMoveDeletionToCursor(p,a,r,i);if(k){a.pop(),a.push(...k),i+=p.count??0;continue}}a.push(p),p.added||(i+=p.count??0)}s=a;let c=new wt(this.ops),l=new wt(t.ops);return this.convertChangesToDelta(s,c,l).chop()}tryMoveInsertionToCursor(t,r,n,o){let s=r.value,i=s.length,a=n-o-i;if(!(t.value.substring(a,a+s.length)===s))return null;let u=t.value.substring(0,a),f=t.value.substring(a),p=[];return u.length>0&&p.push({value:u,count:u.length,added:!1,removed:!1}),p.push(r),f.length>0&&p.push({value:f,count:f.length,added:!1,removed:!1}),p}tryMoveDeletionToCursor(t,r,n,o){let s=r[r.length-1];if(!s||s.added||s.removed)return null;let i=o-(s.count??0),a=o;if(n<i||n>=a)return null;let c=t.value,l=n-i;if(!(s.value.substring(l,l+c.length)===c))return null;let p=s.value.substring(0,l),d=s.value.substring(l),h=t.count??0,m=d.substring(h),y=[];return p.length>0&&y.push({value:p,count:p.length,added:!1,removed:!1}),y.push(t),m.length>0&&y.push({value:m,count:m.length,added:!1,removed:!1}),y}deltasToStrings(t){return[this,t].map(r=>r.map(n=>{if(n.insert!==null||n.insert!==void 0)return typeof n.insert=="string"?n.insert:TS;let o=r===t?"on":"with";throw new Error("diff() called "+o+" non-document")}).join(""))}convertChangesToDelta(t,r,n){let o=new bt;return t.forEach(s=>{let i=s.count??0;for(;i>0;){let a=0;if(s.added)a=Math.min(n.peekLength(),i),o.push(n.next(a));else if(s.removed)a=Math.min(i,r.peekLength()),r.next(a),o.delete(a);else{a=Math.min(r.peekLength(),n.peekLength(),i);let c=r.next(a),l=n.next(a);(0,bi.default)(c.insert,l.insert)?o.retain(a,Tr.diff(c.attributes,l.attributes)):o.push(l).delete(a)}i-=a}}),o}},vo=AS;var hp=g(vi(),1),En;function mp(e){return En&&En!==e?((0,hp.default)("registerEntitySyncManager: an entity sync manager is already registered. The new manager was ignored."),()=>{}):(En=e,()=>{En===e&&(En=void 0)})}function jt(){return En}var Me=function(){return Me=Object.assign||function(t){for(var r,n=1,o=arguments.length;n<o;n++){r=arguments[n];for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(t[s]=r[s])}return t},Me.apply(this,arguments)};function gp(e){return e.toLowerCase()}var kS=[/([a-z0-9])([A-Z])/g,/([A-Z])([A-Z][a-z])/g],DS=/[^A-Z0-9]+/gi;function Ci(e,t){t===void 0&&(t={});for(var r=t.splitRegexp,n=r===void 0?kS:r,o=t.stripRegexp,s=o===void 0?DS:o,i=t.transform,a=i===void 0?gp:i,c=t.delimiter,l=c===void 0?" ":c,u=yp(yp(e,n,"$1\0$2"),s,"\0"),f=0,p=u.length;u.charAt(f)==="\0";)f++;for(;u.charAt(p-1)==="\0";)p--;return u.slice(f,p).split("\0").map(a).join(l)}function yp(e,t,r){return t instanceof RegExp?e.replace(t,r):t.reduce(function(n,o){return n.replace(o,r)},e)}function al(e,t){var r=e.charAt(0),n=e.substr(1).toLowerCase();return t>0&&r>="0"&&r<="9"?"_"+r+n:""+r.toUpperCase()+n}function Co(e,t){return t===void 0&&(t={}),Ci(e,Me({delimiter:"",transform:al},t))}function OS(e,t){return t===0?e.toLowerCase():al(e,t)}function xi(e,t){return t===void 0&&(t={}),Co(e,Me({transform:OS},t))}function Ep(e){return e.charAt(0).toUpperCase()+e.substr(1)}function US(e){return Ep(e.toLowerCase())}function wp(e,t){return t===void 0&&(t={}),Ci(e,Me({delimiter:" ",transform:US},t))}var Oo=g(Ft(),1),Vi=g(Ne(),1),z=g(Pe(),1);var _n=g(H(),1);var rh=g(Ir(),1);var Up=g(H(),1);var vp=100,Cp=5,xp=5e3;function LS(){let e=window.navigator.userAgent,t="Unknown";return e.includes("Firefox")?t="Firefox":e.includes("Edg")?t="Microsoft Edge":e.includes("Chrome")&&!e.includes("Edg")?t="Chrome":e.includes("Safari")&&!e.includes("Chrome")?t="Safari":e.includes("MSIE")||e.includes("Trident")?t="Internet Explorer":(e.includes("Opera")||e.includes("OPR"))&&(t="Opera"),t}function Rp(e,t,r){if(e.size!==t.size)return!1;for(let[n,o]of e.entries())if(!t.has(n)||!r(o,t.get(n)))return!1;return!0}function Tp(e,t){return!e||!t?e===t:Object.keys(e).length!==Object.keys(t).length?!1:Object.entries(e).every(([r,n])=>n===t[r])}function Ip(e){return typeof e!="object"||e===null||Array.isArray(e)?!1:["24","48","96"].every(t=>!(t in e)||typeof e[t]=="string")}function xo(e){return typeof e!="object"||e===null?!1:"id"in e&&"name"in e&&"slug"in e&&"browserType"in e&&"enteredAt"in e&&(e.id===null||typeof e.id=="number"&&Number.isInteger(e.id)&&e.id>0)&&typeof e.name=="string"&&e.name.trim()!==""&&typeof e.slug=="string"&&(!("avatar_urls"in e)||Ip(e.avatar_urls))&&typeof e.browserType=="string"&&typeof e.enteredAt=="number"&&Number.isFinite(e.enteredAt)}function Ap(e,t){let r={browserType:LS(),enteredAt:Date.now()};if(typeof e=="object"&&e){let n=e;if("id"in n&&"name"in n){let o={...r,..."avatar_urls"in n&&Ip(n.avatar_urls)?{avatar_urls:n.avatar_urls}:{},id:n.id,name:n.name,slug:"slug"in n&&typeof n.slug=="string"?n.slug:""};if(xo(o)&&o.id!==null)return o}}return{...r,id:null,name:"Anonymous User",slug:`anonymous-${t}`}}function kp(e,t){return typeof e=="object"&&e!==null&&t in e?e[t]:null}function cl(e){return Object.keys(e)}var Dp=class extends br{getStates(){return super.getStates()}getLocalStateField(e){let t=this.getLocalState();return kp(t,e)}setLocalStateField(e,t){super.setLocalStateField(e,t)}};var MS=class extends Dp{setLocalStateField(e,t){this.isFieldEqual(e,t,this.getLocalStateField(e)??void 0)||super.setLocalStateField(e,t)}isFieldEqual(e,t,r){if(["clientId","isConnected","isMe"].includes(e))return t===r;if(e in this.equalityFieldChecks){let n=this.equalityFieldChecks[e];return n(t,r)}throw new Error(`No equality check implemented for awareness state field "${e.toString()}".`)}isStateEqual(e,t){return[...new Set([...cl(e),...cl(t)])].every(r=>{let n=e[r],o=t[r];return this.isFieldEqual(r,n,o)})}},Op=class extends MS{hasSetupRun=!1;disconnectedCollaborators=new Set;seenStates=new Map;previousSnapshot=new Map;stateSubscriptions=[];myThrottledState={};throttleTimeouts=new Map;setUp=()=>{this.hasSetupRun||(this.hasSetupRun=!0,this.onSetUp(),this.on("change",({added:e,removed:t,updated:r})=>{[...e,...r].forEach(n=>{this.disconnectedCollaborators.delete(n)}),t.forEach(n=>{this.disconnectedCollaborators.add(n),setTimeout(()=>{this.disconnectedCollaborators.delete(n),this.updateSubscribers(!0)},xp)}),this.updateSubscribers()}))};getCurrentState(){return Array.from(this.previousSnapshot.values())}getSeenStates(){return this.seenStates}onStateChange(e){return this.stateSubscriptions.push(e),()=>{this.stateSubscriptions=this.stateSubscriptions.filter(t=>t!==e)}}setThrottledLocalStateField(e,t,r){this.setLocalStateField(e,t),this.throttleTimeouts.set(e,setTimeout(()=>{this.throttleTimeouts.delete(e),this.myThrottledState[e]&&(this.setLocalStateField(e,this.myThrottledState[e]),delete this.myThrottledState[e])},r))}setConnectionStatus(e){e?this.disconnectedCollaborators.delete(this.clientID):this.disconnectedCollaborators.add(this.clientID),this.updateSubscribers(!0)}updateSubscribers(e=!1){if(!this.stateSubscriptions.length)return;let t=this.getStates();this.seenStates=new Map([...this.seenStates.entries(),...t.entries()]);let r=new Map([...this.disconnectedCollaborators,...t.keys()].filter(n=>Object.keys(this.seenStates.get(n)??{}).length>0).map(n=>{let o=this.seenStates.get(n),s=!this.disconnectedCollaborators.has(n),i=n===this.clientID,a=i?this.myThrottledState:{},c={...o,...a,clientId:n,isConnected:s,isMe:i};return[n,c]}));!e&&Rp(this.previousSnapshot,r,this.isStateEqual.bind(this))||(this.previousSnapshot=r,this.stateSubscriptions.forEach(n=>{n(Array.from(r.values()))}))}};var v="core";var ll=class extends Op{onSetUp(){this.setCurrentCollaboratorInfo()}async setCurrentCollaboratorInfo(){let e;try{e=await(0,Up.resolveSelect)(v).getCurrentUser()}catch{}this.setLocalStateField("collaboratorInfo",Ap(e,this.clientID))}},ul={collaboratorInfo:Tp},Lp=class extends ll{equalityFieldChecks=ul};var Bp=g(H(),1);var jp=g(Ir(),1);var Pp=g(Np(),1),{lock:Vp,unlock:ut}=(0,Pp.__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/core-data");function Fp(e){let t=e;for(;t;){let r=t.parent;if(r instanceof b.Map&&r.parent instanceof b.Array&&r.get("clientId")!==void 0&&r.get("innerBlocks")instanceof b.Array)return r;t=r instanceof b.AbstractType?r:null}return null}function fl(e){let t=[],r=e;for(;r;){let n=r.parent;if(!n||!(n instanceof b.Array))return null;let o=-1;for(let i=0;i<n.length;i++)if(n.get(i)===r){o=i;break}if(o===-1)return null;t.unshift(o);let s=n.parent;if(s instanceof b.Map&&s.get("clientId")!==void 0)r=s;else break}return t}function dl(e,t){if(e.length===0)return null;for(let r=0;r<e.length;r++){let n=t[e[r]];if(!n)return null;if(r===e.length-1)return n.clientId;t=n.innerBlocks}return null}function $p(){return(0,Bp.useSelect)(e=>{let{getBlocksByName:t,getClientIdsTree:r}=ut(e(jp.store)),[n]=t("core/post-content");return r(n??"")},[])}var Ve=g(Ro(),1);function Be(e,t){return e.getMap(t)}function Ri(e={}){return new b.Map(Object.entries(e))}function Gp(e){return e instanceof b.Map}function Ti(e,t){let r=e.get(t);if(r instanceof b.Text)return r;let n=e;for(let o of t.split("."))if(n instanceof b.Map)n=n.get(o);else if(n instanceof b.Array){let s=Number.parseInt(o,10);if(!Number.isSafeInteger(s)||s<0||s.toString()!==o)return null;n=n.get(s)}else return null;return n instanceof b.Text?n:null}function To(e,t){let n=Be(t,kt).get("blocks");return n instanceof b.Array?qp(e,n):null}var Hp=57344;function zp(e){for(let r=Hp;r<Hp+16;r++){let n=String.fromCharCode(r);if(!e.includes(n))return n}return null}function Ii(e,t){if(!e.includes("<")&&!e.includes("&"))return t;let r=zp(e);if(!r)return t;let n=e.slice(0,t)+r+e.slice(t),s=(0,Ve.create)({html:n}).text.indexOf(r);return s===-1?t:s}function wn(e,t){if(!e.includes("<")&&!e.includes("&"))return t;let r=zp(e);if(!r)return t;let n=(0,Ve.create)({html:e}),o=(0,Ve.create)({text:r});n.formats[t]&&(o.formats[0]=n.formats[t]);let s=(0,Ve.insert)(n,o,t,t),a=(0,Ve.toHTMLString)({value:s}).indexOf(r);return a===-1?t:a}function qp(e,t){for(let r of t){if(r.get("clientId")===e)return r;let n=r.get("innerBlocks");if(n&&n.length>0){let o=qp(e,n);if(o)return o}}return null}var Qp=g(H(),1);var Jp=g(Ir(),1);var Ar=(e=>(e.None="none",e.Cursor="cursor",e.SelectionInOneBlock="selection-in-one-block",e.SelectionInMultipleBlocks="selection-in-multiple-blocks",e.WholeBlock="whole-block",e))(Ar||{}),Sn=(e=>(e.Forward="f",e.Backward="b",e))(Sn||{});function Xp(e,t,r,n){let{selectionDirection:o}=n??{},i=Be(r,kt).get("blocks"),a=Object.keys(e).length===0,c={type:"none"};if(a||!i)return c;let l=e.clientId===t.clientId,u=l&&e.offset===t.offset;if(l&&e.offset===void 0&&t.offset===void 0){let h=hl(e.clientId),m=h?Zp(h,i):null;return m?{type:"whole-block",blockPosition:m}:c}else if(u){let h=Ai(e,i);return h?{type:"cursor",cursorPosition:h}:c}else if(l){let h=Ai(e,i),m=Ai(t,i);return!h||!m?c:{type:"selection-in-one-block",cursorStartPosition:h,cursorEndPosition:m,selectionDirection:o}}let p=Kp(e,i),d=Kp(t,i);return!p||!d?c:{type:"selection-in-multiple-blocks",startEndpoint:p,endEndpoint:d,selectionDirection:o}}function Ai(e,t){let r=hl(e.clientId),n=r?NS(r,t):null;if(!n||!e.attributeKey||e.offset===void 0)return null;let o=n.get("attributes"),s=o?Ti(o,e.attributeKey):null;return s instanceof b.Text?{relativePosition:b.createRelativePositionFromTypeIndex(s,wn(s.toString(),e.offset)),absoluteOffset:e.offset,attributeKey:e.attributeKey}:null}function Kp(e,t){let r=Ai(e,t);if(r)return{type:"cursor",cursorPosition:r};let n=hl(e.clientId),o=n?Zp(n,t):null;return o?{type:"whole-block",blockPosition:o}:null}function hl(e){let{getBlockIndex:t,getBlockRootClientId:r,getBlockName:n}=(0,Qp.select)(Jp.store),o=[],s=e;for(;s;){let i=t(s);if(i===-1)return null;o.unshift(i);let a=r(s);if(!a||n(a)==="core/post-content")break;s=a}return o.length>0?o:null}function NS(e,t){let r=t;for(let n=0;n<e.length;n++){if(e[n]>=r.length)return null;let o=r.get(e[n]);if(!o)return null;if(n===e.length-1)return o;r=o.get("innerBlocks")??new b.Array}return null}function Zp(e,t){let r=t;for(let n=0;n<e.length;n++){if(e[n]>=r.length)return null;if(n===e.length-1)return b.createRelativePositionFromTypeIndex(r,e[n]);r=r.get(e[n])?.get("innerBlocks")??new b.Array}return null}function th(e,t){if(e.type!==t.type)return!1;switch(e.type){case"none":return!0;case"cursor":return ki(e.cursorPosition,t.cursorPosition);case"selection-in-one-block":return ki(e.cursorStartPosition,t.cursorStartPosition)&&ki(e.cursorEndPosition,t.cursorEndPosition)&&e.selectionDirection===t.selectionDirection;case"selection-in-multiple-blocks":return Wp(e.startEndpoint,t.startEndpoint)&&Wp(e.endEndpoint,t.endEndpoint)&&e.selectionDirection===t.selectionDirection;case"whole-block":return b.compareRelativePositions(e.blockPosition,t.blockPosition);default:return!1}}function Wp(e,t){return e.type!==t.type?!1:e.type==="cursor"&&t.type==="cursor"?ki(e.cursorPosition,t.cursorPosition):b.compareRelativePositions(e.blockPosition,t.blockPosition)}function ki(e,t){let r=b.compareRelativePositions(e.relativePosition,t.relativePosition),n=e.absoluteOffset===t.absoluteOffset;return r&&n}var nh=class extends ll{constructor(e,t,r,n){super(e),this.kind=t,this.name=r,this.postId=n}equalityFieldChecks={...ul,editorState:this.areEditorStatesEqual};onSetUp(){super.onSetUp(),this.subscribeToCollaboratorSelectionChanges()}subscribeToCollaboratorSelectionChanges(){let{getSelectionStart:e,getSelectionEnd:t,getSelectedBlocksInitialCaretPosition:r}=(0,_n.select)(rh.store),n=e(),o=t(),s=null,i=null;(0,_n.subscribe)(()=>{let a=e(),c=t();if(a===n&&c===o)return;i||(i={start:n,end:o}),n=a,o=c;let l=r();this.updateSelectionInEntityRecord(n,o,l),s&&clearTimeout(s),s=setTimeout(()=>{let u={};i&&(u.selectionDirection=VS(i.start,i.end,n,o),i=null);let f=Xp(n,o,this.doc,u);this.setThrottledLocalStateField("editorState",{selection:f},vp)},Cp)})}async updateSelectionInEntityRecord(e,t,r){let n={selection:{selectionStart:e,selectionEnd:t,initialPosition:r}},o={undoIgnore:!0};(0,_n.dispatch)(v).editEntityRecord(this.kind,this.name,this.postId,n,o)}areEditorStatesEqual(e,t){return!e||!t?e===t:!e.selection||!t.selection?e.selection===t.selection:th(e.selection,t.selection)}convertSelectionStateToAbsolute(e,t){if(e.type===Ar.None)return{richTextOffset:null,localClientId:null,attributeKey:null};if(e.type===Ar.WholeBlock){let a=b.createAbsolutePositionFromRelativePosition(e.blockPosition,this.doc),c=null;if(a&&a.type instanceof b.Array){let u=a.type.get(a.index);if(u instanceof b.Map){let f=fl(u);c=f?dl(f,t):null}}return{richTextOffset:null,localClientId:c,attributeKey:null}}if(e.type===Ar.SelectionInMultipleBlocks)return{richTextOffset:null,localClientId:null,attributeKey:null};let r="cursorPosition"in e?e.cursorPosition:e.cursorStartPosition,n=b.createAbsolutePositionFromRelativePosition(r.relativePosition,this.doc);if(!n)return{richTextOffset:null,localClientId:null,attributeKey:null};let o=Fp(n.type),s=o?fl(o):null,i=s?dl(s,t):null;return{richTextOffset:Ii(n.type.toString(),n.index),localClientId:i,attributeKey:r.attributeKey??null}}isYItem(e){return"content"in e}getDebugData(){let e=this.doc,t=Object.fromEntries(Array.from(e.share,([o,s])=>[o,s.toJSON()])),r=new Map(Array.from(this.getSeenStates().entries()).filter(([,o])=>xo(o.collaboratorInfo)).map(([o,s])=>[String(o),{name:s.collaboratorInfo.name,wpUserId:s.collaboratorInfo.id}])),n={};return e.store.clients.forEach((o,s)=>{let i=o.filter(this.isYItem);n[s]=i.map(a=>{let{left:c,right:l,...u}=a;return{...u,left:c?{id:c.id,length:c.length,origin:c.origin,content:c.content}:null,right:l?{id:l.id,length:l.length,origin:l.origin,content:l.content}:null}})}),{doc:t,clients:n,collaboratorMap:Object.fromEntries(r)}}};function VS(e,t,r,n){let o=!eh(e,r),s=!eh(t,n);return o&&!s?Sn.Backward:Sn.Forward}function eh(e,t){return e.clientId===t.clientId&&e.attributeKey===t.attributeKey&&e.offset===t.offset}var vh=g(le(),1),Do=g(Ne(),1);var ft=[];for(let e=0;e<256;++e)ft.push((e+256).toString(16).slice(1));function oh(e,t=0){return(ft[e[t+0]]+ft[e[t+1]]+ft[e[t+2]]+ft[e[t+3]]+"-"+ft[e[t+4]]+ft[e[t+5]]+"-"+ft[e[t+6]]+ft[e[t+7]]+"-"+ft[e[t+8]]+ft[e[t+9]]+"-"+ft[e[t+10]]+ft[e[t+11]]+ft[e[t+12]]+ft[e[t+13]]+ft[e[t+14]]+ft[e[t+15]]).toLowerCase()}var BS=new Uint8Array(16);function ml(){return crypto.getRandomValues(BS)}function jS(e,t,r){return!t&&!e&&crypto.randomUUID?crypto.randomUUID():FS(e,t,r)}function FS(e,t,r){e=e||{};let n=e.random??e.rng?.()??ml();if(n.length<16)throw new Error("Random bytes length must be >= 16");if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,t){if(r=r||0,r<0||r+16>t.length)throw new RangeError(`UUID byte range ${r}:${r+15} is out of buffer bounds`);for(let o=0;o<16;++o)t[r+o]=n[o];return t}return oh(n)}var Io=jS;var kr=g(le(),1),ch=g(Ne(),1),lh=g(Ro(),1);var sh=g(Ro(),1),$S=500;function YS(e){let t=new Map;return function(r){let n=t.get(r);if(n)return n;let o=sh.RichTextData.fromHTMLString(r);return t.size>=e&&t.delete(t.keys().next().value),t.set(r,o),o}}var ih=YS($S);var gl=new WeakMap;function El(e){if(e instanceof lh.RichTextData)return e.valueOf();if(Array.isArray(e))return e.map(El);if(e&&typeof e=="object"){let t={};for(let[r,n]of Object.entries(e))t[r]=El(n);return t}return e}function HS(e,t){let r={...t};for(let[n,o]of Object.entries(t)){if(QS(e,n)){delete r[n];continue}r[n]=El(o)}return r}function uh(e){return e.map(t=>{let{name:r,innerBlocks:n,attributes:o,validationIssues:s,...i}=t;return{...i,name:r,attributes:HS(r,o),innerBlocks:uh(n)}})}function wl(e,t){if(e?.type==="rich-text"&&typeof t=="string")return ih(t);if(Array.isArray(t))return t.map(r=>wl(e,r));if(t&&typeof t=="object"){let r={};for(let[n,o]of Object.entries(t))r[n]=wl(e?.query?.[n],o);return r}return t}function _l(e){return e.map(t=>{let{name:r,innerBlocks:n,attributes:o,...s}=t,i={...o};for(let[a,c]of Object.entries(o)){let l=ko(r,a);l&&(i[a]=wl(l,c))}return{...s,name:r,attributes:i,innerBlocks:_l(n??[])}})}function Sl(e,t){let r=t.toJSON(),n={innerBlocks:null,clientId:null},o=(0,kr.default)(Object.assign({},e,n),Object.assign({},r,n)),s=e.innerBlocks||[],i=t.get("innerBlocks");return o&&s.length===i?.length&&s.every((a,c)=>Sl(a,i.get(c)))}function fh(e,t){return new b.Map(Object.entries(t).map(([r,n])=>[r,GS(e,r,n)]))}function GS(e,t,r){let n=ko(e,t);return bl(n,r)}function bl(e,t){if(!e)return t;if(e.type==="rich-text")return new b.Text(t?.toString()??"");if(e.type==="array"&&e.query&&Array.isArray(t)){let r=e.query,n=new b.Array;return n.insert(0,t.map(o=>Oi(r,o))),n}return e.type==="object"&&e.query&&Ao(t)?Oi(e.query,t):t}function Ao(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function Oi(e,t){if(!Ao(t))return new b.Map;let r=Object.entries(t).map(([n,o])=>{let s=e[n];return[n,bl(s,o)]});return new b.Map(r)}function dh(e){return Ri(Object.fromEntries(Object.entries(e).map(([t,r])=>{switch(t){case"attributes":return[t,fh(e.name,r)];case"innerBlocks":{let n=new b.Array;return Array.isArray(r)?(n.insert(0,r.map(o=>dh(o))),[t,n]):[t,n]}default:return[t,r]}})))}function Ui(e,t,r,n={}){gl.has(t)||gl.set(t,uh(t));let o=gl.get(t)??[],s=Math.min(o.length??0,e.length),i=0,a=0;for(;i<s&&Sl(o[i],e.get(i));i++);for(;a<s-i&&Sl(o[o.length-a-1],e.get(e.length-a-1));a++);let c=s-i-a,l=Math.max(0,o.length-e.length),u=Math.max(0,e.length-o.length);for(let p=0;p<c;p++,i++){let d=o[i],h=e.get(i);Object.entries(d).forEach(([m,y])=>{switch(m){case"attributes":{let E=h.get(m),w=y;if(!E){h.set(m,fh(d.name,w));break}Object.entries(w).forEach(([S,k])=>{let I=E?.get(S),Q=WS(d.name,S,I),vt=I instanceof b.AbstractType;(!Q||vt||!(0,kr.default)(I,k))&&qS(d.name,d.clientId,S,k,E,r)}),E.forEach((S,k)=>{y.hasOwnProperty(k)||E.delete(k)});break}case"innerBlocks":{let E=h.get(m);E instanceof b.Array||(E=new b.Array,h.set(m,E)),Ui(E,y??[],r,n);break}case"clientId":{if(n.preserveClientIds)break;y!==h.get(m)&&h.set(m,y);break}default:(0,kr.default)(d[m],h.get(m))||h.set(m,y)}}),h.forEach((m,y)=>{d.hasOwnProperty(y)||h.delete(y)})}e.delete(i,u);for(let p=0;p<l;p++,i++){let d=[dh(o[i])];e.insert(i,d)}let f=new Set;for(let p=0;p<e.length;p++){let d=e.get(p),h=d.get("clientId");h&&(f.has(h)&&(h=Io(),d.set("clientId",h)),f.add(h))}}function ah(e,t){return t instanceof b.Map&&Ao(e)?(0,kr.default)(e,t.toJSON()):(0,kr.default)(e,t)}function zS(e,t,r,n,o){if(!r.query)return;let s=r.query,i=Math.min(t.length,e.length),a=0,c=0;for(;a<i&&ah(t[a],e.get(a));a++);for(;c<i-a&&ah(t[t.length-c-1],e.get(e.length-c-1));c++);let l=i-a-c;for(let p=0;p<l;p++){let d=e.get(a+p),h=t[a+p];if(d instanceof b.Map&&Ao(h))hh(d,h,s,n,o);else{e.delete(0,e.length),e.insert(0,t.map(m=>Oi(s,m)));return}}let u=Math.max(0,e.length-t.length);u>0&&e.delete(a+l,u);let f=Math.max(0,t.length-e.length);if(f>0){let p=a+l,d=new Array(f);for(let h=0;h<f;h++)d[h]=Oi(s,t[p+h]);e.insert(p,d)}}function ph(e,t,r,n,o,s){let i=r.get(n);if(e?.type==="rich-text"&&typeof t=="string"&&i instanceof b.Text)vl(i,t,KS(o,s,t));else if(e?.type==="array"&&e.query&&Array.isArray(t)&&i instanceof b.Array)zS(i,t,e,o,s);else if(e?.type==="object"&&e.query&&Ao(t)&&i instanceof b.Map)hh(i,t,e.query,o,s);else{let a=bl(e,t);(a!==t||!(0,kr.default)(i,t))&&r.set(n,a)}}function hh(e,t,r,n,o){for(let[s,i]of Object.entries(t))ph(r[s],i,e,s,n,o);for(let s of e.keys())Object.hasOwn(t,s)||e.delete(s)}function qS(e,t,r,n,o,s){let i=ko(e,r);ph(i,n,o,r,s,{attributeKey:r,clientId:t})}function KS(e,t,r){return e&&e.clientId===t.clientId&&e.attributeKey===t.attributeKey&&typeof e.offset=="number"&&Number.isInteger(e.offset)?wn(r,e.offset):null}var Di;function ko(e,t){if(!Di){Di=new Map;for(let r of(0,ch.getBlockTypes)())Di.set(r.name,new Map(Object.entries(r.attributes??{}).map(([n,o])=>{let{role:s,type:i,query:a}=o;return[n,{role:s,type:i,query:a}]})))}return Di.get(e)?.get(t)}function WS(e,t,r){let n=ko(e,t);return n?.type==="rich-text"?r instanceof b.Text:n?.type==="string"?typeof r=="string":n?.type==="array"&&n.query?r instanceof b.Array:n?.type==="object"&&n.query?r instanceof b.Map:!0}function QS(e,t){return ko(e,t)?.role==="local"}var yl;function vl(e,t,r=null){let n=new vo(e.toDelta()),o=new vo([{insert:t}]),s=n.diffWithCursor(o,r),i=r===null||JS(e,s,t)?s:n.diff(o);e.applyDelta(i.ops)}function JS(e,t,r){yl||(yl=new b.Doc);let n=yl.getText("verification-text");return n.delete(0,n.length),n.insert(0,e.toString()),n.applyDelta(t.ops),n.toString()===r}var Mi=g(H(),1),Cl=g(Ir(),1),Eh=g(Ne(),1);var XS=5,bn=(e=>(e.RelativeSelection="RelativeSelection",e.BlockSelection="BlockSelection",e))(bn||{});function gh(e,t=XS){let r=[],n=()=>r.slice(0),o=i=>{if(!i?.selectionStart?.clientId||!i?.selectionEnd?.clientId)return;let{selectionStart:a,selectionEnd:c}=i,l=mh(a,e),u=mh(c,e);s({start:l,end:u})},s=i=>{let a=i.start.clientId,c=i.end.clientId;r=r.filter(l=>!(l.start.clientId===a&&l.end.clientId===c)),r.unshift(i),r.length>t+1&&(r=r.slice(0,t+1))};return{getSelectionHistory:n,updateSelection:o}}function mh(e,t){let r=e.clientId,o=To(r,t)?.get("attributes"),s=e.attributeKey,i=null;if(s&&o&&(i=Ti(o,s)),!(i instanceof b.Text)||!s||!r)return{type:"BlockSelection",clientId:r};let a=e.offset??0,c=b.createRelativePositionFromTypeIndex(i,wn(i.toString(),a));return{type:"RelativeSelection",attributeKey:s,relativePosition:c,clientId:r,offset:a}}var yh=new WeakMap;function wh(e){let t=yh.get(e);return t||(t=gh(e),yh.set(e,t)),t}function Ni(e){return wh(e).getSelectionHistory()}function Sh(e,t){return wh(e).updateSelection(t)}function Li(e,t){if(e.type===bn.RelativeSelection){let{relativePosition:r,attributeKey:n,clientId:o}=e,s=b.createAbsolutePositionFromRelativePosition(r,t);if(s)return{clientId:o,attributeKey:n,offset:Ii(s.type.toString(),s.index)}}else if(e.type===bn.BlockSelection)return{clientId:e.clientId,attributeKey:void 0,offset:void 0};return null}function ZS(e,t){let{start:r,end:n}=e,o=To(r.clientId,t),s=To(n.clientId,t);if(!o||!s)return null;let i=Li(r,t),a=Li(n,t);return i===null||a===null?null:{selectionStart:i,selectionEnd:a}}function t_(e,t){for(let r of t){let n=ZS(r,e);if(n!==null)return n}return null}function _h(e,t){let r=t_(t,e);if(r===null)return;let{getBlock:n}=(0,Mi.select)(Cl.store),{resetSelection:o}=(0,Mi.dispatch)(Cl.store),{selectionStart:s,selectionEnd:i}=r;if(s.clientId===i.clientId){let c=n(s.clientId),l=c&&(0,Eh.isUnmodifiedBlock)(c);if(s.offset===0&&i.offset===0&&l&&!s.attributeKey&&!i.attributeKey){let f={clientId:s.clientId},p={clientId:i.clientId};o(f,p,0)}else o(s,i,0)}else o(i,i,0)}function bh(e,t){if(t.length===0)return null;let{start:r,end:n}=t[0];if(r.type===bn.BlockSelection||n.type===bn.BlockSelection)return null;let o=Li(r,e),s=Li(n,e);if(!o||!s)return null;let i=o.offset!==r.offset,a=s.offset!==n.offset;return!i&&!a?null:{selectionStart:o,selectionEnd:s}}var vn="_crdt_document",Ch=new Set([vn]),xh=new Set(["id","count","link","taxonomy","_links","_embedded"]);function e_(e,t){let r=Be(e,kt);Object.entries(t).forEach(([n,o])=>{if(xh.has(n)||typeof o=="function")return;let s=r.get(n);Pi(r,n,s,o)})}function Rh(e,t,r){let n=Be(e,kt);if(Object.keys(t).forEach(o=>{if(!r.has(o))return;let s=t[o];if(typeof s!="function")switch(o){case"blocks":{let i=n_(t.selection),a=Or(t.content);if(!s&&typeof a=="string"){r_(n,a,i);break}else if(!s){n.set(o,void 0);break}let c=n.get(o);c instanceof b.Array||(c=new b.Array,n.set(o,c)),Ui(c,s,i);break}case"content":case"excerpt":case"title":{let i=n.get(o),a=Or(s);if(o==="title"&&!i?.toString()&&a==="Auto Draft"&&(a=""),i instanceof b.Text)vl(i,a??"");else{let c=new b.Text(a??"");n.set(o,c)}break}case"meta":{let i=n.get("meta");Gp(i)||(i=Ri(),n.set("meta",i)),Object.entries(s??{}).forEach(([a,c])=>{Ch.has(a)||Pi(i,a,i.get(a),c)});break}case"slug":{if(!s)break;let i=n.get(o);Pi(n,o,i,s);break}default:{let i=n.get(o);Pi(n,o,i,s)}}}),t.selection){let o=t.selection;setTimeout(()=>{Sh(e,o)},0)}}function r_(e,t,r){let n=e.get("blocks");n instanceof b.Array||(n=new b.Array,e.set("blocks",n)),Ui(n,(0,Do.parse)(t),r,{preserveClientIds:!0})}function n_(e){let t=e?.selectionStart;return t?.clientId&&t.attributeKey&&typeof t.offset=="number"&&Number.isInteger(t.offset)?{attributeKey:t.attributeKey,clientId:t.clientId,offset:t.offset}:null}function o_(e,t){let r=Be(e,kt).toJSON();return Object.fromEntries(Object.entries(r).filter(([n,o])=>!xh.has(n)&&Dr(t?.[n],o)))}function Th(e,t,r){let n=Be(e,kt),o={},s=Object.fromEntries(Object.entries(n.toJSON()).filter(([c,l])=>{if(!r.has(c))return!1;let u=t[c];switch(c){case"blocks":{if(e.meta?.get(pn)&&t.content){let f=n.get("blocks")?.toJSON()??[];return(0,Do.__unstableSerializeAndClean)(f).trim()!==Or(t.content)}return!0}case"date":return u===null||t.modified===u?!1:Dr(u,l);case"meta":{let f=u??{};o=Object.fromEntries(Object.entries(l??{}).filter(([d])=>Ch.has(d)?!1:d in f));let p={...f,...o};return Dr(u,p)}case"status":return l==="auto-draft"?!1:Dr(u,l);case"content":case"excerpt":case"title":return Dr(Or(u),l);default:return Dr(u,l)}}));if(s.blocks&&(s.blocks=_l(s.blocks)),s.blocks&&!s.content){let c=s.blocks;s.content=()=>(0,Do.__unstableSerializeAndClean)(c)}typeof s.meta=="object"&&(s.meta={...t.meta,...o});let i=Ni(e),a=bh(e,i);return a&&(s.selection={...a,initialPosition:0}),s}var Ih={applyChangesToCRDTDoc:e_,createAwareness:e=>new Lp(e),getChangesFromCRDTDoc:o_},Ah={applyChangesToCRDTDoc:()=>{},getChangesFromCRDTDoc:()=>({}),shouldSync:(e,t)=>t===null};function Or(e){if(typeof e=="string")return e;if(e&&typeof e=="object"&&"raw"in e&&typeof e.raw=="string")return e.raw}function Dr(e,t){return!(0,vh.default)(e,t)}function Pi(e,t,r,n){if(n===void 0){e.delete(t);return}Dr(r,n)&&e.set(t,n)}var $="id",s_=["title","excerpt","content"],i_={blocks:{read:e=>(0,Vi.parse)(e.content?.raw??""),write:e=>({content:(0,Vi.__unstableSerializeAndClean)(e.blocks)})}},Bi=[{label:(0,z.__)("Base"),kind:"root",key:!1,name:"__unstableBase",baseURL:"/",baseURLParams:{_fields:["description","generate_animated_image_subsizes","gmt_offset","home","image_max_bit_depth","image_sizes","image_size_threshold","image_strip_meta","name","site_icon","site_icon_url","site_logo","timezone_string","url","page_for_posts","page_on_front","show_on_front"].join(",")},plural:"__unstableBases",supportsPagination:!1},{label:(0,z.__)("Post Type"),name:"postType",kind:"root",key:"slug",baseURL:"/wp/v2/types",baseURLParams:{context:"edit"},plural:"postTypes",supportsPagination:!1},{name:"media",kind:"root",baseURL:"/wp/v2/media",baseURLParams:{context:"edit"},plural:"mediaItems",label:(0,z.__)("Media"),rawAttributes:["caption","title","description"],supportsPagination:!0},{name:"taxonomy",kind:"root",key:"slug",baseURL:"/wp/v2/taxonomies",baseURLParams:{context:"edit"},plural:"taxonomies",label:(0,z.__)("Taxonomy"),supportsPagination:!1},{name:"sidebar",kind:"root",baseURL:"/wp/v2/sidebars",baseURLParams:{context:"edit"},plural:"sidebars",transientEdits:{blocks:!0},label:(0,z.__)("Widget areas"),supportsPagination:!1},{name:"widget",kind:"root",baseURL:"/wp/v2/widgets",baseURLParams:{context:"edit"},plural:"widgets",transientEdits:{blocks:!0},label:(0,z.__)("Widgets"),supportsPagination:!1},{name:"widgetType",kind:"root",baseURL:"/wp/v2/widget-types",baseURLParams:{context:"edit"},plural:"widgetTypes",label:(0,z.__)("Widget types"),supportsPagination:!1},{label:(0,z.__)("User"),name:"user",kind:"root",baseURL:"/wp/v2/users",getTitle:e=>e?.name||e?.slug,baseURLParams:{context:"edit"},plural:"users",supportsPagination:!0},{name:"comment",kind:"root",baseURL:"/wp/v2/comments",baseURLParams:{context:"edit"},plural:"comments",label:(0,z.__)("Comment"),supportsPagination:!0,...globalThis.window?.__experimentalEnableRealTimeCollaboration?{syncConfig:Ah}:{}},{name:"menu",kind:"root",baseURL:"/wp/v2/menus",baseURLParams:{context:"edit"},plural:"menus",label:(0,z.__)("Menu"),supportsPagination:!0},{name:"menuItem",kind:"root",baseURL:"/wp/v2/menu-items",baseURLParams:{context:"edit"},plural:"menuItems",label:(0,z.__)("Menu Item"),rawAttributes:["title"],supportsPagination:!0},{name:"menuLocation",kind:"root",baseURL:"/wp/v2/menu-locations",baseURLParams:{context:"edit"},plural:"menuLocations",label:(0,z.__)("Menu Location"),key:"name",supportsPagination:!1},{label:(0,z.__)("Global Styles"),name:"globalStyles",kind:"root",baseURL:"/wp/v2/global-styles",baseURLParams:{context:"edit"},plural:"globalStylesVariations",getTitle:()=>(0,z.__)("Custom Styles"),getRevisionsUrl:(e,t)=>`/wp/v2/global-styles/${e}/revisions${t?"/"+t:""}`,supportsPagination:!0},{label:(0,z.__)("Themes"),name:"theme",kind:"root",baseURL:"/wp/v2/themes",baseURLParams:{context:"edit"},plural:"themes",key:"stylesheet",supportsPagination:!1},{label:(0,z.__)("Plugins"),name:"plugin",kind:"root",baseURL:"/wp/v2/plugins",baseURLParams:{context:"edit"},plural:"plugins",key:"plugin",supportsPagination:!1},{label:(0,z.__)("Status"),name:"status",kind:"root",baseURL:"/wp/v2/statuses",baseURLParams:{context:"edit"},plural:"statuses",key:"slug",supportsPagination:!1},{label:(0,z.__)("Font Collections"),name:"fontCollection",kind:"root",baseURL:"/wp/v2/font-collections",baseURLParams:{context:"view"},plural:"fontCollections",key:"slug",supportsPagination:!0},{label:(0,z.__)("Icons"),name:"icon",kind:"root",baseURL:"/wp/v2/icons",baseURLParams:{context:"view"},plural:"icons",key:"name",supportsPagination:!1},{label:(0,z.__)("Icon Collections"),name:"iconCollection",kind:"root",baseURL:"/wp/v2/icon-collections",baseURLParams:{context:"view"},plural:"iconCollections",key:"slug",supportsPagination:!1}],kh={root:{media:{since:"6.9",alternative:{kind:"postType",name:"attachment"}}}},ji=[{kind:"postType",loadEntities:c_},{kind:"taxonomy",loadEntities:l_},{kind:"root",name:"site",plural:"sites",loadEntities:u_}],a_=async(e,t,r,n)=>{let o={};return!n&&e?.status==="auto-draft"&&(!t.status&&!o.status&&(o.status="draft"),(!t.title||t.title==="Auto Draft")&&!o.title&&(!e?.title||e?.title==="Auto Draft")&&(o.title="")),o};async function c_(){let e=(0,Oo.default)({path:"/wp/v2/types?context=view"}),t=window.__experimentalEnableRealTimeCollaboration?(0,Oo.default)({path:"/wp/v2/taxonomies?context=view"}):Promise.resolve({}),[r,n]=await Promise.all([e,t]);return Object.entries(r??{}).map(([o,s])=>{let i=["wp_template","wp_template_part"].includes(o),a=s?.rest_namespace??"wp/v2",c=new Set(["author","blocks","content","comment_status","date","excerpt","featured_media","format","meta","ping_status","slug","status","sticky","template","title",...s.taxonomies?.map(u=>n?.[u]?.rest_base)?.filter(Boolean)??[]]),l={kind:"postType",baseURL:`/${a}/${s.rest_base}`,baseURLParams:{context:"edit"},name:o,label:s.name,transientEdits:{...i_,selection:!0},mergedEdits:{meta:!0},rawAttributes:s_,getTitle:u=>u?.title?.rendered||u?.title||(i?wp(u.slug??""):String(u.id)),__unstablePrePersist:(u,f)=>a_(u,f,o,i),__unstable_rest_base:s.rest_base,supportsPagination:!i,getRevisionsUrl:(u,f)=>`/${a}/${s.rest_base}/${u}/revisions${f?"/"+f:""}`,revisionKey:i?"wp_id":$};return window.__experimentalEnableRealTimeCollaboration&&(l.syncConfig={supportsPersistence:!0,applyChangesToCRDTDoc:(u,f)=>Rh(u,f,c),createAwareness:(u,f)=>{let p="postType",d=parseInt(f,10);return new nh(u,p,o,d)},getChangesFromCRDTDoc:(u,f)=>Th(u,f,c),getPersistedCRDTDoc:u=>u?.meta?.[vn]||null,shouldSync:()=>!(Array.isArray(window._wpCollaborationDisabledPostTypes)&&window._wpCollaborationDisabledPostTypes.includes(o))}),l})}async function l_(){let e=await(0,Oo.default)({path:"/wp/v2/taxonomies?context=view"});return Object.entries(e??{}).map(([t,r])=>{let o={kind:"taxonomy",baseURL:`/${r?.rest_namespace??"wp/v2"}/${r.rest_base}`,baseURLParams:{context:"edit"},name:t,label:r.name,getTitle:s=>s?.name,supportsPagination:!0};return window.__experimentalEnableRealTimeCollaboration&&(o.syncConfig=Ih),o})}async function u_(){let e={label:(0,z.__)("Site"),name:"site",kind:"root",key:!1,baseURL:"/wp/v2/settings",supportsPagination:!1,meta:{}},t=await(0,Oo.default)({path:e.baseURL,method:"OPTIONS"}),r={};return Object.entries(t?.schema?.properties??{}).forEach(([n,o])=>{typeof o=="object"&&o.title&&(r[n]=o.title)}),[{...e,meta:{labels:r}}]}var Ur=(e,t,r="get")=>{let n=e==="root"?"":Co(e),o=Co(t);return`${r}${n}${o}`};var Rl="crdt_snapshot",Uo;function dt(){if(Uo)return Uo;if(globalThis.window?.__experimentalEnableRealTimeCollaboration)return Uo=tl(),Uo}function Lo(){return!!Uo}function Dh(e,t,r){if(Lo())return dt()?.getEntitySnapshot(`${e}/${t}`,`${r}`)}function Oh(e,t,r,n){return Lo()?dt()?.entityContainsSnapshot(`${e}/${t}`,`${r}`,n)??!1:!1}function f_(e,t,r){let n={...t,...r};return Object.fromEntries(Object.entries(e??{}).filter(([o,s])=>o===vn?!1:!(0,xl.default)(s,n[o])))}function d_(e,t,r){return Object.fromEntries(Object.entries(e).flatMap(([n,o])=>{if(n==="meta"){let a=f_(o,t.meta,r.meta);return Object.keys(a).length?[[n,a]]:[]}let s=n in r?r[n]:t[n];return!(0,xl.default)(Or(o)??o,Or(s)??s)?[[n,o]]:[]}))}var p_={select:Cn.select,dispatch:Cn.dispatch,resolveSelect:Cn.resolveSelect};function h_(e=p_){let t=(r,n)=>e.select(v).getEntityConfig(r,n)?.syncConfig;return{shouldSync(r,n){return!!(dt()&&t(r,n))},isLoaded(r,n,o){return Lo()?!!dt()?.isLoaded(`${r}/${n}`,o):!1},load(r,n,o,s,i){let a=t(r,n),c=dt();if(!(!a||!c))return c.load(a,`${r}/${n}`,o,s,E_(e,r,n,o,a,i))},loadCollection(r,n,o){let s=t(r,n),i=dt();if(!(!s||!i))return i.loadCollection(s,`${r}/${n}`,w_(e,r,n,o))},update(r,n,o,s,i){t(r,n)&&dt()?.update(`${r}/${n}`,o,s,m_(i),{isNewUndoLevel:g_(i)})},beforeSave(r,n,o,s,i){if(t(r,n))return y_(r,n,o,s,i)},afterSave(r,n,o,s){if(!t(r,n))return;let{savedRecord:i,persistedRecord:a,edits:c}=s,l=a?d_(i,a,c):i;dt()?.update(`${r}/${n}`,o===void 0?null:o,l,go,{isSave:!0})},unload(r,n,o){t(r,n)&&dt()?.unload(`${r}/${n}`,o)},unloadAll(){Lo()&&dt()?.unloadAll()},get undoHistory(){if(!Lo())return;let r=dt()?.undoManager;if(r)return{undo:(n,o,s)=>r.undo(`${n}/${o}`,s),redo:(n,o,s)=>r.redo(`${n}/${o}`,s),stopCapturing:()=>r.stopCapturing(),clearRedo:()=>r.clearRedo()}}}}function m_(e){return e.undoIgnore?go:mo}function g_(e){return e.undoIgnore?!1:!e.isCached}async function y_(e,t,r,n,{persistedRecord:o,isAutosave:s}){let i=dt();if(!i)return;let a=`${e}/${t}`,c=r;if(o&&i.update(a,c,n,go),s){let u=i.getEntitySnapshot(a,c);return u?{[Rl]:u}:void 0}if(e!=="postType"||!o)return;let l=await i.createPersistedCRDTDoc(a,o.id);if(l)return{meta:{...n.meta,[vn]:l}}}function E_(e,t,r,n,o,s){return{editRecord:s.editRecord,getEditedRecord:s.getEditedRecord,refetchRecord:s.refetchRecord,onUndoLevelOpened:s.onUndoLevelOpened,onStatusChange:i=>{ut(e.dispatch(v)).setSyncConnectionStatus(t,r,n,i)},persistCRDTDoc:()=>{if(o.supportsPersistence)return e.resolveSelect(v).getEditedEntityRecord(t,r,n).then(async i=>{let{meta:a,status:c}=i;if(c==="auto-draft"||!a)return;let u=e.select(v).getEntityConfig(t,r)?.key||$,f=i[u];await Uh(`${t}/${r}`,f)})},addUndoMeta:(i,a)=>{let c=Ni(i);c&&a.set("selectionHistory",c)},restoreUndoMeta:(i,a)=>{let c=a.get("selectionHistory");c&&setTimeout(()=>{_h(c,i)},0)}}}function w_(e,t,r,n){return{refetchRecords:n.refetchRecords,onStatusChange:o=>{ut(e.dispatch(v)).setSyncConnectionStatus(t,r,null,o)}}}globalThis.window?.__experimentalEnableRealTimeCollaboration&&mp(h_());var S_="/wp-sync/v1/save",Fi=new Map;async function __(e,t,r){let n=await dt()?.createPersistedCRDTDoc(e,t);n&&await(0,Lh.default)({path:S_,method:"POST",data:{room:r,doc:n}})}async function Uh(e,t){let r=`${e}:${t}`,o=(Fi.get(r)||Promise.resolve()).catch(()=>{}).then(()=>__(e,t,r));Fi.set(r,o);try{await o}finally{Fi.get(r)===o&&Fi.delete(r)}}function Mo(e){let t=parseInt(e.get("X-WP-Total")??""),r=parseInt(e.get("X-WP-TotalPages")??"");return{totalItems:Number.isFinite(t)?t:null,totalPages:Number.isFinite(r)?r:null}}function Tl(e,t,r){return{type:"RECEIVE_ITEMS",items:e,persistedEdits:t,meta:r}}function Mh(e,t,r,n=!1){return{type:"REMOVE_ITEMS",itemIds:Array.isArray(r)?r:[r],kind:e,name:t,invalidateCache:n}}function Nh(e,t={},r,n){return{...Tl(e,r,n),query:t}}var Hh=g(jh(),1);var $h=g(je(),1);function x_(e){let t={stableKey:"",page:1,perPage:10,offset:null,fields:null,include:null,context:"default"},r=Object.keys(e).sort();for(let n=0;n<r.length;n++){let o=r[n],s=e[o];switch(o){case"page":t[o]=Number(s);break;case"per_page":t.perPage=Number(s);break;case"offset":{let i=Number(s);Number.isFinite(i)&&(t.offset=i);break}case"context":t.context=s;break;default:o==="_fields"&&(t.fields=nt(s)??[],s=t.fields.join()),o==="include"&&(typeof s=="number"&&(s=s.toString()),t.include=(nt(s)??[]).map(Number),s=t.include.join()),t.stableKey+=(t.stableKey?"&":"")+(0,$h.addQueryArgs)("",{[o]:s}).slice(1)}}return t}var Fe=wa(x_);var Yh=new WeakMap;function R_(e,t,r={}){let{supportsPagination:n=!0}=r,{stableKey:o,page:s,perPage:i,offset:a,include:c,fields:l,context:u}=Fe(t),f=e.queries?.[u]?.[o]?.itemIds;if(!f)return null;let p=n&&i!==-1,d=p?a??(s-1)*i:0,h=p?Math.min(d+i,f.length):f.length;if(p&&f.length<d+i){let y=e.queries[u][o].meta?.totalItems;if(Number.isFinite(y)&&f.length<y)return null}let m=[];for(let y=d;y<h;y++){let E=f[y];if(Array.isArray(c)&&!c.includes(E)||E===void 0)continue;if(!e.items[u]?.hasOwnProperty(E))return null;let w=e.items[u][E],S;if(Array.isArray(l)){S={};for(let k=0;k<l.length;k++){let I=l[k].split("."),Q=w;I.forEach(vt=>{Q=Q?.[vt]}),Je(S,I,Q)}}else{if(!e.itemIsComplete[u]?.[E])return null;S=w}m.push(S)}return m}function Il(e,t={},r={}){let n=Yh.get(e);if(n){let s=n.get(t);if(s!==void 0)return s}else n=new Hh.default,Yh.set(e,n);let o=R_(e,t,r);return n.set(t,o),o}function Al(e,t={}){let{stableKey:r,context:n}=Fe(t);return e.queries?.[n]?.[r]?.meta?.totalItems??null}function Gh(e,t={}){let{stableKey:r,context:n}=Fe(t);return e.queries?.[n]?.[r]?.meta?.totalPages??null}var No=g(H(),1),zh=g(In(),1);function qh(e){let{query:t}=e;return t?Fe(t).context:"default"}function T_(e=[],t,{page:r=1,offset:n,perPage:o=10}={}){if(o===-1)return t;let s=n??(r-1)*o,i=Math.max(o,t.length),a=Math.max(e.length,s+t.length),c=new Array(a);for(let l=0;l<a;l++)l>=s&&l<s+i?c[l]=t[l-s]:c[l]=e[l];return c}function Kh(e,t){return Object.fromEntries(Object.entries(e).filter(([r])=>!t.some(n=>Number.isInteger(n)?n===+r:n===r)))}function I_(e={},t){switch(t.type){case"RECEIVE_ITEMS":{let r=qh(t),n=t.key||$,o=Array.isArray(t.items)?t.items:[t.items];return{...e,[r]:{...e[r],...Object.fromEntries(o.map(s=>[s?.[n],Ea(e?.[r]?.[s?.[n]],s)]))}}}case"REMOVE_ITEMS":return Object.fromEntries(Object.entries(e).map(([r,n])=>[r,Kh(n,t.itemIds)]))}return e}function A_(e={},t){switch(t.type){case"RECEIVE_ITEMS":{let r=qh(t),{query:n,key:o=$}=t,s=Array.isArray(t.items)?t.items:[t.items],i=n?Fe(n):{},a=!n||!Array.isArray(i.fields);return{...e,[r]:{...e[r],...s.reduce((c,l)=>{let u=l?.[o];return c[u]=e?.[r]?.[u]||a,c},{})}}}case"REMOVE_ITEMS":return Object.fromEntries(Object.entries(e).map(([r,n])=>[r,Kh(n,t.itemIds)]))}return e}var k_=(0,zh.compose)([kn(e=>"query"in e),Dn(e=>e.query?{...e,...Fe(e.query)}:e),(0,No.keyedReducer)("context"),(0,No.keyedReducer)("stableKey")])((e={},t)=>{if(t.type!=="RECEIVE_ITEMS"||!Array.isArray(t.items))return e;let r=t.key??$;return{itemIds:T_(e.itemIds,t.items.map(n=>n?.[r]).filter(Boolean),{page:t.page,offset:t.offset,perPage:t.perPage}),meta:t.meta}});function D_(e,t){let r=e.itemIds.filter(s=>!t[s]),n=e.itemIds.length-r.length;if(n===0)return e;let o={...e,itemIds:r};return Number.isFinite(e.meta?.totalItems)&&(o.meta={...e.meta,totalItems:Math.max(0,e.meta.totalItems-n),totalPages:null}),o}var O_=(e={},t)=>{switch(t.type){case"RECEIVE_ITEMS":return k_(e,t);case"REMOVE_ITEMS":let r=t.itemIds.reduce((n,o)=>(n[o]=!0,n),{});return Object.fromEntries(Object.entries(e).map(([n,o])=>[n,Object.fromEntries(Object.entries(o).map(([s,i])=>[s,D_(i,r)]))]));default:return e}},$i=(0,No.combineReducers)({items:I_,itemIsComplete:A_,queries:O_});function U_(e={byId:{},queries:{}},t){return t.type==="RECEIVE_USER_QUERY"?{byId:{...e.byId,...t.users.reduce((r,n)=>({...r,[n.id]:n}),{})},queries:{...e.queries,[t.queryID]:t.users.map(r=>r.id)}}:e}function L_(e={},t){return t.type==="RECEIVE_CURRENT_USER"?t.currentUser:e}function M_(e=void 0,t){return t.type==="RECEIVE_CURRENT_THEME"?t.currentTheme.stylesheet:e}function N_(e=void 0,t){return t.type==="RECEIVE_CURRENT_GLOBAL_STYLES_ID"?t.id:e}function P_(e={},t){return t.type==="RECEIVE_THEME_GLOBAL_STYLES"?{...e,[t.stylesheet]:t.globalStyles}:e}function V_(e={},t){return t.type==="RECEIVE_THEME_GLOBAL_STYLE_VARIATIONS"?{...e,[t.stylesheet]:t.variations}:e}var B_=e=>(t,r)=>{if(r.type==="UNDO"||r.type==="REDO"){let{record:n}=r,o=t;return n.forEach(({id:{kind:s,name:i,recordId:a},changes:c})=>{let l=t?.queriedData?.items?.default?.[a],u=Object.fromEntries(Object.entries(c).map(([f,p])=>[f,r.type==="UNDO"?p.from:p.to]));o=e(o,{type:"EDIT_ENTITY_RECORD",kind:s,name:i,recordId:a,edits:An(u,l)})}),o}return e(t,r)};function j_(e){return(0,Wh.compose)([B_,kn(t=>t.name&&t.kind&&t.name===e.name&&t.kind===e.kind),Dn(t=>({key:e.key||$,...t}))])((0,Po.combineReducers)({queriedData:$i,edits:(t={},r)=>{switch(r.type){case"RECEIVE_ITEMS":if((r?.query?.context??"default")!=="default")return t;let o={...t},s=Array.isArray(r.items)?r.items:[r.items];for(let a of s){let c=a?.[r.key],l=o[c];if(!l)continue;let u=Object.keys(l).reduce((f,p)=>(!(0,kl.default)(l[p],a[p]?.raw??a[p])&&(!r.persistedEdits||!(0,kl.default)(l[p],r.persistedEdits[p]))&&(f[p]=l[p]),f),{});Object.keys(u).length?o[c]=u:delete o[c]}return o;case"EDIT_ENTITY_RECORD":let i={...t[r.recordId],...r.edits};return Object.keys(i).forEach(a=>{i[a]===void 0&&delete i[a]}),{...t,[r.recordId]:i}}return t},saving:(t={},r)=>{switch(r.type){case"SAVE_ENTITY_RECORD_START":case"SAVE_ENTITY_RECORD_FINISH":return{...t,[r.recordId]:{pending:r.type==="SAVE_ENTITY_RECORD_START",error:r.error,isAutosave:r.isAutosave}}}return t},deleting:(t={},r)=>{switch(r.type){case"DELETE_ENTITY_RECORD_START":case"DELETE_ENTITY_RECORD_FINISH":return{...t,[r.recordId]:{pending:r.type==="DELETE_ENTITY_RECORD_START",error:r.error}}}return t},revisions:(t={},r)=>{if(r.type==="RECEIVE_ITEM_REVISIONS"){let n=r.recordKey;delete r.recordKey;let o=$i(t[n],{...r,type:"RECEIVE_ITEMS"});return{...t,[n]:o}}return r.type==="REMOVE_ITEMS"?Object.fromEntries(Object.entries(t).filter(([n])=>!r.itemIds.some(o=>Number.isInteger(o)?o===+n:o===n))):t}}))}function F_(e=Bi,t){return t.type==="ADD_ENTITIES"?[...e,...t.entities]:e}var $_=(e={},t)=>{let r=F_(e.config,t),n=e.reducer;if(!n||r!==e.config){let s=r.reduce((i,a)=>{let{kind:c}=a;return i[c]||(i[c]=[]),i[c].push(a),i},{});n=(0,Po.combineReducers)(Object.fromEntries(Object.entries(s).map(([i,a])=>{let c=(0,Po.combineReducers)(Object.fromEntries(a.map(l=>[l.name,j_(l)])));return[i,c]})))}let o=n(e.records,t);return o===e.records&&r===e.config&&n===e.reducer?e:{reducer:n,records:o,config:r}};function Y_(e=(0,Qh.createUndoManager)()){return e}function H_(e={},t){return t.type==="RECORD_SYNC_UNDO_LEVEL"?{}:e}function G_(e={},t){switch(t.type){case"EDIT_ENTITY_RECORD":case"UNDO":case"REDO":return{}}return e}function z_(e={},t){if(t.type==="RECEIVE_EMBED_PREVIEW"){let{url:r,preview:n}=t;return{...e,[r]:n}}return e}function q_(e={},t){switch(t.type){case"RECEIVE_USER_PERMISSION":return{...e,[t.key]:t.isAllowed};case"RECEIVE_USER_PERMISSIONS":return{...e,...t.permissions}}return e}function K_(e={},t){if(t.type==="RECEIVE_AUTOSAVES"){let{postId:r,autosaves:n}=t;return{...e,[r]:n}}return e}function W_(e=[],t){return t.type==="RECEIVE_BLOCK_PATTERNS"?t.patterns:e}function Q_(e=[],t){return t.type==="RECEIVE_BLOCK_PATTERN_CATEGORIES"?t.categories:e}function J_(e=[],t){return t.type==="RECEIVE_USER_PATTERN_CATEGORIES"?t.patternCategories:e}function X_(e=null,t){return t.type==="RECEIVE_NAVIGATION_FALLBACK_ID"?t.fallbackId:e}function Z_(e={},t){return t.type==="RECEIVE_THEME_GLOBAL_STYLE_REVISIONS"?{...e,[t.currentId]:t.revisions}:e}function tb(e={},t){return t.type==="RECEIVE_DEFAULT_TEMPLATE"?{...e,[JSON.stringify(t.query)]:t.templateId}:e}function eb(e={},t){return t.type==="RECEIVE_REGISTERED_POST_META"?{...e,[t.postType]:t.registeredPostMeta}:e}function rb(e=null,t){return t.type==="RECEIVE_EDITOR_SETTINGS"?t.settings:e}function nb(e=null,t){return t.type==="RECEIVE_EDITOR_ASSETS"?t.assets:e}function ob(e={},t){switch(t.type){case"SET_SYNC_CONNECTION_STATUS":{let r=`${t.kind}/${t.name}:${t.key}`;return{...e,[r]:t.status}}case"CLEAR_SYNC_CONNECTION_STATUS":{let r=`${t.kind}/${t.name}:${t.key}`,{[r]:n,...o}=e;return o}}return e}function sb(e=!0,t){switch(t.type){case"SET_COLLABORATION_SUPPORTED":return t.supported;case"SET_SYNC_CONNECTION_STATUS":return ye.DOCUMENT_SIZE_LIMIT_EXCEEDED===t.status?.error?.code?!1:e}return e}function ib(e={},t){if(t.type==="RECEIVE_VIEW_CONFIG"){let r=`${t.kind}/${t.name}`;return{...e,[r]:{...e[r],...t.config}}}return e}function ab(e={},t){return t.type==="RECEIVE_FIELDS_CONFIG"?{...e,[t.kind]:{...e[t.kind],[t.name]:t.config}}:e}function cb(e={},t){return t.type==="RECEIVE_ENTITY_ACTIONS_CONFIG"?{...e,[t.kind]:{...e[t.kind],[t.name]:t.config}}:e}var Jh=(0,Po.combineReducers)({users:U_,currentTheme:M_,currentGlobalStylesId:N_,currentUser:L_,themeGlobalStyleVariations:V_,themeBaseGlobalStyles:P_,themeGlobalStyleRevisions:Z_,entities:$_,editsReference:G_,undoManagerReference:H_,undoManager:Y_,embedPreviews:z_,userPermissions:q_,autosaves:K_,blockPatterns:W_,blockPatternCategories:Q_,userPatternCategories:J_,navigationFallbackId:X_,defaultTemplates:tb,registeredPostMeta:eb,editorSettings:rb,editorAssets:nb,syncConnectionStatuses:ob,collaborationSupported:sb,viewConfigs:ib,fieldsConfigs:ab,entityActionsConfigs:cb});var Pl={};Qe(Pl,{__experimentalGetCurrentGlobalStylesId:()=>cm,__experimentalGetCurrentThemeBaseGlobalStyles:()=>tv,__experimentalGetCurrentThemeGlobalStylesVariations:()=>ev,__experimentalGetDirtyEntityRecords:()=>Nb,__experimentalGetEntitiesBeingSaved:()=>Pb,__experimentalGetEntityRecordNoResolver:()=>Ob,canUser:()=>lm,canUserEditEntityRecord:()=>Wb,getAuthors:()=>Tb,getAutosave:()=>Jb,getAutosaves:()=>Qb,getBlockPatternCategories:()=>nv,getBlockPatterns:()=>rv,getCurrentTheme:()=>Gi,getCurrentThemeGlobalStylesRevisions:()=>sv,getCurrentUser:()=>Ib,getDefaultTemplateId:()=>Ul,getEditedEntityRecord:()=>Ml,getEmbedPreview:()=>qb,getEntitiesByKind:()=>Ab,getEntitiesConfig:()=>om,getEntity:()=>kb,getEntityConfig:()=>Ye,getEntityRecord:()=>qt,getEntityRecordEdits:()=>Ll,getEntityRecordNonTransientEdits:()=>im,getEntityRecords:()=>Hi,getEntityRecordsTotalItems:()=>Lb,getEntityRecordsTotalPages:()=>Mb,getLastEntityDeleteError:()=>Fb,getLastEntitySaveError:()=>jb,getRawEntityRecord:()=>sm,getRedoEdit:()=>Yb,getReferenceByDistinctEdits:()=>Zb,getRevision:()=>cv,getRevisions:()=>iv,getThemeSupports:()=>zb,getUndoEdit:()=>$b,getUserPatternCategories:()=>ov,getUserQueryResults:()=>nm,hasEditsForEntityRecord:()=>am,hasEntityRecord:()=>Db,hasEntityRecords:()=>Ub,hasFetchedAutosaves:()=>Xb,hasRedo:()=>Gb,hasRevision:()=>av,hasUndo:()=>Hb,isAutosavingEntityRecord:()=>Vb,isDeletingEntityRecord:()=>Bb,isPreviewEmbedFallback:()=>Kb,isRequestingEmbedPreview:()=>Rb,isSavingEntityRecord:()=>Nl});var Kt=g(H(),1),rm=g(je(),1),$e=g(Mr(),1);var Ol={};Qe(Ol,{getBlockPatternsForPostType:()=>fb,getEditorAssets:()=>Eb,getEditorSettings:()=>yb,getEntityActionsConfig:()=>bb,getEntityRecordPermissions:()=>db,getEntityRecordsPermissions:()=>tm,getEntitySyncConnectionStatus:()=>Cb,getFieldsConfig:()=>_b,getHomePage:()=>hb,getNavigationFallbackId:()=>ub,getPostsPageId:()=>mb,getRegisteredPostMeta:()=>pb,getSyncConnectionStatus:()=>vb,getTemplateId:()=>gb,getUndoManager:()=>Yi,getViewConfig:()=>Sb,isCollaborationSupported:()=>wb});var ie=g(H(),1);var Zh=g(Mr(),1);var Dl=!1;function U(e,t,r,{alternativeFunctionName:n,isShorthandSelector:o=!1}={}){let s=kh[e]?.[t];if(s){if(!Dl){let{alternative:i}=s,a=o?`'${r}'`:`The '${e}', '${t}' entity (used via '${r}')`,c=`the '${i.kind}', '${i.name}' entity`;n&&(c+=` via the '${n}' function`),(0,Zh.default)(a,{...s,alternative:c})}Dl=!0,setTimeout(()=>{Dl=!1},0)}}var lb={};function Yi(e){return e.undoManager}function ub(e){return e.navigationFallbackId}var fb=(0,ie.createRegistrySelector)(e=>(0,ie.createSelector)((t,r)=>e(v).getBlockPatterns().filter(({postTypes:n})=>!n||Array.isArray(n)&&n.includes(r)),()=>[e(v).getBlockPatterns()])),tm=(0,ie.createRegistrySelector)(e=>(0,ie.createSelector)((t,r,n,o)=>(Array.isArray(o)?o:[o]).map(i=>({delete:e(v).canUser("delete",{kind:r,name:n,id:i}),update:e(v).canUser("update",{kind:r,name:n,id:i})})),t=>[t.userPermissions]));function db(e,t,r,n){return U(t,r,"getEntityRecordPermissions"),tm(e,t,r,n)[0]}function pb(e,t){return e.registeredPostMeta?.[t]??{}}function em(e){return!e||!["number","string"].includes(typeof e)||Number(e)===0?null:e.toString()}var hb=(0,ie.createRegistrySelector)(e=>(0,ie.createSelector)(()=>{let t=e(v).getEntityRecord("root","__unstableBase");if(!t)return null;let r=t?.show_on_front==="page"?em(t.page_on_front):null;if(r)return{postType:"page",postId:r};let n=e(v).getDefaultTemplateId({slug:"front-page"});return n?{postType:"wp_template",postId:n}:n===""?lb:null},t=>[qt(t,"root","site"),qt(t,"root","__unstableBase"),Ul(t,{slug:"front-page"})])),mb=(0,ie.createRegistrySelector)(e=>()=>{let t=e(v).getEntityRecord("root","__unstableBase");return t?.show_on_front==="page"?em(t.page_for_posts):null}),gb=(0,ie.createRegistrySelector)(e=>(t,r,n)=>{let o=ut(e(v)).getHomePage();if(!o)return;if(r==="page"&&r===o?.postType&&n.toString()===o?.postId){let l=e(v).getEntityRecords("postType","wp_template",{per_page:-1});if(!l)return;let u=l.find(({slug:f})=>f==="front-page")?.id;if(u)return u}let s=e(v).getEditedEntityRecord("postType",r,n);if(!s)return;let i=ut(e(v)).getPostsPageId();if(r==="page"&&i===n.toString())return e(v).getDefaultTemplateId({slug:"home"});let a=s.template;if(a){let l=e(v).getEntityRecords("postType","wp_template",{per_page:-1})?.find(({slug:u})=>u===a);if(l)return l.id}let c;return s.slug?c=r==="page"?`${r}-${s.slug}`:`single-${r}-${s.slug}`:c=r==="page"?"page":`single-${r}`,e(v).getDefaultTemplateId({slug:c})});function yb(e){return e.editorSettings}function Eb(e){return e.editorAssets}function wb(e){return e.collaborationSupported}function Sb(e,t,r){return e.viewConfigs?.[`${t}/${r}`]??{default_view:void 0,default_layouts:void 0,view_list:void 0,form:void 0}}function _b(e,t,r){return e.fieldsConfigs?.[t]?.[r]}function bb(e,t,r){return e.entityActionsConfigs?.[t]?.[r]}function vb(e){if(!e.syncConnectionStatuses)return;let t=["disconnected","connecting","connected"],r;for(let n of Object.values(e.syncConnectionStatuses))(!r||t.indexOf(n.status)<t.indexOf(r.status))&&(r=n);return r}function Cb(e,t,r,n){return e.syncConnectionStatuses?.[`${t}/${r}:${n}`]}var xb={},Rb=(0,Kt.createRegistrySelector)(e=>(t,r)=>e(v).isResolving("getEmbedPreview",[r]));function Tb(e,t){(0,$e.default)("select( 'core' ).getAuthors()",{since:"5.9",alternative:"select( 'core' ).getUsers({ who: 'authors' })"});let r=(0,rm.addQueryArgs)("/wp/v2/users/?who=authors&per_page=100",t);return nm(e,r)}function Ib(e){return e.currentUser}var nm=(0,Kt.createSelector)((e,t)=>(e.users.queries[t]??[]).map(n=>e.users.byId[n]),(e,t)=>[e.users.queries[t],e.users.byId]);function Ab(e,t){return(0,$e.default)("wp.data.select( 'core' ).getEntitiesByKind()",{since:"6.0",alternative:"wp.data.select( 'core' ).getEntitiesConfig()"}),om(e,t)}var om=(0,Kt.createSelector)((e,t)=>e.entities.config.filter(r=>r.kind===t),(e,t)=>e.entities.config);function kb(e,t,r){return(0,$e.default)("wp.data.select( 'core' ).getEntity()",{since:"6.0",alternative:"wp.data.select( 'core' ).getEntityConfig()"}),Ye(e,t,r)}function Ye(e,t,r){return U(t,r,"getEntityConfig"),e.entities.config?.find(n=>n.kind===t&&n.name===r)}var qt=((e,t,r,n,o)=>{U(t,r,"getEntityRecord");let s=e.entities.records?.[t]?.[r]?.queriedData;if(!s)return;let i=o?.context??"default";if(!o||!o._fields)return s.itemIsComplete[i]?.[n]?s.items[i][n]:void 0;let a=s.items[i]?.[n];return a&&us(a,o._fields)});qt.normalizeArgs=e=>{let t=[...e],r=t?.[2];return t[2]=On(r)?Number(r):r,t};function Db(e,t,r,n,o){let s=e.entities.records?.[t]?.[r]?.queriedData;if(!s)return!1;let i=o?.context??"default";if(!o||!o._fields)return!!s.itemIsComplete[i]?.[n];let a=s.items[i]?.[n];if(!a)return!1;let c=nt(o._fields)??[];for(let l=0;l<c.length;l++){let u=c[l].split("."),f=a;for(let p=0;p<u.length;p++){let d=u[p];if(!f||!Object.hasOwn(f,d))return!1;f=f[d]}}return!0}function Ob(e,t,r,n){return qt(e,t,r,n)}var sm=(0,Kt.createSelector)((e,t,r,n)=>{U(t,r,"getRawEntityRecord");let o=qt(e,t,r,n),s=Ye(e,t,r);return!o||!s?.rawAttributes?.length?o:Object.fromEntries(Object.keys(o).map(i=>{if(s.rawAttributes.includes(i)){let a=o[i]?.raw;return[i,a!==void 0?a:o[i]]}return[i,o[i]]}))},(e,t,r,n,o)=>{let s=o?.context??"default";return[e.entities.config,e.entities.records?.[t]?.[r]?.queriedData?.items[s]?.[n],e.entities.records?.[t]?.[r]?.queriedData?.itemIsComplete[s]?.[n]]});function Ub(e,t,r,n){return U(t,r,"hasEntityRecords"),Array.isArray(Hi(e,t,r,n))}var Hi=((e,t,r,n)=>{U(t,r,"getEntityRecords");let o=e.entities.records?.[t]?.[r]?.queriedData;return o?Il(o,n,{supportsPagination:!!Ye(e,t,r)?.supportsPagination}):null}),Lb=(e,t,r,n)=>{U(t,r,"getEntityRecordsTotalItems");let o=e.entities.records?.[t]?.[r]?.queriedData;return o?Al(o,n):null},Mb=(e,t,r,n)=>{U(t,r,"getEntityRecordsTotalPages");let o=e.entities.records?.[t]?.[r]?.queriedData;if(!o)return null;if(!Ye(e,t,r)?.supportsPagination||n?.per_page===-1)return 1;let s=Al(o,n);return s&&(n?.per_page?Math.ceil(s/n.per_page):Gh(o,n))},Nb=(0,Kt.createSelector)(e=>{let{entities:{records:t}}=e,r=[];return Object.keys(t).forEach(n=>{Object.keys(t[n]).forEach(o=>{let s=Object.keys(t[n][o].edits).filter(i=>qt(e,n,o,i)&&am(e,n,o,i));if(s.length){let i=Ye(e,n,o);s.forEach(a=>{let c=Ml(e,n,o,a);r.push({key:c?c[i.key||$]:void 0,title:i?.getTitle?.(c)||"",name:o,kind:n})})}})}),r},e=>[e.entities.records]),Pb=(0,Kt.createSelector)(e=>{let{entities:{records:t}}=e,r=[];return Object.keys(t).forEach(n=>{Object.keys(t[n]).forEach(o=>{let s=Object.keys(t[n][o].saving).filter(i=>Nl(e,n,o,i));if(s.length){let i=Ye(e,n,o);s.forEach(a=>{let c=Ml(e,n,o,a);r.push({key:c?c[i.key||$]:void 0,title:i?.getTitle?.(c)||"",name:o,kind:n})})}})}),r},e=>[e.entities.records]);function Ll(e,t,r,n){return U(t,r,"getEntityRecordEdits"),e.entities.records?.[t]?.[r]?.edits?.[String(n)]}var im=(0,Kt.createSelector)((e,t,r,n)=>{U(t,r,"getEntityRecordNonTransientEdits");let{transientEdits:o}=Ye(e,t,r)||{},s=Ll(e,t,r,n)||{};return o?Object.keys(s).reduce((i,a)=>(o[a]||(i[a]=s[a]),i),{}):s},(e,t,r,n)=>[e.entities.config,e.entities.records?.[t]?.[r]?.edits?.[String(n)]]);function am(e,t,r,n){return U(t,r,"hasEditsForEntityRecord"),Nl(e,t,r,n)||Object.keys(im(e,t,r,n)).length>0}var Ml=(0,Kt.createSelector)((e,t,r,n)=>{U(t,r,"getEditedEntityRecord");let o=sm(e,t,r,n),s=Ll(e,t,r,n);return!o&&!s?!1:{...o,...s}},(e,t,r,n,o)=>{let s=o?.context??"default";return[e.entities.config,e.entities.records?.[t]?.[r]?.queriedData.items[s]?.[n],e.entities.records?.[t]?.[r]?.queriedData.itemIsComplete[s]?.[n],e.entities.records?.[t]?.[r]?.edits?.[String(n)]]});function Vb(e,t,r,n){U(t,r,"isAutosavingEntityRecord");let{pending:o,isAutosave:s}=e.entities.records?.[t]?.[r]?.saving?.[n]??{};return!!(o&&s)}function Nl(e,t,r,n){return U(t,r,"isSavingEntityRecord"),e.entities.records?.[t]?.[r]?.saving?.[String(n)]?.pending??!1}function Bb(e,t,r,n){return U(t,r,"isDeletingEntityRecord"),e.entities.records?.[t]?.[r]?.deleting?.[String(n)]?.pending??!1}function jb(e,t,r,n){return U(t,r,"getLastEntitySaveError"),e.entities.records?.[t]?.[r]?.saving?.[String(n)]?.error}function Fb(e,t,r,n){return U(t,r,"getLastEntityDeleteError"),e.entities.records?.[t]?.[r]?.deleting?.[n]?.error}function $b(e){(0,$e.default)("select( 'core' ).getUndoEdit()",{since:"6.3"})}function Yb(e){(0,$e.default)("select( 'core' ).getRedoEdit()",{since:"6.3"})}function Hb(e){return Yi(e).hasUndo()}function Gb(e){return Yi(e).hasRedo()}function Gi(e){return e.currentTheme?qt(e,"root","theme",e.currentTheme):null}function cm(e){return e.currentGlobalStylesId}function zb(e){return Gi(e)?.theme_supports??xb}function qb(e,t){return e.embedPreviews[t]}function Kb(e,t){let r=e.embedPreviews[t],n='<a href="'+t+'">'+t+"</a>";return r?r.html===n:!1}function lm(e,t,r,n){let o=typeof r=="object";if(o&&(!r.kind||!r.name))return!1;o&&U(r.kind,r.name,"canUser");let s=Ze(t,r,n);return e.userPermissions[s]}function Wb(e,t,r,n){return(0,$e.default)("wp.data.select( 'core' ).canUserEditEntityRecord()",{since:"6.7",alternative:"wp.data.select( 'core' ).canUser( 'update', { kind, name, id } )"}),lm(e,"update",{kind:t,name:r,id:n})}function Qb(e,t,r){return e.autosaves[r]}function Jb(e,t,r,n){return n===void 0?void 0:e.autosaves[r]?.find(s=>s.author===n)}var Xb=(0,Kt.createRegistrySelector)(e=>(t,r,n)=>e(v).hasFinishedResolution("getAutosaves",[r,n]));function Zb(e){return e.editsReference}function tv(e){let t=Gi(e);return t?e.themeBaseGlobalStyles[t.stylesheet]:null}function ev(e){let t=Gi(e);return t?e.themeGlobalStyleVariations[t.stylesheet]:null}function rv(e){return e.blockPatterns}function nv(e){return e.blockPatternCategories}function ov(e){return e.userPatternCategories}function sv(e){(0,$e.default)("select( 'core' ).getCurrentThemeGlobalStylesRevisions()",{since:"6.5.0",alternative:"select( 'core' ).getRevisions( 'root', 'globalStyles', ${ recordKey } )"});let t=cm(e);return t?e.themeGlobalStyleRevisions[t]:null}function Ul(e,t){return e.defaultTemplates[JSON.stringify(t)]}var iv=(e,t,r,n,o)=>{U(t,r,"getRevisions");let s=e.entities.records?.[t]?.[r]?.revisions?.[n];return s?Il(s,o):null};function av(e,t,r,n,o,s){let i=e.entities.records?.[t]?.[r]?.revisions?.[n];if(!i)return!1;let a=s?.context??"default";if(!s||!s._fields)return!!i.itemIsComplete[a]?.[o];let c=i.items[a]?.[o];if(!c)return!1;let l=nt(s._fields)??[];for(let u=0;u<l.length;u++){let f=l[u].split("."),p=c;for(let d=0;d<f.length;d++){let h=f[d];if(!p||!Object.hasOwn(p,h))return!1;p=p[h]}}return!0}var cv=(e,t,r,n,o,s)=>{U(t,r,"getRevision");let i=e.entities.records?.[t]?.[r]?.revisions?.[n];if(!i)return;let a=s?.context??"default";if(!s||!s._fields)return i.itemIsComplete[a]?.[o]?i.items[a][o]:void 0;let c=i.items[a]?.[o];return c&&us(c,s._fields)};var ql={};Qe(ql,{__experimentalBatch:()=>Tv,__experimentalReceiveCurrentGlobalStylesId:()=>gv,__experimentalReceiveThemeBaseGlobalStyles:()=>yv,__experimentalReceiveThemeGlobalStyleVariations:()=>Ev,__experimentalSaveSpecifiedEntityEdits:()=>Av,__unstableCreateUndoLevel:()=>Rv,addEntities:()=>pv,clearEntityRecordEdits:()=>vv,deleteEntityRecord:()=>Gl,editEntityRecord:()=>bv,receiveAutosaves:()=>Ov,receiveCurrentTheme:()=>mv,receiveCurrentUser:()=>dv,receiveDefaultTemplateId:()=>Lv,receiveEmbedPreview:()=>_v,receiveEntityRecords:()=>hv,receiveNavigationFallbackId:()=>Uv,receiveRevisions:()=>Mv,receiveThemeGlobalStyleRevisions:()=>Sv,receiveThemeSupports:()=>wv,receiveUploadPermissions:()=>kv,receiveUserPermission:()=>Em,receiveUserPermissions:()=>Dv,receiveUserQuery:()=>fv,redo:()=>xv,saveEditedEntityRecord:()=>Iv,saveEntityRecord:()=>zl,undo:()=>Cv});var Hl=g(Ft(),1),ym=g(je(),1),zi=g(Mr(),1);var Bl=g(Ft(),1),Vl=null;function lv(e,t){let r=[...e],n=[];for(;r.length;)n.push(r.splice(0,t));return n}async function um(e){Vl===null&&(Vl=(await(0,Bl.default)({path:"/batch/v1",method:"OPTIONS"})).endpoints[0].args.requests.maxItems);let t=[];for(let r of lv(e,Vl)){let n=await(0,Bl.default)({path:"/batch/v1",method:"POST",data:{validation:"require-all-validate",requests:r.map(s=>({path:s.path,body:s.data,method:s.method,headers:s.headers}))}}),o;n.failed?o=n.responses.map(s=>({error:s?.body})):o=n.responses.map(s=>{let i={};return s.status>=200&&s.status<300?i.output=s.body:i.error=s.body,i}),t.push(...o)}return t}function jl(e=um){let t=0,r=[],n=new uv;return{add(o){let s=++t;n.add(s);let i=a=>new Promise((c,l)=>{r.push({input:a,resolve:c,reject:l}),n.delete(s)});return typeof o=="function"?Promise.resolve(o(i)).finally(()=>{n.delete(s)}):i(o)},async run(){n.size&&await new Promise(i=>{let a=n.subscribe(()=>{n.size||(a(),i(void 0))})});let o;try{if(o=await e(r.map(({input:i})=>i)),o.length!==r.length)throw new Error("run: Array returned by processor must be same size as input array.")}catch(i){for(let{reject:a}of r)a(i);throw i}let s=!0;return o.forEach((i,a)=>{let c=r[a];i?.error?(c?.reject(i.error),s=!1):c?.resolve(i?.output??i)}),r=[],s}}}var uv=class{constructor(...e){this.set=new Set(...e),this.subscribers=new Set}get size(){return this.set.size}add(e){return this.set.add(e),this.subscribers.forEach(t=>t()),this}delete(e){let t=this.set.delete(e);return this.subscribers.forEach(r=>r()),t}subscribe(e){return this.subscribers.add(e),()=>{this.subscribers.delete(e)}}};var Fl=0;function mm(e,t,r){return Fl+=1,[{id:{kind:e,name:t,recordId:r,isSyncUndoLevel:!0},changes:{level:{from:Fl-1,to:Fl}}}]}function fm(e){return typeof e.id!="string"&&e.id.isSyncUndoLevel===!0}function dm(e){if(typeof e=="string")return;let{kind:t,name:r,recordId:n}=e;if(!(typeof t!="string"||typeof r!="string")&&!(typeof n!="string"&&typeof n!="number"))return{kind:t,name:r,recordId:n}}function pm(e,t){return t?!!e?.isLoaded?.(t.kind,t.name,t.recordId):!1}function $l(e,t,r,n=!1){let o=t?.undoHistory;if(o?.stopCapturing(),o?.clearRedo(),!r){e.addRecord();return}n&&e.hasRedo()&&e.addRecord(),e.addRecord(r,n)}function hm(e,t,r){let n=t?.undoHistory,o;if(r==="undo"?o=e.undo():o=e.redo(),!o)return;let s=o.filter(l=>!fm(l)&&!pm(t,dm(l.id))),i=o.find(fm),a;i&&(a=dm(i.id));let c=!1;if(n&&a&&pm(t,a)){let{kind:l,name:u,recordId:f}=a;c=n[r](l,u,f)}return{changes:s,didApply:s.length>0||c}}function Yl(e,t,r){t?.undoHistory?.stopCapturing();let n=hm(e,t,r);for(;n&&!n.didApply;)n=hm(e,t,r);if(n)return t?.undoHistory?.stopCapturing(),n.changes}function gm(e){return e.status==="auto-draft"?{...e,title:""}:e}function fv(e,t){return{type:"RECEIVE_USER_QUERY",users:Array.isArray(t)?t:[t],queryID:e}}function dv(e){return{type:"RECEIVE_CURRENT_USER",currentUser:e}}function pv(e){return{type:"ADD_ENTITIES",entities:e}}function hv(e,t,r,n=void 0,o=!1,s=void 0,i=void 0){e==="postType"&&(r=Array.isArray(r)?r.map(gm):gm(r));let a;return n?a=Nh(r,n,s,i):a=Tl(r,s,i),{...a,kind:e,name:t,invalidateCache:o}}function mv(e){return{type:"RECEIVE_CURRENT_THEME",currentTheme:e}}function gv(e){return{type:"RECEIVE_CURRENT_GLOBAL_STYLES_ID",id:e}}function yv(e,t){return{type:"RECEIVE_THEME_GLOBAL_STYLES",stylesheet:e,globalStyles:t}}function Ev(e,t){return{type:"RECEIVE_THEME_GLOBAL_STYLE_VARIATIONS",stylesheet:e,variations:t}}function wv(){return(0,zi.default)("wp.data.dispatch( 'core' ).receiveThemeSupports",{since:"5.9"}),{type:"DO_NOTHING"}}function Sv(e,t){return(0,zi.default)("wp.data.dispatch( 'core' ).receiveThemeGlobalStyleRevisions()",{since:"6.5.0",alternative:"wp.data.dispatch( 'core' ).receiveRevisions"}),{type:"RECEIVE_THEME_GLOBAL_STYLE_REVISIONS",currentId:e,revisions:t}}function _v(e,t){return{type:"RECEIVE_EMBED_PREVIEW",url:e,preview:t}}var Gl=(e,t,r,n,{__unstableFetch:o=Hl.default,throwOnError:s=!1}={})=>async({dispatch:i,resolveSelect:a})=>{U(e,t,"deleteEntityRecord");let l=(await a.getEntitiesConfig(e)).find(d=>d.kind===e&&d.name===t),u,f=!1;if(!l)return;let p=await i.__unstableAcquireStoreLock(v,["entities","records",e,t,r],{exclusive:!0});try{i({type:"DELETE_ENTITY_RECORD_START",kind:e,name:t,recordId:r});let d=!1,{baseURL:h}=l;try{let m=`${h}/${r}`;n&&(m=(0,ym.addQueryArgs)(m,n)),f=await o({path:m,method:"DELETE"}),await i(Mh(e,t,r,!0)),jt()?.unload(e,t,r)}catch(m){d=!0,u=m}if(i({type:"DELETE_ENTITY_RECORD_FINISH",kind:e,name:t,recordId:r,error:u}),d&&s)throw u;return f}finally{i.__unstableReleaseStoreLock(p)}},bv=(e,t,r,n,o={})=>({select:s,dispatch:i})=>{U(e,t,"editEntityRecord");let a=s.getEntityConfig(e,t);if(!a)throw new Error(`The entity being edited (${e}, ${t}) does not have a loaded config.`);let{mergedEdits:c={}}=a,l=s.getRawEntityRecord(e,t,r),u=s.getEditedEntityRecord(e,t,r),f=Object.keys(n).reduce((h,m)=>(h[m]=c[m]?{...u[m],...n[m]}:n[m],h),{}),p={kind:e,name:t,recordId:r,edits:An(f,l)},d=jt();d?.update(e,t,r,f,{isCached:!!o.isCached,undoIgnore:!!o.undoIgnore}),!o.undoIgnore&&!d?.isLoaded?.(e,t,r)&&$l(s.getUndoManager(),d,[{id:{kind:e,name:t,recordId:r},changes:Object.keys(n).reduce((h,m)=>(h[m]={from:u[m],to:n[m]},h),{})}],o.isCached),i({type:"EDIT_ENTITY_RECORD",...p})},vv=(e,t,r)=>({select:n,dispatch:o})=>{let s=n.getEntityConfig(e,t);if(U(e,t,"clearEntityRecordEdits"),!s)throw new Error(`The entity being edited (${e}, ${t}) does not have a loaded config.`);let i=n.getEntityRecordEdits(e,t,r);if(!i)return;let a=Object.keys(i).reduce((c,l)=>(c[l]=void 0,c),{});o({type:"EDIT_ENTITY_RECORD",kind:e,name:t,recordId:r,edits:a})},Cv=()=>({select:e,dispatch:t})=>{let r=Yl(e.getUndoManager(),jt(),"undo");r&&t({type:"UNDO",record:r})},xv=()=>({select:e,dispatch:t})=>{let r=Yl(e.getUndoManager(),jt(),"redo");r&&t({type:"REDO",record:r})},Rv=()=>({select:e})=>{$l(e.getUndoManager(),jt())},zl=(e,t,r,n={})=>async({select:o,resolveSelect:s,dispatch:i})=>{let{isAutosave:a=!1,__unstableFetch:c=Hl.default,throwOnError:l=!1}=n;U(e,t,"saveEntityRecord");let f=(await s.getEntitiesConfig(e)).find(y=>y.kind===e&&y.name===t);if(!f)return;let p=f.key??$,d=r[p],h=!!p&&!d,m=await i.__unstableAcquireStoreLock(v,["entities","records",e,t,d||Io()],{exclusive:!0});try{for(let[k,I]of Object.entries(r))if(typeof I=="function"){let Q=I(o.getEditedEntityRecord(e,t,d));i.editEntityRecord(e,t,d,{[k]:Q},{undoIgnore:!0}),r[k]=Q}i({type:"SAVE_ENTITY_RECORD_START",kind:e,name:t,recordId:d,isAutosave:a});let y,E,w=!1,{baseURL:S}=f;try{let k=`${S}${d?"/"+d:""}`,I=h?{}:o.getRawEntityRecord(e,t,d),Q=jt(),vt=h?void 0:await Q?.beforeSave?.(e,t,d,r,{persistedRecord:I,isAutosave:a});if(a){let _={...I,...r},T=["title","excerpt","content","meta"].reduce((C,R)=>(R in _&&(C[R]=_[R]),C),{status:_.status==="auto-draft"?"draft":void 0});if(y=await c({path:`${k}/autosaves`,method:"POST",data:{...T,...vt}}),I.id===y.id){let C={...I,...T,...y};C=Object.keys(C).reduce((R,A)=>(["title","excerpt","content","meta"].includes(A)?R[A]=C[A]:A==="status"?R[A]=I.status==="auto-draft"&&C.status==="draft"?C.status:I.status:R[A]=I[A],R),{}),i.receiveEntityRecords(e,t,C,void 0,!0)}else i.receiveAutosaves(I.id,y)}else{let _={...r,...vt};f.__unstablePrePersist&&(_={..._,...await f.__unstablePrePersist(I,_)}),y=await c({path:k,method:d?"PUT":"POST",data:_}),i.receiveEntityRecords(e,t,y,void 0,!0,r),Q?.afterSave?.(e,t,d,{savedRecord:y,persistedRecord:h?void 0:I,edits:r})}}catch(k){w=!0,E=k}if(i({type:"SAVE_ENTITY_RECORD_FINISH",kind:e,name:t,recordId:d,error:E,isAutosave:a}),w&&l)throw E;return y}finally{i.__unstableReleaseStoreLock(m)}},Tv=e=>async({dispatch:t})=>{let r=jl(),n={saveEntityRecord(i,a,c,l){return r.add(u=>t.saveEntityRecord(i,a,c,{...l,__unstableFetch:u}))},saveEditedEntityRecord(i,a,c,l){return r.add(u=>t.saveEditedEntityRecord(i,a,c,{...l,__unstableFetch:u}))},deleteEntityRecord(i,a,c,l,u){return r.add(f=>t.deleteEntityRecord(i,a,c,l,{...u,__unstableFetch:f}))}},o=e.map(i=>i(n)),[,...s]=await Promise.all([r.run(),...o]);return s},Iv=(e,t,r,n)=>async({select:o,dispatch:s,resolveSelect:i})=>{if(U(e,t,"saveEditedEntityRecord"),!o.hasEditsForEntityRecord(e,t,r))return;let c=(await i.getEntitiesConfig(e)).find(p=>p.kind===e&&p.name===t);if(!c)return;let l=c.key||$,u=o.getEntityRecordNonTransientEdits(e,t,r),f={[l]:r,...u};return await s.saveEntityRecord(e,t,f,n)},Av=(e,t,r,n,o)=>async({select:s,dispatch:i,resolveSelect:a})=>{if(U(e,t,"__experimentalSaveSpecifiedEntityEdits"),!s.hasEditsForEntityRecord(e,t,r))return;let c=s.getEntityRecordNonTransientEdits(e,t,r),l={};for(let d of n)Je(l,d,Sa(c,d));let p=(await a.getEntitiesConfig(e)).find(d=>d.kind===e&&d.name===t)?.key||$;return r&&(l[p]=r),await i.saveEntityRecord(e,t,l,o)};function kv(e){return(0,zi.default)("wp.data.dispatch( 'core' ).receiveUploadPermissions",{since:"5.9",alternative:"receiveUserPermission"}),Em("create/media",e)}function Em(e,t){return{type:"RECEIVE_USER_PERMISSION",key:e,isAllowed:t}}function Dv(e){return{type:"RECEIVE_USER_PERMISSIONS",permissions:e}}function Ov(e,t){return{type:"RECEIVE_AUTOSAVES",postId:e,autosaves:Array.isArray(t)?t:[t]}}function Uv(e){return{type:"RECEIVE_NAVIGATION_FALLBACK_ID",fallbackId:e}}function Lv(e,t){return{type:"RECEIVE_DEFAULT_TEMPLATE",query:e,templateId:t}}var Mv=(e,t,r,n,o,s=!1,i)=>async({dispatch:a,resolveSelect:c})=>{U(e,t,"receiveRevisions");let f=(await c.getEntitiesConfig(e)).find(p=>p.kind===e&&p.name===t)?.revisionKey??$;a({type:"RECEIVE_ITEM_REVISIONS",key:f,items:n,recordKey:r,meta:i,query:o,kind:e,name:t,invalidateCache:s})};var Wl={};Qe(Wl,{editMediaEntity:()=>Pv,receiveEditorAssets:()=>Bv,receiveEditorSettings:()=>Vv,receiveEntityActionsConfig:()=>Yv,receiveFieldsConfig:()=>$v,receiveRegisteredPostMeta:()=>Nv,receiveViewConfig:()=>Fv,recordSyncUndoLevel:()=>Hv,saveDirtyEntities:()=>zv,setCollaborationSupported:()=>jv,setSyncConnectionStatus:()=>Gv});var bm=g(Ft(),1),Bo=g(Sm(),1),vm=g(Ir(),1),Kl=g(Vo(),1),jo=g(Pe(),1);function Nv(e,t){return{type:"RECEIVE_REGISTERED_POST_META",postType:e,registeredPostMeta:t}}var Pv=(e,t={},{__unstableFetch:r=bm.default,throwOnError:n=!1}={})=>async({dispatch:o,resolveSelect:s})=>{if(!e)return;let i="postType",a="attachment",l=(await s.getEntitiesConfig(i)).find(h=>h.kind===i&&h.name===a);if(!l)return;let u=await o.__unstableAcquireStoreLock(v,["entities","records",i,a,e],{exclusive:!0}),f,p,d=!1;try{o({type:"SAVE_ENTITY_RECORD_START",kind:i,name:a,recordId:e});try{let h=`${l.baseURL}/${e}/edit`,m=await r({path:h,method:"POST",data:{...t}});m&&(o.receiveEntityRecords(i,a,m,void 0,!0,void 0,void 0),f=m)}catch(h){p=h,d=!0}if(o({type:"SAVE_ENTITY_RECORD_FINISH",kind:i,name:a,recordId:e,error:p}),d&&n)throw p;return f}finally{o.__unstableReleaseStoreLock(u)}};function Vv(e){return{type:"RECEIVE_EDITOR_SETTINGS",settings:e}}function Bv(e){return{type:"RECEIVE_EDITOR_ASSETS",assets:e}}var jv=e=>({dispatch:t})=>{t({type:"SET_COLLABORATION_SUPPORTED",supported:e}),e||jt()?.unloadAll()};function Fv(e,t,r){return{type:"RECEIVE_VIEW_CONFIG",kind:e,name:t,config:r}}function $v(e,t,r){return{type:"RECEIVE_FIELDS_CONFIG",kind:e,name:t,config:r}}function Yv(e,t,r){return{type:"RECEIVE_ENTITY_ACTIONS_CONFIG",kind:e,name:t,config:r}}var Hv=(e,t,r)=>({select:n,dispatch:o})=>{n.getUndoManager().addRecord(mm(e,t,r)),o({type:"RECORD_SYNC_UNDO_LEVEL"})};function Gv(e,t,r,n){return n?{type:"SET_SYNC_CONNECTION_STATUS",kind:e,name:t,key:r,status:n}:{type:"CLEAR_SYNC_CONNECTION_STATUS",kind:e,name:t,key:r}}var zv=({onSave:e,dirtyEntityRecords:t=[],entitiesToSkip:r=[],close:n,successNoticeContent:o}={})=>({registry:s})=>{let i=[{kind:"postType",name:"wp_navigation"}],a="site-editor-save-success",c=s.select(v).getEntityRecord("root","__unstableBase")?.home;s.dispatch(Bo.store).removeNotice(a);let l=t.filter(({kind:d,name:h,key:m,property:y})=>!r.some(E=>E.kind===d&&E.name===h&&E.key===m&&E.property===y));n?.(l);let u=[],f=[];return l.forEach(({kind:d,name:h,key:m,property:y})=>{d==="root"&&h==="site"?u.push(y):(i.some(E=>E.kind===d&&E.name===h)&&s.dispatch(v).editEntityRecord(d,h,m,{status:"publish"}),f.push(s.dispatch(v).saveEditedEntityRecord(d,h,m,{throwOnError:!0}).catch(p)))}),u.length&&f.push(s.dispatch(v).__experimentalSaveSpecifiedEntityEdits("root","site",void 0,u,{throwOnError:!0}).catch(p)),s.dispatch(vm.store).__unstableMarkLastChangeAsPersistent(),Promise.all(f).then(async d=>(e&&await e(),d)).then(d=>{let h=d.filter(m=>m instanceof Error);if(h.length){let m=h.find(y=>y.message)?.message;s.dispatch(Bo.store).createErrorNotice((0,Kl.decodeEntities)(m||(0,jo.__)("Saving failed.")),{type:"snackbar",id:a})}else s.dispatch(Bo.store).createSuccessNotice(o||(0,jo.__)("Site updated."),{type:"snackbar",id:a,actions:[{label:(0,jo.__)("View site"),url:c,openInNewTab:!0}]})}).catch(d=>s.dispatch(Bo.store).createErrorNotice((0,Kl.decodeEntities)(d?.message||(0,jo.__)("Saving failed.")),{type:"snackbar",id:a}));function p(d){if(d instanceof Error)return d;let h;if(d){if(typeof d.message=="string")h=d.message;else if(typeof d=="string")h=d;else if(Object.hasOwn(d,"toString")&&typeof d.toString=="function"){let m=d.toString();typeof m=="string"&&(h=m)}}return new Error(h,{cause:d})}};var eu={};Qe(eu,{__experimentalGetCurrentGlobalStylesId:()=>dC,__experimentalGetCurrentThemeBaseGlobalStyles:()=>pC,__experimentalGetCurrentThemeGlobalStylesVariations:()=>hC,canUser:()=>Lm,canUserEditEntityRecord:()=>lC,getAuthors:()=>tC,getAutosave:()=>fC,getAutosaves:()=>uC,getBlockPatternCategories:()=>gC,getBlockPatterns:()=>mC,getCurrentTheme:()=>iC,getCurrentThemeGlobalStylesRevisions:()=>Mm,getCurrentUser:()=>eC,getDefaultTemplateId:()=>wC,getEditedEntityRecord:()=>nC,getEditorAssets:()=>CC,getEditorSettings:()=>vC,getEmbedPreview:()=>cC,getEntitiesConfig:()=>bC,getEntityActionsConfig:()=>TC,getEntityRecord:()=>Ki,getEntityRecords:()=>Go,getEntityRecordsTotalItems:()=>oC,getEntityRecordsTotalPages:()=>sC,getFieldsConfig:()=>RC,getNavigationFallbackId:()=>EC,getRawEntityRecord:()=>rC,getRegisteredPostMeta:()=>_C,getRevision:()=>SC,getRevisions:()=>Nm,getThemeSupports:()=>aC,getUserPatternCategories:()=>yC,getViewConfig:()=>xC});var Ot=g(je(),1),Um=g(Vo(),1),B=g(Ft(),1);var Tm=g(Ft(),1);var Fo=g(Ft(),1),$o=g(je(),1),Yo=g(Vo(),1),Ho=g(Pe(),1);async function Cm(e,t={},r={}){let n=t.isInitialSuggestions&&t.initialSuggestionsSearchOptions?{...t,...t.initialSuggestionsSearchOptions}:t,{type:o,subtype:s,preferTypes:i,page:a,perPage:c=t.isInitialSuggestions?3:20}=n,{disablePostFormats:l=!1}=r,u=[];(!o||o==="post")&&u.push((0,Fo.default)({path:(0,$o.addQueryArgs)("/wp/v2/search",{search:e,page:a,per_page:c,type:"post",subtype:s})}).then(d=>d.map(h=>({id:h.id,url:h.url,title:(0,Yo.decodeEntities)(h.title||"")||(0,Ho.__)("(no title)"),type:h.subtype||h.type,kind:"post-type"}))).catch(()=>[])),(!o||o==="term")&&u.push((0,Fo.default)({path:(0,$o.addQueryArgs)("/wp/v2/search",{search:e,page:a,per_page:c,type:"term",subtype:s})}).then(d=>d.map(h=>({id:h.id,url:h.url,title:(0,Yo.decodeEntities)(h.title||"")||(0,Ho.__)("(no title)"),type:h.subtype||h.type,kind:"taxonomy"}))).catch(()=>[])),!l&&(!o||o==="post-format")&&u.push((0,Fo.default)({path:(0,$o.addQueryArgs)("/wp/v2/search",{search:e,page:a,per_page:c,type:"post-format",subtype:s})}).then(d=>d.map(h=>({id:h.id,url:h.url,title:(0,Yo.decodeEntities)(h.title||"")||(0,Ho.__)("(no title)"),type:h.subtype||h.type,kind:"taxonomy"}))).catch(()=>[])),(!o||o==="attachment")&&u.push((0,Fo.default)({path:(0,$o.addQueryArgs)("/wp/v2/media",{search:e,page:a,per_page:c})}).then(d=>d.map(h=>({id:h.id,url:h.source_url,title:(0,Yo.decodeEntities)(h.title.rendered||"")||(0,Ho.__)("(no title)"),type:h.type,kind:"media"}))).catch(()=>[]));let p=(await Promise.all(u)).flat();return p=p.filter(d=>!!d.id),Xv({results:p,search:e,preferTypes:i})}function qv(e,t){let r=s=>(s??"").toLowerCase().trim().replace(/[\u2018\u2019]/g,"'").replace(/[\u201c\u201d]/g,'"'),n=r(e),o=r(t);return!n||!o?{contains:!1,begins:!1}:{contains:n.includes(o),begins:n.startsWith(o)}}var Ql=["post","term","post-format","attachment"];function Kv(e){return e.kind==="media"?"attachment":e.type==="post-format"?"post-format":e.kind==="taxonomy"?"term":"post"}function Wv(e,t=[]){let r=Kv(e),n=t.findIndex(o=>typeof o=="string"?o===r:o.type===r&&o.subtype===e.type);return n!==-1?Ql.length+(t.length-n):Ql.length-Ql.indexOf(r)}function Qv(e,t){let r=Jl(e||"");return t.filter(n=>r.some(o=>o.includes(n))).length}function Jv(e,t){if(!e||!t.length)return 0;let r=Jl(e);return t.reduce((o,s)=>{let i=r.reduce((a,c)=>c.includes(s)?Math.max(a,s.length/c.length):a,0);return o+i},0)/t.length*10}function Xv({results:e,search:t,preferTypes:r}){let n=Jl(t),o=e.map(s=>({result:s,found:Qv(s.title,n),...qv(s.title,t),type:Wv(s,r),score:Jv(s.title,n)}));return o.sort((s,i)=>i.found-s.found||Number(i.contains)-Number(s.contains)||i.type-s.type||Number(i.begins)-Number(s.begins)||i.score-s.score),o.map(({result:s})=>s)}function Jl(e){return e.toLowerCase().match(/[\p{L}\p{N}]+/gu)||[]}var xm=g(Ft(),1),ae=g(je(),1),Xl=new Map,Zv=async(e,t={})=>{let r="/wp-block-editor/v1/url-details",n={url:(0,ae.prependHTTP)(e)};if(!(0,ae.isURL)(e))return Promise.reject(`${e} is not a valid URL.`);let o=(0,ae.getProtocol)(e);return!o||!(0,ae.isValidProtocol)(o)||!o.startsWith("http")||!/^https?:\/\/[^\/\s]/i.test(e)?Promise.reject(`${e} does not have a valid protocol. URLs must be "http" based`):Xl.has(e)?Xl.get(e):(0,xm.default)({path:(0,ae.addQueryArgs)(r,n),...t}).then(s=>(Xl.set(e,s),s))},Rm=Zv;async function Zl(){let e=await(0,Tm.default)({path:"/wp/v2/block-patterns/patterns"});return e?e.map(t=>Object.fromEntries(Object.entries(t).map(([r,n])=>[xi(r),n]))):[]}var Im=g(H(),1),Am=g(Ne(),1),tu=new WeakMap;function km(e,t,r){return`${e}:${t}:${r}`}function Dm(){return(0,Im.select)(Am.store).getBlockTypes()}function Om(e,t,r,n){let o=tu.get(Dm())?.get(km(e,t,r));if(o&&o.content===n)return o.blocks}function qi(e,t,r,n,o){let s=Dm(),i=tu.get(s);i||(i=new Map,tu.set(s,i)),i.set(km(e,t,r),{content:n,blocks:o})}var tC=e=>async({dispatch:t})=>{let r=(0,Ot.addQueryArgs)("/wp/v2/users/?who=authors&per_page=100",e),n=await(0,B.default)({path:r});t.receiveUserQuery(r,n)},eC=()=>async({dispatch:e})=>{let t=await(0,B.default)({path:"/wp/v2/users/me"});e.receiveCurrentUser(t)},Ki=(e,t,r="",n)=>async({select:o,dispatch:s,registry:i,resolveSelect:a})=>{let l=(await a.getEntitiesConfig(e)).find(f=>f.name===t&&f.kind===e);if(!l)return;let u=await s.__unstableAcquireStoreLock(v,["entities","records",e,t,r],{exclusive:!1});try{if(n!==void 0&&n._fields&&(n={...n,_fields:[...new Set([...nt(n._fields)||[],l.key||$])].join()}),n!==void 0&&n._fields&&o.hasEntityRecord(e,t,r,n))return;let{baseURL:f}=l,p=(0,Ot.addQueryArgs)(f+(r?"/"+r:""),{...l.baseURLParams,...n}),d=await(0,B.default)({path:p,parse:!1}),h=await d.json(),m=Ln(d.headers?.get("allow")),y={};for(let S of Un)y[Ze(S,{kind:e,name:t,id:r})]=m[S];let E=[[{kind:e,name:t,id:r}]],w=o?.isCollaborationSupported?.()===!1?void 0:jt();if(w&&On(r)&&!n&&w.shouldSync?.(e,t,r)!==!1){let S={...h};Object.entries(l.transientEdits??{}).filter(([k,I])=>S[k]===void 0&&I&&typeof I=="object"&&"read"in I&&typeof I.read=="function").forEach(([k,I])=>{S[k]=I.read(S)}),S.blocks&&typeof S.content?.raw=="string"&&qi(e,t,r,S.content.raw,S.blocks),w.load(e,t,r,S,{editRecord:(k,I={})=>{Object.keys(k).length&&s({type:"EDIT_ENTITY_RECORD",kind:e,name:t,recordId:r,edits:k,meta:{undo:void 0},options:I})},getEditedRecord:async()=>await a.getEditedEntityRecord(e,t,r),refetchRecord:async()=>{s.receiveEntityRecords(e,t,await(0,B.default)({path:p,parse:!0}),n)},onUndoLevelOpened:()=>{s.recordSyncUndoLevel(e,t,r)}})}i.batch(()=>{s.receiveEntityRecords(e,t,h,n),s.receiveUserPermissions(y),s.finishResolutions("canUser",E)})}finally{s.__unstableReleaseStoreLock(u)}};Ki.shouldInvalidate=(e,t,r)=>t==="root"&&r==="site"&&(e.type==="RECEIVE_ITEMS"&&e.persistedEdits&&e.persistedEdits.status!=="auto-draft"||e.type==="REMOVE_ITEMS")&&e.kind==="postType"&&e.name==="wp_template";var rC=Xe("getEntityRecord"),nC=Xe("getEntityRecord"),Go=(e,t,r={})=>async({dispatch:n,registry:o,resolveSelect:s})=>{let a=(await s.getEntitiesConfig(e)).find(p=>p.name===t&&p.kind===e);if(!a)return;let c=await n.__unstableAcquireStoreLock(v,["entities","records",e,t],{exclusive:!1}),l={...r},u=a.key||$;function f(p,d){let h=fs(d);return p.filter(m=>m?.[u]).map(m=>[e,t,m[u],h])}try{r._fields&&(r={...r,_fields:[...new Set([...nt(r._fields)||[],u])].join()});let{baseURL:p}=a,d=(0,Ot.addQueryArgs)(p,{...a.baseURLParams,...r}),h=[],m;if(a.supportsPagination&&r.per_page!==-1){let y=await(0,B.default)({path:d,parse:!1});h=Object.values(await y.json()),m=Mo(y.headers)}else if(r.per_page===-1&&r[Mn]===!0){let y=1,E;do{let w=await(0,B.default)({path:(0,Ot.addQueryArgs)(d,{page:y,per_page:100}),parse:!1}),S=Object.values(await w.json()),k=Mo(w.headers);E=k.totalPages??1,m||(m={totalItems:k.totalItems,totalPages:1}),h.push(...S),o.batch(()=>{n.receiveEntityRecords(e,t,h,r,!1,void 0,m),n.finishResolutions("getEntityRecord",f(S,l))}),y++}while(y<=E)}else h=Object.values(await(0,B.default)({path:d})),m={totalItems:h.length,totalPages:1};r.per_page===-1&&jt()?.loadCollection?.(e,t,{refetchRecords:async()=>{n.receiveEntityRecords(e,t,await(0,B.default)({path:d,parse:!0}),r)}}),r._fields&&(h=h.map(y=>(r._fields.split(",").forEach(E=>{y.hasOwnProperty(E)||(y[E]=void 0)}),y))),o.batch(()=>{n.receiveEntityRecords(e,t,h,r,!1,void 0,m);let y=h.filter(S=>!!S?.[u]&&!!S?._links?.self?.[0]?.targetHints?.allow).map(S=>({id:S[u],permissions:Ln(S._links.self[0].targetHints.allow)})),E=[],w={};for(let S of y){E.push([{kind:e,name:t,id:S.id}]);for(let k of Un)w[Ze(k,{kind:e,name:t,id:S.id})]=S.permissions[k]}y.length>0&&(n.receiveUserPermissions(w),n.finishResolutions("canUser",E)),n.finishResolutions("getEntityRecord",f(h,l)),n.__unstableReleaseStoreLock(c)})}catch{n.__unstableReleaseStoreLock(c)}};Go.shouldInvalidate=(e,t,r)=>(e.type==="RECEIVE_ITEMS"||e.type==="REMOVE_ITEMS")&&e.invalidateCache&&t===e.kind&&r===e.name;var oC=Xe("getEntityRecords"),sC=Xe("getEntityRecords"),iC=()=>async({dispatch:e,resolveSelect:t})=>{let r=await t.getEntityRecords("root","theme",{status:"active"});e.receiveCurrentTheme(r[0])},aC=Xe("getCurrentTheme"),cC=e=>async({dispatch:t})=>{try{let r=await(0,B.default)({path:(0,Ot.addQueryArgs)("/oembed/1.0/proxy",{url:e})});t.receiveEmbedPreview(e,r)}catch{t.receiveEmbedPreview(e,!1)}},Lm=(e,t)=>async({dispatch:r,resolveSelect:n})=>{let o=null;if(typeof e=="object"){if(!e.kind||!e.name)throw new Error("The entity resource object is not valid.");let l=(await n.getEntitiesConfig(e.kind)).find(u=>u.name===e.name&&u.kind===e.kind);if(!l)return;o=l.baseURL+(e.id?"/"+e.id:"")}else o=`/wp/v2/${e}`+(t?"/"+t:"");let s;try{s=await(0,B.default)({path:o,method:"OPTIONS",parse:!1})}catch{return}let i=Ln(s.headers?.get("allow")),a={};for(let c of Un)a[Ze(c,e,t)]=i[c];r.receiveUserPermissions(a)};Lm.getResolutionArgs=(e,t,r)=>[t,r];var lC=(e,t,r)=>async({resolveSelect:n})=>{await n.canUser("update",{kind:e,name:t,id:r})},uC=(e,t)=>async({dispatch:r,resolveSelect:n})=>{let{rest_base:o,rest_namespace:s="wp/v2",supports:i}=await n.getPostType(e);if(!i?.autosave)return;let a=await(0,B.default)({path:`/${s}/${o}/${t}/autosaves?context=edit`});a&&a.length&&r.receiveAutosaves(t,a)},fC=(e,t)=>async({resolveSelect:r})=>{await r.getAutosaves(e,t)},dC=()=>async({dispatch:e,resolveSelect:t})=>{let n=(await t.getEntityRecords("root","theme",{status:"active"}))?.[0]?._links?.["wp:user-global-styles"]?.[0]?.href;if(!n)return;let o=n.match(/\/(\d+)(?:\?|$)/),s=o?Number(o[1]):null;s&&e.__experimentalReceiveCurrentGlobalStylesId(s)},pC=()=>async({resolveSelect:e,dispatch:t})=>{let r=await e.getCurrentTheme(),n=await(0,B.default)({path:`/wp/v2/global-styles/themes/${r.stylesheet}?context=view`});t.__experimentalReceiveThemeBaseGlobalStyles(r.stylesheet,n)},hC=()=>async({resolveSelect:e,dispatch:t})=>{let r=await e.getCurrentTheme(),n=await(0,B.default)({path:`/wp/v2/global-styles/themes/${r.stylesheet}/variations?context=view`});t.__experimentalReceiveThemeGlobalStyleVariations(r.stylesheet,n)},Mm=()=>async({resolveSelect:e,dispatch:t})=>{let r=await e.__experimentalGetCurrentGlobalStylesId(),o=(r?await e.getEntityRecord("root","globalStyles",r):void 0)?._links?.["version-history"]?.[0]?.href;if(o){let i=(await(0,B.default)({url:o}))?.map(a=>Object.fromEntries(Object.entries(a).map(([c,l])=>[xi(c),l])));t.receiveThemeGlobalStyleRevisions(r,i)}};Mm.shouldInvalidate=e=>e.type==="SAVE_ENTITY_RECORD_FINISH"&&e.kind==="root"&&!e.error&&e.name==="globalStyles";var mC=()=>async({dispatch:e})=>{let t=await Zl();e({type:"RECEIVE_BLOCK_PATTERNS",patterns:t})},gC=()=>async({dispatch:e})=>{let t=await(0,B.default)({path:"/wp/v2/block-patterns/categories"});e({type:"RECEIVE_BLOCK_PATTERN_CATEGORIES",categories:t})},yC=()=>async({dispatch:e,resolveSelect:t})=>{let n=(await t.getEntityRecords("taxonomy","wp_pattern_category",{per_page:-1,_fields:"id,name,description,slug",context:"view"}))?.map(o=>({...o,label:(0,Um.decodeEntities)(o.name),name:o.slug}))||[];e({type:"RECEIVE_USER_PATTERN_CATEGORIES",patternCategories:n})},EC=()=>async({dispatch:e,select:t,registry:r})=>{let n=await(0,B.default)({path:(0,Ot.addQueryArgs)("/wp-block-editor/v1/navigation-fallback",{_embed:!0})}),o=n?._embedded?.self;r.batch(()=>{if(e.receiveNavigationFallbackId(n?.id),!o)return;let i=!t.getEntityRecord("postType","wp_navigation",n.id);e.receiveEntityRecords("postType","wp_navigation",o,void 0,i),e.finishResolution("getEntityRecord",["postType","wp_navigation",n.id])})},wC=e=>async({dispatch:t,registry:r,resolveSelect:n})=>{let o=await(0,B.default)({path:(0,Ot.addQueryArgs)("/wp/v2/templates/lookup",e)});await n.getEntitiesConfig("postType");let s=o?.id;r.batch(()=>{t.receiveDefaultTemplateId(e,s||""),s&&(o.id=s,t.receiveEntityRecords("postType",o.type,o),t.finishResolution("getEntityRecord",["postType",o.type,s]))})},Nm=(e,t,r,n={})=>async({dispatch:o,resolveSelect:s})=>{let a=(await s.getEntitiesConfig(e)).find(u=>u.name===t&&u.kind===e);if(!a)return;let c={...n},l=await o.__unstableAcquireStoreLock(v,["entities","records",e,t,r,"revisions"],{exclusive:!1});try{n._fields&&(n={...n,_fields:[...new Set([...nt(n._fields)||[],a.revisionKey||$])].join()});let u=(0,Ot.addQueryArgs)(a.getRevisionsUrl(r),n),f,p,d={},h=a.supportsPagination&&n.per_page!==-1;try{p=await(0,B.default)({path:u,parse:!h})}catch{return}if(p){h?(f=Object.values(await p.json()),d.totalItems=Mo(p.headers).totalItems):f=Object.values(p),n._fields&&(f=f.map(w=>(n._fields.split(",").forEach(S=>{w.hasOwnProperty(S)||(w[S]=void 0)}),w))),await o.receiveRevisions(e,t,r,f,n,!1,d);let m=a.revisionKey||$,y=fs(c),E=f.filter(w=>w[m]).map(w=>[e,t,r,w[m],y]);o.finishResolutions("getRevision",E)}}finally{o.__unstableReleaseStoreLock(l)}};Nm.shouldInvalidate=(e,t,r,n)=>e.type==="SAVE_ENTITY_RECORD_FINISH"&&r===e.name&&t===e.kind&&!e.error&&n===e.recordId;var SC=(e,t,r,n,o)=>async({select:s,dispatch:i,resolveSelect:a})=>{let l=(await a.getEntitiesConfig(e)).find(f=>f.name===t&&f.kind===e);if(!l)return;o!==void 0&&o._fields&&(o={...o,_fields:[...new Set([...nt(o._fields)||[],l.revisionKey||$])].join()});let u=await i.__unstableAcquireStoreLock(v,["entities","records",e,t,r,"revisions",n],{exclusive:!1});try{if(s.hasRevision(e,t,r,n,o))return;let f=(0,Ot.addQueryArgs)(l.getRevisionsUrl(r,n),o),p;try{p=await(0,B.default)({path:f})}catch{return}p&&await i.receiveRevisions(e,t,r,p,o)}finally{i.__unstableReleaseStoreLock(u)}},_C=e=>async({dispatch:t,resolveSelect:r})=>{let n;try{let{rest_namespace:o="wp/v2",rest_base:s}=await r.getPostType(e)||{};n=await(0,B.default)({path:`${o}/${s}/?context=edit`,method:"OPTIONS"})}catch{return}n&&t.receiveRegisteredPostMeta(e,n?.schema?.properties?.meta?.properties)},bC=e=>async({dispatch:t})=>{let r=ji.find(n=>n.kind===e);if(r)try{let n=await r.loadEntities();if(!n.length)return;t.addEntities(n)}catch{}},vC=()=>async({dispatch:e})=>{let t=await(0,B.default)({path:"/wp-block-editor/v1/settings"});e.receiveEditorSettings(t)},CC=()=>async({dispatch:e})=>{let t=await(0,B.default)({path:"/wp-block-editor/v1/assets"});e.receiveEditorAssets(t)},xC=(e,t,r={})=>async({dispatch:n})=>{let o={kind:e,name:t},s=nt(r.fields);s?.length&&(o._fields=s.join(","));let i=await(0,B.default)({path:(0,Ot.addQueryArgs)("/wp/v2/view-config",o)});n.receiveViewConfig(e,t,i)},RC=(e,t)=>async({dispatch:r})=>{let n=await(0,B.default)({path:(0,Ot.addQueryArgs)("/wp/v2/entity-fields",{kind:e,name:t})});r.receiveFieldsConfig(e,t,n)},TC=(e,t)=>async({dispatch:r})=>{let n=await(0,B.default)({path:(0,Ot.addQueryArgs)("/wp/v2/entity-actions",{kind:e,name:t})});r.receiveEntityActionsConfig(e,t,n)};function ru(e,t){let r={...e},n=r;for(let o of t)n.children={...n.children,[o]:{locks:[],children:{},...n.children[o]}},n=n.children[o];return r}function zo(e,t){let r=e;for(let n of t){let o=r.children[n];if(!o)return null;r=o}return r}function*Pm(e,t){let r=e;yield r;for(let n of t){let o=r.children[n];if(!o)break;yield o,r=o}}function*Vm(e){let t=Object.values(e.children);for(;t.length;){let r=t.pop();yield r,t.push(...Object.values(r.children))}}function nu({exclusive:e},t){return!!(e&&t.length||!e&&t.filter(r=>r.exclusive).length)}var IC={requests:[],tree:{locks:[],children:{}}};function qo(e=IC,t){switch(t.type){case"ENQUEUE_LOCK_REQUEST":{let{request:r}=t;return{...e,requests:[r,...e.requests]}}case"GRANT_LOCK_REQUEST":{let{lock:r,request:n}=t,{store:o,path:s}=n,i=[o,...s],a=ru(e.tree,i),c=zo(a,i);return c.locks=[...c.locks,r],{...e,requests:e.requests.filter(l=>l!==n),tree:a}}case"RELEASE_LOCK":{let{lock:r}=t,n=[r.store,...r.path],o=ru(e.tree,n),s=zo(o,n);return s.locks=s.locks.filter(i=>i!==r),{...e,tree:o}}}return e}function Bm(e){return e.requests}function jm(e,t,r,{exclusive:n}){let o=[t,...r],s=e.tree;for(let a of Pm(s,o))if(nu({exclusive:n},a.locks))return!1;let i=zo(s,o);if(!i)return!0;for(let a of Vm(i))if(nu({exclusive:n},a.locks))return!1;return!0}function Fm(){let e=qo(void 0,{type:"@@INIT"});function t(){for(let o of Bm(e)){let{store:s,path:i,exclusive:a,notifyAcquired:c}=o;if(jm(e,s,i,{exclusive:a})){let l={store:s,path:i,exclusive:a};e=qo(e,{type:"GRANT_LOCK_REQUEST",lock:l,request:o}),c(l)}}}function r(o,s,i){return new Promise(a=>{e=qo(e,{type:"ENQUEUE_LOCK_REQUEST",request:{store:o,path:s,exclusive:i,notifyAcquired:a}}),t()})}function n(o){e=qo(e,{type:"RELEASE_LOCK",lock:o}),t()}return{acquire:r,release:n}}function $m(){let e=Fm();function t(n,o,{exclusive:s}){return()=>e.acquire(n,o,s)}function r(n){return()=>e.release(n)}return{__unstableAcquireStoreLock:t,__unstableReleaseStoreLock:r}}var Ym,Hm;var Wi=g(Wt(),1);var zm=g(Wt(),1),He=(0,zm.createContext)({});He.displayName="EntityContext";var ou=g(Qt(),1);function Km({kind:e,type:t,id:r,revisionId:n,children:o}){return(0,ou.jsx)(Qi,{kind:e,type:t,id:r,revisionId:n,children:o})}function Qi({kind:e,type:t,id:r,revisionId:n,revision:o,children:s}){let i=(0,Wi.useContext)(He),a=o??n,c=(0,Wi.useMemo)(()=>({...i,...e&&{[e]:{...i?.[e],[t]:r}},...a!==void 0&&e&&{revision:{...i?.revision,[e]:{...i?.revision?.[e],[t]:a}}}}),[i,e,t,r,a]);return(0,ou.jsx)(He.Provider,{value:c,children:s})}var Ji=g(H(),1),Qm=g(Mr(),1),Jm=g(Wt(),1);var pt=(e=>(e.Idle="IDLE",e.Resolving="RESOLVING",e.Error="ERROR",e.Success="SUCCESS",e))(pt||{});function Ge(e){let t;switch(e){case"resolving":t=pt.Resolving;break;case"finished":t=pt.Success;break;case"error":t=pt.Error;break;default:t=pt.Idle}return{status:t,isResolving:t===pt.Resolving,hasStarted:t!==pt.Idle,hasResolved:t===pt.Success||t===pt.Error}}var Wm={};function su(e,t,r,n={enabled:!0}){let{editEntityRecord:o,saveEditedEntityRecord:s}=(0,Ji.useDispatch)(Ut),i=(0,Jm.useMemo)(()=>({edit:(p,d={})=>o(e,t,r,p,d),save:(p={})=>s(e,t,r,{throwOnError:!0,...p})}),[o,e,t,r,s]),{record:a,editedRecord:c,hasEdits:l,edits:u,...f}=(0,Ji.useSelect)(p=>{if(!n.enabled)return{record:null,editedRecord:Wm,hasEdits:!1,edits:Wm,...Ge()};let d=p(Ut),h=d.getResolutionState("getEntityRecord",[e,t,r])?.status;return{record:d.getEntityRecord(e,t,r)??null,editedRecord:d.getEditedEntityRecord(e,t,r),hasEdits:d.hasEditsForEntityRecord(e,t,r),edits:d.getEntityRecordNonTransientEdits(e,t,r),...Ge(h)}},[e,t,r,n.enabled]);return{record:a,editedRecord:c,hasEdits:l,edits:u,...f,...i}}function Xm(e,t,r,n){return(0,Qm.default)("wp.data.__experimentalUseEntityRecord",{alternative:"wp.data.useEntityRecord",since:"6.1"}),su(e,t,r,n)}var Zm=g(je(),1),tg=g(Mr(),1),Xi=g(H(),1),iu=g(Wt(),1);var AC=[];function Zi(e,t,r={},n={enabled:!0}){let o=(0,Zm.addQueryArgs)("",r),{records:s,totalItems:i,totalPages:a,...c}=(0,Xi.useSelect)(l=>{if(!n.enabled)return{records:AC,totalItems:null,totalPages:null,...Ge()};let u=l(Ut),f=u.getResolutionState("getEntityRecords",[e,t,r])?.status;return{records:u.getEntityRecords(e,t,r),totalItems:u.getEntityRecordsTotalItems(e,t,r),totalPages:u.getEntityRecordsTotalPages(e,t,r),...Ge(f)}},[e,t,o,n.enabled]);return{records:s,totalItems:i,totalPages:a,...c}}function eg(e,t,r,n){return(0,tg.default)("wp.data.__experimentalUseEntityRecords",{alternative:"wp.data.useEntityRecords",since:"6.1"}),Zi(e,t,r,n)}function rg(e,t,r={},n={enabled:!0}){let o=(0,Xi.useSelect)(u=>u(Ut).getEntityConfig(e,t),[e,t]),{records:s,...i}=Zi(e,t,{...r,...r._fields?{_fields:[...new Set([...nt(r._fields)||[],"_links"])].join()}:{}},n),a=(0,iu.useMemo)(()=>s?.map(u=>u[o?.key??"id"])??[],[s,o?.key]),c=(0,Xi.useSelect)(u=>{let{getEntityRecordsPermissions:f}=ut(u(Ut));return f(e,t,a)},[a,e,t]);return{records:(0,iu.useMemo)(()=>s?.map((u,f)=>({...u,permissions:c[f]}))??[],[s,c]),...i}}var sg=g(Mr(),1),ig=g(vi(),1);var ng=g(H(),1);function ta(e,t){var r=0,n,o;t=t||{};function s(){var i=n,a=arguments.length,c,l;t:for(;i;){if(i.args.length!==arguments.length){i=i.next;continue}for(l=0;l<a;l++)if(i.args[l]!==arguments[l]){i=i.next;continue t}return i!==n&&(i===o&&(o=i.prev),i.prev.next=i.next,i.next&&(i.next.prev=i.prev),i.next=n,i.prev=null,n.prev=i,n=i),i.val}for(c=new Array(a),l=0;l<a;l++)c[l]=arguments[l];return i={args:c,val:e.apply(null,c)},n?(n.prev=i,i.next=n):o=i,r===t.maxSize?(o=o.prev,o.next=null):r++,n=i,i.val}return s.clear=function(){n=null,o=null,r=0},s}var kC=["getIsResolving","hasStartedResolution","hasFinishedResolution","isResolving","getCachedResolvers"];function og(e,t){return(0,ng.useSelect)((r,n)=>e(s=>DC(r(s)),n),t)}var DC=ta((e=>{let t={};for(let r in e)kC.includes(r)||Object.defineProperty(t,r,{get:()=>(...n)=>{let o=e[r](...n),s=e.getResolutionState(r,n)?.status;return{data:o,...Ge(s)}}});return t}));function ag(e,t){let r=typeof e=="object",n=r?JSON.stringify(e):e;return r&&typeof t<"u"&&(0,ig.default)("When 'resource' is an entity object, passing 'id' as a separate argument isn't supported."),og(o=>{let s=r?!!e.id:!!t,{canUser:i}=o(Ut),a=r?{kind:e.kind,name:e.name}:e,c=i("create",a);if(!s){let m=i("read",a),y=c.isResolving||m.isResolving,E=c.hasResolved&&m.hasResolved,w=pt.Idle;return y?w=pt.Resolving:E&&(w=pt.Success),{status:w,isResolving:y,hasResolved:E,canCreate:c.hasResolved&&c.data,canRead:m.hasResolved&&m.data}}let l=i("read",e,t),u=i("update",e,t),f=i("delete",e,t),p=l.isResolving||c.isResolving||u.isResolving||f.isResolving,d=l.hasResolved&&c.hasResolved&&u.hasResolved&&f.hasResolved,h=pt.Idle;return p?h=pt.Resolving:d&&(h=pt.Success),{status:h,isResolving:p,hasResolved:d,canRead:d&&l.data,canCreate:d&&c.data,canUpdate:d&&u.data,canDelete:d&&f.data}},[n,t])}var cg=ag;function lg(e,t){return(0,sg.default)("wp.data.__experimentalUseResourcePermissions",{alternative:"wp.data.useResourcePermissions",since:"6.1"}),ag(e,t)}var Ko=g(Wt(),1),ea=g(H(),1),ra=g(Ne(),1);var ug=g(Wt(),1);function xn(e,t){return(0,ug.useContext)(He)?.[e]?.[t]}var ze=g(Ro(),1),hg=g(vi(),1);var fg=g(Ir(),1);var au,cu=new WeakMap;function dg(e){if(au||(au=ut(fg.privateApis)),!cu.has(e)){let t=au.getRichTextValues([e]);cu.set(e,t)}return cu.get(e)}var lu=new WeakMap;function OC(e){if(!lu.has(e)){let t=[];for(let r of dg(e))r&&r.replacements.forEach(({type:n,attributes:o})=>{n==="core/footnote"&&t.push(o["data-fn"])});lu.set(e,t)}return lu.get(e)}function pg(e){return e.flatMap(OC)}var uu={};function fu(e,t){let r={blocks:e};if(!t||t.footnotes===void 0)return r;let n=pg(e),o;try{o=JSON.parse(t.footnotes||"[]")}catch{}let s=[];if(Array.isArray(o)?s=o:(0,hg.default)("Footnotes post meta is not a JSON array; ignoring it."),s.map(f=>f.id).join("")===n.join(""))return r;let a=n.map(f=>s.find(p=>p.id===f)||uu[f]||{id:f,content:""});function c(f){if(!f||Array.isArray(f)||typeof f!="object")return f;f={...f};for(let p in f){let d=f[p];if(Array.isArray(d)){f[p]=d.map(c);continue}if(typeof d!="string"&&!(d instanceof ze.RichTextData))continue;let h=typeof d=="string"?ze.RichTextData.fromHTMLString(d):new ze.RichTextData(d),m=!1;h.replacements.forEach(y=>{if(y.type==="core/footnote"){let E=y.attributes["data-fn"],w=n.indexOf(E),S=(0,ze.create)({html:y.innerHTML});S.text=String(w+1),S.formats=Array.from({length:S.text.length},()=>S.formats[0]),S.replacements=Array.from({length:S.text.length},()=>S.replacements[0]),y.innerHTML=(0,ze.toHTMLString)({value:S}),m=!0}}),m&&(f[p]=typeof d=="string"?h.toHTMLString():h)}return f}function l(f){return f.map(p=>({...p,attributes:c(p.attributes),innerBlocks:l(p.innerBlocks)}))}let u=l(e);return uu={...uu,...s.reduce((f,p)=>(n.includes(p.id)||(f[p.id]=p),f),{})},{meta:{...t,footnotes:JSON.stringify(a)},blocks:u}}var UC=[];function mg(e,t,{id:r}={}){let n=xn(e,t),o=r??n,{content:s,editedBlocks:i,meta:a}=(0,ea.useSelect)(d=>{if(!o)return{};let{getEditedEntityRecord:h}=d(v),m=h(e,t,o);return{editedBlocks:m.blocks,content:m.content,meta:m.meta}},[e,t,o]),{__unstableCreateUndoLevel:c,editEntityRecord:l}=(0,ea.useDispatch)(v),u=(0,Ko.useMemo)(()=>{if(!o)return;if(i)return i;if(!s||typeof s!="string")return UC;let d=Om(e,t,o,s);return d||(d=(0,ra.parse)(s),qi(e,t,o,s,d)),d},[e,t,o,i,s]),f=(0,Ko.useCallback)((d,h)=>{if(u===d)return c(e,t,o);let{selection:y,...E}=h,w={selection:y,content:({blocks:S=[]})=>(0,ra.__unstableSerializeAndClean)(S),...fu(d,a)};l(e,t,o,w,{isCached:!1,...E})},[e,t,o,u,a,c,l]),p=(0,Ko.useCallback)((d,h)=>{let{selection:m,...y}=h,E={selection:m,...fu(d,a)};l(e,t,o,E,{isCached:!0,...y})},[e,t,o,a,l]);return[u,p,f]}var na=g(Wt(),1),oa=g(H(),1);var LC={context:"edit",_fields:"id,date,author,meta,title,excerpt,content.raw"};function gg(e,t,r,n){let o=xn(e,t),s=n??o,i=(0,na.useContext)(He),a=String(s)===String(o)?i?.revision?.[e]?.[t]:void 0,c=typeof a=="object"?a:void 0,l=c?void 0:a,u=!!(c||l),{value:f,fullValue:p}=(0,oa.useSelect)(m=>{if(c?r in c:l){let I=(c??m(v).getRevision(e,t,s,l,LC))?.[r];return I===void 0?{}:{value:I!==null&&typeof I=="object"&&"raw"in I?I.raw:I,fullValue:I}}let{getEntityRecord:y,getEditedEntityRecord:E}=m(v),w=y(e,t,s),S=E(e,t,s);return w&&S?{value:S[r],fullValue:w[r]}:{}},[e,t,s,r,l,c]),{editEntityRecord:d}=(0,oa.useDispatch)(v),h=(0,na.useCallback)(m=>{u||d(e,t,s,{[r]:m})},[d,e,t,s,r,u]);return[f,h,p]}var sa=g(In(),1),Jt=g(Wt(),1);var MC={richTextOffset:null,localClientId:null,attributeKey:null},du={activeCollaborators:[],resolveSelection:()=>MC,getDebugData:()=>({doc:{},clients:{},collaboratorMap:{}}),isCurrentCollaboratorDisconnected:!1};function yg(e,t){let r=(t??e.getCurrentState()).filter(n=>xo(n.collaboratorInfo));return{activeCollaborators:r,resolveSelection:(n,o)=>e.convertSelectionStateToAbsolute(n,o),getDebugData:()=>e.getDebugData(),isCurrentCollaboratorDisconnected:r.find(n=>n.isMe)?.isConnected===!1}}function Wo(e,t){let[r,n]=(0,Jt.useState)(du);return(0,Jt.useEffect)(()=>{if(e===null||t===null){n(du);return}let o=`postType/${t}`,s=e.toString(),i=dt()?.getAwareness(o,s);if(!i){n(du);return}return i.setUp(),n(yg(i)),i?.onStateChange(c=>{n(yg(i,c))})},[e,t]),r}function Eg(e,t){return Wo(e,t).activeCollaborators}function wg(e,t){let r=$p(),n=Wo(e,t);return(0,Jt.useCallback)(o=>n.resolveSelection(o,r),[r,n])}function NC(e,t){let[r,n]=(0,Jt.useState)(null);return(0,Jt.useEffect)(()=>{if(e===null||t===null){n(null);return}let o=dt()?.getAwareness(`postType/${t}`,e.toString());if(!o){n(null);return}o.setUp();let s=o.doc.getMap("state"),i=o.doc.getMap("document"),a=Date.now(),c=l=>{if(l.keysChanged.has("savedAt")){let u=s.get("savedAt"),f=s.get("savedBy");if(typeof u=="number"&&typeof f=="number"&&u>a){let p=i.get("status");n({savedAt:u,savedByClientId:f,postStatus:p})}}};return s.observe(c),()=>{s.unobserve(c)}},[e,t]),r}function Sg(e,t,r){let{activeCollaborators:n}=Wo(e,t),o=(0,sa.usePrevious)(n);(0,Jt.useEffect)(()=>{if(!o||o.length===0)return;let s=new Map(o.map(a=>[a.clientId,a])),i=n.find(a=>a.isMe);for(let a of n)!s.has(a.clientId)&&!a.isMe&&r(a,i)},[n,o,r])}function _g(e,t,r){let{activeCollaborators:n}=Wo(e,t),o=(0,sa.usePrevious)(n);(0,Jt.useEffect)(()=>{if(!o||o.length===0)return;let s=new Map(n.map(i=>[i.clientId,i]));for(let i of o){if(i.isMe||!i.isConnected)continue;s.get(i.clientId)?.isConnected||r(i)}},[n,o,r])}function bg(e,t,r){let{activeCollaborators:n}=Wo(e,t),o=NC(e,t),s=(0,sa.usePrevious)(o);(0,Jt.useEffect)(()=>{if(!o||s&&o.savedAt===s.savedAt)return;let i=n.find(a=>a.clientId===o.savedByClientId&&!a.isMe);i&&r(o,i,s??null)},[o,s,n,r])}var Qo=g(Nr(),1),Jo=g(Qt(),1),pu=(0,Jo.jsxs)(Qo.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:[(0,Jo.jsx)(Qo.Path,{d:"M9.75 4.75H18C18.6904 4.75 19.25 5.30964 19.25 6V14.25M9.75 4.75H6C5.30964 4.75 4.75 5.30964 4.75 6V14.25M9.75 4.75V14.25M19.25 14.25V18C19.25 18.6904 18.6904 19.25 18 19.25H6C5.30964 19.25 4.75 18.6904 4.75 18V14.25M19.25 14.25H9.75M9.75 14.25H4.75"}),(0,Jo.jsx)(Qo.Path,{d:"M19.25 15.5V18C19.25 18.6904 18.6904 19.25 18 19.25H6C5.30964 19.25 4.75 18.6904 4.75 18V15.5C4.75 14.8096 5.30964 14.25 6 14.25H18C18.6904 14.25 19.25 14.8096 19.25 15.5Z",fill:"currentColor"})]});var Xo=g(Nr(),1),Zo=g(Qt(),1),hu=(0,Zo.jsxs)(Xo.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:[(0,Zo.jsx)(Xo.Path,{d:"M9.75 19.25H18C18.6904 19.25 19.25 18.6904 19.25 18V9.75M9.75 19.25H6C5.30964 19.25 4.75 18.6904 4.75 18V9.75M9.75 19.25V9.75M19.25 9.75V6C19.25 5.30964 18.6904 4.75 18 4.75H6C5.30964 4.75 4.75 5.30964 4.75 6V9.75M19.25 9.75H9.75M9.75 9.75H4.75"}),(0,Zo.jsx)(Xo.Path,{d:"M19.25 8.5V6C19.25 5.30964 18.6904 4.75 18 4.75H6C5.30964 4.75 4.75 5.30964 4.75 6V8.5C4.75 9.19036 5.30964 9.75 6 9.75H18C18.6904 9.75 19.25 9.19036 19.25 8.5Z",fill:"currentColor"})]});var ia=g(Nr(),1),mu=g(Qt(),1),gu=(0,mu.jsx)(ia.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:(0,mu.jsx)(ia.Path,{d:"M9.75 19.25H18C18.6904 19.25 19.25 18.6904 19.25 18V9.75M9.75 19.25H6C5.30964 19.25 4.75 18.6904 4.75 18V9.75M9.75 19.25V9.75M19.25 9.75V6C19.25 5.30964 18.6904 4.75 18 4.75H6C5.30964 4.75 4.75 5.30964 4.75 6V9.75M19.25 9.75H9.75M9.75 9.75H4.75"})});var ts=g(Nr(),1),es=g(Qt(),1),yu=(0,es.jsxs)(ts.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:[(0,es.jsx)(ts.Path,{d:"M4.75 9.25V16C4.75 16.6904 5.30964 17.25 6 17.25H8M4.75 9.25V6C4.75 5.30964 5.30964 4.75 6 4.75H16C16.6904 4.75 17.25 5.30964 17.25 6V8M4.75 9.25H8"}),(0,es.jsx)(ts.Path,{d:"M10.75 11.25C10.75 10.9739 10.9739 10.75 11.25 10.75H18.75C19.0261 10.75 19.25 10.9739 19.25 11.25V18.75C19.25 19.0261 19.0261 19.25 18.75 19.25H11.25C10.9739 19.25 10.75 19.0261 10.75 18.75V11.25Z",fill:"currentColor"})]});var rs=g(Nr(),1),ns=g(Qt(),1),Eu=(0,ns.jsxs)(rs.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:[(0,ns.jsx)(rs.Path,{d:"M9.75 19.25H18C18.6904 19.25 19.25 18.6904 19.25 18V9.75M9.75 19.25H6C5.30964 19.25 4.75 18.6904 4.75 18V9.75M9.75 19.25V9.75M19.25 9.75V6C19.25 5.30964 18.6904 4.75 18 4.75H6C5.30964 4.75 4.75 5.30964 4.75 6V9.75M19.25 9.75H9.75M9.75 9.75H4.75"}),(0,ns.jsx)(rs.Path,{d:"M6 19.25H9.75V9.75H4.75V18C4.75 18.6904 5.30964 19.25 6 19.25Z",fill:"currentColor"})]});var os=g(Nr(),1),ss=g(Qt(),1),wu=(0,ss.jsxs)(os.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",style:{fill:"none"},stroke:"currentColor",strokeWidth:"1.5",children:[(0,ss.jsx)(os.Path,{d:"M15.2071 6.20711L20.2929 11.2929C20.6834 11.6834 20.6834 12.3166 20.2929 12.7071L15.2071 17.7929C14.8166 18.1834 14.1834 18.1834 13.7929 17.7929L8.70711 12.7071C8.31658 12.3166 8.31658 11.6834 8.70711 11.2929L13.7929 6.20711C14.1834 5.81658 14.8166 5.81658 15.2071 6.20711Z",fill:"currentColor"}),(0,ss.jsx)(os.Path,{d:"M9.5 5.5L3.70711 11.2929C3.31658 11.6834 3.31658 12.3166 3.70711 12.7071L9.5 18.5"})]});function aa(e){return e==="header"?hu:e==="footer"?pu:e==="sidebar"?Eu:e==="navigation-overlay"?yu:wu}var Cg={},ca=e=>{if(!e)return Cg;let{templateTypes:t,templateAreas:r,template:n}=e,{description:o,slug:s,title:i,area:a}=n,{title:c,description:l}=Object.values(t).find(h=>h.slug===s)??Cg,u=typeof i=="string"?i:i?.rendered,f=typeof o=="string"?o:o?.raw,d=r?.map(h=>({...h,icon:aa(h.icon)}))?.find(h=>a===h.area)?.icon||gu;return{title:u&&u!==s?u:c||s,description:f||l,icon:d}};function xg(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(r=xg(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function PC(){for(var e,t,r=0,n="",o=arguments.length;r<o;r++)(e=arguments[r])&&(t=xg(e))&&(n&&(n+=" "),n+=t);return n}var Rg=PC;var Se=g(la(),1),we=g(Pe(),1),Tn=g(Wt(),1),is=g(In(),1),Pg=g(H(),1);var Pr=g(Pe(),1),bu=g(H(),1),pa=g(la(),1);var L=g(Pe(),1),Ag=g(Ne(),1),ua=new Map,VC=[],Su={caption:(0,L.__)("Caption"),link:(0,L.__)("Link"),button:(0,L.__)("Button"),heading:(0,L.__)("Heading"),h1:(0,L.__)("H1"),h2:(0,L.__)("H2"),h3:(0,L.__)("H3"),h4:(0,L.__)("H4"),h5:(0,L.__)("H5"),h6:(0,L.__)("H6"),"settings.color":(0,L.__)("Color"),"settings.typography":(0,L.__)("Typography"),"settings.shadow":(0,L.__)("Shadow"),"settings.layout":(0,L.__)("Layout"),"styles.color":(0,L.__)("Colors"),"styles.spacing":(0,L.__)("Spacing"),"styles.background":(0,L.__)("Background"),"styles.typography":(0,L.__)("Typography"),"styles.border":(0,L.__)("Border"),"styles.shadow":(0,L.__)("Shadow"),"styles.outline":(0,L.__)("Outline"),"styles.filter":(0,L.__)("Filter"),"styles.dimensions":(0,L.__)("Dimensions")},BC=ta(()=>(0,Ag.getBlockTypes)().reduce((e,{name:t,title:r})=>(e[t]=r,e),{})),fa=e=>e!==null&&typeof e=="object";function jC(e){if(Su[e])return Su[e];let t=e.split(".");if(t?.[0]==="blocks")return BC()?.[t[1]]||t[1];if(t?.[0]==="elements")return Su[t[1]]||t[1]}function kg(e,t,r=""){if(!fa(e)&&!fa(t))return e!==t?r.split(".").slice(0,2).join("."):void 0;e=fa(e)?e:{},t=fa(t)?t:{};let n=new Set([...Object.keys(e),...Object.keys(t)]),o=[];for(let s of n){let i=r?r+"."+s:s,a=kg(e[s],t[s],i);a&&(o=o.concat(a))}return o}var FC=["background","color","typography","spacing","border","shadow","outline","filter","dimensions"];function Ig(e){return Object.fromEntries(FC.map(t=>[t,e?.styles?.[t]]))}function $C(e,t){let r=JSON.stringify({next:e,previous:t});if(ua.has(r))return ua.get(r);let n=kg({styles:Ig(e),blocks:e?.styles?.blocks,elements:e?.styles?.elements,settings:e?.settings},{styles:Ig(t),blocks:t?.styles?.blocks,elements:t?.styles?.elements,settings:t?.settings});if(!n||Array.isArray(n)&&!n.length)return ua.set(r,[]),[];let o=Array.isArray(n)?n:[n],s=[...new Set(o)].reduce((i,a)=>{let c=jC(a);return c&&i.push([a.split(".")[0],c]),i},[]);return ua.set(r,s),s}function _u(e,t,r={}){let n=$C(e,t),o=n.length,{maxResults:s}=r;return o?(s&&o>s&&(n=n.slice(0,s)),Object.entries(n.reduce((i,a)=>{let c=i[a[0]]||[];return c.includes(a[1])||(i[a[0]]=[...c,a[1]]),i},{})).map(([i,a])=>{let c=a.length,l=a.join((0,L.__)(", "));switch(i){case"blocks":return(0,L.sprintf)((0,L._n)("%s block.","%s blocks.",c),l);case"elements":return(0,L.sprintf)((0,L._n)("%s element.","%s elements.",c),l);case"settings":return(0,L.sprintf)((0,L.__)("%s settings."),l);case"styles":return(0,L.sprintf)((0,L.__)("%s styles."),l);default:return(0,L.sprintf)((0,L.__)("%s."),l)}})):VC}var da=g(la(),1),Dg=g(Pe(),1),Og=g(H(),1),Ug=g(Vo(),1);var Rn=g(Qt(),1);function Lg({record:e,checked:t,onChange:r}){let{name:n,kind:o,title:s,key:i}=e,{entityRecordTitle:a}=(0,Og.useSelect)(c=>{if(o!=="postType"||n!=="wp_template")return{entityRecordTitle:s};let l=c(v).getEditedEntityRecord(o,n,i),{default_template_types:u=[]}=c(v).getCurrentTheme()??{};return{entityRecordTitle:ca({template:l,templateTypes:u}).title}},[n,o,s,i]);return(0,Rn.jsx)(Rn.Fragment,{children:(0,Rn.jsx)(da.PanelRow,{children:(0,Rn.jsx)(da.CheckboxControl,{label:(0,Ug.decodeEntities)(a)||(0,Dg.__)("Untitled"),checked:t,onChange:r,className:"entities-saved-states__change-control"})})})}var Ee=g(Qt(),1);function YC(e,t){switch(e){case"site":return t===1?(0,Pr.__)("This change will affect your whole site."):(0,Pr.__)("These changes will affect your whole site.");case"wp_template":return(0,Pr.__)("This change will affect other parts of your site that use this template.");case"page":case"post":return(0,Pr.__)("The following has been modified.")}}function HC({record:e}){let{editedRecord:t,savedRecord:r}=(0,bu.useSelect)(o=>{let{getEditedEntityRecord:s,getEntityRecord:i}=o(v);return{editedRecord:s(e.kind,e.name,e.key),savedRecord:i(e.kind,e.name,e.key)}},[e.kind,e.name,e.key]),n=_u(t,r,{maxResults:10});return n.length?(0,Ee.jsx)("ul",{className:"entities-saved-states__changes",children:n.map(o=>(0,Ee.jsx)("li",{children:o},o))}):null}function GC({record:e,count:t}){if(e?.name==="globalStyles")return null;let r=YC(e?.name,t);return r?(0,Ee.jsx)(pa.PanelRow,{children:r}):null}function Mg({list:e,unselectedEntities:t,setUnselectedEntities:r}){let n=e.length,o=e[0],i=(0,bu.useSelect)(a=>a(v).getEntityConfig(o.kind,o.name),[o.kind,o.name]).label;return o?.name==="wp_template_part"&&(i=n===1?(0,Pr.__)("Template Part"):(0,Pr.__)("Template Parts")),(0,Ee.jsxs)(pa.PanelBody,{title:i,initialOpen:!0,className:"entities-saved-states__panel-body",children:[(0,Ee.jsx)(GC,{record:o,count:n}),e.map(a=>(0,Ee.jsx)(Lg,{record:a,checked:!t.some(c=>c.kind===a.kind&&c.name===a.name&&c.key===a.key&&c.property===a.property),onChange:c=>r(a,c)},a.key||a.property)),o?.name==="globalStyles"&&(0,Ee.jsx)(HC,{record:o})]})}var Ng=g(H(),1),ha=g(Wt(),1);var ma=()=>{let{editedEntities:e,siteEdits:t,siteEntityConfig:r}=(0,Ng.useSelect)(c=>{let{__experimentalGetDirtyEntityRecords:l,getEntityRecordEdits:u,getEntityConfig:f}=c(v);return{editedEntities:l(),siteEdits:u("root","site"),siteEntityConfig:f("root","site")}},[]),n=(0,ha.useMemo)(()=>{let c=e.filter(E=>!(E.kind==="root"&&E.name==="site")),l=r?.meta?.labels??{},{title:u,description:f,site_logo:p,site_icon:d,...h}=t??{},y=[u!==void 0&&"title",f!==void 0&&"description",p!==void 0&&"site_logo",d!==void 0&&"site_icon",...Object.keys(h)].filter(Boolean).map(E=>({kind:"root",name:"site",title:l[E]||E,property:E}));return[...c,...y]},[e,t,r]),[o,s]=(0,ha.useState)([]),i=({kind:c,name:l,key:u,property:f},p)=>{s(p?o.filter(d=>d.kind!==c||d.name!==l||d.key!==u||d.property!==f):[...o,{kind:c,name:l,key:u,property:f}])},a=n.length-o.length>0;return{dirtyEntityRecords:n,isDirty:a,setUnselectedEntities:i,unselectedEntities:o}};var rt=g(Qt(),1);function Vg({close:e,renderDialog:t,variant:r}){let n=ma();return(0,rt.jsx)(as,{close:e,renderDialog:t,variant:r,...n})}function as({additionalPrompt:e=void 0,close:t,onSave:r=void 0,saveEnabled:n=void 0,saveLabel:o=(0,we.__)("Save"),renderDialog:s,dirtyEntityRecords:i,isDirty:a,setUnselectedEntities:c,unselectedEntities:l,variant:u="default",successNoticeContent:f}){let p=(0,Tn.useRef)(),{saveDirtyEntities:d}=ut((0,Pg.useDispatch)(v)),h=i.reduce((V,j)=>{let{name:Y}=j;return V[Y]||(V[Y]=[]),V[Y].push(j),V},{}),{site:m,wp_template:y,wp_template_part:E,...w}=h,S=[m,y,E,...Object.values(w)].filter(Array.isArray),k=n??a,I=(0,Tn.useCallback)(()=>t(),[t]),[Q,vt]=(0,is.__experimentalUseDialog)({onClose:()=>I()}),_=(0,is.useInstanceId)(as,"entities-saved-states__panel-label"),T=(0,is.useInstanceId)(as,"entities-saved-states__panel-description"),C=i.length?(0,we.__)("Select the items you want to save."):void 0,R=u==="inline",A=(0,rt.jsxs)(rt.Fragment,{children:[(0,rt.jsx)(Se.FlexItem,{isBlock:!R,as:Se.Button,variant:R?"tertiary":"secondary",size:R?void 0:"compact",onClick:I,children:(0,we.__)("Cancel")}),(0,rt.jsx)(Se.FlexItem,{isBlock:!R,as:Se.Button,ref:p,variant:"primary",size:R?void 0:"compact",disabled:!k,accessibleWhenDisabled:!0,onClick:()=>d({onSave:r,dirtyEntityRecords:i,entitiesToSkip:l,close:t,successNoticeContent:f}),className:"entities-saved-states__save-button",children:o})]});return(0,rt.jsxs)("div",{ref:s?Q:void 0,...s&&vt,className:Rg("entities-saved-states__panel",{"is-inline":R}),role:s?"dialog":void 0,"aria-labelledby":s?_:void 0,"aria-describedby":s?T:void 0,children:[!R&&(0,rt.jsx)(Se.Flex,{className:"entities-saved-states__panel-header",gap:2,children:A}),(0,rt.jsxs)("div",{className:"entities-saved-states__text-prompt",children:[(0,rt.jsx)("div",{className:"entities-saved-states__text-prompt--header-wrapper",children:(0,rt.jsx)("strong",{id:s?_:void 0,className:"entities-saved-states__text-prompt--header",children:(0,we.__)("Are you ready to save?")})}),(0,rt.jsxs)("div",{id:s?T:void 0,children:[e,(0,rt.jsx)("p",{className:"entities-saved-states__text-prompt--changes-count",children:a?(0,Tn.createInterpolateElement)((0,we.sprintf)((0,we._n)("There is <strong>%d site change</strong> waiting to be saved.","There are <strong>%d site changes</strong> waiting to be saved.",i.length),i.length),{strong:(0,rt.jsx)("strong",{})}):C})]})]}),S.map(V=>(0,rt.jsx)(Mg,{list:V,unselectedEntities:l,setUnselectedEntities:c},V[0].name)),R&&(0,rt.jsx)(Se.Flex,{direction:"row",justify:"flex-end",className:"entities-saved-states__panel-footer",children:A})]})}var zC={PrivateEntityProvider:Qi,EntitiesSavedStates:Vg,EntitiesSavedStatesExtensible:as,getTemplateInfo:ca,getTemplatePartIcon:aa,useEntitiesSavedStatesIsDirty:ma,useEntityRecordsWithPermissions:rg,RECEIVE_INTERMEDIATE_RESULTS:Mn,CRDT_AUTOSAVE_SNAPSHOT_KEY:Rl,entityContainsSnapshot:Oh,getEntitySnapshot:Dh,retrySyncConnection:wi,useActiveCollaborators:Eg,useResolvedSelection:wg,useOnCollaboratorJoin:Sg,useOnCollaboratorLeave:_g,useOnPostSave:bg,SelectionType:Ar,SelectionDirection:Sn},Bg={};Vp(Bg,zC);var vu=[...Bi,...ji.filter(e=>!!e.name)],qC=vu.reduce((e,t)=>{let{kind:r,name:n,plural:o}=t,s=Ur(r,n);if(e[s]=(i,a,c)=>(U(r,n,s,{isShorthandSelector:!0,alternativeFunctionName:"getEntityRecord"}),qt(i,r,n,a,c)),o){let i=Ur(r,o,"get");e[i]=(a,c)=>(U(r,n,i,{isShorthandSelector:!0,alternativeFunctionName:"getEntityRecords"}),Hi(a,r,n,c))}return e},{}),KC=vu.reduce((e,t)=>{let{kind:r,name:n,plural:o}=t,s=Ur(r,n);if(e[s]=(i,a)=>(U(r,n,s,{isShorthandSelector:!0,alternativeFunctionName:"getEntityRecord"}),Ki(r,n,i,a)),o){let i=Ur(r,o,"get");e[i]=(...a)=>(U(r,o,i,{isShorthandSelector:!0,alternativeFunctionName:"getEntityRecords"}),Go(r,n,...a)),e[i].shouldInvalidate=a=>Go.shouldInvalidate(a,r,n)}return e},{}),WC=vu.reduce((e,t)=>{let{kind:r,name:n}=t,o=Ur(r,n,"save");e[o]=(i,a)=>(U(r,n,o,{isShorthandSelector:!0,alternativeFunctionName:"saveEntityRecord"}),zl(r,n,i,a));let s=Ur(r,n,"delete");return e[s]=(i,a,c)=>(U(r,n,s,{isShorthandSelector:!0,alternativeFunctionName:"deleteEntityRecord"}),Gl(r,n,i,a,c)),e},{}),QC=()=>({reducer:Jh,actions:{...Ym,...ql,...WC,...$m()},selectors:{...Hm,...Pl,...qC},resolvers:{...eu,...KC}}),Ut=(0,ga.createReduxStore)(v,QC());ut(Ut).registerPrivateSelectors(Ol);ut(Ut).registerPrivateActions(Wl);(0,ga.register)(Ut);return Kg(JC);})();
(window.wp ||= {}).coreData = wp.coreData;
})();

Directory Contents

Dirs: 3 × Files: 130
Name Size Perms Modified Actions
- drwxr-xr-x 2026-10-28 14:44:54
Edit Download
- drwxr-xr-x 2026-10-28 14:44:54
Edit Download
vendor DIR
- drwxr-xr-x 2026-10-28 14:44:54
Edit Download
5.56 KB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
2.55 KB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
15.74 KB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
5.84 KB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
20.32 KB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
7.68 KB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
9.79 KB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
5.57 KB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
115 B lrw-r--r-- 2026-10-28 14:44:54
Edit Download
142 B lrw-r--r-- 2026-10-28 14:44:54
Edit Download
2.35 KB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
1.21 KB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
527.90 KB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
222.35 KB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
5.51 MB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
2.34 MB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
3.86 MB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
1.72 MB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
6.68 KB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
2.54 KB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
50.59 KB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
10.48 KB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
295.67 KB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
147.18 KB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
148.74 KB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
62.35 KB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
3.47 MB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
1.71 MB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
83.89 KB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
29.10 KB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
26.67 KB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
11.00 KB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
709.27 KB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
245.94 KB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
646.11 KB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
240.20 KB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
4.20 KB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
1.84 KB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
87.41 KB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
26.96 KB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
177.00 KB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
141.37 KB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
3.11 KB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
1.35 KB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
1.53 KB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
881 B lrw-r--r-- 2026-10-28 14:44:54
Edit Download
36.56 KB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
13.68 KB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
458.55 KB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
156.13 KB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
3.50 MB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
1.59 MB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
713.04 KB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
265.15 KB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
5.27 MB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
2.37 MB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
28.67 KB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
12.34 KB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
2.36 KB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
1.13 KB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
858.37 KB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
397.41 KB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
12.01 KB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
4.99 KB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
1.71 KB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
950 B lrw-r--r-- 2026-10-28 14:44:54
Edit Download
15.73 KB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
5.66 KB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
2.77 KB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
1.17 KB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
10.69 KB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
3.76 KB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
9.48 KB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
3.25 KB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
24.94 KB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
10.79 KB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
2.48 MB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
1.15 MB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
516.75 KB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
214.01 KB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
4.32 KB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
1.71 KB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
107.90 KB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
45.50 KB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
18.22 KB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
7.40 KB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
18.14 KB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
5.73 KB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
21.45 KB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
7.96 KB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
5.20 KB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
2.04 KB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
10.23 KB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
3.42 KB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
4.85 KB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
2.96 KB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
3.97 KB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
1.59 KB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
25.86 KB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
9.72 KB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
5.21 KB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
2.15 KB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
108.74 KB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
43.36 KB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
36.39 KB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
14.21 KB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
12.32 KB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
4.51 KB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
8.08 KB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
3.35 KB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
19.83 KB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
7.33 KB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
161.16 KB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
70.73 KB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
6.18 KB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
1.68 KB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
5.36 KB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
1.77 KB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
119.85 KB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
50.53 KB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
20.33 KB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
8.97 KB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
7.15 KB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
2.33 KB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
1.58 KB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
816 B lrw-r--r-- 2026-10-28 14:44:54
Edit Download
694.87 KB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
315.80 KB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
7.00 KB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
2.51 KB lrw-r--r-- 2026-10-28 14:44:54
Edit Download
If ZipArchive is unavailable, a .tar will be created (no compression).
© 2026 0xNothings — Secure File Manager. All rights reserved. Built with ❤️ & Tailwind x Dark UI