@prismicio/editor-fields 0.4.75-alpha.support-new-cr-model.1 → 0.4.75

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs.js CHANGED
@@ -66,7 +66,7 @@ In object: ${JSON.stringify(t)}`);return n};function yd(t,e,n,r){return new(n||(
66
66
  `})]})}function JDe(t){const{repository:e,track:n}=t;return f.jsx(A.Box,{display:"grid",gridTemplateColumns:"380px 1px minmax(0, 1fr)",width:"100%",height:"100%",gap:16,children:f.jsx(A.ToastProvider,{children:f.jsxs(jLe,{repository:e,track:n,children:[f.jsx(tDe,{}),f.jsx(A.Separator,{orientation:"vertical",style:"dashed",decorative:!0}),f.jsx(qDe,{})]})})})}var ue={},Pr={},Eg={};Object.defineProperty(Eg,"__esModule",{value:!0});Eg.ContentPath=void 0;const uD="::";Eg.ContentPath={serialize(t){return t.map(e=>e.key).join(uD)},current(t){return t[t.length-1]},append(t,e){return t+uD+e},make(t){return t.reduce((e,{key:n,type:r})=>n?e.concat({key:n,type:r}):e,[])}};var HS={},YS={},ya={},uY={},EC={},RC={};Object.defineProperty(RC,"__esModule",{value:!0});RC.default=XDe;let rv;const ZDe=new Uint8Array(16);function XDe(){if(!rv&&(rv=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!rv))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return rv(ZDe)}var Yl={},rd={},kC={};Object.defineProperty(kC,"__esModule",{value:!0});kC.default=void 0;var e2e=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;kC.default=e2e;Object.defineProperty(rd,"__esModule",{value:!0});rd.default=void 0;var t2e=n2e(kC);function n2e(t){return t&&t.__esModule?t:{default:t}}function r2e(t){return typeof t=="string"&&t2e.default.test(t)}var i2e=r2e;rd.default=i2e;Object.defineProperty(Yl,"__esModule",{value:!0});Yl.default=void 0;Yl.unsafeStringify=dY;var o2e=a2e(rd);function a2e(t){return t&&t.__esModule?t:{default:t}}const Rn=[];for(let t=0;t<256;++t)Rn.push((t+256).toString(16).slice(1));function dY(t,e=0){return Rn[t[e+0]]+Rn[t[e+1]]+Rn[t[e+2]]+Rn[t[e+3]]+"-"+Rn[t[e+4]]+Rn[t[e+5]]+"-"+Rn[t[e+6]]+Rn[t[e+7]]+"-"+Rn[t[e+8]]+Rn[t[e+9]]+"-"+Rn[t[e+10]]+Rn[t[e+11]]+Rn[t[e+12]]+Rn[t[e+13]]+Rn[t[e+14]]+Rn[t[e+15]]}function s2e(t,e=0){const n=dY(t,e);if(!(0,o2e.default)(n))throw TypeError("Stringified UUID is invalid");return n}var l2e=s2e;Yl.default=l2e;Object.defineProperty(EC,"__esModule",{value:!0});EC.default=void 0;var c2e=d2e(RC),u2e=Yl;function d2e(t){return t&&t.__esModule?t:{default:t}}let dD,GS,JS=0,ZS=0;function f2e(t,e,n){let r=e&&n||0;const i=e||new Array(16);t=t||{};let o=t.node||dD,a=t.clockseq!==void 0?t.clockseq:GS;if(o==null||a==null){const p=t.random||(t.rng||c2e.default)();o==null&&(o=dD=[p[0]|1,p[1],p[2],p[3],p[4],p[5]]),a==null&&(a=GS=(p[6]<<8|p[7])&16383)}let s=t.msecs!==void 0?t.msecs:Date.now(),l=t.nsecs!==void 0?t.nsecs:ZS+1;const c=s-JS+(l-ZS)/1e4;if(c<0&&t.clockseq===void 0&&(a=a+1&16383),(c<0||s>JS)&&t.nsecs===void 0&&(l=0),l>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");JS=s,ZS=l,GS=a,s+=122192928e5;const u=((s&268435455)*1e4+l)%4294967296;i[r++]=u>>>24&255,i[r++]=u>>>16&255,i[r++]=u>>>8&255,i[r++]=u&255;const d=s/4294967296*1e4&268435455;i[r++]=d>>>8&255,i[r++]=d&255,i[r++]=d>>>24&15|16,i[r++]=d>>>16&255,i[r++]=a>>>8|128,i[r++]=a&255;for(let p=0;p<6;++p)i[r+p]=o[p];return e||(0,u2e.unsafeStringify)(i)}var p2e=f2e;EC.default=p2e;var $C={},hl={},Rg={};Object.defineProperty(Rg,"__esModule",{value:!0});Rg.default=void 0;var h2e=m2e(rd);function m2e(t){return t&&t.__esModule?t:{default:t}}function A2e(t){if(!(0,h2e.default)(t))throw TypeError("Invalid UUID");let e;const n=new Uint8Array(16);return n[0]=(e=parseInt(t.slice(0,8),16))>>>24,n[1]=e>>>16&255,n[2]=e>>>8&255,n[3]=e&255,n[4]=(e=parseInt(t.slice(9,13),16))>>>8,n[5]=e&255,n[6]=(e=parseInt(t.slice(14,18),16))>>>8,n[7]=e&255,n[8]=(e=parseInt(t.slice(19,23),16))>>>8,n[9]=e&255,n[10]=(e=parseInt(t.slice(24,36),16))/1099511627776&255,n[11]=e/4294967296&255,n[12]=e>>>24&255,n[13]=e>>>16&255,n[14]=e>>>8&255,n[15]=e&255,n}var g2e=A2e;Rg.default=g2e;Object.defineProperty(hl,"__esModule",{value:!0});hl.URL=hl.DNS=void 0;hl.default=S2e;var v2e=Yl,y2e=b2e(Rg);function b2e(t){return t&&t.__esModule?t:{default:t}}function C2e(t){t=unescape(encodeURIComponent(t));const e=[];for(let n=0;n<t.length;++n)e.push(t.charCodeAt(n));return e}const fY="6ba7b810-9dad-11d1-80b4-00c04fd430c8";hl.DNS=fY;const pY="6ba7b811-9dad-11d1-80b4-00c04fd430c8";hl.URL=pY;function S2e(t,e,n){function r(i,o,a,s){var l;if(typeof i=="string"&&(i=C2e(i)),typeof o=="string"&&(o=(0,y2e.default)(o)),((l=o)===null||l===void 0?void 0:l.length)!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let c=new Uint8Array(16+i.length);if(c.set(o),c.set(i,o.length),c=n(c),c[6]=c[6]&15|e,c[8]=c[8]&63|128,a){s=s||0;for(let u=0;u<16;++u)a[s+u]=c[u];return a}return(0,v2e.unsafeStringify)(c)}try{r.name=t}catch{}return r.DNS=fY,r.URL=pY,r}var OC={};Object.defineProperty(OC,"__esModule",{value:!0});OC.default=void 0;function w2e(t){if(typeof t=="string"){const e=unescape(encodeURIComponent(t));t=new Uint8Array(e.length);for(let n=0;n<e.length;++n)t[n]=e.charCodeAt(n)}return x2e(T2e(_2e(t),t.length*8))}function x2e(t){const e=[],n=t.length*32,r="0123456789abcdef";for(let i=0;i<n;i+=8){const o=t[i>>5]>>>i%32&255,a=parseInt(r.charAt(o>>>4&15)+r.charAt(o&15),16);e.push(a)}return e}function hY(t){return(t+64>>>9<<4)+14+1}function T2e(t,e){t[e>>5]|=128<<e%32,t[hY(e)-1]=e;let n=1732584193,r=-271733879,i=-1732584194,o=271733878;for(let a=0;a<t.length;a+=16){const s=n,l=r,c=i,u=o;n=Yn(n,r,i,o,t[a],7,-680876936),o=Yn(o,n,r,i,t[a+1],12,-389564586),i=Yn(i,o,n,r,t[a+2],17,606105819),r=Yn(r,i,o,n,t[a+3],22,-1044525330),n=Yn(n,r,i,o,t[a+4],7,-176418897),o=Yn(o,n,r,i,t[a+5],12,1200080426),i=Yn(i,o,n,r,t[a+6],17,-1473231341),r=Yn(r,i,o,n,t[a+7],22,-45705983),n=Yn(n,r,i,o,t[a+8],7,1770035416),o=Yn(o,n,r,i,t[a+9],12,-1958414417),i=Yn(i,o,n,r,t[a+10],17,-42063),r=Yn(r,i,o,n,t[a+11],22,-1990404162),n=Yn(n,r,i,o,t[a+12],7,1804603682),o=Yn(o,n,r,i,t[a+13],12,-40341101),i=Yn(i,o,n,r,t[a+14],17,-1502002290),r=Yn(r,i,o,n,t[a+15],22,1236535329),n=Gn(n,r,i,o,t[a+1],5,-165796510),o=Gn(o,n,r,i,t[a+6],9,-1069501632),i=Gn(i,o,n,r,t[a+11],14,643717713),r=Gn(r,i,o,n,t[a],20,-373897302),n=Gn(n,r,i,o,t[a+5],5,-701558691),o=Gn(o,n,r,i,t[a+10],9,38016083),i=Gn(i,o,n,r,t[a+15],14,-660478335),r=Gn(r,i,o,n,t[a+4],20,-405537848),n=Gn(n,r,i,o,t[a+9],5,568446438),o=Gn(o,n,r,i,t[a+14],9,-1019803690),i=Gn(i,o,n,r,t[a+3],14,-187363961),r=Gn(r,i,o,n,t[a+8],20,1163531501),n=Gn(n,r,i,o,t[a+13],5,-1444681467),o=Gn(o,n,r,i,t[a+2],9,-51403784),i=Gn(i,o,n,r,t[a+7],14,1735328473),r=Gn(r,i,o,n,t[a+12],20,-1926607734),n=Jn(n,r,i,o,t[a+5],4,-378558),o=Jn(o,n,r,i,t[a+8],11,-2022574463),i=Jn(i,o,n,r,t[a+11],16,1839030562),r=Jn(r,i,o,n,t[a+14],23,-35309556),n=Jn(n,r,i,o,t[a+1],4,-1530992060),o=Jn(o,n,r,i,t[a+4],11,1272893353),i=Jn(i,o,n,r,t[a+7],16,-155497632),r=Jn(r,i,o,n,t[a+10],23,-1094730640),n=Jn(n,r,i,o,t[a+13],4,681279174),o=Jn(o,n,r,i,t[a],11,-358537222),i=Jn(i,o,n,r,t[a+3],16,-722521979),r=Jn(r,i,o,n,t[a+6],23,76029189),n=Jn(n,r,i,o,t[a+9],4,-640364487),o=Jn(o,n,r,i,t[a+12],11,-421815835),i=Jn(i,o,n,r,t[a+15],16,530742520),r=Jn(r,i,o,n,t[a+2],23,-995338651),n=Zn(n,r,i,o,t[a],6,-198630844),o=Zn(o,n,r,i,t[a+7],10,1126891415),i=Zn(i,o,n,r,t[a+14],15,-1416354905),r=Zn(r,i,o,n,t[a+5],21,-57434055),n=Zn(n,r,i,o,t[a+12],6,1700485571),o=Zn(o,n,r,i,t[a+3],10,-1894986606),i=Zn(i,o,n,r,t[a+10],15,-1051523),r=Zn(r,i,o,n,t[a+1],21,-2054922799),n=Zn(n,r,i,o,t[a+8],6,1873313359),o=Zn(o,n,r,i,t[a+15],10,-30611744),i=Zn(i,o,n,r,t[a+6],15,-1560198380),r=Zn(r,i,o,n,t[a+13],21,1309151649),n=Zn(n,r,i,o,t[a+4],6,-145523070),o=Zn(o,n,r,i,t[a+11],10,-1120210379),i=Zn(i,o,n,r,t[a+2],15,718787259),r=Zn(r,i,o,n,t[a+9],21,-343485551),n=zs(n,s),r=zs(r,l),i=zs(i,c),o=zs(o,u)}return[n,r,i,o]}function _2e(t){if(t.length===0)return[];const e=t.length*8,n=new Uint32Array(hY(e));for(let r=0;r<e;r+=8)n[r>>5]|=(t[r/8]&255)<<r%32;return n}function zs(t,e){const n=(t&65535)+(e&65535);return(t>>16)+(e>>16)+(n>>16)<<16|n&65535}function I2e(t,e){return t<<e|t>>>32-e}function MC(t,e,n,r,i,o){return zs(I2e(zs(zs(e,t),zs(r,o)),i),n)}function Yn(t,e,n,r,i,o,a){return MC(e&n|~e&r,t,e,i,o,a)}function Gn(t,e,n,r,i,o,a){return MC(e&r|n&~r,t,e,i,o,a)}function Jn(t,e,n,r,i,o,a){return MC(e^n^r,t,e,i,o,a)}function Zn(t,e,n,r,i,o,a){return MC(n^(e|~r),t,e,i,o,a)}var E2e=w2e;OC.default=E2e;Object.defineProperty($C,"__esModule",{value:!0});$C.default=void 0;var R2e=mY(hl),k2e=mY(OC);function mY(t){return t&&t.__esModule?t:{default:t}}const $2e=(0,R2e.default)("v3",48,k2e.default);var O2e=$2e;$C.default=O2e;var FC={},jC={};Object.defineProperty(jC,"__esModule",{value:!0});jC.default=void 0;const M2e=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);var F2e={randomUUID:M2e};jC.default=F2e;Object.defineProperty(FC,"__esModule",{value:!0});FC.default=void 0;var fD=AY(jC),j2e=AY(RC),L2e=Yl;function AY(t){return t&&t.__esModule?t:{default:t}}function D2e(t,e,n){if(fD.default.randomUUID&&!e&&!t)return fD.default.randomUUID();t=t||{};const r=t.random||(t.rng||j2e.default)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,e){n=n||0;for(let i=0;i<16;++i)e[n+i]=r[i];return e}return(0,L2e.unsafeStringify)(r)}var P2e=D2e;FC.default=P2e;var LC={},DC={};Object.defineProperty(DC,"__esModule",{value:!0});DC.default=void 0;function B2e(t,e,n,r){switch(t){case 0:return e&n^~e&r;case 1:return e^n^r;case 2:return e&n^e&r^n&r;case 3:return e^n^r}}function XS(t,e){return t<<e|t>>>32-e}function U2e(t){const e=[1518500249,1859775393,2400959708,3395469782],n=[1732584193,4023233417,2562383102,271733878,3285377520];if(typeof t=="string"){const a=unescape(encodeURIComponent(t));t=[];for(let s=0;s<a.length;++s)t.push(a.charCodeAt(s))}else Array.isArray(t)||(t=Array.prototype.slice.call(t));t.push(128);const r=t.length/4+2,i=Math.ceil(r/16),o=new Array(i);for(let a=0;a<i;++a){const s=new Uint32Array(16);for(let l=0;l<16;++l)s[l]=t[a*64+l*4]<<24|t[a*64+l*4+1]<<16|t[a*64+l*4+2]<<8|t[a*64+l*4+3];o[a]=s}o[i-1][14]=(t.length-1)*8/Math.pow(2,32),o[i-1][14]=Math.floor(o[i-1][14]),o[i-1][15]=(t.length-1)*8&4294967295;for(let a=0;a<i;++a){const s=new Uint32Array(80);for(let h=0;h<16;++h)s[h]=o[a][h];for(let h=16;h<80;++h)s[h]=XS(s[h-3]^s[h-8]^s[h-14]^s[h-16],1);let l=n[0],c=n[1],u=n[2],d=n[3],p=n[4];for(let h=0;h<80;++h){const m=Math.floor(h/20),g=XS(l,5)+B2e(m,c,u,d)+p+e[m]+s[h]>>>0;p=d,d=u,u=XS(c,30)>>>0,c=l,l=g}n[0]=n[0]+l>>>0,n[1]=n[1]+c>>>0,n[2]=n[2]+u>>>0,n[3]=n[3]+d>>>0,n[4]=n[4]+p>>>0}return[n[0]>>24&255,n[0]>>16&255,n[0]>>8&255,n[0]&255,n[1]>>24&255,n[1]>>16&255,n[1]>>8&255,n[1]&255,n[2]>>24&255,n[2]>>16&255,n[2]>>8&255,n[2]&255,n[3]>>24&255,n[3]>>16&255,n[3]>>8&255,n[3]&255,n[4]>>24&255,n[4]>>16&255,n[4]>>8&255,n[4]&255]}var N2e=U2e;DC.default=N2e;Object.defineProperty(LC,"__esModule",{value:!0});LC.default=void 0;var W2e=gY(hl),K2e=gY(DC);function gY(t){return t&&t.__esModule?t:{default:t}}const q2e=(0,W2e.default)("v5",80,K2e.default);var V2e=q2e;LC.default=V2e;var PC={};Object.defineProperty(PC,"__esModule",{value:!0});PC.default=void 0;var z2e="00000000-0000-0000-0000-000000000000";PC.default=z2e;var BC={};Object.defineProperty(BC,"__esModule",{value:!0});BC.default=void 0;var Q2e=H2e(rd);function H2e(t){return t&&t.__esModule?t:{default:t}}function Y2e(t){if(!(0,Q2e.default)(t))throw TypeError("Invalid UUID");return parseInt(t.slice(14,15),16)}var G2e=Y2e;BC.default=G2e;(function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"NIL",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(t,"parse",{enumerable:!0,get:function(){return c.default}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(t,"v1",{enumerable:!0,get:function(){return e.default}}),Object.defineProperty(t,"v3",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(t,"v4",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(t,"v5",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(t,"validate",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(t,"version",{enumerable:!0,get:function(){return a.default}});var e=u(EC),n=u($C),r=u(FC),i=u(LC),o=u(PC),a=u(BC),s=u(rd),l=u(Yl),c=u(Rg);function u(d){return d&&d.__esModule?d:{default:d}}})(uY);var pD;function jt(){if(pD)return ya;pD=1,Object.defineProperty(ya,"__esModule",{value:!0}),ya.withKey=ya.hasContentType=ya.hasFieldContentType=void 0;const t=G,e=un,n=(0,t.__importStar)(te),r=uY,i=rj();function o(u){var d;return a(u)&&u.__TYPE__===i.FieldContentType&&((d=u)===null||d===void 0?void 0:d.type)!==void 0&&typeof u.type=="string"&&(0,e.isRight)(i.FieldType.decode(u.type))}ya.hasFieldContentType=o;function a(u){return typeof u=="object"&&u!==null&&"__TYPE__"in u}ya.hasContentType=a;const s=u=>typeof u=="string"&&(0,r.validate)(u),l=new n.Type("UUID",s,(u,d)=>typeof u>"u"?n.success((0,r.v4)()):s(u)?n.success(u):n.failure(u,d),n.identity);function c(u){return n.intersection([n.strict({key:l}),u])}return ya.withKey=c,ya}var hD;function vY(){return hD||(hD=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.EmptyContent=t.EmptyLegacy=t.isEmptyContent=t.EmptyContentType=void 0;const e=G,n=ut,r=Ye,i=(0,e.__importStar)(te),o=jt();t.EmptyContentType="EmptyContent";const a=c=>(0,o.hasContentType)(c)&&c.__TYPE__===t.EmptyContentType;t.isEmptyContent=a;const s=i.union([i.null,i.type({value:i.null})]),l=c=>new i.Type("EmptyLegacy",t.isEmptyContent,u=>(0,r.pipe)(s.decode(u),n.either.map(()=>({type:c,__TYPE__:t.EmptyContentType}))),()=>null);t.EmptyLegacy=l,t.EmptyContent=i.strict({type:i.string,__TYPE__:i.literal(t.EmptyContentType)})}(YS)),YS}var ew={},gr={};Object.defineProperty(gr,"__esModule",{value:!0});gr.defaultCtx=gr.getFieldCtx=gr.LegacyContentCtx=gr.FieldOrSliceType=void 0;const J2e=G,tw=(0,J2e.__importStar)(te),mD=pa;gr.FieldOrSliceType=tw.union([tw.union([mD.FieldType,mD.SlicesTypes]),tw.literal("Repeatable.Link")]);class XF{constructor(e,n,r){Object.defineProperty(this,"fieldKey",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"prefixedKey",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"keyOfType",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"fieldPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"fieldType",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"allTypes",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.fieldKey=e,this.fieldPath=n||[],this.allTypes=r||new Map;const i=Array.of(this.fieldPath,[this.fieldKey]).flat().join(".");this.prefixedKey=i,this.keyOfType=`${i}_TYPE`,this.fieldType=this.allTypes.get(this.prefixedKey)}}gr.LegacyContentCtx=XF;function Z2e(t,e,n){return new XF(t,[...e.fieldPath,e.fieldKey,...n||[]],e.allTypes)}gr.getFieldCtx=Z2e;function X2e(t,e=new Map){return new XF(t,[],e)}gr.defaultCtx=X2e;var nw={},rw={},AD;function yY(){return AD||(AD=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.BooleanContentDefaultValue=t.BooleanContent=t.BooleanLegacy=t.isBooleanContent=t.BooleanContentType=void 0;const e=G,n=ut,r=Ye,i=(0,e.__importStar)(te),o=jt();t.BooleanContentType="BooleanContent";const a=c=>(0,o.hasContentType)(c)&&c.__TYPE__===t.BooleanContentType;t.isBooleanContent=a;const s=c=>new i.Type("BooleanLegacy",t.isBooleanContent,u=>(0,r.pipe)(i.boolean.decode(u),n.either.map(d=>t.BooleanContent.encode({value:d,__TYPE__:t.BooleanContentType}))),u=>({content:u.value,types:{[c.keyOfType]:"Boolean"}}));t.BooleanLegacy=s,t.BooleanContent=i.strict({__TYPE__:i.literal(t.BooleanContentType),value:i.boolean});const l=c=>{var u;return((u=c.config)===null||u===void 0?void 0:u.default_value)!==void 0?{__TYPE__:t.BooleanContentType,value:c.config.default_value||!1}:void 0};t.BooleanContentDefaultValue=l}(rw)),rw}var iw={},gD;function ej(){return gD||(gD=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.EmbedContent=t.EmbedLegacy=t.EmbedContentLegacy=t.isEmbedContent=t.EmbedContentType=void 0;const e=G,n=ut,r=Ye,i=(0,e.__importStar)(te),o=ht(),a=jt();t.EmbedContentType="EmbedContent";const s=c=>(0,a.hasContentType)(c)&&c.__TYPE__===t.EmbedContentType;t.isEmbedContent=s,t.EmbedContentLegacy=i.exact(i.intersection([i.type({embed_url:i.string,type:i.string}),i.partial({version:i.union([i.string,i.number,i.null]),title:o.StringOrNull,author_name:o.StringOrNull,author_url:o.StringOrNull,provider_name:o.StringOrNull,provider_url:o.StringOrNull,cache_age:i.union([i.string,i.number,i.null]),thumbnail_url:o.StringOrNull,thumbnail_width:o.NumberOrNull,thumbnail_height:o.NumberOrNull,html:o.StringOrNull})]));const l=c=>new i.Type("EmbedLegacy",t.isEmbedContent,u=>(0,r.pipe)(t.EmbedContentLegacy.decode(u),n.either.map(d=>({...d,all:u,__TYPE__:t.EmbedContentType}))),u=>({content:u.all,types:{[c.keyOfType]:"Embed"}}));t.EmbedLegacy=l,t.EmbedContent=i.intersection([t.EmbedContentLegacy,i.strict({__TYPE__:i.literal(t.EmbedContentType),all:i.unknown})])}(iw)),iw}var ow={},aw={},Is={};Object.defineProperty(Is,"__esModule",{value:!0});const ePe=G,tPe=Ts,nPe=Eo,iv=(0,ePe.__importStar)(te);function rPe(t){let e=0;for(;e<t.length&&t[e]<=" ";)e++;let n=t.length;for(;e<n&&t[n-1]<=" ";)n--;return t.substring(e,n)}Is.default=new iv.Type("TrimmedString",iv.string.is,(t,e)=>(0,nPe.pipe)(iv.string.validate(t,e),(0,tPe.chain)(n=>iv.success(rPe(n)))),t=>t);var Hi={};Object.defineProperty(Hi,"__esModule",{value:!0});Hi.FieldContentType=void 0;Hi.FieldContentType="FieldContent";var vD;function yD(){return vD||(vD=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ColorContent=t.ColorLegacy=t.isColorContent=void 0;const e=G,n=ut,r=Ye,i=(0,e.__importStar)(te),o=pa,a=(0,e.__importDefault)(Is),s=jt(),l=Hi,c=d=>(0,s.hasContentType)(d)&&d.__TYPE__===l.FieldContentType&&(0,s.hasFieldContentType)(d)&&d.type==="Color";t.isColorContent=c;const u=d=>new i.Type("ColorLegacy",t.isColorContent,p=>(0,r.pipe)(a.default.decode(p),n.either.map(h=>t.ColorContent.encode({value:h,type:o.ColorFieldType,__TYPE__:l.FieldContentType}))),p=>({content:p.value,types:{[d.keyOfType]:o.ColorFieldType}}));t.ColorLegacy=u,t.ColorContent=i.strict({type:i.literal(o.ColorFieldType),value:a.default,__TYPE__:i.literal(l.FieldContentType)})}(aw)),aw}var sw={},bD;function CD(){return bD||(bD=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.DateContent=t.DateLegacy=t.isDateContent=void 0;const e=G,n=ut,r=Ye,i=(0,e.__importStar)(te),o=pa,a=(0,e.__importDefault)(Is),s=jt(),l=Hi,c=d=>(0,s.hasContentType)(d)&&d.__TYPE__===l.FieldContentType&&(0,s.hasFieldContentType)(d)&&d.type==="Date";t.isDateContent=c;const u=d=>new i.Type("DateLegacy",t.isDateContent,p=>(0,r.pipe)(a.default.decode(p),n.either.map(h=>t.DateContent.encode({value:h,type:o.DateFieldType,__TYPE__:l.FieldContentType}))),p=>({content:p.value,types:{[d.keyOfType]:o.DateFieldType}}));t.DateLegacy=u,t.DateContent=i.strict({type:i.literal(o.DateFieldType),value:a.default,__TYPE__:i.literal(l.FieldContentType)})}(sw)),sw}var lw={},SD;function wD(){return SD||(SD=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.NumberContent=t.NumberLegacy=t.isNumberContent=void 0;const e=G,n=ut,r=Ye,i=(0,e.__importStar)(te),o=pa,a=(0,e.__importDefault)(Is),s=jt(),l=Hi,c=d=>(0,s.hasContentType)(d)&&d.__TYPE__===l.FieldContentType&&(0,s.hasFieldContentType)(d)&&d.type==="Number";t.isNumberContent=c;const u=d=>new i.Type("NumberLegacy",t.isNumberContent,p=>(0,r.pipe)(a.default.decode(p),n.either.map(h=>t.NumberContent.encode({value:h,type:o.NumberFieldType,__TYPE__:l.FieldContentType}))),p=>({content:p.value,types:{[d.keyOfType]:o.NumberFieldType}}));t.NumberLegacy=u,t.NumberContent=i.strict({type:i.literal(o.NumberFieldType),value:a.default,__TYPE__:i.literal(l.FieldContentType)})}(lw)),lw}var cw={},xD;function TD(){return xD||(xD=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.RangeContent=t.RangeLegacy=t.isRangeContent=void 0;const e=G,n=ut,r=Ye,i=(0,e.__importStar)(te),o=pa,a=(0,e.__importDefault)(Is),s=jt(),l=Hi,c=d=>(0,s.hasContentType)(d)&&d.__TYPE__===l.FieldContentType&&(0,s.hasFieldContentType)(d)&&d.type==="Range";t.isRangeContent=c;const u=d=>new i.Type("RangeLegacy",t.isRangeContent,p=>(0,r.pipe)(a.default.decode(p),n.either.map(h=>t.RangeContent.encode({value:h,type:o.RangeFieldType,__TYPE__:l.FieldContentType}))),p=>({content:p.value,types:{[d.keyOfType]:o.RangeFieldType}}));t.RangeLegacy=u,t.RangeContent=i.strict({type:i.literal(o.RangeFieldType),value:a.default,__TYPE__:i.literal(l.FieldContentType)})}(cw)),cw}var uw={},_D;function ID(){return _D||(_D=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.SelectContentDefaultValue=t.SelectContent=t.SelectLegacy=t.isSelectContent=void 0;const e=G,n=ut,r=Ye,i=(0,e.__importStar)(te),o=pa,a=(0,e.__importDefault)(Is),s=jt(),l=Hi,c=p=>(0,s.hasContentType)(p)&&p.__TYPE__===l.FieldContentType&&(0,s.hasFieldContentType)(p)&&p.type==="Select";t.isSelectContent=c;const u=p=>new i.Type("SelectLegacy",t.isSelectContent,h=>(0,r.pipe)(a.default.decode(h),n.either.map(m=>t.SelectContent.encode({value:m,type:o.SelectFieldType,__TYPE__:l.FieldContentType}))),h=>({content:h.value,types:{[p.keyOfType]:o.SelectFieldType}}));t.SelectLegacy=u,t.SelectContent=i.strict({type:i.literal(o.SelectFieldType),value:a.default,__TYPE__:i.literal(l.FieldContentType)});const d=p=>{var h;return!((h=p.config)===null||h===void 0)&&h.default_value?{__TYPE__:l.FieldContentType,type:o.SelectFieldType,value:p.config.default_value||""}:void 0};t.SelectContentDefaultValue=d}(uw)),uw}var dw={},ED;function RD(){return ED||(ED=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.TextContent=t.TextLegacy=t.isTextContent=void 0;const e=G,n=ut,r=Ye,i=(0,e.__importStar)(te),o=pa,a=(0,e.__importDefault)(Is),s=jt(),l=Hi,c=d=>(0,s.hasContentType)(d)&&d.__TYPE__===l.FieldContentType&&(0,s.hasFieldContentType)(d)&&d.type==="Text";t.isTextContent=c;const u=d=>new i.Type("TextLegacy",t.isTextContent,p=>(0,r.pipe)(a.default.decode(p),n.either.map(h=>t.TextContent.encode({value:h,type:o.TextFieldType,__TYPE__:l.FieldContentType}))),p=>({content:p.value,types:{[d.keyOfType]:o.TextFieldType}}));t.TextLegacy=u,t.TextContent=i.strict({type:i.literal(o.TextFieldType),value:a.default,__TYPE__:i.literal(l.FieldContentType)})}(dw)),dw}var fw={},kD;function $D(){return kD||(kD=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.TimestampContent=t.TimestampLegacy=t.isTimestampContent=void 0;const e=G,n=ut,r=Ye,i=(0,e.__importStar)(te),o=pa,a=(0,e.__importDefault)(Is),s=jt(),l=Hi,c=d=>(0,s.hasContentType)(d)&&d.__TYPE__===l.FieldContentType&&(0,s.hasFieldContentType)(d)&&d.type==="Timestamp";t.isTimestampContent=c;const u=d=>new i.Type("TimestampLegacy",t.isTimestampContent,p=>(0,r.pipe)(a.default.decode(p),n.either.map(h=>t.TimestampContent.encode({value:h,type:o.TimestampFieldType,__TYPE__:l.FieldContentType}))),p=>({content:p.value,types:{[d.keyOfType]:o.TimestampFieldType}}));t.TimestampLegacy=u,t.TimestampContent=i.strict({type:i.literal(o.TimestampFieldType),value:a.default,__TYPE__:i.literal(l.FieldContentType)})}(fw)),fw}var OD;function bY(){return OD||(OD=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.FieldContent=t.FieldType=void 0;const e=G,n=(0,e.__importStar)(te),r=yD(),i=CD(),o=wD(),a=TD(),s=ID(),l=RD(),c=$D();t.FieldType=n.keyof({Text:null,Date:null,Timestamp:null,Color:null,Number:null,Range:null,Select:null}),t.FieldContent=n.union([i.DateContent,r.ColorContent,o.NumberContent,a.RangeContent,s.SelectContent,l.TextContent,c.TimestampContent]),(0,e.__exportStar)(yD(),t),(0,e.__exportStar)(Hi,t),(0,e.__exportStar)(CD(),t),(0,e.__exportStar)(wD(),t),(0,e.__exportStar)(TD(),t),(0,e.__exportStar)(ID(),t),(0,e.__exportStar)(RD(),t),(0,e.__exportStar)($D(),t)}(ow)),ow}var pw={},MD;function CY(){return MD||(MD=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.GeoPointContent=t.GeoPointLegacy=t.isGeoPointContent=t.GeoPointContentType=void 0;const e=G,n=ut,r=Eo,i=(0,e.__importStar)(te),o=jt();t.GeoPointContentType="GeoPointContent";const a=c=>(0,o.hasContentType)(c)&&c.__TYPE__===t.GeoPointContentType;t.isGeoPointContent=a;const s=i.strict({position:i.strict({lat:i.number,lng:i.number})}),l=c=>new i.Type("GeoPointLegacy",t.isGeoPointContent,u=>(0,r.pipe)(s.decode(u),n.either.map(d=>t.GeoPointContent.encode({...d,__TYPE__:t.GeoPointContentType}))),u=>({content:{position:u.position},types:{[c.keyOfType]:"GeoPoint"}}));t.GeoPointLegacy=l,t.GeoPointContent=i.intersection([s,i.strict({__TYPE__:i.literal(t.GeoPointContentType)})])}(pw)),pw}var hw={},FD;function tj(){return FD||(FD=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ImageContent=t.ImageLegacy=t.ImageContentView=t.isImageContent=t.ImageContentType=void 0;const e=G,n=ut,r=Ye,i=(0,e.__importStar)(te),o=si,a=ht(),s=jt();t.ImageContentType="ImageContent";const l=p=>(0,s.hasContentType)(p)&&p.__TYPE__===t.ImageContentType;t.isImageContent=l;const c=i.exact(i.type({id:i.string,url:i.string,width:i.number,height:i.number}));t.ImageContentView=i.exact(i.intersection([i.type({origin:c,width:i.number,height:i.number,edit:i.type({zoom:i.number,crop:i.type({x:i.number,y:i.number}),background:i.string})}),i.partial({url:i.string,credits:a.NonEmptyStringOrNull,alt:a.NonEmptyStringOrNull,provider:a.StringOrNull})]));const u=i.intersection([t.ImageContentView,i.partial({thumbnails:i.record(i.string,t.ImageContentView)})]),d=p=>new i.Type("ImageLegacy",t.isImageContent,h=>(0,r.pipe)(u.decode(h),n.either.map(m=>t.ImageContent.encode({...m,__TYPE__:t.ImageContentType}))),h=>({content:(0,o.withOptionals)({edit:h.edit,height:h.height,origin:h.origin,width:h.width},[["alt",h.alt],["credits",h.credits],["provider",h.provider],["thumbnails",h.thumbnails],["url",h.url]]),types:{[p.keyOfType]:"Image"}}));t.ImageLegacy=d,t.ImageContent=i.intersection([u,i.strict({__TYPE__:i.literal(t.ImageContentType)})])}(hw)),hw}var mw={},jD;function SY(){return jD||(jD=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.IntegrationFieldContent=t.IntegrationFieldLegacy=t.isIntegrationFieldContent=t.IntegrationFieldContentType=void 0;const e=G,n=ut,r=Ye,i=(0,e.__importStar)(te),o=jt();t.IntegrationFieldContentType="IntegrationFieldsContent";const a=l=>(0,o.hasContentType)(l)&&l.__TYPE__===t.IntegrationFieldContentType;t.isIntegrationFieldContent=a;const s=l=>new i.Type("IntegrationFieldLegacy",t.isIntegrationFieldContent,c=>(0,r.pipe)(i.string.decode(c),n.either.map(u=>t.IntegrationFieldContent.encode({value:u,__TYPE__:t.IntegrationFieldContentType}))),c=>({content:c.value,types:{[l.keyOfType]:"IntegrationFields"}}));t.IntegrationFieldLegacy=s,t.IntegrationFieldContent=i.strict({__TYPE__:i.literal(t.IntegrationFieldContentType),value:i.string})}(mw)),mw}var Aw={},LD;function UC(){return LD||(LD=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.FilledLinkContent=t.FilledLink=t.FilledLinkContentLegacy=t.FilledLinkLegacy=t.isFilledLinkContent=t.LinkContent=t.Link=t.LinkContentLegacy=t.LinkLegacy=t.isLinkContent=t.LinkContentType=t.AnyLinkContent=t.AnyLinkType=t.ExternalLinkContent=t.FilledExternalLinkContent=t.ExternalLinkType=t.DocumentLinkContent=t.FilledDocumentLinkContent=t.DocumentLinkType=t.MediaLinkContent=t.MediaLinkType=t.FileLinkContent=t.FilledFileLinkContent=t.FileLinkType=t.ImageLinkContent=t.FilledImageLinkContent=t.ImageLinkType=void 0;const e=G,n=ut,r=Ye,i=(0,e.__importStar)(te),o=hC,a=ht(),s=nt,l=jt();t.ImageLinkType="ImageLink";const c=F=>typeof F=="string",u=new i.Type("ImageLinkKind",F=>c(F),(F,V)=>c(F)?i.success("image"):i.failure(F,V),()=>"image"),d=i.intersection([i.strict({kind:u,id:i.string,url:i.string,height:i.string,width:i.string,size:i.string,name:i.string}),i.exact(i.partial({date:a.StringOrNull}))]),p=new i.Type("FilledImageLink",F=>(0,l.hasContentType)(F)&&F.__TYPE__===t.ImageLinkType,F=>(0,r.pipe)(d.decode(F),n.either.map(V=>t.FilledImageLinkContent.encode({...V,__TYPE__:t.ImageLinkType}))),F=>d.encode(F));t.FilledImageLinkContent=i.intersection([i.strict({__TYPE__:i.literal(t.ImageLinkType)}),d]);const h=i.intersection([i.union([d,i.strict({kind:i.literal("image")})]),i.exact(i.partial({text:i.string,variant:i.string}))]),m=new i.Type("ImageLink",F=>(0,l.hasContentType)(F)&&F.__TYPE__===t.ImageLinkType,F=>(0,r.pipe)(h.decode(F),n.either.map(V=>t.ImageLinkContent.encode({...V,__TYPE__:t.ImageLinkType}))),F=>h.encode(F));t.ImageLinkContent=i.intersection([i.strict({__TYPE__:i.literal(t.ImageLinkType)}),h]),t.FileLinkType="FileLink";const g=F=>typeof F=="string",v=new i.Type("FileLinkKind",F=>g(F),(F,V)=>g(F)?i.success("file"):i.failure(F,V),()=>"file"),b=i.exact(i.intersection([i.type({kind:v,id:i.string,url:i.string,name:i.string,size:(0,o.withFallback)(i.string,"0")}),i.partial({date:a.StringOrNull})])),S=new i.Type("FilledFileLink",F=>(0,l.hasContentType)(F)&&F.__TYPE__===t.FileLinkType,F=>(0,r.pipe)(b.decode(F),n.either.map(V=>t.FilledFileLinkContent.encode({...V,__TYPE__:t.FileLinkType}))),F=>b.encode(F));t.FilledFileLinkContent=i.intersection([i.strict({__TYPE__:i.literal(t.FileLinkType)}),b]);const C=i.intersection([i.union([b,i.strict({kind:i.literal("file")})]),i.exact(i.partial({text:i.string,variant:i.string}))]),y=new i.Type("FileLink",F=>(0,l.hasContentType)(F)&&F.__TYPE__===t.FileLinkType,F=>(0,r.pipe)(C.decode(F),n.either.map(V=>t.FileLinkContent.encode({...V,__TYPE__:t.FileLinkType}))),F=>C.encode(F));t.FileLinkContent=i.intersection([i.strict({__TYPE__:i.literal(t.FileLinkType)}),C]),t.MediaLinkType="MediaLink";const x=i.intersection([i.strict({kind:i.literal("media")}),i.exact(i.partial({text:i.string,variant:i.string}))]),w=new i.Type("MediaLink",F=>(0,l.hasContentType)(F)&&F.__TYPE__===t.MediaLinkType,F=>(0,r.pipe)(x.decode(F),n.either.map(V=>t.MediaLinkContent.encode({...V,__TYPE__:t.MediaLinkType}))),F=>x.encode(F));t.MediaLinkContent=i.intersection([i.strict({__TYPE__:i.literal(t.MediaLinkType)}),x]),t.DocumentLinkType="DocumentLink";const _=i.strict({id:a.NonEmptyString}),E=new i.Type("FilledDocumentLink",F=>(0,l.hasContentType)(F)&&F.__TYPE__===t.DocumentLinkType,F=>(0,r.pipe)(_.decode(F),n.either.map(V=>t.FilledDocumentLinkContent.encode({...V,__TYPE__:t.DocumentLinkType}))),F=>_.encode(F));t.FilledDocumentLinkContent=i.intersection([i.strict({__TYPE__:i.literal(t.DocumentLinkType)}),_]);const R=i.intersection([i.union([_,i.strict({kind:i.literal("document")})]),i.exact(i.partial({text:i.string,variant:i.string}))]),O=new i.Type("DocumentLink",F=>(0,l.hasContentType)(F)&&F.__TYPE__===t.DocumentLinkType,F=>(0,r.pipe)(R.decode(F),n.either.map(V=>t.DocumentLinkContent.encode({...V,__TYPE__:t.DocumentLinkType}))),F=>R.encode(F));t.DocumentLinkContent=i.intersection([i.strict({__TYPE__:i.literal(t.DocumentLinkType)}),R]),t.ExternalLinkType="ExternalLink";const $=i.exact(i.intersection([i.type({url:i.string}),i.partial({kind:i.literal("web"),target:a.StringOrNull,preview:(0,s.nullable)(i.partial({title:i.string}))})])),U=new i.Type("FilledExternalLink",F=>(0,l.hasContentType)(F)&&F.__TYPE__===t.ExternalLinkType,F=>(0,r.pipe)($.decode(F),n.either.map(V=>t.FilledExternalLinkContent.encode({...V,__TYPE__:t.ExternalLinkType}))),F=>$.encode(F));t.FilledExternalLinkContent=i.intersection([i.strict({__TYPE__:i.literal(t.ExternalLinkType)}),$]);const q=i.intersection([i.union([$,i.strict({kind:i.literal("web")})]),i.exact(i.partial({text:i.string,variant:i.string}))]),H=new i.Type("ExternalLink",F=>(0,l.hasContentType)(F)&&F.__TYPE__===t.ExternalLinkType,F=>(0,r.pipe)(q.decode(F),n.either.map(V=>t.ExternalLinkContent.encode({...V,__TYPE__:t.ExternalLinkType}))),F=>q.encode(F));t.ExternalLinkContent=i.intersection([i.strict({__TYPE__:i.literal(t.ExternalLinkType)}),q]),t.AnyLinkType="AnyLink";const z=i.exact(i.intersection([i.type({kind:(0,o.withFallback)(i.literal("any"),"any")}),i.partial({text:i.string,variant:i.string})])),K=new i.Type("AnyLink",F=>(0,l.hasContentType)(F)&&F.__TYPE__===t.AnyLinkType,F=>(0,r.pipe)(z.decode(F),n.either.map(V=>t.AnyLinkContent.encode({...V,__TYPE__:t.AnyLinkType}))),F=>z.encode(F));t.AnyLinkContent=i.intersection([i.strict({__TYPE__:i.literal(t.AnyLinkType)}),z]),t.LinkContentType="LinkContent";const Y=F=>(0,l.hasContentType)(F)&&F.__TYPE__===t.LinkContentType;t.isLinkContent=Y,t.LinkLegacy=(0,l.withKey)(i.union([m,y,O,H,w,K]));const ee=F=>new i.Type("LinkLegacy",t.isLinkContent,V=>(0,r.pipe)(t.LinkLegacy.decode(V),n.either.map(({key:pe,...me})=>t.LinkContent.encode({__TYPE__:"LinkContent",key:pe,value:me}))),({key:V,value:pe})=>({content:t.LinkLegacy.encode({...pe,key:V}),types:{[F.keyOfType]:"Link"}}));t.LinkContentLegacy=ee,t.Link=i.union([t.ImageLinkContent,t.FileLinkContent,t.DocumentLinkContent,t.ExternalLinkContent,t.MediaLinkContent,t.AnyLinkContent]),t.LinkContent=(0,l.withKey)(i.strict({__TYPE__:i.literal(t.LinkContentType),value:t.Link}));const L=F=>(0,l.hasContentType)(F)&&F.__TYPE__===t.LinkContentType;t.isFilledLinkContent=L,t.FilledLinkLegacy=i.union([p,S,E,U]);const M=F=>{const V=(0,l.withKey)(t.FilledLinkLegacy);return new i.Type("FilledLinkLegacy",t.isFilledLinkContent,pe=>(0,r.pipe)(V.decode(pe),n.either.map(({key:me,...Me})=>t.FilledLinkContent.encode({__TYPE__:"LinkContent",key:me,value:Me}))),({key:pe,value:me})=>({content:V.encode({...me,key:pe}),types:{[F.keyOfType]:"Link"}}))};t.FilledLinkContentLegacy=M,t.FilledLink=i.union([t.FilledImageLinkContent,t.FilledFileLinkContent,t.FilledDocumentLinkContent,t.FilledExternalLinkContent]),t.FilledLinkContent=(0,l.withKey)(i.strict({__TYPE__:i.literal(t.LinkContentType),value:t.FilledLink}))}(Aw)),Aw}var Gi={},gw={},DD;function wY(){return DD||(DD=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.traverseRepeatableContent=t.RepeatableLegacy=t.isRepeatableContent=t.RepeatableContent=void 0;const e=G,n=ut,r=un,i=Ye,o=(0,e.__importStar)(te),a=jt(),s=UC(),l="RepeatableContent";t.RepeatableContent=o.strict({__TYPE__:o.literal(l),type:o.literal("Link"),value:o.array(s.LinkContent)});const c=p=>(0,a.hasContentType)(p)&&p.__TYPE__===l;t.isRepeatableContent=c;const u=(p,h)=>new o.Type("RepeatableLegacy",t.isRepeatableContent,m=>(0,i.pipe)(o.array(o.unknown).decode(m),n.either.map(v=>({value:v.reduce((S,C)=>{let y;switch(h){case"Link":y=(0,s.LinkContentLegacy)(p).decode(C);break}return!y||(0,r.isLeft)(y)?S:[...S,y.right]},[]),type:h,__TYPE__:"RepeatableContent"}))),m=>({content:o.array(s.LinkContent).encode(m.value).reduce((b,S)=>{let C;switch(S.__TYPE__){case s.LinkContentType:C=(0,s.LinkContentLegacy)(p).encode(S);break}return C?[...b,C]:b},[]).map(b=>b.content),types:{[p.keyOfType]:`Repeatable.${h}`}}));t.RepeatableLegacy=u;function d({path:p,key:h,apiId:m,model:g,content:v}){return b=>{const S=v.value.reduce((C,y,x)=>{const w=p.concat([{key:x.toString(),type:"Widget"}]),_=(g==null?void 0:g.type)==="Link"&&g.config?{...g,config:{...g.config,repeat:!1}}:g,E=b({path:w,key:h,apiId:m,model:_,content:y});return!E||!(0,s.isLinkContent)(E)?C:C.concat(E)},[]);return b({path:p,key:h,apiId:m,model:g,content:{__TYPE__:v.__TYPE__,type:v.type,value:S}})}}t.traverseRepeatableContent=d}(gw)),gw}var vw={},yw={},PD;function BD(){return PD||(PD=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Block=t.BlockLegacy=t.TextBlockLegacy=t.TextBlock=t.checkEmbedBlock=t.EmbedBlock=t.checkImageBlock=t.ImageBlock=t.ValidatedSpans=t.SpanLegacy=t.Span=void 0;const e=G,n=ut,r=un,i=Ye,o=(0,e.__importStar)(te),a=hC,s=bg,l=ht(),c=nt,u=ej(),d=tj(),p=UC(),h=R=>o.strict({data:R,start:o.number,end:o.number,type:o.literal(s.RichTextNodeType.hyperlink)}),m=o.strict({data:(0,a.withFallback)(o.string,""),start:o.number,end:o.number,type:o.literal("label")}),g=o.strict({start:o.number,end:o.number,type:o.keyof({[s.RichTextNodeType.strong]:null,[s.RichTextNodeType.em]:null,"list-item":null})});t.Span=o.union([h(p.FilledLink),m,g]),t.SpanLegacy=o.union([h(p.FilledLinkLegacy),m,g]);const v=R=>new o.Type("ValidatedSpans",O=>Array.isArray(O)&&O.every(R.is),(O,$)=>{if(Array.isArray(O)){const U=O.reduce((q,H)=>{const z=R.decode(H);return(0,r.isLeft)(z)?q:[...q,z.right]},[]).sort((q,H)=>q.start-H.start);return o.success(U)}else return o.failure(O,$)},O=>O.reduce(($,U)=>{const q=R.encode(U);return[...$,q]},[]));t.ValidatedSpans=v;const b=R=>o.exact(o.intersection([o.type({type:o.literal(s.RichTextNodeType.image),data:o.intersection([d.ImageContentView,o.partial({linkTo:(0,c.nullable)(R)})])}),o.partial({label:l.StringOrNull,direction:l.StringOrNull})]));t.ImageBlock=b(p.FilledLink);const S=b(p.FilledLinkLegacy);function C(R){return R.type===s.RichTextNodeType.image}t.checkImageBlock=C;const y=o.exact(o.intersection([o.type({type:o.literal(s.RichTextNodeType.embed),data:o.unknown}),o.partial({label:l.StringOrNull,direction:l.StringOrNull})])),x=new o.Type("EmbedBlockLegacy",R=>R.type==="embed",R=>(0,i.pipe)(y.decode(R),n.either.chain(O=>n.either.map($=>[O,$])(u.EmbedContentLegacy.decode(O.data))),n.either.map(([O,$])=>t.EmbedBlock.encode({...O,data:{...$,__TYPE__:u.EmbedContentType,all:O.data}}))),R=>({...y.encode(R),data:u.EmbedContentLegacy.encode(R.data)}));t.EmbedBlock=o.exact(o.intersection([o.type({type:o.literal(s.RichTextNodeType.embed),data:u.EmbedContent}),o.partial({label:l.StringOrNull,direction:l.StringOrNull})]));function w(R){return R.type===s.RichTextNodeType.embed}t.checkEmbedBlock=w;const _=R=>o.exact(o.intersection([o.type({type:(0,c.refineType)(s.RichTextNodeTypeCodec,`string which isn't ${s.RichTextNodeType.image} ${s.RichTextNodeType.embed}`,O=>O!==s.RichTextNodeType.image&&O!==s.RichTextNodeType.embed),content:o.intersection([o.type({text:o.string}),o.partial({spans:(0,t.ValidatedSpans)(R)})])}),o.partial({label:o.string,direction:o.string})]));t.TextBlock=_(t.Span),t.TextBlockLegacy=_(t.SpanLegacy);const E=o.union([x,S,t.TextBlockLegacy]);t.BlockLegacy=new o.Type("BlockLegacy",R=>x.is(R)||S.is(R)||t.TextBlockLegacy.is(R),R=>E.decode(R),R=>(()=>t.ImageBlock.is(R)?S.encode(R):t.EmbedBlock.is(R)?x.encode(R):t.TextBlockLegacy.encode(R))()),t.Block=o.union([t.ImageBlock,t.EmbedBlock,t.TextBlock])}(yw)),yw}var UD;function nj(){return UD||(UD=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.RichTextLegacy=t.RichTextContent=t.RichTextLegacyContent=t.isRichTextContent=t.RichTextContentType=void 0;const e=G,n=ut,r=Ye,i=(0,e.__importStar)(te),o=jt(),a=BD();t.RichTextContentType="StructuredTextContent";const s=c=>(0,o.hasContentType)(c)&&c.__TYPE__===t.RichTextContentType;t.isRichTextContent=s,t.RichTextLegacyContent=i.array(a.BlockLegacy),t.RichTextContent=i.strict({__TYPE__:i.literal(t.RichTextContentType),value:i.array(a.Block)}),(0,e.__exportStar)(BD(),t);const l=c=>new i.Type("RichTextLegacy",t.isRichTextContent,u=>(0,r.pipe)(t.RichTextLegacyContent.decode(u),n.either.map(d=>({value:d,__TYPE__:t.RichTextContentType}))),u=>({content:t.RichTextLegacyContent.encode(u.value),types:{[c.keyOfType]:"StructuredText"}}));t.RichTextLegacy=l}(vw)),vw}var bw={},ND;function xY(){return ND||(ND=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.SeparatorContent=t.SeparatorLegacy=t.isSeparatorContent=t.SeparatorContentType=void 0;const n=(0,G.__importStar)(te),r=jt();t.SeparatorContentType="SeparatorContent";const i=a=>(0,r.hasContentType)(a)&&a.__TYPE__===t.SeparatorContentType;t.isSeparatorContent=i;const o=a=>new n.Type("SeparatorLegacy",t.isSeparatorContent,()=>n.success(t.SeparatorContent.encode({__TYPE__:t.SeparatorContentType})),()=>({content:{},types:{[a.keyOfType]:"Separator"}}));t.SeparatorLegacy=o,t.SeparatorContent=n.strict({__TYPE__:n.literal(t.SeparatorContentType)})}(bw)),bw}var Cw={},WD;function TY(){return WD||(WD=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.traverseTableContent=t.TableLegacy=t.TableContent=t.isTableContent=t.TableContentType=void 0;const e=G,n=ut,r=Ye,i=(0,e.__importStar)(te),o=fe,a=jt(),s=nj();t.TableContentType="TableContent";const l=v=>(0,a.hasContentType)(v)&&v.__TYPE__===t.TableContentType;t.isTableContent=l;const c=(0,a.withKey)(i.intersection([i.strict({type:i.union([i.literal("tableHeader"),i.literal("tableCell")]),content:s.RichTextContent}),i.exact(i.partial({columnWidth:i.number}))])),u=(0,a.withKey)(i.strict({type:i.literal("tableRow"),content:i.array(c)}));t.TableContent=i.strict({__TYPE__:i.literal(t.TableContentType),content:i.array(u)});const d=(0,a.withKey)(i.intersection([i.strict({type:i.union([i.literal("tableHeader"),i.literal("tableCell")]),content:s.RichTextLegacyContent}),i.exact(i.partial({columnWidth:i.number}))])),p=(0,a.withKey)(i.strict({type:i.literal("tableRow"),content:i.array(d)})),h=i.strict({content:i.array(p)}),m=v=>new i.Type("TableLegacy",t.isTableContent,b=>(0,r.pipe)(h.decode(b),n.either.map(S=>({__TYPE__:"TableContent",content:S.content.map(C=>({...C,content:C.content.map(y=>({...y,content:{__TYPE__:"StructuredTextContent",value:y.content}}))}))}))),b=>({content:h.encode({content:b.content.map(S=>({...S,content:S.content.map(C=>({...C,content:C.content.value}))}))}),types:{[v.keyOfType]:"Table"}}));t.TableLegacy=m;function g({path:v,key:b,apiId:S,model:C,content:y}){return x=>{const w=y.content.map((_,E)=>({..._,content:_.content.map((R,O)=>{const $=v.concat([{key:[E.toString(),O.toString()].join(","),type:"Widget"}]),U=x({path:$,key:b,apiId:S,model:o.TableCell,content:{__TYPE__:R.content.__TYPE__,value:R.content.value}})||{__TYPE__:"StructuredTextContent",value:[]};return{...R,content:U}})}));return x({path:v,key:b,apiId:S,model:C,content:{__TYPE__:y.__TYPE__,content:w}})}}t.traverseTableContent=g}(Cw)),Cw}var KD;function iPe(){if(KD)return Gi;KD=1,Object.defineProperty(Gi,"__esModule",{value:!0}),Gi.NestableLegacy=Gi.isNestableContent=Gi.NestableContentDefaultValue=Gi.NestableContent=void 0;const t=G,e=un,n=(0,t.__importStar)(te),r=vY(),i=yY(),o=ej(),a=bY(),s=Hi,l=CY(),c=tj(),u=SY(),d=UC(),p=wY(),h=nj(),m=xY(),g=TY();Gi.NestableContent=n.union([r.EmptyContent,i.BooleanContent,o.EmbedContent,a.TextContent,a.TimestampContent,a.SelectContent,a.RangeContent,a.NumberContent,a.DateContent,a.ColorContent,l.GeoPointContent,c.ImageContent,u.IntegrationFieldContent,d.LinkContent,h.RichTextContent,m.SeparatorContent,g.TableContent,p.RepeatableContent]);const v=C=>{switch(C.type){case"Boolean":return(0,i.BooleanContentDefaultValue)(C);case"Select":return(0,a.SelectContentDefaultValue)(C);default:return}};Gi.NestableContentDefaultValue=v;const b=C=>(0,a.isTextContent)(C)||(0,a.isColorContent)(C)||(0,a.isDateContent)(C)||(0,a.isTimestampContent)(C)||(0,a.isNumberContent)(C)||(0,a.isRangeContent)(C)||(0,a.isSelectContent)(C)||(0,l.isGeoPointContent)(C)||(0,h.isRichTextContent)(C)||(0,i.isBooleanContent)(C)||(0,o.isEmbedContent)(C)||(0,c.isImageContent)(C)||(0,u.isIntegrationFieldContent)(C)||(0,d.isLinkContent)(C)||(0,m.isSeparatorContent)(C)||(0,g.isTableContent)(C)||(0,r.isEmptyContent)(C)||(0,p.isRepeatableContent)(C);Gi.isNestableContent=b;const S=C=>({decode(y){if(!C.fieldType)return;const x=(0,r.EmptyLegacy)(C.fieldType).decode(y);if((0,e.isRight)(x))return x;const w=(()=>{switch(C.fieldType){case"Text":return(0,a.TextLegacy)(C);case"Color":return(0,a.ColorLegacy)(C);case"Date":return(0,a.DateLegacy)(C);case"Timestamp":return(0,a.TimestampLegacy)(C);case"Number":return(0,a.NumberLegacy)(C);case"Range":return(0,a.RangeLegacy)(C);case"Select":return(0,a.SelectLegacy)(C);case"GeoPoint":return(0,l.GeoPointLegacy)(C);case"StructuredText":return(0,h.RichTextLegacy)(C);case"Boolean":return(0,i.BooleanLegacy)(C);case"Embed":return(0,o.EmbedLegacy)(C);case"Image":return(0,c.ImageLegacy)(C);case"IntegrationFields":return(0,u.IntegrationFieldLegacy)(C);case"Link":return(0,d.LinkContentLegacy)(C);case"Separator":return(0,m.SeparatorLegacy)(C);case"Table":return(0,g.TableLegacy)(C);case"Repeatable.Link":return(0,p.RepeatableLegacy)(C,"Link");default:return}})();if(w)return w.decode(y)},encode(y){switch(y.__TYPE__){case s.FieldContentType:return y.type==="Text"?(0,a.TextLegacy)(C).encode(y):y.type==="Color"?(0,a.ColorLegacy)(C).encode(y):y.type==="Range"?(0,a.RangeLegacy)(C).encode(y):y.type==="Date"?(0,a.DateLegacy)(C).encode(y):y.type==="Number"?(0,a.NumberLegacy)(C).encode(y):y.type==="Timestamp"?(0,a.TimestampLegacy)(C).encode(y):y.type==="Select"?(0,a.SelectLegacy)(C).encode(y):void 0;case l.GeoPointContentType:return(0,l.GeoPointLegacy)(C).encode(y);case h.RichTextContentType:return(0,h.RichTextLegacy)(C).encode(y);case o.EmbedContentType:return(0,o.EmbedLegacy)(C).encode(y);case i.BooleanContentType:return(0,i.BooleanLegacy)(C).encode(y);case c.ImageContentType:return(0,c.ImageLegacy)(C).encode(y);case u.IntegrationFieldContentType:return(0,u.IntegrationFieldLegacy)(C).encode(y);case d.LinkContentType:return(0,d.LinkContentLegacy)(C).encode(y);case m.SeparatorContentType:return(0,m.SeparatorLegacy)(C).encode(y);case g.TableContentType:return(0,g.TableLegacy)(C).encode(y);case"RepeatableContent":return(0,p.RepeatableLegacy)(C,y.type).encode(y);default:return}}});return Gi.NestableLegacy=S,Gi}var qD;function ma(){return qD||(qD=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=G;(0,e.__exportStar)(yY(),t),(0,e.__exportStar)(ej(),t),(0,e.__exportStar)(bY(),t),(0,e.__exportStar)(CY(),t),(0,e.__exportStar)(tj(),t),(0,e.__exportStar)(SY(),t),(0,e.__exportStar)(UC(),t),(0,e.__exportStar)(iPe(),t),(0,e.__exportStar)(wY(),t),(0,e.__exportStar)(nj(),t),(0,e.__exportStar)(xY(),t),(0,e.__exportStar)(TY(),t)}(nw)),nw}var ba={},VD;function NC(){if(VD)return ba;VD=1,Object.defineProperty(ba,"__esModule",{value:!0}),ba.repeatableContentWithDefaultNestableContentValues=ba.withDefaultNestableContentValues=ba.withDefaultSlicePrimaryContentValues=void 0;const t=fe,e=Es(),n=ma();function r(a,s){const l=s;for(const[c,u]of Object.entries(a)){const d=s[c];if(d===void 0){if(u.type===t.GroupFieldType)l[c]=(0,e.groupContentWithDefaultValues)(u,e.GroupContentDefaultValue);else{const p=(0,n.NestableContentDefaultValue)(u);p&&(l[c]=p)}continue}u.type===t.GroupFieldType&&(0,e.isGroupContent)(d)&&(l[c]=(0,e.groupContentWithDefaultValues)(u,d))}return l}ba.withDefaultSlicePrimaryContentValues=r;function i(a,s){return Object.entries(a).reduce((l,[c,u])=>{if(s[c]===void 0){const d=(0,n.NestableContentDefaultValue)(u);return d!==void 0?{...l,[c]:d}:l}return l},s)}ba.withDefaultNestableContentValues=i;function o(a,s){const l=Object.entries(a);return s.map(c=>l.reduce((u,[d,p])=>{var h;const m=c.value.find(([g])=>g===d);if(p.type==="Group"){const g=(0,e.groupContentWithDefaultValues)(p,(h=m==null?void 0:m[1])!==null&&h!==void 0?h:{__TYPE__:e.GroupContentType,value:[]});return{...u,value:[...u.value.filter(([v])=>v!==d),...g?[[d,g]]:[]]}}else if(!m){const g=(0,n.NestableContentDefaultValue)(p);return{...u,value:[...u.value,...g?[[d,g]]:[]]}}return u},c))}return ba.repeatableContentWithDefaultNestableContentValues=o,ba}var zD;function Es(){return zD||(zD=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.traverseGroupItemsContent=t.traverseGroupContent=t.groupContentWithDefaultValues=t.GroupLegacy=t.GroupItemLegacy=t.GroupContentDefaultValue=t.isGroupContent=t.GroupContent=t.GroupItemContent=t.GroupContentType=t.GroupItemContentType=void 0;const e=G,n=ut,r=un,i=Ye,o=(0,e.__importStar)(te),a=fe,s=gr,l=jt(),c=ma(),u=NC();t.GroupItemContentType="GroupItemContent",t.GroupContentType="GroupContentType",t.GroupItemContent=o.recursion("GroupItemContent",()=>o.strict({__TYPE__:o.literal(t.GroupItemContentType),value:o.array(o.tuple([o.string,o.union([c.NestableContent,t.GroupContent])]))})),t.GroupContent=o.recursion("GroupContent",()=>o.strict({__TYPE__:o.literal(t.GroupContentType),value:o.array(t.GroupItemContent)}));const d=S=>(0,l.hasContentType)(S)&&S.__TYPE__===t.GroupContentType;t.isGroupContent=d,t.GroupContentDefaultValue={__TYPE__:t.GroupContentType,value:[]};const p=o.record(o.string,o.unknown),h=S=>new o.Type("GroupItemLegacy",C=>(0,l.hasContentType)(C)&&C.__TYPE__===t.GroupItemContentType,C=>(0,i.pipe)(p.decode(C),n.either.map(x=>({value:Object.entries(x).reduce((_,[E,R])=>{const O=(0,s.getFieldCtx)(E,S),$=O.fieldType===a.GroupFieldType?(0,t.GroupLegacy)(O).decode(R):(0,c.NestableLegacy)(O).decode(R);return!$||(0,r.isLeft)($)?_:[..._,[E,$.right]]},[]),__TYPE__:t.GroupItemContentType}))),C=>C.value.reduce((y,[x,w])=>{const _=(0,s.getFieldCtx)(x,S),E=(0,t.isGroupContent)(w)?(0,t.GroupLegacy)(_).encode(w):(0,c.NestableLegacy)(_).encode(w);return E?{content:{...y.content,[x]:E.content},types:{...y.types,...E.types}}:y},{content:{},types:{}}));t.GroupItemLegacy=h;const m=S=>{const C=o.array(o.union([o.null,(0,t.GroupItemLegacy)(S)])),y=o.array((0,t.GroupItemLegacy)(S));return new o.Type("GroupLegacy",t.isGroupContent,x=>(0,i.pipe)(C.decode(x),n.either.map(w=>({value:w.map(_=>_===null?{__TYPE__:t.GroupItemContentType,value:[]}:_),__TYPE__:t.GroupContentType}))),x=>{const w=y.encode(x.value);return{content:w.map(_=>_.content),types:w.reduce((_,E)=>({..._,...E.types}),{[S.keyOfType]:a.GroupFieldType})}})};t.GroupLegacy=m;function g(S,C){var y;const x=(y=S.config)===null||y===void 0?void 0:y.fields;return x?{...C,value:(0,u.repeatableContentWithDefaultNestableContentValues)(x,C.value)}:C}t.groupContentWithDefaultValues=g;function v({path:S,key:C,apiId:y,model:x,content:w}){return _=>{var E;const R=b({path:S,model:(E=x==null?void 0:x.config)===null||E===void 0?void 0:E.fields,content:w.value})(_);return _({path:S,key:C,apiId:y,model:x,content:{__TYPE__:w.__TYPE__,value:R}})}}t.traverseGroupContent=v;function b({path:S,model:C,content:y}){return x=>y.map((w,_)=>{const E=S.concat([{key:_.toString(),type:"GroupItem"}]),R=w.value.reduce((O,[$,U])=>{const q=C==null?void 0:C[$];let H;return(0,t.isGroupContent)(U)?H=v({path:E.concat([{key:$,type:"Widget"}]),key:$,apiId:$,model:(q==null?void 0:q.type)==="Group"?q:void 0,content:U})(x):(0,c.isRepeatableContent)(U)?H=(0,c.traverseRepeatableContent)({path:E.concat([{key:$,type:"Widget"}]),key:$,apiId:$,model:(q==null?void 0:q.type)==="Link"?q:void 0,content:U})(x):(0,c.isTableContent)(U)?H=(0,c.traverseTableContent)({path:E.concat([{key:$,type:"Widget"}]),key:$,apiId:$,model:(q==null?void 0:q.type)==="Table"?q:void 0,content:U})(x):H=x({path:E.concat([{key:$,type:"Widget"}]),key:$,apiId:$,model:q,content:U}),!H||!((0,c.isNestableContent)(H)||(0,t.isGroupContent)(H))?O:O.concat([[$,H]])},[]);return{__TYPE__:w.__TYPE__,value:R}})}t.traverseGroupItemsContent=b}(ew)),ew}var Sw={},ww={},xw={},sc={},QD;function _Y(){if(QD)return sc;QD=1,Object.defineProperty(sc,"__esModule",{value:!0}),sc.RepeatableWidgets=sc.RepeatableWidgetsLegacy=void 0;const e=(0,G.__importStar)(te),n=Es(),r=ma(),i=s=>e.array((0,n.GroupItemLegacy)(s));sc.RepeatableWidgetsLegacy=i;const o=e.tuple([e.string,e.union([r.NestableContent,n.GroupContent])]),a=e.strict({__TYPE__:e.literal(n.GroupItemContentType),value:e.array(o)});return sc.RepeatableWidgets=e.array(a),sc}var HD;function vy(){return HD||(HD=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.migrateCompositeSlice=t.traverseCompositeSliceContent=t.compositeSliceContentWithDefaultValues=t.CompositeSliceContent=t.CompositeSliceLegacy=t.isCompositeSliceContent=t.CompositeSliceContentType=void 0;const e=G,n=ut,r=un,i=Ye,o=(0,e.__importStar)(te),a=gr,s=jt(),l=Es(),c=ma(),u=NC(),d=_Y();t.CompositeSliceContentType="CompositeSliceContent";const p=S=>(0,s.hasContentType)(S)&&S.__TYPE__===t.CompositeSliceContentType;t.isCompositeSliceContent=p;const h=o.exact(o.partial({repeat:o.array(o.unknown),"non-repeat":o.UnknownRecord})),m=S=>new o.Type("CompositeSliceLegacy",t.isCompositeSliceContent,C=>(0,i.pipe)(h.decode(C),n.either.map(y=>{const x=(()=>{const _=(0,a.getFieldCtx)("repeat",S),E=(0,d.RepeatableWidgetsLegacy)(_).decode(y.repeat);if(!(!E||(0,r.isLeft)(E)))return E.right})()||[];return{nonRepeat:Object.entries(y["non-repeat"]||{}).reduce((_,[E,R])=>{const O=(0,a.getFieldCtx)(E,S,["non-repeat"]);if(!O)return _;const $=(0,c.NestableLegacy)(O).decode(R);return!$||(0,r.isLeft)($)?_:{..._,[E]:$.right}},{}),repeat:x,__TYPE__:t.CompositeSliceContentType}})),C=>{const y=Object.entries(C.nonRepeat).reduce((w,[_,E])=>{const R=(0,a.getFieldCtx)(_,S,["non-repeat"]),O=(0,c.NestableLegacy)(R).encode(E);return O?{content:{...w.content,[_]:O.content},types:{...w.types,...O.types}}:w},{content:{},types:{}}),x=(()=>{const w=(0,a.getFieldCtx)("repeat",S);return(0,d.RepeatableWidgetsLegacy)(w).encode(C.repeat)})()||[];return{content:{"non-repeat":y.content,repeat:x.map(w=>w.content)},types:{[S.keyOfType]:"Slice",...y.types,...x.reduce((w,_)=>({...w,..._.types}),{})}}});t.CompositeSliceLegacy=m,t.CompositeSliceContent=o.strict({__TYPE__:o.literal(t.CompositeSliceContentType),nonRepeat:o.record(o.string,c.NestableContent),repeat:d.RepeatableWidgets});function g(S,C){var y,x;const w=(0,u.withDefaultNestableContentValues)((y=S["non-repeat"])!==null&&y!==void 0?y:{},C.nonRepeat),_=(0,u.repeatableContentWithDefaultNestableContentValues)((x=S.repeat)!==null&&x!==void 0?x:{},C.repeat);return{...C,nonRepeat:w,repeat:_}}t.compositeSliceContentWithDefaultValues=g;function v({path:S,sliceKey:C,sliceName:y,model:x,content:w}){return(_,E)=>{const R=Object.entries(w.widget.nonRepeat).reduce(($,[U,q])=>{const H=(()=>{var K,Y,ee;return(x==null?void 0:x.type)==="SharedSlice"?(Y=(K=x==null?void 0:x.fields)===null||K===void 0?void 0:K.primary)===null||Y===void 0?void 0:Y[U]:(ee=x==null?void 0:x["non-repeat"])===null||ee===void 0?void 0:ee[U]})(),z=_({path:S.concat([{key:"non-repeat",type:"primary"},{key:U,type:"Widget"}]),key:U,apiId:y,model:H,content:q});return z?(0,c.isNestableContent)(z)?{...$,[U]:z}:(console.warn(`Warn: Non nestable content with key [${U}] detected in a composite slice [${y}] with key [${C}]`),$):$},{}),O=(0,l.traverseGroupItemsContent)({path:S.concat([{key:"repeat",type:"items"}]),model:(x==null?void 0:x.type)==="SharedSlice"?x==null?void 0:x.fields.items:x==null?void 0:x.repeat,content:w.widget.repeat})(_);return E({key:C,apiId:y,path:S,model:x,content:{...w,widget:{__TYPE__:"CompositeSliceContent",repeat:O,nonRepeat:R}}})}}t.traverseCompositeSliceContent=v;function b(S,C){const[,y]=C.key.split("$");return{key:`${S.sliceName}$${y}`,name:S.sliceName,maybeLabel:C.maybeLabel,widget:{__TYPE__:"SharedSliceContent",variation:S.variationId,primary:Object.entries(C.widget.nonRepeat).reduce((x,[w,_])=>{var E;return!((E=S.fields.primary)===null||E===void 0)&&E[w]?{...x,[w]:_}:(console.warn(`The widget ${w} in the non-repeat zone of the composite slice [${S.sliceName}] with key [${C.key}] doesn't exist in the model.`),x)},{}),items:C.widget.repeat.map(x=>({__TYPE__:"GroupItemContent",value:x.value.reduce((w,[_,E])=>{var R;return!((R=S.fields.items)===null||R===void 0)&&R[_]?w.concat([[_,E]]):(console.warn(`The widget ${_} in the repeat zone of the composite slice [${S.sliceName}] with key [${C.key}] doesn't exist in the model.`),w)},[])}),[])}}}t.migrateCompositeSlice=b}(xw)),xw}var Tw={},Ca={},YD;function IY(){if(YD)return Ca;YD=1,Object.defineProperty(Ca,"__esModule",{value:!0}),Ca.isSlicePrimaryContent=Ca.SlicePrimaryLegacy=Ca.SlicePrimaryContent=void 0;const e=(0,G.__importStar)(te),n=fe,r=Es(),i=ma();Ca.SlicePrimaryContent=e.union([i.NestableContent,r.GroupContent]);const o=s=>{const l=(0,r.GroupLegacy)(s),c=(0,i.NestableLegacy)(s);return{decode(u){return s.fieldType===n.GroupFieldType?l.decode(u):c.decode(u)},encode(u){return(0,r.isGroupContent)(u)?l.encode(u):c.encode(u)}}};Ca.SlicePrimaryLegacy=o;const a=s=>(0,i.isNestableContent)(s)||(0,r.isGroupContent)(s);return Ca.isSlicePrimaryContent=a,Ca}var GD;function yy(){return GD||(GD=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.traverseSharedSliceContent=t.sharedSliceContentWithDefaultValues=t.SharedSliceContent=t.SharedSliceLegacy=t.isSharedSliceContent=t.SharedSliceContentType=void 0;const e=G,n=ut,r=un,i=Ye,o=(0,e.__importStar)(te),a=hC,s=fe,l=gr,c=jt(),u=Es(),d=ma(),p=NC(),h=_Y(),m=IY();t.SharedSliceContentType="SharedSliceContent";const g=y=>(0,c.hasContentType)(y)&&y.__TYPE__===t.SharedSliceContentType;t.isSharedSliceContent=g;const v=o.exact(o.type({variation:o.string,items:(0,a.withFallback)(o.array(o.unknown),[]),primary:(0,a.withFallback)(o.UnknownRecord,{})})),b=y=>new o.Type("SharedSliceLegacy",t.isSharedSliceContent,x=>(0,i.pipe)(v.decode(x),n.either.map(w=>{const _=(()=>{const R=(0,l.getFieldCtx)("items",y,["variations",w.variation]),O=(0,h.RepeatableWidgetsLegacy)(R).decode(w.items);if(!(!O||(0,r.isLeft)(O)))return O.right})()||[],E=Object.entries(w.primary).reduce((R,[O,$])=>{const U=(0,l.getFieldCtx)(O,y,["variations",w.variation,"primary"]),q=(0,m.SlicePrimaryLegacy)(U).decode($);return!q||(0,r.isLeft)(q)?R:{...R,[O]:q.right}},{});return{variation:w.variation,primary:E,items:_,__TYPE__:t.SharedSliceContentType}})),x=>{const w=Object.entries(x.primary).reduce((E,[R,O])=>{const $=(0,l.getFieldCtx)(R,y,["variations",x.variation,"primary"]),U=(0,m.SlicePrimaryLegacy)($).encode(O);return U?{content:{...E.content,[R]:U.content},types:{...E.types,...U.types}}:E},{content:{},types:{}}),_=(()=>{const E=(0,l.getFieldCtx)("items",y,["variations",x.variation]);return(0,h.RepeatableWidgetsLegacy)(E).encode(x.items)})()||[];return{content:{primary:w.content,items:_.map(E=>E.content),variation:x.variation},types:{[y.keyOfType]:"SharedSlice",...w.types,..._.reduce((E,R)=>({...E,...R.types}),{})}}});t.SharedSliceLegacy=b,t.SharedSliceContent=o.strict({__TYPE__:o.literal(t.SharedSliceContentType),variation:o.string,primary:o.record(o.string,m.SlicePrimaryContent),items:h.RepeatableWidgets});function S(y,x){var w,_;const E=y.variations.find(q=>q.id===x.variation),R=(w=E==null?void 0:E.primary)!==null&&w!==void 0?w:{},O=(_=E==null?void 0:E.items)!==null&&_!==void 0?_:{},$=(0,p.withDefaultSlicePrimaryContentValues)(R,x.primary),U=(0,p.repeatableContentWithDefaultNestableContentValues)(O,x.items);return{...x,primary:$,items:U}}t.sharedSliceContentWithDefaultValues=S;function C({path:y,sliceKey:x,sliceName:w,model:_,content:E}){return(R,O)=>{const $=Object.entries(E.widget.primary).reduce((q,[H,z])=>{var K,Y;const ee=(Y=(K=_==null?void 0:_.fields)===null||K===void 0?void 0:K.primary)===null||Y===void 0?void 0:Y[H],L=(()=>(0,u.isGroupContent)(z)?(0,u.traverseGroupContent)({path:y.concat([{key:"primary",type:"primary"},{key:H,type:"Widget"}]),key:H,apiId:H,content:z,model:(ee==null?void 0:ee.type)===s.GroupFieldType?ee:void 0})(R):(0,d.isRepeatableContent)(z)?(0,d.traverseRepeatableContent)({path:y.concat([{key:"primary",type:"primary"},{key:H,type:"Widget"}]),key:H,apiId:H,content:z,model:(ee==null?void 0:ee.type)==="Link"?ee:void 0})(R):(0,d.isTableContent)(z)?(0,d.traverseTableContent)({path:y.concat([{key:"primary",type:"primary"},{key:H,type:"Widget"}]),key:H,apiId:H,content:z,model:(ee==null?void 0:ee.type)==="Table"?ee:void 0})(R):(0,d.isNestableContent)(z)?R({path:y.concat([{key:"primary",type:"primary"},{key:H,type:"Widget"}]),key:H,apiId:H,model:ee,content:z}):void 0)();return L?((0,m.isSlicePrimaryContent)(L)||console.warn(`Warn: Non nestable or group content with key [${H}] detected in a shared slice [${w}] with key [${x}]`),{...q,[H]:L}):q},{}),U=(0,u.traverseGroupItemsContent)({path:y.concat([{key:"items",type:"items"}]),model:_==null?void 0:_.fields.items,content:E.widget.items})(R);return O({key:x,apiId:w,path:y,model:_,content:{...E,widget:{__TYPE__:"SharedSliceContent",variation:E.widget.variation,primary:$,items:U}}})}}t.traverseSharedSliceContent=C}(Tw)),Tw}var ii={},JD;function by(){if(JD)return ii;JD=1,Object.defineProperty(ii,"__esModule",{value:!0}),ii.migrateSimpleSlice=ii.traverseSimpleSliceContent=ii.SimpleSliceLegacy=ii.isSimpleSliceContent=ii.SimpleSliceContent=void 0;const e=(0,G.__importStar)(te),n=Es(),r=ma();ii.SimpleSliceContent=e.union([r.NestableContent,n.GroupContent]);const i=l=>(0,r.isNestableContent)(l)||(0,n.isGroupContent)(l);ii.isSimpleSliceContent=i;const o=l=>({decode:(()=>l.fieldType==="Group"?(0,n.GroupLegacy)(l).decode.bind(null):(0,r.NestableLegacy)(l).decode.bind(null))(),encode:c=>{switch(c.__TYPE__){case"GroupContentType":return(0,n.GroupLegacy)(l).encode(c);default:return(0,r.NestableLegacy)(l).encode(c)}}});ii.SimpleSliceLegacy=o;function a({path:l,sliceKey:c,sliceName:u,model:d,content:p}){return(h,m)=>{if((0,n.isGroupContent)(p.widget)){const v=(0,n.traverseGroupContent)({path:l,key:p.key,apiId:p.name,model:(()=>{if((d==null?void 0:d.type)==="Group")return d;if((d==null?void 0:d.type)==="SharedSlice")return{type:"Group",config:{fields:d.fields.items||{}}}})(),content:p.widget})(h);return v&&m({key:p.key,apiId:p.name,path:l,model:d,content:{...p,widget:v}})}const g=h({key:p.key,apiId:p.name,path:l,model:(()=>{var v;if((d==null?void 0:d.type)==="SharedSlice")return(v=d.fields.primary)===null||v===void 0?void 0:v[p.name];if((d==null?void 0:d.type)!=="Group")return d})(),content:p.widget});return g&&m({key:c,apiId:u,path:l,model:d,content:{...p,widget:g}})}}ii.traverseSimpleSliceContent=a;function s(l,c){var u;const[,d]=c.key.split("$"),p=`${l.sliceName}$${d}`;return c.widget.__TYPE__==="GroupContentType"?{key:p,name:l.sliceName,maybeLabel:c.maybeLabel,widget:{__TYPE__:"SharedSliceContent",variation:l.variationId,primary:{},items:c.widget.value.map(h=>({__TYPE__:"GroupItemContent",value:h.value.reduce((m,[g,v])=>{var b;return!((b=l.fields.items)===null||b===void 0)&&b[g]?m.concat([[g,v]]):m},[])}),[])}}:{key:p,name:l.sliceName,maybeLabel:c.maybeLabel,widget:{__TYPE__:"SharedSliceContent",variation:l.variationId,primary:!((u=l.fields.primary)===null||u===void 0)&&u[c.name]?{[c.name]:c.widget}:{},items:[]}}}return ii.migrateSimpleSlice=s,ii}var ZD;function EY(){return ZD||(ZD=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.SliceContent=t.SliceLegacy=void 0;const e=G,n=(0,e.__importStar)(te),r=vy(),i=yy(),o=by(),a=s=>({decode:l=>(()=>{switch(s.fieldType){case"Slice":return(0,r.CompositeSliceLegacy)(s);case"SharedSlice":return(0,i.SharedSliceLegacy)(s);default:return(0,o.SimpleSliceLegacy)(s)}})().decode(l),encode:l=>{switch(l.__TYPE__){case"SharedSliceContent":return(0,i.SharedSliceLegacy)(s).encode(l);case"CompositeSliceContent":return(0,r.CompositeSliceLegacy)(s).encode(l);default:return(0,o.SimpleSliceLegacy)(s).encode(l)}}});t.SliceLegacy=a,t.SliceContent=n.union([r.CompositeSliceContent,i.SharedSliceContent,o.SimpleSliceContent]),(0,e.__exportStar)(vy(),t),(0,e.__exportStar)(yy(),t),(0,e.__exportStar)(by(),t),(0,e.__exportStar)(IY(),t)}(ww)),ww}var En={},XD;function RY(){if(XD)return En;XD=1,Object.defineProperty(En,"__esModule",{value:!0}),En.migrateSliceItem=En.SlicesItemLegacy=En.sliceItemContentWithDefaultValues=En.isSimpleSliceItemContent=En.isCompositeSliceItemContent=En.isSharedSliceItemContent=En.SliceItemContent=void 0;const t=G,e=ut,n=un,r=Ye,i=(0,t.__importStar)(te),o=nt,a=gr,s=Es(),l=ma(),c=NC(),u=EY(),d=vy(),p=yy(),h=by();En.SliceItemContent=i.type({key:i.string,name:i.string,maybeLabel:i.union([i.string,i.undefined]),widget:u.SliceContent});function m(x){return(0,p.isSharedSliceContent)(x.widget)}En.isSharedSliceItemContent=m;function g(x){return(0,d.isCompositeSliceContent)(x.widget)}En.isCompositeSliceItemContent=g;function v(x){return(0,s.isGroupContent)(x.widget)||(0,l.isNestableContent)(x.widget)}En.isSimpleSliceItemContent=v;function b(x,w){var _;if(x.type==="SharedSlice"&&(0,p.isSharedSliceContent)(w))return(0,u.sharedSliceContentWithDefaultValues)(x,w);if(x.type==="Slice"&&(0,d.isCompositeSliceContent)(w))return(0,u.compositeSliceContentWithDefaultValues)(x,w);if(x.type==="Group"&&(0,s.isGroupContent)(w)&&(!((_=x.config)===null||_===void 0)&&_.fields)){const E=(0,c.repeatableContentWithDefaultNestableContentValues)(x.config.fields,w.value);return{...w,value:E}}return w}En.sliceItemContentWithDefaultValues=b;const S=i.exact(i.intersection([i.type({key:i.string,value:i.unknown}),i.partial({label:(0,o.nullable)(i.string)})])),C=x=>new i.Type("SlicesItemLegacy",w=>((0,p.isSharedSliceContent)(w.widget),(0,d.isCompositeSliceContent)(w.widget),(0,h.isSimpleSliceContent)(w.widget)),(w,_)=>(0,r.pipe)(S.decode(w),e.either.chain(E=>{var R;const O=E.key.indexOf("$"),$=E.key.substring(0,O>0?O:void 0),U=(0,a.getFieldCtx)($,x),q=(0,u.SliceLegacy)(U).decode(E.value);return!q||(0,n.isLeft)(q)?i.failure(w,_):i.success({key:E.key,name:$,maybeLabel:(R=E.label)!==null&&R!==void 0?R:void 0,widget:q.right})})),w=>{const _=(0,a.getFieldCtx)(w.name,x),E=(0,u.SliceLegacy)(_).encode(w.widget);return{content:{key:w.key,label:w.maybeLabel,value:(E==null?void 0:E.content)||{}},types:(E==null?void 0:E.types)||{}}});En.SlicesItemLegacy=C;const y=({model:x,content:w})=>g(w)&&(x==null?void 0:x.type)==="SharedSlice"?(0,d.migrateCompositeSlice)(x,w):v(w)&&(x==null?void 0:x.type)==="SharedSlice"?(0,h.migrateSimpleSlice)(x,w):w;return En.migrateSliceItem=y,En}var _w={},e2;function oPe(){return e2||(e2=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.traverseSlices=t.slicesContentWithDefaultValues=t.SlicesContent=t.SlicesLegacy=t.isSlicesContent=t.SlicesContentType=void 0;const e=G,n=ut,r=Ye,i=(0,e.__importStar)(te),o=Eg,a=fe,s=jt(),l=vy(),c=yy(),u=by(),d=RY();t.SlicesContentType="SliceContentType";const p=b=>(0,s.hasContentType)(b)&&b.__TYPE__===t.SlicesContentType;t.isSlicesContent=p;const h=b=>{const S=i.array((0,d.SlicesItemLegacy)(b));return new i.Type("SlicesLegacy",t.isSlicesContent,C=>(0,r.pipe)(S.decode(C),n.either.map(y=>({__TYPE__:t.SlicesContentType,value:y}))),C=>{const y=S.encode(C.value);return{content:y.map(x=>x.content),types:y.reduce((x,w)=>({...x,...w.types}),{[b.keyOfType]:"Slices"})}})};t.SlicesLegacy=h,t.SlicesContent=i.type({__TYPE__:i.literal(t.SlicesContentType),value:i.array(d.SliceItemContent)});function m(b,S){var C;const y=(C=b==null?void 0:b.config)===null||C===void 0?void 0:C.choices;if(y===void 0)return S;const x=S.value.map(w=>{const _=y[w.name];if(_){const E=(0,d.sliceItemContentWithDefaultValues)(_,w.widget);return{...w,widget:E}}return w});return{...S,value:x}}t.slicesContentWithDefaultValues=m;function g(b,S,C){var y,x;const w=(x=(y=S==null?void 0:S.config)===null||y===void 0?void 0:y.choices)===null||x===void 0?void 0:x[C.name],_=()=>{if((0,d.isSharedSliceItemContent)(C)&&w&&(0,a.isStaticSharedSlice)(w)){const O=w.variations.find($=>$.id===C.widget.variation);return O?{type:"SharedSlice",sliceName:w.id,variationId:O.id,fields:{primary:O.primary||{},items:O.items||{}}}:void 0}},E=()=>{var O;const $=o.ContentPath.append(o.ContentPath.serialize(b),C.name),U=Object.values(((O=S==null?void 0:S.config)===null||O===void 0?void 0:O.choices)||{}).find(H=>{var z;return(0,a.isStaticSharedSlice)(H)?!!(!((z=H.legacyPaths)===null||z===void 0)&&z[$]):!1});if(!U)return;const q=U==null?void 0:U.variations.find(H=>{var z;return H.id===((z=U.legacyPaths)===null||z===void 0?void 0:z[$])});if(q)return{type:"SharedSlice",sliceName:U.id,variationId:q.id,fields:{primary:q.primary||{},items:q.items||{}}}},R=()=>{if(w){if((0,a.isCompositeSlice)(w))return{type:"Slice","non-repeat":w["non-repeat"]||{},repeat:w.repeat||{}};if((0,a.isLegacySlice)(w))return w}};return _()||E()||R()}function v({path:b,key:S,model:C,content:y}){return({transformWidget:x=({content:_})=>_,transformSlice:w=({content:_})=>_})=>{const _=y.value.reduce((E,R)=>{const O=C&&g(b,C,R),$=(()=>{if((0,d.isSharedSliceItemContent)(R))return(0,c.traverseSharedSliceContent)({path:b.concat({key:R.key,type:"SharedSlice"}),sliceKey:R.key,sliceName:R.name,model:(O==null?void 0:O.type)==="SharedSlice"?O:void 0,content:R})(x,w);if((0,d.isCompositeSliceItemContent)(R))return(0,l.traverseCompositeSliceContent)({path:b.concat({key:R.key,type:"Slice"}),sliceKey:R.key,sliceName:R.name,model:(O==null?void 0:O.type)==="Slice"||(O==null?void 0:O.type)==="SharedSlice"?O:void 0,content:R})(x,w);if((0,d.isSimpleSliceItemContent)(R))return(0,u.traverseSimpleSliceContent)({path:b.concat({key:R.key,type:"LegacySlice"}),sliceKey:R.key,sliceName:R.name,model:O&&(O==null?void 0:O.type)!=="Slice"?O:void 0,content:R})(x,w)})();return $?E.concat($):E},[]);return x({path:b,key:S,apiId:S,model:C,content:{__TYPE__:y.__TYPE__,value:_}})}}t.traverseSlices=v}(_w)),_w}var t2;function kY(){return t2||(t2=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=G;(0,e.__exportStar)(EY(),t),(0,e.__exportStar)(RY(),t),(0,e.__exportStar)(oPe(),t)}(Sw)),Sw}var Iw={},n2;function $Y(){return n2||(n2=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.UIDContent=t.UIDLegacy=t.isUIDContent=t.UIDContentType=void 0;const e=G,n=ut,r=Ye,i=(0,e.__importStar)(te),o=jt();t.UIDContentType="UIDContent";const a=l=>(0,o.hasContentType)(l)&&l.__TYPE__===t.UIDContentType;t.isUIDContent=a;const s=l=>new i.Type("UIDLegacy",t.isUIDContent,c=>(0,r.pipe)(i.string.decode(c),n.either.map(u=>t.UIDContent.encode({value:u,__TYPE__:t.UIDContentType}))),c=>({content:c.value,types:{[l.keyOfType]:"UID"}}));t.UIDLegacy=s,t.UIDContent=i.type({__TYPE__:i.literal(t.UIDContentType),value:i.string})}(Iw)),Iw}var Sa={},r2;function aPe(){if(r2)return Sa;r2=1,Object.defineProperty(Sa,"__esModule",{value:!0}),Sa.WidgetLegacy=Sa.isWidgetContent=Sa.WidgetContent=void 0;const e=(0,G.__importStar)(te),n=Es(),r=ma(),i=kY(),o=$Y();Sa.WidgetContent=e.union([n.GroupContent,r.NestableContent,o.UIDContent,i.SlicesContent]);const a=l=>(0,n.isGroupContent)(l)||(0,r.isNestableContent)(l)||(0,o.isUIDContent)(l)||(0,i.isSlicesContent)(l);Sa.isWidgetContent=a;const s=l=>({decode(c){if(!l.fieldType)return;const u=(()=>{switch(l.fieldType){case"UID":return(0,o.UIDLegacy)(l);case"Group":return(0,n.GroupLegacy)(l);case"Choice":case"Slices":return(0,i.SlicesLegacy)(l);default:return(0,r.NestableLegacy)(l)}})();if(u)return u.decode(c)},encode(c){switch(c.__TYPE__){case o.UIDContentType:return(0,o.UIDLegacy)(l).encode(c);case n.GroupContentType:return(0,n.GroupLegacy)(l).encode(c);case i.SlicesContentType:return(0,i.SlicesLegacy)(l).encode(c);default:return(0,r.NestableLegacy)(l).encode(c)}}});return Sa.WidgetLegacy=s,Sa}var i2;function rj(){return i2||(i2=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=G;(0,e.__exportStar)(vY(),t),(0,e.__exportStar)(Es(),t),(0,e.__exportStar)(ma(),t),(0,e.__exportStar)(kY(),t),(0,e.__exportStar)($Y(),t),(0,e.__exportStar)(aPe(),t)}(HS)),HS}Object.defineProperty(Pr,"__esModule",{value:!0});Pr.migrateDocument=Pr.collectWidgets=Pr.traverseDocument=Pr.fillDocumentWithDefaultValues=Pr.DocumentLegacy=Pr.Document=void 0;const sPe=G,OY=ut,ij=un,MY=Ye,tf=(0,sPe.__importStar)(te),FY=Eg,oj=nd,nf=fe,li=rj(),iT=gr;Pr.Document=tf.record(oj.WidgetKey,li.WidgetContent);const lPe=tf.record(oj.WidgetKey,tf.unknown),aj=t=>new tf.Type("Document",e=>!!e&&typeof e=="object",e=>(0,MY.pipe)(lPe.decode(e),OY.either.map(n=>Object.entries(n).reduce((r,[i,o])=>{const a=(0,iT.defaultCtx)(i,t),s=(0,li.WidgetLegacy)(a).decode(o);return!s||(0,ij.isLeft)(s)?r:{...r,[i]:s.right}},{}))),e=>Object.entries(e).reduce((n,[r,i])=>{const o=(0,iT.defaultCtx)(r,t),a=(0,li.WidgetLegacy)(o).encode(i);return a?{content:{...n.content,[r]:a.content},types:{...n.types,...a.types}}:n},{content:{},types:{}}));function jY(t){const e=Object.entries(t),{types:n,widgets:r}=e.reduce((a,[s,l])=>{if(s.endsWith("_TYPE")){const c=iT.FieldOrSliceType.decode(l);if((0,ij.isRight)(c))return{...a,types:a.types.set(s.substring(0,s.length-5),c.right)}}return!s.endsWith("_POSITION")&&!s.endsWith("_TYPE")?{...a,widgets:{...a.widgets,[s]:l}}:a},{types:new Map,widgets:{}}),i=t.slugs_INTERNAL||[],o=t.uid;return{widgets:r,types:n,uid:o,slugs:i}}function cPe(t,e){const n=(0,MY.pipe)(tf.record(oj.WidgetKey,tf.unknown).decode(t),OY.either.chain(r=>{const{types:i,widgets:o}=jY(r);return aj(i).decode(o)}));return(0,ij.isLeft)(n)?void 0:LY(n.right,e)}function uPe(t){const e=aj().encode(t);return{...e.content,...e.types}}Pr.DocumentLegacy={_codec:aj,extractMetadata:jY,parse:cPe,encode:uPe};function sj(t){return{customTypeId:t==null?void 0:t.id,fields:Object.fromEntries((0,nf.flattenSections)(t))}}function dPe(t,e){const{fields:n}=t&&nf.StaticCustomType.is(t)?sj(t):t;return Object.entries(n).reduce((r,[i,o])=>{const a=e[i],s=(()=>{switch(o.type){case"Group":return(0,li.isGroupContent)(a)?(0,li.groupContentWithDefaultValues)(o,a):a;case"Choice":case"Slices":return(0,li.isSlicesContent)(a)?(0,li.slicesContentWithDefaultValues)(o,a):a;default:return a===void 0&&nf.NestableWidget.is(o)?(0,li.NestableContentDefaultValue)(o):a}})();return s?{...r,[i]:s}:r},e)}Pr.fillDocumentWithDefaultValues=dPe;function lj({document:t,customType:e}){const n=e&&nf.StaticCustomType.is(e)?sj(e):e;return({transformWidget:r=({content:o})=>o,transformSlice:i=({content:o})=>o})=>{const o=n&&Object.entries(n.fields).reduce((a,[s,l])=>({...a,[s]:l}),{});return Object.entries(t).reduce((a,[s,l])=>{const c=o&&o[s],u=FY.ContentPath.make([{key:n==null?void 0:n.customTypeId,type:"CustomType"},{key:s,type:"Widget"}]),d=(()=>{switch(l.__TYPE__){case"SliceContentType":return(0,li.traverseSlices)({path:u,key:s,model:(c==null?void 0:c.type)==="Slices"||(c==null?void 0:c.type)==="Choice"?c:void 0,content:l})({transformWidget:r,transformSlice:i});case"GroupContentType":return(0,li.traverseGroupContent)({path:u,key:s,apiId:s,model:(c==null?void 0:c.type)==="Group"?c:void 0,content:l})(r);case"RepeatableContent":return(0,li.traverseRepeatableContent)({path:u,key:s,apiId:s,model:(c==null?void 0:c.type)==="Link"?c:void 0,content:l})(r);case"TableContent":return(0,li.traverseTableContent)({path:u,key:s,apiId:s,model:(c==null?void 0:c.type)==="Table"?c:void 0,content:l})(r);default:return r({path:u,key:s,apiId:s,model:(c==null?void 0:c.type)!=="Group"&&(c==null?void 0:c.type)!=="Slices"&&(c==null?void 0:c.type)!=="Choice"?c:void 0,content:l})}})();return{...a,...d?{[s]:d}:{}}},{})}}Pr.traverseDocument=lj;function fPe(t,e){const n={};return lj({document:t})({transformWidget:({content:r,path:i})=>{const o=FY.ContentPath.serialize(i);return e(r,i)&&(n[o]=r),r}}),n}Pr.collectWidgets=fPe;function LY(t,e){const n=nf.StaticCustomType.is(e)?sj(e):e;return Object.values((0,nf.collectSharedSlices)(n)).some(i=>!!i.legacyPaths)?lj({document:t,customType:e})({transformSlice:li.migrateSliceItem}):t}Pr.migrateDocument=LY;(function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=G;(0,e.__exportStar)(Pr,t),(0,e.__exportStar)(rj(),t),(0,e.__exportStar)(gr,t)})(ue);function DY(t){if(ue.isRepeatableContent(t))return t;if(ue.isLinkContent(t))return{__TYPE__:"RepeatableContent",type:"Link",value:[t]}}function PY(t){if(ue.isLinkContent(t))return t;if(ue.isRepeatableContent(t)){const[e]=t.value;if(ue.isLinkContent(e))return e}}function pPe(t,e){let n=t;return n=APe(n,e),n=hPe(n,e),n=mPe(n,e),n=gPe(n,e),n}function hPe(t,e){return fe.flattenSections(e).reduce((r,[i,o])=>!t[i]&&o.type==="Group"?{...r,[i]:BY}:r,t)}function mPe(t,e){return ue.traverseDocument({document:t,customType:e})({transformWidget({model:n,content:r}){return n?r:void 0},transformSlice(n){return n.model?n.content:void 0}})}function APe(t,e){return ue.traverseDocument({document:t,customType:e})({transformWidget({model:n,content:r}){if((n==null?void 0:n.type)==="Link"){const{repeat:i}=n.config??{};switch(r.__TYPE__){case"LinkContent":return i?DY(r)??r:r;case"RepeatableContent":return i?r:PY(r)??r;default:return r}}return r}})}function gPe(t,e){return ue.fillDocumentWithDefaultValues(e,t)}const BY={__TYPE__:"GroupContentType",value:[{__TYPE__:"GroupItemContent",value:[]}]},UY={unclassified:{title:"Draft",color:"amber"},published:{title:"Live",color:"green"},release:{title:"Planned",color:"purple"},archived:{title:"Archived",color:"grey"}},oT={unclassified:["unclassified","published"],archived:["unclassified","published"],release:["release","published"],published:["published","unclassified"]};function cj(t){const{documentId:e,versionId:n,baseUrl:r,status:i,releaseId:o}=t,a={s:i,v:n,r:o},s=pi.createRouteParams({params:a}),l=new URLSearchParams(s).toString();return new URL(`pages/${e}?${l}`,r)}function vPe(t){const{children:e,...n}=t;return f.jsx(sr.QueryErrorResetBoundary,{children:({reset:r})=>f.jsx(A.ErrorBoundary,{...n,onReset:r,children:e})})}const NY=I.createContext(void 0),yPe={selectedIds:new Set,excludedIds:new Set,isAllSelected:!1};function WY(t){const{children:e,initialState:n,initialTotalItemCount:r,isSelectAllEnabled:i=!1}=t,o=I.useRef(),a=I.useRef(r||0);function s(){if(n&&n.selectedIds){const _=[...n.selectedIds].pop();_&&(o.current=_)}return{...yPe,...n}}const[l,c]=I.useState(s),u=I.useMemo(()=>{const{selectedIds:_,excludedIds:E,isAllSelected:R}=l;return R?a.current-E.size:_.size},[l]),d=I.useCallback(_=>{const{isAllSelected:E,selectedIds:R,excludedIds:O}=l;return E?!O.has(_):R.has(_)},[l]),p=I.useCallback(()=>{const{isAllSelected:_,selectedIds:E,excludedIds:R}=l;return{selectedIds:[...E],excludedIds:[...R],isAllSelected:_,selectedCount:u}},[l,u]),h=qe.useStableCallback(()=>{i&&c({isAllSelected:!0,selectedIds:new Set,excludedIds:new Set})}),m=qe.useStableCallback(()=>{c({isAllSelected:!1,selectedIds:new Set,excludedIds:new Set})});I.useEffect(()=>{const{isAllSelected:_,selectedIds:E,excludedIds:R}=l,O=a.current;if(!(O===0||!i)){if(_&&R.size===O){m();return}if(!_&&E.size===O){h();return}}},[l,i,h,m]);const g=qe.useStableCallback(_=>{const{id:E,isSingleSelection:R,metaKey:O,shiftKey:$,ids:U}=_;return $&&U&&U.length>0&&o.current?b(E,U,o.current):R&&!O?v(E):d(E)?y([E]):C([E]),o.current=E,d(E)});function v(_){d(_)&&u===1?c(E=>({...E,selectedIds:new Set})):c({isAllSelected:!1,selectedIds:new Set([_]),excludedIds:new Set})}function b(_,E,R){const O=bPe(E,R,_),$=d(_);return $?y(O):C(O),$}const S=qe.useStableCallback(()=>{u>0?m():h()});function C(_){const{isAllSelected:E}=l;if(E){c(R=>({...R,excludedIds:o2(R.excludedIds,_)}));return}c(R=>({...R,selectedIds:a2(R.selectedIds,_)}))}function y(_){const{isAllSelected:E}=l;if(E){c(R=>({...R,excludedIds:a2(R.excludedIds,_)}));return}c(R=>({...R,selectedIds:o2(R.selectedIds,_)}))}function x(_){a.current=_}const w=I.useMemo(()=>({selectedCount:u,state:l,totalItemCount:a.current,isSelected:d,isSelectAllEnabled:i,getSelectionState:p,toggleSelection:g,toggleSelectAll:S,clearSelection:m,setTotalItemCount:x}),[l,m,p,i,d,u,S,g]);return f.jsx(NY.Provider,{value:w,children:e})}function Gl(t){const e=I.useContext(NY);if(e===void 0)throw new Error("useSelectionManagerContext must be used within a SelectionManagerProvider");const{totalItemCount:n,onChangeSelection:r}=t||{},{setTotalItemCount:i,totalItemCount:o,state:a,getSelectionState:s,...l}=e;n!==void 0&&n!==o&&i(n);const c=qe.useStableCallback(r);return I.useEffect(()=>{c==null||c(s())},[s,c,a]),{...l,getSelectionState:s,isAllSelected:a.isAllSelected}}function bPe(t,e,n){const r=t.indexOf(e),i=t.indexOf(n);if(i===-1)throw new Error("targetId must be in the array");return r===-1?[n]:r<=i?t.slice(r,i+1):t.slice(i,r+1)}function o2(t,e){const n=new Set(t);return e.forEach(r=>n.delete(r)),n}function a2(t,e){return new Set([...t,...e])}const Aa="meta_title",Rs="meta_description",CPe=k.object({[Aa]:k.string(),[Rs]:k.string()});async function KY(t,e,n,r){const i=new URL("generate-seo-metadata",e);return i.searchParams.set("repository",t),oe.request(i,{credentials:oe.getRequestCredentials(n),okType:CPe,method:"POST",body:r})}const pm={min:50,max:60},hm={min:120,max:165};function qY(t,e){const n=[];return ue.traverseDocument({document:t,customType:e})({transformWidget:({content:i,model:o,apiId:a})=>{var s;if(!(a===Aa||a===Rs)&&(ue.isRichTextContent(i)&&(o==null?void 0:o.type)==="StructuredText"||ue.isTextContent(i)&&(o==null?void 0:o.type)==="Text"||ue.isUIDContent(i)&&(o==null?void 0:o.type)==="UID")){const l=Cy(i);l&&n.push({label:((s=o.config)==null?void 0:s.label)||"",value:l})}}}),n.map(i=>JSON.stringify(i)).join(`
67
67
  `)}function Cy(t){if(ue.isWidgetContent(t)){if(t.__TYPE__==="UIDContent")return t.value;if(t.__TYPE__==="StructuredTextContent"){const[e]=t.value;return!e||e.type==="image"||e.type==="embed"?void 0:e.content.text}if(t.__TYPE__==="FieldContent"&&t.type==="Text")return t.value}}function VY(t){return t.length>=300}const SPe=k.object({id:k.string().optional(),first_name:k.string().optional(),last_name:k.string().optional(),email:k.string().optional(),uploadedAvatar:k.string().optional()}),uj=k.object({id:k.string(),name:k.string(),is_master:k.boolean().optional()}).transform(t=>({id:t.id,label:t.name,...t.is_master!==void 0?{isMaster:t.is_master}:{}})),zY=k.discriminatedUnion("status",[k.object({status:k.literal("unclassified")}),k.object({status:k.literal("published")}),k.object({status:k.literal("release"),release_id:k.string()}),k.object({status:k.literal("archived")})]),QY=k.object({version_id:k.string(),tags:k.array(k.string()),preview_image:k.string().optional(),last_modified_date:k.coerce.date(),uid:k.string().optional()}),HY=zY.and(QY.extend({custom_type_label:k.string(),preview_summary:k.string().optional(),author:SPe})),YY=zY.and(QY.extend({custom_type_id:k.string().optional(),summary:k.string().optional(),author_ids:k.array(k.string()).optional(),highlights:k.object({uid:k.string().optional()}).optional()}));function GY(t){return HY.safeParse(t).success}function aT(t){return YY.safeParse(t).success}const JY=k.string().nullish().transform(t=>t??"Untitled"),dj=k.object({id:k.string(),title:JY,custom_type_id:k.string(),group_lang_id:k.string(),language:uj,versions:k.array(HY)}),wPe=k.object({total:k.number(),cursor:k.string().optional(),results:k.array(dj)}),xPe=k.object({id:k.string(),title:JY,custom_type_id:k.string(),group_lang_id:k.string(),interesting_versions:k.array(YY),locale_id:k.string().optional()}).transform(t=>{const{interesting_versions:e,...n}=t;return{versions:e,...n}}),TPe=k.object({results:k.array(xPe)});function fj(t){const{baseUrl:e,authStrategy:n,limit:r,cursor:i,statuses:o,authors:a,language:s,groupLangIds:l,documentIds:c,customTypes:u,tags:d,term:p,uids:h,signal:m}=t,g=new URL("documents/search",e),v=gf.filterValues({statuses:o,authors:a,language:s,groupLangIds:l,customTypes:u,tags:d,term:p,documentIds:c,limit:r,cursor:i,uids:h},b=>!(b===""||Array.isArray(b)&&b.length===0));return oe.request(g,{credentials:oe.getRequestCredentials(n),okType:wPe,signal:m,method:"POST",body:v})}function ZY(t,e,n,r){const i=new URL(t);return i.search=n,oe.request(i,{credentials:oe.getRequestCredentials(e),okType:TPe,...r})}function XY(t){const{repository:e,searchTerm:n,tags:r,authors:i,status:o,localeId:a,customTypesIds:s}=t,l=new URLSearchParams;return l.append("repository",e),n&&l.append("searchTerm",n),r!=null&&r.length&&l.append("tags",r.toString()),i!=null&&i.length&&l.append("authors",i.toString()),o!=null&&o.length&&l.append("status",o.toString()),a&&l.append("localeId",a),s!=null&&s.length&&l.append("customTypesIds",s.toString()),l.toString()}function eG(t){return t.reduce((e,n)=>{if(n.values.every(i=>i===""||i===void 0))return e;const r=n.values.map(i=>[n.name,i??""]);return e.concat(r)},[])}function kg(t,e,n){return oe.request(new URL(`documents/${n}`,t),{credentials:oe.getRequestCredentials(e),okType:dj})}const _Pe=k.custom().transform((t,e)=>{const n=ue.Document.decode(t);return n._tag==="Left"?(e.addIssue({code:k.ZodIssueCode.custom,message:"Invalid document."}),k.NEVER):n.right}),IPe=k.unknown().transform((t,e)=>{const n=ue.SliceItemContent.decode(t);return n._tag==="Right"?n.right:(e.addIssue({code:k.ZodIssueCode.custom,message:"Invalid slice content."}),k.NEVER)}),jo={all:()=>["documents"],lists:()=>[...jo.all(),"list"],list:t=>[...jo.lists(),t],infiniteLists:()=>[...jo.all(),"list:infinite"],infiniteList:t=>[...jo.infiniteLists(),t]};function EPe(t,e){t.setQueriesData({queryKey:jo.lists()},n=>n&&s2(n,e)),t.setQueriesData({queryKey:jo.infiniteLists()},n=>n&&{...n,pages:n.pages.map(r=>s2(r,e))})}function s2(t,e){const n=t.results.flatMap(r=>{const i=e(r,t);return i?[i]:[]});return{...t,results:n,total:t.total+(n.length-t.results.length)}}async function RPe(t){await t.invalidateQueries({queryKey:jo.lists()}),await t.invalidateQueries({queryKey:jo.infiniteLists()})}function pj(t){return sr.useSuspenseQuery(tG(t))}function tG(t){return sr.queryOptions({queryKey:jo.list(t),queryFn:({queryKey:[,,e]})=>fj(e)})}async function nG(t){const{coreApiBaseUrl:e,documentSearchBaseUrl:n,authStrategy:r,repository:i,searchTerm:o="",customTypes:a,tags:s,authors:l,status:c,locale:u,signal:d,storageVersion:p}=t;if(p&&p.major<=6){const b=c!=null&&c.length?c:["published","unclassified","release"];return{results:(await fj({baseUrl:e,authStrategy:r,tags:s,customTypes:a,language:u,term:o,authors:l,statuses:b,limit:200})).results}}const h=XY({repository:i,searchTerm:o,tags:s,authors:l,status:c,localeId:u,customTypesIds:a});return{results:(await ZY(n,r,h,{signal:d})).results}}function rG(t){const{searchTerm:e,customTypes:n,tags:r,authors:i,status:o,locale:a,config:s,storageVersion:l}=t;s.searchDocuments||It("searchDocuments");const{coreApiBaseUrl:c,documentSearchBaseUrl:u,authStrategy:d,repository:p}=s;return sr.queryOptions({queryKey:["searchDocuments",{coreApiBaseUrl:c,documentSearchBaseUrl:u,authStrategy:d,repository:p,searchTerm:e,customTypes:n,tags:r,authors:i,status:o,locale:a,storageVersion:l}],queryFn:({queryKey:[,h],signal:m})=>nG({...h,signal:m})})}const kPe=k.object({id:k.string(),firstname:k.string().optional(),lastname:k.string().optional(),email:k.string(),uploadedAvatar:k.string().optional()}),iG=k.array(kPe),$Pe=k.object({slicemachineEnabled:k.boolean()}),oG=["next","nuxt","sveltekit"];function OPe(t){return oG.includes(t)}const WC=k.preprocess(t=>typeof t=="string"&&OPe(t)?t:"other",k.enum([...oG,"other"])),MPe=k.object({simulator_url:k.string().url().nullish(),languages:k.array(uj).transform(t=>_t.sort(t,e=>e.label)),authors:iG.optional().default([]),quotas:$Pe.optional().default({slicemachineEnabled:!1}),framework:WC.optional().default("other"),starterId:k.string().optional(),storageVersion:k.object({major:k.number().int(),minor:k.number().int()}),uploadedAvatar:k.string().url().optional()}).transform(({simulator_url:t,framework:e,...n})=>{const r=t&&aG(t)?t:void 0;return{...n,framework:e,simulatorUrl:r,isSupportedFramework:e!=="other"}});function KC(t,e){return oe.request(new URL("repository",t),{credentials:oe.getRequestCredentials(e),okType:MPe})}function aG(t){const e=pi.toURL(t);return e?e.pathname.endsWith("/slice-simulator"):!1}const FPe=k.object({results:k.array(k.string())});function sG(t,e){return oe.request(new URL("repository/tags",t),{credentials:oe.getRequestCredentials(e),okType:FPe})}const jPe=k.object({maxNbEnvironments:k.number(),integrationFieldsEnabled:k.boolean(),personalEnvironmentsEnabled:k.boolean(),sliceMachineEnabled:k.boolean(),customRolesEnabled:k.boolean()}),lG=k.object({_id:k.string(),name:k.string(),onboarding:k.object({completedSteps:k.array(k.string()),isDismissed:k.boolean()}),framework:WC.optional().default("other"),quotas:jPe.optional().default({maxNbEnvironments:0,integrationFieldsEnabled:!1,personalEnvironmentsEnabled:!1,sliceMachineEnabled:!1,customRolesEnabled:!1}),storageVersion:k.object({major:k.number().int(),minor:k.number().int()}),users:iG.optional().default([])});function LPe(t,e,n){const r=new URL("",t);return r.searchParams.append("repository",e),oe.request(r,{headers:{repository:e},credentials:oe.getRequestCredentials(n),okType:lG})}const DPe=k.enum(["createPrismicProject","chooseLocale","createProject","setupSliceMachine","createPageType","codePage","createSlice","reviewAndPush","createContent","renderPage"]),cG=k.object({completedSteps:k.array(k.string()),isDismissed:k.boolean(),context:k.object({framework:WC,starterId:k.string().nullable().optional()})}),uG=k.object({completedSteps:k.array(k.string())}),dG=k.object({isDismissed:k.boolean()});function PPe(t,e,n){const r=new URL("onboarding",t);return r.searchParams.append("repository",e),oe.request(r,{headers:{repository:e},credentials:oe.getRequestCredentials(n),okType:cG})}function BPe(t,e,n,r){const i=new URL(`onboarding/${t}/toggle`,e);return i.searchParams.append("repository",n),oe.request(i,{method:"PATCH",headers:{repository:n},credentials:oe.getRequestCredentials(r),okType:uG})}function UPe(t,e,n){const r=new URL("onboarding/toggle",t);return r.searchParams.append("repository",e),oe.request(r,{method:"PATCH",headers:{repository:e},credentials:oe.getRequestCredentials(n),okType:dG})}const sT=k.enum(["SuperUser","Owner","Administrator","Manager","Writer","Readonly"]);function NPe(t="Readonly"){return t==="Administrator"||t==="SuperUser"||t==="Owner"}const WPe={SuperUser:"SuperUser",Owner:"Owner",Administrator:"Administrator",Manager:"Publisher",Writer:"Writer",Readonly:"Read-only"};function KPe(t){return WPe[t]}const qPe=k.enum([sT.enum.Manager,sT.enum.Writer]),hj=k.record(qPe),mj=k.record(k.object({rolesPerLocale:hj})),VPe=k.record(k.object({rolesPerLocale:hj,rolesPerUser:mj})),zPe=k.object({rolesPerUser:k.record(sT)}),QPe=k.object({rolesPerUser:mj}),HPe=k.object({rolesPerLocale:hj.optional(),rolesPerUser:mj.optional(),rolesPerTeamSpace:VPe.optional()}),YPe=k.object({repository:zPe.optional(),locale:QPe.optional(),teamSpace:HPe.optional()});function fG(t){const{baseUrl:e,repository:n,authStrategy:r,scopes:i,userIds:o,localeIds:a,teamSpaceIds:s,fetchEnabled:l}=t;if(!l)return Promise.resolve({});const c=new URL("roles",e);return c.searchParams.append("repository",n),i!=null&&i.length&&c.searchParams.set("scopes",i.join(",")),o!=null&&o.length&&c.searchParams.set("userIds",o.join(",")),a!=null&&a.length&&c.searchParams.set("localeIds",a.join(",")),s!=null&&s.length&&c.searchParams.set("teamSpaceIds",s.join(",")),oe.request(c,{method:"GET",credentials:oe.getRequestCredentials(r),okType:YPe})}function GPe(t){return sr.queryOptions({queryKey:["roles",t],queryFn:()=>fG(t)})}function JPe(t){const{baseUrl:e,repository:n,authStrategy:r,payload:i}=t,o=new URL("roles",e);return o.searchParams.append("repository",n),oe.request(o,{method:"PATCH",body:i,credentials:oe.getRequestCredentials(r),okType:k.unknown()})}function ZPe(){const t=sr.useQueryClient();return()=>t.invalidateQueries({queryKey:["roles"]})}const qC=k.object({id:k.string(),name:k.string(),customTypes:k.array(k.string())});k.object({name:k.string(),customTypes:k.array(k.string())});const XPe=k.object({results:k.array(qC)});function pG(t){const{baseUrl:e,repository:n,authStrategy:r}=t,i=new URL("team-spaces",e);return i.searchParams.append("repository",n),oe.request(i,{method:"GET",credentials:oe.getRequestCredentials(r),okType:XPe})}function eBe(t){return sr.queryOptions({queryKey:["teamSpaces",t],queryFn:()=>pG(t),select:e=>e.results})}function tBe(){const t=sr.useQueryClient();return()=>t.invalidateQueries({queryKey:["teamSpaces"]})}function nBe(t){const{baseUrl:e,repository:n,authStrategy:r,payload:i}=t,o=new URL("team-spaces",e);return o.searchParams.append("repository",n),oe.request(o,{method:"POST",body:i,credentials:oe.getRequestCredentials(r),okType:qC})}function rBe(t){const{baseUrl:e,repository:n,authStrategy:r,payload:i,teamSpaceId:o}=t,a=new URL(`team-spaces/${o}`,e);return a.searchParams.append("repository",n),oe.request(a,{method:"PUT",body:i,credentials:oe.getRequestCredentials(r),okType:qC})}function iBe(t){const{baseUrl:e,repository:n,authStrategy:r,teamSpaceId:i}=t,o=new URL(`team-spaces/${i}`,e);return o.searchParams.append("repository",n),oe.request(o,{method:"DELETE",credentials:oe.getRequestCredentials(r),okType:k.unknown()})}const hG=k.enum(["SuperUser","Owner","Administrator","Writer","Manager","Readonly"]),oBe=k.record(hG.optional()),aBe=hG.or(oBe),sBe={SuperUser:"SuperUser",Owner:"Owner",Administrator:"Administrator",Manager:"Publisher",Writer:"Writer",Readonly:"Contributor"},mG=k.object({userId:k.string(),shortId:k.string(),intercomHash:k.string(),email:k.string(),firstName:k.string(),lastName:k.string(),superPower:k.boolean(),repositories:k.array(k.object({domain:k.string(),name:k.string().optional(),role:aBe}))});async function AG(t,e){const n=new URL("profile",t);return await oe.request(n,{credentials:oe.getRequestCredentials(e),okType:mG})}function Aj(){const t=Se();t.userServiceBaseUrl||It("userServiceBaseUrl");const{authStrategy:e,userServiceBaseUrl:n}=t;return et.useRequest(AG,[n,e])}const lBe="https://prismic.io/docs/guides/manage-images#supported-media";function $g(){const t=Se();t.mediaLibrary||It("mediaLibrary");const{assetsApiBaseUrl:e,authStrategy:n,repository:r}=t,{items:i}=et.useRequest(gG,[e,r,n]);return{tags:i}}function gG(t,e,n){return oe.request(new URL("tags",t),{credentials:oe.getRequestCredentials(n),okType:cBe,headers:{repository:e}})}const vG=1,yG=20,gj=k.string().min(vG).max(yG),vj=k.object({id:k.string(),name:gj,uploader_id:k.string().optional(),created_at:k.number(),last_modified:k.number(),count:k.number().optional().default(0)}),cBe=k.object({items:k.array(vj)});function Og(t){et.updateFetcherData(gG,e=>{const{items:n}=e,r=t(n);if(r)return{items:r}})}function uBe(t){const{assetType:e,keyword:n,mode:r,tagIds:i}=t,o=Se();o.mediaLibrary||It("mediaLibrary");const{onAnalyticsEvent:a}=o,s=et.useFetcherData(Yi),l=s[s.length-1],c=I.useRef(l);c.current=l,I.useEffect(()=>{if(!a||!n||!c.current||c.current.keyword!==n)return;const u=String(n.split(" ").length),d=String(c.current.total),p=i.join(",");a("Media Library Search",{searchQuery:n,numberOfWords:u,numberOfResults:d,timeToGetResults:c.current.time,assetType:e,mode:r,tags:p})},[n,e,r,a,i])}function dBe(t){const{assetType:e,mediaDialogOpen:n}=t,r=Se(),i=et.useFetcherData(Yi),o=I.useRef(0);I.useEffect(()=>{n&&(o.current=performance.now())},[n]);function a(s){if(!r.onAnalyticsEvent||!r.mediaLibrary)return;const l=i[i.length-1];if(!l)return;const{keyword:c,uploaderId:u,tags:d}=l,p=SG(i,c,e,u,d),h=String(c.split(" ").length),m=String(l.total),g=p.findIndex(C=>C.id===s),v=String(g+1),b=[s].join(","),S=(performance.now()-o.current).toFixed(0);r.onAnalyticsEvent("Media Added To Page",{assetType:e,searchQuery:c,numberOfWords:h,numberOfResults:m,searchPosition:v,mediaIds:b,timeToAddMediaToPage:S,tags:d})}return a}const ov=k.array(k.string()).optional().transform(t=>t==null?void 0:t[0]),VC=k.object({id:k.string(),kind:k.string(),extension:k.string().optional(),filename:k.string(),width:k.number().optional(),height:k.number().optional(),last_modified:k.number(),url:k.string(),alt:k.string().optional(),uploader_id:k.string().optional(),size:k.number(),notes:k.string().optional(),credits:k.string().optional(),search_highlight:k.object({filename:ov,alt:ov,notes:ov,credits:ov}).optional(),tags:k.array(vj)}),bG={"X-Prismic-Source":"Wroom"},fBe=k.object({total:k.number(),cursor:k.string().optional(),items:k.array(VC)}),CG=30;function Yi(t,e,n,r,i,o,a,s,l){const c=t?new URL("assets",t):void 0,u=new URLSearchParams(eG([{name:"limit",values:[`${CG}`]},{name:"cursor",values:[l]},{name:"keyword",values:[r]},{name:"assetType",values:[i]},{name:"uploaderId",values:[o]},{name:"tags",values:a.split(",")}])).toString(),d=fBe.transform(h=>({...h,keyword:r,assetType:i,uploaderId:o,tags:a,page:s})),p=performance.now();return oe.request(`${(c==null?void 0:c.href)??""}?${u}`,{headers:{repository:e,...bG},credentials:oe.getRequestCredentials(n),okType:d}).then(h=>({...h,time:(performance.now()-p).toFixed(0)}))}et.cache.registerFetcherConfig(Yi,{revalidationStrategy:{type:"never"}});const Ar={keyword:"",assetType:"all",uploaderId:void 0,tagIds:[]};function pBe(t){const{initialAssetType:e=Ar.assetType,mode:n}=t,r=Se(),[i,o]=I.useState({...Ar,assetType:e,page:0});r.mediaLibrary||It("mediaLibrary");const{assetsApiBaseUrl:a,authStrategy:s,repository:l}=r,{page:c,cursor:u,keyword:d,assetType:p,uploaderId:h,tagIds:m}=i,g=et.useRequest(Yi,mm({assetsApiBaseUrl:a,authStrategy:s,repository:l,keyword:d,assetType:p,uploaderId:h,tagIds:m,page:c,cursor:u}));uBe({assetType:p,keyword:d,tagIds:m,mode:n});const v=gBe(d,p,h,m),b=g.total!==v.length;function S(){g.cursor!==void 0&&o(w=>({...w,page:w.page+1,cursor:g.cursor}))}function C(w){o(_=>({..._,page:0,cursor:void 0})),Hc((_,E)=>{if(E.page===0)return[...w,..._]})}function y(w){o(_=>({..._,...w,page:0,cursor:void 0}))}function x(){o(w=>({...w,...Ar,assetType:e==="all"?Ar.assetType:w.assetType,page:0,cursor:void 0}))}return{keyword:d,assetType:p,uploaderId:h,tagIds:m,setFilters:y,resetFilters:x,media:v,mediaTotal:g.total,limit:CG,hasNextPage:b,fetchNextPage:S,updateMedia:hBe,unshiftMedia:C,deleteMedia:mBe,deleteSearchData:ABe,revalidateFirstPage:wG}}function hBe(t){Hc(e=>e.flatMap(n=>{const r=t.find(i=>i.id===n.id);return r?r.response===void 0?[]:{...n,...r.response}:n}))}function mBe(t){Hc(e=>e.filter(n=>!t.includes(n.id)))}function ABe(t){const{keyword:e,assetType:n,uploaderId:r,tagIds:i}=t,o=i==null?void 0:i.join(",");et.updateFetcherData(Yi,a=>{if(!(a.keyword===e&&a.assetType===n&&a.uploaderId===r&&a.tags===o))return a})}function SG(t,e,n,r,i){const o=t.filter(l=>l.keyword===e&&l.assetType===n&&l.uploaderId===r&&l.tags===i),s=_t.sort(o,l=>l.page).flatMap(l=>l.items);return e?_t.uniqBy(s,l=>l.id):s}function gBe(t,e,n,r){const i=et.useFetcherData(Yi);return SG(i,t,e,n,r.join(","))}function Hc(t){et.updateFetcherData(Yi,e=>{const{items:n,total:r}=e,i=t(n,e);if(i)return{...e,total:r+(i.length-n.length),items:i}})}function wG(t){const{config:e,keyword:n=Ar.keyword,assetType:r=Ar.assetType,tagIds:i=Ar.tagIds}=t;if(!e.mediaLibrary)throw new Error("media library is not configured");const{assetsApiBaseUrl:o,authStrategy:a,repository:s}=e;et.revalidateData(Yi,mm({assetsApiBaseUrl:o,repository:s,authStrategy:a,keyword:n,assetType:r,tagIds:i,page:0}))}function xG(t){const{config:e,keyword:n=Ar.keyword,assetType:r=Ar.assetType,tagIds:i=Ar.tagIds}=t;if(!e.mediaLibrary)throw new Error("media library is not configured");et.updateFetcherData(Yi,o=>o.page===0?o:void 0),wG({config:e,keyword:n,assetType:r,tagIds:i})}function mm(t){return[t.assetsApiBaseUrl,t.repository,t.authStrategy,t.keyword,t.assetType,t.uploaderId,t.tagIds.join(","),t.page,t.cursor]}function TG(){const t=Se();t.mediaLibrary||It("mediaLibrary");const{assetsApiBaseUrl:e,coreApiBaseUrl:n,authStrategy:r,repository:i}=t,{authors:o}=et.useRequest(KC,[n,r]),{items:a}=et.useRequest(_G,[e,i,r]),{shortId:s}=Aj(),l=new Map(o.map(d=>[d.id,d])),c=[];for(const d of a){if(d.id==="ghost"){c.push({id:d.id,name:"Ghost",uploadedAvatar:"https://images.prismic.io/page-builder-assets/ZuAXWBoQrfVKl5sD_ghost_user.png?auto=format,compress&w=64"});continue}const p=l.get(d.id);if(!p)continue;let h;if(p.uploadedAvatar){const m=new URL(p.uploadedAvatar);m.searchParams.set("w","64"),h=m.toString()}c.push({id:d.id,name:[p.firstname,p.lastname].filter(Boolean).join(" "),firstName:p.firstname,lastName:p.lastname,email:p.email,uploadedAvatar:h})}const u=new Map(c.map(d=>[d.id,d]));return{uploaders:_t.sort(c,d=>d.id===s?0:1,d=>d.name),uploadersById:u}}function _G(t,e,n){return oe.request(new URL("uploaders",t),{credentials:oe.getRequestCredentials(n),okType:yBe,headers:{repository:e}})}const vBe=k.object({id:k.string()}),yBe=k.object({items:k.array(vBe)});function IG(){const t=Se();t.mediaLibrary||It("mediaLibrary");const{assetsApiBaseUrl:e,authStrategy:n,repository:r}=t;return()=>{et.revalidateData(_G,[e,r,n])}}function bBe(t){const{revalidate:e,config:n,keyword:r,assetType:i,uploaderId:o,tagIds:a}=t,{assetsApiBaseUrl:s=void 0,repository:l="",authStrategy:c="token"}=n.mediaLibrary?n:{},[u,d]=I.useState(!1),[p,h]=I.useState(!1),m={assetsApiBaseUrl:s,repository:l,authStrategy:c,keyword:r,assetType:i,uploaderId:o,tagIds:a,page:0},{revalidateData:g}=et.useCacheRevalidation({fetcher:Yi,requestParams:mm(m),validator:(S,C)=>{var w,_;const y=((w=S.items[0])==null?void 0:w.id)??"",x=((_=C.items[0])==null?void 0:_.id)??"";return y!==x||S.total!==(C==null?void 0:C.total)},onCacheInvalidated:()=>h(!0),every:6e4}),v=S=>{g(mm({...m,...S}))};I.useEffect(()=>{u&&(h(!1),d(!1))},[u]);function b(){d(!0),e()}return{isMediaRevalidationInProgress:u,isMediaCacheInvalid:p,revalidateMedia:b,revalidateWithParams:v}}function CBe(t){const{onBeforeUpload:e,onComplete:n}=t,[r,i]=I.useState([]),o=r.some(u=>u.status==="idle"||u.status==="uploading"),a=Se();function s(){if(!r.length||r.some(h=>h.status==="uploading")||r.every(h=>h.status==="error"))return;const u=r.find(h=>h.status==="idle");if(!u)return;let d=r;function p(h){d=h(d),i(d),d.every(g=>g.status==="success"||g.status==="error")&&setTimeout(()=>{i([]),n==null||n(d)},1500)}p(h=>h.map(m=>m.id===u.id?{...m,status:"uploading"}:m)),EG({file:u.file,config:a}).then(h=>{p(m=>m.map(g=>g.id===u.id?{...g,status:"success",response:h}:g))}).catch(()=>{p(h=>h.map(m=>m.id===u.id?{...m,status:"error"}:m))})}function l(u){const d=u.map(p=>({id:`temp-${crypto.randomUUID()}`,file:p,status:"idle"}));i(d),e(d)}const c=I.useCallback(u=>{const d=[{...u,status:"idle"},...r.filter(p=>p.id!==u.id)];i(d),e(d)},[e,r]);return I.useEffect(s,[a,r,n]),{isUploading:o,uploadingFiles:r,onFilesSelected:l,onRetry:c}}async function EG(t){const{file:e,config:n}=t;if(!n.mediaLibrary)throw new Error("Media Library not configured.");const{assetsApiBaseUrl:r,repository:i,authStrategy:o}=n,a=new FormData;return a.append(e.name,e),oe.request(new URL("assets",r),{headers:{repository:i,"Content-Type":"multipart/form-data",...bG},method:"POST",body:a,credentials:oe.getRequestCredentials(o),okType:VC})}const RG=I.createContext(void 0);function SBe(t){const{children:e,assetType:n=Ar.assetType,onSelectedChange:r,actionContainer:i}=t,o=r?"select":"browse",[a,s]=I.useTransition(),[l,c]=I.useTransition(),u=Se(),{showAlert:d}=A.useAlert(),p=Aj(),h=IG(),{keyword:m,assetType:g,uploaderId:v,tagIds:b,setFilters:S,resetFilters:C,media:y,fetchNextPage:x,hasNextPage:w,updateMedia:_,unshiftMedia:E,deleteMedia:R,mediaTotal:O,deleteSearchData:$,revalidateFirstPage:U}=pBe({initialAssetType:n,mode:o}),[q,H]=I.useState();function z(){xG({config:u,keyword:m,assetType:g,uploaderId:v,tagIds:b})}const{isMediaRevalidationInProgress:K,isMediaCacheInvalid:Y,revalidateMedia:ee,revalidateWithParams:L}=bBe({config:u,revalidate:z,keyword:m,assetType:g,uploaderId:v,tagIds:b});function M(we){const Ze=we.keyword===Ar.keyword,mt=we.assetType===n,tt=we.uploaderId===Ar.uploaderId,dt=we.tagIds.length===Ar.tagIds.length&&we.tagIds.every((Gt,Tn)=>Gt===Ar.tagIds[Tn]);return Ze&&mt&&tt&&dt}function F(we){const Ze={keyword:m,assetType:g,tagIds:b,uploaderId:v,...we};M(Ze)?L(we):$(Ze),c(()=>{S(we),We.clearSelection()})}const{isUploading:V,onFilesSelected:pe,uploadingFiles:me,onRetry:Me}=CBe({onBeforeUpload:we=>{C();const Ze=we.filter(tt=>tt.status==="idle").map(tt=>({id:tt.id,url:URL.createObjectURL(tt.file),filename:tt.file.name,size:tt.file.size,extension:tt.file.type,kind:tt.file.type,last_modified:tt.file.lastModified,tags:[],uploader_id:p.shortId}));E(Ze);const[mt]=Ze??[];mt&&We.toggleSelection({id:mt.id,isSingleSelection:!0})},onComplete:we=>{const Ze=we.flatMap(dt=>dt.status==="success"?dt:(vt(dt),{id:dt.id,response:void 0}));_(Ze),U({config:u,assetType:g,tagIds:b}),h();const mt=Ze[0];!mt||!mt.response||!We.isSelected(mt.id)||We.toggleSelection({id:mt.response.id,isSingleSelection:!0})}}),We=Gl({totalItemCount:O,onChangeSelection:({selectedIds:we,selectedCount:Ze})=>{if(Yt(!1),!!r){if(Ze===1){const[mt]=[...we];if(me.some(dt=>dt.id===mt&&dt.status!=="success")){r(new Set);return}}r(new Set(we))}}});function Tt(we){V||pe(we)}function xe(){w&&s(x)}function Be(we,Ze){_([{id:we,response:Ze}])}function vt(we){const Ze=nr.overflow(we.file.name,30);d({id:we.id,title:`The specified file "${Ze}" could not be uploaded.`,subtitle:f.jsxs(A.Text,{color:"inherit",children:["Read more about our"," ",f.jsx(A.Text,{color:"tomato11",href:lBe,underline:!0,children:"supported media"}),"."]}),buttons:{action:{text:"Retry upload",icon:"cloudUpload",onClick:()=>Me(we)}}})}const[sn,Yt]=I.useState(!1);return f.jsx(RG.Provider,{value:{isFetchingMedia:a,media:y,mediaTotal:O,onScrollToBottom:xe,actionContainer:i,onFilesUpload:Tt,isUploading:V,uploadingFiles:me,isMediaRevalidationInProgress:K,isMediaCacheInvalid:Y,revalidateMedia:ee,deleteMedia:R,updateMedia:Be,keyword:m,isSearchingMedia:l,assetType:g,initialAssetType:n,uploaderId:v,tagManagerOpen:sn,setTagManagerOpen:Yt,tagIds:b,onFilterChange:F,openMediaSection:q,setOpenMediaSection:H},children:e})}function kt(){const t=I.useContext(RG);if(!t)throw new Error("useMediaLibrary must be used within a MediaLibraryProvider");return t}function wBe(){const t=Se(),{initialAssetType:e}=kt(),{assetsApiBaseUrl:n=void 0,repository:r="",authStrategy:i="token"}=t.mediaLibrary?t:{},{total:o}=et.useRequest(Yi,mm({assetsApiBaseUrl:n,authStrategy:i,repository:r,assetType:e,keyword:"",tagIds:[],page:0}));return o}function kG(){return wBe()===0}function xBe(){return kG()?f.jsx(TBe,{}):f.jsx(OG,{})}function $G(t){const{children:e}=t;return f.jsx(A.Box,{justifyContent:"center",flexDirection:"column",height:"100%",children:e})}function OG(){return f.jsx($G,{children:f.jsxs(A.BlankSlate,{children:[f.jsx(A.BlankSlateIcon,{name:"close",lineColor:"purple10",backgroundColor:"purple3",borderColor:"purple6",borderStyle:"dashed",size:"xlarge"}),f.jsx(A.BlankSlateTitle,{size:"big",children:"Oops!"}),f.jsx(A.BlankSlateDescription,{width:360,children:"No items found matching your search"})]})})}function TBe(){const{onFilesUpload:t}=kt();return f.jsx($G,{children:f.jsxs(A.Box,{gap:20,flexDirection:"column",alignItems:"center",children:[f.jsx(A.Box,{maxWidth:375,children:f.jsx(A.BlankSlateTitle,{size:"big",children:"Start by uploading your files!"})}),f.jsx(A.Box,{border:!0,borderStyle:"dashed",borderRadius:4,justifyContent:"center",children:f.jsxs(A.BlankSlate,{sx:{marginBlock:80,marginInline:48},children:[f.jsx(A.BlankSlateIcon,{name:"cloudUpload",lineColor:"purple11",backgroundColor:"purple5",size:"large"}),f.jsx(A.BlankSlateTitle,{children:"Drop your files anywhere to upload or ..."}),f.jsx(A.FileUploadButton,{onFilesSelected:t,renderButton:e=>f.jsx(A.Box,{display:"inline-flex",as:"span",children:f.jsx(A.Button,{onClick:e,color:"grey",children:"Upload media"})})}),f.jsx(A.BlankSlateDescription,{children:"Maximum upload size file: 128 MB"})]})})]})})}const rf={warning:{uploadWhileUploading:{title:"Hang tight!",description:"Your current images are still being uploaded. Once they're all set, you'll be free to upload more."}}};function _Be(){const{actionContainer:t,isUploading:e,onFilesUpload:n,assetType:r}=kt();return f.jsx(MG,{actionContainer:t,children:f.jsxs(A.Box,{width:"100%",gap:16,children:[f.jsx(IBe,{}),f.jsx(A.Tooltip,{title:rf.warning.uploadWhileUploading.title,content:rf.warning.uploadWhileUploading.description,visible:e,stableMount:!0,children:f.jsx(A.FileUploadButton,{disabled:e,onFilesSelected:n,startIcon:"cloudUpload",color:t?"purple":"grey",size:"large",assetType:r,children:"Upload media"})})]})})}function IBe(){const{keyword:t,onFilterChange:e,isFetchingMedia:n}=kt(),[r,i]=I.useState(t);return qe.useOnChange(t,()=>{t===""&&i("")}),qe.useDebounce(r,300,qe.useStableCallback(o=>e({keyword:o}))),f.jsx(A.Box,{width:"100%",flexDirection:"column",children:f.jsx(A.FormSearchInput,{value:r,placeholder:"Search",onValueChange:i,maxLength:200,isLoading:n&&t!==r})})}function MG(t){const{children:e,actionContainer:n}=t;return n?f.jsx(A.Portal,{container:n,asChild:!0,children:e}):f.jsx(f.Fragment,{children:e})}function EBe(t){const{children:e}=t,{onFilesUpload:n,assetType:r}=kt();return f.jsx(A.FileDropZone,{overlay:f.jsx(RBe,{}),onFilesSelected:n,assetType:r,children:e})}function RBe(){const{isUploading:t}=kt(),e=t?rf.warning.uploadWhileUploading.title:"Drop files here",n=t?rf.warning.uploadWhileUploading.description:"Drop your files to upload them instantly to the media library.";return f.jsx(A.Box,{justifyContent:"center",flexDirection:"column",height:"100%",children:f.jsxs(A.BlankSlate,{children:[f.jsx(A.BlankSlateIcon,{name:t?"block":"cloudUpload",lineColor:t?"tomato11":"purple10",backgroundColor:t?"tomato2":"purple3",borderColor:t?"tomato6":"purple6",borderStyle:"dashed",size:"xlarge"}),f.jsx(A.BlankSlateTitle,{size:"big",children:e}),f.jsx(A.BlankSlateDescription,{width:360,children:n})]})})}function FG(){return f.jsx(A.DefaultErrorMessage,{title:"Oops! Something went wrong",description:"An error occurred while searching for your image.",errorImageSrc:A.dialogErrorImage,sx:{marginBlock:"auto",marginInline:"auto"}})}function jG(t){const{mediaList:e,mediaActions:n,mediaToolbar:r,sidePane:i}=t,o=A.useMediaQuery({min:"medium"}),a=i&&o;return f.jsxs(A.Box,{display:"grid",gridTemplateRows:"auto auto 1fr",gridTemplateColumns:a?"1fr 380px":"1fr",width:"100%",height:"100%",children:[f.jsxs(A.Box,{position:"relative",display:"grid",gap:16,gridColumn:"1",gridRow:"1",padding:{right:16,bottom:16},children:[n,r]}),f.jsx(A.Box,{position:"relative",display:"grid",gridColumn:"1",gridRow:"2 / -1",children:e}),a&&i]})}function kBe(){var p;const{onScrollToBottom:t,media:e,isUploading:n,uploadingFiles:r,isSearchingMedia:i,isMediaRevalidationInProgress:o,setOpenMediaSection:a,isFetchingMedia:s}=kt(),l=Gl(),c=I.useRef(null);function u(h){l.toggleSelection({id:h,isSingleSelection:!0}),a("tags")}(n||i||o)&&((p=c.current)==null||p.scrollTo({top:0,behavior:"instant"}));function d(h,m,g){const v=m.shiftKey?e.map(({id:b})=>b):void 0;l.toggleSelection({id:h,isSingleSelection:g==="single",metaKey:m.metaKey,shiftKey:m.shiftKey,ids:v})}return f.jsxs(LG,{onScrollToBottom:t,scrollAreaRef:c,children:[e.map(h=>{var m,g;return f.jsx(A.MediaCard,{"aria-label":"media item",...h,filenameHighlight:(m=h.search_highlight)==null?void 0:m.filename,loading:i,status:(g=r.find(v=>v.id===h.id))==null?void 0:g.status,selected:l.isSelected(h.id),onCardClick:v=>d(h.id,v,"single"),onCheckedChange:(v,b)=>d(h.id,b,"multi"),onAddTagClick:()=>u(h.id)},h.id)}),f.jsx(A.Box,{gridColumn:"1 / -1",justifyContent:"center",children:f.jsx(A.AnimatedElement,{animation:{name:"fade"},children:s&&f.jsx(A.Text,{align:"center",color:"grey11",sx:{marginBlock:8},children:"Loading more items ..."})})})]})}function LG(t){const{children:e,scrollAreaRef:n,onScrollToBottom:r}=t,i=16,o=4,a="250px",s=`calc((100% - ${i*(o-1)}px) / ${o})`;return f.jsx(A.ScrollArea,{"aria-label":"Media list",ref:n,style:{display:"grid",gridTemplateColumns:`repeat(auto-fill, minmax(max(${a}, ${s}), 1fr))`,gridTemplateRows:"1fr 1fr 1fr ",gap:i,padding:2,paddingBottom:16,position:"relative"},onScrollToBottom:r,threshold:500,children:e})}function DG(t){const{children:e,hasSelectedMedia:n}=t;return f.jsx(A.Box,{overflow:"hidden",gridColumn:"2 / -1",gridRow:"1 / -1",children:f.jsx(A.ScrollArea,{style:{display:"grid",height:"100%"},children:f.jsx(A.Box,{flexGrow:1,borderRadius:{topRight:8,topLeft:8},borderStyle:n?"solid":"dashed",border:{top:!0,right:!0,left:!0,bottom:!1},minWidth:0,children:e})})})}function PG(t){const{onFilesUpload:e,isUploading:n,isInitialLoad:r=!1}=t,i=r||n;return f.jsxs(A.Box,{flexDirection:"column",justifyContent:"center",alignItems:"center",padding:16,gap:16,width:"100%",children:[f.jsx(A.BlankSlateIcon,{name:"cloudUpload",lineColor:"purple11",backgroundColor:"purple5",size:"large"}),f.jsx(A.Box,{flexDirection:"column",gap:4,children:f.jsxs(A.Text,{align:"center",children:["Select or"," ",f.jsx(A.FileUploadButton,{disabled:i,onFilesSelected:e,renderButton:o=>f.jsx(A.Tooltip,{title:rf.warning.uploadWhileUploading.title,content:rf.warning.uploadWhileUploading.description,visible:n,children:f.jsx(A.Box,{display:"inline-flex",as:"span",children:f.jsx(A.Button,{disabled:i,onClick:o,invisible:!0,children:"upload"})})})})," ","media."]})}),f.jsx(A.FileUploadButton,{disabled:i,onFilesSelected:e,color:"grey",children:"Upload media"})]})}function BG(t){const{count:e}=t;return f.jsxs(A.Text,{variant:"bold",children:[e," item",e==1?"":"s"]})}function $Be(t){const{actionContainer:e}=t;return f.jsx(jG,{sidePane:f.jsx(FBe,{}),mediaActions:f.jsx(MBe,{actionContainer:e}),mediaToolbar:f.jsx(A.Skeleton,{color:"grey5",borderRadius:12,children:f.jsx(BG,{count:888})}),mediaList:f.jsx(OBe,{})})}function OBe(){return f.jsx(LG,{children:_t.range(1,24).map(t=>f.jsx(UG,{},t))})}function MBe(t){const{actionContainer:e}=t;return f.jsx(MG,{actionContainer:e,children:f.jsxs(A.Box,{width:"100%",gap:16,children:[f.jsx(A.Box,{width:"100%",flexDirection:"column",children:f.jsx(A.FormSearchInput,{placeholder:"Search",maxLength:200,value:"",disabled:!0,onValueChange:()=>{}})}),f.jsx(A.FileUploadButton,{disabled:!0,onFilesSelected:()=>{},startIcon:"cloudUpload",color:e?"purple":"grey",size:"large",children:"Upload media"})]})})}function FBe(){return f.jsx(DG,{hasSelectedMedia:!1,children:f.jsx(PG,{onFilesUpload:()=>{},isUploading:!1,isInitialLoad:!0})})}function UG(){return f.jsx(A.Card,{variant:"outlined",padding:16,children:f.jsxs(A.CardContent,{gap:0,children:[f.jsx(A.Skeleton,{height:185,width:"100%"}),f.jsx(A.Skeleton,{height:16,width:"100%",sx:{marginTop:12}}),f.jsx(A.Skeleton,{height:10,width:100,sx:{marginTop:8}}),f.jsx(A.Skeleton,{height:1,width:"100%",sx:{marginTop:20,marginBottom:16}}),f.jsxs(A.Box,{flexDirection:"row",gap:8,children:[f.jsx(A.Skeleton,{height:24,width:54}),f.jsx(A.Skeleton,{height:24,width:45}),f.jsx(A.Skeleton,{height:24,width:62})]})]})})}const NG=I.createContext({showToast:()=>{}});function jBe(t){const{children:e}=t,[n,r]=I.useState({title:"",seconds:5}),[i,o]=I.useState(!1),{title:a,action:s,seconds:l=1,icon:c="check"}=n,u=I.useMemo(()=>({showToast:d=>{r({seconds:l,...d}),o(!0)}}),[l]);return f.jsxs(f.Fragment,{children:[f.jsx(LBe,{}),f.jsx(A.Toast,{anchor:f.jsx(A.Box,{position:"absolute",justifyContent:"center",width:"100%",bottom:72}),open:i,onOpenChange:o,title:a,action:s,seconds:l,icon:c}),f.jsx(NG.Provider,{value:u,children:e})]})}function WG(){return I.useContext(NG)}function LBe(){const{revalidateMedia:t,isMediaCacheInvalid:e}=kt(),[n,r]=I.useState(e);return qe.useOnChange(e,r),f.jsx(A.Toast,{anchor:f.jsx(A.Box,{position:"absolute",justifyContent:"center",width:"100%",bottom:72}),open:n,title:"There have been changes to your media library",action:{title:"Update",onClick:t},cancel:{onClick:()=>r(!1)}})}function id(){const{media:t}=kt(),e=Gl();return t.filter(({id:n})=>e.isSelected(n))}function DBe(){const[t,e]=I.useState(!1),n=id(),r=Gl(),i=I.useMemo(()=>n.some(({id:a})=>a.startsWith("temp")),[n]),[o]=n;return o?r.selectedCount>1?f.jsxs(A.Box,{gap:8,alignItems:"center",children:[f.jsxs(A.Text,{variant:"emphasized",noWrap:!0,sx:{flexGrow:1},children:[r.selectedCount," media selected"]}),f.jsx(A.Tooltip,{content:"Open all selected media in new tabs",children:f.jsx(A.IconButton,{icon:"openInFull",variant:"solid",size:"small",onClick:()=>n.forEach(a=>window.open(a.url,"_blank"))})}),f.jsx(A.Tooltip,{content:"Remove selected media",children:f.jsx(A.IconButton,{icon:"delete",variant:"solid",color:"tomato",size:"small",hiddenLabel:"Remove media",onClick:()=>e(!0),disabled:i})}),f.jsx(l2,{open:t,onOpenChange:e,media:n})]}):f.jsxs(A.Box,{gap:8,alignItems:"center",children:[f.jsx(A.Text,{variant:"emphasized",noWrap:!0,sx:{flexGrow:1},children:o.filename}),f.jsxs(A.Box,{gap:8,children:[f.jsx(A.Tooltip,{content:"Open media in new tab",children:f.jsx(A.IconButton,{icon:"openInFull",variant:"solid",size:"small",hiddenLabel:"Open media in new tab",onClick:()=>window.open(o.url,"_blank"),disabled:i})}),f.jsx(A.Tooltip,{content:"Copy media URL",children:f.jsx(A.IconButton,{icon:"link",variant:"solid",size:"small",hiddenLabel:"Copy media URL",onClick:()=>navigator.clipboard.writeText(o.url),disabled:i})}),f.jsx(A.Tooltip,{content:"Remove media",children:f.jsx(A.IconButton,{icon:"delete",variant:"solid",color:"tomato",size:"small",hiddenLabel:"Remove media",onClick:()=>e(!0),disabled:i})}),f.jsx(l2,{open:t,onOpenChange:e,media:o})]})]}):null}function l2(t){const{open:e,onOpenChange:n,media:r}=t,i=Se(),{showAlert:o}=A.useAlert(),{deleteMedia:a}=kt(),s=Gl(),l=IG(),[c,u]=I.useState(!1),d=Array.isArray(r),p=d?"these items":"this item";function h(){u(!0);const g=s.getSelectionState().selectedIds;BBe({ids:g,config:i}).then(()=>{n(!1),a(g),s.clearSelection(),l()}).catch(()=>{n(!1),o({title:"Error",subtitle:`Something went wrong when removing ${p}.`})}).finally(()=>{u(!1)})}return f.jsxs(A.Dialog,{onOpenChange:n,open:e,size:"small",children:[f.jsx(A.DialogHeader,{icon:"alert",title:`Remove ${p} from your media library?`}),f.jsx(A.DialogDescription,{asChild:!0,children:f.jsx(A.DialogContent,{children:f.jsxs(A.Box,{padding:16,flexDirection:"column",children:[f.jsxs(A.Text,{children:["You are about to delete ",p,":  ",!d&&f.jsx("b",{children:r.filename})]}),d&&f.jsx(PBe,{media:r})]})})}),f.jsxs(A.DialogActions,{children:[f.jsx(A.DialogCancelButton,{}),f.jsxs(A.DialogActionButton,{onClick:h,color:"tomato",loading:c,children:["Yes, I want to remove ",p]})]})]})}const Ew=15;function PBe(t){const{media:e}=t,n=e.slice(0,Ew),r=e.length>Ew,i=r?e.length-Ew:0,o=nr.pluralize(i,"item");return f.jsxs(A.UnorderedList,{density:"compact",sx:{marginTop:8},children:[n.map((a,s)=>f.jsx(A.ListItem,{children:f.jsx("b",{children:a.filename})},s)),r&&f.jsxs(A.ListItem,{children:["And ",f.jsx("b",{children:i})," more ",o,"..."]})]})}function BBe(t){const{ids:e,config:n}=t;if(!n.mediaLibrary)throw new Error("Media Library not configured.");if(e.length===0)throw new Error("No ids provided during media deletion");const{assetsApiBaseUrl:r,repository:i,authStrategy:o}=n;if(e.length===1){const[a]=e;return oe.request(new URL(`assets/${a}`,r),{headers:{repository:i},method:"DELETE",credentials:oe.getRequestCredentials(o),okType:k.unknown()})}return oe.request(new URL("assets/bulk-delete",r),{headers:{repository:i},method:"POST",credentials:oe.getRequestCredentials(o),okType:k.unknown(),body:{ids:e}})}const Qs=2e3,Wp="__MAIN_THUMBNAIL__";function lT(t,e,n){const r=t.name===Wp?void 0:t.name;let i;return e?no.isDefined(n)?i=[n.width,n.height]:no.isDefined(t.width)||no.isDefined(t.height)?i=[t.width??void 0,t.height??void 0]:i=[e.origin.width,e.origin.height]:i=void 0,[r,i?`${i[0]??"auto"}×${i[1]??"auto"}px`:void 0]}function UBe(t){var e,n;return[{...(e=t.config)==null?void 0:e.constraint,name:Wp}].concat(((n=t.config)==null?void 0:n.thumbnails)??[])}function NBe(t,e){var a,s;const{__TYPE__:n,thumbnails:r,...i}=e,o=(s=(a=t.config)==null?void 0:a.thumbnails)==null?void 0:s.map(({name:l})=>r==null?void 0:r[l]);return[i,...o??[]]}function WBe(t,e,n,r){const i=r.length===0?void 0:r;return t===Wp||!ue.isImageContent(e)?{...e,alt:i}:{...e,thumbnails:{...e.thumbnails,[t]:{...n,alt:i}}}}function KBe(t,e){const{width:n,height:r}=e??{};return n&&r?[n,r]:n?[n,Math.round(t.height*(n/t.width))]:r?[Math.round(t.width*(r/t.height)),r]:[t.width,t.height]}function qBe(t,e,n,r,i){if(GBe(t)==="svg")return t;const o=new URL(t);if(i){const{x:a,y:s,width:l,height:c}=e,u=[...o.searchParams.entries(),["rect",[a,s,l,c].join(",")],["w",n],["h",r]];o.search=u.map(d=>d.join("=")).join("&")}return o.toString()}function yj(t,e){const n=new URL(t.split("?")[0]??t);return e!=null&&e.width&&n.searchParams.set("w",e.width.toString()),e!=null&&e.height&&n.searchParams.set("h",e.height.toString()),(e!=null&&e.width||!(e!=null&&e.height))&&n.searchParams.set("dpr",Math.max(1,Math.min(window.devicePixelRatio,3)).toString()),e!=null&&e.width&&(e!=null&&e.height)&&n.searchParams.set("fit","max"),n.searchParams.set("auto","compress,format"),n.toString()}function VBe(t){return yj(t,{width:300})}function KG(t){return yj(t,{width:800,height:800})}function zBe(t){return t!=null&&t.url?KG(t.url):void 0}function QBe(t,e,n,r){var s,l,c,u,d;if(!n||t===Wp){const p=(s=e.config)==null?void 0:s.thumbnails,h=p&&Object.fromEntries(p.map(m=>[m.name,Iv(r,m)]));return{__TYPE__:"ImageContent",...Iv(r,(l=e.config)==null?void 0:l.constraint),thumbnails:h}}const i=(u=(c=e.config)==null?void 0:c.thumbnails)==null?void 0:u.find(p=>p.name===t);if(!i)return n;const o=(d=n.thumbnails)==null?void 0:d[t],a=Iv(r,i);return a.url===(o==null?void 0:o.url)?n:{...n,thumbnails:gf.mapValues(n.thumbnails??{},(p,h)=>h===t?a:p)}}function HBe(t){return"kind"in t&&"extension"in t}function Iv(t,e){const{width:n,height:r,rect:i}=YBe({...t,width:(t==null?void 0:t.width)??Qs,height:(t==null?void 0:t.height)??Qs},e),o=!!(e!=null&&e.width||e!=null&&e.height);return{provider:"imgix",url:qBe(t.url,i,n,r,o),alt:t.alt,...HBe(t)?{credits:t.credits}:{},origin:{id:t.id,url:t.url,width:t.width??Qs,height:t.height??Qs},width:n,height:r,edit:{background:"transparent",zoom:1,crop:{x:i.x,y:i.y}}}}function YBe(t,e){const[n,r]=KBe(t,e),i=Math.max(n/t.width,r/t.height),o=Math.round((t.width-n/i)/2),a=Math.round((t.height-r/i)/2),s=Math.round(n/i),l=Math.round(r/i);return{width:n,height:r,rect:{x:o,y:a,width:s,height:l}}}function GBe(t){const{pathname:e}=new URL(t),n=e.lastIndexOf(".");if(n!==-1)return e.substring(n).slice(1).toLowerCase()}function JBe(t){if(!t)return"";const{filename:e,extension:n}=t;return!n||!e.endsWith(`.${n}`)?e:e.slice(0,-n.length-1)}function ZBe(){var o;const t=id(),{uploadingFiles:e}=kt(),[n]=t;if(!n)return null;if(t.length===2)return f.jsx(Rw,{children:t.map((a,s)=>f.jsx("div",{style:{position:"absolute",transform:s===0?"translateX(25%) rotate(15deg) ":"translateX(-25%) rotate(-15deg) "},children:f.jsx(c2,{media:a})},a.id))});if(t.length>2)return f.jsx(Rw,{children:t.slice(-4).map((a,s)=>f.jsx("div",{style:{position:"absolute",paddingRight:s*16},children:f.jsx(c2,{media:a})},a.id))});const r=(o=e.find(a=>a.id===n.id))==null?void 0:o.status,i=n.kind.startsWith("image");return f.jsx(A.Box,{flexDirection:"column",children:f.jsx(A.CheckerBoard,{children:f.jsx(Rw,{uploadStatus:r,hasImage:i,children:i?f.jsx(A.Image,{src:n.url,alt:n.alt,sizing:"contain"}):f.jsx(A.MediaCardPlaceholder,{kind:n.kind,filename:n.filename})})})})}function Rw(t){const{children:e,uploadStatus:n,hasImage:r}=t;return f.jsxs(A.Box,{flexDirection:"column",alignItems:"center",justifyContent:"center",position:"relative",height:200,width:"100%",backgroundColor:r?"transparent":"purple2",children:[e,n&&f.jsx(XBe,{uploadStatus:n})]})}function XBe(t){const{uploadStatus:e}=t,{value:n,color:r,height:i,transition:o}=eUe(e);return f.jsx(A.Box,{position:"absolute",backgroundColor:"greyAlpha1",width:"100%",height:"100%",padding:{inline:16},justifyContent:"end",flexDirection:"column",children:f.jsx(A.ProgressBar,{value:n,color:r,height:i,transition:o})})}function eUe(t){switch(t){case"idle":return{value:0,height:"collapsed",color:"grey4"};case"uploading":return{value:90,transition:"slow",color:"purple9"};case"success":return{value:100,height:"collapsed",color:"purple9"};case"error":return{value:100,color:"tomato11"}}}function c2(t){const{media:e}=t;return f.jsx(A.Box,{width:111,height:152,children:e.kind==="image"?f.jsx(A.Image,{borderRadius:8,src:yj(e.url,{width:111,height:152}),alt:e.alt,sizing:"cover"}):f.jsx(A.MediaCardPlaceholder,{kind:e.kind,filename:e.filename})})}function tUe(t){const e=t.length,n={},r=[];return t.forEach(o=>{o.tags.forEach(a=>{n[a.id]||(n[a.id]=0,r.push(a)),n[a.id]++})}),r.filter(o=>n[o.id]===e)}function qG(t){const{tags:e,toggleAssetTag:n,getTagsLabel:r}=t,{setTagManagerOpen:i}=kt(),{showToast:o}=WG(),{showAlert:a}=A.useAlert(),[s,l]=I.useState("");async function c(u,d){l("");try{await n(u,d),o({title:"Media tags were updated",seconds:3})}catch{a({title:"Error",subtitle:"Something went wrong when updating media tags"})}}return f.jsxs(A.Box,{flexDirection:"column",children:[f.jsxs(A.Box,{justifyContent:"space-between",children:[f.jsx(A.Text,{color:"grey12",variant:"bold",children:r()}),f.jsx(A.Button,{startIcon:"edit",invisible:!0,color:"dark",onClick:()=>i(!0),children:"Manage tags"})]}),f.jsxs(A.ComboBox,{sx:{marginTop:4,marginBottom:8},children:[f.jsx(nUe,{searchTerm:s,setSearchTerm:l}),f.jsx(A.ComboBoxContent,{children:f.jsx(A.ErrorBoundary,{renderError:()=>f.jsx(A.Text,{color:"grey9",variant:"small",sx:{marginBlock:8,marginInline:8},children:"Error getting tags"}),children:f.jsx(I.Suspense,{fallback:f.jsx(A.Box,{padding:8,flexDirection:"column",gap:8,children:_t.range(1,6).map(u=>f.jsx(A.Skeleton,{height:24,width:85},u))}),children:f.jsx(rUe,{searchTerm:s,assignedTags:e,onToggleAssetTag:c})})})})]}),f.jsx(A.Box,{flexDirection:"column",alignItems:"flex-start",gap:8,children:e.map(u=>f.jsx(A.Badge,{title:u.name,size:"medium",color:"purple",selected:!0,onClose:()=>c(u,"remove")},u.id))})]})}function nUe(t){const{searchTerm:e,setSearchTerm:n}=t,r=I.useRef(null),{openMediaSection:i,setOpenMediaSection:o}=kt();return I.useEffect(()=>{var a;i==="tags"&&((a=r.current)==null||a.focus(),o(void 0))},[i,o]),f.jsx(A.ComboBoxInput,{value:e,onValueChange:n,placeholder:"Add or create a new tag",ref:r})}function rUe(t){const{searchTerm:e,assignedTags:n,onToggleAssetTag:r}=t,[i]=id(),o=Se(),{showAlert:a}=A.useAlert(),{tags:s}=$g(),l=I.useMemo(()=>{const p=e.toLowerCase();return s.filter(h=>h.name.toLowerCase().includes(p))},[s,e]),u=gj.safeParse(e).success&&s.every(p=>p.name!==e);async function d(){if(!e||!i)return;let p;try{p=await iUe({name:e,config:o}),Og(h=>[p,...h])}catch{a({title:"Error",subtitle:`Something went wrong when creating the tag ${e}`});return}await r(p,"add")}return i?f.jsxs(f.Fragment,{children:[!l.length&&f.jsx(A.Text,{color:"grey9",variant:"small",sx:{marginBlock:8,marginInline:8},children:"No tags found"}),l.map((p,h)=>f.jsx(A.ComboBoxItem,{value:p.id,onCheckedChange:m=>r(p,m?"add":"remove"),checked:n.some(m=>m.id===p.id),children:f.jsx(A.Badge,{title:p.name,color:"purple",size:"medium",sx:{marginInline:8,marginBottom:h===l.length-1?8:4,marginTop:h===0?8:4}})},p.id)),u&&f.jsx(A.ComboBoxItem,{value:"new",onCheckedChange:d,children:f.jsxs(A.Box,{padding:8,flexDirection:"row",alignItems:"center",gap:4,children:[f.jsx(A.Icon,{name:"add",size:"small",color:"grey11"}),f.jsxs(A.Text,{color:"grey12",children:['Create tag "',e,'"']})]})})]}):null}function iUe(t){const{name:e,config:n}=t;n.mediaLibrary||It("mediaLibrary");const{assetsApiBaseUrl:r,repository:i,authStrategy:o}=n;return oe.request(new URL("tags",r),{headers:{repository:i},body:{name:e},method:"POST",credentials:oe.getRequestCredentials(o),okType:vj})}function oUe(t){const{selectedMedia:e}=t,n=Se(),r=I.useMemo(()=>tUe(e),[e]);async function i(a,s){const l=s==="remove",c=e.map(d=>d.id);let u=[];Hc(d=>(u=d,d.map(p=>c.includes(p.id)?l?lUe(p,a):sUe(p,a):p)));try{await aUe({tagId:a.id,assetIds:c,operation:l?"remove":"add",config:n});const d=e.length*(l?-1:1);Og(p=>p.map(h=>h.id===a.id?{...h,count:h.count+d}:h))}catch(d){throw Hc(()=>u),d}}function o(){const a=r.length;return a>1?`${a} tags in common`:a===1?"1 tag in common":"Common tags"}return f.jsx(qG,{tags:r,getTagsLabel:o,toggleAssetTag:i})}function aUe(t){const{tagId:e,assetIds:n,config:r,operation:i}=t;if(!r.mediaLibrary)throw new Error("Media Library not configured.");const{assetsApiBaseUrl:o,repository:a,authStrategy:s}=r;return oe.request(new URL(`tags/${e}/assets`,o),{headers:{repository:a},body:{assetIds:n},method:i==="add"?"POST":"DELETE",credentials:oe.getRequestCredentials(s),okType:k.unknown()})}function sUe(t,e){return t.tags.some(({id:r})=>r===e.id)?t:{...t,tags:[...t.tags,e]}}function lUe(t,e){const n=t.tags.filter(r=>r.id!==e.id);return{...t,tags:n}}function cUe(t){const{selectedMedia:e}=t,n=e.tags,r=Se(),{updateMedia:i}=kt();async function o(s,l){const c=e.tags,u=l==="remove",d=u?c.filter(p=>p.id!==s.id):[...c,s];i(e.id,{tags:d});try{await uUe({mediaId:e.id,config:r,tags:d.map(p=>p.id)}),Og(p=>p.map(h=>h.id===s.id?{...h,count:h.count+(u?-1:1)}:h))}catch(p){throw i(e.id,{tags:c}),p}}function a(){const s=n.length;return s>1?`${s} tags`:s===1?"1 tag":"Tags"}return f.jsx(qG,{tags:n,getTagsLabel:a,toggleAssetTag:o})}function uUe(t){const{mediaId:e,config:n,tags:r}=t;if(!n.mediaLibrary)throw new Error("Media Library not configured.");const{assetsApiBaseUrl:i,repository:o,authStrategy:a}=n;return oe.request(new URL(`assets/${e}`,i),{headers:{repository:o},body:{tags:r},method:"PATCH",credentials:oe.getRequestCredentials(a),okType:VC})}function dUe(){const[t,e]=I.useState("description");if(id().length!==1)return f.jsx(AUe,{});const r=t==="description",i=t==="more-info";return f.jsxs(f.Fragment,{children:[f.jsxs(A.Box,{display:"grid",gridTemplateColumns:"1fr 1fr",backgroundColor:"grey2",border:!0,borderStyle:"solid",borderRadius:8,children:[f.jsx(A.Tab,{selected:r,outline:r,transparent:!0,onClick:()=>e("description"),children:"Description"}),f.jsx(A.Tab,{selected:i,outline:i,transparent:!0,onClick:()=>e("more-info"),children:"More info"})]}),f.jsx(fUe,{tab:t})]})}function fUe(t){const{tab:e}=t;switch(e){case"description":return f.jsx(pUe,{});case"more-info":return f.jsx(hUe,{})}}function pUe(){const{title:t,alt:e,onBlur:n,isUploading:r,selectedMedia:i}=zG();if(!i)return null;const{extension:o}=i;return f.jsxs(A.Box,{flexDirection:"column",gap:16,children:[f.jsx(A.FormInput,{value:t.value,onValueChange:t.set,label:"Media title",placeholder:"Media title",onBlur:n,disabled:r,suffix:o?`.${o}`:void 0}),f.jsx(A.FormInputField,{label:"Alternative text",children:f.jsx(A.ContentEditable,{content:e.displayValue,contentVersion:e.version,readOnly:r,placeholder:"A short description of the media for accessibility",multiline:!0,decorations:{em:"highlight"},onChange:e.onChange,onBlur:n})}),!r&&f.jsx(cUe,{selectedMedia:i})]})}function hUe(){const{credits:t,notes:e,onBlur:n,isUploading:r,selectedMedia:i}=zG();if(!i)return null;const{uploader_id:o}=i,a=yUe(i);return f.jsxs(A.Box,{gap:8,flexDirection:"column",children:[a.map(s=>f.jsxs(A.Box,{gap:8,children:[f.jsxs(A.Text,{color:"grey11",children:[s.label,":"]}),f.jsx(A.Text,{children:s.value})]},s.label)),f.jsxs(A.Box,{gap:8,children:[f.jsx(A.Text,{color:"grey11",children:"Uploaded by:"}),f.jsx(A.ErrorBoundary,{renderError:()=>f.jsx(A.Text,{color:"grey11",children:"Error getting uploader"}),children:f.jsx(I.Suspense,{fallback:f.jsx(VG,{}),children:f.jsx(mUe,{uploaderId:o})})})]}),f.jsx(A.FormInputField,{label:"Copyright",children:f.jsx(A.ContentEditable,{content:t.displayValue,contentVersion:t.version,readOnly:r,placeholder:"Media copyrights or credits",multiline:!0,decorations:{em:"highlight"},onChange:t.onChange,onBlur:n})}),f.jsx(A.FormInputField,{label:"Private notes",children:f.jsx(A.ContentEditable,{content:e.displayValue,contentVersion:e.version,readOnly:r,placeholder:"Private notes are never shared publicly",multiline:!0,decorations:{em:"highlight"},onChange:e.onChange,onBlur:n})})]})}function mUe(t){const{uploaderId:e}=t,{uploadersById:n}=TG(),r=n.get(e??"ghost");return e&&!r?f.jsx(VG,{}):r?f.jsxs(f.Fragment,{children:[f.jsx(A.Avatar,{size:24,firstName:r.firstName,lastName:r.lastName,imageUrl:r.uploadedAvatar}),f.jsx(A.Text,{children:r.name})]}):null}function VG(){return f.jsx(A.Skeleton,{width:128})}function AUe(){const t=id(),{uploadingFiles:e}=kt(),n=I.useMemo(()=>e.some(r=>t.some(i=>r.id===i.id)&&r.status!=="success"),[t,e]);return f.jsx(f.Fragment,{children:!n&&f.jsx(oUe,{selectedMedia:t})})}function zG(){const[t]=id(),{updateMedia:e,uploadingFiles:n}=kt(),r=Se(),{showToast:i}=WG(),o=(t==null?void 0:t.id)??"",a=av(t,"alt"),s=av(t,"notes"),l=av(t,"credits"),c=av(t,"filename",JBe),u=n.some(p=>p.id===(t==null?void 0:t.id)&&p.status!=="success");async function d(){if(!t||!c.changed&&!a.changed&&!l.changed&&!s.changed)return;const{extension:p,search_highlight:h}=t,m=p?`${c.value}.${p}`:c.value;e(o,{filename:m,alt:a.value,credits:l.value,notes:s.value,search_highlight:{alt:a.changed||h==null?void 0:h.alt,credits:l.changed||h==null?void 0:h.credits,filename:c.changed||h==null?void 0:h.filename,notes:s.changed||h==null?void 0:h.notes}}),await vUe({id:o,config:r,metadata:{filename:m,alt:a.value,credits:l.value,notes:s.value}}),i({title:"Media metadata has been saved.",seconds:3})}return{selectedMedia:t,onBlur:d,isUploading:u,title:c,alt:a,credits:l,notes:s,extension:t==null?void 0:t.extension}}function av(t,e,n=r=>r==null?void 0:r[e]){var c;const r=n(t)??"",[i,o]=I.useState(r);qe.useOnChange(t==null?void 0:t.id,()=>o(r));const a=(c=t==null?void 0:t.search_highlight)==null?void 0:c[e],s=!!a;function l(u){const{from:d,to:p}=u.state.selection;u.commands.selectAll(),u.commands.unsetAllMarks(),u.commands.setTextSelection({from:d,to:p}),o(u.getText())}return{value:i,set:o,displayValue:gUe(a??i)??"",onChange:l,version:`${(t==null?void 0:t.id)??""}_${s}`,changed:i!==r}}function gUe(t){return t==null?void 0:t.replace(/\n/g,"<br>")}function vUe(t){const{id:e,config:n,metadata:r}=t;if(!n.mediaLibrary)throw new Error("Media Library not configured.");const{assetsApiBaseUrl:i,repository:o,authStrategy:a}=n;return oe.request(new URL(`assets/${e}`,i),{headers:{repository:o},body:{...r},method:"PATCH",credentials:oe.getRequestCredentials(a),okType:VC})}function yUe(t){const{width:e,height:n,last_modified:r,size:i,extension:o}=t,a=e&&n,s={label:"Date",value:v_.prettyPrintDate(new Date(r))},l={label:"File size",value:nr.formatBytes(i)},c=a?{label:"Dimensions",value:`${e}×${n}`}:void 0,u=a?{label:"Ratio",value:((e??0)/(n??0)).toFixed(1)}:void 0,d=o?{label:"Extension",value:o.toUpperCase()}:void 0;return[s,l,c,u,d].filter(no.isDefined)}function bUe(){const{setTagManagerOpen:t}=kt(),[e,n]=I.useState("");return f.jsxs(A.Box,{gap:20,flexDirection:"column",height:"100%",children:[f.jsxs(A.Box,{alignItems:"center",gap:4,children:[f.jsx(A.IconButton,{icon:"close",size:"small",hasPadding:!1,onClick:()=>t(!1)}),f.jsx(A.Text,{variant:"bold",children:"Tags management"})]}),f.jsxs(A.Box,{gap:16,flexDirection:"column",height:"100%",children:[f.jsx(A.FormSearchInput,{value:e,onValueChange:n,placeholder:"Search for tags",endAdornment:!1,autoFocus:!0}),f.jsx(A.ErrorBoundary,{renderError:()=>f.jsx(xUe,{}),children:f.jsx(I.Suspense,{fallback:f.jsx(IUe,{}),children:f.jsx(CUe,{searchTerm:e})})})]})]})}function CUe(t){const{searchTerm:e}=t,{tags:n}=$g(),r=n.filter(i=>i.name.toLowerCase().includes(e.toLowerCase()));return r.length===0?f.jsx(A.Text,{color:"grey9",variant:"small",children:"No tags found"}):f.jsx(A.AnimatedList,{ariaLabel:"Tags list",getItemKey:i=>i.id,gap:16,items:r,children:i=>f.jsx(SUe,{tag:i})})}function SUe(t){const{tag:e}=t,[n,r]=I.useState(!1),i=Se(),{showAlert:o}=A.useAlert(),{showToast:a}=A.useToast(),{tags:s}=$g();async function l(c){if(!gj.safeParse(c).success){o({title:"Error",subtitle:`Failed to rename tag "${e.name}" to "${c}". Tag name must be at least ${vG} and at maximum ${yG} characters long.`});return}if(s.some(p=>p.name===c)){o({title:"Error",subtitle:`Failed to rename tag "${e.name}" to "${c}". Tag with name "${c}" already exists.`});return}try{await _Ue({id:e.id,name:c,config:i}),Og(p=>p.map(h=>h.id===e.id?{...h,name:c}:h)),Hc(p=>p.map(h=>{if(h.tags.findIndex(g=>g.id===e.id)!==-1){const g=h.tags.map(v=>v.id===e.id?{...v,name:c}:v);return{...h,tags:g}}return h})),a({title:`Tag "${e.name}" renamed to "${c}"`,seconds:3})}catch{o({title:"Error",subtitle:"Something went wrong when renaming the tag."})}}return f.jsxs(f.Fragment,{children:[f.jsxs(A.Box,{justifyContent:"space-between",children:[f.jsx(A.Badge,{title:e.name,color:"purple",size:"medium",onEdit:l}),f.jsx(A.Button,{invisible:!0,color:"tomato",textWeight:"normal",onClick:()=>r(!0),children:"Delete"})]}),f.jsx(wUe,{open:n,onOpenChange:r,tag:e})]})}function wUe(t){const{open:e,onOpenChange:n,tag:r}=t,{id:i,name:o,count:a}=r,s=Se(),{showAlert:l}=A.useAlert(),[c,u]=I.useState(!1);async function d(){u(!0);try{await TUe({id:i,config:s}),Og(p=>p.filter(h=>h.id!==i)),Hc(p=>p.map(h=>{if(h.tags.findIndex(g=>g.id===i)!==-1){const g=h.tags.filter(v=>v.id!==i);return{...h,tags:g}}return h}))}catch{l({title:"Error",subtitle:"Something went wrong when removing the tag."})}finally{u(!1),n(!1)}}return f.jsxs(A.Dialog,{onOpenChange:n,open:e,size:"small",children:[f.jsx(A.DialogHeader,{title:`This tag is being used on ${a} media ${nr.pluralize(a,"item")}`}),f.jsx(A.DialogDescription,{asChild:!0,children:f.jsx(A.DialogContent,{padding:16,children:f.jsxs(A.Text,{children:["You are about to delete the tag name ",f.jsx("b",{children:o}),"."," ",a>0&&`This tag is being used on ${a} media ${nr.pluralize(a,"item")} and will be deleted from ${nr.pluralize(a,"it","them")}.`]})})}),f.jsxs(A.DialogActions,{children:[f.jsx(A.DialogCancelButton,{}),f.jsx(A.DialogActionButton,{onClick:d,color:"tomato",loading:c,children:"Yes, I want to delete"})]})]})}function xUe(){const t=I.useContext(et.ErrorBoundaryContext);return f.jsx(A.Box,{flexDirection:"column",children:f.jsxs(A.BlankSlate,{children:[f.jsx(A.BlankSlateIcon,{name:"close",lineColor:"purple10",backgroundColor:"purple3",borderColor:"purple6",borderStyle:"dashed"}),f.jsx(A.BlankSlateTitle,{size:"big",children:"Oops!"}),f.jsx(A.BlankSlateDescription,{width:360,children:"We couldn't load your media tags."}),f.jsx(A.BlankSlateActions,{children:f.jsx(A.Button,{onClick:t==null?void 0:t.reset,size:"medium",children:"Try again"})})]})})}function TUe(t){const{id:e,config:n}=t;n.mediaLibrary||It("mediaLibrary");const{assetsApiBaseUrl:r,repository:i,authStrategy:o}=n;return oe.request(new URL(`tags/${e}`,r),{headers:{repository:i},method:"DELETE",credentials:oe.getRequestCredentials(o),okType:k.unknown()})}function _Ue(t){const{id:e,name:n,config:r}=t;r.mediaLibrary||It("mediaLibrary");const{assetsApiBaseUrl:i,repository:o,authStrategy:a}=r;return oe.request(new URL(`tags/${e}`,i),{headers:{repository:o},method:"PATCH",credentials:oe.getRequestCredentials(a),body:{name:n},okType:k.unknown()})}function IUe(){return f.jsx(A.Box,{flexDirection:"column",gap:16,children:_t.range(1,6).map(t=>f.jsxs(A.Box,{justifyContent:"space-between",children:[f.jsx(A.Skeleton,{height:24,width:85}),f.jsx(A.Skeleton,{height:24,width:45})]},t))})}function EUe(){const t=id(),{onFilesUpload:e,isUploading:n,tagManagerOpen:r}=kt();return t.length===0&&r===!1?f.jsx(PG,{onFilesUpload:e,isUploading:n}):f.jsx(A.Box,{flexDirection:"column",backgroundColor:"grey1",width:"100%",padding:16,gap:16,borderRadius:{topLeft:8,topRight:8},children:r?f.jsx(bUe,{}):f.jsxs(f.Fragment,{children:[f.jsx(DBe,{}),f.jsx(ZBe,{}),f.jsx(dUe,{})]})})}function RUe(){const t=Gl();return f.jsx(DG,{hasSelectedMedia:t.selectedCount!==0,children:f.jsx(EUe,{})})}const cT={all:{name:"All media",icon:"public"},image:{name:"Images",icon:"image"},video:{name:"Videos",icon:"videocam"},document:{name:"Documents",icon:"insertDriveFile"},audio:{name:"Audio files",icon:"musicNote"}},kUe=Object.entries(cT);function $Ue(){const{assetType:t,initialAssetType:e,onFilterChange:n}=kt(),[r,i]=I.useState(t);qe.useOnChange(t,()=>{i(t)});const[o,a]=I.useState(!1);function s(p){a(!1),i(p),n({assetType:p})}const{icon:l,name:c}=cT[r],u=cT[e].name,d=e!=="all";return f.jsxs(A.DropdownMenu,{open:o,onOpenChange:a,children:[f.jsx(A.DropdownMenuTrigger,{disabled:d,children:f.jsx(OUe,{icon:l,isDropdownDisabled:d,buttonName:c,tooltipAssetTypeName:u})}),f.jsx(A.DropdownMenuContent,{minWidth:256,align:"start",childrenFocusScope:!0,children:f.jsx(f.Fragment,{children:kUe.filter(([p])=>p!==r).map(([p,{icon:h,name:m}])=>f.jsx(A.DropdownMenuItem,{startIcon:f.jsx(A.Icon,{name:h}),onSelect:()=>s(p),children:m},p))})})]})}const OUe=I.forwardRef(function(e,n){const{icon:r,isDropdownDisabled:i,buttonName:o,tooltipAssetTypeName:a,...s}=e;return f.jsx(A.Tooltip,{content:`You can only pick ${(a==null?void 0:a.toLocaleLowerCase())??"this type of media"}`,visible:i,children:f.jsx(A.Button,{startIcon:r,endIcon:"arrowDropDown",size:"small",color:"grey",disabled:i,ref:n,...s,children:o})})});function MUe(t){const{optimisticTagIds:e,setOptimisticTagIds:n}=t,{onFilterChange:r}=kt(),{tags:i}=$g(),o=I.useMemo(()=>Gte.groupBy(i,s=>s.id),[i]);function a(s){const l=e.filter(c=>c!==s.id);n(l),r({tagIds:l})}return f.jsx(f.Fragment,{children:e.map(s=>{var c;const l=(c=o.get(s))==null?void 0:c[0];return l?f.jsx(A.Badge,{title:l.name,size:"medium",color:"purple",onClose:()=>a(l),selected:!0},l.id):null})})}function FUe(){const{setTagManagerOpen:t,tagIds:e,onFilterChange:n}=kt(),[r,i]=I.useState(""),[o,a]=I.useState(!1),[s,l]=I.useState(e);qe.useOnChange(JSON.stringify(e),()=>{l(e)});function c(p){a(p),p||i("")}function u(p){const h=s.includes(p.id)?e.filter(m=>m!==p.id):[...e,p.id];l(h),n({tagIds:h}),a(!1)}function d(){a(!1),t(!0)}return f.jsxs(f.Fragment,{children:[f.jsxs(A.DropdownMenu,{open:o,onOpenChange:c,children:[f.jsx(A.DropdownMenuTrigger,{children:f.jsx(A.Button,{startIcon:"label",endIcon:"arrowDropDown",size:"small",color:"grey",children:"Tags"})}),f.jsx(A.DropdownMenuContent,{minWidth:256,align:"start",border:!1,childrenFocusScope:!0,children:f.jsxs(A.ComboBox,{variant:"attached",children:[f.jsx(A.ComboBoxInput,{value:r,onValueChange:i,placeholder:"Search for a tag",autoFocus:!0}),f.jsx(A.ComboBoxContent,{paddingBlock:4,children:f.jsx(A.ErrorBoundary,{renderError:()=>f.jsx(A.Text,{color:"grey9",variant:"small",sx:{marginBlock:8,marginInline:8},children:"Error getting tags"}),children:f.jsx(I.Suspense,{fallback:f.jsx(A.Box,{padding:8,flexDirection:"column",gap:8,children:_t.range(1,6).map(p=>f.jsx(A.Skeleton,{height:24,width:85},p))}),children:f.jsx(jUe,{searchTerm:r,setSearchTerm:i,onTagToggle:u,optimisticTagIds:s})})})}),f.jsx(A.ComboboxAction,{children:f.jsx(A.Button,{invisible:!0,startIcon:"edit",textWeight:"normal",color:"dark",onClick:d,children:"Manage tags"})})]})})]}),s.length>0&&f.jsx(A.ErrorBoundary,{children:f.jsx(I.Suspense,{children:f.jsx(MUe,{optimisticTagIds:s,setOptimisticTagIds:l})})})]})}function jUe(t){const{onTagToggle:e,searchTerm:n,optimisticTagIds:r}=t,{tags:i}=$g(),o=I.useMemo(()=>{const a=n.toLowerCase();return i.filter(s=>s.name.toLowerCase().includes(a))},[i,n]);return f.jsxs(f.Fragment,{children:[!o.length&&f.jsx(A.Text,{color:"grey9",variant:"small",sx:{marginBlock:8,marginInline:8},children:"No tags found"}),o.map(a=>{const s=r.includes(a.id);return f.jsx(A.ComboBoxItem,{value:a.id,onCheckedChange:()=>e(a),checked:s,children:f.jsx(A.Badge,{title:a.name,color:"purple",sx:{marginLeft:8,marginBottom:4,marginTop:4},size:"medium"})},a.id)})]})}function LUe(){const{uploaderId:t,onFilterChange:e}=kt(),[n,r]=I.useState(""),[i,o]=I.useState(!1),[a,s]=I.useState();qe.useOnChange(t,()=>{t||s(void 0)});function l(u){o(u),u||r("")}function c(u){s(u),e({uploaderId:u==null?void 0:u.id}),o(!1)}return f.jsxs(A.DropdownMenu,{open:i,onOpenChange:l,children:[f.jsx(A.DropdownMenuTrigger,{children:f.jsx(A.Button,{startIcon:"people",renderStartIcon:u=>a?f.jsx(A.Avatar,{imageUrl:a==null?void 0:a.uploadedAvatar,firstName:a.firstName,lastName:a.lastName,size:16}):u,endIcon:"arrowDropDown",size:"small",color:"grey",children:(a==null?void 0:a.name)??"All uploaders"})}),f.jsx(A.DropdownMenuContent,{minWidth:256,align:"start",border:!1,childrenFocusScope:!0,children:f.jsxs(A.ComboBox,{variant:"attached",children:[f.jsx(A.ComboBoxInput,{value:n,onValueChange:r,placeholder:"Search for uploaders",autoFocus:!0}),f.jsx(A.ComboBoxContent,{paddingBlock:4,children:f.jsx(A.ErrorBoundary,{renderError:()=>f.jsx(A.Text,{color:"grey9",variant:"small",sx:{marginBlock:8,marginInline:8},children:"Error getting uploaders"}),children:f.jsx(I.Suspense,{fallback:f.jsx(PUe,{}),children:f.jsx(DUe,{searchTerm:n,setSearchTerm:r,onUploaderToggle:c,optimisticUploader:a})})})})]})})]})}function DUe(t){const{searchTerm:e,optimisticUploader:n,onUploaderToggle:r}=t,{uploaders:i}=TG(),o=I.useMemo(()=>{const a=e.toLowerCase();return _t.sort(i.filter(s=>{var l;return s.name.toLowerCase().includes(a)||((l=s.email)==null?void 0:l.toLowerCase().includes(a))}),s=>(n==null?void 0:n.id)===(s==null?void 0:s.id)?0:1)},[i,n,e]);return o.length?f.jsx(f.Fragment,{children:o.map(a=>{const s=a.id===(n==null?void 0:n.id);return f.jsx(A.ComboBoxItem,{value:a.id,onCheckedChange:()=>s?r():r(a),checked:s,children:f.jsxs(A.Box,{alignItems:"center",padding:{top:8,bottom:8,left:16,right:16},gap:8,children:[f.jsx(A.Avatar,{firstName:a.firstName,lastName:a.lastName,imageUrl:a.uploadedAvatar}),f.jsxs(A.Box,{display:"flex",flexDirection:"column",children:[f.jsx(A.Text,{color:"grey12",variant:"normal",children:a.name}),a.email&&f.jsx(A.Text,{color:"grey10",variant:"small",children:a.email})]})]})},a.id)})}):f.jsx(A.Text,{color:"grey9",variant:"small",sx:{marginBlock:8,marginInline:8},children:"No uploaders found"})}function PUe(){return f.jsx(A.Box,{padding:8,flexDirection:"column",gap:8,children:_t.range(1,4).map(t=>f.jsx(A.Skeleton,{height:48,width:"full"},t))})}function BUe(){const{media:t,mediaTotal:e}=kt(),n=Gl();return f.jsxs(A.Box,{alignItems:"center",gap:16,children:[n.isSelectAllEnabled&&f.jsx(A.Checkbox,{onCheckedChange:n.toggleSelectAll,checked:n.selectedCount>0,indeterminate:n.selectedCount!==e,onClick:r=>r.stopPropagation(),disabled:t.length===0}),t.length!==0&&f.jsx(BG,{count:e}),f.jsxs(A.Box,{gap:8,alignItems:"center",children:[f.jsx(A.Text,{children:"Filter:"}),f.jsx($Ue,{}),f.jsx(LUe,{}),f.jsx(FUe,{})]})]})}function QG(t){const{assetType:e,onSelectedChange:n,actionContainer:r}=t;return f.jsx(A.ErrorBoundary,{renderError:()=>f.jsx(FG,{}),children:f.jsx(I.Suspense,{fallback:f.jsx($Be,{actionContainer:r}),children:f.jsx(WY,{children:f.jsx(SBe,{assetType:e,actionContainer:r,onSelectedChange:n,children:f.jsx(EBe,{children:f.jsx(UUe,{})})})})})})}function UUe(){const{media:t}=kt(),e=kG();return f.jsx(jBe,{children:f.jsx(jG,{sidePane:e?void 0:f.jsx(RUe,{}),mediaActions:f.jsx(_Be,{}),mediaToolbar:f.jsx(BUe,{}),mediaList:t.length===0?f.jsx(xBe,{}):f.jsx(kBe,{})})})}function NUe(t){const{href:e,tracking:n}=t;return f.jsx(A.Box,{justifyContent:"center",padding:{block:6},children:f.jsxs(A.Text,{href:e,variant:"smallBold",color:"grey11",onClick:()=>void n.track({event:"shared-onboarding:follow-tutorial",source:n.source}),children:["Or watch our in-depth course",f.jsx(A.Icon,{name:"playCircle",color:"grey11",size:"small",sx:{marginLeft:4}})]})})}function WUe(t){const{step:e,stepIndex:n,isOpen:r,onActionClick:i,onClose:o,contentRef:a}=t,[s,l]=I.useState(!1),[c,u]=I.useState(t.isStepComplete);I.useEffect(()=>{r&&u(t.isStepComplete)},[t.isStepComplete,r]);async function d(){if(r)try{l(!0),await i(c)}finally{l(!1)}}return f.jsxs(A.Dialog,{open:r,onOpenChange:o,size:"small",children:[f.jsx(A.DialogHeader,{title:"Onboarding"}),f.jsxs(A.DialogContent,{children:[f.jsx(A.ScrollArea,{children:f.jsxs(A.Box,{ref:a,as:"article",flexDirection:"column",padding:16,gap:16,children:[f.jsx(A.DialogDescription,{asChild:!0,children:f.jsxs("section",{children:[f.jsxs(A.Text,{sx:{marginBottom:4},color:"purple9",variant:"bold",children:["Step ",n+1]}),f.jsx(A.Text,{variant:"h3",children:e.title}),e.content]})}),e.videoUrl&&f.jsx(A.Video,{src:e.videoUrl,sizing:"contain",borderRadius:4,autoPlay:!0,loop:!0})]})}),f.jsxs(A.DialogActions,{children:[f.jsx(A.DialogCancelButton,{size:"medium",children:"Close"}),!e.defaultCompleted&&f.jsx(A.DialogActionButton,{size:"medium",onClick:d,loading:s,color:c?"darkGrey":"purple",children:c?"Undo step":"Complete step"})]})]})]})}function KUe(t){const{steps:e,completedSteps:n,onToggleStep:r,tracking:i,stepOverrides:o}=t,[a,s]=I.useState(!1),[l,c]=I.useState(e[0]),u=I.useRef(null);if(!l)return null;const d=e.findIndex(({id:v})=>v===l.id);function p(v){return n.includes(v.id)}function h(v){c(v),s(!0),i.track({event:"shared-onboarding:step-opened",stepId:v.id,stepTitle:v.title,source:i.source})}async function m(v=!1){var b;if(l&&(await r(l),!v)){(b=u.current)==null||b.animate([{opacity:0},{opacity:1}],{duration:400});const S=g();S?h(S):s(!1)}}function g(){let v=d+1;for(;v<e.length;){const b=e[v];if(b&&!p(b))return b;v++}}return f.jsxs(f.Fragment,{children:[f.jsx(WUe,{contentRef:u,isOpen:a,step:l,stepIndex:d,isStepComplete:p(l),onClose:()=>s(!1),onActionClick:m}),f.jsxs(A.DropdownMenu,{children:[f.jsx(A.DropdownMenuTrigger,{children:f.jsx(A.Button,{size:"large",color:"grey",sx:{width:"100%"},renderStartIcon:qUe,children:n.length>0?"Continue":"Start now"})}),f.jsxs(A.DropdownMenuContent,{side:"right",minWidth:256,collisionPadding:8,children:[f.jsx(A.DropdownMenuLabel,{children:f.jsx(A.Text,{variant:"small",color:"grey11",sx:{marginInline:8},children:"Progress"})}),e.map((v,b)=>{const S=p(v);return f.jsx(A.DropdownMenuItem,{onSelect:(o==null?void 0:o[v.id])??(()=>h(v)),description:v.description,completed:S,endAdornment:f.jsx(A.Icon,{name:"chevronRight",size:"small",color:"grey11"}),children:`${b+1} ${v.title}`},v.id)})]})]})]})}function qUe(){return f.jsx(A.Icon,{name:"arrowForward",size:"small",color:"grey11"})}function VUe(t){const{steps:e,completedSteps:n,tutorialLink:r,tracking:i,onToggleStep:o,onClose:a,stepOverrides:s}=t,l=n.length===e.length;return f.jsx(A.Card,{variant:l?"elevated":"animated-light",paddingBlock:16,onClose:a,children:f.jsxs(A.CardContent,{children:[f.jsxs("div",{children:[f.jsx(A.Text,{variant:"bold",children:`Build your first page in ${e.length.toString()} simple steps`}),f.jsx(A.Text,{color:"grey11",variant:"small",children:"Render a live page with content coming from Prismic."})]}),f.jsx(A.ProgressBar,{value:n.length,max:e.length,displayLabel:!0,getValueLabel:(c,u)=>`${c}/${u}`}),f.jsx(KUe,{steps:e,completedSteps:n,onToggleStep:o,tracking:i,stepOverrides:s}),r&&f.jsx(NUe,{href:r,tracking:i})]})})}function zUe(t){const{framework:e,projectName:n,starterId:r,repositoryName:i}=t,{frameworkNameLabel:o,createProjectCodeSnippet:a}=QUe(t),s=[{id:"createPrismicProject",title:"Create your Prismic project",description:"Create and set up your project",defaultCompleted:!0,content:f.jsx(A.Text,{children:"A Prismic project is a space for managing and organizing the content of your website."})},{id:"chooseLocale",title:"Select your main locale",description:"Choose your first locale",defaultCompleted:!!r,content:f.jsx(A.Text,{children:"Locales allow you to create and manage multilingual versions of your content within a single Prismic project."})},{id:"createProject",title:`Create a ${o}project`,description:"Create and set up your project",videoUrl:"https://res.cloudinary.com/dmtf1daqp/video/upload/v1727768069/DEV_TOOLS/ONBOARDING_GUIDE/Pagebuilder_onboarding_step_3_puh6fx.mp4",content:f.jsxs(f.Fragment,{children:[f.jsx(A.Text,{sx:{marginBottom:16},children:"Now that you have a Prismic project to manage the content of your website, let's create the code project that will be querying your content."}),!!a&&f.jsx(gy,{code:`${a} ${i??"<my-project>"}`,language:"bash"}),f.jsx(A.Text,{variant:"small",sx:{marginTop:16},children:"(example for Next.js below)"})]})},{id:"setupSliceMachine",title:"Set up & run Slice Machine",description:"Prepare the code to fetch content",videoUrl:"https://res.cloudinary.com/dmtf1daqp/video/upload/v1727768069/DEV_TOOLS/ONBOARDING_GUIDE/page_builder_onboarding_step_4_yl8fb8.mp4",content:f.jsxs(f.Fragment,{children:[f.jsx(A.Text,{sx:{marginBottom:16},children:`Slice Machine is the Prismic tool for creating your content models.
68
68
  Install it in your ${o}project by running these commands:`}),f.jsx(gy,{code:`cd ${n??"<your project name>"}
69
- npx @slicemachine/init@latest --repository ${i??"<my-project>"}`,language:"bash",title:"Terminal",showLineNumbers:!1})]})},{id:"createPageType",title:"Create a Page Type",description:"Build the structure of your page",videoUrl:"https://res.cloudinary.com/dmtf1daqp/video/upload/v1721918320/DEV_TOOLS/ONBOARDING_GUIDE/Create_page_type_xdn13j.mp4",content:f.jsx(A.Text,{children:"A page type is a base content structure editors will use to create pages in the Page Builder (Prismic's content creation UI). A page type can be reusable (e.g., for multiple blog posts) or single (e.g., for a one-time page like the homepage)."})},{id:"codePage",title:"Code Your Page Type",description:"Prepare code to fetch content",videoUrl:"https://res.cloudinary.com/dmtf1daqp/video/upload/v1721918320/DEV_TOOLS/ONBOARDING_GUIDE/Step2_code_your_page_jatiur.mp4",content:f.jsx(A.Text,{children:"Prepare your code to query the content from the Prismic API."})},{id:"createSlice",title:"Create a Slice",description:"Build a reusable website section",videoUrl:"https://res.cloudinary.com/dmtf1daqp/video/upload/v1721918322/DEV_TOOLS/ONBOARDING_GUIDE/Step3_add_slice_qzmvxf.mp4",content:f.jsx(A.Text,{children:"Slices are website sections that can be reused on different pages with different content. Each slice has a code component automatically generated by Slice Machine. Start with a template and look at your code to see how it's structured."})},{id:"reviewAndPush",title:"Review and Push changes",description:"Enable editors to create content",videoUrl:"https://res.cloudinary.com/dmtf1daqp/video/upload/v1721918320/DEV_TOOLS/ONBOARDING_GUIDE/DevTools_Squad_push_changes_ovvmul.mp4",content:f.jsx(A.Text,{children:"Your page types and slices currently exist only in your local project. Push them to your repository to make them available for your content editors."})},{id:"createContent",title:"Create Content",description:"Publish a page to the Prismic API",videoUrl:"https://res.cloudinary.com/dmtf1daqp/video/upload/v1732631905/DEV_TOOLS/ONBOARDING_GUIDE/step_9_create_content_y8m3m0.mp4",content:f.jsx(A.Text,{children:"In Prismic, content creation takes place in the Prismic Page Builder UI. Open the Page Builder and start creating your first page."})},{id:"renderPage",title:"Render Your Page",description:"View your page in the browser",videoUrl:"https://res.cloudinary.com/dmtf1daqp/video/upload/v1721918321/DEV_TOOLS/ONBOARDING_GUIDE/Step_6_Render_Page_tnauh9.mp4",content:f.jsxs(A.Text,{children:["Now that your content is published, you can run your project in your terminal and visit the page on your local server (e.g.,"," ",f.jsx(A.Text,{component:"code",children:"localhost:3000/example-page"}),"). Your content should now be visible!"]})}],l={next:"https://prismic.dev/course/next",nuxt:"https://prismic.dev/course/nuxt",sveltekit:"https://prismic.dev/course/sveltekit"};return{steps:s,defaultCompletedStepIds:s.flatMap(c=>c.defaultCompleted?[c.id]:[]),tutorialLink:e?l[e]:void 0}}function QUe(t){const{framework:e}=t;if(!e||e==="other")return{frameworkNameLabel:"",createProjectCodeSnippet:""};const n=iU[e];return{frameworkNameLabel:n?`${n} `:"",createProjectCodeSnippet:oU[e]}}const kw=3e3,u2=400;function HUe(t){const{onboardingState:e,tracking:n,onToggleStep:r,onToggleGuide:i,fallback:o=null,stepOverrides:a,repositoryName:s,projectName:l}=t,{context:c,isDismissed:u}=e,{steps:d,defaultCompletedStepIds:p,tutorialLink:h}=zUe({...c,repositoryName:s,projectName:l}),m=S(e.completedSteps),g=YUe(v,u2);if(qe.useOnChange(u,()=>!u&&g.reset()),c.framework==="other")return f.jsx(f.Fragment,{children:o});function v(){i()}async function b(C){const y=await r(C.id);y.includes(C.id)&&n.track({event:"shared-onboarding:step-completed",stepId:C.id,stepTitle:C.title,source:n.source}),S(y).length===d.length&&(n.track({event:"shared-onboarding:completed",source:n.source}),g.start())}function S(C){const y=d.map(({id:x})=>x);return Array.from(new Set([...C.filter(x=>y.includes(x)),...p]))}return u?null:f.jsx(A.AnimatedElement,{enterDuration:0,exitDuration:u2,children:g.status!=="hidden"&&f.jsxs("div",{ref:g.refs.container,style:{position:"relative"},children:[f.jsx(VUe,{steps:d,completedSteps:m,tutorialLink:h,tracking:n,onToggleStep:b,onClose:g.status!=="animating"?v:void 0,stepOverrides:a}),f.jsx("div",{ref:g.refs.cannon,style:{position:"absolute",bottom:0,left:0}})]})})}function YUe(t,e=400){const n=Zte.useConfetti({config:{duration:kw}}),[r,i]=I.useState("visible"),o=I.useRef(!1),a=I.useCallback(()=>{i("animating"),setTimeout(()=>i("hidden"),kw-e),o.current||(setTimeout(t,kw),o.current=!0)},[t,e]),s=()=>{n.throwConfetti(),a()},l=I.useCallback(()=>{i("visible"),o.current=!1},[]);return{refs:{container:n.confettiContainerRef,cannon:n.confettiCannonRef},status:r,start:s,reset:l}}function HG(t){const{type:e,value:n}=t,r=e===Aa?pm.max:hm.max;return f.jsx(A.Box,{alignItems:"center",children:f.jsx(A.Tooltip,{title:GUe[e],content:XUe[e],stableMount:!0,children:f.jsx(A.Badge,{title:`${n.length} characters`,size:"medium",color:n.length>r?"tomato":"green",sx:{alignSelf:"center"}})})})}const GUe={[Aa]:"Meta title length",[Rs]:"Meta description length"},JUe=`${pm.min}-${pm.max}`,ZUe=`${hm.min}-${hm.max}`,XUe={[Aa]:`For optimal mobile SEO, keep your meta title within ${JUe} characters to prevent it from being cut off in search results.`,[Rs]:`To ensure your meta description isn’t truncated in mobile search results, aim for ${ZUe} characters. This helps improve visibility and click-through rates.`};function YG(t){const{title:e,description:n}=t;return f.jsx(A.Card,{paddingBlock:8,paddingInline:8,variant:"highlighted",children:f.jsxs(A.CardContent,{gap:4,children:[f.jsx(A.Text,{color:"indigo11",variant:"h4",noSelect:!0,children:nr.overflow(e,pm.max)}),f.jsx(A.Text,{color:"green11",noSelect:!0,children:"https://www.yourdomain.com/"}),f.jsx(A.Text,{variant:"small",color:"grey11",noSelect:!0,children:nr.overflow(n,hm.max)})]})})}const GG=I.createContext({editedUID:{current:!1},onEditUID:()=>{}});function JG(t){return Object.values(t.json).some(e=>{var n;return((n=e.uid)==null?void 0:n.type)==="UID"})}function eNe(t){const{content:e,customType:n}=t;return JG(n)&&!e.uid}function ZG(t){const{documentId:e,documentsWithUid:n,uid:r}=t;return n.filter(i=>e!==i.id&&nNe({document:i,uid:r})&&tNe({...t,document:i}))}function tNe(t){const{customTypeId:e,languageId:n,document:r}=t,i=e===r.custom_type_id,o=n===r.language.id;return i&&o}function nNe(t){const{document:e,uid:n}=t,r=e.versions.filter(i=>i.uid===n);return r.length===0?!0:r.some(i=>i.status!=="archived")}const ml=I.createContext(void 0);function rNe(t){const{customTypeFormat:e,children:n}=t,r=I.useMemo(()=>({customTypeFormat:e,isInSlice:!1,isInGroup:!1,isInRepeatable:!1}),[e]);return f.jsx(ml.Provider,{value:r,children:n})}function iNe(t){const{children:e}=t,n=I.useContext(ml),r=I.useMemo(()=>n&&{...n,isInSlice:!0},[n]);return f.jsx(ml.Provider,{value:r,children:e})}function oNe(t){const{children:e}=t,n=I.useContext(ml),r=I.useMemo(()=>n&&{...n,isInGroup:!0},[n]);return f.jsx(ml.Provider,{value:r,children:e})}function aNe(t){const{children:e}=t,n=I.useContext(ml),r=I.useMemo(()=>n&&{...n,isInRepeatable:!0},[n]);return f.jsx(ml.Provider,{value:r,children:e})}function sNe(){return I.useContext(ml)}function zC(t,e){return`${t}___${e}`}const XG=I.createContext({ids:[],isSelected:()=>!1,update:()=>{}});function QC(){return I.useContext(XG)}function Fr(t){var e;return(e=t.config)!=null&&e.label?t.config.label:t.type!=="Boolean"&&t.type!=="Separator"&&t.type!=="Table"&&t.fieldset?t.fieldset:t.type}const bj="...";function lNe(t,e,n=bj){var r,i;return(e?(r=t.config)==null?void 0:r.placeholder_true:(i=t.config)==null?void 0:i.placeholder_false)||n}function od(t,e=bj){var n;return((n=t.config)==null?void 0:n.placeholder)||e}function cNe(t){var s;const{content:e,field:n,id:r,readOnly:i,onContentChange:o}=t,a=(e==null?void 0:e.value)??((s=n.config)==null?void 0:s.default_value)??!1;return f.jsxs(A.Field,{children:[f.jsx(A.FieldIcon,{name:"biToggle"}),f.jsx(A.FieldLabel,{htmlFor:r,children:Fr(n)}),f.jsxs(A.FieldControl,{children:[f.jsx(A.Box,{padding:4,alignItems:"center",children:f.jsx(A.Text,{children:lNe(n,a)})}),f.jsx(A.Switch,{id:r,sx:{alignSelf:"center",marginLeft:"auto",marginRight:12},checked:a,onCheckedChange:l=>{i||o(uNe(l))}})]})]})}function uNe(t){return{__TYPE__:"BooleanContent",value:t}}function dNe(t){const{id:e,field:n,content:r,onContentChange:i}=t;return f.jsxs(A.Field,{children:[f.jsx(A.FieldIcon,{name:"colorLens"}),f.jsx(A.FieldLabel,{id:e,children:Fr(n)}),f.jsx(A.FieldControl,{children:f.jsx(A.Box,{padding:{left:4},alignItems:"center",children:f.jsx(A.ColorInput,{onValueChange:o=>i(fNe(o)),value:r==null?void 0:r.value,"aria-labelledby":e,placeholder:od(n)})})})]})}function fNe(t){return t===void 0?void 0:{__TYPE__:"FieldContent",type:"Color",value:t}}function pNe(t){const{id:e,readOnly:n,field:r,content:i,onContentChange:o}=t,a=i!=null&&i.value?v_.dateFromISOString(i.value):void 0;return f.jsxs(A.Field,{children:[f.jsx(A.FieldIcon,{name:"dateRange"}),f.jsx(A.FieldLabel,{id:e,children:Fr(r)}),f.jsx(A.FieldControl,{children:f.jsx(A.Box,{padding:{left:4,right:12},width:"100%",flexDirection:"column",justifyContent:"center",children:f.jsx(A.DateInput,{mode:"date","aria-labelledby":e,disabled:n,value:a,onValueChange:s=>o(hNe(s))})})})]})}function hNe(t){if(t)return{__TYPE__:"FieldContent",type:"Date",value:mNe(t)}}function mNe(t){const e=`${t.getFullYear()}`.padStart(4,"0"),n=`${t.getMonth()+1}`.padStart(2,"0"),r=`${t.getDate()}`.padStart(2,"0");return`${e}-${n}-${r}`}const Jl=I.forwardRef(function(e,n){const{padding:r=eJ,...i}=e;return f.jsx(A.TextInput,{...i,padding:r,ref:n,sx:{...e.sx,alignSelf:"stretch"}})}),eJ={input:{inline:4},adornment:{inline:12}},ANe=({provider:t})=>gNe[t.toLowerCase()]??f.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[f.jsx("g",{clipPath:"url(#clip0_6524_22412)",children:f.jsx("path",{d:"M7.99992 1.33333C4.31992 1.33333 1.33325 4.32 1.33325 8C1.33325 11.68 4.31992 14.6667 7.99992 14.6667C11.6799 14.6667 14.6666 11.68 14.6666 8C14.6666 4.32 11.6799 1.33333 7.99992 1.33333ZM2.66659 8C2.66659 7.59333 2.71992 7.19333 2.80659 6.81333L5.99325 10V10.6667C5.99325 11.4 6.59325 12 7.32658 12V13.2867C4.70658 12.9533 2.66659 10.7133 2.66659 8ZM11.9266 11.6C11.7533 11.06 11.2599 10.6667 10.6599 10.6667H9.99325V8.66667C9.99325 8.3 9.69325 8 9.32658 8H5.32658V6.66667H6.65992C7.02658 6.66667 7.32658 6.36667 7.32658 6V4.66667H8.65992C9.39325 4.66667 9.99325 4.06667 9.99325 3.33333V3.06C11.9466 3.84667 13.3333 5.76667 13.3333 8C13.3333 9.38667 12.7933 10.6533 11.9266 11.6Z",fill:"#6F6E77"})}),f.jsx("defs",{children:f.jsx("clipPath",{id:"clip0_6524_22412",children:f.jsx("rect",{width:"16",height:"16",fill:"white"})})})]}),gNe={codepen:f.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[f.jsx("g",{clipPath:"url(#clip0_6523_22409)",children:f.jsx("path",{d:"M15.9879 5.44292C15.9843 5.42352 15.981 5.40413 15.9759 5.38517C15.9726 5.37375 15.9688 5.36298 15.9651 5.35177C15.9597 5.33497 15.9541 5.31816 15.9474 5.30179C15.9427 5.29037 15.9373 5.27938 15.9321 5.26839C15.9248 5.25288 15.9173 5.23758 15.9086 5.22271C15.9026 5.21172 15.8957 5.20138 15.889 5.19082C15.8798 5.1766 15.8703 5.1626 15.8599 5.14902C15.8524 5.13889 15.8446 5.1292 15.8365 5.1195C15.8257 5.10657 15.8141 5.09429 15.8024 5.08223C15.7934 5.07318 15.7843 5.06413 15.7748 5.05529C15.7623 5.04387 15.7494 5.0331 15.7358 5.02276C15.7255 5.01479 15.7154 5.0066 15.7046 4.99927C15.7007 4.99647 15.6973 4.99324 15.6932 4.99065L8.38116 0.115543C8.15039 -0.0385144 7.84939 -0.0385144 7.61863 0.115543L0.306176 4.99044C0.302082 4.99302 0.29885 4.99626 0.294756 4.99906C0.283983 5.0066 0.273856 5.01457 0.263514 5.02254C0.250155 5.0331 0.237011 5.04387 0.224515 5.05486C0.215034 5.06348 0.205985 5.07253 0.19715 5.0818C0.185084 5.09386 0.17388 5.10614 0.162892 5.11907C0.154704 5.12877 0.146947 5.13846 0.139406 5.14924C0.129064 5.16281 0.119583 5.1766 0.110318 5.19104C0.103639 5.20159 0.0969593 5.21194 0.0907108 5.22293C0.0820922 5.23779 0.0745509 5.25309 0.0674405 5.26817C0.0622694 5.27916 0.0566673 5.29037 0.0521425 5.30157C0.0454631 5.31795 0.0396456 5.33475 0.0342589 5.35156C0.030596 5.36276 0.0267177 5.37375 0.0237011 5.38388C0.0187455 5.40284 0.0150825 5.42201 0.0116351 5.44162C0.00969592 5.45153 0.00732581 5.46123 0.00603302 5.47136C0.00215465 5.50109 0 5.53082 0 5.56121V10.4372C0 10.4673 0.00215465 10.4975 0.00646395 10.527C0.00797221 10.5378 0.0107733 10.5464 0.0129279 10.5568C0.0163753 10.5762 0.0193919 10.5955 0.0258558 10.6149C0.0288723 10.6257 0.0323198 10.6365 0.0366291 10.6483C0.0420157 10.6656 0.0474023 10.6828 0.0538662 10.6985C0.058391 10.7093 0.0646395 10.7201 0.0689488 10.7309C0.0760591 10.7459 0.0840314 10.761 0.09265 10.7768C0.098683 10.7875 0.105578 10.7983 0.112042 10.8082C0.121307 10.8233 0.131434 10.8362 0.142207 10.8491C0.149748 10.8599 0.157289 10.8685 0.165908 10.8789C0.176897 10.8918 0.187455 10.9047 0.200382 10.9162C0.209217 10.9248 0.21762 10.9355 0.228393 10.942C0.24089 10.9528 0.254249 10.9636 0.267177 10.9748C0.277519 10.9834 0.288723 10.9898 0.297342 10.9982C0.301436 11.0004 0.303806 11.0047 0.308115 11.0067L7.61863 15.8841C7.73412 15.9617 7.86641 16.0005 8 15.9998C8.13359 15.9992 8.26588 15.9611 8.38137 15.8841L15.6938 11.0092C15.6979 11.0067 15.7014 11.0036 15.7052 11.0008C15.716 10.9933 15.7261 10.9853 15.7365 10.9773C15.7498 10.9668 15.763 10.9558 15.7755 10.9446C15.785 10.9362 15.794 10.9269 15.8031 10.9179C15.8149 10.9058 15.8263 10.8935 15.8371 10.8806C15.8453 10.8709 15.8531 10.8612 15.8606 10.8509C15.8709 10.8373 15.8804 10.8233 15.8897 10.8091C15.8964 10.7987 15.903 10.7882 15.9093 10.7776C15.9179 10.7625 15.9254 10.7472 15.9328 10.7317C15.9379 10.7207 15.9433 10.7097 15.9481 10.6985C15.9548 10.6819 15.9604 10.6651 15.9657 10.6483C15.9694 10.6371 15.9733 10.6261 15.9765 10.6149C15.9815 10.596 15.9849 10.5766 15.9886 10.5572C15.9903 10.5473 15.9929 10.5376 15.994 10.5275C15.9978 10.4977 16 10.468 16 10.4376V5.5625C16 5.53212 15.9976 5.50238 15.994 5.47265C15.9922 5.46209 15.989 5.45347 15.9869 5.44292H15.9879ZM7.99978 9.62638L5.56826 8.00005L7.99978 6.37351L10.4315 8.00005L7.99978 9.62638ZM7.31245 5.17919L4.33171 7.17288L1.92561 5.56336L7.31245 1.97221V5.17919ZM3.09515 7.99984L1.37531 9.15021V6.84947L3.09515 7.99984ZM4.33171 8.82765L7.31245 10.8211V14.0281L1.92561 10.4365L4.33171 8.82722V8.82765ZM8.68733 10.8207L11.6681 8.82722L14.0744 10.4365L8.68733 14.0277V10.8207ZM12.9046 8.00027L14.6247 6.84969V9.15064L12.9046 7.99984V8.00027ZM11.6681 7.17288L8.68733 5.1794V1.97221L14.0744 5.56336L11.6681 7.17288Z",fill:"black"})}),f.jsx("defs",{children:f.jsx("clipPath",{id:"clip0_6523_22409",children:f.jsx("rect",{width:"16",height:"16",fill:"white"})})})]}),codesandbox:f.jsxs("svg",{width:"14",height:"16",viewBox:"0 0 14 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[f.jsx("g",{clipPath:"url(#clip0_6523_22406)",children:f.jsx("path",{d:"M6.24312 14.1129V8.35021L1.28724 5.49888V8.78388L3.55732 10.0999V12.5702L6.24312 14.1129ZM7.53036 14.1468L10.2658 12.571V10.0422L12.5506 8.71812V5.47426L7.53036 8.3727V14.1468ZM11.8904 4.36906L9.25164 2.83995L6.93472 4.18436L4.60022 2.8386L1.93795 4.38817L6.90626 7.24665L11.8904 4.36906ZM0 12.0115V4.02675L6.91821 0L13.8378 4.00984V11.9988L6.91805 15.985L0 12.0115Z",fill:"black"})}),f.jsx("defs",{children:f.jsx("clipPath",{id:"clip0_6523_22406",children:f.jsx("rect",{width:"13.8378",height:"16",fill:"white"})})})]}),dailymotion:f.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[f.jsxs("g",{clipPath:"url(#clip0_6523_22345)",children:[f.jsx("path",{d:"M16 0H0V16H16V0Z",fill:"white"}),f.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.73038 10.3003C8.40789 10.6268 8.00377 10.7901 7.51804 10.7901C7.04025 10.7901 6.64411 10.6308 6.32956 10.3122C6.01503 9.99367 5.85776 9.58351 5.85776 9.08176C5.85776 8.60389 6.01901 8.20766 6.3415 7.89306C6.66401 7.57847 7.06016 7.42118 7.52998 7.42118C7.84849 7.42118 8.13715 7.49484 8.39594 7.64219C8.65474 7.78953 8.8558 7.99063 8.99913 8.2455C9.14246 8.50034 9.21412 8.77908 9.21412 9.08176C9.21412 9.56757 9.05287 9.97376 8.73038 10.3003ZM9.10662 3.58632V6.35792C8.82791 6.07918 8.53131 5.87808 8.21678 5.75463C7.90223 5.63118 7.54988 5.56946 7.1597 5.56946C6.53062 5.56946 5.96527 5.72476 5.4636 6.03538C4.96193 6.34597 4.57176 6.77007 4.29305 7.30768C4.01435 7.84528 3.875 8.44062 3.875 9.09369C3.875 9.76269 4.01236 10.366 4.28708 10.9036C4.5618 11.4412 4.95197 11.8653 5.45763 12.1759C5.96328 12.4865 6.54258 12.6418 7.19553 12.6418C8.14312 12.6418 8.80403 12.3312 9.17831 11.71H9.20218V12.5595H11.0894V3.15625L9.10662 3.58632Z",fill:"#232323"})]}),f.jsx("defs",{children:f.jsx("clipPath",{id:"clip0_6523_22345",children:f.jsx("rect",{width:"16",height:"16",fill:"white"})})})]}),flickr:f.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[f.jsx("rect",{width:"16",height:"16",fill:"white"}),f.jsxs("g",{clipPath:"url(#clip0_6523_22379)",children:[f.jsx("path",{d:"M8.43286 7.78387C8.43286 9.321 9.67925 10.5674 11.2166 10.5674C12.7538 10.5674 13.9999 9.321 13.9999 7.78387C13.9999 6.24675 12.7538 5.00061 11.2166 5.00061C9.67925 5.00061 8.43286 6.24675 8.43286 7.78387Z",fill:"#FF0084"}),f.jsx("path",{d:"M2 7.78408C2 9.32121 3.24614 10.5676 4.78352 10.5676C6.32089 10.5676 7.56703 9.32121 7.56703 7.78408C7.56703 6.24695 6.32089 5.00081 4.78352 5.00081C3.24614 5.00081 2 6.24695 2 7.78408Z",fill:"#0063DC"})]}),f.jsx("defs",{children:f.jsx("clipPath",{id:"clip0_6523_22379",children:f.jsx("rect",{width:"12",height:"5.568",fill:"white",transform:"translate(2 5)"})})})]}),giphy:f.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[f.jsx("rect",{width:"16",height:"16",fill:"#121212"}),f.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4 3.38889V12.2778H5.11111V3.38889H4Z",fill:"#00FF99"}),f.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.6663 5.61111V12.2778H11.7774V5.61111H10.6663Z",fill:"#9933FF"}),f.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.75 3H4V4.11111H8.83333V3H7.75Z",fill:"#FFF35C"}),f.jsx("path",{d:"M9.00041 4.11111H7.33374H8.83374V3.77778L9.00041 4.11111Z",fill:"#999999"}),f.jsx("path",{d:"M8.83374 4.11111H7.33374L8.44485 3L8.83374 3.77778V4.11111Z",fill:"#999237"}),f.jsx("path",{d:"M10.6663 7.44444V5.77778L11.7774 6.33333L10.6663 7.44444Z",fill:"#5C1F99"}),f.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.6667 11.8889H4V13H11.7778V11.8889H10.6667Z",fill:"#00CCFF"}),f.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.6668 5.22222V4.11111H9.55569V3H8.44458V3.90739V5.0185V6.33333H9.55569H10.6668H11.7779V5.22222H10.6668Z",fill:"#FF6666"})]}),instagram:f.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",children:[f.jsxs("g",{clipPath:"url(#clip0_6523_22356)",children:[f.jsx("mask",{id:"mask0_6523_22356",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"16",height:"16",children:f.jsx("path",{d:"M4.70325 0.0949238C3.85627 0.1349 3.27778 0.270564 2.77227 0.468642C2.24897 0.672648 1.80537 0.946046 1.36408 1.38914C0.922279 1.83249 0.650958 2.27688 0.448504 2.8007C0.252489 3.3075 0.119662 3.88627 0.0822604 4.73377C0.045126 5.58283 0.0366102 5.85363 0.0407495 8.01522C0.0448729 10.1765 0.0544124 10.4479 0.0949012 11.2972C0.135388 12.1439 0.270546 12.7222 0.468623 13.2279C0.672886 13.7512 0.946004 14.1946 1.38935 14.6361C1.83245 15.0777 2.27708 15.3487 2.80115 15.5515C3.30744 15.7472 3.88644 15.8806 4.73369 15.9177C5.58273 15.9551 5.85379 15.9634 8.01483 15.9592C10.1769 15.9551 10.448 15.9456 11.297 15.9053C12.144 15.8648 12.722 15.7292 13.228 15.5316C13.7513 15.3268 14.1949 15.0542 14.6362 14.6109C15.0775 14.1678 15.3488 13.7231 15.5512 13.199C15.7473 12.6927 15.8806 12.1137 15.9175 11.267C15.9546 10.4174 15.9634 10.1461 15.9593 7.98478C15.9551 5.8232 15.9453 5.55239 15.9051 4.7036C15.8649 3.85609 15.7292 3.27811 15.5314 2.77208C15.3269 2.24877 15.054 1.80567 14.6109 1.36387C14.1678 0.922574 13.7232 0.650729 13.1991 0.448785C12.6926 0.252768 12.1138 0.119166 11.2666 0.0825425C10.4175 0.0448876 10.1465 0.0366393 7.98465 0.0407642C5.82336 0.0448892 5.5523 0.0541772 4.70325 0.0949238ZM4.79611 14.485C4.02004 14.4512 3.59863 14.3222 3.31776 14.2142C2.94585 14.0703 2.68046 13.8977 2.40114 13.6205C2.12234 13.3422 1.94928 13.0776 1.80408 12.7064C1.69497 12.4255 1.5637 12.0046 1.52734 11.2286C1.48788 10.3896 1.47886 10.1378 1.47498 8.01237C1.47086 5.88742 1.47859 5.63569 1.51522 4.79593C1.54848 4.02038 1.67822 3.59843 1.78602 3.31782C1.92993 2.94539 2.10196 2.68051 2.37973 2.4012C2.65801 2.12187 2.92263 1.94933 3.29402 1.80412C3.57463 1.69451 3.99555 1.56426 4.77134 1.52738C5.61084 1.48766 5.8623 1.47915 7.98723 1.47502C10.1127 1.47089 10.3644 1.47838 11.2042 1.51526C11.9797 1.54904 12.4016 1.67749 12.682 1.78607C13.0541 1.92998 13.3195 2.1015 13.5986 2.37979C13.8777 2.65808 14.0507 2.92218 14.1959 3.29435C14.3055 3.57418 14.4358 3.99562 14.4724 4.77117C14.5124 5.61068 14.5214 5.8624 14.5253 7.98736C14.5294 10.1128 14.5217 10.3646 14.4848 11.2038C14.451 11.9799 14.3223 12.4016 14.214 12.6827C14.0701 13.0543 13.898 13.3197 13.62 13.5991C13.342 13.8773 13.0774 14.0509 12.7057 14.1961C12.4256 14.3055 12.0042 14.436 11.2289 14.4729C10.3894 14.5123 10.1379 14.5214 8.01225 14.5252C5.88732 14.5294 5.63586 14.5214 4.79611 14.485ZM11.2854 3.74493C11.2864 4.27211 11.7151 4.69896 12.2422 4.69792C12.7697 4.69689 13.1965 4.2685 13.1957 3.74132C13.1947 3.21414 12.7661 2.78704 12.2386 2.78807C11.7112 2.7891 11.2844 3.21775 11.2854 3.74493ZM3.91277 8.00773C3.91714 10.2653 5.75063 12.0913 8.0076 12.0869C10.2648 12.0825 12.0919 10.2495 12.0875 7.99201C12.0831 5.73526 10.2494 3.90819 7.99188 3.91257C5.73489 3.91696 3.90837 5.75073 3.91277 8.00773ZM5.34648 8.0049C5.3439 6.53969 6.52978 5.34942 7.99471 5.34683C9.45991 5.344 10.6504 6.52937 10.6533 7.99484C10.6561 9.46031 9.47022 10.6503 8.00477 10.6532C6.53984 10.656 5.34932 9.47037 5.34648 8.0049Z",fill:"white"})}),f.jsxs("g",{mask:"url(#mask0_6523_22356)",children:[f.jsx("mask",{id:"mask1_6523_22356",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"-1",y:"-1",width:"18",height:"18",children:f.jsx("path",{d:"M16.5905 -0.583628H-0.603516V16.6106H16.5905V-0.583628Z",fill:"white"})}),f.jsxs("g",{mask:"url(#mask1_6523_22356)",children:[f.jsx("mask",{id:"mask2_6523_22356",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"-1",y:"-1",width:"18",height:"18",children:f.jsx("path",{d:"M16.6701 -0.663237H-0.683105V16.6902H16.6701V-0.663237Z",fill:"white"})}),f.jsxs("g",{mask:"url(#mask2_6523_22356)",children:[f.jsx("mask",{id:"mask3_6523_22356",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"-1",y:"-1",width:"18",height:"18",children:f.jsx("path",{d:"M16.6701 -0.663237H-0.683105V16.6902H16.6701V-0.663237Z",fill:"white"})}),f.jsx("g",{mask:"url(#mask3_6523_22356)",children:f.jsx("rect",{x:"-0.688721",y:"-0.665792",width:"17.3622",height:"17.3622",fill:"url(#pattern0)"})})]})]})]})]}),f.jsxs("defs",{children:[f.jsx("pattern",{id:"pattern0",patternContentUnits:"objectBoundingBox",width:"1",height:"1",children:f.jsx("use",{xlinkHref:"#image0_6523_22356",transform:"scale(0.000439947)"})}),f.jsx("clipPath",{id:"clip0_6523_22356",children:f.jsx("rect",{width:"16",height:"16",fill:"white"})}),f.jsx("image",{id:"image0_6523_22356",width:"2273",height:"2275",xlinkHref:"data:image/jpeg;base64,/9j/4AAQSkZJRgABAgEAlgCWAAD/7AARRHVja3kAAQAEAAAAHgAA/+4AIUFkb2JlAGTAAAAAAQMAEAMCAwYAAFokAABijgAAd23/2wCEABALCwsMCxAMDBAXDw0P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FiwBYsoCBUsoFgEstSiCosVKILYBLFSqgWLKSxQqBYsEq2AgWLKSxUqoFgIstSy1KILYKixUspLLQqBYspLLQILUsoFgpLLQILUsoBKtgEsoFCoAKSxQApKIALQAEogAAAAPXfD7/DjcMNWQAAAACgAAAACABBQAAAAAogAAAsAAAgoAALEogAAoAAEgoAAAKSiABAAApFEUAJRFEURRFEAAlVFigRRAJVsAlgFsWALAJZQLBSWKFQKlglWwEWKlVAsFRYqUQWxYJZalECxZSWKlEFsBFlqWCVbAQWwVFipZalVBbARZallAsFJZaBBallAQWpZQLBQEFqVUChUWAAWwAAUlgCgBQAEURYAAeu+H3+HF4Ya8gCiKAAAAAAQAWJQAAAAAFJRAAAgUAABBQAAIUQAAoACQAUAAAUQAIAAAKAAAQAAAAAAFSiACosUBKIBLLQIsUKgEsUKgVLALYBLLQICLLUogWLKSlgqBYsEq2AgtiwSxQqBYKSxUsUKgWCostSwSrYKgWC2LKSy1KILYspKWCospKWCostAgtSygIstAiygVKqAASy0AAKgAUAKAAAAA9d8Pv8OLwg15gAAAAAAgAsSgAAAAAAKgAAAQUAAAgCgAELKgACgAEgCgAAAogQAAKSgAACAFAAACURRFEWACUsWACVUCxYBbFglECpZQLBSWALBSWKBBalgCwVFipVQLAJZalgFsAlipZQLBUCpYJZaBBbAqWUlipVQWwEFsWUllqWKFQUlihUFqWAWwUlihUFqWAUlihSWAWgRZQAWwAACVUACgAABQAHrvh9/hxeEGvMAAAEAAAKgAAAAAABZUAAACFAAAEAUAAgUBABQAJAFAAABRAgABQABAABSUAgAAAAAAKiwABYsAIstAgEq2ASxQqASxQqBUsAtgEsUKgEstSwBYLYsEstAgWCksUKgWASy1LALYCC2ASy1KILYFiykstSykpYKgtSwC2CoLUsAtiykpYKgoFgpKWCgIKBUsoACLLQAAEqoAFAAAAA9d8Pv8ONwg15gAgAAACkAAAAAAAAKIAAEKAAAIAKAABFCAAKAASAUAACiBAACygAIAKSgEAAAAAAAAAJVQACWKAllAsWAWwCUQWx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1aw9WsPVrD1aw9WsPVrD1aw9WsPVrB34/8Ay/z/AH/53yHY/wDU/E/0v+P7/wCz/9k="})]})]}),pinterest:f.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[f.jsxs("g",{clipPath:"url(#clip0_6570_25513)",children:[f.jsx("rect",{width:"15.996",height:"16",rx:"2",fill:"#CC2127"}),f.jsx("path",{d:"M7.999 2C4.68555 2 2 4.68555 2 7.999C2 10.5406 3.58174 12.7102 5.81336 13.5861C5.76137 13.1121 5.71338 12.3843 5.83336 11.8644C5.94134 11.3964 6.53724 8.88285 6.53724 8.88285C6.53724 8.88285 6.35727 8.52291 6.35727 7.993C6.35727 7.15914 6.84119 6.53524 7.44309 6.53524C7.95501 6.53524 8.20297 6.91918 8.20297 7.3811C8.20297 7.89502 7.87502 8.66489 7.70705 9.37877C7.56507 9.97667 8.007 10.4626 8.5949 10.4626C9.66072 10.4626 10.4806 9.33878 10.4806 7.71505C10.4806 6.27929 9.44876 5.27345 7.975 5.27345C6.26729 5.27345 5.26546 6.55324 5.26546 7.87702C5.26546 8.39293 5.46342 8.94484 5.71138 9.24679C5.75937 9.30678 5.76737 9.35877 5.75337 9.41876C5.70738 9.60873 5.6074 10.0167 5.5874 10.0987C5.56141 10.2086 5.50142 10.2326 5.38743 10.1786C4.63756 9.83069 4.16964 8.73488 4.16964 7.85502C4.16964 5.96334 5.54541 4.22563 8.13298 4.22563C10.2146 4.22563 11.8304 5.70938 11.8304 7.69105C11.8304 9.75871 10.5266 11.4224 8.71688 11.4224C8.10898 11.4224 7.53708 11.1065 7.34111 10.7345C7.34111 10.7345 7.04116 11.8804 6.96717 12.1603C6.83119 12.6822 6.46526 13.3341 6.2213 13.732C6.7832 13.906 7.3791 14 7.997 14C11.3104 14 13.996 11.3144 13.996 8.001C13.998 4.68555 11.3124 2 7.999 2Z",fill:"white"})]}),f.jsx("defs",{children:f.jsx("clipPath",{id:"clip0_6570_25513",children:f.jsx("rect",{width:"16",height:"16",fill:"white"})})})]}),spotify:f.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[f.jsx("g",{clipPath:"url(#clip0_6523_22402)",children:f.jsx("path",{d:"M12.6609 7.10585C10.121 5.59751 5.93158 5.45882 3.50697 6.1947C3.11759 6.31287 2.70584 6.09298 2.5879 5.70373C2.46988 5.31411 2.68945 4.90265 3.07911 4.78429C5.86241 3.93945 10.4892 4.1026 13.4132 5.83828C13.7634 6.04622 13.8782 6.49851 13.6707 6.84813C13.4629 7.19833 13.0103 7.31376 12.6609 7.10585ZM12.5777 9.33993C12.3995 9.62908 12.0215 9.71979 11.7327 9.54223C9.61522 8.24063 6.38637 7.86357 3.88123 8.624C3.55636 8.72218 3.21323 8.53899 3.11455 8.21475C3.01666 7.88989 3.19992 7.54738 3.5242 7.44859C6.38597 6.58018 9.9436 7.00081 12.3756 8.49536C12.6644 8.67322 12.7553 9.05146 12.5777 9.33993ZM11.6136 11.4855C11.472 11.7177 11.1697 11.7904 10.9383 11.6489C9.08801 10.518 6.75909 10.2627 4.01637 10.8891C3.75207 10.9497 3.48866 10.7841 3.42838 10.5198C3.36785 10.2556 3.53284 9.99217 3.79772 9.93186C6.79916 9.2457 9.37381 9.54101 11.4506 10.8101C11.6822 10.9515 11.7551 11.254 11.6136 11.4855ZM8.00002 0.120623C3.64839 0.120623 0.120605 3.64834 0.120605 7.99989C0.120605 12.352 3.64839 15.8794 8.00002 15.8794C12.3517 15.8794 15.8794 12.352 15.8794 7.99989C15.8794 3.64834 12.3517 0.120623 8.00002 0.120623Z",fill:"#1ED760"})}),f.jsx("defs",{children:f.jsx("clipPath",{id:"clip0_6523_22402",children:f.jsx("rect",{width:"16",height:"16",fill:"white"})})})]}),twitter:f.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:f.jsx("path",{d:"M14.3193 4.31285C14.329 4.45301 14.329 4.59317 14.329 4.73462C14.329 9.04475 11.0516 14.0156 5.05865 14.0156V14.0131C3.28832 14.0156 1.55478 13.508 0.0644531 12.5507C0.321873 12.5817 0.580582 12.5972 0.839937 12.5979C2.30703 12.5992 3.7322 12.1063 4.88639 11.1988C3.4922 11.1724 2.26961 10.2623 1.84252 8.93366C2.3309 9.02796 2.83413 9.00858 3.31349 8.87746C1.79349 8.57001 0.699937 7.23299 0.699937 5.68023C0.699937 5.66602 0.699937 5.65246 0.699937 5.63889C1.15284 5.89144 1.65994 6.0316 2.17865 6.0471C0.747034 5.08923 0.305743 3.18251 1.17026 1.69176C2.82445 3.7296 5.2651 4.96844 7.8851 5.09956C7.62252 3.96664 7.98123 2.77947 8.82768 1.98307C10.1399 0.748096 12.2038 0.811395 13.4374 2.12452C14.167 1.98048 14.8664 1.71243 15.5064 1.33264C15.2632 2.0877 14.7541 2.72909 14.0741 3.13665C14.7199 3.06044 15.3509 2.88734 15.9451 2.62316C15.5077 3.2794 14.9567 3.85103 14.3193 4.31285Z",fill:"#1D9BF0"})}),vimeo:f.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[f.jsxs("g",{clipPath:"url(#clip0_6523_22340)",children:[f.jsx("path",{d:"M16 14.4C16 15.28 15.28 16 14.4 16H1.6C0.72 16 0 15.28 0 14.4V1.6C0 0.72 0.72 0 1.6 0H14.4C15.28 0 16 0.72 16 1.6V14.4Z",fill:"#1AB7EA"}),f.jsx("path",{d:"M13.9945 5.3084C13.9391 6.42815 13.1229 7.97447 11.5458 9.93402C9.91331 11.9736 8.52987 13 7.40928 13C6.70372 13 6.12267 12.3735 5.63846 11.1338C5.32027 9.98735 4.98824 8.85427 4.67005 7.70786C4.31036 6.46814 3.92299 5.84161 3.50796 5.84161C3.42495 5.84161 3.10676 6.02824 2.56721 6.38816L2 5.68165C2.59488 5.1751 3.17593 4.68187 3.75698 4.17532C4.54554 3.52214 5.14042 3.17555 5.54162 3.13556C6.46853 3.05557 7.04958 3.66877 7.27093 4.97514C7.50612 6.40149 7.67213 7.28129 7.75514 7.62788C8.01799 8.80095 8.32235 9.40081 8.64054 9.40081C8.88956 9.40081 9.26309 9.01423 9.77497 8.2544C10.273 7.49457 10.5497 6.90804 10.5774 6.50813C10.6465 5.85494 10.3837 5.52169 9.77497 5.52169C9.48444 5.52169 9.19392 5.58834 8.88956 5.70831C9.48444 3.84206 10.605 2.94893 12.2652 3.00225C13.4826 3.02891 14.0637 3.80207 13.9945 5.3084Z",fill:"white"})]}),f.jsx("defs",{children:f.jsx("clipPath",{id:"clip0_6523_22340",children:f.jsx("rect",{width:"16",height:"16",fill:"white"})})})]}),youtube:f.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[f.jsx("path",{d:"M15.6656 3.75817C15.4816 3.06609 14.9395 2.5211 14.2511 2.33614C13.0034 2 8 2 8 2C8 2 2.99666 2 1.7489 2.33614C1.06051 2.5211 0.518324 3.06609 0.334339 3.75817C0 5.01251 0 7.62963 0 7.62963C0 7.62963 0 10.2467 0.334339 11.5012C0.518324 12.1932 1.06051 12.7381 1.7489 12.9232C2.99666 13.2593 8 13.2593 8 13.2593C8 13.2593 13.0034 13.2593 14.2511 12.9232C14.9395 12.7381 15.4816 12.1932 15.6656 11.5012C16 10.2467 16 7.62963 16 7.62963C16 7.62963 16 5.01251 15.6656 3.75817Z",fill:"#ED1D24"}),f.jsx("path",{d:"M6.36353 10.0058L10.5453 7.62974L6.36353 5.25349V10.0058Z",fill:"white"})]})};function tJ(t){const{debouncedUrl:e,content:n,onContentChange:r,selected:i}=t,o=I.useRef(null),[a,s]=I.useState(!1);qe.useOnChange(e,()=>{var c;a&&(s(!1),(c=o.current)==null||c.reset())});function l(){s(!0),r(void 0)}return pi.toURL(e)?e===(n==null?void 0:n.embed_url)?f.jsx(uT,{content:n,selected:i}):f.jsx(A.ErrorBoundary,{ref:o,renderError:vNe,onError:l,children:f.jsx(I.Suspense,{fallback:n&&f.jsx(uT,{content:n,selected:i}),children:f.jsx(yNe,{url:e,selected:i,onContentChange:r})})}):null}function vNe(){return f.jsxs(A.Box,{backgroundColor:"grey2",borderRadius:6,padding:16,gap:4,children:[f.jsx(A.Icon,{name:"alert",size:"small",color:"grey11"}),f.jsx(A.Text,{variant:"smallBold",color:"grey11",children:"There is no embed data available."})]})}function uT(t){const{content:e,selected:n}=t,{thumbnail:r,provider:i,author:o,url:a,subtitle:s}=wNe(e);return f.jsxs(A.PreviewCard,{selected:n,children:[f.jsx(A.PreviewImage,{src:r.url,aspectRatio:r.aspectRatio}),f.jsxs(A.PreviewContent,{children:[f.jsxs(A.Box,{display:"flex",alignItems:"center",gap:4,children:[f.jsx(ANe,{provider:i}),f.jsx(A.Text,{variant:"smallBold",color:"grey12",noWrap:!0,children:i}),o&&f.jsx(A.Text,{variant:"small",color:"grey11",noWrap:!0,children:o})]}),f.jsx(A.Text,{variant:"smallBold",href:a,children:s})]})]})}function yNe(t){const{url:e,onContentChange:n,selected:r}=t,i=bNe({url:e,onContentChange:n});return f.jsx(uT,{content:i,selected:r})}function bNe(t){const{url:e,onContentChange:n}=t,{embedApiEndpoint:r}=Se(),i=et.useRequest(CNe,[e,r]),o=qe.useStableCallback(n);return I.useEffect(()=>{o(i)},[i,o]),i}function CNe(t,e){const n=new URL(e);return n.searchParams.set("url",t),oe.request(n,{okType:SNe(t)})}function SNe(t){return k.object({type:k.string(),version:k.string().or(k.number()).nullish(),title:k.string().nullish(),author_name:k.string().nullish(),author_url:k.string().nullish(),provider_name:k.string().nullish(),provider_url:k.string().nullish(),cache_age:k.string().or(k.number()).nullish(),thumbnail_url:k.string().nullish(),thumbnail_width:k.number().nullish(),thumbnail_height:k.number().nullish(),html:k.string().nullish()}).passthrough().transform(e=>{const n={embed_url:t};return{...n,__TYPE__:"EmbedContent",type:e.type,version:e.version,title:e.title,author_name:e.author_name,author_url:e.author_url,provider_name:e.provider_name,provider_url:e.provider_url,cache_age:e.cache_age,thumbnail_url:e.thumbnail_url,thumbnail_width:e.thumbnail_width,thumbnail_height:e.thumbnail_height,html:e.html,all:{...n,...e}}})}function wNe(t){let e="";switch(t.type){case"video":e=t.title??"";break;case"photo":e=`View this post${t.provider_name?` on ${t.provider_name}`:""}`;break;default:e=`Open${t.provider_name?` on ${t.provider_name}`:""}`}return{url:t.embed_url,thumbnail:{url:t.thumbnail_url??"",aspectRatio:t.type==="video"?"16:9":"1:1"},provider:t.provider_name??"",author:t.author_name??"",subtitle:e}}function xNe(t){const{id:e,readOnly:n,field:r,content:i,onContentChange:o}=t,a=qe.useDebounceState({initialState:(i==null?void 0:i.embed_url)??"",startTransition:I.startTransition});function s(l){a.set(l),pi.toURL(l)||o(void 0)}return f.jsxs(A.Field,{footer:pi.toURL(a.value)&&f.jsx(A.FieldFooter,{children:f.jsx(tJ,{debouncedUrl:a.debouncedValue,content:i,onContentChange:o})}),children:[f.jsx(A.FieldIcon,{name:"cloud"}),f.jsx(A.FieldLabel,{htmlFor:e,children:Fr(r)}),f.jsx(A.FieldControl,{children:f.jsx(Jl,{id:e,readOnly:n,placeholder:od(r),value:a.value,onValueChange:s,variant:pi.toURL(a.value)?"link":"normal",endAdornment:f.jsx(A.Button,{startIcon:"close",color:"grey",size:"small",disabled:!a,onClick:()=>s("")})})})]})}function nJ(t){return!(t.lat>85||t.lat<-85||t.lng>180||t.lng<-180)}function $w(t){const e=/^.*@(-?\d+.\d+),(-?\d+.\d+).*$/,n=t.match(e);if(!n)return;const r=parseFloat(n[1]??""),i=parseFloat(n[2]??"");if(isNaN(r)||isNaN(i))return;const o={lat:r,lng:i};if(nJ(o))return o}function d2(t){return t?`${t.lat}, ${t.lng}`:""}function f2(t){const e=/\(?([\d|.|-]*)[\s+]*,[\s]*([\d|.|-]*)\)?/,n=t.match(e);if(!n)return $w(t);const r=parseFloat(n[1]??""),i=parseFloat(n[2]??"");if(isNaN(r)||isNaN(i))return $w(t);const o={lat:r,lng:i};return nJ(o)?o:$w(t)}function TNe(t){const{field:e,id:n,readOnly:r,...i}=t,{onValueChange:o,displayedValue:a,onBlur:s,clearValue:l,isValidCoordinates:c}=_Ne(i);return f.jsxs(A.Field,{children:[f.jsx(A.FieldIcon,{name:"place"}),f.jsx(A.FieldLabel,{htmlFor:n,children:Fr(e)}),f.jsx(A.FieldControl,{children:f.jsx(Jl,{id:n,onValueChange:o,placeholder:bj,readOnly:r,value:a,onBlur:s,variant:c?"link":"normal",endAdornment:f.jsx(A.Button,{startIcon:"close",color:"grey",size:"small",disabled:!a,onClick:l})})})]})}function _Ne(t){const{content:e,onContentChange:n}=t,r=d2(e==null?void 0:e.position),[i,o]=I.useState(r);function a(){const c=f2(i);if(!c)return o(""),n(void 0);const{lat:u,lng:d}=c;o(d2({lat:u,lng:d})),n({__TYPE__:"GeoPointContent",position:{lat:u,lng:d}})}function s(){o(""),n(void 0)}const l=!!f2(i);return{displayedValue:i,isValidCoordinates:l,onValueChange:o,onBlur:a,clearValue:s}}function rJ(t){const{fieldLabel:e,imageLabel:n=[]}=t;return f.jsxs(A.CardHeaderTitle,{children:[f.jsx(A.Text,{variant:"bold",noWrap:!0,children:nr.overflow(e,30)}),n.length!==0&&f.jsx(A.Text,{color:"grey11",noSelect:!0,children:` • ${n.join(" • ")}`})]})}function iJ(t){const{fieldLabel:e,isUpdating:n,readOnly:r,onMediaDialogOpenChange:i}=t;return f.jsxs(f.Fragment,{children:[f.jsx(A.CardHeader,{sx:{flexWrap:"wrap"},children:f.jsx(rJ,{fieldLabel:e})}),f.jsx(A.CardContent,{children:f.jsx(A.Card,{color:"grey2",variant:"dashed",paddingBlock:12,radius:4,sx:{width:"100%"},children:f.jsx(A.CardContent,{children:f.jsxs(A.BlankSlate,{variant:"horizontal",children:[f.jsx(A.BlankSlateIcon,{name:"cloudUpload",lineColor:"purple9",backgroundColor:"purple4",size:"small"}),f.jsx(A.BlankSlateTitle,{children:n?"Preparing your image...":"You haven't selected an image"}),!r&&f.jsx(A.BlankSlateActions,{children:f.jsx(A.Button,{disabled:n,onClick:()=>i(!0),size:"medium",children:"Select image"})})]})})})})]})}const INe=iy({id:pc(),width:ry(),height:ry(),urls:iy({full:pc(),small:pc().transform(VBe)}),alt_description:pc().optional(),description:pc().nullable()}),ENe=iy({results:yU(INe)}).transform(t=>t.results);function oJ(t,e){const n=new URL("search/photos",t);return n.searchParams.set("page","1"),n.searchParams.set("per_page","28"),n.searchParams.set("query",e),oe.request(n,{okType:ENe})}et.cache.registerFetcherConfig(oJ,{cacheCapacity:5,revalidationStrategy:{type:"never"}});function RNe(t,e){const n=I.useRef(),r=Se(),i=et.useRequest(oJ,[t,e]);return qe.useDebounce(e,1e3,()=>{var o;n.current&&e!==n.current&&((o=r.onAnalyticsEvent)==null||o.call(r,"Unsplash Image Searched")),n.current=e}),i}function kNe(t){const{onSelectedChange:e}=t,[n,r]=I.useTransition(),i=qe.useDebounceState({initialState:"",ms:300,startTransition:r});return f.jsxs(A.Box,{flexDirection:"column",gap:16,width:"100%",position:"relative",children:[f.jsx(A.FormSearchInput,{value:i.value,placeholder:"Search on Unsplash.com",onValueChange:i.set}),f.jsx(A.ErrorBoundary,{renderError:()=>f.jsx(FG,{}),children:f.jsx(I.Suspense,{fallback:f.jsx(ONe,{}),children:f.jsx($Ne,{term:i.debouncedValue,loading:n,onSelectedChange:e})})})]})}function $Ne(t){const{term:e,onSelectedChange:n,loading:r}=t,{media:i,toggleSelected:o,selectedImageId:a}=MNe({term:e,onSelectedChange:n});return f.jsxs(f.Fragment,{children:[i.length>0&&f.jsx(aJ,{children:i==null?void 0:i.map(s=>{const c=new URL(s.urls.full).searchParams.get("fm")??"jpg";return f.jsx(A.MediaCard,{url:s.urls.small,filename:s.description??"Unsplash Image",selected:a===s.id,onCardClick:()=>o(s),onCheckedChange:()=>o(s),extension:c,kind:"image",width:s.width,height:s.height,loading:r},s.id)})}),i.length===0&&f.jsx(OG,{})]})}function aJ(t){const{children:e}=t;return f.jsx(A.ScrollArea,{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(min(100%, 250px), 1fr))",gap:16,padding:2,paddingBottom:16,position:"relative",width:"100%"},children:e})}function ONe(){return f.jsx(aJ,{children:_t.range(1,24).map(t=>f.jsx(UG,{},t))})}function MNe(t){var c;const{term:e,onSelectedChange:n}=t,{unsplashApiBaseUrl:r}=Se(),i=RNe(r,e||"citrus fruit"),o=(c=i==null?void 0:i[0])==null?void 0:c.id,[a,s]=I.useState();I.useEffect(()=>{n==null||n([]),s(void 0)},[o,n]);function l(u){if(u.id===a)return s(void 0),n==null?void 0:n([]);s(u.id),n==null||n([{...u,url:u.urls.full,alt:u.alt_description}])}return{media:i,toggleSelected:l,selectedImageId:a}}function Cj(t){const{open:e,onOpenChange:n,onMediaSelected:r,assetType:i}=t,o=Se(),a=o.mediaLibrary,[s,l]=I.useState(()=>a?"media":"unsplash"),[c,u]=I.useState(new Set),[d,p]=I.useState([]),h=c.size+d.length,m=et.useFetcherData(Yi);I.useEffect(()=>{!e||!a||xG({config:o,assetType:i})},[e,o,i,a]);function g(x){if(x!=="media"&&x!=="unsplash")throw new Error(`Invalid option ${x}.`);l(x)}function v(x){x||u(new Set),n(x)}const b=dBe({assetType:i,mediaDialogOpen:e});function S(){var x;switch(s){case"unsplash":{const w=d[0];if(!w)return;r(w),(x=o.onAnalyticsEvent)==null||x.call(o,"Unsplash Image Added");break}case"media":{const E=m.flatMap(R=>R.items).filter(R=>c.has(R.id))[0];if(!E)return;r(E),b(E.id);break}}}function C(){if(h===0)return"Select a media item to add to the page";if(h>1)return"Only one media item can be added to the page"}const{containerRef:y}=A.useAlert();return f.jsxs(A.Dialog,{open:e,onOpenChange:v,size:{width:"min(calc(100% - 48px), 2000px)",height:"calc(100% - 30px)"},position:"center",onPointerDownOutside:x=>{y&&qe.refContainsTarget(y,x.target)&&x.preventDefault()},children:[f.jsx(A.DialogHeader,{icon:"image",title:"Media library"}),f.jsx(A.DialogDescription,{hidden:!0,children:"Select a media item to add to the page"}),f.jsxs(A.DialogOptions,{value:s,onValueChange:g,padding:"small",width:"auto",children:[a&&f.jsx(A.DialogOptionsItem,{value:"media",icon:"photo"}),f.jsx(A.DialogOptionsItem,{value:"unsplash",icon:"unsplash"})]}),f.jsx(A.DialogContent,{children:f.jsx(A.Box,{flexDirection:"column",flexGrow:1,overflow:"hidden",children:f.jsxs(A.Box,{overflow:"hidden",backgroundColor:"grey2",padding:{top:16,inline:16},flexGrow:1,children:[s==="media"&&f.jsx(QG,{assetType:i,onSelectedChange:u}),s==="unsplash"&&f.jsx(kNe,{onSelectedChange:p})]})})}),f.jsxs(A.DialogActions,{children:[f.jsx(A.DialogCancelButton,{}),f.jsx(A.DialogActionButton,{onClick:S,disabled:h!==1,tooltipLabel:C(),children:"Add to page"})]})]})}const sJ=I.forwardRef(function(e,n){const{isMediaDialogOpen:r,selected:i,children:o,onMediaSelected:a,onMediaDialogOpenChange:s}=e;function l(c){a(c),s(!1)}return f.jsxs(A.Card,{ref:n,color:i?"indigo2":"grey2",variant:i?"selected":"dashed",paddingBlock:12,radius:4,children:[o,f.jsx(Cj,{open:r,onOpenChange:s,onMediaSelected:l,assetType:"image"})]})});function lJ(t){const{uploadImage:e,children:n,isUploading:r,disabled:i}=t;if(i)return f.jsx(f.Fragment,{children:n});function o(a){if(r)return;const s=a[0];s&&e(s)}return f.jsx(A.FileDropZone,{assetType:"image",maxFiles:1,onFilesSelected:o,overlay:f.jsx(FNe,{isUploading:r}),children:n})}function FNe(t){const{isUploading:e}=t,n=e?"You can't upload while the upload is ongoing":"Drop image to instantly upload";return f.jsx(A.Box,{justifyContent:"center",flexDirection:"column",height:"100%",padding:8,children:f.jsxs(A.BlankSlate,{children:[f.jsx(A.BlankSlateIcon,{name:e?"block":"cloudUpload",lineColor:e?"tomato11":"purple10",backgroundColor:e?"tomato2":"purple3",borderColor:e?"tomato6":"purple6",borderStyle:"dashed",size:"small"}),f.jsx(A.BlankSlateTitle,{size:"regular",children:n})]})})}function cJ(t){const{contentView:e,croppedImage:n}=t,{width:r,height:i,x:o,y:a,zoom:s}=n,l=LNe({origin:e.origin,croppedImage:n});return{...e,width:r,height:i,url:l,edit:{...e.edit,zoom:s,crop:{x:o,y:a}}}}function jNe(t){var c,u,d;const{field:e,content:n,thumbnail:r,croppedImage:i}=t;if(r===Wp)return uJ({content:n,croppedImage:i});const o=ue.isImageContent(n),a=(u=(c=e==null?void 0:e.config)==null?void 0:c.thumbnails)==null?void 0:u.find(p=>p.name===r),s=o?(d=n.thumbnails)==null?void 0:d[r]:void 0;if(!a||!s)return n;const l=cJ({contentView:s,croppedImage:i});return l.url===s.url?n:{...n,thumbnails:o?{...n.thumbnails,[r]:l}:void 0}}function uJ(t){const{content:e,croppedImage:n}=t,r=cJ({contentView:e,croppedImage:n});return r.url===e.url?e:{...e,...r}}function LNe(t){const{origin:e,croppedImage:n}=t,{x:r,y:i,width:o,height:a,cropHeight:s,cropWidth:l}=n,c=new URL(e.url),u=e.height!==a||e.width!==o;if(r!==0||i!==0||s!==e.height||l!==e.width){const p=[r,i,l,s].map(Math.round).join(",");c.searchParams.set("rect",p),c.searchParams.set("w",o.toString()),c.searchParams.set("h",a.toString())}return u&&(c.searchParams.set("w",o.toString()),c.searchParams.set("h",a.toString())),c.toString()}function DNe(t){const{edit:{crop:{x:e,y:n},zoom:r},width:i,height:o,origin:{width:a,height:s}}=t;let l,c;const u=a/s,d=i/o;return d>=u?(l=a/r,c=l/d):(c=s/r,l=c*d),{x:e,y:n,width:i,height:o,zoom:r,cropWidth:l,cropHeight:c}}function PNe(t){const{selectedImage:e,imageCrop:n,setImageCrop:r}=t,{width:i,height:o,zoom:a,cropHeight:s,cropWidth:l}=n,c=e.contentView,u={x:n.x,y:n.y,width:l,height:s},[d,p]=I.useState(),h=(c==null?void 0:c.origin.url)??"",m=!(e!=null&&e.thumbnail.height&&(e!=null&&e.thumbnail.width));function g(y,x){const w=parseInt(x);isNaN(w)||w<=0||!m||r({...n,[y]:w})}function v(y){r({...n,cropWidth:y.width,cropHeight:y.height,x:y.x,y:y.y})}function b(y){r({...n,zoom:y})}function S(){p(sv),r({...n,...sv})}function C(){c&&(p(sv),r({...n,...sv,zoom:1,cropWidth:c.width,cropHeight:c.height}))}return f.jsxs(A.Box,{padding:{inline:24,block:16},flexDirection:"column",gap:16,height:"100%",overflowY:"auto",alignItems:"center",children:[f.jsxs(A.Box,{gap:8,height:32,alignItems:"flex-start",width:"100%",children:[f.jsx(A.Tooltip,{content:"Center",children:f.jsx(A.Button,{color:"grey",size:"medium",startIcon:"centerFocusWeak",onClick:S})}),f.jsx(A.Tooltip,{content:"Cover",children:f.jsx(A.Button,{color:"grey",size:"medium",startIcon:"zoomOutMap",onClick:C})}),f.jsx(A.Separator,{orientation:"vertical"}),f.jsx(A.FormInput,{prefix:"W",prefixTooltip:"Width",placeholder:"width",type:"number",size:"medium",value:String(i),onValueChange:y=>g("width",y),sx:{width:100},disabled:!m}),f.jsx(A.FormInput,{prefix:"H",prefixTooltip:"Height",placeholder:"height",type:"number",size:"medium",value:String(o),onValueChange:y=>g("height",y),sx:{width:100},disabled:!m})]}),f.jsx(A.Cropper,{image:h,aspect:i/o,crop:d??{x:0,y:0},onCropChange:p,zoom:a,onZoomChange:b,onCropAreaChange:(y,x)=>v(x),initialCroppedAreaPixels:u}),f.jsx(A.Box,{width:"100%",maxWidth:320,children:f.jsx(A.Slider,{min:1,max:3,step:.01,value:[a],onValueChange:([y])=>b(y??1)})})]})}const sv={x:0,y:0};function BNe(t){const{trigger:e,initialImages:n,renderTooltip:r}=t,{open:i,onOpenChange:o,ready:a,option:s,selectedImage:l,croppedImage:c,setCroppedImage:u,setReady:d,setOption:p}=UNe(t);return f.jsxs(A.Dialog,{trigger:e,onAnimationEnd:()=>d(!0),open:i,onOpenChange:o,renderTooltip:r,children:[f.jsx(A.DialogHeader,{icon:"photo",title:"Image editor"}),f.jsx(A.DialogDescription,{hidden:!0,children:"Crop your image to the desired size."}),f.jsx(A.DialogOptions,{value:String(s),onValueChange:h=>p(Number(h)),children:n.map((h,m)=>f.jsx(A.DialogOptionsItem,{value:String(m),icon:"photo",title:h.labels[0]??"Main",subtitle:h.labels[1]??""},h.thumbnail.name))}),l&&f.jsx(A.DialogContent,{children:a&&c&&f.jsx(PNe,{selectedImage:l,imageCrop:c,setImageCrop:u},l.thumbnail.name)})]})}function UNe(t){const{initialImages:e,initialOption:n,onClose:r}=t,[i,o]=I.useState(v),[a,s]=I.useState(!1),[l,c]=I.useState(!1),[u,d]=I.useState(n);function p(b){b?(d(n),o(v())):(c(!1),r({option:u,croppedImages:i})),s(b)}const h=e[u],m=i[(h==null?void 0:h.thumbnail.name)??""];function g(b){if(!h)return;const S=h.thumbnail.name;o({...i,[S]:b})}function v(){return e.reduce((b,S)=>(S.contentView&&(b[S.thumbnail.name]=DNe(S.contentView)),b),{})}return{open:a,ready:l,option:u,selectedImage:h,croppedImage:m,setCroppedImage:g,setReady:c,setOption:d,onClose:r,onOpenChange:p}}function NNe(t){const{readOnly:e,altText:n,selected:r,onValueChange:i}=t,o=I.useId();return f.jsxs(A.Field,{selected:r,children:[f.jsx(A.FieldLabel,{htmlFor:o,children:"Alt text"}),f.jsx(A.FieldControl,{children:f.jsx(A.Box,{flexGrow:1,height:40,children:f.jsx(Jl,{id:o,placeholder:"Short description for the visually impaired",readOnly:e,value:n,padding:{input:{inline:12}},onValueChange:i})})})]})}function WNe(t){const{fieldLabel:e,imageLabel:n,initialImages:r,page:i,displaySeparator:o=!0,isSVGContentView:a,visibility:s,onClear:l,onCropperDialogClose:c,onMediaDialogOpenChange:u}=t;return f.jsxs(A.Box,{display:"flex",flexDirection:"column",gap:12,children:[f.jsxs(A.Box,{display:"flex",alignItems:"center",justifyContent:"space-between",flexWrap:"wrap",gap:4,children:[f.jsx(rJ,{fieldLabel:e,imageLabel:n}),f.jsxs(A.CardHeaderActions,{sx:{visibility:s},children:[f.jsx(BNe,{trigger:f.jsx(A.Button,{startIcon:"crop",disabled:a,hiddenLabel:"Crop & Resize"}),renderTooltip:d=>f.jsx(A.Tooltip,{content:"Crop & Resize",children:d}),initialImages:r,initialOption:i,onClose:c}),f.jsx(A.Tooltip,{content:"Replace",children:f.jsx(A.Button,{startIcon:"imageSearch",hiddenLabel:"Replace",onClick:()=>u(!0)})}),f.jsx(A.Tooltip,{content:"Clear",children:f.jsx(A.Button,{onClick:l,startIcon:"delete",hiddenLabel:"Clear"})})]})]}),o&&f.jsx(A.Separator,{style:"dashed",decorative:!0})]})}function Yc(t){const{description:e,largeIconName:n="public",loading:r,error:i,onEdit:o,onUnlink:a}=t,s=i?f.jsx(QNe,{}):f.jsx(zNe,{...t,largeIconName:n,loading:r});return f.jsx(A.Card,{sx:{width:420},children:f.jsxs(A.CardContent,{gap:12,children:[f.jsxs(A.Box,{display:"grid",gridTemplateColumns:"max-content 1fr min-content",gridTemplateRows:"1fr",gap:8,children:[s,f.jsxs(A.ButtonGroup,{size:"medium",color:"grey",sx:{justifySelf:"end"},children:[o&&f.jsx(A.Button,{startIcon:"edit",onClick:o}),a&&f.jsx(A.Button,{startIcon:"linkOff",onClick:a})]})]}),!i&&f.jsx(VNe,{description:e,loading:r})]})})}function KNe(t){const{url:e,title:n,loading:r}=t;return r?f.jsx(dJ,{height:16,width:80}):n?f.jsx(A.Text,{variant:"smallBold",href:e==null?void 0:e.toString(),children:n}):null}function qNe(t){const{subTitle:e,loading:n}=t;return n?f.jsx(A.Box,{padding:{block:2},children:f.jsx(dJ,{height:12,width:60})}):e?f.jsx(A.Text,{variant:"small",color:"grey11",noWrap:!0,children:e}):null}function VNe(t){const{description:e,loading:n}=t;return!e||n?null:f.jsx(A.Text,{variant:"small",color:"grey11",children:e})}function zNe(t){const{largeIconName:e,title:n,url:r,loading:i,subTitle:o}=t;return f.jsxs(f.Fragment,{children:[f.jsx(A.ConjoinedIcons,{largeIconName:e,smallIconName:"link"}),f.jsxs(A.Box,{flexDirection:"column",minWidth:0,children:[f.jsx(KNe,{title:n,url:r,loading:i}),f.jsx(qNe,{subTitle:o,loading:i})]})]})}function QNe(){return f.jsxs(A.Box,{alignItems:"center",gap:8,children:[f.jsx(A.BackgroundIcon,{name:"alert",color:"tomato",size:"small"}),f.jsx(A.Text,{color:"tomato11",children:"Failed to load linked document data"})]})}function dJ(t){const{width:e,height:n}=t;return f.jsx(A.Skeleton,{color:"grey5",borderRadius:6,width:e,height:n})}function p2(){const t=Se();t.searchDocuments||It("searchDocuments");const{coreApiBaseUrl:e,authStrategy:n}=t,r=et.useRequest(KC,[e,n]);return new Set(r.languages.map(i=>({id:i.id,label:i.label})))}function HNe(){const t=Se();t.searchDocuments||It("searchDocuments");const{coreApiBaseUrl:e,authStrategy:n}=t,r=et.useRequest(sG,[e,n]);return new Set(r.results.map(i=>({id:i,label:i})))}function fJ(){const t=Se();t.searchDocuments||It("searchDocuments");const{customTypesApiBaseUrl:e,repository:n,authStrategy:r}=t,i=IC({baseUrl:e,repository:n,authStrategy:r});return new Set(i.data)}function YNe(t){const{documentTypeId:e,documentUrl:n,title:r,statusColor:i,description:o,tags:a,tagsFilter:s,previewImageUrl:l,highlighted:c,highlightedUID:u,searchTerm:d,onSelect:p}=t;function h(m){return m.nativeEvent instanceof MouseEvent&&(m.metaKey||m.ctrlKey)?window.open(n,"_blank"):p()}return f.jsxs(A.Card,{paddingBlock:16,onSelect:h,variant:c?"highlighted":void 0,color:c?"purple2":void 0,sx:{marginBlock:c?4:0,marginInline:4,flexShrink:0},children:[f.jsx(A.CardContent,{children:f.jsxs(A.Box,{justifyContent:"space-between",gap:6,children:[f.jsxs(A.Box,{flexDirection:"column",gap:4,alignItems:"flex-start",flexGrow:1,children:[f.jsx(GNe,{documentTypeId:e}),f.jsx(ZNe,{title:r,statusColor:i,searchTerm:d}),u&&d&&f.jsx(nWe,{uid:u,searchTerm:d}),f.jsx(XNe,{description:o})]}),f.jsx(eWe,{previewImageUrl:l})]})}),a.length>0&&f.jsx(tWe,{tags:a,tagsFilter:s})]})}function GNe(t){const{documentTypeId:e}=t;return f.jsx(A.ErrorBoundary,{renderError:()=>f.jsx(A.Badge,{maxWidth:150,size:"medium",title:"Type: error",icon:"description"}),children:f.jsx(I.Suspense,{fallback:f.jsx(A.Skeleton,{width:150,height:24}),children:f.jsx(JNe,{documentTypeId:e})})})}function JNe(t){const{documentTypeId:e}=t,r=[...fJ()].find(i=>i.id===e);return f.jsx(A.Badge,{size:"medium",title:`Type: ${(r==null?void 0:r.label)??"Unknown"}`,icon:"description"})}function ZNe(t){const{title:e,statusColor:n,searchTerm:r}=t;return f.jsxs(A.Box,{gap:8,alignItems:"center",children:[f.jsx(A.Dot,{color:n}),f.jsx(pJ,{text:e,highlight:r})]})}function XNe(t){const{description:e}=t,n=e==null?void 0:e.substring(0,150);return n?f.jsx(A.Text,{variant:"small",color:"grey11",children:`${n}${n!==e?"...":""}`}):f.jsx(A.Text,{variant:"smallItalic",color:"grey11",children:"No description available"})}function eWe(t){const{previewImageUrl:e}=t;return f.jsx(A.Box,{width:142,height:90,backgroundColor:"grey2",border:!0,borderRadius:6,flexDirection:"column",alignItems:"center",justifyContent:"center",gap:4,flexShrink:0,padding:8,children:e?f.jsx(A.Image,{src:e,sizing:"cover"}):f.jsxs(f.Fragment,{children:[f.jsx(A.Icon,{name:"hideImage",size:"large",color:"grey11"}),f.jsx(A.Text,{color:"grey11",variant:"small",children:"No preview available"})]})})}function tWe(t){const{tags:e}=t;return f.jsxs(A.CardFooter,{children:[f.jsxs(A.Box,{gap:4,alignItems:"center",children:[f.jsx(A.Icon,{name:"label",size:"small",color:"grey11"}),f.jsx(A.Text,{variant:"small",color:"grey11",children:"Tags:"})]}),f.jsx(A.TextOverflow,{children:e.map(n=>f.jsx(A.Badge,{size:"medium",title:n,sx:{marginRight:8}},n))})]})}function nWe(t){const{uid:e,searchTerm:n}=t;return f.jsxs(A.Box,{alignItems:"flex-start",children:[f.jsx(A.Icon,{name:"tag",color:"green11",sx:{width:12,height:12}}),f.jsx(pJ,{variant:"uid",highlight:n,text:e})]})}function pJ(t){const{text:e,highlight:n,variant:r="title"}=t,i=rWe[r],o=n?e.split(new RegExp(`(${nr.escapeStringRegexp(n)})`,"gi")):[e];return f.jsx(A.Text,{variant:i.textVariants.text,color:i.colors.text,hyphens:!0,overflowWrap:"anywhere",children:o.map((a,s)=>a.toLowerCase()===(n==null?void 0:n.toLowerCase())?f.jsx(A.Text,{variant:i.textVariants.highlight,hyphens:!0,overflowWrap:"anywhere",highlight:!0,highlightColor:i.colors.highlight,highlightBorderRadius:2,color:i.colors.highlightText,children:a},s):a)})}const rWe={title:{colors:{text:void 0,highlight:void 0,highlightText:"purple11"},textVariants:{text:"bold",highlight:"bold"}},uid:{colors:{text:"green11",highlight:"green3",highlightText:"green11"},textVariants:{text:"extraSmall",highlight:"extraSmall"}}};function iWe(t){const{searchTerm:e,tagsFilter:n,typesFilter:r,localesFilter:i}=t,o=Se();o.searchDocuments||It("searchDocuments");const{storageVersion:a}=et.useRequest(KC,[o.coreApiBaseUrl,o.authStrategy]);o.searchDocuments||It("searchDocuments");const{status:s}=o,{data:l}=sr.useSuspenseQuery({...rG({searchTerm:e,tags:[...di.map(n,c=>c.id)],customTypes:[...di.map(r,c=>c.id)],locale:[...di.map(i,c=>c.id)][0]??"",status:oT[s],storageVersion:a,config:o}),select:c=>oWe(c.results,oT[s]),staleTime:300});return{documents:l.results}}function oWe(t,e){return{results:t.flatMap(r=>{const o=r.versions.filter(a=>e.includes(a.status));return o.length===0?[]:{...r,versions:o}})}}function aWe(t,e){const n=Se(),r=qe.useDebounceState({initialState:""}),[i,o]=I.useState(new Set),[a,s]=I.useState(new Set);function l(){return!n.searchDocuments||!n.localeId?new Set:new Set([{id:n.localeId,label:n.localeId}])}const[c,u]=I.useState(l),d=di.union(a,Sy(t)),p=di.union(i,Sy(e));return{searchTerm:r,filteredTags:i,setFilteredTags:o,filteredCustomTypes:a,setFilteredCustomTypes:s,filteredLocales:c,setFilteredLocales:u,typesFilter:d,tagsFilter:p}}function Sy(t){return t?di.map(t,e=>({id:e,label:e})):new Set}function sWe(t){const{filteredLocales:e,setFilteredLocales:n,filteredTags:r,setFilteredTags:i,filteredCustomTypes:o,setFilteredCustomTypes:a,fixedTags:s,fixedCustomTypes:l}=t;return f.jsxs(f.Fragment,{children:[f.jsx(cWe,{selectedValues:e,onSelectedValuesChange:n}),f.jsx(dT,{selectedValues:r,fixedSelectedValues:Sy(s),onSelectedValuesChange:i,label:"Tags",icon:"label",fetchFilters:HNe}),f.jsx(dT,{selectedValues:o,fixedSelectedValues:Sy(l),onSelectedValuesChange:a,label:"Type",icon:"description",fetchFilters:fJ})]})}function dT(t){const[e,n]=I.useState(!1),r=I.useRef(null);return f.jsx(A.ErrorBoundary,{ref:r,renderError:()=>{var i;return f.jsx(A.FilterField,{mode:"error",onErrorRetry:(i=r.current)==null?void 0:i.reset,open:e,setOpen:n,values:new Set,...t})},children:f.jsx(I.Suspense,{fallback:f.jsx(A.FilterField,{mode:"loading",open:e,setOpen:n,values:new Set,...t}),children:f.jsx(lWe,{open:e,setOpen:n,...t})})})}function lWe(t){const{open:e,setOpen:n,onSelectedValuesChange:r,fixedSelectedValues:i,selectedValues:o,label:a,icon:s,fetchFilters:l,multiple:c}=t,u=l();return f.jsx(A.FilterField,{open:e,setOpen:n,label:a,icon:s,selectedValues:o,values:new Set(u),fixedSelectedValues:i,onSelectedValuesChange:r,multiple:c})}function cWe(t){const{selectedValues:e,onSelectedValuesChange:n}=t,[r,i]=I.useState(di.first(e));function o(s){n(s),i(di.first(s))}const a=di.find(p2(),s=>{var l;return s.id===((l=di.first(e))==null?void 0:l.id)});return(a==null?void 0:a.label)!==(r==null?void 0:r.label)&&i(a),f.jsx(dT,{selectedValues:new Set(r?[r]:[]),onSelectedValuesChange:o,label:"Locale",icon:"public",fetchFilters:p2,multiple:!1})}function hJ(t){const{onSelectDocument:e,fixedCustomTypes:n,fixedTags:r,linkedDocumentId:i,...o}=t,a=Se(),{searchTerm:s,filteredTags:l,setFilteredTags:c,filteredCustomTypes:u,setFilteredCustomTypes:d,filteredLocales:p,setFilteredLocales:h,typesFilter:m,tagsFilter:g}=aWe(n,r);return f.jsxs(A.Dialog,{size:{height:727,width:656},hasClose:!1,...o,children:[f.jsx(A.DialogTitle,{hidden:!0,children:"Link to a page"}),f.jsx(A.DialogDescription,{hidden:!0,children:"Search and select a page to link to"}),f.jsx(A.DialogContent,{children:f.jsx(A.Box,{flexDirection:"column",height:"100%",children:f.jsxs(A.ScrollArea,{style:{flexGrow:1,paddingBottom:A.theme.space[16],paddingInline:A.theme.space[16],display:"flex",flexDirection:"column"},children:[f.jsx(A.Box,{padding:{top:16,bottom:8},flexDirection:"column",position:"sticky",top:0,backgroundColor:"white",children:f.jsx(A.FormInput,{value:s.value,onValueChange:s.set,placeholder:"Search a page",icon:"search"})}),a.searchDocuments&&f.jsx(A.Box,{padding:{top:4,bottom:8},flexDirection:"column",gap:12,children:f.jsx(sWe,{filteredTags:l,setFilteredTags:c,filteredCustomTypes:u,setFilteredCustomTypes:d,filteredLocales:p,setFilteredLocales:h,fixedTags:r,fixedCustomTypes:n})}),a.searchDocuments?f.jsx(uWe,{searchTerm:s.debouncedValue,tagsFilter:g,typesFilter:m,localesFilter:p,onSelectDocument:e,linkedDocumentId:i}):f.jsx(AJ,{title:"Oops!",message:"Slice Machine does not yet support mock data for linked documents in the simulator."})]})})})]})}function uWe(t){const{searchTerm:e,tagsFilter:n,typesFilter:r,localesFilter:i,linkedDocumentId:o,onSelectDocument:a}=t;return f.jsxs(f.Fragment,{children:[o&&f.jsxs(f.Fragment,{children:[f.jsx(m2,{children:"Linked page"}),f.jsx(A.ErrorBoundary,{renderError:()=>f.jsx(h2,{description:"An error occurred while fetching the linked page."}),children:f.jsx(I.Suspense,{fallback:AWe,children:f.jsx(pWe,{linkedDocumentId:o,tagsFilter:n,onSelectDocument:a})})})]}),f.jsx(m2,{children:"Link to a page"}),f.jsx(A.ErrorBoundary,{renderError:()=>f.jsx(h2,{description:"An error occurred while fetching pages."}),children:f.jsx(I.Suspense,{fallback:fWe,children:f.jsx(dWe,{searchTerm:e,tagsFilter:n,localesFilter:i,typesFilter:r,linkedDocumentId:o,onSelectDocument:a})})})]})}function dWe(t){const{searchTerm:e,tagsFilter:n,localesFilter:r,typesFilter:i,linkedDocumentId:o,onSelectDocument:a}=t,{documents:s}=iWe({searchTerm:e,tagsFilter:n,localesFilter:r,typesFilter:i}),l=s.filter(c=>c.id!==o);return l.length===0?f.jsx(AJ,{title:s.length===1?"No other pages found!":void 0}):f.jsx(A.Box,{flexDirection:"column",gap:12,children:l.map(c=>{const u=c==null?void 0:c.versions[0];return u?f.jsx(mJ,{document:c,version:u,tagsFilter:n,searchTerm:e,onSelectDocument:a},`${c.id}-${u.status}`):null})})}const fWe=f.jsx(A.Box,{flexDirection:"column",gap:12,children:_t.range(1,3).map(t=>f.jsx(A.Skeleton,{height:124,sx:{marginInline:4},zIndex:-1},t))});function h2(t){const{description:e}=t;return f.jsx(A.Box,{flexDirection:"column",alignItems:"center",justifyContent:"center",children:f.jsx(A.DefaultErrorMessage,{title:"Request failed",description:e,errorImageSrc:A.dialogErrorImage})})}function pWe(t){const{linkedDocumentId:e,tagsFilter:n,onSelectDocument:r}=t,i=gWe(e),o=hWe(i);return f.jsx(mJ,{document:i,version:o,tagsFilter:n,onSelectDocument:r,highlighted:!0})}function hWe(t){return I.useMemo(()=>mWe(t),[t])}function mWe(t){return _t.sort(t.versions,e=>e.status==="unclassified"||e.status==="published"?-1:0,e=>e.status==="release"?-1:0,e=>-e.last_modified_date.getTime())[0]}const AWe=f.jsx(A.Skeleton,{height:124,sx:{marginBlock:4,marginInline:4},zIndex:-1});function gWe(t){const e=Se();e.searchDocuments||It("searchDocuments");const{coreApiBaseUrl:n,authStrategy:r}=e;return et.useRequest(kg,[n,r,t])}function mJ(t){var p;const{document:e,version:n,tagsFilter:r,highlighted:i,onSelectDocument:o,searchTerm:a}=t,s=Se();if(!e||!n)return null;const l=cj({documentId:e.id,versionId:n.status==="archived"?n.version_id:void 0,releaseId:n.status==="release"?n.release_id:void 0,status:n.status,baseUrl:s.baseUrl}),c=vWe({tags:n.tags,tagsFilter:r}),u=aT(n)&&n.summary||GY(n)&&n.preview_summary||"",d=aT(n)?(p=n.highlights)==null?void 0:p.uid:void 0;return f.jsx(YNe,{documentTypeId:e.custom_type_id,documentUrl:l,description:u,tags:c,title:e.title,previewImageUrl:n.preview_image,onSelect:()=>o(e.id),statusColor:UY[n.status].color,highlighted:i,highlightedUID:d,searchTerm:a})}function m2(t){const{children:e}=t;return f.jsx(A.Box,{position:"sticky",top:64,backgroundColor:"white",padding:{block:6,inline:4},children:f.jsx(A.Text,{variant:"smallBold",color:"grey11",children:e})})}function AJ(t){const{title:e="No pages found!",message:n="Consider using different keywords or tweaking your filters to find what you need."}=t;return f.jsx(A.Box,{justifyContent:"center",flexDirection:"column",height:"100%",children:f.jsxs(A.BlankSlate,{children:[f.jsx(A.BlankSlateIcon,{name:"close",lineColor:"tomato11",backgroundColor:"tomato4",size:48}),f.jsx(A.BlankSlateTitle,{size:"big",children:e}),f.jsx(A.BlankSlateDescription,{width:360,children:n})]})})}function vWe(t){const{tags:e,tagsFilter:n}=t,r=[...n].map(o=>o.label).reverse();return _t.sort(e,o=>-r.indexOf(o))}function gJ(t){const{hasLink:e,onUnlink:n,selectEnabled:r,selectedType:i,value:o,onOpenLinkModal:a,onValueChange:s,openInNewTab:l=!0,condensedButtons:c=!1,showNewTabButton:u=!1,displayTextEnabled:d,variants:p,variant:h,onVariantChange:m}=t;return f.jsxs(f.Fragment,{children:[!d&&u&&l&&f.jsx(A.Badge,{title:"Open in a new tab",color:"indigo",size:"small",icon:"openInNew",onClick:a}),!e&&r&&f.jsxs(A.Select,{value:i==="any"?void 0:i,color:"grey",size:"small",boldTriggerText:!0,position:"popper",sideOffset:4,startIcon:Fd({selectType:i}),disabled:!r,onValueChange:s,placeholder:c?"":fd("any"),onlyStartIcon:c&&i!==void 0,renderTrigger:({button:g})=>f.jsx(A.Tooltip,{content:fd(i),visible:c,children:g}),children:[f.jsx(A.SelectItem,{value:"web",icon:"public",children:fd("web")}),f.jsx(A.SelectItem,{value:"document",icon:"description",children:fd("document")}),f.jsx(A.SelectItem,{value:"media",icon:"image",children:fd("media")})]},i===void 0?"unlinked":"linked"),!e&&!r&&f.jsx(A.Button,{startIcon:Fd({selectType:i}),color:"grey",textColor:"link",textWeight:"normal",size:"small",onClick:a,children:fd(i)}),e&&!d&&f.jsx(A.Button,{startIcon:"close",color:"grey",size:"small",onClick:n,"aria-label":"Close"}),e&&d&&f.jsxs(A.ButtonGroup,{density:"compact",children:[f.jsx(A.Button,{startIcon:Fd({selectType:i}),renderEndIcon:()=>l&&i==="web"?f.jsx(A.Icon,{name:"openInNew",size:"extraSmall",color:"indigo11"}):null,color:"grey",textColor:"link",textWeight:"normal",size:"small",disabled:!e,onClick:a,children:o.length>30?`${o.slice(0,30)}...`:o}),f.jsx(A.Button,{startIcon:"close",color:"grey",size:"small",onClick:n})]}),p.length>1&&f.jsx(A.Select,{value:h,color:"grey",size:"small",boldTriggerText:!0,position:"popper",sideOffset:4,startIcon:"colorLens",onValueChange:m,children:p.map((g,v)=>f.jsx(A.SelectItem,{value:g,children:g},`${g}-${v}`))})]})}function fd(t){if(!t||t==="any")return"Choose link type";switch(t){case"document":return"Link to Prismic page";case"web":return"Link to web page";case"media":return"Link to media"}}function vJ(t){const{onEdit:e,onUnlink:n,url:r,title:i,subTitle:o}=t,[a,s]=I.useState(null);return f.jsx(A.Card,{paddingBlock:16,ref:s,children:f.jsxs(A.CardContent,{children:[f.jsx(bWe,{url:r,title:i,subTitle:o,onEdit:e,onUnlink:n,container:a}),r&&f.jsx(A.CheckerBoard,{children:f.jsx(yWe,{children:f.jsx(A.Image,{src:r,alt:i,sizing:"contain"})})})]})})}function yWe(t){const{children:e}=t;return f.jsx(A.Box,{flexDirection:"column",alignItems:"center",justifyContent:"center",position:"relative",height:327,children:e})}function bWe(t){const{url:e,title:n,subTitle:r,onEdit:i,onUnlink:o,container:a}=t;return f.jsxs(A.Box,{flexDirection:"row",justifyContent:"space-between",gap:8,children:[f.jsxs(A.Box,{gap:8,minWidth:0,children:[f.jsx(A.ConjoinedIcons,{largeIconName:"image",smallIconName:"link"}),f.jsxs(A.Box,{flexDirection:"column",minWidth:0,children:[f.jsx(A.Text,{noWrap:!0,variant:"smallBold",href:e,inline:!0,children:n}),f.jsx(A.Text,{variant:"small",color:"grey11",children:r})]})]}),f.jsxs(A.ButtonGroup,{size:"medium",color:"grey",children:[i&&f.jsx(A.Tooltip,{content:"Edit link",side:"top",container:a,children:f.jsx(A.Button,{startIcon:"edit",onClick:i})}),o&&f.jsx(A.Tooltip,{content:"Remove link",side:"top",container:a,children:f.jsx(A.Button,{startIcon:"linkOff",onClick:o})})]})]})}function CWe(t){var q,H,z;const{field:e,content:n,onContentChange:r}=t,i=S(),o=((q=e.config)==null?void 0:q.allowText)??!1,a=o&&(n==null?void 0:n.value.text)||void 0,s=((H=e.config)==null?void 0:H.variants)??[],c=(n==null?void 0:n.value.variant)&&s.includes(n==null?void 0:n.value.variant)?n==null?void 0:n.value.variant:s[0],[u,d]=I.useState(b),p=ue.FilledExternalLinkContent.is(n==null?void 0:n.value)&&(n==null?void 0:n.value.target)||void 0,[h,m]=I.useState(!1),g=I.useRef(null);qe.useOnChange(i,$);const v=u?SWe[u]:void 0;function b(){var K,Y;return!((K=e.config)!=null&&K.select)||n!=null&&n.value.__TYPE__?n==null?void 0:n.value.__TYPE__:A2[(Y=e.config)==null?void 0:Y.select]}function S(){return n?ue.FilledDocumentLinkContent.is(n.value)?n.value.id:ue.FilledExternalLinkContent.is(n.value)?n.value.url:ue.FilledFileLinkContent.is(n.value)||ue.FilledImageLinkContent.is(n.value)?n.value.name:"":""}function C(K){var L;const{displayText:Y,variant:ee}=K;if(!Y&&!ee)return r(void 0);switch((L=e.config)==null?void 0:L.select){case"web":return r({__TYPE__:"LinkContent",key:pd(n),value:{__TYPE__:"ExternalLink",kind:"web",...Y&&{text:Y},...ee&&{variant:ee}}});case"document":return r({__TYPE__:"LinkContent",key:pd(n),value:{__TYPE__:"DocumentLink",kind:"document",...Y&&{text:Y},...ee&&{variant:ee}}});case"media":return r({__TYPE__:"LinkContent",key:pd(n),value:{__TYPE__:"MediaLink",kind:"media",...Y&&{text:Y},...ee&&{variant:ee}}});default:return r({__TYPE__:"LinkContent",key:pd(n),value:{__TYPE__:"AnyLink",kind:"any",...Y&&{text:Y},...ee&&{variant:ee}}})}}function y(K,Y){if(!K)return C({displayText:a,variant:c});const{newTab:ee=!1}=Y??{},L=ee?"_blank":void 0;switch(u){case"ExternalLink":return r({__TYPE__:"LinkContent",key:pd(n),value:{__TYPE__:"ExternalLink",url:K,target:L,...a&&{text:a},...c&&{variant:c}}});case"DocumentLink":return r({__TYPE__:"LinkContent",key:pd(n),value:{__TYPE__:"DocumentLink",id:K,...a&&{text:a},...c&&{variant:c}}});default:return r(void 0)}}function x(K){return n?r({__TYPE__:n.__TYPE__,key:n.key,value:{...n.value,text:K}}):C({displayText:K})}function w(K){return n?r({__TYPE__:n.__TYPE__,key:n.key,value:{...n.value,variant:K}}):C({variant:K})}const _=xWe();function E(K){d(K?A2[K]:void 0),y(""),K&&K!=="any"&&_(K)}function R(K){y(K)}function O(){m(!0)}function $(){var K;h&&(m(!1),(K=g.current)==null||K.reset())}function U(K){const Y=yJ({media:K});switch(Y.value.__TYPE__){case"ImageLink":return r({__TYPE__:Y.__TYPE__,key:Y.key,value:{...Y.value,...a&&{text:a},...c&&{variant:c}}});case"FileLink":return r({__TYPE__:Y.__TYPE__,key:Y.key,value:{...Y.value,...a&&{text:a},...c&&{variant:c}}})}}return{contentType:u,selectType:v,fieldValue:i,onDisplayTextChange:x,onValueChange:y,onTypeChange:E,placeholder:od(e),isTypeSelectEnabled:!((z=e.config)!=null&&z.select),onDocumentSelected:R,onError:O,errorBoundaryRef:g,isTargetNewTab:p==="_blank",onMediaSelected:U,displayTextEnabled:o,displayText:a??"",variants:s,variant:c,onVariantChange:w}}function pd(t){return t?t.key:crypto.randomUUID()}const SWe={AnyLink:"any",DocumentLink:"document",ExternalLink:"web",FileLink:"media",ImageLink:"media",MediaLink:"media"},A2={any:"AnyLink",document:"DocumentLink",web:"ExternalLink",media:"FileLink"};function wWe(t){const e=Se();e.searchDocuments||It("searchDocuments");const{coreApiBaseUrl:n,authStrategy:r}=e;return et.useRequest(kg,[n,r,t]).title}et.cache.registerFetcherConfig(kg,{concurrency:50});function yJ(t){var i,o,a,s,l,c;const{media:e}=t,n="kind"in e;return n&&e.kind==="image"?{__TYPE__:"LinkContent",key:crypto.randomUUID(),value:{__TYPE__:"ImageLink",id:e.id,name:e.filename,url:e.url,kind:"image",size:e.size.toString(),height:((i=e.height)==null?void 0:i.toString())??`${Qs}`,width:((o=e.width)==null?void 0:o.toString())??`${Qs}`,date:((a=e.last_modified)==null?void 0:a.toString())??""}}:n?{__TYPE__:"LinkContent",key:crypto.randomUUID(),value:{__TYPE__:"FileLink",id:e.id,name:e.filename,kind:"file",url:e.url,size:e.size.toString(),date:((s=e.last_modified)==null?void 0:s.toString())??""}}:{__TYPE__:"LinkContent",key:crypto.randomUUID(),value:{__TYPE__:"ImageLink",id:e.id,name:(e==null?void 0:e.alt)??e.url,kind:"image",url:e.url,size:"0",height:((l=e.height)==null?void 0:l.toString())??`${Qs}`,width:((c=e.width)==null?void 0:c.toString())??`${Qs}`}}}const xWe=()=>{const t=sNe(),{onAnalyticsEvent:e}=Se();function n(r){t&&e&&e("Generic Link Added",{type:r,isInSlice:String(t.isInSlice),isInGroup:String(t.isInGroup),isInRepeatable:String(t.isInRepeatable),customTypeFormat:t.customTypeFormat??"custom"})}return n};function TWe(t){const{open:e,onOpenChange:n,showNewTabButton:r}=t,{url:i,setUrl:o,openInNewTab:a,setOpenInNewTab:s,disabled:l,onUpdate:c}=_We(t);return f.jsxs(A.Dialog,{open:e,onOpenChange:n,size:"small",noDescription:!0,children:[f.jsx(A.DialogHeader,{title:"Set Link URL"}),f.jsxs(A.DialogContent,{padding:16,children:[f.jsx(A.FormInput,{value:i,onValueChange:o,placeholder:"Paste URL",icon:"public"}),r&&f.jsx(A.InlineLabel,{value:"Open in a new tab",children:f.jsx(A.Checkbox,{checked:a,onCheckedChange:s})})]}),f.jsxs(A.DialogActions,{children:[f.jsx(A.DialogCancelButton,{}),f.jsx(A.DialogActionButton,{onClick:c,disabled:l,children:"Update"})]})]})}function _We(t){const{url:e,openInNewTab:n,onUpdate:r,open:i}=t,[o,a]=I.useState(e),[s,l]=I.useState(n);qe.useOnChange(i,()=>{i&&(a(e),l(n))});const c=!o||o===e&&s===n;function u(){r(o,{newTab:s})}return{url:o,setUrl:a,openInNewTab:s,disabled:c,setOpenInNewTab:l,onUpdate:u}}function Sj(t){var Y,ee,L,M,F;const{content:e,field:n,id:r,onContentChange:i,appearance:o="normal",backgroundColor:a="grey1"}=t,s=qe.useDebounceState({initialState:!1}),[l,c]=I.useState(),{contentType:u,fieldValue:d,errorBoundaryRef:p,onDocumentSelected:h,onError:m,onMediaSelected:g,onValueChange:v,selectType:b,onTypeChange:S,isTypeSelectEnabled:C,displayTextEnabled:y,...x}=CWe({content:e,field:n,onContentChange:i}),w=u==="DocumentLink"&&d!=="",E=u==="ExternalLink"&&pi.toURL(d),R=!!((Y=n.config)!=null&&Y.allowTargetBlank);function O(){switch(u){case"DocumentLink":return c("document");case"ExternalLink":return c("web");case"FileLink":case"ImageLink":case"MediaLink":return c("media");default:return c(void 0)}}const $={...x,id:r,onFocus:()=>s.set(!0),onBlur:()=>s.set(!1),onOpenLinkModal:O,onUnlink:()=>{C?S(void 0):v("")},onSelectValueChange:V=>{S(V),c(V)},value:d,allowTargetBlank:R,selectType:b,onValueChange:v,isTypeSelectEnabled:C,displayTextEnabled:y,onKeyDown(V){y||(V.key==="Enter"||V.key===" ")&&(O(),V.preventDefault())},onClick:()=>{y||O()},appearance:o},{searchDocuments:U}=Se();function q(V){if(V)return;const pe=e&&e.value.__TYPE__!=="AnyLink";!V&&!pe&&C&&S(void 0),c(void 0)}function H(V,pe){v(V,pe),c(void 0)}function z(V){g(V),c(void 0)}function K(V){h(V),c(void 0)}return f.jsxs(f.Fragment,{children:[f.jsxs(A.Popover,{align:"start",sideOffset:-3,focusOnEnter:!1,open:s.debouncedValue,anchor:f.jsxs(A.Field,{variant:IWe(o),color:a,children:[w?f.jsx(kWe,{documentId:d,displayTextEnabled:y}):f.jsx(A.FieldIcon,{name:Fd({selectType:b,displayTextEnabled:y})}),o!=="compact"&&f.jsx(A.FieldLabel,{htmlFor:r,children:Fr(n)}),f.jsx(A.FieldControl,{children:w&&U?f.jsx(OWe,{errorBoundaryRef:p,onError:m,fallback:f.jsx(fT,{...$,value:"..."}),renderError:()=>EWe($),children:f.jsx(RWe,{...$,documentId:d})}):f.jsx(fT,{...$})})]}),children:[E&&f.jsx(Yc,{url:E,title:pi.getUrlTitle(E)??"",subTitle:E.toString()}),e&&ue.FilledImageLinkContent.is(e.value)&&f.jsx(vJ,{url:e.value.url,title:e.value.name,subTitle:`${e.value.width} x ${e.value.height} pixels`})]}),f.jsx(TWe,{open:l==="web",onOpenChange:q,onUpdate:H,url:d,openInNewTab:x.isTargetNewTab,showNewTabButton:!!((ee=n.config)!=null&&ee.allowTargetBlank)}),f.jsx(Cj,{open:l==="media",onOpenChange:q,onMediaSelected:z,assetType:"all"}),f.jsx(hJ,{open:l==="document",onOpenChange:q,onSelectDocument:K,fixedCustomTypes:new Set((M=(L=n.config)==null?void 0:L.customtypes)==null?void 0:M.flatMap(V=>typeof V=="string"?[V]:[])),fixedTags:new Set((F=n.config)==null?void 0:F.tags),linkedDocumentId:e&&ue.FilledDocumentLinkContent.is(e.value)?e.value.id:void 0})]})}function IWe(t){switch(t){case"compact":return"compact";case"normal":return"normal";default:return}}function EWe(t){return f.jsx(fT,{...t})}function fT(t){const{id:e,value:n,onOpenLinkModal:r,onBlur:i,isTypeSelectEnabled:o,selectType:a,onSelectValueChange:s,onUnlink:l,isTargetNewTab:c,allowTargetBlank:u,displayTextEnabled:d,displayText:p,onFocus:h,onClick:m,onKeyDown:g,appearance:v,placeholder:b,variants:S,variant:C,onVariantChange:y,onDisplayTextChange:x,onValueChange:w}=t;return f.jsx(A.Box,{padding:{block:4},width:"100%",children:f.jsx(Jl,{id:e,textOverflow:"ellipsis",variant:d?"normal":"link",readOnly:!d,placeholder:d?"Add your display text":b,padding:bJ(v),value:d?p:n,cursor:CJ({value:n,displayTextEnabled:d,isTypeSelectEnabled:o}),onBlur:i,onFocus:h,onClick:m,onKeyDown:g,onValueChange:d?x:w,endAdornment:f.jsx(gJ,{hasLink:!!(n&&a),onUnlink:l,selectEnabled:o,selectedType:a,value:n,onOpenLinkModal:r,onValueChange:s,openInNewTab:c,condensedButtons:v==="condensedButtons",showNewTabButton:u&&a==="web",displayTextEnabled:d,variants:S,variant:C,onVariantChange:y})})})}function RWe(t){const{id:e,documentId:n,onOpenLinkModal:r,isTypeSelectEnabled:i,selectType:o,displayTextEnabled:a,onSelectValueChange:s,onUnlink:l,onFocus:c,onClick:u,onKeyDown:d,appearance:p,variants:h,variant:m,displayText:g,onVariantChange:v,onDisplayTextChange:b}=t,S=wWe(n),C=SJ(n);return f.jsx(Jl,{id:e,textOverflow:"ellipsis",padding:bJ(p),placeholder:a?"Add your display text":void 0,readOnly:!a,value:a?g:S,variant:a?"normal":"link",cursor:CJ({value:S,displayTextEnabled:a,isTypeSelectEnabled:i}),onFocus:c,onClick:u,onKeyDown:d,onValueChange:a?b:void 0,endAdornment:f.jsxs(A.Box,{gap:4,children:[C&&f.jsx(A.Badge,{title:"Broken Link",color:"tomato"}),f.jsx(gJ,{hasLink:!0,onUnlink:l,selectEnabled:i,selectedType:o,value:S,onOpenLinkModal:r,condensedButtons:p==="condensedButtons",onValueChange:s,displayTextEnabled:a,variants:h,variant:m,onVariantChange:v})]})})}function kWe(t){const{documentId:e,displayTextEnabled:n}=t;return f.jsx(A.ErrorBoundary,{renderError:()=>f.jsx(A.FieldIcon,{name:"warning"}),children:f.jsx(I.Suspense,{fallback:f.jsx(A.FieldIcon,{name:Fd({selectType:"document",displayTextEnabled:n})}),children:f.jsx($We,{documentId:e,displayTextEnabled:n})})})}function $We(t){const{displayTextEnabled:e,documentId:n}=t;return SJ(n)?f.jsx(A.FieldIcon,{name:"linkOff"}):f.jsx(A.FieldIcon,{name:Fd({selectType:"document",displayTextEnabled:e})})}function bJ(t){switch(t){case"compact":return{input:{inline:4}};default:return}}function OWe(t){const{errorBoundaryRef:e,onError:n,children:r,fallback:i,renderError:o}=t;return f.jsx(A.ErrorBoundary,{ref:e,onError:n,renderError:o,children:f.jsx(I.Suspense,{fallback:i,children:r})})}function Fd(t){const{selectType:e,displayTextEnabled:n}=t;if(n)return"notes";switch(e){case"document":return"description";case"web":return"public";case"media":return"image";default:return"link"}}function CJ(t){const{value:e,displayTextEnabled:n,isTypeSelectEnabled:r}=t;return n?"text":r&&!e?"default":"pointer"}function MWe(t){const{onContentChange:e,...n}=t;function r(i){const o=ue.FilledLinkContent.is(i)?i:void 0;e(o)}return f.jsx(Sj,{...n,onContentChange:r})}function SJ(t){const e=Se();e.uidField||It("uidField");const{coreApiBaseUrl:n,authStrategy:r}=e,{data:i}=pj({baseUrl:n,authStrategy:r,documentIds:[t],statuses:["archived","unclassified","published"]});if(i.results.length===0||i.results.length>1)return!1;const o=i.results[0];return o==null?void 0:o.versions.every(a=>a.status==="archived")}function FWe(t){const{onDelete:e,isDeleteEnabled:n,onMoveUp:r,onMoveDown:i,isMoveUpEnabled:o,isMoveDownEnabled:a}=t;return f.jsxs(A.DropdownMenu,{children:[f.jsx(A.DropdownMenuTrigger,{children:f.jsx(A.IconButton,{hiddenLabel:"Link actions",icon:"moreVert",size:"small",variant:"solid"})}),f.jsxs(A.DropdownMenuContent,{children:[f.jsx(A.DropdownMenuLabel,{children:f.jsx(A.Text,{variant:"small",color:"grey11",children:"Item options"})}),f.jsx(A.DropdownMenuItem,{onSelect:r,startIcon:f.jsx(A.Icon,{name:"arrowUpward"}),disabled:!o,children:"Move up"}),f.jsx(A.DropdownMenuItem,{onSelect:i,startIcon:f.jsx(A.Icon,{name:"arrowDownward"}),disabled:!a,children:"Move down"}),f.jsx(A.DropdownMenuItem,{color:"tomato",onSelect:e,startIcon:f.jsx(A.Icon,{name:"delete",color:"tomato9"}),disabled:!n,children:"Delete"})]})]})}function jWe(t){const{field:e,content:n,onContentChange:r}=t,{config:i}=e,o=I.useMemo(()=>Ow({config:i}),[i]),a=n!=null&&n.value.length?n.value:[o];function s(p){const h=_t.insertAtIndex(a,p,Ow({config:i}));r(Gp(h))}function l(p,h){var v;const m=[...a],g=Ow({config:i,key:(v=m[h])==null?void 0:v.key});m[h]=p??g,r(Gp(m))}function c(p){r(Gp(p))}function u(p){const h=_t.removeIndex(a,p);r(Gp(h))}function d(p,h){const m=_t.move(a,h,h+LWe(p));r(Gp(m))}return{links:a,updateLink:l,updateLinks:c,addLink:s,deleteLink:u,moveLink:d}}function LWe(t){switch(t){case"up":return-1;case"down":return 1}}function Ow(t){const{config:e,key:n=crypto.randomUUID()}=t,r=DWe(e==null?void 0:e.select);return e!=null&&e.allowText&&(r.text=""),{__TYPE__:"LinkContent",key:n,value:r}}function DWe(t){switch(t){case"web":return{__TYPE__:"ExternalLink",kind:"web"};case"document":return{__TYPE__:"DocumentLink",kind:"document"};case"media":return{__TYPE__:"MediaLink",kind:"media"};default:return{__TYPE__:"AnyLink",kind:"any"}}}function Gp(t){return{__TYPE__:"RepeatableContent",type:"Link",value:t}}function PWe(t){const{id:e,field:n}=t,r=jWe(t),[i,o]=I.useState(!1),{links:a}=r;return f.jsx(aNe,{children:f.jsxs(A.FieldSet,{id:e,legend:BWe(n.config),variant:"compact",selected:i,children:[f.jsx(UWe,{field:n,items:a,onItemDelete:r.deleteLink,onItemChange:r.updateLink,onItemMove:r.moveLink,onItemAdd:r.addLink,onItemReorder:r.updateLinks,onDragStatusChange:o}),f.jsx(A.Button,{startIcon:"add",color:"grey",onClick:()=>r.addLink(a.length),sx:{marginInline:4,marginBlock:4},children:"Add"})]})})}function BWe(t){return t!=null&&t.label?`Multiple • ${t.label}`:"Multiple"}function UWe(t){const{field:e,items:n,onItemChange:r,onItemDelete:i,onItemMove:o}=t,a=n.length>1,s=NWe(t);return f.jsx(A.AnimatedList,{items:n,getItemKey:l=>l.key,ariaLabel:"Link list",dnd:s,children:(l,c)=>f.jsxs(A.Draggable,{disabled:!a,children:[f.jsx(Sj,{appearance:"compact",content:l,field:e,onContentChange:u=>r(u,c),backgroundColor:"transparent"}),f.jsx(FWe,{onDelete:()=>i(c),isDeleteEnabled:n.length>1,onMoveUp:()=>o("up",c),isMoveUpEnabled:c>0,onMoveDown:()=>o("down",c),isMoveDownEnabled:c<n.length-1})]})})}function NWe(t){const{onDragStatusChange:e,onItemReorder:n,onItemAdd:r}=t,{scrollOffsetTop:i}=Se(),o=qe.useStableCallback(r);return{renderDropIndicator:s=>f.jsx(WWe,{...s,onItemAdd:o}),scrollOffsetTop:i,onDragChange:e,onReorder:n}}function WWe(t){const{isDropTarget:e,itemIndex:n,position:r,itemCount:i,onItemAdd:o}=t;return n===0&&r==="before"?f.jsx(g2,{isDropTarget:e,position:"before"}):n===i-1&&r==="after"?f.jsx(g2,{isDropTarget:e,position:"after"}):f.jsx(KWe,{index:n,isDropTarget:e,onItemAdd:o})}function KWe(t){const{index:e,onItemAdd:n,isDropTarget:r}=t,[i,o]=I.useState(0);function a(){n(e+1),o(s=>s+1)}return f.jsx(A.HairlineButton,{icon:"add",size:"small",variant:"rightDashed",tooltip:{content:"Add item below"},onClick:a,dropMode:r,sx:{marginInline:4}},i)}function g2(t){const{isDropTarget:e,position:n}=t;return f.jsx(A.AnimatedElement,{enterDuration:150,animation:{name:"expand-vertical"},children:e&&f.jsx(A.Box,{children:f.jsx(A.Line,{color:"purple",thickness:2,sx:{width:"100%",marginBottom:n==="before"?4:void 0,marginTop:n==="after"?4:void 0}},"line")})})}function qWe(t){const{linkTo:e,onLinkToChange:n}=t,r=VWe(e);return f.jsx(MWe,{content:r,onContentChange:i=>n(zWe(i)),field:{type:"Link",config:{label:"Link",allowTargetBlank:!0,allowText:!1}},appearance:"condensedButtons"})}function VWe(t){const[e]=I.useState(()=>crypto.randomUUID());if(t)return{__TYPE__:"LinkContent",key:e,value:t}}function zWe(t){return t==null?void 0:t.value}function wJ(t){var C,y;const{allContentViews:e,content:n,contentView:r,fieldLabel:i,imageLabel:o,initialImages:a,isUpdating:s,page:l=0,readOnly:c,thumbnailName:u,onClear:d,onContentChange:p,onCropperDialogClose:h,onPageChange:m,onMediaDialogOpenChange:g}=t,v=((y=(C=n==null?void 0:n.url)==null?void 0:C.split("?")[0])==null?void 0:y.slice(-4))===".svg",b=n!=null&&n.url&&!c?"visible":"hidden",S=!ue.isImageContent(n);return f.jsxs(A.Box,{display:"flex",gap:12,padding:{inline:12},children:[f.jsx(A.Box,{children:f.jsx(A.Carousel,{getItemSource:zBe,items:e,onPageChange:m,page:l,buttonSize:"small",renderPrevTooltip:x=>f.jsx(A.Tooltip,{content:"Previous",children:x}),renderNextTooltip:x=>f.jsx(A.Tooltip,{content:"Next",children:x}),style:S?{width:181,height:142}:{width:123,height:93},children:x=>(x==null?void 0:x.url)&&f.jsx(A.CarouselItem,{"aria-label":"Image Field Item",src:KG(x.url),alt:x.alt??void 0,isUpdating:s,disableAnimation:S},`${u}_${x.url}`)})}),f.jsxs(A.Box,{width:"100%",display:"flex",flexDirection:"column",gap:S?16:12,children:[f.jsx(WNe,{fieldLabel:i,imageLabel:o,initialImages:a,page:l,displaySeparator:!S,isSVGContentView:v,visibility:b,onClear:d,onCropperDialogClose:h,onMediaDialogOpenChange:g}),f.jsx(NNe,{readOnly:c||!r,altText:(r==null?void 0:r.alt)??"",onValueChange:x=>{r&&p(WBe(u,n,r,x))}}),S&&f.jsx(qWe,{linkTo:n.linkTo,onLinkToChange:x=>{p({...n,linkTo:x})}})]})]})}function xJ(t){const{onMediaSelected:e}=t,n=Se(),{showAlert:r}=A.useAlert(),{mutate:i,isPending:o}=sr.useMutation({mutationFn:a=>EG({file:a,config:n}),onSuccess:a=>{e(a)},onError:()=>{r({title:"Error uploading image",subtitle:"Please try again"})}});return{uploadImage:i,isUploadingImage:o}}function QWe(t){const{content:e,onContentChange:n,field:r}=t,[i,o]=I.useState(0),[a,s]=I.useTransition(),l=UBe(r),c=l[i],u=e?NBe(r,e):void 0,d=u==null?void 0:u[i];function p(S){if(!c)return;const C=QBe(c.name,r,e,S);C!==e&&s(()=>n(C))}function h(S){s(()=>o(S))}function m({option:S,croppedImages:C}){if(o(S),!e)return;const y=Object.entries(C).reduce((x,[w,_])=>jNe({field:r,content:x,thumbnail:w,croppedImage:_}),e);y!==e&&s(()=>n(y))}function g(){o==null||o(0),n(void 0)}const{uploadImage:v,isUploadingImage:b}=xJ({onMediaSelected:p});return{onCropperDialogClose:m,onPageChange:h,onMediaSelected:p,isUpdating:a,page:i,thumbnail:c,allThumbnails:l,allContentViews:u,contentView:d,onClear:g,uploadImage:v,isUploadingImage:b}}function HWe(t){const{content:e,field:n,readOnly:r,onContentChange:i}=t,o=e&&e.origin.url.length>0,{onCropperDialogClose:a,onPageChange:s,isUpdating:l,page:c,onMediaSelected:u,thumbnail:d,allThumbnails:p,allContentViews:h,contentView:m,onClear:g,uploadImage:v,isUploadingImage:b}=QWe({field:n,content:e,onContentChange:i}),[S,C]=I.useState(!1),y=Fr(n),x=p.map((R,O)=>{const $=h==null?void 0:h[O];return{thumbnail:R,contentView:$,labels:lT(R,e,$)}}),w=d&&o?lT(d,e,m).filter(no.isDefined):[],_=d&&e&&o&&h,E=b||l;return f.jsx(sJ,{isMediaDialogOpen:S,onMediaSelected:u,onMediaDialogOpenChange:C,children:f.jsx(I.Suspense,{fallback:f.jsx("div",{style:{height:95}}),children:_?f.jsx(wJ,{allContentViews:h,content:e,contentView:m,fieldLabel:y,imageLabel:w,initialImages:x,isUpdating:E,page:c,readOnly:r,thumbnailName:d.name,onClear:g,onContentChange:i,onCropperDialogClose:a,onMediaDialogOpenChange:C,onPageChange:s}):f.jsx(lJ,{uploadImage:v,isUploading:b,disabled:r||S,children:f.jsx(iJ,{fieldLabel:y,isUpdating:E,readOnly:r,onMediaDialogOpenChange:C})})})})}function YWe(t){var v,b;const{searchTerm:e,catalogId:n}=t,r=Se();r.integrationFields||It("integrationFields");const{integrationFieldsApiBaseUrl:i,repository:o,authStrategy:a}=r,[s,l]=I.useState(1),[c,u]=I.useState([]),[d,p]=I.useState(""),h=et.useRequest(GWe,[i,a,o,n,e,e===d?s:1]);e!==d?(p(e),l(1),u(h.items)):h.items.length>0&&((v=_t.last(c))==null?void 0:v.id)!==((b=_t.last(h.items))==null?void 0:b.id)&&u(S=>S.concat(h.items));const m=s<h.totalPages;function g(){m&&l(S=>S+1)}return{items:c,response:h,fetchNextPage:g,hasNextPage:m}}function GWe(t,e,n,r,i,o=1,a=30){const s=new URL(`if/search/${r}`,t);return s.searchParams.set("searchTerm",i),s.searchParams.set("limit",a.toString()),s.searchParams.set("page",o.toString()),oe.request(s,{headers:{repository:n},credentials:oe.getRequestCredentials(e),okType:JWe})}const TJ=k.object({id:k.string(),title:k.string(),imageURL:k.string().optional(),description:k.string().optional()}),JWe=k.object({items:k.array(TJ),totalPages:k.number(),page:k.number()});function _J(t){const{itemId:e,catalogId:n}=t,r=Se();r.integrationFields||It("integrationFields");const{integrationFieldsApiBaseUrl:i,repository:o,authStrategy:a}=r,l=et.useRequest(ZWe,[i,a,o,n,e]).items[0];if(!l)throw new Error("Item not found");return{item:l}}function ZWe(t,e,n,r,i){const o=new URL(`if/read/${r}`,t);return o.searchParams.set("ids",[i].toString()),oe.request(o,{headers:{repository:n},credentials:oe.getRequestCredentials(e),okType:XWe})}const XWe=k.object({items:k.array(TJ)});function wj(t){const{item:e,onClick:n,catalogId:r}=t;return f.jsxs(A.PreviewCard,{variant:"large",onClick:n,children:[f.jsx(eKe,{src:e.imageURL??"",alt:e.title}),f.jsxs(A.PreviewContent,{children:[f.jsx(A.Badge,{title:`Catalog: ${r}`,icon:"multipleStop",size:"medium"}),f.jsx(A.Text,{variant:"bold",color:"grey12",sx:{marginTop:4},children:e.title}),f.jsx(A.Text,{variant:"small",color:"grey11",children:e.description??e.id})]})]})}const lv=76;function eKe(t){const{src:e,alt:n}=t;return e?f.jsx(A.PreviewImage,{src:e,alt:n,width:lv,height:lv,framed:!0}):f.jsxs(A.Box,{borderRadius:6,backgroundColor:"grey2",height:lv,width:lv,flexDirection:"column",alignItems:"center",justifyContent:"center",border:!0,padding:{inline:4,block:8},children:[f.jsx(A.Icon,{name:"hideImage",size:"large",color:"grey11"}),f.jsx(A.Text,{color:"grey11",variant:"small",noSelect:!0,align:"center",children:"No preview image"})]})}function bd(){return f.jsxs(A.PreviewCard,{variant:"large",children:[f.jsx(A.Skeleton,{height:76,width:76}),f.jsxs(A.PreviewContent,{children:[f.jsx(A.Skeleton,{height:24,width:168}),f.jsx(A.Skeleton,{height:24,width:240,sx:{marginTop:4}}),f.jsx(A.Skeleton,{height:16,width:144})]})]})}function tKe(t){const{open:e,onOpenChange:n,catalogId:r,onSelectItem:i}=t,o=qe.useDebounceState({initialState:""}),a=Se();return f.jsx(A.Dialog,{open:e,onOpenChange:n,hasClose:!1,size:{width:612,height:724},noDescription:!0,children:f.jsx(A.DialogContent,{children:f.jsxs(A.Box,{flexDirection:"column",height:"100%",children:[f.jsxs(A.Box,{padding:{top:16,inline:16},flexDirection:"column",gap:8,children:[f.jsx(A.FormSearchInput,{value:o.value,onValueChange:o.set,placeholder:"Search in your catalog"}),f.jsx(A.DialogTitle,{asChild:!0,children:f.jsx(A.Text,{variant:"smallBold",color:"grey11",children:"Select an item"})})]}),a.integrationFields?f.jsx(A.ErrorBoundary,{renderError:()=>f.jsx(pT,{message:"There was an error while fetching your catalog items."}),children:f.jsx(I.Suspense,{fallback:f.jsxs(A.Box,{flexDirection:"column",gap:12,padding:{top:10,inline:16,bottom:16},children:[f.jsx(bd,{}),f.jsx(bd,{}),f.jsx(bd,{}),f.jsx(bd,{}),f.jsx(bd,{})]}),children:f.jsx(nKe,{searchTerm:o.debouncedValue,catalogId:r,onItemClick:i})})}):f.jsx(pT,{message:"Slice Machine does not yet support mock data for integration field in the simulator."})]})})})}function nKe(t){const{catalogId:e,searchTerm:n,onItemClick:r}=t,[i,o]=I.useTransition(),{items:a,hasNextPage:s,fetchNextPage:l}=YWe({catalogId:e,searchTerm:n});return f.jsx(f.Fragment,{children:f.jsxs(A.ScrollArea,{onScrollToBottom:()=>s&&o(l),style:{flexGrow:1,paddingTop:A.theme.space[10],paddingBottom:A.theme.space[16],paddingInline:A.theme.space[16],display:"flex",flexDirection:"column",gap:A.theme.space[12]},threshold:252,children:[a.length===0?f.jsx(pT,{}):a.map(c=>f.jsx(wj,{item:c,catalogId:e,onClick:()=>r(c)},c.id)),f.jsx(A.AnimatedElement,{animation:{name:"fade"},children:i&&f.jsx(A.Text,{color:"grey11",align:"center",sx:{marginBlock:8},children:"Loading more results ..."})})]})})}function pT(t){const{message:e="We can't find any items matching your search"}=t,n="Oops!";return f.jsx(A.Box,{justifyContent:"center",flexDirection:"column",height:"100%",children:f.jsxs(A.BlankSlate,{children:[f.jsx(A.BlankSlateIcon,{name:"close",lineColor:"purple10",backgroundColor:"purple3",borderColor:"purple6",borderStyle:"dashed",size:"xlarge"}),f.jsx(A.BlankSlateTitle,{size:"big",children:n}),f.jsx(A.BlankSlateDescription,{width:360,children:e})]})})}function rKe(t){const{itemId:e,item:n}=t,r=Se();return e&&n&&n.id===e?f.jsx(Cd,{...t,value:n.title}):e&&r.integrationFields?f.jsx(A.ErrorBoundary,{renderError:()=>f.jsx(Cd,{...t,value:e}),children:f.jsx(I.Suspense,{fallback:f.jsx(Cd,{...t,value:e}),children:f.jsx(aKe,{...t,itemId:e})},e)},e):e&&!r.integrationFields?f.jsx(Cd,{...t,value:e}):f.jsx(Cd,{...t,value:""})}function iKe(t){const{catalogId:e,itemId:n,item:r}=t,i=Se();return n&&r&&r.id===n?f.jsx(A.FieldFooter,{children:f.jsx(wj,{catalogId:e,item:r})}):n&&i.integrationFields?f.jsx(A.ErrorBoundary,{renderError:()=>null,children:f.jsx(A.FieldFooter,{children:f.jsx(I.Suspense,{fallback:f.jsx(bd,{}),children:f.jsx(oKe,{catalogId:e,itemId:n})},n)})},n):null}function oKe(t){const{itemId:e,catalogId:n}=t,{item:r}=_J({catalogId:n,itemId:e});return f.jsx(wj,{catalogId:n,item:r})}function Cd(t){const{id:e,field:n,readOnly:r,value:i,onFocus:o,onClearItem:a}=t;return f.jsx(Jl,{id:e,placeholder:od(n),readOnly:!0,variant:"link",value:i,...!r&&{cursor:"pointer",onFocus:o},endAdornment:f.jsx(A.Button,{startIcon:"close",color:"grey",size:"small",disabled:!i,onClick:a})})}function aKe(t){const{itemId:e,catalogId:n}=t,{item:r}=_J({catalogId:n,itemId:e});return f.jsx(Cd,{...t,value:r.title})}function sKe(t){var h;const{id:e,field:n,content:r,readOnly:i,onContentChange:o}=t,[a,s]=I.useState(!1),[l,c]=I.useState(),u=(h=n.config)==null?void 0:h.catalog;if(!u)return null;function d(m){o({value:m.id,__TYPE__:"IntegrationFieldsContent"}),c(m),s(!1)}function p(){o(void 0),c(void 0)}return f.jsxs(f.Fragment,{children:[f.jsxs(A.Field,{footer:f.jsx(iKe,{catalogId:u,item:l,itemId:r==null?void 0:r.value}),children:[f.jsx(A.FieldIcon,{name:"multipleStop"}),f.jsx(A.FieldLabel,{htmlFor:e,children:Fr(n)}),f.jsx(A.FieldControl,{children:f.jsx(rKe,{id:e,field:n,readOnly:i,catalogId:u,item:l,itemId:r==null?void 0:r.value,onFocus:()=>s(!0),onClearItem:p})})]}),f.jsx(tKe,{open:a,onOpenChange:s,catalogId:u,onSelectItem:d})]})}function IJ(t){const{content:e,field:n,id:r,onContentChange:i,readOnly:o,endAdornment:a,placeholder:s}=t;return f.jsxs(A.Field,{children:[f.jsx(A.FieldIcon,{name:"notes"}),f.jsx(A.FieldLabel,{htmlFor:r,children:Fr(n)}),f.jsxs(A.FieldControl,{children:[f.jsx(A.TextArea,{id:r,placeholder:s||od(n),readOnly:o,paddingLeft:4,paddingRight:12,sx:{flexGrow:1},value:(e==null?void 0:e.value)??"",onChange:l=>{i(lKe(l))}}),a]})]})}function lKe(t){return t.length===0?void 0:{__TYPE__:"FieldContent",type:"Text",value:t}}function cKe(t){var s;const{content:e,id:n,field:r,onContentChange:i,readOnly:o}=t,a={id:n,readOnly:o,onContentChange:i};return(s=r.config)!=null&&s.repeat?f.jsx(PWe,{...a,field:r,content:DY(e)}):f.jsx(Sj,{...a,field:r,content:PY(e)})}const uKe=({content:t,field:e,id:n,onContentChange:r,readOnly:i})=>{var s,l;const o=Number(t==null?void 0:t.value),a=Number.isFinite(o)?o:void 0;return f.jsxs(A.Field,{children:[f.jsx(A.FieldIcon,{name:"pin"}),f.jsx(A.FieldLabel,{htmlFor:n,children:Fr(e)}),f.jsx(A.FieldControl,{children:f.jsx(A.NumberInput,{id:n,value:a,min:(s=e.config)==null?void 0:s.min,max:(l=e.config)==null?void 0:l.max,padding:eJ,placeholder:od(e),readOnly:i,onValueChange:c=>r(dKe(c))})})]})};function dKe(t){return t===void 0?void 0:{__TYPE__:"FieldContent",type:"Number",value:String(t)}}function kn(t){this.content=t}kn.prototype={constructor:kn,find:function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return-1},get:function(t){var e=this.find(t);return e==-1?void 0:this.content[e+1]},update:function(t,e,n){var r=n&&n!=t?this.remove(n):this,i=r.find(t),o=r.content.slice();return i==-1?o.push(n||t,e):(o[i+1]=e,n&&(o[i]=n)),new kn(o)},remove:function(t){var e=this.find(t);if(e==-1)return this;var n=this.content.slice();return n.splice(e,2),new kn(n)},addToStart:function(t,e){return new kn([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new kn(n)},addBefore:function(t,e,n){var r=this.remove(e),i=r.content.slice(),o=r.find(t);return i.splice(o==-1?i.length:o,0,e,n),new kn(i)},forEach:function(t){for(var e=0;e<this.content.length;e+=2)t(this.content[e],this.content[e+1])},prepend:function(t){return t=kn.from(t),t.size?new kn(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=kn.from(t),t.size?new kn(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=kn.from(t);for(var n=0;n<t.content.length;n+=2)e=e.remove(t.content[n]);return e},toObject:function(){var t={};return this.forEach(function(e,n){t[e]=n}),t},get size(){return this.content.length>>1}};kn.from=function(t){if(t instanceof kn)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new kn(e)};function EJ(t,e,n){for(let r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;let i=t.child(r),o=e.child(r);if(i==o){n+=i.nodeSize;continue}if(!i.sameMarkup(o))return n;if(i.isText&&i.text!=o.text){for(let a=0;i.text[a]==o.text[a];a++)n++;return n}if(i.content.size||o.content.size){let a=EJ(i.content,o.content,n+1);if(a!=null)return a}n+=i.nodeSize}}function RJ(t,e,n,r){for(let i=t.childCount,o=e.childCount;;){if(i==0||o==0)return i==o?null:{a:n,b:r};let a=t.child(--i),s=e.child(--o),l=a.nodeSize;if(a==s){n-=l,r-=l;continue}if(!a.sameMarkup(s))return{a:n,b:r};if(a.isText&&a.text!=s.text){let c=0,u=Math.min(a.text.length,s.text.length);for(;c<u&&a.text[a.text.length-c-1]==s.text[s.text.length-c-1];)c++,n--,r--;return{a:n,b:r}}if(a.content.size||s.content.size){let c=RJ(a.content,s.content,n-1,r-1);if(c)return c}n-=l,r-=l}}class B{constructor(e,n){if(this.content=e,this.size=n||0,n==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,n,r,i=0,o){for(let a=0,s=0;s<n;a++){let l=this.content[a],c=s+l.nodeSize;if(c>e&&r(l,i+s,o||null,a)!==!1&&l.content.size){let u=s+1;l.nodesBetween(Math.max(0,e-u),Math.min(l.content.size,n-u),r,i+u)}s=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,r,i){let o="",a=!0;return this.nodesBetween(e,n,(s,l)=>{let c=s.isText?s.text.slice(Math.max(e,l)-l,n-l):s.isLeaf?i?typeof i=="function"?i(s):i:s.type.spec.leafText?s.type.spec.leafText(s):"":"";s.isBlock&&(s.isLeaf&&c||s.isTextblock)&&r&&(a?a=!1:o+=r),o+=c},0),o}append(e){if(!e.size)return this;if(!this.size)return e;let n=this.lastChild,r=e.firstChild,i=this.content.slice(),o=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),o=1);o<e.content.length;o++)i.push(e.content[o]);return new B(i,this.size+e.size)}cut(e,n=this.size){if(e==0&&n==this.size)return this;let r=[],i=0;if(n>e)for(let o=0,a=0;a<n;o++){let s=this.content[o],l=a+s.nodeSize;l>e&&((a<e||l>n)&&(s.isText?s=s.cut(Math.max(0,e-a),Math.min(s.text.length,n-a)):s=s.cut(Math.max(0,e-a-1),Math.min(s.content.size,n-a-1))),r.push(s),i+=s.nodeSize),a=l}return new B(r,i)}cutByIndex(e,n){return e==n?B.empty:e==0&&n==this.content.length?this:new B(this.content.slice(e,n))}replaceChild(e,n){let r=this.content[e];if(r==n)return this;let i=this.content.slice(),o=this.size+n.nodeSize-r.nodeSize;return i[e]=n,new B(i,o)}addToStart(e){return new B([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new B(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let n=0;n<this.content.length;n++)if(!this.content[n].eq(e.content[n]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let n=this.content[e];if(!n)throw new RangeError("Index "+e+" out of range for "+this);return n}maybeChild(e){return this.content[e]||null}forEach(e){for(let n=0,r=0;n<this.content.length;n++){let i=this.content[n];e(i,r,n),r+=i.nodeSize}}findDiffStart(e,n=0){return EJ(this,e,n)}findDiffEnd(e,n=this.size,r=e.size){return RJ(this,e,n,r)}findIndex(e,n=-1){if(e==0)return cv(0,e);if(e==this.size)return cv(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let r=0,i=0;;r++){let o=this.child(r),a=i+o.nodeSize;if(a>=e)return a==e||n>0?cv(r+1,a):cv(r,i);i=a}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,n){if(!n)return B.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new B(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return B.empty;let n,r=0;for(let i=0;i<e.length;i++){let o=e[i];r+=o.nodeSize,i&&o.isText&&e[i-1].sameMarkup(o)?(n||(n=e.slice(0,i)),n[n.length-1]=o.withText(n[n.length-1].text+o.text)):n&&n.push(o)}return new B(n||e,r)}static from(e){if(!e)return B.empty;if(e instanceof B)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new B([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}B.empty=new B([],0);const Mw={index:0,offset:0};function cv(t,e){return Mw.index=t,Mw.offset=e,Mw}function wy(t,e){if(t===e)return!0;if(!(t&&typeof t=="object")||!(e&&typeof e=="object"))return!1;let n=Array.isArray(t);if(Array.isArray(e)!=n)return!1;if(n){if(t.length!=e.length)return!1;for(let r=0;r<t.length;r++)if(!wy(t[r],e[r]))return!1}else{for(let r in t)if(!(r in e)||!wy(t[r],e[r]))return!1;for(let r in e)if(!(r in t))return!1}return!0}let ct=class hT{constructor(e,n){this.type=e,this.attrs=n}addToSet(e){let n,r=!1;for(let i=0;i<e.length;i++){let o=e[i];if(this.eq(o))return e;if(this.type.excludes(o.type))n||(n=e.slice(0,i));else{if(o.type.excludes(this.type))return e;!r&&o.type.rank>this.type.rank&&(n||(n=e.slice(0,i)),n.push(this),r=!0),n&&n.push(o)}}return n||(n=e.slice()),r||n.push(this),n}removeFromSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return e.slice(0,n).concat(e.slice(n+1));return e}isInSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return!0;return!1}eq(e){return this==e||this.type==e.type&&wy(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[n.type];if(!r)throw new RangeError(`There is no mark type ${n.type} in this schema`);let i=r.create(n.attrs);return r.checkAttrs(i.attrs),i}static sameSet(e,n){if(e==n)return!0;if(e.length!=n.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(n[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return hT.none;if(e instanceof hT)return[e];let n=e.slice();return n.sort((r,i)=>r.type.rank-i.type.rank),n}};ct.none=[];class Gc extends Error{}class W{constructor(e,n,r){this.content=e,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,n){let r=$J(this.content,e+this.openStart,n);return r&&new W(r,this.openStart,this.openEnd)}removeBetween(e,n){return new W(kJ(this.content,e+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,n){if(!n)return W.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new W(B.fromJSON(e,n.content),r,i)}static maxOpen(e,n=!0){let r=0,i=0;for(let o=e.firstChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.firstChild)r++;for(let o=e.lastChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.lastChild)i++;return new W(e,r,i)}}W.empty=new W(B.empty,0,0);function kJ(t,e,n){let{index:r,offset:i}=t.findIndex(e),o=t.maybeChild(r),{index:a,offset:s}=t.findIndex(n);if(i==e||o.isText){if(s!=n&&!t.child(a).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=a)throw new RangeError("Removing non-flat range");return t.replaceChild(r,o.copy(kJ(o.content,e-i-1,n-i-1)))}function $J(t,e,n,r){let{index:i,offset:o}=t.findIndex(e),a=t.maybeChild(i);if(o==e||a.isText)return r&&!r.canReplace(i,i,n)?null:t.cut(0,e).append(n).append(t.cut(e));let s=$J(a.content,e-o-1,n);return s&&t.replaceChild(i,a.copy(s))}function fKe(t,e,n){if(n.openStart>t.depth)throw new Gc("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new Gc("Inconsistent open depths");return OJ(t,e,n,0)}function OJ(t,e,n,r){let i=t.index(r),o=t.node(r);if(i==e.index(r)&&r<t.depth-n.openStart){let a=OJ(t,e,n,r+1);return o.copy(o.content.replaceChild(i,a))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&t.depth==r&&e.depth==r){let a=t.parent,s=a.content;return Ec(a,s.cut(0,t.parentOffset).append(n.content).append(s.cut(e.parentOffset)))}else{let{start:a,end:s}=pKe(n,t);return Ec(o,FJ(t,a,s,e,r))}else return Ec(o,xy(t,e,r))}function MJ(t,e){if(!e.type.compatibleContent(t.type))throw new Gc("Cannot join "+e.type.name+" onto "+t.type.name)}function mT(t,e,n){let r=t.node(n);return MJ(r,e.node(n)),r}function Ic(t,e){let n=e.length-1;n>=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function _h(t,e,n,r){let i=(e||t).node(n),o=0,a=e?e.index(n):i.childCount;t&&(o=t.index(n),t.depth>n?o++:t.textOffset&&(Ic(t.nodeAfter,r),o++));for(let s=o;s<a;s++)Ic(i.child(s),r);e&&e.depth==n&&e.textOffset&&Ic(e.nodeBefore,r)}function Ec(t,e){return t.type.checkContent(e),t.copy(e)}function FJ(t,e,n,r,i){let o=t.depth>i&&mT(t,e,i+1),a=r.depth>i&&mT(n,r,i+1),s=[];return _h(null,t,i,s),o&&a&&e.index(i)==n.index(i)?(MJ(o,a),Ic(Ec(o,FJ(t,e,n,r,i+1)),s)):(o&&Ic(Ec(o,xy(t,e,i+1)),s),_h(e,n,i,s),a&&Ic(Ec(a,xy(n,r,i+1)),s)),_h(r,null,i,s),new B(s)}function xy(t,e,n){let r=[];if(_h(null,t,n,r),t.depth>n){let i=mT(t,e,n+1);Ic(Ec(i,xy(t,e,n+1)),r)}return _h(e,null,n,r),new B(r)}function pKe(t,e){let n=e.depth-t.openStart,i=e.node(n).copy(t.content);for(let o=n-1;o>=0;o--)i=e.node(o).copy(B.from(i));return{start:i.resolveNoCache(t.openStart+n),end:i.resolveNoCache(i.content.size-t.openEnd-n)}}class Am{constructor(e,n,r){this.pos=e,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,n=this.index(this.depth);if(n==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=e.child(n);return r?e.child(n).cut(r):i}get nodeBefore(){let e=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(e).cut(0,n):e==0?null:this.parent.child(e-1)}posAtIndex(e,n){n=this.resolveDepth(n);let r=this.path[n*3],i=n==0?0:this.path[n*3-1]+1;for(let o=0;o<e;o++)i+=r.child(o).nodeSize;return i}marks(){let e=this.parent,n=this.index();if(e.content.size==0)return ct.none;if(this.textOffset)return e.child(n).marks;let r=e.maybeChild(n-1),i=e.maybeChild(n);if(!r){let s=r;r=i,i=s}let o=r.marks;for(var a=0;a<o.length;a++)o[a].type.spec.inclusive===!1&&(!i||!o[a].isInSet(i.marks))&&(o=o[a--].removeFromSet(o));return o}marksAcross(e){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let r=n.marks,i=e.parent.maybeChild(e.index());for(var o=0;o<r.length;o++)r[o].type.spec.inclusive===!1&&(!i||!r[o].isInSet(i.marks))&&(r=r[o--].removeFromSet(r));return r}sharedDepth(e){for(let n=this.depth;n>0;n--)if(this.start(n)<=e&&this.end(n)>=e)return n;return 0}blockRange(e=this,n){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!n||n(this.node(r))))return new Ty(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let n=1;n<=this.depth;n++)e+=(e?"/":"")+this.node(n).type.name+"_"+this.index(n-1);return e+":"+this.parentOffset}static resolve(e,n){if(!(n>=0&&n<=e.content.size))throw new RangeError("Position "+n+" out of range");let r=[],i=0,o=n;for(let a=e;;){let{index:s,offset:l}=a.content.findIndex(o),c=o-l;if(r.push(a,s,i+l),!c||(a=a.child(s),a.isText))break;o=c-1,i+=l+1}return new Am(n,r,o)}static resolveCached(e,n){let r=v2.get(e);if(r)for(let o=0;o<r.elts.length;o++){let a=r.elts[o];if(a.pos==n)return a}else v2.set(e,r=new hKe);let i=r.elts[r.i]=Am.resolve(e,n);return r.i=(r.i+1)%mKe,i}}class hKe{constructor(){this.elts=[],this.i=0}}const mKe=12,v2=new WeakMap;class Ty{constructor(e,n,r){this.$from=e,this.$to=n,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const AKe=Object.create(null);let Xs=class AT{constructor(e,n,r,i=ct.none){this.type=e,this.attrs=n,this.marks=i,this.content=r||B.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,n,r,i=0){this.content.nodesBetween(e,n,r,i,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,n,r,i){return this.content.textBetween(e,n,r,i)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,n,r){return this.type==e&&wy(this.attrs,n||e.defaultAttrs||AKe)&&ct.sameSet(this.marks,r||ct.none)}copy(e=null){return e==this.content?this:new AT(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new AT(this.type,this.attrs,this.content,e)}cut(e,n=this.content.size){return e==0&&n==this.content.size?this:this.copy(this.content.cut(e,n))}slice(e,n=this.content.size,r=!1){if(e==n)return W.empty;let i=this.resolve(e),o=this.resolve(n),a=r?0:i.sharedDepth(n),s=i.start(a),c=i.node(a).content.cut(i.pos-s,o.pos-s);return new W(c,i.depth-a,o.depth-a)}replace(e,n,r){return fKe(this.resolve(e),this.resolve(n),r)}nodeAt(e){for(let n=this;;){let{index:r,offset:i}=n.content.findIndex(e);if(n=n.maybeChild(r),!n)return null;if(i==e||n.isText)return n;e-=i+1}}childAfter(e){let{index:n,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(n),index:n,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:n,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(n),index:n,offset:r};let i=this.content.child(n-1);return{node:i,index:n-1,offset:r-i.nodeSize}}resolve(e){return Am.resolveCached(this,e)}resolveNoCache(e){return Am.resolve(this,e)}rangeHasMark(e,n,r){let i=!1;return n>e&&this.nodesBetween(e,n,o=>(r.isInSet(o.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),jJ(this.marks,e)}contentMatchAt(e){let n=this.type.contentMatch.matchFragment(this.content,0,e);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(e,n,r=B.empty,i=0,o=r.childCount){let a=this.contentMatchAt(e).matchFragment(r,i,o),s=a&&a.matchFragment(this.content,n);if(!s||!s.validEnd)return!1;for(let l=i;l<o;l++)if(!this.type.allowsMarks(r.child(l).marks))return!1;return!0}canReplaceWith(e,n,r,i){if(i&&!this.type.allowsMarks(i))return!1;let o=this.contentMatchAt(e).matchType(r),a=o&&o.matchFragment(this.content,n);return a?a.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=ct.none;for(let n=0;n<this.marks.length;n++){let r=this.marks[n];r.type.checkAttrs(r.attrs),e=r.addToSet(e)}if(!ct.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(n=>n.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(n=>n.toJSON())),e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(e.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(n.text,r)}let i=B.fromJSON(e,n.content),o=e.nodeType(n.type).create(n.attrs,i,r);return o.type.checkAttrs(o.attrs),o}};Xs.prototype.text=void 0;class _y extends Xs{constructor(e,n,r,i){if(super(e,n,null,i),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):jJ(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,n){return this.text.slice(e,n)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new _y(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new _y(this.type,this.attrs,e,this.marks)}cut(e=0,n=this.text.length){return e==0&&n==this.text.length?this:this.withText(this.text.slice(e,n))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function jJ(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class Jc{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new gKe(e,n);if(r.next==null)return Jc.empty;let i=LJ(r);r.next&&r.err("Unexpected trailing text");let o=xKe(wKe(i));return TKe(o,r),o}matchType(e){for(let n=0;n<this.next.length;n++)if(this.next[n].type==e)return this.next[n].next;return null}matchFragment(e,n=0,r=e.childCount){let i=this;for(let o=n;i&&o<r;o++)i=i.matchType(e.child(o).type);return i}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:n}=this.next[e];if(!(n.isText||n.hasRequiredAttrs()))return n}return null}compatible(e){for(let n=0;n<this.next.length;n++)for(let r=0;r<e.next.length;r++)if(this.next[n].type==e.next[r].type)return!0;return!1}fillBefore(e,n=!1,r=0){let i=[this];function o(a,s){let l=a.matchFragment(e,r);if(l&&(!n||l.validEnd))return B.from(s.map(c=>c.createAndFill()));for(let c=0;c<a.next.length;c++){let{type:u,next:d}=a.next[c];if(!(u.isText||u.hasRequiredAttrs())&&i.indexOf(d)==-1){i.push(d);let p=o(d,s.concat(u));if(p)return p}}return null}return o(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let n=this.computeWrapping(e);return this.wrapCache.push(e,n),n}computeWrapping(e){let n=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let i=r.shift(),o=i.match;if(o.matchType(e)){let a=[];for(let s=i;s.type;s=s.via)a.push(s.type);return a.reverse()}for(let a=0;a<o.next.length;a++){let{type:s,next:l}=o.next[a];!s.isLeaf&&!s.hasRequiredAttrs()&&!(s.name in n)&&(!i.type||l.validEnd)&&(r.push({match:s.contentMatch,type:s,via:i}),n[s.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function n(r){e.push(r);for(let i=0;i<r.next.length;i++)e.indexOf(r.next[i].next)==-1&&n(r.next[i].next)}return n(this),e.map((r,i)=>{let o=i+(r.validEnd?"*":" ")+" ";for(let a=0;a<r.next.length;a++)o+=(a?", ":"")+r.next[a].type.name+"->"+e.indexOf(r.next[a].next);return o}).join(`
69
+ npx @slicemachine/init@latest --repository ${i??"<my-project>"}`,language:"bash",title:"Terminal",showLineNumbers:!1})]})},{id:"createPageType",title:"Create a Page Type",description:"Build the structure of your page",videoUrl:"https://res.cloudinary.com/dmtf1daqp/video/upload/v1721918320/DEV_TOOLS/ONBOARDING_GUIDE/Create_page_type_xdn13j.mp4",content:f.jsx(A.Text,{children:"A page type is a base content structure editors will use to create pages in the Page Builder (Prismic's content creation UI). A page type can be reusable (e.g., for multiple blog posts) or single (e.g., for a one-time page like the homepage)."})},{id:"codePage",title:"Code Your Page Type",description:"Prepare code to fetch content",videoUrl:"https://res.cloudinary.com/dmtf1daqp/video/upload/v1721918320/DEV_TOOLS/ONBOARDING_GUIDE/Step2_code_your_page_jatiur.mp4",content:f.jsx(A.Text,{children:"Prepare your code to query the content from the Prismic API."})},{id:"createSlice",title:"Create a Slice",description:"Build a reusable website section",videoUrl:"https://res.cloudinary.com/dmtf1daqp/video/upload/v1721918322/DEV_TOOLS/ONBOARDING_GUIDE/Step3_add_slice_qzmvxf.mp4",content:f.jsx(A.Text,{children:"Slices are website sections that can be reused on different pages with different content. Each slice has a code component automatically generated by Slice Machine. Start with a template and look at your code to see how it's structured."})},{id:"reviewAndPush",title:"Review and Push changes",description:"Enable editors to create content",videoUrl:"https://res.cloudinary.com/dmtf1daqp/video/upload/v1721918320/DEV_TOOLS/ONBOARDING_GUIDE/DevTools_Squad_push_changes_ovvmul.mp4",content:f.jsx(A.Text,{children:"Your page types and slices currently exist only in your local project. Push them to your repository to make them available for your content editors."})},{id:"createContent",title:"Create Content",description:"Publish a page to the Prismic API",videoUrl:"https://res.cloudinary.com/dmtf1daqp/video/upload/v1732631905/DEV_TOOLS/ONBOARDING_GUIDE/step_9_create_content_y8m3m0.mp4",content:f.jsx(A.Text,{children:"In Prismic, content creation takes place in the Prismic Page Builder UI. Open the Page Builder and start creating your first page."})},{id:"renderPage",title:"Render Your Page",description:"View your page in the browser",videoUrl:"https://res.cloudinary.com/dmtf1daqp/video/upload/v1721918321/DEV_TOOLS/ONBOARDING_GUIDE/Step_6_Render_Page_tnauh9.mp4",content:f.jsxs(A.Text,{children:["Now that your content is published, you can run your project in your terminal and visit the page on your local server (e.g.,"," ",f.jsx(A.Text,{component:"code",children:"localhost:3000/example-page"}),"). Your content should now be visible!"]})}],l={next:"https://prismic.dev/course/next",nuxt:"https://prismic.dev/course/nuxt",sveltekit:"https://prismic.dev/course/sveltekit"};return{steps:s,defaultCompletedStepIds:s.flatMap(c=>c.defaultCompleted?[c.id]:[]),tutorialLink:e?l[e]:void 0}}function QUe(t){const{framework:e}=t;if(!e||e==="other")return{frameworkNameLabel:"",createProjectCodeSnippet:""};const n=iU[e];return{frameworkNameLabel:n?`${n} `:"",createProjectCodeSnippet:oU[e]}}const kw=3e3,u2=400;function HUe(t){const{onboardingState:e,tracking:n,onToggleStep:r,onToggleGuide:i,fallback:o=null,stepOverrides:a,repositoryName:s,projectName:l}=t,{context:c,isDismissed:u}=e,{steps:d,defaultCompletedStepIds:p,tutorialLink:h}=zUe({...c,repositoryName:s,projectName:l}),m=S(e.completedSteps),g=YUe(v,u2);if(qe.useOnChange(u,()=>!u&&g.reset()),c.framework==="other")return f.jsx(f.Fragment,{children:o});function v(){i()}async function b(C){const y=await r(C.id);y.includes(C.id)&&n.track({event:"shared-onboarding:step-completed",stepId:C.id,stepTitle:C.title,source:n.source}),S(y).length===d.length&&(n.track({event:"shared-onboarding:completed",source:n.source}),g.start())}function S(C){const y=d.map(({id:x})=>x);return Array.from(new Set([...C.filter(x=>y.includes(x)),...p]))}return u?null:f.jsx(A.AnimatedElement,{enterDuration:0,exitDuration:u2,children:g.status!=="hidden"&&f.jsxs("div",{ref:g.refs.container,style:{position:"relative"},children:[f.jsx(VUe,{steps:d,completedSteps:m,tutorialLink:h,tracking:n,onToggleStep:b,onClose:g.status!=="animating"?v:void 0,stepOverrides:a}),f.jsx("div",{ref:g.refs.cannon,style:{position:"absolute",bottom:0,left:0}})]})})}function YUe(t,e=400){const n=Zte.useConfetti({config:{duration:kw}}),[r,i]=I.useState("visible"),o=I.useRef(!1),a=I.useCallback(()=>{i("animating"),setTimeout(()=>i("hidden"),kw-e),o.current||(setTimeout(t,kw),o.current=!0)},[t,e]),s=()=>{n.throwConfetti(),a()},l=I.useCallback(()=>{i("visible"),o.current=!1},[]);return{refs:{container:n.confettiContainerRef,cannon:n.confettiCannonRef},status:r,start:s,reset:l}}function HG(t){const{type:e,value:n}=t,r=e===Aa?pm.max:hm.max;return f.jsx(A.Box,{alignItems:"center",children:f.jsx(A.Tooltip,{title:GUe[e],content:XUe[e],stableMount:!0,children:f.jsx(A.Badge,{title:`${n.length} characters`,size:"medium",color:n.length>r?"tomato":"green",sx:{alignSelf:"center"}})})})}const GUe={[Aa]:"Meta title length",[Rs]:"Meta description length"},JUe=`${pm.min}-${pm.max}`,ZUe=`${hm.min}-${hm.max}`,XUe={[Aa]:`For optimal mobile SEO, keep your meta title within ${JUe} characters to prevent it from being cut off in search results.`,[Rs]:`To ensure your meta description isn’t truncated in mobile search results, aim for ${ZUe} characters. This helps improve visibility and click-through rates.`};function YG(t){const{title:e,description:n}=t;return f.jsx(A.Card,{paddingBlock:8,paddingInline:8,variant:"highlighted",children:f.jsxs(A.CardContent,{gap:4,children:[f.jsx(A.Text,{color:"indigo11",variant:"h4",noSelect:!0,children:nr.overflow(e,pm.max)}),f.jsx(A.Text,{color:"green11",noSelect:!0,children:"https://www.yourdomain.com/"}),f.jsx(A.Text,{variant:"small",color:"grey11",noSelect:!0,children:nr.overflow(n,hm.max)})]})})}const GG=I.createContext({editedUID:{current:!1},onEditUID:()=>{}});function JG(t){return Object.values(t.json).some(e=>{var n;return((n=e.uid)==null?void 0:n.type)==="UID"})}function eNe(t){const{content:e,customType:n}=t;return JG(n)&&!e.uid}function ZG(t){const{documentId:e,documentsWithUid:n,uid:r}=t;return n.filter(i=>e!==i.id&&nNe({document:i,uid:r})&&tNe({...t,document:i}))}function tNe(t){const{customTypeId:e,languageId:n,document:r}=t,i=e===r.custom_type_id,o=n===r.language.id;return i&&o}function nNe(t){const{document:e,uid:n}=t,r=e.versions.filter(i=>i.uid===n);return r.length===0?!0:r.some(i=>i.status!=="archived")}const ml=I.createContext(void 0);function rNe(t){const{customTypeFormat:e,children:n}=t,r=I.useMemo(()=>({customTypeFormat:e,isInSlice:!1,isInGroup:!1,isInRepeatable:!1}),[e]);return f.jsx(ml.Provider,{value:r,children:n})}function iNe(t){const{children:e}=t,n=I.useContext(ml),r=I.useMemo(()=>n&&{...n,isInSlice:!0},[n]);return f.jsx(ml.Provider,{value:r,children:e})}function oNe(t){const{children:e}=t,n=I.useContext(ml),r=I.useMemo(()=>n&&{...n,isInGroup:!0},[n]);return f.jsx(ml.Provider,{value:r,children:e})}function aNe(t){const{children:e}=t,n=I.useContext(ml),r=I.useMemo(()=>n&&{...n,isInRepeatable:!0},[n]);return f.jsx(ml.Provider,{value:r,children:e})}function sNe(){return I.useContext(ml)}function zC(t,e){return`${t}___${e}`}const XG=I.createContext({ids:[],isSelected:()=>!1,update:()=>{}});function QC(){return I.useContext(XG)}function Fr(t){var e;return(e=t.config)!=null&&e.label?t.config.label:t.type!=="Boolean"&&t.type!=="Separator"&&t.type!=="Table"&&t.fieldset?t.fieldset:t.type}const bj="...";function lNe(t,e,n=bj){var r,i;return(e?(r=t.config)==null?void 0:r.placeholder_true:(i=t.config)==null?void 0:i.placeholder_false)||n}function od(t,e=bj){var n;return((n=t.config)==null?void 0:n.placeholder)||e}function cNe(t){var s;const{content:e,field:n,id:r,readOnly:i,onContentChange:o}=t,a=(e==null?void 0:e.value)??((s=n.config)==null?void 0:s.default_value)??!1;return f.jsxs(A.Field,{children:[f.jsx(A.FieldIcon,{name:"biToggle"}),f.jsx(A.FieldLabel,{htmlFor:r,children:Fr(n)}),f.jsxs(A.FieldControl,{children:[f.jsx(A.Box,{padding:4,alignItems:"center",children:f.jsx(A.Text,{children:lNe(n,a)})}),f.jsx(A.Switch,{id:r,sx:{alignSelf:"center",marginLeft:"auto",marginRight:12},checked:a,onCheckedChange:l=>{i||o(uNe(l))}})]})]})}function uNe(t){return{__TYPE__:"BooleanContent",value:t}}function dNe(t){const{id:e,field:n,content:r,onContentChange:i}=t;return f.jsxs(A.Field,{children:[f.jsx(A.FieldIcon,{name:"colorLens"}),f.jsx(A.FieldLabel,{id:e,children:Fr(n)}),f.jsx(A.FieldControl,{children:f.jsx(A.Box,{padding:{left:4},alignItems:"center",children:f.jsx(A.ColorInput,{onValueChange:o=>i(fNe(o)),value:r==null?void 0:r.value,"aria-labelledby":e,placeholder:od(n)})})})]})}function fNe(t){return t===void 0?void 0:{__TYPE__:"FieldContent",type:"Color",value:t}}function pNe(t){const{id:e,readOnly:n,field:r,content:i,onContentChange:o}=t,a=i!=null&&i.value?v_.dateFromISOString(i.value):void 0;return f.jsxs(A.Field,{children:[f.jsx(A.FieldIcon,{name:"dateRange"}),f.jsx(A.FieldLabel,{id:e,children:Fr(r)}),f.jsx(A.FieldControl,{children:f.jsx(A.Box,{padding:{left:4,right:12},width:"100%",flexDirection:"column",justifyContent:"center",children:f.jsx(A.DateInput,{mode:"date","aria-labelledby":e,disabled:n,value:a,onValueChange:s=>o(hNe(s))})})})]})}function hNe(t){if(t)return{__TYPE__:"FieldContent",type:"Date",value:mNe(t)}}function mNe(t){const e=`${t.getFullYear()}`.padStart(4,"0"),n=`${t.getMonth()+1}`.padStart(2,"0"),r=`${t.getDate()}`.padStart(2,"0");return`${e}-${n}-${r}`}const Jl=I.forwardRef(function(e,n){const{padding:r=eJ,...i}=e;return f.jsx(A.TextInput,{...i,padding:r,ref:n,sx:{...e.sx,alignSelf:"stretch"}})}),eJ={input:{inline:4},adornment:{inline:12}},ANe=({provider:t})=>gNe[t.toLowerCase()]??f.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[f.jsx("g",{clipPath:"url(#clip0_6524_22412)",children:f.jsx("path",{d:"M7.99992 1.33333C4.31992 1.33333 1.33325 4.32 1.33325 8C1.33325 11.68 4.31992 14.6667 7.99992 14.6667C11.6799 14.6667 14.6666 11.68 14.6666 8C14.6666 4.32 11.6799 1.33333 7.99992 1.33333ZM2.66659 8C2.66659 7.59333 2.71992 7.19333 2.80659 6.81333L5.99325 10V10.6667C5.99325 11.4 6.59325 12 7.32658 12V13.2867C4.70658 12.9533 2.66659 10.7133 2.66659 8ZM11.9266 11.6C11.7533 11.06 11.2599 10.6667 10.6599 10.6667H9.99325V8.66667C9.99325 8.3 9.69325 8 9.32658 8H5.32658V6.66667H6.65992C7.02658 6.66667 7.32658 6.36667 7.32658 6V4.66667H8.65992C9.39325 4.66667 9.99325 4.06667 9.99325 3.33333V3.06C11.9466 3.84667 13.3333 5.76667 13.3333 8C13.3333 9.38667 12.7933 10.6533 11.9266 11.6Z",fill:"#6F6E77"})}),f.jsx("defs",{children:f.jsx("clipPath",{id:"clip0_6524_22412",children:f.jsx("rect",{width:"16",height:"16",fill:"white"})})})]}),gNe={codepen:f.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[f.jsx("g",{clipPath:"url(#clip0_6523_22409)",children:f.jsx("path",{d:"M15.9879 5.44292C15.9843 5.42352 15.981 5.40413 15.9759 5.38517C15.9726 5.37375 15.9688 5.36298 15.9651 5.35177C15.9597 5.33497 15.9541 5.31816 15.9474 5.30179C15.9427 5.29037 15.9373 5.27938 15.9321 5.26839C15.9248 5.25288 15.9173 5.23758 15.9086 5.22271C15.9026 5.21172 15.8957 5.20138 15.889 5.19082C15.8798 5.1766 15.8703 5.1626 15.8599 5.14902C15.8524 5.13889 15.8446 5.1292 15.8365 5.1195C15.8257 5.10657 15.8141 5.09429 15.8024 5.08223C15.7934 5.07318 15.7843 5.06413 15.7748 5.05529C15.7623 5.04387 15.7494 5.0331 15.7358 5.02276C15.7255 5.01479 15.7154 5.0066 15.7046 4.99927C15.7007 4.99647 15.6973 4.99324 15.6932 4.99065L8.38116 0.115543C8.15039 -0.0385144 7.84939 -0.0385144 7.61863 0.115543L0.306176 4.99044C0.302082 4.99302 0.29885 4.99626 0.294756 4.99906C0.283983 5.0066 0.273856 5.01457 0.263514 5.02254C0.250155 5.0331 0.237011 5.04387 0.224515 5.05486C0.215034 5.06348 0.205985 5.07253 0.19715 5.0818C0.185084 5.09386 0.17388 5.10614 0.162892 5.11907C0.154704 5.12877 0.146947 5.13846 0.139406 5.14924C0.129064 5.16281 0.119583 5.1766 0.110318 5.19104C0.103639 5.20159 0.0969593 5.21194 0.0907108 5.22293C0.0820922 5.23779 0.0745509 5.25309 0.0674405 5.26817C0.0622694 5.27916 0.0566673 5.29037 0.0521425 5.30157C0.0454631 5.31795 0.0396456 5.33475 0.0342589 5.35156C0.030596 5.36276 0.0267177 5.37375 0.0237011 5.38388C0.0187455 5.40284 0.0150825 5.42201 0.0116351 5.44162C0.00969592 5.45153 0.00732581 5.46123 0.00603302 5.47136C0.00215465 5.50109 0 5.53082 0 5.56121V10.4372C0 10.4673 0.00215465 10.4975 0.00646395 10.527C0.00797221 10.5378 0.0107733 10.5464 0.0129279 10.5568C0.0163753 10.5762 0.0193919 10.5955 0.0258558 10.6149C0.0288723 10.6257 0.0323198 10.6365 0.0366291 10.6483C0.0420157 10.6656 0.0474023 10.6828 0.0538662 10.6985C0.058391 10.7093 0.0646395 10.7201 0.0689488 10.7309C0.0760591 10.7459 0.0840314 10.761 0.09265 10.7768C0.098683 10.7875 0.105578 10.7983 0.112042 10.8082C0.121307 10.8233 0.131434 10.8362 0.142207 10.8491C0.149748 10.8599 0.157289 10.8685 0.165908 10.8789C0.176897 10.8918 0.187455 10.9047 0.200382 10.9162C0.209217 10.9248 0.21762 10.9355 0.228393 10.942C0.24089 10.9528 0.254249 10.9636 0.267177 10.9748C0.277519 10.9834 0.288723 10.9898 0.297342 10.9982C0.301436 11.0004 0.303806 11.0047 0.308115 11.0067L7.61863 15.8841C7.73412 15.9617 7.86641 16.0005 8 15.9998C8.13359 15.9992 8.26588 15.9611 8.38137 15.8841L15.6938 11.0092C15.6979 11.0067 15.7014 11.0036 15.7052 11.0008C15.716 10.9933 15.7261 10.9853 15.7365 10.9773C15.7498 10.9668 15.763 10.9558 15.7755 10.9446C15.785 10.9362 15.794 10.9269 15.8031 10.9179C15.8149 10.9058 15.8263 10.8935 15.8371 10.8806C15.8453 10.8709 15.8531 10.8612 15.8606 10.8509C15.8709 10.8373 15.8804 10.8233 15.8897 10.8091C15.8964 10.7987 15.903 10.7882 15.9093 10.7776C15.9179 10.7625 15.9254 10.7472 15.9328 10.7317C15.9379 10.7207 15.9433 10.7097 15.9481 10.6985C15.9548 10.6819 15.9604 10.6651 15.9657 10.6483C15.9694 10.6371 15.9733 10.6261 15.9765 10.6149C15.9815 10.596 15.9849 10.5766 15.9886 10.5572C15.9903 10.5473 15.9929 10.5376 15.994 10.5275C15.9978 10.4977 16 10.468 16 10.4376V5.5625C16 5.53212 15.9976 5.50238 15.994 5.47265C15.9922 5.46209 15.989 5.45347 15.9869 5.44292H15.9879ZM7.99978 9.62638L5.56826 8.00005L7.99978 6.37351L10.4315 8.00005L7.99978 9.62638ZM7.31245 5.17919L4.33171 7.17288L1.92561 5.56336L7.31245 1.97221V5.17919ZM3.09515 7.99984L1.37531 9.15021V6.84947L3.09515 7.99984ZM4.33171 8.82765L7.31245 10.8211V14.0281L1.92561 10.4365L4.33171 8.82722V8.82765ZM8.68733 10.8207L11.6681 8.82722L14.0744 10.4365L8.68733 14.0277V10.8207ZM12.9046 8.00027L14.6247 6.84969V9.15064L12.9046 7.99984V8.00027ZM11.6681 7.17288L8.68733 5.1794V1.97221L14.0744 5.56336L11.6681 7.17288Z",fill:"black"})}),f.jsx("defs",{children:f.jsx("clipPath",{id:"clip0_6523_22409",children:f.jsx("rect",{width:"16",height:"16",fill:"white"})})})]}),codesandbox:f.jsxs("svg",{width:"14",height:"16",viewBox:"0 0 14 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[f.jsx("g",{clipPath:"url(#clip0_6523_22406)",children:f.jsx("path",{d:"M6.24312 14.1129V8.35021L1.28724 5.49888V8.78388L3.55732 10.0999V12.5702L6.24312 14.1129ZM7.53036 14.1468L10.2658 12.571V10.0422L12.5506 8.71812V5.47426L7.53036 8.3727V14.1468ZM11.8904 4.36906L9.25164 2.83995L6.93472 4.18436L4.60022 2.8386L1.93795 4.38817L6.90626 7.24665L11.8904 4.36906ZM0 12.0115V4.02675L6.91821 0L13.8378 4.00984V11.9988L6.91805 15.985L0 12.0115Z",fill:"black"})}),f.jsx("defs",{children:f.jsx("clipPath",{id:"clip0_6523_22406",children:f.jsx("rect",{width:"13.8378",height:"16",fill:"white"})})})]}),dailymotion:f.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[f.jsxs("g",{clipPath:"url(#clip0_6523_22345)",children:[f.jsx("path",{d:"M16 0H0V16H16V0Z",fill:"white"}),f.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.73038 10.3003C8.40789 10.6268 8.00377 10.7901 7.51804 10.7901C7.04025 10.7901 6.64411 10.6308 6.32956 10.3122C6.01503 9.99367 5.85776 9.58351 5.85776 9.08176C5.85776 8.60389 6.01901 8.20766 6.3415 7.89306C6.66401 7.57847 7.06016 7.42118 7.52998 7.42118C7.84849 7.42118 8.13715 7.49484 8.39594 7.64219C8.65474 7.78953 8.8558 7.99063 8.99913 8.2455C9.14246 8.50034 9.21412 8.77908 9.21412 9.08176C9.21412 9.56757 9.05287 9.97376 8.73038 10.3003ZM9.10662 3.58632V6.35792C8.82791 6.07918 8.53131 5.87808 8.21678 5.75463C7.90223 5.63118 7.54988 5.56946 7.1597 5.56946C6.53062 5.56946 5.96527 5.72476 5.4636 6.03538C4.96193 6.34597 4.57176 6.77007 4.29305 7.30768C4.01435 7.84528 3.875 8.44062 3.875 9.09369C3.875 9.76269 4.01236 10.366 4.28708 10.9036C4.5618 11.4412 4.95197 11.8653 5.45763 12.1759C5.96328 12.4865 6.54258 12.6418 7.19553 12.6418C8.14312 12.6418 8.80403 12.3312 9.17831 11.71H9.20218V12.5595H11.0894V3.15625L9.10662 3.58632Z",fill:"#232323"})]}),f.jsx("defs",{children:f.jsx("clipPath",{id:"clip0_6523_22345",children:f.jsx("rect",{width:"16",height:"16",fill:"white"})})})]}),flickr:f.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[f.jsx("rect",{width:"16",height:"16",fill:"white"}),f.jsxs("g",{clipPath:"url(#clip0_6523_22379)",children:[f.jsx("path",{d:"M8.43286 7.78387C8.43286 9.321 9.67925 10.5674 11.2166 10.5674C12.7538 10.5674 13.9999 9.321 13.9999 7.78387C13.9999 6.24675 12.7538 5.00061 11.2166 5.00061C9.67925 5.00061 8.43286 6.24675 8.43286 7.78387Z",fill:"#FF0084"}),f.jsx("path",{d:"M2 7.78408C2 9.32121 3.24614 10.5676 4.78352 10.5676C6.32089 10.5676 7.56703 9.32121 7.56703 7.78408C7.56703 6.24695 6.32089 5.00081 4.78352 5.00081C3.24614 5.00081 2 6.24695 2 7.78408Z",fill:"#0063DC"})]}),f.jsx("defs",{children:f.jsx("clipPath",{id:"clip0_6523_22379",children:f.jsx("rect",{width:"12",height:"5.568",fill:"white",transform:"translate(2 5)"})})})]}),giphy:f.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[f.jsx("rect",{width:"16",height:"16",fill:"#121212"}),f.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4 3.38889V12.2778H5.11111V3.38889H4Z",fill:"#00FF99"}),f.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.6663 5.61111V12.2778H11.7774V5.61111H10.6663Z",fill:"#9933FF"}),f.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.75 3H4V4.11111H8.83333V3H7.75Z",fill:"#FFF35C"}),f.jsx("path",{d:"M9.00041 4.11111H7.33374H8.83374V3.77778L9.00041 4.11111Z",fill:"#999999"}),f.jsx("path",{d:"M8.83374 4.11111H7.33374L8.44485 3L8.83374 3.77778V4.11111Z",fill:"#999237"}),f.jsx("path",{d:"M10.6663 7.44444V5.77778L11.7774 6.33333L10.6663 7.44444Z",fill:"#5C1F99"}),f.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.6667 11.8889H4V13H11.7778V11.8889H10.6667Z",fill:"#00CCFF"}),f.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.6668 5.22222V4.11111H9.55569V3H8.44458V3.90739V5.0185V6.33333H9.55569H10.6668H11.7779V5.22222H10.6668Z",fill:"#FF6666"})]}),instagram:f.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",children:[f.jsxs("g",{clipPath:"url(#clip0_6523_22356)",children:[f.jsx("mask",{id:"mask0_6523_22356",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"16",height:"16",children:f.jsx("path",{d:"M4.70325 0.0949238C3.85627 0.1349 3.27778 0.270564 2.77227 0.468642C2.24897 0.672648 1.80537 0.946046 1.36408 1.38914C0.922279 1.83249 0.650958 2.27688 0.448504 2.8007C0.252489 3.3075 0.119662 3.88627 0.0822604 4.73377C0.045126 5.58283 0.0366102 5.85363 0.0407495 8.01522C0.0448729 10.1765 0.0544124 10.4479 0.0949012 11.2972C0.135388 12.1439 0.270546 12.7222 0.468623 13.2279C0.672886 13.7512 0.946004 14.1946 1.38935 14.6361C1.83245 15.0777 2.27708 15.3487 2.80115 15.5515C3.30744 15.7472 3.88644 15.8806 4.73369 15.9177C5.58273 15.9551 5.85379 15.9634 8.01483 15.9592C10.1769 15.9551 10.448 15.9456 11.297 15.9053C12.144 15.8648 12.722 15.7292 13.228 15.5316C13.7513 15.3268 14.1949 15.0542 14.6362 14.6109C15.0775 14.1678 15.3488 13.7231 15.5512 13.199C15.7473 12.6927 15.8806 12.1137 15.9175 11.267C15.9546 10.4174 15.9634 10.1461 15.9593 7.98478C15.9551 5.8232 15.9453 5.55239 15.9051 4.7036C15.8649 3.85609 15.7292 3.27811 15.5314 2.77208C15.3269 2.24877 15.054 1.80567 14.6109 1.36387C14.1678 0.922574 13.7232 0.650729 13.1991 0.448785C12.6926 0.252768 12.1138 0.119166 11.2666 0.0825425C10.4175 0.0448876 10.1465 0.0366393 7.98465 0.0407642C5.82336 0.0448892 5.5523 0.0541772 4.70325 0.0949238ZM4.79611 14.485C4.02004 14.4512 3.59863 14.3222 3.31776 14.2142C2.94585 14.0703 2.68046 13.8977 2.40114 13.6205C2.12234 13.3422 1.94928 13.0776 1.80408 12.7064C1.69497 12.4255 1.5637 12.0046 1.52734 11.2286C1.48788 10.3896 1.47886 10.1378 1.47498 8.01237C1.47086 5.88742 1.47859 5.63569 1.51522 4.79593C1.54848 4.02038 1.67822 3.59843 1.78602 3.31782C1.92993 2.94539 2.10196 2.68051 2.37973 2.4012C2.65801 2.12187 2.92263 1.94933 3.29402 1.80412C3.57463 1.69451 3.99555 1.56426 4.77134 1.52738C5.61084 1.48766 5.8623 1.47915 7.98723 1.47502C10.1127 1.47089 10.3644 1.47838 11.2042 1.51526C11.9797 1.54904 12.4016 1.67749 12.682 1.78607C13.0541 1.92998 13.3195 2.1015 13.5986 2.37979C13.8777 2.65808 14.0507 2.92218 14.1959 3.29435C14.3055 3.57418 14.4358 3.99562 14.4724 4.77117C14.5124 5.61068 14.5214 5.8624 14.5253 7.98736C14.5294 10.1128 14.5217 10.3646 14.4848 11.2038C14.451 11.9799 14.3223 12.4016 14.214 12.6827C14.0701 13.0543 13.898 13.3197 13.62 13.5991C13.342 13.8773 13.0774 14.0509 12.7057 14.1961C12.4256 14.3055 12.0042 14.436 11.2289 14.4729C10.3894 14.5123 10.1379 14.5214 8.01225 14.5252C5.88732 14.5294 5.63586 14.5214 4.79611 14.485ZM11.2854 3.74493C11.2864 4.27211 11.7151 4.69896 12.2422 4.69792C12.7697 4.69689 13.1965 4.2685 13.1957 3.74132C13.1947 3.21414 12.7661 2.78704 12.2386 2.78807C11.7112 2.7891 11.2844 3.21775 11.2854 3.74493ZM3.91277 8.00773C3.91714 10.2653 5.75063 12.0913 8.0076 12.0869C10.2648 12.0825 12.0919 10.2495 12.0875 7.99201C12.0831 5.73526 10.2494 3.90819 7.99188 3.91257C5.73489 3.91696 3.90837 5.75073 3.91277 8.00773ZM5.34648 8.0049C5.3439 6.53969 6.52978 5.34942 7.99471 5.34683C9.45991 5.344 10.6504 6.52937 10.6533 7.99484C10.6561 9.46031 9.47022 10.6503 8.00477 10.6532C6.53984 10.656 5.34932 9.47037 5.34648 8.0049Z",fill:"white"})}),f.jsxs("g",{mask:"url(#mask0_6523_22356)",children:[f.jsx("mask",{id:"mask1_6523_22356",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"-1",y:"-1",width:"18",height:"18",children:f.jsx("path",{d:"M16.5905 -0.583628H-0.603516V16.6106H16.5905V-0.583628Z",fill:"white"})}),f.jsxs("g",{mask:"url(#mask1_6523_22356)",children:[f.jsx("mask",{id:"mask2_6523_22356",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"-1",y:"-1",width:"18",height:"18",children:f.jsx("path",{d:"M16.6701 -0.663237H-0.683105V16.6902H16.6701V-0.663237Z",fill:"white"})}),f.jsxs("g",{mask:"url(#mask2_6523_22356)",children:[f.jsx("mask",{id:"mask3_6523_22356",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"-1",y:"-1",width:"18",height:"18",children:f.jsx("path",{d:"M16.6701 -0.663237H-0.683105V16.6902H16.6701V-0.663237Z",fill:"white"})}),f.jsx("g",{mask:"url(#mask3_6523_22356)",children:f.jsx("rect",{x:"-0.688721",y:"-0.665792",width:"17.3622",height:"17.3622",fill:"url(#pattern0)"})})]})]})]})]}),f.jsxs("defs",{children:[f.jsx("pattern",{id:"pattern0",patternContentUnits:"objectBoundingBox",width:"1",height:"1",children:f.jsx("use",{xlinkHref:"#image0_6523_22356",transform:"scale(0.000439947)"})}),f.jsx("clipPath",{id:"clip0_6523_22356",children:f.jsx("rect",{width:"16",height:"16",fill:"white"})}),f.jsx("image",{id:"image0_6523_22356",width:"2273",height:"2275",xlinkHref:"data:image/jpeg;base64,/9j/4AAQSkZJRgABAgEAlgCWAAD/7AARRHVja3kAAQAEAAAAHgAA/+4AIUFkb2JlAGTAAAAAAQMAEAMCAwYAAFokAABijgAAd23/2wCEABALCwsMCxAMDBAXDw0PFxsUEBAUGx8XFxcXFx8eFxoaGhoXHh4jJSclIx4vLzMzLy9AQEBAQEBAQEBAQEBAQEABEQ8PERMRFRISFRQRFBEUGhQWFhQaJhoaHBoaJjAjHh4eHiMwKy4nJycuKzU1MDA1NUBAP0BAQEBAQEBAQEBAQP/CABEICOMI4QMBIgACEQEDEQH/xADDAAEBAQEBAQEBAAAAAAAAAAAAAQUEBgMHAgEBAQADAQEAAAAAAAAAAAAAAAECAwUEBhAAAQIEBAcBAQEBAQAAAAAAAAMFcIA1FiIjMxQBEQIyEwQ0MRIGFZARAAADCAICAgEABwUJAQAAAAADo4ABcqLSBDREsXNDRcECESExQVGREjIQYdETM3GB8VJiksLiFBUSAAECBgEEAwABAwIHAAAAAAABAnCxcpIDM0QxMkNFcZFzERBBEmGCoCFRgUKDNP/aAAwDAQACEQMRAAAA9X5n5Z3e26jLei6jLRqMsajLGoyxqMsajLGoyxqMsajLJqMsajLGoyxqMsajLGoyxqMsalyqajLGoyxqMsajLJqMsajLGoyxqMsajLRqMsajLGoyxqMsajLGoyxqMsajLppswabMGmyxqMwumzIajLppsyGoyy6jLGoyxqMsuoyxqMsuoyxqTMhqzMi6jLGoyy6jLGoyy6jLGoyy6jLGoyxqMsuoyxqMuLqsoarKLqMsajLLqMsajLLqMsajLGoyi6rKGqyhqsouqyhqXKGoyy6jLGoyxqMouqyhqsoarKGqyi6rKGqyhqsouqyhqsoarKGqyhqMouqyhqsoar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XQMpMugZSZdAyky6BlJl0DKTLoDnvufy537Hll/h/wDD6D6Wt/8AX6/X7GP/AJSzvp+h35f+p32+v9/73fw/b/ZdP+37Ps76u/2fX6u+rDn6vt/3/wDqLvsfww7ddj+GHbrsfww7d9j+GHbrsfww7ddj+GHbrsfww7ddj+GHbrsfww7ddj+GHbrsfww7ddj+GHbrsfww7ddj+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfww7d9j+GHbvsfw5h277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3fY/hh277H8MO3XY/hh26jfww7dRv4Yduo38MO3Ub+GHbqN/DDt1G/hh26jfww7dRv4Yduo38MO3Ub+GHbqN/DDt1G/hh26jfww7dRv4Yduo38MO3Ub+GHbqN/DDt1G/hh26jfww7dRv4Yduo38MO3Ub+GHbqN/DDt1G/hh26jfww7dRv4Yduo38MO3Ub+GHbqN/DDt1G/hh26j+GHbqP4Yduo38MO3Ub+GHbqP4Yduo/hh26j+GHbmP4YduY/hh25j+GHbmP4Ydu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NQaag01BpqDTUGmoNNQaag0lBpKDSUGkoNJQaSg0lBpKDSUGioNFQaKg0VBoqDRVGiqNFUaKo0FRoKjQVGgqNBUaCo0FRoKjQVGgqPXqj16o9eqPXqj16o9eqPXqj16o9eqPXqj1yo9cqPXKj1yo9cqPXLD1yw9csPXLD1yw9csPWrD1qw9asPWrD1qw9asPWrD1qw9asPWrD1qw9YsPWLD1iw9YsPWLD1iw9YsPWLD1iw9YsPWLD1iw9YsPWLD1iw9YsPWLD1iw9YsPWLD1iw9YsPWLD1aw9WsPVrD1aw9WsPVrD1aw9WsPVrD1aw9WsPVrB34/8Ay/z/AH/53yHY/wDU/E/0v+P7/wCz/9k="})]})]}),pinterest:f.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[f.jsxs("g",{clipPath:"url(#clip0_6570_25513)",children:[f.jsx("rect",{width:"15.996",height:"16",rx:"2",fill:"#CC2127"}),f.jsx("path",{d:"M7.999 2C4.68555 2 2 4.68555 2 7.999C2 10.5406 3.58174 12.7102 5.81336 13.5861C5.76137 13.1121 5.71338 12.3843 5.83336 11.8644C5.94134 11.3964 6.53724 8.88285 6.53724 8.88285C6.53724 8.88285 6.35727 8.52291 6.35727 7.993C6.35727 7.15914 6.84119 6.53524 7.44309 6.53524C7.95501 6.53524 8.20297 6.91918 8.20297 7.3811C8.20297 7.89502 7.87502 8.66489 7.70705 9.37877C7.56507 9.97667 8.007 10.4626 8.5949 10.4626C9.66072 10.4626 10.4806 9.33878 10.4806 7.71505C10.4806 6.27929 9.44876 5.27345 7.975 5.27345C6.26729 5.27345 5.26546 6.55324 5.26546 7.87702C5.26546 8.39293 5.46342 8.94484 5.71138 9.24679C5.75937 9.30678 5.76737 9.35877 5.75337 9.41876C5.70738 9.60873 5.6074 10.0167 5.5874 10.0987C5.56141 10.2086 5.50142 10.2326 5.38743 10.1786C4.63756 9.83069 4.16964 8.73488 4.16964 7.85502C4.16964 5.96334 5.54541 4.22563 8.13298 4.22563C10.2146 4.22563 11.8304 5.70938 11.8304 7.69105C11.8304 9.75871 10.5266 11.4224 8.71688 11.4224C8.10898 11.4224 7.53708 11.1065 7.34111 10.7345C7.34111 10.7345 7.04116 11.8804 6.96717 12.1603C6.83119 12.6822 6.46526 13.3341 6.2213 13.732C6.7832 13.906 7.3791 14 7.997 14C11.3104 14 13.996 11.3144 13.996 8.001C13.998 4.68555 11.3124 2 7.999 2Z",fill:"white"})]}),f.jsx("defs",{children:f.jsx("clipPath",{id:"clip0_6570_25513",children:f.jsx("rect",{width:"16",height:"16",fill:"white"})})})]}),spotify:f.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[f.jsx("g",{clipPath:"url(#clip0_6523_22402)",children:f.jsx("path",{d:"M12.6609 7.10585C10.121 5.59751 5.93158 5.45882 3.50697 6.1947C3.11759 6.31287 2.70584 6.09298 2.5879 5.70373C2.46988 5.31411 2.68945 4.90265 3.07911 4.78429C5.86241 3.93945 10.4892 4.1026 13.4132 5.83828C13.7634 6.04622 13.8782 6.49851 13.6707 6.84813C13.4629 7.19833 13.0103 7.31376 12.6609 7.10585ZM12.5777 9.33993C12.3995 9.62908 12.0215 9.71979 11.7327 9.54223C9.61522 8.24063 6.38637 7.86357 3.88123 8.624C3.55636 8.72218 3.21323 8.53899 3.11455 8.21475C3.01666 7.88989 3.19992 7.54738 3.5242 7.44859C6.38597 6.58018 9.9436 7.00081 12.3756 8.49536C12.6644 8.67322 12.7553 9.05146 12.5777 9.33993ZM11.6136 11.4855C11.472 11.7177 11.1697 11.7904 10.9383 11.6489C9.08801 10.518 6.75909 10.2627 4.01637 10.8891C3.75207 10.9497 3.48866 10.7841 3.42838 10.5198C3.36785 10.2556 3.53284 9.99217 3.79772 9.93186C6.79916 9.2457 9.37381 9.54101 11.4506 10.8101C11.6822 10.9515 11.7551 11.254 11.6136 11.4855ZM8.00002 0.120623C3.64839 0.120623 0.120605 3.64834 0.120605 7.99989C0.120605 12.352 3.64839 15.8794 8.00002 15.8794C12.3517 15.8794 15.8794 12.352 15.8794 7.99989C15.8794 3.64834 12.3517 0.120623 8.00002 0.120623Z",fill:"#1ED760"})}),f.jsx("defs",{children:f.jsx("clipPath",{id:"clip0_6523_22402",children:f.jsx("rect",{width:"16",height:"16",fill:"white"})})})]}),twitter:f.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:f.jsx("path",{d:"M14.3193 4.31285C14.329 4.45301 14.329 4.59317 14.329 4.73462C14.329 9.04475 11.0516 14.0156 5.05865 14.0156V14.0131C3.28832 14.0156 1.55478 13.508 0.0644531 12.5507C0.321873 12.5817 0.580582 12.5972 0.839937 12.5979C2.30703 12.5992 3.7322 12.1063 4.88639 11.1988C3.4922 11.1724 2.26961 10.2623 1.84252 8.93366C2.3309 9.02796 2.83413 9.00858 3.31349 8.87746C1.79349 8.57001 0.699937 7.23299 0.699937 5.68023C0.699937 5.66602 0.699937 5.65246 0.699937 5.63889C1.15284 5.89144 1.65994 6.0316 2.17865 6.0471C0.747034 5.08923 0.305743 3.18251 1.17026 1.69176C2.82445 3.7296 5.2651 4.96844 7.8851 5.09956C7.62252 3.96664 7.98123 2.77947 8.82768 1.98307C10.1399 0.748096 12.2038 0.811395 13.4374 2.12452C14.167 1.98048 14.8664 1.71243 15.5064 1.33264C15.2632 2.0877 14.7541 2.72909 14.0741 3.13665C14.7199 3.06044 15.3509 2.88734 15.9451 2.62316C15.5077 3.2794 14.9567 3.85103 14.3193 4.31285Z",fill:"#1D9BF0"})}),vimeo:f.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[f.jsxs("g",{clipPath:"url(#clip0_6523_22340)",children:[f.jsx("path",{d:"M16 14.4C16 15.28 15.28 16 14.4 16H1.6C0.72 16 0 15.28 0 14.4V1.6C0 0.72 0.72 0 1.6 0H14.4C15.28 0 16 0.72 16 1.6V14.4Z",fill:"#1AB7EA"}),f.jsx("path",{d:"M13.9945 5.3084C13.9391 6.42815 13.1229 7.97447 11.5458 9.93402C9.91331 11.9736 8.52987 13 7.40928 13C6.70372 13 6.12267 12.3735 5.63846 11.1338C5.32027 9.98735 4.98824 8.85427 4.67005 7.70786C4.31036 6.46814 3.92299 5.84161 3.50796 5.84161C3.42495 5.84161 3.10676 6.02824 2.56721 6.38816L2 5.68165C2.59488 5.1751 3.17593 4.68187 3.75698 4.17532C4.54554 3.52214 5.14042 3.17555 5.54162 3.13556C6.46853 3.05557 7.04958 3.66877 7.27093 4.97514C7.50612 6.40149 7.67213 7.28129 7.75514 7.62788C8.01799 8.80095 8.32235 9.40081 8.64054 9.40081C8.88956 9.40081 9.26309 9.01423 9.77497 8.2544C10.273 7.49457 10.5497 6.90804 10.5774 6.50813C10.6465 5.85494 10.3837 5.52169 9.77497 5.52169C9.48444 5.52169 9.19392 5.58834 8.88956 5.70831C9.48444 3.84206 10.605 2.94893 12.2652 3.00225C13.4826 3.02891 14.0637 3.80207 13.9945 5.3084Z",fill:"white"})]}),f.jsx("defs",{children:f.jsx("clipPath",{id:"clip0_6523_22340",children:f.jsx("rect",{width:"16",height:"16",fill:"white"})})})]}),youtube:f.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[f.jsx("path",{d:"M15.6656 3.75817C15.4816 3.06609 14.9395 2.5211 14.2511 2.33614C13.0034 2 8 2 8 2C8 2 2.99666 2 1.7489 2.33614C1.06051 2.5211 0.518324 3.06609 0.334339 3.75817C0 5.01251 0 7.62963 0 7.62963C0 7.62963 0 10.2467 0.334339 11.5012C0.518324 12.1932 1.06051 12.7381 1.7489 12.9232C2.99666 13.2593 8 13.2593 8 13.2593C8 13.2593 13.0034 13.2593 14.2511 12.9232C14.9395 12.7381 15.4816 12.1932 15.6656 11.5012C16 10.2467 16 7.62963 16 7.62963C16 7.62963 16 5.01251 15.6656 3.75817Z",fill:"#ED1D24"}),f.jsx("path",{d:"M6.36353 10.0058L10.5453 7.62974L6.36353 5.25349V10.0058Z",fill:"white"})]})};function tJ(t){const{debouncedUrl:e,content:n,onContentChange:r,selected:i}=t,o=I.useRef(null),[a,s]=I.useState(!1);qe.useOnChange(e,()=>{var c;a&&(s(!1),(c=o.current)==null||c.reset())});function l(){s(!0),r(void 0)}return pi.toURL(e)?e===(n==null?void 0:n.embed_url)?f.jsx(uT,{content:n,selected:i}):f.jsx(A.ErrorBoundary,{ref:o,renderError:vNe,onError:l,children:f.jsx(I.Suspense,{fallback:n&&f.jsx(uT,{content:n,selected:i}),children:f.jsx(yNe,{url:e,selected:i,onContentChange:r})})}):null}function vNe(){return f.jsxs(A.Box,{backgroundColor:"grey2",borderRadius:6,padding:16,gap:4,children:[f.jsx(A.Icon,{name:"alert",size:"small",color:"grey11"}),f.jsx(A.Text,{variant:"smallBold",color:"grey11",children:"There is no embed data available."})]})}function uT(t){const{content:e,selected:n}=t,{thumbnail:r,provider:i,author:o,url:a,subtitle:s}=wNe(e);return f.jsxs(A.PreviewCard,{selected:n,children:[f.jsx(A.PreviewImage,{src:r.url,aspectRatio:r.aspectRatio}),f.jsxs(A.PreviewContent,{children:[f.jsxs(A.Box,{display:"flex",alignItems:"center",gap:4,children:[f.jsx(ANe,{provider:i}),f.jsx(A.Text,{variant:"smallBold",color:"grey12",noWrap:!0,children:i}),o&&f.jsx(A.Text,{variant:"small",color:"grey11",noWrap:!0,children:o})]}),f.jsx(A.Text,{variant:"smallBold",href:a,children:s})]})]})}function yNe(t){const{url:e,onContentChange:n,selected:r}=t,i=bNe({url:e,onContentChange:n});return f.jsx(uT,{content:i,selected:r})}function bNe(t){const{url:e,onContentChange:n}=t,{embedApiEndpoint:r}=Se(),i=et.useRequest(CNe,[e,r]),o=qe.useStableCallback(n);return I.useEffect(()=>{o(i)},[i,o]),i}function CNe(t,e){const n=new URL(e);return n.searchParams.set("url",t),oe.request(n,{okType:SNe(t)})}function SNe(t){return k.object({type:k.string(),version:k.string().or(k.number()).nullish(),title:k.string().nullish(),author_name:k.string().nullish(),author_url:k.string().nullish(),provider_name:k.string().nullish(),provider_url:k.string().nullish(),cache_age:k.string().or(k.number()).nullish(),thumbnail_url:k.string().nullish(),thumbnail_width:k.number().nullish(),thumbnail_height:k.number().nullish(),html:k.string().nullish()}).passthrough().transform(e=>{const n={embed_url:t};return{...n,__TYPE__:"EmbedContent",type:e.type,version:e.version,title:e.title,author_name:e.author_name,author_url:e.author_url,provider_name:e.provider_name,provider_url:e.provider_url,cache_age:e.cache_age,thumbnail_url:e.thumbnail_url,thumbnail_width:e.thumbnail_width,thumbnail_height:e.thumbnail_height,html:e.html,all:{...n,...e}}})}function wNe(t){let e="";switch(t.type){case"video":e=t.title??"";break;case"photo":e=`View this post${t.provider_name?` on ${t.provider_name}`:""}`;break;default:e=`Open${t.provider_name?` on ${t.provider_name}`:""}`}return{url:t.embed_url,thumbnail:{url:t.thumbnail_url??"",aspectRatio:t.type==="video"?"16:9":"1:1"},provider:t.provider_name??"",author:t.author_name??"",subtitle:e}}function xNe(t){const{id:e,readOnly:n,field:r,content:i,onContentChange:o}=t,a=qe.useDebounceState({initialState:(i==null?void 0:i.embed_url)??"",startTransition:I.startTransition});function s(l){a.set(l),pi.toURL(l)||o(void 0)}return f.jsxs(A.Field,{footer:pi.toURL(a.value)&&f.jsx(A.FieldFooter,{children:f.jsx(tJ,{debouncedUrl:a.debouncedValue,content:i,onContentChange:o})}),children:[f.jsx(A.FieldIcon,{name:"cloud"}),f.jsx(A.FieldLabel,{htmlFor:e,children:Fr(r)}),f.jsx(A.FieldControl,{children:f.jsx(Jl,{id:e,readOnly:n,placeholder:od(r),value:a.value,onValueChange:s,variant:pi.toURL(a.value)?"link":"normal",endAdornment:f.jsx(A.Button,{startIcon:"close",color:"grey",size:"small",disabled:!a,onClick:()=>s("")})})})]})}function nJ(t){return!(t.lat>85||t.lat<-85||t.lng>180||t.lng<-180)}function $w(t){const e=/^.*@(-?\d+.\d+),(-?\d+.\d+).*$/,n=t.match(e);if(!n)return;const r=parseFloat(n[1]??""),i=parseFloat(n[2]??"");if(isNaN(r)||isNaN(i))return;const o={lat:r,lng:i};if(nJ(o))return o}function d2(t){return t?`${t.lat}, ${t.lng}`:""}function f2(t){const e=/\(?([\d|.|-]*)[\s+]*,[\s]*([\d|.|-]*)\)?/,n=t.match(e);if(!n)return $w(t);const r=parseFloat(n[1]??""),i=parseFloat(n[2]??"");if(isNaN(r)||isNaN(i))return $w(t);const o={lat:r,lng:i};return nJ(o)?o:$w(t)}function TNe(t){const{field:e,id:n,readOnly:r,...i}=t,{onValueChange:o,displayedValue:a,onBlur:s,clearValue:l,isValidCoordinates:c}=_Ne(i);return f.jsxs(A.Field,{children:[f.jsx(A.FieldIcon,{name:"place"}),f.jsx(A.FieldLabel,{htmlFor:n,children:Fr(e)}),f.jsx(A.FieldControl,{children:f.jsx(Jl,{id:n,onValueChange:o,placeholder:bj,readOnly:r,value:a,onBlur:s,variant:c?"link":"normal",endAdornment:f.jsx(A.Button,{startIcon:"close",color:"grey",size:"small",disabled:!a,onClick:l})})})]})}function _Ne(t){const{content:e,onContentChange:n}=t,r=d2(e==null?void 0:e.position),[i,o]=I.useState(r);function a(){const c=f2(i);if(!c)return o(""),n(void 0);const{lat:u,lng:d}=c;o(d2({lat:u,lng:d})),n({__TYPE__:"GeoPointContent",position:{lat:u,lng:d}})}function s(){o(""),n(void 0)}const l=!!f2(i);return{displayedValue:i,isValidCoordinates:l,onValueChange:o,onBlur:a,clearValue:s}}function rJ(t){const{fieldLabel:e,imageLabel:n=[]}=t;return f.jsxs(A.CardHeaderTitle,{children:[f.jsx(A.Text,{variant:"bold",noWrap:!0,children:nr.overflow(e,30)}),n.length!==0&&f.jsx(A.Text,{color:"grey11",noSelect:!0,children:` • ${n.join(" • ")}`})]})}function iJ(t){const{fieldLabel:e,isUpdating:n,readOnly:r,onMediaDialogOpenChange:i}=t;return f.jsxs(f.Fragment,{children:[f.jsx(A.CardHeader,{sx:{flexWrap:"wrap"},children:f.jsx(rJ,{fieldLabel:e})}),f.jsx(A.CardContent,{children:f.jsx(A.Card,{color:"grey2",variant:"dashed",paddingBlock:12,radius:4,sx:{width:"100%"},children:f.jsx(A.CardContent,{children:f.jsxs(A.BlankSlate,{variant:"horizontal",children:[f.jsx(A.BlankSlateIcon,{name:"cloudUpload",lineColor:"purple9",backgroundColor:"purple4",size:"small"}),f.jsx(A.BlankSlateTitle,{children:n?"Preparing your image...":"You haven't selected an image"}),!r&&f.jsx(A.BlankSlateActions,{children:f.jsx(A.Button,{disabled:n,onClick:()=>i(!0),size:"medium",children:"Select image"})})]})})})})]})}const INe=iy({id:pc(),width:ry(),height:ry(),urls:iy({full:pc(),small:pc().transform(VBe)}),alt_description:pc().optional(),description:pc().nullable()}),ENe=iy({results:yU(INe)}).transform(t=>t.results);function oJ(t,e){const n=new URL("search/photos",t);return n.searchParams.set("page","1"),n.searchParams.set("per_page","28"),n.searchParams.set("query",e),oe.request(n,{okType:ENe})}et.cache.registerFetcherConfig(oJ,{cacheCapacity:5,revalidationStrategy:{type:"never"}});function RNe(t,e){const n=I.useRef(),r=Se(),i=et.useRequest(oJ,[t,e]);return qe.useDebounce(e,1e3,()=>{var o;n.current&&e!==n.current&&((o=r.onAnalyticsEvent)==null||o.call(r,"Unsplash Image Searched")),n.current=e}),i}function kNe(t){const{onSelectedChange:e}=t,[n,r]=I.useTransition(),i=qe.useDebounceState({initialState:"",ms:300,startTransition:r});return f.jsxs(A.Box,{flexDirection:"column",gap:16,width:"100%",position:"relative",children:[f.jsx(A.FormSearchInput,{value:i.value,placeholder:"Search on Unsplash.com",onValueChange:i.set}),f.jsx(A.ErrorBoundary,{renderError:()=>f.jsx(FG,{}),children:f.jsx(I.Suspense,{fallback:f.jsx(ONe,{}),children:f.jsx($Ne,{term:i.debouncedValue,loading:n,onSelectedChange:e})})})]})}function $Ne(t){const{term:e,onSelectedChange:n,loading:r}=t,{media:i,toggleSelected:o,selectedImageId:a}=MNe({term:e,onSelectedChange:n});return f.jsxs(f.Fragment,{children:[i.length>0&&f.jsx(aJ,{children:i==null?void 0:i.map(s=>{const c=new URL(s.urls.full).searchParams.get("fm")??"jpg";return f.jsx(A.MediaCard,{url:s.urls.small,filename:s.description??"Unsplash Image",selected:a===s.id,onCardClick:()=>o(s),onCheckedChange:()=>o(s),extension:c,kind:"image",width:s.width,height:s.height,loading:r},s.id)})}),i.length===0&&f.jsx(OG,{})]})}function aJ(t){const{children:e}=t;return f.jsx(A.ScrollArea,{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(min(100%, 250px), 1fr))",gap:16,padding:2,paddingBottom:16,position:"relative",width:"100%"},children:e})}function ONe(){return f.jsx(aJ,{children:_t.range(1,24).map(t=>f.jsx(UG,{},t))})}function MNe(t){var c;const{term:e,onSelectedChange:n}=t,{unsplashApiBaseUrl:r}=Se(),i=RNe(r,e||"citrus fruit"),o=(c=i==null?void 0:i[0])==null?void 0:c.id,[a,s]=I.useState();I.useEffect(()=>{n==null||n([]),s(void 0)},[o,n]);function l(u){if(u.id===a)return s(void 0),n==null?void 0:n([]);s(u.id),n==null||n([{...u,url:u.urls.full,alt:u.alt_description}])}return{media:i,toggleSelected:l,selectedImageId:a}}function Cj(t){const{open:e,onOpenChange:n,onMediaSelected:r,assetType:i}=t,o=Se(),a=o.mediaLibrary,[s,l]=I.useState(()=>a?"media":"unsplash"),[c,u]=I.useState(new Set),[d,p]=I.useState([]),h=c.size+d.length,m=et.useFetcherData(Yi);I.useEffect(()=>{!e||!a||xG({config:o,assetType:i})},[e,o,i,a]);function g(x){if(x!=="media"&&x!=="unsplash")throw new Error(`Invalid option ${x}.`);l(x)}function v(x){x||u(new Set),n(x)}const b=dBe({assetType:i,mediaDialogOpen:e});function S(){var x;switch(s){case"unsplash":{const w=d[0];if(!w)return;r(w),(x=o.onAnalyticsEvent)==null||x.call(o,"Unsplash Image Added");break}case"media":{const E=m.flatMap(R=>R.items).filter(R=>c.has(R.id))[0];if(!E)return;r(E),b(E.id);break}}}function C(){if(h===0)return"Select a media item to add to the page";if(h>1)return"Only one media item can be added to the page"}const{containerRef:y}=A.useAlert();return f.jsxs(A.Dialog,{open:e,onOpenChange:v,size:{width:"min(calc(100% - 48px), 2000px)",height:"calc(100% - 30px)"},position:"center",onPointerDownOutside:x=>{y&&qe.refContainsTarget(y,x.target)&&x.preventDefault()},children:[f.jsx(A.DialogHeader,{icon:"image",title:"Media library"}),f.jsx(A.DialogDescription,{hidden:!0,children:"Select a media item to add to the page"}),f.jsxs(A.DialogOptions,{value:s,onValueChange:g,padding:"small",width:"auto",children:[a&&f.jsx(A.DialogOptionsItem,{value:"media",icon:"photo"}),f.jsx(A.DialogOptionsItem,{value:"unsplash",icon:"unsplash"})]}),f.jsx(A.DialogContent,{children:f.jsx(A.Box,{flexDirection:"column",flexGrow:1,overflow:"hidden",children:f.jsxs(A.Box,{overflow:"hidden",backgroundColor:"grey2",padding:{top:16,inline:16},flexGrow:1,children:[s==="media"&&f.jsx(QG,{assetType:i,onSelectedChange:u}),s==="unsplash"&&f.jsx(kNe,{onSelectedChange:p})]})})}),f.jsxs(A.DialogActions,{children:[f.jsx(A.DialogCancelButton,{}),f.jsx(A.DialogActionButton,{onClick:S,disabled:h!==1,tooltipLabel:C(),children:"Add to page"})]})]})}const sJ=I.forwardRef(function(e,n){const{isMediaDialogOpen:r,selected:i,children:o,onMediaSelected:a,onMediaDialogOpenChange:s}=e;function l(c){a(c),s(!1)}return f.jsxs(A.Card,{ref:n,color:i?"indigo2":"grey2",variant:i?"selected":"dashed",paddingBlock:12,radius:4,children:[o,f.jsx(Cj,{open:r,onOpenChange:s,onMediaSelected:l,assetType:"image"})]})});function lJ(t){const{uploadImage:e,children:n,isUploading:r,disabled:i}=t;if(i)return f.jsx(f.Fragment,{children:n});function o(a){if(r)return;const s=a[0];s&&e(s)}return f.jsx(A.FileDropZone,{assetType:"image",maxFiles:1,onFilesSelected:o,overlay:f.jsx(FNe,{isUploading:r}),children:n})}function FNe(t){const{isUploading:e}=t,n=e?"You can't upload while the upload is ongoing":"Drop image to instantly upload";return f.jsx(A.Box,{justifyContent:"center",flexDirection:"column",height:"100%",padding:8,children:f.jsxs(A.BlankSlate,{children:[f.jsx(A.BlankSlateIcon,{name:e?"block":"cloudUpload",lineColor:e?"tomato11":"purple10",backgroundColor:e?"tomato2":"purple3",borderColor:e?"tomato6":"purple6",borderStyle:"dashed",size:"small"}),f.jsx(A.BlankSlateTitle,{size:"regular",children:n})]})})}function cJ(t){const{contentView:e,croppedImage:n}=t,{width:r,height:i,x:o,y:a,zoom:s}=n,l=LNe({origin:e.origin,croppedImage:n});return{...e,width:r,height:i,url:l,edit:{...e.edit,zoom:s,crop:{x:o,y:a}}}}function jNe(t){var c,u,d;const{field:e,content:n,thumbnail:r,croppedImage:i}=t;if(r===Wp)return uJ({content:n,croppedImage:i});const o=ue.isImageContent(n),a=(u=(c=e==null?void 0:e.config)==null?void 0:c.thumbnails)==null?void 0:u.find(p=>p.name===r),s=o?(d=n.thumbnails)==null?void 0:d[r]:void 0;if(!a||!s)return n;const l=cJ({contentView:s,croppedImage:i});return l.url===s.url?n:{...n,thumbnails:o?{...n.thumbnails,[r]:l}:void 0}}function uJ(t){const{content:e,croppedImage:n}=t,r=cJ({contentView:e,croppedImage:n});return r.url===e.url?e:{...e,...r}}function LNe(t){const{origin:e,croppedImage:n}=t,{x:r,y:i,width:o,height:a,cropHeight:s,cropWidth:l}=n,c=new URL(e.url),u=e.height!==a||e.width!==o;if(r!==0||i!==0||s!==e.height||l!==e.width){const p=[r,i,l,s].map(Math.round).join(",");c.searchParams.set("rect",p),c.searchParams.set("w",o.toString()),c.searchParams.set("h",a.toString())}return u&&(c.searchParams.set("w",o.toString()),c.searchParams.set("h",a.toString())),c.toString()}function DNe(t){const{edit:{crop:{x:e,y:n},zoom:r},width:i,height:o,origin:{width:a,height:s}}=t;let l,c;const u=a/s,d=i/o;return d>=u?(l=a/r,c=l/d):(c=s/r,l=c*d),{x:e,y:n,width:i,height:o,zoom:r,cropWidth:l,cropHeight:c}}function PNe(t){const{selectedImage:e,imageCrop:n,setImageCrop:r}=t,{width:i,height:o,zoom:a,cropHeight:s,cropWidth:l}=n,c=e.contentView,u={x:n.x,y:n.y,width:l,height:s},[d,p]=I.useState(),h=(c==null?void 0:c.origin.url)??"",m=!(e!=null&&e.thumbnail.height&&(e!=null&&e.thumbnail.width));function g(y,x){const w=parseInt(x);isNaN(w)||w<=0||!m||r({...n,[y]:w})}function v(y){r({...n,cropWidth:y.width,cropHeight:y.height,x:y.x,y:y.y})}function b(y){r({...n,zoom:y})}function S(){p(sv),r({...n,...sv})}function C(){c&&(p(sv),r({...n,...sv,zoom:1,cropWidth:c.width,cropHeight:c.height}))}return f.jsxs(A.Box,{padding:{inline:24,block:16},flexDirection:"column",gap:16,height:"100%",overflowY:"auto",alignItems:"center",children:[f.jsxs(A.Box,{gap:8,height:32,alignItems:"flex-start",width:"100%",children:[f.jsx(A.Tooltip,{content:"Center",children:f.jsx(A.Button,{color:"grey",size:"medium",startIcon:"centerFocusWeak",onClick:S})}),f.jsx(A.Tooltip,{content:"Cover",children:f.jsx(A.Button,{color:"grey",size:"medium",startIcon:"zoomOutMap",onClick:C})}),f.jsx(A.Separator,{orientation:"vertical"}),f.jsx(A.FormInput,{prefix:"W",prefixTooltip:"Width",placeholder:"width",type:"number",size:"medium",value:String(i),onValueChange:y=>g("width",y),sx:{width:100},disabled:!m}),f.jsx(A.FormInput,{prefix:"H",prefixTooltip:"Height",placeholder:"height",type:"number",size:"medium",value:String(o),onValueChange:y=>g("height",y),sx:{width:100},disabled:!m})]}),f.jsx(A.Cropper,{image:h,aspect:i/o,crop:d??{x:0,y:0},onCropChange:p,zoom:a,onZoomChange:b,onCropAreaChange:(y,x)=>v(x),initialCroppedAreaPixels:u}),f.jsx(A.Box,{width:"100%",maxWidth:320,children:f.jsx(A.Slider,{min:1,max:3,step:.01,value:[a],onValueChange:([y])=>b(y??1)})})]})}const sv={x:0,y:0};function BNe(t){const{trigger:e,initialImages:n,renderTooltip:r}=t,{open:i,onOpenChange:o,ready:a,option:s,selectedImage:l,croppedImage:c,setCroppedImage:u,setReady:d,setOption:p}=UNe(t);return f.jsxs(A.Dialog,{trigger:e,onAnimationEnd:()=>d(!0),open:i,onOpenChange:o,renderTooltip:r,children:[f.jsx(A.DialogHeader,{icon:"photo",title:"Image editor"}),f.jsx(A.DialogDescription,{hidden:!0,children:"Crop your image to the desired size."}),f.jsx(A.DialogOptions,{value:String(s),onValueChange:h=>p(Number(h)),children:n.map((h,m)=>f.jsx(A.DialogOptionsItem,{value:String(m),icon:"photo",title:h.labels[0]??"Main",subtitle:h.labels[1]??""},h.thumbnail.name))}),l&&f.jsx(A.DialogContent,{children:a&&c&&f.jsx(PNe,{selectedImage:l,imageCrop:c,setImageCrop:u},l.thumbnail.name)})]})}function UNe(t){const{initialImages:e,initialOption:n,onClose:r}=t,[i,o]=I.useState(v),[a,s]=I.useState(!1),[l,c]=I.useState(!1),[u,d]=I.useState(n);function p(b){b?(d(n),o(v())):(c(!1),r({option:u,croppedImages:i})),s(b)}const h=e[u],m=i[(h==null?void 0:h.thumbnail.name)??""];function g(b){if(!h)return;const S=h.thumbnail.name;o({...i,[S]:b})}function v(){return e.reduce((b,S)=>(S.contentView&&(b[S.thumbnail.name]=DNe(S.contentView)),b),{})}return{open:a,ready:l,option:u,selectedImage:h,croppedImage:m,setCroppedImage:g,setReady:c,setOption:d,onClose:r,onOpenChange:p}}function NNe(t){const{readOnly:e,altText:n,selected:r,onValueChange:i}=t,o=I.useId();return f.jsxs(A.Field,{selected:r,children:[f.jsx(A.FieldLabel,{htmlFor:o,children:"Alt text"}),f.jsx(A.FieldControl,{children:f.jsx(A.Box,{flexGrow:1,height:40,children:f.jsx(Jl,{id:o,placeholder:"Short description for the visually impaired",readOnly:e,value:n,padding:{input:{inline:12}},onValueChange:i})})})]})}function WNe(t){const{fieldLabel:e,imageLabel:n,initialImages:r,page:i,displaySeparator:o=!0,isSVGContentView:a,visibility:s,onClear:l,onCropperDialogClose:c,onMediaDialogOpenChange:u}=t;return f.jsxs(A.Box,{display:"flex",flexDirection:"column",gap:12,children:[f.jsxs(A.Box,{display:"flex",alignItems:"center",justifyContent:"space-between",flexWrap:"wrap",gap:4,children:[f.jsx(rJ,{fieldLabel:e,imageLabel:n}),f.jsxs(A.CardHeaderActions,{sx:{visibility:s},children:[f.jsx(BNe,{trigger:f.jsx(A.Button,{startIcon:"crop",disabled:a,hiddenLabel:"Crop & Resize"}),renderTooltip:d=>f.jsx(A.Tooltip,{content:"Crop & Resize",children:d}),initialImages:r,initialOption:i,onClose:c}),f.jsx(A.Tooltip,{content:"Replace",children:f.jsx(A.Button,{startIcon:"imageSearch",hiddenLabel:"Replace",onClick:()=>u(!0)})}),f.jsx(A.Tooltip,{content:"Clear",children:f.jsx(A.Button,{onClick:l,startIcon:"delete",hiddenLabel:"Clear"})})]})]}),o&&f.jsx(A.Separator,{style:"dashed",decorative:!0})]})}function Yc(t){const{description:e,largeIconName:n="public",loading:r,error:i,onEdit:o,onUnlink:a}=t,s=i?f.jsx(QNe,{}):f.jsx(zNe,{...t,largeIconName:n,loading:r});return f.jsx(A.Card,{sx:{width:420},children:f.jsxs(A.CardContent,{gap:12,children:[f.jsxs(A.Box,{display:"grid",gridTemplateColumns:"max-content 1fr min-content",gridTemplateRows:"1fr",gap:8,children:[s,f.jsxs(A.ButtonGroup,{size:"medium",color:"grey",sx:{justifySelf:"end"},children:[o&&f.jsx(A.Button,{startIcon:"edit",onClick:o}),a&&f.jsx(A.Button,{startIcon:"linkOff",onClick:a})]})]}),!i&&f.jsx(VNe,{description:e,loading:r})]})})}function KNe(t){const{url:e,title:n,loading:r}=t;return r?f.jsx(dJ,{height:16,width:80}):n?f.jsx(A.Text,{variant:"smallBold",href:e==null?void 0:e.toString(),children:n}):null}function qNe(t){const{subTitle:e,loading:n}=t;return n?f.jsx(A.Box,{padding:{block:2},children:f.jsx(dJ,{height:12,width:60})}):e?f.jsx(A.Text,{variant:"small",color:"grey11",noWrap:!0,children:e}):null}function VNe(t){const{description:e,loading:n}=t;return!e||n?null:f.jsx(A.Text,{variant:"small",color:"grey11",children:e})}function zNe(t){const{largeIconName:e,title:n,url:r,loading:i,subTitle:o}=t;return f.jsxs(f.Fragment,{children:[f.jsx(A.ConjoinedIcons,{largeIconName:e,smallIconName:"link"}),f.jsxs(A.Box,{flexDirection:"column",minWidth:0,children:[f.jsx(KNe,{title:n,url:r,loading:i}),f.jsx(qNe,{subTitle:o,loading:i})]})]})}function QNe(){return f.jsxs(A.Box,{alignItems:"center",gap:8,children:[f.jsx(A.BackgroundIcon,{name:"alert",color:"tomato",size:"small"}),f.jsx(A.Text,{color:"tomato11",children:"Failed to load linked document data"})]})}function dJ(t){const{width:e,height:n}=t;return f.jsx(A.Skeleton,{color:"grey5",borderRadius:6,width:e,height:n})}function p2(){const t=Se();t.searchDocuments||It("searchDocuments");const{coreApiBaseUrl:e,authStrategy:n}=t,r=et.useRequest(KC,[e,n]);return new Set(r.languages.map(i=>({id:i.id,label:i.label})))}function HNe(){const t=Se();t.searchDocuments||It("searchDocuments");const{coreApiBaseUrl:e,authStrategy:n}=t,r=et.useRequest(sG,[e,n]);return new Set(r.results.map(i=>({id:i,label:i})))}function fJ(){const t=Se();t.searchDocuments||It("searchDocuments");const{customTypesApiBaseUrl:e,repository:n,authStrategy:r}=t,i=IC({baseUrl:e,repository:n,authStrategy:r});return new Set(i.data)}function YNe(t){const{documentTypeId:e,documentUrl:n,title:r,statusColor:i,description:o,tags:a,tagsFilter:s,previewImageUrl:l,highlighted:c,highlightedUID:u,searchTerm:d,onSelect:p}=t;function h(m){return m.nativeEvent instanceof MouseEvent&&(m.metaKey||m.ctrlKey)?window.open(n,"_blank"):p()}return f.jsxs(A.Card,{paddingBlock:16,onSelect:h,variant:c?"highlighted":void 0,color:c?"purple2":void 0,sx:{marginBlock:c?4:0,marginInline:4,flexShrink:0},children:[f.jsx(A.CardContent,{children:f.jsxs(A.Box,{justifyContent:"space-between",gap:6,children:[f.jsxs(A.Box,{flexDirection:"column",gap:4,alignItems:"flex-start",flexGrow:1,children:[f.jsx(GNe,{documentTypeId:e}),f.jsx(ZNe,{title:r,statusColor:i,searchTerm:d}),u&&d&&f.jsx(nWe,{uid:u,searchTerm:d}),f.jsx(XNe,{description:o})]}),f.jsx(eWe,{previewImageUrl:l})]})}),a.length>0&&f.jsx(tWe,{tags:a,tagsFilter:s})]})}function GNe(t){const{documentTypeId:e}=t;return f.jsx(A.ErrorBoundary,{renderError:()=>f.jsx(A.Badge,{maxWidth:150,size:"medium",title:"Type: error",icon:"description"}),children:f.jsx(I.Suspense,{fallback:f.jsx(A.Skeleton,{width:150,height:24}),children:f.jsx(JNe,{documentTypeId:e})})})}function JNe(t){const{documentTypeId:e}=t,r=[...fJ()].find(i=>i.id===e);return f.jsx(A.Badge,{size:"medium",title:`Type: ${(r==null?void 0:r.label)??"Unknown"}`,icon:"description"})}function ZNe(t){const{title:e,statusColor:n,searchTerm:r}=t;return f.jsxs(A.Box,{gap:8,alignItems:"center",children:[f.jsx(A.Dot,{color:n}),f.jsx(pJ,{text:e,highlight:r})]})}function XNe(t){const{description:e}=t,n=e==null?void 0:e.substring(0,150);return n?f.jsx(A.Text,{variant:"small",color:"grey11",children:`${n}${n!==e?"...":""}`}):f.jsx(A.Text,{variant:"smallItalic",color:"grey11",children:"No description available"})}function eWe(t){const{previewImageUrl:e}=t;return f.jsx(A.Box,{width:142,height:90,backgroundColor:"grey2",border:!0,borderRadius:6,flexDirection:"column",alignItems:"center",justifyContent:"center",gap:4,flexShrink:0,padding:8,children:e?f.jsx(A.Image,{src:e,sizing:"cover"}):f.jsxs(f.Fragment,{children:[f.jsx(A.Icon,{name:"hideImage",size:"large",color:"grey11"}),f.jsx(A.Text,{color:"grey11",variant:"small",children:"No preview available"})]})})}function tWe(t){const{tags:e}=t;return f.jsxs(A.CardFooter,{children:[f.jsxs(A.Box,{gap:4,alignItems:"center",children:[f.jsx(A.Icon,{name:"label",size:"small",color:"grey11"}),f.jsx(A.Text,{variant:"small",color:"grey11",children:"Tags:"})]}),f.jsx(A.TextOverflow,{children:e.map(n=>f.jsx(A.Badge,{size:"medium",title:n,sx:{marginRight:8}},n))})]})}function nWe(t){const{uid:e,searchTerm:n}=t;return f.jsxs(A.Box,{alignItems:"flex-start",children:[f.jsx(A.Icon,{name:"tag",color:"green11",sx:{width:12,height:12}}),f.jsx(pJ,{variant:"uid",highlight:n,text:e})]})}function pJ(t){const{text:e,highlight:n,variant:r="title"}=t,i=rWe[r],o=n?e.split(new RegExp(`(${nr.escapeStringRegexp(n)})`,"gi")):[e];return f.jsx(A.Text,{variant:i.textVariants.text,color:i.colors.text,hyphens:!0,overflowWrap:"anywhere",children:o.map((a,s)=>a.toLowerCase()===(n==null?void 0:n.toLowerCase())?f.jsx(A.Text,{variant:i.textVariants.highlight,hyphens:!0,overflowWrap:"anywhere",highlight:!0,highlightColor:i.colors.highlight,highlightBorderRadius:2,color:i.colors.highlightText,children:a},s):a)})}const rWe={title:{colors:{text:void 0,highlight:void 0,highlightText:"purple11"},textVariants:{text:"bold",highlight:"bold"}},uid:{colors:{text:"green11",highlight:"green3",highlightText:"green11"},textVariants:{text:"extraSmall",highlight:"extraSmall"}}};function iWe(t){const{searchTerm:e,tagsFilter:n,typesFilter:r,localesFilter:i}=t,o=Se();o.searchDocuments||It("searchDocuments");const{storageVersion:a}=et.useRequest(KC,[o.coreApiBaseUrl,o.authStrategy]);o.searchDocuments||It("searchDocuments");const{status:s}=o,{data:l}=sr.useSuspenseQuery({...rG({searchTerm:e,tags:[...di.map(n,c=>c.id)],customTypes:[...di.map(r,c=>c.id)],locale:[...di.map(i,c=>c.id)][0]??"",status:oT[s],storageVersion:a,config:o}),select:c=>oWe(c.results,oT[s]),staleTime:300});return{documents:l.results}}function oWe(t,e){return{results:t.flatMap(r=>{const o=r.versions.filter(a=>e.includes(a.status));return o.length===0?[]:{...r,versions:o}})}}function aWe(t,e){const n=Se(),r=qe.useDebounceState({initialState:""}),[i,o]=I.useState(new Set),[a,s]=I.useState(new Set);function l(){return!n.searchDocuments||!n.localeId?new Set:new Set([{id:n.localeId,label:n.localeId}])}const[c,u]=I.useState(l),d=di.union(a,Sy(t)),p=di.union(i,Sy(e));return{searchTerm:r,filteredTags:i,setFilteredTags:o,filteredCustomTypes:a,setFilteredCustomTypes:s,filteredLocales:c,setFilteredLocales:u,typesFilter:d,tagsFilter:p}}function Sy(t){return t?di.map(t,e=>({id:e,label:e})):new Set}function sWe(t){const{filteredLocales:e,setFilteredLocales:n,filteredTags:r,setFilteredTags:i,filteredCustomTypes:o,setFilteredCustomTypes:a,fixedTags:s,fixedCustomTypes:l}=t;return f.jsxs(f.Fragment,{children:[f.jsx(cWe,{selectedValues:e,onSelectedValuesChange:n}),f.jsx(dT,{selectedValues:r,fixedSelectedValues:Sy(s),onSelectedValuesChange:i,label:"Tags",icon:"label",fetchFilters:HNe}),f.jsx(dT,{selectedValues:o,fixedSelectedValues:Sy(l),onSelectedValuesChange:a,label:"Type",icon:"description",fetchFilters:fJ})]})}function dT(t){const[e,n]=I.useState(!1),r=I.useRef(null);return f.jsx(A.ErrorBoundary,{ref:r,renderError:()=>{var i;return f.jsx(A.FilterField,{mode:"error",onErrorRetry:(i=r.current)==null?void 0:i.reset,open:e,setOpen:n,values:new Set,...t})},children:f.jsx(I.Suspense,{fallback:f.jsx(A.FilterField,{mode:"loading",open:e,setOpen:n,values:new Set,...t}),children:f.jsx(lWe,{open:e,setOpen:n,...t})})})}function lWe(t){const{open:e,setOpen:n,onSelectedValuesChange:r,fixedSelectedValues:i,selectedValues:o,label:a,icon:s,fetchFilters:l,multiple:c}=t,u=l();return f.jsx(A.FilterField,{open:e,setOpen:n,label:a,icon:s,selectedValues:o,values:new Set(u),fixedSelectedValues:i,onSelectedValuesChange:r,multiple:c})}function cWe(t){const{selectedValues:e,onSelectedValuesChange:n}=t,[r,i]=I.useState(di.first(e));function o(s){n(s),i(di.first(s))}const a=di.find(p2(),s=>{var l;return s.id===((l=di.first(e))==null?void 0:l.id)});return(a==null?void 0:a.label)!==(r==null?void 0:r.label)&&i(a),f.jsx(dT,{selectedValues:new Set(r?[r]:[]),onSelectedValuesChange:o,label:"Locale",icon:"public",fetchFilters:p2,multiple:!1})}function hJ(t){const{onSelectDocument:e,fixedCustomTypes:n,fixedTags:r,linkedDocumentId:i,...o}=t,a=Se(),{searchTerm:s,filteredTags:l,setFilteredTags:c,filteredCustomTypes:u,setFilteredCustomTypes:d,filteredLocales:p,setFilteredLocales:h,typesFilter:m,tagsFilter:g}=aWe(n,r);return f.jsxs(A.Dialog,{size:{height:727,width:656},hasClose:!1,...o,children:[f.jsx(A.DialogTitle,{hidden:!0,children:"Link to a page"}),f.jsx(A.DialogDescription,{hidden:!0,children:"Search and select a page to link to"}),f.jsx(A.DialogContent,{children:f.jsx(A.Box,{flexDirection:"column",height:"100%",children:f.jsxs(A.ScrollArea,{style:{flexGrow:1,paddingBottom:A.theme.space[16],paddingInline:A.theme.space[16],display:"flex",flexDirection:"column"},children:[f.jsx(A.Box,{padding:{top:16,bottom:8},flexDirection:"column",position:"sticky",top:0,backgroundColor:"white",children:f.jsx(A.FormInput,{value:s.value,onValueChange:s.set,placeholder:"Search a page",icon:"search"})}),a.searchDocuments&&f.jsx(A.Box,{padding:{top:4,bottom:8},flexDirection:"column",gap:12,children:f.jsx(sWe,{filteredTags:l,setFilteredTags:c,filteredCustomTypes:u,setFilteredCustomTypes:d,filteredLocales:p,setFilteredLocales:h,fixedTags:r,fixedCustomTypes:n})}),a.searchDocuments?f.jsx(uWe,{searchTerm:s.debouncedValue,tagsFilter:g,typesFilter:m,localesFilter:p,onSelectDocument:e,linkedDocumentId:i}):f.jsx(AJ,{title:"Oops!",message:"Slice Machine does not yet support mock data for linked documents in the simulator."})]})})})]})}function uWe(t){const{searchTerm:e,tagsFilter:n,typesFilter:r,localesFilter:i,linkedDocumentId:o,onSelectDocument:a}=t;return f.jsxs(f.Fragment,{children:[o&&f.jsxs(f.Fragment,{children:[f.jsx(m2,{children:"Linked page"}),f.jsx(A.ErrorBoundary,{renderError:()=>f.jsx(h2,{description:"An error occurred while fetching the linked page."}),children:f.jsx(I.Suspense,{fallback:AWe,children:f.jsx(pWe,{linkedDocumentId:o,tagsFilter:n,onSelectDocument:a})})})]}),f.jsx(m2,{children:"Link to a page"}),f.jsx(A.ErrorBoundary,{renderError:()=>f.jsx(h2,{description:"An error occurred while fetching pages."}),children:f.jsx(I.Suspense,{fallback:fWe,children:f.jsx(dWe,{searchTerm:e,tagsFilter:n,localesFilter:i,typesFilter:r,linkedDocumentId:o,onSelectDocument:a})})})]})}function dWe(t){const{searchTerm:e,tagsFilter:n,localesFilter:r,typesFilter:i,linkedDocumentId:o,onSelectDocument:a}=t,{documents:s}=iWe({searchTerm:e,tagsFilter:n,localesFilter:r,typesFilter:i}),l=s.filter(c=>c.id!==o);return l.length===0?f.jsx(AJ,{title:s.length===1?"No other pages found!":void 0}):f.jsx(A.Box,{flexDirection:"column",gap:12,children:l.map(c=>{const u=c==null?void 0:c.versions[0];return u?f.jsx(mJ,{document:c,version:u,tagsFilter:n,searchTerm:e,onSelectDocument:a},`${c.id}-${u.status}`):null})})}const fWe=f.jsx(A.Box,{flexDirection:"column",gap:12,children:_t.range(1,3).map(t=>f.jsx(A.Skeleton,{height:124,sx:{marginInline:4},zIndex:-1},t))});function h2(t){const{description:e}=t;return f.jsx(A.Box,{flexDirection:"column",alignItems:"center",justifyContent:"center",children:f.jsx(A.DefaultErrorMessage,{title:"Request failed",description:e,errorImageSrc:A.dialogErrorImage})})}function pWe(t){const{linkedDocumentId:e,tagsFilter:n,onSelectDocument:r}=t,i=gWe(e),o=hWe(i);return f.jsx(mJ,{document:i,version:o,tagsFilter:n,onSelectDocument:r,highlighted:!0})}function hWe(t){return I.useMemo(()=>mWe(t),[t])}function mWe(t){return _t.sort(t.versions,e=>e.status==="unclassified"||e.status==="published"?-1:0,e=>e.status==="release"?-1:0,e=>-e.last_modified_date.getTime())[0]}const AWe=f.jsx(A.Skeleton,{height:124,sx:{marginBlock:4,marginInline:4},zIndex:-1});function gWe(t){const e=Se();e.searchDocuments||It("searchDocuments");const{coreApiBaseUrl:n,authStrategy:r}=e;return et.useRequest(kg,[n,r,t])}function mJ(t){var p;const{document:e,version:n,tagsFilter:r,highlighted:i,onSelectDocument:o,searchTerm:a}=t,s=Se();if(!e||!n)return null;const l=cj({documentId:e.id,versionId:n.status==="archived"?n.version_id:void 0,releaseId:n.status==="release"?n.release_id:void 0,status:n.status,baseUrl:s.baseUrl}),c=vWe({tags:n.tags,tagsFilter:r}),u=aT(n)&&n.summary||GY(n)&&n.preview_summary||"",d=aT(n)?(p=n.highlights)==null?void 0:p.uid:void 0;return f.jsx(YNe,{documentTypeId:e.custom_type_id,documentUrl:l,description:u,tags:c,title:e.title,previewImageUrl:n.preview_image,onSelect:()=>o(e.id),statusColor:UY[n.status].color,highlighted:i,highlightedUID:d,searchTerm:a})}function m2(t){const{children:e}=t;return f.jsx(A.Box,{position:"sticky",top:64,backgroundColor:"white",padding:{block:6,inline:4},children:f.jsx(A.Text,{variant:"smallBold",color:"grey11",children:e})})}function AJ(t){const{title:e="No pages found!",message:n="Consider using different keywords or tweaking your filters to find what you need."}=t;return f.jsx(A.Box,{justifyContent:"center",flexDirection:"column",height:"100%",children:f.jsxs(A.BlankSlate,{children:[f.jsx(A.BlankSlateIcon,{name:"close",lineColor:"tomato11",backgroundColor:"tomato4",size:48}),f.jsx(A.BlankSlateTitle,{size:"big",children:e}),f.jsx(A.BlankSlateDescription,{width:360,children:n})]})})}function vWe(t){const{tags:e,tagsFilter:n}=t,r=[...n].map(o=>o.label).reverse();return _t.sort(e,o=>-r.indexOf(o))}function gJ(t){const{hasLink:e,onUnlink:n,selectEnabled:r,selectedType:i,value:o,onOpenLinkModal:a,onValueChange:s,openInNewTab:l=!0,condensedButtons:c=!1,showNewTabButton:u=!1,displayTextEnabled:d,variants:p,variant:h,onVariantChange:m}=t;return f.jsxs(f.Fragment,{children:[!d&&u&&l&&f.jsx(A.Badge,{title:"Open in a new tab",color:"indigo",size:"small",icon:"openInNew",onClick:a}),!e&&r&&f.jsxs(A.Select,{value:i==="any"?void 0:i,color:"grey",size:"small",boldTriggerText:!0,position:"popper",sideOffset:4,startIcon:Fd({selectType:i}),disabled:!r,onValueChange:s,placeholder:c?"":fd("any"),onlyStartIcon:c&&i!==void 0,renderTrigger:({button:g})=>f.jsx(A.Tooltip,{content:fd(i),visible:c,children:g}),children:[f.jsx(A.SelectItem,{value:"web",icon:"public",children:fd("web")}),f.jsx(A.SelectItem,{value:"document",icon:"description",children:fd("document")}),f.jsx(A.SelectItem,{value:"media",icon:"image",children:fd("media")})]},i===void 0?"unlinked":"linked"),!e&&!r&&f.jsx(A.Button,{startIcon:Fd({selectType:i}),color:"grey",textColor:"link",textWeight:"normal",size:"small",onClick:a,children:fd(i)}),e&&!d&&f.jsx(A.Button,{startIcon:"close",color:"grey",size:"small",onClick:n,"aria-label":"Close"}),e&&d&&f.jsxs(A.ButtonGroup,{density:"compact",children:[f.jsx(A.Button,{startIcon:Fd({selectType:i}),renderEndIcon:()=>l&&i==="web"?f.jsx(A.Icon,{name:"openInNew",size:"extraSmall",color:"indigo11"}):null,color:"grey",textColor:"link",textWeight:"normal",size:"small",disabled:!e,onClick:a,children:o.length>30?`${o.slice(0,30)}...`:o}),f.jsx(A.Button,{startIcon:"close",color:"grey",size:"small",onClick:n})]}),p.length>1&&f.jsx(A.Select,{value:h,color:"grey",size:"small",boldTriggerText:!0,position:"popper",sideOffset:4,startIcon:"colorLens",onValueChange:m,children:p.map((g,v)=>f.jsx(A.SelectItem,{value:g,children:g},`${g}-${v}`))})]})}function fd(t){if(!t||t==="any")return"Choose link type";switch(t){case"document":return"Link to Prismic page";case"web":return"Link to web page";case"media":return"Link to media"}}function vJ(t){const{onEdit:e,onUnlink:n,url:r,title:i,subTitle:o}=t,[a,s]=I.useState(null);return f.jsx(A.Card,{paddingBlock:16,ref:s,children:f.jsxs(A.CardContent,{children:[f.jsx(bWe,{url:r,title:i,subTitle:o,onEdit:e,onUnlink:n,container:a}),r&&f.jsx(A.CheckerBoard,{children:f.jsx(yWe,{children:f.jsx(A.Image,{src:r,alt:i,sizing:"contain"})})})]})})}function yWe(t){const{children:e}=t;return f.jsx(A.Box,{flexDirection:"column",alignItems:"center",justifyContent:"center",position:"relative",height:327,children:e})}function bWe(t){const{url:e,title:n,subTitle:r,onEdit:i,onUnlink:o,container:a}=t;return f.jsxs(A.Box,{flexDirection:"row",justifyContent:"space-between",gap:8,children:[f.jsxs(A.Box,{gap:8,minWidth:0,children:[f.jsx(A.ConjoinedIcons,{largeIconName:"image",smallIconName:"link"}),f.jsxs(A.Box,{flexDirection:"column",minWidth:0,children:[f.jsx(A.Text,{noWrap:!0,variant:"smallBold",href:e,inline:!0,children:n}),f.jsx(A.Text,{variant:"small",color:"grey11",children:r})]})]}),f.jsxs(A.ButtonGroup,{size:"medium",color:"grey",children:[i&&f.jsx(A.Tooltip,{content:"Edit link",side:"top",container:a,children:f.jsx(A.Button,{startIcon:"edit",onClick:i})}),o&&f.jsx(A.Tooltip,{content:"Remove link",side:"top",container:a,children:f.jsx(A.Button,{startIcon:"linkOff",onClick:o})})]})]})}function CWe(t){var q,H,z;const{field:e,content:n,onContentChange:r}=t,i=S(),o=((q=e.config)==null?void 0:q.allowText)??!1,a=o&&(n==null?void 0:n.value.text)||void 0,s=((H=e.config)==null?void 0:H.variants)??[],c=(n==null?void 0:n.value.variant)&&s.includes(n==null?void 0:n.value.variant)?n==null?void 0:n.value.variant:s[0],[u,d]=I.useState(b),p=ue.FilledExternalLinkContent.is(n==null?void 0:n.value)&&(n==null?void 0:n.value.target)||void 0,[h,m]=I.useState(!1),g=I.useRef(null);qe.useOnChange(i,$);const v=u?SWe[u]:void 0;function b(){var K,Y;return!((K=e.config)!=null&&K.select)||n!=null&&n.value.__TYPE__?n==null?void 0:n.value.__TYPE__:A2[(Y=e.config)==null?void 0:Y.select]}function S(){return n?ue.FilledDocumentLinkContent.is(n.value)?n.value.id:ue.FilledExternalLinkContent.is(n.value)?n.value.url:ue.FilledFileLinkContent.is(n.value)||ue.FilledImageLinkContent.is(n.value)?n.value.name:"":""}function C(K){var L;const{displayText:Y,variant:ee}=K;if(!Y&&!ee)return r(void 0);switch((L=e.config)==null?void 0:L.select){case"web":return r({__TYPE__:"LinkContent",key:pd(n),value:{__TYPE__:"ExternalLink",kind:"web",...Y&&{text:Y},...ee&&{variant:ee}}});case"document":return r({__TYPE__:"LinkContent",key:pd(n),value:{__TYPE__:"DocumentLink",kind:"document",...Y&&{text:Y},...ee&&{variant:ee}}});case"media":return r({__TYPE__:"LinkContent",key:pd(n),value:{__TYPE__:"MediaLink",kind:"media",...Y&&{text:Y},...ee&&{variant:ee}}});default:return r({__TYPE__:"LinkContent",key:pd(n),value:{__TYPE__:"AnyLink",kind:"any",...Y&&{text:Y},...ee&&{variant:ee}}})}}function y(K,Y){if(!K)return C({displayText:a,variant:c});const{newTab:ee=!1}=Y??{},L=ee?"_blank":void 0;switch(u){case"ExternalLink":return r({__TYPE__:"LinkContent",key:pd(n),value:{__TYPE__:"ExternalLink",url:K,target:L,...a&&{text:a},...c&&{variant:c}}});case"DocumentLink":return r({__TYPE__:"LinkContent",key:pd(n),value:{__TYPE__:"DocumentLink",id:K,...a&&{text:a},...c&&{variant:c}}});default:return r(void 0)}}function x(K){return n?r({__TYPE__:n.__TYPE__,key:n.key,value:{...n.value,text:K}}):C({displayText:K})}function w(K){return n?r({__TYPE__:n.__TYPE__,key:n.key,value:{...n.value,variant:K}}):C({variant:K})}const _=xWe();function E(K){d(K?A2[K]:void 0),y(""),K&&K!=="any"&&_(K)}function R(K){y(K)}function O(){m(!0)}function $(){var K;h&&(m(!1),(K=g.current)==null||K.reset())}function U(K){const Y=yJ({media:K});switch(Y.value.__TYPE__){case"ImageLink":return r({__TYPE__:Y.__TYPE__,key:Y.key,value:{...Y.value,...a&&{text:a},...c&&{variant:c}}});case"FileLink":return r({__TYPE__:Y.__TYPE__,key:Y.key,value:{...Y.value,...a&&{text:a},...c&&{variant:c}}})}}return{contentType:u,selectType:v,fieldValue:i,onDisplayTextChange:x,onValueChange:y,onTypeChange:E,placeholder:od(e),isTypeSelectEnabled:!((z=e.config)!=null&&z.select),onDocumentSelected:R,onError:O,errorBoundaryRef:g,isTargetNewTab:p==="_blank",onMediaSelected:U,displayTextEnabled:o,displayText:a??"",variants:s,variant:c,onVariantChange:w}}function pd(t){return t?t.key:crypto.randomUUID()}const SWe={AnyLink:"any",DocumentLink:"document",ExternalLink:"web",FileLink:"media",ImageLink:"media",MediaLink:"media"},A2={any:"AnyLink",document:"DocumentLink",web:"ExternalLink",media:"FileLink"};function wWe(t){const e=Se();e.searchDocuments||It("searchDocuments");const{coreApiBaseUrl:n,authStrategy:r}=e;return et.useRequest(kg,[n,r,t]).title}et.cache.registerFetcherConfig(kg,{concurrency:50});function yJ(t){var i,o,a,s,l,c;const{media:e}=t,n="kind"in e;return n&&e.kind==="image"?{__TYPE__:"LinkContent",key:crypto.randomUUID(),value:{__TYPE__:"ImageLink",id:e.id,name:e.filename,url:e.url,kind:"image",size:e.size.toString(),height:((i=e.height)==null?void 0:i.toString())??`${Qs}`,width:((o=e.width)==null?void 0:o.toString())??`${Qs}`,date:((a=e.last_modified)==null?void 0:a.toString())??""}}:n?{__TYPE__:"LinkContent",key:crypto.randomUUID(),value:{__TYPE__:"FileLink",id:e.id,name:e.filename,kind:"file",url:e.url,size:e.size.toString(),date:((s=e.last_modified)==null?void 0:s.toString())??""}}:{__TYPE__:"LinkContent",key:crypto.randomUUID(),value:{__TYPE__:"ImageLink",id:e.id,name:(e==null?void 0:e.alt)??e.url,kind:"image",url:e.url,size:"0",height:((l=e.height)==null?void 0:l.toString())??`${Qs}`,width:((c=e.width)==null?void 0:c.toString())??`${Qs}`}}}const xWe=()=>{const t=sNe(),{onAnalyticsEvent:e}=Se();function n(r){t&&e&&e("Generic Link Added",{type:r,isInSlice:String(t.isInSlice),isInGroup:String(t.isInGroup),isInRepeatable:String(t.isInRepeatable),customTypeFormat:t.customTypeFormat??"custom"})}return n};function TWe(t){const{open:e,onOpenChange:n,showNewTabButton:r}=t,{url:i,setUrl:o,openInNewTab:a,setOpenInNewTab:s,disabled:l,onUpdate:c}=_We(t);return f.jsxs(A.Dialog,{open:e,onOpenChange:n,size:"small",noDescription:!0,children:[f.jsx(A.DialogHeader,{title:"Set Link URL"}),f.jsxs(A.DialogContent,{padding:16,children:[f.jsx(A.FormInput,{value:i,onValueChange:o,placeholder:"Paste URL",icon:"public"}),r&&f.jsx(A.InlineLabel,{value:"Open in a new tab",children:f.jsx(A.Checkbox,{checked:a,onCheckedChange:s})})]}),f.jsxs(A.DialogActions,{children:[f.jsx(A.DialogCancelButton,{}),f.jsx(A.DialogActionButton,{onClick:c,disabled:l,children:"Update"})]})]})}function _We(t){const{url:e,openInNewTab:n,onUpdate:r,open:i}=t,[o,a]=I.useState(e),[s,l]=I.useState(n);qe.useOnChange(i,()=>{i&&(a(e),l(n))});const c=!o||o===e&&s===n;function u(){r(o,{newTab:s})}return{url:o,setUrl:a,openInNewTab:s,disabled:c,setOpenInNewTab:l,onUpdate:u}}function Sj(t){var Y,ee,L,M,F;const{content:e,field:n,id:r,onContentChange:i,appearance:o="normal",backgroundColor:a="grey1"}=t,s=qe.useDebounceState({initialState:!1}),[l,c]=I.useState(),{contentType:u,fieldValue:d,errorBoundaryRef:p,onDocumentSelected:h,onError:m,onMediaSelected:g,onValueChange:v,selectType:b,onTypeChange:S,isTypeSelectEnabled:C,displayTextEnabled:y,...x}=CWe({content:e,field:n,onContentChange:i}),w=u==="DocumentLink"&&d!=="",E=u==="ExternalLink"&&pi.toURL(d),R=!!((Y=n.config)!=null&&Y.allowTargetBlank);function O(){switch(u){case"DocumentLink":return c("document");case"ExternalLink":return c("web");case"FileLink":case"ImageLink":case"MediaLink":return c("media");default:return c(void 0)}}const $={...x,id:r,onFocus:()=>s.set(!0),onBlur:()=>s.set(!1),onOpenLinkModal:O,onUnlink:()=>{C?S(void 0):v("")},onSelectValueChange:V=>{S(V),c(V)},value:d,allowTargetBlank:R,selectType:b,onValueChange:v,isTypeSelectEnabled:C,displayTextEnabled:y,onKeyDown(V){y||(V.key==="Enter"||V.key===" ")&&(O(),V.preventDefault())},onClick:()=>{y||O()},appearance:o},{searchDocuments:U}=Se();function q(V){if(V)return;const pe=e&&e.value.__TYPE__!=="AnyLink";!V&&!pe&&C&&S(void 0),c(void 0)}function H(V,pe){v(V,pe),c(void 0)}function z(V){g(V),c(void 0)}function K(V){h(V),c(void 0)}return f.jsxs(f.Fragment,{children:[f.jsxs(A.Popover,{align:"start",sideOffset:-3,focusOnEnter:!1,open:s.debouncedValue,anchor:f.jsxs(A.Field,{variant:IWe(o),color:a,children:[w?f.jsx(kWe,{documentId:d,displayTextEnabled:y}):f.jsx(A.FieldIcon,{name:Fd({selectType:b,displayTextEnabled:y})}),o!=="compact"&&f.jsx(A.FieldLabel,{htmlFor:r,children:Fr(n)}),f.jsx(A.FieldControl,{children:w&&U?f.jsx(OWe,{errorBoundaryRef:p,onError:m,fallback:f.jsx(fT,{...$,value:"..."}),renderError:()=>EWe($),children:f.jsx(RWe,{...$,documentId:d})}):f.jsx(fT,{...$})})]}),children:[E&&f.jsx(Yc,{url:E,title:pi.getUrlTitle(E)??"",subTitle:E.toString()}),e&&ue.FilledImageLinkContent.is(e.value)&&f.jsx(vJ,{url:e.value.url,title:e.value.name,subTitle:`${e.value.width} x ${e.value.height} pixels`})]}),f.jsx(TWe,{open:l==="web",onOpenChange:q,onUpdate:H,url:d,openInNewTab:x.isTargetNewTab,showNewTabButton:!!((ee=n.config)!=null&&ee.allowTargetBlank)}),f.jsx(Cj,{open:l==="media",onOpenChange:q,onMediaSelected:z,assetType:"all"}),f.jsx(hJ,{open:l==="document",onOpenChange:q,onSelectDocument:K,fixedCustomTypes:new Set((M=(L=n.config)==null?void 0:L.customtypes)==null?void 0:M.map(V=>typeof V=="string"?V:V.id)),fixedTags:new Set((F=n.config)==null?void 0:F.tags),linkedDocumentId:e&&ue.FilledDocumentLinkContent.is(e.value)?e.value.id:void 0})]})}function IWe(t){switch(t){case"compact":return"compact";case"normal":return"normal";default:return}}function EWe(t){return f.jsx(fT,{...t})}function fT(t){const{id:e,value:n,onOpenLinkModal:r,onBlur:i,isTypeSelectEnabled:o,selectType:a,onSelectValueChange:s,onUnlink:l,isTargetNewTab:c,allowTargetBlank:u,displayTextEnabled:d,displayText:p,onFocus:h,onClick:m,onKeyDown:g,appearance:v,placeholder:b,variants:S,variant:C,onVariantChange:y,onDisplayTextChange:x,onValueChange:w}=t;return f.jsx(A.Box,{padding:{block:4},width:"100%",children:f.jsx(Jl,{id:e,textOverflow:"ellipsis",variant:d?"normal":"link",readOnly:!d,placeholder:d?"Add your display text":b,padding:bJ(v),value:d?p:n,cursor:CJ({value:n,displayTextEnabled:d,isTypeSelectEnabled:o}),onBlur:i,onFocus:h,onClick:m,onKeyDown:g,onValueChange:d?x:w,endAdornment:f.jsx(gJ,{hasLink:!!(n&&a),onUnlink:l,selectEnabled:o,selectedType:a,value:n,onOpenLinkModal:r,onValueChange:s,openInNewTab:c,condensedButtons:v==="condensedButtons",showNewTabButton:u&&a==="web",displayTextEnabled:d,variants:S,variant:C,onVariantChange:y})})})}function RWe(t){const{id:e,documentId:n,onOpenLinkModal:r,isTypeSelectEnabled:i,selectType:o,displayTextEnabled:a,onSelectValueChange:s,onUnlink:l,onFocus:c,onClick:u,onKeyDown:d,appearance:p,variants:h,variant:m,displayText:g,onVariantChange:v,onDisplayTextChange:b}=t,S=wWe(n),C=SJ(n);return f.jsx(Jl,{id:e,textOverflow:"ellipsis",padding:bJ(p),placeholder:a?"Add your display text":void 0,readOnly:!a,value:a?g:S,variant:a?"normal":"link",cursor:CJ({value:S,displayTextEnabled:a,isTypeSelectEnabled:i}),onFocus:c,onClick:u,onKeyDown:d,onValueChange:a?b:void 0,endAdornment:f.jsxs(A.Box,{gap:4,children:[C&&f.jsx(A.Badge,{title:"Broken Link",color:"tomato"}),f.jsx(gJ,{hasLink:!0,onUnlink:l,selectEnabled:i,selectedType:o,value:S,onOpenLinkModal:r,condensedButtons:p==="condensedButtons",onValueChange:s,displayTextEnabled:a,variants:h,variant:m,onVariantChange:v})]})})}function kWe(t){const{documentId:e,displayTextEnabled:n}=t;return f.jsx(A.ErrorBoundary,{renderError:()=>f.jsx(A.FieldIcon,{name:"warning"}),children:f.jsx(I.Suspense,{fallback:f.jsx(A.FieldIcon,{name:Fd({selectType:"document",displayTextEnabled:n})}),children:f.jsx($We,{documentId:e,displayTextEnabled:n})})})}function $We(t){const{displayTextEnabled:e,documentId:n}=t;return SJ(n)?f.jsx(A.FieldIcon,{name:"linkOff"}):f.jsx(A.FieldIcon,{name:Fd({selectType:"document",displayTextEnabled:e})})}function bJ(t){switch(t){case"compact":return{input:{inline:4}};default:return}}function OWe(t){const{errorBoundaryRef:e,onError:n,children:r,fallback:i,renderError:o}=t;return f.jsx(A.ErrorBoundary,{ref:e,onError:n,renderError:o,children:f.jsx(I.Suspense,{fallback:i,children:r})})}function Fd(t){const{selectType:e,displayTextEnabled:n}=t;if(n)return"notes";switch(e){case"document":return"description";case"web":return"public";case"media":return"image";default:return"link"}}function CJ(t){const{value:e,displayTextEnabled:n,isTypeSelectEnabled:r}=t;return n?"text":r&&!e?"default":"pointer"}function MWe(t){const{onContentChange:e,...n}=t;function r(i){const o=ue.FilledLinkContent.is(i)?i:void 0;e(o)}return f.jsx(Sj,{...n,onContentChange:r})}function SJ(t){const e=Se();e.uidField||It("uidField");const{coreApiBaseUrl:n,authStrategy:r}=e,{data:i}=pj({baseUrl:n,authStrategy:r,documentIds:[t],statuses:["archived","unclassified","published"]});if(i.results.length===0||i.results.length>1)return!1;const o=i.results[0];return o==null?void 0:o.versions.every(a=>a.status==="archived")}function FWe(t){const{onDelete:e,isDeleteEnabled:n,onMoveUp:r,onMoveDown:i,isMoveUpEnabled:o,isMoveDownEnabled:a}=t;return f.jsxs(A.DropdownMenu,{children:[f.jsx(A.DropdownMenuTrigger,{children:f.jsx(A.IconButton,{hiddenLabel:"Link actions",icon:"moreVert",size:"small",variant:"solid"})}),f.jsxs(A.DropdownMenuContent,{children:[f.jsx(A.DropdownMenuLabel,{children:f.jsx(A.Text,{variant:"small",color:"grey11",children:"Item options"})}),f.jsx(A.DropdownMenuItem,{onSelect:r,startIcon:f.jsx(A.Icon,{name:"arrowUpward"}),disabled:!o,children:"Move up"}),f.jsx(A.DropdownMenuItem,{onSelect:i,startIcon:f.jsx(A.Icon,{name:"arrowDownward"}),disabled:!a,children:"Move down"}),f.jsx(A.DropdownMenuItem,{color:"tomato",onSelect:e,startIcon:f.jsx(A.Icon,{name:"delete",color:"tomato9"}),disabled:!n,children:"Delete"})]})]})}function jWe(t){const{field:e,content:n,onContentChange:r}=t,{config:i}=e,o=I.useMemo(()=>Ow({config:i}),[i]),a=n!=null&&n.value.length?n.value:[o];function s(p){const h=_t.insertAtIndex(a,p,Ow({config:i}));r(Gp(h))}function l(p,h){var v;const m=[...a],g=Ow({config:i,key:(v=m[h])==null?void 0:v.key});m[h]=p??g,r(Gp(m))}function c(p){r(Gp(p))}function u(p){const h=_t.removeIndex(a,p);r(Gp(h))}function d(p,h){const m=_t.move(a,h,h+LWe(p));r(Gp(m))}return{links:a,updateLink:l,updateLinks:c,addLink:s,deleteLink:u,moveLink:d}}function LWe(t){switch(t){case"up":return-1;case"down":return 1}}function Ow(t){const{config:e,key:n=crypto.randomUUID()}=t,r=DWe(e==null?void 0:e.select);return e!=null&&e.allowText&&(r.text=""),{__TYPE__:"LinkContent",key:n,value:r}}function DWe(t){switch(t){case"web":return{__TYPE__:"ExternalLink",kind:"web"};case"document":return{__TYPE__:"DocumentLink",kind:"document"};case"media":return{__TYPE__:"MediaLink",kind:"media"};default:return{__TYPE__:"AnyLink",kind:"any"}}}function Gp(t){return{__TYPE__:"RepeatableContent",type:"Link",value:t}}function PWe(t){const{id:e,field:n}=t,r=jWe(t),[i,o]=I.useState(!1),{links:a}=r;return f.jsx(aNe,{children:f.jsxs(A.FieldSet,{id:e,legend:BWe(n.config),variant:"compact",selected:i,children:[f.jsx(UWe,{field:n,items:a,onItemDelete:r.deleteLink,onItemChange:r.updateLink,onItemMove:r.moveLink,onItemAdd:r.addLink,onItemReorder:r.updateLinks,onDragStatusChange:o}),f.jsx(A.Button,{startIcon:"add",color:"grey",onClick:()=>r.addLink(a.length),sx:{marginInline:4,marginBlock:4},children:"Add"})]})})}function BWe(t){return t!=null&&t.label?`Multiple • ${t.label}`:"Multiple"}function UWe(t){const{field:e,items:n,onItemChange:r,onItemDelete:i,onItemMove:o}=t,a=n.length>1,s=NWe(t);return f.jsx(A.AnimatedList,{items:n,getItemKey:l=>l.key,ariaLabel:"Link list",dnd:s,children:(l,c)=>f.jsxs(A.Draggable,{disabled:!a,children:[f.jsx(Sj,{appearance:"compact",content:l,field:e,onContentChange:u=>r(u,c),backgroundColor:"transparent"}),f.jsx(FWe,{onDelete:()=>i(c),isDeleteEnabled:n.length>1,onMoveUp:()=>o("up",c),isMoveUpEnabled:c>0,onMoveDown:()=>o("down",c),isMoveDownEnabled:c<n.length-1})]})})}function NWe(t){const{onDragStatusChange:e,onItemReorder:n,onItemAdd:r}=t,{scrollOffsetTop:i}=Se(),o=qe.useStableCallback(r);return{renderDropIndicator:s=>f.jsx(WWe,{...s,onItemAdd:o}),scrollOffsetTop:i,onDragChange:e,onReorder:n}}function WWe(t){const{isDropTarget:e,itemIndex:n,position:r,itemCount:i,onItemAdd:o}=t;return n===0&&r==="before"?f.jsx(g2,{isDropTarget:e,position:"before"}):n===i-1&&r==="after"?f.jsx(g2,{isDropTarget:e,position:"after"}):f.jsx(KWe,{index:n,isDropTarget:e,onItemAdd:o})}function KWe(t){const{index:e,onItemAdd:n,isDropTarget:r}=t,[i,o]=I.useState(0);function a(){n(e+1),o(s=>s+1)}return f.jsx(A.HairlineButton,{icon:"add",size:"small",variant:"rightDashed",tooltip:{content:"Add item below"},onClick:a,dropMode:r,sx:{marginInline:4}},i)}function g2(t){const{isDropTarget:e,position:n}=t;return f.jsx(A.AnimatedElement,{enterDuration:150,animation:{name:"expand-vertical"},children:e&&f.jsx(A.Box,{children:f.jsx(A.Line,{color:"purple",thickness:2,sx:{width:"100%",marginBottom:n==="before"?4:void 0,marginTop:n==="after"?4:void 0}},"line")})})}function qWe(t){const{linkTo:e,onLinkToChange:n}=t,r=VWe(e);return f.jsx(MWe,{content:r,onContentChange:i=>n(zWe(i)),field:{type:"Link",config:{label:"Link",allowTargetBlank:!0,allowText:!1}},appearance:"condensedButtons"})}function VWe(t){const[e]=I.useState(()=>crypto.randomUUID());if(t)return{__TYPE__:"LinkContent",key:e,value:t}}function zWe(t){return t==null?void 0:t.value}function wJ(t){var C,y;const{allContentViews:e,content:n,contentView:r,fieldLabel:i,imageLabel:o,initialImages:a,isUpdating:s,page:l=0,readOnly:c,thumbnailName:u,onClear:d,onContentChange:p,onCropperDialogClose:h,onPageChange:m,onMediaDialogOpenChange:g}=t,v=((y=(C=n==null?void 0:n.url)==null?void 0:C.split("?")[0])==null?void 0:y.slice(-4))===".svg",b=n!=null&&n.url&&!c?"visible":"hidden",S=!ue.isImageContent(n);return f.jsxs(A.Box,{display:"flex",gap:12,padding:{inline:12},children:[f.jsx(A.Box,{children:f.jsx(A.Carousel,{getItemSource:zBe,items:e,onPageChange:m,page:l,buttonSize:"small",renderPrevTooltip:x=>f.jsx(A.Tooltip,{content:"Previous",children:x}),renderNextTooltip:x=>f.jsx(A.Tooltip,{content:"Next",children:x}),style:S?{width:181,height:142}:{width:123,height:93},children:x=>(x==null?void 0:x.url)&&f.jsx(A.CarouselItem,{"aria-label":"Image Field Item",src:KG(x.url),alt:x.alt??void 0,isUpdating:s,disableAnimation:S},`${u}_${x.url}`)})}),f.jsxs(A.Box,{width:"100%",display:"flex",flexDirection:"column",gap:S?16:12,children:[f.jsx(WNe,{fieldLabel:i,imageLabel:o,initialImages:a,page:l,displaySeparator:!S,isSVGContentView:v,visibility:b,onClear:d,onCropperDialogClose:h,onMediaDialogOpenChange:g}),f.jsx(NNe,{readOnly:c||!r,altText:(r==null?void 0:r.alt)??"",onValueChange:x=>{r&&p(WBe(u,n,r,x))}}),S&&f.jsx(qWe,{linkTo:n.linkTo,onLinkToChange:x=>{p({...n,linkTo:x})}})]})]})}function xJ(t){const{onMediaSelected:e}=t,n=Se(),{showAlert:r}=A.useAlert(),{mutate:i,isPending:o}=sr.useMutation({mutationFn:a=>EG({file:a,config:n}),onSuccess:a=>{e(a)},onError:()=>{r({title:"Error uploading image",subtitle:"Please try again"})}});return{uploadImage:i,isUploadingImage:o}}function QWe(t){const{content:e,onContentChange:n,field:r}=t,[i,o]=I.useState(0),[a,s]=I.useTransition(),l=UBe(r),c=l[i],u=e?NBe(r,e):void 0,d=u==null?void 0:u[i];function p(S){if(!c)return;const C=QBe(c.name,r,e,S);C!==e&&s(()=>n(C))}function h(S){s(()=>o(S))}function m({option:S,croppedImages:C}){if(o(S),!e)return;const y=Object.entries(C).reduce((x,[w,_])=>jNe({field:r,content:x,thumbnail:w,croppedImage:_}),e);y!==e&&s(()=>n(y))}function g(){o==null||o(0),n(void 0)}const{uploadImage:v,isUploadingImage:b}=xJ({onMediaSelected:p});return{onCropperDialogClose:m,onPageChange:h,onMediaSelected:p,isUpdating:a,page:i,thumbnail:c,allThumbnails:l,allContentViews:u,contentView:d,onClear:g,uploadImage:v,isUploadingImage:b}}function HWe(t){const{content:e,field:n,readOnly:r,onContentChange:i}=t,o=e&&e.origin.url.length>0,{onCropperDialogClose:a,onPageChange:s,isUpdating:l,page:c,onMediaSelected:u,thumbnail:d,allThumbnails:p,allContentViews:h,contentView:m,onClear:g,uploadImage:v,isUploadingImage:b}=QWe({field:n,content:e,onContentChange:i}),[S,C]=I.useState(!1),y=Fr(n),x=p.map((R,O)=>{const $=h==null?void 0:h[O];return{thumbnail:R,contentView:$,labels:lT(R,e,$)}}),w=d&&o?lT(d,e,m).filter(no.isDefined):[],_=d&&e&&o&&h,E=b||l;return f.jsx(sJ,{isMediaDialogOpen:S,onMediaSelected:u,onMediaDialogOpenChange:C,children:f.jsx(I.Suspense,{fallback:f.jsx("div",{style:{height:95}}),children:_?f.jsx(wJ,{allContentViews:h,content:e,contentView:m,fieldLabel:y,imageLabel:w,initialImages:x,isUpdating:E,page:c,readOnly:r,thumbnailName:d.name,onClear:g,onContentChange:i,onCropperDialogClose:a,onMediaDialogOpenChange:C,onPageChange:s}):f.jsx(lJ,{uploadImage:v,isUploading:b,disabled:r||S,children:f.jsx(iJ,{fieldLabel:y,isUpdating:E,readOnly:r,onMediaDialogOpenChange:C})})})})}function YWe(t){var v,b;const{searchTerm:e,catalogId:n}=t,r=Se();r.integrationFields||It("integrationFields");const{integrationFieldsApiBaseUrl:i,repository:o,authStrategy:a}=r,[s,l]=I.useState(1),[c,u]=I.useState([]),[d,p]=I.useState(""),h=et.useRequest(GWe,[i,a,o,n,e,e===d?s:1]);e!==d?(p(e),l(1),u(h.items)):h.items.length>0&&((v=_t.last(c))==null?void 0:v.id)!==((b=_t.last(h.items))==null?void 0:b.id)&&u(S=>S.concat(h.items));const m=s<h.totalPages;function g(){m&&l(S=>S+1)}return{items:c,response:h,fetchNextPage:g,hasNextPage:m}}function GWe(t,e,n,r,i,o=1,a=30){const s=new URL(`if/search/${r}`,t);return s.searchParams.set("searchTerm",i),s.searchParams.set("limit",a.toString()),s.searchParams.set("page",o.toString()),oe.request(s,{headers:{repository:n},credentials:oe.getRequestCredentials(e),okType:JWe})}const TJ=k.object({id:k.string(),title:k.string(),imageURL:k.string().optional(),description:k.string().optional()}),JWe=k.object({items:k.array(TJ),totalPages:k.number(),page:k.number()});function _J(t){const{itemId:e,catalogId:n}=t,r=Se();r.integrationFields||It("integrationFields");const{integrationFieldsApiBaseUrl:i,repository:o,authStrategy:a}=r,l=et.useRequest(ZWe,[i,a,o,n,e]).items[0];if(!l)throw new Error("Item not found");return{item:l}}function ZWe(t,e,n,r,i){const o=new URL(`if/read/${r}`,t);return o.searchParams.set("ids",[i].toString()),oe.request(o,{headers:{repository:n},credentials:oe.getRequestCredentials(e),okType:XWe})}const XWe=k.object({items:k.array(TJ)});function wj(t){const{item:e,onClick:n,catalogId:r}=t;return f.jsxs(A.PreviewCard,{variant:"large",onClick:n,children:[f.jsx(eKe,{src:e.imageURL??"",alt:e.title}),f.jsxs(A.PreviewContent,{children:[f.jsx(A.Badge,{title:`Catalog: ${r}`,icon:"multipleStop",size:"medium"}),f.jsx(A.Text,{variant:"bold",color:"grey12",sx:{marginTop:4},children:e.title}),f.jsx(A.Text,{variant:"small",color:"grey11",children:e.description??e.id})]})]})}const lv=76;function eKe(t){const{src:e,alt:n}=t;return e?f.jsx(A.PreviewImage,{src:e,alt:n,width:lv,height:lv,framed:!0}):f.jsxs(A.Box,{borderRadius:6,backgroundColor:"grey2",height:lv,width:lv,flexDirection:"column",alignItems:"center",justifyContent:"center",border:!0,padding:{inline:4,block:8},children:[f.jsx(A.Icon,{name:"hideImage",size:"large",color:"grey11"}),f.jsx(A.Text,{color:"grey11",variant:"small",noSelect:!0,align:"center",children:"No preview image"})]})}function bd(){return f.jsxs(A.PreviewCard,{variant:"large",children:[f.jsx(A.Skeleton,{height:76,width:76}),f.jsxs(A.PreviewContent,{children:[f.jsx(A.Skeleton,{height:24,width:168}),f.jsx(A.Skeleton,{height:24,width:240,sx:{marginTop:4}}),f.jsx(A.Skeleton,{height:16,width:144})]})]})}function tKe(t){const{open:e,onOpenChange:n,catalogId:r,onSelectItem:i}=t,o=qe.useDebounceState({initialState:""}),a=Se();return f.jsx(A.Dialog,{open:e,onOpenChange:n,hasClose:!1,size:{width:612,height:724},noDescription:!0,children:f.jsx(A.DialogContent,{children:f.jsxs(A.Box,{flexDirection:"column",height:"100%",children:[f.jsxs(A.Box,{padding:{top:16,inline:16},flexDirection:"column",gap:8,children:[f.jsx(A.FormSearchInput,{value:o.value,onValueChange:o.set,placeholder:"Search in your catalog"}),f.jsx(A.DialogTitle,{asChild:!0,children:f.jsx(A.Text,{variant:"smallBold",color:"grey11",children:"Select an item"})})]}),a.integrationFields?f.jsx(A.ErrorBoundary,{renderError:()=>f.jsx(pT,{message:"There was an error while fetching your catalog items."}),children:f.jsx(I.Suspense,{fallback:f.jsxs(A.Box,{flexDirection:"column",gap:12,padding:{top:10,inline:16,bottom:16},children:[f.jsx(bd,{}),f.jsx(bd,{}),f.jsx(bd,{}),f.jsx(bd,{}),f.jsx(bd,{})]}),children:f.jsx(nKe,{searchTerm:o.debouncedValue,catalogId:r,onItemClick:i})})}):f.jsx(pT,{message:"Slice Machine does not yet support mock data for integration field in the simulator."})]})})})}function nKe(t){const{catalogId:e,searchTerm:n,onItemClick:r}=t,[i,o]=I.useTransition(),{items:a,hasNextPage:s,fetchNextPage:l}=YWe({catalogId:e,searchTerm:n});return f.jsx(f.Fragment,{children:f.jsxs(A.ScrollArea,{onScrollToBottom:()=>s&&o(l),style:{flexGrow:1,paddingTop:A.theme.space[10],paddingBottom:A.theme.space[16],paddingInline:A.theme.space[16],display:"flex",flexDirection:"column",gap:A.theme.space[12]},threshold:252,children:[a.length===0?f.jsx(pT,{}):a.map(c=>f.jsx(wj,{item:c,catalogId:e,onClick:()=>r(c)},c.id)),f.jsx(A.AnimatedElement,{animation:{name:"fade"},children:i&&f.jsx(A.Text,{color:"grey11",align:"center",sx:{marginBlock:8},children:"Loading more results ..."})})]})})}function pT(t){const{message:e="We can't find any items matching your search"}=t,n="Oops!";return f.jsx(A.Box,{justifyContent:"center",flexDirection:"column",height:"100%",children:f.jsxs(A.BlankSlate,{children:[f.jsx(A.BlankSlateIcon,{name:"close",lineColor:"purple10",backgroundColor:"purple3",borderColor:"purple6",borderStyle:"dashed",size:"xlarge"}),f.jsx(A.BlankSlateTitle,{size:"big",children:n}),f.jsx(A.BlankSlateDescription,{width:360,children:e})]})})}function rKe(t){const{itemId:e,item:n}=t,r=Se();return e&&n&&n.id===e?f.jsx(Cd,{...t,value:n.title}):e&&r.integrationFields?f.jsx(A.ErrorBoundary,{renderError:()=>f.jsx(Cd,{...t,value:e}),children:f.jsx(I.Suspense,{fallback:f.jsx(Cd,{...t,value:e}),children:f.jsx(aKe,{...t,itemId:e})},e)},e):e&&!r.integrationFields?f.jsx(Cd,{...t,value:e}):f.jsx(Cd,{...t,value:""})}function iKe(t){const{catalogId:e,itemId:n,item:r}=t,i=Se();return n&&r&&r.id===n?f.jsx(A.FieldFooter,{children:f.jsx(wj,{catalogId:e,item:r})}):n&&i.integrationFields?f.jsx(A.ErrorBoundary,{renderError:()=>null,children:f.jsx(A.FieldFooter,{children:f.jsx(I.Suspense,{fallback:f.jsx(bd,{}),children:f.jsx(oKe,{catalogId:e,itemId:n})},n)})},n):null}function oKe(t){const{itemId:e,catalogId:n}=t,{item:r}=_J({catalogId:n,itemId:e});return f.jsx(wj,{catalogId:n,item:r})}function Cd(t){const{id:e,field:n,readOnly:r,value:i,onFocus:o,onClearItem:a}=t;return f.jsx(Jl,{id:e,placeholder:od(n),readOnly:!0,variant:"link",value:i,...!r&&{cursor:"pointer",onFocus:o},endAdornment:f.jsx(A.Button,{startIcon:"close",color:"grey",size:"small",disabled:!i,onClick:a})})}function aKe(t){const{itemId:e,catalogId:n}=t,{item:r}=_J({catalogId:n,itemId:e});return f.jsx(Cd,{...t,value:r.title})}function sKe(t){var h;const{id:e,field:n,content:r,readOnly:i,onContentChange:o}=t,[a,s]=I.useState(!1),[l,c]=I.useState(),u=(h=n.config)==null?void 0:h.catalog;if(!u)return null;function d(m){o({value:m.id,__TYPE__:"IntegrationFieldsContent"}),c(m),s(!1)}function p(){o(void 0),c(void 0)}return f.jsxs(f.Fragment,{children:[f.jsxs(A.Field,{footer:f.jsx(iKe,{catalogId:u,item:l,itemId:r==null?void 0:r.value}),children:[f.jsx(A.FieldIcon,{name:"multipleStop"}),f.jsx(A.FieldLabel,{htmlFor:e,children:Fr(n)}),f.jsx(A.FieldControl,{children:f.jsx(rKe,{id:e,field:n,readOnly:i,catalogId:u,item:l,itemId:r==null?void 0:r.value,onFocus:()=>s(!0),onClearItem:p})})]}),f.jsx(tKe,{open:a,onOpenChange:s,catalogId:u,onSelectItem:d})]})}function IJ(t){const{content:e,field:n,id:r,onContentChange:i,readOnly:o,endAdornment:a,placeholder:s}=t;return f.jsxs(A.Field,{children:[f.jsx(A.FieldIcon,{name:"notes"}),f.jsx(A.FieldLabel,{htmlFor:r,children:Fr(n)}),f.jsxs(A.FieldControl,{children:[f.jsx(A.TextArea,{id:r,placeholder:s||od(n),readOnly:o,paddingLeft:4,paddingRight:12,sx:{flexGrow:1},value:(e==null?void 0:e.value)??"",onChange:l=>{i(lKe(l))}}),a]})]})}function lKe(t){return t.length===0?void 0:{__TYPE__:"FieldContent",type:"Text",value:t}}function cKe(t){var s;const{content:e,id:n,field:r,onContentChange:i,readOnly:o}=t,a={id:n,readOnly:o,onContentChange:i};return(s=r.config)!=null&&s.repeat?f.jsx(PWe,{...a,field:r,content:DY(e)}):f.jsx(Sj,{...a,field:r,content:PY(e)})}const uKe=({content:t,field:e,id:n,onContentChange:r,readOnly:i})=>{var s,l;const o=Number(t==null?void 0:t.value),a=Number.isFinite(o)?o:void 0;return f.jsxs(A.Field,{children:[f.jsx(A.FieldIcon,{name:"pin"}),f.jsx(A.FieldLabel,{htmlFor:n,children:Fr(e)}),f.jsx(A.FieldControl,{children:f.jsx(A.NumberInput,{id:n,value:a,min:(s=e.config)==null?void 0:s.min,max:(l=e.config)==null?void 0:l.max,padding:eJ,placeholder:od(e),readOnly:i,onValueChange:c=>r(dKe(c))})})]})};function dKe(t){return t===void 0?void 0:{__TYPE__:"FieldContent",type:"Number",value:String(t)}}function kn(t){this.content=t}kn.prototype={constructor:kn,find:function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return-1},get:function(t){var e=this.find(t);return e==-1?void 0:this.content[e+1]},update:function(t,e,n){var r=n&&n!=t?this.remove(n):this,i=r.find(t),o=r.content.slice();return i==-1?o.push(n||t,e):(o[i+1]=e,n&&(o[i]=n)),new kn(o)},remove:function(t){var e=this.find(t);if(e==-1)return this;var n=this.content.slice();return n.splice(e,2),new kn(n)},addToStart:function(t,e){return new kn([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new kn(n)},addBefore:function(t,e,n){var r=this.remove(e),i=r.content.slice(),o=r.find(t);return i.splice(o==-1?i.length:o,0,e,n),new kn(i)},forEach:function(t){for(var e=0;e<this.content.length;e+=2)t(this.content[e],this.content[e+1])},prepend:function(t){return t=kn.from(t),t.size?new kn(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=kn.from(t),t.size?new kn(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=kn.from(t);for(var n=0;n<t.content.length;n+=2)e=e.remove(t.content[n]);return e},toObject:function(){var t={};return this.forEach(function(e,n){t[e]=n}),t},get size(){return this.content.length>>1}};kn.from=function(t){if(t instanceof kn)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new kn(e)};function EJ(t,e,n){for(let r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;let i=t.child(r),o=e.child(r);if(i==o){n+=i.nodeSize;continue}if(!i.sameMarkup(o))return n;if(i.isText&&i.text!=o.text){for(let a=0;i.text[a]==o.text[a];a++)n++;return n}if(i.content.size||o.content.size){let a=EJ(i.content,o.content,n+1);if(a!=null)return a}n+=i.nodeSize}}function RJ(t,e,n,r){for(let i=t.childCount,o=e.childCount;;){if(i==0||o==0)return i==o?null:{a:n,b:r};let a=t.child(--i),s=e.child(--o),l=a.nodeSize;if(a==s){n-=l,r-=l;continue}if(!a.sameMarkup(s))return{a:n,b:r};if(a.isText&&a.text!=s.text){let c=0,u=Math.min(a.text.length,s.text.length);for(;c<u&&a.text[a.text.length-c-1]==s.text[s.text.length-c-1];)c++,n--,r--;return{a:n,b:r}}if(a.content.size||s.content.size){let c=RJ(a.content,s.content,n-1,r-1);if(c)return c}n-=l,r-=l}}class B{constructor(e,n){if(this.content=e,this.size=n||0,n==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,n,r,i=0,o){for(let a=0,s=0;s<n;a++){let l=this.content[a],c=s+l.nodeSize;if(c>e&&r(l,i+s,o||null,a)!==!1&&l.content.size){let u=s+1;l.nodesBetween(Math.max(0,e-u),Math.min(l.content.size,n-u),r,i+u)}s=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,r,i){let o="",a=!0;return this.nodesBetween(e,n,(s,l)=>{let c=s.isText?s.text.slice(Math.max(e,l)-l,n-l):s.isLeaf?i?typeof i=="function"?i(s):i:s.type.spec.leafText?s.type.spec.leafText(s):"":"";s.isBlock&&(s.isLeaf&&c||s.isTextblock)&&r&&(a?a=!1:o+=r),o+=c},0),o}append(e){if(!e.size)return this;if(!this.size)return e;let n=this.lastChild,r=e.firstChild,i=this.content.slice(),o=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),o=1);o<e.content.length;o++)i.push(e.content[o]);return new B(i,this.size+e.size)}cut(e,n=this.size){if(e==0&&n==this.size)return this;let r=[],i=0;if(n>e)for(let o=0,a=0;a<n;o++){let s=this.content[o],l=a+s.nodeSize;l>e&&((a<e||l>n)&&(s.isText?s=s.cut(Math.max(0,e-a),Math.min(s.text.length,n-a)):s=s.cut(Math.max(0,e-a-1),Math.min(s.content.size,n-a-1))),r.push(s),i+=s.nodeSize),a=l}return new B(r,i)}cutByIndex(e,n){return e==n?B.empty:e==0&&n==this.content.length?this:new B(this.content.slice(e,n))}replaceChild(e,n){let r=this.content[e];if(r==n)return this;let i=this.content.slice(),o=this.size+n.nodeSize-r.nodeSize;return i[e]=n,new B(i,o)}addToStart(e){return new B([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new B(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let n=0;n<this.content.length;n++)if(!this.content[n].eq(e.content[n]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let n=this.content[e];if(!n)throw new RangeError("Index "+e+" out of range for "+this);return n}maybeChild(e){return this.content[e]||null}forEach(e){for(let n=0,r=0;n<this.content.length;n++){let i=this.content[n];e(i,r,n),r+=i.nodeSize}}findDiffStart(e,n=0){return EJ(this,e,n)}findDiffEnd(e,n=this.size,r=e.size){return RJ(this,e,n,r)}findIndex(e,n=-1){if(e==0)return cv(0,e);if(e==this.size)return cv(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let r=0,i=0;;r++){let o=this.child(r),a=i+o.nodeSize;if(a>=e)return a==e||n>0?cv(r+1,a):cv(r,i);i=a}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,n){if(!n)return B.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new B(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return B.empty;let n,r=0;for(let i=0;i<e.length;i++){let o=e[i];r+=o.nodeSize,i&&o.isText&&e[i-1].sameMarkup(o)?(n||(n=e.slice(0,i)),n[n.length-1]=o.withText(n[n.length-1].text+o.text)):n&&n.push(o)}return new B(n||e,r)}static from(e){if(!e)return B.empty;if(e instanceof B)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new B([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}B.empty=new B([],0);const Mw={index:0,offset:0};function cv(t,e){return Mw.index=t,Mw.offset=e,Mw}function wy(t,e){if(t===e)return!0;if(!(t&&typeof t=="object")||!(e&&typeof e=="object"))return!1;let n=Array.isArray(t);if(Array.isArray(e)!=n)return!1;if(n){if(t.length!=e.length)return!1;for(let r=0;r<t.length;r++)if(!wy(t[r],e[r]))return!1}else{for(let r in t)if(!(r in e)||!wy(t[r],e[r]))return!1;for(let r in e)if(!(r in t))return!1}return!0}let ct=class hT{constructor(e,n){this.type=e,this.attrs=n}addToSet(e){let n,r=!1;for(let i=0;i<e.length;i++){let o=e[i];if(this.eq(o))return e;if(this.type.excludes(o.type))n||(n=e.slice(0,i));else{if(o.type.excludes(this.type))return e;!r&&o.type.rank>this.type.rank&&(n||(n=e.slice(0,i)),n.push(this),r=!0),n&&n.push(o)}}return n||(n=e.slice()),r||n.push(this),n}removeFromSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return e.slice(0,n).concat(e.slice(n+1));return e}isInSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return!0;return!1}eq(e){return this==e||this.type==e.type&&wy(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[n.type];if(!r)throw new RangeError(`There is no mark type ${n.type} in this schema`);let i=r.create(n.attrs);return r.checkAttrs(i.attrs),i}static sameSet(e,n){if(e==n)return!0;if(e.length!=n.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(n[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return hT.none;if(e instanceof hT)return[e];let n=e.slice();return n.sort((r,i)=>r.type.rank-i.type.rank),n}};ct.none=[];class Gc extends Error{}class W{constructor(e,n,r){this.content=e,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,n){let r=$J(this.content,e+this.openStart,n);return r&&new W(r,this.openStart,this.openEnd)}removeBetween(e,n){return new W(kJ(this.content,e+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,n){if(!n)return W.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new W(B.fromJSON(e,n.content),r,i)}static maxOpen(e,n=!0){let r=0,i=0;for(let o=e.firstChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.firstChild)r++;for(let o=e.lastChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.lastChild)i++;return new W(e,r,i)}}W.empty=new W(B.empty,0,0);function kJ(t,e,n){let{index:r,offset:i}=t.findIndex(e),o=t.maybeChild(r),{index:a,offset:s}=t.findIndex(n);if(i==e||o.isText){if(s!=n&&!t.child(a).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=a)throw new RangeError("Removing non-flat range");return t.replaceChild(r,o.copy(kJ(o.content,e-i-1,n-i-1)))}function $J(t,e,n,r){let{index:i,offset:o}=t.findIndex(e),a=t.maybeChild(i);if(o==e||a.isText)return r&&!r.canReplace(i,i,n)?null:t.cut(0,e).append(n).append(t.cut(e));let s=$J(a.content,e-o-1,n);return s&&t.replaceChild(i,a.copy(s))}function fKe(t,e,n){if(n.openStart>t.depth)throw new Gc("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new Gc("Inconsistent open depths");return OJ(t,e,n,0)}function OJ(t,e,n,r){let i=t.index(r),o=t.node(r);if(i==e.index(r)&&r<t.depth-n.openStart){let a=OJ(t,e,n,r+1);return o.copy(o.content.replaceChild(i,a))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&t.depth==r&&e.depth==r){let a=t.parent,s=a.content;return Ec(a,s.cut(0,t.parentOffset).append(n.content).append(s.cut(e.parentOffset)))}else{let{start:a,end:s}=pKe(n,t);return Ec(o,FJ(t,a,s,e,r))}else return Ec(o,xy(t,e,r))}function MJ(t,e){if(!e.type.compatibleContent(t.type))throw new Gc("Cannot join "+e.type.name+" onto "+t.type.name)}function mT(t,e,n){let r=t.node(n);return MJ(r,e.node(n)),r}function Ic(t,e){let n=e.length-1;n>=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function _h(t,e,n,r){let i=(e||t).node(n),o=0,a=e?e.index(n):i.childCount;t&&(o=t.index(n),t.depth>n?o++:t.textOffset&&(Ic(t.nodeAfter,r),o++));for(let s=o;s<a;s++)Ic(i.child(s),r);e&&e.depth==n&&e.textOffset&&Ic(e.nodeBefore,r)}function Ec(t,e){return t.type.checkContent(e),t.copy(e)}function FJ(t,e,n,r,i){let o=t.depth>i&&mT(t,e,i+1),a=r.depth>i&&mT(n,r,i+1),s=[];return _h(null,t,i,s),o&&a&&e.index(i)==n.index(i)?(MJ(o,a),Ic(Ec(o,FJ(t,e,n,r,i+1)),s)):(o&&Ic(Ec(o,xy(t,e,i+1)),s),_h(e,n,i,s),a&&Ic(Ec(a,xy(n,r,i+1)),s)),_h(r,null,i,s),new B(s)}function xy(t,e,n){let r=[];if(_h(null,t,n,r),t.depth>n){let i=mT(t,e,n+1);Ic(Ec(i,xy(t,e,n+1)),r)}return _h(e,null,n,r),new B(r)}function pKe(t,e){let n=e.depth-t.openStart,i=e.node(n).copy(t.content);for(let o=n-1;o>=0;o--)i=e.node(o).copy(B.from(i));return{start:i.resolveNoCache(t.openStart+n),end:i.resolveNoCache(i.content.size-t.openEnd-n)}}class Am{constructor(e,n,r){this.pos=e,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,n=this.index(this.depth);if(n==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=e.child(n);return r?e.child(n).cut(r):i}get nodeBefore(){let e=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(e).cut(0,n):e==0?null:this.parent.child(e-1)}posAtIndex(e,n){n=this.resolveDepth(n);let r=this.path[n*3],i=n==0?0:this.path[n*3-1]+1;for(let o=0;o<e;o++)i+=r.child(o).nodeSize;return i}marks(){let e=this.parent,n=this.index();if(e.content.size==0)return ct.none;if(this.textOffset)return e.child(n).marks;let r=e.maybeChild(n-1),i=e.maybeChild(n);if(!r){let s=r;r=i,i=s}let o=r.marks;for(var a=0;a<o.length;a++)o[a].type.spec.inclusive===!1&&(!i||!o[a].isInSet(i.marks))&&(o=o[a--].removeFromSet(o));return o}marksAcross(e){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let r=n.marks,i=e.parent.maybeChild(e.index());for(var o=0;o<r.length;o++)r[o].type.spec.inclusive===!1&&(!i||!r[o].isInSet(i.marks))&&(r=r[o--].removeFromSet(r));return r}sharedDepth(e){for(let n=this.depth;n>0;n--)if(this.start(n)<=e&&this.end(n)>=e)return n;return 0}blockRange(e=this,n){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!n||n(this.node(r))))return new Ty(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let n=1;n<=this.depth;n++)e+=(e?"/":"")+this.node(n).type.name+"_"+this.index(n-1);return e+":"+this.parentOffset}static resolve(e,n){if(!(n>=0&&n<=e.content.size))throw new RangeError("Position "+n+" out of range");let r=[],i=0,o=n;for(let a=e;;){let{index:s,offset:l}=a.content.findIndex(o),c=o-l;if(r.push(a,s,i+l),!c||(a=a.child(s),a.isText))break;o=c-1,i+=l+1}return new Am(n,r,o)}static resolveCached(e,n){let r=v2.get(e);if(r)for(let o=0;o<r.elts.length;o++){let a=r.elts[o];if(a.pos==n)return a}else v2.set(e,r=new hKe);let i=r.elts[r.i]=Am.resolve(e,n);return r.i=(r.i+1)%mKe,i}}class hKe{constructor(){this.elts=[],this.i=0}}const mKe=12,v2=new WeakMap;class Ty{constructor(e,n,r){this.$from=e,this.$to=n,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const AKe=Object.create(null);let Xs=class AT{constructor(e,n,r,i=ct.none){this.type=e,this.attrs=n,this.marks=i,this.content=r||B.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,n,r,i=0){this.content.nodesBetween(e,n,r,i,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,n,r,i){return this.content.textBetween(e,n,r,i)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,n,r){return this.type==e&&wy(this.attrs,n||e.defaultAttrs||AKe)&&ct.sameSet(this.marks,r||ct.none)}copy(e=null){return e==this.content?this:new AT(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new AT(this.type,this.attrs,this.content,e)}cut(e,n=this.content.size){return e==0&&n==this.content.size?this:this.copy(this.content.cut(e,n))}slice(e,n=this.content.size,r=!1){if(e==n)return W.empty;let i=this.resolve(e),o=this.resolve(n),a=r?0:i.sharedDepth(n),s=i.start(a),c=i.node(a).content.cut(i.pos-s,o.pos-s);return new W(c,i.depth-a,o.depth-a)}replace(e,n,r){return fKe(this.resolve(e),this.resolve(n),r)}nodeAt(e){for(let n=this;;){let{index:r,offset:i}=n.content.findIndex(e);if(n=n.maybeChild(r),!n)return null;if(i==e||n.isText)return n;e-=i+1}}childAfter(e){let{index:n,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(n),index:n,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:n,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(n),index:n,offset:r};let i=this.content.child(n-1);return{node:i,index:n-1,offset:r-i.nodeSize}}resolve(e){return Am.resolveCached(this,e)}resolveNoCache(e){return Am.resolve(this,e)}rangeHasMark(e,n,r){let i=!1;return n>e&&this.nodesBetween(e,n,o=>(r.isInSet(o.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),jJ(this.marks,e)}contentMatchAt(e){let n=this.type.contentMatch.matchFragment(this.content,0,e);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(e,n,r=B.empty,i=0,o=r.childCount){let a=this.contentMatchAt(e).matchFragment(r,i,o),s=a&&a.matchFragment(this.content,n);if(!s||!s.validEnd)return!1;for(let l=i;l<o;l++)if(!this.type.allowsMarks(r.child(l).marks))return!1;return!0}canReplaceWith(e,n,r,i){if(i&&!this.type.allowsMarks(i))return!1;let o=this.contentMatchAt(e).matchType(r),a=o&&o.matchFragment(this.content,n);return a?a.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=ct.none;for(let n=0;n<this.marks.length;n++){let r=this.marks[n];r.type.checkAttrs(r.attrs),e=r.addToSet(e)}if(!ct.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(n=>n.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(n=>n.toJSON())),e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(e.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(n.text,r)}let i=B.fromJSON(e,n.content),o=e.nodeType(n.type).create(n.attrs,i,r);return o.type.checkAttrs(o.attrs),o}};Xs.prototype.text=void 0;class _y extends Xs{constructor(e,n,r,i){if(super(e,n,null,i),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):jJ(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,n){return this.text.slice(e,n)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new _y(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new _y(this.type,this.attrs,e,this.marks)}cut(e=0,n=this.text.length){return e==0&&n==this.text.length?this:this.withText(this.text.slice(e,n))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function jJ(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class Jc{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new gKe(e,n);if(r.next==null)return Jc.empty;let i=LJ(r);r.next&&r.err("Unexpected trailing text");let o=xKe(wKe(i));return TKe(o,r),o}matchType(e){for(let n=0;n<this.next.length;n++)if(this.next[n].type==e)return this.next[n].next;return null}matchFragment(e,n=0,r=e.childCount){let i=this;for(let o=n;i&&o<r;o++)i=i.matchType(e.child(o).type);return i}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:n}=this.next[e];if(!(n.isText||n.hasRequiredAttrs()))return n}return null}compatible(e){for(let n=0;n<this.next.length;n++)for(let r=0;r<e.next.length;r++)if(this.next[n].type==e.next[r].type)return!0;return!1}fillBefore(e,n=!1,r=0){let i=[this];function o(a,s){let l=a.matchFragment(e,r);if(l&&(!n||l.validEnd))return B.from(s.map(c=>c.createAndFill()));for(let c=0;c<a.next.length;c++){let{type:u,next:d}=a.next[c];if(!(u.isText||u.hasRequiredAttrs())&&i.indexOf(d)==-1){i.push(d);let p=o(d,s.concat(u));if(p)return p}}return null}return o(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let n=this.computeWrapping(e);return this.wrapCache.push(e,n),n}computeWrapping(e){let n=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let i=r.shift(),o=i.match;if(o.matchType(e)){let a=[];for(let s=i;s.type;s=s.via)a.push(s.type);return a.reverse()}for(let a=0;a<o.next.length;a++){let{type:s,next:l}=o.next[a];!s.isLeaf&&!s.hasRequiredAttrs()&&!(s.name in n)&&(!i.type||l.validEnd)&&(r.push({match:s.contentMatch,type:s,via:i}),n[s.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function n(r){e.push(r);for(let i=0;i<r.next.length;i++)e.indexOf(r.next[i].next)==-1&&n(r.next[i].next)}return n(this),e.map((r,i)=>{let o=i+(r.validEnd?"*":" ")+" ";for(let a=0;a<r.next.length;a++)o+=(a?", ":"")+r.next[a].type.name+"->"+e.indexOf(r.next[a].next);return o}).join(`
70
70
  `)}}Jc.empty=new Jc(!0);class gKe{constructor(e,n){this.string=e,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function LJ(t){let e=[];do e.push(vKe(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function vKe(t){let e=[];do e.push(yKe(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function yKe(t){let e=SKe(t);for(;;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else if(t.eat("{"))e=bKe(t,e);else break;return e}function y2(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function bKe(t,e){let n=y2(t),r=n;return t.eat(",")&&(t.next!="}"?r=y2(t):r=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function CKe(t,e){let n=t.nodeTypes,r=n[e];if(r)return[r];let i=[];for(let o in n){let a=n[o];a.isInGroup(e)&&i.push(a)}return i.length==0&&t.err("No node type or group '"+e+"' found"),i}function SKe(t){if(t.eat("(")){let e=LJ(t);return t.eat(")")||t.err("Missing closing paren"),e}else if(/\W/.test(t.next))t.err("Unexpected token '"+t.next+"'");else{let e=CKe(t,t.next).map(n=>(t.inline==null?t.inline=n.isInline:t.inline!=n.isInline&&t.err("Mixing inline and block content"),{type:"name",value:n}));return t.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function wKe(t){let e=[[]];return i(o(t,0),n()),e;function n(){return e.push([])-1}function r(a,s,l){let c={term:l,to:s};return e[a].push(c),c}function i(a,s){a.forEach(l=>l.to=s)}function o(a,s){if(a.type=="choice")return a.exprs.reduce((l,c)=>l.concat(o(c,s)),[]);if(a.type=="seq")for(let l=0;;l++){let c=o(a.exprs[l],s);if(l==a.exprs.length-1)return c;i(c,s=n())}else if(a.type=="star"){let l=n();return r(s,l),i(o(a.expr,l),l),[r(l)]}else if(a.type=="plus"){let l=n();return i(o(a.expr,s),l),i(o(a.expr,l),l),[r(l)]}else{if(a.type=="opt")return[r(s)].concat(o(a.expr,s));if(a.type=="range"){let l=s;for(let c=0;c<a.min;c++){let u=n();i(o(a.expr,l),u),l=u}if(a.max==-1)i(o(a.expr,l),l);else for(let c=a.min;c<a.max;c++){let u=n();r(l,u),i(o(a.expr,l),u),l=u}return[r(l)]}else{if(a.type=="name")return[r(s,void 0,a.value)];throw new Error("Unknown expr type")}}}}function DJ(t,e){return e-t}function b2(t,e){let n=[];return r(e),n.sort(DJ);function r(i){let o=t[i];if(o.length==1&&!o[0].term)return r(o[0].to);n.push(i);for(let a=0;a<o.length;a++){let{term:s,to:l}=o[a];!s&&n.indexOf(l)==-1&&r(l)}}}function xKe(t){let e=Object.create(null);return n(b2(t,0));function n(r){let i=[];r.forEach(a=>{t[a].forEach(({term:s,to:l})=>{if(!s)return;let c;for(let u=0;u<i.length;u++)i[u][0]==s&&(c=i[u][1]);b2(t,l).forEach(u=>{c||i.push([s,c=[]]),c.indexOf(u)==-1&&c.push(u)})})});let o=e[r.join(",")]=new Jc(r.indexOf(t.length-1)>-1);for(let a=0;a<i.length;a++){let s=i[a][1].sort(DJ);o.next.push({type:i[a][0],next:e[s.join(",")]||n(s)})}return o}}function TKe(t,e){for(let n=0,r=[t];n<r.length;n++){let i=r[n],o=!i.validEnd,a=[];for(let s=0;s<i.next.length;s++){let{type:l,next:c}=i.next[s];a.push(l.name),o&&!(l.isText||l.hasRequiredAttrs())&&(o=!1),r.indexOf(c)==-1&&r.push(c)}o&&e.err("Only non-generatable nodes ("+a.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function PJ(t){let e=Object.create(null);for(let n in t){let r=t[n];if(!r.hasDefault)return null;e[n]=r.default}return e}function BJ(t,e){let n=Object.create(null);for(let r in t){let i=e&&e[r];if(i===void 0){let o=t[r];if(o.hasDefault)i=o.default;else throw new RangeError("No value supplied for attribute "+r)}n[r]=i}return n}function UJ(t,e,n,r){for(let i in e)if(!(i in t))throw new RangeError(`Unsupported attribute ${i} for ${n} of type ${i}`);for(let i in t){let o=t[i];o.validate&&o.validate(e[i])}}function NJ(t,e){let n=Object.create(null);if(e)for(let r in e)n[r]=new IKe(t,r,e[r]);return n}let C2=class WJ{constructor(e,n,r){this.name=e,this.schema=n,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=NJ(e,r.attrs),this.defaultAttrs=PJ(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==Jc.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:BJ(this.attrs,e)}create(e=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Xs(this,this.computeAttrs(e),B.from(n),ct.setFrom(r))}createChecked(e=null,n,r){return n=B.from(n),this.checkContent(n),new Xs(this,this.computeAttrs(e),n,ct.setFrom(r))}createAndFill(e=null,n,r){if(e=this.computeAttrs(e),n=B.from(n),n.size){let a=this.contentMatch.fillBefore(n);if(!a)return null;n=a.append(n)}let i=this.contentMatch.matchFragment(n),o=i&&i.fillBefore(B.empty,!0);return o?new Xs(this,e,n.append(o),ct.setFrom(r)):null}validContent(e){let n=this.contentMatch.matchFragment(e);if(!n||!n.validEnd)return!1;for(let r=0;r<e.childCount;r++)if(!this.allowsMarks(e.child(r).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){UJ(this.attrs,e,"node",this.name)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let n=0;n<e.length;n++)if(!this.allowsMarkType(e[n].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let n;for(let r=0;r<e.length;r++)this.allowsMarkType(e[r].type)?n&&n.push(e[r]):n||(n=e.slice(0,r));return n?n.length?n:ct.none:e}static compile(e,n){let r=Object.create(null);e.forEach((o,a)=>r[o]=new WJ(o,n,a));let i=n.spec.topNode||"doc";if(!r[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let o in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};function _Ke(t,e,n){let r=n.split("|");return i=>{let o=i===null?"null":typeof i;if(r.indexOf(o)<0)throw new RangeError(`Expected value of type ${r} for attribute ${e} on type ${t}, got ${o}`)}}class IKe{constructor(e,n,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?_Ke(e,n,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class Mg{constructor(e,n,r,i){this.name=e,this.rank=n,this.schema=r,this.spec=i,this.attrs=NJ(e,i.attrs),this.excluded=null;let o=PJ(this.attrs);this.instance=o?new ct(this,o):null}create(e=null){return!e&&this.instance?this.instance:new ct(this,BJ(this.attrs,e))}static compile(e,n){let r=Object.create(null),i=0;return e.forEach((o,a)=>r[o]=new Mg(o,i++,n,a)),r}removeFromSet(e){for(var n=0;n<e.length;n++)e[n].type==this&&(e=e.slice(0,n).concat(e.slice(n+1)),n--);return e}isInSet(e){for(let n=0;n<e.length;n++)if(e[n].type==this)return e[n]}checkAttrs(e){UJ(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class KJ{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let i in e)n[i]=e[i];n.nodes=kn.from(e.nodes),n.marks=kn.from(e.marks||{}),this.nodes=C2.compile(this.spec.nodes,this),this.marks=Mg.compile(this.spec.marks,this);let r=Object.create(null);for(let i in this.nodes){if(i in this.marks)throw new RangeError(i+" can not be both a node and a mark");let o=this.nodes[i],a=o.spec.content||"",s=o.spec.marks;if(o.contentMatch=r[a]||(r[a]=Jc.parse(a,this.nodes)),o.inlineContent=o.contentMatch.inlineContent,o.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!o.isInline||!o.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=o}o.markSet=s=="_"?null:s?S2(this,s.split(" ")):s==""||!o.inlineContent?[]:null}for(let i in this.marks){let o=this.marks[i],a=o.spec.excludes;o.excluded=a==null?[o]:a==""?[]:S2(this,a.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,n=null,r,i){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof C2){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(n,r,i)}text(e,n){let r=this.nodes.text;return new _y(r,r.defaultAttrs,e,ct.setFrom(n))}mark(e,n){return typeof e=="string"&&(e=this.marks[e]),e.create(n)}nodeFromJSON(e){return Xs.fromJSON(this,e)}markFromJSON(e){return ct.fromJSON(this,e)}nodeType(e){let n=this.nodes[e];if(!n)throw new RangeError("Unknown node type: "+e);return n}}function S2(t,e){let n=[];for(let r=0;r<e.length;r++){let i=e[r],o=t.marks[i],a=o;if(o)n.push(o);else for(let s in t.marks){let l=t.marks[s];(i=="_"||l.spec.group&&l.spec.group.split(" ").indexOf(i)>-1)&&n.push(a=l)}if(!a)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}function EKe(t){return t.tag!=null}function RKe(t){return t.style!=null}class el{constructor(e,n){this.schema=e,this.rules=n,this.tags=[],this.styles=[];let r=this.matchedStyles=[];n.forEach(i=>{if(EKe(i))this.tags.push(i);else if(RKe(i)){let o=/[^=]*/.exec(i.style)[0];r.indexOf(o)<0&&r.push(o),this.styles.push(i)}}),this.normalizeLists=!this.tags.some(i=>{if(!/^(ul|ol)\b/.test(i.tag)||!i.node)return!1;let o=e.nodes[i.node];return o.contentMatch.matchType(o)})}parse(e,n={}){let r=new x2(this,n,!1);return r.addAll(e,ct.none,n.from,n.to),r.finish()}parseSlice(e,n={}){let r=new x2(this,n,!0);return r.addAll(e,ct.none,n.from,n.to),W.maxOpen(r.finish())}matchTag(e,n,r){for(let i=r?this.tags.indexOf(r)+1:0;i<this.tags.length;i++){let o=this.tags[i];if(OKe(e,o.tag)&&(o.namespace===void 0||e.namespaceURI==o.namespace)&&(!o.context||n.matchesContext(o.context))){if(o.getAttrs){let a=o.getAttrs(e);if(a===!1)continue;o.attrs=a||void 0}return o}}}matchStyle(e,n,r,i){for(let o=i?this.styles.indexOf(i)+1:0;o<this.styles.length;o++){let a=this.styles[o],s=a.style;if(!(s.indexOf(e)!=0||a.context&&!r.matchesContext(a.context)||s.length>e.length&&(s.charCodeAt(e.length)!=61||s.slice(e.length+1)!=n))){if(a.getAttrs){let l=a.getAttrs(n);if(l===!1)continue;a.attrs=l||void 0}return a}}}static schemaRules(e){let n=[];function r(i){let o=i.priority==null?50:i.priority,a=0;for(;a<n.length;a++){let s=n[a];if((s.priority==null?50:s.priority)<o)break}n.splice(a,0,i)}for(let i in e.marks){let o=e.marks[i].spec.parseDOM;o&&o.forEach(a=>{r(a=T2(a)),a.mark||a.ignore||a.clearMark||(a.mark=i)})}for(let i in e.nodes){let o=e.nodes[i].spec.parseDOM;o&&o.forEach(a=>{r(a=T2(a)),a.node||a.ignore||a.mark||(a.node=i)})}return n}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new el(e,el.schemaRules(e)))}}const qJ={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},kKe={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},VJ={ol:!0,ul:!0},gm=1,gT=2,Ih=4;function w2(t,e,n){return e!=null?(e?gm:0)|(e==="full"?gT:0):t&&t.whitespace=="pre"?gm|gT:n&~Ih}class uv{constructor(e,n,r,i,o,a){this.type=e,this.attrs=n,this.marks=r,this.solid=i,this.options=a,this.content=[],this.activeMarks=ct.none,this.match=o||(a&Ih?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(B.from(e));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let r=this.type.contentMatch,i;return(i=r.findWrapping(e.type))?(this.match=r,i):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&gm)){let r=this.content[this.content.length-1],i;if(r&&r.isText&&(i=/[ \t\r\n\u000c]+$/.exec(r.text))){let o=r;r.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=o.withText(o.text.slice(0,o.text.length-i[0].length))}}let n=B.from(this.content);return!e&&this.match&&(n=n.append(this.match.fillBefore(B.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!qJ.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class x2{constructor(e,n,r){this.parser=e,this.options=n,this.isOpen=r,this.open=0,this.localPreserveWS=!1;let i=n.topNode,o,a=w2(null,n.preserveWhitespace,0)|(r?Ih:0);i?o=new uv(i.type,i.attrs,ct.none,!0,n.topMatch||i.type.contentMatch,a):r?o=new uv(null,null,ct.none,!0,null,a):o=new uv(e.schema.topNodeType,null,ct.none,!0,null,a),this.nodes=[o],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,n){e.nodeType==3?this.addTextNode(e,n):e.nodeType==1&&this.addElement(e,n)}addTextNode(e,n){let r=e.nodeValue,i=this.top,o=i.options&gT?"full":this.localPreserveWS||(i.options&gm)>0;if(o==="full"||i.inlineContext(e)||/[^ \t\r\n\u000c]/.test(r)){if(o)o!=="full"?r=r.replace(/\r?\n|\r/g," "):r=r.replace(/\r\n?/g,`
71
71
  `);else if(r=r.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(r)&&this.open==this.nodes.length-1){let a=i.content[i.content.length-1],s=e.previousSibling;(!a||s&&s.nodeName=="BR"||a.isText&&/[ \t\r\n\u000c]$/.test(a.text))&&(r=r.slice(1))}r&&this.insertNode(this.parser.schema.text(r),n),this.findInText(e)}else this.findInside(e)}addElement(e,n,r){let i=this.localPreserveWS,o=this.top;(e.tagName=="PRE"||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let a=e.nodeName.toLowerCase(),s;VJ.hasOwnProperty(a)&&this.parser.normalizeLists&&$Ke(e);let l=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(s=this.parser.matchTag(e,this,r));e:if(l?l.ignore:kKe.hasOwnProperty(a))this.findInside(e),this.ignoreFallback(e,n);else if(!l||l.skip||l.closeParent){l&&l.closeParent?this.open=Math.max(0,this.open-1):l&&l.skip.nodeType&&(e=l.skip);let c,u=this.needsBlock;if(qJ.hasOwnProperty(a))o.content.length&&o.content[0].isInline&&this.open&&(this.open--,o=this.top),c=!0,o.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,n);break e}let d=l&&l.skip?n:this.readStyles(e,n);d&&this.addAll(e,d),c&&this.sync(o),this.needsBlock=u}else{let c=this.readStyles(e,n);c&&this.addElementByRule(e,l,c,l.consuming===!1?s:void 0)}this.localPreserveWS=i}leafFallback(e,n){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
72
72
  `),n)}ignoreFallback(e,n){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),n)}readStyles(e,n){let r=e.style;if(r&&r.length)for(let i=0;i<this.parser.matchedStyles.length;i++){let o=this.parser.matchedStyles[i],a=r.getPropertyValue(o);if(a)for(let s=void 0;;){let l=this.parser.matchStyle(o,a,this,s);if(!l)break;if(l.ignore)return null;if(l.clearMark?n=n.filter(c=>!l.clearMark(c)):n=n.concat(this.parser.schema.marks[l.mark].create(l.attrs)),l.consuming===!1)s=l;else break}}return n}addElementByRule(e,n,r,i){let o,a;if(n.node)if(a=this.parser.schema.nodes[n.node],a.isLeaf)this.insertNode(a.create(n.attrs),r)||this.leafFallback(e,r);else{let l=this.enter(a,n.attrs||null,r,n.preserveWhitespace);l&&(o=!0,r=l)}else{let l=this.parser.schema.marks[n.mark];r=r.concat(l.create(n.attrs))}let s=this.top;if(a&&a.isLeaf)this.findInside(e);else if(i)this.addElement(e,r,i);else if(n.getContent)this.findInside(e),n.getContent(e,this.parser.schema).forEach(l=>this.insertNode(l,r));else{let l=e;typeof n.contentElement=="string"?l=e.querySelector(n.contentElement):typeof n.contentElement=="function"?l=n.contentElement(e):n.contentElement&&(l=n.contentElement),this.findAround(e,l,!0),this.addAll(l,r),this.findAround(e,l,!1)}o&&this.sync(s)&&this.open--}addAll(e,n,r,i){let o=r||0;for(let a=r?e.childNodes[r]:e.firstChild,s=i==null?null:e.childNodes[i];a!=s;a=a.nextSibling,++o)this.findAtPoint(e,o),this.addDOM(a,n);this.findAtPoint(e,o)}findPlace(e,n){let r,i;for(let o=this.open;o>=0;o--){let a=this.nodes[o],s=a.findWrapping(e);if(s&&(!r||r.length>s.length)&&(r=s,i=a,!s.length)||a.solid)break}if(!r)return null;this.sync(i);for(let o=0;o<r.length;o++)n=this.enterInner(r[o],null,n,!1);return n}insertNode(e,n){if(e.isInline&&this.needsBlock&&!this.top.type){let i=this.textblockFromContext();i&&(n=this.enterInner(i,null,n))}let r=this.findPlace(e,n);if(r){this.closeExtra();let i=this.top;i.match&&(i.match=i.match.matchType(e.type));let o=ct.none;for(let a of r.concat(e.marks))(i.type?i.type.allowsMarkType(a.type):_2(a.type,e.type))&&(o=a.addToSet(o));return i.content.push(e.mark(o)),!0}return!1}enter(e,n,r,i){let o=this.findPlace(e.create(n),r);return o&&(o=this.enterInner(e,n,r,!0,i)),o}enterInner(e,n,r,i=!1,o){this.closeExtra();let a=this.top;a.match=a.match&&a.match.matchType(e);let s=w2(e,o,a.options);a.options&Ih&&a.content.length==0&&(s|=Ih);let l=ct.none;return r=r.filter(c=>(a.type?a.type.allowsMarkType(c.type):_2(c.type,e))?(l=c.addToSet(l),!1):!0),this.nodes.push(new uv(e,n,l,i,null,s)),this.open++,r}closeExtra(e=!1){let n=this.nodes.length-1;if(n>this.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let n=this.open;n>=0;n--){if(this.nodes[n]==e)return this.open=n,!0;this.localPreserveWS&&(this.nodes[n].options|=gm)}return!1}get currentPos(){this.closeExtra();let e=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let i=r.length-1;i>=0;i--)e+=r[i].nodeSize;n&&e++}return e}findAtPoint(e,n){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==e&&this.find[r].offset==n&&(this.find[r].pos=this.currentPos)}findInside(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].pos==null&&e.nodeType==1&&e.contains(this.find[n].node)&&(this.find[n].pos=this.currentPos)}findAround(e,n,r){if(e!=n&&this.find)for(let i=0;i<this.find.length;i++)this.find[i].pos==null&&e.nodeType==1&&e.contains(this.find[i].node)&&n.compareDocumentPosition(this.find[i].node)&(r?2:4)&&(this.find[i].pos=this.currentPos)}findInText(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&(this.find[n].pos=this.currentPos-(e.nodeValue.length-this.find[n].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let n=e.split("/"),r=this.options.context,i=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),o=-(r?r.depth+1:0)+(i?0:1),a=(s,l)=>{for(;s>=0;s--){let c=n[s];if(c==""){if(s==n.length-1||s==0)continue;for(;l>=o;l--)if(a(s-1,l))return!0;return!1}else{let u=l>0||l==0&&i?this.nodes[l].type:r&&l>=o?r.node(l-o).type:null;if(!u||u.name!=c&&!u.isInGroup(c))return!1;l--}}return!0};return a(n.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let n=e.depth;n>=0;n--){let r=e.node(n).contentMatchAt(e.indexAfter(n)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let n in this.parser.schema.nodes){let r=this.parser.schema.nodes[n];if(r.isTextblock&&r.defaultAttrs)return r}}}function $Ke(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&VJ.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):r=="li"?n=e:r&&(n=null)}}function OKe(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function T2(t){let e={};for(let n in t)e[n]=t[n];return e}function _2(t,e){let n=e.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(t))continue;let o=[],a=s=>{o.push(s);for(let l=0;l<s.edgeCount;l++){let{type:c,next:u}=s.edge(l);if(c==e||o.indexOf(u)<0&&a(u))return!0}};if(a(i.contentMatch))return!0}}class ad{constructor(e,n){this.nodes=e,this.marks=n}serializeFragment(e,n={},r){r||(r=Fw(n).createDocumentFragment());let i=r,o=[];return e.forEach(a=>{if(o.length||a.marks.length){let s=0,l=0;for(;s<o.length&&l<a.marks.length;){let c=a.marks[l];if(!this.marks[c.type.name]){l++;continue}if(!c.eq(o[s][0])||c.type.spec.spanning===!1)break;s++,l++}for(;s<o.length;)i=o.pop()[1];for(;l<a.marks.length;){let c=a.marks[l++],u=this.serializeMark(c,a.isInline,n);u&&(o.push([c,i]),i.appendChild(u.dom),i=u.contentDOM||u.dom)}}i.appendChild(this.serializeNodeInner(a,n))}),r}serializeNodeInner(e,n){let{dom:r,contentDOM:i}=Ev(Fw(n),this.nodes[e.type.name](e),null,e.attrs);if(i){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,n,i)}return r}serializeNode(e,n={}){let r=this.serializeNodeInner(e,n);for(let i=e.marks.length-1;i>=0;i--){let o=this.serializeMark(e.marks[i],e.isInline,n);o&&((o.contentDOM||o.dom).appendChild(r),r=o.dom)}return r}serializeMark(e,n,r={}){let i=this.marks[e.type.name];return i&&Ev(Fw(r),i(e,n),null,e.attrs)}static renderSpec(e,n,r=null,i){return Ev(e,n,r,i)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new ad(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let n=I2(e.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(e){return I2(e.marks)}}function I2(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function Fw(t){return t.document||window.document}const E2=new WeakMap;function MKe(t){let e=E2.get(t);return e===void 0&&E2.set(t,e=FKe(t)),e}function FKe(t){let e=null;function n(r){if(r&&typeof r=="object")if(Array.isArray(r))if(typeof r[0]=="string")e||(e=[]),e.push(r);else for(let i=0;i<r.length;i++)n(r[i]);else for(let i in r)n(r[i])}return n(t),e}function Ev(t,e,n,r){if(typeof e=="string")return{dom:t.createTextNode(e)};if(e.nodeType!=null)return{dom:e};if(e.dom&&e.dom.nodeType!=null)return e;let i=e[0],o;if(typeof i!="string")throw new RangeError("Invalid array passed to renderSpec");if(r&&(o=MKe(r))&&o.indexOf(e)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let a=i.indexOf(" ");a>0&&(n=i.slice(0,a),i=i.slice(a+1));let s,l=n?t.createElementNS(n,i):t.createElement(i),c=e[1],u=1;if(c&&typeof c=="object"&&c.nodeType==null&&!Array.isArray(c)){u=2;for(let d in c)if(c[d]!=null){let p=d.indexOf(" ");p>0?l.setAttributeNS(d.slice(0,p),d.slice(p+1),c[d]):l.setAttribute(d,c[d])}}for(let d=u;d<e.length;d++){let p=e[d];if(p===0){if(d<e.length-1||d>u)throw new RangeError("Content hole must be the only child of its parent node");return{dom:l,contentDOM:l}}else{let{dom:h,contentDOM:m}=Ev(t,p,n,r);if(l.appendChild(h),m){if(s)throw new RangeError("Multiple content holes");s=m}}}return{dom:l,contentDOM:s}}const zJ=65535,QJ=Math.pow(2,16);function jKe(t,e){return t+e*QJ}function R2(t){return t&zJ}function LKe(t){return(t-(t&zJ))/QJ}const HJ=1,YJ=2,Rv=4,GJ=8;let vT=class{constructor(e,n,r){this.pos=e,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&GJ)>0}get deletedBefore(){return(this.delInfo&(HJ|Rv))>0}get deletedAfter(){return(this.delInfo&(YJ|Rv))>0}get deletedAcross(){return(this.delInfo&Rv)>0}},of=class Sd{constructor(e,n=!1){if(this.ranges=e,this.inverted=n,!e.length&&Sd.empty)return Sd.empty}recover(e){let n=0,r=R2(e);if(!this.inverted)for(let i=0;i<r;i++)n+=this.ranges[i*3+2]-this.ranges[i*3+1];return this.ranges[r*3]+n+LKe(e)}mapResult(e,n=1){return this._map(e,n,!1)}map(e,n=1){return this._map(e,n,!0)}_map(e,n,r){let i=0,o=this.inverted?2:1,a=this.inverted?1:2;for(let s=0;s<this.ranges.length;s+=3){let l=this.ranges[s]-(this.inverted?i:0);if(l>e)break;let c=this.ranges[s+o],u=this.ranges[s+a],d=l+c;if(e<=d){let p=c?e==l?-1:e==d?1:n:n,h=l+i+(p<0?0:u);if(r)return h;let m=e==(n<0?l:d)?null:jKe(s/3,e-l),g=e==l?YJ:e==d?HJ:Rv;return(n<0?e!=l:e!=d)&&(g|=GJ),new vT(h,g,m)}i+=u-c}return r?e+i:new vT(e+i,0,null)}touches(e,n){let r=0,i=R2(n),o=this.inverted?2:1,a=this.inverted?1:2;for(let s=0;s<this.ranges.length;s+=3){let l=this.ranges[s]-(this.inverted?r:0);if(l>e)break;let c=this.ranges[s+o],u=l+c;if(e<=u&&s==i*3)return!0;r+=this.ranges[s+a]-c}return!1}forEach(e){let n=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,o=0;i<this.ranges.length;i+=3){let a=this.ranges[i],s=a-(this.inverted?o:0),l=a+(this.inverted?0:o),c=this.ranges[i+n],u=this.ranges[i+r];e(s,s+c,l,l+u),o+=u-c}}invert(){return new Sd(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?Sd.empty:new Sd(e<0?[0,-e,0]:[0,0,e])}};of.empty=new of([]);let JJ=class kv{constructor(e=[],n,r=0,i=e.length){this.maps=e,this.mirror=n,this.from=r,this.to=i}slice(e=0,n=this.maps.length){return new kv(this.maps,this.mirror,e,n)}copy(){return new kv(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)}appendMap(e,n){this.to=this.maps.push(e),n!=null&&this.setMirror(this.maps.length-1,n)}appendMapping(e){for(let n=0,r=this.maps.length;n<e.maps.length;n++){let i=e.getMirror(n);this.appendMap(e.maps[n],i!=null&&i<n?r+i:void 0)}}getMirror(e){if(this.mirror){for(let n=0;n<this.mirror.length;n++)if(this.mirror[n]==e)return this.mirror[n+(n%2?-1:1)]}}setMirror(e,n){this.mirror||(this.mirror=[]),this.mirror.push(e,n)}appendMappingInverted(e){for(let n=e.maps.length-1,r=this.maps.length+e.maps.length;n>=0;n--){let i=e.getMirror(n);this.appendMap(e.maps[n].invert(),i!=null&&i>n?r-i-1:void 0)}}invert(){let e=new kv;return e.appendMappingInverted(this),e}map(e,n=1){if(this.mirror)return this._map(e,n,!0);for(let r=this.from;r<this.to;r++)e=this.maps[r].map(e,n);return e}mapResult(e,n=1){return this._map(e,n,!1)}_map(e,n,r){let i=0;for(let o=this.from;o<this.to;o++){let a=this.maps[o],s=a.mapResult(e,n);if(s.recover!=null){let l=this.getMirror(o);if(l!=null&&l>o&&l<this.to){o=l,e=this.maps[l].recover(s.recover);continue}}i|=s.delInfo,e=s.pos}return r?e:new vT(e,i,null)}};const jw=Object.create(null);let ri=class{getMap(){return of.empty}merge(e){return null}static fromJSON(e,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=jw[n.stepType];if(!r)throw new RangeError(`No step type ${n.stepType} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in jw)throw new RangeError("Duplicate use of step JSON ID "+e);return jw[e]=n,n.prototype.jsonID=e,n}},Nr=class oh{constructor(e,n){this.doc=e,this.failed=n}static ok(e){return new oh(e,null)}static fail(e){return new oh(null,e)}static fromReplace(e,n,r,i){try{return oh.ok(e.replace(n,r,i))}catch(o){if(o instanceof Gc)return oh.fail(o.message);throw o}}};function xj(t,e,n){let r=[];for(let i=0;i<t.childCount;i++){let o=t.child(i);o.content.size&&(o=o.copy(xj(o.content,e,o))),o.isInline&&(o=e(o,n,i)),r.push(o)}return B.fromArray(r)}let Tj=class ah extends ri{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=e.resolve(this.from),i=r.node(r.sharedDepth(this.to)),o=new W(xj(n.content,(a,s)=>!a.isAtom||!s.type.allowsMarkType(this.mark.type)?a:a.mark(this.mark.addToSet(a.marks)),i),n.openStart,n.openEnd);return Nr.fromReplace(e,this.from,this.to,o)}invert(){return new Fg(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new ah(n.pos,r.pos,this.mark)}merge(e){return e instanceof ah&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new ah(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new ah(n.from,n.to,e.markFromJSON(n.mark))}};ri.jsonID("addMark",Tj);let Fg=class sh extends ri{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=new W(xj(n.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),n.openStart,n.openEnd);return Nr.fromReplace(e,this.from,this.to,r)}invert(){return new Tj(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new sh(n.pos,r.pos,this.mark)}merge(e){return e instanceof sh&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new sh(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new sh(n.from,n.to,e.markFromJSON(n.mark))}};ri.jsonID("removeMark",Fg);let _j=class lh extends ri{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return Nr.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return Nr.fromReplace(e,this.pos,this.pos+1,new W(B.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);if(n){let r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(let i=0;i<n.marks.length;i++)if(!n.marks[i].isInSet(r))return new lh(this.pos,n.marks[i]);return new lh(this.pos,this.mark)}}return new Ij(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new lh(n.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new lh(n.pos,e.markFromJSON(n.mark))}};ri.jsonID("addNodeMark",_j);let Ij=class yT extends ri{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return Nr.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return Nr.fromReplace(e,this.pos,this.pos+1,new W(B.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new _j(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new yT(n.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new yT(n.pos,e.markFromJSON(n.mark))}};ri.jsonID("removeNodeMark",Ij);let Zl=class lc extends ri{constructor(e,n,r,i=!1){super(),this.from=e,this.to=n,this.slice=r,this.structure=i}apply(e){return this.structure&&bT(e,this.from,this.to)?Nr.fail("Structure replace would overwrite content"):Nr.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new of([this.from,this.to-this.from,this.slice.size])}invert(e){return new lc(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deletedAcross&&r.deletedAcross?null:new lc(n.pos,Math.max(n.pos,r.pos),this.slice)}merge(e){if(!(e instanceof lc)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let n=this.slice.size+e.slice.size==0?W.empty:new W(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new lc(this.from,this.to+(e.to-e.from),n,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let n=this.slice.size+e.slice.size==0?W.empty:new W(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new lc(e.from,this.to,n,this.structure)}else return null}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new lc(n.from,n.to,W.fromJSON(e,n.slice),!!n.structure)}};ri.jsonID("replace",Zl);let Ro=class $v extends ri{constructor(e,n,r,i,o,a,s=!1){super(),this.from=e,this.to=n,this.gapFrom=r,this.gapTo=i,this.slice=o,this.insert=a,this.structure=s}apply(e){if(this.structure&&(bT(e,this.from,this.gapFrom)||bT(e,this.gapTo,this.to)))return Nr.fail("Structure gap-replace would overwrite content");let n=e.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return Nr.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?Nr.fromReplace(e,this.from,this.to,r):Nr.fail("Content does not fit in gap")}getMap(){return new of([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let n=this.gapTo-this.gapFrom;return new $v(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1),i=e.map(this.gapFrom,-1),o=e.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||i<n.pos||o>r.pos?null:new $v(n.pos,r.pos,i,o,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new $v(n.from,n.to,n.gapFrom,n.gapTo,W.fromJSON(e,n.slice),n.insert,!!n.structure)}};ri.jsonID("replaceAround",Ro);function bT(t,e,n){let r=t.resolve(e),i=n-e,o=r.depth;for(;i>0&&o>0&&r.indexAfter(o)==r.node(o).childCount;)o--,i--;if(i>0){let a=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!a||a.isLeaf)return!0;a=a.firstChild,i--}}return!1}function DKe(t,e,n,r){let i=[],o=[],a,s;t.doc.nodesBetween(e,n,(l,c,u)=>{if(!l.isInline)return;let d=l.marks;if(!r.isInSet(d)&&u.type.allowsMarkType(r.type)){let p=Math.max(c,e),h=Math.min(c+l.nodeSize,n),m=r.addToSet(d);for(let g=0;g<d.length;g++)d[g].isInSet(m)||(a&&a.to==p&&a.mark.eq(d[g])?a.to=h:i.push(a=new Fg(p,h,d[g])));s&&s.to==p?s.to=h:o.push(s=new Tj(p,h,r))}}),i.forEach(l=>t.step(l)),o.forEach(l=>t.step(l))}function PKe(t,e,n,r){let i=[],o=0;t.doc.nodesBetween(e,n,(a,s)=>{if(!a.isInline)return;o++;let l=null;if(r instanceof Mg){let c=a.marks,u;for(;u=r.isInSet(c);)(l||(l=[])).push(u),c=u.removeFromSet(c)}else r?r.isInSet(a.marks)&&(l=[r]):l=a.marks;if(l&&l.length){let c=Math.min(s+a.nodeSize,n);for(let u=0;u<l.length;u++){let d=l[u],p;for(let h=0;h<i.length;h++){let m=i[h];m.step==o-1&&d.eq(i[h].style)&&(p=m)}p?(p.to=c,p.step=o):i.push({style:d,from:Math.max(s,e),to:c,step:o})}}}),i.forEach(a=>t.step(new Fg(a.from,a.to,a.style)))}function BKe(t,e,n,r=n.contentMatch){let i=t.doc.nodeAt(e),o=[],a=e+1;for(let s=0;s<i.childCount;s++){let l=i.child(s),c=a+l.nodeSize,u=r.matchType(l.type);if(!u)o.push(new Zl(a,c,W.empty));else{r=u;for(let d=0;d<l.marks.length;d++)n.allowsMarkType(l.marks[d].type)||t.step(new Fg(a,c,l.marks[d]))}a=c}if(!r.validEnd){let s=r.fillBefore(B.empty,!0);t.replace(a,a,new W(s,0,0))}for(let s=o.length-1;s>=0;s--)t.step(o[s])}function UKe(t,e,n){return(e==0||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function NKe(t){let n=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let r=t.depth;;--r){let i=t.$from.node(r),o=t.$from.index(r),a=t.$to.indexAfter(r);if(r<t.depth&&i.canReplace(o,a,n))return r;if(r==0||i.type.spec.isolating||!UKe(i,o,a))break}return null}function WKe(t,e,n){let{$from:r,$to:i,depth:o}=e,a=r.before(o+1),s=i.after(o+1),l=a,c=s,u=B.empty,d=0;for(let m=o,g=!1;m>n;m--)g||r.index(m)>0?(g=!0,u=B.from(r.node(m).copy(u)),d++):l--;let p=B.empty,h=0;for(let m=o,g=!1;m>n;m--)g||i.after(m+1)<i.end(m)?(g=!0,p=B.from(i.node(m).copy(p)),h++):c++;t.step(new Ro(l,c,a,s,new W(u.append(p),d,h),u.size-d,!0))}function KKe(t,e,n=null,r=t){let i=qKe(t,e),o=i&&VKe(r,e);return o?i.map(k2).concat({type:e,attrs:n}).concat(o.map(k2)):null}function k2(t){return{type:t,attrs:null}}function qKe(t,e){let{parent:n,startIndex:r,endIndex:i}=t,o=n.contentMatchAt(r).findWrapping(e);if(!o)return null;let a=o.length?o[0]:e;return n.canReplaceWith(r,i,a)?o:null}function VKe(t,e){let{parent:n,startIndex:r,endIndex:i}=t,o=n.child(r),a=e.contentMatch.findWrapping(o.type);if(!a)return null;let l=(a.length?a[a.length-1]:e).contentMatch;for(let c=r;l&&c<i;c++)l=l.matchType(n.child(c).type);return!l||!l.validEnd?null:a}function zKe(t,e,n){let r=B.empty;for(let a=n.length-1;a>=0;a--){if(r.size){let s=n[a].type.contentMatch.matchFragment(r);if(!s||!s.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=B.from(n[a].type.create(n[a].attrs,r))}let i=e.start,o=e.end;t.step(new Ro(i,o,i,o,new W(r,0,0),n.length,!0))}function QKe(t,e,n,r,i){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let o=t.steps.length;t.doc.nodesBetween(e,n,(a,s)=>{if(a.isTextblock&&!a.hasMarkup(r,i)&&HKe(t.doc,t.mapping.slice(o).map(s),r)){t.clearIncompatible(t.mapping.slice(o).map(s,1),r);let l=t.mapping.slice(o),c=l.map(s,1),u=l.map(s+a.nodeSize,1);return t.step(new Ro(c,u,c+1,u-1,new W(B.from(r.create(i,null,a.marks)),0,0),1,!0)),!1}})}function HKe(t,e,n){let r=t.resolve(e),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}function YKe(t,e,n,r,i){let o=t.doc.nodeAt(e);if(!o)throw new RangeError("No node at given position");n||(n=o.type);let a=n.create(r,null,i||o.marks);if(o.isLeaf)return t.replaceWith(e,e+o.nodeSize,a);if(!n.validContent(o.content))throw new RangeError("Invalid content for node type "+n.name);t.step(new Ro(e,e+o.nodeSize,e+1,e+o.nodeSize-1,new W(B.from(a),0,0),1,!0))}function GKe(t,e,n=1,r){let i=t.resolve(e),o=i.depth-n,a=r&&r[r.length-1]||i.parent;if(o<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!a.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let c=i.depth-1,u=n-2;c>o;c--,u--){let d=i.node(c),p=i.index(c);if(d.type.spec.isolating)return!1;let h=d.content.cutByIndex(p,d.childCount),m=r&&r[u+1];m&&(h=h.replaceChild(0,m.type.create(m.attrs)));let g=r&&r[u]||d;if(!d.canReplace(p+1,d.childCount)||!g.type.validContent(h))return!1}let s=i.indexAfter(o),l=r&&r[0];return i.node(o).canReplaceWith(s,s,l?l.type:i.node(o+1).type)}function JKe(t,e,n=1,r){let i=t.doc.resolve(e),o=B.empty,a=B.empty;for(let s=i.depth,l=i.depth-n,c=n-1;s>l;s--,c--){o=B.from(i.node(s).copy(o));let u=r&&r[c];a=B.from(u?u.type.create(u.attrs,a):i.node(s).copy(a))}t.step(new Zl(e,e,new W(o.append(a),n,n),!0))}function ZKe(t,e){let n=t.resolve(e),r=n.index();return XKe(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function XKe(t,e){return!!(t&&e&&!t.isLeaf&&t.canAppend(e))}function e3e(t,e,n){let r=new Zl(e-n,e+n,W.empty,!0);t.step(r)}function t3e(t,e,n){let r=t.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),n))return e;if(r.parentOffset==0)for(let i=r.depth-1;i>=0;i--){let o=r.index(i);if(r.node(i).canReplaceWith(o,o,n))return r.before(i+1);if(o>0)return null}if(r.parentOffset==r.parent.content.size)for(let i=r.depth-1;i>=0;i--){let o=r.indexAfter(i);if(r.node(i).canReplaceWith(o,o,n))return r.after(i+1);if(o<r.node(i).childCount)return null}return null}function n3e(t,e,n){let r=t.resolve(e);if(!n.content.size)return e;let i=n.content;for(let o=0;o<n.openStart;o++)i=i.firstChild.content;for(let o=1;o<=(n.openStart==0&&n.size?2:1);o++)for(let a=r.depth;a>=0;a--){let s=a==r.depth?0:r.pos<=(r.start(a+1)+r.end(a+1))/2?-1:1,l=r.index(a)+(s>0?1:0),c=r.node(a),u=!1;if(o==1)u=c.canReplace(l,l,i);else{let d=c.contentMatchAt(l).findWrapping(i.firstChild.type);u=d&&c.canReplaceWith(l,l,d[0])}if(u)return s==0?r.pos:s<0?r.before(a+1):r.after(a+1)}return null}function r3e(t,e,n=e,r=W.empty){if(e==n&&!r.size)return null;let i=t.resolve(e),o=t.resolve(n);return ZJ(i,o,r)?new Zl(e,n,r):new i3e(i,o,r).fit()}function ZJ(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}let i3e=class{constructor(e,n,r){this.$from=e,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=B.empty;for(let i=0;i<=e.depth;i++){let o=e.node(i);this.frontier.push({type:o.type,match:o.contentMatchAt(e.indexAfter(i))})}for(let i=e.depth;i>0;i--)this.placed=B.from(e.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let c=this.findFittable();c?this.placeNodes(c):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,i=this.close(e<0?this.$to:r.doc.resolve(e));if(!i)return null;let o=this.placed,a=r.depth,s=i.depth;for(;a&&s&&o.childCount==1;)o=o.firstChild.content,a--,s--;let l=new W(o,a,s);return e>-1?new Ro(r.pos,e,this.$to.pos,this.$to.end(),l,n):l.size||r.pos!=this.$to.pos?new Zl(r.pos,i.pos,l):null}findFittable(){let e=this.unplaced.openStart;for(let n=this.unplaced.content,r=0,i=this.unplaced.openEnd;r<e;r++){let o=n.firstChild;if(n.childCount>1&&(i=0),o.type.spec.isolating&&i<=r){e=r;break}n=o.content}for(let n=1;n<=2;n++)for(let r=n==1?e:this.unplaced.openStart;r>=0;r--){let i,o=null;r?(o=Lw(this.unplaced.content,r-1).firstChild,i=o.content):i=this.unplaced.content;let a=i.firstChild;for(let s=this.depth;s>=0;s--){let{type:l,match:c}=this.frontier[s],u,d=null;if(n==1&&(a?c.matchType(a.type)||(d=c.fillBefore(B.from(a),!1)):o&&l.compatibleContent(o.type)))return{sliceDepth:r,frontierDepth:s,parent:o,inject:d};if(n==2&&a&&(u=c.findWrapping(a.type)))return{sliceDepth:r,frontierDepth:s,parent:o,wrap:u};if(o&&c.matchType(o.type))break}}}openMore(){let{content:e,openStart:n,openEnd:r}=this.unplaced,i=Lw(e,n);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new W(e,n+1,Math.max(r,i.size+n>=e.size-r?n+1:0)),!0)}dropNode(){let{content:e,openStart:n,openEnd:r}=this.unplaced,i=Lw(e,n);if(i.childCount<=1&&n>0){let o=e.size-n<=n+i.size;this.unplaced=new W(ch(e,n-1,1),n-1,o?n-1:r)}else this.unplaced=new W(ch(e,n,1),n,r)}placeNodes({sliceDepth:e,frontierDepth:n,parent:r,inject:i,wrap:o}){for(;this.depth>n;)this.closeFrontierNode();if(o)for(let g=0;g<o.length;g++)this.openFrontierNode(o[g]);let a=this.unplaced,s=r?r.content:a.content,l=a.openStart-e,c=0,u=[],{match:d,type:p}=this.frontier[n];if(i){for(let g=0;g<i.childCount;g++)u.push(i.child(g));d=d.matchFragment(i)}let h=s.size+e-(a.content.size-a.openEnd);for(;c<s.childCount;){let g=s.child(c),v=d.matchType(g.type);if(!v)break;c++,(c>1||l==0||g.content.size)&&(d=v,u.push(XJ(g.mark(p.allowedMarks(g.marks)),c==1?l:0,c==s.childCount?h:-1)))}let m=c==s.childCount;m||(h=-1),this.placed=uh(this.placed,n,B.from(u)),this.frontier[n].match=d,m&&h<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let g=0,v=s;g<h;g++){let b=v.lastChild;this.frontier.push({type:b.type,match:b.contentMatchAt(b.childCount)}),v=b.content}this.unplaced=m?e==0?W.empty:new W(ch(a.content,e-1,1),e-1,h<0?a.openEnd:e-1):new W(ch(a.content,e,c),a.openStart,a.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],n;if(!e.type.isTextblock||!Dw(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(n=this.findCloseLevel(this.$to))&&n.depth==this.depth)return-1;let{depth:r}=this.$to,i=this.$to.after(r);for(;r>1&&i==this.$to.end(--r);)++i;return i}findCloseLevel(e){e:for(let n=Math.min(this.depth,e.depth);n>=0;n--){let{match:r,type:i}=this.frontier[n],o=n<e.depth&&e.end(n+1)==e.pos+(e.depth-(n+1)),a=Dw(e,n,i,r,o);if(a){for(let s=n-1;s>=0;s--){let{match:l,type:c}=this.frontier[s],u=Dw(e,s,c,l,!0);if(!u||u.childCount)continue e}return{depth:n,fit:a,move:o?e.doc.resolve(e.after(n+1)):e}}}}close(e){let n=this.findCloseLevel(e);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=uh(this.placed,n.depth,n.fit)),e=n.move;for(let r=n.depth+1;r<=e.depth;r++){let i=e.node(r),o=i.type.contentMatch.fillBefore(i.content,!0,e.index(r));this.openFrontierNode(i.type,i.attrs,o)}return e}openFrontierNode(e,n=null,r){let i=this.frontier[this.depth];i.match=i.match.matchType(e),this.placed=uh(this.placed,this.depth,B.from(e.create(n,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(B.empty,!0);n.childCount&&(this.placed=uh(this.placed,this.frontier.length,n))}};function ch(t,e,n){return e==0?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(ch(t.firstChild.content,e-1,n)))}function uh(t,e,n){return e==0?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(uh(t.lastChild.content,e-1,n)))}function Lw(t,e){for(let n=0;n<e;n++)t=t.firstChild.content;return t}function XJ(t,e,n){if(e<=0)return t;let r=t.content;return e>1&&(r=r.replaceChild(0,XJ(r.firstChild,e-1,r.childCount==1?n-1:0))),e>0&&(r=t.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(t.type.contentMatch.matchFragment(r).fillBefore(B.empty,!0)))),t.copy(r)}function Dw(t,e,n,r,i){let o=t.node(e),a=i?t.indexAfter(e):t.index(e);if(a==o.childCount&&!n.compatibleContent(o.type))return null;let s=r.fillBefore(o.content,!0,a);return s&&!o3e(n,o.content,a)?s:null}function o3e(t,e,n){for(let r=n;r<e.childCount;r++)if(!t.allowsMarks(e.child(r).marks))return!0;return!1}function a3e(t){return t.spec.defining||t.spec.definingForContent}function s3e(t,e,n,r){if(!r.size)return t.deleteRange(e,n);let i=t.doc.resolve(e),o=t.doc.resolve(n);if(ZJ(i,o,r))return t.step(new Zl(e,n,r));let a=tZ(i,t.doc.resolve(n));a[a.length-1]==0&&a.pop();let s=-(i.depth+1);a.unshift(s);for(let p=i.depth,h=i.pos-1;p>0;p--,h--){let m=i.node(p).type.spec;if(m.defining||m.definingAsContext||m.isolating)break;a.indexOf(p)>-1?s=p:i.before(p)==h&&a.splice(1,0,-p)}let l=a.indexOf(s),c=[],u=r.openStart;for(let p=r.content,h=0;;h++){let m=p.firstChild;if(c.push(m),h==r.openStart)break;p=m.content}for(let p=u-1;p>=0;p--){let h=c[p].type,m=a3e(h);if(m&&i.node(l).type!=h)u=p;else if(m||!h.isTextblock)break}for(let p=r.openStart;p>=0;p--){let h=(p+u+1)%(r.openStart+1),m=c[h];if(m)for(let g=0;g<a.length;g++){let v=a[(g+l)%a.length],b=!0;v<0&&(b=!1,v=-v);let S=i.node(v-1),C=i.index(v-1);if(S.canReplaceWith(C,C,m.type,m.marks))return t.replace(i.before(v),b?o.after(v):n,new W(eZ(r.content,0,r.openStart,h),h,r.openEnd))}}let d=t.steps.length;for(let p=a.length-1;p>=0&&(t.replace(e,n,r),!(t.steps.length>d));p--){let h=a[p];h<0||(e=i.before(h),n=o.after(h))}}function eZ(t,e,n,r,i){if(e<n){let o=t.firstChild;t=t.replaceChild(0,o.copy(eZ(o.content,e+1,n,r,o)))}if(e>r){let o=i.contentMatchAt(0),a=o.fillBefore(t).append(t);t=a.append(o.matchFragment(a).fillBefore(B.empty,!0))}return t}function l3e(t,e,n,r){if(!r.isInline&&e==n&&t.doc.resolve(e).parent.content.size){let i=t3e(t.doc,e,r.type);i!=null&&(e=n=i)}t.replaceRange(e,n,new W(B.from(r),0,0))}function c3e(t,e,n){let r=t.doc.resolve(e),i=t.doc.resolve(n),o=tZ(r,i);for(let a=0;a<o.length;a++){let s=o[a],l=a==o.length-1;if(l&&s==0||r.node(s).type.contentMatch.validEnd)return t.delete(r.start(s),i.end(s));if(s>0&&(l||r.node(s-1).canReplace(r.index(s-1),i.indexAfter(s-1))))return t.delete(r.before(s),i.after(s))}for(let a=1;a<=r.depth&&a<=i.depth;a++)if(e-r.start(a)==r.depth-a&&n>r.end(a)&&i.end(a)-n!=i.depth-a)return t.delete(r.before(a),n);t.delete(e,n)}function tZ(t,e){let n=[],r=Math.min(t.depth,e.depth);for(let i=r;i>=0;i--){let o=t.start(i);if(o<t.pos-(t.depth-i)||e.end(i)>e.pos+(e.depth-i)||t.node(i).type.spec.isolating||e.node(i).type.spec.isolating)break;(o==e.start(i)||i==t.depth&&i==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&i&&e.start(i-1)==o-1)&&n.push(i)}return n}let nZ=class Ov extends ri{constructor(e,n,r){super(),this.pos=e,this.attr=n,this.value=r}apply(e){let n=e.nodeAt(this.pos);if(!n)return Nr.fail("No node at attribute step's position");let r=Object.create(null);for(let o in n.attrs)r[o]=n.attrs[o];r[this.attr]=this.value;let i=n.type.create(r,null,n.marks);return Nr.fromReplace(e,this.pos,this.pos+1,new W(B.from(i),0,n.isLeaf?0:1))}getMap(){return of.empty}invert(e){return new Ov(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new Ov(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.pos!="number"||typeof n.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new Ov(n.pos,n.attr,n.value)}};ri.jsonID("attr",nZ);let af=class extends Error{};af=function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n};af.prototype=Object.create(Error.prototype);af.prototype.constructor=af;af.prototype.name="TransformError";let u3e=class{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new JJ}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let n=this.maybeStep(e);if(n.failed)throw new af(n.failed);return this}maybeStep(e){let n=e.apply(this.doc);return n.failed||this.addStep(e,n.doc),n}get docChanged(){return this.steps.length>0}addStep(e,n){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=n}replace(e,n=e,r=W.empty){let i=r3e(this.doc,e,n,r);return i&&this.step(i),this}replaceWith(e,n,r){return this.replace(e,n,new W(B.from(r),0,0))}delete(e,n){return this.replace(e,n,W.empty)}insert(e,n){return this.replaceWith(e,e,n)}replaceRange(e,n,r){return s3e(this,e,n,r),this}replaceRangeWith(e,n,r){return l3e(this,e,n,r),this}deleteRange(e,n){return c3e(this,e,n),this}lift(e,n){return WKe(this,e,n),this}join(e,n=1){return e3e(this,e,n),this}wrap(e,n){return zKe(this,e,n),this}setBlockType(e,n=e,r,i=null){return QKe(this,e,n,r,i),this}setNodeMarkup(e,n,r=null,i){return YKe(this,e,n,r,i),this}setNodeAttribute(e,n,r){return this.step(new nZ(e,n,r)),this}addNodeMark(e,n){return this.step(new _j(e,n)),this}removeNodeMark(e,n){if(!(n instanceof ct)){let r=this.doc.nodeAt(e);if(!r)throw new RangeError("No node at position "+e);if(n=n.isInSet(r.marks),!n)return this}return this.step(new Ij(e,n)),this}split(e,n=1,r){return JKe(this,e,n,r),this}addMark(e,n,r){return DKe(this,e,n,r),this}removeMark(e,n,r){return PKe(this,e,n,r),this}clearIncompatible(e,n,r){return BKe(this,e,n,r),this}};const Pw=Object.create(null);class ke{constructor(e,n,r){this.$anchor=e,this.$head=n,this.ranges=r||[new rZ(e.min(n),e.max(n))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let n=0;n<e.length;n++)if(e[n].$from.pos!=e[n].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,n=W.empty){let r=n.content.lastChild,i=null;for(let s=0;s<n.openEnd;s++)i=r,r=r.lastChild;let o=e.steps.length,a=this.ranges;for(let s=0;s<a.length;s++){let{$from:l,$to:c}=a[s],u=e.mapping.slice(o);e.replaceRange(u.map(l.pos),u.map(c.pos),s?W.empty:n),s==0&&M2(e,o,(r?r.isInline:i&&i.isTextblock)?-1:1)}}replaceWith(e,n){let r=e.steps.length,i=this.ranges;for(let o=0;o<i.length;o++){let{$from:a,$to:s}=i[o],l=e.mapping.slice(r),c=l.map(a.pos),u=l.map(s.pos);o?e.deleteRange(c,u):(e.replaceRangeWith(c,u,n),M2(e,r,n.isInline?-1:1))}}static findFrom(e,n,r=!1){let i=e.parent.inlineContent?new Ie(e):wd(e.node(0),e.parent,e.pos,e.index(),n,r);if(i)return i;for(let o=e.depth-1;o>=0;o--){let a=n<0?wd(e.node(0),e.node(o),e.before(o+1),e.index(o),n,r):wd(e.node(0),e.node(o),e.after(o+1),e.index(o)+1,n,r);if(a)return a}return null}static near(e,n=1){return this.findFrom(e,n)||this.findFrom(e,-n)||new Mi(e.node(0))}static atStart(e){return wd(e,e,0,0,1)||new Mi(e)}static atEnd(e){return wd(e,e,e.content.size,e.childCount,-1)||new Mi(e)}static fromJSON(e,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=Pw[n.type];if(!r)throw new RangeError(`No selection type ${n.type} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in Pw)throw new RangeError("Duplicate use of selection JSON ID "+e);return Pw[e]=n,n.prototype.jsonID=e,n}getBookmark(){return Ie.between(this.$anchor,this.$head).getBookmark()}}ke.prototype.visible=!0;class rZ{constructor(e,n){this.$from=e,this.$to=n}}let $2=!1;function O2(t){!$2&&!t.parent.inlineContent&&($2=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}class Ie extends ke{constructor(e,n=e){O2(e),O2(n),super(e,n)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,n){let r=e.resolve(n.map(this.head));if(!r.parent.inlineContent)return ke.near(r);let i=e.resolve(n.map(this.anchor));return new Ie(i.parent.inlineContent?i:r,r)}replace(e,n=W.empty){if(super.replace(e,n),n==W.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof Ie&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new HC(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,n){if(typeof n.anchor!="number"||typeof n.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new Ie(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,r=n){let i=e.resolve(n);return new this(i,r==n?i:e.resolve(r))}static between(e,n,r){let i=e.pos-n.pos;if((!r||i)&&(r=i>=0?1:-1),!n.parent.inlineContent){let o=ke.findFrom(n,r,!0)||ke.findFrom(n,-r,!0);if(o)n=o.$head;else return ke.near(n,r)}return e.parent.inlineContent||(i==0?e=n:(e=(ke.findFrom(e,-r,!0)||ke.findFrom(e,r,!0)).$anchor,e.pos<n.pos!=i<0&&(e=n))),new Ie(e,n)}}ke.jsonID("text",Ie);class HC{constructor(e,n){this.anchor=e,this.head=n}map(e){return new HC(e.map(this.anchor),e.map(this.head))}resolve(e){return Ie.between(e.resolve(this.anchor),e.resolve(this.head))}}class Ce extends ke{constructor(e){let n=e.nodeAfter,r=e.node(0).resolve(e.pos+n.nodeSize);super(e,r),this.node=n}map(e,n){let{deleted:r,pos:i}=n.mapResult(this.anchor),o=e.resolve(i);return r?ke.near(o):new Ce(o)}content(){return new W(B.from(this.node),0,0)}eq(e){return e instanceof Ce&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new Ej(this.anchor)}static fromJSON(e,n){if(typeof n.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new Ce(e.resolve(n.anchor))}static create(e,n){return new Ce(e.resolve(n))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}}Ce.prototype.visible=!1;ke.jsonID("node",Ce);class Ej{constructor(e){this.anchor=e}map(e){let{deleted:n,pos:r}=e.mapResult(this.anchor);return n?new HC(r,r):new Ej(r)}resolve(e){let n=e.resolve(this.anchor),r=n.nodeAfter;return r&&Ce.isSelectable(r)?new Ce(n):ke.near(n)}}class Mi extends ke{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,n=W.empty){if(n==W.empty){e.delete(0,e.doc.content.size);let r=ke.atStart(e.doc);r.eq(e.selection)||e.setSelection(r)}else super.replace(e,n)}toJSON(){return{type:"all"}}static fromJSON(e){return new Mi(e)}map(e){return new Mi(e)}eq(e){return e instanceof Mi}getBookmark(){return d3e}}ke.jsonID("all",Mi);const d3e={map(){return this},resolve(t){return new Mi(t)}};function wd(t,e,n,r,i,o=!1){if(e.inlineContent)return Ie.create(t,n);for(let a=r-(i>0?0:1);i>0?a<e.childCount:a>=0;a+=i){let s=e.child(a);if(s.isAtom){if(!o&&Ce.isSelectable(s))return Ce.create(t,n-(i<0?s.nodeSize:0))}else{let l=wd(t,s,n+i,i<0?s.childCount:0,i,o);if(l)return l}n+=s.nodeSize*i}return null}function M2(t,e,n){let r=t.steps.length-1;if(r<e)return;let i=t.steps[r];if(!(i instanceof Zl||i instanceof Ro))return;let o=t.mapping.maps[r],a;o.forEach((s,l,c,u)=>{a==null&&(a=u)}),t.setSelection(ke.near(t.doc.resolve(a),n))}const F2=1,dv=2,j2=4;class f3e extends u3e{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(e){if(e.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=(this.updated|F2)&~dv,this.storedMarks=null,this}get selectionSet(){return(this.updated&F2)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=dv,this}ensureMarks(e){return ct.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&dv)>0}addStep(e,n){super.addStep(e,n),this.updated=this.updated&~dv,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,n=!0){let r=this.selection;return n&&(e=e.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||ct.none))),r.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,n,r){let i=this.doc.type.schema;if(n==null)return e?this.replaceSelectionWith(i.text(e),!0):this.deleteSelection();{if(r==null&&(r=n),r=r??n,!e)return this.deleteRange(n,r);let o=this.storedMarks;if(!o){let a=this.doc.resolve(n);o=r==n?a.marks():a.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(n,r,i.text(e,o)),this.selection.empty||this.setSelection(ke.near(this.selection.$to)),this}}setMeta(e,n){return this.meta[typeof e=="string"?e:e.key]=n,this}getMeta(e){return this.meta[typeof e=="string"?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=j2,this}get scrolledIntoView(){return(this.updated&j2)>0}}function L2(t,e){return!e||!t?t:t.bind(e)}class dh{constructor(e,n,r){this.name=e,this.init=L2(n.init,r),this.apply=L2(n.apply,r)}}const p3e=[new dh("doc",{init(t){return t.doc||t.schema.topNodeType.createAndFill()},apply(t){return t.doc}}),new dh("selection",{init(t,e){return t.selection||ke.atStart(e.doc)},apply(t){return t.selection}}),new dh("storedMarks",{init(t){return t.storedMarks||null},apply(t,e,n,r){return r.selection.$cursor?t.storedMarks:null}}),new dh("scrollToSelection",{init(){return 0},apply(t,e){return t.scrolledIntoView?e+1:e}})];class Bw{constructor(e,n){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=p3e.slice(),n&&n.forEach(r=>{if(this.pluginsByKey[r.key])throw new RangeError("Adding different instances of a keyed plugin ("+r.key+")");this.plugins.push(r),this.pluginsByKey[r.key]=r,r.spec.state&&this.fields.push(new dh(r.key,r.spec.state,r))})}}class $d{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,n=-1){for(let r=0;r<this.config.plugins.length;r++)if(r!=n){let i=this.config.plugins[r];if(i.spec.filterTransaction&&!i.spec.filterTransaction.call(i,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let n=[e],r=this.applyInner(e),i=null;for(;;){let o=!1;for(let a=0;a<this.config.plugins.length;a++){let s=this.config.plugins[a];if(s.spec.appendTransaction){let l=i?i[a].n:0,c=i?i[a].state:this,u=l<n.length&&s.spec.appendTransaction.call(s,l?n.slice(l):n,c,r);if(u&&r.filterTransaction(u,a)){if(u.setMeta("appendedTransaction",e),!i){i=[];for(let d=0;d<this.config.plugins.length;d++)i.push(d<a?{state:r,n:n.length}:{state:this,n:0})}n.push(u),r=r.applyInner(u),o=!0}i&&(i[a]={state:r,n:n.length})}}if(!o)return{state:r,transactions:n}}}applyInner(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let n=new $d(this.config),r=this.config.fields;for(let i=0;i<r.length;i++){let o=r[i];n[o.name]=o.apply(e,this[o.name],this,n)}return n}get tr(){return new f3e(this)}static create(e){let n=new Bw(e.doc?e.doc.type.schema:e.schema,e.plugins),r=new $d(n);for(let i=0;i<n.fields.length;i++)r[n.fields[i].name]=n.fields[i].init(e,r);return r}reconfigure(e){let n=new Bw(this.schema,e.plugins),r=n.fields,i=new $d(n);for(let o=0;o<r.length;o++){let a=r[o].name;i[a]=this.hasOwnProperty(a)?this[a]:r[o].init(e,i)}return i}toJSON(e){let n={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(n.storedMarks=this.storedMarks.map(r=>r.toJSON())),e&&typeof e=="object")for(let r in e){if(r=="doc"||r=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let i=e[r],o=i.spec.state;o&&o.toJSON&&(n[r]=o.toJSON.call(i,this[i.key]))}return n}static fromJSON(e,n,r){if(!n)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let i=new Bw(e.schema,e.plugins),o=new $d(i);return i.fields.forEach(a=>{if(a.name=="doc")o.doc=Xs.fromJSON(e.schema,n.doc);else if(a.name=="selection")o.selection=ke.fromJSON(o.doc,n.selection);else if(a.name=="storedMarks")n.storedMarks&&(o.storedMarks=n.storedMarks.map(e.schema.markFromJSON));else{if(r)for(let s in r){let l=r[s],c=l.spec.state;if(l.key==a.name&&c&&c.fromJSON&&Object.prototype.hasOwnProperty.call(n,s)){o[a.name]=c.fromJSON.call(l,e,n[s],o);return}}o[a.name]=a.init(e,o)}}),o}}function iZ(t,e,n){for(let r in t){let i=t[r];i instanceof Function?i=i.bind(e):r=="handleDOMEvents"&&(i=iZ(i,e,{})),n[r]=i}return n}class an{constructor(e){this.spec=e,this.props={},e.props&&iZ(e.props,this,this.props),this.key=e.key?e.key.key:oZ("plugin")}getState(e){return e[this.key]}}const Uw=Object.create(null);function oZ(t){return t in Uw?t+"$"+ ++Uw[t]:(Uw[t]=0,t+"$")}class xn{constructor(e="key"){this.key=oZ(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const On=function(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e},vm=function(t){let e=t.assignedSlot||t.parentNode;return e&&e.nodeType==11?e.host:e};let CT=null;const Ea=function(t,e,n){let r=CT||(CT=document.createRange());return r.setEnd(t,n??t.nodeValue.length),r.setStart(t,e||0),r},h3e=function(){CT=null},Zc=function(t,e,n,r){return n&&(D2(t,e,n,r,-1)||D2(t,e,n,r,1))},m3e=/^(img|br|input|textarea|hr)$/i;function D2(t,e,n,r,i){for(;;){if(t==n&&e==r)return!0;if(e==(i<0?0:ki(t))){let o=t.parentNode;if(!o||o.nodeType!=1||jg(t)||m3e.test(t.nodeName)||t.contentEditable=="false")return!1;e=On(t)+(i<0?0:1),t=o}else if(t.nodeType==1){if(t=t.childNodes[e+(i<0?-1:0)],t.contentEditable=="false")return!1;e=i<0?ki(t):0}else return!1}}function ki(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function A3e(t,e){for(;;){if(t.nodeType==3&&e)return t;if(t.nodeType==1&&e>0){if(t.contentEditable=="false")return null;t=t.childNodes[e-1],e=ki(t)}else if(t.parentNode&&!jg(t))e=On(t),t=t.parentNode;else return null}}function g3e(t,e){for(;;){if(t.nodeType==3&&e<t.nodeValue.length)return t;if(t.nodeType==1&&e<t.childNodes.length){if(t.contentEditable=="false")return null;t=t.childNodes[e],e=0}else if(t.parentNode&&!jg(t))e=On(t)+1,t=t.parentNode;else return null}}function v3e(t,e,n){for(let r=e==0,i=e==ki(t);r||i;){if(t==n)return!0;let o=On(t);if(t=t.parentNode,!t)return!1;r=r&&o==0,i=i&&o==ki(t)}}function jg(t){let e;for(let n=t;n&&!(e=n.pmViewDesc);n=n.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==t||e.contentDOM==t)}const YC=function(t){return t.focusNode&&Zc(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)};function hc(t,e){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=t,n.key=n.code=e,n}function y3e(t){let e=t.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function b3e(t,e,n){if(t.caretPositionFromPoint)try{let r=t.caretPositionFromPoint(e,n);if(r)return{node:r.offsetNode,offset:Math.min(ki(r.offsetNode),r.offset)}}catch{}if(t.caretRangeFromPoint){let r=t.caretRangeFromPoint(e,n);if(r)return{node:r.startContainer,offset:Math.min(ki(r.startContainer),r.startOffset)}}}const Qo=typeof navigator<"u"?navigator:null,P2=typeof document<"u"?document:null,Xl=Qo&&Qo.userAgent||"",ST=/Edge\/(\d+)/.exec(Xl),aZ=/MSIE \d/.exec(Xl),wT=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Xl),Wr=!!(aZ||wT||ST),tl=aZ?document.documentMode:wT?+wT[1]:ST?+ST[1]:0,co=!Wr&&/gecko\/(\d+)/i.test(Xl);co&&+(/Firefox\/(\d+)/.exec(Xl)||[0,0])[1];const xT=!Wr&&/Chrome\/(\d+)/.exec(Xl),tr=!!xT,sZ=xT?+xT[1]:0,wr=!Wr&&!!Qo&&/Apple Computer/.test(Qo.vendor),sf=wr&&(/Mobile\/\w+/.test(Xl)||!!Qo&&Qo.maxTouchPoints>2),Ei=sf||(Qo?/Mac/.test(Qo.platform):!1),C3e=Qo?/Win/.test(Qo.platform):!1,Ma=/Android \d/.test(Xl),Lg=!!P2&&"webkitFontSmoothing"in P2.documentElement.style,S3e=Lg?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function w3e(t){let e=t.defaultView&&t.defaultView.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.documentElement.clientWidth,top:0,bottom:t.documentElement.clientHeight}}function wa(t,e){return typeof t=="number"?t:t[e]}function x3e(t){let e=t.getBoundingClientRect(),n=e.width/t.offsetWidth||1,r=e.height/t.offsetHeight||1;return{left:e.left,right:e.left+t.clientWidth*n,top:e.top,bottom:e.top+t.clientHeight*r}}function B2(t,e,n){let r=t.someProp("scrollThreshold")||0,i=t.someProp("scrollMargin")||5,o=t.dom.ownerDocument;for(let a=n||t.dom;a;a=vm(a)){if(a.nodeType!=1)continue;let s=a,l=s==o.body,c=l?w3e(o):x3e(s),u=0,d=0;if(e.top<c.top+wa(r,"top")?d=-(c.top-e.top+wa(i,"top")):e.bottom>c.bottom-wa(r,"bottom")&&(d=e.bottom-e.top>c.bottom-c.top?e.top+wa(i,"top")-c.top:e.bottom-c.bottom+wa(i,"bottom")),e.left<c.left+wa(r,"left")?u=-(c.left-e.left+wa(i,"left")):e.right>c.right-wa(r,"right")&&(u=e.right-c.right+wa(i,"right")),u||d)if(l)o.defaultView.scrollBy(u,d);else{let p=s.scrollLeft,h=s.scrollTop;d&&(s.scrollTop+=d),u&&(s.scrollLeft+=u);let m=s.scrollLeft-p,g=s.scrollTop-h;e={left:e.left-m,top:e.top-g,right:e.right-m,bottom:e.bottom-g}}if(l||/^(fixed|sticky)$/.test(getComputedStyle(a).position))break}}function T3e(t){let e=t.dom.getBoundingClientRect(),n=Math.max(0,e.top),r,i;for(let o=(e.left+e.right)/2,a=n+1;a<Math.min(innerHeight,e.bottom);a+=5){let s=t.root.elementFromPoint(o,a);if(!s||s==t.dom||!t.dom.contains(s))continue;let l=s.getBoundingClientRect();if(l.top>=n-20){r=s,i=l.top;break}}return{refDOM:r,refTop:i,stack:lZ(t.dom)}}function lZ(t){let e=[],n=t.ownerDocument;for(let r=t;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),t!=n);r=vm(r));return e}function _3e({refDOM:t,refTop:e,stack:n}){let r=t?t.getBoundingClientRect().top:0;cZ(n,r==0?0:r-e)}function cZ(t,e){for(let n=0;n<t.length;n++){let{dom:r,top:i,left:o}=t[n];r.scrollTop!=i+e&&(r.scrollTop=i+e),r.scrollLeft!=o&&(r.scrollLeft=o)}}let hd=null;function I3e(t){if(t.setActive)return t.setActive();if(hd)return t.focus(hd);let e=lZ(t);t.focus(hd==null?{get preventScroll(){return hd={preventScroll:!0},!0}}:void 0),hd||(hd=!1,cZ(e,0))}function uZ(t,e){let n,r=2e8,i,o=0,a=e.top,s=e.top,l,c;for(let u=t.firstChild,d=0;u;u=u.nextSibling,d++){let p;if(u.nodeType==1)p=u.getClientRects();else if(u.nodeType==3)p=Ea(u).getClientRects();else continue;for(let h=0;h<p.length;h++){let m=p[h];if(m.top<=a&&m.bottom>=s){a=Math.max(m.bottom,a),s=Math.min(m.top,s);let g=m.left>e.left?m.left-e.left:m.right<e.left?e.left-m.right:0;if(g<r){n=u,r=g,i=g&&n.nodeType==3?{left:m.right<e.left?m.right:m.left,top:e.top}:e,u.nodeType==1&&g&&(o=d+(e.left>=(m.left+m.right)/2?1:0));continue}}else m.top>e.top&&!l&&m.left<=e.left&&m.right>=e.left&&(l=u,c={left:Math.max(m.left,Math.min(m.right,e.left)),top:m.top});!n&&(e.left>=m.right&&e.top>=m.top||e.left>=m.left&&e.top>=m.bottom)&&(o=d+1)}}return!n&&l&&(n=l,i=c,r=0),n&&n.nodeType==3?E3e(n,i):!n||r&&n.nodeType==1?{node:t,offset:o}:uZ(n,i)}function E3e(t,e){let n=t.nodeValue.length,r=document.createRange();for(let i=0;i<n;i++){r.setEnd(t,i+1),r.setStart(t,i);let o=Fs(r,1);if(o.top!=o.bottom&&Rj(e,o))return{node:t,offset:i+(e.left>=(o.left+o.right)/2?1:0)}}return{node:t,offset:0}}function Rj(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function R3e(t,e){let n=t.parentNode;return n&&/^li$/i.test(n.nodeName)&&e.left<t.getBoundingClientRect().left?n:t}function k3e(t,e,n){let{node:r,offset:i}=uZ(e,n),o=-1;if(r.nodeType==1&&!r.firstChild){let a=r.getBoundingClientRect();o=a.left!=a.right&&n.left>(a.left+a.right)/2?1:-1}return t.docView.posFromDOM(r,i,o)}function $3e(t,e,n,r){let i=-1;for(let o=e,a=!1;o!=t.dom;){let s=t.docView.nearestDesc(o,!0),l;if(!s)return null;if(s.dom.nodeType==1&&(s.node.isBlock&&s.parent||!s.contentDOM)&&((l=s.dom.getBoundingClientRect()).width||l.height)&&(s.node.isBlock&&s.parent&&(!a&&l.left>r.left||l.top>r.top?i=s.posBefore:(!a&&l.right<r.left||l.bottom<r.top)&&(i=s.posAfter),a=!0),!s.contentDOM&&i<0&&!s.node.isText))return(s.node.isBlock?r.top<(l.top+l.bottom)/2:r.left<(l.left+l.right)/2)?s.posBefore:s.posAfter;o=s.dom.parentNode}return i>-1?i:t.docView.posFromDOM(e,n,-1)}function dZ(t,e,n){let r=t.childNodes.length;if(r&&n.top<n.bottom)for(let i=Math.max(0,Math.min(r-1,Math.floor(r*(e.top-n.top)/(n.bottom-n.top))-2)),o=i;;){let a=t.childNodes[o];if(a.nodeType==1){let s=a.getClientRects();for(let l=0;l<s.length;l++){let c=s[l];if(Rj(e,c))return dZ(a,e,c)}}if((o=(o+1)%r)==i)break}return t}function O3e(t,e){let n=t.dom.ownerDocument,r,i=0,o=b3e(n,e.left,e.top);o&&({node:r,offset:i}=o);let a=(t.root.elementFromPoint?t.root:n).elementFromPoint(e.left,e.top),s;if(!a||!t.dom.contains(a.nodeType!=1?a.parentNode:a)){let c=t.dom.getBoundingClientRect();if(!Rj(e,c)||(a=dZ(t.dom,e,c),!a))return null}if(wr)for(let c=a;r&&c;c=vm(c))c.draggable&&(r=void 0);if(a=R3e(a,e),r){if(co&&r.nodeType==1&&(i=Math.min(i,r.childNodes.length),i<r.childNodes.length)){let u=r.childNodes[i],d;u.nodeName=="IMG"&&(d=u.getBoundingClientRect()).right<=e.left&&d.bottom>e.top&&i++}let c;Lg&&i&&r.nodeType==1&&(c=r.childNodes[i-1]).nodeType==1&&c.contentEditable=="false"&&c.getBoundingClientRect().top>=e.top&&i--,r==t.dom&&i==r.childNodes.length-1&&r.lastChild.nodeType==1&&e.top>r.lastChild.getBoundingClientRect().bottom?s=t.state.doc.content.size:(i==0||r.nodeType!=1||r.childNodes[i-1].nodeName!="BR")&&(s=$3e(t,r,i,e))}s==null&&(s=k3e(t,a,e));let l=t.docView.nearestDesc(a,!0);return{pos:s,inside:l?l.posAtStart-l.border:-1}}function U2(t){return t.top<t.bottom||t.left<t.right}function Fs(t,e){let n=t.getClientRects();if(n.length){let r=n[e<0?0:n.length-1];if(U2(r))return r}return Array.prototype.find.call(n,U2)||t.getBoundingClientRect()}const M3e=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function fZ(t,e,n){let{node:r,offset:i,atom:o}=t.docView.domFromPos(e,n<0?-1:1),a=Lg||co;if(r.nodeType==3)if(a&&(M3e.test(r.nodeValue)||(n<0?!i:i==r.nodeValue.length))){let l=Fs(Ea(r,i,i),n);if(co&&i&&/\s/.test(r.nodeValue[i-1])&&i<r.nodeValue.length){let c=Fs(Ea(r,i-1,i-1),-1);if(c.top==l.top){let u=Fs(Ea(r,i,i+1),-1);if(u.top!=l.top)return Jp(u,u.left<c.left)}}return l}else{let l=i,c=i,u=n<0?1:-1;return n<0&&!i?(c++,u=-1):n>=0&&i==r.nodeValue.length?(l--,u=1):n<0?l--:c++,Jp(Fs(Ea(r,l,c),u),u<0)}if(!t.state.doc.resolve(e-(o||0)).parent.inlineContent){if(o==null&&i&&(n<0||i==ki(r))){let l=r.childNodes[i-1];if(l.nodeType==1)return Nw(l.getBoundingClientRect(),!1)}if(o==null&&i<ki(r)){let l=r.childNodes[i];if(l.nodeType==1)return Nw(l.getBoundingClientRect(),!0)}return Nw(r.getBoundingClientRect(),n>=0)}if(o==null&&i&&(n<0||i==ki(r))){let l=r.childNodes[i-1],c=l.nodeType==3?Ea(l,ki(l)-(a?0:1)):l.nodeType==1&&(l.nodeName!="BR"||!l.nextSibling)?l:null;if(c)return Jp(Fs(c,1),!1)}if(o==null&&i<ki(r)){let l=r.childNodes[i];for(;l.pmViewDesc&&l.pmViewDesc.ignoreForCoords;)l=l.nextSibling;let c=l?l.nodeType==3?Ea(l,0,a?0:1):l.nodeType==1?l:null:null;if(c)return Jp(Fs(c,-1),!0)}return Jp(Fs(r.nodeType==3?Ea(r):r,-n),n>=0)}function Jp(t,e){if(t.width==0)return t;let n=e?t.left:t.right;return{top:t.top,bottom:t.bottom,left:n,right:n}}function Nw(t,e){if(t.height==0)return t;let n=e?t.top:t.bottom;return{top:n,bottom:n,left:t.left,right:t.right}}function pZ(t,e,n){let r=t.state,i=t.root.activeElement;r!=e&&t.updateState(e),i!=t.dom&&t.focus();try{return n()}finally{r!=e&&t.updateState(r),i!=t.dom&&i&&i.focus()}}function F3e(t,e,n){let r=e.selection,i=n=="up"?r.$from:r.$to;return pZ(t,e,()=>{let{node:o}=t.docView.domFromPos(i.pos,n=="up"?-1:1);for(;;){let s=t.docView.nearestDesc(o,!0);if(!s)break;if(s.node.isBlock){o=s.contentDOM||s.dom;break}o=s.dom.parentNode}let a=fZ(t,i.pos,1);for(let s=o.firstChild;s;s=s.nextSibling){let l;if(s.nodeType==1)l=s.getClientRects();else if(s.nodeType==3)l=Ea(s,0,s.nodeValue.length).getClientRects();else continue;for(let c=0;c<l.length;c++){let u=l[c];if(u.bottom>u.top+1&&(n=="up"?a.top-u.top>(u.bottom-a.top)*2:u.bottom-a.bottom>(a.bottom-u.top)*2))return!1}}return!0})}const j3e=/[\u0590-\u08ac]/;function L3e(t,e,n){let{$head:r}=e.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,o=!i,a=i==r.parent.content.size,s=t.domSelection();return s?!j3e.test(r.parent.textContent)||!s.modify?n=="left"||n=="backward"?o:a:pZ(t,e,()=>{let{focusNode:l,focusOffset:c,anchorNode:u,anchorOffset:d}=t.domSelectionRange(),p=s.caretBidiLevel;s.modify("move",n,"character");let h=r.depth?t.docView.domAfterPos(r.before()):t.dom,{focusNode:m,focusOffset:g}=t.domSelectionRange(),v=m&&!h.contains(m.nodeType==1?m:m.parentNode)||l==m&&c==g;try{s.collapse(u,d),l&&(l!=u||c!=d)&&s.extend&&s.extend(l,c)}catch{}return p!=null&&(s.caretBidiLevel=p),v}):r.pos==r.start()||r.pos==r.end()}let N2=null,W2=null,K2=!1;function D3e(t,e,n){return N2==e&&W2==n?K2:(N2=e,W2=n,K2=n=="up"||n=="down"?F3e(t,e,n):L3e(t,e,n))}const Fi=0,q2=1,bc=2,Ho=3;class Dg{constructor(e,n,r,i){this.parent=e,this.children=n,this.dom=r,this.contentDOM=i,this.dirty=Fi,r.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,n,r){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let n=0;n<this.children.length;n++)e+=this.children[n].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let n=0,r=this.posAtStart;;n++){let i=this.children[n];if(i==e)return r;r+=i.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,n,r){if(this.contentDOM&&this.contentDOM.contains(e.nodeType==1?e:e.parentNode))if(r<0){let o,a;if(e==this.contentDOM)o=e.childNodes[n-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;o=e.previousSibling}for(;o&&!((a=o.pmViewDesc)&&a.parent==this);)o=o.previousSibling;return o?this.posBeforeChild(a)+a.size:this.posAtStart}else{let o,a;if(e==this.contentDOM)o=e.childNodes[n];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;o=e.nextSibling}for(;o&&!((a=o.pmViewDesc)&&a.parent==this);)o=o.nextSibling;return o?this.posBeforeChild(a):this.posAtEnd}let i;if(e==this.dom&&this.contentDOM)i=n>On(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))i=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(n==0)for(let o=e;;o=o.parentNode){if(o==this.dom){i=!1;break}if(o.previousSibling)break}if(i==null&&n==e.childNodes.length)for(let o=e;;o=o.parentNode){if(o==this.dom){i=!0;break}if(o.nextSibling)break}}return i??r>0?this.posAtEnd:this.posAtStart}nearestDesc(e,n=!1){for(let r=!0,i=e;i;i=i.parentNode){let o=this.getDesc(i),a;if(o&&(!n||o.node))if(r&&(a=o.nodeDOM)&&!(a.nodeType==1?a.contains(e.nodeType==1?e:e.parentNode):a==e))r=!1;else return o}}getDesc(e){let n=e.pmViewDesc;for(let r=n;r;r=r.parent)if(r==this)return n}posFromDOM(e,n,r){for(let i=e;i;i=i.parentNode){let o=this.getDesc(i);if(o)return o.localPosFromDOM(e,n,r)}return-1}descAt(e){for(let n=0,r=0;n<this.children.length;n++){let i=this.children[n],o=r+i.size;if(r==e&&o!=r){for(;!i.border&&i.children.length;)for(let a=0;a<i.children.length;a++){let s=i.children[a];if(s.size){i=s;break}}return i}if(e<o)return i.descAt(e-r-i.border);r=o}}domFromPos(e,n){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let r=0,i=0;for(let o=0;r<this.children.length;r++){let a=this.children[r],s=o+a.size;if(s>e||a instanceof mZ){i=e-o;break}o=s}if(i)return this.children[r].domFromPos(i-this.children[r].border,n);for(let o;r&&!(o=this.children[r-1]).size&&o instanceof hZ&&o.side>=0;r--);if(n<=0){let o,a=!0;for(;o=r?this.children[r-1]:null,!(!o||o.dom.parentNode==this.contentDOM);r--,a=!1);return o&&n&&a&&!o.border&&!o.domAtom?o.domFromPos(o.size,n):{node:this.contentDOM,offset:o?On(o.dom)+1:0}}else{let o,a=!0;for(;o=r<this.children.length?this.children[r]:null,!(!o||o.dom.parentNode==this.contentDOM);r++,a=!1);return o&&a&&!o.border&&!o.domAtom?o.domFromPos(0,n):{node:this.contentDOM,offset:o?On(o.dom):this.contentDOM.childNodes.length}}}parseRange(e,n,r=0){if(this.children.length==0)return{node:this.contentDOM,from:e,to:n,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let i=-1,o=-1;for(let a=r,s=0;;s++){let l=this.children[s],c=a+l.size;if(i==-1&&e<=c){let u=a+l.border;if(e>=u&&n<=c-l.border&&l.node&&l.contentDOM&&this.contentDOM.contains(l.contentDOM))return l.parseRange(e,n,u);e=a;for(let d=s;d>0;d--){let p=this.children[d-1];if(p.size&&p.dom.parentNode==this.contentDOM&&!p.emptyChildAt(1)){i=On(p.dom)+1;break}e-=p.size}i==-1&&(i=0)}if(i>-1&&(c>n||s==this.children.length-1)){n=c;for(let u=s+1;u<this.children.length;u++){let d=this.children[u];if(d.size&&d.dom.parentNode==this.contentDOM&&!d.emptyChildAt(-1)){o=On(d.dom);break}n+=d.size}o==-1&&(o=this.contentDOM.childNodes.length);break}a=c}return{node:this.contentDOM,from:e,to:n,fromOffset:i,toOffset:o}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let n=this.children[e<0?0:this.children.length-1];return n.size==0||n.emptyChildAt(e)}domAfterPos(e){let{node:n,offset:r}=this.domFromPos(e,0);if(n.nodeType!=1||r==n.childNodes.length)throw new RangeError("No node after pos "+e);return n.childNodes[r]}setSelection(e,n,r,i=!1){let o=Math.min(e,n),a=Math.max(e,n);for(let h=0,m=0;h<this.children.length;h++){let g=this.children[h],v=m+g.size;if(o>m&&a<v)return g.setSelection(e-m-g.border,n-m-g.border,r,i);m=v}let s=this.domFromPos(e,e?-1:1),l=n==e?s:this.domFromPos(n,n?-1:1),c=r.root.getSelection(),u=r.domSelectionRange(),d=!1;if((co||wr)&&e==n){let{node:h,offset:m}=s;if(h.nodeType==3){if(d=!!(m&&h.nodeValue[m-1]==`