1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7174],{98580:function(e,t){"use strict";t.Z={src:"/_next/static/media/Title-with-2-Column-Image-Left.a898abf9.svg",height:47,width:92,blurWidth:0,blurHeight:0}},23831:function(e,t){"use strict";t.Z={src:"/_next/static/media/Title-with-3-boxes.8a28c3c6.svg",height:49,width:91,blurWidth:0,blurHeight:0}},25537:function(e,t){"use strict";t.Z={src:"/_next/static/media/Title-with-3-images.172b44a3.svg",height:69,width:92,blurWidth:0,blurHeight:0}},83947:function(e,t){"use strict";t.Z={src:"/_next/static/media/Title-with-Bullets.066ad97e.svg",height:55,width:92,blurWidth:0,blurHeight:0}},4495:function(e,t){"use strict";t.Z={src:"/_next/static/media/Title-with-text.2a88d207.svg",height:45,width:92,blurWidth:0,blurHeight:0}},20396:function(e,t){"use strict";t.Z={src:"/_next/static/media/Title-with-timeline.5a8d1065.svg",height:63,width:91,blurWidth:0,blurHeight:0}},90763:function(e,t,n){"use strict";n.d(t,{l:function(){return d}});var r=n(52322),o=n(38035),i=n(28535),a=n(77533),l=n(94523),s=n(5879);n(2784);let d=e=>{let{createdByName:t,createdByProfileImageUrl:n,createdByYou:d,timestampDescription:c}=e;return(0,r.jsxs)(o.k,{align:"center",children:[(0,r.jsx)(l.Vw,{size:"xs",fontSize:"xs",name:t,src:n,tooltipProps:{placement:"top"}}),(0,r.jsxs)(i.xu,{ml:2,mr:2,w:"100%",children:[(0,r.jsx)(a.x,{noOfLines:1,fontSize:"xs",w:"100%",wordBreak:"break-all",children:d?(0,r.jsx)(s.cC,{id:"WZTg05"}):(0,r.jsx)(s.cC,{id:"pS1F3d",values:{createdByName:t}})}),c&&(0,r.jsx)(a.x,{noOfLines:1,fontSize:"11px",color:"gray.400",children:c})]})]})}},51456:function(e,t,n){"use strict";n.d(t,{G:function(){return a}});var r=n(52322),o=n(69251),i=n(25925);n(2784);let a=e=>{let{children:t,...n}=e;return(0,r.jsx)(o.r,{templateColumns:{base:"repeat(1, 1fr)",sm:"repeat(2, 1fr)",md:"repeat(2, 1fr)",lg:"repeat(3, 1fr)",xl:"repeat(4, 1fr)","2xl":"repeat(5, 1fr)"},gap:6,...n,children:(0,r.jsx)(i.M,{children:t})})}},14223:function(e,t,n){"use strict";n.d(t,{Gd:function(){return r.G},F7:function(){return F},Ot:function(){return H},_6:function(){return D}});var r=n(51456),o=n(52322),i=n(11881),a=n(29117),l=n(75009),s=n(93274),d=n(30523),c=n(38035),u=n(82729),p=n(28535),m=n(77533),h=n(36474),g=n(94523),f=n(87254),x=n(2784),v=n(48832),b=n(90221),y=n(93441),C=n(20678),w=n(90763),k=n(26284),j=n(70065),S=n(55478),A=n(10625),I=n(67046),E=n(32899),z=n(332),T=n(99058),N=n(27599),M=n(25481),_=n(42946),L=n(54933),P=n(49929),R=n(5879);let H=e=>{let{href:t,title:n,createdByName:r,createdByEmail:i,createdTime:a,isDuplicateEnabled:l,isRenameEnabled:s,isShareEnabled:d,isTrashed:c,isFavorited:u,isTrashAndRestoreEnabled:h,isRemoveFromChannelEnabled:f,onDuplicate:x,onFavorite:b,onUnfavorite:y,onTrash:C,onPermanentDelete:w,onRestore:H,onShareClick:D,onRename:O,onRemoveFromChannel:B}=e,{onCopy:F}=(0,k.V)("".concat(window.location.origin).concat(t)),W=(0,j.p)(),{isOpen:G,onOpen:U,onClose:V}=(0,S.q)();return(0,o.jsxs)(A.v,{isLazy:!0,closeOnSelect:!1,children:[(0,o.jsx)(I.j,{"data-dashboard-doc-menu":!0,as:E.h,size:"xs",variant:"ghost",borderRadius:"full",onClick:U,icon:(0,o.jsx)(P.G,{fixedWidth:!0,icon:_.cNd}),color:"gray.400",_hover:{color:"gray.800",bg:"gray.200"},children:(0,o.jsx)(R.cC,{id:"7L01XJ"})}),G&&(0,o.jsx)(z.h,{children:(0,o.jsxs)(T.q,{maxW:"sm",zIndex:"overlay",children:[(0,o.jsxs)(p.xu,{px:4,py:0,wordBreak:"break-word",children:[(0,o.jsx)(m.x,{children:n}),(0,o.jsx)(m.x,{fontSize:"sm",color:"gray.500",noOfLines:1,children:(0,o.jsx)(R.cC,{id:"MXSt4t",values:{0:(0,v.p6)(a,"MMMM do, yyyy")}})}),i&&r&&(0,o.jsx)(g.kH,{label:i,children:(0,o.jsx)(m.x,{display:"inline-block",fontSize:"sm",color:"gray.500",noOfLines:1,children:(0,o.jsx)(R.cC,{id:"Wpe4mQ",values:{createdByName:r}})})})]}),(d||s||f)&&(0,o.jsx)(N.R,{}),f&&(0,o.jsx)(M.s,{onClick:B,icon:(0,o.jsx)(P.G,{fixedWidth:!0,icon:_.gPx}),children:(0,o.jsx)(R.cC,{id:"bv+Frh"})}),d&&(0,o.jsx)(M.s,{onClick:D,icon:(0,o.jsx)(P.G,{fixedWidth:!0,icon:_.zBy}),children:(0,o.jsx)(R.cC,{id:"iyga2M"})}),s&&(0,o.jsx)(M.s,{onClick:O,icon:(0,o.jsx)(P.G,{fixedWidth:!0,icon:_.aJJ}),children:(0,o.jsx)(R.cC,{id:"Cg4Iup"})}),(0,o.jsx)(N.R,{}),b?u?(0,o.jsx)(M.s,{icon:(0,o.jsx)(p.xu,{color:"yellow.400",children:(0,o.jsx)(P.G,{fixedWidth:!0,icon:L.Tab})}),onClick:y,children:(0,o.jsx)(R.cC,{id:"T/pF0Z"})}):(0,o.jsx)(M.s,{icon:(0,o.jsx)(P.G,{fixedWidth:!0,icon:_.Tab}),onClick:b,children:(0,o.jsx)(R.cC,{id:"pBsoKL"})}):null,l&&!!x&&(0,o.jsx)(M.s,{icon:(0,o.jsx)(P.G,{fixedWidth:!0,icon:_.WM4}),onClick:x,children:(0,o.jsx)(R.cC,{id:"euc6Ns"})}),(0,o.jsx)(M.s,{icon:(0,o.jsx)(P.G,{fixedWidth:!0,icon:_.tFX}),onClick:()=>{F(),W({title:(0,o.jsx)(R.cC,{id:"h5GS+N"}),status:"success",duration:3e3,position:"top"})},children:(0,o.jsx)(R.cC,{id:"y1eoq1"})}),h&&(0,o.jsx)(N.R,{}),h?c?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(M.s,{icon:(0,o.jsx)(P.G,{fixedWidth:!0,icon:L.XnX}),onClick:H,children:(0,o.jsx)(R.cC,{id:"yKu/3Y"})}),w&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(N.R,{}),(0,o.jsx)(M.s,{color:"red",icon:(0,o.jsx)(P.G,{fixedWidth:!0,icon:_.WA2}),onClick:w,children:(0,o.jsx)(R.cC,{id:"0Lbaux"})})]})]}):(0,o.jsx)(M.s,{color:"red",icon:(0,o.jsx)(P.G,{fixedWidth:!0,icon:_.XAH}),onClick:()=>{V(),null==C||C()},children:(0,o.jsx)(R.cC,{id:"1C/Yjq"})}):null]})})]})},D=e=>{let{isFavorited:t,onFavorite:n,onUnfavorite:r,...i}=e,[a,l]=(0,x.useState)(!1),s=(0,x.useCallback)(()=>
1{if(!n||!r){console.error("[FavoriteButton] onFavorite or onUnfavorite is not defined");return}t?(l(!1),r()):(l(!0),setTimeout(()=>{l(!1)},1e3),n())},[n,r]);return(0,o.jsx)(g.kH,{label:t?(0,o.jsx)(R.cC,{id:"T/pF0Z"}):(0,o.jsx)(R.cC,{id:"pBsoKL"}),placement:"top",children:(0,o.jsx)(E.h,{...i,zIndex:"1","data-favorite-button":!0,"aria-label":f.ag._({id:"pBsoKL"}),className:"star-wrapper ".concat(a?"active":""),onClick:s,variant:"ghost",size:"xs",color:t?"yellow.400":"gray.400",_hover:{color:t?"yellow.500":"gray.400",bg:t?void 0:"blackAlpha.100"},bg:t?"yellow.50":"transparent",borderRadius:"full",icon:(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(P.G,{icon:t?L.Tab:_.Tab}),(0,o.jsxs)(p.xu,{fontSize:"2.5px",children:[(0,o.jsxs)("div",{className:"star",children:[(0,o.jsx)("div",{className:"tl"}),(0,o.jsx)("div",{className:"tr"}),(0,o.jsx)("div",{className:"bl"}),(0,o.jsx)("div",{className:"br"})]}),(0,o.jsx)("div",{className:"ring"}),(0,o.jsx)("div",{className:"circles"})]})]})})})},O=e=>{let{href:t,NextLink:n,target:r,children:a}=e;return n?(0,o.jsx)(n,{href:t,passHref:!0,target:r,legacyBehavior:!0,children:(0,o.jsx)(i.A,{outline:"none",children:a})}):(0,o.jsx)(i.A,{outline:"none",href:t,target:r,children:a})},B=e=>{let{cardThumbnails:t,hoveredIndex:n}=e;return(0,o.jsx)(a.U,{justifyContent:"flex-start",alignItems:"top",w:"100%",position:"absolute",zIndex:2,top:0,spacing:0,children:t.map((e,t)=>(0,o.jsx)(l.E,{className:"thumbnail-scrubber",src:e.previewUrl,fit:"cover",position:"absolute",left:0,pointerEvents:"none",transform:"translate(calc(calc(".concat(t," * 100%) - ").concat(n," * 100%),0px)")},e.id))})},F=x.forwardRef((e,t)=>{let{id:n,title:r,thumbnailImageUrl:a,NextLink:k,href:j,createdByYou:S=!1,createdByName:A,createdByEmail:I,createdTime:E,createdByProfileImageUrl:z,timestampDescription:T,editors:N,isDuplicateEnabled:M=!0,isRenameEnabled:_=!1,isShareEnabled:L=!1,isTrashAndRestoreEnabled:P=!0,isRemoveFromChannelEnabled:R=!1,isTrashed:F=!1,isFavorited:W=!1,onDuplicate:G,onFavorite:U,onUnfavorite:V,onTrash:q,onPermanentDelete:$,onRestore:K,onShareClick:Z,onRename:Y,onRemoveFromChannel:X,cardThumbnails:J,context:Q="grid",tags:ee=[],menuEnabled:et=!1,openInNewWindow:en=!1,activity:er,...eo}=e,ei=(0,y.gF)(),ea=en?"_blank":void 0,el=N&&N.length>0&&(0,o.jsx)(s.H,{size:"xs",max:5,fontSize:"xs",children:N.map(e=>(0,o.jsx)(g.Vw,{shadow:"md",borderWidth:"1px",name:ei?f.ag._({id:"bxVoEp",values:{0:e.user.displayName,1:(0,v.Km)(e.lastEdited)}}):" ",src:e.user.profileImageUrl,tooltipProps:{placement:"top"}},"".concat(n,"-").concat(e.user.id)))}),[es,ed]=(0,x.useState)(0),ec=(0,x.useCallback)(e=>{if(!J)return;let t=e.currentTarget.getBoundingClientRect(),n=e.pageX-t.left,r=n/t.width,o=Math.floor(J.length*r);ed(o)},[J]);return(0,o.jsx)(i.f,{overflow:"hidden",ref:t,"data-doc-grid-item-id":n,bg:"linen.50",borderRadius:"5px",shadow:"md",as:d.P,_focusWithin:{shadow:"outline",_hover:{shadow:"outline"}},cursor:"pointer",_hover:{shadow:"lg",bgColor:"popover"===Q?"white":"gray.100"},transition:"box-shadow .2s ease",role:"group",onMouseMove:ec,className:"highlight-mask",...eo,children:(0,o.jsxs)(c.k,{direction:"column",wordBreak:"break-word",alignContent:"space-between",height:"100%",children:[a&&(0,o.jsx)(O,{NextLink:k,href:j,target:ea,children:(0,o.jsx)(u.o,{ratio:40/21,bgColor:"gray.100",children:(0,o.jsxs)(c.k,{borderBottomWidth:"1px",borderBottomColor:"gray.100",children:[(0,o.jsx)(B,{cardThumbnails:J||[],hoveredIndex:es}),(0,o.jsx)(l.E,{src:null==a?void 0:a.src,fallbackSrc:null==a?void 0:a.fallbackSrc,fit:"cover"}),!!el&&(0,o.jsx)(p.xu,{position:"absolute",right:0,bottom:0,borderRadius:"full",p:3,zIndex:1,children:el})]})})}),(0,o.jsxs)(c.k,{p:3,position:"relative",direction:"column",justifyContent:"space-between",h:"100%",alignItems:"flex-start",children:[(0,o.jsx)(O,{NextLink:k,href:j,target:ea,children:(0,o.jsx)(m.x,{noOfLines:2,h:12,mb:2,children:(0,C.$)(r)})}),(0,o.jsxs)(c.k,{direction:"column",w:"100%",children:[ee&&ee.length>0&&k&&(0,o.jsx)(g.MY,{tags:ee,NextLink:k,overflowButtonLabel:"See all folders"}),(0,o.jsxs)(c.k,{mt:2,align:"flex-start",w:"100%",justify:"space-between",children:[er&&er,A&&(0,o.jsx)(w.l,{createdByYou:S,createdByName:A,createdByProfileImageUrl:z,timestampDescription:T}),(0,o.jsx)(h.L,{}),et&&(0,o.jsx)(H,{href:j,title:(0,C.$)(r),createdByName:A,createdByEmail
1:I,createdTime:E,isDuplicateEnabled:M,isRenameEnabled:_,isShareEnabled:L,isTrashAndRestoreEnabled:P,isRemoveFromChannelEnabled:R,isTrashed:F,isFavorited:W,onDuplicate:G,onFavorite:U,onUnfavorite:V,onTrash:q,onPermanentDelete:$,onRestore:K,onShareClick:Z,onRename:Y,onRemoveFromChannel:X})]})]})]}),!!U&&!!V&&(0,o.jsx)(p.xu,{position:"absolute",top:3,right:3,zIndex:3,children:(0,o.jsx)(D,{isFavorited:W,onFavorite:U,onUnfavorite:V,opacity:W?1:(0,b.s2)()?1:0,_groupHover:(0,b.s2)()?void 0:{opacity:1},_focus:{opacity:1,shadow:"outline"}})})]})},n)});F.displayName="DocumentGridItem"},18816:function(e,t,n){"use strict";n.d(t,{w:function(){return m}});var r=n(52322),o=n(7344),i=n(28535),a=n(29117),l=n(38045),s=n(2784),d=n(63367),c=n(62614),u=n(94523);let p=(0,s.forwardRef)((e,t)=>{var n;let{children:i,size:a="md",disabled:l=!1,tooltip:s,...p}=e,m=(0,o.X)(),h=m.value===p.value,{getCheckboxProps:g,getInputProps:f}=(0,d.x)({...p,isChecked:h,onChange:m.onChange,name:null!==(n=m.name)&&void 0!==n?n:p.name}),{...x}=g(),v=f(),b=(0,r.jsxs)(c.z,{boxShadow:"none",bg:"transparent",as:"label",borderColor:"transparent",borderX:"none",size:a,disabled:l,style:{marginLeft:0,marginInlineStart:0},_hover:{bg:l?"transparent":"trueblue.50",cursor:l?"default":"pointer"},_first:{borderTopLeftRadius:"md",borderBottomLeftRadius:"md"},_last:{borderTopRightRadius:"md",borderBottomRightRadius:"md"},_checked:{bg:"transparent",color:"trueblue.500"},radioGroup:"orientation",...x,ref:t,children:[(0,r.jsx)("input",{...v,disabled:l,hidden:!0}),i]});return s?(0,r.jsx)(u.kH,{...s,children:b}):b}),m=e=>{let{options:t,onChange:n,size:d,disabled:c=!1,value:u,...m}=e,h=(0,s.useRef)({}),[g,f]=(0,s.useState)({left:0,top:0,width:0,height:0});return(0,s.useEffect)(()=>{var e;let t=u?null===(e=h.current[u])||void 0===e?void 0:e.current:void 0;if(!t){f(e=>({left:e.left+e.width/2,top:e.top+e.height/2,width:0,height:0}));return}f({left:t.offsetLeft,top:t.offsetTop,width:t.offsetWidth,height:t.offsetHeight})},[u,d]),(0,r.jsxs)(o.E,{bg:"gray.200",pos:"relative",p:.5,borderRadius:"md",onChange:function(e){n(e)},value:u,boxSizing:"border-box",...m,children:[(0,r.jsx)(i.xu,{as:l.E.div,pos:"absolute",zIndex:50,bg:c?"gray.100":"gradient.light",height:"100%",borderRadius:"md",m:.5,animate:{left:"".concat(g.left,"px"),top:"".concat(g.top,"px"),width:"".concat(g.width,"px"),height:"".concat(g.height,"px")}}),(0,r.jsx)(a.U,{zIndex:90,pos:"relative",children:t.map(e=>{var t;return(0,r.jsx)(p,{value:e.value,ref:(t=e.value,h.current[t]||(h.current[t]={current:null}),h.current[t]),size:d,disabled:c,tooltip:e.tooltip,children:e.component},e.value)})})]})}},79758:function(e,t,n){"use strict";n.d(t,{B:function(){return r}});class r{constructor({key:e,description:t,classifyExamples:n,classifyReply:r,checkEnabled:o}){this.key=e,this.description=t,this.classifyExamples=n,this.classifyReply=r,this.checkEnabled=o}}},31151:function(e,t,n){"use strict";n.d(t,{$D:function(){return i},An:function(){return o},Iy:function(){return l},ME:function(){return a},Og:function(){return r},eo:function(){return s}});class r extends Error{constructor(e,t={}){super(e),this.opts=t}}r.prototype.name="DesignPartnerError";class o extends r{constructor(e,t={}){super(e,t)}}o.prototype.name="CouldNotApplySuggestionError";class i extends r{constructor(e,t={}){super(e,t)}}i.prototype.name="InvalidResponseError";class a extends r{constructor(e,t={}){super(e,t)}}a.prototype.name="NoopSuggestionError";class l extends r{constructor(e,t={}){super("InputTooLongError: ".concat(e),t)}}l.prototype.name="InputTooLongError";class s extends r{constructor(e,t={}){super("ParsedSuggestionError: ".concat(e),t)}}a.prototype.name="ParsedSuggestionError"},5029:function(e,t,n){"use strict";n.d(t,{O:function(){return c}});var r=n(9850),o=n.n(r),i=n(27191),a=n(74684),l=n(11093),s=n(91073),d=n(83194);class c{isApplied(e){let t=e.state.tr,n=null;try{n=this.transact(e,t,!1)}catch(e){return console.error("[isModificationActive] Could not transact modificatioon, returning false",e.message),!1}if(!n)return!1;let r=(0,d.m$)(e,this.rangeId);if(!r)return!1;try{let o=e.state.doc.slice(r.from,r.to),i=t.doc.slice(r.from,r.to),a=n.from===r.from&&n.to===r.to;return o.eq(i)&&a}catch(e){}return!1}getPreviewJson(e){let t=e.state.tr;this.transact(e,t);let n=this.getParentCardId(e,t),r=o()(t.doc.toJSON());return(0,d.Y0)(r,n)}getParentCardId(e,t){let n=(0,d.m$)(e,this.rangeId);if(!n)return null;let r=t.doc.resolve(n.from),o=(0,l.Ru)(r,s.KH)[0];if(!o)return null;let i=o.node.attrs.id;return i||null}apply(e){let t=e.state.tr;this.transact(e,t);let n=(0,d.m$)(e,this.rangeId);console.debug("[ReplaceContentModification] Applying modification",{modification:this,range:n}),e.view.dispatch(t);let r=this.getParentCardId(e,t);(0,a.YS)({editor:e,cardId:r})}transact(e,t){let n=!(arguments.length>2)||void 0===arguments[2]||arguments[2],r=(0,d.m$)(e,this.rangeId);if(!r)return null;let{state:o}=e;
1t.replace(r.from,r.to,this.slice).setMeta("applyingAiModification",{rangeId:this.rangeId});let a=t.mapping.map(r.to),l={from:r.from,to:a};if(n){if(o.selection.empty)return t.setSelection(i.Y1.near(t.doc.resolve(r.from))),l;if(o.selection instanceof i.qv)return t.setSelection(i.qv.create(t.doc,r.from)),l;let e=i.Bs.between(t.doc.resolve(r.from),t.doc.resolve(a));t.setSelection(e)}return l}getContentForTracking(){return this.content}constructor(e,t){this.type="replace-content",this.description=t.description,this.rangeId=t.rangeId,this.content=t.content,this.slice=(0,d.Fr)(e,t.content)}}},83194:function(e,t,n){"use strict";n.d(t,{C$:function(){return s},Fr:function(){return l},Y0:function(){return a},m$:function(){return d}});var r=n(30764),o=n(8445),i=n(3402);let a=(e,t)=>{if(!e.content||!e.content[0].content)return null;let n=e.content[0].content.find(e=>e.attrs&&e.attrs.id===t);return n?(e.content[0].content=[n],e):null},l=(e,t)=>{let n=null;if("html"===t.type){let r=(0,i.T)(t.html,e.schema);n=r.slice}else if("json"===t.type){let o=r.HY.fromJSON(e.schema,t.json);n=new r.p2(o,0,0)}else throw Error("Unsupported Modification content type ".concat(t.type));return n},s=(e,t,n)=>{var r,i;let a=o.i.getState(e.state);if(!a)return t;let l=(null==a?void 0:a.getExistingRangeId(e.state,n))||null;return l||(null===(r=(i=e.commands).setInteractionRange)||void 0===r||r.call(i,t,n),t)},d=(e,t)=>{let n=o.i.getState(e.state);return(null==n?void 0:n.getRange(e.state,t))||null}},81087:function(e,t,n){"use strict";n.d(t,{$V:function(){return x},az:function(){return h},w6:function(){return g}});var r=n(87254),o=n(79758),i=n(36528),a=n(54691),l=n(28667),s=n(19585),d=n(31151),c=n(5029),u=n(83194),p=n(93934),m=n(64488);let h=()=>
1r.ag._({id:"HNDdbS"});class g extends o.B{async getResponseMessages(e){let{editor:t,context:n,rangeId:o,response:{raw:i,suggestion:a,message:s}}=e;if(!a)throw new d.$D("[SuggestContentTask] No html provided in prompt response",{chatMessage:s,inputMessage:n.message,resp:i,interactionId:n.interactionId});let u=await (0,l.T)(a,{loadImages:!0});console.debug("[AIChat SuggestContentTask] modify suggestion",{transformedHtml:u,html:a});let p=new c.O(t,{description:r.ag._({id:"nyQWMb"}),content:{type:"html",html:u},rangeId:o}),m={label:r.ag._({id:"nyQWMb"}),modification:p,jsonContentPreview:p.getPreviewJson(t)},h=this.getOriginalModifyContentSuggestion(t,n,o),g={from:"Designer",type:"suggestContent",resp:i,message:s||r.ag._({id:"pMSbe+"}),suggestions:[m,h],interactionId:n.interactionId};return{messages:[g],suggestionToApply:m}}async runPrompt(e){let{input:t,context:n,variables:r,trackFns:o,retries:i=2}=e,l=await (0,a.I)(t,n.interactionId,{timeout:s.VH.get("aiRequestTimeouts").suggestContent});if(!l)throw new d.$D("Couldn't get response from prompt",{resp:l,inputMessage:n.message,interactionId:n.interactionId});let c=this.parseResponse(l,r);if(c.shouldRetry){if(i<=0)throw new d.eo("Could not parse response properly after retries",{chatMessage:h(),inputMessage:n.message,resp:l,interactionId:n.interactionId});return o.trackRequestRetry({interactionId:n.interactionId,retriesRemaining:i,resp:l}),this.runPrompt({input:t,context:n,retries:i-1,trackFns:o,variables:r})}return{parsed:c,resp:l}}async run(e){let{editor:t,context:n,addMessage:r,history:o,trackFns:a,themeModificationController:l,provider:s}=e,{html:d,range:c}=this.determineTaskTarget(n.editorContext);a.trackInputContent({taskContext:n,inputContent:d});let p={message:n.message,html:d,outline:n.editorContext.outline},h=(0,u.C$)(t,n.interactionId,c),g=(0,m.x)(o||[]),f=this.prompt.prepare({variables:p,history:g,interactionId:n.interactionId,params:{provider:s}});console.debug("[AIChat SuggestContentTask] run",{html:p.html,input:f,suggestHistory:g,range:(0,u.m$)(t,h)});let x=await (0,i.oO)(f),{parsed:v,resp:b}=await this.runPrompt({input:x,context:n,variables:p,trackFns:a,retries:1}),{messages:y,suggestionToApply:C}=await this.getResponseMessages({editor:t,context:n,rangeId:h,response:v,themeModificationController:l});console.debug("[AIChat SuggestContentTask] completed",{suggestion:v.suggestion,resp:b,parsed:v,messages:y,suggestionToApply:C}),this.autoApplySuggestion({context:n,editor:t,suggestionToApply:C,resp:b,trackFns:a,themeModificationController:l}),y.forEach(e=>r(e)),a.trackRequestComplete({taskContext:n,outputMessage:v.message,outputContent:v.suggestion,resp:b})}determineTaskTarget(e){return this.getTaskTarget?this.getTaskTarget(e):e.defaultRange}getOriginalModifyContentSuggestion(e,t,n){let o=new c.O(e,{description:r.ag._({id:"HxF6Fk"}),content:{type:"html",html:this.determineTaskTarget(t.editorContext).html},rangeId:n});return{label:r.ag._({id:"HxF6Fk"}),modification:o,jsonContentPreview:o.getPreviewJson(e)}}autoApplySuggestion(e){let{context:t,editor:n,suggestionToApply:r,resp:o,trackFns:i,themeModificationController:a}=e;if(r){if(r.modification.isApplied(n,a))throw console.debug("[SuggestContentTask] suggestion does not change the content",r),new d.ME("Suggestion does not change content",{resp:o,interactionId:t.interactionId,chatMessage:h()});try{let{modification:e}=r;e.apply(n,a),i.trackSuggestionApplied({interactionId:t.interactionId,suggestionContent:e.getContentForTracking(),suggestionLabel:e.description,suggestionType:e.type,autoApplied:!0})}catch(e){throw new d.An("Could not apply suggestion",{interactionId:t.interactionId})}}}constructor(e){super(e),this.prompt=e.prompt,this.parseResponse=e.parseResponse||x,this.getTaskTarget=e.getTaskTarget}}let f=RegExp("(.*?)```[A-Za-z]*\\n(.*?)\\n```(.*?)$","ims"),x=e=>{let t;let n=e.match(f),r=[];if(n)r=[n[1],n[3]],t=n[2];else{let n=e.split("```");if(0===n.length)throw Error("Could not extract code from response");if(1===n.length)return(0,p.y)(n[0])?{suggestion:void 0,raw:e,message:e,shouldRetry:!0}:{suggestion:void 0,raw:e,message:e.replaceAll(/(HTML|code)/gi,"content")};r=[n[0]],t=n[1].trim()}let o=r.map(e=>e.trim()).filter(e=>e.length>0).join("\n\n").replaceAll(/(HTML|code)/gi,"content").replaceAll(/(slide)/gi,"card");return{suggestion:t,message:o,raw:e}}},81136:function(e,t,n){"use strict";n.d(t,{L:function(){return a},a:function(){return l}});var r=n(21156),o=n(93202),i=n(81087);let a=new r.V({systemPromptOperation:o.Run.ChangeContentLayoutSystem,userPromptOperation:o.Run.ChangeContentLayoutUser,variables:["html","message"],params:{temperature:.7,maxTokens:1e3}}),l=new i.w6({key:"CHANGE_LAYOUT",description:"Change the display of information to use a different layout (like timeline, bullets, boxes, columns, table) or rearrange elements within a layout",classifyExamples:["turn this into a table","make each bullet into a box","could you split this into columns?","make this a timeline","could you make this more visual?","visualize this as a timeline"],classifyReply:"Sure, I'll start reformatting this as a table...",getTaskTarget:e=>"selectionRange"!==e.selectedDefaultRange?e.defaultRange:0===e.selectionRange.html.trim().length?e.cardContent:e.blockRange,prompt:a})},93934:function(e,t,n){"use strict";n.d(t,{y:function(){return r}});let r=e=>{let t=new DOMParser().parseFromString(e,"text/html");return Array.from(t.body.childNodes).some(e=>1===e.nodeType)}},64488:function(e,t,n){"use strict";n.d(t,{x:function(){return r}});let r=e=>{let t=e.slice(-7).map(e=>"User"===e.from?{role:"user",content:e.message}:e.isClassification?{role:"assistant",content:e.message}:e.resp?{role:"assistant",content:e.resp}:null).filter(e=>!!(null==e?void 0:e.content));return t}},36528:function(e,t,n){"use strict";n.d(t,{_j:function(){return u},oO:function(){return d},uc:function(){return l}});var r=n(31151),o=n(93202),i=n(21733);let a=e=>!l(e).some(e=>["BAD_USER_INPUT"].includes(e)),l=e=>{let t=(null==e?void 0:e.graphQLErrors)||[];return null==t?void 0:t.map(e=>e.code)},s=async e=>{let{fn:t,retries:n,backoff:r=1e3,timeout:o}=e;try{return await Promise.race([t(),new Promise((e,t)=>
1{setTimeout(()=>t(Error("Request timeout (".concat(o,"ms)"))),o)})])}catch(d){var i;let e=null===(i=d.message)||void 0===i?void 0:i.startsWith("Request timeout");e&&console.debug("[AI] Request timeout. Not retrying");let l=a(d)&&!e;if(n>0&&l)return await new Promise(e=>setTimeout(e,r)),s({fn:t,retries:n-1,backoff:2*r,timeout:o});throw d}},d=async e=>{var t;let n=await c({messages:e.messages,maxTokens:null!==(t=e.params.maxTokens)&&void 0!==t?t:null,models:["gpt-3.5-turbo","gpt-3.5-turbo-16k"]});return{...e,params:{...e.params,model:n}}},c=async e=>{var t;let{messages:n,maxTokens:i,models:a}=e,{data:l}=await (0,o.WQq)().query({query:o.yL,returnPartialData:!1,variables:{input:{messages:n,maxTokens:i,models:a}}}),s=null==l?void 0:l.canRunChatCompletion;if(!s||0===s.length)throw Error("No response received");let d=null===(t=s.find(e=>!!e.canRun))||void 0===t?void 0:t.model;if(!d)throw new r.Iy("Input too long for models: "+JSON.stringify(a));return d},u=async function(e){var t,n;let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{timeout:6e4,retries:0};return console.debug("[AI][fetchChatCompletion]",e.messages,e.params),s({fn:()=>(0,o.WQq)().mutate({mutation:o.Dan,variables:{input:{...e,workspaceId:(0,i.n_)()}}}).then(e=>{let{data:t}=e,n=null==t?void 0:t.chatCompletion;if(!n||0===n.length)throw Error("No response received");return console.debug("[AI] Got chat completion",n),t}),timeout:null!==(t=r.timeout)&&void 0!==t?t:6e4,retries:null!==(n=r.retries)&&void 0!==n?n:0})}},54691:function(e,t,n){"use strict";n.d(t,{I:function(){return i}});var r=n(19585),o=n(36528);let i=async function(e,t){var n,i;let a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},l=r.VH.get("aiRequestRetries").chat;a.retries=null!==(i=a.retries)&&void 0!==i?i:l;let s=await (0,o._j)({...e,interactionId:t},a);return null==s?void 0:null===(n=s.chatCompletion)||void 0===n?void 0:n[0].content}},6997:function(e,t,n){"use strict";n.d(t,{u:function(){return i}});var r=n(93202),o=n(89918);class i extends o.j{getSystemChatMessage(e){return{role:r.XaP.System,content:a(this.systemPrompt,e)}}getUserChatMessage(e){return{role:r.XaP.User,content:a(this.userPrompt,e)}}constructor({variables:e,systemPrompt:t,userPrompt:n,params:r}){super({params:r}),this.variables=e,this.systemPrompt=t,this.userPrompt=n}}function a(e,t){let n=e;for(let e in t)n=n.replaceAll("{{".concat(e,"}}"),t[e]);return n}},52906:function(e,t,n){"use strict";let r;n.d(t,{NV:function(){return s},Uu:function(){return d}});var o=n(66922),i=n(39877),a=n(87205);class l{getKey(e){let{query:t,provider:n,options:r}=e;return"".concat(n,"__").concat(t,"__").concat(JSON.stringify(r))}markUsed(e){this.usedImages.add(e)}isUsed(e){return this.usedImages.has(e)}async findImage(e){let t,n=!(arguments.length>1)||void 0===arguments[1]||arguments[1];await this.loadImageResults(e);let r=this.getKey(e);if(this.validImagePromises.has(r)){let n=this.validImagePromises.get(r);t=n.then(()=>this.findValidImage(e)),this.validImagePromises.set(r,t)}else t=this.findValidImage(e);return this.validImagePromises.set(r,t),t.then(e=>(e&&n&&this.markUsed(e.imageUrl),e))}async findValidImage(e){let t=this.getKey(e),n=this.results.get(t);for(let e of n){let{image:t}=e;if(!this.isUsed(t.imageUrl)&&(void 0===e.isValid&&(e.isValid=await (0,a.KI)(t.imageUrl)),e.isValid))return e.image}return null}async loadImageResults(e){let{query:t,provider:n,options:r,count:o}=e,l=this.getKey({query:t,provider:n,options:r});if(this.results.has(l))return;if(this.requestPromises.has(l)){await this.requestPromises.get(l);return}this.debugRequests.push(l);let s=(0,i.C)({query:t,count:o,options:r,provider:n}).then(e=>e.filter(e=>(0,a.VE)(e.imageUrl))).then(e=>{let t=e.map(e=>({image:e,isValid:void 0}));return this.results.set(l,t),e});this.requestPromises.set(l,s),await s}async generateImage(e,t){let n="aiGenerated__".concat(t.prompt,"__").concat(e);if(this.debugRequests.push(n),this.generateImagePromises.has(e))return this.generateImagePromises.get(e);let r=(0,o.Qz)(t);return this.generateImagePromises.set(e,r),r}debugInfo(){return{requests:this.debugRequests}}constructor(){this.usedImages=new Set,this.results=new Map,this.requestPromises=new Map,this.validImagePromises=new Map,this.debugRequests=[],this.generateImagePromises=new Map}}let s=()=>(r||(r=new l),r),d=()=>{r=new l}},6501:function(e,t,n){"use strict";n.d(t,{sj:function(){return A},Tm:function(){return T},Bv:function(){return P}});var r=n(72338),o=n(2284),i=n.n(o),a=n(30764),l=n(66922),s=n(50260),d=n(77377),c=n(26104),u=n(33169),p=n(3402),m=n(97253),h=n(13793),g=n(36651),f=n(3543),x=n(90775),v=n(1313),b=n.n(v);let y=e=>b()(e)(),C=(e,t)=>
1{let n=b()(t),r=Math.floor(n()*e.length);return e[r]};var w=n(50775),k=n(28667);let j=["gridLayout","table","gallery"],S=["imagesText","iconsText","pyramid","funnel","staircase","stats","circleStats","barStats"],A=async(e,t)=>{var n,o;let{cardIndex:i,imageOptions:a,docFormatKey:l,theme:s,loadImages:u}=t,m=await (0,k.T)(e,{imageOptions:a,removeImagesFromLayouts:!0,loadImages:!1}),h=(0,r.J1)((0,d.e)()),{content:f,dom:x}=(0,p.T)(m,h),v=null===(n=x.firstElementChild)||void 0===n?void 0:n.getAttribute("image-layout"),b=v&&c.IT.includes(v)?v:void 0,y=f.toJSON(),C=1===y.length&&"card"===y[0].type?(null===(o=y[0])||void 0===o?void 0:o.content)||[]:y,w=N(C,{cardIndex:i,docFormatKey:l,theme:s,cardLayout:b,preserveLayouts:t.preserveLayouts});return a&&"aiGenerated"===a.provider&&I(w,h),u&&await z(w,h,{docId:"unknown",workspaceId:(0,g.n_)(),...t.context}),T(w),w},I=(e,t)=>{(0,x.N)(e,e=>{if("text"===e.type)return;let n=a.NB.fromJSON(t,{type:e.type,attrs:e.attrs}),r=(0,m.XU)(n);if(!r||!r.loadImageParams)return;let{options:o}=r.loadImageParams,i="model"in o&&o.model?l.Iw[o.model].aspectRatios:l.Iw["stable-diffusion-xl-v1-0"].aspectRatios,s=E(e),{width:d,height:c}=(null==i?void 0:i[s])||l.vr,u={...r.loadImageParams,options:{...r.loadImageParams.options,width:d,height:c}};e.attrs=(0,m.j6)(n,{loadImageParams:u})})},E=e=>{let t=e.parent;if(!(null==t?void 0:t.attrs))return"square";if("smartLayoutCell"===e.type&&"imagesText"===t.attrs.variantKey)return"landscape";if("cardAccentLayoutItem"===e.type){let e=t.attrs.layout;if("left"===e||"right"===e)return"portrait";if("top"===e)return"landscape"}return"square"},z=async(e,t,n)=>{let r=[];(0,x.N)(e,async e=>{if("text"===e.type)return;let o=t.nodeFromJSON({type:e.type,attrs:e.attrs}),i=(0,m.XU)(o);if(!i)return;let{loadImageStatus:a,loadImageId:l,loadImageParams:s}=i;if("queued"!==a||!s||!l)return;let d=(0,w.B)({loadImageId:l,loadImageParams:s,context:n}).then(t=>{e.attrs=(0,m.j6)(o,t)});r.push(d)}),await Promise.all(r)},T=e=>{var t,n,r,o;let i=e.content.find(e=>"cardAccentLayoutItem"===e.type);if(!i)return;let a=i.attrs.background;if(!a)return;let l=null==a?void 0:null===(n=a.image)||void 0===n?void 0:null===(t=n.meta)||void 0===t?void 0:t.average_color,s=l&&(0,f.DP)(l);"behind"===e.attrs.layout&&(s||.5>y(e.attrs.id))&&(null!==(o=(r=e.attrs).container)&&void 0!==o||(r.container={}),e.attrs.container.background={type:h.E.COLOR,color:{hex:"#000000"}});let d=e.content.find(e=>"cardLayoutItem"===e.type);if(!d)return;let c=d.content.filter(e=>"paragraph"!==e.type||e.content);try{a.mask={effect:0===c.length?"none":"faded"}}catch(e){console.error("[caught] [fixBehindBackgroundMask]",e,"with accentBackground:",a)}},N=(e,t)=>{let n;let{cardIndex:r,docFormatKey:o,theme:a,cardLayout:l}=t,s=u.C2.generate(),d=e.filter(e=>{var t,n;return"image"===e.type&&((null===(t=e.attrs)||void 0===t?void 0:t.src)||(null===(n=e.attrs)||void 0===n?void 0:n.loadImageStatus)==="queued")})||[],c=t.preserveLayouts||e.some(t=>{var n;return j.includes(t.type)||"smartLayout"===t.type&&(null===(n=t.attrs)||void 0===n?void 0:n.variantKey)&&S.includes(t.attrs.variantKey)||"smartLayout"===t.type&&t.content&&t.content.length>3||e.length>5});d.length>0&&"blank"!==l?(n={type:h.E.IMAGE,image:d[0].attrs,source:d[0].attrs.source},i()(e,d[0])):a&&(n={...P(a,s)}),0===r&&"webpage"!==o&&e.push({type:"contributors"}),e.forEach(e=>R(e,s));let p={};"deck"===o?p=_({cardIndex:r,cardId:s,preventRandomCardLayouts:c,cardLayout:l}):"document"===o?p=L({cardIndex:r,cardId:s,preventRandomCardLayouts:c,cardLayout:l}):"webpage"===o&&(p=M({cardIndex:r,cardId:s,accentBackground:n,preventRandomCardLayouts:c,cardLayout:l,theme:a}));let m={container:{},layout:l||"blank",id:s,...p};if("left"===m.layout||"right"===m.layout){let t=!1;e.forEach(e=>{if("smartLayout"===e.type&&e.attrs){let n=e.attrs;t=!0,n.options.orientation="vertical",n.options.twoSided=!1,n.options.cellSize="lg"}}),t&&(m.layoutTemplateColumns="left"===m.layout?"25% 75%":"75% 25%")}let g={type:"cardLayoutItem",attrs:{itemId:"body"},content:e},f="blank"===m.layout?null:{type:"cardAccentLayoutItem",attrs:{itemId:"accent",background:n}};return{type:"card",attrs:m,content:f?[f,g]:[g]}},M=e=>
1{let{cardIndex:t,cardId:n,accentBackground:r,preventRandomCardLayouts:o,theme:i,cardLayout:a}=e,l={},d=i?(0,s.Wz)(i):[];return a?l.layout=a:0===t?l.layout=C(["behind","right"],n):.8>y(n)?(l.layout=o?"blank":C(["left","right","behind","blank","blank"],n),o&&"blank"===l.layout&&d.length&&.25>y(n)&&(l.container={background:{type:h.E.COLOR,color:{hex:C(d,n)}}})):(l.cardSize="contained",l.background=C([r,{type:h.E.COLOR,color:{hex:C(d,n)}}],n),l.layout="blank"),l},_=e=>{let{cardIndex:t,cardId:n,preventRandomCardLayouts:r,cardLayout:o}=e,i={};return o?i.layout=o:0!==t||r?r?i.layout="blank":i.layout=C(["left","left","right","right","behind","top","blank"],n):i.layout=C(["left","right"],n),i},L=e=>{let{cardIndex:t,preventRandomCardLayouts:n,cardId:r,cardLayout:o}=e,i={};return o?i.layout=o:0===t?(i.cardSize="full",i.layout="behind"):n?i.layout="blank":i.layout=C(["blank","blank","blank","blank","right","left"],r),i},P=(e,t)=>C(e.config.accentBackgrounds||[],t),R=(e,t)=>{if("smartLayout"!==e.type||!e.attrs||!e.content)return;let n=e.attrs.variantKey;if("numbers"===n){var r;let n=null===(r=e.content)||void 0===r?void 0:r.map(e=>{var t;return null===(t=e.attrs)||void 0===t?void 0:t.label});(null==n?void 0:n.every(e=>e.endsWith("%")))&&(e.attrs.variantKey=C(["barStats","circleStats"],t))}e.content.length>4&&(e.attrs.options.orientation="vertical")}},65365:function(e,t,n){"use strict";n.d(t,{L:function(){return r}});let r="ai-parsed-attrs"},50775:function(e,t,n){"use strict";n.d(t,{B:function(){return u},Z:function(){return c}});var r=n(31490),o=n(52906),i=n(66922),a=n(61185),l=n(16494),s=n(50279),d=n(80236);let c=e=>{let{query:t,provider:n,license:r,model:o}=e;if(!t)return{loadImageStatus:"error"};"aiGenerated"!==n&&(t=t.split(", ")[0]);let i={provider:n,query:t,options:"aiGenerated"===n?{model:o}:{license:r}};return{loadImageParams:i,loadImageStatus:"queued",loadImageId:(0,d.G)()}},u=async e=>{let{loadImageId:t,loadImageParams:n,context:d,markUsed:c=!0}=e,{provider:u,query:p,options:m}=n,{interactionId:h,...g}=d;try{if("aiGenerated"===u){let e={...m,interactionId:h||(0,r.nZ)(),steps:30,...g,prompt:p,count:1};e.model!==i.NF&&(e.fallbackModel=i.NF);let n=await (0,o.NV)().generateImage(t,e);if(!n[0])return{loadImageStatus:"error"};return{...n[0].attrs,tempUrl:null,loadImageStatus:"done",uploadStatus:l.D.Queued}}{let e=await (0,o.NV)().findImage({query:p,provider:n.provider,options:n.options},c);if(!e)return{query:p,source:a.Q[u],loadImageStatus:"error"};let t={...(0,s.C)(e,p,u),loadImageStatus:"done",uploadStatus:l.D.Queued};return t}}catch(e){return console.error("[AIStream] An error occurred while fetching image: ".concat(e.message),e.stack),{loadImageStatus:"error"}}}},42505:function(e,t,n){"use strict";n.d(t,{JZ:function(){return p},eM:function(){return h},g1:function(){return u},tf:function(){return m}});var r=n(72338),o=n(6501),i=n(2090),a=n(16494),l=n(96255),s=n(97253),d=n(50775);let c=async e=>{let{editor:t,chain:n,node:r,imageAttrs:o,pos:l}=e;n.updateAttributesAtPos(l,(0,s.j6)(r,{uploadStatus:a.D.Uploading}));let{tempUrl:d,src:c}=o;(0,i.WY)(c,t.storage.mediaUpload.orgId,{onUploadComplete:e=>{(0,s.Ns)(t,d,e)},onUploadFailed:e=>{(0,s.f8)(t,d,e,!0)}})},u=async e=>{let{cardId:t,editor:n}=e;console.debug("[AIStream uploadAIImages] for cardId: ",t);let o=n.chain(),i=(0,r.N2)(n.state.doc,e=>(0,l.KH)(e)&&e.attrs.id===t)[0];if(!i){console.error("[uploadAIImages] can not find card with id: ",t);return}let d=i.pos,u=d+i.node.nodeSize;n.state.doc.descendants((e,t)=>{if(t<d||t>u)return!0;let r=(0,s.XU)(e);return!r||(r&&r.uploadStatus===a.D.Queued&&(console.debug("[AIStream processAIImages]: ".concat(e.type.name," node with AI queries at pos ").concat(t,":"),r),c({editor:n,chain:o,node:e,imageAttrs:r,pos:t})),!0)}),o.run()},p=async e=>{let{lastCompletedCardId:t,editor:n,theme:o}=e;if(!t)return;console.debug("[AIStream refetchLazyImages] for cardId: ",t);let i=(0,r.N2)(n.state.doc,e=>(0,l.KH)(e)&&e.attrs.id===t)[0];if(!i){console.error("[refetchLazyImages] can not find card with id: ",t);return}let a=i.pos+i.node.nodeSize;h(n,n.state.doc,o,0,a)},m=async e=>{let{editor:t,loadImageId:n,newAttrs:i,node:a,theme:l,cardId:d}=e,c=(0,r.N2)(t.state.doc,e=>{let t=(0,s.XU)(e);return!!t&&t.loadImageId===n})[0];if(!c){console.error("[AIStream] could not find image in editor with loadImageId=".concat(n,"}"));return}let u="cardAccentLayoutItem"===a.type.name&&"error"===i.loadImageStatus?{...c.node.attrs,background:(0,o.Bv)(l,d)}:(0,s.j6)(c.node,i);t.chain().updateAttributesAtPos(c.pos,u).noUndo().run()},h=async(e,t,n,r,o)=>
1{t.descendants((t,i)=>{if(r&&i<r||o&&i>o)return;let a=(0,s.XU)(t);if(!a||"queued"!==a.loadImageStatus||!a.loadImageId||!a.loadImageParams)return;let{loadImageId:l,loadImageParams:c}=a;(0,d.B)({loadImageId:l,loadImageParams:c,context:{docId:e.gammaDocId,workspaceId:e.gammaOrgId}}).then(r=>{m({editor:e,newAttrs:r,loadImageId:l,node:t,theme:n})})})}},28667:function(e,t,n){"use strict";n.d(t,{T:function(){return l}});var r=n(65365),o=n(50775),i=n(65396),a=n(36651);let l=async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{let n=new DOMParser().parseFromString(e,"text/html");d(n),t.removeImagesFromLayouts&&s(n);let l=(0,a.n_)(),u=(0,i.F)(n,"img[searches], img[query]").map(async e=>{var n,i,a;if(e.getAttribute("bookmark"))return;let s=e.getAttribute("query")||e.getAttribute("searches")||"",d="icon"===e.getAttribute("type");t.imageOptions&&"aiGenerated"===t.imageOptions.provider&&t.imageOptions.generateStyle&&!d&&(s="".concat(s,", ").concat(t.imageOptions.generateStyle));let c=(0,o.Z)({query:s,provider:d?"fontawesome":(null===(n=t.imageOptions)||void 0===n?void 0:n.provider)||"web",license:null===(i=t.imageOptions)||void 0===i?void 0:i.license,model:null===(a=t.imageOptions)||void 0===a?void 0:a.model}),u=t.loadImages?await (0,o.B)({loadImageId:c.loadImageId,loadImageParams:c.loadImageParams,context:{workspaceId:l}}):{};e.setAttribute(r.L,JSON.stringify({...c,...u}))});return await Promise.all(u),(0,i.F)(n,"images, icons").forEach(c),n.body.innerHTML}catch(t){return console.error("Error transforming AI HTML",t),e}},s=e=>{e.querySelectorAll(":is(boxes, timeline, table, bullets, arrows, pyramid, funnel, staircase, numbers, percentages, circles) img").forEach(e=>{e.remove()})},d=e=>{let t=e.getElementsByTagName("*");for(let e=0;e<t.length;e++){let n=t[e],r=n.style.textAlign;n.removeAttribute("style"),r&&(n.style.textAlign=r)}},c=e=>{let t=(0,i.F)(e,"div > img:first-child");t.forEach(e=>{let t=e.parentElement;if(!t)return;let n=JSON.parse(e.getAttribute(r.L)||"{}");t.setAttribute("data-image",JSON.stringify(n)),e.remove()})}},29957:function(e,t,n){"use strict";n.d(t,{T:function(){return o}});var r=n(76919);let o=new r.v},40335:function(e,t,n){"use strict";n.d(t,{B:function(){return v},b:function(){return b}});var r=n(87254),o=n(9850),i=n.n(o),a=n(37164),l=n(2784),s=n(81087),d=n(81136),c=n(54691),u=n(77787),p=n(31490),m=n(28667),h=n(19585),g=n(91994),f=n(3402),x=n(8776);let v="Translate this to Spanish please",b=e=>{let{editor:t}=e,n=(0,g.TL)();return(0,l.useCallback)(async e=>{let{doc:o,cardId:a,message:l}=e;if(!t)return;let s={};o.descendants(e=>{if("card"===e.type.name){let n=e.attrs.id;if(a!==n)return!1;let r=(0,u.c)(t,e.content);return s[n]={html:r,node:e},!1}return!0});let d=Object.values(s).map(e=>{let{node:t}=e;return{cardId:a,variant:{label:r.ag._({id:"HxF6Fk"}),card:i()(t.toJSON()),id:"original"},autoselect:!0}});n((0,x.pg)(d)),Object.values(s).forEach(async e=>{let{node:r,html:o}=e,i=await y({editor:t,html:o,node:r,message:l});n((0,x.pg)([{cardId:a,variant:i,autoselect:!0}]))})},[n,t])},y=async e=>{let{html:t,node:n,message:o,editor:i}=e,l=(0,p.nZ)(),u=d.L.prepare({variables:{html:t,message:o}}),g=await (0,c.I)(u,l,{timeout:h.VH.get("aiRequestTimeouts").suggestContent}),{suggestion:x}=(0,s.$V)(g),{content:v}=(0,f.T)(await (0,m.T)(x,{loadImages:!0}),i.schema),b={...n.toJSON(),content:v.toJSON()};return{id:(0,a.x0)(5),label:r.ag._({id:"nyQWMb"}),card:b}}},48525:function(e,t,n){"use strict";n.d(t,{e:function(){return b},k:function(){return y}});var r=n(52322),o=n(10625),i=n(67046),a=n(62614),l=n(332),s=n(99058),d=n(44035),c=n(39237),u=n(42946),p=n(54933),m=n(49929),h=n(87254),g=n(2784),f=n(45302),x=n(89458),v=n(88640);let b=()=>{var e;let t=(0,g.useMemo)(()=>{var e;let t=navigator.language.toLowerCase(),n=t.split("-")[0],r=null!==(e=f.NF.find(e=>e.key===t))&&void 0!==e?e:f.NF.find(e=>e.key===n);return null==r?void 0:r.key},[]),[n,r]=(0,x.I)(v.H.generateLanguage,null!=t?t:"en"),o=(0,g.useMemo)(()=>null!==(e=f.NF.find(e=>e.key===n))&&void 0!==e?e:f.NF[0],[n]);return[o,r]},y=(0,g.memo)(e=>{let{locale:t,setLocale:n,buttonProps:x}=e,[v,b]=(0,g.useState)([]);(0,g.useEffect)(()=>{b(e=>{let n=f.NF.find(e=>e.key===t.key);if(n)return e;let r=[...e];return r.find(e=>e.key===t.key)||r.push(t),r})},[t.key]);let y=(0,g.useMemo)(()=>[...v,...f.h_],[v]);return(0,r.jsxs)(o.v,{children:[(0,r.jsx)(i.j,{as:a.z,size:"sm",boxShadow:"sm",variant:"ghost",rightIcon:(0,r.jsx)(m.G,{size:"xs",icon:u.ptq}),leftIcon:(0,r.jsx)(m.G,{size:"xs",icon:p.BCn}),minW:"150px",...x,children:t.displayName}),(0,r.jsx)(l.h,{children:(0,r.jsx)(s.q,{minWidth:"240px",maxH:"290px",overflowY:"auto",overflowX:"hidden",zIndex:"tooltip",children:(0,r.jsx)(d._,{value:t.key,title:h.ag._({id:"vXIe7J"}),type:"radio",onChange:e=>{n(e)},children:y.map(e=>(0,r.jsx)(c.i,{value:e.key,children:e.displayName},e.key))})})})]})});y.displayName="AILocalePicker"},45302:function(e,t,n){"use strict";n.d(t,{NF:function(){return l},h_:function(){return p},jw:function(){return d}});var r=n(829),o=n.n(r),i=n(10649),a=n(44754);let l=[{key:"en",englishName:"English (US)",displayName:"English (US)"},{key:"en-gb",englishName:"English (UK)",displayName:"English (UK)"},{key:"es",englishName:"Spanish",displayName:"Espa\xf1ol"}
1,{key:"ca",englishName:"Catalan",displayName:"Catal\xe0"},{key:"fr",englishName:"French",displayName:"Fran\xe7ais"},{key:"zh-cn",englishName:"Simplified Chinese",displayName:"ç®ä½ä¸æ"},{key:"zh-tw",englishName:"Traditional Chinese",displayName:"ç¹é«ä¸æ"},{key:"ko",englishName:"Korean",displayName:"íêµì´"},{key:"ja",englishName:"Japanese",displayName:"æ¥æ¬èª"},{key:"pt-br",englishName:"Portuguese",displayName:"Portugu\xeas"},{key:"de",englishName:"German",displayName:"Deutsch"},{key:"it",englishName:"Italian",displayName:"Italiano"},{key:"ru",englishName:"Russian",displayName:"Ð ÑÑÑкий"},{key:"pl",englishName:"Polish",displayName:"Polski"},{key:"uk",englishName:"Ukrainian",displayName:"УкÑаÑнÑÑка"},{key:"ro",englishName:"Romanian",displayName:"Rom\xe2nÄ"},{key:"hu",englishName:"Hungarian",displayName:"Magyar"},{key:"cs",englishName:"Czech",displayName:"ÄeÅ¡tina"},{key:"el",englishName:"Greek",displayName:"Îλληνικά"},{key:"tr",englishName:"Turkish",displayName:"T\xfcrk\xe7e"},{key:"ar",englishName:"Arabic",displayName:"عربÙ"},{key:"he",englishName:"Hebrew",displayName:"×¢×ר×ת"},{key:"fa",englishName:"Persian",displayName:"ÙØ§Ø±Ø³Û"},{key:"nl",englishName:"Dutch",displayName:"Nederlands"},{key:"sv",englishName:"Swedish",displayName:"Svenska"},{key:"da",englishName:"Danish",displayName:"Dansk"},{key:"nb",englishName:"Norwegian",displayName:"Norsk"},{key:"fi",englishName:"Finnish",displayName:"Suomi"},{key:"id",englishName:"Indonesian",displayName:"Bahasa Indonesia"},{key:"vi",englishName:"Vietnamese",displayName:"Tiếng Viá»t"},{key:"hi",englishName:"Hindi",displayName:"हिनà¥à¤¦à¥"},{key:"th",englishName:"Thai",displayName:"ภาษาà¹à¸à¸¢"},{key:"rs",englishName:"Serbian",displayName:"Srpski"}],s=e=>{let t=e.toLowerCase(),n=l.find(e=>e.key.toLowerCase()===t);return n||null},d=e=>{let t=s(e);if(t)return t;let n=i.MD[e],r=n&&s(n);if(r)return r;let[o]=e.toLowerCase().split("-"),a=o&&s(o);return a||u(e)},c={key:"en",englishName:"English (US)",displayName:"English (US)"},u=e=>{let t=(0,a.K)();try{let n=new Intl.DisplayNames([t],{type:"language"}),r=new Intl.DisplayNames(["en"],{type:"language"}),o=r.of(e),i=n.of(e);if(!o||!i)return c;return{key:e.toLowerCase(),englishName:o,displayName:i}}catch(e){return c}},p=o()(l,e=>e.displayName)},75279:function(e,t,n){"use strict";n.d(t,{A2:function(){return j},$m:function(){return k.$m},DD:function(){return T}});var r=n(52322),o=n(70065),i=n(17993),a=n(29117),l=n(74409),s=n(77533),d=n(43297),c=n(62614),u=n(11082),p=n(28535),m=n(97143),h=n(54933),g=n(49929),f=n(5879),x=n(87254),v=n(92092),b=n(89365),y=n(91025),C=n(94199),w=n(36651),k=n(18724);let j=e=>{var t,n,p;let{accessLink:j,doc:A,refetchFn:I,...E}=e,z=(0,o.p)(),{refetch:T}=(0,w.SE)(),N=I||T,M=e=>{let{title:t,description:n}=y.T[e]||{title:(0,r.jsx)(f.cC,{id:"U7nnQt"}),description:e};z.isActive(e)||z({title:t,description:n,position:"top",id:e,status:"error",isClosable:!0,duration:null})},_=null!==(n=null==j?void 0:j.permission)&&void 0!==n?n:"view",L={manage:(0,r.jsx)(f.cC,{id:"C11Xkl",values:{GAMMA_ARTIFACT_PROPER_NOUN:C.Yc}}),edit:(0,r.jsx)(f.cC,{id:"C11Xkl",values:{GAMMA_ARTIFACT_PROPER_NOUN:C.Yc}}),comment:(0,r.jsx)(f.cC,{id:"gu6c+c",values:{GAMMA_ARTIFACT_PROPER_NOUN:C.Yc}}),view:(0,r.jsx)(f.cC,{id:"LoR9yH",values:{GAMMA_ARTIFACT_PROPER_NOUN:C.Yc}})},P=L[_],R={manage:(0,r.jsx)(f.cC,{id:"MEeXaP"}),edit:(0,r.jsx)(f.cC,{id:"MEeXaP"}),comment:(0,r.jsx)(f.cC,{id:"dx3Kfr"}),view:(0,r.jsx)(f.cC,{id:"R2ZEYO"})},H=R[_],D={manage:{icon:h.TzT,colorScheme:"cyan"},edit:{icon:h.TzT,colorScheme:"cyan"},comment:{icon:h.Mzg,colorScheme:"yellow"},view:{icon:h.Pk,colorScheme:"green"}},O=null!==(p=null==A?void 0:null===(t=A.editors)||void 0===t?void 0:t.map(e=>e.user.displayName))&&void 0!==p?p:[],B=(()=>{switch(_){case"manage":case"edit":switch(O.length){case 0:return(0,r.jsx)(f.cC,{id:"bspMVx",values:{GAMMA_ARTIFACT_PROPER_NOUN:C.Yc},components:{0:(0,r.jsx)("span",{role:"img","aria-label":x.ag._({id:"JGFG6q"})}),1:(0,r.jsx)("strong",{})}});case 1:return(0,r.jsx)(f.cC,{id:"w49thS",values:{GAMMA_ARTIFACT_PROPER_NOUN:C.Yc,0:O[0]},components:{0:(0,r.jsx)("span",{role:"img","aria-label":x.ag._({id:"JGFG6q"})}),1:(0,r.jsx)("strong",{})}});case 2:return(0,r.jsx)(f.cC,{id:"Tz4Wi7",values:{0:O[0],1:O[1]},components:{0:(0,r.jsx)("span",{role:"img","aria-label":x.ag._({id:"7Lrnj6"})}),1:(0,r.jsx)("strong",{}),2:(0,r.jsx)("strong",{})}});default:return(0,r.jsx)(f.cC,{id:"VhIJ/j",values:{0:O[0],1:O.length-1},components:{0:(0,r.jsx)("span",{role:"img","aria-label":x.ag._({id:"7Lrnj6"})}),1:(0,r.jsx)("strong",{})}})}case"comment":return(0,r.jsx)(f.cC,{id:"vIOI7i",components:{0:(0,r.jsx)("span",{role:"img","aria-label":x.ag._({id:"OoNfwA"})}),1:(0,r.jsx)("strong",{}),2:(0,r.jsx)("strong",{})}});default:return(0,r.jsx)(f.cC,{id:"k/HcwJ",values:{GAMMA_ARTIFACT_PROPER_NOUN:C.Yc},components:{0:(0,r.jsx)("strong",{})}})}})(),F=async()=>{N&&(await N(),(0,k.bC)()),z.isActive("login-complete")||z({title:(0,r.jsx)(f.cC,{id:"yFvQAN"}),description:P,position:"top",id:"login-complete",status:"success",isClosable:!0,duration:5e3})};return(0,r.jsxs)(i.g,{align:"stretch",...E,children:[(0,r.jsxs)(a.U,{spacing:4,mr:6,children:[(0,r.jsx)(S,{icon:(0,r.jsx)(g.G,{icon:D[_].icon}),colorScheme:D[_].colorScheme}),(0,r.jsx)(l.X,{size:"sm",children:H})]}),(0,r.jsx)(s.x,{fontSize:"sm",children:B}),(0,r.jsxs)(d.K,{children:[(0,r.jsx)(c.z,{variant:"solid",leftIcon:(0,r.jsx)(g.G,{icon:m.xYR}),size:"md",onClick:()=>{(0,b.DW)({type:b._M.DOC_ACCESS_LINK,params:{docId:null==A?void 0:A.id,shareToken:j.token},errorCallback:M,doneCallback:F})},children:(0,r.jsx)(f.cC,{id:"oZyG4C"})}),(0,r.jsx)(s.x,{fontSize:"xs",color:"gray.600",children:(0,r.jsx)(f.cC,{id:"oXChp6",values:{GAMMA_PROPER_NOUN:C.N6}
1,components:{0:(0,r.jsx)(u.r,{href:v.B,isExternal:!0,fontWeight:"bold"}),1:(0,r.jsx)(u.r,{href:v.h,isExternal:!0,fontWeight:"bold"})}})})]})]})},S=e=>{let{icon:t,colorScheme:n}=e;return(0,r.jsxs)(p.Cd,{size:10,bg:"linear-gradient(to bottom, var(--chakra-colors-".concat(n,"-200), var(--chakra-colors-").concat(n,"-300))"),position:"relative",children:[(0,r.jsx)(p.xu,{color:"".concat(n,".600"),display:"block",mt:"0.5",textAlign:"center",children:t}),(0,r.jsx)(p.Cd,{size:5,position:"absolute",bottom:-1,right:-1,color:"".concat(n,".800"),bg:"".concat(n,".100"),boxShadow:"base",fontSize:"xs",children:(0,r.jsx)(g.G,{icon:h.r8p})})]})};var A=n(81672),I=n(2784),E=n(90419);let z=e=>{let{onClose:t,doc:n,...o}=e;return(0,r.jsxs)(p.xu,{bg:"white",border:"0.5px solid var(--chakra-colors-gray-100)",borderRadius:"md",shadow:"md",maxWidth:"calc(".concat(E.pn,"px - 1rem)"),display:"column",p:4,position:"relative",children:[(0,r.jsx)(A.P,{size:"sm",onClick:t,position:"absolute",top:2,right:2}),(0,r.jsx)(j,{...o,doc:n,spacing:4})]})},T=(e,t)=>{let{isUserLoading:n,user:r,refetch:i}=(0,w.SE)(),a=(0,k.$m)(e,r),l=(0,o.p)(),s=(0,I.useRef)();(0,I.useEffect)(()=>{let o=t&&!r&&!n&&e&&a&&"view"!==a.permission;s.current&&l.close(s.current),o&&(s.current=l({position:"bottom-left",render:t=>{let{onClose:n}=t;return z({refetchFn:i,doc:e,accessLink:a,onClose:n})},isClosable:!0,duration:null}))},[i,r,n,a,l,e,t])}},18724:function(e,t,n){"use strict";n.d(t,{$m:function(){return u},bC:function(){return d},ts:function(){return c}});var r=n(2784),o=n(14274),i=n(93202),a=n(34881),l=n(36651),s=n(93441);let d=()=>{if(""===o.v.SHARE_TOKEN)return;let{searchParams:e}=new URL(window.location.href);e.delete("token");let t=Object.fromEntries(e.entries());(0,a.lO)({query:t})},c=e=>{let{user:t}=(0,l.SE)(),[n,{error:a}]=(0,i.E3j)();(0,s.GJ)("[useAccessLinkCollaborator]: Error updating collaborator.",a),(0,r.useEffect)(()=>{var r;if(!t||!e)return;let a=null===(r=e.accessLinks)||void 0===r?void 0:r.find(e=>e.token===o.v.SHARE_TOKEN);if(!a)return;let s=l.gj.createForUser({...t,__typename:"User"});a.permission&&a.permission!==i.y3$.View&&s.cannot(a.permission,e)?n({variables:{docId:e.id}}).then(()=>{d(),(0,o.M)("SHARE_TOKEN","")}).catch(e=>console.error("[useAccessLinkCollaborator]: Error adding collaborator.",e)):d()},[n,e,t])},u=(e,t)=>{var n;if(!e||t)return null;let r=null==e?void 0:null===(n=e.accessLinks)||void 0===n?void 0:n.find(e=>e.token===o.v.SHARE_TOKEN);return r&&r.permission?r:null}},89365:function(e,t,n){"use strict";n.d(t,{DW:function(){return I},Mj:function(){return i},_M:function(){return a},r9:function(){return S}});var r,o,i,a,l=n(14274),s=n(93202),d=n(61233),c=n(17018),u=n(19902),p=n(11050),m=n(36651),h=n(18733),g=n(88640),f=n(88232);let x=null,v=null;(r=i||(i={})).LOGIN_COMPLETE="loginComplete",r.LOGIN_FAILURE="loginFailure",r.SIGNUP_COMPLETE="signupComplete";let b=e=>{if(!e)return;let{userId:t,workspaceId:n}=e;p.co.identify(t,{user_org_id:n,anonymous_user:!1,gamma_user_id:t})},y=(e,t)=>(0,s.WQq)().mutate({mutation:s.ftw,variables:{input:{id:e,referrer:t}}}),C=()=>{let e=(0,c.py)(),t=(0,m.Yu)({set:{locale:e}});return(0,s.WQq)().mutate({mutation:s.POY,variables:{patch:t}})},w=e=>["docAccessLink","docInvitation"].includes(e),k=e=>{let{data:t,redirectTo:n}=e,r=n||(0,f.wH)();if(t){let{welcomeDocId:e,newWorkspace:n,signupFlow:o}=t;if(e)try{h.W.setItem(g.H.welcomeDocId,JSON.stringify(e))}catch(e){}if(w(o))return r;n&&(r="/welcome?newWorkspace=true")}return r},j=e=>{var t,n,r,o,a,s,m,h,g,f,x,v,j,S,A,I;let{event:E,errorCallback:z,redirectTo:T,doneCallback:N}=e,M=(0,u.K)(),_=M.get(),{data:L}=E;if(L.type===i.LOGIN_COMPLETE){let e=T||"/";if(b(null==L?void 0:null===(t=L.payload)||void 0===t?void 0:t.data),p.co.track(p.AA.LOGIN,{provider:"google"},{context:_}),!T&&N){N();return}let i=null==L?void 0:null===(r=L.payload)||void 0===r?void 0:null===(n=r.data)||void 0===n?void 0:n.isFirstWorkspace;i&&(null==L?void 0:null===(o=L.payload)||void 0===o?void 0:o.data)&&(e=k({data:null===(a=L.payload)||void 0===a?void 0:a.data,redirectTo:T})),window.location.href=e}if(L.type===i.SIGNUP_COMPLETE){b(null==L?void 0:null===(s=L.payload)||void 0===s?void 0:s.data),p.co.track(p.AA.SIGNUP,{flow:null==L?void 0:null===(h=L.payload)||void 0===h?void 0:null===(m=h.data)||void 0===m?void 0:m.signupFlow,provider:"google"},{context:_});let e=null==L?void 0:null===(f=L.payload)||void 0===f?void 0:null===(g=f.data)||void 0===g?void 0:g.userId,t=e&&l.v.IS_USER_TESTING_SESSION?y(e,"USER_TESTING"):Promise.resolve();e&&(0,c.u_)()&&C();let n=T||"/",r=null==L?void 0:null===(v=L.payload)||void 0===v?void 0:null===(x=v.data)||void 0===x?void 0:x.isFirstWorkspace;if(!T&&N&&!r){N();return}if(r&&(null==L?void 0:null===(j=L.payload)||void 0===j?void 0:j.data)){(0,d.j6)();let{signupFlow:e}=L.payload.data;if(w(e)&&N){N();return}n=k({data:null===(S=L.payload)||void 0===S?void 0:S.data,redirectTo:T})}t.then(()=>{window.location.href=n})}if(L.type===i.LOGIN_FAILURE){let e=null==E?void 0:null===(I=E.data)||void 0===I?void 0:null===(A=I.payload)||void 0===A?void 0:A.code;if(!z){console.error("No error callback defined");return}if(!e){console.error("No code defined");return}z(e)}};(o=a||(a={})).ACCEPT_DOC_INVITATION="accept-doc-invitation",o.ACCEPT_WORKSPACE_INVITATION="accept-workspace-invitation",o.DOC_ACCESS_LINK="doc-access-link",o.JOIN_WITH_CODE="join-with-code",o.DEFAULT_LOGIN="login",o.SIGNUP="signup";let S={"accept-doc-invitation":"docInvitation","accept-workspace-invitation":"workspaceInvitation","doc-access-link":"docAccessLink","join-with-code":"joinLink",login:"signup",signup:"signup"},A=(e,t)=>
1{switch(e){case a.JOIN_WITH_CODE:{let{workspaceId:e,inviteCode:n,referredByUserId:r}=t,o=new URL("".concat(l.v.API_HOST||"https://gamma.app","/organizations/").concat(e,"/join/").concat(n));return r&&o.searchParams.set("referredByUserId",r),o.toString()}case a.ACCEPT_DOC_INVITATION:{let{docId:e,email:n,inviteCode:r}=t;return"".concat(l.v.API_HOST,"/invitations/docs/").concat(e,"/?inviteCode=").concat(r,"&email=").concat(n)}case a.ACCEPT_WORKSPACE_INVITATION:{let{workspaceId:e,email:n,inviteCode:r}=t;return"".concat(l.v.API_HOST,"/invitations/workspaces/").concat(e,"?inviteCode=").concat(r,"&email=").concat(n)}case a.DOC_ACCESS_LINK:{let{docId:e,shareToken:n}=t;return"".concat(l.v.API_HOST,"/access-links/docs/").concat(e,"/?token=").concat(n)}case a.SIGNUP:{let{inviteCode:e,referredByUserId:n,partnerStackClickId:r,partnerStackPartnerId:o}=t,i=new URL("".concat(l.v.API_HOST||"https://gamma.app","/signup"));return e&&i.searchParams.set("inviteCode",e),n&&i.searchParams.set("referredByUserId",n),r&&i.searchParams.set("partnerStackClickId",r),o&&i.searchParams.set("partnerStackPartnerId",o),i.toString()}default:return"".concat(l.v.API_HOST,"/login")}},I=e=>{let{type:t,params:n,errorCallback:r,redirectTo:o,doneCallback:i}=e,a=A(t,n),l="toolbar=no, menubar=no, width=600, height=700, top=100, left=100";null===x||x.closed?x=window.open(a,t,l):v!==a?null!==(x=window.open(a,t,l))&&x.focus():x.focus(),(0,f.a_)().addEventListener("message",e=>{j({event:e,errorCallback:r,redirectTo:o,doneCallback:i})}),v=a}},580:function(e,t,n){"use strict";n.d(t,{A:function(){return a}});var r=n(52322),o=n(38035);n(2784);let i={allowPopups:!1,noSandbox:!1,preventScroll:void 0},a=e=>{let{initialUrl:t,frameRef:n,iframeOptions:a,backgroundColor:l="white",...s}=e,{allowPopups:d,preventScroll:c,noSandbox:u}=a||i;return(0,r.jsx)(o.k,{w:"100%",h:"100%",direction:"column",background:l,...s,children:(0,r.jsx)("iframe",{ref:n,src:t,frameBorder:"0",width:"100%",height:"100%",allow:"encrypted-media; camera; microphone",allowFullScreen:!0,title:"Embedded app",sandbox:u?void 0:"allow-forms allow-scripts allow-same-origin allow-modals allow-pointer-lock ".concat(d?"allow-popups":""),scrolling:c?"no":void 0,style:{flex:1}})})}},15830:function(e,t,n){"use strict";n.d(t,{T:function(){return o}});var r=n(76919);let o=new r.v},89996:function(e,t,n){"use strict";n.d(t,{t:function(){return a}});var r=n(54073),o=n.n(r),i=n(2784);let a=e=>{let[t,n]=(0,i.useState)(null);return(0,i.useEffect)(()=>{if(!e)return;let t=e=>{let{editor:t}=e;n(t.state.selection)};t({editor:e});let r=o()(t,200,{leading:!0});return e.on("selectionUpdate",r),()=>{e.off("selectionUpdate",r)}},[e]),{selection:t}}},47288:function(e,t,n){"use strict";n.d(t,{$:function(){return s}});var r=n(6238),o=n.n(r),i=n(98621),a=n.n(i),l=n(33107);let s=o()(function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"analogous",r=Array.from(new Set(t)),o=Math.round(a()(e).getBrightness()/255*100),i=o<20?o:20,s=o>90?o:90;if(0===r.length)return new Map;if(1===r.length)return new Map([[r[0],a()(e).toHex8String()]]);switch(n){case"darkest":{let n=(s-i)/t.length,o=a()(e),l=0;for(;o.getBrightness()/255*100>i&&!(l++>100);)o.darken(n);return new Map(r.map((e,t)=>{let r=a()(o.toHexString()).lighten(t*n);return[e,r.toHex8String()]}))}case"lightest":{let n=(s-i)/t.length,o=a()(e),l=0;for(;o.getBrightness()/255*100<s&&!(l++>100);)o.lighten(n);return new Map(r.map((e,r)=>{let i=a()(o.toHexString()).darken((t.length-r)*n);return[e,i.toHex8String()]}))}case"median":{let n=Math.floor(t.length/2),l=(s-o)/(t.length-n+1),d=(o-i)/(t.length-n+1),c=new Map(r.map((t,r)=>{let o;if(r===n)o=a()(e);else if(r>n)o=a()(e).brighten(l*(r-n));else{let t=(n-r)*d;o=a()(e).darken(t)}return[t,o.toHex8String()]}));return c}case"analogous":{let t=a()(e),n=a()(e).analogous(r.length+1,22).filter(e=>e.toHex()!==t.toHex());return n.unshift(t),new Map(r.map((e,t)=>[e,n[t].toHex8String()]))}case"spin":{let t=a()(e),n=Math.floor(r.length/2),o=360/r.length<22?360/r.length:22,i=(0,l.R)(r.map((e,r)=>{let i=0;return r<n&&(i=-((n-r)*o*1)),r>n&&(i=(r-n)*o),t.clone().spin(i)}),n);return new Map(r.map((e,t)=>[e,i[t].toHex8String()]))}case"linear":{let n=60/t.length;return new Map(r.map((t,r)=>{let o=a()(a()(e).lighten(n*r));return[t,o.toHex8String()]}))}case"complement":case"complement2":{let t=a()(e),o=180/(r.length-1);return new Map(r.map((e,r)=>[e,t.clone().spin(o*r*("complement2"===n?-1:1)).toHex8String()]))}}})},31131:function(e,t,n){"use strict";n.d(t,{CK:function(){return d},bT:function(){return s},cb:function(){return l},jK:function(){return a},zn:function(){return i}});var r=n(42946),o=n(87254);let i=.25,a={top:0,right:0,bottom:0,left:0},l={darkest:{label:()=>o.ag._({id:"d6XP5a"})},lightest:{label:()=>o.ag._({id:"zWjtkK"})},median:{label:()=>o.ag._({id:"CzL2o5"})},analogous:{label:()=>o.ag._({id:"IahlE2"})},linear:{label:()=>o.ag._({id:"vQ2Ad9"})},spin:{label:()=>o.ag._({id:"Tif2bC"})},complement:{label:()=>o.ag._({id:"yqcdL8"})},complement2:{label:()=>o.ag._({id:"D0tWSS"})}},s="complement",d=Object.freeze({pie:{icon:r.OS1,label:()=>o.ag._({id:"ZjVniv"})},donut:{icon:r.epv,label:()=>o.ag._({id:"0jblrE"})},line:{icon:r.Stf,label:()=>o.ag._({id:"rjuFFw"})},bar:{icon:r.Wpq,label:()=>o.ag._({id:"WtgDbl"})},"horizontal-bar":{icon:r.AGo,label:()=>o.ag._({id:"GoBp8L"})}})},28091:function(e,t,n){"use strict";n.d(t,{C:function(){return a}});var r=n(13109),o=n(5966),i=n(9315);class a{getCellClass(){switch(this.type){case"label":return o.m;case"data":return r.O}}getCells(e){return e.rows.map(t=>e.getCellOrThrow({row:t.id,column:this.id}))}constructor(e){let{id:t,type:n,label:r,format:o}=(0,i.kC)(e);this.id=t,this.type=n,this.label=r,this.format=o||"raw"}}},63213:function(e,t,n){"use strict";n.d(t,{f:function(){return l}});var r=n(28091),o=n(88323),i=n(44776),a=n(9315);class l{get columns(){return this._columns}get rows(){return this._rows}get cells(){return this._rows.flatMap(e=>this.columns.map(t=>this._cells[e.id][t.id]))}getColumn(e){return this.columnsIndex.get(e)}getRow(e){return this.rowsIndex.get(e)}getCell(e){let{row:t,column:n}=e;return this._cells[t][n]}getCellAtIndex(e){let{row:t,column:n}=e;if(t>=this._rows.length||n>=this._columns.length)throw Error("Index out of bounds");let r=this._rows[t].id,o=this._columns[n].id;return this.getCellOrThrow({row:r,column:o})}findCellIndex(e){let t=this._columns.findIndex(t=>t.id===e.position.column),n=this._rows.findIndex(t=>t.id===e.position.row);if(!(t<0)&&!(n<0))return{row:n,column:t}}findCellIndexOrThrow(e){let t=this.findCellIndex(e);if(!t)throw Error("Cell not found");return t}getCellOrThrow(e){let t=this.getCell(e);if(!t)throw Error("Cell not found");return t}addEmptyColumn(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"data",t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!n&&this._columns.length>=i.Z)return null;let o=new r.C({type:e,label:""});for(let e of this._rows)this.setEmptyCell(e,o);switch(t){case void 0:this._columns.push(o);break;case 0:this._columns.unshift(o);break;default:this._columns.splice(t,0,o)}return this.columnsIndex.set(o.id,o),o}addEmptyRow(e,t){if(!t&&this._rows.length>=i.F)return null;let n=new o.H({});for(let e of this._columns)this.setEmptyCell(n,e);switch(e){case void 0:this._rows.push(n);break;case 0:this._rows.unshift(n);break;default:this._rows.splice(e,0,n)}return this.rowsIndex.set(n.id,n),n}deleteColumns(e){let t=Object.fromEntries(e.map(e=>[e,!0]));for(let n of(this._columns=this._columns.filter(e=>{let{id:n}=e;return!t[n]||(this.columnsIndex.delete(n),!1)}),Object.values(this._cells)))for(let t of e)delete n[t]}deleteRows(e){let t=Object.fromEntries(e.map(e=>[e,!0]));for(let n of(this._rows=this._rows.filter(e=>{let{id:n}=e;return!t[n]||(this.rowsIndex.delete(n),!1)}),e))delete this._cells[n]}moveRows(e,t){this.moveLines(e,t,"rows")}moveColumns(e,t){this.moveLines(e,t,"columns")}setEmptyCell(e,t){let n=t.getCellClass(),r=new n({row:e,column:t});return this.setCell(r),r}moveLines(e,t,n){let r="_".concat(n),o=this[r].findIndex(t=>{let{id:n}=t;return n===e[0]});if(-1===o)throw Error("".concat(n,"=").concat(e[0]," not found"));o!==t&&(0,a.im)(this[r],{fromIx:o,toIx:t,count:e.length})}set columns(e){this._columns=e,this.indexColumns()}set rows(e){this._rows=e,this.indexRows()}set cells(e){for(let t of(this._cells={},e)){let{row:e,column:n}=t.position;if(!this.getColumn(n))throw Error("Column=".concat(n," not found"));if(!this.getRow(e))throw Error("Row=".concat(e," not found"));this.setCell(t)}}setCell(e){let{row:t,column:n}=e.position;this._cells[t]||(this._cells[t]={}),this._cells[t][n]=e}indexColumns(){this.columnsIndex=(0,a.HK)(this._columns,"id")}indexRows(){this.rowsIndex=(0,a.HK)(this._rows,"id")}static createEmpty(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=new l;for(let t=0;t<e;t++)r.addEmptyColumn(0===t?"label":"data",void 0,n);for(let e=0;e<t;e++)r.addEmptyRow(void 0,n);return r}constructor(e){if(this._columns=[],this._rows=[],this._cells={},this.columnsIndex=new Map,this.rowsIndex=new Map,e){let{columns:t,rows:n,cells:r}=e;this.rows=n,this.columns=t,this.cells=r}}}},88323:function(e,t,n){"use strict";n.d(t,{H:function(){return o}});var r=n(9315);class o{getCells(e){return e.columns.map(t=>
1e.getCellOrThrow({row:this.id,column:t.id}))}constructor(e){this.id=(0,r.kC)(e).id}}},91496:function(e,t,n){"use strict";n.d(t,{u:function(){return r}});class r{get position(){return{row:this.row.id,column:this.column.id}}get key(){return"".concat(this.row.id,":").concat(this.column.id)}constructor({row:e,column:t}){this.row=e,this.column=t}}},13109:function(e,t,n){"use strict";n.d(t,{O:function(){return o}});var r=n(91496);class o extends r.u{get data(){return this._data}set data(e){this._data=isNaN(e)?0:e}get textValue(){return this.column.format,"".concat(this.data)}set textValue(e){let t=Number.parseFloat(e),n=isNaN(t)?0:t;this.column.format,this.data=n}setupInitialData(e){this.data=e.data}constructor(e,t){super(e),this.type="data",this._data=0,t&&this.setupInitialData(t)}}},5966:function(e,t,n){"use strict";n.d(t,{m:function(){return o}});var r=n(91496);class o extends r.u{get textValue(){return this.label}set textValue(e){this.label=e}setupInitialData(e){this.label=e.label}constructor(e,t){super(e),this.type="label",this.label="",t&&this.setupInitialData(t)}}},44776:function(e,t,n){"use strict";n.d(t,{F:function(){return r},Z:function(){return o}});let r=20,o=5},9315:function(e,t,n){"use strict";n.d(t,{HK:function(){return s},Vd:function(){return d},X8:function(){return c},im:function(){return l},kC:function(){return a}});var r=n(37164),o=n(13109),i=n(5966);function a(e){var t;let n=null!==(t=e.id)&&void 0!==t?t:(0,r.x0)(5);return{...e,id:n}}function l(e,t){let{fromIx:n,toIx:r,count:o=1}=t;if(o<=0){console.warn("Trying to move ".concat(o," elements"));return}n!==r&&e.splice(r,0,...e.splice(n,o))}function s(e,t){return new Map(e.map(e=>[e[t],e]))}function d(e){return e instanceof o.O}function c(e){return e instanceof i.m}},33107:function(e,t,n){"use strict";n.d(t,{H:function(){return o},R:function(){return r}});let r=(e,t)=>{let n=e.length,r=Array(n);return e.forEach((e,o)=>{r[(o+t)%n]=e}),r},o=e=>e?1:16},91025:function(e,t,n){"use strict";n.d(t,{T:function(){return s}});var r,o,i=n(52322),a=n(5879),l=n(94199);(r=o||(o={})).invalid_signup_code="invalid_signup_code",r.invalid_reset_code="invalid_reset_code",r.invalid_user="invalid_user",r.other_workspace_member="other_workspace_member";let s={[o.invalid_signup_code]:{title:(0,i.jsx)(a.cC,{id:"F6yt1L",values:{GAMMA_PROPER_NOUN:l.N6}}),description:(0,i.jsx)(a.cC,{id:"hVNvhu"})},[o.invalid_reset_code]:{title:(0,i.jsx)(a.cC,{id:"SvShcH"}),description:(0,i.jsx)(a.cC,{id:"Vm3y4h"})},[o.invalid_user]:{title:(0,i.jsx)(a.cC,{id:"a2AYF6"}),description:(0,i.jsx)(a.cC,{id:"x9CdxW",values:{GAMMA_PROPER_NOUN:l.N6}})},[o.other_workspace_member]:{title:(0,i.jsx)(a.cC,{id:"J5F9Vo"}),description:(0,i.jsx)(a.cC,{id:"CTBeTd",values:{GAMMA_PROPER_NOUN:l.N6}})}}},20336:function(e,t,n){"use strict";n.d(t,{V:function(){return s}});var r=n(52322),o=n(38035),i=n(77533),a=n(5879),l=n(2784);let s=(0,l.memo)(e=>{let{label:t,isConnected:n=!0,...l}=e;return n?null:(0,r.jsxs)(o.k,{bg:"gray.50",p:4,borderRadius:"lg",textAlign:"center",alignItems:"center",direction:"column",...l,children:[(0,r.jsx)(i.x,{fontSize:"sm",fontWeight:"bold",children:(0,r.jsx)(a.cC,{id:"ysdDIA"})}),(0,r.jsx)(i.x,{fontSize:"sm",children:t})]})});s.displayName="OfflineInfoBox"},34972:function(e,t,n){"use strict";n.d(t,{BU:function(){return s},My:function(){return a}});var r=n(52322),o=n(2784);let i=o.createContext({inPreviewContext:!1}),a=()=>{let e=(0,o.useContext)(i);return e},l={inPreviewContext:!0},s=e=>{let{children:t}=e;return(0,r.jsx)(i.Provider,{value:l,children:t})}},31341:function(e,t,n){"use strict";n.d(t,{y5:function(){return ed},Pu:function(){return x},H9:function(){return eh}});var r=n(52322),o=n(46949),i=n(74105),a=n(20816),l=n(85573),s=n(77533),d=n(94523),c=n(87254),u=n(2784),p=n(43997),m=n(16893),h=n(90221),g=n(36857);let f=()=>c.ag._({id:"NiZZRh"}),x=()=>{let e=(0,p.I0)(),t=(0,m.A)(f),n=(0,u.useCallback)(()=>{e((0,g.Hm)({isOpen:!0}))},[e]),c=(0,u.useCallback)(t=>{e((0,g.Hm)({isOpen:!0,initialQuery:t.target.value}))},[e]);return(0,r.jsxs)(i.B,{mt:4,children:[(0,r.jsx)(a.Z,{pointerEvents:"none",children:(0,r.jsx)(o.W,{color:"gray.300"})}),(0,r.jsx)(l.I,{placeholder:t,_placeholder:{opacity:1},onChange:c,onClick:n,value:""}),!(0,h.s2)()&&(0,r.jsx)(a.x,{pointerEvents:"none",children:(0,r.jsx)(s.x,{mr:6,fontWeight:"600",color:"gray.400",fontSize:"sm",bg:"gray.50",px:1,borderRadius:"md",children:(0,d.cE)("Mod+K")})})]})};var v=n(92850),b=n(26468),y=n(22226),C=n(97217),w=n(91994),k=n(96933),j=n(87202),S=n(17292),A=n(36651);let I=(0,j.ZP)("mod+K"),E=e=>{let{isEnabledFn:t=()=>!0,isOpen:n=!1}=e,{user:r}=(0,A.SE)(),o=(0,p.I0)();(0,u.useEffect)(()=>
1{if(!(0,h.s2)()&&r)return S.F7.on("keydown","GLOBAL_SEARCH",e=>!!(I(e)&&t())&&(e.preventDefault(),o((0,g.Hm)({isOpen:!n})),!0))},[o,t,r,n])};var z=n(38035),T=n(2338),N=n(5879),M=n(27875),_=n.n(M),L=n(93202),P=n(20336),R=n(93441),H=n(89458),D=n(88640),O=n(81540);let B=e=>{let{onChange:t,query:n,isDisabled:s,isLoading:d,isFocused:p}=e,m=(0,u.useRef)(null);return(0,u.useEffect)(()=>{m.current&&p&&(m.current.scrollIntoView({behavior:"smooth",block:"center",inline:"nearest"}),m.current.focus())},[m,p]),(0,r.jsxs)(i.B,{size:"lg",variant:"unstyled",children:[(0,r.jsx)(a.Z,{p:4,pointerEvents:"none",color:"gray.300",children:(0,r.jsx)(o.W,{})}),(0,r.jsx)(l.I,{isDisabled:s,placeholder:c.ag._({id:"NiZZRh"}),p:3,pl:12,border:"none",outline:"none",shadow:"none",value:n,onChange:t,_placeholder:{opacity:1,color:"gray.300"},ref:m}),(0,r.jsx)(a.x,{p:4,pointerEvents:"none",color:"gray.500",opacity:d?1:0,transitionProperty:"common",transitionDuration:"normal",mr:(0,h.s2)()?8:0,children:(0,r.jsx)(O.$,{size:"sm"})})]})};var F=n(82642),W=n(87651),G=n(74008),U=n(29117),V=n(5740),q=n(36474),$=n(32899);let K=e=>{let{onClose:t,showTip:n}=e;return(0,r.jsxs)(W.U,{in:n,children:[(0,r.jsx)(G.i,{}),(0,r.jsxs)(U.U,{p:4,px:6,children:[(0,r.jsxs)(s.x,{fontSize:"sm",color:"gray.600",children:[(0,r.jsxs)("span",{role:"img","aria-label":"Wave",children:["\uD83D\uDC4B"," "]}),(0,r.jsx)(N.cC,{id:"3SXj0j",values:{0:(0,d.cE)("Mod+K")},components:{0:(0,r.jsx)(V.T,{})}})]}),(0,r.jsx)(q.L,{}),(0,r.jsx)($.h,{"aria-label":c.ag._({id:"yz7wBu"}),icon:(0,r.jsx)(F.T,{boxSize:2.5}),isRound:!0,size:"xs",variant:"ghost",onClick:t})]})]})};var Z=n(43297),Y=n(11881),X=n(28535),J=n(49929),Q=n(30579),ee=n(78462);let et=e=>{let{result:t,isActive:n,focusedItemEl:o,onMouseMove:i}=e,{name:a,id:l,slug:u,isMember:p,memberCount:m,members:h}=t;return(0,r.jsx)(Y.f,{children:(0,r.jsxs)(U.U,{ref:n?o:null,className:"search-result",wordBreak:"break-word",onMouseMove:i,p:3,align:"flex-start",alignItems:"center",borderRadius:"md",transitionProperty:"common",transitionDuration:"normal",role:"group",bg:n?"gray.100":"transparent",cursor:"pointer",color:"gray.800",borderWidth:"1px",borderColor:n?"gray.200":"transparent",spacing:{base:0,sm:4},children:[(0,r.jsx)(X.xu,{p:2,children:(0,r.jsx)(J.G,{icon:Q.Ty})}),(0,r.jsx)(Z.K,{spacing:2,flex:"1",children:(0,r.jsxs)(Y.A,{href:(0,ee.j)({id:l,slug:u}),children:[(0,r.jsx)(s.x,{children:a}),(0,r.jsx)(s.x,{fontSize:"sm",color:"gray.400",children:p?(0,r.jsx)(N.cC,{id:"tWPlLK",values:{0:m||0}}):(0,r.jsx)(N.cC,{id:"pkIIls",values:{0:m||0}})})]})}),(0,r.jsx)(q.L,{}),(0,r.jsx)(d.NL,{overflowTooltipLabel:c.ag._({id:"25VyZX"}),size:"xs",avatars:h||[],max:3})]})})};var en=n(75009),er=n(93274),eo=n(14304),ei=n.n(eo),ea=n(16426),el=n(42111),es=n(46640);let ed=e=>{let{result:t,isActive:n,focusedItemEl:o,onMouseMove:i,context:a="globalSearch"}=e,l=(0,el.ye)("screenshotsEnabled"),{title:c,text:u,previewUrl:p,editors:m,editedTime:g,id:f,createdBy:x}=t,v="mentionsList"===a;return(0,r.jsx)(Y.f,{children:(0,r.jsxs)(U.U,{ref:n?o:null,className:"search-result",wordBreak:"break-word",onMouseMove:i,p:v?0:[2,3],py:v?.5:void 0,align:"flex-start",borderRadius:"md",transitionProperty:"common",transitionDuration:"normal",role:"group",bg:n?"gray.100":"transparent",cursor:"pointer",color:"gray.800",borderWidth:"1px",borderColor:n?"gray.200":"transparent",spacing:{base:0,sm:4},sx:{em:{bg:"var(--chakra-colors-trueblue-100)",fontStyle:"normal",borderRadius:"base",display:"inline-block",padding:"0px 2px",margin:"0px -2px"}},children:[(0,r.jsx)(en.E,{display:{base:"none",xs:"block"},h:"100%",src:l?p:ea.Z.src,w:{base:"0px",sm:"25%"},border:"1px solid",borderColor:"gray.200",borderRadius:"md",shadow:"lg",fallbackSrc:ea.Z.src}),(0,r.jsxs)(Z.K,{spacing:(0,h.s2)()?1:2,flex:"1",children:[(0,r.jsxs)(Y.A,{href:"globalSearch"===a?(0,ee.Gn)({docId:f}):void 0,children:[(0,r.jsx)(s.x,{fontSize:"md",fontWeight:"600",noOfLines:v?1:2,dangerouslySetInnerHTML:{__html:c?ei().sanitize(c):""}}),(null==x?void 0:x.displayName)&&(0,r.jsx)(s.x,{fontSize:"xs",color:"gray.600",fontWeight:"500",children:(0,r.jsx)(N.cC,{id:"ab98Hp",values:{0:null==x?void 0:x.displayName}})})]}),(0,r.jsx)(s.x,{fontSize:v?"xs":"sm",noOfLines:2,whiteSpace:"normal",wordBreak:"break-word",dangerouslySetInnerHTML:{__html:u?ei().sanitize(u):""}}),(0,r.jsxs)(U.U,{children:[m&&m.length>0&&(0,r.jsx)(er.H,{size:"xs",fontSize:"xs",max:5,children:null==m?void 0:m.map(e=>{let{user:t}=e,{id:n,displayName:o,profileImageUrl:i}=t;return(0,r.jsx)(d.Vw,{label:o,src:i,shadow:"base"},n)})}),g&&(0,r.jsx)(s.x,{fontSize:"xs",color:"gray.600",fontWeight:"500",children:(0,r.jsx)(N.cC,{id:"5cC8f2",values:{0:(0,es.P9)(g)}})})]})]})]})})},ec=e=>{let{results:t,focusedIndex:n,focusedItemEl:o,onMouseMove:i}=e;return(0,r.jsx)(Z.K,{spacing:1,px:4,h:["lg","xl"],maxHeight:["lg","xl"],pb:4,overflow:"auto","data-testid":"search-results-wrapper",children:t.map((e,t)=>"DocResult"===e.__typename||"PseudoDocResult"===e.__typename?(0,r.jsx)(ed,{result:e,isActive:n===t,focusedItemEl:o,onMouseMove:()=>{i(t)}},e.id):"Channel"===e.__typename?(0,r.jsx)(et,{result:e,isActive:n===t,focusedItemEl:o,onMouseMove:()=>{i(t)}},e.id):null)})},eu=(0,j.ZP)("mod+K"),ep=e=>{let{query:t,isOpen:n,setResults:r,currentWorkspaceId:o}=e,{data:i}=(0,L.plz)({variables:{first:5,workspaceId:o,archived:!1,sortBy:{field:L.IX5.LastViewed,direction:L.SrV.Desc}},fetchPolicy:"cache-first",skip:!n});(0,u.useEffect)(()=>
1{if(t.length>0||!n)return;let e=(null==i?void 0:i.docs.edges.map(e=>e.node))||[],o=e.slice(0,5).map(e=>{let{id:t,title:n,archived:r,titleCard:o,createdBy:i,editors:a,createdTime:l,editedTime:s,updatedTime:d}=e;return{id:t,title:n,archived:r,previewUrl:null==o?void 0:o.previewUrl,createdBy:i,editors:a,text:"",createdTime:l,editedTime:s,updatedTime:d,__typename:"PseudoDocResult"}});r(o)},[n,t.length,null==i?void 0:i.docs.edges,r])},em=()=>{let{user:e,currentWorkspace:t}=(0,A.SE)(),{isConnected:n}=(0,L.$gs)(),o=(0,w.CG)(g.Ct),[i,a]=(0,u.useState)([]),[l,s]=(0,u.useState)(!0),[c,p]=(0,u.useState)(-1),[m,f]=(0,H.I)(D.H.hasDismissedSearchTip,!1),x=(0,u.useRef)(null),[v,b]=(0,u.useState)(!1),y=(0,w.CG)(g.ak),[C,k]=(0,u.useState)(()=>y||""),[j,{data:I,loading:E}]=(0,L.SVp)();ep({query:C,isOpen:o,setResults:a,currentWorkspaceId:null==t?void 0:t.id});let M=(0,R.Kt)(j,600);(0,u.useEffect)(()=>{0!=y.length&&k(y)},[y]);let O=(0,u.useCallback)(function(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{target:"_self"},{target:n}=t||{},r=(null==x?void 0:null===(e=x.current)||void 0===e?void 0:e.querySelector("[href]")).href;r||console.error("[SearchModal] No href found"),window.open(r,n)}
1,[x]),F=(0,u.useRef)({focusedIndex:c,results:i,goToItem:O,searchInputFocused:l});F.current={focusedIndex:c,results:i,goToItem:O,searchInputFocused:l},(0,u.useEffect)(()=>{if(o)return S.F7.on("keydown","GLOBAL_SEARCH",e=>{let{key:t}=e;if(eu(e))return!0;let n=F.current;switch(t){case"Escape":return e.preventDefault(),e.stopPropagation(),!0;case"Tab":return e.preventDefault(),n.searchInputFocused?p(_()(n.focusedIndex-1,0,n.results.length-1)):p(-1),s(!n.searchInputFocused),!0;case"Enter":return e.preventDefault(),n.searchInputFocused?M.flush():n.results.length>0&&n.goToItem({target:e.metaKey||e.ctrlKey?"_blank":"_self"}),!0;case"ArrowUp":return e.preventDefault(),n.focusedIndex<0?(s(!1),p(n.results.length-1)):0==n.focusedIndex?(s(!0),p(-1)):(s(!1),p(_()(n.focusedIndex-1,-1,n.results.length-1))),b(!0),!0;case"ArrowDown":return e.preventDefault(),n.focusedIndex<0?(s(!1),p(0)):n.focusedIndex>=n.results.length-1?(s(!0),p(-1)):(s(!1),p(_()(n.focusedIndex+1,-1,n.results.length-1))),b(!0),!0;default:return s(!0),p(-1),!1}})},[c,M,o,l]),(0,u.useEffect)(()=>{if(!(null==I?void 0:I.search))return;let e=null==I?void 0:I.search.filter(e=>void 0!==e&&("DocResult"===e.__typename||"Channel"===e.__typename));a(e)},[null==I?void 0:I.search]);let W=(0,u.useCallback)(e=>{let{value:n}=e.target;n?(k(n),M({variables:{workspaceId:null==t?void 0:t.id,query:n}})):(M.cancel(),k(""),a([]),p(-1),s(!0))},[null==t?void 0:t.id,M]),G=(0,u.useCallback)(e=>{b(!1),p(e)},[]),U=(0,R.Z_)(G,50),V=!m&&i.length>0;(0,u.useEffect)(()=>{var e;x.current&&v&&(null==x||null===(e=x.current)||void 0===e||e.scrollIntoView({behavior:"smooth",block:"center",inline:"nearest"}))},[c,v]);let q=C.length>0?(0,r.jsx)(N.cC,{id:"5WYZKZ"}):(0,r.jsx)(N.cC,{id:"AOvC3b"});return e?(0,r.jsxs)(z.k,{direction:"column",children:[(0,r.jsx)(B,{onChange:W,query:C,isDisabled:!n,isLoading:E,isFocused:l}),(0,r.jsx)(P.V,{mx:4,mt:2,mb:4,isConnected:n,label:(0,r.jsx)(N.cC,{id:"R4lJxt"})}),n&&(0,r.jsx)(d.NZ,{p:4,children:q}),n&&i&&i.length>0&&(0,r.jsx)(ec,{focusedItemEl:x,results:i,focusedIndex:c,onMouseMove:U}),!(0,h.s2)()&&(0,r.jsx)(K,{onClose:()=>{f(!0)},showTip:V}),(0,h.s2)()&&(0,r.jsx)(T.o,{})]}):null},eh=e=>{let{isEnabledFn:t}=e,n=(0,w.CG)(g.Ct);E({isEnabledFn:t,isOpen:n});let o=(0,p.I0)(),i=(0,k.i)({base:"sm",sm:"md",md:"lg",lg:"2xl"}),a=(0,u.useCallback)(()=>{o((0,g.Hm)({isOpen:!1,initialQuery:""}))},[o]);return(0,r.jsxs)(v.u_,{isOpen:n,onClose:a,size:i,onOverlayClick:a,returnFocusOnClose:!1,children:[(0,r.jsx)(b.Z,{}),(0,r.jsx)(y.h,{children:(0,r.jsx)(C.f,{p:0,children:(0,r.jsx)(em,{})})})]})}},68727:function(e,t,n){"use strict";n.d(t,{j:function(){return p}});var r=n(52322),o=n(50019),i=n(38035),a=n(43297),l=n(77533),s=n(36474),d=n(42946),c=n(49929),u=n(5879);let p=e=>{let{formatLabel:t,icon:n,accentColor:p,onClick:m,exportInProgress:h,exportInProgressNote:g,badge:f}=e,x=(0,o.ff)("gray.50","whiteAlpha.100"),v=(0,o.ff)("gray.200","gray.700"),b=(0,o.ff)("".concat(p,".100"),"".concat(p,".500")),y=(0,o.ff)("gray.200","gray.700"),C=(0,o.ff)("".concat(p,".500"),"".concat(p,".200")),w=(0,o.ff)("gray.500","gray.300"),k=(0,o.ff)("var(--chakra-colors-".concat(p,"-300)"),"var(--chakra-colors-".concat(p,"-700)")),j=(0,o.ff)("var(--chakra-colors-".concat(p,"-700)"),"var(--chakra-colors-".concat(p,"-300)"));return(0,r.jsxs)(i.k,{alignItems:"stretch",overflow:"hidden",onClick:m,borderRadius:"md",border:"1px",borderColor:(0,o.ff)("gray.200","gray.700"),bgColor:h?v:x,cursor:h?"progress":void 0,disabled:h,as:"button",transitionProperty:"common",transitionDuration:"normal",_hover:h?{}:{boxShadow:"var(--chakra-shadows-md)",borderColor:k,color:j},children:[(0,r.jsx)(i.k,{bgColor:h?y:b,color:"".concat(h?w:C),width:16,minH:16,alignItems:"center",justifyContent:"center",fontSize:"2xl",children:(0,r.jsx)(c.G,{icon:n,fixedWidth:!0})}),(0,r.jsxs)(a.K,{alignItems:"flex-start",spacing:0,p:4,justifyContent:"center",children:[(0,r.jsxs)(l.x,{fontWeight:"medium",children:[(0,r.jsx)(u.cC,{id:"i3Tbgc",values:{formatLabel:t}})," ",f]}),h&&(0,r.jsxs)(l.x,{color:"gray.600",fontSize:"xs",children:[(0,r.jsx)(u.cC,{id:"wRvCQ6",values:{formatLabel:t}})," ",g]})]}),(0,r.jsx)(s.L,{}),!h&&(0,r.jsx)(i.k,{alignItems:"center",pl:4,pr:6,children:(0,r.jsx)(c.G,{icon:d.fuY,size:"1x"})})]})}},30579:function(e,t,n){"use strict";n.d(t,{Ty:function(){return s},ei:function(){return m},l7:function(){return d},tN:function(){return c}});var r=n(52322),o=n(42946),i=n(54933),a=n(5879),l=n(87254);let s=o.Pk,d=i.cC_,c=()=>
1l.ag._({id:"4BKB+B"}),u=()=>({invite:{ariaLabel:l.ag._({id:"b4DayH"}),label:(0,r.jsx)(a.cC,{id:"b4DayH"}),icon:o.FKd,viewKey:"invite"},public:{ariaLabel:l.ag._({id:"Z8lGw6"}),label:(0,r.jsx)(a.cC,{id:"Z8lGw6"}),icon:o.Z_X,viewKey:"public"},export:{ariaLabel:l.ag._({id:"GS+Mus"}),label:(0,r.jsx)(a.cC,{id:"GS+Mus"}),icon:o.fuY,viewKey:"export"},embed:{ariaLabel:l.ag._({id:"KKBlUU"}),label:(0,r.jsx)(a.cC,{id:"KKBlUU"}),icon:o.dT$,viewKey:"embed"}}),p=["invite","public","export","embed"],m=e=>{let{showSharePublic:t=!0,showEmbed:n=!0,showInvite:r=!0,showExport:o=!0}=e,i=p.map(e=>u()[e]);return i.filter(e=>"public"===e.viewKey?t:"embed"===e.viewKey?n:"invite"===e.viewKey?r:"export"!==e.viewKey||o)}},26803:function(e,t,n){"use strict";n.d(t,{H:function(){return p}});var r=n(5632),o=n(2784),i=n(84698),a=n(91994),l=n(47968),s=n(93441),d=n(90383),c=n(50788),u=n(15041);let p=e=>{let{url:t,nonPublishedUrl:n}=e,{push:p}=(0,r.useRouter)(),m=(0,s.gF)(),h=(0,a.CG)(l.yx),g=(0,c.C7)(),f=(0,a.CG)(i.Lw),x=g?(0,d.Op)({url:t,doc:h,previewEnabled:f}):n||t,v=m&&(0,d.sG)(t,h),b=(0,o.useCallback)(e=>{(0,u.BZ)(x)&&(e.preventDefault(),p(x,void 0,{shallow:!0}))},[x,p]);return(0,o.useMemo)(()=>({linkUrl:x,handleClick:f?b:void 0,isCurrentPage:v}),[b,x,f,v])}},53701:function(e,t,n){"use strict";n.d(t,{U:function(){return b}});var r=n(52322),o=n(20437),i=n(30523),a=n(28535),l=n(62614),s=n(32899),d=n(78071),c=n(42822),u=n(42946),p=n(49929),m=n(94523),h=n(5879),g=n(87254),f=n(2784),x=n(22569),v=n(87205);let b=e=>{let{accentImages:t,isDark:n,handleDelete:b,handleItemClick:y,currentAttributes:C,editType:w}=e,k=(0,f.useCallback)(e=>t=>{b&&(t.stopPropagation(),b(e))},[b]),j=(0,f.useCallback)(e=>()=>{y&&y(e)},[y]);return(0,r.jsx)(o.M,{gap:2,columns:{base:2,"2xl":3},children:t.map(e=>{let t=(0,x.wh)(e,n,v.Iv),o=("node"===w||"accessory"===w)&&e.image,f=o?{...e.image,source:e.source}:e,S=o?(null==C?void 0:C.src)===e.image.src:(null==C?void 0:C.accentId)===e.accentId;return(0,r.jsx)(i.P,{children:(0,r.jsxs)(a.xu,{as:l.z,variant:"unstyled",backgroundColor:n?"black":"white",cursor:y?"pointer":void 0,...t,opacity:1,width:"100%",borderRadius:"base",shadow:"md",minH:"100px",position:"relative",role:"group",onClick:j(f),children:[b&&(0,r.jsx)(m.kH,{label:(0,r.jsx)(h.cC,{id:"Rz0Yis"}),placement:"top",children:(0,r.jsx)(s.h,{"aria-label":g.ag._({id:"Rz0Yis"}),icon:(0,r.jsx)(p.G,{icon:u.XAH}),onClick:k(e),isRound:!0,position:"absolute",top:1,right:1,size:"sm",color:"red.600",opacity:0,_hover:{color:"red.600"},_groupHover:{opacity:1}})}),C&&(0,r.jsx)(d.p,{in:S,children:(0,r.jsx)(a.xu,{pointerEvents:"none",color:"white",pos:"absolute",inset:0,bg:"rgba(0,0,0,.5)",borderRadius:"base",children:(0,r.jsx)(c.M,{h:"100%",w:"100%",children:(0,r.jsx)(p.G,{icon:u.LEp})})})})]})},e.accentId)})})}},28601:function(e,t,n){"use strict";n.d(t,{M:function(){return z}});var r=n(52322),o=n(17993),i=n(74008),a=n(38035),l=n(62614),s=n(42946),d=n(49929),c=n(5879),u=n(2784),p=n(11050),m=n(87254),h=n(69024),g=n(20437),f=n(94523);let x=e=>{let{onClick:t,label:n}=e;return(0,r.jsx)(f.kH,{label:n,placement:"top",children:(0,r.jsx)(l.z,{display:"inline-flex",alignSelf:"center",boxSize:"26px",borderRadius:"md",border:"1px solid",borderColor:"blackAlpha.300",bgColor:"gray.50",onClick:t,variant:"unstyled",minW:0,fontSize:"xs",transitionProperty:"border",transitionDuration:"normal",textAlign:"center",children:(0,r.jsx)(a.k,{justify:"center",align:"center",children:(0,r.jsx)(d.G,{icon:s.r8p})})})})};var v=n(56581),b=n(3543);let y=e=>{let{color:t,setColor:n,isActive:o,name:i}=e,a=(0,b.DP)(t)?"white":"black";return(0,r.jsx)(f.kH,{label:i||t.toUpperCase(),placement:"top",children:(0,r.jsx)(l.z,{display:"inline-block",alignSelf:"center",boxSize:"26px",borderRadius:"md",border:"1px solid",borderColor:"blackAlpha.300",color:a,bgColor:null!=t?t:"#FFFFFF",onClick:()=>n(t),variant:"unstyled",minW:0,fontSize:"xs",transitionProperty:"border",transitionDuration:"normal",children:o&&(0,r.jsx)(v.n,{})})})},C=e=>{let{label:t,colors:n,setColor:o,currentColor:i,isDefault:a,handleAddColorButtonClick:l,addColorLabel:s="Add color"}=e;return(0,r.jsx)(h.k,{title:t,children:(0,r.jsxs)(g.M,{gap:1.5,columns:6,p:2,children:[n.map((e,t)=>{let{hex:n,name:l}=e;return(0,r.jsx)(y,{name:l,color:n,setColor:o,isActive:a?null===i:i===n},t)}),l&&(0,r.jsx)(x,{onClick:l,label:s})]})})},w=()=>
1[{key:"black",hex:"#000000",name:m.ag._({id:"THokF3"})},{key:"dark-gray",hex:"#4D4D4D",name:m.ag._({id:"uUMrFZ"})},{key:"gray",hex:"#808080",name:m.ag._({id:"qS5//Q"})},{key:"light-gray",hex:"#CCCCCC",name:m.ag._({id:"xa/b9m"})},{key:"white-smoke",hex:"#F2F2F2",name:m.ag._({id:"rGj3KB"})},{key:"white",hex:"#FFFFFF",name:m.ag._({id:"5Ex+AP"})},{key:"light-sun",hex:"#FCEC99",name:m.ag._({id:"nOXj3q"})},{key:"peach",hex:"#FFD1A7",name:m.ag._({id:"68+2yw"})},{key:"salmon",hex:"#FAA1A1",name:m.ag._({id:"TrGQaZ"})},{key:"lavender",hex:"#D8AFF8",name:m.ag._({id:"gc4DdH"})},{key:"baby-blue",hex:"#AFCBF8",name:m.ag._({id:"+bmpN5"})},{key:"pale-green",hex:"#AEE4BD",name:m.ag._({id:"hUOhvE"})},{key:"gold",hex:"#F9D933",name:m.ag._({id:"FYlHHU"})},{key:"orange",hex:"#FFA44F",name:m.ag._({id:"4OE5Sf"})},{key:"red",hex:"#F44444",name:m.ag._({id:"wRTiSD"})},{key:"purple",hex:"#B05EF1",name:m.ag._({id:"mF9LxA"})},{key:"blue",hex:"#5E98F1",name:m.ag._({id:"Zn5crm"})},{key:"green",hex:"#5CC97B",name:m.ag._({id:"VmkjGB"})},{key:"dark-goldenrod",hex:"#957D00",name:m.ag._({id:"vWWr+k"})},{key:"brown",hex:"#995515",name:m.ag._({id:"JLxwQS"})},{key:"maroon",hex:"#910D0D",name:m.ag._({id:"cg4yu3"})},{key:"dark-purple",hex:"#5E208E",name:m.ag._({id:"oqSDkM"})},{key:"midnight-blue",hex:"#204C8E",name:m.ag._({id:"QCyMdk"})},{key:"forest-green",hex:"#1F7135",name:m.ag._({id:"HVCLqF"})}],k=e=>{let{setColor:t,currentColor:n}=e;return(0,r.jsx)(C,{label:m.ag._({id:"Zp2USm"}),colors:w(),setColor:t,currentColor:n})};var j=n(91994),S=n(50260),A=n(69747),I=n(47968);let E=e=>{let{setColor:t,currentColor:n}=e,o=(0,j.CG)(I.Pu),i=(0,S.Wz)(o).map(e=>({hex:e,key:e}));return(0,r.jsx)(C,{label:m.ag._({id:"J1XRO3"}),colors:i,setColor:t,currentColor:n,handleAddColorButtonClick:()=>{A.pw.emit(A.TI.OPEN_THEME_EDITOR,{})},addColorLabel:null===o.workspaceId?m.ag._({id:"0TWTg2"}):m.ag._({id:"TExCtI"})})},z=e=>{let{currentColor:t,setColor:n,unsetColor:m=()=>n(null),source:h}=e,g=(0,p.z$)(),f=(0,u.useCallback)(e=>{null==g||g.track(p.AA.COLOR_PICKER_SET_COLOR,{color:e,source:h}),n(e)},[n,g,h]),x=(0,u.useCallback)(()=>{null==g||g.track(p.AA.COLOR_PICKER_RESET,{source:h}),m()},[m,g,h]);return(0,p.If)(e=>{e.track(p.AA.COLOR_PICKER_OPENED,{source:h})},[h]),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(o.g,{divider:(0,r.jsx)(i.i,{}),p:0,align:"start",children:[(0,r.jsx)(E,{setColor:f,currentColor:t}),(0,r.jsx)(k,{setColor:f,currentColor:t})]}),(0,r.jsx)(a.k,{px:5,py:3,bg:"gray.100",alignItems:"center",justifyContent:"center",mx:-2,mb:-2,mt:2,children:(0,r.jsx)(l.z,{onClick:x,variant:"link",size:"sm",colorScheme:"gray",leftIcon:(0,r.jsx)(d.G,{icon:s.X7o}),children:(0,r.jsx)(c.cC,{id:"L+rMC9"})})})]})}},5200:function(e,t,n){"use strict";n.d(t,{J:function(){return s},P:function(){return d}});var r=n(52322),o=n(11082),i=n(2784),a=n(50788),l=n(17821);let s=e=>{let{fonts:t}=e,n=(0,a.C7)(),s=null==t?void 0:t.find(e=>"Eudoxus Sans"===e.id),d=(0,i.useMemo)(()=>(null==t?void 0:t.filter(e=>e.url))||[],[t]);return(0,r.jsxs)(r.Fragment,{children:[s?(0,r.jsx)(l.ZP,{shouldUsePublishedVersion:n}):null,d.map(e=>(0,r.jsx)(o.r,{as:"link",href:e.url,rel:"stylesheet","data-gamma-font":e.id},e.id))]})},d=e=>{let{theme:t}=e;return(0,r.jsx)(s,{fonts:null==t?void 0:t.fonts})}},15151:function(e,t,n){"use strict";n.d(t,{J:function(){return a}});var r=n(93814),o=n(98285),i=n(27333);let a=(e,t)=>({...(0,i.A3)(e),...(0,o.WX)(e,t),[".".concat(r.vD," .").concat(r.pL)]:e.config.contentStyles})},19194:function(e,t,n){"use strict";n.d(t,{Eo:function(){return i},NC:function(){return l},Yw:function(){return a},_M:function(){return s}});var r=n(3543),o=n(27333);let i=(e,t)=>{if(!e)return;let n=(0,r.DP)(e)?(0,r.DT)(e,10):(0,r.DT)(e,-10),o={"--shape-border-color-override":n};return t?o:{"--shape-bg-color-override":e,...o}},a=e=>{if(!e)return{textColor:void 0,textColorVars:void 0};let t=(0,r.DP)(e)?"#fff":"#000",n=l(t);return{textColor:t,textColorVars:n}},l=e=>{if(e)return{"--body-color":e,"--heading-color":e,"--link-color":e}},s=function(e){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1];if(!e)return;let n=i(e);if(!t)return n;let{textColor:r,textColorVars:l}=a(e),s=r?(0,o.Mt)(r):void 0;return{...n,...l,...s}}},5995:function(e,t,n){"use strict";n.d(t,{l:function(){return p}});var r=n(6238),o=n.n(r),i=n(62685),a=n(3543),l=n(34135),s=n(47749),d=n(89098),c=n(52099),u=n(66479);let p=o()((e,t)=>{var n;
1let r=(0,i.Jh)(e),{bodyFont:o,headingFont:p,fonts:m}=e,h=(0,c.Yw)(m,o)||s.ke.bodyFont,g=(0,c.Yw)(m,p)||s.ke.headingFont,f=(0,u.e9)(e),x=t?(0,a.DP)(t):(0,u.wj)(e),{bodyColor:v=x?s.Z_:s.zL,headingColor:b=x?s.Qw:s.l0,headingGradient:y,accentGradient:C,disableReadabilityAdjustment:w}=e.config,k=null!=t?t:(0,i.BA)(e,{...r,isDark:x}),j=void 0!==t,S=!w||j,A=j?6:4.5,I=j?4.5:3,E=S?(0,a.e5)(f,k,I,!1):f,z=S?(0,a.e5)(v,k,A,j):v,T=S?(0,a.e5)(b,k,I,j):b,N=(0,u.lQ)(e).map(e=>S?(0,a.e5)(e,k,A,!1):e),M=(0,d.c)(e),_=(null===(n=M.getCSSVars)||void 0===n?void 0:n.call(M,{cardColor:k,accentColor:f,accentPalette:N}))||{};return{"--body-font":'"'.concat(h,'"'),"--heading-font":'"'.concat(g,'"'),"--heading-font-weight":(0,c.On)(e,"heading"),"--body-font-weight":(0,c.On)(e,"body"),"--accent-color":f,"--accent-gradient-background":(0,l.wZ)((0,l.UL)(C,x?.25:.9)),"--accent-color-background":x?(0,a.m2)(f,.25):(0,a.m2)(f,.9),"--accent-color-border":x?(0,a.m2)(f,.3):(0,a.m2)(f,.8),"--accent-color-background-muted":x?(0,a.m2)(f,.15):(0,a.m2)(f,.95),"--accent-color-100":(0,a.m2)(f,.9),"--accent-color-500":(0,a.m2)(f,.5),"--accent-gradient":(0,l.wZ)(S?(0,l.Ux)(C,k,I,!1):C),"--expandable-hover-background":(0,a.tT)(E,.1),"--link-color":E,"--link-color-hover":(0,a.tG)(E,-10),"--body-color":z,"--body-color-muted":(0,a.tT)(z,.5),"--body-color-inverted":x?"#000":"#fff","--link-color-inverted":(0,a.DP)(E)?"#fff":"#000","--highlight-color-dark":x?"var(--body-color)":"var(--body-color-inverted)","--highlight-color-light":x?"var(--body-color-inverted)":"var(--body-color)","--heading-color":T,"--heading-gradient":(0,l.wZ)(S?(0,l.Ux)(y,k,I,j):y),"--card-color":k,"--card-color-mask":(0,a.tT)(k,(0,a.DP)(k)?.8:.85),"--link-box-shadow":"0 0 0px 3px ".concat((0,a.tT)(E,1)),"--shape-border-image-svg":"url()","--shape-bg-image-svg":"url()",..._}})},52099:function(e,t,n){"use strict";n.d(t,{On:function(){return i},W9:function(){return d},YO:function(){return s},Yw:function(){return l},eu:function(){return a},s8:function(){return c}});var r=n(13608),o=n(47749);let i=(e,t)=>{var n;return null!==(n=e["body"===t?"bodyFontWeight":"headingFontWeight"])&&void 0!==n?n:o.ZT[t]},a=e=>e&&["adonis-web","p22-mackinac-pro"].includes(e),l=function(e,t){var n;let r=!(arguments.length>2)||void 0===arguments[2]||arguments[2];return r&&a(t)?t:null==e?void 0:null===(n=e.find(e=>e&&e.id===t))||void 0===n?void 0:n.name},s=(e,t)=>{let n=l(t.fonts,t.headingFont)||o.ke.headingFont,i=l(t.fonts,t.bodyFont)||o.ke.bodyFont;return".".concat(r.pL," {\n --heading-font: ").concat('"'.concat(n,'", ')).concat(e,", sans-serif;\n --body-font: ").concat('"'.concat(i,'", ')).concat(e,", sans-serif;\n }")},d=e=>{var t;if(!e)return[];let n=null===e.workspaceId&&(null===(t=e.fontFiles)||void 0===t?void 0:t.length)===0;if(n)return[400,600,700];{let t=(e.fontFiles||[]).map(e=>e.weight);return Array.from(new Set(t)).sort((e,t)=>e-t)}},c=e=>{let{fontsMap:t,bodyFontId:n,headingFontId:r}=e,i=t[o.ke.headingFont],a=t[o.ke.bodyFont],l=t[n]||a,s=t[r]||i,d={id:l.id,name:l.name,url:l.cssUrl},c={id:s.id,name:s.name,url:s.cssUrl};return[d,c]}},92440:function(e,t,n){"use strict";n.d(t,{S:function(){return P}});var r=n(52322),o=n(50019),i=n(28535),a=n(38035),l=n(87651),s=n(29117),d=n(36474),c=n(62614),u=n(42946),p=n(49929),m=n(94523),h=n(5879),g=n(87202),f=n(2784),x=n(43997),v=n(93441),b=n(90507),y=n(47968),C=n(11093),w=n(70675),k=n(30541),j=n(77381),S=n(31230),A=n(17487),I=n(40279),E=n(97253),z=n(8904),T=n(23450),N=n(13653);let M=()=>[k.Z.configure({horizontalRule:!1,codeBlock:!1}),T.L,w.Z.configure({openOnClick:!1}),S.d,I.E,z.cB,z.s6,z.nk,A.Hy,j.l,A.Pi,E.R,N.Jn],_=(0,g.P6)("mod+Enter"),L=(0,g.P6)("mod+a"),P=f.memo(e=>{let{clearContentOnSave:t=!1,editable:n=!0,saveButtonText:g=(0,r.jsx)(h.cC,{id:"tfDRzk"}),saveButtonIcon:w=(0,r.jsx)(p.G,{icon:u.XCy}),initialContent:k="",placeholder:j="Reply",showBorder:S=!0,onCancelEditingClick:A,onCommentSave:I,onCreate:E=()=>{},onUpdate:z=()=>{},shouldFocus:T=!0,alwaysShowButtons:N=!1,...P}=e,R=(0,f.useMemo)(()=>M(),[]),H=(0,x.v9)(y.ke),D=(0,x.v9)(y.KV),O=(0,b.jE)({extensions:R,content:k,onCreate:e=>{let{editor:t}=e;E({editor:t}),t.gammaDocId=H,t.gammaOrgId=D},onUpdate:e=>{let{editor:t,transaction:n}=e;z({editor:t,transaction:n})}});(0,f.useEffect)(()=>{O&&O.setOptions({editable:n})},[O,n]),(0,v.vm)(()=>{O&&T&&O.isEditable&&O.commands.focus("end")},[O,T],[O]),(0,f.useEffect)(()=>{O&&!n&&(null==O||O.commands.setContent(k))},[O,k,n]);let{colorMode:B}=(0,o.If)(),F="light"===B,W=e=>{L(e)&&(e.preventDefault(),null==O||O.commands.selectAll()),_(e)&&(e.preventDefault(),e.stopPropagation(),G())},G=()=>{if(!I||!O||(0,C.$y)(O.state.doc)||(0,C.WL)(O.state.doc))return;let e=O.getJSON();I(e),t&&O.commands.clearContent(!0)};return n?(0,r.jsxs)(a.k,{"data-gamma-child-tiptap-editor":"comment-editor",direction:"column",...P,children:[(0,r.jsx)(i.xu,{tabIndex:0,w:"100%",onKeyDownCapture:W,onKeyPressCapture:W,className:"comment-editor",color:F?"gray.800":"gray.200",bg
1:F?"white":"gray.800",...S?{border:"1px solid",borderColor:F?"gray.200":"gray.700",borderRadius:"md"}:{},sx:{"p:first-of-type::before":(null==O?void 0:O.isEmpty)?{content:'"'.concat(j,'"'),float:"left",color:F?"gray.400":"gray.500",pointerEvents:"none",height:"0"}:""},fontSize:"sm",children:(0,r.jsx)(b.kg,{editor:O,className:"comment-editor",style:{wordBreak:"break-word",width:"100%"}})}),(0,r.jsxs)(l.U,{in:!!(N||O&&!O.isEmpty),children:[(0,r.jsx)(i.xu,{h:3,children:(0,r.jsx)(r.Fragment,{})}),(0,r.jsxs)(s.U,{children:[(0,r.jsx)(d.L,{}),!!A&&(0,r.jsx)(m.kH,{label:(0,r.jsx)(h.cC,{id:"zeQdHz"}),placement:"top",children:(0,r.jsx)(c.z,{size:"sm",variant:"ghost",onClick:()=>{A&&A(),null==O||O.commands.clearContent(!0)},colorScheme:"red",children:(0,r.jsx)(h.cC,{id:"dEgA5A"})})}),(0,r.jsx)(c.z,{size:"sm",variant:"solid",leftIcon:w,isDisabled:(null==O?void 0:O.isEmpty)||(0,C.WL)(null==O?void 0:O.state.doc),onClick:G,"data-testid":"post-comment",children:g})]})]})]}):(0,r.jsx)(i.xu,{fontSize:"sm",children:(0,r.jsx)(b.kg,{editor:O})})})},77377:function(e,t,n){"use strict";n.d(t,{y:function(){return lA},e:function(){return lw}});var r,o,i,a,l=n(52322),s=n(28535),d=n(36518),c=n(78563),u=n(39615),p=n(3517),m=n(2784),h=n(43997),g=n(14274),f=n(64467),x=n(23405),v=n(91994),b=n(24781),y=n(38035),C=n(94523),w=n(29318),k=n(85e3),j=n(50019),S=n(76643),A=n(43297),I=n(62614),E=n(82554),z=n(74008),T=n(82655),N=n(49929),M=n(5879),_=n(87254),L=n(29957),P=n(40335),R=n(42111),H=n(16893),D=n(48892),O=n(67261),B=n(86323),F=n(98081),W=n(94297),G=n(50593),U=n(13988),V=n(57670);(r=i||(i={})).Cards="cards",r.Images="images",r.Apps="apps",r.Videos="videos",r.Layouts="layouts",r.Text="text",r.Forms="forms",(o=a||(a={})).Uncategorized="Other",o.Tables="Tables",o.Columns="Columns",o.SmartLayout="Smart layouts",o.Lists="Lists",o.Text="Text",o.Diagrams="Diagrams",o.Interactive="Interactive",o.New="New",o.Callouts="Callout boxes";let q={[a.Uncategorized]:(0,l.jsx)(M.cC,{id:"/IX/7x"}),[a.Tables]:(0,l.jsx)(M.cC,{id:"8+4V8D"}),[a.Columns]:(0,l.jsx)(M.cC,{id:"jEu4bB"}),[a.SmartLayout]:(0,l.jsx)(M.cC,{id:"uNnHCK"}),[a.Lists]:(0,l.jsx)(M.cC,{id:"h16FyT"}),[a.Interactive]:(0,l.jsx)(M.cC,{id:"jijeT/"}),[a.Text]:(0,l.jsx)(M.cC,{id:"xeiujy"}),[a.Diagrams]:(0,l.jsx)(M.cC,{id:"muZ1GG"}),[a.New]:(0,l.jsx)(M.cC,{id:"isRobC"}),[a.Callouts]:(0,l.jsx)(M.cC,{id:"uJ8xrP"})},$=()=>{let e=(0,B.zm)();return{[i.Cards]:{name:_.ag._({id:"4z8XKi"}),icon:T.rZt,itemGroups:(0,W.V)()},[i.Images]:{name:_.ag._({id:"an5hVd"}),icon:T.VmB,itemGroups:[{subcategory:q[a.Uncategorized],items:[...G.c.filter(e=>"image"===e.nodeName),e.gallery]}]},[i.Apps]:{name:_.ag._({id:"Nz7jbx"}),icon:T.m6E,itemGroups:[{subcategory:q[a.Uncategorized],items:[...G.c.filter(e=>"embed"===e.nodeName&&(!e.categories||e.categories.includes("app")))]}]},[i.Videos]:{name:_.ag._({id:"86kBVB"}),icon:T.CjD,itemGroups:[{subcategory:q[a.Uncategorized],items:[e.gallery,...G.c.filter(e=>"video"===e.nodeName)]}]},[i.Layouts]:{name:_.ag._({id:"w61hKo"}),icon:T.Y$l,itemGroups:[{subcategory:q[a.Columns],items:[e.columns2,e.columns3,e.columns4]},{subcategory:(0,l.jsx)(M.cC,{id:"JxTeLK"}),items:U.js},{subcategory:(0,l.jsx)(M.cC,{id:"9qIAFJ"}),items:U.ne},{subcategory:q[a.Diagrams],items:V.h}]},[i.Text]:{name:_.ag._({id:"8nVVMR"}),icon:T.nUG,itemGroups:[{subcategory:q[a.Text],items:[e.title,e.h1,e.h2,e.h3,e.h4,e.blockquote]},{subcategory:q[a.Tables],items:[e.table2,e.table3,e.table4]},{subcategory:q[a.Lists],items:[e.bulletedList,e.numberedList,e.todoList]},{subcategory:q[a.Callouts],items:(0,F.Di)()},{subcategory:q[a.Interactive],items:[e.buttonGroup,e.toggle]},{subcategory:q[a.Uncategorized],items:[e.codeBlock,e.mathBlock,e.footnote,e.contributors,e.tableOfContents,e.divider]}]},[i.Forms]:{name:_.ag._({id:"4Kic3M"}),icon:T.aJJ,itemGroups:[{subcategory:q[a.Uncategorized],items:[e.buttonGroup,...G.c.filter(e=>{var t;return"embed"===e.nodeName&&(null===(t=e.categories)||void 0===t?void 0:t.includes("form"))})]}]}}},K=()=>[[i.Cards,i.Layouts],[i.Text,i.Images,i.Videos,i.Apps,i.Forms]],Z=()=>K().map(e=>e.map(e=>$()[e])),Y=e=>{let{editor:t}=e,n=(0,H.A)(Z),r=(0,R.Zd)(),[o,i]=m.useState(null),a=(0,m.useRef)(null),s=(0,R.ye)("aiChat"),d=(0,R.ye)("aiCardDesigner"),c={bg:(0,j.ff)("#F9FAFBDD","gray.900"),border:(0,j.ff)("whiteAlpha.600","whiteAlpha.100"),iconColor:(0,j.ff)("trueblue.600","trueblue.200"),dividerColor:(0,j.ff)("blackAlpha.200","whiteAlpha.200")};
1return(0,S.O)({ref:a,handler:e=>{e.target.closest("[data-insert-widget-popover]")||i(null)}}),(0,l.jsxs)(l.Fragment,{children:[s&&(0,l.jsx)(C.kH,{label:(0,l.jsx)(M.cC,{id:"EVnzPs"}),placement:"left",children:(0,l.jsx)(A.K,{position:"relative",children:(0,l.jsxs)(I.z,{"data-guider-highlight":"design-partner-button",position:"relative",color:c.iconColor,"aria-label":_.ag._({id:"EVnzPs"}),bg:c.bg,p:1,borderWidth:"1px",borderColor:c.border,borderRadius:"md",shadow:"lg",mb:3,onClick:()=>{D.T.emit("toggle",{})},height:12,fontSize:"lg",children:[(0,l.jsx)(N.G,{icon:T.JyM}),(0,l.jsx)(E.C,{fontSize:"10px",px:"0.5",colorScheme:"trueblue",position:"absolute",bottom:1,right:1,children:(0,l.jsx)(M.cC,{id:"jsQZMk"})})]})})}),d&&(0,l.jsx)(C.kH,{label:"Design with AI",placement:"left",children:(0,l.jsxs)(I.z,{color:c.iconColor,"aria-label":"Design with AI",bg:c.bg,p:1,borderWidth:"1px",borderColor:c.border,borderRadius:"md",shadow:"xl",mb:3,onClick:()=>{let e=prompt("What do you want to change?",P.B);e&&L.T.emit("openSuggestionEditor",{cardId:null,userMessage:e})},children:[(0,l.jsx)(N.G,{icon:T.Hh4}),(0,l.jsx)(E.C,{colorScheme:"trueblue",position:"absolute",bottom:1,right:1,children:(0,l.jsx)(M.cC,{id:"jsQZMk"})})]})}),(0,l.jsx)(A.K,{bg:c.bg,color:c.iconColor,p:1,borderWidth:"1px",borderColor:c.border,borderRadius:"md",shadow:"lg",ref:a,overflow:"hidden",spacing:1,children:n.map((e,n)=>(0,l.jsxs)(m.Fragment,{children:[n>0&&(0,l.jsx)(z.i,{borderColor:c.dividerColor}),e.map(e=>{let{name:n,itemGroups:a,icon:s,featureFlag:d}=e;return d&&!r[d]?null:(0,l.jsx)(O.LT,{itemGroups:a,icon:s,name:n,editor:t,setOpenButton:i,isOpen:o===n},n)})]},n))})]})},X=(0,m.memo)(e=>{let{editor:t}=e,n=(0,w.Yy)(),r=(0,k.k)();return r?(0,l.jsx)(C.Wk,{isDark:n,children:(0,l.jsx)(y.k,{position:"fixed",w:"0%",h:"0%",right:6,top:"50%",alignItems:"center",zIndex:"sticky","data-testid":"insert-widget-wrapper",children:(0,l.jsx)(y.k,{position:"absolute",right:0,"data-guider-highlight":"insert-widget",direction:"column",className:"insert-widget",children:(0,l.jsx)(Y,{editor:t})})})}):null});var J=n(38322),Q=n(36651),ee=n(93441),et=n(96841),en=n(80720),er=n(77381),eo=n(72338),ei=n(79609),ea=n(26151),el=n(90507),es=n(86353),ed=n(4030);let ec=e=>(0,l.jsx)(ed.lO,{...e,children:(0,l.jsxs)(s.xu,{position:"relative","data-selection-ring":"padded",children:[(0,l.jsx)(el.ms,{as:"blockquote"}),(0,l.jsx)(s.xu,{position:"absolute",left:"0",top:"0",height:"100%",w:"var(--line-thickness)",backgroundColor:"var(--accent-color)",backgroundImage:"var(--accent-gradient)"})]})}),eu=ei.ZP.extend({group:"cardBlock layoutBlock footnoteBlock tableBlock smartLayoutBlock",content:"(block | calloutBlock)+",addNodeView:()=>(0,el.fW)(ec,{update:es.E7}),addCommands(){var e;return{...null===(e=this.parent)||void 0===e?void 0:e.call(this),unwrapQuoteOnDelete:()=>e=>{let{state:t,tr:n}=e,{selection:r}=t;if(!r.empty)return!1;let o=(0,eo.Kk)(e=>e.type.name===eu.name)(r);if(!o)return!1;let i=r.from<=o.pos+2;if(!i)return!1;let a=r.$from.blockRange(r.$to);if(!a)return!1;let l=(0,ea.k9)(a);return!!l&&(n.lift(a,l),!0)}}}});var ep=n(86900);let em=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))$/,eh=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))$/,eg=ep.ZP.extend({addInputRules(){return[(0,eo.Cf)({find:em,type:this.type}
1),(0,eo.Cf)({find:eh,type:this.type})]},renderHTML(e){let{HTMLAttributes:t}=e;return["b",(0,eo.P1)(this.options.HTMLAttributes,t),0]}});var ef=n(93486),ex=n(50499),ev=n(36781);let eb=eo.NB.create({name:"buttonGroup",content:"button{1, ".concat(ev.YZ,"}"),group:"block",addNodeView:()=>(0,el.fW)(ex.Ns,{update:es.I_}),parseHTML:()=>[{tag:"div[class=button-group]"},{tag:"buttons"}],renderHTML(e){let{HTMLAttributes:t}=e;return["div",(0,eo.P1)(t,{class:"button-group"}),0]},renderHTMLforAI(e){let{node:t}=e;return["buttons",{},0]}});var ey=n(29117),eC=n(77533),ew=n(73200),ek=n(27333),ej=n(3543),eS=n(47749),eA=n(17238),eI=n(86189),eE=n(70952),ez=n(12304),eT=n(97676),eN=n(89);let eM=e=>{var t;let{node:n,editor:r,getPos:o,decorations:i}=e,{variant:a,icon:d,color:c}=n.attrs,{firstChildSize:u}=(0,eE.z)(i),p=(0,ez.v0)(u),{theme:h,isDark:g}=(0,eA.t)(i),f=null!==(t=h.accentColor)&&void 0!==t?t:eS.uP,{colorScheme:x,icon:v}=(0,F.hw)(a),{backgroundColor:b,iconColor:y,bodyColor:C}=c?e_(c):eL(g,x,f),w=(0,m.useCallback)(()=>{r.isEditable&&r.commands.selectNodeAtPos(o())},[r,o]);return(0,l.jsx)(ed.lO,{...e,children:(0,l.jsxs)(s.xu,{backgroundColor:"".concat(b," !important"),pt:"0.25em",pb:"0.5em",px:"1em",className:"calloutBox",borderRadius:"var(--box-border-radius)",css:{"--body-color":C,"--heading-color":C},"data-selection-ring":!0,pos:"relative",children:[(0,l.jsxs)(ey.U,{direction:"row",align:u?"baseline":"flex-start",spacing:"1em",children:[d&&(0,l.jsx)(eC.x,{sx:p,onClick:w,color:y,mt:u?void 0:"1em",contentEditable:!1,children:(0,l.jsx)(N.G,{icon:v,fixedWidth:!0})}),(0,l.jsx)(el.ms,{style:{flex:"1 1 auto",minWidth:0},className:(0,ew.cx)(ek.LY)})]}),(0,l.jsx)(eI.A,{...e})]})})},e_=e=>{let t=(0,ej.DP)(e),n=t?(0,ej.m2)(e,.7):(0,ej.m2)(e,.3);return{backgroundColor:e,bodyColor:t?"white":"black",iconColor:n}},eL=(e,t,n)=>{let r=e?(0,ej.m2)("accent"===t?n:eT.Ox.dark[t].hex,.15):(0,ej.m2)("accent"===t?n:eT.Ox.light[t].hex,.85),o=e?"accent"===t?(0,ej.m2)(n,.7):eN.eR.dark[t].hex:"accent"===t?(0,ej.m2)(n,.3):eN.eR.light[t].hex;return{backgroundColor:r,bodyColor:e?"white":"black",iconColor:o}},eP=eo.NB.create({name:"calloutBox",group:"cardBlock layoutBlock footnoteBlock smartLayoutBlock",content:"(block | calloutBlock)+",selectable:!0,isolating:!0,containerHandle:!0,addAttributes:()=>({variant:{default:"note"},icon:{default:!0},color:{}}),addNodeView:()=>(0,el.fW)(eM,{update:es.E7}),parseHTML:()=>[{tag:"aside"}],renderHTML(e){let{HTMLAttributes:t}=e;return["aside",(0,eo.P1)(t,{class:"calloutBox"}),0]}});var eR=n(13608),eH=n(52332),eD=n(60491),eO=n(30870),eB=n(50279),eF=n(13793),eW=n(11093),eG=n(38372),eU=n(55478),eV=n(16494),eq=n(2572),e$=n(4878),eK=n(47968),eZ=n(22569),eY=n(87205),eX=n(72975),eJ=n(39018),eQ=n(11050),e0=n(13180),e1=n(13653),e2=n(94804),e3=n(89098);let e4={marginLeft:"1em",path:{stroke:"var(--body-color) !important"}},e5=()=>{let e=(0,v.CG)(eK.Pu),t=(0,e3.c)(e),n=t.ornaments;if(!n)return null;let r=n[0],{image:o}=r;return(0,l.jsx)(s.xu,{position:"absolute",right:"0",top:"0",width:o.width,height:o.height,maxH:"100%",overflow:"hidden",sx:e4,children:(0,l.jsx)(e2.Z,{src:o.src})},r.key)};var e8=n(27483),e9=n(87651),e7=n(75768),e6=n(75009),te=n(42946),tt=n(11550),tn=n(92850),tr=n(26468),to=n(22226),ti=n(2338),ta=n(54326),tl=n(97217),ts=n(69251),td=n(55448),tc=n(80311);let tu=(0,m.memo)(e=>{let{onClose:t,handleAddCard:n}=e,r=(0,tc.ON)("modal");return(0,l.jsxs)(tn.u_,{isOpen:!0,onClose:t,size:"2xl",children:[(0,l.jsx)(tr.Z,{}),(0,l.jsxs)(to.h,{children:[(0,l.jsx)(ti.o,{}),(0,l.jsx)(ta.x,{children:(0,l.jsx)(M.cC,{id:"4z8XKi"})}),(0,l.jsx)(tl.f,{pb:6,children:(0,l.jsx)(A.K,{spacing:6,children:r.map(e=>{let{subcategory:r,items:o}=e;return(0,l.jsxs)(A.K,{children:[(0,l.jsx)(eC.x,{color:"gray.700",children:r}),(0,l.jsx)(ts.r,{templateColumns:"repeat(auto-fill, minmax(80px, 1fr))",gap:3,children:o.map(e=>{let{id:r,name:o,previewImage:i}=e;return(0,l.jsx)(td.L,{isDark:!1,isSelected:!1,name:o(),onClick:()=>{t(),n(r)},w:"auto",image:(0,l.jsx)(e6.E,{src:i.src,bg:"white",borderRadius:"4px"})},r)})})]},r)})})})]})]})});var tp=n(66028);let tm=e=>{let{isVisible:t,setCardContent:n,editor:r}=e,o=(0,w.Yy)(),i=o?"invert(.8) brightness(1.2)":"invert(0)",{items:a}=(0,tc.ON)("placeholder")[0],{isOpen:s,onClose:d,onOpen:c}
1=(0,tt.M)({id:"cardTemplatesModal"});return(0,l.jsxs)(C.Wk,{isDark:o,children:[(0,l.jsx)(e9.U,{in:t,onAnimationComplete:()=>{var e,t;null===(e=(t=r.commands).refreshBubbleMenu)||void 0===e||e.call(t)},children:(0,l.jsxs)(A.K,{overflow:"hidden",mx:16,mb:12,contentEditable:!1,onMouseDown:tp.br,cursor:"default",children:[(0,l.jsx)(eC.x,{color:"var(--body-color-muted)",fontSize:"sm",fontFamily:"Inter",fontWeight:"normal",children:(0,l.jsx)(M.cC,{id:"3h21H3"})}),(0,l.jsxs)(e7.h,{spacing:2,children:[a.map(e=>{let{id:t,name:r,previewImage:a}=e;return(0,l.jsx)(td.L,{name:r(),isDark:o,image:(0,l.jsx)(e6.E,{src:a.src,filter:i,bg:"white",overflow:"hidden",borderRadius:"4px"}),isSelected:!1,onClick:()=>n(t),w:"auto"},t)}),(0,l.jsxs)(y.k,{as:"button","aria-label":"Browse templates",direction:"column",alignItems:"center",justifyContent:"center",h:"auto",py:3,px:6,borderRadius:"md",bg:o?"blackAlpha.600":"blackAlpha.100",color:"gray.500",transition:"all 300ms ease",_hover:{bg:o?"gray.800":"trueblue.50"},onClick:c,children:[(0,l.jsx)(N.G,{icon:te.emM,size:"sm"}),(0,l.jsxs)(eC.x,{fontSize:"xs",children:[(0,l.jsx)(M.cC,{id:"O2UpM1"}),"â¦"]})]})]})]})}),s&&(0,l.jsx)(tu,{onClose:d,handleAddCard:n})]})};var th=n(64300),tg=n(9729),tf=n(96255),tx=n(36783),tv=n(15468),tb=n(32899);let ty=e=>{let{isVisible:t,setLayout:n,editor:r}=e,o=(0,w.Yy)(),i=o?"invert(.8) brightness(1.2)":"invert(0)";return(0,l.jsx)(C.Wk,{isDark:o,children:(0,l.jsx)(e9.U,{in:t,onAnimationComplete:()=>{var e,t;null===(e=(t=r.commands).refreshBubbleMenu)||void 0===e||e.call(t)},children:(0,l.jsxs)(A.K,{overflow:"hidden",mx:16,mb:12,contentEditable:!1,onMouseDown:tp.br,cursor:"default",children:[(0,l.jsx)(eC.x,{color:"var(--body-color-muted)",fontSize:"sm",fontFamily:"Inter",fontWeight:"normal",children:(0,l.jsx)(M.cC,{id:"q+/7Td"})}),(0,l.jsxs)(e7.h,{spacing:1,children:[(0,l.jsx)(tb.h,{"aria-label":_.ag._({id:"loNm+3"}),h:"auto",p:1,variant:"ghost",onClick:()=>n("top"),icon:(0,l.jsx)(e6.E,{src:"/_next/static/media/layout-top.bb63e01e.svg",filter:i})}),(0,l.jsx)(tb.h,{"aria-label":_.ag._({id:"dL4qXb"}),h:"auto",p:1,variant:"ghost",onClick:()=>n("left"),icon:(0,l.jsx)(e6.E,{src:"/_next/static/media/layout-left.deebff4d.svg",filter:i})}),(0,l.jsx)(tb.h,{"aria-label":_.ag._({id:"kVQU97"}),h:"auto",p:1,variant:"ghost",onClick:()=>n("right"),icon:(0,l.jsx)(e6.E,{src:"/_next/static/media/layout-right.af6aebc7.svg",filter:i})}),(0,l.jsx)(tb.h,{"aria-label":_.ag._({id:"3eqz61"}),h:"auto",p:1,variant:"ghost",onClick:()=>n("behind"),icon:(0,l.jsx)(e6.E,{src:"/_next/static/media/layout-behind.f3d267a6.svg",filter:i})})]})]})})})},tC=(e,t,n)=>{if(n)return{};if("behind"===e||"blank"===e)return{borderRadius:"var(--card-border-radius)"};if("left"===e)return"accent"===t?{borderLeftRadius:"var(--card-border-radius)"}:"body"===t?{borderRightRadius:"var(--card-border-radius)"}:{};if("right"===e)return"body"===t?{borderLeftRadius:"var(--card-border-radius)"}:"accent"===t?{borderRightRadius:"var(--card-border-radius)"}:{};if("top"===e||"mobileStacked"===e){if("body"===t)return{borderBottomRadius:"var(--card-border-radius)"};if("accent"===t)return{borderTopRadius:"var(--card-border-radius)"}}return{}},tw=e=>{let{node:t,getPos:n,decorations:r,editor:o}=e,i=t.attrs,{background:a}=i,s=(0,tx.en)(r),{isNested:d}=(0,e8.$D)(r),c=(null==s?void 0:s.layout)==="blank",u=c?{}:(0,eZ.wh)(a,!1),p=tC(s.layout,i.itemId,"full"===s.cardSize),h={flexDirection:"column",justifyContent:i.verticalAlign||"var(--card-vertical-align)"},g=(0,tv.$U)(null==s?void 0:s.layout),f=g&&!g.items[i.itemId],[x]=(0,tg.D)(s.cardId),b=(0,e0.R)(r),C=(0,v.CG)(eK.hN),w=(0,e1.Od)(r),k=(0,th.W)(),j=(0,R.ye)("cardTemplatesPlaceholder"),S=(0,eQ.z$)(),A=C&&b,I=(0,m.useCallback)(e=>{let t=(0,eW.nv)(o.state.doc.resolve(n()),tf.KH),r=t.length>0?t[0].pos:null;r&&(null==S||S.track(eQ.AA.CARD_LAYOUT_UPDATED,{source:"empty-card-placeholder",layout:e}),o.chain().setCardLayout(r,e,k).selectInsideCardBody(r).focus().run())},[o,n,k,S]),E=(0,m.useCallback)(e=>{if(!j)return;let t=(0,eW.nv)(o.state.doc.resolve(n()),tf.KH),r=t.length>0?t[0]:null;if(!r)return;let i=B.e1[e]||B.e1.blankCard,a=r.pos,l=r.pos+r.node.nodeSize;o.chain().insertContentAt({from:a,to:l},i,{updateSelection:!1}).selectInsertedNode().run()},[j,o,n]);return(0,l.jsx)(el.T5,{as:"div",style:{...f?{display:"none"}:{}},children:(0,l.jsxs)(y.k,{"data-content-reference":!0,className:"card-layout-cell-bg",w:"100%",h:"100%",position:"relative","data-selection-ring":!0,"data-selection-background":!0,...u,..."presentCurrent"!==x&&p,...h,children:[c&&(0,l.jsx)(e5,{}),(0,l.jsx)(el.ms,{as:"div",style:{width:"100%"}}),A&&j&&(0,l.jsx)(tm,{isVisible:w,setCardContent:E,editor:o}),A&&!d&&!j&&(0,l.jsx)(ty,{isVisible:c&&w,setLayout:I,editor:o})]})})};var tk=n(59732),tj=n(96214),tS=n(2136);let tA=e=>{var t;let{hasImage:n,onEditImage:r,image:o,editor:i,isLoading:a,...d}=e,c=!!r;return n?null:(0,l.jsx)(y.k,{align:"center",justify:"center",pos:"absolute",inset:0,role:"group",cursor:"default",...n?{}:{bgColor:"gray.200"},...d,children:!i.isThumbnail&&(0,l.jsx)(y.k,{pos:"absolute",inset:0,justify:"center",align:"center",cursor:c?"default":void 0,_hover:c?{filter:"brightness(0.7)"}:void 0,onClick:r,children:(0,l.jsx)(s.xu,{color:"gray.400",children:a?(0,l.jsx)(tS.G,{provider:null==o?void 0:null===(t=o.loadImageParams)||void 0===t?void 0:t.provider}):(0,l.jsx)(N.G,{icon:te.VmB,size:"3x"})})})})},tI=e=>{let{fitType:t,bgProps:n}=e;return"fit"!==t?null:(0,l.jsx)(s.xu,{position:"absolute",inset:"0","data-image-fit-bg":!0,...n,bgPosition:"center",borderRadius:"inherit",children:(0,l.jsx)(s.xu,{backdropFilter:"blur(6em)",inset:0,position:"absolute",borderRadius:"inherit"})})},tE=e=>{let{image:t,resizeParams:n}=e,{src:r,tempUrl:o,meta:i}=t,a=(null==i?void 0:i.frame_count)&&i.frame_count>1,s=r&&!a&&n?(0,eY.SN)(r,n,i):r;return(0,l.jsx)(e6.E,{src:s||void 0,fallbackSrc:o||void 0,w:"100%",borderRadius:"var(--box-border-radius)",pos:"relative"})},tz={width:1200},tT=e=>{let{editor:t,node:n,getPos:r}=e;(0,m.useEffect)(()=>{"cardLayoutItem"===n.type.name&&"accent"===n.attrs.itemId&&setTimeout(()=>{t.commands.command(e=>
1{let{tr:o}=e;return(0,tv.BA)(o,r(),n,t.schema),!0})})},[t,r,n])},tN=e=>{var t,n,r,o;let{node:i,decorations:a,editor:d,getPos:c}=e,u=i.attrs;tT(e);let{openBackgroundTab:p}=(0,eq.a)(),{isOpen:h,onOpen:g,onClose:f}=(0,eU.q)(),[x,b]=(0,m.useState)(0),{background:C}=u,{defaultFullBleed:w}=(0,v.CG)(eK.US),k=(0,tx.en)(a),j=(null==k?void 0:k.cardSize)==="default"?"full"===w:(null==k?void 0:k.cardSize)==="full",S=null==k?void 0:k.cardId,A=null==k?void 0:k.layout,I="behind"===A,E=d.isThumbnail?eY.Iv:"right"===A||"left"===A||"mobileStacked"===A?tz:void 0,z=(0,tj.U)(u,A),T="fit"===z&&C.image,N=T&&!j&&!d.isThumbnail,M=(0,eZ.wh)(C,!1,E),_=(0,tv.$U)(A),L=!!_.items[u.itemId],P=tC(k.layout,u.itemId,"full"===k.cardSize),R="none"===C.type||C.type===eF.E.IMAGE&&!C.image||C.type===eF.E.IMAGE&&!(null===(t=C.image)||void 0===t?void 0:t.src)&&!(null===(n=C.image)||void 0===n?void 0:n.tempUrl),H=(0,m.useCallback)(()=>{d.commands.selectNodeAtPos(c())},[d.commands,c]),D=(0,m.useCallback)(()=>{H()},[H]),O=(0,m.useCallback)(()=>{p(),g()},[g,p]),B=(null===(r=C.image)||void 0===r?void 0:r.loadImageStatus)==="queued",F=(0,v.CG)(eK.hN),W=(0,m.useCallback)(e=>{d.commands.updateNestedAttributesAtPos(c(),e)},[d,c]),G=(0,v.CG)(eK.Pu),U=G.config.accentBackgroundsColorize&&(0,eZ.wh)(G.config.accentBackgroundsColorize,!1);(0,m.useEffect)(()=>tk.T.on("toggleEditBackgroundDrawer",e=>{let{openDrawer:t,cardId:n}=e;t&&n===S&&g()}),[S,g]);let V=null===(o=C.image)||void 0===o?void 0:o.uploadStatus,q=(0,e$.TZ)(),$=!j||"fit"===z||q?void 0:"left"===A||"right"===A?{borderRadius:"var(--box-border-radius)",margin:"1em",height:"auto"}:"top"===A||"behind"===A?{width:"var(--editor-width)",position:"absolute",transform:"translateX(-50%)",left:"calc(50% - var(--doc-padding-left, 0px) / 2 + var(--doc-padding-right, 0px) / 2)"}:void 0;return L?(0,l.jsx)(l.Fragment,{children:(0,l.jsx)(el.T5,{as:"div",style:{display:j?"flex":void 0},children:(0,l.jsxs)(y.k,{"data-content-reference":!0,"data-change-focus-point-el":!0,className:"card-layout-cell-bg",w:"100%",h:"100%","data-selection-ring":"inside","data-selection-background":!0,"data-card-layout":null==k?void 0:k.layout,"data-fit-type":z,position:"relative",...T?void 0:M,"data-drag-handle":!0,...P,flexDirection:"column",justifyContent:"center",...$,bgSize:"fill"===z||I?"cover":"contain",onClick:H,onDoubleClick:O,p:"fill"===z||I?0:"1.25em",objectFit:"contain",children:[N&&(0,l.jsx)(tI,{bgProps:M,fitType:z}),T&&(0,l.jsx)(tE,{image:C.image,resizeParams:E}),U&&(0,l.jsx)(s.xu,{position:"absolute",inset:"0",borderRadius:"inherit",...U,mixBlendMode:"color"}),I&&(0,l.jsx)(eJ.g5,{background:C}),F&&(0,l.jsx)(eq.S,{editor:d,isOpen:h,onClose:f,tabIndex:x,setTabIndex:b,updateNestedAttributes:W,background:null==u?void 0:u.background,enableMask:I,isAccentImageDrawer:!0}),(0,l.jsx)(tA,{isLoading:B,editor:d,hasImage:!R,image:C.image,onEditImage:F?D:void 0,...P}),V==eV.D.Uploading&&F&&(0,l.jsx)(eX.HI,{}),V==eV.D.Error&&(0,l.jsx)(eX.s7,{})]})})}):null},tM=e=>{let{node:t}=e;return"accent"===t.attrs.itemId?(0,l.jsx)(tN,{...e}):(0,l.jsx)(tw,{...e})},t_=eo.NB.create({name:"cardAccentLayoutItem",group:"cardLayoutItemGroup",selectable:!1,atom:!0,draggable:!0,imageKeyPath:"background.image",addAttributes:()=>({itemId:{default:"accent"},fitType:{},background:{default:{type:eF.E.NONE},...(0,eW.sw)("background")}}),addNodeView:()=>(0,el.fW)(tM,{update:es.E7}),addStorage:eG.gk,parseHTML(){return[{tag:"div[class=card-accent-layout-item][bookmark]",getAttrs:(0,eG.xF)(this.storage)},{tag:"div[class=card-accent-layout-item]",context:"card/"}]},renderHTMLforAI(e){let{node:t}=e,n=(0,eG.ml)(this.storage,t),r=t.attrs.background,o=r.image&&(0,eB.K)(r.image);return["div",{bookmark:n,class:"card-accent-layout-item",alt:o}]},renderHTML(e){let{HTMLAttributes:t}=e;return["div",(0,eo.P1)(t,{class:"card-accent-layout-item"})]}});var tL=n(19283),tP=n(78374),tR=n(27191),tH=n(52780),tD=n(46795);let tO=new tR.H$("cardLayoutResizing");class tB{getActiveHandleAbs(e){return this.activeHandle?(0,tD.XV)(e,this.activeHandle):null}reset(){return this.activeHandle=null,this.side=null,this.dragging=null,this}setHandle(e,t){return null===t.setHandle?(this.activeHandle=null,this.side=null):(this.activeHandle=(0,tD.jS)(e,t.setHandle.pos),this.side=t.setHandle.side),this}setDragging(e){return this.dragging=e.setDragging,this}apply(e,t){let n=e.getMeta(tO);return n&&"setHandle"in n?this.setHandle(t,n):n&&"setDragging"in n?this.setDragging(n):n&&"reset"in n?this.reset():this}constructor(){this.activeHandle=null,this.dragging=null}}var tF=n(68015),tW=n.n(tF),tG=n(99137),tU=n(86392);let tV=e=>tO.getState(e.state),tq=(e,t)=>
1{e.dispatch(e.state.tr.setMeta(tO,{setHandle:t}))},t$=(e,t)=>{e.dispatch(e.state.tr.setMeta(tO,{setDragging:t}))},tK=e=>{e.dispatch(e.state.tr.setMeta(tO,{reset:!0}))},tZ=(e,t)=>{if(!e.editable||!t.target||t.target.closest(".column-resize-handle"))return;let n=tV(e);if(n.dragging)return;let r=function(e,t){let n=e.posAtCoords({left:t.clientX,top:t.clientY});if(!n||-1===n.inside)return null;let r=e.domAtPos(n.inside);if(!r)return null;let o=r.node.childNodes[r.offset];if(!o)return null;let i=e.state.doc.resolve(n.inside);if(!i.nodeAfter||!(0,tf.pv)(i.nodeAfter))return null;let a=(0,eW.nv)(i,tf.KH)[0];if(!a)return null;let l=(0,tv.$U)(a.node.attrs.layout);if(!l.allowResizing)return null;let{left:s,right:d}=o.getBoundingClientRect();if(t.clientX-s<=5){let n=e.posAtCoords({left:t.clientX-10,top:t.clientY});if(!n)return null;let r=e.state.doc.nodeAt(n.inside);return r&&(0,tf.pv)(r)?"cardLayoutItem"===r.type.name?{pos:n.inside,side:"right"}:{pos:i.pos,side:"left"}:null}if(d-t.clientX<=5){let n=e.posAtCoords({left:t.clientX+10,top:t.clientY});if(!n)return null;let r=e.state.doc.nodeAt(n.inside);return r&&(0,tf.pv)(r)?"cardLayoutItem"===r.type.name?{pos:n.inside,side:"left"}:{pos:i.pos,side:"right"}:null}return null}(e,t),o=n.getActiveHandleAbs(e.state),i=n.side;null===o&&null===r||r&&r.side===i&&r.pos===o||tq(e,r)},tY=(e,t)=>{let n=e.domAtPos(t),r=n.node.childNodes[n.offset];return r.offsetWidth},tX=(e,t)=>{let{node:n,offset:r}=e.domAtPos(t.start()),o=n.childNodes[r];do if(o&&o.classList&&o.classList.contains("node-card"))break;while(o=o.parentNode);return o},tJ=(e,t,n)=>{let r=(0,tv.$U)(n),o=t.querySelector('[data-node-view-content-inner="card"]'),i=e.attrs,a=(null==o?void 0:o.style.gridTemplateColumns)||i.layoutTemplateColumns||r.grid.gridTemplateColumns;if(!a)return null;let l=a.split(" ");if(!l.length)return null;let s=l[0].includes("fr"),d=[];if(s){let e=l.map(e=>+e.replace("fr","")),t=e.reduce((e,t)=>e+t,0);d=e.map(e=>e/t*100)}else d=l.map(e=>+e.replace("%",""));return d},tQ=eo.NB.create({name:"cardLayoutItem",group:"cardLayoutItemGroup",content:"(block | cardBlock)+",selectable:!1,draggable:!1,isolating:!0,containerHandle:!0,priority:tL.a.CardLayoutItem,addAttributes:()=>({itemId:{default:"body"},background:{default:{},...(0,eW.sw)("background")}}),addNodeView:()=>(0,el.fW)(tM,{update:es.E7}),addCommands:()=>({handleCardAccentDelete:()=>e=>{let{state:t,commands:n}=e;if(!(0,eo.EG)(t.selection))return!1;let{node:r}=t.selection;if(!(0,tv.pt)(r))return!1;let o=(0,eo.Kk)(tf.KH)(t.selection);return!!o&&n.setCardLayout(o.pos,"blank")},selectInsideCardBody:e=>t=>{let{state:n,tr:r,commands:o}=t,i=n.doc.nodeAt(e);if(!i||!(0,tf.KH)(i))return!1;let a=(0,tv.wz)(r,e);if(0===Object.entries(a).length)return o.selectInsideNodeAtPos(e);let l=a.body;return!!l&&o.selectInsideNodeAtPos(l.pos)},setCardLayout:(e,t,n)=>r=>{let{tr:o,editor:i}=r;return(0,tP.G)(i,o,e,t,n)},removeCardLayout:e=>t=>{let{tr:n,editor:r}=t,o=(0,tf.Bw)(r,e);return!!o&&(0,tP.G)(r,n,o.pos,"blank")}}),parseHTML:()=>[{tag:"div[class=card-layout-item]"}],addProseMirrorPlugins(){return[(0,tx.V6)(this.editor),function(){let e=new tR.Sy({key:tO,state:{init:()=>new tB,apply:(e,t,n,r)=>t.apply(e,r)},props:{attributes(e){let t=tO.getState(e),n=t.getActiveHandleAbs(e);return null!==n?{class:"resize-cursor"}:{class:""}},handleDOMEvents:{mousemove:(e,t)=>(tZ(e,t),!1),mouseleave:e=>(!function(e){let t=tV(e),n=t.getActiveHandleAbs(e.state);null===n||t.dragging||tq(e,null)}(e),!1),mousedown:(e,t)=>(!function(e,t){if(!e.editable)return;let n=tV(e),r=n.getActiveHandleAbs(e.state);if(null===r||n.dragging)return;let o=e.state.doc.resolve(r),i=o.node(),a=tX(e,o),l=a.querySelector('[data-node-view-content-inner="card"]');if(!l)return;let s=n.side,d=l.offsetWidth,c=tY(e,r),u=tJ(i,a,i.attrs.layout);if(!u)return;t$(e,{startX:t.clientX,startWidth:c,colWidths:u,totalWidth:d,colIndex:0});let p=null;function m(){window.removeEventListener("mouseup",m),window.removeEventListener("mousemove",h);let t=tV(e);if(t.dragging){if(null===p){t$(e,null);return}if(t.dragging)try{let n=t.getActiveHandleAbs(e.state);(function(e,t,n){let r=e.state.doc.resolve(t),o=r.before(),i=n.map(e=>"".concat(e,"%")).join(" "),a=e.state.tr.setNodeAttribute(o,"layoutTemplateColumns",i);e.dispatch(a),function(e,t){let n=e.state.doc.resolve(t),r=tX(e,n),o=r.querySelector('[data-node-view-content-inner="card"]');o&&(o.style.gridTemplateColumns="")}(e,t)})(e,n,p),t$(e,null)}catch(t){tK(e)}p=null}}function h(t){if(!t.which)return m();let n=tV(e),r=n.getActiveHandleAbs(e.state);if(!n.dragging||null===r)return;let{colWidths:o}=n.dragging,i=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,{totalWidth:r}=e,o=t.clientX-e.startX;return tW()(100*o/r/n,0)*n}(n.dragging,t,.1),l=o[0],d="left"===s?[25,37.5,50]:[50,62.5,75],c=l+i<d[0]?d[0]:l+i>d[d.length-1]?d[d.length-1]:d.find(e=>6.25>=Math.abs(e-l-i));(function(e,t){let n=e.querySelector('[data-node-view-content-inner="card"]');n&&(n.style.gridTemplateColumns=t.map(e=>"".concat(e,"%")).join(" "))})(a,p=(0,tG.GI)(o,0,c-l,25)),(0,tU.CI)(a)}window.addEventListener("mouseup",m),window.addEventListener("mousemove",h),t.preventDefault()}(e,t),!1)},decorations(e){let t=tO.getState(e),n=t.getActiveHandleAbs(e);if(null!==n){let r=[];try{let o=document.createElement("div");
1o.className="column-resize-handle ".concat(t.side),r.push(tH.p.widget(n+1,o));let i=e.doc.nodeAt(n);return r.push(tH.p.node(n,n+i.nodeSize,{class:"has-column-resize-handle"})),tH.EH.create(e.doc,r)}catch(e){return console.error("(caught) cardLayoutResizing error: ".concat(e.message)),tH.EH.empty}}},nodeViews:{}}});return e}()]},renderHTML(e){let{HTMLAttributes:t}=e;return["div",(0,eo.P1)(t,{class:"card-layout-item"}),0]}});var t0=n(55388),t1=n(9850),t2=n.n(t1),t3=n(75420),t4=n(77220),t5=n(17487),t8=n(97253),t9=n(23450),t7=n(74585),t6=n(35251);class ne extends el.Al{updateProps(e){this.isDestroyed||this.renderer.updateProps(e)}mountEditor(){let e=this.editor,{nodeName:t,preventNodeOrExtensionTypes:n}=this.editorOptions,r=[...lw({isInnerEditor:!0}),t7.W,t5.Pi,e1.Jn,t8.R,nn.configure({outerEditor:e,getPos:this.getPos}),t9.L,t4.NM].filter(e=>!n||!n.includes(e.name)).map(e=>e.name===t?e.extend({topNode:!0}):e);return this.innerEditor=new t3.M({extensions:r,content:{type:t,content:this.node.content.toJSON(),attrs:t2()(this.node.attrs)},onBeforeCreate(r){let{editor:o}=r;o.schema.nodes={...e.schema.nodes},null==n||n.forEach(e=>{o.schema.nodes[e]&&delete o.schema.nodes[e]}),o.schema.marks={...e.schema.marks},o.schema.topNodeType=e.schema.nodes[t],o.extensionManager.schema=o.schema}}),this.innerEditor.gammaOrgId=e.gammaOrgId,this.innerEditor.gammaDocId=e.gammaDocId,this.innerEditor.parentEditor=e,this.innerEditor.view.updateState=function(e){if(!this.docView){this.state=e;return}this.updateStateInner(e,this.state.plugins!=e.plugins)},this.updateProps({innerEditor:this.innerEditor}),this.innerEditor}destroy(){var e;this.isDestroyed=!0,null===(e=this.innerEditor)||void 0===e||e.destroy(),super.destroy()}update(e,t){var n;if(!e.sameMarkup(this.node))return!1;this.node=e;let r=null===(n=this.innerEditor)||void 0===n?void 0:n.view;if(!r)return!0;let o=r.state,i=e.content.findDiffStart(o.doc.content);if(null!=i){let{a:t,b:n}=e.content.findDiffEnd(o.doc.content),a=i-Math.min(t,n);a>0&&(t+=a,n+=a),r.dispatch(o.tr.replace(i,n,e.slice(i,t)).setMeta(t6.z,!0).setMeta("preventAutolink",!0))}return super.update(e,t)}stopEvent(e){return!!this.innerEditor&&this.innerEditor.view.dom.contains(e.target)}ignoreMutation(){return!0}get contentDOM(){return null}constructor(e,t,n){super(e,t,n),this.isDestroyed=!1,this.editorOptions=n,this.updateProps({mountEditor:()=>this.mountEditor(),destroyEditor:()=>{var e,t,n;null===(e=this.innerEditor)||void 0===e||e.destroy(),null===(t=(n=this.editor.commands).forceHideBubbleMenu)||void 0===t||t.call(n,!1),setTimeout(()=>{this.updateProps({innerEditor:void 0})})}})}}function nt(e,t){return n=>new ne(e,n,t)}let nn=eo.hj.create({name:"innerEditorExtension",addOptions:()=>({outerEditor:null,getPos:null}),addProseMirrorPlugins(){let{outerEditor:e,getPos:t}=this.options;return[new tR.Sy({appendTransaction:n=>{let r=n[0];if(!r)return null;if(!r.getMeta(t6.z)){let r=e.state.tr,o=ea.KS.offset(t()+1);for(let e=0;e<n.length;e++){let t=n[e].steps;for(let e=0;e<t.length;e++){let n=t[e],i=n.map(o);!i&&n instanceof ea.FC&&0==n.from&&(i=nr(n,o)),i&&r.step(i)}}r.setMeta(t6.e,!0).setMeta("preventAutolink",!0),r.docChanged&&e.view.dispatch(r)}return null}})]},addKeyboardShortcuts(){let{outerEditor:e}=this.options;return{"Mod-z":()=>e.commands.undo(),"Mod-y":()=>e.commands.redo()}}}),nr=(e,t)=>
1{let n=t.mapResult(e.from,1),r=t.mapResult(e.to,-1),o=t.map(e.gapFrom,1),i=t.map(e.gapTo,1);return n.deletedAcross&&r.deletedAcross||o<n.pos||i>r.pos?null:new ea.FC(n.pos,r.pos,o,i,e.slice,e.insert,e.structure)};var no=n(89996),ni=n(98462);let na=e=>{let{decorations:t,editor:n,getPos:r,destroyEditor:o,mountEditor:i}=e,a=(0,v.TL)();(0,no.t)(n);let{mountEditor:l,activeNoteCardId:s}=(0,v.CG)(f.Vy),{parentCardId:d,isNested:c}=(0,e8.$D)(t),u=!c&&(0,ni.vS)(n,r(),d),p=s===d&&l===i,h=u&&!p&&!!i&&!c&&!n.isThumbnail;(0,m.useEffect)(()=>{h&&a((0,f.IS)({activeNoteCardId:d,mountEditor:i,destroyEditor:o}))},[h,o,a,i,d])};var nl=n(38564),ns=n(3452),nd=n(74684),nc=n(90062);let nu=new tR.H$("cardNotesPlugin"),np=(e,t)=>new tR.Sy({key:nu,props:{attributes:()=>{let n=t.getState();return(0,f.v7)(n)&&(0,ni.uj)()&&!(0,ni.$v)(e)&&(0,eK.hN)(n)&&!e.isStatic?{class:"card-notes-active"}:{class:""}},decorations:n=>{let{doc:r,selection:o}=n,i=t.getState();if(!(0,f.v7)(i)||!(0,ni.uj)()||(0,ni.$v)(e)||!(0,eK.hN)(i)||e.isStatic)return;let a=(0,nd.AQ)(e.state.doc,o.from);if(a)return tH.EH.create(r,[tH.p.node(a.pos,a.pos+a.node.nodeSize,{class:"card-notes-active-parent-card"})])}},appendTransaction:(t,n,r)=>{if(!(0,ni.uj)()||(0,ni.$v)(e)||e.isThumbnail||e.isStatic)return;let o=r.tr;return((0,ns.W)(t,n,r,o,"cardNotes"),nh(t,n,r,o),o.docChanged)?o:null}}),nm=e=>e.map(e=>{let t=e.slice.content,n=0===t.size;return e.from!==e.to&&n?{type:"delete",step:e}:e.from!==e.to||n?e.from===e.to||n?null:{type:"replace",step:e}:{type:"insert",step:e}}).filter(e=>!!e),nh=(e,t,n,r)=>{e.forEach(e=>{let o=e.steps.filter(e=>e instanceof ea.Pu||e instanceof ea.FC);if(1!==o.length)return;let i=e.getMeta(nl.Gt),a=(null==i?void 0:i.isChangeOrigin)===!0;if(a||e.getMeta(t6.e)||e.getMeta("appendedTransaction")||e.getMeta("cardNotesHandled")||e.getMeta("rearrangeCards"))return;let l=nm(o).filter(e=>"delete"===e.type||"replace"===e.type);l.forEach(e=>{let{step:o}=e,{from:i,to:a}=o;t.doc.nodesBetween(i,a,(e,o)=>{if("cardNotes"===e.type.name){var a;let l=t.doc.resolve(o),s=null===(a=(0,eo.qv)(l,tf.KH))||void 0===a?void 0:a.node.attrs.id,d=(0,eo.N2)(n.doc,e=>(0,tf.KH)(e)&&e.attrs.id===s).length;if(!d)return;let c=(0,nd.AQ)(n.doc,i);if(!c){console.warn("[preventNotesDelete] parentCard not found");return}let u=n.doc.resolve(c.pos),p=(0,ni.cM)(u);if(p){let t=(0,nc.lo)(n.doc,c.pos,!1);if(null===t){console.warn("[preventNotesDelete] insertPos not found");return}r.insert(t,e.content)}else{let t=c.pos+c.node.nodeSize-1;r.insert(t,e)}}})})})},ng=eo.NB.create({name:"cardNotes",content:"cardNotesBlock+",selectable:!1,atom:!0,parseHTML:()=>[{tag:"div[class=card-notes]"}],renderHTML(e){let{HTMLAttributes:t}=e;return["div",(0,eo.P1)(t,{class:"card-notes"}),0]},renderText:()=>"",addProseMirrorPlugins(){let e=(0,v.bh)();return[np(this.editor,e)]},addNodeView(){return this.editor.shouldUsePublishedVersion?(0,t0.fW)(()=>null):nt(na,{nodeName:this.name,preventNodeOrExtensionTypes:["dropCursor","smartLayout","doc","document","card","slashMenu","mediaUpload","GammaMention"]})}});var nf=n(47443),nx=n(52929),nv=n(80877),nb=n(74444),ny=n(17993);let nC=e=>(0,l.jsx)(s.xu,{bg:"var(--body-color)",opacity:"0.4",borderRadius:"sm",...e});var nw=n(73544),nk=n(90604),nj=n(90439),nS=n(97010),nA=n(11082),nI=n(48776),nE=n(50788),nz=n(71173),nT=n(46741),nN=n(90383),nM=n(78462),n_=n(8904);let nL=(0,m.memo)(e=>{let{cardId:t,docId:n,editor:r,cards:o,level:i,showNested:a,isPresentMode:d}=e,c=(0,nI.c)(t),u=(0,v.CG)(eK.yx),p=(0,m.useCallback)(e=>{(0,nz.l)(r,e,t)},[r,t]),h=(0,nE.C7)(),g=(0,m.useMemo)(()=>{let e=(0,nM.gq)({cardId:t,docId:n,isPresentMode:d});return h?(0,nN.Op)({url:e,doc:u}):e},[t,n,u,d,h]),{listStyle:f,paddingLeft:x,marginLeft:b}=(0,nT.fY)(i);return c?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(nS.aV,{mb:"0.5em",children:(0,l.jsx)(nS.HC,{listStyleType:f,pl:x,ml:b,children:(0,l.jsx)(s.xu,{display:"inline",children:(0,l.jsx)(nA.r,{href:g,className:"link",role:"link",isExternal:!h,noOfLines:1,wordBreak:"break-word",onClick:p,display:"-webkit-inline-box",verticalAlign:"top",children:(null==c?void 0:c.title)||n_.f8})})})}),a&&o.map(e=>(0,l.jsx)(nL,{cardId:e.id,cards:e.children,editor:r,level:i+1,showNested:a,docId:n,isPresentMode:d},e.id))]}):null});
1nL.displayName="CardTOCItem";let nP=e=>{let{node:t,editor:n,getPos:r}=e,{nested:o}=t.attrs,i=r(),a=(0,nd.AQ)(n.state.doc,i),d=(0,v.CG)((0,eK.ZL)({cardId:null==a?void 0:a.node.attrs.id,showAll:nj.Oj})),c=(0,v.CG)(eK.yx),u=(0,v.CG)(eK.gh),p=(0,v.CG)(eK.Ql),m=u===nk.q.SLIDE_VIEW;return(0,l.jsx)(ed.lO,{...e,as:"div",children:(0,l.jsxs)(s.xu,{cursor:"default",pointerEvents:p?"none":void 0,borderRadius:"var(--box-border-radius)","data-selection-ring":!0,className:"card-toc",children:[0===d.length&&(0,l.jsxs)(nf.b,{colorScheme:"gray",color:"gray.800",fontFamily:"Inter, sans-serif",fontSize:"1em",py:"0.75em",px:"1em",children:[(0,l.jsx)(nx.z,{w:"1em",h:"1em",alignSelf:"center",mr:"0.75em"}),(0,l.jsxs)(s.xu,{children:[(0,l.jsx)(nv.C,{fontSize:"1em",lineHeight:"1.5em",children:"This is the last card."}),(0,l.jsx)(nb.X,{fontSize:"0.75em",lineHeight:"1.5em",children:"Add more cards to generate table of content links automatically."})]})]}),d.map(e=>(0,l.jsx)(nL,{cardId:e.id,cards:e.children,editor:n,level:0,showNested:o,docId:(null==c?void 0:c.id)||"",isPresentMode:m},e.id))]})})},nR=e=>(0,l.jsx)(nw.T,{children:(0,l.jsxs)(ny.g,{spacing:"0.5em",align:"start",children:[(0,l.jsx)(nC,{h:"1em",w:"14em",bg:"var(--link-color)"}),(0,l.jsx)(nC,{h:"1em",w:"14em",bg:"var(--link-color)"}),(0,l.jsx)(nC,{h:"1em",w:"14em",bg:"var(--link-color)"}),(0,l.jsx)(nC,{h:"1em",w:"14em",bg:"var(--link-color)"})]})}),nH=eo.NB.create({name:"tableOfContents",group:"block",atom:!0,selectable:!0,dynamic:!0,addAttributes:()=>({nested:{default:!1}}),parseHTML:()=>[{tag:"div[class=toc]"}],renderHTML(e){let{HTMLAttributes:t}=e;return["div",(0,eo.P1)(t,{class:"toc"})]},addNodeView(){return this.editor.isThumbnail?(0,el.fW)(nR,{update:es.E7}):(0,el.fW)(nP,{update:es.E7})}});var nD=n(37164),nO=n(4889),nB=n(2574),nF=n(38045),nW=n(59309),nG=n(92638),nU=n(10897),nV=n(14582),nq=n(51572);function n$(e){for(let t of e.columns)if("data"===t.type)return t;return null}function nK(e){for(let t of e.columns)if("label"===t.type)return t;return null}var nZ=n(47288),nY=n(31131),nX=n(9315),nJ=n(6802),nQ=n(70258),n0=n(33951),n1=n(75715);let n2={top:8,bottom:16,right:1,left:1},n3=e=>{let{color:t,labelCells:n,dataCells:r,height:o,children:i,textColor:a,tickColor:s,tiny:d=!1,width:c,fontFamily:u="var(--body-font)",fontSize:p="var(--chakra-fontSizes-sm)",fontWeight:h="var(--body-font-weight)",shouldRoundYValues:g=!0,showMaxAndMiddle:f=!0,margin:x=nY.jK,direction:v="vertical",hideLabels:b=!1}=e,y=d?{top:1,right:0,bottom:2,left:0}:n2,C=d?{top:0,right:0,bottom:0,left:0}:x;d&&(p="2px");let w=d?.5:2,k=d?1:6,j=r.map(e=>e.data),S=Math.max(...j),A=[S,Math.round(S/2)],I="vertical"===v?f?A:j:n.map(e=>e.label),E=b?0:n4(I,{fontFamily:u,fontSize:p,fontWeight:h}),z={top:C.top+y.top,right:C.right+y.right,bottom:C.bottom+w+(b?0:k+y.bottom),left:C.left+E+w+(b?0:k+y.left)},T=c-z.left-z.right,N=o-z.top-z.bottom,M=n.map(e=>e.position.row).join(","),{labelScale:_,labelIndex:L}=(0,m.useMemo)(()=>({labelScale:(0,nG.Z)({range:"vertical"===v?[0,T]:[0,N],domain:n.map(e=>e.position.row),padding:.3}),labelIndex:Object.fromEntries(n.map(e=>[e.position.row,e]))}),[T,v,N,M]),P=(0,m.useMemo)(()=>(0,n0.Z)({range:"horizontal"===v?[0,T]:[N,0],round:!0,domain:[0,S]}),[N,S,T,v]);return(0,l.jsxs)("svg",{width:c,height:o,children:[i({labelScale:_,dataScale:P,yMax:N,margin:{...z}}),(0,l.jsx)(nW.Z,{children:"vertical"===v?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(nJ.Z,{top:z.top,left:z.left,scale:P,stroke:t,strokeWidth:w,tickValues:b?[]:f?A:void 0,numTicks:f?void 0:2,tickFormat:g?n5:void 0,tickLength:k,tickStroke:s||t,tickLabelProps:()=>({fill:a||t,textAnchor:"end",fontFamily:u,fontSize:p,fontWeight:h,dy:"0.33em",dx:d?0:-4,userSelect:"auto"})}),(0,l.jsx)(nQ.Z,{top:N+z.top,left:z.left,scale:_,stroke:t,numTicks:4,tickValues:b?[]:void 0,tickFormat:e=>L[e].label,tickStroke:s||t,tickLabelProps:()=>({fill:a||t,textAnchor:"middle",fontFamily:u,fontSize:p,fontWeight:h,userSelect:"auto",dy:d?0:4}),strokeWidth:w,tickLength:k})]}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(nJ.Z,{top:z.top,left:z.left,scale:_,stroke:t,strokeWidth:w,tickLength:k,tickValues:b?[]:void 0,numTicks:4,tickFormat:e=>L[e].label,tickStroke:s||t,tickLabelProps:()=>({fill:a||t,textAnchor:"end",fontFamily:u,fontSize:p,fontWeight:h,dy:"0.33em",dx:d?0:-4,userSelect:"auto"})}
1),(0,l.jsx)(nQ.Z,{top:N+z.top,left:z.left,scale:P,stroke:t,tickValues:b?[]:f?A:void 0,numTicks:f?void 0:2,tickFormat:g?n5:void 0,tickLength:k,tickStroke:s||t,tickLabelProps:(e,n)=>({fill:a||t,textAnchor:0===n?"end":"middle",fontFamily:u,fontSize:p,fontWeight:h,userSelect:"auto",dy:d?0:4}),strokeWidth:w})]})})]})},n4=(e,t)=>{let{fontFamily:n,fontSize:r,fontWeight:o}=t;return Math.max(...e.map(e=>(0,n1.Z)("".concat(e),{fontFamily:n,fontSize:r,fontWeight:o})||0))},n5=e=>Math.round(e).toString(),n8=e=>{let{data:t,render:n,height:r="3em",getColor:o,getOpacity:i,onMouseOver:a,onMouseLeave:d,onClick:c,onDoubleClick:u,textColor:p}=e;return(0,l.jsx)(y.k,{position:"absolute",bottom:0,left:0,width:"100%",flexGrow:0,flexShrink:0,justifyContent:"center",children:(0,l.jsx)(ey.U,{height:r,maxW:"100%",overflowX:"auto",gap:"0.5em",children:t.map((e,t)=>(0,l.jsxs)(ey.U,{opacity:i?i(e,t):1,cursor:"pointer",onMouseOver:null==a?void 0:a(e,t),onMouseLeave:null==d?void 0:d(e,t),onClick:null==c?void 0:c(e,t),onDoubleClick:null==u?void 0:u(e,t),transition:"opacity ".concat(nY.zn,"s"),mr:"1em",gap:"0.5em",children:[(0,l.jsx)(s.xu,{as:nF.E.div,width:"1em",height:"1em",flexShrink:0,bg:o(e,t),borderRadius:"sm",animate:{backgroundColor:o(e,t)},children:" "}),(0,l.jsx)(eC.x,{fontSize:"1em",lineHeight:"1em",color:p,children:n(e)})]},t))})})};function n9(){let e=(0,m.useRef)(null);return(0,m.useEffect)(()=>()=>{e.current&&(clearTimeout(e.current),e.current=null)},[]),{clickHandler:t=>n=>{e.current||(e.current=setTimeout(()=>{e.current=null,t(n)},200))},doubleClickHandler:t=>n=>{e.current&&(clearTimeout(e.current),e.current=null),t(n)}}}var n7=n(80237),n6=n(96492),re=n(40837),rt=n(14141);let rn=e=>{let{TooltipInner:t}=e,{showTooltip:n,tooltipOpen:r,tooltipLeft:o,tooltipTop:i,tooltipData:a,hideTooltip:s}=(0,n6.Z)(),d=(0,m.useRef)();return(0,m.useEffect)(()=>()=>{d.current&&clearTimeout(d.current)},[]),{mouseMoveHandler:(e,t)=>r=>{d.current&&clearTimeout(d.current);let o=t?t(e,r):(0,n7.Z)(r);n({tooltipData:{...e,position:e.position},tooltipTop:null==o?void 0:o.y,tooltipLeft:null==o?void 0:o.x})},mouseLeaveHandler:e=>e=>{d.current=window.setTimeout(()=>{s()},300)},renderTooltip:function(){return r&&a?(0,l.jsx)(re.Z,{top:i,left:o,style:{...rt.j,userSelect:"none"},contentEditable:!1,suppressContentEditableWarning:!0,children:(0,l.jsx)(t,{...a})}):null}}};var rr=n(33107);let ro=e=>{let{showZero:t,data:n,dataColumns:r,animationDuration:o,barColors:i,direction:a,selectCell:s,tooltipEnter:d,tooltipLeave:c,dataScale:u,labelScale:p,yMax:m,margin:h,minValueGreaterThanZero:g,onDataClick:f,onDataDoubleClick:x}=e,v=(0,nX.HK)(r,"id");return(0,l.jsx)(l.Fragment,{children:(0,l.jsx)(nW.Z,{top:h.top,left:h.left,children:n.rows.map(e=>{let r="group-".concat(e.id),h=e.getCells(n).filter(e=>!!v.get(e.position.column));return(0,l.jsx)(ra,{animationDuration:o,barColors:i,data:h,showZero:t,dataMax:m,dataScale:u,labelScale:p,selectCell:s,direction:a,globalMinValueGreaterThanZero:g,tooltipEnter:d,tooltipLeave:c,onDataClick:f,onDataDoubleClick:x},r)})})})},ri=e=>{let{TooltipInner:t,showZero:n=!0,shouldRoundYValues:r=!0,showMaxAndMiddle:o=!0,data:i,textColor:a,accentColor:d,animationDuration:c=nY.zn,isThumbnail:u=!1,width:p,height:m,chartType:h,colorScheme:g=nY.bT,hideLabels:f,onDataClick:x,onDataDoubleClick:v}=e,b="horizontal-bar"===h?"horizontal":"vertical",{renderTooltip:y,mouseMoveHandler:C,mouseLeaveHandler:w}=rn({TooltipInner:t}),k=nK(i),j=(null==k?void 0:k.getCells(i))||[],S=i.columns.filter(e=>{let{type:t}=e;return"data"===t}),A=S.map(e=>e.getCells(i)).flat(),I=S.length>1&&!f,E=Math.min(...A.map(e=>e.data).filter(e=>e>0)),z=S.map(e=>{let{id:t}=e;return t}),T=(0,nZ.$)(d,z,g),N=(0,rr.H)(u);return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(s.xu,{position:"relative","data-test":"bar-chart-container",height:m,cursor:"default",userSelect:"none",contentEditable:!1,children:[(0,l.jsx)(n3,{width:p,height:I?m-3*N:m,labelCells:j,dataCells:A,color:a,textColor:a,tiny:u,shouldRoundYValues:r,showMaxAndMiddle:o,direction:b,hideLabels:f,children:e=>(0,l.jsx)(ro,{showZero:n,barColors:T,data:i,dataColumns:S,animationDuration:c,direction:b,tooltipEnter:C,tooltipLeave:w,minValueGreaterThanZero:E,onDataClick:x,onDataDoubleClick:v,...e})}),I&&(0,l.jsx)(n8,{data:S,render:e=>e.label,getColor:e=>T.get(e.id),textColor:a})]}),y()]})},ra=e=>{var t;let{animationDuration:n,barColors:r,data:o,showZero:i,dataMax:a,dataScale:s,labelScale:d,direction:c,globalMinValueGreaterThanZero:u,tooltipEnter:p,tooltipLeave:h,onDataClick:g,onDataDoubleClick:f}=e,{clickHandler:x,doubleClickHandler:v}=n9(),b=d.bandwidth(),y=d(null===(t=o[0])||void 0===t?void 0:t.position.row)||0,C=(0,m.useMemo)(()=>{let e=o.map(e=>e.position.column);return(0,nG.Z)({range:[y,y+b],domain:e,paddingInner:e.length>1?.2:0})},[b,o,y]),w=i?s(u):0;return(0,l.jsx)(nW.Z,{children:o.map(e=>{let t={dataScale:s,value:e,innerScale:C,dataMax:a,scaledMinValueGreaterThanZero:w,showZero:i},{x:o,y:d,width:u,height:m}="vertical"===c?function(e){var t,n;let{dataScale:r,value:o,innerScale:i,dataMax:a,showZero:l,scaledMinValueGreaterThanZero:s}=e,d=a-(null!==(t=r(o.data))&&void 0!==t?t:0),c=l&&a-s>12&&d<6?6:d,u=null!==(n=i(o.position.column))&&void 0!==n?n:0,p=i.bandwidth();return{x:u,y:a-c,height:c,width:p}}(t):function(e){let{dataScale:t,value:n,innerScale:r,showZero:o,scaledMinValueGreaterThanZero:i}=e,a=r(n.position.column),l=t(n.data),s=r.bandwidth();return{x:0,y:a,height:s,width:o&&i>12&&l<6?6:l}}(t);return(0,l.jsx)(rl,{yMax:a,x:o,y:d,width:u,height:m,radius:5,topLeft:"vertical"===c,top
1Right:!0,bottomRight:"horizontal"===c,fill:r.get(e.position.column),duration:n,onMouseLeave:h(e),onMouseMove:p(e),onClick:g?x(g.bind(void 0,e)):void 0,onDoubleClick:f?v(f.bind(void 0,e)):void 0,style:{cursor:"pointer"}},e.key)})})},rl=e=>{let{duration:t=0,y:n,x:r,height:o,width:i,yMax:a,innerRef:s,...d}=e,[c,u]=(0,m.useState)(0),[p,h]=(0,m.useState)(i),[g,f]=(0,m.useState)(n+o),[x,v]=(0,m.useState)(r);return(0,m.useEffect)(()=>{(0,nq.j)(c,o,{duration:t,onUpdate:e=>u(e)})},[o]),(0,m.useEffect)(()=>{(0,nq.j)(p,i,{duration:t,onUpdate:e=>h(e)})},[i]),(0,m.useEffect)(()=>{(0,nq.j)(x,r,{duration:t,onUpdate:e=>v(e)})},[r]),(0,m.useEffect)(()=>{(0,nq.j)(g,n,{duration:t,onUpdate:e=>f(e)})},[n]),(0,l.jsxs)(nW.Z,{children:[(0,l.jsx)(nU.Z,{height:c,width:p,x:x,y:g,innerRef:s,...d}),(0,l.jsx)(nV.Z,{height:Math.max(0,a-c),width:p,x:x,y:0,...d,onClick:void 0,onDoubleClick:void 0,style:void 0,opacity:0})]})};var rs=n(13109),rd=n(5966),rc=n(28091),ru=n(63213),rp=n(88323);let rm={parse(e){let t=e.columns.map(e=>new rc.C(e)),n=e.rows.map(e=>new rp.H(e)),r=(0,nX.HK)(t,"id"),o=(0,nX.HK)(n,"id"),i=Object.entries(e.cells).flatMap(e=>{let[t,n]=e;return Object.entries(n).map(e=>{let[n,i]=e,a=function(e,t){let{row:n,column:r}=e;switch(t.type){case"label":return new rd.m({row:n,column:r},t);case"data":return new rs.O({row:n,column:r},t)}}({row:o.get(t),column:r.get(n)},i);return a})});return new ru.f({columns:t,rows:n,cells:i})},serialize(e){let t=e.rows.map(e=>{let{id:t}=e;return{id:t}}),n=e.columns.map(e=>{let{id:t,type:n,label:r,format:o}=e;return{id:t,type:n,label:r,format:o}}),r={};for(let t of e.rows)for(let n of e.columns){let o=e.getCell({row:t.id,column:n.id});if(!o)continue;let i=(()=>{if(o instanceof rs.O){let{type:e,data:t}=o;return{type:e,data:t}}if(o instanceof rd.m){let{type:e,label:t}=o;return{type:e,label:t}}throw Error("Unexpected cell type ".concat(o.type))})();r[t.id]=r[t.id]||{},r[t.id][n.id]=i}return{rows:t,columns:n,cells:r}}};var rh=n(27079);let rg=e=>{var t;let{data:n,TooltipInner:r,isThumbnail:o=!1,width:i,height:a,accentColor:d,textColor:c,colorScheme:u=nY.bT,hideLabels:p,...m}=e,{renderTooltip:h,mouseMoveHandler:g,mouseLeaveHandler:f}=rn({TooltipInner:r}),x=(null===(t=nK(n))||void 0===t?void 0:t.getCells(n))||[],v=n.columns.filter(e=>{let{type:t}=e;return"data"===t}),b=v.map(e=>e.getCells(n)).flat(),y=v.map(e=>{let{id:t}=e;return t}),C=(0,nZ.$)(d,y,u),w=(0,rr.H)(o),k=v.length>1&&!p,j=k?a-3*w:a;return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(s.xu,{"data-test":"line-chart-container",height:a,pos:"relative",cursor:"default",contentEditable:!1,suppressContentEditableWarning:!0,userSelect:"none",children:[(0,l.jsx)(n3,{width:i,height:j,color:c,textColor:c,tiny:o,labelCells:x,dataCells:b,hideLabels:p,children:e=>v.map((t,r)=>{let a=t.getCells(n);return(0,l.jsx)(rf,{dataCells:a,width:i,height:j,isThumbnail:o,color:C.get(t.id),textColor:c,tooltipEnter:g,tooltipLeave:f,makeTooltipBars:0===r,...m,...e},t.id)})}),k&&(0,l.jsx)(n8,{data:v,getColor:e=>C.get(e.id),textColor:c,render:e=>e.label})]}),h()]})},rf=e=>{let{labelScale:t,dataScale:n,dataCells:r,isThumbnail:o,color:i,textColor:a,margin:s,tooltipEnter:d,tooltipLeave:c,chartOptions:{line:u={}},onDataClick:p,onDataDoubleClick:m,animationDuration:h=nY.zn,makeTooltipBars:g}=e,{clickHandler:f,doubleClickHandler:x}=n9(),v=rx(r,n,h),b=n(0);return(0,l.jsxs)(nW.Z,{left:s.left,top:s.top,children:[(0,l.jsx)(rh.Z,{data:r,x:e=>{let{position:{row:n}}=e;return(t(n)||0)+t.bandwidth()/2},y:e=>v(e),stroke:i,strokeWidth:o?1:2}),o||r.map(e=>(0,l.jsxs)(l.Fragment,{children:[g&&(0,l.jsx)(nV.Z,{opacity:0,height:b,width:t.bandwidth(),x:t(e.position.row),y:0,onMouseMove:d(e),onMouseLeave:c(e)},"p-".concat(e.key)),(0,l.jsx)(nF.E.circle,{cx:(t(e.position.row)||0)+t.bandwidth()/2,cy:v(e),r:4,fill:i,stroke:i,opacity:u.hideMarkers?0:1,style:{cursor:"pointer",transition:"opacity ".concat(h,"s")},onMouseMove:d(e),onMouseLeave:c(e),onClick:p?f(p.bind(void 0,e)):void 0,onDoubleClick:m?x(m.bind(void 0,e)):void 0},"circle-".concat(e.key))]}))]})},rx=(e,t,n)=>{let r=(0,m.useRef)(Object.fromEntries(e.map(e=>[e.key,void 0]))),o=()=>e=>r.current[e.key],[i,a]=(0,m.useState)(()=>o());return(0,m.useEffect)(()=>{let i=t(0);if(0===i)return;let l=e.map(e=>{var l;let s=e.key;return(0,nq.j)(null!==(l=r.current[s])&&void 0!==l?l:i,t(e.data),{duration:n,ease:"easeOut",onUpdate:e=>{r.current[s]=e,a(()=>o())}})});return()=>
1{l.forEach(e=>{e.stop()})}},[e,t]),i||console.log("no getter"),i};var rv=n(82756);let rb=e=>{let{targetValue:t,initialValue:n=0,duration:r=nY.zn}=e,[o,i]=(0,m.useState)(n);return(0,m.useEffect)(()=>{let{stop:e}=(0,nq.j)(o,t,{duration:r,onUpdate:e=>{i(e)}});return()=>{e()}},[t]),o},ry=e=>{let{data:t,TooltipInner:n,colorScheme:r=nY.bT,isThumbnail:o=!1,width:i,height:a,chartType:d,textColor:c,accentColor:u,chartOptions:{donut:p,pie:h},hideLabels:g,onDataClick:f,onDataDoubleClick:x,animationDuration:v=nY.zn}=e,{renderTooltip:b,mouseMoveHandler:y,mouseLeaveHandler:C}=rn({TooltipInner:n}),w={top:20,right:20,bottom:20,left:20},k=n$(t),j=nK(t);if(!k)throw Error("Nothing to chart");let S=k.getCells(t),A=S.map(e=>{let{position:t}=e;return t.row}),I=(0,nZ.$)(u,A,r),[E,z]=(0,m.useState)(null),T=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return E?E.row===e.row&&E.column==E.column:!t};o&&(w.top=5,w.right=5,w.bottom=5,w.left=5);let N=(0,rr.H)(o),M=g||!j?a:a-3*N,_=i-w.left-w.right,L=M-w.top-w.bottom,P=Math.min(_,L)/2,R=rb({targetValue:"donut"===d?(null==p?void 0:p.radius)||.5:1,initialValue:1,duration:v}),H=P*R,D=e=>(0,l.jsx)(rw,{cells:S,colors:I,donutThickness:H,duration:v,isDummy:e,isFocused:T,isThumbnail:o,onClick:f,onDoubleClick:x,radius:P,setFocus:z,tooltipEnter:y,tooltipLeave:C});return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(s.xu,{height:a,"data-test":"pie-chart-container",pos:"relative",cursor:"default",contentEditable:!1,suppressContentEditableWarning:!0,userSelect:"none",children:[(0,l.jsx)("svg",{width:i,height:M,children:(0,l.jsx)(nW.Z,{top:L/2+w.top,left:_/2+w.left,children:(0,l.jsxs)(l.Fragment,{children:["donut"===d&&D(!0),D(!1)]})})}),!g&&j&&(0,l.jsx)(n8,{data:S,getColor:e=>I.get(e.position.row),render:e=>{let{position:{row:n}}=e;return t.getCellOrThrow({row:n,column:j.id}).label},textColor:c,getOpacity:e=>T(e.position)?1:.2,onMouseOver:e=>()=>z(e.position),onMouseLeave:()=>()=>z(null)})]}),b()]})},rC=e=>{let{arc:t,duration:n=.2,path:r,getColor:o,tooltipEnter:i,tooltipLeave:a,onClick:s,onDoubleClick:d,focused:c,setFocused:u,isThumbnail:p,...h}=e,{startAngle:g,endAngle:f}=t,x=o(t.data),[v,b]=(0,m.useState)(g),[y,C]=(0,m.useState)(g),[w,k]=(0,m.useState)(x),{clickHandler:j,doubleClickHandler:S}=n9();(0,m.useEffect)(()=>{(0,nq.j)(v,[v,f],{duration:n,onUpdate:e=>b(e)})},[f]),(0,m.useEffect)(()=>{(0,nq.j)(y,[y,g],{duration:n,onUpdate:e=>C(e)})},[g]),(0,m.useEffect)(()=>{(0,nq.j)(w,x,{duration:n,onUpdate:e=>k(e)})},[x]);let A=c?p?4:15:0,I=(y+v)/2,E=A>0?"translate(".concat(Math.sin(I)*A,", ").concat(-(Math.cos(I)*A*1),")"):"";return(0,l.jsx)("path",{d:r({...t,startAngle:y,endAngle:v}),fill:w,onMouseMove:e=>{u(!0),null==i||i(t.data)(e)},onMouseLeave:e=>{u(!1),null==a||a(t.data)(e)},onClick:s?j(s.bind(void 0,t.data)):void 0,onDoubleClick:d?S(d.bind(void 0,t.data)):void 0,transform:E,style:{transition:"transform ".concat(n,"s")},...h})},rw=e=>{let{cells:t,colors:n,donutThickness:r,duration:o,isDummy:i,isFocused:a,isThumbnail:s,onClick:d,onDoubleClick:c,radius:u,setFocus:p,tooltipEnter:m,tooltipLeave:h}=e;return(0,l.jsx)(rv.Z,{data:t,outerRadius:u,innerRadius:i?0:u-r,pieValue:e=>{let{data:t}=e;return t},pieSort:null,pieSortValues:null,padAngle:i?0:.01,children:e=>{let{arcs:t,...r}=e;return t.map(e=>(0,l.jsx)(rC,{arc:e,...r,focused:!i&&a(e.data.position,!0),setFocused:t=>{p(t?e.data.position:null)},getColor:e=>i?"transparent":n.get(e.position.row),tooltipEnter:m,tooltipLeave:h,duration:i?0:o,isThumbnail:s,onClick:d,onDoubleClick:c},e.data.key))}})};var rk=n(71997),rj=n(17955);let rS=e=>{let{isResizing:t,onResizing:n,setIsResizing:r,cloneBoxProps:o={},showResizeControls:i,disableCloning:a,children:d,...c}=e,u=(0,m.useRef)(null),p=(0,m.useRef)(null),h=(0,m.useRef)(void 0);return(0,m.useEffect)(()=>{if(!a){if(!0===t&&p.current&&h.current){let e=p.current;e.appendChild(h.current)}if(!t&&h.current){var e;null===(e=h.current.parentNode)||void 0===e||e.removeChild(h.current)}}},[t]),(0,l.jsxs)(l.Fragment,{children:[t&&!a?(0,l.jsx)(s.xu,{filter:"blur(15px)",...o,ref:p,width:"100%",height:"100%",position:"relative","data-test":"resize-placeholder"}):(0,l.jsx)(s.xu,{ref:u,width:"100%",height:"100%",children:d}),i&&(0,l.jsx)(rj.R4,{setIsResizing:e=>{if(!a&&e){var t;h.current=null===(t=u.current)||void 0===t?void 0:t.cloneNode(!0);let e=h.current;e&&(e.style.position="absolute",e.style.top="0px",e.style.left="0px",e.style.width="auto",e.style.height="auto")}r(e)},onResizing:function(e){for(var t=arguments.length,r=Array(t>1?t-1:0),o=1;o<t;o++)r[o-1]=arguments[o];let{width:i,height:a}=e,l=h.current;if(!l)return;let s={width:l.offsetWidth,height:l.offsetHeight},d=i/s.width,c=a/s.height;l.style.transform="scale(".concat(d,", ").concat(c,")"),l.style.transformOrigin="top left",null==n||n(e,...r)},...c})]})};var rA=n(74409),rI=n(50260),rE=n(12964),rz=n(81540),rT=n(25237),rN=n.n(rT);let rM=rN()(async()=>(await Promise.all([n.e(411),n.e(4276)]).then(n.bind(n,4276))).DataEditor,{loadableGenerated:{webpack:()=>[4276]},ssr:!1,loading:()=>(0,l.jsx)(y.k,{m:5,h:"100%",justifyContent:"center",children:(0,l.jsx)(rz.$,{size:"lg"})})}),r_=e=>(0,l.jsx)(rM,{...e}),rL=e=>{let{onChange:t,onClose:n,data:r,renderChart:o,attributes:i,updateAttributes:a,accentColor:d,selectedCell:c}=e,u=(0,v.CG)(eK.Pu),p=(0,rI.yU)(u)||((0,rI.wj)(u)?"gray.800":"gray.200"),m=u.config.bodyColor||((0,rI.wj)(u)?"var(--chakra-colors-gray-50)":"var(--chakra-colors-gray-900)");return(0,l.jsxs)(C.dy,{placement:"bottom",onClose:n,isOpen:!0,trapFocus:!0,isFullHeight:!0,returnFocusOnClose
1:!1,children:[(0,l.jsx)(C.P1,{}),(0,l.jsxs)(C.sc,{borderTopRadius:"xl",h:"calc(var(--100vh) - 24px)",transition:{enter:{duration:.4}},children:[(0,l.jsx)(C.cC,{}),(0,l.jsxs)(C.Ng,{p:0,h:"100%",overflow:"auto","data-testid":"chart-editor-body",display:"flex",flexDir:"column",children:[(0,l.jsx)(rA.X,{margin:5,children:_.ag._({id:"44wbJb"})}),(0,l.jsxs)(y.k,{direction:{base:"column",xl:"row-reverse"},overflow:"auto",children:[(0,l.jsxs)(y.k,{direction:{base:"column",lg:"row",xl:"column"},width:{base:"auto",xl:"40%","2xl":"30%"},flexGrow:0,gap:5,margin:5,children:[(0,l.jsx)(s.xu,{flexGrow:{base:1,xl:0},flexShrink:0,flexBasis:"auto",padding:4,background:"gray.50",borderRadius:"md",overflow:"hidden",children:(0,l.jsx)(s.xu,{background:p,borderRadius:"md",padding:2,aspectRatio:"16/9",maxWidth:"100%",maxHeight:"xs",marginX:"auto",children:(0,l.jsx)(nB.Z,{children:e=>{let{width:t,height:n}=e;return r?o({data:r,width:t,height:n,textColor:m}):null}})})}),(0,l.jsx)(s.xu,{background:"gray.50",flexGrow:0,flexShrink:1,flexBasis:"sm",borderRadius:"md",children:(0,l.jsx)(rE.o,{attributes:i,updateAttributes:a,accentColor:d})})]}),(0,l.jsx)(z.i,{display:{base:"block",xl:"none"}}),(0,l.jsx)(s.xu,{flexGrow:1,zIndex:1,margin:5,overflow:{xl:"auto"},children:(0,l.jsx)(r_,{onChange:t,data:r||ru.f.createEmpty(2,3),selectedCell:c})})]})]})]})]})},rP=(0,nF.E)(s.xu),rR=e=>{var t;let{node:n,editor:r,selected:o,updateAttributes:i}=e,{chartType:a,colorScheme:d,data:c,dimensions:u={ratio:.5},hideLabels:p,chartAttributes:h={}}=n.attrs,g=(0,m.useMemo)(()=>c?rm.parse(c):null,[c]),f=(0,v.CG)(eK.Pu),x=(0,v.CG)(eK.Pw),b=(0,v.CG)(eK.wc),C=(0,e$.LM)(r),w=x&&C&&b,{ref:k,isResizing:j,setIsResizing:S,resizeableSx:A,onLayoutAnimationStart:I,onLayoutAnimationComplete:E}=(0,rj.ow)(r),z=(0,m.useCallback)(e=>{i({dimensions:{width:e.width,height:e.height}})},[i]),[T,N]=(0,m.useState)(nY.zn);(0,m.useEffect)(()=>{j?N(0):setTimeout(()=>{N(nY.zn)},1e3*nY.zn)},[j]);let M=r.isThumbnail||!1,[_,L]=(0,m.useState)(!1),[P,R]=(0,m.useState)(),H=(0,m.useMemo)(()=>{switch(a){case"pie":case"donut":return ry;case"line":return rg;default:return ri}},[a]),D=null!==(t=f.accentColor)&&void 0!==t?t:"red",O=e=>{x&&b&&(R(e),L(!0))};(0,m.useEffect)(()=>{if(!P)return;let e=null==g?void 0:g.getCell(P.position);e!==P&&R(void 0)},[P,_]);let B=e=>{let{data:t,width:n,height:r,textColor:o="var(--body-color)",showEditInPlaceholder:i=!1}=e;return n$(t)?(0,l.jsx)(H,{animationDuration:T,data:t,colorScheme:d,width:n,height:r,accentColor:D,textColor:o,chartOptions:h,onDataDoubleClick:O,hideLabels:p,TooltipInner:e=>(0,l.jsx)(l.Fragment,{children:c.columns.map(n=>{var r;return(0,l.jsxs)(s.xu,{as:"p",children:[(0,l.jsx)(eC.x,{as:"b",children:n.label}),(0,l.jsx)(eC.x,{children:null===(r=t.getCell({row:e.position.row,column:n.id}))||void 0===r?void 0:r.textValue},n.id)]},n.id)})}),chartType:a,isThumbnail:M}):(0,l.jsx)(rO,{setEditing:i?L:void 0})},F=rH(u);return(0,l.jsx)(ed.lO,{as:"div",...e,children:(0,l.jsx)(y.k,{w:"100%",className:rk.d,sx:A,direction:"column",onDoubleClick:()=>{w&&L(!0)},_focusWithin:{shadow:"outline"},children:(0,l.jsxs)(rP,{ref:k,className:"chart",borderRadius:"var(--box-border-radius)","data-content-reference":!0,"data-selection-ring":!0,"data-selection-background":!0,maxW:"100%",width:"width"in u&&"height"in u?rD(u.width):"100%",aspectRatio:"1/".concat(F),position:"relative",layout:!0,transition:{duration:.15},onLayoutAnimationStart:I,onLayoutAnimationComplete:E,minH:g?"auto":"6em","data-drag-handle":!0,children:[(0,l.jsx)(rS,{showResizeControls:w&&o,imageWrapperRef:k,isResizing:j,setIsResizing:S,updateResizeAttrs:z,refreshDeps:[n.attrs],disableCloning:!g,keepRatio:!1,children:g?(0,l.jsx)(nB.Z,{children:e=>{let{width:t}=e;return B({data:g,width:t,height:t*F,showEditInPlaceholder:!0})}}):(0,l.jsx)(rO,{setEditing:L})}),_&&(0,l.jsx)(rL,{renderChart:B,data:g,onClose:()=>L(!1),onChange:e=>{let t=rm.serialize(e);i({data:t})},attributes:n.attrs,updateAttributes:i,accentColor:D,selectedCell:P})]})})})},rH=e=>"ratio"in e?e.ratio:e.height/e.width,rD=e=>"calc(".concat(e," * var(--font-size) / 16)"),rO=e=>{let{setEditing:t}=e;return(0,l.jsxs)(ny.g,{spacing:3,justify:"center",contentEditable:!1,
1color:"gray.400",h:"100%",backgroundColor:"blackAlpha.50",borderRadius:"var(--box-border-radius)","data-testid":"chart-placeholder",children:[(0,l.jsx)(N.G,{size:"2x",icon:te.Wpq}),t&&(0,l.jsx)(I.z,{size:"xs",onClick:()=>t(!0),children:"Add Data"})]})},rB=eo.NB.create({name:"chart",group:"cardBlock layoutBlock",selectable:!0,draggable:!0,addNodeView:()=>(0,el.fW)(rR,{update:es.E7}),addAttributes:()=>({id:(0,nO.b)(()=>(0,nD.x0)(5)),chartType:{default:"bar"},chartAttributes:{...(0,eW.sw)("chartAttributes"),default:{}},colorScheme:{default:"lightest",isRequired:!0},dimensions:{...(0,eW.sw)("dimensions"),default:{ratio:.56}},hideLabels:{isRequired:!1,default:!1},data:{...(0,eW.sw)("data")}}),addCommands:()=>({insertChart:()=>e=>{let{dispatch:t,editor:n,commands:r}=e;if(!t)return!1;let{schema:o}=n,i=o.nodes.chart,a=i.createChecked({});return r.insertContent(a.toJSON())}}),parseHTML(){return[{tag:'div[data-type="'.concat(this.name,'"]')}]},renderHTML(e){let{HTMLAttributes:t}=e;return["div",(0,eo.P1)({"data-type":this.name},this.options.HTMLAttributes,t)]}});var rF=n(30764),rW=n(18455),rG=n(15690),rU=n(71917),rV=n(37160),rq=n(25819),r$=n(86581),rK=n(29460),rZ=n(87008);let rY=eo.hj.create({name:"clipboard",addProseMirrorPlugins(){let e=this.editor,t=e.state.schema,n=null;return[new tR.Sy({key:new tR.H$("clipboard"),appendTransaction(e,t,n){let r=e.find(e=>"cut"===e.getMeta("uiEvent"));if(!r)return null;let o=(0,rG.a)(r);return o?n.tr.setSelection(o):null},props:{handleDOMEvents:{drop(e){n=e.dragging,requestAnimationFrame(()=>{n=null})}},clipboardSerializer:{serializeFragment:e=>(0,rZ.Xb)(e,this.editor.schema)},transformPastedHTML:e=>(0,rW.B)(e,!0),transformPasted:r=>{let o=!!(null==n?void 0:n.slice);return rX(e,o?r:(0,rK.iu)(r,t))},handlePaste:(t,n,r)=>(0,rq.Lv)(e,n,r)||(0,r$.iO)(e,n)||(0,rV.g)(t,n,r)}})]},addCommands:()=>({insertMarkdownAt:(e,t)=>n=>{let{state:r,tr:o}=n;try{let n=(0,r$.aT)(t,r.schema);return o.replaceRange(e.from,e.to,n),!0}catch(e){return console.warn("(caught) [Clipboard] insertMarkdownAt error",e),!1}}})}),rX=(e,t)=>{var n;let r=(0,rU.u)(e.state.doc),o=null===(n=t.toJSON())||void 0===n?void 0:n.content;if(!o||"document"!==o[0].type)return t;let i=(0,rU.u)(t.content.firstChild);return r.cardLayoutsEnabled&&!i.cardLayoutsEnabled?((0,eW.K9)(o,e=>{"card"===e.type&&(e.content=[{type:"cardLayoutItem",content:e.content}])}),rF.p2.fromJSON(e.schema,{openStart:t.openStart+1,openEnd:t.openEnd+1,content:o})):t};var rJ=n(31230),rQ=n(31187);let r0=rQ.ZP.extend({priority:tL.a.Code,inclusive:!1});var r1=n(93274),r2=n(48832),r3=n(96933);let r4=e=>{let[t,n]=(0,m.useState)(new Date),r=(0,m.useRef)(!1);return(0,m.useEffect)(()=>{r.current&&n(new Date),r.current=!0;let e=setInterval(()=>{n(new Date)},6e4);return()=>{clearInterval(e)}},[e]),t},r5=e=>{var t;let n=(0,r3.i)({base:4,md:8})||8,{node:r}=e,{showTime:o,hiddenContributorIds:i}=r.attrs,a=(0,v.CG)(eK.xy)||[],s=(0,m.useMemo)(()=>a.filter(e=>!i.includes(e.user.id)),[a,i]),d=(0,ee.gF)(),c=(0,v.CG)(eK.yx),u=null==c?void 0:c.editedTime,p=r4(u).toISOString(),h=s.length-n,f=null!==(t=e.node.attrs.horizontalAlign)&&void 0!==t?t:"left",x=(0,m.useMemo)(()=>({left:"row",center:"column",right:"row-reverse"})[f],[f]);return(0,l.jsx)(l.Fragment,{children:s.length>0&&(0,l.jsx)(ed.lO,{...e,as:"div",children:(0,l.jsxs)(y.k,{userSelect:"none",contentEditable:!1,justify:"flex-start",align:"center",direction:x,borderRadius:"var(--box-border-radius)","data-selection-ring":"padded","data-selection-background":!0,children:[(0,l.jsxs)(r1.H,{sx:{".avatar-overflow-activator":{height:"1.6em",width:"1.6em",minH:"1.6em",minW:"1.6em",fontSize:"inherit",span:{fontSize:"0.68em"}}},children:[s.slice(0,n).map(e=>(0,l.jsx)(C.Vw,{width:"1.6em",height:"1.6em",fontSize:"inherit",shadow:"base",sx:{"@media print":{shadow:"none"}},borderWidth:"1px",name:d?_.ag._({id:"bxVoEp",values:{0:e.user.displayName,1:(0,r2.Km)(e.lastEdited,p)}}):" ",src:e.user.profileImageUrl},e.user.id)),h>0&&(0,l.jsx)(C.Z9,{tooltipLabel:_.ag._({id:"25VyZX"}),count:h,avatars:s.map(e=>({name:e.user.displayName||"",id:e.user.id,profileImageUrl:e.user.profileImageUrl||"",color:"white"})),disabled:!0})]}
1),(0,l.jsxs)(y.k,{direction:"column",ml:"left"===f?"0.5em":0,mr:"right"===f?"0.5em":0,lineHeight:"1.4",textAlign:f,children:[(0,l.jsx)(eC.x,{className:"contributors-list",children:1===s.length?(0,l.jsx)(M.cC,{id:"t490IT",values:{0:s[0].user.displayName}}):(0,l.jsx)(M.cC,{id:"KNjuGh",values:{0:s.length}})}),!g.v.GAMMA_PUPPETEER_SERVICE&&u&&o&&(0,l.jsx)(eC.x,{fontSize:"0.75em",children:d?(0,l.jsx)(M.cC,{id:"gUWkFH",values:{0:(0,r2.Km)(u,p)}}):" "})]})]})})})},r8=e=>{var t;let n=null!==(t=e.node.attrs.horizontalAlign)&&void 0!==t?t:"left",r=(0,m.useMemo)(()=>({left:"row",center:"column",right:"row-reverse"})[n],[n]);return(0,l.jsx)(nw.T,{children:(0,l.jsxs)(y.k,{direction:r,alignItems:"center",gap:"1em",children:[(0,l.jsx)(nC,{borderRadius:"full",boxSize:"4em"}),(0,l.jsx)(nC,{h:"2em",w:"14em"})]})})},r9=eo.NB.create({name:"contributors",group:"block",atom:!0,selectable:!0,dynamic:!0,addAttributes:()=>({showTime:{default:!0},hiddenContributorIds:{default:[],...(0,eW.sw)("hiddenContributorIds")}}),addCommands:()=>({toggleShowTime:()=>e=>{let{commands:t,state:n}=e,{selection:r}=n;if(!(r instanceof tR.qv))return!1;let{node:o}=r;return"contributors"===o.type.name&&(t.updateAttributes("contributors",{showTime:!o.attrs.showTime}),!0)},toggleOneContributorVisibility:e=>t=>{let{commands:n,state:r}=t,o=(0,v.bh)().getState(),i=(0,eK.xy)(o);if(!i||1===i.length)return!1;let{selection:a}=r;if(!(a instanceof tR.qv))return!1;let{hiddenContributorIds:l}=a.node.attrs,s=[];if(l.includes(e))s=l.filter(t=>t!==e);else{if(l.length+1===i.length)return!1;s=[...l,e]}return n.updateAttributes("contributors",{hiddenContributorIds:s}),!0},toggleAllContributorsVisibility:()=>e=>{let{commands:t,state:n}=e,r=(0,v.bh)().getState(),o=(0,eK.xy)(r);if(!o||1===o.length)return!1;let{selection:i}=n;if(!(i instanceof tR.qv))return!1;let{hiddenContributorIds:a}=i.node.attrs,l=[];if(a.length>0)l=[];else{let e=(0,eK.bU)(r);l=o.filter(t=>t.user.id!==(null==e?void 0:e.id)).map(e=>e.user.id)}return t.updateAttributes("contributors",{hiddenContributorIds:l}),!0}}),parseHTML:()=>[{tag:"div[class=contributors]"}],renderHTML(e){let{HTMLAttributes:t}=e;return["div",(0,eo.P1)(t,{class:"contributors"})]},addNodeView(){return this.editor.isThumbnail?(0,el.fW)(r8,{update:es.E7}):(0,el.fW)(r5,{update:es.E7})}});var r7=n(55850),r6=n(39823);let oe=e=>{let{svg:t,theme:n}=e;if(!t)return null;let r=(0,r6.c)(n);return(0,l.jsx)(s.xu,{dangerouslySetInnerHTML:{__html:t},"data-testid":"diagram-svg",sx:{svg:{width:"100%",height:"auto",...r}}})};var ot=n(55395),on=n(32398),or=n(17630),oo=n(96636);let oi=async e=>{let t=Array.from(e.getCurrentPageShapeIds()),n=await e.getSvg(t,{padding:8,scale:1});if(n)return console.debug("generated svg",n),n},oa=(e,t,n)=>{if(!e||!t)return;let r=Array.from(e.getCurrentPageShapeIds());r.length>0?e.updateShapes(t):e.createShapes(t),n&&e.updateAssets(n)},ol=(e,t)=>{e.user.updateUserPreferences({isDarkMode:(0,rI.wj)(t)}),setTimeout(()=>{e.zoomToFit()})},os=e=>{let{isOpen:t,isEditable:n,onClose:r,isDrawingEditorActive:o,setDrawingEditorActive:i,editor:a,...s}=e,{node:d,updateAttributes:c}=s,{assets:u,shapes:p}=d.attrs,h=(0,v.CG)(eK.Pu),[g,f]=(0,m.useState)();(0,m.useEffect)(()=>{g&&oa(g,p,u)},[p,u,g,c]);let x=(0,m.useCallback)(e=>{f(e),window.tldrawEditor=e,ol(e,h)},[h]),b=(0,m.useCallback)(async()=>{if(!g)return;let e=await oi(g);e&&c({svg:e.outerHTML})},[g,c]),w=(0,m.useCallback)(()=>{g&&c({shapes:g.getCurrentPageShapes(),assets:g.getAssets(),version:2})},[c,g]),k=(0,ee.Kt)(w,500),j=(0,m.useCallback)(()=>{n&&b(),i(!1),r()},[r,b,i,n]);return(0,l.jsx)(l.Fragment,{children:(0,l.jsxs)(C.dy,{placement:"bottom",onClose:j,isOpen:t,trapFocus:!0,isFullHeight:!0,returnFocusOnClose:!1,children:[(0,l.jsx)(C.P1,{}),(0,l.jsxs)(C.sc,{borderTopRadius:"xl",h:"calc(var(--100vh) - 24px)",onAnimationComplete:e=>{"enter"==e&&i(!0)},transition:{enter:{duration:.4}},children:[(0,l.jsx)(C.Ng,{p:0,h:"100%",overflow:"hidden","data-testid":"drawing-editor-body",children:o?(0,l.jsx)(oo.r,{onMount:x,onChange:n?k:void 0,orgId:a.gammaOrgId,theme:h}):(0,l.jsx)(y.k,{align:"center",justify:"center",w:"100%",h:"100%",children:(0,l.jsx)(rz.$,{size:"xl"})})}),(0,l.jsx)(C.cC,{zIndex:400,backgroundColor:"white","data-testid":"drawing-editor-close"})]})]})})},od=(0,nF.E)(s.xu),oc=e=>{let{node:t,updateAttributes:n,selected:r,editor:o,getPos:i,decorations:a}=e,{width:d,meta:c,id:u,horizontalAlign:p,svg:h,shapes:g}=t.attrs,f=(0,v.CG)(eK.Pw),x=(0,v.CG)(eK.wc),b=(0,e$.LM)(o),C=f&&b&&x,w=(0,v.CG)(eK.Av),k=!!w&&w===u,[j,S]=(0,m.useState)(!1),A=(0,v.CG)(eK.Pu),{ref:E,setIsResizing:z,resizeableSx:T,onLayoutAnimationStart:M,onLayoutAnimationComplete:_}=(0,rj.ow)(o),L=(0,m.useCallback)(()=>{(0,on.Sc)(u,!0)},[u]),P=(0,m.useCallback)(()=>{o.chain().setNodeSelection(i()).focus().run()},[o,i]),R=(0,m.useCallback)(()=>{(0,on.Sc)(null,!1)},[]),H=(0,m.useCallback)((e,r)=>{n({...t.attrs,fullWidthBlock:void 0===r?t.attrs.fullWidthBlock:r,...e})}
1,[t.attrs,n]),D=d||(null==c?void 0:c.width),O=!h,B=g&&g.length>0,{isFullWidth:F}=(0,ot.w)(a),W=(0,or.nN)(F?"center":p);return(0,l.jsx)(ed.lO,{...e,as:"div",children:(0,l.jsxs)(y.k,{w:"100%",className:rk.d,css:W,sx:T,direction:"column",_focusWithin:{shadow:"outline"},children:[(0,l.jsxs)(od,{ref:E,className:"drawing",borderRadius:"var(--box-border-radius)","data-content-reference":!0,"data-selection-ring":!0,"data-selection-background":!0,w:F?"100%":D?"calc(".concat(D," * var(--font-size) / 16)"):"100%",maxW:"100%",h:"auto",position:"relative",layout:!0,layoutDependency:p,transition:{duration:.15},onLayoutAnimationStart:M,onLayoutAnimationComplete:_,minH:O?"6em":"auto","data-drag-handle":!0,children:[C&&r&&!F&&(0,l.jsx)(rj.R4,{imageWrapperRef:E,setIsResizing:z,updateResizeAttrs:H,refreshDeps:[t.attrs]}),!j&&(0,l.jsx)(oe,{svg:h,theme:A}),C&&!k&&!O&&(0,l.jsx)(s.xu,{cursor:"default",position:"absolute",inset:"0",zIndex:"1",onClick:P,onDoubleClick:L}),O&&(0,l.jsxs)(ny.g,{spacing:3,justify:"center",contentEditable:!1,color:"gray.400",h:32,backgroundColor:"blackAlpha.50",borderRadius:"var(--box-border-radius)","data-testid":"drawing-placeholder",children:[(0,l.jsx)(N.G,{size:"2x",icon:te.Kak}),f&&(0,l.jsx)(I.z,{size:"xs",onClick:L,children:B?"Open diagram":"Add diagram"})]})]}),k&&(0,l.jsx)(os,{...e,isOpen:k,isEditable:f,onClose:R,isDrawingEditorActive:j,setDrawingEditorActive:S})]})})},ou=eo.NB.create({name:"diagram",group:"block",atom:!0,selectable:!0,draggable:!0,addAttributes:()=>({id:(0,nO.b)(om),shapes:{...(0,eW.sw)("shapes")},assets:{...(0,eW.sw)("assets"),default:{}},meta:{...(0,eW.sw)("meta"),default:{}},width:{},svg:{}}),parseHTML(){return[{tag:"div[class=diagram]"},{tag:"diagram[bookmark]",getAttrs:(0,eG.xF)(this.storage)}]},addStorage:eG.gk,renderHTMLforAI(e){let{node:t}=e;return["diagram",{bookmark:(0,eG.ml)(this.storage,t)}]},renderHTML(e){let{HTMLAttributes:t}=e;return["div",(0,eo.P1)(t,{class:"diagram"})]},addCommands(){let e=this.name,t=t=>{let{selection:n}=t;return n instanceof tR.qv&&n.node.type.name===e?n.node:void 0};return{editSelectedDiagramBlock:()=>e=>{let{state:n}=e,r=t(n);if(r){let e=(0,v.bh)();e.dispatch((0,eK.h)({drawingId:r.attrs.id}))}return!0}}},addExtensions:()=>[oh],addNodeView:()=>(0,el.fW)(oc,{update:es.E7})}),op=new tR.H$("UniqueMediaId"),om=()=>(0,nD.x0)(5),oh=r7.I.extend({name:"UniqueDiagramId"}).configure({attributeName:"id",types:["diagram"],initialValue:om,filterTransaction:e=>{let t=e.getMeta(nl.Gt);return(null==t?void 0:t.isChangeOrigin)!==!0},pluginKey:op});var og=n(47577);let of=()=>(0,l.jsx)(el.T5,{as:"div",children:(0,l.jsx)(s.xu,{contentEditable:!1,borderRadius:"var(--box-border-radius)","data-selection-ring":"padded","data-selection-background":!0,"data-drag-handle":!0,py:"0.25em",position:"relative",transform:"translateY(0.25em)",children:(0,l.jsx)(z.i,{borderColor:"var(--body-color)",borderBottomWidth:"0.125em",opacity:.5})})}),ox=/^(---|___|â-)/,ov=eo.NB.create({name:"divider",group:"block cardNotesBlock",atom:!0,selectable:!0,draggable:!0,parseHTML:()=>[{tag:'hr[class="divider"]'}],renderHTML(e){let{HTMLAttributes:t}=e;return["hr",(0,eo.P1)(t,{class:"divider"})]},addNodeView:()=>(0,el.fW)(of),addInputRules(){return[(0,og.ok)({find:ox,type:this.t
1ype})]}});var ob=n(25925),oy=n(87202),oC=n(17292),ow=n(5200),ok=n(15151),oj=n(34135),oS=n(66479),oA=n(5995);let oI=(0,m.memo)(e=>{let{theme:t}=e,n=(0,e3.c)(t),r=(0,oA.l)(t);return(0,l.jsx)(s.xu,{as:"svg",width:"0",height:"0",sx:r,children:(0,l.jsxs)("defs",{children:[(0,l.jsx)(oE,{theme:t}),(0,l.jsx)(oz,{theme:t}),n.SVGDefs&&(0,l.jsx)(n.SVGDefs,{theme:t})]})})});oI.displayName="ThemeSVGDefs";let oE=(0,m.memo)(e=>{let{theme:t}=e,{accentGradient:n}=t.config;return!n||n.colors.length<=1||n.disabled?null:(0,l.jsx)(oT,{gradient:n,id:"theme-accent-gradient-linear"})});oE.displayName="ThemeAccentGradientLinearDef";let oz=(0,m.memo)(e=>{let{theme:t}=e,{accentGradient:n}=t.config;if(!n||n.colors.length<=1||n.disabled)return null;let r=(0,oS.wj)(t),o=(0,oj.UL)(n,r?.25:.9);return o?(0,l.jsx)(oT,{gradient:o,id:"theme-accent-background-gradient-linear"}):null});oz.displayName="ThemeAccentBackgroundGradientLinearDef";let oT=(0,m.memo)(e=>{let{gradient:t,id:n}=e;return(0,l.jsx)("linearGradient",{id:n,x1:"0%",y1:"0%",x2:"100%",y2:"100%",children:t.colors.map((e,n)=>(0,l.jsx)("stop",{offset:"".concat(100*n/(t.colors.length-1),"%"),stopColor:e||oj.wr},n))})});oT.displayName="LinearGradientDef";var oN=n(88959);let oM=e=>{if(e.state.selection instanceof tR.qv&&(0,oN.Q)(e.state.selection.node)){e.chain().focus(e.state.selection.from).blur().run();return}return e.commands.blur()};var o_=n(90221),oL=n(93814),oP=n(7207),oR=n(70347),oH=n(18149),oD=n.n(oH);let oO=e=>(0,v.CG)(t=>{let n=(0,eK.gh)(t);if(n===nk.q.DOC_VIEW)return null;let r=(0,eK.k8)(t);if(!r||!(null==r?void 0:r.cardId))return null;let[o]=(0,eo.N2)(e.state.doc,e=>(0,tf.KH)(e)&&e.attrs.id===r.cardId);if(!o)return console.warn("[usePresentingCardBackground] Unexpectedly couldnt find presentingCard ".concat(r.cardId)),null;let i=(0,eW.nv)(e.state.doc.resolve(o.pos+1),e=>(0,tf.KH)(e)&&e.attrs.background&&!e.attrs.background.inside).pop();return i?i.node.attrs.background:(console.warn("[usePresentingCardBackground] Unexpectedly couldnt find card at pos ".concat(o.pos)),null)},oD());var oB=n(83905);let oF=(0,nF.E)(s.xu),oW=(e,t)=>{let n=!!(e&&t),r=!!(e&&!t),o=!!(!e&&t),i=!!(!e&&!t),a=(0,m.useRef)(n);(0,m.useEffect)(()=>{a.current=n},[n,i]);let l=r||o?a.current:n;return[l,n]},oG=e=>{let{editor:t,node:n,updateAttributes:r}=e,o=(0,h.v9)(eK.gh),i=(0,v.CG)(eK.hN),a=(0,h.v9)(eK.Hl),d=(0,h.v9)(eK.i2);(0,v.CG)(eK.K3);let c=(0,v.CG)(eK.Pu),u=o===nk.q.SLIDE_VIEW,p=oO(t),{background:g}=n.attrs,f=(0,e$.TZ)(),[x,b]=oW(u,d);(0,m.useEffect)(()=>{!n.attrs.docId&&t.gammaDocId&&r({...n.attrs,docId:t.gammaDocId})},[n.attrs,t,r]);let C=(0,ok.J)(c,i),w=(0,rI.wj)(c),k=(0,eZ.R5)(c,g),j=(0,eZ.wh)(k,w,t.isThumbnail?eY.Iv:void 0),S=(0,eZ.wh)(u&&p&&p.type!==eF.E.NONE?p:k,w,t.isThumbnail?eY.Iv:void 0);console.debug("%c[DocComponent] Doc is rerendering","background-color: chartreuse",{isPresentModeReady:b,isPresentModeReadyLagging:x,presentingCardId:d});let A=(0,m.useCallback)(e=>{let n=e.target;return(!n.closest(".".concat(oL.ar))||!!n.getAttribute("data-outside-card-body"))&&(oM(t),!0)},[t]);(0,m.useEffect)(()=>oC.F7.on("keydown","DOC_BLUR",e=>!!(0,oy.ZP)("Esc")(e)&&!!t.isFocused&&(t.commands.blur(),e.preventDefault(),!0)),[t]);let I=(0,e$.Br)("comment");return(0,l.jsxs)(el.T5,{as:"div","data-testid":"doc-node-root",style:{height:"100%"},children:[(0,l.jsx)(ow.P,{theme:c}),(0,l.jsx)(oI,{theme:c}),(0,l.jsx)(s.xu,{sx:{counterReset:"footnote"},onMouseDown:A,h:"100%",children:(0,l.jsxs)(y.k,{className:"doc-content-wrapper",direction:"column",align:"center",pos:"relative",pb:f||u||!I?"0px":a?oP.i:oP.m,sx:C,onDragOver:tp.Gb,minH:"calc(var(--100vh) - var(--editor-padding-top, 0px))",children:[(0,l.jsx)(oU,{...j,isMobileDevice:f,isPresentMode:u}),(0,l.jsx)(ob.M,{children:(0,l.jsx)(oF,{className:"motion-present-mode-bg","data-doc-background-element-present-mode":!0,position:"fixed",zIndex:oB.S.presentBg,top:0,left:0,right:0,h:"100%",initial:{opacity:0}
1,animate:{opacity:1},exit:{opacity:1},visibility:b?"visible":"hidden",transition:oL.Vs,...S},"presenting-background-"+d)}),(0,l.jsx)(y.k,{sx:{width:"100%",'[data-animate-value="doc"]':{display:x?"none":void 0}},justify:"center",className:(0,ew.cx)("document-content",u?"is-present-mode":"is-doc-mode"),pt:"var(--doc-padding-top)",children:(0,l.jsx)(el.ms,{style:{width:"100%"}})})]})}),f&&(0,l.jsx)(oR.kT,{})]})},oU=e=>{let{isMobileDevice:t,isPresentMode:n,...r}=e,o=(0,o_.f_)()?{style:{touchAction:"none"},position:"fixed",top:0,left:0}:{};return(0,l.jsx)(y.k,{"data-doc-background-element":!0,"data-testid":"doc-background",position:"absolute",w:"var(--editor-width)",h:"100%",contentEditable:!1,...r,...o,backgroundAttachment:"fixed",children:!t&&!n&&(0,l.jsx)(oR.LN,{})})};var oV=n(7287);let oq=eo.NB.create({name:"doc",topNode:!0,content:"document"}),o$=eo.NB.create({name:"document",content:"card+",isolating:!0,defining:!0,selectable:!1,addAttributes:()=>({docId:{},background:{default:oV.w.background,...(0,eW.sw)("background")},docFlags:{default:oV.w.docFlags,...(0,eW.sw)("docFlags")},format:{},customCode:{default:oV.w.customCode,...(0,eW.sw)("customCode")},settings:{default:oV.w.settings,...(0,eW.sw)("settings")},generateStatus:{default:oV.w.generateStatus},generateInfo:{default:oV.w.generateInfo,...(0,eW.sw)("generateInfo")}}),addNodeView:()=>(0,el.fW)(oG,{update:es.E7,ignoreMutation:e=>{let{mutation:t}=e,n=t.target instanceof HTMLElement?t.target:t.target.parentElement,r="selection"!==t.type&&oK(n);return console.debug("[Document.ignoreMutation] isMutationOutsideDocContent:",r),!!r}}),parseHTML:()=>[{tag:"div[class=gamma-doc]"}],renderHTML(e){let{HTMLAttributes:t}=e;return["div",(0,eo.P1)(t,{class:"gamma-doc"}),0]}}),oK=e=>{let t=null==e?void 0:e.parentElement;return!!t&&!t.closest(".document-content")};var oZ=n(65878),oY=n(34227),oX=n(35503),oJ=n(46188),oQ=n(26282),o0=n(26824),o1=n(20182);class o2{destroy(){this.handlers.forEach(e=>{let{name:t,handler:n}=e;return this.editorView.dom.removeEventListener(t,n)})}update(e,t){null!=this.cursor&&t.doc!=e.state.doc&&(this.cursor.pos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){var t,n,r,o,i;let a=(null==e?void 0:e.pos)||null;(a!=(null===(t=this.cursor)||void 0===t?void 0:t.pos)||(null==e?void 0:e.type)!=(null===(n=this.cursor)||void 0===n?void 0:n.type)||(null==e?void 0:e.side)!=(null===(r=this.cursor)||void 0===r?void 0:r.side))&&(this.cursor=e,null==e?(null===(i=this.element)||void 0===i||null===(o=i.parentNode)||void 0===o||o.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){var e;let t,n;if(null==this.cursor||!this.editorView)return;let r=this.editorView.state.doc.resolve(this.cursor.pos),o,i="";if("gallery"==this.cursor.type&&(null===(e=this.cursor.node)||void 0===e?void 0:e.type.name)!=="gallery")o=this.cursor.rect,i="Drop to make a gallery";else if("blankRect"==this.cursor.type)o=this.cursor.rect,i="";else if("column"==this.cursor.type||"gallery"==this.cursor.type||"smartLayout"==this.cursor.type){let e=this.cursor.rect;if(!e)return;let t="right"==this.cursor.side||"bottom"==this.cursor.side,n=t?r.nodeAfter:r.nodeBefore,i=n&&((0,oX._5)(n)||(0,oQ.E)(n))?0:this.width;if("right"==this.cursor.side||"left"==this.cursor.side){let n=t?e.right+i:e.left-i;o={top:e.top,bottom:e.bottom,left:n-this.width/2,right:n+this.width/2}}else{let n=t?e.bottom+i:e.top-i;o={left:e.left,right:e.right,top:n-this.width/2,bottom:n+this.width/2}}}else if(!r.parent.inlineContent){let e=r.nodeBefore,t=r.nodeAfter;if(e||t){let n=this.editorView.nodeDOM(this.cursor.pos-(e?e.nodeSize:0));if(!n||!(n instanceof Element))return;let r=n.getBoundingClientRect(),i=e?r.bottom:r.top;e&&t&&(i=(i+this.editorView.nodeDOM(this.cursor.pos).getBoundingClientRect().top)/2),o={left:r.left,right:r.right,top:i-this.width/2,bottom:i+this.width/2}}}if(!o){let e=this.editorView.coordsAtPos(this.cursor.pos);o={left:e.left-this.width/2,right:e.left+this.width/2,top:e.top,bottom:e.bottom}}let a=this.editorView.dom.offsetParent;if(this.element||(this.element=a.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none; background-color: "+this.color),a&&(a!=document.body||"static"!=getComputedStyle(a).position)){let e=a.getBoundingClientRect();t=e.left-a.scrollLeft,n=e.top-a.scrollTop}else t=-pageXOffset,n=-pageYOffset;this.element.style.left=o.left-t+"px",this.element.style.top=o.top-n+"px",this.element.style.width=o.right-o.left+"px",this.element.style.height=o.bottom-o.top+"px",this.element.dataset.type=this.cursor.type,this.element.innerHTML=i}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){var t,n,r,o,i,a,l,s;if(!this.editorView.editable)return;let d=(0,oY.VR)(this.editorView,e,null===(t=this.editorView.dragging)||void 0===t?void 0:t.slice);if(d){this.setCursor({...d,type:"blankRect"}),this.scheduleRemoval(5e3);return}let c=(0,o0.fC)(this.editorView,e,null===(n=this.editorView.dragging)||void 0===n?void 0:n.slice);if(c){this.setCursor({...c,type:"blankRect"}),this.scheduleRemoval(5e3);return}let u=(0,oJ.yT)(this.editorView,e,null===(r=this.editorView.dragging)||void 0===r?void 0:r.slice,!this.editorView.dragging);if(u){this.setCursor({...u,type:"gallery"}),this.scheduleRemoval(5e3);return}let p=(0,oX.BF)(this.editorView,e,null===(o=this.editorView.dragging)||void 0===o?void 0:o.slice,!this.editorView.dragging);if(p){this.setCursor({...p,type:"column"}),this.scheduleRemoval(5e3);return}let m=(0,oY.pY)(this.editorView,e,null===(i=this.editorView.dragging)||void 0===i?void 0:i.slice);if(m){this.setCursor({...m,type:"blankRect"}),this.scheduleRemoval(5e3);return}let h=(0,o0.cQ)(this.editorView,e,null===(a=this.editorView.dragging)||void 0===a?void 0:a.slice);if(h){this.setCursor({...h,type:"smartLayout"}),this.scheduleRemoval(5e3);return}let g=(0,eR.jz)(this.editorView,e,null===(l=this.editorView.dragging)||void 0===l?void 0:l.slice);if(g){this.setCursor({pos:g.pos,type:"default"}),this.scheduleRemoval(5e3);return}let f=(0,o1.Z)(this.editorView,e,null===(s=this.editorView.dragging)||void 0===s?void 0:s.slice);null===f?this.setCursor(null):(this.setCursor({pos:f,type:"default"}),this.scheduleRemoval(5e3))}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){e.target!=this.editorView.dom&&this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}constructor(e,t){this.cursor=null,this.element=null,this.timeout=null,this.editorView=e,this.width=t.width||1,this.color=t.color||"black",this.class=t.class,this.handlers=["dragover","dragend","drop","dragleave"].map(t=>{let n=e=>this[t](e);return e.dom.addEventListener(t,n),{name:t,handler:n}})}}let o3=eo.hj.create({name:"dropCursor",addOptions:()=>({color:"currentColor",width:1,class:null}),addProseMirrorPlugins(){return[function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new tR.Sy({key:new tR.H$("dropCursor"),view:t=>new o2(t,e)})}(this.options)]}}).configure({color:"var(--chakra-ring-color)",width:3,class:"ProseMirror-dropcursor"});var o4=n(35483),o5=n(10668);let o8=e=>{let{svg:t,isDark:n,font:r}=e,o=(0,m.useMemo)(()=>(0,o5.c)(n),[n]),i=(0,m.useMemo)(()=>(0,o5.m)(r),[r]);return t?(0,l.jsx)(s.xu,{dangerouslySetInnerHTML:{__html:t},"data-testid":"drawing-svg",sx:{svg:{width:"100%",height:"auto",text:i,...o}}}):null};var o9=n(62685),o7=n(16656);let o6=["tl-centered-g"],ie=async e=>{let t=await e.getSvg(e.shapes.map(e=>e.id),{padding:1});
1if(t)return o6.forEach(e=>{var n;null===(n=t.querySelector(".".concat(e)))||void 0===n||n.classList.remove(e)}),t.querySelectorAll(":not(mask)[id]").forEach(e=>e.removeAttribute("id")),t},it=e=>{let{isOpen:t,isEditable:n,onClose:r,font:o,isDark:i,isDrawingEditorActive:a,setDrawingEditorActive:s,...d}=e,{node:c,updateAttributes:u}=d,{page:p,assets:h}=c.attrs,[g,f]=(0,m.useState)();(0,m.useEffect)(()=>{(0,on.Us)(g,p,h)},[p,h,g,u]);let x=(0,m.useCallback)(e=>{f(e),window.tldrawEditor=e,(0,on.ZF)(e,!0)},[]),v=(0,m.useCallback)(async()=>{if(!g)return;let e=await ie(g);if(!e)return;u({svg:e.outerHTML});let t=JSON.stringify({page:g.document.pages.page,assets:g.document.assets});console.debug("[DrawingEditor] Generated SVG",{svgSize:e.outerHTML.length,jsonSize:t.length,svgEl:e})},[g,u]),b=(0,m.useCallback)(()=>{g&&u({page:g.document.pages.page,assets:g.document.assets})},[u,g]),w=(0,ee.Kt)(b,500),k=(0,m.useCallback)(()=>{n&&v(),s(!1),r()},[r,v,s,n]);return(0,l.jsx)(l.Fragment,{children:(0,l.jsxs)(C.dy,{placement:"bottom",onClose:k,isOpen:t,trapFocus:!0,isFullHeight:!0,returnFocusOnClose:!1,children:[(0,l.jsx)(C.P1,{}),(0,l.jsxs)(C.sc,{borderTopRadius:"xl",h:"calc(var(--100vh) - 24px)",onAnimationComplete:e=>{"enter"==e&&s(!0)},transition:{enter:{duration:.4}},children:[(0,l.jsx)(C.Ng,{p:0,h:"100%",overflow:"hidden","data-testid":"drawing-editor-body",children:a?(0,l.jsx)(o7.rJ,{readOnly:!n,showPages:!1,onMount:x,onChangePage:n?w:void 0,autofocus:!1,isDark:i,font:o}):(0,l.jsx)(y.k,{align:"center",justify:"center",w:"100%",h:"100%",children:(0,l.jsx)(rz.$,{size:"xl"})})}),(0,l.jsx)(C.cC,{zIndex:2,backgroundColor:"white","data-testid":"drawing-editor-close"})]})]})})},ir=(0,nF.E)(s.xu),io=e=>{let{node:t,updateAttributes:n,selected:r,editor:o,getPos:i,decorations:a}=e,{width:d,meta:c,id:u,horizontalAlign:p,svg:h,page:g}=t.attrs,f=(0,v.CG)(eK.Pw),x=(0,v.CG)(eK.wc),b=(0,e$.LM)(o),C=f&&b&&x,w=(0,v.CG)(eK.Av),k=!!w&&w===u,[j,S]=(0,m.useState)(!1),A=(0,v.CG)(eK.Pu),{isDark:E}=(0,o9.Jh)(A),z=(0,oA.l)(A)["--body-font"],{ref:T,setIsResizing:M,resizeableSx:_,onLayoutAnimationStart:L,onLayoutAnimationComplete:P}=(0,rj.ow)(o),R=(0,m.useCallback)(()=>{(0,on.Sc)(u,!0)},[u]),H=(0,m.useCallback)(()=>{o.chain().setNodeSelection(i()).focus().run()},[o,i]),D=(0,m.useCallback)(()=>{(0,on.Sc)(null,!1)},[]),O=(0,m.useCallback)((e,r)=>{n({...t.attrs,fullWidthBlock:void 0===r?t.attrs.fullWidthBlock:r,...e})},[t.attrs,n]),B=d||(null==c?void 0:c.width),F=!h,W=g&&Object.keys(g.shapes).length>0,{isFullWidth:G}=(0,ot.w)(a),U=(0,or.nN)(G?"center":p);return(0,l.jsx)(ed.lO,{...e,as:"div",children:(0,l.jsxs)(y.k,{w:"100%",className:rk.d,css:U,sx:_,direction:"column",_focusWithin:{shadow:"outline"},children:[(0,l.jsxs)(ir,{ref:T,className:"drawing",borderRadius:"var(--box-border-radius)","data-content-reference":!0,"data-selection-ring":!0,"data-selection-background":!0,w:G?"100%":B?"calc(".concat(B," * var(--font-size) / 16)"):"100%",maxW:"100%",h:"auto",position:"relative",layout:!0,layoutDependency:p,transition:{duration:.15},onLayoutAnimationStart:L,onLayoutAnimationComplete:P,minH:F?"6em":"auto","data-drag-handle":!0,children:[C&&r&&!G&&(0,l.jsx)(rj.R4,{imageWrapperRef:T,setIsResizing:M,updateResizeAttrs:O,refreshDeps:[t.attrs]}),!j&&(0,l.jsx)(o8,{font:z,svg:h,isDark:E}),C&&!k&&!F&&(0,l.jsx)(s.xu,{cursor:"default",position:"absolute",inset:"0",zIndex:"1",onClick:H,onDoubleClick:R}),F&&(0,l.jsxs)(ny.g,{spacing:3,justify:"center",contentEditable:!1,color:"gray.400",h:32,backgroundColor:"blackAlpha.50",borderRadius:"var(--box-border-radius)","data-testid":"drawing-placeholder",children:[(0,l.jsx)(N.G,{size:"2x",icon:te.Kak}),f&&(0,l.jsx)(I.z,{size:"xs",onClick:R,children:W?"Open diagram":"Add diagram"})]})]}),k&&(0,l.jsx)(it,{...e,isOpen:k,isEditable:f,onClose:D,isDark:E,font:z,isDrawingEditorActive:j,setDrawingEditorActive:S})]})})},ii=new tR.H$("UniqueMediaId"),ia=r7.I.extend({name:"UniqueDrawingId"}).configure({attributeName:"id",types:["drawing"],initialValue:on.RA,filterTransaction:e=>{let t=e.getMeta(nl.Gt);return(null==t?void 0:t.isChangeOrigin)!==!0},pluginKey:ii}),il=eo.NB.create({name:"drawing",group:"block",atom:!0,selectable:!0,draggable:!0,addAttributes:()=>({id:(0,nO.b)(on.RA),page:{...(0,eW.sw)("page")},assets:{...(0,eW.sw)("assets"),default:{}},meta:{...(0,eW.sw)("meta"),default:{}},fullWidthBlock:{default:!1},width:{},svg:{}}),parseHTML(){return[{tag:"div[class=drawing]"},{tag:"tldraw",getAttrs:e=>{try{let t=new o4.J2,n=JSON.parse(e.innerHTML);t.insertContent(n,{select:!1});let r={page:t.document.pages[t.currentPageId],assets:t.assets};return r}catch(t){return console.error("(caught) Error parsing Tldraw paste",t,e.innerHTML),!1}}},{tag:"drawing[bookmark]",getAttrs:(0,eG.xF)(this.storage)}]},addStorage:eG.gk,renderHTMLforAI(e){let{node:t}=e;return["drawing",{bookmark:(0,eG.ml)(this.storage,t)}]},renderHTML(e){let{HTMLAttributes:t}=e;return["div",(0,eo.P1)(t,{class:"drawing"})]},addCommands(){this.name;let e=e=>{let{selection:t}=e;
1return t instanceof tR.qv&&("drawing"===t.node.type.name||"diagram"===t.node.type.name)?t.node:void 0};return{editSelectedDrawingBlock:()=>t=>{let{state:n}=t,r=e(n);if(r){let e=(0,v.bh)();e.dispatch((0,eK.h)({drawingId:r.attrs.id}))}return!0}}},addExtensions:()=>[ia],addNodeView:()=>(0,el.fW)(io,{update:es.E7})}),is=eo.hj.create({name:"dynamicNodes",extendNodeSchema(e){var t;return{dynamic:null!==(t=(0,eo.nU)((0,eo.Nl)(e,"dynamic",e)))&&void 0!==t&&t}}}),id=eo.hj.create({name:"fixRequiredAttrs",onBeforeCreate(){Object.values(this.editor.schema.nodes).forEach(e=>{Object.values(e.attrs||{}).forEach(e=>{void 0===e.default&&(e.hasDefault=!1)})})}});var ic=n(79786),iu=n(22596),ip=n(33169),im=n(96693),ih=n(3440),ig=n.n(ih);let ix=e=>{"footnote"!==e.$anchor.doc.type.name&&!e.empty&&!(0,im.AW)(e)&&(0,eo.xh)(e)&&(0,im.RV)()&&(0,im.t0)(null,!1)},iv=(e,t,n,r)=>{if(!e.some(e=>e.docChanged))return;let{doc:o}=n,i=[],a=[];o.nodesBetween(0,n.doc.content.size,(e,t,n)=>{"footnote"===e.type.name&&i.push({from:t,to:t+e.nodeSize,node:e,parent:n}),e.marks.forEach(r=>{"footnoteLabel"===r.type.name&&a.push({from:t,to:t+e.nodeSize,mark:r,parent:n})})});let l=a.filter(e=>{let{mark:t,parent:n}=e;return!i.find(e=>{let{node:r,parent:o}=e;return r.attrs.noteId===t.attrs.noteId&&o===n})});l.forEach(e=>{let{from:t,to:n,mark:o}=e;return r.removeMark(t,n,o)});let s=e=>(0,eo.TP)("footnoteLabel",n.schema).create({noteId:e});a.filter(e=>{let{mark:t}=e;return!t.attrs.noteId}).forEach(e=>{let{mark:t,from:n,to:o}=e,l=i.find(e=>{let{node:t,from:n}=e,r=n>=o,i=!a.find(e=>{let{mark:n}=e;return n.attrs.noteId==t.attrs.noteId});return r&&i});l&&r.removeMark(n,o,t).addMark(n,o,s(l.node.attrs.noteId))});let d=ig()(i,e=>{let{node:t}=e;return t.attrs.noteId});Object.entries(d).forEach(e=>{let[t,n]=e;if(1==n.length||!t)return;let o=a.filter(e=>{let{mark:n}=e;return n.attrs.noteId===t});n.slice(1).forEach((e,t)=>{let{from:n}=e,i=(0,im.H)();r.setNodeMarkup(n,void 0,{noteId:i});let a=o[t+1];a&&(r.removeMark(a.from,a.to,a.mark),r.addMark(a.from,a.to,s(i)))})})},ib=new tR.Sy({key:new tR.H$("footnote"),appendTransaction:(e,t,n)=>{let{selection:r}=n;r.eq(t.selection)||ix(r);let o=n.tr;return((0,ns.W)(e,t,n,o),iv(e,t,n,o),o.docChanged)?(console.debug("[FootnotePlugin] Applied steps",o.steps),o):null}});var iy=n(43679),iC=n(34071),iw=n(332),ik=n(39429),ij=n(46164),iS=n(48394),iA=n(10625),iI=n(67046),iE=n(99058),iz=n(25481),iT=n(54933),iN=n(98537),iM=n.n(iN),i_=n(42703),iL=n(28858),iP=n(91579);let iR=(e,t,n)=>{let r=(0,v.CG)(eK.II);(0,S.O)({ref:n,enabled:!!(n&&r===t),handler(e){var t,n;(null===(t=e.target)||void 0===t?void 0:t.closest("[data-footnote-view]"))||(null===(n=e.target)||void 0===n?void 0:n.closest("[data-footnote-label]"))||o(!1)}});let o=(0,m.useCallback)(n=>{var o,i;let a=e.state.selection,l=(0,eo.xh)(a)&&!a.empty,s=(null===(o=document.activeElement)||void 0===o?void 0:o.closest(".footnote-popover"))||!!(null===(i=document.activeElement)||void 0===i?void 0:i.closest("[data-in-editor-focus]")),d=void 0!==n?n:r!==t;s||(d&&!l?(0,im.NX)(t,!0):!1===d&&(0,im.NX)(t,!1))},[e.state.selection,r,t]);return{onClick:o}},iH=e=>{let{node:t,editor:n,innerEditor:r,selected:o}=e,{noteId:i}=t.attrs,a=(0,m.useRef)(null),d=(0,v.CG)(eK.II),c=(0,v.CG)(eK.Pw),u=(0,nE.C7)(),{onClick:p}=iR(n,i,a);(0,m.useEffect)(()=>{r&&r.setEditable(c)},[c,r]);let h=!!d&&d===i,g=(0,m.useCallback)(()=>(0,im.t0)(i,!1),[i]);(0,m.useEffect)(()=>{if(!r)return;let e=()=>{setTimeout(()=>{(0,eW.KB)(r)||g()},20)};return r.on("blur",e),()=>{r.off("blur",e)}},[r,g]);let f=!(0,ni.$v)(n),x=(0,m.useCallback)(()=>{f&&p()},[f,p]);return(0,l.jsx)(el.T5,{as:"span","data-testid":"footnote-nodeview-wrapper",children:(0,l.jsxs)(iy.J,{isOpen:h,onClose:g,placement:"top",gutter:8,isLazy:!0,lazyBehavior:"unmount",autoFocus:!1,closeOnBlur:!1,closeOnEsc:!1,returnFocusOnClose:!1,children:[(0,l.jsx)(iC.x,{children:(0,l.jsx)(eC.x,{as:"span",onClick:x,_after:{content:"counter(footnote)",counterIncrement:"footnote",position:"relative",bottom:"0.6em",fontSize:"0.8em",shadow:o&&f?"outline":void 0,borderRadius:"sm"},pl:"1px",className:"footnote",contentEditable:!1,"data-footnote-view":!0,
1cursor:f?"pointer":void 0})}),f&&(0,l.jsx)(iw.h,{children:(0,l.jsxs)(ik.y,{zIndex:"popover",shadow:"md",borderRadius:"md",border:"1px solid",borderColor:"gray.200",w:"500px",maxW:"100vw","data-footnote-popover-test-id":i,p:0,ref:a,children:[(0,l.jsx)(ij.Q,{}),(0,l.jsx)(iS.b,{position:"relative",zIndex:"1",p:0,className:"footnote-popover","data-footnote-popover-id":i,children:u?(0,l.jsx)(iB,{...e,onClose:g}):(0,l.jsx)(iO,{...e,editable:c,onClose:g})}),(0,l.jsx)(s.xu,{position:"absolute",top:"-".concat(8,"px"),bottom:"-".concat(8,"px"),left:0,right:0,zIndex:"0"})]})})]})})},iD=iM()({},iL.I,{".ProseMirror":{px:8,py:4,overflow:"hidden auto",maxH:"300px",maxW:"100%",borderRadius:"md"}}),iO=e=>{let{editor:t,innerEditor:n,mountEditor:r,destroyEditor:o,node:i,editable:a,getPos:d,onClose:c}=e,{noteId:u}=i.attrs,p=(0,m.useCallback)(()=>t.commands.convertNoteToCard(u),[t,u]),h=(0,m.useCallback)(()=>{t.chain().focus().setNodeSelection(d()).deleteSelection().run()},[t,d]);(0,m.useEffect)(()=>{if(r&&o)return r(),()=>{o()}},[r,o]);let g=(0,v.CG)(eK.Pu),f=(0,oA.l)(g,"#FFFFFF");if(!n)return null;let x=(0,eo.N2)(t.state.doc,e=>e.marks.some(e=>"footnoteLabel"===e.type.name&&e.attrs.noteId===u)).length>0;return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(s.xu,{className:oL.pL,sx:iD,position:"relative",_focusWithin:{shadow:a?"outline":void 0},borderRadius:"md",css:f,children:[(0,l.jsx)(iP.k,{editor:n,className:"highlight-mask"}),(0,l.jsx)(et.Y,{editor:n}),(0,l.jsxs)(e7.h,{size:"sm",colorScheme:"gray",variant:"ghost",position:"absolute",right:4,top:2,onMouseDown:tp.br,spacing:0,children:[a&&(0,l.jsxs)(iA.v,{autoSelect:!1,isLazy:!0,children:[(0,l.jsx)(iI.j,{as:tb.h,icon:(0,l.jsx)(N.G,{icon:te.S6C}),minW:6,h:6,isRound:!0,backgroundColor:"white"}),(0,l.jsx)(iw.h,{children:(0,l.jsxs)(iE.q,{"data-in-editor-focus":!0,zIndex:"dropdown",children:[x&&(0,l.jsx)(iz.s,{icon:(0,l.jsxs)("span",{className:"fa-layers fa-fw",children:[(0,l.jsx)(N.G,{icon:iT.lCX,fixedWidth:!0}),(0,l.jsx)(N.G,{icon:iT.eFW,inverse:!0,transform:"shrink-8"})]}),onClick:p,children:(0,l.jsx)(M.cC,{id:"p/s15o"})}),(0,l.jsx)(iz.s,{icon:(0,l.jsx)(N.G,{icon:te.XAH,fixedWidth:!0}),color:"red.500",onClick:h,children:(0,l.jsx)(M.cC,{id:"sHHbXH"})})]})})]}),(0,l.jsx)(tb.h,{"aria-label":_.ag._({id:"j+JKcM"}),icon:(0,l.jsx)(N.G,{icon:te.NBC}),minW:6,h:6,isRound:!0,onClick:c,backgroundColor:"white"})]})]}),(0,l.jsx)(en.u,{editor:n})]})},iB=e=>{let{mountEditor:t,destroyEditor:n,onClose:r}=e,o=(0,m.useMemo)(()=>{if(t)return t()},[t]);(0,m.useEffect)(()=>{if(n)return()=>n()},[n]);let i=(0,v.CG)(eK.Pu),a=(0,oA.l)(i,"#FFFFFF");return o?(0,l.jsx)(l.Fragment,{children:(0,l.jsxs)(s.xu,{className:oL.pL,sx:iD,position:"relative",borderRadius:"md",css:a,children:[(0,l.jsx)(i_.f,{editor:o}),(0,l.jsx)(e7.h,{size:"sm",colorScheme:"gray",variant:"ghost",position:"absolute",right:4,top:2,onMouseDown:tp.br,spacing:0,children:(0,l.jsx)(tb.h,{"aria-label":_.ag._({id:"j+JKcM"}),icon:(0,l.jsx)(N.G,{icon:te.NBC}),minW:6,h:6,isRound:!0,onClick:r,backgroundColor:"white"})})]})}):null};var iF=n(96374);let iW=eo.vc.create({name:"footnoteLabel",inclusive:!1,excludes:"link underline",priority:tL.a.FootnoteLabel,parseHTML(){return[{tag:"span[class=footnote-label][bookmark]",getAttrs:(0,eG.xF)(this.storage)},{tag:"span[class=footnote-label]"}]},renderHTML(e){let{HTMLAttributes:t}=e;return["span",(0,eo.P1)(t,{class:"footnote-label"}),0]},renderHTMLforAI(e){let{mark:t}=e;return["span",{class:"footnote-label",bookmark:(0,eG.ml)(this.storage,t)},0]},addStorage:eG.gk,addAttributes:()=>({noteId:{rendered:!1}}),addProseMirrorPlugins(){return[(0,iF.r)(this,iG)]}}),iG=e=>{let{node:t,editor:n,children:r}=e,{noteId:o}=t.attrs,i=(0,nE.C7)(),{onClick:a}=iR(n,o),s=!(0,ni.$v)(n),d=(0,m.useCallback)(()=>{s&&a()},[s,a]);return(0,l.jsx)(el.T5,{as:"span",className:"footnote-label-view",children:(0,l.jsx)(eC.x,{as:"span",className:"footnote-label",onClick:d,"data-footnote-label":!0,cursor:s?"pointer":void 0,children:i?r:(0,l.jsx)(el.ms,{as:"span"})})})},iU=/(?:^|\s)((?:\^)((?:[^^]+))(?:\^))$/,iV=eo.NB.create({name:"footnote",content:"(block | footnoteBlock)+",group:"inline",atom:!0,inline:!0,priority:tL.a.Footnote,parseHTML(){return[{tag:"span[class=footnote]",getContent:(e,t)=>
1rF.HY.fromJSON(t,JSON.parse(e.getAttribute("data-content")||"{}"))},{tag:"div[class=imported-footnote]"},{tag:"footnote[bookmark]",getAttrs:(0,eG.xF)(this.storage),getContent:(0,eG.eV)(this.storage)}]},addStorage:eG.gk,renderHTML(e){let{node:t,HTMLAttributes:n}=e;return["span",(0,eo.P1)(n,{class:"footnote","data-content":JSON.stringify(t.content.toJSON())})]},renderHTMLforAI(e){let{node:t}=e;return["footnote",{bookmark:(0,eG.ml)(this.storage,t)}]},addAttributes(){return{noteId:{parseHTML:e=>{let t=(0,eG.xF)(this.storage)(e);return t&&t.noteId?t.nodeId:(0,im.H)()},default:void 0}}},addNodeView:()=>nt(iH,{nodeName:"footnote",preventNodeOrExtensionTypes:["doc","document","card"]}),addInputRules(){var e;return[(e={find:iU,nodeType:this.type,markType:this.editor.schema.marks.footnoteLabel},new eo.VK({find:e.find,handler:t=>{let{state:n,range:r,match:o}=t,{tr:i}=n,a=o[o.length-1],l=o[0],s=r.to;if(a){let t=l.search(/\S/),o=r.from+l.indexOf(a),d=o+a.length,c=(0,eo.tI)(r.from,r.to,n.doc).filter(t=>{let n=t.mark.type.excluded;return n.find(n=>n===e.markType&&n!==t.mark.type)}).filter(e=>e.to>o);if(c.length)return;d<r.to&&i.delete(d,r.to),o>r.from&&i.delete(r.from+t,o),s=r.from+t+a.length;let u=(0,im.H)();(0,im.t0)(u,!0);let p=e.nodeType.createAndFill({noteId:u},rF.HY.empty);i.insert(s,p),i.addMark(r.from+t,s,e.markType.create({noteId:u})),i.removeStoredMark(e.markType)}}}))]},addKeyboardShortcuts:()=>({Enter:e=>{let{editor:t}=e;if(!(0,im.AW)(t.state.selection))return!1;let n=t.state.selection.node.attrs.noteId;return(0,im.t0)(n,!0),!0},Escape:()=>{let e=(0,im.RV)();return!!e&&((0,im.t0)(e,!1),!0)},"Mod-Alt-f":e=>{let{editor:t}=e;return t.commands.toggleFootnote()}}),addProseMirrorPlugins:()=>[ib],addCommands:()=>({convertNoteToCard:e=>t=>{let{chain:n,state:r}=t,{doc:o}=r,i=(0,eo.N2)(o,t=>"footnote"===t.type.name&&t.attrs.noteId===e);if(1!==i.length)throw Error("Found the wrong number of footnotes nodes: ".concat(i));let{node:a,pos:l}=i[0],s=(0,eo.IH)(o.resolve(l-1),r.schema.marks.footnoteLabel,{noteId:a.attrs.noteId});if(!s)return console.error("Couldnt find the corresponding footnote mark",{node:a,pos:l}),!1;let d=o.textBetween(s.from,s.to),c={type:"card",attrs:{id:ip.C2.generate()},content:[{type:"heading",attrs:{level:1},content:[{type:"text",text:d}]},...a.content.toJSON()]},u=new URL(window.location.href);u.hash="card-".concat(c.attrs.id),(0,eH.Nn)(c.attrs.id,!1);let p=o.content.size-1;return n().setTextSelection(s).unsetMark("footnoteLabel").setLink({href:u.toString()}).insertContentAt(p,c).command(e=>{let{tr:t}=e,n=(0,J.t)(t.doc.resolve(p));return n&&t.setSelection(n),!0}).deleteRange({from:l,to:l+a.nodeSize}).focusDelayed().run()},toggleFootnote:()=>e=>{let{chain:t,state:n,editor:r}=e;if(r.isActive("footnoteLabel"))return t().toggleMark("footnoteLabel").focus().run();let o=(0,im.H)();return(0,im.t0)(o,!0),(0,iu.N)().push(()=>{var e,t;null===(e=(t=r.commands).forceHideBubbleMenu)||void 0===e||e.call(t,!0),iq(o)},"toggleFootnote"),t().setMark("footnoteLabel",{noteId:o}).insertContentAt(n.selection.to,{type:"footnote",attrs:{noteId:o},content:[{type:"paragraph"}]}).run()}})}),iq=e=>{let t=document.querySelector('[data-footnote-popover-id="'.concat(e,'"] .ProseMirror'));if(!t)return;t.focus();let n=window.getSelection();if(!n)return;let r=document.createRange();r.setStart(t,0),r.setEnd(t,0),n.removeAllRanges(),n.addRange(r)};var i$=n(28041),iK=n(85818),iZ=n(9432);let iY=/(?:^|\s)((?:_)((?:[^_]+))(?:_))$/,iX=/(?:^|\s)((?:__)((?:[^__]+))(?:__))$/,iJ=iZ.ZP.extend({addInputRules(){return[(0,eo.Cf)({find:iY,type:this.type}
1),(0,eo.Cf)({find:iX,type:this.type})]}});var iQ=n(45534),i0=n(5596),i1=n(14657),i2=n(39951),i3=n(65940),i4=n(99914),i5=n(89064);let i8=e=>{let{node:t,decorations:n,editor:r,getPos:o}=e,{options:i,...a}=t.attrs,d=(0,i4.PX)(n),c=(0,i5.P)(d.smartLayoutAttrs.variantKey),{Cell:u}=c,p=(0,v.CG)(eK.Pu),h=(0,o0.jM)(d.smartLayoutAttrs),{firstChildSize:g}=(0,eE.z)(n),f=d.index===d.numCells-1,x=(0,v.CG)(eK.hN),b=(0,e1.Od)(n),w=(0,m.useCallback)(()=>{let e=o(),t=r.state.doc.nodeAt(o());t&&r.commands.insertSmartLayoutCell(e+t.nodeSize)},[r,o]),k=c.addDirection?c.addDirection(h):"right",j=(0,m.useCallback)(()=>{x&&r.commands.selectNodeAtPos(o())},[r,o,x]);return(0,l.jsx)(i3.l,{...e,children:(0,l.jsx)(s.xu,{display:"contents",position:"relative","data-spotlight-parent":!0,children:(0,l.jsxs)(u,{cellOptions:i,layoutOptions:h,theme:p,...d,...a,...e,firstChildSize:g,isFocused:b,selectCell:j,variant:c,dragHandle:(0,l.jsx)(eI.A,{...e,handlePlacement:"top","data-testid":"smart-layout-cell-drag-handle",label:(0,l.jsx)(y.k,{direction:"column",align:"center",children:(0,l.jsx)(M.cC,{id:"YkfVHA",components:{0:(0,l.jsx)(eC.x,{color:"gray.500"})}})})}),children:[(0,l.jsx)(el.ms,{style:{maxWidth:"100%",wordBreak:"break-word"}}),x&&f&&(0,l.jsx)(y.k,{position:"absolute",..."bottom"===k?{bottom:-3,right:0,width:"100%",height:6,justify:"center"}:{right:-3,bottom:0,height:"100%",width:6,align:"center"},opacity:"0",transitionProperty:"opacity",transitionDuration:"normal",zIndex:"1",className:"add-button",children:(0,l.jsx)(C.kH,{label:(0,l.jsx)(M.cC,{id:"NQ8llq"}),placement:"top",children:(0,l.jsx)(tb.h,{icon:(0,l.jsx)(N.G,{icon:te.r8p}),"aria-label":_.ag._({id:"NQ8llq"}),position:"absolute",size:"xs",variant:"plain",isRound:!0,onClick:w,onMouseDown:tp.br})})})]})})})},i9=eo.NB.create({name:"smartLayoutCell",content:"(block | smartLayoutBlock)+",isolating:!0,selectable:!1,containerHandle:!0,imageKeyPath:"image",accessoryImageKey:"image",addAttributes:()=>({options:{default:{},...(0,eW.sw)("options")},width:{default:null},image:{default:null,...(0,eW.sw)("image")},label:{default:null,parseHTML:e=>e.getAttribute("label")||e.getAttribute("number")}}),parseHTML(){return[{tag:"div[class=layout-item]"},{tag:"item"},{tag:"div[bookmark]",context:"smartLayout/",getAttrs:(0,eG.xF)(this.storage)},{tag:"div",context:"smartLayout/"}]},renderHTML(e){let{HTMLAttributes:t}=e;return["div",(0,eo.P1)(t,{class:"layout-item"}),0]},addStorage:eG.gk,renderHTMLforAI(e){let{node:t}=e;return["div",{bookmark:(0,eG.ml)(this.storage,t)},0]},addNodeView:()=>(0,el.fW)(i8,{update:es.E7})});var i7=n(89484),i6=n(71986);let ae=e=>{let{node:t}=e,{verticalAlign:n}=t.attrs;return(0,l.jsxs)(el.T5,{className:"grid-cell",style:{position:"relative",justifyContent:n},"data-selection-ring":!0,children:[(0,l.jsx)(eI.A,{handlePlacement:"top",...e,"data-testid":"column-drag-handle",label:(0,l.jsx)(y.k,{direction:"column",align:"center",children:(0,l.jsx)(M.cC,{id:"zWdF4l",components:{0:(0,l.jsx)(eC.x,{color:"gray.500"})}})})}),(0,l.jsx)(el.ms,{})]})},at=eo.NB.create({name:"gridCell",content:"(block | layoutBlock)+",definingAsContext:!0,isolating:!0,selectable:!1,containerHandle:!0,parseHTML:()=>[{tag:"div[class=column]"},{tag:"div",context:"gridLayout/"}],addAttributes:()=>({verticalAlign:null}),renderHTML(e){let{HTMLAttributes:t}=e;return["div",(0,eo.P1)(t,{class:"column"}),0]},addNodeView:()=>(0,el.fW)(ae,{update:es.E7})});class an{constructor(e=null){this.dragging=e}}let ar=new tR.H$("layoutPlugin"),ao=e=>new tR.Sy({key:ar,state:{init:()=>new an,apply:(e,t)=>t},appendTransaction:(e,t,n)=>{if(!e.some(e=>e.docChanged))return null;let r=e.find(e=>e.selectionSet),o=n.tr;if(n.doc.descendants((e,t)=>{if("gridLayout"===e.type.name&&1==e.childCount){let n=o.mapping.map(t);o.replaceWith(n,o.mapping.map(t+e.nodeSize),e.child(0).content).setMeta("annotationEvent",{type:"unwrap-node",pos:n})}}),!o.docChanged)return null;if(r){let e=r.selection.$from.depth-o.selection.$from.depth,t=(0,rG.E)(o.doc.resolve(r.selection.from-e));t&&o.setSelection(t)}return o},props:{handleDOMEvents:{drop(e){var t;let n=null===(t=e.dragging)||void 0===t?void 0:t.annotations,r=ar.getState(e.state);if(!r)return!1;r.dragging=n}},handleDrop:(t,n,r)=>{let o=ar.getState(t.state),i=null==o?void 0:o.dragging;o&&(o.dragging=null);let a=null;try{if(!(a=(0,oX.BF)(t,n,r,!1)))return!1}catch(e){return!1}try{let{selection:n}=t.state,o=!n.empty,{node:s,pos:d,side:c}=a;if(d>n.from&&d<n.to)return!0;let u=r.content.toJSON();if("gridCell"===s.type.name){var l;let t="left"===c?d:d+s.nodeSize,n=(null===(l=u[0])||void 0===l?void 0:l.type)!=="gridCell",r=n?{type:"gridCell",content:u}:u;e.chain().insertContentAt({from:t,to:t},r,{updateSelection:!1}).command(e=>{let{tr:r}=e;return o&&r.deleteSelection(),i&&r.setMeta("annotationEvent",{type:"drop",dragging:i,droppedBlockPos:t+(n?1:0)}),!0}).focusMapped(t,1).run()}else{let n="left"===c?r.size:s.nodeSize;e.chain().insertContentAt({from:d,to:d+s.nodeSize}
1,{type:"gridLayout",content:[{type:"gridCell",content:"left"===c?u:[s.toJSON()]},{type:"gridCell",content:"left"===c?[s.toJSON()]:u}]},{updateSelection:!1}).command(r=>{let{tr:a}=r;if(o&&a.deleteSelection(),i){let r=(0,i1.lM)({side:c,view:t,tr:a,dragging:i,dropPos:d,dropNode:s,leftContentSize:n});requestAnimationFrame(()=>{var t,n;null===(t=(n=e.commands).moveAnnotations)||void 0===t||t.call(n,r)})}return!0}).focusMapped(d,"left"===c?2:s.nodeSize+4).run()}}catch(e){console.error("(caught) [LayoutPlugin] handleDrop error:",e)}return!0}}}),ai=new tR.H$("layoutResizing");class aa{getActiveHandleAbs(e){return this.activeHandle?(0,tD.XV)(e,this.activeHandle):null}reset(){return this.activeHandle=null,this.dragging=null,this}setHandle(e,t){return null===t.setHandle?this.activeHandle=null:this.activeHandle=(0,tD.jS)(e,t.setHandle),this}setDragging(e){return this.dragging=e.setDragging,this}apply(e,t){let n=e.getMeta(ai);return n&&"setHandle"in n?this.setHandle(t,n):n&&"setDragging"in n?this.setDragging(n):n&&"reset"in n?this.reset():this}constructor(e=null,t=null){this.activeHandle=e,this.dragging=t}}let al=e=>ai.getState(e.state),as=(e,t)=>{e.dispatch(e.state.tr.setMeta(ai,{setHandle:t}))},ad=(e,t)=>{e.dispatch(e.state.tr.setMeta(ai,{setDragging:t}))},ac=e=>{e.dispatch(e.state.tr.setMeta(ai,{reset:!0}))},au=(e,t)=>{if(!e.editable||!t.target||t.target.closest(".column-resize-handle"))return;let n=al(e);if(n.dragging)return;let r=function(e,t){var n;let r=e.posAtCoords({left:t.clientX,top:t.clientY});if(!r||-1===r.inside)return null;let o=e.domAtPos(r.inside);if(!o)return null;let i=o.node.childNodes[o.offset];if(!i)return null;let a=e.state.doc.resolve(r.inside);if((null===(n=a.nodeAfter)||void 0===n?void 0:n.type.name)!=="gridCell")return null;let{left:l,right:s}=i.getBoundingClientRect();if(t.clientX-l<=5){let t=e.state.doc.resolve(a.before(a.depth)),n=ap((0,oX.oc)(t),e=>e.pos===a.pos);return(null==n?void 0:n.pos)||null}return s-t.clientX<=5?a.pos:null}(e,t),o=n.getActiveHandleAbs(e.state);r!==o&&as(e,r)},ap=(e,t)=>{for(let n=0;n<e.length;n++)if(t(e[n])){if(0===n)return null;return e[n-1]||null}return null},am=(e,t)=>{let n=e.domAtPos(t),r=n.node.childNodes[n.offset];return r.offsetWidth},ah=(e,t)=>{let{node:n,offset:r}=e.domAtPos(t.start()),o=n.childNodes[r];do if(o&&o.classList&&o.classList.contains("node-gridLayout"))break;while(o=o.parentNode);return o};var ag=n(20437);let af=e=>{let{getPos:t,updateAttributes:n,editor:r,node:o}=e,i=r.state.doc.resolve(t()),a=(0,oX.oc)(i);(0,m.useEffect)(()=>{a.length!==o.attrs.colWidths.length&&setTimeout(()=>{n({colWidths:(0,tG.RS)(a.length)})},0)},[o,a,n])},ax=e=>{let{node:t,editor:n,getPos:r}=e,o=t.content.childCount,i=(0,v.CG)(eK.Pw),a=(0,e$.TZ)();af(e);let s=o%2==0,d=(0,r3.i)({base:1,sm:s?2:1,md:s?2:3,lg:4})||4,c=(0,m.useCallback)(()=>{n.commands.addLayoutCell(r())},[n,r]),u=o<i6.h&&i,p=a?"100%":(t.attrs.colWidths||[]).map(e=>"".concat(e,"%")).join(" ");return(0,l.jsx)(ed.lO,{...e,children:(0,l.jsxs)(ag.M,{className:(0,ew.cx)("grid-col-controls",i&&"is-editable"),columns:Math.min(d,o),gap:"var(--grid-border)",position:"relative",gridTemplateColumns:p,"data-selection-ring":!0,children:[(0,l.jsx)(el.ms,{className:"layout-content"}),(0,l.jsx)(eI.A,{...e,label:_.ag._({id:"Szg6OU"}),"data-testid":"layout-drag-handle"}),(0,l.jsx)(y.k,{position:"absolute",top:"0",h:"100%",align:"center",w:6,right:-3,className:"add-column",opacity:"0",transitionProperty:"opacity",transitionDuration:"normal",children:u&&(0,l.jsx)(C.kH,{label:(0,l.jsx)(M.cC,{id:"AgvHni"}),placement:"top",children:(0,l.jsx)(tb.h,{icon:(0,l.jsx)(N.G,{icon:te.r8p}),"aria-label":_.ag._({id:"AgvHni"}),position:"absolute",size:"xs",variant:"plain",isRound:!0,zIndex:"1",onClick:c})})})]})})},av=eo.NB.create({name:"gridLayout",content:"gridCell{1, ".concat(i6.h,"}"),group:"cardBlock",defining:!1,isolating:!0,selectable:!1,priority:tL.a.Layout,containerHandle:!0,parseHTML:()=>[{tag:"div[class=columns]"},{tag:"columns"}],renderHTML(e){let{HTMLAttributes:t}=e;return["div",(0,eo.P1)(t,{class:"columns"}),0]},renderHTMLforAI(e){let{node:t}=e;return["columns",{colWidths:JSON.stringify(t.attrs.colWidths)},0]},addAttributes(){let e="colWidths";return{colWidths:{default:[],parseHTML:t=>{let n=t.getAttribute("data-".concat(e));if(n)return JSON.parse(n);let r=0;
1return t.childNodes.forEach(e=>{"DIV"===e.nodeName&&r++}),(0,tG.RS)(r)},renderHTML:t=>{let n=t[e];return n?{["data-".concat(e)]:JSON.stringify(n)}:{}}},fullWidthBlock:{default:!1}}},addNodeView:()=>(0,el.fW)(ax,{update:es.I_,ignoreMutation:i0.j}),addProseMirrorPlugins(){return[ao(this.editor),function(){let e=new tR.Sy({key:ai,state:{init:()=>new aa,apply:(e,t,n,r)=>t.apply(e,r)},props:{attributes(e){let t=ai.getState(e),n=t.getActiveHandleAbs(e);return null!==n?{class:"resize-cursor"}:{class:""}},handleDOMEvents:{mousemove:(e,t)=>!!R.VH.get("layoutResizing")&&(au(e,t),!1),mouseleave:e=>!!R.VH.get("layoutResizing")&&(!function(e){let t=al(e),n=t.getActiveHandleAbs(e.state);null===n||t.dragging||as(e,null)}(e),!1),mousedown:(e,t)=>!!R.VH.get("layoutResizing")&&(!function(e,t){if(!e.editable)return;let n=al(e),r=n.getActiveHandleAbs(e.state);if(null===r||n.dragging)return;let o=e.state.doc.resolve(r),i=o.node(),a=[...i.attrs.colWidths],l=(0,oX.ug)(o),s=am(e,r),d=ah(e,o),c=d.offsetWidth;ad(e,{startX:t.clientX,startWidth:s,colWidths:a,tableWidth:c,colIndex:l});let u=null;function p(t){window.removeEventListener("mouseup",p),window.removeEventListener("mousemove",m);let n=al(e);if(n.dragging){if(null===u){ad(e,null);return}if(n.dragging)try{let t=n.getActiveHandleAbs(e.state);(function(e,t,n){let r=e.state.doc.resolve(t),o=r.before(),i=e.state.tr.setNodeMarkup(o,void 0,{colWidths:[...n]}).setMeta("annotationEvent",{type:"update-node-attrs",pos:o});e.dispatch(i),function(e,t){let n=e.state.doc.resolve(t),r=ah(e,n),o=r.querySelector(".grid-col-controls");o&&(o.style.gridTemplateColumns="")}(e,t)})(e,t,u),ad(e,null)}catch(t){ac(e)}u=null}}function m(t){if(!t.which)return p(t);let n=al(e),r=n.getActiveHandleAbs(e.state);if(!n.dragging||null===r)return;let{colIndex:o,colWidths:i}=n.dragging,a=function(e,t){let{tableWidth:n}=e,r=t.clientX-e.startX;return tW()(100*r/n,0)}(n.dragging,t);(function(e,t){let n=e.querySelector(".grid-col-controls");n&&(n.style.gridTemplateColumns=t.map(e=>"".concat(e,"%")).join(" "))})(d,u=(0,tG.GI)(i,o,a,15)),(0,tU.CI)(d)}window.addEventListener("mouseup",p),window.addEventListener("mousemove",m),t.preventDefault()}(e,t),!1)},decorations(e){let t=ai.getState(e),n=t.getActiveHandleAbs(e);if(null!==n){let t=[];try{let r=document.createElement("div");return r.className="column-resize-handle",t.push(tH.p.widget(n+1,r)),tH.EH.create(e.doc,t)}catch(e){return console.error("(caught) layoutResizing error: ".concat(e.message)),tH.EH.empty}}},nodeViews:{}}});return e}()]},addCommands(){var e=this;return{useLayoutPreset:(e,t)=>n=>{let{dispatch:r,tr:o,commands:i,view:a}=n;if(!r)return!0;let l=(0,oX.TH)(o.doc.resolve(e));if(!l)return!0;let s=(0,oX.oc)(l),d=t.length-s.length,c=[];for(;0!==d;){if(d<0){let t=(0,oX.Tl)(o.doc.resolve(e),-1),n=t.nodeAfter;o.deleteRange(t.pos,t.pos+n.nodeSize);let r=1===n.childCount&&(0,eo.bR)(n.firstChild)?[]:n.content.toJSON();c=[...r,...c],d++;continue}if(d>0){i.addLayoutCell(l.pos,!1),d--;continue}}o.setNodeAttribute(e,"colWidths",t);let u=(0,oX.Tl)(o.doc.resolve(l.pos),-1);if(!u||!u.nodeAfter)return!0;let p=u.pos+u.nodeAfter.nodeSize-1;if(i.insertContentAt(p,c,{updateSelection:!1}),o.selection.from>p||o.selection.to>p){let e=o.doc.resolve(u.pos+1).end(),t=(0,rG.E)(o.doc.resolve(e),-1);t&&o.setSelection(t)}let m=ah(a,l);return m&&(0,tU.CI)(m),!0},insertLayout:e=>t=>{let{dispatch:n,commands:r}=t;if(!n)return!0;let o=Array.from(Array(e),e=>ab);return r.insertContentAndSelect({type:"gridLayout",attrs:{colWidths:(0,tG.RS)(e)},content:o})},addLayoutCell:function(e){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1];return n=>{let{chain:r,state:o}=n,i=o.doc.nodeAt(e);if(!i||i.type.name!==av.name)return!1;let a=e+i.nodeSize-1,{colWidths:l}=i.attrs,s=l.length,d=tW()(100/(s+1),2),c=(0,tG.CO)(l,s,d,15),u=r().insertContentAt(a,ab,{updateSelection:!1});return t&&u.selectInsertedNode(),u.command(t=>{let{tr:n}=t;return n.setNodeAttribute(e,"colWidths",c),!0}).run(),!0}},handleLayoutDelete:function(t){let n=!(arguments.length>1)||void 0===arguments[1]||arguments[1];return r=>{let{tr:o,dispatch:i,state:a}=r;if(!i)return!0;let l=(0,eo.Kk)(e=>
1e.type.name===at.name)(a.selection),s=(0,eo.Kk)(e=>e.type.name===av.name)(a.selection);if(!l||!s)return!1;if(!n||(0,eW.$y)(l.node)){if(2==s.node.childCount){let t=l.node===s.node.child(0),n=t?s.node.child(1):s.node.child(0),r=t?s.start+s.node.child(0).nodeSize+1:s.start+1,i=r+n.content.size;o.replaceWith(s.pos,s.pos+s.node.nodeSize,n.content);let a=(0,rG.E)(o.doc.resolve(s.pos+(t?0:n.content.size)),t?1:-1);a&&o.setSelection(a);let d=(0,i1.nf)({insertPos:s.pos,contentPos:r,contentEnd:i,editor:e.editor});requestAnimationFrame(()=>{var t,n;null===(t=(n=e.editor.commands).moveAnnotations)||void 0===t||t.call(n,d)})}else{let e=o.doc.resolve(l.pos);(0,i7.D)(o,e,t),o.setNodeAttribute(s.pos,"colWidths",(0,tG.Z7)(s.node.attrs.colWidths,[(0,oX.ug)(e)]))}return!0}let{parent:d}=a.selection.$from;return!!(a.selection.empty&&d.isTextblock&&(0,eo.bR)(d))&&d==l.node.firstChild&&!t&&(o.deleteRange(a.selection.$from.before(),a.selection.$from.after()),!0)}},goToNextLayoutCell:e=>t=>{let{tr:n,state:r}=t,o=(0,eo.Kk)(e=>e.type.name===at.name||e.type.name===i9.name)(r.selection),i=(0,eo.Kk)(e=>e.type.name===av.name||e.type.name===i2.z.name)(r.selection);if(!o||!i)return!1;let a=r.doc.resolve(o.pos),l=e?a.index()+1:a.index()-1;if(l<0||l>=a.parent.childCount)return!1;let s=a.posAtIndex(l);return n.setSelection(tR.Y1.near(r.doc.resolve(s))),!0}}},addKeyboardShortcuts:()=>({Tab:e=>{let{editor:t}=e;return t.commands.goToNextLayoutCell(!0)},"Shift-Tab":e=>{let{editor:t}=e;return t.commands.goToNextLayoutCell(!1)}})}),ab={type:"gridCell",content:[{type:"paragraph"}]};var ay=n(50322),aC=n(72762),aw=n(73528),ak=n(99173),aj=n(44368),aS=n(82713);let aA=e=>{let{node:t,updateAttributes:n}=e,r=(0,v.CG)(eK.yx),o=(0,Q.py)("edit",r),{checked:i,fontSize:a,placeholder:s}=t.attrs;return(0,l.jsx)(i3.l,{...e,children:(0,l.jsxs)(eC.x,{as:"li",color:i?"var(--body-color-muted)":void 0,textDecoration:i?"line-through":void 0,transition:"color 250ms ease-out",position:"relative",className:"todo","data-font-size":a,children:[(0,l.jsx)(aS.X,{contentEditable:!1,suppressContentEditableWarning:!0,isChecked:i,onChange:e=>{o&&n({checked:e.target.checked})},position:"absolute"}),(0,l.jsx)(el.ms,{as:"span",className:"todo-content","data-placeholder":s||_.ag._({id:"M+qBZP"})})]})})},aI=/^\s*\[[ ]?\]\s$/,aE=/^\s*\[x\]\s$/,az=eo.NB.create({name:aj.W.Todo,addOptions:()=>({HTMLAttributes:{}}),content:"inline*",defining:!0,group:"block cardNotesBlock",selectable:!1,allowFontSizes:"body",addAttributes:()=>({indent:{default:0},checked:{default:!1},fontSize:{default:null}}),addNodeView:()=>(0,el.fW)(aA,{as:"ul",update:es.E7,updateWrapperEl:(e,t)=>{e.setAttribute("indent",t.node.attrs.indent)}}
1),addInputRules(){return[(0,aw.Bx)({find:aI,type:this.type,getAttributes:{checked:!1}},this.editor.state.schema),(0,aw.Bx)({find:aE,type:this.type,getAttributes:{checked:!0}},this.editor.state.schema)]},addKeyboardShortcuts:()=>({"Mod-,":e=>{let{editor:t}=e;return t.commands.setListItems({variant:aj.W.Todo})},"Mod-Shift-9":e=>{let{editor:t}=e;return t.commands.setListItems({variant:aj.W.Todo})}}),parseHTML(){return[{tag:'li[variant="'.concat(this.name,'"]')}]},renderHTML(e){let{HTMLAttributes:t}=e;return["li",(0,eo.P1)(this.options.HTMLAttributes,t,{variant:this.name}),0]}});var aT=n(78277);let aN=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"body";(0,m.useEffect)(()=>{let t;let n=document.querySelector(e);if(!n)return;let r=e=>{var r;0===e.target.scrollTop&&t>50&&(null===(r=document.activeElement)||void 0===r?void 0:r.tagName)==="IFRAME"?(console.debug("[EditorCore] Prevented scroll event from iframe",e,t,document.activeElement),n.scrollTo(0,t)):t=e.target.scrollTop};return n.addEventListener("scroll",r,{passive:!0}),()=>n.removeEventListener("scroll",r)},[e])};var aM=n(80759),a_=n(48697),aL=n(14063),aP=n(80236),aR=n(66855);let aH=eo.hj.create({name:"media",addExtensions:()=>[aP.z],addCommands:()=>({handleSpaceToZoom:()=>e=>{let{state:t}=e;if(t.selection instanceof tR.qv&&(0,aR.fP)(t.selection.node)){let e=(0,v.bh)(),{id:n}=t.selection.node.attrs;return!!(n&&(0,aL.v_)(n)(e.getState()))||(e.dispatch((0,eK.RW)({nodeId:t.selection.node.attrs.id})),!0)}return!1}})});var aD=n(94567),aO=n(41889),aB=n(38438),aF=n(5682),aW=n(39540);let aG=e=>{let{node:t,decorations:n,editor:r}=e,o=(0,e0.R)(n),i=(0,aW.v)(n),{horizontalAlign:a,fontSize:s,placeholder:d}=t.attrs,c=i&&o&&(!a||"left"===a)&&!(0,ni.$v)(r)&&!d;return(0,l.jsxs)(ed.lO,{...e,style:{position:"relative"},children:[(0,l.jsx)(el.ms,{"data-font-size":s,"data-multiline-placeholder":d,style:{textAlign:a}}),c&&(0,l.jsx)(aF.B,{...e})]})},aU=aB.Z.extend({name:"paragraph",group:"block cardNotesBlock",selectable:!1,addNodeView:()=>(0,el.fW)(aG,{update:es.E7}),allowFontSizes:"body",addAttributes:()=>({fontSize:{default:null}}),parseHTML:()=>[{tag:"p"}],renderHTML(e){let{HTMLAttributes:t}=e;return["p",(0,eo.P1)(t,{class:"paragraph"}),0]},renderHTMLforAI(e){let{HTMLAttributes:t}=e;return["p",{},0]}});var aV=n(54073),aq=n.n(aV);let a$=["paragraph","heading","title","bullet","numbered","todo","toggleSummary"],aK=eo.hj.create({name:"placeholderText",addGlobalAttributes:()=>[{types:a$,attributes:{placeholder:{default:null,keepOnSplit:!1,rendered:!1}}}],addCommands:()=>({removeFilledPlaceholders:()=>e=>{let{tr:t,dispatch:n}=e;return!n||(t.doc.descendants((e,n)=>{e.attrs.placeholder&&e.textContent&&(console.debug("Removing placeholder",e.attrs.placeholder,"at",n,"with content",e.textContent),t.setNodeAttribute(n,"placeholder",null))}),!0)}}),onUpdate(){aZ(this.editor)}}),aZ=aq()(e=>{e.isEditable&&e.commands.removeFilledPlaceholders()},100,{maxWait:1e3});var aY=n(59799),aX=n(91887),aJ=n(59080);let aQ=eo.hj.create({name:"TableCommands",addCommands:()=>({selectColumn:e=>t=>{let{tr:n,dispatch:r}=t;if(!r)return!0;let{doc:o}=n,i=o.resolve(e),a=aJ.Xc.colSelection(i);return n.setSelection(a),!0},selectRow:e=>t=>{let{tr:n,dispatch:r}=t;if(!r)return!0;let{doc:o}=n,i=o.resolve(e),a=aJ.Xc.rowSelection(i);return n.setSelection(a),!0},selectTable:e=>t=>{let{tr:n,dispatch:r}=t;if(!r)return!0;let{doc:o}=n,i=o.resolve(e),a=aJ.Xc.colSelection(i),l=aJ.Xc.rowSelection(a.$anchorCell,a.$headCell);return n.setSelection(l),!0}})}),a0=eo.NB.create({name:"tableCell",addOptions:()=>({HTMLAttributes:{}}),content:"(block | tableBlock)+",addAttributes:()=>({colspan:{default:1},rowspan:{default:1}}),tableRole:"cell",isolating:!0,selectable:!1,parseHTML:()=>[{tag:"td"},{tag:"th"}],renderHTML(e){let{HTMLAttributes:t}=e;return["td",(0,eo.P1)(this.options.HTMLAttributes,t),0]}}),a1=e=>(0,l.jsxs)(el.T5,{className:"table-row-wrapper",style:{display:"contents"},children:[(0,l.jsx)("th",{style:{position:"relative",padding:0},children:(0,l.jsx)(a2,{...e})}),(0,l.jsx)(el.ms,{as:"div",className:"table-row-content",style:{display:"contents"}})]}),a2=(0,m.memo)(e=>{let{...t}=e,{getPos:n,editor:r}=t;return(0,l.jsx)(y.k,{height:"100%",align:"center",contentEditable:!1,suppressContentEditableWarning:!0,children:(0,l.jsx)(eI.A,{...t,label:_.ag._({i
1d:"9c44h0"}),onClick:()=>{let e=n()+1;r.chain().focus().selectRow(e).run()},left:"-0.5em",top:"1em",zIndex:"3","data-testid":"table-row-control"})})});a2.displayName="RowControl";let a3=eo.NB.create({name:"tableRow",addOptions:()=>({HTMLAttributes:{}}),selectable:!1,content:"tableCell+",tableRole:"row",containerHandle:!0,addNodeView:()=>(0,el.fW)(a1,{update:es.E7,as:"tr"}),parseHTML:()=>[{tag:"tr"}],renderHTML(e){let{HTMLAttributes:t}=e;return["tr",(0,eo.P1)(this.options.HTMLAttributes,t),0]}});var a4=n(6776);let a5=a4.ZP.extend({name:"highlight",priority:tL.a.Highlight,excludes:"textColor highlight",addAttributes:()=>({variant:{},hex:{}}),addCommands(){var e;return{...null===(e=this.parent)||void 0===e?void 0:e.call(this),setHighlightColor:e=>t=>{let{commands:n}=t;return n.setMark(this.name,{hex:e,variant:null})},setHighlightVariant:e=>t=>{let{commands:n}=t;return n.setMark(this.name,{variant:e,hex:null})}}},parseHTML:()=>[{tag:"mark[class=highlight]"},{tag:"*[highlight]",getAttrs(e){let t=e.getAttribute("highlight");return!!t&&(eN.RJ.includes(t)?{variant:t}:{hex:t})},consuming:!1,priority:60}],renderHTML(e){let{HTMLAttributes:t,mark:n}=e,r=n.attrs.hex&&(0,ej.DP)(n.attrs.hex),o=["--highlight-color: ".concat(n.attrs.hex),"color: var(".concat(r?"--highlight-color-dark":"--highlight-color-light",")")].join("; ");return["mark",(0,eo.P1)(this.options.HTMLAttributes,t,{class:"highlight",style:o})]},renderHTMLforAI(e){var t;let{mark:n}=e;return["span",{color:null!==(t=n.attrs.hex)&&void 0!==t?t:n.attrs.variant}]}}).configure({multicolor:!0}),a8=eo.vc.create({name:"textColor",excludes:"highlight textColor",priority:tL.a.TextColor,addAttributes:()=>({variant:{},hex:{}}),addCommands(){return{setTextColorVariant:e=>t=>{let{commands:n}=t;return n.setMark(this.name,{hex:null,variant:e})},setTextColor:e=>t=>{let{commands:n}=t;return n.setMark(this.name,{hex:e,variant:null})}}},parseHTML:()=>[{tag:"span[class=textColor]"},{tag:"*[color]",getAttrs(e){if(["ASIDE"].includes(e.tagName))return!1;let t=e.getAttribute("color");return!!t&&(eN.RJ.includes(t)?{variant:t}:{hex:t})},consuming:!1,priority:60}],renderHTML(e){let{HTMLAttributes:t,mark:n}=e;return["span",(0,eo.P1)(t,{class:"textColor",style:n.attrs.hex?"--text-color: ".concat(n.attrs.hex):void 0})]},renderHTMLforAI(e){var t;let{mark:n}=e;return["span",{color:null!==(t=n.attrs.hex)&&void 0!==t?t:n.attrs.variant}]}});var a9=n(62198),a7=n(43298),a6=n(54999);let le=()=>new tR.Sy({key:new tR.H$("TogglePlugin"),props:{handlePaste(e,t,n){let{selection:r,tr:o}=e.state,i=(0,eo.Kk)(a6.O4)(r);if(!i)return!1;let a=null,l=null,s=[];if(n.content.descendants(e=>{e.isTextblock&&(a?s.push(e):(a=e.content,l=(0,a7.Aw)(e)||null))}),!a)return;l&&o.setNodeAttribute(i.pos,"fontSize",l),o.replaceSelection(rF.p2.maxOpen(a));let d=o.mapping.map(i.pos+i.node.nodeSize);o.replaceRange(d,d,rF.p2.maxOpen(rF.HY.fromArray(s)));let c=(0,rG.a)(o,-1);return c&&o.setSelection(c),e.dispatch(o),!0},decorations(e){let{doc:t}=e,n=[];return t.descendants((e,t,r)=>{if(!r||!(0,a6.O4)(e))return;let o=(0,eW.Jn)(r.content),i=o.slice(1).every(e=>(0,eW.bR)(e)),a=tH.p.node(t,t+e.nodeSize,{},{isToggleDecoration:!0,toggleId:r.attrs.id,isEmpty:i});n.push(a)}),tH.EH.create(t,n)}}}),lt=e=>{var t;return(null===(t=e.find(e=>e.spec.isToggleDecoration))||void 0===t?void 0:t.spec)||{}},ln="1.5em",lr=e=>{let{node:t,decorations:n}=e,{level:r,fontSize:o,placeholder:i}=t.attrs,{toggleId:a="",isEmpty:s}=lt(n),d=(0,v.CG)(eK.hN),c=(0,v.CG)(eK.Ql),u=(0,v.CG)((0,eK.R)(a))||c,p=(0,m.useCallback)(()=>{(0,a6.xB)(a,!u)},[a,u]);return(0,l.jsx)(ed.lO,{...e,hideComments:!u,children:(0,l.jsxs)(eC.x,{as:"div",position:"relative",onClick:d?void 0:p,cursor:d?void 0:"pointer",children:[(0,l.jsx)(I.z,{left:"calc(0.125em - ".concat(ln,")"),position:"absolute",variant:"ghost",colorScheme:"gray",color:s?"var(--body-color-muted)":"var(--body-color)",onClick:d?p:void 0,contentEditable:!1,onMouseDown:tp.br,fontSize:"1em",lineHeight:"inherit",height:"100%",px:2,ml:-2,minW:"unset","data-testid":"toggle-button",children:(0,l.jsx)(eC.x,{transform:"rotate(".concat(u?90:0,"deg)"),transformOrigin:"center",transitionProperty:"transform",transitionDuration:"normal",fontSize:"0.75em",children:(0,l.jsx)(N.G,{icon:iT.zc})})}
1),(0,l.jsx)(el.ms,{level:r,"data-placeholder":i||_.ag._({id:"JFciKP"}),"data-font-size":o,className:(0,ew.cx)((0,a7.qx)(o)&&ek.A8)})]})})},lo=eo.NB.create({name:"toggleSummary",content:"inline*",selectable:!1,marks:"bold italic underline code footnoteLabel strike textColor highlight",allowFontSizes:"heading body",addAttributes:()=>({fontSize:{default:null}}),addNodeView:()=>(0,el.fW)(lr,{update:es.E7}),renderHTML(e){let{HTMLAttributes:t}=e;return["summary",t,0]},parseHTML:()=>[{tag:"summary"}]}),li=e=>{let{node:t}=e,n=(0,v.CG)(eK.Ql),r=(0,v.CG)((0,eK.R)(t.attrs.id))||n;return(0,l.jsx)(ed.lO,{...e,hideComments:r,readOnly:!r,children:(0,l.jsxs)(s.xu,{pl:ln,position:"relative","data-open":!!r,className:"toggle",borderRadius:"var(--box-border-radius)","data-selection-ring":"padded",children:[(0,l.jsx)(el.ms,{}),r&&(0,l.jsx)(s.xu,{position:"absolute",left:"0.375em",bottom:"0.25em",top:"2.5em",borderLeft:"1px solid",borderColor:"var(--box-border-color)"})]})})};var la=n(50177);let ll=/^\s*([+])\s$/,ls=eo.NB.create({name:"toggle",group:"layoutBlock calloutBlock cardBlock smartLayoutBlock tableBlock",content:"toggleSummary (block | layoutBlock)+",selectable:!1,isolating:!0,priority:tL.a.Toggle,expandable:!0,addNodeView:()=>(0,el.fW)(li,{update:es.E7}),addProseMirrorPlugins:()=>[le()],addAttributes:()=>({id:(0,nO.b)(la.C)}),addInputRules(){var e;return[(e={find:ll,innerType:this.editor.schema.nodes.toggleSummary,outerType:this.type,getInnerAttributes:e=>{let t=(0,a7.Aw)(e);return{fontSize:t}},getOuterAttributes:()=>{let e=(0,la.C)();return(0,a6.xB)(e,!0),{id:e}}},new eo.VK({find:e.find,handler:t=>{let{state:n,range:r,match:o}=t,i=n.doc.resolve(r.from);if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),e.outerType))return;let a=(0,eo.nU)(e.getOuterAttributes,void 0,i.parent)||{},l=(0,eo.nU)(e.getInnerAttributes,void 0,i.parent)||{},s=n.tr.delete(r.from,r.to),d=s.doc.resolve(r.from),c=d.parent,u=e.outerType.createAndFill(a,[e.innerType.create(l,c.content)]);s.replaceWith(d.before(),d.after(),u);let p=(0,rG.E)(s.doc.resolve(r.from));p&&s.setSelection(p)}}))]},addCommands(){var e=this;return{unwrapToggle:()=>e=>{let{state:t,editor:n,tr:r}=e;if(!n.isActive("toggleSummary"))return!1;let{selection:o,schema:i}=t,a=(0,eo.Kk)(a6.AH)(o);if(!a||a.start+1!==o.from||!o.empty)return!1;let l=(0,eW.Jn)(a.node.content),s=l[0],{type:d,level:c}=(0,a7.hx)(s.attrs.fontSize),u="heading"===d?i.nodes.heading.create({level:c},s.content):i.nodes.paragraph.create({fontSize:s.attrs.fontSize},s.content),p=[u].concat(l.slice(1));r.replaceWith(a.pos,a.pos+a.node.nodeSize,rF.HY.from(p)).setMeta("annotationEvent",{type:"unwrap-node",pos:a.pos});let m=r.doc.resolve(a.pos),h=(0,J.t)(m);return h&&r.setSelection(h),!0},joinBackwardInToggle:()=>e=>{let{state:t,editor:n,chain:r}=e;if(n.isActive("toggleSummary"))return!1;let{selection:o}=t,i=(0,eo.Kk)(a6.AH)(o);if(!i)return!1;let a=(0,eW.Jn)(i.node.content),l=a.slice(1);return!!o.empty&&0===o.$from.parentOffset&&1===l.length&&(r().command(e=>{let{tr:t}=e,r=t.doc.resolve(i.pos+1).end();return t.insert(r,n.schema.nodes.paragraph.create()),!0}).joinBackward(),!0)},wrapWithToggle:function(t){let n=!(arguments.length>1)||void 0===arguments[1]||arguments[1];return r=>{let o,{state:i,tr:a}=r,{doc:l,selection:s,schema:d}=i,c=s.$from.blockRange(s.$to);if(!c)return!1;let u=[];l.nodesBetween(s.from,s.to,(e,t,n)=>{if(n===c.parent)return u.push(e),!1});let p=[];if(!t&&u[0].isTextblock&&u[0].textContent.length<100){let e=(0,a7.Aw)(u[0]);o=d.nodes.toggleSummary.create({fontSize:e},u[0].content),p=u.slice(1)}else{let e=t?d.text(t):null;o=d.nodes.toggleSummary.create(null,e),p=u}let m=(0,la.C)();n&&(0,a6.xB)(m,!0);let h=e.editor.schema.nodes.toggle.createAndFill({id:m},rF.HY.fromArray([o,...p]));if(!h)return!1;let{start:g,end:f}=c;a.replaceRangeWith(g,f,h).setMeta("annotationEvent",{type:"wrap-nodes",start:g,end:f,level:1});let x=(0,J.G)(a);if(!x)return!1;let v=(0,J.t)(x,-1);return v&&a.setSelection(v),!0}},enterInToggle:()=>e=>{let{editor:t,state:n,chain:r}=e;if(!t.isActive("toggle"))return!1;let o=(0,eo.Kk)(a6.AH)(n.selection);if(!o||(0,a6.fH)(o.node.attrs.id))return!1;let{selection:i}=t.state,{$from:a}=i,l=a.parentOffset===a.parent.nodeSize-2;if(l){let e=o.pos+o.node.nodeSize;return r().insertContentAt(e,{type:"paragraph"}).selectInsertedNode().run(),!0}return(0,a6.xB)(o.node.attrs.id,!0),!0}}},addKeyboardShortcuts:()=>({Enter:e=>{let{editor:t}=e;
1return t.commands.enterInToggle()},Backspace:e=>{let{editor:t}=e;return t.commands.first(e=>{let{commands:t}=e;return[()=>t.unwrapToggle(),()=>t.joinBackwardInToggle()]})}}),addExtensions:()=>[la.w,lo],renderHTML(e){let{HTMLAttributes:t}=e;return["details",t,0]},parseHTML:()=>[{tag:"details"}]});var ld=n(39475);let lc=ld.Z;var lu=n(36909),lp=n(17132),lm=n(31638),lh=n(87428),lg=n(44438),lf=n(28165),lx=n(12483);class lv extends m.Component{static getDerivedStateFromError(e){return{hasError:!0,errMessage:e.message}}componentDidCatch(e,t){this.errorEventId=lx.Tb(e,{extra:{info:null==t?void 0:t.componentStack}})}render(){return this.state.hasError?(0,l.jsx)(ly,{errMessage:this.state.errMessage,errorId:this.errorEventId,isInsideDrawer:this.props.isInsideDrawer}):this.props.children}constructor(e){super(e),this.errorEventId=null,this.state={hasError:!1,errMessage:""}}}let lb=["collaborative-editor-wrapper","public-static-editor-wrapper-inner","example-static-editor-wrapper-inner","custom-theme-tabs","custom-theme-tab-panels","custom-theme-preview-editor"].map(e=>'[data-testid="'.concat(e,'"]')).join(", "),ly=e=>{let{errMessage:t,errorId:n,isInsideDrawer:r=!1}=e;return(0,l.jsxs)(y.k,{minH:"100%",direction:"column","data-editor-error-component":!0,align:"center",children:[(0,l.jsx)(lf.xB,{styles:{[lb]:{height:"100%"},html:{height:"100%"},body:{height:"100%"}}}),(0,l.jsxs)(A.K,{flex:1,align:"center",justify:"center",p:6,spacing:r?[4,4,4,6]:[6,10,12],w:r?["100%","100%","100%","container.sm","container.md"]:["100%","100%","container.md"],children:[(0,l.jsxs)(A.K,{textAlign:"center",children:[(0,l.jsx)(eC.x,{fontSize:r?["xl","xl","2xl"]:["xl","2xl","3xl"],fontWeight:"600",fontFamily:"p22-mackinac-pro, sans-serif",children:(0,l.jsx)(M.cC,{id:"gtI5JW"})}),!r&&(0,l.jsx)(eC.x,{fontSize:"lg",children:(0,l.jsx)(M.cC,{id:"9QTtU0"})})]}),(0,l.jsx)(e6.E,{src:"https://cdn.gamma.app/zc87vhr30n8uf3n/b4b04402416f4ec8b5c1dc24f4c2a3d6/optimized/Sal-Spaceship-Riding.png",px:r?[4,4,4,8]:[6,6,10],maxW:r?"min(80%, 22rem)":"min(100%, 24rem)"}),t&&(0,l.jsxs)(lg.E,{py:1,px:12,children:[t,n&&(0,l.jsx)(M.cC,{id:"sS1P4/",values:{errorId:n}
1,components:{0:(0,l.jsx)("br",{})}})]}),(0,l.jsxs)(A.K,{spacing:4,children:[!r&&(0,l.jsx)(I.z,{alignSelf:"center",variant:"solid",size:["md","md","lg"],onClick:()=>{window.location.reload()},children:(0,l.jsx)(M.cC,{id:"C6f2hU"})}),(0,l.jsx)(eC.x,{size:"sm",textAlign:"center",children:(0,l.jsx)(M.cC,{id:"E4kJGH"})})]})]})]})};var lC=n(64110);let lw=function(){let{isInnerEditor:e=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return[oq,o$,oZ.x,eR.Zb,eO.o4.configure({enabled:!g.v.GAMMA_PUPPETEER_SERVICE}),eH.K9,eD.B,tQ,t_,ng,lu._,u.x,i$.U,ay.r.configure({openOnClick:!1}),r0,oN.Z,eg,iJ,lc,c.Re,aw.aV,aC.g,ak.k,az,a9.D,iK.X6,aU,eu,eP,rJ.d,or.Kq,a5,ef.z,eb,a8,ic.Bf,aK,aX.i.extend({resizable:!0,allowTableNodeSelection:!0}),a3,a0,aQ,rB,aH,eX.om,a_.Ee,aD.nk,aT.cx,il,ou,aM.r,n_.cB,n_.nk,n_.s6,t5.Hy,ov,av,at,i2.z,i9,iV,iW,r9,nH,ls,is,e0._,er.l,id,rY,aO.d,o3,d.f,aY.U,iQ.$m.configure({addSelectionKeyMaps:!e}),iQ.$7]},lk=e=>new Promise(t=>{setTimeout(()=>{requestAnimationFrame(()=>{let n=e.state.doc.resolve(1),r=(0,J.t)(n);r&&e.commands.command(e=>{let{tr:t}=e;return t.setSelection(r),!0}),t()})})}),lj=function(e){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1],n=(0,b.As)("editor"),r=(0,v.CG)(t=>{let n=(0,eK.gh)(t),r=(0,eK.i2)(t);return n===nk.q.SLIDE_VIEW&&r?(0,eR.U8)(r):e});(0,m.useEffect)(()=>{t&&r&&n.setScrollSelector(r)},[t,n,r])},lS=e=>{let{onCreate:t=()=>{},extensions:n=[],readOnly:r=!0,shouldSupportComments:o=!1,shouldSupportMenus:i=!1,initialContent:a,doc:d,docId:c,isStatic:u=!1,animationsEnabled:b=!0,scrollingParentSelector:y,theme:C,editorId:w}=e,k=(0,Q.py)("edit",d),j=(null==d?void 0:d.organization)&&d.organization.id,[S]=(0,m.useState)(i),[A,I]=(0,m.useState)(!1),E=(0,h.I0)(),z=(0,v.CG)(eK.Pw),T=(0,m.useMemo)(()=>lw(),[]),N=(0,p.J)(),M=(0,x.y)("debugLogging"),_=!!(null==d?void 0:d.site),{setEditorRendered:L,onEditorUnload:P}=(0,lh.O)(w);aN(y),lj(y,!u);let R=(0,el.jE)({async onCreate(e){let{editor:t}=e;console.debug("[EditorCore][onCreate] TipTap editor is now ready"),(0,lC.w)(t,E),I(!0)},onUpdate(e){var t,n;let{editor:r}=e;null===(t=oZ.S.getState(r.state))||void 0===t||t.processChanges(E),null===(n=eO.Z8.getState(r.state))||void 0===n||n.processChanges(E)},onSelectionUpdate(e){let{editor:t}=e;console.debug("[EditorCore][onSelectionUpdate] selection updated",t.state.selection.from,t.state.selection.to,t.state.selection)},onDestroy(){M&&console.warn("[EditorCore][onDestroy] This should only happen on page navigation."),P(),E((0,eK.mc)()),E((0,f.NK)())},extensions:T.concat(n),content:a,editable:!1}),H=!!(R&&A);return((0,m.useEffect)(()=>{C&&E((0,eK.Dc)({theme:C}))},[C,E]),(0,ee.vm)(()=>{R&&H&&lk(R).then(()=>{console.debug("[EditorCore][fullyReady] Menus initialized & focused at start - fully ready"),t({editor:R}),requestAnimationFrame(()=>{requestIdleCallback(()=>{L()})})})},[R,H,t,L],[H]),(0,m.useEffect)(()=>{d&&E((0,eK.pl)({doc:d}))},[d,E]),(0,m.useEffect)(()=>{E((0,eK.tp)({isStatic:u})),R.isStatic=u},[R,u,E]),(0,m.useEffect)(()=>{E((0,eK.Nr)({animationsEnabled:b&&!1===N}))},[b,N,E]),(0,m.useEffect)(()=>{E((0,eK.QU)({commentsEnabled:o}))},[o,E]),(0,m.useEffect)(()=>{if(R)return g.v.DEBUG_ENABLED&&void 0===window.gammaEditorCore&&(window.gammaEditorCore=R),R.gammaOrgId=j,R.gammaDocId=c,R.editorId=w,R.multipageEnabled=_,()=>{delete window.gammaEditorCore}},[R,c,j,w,_]),(0,m.useEffect)(()=>{R&&E((0,eK.iS)({isAllowedToEdit:k&&!r}))},[R,E,r,k]),(0,m.useEffect)(()=>{R&&H&&requestAnimationFrame(()=>{R.setOptions({editable:z})})},[R,E,z,H,L]),(0,e$.Yk)(R),(0,e$.p2)(R),(0,e$.f3)(R,z),(0,e$.vE)(R),R&&A)?(0,l.jsx)(lm.O,{value:w,children:(0,l.jsxs)(s.xu,{id:"editor-core-root",className:"editor-core-root","data-testid":"editor-core-root",width:"100%",position:"relative",sx:iL.I,children:[(0,l.jsx)(el.kg,{editor:R,style:{width:"100%",height:"100%"},"data-testid":"tiptap-react-root-wrapper",className:"highlight-mask"}),S&&(0,l.jsx)(lp.a,{editorId:w,children:(0,l.jsx)(lI,{editor:R,scrollingParentSelector:y})})]})}):(0,l.jsx)(l.Fragment,{})},lA=e=>{let{isInsideDrawer:t,...n}=e;return(0,l.jsx)(lv,{isInsideDrawer:t,children:(0,l.jsx)(lS,{...n})})},lI=(0,m.memo)(e=>{let{editor:t,scrollingParentSelector:n}=e;return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(en.u,{editor:t,scrollingParentSelector:n}),(0,l.jsx)(X,{editor:t}),(0,l.jsx)(et.Y,{editor:t})]})})},64110:function(e,t,n){"use strict";n.d(t,{w:function(){return a}});var r=n(52332),o=n(30870),i=n(65878);let a=(e,t)=>{var n,a;null===(n=i.S.getState(e.state))||void 0===n||n.compute(e.state.doc).processChanges(t),null===(a=o.Z8.getState(e.state))||void 0===a||a.compute(e.state).processChanges(t),e.commands.command(()=>((0,r.E0)(e.state.doc,t),!0))}},42703:function(e,t,n){"use strict";n.d(t,{f:function(){return d}});var r=n(52322),o=n(2784),i=n(90507),a=n(80301),l=n(25198);class s extends o.Component{componentDidMount(){this.mounted=!0}componentWillUnmount(){this.mounted=!1}init(){let{editor:e}=this.props;if(!e)return;let{doc:t}=e.state;e.contentComponent=this,e.createNodeViews(),this.RootComponent=(0,r.jsx)(c,{editor:e,node:t})}setRenderer(e,t){this.renderers.set(e,t),this.mounted&&this.setState({counter:this.state.counter+1})}removeRenderer(e){this.renderers.delete(e),this.mounted&&this.setState({counter:this.state.counter+1})}render(){let{editor:e}=this.props;return e?(0,r.jsx)("div",{className:"ProseMirror",children:this.RootComponent}):null}constructor(e){super(e),this.RootComponent=null,this.renderers=new Map,this.mounted=!1,this.editorContentRef=o.createRef(),this.editorContentChildren=o.createRef(),this.state={counter:0},this.init()}}let d=o.memo(s),c=e=>{let{node:t,editor:n}=e;return(0,r.jsx)(a.j.Provider,{value:{editor:n,node:t},children:(0,r.jsx)(i.T5,{children:(0,r.jsx)(l.m,{})})})}},25198:function(e,t,n){"use strict";n.d(t,{m:function(){return f}});var r=n(52322),o=n(73200),i=n(72338),a=n(30764),l=n(2784),s=n(80301),d=n(11093),c=n(91073);let u=e=>{let t={};for(let n of e.attributes){let e=n.name;"class"===e?t.className=n.value:"contenteditable"===e&&"false"===n.value||(t[e]=n.value)}return t},p=(e,t,n,o)=>{let i=Array.from(n.contentComponent.renderers.values()).find(t=>t.props.node===e);if(i){let e=i.element.nodeName.toLowerCase()||"div",{style:n,...a}=u(i.element);return(0,r.jsx)(e,{"data-pos":t,...a,STYLE:"white-space: inherit;".concat(n),children:(0,r.jsx)(i.component,{...i.props,children:o})},i.id)}return null},m=e=>{var t;return null!==(t=e.config.renderHTMLforSSR)&&void 0!==t?t:e.config.renderHTML},h=e=>{let t={...e};return(null==t?void 0:t.style)&&(t.STYLE=t.style,delete t.style),(null==t?void 0:t.class)&&(t.className=t.class,delete t.class),(null==t?void 0:t.colspan)&&(t.colSpan=t.colspan,delete t.colspan),(null==t?void 0:t.rowspan)&&(t.rowSpan=t.rowspan,delete t.rowspan),t},g=(e,t)=>{var n;let r=(0,d.j0)(e,t.type);if(!r)return[];let o=e.extensionManager.attributes.filter(e=>e.type===t.type.name),a=(0,i.m7)(t,o),l=r;
1for(;!m(l)&&l.parent;)l=l.parent;let s=null===(n=m(l))||void 0===n?void 0:n.bind(r);if(!s)return[];let c=s({HTMLAttributes:a,node:t,mark:t,editor:e}),[u,p,g]=c,f=h(p);return[u,f,g]},f=l.memo(e=>{let{node:t,editor:n,getPos:i}=(0,s.a)();if(!t||!n)return null;let d=e.as||"div",u=t.isInline||t instanceof a.vc?"span":"div",m=[],h="function"==typeof i?i():null,f=(e,t,i)=>{let a=(null===h?0:h)+t+1,s=p(e,a,n);if(s)return s;let d=t=>Array.from(e.marks).reverse().reduce((e,t)=>{let r=p(t,a,n,e);if(r)return r;let[o,s,d]=g(n,t)||[];return o?l.createElement(o,{key:i,...s},e):e},t),u=null===h?[]:(0,c.su)(n,a),[m,x,v]=g(n,e);if(m&&x){let n=null;if(0===v&&e.firstChild){let r=[];e.forEach((e,n,o)=>{r.push(f(e,t+n,"".concat(i,"_").concat(o)))}),n=r,console.debug("[SSR NodeViewContent] HOLE",r)}else Array.isArray(v)?(console.debug("[SSR NodeViewContent] children array",v),n=[...v]):v&&(console.debug("[SSR NodeViewContent] children plain",v),n=v);let{nodeName:r,...s}=u.map(e=>{var t;return null===(t=e.type)||void 0===t?void 0:t.attrs}).reduce((e,t)=>({...e,...t}),{}),c={...x,...s,className:(0,o.cx)(s.class,x.class),"data-pos":a};delete c.class,console.debug("[SSR NodeViewContent] non-nodeview:",i,c,v);let p=l.createElement(m,{key:i,...c},n);return d(p)}return e.isText?d((0,r.jsx)(l.Fragment,{children:e.textContent},i)):null};return t.forEach((e,n)=>{let r=m.length+1,o=f(e,n,"".concat(r));o?m.push(o):console.warn("%c [Simple NodeViewContent] UNKNOWN NODE $$$$$$$$$$$$$$$$$$$$$$$$$","background-color: aqua; font-weight: bold",{unknownNode:e,parentNode:t})}),(0,r.jsx)(d,{...e,"data-node-view-content":"",style:{whiteSpace:"pre-wrap",...e.style},children:(0,r.jsx)(u,{"data-node-view-content-inner":t.type.name,style:{whiteSpace:"inherit"},children:0===m.length?null:1===m.length?m[0]:m})})});f.displayName="NodeViewContent"},97563:function(e,t,n){"use strict";n.d(t,{f:function(){return a}});var r=n(42111),o=n(76919);class i extends o.v{initialize(){this.on("cardViewed",e=>{let{cardId:t,interval:n}=e;this.viewedCards[t]=this.viewedCards[t]||0,this.viewedCards[t]+=n});let e=()=>{var e;this.cardViewedThreshold=null!==(e=r.VH.get("cardViewedThreshold"))&&void 0!==e?e:5e3};r.VH.subscribe("cardViewedThreshold",e),e()}flush(){let e={};for(let t in this.viewedCards){let n=this.viewedCards[t];n&&!(n<this.cardViewedThreshold)&&(e[t]=Math.floor(n/1e3))}this.emit("flush",{viewed:e}),this.viewedCards={}}destroy(){this.flush(),this.off("cardViewed"),this.off("flush")}constructor(...e){super(...e),this.viewedCards={},this.cardViewedThreshold=r.VH.get("cardViewedThreshold")}}let a=new i},4471:function(e,t,n){"use strict";n.d(t,{UO:function(){return E},pP:function(){return N},zm:function(){return T},xr:function(){return z}});var r=n(82655),o=n(42946),i=n(54933),a=n(87254),l=n(829),s=n.n(l),d=n(87622),c=n.n(d),u=n(42111),p=n(9726),m=n(57574);let h=[{key:"autoComplete",name:()=>a.ag._({id:"ZyVTQp"}),shortcut:m.o,nodeName:"paragraph",icon:i.ddb,keywords:["continue","autocomplete","typeahead","complete","continue","ai"],execute:e=>{e.commands.autoComplete()},featureFlag:"aiAutocomplete",creditType:"autocomplete"}];var g=n(98081),f=n(57670),x=n(96693),v=n(3452),b=n(44368),y=n(50593),C=n(13988),w=n(62198),k=n(93565),j=n(50177),S=n(54999);let A=[{key:"toggle",name:()=>a.ag._({id:"JFciKP"}),description:()=>a.ag._({id:"Woijyj"}),keywords:["toggle","expand","collapse","disclosure","details"],nodeName:"toggle",icon:r.zc,execute:e=>{let t=(0,j.C)();(0,S.xB)(t,!0),e.chain().insertContent({...p.e.toggle,attrs:{id:t}}).selectInsertedNode().run()},dragStartFn:e=>{let t=(0,j.C)();(0,S.xB)(t,!0),(0,k.U)(e,{...p.e.toggle,attrs:{id:t}})}}];var I=n(11093);let E=[{key:"insertCardAfter",name:()=>a.ag._({id:"coNSGP"}),nodeName:"card",icon:r.Mp0,execute:e=>e.commands.insertCardAfter(),checkDisabled:e=>!e.schema.nodes.card,keywords:["card","below","after","new"]},{key:"aiCardAfter",name:()=>a.ag._({id:"yk2NpI"}),nodeName:"card",icon:i.ddb,execute:e=>e.commands.insertCardAfter(p.e.aiCardAfter),checkDisabled:e=>!e.schema.nodes.card,keywords:["card","below","after","new"],featureFlag:"addCard2"},{key:"insertCardInside",name:()=>a.ag._({id:"lOmsEK"}),nodeName:"card",icon:r.uFC,execute:e=>e.commands.insertNestedCard(),checkDisabled:e=>!e.schema.nodes.card,keywords:["nested","card","sub"]},{key:"splitCard",name:()=>a.ag._({id:"ONXbeB"}),nodeName:"card",icon:r.C5L,shortcut:"***",execute:e=>e.commands.splitCardAtSelection(),checkDisabled:e=>!e.schema.nodes.card,dragStartFn:e=>{(0,k.U)(e,p.e.normalText)},dragEndFn:e=>{e.chain().splitCardAtSelection().focusDelayed().run()},keywords:["split"]},{key:"title",name:()=>a.ag._({id:"MHrjPM"}),nodeName:"title",icon:o.K5C,shortcut:"/title",execute:e=>{e.chain().focus().setNode(w.D.name,{level:w.Y.DocTitle}).run()},keywords:["title","big"]},{key:"h1",name:()=>a.ag._({id:"lXKZGw"}),nodeName:"heading",icon:r.kVJ,shortcut:"# Heading 1",execute:e=>{e.chain().focus().setHeading({level:1}).run()},keywords:["heading","h1"]},{key:"smallText",name:()=>a.ag._({id:"LBkaLa"}),nodeName:"paragraph",icon:o.K5C,shortcut:"/sm",execute:e=>{e.chain().focus().setFontSize("sm").run()},keywords:["sm","small","paragraph"]},{key:"normalText",name:()=>a.ag._({id:"5NwZ8t"}),nodeName:"paragraph",icon:r.K5C,shortcut:"/md",execute:e=>{e.chain().focus().setFontSize("md").run()},keywords:["md","normal","paragraph","default","body"]},{key:"largeText",name:()=>a.ag._({id:"0Sz17G"}),nodeName:"paragraph",icon:r.K5C,shortcut:"/lg",execute:e=>{e.chain().focus().setFontSize("lg").run()},keywords:["lg","large","paragraph"]},{key:"h2",name:()=>a.ag._({id:"El7NbA"}),nodeName:"heading",icon:r.ejo,shortcut:"## Heading 2",execute:e=>{e.chain().focus().setHeading({level:2}).run()},keywords:["heading","h2"]}
1,{key:"h3",name:()=>a.ag._({id:"SFN6dN"}),nodeName:"heading",icon:r.WTH,shortcut:"### Heading 3",execute:e=>{e.chain().focus().setHeading({level:3}).run()},keywords:["heading","h3"]},{key:"h4",name:()=>a.ag._({id:"nJeKmw"}),nodeName:"heading",icon:r.qv8,shortcut:"#### Heading 4",execute:e=>{e.chain().focus().setHeading({level:4}).run()},keywords:["heading","h4"]},{key:"openEmojiPicker",name:()=>a.ag._({id:"tKlWWY"}),nodeName:"emoji",icon:o.pkM,execute:e=>e.commands.openEmojiPicker(),keywords:["icon","symbol","emoji"]},{key:"bulletedList",name:()=>a.ag._({id:"ynb7Kh"}),nodeName:b.W.Bullet,icon:r.gf$,shortcut:"- Item",execute:e=>{e.chain().setListItems({variant:b.W.Bullet}).selectInsertedNode().run()},keywords:["bullets","unordered","ul","list"]},{key:"numberedList",name:()=>a.ag._({id:"M3G9ZD"}),nodeName:b.W.Numbered,icon:r.nFo,shortcut:"1. Item",execute:e=>{e.chain().setListItems({variant:b.W.Numbered}).selectInsertedNode().run()},keywords:["numbers","numbered","ordered","ol","list"]},{key:"todoList",name:()=>a.ag._({id:"rCIbrq"}),nodeName:b.W.Todo,icon:r.A8,shortcut:"[] Item",execute:e=>{e.chain().setListItems({variant:b.W.Todo}).selectInsertedNode().run()},keywords:["todo","task","checkbox","list","checklist"]},{key:"blockquote",name:()=>a.ag._({id:"OLMhPm"}),nodeName:"blockquote",icon:r.vV6,shortcut:"> Quote",execute:e=>e.chain().focus().toggleBlockquote().run(),keywords:["quote","blockquote"]},...(0,g.Di)(),{key:"buttonGroup",name:()=>a.ag._({id:"hxBFty"}),nodeName:"buttonGroup",icon:r.duH,execute:e=>e.commands.insertContentAndSelect(p.e.buttonGroup),description:()=>a.ag._({id:"IvDo5O"}),keywords:["button","link","click","call to action"]},{key:"codeBlock",name:()=>a.ag._({id:"4A3Yzu"}),nodeName:"codeBlock",icon:r.dT$,shortcut:"```",execute:e=>{e.chain().focus().setCodeBlock().run()},keywords:["code","block","codeblock"]},{key:"mathBlock",name:()=>a.ag._({id:"TI6GY9"}),nodeName:"math_display",featureFlag:"math",icon:r.xFR,keywords:["math","equation","latex","katex"],execute:e=>e.chain().focus().insertContent(p.e.mathBlock).run(),dragEndFn:()=>{},description:()=>a.ag._({id:"mBJFYh"})},{key:"mathInline",name:()=>a.ag._({id:"qc9cD+"}),featureFlag:"math",nodeName:"math_inline",icon:r.eDD,keywords:["math","equation","latex","katex"],execute:e=>e.chain().focus().insertMathInline().run(),shortcut:"$x^2$ "},{key:"table2",name:()=>a.ag._({id:"3gSgpL"}),keywords:["table","grid","data"],nodeName:"table",shortcut:"/table",icon:r.B3e,execute:e=>e.commands.insertTable({rows:2,cols:2,withHeaderRow:!1})},{key:"table3",name:()=>a.ag._({id:"ZjN50+"}),keywords:["table","grid","data"],nodeName:"table",icon:r.B3e,execute:e=>e.commands.insertTable({rows:3,cols:3,withHeaderRow:!1})},{key:"table4",name:()=>a.ag._({id:"64S2d0"}),keywords:["table","grid","data"],nodeName:"table",icon:r.B3e,execute:e=>e.commands.insertTable({rows:4,cols:4,withHeaderRow:!1})},{key:"chart",name:()=>a.ag._({id:"nuBbBr"}),featureFlag:"enableCharts",keywords:["chart","data","graph"],nodeName:"chart",icon:r.B3e,execute:e=>e.commands.insertChart()},{key:"columns2",name:()=>a.ag._({id:"vVJ2/D"}),keywords:["columns","layout","grid","two"],nodeName:"gridLayout",shortcut:"/columns",icon:r.blG,execute:e=>e.commands.insertLayout(2)},{key:"columns3",name:()=>a.ag._({id:"OnuuaA"}),keywords:["columns","layout","grid","three"],nodeName:"gridLayout",icon:r.blG,execute:e=>e.commands.insertLayout(3)},{key:"columns4",name:()=>a.ag._({id:"hexbw8"}),keywords:["columns","layout","grid","four"],nodeName:"gridLayout",icon:r.blG,execute:e=>e.commands.insertLayout(4)},{key:"contributors",name:()=>a.ag._({id:"YqsXfH"}),nodeName:"contributors",icon:r.V3X,execute:e=>e.commands.insertContentAndSelect(p.e.contributors),keywords:["contributors","authors","credits"]},{key:"divider",name:()=>a.ag._({id:"R8AthW"}),nodeName:"divider",icon:r.ZC5,keywords:["hr","rule","line","divider"],shortcut:"---",execute:e=>e.commands.insertContentAndSelect(p.e.divider)},{key:"tableOfContents",name:()=>a.ag._({id:"9FTolD"}),featureFlag:"tableOfContentsBlock",nodeName:"tableOfContents",icon:r.Ljc,execute:e=>e.commands.insertContentAndSelect(p.e.tableOfContents,-1),keywords:["toc","contents"]},{key:"gallery",name:()=>a.ag._({id:"U+kFad"}),description:()=>a.ag._({id:"GqdREM"}),nodeName:"gallery",shortcut:"/gallery",icon:r.emM,keywords:["gallery","image","layout","filmstrip","carousel"],execute:e=>e.commands.insertContentAndSelect(p.e.gallery)},{key:"footnote",name:()=>a.ag._({id:"dOxPd4"}),nodeName:"footnote",shortcut:"^note^",icon:r.dkK,execute:e=>{let t=(0,x.H)(),n={...p.e.footnote,attrs:{noteId:t}};(0,x.t0)(t,!0),e.commands.insertContent(n)},dragStartFn:e=>{let t=(0,x.H)(),n={...p.e.footnote,attrs:{noteId:t}};(0,x.t0)(t,!0),(0,k.U)(e,n)},checkDisabled:v.M,keywords:["footnote","note","reference"]},...y.c,...C.js,...C.ne,...f.h,...A,...h],z=()=>s()(E,e=>e.priority),T=()=>c()(E,"key"),N=function(e,t){var n;let r=!(arguments.length>2)||void 0===arguments[2]||arguments[2];return!!(t.featureFlag&&!u.VH.get(t.featureFlag)||(null===(n=t.checkDisabled)||void 0===n?void 0:n.call(t,e)))||!!r&&!(0,I.$i
1)(e,t.nodeName)}},9726:function(e,t,n){"use strict";n.d(t,{e:function(){return a}});var r=n(98081),o=n(53027),i=n(80311);let a={title:{type:"title",attrs:{level:1}},h1:{type:"heading",attrs:{level:1}},normalText:{type:"paragraph"},h2:{type:"heading",attrs:{level:2}},h3:{type:"heading",attrs:{level:3}},h4:{type:"heading",attrs:{level:4}},bulletedList:{type:"bullet",attrs:{indent:0}},numberedList:{type:"numbered",attrs:{indent:0}},todoList:{type:"todo",attrs:{indent:0}},blockquote:{type:"blockquote",content:[{type:"paragraph"}]},codeBlock:{type:"codeBlock"},mathBlock:{type:"math_display"},button:{type:"button",content:[{type:"text",text:"Click here"}]},buttonGroup:{type:"buttonGroup",content:[{type:"button",content:[{type:"text",text:"Click here"}]}]},table2:{type:"table",content:[{type:"tableRow",content:[{type:"tableCell",attrs:{colspan:1,rowspan:1},content:[{type:"paragraph"}]},{type:"tableCell",attrs:{colspan:1,rowspan:1},content:[{type:"paragraph"}]}]},{type:"tableRow",content:[{type:"tableCell",attrs:{colspan:1,rowspan:1},content:[{type:"paragraph"}]},{type:"tableCell",attrs:{colspan:1,rowspan:1},content:[{type:"paragraph"}]}]}]},table3:{type:"table",content:[{type:"tableRow",content:[{type:"tableCell",attrs:{colspan:1,rowspan:1},content:[{type:"paragraph"}]},{type:"tableCell",attrs:{colspan:1,rowspan:1},content:[{type:"paragraph"}]},{type:"tableCell",attrs:{colspan:1,rowspan:1},content:[{type:"paragraph"}]}]},{type:"tableRow",content:[{type:"tableCell",attrs:{colspan:1,rowspan:1},content:[{type:"paragraph"}]},{type:"tableCell",attrs:{colspan:1,rowspan:1},content:[{type:"paragraph"}]},{type:"tableCell",attrs:{colspan:1,rowspan:1},content:[{type:"paragraph"}]}]},{type:"tableRow",content:[{type:"tableCell",attrs:{colspan:1,rowspan:1},content:[{type:"paragraph"}]},{type:"tableCell",attrs:{colspan:1,rowspan:1},content:[{type:"paragraph"}]},{type:"tableCell",attrs:{colspan:1,rowspan:1},content:[{type:"paragraph"}]}]}]},table4:{type:"table",content:[{type:"tableRow",content:[{type:"tableCell",attrs:{colspan:1,rowspan:1},content:[{type:"paragraph"}]},{type:"tableCell",attrs:{colspan:1,rowspan:1},content:[{type:"paragraph"}]},{type:"tableCell",attrs:{colspan:1,rowspan:1},content:[{type:"paragraph"}]},{type:"tableCell",attrs:{colspan:1,rowspan:1},content:[{type:"paragraph"}]}]},{type:"tableRow",content:[{type:"tableCell",attrs:{colspan:1,rowspan:1},content:[{type:"paragraph"}]},{type:"tableCell",attrs:{colspan:1,rowspan:1},content:[{type:"paragraph"}]},{type:"tableCell",attrs:{colspan:1,rowspan:1},content:[{type:"paragraph"}]},{type:"tableCell",attrs:{colspan:1,rowspan:1},content:[{type:"paragraph"}]}]},{type:"tableRow",content:[{type:"tableCell",attrs:{colspan:1,rowspan:1},content:[{type:"paragraph"}]},{type:"tableCell",attrs:{colspan:1,rowspan:1},content:[{type:"paragraph"}]},{type:"tableCell",attrs:{colspan:1,rowspan:1},content:[{type:"paragraph"}]},{type:"tableCell",attrs:{colspan:1,rowspan:1},content:[{type:"paragraph"}]}]},{type:"tableRow",content:[{type:"tableCell",attrs:{colspan:1,rowspan:1},content:[{type:"paragraph"}]},{type:"tableCell",attrs:{colspan:1,rowspan:1},content:[{type:"paragraph"}]},{type:"tableCell",attrs:{colspan:1,rowspan:1},content:[{type:"paragraph"}]},{type:"tableCell",attrs:{colspan:1,rowspan:1},content:[{type:"paragraph"}]}]}]},columns2:{type:"gridLayout",content:[{type:"gridCell",content:[{type:"paragraph"}]},{type:"gridCell",content:[{type:"paragraph"}]}]},columns3:{type:"gridLayout",content:[{type:"gridCell",content:[{type:"paragraph"}]},{type:"gridCell",content:[{type:"paragraph"}]},{type:"gridCell",content:[{type:"paragraph"}]}]},columns4:{type:"gridLayout",content:[{type:"gridCell",content:[{type:"paragraph"}]},{type:"gridCell",content:[{type:"paragraph"}]},{type:"gridCell",content:[{type:"paragraph"}]},{type:"gridCell",content:[{type:"paragraph"}]}]},insertCardInside:{type:"card",content:[{type:"cardLayoutItem",attrs:{itemId:"body",background:{}},content:[{type:"heading",attrs:{level:1}}]}]},aiCardAfter:{type:"card",attrs:{generatorInput:o.d},content:[{type:"paragraph"}]},footnote:{type:"footnote",content:[{type:"paragraph"}]},contributors:{type:"contributors"},divider:{type:"divider"},tableOfContents:[{type:"heading",attrs:{level:3},content:[{type:"text",text:"Table of contents"}]},{type:"tableOfContents"}],gallery:{type:"gallery",content:[]},...(0,i.BC)(),...r.NY,toggle:{type:"toggle",content:[{type:"toggleSummary"},{type:"paragraph"}]}}},86323:function(e,t,n){"use strict";n.d(t,{UV:function(){return o.U},ZT:function(){return o.Z},e1:function(){return i.e},pP:function(){return r.pP},xr:function(){return r.xr},zm:function(){return r.zm}});var r=n(4471),o=n(93565),i=n(9726)},93565:function(e,t,n){"use strict";n.d(t,{U:function(){return i},Z:function(){return a}});var r=n(30764),o=n(11050);let i=(e,t)=>{let n=Array.isArray(t)?t:[t],o=r.p2.fromJSON(e.schema,{content:n});e.view.dragging={slice:o,move:!0},e.commands.setTextSelection(e.state.selection.from)},a=(e,t)=>{o.co.track(o.AA.NODE_INSERTED,{node_name:e.nodeName,command:e.key,method:t}
1),"card"===e.nodeName&&o.co.track(o.AA.CARD_CREATED,{method:t,command:e.key})}},96841:function(e,t,n){"use strict";n.d(t,{Y:function(){return O}});var r=n(52322),o=n(32981),i=n(26468),a=n(73751),l=n(54326),s=n(97217),d=n(28535),c=n(2338),u=n(85954),p=n(99903),m=n(5879),h=n(27191),g=n(2784),f=n(93202),x=n(16494),v=n(15636);let b=e=>{let{currentAttributes:t,updateAttributes:n,editor:r,isMounted:o}=e,i=(0,g.useRef)({currentAttributes:t,updateAttributes:n,sourceKey:t.source});i.current.currentAttributes=t,i.current.updateAttributes=n,(0,g.useEffect)(()=>{i.current.sourceKey=i.current.currentAttributes.source},[t.tempUrl,t.src]),(0,g.useEffect)(()=>{if(!r||o)return;let{src:e,tempUrl:t,uploadStatus:n}=i.current.currentAttributes;t&&!e&&n!==x.D.Uploading&&(console.log("[useUploadOnUnmount] uploading tempUrl:",t),i.current.updateAttributes({uploadStatus:x.D.Uploading,source:i.current.sourceKey}),(0,v.Sm)(r,t))},[r,o])};var y=n(88194),C=n(20336),w=n(91994),k=n(61840),j=n(29596),S=n(4878),A=n(47968),I=n(93691),E=n(65435),z=n(29560),T=n(30764),N=n(66855),M=n(26282),_=n(89064),L=n(11093);let P=(e,t,n)=>{if(t instanceof h.qv){let l=null!=n?n:t.node,s=(0,L.j0)(e,l.type);if(s&&s.config.accessoryImageKey){var r,o,i,a;let e=s.config.accessoryImageKey,n=null!==(r=l.attrs[e])&&void 0!==r?r:{};if(!n.source&&(0,M.G)(t.$from.parent)){let r=(0,_.P)(t.$from.parent.attrs.variantKey);if(null===(i=r.defaultAttrs)||void 0===i?void 0:null===(o=i[e])||void 0===o?void 0:o.source)n.source=r.defaultAttrs[e].source;else{let r=(0,L.Jn)(t.$from.parent.content).find(t=>{var n;return null===(n=t.attrs[e])||void 0===n?void 0:n.source});n.source=null==r?void 0:null===(a=r.attrs[e])||void 0===a?void 0:a.source}}return{attrs:n,type:l.type,editType:"accessory",mediaType:"image",accesoryKeyPath:e}}return{editType:"node",...l}}if(t instanceof h.Bs&&t.to-t.from==1&&t.$from.nodeAfter){let e=null!=n?n:t.$from.nodeAfter;return{editType:"node",...e}}return t instanceof h.Bs&&e.isActive("link")?{attrs:e.getAttributes("link"),type:e.schema.marks.link,mediaType:"embed"}:null},R=e=>{let t,{editor:n,selection:r,sourceKey:o,attrs:i,nodeName:a,resetAttrs:l,resizeToFit:s}=e,{from:d}=r,c=P(n,r);if(c){if(l)t={};else if(c.type instanceof T.ZU)t=c.attrs;else{var u;let e=n.state.doc.nodeAt(d);if(!e||e.type!==c.type){console.error("[updateSelectedMedia] Node has moved, cant update");return}t=(null===(u=P(n,r,e))||void 0===u?void 0:u.attrs)||{}}}else{console.error("[updateSelectedMedia] No selectedMedia to update");return}let p={...t,source:o,...i};if(s&&"node"===c.editType&&(p=(0,N.UZ)(p)),(null==c?void 0:c.type.name)==="link"){p.href=p.href||p.sourceUrl;let{from:e,to:t}=r;n.chain().extendMarkRange("link").updateAttributes("link",p).setTextSelection({from:e,to:t}).run();return}if(c.accesoryKeyPath){n.chain().updateAttributesAtPos(d,{[c.accesoryKeyPath]:p}).run();return}let m=j.ah[p.source],g=a||m.nodeName;g&&n.commands.command(e=>{let{tr:t,state:n}=e,r=n.schema.nodes[g];return!!r&&(t.setNodeMarkup(d,r,p).setSelection(h.qv.create(t.doc,d)).setMeta("annotationEvent",{type:"update-node-attrs",pos:d}),!0)})},H=(e,t)=>{let n=(0,L.j0)(e,t);return!!n&&!!n.config.accessoryImageKey||(t instanceof T.Jq?(0,N.vb)(t):t instanceof T.ZU&&"link"===t.name)},D=y.i.key,O=g.memo(e=>{let{editor:t}=e;(0,S.F1)(t);let n=(0,S.LM)(t),{isConnected:x}=(0,f.$gs)(),v=(0,z.B)(),y=(0,w.CG)(A.hN),T=t.state.selection,N=(0,g.useMemo)(()=>P(t,T),[t,T]),M=(0,w.CG)(A.tY),_=N&&H(t,N.type),L=n&&!!(M&&_&&y),O=(0,g.useRef)(null),B=(0,g.useCallback)(()=>{v(!1),T instanceof h.qv&&t.chain().selectNodeAtPos(T.from,!1).focus().run()},[t,T,v]),F=(0,k.A)(t);(0,g.useEffect)(()=>{_||v(!1)},[_,v]),(0,g.useEffect)(()=>{L&&setTimeout(()=>{if(!O.current)return;let e=(0,u.t5)(O.current);e&&!(e.length<1)&&(0,p.T)(e[0],{nextTick:!0})},100)},[L,t]),(0,g.useEffect)(()=>{N&&H(t,N.type)&&G(N.attrs.source||D)},[N,t]);let[W,G]=(0,g.useState)(D),U=j.ah[W];(0,g.useEffect)(()=>{U||G(D)},[U]);let V=(0,g.useCallback)(e=>{R({editor:t,selection:T,sourceKey:W,attrs:e,resizeToFit:U.resizeToFit})},[t,W,T,U.resizeToFit]),q=(null==N?void 0:N.attrs)||{};b({currentAttributes:q,updateAttributes:V,editor:t,isMounted:L});let $=(0,g.useCallback)(()=>{R({editor:t,selection:T,sourceKey:W,attrs:{source:W},nodeName:"mediaPlaceholder",resetAttrs:!0})},[W,T,t]),K=(0,I.g)(),Z=!!(x||(null==U?void 0:U.availableOffline)),Y=(null==N?void 0:N.editType)||"node",X=(0,g.useCallback)(e=>
1(null==N?void 0:N.mediaType)==="embed"?"embed"===e.nodeName||"video"===e.nodeName:(null==N?void 0:N.mediaType)==="image"?"image"===e.nodeName:!!e.nodeName,[N]);return(0,r.jsxs)(o.d,{isOpen:L,onClose:B,size:K,trapFocus:!1,blockScrollOnMount:!1,children:[(0,r.jsx)(i.Z,{background:"none"}),(0,r.jsxs)(a.s,{onKeyDown:F,"data-in-editor-focus":!0,"data-testid":"media-drawer","data-test-media-source":W,children:[(0,r.jsx)(l.x,{children:(0,r.jsx)(m.cC,{id:"xYilR2"})}),(0,r.jsxs)(s.f,{children:[(0,r.jsx)(C.V,{isConnected:Z,label:(0,r.jsx)(m.cC,{id:"2y7sUG"}),mb:6}),(0,r.jsx)(E.M,{currentSource:U,onChange:G,isValidSource:X}),U&&(0,r.jsx)(d.xu,{ref:O,opacity:Z?1:.4,pointerEvents:Z?"initial":"none",children:(0,r.jsx)(U.Panel,{editor:t,updateAttributes:V,currentAttributes:q,resetToPlaceholder:$,editType:Y})})]}),(0,r.jsx)(c.o,{"data-testid":"media-drawer-close"})]})]})});O.displayName="MediaDrawer"},65435:function(e,t,n){"use strict";n.d(t,{M:function(){return y}});var r=n(52322),o=n(10625),i=n(67046),a=n(62614),l=n(75009),s=n(28535),d=n(332),c=n(99058),u=n(44035),p=n(39237),m=n(38035),h=n(82554),g=n(42946),f=n(49929),x=n(2784),v=n(42111),b=n(29596);let y=x.memo(e=>{var t;let{currentSource:n,onChange:x,isValidSource:y}=e,C=null==n?void 0:null===(t=n.image)||void 0===t?void 0:t.src,w=(0,v.Zd)();return(0,r.jsxs)(o.v,{children:[(0,r.jsx)(i.j,{as:a.z,w:"100%",textAlign:"left",rightIcon:(0,r.jsx)(f.G,{icon:g.ptq}),leftIcon:C?(0,r.jsx)(l.E,{h:"1em",w:"1em",objectFit:"cover",src:C}):(null==n?void 0:n.icon)?(0,r.jsx)(f.G,{icon:null==n?void 0:n.icon,color:"var(--chakra-colors-trueblue-600)",fixedWidth:!0}):void 0,mb:6,children:(0,r.jsx)(s.xu,{noOfLines:1,wordBreak:"break-all",overflowX:"hidden",textOverflow:"ellipsis",children:(null==n?void 0:n.label())||"Source"})}),(0,r.jsx)(d.h,{children:(0,r.jsx)(c.q,{zIndex:"modalPopover",maxH:"60vh",overflowY:"auto",pos:"relative",children:Object.entries(b.dz).map(e=>{var t;let[o,i]=e,a=i.filter(e=>!(e.checkDisabled&&e.checkDisabled())&&!e.disabled&&(!e.featureFlag||!!w[e.featureFlag])&&y(e));return 0===a.length?null:(0,r.jsx)(u._,{title:null!==(t=b.X8[o]())&&void 0!==t?t:o,type:"radio",onChange:x,value:null==n?void 0:n.key,children:a.map(e=>{let{label:t,key:n,icon:o,image:i,badge:a}=e;return(0,r.jsx)(p.i,{value:n,children:(0,r.jsxs)(m.k,{direction:"row",align:"center",children:[i?(0,r.jsx)(l.E,{display:"inline",mr:2,h:"1em",w:"1em",objectFit:"contain",src:i.src}):o?(0,r.jsx)(s.xu,{display:"inline",mr:2,color:"trueblue.600",children:(0,r.jsx)(f.G,{icon:o})}):(0,r.jsx)(r.Fragment,{}),t(),a&&(0,r.jsx)(h.C,{ml:2,colorScheme:"green",children:a()})]})},n)})},o)})})})]})});y.displayName="MediaDrawerMenu"},93691:function(e,t,n){"use strict";n.d(t,{g:function(){return i}});var r=n(96933);let o={base:"xs","2xl":"sm"},i=()=>(0,r.i)(o)},80720:function(e,t,n){"use strict";n.d(t,{u:function(){return nO}});var r,o=n(52322),i=n(28535),a=n(29117),l=n(94523),s=n(72338),d=n(27191),c=n(2784),u=n(15468),p=n(98462),m=n(35503),h=n(27835),g=n(26282),f=n(59080),x=n(91073),v=n(10653),b=n(77220);let y=e=>{let t=(0,c.useRef)(null),n=(0,v.nm)(),{editor:r,tippyOptions:i,onHide:a,targetElement:l}=e;return(0,c.useEffect)(()=>{r&&r.commands.command(e=>{let{tr:r}=e;return r.setMeta(b.eq,{element:t.current,tippyOptions:i,panelLifecycle:n,onHide:a,targetElement:l}),!0})},[r,i,n,a,l]),(0,o.jsx)("div",{ref:t,className:e.className,style:{visibility:"hidden"},children:e.children})};
1var C=n(66855),w=n(4878),k=n(42946),j=n(54933),S=n(87254),A=n(17630),I=n(5879),E=n(29679);let z=e=>{let{editor:t,handleDelete:n}=e,r=(0,c.useCallback)(()=>{t.chain().deleteSelectionAndSelectNear().run()},[t]);return(0,o.jsx)(E.h,{label:(0,o.jsx)(I.cC,{id:"cnGeoo"}),icon:k.XAH,onClick:n||r,testId:"delete-node-button",color:"red.500"})};var T=n(42822),N=n(74008);let M=()=>(0,o.jsx)(T.M,{h:"20px",children:(0,o.jsx)(N.i,{mx:1,borderColor:"gray.300",orientation:"vertical"})});var _=n(85573),L=n(91994),P=n(71173),R=n(84875),H=n(56581),D=n(10625),O=n(67046),B=n(62614),F=n(99058),W=n(36371),G=n(73582),U=n(2969),V=n(77533),q=n(3181),$=n(13272),K=n(43297),Z=n(38035),Y=n(49929),X=n(98621),J=n.n(X),Q=n(28601);let ee=(e,t)=>{let n=new Set;for(let r of e)if(n.add(r[t]),n.size>1)return!1;return[...n][0]},et=(e,t,n)=>ee(function(e,t){let n=function(e,t){if("string"==typeof e){if(!t.marks[e])throw Error("There is no mark type named '".concat(e,"'. Maybe you forgot to add the extension?"));return t.marks[e]}return e}(t,e.schema),{from:r,to:o,empty:i}=e.selection,a=[];return i?(e.storedMarks&&a.push(...e.storedMarks),a.push(...e.selection.$head.marks())):e.doc.nodesBetween(r,o,e=>{a.push(...e.marks)}),a.filter(e=>e.type.name===n.name).map(e=>({...e.attrs}))}(e,t),n);var en=n(66028),er=n(42487);let eo=e=>{let{editor:t}=e,{selection:n,doc:r,schema:o}=t.state,{from:i,to:a}=n,l=r.rangeHasMark(i,a,o.marks.highlight)?null:r.rangeHasMark(i,a,o.marks.textColor)?et(t.state,"textColor","hex")||null:ea(t),s=r.rangeHasMark(i,a,o.marks.textColor)?null:r.rangeHasMark(i,a,o.marks.highlight)&&et(t.state,"highlight","hex")||null,d=(0,c.useCallback)(e=>t.chain().focus().setHighlightColor(e).run(),[t]),u=(0,c.useCallback)(e=>t.chain().focus().setTextColor(e).run(),[t]),p=(0,c.useCallback)(()=>{t.chain().focus().unsetMark("textColor").unsetMark("highlight").run()},[t]);return{highlightValue:s,resetColorAndHighlight:p,setHighlightColor:d,setTextColor:u,textColorValue:l}},ei=e=>{let{editor:t,testId:n,disabled:r}=e,{textColorValue:i,highlightValue:s,setHighlightColor:d,setTextColor:c,resetColorAndHighlight:u}=eo({editor:t});return(0,o.jsxs)(D.v,{isLazy:!0,onClose:()=>(0,er.L)(t),children:[(0,o.jsx)(l.kH,{placement:"top",label:(0,o.jsx)(I.cC,{id:"76ESgh"}),children:(0,o.jsx)(O.j,{isDisabled:r,as:B.z,variant:"toolbar",rightIcon:(0,o.jsx)(Y.G,{icon:k.ptq,transform:"shrink-6"}),"data-testid":n,onMouseDown:en.br,size:"sm",children:(0,o.jsx)(el,{color:s||i||void 0})})}),(0,o.jsx)(F.q,{overflow:"hidden",children:(0,o.jsxs)(W.m,{isFitted:!0,variant:"soft-rounded",size:"sm",defaultIndex:s?1:0,children:[(0,o.jsxs)(G.t,{children:[(0,o.jsx)(U.O,{children:(0,o.jsxs)(a.U,{children:[(0,o.jsx)(Y.G,{icon:k.yGG}),(0,o.jsx)(V.x,{children:(0,o.jsx)(I.cC,{id:"xeiujy"})})]})}),(0,o.jsx)(U.O,{children:(0,o.jsxs)(a.U,{children:[(0,o.jsx)(Y.G,{icon:k.hjM}),(0,o.jsx)(V.x,{children:(0,o.jsx)(I.cC,{id:"gtEbeW"})})]})})]}),(0,o.jsxs)(q.n,{children:[(0,o.jsx)($.x,{p:0,pt:2,children:(0,o.jsx)(Q.M,{currentColor:i||null,setColor:c,unsetColor:u,source:"TextColor"})}),(0,o.jsx)($.x,{p:0,pt:2,children:(0,o.jsx)(Q.M,{currentColor:s||"",setColor:d,unsetColor:u,source:"TextHighlight"})})]})]})})]})},ea=e=>{let{from:t}=e.state.selection,n=e.view.domAtPos(t),r=n.node instanceof HTMLElement?n.node:n.node.parentElement;if(!r)return null;let o=getComputedStyle(r),i=o.getPropertyValue("color");return i&&"rgba(0, 0, 0, 0)"!==i?J()(i).toHexString().toUpperCase():null},el=e=>{let{color:t,fixedWidth:n,isChecked:r}=e;return(0,o.jsxs)(K.K,{spacing:"2px",children:[(0,o.jsx)(V.x,{children:r?(0,o.jsx)(H.n,{}):(0,o.jsx)(Y.G,{icon:j.yGG,fixedWidth:n,size:t?"sm":void 0,transform:{y:t?3:0}})}),t&&(0,o.jsx)(Z.k,{w:5,h:1.5,bg:t,borderRadius:"sm",borderWidth:"1px",borderColor:"blackAlpha.400"})]})};var es=n(47968),ed=n(15425),ec=n(11093),eu=n(29560),ep=n(75768),em=n(44035),eh=n(39237),eg=n(3452),ef=n(78277),ex=n(28390);let ev=()=>({link:{title:S.ag._({id:"yzF66j"})},preview:{title:S.ag._({id:"rdUucN"})},inline:{title:S.ag._({id:"HY4nP5"})}}),eb=e=>{let{editor:t,selection:n,isDisabled:r}
1=e,i=n instanceof d.Bs?"link":n.node.type.name,a="link"===i,l=t.getAttributes(i),{embed:s,source:u}=l,p=(0,ef.v0)(u||void 0),m="embed.twitter"===p.key,h=ev(),g=(0,c.useCallback)(e=>{if("link"===i&&"link"!==e)t.commands.convertLinkToMedia(e);else if("link"===e){t.commands.convertMediaToLink();return}t.commands.updateAttributes(i,{displayStyle:e})},[t,i]);if("href"in l&&(0,R.H7)(l.href)||m)return null;let f=a?"link":"displayStyle"in l&&l.displayStyle||"inline";return(0,o.jsxs)(D.v,{closeOnSelect:!0,isLazy:!0,autoSelect:!1,children:[(0,o.jsx)(O.j,{isDisabled:r,size:"sm",as:B.z,rightIcon:(0,o.jsx)(Y.G,{icon:k.ptq,transform:"shrink-6"}),variant:"toolbar",pl:2,onMouseDown:en.br,"data-testid":"display-style-dropdown",children:h[f].title}),(0,o.jsx)(F.q,{children:(0,o.jsx)(em._,{type:"radio",onChange:g,value:f,children:Object.entries(h).map(e=>{let[t,{title:n}]=e;return(0,o.jsx)(eh.i,{value:t,onMouseDown:en.br,"data-testid":"display-style-option-".concat(t),children:(0,o.jsx)(V.x,{children:n})},t)})})})]})},ey=e=>{let{href:t,updateHref:n,unlink:r,editor:i,allowEditMetadata:l=!1}=e,s=(0,c.useRef)(null),[d,u]=(0,c.useState)(t),p=(0,L.CG)(es.xb),m=(0,ec.NC)(t,p),h=e=>{if(!e)return;let t=!(0,ed.kr)(e)&&!(0,R.H7)(e),r=t?"http://"+e:e;if(!(0,ed.jv)(r)){n("");return}n(r)},g=(0,c.useCallback)(()=>{try{window.open(t,"_blank")}catch(e){console.error("(caught) Link Formatting Menu error",e)}},[t]),f=(0,c.useCallback)(e=>{if(!m)return;let n=(0,ec.g)(t);(0,P.l)(i,e,n)},[i,t,m]);(0,c.useEffect)(()=>{!t&&s.current&&setTimeout(()=>{var e;null==s||null===(e=s.current)||void 0===e||e.focus()})},[t]),(0,c.useEffect)(()=>{u(t)},[t]);let x=(0,eu.B)(),v=(0,c.useCallback)(e=>{x(!0),e.stopPropagation()},[x]);return(0,o.jsxs)(a.U,{spacing:2,py:1,mx:2,children:[(0,o.jsx)(_.I,{value:d,ref:s,onChange:e=>u(e.target.value),onBlur:()=>{h(d)},onKeyPress:e=>{"Enter"===e.key&&(h(d),i.commands.focus())},placeholder:S.ag._({id:"Ilf1mg"}),width:"250px",size:"sm","data-testid":"link-input"}),r&&(0,o.jsx)(E.h,{label:(0,o.jsx)(I.cC,{id:"484LKL"}),icon:k.AE2,onClick:r}),m&&(0,o.jsx)(E.h,{label:(0,o.jsx)(I.cC,{id:"9FNPgA"}),icon:k.eFW,onClick:f}),t&&(0,o.jsx)(E.h,{label:m?(0,o.jsx)(I.cC,{id:"RMJwZi"}):(0,o.jsx)(I.cC,{id:"fOj0+R"}),icon:k.gJF,onClick:g}),t&&l&&(0,o.jsx)(E.h,{label:(0,o.jsx)(I.cC,{id:"ePK91l"}),icon:k.TzT,onClick:v})]})},eC=()=>[{name:S.ag._({id:"bjuYAW"}),key:"solid",icon:j.r9b},{name:S.ag._({id:"bCuf07"}),key:"outline",icon:k.r9b}];var ew=n(98081);let ek=e=>{let{editor:t,attrs:n,selection:r}=e,i=(0,ew.ri)(),a=i[n.variant],s=a?a.icon:k.L4e;return(0,o.jsxs)(D.v,{isLazy:!0,onClose:()=>(0,er.L)(t),children:[(0,o.jsx)(l.kH,{placement:"top",label:(0,o.jsx)(I.cC,{id:"H8b4pf"}),"aria-label":S.ag._({id:"H8b4pf"}),children:(0,o.jsx)(O.j,{as:B.z,variant:"toolbar",rightIcon:(0,o.jsx)(Y.G,{icon:k.ptq,transform:"shrink-6"}),size:"sm",onMouseDown:en.br,children:(0,o.jsx)(Y.G,{icon:s})})}),(0,o.jsx)(F.q,{maxW:"auto",children:(0,o.jsxs)(ep.h,{flex:"row",alignItems:"center",children:[Object.entries(i).map(e=>{let[i,{name:a,icon:l}]=e;return(0,o.jsx)(E.h,{label:a,icon:l,isActive:n.icon&&n.variant===i,onClick:()=>{t.chain().focus().updateAttributes("calloutBox",{variant:i,icon:!0}).selectNodeAtPos(r.from).run()}},a)}),(0,o.jsx)(M,{}),(0,o.jsx)(E.h,{label:n.icon?(0,o.jsx)(I.cC,{id:"Cs6LHm"}):(0,o.jsx)(I.cC,{id:"pjF2Hd"}),icon:k.gPx,isActive:!n.icon,onClick:()=>{t.chain().focus().updateAttributes("calloutBox",{icon:!n.icon}).selectNodeAtPos(r.from).run()}},"icon")]})})]})};var ej=n(12336),eS=n(70065),eA=n(11082),eI=n(56143),eE=n(43019),ez=n(29957),eT=n(40335),eN=n(42111),eM=n(11550),e_=n(98441),eL=n(92850),eP=n(26468),eR=n(22226),eH=n(54326),eD=n(82554),eO=n(2338),eB=n(97217),eF=n(17993),eW=n(50250),eG=n(14274),eU=n(11050),eV=n(68727),eq=n(69747);let e$=e=>{let{isOpen:t,onClose:n,cardId:r,editor:i}=e,a=(0,eU.z$)(),[l,s]=(0,c.useState)(!1),[d,u]=(0,c.useState)(!1),p=(0,eS.p)(),m=(0,c.useRef)(null),h=(0,c.useCallback)(()=>{m.current&&p.update(m.current,{status:"success",title:(0,o.jsx)(I.cC,{id:"enJ/4m"}),description:(0,o.jsx)(V.x,{children:(0,o.jsx)(I.cC,{id:"IxXthU"})}),duration:3e3,isClosable:!0})}
1,[p]),g=(0,c.useCallback)(()=>{m.current&&p.update(m.current,{title:(0,o.jsx)(I.cC,{id:"FE5kcD"}),status:"error",duration:null,isClosable:!0})},[p]),f=(0,c.useCallback)(async e=>{switch(e){case"png":s(!0);break;case"jpeg":u(!0)}let t=i.getJSON(),n="".concat(eG.v.API_HOST,"/export/cards/").concat(r,"/image");m.current=p({id:"export-toast-".concat(r,"-").concat(e),isClosable:!1,position:"top",duration:null,status:"loading",variant:"light",title:(0,o.jsx)(I.cC,{id:"yvVnEI"})});try{var l;let o=await fetch(n,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({docContent:t,fileType:e})}),i=await o.blob();if(!o.ok)throw Error("Export failed.");let d=window.URL.createObjectURL(i),c=document.createElement("a"),p=decodeURIComponent((null===(l=(o.headers.get("Content-Disposition")||"").split(";").find(e=>e.includes("filename=")))||void 0===l?void 0:l.replace("filename=","").trim())||"".concat(r,".").concat(e));c.download=p,c.href=d,document.body.appendChild(c),c.click(),c.remove(),null==a||a.track(eU.AA.CARD_EXPORTED,{cardId:r,format:"image",fileType:e}),setTimeout(()=>{switch(e){case"png":s(!1);break;case"jpeg":u(!1)}h()},300)}catch(e){g()}finally{s(!1),u(!1)}},[a,r,i,g,h,p]);return(0,o.jsxs)(eL.u_,{isOpen:t,onClose:n,size:"lg",children:[(0,o.jsx)(eP.Z,{}),(0,o.jsxs)(eR.h,{children:[(0,o.jsxs)(eH.x,{children:[(0,o.jsx)(I.cC,{id:"xRJ+bN"}),(0,o.jsx)(eD.C,{colorScheme:"green",fontSize:"lg",ml:2,children:(0,o.jsx)(I.cC,{id:"YBt9YP"})})]}),(0,o.jsx)(eO.o,{}),(0,o.jsx)(N.i,{}),(0,o.jsx)(eB.f,{pt:"6",children:(0,o.jsxs)(eF.g,{spacing:4,align:"start",children:[(0,o.jsx)(K.K,{spacing:2,w:"100%",children:(0,o.jsx)(eV.j,{onClick:()=>f("png"),exportInProgress:l,exportInProgressNote:(0,o.jsx)(I.cC,{id:"SJjTti"}),accentColor:"purple",icon:k.VmB,formatLabel:"PNG"})}),(0,o.jsx)(V.x,{fontSize:"sm",color:"gray.600",children:(0,o.jsx)(I.cC,{id:"8LhjM/",components:{0:(0,o.jsx)(B.z,{variant:"link",as:"span",size:"sm",cursor:"pointer",onClick:()=>{n(),eq.pw.emit(eq.TI.OPEN_PAGE_SETUP,"cards")}})}})})]})}),(0,o.jsx)(eW.m,{children:(0,o.jsx)(ep.h,{children:(0,o.jsx)(B.z,{onClick:()=>{n()},children:(0,o.jsx)(I.cC,{id:"DPfwMq"})})})})]})]})};var eK=n(26284),eZ=n(73208),eY=n(65895),eX=n(90604),eJ=n(78462);let eQ=e=>{let{attrs:t}=e,n=(0,L.CG)(es.gh),r=(0,L.CG)(es.yx),i=t.id,a=(0,eJ.gq)({cardId:i,docId:null==r?void 0:r.id,isPresentMode:n===eX.q.SLIDE_VIEW}),l=(0,eS.p)(),{onCopy:s}=(0,eK.V)(a),d=(0,c.useCallback)(e=>{var t;if(e.target&&(null===(t=e.target)||void 0===t?void 0:t.closest('[data-testid="open-share"]'))){e.preventDefault();return}s(),l({title:S.ag._({id:"BVYvMa"}),status:"success",duration:3e3,position:"top"})},[s,l]),u=(0,eY.K)();return(0,o.jsx)(E.h,{onClick:d,label:u?(0,o.jsx)(I.cC,{id:"F0YmUY"}):(0,o.jsxs)(K.K,{spacing:"0",children:[(0,o.jsx)(V.x,{children:(0,o.jsx)(I.cC,{id:"afMspw"})}),(0,o.jsx)(V.x,{fontSize:"xxs",color:"gray.400",children:(0,o.jsx)(I.cC,{id:"OpeWZK"})})]}),children:(0,o.jsx)(eZ.x,{isLocked:!u})})};var e0=n(32899),e1=n(2572),e2=n(96214),e3=n(36783),e4=n(13793);let e5=e=>{let{editor:t,selection:n,decorations:r}=e,{node:i,from:a}=n,s=i.attrs,d=(0,e3.en)(r),u=(0,e2.U)(s,null==d?void 0:d.layout),p=(0,c.useCallback)(e=>{a&&t.commands.updateAttributesAtPos(a,{fitType:e})},[t,a]);return(0,o.jsx)(l.kH,{label:(0,o.jsx)(I.cC,{id:"lTNfPK"}),children:(0,o.jsxs)(D.v,{children:[(0,o.jsx)(O.j,{as:B.z,size:"sm",variant:"toolbar",rightIcon:(0,o.jsx)(Y.G,{icon:k.ptq}),children:"fit"===u?(0,o.jsx)(I.cC,{id:"u4iXQi"}):(0,o.jsx)(I.cC,{id:"TuM2Yu"})}),(0,o.jsx)(F.q,{children:(0,o.jsxs)(em._,{title:S.ag._({id:"lTNfPK"}),type:"radio",value:u,children:[(0,o.jsx)(eh.i,{value:"fill",onClick:()=>p("fill"),children:(0,o.jsx)(I.cC,{id:"+g2u5d"})}),(0,o.jsx)(eh.i,{value:"fit",onClick:()=>p("fit"),children:(0,o.jsx)(I.cC,{id:"VPxUGR"})})]})})]})})};var e8=n(55478),e9=n(43679),e7=n(34071),e6=n(39429),te=n(48394),tt=n(82729),tn=n(75009),tr=n(27875),to=n.n(tr),ti=n(68015),ta=n.n(ti),tl=n(46795),ts=n(87205),td=n(59366);let tc=e=>{let[t,n]=(0,c.useState)(null);return(0,c.useEffect)(()=>((()=>{let t=new Image;t.src=e,t.onload=()=>
1{let{naturalWidth:e,naturalHeight:r}=t;n(e/r)}})(),()=>{n(null)}),[e]),t},tu=(e,t,n)=>{let r=e.view.domAtPos(t);if(!r)return;let{node:o,offset:i}=r,a=o.childNodes[i],l=a.querySelector("[data-change-focus-point-el]");l&&(l.style.backgroundPosition=n?"".concat(n.x,"% ").concat(n.y,"%"):"")},tp=e=>{var t;return null===(t=(0,td.XU)(e))||void 0===t?void 0:t.backgroundPos},tm=(e,t,n)=>{if(!t||!n)return;let r=(0,tl.XV)(e.state,n);if(!r){console.error("ChangeFocusPoint - relative pos is null");return}tu(e,r,null);let o=e.state.doc.nodeAt(r);if(!o)return;let i=(0,td.XU)(o),a=(0,td.j6)(o,{...i,backgroundPos:t});e.commands.updateAttributesAtPos(r,a)},th=e=>{let{editor:t,pos:n,node:r}=e,o=(0,c.useRef)(null),i=(0,c.useRef)(null),a=(0,c.useRef)(null),[l,s]=(0,c.useState)(!1),d=(0,c.useRef)(),u=(0,c.useCallback)(e=>{let r=o.current;if(r){if(d.current=e,!e){r.style.left="calc(50% - 10px)",r.style.top="calc(50% - 10px)",s(!1);return}r.style.left="calc(".concat(e.x,"% - 10px)"),r.style.top="calc(".concat(e.y,"% - 10px)"),tu(t,n,e),s(50!==e.x||50!==e.y)}},[t,n]),{onOpen:p,onClose:m,isOpen:h}=(0,e8.q)(),g=(0,c.useCallback)(()=>{u(tp(r)),p()},[r,p,u]),f=(0,c.useCallback)(()=>{let e={x:50,y:50};u(e);let r=(0,tl.jS)(t.state,n);tm(t,e,r)},[u,t,n]),x=(0,c.useCallback)(e=>{let t=i.current;if(!t)return;let n=t.getBoundingClientRect(),r=n.width,o=n.height,a=(e.clientX-n.left)/r,l=(e.clientY-n.top)/o;u({x:ta()(100*to()(a,0,1),2),y:ta()(100*to()(l,0,1),2)})},[u]);return(0,c.useEffect)(()=>{let e=o.current,r=i.current;if(!e||!r)return;a.current=(0,tl.jS)(t.state,n);let l=()=>{r.addEventListener("mousemove",x),window.addEventListener("mouseup",s)},s=()=>{r.removeEventListener("mousemove",x),window.removeEventListener("mouseup",s),tm(t,d.current,a.current)};return e.addEventListener("mousedown",l),()=>{e.removeEventListener("mousedown",l)}},[t,x,n]),(0,c.useEffect)(()=>{let e=i.current;if(!e)return;a.current=(0,tl.jS)(t.state,n);let r=t=>{e.addEventListener("mousemove",x),window.addEventListener("mouseup",o),x(t)},o=()=>{e.removeEventListener("mousemove",x),window.removeEventListener("mouseup",o),tm(t,d.current,a.current)};return e.addEventListener("mousedown",r),()=>{e.removeEventListener("mousedown",r)}},[t,x,n]),{onOpen:g,onClose:m,isOpen:h,dotRef:o,dotContainerRef:i,canReset:l,resetDotPosition:f}},tg=e=>{let{editor:t,pos:n,node:r}=e,{onOpen:a,onClose:s,isOpen:d,dotRef:c,dotContainerRef:u,canReset:p,resetDotPosition:m}=th({editor:t,pos:n,node:r}),h=(0,td.XU)(r),g=(null==h?void 0:h.src)||(null==h?void 0:h.tempUrl),f=tc(g);return(0,o.jsxs)(e9.J,{strategy:"absolute",placement:"top",isOpen:d,onOpen:a,onClose:s,children:[(0,o.jsx)(l.kH,{label:(0,o.jsx)(I.cC,{id:"BmxaoW"}),children:(0,o.jsx)(i.xu,{my:1,children:(0,o.jsx)(e7.x,{children:(0,o.jsx)(e0.h,{variant:"toolbar",size:"sm",icon:(0,o.jsx)(Y.G,{icon:k.YhY}),boxSize:7,p:0,my:0,"aria-label":S.ag._({id:"BmxaoW"})})})})}),(0,o.jsx)(e6.y,{children:(0,o.jsx)(te.b,{p:1,children:(0,o.jsxs)(i.xu,{ref:u,userSelect:"none",position:"relative",children:[(0,o.jsx)(i.xu,{ref:c,borderRadius:"full",boxSize:5,pos:"absolute",zIndex:"overlay",border:"2px solid",borderColor:"gray.100",pointerEvents:"none",boxShadow:"0 0 0 2px rgba(0,0,0,.1)",bg:"white"}),g&&(0,o.jsx)(tt.o,{maxW:"300px",ratio:f||1,position:"relative",children:(0,o.jsx)(tn.E,{pointerEvents:"none",src:(0,ts.SN)(g,ts.Iv,h.meta),fallbackSrc:g,objectFit:"cover",position:"absolute",top:0,left:0,width:"100%",height:"100%"})}),(0,o.jsx)(B.z,{opacity:p?1:0,pos:"absolute",bottom:3,right:3,variant:"plain",size:"xs",onClick:m,children:(0,o.jsx)(I.cC,{id:"OfhWJH"})})]})})})]})};var tf=n(12964),tx=n(41098);let tv="10px",tb="28px",ty=e=>{let{label:t,children:n,...r}=e;return(0,o.jsxs)(K.K,{direction:"row",spacing:3,paddingX:1,...r,children:[t&&(0,o.jsx)(K.K,{alignSelf:"center",justifyContent:"start",minWidth:n?"max-content":"100%",h:tb,ml:tv,children:(0,o.jsx)(Z.k,{justifyContent:"flex-start",alignItems:"center",width:"100%",height:"100%",children:t})}),n&&(0,o.jsx)(K.K,{alignSelf:"center",width:"100%",pr:tv,h:tb,children:(0,o.jsx)(Z.k,{justifyContent:"flex-end",alignItems:"center",width:"100%",height:"100%",children:n})})]})},tC=e=>{let{editor:t}=e;return(0,o.jsx)(ep.h,{spacing:1,size:"sm",children:A.Ec.map(e=>{let{name:n,icon:r,checkActive:i,apply:a}=e;if(i&&a)return(0,o.jsx)(E.h,{label:n(),icon:r,onClick:()=>{a(t)},isActive:i(t)},n())})})};var tw=n(83906),tk=n(36474);let tj=e=>{let{contributors:t,hiddenContributorIds:n,toggleOneVisibleContributor:r,toggleAllVisibleContributors:i,isDisabled:a=!1}=e,s=0===n.length;return(0,o.jsxs)(D.v,{isLazy:!0,children:[(0,o.jsx)(O.j,{as:B.z,variant:"plain",size:"sm",boxShadow:"none",minW:"max-content",textAlign:"left",rightIcon:(0,o.jsx)(tw.v,{}),isDisabled:a,children:s?(0,o.jsx)(I.cC,{id:"lZw9AX"}):(0,o.jsx)(I.cC,{id:"8Tg/JR"})}),(0,o.jsx)(F.q,{minWidth:"max-content",padding:0,children:(0,o.jsxs)(K.K,{spacing:1,py:3,children:[(0,o.jsx)(ty,{label:(0,o.jsx)(I.cC,{id:"lZw9AX"}),children:(0,o.jsx)(tx.r,{isChecked:s,onChange:i})}),(0,o.jsx)(tA,{paddingY:2}),(0,o.jsx)(ty,{label:(0,o.jsx)(l.NZ,{children:(0,o.jsx)(V.x,{children:(0,o.jsx)(I.cC,{id:"8Tg/JR"})})})}),t.map(e=>(0,o.jsx)(tS,{contributor:e,contributors:t,toggleOneVisibleContributor:r,hiddenContributorIds:n,allVisible:s},e.user.id))]})})]})},tS=e=>{let{contributor:t,contributors:n,toggleOneVisibleContributor:r,hiddenContributorIds:i,allVisible:a}=e,s=n.length-i.length==1&&!i.includes(t.user.id);return(0,o.jsxs)(ty,{label:(0,o.jsxs)(Z.k,{alignItems:"center",gap:2,children:[(0,o.jsx)(l.Vw,{size:"xs",src:t.user.profileImageUrl,opacity:a?.5:1}),(0,o.jsx)(V.x,{fontSize:"md",fontFamily:"Inter, sans-serif",opacity:a?.5:1,sx:{cursor:a?"default":"text"},children:t.user.displayName})]}),paddingY:1.25,children:[(0,o.jsx)(tk.L,{w:4}),(0,o.jsx)(tx.r,{isChecked:!i.includes(t.user.id),onChange:()=>r(t.user.id),disabled:s})]})},tA=e=>(0,o.jsx)(T.M,{children:(0,o.jsx)(N.i,{borderBottomColor:"gray.200"})}),tI=e=>{let{contributors:t,hiddenContributorIds:n,hasMultipleContributors:r,toggleOneVisibleContributor:a,toggleAllVisibleContributors:l}=e;return(0,o.jsx)(o.Fragment,{children:(0,o.jsx)(ty,{label:(0,o.jsx)(i.xu,{display:"flex",alignItems:"center",children:(0,o.jsx)(V.x,{children:(0,o.jsx)(I.cC,{id:"YqsXfH"})})}),children:(0,o.jsx)(tj,{contributors:t,hiddenContributorIds:n,toggleOneVisibleContributor:a,toggleAllVisibleContributors:l,isDisabled:!r})})})},tE=e=>{let{editor:t}=e,n=(0,c.useCallback)(()=>{t.chain().deleteSelectionAndSelectNear().run()},[t]);return(0,o.jsx)(ty,{label:(0,o.jsxs)(i.xu,{color:"red",display:"flex",gap:2,width:"100%",alignItems:"center",onClick:n,_hover:{cursor:"pointer"},children:[(0,o.jsx)(Y.G,{fixedWidth:!0,icon:k.XAH,color:"red"}),(0,o.jsx)(V.x,{children:(0,o.jsx)(I.cC,{id:"cnGeoo"})})]})})};var tz=n(55233),tT=n(72318),tN=n(18149),tM=n.n(tN),t_=n(48697),tL=n(67245),tP=n(46188);let tR=e=>{let{editor:t,label:n,icon:r}=e;return(0,o.jsx)(E.h,{label:n,onClick:()=>{t.chain().selectParentNode().run()},children:r?(0,o.jsx)(Y.G,{icon:r}):(0,o.jsx)(Y.G,{icon:k.pQN,flip:"horizontal"})})};var tH=n(70723);let tD=()=>({inset:{title:S.ag._({id:"Jn5DbR"})},circle:{title:S.ag._({id:"7xMmki"})}}),tO=e=>{let{clipType:t,onChange:n}=e;return t?(0,o.jsxs)(tH.Lt,{children:[(0,o.jsx)(tH.PS,{size:"sm",borderRadius:"full",minWidth:"105px",rightIcon:(0,o.jsx)(Y.G,{icon:k.ptq,transform:"shrink-6"}),variant:"toolbar",pl:2,onMouseDown:en.br,children:tD()[t].title}),(0,o.jsx)(tH.sV,{children:Object.entries(tD()).map(e=>{let[r,{title:a}]=e;return(0,o.jsx)(tH.hP,{value:r,fontSize:"sm",fontWeight:600,icon:(0,o.jsx)(i.xu,{visibility:r===t?"visible":"hidden",children:(0,o.jsx)(Y.G,{icon:k.LEp})}),onMouseDown:en.br,onClick:()=>{n(r)},children:(0,o.jsx)(V.x,{children:a})},r)})})]}):null};var tB=n(65186),tF=n(71986);let tW=e=>{let{editor:t,selection:n,handleDuplicate:r}=e,i=(0,c.useCallback)(()=>{t.chain().insertContentAt(n.from+n.node.nodeSize,n.node.toJSON()).selectInsertedNode().run()},[t,n]);return(0,o.jsx)(E.h,{label:(0,o.jsx)(I.cC,{id:"euc6Ns"}),icon:k.WM4,onClick:r||i,testId:"duplicate-node-button"})};var tG={src:"/_next/static/media/layout-3-cols.478d87d6.svg",height:25,width:20,blurWidth:0,blurHeight:0},tU={src:"/_next/static/media/layout-30-70.019e8aa0.svg",height:25,width:20,blurWidth:0,blurHeight:0},tV={src:"/_next/static/media/layout-4-cols.bc7869e3.svg",height:25,width:20,blurWidth:0,blurHeight:0},tq={src:"/_next/static/media/layout-50-50.a28ea4d4.svg",height:25,width:20,blurWidth:0,blurHeight:0},t$={src:"/_next/static/media/layout-70-30.abcf64e9.svg",height:25,width:20,blurWidth:0,blurHeight:0};let tK=()=>[{name:S.ag._({id:"oCWIE5"}),testId:"layout-preset-5050",image:tq,value:[50,50]},{name:S.ag._({id:"eWUI4Z"}),testId:"layout-preset-7030",image:t$,value:[70,30]},{name:S.ag._({id:"hOcihM"}),testId:"layout-preset-3070",image:tU,value:[30,70]},{name:S.ag._({id:"OnuuaA"}),testId:"layout-preset-3col",image:tG,value:[33.33,33.33,33.34]},{name:S.ag._({id:"hexbw8"}),testId:"layout-preset-4col",image:tV,value:[25,25,25,25]}];var tZ=n(31181),tY=n(36781),tX=n(74105),tJ=n(20816),tQ=n(16556);let t0=e=>{let{existingLink:t,handleRemoveClick:n}=e,r=(null==t?void 0:t.href)&&!t.docId,{title:s,href:d}=t;return r?(0,o.jsx)(a.U,{spacing:2,children:(0,o.jsxs)(tX.B,{size:"sm",children:[(0,o.jsx)(_.I,{size:"sm",isReadOnly:!0,value:d}),(0,o.jsx)(tJ.x,{children:(0,o.jsx)(E.h,{label:(0,o.jsx)(I.cC,{id:"/PoNoq"}),icon:k.Xcf,onClick:()=>n("url")})})]})}):(0,o.jsx)(a.U,{spacing:1,children:(0,o.jsx)(tQ.Vp,{children:(0,o.jsxs)(a.U,{spacing:1,children:[(0,o.jsx)(Y.G,{icon:k.gMD}),(0,o.jsx)(l.kH,{label:s,placement:"top",children:(0,o.jsx)(i.xu,{noOfLines:1,children:s})}),(0,o.jsx)(l.kH,{label:S.ag._({id:"/PoNoq"}),placement:"top",children:(0,o.jsx)(e0.h,{size:"xxs",variant:"ghost","aria-label":S.ag._({id:"/PoNoq"}),icon:(0,o.jsx)(Y.G,{icon:k.Xcf}),onClick:()=>n("pages")})})]})})})};var t1=n(90383);let t2=e=>{let{site:t}=e,n=null==t?void 0:t.routes.map(e=>{var t;return{docId:e.docId,title:null===(t=e.doc)||void 0===t?void 0:t.t
1itle}});return{linkablePages:n}},t3=e=>{let{href:t,linkablePages:n}=e;if(!t)return null;let r=(0,t1.jM)(t);if(!r)return{href:t};let{docId:o}=r,i=o&&(null==n?void 0:n.find(e=>e.docId===o))||null;return{...i,href:t}},t4=e=>{let{title:t,docId:n,updateHref:r}=e,i=(0,eJ.Gn)({docId:n,docTitle:t,absolute:!0});return(0,o.jsx)(l.kH,{label:t,placement:"top",children:(0,o.jsx)(B.z,{w:"100%",onClick:()=>{r(i)},variant:"ghost",colorScheme:"gray",fontWeight:"500",px:2,size:"sm",justifyContent:"flex-start",leftIcon:(0,o.jsx)(Y.G,{icon:k.gMD}),children:(0,o.jsx)(V.x,{textAlign:"left",w:"100%",noOfLines:1,display:"inline",children:t})},n)})},t5=e=>{let{items:t,updateHref:n}=e,[r]=(0,c.useState)(""),i=(0,c.useRef)(null),a=t.filter(e=>{var t;return null===(t=e.title)||void 0===t?void 0:t.toLowerCase().includes(r.toLowerCase())});return(0,c.useEffect)(()=>{var e;(null==i?void 0:i.current)&&(null==i||null===(e=i.current)||void 0===e||e.focus())},[]),(0,o.jsxs)(K.K,{mx:-4,children:[(0,o.jsx)(V.x,{color:"gray.500",fontSize:"sm",fontWeight:"600",children:(0,o.jsx)(I.cC,{id:"QIUdjp"})}),(0,o.jsx)(K.K,{spacing:0,children:a.map(e=>(0,o.jsx)(t4,{updateHref:n,title:e.title,docId:e.docId},e.docId))})]})},t8=e=>{let{updateHref:t,initialHref:n}=e,r=(0,c.useRef)(null),[i,a]=(0,c.useState)(!1),[l,s]=(0,c.useState)(n||""),d=e=>{if(!e)return;let n=!(0,ed.kr)(e)&&!(0,R.H7)(e),r=n?"http://"+e:e;(0,ed.jv)(r)&&t(r)};return(0,c.useEffect)(()=>{var e;(null==r?void 0:r.current)&&(null==r||null===(e=r.current)||void 0===e||e.focus())},[]),(0,o.jsxs)(K.K,{mx:-2,children:[(0,o.jsxs)(tX.B,{size:"sm",children:[(0,o.jsx)(_.I,{ref:r,size:"sm",value:l,placeholder:"Paste a link and hit enter",onChange:e=>{s(e.target.value)},onKeyDown:e=>{"Enter"===e.key&&l.trim().length>0&&(e.preventDefault(),d(l))},onFocus:()=>a(!0),onBlur:()=>a(!1)}),l.length>0&&(0,o.jsx)(tJ.x,{bottom:0,top:"auto",children:(0,o.jsx)(e0.h,{"aria-label":S.ag._({id:"hQRttt"}),variant:"ghost",size:"xs",onClick:()=>d(l),icon:(0,o.jsx)(Y.G,{icon:k.LEp})})})]}),l.length>0&&i&&(0,o.jsx)(V.x,{w:"100%",fontSize:"xxs",color:"gray.500",children:(0,o.jsx)(I.cC,{id:"j6RzX0"})})]})},t9=e=>{let{updateHref:t,initialTab:n,initialHref:r}=e,a=(0,L.CG)(tZ.lH),{linkablePages:l}=t2({site:a}),s=(null==l?void 0:l.length)&&l.length>0;return(0,o.jsx)(i.xu,{children:(0,o.jsxs)(W.m,{size:"sm",variant:"soft-rounded",isFitted:!0,colorScheme:"trueblue",defaultIndex:"pages"===n?0:1,children:[(0,o.jsxs)(G.t,{children:[s&&(0,o.jsx)(U.O,{children:(0,o.jsx)(I.cC,{id:"wRR604"})}),(0,o.jsx)(U.O,{children:(0,o.jsx)(I.cC,{id:"IagCbF"})})]}),(0,o.jsxs)(q.n,{children:[s&&(0,o.jsx)($.x,{maxH:"min(300px, 50vh)",overflowY:"auto",children:(0,o.jsx)(t5,{items:l,updateHref:t})}),(0,o.jsx)($.x,{maxH:"min(300px, 50vh)",overflowY:"auto",children:(0,o.jsx)(t8,{updateHref:t,initialHref:r})})]})]})})},t7=e=>{let{editor:t,selection:n}=e,r=(0,L.CG)(tZ.lH),{linkablePages:i}=t2({site:r}),[l,s]=(0,c.useState)("pages"),[d,u]=(0,c.useState)(null),p=t.getAttributes("button").href||"",m=(0,c.useCallback)(()=>t.commands.handleButtonDelete(!1),[t]),h=n.$from.node(-1),g=tY.e6[h.type.name],f=(0,tY.Y0)().filter(e=>g.variants.includes(e.key)),x=t3({href:p,linkablePages:i}
1),v=(null==x?void 0:x.docId)&&(null==r?void 0:r.id)&&(0,eJ.yQ)({docId:null==x?void 0:x.docId})||p;return(0,o.jsxs)(K.K,{w:x?void 0:"320px",minW:"min(80vw, 320px)",maxW:"50vw",maxH:"max(30vh, 400px)",children:[(0,o.jsxs)(a.U,{justify:"space-between",pt:1,borderBottomWidth:x?0:1,mx:-2,px:2,children:[f.length>=2&&f.map(e=>{let{name:n,icon:r,key:i}=e;return(0,o.jsx)(E.h,{label:n,icon:r,onClick:()=>{t.commands.updateAttributes("button",{variant:i})},isActive:t.isActive("button",{variant:i})},n)}),g.alignEnabled&&A.Ec.map(e=>{let{name:n,icon:r,checkActive:i,apply:a}=e;if(i&&a)return(0,o.jsx)(E.h,{label:n(),icon:r,onClick:()=>{a(t)},isActive:i(t)},n())}),x&&(0,o.jsx)(t0,{existingLink:x,handleRemoveClick:e=>{s(e),"url"===e&&u(p),t.commands.updateAttributes("button",{href:null})}}),(0,o.jsx)(tk.L,{}),x&&(0,o.jsx)(E.h,{label:(0,o.jsx)(I.cC,{id:"Ky3sBN"}),icon:k.Xjp,onClick:()=>window.open(v,"_blank")}),(0,o.jsx)(z,{editor:t,handleDelete:m})]}),!x&&(0,o.jsx)(t9,{updateHref:e=>{t.commands.updateAttributes("button",{href:e})},initialTab:l,initialHref:d})]})};var t6=n(89064),ne=n(26824),nt=n(99914),nn=n(99137),nr=n(91887),no=n(59322),ni=n(14657),na=n(86323),nl=n(73528),ns=n(44368);(r||(r={})).enabledForTables="enabledForTables";let nd=[{key:"numbered",name:()=>S.ag._({id:"M3G9ZD"}),icon:k.nFo,node:"numbered",checkActive:e=>(0,nl.S3)(e,ns.W.Numbered),shortcut:"1.",apply:e=>e.chain().toggleListItems({variant:ns.W.Numbered}).focus().run()},{key:"bullet",name:()=>S.ag._({id:"ynb7Kh"}),icon:k.gf$,node:"bullet",checkActive:e=>(0,nl.S3)(e,ns.W.Bullet),apply:e=>e.chain().toggleListItems({variant:ns.W.Bullet}).focus().run(),shortcut:"*"},{key:"todo",name:()=>S.ag._({id:"rCIbrq"}),icon:k.A8,node:"todo",checkActive:e=>(0,nl.S3)(e,ns.W.Todo),shortcut:"[]",apply:e=>{let{from:t,to:n}=e.state.selection;e.chain().toggleListItems({variant:ns.W.Todo}).run(),requestAnimationFrame(()=>e.chain().focus().setTextSelection({from:t,to:n}).run())}}],nc=[[{key:"textColor",name:()=>S.ag._({id:"MapzEo"}),icon:k.yGG,shortcut:"Mod+Shift+H",enabledForTables:!0,checkDisabled:p.$v}],[{key:"bold",name:()=>S.ag._({id:"KmydK6"}),mark:"bold",icon:j.c_t,shortcut:"Mod+B",enabledForTables:!0},{key:"italic",name:()=>S.ag._({id:"pzutoc"}),mark:"italic",icon:k.cJz,shortcut:"Mod+I",enabledForTables:!0},{key:"underline",name:()=>S.ag._({id:"YyXtnN"}),mark:"underline",icon:k.jmw,shortcut:"Mod+U",enabledForTables:!0},{key:"strike",name:()=>S.ag._({id:"WhOsNE"}),mark:"strike",icon:k.b$N,shortcut:"Mod+Shift+X"},{key:"code",name:()=>S.ag._({id:"EWPtMO"}),mark:"code",icon:k.dT$,shortcut:"Mod+E"},{key:"math",name:()=>S.ag._({id:"l8rp1O"}),apply:e=>e.commands.convertToMathInline(),icon:k.eDD,featureFlag:"math",shortcut:"$$",checkDisabled:()=>!0},{key:"removeFormatting",name:()=>S.ag._({id:"bj5jMy"}),icon:k.DvJ,apply:e=>e.chain().unsetAllMarks().focus().run(),enabledForTables:!0}],[{key:"link",name:()=>S.ag._({id:"yzF66j"}),mark:"link",icon:k.nNP,shortcut:"Mod+K"},{key:"footnote",name:()=>S.ag._({id:"ONAJuB"}),icon:k.dkK,apply:e=>{(0,na.ZT)((0,na.zm)().footnote,eU.fe.FORMATTING_MENU),e.chain().toggleFootnote().run()},checkActive:e=>e.isActive("footnoteLabel"),shortcut:"Mod+Alt+F",checkDisabled:e=>(0,eg.M)(e)||!(0,ec.P3)(e,"footnote")||(0,p.$v)(e)}],[{key:"alignText",name:()=>S.ag._({id:"6Hkcin"}),icon:k.elf}],[{key:"convertText",name:()=>S.ag._({id:"cXIM1U"}),checkDisabled:p.$v,icon:k.jHE},{key:"rewriteText",name:()=>S.ag._({id:"C4t1b/"}),icon:j.JyM,checkDisabled:p.$v,featureFlag:"aiRewrite"}],[{key:"comment",name:()=>S.ag._({id:"oFsfkI"}),icon:k.Mzg,checkDisabled:e=>(0,eg.M)(e)||(0,p.$v)(e),apply:e=>{let{selection:t}=e.state,{from:n,to:r}=t,[o]=(0,ec.nv)(e.state.doc.resolve(n),(e,t)=>(0,ni.ZM)(t));if(!o){console.warn("[TEXT_FORMATTING_COMMANDS] Add comment - Unable to find annotatable parent for this selection");return}let i=(0,ec.E8)(e.state.doc,n,r,e=>"footnote"!==e.type.name&&"cardNotes"!==e.type.name,"__BLOCK_SEPARATOR_PLACEHOLDER").split("__BLOCK_SEPARATOR_PLACEHOLDER").join("<br /><br />");eq.pw.emit(eq.TI.CREATE_COMMENT_FROM_SELECTION,{selectionPos:n,parentPos:o.pos,text:i})}}]],nu=(e,t)=>{var n;return!!(t.featureFlag&&!eN.VH.get(t.featureFlag)||(null===(n=t.checkDisabled)||void 0===n?void 0:n.call(t,e)))||(t.no
1de?!(0,ec.$E)(e,t.node):!!t.mark&&!(0,ec.by)(e,t.mark))};var np=n(332);let nm=e=>{let{editor:t,testId:n,disabled:r,icon:i,label:a}=e;return((0,eS.p)(),A.Ec.length)?(0,o.jsxs)(D.v,{isLazy:!0,onClose:()=>(0,er.L)(t),children:[(0,o.jsx)(l.kH,{placement:"top",label:a,children:(0,o.jsx)(O.j,{isDisabled:r,as:B.z,variant:"toolbar","data-testid":n,onMouseDown:en.br,rightIcon:(0,o.jsx)(Y.G,{icon:k.ptq,transform:"shrink-6"}),children:i&&(0,o.jsx)(Y.G,{icon:i})})}),(0,o.jsx)(np.h,{children:(0,o.jsx)(F.q,{minW:"auto",children:(()=>{let e=A.Ec.some(e=>{var n;return null===(n=e.checkActive)||void 0===n?void 0:n.call(e,t)});return A.Ec.length&&A.Ec.map(n=>{let{key:r,name:i,shortcut:a,icon:l,checkActive:s,apply:d}=n,c=null==s?void 0:s(t);return e||"alignLeft"!==r||(c=!0),(0,o.jsx)(E.h,{icon:l,label:i(),onClick:()=>null==d?void 0:d(t),isActive:c,testId:r,shortcut:a},r)})})()})})]}):null};var nh=n(69024),ng=n(25481),nf=n(57336),nx=n(13988);let nv=()=>({list:{label:S.ag._({id:"Ci8I/9"})},wrap:{label:S.ag._({id:"T4+jD7"})}}),nb=()=>{let e=(0,na.zm)();return[{key:"toggle",name:()=>S.ag._({id:"JFciKP"}),icon:k.zc,node:"toggle",description:()=>S.ag._({id:"rhfAX6"}),apply:t=>{(0,na.ZT)(e.toggle,eU.fe.FORMATTING_MENU),t.chain().wrapWithToggle().run()},group:"wrap"},{key:"convertToNestedCard",name:()=>S.ag._({id:"lOmsEK"}),node:"card",description:()=>S.ag._({id:"gRMoQV"}),icon:k.uFC,apply:t=>{(0,na.ZT)(e.insertCardInside,eU.fe.FORMATTING_MENU),t.chain().convertToNestedCard().run()},checkDisabled:e=>!e.schema.nodes.card||!(0,ec.P3)(e,"card"),group:"wrap"},{key:"blockquote",name:()=>S.ag._({id:"OLMhPm"}),node:"blockquote",description:()=>S.ag._({id:"2yuhT7"}),icon:k.vV6,shortcut:"> Quote",apply:e=>e.chain().wrapWithAnnotations("blockquote").run(),checkDisabled:e=>!(0,ec.P3)(e,"blockquote"),group:"wrap"},{key:"calloutBox",name:()=>S.ag._({id:"1E4ojF"}),node:"calloutBox",description:()=>S.ag._({id:"4Wf98Z"}),icon:k.sqG,apply:e=>e.chain().wrapWithAnnotations("calloutBox",{variant:"info"}).run(),checkDisabled:e=>!(0,ec.P3)(e,"calloutBox"),group:"wrap"},{key:"listToCards",name:()=>S.ag._({id:"FJ18tL"}),icon:k.s2,description:()=>S.ag._({id:"hWesxP"}),group:"list",apply:e=>e.commands.listToCards(),checkDisabled:e=>!(0,nf.Ah)(e)},...nx.Ne]},ny=e=>{let{editor:t,testId:n,disabled:r,icon:i,label:a}=e,s=nb().filter(e=>e.apply&&!nu(t,e));return 0===s.length?null:(0,o.jsxs)(D.v,{isLazy:!0,onClose:()=>(0,er.L)(t),children:[(0,o.jsx)(l.kH,{placement:"top",label:a,children:(0,o.jsx)(O.j,{isDisabled:r,as:B.z,variant:"toolbar","data-testid":n,onMouseDown:en.br,rightIcon:(0,o.jsx)(Y.G,{icon:k.ptq,transform:"shrink-6"}),children:i&&(0,o.jsx)(Y.G,{icon:i})})}),(0,o.jsx)(np.h,{children:(0,o.jsx)(F.q,{maxH:"min(25em, 45vh)",overflowY:"auto",maxW:"400px",children:Object.entries(nv()).map(e=>{let[n,{label:r}]=e,i=s.filter(e=>e.group===n);return 0===i.length?null:(0,o.jsx)(nh.k,{title:r,children:i.map(e=>{let{key:n,icon:r,name:i,description:a,apply:l}=e;return(0,o.jsxs)(ng.s,{value:n,icon:(0,o.jsx)(Y.G,{icon:r,fixedWidth:!0}),onClick:()=>l(t),"data-testid":"text-convert-menu-".concat(n),children:[(0,o.jsx)(V.x,{children:i()}),a&&(0,o.jsx)(V.x,{color:"gray.400",fontSize:"sm",children:a()})]},n)})},n)})})})]})};var nC=n(3440),nw=n.n(nC);let nk=()=>({rephrase:{label:S.ag._({id:"bKWhYP"})},visualize:{label:S.ag._({id:"6n7jtr"})},reformat:{label:S.ag._({id:"ILEG4I"})}}),nj=[{key:"rephrase.better",type:"rephrase",name:()=>S.ag._({id:"zD3xDw"}),icon:k.Sab,featureFlag:"aiRewrite",description:()=>S.ag._({id:"YePdJg"}),apply:()=>{eq.pw.emit("queueDesignPartnerTask",{message:S.ag._({id:"8nKskd"})})}},{key:"rephrase.expand",type:"rephrase",name:()=>S.ag._({id:"K1q3tl"}),icon:k.eEm,description:()=>S.ag._({id:"Y2Kk1Q"}),apply:()=>{eq.pw.emit("queueDesignPartnerTask",{message:S.ag._({id:"HyVgOT"})})},featureFlag:"aiRewrite"},{key:"rephrase.condense",type:"rephrase",name:()=>S.ag._({id:"rqoYwb"}),icon:k.G_A,description:()=>S.ag._({id:"+ZW8bU"}),apply:()=>{eq.pw.emit("queueDesignPartnerTask",{message:S.ag._({id:"70o6lh"})})},featureFlag:"aiRewrite"},{key:"visualize.keypoints",type:"visualize",name:()=>S.ag._({id:"n+v3I1"}),description:()=>S.ag._({id:"E9axcX"}),icon:k.oJX,node:"smartLayout",apply:()=>{eq.pw.emit("queueDesignPartnerTask",{message:S.ag._({id:"bXgpVx"})})}},{key:"visualize.images",type:"visualize",name:()=>S.ag._({id:"laUyeH"}),description:()=>S.ag._({id:"ADlAam"}),icon:k.l9f,apply:()=>{eq.pw.emit("queueDesignPartnerTask",{message:S.ag._({id:"p2oHY3"})})}},{key:"visualize.timeline",type:"visualize",name:()=>S.ag._({id:"Oh+9k8"}),description:()=>S.ag._({id:"Qx1qQH"}),icon:k.cp3,apply:()=>{eq.pw.emit("queueDesignPartnerTask",{message:S.ag._({id:"4ReFRy"})})}},{key:"reformat.columns",type:"reformat",name:()=>S.ag._({id:"KyPPwt"}),description:()=>S.ag._({id:"52Y/fs"}),icon:k.jNR,node:"gridLayout",apply:()=>{eq.pw.emit("queueDesignPartnerTask",{message:S.ag._({id:"Y0UR8y"})})}},{key:"reformat.table",type:"reformat",name:()=>S.ag._({id:"84sVti"}),description:()=>S.ag._({id:"CxvNve"}),icon:k.B3e,node:"table",apply:()=>{eq.pw.emit("queueDesignPartnerTask",{message:S.ag._({id:"rU0fs4"})})}},{key:"reformat.toggles",type:"reformat",name:()=>S.ag._({id:"aRUmvo"}),icon:k.SG6,node:"toggle",description:()=>S.ag._({id:"914Ln8"}),apply:()=>{eq.pw.emit("queueDesignPartnerTask",{message:S.ag._({id:"rivjMe"})})}}],nS=()=>Object.entries(nw()(nj,"type")),nA=e=>{let{editor:t,testId:n,disabled:r,icon:i,label:a}=e,s=(0,eS.p)();return(0,o.jsxs)(D.v,{isLazy:!0,onClose:()=>(0,er.L)(t),children:[(0,o.jsx)(l.kH,{placement:"top",label:a,children:(0,o.jsx)(O.j,{isDisabled:r,as:B.z,variant:"toolbar","data-testid":n,onMouseDown:en.br,color:"trueblue.500",rightIcon:(0,o.jsx)(Y.G,{icon:k.ptq,transform:"shrink-6"}),children:i&&(0,o.jsx)(Y.G,{icon:i})})}),(0,o.jsx)(np.h,{children:(0,o.jsx)(F.q,{maxH:"min(25em, 45vh)",overflowY:"auto",maxW:"450px",children:nS().map(e=>{let[n,r]=e,{label:i,featureFlag:a}=nk()[n];if(a&&!eN.VH.get(a))return;let l=r.map(e=>{if(!(!e.apply||nu(t,e)))return(0,o.jsxs)(ng.s,{value:e.key,icon:(0,o.jsx)(Y.G,{icon:e.icon,fixedWidth:!0}),onClick:()=>nI(e,t,s),children:[(0,o.jsx)(V.x,{children:e.name()}),e.description&&(0,o.jsx)(V.x,{color:"gray.400",fontSize:"sm",children:e.description()})]},e.key)}
1).filter(Boolean);return l.length?(0,o.jsx)(nh.k,{title:i,children:l},n):null})})})]})},nI=(e,t,n)=>{let{apply:r}=e;if(!r)return;let i=r(t);if(!i)return;let l=n({position:"top",isClosable:!1,duration:null,status:"loading",variant:"subtle",title:(0,o.jsx)(I.cC,{id:"j4ZLea"})});i.then(()=>{n.close(l);let e=n({title:(0,o.jsxs)(a.U,{children:[(0,o.jsxs)(V.x,{noOfLines:1,children:[(0,o.jsx)(I.cC,{id:"hAmdL3"})," "]}),(0,o.jsx)(eA.r,{textDecoration:"underline",onClick:()=>{(0,eI.Yw)(t.state),n.close(e)},children:(0,o.jsx)(I.cC,{id:"9uI/rE"})})]}),status:"success",duration:3e3,position:"top"})}).catch(e=>{n.close(l),n({title:(0,o.jsx)(I.cC,{id:"mTQLsL"}),description:e.message,status:"error",duration:3e3,position:"top"})})};var nE=n(27599),nz=n(98314),nT=n(79786),nN=n(43298);let nM=(e,t)=>!!t&&(e||!t.startsWith("/")),n_=e=>{let{editor:t}=e,n=(0,L.CG)(es.Pu),{bodyFont:r,headingFont:i}=n,l=e=>{t.chain().focus().setFontSize(e).run()},{$from:s}=t.state.selection,d=(0,ec.$E)(t,"heading")||(0,nT.hY)(s.parent).includes("heading"),c=(0,ec.$E)(t,"title")||(0,nT.hY)(s.parent).includes("title"),u=(0,ec.$E)(t,"paragraph")||(0,nT.hY)(s.parent).includes("body");if(!u&&!d&&!c)return null;let p=(0,nT.Zh)(t),m=t.isActive("title")?"title":t.isActive("heading")?"h".concat(t.getAttributes("heading").level):1===p.length&&p[0]||"default",h=(0,nN.hx)(m),g=e=>"".concat(Math.sqrt(e),"em"),f=t.shouldUseLiteMenus,x=!!t.extensionManager.extensions.find(e=>"slashMenu"===e.name);return(0,o.jsxs)(D.v,{closeOnSelect:!0,isLazy:!0,children:[(0,o.jsx)(O.j,{size:"sm",as:B.z,rightIcon:(0,o.jsx)(Y.G,{icon:k.ptq,transform:"shrink-6"}),variant:"toolbar",pl:2,children:h.label}),(0,o.jsxs)(F.q,{maxH:"min(60em, 45vh)",overflowY:"auto",minW:"260px",children:[u&&(0,o.jsx)(em._,{type:"radio",value:m,children:(0,nz.be)().filter(e=>{let[t]=e;return!(f&&"default"!==t)}).map(e=>{let[t,{label:n,size:i,flagged:s,shortcut:d}]=e,c=nM(x,d);return(0,o.jsx)(eh.i,{value:t,onClick:()=>l(t),children:(0,o.jsxs)(a.U,{children:[(0,o.jsx)(V.x,{fontFamily:r,fontSize:g(i),children:n}),c&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(tk.L,{}),(0,o.jsx)(V.x,{color:"gray.400",children:d})]})]})},t)})}),d&&(0,o.jsx)(em._,{type:"radio",value:m,children:(0,nz.B8)().reverse().map(e=>{let[t,{label:n,size:r,shortcut:s}]=e,d=nM(x,s);return(0,o.jsx)(eh.i,{value:t,onClick:()=>l(t),children:(0,o.jsxs)(a.U,{children:[(0,o.jsx)(V.x,{fontSize:g(r),fontWeight:"bold",fontFamily:i,children:n}),d&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(tk.L,{}),(0,o.jsx)(V.x,{color:"gray.400",children:s})]})]})},t)})}),c&&(0,o.jsx)(em._,{type:"radio",value:m,children:(0,nz.Yt)().map(e=>{let[t,{label:n,size:r,shortcut:s}]=e,d=nM(x,s);return(0,o.jsx)(eh.i,{value:t,onClick:()=>l(t),children:(0,o.jsxs)(a.U,{children:[(0,o.jsx)(V.x,{fontSize:g(r),fontWeight:"bold",fontFamily:i,children:n}),d&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(tk.L,{}),(0,o.jsx)(V.x,{color:"gray.400",children:s})]})]})},t)})}),(0,o.jsx)(nE.R,{}),(0,o.jsx)(em._,{type:"radio",value:(()=>{for(let e of nd)if(e.checkActive(t))return e.key;return"none"})(),children:nd.map(e=>{var n;let i=nM(x,e.shortcut);return(0,o.jsx)(eh.i,{value:e.key,isChecked:null===(n=e.checkActive)||void 0===n?void 0:n.call(e,t),onClick:()=>e.apply(t),children:(0,o.jsxs)(a.U,{children:[(0,o.jsx)(Y.G,{fixedWidth:!0,icon:e.icon}),(0,o.jsx)(V.x,{fontFamily:r,children:e.name()}),i&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(tk.L,{}),(0,o.jsx)(V.x,{color:"gray.400",children:e.shortcut})]})]})},e.key)})})]})]})},nL=e=>{let{editor:t,filterBy:n}=e,r=()=>{let e=A.Ec.find(e=>e.alignment===(0,A.ZE)(t));return(null==e?void 0:e.icon)||k.elf};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(ep.h,{isAttached:!0,onMouseDown:en.br,children:(0,o.jsx)(n_,{editor:t})},"text"),nc.map((e,i)=>(0,o.jsx)(ep.h,{spacing:0,size:"sm",onMouseDown:en.br,_empty:{display:"none"},children:e.filter(e=>{let r=!nu(t,e);return n?r&&e[n]:r}).map(e=>{let{key:n,name:i,shortcut:a,icon:l,mark:s,node:d,checkActive:c,apply:u}=e,p=u||(s?e=>e.chain().toggleMark(s).focus().run():()=>{}),m=c?c(t):s?t.isActive(s):d?t.isActive(d):void 0;return"textColor"===n?(0,o.jsx)(ei,{shortcut:a,icon:l,editor:t},n):"rewriteText"===n?(0,o.jsx)(nA,{editor:t,shortcut:a,icon:l,testId:n,label:i()},n):"convertText"===n?(0,o.jsx)(ny,{editor:t,shortcut:a,icon:l,testId:n,label:i()},n):"alignText"===n?(0,o.jsx)(nm,{editor:t,shortcut:a,icon:r(),testId:n,label:i()},n):(0,o.jsx)(E.h,{label:i(),shortcut:a,isActive:m,onClick:()=>p(t),icon:l,testId:n},n)})},i))]})},nP=e=>{let{editor:t,selection:n}=e,i=n.isRowSelection(),l=n.isColSelection(),c=i&&l,u=(0,s.Kk)(no.CU)(n);u&&d.qv.create(t.state.doc,null==u?void 0:u.pos);let p=Math.min(n.$anchorCell.pos,n.$headCell.pos),m=Math.max(n.$anchorCell.pos,n.$headCell.pos),{colMinPercent:h,newCol
1Size:g}=t.schema.nodes[nr.i.name].spec,x=n.getTableNode(),v=(0,nn.Ux)(x.attrs.colWidths,g,h);return(0,o.jsxs)(a.U,{spacing:1,children:[(0,o.jsx)(nL,{editor:t,filterBy:r.enabledForTables}),(0,o.jsx)(M,{}),i&&!c&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(E.h,{label:(0,o.jsx)(I.cC,{id:"1ct6G/"}),onClick:()=>{t.commands.addRowBefore(),requestAnimationFrame(()=>{t.commands.focus(p)})},testId:"add-row-before-button",children:(0,o.jsx)(Y.G,{icon:k.Mp0})}),(0,o.jsx)(E.h,{label:(0,o.jsx)(I.cC,{id:"JUmxSq"}),onClick:()=>{t.commands.addRowAfter(),requestAnimationFrame(()=>{t.chain().focus(m).goToNextCell().run()})},testId:"add-row-after-button",children:(0,o.jsx)(Y.G,{icon:k.Mp0,rotation:180})}),(0,o.jsx)(E.h,{label:(0,o.jsx)(I.cC,{id:"0cspe/"}),icon:k.XAH,onClick:()=>t.chain().focus().deleteRow().run(),color:"red.500",testId:"delete-row-button"})]}),l&&!c&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(E.h,{label:(0,o.jsx)(I.cC,{id:"mwcRkO"}),onClick:()=>{let{left:e}=(0,f.zN)(t.state.selection);t.commands.addColumnBefore(e),requestAnimationFrame(()=>{t.commands.focus(p)})},isDisabled:!v,testId:"add-col-before-button",children:(0,o.jsx)(Y.G,{icon:k.Mp0,rotation:270})}),(0,o.jsx)(E.h,{label:(0,o.jsx)(I.cC,{id:"/93cy4"}),onClick:()=>{let{left:e}=(0,f.zN)(t.state.selection);t.commands.addColumnAfter(e),requestAnimationFrame(()=>{t.chain().focus(p).goToNextCell().run()})},isDisabled:!v,testId:"add-col-after-button",children:(0,o.jsx)(Y.G,{icon:k.Mp0,rotation:90})}),(0,o.jsx)(E.h,{label:(0,o.jsx)(I.cC,{id:"GAohqx"}),icon:k.XAH,onClick:()=>{t.commands.deleteColumn(),requestAnimationFrame(()=>{t.commands.focus(p)})},color:"red.500",testId:"delete-col-button"})]}),c&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(E.h,{label:(0,o.jsx)(I.cC,{id:"SOkhdm"}),icon:k.ZC_,onClick:()=>t.commands.equalizeColumns(),testId:"equalize-columns-button"}),(0,o.jsx)(M,{}),(0,o.jsx)(E.h,{label:(0,o.jsx)(I.cC,{id:"HSI88F"}),icon:k.XAH,onClick:()=>t.chain().focus().deleteTable().run(),color:"red.500",testId:"delete-table-button"})]})]})},nR=[{component:nP,predicate:e=>e instanceof f.Xc&&e.isColSelection(),offsetPx:16},{component:nP,predicate:e=>e instanceof f.Xc&&e.isRowSelection(),offsetPx:12},{component:e=>{var t;let{editor:n,selection:r}=e,i=(0,L.CG)(es.Pu),a=r.node,l=null!==(t=i.accentColor)&&void 0!==t?t:"red";return a?(0,o.jsx)(tf.o,{attributes:a.attrs,updateAttributes:e=>{n.chain().updateAttributes("chart",e).focus().run()},accentColor:l,inline:!0}):null},predicate:e=>{var t,n;return e instanceof d.qv&&(null===(n=e.node)||void 0===n?void 0:null===(t=n.type)||void 0===t?void 0:t.name)==="chart"}},{component:e=>{let{editor:t,selection:n}=e,r=t.getAttributes("link").href||"",i=!t.shouldUseLiteMenus;return(0,o.jsxs)(o.Fragment,{children:[i&&r&&(0,o.jsx)(eb,{editor:t,selection:n}),i&&!n.empty&&(0,o.jsx)(ei,{editor:t}),(0,o.jsx)(ey,{href:r,updateHref:e=>t.commands.updateSurroundingLink(e),unlink:()=>{t.commands.removeSurroundingLink()},editor:t,allowEditMetadata:i&&!(0,R.H7)(r)})]})},predicate:(e,t)=>e instanceof d.Bs&&t.isActive("link")&&!t.multipageEnabled},{component:e=>{let{editor:t,selection:n}=e,r=(0,L.CG)(tZ.lH),i=t.getAttributes("link").href||"",[a,l]=(0,c.useState)("pages"),[s,d]=(0,c.useState)(i),[u,p]=(0,c.useState)(!1),{linkablePages:m}=t2({site:r}),h=t3({href:i,linkablePages:m}
1),g=(null==h?void 0:h.docId)&&(null==r?void 0:r.id)&&(0,eJ.yQ)({docId:null==h?void 0:h.docId})||i,f=m.some(e=>e.docId===(null==h?void 0:h.docId));return(0,o.jsx)(o.Fragment,{children:(0,o.jsxs)(K.K,{direction:"column",minW:"min(80vw, 320px)",maxW:"50vw",maxH:"max(30vh, 400px)",children:[(0,o.jsxs)(K.K,{direction:"row",justify:"space-between",mx:-2,px:2,borderBottom:!i||u?"1px solid var(--chakra-colors-blackAlpha-100)":void 0,children:[i&&(0,o.jsx)(eb,{editor:t,selection:n,isDisabled:!!f}),!n.empty&&(0,o.jsx)(ei,{editor:t}),h&&!u&&(0,o.jsx)(t0,{existingLink:h,handleRemoveClick:e=>{l(e),"url"===e&&d(i),f&&t.commands.updateSurroundingLink(""),p(!0)}}),h&&(0,o.jsx)(E.h,{label:f?(0,o.jsx)(I.cC,{id:"Ky3sBN"}):(0,o.jsx)(I.cC,{id:"Alx2/L"}),icon:k.Xjp,onClick:()=>window.open(g,"_blank")}),(0,o.jsx)(tk.L,{}),(0,o.jsx)(E.h,{label:(0,o.jsx)(I.cC,{id:"484LKL"}),icon:k.AE2,onClick:()=>t.commands.removeSurroundingLink()})]}),(!h||u)&&(0,o.jsx)(t9,{updateHref:e=>{t.commands.updateSurroundingLink(e),p(!1)},initialTab:a,initialHref:s})]})})},predicate:(e,t)=>e instanceof d.Bs&&t.isActive("link")&&!!t.multipageEnabled},{component:e=>{let{editor:t}=e,n=t.getAttributes("button").href||"",r=(0,c.useCallback)(()=>t.commands.handleButtonDelete(!1),[t]);return(0,o.jsxs)(a.U,{px:2,children:[eC().map(e=>{let{name:n,icon:r,key:i}=e;return(0,o.jsx)(E.h,{label:n,icon:r,onClick:()=>{t.commands.updateAttributes("button",{variant:i})},isActive:t.isActive("button",{variant:i})},n)}),(0,o.jsx)(M,{}),A.Ec.map(e=>{let{name:n,icon:r,checkActive:i,apply:a}=e;if(i&&a)return(0,o.jsx)(E.h,{label:n(),icon:r,onClick:()=>{a(t)},isActive:i(t)},n())}),(0,o.jsx)(ey,{href:n,updateHref:e=>t.commands.updateAttributes("button",{href:e}),editor:t,allowEditMetadata:!1}),(0,o.jsx)(M,{}),(0,o.jsx)(z,{editor:t,handleDelete:r})]})},predicate:(e,t)=>t.isActive("button")&&!t.multipageEnabled&&!t.isSiteNavbarEditor},{component:t7,predicate:(e,t)=>t.isActive("button")&&!!t.multipageEnabled},{component:e=>{let{editor:t,selection:n}=e,{node:r,from:i}=n,a=e=>!!r&&JSON.stringify(e)===JSON.stringify(r.attrs.colWidths),{verticalAlign:l}=t.getAttributes("gridCell"),s=(0,c.useCallback)(e=>{t.chain().updateAttributes("gridCell",{verticalAlign:e===l?null:e}).selectNodeAtPos(n.from).focus().run()},[t,n,l]);return(0,o.jsx)(o.Fragment,{children:(0,o.jsxs)(ep.h,{spacing:1,size:"sm",alignItems:"center",children:[(0,o.jsxs)(tH.Lt,{isLazy:!0,children:[(0,o.jsx)(tH.PS,{as:B.z,variant:"toolbar",rightIcon:(0,o.jsx)(Y.G,{icon:k.ptq}),size:"sm","data-testid":"layout-preset-dropdown",children:(0,o.jsx)(I.cC,{id:"6v+N4U",values:{0:r.childCount}})}),(0,o.jsx)(tH.sV,{"data-in-editor-focus":!0,fontSize:"md",children:tK().map(e=>{let{testId:n,name:r,image:l,value:s}=e;return(0,o.jsx)(tH.hP,{"data-testid":n,icon:a(s)?(0,o.jsx)(H.n,{w:"2rem"}):(0,o.jsx)(tn.E,{h:"1rem",w:"2rem",objectFit:"cover",src:l.src}),onClick:()=>{i&&t.commands.useLayoutPreset(i,s)},children:r},r)})})]}),(0,o.jsx)(E.h,{onClick:()=>s("start"),isActive:"start"===l,label:S.ag._({id:"/Q0jUh"}),children:(0,o.jsx)(tB.dBc,{})}),(0,o.jsx)(E.h,{onClick:()=>s("center"),isActive:"center"===l,label:S.ag._({id:"QhuQN2"}),children:(0,o.jsx)(tB.RyY,{})}),(0,o.jsx)(E.h,{onClick:()=>s("end"),isActive:"end"===l,label:S.ag._({id:"EPnxoe"}),children:(0,o.jsx)(tB.pgY,{})}),(0,o.jsx)(M,{}),(0,o.jsx)(z,{editor:t})]})})},predicate:e=>e instanceof d.qv&&(0,m.SA)(e.node)},{component:e=>{let{editor:t,selection:n,decorations:r}=e,{node:i,from:l}=n,{attrs:s,isNested:d,isFirstCard:u}=(0,e_.v)({node:i,decorations:r,editor:t}),{isOpen:p,onOpen:m,onClose:h}=(0,eM.M)({id:"downloadCardAsImageDisclosure"}),g=(0,eN.ye)("exportCard"),f=(0,c.useCallback)(()=>{null==t||t.commands.duplicateCard(l)},[t,l]),x=(0,c.useCallback)(()=>{null==t||t.commands.unnestCard(l)},[t,l]),v=(0,c.useCallback)(()=>{null==t||t.chain().mergeCardsAtPos(l).focus().run()},[t,l]),b=(0,eS.p)(),y=(0,c.useCallback)(()=>{let e=t.state.doc.nodeAt(l),n=e&&(0,eE.getCardTitle)(e.toJSON());t.chain().deleteCard(l).focus().run();let r=S.ag._({id:"0MWv65",values:{displayTitle:n?'"'.concat(n,'"'):"card"}}),i=S.ag._({id:"9uI/rE"}),s=b({title:(0,o.jsxs)(a.U,{children:[(0,o.jsx)(V.x,{noOfLines:1,children:r}),(0,o.jsx)(eA.r,{textDecoration:"underline",onClick:()=>{(0,eI.Yw)(t.state),b.close(s)},children:i})]}),status:"info",duration:3e3,position:"top"})},[t,l,b]),C=(0,eN.ye)("aiCardDesigner"),w=(0,c.useCallback)(()=>{var e;let t=null===(e=n.node)||void 0===e?void 0:e.attrs.id;if(!t)return;let r=prompt("What do you want to change?",eT.B);r&&ez.T.emit("openSuggestionEditor",{cardId:t,userMessage:r})},[n]);return(0,o.jsx)(o.Fragment,{children:(0,o.jsxs)(ep.h,{spacing:1,size:"sm",alignItems:"center",children:[(0,o.jsx)(E.h,{label:(0,o.jsx)(I.cC,{id:"BTDPLo"}),testId:"duplicate-card",onClick:f,icon:k.WM4}),d&&(0,o.jsx)(E.h,{label:(0,o.jsx)(I.cC,{id:"b+J8Wt"}),testId:"merge-into-parent-card",onClick:x,icon:k.oK7}),!d&&!u&&(0,o.jsx)(E.h,{label:(0,o.jsx)(I.cC,{id:"kV34zB"}),testId:"merge-into-card-above",onClick:v,icon:k.FPD}),C&&(0,o.jsx)(E.h,{onClick:w,icon:k.Hh4,label:"Design with AI"}),(0,o.jsx)(eQ,{attrs:s}),g&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(E.h,{label:(0,o.jsx)(I.cC,{id:"xRJ+bN"}),testId:"download-card",onClick:m,icon:k.fuY}),(0,o.jsx)(e$,{isOpen:p,onClose:h,cardId:s.id,editor:t})]}),(0,o.jsx)(z,{editor:t,handleDelete:y})]})})},predicate:e=>{let t=e instanceof d.qv&&(0,x.KH)(e.node);return t},offsetPx:0},{component:e=>{var t,n;let{editor:r,selection:i,decorations:a}=e,{node:d,from:p}=i,m=(0,e3.en)(a),h=d.attrs,{allowFit:g}=(0,u.$U)(null==m?void 0:m.layout),f=(null===(t=h.background)||void 0===t?void 0:t.type)===e4.E.IMAGE,v=(0,e2.U)(
1h,null==m?void 0:m.layout),b=(0,eN.ye)("accentImageFit"),y=b&&g&&f,C=(0,L.CG)(es.Pu),w=null===(n=C.config)||void 0===n?void 0:n.accentBackgrounds,j=(0,u.q9)(h.background,w),A=(0,c.useRef)(j),E=(0,s.qv)(r.state.doc.resolve(p),x.KH),z=(0,c.useCallback)(e=>{(0,er.y)(r,p,e)},[r,p]),T=(0,c.useCallback)(()=>{w&&(r.commands.updateNestedAttributesAtPos(p,{background:w[A.current]}),A.current=(A.current+1)%w.length)},[w,r,p]),{openBackgroundTab:N,..._}=(0,e1.a)(),P=(0,c.useCallback)(()=>{p&&(f?r.commands.updateAttributesAtPos(p,{background:{type:e4.E.NONE}}):(null==E?void 0:E.pos)&&(r.commands.setCardLayout(E.pos,"blank"),r.commands.selectInsideCardBody(E.pos)))},[r,p,E,f]),R=d.attrs.background.type,H=R===e4.E.IMAGE&&"fill"===v;return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(e1.S,{editor:r,..._,updateNestedAttributes:z,background:h.background,isAccentImageDrawer:!0}),(0,o.jsx)(ep.h,{spacing:1,size:"sm",alignItems:"center",children:"accent"===h.itemId&&(0,o.jsxs)(o.Fragment,{children:[y&&(0,o.jsx)(e5,{editor:r,selection:i,decorations:a}),H&&(0,o.jsx)(tg,{editor:r,pos:p,node:d}),(0,o.jsx)(M,{}),w&&w.length>0&&(0,o.jsx)(l.kH,{label:(0,o.jsx)(I.cC,{id:"OVjfHO"}),children:(0,o.jsx)(e0.h,{onClick:T,variant:"toolbar",size:"sm",icon:(0,o.jsx)(Y.G,{icon:k.RJo}),boxSize:7,p:0,"aria-label":S.ag._({id:"gH5Gbn"})})}),(0,o.jsx)(l.kH,{label:f?(0,o.jsx)(I.cC,{id:"Ov693i"}):(0,o.jsx)(I.cC,{id:"B6vyEa"}),children:(0,o.jsx)(e0.h,{onClick:N,variant:"toolbar",size:"sm",icon:(0,o.jsx)(Y.G,{icon:k.VmB}),boxSize:7,p:0,"aria-label":f?S.ag._({id:"Ov693i"}):S.ag._({id:"B6vyEa"})})}),(0,o.jsx)(M,{}),(0,o.jsx)(l.kH,{label:f?(0,o.jsx)(I.cC,{id:"sGYCGx"}):(0,o.jsx)(I.cC,{id:"6vLq+T"}),placement:"top",children:(0,o.jsx)(e0.h,{onClick:P,variant:"toolbar",size:"sm",icon:f?(0,o.jsx)(Y.G,{icon:k.qDv}):(0,o.jsx)(Y.G,{icon:k.XAH}),color:"red.500",boxSize:7,p:0,"aria-label":f?S.ag._({id:"sGYCGx"}):S.ag._({id:"6vLq+T"})})})]})})]})},predicate:e=>{let t=e instanceof d.qv&&(0,u.pt)(e.node);return t},offsetPx:6},{component:e=>{let{editor:t,selection:n}=e,r=n.$from.parent,i=r.childCount<tF.h,{verticalAlign:a}=n.node.attrs,l=(0,c.useCallback)(e=>{t.chain().updateAttributes("gridCell",{verticalAlign:e===a?null:e}).selectNodeAtPos(n.from).focus().run()},[t,a,n]);return(0,o.jsxs)(ep.h,{spacing:1,size:"sm",alignItems:"center",children:[(0,o.jsx)(tR,{editor:t,label:S.ag._({id:"NFoeBH"}),icon:k.rWw}),i&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(M,{}),(0,o.jsx)(E.h,{label:S.ag._({id:"bZ9ges"}),icon:k.Mp0,iconRotation:270,onClick:()=>{t.chain().insertContentAt(n.from,tF.x).run()},testId:"add-col-before-button"}),(0,o.jsx)(E.h,{label:S.ag._({id:"7ibPpM"}),icon:k.Mp0,iconRotation:90,onClick:()=>{t.chain().insertContentAt(n.from+n.node.nodeSize,tF.x).run()},testId:"add-col-after-button"}),(0,o.jsx)(tW,{editor:t,selection:n})]}),(0,o.jsx)(E.h,{onClick:()=>l("start"),isActive:"start"===a,label:S.ag._({id:"/Q0jUh"}),children:(0,o.jsx)(tB.dBc,{})}),(0,o.jsx)(E.h,{onClick:()=>l("center"),isActive:"center"===a,label:S.ag._({id:"QhuQN2"}),children:(0,o.jsx)(tB.RyY,{})}),(0,o.jsx)(E.h,{onClick:()=>l("end"),isActive:"end"===a,label:S.ag._({id:"EPnxoe"}),children:(0,o.jsx)(tB.pgY,{})}),(0,o.jsx)(M,{}),(0,o.jsx)(z,{editor:t,handleDelete:()=>{t.chain().selectInsideNodeAtPos(n.from).handleLayoutDelete(!0,!1).run()}})]})},predicate:e=>e instanceof d.qv&&(0,m._5)(e.node)},{component:e=>{let{editor:t,selection:n,decorations:r}=e,{node:i}=n,{options:l,variantKey:s}=i.attrs,d=(0,t6.P)(s),u=(0,c.useCallback)(e=>{t.commands.updateNestedAttributesAtPos(n.from,e)},[t,n.from]),p=(0,c.useCallback)(e=>{u({variantKey:e})},[u]);return(0,o.jsxs)(a.U,{spacing:2,children:[(0,o.jsxs)(tH.Lt,{isLazy:!0,children:[(0,o.jsx)(tH.PS,{as:B.z,variant:"toolbar",rightIcon:(0,o.jsx)(Y.G,{icon:k.ptq,transform:"shrink-6"}),leftIcon:(0,o.jsx)(Y.G,{icon:d.icon,fixedWidth:!0}),size:"sm","data-testid":"smart-layout-variant-dropdown",children:d.name()}),(0,o.jsx)(tH.sV,{maxH:"min(25em, 45vh)",overflowY:"auto","data-in-editor-focus":!0,fontSize:"md",children:(0,t6.m)().map(e=>{let{key:t,name:n,icon:r,disabled:i,featureFlag:a}=e;if(i||a&&!eN.VH.get(a))return null;let l=s===t;return(0,o.jsx)(tH.hP,{"data-test-variant-option":t,icon:l?(0,o.jsx)(H.n,{}):(0,o.jsx)(Y.G,{icon:r,fixedWidth:!0}),onClick:()=>p(t),children:n()},t)})})]}),(0,o.jsx)(M,{}),(0,o.jsx)(ep.h,{size:"sm",children:d.options.map(e=>{var a;let s=(0,nt.Xo)(r);if(e.checkEnabled&&!e.checkEnabled(i.attrs,s))return null;let d=null!==(a=l[e.key])&&void 0!==a?a:e.defaultValue;
1return(0,o.jsx)(e.Control,{value:d,updateValue:(r,o)=>{u({options:{...l,[e.key]:r}}),o&&i.forEach((o,i)=>{t.commands.updateNestedAttributesAtPos(n.from+i+1,{options:{...o.attrs.options,[e.key]:r}})})},editor:t,option:e},e.key)})}),(0,o.jsx)(M,{}),(0,o.jsx)(z,{editor:t})]})},predicate:e=>e instanceof d.qv&&(0,g.G)(e.node)},{component:e=>{let{editor:t,selection:n}=e,{node:r,from:i}=n,a=n.$from.parent,l=(0,c.useCallback)(()=>{t.chain().insertSmartLayoutCell(n.from).run()},[t,n.from]),s=(0,c.useCallback)(()=>{t.chain().insertSmartLayoutCell(n.from+n.node.nodeSize).run()},[t,n.from,n.node]),{options:d,image:u}=n.node.attrs,p=(0,c.useCallback)(e=>{t.commands.updateNestedAttributesAtPos(n.from,e)},[t,n.from]),m=(0,c.useCallback)(()=>{t.chain().handleSmartLayoutDelete().run()},[t]);if(!a||!(0,g.G)(a))return console.error("SmartLayoutCellFormattingMenu: parent is not a smartLayout"),null;let h=(0,ne.yU)(a.attrs),f=(0,t6.P)(a.attrs.variantKey),x=(0,C.zd)((null==u?void 0:u.src)||(null==u?void 0:u.tempUrl)),v="imagesText"===f.key&&!x&&(null==u?void 0:u.src);return(0,o.jsxs)(ep.h,{spacing:1,size:"sm",alignItems:"center",children:[(0,o.jsx)(tR,{editor:t,label:S.ag._({id:"NFoeBH"}),icon:f.icon}),(0,o.jsx)(M,{}),v&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(tg,{editor:t,pos:i,node:r}),(0,o.jsx)(M,{})]}),(0,o.jsx)(E.h,{label:S.ag._({id:"w7mkyz"}),iconRotation:"bottom"===h?void 0:270,icon:k.Mp0,onClick:l,testId:"add-col-before-button"}),(0,o.jsx)(E.h,{label:S.ag._({id:"1e37Dl"}),icon:k.Mp0,iconRotation:"bottom"===h?180:90,onClick:s,testId:"add-col-after-button"}),(0,o.jsx)(tW,{editor:t,selection:n}),f.cellOptions.length>0?(0,o.jsx)(M,{}):null,(0,o.jsx)(ep.h,{size:"sm",children:f.cellOptions.map(e=>{var n;if(e.checkEnabled&&!e.checkEnabled(r.attrs))return null;let i=null!==(n=d[e.key])&&void 0!==n?n:e.defaultValue;return(0,o.jsx)(e.Control,{value:i,updateValue:t=>{p({options:{...d,[e.key]:t}})},editor:t,option:e},e.key)})}),(0,o.jsx)(M,{}),(0,o.jsx)(z,{editor:t,handleDelete:m})]})},predicate:e=>e instanceof d.qv&&(0,g.E)(e.node)},{component:e=>{let{selection:t,editor:n}=e,r=0===t.node.childCount,i=t.node.attrs.thumbHeight||tT.vf,l=(0,c.useCallback)(e=>{n.chain().updateAttributes("gallery",{thumbHeight:e}).setNodeSelection(t.from).focus().run()},[n,t.from]);return(0,o.jsxs)(a.U,{spacing:2,mr:2,children:[!r&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(V.x,{fontSize:"sm",fontWeight:"600",children:(0,o.jsx)(I.cC,{id:"Cj2Gtd"})}),(0,o.jsxs)(tz.iR,{"aria-label":"gallery-slider",min:5,max:15,step:.25,value:i,onChange:l,w:"120px",focusThumbOnChange:!1,colorScheme:"trueblue",size:"sm",children:[(0,o.jsx)(tz.Uj,{children:(0,o.jsx)(tz.Ms,{})}),(0,o.jsx)(tz.gs,{background:"trueblue.500"})]}),(0,o.jsx)(M,{}),(0,o.jsx)(ep.h,{spacing:0,size:"sm",onMouseDown:en.br,_empty:{display:"none"},children:A.Ec.map(e=>{let{key:r,name:i,shortcut:a,icon:l,apply:s,checkActive:d}=e;return n&&s&&d?(0,o.jsx)(E.h,{shortcut:a,icon:l,label:i(),onClick:e=>{s(n),n.chain().setNodeSelection(t.from).run()},isActive:d(n),testId:r},r):null})}),(0,o.jsx)(M,{})]}),(0,o.jsx)(z,{editor:n})]})},predicate:e=>e instanceof d.qv&&(0,h.N5)(e.node)},{component:e=>{let{editor:t,selection:n}=e,r=n.node.attrs;return(0,o.jsxs)(ep.h,{spacing:2,size:"sm",flex:"row",alignItems:"center",children:[(0,o.jsx)(ek,{editor:t,attrs:r,selection:n}),(0,o.jsx)(ej.E,{color:r.color||void 0,setColor:e=>{t.chain().focus().updateAttributes("calloutBox",{color:e}).selectNodeAtPos(n.from).run()},editor:t,analyticsSource:"CalloutBox"}),(0,o.jsx)(M,{}),(0,o.jsx)(z,{editor:t})]})},predicate:e=>e instanceof d.qv&&"calloutBox"===e.node.type.name},{component:e=>{let{editor:t,selection:n}=e,r=n.node.type.name,{fullWidthBlock:i}=t.getAttributes(r),a=(0,c.useCallback)(e=>{var n,r;e.stopPropagation(),null===(n=(r=t.commands).editSelectedDrawingBlock)||void 0===n||n.call(r)},[t]);return(0,o.jsxs)(ep.h,{spacing:0,size:"sm",alignItems:"center",children:[A.Ec.map(e=>{let{name:n,icon:a,checkActive:l,apply:s}=e;if(l&&s)return(0,o.jsx)(E.h,{label:n(),icon:a,onClick:()=>{s(t),i&&t.commands.updateAttributes(r,{fullWidthBlock:!1})},isActive:!i&&l(t)},n())}),(0,o.jsx)(E.h,{label:(0,o.jsx)(I.cC,{id:"ePK91l"}),icon:k.TzT,onClick:a}),(0,o.jsx)(M,{}),(0,o.jsx)(z,{editor:t})]})},predicate:e=>
1e instanceof d.qv&&("drawing"===e.node.type.name||"diagram"===e.node.type.name)},{component:e=>{let{editor:t,selection:n}=e,r=n.node.type.name,i=r===t_.Ee.name,{resize:l,fullWidthBlock:s,id:d}=n.node.attrs,u=(0,L.CG)(t_.Ig),p=(0,L.CG)((0,t_.v_)(d));(0,L.TL)();let m=!tM()({resize:l},{resize:t_.OT}),h=!!((null==l?void 0:l.clipPath)&&(null==l?void 0:l.clipType)),{setCropClipType:g,confirmCrop:f,cancelCrop:x,startCrop:v,resetCrop:b}=(0,tL.k)(t),y=(0,eu.B)(),C=(0,c.useCallback)(e=>{y(!0),e.stopPropagation()},[y]),{enterZoom:w}=(0,ex.d8)(n.node.attrs.id),j=(0,c.useCallback)(()=>{(0,tP.rR)(n)},[n]),T=(0,eg.M)(t),N=(0,tP.u5)(n.$from),_=!N&&!T;return(0,o.jsxs)(a.U,{spacing:0,children:[_&&(0,o.jsxs)(o.Fragment,{children:[p?(0,o.jsx)(tO,{clipType:u,onChange:e=>{g({clipType:e})}}):(0,o.jsx)(o.Fragment,{children:A.Ec.map(e=>{let{name:n,icon:i,checkActive:a,apply:d}=e;if(a&&d)return(0,o.jsx)(E.h,{label:n(),icon:i,onClick:()=>{d(t),s&&t.commands.updateAttributes(r,{fullWidthBlock:!1,resize:{...l,width:null}})},isActive:!s&&a(t)},n())})}),(0,o.jsx)(M,{})]}),(0,o.jsxs)(ep.h,{spacing:0,size:"sm",alignItems:"center",children:[p?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(E.h,{label:(0,o.jsx)(I.cC,{id:"6Z0nnS"}),icon:k.XnX,isDisabled:!h,onClick:()=>{b({id:d})}}),(0,o.jsx)(E.h,{color:"red.500",label:(0,o.jsx)(I.cC,{id:"7Bn152"}),icon:k.g82,onClick:()=>{x({id:d})}}),(0,o.jsx)(E.h,{color:"green.500",label:(0,o.jsx)(I.cC,{id:"ryQtQS"}),icon:k.LEp,onClick:()=>{f({id:d})}})]}):(0,o.jsxs)(o.Fragment,{children:[i&&(0,o.jsx)(E.h,{label:(0,o.jsx)(I.cC,{id:"ACjxWW"}),icon:k.q9v,onClick:w}),i&&!T&&(0,o.jsx)(E.h,{label:(0,o.jsx)(I.cC,{id:"oFsfkI"}),icon:k.Mzg,onClick:j}),i&&_&&(0,o.jsx)(E.h,{label:(0,o.jsx)(I.cC,{id:"qKx+US"}),icon:k._nR,isActive:p,onClick:()=>{v({id:d,clipType:null==l?void 0:l.clipType})}}),i&&_&&(0,o.jsx)(E.h,{label:(0,o.jsx)(I.cC,{id:"5eaf8Z"}),icon:k.XnX,isDisabled:!m,onClick:()=>{t.chain().resetImageClip().resetImageScale().command(e=>{var t;let{commands:n}=e;return!!(null===(t=n.refreshBubbleMenu)||void 0===t?void 0:t.call(n))}).run()}}),N&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(tR,{editor:t,label:S.ag._({id:"+v0hYZ"}),icon:k.emM}),(0,o.jsx)(M,{})," "]}),(0,o.jsx)(E.h,{label:(0,o.jsx)(I.cC,{id:"ePK91l"}),icon:k.TzT,onClick:C,testId:"edit-button"})]}),!p&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(M,{}),(0,o.jsx)(z,{editor:t})]})]})]})},predicate:e=>e instanceof d.qv&&("image"===e.node.type.name||"mediaPlaceholder"===e.node.type.name)},{component:e=>{let{editor:t,selection:n}=e,r=(0,eu.B)(),i=(0,c.useCallback)(e=>{r(!0),e.stopPropagation()},[r]),a=(0,eg.M)(t),l=(0,h.u5)(n.$from),s=(0,c.useCallback)(()=>{(0,h.rR)(n)},[n]),{enterZoom:d}=(0,ex.d8)(n.node.attrs.id);return(0,o.jsxs)(ep.h,{spacing:0,size:"sm",alignItems:"center",children:[!l&&(0,o.jsx)(eb,{editor:t,selection:n}),(0,o.jsx)(E.h,{label:(0,o.jsx)(I.cC,{id:"ACjxWW"}),icon:k.q9v,onClick:d}),!a&&(0,o.jsx)(E.h,{label:(0,o.jsx)(I.cC,{id:"oFsfkI"}),icon:k.Mzg,onClick:s}),(0,o.jsx)(E.h,{label:(0,o.jsx)(I.cC,{id:"ePK91l"}),icon:k.TzT,onClick:i}),(0,o.jsx)(M,{}),(0,o.jsx)(z,{editor:t})]})},predicate:e=>e instanceof d.qv&&(0,C.Bp)(e.node)},{component:e=>{let{editor:t,selection:n}=e,{nested:r}=n.node.attrs;return(0,o.jsxs)(ep.h,{spacing:0,size:"sm",children:[(0,o.jsx)(E.h,{testId:"toc-top-level-cards",label:(0,o.jsx)(I.cC,{id:"RiLgqi"}),icon:k.Zrf,onClick:()=>{t.commands.updateAttributes("tableOfContents",{nested:!1})},isActive:!r}),(0,o.jsx)(E.h,{testId:"toc-nested-cards",label:(0,o.jsx)(I.cC,{id:"nTkST4"}),icon:k.vp0,onClick:()=>{t.commands.updateAttributes("tableOfContents",{nested:!0})},isActive:r})]})},predicate:e=>e instanceof d.qv&&"tableOfContents"===e.node.type.name},{component:e=>{let{editor:t}=e,{showTime:n,hiddenContributorIds:r}=t.getAttributes("contributors"),i=(0,L.CG)(es.xy)||[],{toggleShowTime:a,toggleOneVisibleContributor:l,toggleAllVisibleContributors:s}=function(e){let t=(0,c.useCallback)(()=>{e.commands.toggleShowTime()},[e]),n=(0,c.useCallback)(t=>{e.commands.toggleOneContributorVisibility(t)},[e]),r=(0,c.useCallback)(()=>{e.commands.toggleAllContributorsVisibility()},[e]);return{toggleShowTime:t,toggleOneVisibleContributor:n,toggleAllVisibleContributors:r}}(t),d=i.length>1;return(0,o.jsxs)(K.K,{direction:"column",width:"320px",height:"100%",bgColor:"white",borderRadius:"xl",marginLeft:"-8px",marginRight:"-8px",paddingY:2,spacing:3,overflow:"hidden",children:[(0,o.jsx)(ty,{label:(0,o.jsx)(V.x,{children:(0,o.jsx)(I.cC,{id:"p/78dY"})}),children:(0,o.jsx)(tC,{editor:t})}),(0,o.jsx)(ty,{label:(0,o.jsx)(V.x,{children:(0,o.jsx)(I.cC,{id:"4ep6pq"})}),children:(0,o.jsx)(tx.r,{isChecked:n,onChange:a})}),d&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(tA,{}),(0,o.jsx)(tI,{contributors:i,hasMultipleContributors:d,hiddenContributorIds:r,toggleOneVisibleContributor:l,toggleAllVisibleContributors:s})]}),(0,o.jsx)(tA,{}),(0,o.jsx)(tE,{editor:t})]})},predicate:e=>
1e instanceof d.qv&&"contributors"===e.node.type.name},{component:nL,predicate:e=>e instanceof d.Bs}],nH=[{component:t7,predicate:(e,t)=>{var n,r,o,i;return(!!(null===(r=document)||void 0===r?void 0:null===(n=r.activeElement)||void 0===n?void 0:n.closest('[data-active-menu="navigation"]'))||!!(null===(i=document)||void 0===i?void 0:null===(o=i.activeElement)||void 0===o?void 0:o.closest("[data-navbar-editor]")))&&t.isActive("button")&&!!t.isSiteNavbarEditor&&!t.multipageEnabled}}],nD={border:"1px solid",borderColor:"gray.200",backdropFilter:"blur(20px)",backgroundColor:"#F9FAFBEE",shadow:"lg"},nO=e=>{let{editor:t,scrollingParentSelector:n,menuContext:r}=e;(0,w.F1)(t);let{hideTooltips:d,GammaTooltipHiderContext:u}=(0,l.o5)(),m=t.state.selection,h=("navigation"===r?nH:nR).find(e=>e.predicate(m,t)),g=[];try{(0,s.EG)(t.state.selection)&&(g=(0,x.su)(t,t.state.selection.from))}catch(e){console.error("[FormattingMenu] unable to find decorations at ".concat(t.state.selection.from),e.message)}let f=(0,c.useMemo)(()=>({maxWidth:"none",zIndex:"var(--chakra-zIndices-popover)",placement:"top",popperOptions:{modifiers:[{name:"flip",options:{fallbackPlacements:["top","bottom","right-start","left-start","right-end","left-end"]}},{name:"preventOverflow",options:{boundary:n?document.querySelector(n):void 0}}]}}),[n]),v=(0,p.$v)(t),b=v?document.querySelector("[data-card-notes-bubble-menu-target]"):null;return(0,o.jsx)(u,{children:(0,o.jsx)(y,{editor:t,onHide:d,tippyOptions:f,targetElement:b,children:h&&(0,o.jsx)(i.xu,{"data-active-menu":"navigation"===r?"navigation":"editor",borderRadius:"xl",...nD,w:"auto",minW:"0px",h:"fit-content",position:"relative",bottom:h.offsetPx?"".concat(h.offsetPx,"px"):"0","data-in-editor-focus":!0,"data-testid":"formatting-menu",children:(0,o.jsx)(a.U,{spacing:3,px:2,minH:10,children:(0,o.jsx)(h.component,{editor:t,selection:m,decorations:g})})})})})}},42487:function(e,t,n){"use strict";n.d(t,{L:function(){return o},y:function(){return i}});var r=n(13793);let o=e=>{setTimeout(()=>{e.commands.focus()})},i=(e,t,n)=>{var o;(null===(o=n.background)||void 0===o?void 0:o.type)===r.E.NONE?e.commands.updateAttributesAtPos(t,n):e.commands.updateNestedAttributesAtPos(t,n)}},67261:function(e,t,n){"use strict";n.d(t,{LT:function(){return _},Nb:function(){return N}});var r=n(52322),o=n(50019),i=n(43297),a=n(38035),l=n(75009),s=n(28535),d=n(82554),c=n(77533),u=n(43679),p=n(34071),m=n(32899),h=n(332),g=n(39429),f=n(69251),x=n(42946),v=n(54933),b=n(49929),y=n(94523),C=n(5879),w=n(87254),k=n(2784),j=n(11050),S=n(86323),A=n(33169),I=n(66028),E=n(9726),z=n(11093),T=n(85e3);let N=e=>{let{item:t}=e,{name:n,image:u,icon:p,previewImage:m,shortcut:h,badge:g}=t,f={iconColor:(0,o.ff)("trueblue.600","trueblue.100"),bgColor:(0,o.ff)("white","gray.900"),textColor:(0,o.ff)("gray.800","gray.100"),borderColor:(0,o.ff)("gray.200","gray.700"),invertFilter:(0,o.ff)("invert(0)","invert(.7) brightness(1.2)"),iconBgColor:(0,o.ff)("white","gray.800"),gripDotsColor:(0,o.ff)("gray.500","gray.500")};return(0,r.jsxs)(i.K,{h:"100%",bg:f.bgColor,p:2.5,pt:2,spacing:1.5,alignItems:"center",shadow:"sm",borderRadius:"xl",border:"1px",borderColor:f.borderColor,role:"group",children:[(0,r.jsx)(a.k,{justifyContent:"center",alignItems:"center",minH:"7",w:"100%",children:m?(0,r.jsx)(a.k,{bg:f.iconBgColor,borderRadius:"md",children:(0,r.jsx)(l.E,{filter:f.invertFilter,src:m.src,w:"100%",maxW:"100%",alt:n()})}):u?(0,r.jsx)(l.E,{src:u.src,borderRadius:"sm",h:"1.5em",w:"1.5em",objectFit:"contain"}):(0,r.jsx)(s.xu,{color:f.iconColor,fontSize:"xl",children:p&&(0,r.jsx)(b.G,{icon:p})})}),g&&(0,r.jsx)(d.C,{position:"absolute",top:"1",right:"2",colorScheme:"green",children:g()}),(0,r.jsxs)(i.K,{spacing:0,whiteSpace:"break-spaces",flex:"1",textAlign:"center",children:[(0,r.jsx)(c.x,{color:f.textColor,fontWeight:"600",fontSize:"xs",lineHeight:1.2,noOfLines:2,children:n()}),h&&(0,r.jsx)(c.x,{fontSize:"xs",color:"gray.500",fontWeight:"500",children:h})]})]})},M=e=>{let{item:t,onDragStart:n,onDragEnd:a,onClick:l}=e,{isDragging:d,isMouseDown:u,handleDragStart:p,handleDragEnd:m,handleClick:h,onMouseDown:g,onMouseUp:f}=(0,T.D)(n,a,l),{key:k,description:j}=t,S={gripDotsBg:(0,o.ff)("white","gray.900"),gripDotsColor:(0,o.ff)("gray.500","gray.500")};return(0,r.jsx)(y.kH,{closeOnMouseDown:!0,closeOnClick:!0,isOpen:!d&&void 0,label:(0,r.jsxs)(s.xu,{as:"span",display:"inline",children:[(0,r.jsx)(b.G,{icon:x.ioV})," ",(0,r.jsx)(c.x,{display:"inline",children:(0,r.jsx)(C.cC,{id:"Dd9uag"})}),j&&(0,r.jsx)(c.x,{textAlign:"left",color:"gray.300",maxW:"170px",children:j()})]}),"aria-label":w.ag._({id:"Dd9uag"}),placement:"top",children:(0,r.jsxs)(i.K,{"data-testid":"".concat(k,"-insert-button"),draggable:!0,onDragStart:p,onDragEnd:m,onClick:h,onMouseDown:g,onMouseUp:f,onMouseLeave:f,cursor:"grab",_hover:{transform:"scale(1.05) rotate(-0.25deg)",shadow:"lg"},transitionProperty:"common",transitionDuration:"normal",transform:"rotate(".concat(u&&!d?-1:0,"deg) translate(0, 0);"),role:"group",borderRadius:"xl",children:[(0,r.jsx)(N,{item:t}),(0,r.jsx)(s.xu,{opacity:0,_groupHover:{opacity:1},transitionProperty:"opacity",transitionDuration:"normal",position:"absolute",top:"0",left:"1.5",bg:S.gripDotsBg,color:S.gripDotsColor,borderRadius:"sm",fontSize:"sm",children:(0,r.jsx)(b.G,{icon:v.Okg,fixedWidth:!0})})]})})},_=e=>{let{icon:t,name:n,itemGroups:l,editor:d,setOpenButton:c,isOpen:x}=e,v=(0,k.useRef)(null),{GammaTooltipHiderContext:C,hideTooltips:w}=(0,y.o5)(),j={iconColor:(0,o.ff)("trueblue.600","trueblue.200"),hoverColor:(0,o.ff)("gray.100","whiteAlpha.100"),activeColor:(0,o.ff)("gray.200","whiteAlpha.200"),popoverBorderColor:(0,o.ff)("whiteAlpha.600","whiteAlpha.300"),popoverBackgroun
1dColor:(0,o.ff)("gray.50","blackAlpha.900"),scrollGradientStart:(0,o.ff)("rgba(249, 246, 246, 0)","rgba(0,0,0,0)"),scrollGradientEnd:(0,o.ff)("rgba(249, 246, 246, 1)","rgba(0,0,0,0.9)")},A=(0,k.useCallback)(()=>{c(null)},[c]);return(0,k.useEffect)(()=>{x&&v.current&&v.current.scrollTo({top:0})},[x]),(0,r.jsxs)(u.J,{placement:"start",isOpen:x,isLazy:!0,lazyBehavior:"keepMounted",returnFocusOnClose:!1,modifiers:[{name:"preventOverflow",enabled:!0,options:{padding:20}}],autoFocus:!1,children:[(0,r.jsx)(y.kH,{label:n,modifiers:[{name:"offset",options:{offset:[0,-2]}}],shouldWrapChildren:!0,"aria-label":n,placement:"left",portalProps:{appendToParentPortal:!0},children:(0,r.jsx)(p.x,{children:(0,r.jsx)(m.h,{"aria-label":n,"data-testid":"".concat(n.toLowerCase().split(" ").join("-"),"-widget-inner-button"),size:"md",icon:(0,r.jsx)(b.G,{icon:t}),color:j.iconColor,fontWeight:"500",borderRadius:"md",backdropFilter:"blur(20px)",variant:"undefined",bg:x?j.activeColor:void 0,_hover:{bg:x?j.activeColor:j.hoverColor},textShadow:"0px 1px 0px rgba(0,0,0,0)",onMouseDown:e=>(d.isFocused&&(0,I.br)(e),c(e=>e===n?null:n),!0)})})}),(0,r.jsx)(h.h,{children:(0,r.jsxs)(g.y,{bg:j.popoverBackgroundColor,borderWidth:"1px",borderColor:j.popoverBorderColor,borderRadius:"xl",shadow:"xl",zIndex:"overlay",overflow:"hidden",maxH:"90vh",w:"400px",p:0,className:"insert-widget-popover",position:"relative",children:[(0,r.jsx)(a.k,{overflow:"hidden auto",direction:"column",h:"100%",ref:v,flex:1,"data-insert-widget-popover":!0,children:(0,r.jsx)(C,{children:(0,r.jsx)(i.K,{p:2,pb:l.length>1?8:2,spacing:3,children:l.map((e,t)=>{let{subcategory:o,items:a}=e;return(0,r.jsxs)(i.K,{spacing:2,children:[(0,r.jsx)(y.NZ,{flex:"1",textAlign:"left",ml:1,children:1===l.length?n:o}),(0,r.jsx)(f.r,{gap:"1.5",gridTemplateColumns:"1fr 1fr 1fr",maxW:"100%",children:a.map(e=>(0,S.pP)(d,e,!1)?null:(0,r.jsx)(M,{item:e,onDragStart:()=>R(e,d,A,w),onDragEnd:t=>P(e,d,t),onClick:()=>L(e,d,A)},e.key))})]},t)})})})}),l.length>1&&(0,r.jsx)(s.xu,{h:"12",w:"100%",position:"absolute",bottom:"0",bg:"linear-gradient(to bottom, ".concat(j.scrollGradientStart,", ").concat(j.scrollGradientEnd," 90%)"),pointerEvents:"none"})]})})]})},L=(e,t,n)=>{!(!(0,z.KB)(t)||(0,S.pP)(t,e))&&t.state.selection.empty&&(n(),(0,S.ZT)(e,j.fe.INSERT_WIDGET),e.execute(t))},P=(e,t,n)=>{n.preventDefault(),n.stopPropagation();let{dragEndFn:r}=e;try{r&&r(t),(0,S.ZT)(e,j.fe.INSERT_WIDGET)}catch(e){console.error("[InsertWidget] dragEndFn error:",e)}},R=(e,t,n,r)=>{setTimeout(()=>{n()});let o="card"===e.nodeName?(0,A.Zs)(E.e[e.key]):E.e[e.key],i=e.dragStartFn?e.dragStartFn:o?()=>(0,S.UV)(t,o):void 0;if(!i){console.error("[InsertWidget] dragStartFn undefined",e);return}i(t),null==r||r()}},85e3:function(e,t,n){"use strict";n.d(t,{D:function(){return d},k:function(){return c}});var r=n(94207),o=n(24772),i=n(2784),a=n(91994),l=n(47968),s=n(90604);let d=(e,t,n)=>{let[r,o]=(0,i.useState)(!1),[a,l]=(0,i.useState)(!1),s=(0,i.useRef)(),d=(0,i.useCallback)(t=>{o(!0),e(t)},[e]),c=(0,i.useCallback)(e=>{o(!1),l(!1),t(e)},[t]),u=(0,i.useCallback)(e=>{s.current instanceof HTMLElement&&s.current.focus(),n(e)},[n]),p=(0,i.useCallback)(()=>{l(!0),s.current=document.activeElement||void 0},[]),m=(0,i.useCallback)(()=>{l(!1)},[]);return{isDragging:r,isMouseDown:a,handleDragStart:d,handleDragEnd:c,handleClick:u,onMouseDown:p,onMouseUp:m}},c=()=>{let[e]=(0,r.a)(["(max-height: 400px)","(min-height: 401px"]),t=(0,a.CG)(l.hN),n=(0,a.CG)(l.Hl),i=(0,o.S)({base:!1,lg:!0}),d=(0,a.CG)(l.gh);return t&&!e&&!n&&i&&d!==s.q.SLIDE_VIEW}},5682:function(e,t,n){"use strict";n.d(t,{Z:function(){return g},B:function(){return z}});var r=n(52322),o=n(28535),i=n(75009),a=n(82554),l=n(49929),s=n(94523),d=n(2784),c=n(85420),u=n(16893),p=n(11050),m=n(86323),h=n(33374);let g=(0,d.forwardRef)((e,t)=>{let{query:n,editor:g}=e,f=(0,u.A)(m.xr),x=f.filter(e=>{if((0,m.pP)(g,e))return!1;let{name:t,keywords:r=[]}=e;return t().toLowerCase().includes(n.toLowerCase())||r.find(e=>e.startsWith(n.toLowerCase()))}),v=(0,d.useCallback)(e=>{if(!x[e])return;let{execute:t}=x[e],r=g.state.selection;g.chain().deleteRange({from:r.from-n.length-1,to:r.to}).run(),(0,m.ZT)(x[e],p.fe.SLASH_MENU),t(g)},[g,x,n.length]),{selectedIndex:b,selectedItemEl:y}=(0,h.Yg)({ref:t,selectItem:v,options:x});return x.length>
10?(0,r.jsx)(o.xu,{"data-slash-menu-dropdown":!0,children:(0,r.jsx)(s.wb,{children:(0,r.jsx)(s.Dw,{width:"375px",children:x.map((e,t)=>{let{name:n,icon:o,iconStyle:d,image:u,shortcut:p,creditType:m,badge:h}=e;return(0,r.jsxs)(s.m9,{ref:t===b?y:null,icon:u?(0,r.jsx)(i.E,{mt:1,h:"1.5em",w:"1.25em",objectFit:"contain",src:u.src}):o?(0,r.jsx)(l.G,{icon:o,rotation:null==d?void 0:d.rotation,size:"1x",fixedWidth:!0,color:"var(--chakra-colors-trueblue-600)"}):(0,r.jsx)(r.Fragment,{}),tabIndex:t===b?0:-1,onClick:()=>v(t),command:p,children:[n(),m&&(0,r.jsx)(c.J,{type:m,colorScheme:"blackAlpha",bg:"whiteAlpha.800"}),h&&(0,r.jsx)(a.C,{ml:2,colorScheme:"green",children:h()})]},t)})})})}):(0,r.jsx)(r.Fragment,{})});var f=n(29117),x=n(77533),v=n(5740),b=n(75768),y=n(32899),C=n(5879),w=n(42111),k=n(57574),j=n(3452),S=n(66028),A=n(4471);let I=["image.custom","table2","columns","insertCardInside","embed.custom"],E=()=>I.map(e=>A.UO.find(t=>t.key===e)).filter(Boolean),z=e=>{let{editor:t}=e,n=(0,w.ye)("aiAutocomplete")&&!(0,j.M)(t),o=(0,u.A)(E),{selection:i}=t.state;return i.empty?(0,r.jsxs)(f.U,{spacing:4,color:"gray.400","data-print-hidden":!0,position:"absolute",inset:"0",contentEditable:!1,overflow:"hidden",fontFamily:"Inter, sans-serif",fontSize:"0.8em",onMouseDown:S.br,pointerEvents:"none",userSelect:"none","data-guider-highlight":"slash-menu-prompt",className:"slash-menu-prompt",children:[(0,r.jsx)(x.x,{whiteSpace:"nowrap",children:n?(0,r.jsx)(C.cC,{id:"UfUEJ5",values:{AUTOCOMPLETE_INPUT_SHORTCUT:k.o},components:{0:(0,r.jsx)(v.T,{}),1:(0,r.jsx)(v.T,{})}}):(0,r.jsx)(C.cC,{id:"HGRFT/",components:{0:(0,r.jsx)(v.T,{})}})}),(0,r.jsx)(b.h,{isAttached:!0,variant:"ghost",size:"xs",spacing:1,pointerEvents:"auto",colorScheme:"gray",transitionProperty:"opacity",transitionDuration:"normal",_hover:{opacity:1},children:o.map(e=>{let{name:n,shortcut:o,icon:i,execute:a,key:d,creditType:u}=e;return!(0,m.pP)(t,e)&&(0,r.jsx)(s.kH,{placement:"top",shortcut:o,label:(0,r.jsxs)(r.Fragment,{children:[n()," ",u&&(0,r.jsx)(c.J,{type:u})]}),children:(0,r.jsx)(y.h,{"aria-label":n(),onClick:()=>{(0,m.ZT)(e,p.fe.BLOCK_PROMPT),a(t)},icon:(0,r.jsx)(l.G,{icon:i}),color:"inherit"})},d)})})]}):null}},70723:function(e,t,n){"use strict";n.d(t,{Lt:function(){return x},PS:function(){return v},hP:function(){return y},sV:function(){return b}});var r=n(52322),o=n(55478),i=n(70339),a=n(91982),l=n(62614),s=n(81821),d=n(76801),c=n(79729),u=n(94523),p=n(2784);let[m,h]=(0,s.k)({strict:!1,name:"DropdownContext"}),[g,f]=(0,s.k)({name:"DropdownStylesContext",errorMessage:"useDropdownStyles returned is 'undefined'. Seems you forgot to wrap the components in \"<Dropdown />\" "}),x=e=>{let{isOpen:t,onClose:n,onToggle:l}=(0,o.q)(),s=(0,a.jC)("Dropdown",e),d=(0,i.D)({placement:"bottom-start"}),c=(0,p.useMemo)(()=>({isOpen:t,onClose:n,onToggle:l,popper:d}),[t,n,l,d]);return(0,r.jsx)(m,{value:c,children:(0,r.jsx)(g,{value:s,children:(0,r.jsx)(u.wb,{...e})})})},v=e=>{let{children:t,as:n,...o}=e,{popper:i,onToggle:a}=h(),s=n||l.z;return(0,r.jsx)(s,{...o,ref:i.referenceRef,onClick:(0,c.v0)(e.onClick,a),children:(0,r.jsx)(d.m.span,{__css:{pointerEvents:"none",flex:"1 1 auto",justifyContent:"flex-start",display:"flex",minW:0},children:t})})},b=e=>{var t,n;let{children:o,...i}=e,{isOpen:a,popper:l}=h(),s=f();if(!a)return null;let c=l.getPopperProps({...e,style:{visibility:a?"visible":"hidden",...e.style}});return(0,r.jsx)(d.m.div,{...i,mt:2,minWidth:"var(--chakra-sizes-48)",ref:l.popperRef,...c,__css:{zIndex:null!==(n=e.zIndex)&&void 0!==n?n:null===(t=s.list)||void 0===t?void 0:t.zIndex},children:(0,r.jsx)(u.Dw,{children:o})})},y=e=>{let{onToggle:t}=h();return(0,r.jsx)(u.m9,{...e,onClick:(0,c.v0)(e.onClick,t)})}},12336:function(e,t,n){"use strict";n.d(t,{E:function(){return f}});var r=n(52322),o=n(10625),i=n(67046),a=n(62614),l=n(99058),s=n(42946),d=n(49929),c=n(94523),u=n(5879),p=n(87254),m=n(28601),h=n(66028),g=n(42487);let f=e=>{let{editor:t,color:n,setColor:f,analyticsSource:x}=e;return(0,r.jsxs)(o.v,{isLazy:!0,onClose:()=>(0,g.L)(t),children:[(0,r.jsx)(c.kH,{placement:"top",label:(0,r.jsx)(u.cC,{id:"XAIjEI"}),"aria-label":p.ag._({id:"XAIjEI"}),children:(0,r.jsx)(i.j,{as:a.z,variant:"toolbar",rightIcon:(0,r.jsx)(d.G,{icon:s.ptq,transform:"shrink-6"}),size:"sm",onMouseDown:h.br,children:(0,r.jsx)(d.G,{icon:s.q2v})})}),(0,r.jsx)(l.q,{overflow:"hidden",children:(0,r.jsx)(m.M,{currentColor:n||null,setColor:f,source:x})})]})}},29679:function(e,t,n){"use strict";n.d(t,{h:function(){return d}});var r=n(52322),o=n(62614),i=n(49929),a=n(94523);n(2784);var l=n(1198),s=n(66028);let d=e=>{let{label:t,shortcut:n,disabled:a=!1,color:l,isActive:d=!1,onClick:u,icon:p,iconRotation:m,testId:h,children:g,...f}=e,x=(0,r.jsx)(o.z,{isDisabled:a,color:l,variant:d?"activeToolbar":"toolbar",onClick:u,"data-testid":h,onMouseDown:s.br,size:"sm",...f,children:p?(0,r.jsx)(i.G,{icon:p,rotation:m,fixedWidth:!0}):g||null});return t?(0,r.jsx)(c,{label:t,shortcut:n,children:x}):x},c=e=>{let{label:t,shortcut:n,children:o}=e;return(0,r.jsx)(a.kH,{placement:"top",portalProps:{containerRef:(0,l.jj)()},label:t,shortcut:n,children:o})}},40520:function(e,t,n){"use strict";n.d(t,{O:function(){return h}});var r=n(52322),o=n(28535),i=n(5879),a=n(2784),l=n(93202),s=n(20336),d=n(50260),c=n(29596),u=n(13793),p=n(65435);let m=e=>{if(!e.source&&e.type===u.E.IMAGE){var t;return null===(t=e.image)||void 0===t?void 0:t.source}return e.source},h=(0,a.memo)(e=>{let{editor:t,defaultMessage:n,isDark:u,setCurrentSourceKey:h,currentSourceKey:g,currentSource:f,updateCurrentBackgroun
1d:x,currentBackground:v,isValidSource:b,editType:y="background"}=e,{isConnected:C}=(0,l.$gs)(),w=(0,a.useCallback)(e=>{let t=c.ah[e];t.backgroundType&&x({type:t.backgroundType,source:e,[t.backgroundType]:void 0})},[x]),k=(0,a.useCallback)(()=>w(g),[g,w]),j=(0,a.useCallback)(e=>{e===c.mC&&w(c.mC),h(e)},[h,w]),S=m(v);(0,a.useEffect)(()=>{S&&c.ah[S]&&h(S)},[S,h]);let A=!!(C||(null==f?void 0:f.availableOffline));return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(s.V,{isConnected:A,label:(0,r.jsx)(i.cC,{id:"nfjtFu"}),mb:3,my:6}),(0,r.jsx)(p.M,{isValidSource:b,onChange:j,currentSource:f}),f&&(0,r.jsx)(o.xu,{opacity:A?1:.4,pointerEvents:A?"initial":"none",children:(0,r.jsx)(f.Panel,{editor:t,updateAttributes:e=>{f.backgroundType&&(f.key===d.cx?x(e):x({type:f.backgroundType,[f.backgroundType]:{...e},source:g}))},currentAttributes:f.backgroundType?f.key===d.cx?v:v[f.backgroundType]||{}:{},resetToPlaceholder:k,editType:y,isDark:u})}),g===c.mC&&n]})});h.displayName="BackgroundPanel"},55891:function(e,t,n){"use strict";n.d(t,{o:function(){return c}});var r=n(52322),o=n(2784),i=n(99787),a=n(50260),l=n(29596),s=n(40520),d=n(64743);let c=e=>{let{editor:t,updateNestedAttributes:n,background:c,defaultMessage:u,isDark:p,isValidSource:m}=e,[h,g]=(0,o.useState)(i.hq.key),f=l.ah[h],x=(0,o.useCallback)(e=>{f.key===a.cx?n({background:e}):n({background:{...e,accentId:void 0}})},[f.key,n]),v=(0,o.useCallback)(e=>m?m(e)&&(0,d.bH)(e):(0,d.bH)(e),[m]);return(0,r.jsx)(s.O,{editor:t,isDark:p,isValidSource:v,defaultMessage:u,currentBackground:c,updateCurrentBackground:x,currentSourceKey:h,setCurrentSourceKey:g,currentSource:f})}},64743:function(e,t,n){"use strict";n.d(t,{Rr:function(){return i},bH:function(){return o}});var r=n(50260);n(13793);let o=e=>!!e.backgroundType,i=e=>e.key!==r.cx},8445:function(e,t,n){"use strict";n.d(t,{Y:function(){return s},i:function(){return l}});var r=n(27191),o=n(11093),i=n(91073),a=n(46795);let l=new r.H$("aiModifications");class s{getExistingRangeId(e,t){let n=(0,a.G8)(e,t);if(!n)return null;let r=Object.entries(this.ranges).find(t=>{let[r,o]=t,i=(0,a.G8)(e,o);return!!i&&n.from===i.from&&n.to===i.to});return r?r[0]:null}getRangeParentCardId(e,t){let n=this.ranges[t];if(!n)return null;let r=(0,a.G8)(e,n);if(!r)return null;let l=r.from,s=e.doc.nodeAt(l),d=e.doc.resolve(l),c=s&&(0,i.KH)(s)?{node:s,pos:l,start:d.start,depth:d.depth}:(0,o.nv)(d,i.KH)[0];return c?c.node.attrs.id:null}getRange(e,t){let n=this.queuedMoveRanges[t];if(n)return n;let r=this.ranges[t];if(!r)return null;let o=(0,a.G8)(e,r);return o}apply(e,t){let n=e.getMeta("aiModificationAction");n&&"setInteractionRange"===n.type&&this.setInteractionRange(n,t);let r=e.getMeta("applyingAiModification");if(r)return this.handleRangeMapping(t,e,r.rangeId),this;let o=e.getMeta("appendedTransaction");return o&&this.handleAppendedTransaction(t,e,o),this}handleAppendedTransaction(e,t,n){if(n.getMeta("applyingAiModification")){let r=n.getMeta("applyingAiModification");r&&this.handleRangeMapping(e,t,r.rangeId)}}handleRangeMapping(e,t,n){let r=this.getRange(e,n);if(!r){console.warn("[AiModificationState] Could not find range for rangeId=".concat(n));return}let o={from:r.from,to:t.mapping.map(r.to)};(r.from!==o.to||r.to!==o.to)&&this.enqueueMoveInstructions(n,o)}enqueueMoveInstructions(e,t){this.queuedMoveRanges[e]=t}flushMoveInstructionQueue(e){for(let[t,n]of Object.entries(this.queuedMoveRanges))this.ranges[t]=(0,a.bb)(e,n);this.queuedMoveRanges={}}setInteractionRange(e,t){this.ranges[e.rangeId]=e.range}constructor(){this.queuedMoveRanges={},this.ranges={}}}},47016:function(e,t,n){"use strict";n.d(t,{F:function(){return j},X:function(){return k}});var r=n(72338),o=n(27191),i=n(54691),a=n(28918),l=n(31490),s=n(7144),d=n(68601),c=n(42111),u=n(91994),p=n(47968),m=n(46795),h=n(15690),g=n(96255),f=n(86581),x=n(52780);let v=new o.H$("autocomplete"),b=e=>new o.Sy({key:v,state:{init:()=>({loading:!1,insertedRange:null}),apply(e,t){let n=e.getMeta("autocompleteEvent");return(null==n?void 0:n.type)==="reset"?{loading:!1,insertedRange:null}:(null==n?void 0:n.type)==="load"?{loading:!0,insertedRange:null}:(null==n?void 0:n.type)==="insert"?{loading:!1,insertedRange:n.range}:t}},props:{decorations(e){let t=[],n=v.getState(e),{selection:o,doc:i}=e,{loading:a,insertedRange:l}=n||{};if(a){let e=x.p.widget(o.from,()=>{let e=document.createElement("span");return e.className="autocomplete-loading",e});t.push(e)}if(l){let e;try{e=(0,r.b5)(i,l,e=>e.isTextblock)}catch(t){e=[]}
1e.forEach(e=>{let{node:n,pos:r}=e,o=Math.max(r+1,l.from),i=Math.min(r+n.nodeSize-1,l.to),a=x.p.inline(o,i,{class:"autocomplete-inserted"});t.push(a)})}return t.length?x.EH.create(i,t):x.EH.empty}}});var y=n(6997);let C=new y.u({systemPrompt:"You are helping a user write a document. Your job is to continue what they've written by writing 2-3 additional sentences. Respond with the just the additional text, and no additional conversation.".trim(),userPrompt:"Continue the following text. Respond with at most 3 sentences.\n\n{{text}}".trim(),variables:["text"],params:{maxTokens:200,temperature:1,model:"gpt-3.5-turbo"}}),w=/(\+\+\+)/,k=4e3,j=r.hj.create({name:"autocomplete",addProseMirrorPlugins(){return[b(this.editor)]},addCommands:()=>({autoOutline:()=>e=>{let{editor:t,state:n,tr:o}=e,{selection:i,doc:a}=n,{$from:l,from:s}=i,d=(0,m.jS)(n,l.after()),c=(0,r.Kk)(g.KH)(i);return!!c&&!!d&&((0,f.Ck)(a,c.pos,s),o.setMeta("autocompleteEvent",{type:"load"}),!0)},autoComplete:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t=>{var n;let{editor:r,state:g,tr:x}=t,{selection:v,doc:b}=g,{from:y}=v,w=(0,m.jS)(g,y),j=c.VH.get("aiAutocomplete")&&v.empty&&v instanceof o.Bs&&w;if(!j)return!1;let S=(0,u.bh)().getState(),A=null===(n=(0,p.yx)(S))||void 0===n?void 0:n.organization,I=(0,d.C)("autocomplete",A);if(!I)return!1;let E=(0,f.Ck)(b,Math.max(v.from-1e3,0),v.from),z=(0,a.xk)(E).slice(-200),T=(0,a.Zs)(z),N=b.textBetween(v.from-10,v.to);x.setMeta("autocompleteEvent",{type:"load"});let M=(0,l.nZ)(),_=C.prepare({interactionId:M,variables:{text:T},params:e}),L=performance.now(),P={interactionId:M,interface:"autocomplete",inputContent:E};return(0,l.hq)(P),(0,i.I)(_,M,{timeout:5e3,retries:1}).then(e=>{var t;let n=(0,m.XV)(g,w);if(!e||!n)throw Error("No completion or insertPos");e=e.trim();let o={from:n,to:n},i=r.chain().insertMarkdownAt(o,e).command(e=>{let{tr:t}=e,n=(0,h.a)(t);return!n||(o.to=n.to,t.setSelection(n).scrollIntoView(),!0)}).setMeta("autocompleteEvent",{range:o,type:"insert"}),a=g.doc.resolve(n);(null===(t=a.nodeBefore)||void 0===t?void 0:t.isText)&&!(N.endsWith(" ")||N.endsWith("\n"))&&i.insertContentAt(n," ",{updateSelection:!1}),i.run(),(0,l.gb)({...P,outputContent:e,latency:performance.now()-L,timeToComplete:performance.now()-L}),(0,s.d)("autocomplete",A,M),setTimeout(()=>{r.commands.setMeta("autocompleteEvent",{type:"reset"})},k)}).catch(e=>{console.warn("Error fetching autocomplete",e),r.commands.setMeta("autocompleteEvent",{type:"reset"})}),!0}}}),addInputRules:()=>[new r.VK({find:w,handler:e=>{let{range:t,chain:n}=e;n().setTextSelection(t).deleteSelection().autoComplete().run()}})]})},38372:function(e,t,n){"use strict";n.d(t,{eV:function(){return i},gk:function(){return a},ml:function(){return l},xF:function(){return o}});var r=n(37164);let o=e=>t=>{let n=t.getAttribute("bookmark");if(!n)return!1;let r=e.bookmarks[n];return!!r&&r.attrs},i=e=>t=>{let n=t.getAttribute("bookmark");if(console.log("getContentFromBookmark",n,e.bookmarks[n]),!n)return!1;let r=e.bookmarks[n];return!!r&&r.content},a=()=>({bookmarks:{}}),l=(e,t)=>
1{let n=(0,r.x0)(5);return e.bookmarks[n]=t,n}},21782:function(e,t,n){"use strict";n.d(t,{D:function(){return m},F:function(){return p}});var r=n(27191),o=n(77787),i=n(66625),a=n(47968),l=n(11093),s=n(46795),d=n(74684),c=n(96255);let u=(e,t)=>{let{content:n}=e.state.doc.slice(t.from,t.to);return(0,o.c)(e,n)},p=(e,t)=>{let{selection:n}=e.state,o=(0,l.Ru)(n.$from,c.KH)[0],i=o&&(0,d.NE)(o.node,o.pos);if(!o||!i)throw Error("Cant find parent card for selection ".concat(n));let p={from:o.pos,to:o.pos+o.node.nodeSize},h={from:i.pos+1,to:i.pos+i.node.nodeSize-1},g=n.$from.blockRange(n.$to),f={from:g.start,to:g.end},x={range:(0,s.bb)(e.state,h),html:u(e,h)},v={range:(0,s.bb)(e.state,n),html:u(e,n)},b={range:(0,s.bb)(e.state,f),html:u(e,f)},y=n instanceof r.qv&&(0,c.KH)(n.node)||n.empty||0===v.html.trim().length||n instanceof r.qv&&n.node.isAtom,C=!n.$from.parent.eq(n.$to.parent)||0===g.$from.parentOffset&&g.$to.parentOffset===g.$to.parent.content.size,w=v,k="selectionRange";y?(w=x,k="cardContent"):C&&(w=b,k="blockRange");let j=m(t),S=(0,a.Pu)(t.getState());return{card:{cardId:o.node.attrs.id,range:(0,s.bb)(e.state,p),html:u(e,p),attrs:o.node.attrs},cardContent:x,blockRange:b,selectionRange:v,defaultRange:w,selection:n,outline:j,selectedDefaultRange:k,theme:S}},m=e=>{let t=e.getState(),n=(0,a.X9)(t),r=(0,i.qN)(t),o=Object.keys(n.tree).map(e=>{var t;return null===(t=r[e])||void 0===t?void 0:t.title}).filter(e=>!!e);return o.join("\n")}},50105:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(27191);let o=new r.H$("annotation")},17010:function(e,t,n){"use strict";n.d(t,{N:function(){return c},O:function(){return u}});var r=n(27191),o=n(38564),i=n(36069),a=n(72338),l=n(52780),s=n(50105);class d{apply(e,t){let n=e.getMeta(c);if(n&&n.type)return"createDraftComment"===n.type&&this.createDraftComment(n,t),"removeDraftComment"===n.type&&this.removeDraftComment(n,t),this;let r=e.getMeta(s.Z);if(r&&r.type)return"refreshAnnotationDecorations"===r.type&&this.createDecorations(t),this;let i=o.Gt.getState(t);if(i.isChangeOrigin){try{this.createDecorations(t)}catch(e){console.log("could not create decorations: ".concat(e.message),e)}return this}return this.decorations=this.decorations.map(e.mapping,e.doc),this}removeDraftComment(e,t){return e.comments.forEach(e=>{let{targetId:t}=e;delete this.draftComments[t]}),this.createDecorations(t),this}createDraftComment(e,t){this.draftComments[e.comment.targetId]=e.comment,this.createDecorations(t)}createDecorations(e){let t=o.Gt.getState(e);if(!t.binding)return this;let{doc:n,type:r,binding:s}=t,d=[];for(let t of Object.values(this.draftComments))try{var c,u;let o=(0,i.SF)(n,r,t.relativePos,s.mapping);if(null==o)continue;let p=e.doc.resolve(o),m=t=>{let n=(0,a.N2)(e.doc,e=>e===t);if(!n||0===n.length)throw Error();return n[0].pos},h=(null===(c=p.nodeAfter)||void 0===c?void 0:c.isBlock)?o:m(p.parent),g=h+((null===(u=p.nodeAfter)||void 0===u?void 0:u.isBlock)?p.nodeAfter.nodeSize:p.parent.nodeSize);d.push(l.p.node(h,g,{},{isDraftComment:!0,comment:t}))}catch(e){console.log("[DraftCommentState] error: $".concat(e.message))}return this.decorations=l.EH.create(e.doc,d),this}absToRel(e,t){let n=o.Gt.getState(e),{type:r,binding:a}=n;if(!n.binding)throw Error("Y.State non initialized");return(0,i.JR)(t,r,a.mapping)}constructor(){this.draftComments={},this.decorations=l.EH.empty}}let c=new r.H$("draftComments"),u=()=>new r.Sy({key:c,state:{init:()=>new d,apply:(e,t,n,r)=>t.apply(e,r)},props:{decorations(e){let{decorations:t}=this.getState(e);return t}}})},65940:function(e,t,n){"use strict";n.d(t,{l:function(){return eF}});var r=n(52322),o=n(28535),i=n(73200),a=n(94523),l=n(37164),s=n(2784),d=n(93202),c=n(42111),u=n(91994),p=n(50788),m=n(4878),h=n(90507),g=n(47968),f=n(3543),x=n(90221),v=n(93441),b=n(62047);let y=e=>{let{editor:t,decorations:n}=e,r=n.filter(e=>!!e.spec.isMobileAnnotation),[o,i]=(0,s.useState)(null),a=(0,s.useRef)(null);return(0,s.useEffect)(()=>{if(0===r.length){null!==a.current&&(document.removeEventListener("touchstart",a.current),a.current=null,i(null));return}a.current||(i({left:r[0].spec.offsetX,top:r[0].spec.offsetY}),a.current=e=>{let n=e.target,r=n.closest(".mobile-add-comment-widget");r||t.commands.setMobileAddBlockComment(null)},document.addEventListener("touchstart",a.current))},[t,r]),o};var C=n(70065),w=n(43997),k=n(69747),j=n(13608),S=n(36651),A=n(40015),I=n(29117),E=n(54933),z=n(38035),T=n(43297),N=n(87651),M=n(42946),_=n(5879),L=n(25925),P=n(66028),R=n(62614),H=n(82554),D=n(49929);let O=(0,s.memo)(e=>{let{isMobile:t,icon:n,badgeCount:o,tooltip:i,children:l,...s}=e;t&&delete s._hover;let d=(0,r.jsx)(I.U,{className:"block-comment-button-wrapper",children:(0,r.jsxs)(R.z,{variant:"custom",borderRadius:"full",size:"sm",bgGradient:"none",color:"yellow.600",boxSize:t?10:8,border:t?"":"1px solid white",transitionProperty:"common",transitionDuration:"normal",_hover:t?{}:{bgGradient:"linear(to-b, yellow.300, yellow.400)",color:"yellow.700"},...s,children:[n&&(0,r.jsx)(D.G,{size:t?"lg":"sm",icon:n}),l&&l,void 0!==o&&(0,r.jsx)(H.C,{colorScheme:"yellow",borderRadius:"full",pos:"absolute",bottom:-1,right:-1,shadow:"base","data-testid":"badge-count",children:o})]})});return i?(0,r.jsx)(a.kH,{placement:"left",label:i,children:d}):d});O.displayName="GenericBlockCommentButton";var B=n(76643),F=n(84636),W=n.n(F),G=n(57480),U=n(3561),V=n(77182);let q=e=>{let{comments:t,reactions:n,draftComment:r}=e;if(r&&r.text.trim().length>0)return"draft";if(0===t.length)return 0===n.length?"fresh":"reactions-only";if(1===t.length)return"single-thread";if(t.length>1)return"multiple-threads";throw Error("Invalid button state")},$=e=>{let{comments:t,reactions:n}=e,r={};
1return t.forEach(e=>{r[e.id]=[e.user],e.replies.forEach(t=>{r[e.id].push(t.user)})}),Object.entries(r).forEach(e=>{let[t,n]=e;r[t]=W()(n,"id")}),r},K=e=>{let{reactions:t}=e,n={};return t.forEach(e=>{n[e.emoji]=W()(e.reactions.flatMap(e=>e.users),"id")}),n},Z=e=>{let{comments:t,reactions:n,draftComment:r}=e,o=q({comments:t,reactions:n,draftComment:r}),i=t.reduce((e,t)=>{var n;return e+((null===(n=t.replies)||void 0===n?void 0:n.length)||0)},0)+n.reduce((e,t)=>e+t.count,0)+t.length,a=Math.max(0,n.length-7);return{state:o,allCount:i,overflowReactionCount:a}},Y=e=>{let{comments:t,reactions:n}=e,r=n.flatMap(e=>e.reactions.map(e=>e.users)).flat(),o=t.map(e=>e.user).concat(t.map(e=>e.replies.map(e=>e.user)).flat()).filter(Boolean),i=$({comments:t,reactions:n}),a=W()([...o,...r],"id"),l=[],s=K({reactions:n});return t.forEach(e=>{l.push(i[e.id])}),{allAvatars:a,reactionAvatars:s,commentAvatars:l}},X=e=>{let{popup:t,isMobile:n,isHovered:r,comments:o,reactions:i,draftComment:a,enableReactions:l}=e,{state:d}=Z({comments:o,reactions:i,draftComment:a}),c=n||l&&r||!l&&r&&"fresh"!==d||null!==t;return(0,s.useEffect)(()=>{n||(c?document.body.classList.add("is-taking-action"):document.body.classList.remove("is-taking-action"))},[c,n]),{isExpanded:c}},J=e=>{let{isOpen:t,popupRef:n,onClose:r}=e;(0,B.O)({ref:n,handler:e=>{var n,o,i,a,l,s,d;let c=(0,x.f_)()&&!(null===(n=null==e?void 0:e.target)||void 0===n?void 0:n.closest(".".concat(U.G," [data-controls-toggle-button]")));c||!t||(null===(o=null==e?void 0:e.target)||void 0===o?void 0:o.closest("[data-controls-toggle-button]"))||(null===(i=null==e?void 0:e.target)||void 0===i?void 0:i.closest('[data-target-name="emoji-list"]'))||(null===(a=null==e?void 0:e.target)||void 0===a?void 0:a.closest('[data-target-name="mention-list"]'))||(null===(l=null==e?void 0:e.target)||void 0===l?void 0:l.closest('[data-target-name="reaction-emoji-picker"]'))||(null===(s=null==e?void 0:e.target)||void 0===s?void 0:s.closest(".chakra-menu__menu-list"))||(null===(d=null==e?void 0:e.target)||void 0===d?void 0:d.closest('[data-target-name="doc-mention-popup"]'))||r()}})},Q=e=>{let{editor:t,getPos:n}=e,r=t.view.nodeDOM(n()),[o,i]=(0,s.useState)(null);return((0,s.useLayoutEffect)(()=>{i((null==r?void 0:r.offsetHeight)||100)},[]),null===o)?null:Math.min(o,G.yK)};var ee=n(77533),et=n(81540),en=n(38045),er=n(62549);let eo=(0,en.E)(o.xu),ei=(0,s.memo)(e=>{let{emojis:t}=e;return(0,r.jsx)(r.Fragment,{children:null==t?void 0:t.map((e,n)=>0===n?(0,r.jsx)(eo,{initial:{x:"6px",y:"5px"},textShadow:(null==t?void 0:t.length)>1?"0px 1px 3px rgba(0,0,0,.4)":"none",fontSize:"20px",position:"absolute",zIndex:1,children:(0,r.jsx)("em-emoji",{size:0,native:!0,id:e})},n):1===n?(0,r.jsx)(eo,{zIndex:0,initial:{x:"10px",y:"6px",scale:.7},animate:{scale:.7,rotate:"10deg",x:"18px",y:"-3px"},position:"absolute",children:(0,r.jsx)("em-emoji",{size:0,native:!0,id:e})},n):2===n?(0,r.jsx)(eo,{zIndex:0,initial:{x:"10px",y:"6px",scale:.7},animate:{scale:.7,rotate:"-10deg",x:"-3px",y:"16px"},position:"absolute",children:(0,r.jsx)("em-emoji",{size:0,native:!0,id:e})},n):3===n?(0,r.jsx)(eo,{zIndex:0,initial:{x:"10px",y:"6px",scale:.7},animate:{scale:.7,rotate:"-10deg",x:"-3px",y:"-3px"},position:"absolute",children:(0,r.jsx)("em-emoji",{size:0,native:!0,id:e})},n):null)})});ei.displayName="EmojiCluster";let ea=(0,en.E)(o.xu),el=(0,s.memo)(e=>{let{emoji:t,emojiCluster:n,isMobile:i,user:l,canReact:d,reaction:c,badgeCount:u,onClick:p,...m}=e,h=(0,V.gq)(c),g=!!h.find(e=>e.id===(null==l?void 0:l.id)),f=(0,er.Rf)({users:h,selfUserId:(null==l?void 0:l.id)||""}),x=(0,r.jsxs)(o.xu,{alignContent:"center",children:[(0,r.jsx)(_.cC,{id:"mRnNF/",values:{usersLabel:f,emoji:t},components:{0:(0,r.jsx)(ee.x,{as:"span",color:"gray.300"})}}),d&&(0,r.jsx)(ee.x,{display:"block",color:"gray.500",children:g?(0,r.jsx)(_.cC,{id:"fb/FjL"}):(0,r.jsx)(_.cC,{id:"AG3H1y"})})]}),v=(0,r.jsx)(I.U,{className:"block-comment-button-wrapper",children:(0,r.jsxs)(R.z,{variant:"ghost",borderRadius:"full",size:"sm",boxSize:i?10:8,transitionProperty:"common",transitionDuration:"normal",...g?{bg:"gray.100",borderColor:i?"blackAlpha.200":"gray.200"}:{},...m,onClick:e=>{d&&p&&p(e)},pos:"relative",children:[(0,r.jsx)(s.Suspense,{fallback:(0,r.jsx)(et.$,{size:"sm"}),children:(0,r.jsxs)(ee.x,{pos:"absolute",inset:0,as:"span",sx:{".emoji-mart-emoji":{fontSize:"1em",span:{cursor:"inherit",fontSize:"1em !important"},":hover::before":i?{}:{backgroundColor:"transparent"}}},fontSize:i?"1.5em":"1.25em",children:[!n&&(0,r.jsx)(ea,{initial:{x:"6px",y:"5px"},fontSize:"20px",position:"absolute",zIndex:1,children:(0,r.jsx)("em-emoji",{size:0,native:!0,id:t})}),(0,r.jsx)(L.M,{children:(0,r.jsx)(ei,{emojis:n})})]})}),void 0!==u&&(0,r.jsx)(H.C,{colorScheme:"yellow",borderRadius:"full",pos:"absolute",bottom:-1,right:-1,shadow:"base",zIndex:1,children:u})]})});return x?(0,r.jsx)(a.kH,{placement:"left",label:x,children:v}):v});el.displayName="ReactionButton";let es={bg:"yellow.600",color:"yellow.100",_hover:{bg:"yellow.600",color:"yellow.100"}},ed={bg:"yellow.100",color:"yellow.800"},ec="linear(to-b, yellow.200, yellow.300)",eu=e=>{e.stopPropagation()},ep=(0,s.memo)(e=>{let{user:t,userCanComment:n,isExpanded:i,isMobile:a,comments:l,reactions:s,draftComment:d,onClickThread:c,onClickAddComment:u,onClickAddReaction:p,onClickReactionsOverflow:m,onClickExistingReaction:h,onClosePopup:g,hideAddCommentButton:f=!1,viewingCommentId:x,enableReactions:v,blockAllowsCommenting:b,...y}=e,{state:C,allCount:w,overflowReactionCount:k}=Z({comments:l,reactions:s,draftComment:d}),j=[];if(!i)switch(C){case"draft":j.push((0,r.jsx)(O,{isMobile:a,icon:M.OfB,onClick:u,bg:i?"gray.100":"white",_hover:ed,color:"gray.600"},"draft"));break;case"fresh":j.push((0,r.jsx)(O,{isMobile:a,icon:E.XoX,bg:i?"gray.100":"white",_hover:ed,color:"gray.600",bgGradient:ec,tooltip:(0,r.jsx)(_.cC,{id:"oFsfkI"}),"data-testid":"create-comment-button",onClick:u},"fresh"));break;case"reactions-only":if(s.length>0){let e=s[0],o=s.reduce((e,t)=>
1(e.push(t.emoji),e),[]);j.push((0,r.jsx)(el,{isMobile:a,onClick:t=>{h(e),t.stopPropagation()},reaction:e,user:t,badgeCount:w,emoji:e.emoji,"data-testid":"reaction-".concat(e.emoji),emojiCluster:o,canReact:n&&b},e.emoji))}break;case"single-thread":j.push((0,r.jsx)(O,{isMobile:a,icon:E.Mzg,bgGradient:ec,badgeCount:w,"data-testid":"single-thread"},"first-thread"));break;case"multiple-threads":j.push((0,r.jsx)(O,{isMobile:a,bgGradient:ec,icon:E.lXL,badgeCount:w,"data-testid":"multiple-threads"},"first-thread"))}return(i&&(l.forEach((e,t)=>{let n=null!==x&&e.id===x,o=n?es:{},i=n?()=>g():()=>c(e);j.push((0,r.jsx)(O,{isMobile:a,icon:E.Mzg,badgeCount:e.replies.length+1,bgGradient:ec,onClick:i,"data-testid":"thread-".concat(t),...o},0===t?"first-thread":"thread-".concat(t)))}),v&&(s.slice(0,7).forEach(e=>{j.push((0,r.jsx)(el,{isMobile:a,onClick:t=>{h(e),t.stopPropagation()},"data-testid":"reaction-".concat(e.emoji),reaction:e,user:t,badgeCount:e.count,emoji:e.emoji,canReact:n&&b},e.emoji))}),k>0&&j.push((0,r.jsxs)(O,{isMobile:a,onClick:()=>{m()},bg:"gray.100",color:"yellow.800",_hover:ed,children:["+",k]},"reactions-overflow"))),"draft"===C?j.push((0,r.jsx)(O,{isMobile:a,icon:M.OfB,tooltip:(0,r.jsx)(_.cC,{id:"x8Zuns"}),onClick:u,bg:i?"gray.100":"white",_hover:ed,"data-testid":"create-comment-button-draft",color:"gray.600"},"draft")):f||a||j.push((0,r.jsx)(O,{isMobile:a,icon:E.XoX,bgGradient:ec,tooltip:(0,r.jsx)(_.cC,{id:"oFsfkI"}),onClick:u,bg:i?"gray.100":"white",_hover:ed,"data-testid":"create-comment-button",color:"gray.600"},"fresh")),v&&n&&!f&&!a&&j.push((0,r.jsx)(O,{isMobile:a,icon:E.wqT,bgGradient:ec,onClick:()=>{p()},tooltip:(0,r.jsx)(_.cC,{id:"9OEgyT"}),"data-testid":"add-reaction-button",bg:"gray.100",_hover:ed,color:"gray.600"},"add-reaction"))),a)?(0,r.jsx)(z.k,{className:"block-comments-inner-stack",userSelect:"none",transitionProperty:"all",transitionDuration:"fast",flexDir:"row",flexWrap:"wrap",onClick:eu,children:j}):(0,r.jsxs)(T.K,{className:"block-comments-inner-stack",userSelect:"none",spacing:0,width:"34px",transitionProperty:"all",transitionDuration:"fast",onClick:eu,borderRadius:"full",boxShadow:"0 0 0 2px rgba(0,0,0,.1)",bg:"white",border:"1px solid transparent",onMouseDown:P.br,"data-testid":"block-comments-buttons",...y,children:[(0,r.jsx)(o.xu,{children:j[0]}),(0,r.jsx)(N.U,{in:i,startingHeight:0,transitionEnd:{enter:{overflow:"initial"}},children:(0,r.jsx)(L.M,{children:j.length>1&&(0,r.jsx)(T.K,{spacing:1,children:j.slice(1)})})})]})});ep.displayName="BlockCommentsButtons";let em=(0,s.memo)(e=>{let{onClickAddComment:t,onClickAddReaction:n,...i}=e;return(0,r.jsx)(o.xu,{className:"mobile-add-comment-widget",pos:"absolute",transform:"translate(-50%,-50%) scale(1)",mt:-6,background:"white",p:"4px",borderRadius:"full",shadow:"lg",transitionProperty:"common",transitionDuration:"normal",transitionTimingFunction:"cubic-bezier(0.34, 1.56, 0.64, 1);",zIndex:9,...i,children:(0,r.jsxs)(I.U,{spacing:1,children:[(0,r.jsx)(O,{isMobile:!0,icon:E.XoX,bg:"white",_hover:ed,color:"gray.600",bgGradient:ec,onClick:()=>{t()}},"fresh"),(0,r.jsx)(O,{isMobile:!0,icon:E.wqT,bgGradient:ec,onClick:()=>{n()},bg:"white",_hover:ed,color:"gray.600"},"add-reaction")]})})});em.displayName="MobileAddCommentWidget";var eh=n(93274),eg=n(109);let ef=(0,s.memo)(e=>{let{comments:t,reactions:n,isExpanded:o,avatarMax:i=4}=e,{allAvatars:a,reactionAvatars:l,commentAvatars:s}=Y({comments:t,reactions:n});return(0,r.jsxs)(T.K,{className:"avatar-group-popup",spacing:1,transitionProperty:"common",transitionDuration:"fast",onClick:e=>{e.stopPropagation()},p:"1px",pl:3,userSelect:"none",children:[!o&&(0,r.jsx)(eh.H,{max:i,style:{fontSize:"var(--chakra-fontSizes-sm)"},size:"sm",justifyContent:"start",opacity:[0,0,0,1],transitionProperty:"common",transitionDuration:"normal",position:"relative",children:a.map((e,t)=>(0,r.jsx)(eg.q,{zIndex:a.length-t,mr:-3,name:null==e?void 0:e.displayName,src:null==e?void 0:e.profileImageUrl,shadow:"base",ignoreFallback:!0},"unexpanded-".concat(null==e?void 0:e.id)))}),o&&(0,r.jsxs)(r.Fragment,{children:[s.map((e,t)=>(0,r.jsx)(eh.H,{max:i,style:{fontSize:"var(--chakra-fontSizes-sm)"},size:"sm",justifyContent:"start",opacity:[0,0,0,1],transitionProperty:"common",transitionDuration:"normal",position:"relative",children:e.map((e,t)=>(0,r.jsx)(eg.q,{zIndex:a.length-t,mr:-3,name:null==e?void 0:e.displayName,src:null==e?void 0:e.profileImageUrl,shadow:"base",ignoreFallback:!0},"comment-".concat(null==e?void 0:e.id)))},"comment-".concat(t))),n.slice(0,7).map((e,t)=>(0,r.jsx)(eh.H,{max:i,style:{fontSize:"var(--chakra-fontSizes-sm)"},size:"sm",justifyContent:"start",opacity:[0,0,0,1],transitionProperty:"common",transitionDuration:"normal",position:"relative",children:l[e.emoji].map((e,t)=>(0,r.jsx)(eg.q,{zIndex:a.length-t,mr:-3,name:null==e?void 0:e.displayName,src:null==e?void 0:e.profileImageUrl,shadow:"base",ignoreFallback:!0},"reaction-".concat(null==e?void 0:e.id)))},"reaction-".concat(t)))]})]})});
1ef.displayName="AvatarGroupPopup";var ex=n(87254);let ev=e=>{let{isMobile:t,emoji:n}=e,o=ex.ag._({id:"r2ONxg"});return(0,r.jsx)(s.Suspense,{fallback:(0,r.jsx)(et.$,{size:"sm"}),children:(0,r.jsxs)(ee.x,{as:"span",sx:{".emoji-mart-emoji":{fontSize:"1em",span:{cursor:"inherit",fontSize:"1em !important"}}},children:[(0,r.jsx)("em-emoji",{size:0,native:!0,id:n})," ",o,"."]})})};var eb=n(75279),ey=n(96071),eC=n(794),ew=n(60265);let ek=e=>{let{onCancel:t,editor:n,commentIdToHighlight:o,userCanComment:i,blockAllowsCommenting:a,getPos:l,draftComment:s,onCommentDraftUpdate:d,onCommentSave:c,isMobile:p}=e,{user:m}=(0,S.SE)(),h=(0,u.CG)(g.yx),f=(0,eb.$m)(h,m),x=Q({editor:n,getPos:l}),v=f&&!m&&a;if(null===x)return null;let b=(0,r.jsxs)(z.k,{overflowY:"auto",direction:"column",className:"comments-list",p:p||v?0:4,children:[v&&h&&(0,r.jsx)(ey.I,{accessLink:f,doc:h,className:"comments-sign-up",showDivider:!1}),i&&(0,r.jsx)(eC.A,{draftComment:s,user:m,showUser:p,showBorder:p,onCommentDraftUpdate:d,onCommentSave:c,commentIdToHighlight:o,alwaysShowButtons:p})]});return p?b:(0,r.jsx)(ew.KT,{offsetFromTop:x,children:b})};var ej=n(27354);let eS=e=>{let{isMobile:t,editor:n,onReactionClick:o,getPos:i}=e,a=Q({editor:n,getPos:i});if(null===a)return null;let l=(0,r.jsx)(z.k,{bg:"white",p:"0",zIndex:"tooltip","data-testid":"add-reaction-popup","data-target-name":"reaction-emoji-picker",boxShadow:"none",sx:{".emoji-mart":{border:"none"}},overflow:"hidden",justify:"center",children:(0,r.jsx)(ej.h5,{perLine:9,handlePick:o,shouldFocusSearch:!t})});return t?l:(0,r.jsx)(ew.KT,{offsetFromTop:a,children:l})};var eA=n(32981),eI=n(26468),eE=n(73751),ez=n(97217),eT=n(2338);let eN=(0,s.forwardRef)(function(e,t){let{isMobile:n,children:i,closePopup:a,drawerMinHeight:l}=e;if((0,s.useEffect)(()=>{n&&setTimeout(()=>{window.scrollTo(window.scrollY+1,0)},250)},[n]),n){let e=l||"calc(calc(100vh - calc(100vh - 100%)) - 1rem)";return(0,r.jsxs)(eA.d,{placement:"bottom",isOpen:!0,onClose:a,children:[(0,r.jsx)(eI.Z,{}),(0,r.jsxs)(eE.s,{minH:e,maxH:e,borderTopRadius:"xl",className:"comments-wrapper","data-block-comments-popup":!0,children:[(0,r.jsx)(ez.f,{p:6,pb:2,className:ew.U6,children:i}),(0,r.jsx)(eT.o,{})]})]})}return(0,r.jsx)(o.xu,{ref:t,children:i})});var eM=n(74409);let e_=e=>{let{onCancel:t,reactions:n,onClickExistingReaction:o,editor:i,getPos:a,user:l,userCanComment:d,blockAllowsCommenting:c,isMobile:u}=e,p=Q({editor:i,getPos:a}),m=n.slice(u?0:7),h=m.map(e=>(0,r.jsx)(el,{isMobile:!0,onClick:t=>{o(e),t.stopPropagation()},mr:2,mb:4,reaction:e,user:l,canReact:d&&c,badgeCount:e.count,emoji:e.emoji},e.emoji));if((0,s.useEffect)(()=>{0===m.length&&t()},[t,m]),null===p)return null;let g=(0,r.jsxs)(T.K,{spacing:4,children:[(0,r.jsx)(eM.X,{size:"md",children:(0,r.jsx)(_.cC,{id:"7ZMg79"})}),(0,r.jsx)(z.k,{flexWrap:"wrap",children:h})]});return u?g:(0,r.jsx)(ew.KT,{offsetFromTop:p,children:(0,r.jsx)(z.k,{p:4,px:2,pb:0,flexWrap:"wrap",children:h})})};var eL=n(43970);let eP=e=>{let{comment:t,editor:n,commentIdToHighlight:o,userCanComment:i,blockAllowsCommenting:a,getPos:l,isMobile:s,closePopup:d}=e,c=n.gammaDocId,{user:p}=(0,S.SE)(),m=(0,w.v9)(g.gh),h=(0,u.CG)(g.yx),f=(0,eb.$m)(h,p),x=Q({editor:n,getPos:l});if(null===x||!t)return null;let v=(0,r.jsxs)(z.k,{direction:"column",className:"comments-list","data-testid":"thread-view-popup",children:[f&&!p&&h&&a&&(0,r.jsx)(ey.I,{accessLink:f,doc:h,className:"comments-sign-up"}),(0,r.jsx)(eL.q,{instanceType:s?"drawer":"popup",userCanComment:i,commentIdToHighlight:o,editor:n,comment:t,selfUser:p,docId:c,editorMode:m,isRootComment:!0,borderBottomWidth:"none",closePopup:d,p:s?0:4,pb:4},t.id)]});return s?v:(0,r.jsx)(ew.KT,{offsetFromTop:x,children:v})};var eR=n(1787);let eH=e=>{let{getPos:t,editor:n,reactions:r}=e,{user:o}=(0,S.SE)(),[i]=(0,d.Os4)(),[a]=(0,d.d6Z)(),l=(0,s.useCallback)(e=>{let{reaction:t}=e;if(!o)return;let r=t.docId;1===t.count&&n.commands.deleteAnnotation(t.targetId);let i=t.count-1,l=t.users.filter(e=>(null==e?void 0:e.id)!==(null==o?void 0:o.id));a({variables:{reactionInput:{docId:r,targetId:t.targetId,emoji:t.emoji}},update:(e,t)=>
1{let{data:n}=t;e.writeFragment({id:"Doc:".concat(r),fragment:d.wk2,fragmentName:"DocReactionsCreate",data:{reactions:[null==n?void 0:n.removeReaction]}})},optimisticResponse:{removeReaction:{docId:r,targetId:t.targetId,targetType:d.Lmy.Decoration,count:i,emoji:t.emoji,users:l,__typename:"Reaction"}}})},[n,a,o]),c=(0,s.useCallback)(e=>{let{emoji:a}=e;if((0,V.z3)({emoji:a,user:o,reactions:r})||!o)return;let l=n.gammaDocId,s=(0,V.Nq)({reactions:r,emoji:a}),c=eR.v.generate(),u=((null==s?void 0:s.count)||0)+1,p=[];s?(c=s.targetId,p=[...s.users]):n.commands.addAnnotation({id:c,pos:t()}),p.unshift(o),p.sort((e,t)=>e.id>t.id?1:-1),i({variables:{reactionInput:{docId:l,targetId:c,targetType:d.Lmy.Decoration,emoji:a}},update:(e,t)=>{let{data:n}=t;e.writeFragment({id:"Doc:".concat(l),fragment:d.wk2,fragmentName:"DocReactionsCreate",data:{reactions:[null==n?void 0:n.addReaction]}})},optimisticResponse:{addReaction:{docId:l,targetId:c,targetType:d.Lmy.Decoration,count:u,emoji:a,users:p,__typename:"Reaction"}}})},[i,n,t,r,o]);return{addReactionFn:c,removeReactionFn:l}},eD={"add-comment":"350px","add-reaction":"350px","reactions-overflow":"350px"},eO=e=>{let{nodeName:t,isVisible:n,editor:o,getPos:a,comments:l,reactions:d,createDraftComment:c,cleanupDraftComment:u,onCommentDraftUpdate:p,draftComment:m,onCommentSave:h,userCanComment:f,blockAllowsCommenting:b,blockCommentId:y,enableReactions:I,mobileAddCommentPos:E,setIsButtonStackHovered:z}=e,T=(0,C.p)(),N=(0,x.s2)(),M=(0,w.I0)(),{user:_,isUserLoading:L}=(0,S.SE)(),{isHovering:P,delayedClose:R,...H}=(0,v.xx)({enterDelay:30,leaveDelay:100}),D=!!P,O=(0,s.useRef)(null),B=(0,s.useRef)(),F=(0,w.v9)((0,g.s3)(y)),W=(0,s.useRef)(null),[G,V]=(0,s.useState)(null),q=null!==G,[$,K]=(0,s.useState)(null),Z=l.find(e=>e.id===$)||null,Y=(0,s.useCallback)(e=>{V("thread"),K(e.id),M((0,g.UX)({isOpen:!0,blockCommentId:y}))},[y,M]),Q=(0,s.useCallback)(e=>{V("add-comment"),K(null),M((0,g.UX)({isOpen:!0,blockCommentId:y})),c(e)},[y,M,c]),ee=(0,s.useCallback)(()=>{V("add-reaction"),K(null),M((0,g.UX)({isOpen:!0,blockCommentId:y}))},[y,M]),et=(0,s.useCallback)(function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];V(null),K(null),u(),M((0,g.UX)({isOpen:!1,blockCommentId:y})),e&&R(1e3)},[y,u,R,M]),{addReactionFn:en,removeReactionFn:er}=eH({editor:o,getPos:a,reactions:d}),eo=(0,s.useCallback)(e=>{f&&(en({emoji:e.id}),T({title:(0,r.jsx)(ev,{emoji:e.id,isMobile:N}),status:"success",duration:5e3,isClosable:!1,position:N?"bottom":"top"}),et(!0))},[en,et,N,T,f]),ei=(0,s.useCallback)(e=>{h(e),et(!0)},[h,et]),ea=(0,s.useCallback)(e=>{if(!f)return;let t=e.reactions.find(e=>{var t;return null===(t=e.users)||void 0===t?void 0:t.find(e=>e.id===(null==_?void 0:_.id))});t?er({reaction:t}):en({emoji:e.emoji})},[en,er,_,f]),el=(0,s.useCallback)(()=>{V("reactions-overflow"),K(null),M((0,g.UX)({isOpen:!0,blockCommentId:y}))},[y,M]);J({isOpen:q,popupRef:W,onClose:et});let{isExpanded:es}=X({popup:G,isMobile:N,isHovered:D,comments:l,reactions:d,draftComment:m,enableReactions:I});(0,s.useEffect)(()=>{N||z(D)},[D,N,z]),(0,A.c0)(a,Q);let ed=(0,A.m0)({comments:l,blockAllowsCommenting:b,showComment:(0,s.useCallback)(e=>{(0,j.pE)({pos:a(),editor:o}),Y({id:e})},[o,a,Y])});(0,s.useEffect)(()=>{k.pw.emit(k.TI.POPUP_COMMENT_TOGGLED,{open:q})},[q]);let ec=(0,s.useCallback)(e=>{"Escape"===e.key&&et()},[et]);if(!n||L)return null;let eu=!!_&&!f,eh=0===l.length&&0===d.length;if((eu||!b)&&eh)return null;let eg=eu||!b;return(0,r.jsxs)(r.Fragment,{children:[N&&E&&(0,r.jsx)(em,{onClickAddComment:Q,onClickAddReaction:ee,top:E.top,left:E.left}),(0,r.jsxs)(U.C,{nodeName:t,className:(0,i.cx)("block-comments-stack",es&&"is-expanded",es&&"is-taking-action",eh&&"is-empty",!N&&F&&"other-comment-open"),isMobile:N,isEmpty:eh,isPopupOpen:q,...H,buttonRef:O,onKeyDown:ec,hasCommentsOrReactions:!eh,children:[(0,r.jsx)(ep,{isExpanded:es,isMobile:N,user:_,userCanComment:f,blockAllowsCommenting:b,draftComment:m,reactions:d,comments:l,onClickThread:Y,onClickAddComment:Q,onClickAddReaction:ee,onClickExistingReaction:ea,onClickReactionsOverflow:el,hideAddCommentButton:eg,onClosePopup:et,viewingCommentId:$,enableReactions:I}),!q&&!N&&(0,r.jsx)(ef,{isExpanded:es,comments:l,reactions:d}),q&&(0,r.jsxs)(eN,{isMobile:N,ref:W,closePopup:et,drawerMinHeight:eD[G],children:["thread"===G&&(0,r.jsx)(eP,{isMobile:N,comment:Z,closePopup:et,editor:o,getPos:a,commentIdToHighlight:ed,commentsPanelRef:B,userCanComment:f,blockAllowsCommenting:b}),"add-comment"===G&&(0,r.jsx)(ek,{isMobile:N,onCancel:()=>{et()},editor:o,getPos:a,commentIdToHighlight:ed,userCanComment:f,blockAllowsCommenting:b,onCommentSave:ei,draftComment:m,onCommentDraftUpdate:p}),"add-reaction"===G&&(0,r.jsx)(eS,{isMobile:N,onReactionClick:eo,editor:o,getPos:a}),"reactions-overflow"===G&&(0,r.jsx)(e_,{isMobile:N,onCancel:()=>{et()},onClickExistingReaction:ea,editor:o,getPos:a,user:_,userCanComment:f,blockAllowsCommenting:b,reactions:d})]})]})]})};var eB=n(29978);let eF=e=>{let{children:t,as:n,className:o,style:i,hideComments:a=!1,readOnly:l=!1,...s}=e,{decorations:d,editor:c}=s,u=(0,p.C7)(),m=d.some(e=>e.spec.isAnnotatable);return!m||c.isThumbnail||u?(0,r.jsx)(h.T5,{as:n,className:o,style:i,children:t}):(0,r.jsx)(eW,{as:n,className:o,style:i,hideComments:a,readOnly:l,...s,children:t})},eW=e=>{var t;let{children:n,decorations:p,editor:C,getPos:w,as:k,className:j,style:S,hideComments:I,readOnly:E,node:z}=e,{isConnected:T}=(0,d.$gs)(),N=(0,b.iS)(p),M=y({editor:C,decorations:p}),_=(0,c.ye)("blockReactions"),L=(0,m.Br)("comment"),P=(0,u.CG)(g.kk),R=(0,s.useMemo)(()=>
1(0,l.x0)(5),[]),H=(0,u.CG)((0,g.Ze)(R)),[D,O]=(0,s.useState)(!1),B=(0,c.ye)("debugComments"),F=(0,A.vY)(p),W=F[0]||null,[G,U]=(0,s.useState)(null),V=(0,u.TL)(),q=(0,s.useCallback)(e=>{let t=(null==e?void 0:e.getPos)||w,n=null==e?void 0:e.targetHtml,r=W;if(r)e&&(r=(0,eB.kr)(r,t,n,C));else{var o,i;r=(0,eB.xN)(t,C,n),null===(o=(i=C.commands).createDraftComment)||void 0===o||o.call(i,r)}U(r),V((0,g.Qx)({attached:!1}))},[V,C,w,W]),$=(0,s.useCallback)(()=>{var e,t,n,r,o,i;G&&(null==G?void 0:null===(t=G.text)||void 0===t?void 0:null===(e=t.trim())||void 0===e?void 0:e.length)>0?null===(n=(r=C.commands).createDraftComment)||void 0===n||n.call(r,G):null===(o=(i=C.commands).removeDraftComments)||void 0===o||o.call(i,F),U(null)},[F,C,G]),K=(0,s.useRef)(H);K.current=H,(0,s.useEffect)(()=>()=>{K.current&&V((0,g.UX)({isOpen:!1,blockCommentId:R}))},[R,V]);let Z=(0,A.iZ)({draftComment:G,clearDraftComment(){var e,t,n,r;G&&(null===(n=(r=C.commands).removeDraftComments)||void 0===n||n.call(r,[G,...F]));let o=(0,eB.xN)(w,C);null===(e=(t=C.commands).createDraftComment)||void 0===e||e.call(t,o),U(o)},editor:C}),Y=(0,A.xA)(p),X=Y.length>0&&!I,J=G||W,Q=(null==J?void 0:null===(t=J.text)||void 0===t?void 0:t.length)>0,[ee,et]=(0,v.XI)(),en=(0,A.Zz)(p);_||(en=[]);let er=en.length>0,eo=(0,x.s2)()&&(H||X||er||!!M)||!(0,x.s2)()&&(et||N||H||X||er||Q),ei=H||M||D?(0,f.tT)(a.qZ.colors.yellow[200],.25):void 0;return(0,r.jsxs)(h.T5,{as:k,style:{...S,position:"relative",backgroundColor:(0,x.s2)()?void 0:ei},className:(0,i.cx)(j,"annotatable-node-view-wrapper",(0,x.s2)()&&"is-mobile",B?"debug-comments":""),ref:ee,children:[P&&!I&&L&&(0,r.jsx)(eO,{nodeName:z.type.name,isVisible:eo,reactions:en,blockCommentId:R,userCanComment:L&&T,blockAllowsCommenting:!I&&!E,onCommentDraftUpdate:e=>{let{editor:t}=e;U(e=>e?{...e,json:t.view.state.doc.toJSON(),text:t.view.state.doc.textContent}:e)},cleanupDraftComment:$,createDraftComment:q,editor:C,getPos:w,comments:Y,draftComment:J,onCommentSave:Z,enableReactions:_,mobileAddCommentPos:M,setIsButtonStackHovered:O}),(0,x.s2)()&&ei?(0,r.jsx)(o.xu,{bgColor:ei,children:n}):n]})}},3561:function(e,t,n){"use strict";n.d(t,{C:function(){return c},G:function(){return d}});var r=n(52322),o=n(28535),i=n(29117),a=n(38035),l=n(2784);let s=(0,l.memo)(e=>{let{nodeName:t}=e;return(0,r.jsx)(o.Cd,{contentEditable:!1,userSelect:"none",right:0,size:4,transform:"translate(calc(".concat("gridLayout"===t||"gallery"===t?"-1 * var(--grid-padding)":"0px"," + var(--comment-padding) + 50%),calc(50%)) scale(1)"),position:"absolute",bgGradient:"linear(to-b, yellow.200, yellow.300)",border:"1px solid white",shadow:"0 0 0 1px rgb(0 0 0 / 10%)",className:"block-comments-circle",zIndex:"1"})});s.displayName="BlockCommentsCircle";let d="comments-wrapper",c=(0,l.forwardRef)(function(e,t){let{nodeName:n,isPopupOpen:l,onKeyDown:c,buttonRef:u,isMobile:p,hasCommentsOrReactions:m,children:h,isEmpty:g,...f}=e;return(0,r.jsxs)(o.xu,{ref:t,contentEditable:!1,suppressContentEditableWarning:!0,pointerEvents:"none","data-comments-wrapper":!0,"data-is-popup-open":l,className:d,alignSelf:"start",onKeyDown:c,"data-print-hidden":!0,children:[!g&&!p&&(0,r.jsx)(s,{nodeName:n}),(0,r.jsx)(i.U,{contentEditable:!1,suppressContentEditableWarning:!0,...p?m?{pt:4}:{}:{position:"absolute",marginLeft:"100%",top:0,height:"100%",align:"flex-start"},className:"controls-wrapper controls-wrapper__".concat(n),children:(0,r.jsx)(a.k,{direction:"row",ref:u,contentEditable:!1,suppressContentEditableWarning:!0,transitionProperty:"common",transitionDuration:"fast",zIndex:21,"data-controls-toggle-button":!0,ml:[0,"-17px"],...f,children:h})})]})})},60265:function(e,t,n){"use strict";n.d(t,{K0:function(){return s},KT:function(){return d},U6:function(){return l}});var r=n(52322),o=n(38035),i=n(7207),a=n(57480);let l="block-comments-container",s="2xl",d=e=>{let{offsetFromTop:t,children:n}=e;return(0,r.jsx)(o.k,{contentEditable:!1,suppressContentEditableWarning:!0,color:"gray.900",className:l,direction:"column",bg:"white",borderRadius:"xl",shadow:"xl",overflowY:"auto",transitionProperty:"common",transitionDuration:"normal",zIndex:"sticky",bottom:{top:"0px",[s]:"auto"},top:{top:"0px",[s]:"auto"},width:{base:a.bk,[s]:a.bk}
1,maxW:{base:"90vw",md:"80vw",[s]:a.bk},right:{base:"44px",[s]:0},transform:{base:"translate(0, ".concat(t,"px)"),[s]:"translate(calc(100% + 10px), 0)"},wordBreak:"break-word",height:"fit-content",maxHeight:"calc(".concat(i.i," - 8em)"),position:"absolute",children:n})}},77182:function(e,t,n){"use strict";n.d(t,{H8:function(){return i},Nq:function(){return s},gq:function(){return d},z3:function(){return l}}),n(3440);var r=n(84636),o=n.n(r);let i=(e,t)=>{for(let n of e){if(n.id===t)return t;let e=n.replies||[];for(let r of e)if(r.id===t)return n.id}return null},a=e=>{let{reactions:t,emoji:n,user:r}=e,o=t.find(e=>e.emoji===n);return o&&o.reactions.find(e=>{var t;return e.emoji===n&&(null===(t=e.users)||void 0===t?void 0:t.find(e=>e.id===(null==r?void 0:r.id)))})||null},l=e=>{let{reactions:t,emoji:n,user:r}=e;return!!a({reactions:t,emoji:n,user:r})},s=e=>{let{reactions:t,emoji:n}=e,r=t.find(e=>e.emoji===n);return r&&r.reactions.find(e=>e.emoji===n)||null},d=e=>o()(e.reactions.flatMap(e=>e.users),"id")},43970:function(e,t,n){"use strict";n.d(t,{q:function(){return ev}});var r=n(52322),o=n(70065),i=n(77533),a=n(11082),l=n(50019),s=n(38035),d=n(43297),c=n(28535),u=n(87651),p=n(29117),m=n(109),h=n(42946),g=n(49929),f=n(5879),x=n(87254),v=n(2784),b=n(43997),y=n(93202),C=n(24781),w=n(92440),k=n(69747),j=n(57480),S=n(13608),A=n(93814),I=n(96255),E=n(47968),z=n(11093),T=n(56943),N=n(80498),M=n(90221),_=n(78462),L=n(90604),P=n(50105),R=n(32899),H=n(89099),D=n(94523),O=n(36651),B=n(62549),F=n(66028);let W=e=>{let{docId:t,cardId:n,commentId:r,parentCommentId:o,targetType:i}=e,[a]=(0,y.Os4)(),[l]=(0,y.d6Z)();function s(e,a,l,s){let d={targetId:i===y.Lmy.Comment?r:n,docId:t,emoji:a,cardId:n};if("addReaction"===e&&(d={...d,targetType:i}),i===y.Lmy.Comment)return{variables:{reactionInput:d},update:(n,i)=>{let{data:a}=i;n.writeFragment({id:"Doc:".concat(t),fragment:y.f,fragmentName:"DocCommentsUpdate",data:{comments:[o?{id:o,replies:[{id:r,reactions:[a[e]],__typename:"Comment"}],reactions:[],__typename:"Comment"}:{id:r,replies:[],reactions:[a[e]],__typename:"Comment"}]}})},optimisticResponse:{[e]:{commentId:r,count:l,emoji:a,users:s,cardId:n,__typename:"Reaction"}}};console.error("[useReactionUpdate] Invalid targetType: ".concat(i))}return{addReactionFn:(e,t,n)=>{a(s("addReaction",e,t,n))},removeReactionFn:(e,t,n)=>{l(s("removeReaction",e,t,n))}}};var G=n(76643),U=n(332),V=n(94207),q=n(55478),$=n(35741),K=n(27354);let Z=(e,t)=>e===t||null!=e.parentElement&&Z(e.parentElement,t),Y=e=>{let{setPopperElement:t,onPopoverClose:n,handleReactionClick:o,popperElement:i,openerElement:a,usePortal:l,isMobile:s,placement:d,...u}=e;(0,G.O)({ref:{current:i},handler(e){a&&Z(e.target,a)||n()}});let p=(0,r.jsx)(c.xu,{mx:s?0:3,mt:s?0:"-110px",shadow:"lg",bg:"white",p:"0",w:"auto",minW:"0px",zIndex:"tooltip","data-target-name":"reaction-emoji-picker",ref:t,...u,children:(0,r.jsx)(K.h5,{perLine:s?9:12,handlePick:e=>{o(e.id),n()},shouldFocusSearch:!(0,M.s2)()})});return l?(0,r.jsx)(U.h,{children:p}):p},X=e=>{let{size:t,colorScheme:n,handleReactionClick:o,placement:i,usePortal:a=!0}=e,[l]=(0,V.a)(["(max-width: 840px)","(min-width: 841px)"]),{isOpen:s,onToggle:d,onClose:u}=(0,q.q)(),[p,m]=(0,v.useState)(!1),[b,y]=(0,v.useState)(null),[C,w]=(0,v.useState)(null),{styles:k,attributes:j,forceUpdate:S}=(0,$.D)(b,C,{placement:l?"auto":"".concat(i,"-start"),strategy:"fixed"});return(0,v.useEffect)(()=>{S&&setTimeout(()=>{S()},0)},[S]),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(D.kH,{placement:ee,label:(0,r.jsx)(f.cC,{id:"9OEgyT"}),isOpen:p,children:(0,r.jsx)(c.xu,{display:"flex",onMouseEnter:()=>{m(!0)},onMouseLeave:()=>m(!1),children:(0,r.jsx)(R.h,{colorScheme:n,float:"inline-start","aria-label":x.ag._({id:"9OEgyT"}),variant:"ghost",onClick:e=>{d(),e.stopPropagation()},size:t||"sm",ref:y,isRound:!0,icon:(0,r.jsx)(g.G,{icon:h.wqT})})})}),s&&(0,r.jsx)(Y,{usePortal:a,setPopperElement:w,onPopoverClose:u,handleReactionClick:o,popperElement:C,isPopoverOpen:s,openerElement:b,style:k.popper,isMobile:l,placement:i,...j.popper})]})};var J=n(62614);let Q=e=>{let{colorScheme:t,size:n,emoji:o,label:a,count:s,hasSelfReacted:d,handleReactionClick:u,readOnly:p}=e,{colorMode:m}=(0,l.If)(),h="light"===m,g=(0,v.useCallback)(e=>{p||u(o,e)},[o,u,p]);return(0,r.jsx)(D.kH,{placement:ee,label:(0,r.jsxs)(c.xu,{alignContent:"center",children:[a,!p&&(0,r.jsx)(i.x,{display:"block",color:h?"gray.500":"gray.700",children:d?(0,r.jsx)(f.cC,{id:"fb/FjL"}):(0,r.jsx)(f.cC,{id:"AG3H1y"})})]}),children:(0,r.jsxs)(J.z,{cursor:p?"default":"cursor","data-testid":"reaction-button-".concat(o),size:n||"sm",color:h?"gray.500":"gray.300",bg:d?h?"gray.100":"gray.700":"none",borderWidth:"1px",borderStyle:"solid",colorScheme:t,borderColor:d?h?"gray.200":"gray.500":"transparent",_hover:{bg:h?"gray.200":"gray.600"},variant:"ghost",borderRadius:"full",px:2,onClick:g,children:[(0,r.jsx)(K.Sr,{emojiId:o,fontSize:"sm"===n?"lg":"sm"}),(0,r.jsx)(i.x,{as:"span",fontSize:n,ml:1.5,children:s})]})})},ee="bottom",et=e=>{let{size:t,colorScheme:n,placement:o="right",usePortal:a,reactions:l,docId:d,cardId:c,commentId:u,parentCommentId:p,targetType:m,readOnly:x,innerPaddingY:v,...b}=e,{addReactionFn:C,removeReactionFn:w}=W({docId:d,commentId:u,parentCommentId:p,cardId:c,targetType:m}),{user:k}=(0,O.SE)(),j=(null==l?void 0:l.reduce((e,t)=>
1(t.count&&(e[t.emoji]=t),e),{}))||{},S=!x&&m===y.Lmy.Card&&!j.heart,A=Object.keys(j).length>0,I=(e,t)=>{var n,r,o,i,a,l;if(!(m===y.Lmy.Comment&&u||m===y.Lmy.Card&&c))throw Error("[Reactions.handleReactionClick] Invalid targetType. Args: targetType: ".concat(m,", commentId: ").concat(u,", cardId: ").concat(c));let s=null===(r=j[e])||void 0===r?void 0:null===(n=r.users.find(e=>e.id===(null==k?void 0:k.id)))||void 0===n?void 0:n.id;if(s){let t=(null==j?void 0:null===(o=j[e])||void 0===o?void 0:o.count)-1,n=(null==j?void 0:null===(i=j[e])||void 0===i?void 0:i.users)?j[e].users.filter(e=>e.id!==(null==k?void 0:k.id)):[];w(e,t,n)}else{let t=(null==j?void 0:null===(a=j[e])||void 0===a?void 0:a.count)?j[e].count+1:1,n=(null==j?void 0:null===(l=j[e])||void 0===l?void 0:l.users)?j[e].users.concat(k):[k];C(e,t,n)}null==t||t.stopPropagation()};return(0,r.jsxs)(s.k,{direction:"row",cursor:"default",contentEditable:!1,onMouseDown:F.br,mb:v?"-".concat(v/1.5,"rem"):void 0,...b,children:[S&&(0,r.jsx)(D.kH,{label:(0,r.jsx)(f.cC,{id:"W9FRBT"}),placement:ee,children:(0,r.jsx)(R.h,{colorScheme:n,float:"inline-start","aria-label":"",variant:"ghost",onClick:e=>{I("heart",e)},size:t,isRound:!0,mr:2,icon:(0,r.jsx)(g.G,{icon:h.m6i})})}),!x&&(0,r.jsx)(X,{size:t,colorScheme:n,handleReactionClick:I,usePortal:a,placement:o}),A&&(0,r.jsx)(H.E,{spacing:"sm"===t?2:1,mr:2,className:"reactions-row",children:A&&Object.entries(j).map(e=>{let[o,a]=e,l=null==a?void 0:a.users,s=!!(null==l?void 0:l.find(e=>(null==e?void 0:e.id)===(null==k?void 0:k.id))),d=(0,B.Rf)({users:l,selfUserId:null==k?void 0:k.id});return(0,r.jsx)(Q,{colorScheme:n,size:t,emoji:o,readOnly:x,label:(0,r.jsx)(r.Fragment,{children:(0,r.jsx)(f.cC,{id:"mRnNF/",values:{usersLabel:d,emoji:o},components:{0:(0,r.jsx)(i.x,{as:"span",color:"gray.300"})}})}),count:null==l?void 0:l.length,hasSelfReacted:s,handleReactionClick:I},o)})})]})},en=v.memo(e=>{let{docId:t,reactions:n,cardId:o,commentId:i,size:a,parentCommentId:l,placement:s="right",usePortal:d=!0,userCanComment:c,...u}=e;return(0,r.jsx)(et,{size:a,cardId:o,usePortal:d,placement:s,reactions:n,parentCommentId:l,docId:t,commentId:i,targetType:y.Lmy.Comment,readOnly:!c,...u})});var er=n(40015),eo=n(26284),ei=n(36474),ea=n(10625),el=n(67046),es=n(99058),ed=n(25481),ec=n(27599),eu=n(82108),ep=n.n(eu),em=n(46640);let eh=()=>({[y.Ux9.Open]:{label:x.ag._({id:"9ggh96"}),icon:h.f8k,successMessage:x.ag._({id:"1INZuT"})},[y.Ux9.Closed]:{label:x.ag._({id:"pL38RI"}),icon:h._1v,successMessage:x.ag._({id:"gieGvY"})}}),eg=e=>{let{status:t,handleCommentStatusUpdate:n}=e;return(0,r.jsx)(D.kH,{label:eh()[t].label,"aria-label":eh()[t].label,children:(0,r.jsx)(R.h,{variant:"ghost",size:"sm",borderRadius:"full",isDisabled:!1,"aria-label":eh()[t].label,icon:(0,r.jsx)(g.G,{icon:eh()[t].icon}),onClick:()=>n(t)})})},ef=e=>{let{comment:t,selfUser:n,isInPanel:a,isSourceContentAvailable:u,showCopyCommentLink:v,showLinkToTargetContent:b,hasCommentBeenUpdated:C,onTargetClick:w,commentUrl:k,isReply:j,userCanComment:S,handleCommentStatusUpdate:A,toastPosition:I,isEditing:E,handleEditCommentClick:z,handleDeleteCommentClick:T}=e,{user:N,createdTime:M,updatedTime:_,status:L=y.Ux9.Open}=t,{email:P,displayName:H,profileImageUrl:O}=N,B=(null==n?void 0:n.id)===(null==N?void 0:N.id),{onCopy:F}=(0,eo.V)(k),W=(0,l.ff)("red.500","red.300"),G=(0,o.p)();return(0,r.jsxs)(p.U,{spacing:2,align:"top",mb:3,_before:a?{content:"''",position:"absolute",w:"9px",h:"9px",mt:"15px",left:j?"12px":"36px",bg:"gray.100",borderRadius:"full"}:{},children:[(0,r.jsx)(D.kH,{label:P,"aria-label":P,children:(0,r.jsx)(m.q,{mt:1,size:"sm",name:H,src:O,ignoreFallback:!0})}),(0,r.jsxs)(d.K,{align:"center",alignItems:"flex-start",spacing:0,mb:1,children:[(0,r.jsxs)(i.x,{fontWeight:"600",mb:0,fontSize:"sm",children:[H," ",B?(0,r.jsx)(f.cC,{id:"dDUgzP"}):null]}),(0,r.jsx)(s.k,{direction:"row",w:"100%",alignItems:"flex-start",children:(0,r.jsx)(c.xu,{flex:"1",children:(0,r.jsx)(D.kH,{isDisabled:!C,label:"Updated ".concat((0,em.P9)(_)),placement:"top",children:(0,r.jsxs)(p.U,{children:[(0,r.jsx)(i.x,{my:"0 !important",className:"comment-date",fontSize:"xs",color:"gray.500",children:ep()((0,em.P9)(M))}
1),C&&(0,r.jsx)(c.xu,{color:"gray.500",children:(0,r.jsx)(g.G,{size:"xs",icon:h.HMF})})]})})})})]}),(0,r.jsx)(ei.L,{}),(0,r.jsxs)(p.U,{spacing:1,children:[b&&(0,r.jsx)(D.kH,{label:u?(0,r.jsx)(f.cC,{id:"LmLruJ"}):(0,r.jsx)(f.cC,{id:"/oHV5h"}),shouldWrapChildren:!0,children:(0,r.jsx)(R.h,{size:"sm",borderRadius:"full",variant:"ghost",isDisabled:!u,"aria-label":u?x.ag._({id:"LmLruJ"}):x.ag._({id:"/oHV5h"}),onClick:w,icon:(0,r.jsx)(g.G,{icon:h.FR9})})}),!j&&S&&(0,r.jsx)(eg,{status:L,handleCommentStatusUpdate:()=>A(t.status)}),(0,r.jsxs)(ea.v,{isLazy:!0,children:[(0,r.jsx)(el.j,{as:R.h,size:"sm",variant:"ghost",borderRadius:"full","data-testid":"comment-header-menu",icon:(0,r.jsx)(g.G,{fixedWidth:!0,icon:h.cNd}),children:(0,r.jsx)(f.cC,{id:"7L01XJ"})}),(0,r.jsx)(U.h,{children:(0,r.jsxs)(es.q,{zIndex:"popover","data-testid":"comment-header-menulist",children:[v&&(0,r.jsx)(ed.s,{icon:(0,r.jsx)(g.G,{icon:h.nNP}),onClick:()=>{F(),G({title:x.ag._({id:"h5GS+N"}),status:"success",duration:3e3,position:I})},children:(0,r.jsx)(f.cC,{id:"qhJCCi"})}),S&&!E&&B&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(ec.R,{}),(0,r.jsx)(ed.s,{icon:(0,r.jsx)(g.G,{icon:h.Xcf}),onClick:z,children:(0,r.jsx)(f.cC,{id:"ePK91l"})}),(0,r.jsx)(ed.s,{icon:(0,r.jsx)(g.G,{icon:h.XAH}),color:W,onClick:()=>{T()},"data-testid":"delete-thread",children:j?(0,r.jsx)(f.cC,{id:"FjzXBu"}):(0,r.jsx)(f.cC,{id:"xOviNB"})})]})]})})]})]})]})};var ex=n(99421);let ev=(0,v.memo)(e=>{let{comment:t,editor:n,selfUser:R,docId:H,commentIdToHighlight:D,userCanComment:O,instanceType:B,editorMode:F,isRootComment:W=!1,onClose:G,closePopup:U,...V}=e,q="feed"===B,$="drawer"===B,K=(0,M.s2)()?"bottom":"top",{content:Z,targetHtml:Y,targetId:X,createdTime:J,updatedTime:Q,id:ee,replies:et,reactions:eo}=t,ei=(0,b.I0)(),{initialDraftReply:ea,updateLocalDraftReply:el,hasLocalDraftReply:es}=(0,er.nG)(ee),ed=(0,v.useRef)(new N.B),ec=D===ee,eu=(0,_.W2)({docId:H,id:ee}),ep=(0,v.useRef)(null),[em,eg]=(0,v.useState)(!1),[eb,ey]=(0,v.useState)(W);(0,v.useEffect)(()=>{es&&!eb&&ey(!0)},[es,eb]);let[eC]=(0,y.sHn)(),[ew]=(0,y.oRU)(),[ek]=(0,y.qHm)(),[ej]=(0,y.n70)(),eS=(0,o.p)(),eA=(0,C.As)("editor"),eI=(0,v.useCallback)(()=>{eg(!0)},[]),eE=(0,v.useCallback)(()=>{el(null)},[el]),ez=[.25,.1,.25,1];(0,v.useLayoutEffect)(()=>{ec&&ep.current&&eA.scrollElementIntoView({element:ep.current})},[eA,ec]);let eT=e=>{let t=e===y.Ux9.Open?y.Ux9.Closed:y.Ux9.Open,n={id:ee,docId:H,status:t};ek({variables:{input:n},update:(e,t)=>{let{data:n}=t,r={id:"Doc:".concat(H),fragment:T.Hn,fragmentName:"DocCommentsUpdate",data:{comments:[null==n?void 0:n.updateCommentStatus]}};e.writeFragment(r)},optimisticResponse:{updateCommentStatus:{...n,__typename:"Comment",updatedTime:new Date().toISOString()}}}).then(()=>{eS({title:(0,r.jsxs)(i.x,{children:[eh()[e].successMessage,"."," ",(0,r.jsx)(a.r,{textDecoration:"underline",onClick:()=>eT(t),children:x.ag._({id:"9uI/rE"})})]}),status:"success",duration:5e3,isClosable:!1,position:K})}).catch(e=>{console.error("[CommentComponent]: Error changing comment status",e),eS({title:x.ag._({id:"+Q5eww",values:{0:e.message}}),status:"error",isClosable:!0,position:K})}).finally(()=>{"popup"===B&&U&&U(!0)})},eN=(0,l.ff)("yellow.100","yellow.800"),eM=P.Z.getState(n.state),e_=(0,v.useMemo)(()=>null==eM?void 0:eM.annotations.find(e=>e.id===X),[null==eM?void 0:eM.annotations,X]),{pos:eL}=e_||{},eP=!!(null==e_?void 0:e_.pos),eR="notification"!==B&&t.id!==j.Gt,eH=("notification"===B||"feed"===B)&&eL!==j.Et,eD=(0,v.useCallback)(e=>{var t;if(!(!X||!e_||!eL||(null===(t=null==e?void 0:e.target)||void 0===t?void 0:t.closest('[data-target-name="comment-target-expand-button"]')))){if("notification"===B)k.pw.emit
1(k.TI.OPEN_POPUP_COMMENT,{commentId:ee,highlightComment:!0});else if("feed"===B){let e=A.nY,t=(0,z.Sh)(n,eL);if(F===L.q.DOC_VIEW)(0,S.pE)({pos:eL,editor:n});else if(F===L.q.SLIDE_VIEW){let[t]=(0,z.nv)(n.state.doc.resolve(eL),I.KH);n.commands.spotlightCardById(t.node.attrs.id),ei((0,E.Qx)({attached:!1})),e=A.id}(0,M.s2)()&&G&&setTimeout(G,300),eA.scrollElementIntoView({element:t,delay:e})}}},[n,eA,X,B,ee,e_,eL,F,ei,G]),eO=(0,v.useMemo)(()=>new Date(Q).getTime()-new Date(J).getTime()>100,[Q,J]),eB=!!t.commentId,eF=!!et&&et.length>0;return(0,r.jsxs)(s.k,{flexDir:"column",ref:ep,id:"comment-".concat(ee),className:"comment highlight-mask","data-target-id":"comment-".concat(ee),borderRadius:ec?"md":"0px",position:"relative",borderBottomWidth:W?"1px":"0px",borderBottomColor:"gray.200",_after:q&&eF?{content:"''",position:"absolute",w:"9px",h:"9px",left:"36px",bottom:9,bg:"gray.100",borderRadius:"full",transitionPropery:"common",transitionDuration:"normal"}:{},_before:eF&&q?{content:"''",position:"absolute",w:"3px",top:7,bottom:9,left:"39px",bg:"gray.100",borderRadius:"full"}:{},...V,overflowY:"hidden",children:[(0,r.jsxs)(d.K,{backgroundColor:ec?eN:"auto",transitionProperty:"border, background",transitionDuration:"normal",transitionTimingFunction:"ease",role:"group",spacing:8,children:[(0,r.jsxs)(c.xu,{pl:eB&&q?10:0,children:[(0,r.jsx)(ef,{isInPanel:q,comment:t,selfUser:R,isSourceContentAvailable:eP,showCopyCommentLink:eR,showLinkToTargetContent:eH,hasCommentBeenUpdated:eO,onTargetClick:eD,commentUrl:eu,isReply:eB,userCanComment:O,handleCommentStatusUpdate:eT,toastPosition:K,isEditing:em,handleEditCommentClick:eI,handleDeleteCommentClick:()=>{let e=!!t.commentId;ej({variables:{id:ee},update:(n,r)=>{let{data:o}=r;n.writeFragment({id:"Doc:".concat(H),fragment:T.Hn,fragmentName:e?"DocRepliesRemove":"DocCommentsRemove",data:{comments:[e?{id:t.commentId,replies:[null==o?void 0:o.archiveComment],__typename:"Comment"}:null==o?void 0:o.archiveComment]}})},optimisticResponse:{archiveComment:{id:ee,__typename:"Comment",archived:!0}}}),!e&&t.targetId&&n.commands.deleteAnnotation(t.targetId),"popup"===B&&U&&U(!0),eS({title:x.ag._({id:"Ho/Jvc"}),status:"success",duration:5e3,isClosable:!1,position:K})}}),(0,r.jsxs)(c.xu,{pl:eF&&q?10:0,overflowY:"hidden",children:[Y&&Y.length&&(0,r.jsx)(ex.p,{targetHtml:Y,onTargetClick:eD,isSourceContentAvailable:eP,instanceType:B}),(0,r.jsx)(w.S,{initialContent:Z,editable:em,onCancelEditingClick:()=>eg(!1),saveButtonText:(0,r.jsx)(f.cC,{id:"yY7Bil"}),saveButtonIcon:(0,r.jsx)(g.G,{icon:h.LEp}),onCommentSave:e=>{let n=!!t.commentId,r={id:ee,docId:H,content:e};ew({variables:{input:r},update:(e,r)=>{let{data:o}=r,i={id:"Doc:".concat(H),fragment:T.Hn,fragmentName:n?"DocRepliesUpdate":"DocCommentsUpdate",data:{comments:[n?{id:t.commentId,replies:[null==o?void 0:o.updateComment],__typename:"Comment"}:null==o?void 0:o.updateComment]}};e.writeFragment(i)},optimisticResponse:{updateComment:{...r,__typename:"Comment",updatedTime:new Date().toISOString()}}}),eS({title:x.ag._({id:"kibWwZ"}),status:"success",duration:5e3,isClosable:!1,position:K}),eg(!1)}}),!em&&(0,r.jsx)(en,{mt:2,docId:H,cardId:t.cardId,commentId:t.id,parentCommentId:t.commentId,reactions:eo,size:"sm",placement:"right",usePortal:!0,userCanComment:O})]})]}),et&&et.length>0&&et.map(e=>(0,r.jsx)(ev,{instanceType:B,userCanComment:O,commentIdToHighlight:D,comment:e,docId:H,selfUser:R,editor:n,editorMode:F,pl:0,p:0,pb:0},null==e?void 0:e.id))]}),O&&(0,r.jsxs)(u.U,{in:eb&&!em,unmountOnExit:!0,transition:{enter:{when:"afterChildren",height:{duration:.3,ease:ez},opacity:{duration:.4,ease:ez}},exit:{when:"beforeChildren",height:{duration:.2,ease:ez},opacity:{duration:.3,ease:ez}}},children:[$&&(0,r.jsxs)(p.U,{align:"center",mb:3,pt:6,children:[(0,r.jsx)(m.q,{mt:1,size:"sm",name:null==R?void 0:R.displayName,src:null==R?void 0:R.profileImageUrl,ignoreFallback:!0}),(0,r.jsx)(d.K,{align:"center",alignItems:"flex-start",spacing:0,mb:1,children:(0,r.jsx)(i.x,{fontWeight:"600",mb:0,fontSize:"sm",children:(0,r.jsx)(f.cC,{id:"866PMb",values:{0:null==R?void 0:R.displayName}})})})]}),(0,r.jsx)(w.S,{pl:q&&eF?8:0,pt:$?0:6,initialContent:(null==ea?void 0:ea.json)||"",clearContentOnSave:!0,editable:!0,saveButtonText:(0,r.jsx)(f.cC,{id:"ImOQa9"}),saveButtonIcon:(0,r.jsx)(g.G,{icon:h.Lh7}),placeholder:x.ag._({id:"ImOQa9"}),onCommentSave:e=>{let n={targetId:t.targetId,commentId:ee,docId:H,content:e,cardId:t.cardId};eC({variables:{input:n},update:(e,t)=>
1{let{data:n}=t;e.writeFragment({id:"Doc:".concat(H),fragment:T.Hn,fragmentName:"DocRepliesCreate",data:{comments:[{id:ee,replies:[null==n?void 0:n.createComment],__typename:"Comment"}]}})},optimisticResponse:{createComment:{id:j.Gt,__typename:"Comment",...n,user:R,archived:!1,reactions:[],createdTime:new Date().toISOString(),updatedTime:new Date().toISOString()}}}),ey(!1),el(null),ei((0,E.pS)({id:ee})),eS({title:x.ag._({id:"yPok8v"}),status:"success",duration:5e3,isClosable:!1,position:K})},onCancelEditingClick:eE,onUpdate:e=>{let{editor:t}=e;el({commentId:ee,json:t.view.state.doc.toJSON(),text:t.view.state.doc.textContent})},onCreate:e=>{ed.current.resolve(e)},alwaysShowButtons:$,shouldFocus:"popup"===B||"drawer"===B})]})]})})},96071:function(e,t,n){"use strict";n.d(t,{I:function(){return a}});var r=n(52322),o=n(74008),i=n(75279);let a=e=>{let{accessLink:t,doc:n,className:a,showDivider:l=!0}=e;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(i.A2,{accessLink:t,doc:n,p:6,spacing:4,className:a}),l&&(0,r.jsx)(o.i,{})]})}},99421:function(e,t,n){"use strict";n.d(t,{p:function(){return f}});var r=n(52322),o=n(38035),i=n(28535),a=n(32899),l=n(42946),s=n(49929),d=n(94523),c=n(5879),u=n(87254),p=n(14304),m=n.n(p),h=n(2784),g=n(1198);let f=e=>{let{targetHtml:t,onTargetClick:n,isSourceContentAvailable:p,instanceType:f}=e,[x,v]=(0,h.useState)(!1),[b,y]=(0,h.useState)(!1),C=(0,h.useRef)(null),w=(0,g.jj)(),k=x?void 0:3,j=x?l._qI:l.yh$,S=x?u.ag._({id:"vLyv1R"}):u.ag._({id:"fMPkxb"});return(0,h.useEffect)(()=>{var e;if(!C.current)return;let t=!x&&C.current.scrollHeight<=(null===(e=C.current)||void 0===e?void 0:e.clientHeight);y(!t)},[x]),(0,r.jsxs)(o.k,{className:"block-target-html",pl:3,mb:2,borderLeftWidth:"4px",borderLeftStyle:"solid",borderLeftColor:"yellow.200",direction:"row",alignItems:"flex-end",cursor:p&&"feed"===f?"pointer":"auto",onClick:n,children:[(0,r.jsx)(d.kH,{label:(0,r.jsx)(c.cC,{id:"/oHV5h"}),isDisabled:!("feed"===f&&!p),portalProps:{containerRef:w},children:(0,r.jsx)(i.xu,{flex:1,ml:-3,pl:3,w:"100%",fontSize:"sm",noOfLines:k,dangerouslySetInnerHTML:{__html:t?m().sanitize(t):""},ref:C,_hover:{bgColor:"feed"===f?p?"yellow.100":"gray.100":void 0}})}),b&&(0,r.jsx)(d.kH,{label:S,portalProps:{containerRef:w},children:(0,r.jsx)(a.h,{variant:"ghost",size:"xs","aria-label":S,icon:(0,r.jsx)(s.G,{icon:j}),onClick:()=>{v(e=>!e)},"data-target-name":"comment-target-expand-button",isRound:!0})})]})}},794:function(e,t,n){"use strict";n.d(t,{A:function(){return h}});var r=n(52322),o=n(38035),i=n(29117),a=n(109),l=n(43297),s=n(77533),d=n(5879),c=n(87254),u=n(92440),p=n(90221),m=n(99421);let h=e=>{let{draftComment:t,showUser:n=!0,showBorder:h=!0,user:g,onCommentDraftUpdate:f,onCommentSave:x,commentIdToHighlight:v,alwaysShowButtons:b=!1,...y}=e;return(0,r.jsxs)(o.k,{direction:"column",...y,children:[n&&(0,r.jsxs)(i.U,{mb:3,pt:3,children:[(0,r.jsx)(a.q,{src:null==g?void 0:g.profileImageUrl,size:"sm"}),(0,r.jsx)(l.K,{children:(0,r.jsx)(s.x,{fontWeight:"bold",fontSize:"sm",children:(0,r.jsx)(d.cC,{id:"866PMb",values:{0:null==g?void 0:g.displayName}})})})]}),t&&(null==t?void 0:t.targetHtml)&&(0,r.jsx)(m.p,{targetHtml:t.targetHtml}),(0,r.jsx)(u.S,{onUpdate:f,initialContent:(null==t?void 0:t.json)||null,clearContentOnSave:!0,editable:!0,saveButtonText:(0,r.jsx)(d.cC,{id:"26iNma"}),placeholder:c.ag._({id:"UkDQUD"}),onCommentSave:x,showBorder:h,shouldFocus:!!(!(0,p.f_)()&&!v),alwaysShowButtons:b})]})}},29978:function(e,t,n){"use strict";n.d(t,{W1:function(){return s},kr:function(){return l},xN:function(){return a}});var r=n(46795),o=n(1787),i=n(17010);let a=(e,t,n)=>({targetId:o.v.generate(),targetHtml:n,json:null,text:"",relativePos:(0,r.jS)(t.state,e())}),l=(e,t,n,o)=>({...e,targetHtml:n,relativePos:(0,r.jS)(o.state,t())}),s=(e,t)=>{let n=i.N.getState(e.state);return Object.values(n.draftComments).filter(n=>(0,r.XV)(e.state,n.relativePos)===t)}},40015:function(e,t,n){"use strict";n.d(t,{Zz:function(){return R},c0:function(){return _},iZ:function(){return M},m0:function(){return L},nG:function(){return P},vY:function(){return N},xA:function(){return T}});var r=n(70065),o=n(87254),i=n(72338),a=n(3440),l=n.n(a),s=n(829),d=n.n(s),c=n(35838),u=n.n(c),p=n(18149),m=n.n(p),h=n(2784),g=n(43997),f=n(93202),x=n(91994),v=n(69747),b=n(47968),y=n(14647),C=n(91073),w=n(46795),k=n(36651),j=n(56943),S=n(90221),A=n(77182);let I=(0,S.s2)()?"bottom":"top";function E(e){return e?e.reduce((e,t)=>
1(t.targetId&&(e[t.targetId]?e[t.targetId].push(t):e[t.targetId]=[t]),e),{}):null}let z=e=>e.filter(e=>!!e.spec.isAnnotation),T=e=>{let t=(0,x.CG)(t=>{let n=(0,b.yx)(t),r=E(((null==n?void 0:n.comments)||[]).filter(e=>e.status===f.Ux9.Open));if(!r)return[];let o=z(e);return u()(o,e=>{let{spec:t}=e;return r[t.id]}).filter(Boolean)},m());return t},N=e=>e.filter(e=>!!e.spec.isDraftComment).map(e=>e.spec.comment),M=e=>{let{draftComment:t,clearDraftComment:n,editor:a}=e,[l]=(0,f.sHn)(),s=(0,r.p)(),d=a.gammaDocId,{user:c}=(0,k.SE)();return e=>{var r;if(!t)return;let{relativePos:u,targetId:p}=t,m=(0,w.XV)(a.state,u);if(!m)throw Error("Could not save comment, null pos from relativePos");let h=(0,i.qv)(a.state.doc.resolve(m),C.KH),g=a.view.state.doc.nodeAt(m),x=t.targetHtml||(0,y.ho)(g,["footnote","footnoteLabel","cardNotes"]),v=t.targetHtml||(0,y.iJ)(g,["footnote","footnoteLabel","cardNotes"]);a.commands.addAnnotation({id:p,pos:m});let b=null==h?void 0:null===(r=h.node)||void 0===r?void 0:r.attrs.id,k={targetId:p,docId:d,cardId:b,content:e,targetHtml:x,targetText:v};l({variables:{input:k},update:(e,t)=>{let{data:n}=t;e.writeFragment({id:"Doc:".concat(d),fragment:j.Hn,fragmentName:"DocCommentsCreate",data:{comments:[null==n?void 0:n.createComment]}})},optimisticResponse:{createComment:{id:"temp-id",commentId:"",__typename:"Comment",...k,content:JSON.parse(JSON.stringify(e)),user:c,archived:!1,reactions:[],replies:[],status:f.Ux9.Open,createdTime:new Date().toISOString(),updatedTime:new Date().toISOString()}}}),s({title:o.ag._({id:"4kSebh"}),status:"success",duration:5e3,isClosable:!1,position:I}),n()}},_=(e,t)=>{(0,h.useEffect)(()=>{let n=!0,r=r=>{let{selectionPos:o,parentPos:i,text:a}=r;if(!n)return;let l=e();l===i&&t({targetHtml:a,getPos:()=>o})};return v.pw.on(v.TI.CREATE_COMMENT_FROM_SELECTION,r),()=>{v.pw.on(v.TI.CREATE_COMMENT_FROM_SELECTION,r),n=!1}},[e,t])},L=e=>{let{showComment:t,comments:n,blockAllowsCommenting:r,highlightDuration:o=4e3}=e,[i,a]=(0,h.useState)(null);return(0,h.useEffect)(()=>{let e=!0,i=i=>{let{commentId:l,highlightComment:s=!1}=i;if(!e||!r)return;let d=(0,A.H8)(n,l);d&&(t(d),s&&(a(l),setTimeout(()=>{e&&a(null)},o)))};return v.pw.on(v.TI.OPEN_POPUP_COMMENT,i),()=>{v.pw.off(v.TI.OPEN_POPUP_COMMENT,i),e=!1}},[n,r,o,t]),i},P=e=>{let t=(0,g.I0)(),n=(0,x.CG)((0,b.Mk)(e)),r=(0,h.useRef)(null),[o,i]=(0,h.useState)(!1),a=(0,h.useCallback)(e=>{r.current=e,i(!!e)},[]),l=(0,h.useCallback)(()=>{r.current=n,i(!!n)},[n]),s=(0,h.useCallback)(()=>{var n;if(!r.current||!(null===(n=r.current.text)||void 0===n?void 0:n.length)){t((0,b.pS)({id:e}));return}t((0,b.qt)({id:e,reply:r.current}))},[e,t]),d=(0,h.useRef)(s);return(0,h.useEffect)(()=>{d.current=s},[s]),(0,h.useEffect)(()=>(l(),()=>{d.current()}),[]),{hasLocalDraftReply:o,initialDraftReply:r.current,updateLocalDraftReply:a}},R=e=>{let t=(0,x.CG)(t=>{let n=(0,b.yx)(t),r=E((null==n?void 0:n.reactions)||[]);if(!r)return[];let o=z(e),i=u()(o,e=>{let{spec:t}=e;return r[t.id]}).filter(Boolean),a=l()(i,"emoji"),s=[];for(let[e,t]of Object.entries(a)){let n=t.reduce((e,t)=>e+t.count,0);s.push({emoji:e,count:n,reactions:t})}return d()(s.filter(e=>e.count>0),"count").reverse()},m());return t}},57480:function(e,t,n){"use strict";n.d(t,{Et:function(){return o},Gt:function(){return i},bk:function(){return r},yK:function(){return a}});let r="350px",o=1,i="temp-id",a=128},4030:function(e,t,n){"use strict";n.d(t,{lO:function(){return r.l},q5:function(){return o.q},IZ:function(){return i.I},Ag:function(){return a.A},xN:function(){return l.xN},W1:function(){return l.W1},iZ:function(){return s.iZ}});var r=n(65940),o=n(43970),i=n(96071),a=n(794),l=n(29978),s=n(40015)},14657:function(e,t,n){"use strict";n.d(t,{Mw:function(){return v},R1:function(){return c},ZM:function(){return d},bg:function(){return p},ei:function(){return x},f$:function(){return u},lG:function(){return m},lM:function(){return g},mS:function(){return h},nf:function(){return f}});var r=n(38564),o=n(36069),i=n(72338),a=n(96255),l=n(54999),s=n(50105);let d=e=>(0,a.KH)(e)||(0,a.pv)(e)||(0,l.AH)(e),c=(e,t)=>!(0,a.KH)(e)&&!(0,a.pv)(e)&&d(t),u=(e,t)=>
1{let n=null;return t.state.doc.descendants((t,r,o)=>{if(r>0&&!d(o)&&!d(t))return!1;!(0,a.KH)(t)&&d(o)&&e>=r&&e<r+t.nodeSize&&(n={node:t,pos:r,end:r+t.nodeSize})}),n},p=e=>{if(d(e.parent))return{pos:e.pos,node:e.nodeAfter};for(let t=e.depth;t>0;t--){let n=e.node(t),r=e.node(t-1);if(d(r))return{pos:t>0?e.before(t):0,node:n}}return null},m=e=>{let{pos:t,from:n,to:r,editor:o}=e,{state:l}=o,d=s.Z.getState(l);if(!d)return null;let c=(0,i.qv)(o.state.doc.resolve(t),a.KH),u=d.getAnnotationsBetween(l,n,r),p=c?d.getAnnotationsBetween(l,c.pos,c.pos+c.node.nodeSize).filter(e=>!u.find(t=>t.id===e.id)):[];return{inBlock:u,inCard:p,origNodePos:t}},h=e=>{let{dropPos:t,dropNode:n,dragging:i,side:a,tr:l,view:d}=e,c=s.Z.getState(d.state);if(!c)return[];let u=c.getAnnotationsBetween(d.state,t,t+n.nodeSize),p=i.inBlock,m="left"===a?i.origNodePos:t,h="left"===a?t:i.origNodePos,{doc:g,type:f,binding:x}=r.Gt.getState(d.state),v=l.mapping.map(t),b=(e,t)=>n=>{let{id:r,relativePos:i}=n,a=(0,o.SF)(g,f,i,x.mapping);return null==a?null:{id:r,newPos:v+(a-e)+t}},y=("left"===a?p:u).map(b(m,1)).filter(e=>!!e),C=("left"===a?u:p).map(b(h,2)).filter(e=>!!e),w=[...y,...C],k=i.inCard.filter(e=>{let{id:t}=e;return!w.find(e=>e.id===t)}).map(e=>{let{id:t,pos:n}=e,r=l.mapping.map(n);return n===r?null:{newPos:r,id:t}}).filter(e=>!!e);return[...w,...k]},g=e=>{let{dropPos:t,dropNode:n,dragging:i,side:a,tr:l,view:d,leftContentSize:c}=e,u=s.Z.getState(d.state);if(!u)return[];let p=u.getAnnotationsBetween(d.state,t,t+n.nodeSize),m=i.inBlock,h="left"===a?i.origNodePos:t,g="left"===a?t:i.origNodePos,{doc:f,type:x,binding:v}=r.Gt.getState(d.state),b=l.mapping.map(t),y=(e,t)=>n=>{let{id:r,relativePos:i}=n,a=(0,o.SF)(f,x,i,v.mapping);return null==a?null:{id:r,newPos:b+(a-e)+t}},C=("left"===a?m:p).map(y(h,2)).filter(e=>!!e),w=("left"===a?p:m).map(y(g,4+c)).filter(e=>!!e),k=[...C,...w],j=i.inCard.filter(e=>{let{id:t}=e;return!k.find(e=>e.id===t)}).map(e=>{let{id:t,pos:n}=e,r=l.mapping.map(n);return n===r?null:{newPos:r,id:t}}).filter(e=>!!e);return[...k,...j]},f=e=>{let{contentPos:t,contentEnd:n,insertPos:i,editor:a}=e,l=s.Z.getState(a.state);if(!l)return[];let{state:d}=a,c=l.getAnnotationsBetween(d,t,n),{doc:u,type:p,binding:m}=r.Gt.getState(a.view.state),h=c.map(e=>{let{id:n,relativePos:r}=e,a=(0,o.SF)(u,p,r,m.mapping);if(null==a)return null;let l=a-t;return{id:n,newPos:i+l}}).filter(e=>!!e);return h},x=e=>{var t;let{dropPos:n,dragging:i,cardWrapOffset:a,tr:l,view:d}=e,c=s.Z.getState(d.state);if(!c)return[];let{doc:u,type:p,binding:m}=r.Gt.getState(d.state),h=l.mapping.map(n,-1),g=i.inBlock.map((t=i.origNodePos,e=>{let{id:n,relativePos:r}=e,i=(0,o.SF)(u,p,r,m.mapping);return null==i?null:{id:n,newPos:h+(i-t)+a}})).filter(e=>!!e),f=i.inCard.filter(e=>{let{id:t}=e;return!g.find(e=>e.id===t)}).map(e=>{let{id:t,pos:n}=e,r=l.mapping.map(n);return n===r?null:{newPos:r,id:t}}).filter(e=>!!e);return[...g,...f]},v=e=>{let{pos:t,tr:n,editor:r}=e,o=s.Z.getState(r.view.state);if(!o)return[];let i=r.state.doc.resolve(t);return i.nodeAfter?o.getAnnotationsBetween(r.state,t,t+i.nodeAfter.nodeSize).map(e=>{let{id:r,pos:o}=e;return{id:r,newPos:o===t?n.mapping.map(o+1)-1:n.mapping.map(o)}}):[]}},77381:function(e,t,n){"use strict";n.d(t,{V:function(){return u},l:function(){return c}});var r=n(73200),o=n(72338),i=n(27191),a=n(52780),l=n(91073),s=n(14657),d=n(15468);let c=o.hj.create({name:"blockClass",addOptions:()=>({blockClass:"block"}),addProseMirrorPlugins(){return[new i.Sy({key:new i.H$("blockClass"),props:{decorations:e=>{let{doc:t}=e,n=[];return t.descendants((e,t,o,i)=>{if((0,s.ZM)(o)&&n.push(a.p.node(t,t+e.nodeSize,{},{isAnnotatable:!0})),(0,l.zh)(e)){n.push(a.p.node(t,t+e.nodeSize,{class:(0,r.cx)(this.options.blockClass,"block-".concat(e.type.name),0===i&&"first-block",i===o.childCount-1&&"last-block")}));let s=0===i&&((0,l.KH)(o)||(0,d.Fi)(o));s&&n.push(a.p.node(t,t+e.nodeSize,{class:"first-block-in-card"},{isFirstBlockInCard:!0}))}else{if(!e.isLeaf&&!e.isBlock)return;n.push(a.p.node(t,t+e.nodeSize,{class:"node-".concat(e.type.name)}))}}),a.EH.create(t,n)}}})]}}),u=e=>!!e.find(e=>e.spec.isFirstBlockInCard)},77220:function(e,t,n){"use strict";n.d(t,{NM:function(){return c},eq:function(){return s}});var r=n(72338),o=n(27191),i=n(55079),a=n(60742),l=n(11093);let s=new o.H$("menuBubble");class d{initialize(e){let{element:t,tippyOptions:n,panelLifecycle:r,onHide:o,targetElement:i}=e;if(!t){console.warn("[BubbleMenuView] initialize. No element provided");return}this.onHide=o,this.element=t,this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.addEventListener("dragstart",this.dragstartHandler),this.view.dom.addEventListener("dragend",this.dragendHandler),this.view.dom.addEventListener("drop",this.dragendHandler),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.createTooltip(n,i),this.element.style.visibility="visible",document.addEventListener("mousedown",this.mousedownDocumentHandler,!0),document.addEventListener("mouseup",this.mouseupDocumentHandler,!0),r&&(this.cleanupPanelLifecycle=r.on("resize",()=>{var e;
1null===(e=this.tippy.popperInstance)||void 0===e||e.update()}))}createTooltip(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=t||this.view.dom.parentElement;this.tippy=(0,i.ZP)(n,{duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"top",hideOnClick:"toggle",...e}),this.editor.commands.command(e=>{let{tr:t}=e;return t.setMeta(s,{tippyInstance:this.tippy}),!0})}update(e,t){let n=t&&s.getState(t),o=s.getState(e.state),{state:i,composing:d}=e,{doc:c,selection:p}=i,m=t&&t.doc.eq(c)&&t.selection.eq(p)&&this.isEditable===this.editor.isEditable&&(null==n?void 0:n.forceHide)===o.forceHide;if(!this.element){if(!o.element)return;this.initialize(o)}if(this.isEditable=this.editor.isEditable,!this.editor.isEditable||!0===o.forceHide){this.hide();return}if(d||m)return;let{empty:h,ranges:g}=p,f=Math.min(...g.map(e=>e.$from.pos)),x=Math.max(...g.map(e=>e.$to.pos)),v=!c.textBetween(f,x).length&&(0,r.xh)(e.state.selection);if(h||v){let e=p.$anchor.marks().some(e=>"link"===e.type.name)||"button"===p.$anchor.parent.type.name,t=(0,r.b5)(c,{from:f,to:x},e=>"emoji"===e.type.name);if(!e&&(null==t?void 0:t.length)===0){this.hide();return}}this.tippy.setProps({getReferenceClientRect:()=>{if(!(0,r.EG)(e.state.selection))return(0,r.pr)(e,f,x);let t=e.nodeDOM(f);return t&&(0,a.Re)(t)?(u(t,".drag-handle")||u(t,"[data-content-reference]")||t).getBoundingClientRect():(0,r.pr)(e,f,x)}}),!this.isMouseDownOutsideMenu&&(0,l.KB)(this.editor)&&this.show()}show(){this.tippy.show(),document.body.classList.add("formatting-menu-open")}hide(){this.onHide&&"function"==typeof this.onHide&&this.onHide(),this.tippy.hide(),document.body.classList.remove("formatting-menu-open")}destroy(){var e,t;null===(e=this.tippy)||void 0===e||e.destroy(),null===(t=this.element)||void 0===t||t.removeEventListener("mousedown",this.mousedownHandler),document.removeEventListener("mousedown",this.mousedownDocumentHandler,!0),document.removeEventListener("mouseup",this.mouseupDocumentHandler,!0),this.view.dom.removeEventListener("dragstart",this.dragstartHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler),this.cleanupPanelLifecycle&&this.cleanupPanelLifecycle()}constructor({editor:e,view:t}){this.preventHide=!1,this.mousedownDocumentHandler=e=>{this.element.contains(e.target)?this.isMouseDownOutsideMenu=!1:this.isMouseDownOutsideMenu=!0},this.mouseupDocumentHandler=()=>{this.isMouseDownOutsideMenu=!1,this.update(this.editor.view)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.dragendHandler=()=>{this.isMouseDownOutsideMenu=!1,setTimeout(()=>this.update(this.editor.view))},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=e=>{var t;let{event:n}=e;if(this.preventHide){this.preventHide=!1;return}(null==n?void 0:n.relatedTarget)&&(null===(t=this.element.parentNode)||void 0===t?void 0:t.contains(n.relatedTarget))||this.hide()},this.editor=e,this.isEditable=e.isEditable,this.view=t}}let c=r.hj.create({name:"bubbleMenu",addCommands:()=>({forceHideBubbleMenu:e=>t=>{let{tr:n}=t;return n.setMeta(s,{forceHide:e}),!0},refreshBubbleMenu:()=>e=>{var t;let{state:n}=e,{tippyInstance:r}=s.getState(n);return null==r||null===(t=r.popperInstance)||void 0===t||t.forceUpdate(),!0}}),addProseMirrorPlugins(){let{editor:e}=this;return[new o.Sy({key:s,state:{init:()=>({element:null,forceHide:!1,onHide:()=>{},tippyOptions:{},tippyInstance:null}),apply(e,t){let n=e.getMeta(s);return n?{...t,...n}:t}},view:t=>new d({view:t,editor:e})})]}}),u=(e,t)=>{let n=e.querySelector(t),r=e.querySelector("[data-node-view-wrapper]");if(!n||!r)return null;let o=(0,a.tl)(n,e,e=>e.hasAttribute("data-node-view-wrapper"));return o===r?n:null}},98081:function(e,t,n){"use strict";n.d(t,{Di:function(){return l},NY:function(){return s},hw:function(){return a},ri:function(){return i}});var r=n(42946),o=n(87254);let i=()=>({note:{name:o.ag._({id:"KiJn9B"}),commandName:o.ag._({id:"Cq+sLh"}),description:o.ag._({id:"ooy/OF"}),icon:r.L4e,colorScheme:"accent"},info:{name:o.ag._({id:"CE+M2e"}),commandName:o.ag._({id:"1E4ojF"}),description:o.ag._({id:"NfbNtV"}),icon:r.sqG,colorScheme:"blue"},warning:{name:o.ag._({id:"r6y+jM"}),commandName:o.ag._({id:"xb1fsI"}),icon:r.ik8,description:o.ag._({id:"tpYgEx"}),colorScheme:"yellow"},caution:{name:o.ag._({id:"VvjZ7K"}),commandName:o.ag._({id:"tC/T1p"}),description:o.ag._({id:"nbib7S"}),icon:r.$9F,colorScheme:"red"},success:{name:o.ag._({id:"zzDlyQ"}),commandName:o.ag._({id:"Vv+D/T"}),description:o.ag._({id:"pqvop4"}),icon:r.f8k,colorScheme:"green"},question:{name:o.ag._({id:"bfgr/e"}),commandName:o.ag._({id:"Ev0Vqt"}),description:o.ag._({id:"IsUqRH"}),icon:r.Fuz,colorScheme:"gray"}}),a=e=>i()[e]||i().note,l=()=>Object.entries(i()).map(e=>{let[t,{commandName:n,icon:r}]=e;return{key:"calloutBox-".concat(t),name:()=>n,nodeName:"calloutBox",icon:r,shortcut:"/".concat(t),keywords:["callout","box"],execute:e=>e.chain().focus().wrapIn("calloutBox",{variant:t}).run()}}),s=Object.fromEntries(Object.keys(i()).map(e=>["calloutBox-".concat(e),{type:"calloutBox",attrs:{variant:e},content:[{type:"paragraph"}]}]))},57863:function(e,t,n){"use strict";n.d(t,{m:function(){return r}});let r=e=>
1"calloutBox"===e.type.name},26104:function(e,t,n){"use strict";n.d(t,{IT:function(){return g},yG:function(){return x}});var r=n(52322),o=n(75768),i=n(32899),a=n(28535),l=n(38035),s=n(94523),d=n(87254),c=n(82108),u=n.n(c),p=n(2784),m=n(11050),h=n(64300);let g=["blank","top","left","right","behind"],f=e=>"blank"===e?d.ag._({id:"6JcK6b"}):"behind"===e?d.ag._({id:"SQOVlA"}):d.ag._({id:"T8aKxO",values:{0:u()(e)}}),x=e=>{let{layout:t,editor:n,getPos:a,edgeLayoutsEnabled:l}=e,d=(0,h.W)(),c=(0,m.z$)(),u=(0,p.useCallback)(e=>{"blank"===e?n.commands.setCardLayout(a(),e):n.commands.setCardLayout(a(),e,d),null==c||c.track(m.AA.CARD_LAYOUT_UPDATED,{source:"card-styling-menu",layout:e})},[n,a,d,c]),x=g.filter(e=>l||["blank","behind"].includes(e));return(0,r.jsx)(o.h,{mb:2,children:x.map(e=>{let n=f(e);return(0,r.jsx)(s.kH,{label:n,placement:"top",children:(0,r.jsx)(i.h,{"aria-label":n,flex:1,variant:"plain",size:"md",onClick:()=>u(e),icon:(0,r.jsx)(v,{layout:e,isSelected:t===e}),boxShadow:"none",background:t===e?"trueblue.50":"white"})},e)})})},v=e=>{let{layout:t,isSelected:n}=e,o=n?"trueblue.400":"gray.300",i=null;return"top"===t?i=(0,r.jsx)(a.xu,{height:"0.375rem",width:"100%",background:o}):"left"===t?i=(0,r.jsxs)(l.k,{height:"100%",minH:"100%",children:[(0,r.jsx)(a.xu,{width:"0.625rem",minH:"100%",background:o}),(0,r.jsx)(a.xu,{flex:"1",minH:"100%"})]}):"right"===t&&(i=(0,r.jsxs)(l.k,{height:"100%",minH:"100%",children:[(0,r.jsx)(a.xu,{flex:"1",minH:"100%"}),(0,r.jsx)(a.xu,{width:"0.625rem",minH:"100%",background:o})]})),(0,r.jsx)(a.xu,{boxSizing:"border-box",height:"1.25rem",width:"1.75rem",border:"2px solid",borderRadius:"sm",borderColor:o,background:"behind"===t?o:"none",children:i})}},71607:function(e,t,n){"use strict";n.d(t,{kc:function(){return S},$v:function(){return j}});var r=n(52322),o=n(17993),i=n(74409),a=n(20437),l=n(5879),s=n(87254),d=n(91994),c=n(5995),u=n(47968),p=n(62685),m=n(56581),h=n(62614),g=n(38035),f=n(28535),x=n(77533),v=n(43297),b=n(22569),y=n(87205),C=n(39018);let w=e=>{let{label:t,onClick:n,isChecked:o,cardBackground:i,isDark:a=!1,...l}=e,s=(0,b.wh)(i,a,y.Iv);return(0,r.jsxs)(h.z,{borderRadius:"md",display:"block",height:"auto",variant:"ghost",color:"black",onClick:n,p:1,...l,children:[(0,r.jsxs)(g.k,{borderWidth:"1px",borderColor:"gray.200",sx:s,p:2,backgroundAttachment:"unset",_focus:{boxShadow:"outline"},overflow:"hidden",position:"relative",direction:"column",align:"center",justify:"center",height:"80px",children:[(0,r.jsx)(C.g5,{background:i}),(0,r.jsx)(f.xu,{position:"relative",p:2,zIndex:0,transitionProperty:"inset",transitionDuration:"normal",width:"100%",overflow:"hidden",color:"var(--body-color)",children:(0,r.jsx)(k,{})})]}),(0,r.jsxs)(g.k,{align:"center",mt:1,children:[o&&(0,r.jsx)(m.n,{w:3,mr:1}),(0,r.jsx)(x.x,{fontSize:"sm",fontWeight:"medium",children:t})]})]})},k=()=>{let e="currentColor";return(0,r.jsxs)(v.K,{spacing:1,h:"28px",position:"relative",zIndex:1,children:[(0,r.jsx)(f.xu,{h:"6px",w:"50%",bg:e,borderRadius:"sm"}),(0,r.jsx)(f.xu,{h:"3px",w:"100%",bg:e,borderRadius:"sm"}),(0,r.jsx)(f.xu,{h:"3px",w:"100%",bg:e,borderRadius:"sm"}),(0,r.jsx)(f.xu,{h:"3px",w:"30%",bg:e,borderRadius:"sm"})]})},j=[{label:()=>s.ag._({id:"MjB4VB"}),value:"frosted"},{label:()=>s.ag._({id:"xg0y9o"}),value:"faded"},{label:()=>s.ag._({id:"xCJdfg"}),value:"none"}],S=e=>{let{background:t,container:n,updateAttributes:s}=e,m={...C.xO,...t.mask},h=(0,d.CG)(u.Pu),g=(0,p.BA)(h,n),f=(0,c.l)(h,g);return(0,r.jsx)(o.g,{spacing:4,w:"100%",align:"stretch",css:f,children:(0,r.jsxs)(o.g,{spacing:2,align:"stretch",children:[(0,r.jsx)(i.X,{size:"md",children:(0,r.jsx)(l.cC,{id:"OXOTHU"})}),(0,r.jsx)(a.M,{columns:2,spacing:2,children:j.map(e=>{var n;let{label:o,value:i}=e,a={...t,mask:{...m,effect:i}};return(0,r.jsx)(w,{onClick:()=>{s({background:a})},label:o(),isChecked:(null===(n=t.mask)||void 0===n?void 0:n.effect)===i,cardBackground:a,cardColor:g},i)})})]})})}},2572:function(e,t,n){"use strict";n.d(t,{S:function(){return N},a:function(){return T}});var r=n(52322),o=n(55478),i=n(32981),a=n(26468),l=n(73751),s=n(2338),d=n(54326),c=n(97217),u=n(36371),p=n(73582),m=n(2969),h=n(28535),g=n(3181),f=n(13272),x=n(47443),v=n(52929),b=n(42946),y=n(49929),C=n(5879),w=n(2784),k=n(93691),j=n(55891),S=n(61840),A=n(13793),I=n(39018),E=n(21209),z=n(71607);let T=()=>{let{isOpen:e,onOpen:t,onClose:n}=(0,o.q)(),[r,i]=(0,w.useState)(0),a=(0,w.useCallback)(e=>{t(),i(e)},[t]),l=(0,w.useCallback)(()=>{a(0)},[a]),s=(0,w.useCallback)(()=>{a(1)},[a]);
1return{openBackgroundTab:l,openStylesTab:s,isOpen:e,onClose:n,tabIndex:r,setTabIndex:i}},N=(0,w.memo)(function(e){let{editor:t,isOpen:n,onClose:o,background:T,container:N,updateNestedAttributes:M,tabIndex:_,setTabIndex:L,isAccentImageDrawer:P=!1,enableMask:R=!1}=e,H=(0,S.A)(t),D=(0,w.useCallback)(()=>{0!==_&&L(0),o()},[o,_,L]),O=(0,k.g)(),B=R&&(0,I.Zi)(T),F=P?E.kT.accentImage:E.kT.cardBackground,W=(0,w.useCallback)(e=>!P||e.backgroundType!==A.E.NONE,[P]);return(0,r.jsxs)(i.d,{trapFocus:!1,isOpen:n,placement:"right",onClose:D,size:O,blockScrollOnMount:!1,children:[(0,r.jsx)(a.Z,{background:"none"}),(0,r.jsxs)(l.s,{onKeyDown:H,"data-in-editor-focus":!0,"data-edit-background-drawer":!0,"data-testid":"card-style-drawer",children:[(0,r.jsx)(s.o,{}),(0,r.jsx)(d.x,{children:(0,r.jsx)(C.cC,{id:"xYilR2"})}),(0,r.jsx)(c.f,{overflowX:"hidden",children:(0,r.jsxs)(u.m,{variant:"soft-rounded",size:"sm",isFitted:!0,isLazy:!0,index:_,onChange:L,children:[B&&(0,r.jsxs)(p.t,{children:[(0,r.jsxs)(m.O,{children:[(0,r.jsx)(h.xu,{mr:2,children:(0,r.jsx)(y.G,{icon:b.re8})}),(0,r.jsx)(C.cC,{id:"GtJbUa"})]}),(0,r.jsxs)(m.O,{children:[(0,r.jsx)(h.xu,{mr:2,children:(0,r.jsx)(y.G,{icon:b.Mdf})}),(0,r.jsx)(C.cC,{id:"9LBB6c"})]})]}),(0,r.jsxs)(g.n,{children:[(0,r.jsx)(f.x,{p:0,pb:1,mt:B?4:0,children:(0,r.jsx)(j.o,{editor:t,updateNestedAttributes:M,background:T,defaultMessage:(0,r.jsxs)(x.b,{children:[(0,r.jsx)(v.z,{}),F]}),isDark:!1,isValidSource:W})}),B&&(0,r.jsx)(f.x,{p:0,pb:1,mt:4,children:(0,r.jsx)(z.kc,{updateAttributes:M,background:T,container:N})})]})]})})]})]})})},53027:function(e,t,n){"use strict";n.d(t,{d:function(){return r}});let r={prompt:"",template:null,settings:{},status:"ready"}},21209:function(e,t,n){"use strict";n.d(t,{CJ:function(){return r},fD:function(){return o},kT:function(){return i}});let r="card-layout",o="25px",i={accentImage:"Try adding an image from this theme's accent image library or search Unsplash for inspiration. You can also upload your own image here.",cardBackground:"The page background will show up behind this card. You\n can change the page background using the theme button in\n the toolbar, or add a backdrop specific to this card."}},60491:function(e,t,n){"use strict";n.d(t,{B:function(){return S},X:function(){return A}});var r=n(72338),o=n(9850),i=n.n(o),a=n(60737),l=n(27191),s=n(50260),d=n(55850),c=n(13793),u=n(11093),p=n(38322),m=n(15690),h=n(9726),g=n(91073),f=n(23147),x=n(14657),v=n(15468),b=n(98462),y=n(93814),C=n(90062),w=n(96255),k=n(13608);let j=/^(\*\*\*)/,S=r.hj.create({name:"cardCommands",addCommands:()=>({resetCardSettings:e=>t=>{let{state:n,dispatch:r,chain:o}=t;if(!r)return!0;let i=o();return n.doc.descendants((t,n)=>{(0,g.KH)(t)&&i.updateNestedAttributesAtPos(n,e)}),!0},splitCardAtSelection:()=>e=>(A(e),!0),insertNestedCard:()=>e=>{let{state:t,chain:n,dispatch:r,editor:o}=e;if(!r)return!0;let{from:i,$from:a}=t.selection;return n().insertContentAndSelect(h.e.insertCardInside).command(e=>{let{tr:t}=e,n=(0,x.Mw)({editor:o,pos:i-a.parentOffset-1,tr:t});return n.length&&requestAnimationFrame(()=>{var e,t;null===(e=(t=o.commands).moveAnnotations)||void 0===e||e.call(t,n)}),!0}).run(),!0},convertToNestedCard:()=>e=>{let{state:t,dispatch:n,commands:r}=e;if(!n)return!0;let o=(0,a.ym)(t.schema.nodes[k.Zb.name])(t,n);return r.selectInsertedNode(),o},unnestCard:e=>t=>{let{state:n,dispatch:o,chain:i,tr:a}=t,l=n.doc.nodeAt(e);if(!l||!(0,g.KH)(l))return!1;if(!o)return!0;let s=(0,C.xn)(a,e);if(!s)return!1;let d=a.doc.resolve(e),c=(0,r.qv)(d,g.KH),u=(0,b.cM)(d),p=null;u&&(p=c?(0,C.lo)(n.doc,c.pos,!0):null);let m=e+l.nodeSize,h=i();
1if(p&&u&&c){let e=(0,b.Qp)(c.node)?u.node.content:u.node;h.insertContentAt(p,e.toJSON()).setMeta("cardNotesHandled",!0)}return h.insertContentAt({from:e,to:m},s.node.toJSON().content).selectInsertedNode().command(t=>{let{tr:n}=t;return n.setMeta("annotationEvent",{type:"merge-cards",contentPos:s.pos,insertPos:e}),!0}).run(),!0},mergeCardsAtPos:e=>t=>{let{tr:n}=t,r=n.doc.nodeAt(e);return!!(r&&(0,g.KH)(r))&&(0,C.Gq)(e,n)},mergeCardsOnDelete:e=>t=>{let{tr:n,state:o,dispatch:i}=t;if(!i)return!0;let{selection:a}=o,l=(0,r.Kk)(g.KH)(a);if(!l||!a.empty)return!1;try{let t=(0,C.pt)(a,e);if(!t)return!1;return e?(0,C.Yh)(l.pos,n,o):(0,C.Gq)(l.pos,n)}catch(e){return console.debug("[CardCommands] mergeCardsOnDelete failed",e),!1}},insertCardAfter:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:h.e.insertCardInside;return t=>{let{state:n,chain:o,dispatch:i}=t;if(!i)return!0;let{selection:a}=n,l=(0,r.Kk)(g.KH)(a);if(!l)return!0;let{pos:s,node:d}=l,c=s+d.nodeSize;return o().insertContentAt(c,e).selectInsertedNode().scrollIntoView().run(),!0}},deleteCardIfEmpty:e=>t=>{let{tr:n,dispatch:r,state:o}=t;if(!r)return!0;let i=!1,{from:a,to:l}=o.selection;return o.doc.nodesBetween(a,l,(t,r)=>{if((0,g.KH)(t)&&(0,k.pr)(t)&&r>y.k_){let o=n.doc.resolve(r).depth>1;n.deleteRange(r,r+t.nodeSize);let a=r+(o?0:e?1:-1),l=(0,m.E)(n.doc.resolve(a),e?1:-1);l&&n.setSelection(l),i=!0}}),i},deleteCard:e=>t=>{let{state:n,dispatch:r,tr:o}=t;if(!r)return!0;let i=n.doc.resolve(e),a=i.depth>1,l=i.nodeAfter;if(!l||!(0,g.KH)(l))return console.error("[CardExtension.deleteCard] Cannot delete card. Node unknown"),!1;o.delete(e,e+l.nodeSize);let s=(0,m.E)(o.doc.resolve(e-(a?0:1)),-1);return s&&o.setSelection(s),!0},duplicateCard:e=>t=>{let{state:n,chain:r,editor:o}=t,a=n.doc.nodeAt(e);if(!a||!(0,g.KH)(a))return console.error("[CardExtension.duplicateCard] Cannot duplicate card. Node unknown"),!1;let l=e+a.nodeSize,s=(0,f.hs)(i()(a.toJSON()));return r().insertContentAt(l,s,{updateSelection:!1}).command(e=>{let{tr:t}=e;return t.setMeta(d.q,!0),!0}).run(),setTimeout(()=>{o.chain().selectInsideNodeAtPos(l).focus().run()},200),!0},rearrangeCards:e=>{let{from:t,to:n,position:r}=e;return e=>{let o,{view:i,state:a,tr:s}=e,d=a.doc.resolve(n),c=a.doc.resolve(t),u=c.pos+c.nodeAfter.nodeSize,p=new l.qv(c),m=p.content();if((o="below"===r?d.pos+d.nodeAfter.nodeSize:"above"===r?d.pos:d.pos+d.nodeAfter.nodeSize-1)===c.pos)return s.setMeta("preventDispatch",!0),!0;s.delete(p.from,p.to);let h=s.mapping.map(o);s.replaceRangeWith(h,h,m.content.firstChild);let g=s.doc.resolve(h+1);s.setSelection(new l.qv(g));let f={type:"move",insertPos:h,insertPosRaw:o,pos:c.pos,end:u};return s.setMeta("annotationEvent",f).setMeta("rearrangeCards",!0),i.focus(),!0}},rearrangeCardsById:(e,t)=>n=>{var r;let{dispatch:o,tr:i,editor:a}=n;if(!o)return!0;let l=(0,w.Y0)(a.state.doc);if(!l)return!1;let s=l.map(e=>e.node.attrs.id),d=t.filter(e=>s.includes(e)).map(e=>l.find(t=>t.node.attrs.id===e)).filter(e=>!!e),c=d.map(e=>({pos:e.pos,id:e.node.attrs.id})).filter(e=>{let{id:t}=e;return t&&"string"==typeof t}),u=null===(r=d[0])||void 0===r?void 0:r.node.attrs.id;if(!u)return!0;let p=Math.max(e.findIndex(e=>e===u),0),m=e[p-1],h=l.find(e=>e.node.attrs.id===m),g=p>0&&h?h.pos+h.node.nodeSize:l[p].pos;if(void 0===g)return!0;let f=[...d].reverse();f.forEach(e=>{e&&i.replaceWith(g,g,e.node)}),d.forEach(e=>{if(!e)return;let t=i.mapping.map(e.pos);i.delete(t,t+e.node.nodeSize)});let x=(0,w.Y0)(i.doc);if(!x)return!0;let v=x.map(e=>({pos:e.pos,id:e.node.attrs.id})).filter(e=>{let{id:n}=e;return t.includes(n)}),b=v.map(e=>{var t;let{id:n,pos:r}=e,o=null===(t=c.find(e=>e.id===n))||void 0===t?void 0:t.pos;return o?{id:n,oldPos:o,newPos:r}:null}).filter(e=>!!e);return i.setMeta("annotationEvent",{type:"rearrange-cards",rearrangedCardPositions:b,insertPos:g}).setMeta("rearrangeCards",!0),!0},updateThemeAccentImages:function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return n=>{let{editor:r,commands:o}=n,i=!e||0===e.length,a=0;return r.state.doc.descendants((n,r)=>{let l=(0,v.pt)(n);if(l||(0,g.KH)(n)){let d=l&&n.attrs.background.type===c.E.NONE;(n.attrs.background.source===s.cx||t&&l||d)&&(i?o.updateAttributesAtPos(r,{background:{type:l?c.E.NONE:void 0}}):(o.updateAttributesAtPos(r,{background:e[a%e.length]}),a++))}}),!0}}
1,deleteCardsById:function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return n=>{let{editor:o,dispatch:i,tr:a}=n;if(!i)return!0;let l=(0,r.N2)(o.state.doc,t=>(0,g.KH)(t)&&e.includes(t.attrs.id));if(!l.length)return!1;let s=l.map((e,t)=>({pos:e.pos,cardIndex:t}));l.forEach(e=>{let{node:t,pos:n}=e;a=a.delete(a.mapping.map(n),a.mapping.map(n+t.nodeSize))});let d=l[0].pos,c=(0,p.t)(a.doc.resolve(d));return c&&(a=a.setSelection(c)),t&&a.setMeta("annotationEvent",{type:"filmstrip-cut",deleted:s}),!0}},deleteCardsAfter:e=>t=>{let{editor:n,dispatch:r,commands:o}=t;if(!r)return!0;let i=(0,u.sS)(n.state.doc.firstChild,e=>(0,g.KH)(e)).map(e=>e.node.attrs.id);if(null===e)return o.deleteCardsById(i);let a=i.indexOf(e),l=a>-1?i.slice(a+1):[];return 0===l.length||o.deleteCardsById(l)},selectInsideNextCard:e=>t=>{let{state:n,dispatch:r,commands:o}=t;if(!r)return!0;let{selection:i}=n,a=(0,u.Ru)(i.$from,g.KH)[0];if(!a||!i.empty)return!1;let l=n.doc.resolve(a.pos),s=l.index();if(e){if(s===l.parent.childCount-1)return!1;o.selectInsideNodeAtPos(a.pos+a.node.nodeSize)}else{if(0===s)return!1;let e=l.posAtIndex(s-1);o.selectInsideNodeAtPos(e,-1)}return!0}}),addInputRules:()=>[new r.VK({find:j,handler:e=>{let{state:t,range:n}=e,{tr:r}=t;A({tr:r.deleteRange(n.from,n.to),dispatch:!0})}})]}),A=e=>{let{tr:t,dispatch:n}=e;if(!n)return;let o=(0,r.Kk)(g.KH)(t.selection);if(!o){console.error("Couldn't find parent card while splitting",t.selection);return}let{accent:i,body:a}=(0,v.wz)(t,o.pos),l=i&&a&&i.pos>a.pos;l&&(t.delete(i.pos,i.pos+i.node.nodeSize),t.insert(a.pos,i.node));let{selection:s}=t,{$from:c}=s,u=s.$from.parentOffset,h=s.from-u-1,f=s.$from.node().content.size-s.$from.parentOffset;t.setMeta(d.q,!0),t.setMeta("annotationEvent",{type:"split-card",splitPos:c.before()});let{node:x,depth:C}=o,{type:w,attrs:k}=x,j=c.depth-C+1,S=(0,b.cM)(t.doc.resolve(o.pos));t.split(c.pos,j,[{type:w,attrs:{...k,layout:"blank"}}]);let A=(0,p.G)(t,y.W4).pos,I=t.doc.nodeAt(A).childCount;if(0===u&&(t.delete(h,h+t.doc.nodeAt(h).nodeSize),A=t.steps[t.steps.length-1].getMap().map(A)),0===f&&I>1){let e=A+1,n=t.doc.nodeAt(e);n&&!("cardNotes"===n.type.name||"cardLayoutItem"===n.type.name)&&t.delete(e,e+n.nodeSize)}let E=(0,b.cM)(t.doc.resolve(A));E&&t.delete(E.pos,E.pos+E.node.nodeSize);let z=(0,m.E)(t.doc.resolve(A+1)),T=t.doc.nodeAt(o.pos),N=T&&o.pos+T.nodeSize-1;if(N&&S){let e=S.node;t.insert(N,e),t.setMeta("cardNotesHandled",!0)}z&&t.setSelection(z).scrollIntoView()}},23553:function(e,t,n){"use strict";n.d(t,{Ft:function(){return j},l:function(){return k}});var r=n(52322),o=n(29117),i=n(10625),a=n(67046),l=n(62614),s=n(332),d=n(99058),c=n(44035),u=n(39237),p=n(77533),m=n(82554),h=n(28535),g=n(42946),f=n(54933),x=n(49929),v=n(39402),b=n(5879),y=n(87254),C=n(18816);let w={fluid:{label:()=>y.ag._({id:"f5YDMB"}),icon:g.rZe,description:()=>y.ag._({id:"3JV7Yt"}),aspectRatio:null,defaultVerticalAlign:"center"},"16x9":{label:()=>y.ag._({id:"ekoaFo"}),description:()=>y.ag._({id:"nmOzVW"}),aspectRatio:v.tX["16x9"],defaultVerticalAlign:"center",orientation:v.L9.landscape,counterOrientation:"16x9_portrait"},"16x9_portrait":{label:()=>y.ag._({id:"iMNTNx"}),description:()=>y.ag._({id:"nmOzVW"}),aspectRatio:v.tX["16x9_portrait"],defaultVerticalAlign:"top",orientation:v.L9.portrait,counterOrientation:"16x9",hide:!0},a4:{label:()=>y.ag._({id:"i+5kKa"}),description:()=>y.ag._({id:"UTXvCx"}),aspectRatio:v.tX.a4,defaultVerticalAlign:"center",orientation:v.L9.landscape,counterOrientation:"a4_portrait"},a4_portrait:{label:()=>y.ag._({id:"pzj1N+"}),description:()=>y.ag._({id:"UTXvCx"}),aspectRatio:v.tX.a4_portrait,defaultVerticalAlign:"top",orientation:v.L9.portrait,counterOrientation:"a4",hide:!0},letter:{label:()=>y.ag._({id:"S4Fsut"}),description:()=>y.ag._({id:"UTXvCx"}),aspectRatio:v.tX.letter,defaultVerticalAlign:"center",orientation:v.L9.landscape,counterOrientation:"letter_portrait"},letter_portrait:{label:()=>y.ag._({id:"fVkwbQ"}),description:()=>y.ag._({id:"UTXvCx"}),aspectRatio:v.tX.letter_portrait,defaultVerticalAlign:"top",orientation:v.L9.portrait,counterOrientation:"letter",hide:!0},square:{label:()=>y.ag._({id:"1DA6ap"}),icon:g.pL1,description:()=>y.ag._({id:"5SkGv0"}),aspectRatio:v.tX.square,defaultVerticalAlign:"center"}},k=e=>e&&w[e]||w.fluid,j=e=>{let{cardDimensions:t,updateCardDimensions:n}=e,j=k(t);return(0,r.jsxs)(o.U,{children:[(0,r.jsxs)(i.v,{isLazy:!0,children:[(0,r.jsx)(a.j,{minW:36,textAlign:"left",as:l.z,size:"sm",variant:"plain",leftIcon:j.icon?(0,r.jsx)(x.G,{icon:j.icon,fixedWidth:!0}):void 0,rightIcon:(0,r.jsx)(x.G,{icon:f.ptq}),children:j.label()}),(0,r.jsx)(s.h,{children:(0,r.jsx)(d.q,{maxW:"400px",zIndex:"modalPopover",children:(0,r.jsx)(c._,{value:t||"fluid",type:"radio",onChange:e=>{let t=k(e);j.orientation&&t.orientation&&j.orientation!==t.orientation?n(t.counterOrientation):n(e)},children:Object.entries(w).map(e=>{let[t,{label:n,description:o,hide:i}]=e;return i?null:(0,r.jsxs)(u.i,{value:t,children:[(0,r.jsxs)(p.x,{children:[n(),"fluid"===t&&(0,r.jsxs)(r.Fragment,{children:[" ",(0,r.jsx)(m.C,{colorScheme:"gray",ml:1,children:(0,r.jsx)(b.cC,{id:"ovBPCi"})})]})]}),(0,r.jsx)(p.x,{fontSize:"xs",color:"gray.500",children:o()})]},t)})})})})]}),j.orientation&&(0,r.jsx)(h.xu,{pos:"relative",zIndex:"1",children:(0,r.jsx)(C.w,{size:"sm",name:"orientation",disabled:!j.orientation,value:j.orientation,onChange:()=>{j.counterOrientation&&n(j.counterOrientation)},options:[{value:v.L9.landscape,component:(0,r.jsx)(x.G,{icon:g.r9b}),tooltip:{label:y.ag._({id:"XxIeKn"}),placement:"top"}},{value:v.L9.portrait,component:(0,r.jsx)(x.G,{icon:g.j8N}),tooltip:{label:y.ag._({id:"3bV9gD"}),placement:"top"}}]})})]})}},30870:function(e,t,n){"use strict";n.d(t,{o4:function(){return x},Z8:function(){return f}});var r=n(12483),o=n(72338),i=n(27191),a=n(26151),l=n(11050),s=n(19283),d=n(18149),c=n.n(d),u=n(47968),p=n(11093),m=n(91073);let h=e=>{let t=[],n={tree:{},parents:{},treeArray:[]};return e.doc.descendants((r,o)=>{if(!(0,m.KH)(r))return;let i=e.doc.resolve(o),a=r.attrs.id;t.push(a);let l=(0,p.nv)(i,m.KH).reverse().map(e=>{let{node:t}=e;return t.attrs.id}),s=[...l,a];s.reduce((e,t)=>
1(e[t]=e[t]||{},e[t]),n.tree),n.parents[a]=l,s.reduce((e,t)=>{let n=e.find(e=>e.id===t);return n?n.children:(e.push({id:a,children:[]}),e)},n.treeArray)}),{cardIds:t,cardIdMap:n}};class g{compute(e){let t=h(e);c()(this.value,t)||(this.hasChanges=!0);let n=t.cardIds.filter(Boolean),r=n.filter((e,t)=>n.includes(e,t+1));return this.duplicateCardIds=r.filter(e=>!this.duplicateCardIds.includes(e)),this.value=t,this}apply(e,t){return e.docChanged&&this.compute(t),this}processChanges(e){this.hasChanges&&this.value&&e((0,u.iX)(this.value)),this.hasChanges=!1}constructor(){this.hasChanges=!1,this.duplicateCardIds=[],this.value=null}}let f=new i.H$("cardIds"),x=o.hj.create({name:"cardIds",priority:s.a.CardIds,addOptions:()=>({enabled:!0}),addProseMirrorPlugins(){return this.options.enabled?[new i.Sy({key:f,state:{init:()=>new g,apply:(e,t,n,r)=>t.apply(e,r)},appendTransaction(e,t,n){var o;let i=f.getState(n);if(!(null==i?void 0:null===(o=i.value)||void 0===o?void 0:o.cardIds))return null;let a=e.some(e=>e.docChanged);if(a&&i.duplicateCardIds.length){let t={duplicateIds:JSON.stringify(i.duplicateCardIds),transactions:JSON.stringify(v(e))};null===l.co||void 0===l.co||l.co.track(l.xW.DUPLICATE_CARD_IDS,{...t}),r.Tb("[generateCardIdMap] Duplicate cardIds detected. This is unexpected and will cause spotlight issues. Additional metadata:",{extra:t})}return null}})]:[]}}),v=e=>e.map(e=>{let t=e.steps.map(e=>{if(e instanceof a.Pu||e instanceof a.FC){var t,n,r;let o=(null===(n=e.slice.toJSON())||void 0===n?void 0:null===(t=n.content)||void 0===t?void 0:t[0])||{},i={type:o.type,attrs:o.attrs,contentLength:null===(r=o.content)||void 0===r?void 0:r.length};return{name:e.constructor.name,from:e.from,to:e.to,sliceContentSimple:i}}return e instanceof a.Cj?{name:e.constructor.name,pos:e.pos,attr:e.attr}:{name:e.constructor.name}}),n=Object.fromEntries(Object.entries(e.meta).map(e=>{let[t,n]=e;if("annotationEvent"===t){var r,o,i,a,l;return[t,{type:n.type,droppedBlockPos:n.droppedBlockPos,dragging:{inBlockLength:null===(o=n.dragging)||void 0===o?void 0:null===(r=o.inBlock)||void 0===r?void 0:r.length,inCardLength:null===(a=n.dragging)||void 0===a?void 0:null===(i=a.inCard)||void 0===i?void 0:i.length,origNodePos:null===(l=n.dragging)||void 0===l?void 0:l.origNodePos}}]}return"uiEvent"===t?[t,n]:[t,"object"==typeof n?"object":n]}));return{stepsData:t,docChanged:e.docChanged,selection:{from:e.selection.from,to:e.selection.to},selectionSet:e.selectionSet,metaData:n}})},59732:function(e,t,n){"use strict";n.d(t,{T:function(){return o}});var r=n(76919);let o=new r.v},96214:function(e,t,n){"use strict";n.d(t,{U:function(){return o}});var r=n(15468);let o=(e,t)=>{var n,o;let{background:i,fitType:a}=e,{allowFit:l}=(0,r.$U)(t);return l?a||((null==i?void 0:null===(o=i.image)||void 0===o?void 0:null===(n=o.meta)||void 0===n?void 0:n.has_transparency)?"fit":"fill"):"fill"}},36783:function(e,t,n){"use strict";n.d(t,{V6:function(){return y},en:function(){return C},y3:function(){return b}});var r=n(72338),o=n(27191),i=n(26151),a=n(52780),l=n(84698),s=n(91994),d=n(52808),c=n(13793),u=n(11093),p=n(37160),m=n(71917),h=n(32581),g=n(96255),f=n(78374),x=n(34227),v=n(15468);let b=new o.H$("cardLayoutPlugin"),y=e=>new o.Sy({key:b,state:{init:()=>({draggingData:null}),apply:(e,t)=>t},filterTransaction:(e,t)=>{if(!e.docChanged||!((0,r.EG)(t.selection)&&(0,g.pv)(t.selection.node))||e.steps.every(e=>e instanceof i.Cj)||e.getMeta("imageUploadUpdateAttrs")||e.steps.every(t=>{if(!(t instanceof i.Pu))return!1;let n=e.before.nodeAt(t.from);if(!n||!(0,v.pt)(n))return!1;let r=t.slice.content;return 1===r.childCount&&(0,v.pt)(r.firstChild)}))return!0;let n=(0,d.Z)(e),o=n.every(t=>{let n=e.before.nodeAt(t.oldStart);return!n||!(0,g.pv)(n)});return o||console.warn("[CardLayoutPlugin] blocking transaction with CardLayoutItem selected"),o},appendTransaction:(t,n,o)=>{let i=t.some(e=>e.docChanged)&&!n.doc.eq(o.doc);if(!i)return;let a=(0,m.u)(e.state.doc);if(!a.cardLayoutsEnabled)return;let l=o.tr,s=(0,r.XP)(n.doc,t),c=(0,d.Z)(s);if(c.forEach(t=>{let n={from:t.newStart,to:t.newEnd},i=(0,r.b5)(o.doc,n,e=>
1"card"===e.type.name);i.forEach(t=>{let{pos:r}=t;if(r<n.from)return;let o=l.mapping.map(r),i=l.doc.nodeAt(o);if(!i)return;let a=(0,v.$U)(i.attrs.layout);(0,v.Ux)(l,o,e.schema,a)})}),l.docChanged)return l},props:{handleDOMEvents:{dragstart:(t,n)=>(0,x.s4)(e,t,n),drop(t,n){let r=t.state.tr,o=(0,x.pY)(t,n);if(o&&o.isImageUpload){n.preventDefault();let i=o.pos;(0,f.G)(e,r,i,o.layout);let{accent:a}=(0,v.wz)(r,i);if(!a)throw Error("Could not find accent after setting card layout=".concat(o.layout," at pos=").concat(o.pos));return(0,h.j)(e,r,o.file,a.pos),t.dispatch(r),!0}let i=(0,x.VR)(t,n);if(i&&i.isImageUpload)return n.preventDefault(),(0,h.j)(e,r,i.file,i.pos),t.dispatch(r),!0;let a=(0,x.Y3)(e,t,n),l=b.getState(t.state);return a&&l&&(l.draggingData={removeLayoutFromCardId:a.node.attrs.id}),!1}},handlePaste:(t,n,r)=>{let{selection:i}=t.state,a=i instanceof o.qv&&(0,v.pt)(i.node);if(!a)return!1;let l=(0,p.O)(r);return!!l&&"image"===l.type.name&&e.commands.updateNestedAttributesAtPos(i.from,{background:{image:l.attrs,type:c.E.IMAGE,source:l.attrs.source}})},handleDrop(t,n,r){let o=t.state.tr,i=(0,x.s7)(e,o,t,n,r),a=(0,x.go)(t,o,n,r);return(!!i||!!a)&&((0,x.jZ)(e,o),t.dispatch(o),!0)},decorations:e=>{let{doc:t}=e,n=[];return t.descendants((e,r)=>{if("card"===e.type.name){let o=t.resolve(r),i=(0,u.nv)(o,g.KH).map(e=>e.node),d=(0,l.ws)((0,s.bh)().getState()),c=(0,v.Hh)({parentCards:i,layout:e.attrs.layout,isMobileDevice:d});e.forEach((t,r)=>{let i=o.pos+r+1;if(!(0,g.pv)(t))return;let l={cardId:e.attrs.id,isCardLayoutDecoration:!0,layout:c,cardSize:e.attrs.cardSize};n.push(a.p.node(i,i+t.nodeSize,{"data-layout-item-id":t.attrs.itemId},l))})}}),a.EH.create(t,n)}}}),C=e=>{let t=e.find(e=>e.spec.isCardLayoutDecoration);return null==t?void 0:t.spec}},78374:function(e,t,n){"use strict";n.d(t,{G:function(){return i}});var r=n(13793),o=n(15468);let i=(e,t,n,i,a)=>{let l=t.doc.nodeAt(n);if((null==l?void 0:l.type.name)!=="card")return!1;let s=l.attrs,d=(0,o.$U)(i);if((0,o.Ux)(t,n,e.schema,d),i===s.layout)return!0;t.setNodeAttribute(n,"layout",i);let{accent:c}=(0,o.wz)(t,n);if(a&&c&&c.node.attrs.background.type===r.E.NONE){let e=a();e&&t.setNodeAttribute(c.pos,"background",e)}let{layoutTemplateColumns:u}=l.attrs,p=s.layout;return u&&("left"===p&&"right"===i||"right"===p&&"left"===i)&&t.setNodeAttribute(n,"layoutTemplateColumns",u.split(" ").reverse().join(" ")),!0}},34227:function(e,t,n){"use strict";n.d(t,{VR:function(){return f},Y3:function(){return v},go:function(){return x},jZ:function(){return b},pY:function(){return y},s4:function(){return j},s7:function(){return k}});var r=n(72338),o=n(27191),i=n(93565),a=n(13793),l=n(11093),s=n(91073),d=n(87205),c=n(37160),u=n(15636),p=n(96255),m=n(78374),h=n(36783),g=n(15468);let f=(e,t,n)=>{let r=e.posAtCoords({left:t.clientX,top:t.clientY});if(!r||r.inside<0)return null;let{doc:o}=e.state,{inside:i}=r,p=o.resolve(i),m=(0,l.Ru)(p,g.pt),h=(0,l.Ru)(p,s.KH)[0],f=n&&(0,c.O)(n),x=(0,l.Fu)(i,e);if(0===m.length||!x||!h)return null;if(!f){let e=(0,u.RC)(t).filter(e=>(0,d.fU)(e.type));return 1!==e.length?null:{pos:i,rect:x,isImageUpload:!0,file:e[0]}}return f&&"image"===f.type.name?{pos:i,rect:x,isImageUpload:!1,background:{type:a.E.IMAGE,source:f.attrs.source,image:f.attrs}}:null},x=(e,t,n,r)=>{let o;try{if(!(o=f(e,n,r)))return!1}catch(e){return console.error("(caught) [CardLayoutPlugin] handleDrop checkGalleryDropTarget error:",e),!1}return!!o&&!o.isImageUpload&&(t.setNodeAttribute(o.pos,"background",o.background),t.deleteSelection(),!0)},v=(e,t,n)=>{var r,o;let i=t.posAtCoords({left:n.clientX,top:n.clientY});if(!i||i.inside<0)return null;let{doc:a}=t.state,{inside:d}=i,c=a.resolve(d),u=(0,l.Ru)(c,s.KH)[0];if(!u)return null;let m=null===(o=t.dragging)||void 0===o?void 0:null===(r=o.accentImage)||void 0===r?void 0:r.cardId;if(!m)return null;let h=m===u.node.attrs.id,f=c.nodeAfter&&(0,g.pt)(c.nodeAfter);return f&&h?null:(0,p.Bw)(e,m)},b=(e,t)=>{var n;let o=h.y3.getState(e.state);if(null==o?void 0:null===(n=o.draggingData)||void 0===n?void 0:n.removeLayoutFromCardId){let n=o.draggingData.removeLayoutFromCardId;o.draggingData=null;let i=(0,r.N2)(t.doc,e=>(0,s.KH)(e)&&e.attrs.id===n)[0];return!!i&&(0,m.G)(e,t,i.pos,"blank")}return!1},y=(e,t,n)=>{let r=e.posAtCoords({left:t.clientX,top:t.clientY});if(!r||r.inside<0)return null;let{doc:o}=e.state,{inside:i}=r,p=o.resolve(i),m=o.nodeAt(i);if(!m)return null;let[h,...g]=(0,l.Ru)(p,s.KH),f=n&&(0,c.O)(n),x=(0,l.Fu)(i,e),v="cardLayoutItem"===m.type.n
1ame;if(!h||!x||!v||g.length>0)return null;let b=h.node.attrs,y="blank"===b.layout?w(t,x):"behind"===b.layout?C(t,x):null;if(!y)return null;if(!f){let e=(0,u.RC)(t).filter(e=>(0,d.fU)(e.type));return 1!==e.length?null:{pos:h.pos,isImageUpload:!0,file:e[0],...y}}return f&&"image"===f.type.name?{pos:h.pos,...y,isImageUpload:!1,background:{type:a.E.IMAGE,source:f.attrs.source,image:f.attrs}}:null},C=(e,t)=>e.clientY<t.top+80||e.clientX<t.left+80||e.clientX>t.right-80?{layout:"behind",rect:t}:null,w=(e,t)=>{let n,r=t,o=Math.min(t.height/3,100);if(e.clientX<t.left+t.width/4)n="left",r={...t.toJSON(),left:t.left,right:t.left+t.width/3,top:t.top,bottom:t.bottom};else if(e.clientX>t.right-t.width/4)n="right",r={...t.toJSON(),right:t.right,left:t.right-t.width/3,top:t.top,bottom:t.bottom};else{if(!(e.clientY<t.top+o))return null;n="top",r={...t.toJSON(),left:t.left,right:t.right,top:t.top,bottom:t.top+Math.min(t.height/3,200)}}return{rect:r,layout:n}},k=(e,t,n,i,a)=>{var l;let d;try{if(!(d=y(n,i,a)))return!1}catch(e){return console.error("(caught) [handleImageDropCreateAccent] handleDrop checkCreateCardAccentDropTarget error:",e),!1}if(!d||d.isImageUpload||!d.layout)return!1;let c=d.background;t.deleteSelection();let u=t.doc.resolve(t.mapping.map(d.pos)),p=u.nodeAfter&&"card"===u.nodeAfter.type.name?u.pos:null===(l=(0,r.qv)(u,s.KH))||void 0===l?void 0:l.pos;if(!p)return!1;(0,m.G)(e,t,p,d.layout);let{accent:h}=(0,g.wz)(t,p);return!!h&&(t.setNodeAttribute(h.pos,"background",c),t.setSelection(o.qv.create(t.doc,h.pos)),!0)},j=(e,t,n)=>{if(!n.target)return;let r=t.posAtDOM(n.target,0);if(!r||r<0)return;let o=(0,p._O)(e,r),l=t.state.doc.nodeAt(r);if(!l||!(0,g.pt)(l))return;if(l.attrs.background.type===a.E.NONE)return n.preventDefault(),n.stopPropagation(),!0;let s=e.view.domAtPos(r).node;if(s&&n.dataTransfer){let e=s.querySelector("[data-content-reference]");if(e){let t=e.cloneNode(!0);t.style.width="18em",t.style.height="10em",t.style.borderRadius=".375em";let r=document.createElement("div");r.style.position="absolute",r.style.top="-9999px",r.style.left="-9999px",document.body.appendChild(r),r.appendChild(t),n.dataTransfer.clearData(),n.dataTransfer.effectAllowed="move",n.dataTransfer.setData("text/html",t.innerHTML),n.dataTransfer.setData("text/plain",t.textContent||""),n.dataTransfer.setDragImage(t,0,0),setTimeout(()=>{document.body.removeChild(r)},0)}}return(0,i.U)(e,{type:"image",attrs:{...l.attrs.background.image,source:l.attrs.background.source}}),t.dragging.accentImage={cardId:null==o?void 0:o.node.attrs.id},!0}},73208:function(e,t,n){"use strict";n.d(t,{x:function(){return d}});var r=n(52322),o=n(28535),i=n(42946),a=n(54933),l=n(49929),s=n(2784);let d=(0,s.memo)(e=>{let{isLocked:t,isDark:n=!1}=e;return(0,r.jsxs)(o.xu,{as:"span",className:"fa-layers fa-fw",children:[(0,r.jsx)(l.G,{icon:i.nNP}),t&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(l.G,{icon:a.diR,color:n?"var(--chakra-colors-gray-900)":"var(--chakra-colors-gray-50)",transform:"shrink-3 right-6 down-6"}),(0,r.jsx)(l.G,{icon:a.byT,transform:"shrink-8 right-6 down-6"})]})]})});d.displayName="CardLinkIcon"},65895:function(e,t,n){"use strict";n.d(t,{K:function(){return a}});var r=n(14274),o=n(91994),i=n(47968);let a=()=>{var e,t;let n=(0,o.CG)(i.yx);if(!n)return!1;let a=r.v.SHARE_TOKEN,l=null!==n.publicAccess,s=null===(e=n.accessLinks)||void 0===e?void 0:e.some(e=>""===e.token),d=null===(t=n.accessLinks)||void 0===t?void 0:t.some(e=>null===e.permission);return!!l||!!a||!!s&&!d}},98462:function(e,t,n){"use strict";n.d(t,{$v:function(){return h},Fi:function(){return d},Qp:function(){return u},Yl:function(){return g},cM:function(){return p},uj:function(){return s},vS:function(){return m}});var r=n(27191),o=n(42111),i=n(78374),a=n(74684),l=n(96255);let s=()=>o.VH.get("cardNotes"),d=(e,t)=>{var n;let r=e.state.doc.nodeAt(t);if(!r||(null===(n=r.lastChild)||void 0===n?void 0:n.type.name)==="cardNotes")return;let o=t+r.nodeSize-1,a={type:"cardNotes",content:[{type:"paragraph"}]},s=r.firstChild&&(0,l.pv)(r.firstChild);if(s)e.chain().insertContentAt({from:o,to:o},{type:"cardNotes",content:[{type:"paragraph"}]},{updateSelection:!1}).noUndo().run();else{e.chain().command(n=>{let{tr:r}=n;(0,i.G)(e,r,t,"blank");let l=r.mapping.map(o);return r.insert(l,e.schema.nodeFromJSON(a)),!0}).noUndo().run();return}},c=e=>
1"cardNotes"===e.type.name,u=e=>null!==e.lastChild&&c(e.lastChild),p=e=>{let t=null,n=e.nodeAfter;return n.descendants((n,r)=>!c(n)||(t={node:n,pos:r+e.pos+1},!1)),t},m=(e,t,n)=>{let o=(0,a.AQ)(e.state.doc,t);if(!o||!o.pos||n&&o.node.attrs.id!==n)return!1;let i=e.state.doc.resolve(o.pos),l=i.pos,s=l+o.node.nodeSize,{selection:d}=e.state,c=d instanceof r.Bs?d.to<s:d.to<=s;return d.from>=l&&c},h=e=>"cardNotes"==e.schema.topNodeType.name,g=e=>{if(0===e.childCount)return!0;let t=!1;e.content.nodesBetween(0,e.content.size,e=>!e.isAtom||!!e.isText||(t=!0,!1));let n=0===e.textContent.trim().length;return n&&!t}},27483:function(e,t,n){"use strict";n.d(t,{$D:function(){return b},xL:function(){return v}});var r=n(27191),o=n(52780),i=n(84698),a=n(91994),l=n(3543),s=n(15468),d=n(74684),c=n(98462);n(93814);var u=n(96255),p=n(22569),m=n(11093),h=n(14657);class g{constructor(e=null){this.dragging=e}}let f=new r.H$("cardPlugin"),x=["card","calloutBox","image","cardLayoutItem","cardAccentLayoutItem","cardNotes"],v=e=>new r.Sy({key:f,state:{init:()=>new g,apply:(e,t)=>t},props:{decorations:e=>{let{doc:t}=e,n=[];return t.descendants((e,r,d,h)=>{if(x.includes(e.type.name)){var g,f,v,b,y;let x=t.resolve(r),C=(0,m.nv)(x,u.KH).map(e=>e.node),w=(0,u.sP)(C,"width"),k=(0,u.KH)(e)?C.length:C.length-1,j=k>0,S=!j&&0===h,A=!j&&h===d.childCount-1,I=!!(e.firstChild&&(0,u.pv)(e.firstChild)),E=(0,s.Ap)(e),z=(null==E?void 0:E.type)==="none",T=null==E?void 0:null===(g=E.mask)||void 0===g?void 0:g.effect,N=(0,p.dF)((0,u.KH)(e)?null===(f=e.attrs.container)||void 0===f?void 0:f.background:null===(b=C[0])||void 0===b?void 0:null===(v=b.attrs.container)||void 0===v?void 0:v.background),M=N?(0,l.DP)(N):void 0,_=(0,i.ws)((0,a.bh)().getState()),L=(0,s.Hh)({layout:e.attrs.layout,parentCards:C,isMobileDevice:_}),P=null!==e.lastChild&&(0,c.Qp)(e),R=P&&!(0,c.Yl)(e.lastChild),H={isCardDecoration:!0,nestedDepth:k,isNested:j,isFirstCard:S,isLastCard:A,hasLayoutItem:I,hasNoAccentBackground:z,cardAccentBackgroundMaskEffect:T,isCardDark:M,displayLayout:L,insideSideLayout:(0,s.eZ)(C),parentCardId:null===(y=C[0])||void 0===y?void 0:y.attrs.id,inheritContainerWidth:w,hasCardNotesNode:P,hasNonEmptyCardNotes:R};n.push(o.p.node(r,r+e.nodeSize,{},H))}}),n.length>0?o.EH.create(t,n):o.EH.empty},handleDOMEvents:{drop(e){var t;let n=null===(t=e.dragging)||void 0===t?void 0:t.annotations,r=f.getState(e.state);if(!r)return!1;r.dragging=n}},handleDrop:(t,n,r)=>{var o;let i=f.getState(t.state),a=null==i?void 0:i.dragging;i&&(i.dragging=null);let l=(0,d.jz)(t,n,r);if(!l)return!1;let s=r.content.toJSON();if(!s)return!1;let c=(null===(o=s[0])||void 0===o?void 0:o.type)==="card";if(c&&a)return e.commands.rearrangeCards({from:a.origNodePos,to:l.pos,position:"above"});let{selection:u}=t.state,p=!u.empty;try{return e.chain().insertContentAt(l.pos,c?s:{type:"card",content:s},{updateSelection:!1}).command(n=>{let{tr:r}=n;if(p&&r.deleteSelection(),a){let n=(0,h.ei)({view:t,tr:r,cardWrapOffset:c?0:1,dragging:a,dropPos:l.pos});requestAnimationFrame(()=>{var t,r;null===(t=(r=e.commands).moveAnnotations)||void 0===t||t.call(r,n)})}return!0}).focusMapped(l.pos,1).run()}catch(e){return console.error("(caught) [Cardplugin] handleDrop error:",e),!0}}}}),b=e=>{let t=e.find(e=>e.spec.isCardDecoration);return t?t.spec:{isNested:!1,hasLayoutItem:!1,nestedDepth:0,isFirstCard:!1,isCardDecoration:!0,isLastCard:!1,displayLayout:"blank",insideSideLayout:!1,hasNoAccentBackground:!0,hasCardNotesNode:!1,hasNonEmptyCardNotes:!1}}},55448:function(e,t,n){"use strict";n.d(t,{L:function(){return a}});var r=n(52322),o=n(32899),i=n(94523);let a=e=>{let{isDark:t,image:n,name:a,isSelected:l,onClick:s,...d}=e;return(0,r.jsx)(i.kH,{label:a,placement:"top",children:(0,r.jsx)(o.h,{onClick:s,icon:n,h:"auto",textShadow:"none",variant:"plain",p:1,w:"100%",cursor:"pointer",textAlign:"center",transition:"all 300ms ease",border:"2px solid",bg:t?l?"trueblue.900":"blackAlpha.600":l?"trueblue.50":"whiteAlpha.900",borderRadius:"md",boxShadow:"sm",borderColor:t?l?"trueblue.300":"gray.800":l?"trueblue.500":"gray.200",color:t?l?"trueblue.200":"gray.700":l?"trueblue.500":"trueblue.600",_hover:{bg:t?l?"whiteAlpha.100":"gray.800":l?"trueblue.100":"trueblue.50",borderColor:t?"trueblue.200":l?"trueblue.500":"trueblue.200"},position:"relative","aria-label":a,...d})})}},37351:function(e,t,n){"use strict";n.d(t,{$:function(){return a}});var r=n(87254);let o=[{id:"basic",name:()=>
1r.ag._({id:"DJoVQx"}),templateIds:["blankCard","titleCard","titleWithText","titleWithBullets","titleWithContentAndButton","accentTop"]},{id:"twoCol",name:()=>r.ag._({id:"qz7ItL"}),templateIds:["accentLeft","accentRight","titleWith2ColumnContent","titleWith2ColumnImageLeft","titleWith2ColumnImageRight","titleWith2ImageColumns","barStatsWithText","funnelWithText","steppedPyramidWithText"]},{id:"specialty",name:()=>r.ag._({id:"65r5M1"}),templateIds:["titleWith3ColumnContent","titleWith3ImageColumns","titleWith4ImageColumns","titleWith3NestedCards","titleWith3Toggles","titleWithTimeline","titleWithLargeBulletList","titleWith3Boxes","titleWithTeamPhotos","titleWith3Stats"]},{id:"cardPlaceholder",name:()=>r.ag._({id:"hx1ePY"}),templateIds:["titleWith2ColumnImageLeft","titleWith2ColumnContent","accentRight","titleWith3ImageColumns"]}],i={default:["basic","twoCol","specialty"],insertWidget:["basic","twoCol","specialty"],placeholder:["cardPlaceholder"],modal:["basic","twoCol","specialty"]},a=e=>{let t=i[e];return o.filter(e=>t.includes(e.id))}},94297:function(e,t,n){"use strict";n.d(t,{A:function(){return l},V:function(){return s}});var r=n(82655),o=n(37351),i=n(80311);let a={blankCard:"/new"},l=()=>i.nT.reduce((e,t)=>{let{id:n,name:o,previewImage:i,jsonContent:l}=t;return e[n]={type:"cardTemplate",key:n,nodeName:"card",name:o,previewImage:i,...a[n]&&{shortcut:a[n]},icon:r.emM,execute:e=>{e.commands.insertContentAndSelect(l)}},e},{}),s=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default",t=(0,o.$)(e);return t.map(e=>{let{name:t,templateIds:n}=e,r=n.map(e=>l()[e]);return{subcategory:t(),items:r}})}},80311:function(e,t,n){"use strict";n.d(t,{nT:function(){return g},BC:function(){return x},ON:function(){return v}});var r=n(87254),o=n(87622),i=n.n(o);n(19585);var a=n(98580),l=n(23831),s=n(25537),d=n(83947),c=n(4495),u=n(20396),p=n(37351),m=n(97724);let h=r.ag._({id:"6MDj8K"}),g=[{id:"blankCard",createdBy:null,name:()=>
1r.ag._({id:"UQOvxZ"}),description:()=>r.ag._({id:"V7lf6B"}),jsonContent:m.i.card([m.i.heading()]),keywords:["blank"],previewImage:{src:"/_next/static/media/Blank-card.33757130.svg",height:43,width:92,blurWidth:0,blurHeight:0}},{id:"titleCard",createdBy:null,name:()=>r.ag._({id:"5U/oBM"}),description:()=>r.ag._({id:"rYur7N"}),jsonContent:m.i.card([m.i.title(),m.i.h2()]),keywords:["title"],previewImage:{src:"/_next/static/media/Title-card.409d7081.svg",height:33,width:92,blurWidth:0,blurHeight:0}},{id:"titleWithText",createdBy:null,name:()=>r.ag._({id:"K9cc6R"}),description:()=>r.ag._({id:"zY04ZW"}),jsonContent:m.i.card([m.i.heading(),m.i.paragraph()]),keywords:["heading","text"],previewImage:c.Z},{id:"titleWithBullets",name:()=>r.ag._({id:"jzSy62"}),createdBy:null,description:()=>r.ag._({id:"+EQqd1"}),jsonContent:m.i.card([m.i.heading(),m.i.bullet(),m.i.bullet(),m.i.bullet()]),keywords:["heading","bullets"],previewImage:d.Z},{id:"titleWithContentAndButton",name:()=>r.ag._({id:"FJJPAA"}),createdBy:null,description:()=>
1r.ag._({id:"itiMvE"}),jsonContent:m.i.card([m.i.heading(),m.i.paragraph(h),m.i.buttons([m.i.button(r.ag._({id:"uWe4QF"}),{variant:"solid"}),m.i.button(r.ag._({id:"zwWKhA"}),{variant:"outline"})])]),keywords:["button","heading","paragraph"],previewImage:{src:"/_next/static/media/Title-with-Content-with-Button.0a656178.svg",height:51,width:91,blurWidth:0,blurHeight:0}},{id:"accentLeft",createdBy:null,name:()=>r.ag._({id:"5HMSY5"}),description:()=>r.ag._({id:"c/I4N2"}),jsonContent:m.i.card([m.i.heading(),m.i.paragraph(h)],{layout:"left"}),keywords:["accent"],previewImage:{src:"/_next/static/media/Accent-left.ec4a8091.svg",height:44,width:92,blurWidth:0,blurHeight:0}},{id:"accentRight",createdBy:null,name:()=>r.ag._({id:"Czo70+"}),description:()=>r.ag._({id:"x5nYRE"}),jsonContent:m.i.card([m.i.heading(),m.i.paragraph(h)],{layout:"right"}),keywords:["accent"],previewImage:{src:"/_next/static/media/Accent-right.c78c2203.svg",height:44,width:92,blurWidth:0,blurHeight:0}},{id:"accentTop",createdBy:null,name:()=>r.ag._({id:"BUdX7X"}),description:()=>
1r.ag._({id:"QuKih6"}),jsonContent:m.i.card([m.i.heading(),m.i.paragraph(h)],{layout:"top"}),keywords:["accent"],previewImage:{src:"/_next/static/media/Accent-top.3daf9740.svg",height:59,width:92,blurWidth:0,blurHeight:0}},{id:"titleWith2ColumnContent",createdBy:null,name:()=>r.ag._({id:"yUsy1w"}),description:()=>r.ag._({id:"5n9mwv"}),jsonContent:m.i.card([m.i.heading(),m.i.columns([[m.i.h3(),m.i.paragraph(h)],[m.i.h3(),m.i.paragraph(h)]])]),keywords:["title","2 column","paragraph"],previewImage:{src:"/_next/static/media/Title-with-2-Column-Content.31842b2e.svg",height:45,width:92,blurWidth:0,blurHeight:0}},{id:"titleWith2ColumnImageLeft",createdBy:null,name:()=>r.ag._({id:"Rv3R2r"}),description:()=>r.ag._({id:"SzGG7G"}),jsonContent:m.i.card([m.i.heading(),m.i.columns([[m.i.mediaPlaceholder()],[m.i.paragraph(h)]])]),keywords:["title","2 column","image","left"],previewImage:a.Z},{id:"titleWith2ColumnImageRight",createdBy:null,name:()=>r.ag._({id:"ZiIaUH"}),description:()=>r.ag._({id:"M7cuHB"}),jsonContent:m.i.card([m.i.heading(),m.i.columns([[m.i.paragraph(h)],[m.i.mediaPlaceholder()]])]),keywords:["title","2 column","image","right"],previewImage:{src:"/_next/static/media/Title-with-2-Column-Image-Right.82d9989d.svg",height:47,width:92,blurWidth:0,blurHeight:0}},{id:"titleWith2ImageColumns",createdBy:null,name:()=>
1r.ag._({id:"oVMU3f"}),description:()=>r.ag._({id:"sqVSP2"}),jsonContent:m.i.card([m.i.heading(),m.i.columns([[m.i.mediaPlaceholder(),m.i.h3(),m.i.paragraph(h)],[m.i.mediaPlaceholder(),m.i.h3(),m.i.paragraph(h)]])]),previewImage:{src:"/_next/static/media/Title-with-2-images.8c3df472.svg",height:65,width:92,blurWidth:0,blurHeight:0},keywords:["heading","2 column","image"]},{id:"titleWith3ColumnContent",createdBy:null,name:()=>r.ag._({id:"G9HV86"}),description:()=>r.ag._({id:"8VPyb1"}),jsonContent:m.i.card([m.i.heading(),m.i.columns([[m.i.h4(),m.i.paragraph(h)],[m.i.h4(),m.i.paragraph(h)],[m.i.h4(),m.i.paragraph(h)]])]),previewImage:{src:"/_next/static/media/Title-with-3-Column-Content.a2e0f358.svg",height:45,width:92,blurWidth:0,blurHeight:0},keywords:["heading","3 column","paragraph"]},{id:"titleWith3ImageColumns",createdBy:null,name:()=>r.ag._({id:"ZjjVJt"}),description:()=>r.ag._({id:"kmtZuD"}),jsonContent:m.i.card([m.i.heading(),m.i.columns([[m.i.mediaPlaceholder(),m.i.h4(),m.i.paragraph(h)],[m.i.mediaPlaceholder(),m.i.h4(),m.i.paragraph(h)],[m.i.mediaPlaceholder(),m.i.h4(),m.i.paragraph(h)]])]),previewImage:s.Z,keywords:["heading","3 column","paragraph","image"]},{id:"titleWith3NestedCards",createdBy:null,name:()=>
1r.ag._({id:"ORoO1f"}),description:()=>r.ag._({id:"J89hiV"}),jsonContent:m.i.card([m.i.heading(),m.i.card([m.i.heading(),m.i.paragraph()]),m.i.card([m.i.heading(),m.i.paragraph()]),m.i.card([m.i.heading(),m.i.paragraph()])]),previewImage:{src:"/_next/static/media/Title-with-3-nested-cards.c9385238.svg",height:83,width:92,blurWidth:0,blurHeight:0},keywords:["heading","nested","card"]},{id:"titleWith3Toggles",createdBy:null,name:()=>r.ag._({id:"Sf3ASu"}),description:()=>r.ag._({id:"58JI2k"}),jsonContent:m.i.card([m.i.heading(),m.i.toggle([m.i.paragraph(h)]),m.i.toggle([m.i.paragraph(h)]),m.i.toggle([m.i.paragraph(h)])]),previewImage:{src:"/_next/static/media/Title-with-3-toggles.c0b5bbb9.svg",height:49,width:92,blurWidth:0,blurHeight:0},keywords:["heading","toggle"]},{id:"titleWithTimeline",createdBy:null,name:()=>r.ag._({id:"cklVjM"}),description:()=>r.ag._({id:"Wdyt2J"}),jsonContent:m.i.card([m.i.heading(),m.i.smartLayout("timeline",[m.i.smartLayoutCell([m.i.h3(r.ag._({id:"HX5SVx"})),m.i.paragraph(h)]),m.i.smartLayoutCell([m.i.h3(r.ag._({id:"HX5SVx"})),m.i.paragraph(h)]),m.i.smartLayoutCell([m.i.h3(r.ag._({id:"HX5SVx"})),m.i.paragraph(h)])],{options:{orientation:"vertical",twoSided:!1}})]),previewImage:u.Z,keywords:["heading","timeline"]},{id:"titleWithLargeBulletList",createdBy:null,name:()=>
1r.ag._({id:"F5uDGO"}),description:()=>r.ag._({id:"g1FTqD"}),jsonContent:m.i.card([m.i.heading(),m.i.smartLayout("bullets",[m.i.smartLayoutCell([m.i.h3(r.ag._({id:"HX5SVx"})),m.i.paragraph(h)]),m.i.smartLayoutCell([m.i.h3(r.ag._({id:"HX5SVx"})),m.i.paragraph(h)]),m.i.smartLayoutCell([m.i.h3(r.ag._({id:"HX5SVx"})),m.i.paragraph(h)]),m.i.smartLayoutCell([m.i.h3(r.ag._({id:"HX5SVx"})),m.i.paragraph(h)])],{options:{cellSize:20}})]),previewImage:{src:"/_next/static/media/Title-with-large-bullets.45506775.svg",height:53,width:91,blurWidth:0,blurHeight:0},keywords:["heading","bullet","list"]},{id:"titleWith3Boxes",createdBy:null,name:()=>r.ag._({id:"7xlpDo"}),description:()=>r.ag._({id:"Cg0xBG"}),jsonContent:m.i.card([m.i.heading(),m.i.smartLayout("boxes",[m.i.smartLayoutCell([m.i.h3(r.ag._({id:"HX5SVx"})),m.i.paragraph(h)]),m.i.smartLayoutCell([m.i.h3(r.ag._({id:"HX5SVx"})),m.i.paragraph(h)]),m.i.smartLayoutCell([m.i.h3(r.ag._({id:"HX5SVx"})),m.i.paragraph(h)])],{options:{cellSize:10}})]),previewImage:l.Z,keywords:["heading","boxes"]},{id:"titleWithTeamPhotos",createdBy:null,name:()=>
1r.ag._({id:"+kQMBP"}),description:()=>r.ag._({id:"tt2nIz"}),jsonContent:m.i.card([m.i.heading(),m.i.smartLayout("imagesText",[m.i.smartLayoutCell([m.i.heading(r.ag._({id:"6YtxFj"}),{level:3}),m.i.paragraph(r.ag._({id:"GDvlUT"})),m.i.paragraph(r.ag._({id:"Nu4oKW"}),{fontSize:"sm"})]),m.i.smartLayoutCell([m.i.heading(r.ag._({id:"6YtxFj"}),{level:3}),m.i.paragraph(r.ag._({id:"GDvlUT"})),m.i.paragraph(r.ag._({id:"Nu4oKW"}),{fontSize:"sm"})]),m.i.smartLayoutCell([m.i.heading(r.ag._({id:"6YtxFj"}),{level:3}),m.i.paragraph(r.ag._({id:"GDvlUT"})),m.i.paragraph(r.ag._({id:"Nu4oKW"}),{fontSize:"sm"})])],{options:{cellSize:10,shapeSize:"full",horizontalAlign:"center",imageShape:"circle"}})]),previewImage:{src:"/_next/static/media/Title-with-team-photos.475f94b7.svg",height:61,width:91,blurWidth:0,blurHeight:0},keywords:["heading","image","team"]},{id:"titleWith3Stats",createdBy:null,name:()=>r.ag._({id:"w0arAq"}),description:()=>r.ag._({id:"YEhR/1"}),jsonContent:m.i.card([m.i.heading(),m.i.smartLayout("stats",[m.i.smartLayoutCell([m.i.heading(r.ag._({i
1d:"nH8BJ4"}),{level:3}),m.i.paragraph(h)],{label:"25%"}),m.i.smartLayoutCell([m.i.heading(r.ag._({id:"nH8BJ4"}),{level:3}),m.i.paragraph(h)],{label:"3/4"}),m.i.smartLayoutCell([m.i.heading(r.ag._({id:"nH8BJ4"}),{level:3}),m.i.paragraph(h)],{label:"50"})],{options:{cellSize:15,shapeSize:"lg"}})]),previewImage:{src:"/_next/static/media/Title-with-3-stats.a7683899.svg",height:57,width:92,blurWidth:0,blurHeight:0},keywords:["heading","stats"]},{id:"barStatsWithText",createdBy:null,name:()=>r.ag._({id:"sjyYND"}),description:()=>r.ag._({id:"DgfiYp"}),jsonContent:m.i.card([m.i.heading(),m.i.columns([[m.i.smartLayout("barStats",[m.i.smartLayoutCell([m.i.heading(r.ag._({id:"nH8BJ4"}),{level:3}),m.i.paragraph(h)],{label:"25%"}),m.i.smartLayoutCell([m.i.heading(r.ag._({id:"nH8BJ4"}),{level:3}),m.i.paragraph(h)],{label:"3/4"})],{options:{cellSize:20}})],[m.i.h2(),m.i.paragraph(h)]],{verticalAlign:"center"})]),previewImage:{src:"/_next/static/media/Bar-Stats-With-Text.2f08d58e.svg",height:48,width:92,blurWidth:0,blurHeight:0},keywords:["heading","stats"]},{id:"funnelWithText",createdBy:null,name:()=>
1r.ag._({id:"ETqzyH"}),description:()=>r.ag._({id:"9ph4ZV"}),jsonContent:m.i.card([m.i.heading(),m.i.columns([[m.i.smartLayout("funnel",[m.i.smartLayoutCell([m.i.h3()]),m.i.smartLayoutCell([m.i.h3()]),m.i.smartLayoutCell([m.i.h3()]),m.i.smartLayoutCell([m.i.h3()])],{options:{numbered:!0,outsideText:!1}})],[m.i.h2(),m.i.paragraph(h)]],{verticalAlign:"center"})]),previewImage:{src:"/_next/static/media/Funnel-With-Text.824058f2.svg",height:50,width:92,blurWidth:0,blurHeight:0},keywords:["heading","funnel"]},{id:"steppedPyramidWithText",createdBy:null,name:()=>r.ag._({id:"6xmZsQ"}),description:()=>r.ag._({id:"GqW7Xg"}),jsonContent:m.i.card([m.i.heading(),m.i.columns([[m.i.smartLayout("staircase",[m.i.smartLayoutCell([m.i.h3()]),m.i.smartLayoutCell([m.i.h3()]),m.i.smartLayoutCell([m.i.h3()]),m.i.smartLayoutCell([m.i.h3()])],{options:{outsideText:!1,horizontalAlign:"center"}})],[m.i.h2(),m.i.paragraph(h)]],{verticalAlign:"center"})]),previewImage:{src:"/_next/static/media/Stepped-Pyramid-With-Text.3c282844.svg",height:50,width:92,blurWidth:0,blurHeight:0},keywords:["heading","pyramid"]},{id:"titleWith4ImageColumns",createdBy:null,name:()=>
1r.ag._({id:"Re1S+b"}),description:()=>r.ag._({id:"+x8oem"}),jsonContent:m.i.card([m.i.heading(),m.i.columns([[m.i.mediaPlaceholder(),m.i.h4(),m.i.paragraph(h)],[m.i.mediaPlaceholder(),m.i.h4(),m.i.paragraph(h)],[m.i.mediaPlaceholder(),m.i.h4(),m.i.paragraph(h)],[m.i.mediaPlaceholder(),m.i.h4(),m.i.paragraph(h)]])]),previewImage:{src:"/_next/static/media/Title-with-4-images.44914702.svg",height:65,width:92,blurWidth:0,blurHeight:0},keywords:["heading","4 column","image"]}],f=()=>i()(g,"id"),x=()=>g.reduce((e,t)=>(e[t.id]=t.jsonContent,e),{}),v=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default",t=(0,p.$)(e);return t.map(e=>{let{name:t,templateIds:n}=e,r=n.map(e=>f()[e]);return{subcategory:t(),items:r}})}},97724:function(e,t,n){"use strict";n.d(t,{i:function(){return r}});let r={heading:(e,t)=>({type:"heading",attrs:{placeholder:e,level:1,...t}}),h2(e){return this.heading(e,{level:2})},h3(e){return this.heading(e,{level:3})},h4(e){return this.heading(e,{level:4})},title:(e,t)=>({type:"title",attrs:{placeholder:e,...t}}),paragraph:(e,t)=>({type:"paragraph",attrs:{placeholder:e,...t}}),bullet:(e,t)=>({type:"bullet",attrs:{placeholder:e,...t}}),toggle(e,t,n){let o=e||[r.paragraph()];return{type:"toggle",content:[{type:"toggleSummary",attrs:{fontSize:"h3",placeholder:t,...n}},...o]}},columns:(e,t)=>({type:"gridLayout",content:e.map(e=>({type:"gridCell",content:e,attrs:t}))}),smartLayout:(e,t,n)=>({type:"smartLayout",attrs:{variantKey:e,...n},content:t}),smartLayoutCell:(e,t)=>({type:"smartLayoutCell",attrs:t,content:e}),mediaPlaceholder:e=>({type:"mediaPlaceholder",attrs:e}),card(e,t){let n=e||[r.heading()];return{type:"card",attrs:t,content:[{type:"cardLayoutItem",attrs:{itemId:"body"},content:n}]}},buttons:(e,t)=>({type:"buttonGroup",attrs:t,content:e}),button:(e,t)=>({type:"button",attrs:t,content:[{type:"text",text:e}]})}},17238:function(e,t,n){"use strict";n.d(t,{t:function(){return l}});var r=n(91994),o=n(50260),i=n(47968),a=n(27483);let l=e=>{let t=(0,r.CG)(i.Pu),{isCardDark:n}=(0,a.$D)(e);return{theme:t,isDark:null!=n?n:(0,o.wj)(t)}}},98441:function(e,t,n){"use strict";n.d(t,{v:function(){return h}});var r=n(91994),o=n(50788),i=n(4878),a=n(47968),l=n(90604),s=n(97857),d=n(39540),c=n(23553),u=n(27483),p=n(17238),m=n(9729);let h=e=>{var t,n;let{node:h,decorations:g,editor:f}=e,x=h.attrs,{id:v,previewContent:b}=x,y=(0,i.TZ)(),C=(0,o.C7)(),w=f.isThumbnail,k=(0,r.CG)(a.Ql),[j,S]=(0,m.D)(v),A="doc"===j?l.q.DOC_VIEW:l.q.SLIDE_VIEW,I=(0,r.CG)(e=>(0,a.hN)(e,A)),E=A===l.q.SLIDE_VIEW,z=(0,r.CG)(a.SU),T=(0,d.v)(g),N=(0,r.CG)((0,a.yH)(v)),M=(0,s.yv)(g),{isNested:_,nestedDepth:L,isFirstCard:P,isLastCard:R,inheritContainerWidth:H,displayLayout:D,insideSideLayout:O,cardAccentBackgroundMaskEffect:B,hasLayoutItem:F,hasNonEmptyCardNotes:W}=(0,u.$D)(g),{theme:G,isDark:U}=(0,p.t)(g),{cardDimensions:V,defaultFullBleed:q,defaultContentWidth:$,presentBackdrop:K=!1}=(0,r.CG)(a.US),Z=(0,c.l)(V),Y="default"===x.cardSize?"full"===q:"full"===x.cardSize,X=E&&!_&&!!Z.aspectRatio&&!K,J=(null!==(n=null!==(t=x.container.width)&&void 0!==t?t:H)&&void 0!==n?n:$)==="lg";return{hasNonEmptyCardNotes:W,isCollapsed:N,isEditable:I,isFirstCard:P,isFocused:T,isExpandableSelected:M,isLastCard:R,isLetterboxed:X,isMobileDevice:y,isNested:_,isPresenting:"doc"!==j&&"presentCollapsed"!==j,isPresentingCurrent:"presentCurrent"===j,isPresentingParent:"presentParent"===j,isPresentMode:E,isPublished:C,isStatic:k,isDark:U,isThumbnail:w,mode:A,nestedDepth:L,presentVariant:j,prevPresentVariant:S,previewContent:b,theme:G,attrs:x,cardId:v,isFullBleed:Y,displayFullBleed:w||!_&&(Y||E&&!K),isWideContent:J,displayLayout:D,insideSideLayout:O,cardAccentBackgroundMaskEffect:B,cardDimensions:Z,showPresentBackdrop:K,hasLayoutItem:F,userZoomLevel:z}}},64300:function(e,t,n){"use strict";n.d(t,{W:function(){return s}});var r=n(4742),o=n.n(r),i=n(2784),a=n(91994),l=n(47968);let s=()=>{let e=(0,a.CG)(l.Pu),t=(0,i.useCallback)(()=>o()(e.config.accentBackgrounds),[e]);return t}},9729:function(e,t,n){"use strict";n.d(t,{D:function(){return d}});var r=n(2784),o=n(42111),i=n(91994),a=n(47968),l=n(90604),s=n(52332);n(93814);let d=e=>{let t=(0,r.useRef)("doc"),n=(0,i.qr)(),d=(0,i.CG)(n=>{let r=(0,a.i2)(n)||"",i=(0,a.X9)(n),s=(0,a.xb)(n),d=(0,a.gh)(n),c=i.parents[r]||[],u=c.reduce((e,t)=>
1e[t],i.tree),p=s.includes(r),m=d===l.q.SLIDE_VIEW;if(m&&!p||!m&&p)return t.current;if(!m&&!p)return"doc";let h=s.filter(e=>u[e]),g=e=>u[e]?h.indexOf(e)-h.indexOf(r):1/0,f=g(e),x=c.indexOf(e)>-1,v=h.some(t=>u[t][e]&&1>=Math.abs(g(t))),b=r===e,y=o.VH.get("presentModeFlat"),C=i.parents[e];if(!C)return t.current;let w=C.includes(r);return v||y&&w?"presentCollapsed":x?"presentParent":b?"presentCurrent":-1===f?"presentPrev":1===f?"presentNext":"doc"});return(0,r.useEffect)(()=>{t.current=d;let r=n.getState();if((0,a.ks)(r))return;let i=o.VH.get("presentModeFlat");"presentCollapsed"!==d||i?["presentParent","presentCurrent","presentPrev","presentNext"].includes(d)&&(0,s.Nn)(e,!1):(0,s.Nn)(e,!0)},[n,d,e]),[d,t.current]}},13608:function(e,t,n){"use strict";n.d(t,{id:function(){return C.id},pL:function(){return C.pL},W4:function(){return C.W4},vD:function(){return C.vD},Zb:function(){return nC},nY:function(){return C.nY},r0:function(){return C.r0},Sf:function(){return C.Sf},jz:function(){return nv.jz},J9:function(){return nv.J9},AQ:function(){return nv.AQ},U8:function(){return C.U8},YS:function(){return nv.YS},pr:function(){return nb},pE:function(){return nv.pE}});var r=n(43019),o=n(72338),i=n(27191),a=n(50279),l=n(96255),s=n(90507),d=n(49354),c=n(11093),u=n(38372),p=n(19283),m=n(66855),h=n(86353),g=n(52332),f=n(15468),x=n(3027),v=n(71917);let b=!1;var y=n(27483),C=n(93814),w=n(52322),k=n(2784),j=n(91994),S=n(47968),A=n(28535),I=n(75768),E=n(77533),z=n(29117),T=n(62614),N=n(73200),M=n(42946),_=n(49929),L=n(5879),P=n(87254),R=n(48776),H=n(27902),D=n(25566),O=n(98285),B=n(27333),F=n(5995),W=n(1365),G=n(22569),U=n(19576),V=n(98441),q=n(4030),$=n(86189),K=n(97857),Z=n(12304);let Y=(0,Z.v0)("h4"),X=(0,k.memo)(e=>{let{decorations:t,editor:n,getPos:r,node:o}=e,i=(0,H.z$)(),a=(0,j.TL)(),l=(0,V.v)(e),{cardId:s,isPresentMode:d,isEditable:c,isMobileDevice:u}=l,{title:p,text:m}=(0,R.T)({node:o,cardId:s}),{previewContent:h,container:f}=e.node.attrs,x=""===h,v=null==p?void 0:p.replaceAll(W.V,e=>'<span class="emoji">'.concat(e,"</span>")),b=(0,j.CG)(S.Pu),y=(0,G.dF)(f.background),T=y&&(0,F.l)(b,y),P=(0,K.yv)(t),Z=(0,k.useCallback)(e=>{e.stopPropagation(),d&&!c?(a((0,S.Qx)({attached:!1})),n.commands.descendIntoCurrentCard(r(),"push"),null==i||i.track(D.AA.CARD_EXPANDED,{is_present_mode:!0,method:"click"})):((0,g.Nn)(s,!1),setTimeout(()=>{if(!c||n.isDestroyed)return;let e=r();n.commands.selectInsideNodeAtPos(e)},50),null==i||i.track(D.AA.CARD_EXPANDED,{is_present_mode:!1,method:"click"}))},[s,d,c,a,n,r,i]);return(0,w.jsxs)(q.lO,{...e,children:[(0,w.jsx)($.A,{...e,"data-testid":"card-drag-handle",handlePlacement:"outside"}),(0,w.jsxs)(A.xu,{mb:"0.25em",position:"relative",contentEditable:!1,userSelect:"none",role:"group","data-card-id":s,"data-export-as-image":!0,children:[(0,w.jsxs)(I.h,{position:"absolute",right:"0.75em",top:"0.75em","data-print-hidden":!0,variant:"unstyled",colorScheme:"gray","data-thumbnail-hidden":!0,children:[c&&(0,w.jsx)(J,{hidePreview:x,...e}),(0,w.jsx)(Q,{onClick:Z})]}),(0,w.jsxs)(A.xu,{cursor:"pointer",className:(0,N.cx)(O.wY,C.vD,"card-collapsed",P&&"expandable-selected"),_groupHover:O.HM,paddingX:u?"1em":"1.5em",paddingY:"1em",onClick:Z,"data-collapsed-card":!0,"data-selection-ring":!0,"data-selection-background":!0,"data-content-reference":!0,css:T,sx:{backgroundColor:y},children:[(0,w.jsx)(E.x,{sx:Y,noOfLines:1,mr:"1.75em",mb:"0.375em",className:(0,N.cx)(B.A8),children:v?(0,w.jsx)(E.x,{as:"span",dangerouslySetInnerHTML:{__html:U.R.sanitize(v)}}):p||(0,w.jsx)(E.x,{as:"span",color:"gray.400",children:(0,w.jsx)(L.cC,{id:"gLDJuJ"})})}),(0,w.jsxs)(z.U,{color:"var(--body-color-muted)",children:[(0,w.jsx)(E.x,{noOfLines:1,fontSize:"0.9em",children:!x&&(null==m?void 0:m.trim())?m:(0,w.jsx)(L.cC,{id:"4m3nxQ"})}),x&&(0,w.jsx)(_.G,{icon:M.ptq,size:"sm"})]})]})]})]})});X.displayName="CollapsedCard";let J=e=>{let{hidePreview:t,updateAttributes:n}=e,r=(0,k.useCallback)(e=>{n&&(n({previewContent:t?null:""}),e.stopPropagation())},[n,t]);return(0,w.jsx)(T.z,{opacity:0,transitionProperty:"opacity",transitionDuration:"normal",_groupHover:{opacity:1},sx:O.un,fontSize:"0.7em",onClick:r,className:O.wY,zIndex:1,children:t?(0,w.jsx)(L.cC,{id:"fsyAH8"}):(0,w.jsx)(L.cC,{id:"Po0vX/"})})},Q=e=>{let{onClick:t}=e;
1return(0,w.jsxs)(T.z,{"aria-label":P.ag._({id:"JjrOSL"}),className:O.wY,onClick:t,zIndex:1,sx:O.un,fontSize:"0.7em","data-testid":"expand-card-button",children:[(0,w.jsx)(_.G,{icon:M.TTL,fontSize:"0.9em"}),(0,w.jsx)(E.x,{as:"span",_groupHover:{opacity:1,display:"inline"},opacity:"0",display:"none",ml:2,children:(0,w.jsx)(L.cC,{id:"1A3EXy"})})]})};var ee=n(17993),et=n(36474),en=n(94523),er=n(42111),eo=n(34922),ei=n(50260),ea=n(17132),el=n(62047),es=n(13653),ed=n(38035),ec=n(97563);let eu=e=>{let{cardId:t,...n}=e,[r,o]=(0,k.useState)(0),[i,a]=(0,k.useState)(!1),[l,s]=(0,k.useState)(0);return(0,k.useEffect)(()=>{let e=ec.f.on("cardViewed",e=>{let{cardId:n,interval:r}=e;t===n&&o(e=>e+r)}),n=ec.f.on("flush",e=>{let{viewed:n}=e;o(0),n[t]&&(a(!0),s(n[t]),setTimeout(()=>a(!1),2e3))});return()=>{e(),n()}},[t]),(0,w.jsxs)(A.xu,{...n,bg:i?"#c3313a":"#f5ae00",children:[!i&&(0,w.jsxs)(A.xu,{children:["time on card: ",Math.floor(r/1e3),"s"]}),i&&(0,w.jsxs)(A.xu,{children:["Tracked View: ",l,"s"]})]})},ep=e=>{let t=(0,er.ye)("debugCardViewed"),{getPos:n,node:r}=e,{id:o}=r.attrs;return t?(0,w.jsxs)(ed.k,{left:8,top:2,zIndex:"overlay",position:"absolute",pointerEvents:"none",opacity:.5,contentEditable:!1,children:[(0,w.jsx)(A.xu,{bg:"yellow",px:2,mr:2,borderRadius:"md",children:o}),(0,w.jsxs)(A.xu,{bg:"trueblue.200",px:2,mr:2,borderRadius:"md",children:["f:",n()," t:",n()+r.nodeSize]}),(0,w.jsx)(eu,{cardId:o,px:2,borderRadius:"md"})]}):null};var em=n(83906),eh=n(76643),eg=n(70065),ef=n(11082),ex=n(43679),ev=n(34071),eb=n(332),ey=n(39429),eC=n(43297),ew=n(74008),ek=n(89099),ej=n(56143),eS=n(42487),eA=n(69747),eI=n(13793),eE=n(66028),ez=n(56904),eT=n(39018),eN=n(32899),eM=n(59732);let e_=e=>{let{icon:t,label:n,children:r,...o}=e;return(0,w.jsxs)(eC.K,{direction:"row",spacing:4,alignItems:"center",...o,children:[(0,w.jsx)(_.G,{fixedWidth:!0,icon:t}),(0,w.jsx)(E.x,{children:n}),(0,w.jsx)(et.L,{}),r]})},eL=e=>{let{editor:t,accentPos:n,cardId:r,hasAccentImage:o,isBehindLayout:i}=e,a=(0,k.useCallback)(()=>{n&&t.commands.updateAttributesAtPos(n,{background:{type:eI.E.NONE}})},[t,n]),l=(0,k.useCallback)(()=>{eM.T.emit("toggleEditBackgroundDrawer",{openDrawer:!0,cardId:r})},[r]);return(0,w.jsx)(w.Fragment,{children:(0,w.jsx)(e_,{label:i?(0,w.jsx)(L.cC,{id:"23c2Uw"}):(0,w.jsx)(L.cC,{id:"e5Sy/T"}),icon:M.VmB,children:(0,w.jsx)(z.U,{spacing:1,children:(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(T.z,{size:"sm",variant:"link",onClick:l,colorScheme:"trueblue",children:o?(0,w.jsx)(L.cC,{id:"ePK91l"}):(0,w.jsx)(L.cC,{id:"PNapeY"})}),o&&(0,w.jsx)(en.kH,{label:(0,w.jsx)(L.cC,{id:"sGYCGx"}),placement:"top",children:(0,w.jsx)(eN.h,{"aria-label":P.ag._({id:"sGYCGx"}),size:"sm",variant:"link",onClick:a,colorScheme:"red",icon:(0,w.jsx)(_.G,{icon:M.XAH})})})]})})})})},eP=e=>{let{editor:t,getPos:n,onAddOrEditClick:r,isDisabled:o,hasBackdrop:i}=e,a=(0,k.useCallback)(()=>{t.commands.updateAttributesAtPos(n(),{background:{type:eI.E.NONE}})},[t,n]);return(0,w.jsx)(w.Fragment,{children:(0,w.jsxs)(e_,{icon:M.UHQ,label:(0,w.jsx)(L.cC,{id:"ANn8Qe"}),color:o?"gray.500":void 0,children:[o&&(0,w.jsx)(en.kH,{placement:"top",label:(0,w.jsx)(L.cC,{id:"ZnOCf5"}),isDisabled:!o,children:(0,w.jsx)(_.G,{fixedWidth:!0,icon:M.Aq})}),(0,w.jsx)(z.U,{spacing:1,children:!o&&(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(T.z,{size:"sm",variant:"link",onClick:r,colorScheme:"trueblue",children:i?(0,w.jsx)(L.cC,{id:"ePK91l"}):(0,w.jsx)(L.cC,{id:"PNapeY"})}),i&&(0,w.jsx)(en.kH,{label:(0,w.jsx)(L.cC,{id:"IfZ6hd"}),placement:"top",children:(0,w.jsx)(eN.h,{"aria-label":P.ag._({id:"IfZ6hd"}),size:"sm",variant:"link",onClick:a,colorScheme:"red",icon:(0,w.jsx)(_.G,{icon:M.XAH})})})]})})]})})};var eR=n(10625),eH=n(67046),eD=n(99058),eO=n(44035),eB=n(39237),eF=n(71607);let eW=e=>{var t,n;let{editor:r,accentPos:o,accentBackground:i,effect:a}=e,l=(0,k.useCallback)(e=>{if(!o||!i)return;let t={background:{mask:{...i.mask,effect:e}}};r.commands.updateNestedAttributesAtPos(o,t)},[r,i,o]),s=null!=a?a:eT.xO.effect,d=null!==(n=null===(t=eF.$v.find(e=>e.value===a))||void 0===t?void 0:t.label())&&void 0!==n?n:(0,w.jsx)(L.cC,{id:"xg0y9o"});return(0,w.jsx)(e_,{label:(0,w.jsx)(L.cC,{id:"u4YODQ"}),icon:M.DhN,children:(0,w.jsxs)(eR.v,{isLazy:!0,children:[(0,w.jsx)(eH.j,{as:T.z,variant:"plain",size:"sm",minW:"128px",boxShadow:"none",textAlign:"left",rightIcon:(0,w.jsx)(em.v,{}),children:d}),(0,w.jsx)(eD.q,{children:(0,w.jsx)(eO._,{value:s,type:"radio",onChange:l,children:eF.$v.map(e=>{let{value:t,label:n}=e;return(0,w.jsx)(eB.i,{value:t,children:n()},t)})})})]})})};var eG=n(98621),eU=n.n(eG),eV=n(28601),eq=n(62685);let e$=e=>{var t,n;let{editor:r,attrs:o,getPos:i}=e,a=(0,j.CG)(S.Pu),l=(0,G.dF)(null===(t=o.container)||void 0===t?void 0:t.background),s=null!==(n=(0,ei.yU)(a))&&void 0!==n?n:(0,eq.BA)(a);return{currentColor:l,themeCardColor:s,setCardColor:e=>{let{container:t}
1=o,n=e?{background:{type:eI.E.COLOR,color:{hex:e}}}:{background:void 0};void 0!==t.isDark&&(n.isDark=void 0),r.commands.updateNestedAttributesAtPos(i(),{container:{...t,...n}})}}},eK=e=>{let{editor:t,attrs:n,getPos:r}=e,{setCardColor:o,currentColor:i,themeCardColor:a}=e$({editor:t,attrs:n,getPos:r}),l=void 0===i;return(0,w.jsx)(e_,{icon:M.MXR,label:"behind"===n.layout?(0,w.jsx)(L.cC,{id:"cA3hQ0"}):(0,w.jsx)(L.cC,{id:"9d2iLQ"}),children:(0,w.jsxs)(eR.v,{isLazy:!0,children:[(0,w.jsx)(eH.j,{as:T.z,variant:"plain",size:"sm",boxShadow:"none",minW:"fit-content",textAlign:"left",rightIcon:(0,w.jsx)(em.v,{}),children:(0,w.jsxs)(eC.K,{direction:"row",spacing:2,align:"center",children:[(0,w.jsx)(eZ,{color:null!=i?i:a}),(0,w.jsx)(E.x,{fontFamily:l?void 0:"mono",textTransform:l?void 0:"uppercase",fontSize:"sm",children:l?(0,w.jsx)(L.cC,{id:"ovBPCi"}):eU()(i).toHexString()})]})}),(0,w.jsx)(eD.q,{overflow:"hidden",children:(0,w.jsx)(eV.M,{currentColor:null!=i?i:a,setColor:o,source:"CardColor"})})]})})},eZ=e=>{let{color:t}=e;return(0,w.jsx)(A.xu,{as:"span",alignSelf:"center",boxSize:5,borderRadius:"md",border:"2px solid",borderColor:"gray.300",bgColor:null!=t?t:"#FFFFFF"})};var eY=n(41098);let eX=e=>{let{editor:t,getPos:n,isWideContent:r}=e,o=(0,k.useCallback)(()=>{t.commands.updateNestedAttributesAtPos(n(),{container:{width:r?"md":"lg"}})},[t,n,r]);return(0,w.jsx)(e_,{icon:M.dH7,label:(0,w.jsx)(L.cC,{id:"lklIf1"}),children:(0,w.jsx)(eY.r,{isChecked:r,onChange:o})})};var eJ=n(26104);let eQ=e=>{let{editor:t,getPos:n,isFullWidth:r}=e,o=(0,k.useCallback)(()=>{t.commands.updateAttributesAtPos(n(),{cardSize:r?"contained":"full"})},[t,n,r]);return(0,w.jsx)(e_,{icon:M.r9b,label:(0,w.jsx)(L.cC,{id:"BquNv8"}),children:(0,w.jsx)(eY.r,{isChecked:r,onChange:o})})};var e0=n(39176),e1=n(21209),e2=n(2572);let e3=(0,k.memo)(e=>{var t,n;let{editor:r,getPos:o,attrs:i,accentBackgroundMaskEffect:a,displayLayout:l,insideSideLayout:s,isNested:d,isFullBleed:c,isWideContent:u}=e,{color:p,bg:m,hoverColor:h,hoverBg:g,borderColor:x}=(0,ez.lv)(),v=(0,k.useRef)(null),b=(0,j.CG)((0,e0.v3)(i.id)),y=(0,j.TL)(),C=(0,k.useCallback)(()=>{y((0,e0.UA)())},[y]),S=(0,k.useCallback)(()=>{y((0,e0.zD)({cardId:i.id}))},[y,null==i?void 0:i.id]);(0,eh.O)({ref:v,handler:e=>{var t;if(!b)return;let n=e.target,r=null==n?void 0:n.closest('[data-card-styles-menu-trigger="'.concat(i.id,'"]')),o=!!(null==n?void 0:null===(t=n.closest(".chakra-modal__content-container"))||void 0===t?void 0:t.querySelector("[data-edit-background-drawer]"));r||o||C()}});let I=(0,er.ye)("borderless"),N=(0,er.ye)("cardWidthOptions"),R=(0,f.gF)(r.state.doc.resolve(o())),H=(null===(t=R.accent)||void 0===t?void 0:t.pos)||null,D=null===(n=R.accent)||void 0===n?void 0:n.node.attrs.background,O=D&&D.type!==eI.E.NONE,B="none"!==i.background.type,F="default"!==i.cardSize||B||O||i.container.width||i.container.background||"blank"!==l,W="behind"===l&&O&&(0,eT.Zi)(D),G=(0,eg.p)(),{openBackgroundTab:U,...V}=(0,e2.a)(),q=(0,k.useCallback)(e=>{(0,eS.y)(r,o(),e)},[r,o]),$=(0,k.useCallback)(()=>{let e={};B&&(e.background={type:eI.E.NONE,source:void 0}),e.cardSize=void 0,e.container={...i.container,width:void 0},i.container.background&&(e.container={...i.container,background:void 0}),"blank"!==l&&(e.layout="blank"),H?r.chain().updateAttributesAtPos(o(),e).updateNestedAttributesAtPos(H,{background:{type:eI.E.NONE}}).run():r.commands.updateAttributesAtPos(o(),e);let t=P.ag._({id:"rQHMjX"}),n=P.ag._({id:"9uI/rE"}),a=G({title:(0,w.jsxs)(z.U,{children:[(0,w.jsx)(E.x,{children:t}),(0,w.jsx)(ef.r,{textDecoration:"underline",onClick:()=>{(0,ej.Yw)(r.state),G.close(a)},children:n})]}),status:"info",duration:3e3,position:"top"})},[B,i.container,l,H,r,o,G]);return(0,w.jsx)(en.Wk,{isDark:!1,children:(0,w.jsxs)(z.U,{spacing:1,onClick:eE.UW,contentEditable:!1,children:[(0,w.jsxs)(ex.J,{isLazy:!0,returnFocusOnClose:!1,isOpen:b,onClose:C,closeOnBlur:!1,children:[(0,w.jsx)(en.kH,{label:(0,w.jsx)(L.cC,{id:"F153E+"}),placement:"top",shouldWrapChildren:!0,children:(0,w.jsx)(ev.x,{children:(0,w.jsxs)(T.z,{"data-card-styles-menu-trigger":i.id,height:e1.fD,fontWeight:"900",alignItems:"center",fontFamily:"Inter, sans-serif",display:"flex",backdropFilter:"blur(8px)",borderRadius:"sm",borderColor:x,color:p,boxShadow:"sm",cursor:"pointer",fontSize:"14px",bg:m,px:.5,_hover:{color:h,background:g},onClick:S,children:[(0,w.jsx)(A.xu,{as:"span",display:"inline-flex",mr:1,children:(0,w.jsx)(_.G,{icon:M.q2v})}),(0,w.jsx)(em.v,{})]})})}),(0,w.jsx)(eb.h,{children:(0,w.jsxs)(ey.y,{"data-card-styles-menu":!0,ref:v,minWidth:"320px",width:"fit-content",maxWidth:"min(360px, 80vw)",fontFamily:"Inter, sans-serif",fontSize:"md",border:"none",children:[(0,w.jsxs)(eC.K,{spacing:5,p:4,children:[(0,w.jsx)(eJ.yG,{editor:r,layout:l,getPos:o,edgeLayoutsEnabled:!s}
1),"blank"!==l&&(0,w.jsx)(eL,{editor:r,accentPos:H,cardId:i.id,hasAccentImage:!!O,isBehindLayout:"behind"===l}),W&&(0,w.jsx)(eW,{editor:r,accentBackground:D,accentPos:H,effect:a}),(0,w.jsx)(eK,{editor:r,attrs:i,getPos:o}),!d&&(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(ew.i,{my:"3"}),I&&(0,w.jsx)(eQ,{editor:r,getPos:o,isFullWidth:c}),N&&(0,w.jsx)(eX,{editor:r,getPos:o,isWideContent:u}),(0,w.jsx)(eP,{editor:r,getPos:o,onAddOrEditClick:U,hasBackdrop:B,isDisabled:c})]})]}),(0,w.jsxs)(ek.E,{px:5,py:3,bg:"gray.100",mx:-1,mb:-1,justify:F?"space-between":"center",alignItems:"center",borderBottomRadius:"xl",children:[F&&(0,w.jsx)(ek.U,{children:(0,w.jsx)(T.z,{onClick:$,variant:"link",size:"sm",colorScheme:"gray",my:0,children:(0,w.jsx)(L.cC,{id:"6hU6uw"})})}),(0,w.jsx)(ek.U,{children:(0,w.jsx)(T.z,{onClick:()=>{C(),eA.pw.emit(eA.TI.OPEN_PAGE_SETUP,"cards")},variant:"link",size:"sm",colorScheme:"gray",my:0,children:(0,w.jsx)(L.cC,{id:"fvaOtb"})})})]})]})})]}),(0,w.jsx)(e2.S,{editor:r,updateNestedAttributes:q,background:i.background,container:i.container,...V})]})})});var e4=n(81540),e5=n(54933),e8=n(51874),e9=n(85420),e7=n(97763),e6=n(57124),te=n(11050),tt=n(4742),tn=n.n(tt),tr=n(30764),to=n(50634),ti=n(28918),ta=n(31490),tl=n(6501),ts=n(42505),td=n(45302),tc=n(93202),tu=n(7144),tp=n(1163),tm=n(21782),th=n(86581),tg=n(98580),tf=n(23831),tx=n(25537),tv=n(83947),tb=n(4495),ty=n(20396);let tC=[{name:"Bullets",key:"bullets",image:tv.Z},{name:"Paragraphs",key:"paragraphs",image:tb.Z},{name:"Two column with image",key:"twoColImage",image:tg.Z},{name:"Timeline",key:"timeline",image:ty.Z},{name:"Images with text",key:"imagesWithText",image:tx.Z},{name:"Boxes",key:"boxes",image:tf.Z}],tw=["bullets","paragraphs","twoColImage","sideImageWithText","timeline","imagesWithText","boxes","arrows","columns","pyramid","bigBullets","icons"],tk={language:"English (US)",textAmou
1nt:"md",tone:"",audience:"",format:"deck",imageProvider:"aiGenerated"},tj=e=>{let{editor:t,getPos:n,theme:r,input:i}=e,{generate:a}=(0,to.j)("GenerateCard",{}),s=(0,j.CG)(S.yx),[d,c]=(0,k.useState)(!1),u=(0,j.qr)(),p=(0,k.useCallback)(async e=>{let{instructions:t="",template:n,input:o="",settings:i}=e,l=(0,ta.nZ)(),d=performance.now(),c=(0,tm.D)(u),p={...tk,...i,editorMode:"structured",textMode:"generate",input:o,instructions:t,template:n,previous:e.context,outline:c},m=null==i?void 0:i.imageStyle;"aiGenerated"===p.imageProvider&&r&&(m=(0,ei.A)(r));let h={interface:"add-card",interactionId:l,inputContent:o,inputMessage:t,inputData:{...i,template:n},product:(0,tp.K9)(null==s?void 0:s.organization),docId:s.id};(0,ta.hq)(h);let{promise:g}=a({workspaceId:s.organization.id,variables:p,interactionId:l}),f=await g,x=await (0,tl.sj)(f,{docFormatKey:p.format,loadImages:!1,theme:r,context:{workspaceId:s.organization.id,docId:s.id,interactionId:l},imageOptions:{provider:p.imageProvider,generateStyle:m}});return(0,ta.o)({...h,outputContent:f,latency:performance.now()-d}),(0,tu.d)("generateCard",null==s?void 0:s.organization,l),x},[a,s,r,u]),{template:m,settings:h}=i,g=tS(),f=(0,td.jw)(h.locale||(null==g?void 0:g.settings.locale)||"en"),x=(0,k.useCallback)(async e=>{if(!t)return;let i=n(),a=t.view.state.doc.nodeAt(i);if(!a){console.error("[AICard] Cannot append card. Node unknown");return}let s=(0,th.Ck)(t.state.doc,Math.max(i-2e3,0),i),d=(0,ti.xk)(s).slice(-500),u=(0,ti.Zs)(d);c(!0);try{let n=await p({input:e,template:m||tn()(tw),context:u,settings:{language:f.englishName}});n.attrs={...a.attrs,...n.attrs,generatorInput:{...a.attrs.generatorInput,prompt:e,template:m,settings:h,status:"done"}};let s=(0,o.N2)(t.state.doc,e=>(0,l.KH)(e)&&e.attrs.id===a.attrs.id)[0];if(!s){console.warn("[useGenerateCard] Card not found. It may have been deleted while generating.");return}t.chain().insertContentAt({from:s.pos,to:s.pos+s.node.nodeSize},n).setMeta("isGenerateCard",!0).selectInsideCardBody(i).run();let d=tr.NB.fromJSON(t.state.schema,n);(0,ts.eM)(t,d,r)}catch(e){console.error("[GenerateCard] Error generating card",e)}c(!1)},[p,t,n,r,m,h,f]),v=(0,k.useCallback)(e=>{let r=n();t.commands.updateNestedAttributesAtPos(r,{generatorInput:e})},[t,n]);return{isGenerating:d,getContextAndGenerate:x,updateInput:v,locale:f}},tS=()=>{var e,t,n,r;let o=(0,j.CG)(S.yx),i=null==o?void 0:null===(t=o.docGenerateInput)||void 0===t?void 0:null===(e=t.docGeneration)||void 0===e?void 0:e.id,a=null==o?void 0:null===(n=o.docGenerateInput)||void 0===n?void 0:n.id,{data:l}=(0,tc.Y96)({variables:{id:i||""},skip:!i}),s=null==l?void 0:l.docGeneration,d=null==s?void 0:null===(r=s.docGenerateInputs)||void 0===r?void 0:r.find(e=>e.id===a);return d},tA=e=>{let[t,n]=(0,k.useState)([]),[r,o]=(0,k.useState)("ready"),{generate:i}=(0,to.j)("SuggestCardTopics",{onStart(){o("generating"),n([])},onContent(e){n(e.split("\n").filter(Boolean))},onComplete(e){n(e.split("\n").filter(Boolean)),o("done")},onError(e){console.error("Error generating suggestions",e),o("error")},timeout:3e4}),a=(0,j.CG)(S.yx),l=tS(),s=(0,j.qr)();return(0,k.useEffect)(()=>{if(e&&"ready"===r){let e=(0,tm.D)(s);e.trim().split("\n").length<3||i({variables:{outline:e,format:(null==l?void 0:l.format)||tk.format},workspaceId:a.organization.id})}},[r,i,e,s,l,a]),{suggestions:t,generateSuggestionsStatus:r}};var tI=n(53027);let tE=e=>{let{theme:t,editor:n,getPos:r,updateAttributes:o,input:i,isDark:a}=e,{getContextAndGenerate:l,isGenerating:s}=tj({theme:t,editor:n,getPos:r,input:i}),d=(0,e7.YO)(()=>l(i.prompt),"generateCard",te.AA.GAMMA_UPSELL_CALLOUT_AI_CREDITS_GENERATE_CARD),{color:c,bg:u,borderColor:p}=(0,ez.lv)(),m=(0,e6.Y)("unlimited_credits"),h=a?e8.rO:e8.ZQ;return(0,w.jsx)(z.U,{borderRadius:"md",border:"1px solid",borderColor:p,color:c,bg:u,boxShadow:"sm",contentEditable:!1,userSelect:"none",align:"center",position:"absolute",left:"50%",transform:"translateX(-50%)",p:.5,marginLeft:-3,...h,children:s?(0,w.jsx)(A.xu,{px:4,children:(0,w.jsx)(e4.$,{size:"xs",color:"purple.500"})}):(0,w.jsxs)(I.h,{size:"sm",variant:"ghost",colorScheme:"gray",spacing:0,children:[(0,w.jsx)(en.kH,{label:(0,w.jsx)(L.cC,{id:"K1Ro+T"}),placement:"top",children:(0,w.jsx)(eN.h,{colorScheme:"gray",_hover:{bg:a?"whiteAlpha.200":"blackAlpha.100"},icon:(0,w.jsx)(_.G,{icon:e5.acZ}
1),"aria-label":P.ag._({id:"K1Ro+T"}),onClick:()=>o({layoutTemplateColumns:null,generatorInput:{...tI.d,prompt:i.prompt}})})}),(0,w.jsx)(en.kH,{label:(0,w.jsxs)(ee.g,{spacing:.5,pb:1,children:[(0,w.jsx)(E.x,{children:(0,w.jsx)(L.cC,{id:"yz/C2/"})}),!m&&(0,w.jsx)(e9.J,{type:"generateCard",ml:0})]}),placement:"top",children:(0,w.jsx)(eN.h,{_hover:{bg:a?"whiteAlpha.200":"blackAlpha.100"},icon:(0,w.jsx)(_.G,{icon:e5.jHE}),onClick:d,"aria-label":P.ag._({id:"yz/C2/"})})}),(0,w.jsx)(en.kH,{label:(0,w.jsx)(L.cC,{id:"fyn0X5"}),placement:"top",children:(0,w.jsx)(eN.h,{color:a?"trueblue.200":"trueblue.500",_hover:{bg:a?"whiteAlpha.300":"trueblue.100"},icon:(0,w.jsx)(_.G,{icon:e5.LEp}),"aria-label":P.ag._({id:"fyn0X5"}),onClick:()=>o({generatorInput:null})})})]})})};var tz=n(73235),tT=n(28165),tN=n(89098),tM=n(90439);function t_(){let e=(0,tz._)(["\n 0% {\n margin-inline: 0;\n }\n 100% {\n margin-inline: var(--nested-card-margin);\n }\n"]);return t_=function(){return e},e}let tL=(0,tT.F4)(t_()),tP=e=>{let{attrs:t,isFullBleed:n,displayFullBleed:r,isNested:o,isPresentMode:i,isEditable:a,isFocused:l,isDark:s,isLetterboxed:d,showPresentBackdrop:c,theme:u,children:p}=e,{id:m,container:h}=t,g=(0,tN.c)(u),f=(0,eq.BA)(u,h),x=r&&g.cardFullBleedSx?g.cardFullBleedSx:g.cardSx,v={...o?g.clickableSx:void 0,...x},b=i&&!o,y=(0,F.l)(u,h.background?f:void 0),k=n?{width:o||d?"var(--card-width)":"100%"}:{zIndex:o?1:void 0,width:"var(--card-width)"},j=b?{minW:c||d?"auto":"100%",maxW:"var(--card-max-width)",minH:"var(--card-min-height)",my:"auto"}:{minW:"0%",minH:"var(--card-min-height)"},S=tM.cx?0:C.nY;return(0,w.jsxs)(ed.k,{className:(0,N.cx)(C.ar),"data-card-body":m,"data-selection-ring":!0,"data-guider-highlight":"card-body","data-content-reference":!0,"data-hide-comments":i&&!c,transitionProperty:"min-height, min-width, width, font-size, padding",transitionDuration:"".concat(S,"ms"),fontSize:"var(--font-size)",animation:o?"".concat(tL," ").concat(S,"ms ease-out forwards"):void 0,position:"relative",...k,...j,css:{"--card-border-radius":v.borderRadius,"--grid-outline-color":s?"var(--chakra-colors-gray-700)":"var(--chakra-colors-gray-200)",...y},justify:"center",borderRadius:"var(--card-border-radius)",pl:n&&!o?"var(--doc-padding-left)":void 0,pr:n&&!o?"var(--doc-padding-right)":void 0,_hover:a&&r&&!l?{"> .card-body-background":{outline:"2px solid var(--grid-outline-color)"}}:void 0,outline:d?"max(50vw, 50vh) solid black":void 0,children:[(0,w.jsx)(A.xu,{position:"absolute",inset:"0",sx:v,className:"card-body-background",borderRadius:"inherit",contentEditable:!1,zIndex:i?-1:void 0,outline:l?"2px solid var(--chakra-ring-color)":void 0,outlineOffset:n&&!i?"-2px":void 0}),(0,w.jsx)(en.Wk,{isDark:s,children:p})]})};var tR=n(50019),tH=n(86323),tD=n(9726),tO=n(4878),tB=n(94297),tF=n(69251),tW=n(4471),tG=n(67261);let tU=(0,k.memo)(function(e){let{editor:t,appendCard:n}=e,r={bgColor:(0,tR.ff)("gray.50","blackAlpha.900")};return(0,w.jsx)(eC.K,{p:2,bg:r.bgColor,children:(0,tB.V)().map(e=>{let{subcategory:r,items:o}=e,i=o.filter(e=>!(0,tW.pP)(t,e,!1));if(0!==i.length)return(0,w.jsxs)(eC.K,{spacing:1,children:[(0,w.jsx)(en.NZ,{flex:"1",textAlign:"left",children:r}),(0,w.jsx)(tF.r,{gap:"1.5",gridTemplateColumns:"1fr 1fr 1fr",children:i.map(e=>(0,w.jsx)(en.kH,{label:(0,w.jsx)(L.cC,{id:"BPbkIF"}),placement:"top",children:(0,w.jsx)(A.xu,{cursor:"pointer",onClick:()=>{n(e.key)},borderRadius:"xl",_hover:{boxShadow:"lg"},transitionProperty:"box-shadow",transitionDuration:"normal",children:(0,w.jsx)(tG.Nb,{item:e})})},e.key))})]},r)})})});var tV=n(33169);let tq=(0,k.memo)(function(e){let{editor:t,getPos:n,display:r,isNested:o}=e,i=(0,tO.TZ)(),a=(0,er.ye)("aiRewrite")&&!i,l=(0,k.useCallback)(e=>{let r=(0,tB.A)(),o=n(),i=t.view.state.doc.nodeAt(o);if(!i){console.error("[CardDivider] Cannot append card. Node unknown");return}let a=o+i.nodeSize,l=tD.e.blankCard;e&&(l=tD.e[e]);let s="aiCardAfter"===e?te.fe.CARD_DIVIDER_AI:e?te.fe.CARD_DIVIDER_DROPDOWN:te.fe.CARD_DIVIDER,d="aiCardAfter"===e?{key:"aiCardAfter",nodeName:"card"}:e?r[e]:r.blankCard;(0,tH.ZT)(d,s),t.chain().insertContentAt(a,(0,tV.Zs)(l)).focus().selectInsertedNode().run()},[t,n]),s=(0,tR.ff)("gray.100","gray.700"),d=(0,er.ye)("addCard2");return(0,w.jsx)(eR.v,{isLazy:!0,children:e=>{let{isOpen:n}=e;
1return(0,w.jsx)(ed.k,{contentEditable:!1,suppressContentEditableWarning:!0,className:"card-divider","data-is-nested-card":String(o),position:"absolute",zIndex:2,bottom:-4,w:"100%",justify:"center",align:"center",display:r,opacity:n?1:0,transitionProperty:"opacity",transitionDuration:"normal","data-print-hidden":!0,"data-id":"card-divider",children:(0,w.jsxs)(I.h,{size:"sm",isAttached:!0,"data-guider-highlight":"add-card-button",className:"card-divider-button-group",variant:"plain",shadow:"md",borderRadius:"md",opacity:"1",transitionProperty:"opacity",transitionDuration:"normal",children:[(0,w.jsx)(en.kH,{label:(0,w.jsx)(L.cC,{id:"7iE+3N"}),children:(0,w.jsx)(eN.h,{className:"insert-card-button",variant:"plain","aria-label":P.ag._({id:"g+7nXG"}),icon:(0,w.jsx)(_.G,{icon:e5.r8p}),onClick:()=>l(),onMouseDown:eE.Wg,size:"sm",shadow:"none",borderRadius:"md",minW:12,transitionProperty:"none",borderColor:s})}),a&&(0,w.jsx)(en.kH,{label:(0,w.jsx)(L.cC,{id:"kLZLXX"}),children:(0,w.jsx)(eN.h,{borderLeft:"none",className:"insert-ai-card-button",variant:"plain","aria-label":P.ag._({id:"g+7nXG"}),icon:(0,w.jsx)(z.U,{spacing:0,children:(0,w.jsx)(_.G,{icon:e5.JyM})}),onClick:()=>{if(d){l("aiCardAfter");return}eA.pw.emit("queueDesignPartnerTask",{message:P.ag._({id:"JoMQgx",values:{placeholder:""}}),submit:!1})},onMouseDown:eE.Wg,size:"sm",shadow:"none",borderRadius:"md",minW:12,transitionProperty:"none",borderColor:s,borderRightRadius:"none"})}),(0,w.jsxs)(ex.J,{placement:"end",isLazy:!0,closeOnBlur:!0,closeOnEsc:!0,children:[(0,w.jsx)(en.kH,{label:(0,w.jsx)(L.cC,{id:"UgOs5x"}),shouldWrapChildren:!0,children:(0,w.jsx)(ev.x,{children:(0,w.jsx)(eN.h,{"aria-label":"Add from template",size:"sm",shadow:"none",borderColor:s,icon:(0,w.jsx)(em.v,{}),fontSize:"lg",fontWeight:"500",borderRadius:"md",borderLeftRadius:"none",borderLeft:"none","data-guider-highlight":"add-card-template-button",transitionProperty:"none",onMouseDown:eE.Wg})})}),(0,w.jsx)(eb.h,{children:(0,w.jsx)(ey.y,{shadow:"xl",maxH:"90vh",overflowY:"scroll",w:"400px",p:"0",children:(0,w.jsx)(tU,{editor:t,appendCard:l})})})]})]})})}})});var t$=n(70347);let tK=()=>(0,w.jsx)(A.xu,{position:"absolute",inset:"0",pointerEvents:"none",overflow:"hidden",display:{base:"none",lg:"block"},children:(0,w.jsxs)(A.xu,{position:"absolute",top:"var(--card-min-height)",left:"0",w:"100%",h:"1px",borderBottom:"2px dashed",borderBottomColor:"var(--body-color)",opacity:"0.15",children:[(0,w.jsx)(tZ,{left:0}),(0,w.jsx)(tZ,{right:0})]})}),tZ=e=>(0,w.jsx)(en.kH,{placement:"top",w:"250px",label:(0,w.jsx)(L.cC,{id:"0Gqs/k",components:{0:(0,w.jsx)(E.x,{}),1:(0,w.jsx)(E.x,{color:"gray.500"})}}),children:(0,w.jsx)(A.xu,{position:"absolute",w:"var(--card-inner-padding-x)",h:"".concat(20,"px"),top:"-".concat(10,"px"),pointerEvents:"auto",cursor:"help",...e})});var tY=n(67109),tX=n(82554),tJ=n(74105),tQ=n(92768),t0=n(87651),t1=n(16556),t2=n(29494);let t3=(0,k.forwardRef)((e,t)=>{let{initialHeight:n="1em",onChange:r,...o}=e,i=(0,k.useCallback)(()=>{"function"!=typeof t&&(null==t?void 0:t.current)&&(t.current.style.height=n,t.current.style.height="".concat(t.current.scrollHeight,"px"))},[n,t]);return(0,k.useEffect)(()=>{i()},[i]),(0,w.jsx)(t2.g,{...o,h:n,minH:n,ref:t,resize:"none",autoFocus:!0,overflow:"hidden",onChange:e=>{i(),null==r||r(e)}})});t3.displayName="ResizingTextarea";var t4=n(48525),t5=n(14764),t8=n(67688),t9=n(93441),t7=n(75009),t6=n(82655),ne=n(55448);let nt=e=>{let{isDark:t,selectedTemplate:n,setSelectedTemplate:r}=e,o=t?"invert(.8) brightness(1.2)":"invert(0)",i=t?"invert(.8) brightness(2)":"invert(0)";return(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(E.x,{color:"var(--body-color-muted)",fontSize:"sm",fontFamily:"Inter",fontWeight:"normal",children:(0,w.jsx)(L.cC,{id:"hQDrYd"})}),(0,w.jsxs)(I.h,{spacing:2,children:[(0,w.jsx)(ne.L,{isDark:t,image:(0,w.jsxs)(eC.K,{children:[(0,w.jsx)(_.G,{icon:t6.Y$l,size:"lg"}),(0,w.jsx)(E.x,{fontSize:"xs",children:(0,w.jsx)(L.cC,{id:"wtGmzA"})})]}),name:P.ag._({id:"ERTBmO"}),isSelected:null===n,onClick:()=>r(null)}),tC.map(e=>{let{key:a,image:l,name:s}=e,d=a===n;return(0,w.jsx)(ne.L,{isDark:t,image:(0,w.jsx)(t7.E,{src:l.src,filter:d?i:o,bg:"white"}),name:s,isSelected:d,onClick:()=>r(a)},a)})]})]})},nn=e=>{let{theme:t,handle:n,editor:r,getPos:o,updateAttributes:i,input:a,isFullBleed:l,isFocused:d}=e,{isGenerating:c,getContextAndGenerate:u,updateInput:p,locale:m}=tj({theme:t,editor:r,getPos:o,input:a}),h=(0,t9.Kt)(p,500),{prompt:g,template:f}=a,[x,v]=(0,k.useState)(g),b=(0,e7.YO)(()=>{p({prompt:x}),u(x)},"generateCard",te.AA.GAMMA_UPSELL_CALLOUT_AI_CREDITS_GENERATE_CARD),y=(0,tR.ff)(!1,!0),C=(0,k.useRef)(null),{suggestions:j,generateSuggestionsStatus:S}=tA(d);if((0,k.useEffect)(()=>{d&&C.current&&setTimeout(()=>{var e;null===(e=C.current)||void 0===e||e.focus()})},[d]),c)return(0,w.jsxs)(ed.k,{position:"relative",maxW:"100%",w:"var(--card-width)",minH:32,contentEditable:"false",justify:"center",direction:"column",p:"var(--card-inner-padding)",children:[n,(0,w.jsxs)(eC.K,{zIndex:1,w:"100%",children:[(0,w.jsx)(tY.O,{height:"3em",w:"33%",mb:4}),(0,w.jsx)(tY.O,{height:"1.5em"}),(0,w.jsx)(tY.O,{height:"1.5em"}),(0,w.jsx)(tY.O,{height:"1.5em"}),(0,w.jsx)(tY.O,{height:"1.5em",w:"75%"})]})]});let I=y?e8.rO:e8.ZQ;return(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(s.ms,{style:{position:"absolute",opacity:0}
1}),(0,w.jsxs)(ed.k,{contentEditable:"false",w:"var(--card-width)",minH:32,bgSize:"cover",bgPosition:"center center",...I,position:"relative",borderRadius:l?"var(--box-border-radius)":"var(--card-border-radius)",p:"var(--card-inner-padding)",direction:"column",justify:"center",m:"-1px",fontFamily:"Inter, sans-serif",onMouseDown:e=>{e.preventDefault(),C.current&&C.current===document.activeElement?C.current.blur():r.view.hasFocus()&&r.commands.blur()},children:[n,(0,w.jsx)(A.xu,{position:"absolute",zIndex:0,pointerEvents:"none",inset:0,bg:"url(".concat(t8.Z.src,")"),bgRepeat:"repeat",bgPosition:"center center",sx:{animation:"".concat(e8.Mb," 180s linear infinite"),maskImage:"linear-gradient(to left, rgba(0,0,0,.75), transparent, rgba(0,0,0,.75))",maskRepeat:"repeat",maskSize:"140px"},opacity:y?.2:1}),(0,w.jsx)(eN.h,{position:"absolute",top:2,right:2,variant:"ghost",colorScheme:y?"gray":"blackAlpha",isRound:!0,size:"sm","aria-label":P.ag._({id:"DIQZR1"}),icon:(0,w.jsx)(_.G,{fixedWidth:!0,icon:M.NBC}),onClick:()=>i({generatorInput:null})}),(0,w.jsxs)(eC.K,{spacing:4,children:[(0,w.jsxs)(z.U,{justify:"end",children:[(0,w.jsx)(E.x,{fontFamily:"p22-mackinac-pro, sans-serif",fontWeight:700,fontSize:"2xl",color:y?"white":"gray.800",children:(0,w.jsx)(L.cC,{id:"8e1wQN"})}),(0,w.jsx)(tX.C,{colorScheme:"green",children:"Beta"}),(0,w.jsx)(et.L,{}),(0,w.jsx)(t5.r,{modalId:"ai-credits-modal-generate-card",variant:"ghost",justify:"flex-end",segmentEvent:te.AA.GAMMA_UPSELL_CALLOUT_AI_CREDITS_GENERATE_CARD}),(0,w.jsx)(t4.k,{locale:m,setLocale:e=>p({settings:{locale:e}}),buttonProps:{variant:"plain",size:"sm",textAlign:"left"}})]}),(0,w.jsxs)(tJ.B,{color:y?"white":"gray.800",bg:y?"blackAlpha.900":"white",boxShadow:"sm",border:"none",borderRadius:"md",display:"flex",alignItems:"start",gap:"0",onMouseDown:eE.UW,_focusWithin:{boxShadow:"var(--chakra-shadows-sm), var(--chakra-shadows-outline)"},transitionProperty:"box-shadow",transitionDuration:"normal",children:[(0,w.jsx)(t3,{ref:C,"data-in-editor-focus":!0,fontWeight:"500",border:"none",fontSize:"lg",initialHeight:"4rem",placeholder:P.ag._({id:"BiLwIi"}),value:x,onChange:e=>{v(e.target.value),h({prompt:e.target.value})},onKeyDown:e=>{e.shiftKey||("Enter"===e.key?b():"ArrowDown"!==e.key||x?"ArrowUp"!==e.key||x||r.chain().focus(o()).selectInsideNextCard(!1).run():r.chain().focus(o()).selectInsideNextCard(!0).run())},_focus:{boxShadow:"none"},_focusVisible:{boxShadow:"none"},p:5}),(0,w.jsx)(tQ.xW,{h:"100%",border:"none",color:y?"white":"gray.800",bg:y?"blackAlpha.900":"white",p:3,pl:0,alignItems:"end",children:(0,w.jsxs)(T.z,{variant:"solid","aria-label":"Generate card",isDisabled:!x,onClick:b,onMouseDown:eE.br,children:[(0,w.jsx)(e9.J,{type:"generateCard",ml:0,mr:2}),(0,w.jsx)(_.G,{icon:e5.XCy})]})})]})]}),(0,w.jsx)(t0.U,{in:!x&&(j.length>0||"generating"===S),children:(0,w.jsxs)(z.U,{pt:4,children:[null==j?void 0:j.map((e,t)=>(0,w.jsx)(t1.Vp,{as:T.z,variant:"subtle",colorScheme:y?"whiteAlpha":"blackAlpha",color:y?"whiteAlpha.700":"blackAlpha.700",p:1,px:2,minH:"auto",h:"auto",onClick:()=>{v(e),p({prompt:e})},children:(0,w.jsx)(t1.Sn,{children:e})},t)),"generating"===S&&(0,w.jsxs)(t1.Vp,{variant:"subtle",colorScheme:y?"whiteAlpha":"blackAlpha",color:y?"whiteAlpha.500":"blackAlpha.500",children:[(0,w.jsx)(t1.AD,{boxSize:"12px",as:e4.$}),(0,w.jsx)(t1.Sn,{children:(0,w.jsx)(L.cC,{id:"AUV+TY"})})]})]})}),(0,w.jsx)(eC.K,{mt:4,zIndex:"1",children:(0,w.jsx)(nt,{isDark:y,selectedTemplate:f,setSelectedTemplate:e=>p({template:e})})})]})]})},nr=e=>{let{displayLayout:t,children:n,isExpandableSelected:r,isFocused:o,isFullBleed:i,isPresentMode:a,isEditable:l,attrs:s,hasLayoutItem:d,onDoubleClick:c,cardDimensions:u,theme:p,handle:m,editor:h,getPos:g,updateAttributes:x}=e;if(s.generatorInput&&"done"!==s.generatorInput.status&&l)return(0,w.jsx)(nn,{theme:p,handle:m,editor:h,getPos:g,input:s.generatorInput,updateAttributes:x,isFullBleed:i,isFocused:o});let v=(0,f.$U)(t),b=(0,f.jS)(t),y=s.layoutTemplateColumns,{logoUrl:k}=p,j=k&&a&&"right"!==t&&"top"!==t;return(0,w.jsxs)(A.xu,{className:(0,N.cx)(e1.CJ,r&&"expandable-selected"),onDoubleClick:c,w:"var(--card-width)",maxW:"100%",position:"relative",spellCheck:o,cursor:"auto",color:"var(--body-color)",sx:{["> .".concat(C.pL)]:{padding:d?void 0:"var(--card-inner-padding)",'> [data-node-view-content-inner="card"]':{...d?{display:"grid",alignItems:"stretch",justifyContent:"stretch",minH:"100%",transitionDuration:"".concat(C.nY,"ms"),transitionProperty:"grid-template-columns, min-height",...v.grid,...y&&v.allowResizing&&{gridTemplateColumns:y},...b}:{display:"block",mx:"auto",maxW:"var(--max-content-width)",width:"100%",boxSizing:"border-box",minW:0},"> .node-cardLayoutItem":{"> [data-node-view-wrapper]":{"> .card-layout-cell-bg":{"> [data-node-view-content]":{"> [data-node-view-content-inner]":{maxWidth:"var(--max-content-width)",margin:"auto"},padding:"var(--card-inner-padding)"}}}}}}},children:[m,n,o&&u.aspectRatio&&(0,w.jsx)(tK,{}),j&&(0,w.jsx)(t$.LN,{})]})};var no=n(15830),ni=n(64467),na=n(98462);let nl=e=>{let{hasNotes:t,isReadonly:n}=e;return t?n?(0,w.jsx)(L.cC,{id:"nqt+Fj"}):(0,w.jsx)(L.cC,{id:"+kQy/G"}):n?null:(0,w.jsx)(L.cC,{id:"GquPwe"})},ns=e=>{let{cardId:t,decorations:n,editor:r,getPos:o,hasNonEmptyCardNotes:i,isReadonly:a,...l}=e,s=(0,k.useCallback)(()=>{let e=o();if(!a){let{hasCardNotesNode:t}=(0,y.$D)(n);t||(0,na.Fi)(r,e)}let i=(0,j.bh)(),l=(0,ni.AD)(i.getState());no.T.emit("toggle",{clickedCardId:t,activeNotesCardId:l}),(0,na.vS)(r,e)||r.commands.selectInsideNodeAtPos(e)},[t,n,a,r,o]),{color:d,bg:c,hoverColor:u,hoverBg:p,borderColor:m}=(0,ez.lv)();return(0,w.jsx)(en.kH,{label:(0,w.jsx)(nl,{hasNotes:i,isReadonly:a}),placement:"top",children:(0,w.jsx)(T.z,{height:e1.fD,fontWeight:"900",alignItems:"center",fontFamily:"Inter, sans-serif",display:"flex",backdropFilter:"blur(8px)",borderRadius:"sm",borderColor:m,color:d,boxSh
1adow:"sm",cursor:"pointer",fontSize:"14px",bg:c,minW:"auto",px:2,_hover:{color:u,background:p},onMouseDown:eE.br,onClick:s,...l,children:(0,w.jsx)(A.xu,{as:"span",display:"inline-flex",children:(0,w.jsx)(_.G,{icon:i?e5.s0r:M.s0r})})})})},nd=e=>{let{attrs:t,children:n,presentVariant:r,isPresentMode:o,isDark:i,isNested:a,isThumbnail:l,css:s}=e,{background:d,id:c}=t,u=(0,j.CG)(S.P7),p=a||l?void 0:(0,G.wh)(d,i);return(0,w.jsx)(ed.k,{onDragOver:eE.Gb,top:0,left:0,position:"relative",width:"100%",height:"100%",alignItems:"center",justifyContent:"center",cursor:"default","data-animate-value":r,fontSize:"var(--editor-font-size, 1rem)",py:"var(--card-outer-padding-y)",pl:"var(--card-outer-padding-left)",pr:"var(--card-outer-padding-right)","data-card-id":c,"data-card-scroll-element":!0,overflow:o&&!a?"hidden auto":void 0,className:(0,N.cx)(C.vD,"card-expanded",o&&C.aY,o&&"card-present-mode card-present-mode--".concat(r)),transitionProperty:"transform, padding",transitionDuration:"".concat(u?C.id:0,"ms"),...p,css:s,children:n})};nd.displayName="CardContainer";var nc=n(1198),nu=n(90221),np=n(83905);let nm=(0,w.jsx)(_.G,{icon:M.V9$}),nh=(0,k.memo)(function(e){let{cardId:t,getPos:n,editor:r,isNested:i,isCollapsed:a,isPresentMode:s,isEditable:d,isDark:c,top:u}=e,p=(0,te.z$)(),m=(0,k.useCallback)(()=>{if(s&&!d)r.commands.spotlightCollapseCard(n());else{(0,g.Nn)(t,!0);let{selection:e}=r.state,i=(0,o.Kk)(l.KH)(e);i&&i.node.attrs.id===t&&r.commands.selectNodeAtPos(n())}null==p||p.track(te.AA.CARD_COLLAPSED,{method:"collapse_button",is_present_mode:!1})},[r,n,p,t,d,s]),h=(0,nc.jj)(),f=(0,k.useMemo)(()=>(0,w.jsx)(en.kH,{label:(0,w.jsx)(L.cC,{id:"kBUgVh"}),placement:"top",portalProps:{containerRef:h},children:(0,w.jsx)(eN.h,{variant:"ghost",size:"sm",pl:(0,nu.s2)()?6:0,pr:(0,nu.s2)()?2:0,onClick:m,onMouseDown:eE.br,colorScheme:"gray",isRound:!0,"aria-label":P.ag._({id:"H86f9p"}),"data-collapse-card-button":!0,icon:nm,color:c?"gray.300":"gray.600"})}),[m,h,c]),x=(0,k.useMemo)(()=>(0,w.jsx)(T.z,{size:"sm",variant:"ghost",position:"absolute",zIndex:2,bottom:[1,3],right:[2,4],rightIcon:(0,w.jsx)(_.G,{icon:M.mTx}),colorScheme:"gray","data-collapse-card-button":!0,onClick:m,fontWeight:"normal",color:c?"gray.300":"gray.600",children:(0,w.jsx)(L.cC,{id:"H86f9p"})}),[m,c]);return(0,w.jsxs)(ed.k,{contentEditable:!1,onClick:eE.UW,className:"manage-card-controls","data-print-hidden":!0,transitionProperty:"common",transitionDuration:"normal",display:"inherit",sx:{"[data-collapse-card-button]":{visibility:i&&!a?"visible":"hidden"}},children:[(0,w.jsx)(z.U,{spacing:1,position:"absolute",top:u||[1,3],right:[2,4],zIndex:np.S.collapseCardBtn,children:f}),i&&!a&&x]})});var ng=n(56253);let nf=e=>{let t=(0,j.TL)(),n=(0,j.qr)(),{getPos:r,editor:o,decorations:i}=e,a=(0,V.v)(e),{isPresentMode:l,isNested:d,isFocused:c,isEditable:u,isMobileDevice:p,cardAccentBackgroundMaskEffect:m,cardId:h,isFullBleed:g,hasNonEmptyCardNotes:f}=a,x=(0,ng.HQ)(a),v=(0,er.ye)("realUserMetrics");(0,eo.MI)(v,h,a.presentVariant,a.prevPresentVariant);let b=(0,k.useCallback)(()=>{let e=(0,S.wc)(n.getState());e&&(t((0,S.e)({isEditingInSlideView:!0})),t((0,S.Qx)({attached:!1})),o.commands.turnOffSpotlight())},[o,t,n]),y=(0,el.WE)(i),A=(0,es.EL)(i),I=(0,j.CG)((0,e0.v3)(h)),T=y||A||c,M=(0,er.ye)("cardNotes"),_=M&&!d&&!o.isThumbnail&&!o.isStatic&&!p&&!o.shouldUsePublishedVersion&&!l&&(f||u&&T);return(0,w.jsx)(q.lO,{as:"div",style:{minHeight:l&&!d?"100vh":0},hideComments:!0,...e,children:(0,w.jsxs)(nd,{...a,css:x,children:[(0,w.jsx)(tP,{...a,children:(0,w.jsxs)(nr,{...a,...e,onDoubleClick:l&&!u?b:void 0,handle:(0,w.jsx)($.A,{...e,"data-testid":"card-drag-handle",zIndex:3,left:2,top:3,width:"18px",height:e1.fD,label:(0,w.jsxs)(ee.g,{spacing:0,children:[(0,w.jsx)(E.x,{color:"gray.400",children:(0,w.jsx)(L.cC,{id:"63lY3K",components:{0:(0,w.jsx)(E.x,{color:"white",as:"span"})}})}),(0,w.jsx)(E.x,{color:"gray.400",children:(0,w.jsx)(L.cC,{id:"COhrZ5",components:{0:(0,w.jsx)(E.x,{color:"white",as:"span"})}})})]})}),children:[(0,w.jsx)(ep,{...e}),(0,w.jsxs)(z.U,{pos:"absolute",left:8,right:2.5,zIndex:11,top:3,align:"start",children:[u&&(T||I)&&(0,w.jsx)(e3,{editor:o,getPos:r,...a,accentBackgroun
1dMaskEffect:m}),(0,w.jsx)(et.L,{}),a.attrs.generatorInput&&u&&(0,w.jsx)(tE,{...e,...a,isDark:a.isDark,input:a.attrs.generatorInput,isInteracting:T}),(0,w.jsx)(et.L,{}),_&&(0,w.jsx)(ns,{editor:o,cardId:h,decorations:i,getPos:r,hasNonEmptyCardNotes:f,isReadonly:!u})]}),(0,w.jsx)(s.ms,{className:(0,N.cx)(C.pL,c&&"is-focused",d&&"is-nested",(l||g)&&"is-full-width",g&&!d&&!l&&"is-borderless",a.isDark&&"is-dark")}),d&&(0,w.jsx)(nh,{top:[1,3],...a,...e})]})}),(0,w.jsx)(ea.a,{children:(0,w.jsx)(en.Wk,{isDark:(0,ei.wj)(a.theme),children:(0,w.jsx)(tq,{display:!u||d||l?"none":"flex",editor:o,getPos:r,isNested:d})})})]})})},nx=e=>{let{node:t}=e,{id:n}=t.attrs,r=(0,j.CG)((0,S.yH)(n));return r?(0,w.jsx)(X,{...e}):(0,w.jsx)(nf,{...e})};var nv=n(74684);(()=>{if(b)return;let e=x.Q.valid;x.Q.valid=t=>{let n=(0,v.u)(t.doc);if(!n.cardLayoutsEnabled)return e(t);let r=e(t);return!(r&&(t.nodeAfter&&(0,l.pv)(t.nodeAfter)||t.nodeBefore&&(0,l.pv)(t.nodeBefore)))&&r},b=!0})();let nb=e=>{if((0,c.bR)(e)||1===e.childCount&&(0,c.bR)(e.firstChild))return!0;if("blank"!==e.attrs.layout)return!1;let t=(0,l.c6)(e);if(0===t.length)return!1;let n=t.find(e=>"body"===e.attrs.itemId);return!!n&&1===n.childCount&&(0,c.bR)(n.firstChild)},ny=e=>{let{newNode:t,newDecorations:n,oldNode:r,oldDecorations:o,updateProps:i}=e,a=JSON.stringify(t.attrs)!==JSON.stringify(r.attrs),l=(0,h.I1)(o,n),s=nb(t)!==nb(r);return(a||l||s)&&(console.debug("[cardUpdateFn] Card ".concat(t.attrs.id," updateProps will be called:"),{oldDecorations:o,newDecorations:n,decorationsChanged:l}),i()),!0},nC=o.NB.create({name:C.W4,content:"(block | cardBlock)+ | cardLayoutItemGroup{1,2} cardNotes?",group:"cardBlock",defining:!1,isolating:!0,selectable:!1,draggable:!0,priority:p.a.Card,containerHandle:!0,imageKeyPath:"background.image",expandable:!0,addNodeView(){return(0,s.fW)(nx,{update:ny,ignoreMutation:e=>{let{mutation:t}=e,n=this.editor.state.selection,r=t.target instanceof HTMLElement?t.target:t.target.parentElement,o="selection"!==t.type&&nw(r),a="selection"===t.type&&n instanceof i.qv&&(0,m.fP)(n.node);return!!o||!!a}})},addProseMirrorPlugins(){return[(0,y.xL)(this.editor)]},addOptions:()=>({isStatic:!1}),addAttributes:()=>({id:{},previewContent:{default:null},background:{default:d.jg,...(0,c.sw)("background")},container:{default:{},...(0,c.sw)("container")},cardSize:{default:"default"},layout:{default:"blank"},layoutTemplateColumns:{default:null},generatorInput:{default:null,...(0,c.sw)("generatorInput")}}),addExtensions(){return[tV.pK.configure({callback:(e,t,n)=>{0!==t.length&&t.forEach(e=>{let{val:t,pos:n}=e;console.debug("[Card.UniqueCardId] New card id(".concat(t,") created. Will be created in postgres through content service.")),(0,g.Ay)(t)})},types:[this.name]})]},addCommands:()=>({}),parseHTML(){return[{tag:"div[class=gamma-card]"},{tag:"section"},{tag:"card[bookmark]",getAttrs:(0,u.xF)(this.storage),getContent:(0,u.eV)(this.storage)}]},renderHTML(e){let{HTMLAttributes:t}=e;return["div",(0,o.P1)(t,{class:"gamma-card"}),0]},addStorage:u.gk,renderHTMLforAI(e){let{node:t}=e,n=(0,u.ml)(this.storage,t),o=(0,r.getCardTitle)(t.toJSON()),i=(0,f.Ap)(t);return["card",{bookmark:n,title:o,accentPosition:t.attrs.layout,accentImage:(null==i?void 0:i.image)?(0,a.K)(i.image):void 0}]}}),nw=e=>{var t;return(null==e?void 0:e.parentElement)&&(e.classList.contains(C.vD)||(null===(t=e.parentElement.closest(".".concat(C.pL,", .").concat(C.vD)))||void 0===t?void 0:t.classList.contains(C.vD)))}},90062:function(e,t,n){"use strict";n.d(t,{Gq:function(){return u},Yh:function(){return c},lo:function(){return g},pt:function(){return f},xn:function(){return p}});var r=n(72338),o=n(3027),i=n(11093),a=n(15690),l=n(15468),s=n(98462),d=n(96255);let c=(e,t,n)=>{let r=t.doc.resolve(e),i=t.doc.nodeAt(e),l=e+r.nodeAfter.nodeSize,c=t.doc.resolve(l),u=t.doc.nodeAt(l);if(!u||!(0,d.KH)(u))return!1;let m=i&&(0,s.Qp)(i),f=(0,s.Qp)(u),x=null;f&&(x=m?g(t.doc,r.pos,!0):i?r.pos+i.nodeSize-1:null);let v=p(t,l);if(!v)return!1;t.delete(l,l+u.nodeSize);let b=h(t,e,!0);if(x&&f){let e=(0,s.cM)(c);if(e){let n=m?e.node.content:e.node;t.insert(x,n),t.setMeta("cardNotesHandled",!0)}}t.insert(b,v.node.content);let y={type:"merge-cards",contentPos:v.pos,insertPos:b};
1if(t.setMeta("annotationEvent",y),n.selection instanceof o.Q){let e=(0,a.E)(t.doc.resolve(b));e&&t.setSelection(e)}return!0},u=(e,t)=>{let n=t.doc.resolve(e);if(!n.nodeBefore)return!1;let r=e-n.nodeBefore.nodeSize,o=t.doc.nodeAt(r);if(!o||!(0,d.KH)(o))return!1;let i=(0,s.Qp)(o),l=n.nodeAfter&&(0,s.Qp)(n.nodeAfter),c=null;l&&(c=i?g(t.doc,r,!0):r+o.nodeSize-1);let u=p(t,e);if(!u)return!1;t.delete(e,e+n.nodeAfter.nodeSize);let m=h(t,r,!0);if(c&&l){let e=(0,s.cM)(n);if(e){let n=i?e.node.content:e.node;t.insert(c,n),t.setMeta("cardNotesHandled",!0)}}t.insert(m,u.node.content);let f=(0,a.E)(t.doc.resolve(m));f&&t.setSelection(f);let x={type:"merge-cards",contentPos:u.pos,insertPos:m};return t.setMeta("annotationEvent",x),!0},p=(e,t)=>{let n=(0,l.wz)(e,t);return 0===Object.entries(n).length?{node:e.doc.nodeAt(t),pos:t}:n.body||null},m=e=>{let t=(0,i.Ru)(e,e=>"cardLayoutItem"===e.type.name&&"body"===e.attrs.itemId||"card"===e.type.name);return 0===t.length?null:t[0]},h=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=(0,l.wz)(e,t),o=e.doc.resolve(t);if(0===Object.entries(r).length)return n?o.doc.resolve(o.start(o.depth+1)).end():t+1;if(!r.body)throw Error("Could not find card body at cardPos=".concat(t));let i=e.doc.resolve(r.body.pos);return n?i.doc.resolve(i.start(i.depth+1)).end():i.pos+1},g=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=e.resolve(t),o=(0,s.cM)(r);if(!o)return null;let i=e.resolve(o.pos);return n?i.doc.resolve(i.start(i.depth+1)).end():i.pos+1},f=(e,t)=>{if(!e.empty)return!1;let n=e instanceof o.Q;if(!(0,r.xh)(e)&&!n)return!1;let{from:i,$from:a}=e;if(!t&&0!==a.parentOffset||t&&a.parentOffset!==a.parent.content.size)return!1;let l=m(a);if(!l)return!1;if(n)return t?i===l.pos+l.node.nodeSize-1:i===l.pos+1;let s=["paragraph","heading","title"],c=!0;for(let e=a.depth;e>0;e--){let t=a.node(e);if("card"===t.type.name||(0,d.pv)(t))break;if(!s.includes(t.type.name)){c=!1;break}}return!!c&&(t?i===l.pos+l.node.nodeSize-2:i===l.pos+2)}},33169:function(e,t,n){"use strict";n.d(t,{C2:function(){return d},Zs:function(){return u},pK:function(){return p}});var r=n(38564),o=n(37164),i=n(30764),a=n(27191),l=n(55850),s=n(93814);let d={generate:(0,o.kP)("0123456789abcdefghijklmnopqrstuvwxyz",15)},c=new a.H$("UniqueCardId"),u=e=>{let t=e=>{var n;return null===(n=e.content)||void 0===n?void 0:n.map(e=>{if(!e.content||e.type!==s.W4)return e;let n={...e,attrs:{...e.attrs,id:d.generate()}};return n.content=t(n),n})};return Object.assign({},e,{content:t(e)})},p=l.I.extend({name:"UniqueCardId"}).configure({attributeName:"id",initialValue:()=>d.generate(),filterTransaction:e=>{let t=e.getMeta(r.Gt);return(null==t?void 0:t.isChangeOrigin)!==!0},pluginKey:c,transformPasted:(e,t,n)=>{let{types:r,initialValue:o,attributeName:a}=t,l={},d=e=>{let t=[];return e.forEach(e=>{if(e.isText){t.push(e);return}if(!r.includes(e.type.name)){t.push(e.copy(d(e.content)));return}let n=o(),i=e.type.create({...e.attrs,[a]:n},d(e.content),e.marks);e.type.name===s.W4&&(l={...l,[e.attrs.id]:n}),t.push(i)}),i.HY.from(t)},c=e=>{let t=[];return e.forEach(e=>{if(e.isText){t.push(e);return}if("cardMention"===e.type.name){let r=l[e.attrs.id];if(r){let o=e.type.create({...e.attrs,...r?{id:r}:{},docId:n});t.push(o)}else t.push(e);return}t.push(e.copy(c(e.content)))}),i.HY.from(t)},u=d(e.content),p=c(u);return new i.p2(p,e.openStart,e.openEnd)}})},12964:function(e,t,n){"use strict";n.d(t,{o:function(){return E}});var r=n(52322),o=n(38035),i=n(28535),a=n(41098),l=n(49929),s=n(87254),d=n(18816),c=n(31131),u=n(35183),p=n(97166);let m=e=>{let{label:t,control:n}=e;return(0,r.jsxs)(o.k,{as:u.NI,alignItems:"center",children:[(0,r.jsx)(p.l,{flexGrow:1,children:t}),(0,r.jsx)(i.xu,{width:48,children:n})]})};var h=n(55233);function g(e,t){return function(n,r,o){var i;return t({chartAttributes:{...o,[e]:{...null!==(i=o[e])&&void 0!==i?i:{},[n]:r}}})}}let f={donut:e=>{let{attributes:t,updateAttributes:n,inline:o}=e,i=t.chartAttributes||{},a=i.donut||{},l=g("donut",n);return(0,r.jsx)(m,{label:s.ag._({id:"apgGuY"}),control:(0,r.jsxs)(h.iR,{defaultValue:1-(a.radius||.5),step:.01,min:.1,max:.9,onChange:e=>o||l("radius",1-e,i),onChangeEnd:e=>o&&l("radius",1-e,i),children:[(0,r.jsx)(h.Uj,{children:(0,r.jsx)(h.Ms,{})}),(0,r.jsx)(h.gs,{})]})})},line:e=>{let{attributes:t,updateAttributes:n}=e,o=t.chartAttributes||{},i=o.line||{},l=g("line",n);return(0,r.jsx)(m,{label:s.ag._({id:"PwokTd"}),control:(0,r.jsx)(a.r,{isChecked:!i.hideMarkers,onChange:e=>l("hideMarkers",!e.target.checked,o)})})}};var x=n(10625),v=n(67046),b=n(62614),y=n(99058),C=n(44035),w=n(39237),k=n(54933),j=n(2784),S=n(47288);let A=e=>{let{accentColor:t,selected:n,onChange:i,steps:a=5}=e,d=Array(a).fill(0).map((e,t)=>t),u=(0,j.useMemo)(()=>Object.fromEntries(Object.entries(c.cb).map(e=>{let[n,{label:r}]=e;return[n,{label:r,scale:(0,S.$)(t,d,n)}]})),[t,a]);return(0,r.jsx)(m,{label:s.ag._({id:"tvmuQ0"}),control:(0,r.jsxs)(x.v,{isLazy:!0,children:[(0,r.jsx)(v.j,{as:b.z,variant:"plain",width:48,rightIcon:(0,r.jsx)(l.G,{icon:k.ptq}),leftIcon:(0,r.jsx)(I,{width:5,height:"1.2em",data:d,scale:u[n].scale}),children:u[n].label()}),(0,r.jsx)(y.q,{zIndex:"modalPopover",children:(0,r.jsx)(C._,{value:n,type:"radio",onChange:i,children:Object.entries(u).map(e=>{let[t,{label:n,scale:i}]=e;return(0,r.jsx)(w.i,{value:t,children:(0,r.jsxs)(o.k,{justifyItems:"stretch",children:[(0,r.jsx)(o.k,{flexGrow:1,children:n()}),(0,r.jsx)(I,{ml:2,flexGrow:0,width:20,scale:i,data:d})]})},t)})})})]})})},I=e=>{let{scale:t,data:n,...i}=e;return(0,r.jsx)(o.k,{width:"100%",...i,children:n.map(e=>(0,r.jsx)(o.k,{background:t.get(e),flexBasis:"1em",flexGrow:1,flexShrink:1,children:" "},e))})},E=e=>{let{attributes:t,updateAttributes:n,accentColor:u}=e,p=f[t.chartType];return(0,r.jsxs)(o.k,{background:"gray.50",flexDir:"column",children:[(0,r.jsx)(i.xu,{background:"gray.200",width:"100%",children:(0,r.jsx)(d.w,{name:"chartType",size:"lg",value:t.chartType,onCh
1ange:e=>n({chartType:e}),options:Object.entries(c.CK).map(e=>{let[t,{icon:n,label:o}]=e;return{value:t,component:(0,r.jsx)(l.G,{icon:n}),tooltip:{label:o()}}})})}),(0,r.jsxs)(o.k,{flexDir:"column",p:3,children:[(0,r.jsx)(A,{accentColor:u,selected:t.colorScheme||"lightest",steps:5,onChange:e=>{n({colorScheme:e})}}),(0,r.jsx)(m,{label:s.ag._({id:"sgzcYD"}),control:(0,r.jsx)(a.r,{isChecked:!t.hideLabels,onChange:e=>n({hideLabels:!e.target.checked})})}),(0,r.jsx)(i.xu,{as:"hr",my:3}),p&&(0,r.jsx)(p,{...e})]})]})}},37160:function(e,t,n){"use strict";n.d(t,{O:function(){return i},g:function(){return a}});var r=n(27191),o=n(15690);function i(e){return 0==e.openStart&&0==e.openEnd&&1==e.content.childCount?e.content.firstChild:null}let a=(e,t,n)=>{if(!n)return!0;let a=i(n),l=a&&e.state.selection instanceof r.qv,s=a?e.state.tr.replaceSelectionWith(a,e.input.shiftKey):e.state.tr.replaceSelection(n),d=(0,o.a)(s);return d?s.setSelection(d):l&&s.setSelection(r.qv.create(s.doc,e.state.selection.from)),e.dispatch(s.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}},25819:function(e,t,n){"use strict";n.d(t,{Lv:function(){return m},i1:function(){return g},tf:function(){return h}});var r=n(72338),o=n(3027),i=n(27191),a=n(11093),l=n(15425),s=n(78462),d=n(15690),c=n(50322),u=n(84875);let p=e=>"gallery"===e.type.name,m=(e,t,n)=>{var c;let m=x(n);if(m.length>0)return m.forEach(t=>{let{mark:n}=t;(0,u.Td)(n)||(0,u.m7)(n.attrs.href,e)}),!1;let g=null===(c=t.clipboardData)||void 0===c?void 0:c.getData("text/plain");if(!g||!h(g))return!1;let{selection:v}=e.state;if(v instanceof i.Bs&&!v.empty)return t.preventDefault(),f(e,g),!0;if(g.match(s.nP)||(0,l.hU)(g))return!1;if(!e.schema.nodes.embed)return(0,u.m7)(g,e),!1;let b=v instanceof o.Q,y=v.empty&&["paragraph","heading","title"].includes(v.$from.parent.type.name)&&(0,a.bR)(v.$from.parent),C=p(v.$from.parent),w=(0,r.EG)(v)&&p(v.node);if(!(y||C||w||b))return!1;let k=v.from-1,j=w?{from:v.to-1,to:v.to-1}:y?{from:k,to:k+v.$from.parent.nodeSize}:{from:v.from,to:v.to};return e.chain().setTextSelection(j).insertEmbedAndFetchMetadata(g,void 0,!0).command(e=>{let{tr:t}=e,n=(0,d.a)(t);return n&&t.setSelection(n),!0}).run(),!0},h=e=>(0,l.kr)(e)&&!e.includes("\n")&&(0,l.jv)(e),g=e=>1===e.content.childCount&&e.content.firstChild.isTextblock&&h(e.content.firstChild.textContent),f=(e,t)=>{e.commands.setMark(c.r.name,{href:t}),(0,u.m7)(t,e)},x=e=>{let t=[];return e.content.descendants((e,n)=>{e.marks.filter(e=>"link"===e.type.name).forEach(e=>{t.push({mark:e,pos:n})})}),t}},86581:function(e,t,n){"use strict";n.d(t,{Ck:function(){return m},MF:function(){return h},aT:function(){return d},c$:function(){return u},c8:function(){return p},iO:function(){return s}});var r=n(19870),o=n(6382),i=n(25819),a=n(3402),l=n(87008);let s=(e,t)=>{if(!e.isEditable||!t.clipboardData)return!1;let n=t.clipboardData.getData("text/plain");if(!n||(0,i.tf)(n))return!1;let r=t.clipboardData.getData("text/html");if(null==r?void 0:r.includes("data-pm-slice"))return!1;let{state:o}=e;if(o.selection.$from.parent.type.spec.code){let t=o.tr.insertText(n);return e.view.dispatch(t),!0}let a=t.clipboardData.getData("vscode-editor-data"),l=a?JSON.parse(a):void 0,s=null==l?void 0:l.mode,d=!r||"markdown"===s||c(n);if(!d)return!1;let{from:u,to:p}=o.selection;return t.preventDefault(),e.commands.insertMarkdownAt({from:u,to:p},n)},d=(e,t,n)=>{let o=r.TU.parse(e),{slice:i}=(0,a.T)(o,t,n,!1);return i},c=e=>{let t=e.match(/^```/gm);if(t&&t.length>1||e.match(/\[[^]+\]\(https?:\/\/\S+\)/gm)||e.match(/\[[^]+\]\(\/\S+\)/gm)||e.match(/^#{1,6}\s+\S+/gm))return!0;let n=e.match(/^\s*[\d-*].\s\S+/gm);return!!(n&&n.length>1||e.match(/^\s*-{3,}\s*$/gm))},u=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];t&&(o.Z.prototype.escape=e=>e);let n=g.turndown(e);return t&&(o.Z.prototype.escape=f),n},p=e=>r.TU.parse(e,{}),m=(e,t,n,r)=>{try{let o=e.slice(t,n).content,i=(0,l.Xb)(o,e.type.schema),a=document.createElement("div");a.appendChild(i);let s=a.innerHTML,d=u(s,r);return d}catch(r){return console.error("[caught] rangeToMarkdown: ",t,n,e.nodeSize,r),""}},h=(e,t)=>m(e,1,e.nodeSize-2,t),g=(0,o.Z)({headingStyle:"atx",bulletListMarker:"-",codeBlockStyle:"fenced",hr:"---"}).remove(["style"]).addRule("list",{filter:["ul","ol"],replacement:function(e,t){let n=t.parentNode;return(t.parentNode.nodeName.match(/^(UL|OL)$/i)&&(e=" "+e.replace(/^\n+/,"").replace(/\n+$/,"\n").replace(/\n/gm,"\n ")),"LI"===n.nodeName&&n.lastElementChild===t)?"\n"+e:"\n\n"+e+"\n\n"}}).addRule("listItem",{filter:"li",replacement:function(e,t,n){e=e.replace(/^\n+/,"").replace(/\n+$/,"\n").replace(/\n/gm,"\n ");let r=n.bulletListMarker+" ",o=t.parentNode;if(1===t.children.length&&t.children[0].nodeName.match(/^(UL|OL)$/i)&&t.textContent===t.children[0].textContent)r=" ";else if("OL"===o.nodeName){let e=o.getAttribute("start"),n=Array.prototype.indexOf.call(Array.prototype.filter.call(o.children,e=>"LI"===e.nodeName),t);r=(e?Number(e)+n:n+1)+". "}return r+e+(t.nextSibling&&!/\n$/.test(e)?"\n":"")}}),f=o.Z.prototype.escape},3402:function(e,t,n){"use strict";n.d(t,{T:function(){return a}});var r=n(30764),o=n(29460),i=n(18455);let a=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,a=arguments.length>3&&void 0!==arguments[3]&&arguments[3],l=(0,i.B)(e,!1),s=new DOMParser().parseFromString(l,"text/html"),d=r.aw.fromSc
1hema(t).parseSlice(s,{preserveWhitespace:a}),c=(0,o.iu)(d,t,n);return{content:c.content,dom:s.body,slice:c}}},29460:function(e,t,n){"use strict";n.d(t,{iu:function(){return h}});var r=n(30764),o=n(27354),i=n(66121);let a=e=>{if((0,o.zx)()&&e&&0!==e.length)for(let t=0;t<e.length;t++)l(e[t],e,t)},l=(e,t,n)=>{if("text"===e.type){if(!e.text)return;let{replaced:r,nodes:o}=(0,i.W)(e.text,e.marks);r&&t.splice(n,1,...o);return}if(e.content&&e.content.length>0)for(let t=0;t<e.content.length;t++)l(e.content[t],e.content,t)};var s=n(27875),d=n.n(s),c=n(35676),u=n.n(c);let p=(e,t)=>{let n={type:"document",content:[]},r=(e,t)=>{var r,o;let i=n;for(let e=0;e<t;e++){(o=i).content||(o.content=[]);let e=i.content[i.content.length-1];e&&"card"===e.type||(e={type:"card",content:[]},i.content.push(e)),i=e}null===(r=i.content)||void 0===r||r.push(e)},o=1,i=null;for(let n=0;n<e.length;n++){var a;let l=e[n];if(t.splitOnHeadings&&"heading"===l.type&&(null===(a=l.content)||void 0===a?void 0:a.length)){let{level:e}=l.attrs||{};if(null==i?i=e:e>i?(o+=1,i=e):e<i&&(o=e,i=e),o>1&&!t.nested){i=1,r(l,o=1);continue}r({type:"card",content:[]},(o=d()(o,1,3))-1)}else if(t.splitOnDividers&&"divider"===l.type){r({type:"card",content:[]},o-1);continue}r(l,o)}let l=u()(m(n));return console.debug("splitCards",n,l),l},m=e=>{var t;return(null===(t=e.content)||void 0===t?void 0:t.every(e=>"card"===e.type))?u()(e.content.map(m)):[e]},h=(e,t,n)=>{var o;let i=null===(o=e.toJSON())||void 0===o?void 0:o.content;if(a(i),!i||0===i.length||1===i.length&&("document"===i[0].type||"card"===i[0].type))return e;if(i.every(e=>t.nodes[e.type].isInline))return r.p2.fromJSON(t,{...e,content:i});try{return i=f(i,t),i=g(i),n&&(i=p(i,n)),r.p2.fromJSON(t,{...e,content:i})}catch(t){return console.error("Error transforming slice",t),e}},g=e=>{let t=[...e];return e.forEach((n,r)=>{var o;if(r<1)return;let i=e[r-1];if(i.type!==n.type||!i.content)return;let a=null===(o=n.content)||void 0===o?void 0:o[0];a&&"footnote"===a.type&&(i.content=i.content.concat(n.content),t[r]=null)}),t.filter(e=>null!==e)},f=(e,t)=>{let n=[];return e.forEach(e=>{var r,o;if(!e.type)return;let i=null===(r=t.nodes[e.type])||void 0===r?void 0:r.isBlock;if(i)n.push(e);else{let r=n[n.length-1];if(!r||!r.content||!t.nodes[r.type].isTextblock||"text"===e.type&&(null===(o=e.text)||void 0===o?void 0:o.trim())==="")return;r.content.push(e)}}),n}},18455:function(e,t,n){"use strict";n.d(t,{B:function(){return x}});var r=n(87008),o=n(65396);let i=e=>{(0,o.F)(e,"p.title").forEach(d),(0,o.F)(e,"br").forEach(s),(0,o.F)(e,"a[href]").forEach(u),(0,o.F)(e,"a[href][id]").forEach(p),(0,o.F)(e,"span").forEach(m),(0,o.F)(e,"a[href][id]").forEach(t=>g(t,e))},a=e=>{(0,o.F)(e,"h1").forEach(l)},l=e=>{if("always"==e.style.pageBreakBefore){let t=document.createElement("hr");t.style.pageBreakBefore="always",t.classList.add("divider"),e.before(t)}},s=e=>{var t;((null===(t=e.previousElementSibling)||void 0===t?void 0:t.tagName)=="P"||e.classList.contains("Apple-interchange-newline"))&&e.remove()},d=e=>{let t=document.createElement("h1");t.className="title",t.innerHTML=e.innerHTML,e.replaceWith(t)},c=/^https:\/\/docs\.google\.com\/document\/d\/[^/]+\/edit#heading=(h\.[^/]+)/,u=e=>{let t=e.getAttribute("href");if(t&&(t.startsWith("#h.")||c.test(t))){let t=e.closest("p");t&&t.textContent==e.textContent?t.remove():e.removeAttribute("href")}},p=e=>{var t,n;if(null===(t=e.getAttribute("id"))||void 0===t?void 0:t.startsWith("cmnt_ref")){let t=e.closest("sup");null==t||t.remove()}else if(null===(n=e.getAttribute("id"))||void 0===n?void 0:n.startsWith("cmnt")){let t=e.closest("div");null==t||t.remove()}},m=e=>{e.innerHTML=e.innerHTML.replace(/( ){2,}/g,"").replace(/ /g," ")},h=/ftnt_ref(\d+)/,g=(e,t)=>{let n=e.getAttribute("id");if(n&&n.startsWith("ftnt_ref")){var r;let o=parseInt((null===(r=n.match(h))||void 0===r?void 0:r[1])||""),i=e.closest("sup"),a=t.querySelector("#ftnt".concat(o)),l=null==a?void 0:a.closest("div");if(!o||!i||!l)return;null==a||a.remove();let s=document.createElement("div");s.className="imported-footnote",s.appendChild(l),i.replaceWith(s)}};var f=n(65282);let x=function(e){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1];try{let n=new DOMParser().parseFromString(e,"text/html");
1return(0,o.F)(n,"li",!0).forEach(f.e),(0,o.F)(n,"img").forEach(v),t||(0,o.F)(n,"img").forEach(y),(0,o.F)(n,"script, style").forEach(e=>e.remove()),a(n),i(n),(0,o.F)(n,"p").forEach(b),n.body.innerHTML}catch(t){return console.error("Error transforming pasted HTML",t),e}},v=e=>{let t=e.closest("p, h1, h2, h3, h4, h5, h6, ul, ol, li");t&&t.after(e)},b=e=>{if((0,r.np)(e)){var t;(null===(t=e.parentElement)||void 0===t?void 0:t.childElementCount)!==1&&e.remove()}},y=e=>{e.src.startsWith("data:")&&e.remove()}},87008:function(e,t,n){"use strict";n.d(t,{G8:function(){return s},Xb:function(){return i},np:function(){return l}});var r=n(30764),o=n(396);let i=(e,t,n)=>{null!=n||(n=r.PW.fromSchema(t));let i=n.serializeFragment(e);return(0,o.S)(i)},a=["img"],l=e=>{var t;return!e.hasChildNodes()||!((null===(t=e.textContent)||void 0===t?void 0:t.trim())!=""||a.includes(e.nodeName))&&[...e.childNodes].every(e=>l(e))},s=(e,t,n)=>{let r=i(e,t,n),o=document.createElement("div");o.appendChild(r);let a=o.innerHTML;return a}},71917:function(e,t,n){"use strict";n.d(t,{u:function(){return o}});let r={cardLayoutsEnabled:!1},o=e=>{if(!e)return{...r};let t=null;return("doc"===e.type.name?t=e.nodeAt(0):"document"===e.type.name&&(t=e),t)?{...r,...t.attrs.docFlags}:(console.debug("[getDocFlags] could not find document node, returning defaults"),{...r})}},70347:function(e,t,n){"use strict";n.d(t,{LN:function(){return g},kT:function(){return f}});var r=n(52322),o=n(38035),i=n(75009),a=n(91994),l=n(90439),s=n(87205),d=n(47968),c=n(90604),u=n(83905);let p="10vw",m="var(--chakra-space-10)",h="80px",g=()=>{let e=(0,a.CG)(d.Pu),t=(0,a.CG)(d.gh),n=t===c.q.SLIDE_VIEW,{logoUrl:g}=e;if(!g)return null;let f=(0,s.SN)(g,s.gJ),x=l.Pv?{position:"absolute",right:m,top:m,height:h,maxHeight:h,width:"80px"}:n?{position:"absolute",right:"2.5rem",top:"2.5rem",justify:"end",align:"start",width:p,height:"4vh"}:{position:"sticky",left:"3rem",top:"calc(100% - ".concat("4vh"," - 4.5rem)"),justify:"start",width:p,height:"4vh"},v=l.cx?u.S.customerLogo:{base:void 0,lg:u.S.customerLogo};return(0,r.jsx)(o.k,{...x,className:"logo",zIndex:v,borderRadius:"md",contentEditable:!1,userSelect:"none",children:(0,r.jsx)(i.E,{src:f,maxH:"100%",maxW:"100%",transitionProperty:"width, height",transitionDuration:"normal",pointerEvents:"none","data-testid":"customer-logo","data-customer-logo-image":!0,objectFit:"contain",objectPosition:n?"top right":"bottom left"})})},f=()=>{let e=(0,a.CG)(d.Pu),{logoUrl:t}=e;if(!t)return null;let n=(0,s.SN)(t,s.gJ);return(0,r.jsx)(o.k,{w:"100%",justify:"center",align:"center",mt:8,mb:10,"data-id":"customer-logo-wrapper",children:(0,r.jsx)(i.E,{src:n,maxW:"12em",zIndex:u.S.customerLogo,maxH:"4vh",transitionProperty:"width, height",transitionDuration:"normal",pointerEvents:"none",objectFit:"contain",objectPosition:"bottom"})})}},65878:function(e,t,n){"use strict";n.d(t,{x:function(){return c},S:function(){return d}});var r=n(72338),o=n(27191),i=n(18149),a=n.n(i),l=n(47968);class s{compute(e){let t=e.firstChild;if(!t)return this;let n=t.attrs;return a()(n,this.value)||(this.hasChanges=!0),this.value=n,this}apply(e,t){return e.docChanged&&this.compute(e.doc),this}processChanges(e){this.hasChanges&&this.value&&e((0,l.Qt)({docAttrs:this.value})),this.hasChanges=!1}constructor(){this.hasChanges=!1,this.value=null}}let d=new o.H$("documentAttrs"),c=r.hj.create({name:"documentAttrs",addProseMirrorPlugins:()=>[new o.Sy({key:d,state:{init:()=>new s,apply:(e,t,n,r)=>t.apply(e,r)}})]})},7207:function(e,t,n){"use strict";n.d(t,{i:function(){return o},m:function(){return r}});let r="10vh",o="80vh"},83905:function(e,t,n){"use strict";n.d(t,{S:function(){return r}});let r={presentBg:1,customerLogo:4,toolbar:5,collapseCardBtn:11,siteNav:21}},86189:function(e,t,n){"use strict";n.d(t,{A:function(){return f}});var r=n(52322),o=n(2784),i=n(91994),a=n(47968),l=n(62047),s=n(13653),d=n(39540),c=n(37872),u=n(42822),p=n(94523),m=n(56904);let h=e=>{let{icon:t="â®",isVisible:n,isSelected:o,label:i,onClick:a,onDragStart:l,...s}=e,{color:d,bg:c,hoverColor:h,hoverBg:g,borderColor:f}=(0,m.lv)(o);return(0,r.jsx)(p.kH,{placement:"top",label:o?void 0:i,children:(0,r.jsx)(u.M,{position:"absolute",width:"16px",height:"22px",fontWeight:"900",fontFamily:"Inter, sans-serif",background:c,backdropFilter:"blur(8px)",border:"1px solid",borderColor:f,color:d,borderRadius:"sm",boxShadow:"sm",fontSize:"16px",cursor:"pointer",opacity:o||n?1:0,_hover:{color:h,background:g,opacity:1},...s,className:"drag-handle",onClick:a,onDragStart:l,draggable:!0,contentEditable:!1,_after:{position:"absolute",content:'""',inset:-2},children:t})})},g={top:{top:"0",left:"50%",height:"16px",width:"26px",pt:"1px",
1icon:"â¯",zIndex:"3",transform:"translateY(-50%) translateX(-50%)",fontSize:"15px"},left:{top:"50%",left:"0",height:"26px",width:"16px",zIndex:"3",transform:"translateY(-50%) translateX(-50%)",fontSize:"15px"},outside:{top:0,left:-6},inside:{top:2,left:3}},f=e=>{let{handlePlacement:t="outside",editor:n,getPos:u,decorations:p,isVisible:m,onClick:f,node:x,selected:v,extension:b,updateAttributes:y,deleteNode:C,...w}=e,k=(0,i.CG)(a.hN),j=(0,o.useCallback)(e=>{n.commands.selectNodeAtPos(u()),e.stopPropagation()},[n,u]),S=(0,o.useCallback)(e=>{var t;let r=(null===(t=e.target.closest("[data-node-view-wrapper]"))||void 0===t?void 0:t.querySelector("[data-selection-ring]"))||void 0;(0,c.SS)(n,e.nativeEvent,u(),r),e.stopPropagation()},[n,u]);if(!k)return null;let A=(0,l.WE)(p),I=(0,d.v)(p),E=(0,s.EL)(p);return null!=m||(m=A||I),(0,r.jsx)(h,{isSelected:E,isVisible:m,onClick:f||j,onDragStart:S,...g[t],...w})}},56904:function(e,t,n){"use strict";n.d(t,{lv:function(){return s},vu:function(){return a}});var r=n(2784),o=n(29318);let i=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n={borderColor:e?"var(--chakra-colors-whiteAlpha-300)":"var(--chakra-colors-blackAlpha-200)"};return t?{...n,bg:e?"var(--chakra-colors-trueblue-300)":"var(--chakra-colors-trueblue-50)",color:e?"var(--chakra-colors-trueblue-900)":"var(--chakra-colors-trueblue-300)",hoverBg:e?"var(--chakra-colors-trueblue-200)":"var(--chakra-colors-trueblue-100)",hoverColor:e?"var(--chakra-colors-trueblue-900)":"var(--chakra-colors-trueblue-600)"}:{...n,bg:e?"var(--chakra-colors-gradient-dark)":"var(--chakra-colors-whiteAlpha-900)",color:e?"var(--chakra-colors-gray-100)":"var(--chakra-colors-gray-500)",hoverBg:e?"var(--chakra-colors-gray-800)":"var(--chakra-colors-gray-100)",hoverColor:e?"var(--chakra-colors-trueblue-200)":"var(--chakra-colors-gray-800)"}},a=e=>{let t=i(e);return{"--global-drag-handle-background":t.bg,"--global-drag-handle-color":t.color,"--global-drag-handle-hover-background":t.hoverBg,"--global-drag-handle-hover-color":t.hoverColor,"--global-drag-handle-border":t.borderColor}},l=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return t?i(e,!0):{bg:"var(--global-drag-handle-background)",color:"var(--global-drag-handle-color)",hoverBg:"var(--global-drag-handle-hover-background)",hoverColor:"var(--global-drag-handle-hover-color)",borderColor:"var(--global-drag-handle-border)"}},s=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=(0,o.Yy)();return(0,r.useMemo)(()=>l(t,e),[t,e])}},37872:function(e,t,n){"use strict";n.d(t,{SS:function(){return C},YR:function(){return f},nM:function(){return w},rc:function(){return b},z7:function(){return y}});var r=n(72338),o=n(27191),i=n(91073),a=n(90221),l=n(14657),s=n(57863),d=n(13608),c=n(52332),u=n(27835),p=n(66855),m=n(26282),h=n(59322),g=n(54999);let f=24,x=2+f,v=(e,t,n,r)=>{if(r&&((0,h.BF)(r)||(0,m.E)(r)||(0,s.m)(r))||w(e)||(0,g.O4)(e)||!(0,i.zh)(e))return!1;if((0,p.fP)(e)){let e=n.state.doc.resolve(t);return!(0,u.u5)(e)}return!0},b=(e,t)=>{var n,o,i;let a;let l=Math.max((null===(n=t.posAtCoords(e))||void 0===n?void 0:n.inside)||-1,(null===(o=t.posAtCoords({...e,left:e.left+x}))||void 0===o?void 0:o.inside)||-1,(null===(i=t.posAtCoords({...e,left:e.left+x+22}))||void 0===i?void 0:i.inside)||-1);if(-1==l)return;try{a=t.state.doc.resolve(l)}catch(e){return}let s=a.nodeAfter,d=s&&v(s,l,t,a.parent)?{pos:l,depth:a.depth,node:s}:(0,r.qv)(a,e=>v(e,l,t));if(!d)return;let{pos:c,depth:u,node:p}=d,m=t.nodeDOM(c);if(!(m instanceof HTMLElement))return;let h=m,g=m.querySelector("[data-content-reference]");if(g){let e=t.posAtDOM(g,0);(p.isAtom&&e===c||e===c+1)&&(h=g)}return{pos:c,depth:u,el:h,node:p}},y=(e,t)=>{let n={left:0,top:0};if(e.isTextblock){let e=t.querySelector("[data-node-view-content]")||t,r=parseInt(window.getComputedStyle(e).lineHeight);n.top=(r-22)/2}else if((0,i.KH)(e)){let r=(0,c.HD)(e);r?n.left=0-t.clientWidth*(d.r0-1)/2:(n.left=32,n.top=12)}else(0,h.CU)(e)&&(n.left=-22);return n},C=(e,t,n,r)=>{let{view:i,state:s}=e;if(!t.dataTransfer||!r&&!(r=e.view.domAtPos(n).node))return;let d=r.dataset.contentReference,c=0,u=0;if((0,a.i7)()&&d){let[e,t]=d.split(",").map(parseFloat);e&&t&&(c=e,u=t)}t.dataTransfer.clearData(),t.dataTransfer.effectAllowed="move",t.dataTransfer.setData("text/html",r.innerHTML),t.dataTransfer.setData("text/plain",r.textContent||""),t.dataTransfer.setDragImage(r,c,u);let p=o.qv.create(s.doc,n),m=p.content();i.dispatch(i.state.tr.setSelection(p)),i.dragging={slice:m,move:!0};let h=(0,l.lG)({pos:n,editor:e,from:p.from,to:p.to});h&&(i.dragging.annotations=h)},w=e=>e.type.spec.containerHandle},57670:function(e,t,n){"use strict";n.d(t,{h:function(){return u}});let r={staircase:{type:"drawing",attrs:{horizontalAlign:null,page:{
1id:"page",name:"Page 1",childIndex:1,shapes:{"2fe86829-fd3e-4e73-309a-9c88978544b6":{id:"2fe86829-fd3e-4e73-309a-9c88978544b6",type:"rectangle",name:"Rectangle",parentId:"page",childIndex:5.666666666666667,point:[312,728],size:[245.61,36.31],rotation:0,style:{color:"violet",size:"small",isFilled:!0,dash:"solid",scale:1},label:"",labelPoint:[.5,.5]},"e7f37a08-32c9-4a9e-3e82-d4eb03c55ce3":{id:"e7f37a08-32c9-4a9e-3e82-d4eb03c55ce3",type:"text",name:"Text",parentId:"page",childIndex:6.666666666666667,point:[312,792],rotation:0,text:"S T E P 1",style:{color:"violet",size:"small",isFilled:!0,dash:"solid",scale:1.0735548818438974,font:"script",textAlign:"middle"}},"707d08b1-ef6d-4402-2b83-8242300be57c":{id:"707d08b1-ef6d-4402-2b83-8242300be57c",type:"text",name:"Text",parentId:"page",childIndex:7.666666666666667,point:[312,856],rotation:0,text:"Lorem ipsum dolor sit,\nconsectetur adipiscing,\nsed do eiusmod tempor\nincididunt ut labore etlor",style:{color:"white",size:"small",isFilled:!0,dash:"solid",scale:.7890928011383548,font:"script",textAlign:"middle"}},"aa532a44-94e2-4d73-10a4-47aaec919c99":{id:"aa532a44-94e2-4d73-10a4-47aaec919c99",type:"rectangle",name:"Rectangle",parentId:"page",childIndex:8.666666666666668,point:[664,664],size:[245.61,36.31],rotation:0,style:{color:"violet",size:"small",isFilled:!0,dash:"solid",scale:1},label:"",labelPoint:[.5,.5]},"4fa8a112-49a2-4ff1-3386-97befd6c8719":{id:"4fa8a112-49a2-4ff1-3386-97befd6c8719",type:"text",name:"Text",parentId:"page",childIndex:9.666666666666668,point:[664,728],rotation:0,text:"S T E P 2",style:{color:"violet",size:"small",isFilled:!0,dash:"solid",scale:1.0735548818438974,font:"script",textAlign:"middle"}},"80dde81a-0620-46be-0ee1-2f00db00d9f0":{id:"80dde81a-0620-46be-0ee1-2f00db00d9f0",type:"text",name:"Text",parentId:"page",childIndex:10.666666666666668,point:[664,792],rotation:0,text:"Lorem ipsum dolor sit,\nconsectetur adipiscing,\nsed do eiusmod tempor\nincididunt ut labore etlor",style:{color:"white",size:"small",isFilled:!0,dash:"solid",scale:.7890928011383548,font:"script",textAlign:"middle"}},"e7f6c66e-e78f-4131-003a-4c6a7cc79d38":{id:"e7f6c66e-e78f-4131-003a-4c6a7cc79d38",type:"rectangle",name:"Rectangle",parentId:"page",childIndex:11.666666666666668,point:[1016,632],size:[245.61,36.31],rotation:0,style:{color:"violet",size:"small",isFilled:!0,dash:"solid",scale:1},label:"",labelPoint:[.5,.5]},"111dc4dd-0162-420b-1a9d-f836e8dc1b0d":{id:"111dc4dd-0162-420b-1a9d-f836e8dc1b0d",type:"text",name:"Text",parentId:"page",childIndex:12.666666666666668,point:[1016,696],rotation:0,text:"S T E P 3",style:{color:"violet",size:"small",isFilled:!0,dash:"solid",scale:1.0735548818438974,font:"script",textAlign:"middle"}},"00c3c74b-cd1a-4b26-1ea2-96d342fadd96":{id:"00c3c74b-cd1a-4b26-1ea2-96d342fadd96",type:"text",name:"Text",parentId:"page",childIndex:13.666666666666668,point:[1016,760],rotation:0,text:"Lorem ipsum dolor sit,\nconsectetur adipiscing,\nsed do eiusmod tempor\nincididunt ut labore etlor",style:{color:"white",size:"small",isFilled:!0,dash:"solid",scale:.7890928011383548,font:"script",textAlign:"middle"}},"936954c8-6148-40d6-36d5-1363f32a31c3":{id:"936954c8-6148-40d6-36d5-1363f32a31c3",type:"rectangle",name:"Rectangle",parentId:"page",childIndex:14.666666666666668,point:[1368,600],size:[245.61,36.31],rotation:0,style:{color:"violet",size:"small",isFilled:!0,dash:"solid",scale:1},label:"",labelPoint:[.5,.5]},"ab2480c2-a0c2-4dc2-2850-d2e90d051ec1":{id:"ab2480c2-a0c2-4dc2-2850-d2e90d051ec1",type:"text",name:"Text",parentId:"page",childIndex:15.666666666666668,point:[1368,664],rotation:0,text:"S T E P 4",style:{color:"violet",size:"small",isFilled:!0,dash:"solid",scale:1.0735548818438974,font:"script",textAlign:"middle"}},"7c0ee72e-973f-48d6-0651-b6c75f9d5411":{id:"7c0ee72e-973f-48d6-0651-b6c75f9d5411",type:"text",name:"Text",parentId:"page",childIndex:16.666666666666668,point:[1368,728],rotation:0,text:"Lorem ipsum dolor sit,\nconsectetur adipiscing,\nsed do eiusmod tempor\nincididunt ut labore etlor",style:{color:"white",size:"small",isFilled:!0,dash:"solid",scale:.7890928011383548,font:"script",textAlign:"middle"}}},bindings:{}},assets:{},meta:{width:1304,height:354},width:1304,svg:'<svg viewBox="0 0 1304 354" width="1304" height="354" style="background-color: transparent;"><g class="" transform="translate(0.00, 128.00) rotate(0.00, 122.81, 18.16)"><rect x="2.1180000000000003" y="2.1180000000000003" width="243.49200000000002" height="34.192" fill="#e2daf8" pointer-events="none"></rect><g pointer-events="none" stroke="#7746f1" stroke-width="4.236000000000001" stroke-linecap="round"><line x1="2.1180000000000003" y1="2.1180000000000003" x2="243.49200000000002" y2="2.1180000000000003" stroke-dasharray="none" stroke-dashoffset="none"></line><line x1="243.49200000000002" y1="2.1180000000000003" x2="243.49200000000002" y2="34.192" stroke-dasharray="none" stroke-dashoffset="none"></line><line x1="243.49200000000002" y1="34.192" x2="2.1180000000000003" y2="34.192" stroke-dasharray="none" stroke-dashoffset="none"></line><line x1="2.1180000000000003" y1="34.192" x2="2.1180000000000003" y2="2.1180000000000003" stroke-dasharray="none" stroke-dashoffset="none"></line></g></g><g text-align="center" text-anchor="middle" fill="#7746f1" transform="translate(0.00, 192.00) rotate(0.00, 70.00, 20.00)"><text y="14" letter-spacing="-0.84" font-size="28px" font-family="Caveat Brush" text-align="center" alignment-baseline="central" transform="scale(1.0735548818438974)" x="65.20393245268527">S T E P 1</text></g><g text-align="center" text-anchor="middle" fill="#1d1d1d" transform="translate(0.00, 256.00) rotate(0.00, 124.00, 49.00)"><text y="14" letter-spacing="-0.84" font-size="28px" font-family="Caveat Brush" text-align="center" alignment-baseline="central" transform="scale(0.7890928011383548)" x="157.14248035353523">Lorem ipsum dolor sit,</text><text y="42" letter-spacing="-0.84" font-size="28px" font-family="Caveat Brush" text-align="center" alignment-baseline="central" transform="scale(0.7890928011383548)" x="157.14248035353523">consectetur adipiscing,</text><text y="70" letter-spacing="-0.84" font-size="28px" font-family="Caveat Brush" text-align="center" alignment-baseline="central" transform="scale(0.7890928011383548)" x="157.14248035353523">sed do eiusmod tempor</text><text y="98" letter-spacing="-0.84" font-size="28px" font-family="Caveat Brush" text-align="center" alignment-baseline="central" transform="scale(0.7890928011383548)" x="157.14248035353523">incididunt ut labore etlor</text></g><g class="" transform="translate(352.00, 64.00) rotate(0.00, 122.81, 18.16)"><rect x="2.1180000000000003" y="2.1180000000000003" width="243.49200000000002" height="34.192" fill="#e2daf8" pointer-events="none"></rect><g pointer-events="none" stroke="#7746f1" stroke-width="4.236000000000001" stroke-linecap="round"><line x1="2.1180000000000003" y1="2.1180000000000003" x2="243.49200000000002" y2="2.1180000000000003" stroke-dasharray="none" stroke-dashoffset="none"></line><line x1="243.49200000000002" y1="2.1180000000000003" x2="243.49200000000002" y2="34.192" stroke-dasharray="none" stroke-dashoffset="none"></line><line x1="243.49200000000002" y1="34.192" x2="2.1180000000000003" y2="34.192" stroke-dasharray="none" stroke-dashoffset="none"></line><line x1="2.1180000000000003" y1="34.192" x2="2.1180000000000003" y2="2.1180000000000003" stroke-dasharray="none" stroke-dashoffset="none"></line></g></g><g text-align="center" text-anchor="middle" fill="#7746f1" transform="translate(352.00, 128.00) rotate(0.00, 72.50, 20.00)"><text y="14" letter-spacing="-0.84" font-size="28px" font-family="Caveat Brush" text-align="center" alignment-baseline="central" transform="scale(1.0735548818438974)" x="67.53264432599546">S T E P 2</text></g><g text-align="center" text-anchor="middle" fill="#1d1d1d" transform="translate(352.00, 192.00) rotate(0.00, 124.00, 49.00)"><text y="14" letter-spacing="-0.84" font-size="28px" font-family="Caveat Brush" text-align="center" alignment-baseline="central" transform="scale(0.7890928011383548)" x="157.14248035353523">Lorem ipsum dolor sit,</text><text y="42" letter-spacing="-0.84" font-size="28px" font-family="Caveat Brush" text-align="center" alignment-baseline="central" transform="scale(0.7890928011383548)" x="157.14248035353523">consectetur adipiscing,</text><text y="70" letter-spacing="-0.84" font-size="28px" font-family="Caveat Brush" text-align="center" alignment-baseline="central" transform="scale(0.7890928011383548)" x="157.14248035353523">sed do eiusmod tempor</text><text y="98" letter-spacing="-0.84" font-size="28px" font-family="Caveat Brush" text-align="center" alignment-baseline="central" transform="scale(0.7890928011383548)" x="157.14248035353523">incididunt ut labore etlor</text></g><g class="tl-centered-g" transform="translate(704.00, 32.00) rotate(0.00, 122.81, 18.16)"><rect x="2.1180000000000003" y="2.1180000000000003" width="243.49200000000002" height="34.192" fill="#e2daf8" pointer-events="none"></rect><g pointer-events="none" stroke="#7746f1" stroke-width="4.236000000000001" stroke-linecap="round"><line x1="2.1180000000000003" y1="2.1180000000000003" x2="243.49200000000002" y2="2.1180000000000003" stroke-dasharray="none" stroke-dashoffset="none"></line><line x1="243.49200000000002" y1="2.1180000000000003" x2="243.49200000000002" y2="34.192" stroke-dasharray="none" stroke-dashoffset="none"></line><line x1="243.49200000000002" y1="34.192" x2="2.1180000000000003" y2="34.192" stroke-dasharray="none" stroke-dashoffset="none"></line><line x1="2.1180000000000003" y1="34.192" x2="2.1180000000000003" y2="2.1180000000000003" stroke-dasharray="none" stroke-dashoffset="none"></line></g></g><g text-align="center" text-anchor="middle" fill="#7746f1" transform="translate(704.00, 96.00) rotate(0.00, 72.50, 20.00)"><text y="14" letter-spacing="-0.84" font-size="28px" font-family="Caveat Brush" text-align="center" alignment-baseline="central" transform="scale(1.0735548818438974)" x="67.53264432599546">S T E P 3</text></g><g text-align="center" text-anchor="middle" fill="#1d1d1d" transform="translate(704.00, 160.00) rotate(0.00, 124.00, 49.00)"><text y="14" letter-spacing="-0.84" font-size="28px" font-family="Caveat Brush" text-align="center" alignment-baseline="central" transform="scale(0.7890928011383548)" x="157.14248035353523">Lorem ipsum dolor sit,</text><text y="42" letter-spacing="-0.84" font-size="28px" font-family="Caveat Brush" text-align="center" alignment-baseline="central" transform="scale(0.7890928011383548)" x="157.14248035353523">consectetur adipiscing,</text><text y="70" letter-spacing="-0.84" font-size="28px" font-family="Caveat Brush" text-align="center" alignment-baseline="central" transform="scale(0.7890928011383548)" x="157.14248035353523">sed do eiusmod tempor</text><text y="98" letter-spacing="-0.84" font-size="28px" font-family="Caveat Brush" text-align="center" alignment-baseline="central" transform="scale(0.7890928011383548)" x="157.14248035353523">incididunt ut labore etlor</text></g><g class="tl-centered-g" transform="translate(1056.00, 0.00) rotate(0.00, 122.81, 18.16)"><rect x="2.1180000000000003" y="2.1180000000000003" width="243.49200000000002" height="34.192" fill="#e2daf8" pointer-events="none"></rect><g pointer-events="none" stroke="#7746f1" stroke-width="4.236000000000001" stroke-linecap="round"><line x1="2.1180000000000003" y1="2.1180000000000003" x2="243.49200000000002" y2="2.1180000000000003" stroke-dasharray="none" stroke-dashoffset="none"></line><line x1="243.49200000000002" y1="2.1180000000000003" x2="243.49200000000002" y2="34.192" stroke-dasharray="none" stroke-dashoffset="none"></line><line x1="243.49200000000002" y1="34.192" x2="2.1180000000000003" y2="34.192" stroke-dasharray="none" stroke-dashoffset="none"></line><line x1="2.1180000000000003" y1="34.192" x2="2.1180000000000003" y2="2.1180000000000003" stroke-dasharray="none" stroke-dashoffset="none"></line></g></g><g text-align="center" text-anchor="middle" fill="#7746f1" transform="translate(1056.00, 64.00) rotate(0.00, 73.00, 20.00)"><text y="14" letter-spacing="-0.84" font-size="28px" font-family="Caveat Brush" text-align="center" alignment-baseline="central" transform="scale(1.0735548818438974)" x="67.99838670065749">S T E P 4</text></g><g text-align="center" text-anchor="middle" fill="#1d1d1d" transform="translate(1056.00, 128.00) rotate(0.00, 124.00, 49.00)"><text y="14" letter-spacing="-0.84" font-size="28px" font-family="Caveat Brush" text-align="center" alignment-baseline="central" transform="scale(0.7890928011383548)" x="157.14248035353523">Lorem ipsum dolor sit,</text><text y="42" letter-spacing="-0.84" font-size="28px" font-family="Caveat Brush" text-align="center" alignment-baseline="central" transform="scale(0.7890928011383548)" x="157.14248035353523">consectetur adipiscing,</text><text y="70" letter-spacing="-0.84" font-size="28px" font-family="Caveat Brush" text-align="center" alignment-baseline="central" transform="scale(0.7890928011383548)" x="157.14248035353523">sed do eiusmod tempor</text><text y="98" letter-spacing="-0.84" font-size="28px" font-family="Caveat Brush" text-align="center" alignment-baseline="central" transform="scale(0.7890928011383548)" x="157.14248035353523">incididunt ut labore etlor</text></g></svg>'}}
1,sequence:{type:"drawing",attrs:{horizontalAlign:null,page:{id:"page",name:"Page 1",childIndex:1,shapes:{"09001ea2-ce96-4d72-05af-5e4cefe2b975":{id:"09001ea2-ce96-4d72-05af-5e4cefe2b975",type:"rectangle",name:"Rectangle",parentId:"page",childIndex:1,point:[320,8],size:[352,88],rotation:0,style:{color:"violet",size:"small",isFilled:!0,dash:"solid",scale:1},label:"Step 1",labelPoint:[.5,.5]},"d6511d0b-9e7c-47cb-3989-9433cdd5f125":{id:"d6511d0b-9e7c-47cb-3989-9433cdd5f125",type:"text",name:"Text",parentId:"page",childIndex:1.6666666666666665,point:[358,128],rotation:0,text:"Lorem ipsum dolor sit,\nconsectetur adipiscing,\nsed do eiusmod tempor\nincididunt ut labore etlor",style:{color:"white",size:"small",isFilled:!0,dash:"solid",scale:.8841156470471224,font:"script",textAlign:"middle"}},"0db77405-03ce-4809-2f92-1afa74a6dfbe":{id:"0db77405-03ce-4809-2f92-1afa74a6dfbe",type:"rectangle",name:"Rectangle",parentId:"page",childIndex:1.3333333333333333,point:[704,8],size:[352,88],rotation:0,style:{color:"violet",size:"small",isFilled:!0,dash:"solid",scale:1},label:"Step 2",labelPoint:[.5,.5]},"89c2bb29-dc42-41b9-23be-f21e29a77951":{id:"89c2bb29-dc42-41b9-23be-f21e29a77951",type:"rectangle",name:"Rectangle",parentId:"page",childIndex:1.6666666666666665,point:[1472,8],size:[352,88],rotation:0,style:{color:"violet",size:"small",isFilled:!0,dash:"solid",scale:1},label:"Step 4",labelPoint:[.5,.5]},"61c78694-5ac6-4aff-1853-8fbe63b68f44":{id:"61c78694-5ac6-4aff-1853-8fbe63b68f44",type:"rectangle",name:"Rectangle",parentId:"page",childIndex:1.3333333333333333,point:[1088,8],size:[352,88],rotation:0,style:{color:"violet",size:"small",isFilled:!0,dash:"solid",scale:1},label:"Step 3",labelPoint:[.5,.5]},"80d80fdc-3a9f-411c-3902-135a5d234b77":{id:"80d80fdc-3a9f-411c-3902-135a5d234b77",type:"text",name:"Text",parentId:"page",childIndex:1.6666666666666665,point:[742,128],rotation:0,text:"Lorem ipsum dolor sit,\nconsectetur adipiscing,\nsed do eiusmod tempor\nincididunt ut labore etlor",style:{color:"white",size:"small",isFilled:!0,dash:"solid",scale:.8841156470471224,font:"script",textAlign:"middle"}},"904a74d6-1b65-40e7-2556-6140bcb8fb88":{id:"904a74d6-1b65-40e7-2556-6140bcb8fb88",type:"text",name:"Text",parentId:"page",childIndex:2,point:[1126,128],rotation:0,text:"Lorem ipsum dolor sit,\nconsectetur adipiscing,\nsed do eiusmod tempor\nincididunt ut labore etlor",style:{color:"white",size:"small",isFilled:!0,dash:"solid",scale:.8841156470471224,font:"script",textAlign:"middle"}},"eb8b1bc6-d282-4dd7-25a0-84048e732951":{id:"eb8b1bc6-d282-4dd7-25a0-84048e732951",type:"text",name:"Text",parentId:"page",childIndex:2.3333333333333335,point:[1510,128],rotation:0,text:"Lorem ipsum dolor sit,\nconsectetur adipiscing,\nsed do eiusmod tempor\nincididunt ut labore etlor",style:{color:"white",size:"small",isFilled:!0,dash:"solid",scale:.8841156470471224,font:"script",textAlign:"middle"}}},bindings:{}},assets:{},meta:{width:1504,height:229},width:1504,svg:'<svg viewBox="0 0 1504 229" width="1504" height="229" style="background-color: transparent;"><g text-align="center" text-anchor="middle" transform="translate(0.00, 0.00) rotate(0.00, 176.00, 44.00)"><g class=""><rect x="2.1180000000000003" y="2.1180000000000003" width="349.882" height="85.882" fill="#e2daf8" pointer-events="none"></rect><g pointer-events="none" stroke="#7746f1" stroke-width="4.236000000000001" stroke-linecap="round"><line x1="2.1180000000000003" y1="2.1180000000000003" x2="349.882" y2="2.1180000000000003" stroke-dasharray="none" stroke-dashoffset="none"></line><line x1="349.882" y1="2.1180000000000003" x2="349.882" y2="85.882" stroke-dasharray="none" stroke-dashoffset="none"></line><line x1="349.882" y1="85.882" x2="2.1180000000000003" y2="85.882" stroke-dasharray="none" stroke-dashoffset="none"></line><line x1="2.1180000000000003" y1="85.882" x2="2.1180000000000003" y2="2.1180000000000003" stroke-dasharray="none" stroke-dashoffset="none"></line></g></g><g fill="#7746f1" transform-origin="top left" transform="translate(176, 25)"><text y="14" letter-spacing="-0.84" font-size="28px" font-family="Caveat Brush" text-align="left" alignment-baseline="central">Step 1</text></g></g><g text-align="center" text-anchor="middle" transform="translate(384.00, 0.00) rotate(0.00, 176.00, 44.00)"><g class=""><rect x="2.1180000000000003" y="2.1180000000000003" width="349.882" height="85.882" fill="#e2daf8" pointer-events="none"></rect><g pointer-events="none" stroke="#7746f1" stroke-width="4.236000000000001" stroke-linecap="round"><line x1="2.1180000000000003" y1="2.1180000000000003" x2="349.882" y2="2.1180000000000003" stroke-dasharray="none" stroke-dashoffset="none"></line><line x1="349.882" y1="2.1180000000000003" x2="349.882" y2="85.882" stroke-dasharray="none" stroke-dashoffset="none"></line><line x1="349.882" y1="85.882" x2="2.1180000000000003" y2="85.882" stroke-dasharray="none" stroke-dashoffset="none"></line><line x1="2.1180000000000003" y1="85.882" x2="2.1180000000000003" y2="2.1180000000000003" stroke-dasharray="none" stroke-dashoffset="none"></line></g></g><g fill="#7746f1" transform-origin="top left" transform="translate(176, 25)"><text y="14" letter-spacing="-0.84" font-size="28px" font-family="Caveat Brush" text-align="left" alignment-baseline="central">Step 2</text></g></g><g text-align="center" text-anchor="middle" transform="translate(768.00, 0.00) rotate(0.00, 176.00, 44.00)"><g class="tl-centered-g"><rect x="2.1180000000000003" y="2.1180000000000003" width="349.882" height="85.882" fill="#e2daf8" pointer-events="none"></rect><g pointer-events="none" stroke="#7746f1" stroke-width="4.236000000000001" stroke-linecap="round"><line x1="2.1180000000000003" y1="2.1180000000000003" x2="349.882" y2="2.1180000000000003" stroke-dasharray="none" stroke-dashoffset="none"></line><line x1="349.882" y1="2.1180000000000003" x2="349.882" y2="85.882" stroke-dasharray="none" stroke-dashoffset="none"></line><line x1="349.882" y1="85.882" x2="2.1180000000000003" y2="85.882" stroke-dasharray="none" stroke-dashoffset="none"></line><line x1="2.1180000000000003" y1="85.882" x2="2.1180000000000003" y2="2.1180000000000003" stroke-dasharray="none" stroke-dashoffset="none"></line></g></g><g fill="#7746f1" transform-origin="top left" transform="translate(176, 25)"><text y="14" letter-spacing="-0.84" font-size="28px" font-family="Caveat Brush" text-align="left" alignment-baseline="central">Step 3</text></g></g><g text-align="center" text-anchor="middle" fill="#1d1d1d" transform="translate(38.00, 120.00) rotate(0.00, 138.00, 54.50)"><text y="14" letter-spacing="-0.84" font-size="28px" font-family="Caveat Brush" text-align="center" alignment-baseline="central" transform="scale(0.8841156470471224)" x="156.08817744704473">Lorem ipsum dolor sit,</text><text y="42" letter-spacing="-0.84" font-size="28px" font-family="Caveat Brush" text-align="center" alignment-baseline="central" transform="scale(0.8841156470471224)" x="156.08817744704473">consectetur adipiscing,</text><text y="70" letter-spacing="-0.84" font-size="28px" font-family="Caveat Brush" text-align="center" alignment-baseline="central" transform="scale(0.8841156470471224)" x="156.08817744704473">sed do eiusmod tempor</text><text y="98" letter-spacing="-0.84" font-size="28px" font-family="Caveat Brush" text-align="center" alignment-baseline="central" transform="scale(0.8841156470471224)" x="156.08817744704473">incididunt ut labore etlor</text></g><g text-align="center" text-anchor="middle" transform="translate(1152.00, 0.00) rotate(0.00, 176.00, 44.00)"><g class="tl-centered-g"><rect x="2.1180000000000003" y="2.1180000000000003" width="349.882" height="85.882" fill="#e2daf8" pointer-events="none"></rect><g pointer-events="none" stroke="#7746f1" stroke-width="4.236000000000001" stroke-linecap="round"><line x1="2.1180000000000003" y1="2.1180000000000003" x2="349.882" y2="2.1180000000000003" stroke-dasharray="none" stroke-dashoffset="none"></line><line x1="349.882" y1="2.1180000000000003" x2="349.882" y2="85.882" stroke-dasharray="none" stroke-dashoffset="none"></line><line x1="349.882" y1="85.882" x2="2.1180000000000003" y2="85.882" stroke-dasharray="none" stroke-dashoffset="none"></line><line x1="2.1180000000000003" y1="85.882" x2="2.1180000000000003" y2="2.1180000000000003" stroke-dasharray="none" stroke-dashoffset="none"></line></g></g><g fill="#7746f1" transform-origin="top left" transform="translate(176, 25)"><text y="14" letter-spacing="-0.84" font-size="28px" font-family="Caveat Brush" text-align="left" alignment-baseline="central">Step 4</text></g></g><g text-align="center" text-anchor="middle" fill="#1d1d1d" transform="translate(422.00, 120.00) rotate(0.00, 138.00, 54.50)"><text y="14" letter-spacing="-0.84" font-size="28px" font-family="Caveat Brush" text-align="center" alignment-baseline="central" transform="scale(0.8841156470471224)" x="156.08817744704473">Lorem ipsum dolor sit,</text><text y="42" letter-spacing="-0.84" font-size="28px" font-family="Caveat Brush" text-align="center" alignment-baseline="central" transform="scale(0.8841156470471224)" x="156.08817744704473">consectetur adipiscing,</text><text y="70" letter-spacing="-0.84" font-size="28px" font-family="Caveat Brush" text-align="center" alignment-baseline="central" transform="scale(0.8841156470471224)" x="156.08817744704473">sed do eiusmod tempor</text><text y="98" letter-spacing="-0.84" font-size="28px" font-family="Caveat Brush" text-align="center" alignment-baseline="central" transform="scale(0.8841156470471224)" x="156.08817744704473">incididunt ut labore etlor</text></g><g text-align="center" text-anchor="middle" fill="#1d1d1d" transform="translate(806.00, 120.00) rotate(0.00, 138.00, 54.50)"><text y="14" letter-spacing="-0.84" font-size="28px" font-family="Caveat Brush" text-align="center" alignment-baseline="central" transform="scale(0.8841156470471224)" x="156.08817744704473">Lorem ipsum dolor sit,</text><text y="42" letter-spacing="-0.84" font-size="28px" font-family="Caveat Brush" text-align="center" alignment-baseline="central" transform="scale(0.8841156470471224)" x="156.08817744704473">consectetur adipiscing,</text><text y="70" letter-spacing="-0.84" font-size="28px" font-family="Caveat Brush" text-align="center" alignment-baseline="central" transform="scale(0.8841156470471224)" x="156.08817744704473">sed do eiusmod tempor</text><text y="98" letter-spacing="-0.84" font-size="28px" font-family="Caveat Brush" text-align="center" alignment-baseline="central" transform="scale(0.8841156470471224)" x="156.08817744704473">incididunt ut labore etlor</text></g><g text-align="center" text-anchor="middle" fill="#1d1d1d" transform="translate(1190.00, 120.00) rotate(0.00, 138.00, 54.50)"><text y="14" letter-spacing="-0.84" font-size="28px" font-family="Caveat Brush" text-align="center" alignment-baseline="central" transform="scale(0.8841156470471224)" x="156.08817744704473">Lorem ipsum dolor sit,</text><text y="42" letter-spacing="-0.84" font-size="28px" font-family="Caveat Brush" text-align="center" alignment-baseline="central" transform="scale(0.8841156470471224)" x="156.08817744704473">consectetur adipiscing,</text><text y="70" letter-spacing="-0.84" font-size="28px" font-family="Caveat Brush" text-align="center" alignment-baseline="central" transform="scale(0.8841156470471224)" x="156.08817744704473">sed do eiusmod tempor</text><text y="98" letter-spacing="-0.84" font-size="28px" font-family="Caveat Brush" text-align="center" alignment-baseline="central" transform="scale(0.8841156470471224)" x="156.08817744704473">incididunt ut labore etlor</text></g></svg>'}}
1,flywheel:{type:"drawing",attrs:{horizontalAlign:null,page:{id:"page",name:"Page 1",childIndex:1,shapes:{"5b3035a3-027b-4f91-3a78-511b4ab1437a":{id:"5b3035a3-027b-4f91-3a78-511b4ab1437a",type:"arrow",name:"Arrow",parentId:"page",childIndex:2,point:[607.42,127.33],rotation:0,bend:.38579003941729895,handles:{start:{id:"start",index:0,point:[-14.48,-2.33],canBind:!0},end:{id:"end",index:1,point:[160.31,200.34],canBind:!0},bend:{id:"bend",index:2,point:[112.01,65.29]}},decorations:{end:"arrow"},style:{color:"white",size:"small",isFilled:!0,dash:"solid",scale:1},label:"",labelPoint:[.5,.5]},"55c7268a-8e7b-4283-1b8e-d7adb49b60e6":{id:"55c7268a-8e7b-4283-1b8e-d7adb49b60e6",type:"arrow",name:"Arrow",parentId:"page",childIndex:3,point:[605.04,384.78],rotation:0,bend:.3095854342501735,handles:{start:{id:"start",index:0,point:[162.88,-13.11],canBind:!0},end:{id:"end",index:1,point:[-13.04,167.22],canBind:!0},bend:{id:"bend",index:2,point:[102.83,104.29]}},decorations:{end:"arrow"},style:{color:"white",size:"small",isFilled:!0,dash:"solid",scale:1},label:"",labelPoint:[.5,.5]},"3cfcd160-f69e-4631-1fe5-a7651145ce0d":{id:"3cfcd160-f69e-4631-1fe5-a7651145ce0d",type:"arrow",name:"Arrow",parentId:"page",childIndex:4,point:[336,384],rotation:0,bend:.3096244996346072,handles:{start:{id:"start",index:0,point:[167.17,167.02],canBind:!0},end:{id:"end",index:1,point:[-2.42,-12.91],canBind:!0},bend:{id:"bend",index:2,point:[54.52,103.31]}},decorations:{end:"arrow"},style:{color:"white",size:"small",isFilled:!0,dash:"solid",scale:1},label:"",labelPoint:[.5,.5]},"3a336e31-7d15-472e-1069-0088b69aa6bb":{id:"3a336e31-7d15-472e-1069-0088b69aa6bb",type:"arrow",name:"Arrow",parentId:"page",childIndex:5,point:[328,128],rotation:0,bend:.3361081327617002,handles:{start:{id:"start",index:0,point:[-1.29,204.46],canBind:!0},end:{id:"end",index:1,point:[175.4,-3.64],canBind:!0},bend:{id:"bend",index:2,point:[52.08,70.72]}},decorations:{end:"arrow"},style:{color:"white",size:"small",isFilled:!0,dash:"solid",scale:1},label:"",labelPoint:[.5,.5]},"d6fc4f6d-b407-41d4-0b15-1741656a6c33":{id:"d6fc4f6d-b407-41d4-0b15-1741656a6c33",type:"text",name:"Text",parentId:"page",childIndex:6,point:[520,104],rotation:0,text:"One",style:{color:"white",size:"small",isFilled:!0,dash:"solid",scale:.8260586360543353,font:"script",textAlign:"middle"}},"b12531f9-c8fa-477b-2d25-870193af6ff1":{id:"b12531f9-c8fa-477b-2d25-870193af6ff1",type:"text",name:"Text",parentId:"page",childIndex:7,point:[752,336],rotation:0,text:"Two",style:{color:"white",size:"small",isFilled:!0,dash:"solid",scale:.8260586360543353,font:"script",textAlign:"middle"}},"a3df395b-79b9-4d53-1f84-63cfc1ec1bc8":{id:"a3df395b-79b9-4d53-1f84-63cfc1ec1bc8",type:"text",name:"Text",parentId:"page",childIndex:8,point:[512,536],rotation:0,text:"Three",style:{color:"white",size:"small",isFilled:!0,dash:"solid",scale:.8260586360543353,font:"script",textAlign:"middle"}},"27670358-2271-4bd5-2c64-598eb9eb4dc6":{id:"27670358-2271-4bd5-2c64-598eb9eb4dc6",type:"text",name:"Text",parentId:"page",childIndex:9,point:[294.5,336],rotation:0,text:"Four",style:{color:"white",size:"small",isFilled:!0,dash:"solid",scale:.8260586360543353,font:"script",textAlign:"middle"}}},bindings:{}},assets:{},meta:{width:510.5,height:465},width:510.5,svg:'<svg viewBox="0 0 510.5 465" width="510.5" height="465" style="background-color: transparent;"><g class="" transform="translate(312.92, 23.33) rotate(0.00, 80.07, 92.84)"><defs><mask><rect x="-100" y="-100" width="360.1300564607744" height="385.67171201387475" fill="white"></rect><rect x="112.00502823038723" y="65.28585600693738" width="0" height="0" rx="4" ry="4" fill="black" opacity="1"></rect></mask></defs><g pointer-events="none" opacity="1" mask=""><path d="M -14.48 -2.33 A 199.24326528571817 199.24326528571817 0 0 1 160.31 200.34" fill="none" stroke="#1d1d1d" stroke-width="4.236000000000001" stroke-dasharray="none" stroke-dashoffset="none" stroke-linecap="round" stroke-linejoin="round" pointer-events="none"></path><g><path d="M 168.30871236075654,186.48285020035215 L 160.31,200.34 152.3087124298368,186.4843369981963" fill="none" stroke="#1d1d1d" stroke-width="4.236000000000001" stroke-linecap="round" stroke-linejoin="round" pointer-events="none"></path></g></g></g><g class="" transform="translate(310.54, 280.78) rotate(0.00, 80.09, 82.10)"><defs><mask><rect x="-100" y="-100" width="360.18709717016566" height="364.2027014136878" fill="white"></rect><rect x="102.83354858508284" y="104.29135070684393" width="0" height="0" rx="4" ry="4" fill="black" opacity="1"></rect></mask></defs><g pointer-events="none" opacity="1" mask=""><path d="M 162.88 -13.11 A 222.9364239272154 222.9364239272154 0 0 1 -13.04 167.22" fill="none" stroke="#1d1d1d" stroke-width="4.236000000000001" stroke-dasharray="none" stroke-dashoffset="none" stroke-linecap="round" stroke-linejoin="round" pointer-events="none"></path><g><path d="M 2.225876144821453,172.01093159322602 L -13.04,167.22 -1.2579934600620746,156.39482924417078" fill="none" stroke="#1d1d1d" stroke-width="4.236000000000001" stroke-linecap="round" stroke-linejoin="round" pointer-events="none"></path></g></g></g><g class="tl-centered-g" transform="translate(41.50, 280.00) rotate(0.00, 77.21, 81.92)"><defs><mask><rect x="-100" y="-100" width="354.42364046520083" height="363.83893878709597" fill="white"></rect><rect x="54.521820232600426" y="103.30946939354799" width="0" height="0" rx="4" ry="4" fill="black" opacity="1"></rect></mask></defs><g pointer-events="none" opacity="1" mask=""><path d="M 167.17 167.02 A 218.78103103315786 218.78103103315786 0 0 1 -2.42 -12.91" fill="none" stroke="#1d1d1d" stroke-width="4.236000000000001" stroke-dasharray="none" stroke-dashoffset="none" stroke-linecap="round" stroke-linejoin="round" pointer-events="none"></path><g><path d="M -7.841710609421167,2.1434067263091645 L -2.42,-12.91 7.905777333772692,-0.6879575171190755" fill="none" stroke="#1d1d1d" stroke-width="4.236000000000001" stroke-linecap="round" stroke-linejoin="round" pointer-events="none"></path></g></g></g><g class="tl-centered-g" transform="translate(33.50, 24.00) rotate(0.00, 80.60, 94.93)"><defs><mask><rect x="-100" y="-100" width="361.20939101407447" height="389.86741903915834" fill="white"></rect><rect x="52.08469550703724" y="70.72370951957916" width="0" height="0" rx="4" ry="4" fill="black" opacity="1"></rect></mask></defs><g pointer-events="none" opacity="1" mask=""><path d="M -1.29 204.46 A 225.99291426488986 225.99291426488986 0 0 1 175.4 -3.64" fill="none" stroke="#1d1d1d" stroke-width="4.236000000000001" stroke-dasharray="none" stroke-dashoffset="none" stroke-linecap="round" stroke-linejoin="round" pointer-events="none"></path><g><path d="M 160.03808035667558,-8.113413112159797 L 175.4,-3.64 163.844950781585,7.427106105934227" fill="none" stroke="#1d1d1d" stroke-width="4.236000000000001" stroke-linecap="round" stroke-linejoin="round" pointer-events="none"></path></g></g></g><g text-align="center" text-anchor="middle" fill="#1d1d1d" transform="translate(225.50, 0.00) rotate(0.00, 26.50, 16.50)"><text y="14" letter-spacing="-0.84" font-size="28px" font-family="Caveat Brush" text-align="center" alignment-baseline="central" transform="scale(0.8260586360543353)" x="32.080047158125616">One</text></g><g text-align="center" text-anchor="middle" fill="#1d1d1d" transform="translate(457.50, 232.00) rotate(0.00, 26.50, 16.50)"><text y="14" letter-spacing="-0.84" font-size="28px" font-family="Caveat Brush" text-align="center" alignment-baseline="central" transform="scale(0.8260586360543353)" x="32.080047158125616">Two</text></g><g text-align="center" text-anchor="middle" fill="#1d1d1d" transform="translate(217.50, 432.00) rotate(0.00, 35.00, 16.50)"><text y="14" letter-spacing="-0.84" font-size="28px" font-family="Caveat Brush" text-align="center" alignment-baseline="central" transform="scale(0.8260586360543353)" x="42.36987360507157">Three</text></g><g text-align="center" text-anchor="middle" fill="#1d1d1d" transform="translate(0.00, 232.00) rotate(0.00, 28.00, 16.50)"><text y="14" letter-spacing="-0.84" font-size="28px" font-family="Caveat Brush" text-align="center" alignment-baseline="central" transform="scale(0.8260586360543353)" x="33.89589888405725">Four</text></g></svg>'}}
1,quadrant:{type:"drawing",attrs:{horizontalAlign:null,page:{id:"page",name:"Page 1",childIndex:1,shapes:{"d4981fab-f010-41b4-3918-0b4c10baea01":{id:"d4981fab-f010-41b4-3918-0b4c10baea01",type:"arrow",name:"Arrow",parentId:"page",childIndex:1,point:[608,160],rotation:0,bend:0,handles:{start:{id:"start",index:0,point:[0,320],canBind:!0},end:{id:"end",index:1,point:[0,0],canBind:!0},bend:{id:"bend",index:2,point:[0,160]}},decorations:{end:"arrow",start:"arrow"},style:{color:"white",size:"small",isFilled:!0,dash:"solid",scale:1},label:"",labelPoint:[.5,.5]},"17eb22ab-7b7d-4ce1-0570-abe7c680dec3":{id:"17eb22ab-7b7d-4ce1-0570-abe7c680dec3",type:"arrow",name:"Arrow",parentId:"page",childIndex:2,point:[424,320],rotation:0,bend:0,handles:{start:{id:"start",index:0,point:[0,0],canBind:!0},end:{id:"end",index:1,point:[368,0],canBind:!0},bend:{id:"bend",index:2,point:[184,0]}},decorations:{end:"arrow",start:"arrow"},style:{color:"white",size:"small",isFilled:!0,dash:"solid",scale:1},label:"",labelPoint:[.5,.5]},"bad53771-dcfa-4761-2446-aeecdfc7fd36":{id:"bad53771-dcfa-4761-2446-aeecdfc7fd36",type:"text",name:"Text",parentId:"page",childIndex:3,point:[576,112],rotation:0,text:"$$$",style:{color:"white",size:"small",isFilled:!0,dash:"solid",scale:1,font:"script",textAlign:"middle"}},"79f58b13-46e9-4dbb-1ade-02c007416434":{id:"79f58b13-46e9-4dbb-1ade-02c007416434",type:"text",name:"Text",parentId:"page",childIndex:4,point:[593,488],rotation:0,text:"$",style:{color:"white",size:"small",isFilled:!0,dash:"solid",scale:1,font:"script",textAlign:"middle"}},"e07ad3d9-9a1d-4757-1d2c-a906841f014c":{id:"e07ad3d9-9a1d-4757-1d2c-a906841f014c",type:"text",name:"Text",parentId:"page",childIndex:5,point:[795.5,304],rotation:0,text:"Hard",style:{color:"white",size:"small",isFilled:!0,dash:"solid",scale:1,font:"script",textAlign:"middle"}},"28948bec-db32-4e7b-308f-9f3227021aa3":{id:"28948bec-db32-4e7b-308f-9f3227021aa3",type:"text",name:"Text",parentId:"page",childIndex:6,point:[344,304],rotation:0,text:"Easy",style:{color:"white",size:"small",isFilled:!0,dash:"solid",scale:1,font:"script",textAlign:"middle"}}},bindings:{}},assets:{},meta:{width:521.5,height:414},width:521.5,svg:'<svg viewBox="0 0 521.5 414" width="521.5" height="414" style="background-color: transparent;"><g class="" transform="translate(264.00, 48.00) rotate(0.00, 0.50, 160.00)"><defs><mask><rect x="-100" y="-100" width="201" height="520" fill="white"></rect><rect x="0" y="160" width="0" height="0" rx="4" ry="4" fill="black" opacity="1"></rect></mask></defs><g pointer-events="none" opacity="1" mask=""><path d="M0,320L0,0" fill="#1d1d1d" stroke="#1d1d1d" stroke-width="4.236000000000001" stroke-dasharray="none" stroke-dashoffset="none" stroke-linecap="round" stroke-linejoin="round" pointer-events="stroke"></path><g><path d="M 7.999999999999999,306.143593539449 L 0,320 -7.999999999999999,306.143593539449" fill="none" stroke="#1d1d1d" stroke-width="4.236000000000001" stroke-linecap="round" stroke-linejoin="round" pointer-events="none"></path></g><g><path d="M -7.999999999999999,13.85640646055102 L 0,0 7.999999999999999,13.85640646055102" fill="none" stroke="#1d1d1d" stroke-width="4.236000000000001" stroke-linecap="round" stroke-linejoin="round" pointer-events="none"></path></g></g></g><g class="" transform="translate(80.00, 208.00) rotate(0.00, 184.00, 0.50)"><defs><mask><rect x="-100" y="-100" width="568" height="201" fill="white"></rect><rect x="184" y="0" width="0" height="0" rx="4" ry="4" fill="black" opacity="1"></rect></mask></defs><g pointer-events="none" opacity="1" mask=""><path d="M0,0L368,0" fill="#1d1d1d" stroke="#1d1d1d" stroke-width="4.236000000000001" stroke-dasharray="none" stroke-dashoffset="none" stroke-linecap="round" stroke-linejoin="round" pointer-events="stroke"></path><g><path d="M 13.85640646055102,7.999999999999999 L 0,0 13.85640646055102,-7.999999999999999" fill="none" stroke="#1d1d1d" stroke-width="4.236000000000001" stroke-linecap="round" stroke-linejoin="round" pointer-events="none"></path></g><g><path d="M 354.143593539449,-7.999999999999999 L 368,0 354.143593539449,7.999999999999999" fill="none" stroke="#1d1d1d" stroke-width="4.236000000000001" stroke-linecap="round" stroke-linejoin="round" pointer-events="none"></path></g></g></g><g text-align="center" text-anchor="middle" fill="#1d1d1d" transform="translate(232.00, 0.00) rotate(0.00, 30.50, 19.00)"><text y="14" letter-spacing="-0.84" font-size="28px" font-family="Caveat Brush" text-align="center" alignment-baseline="central" x="30.5">$$$</text></g><g text-align="center" text-anchor="middle" fill="#1d1d1d" transform="translate(249.00, 376.00) rotate(0.00, 13.50, 19.00)"><text y="14" letter-spacing="-0.84" font-size="28px" font-family="Caveat Brush" text-align="center" alignment-baseline="central" x="13.5">$</text></g><g text-align="center" text-anchor="middle" fill="#1d1d1d" transform="translate(451.50, 192.00) rotate(0.00, 35.00, 19.00)"><text y="14" letter-spacing="-0.84" font-size="28px" font-family="Caveat Brush" text-align="center" alignment-baseline="central" x="35">Hard</text></g><g text-align="center" text-anchor="middle" fill="#1d1d1d" transform="translate(0.00, 192.00) rotate(0.00, 34.50, 19.00)"><text y="14" letter-spacing="-0.84" font-size="28px" font-family="Caveat Brush" text-align="center" alignment-baseline="central" x="34.5">Easy</text></g></svg>'}}
1,venn:{type:"drawing",attrs:{horizontalAlign:null,page:{id:"page",name:"Page 1",childIndex:1,shapes:{"05b9987d-ea31-4664-2bf7-8cdff61c1c52":{id:"05b9987d-ea31-4664-2bf7-8cdff61c1c52",type:"text",name:"Text",parentId:"page",childIndex:9,point:[816,368],rotation:0,text:"Good",style:{color:"blue",size:"small",isFilled:!0,dash:"solid",scale:1.432720080681665,font:"script",textAlign:"middle"}},"84ec762b-f98e-4e75-1c5d-e656b272b97e":{id:"84ec762b-f98e-4e75-1c5d-e656b272b97e",type:"text",name:"Text",parentId:"page",childIndex:9.25,point:[624,688],rotation:0,text:"Fast",style:{color:"red",size:"small",isFilled:!0,dash:"solid",scale:1.432720080681665,font:"script",textAlign:"middle"}},"9f932b53-a194-4803-16c0-9b3bcb1ea26e":{id:"9f932b53-a194-4803-16c0-9b3bcb1ea26e",type:"text",name:"Text",parentId:"page",childIndex:9.5,point:[984,696],rotation:0,text:"Cheap",style:{color:"violet",size:"small",isFilled:!0,dash:"solid",scale:1.432720080681665,font:"script",textAlign:"middle"}},"b4fb4c43-a940-4abb-0425-30ca0e2ef3df":{id:"b4fb4c43-a940-4abb-0425-30ca0e2ef3df",type:"text",name:"Text",parentId:"page",childIndex:9.75,point:[824,712],rotation:0,text:"Low\nQuality",style:{color:"gray",size:"small",isFilled:!0,dash:"solid",scale:.7125938829717526,font:"script",textAlign:"middle"}},"1998e34a-0f81-41e6-1345-51c4aaa3fa4f":{id:"1998e34a-0f81-41e6-1345-51c4aaa3fa4f",type:"ellipse",name:"Ellipse",parentId:"page",childIndex:.125,point:[528,472],radius:[199.94000000000005,199.94000000000005],rotation:0,style:{color:"red",size:"small",isFilled:!1,dash:"solid",scale:1},label:"",labelPoint:[.5,.5]},"ead057fa-ce8c-4406-2ec0-d746ed921ee4":{id:"ead057fa-ce8c-4406-2ec0-d746ed921ee4",type:"ellipse",name:"Ellipse",parentId:"page",childIndex:.25,point:[792,472],radius:[199.94000000000005,199.94000000000005],rotation:0,style:{color:"violet",size:"small",isFilled:!1,dash:"solid",scale:1},label:"",labelPoint:[.5,.5]},"33fb46c5-b489-46f8-36a7-5d1ca38f78d1":{id:"33fb46c5-b489-46f8-36a7-5d1ca38f78d1",type:"ellipse",name:"Ellipse",parentId:"page",childIndex:.375,point:[664,288],radius:[199.94000000000005,199.94000000000005],rotation:0,style:{color:"blue",size:"small",isFilled:!1,dash:"solid",scale:1},label:"",labelPoint:[.5,.5]},"9ebe9241-a315-4435-28cb-aa226ff83005":{id:"9ebe9241-a315-4435-28cb-aa226ff83005",type:"text",name:"Text",parentId:"page",childIndex:10.75,point:[921.5,536],rotation:0,text:"Take Time",style:{color:"gray",size:"small",isFilled:!0,dash:"solid",scale:.7125938829717526,font:"script",textAlign:"middle"}},"c3c12744-fa0e-41f3-0a76-393cb9fbff1e":{id:"c3c12744-fa0e-41f3-0a76-393cb9fbff1e",type:"text",name:"Text",parentId:"page",childIndex:11.75,point:[712.5,536],rotation:0,text:"Expensive",style:{color:"gray",size:"small",isFilled:!0,dash:"solid",scale:.7125938829717526,font:"script",textAlign:"middle"}},"ff77e033-6f2f-4856-14f4-38f2d2e6c135":{id:"ff77e033-6f2f-4856-14f4-38f2d2e6c135",type:"text",name:"Text",parentId:"page",childIndex:11.75,point:[851,616],rotation:0,text:" ",style:{color:"gray",size:"small",isFilled:!0,dash:"solid",scale:.7125938829717526,font:"script",textAlign:"middle"}}},bindings:{}},assets:{},meta:{width:663.8800000000001,height:583.8800000000001},width:663.8800000000001,svg:'<svg viewBox="0 0 663.8800000000001 583.8800000000001" width="663.8800000000001" height="583.8800000000001" style="background-color: transparent;"><g class="" transform="translate(0.00, 184.00) rotate(0.00, 199.94, 199.94)"><ellipse cx="199.94000000000005" cy="199.94000000000005" rx="197.82200000000006" ry="197.82200000000006" fill="none" stroke="#7746f1" stroke-width="4.236000000000001" stroke-dasharray="none" stroke-dashoffset="none" pointer-events="none" stroke-linecap="round" stroke-linejoin="round"></ellipse></g><g class="" transform="translate(264.00, 184.00) rotate(0.00, 199.94, 199.94)"><ellipse cx="199.94000000000005" cy="199.94000000000005" rx="197.82200000000006" ry="197.82200000000006" fill="none" stroke="#7746f1" stroke-width="4.236000000000001" stroke-dasharray="none" stroke-dashoffset="none" pointer-events="none" stroke-linecap="round" stroke-linejoin="round"></ellipse></g><g class="tl-centered-g" transform="translate(136.00, 0.00) rotate(0.00, 199.94, 199.94)"><ellipse cx="199.94000000000005" cy="199.94000000000005" rx="197.82200000000006" ry="197.82200000000006" fill="none" stroke="#7746f1" stroke-width="4.236000000000001" stroke-dasharray="none" stroke-dashoffset="none" pointer-events="none" stroke-linecap="round" stroke-linejoin="round"></ellipse></g><g text-align="center" text-anchor="middle" fill="#1c7ed6" transform="translate(288.00, 80.00) rotate(0.00, 54.00, 25.00)"><text y="14" letter-spacing="-0.84" font-size="28px" font-family="Caveat Brush" text-align="center" alignment-baseline="central" transform="scale(1.432720080681665)" x="37.690544530029676">Good</text></g><g text-align="center" text-anchor="middle" fill="#ff2133" transform="translate(96.00, 400.00) rotate(0.00, 43.50, 25.00)"><text y="14" letter-spacing="-0.84" font-size="28px" font-family="Caveat Brush" text-align="center" alignment-baseline="central" transform="scale(1.432720080681665)" x="30.36182753807946">Fast</text></g><g text-align="center" text-anchor="middle" fill="#7746f1" transform="translate(456.00, 408.00) rotate(0.00, 63.50, 25.00)"><text y="14" letter-spacing="-0.84" font-size="28px" font-family="Caveat Brush" text-align="center" alignment-baseline="central" transform="scale(1.432720080681665)" x="44.32128847512749">Cheap</text></g><g text-align="center" text-anchor="middle" fill="#788492" transform="translate(296.00, 424.00) rotate(0.00, 36.00, 25.00)"><text y="14" letter-spacing="-0.84" font-size="28px" font-family="Caveat Brush" text-align="center" alignment-baseline="central" transform="scale(0.7125938829717526)" x="50.51965903758263">Low</text><text y="42" letter-spacing="-0.84" font-size="28px" font-family="Caveat Brush" text-align="center" alignment-baseline="central" transform="scale(0.7125938829717526)" x="50.51965903758263">Quality</text></g><g text-align="center" text-anchor="middle" fill="#788492" transform="translate(393.50, 248.00) rotate(0.00, 50.50, 15.00)"><text y="14" letter-spacing="-0.84" font-size="28px" font-family="Caveat Brush" text-align="center" alignment-baseline="central" transform="scale(0.7125938829717526)" x="70.86785503883118">Take Time</text></g><g text-align="center" text-anchor="middle" fill="#788492" transform="translate(184.50, 248.00) rotate(0.00, 50.00, 15.00)"><text y="14" letter-spacing="-0.84" font-size="28px" font-family="Caveat Brush" text-align="center" alignment-baseline="central" transform="scale(0.7125938829717526)" x="70.16619310775364">Expensive</text></g><g text-align="center" text-anchor="middle" fill="#788492" transform="translate(323.00, 328.00) rotate(0.00, 7.50, 15.00)"><text y="14" letter-spacing="-0.84" font-size="28px" font-family="Caveat Brush" text-align="center" alignment-baseline="central" transform="scale(0.7125938829717526)" x="10.524928966163047"> </text></g></svg>'}}
1,pyramid:{type:"drawing",attrs:{horizontalAlign:null,page:{id:"page",name:"Page 1",childIndex:1,shapes:{"0886084d-8916-4544-188e-1b8a5f9d43db":{id:"0886084d-8916-4544-188e-1b8a5f9d43db",type:"triangle",name:"Triangle",parentId:"page",childIndex:1,point:[496.00000000000006,184],size:[1013.15,800.74],rotation:0,style:{color:"white",size:"small",isFilled:!0,dash:"solid",scale:1},label:"",labelPoint:[.5,.5]},"d22e1b19-cdf0-4e9b-3bf5-a03a15862c9f":{id:"d22e1b19-cdf0-4e9b-3bf5-a03a15862c9f",type:"arrow",name:"Arrow",parentId:"page",childIndex:3,point:[222.58,456],rotation:0,bend:0,handles:{start:{id:"start",index:0,point:[952,0],canBind:!0},end:{id:"end",index:1,point:[0,0],canBind:!0,bindingId:"bf28142e-325a-49b3-2b50-44f6c25460b2"},bend:{id:"bend",index:2,point:[476,0]}},decorations:{},style:{color:"violet",size:"small",isFilled:!0,dash:"solid",scale:1},label:"",labelPoint:[.5,.5]},"69d5b18d-926e-436b-0ec5-217293e2b2ef":{id:"69d5b18d-926e-436b-0ec5-217293e2b2ef",type:"arrow",name:"Arrow",parentId:"page",childIndex:4,point:[218.58,589],rotation:0,bend:0,handles:{start:{id:"start",index:0,point:[1040,0],canBind:!0},end:{id:"end",index:1,point:[0,0],canBind:!0},bend:{id:"bend",index:2,point:[520,0]}},decorations:{},style:{color:"blue",size:"small",isFilled:!0,dash:"solid",scale:1},label:"",labelPoint:[.5,.5]},"c21444f2-93d1-40d7-2a6a-f71d841e29a7":{id:"c21444f2-93d1-40d7-2a6a-f71d841e29a7",type:"arrow",name:"Arrow",parentId:"page",childIndex:5,point:[224,722],rotation:0,bend:0,handles:{start:{id:"start",index:0,point:[1120,0],canBind:!0},end:{id:"end",index:1,point:[0,0],canBind:!0},bend:{id:"bend",index:2,point:[560,0]}},decorations:{},style:{color:"violet",size:"small",isFilled:!0,dash:"solid",scale:1},label:"",labelPoint:[.5,.5]},"b75e5507-249c-4a34-0df3-282340c3f21b":{id:"b75e5507-249c-4a34-0df3-282340c3f21b",type:"arrow",name:"Arrow",parentId:"page",childIndex:6,point:[216,855],rotation:0,bend:0,handles:{start:{id:"start",index:0,point:[1208,0],canBind:!0},end:{id:"end",index:1,point:[0,0],canBind:!0},bend:{id:"bend",index:2,point:[604,0]}},decorations:{},style:{color:"blue",size:"small",isFilled:!0,dash:"solid",scale:1},label:"",labelPoint:[.5,.5]},"8f9b0d72-fdef-4ec0-1080-7e144d3d2eb3":{id:"8f9b0d72-fdef-4ec0-1080-7e144d3d2eb3",type:"text",name:"Text",parentId:"page",childIndex:7,point:[211,392],rotation:0,text:"Self-actualization",style:{color:"violet",size:"small",isFilled:!0,dash:"solid",scale:1.6942371033092245,font:"script",textAlign:"middle"}},"22a8bb2a-d70b-46b4-19cb-b2544acc01b6":{id:"22a8bb2a-d70b-46b4-19cb-b2544acc01b6",type:"text",name:"Text",parentId:"page",childIndex:8,point:[211,520],rotation:0,text:"Esteem",style:{color:"blue",size:"small",isFilled:!0,dash:"solid",scale:1.6942371033092245,font:"script",textAlign:"middle"}},"115f9e96-a566-46aa-042e-8378c7bb92dd":{id:"115f9e96-a566-46aa-042e-8378c7bb92dd",type:"text",name:"Text",parentId:"page",childIndex:9,point:[211,648],rotation:0,text:"Love/Belonging",style:{color:"violet",size:"small",isFilled:!0,dash:"solid",scale:1.6942371033092245,font:"script",textAlign:"middle"}},"a398402f-af3d-4743-3dc9-386370b2620d":{id:"a398402f-af3d-4743-3dc9-386370b2620d",type:"text",name:"Text",parentId:"page",childIndex:10,point:[211,784],rotation:0,text:"Safety",style:{color:"blue",size:"small",isFilled:!0,dash:"solid",scale:1.6942371033092245,font:"script",textAlign:"middle"}},"e20bae77-d2f8-404e-3292-f0d78e6f5d2e":{id:"e20bae77-d2f8-404e-3292-f0d78e6f5d2e",type:"text",name:"Text",parentId:"page",childIndex:11,point:[211,904],rotation:0,text:"Physiological",style:{color:"violet",size:"small",isFilled:!0,dash:"solid",scale:1.6942371033092245,font:"script",textAlign:"middle"}},"18430d21-d0d1-4605-04d9-21dcd0f3c6a3":{id:"18430d21-d0d1-4605-04d9-21dcd0f3c6a3",type:"arrow",name:"Arrow",parentId:"page",childIndex:7,point:[216,983.93],rotation:0,bend:0,handles:{start:{id:"start",index:0,point:[280.51,0],canBind:!0,bindingId:"0c2729e8-0d53-4dee-1c12-9ee7369d1395"},end:{id:"end",index:1,point:[0,.04],canBind:!0},bend:{id:"bend",index:2,point:[140.26,.02]}},decorations:{},style:{color:"violet",size:"small",isFilled:!0,dash:"solid",scale:1},label:"",labelPoint:[.5,.5]},"4f4681b8-2cb0-42db-386c-866cbc24a311":{id:"4f4681b8-2cb0-42db-386c-866cbc24a311",type:"text",name:"Text",parentId:"page",childIndex:7,point:[935.58,330.62],rotation:0,text:"morality,\ncreativity",style:{color:"gray",size:"small",isFilled:!0,dash:"solid",scale:1.087495623855612,font:"script",textAlign:"middle"}},"90751c3c-1f94-4fa4-2823-84485d39700b":{id:"90751c3c-1f94-4fa4-2823-84485d39700b",type:"text",name:"Text",parentId:"page",childIndex:8,point:[826.08,475.5],rotation:0,text:"self-esteem, confidence, \nachievement, respect ",style:{color:"gray",size:"small",isFilled:!0,dash:"solid",scale:1.087495623855612,font:"script",textAlign:"middle"}},"2a1f7b3d-5d42-42ba-250a-65a294f0a741":{id:"2a1f7b3d-5d42-42ba-250a-65a294f0a741",type:"text",name:"Text",parentId:"page",childIndex:9,point:[876.38,634],rotation:0,text:"friendship, family",style:{color:"gray",size:"small",isFilled:!0,dash:"solid",scale:1.087495623855612,font:"script",textAlign:"middle"}},"2e43b13a-6795-4270-1d7e-1f07d08bb10e":{id:"2e43b13a-6795-4270-1d7e-1f07d08bb10e",type:"text",name:"Text",parentId:"page",childIndex:10,point:[683.58,747.81],rotation:0,text:"security of body, of employment, of resources,\nof morality, of the family, of health, of property",style:{color:"gray",size:"small",isFilled:!0,dash:"solid",scale:1.087495623855612,font:"script",textAlign:"middle"}},"057384d4-c107-4b13-2340-a932f1ef546d":{id:"057384d4-c107-4b13-2340-a932f1ef546d",type:"text",name:"Text",parentId:"page",childIndex:11,point:[711.58,895.13],rotation:0,text:"breathing, food, water, sleep, homeostasis",style:{color:"gray",size:"small",isFilled:!0,dash:"solid",scale:1.087495623855612,font:"script",textAlign:"middle"}}},bindings:{"0c2729e8-0d53-4dee-1c12-9ee7369d1395":{id:"0c2729e8-0d53-4dee-1c12-9ee7369d1395",type:"arrow",fromId:"18430d21-d0d1-4605-04d9-21dcd0f3c6a3",toId:"0886084d-8916-4544-188e-1b8a5f9d43db",handleId:"start",point:[.98,.98],distance:16}
1,"bf28142e-325a-49b3-2b50-44f6c25460b2":{id:"bf28142e-325a-49b3-2b50-44f6c25460b2",type:"arrow",fromId:"d22e1b19-cdf0-4e9b-3bf5-a03a15862c9f",toId:"8f9b0d72-fdef-4ec0-1080-7e144d3d2eb3",handleId:"end",point:[.03,.99],distance:8}}},assets:{},meta:{width:1298.15,height:800.74},width:2162,svg:'<svg viewBox="0 0 1300.15 802.74" width="1300.15" height="802.74" style="background-color: transparent;"><defs><style>@import url(\'https://fonts.googleapis.com/css2?family=Caveat+Brush&family=Source+Code+Pro&family=Source+Sans+Pro&family=Crimson+Pro&display=block\');</style></defs><g transform="translate(286.00, 1.00) rotate(0.00, 506.57, 400.37)"><g class="" data-color="white" data-fill="true"><polygon fill="#fefefe" points="506.575,0,1013.15,800.74,0,800.74" pointer-events="none"></polygon><g pointer-events="stroke"><line x1="506.575" y1="0" x2="1013.15" y2="800.74" stroke="#1d1d1d" stroke-width="4.236000000000001" stroke-linecap="round" stroke-dasharray="none" stroke-dashoffset="none"></line><line x1="1013.15" y1="800.74" x2="0" y2="800.74" stroke="#1d1d1d" stroke-width="4.236000000000001" stroke-linecap="round" stroke-dasharray="none" stroke-dashoffset="none"></line><line x1="0" y1="800.74" x2="506.575" y2="0" stroke="#1d1d1d" stroke-width="4.236000000000001" stroke-linecap="round" stroke-dasharray="none" stroke-dashoffset="none"></line></g></g><text font-size="28px" font-family="Caveat Brush" font-weight="normal" line-height="36.4px" letter-spacing="-0.03em" text-align="center" dominant-baseline="mathematical" alignment-baseline="mathematical" text-anchor="middle" fill="#1d1d1d" transform-origin="top left" transform="translate(498.575, 480.4588)"><tspan y="18.2px" x="12">\n</tspan></text></g><g class="tl-centered-g" data-color="violet" data-fill="true" transform="translate(12.58, 273.00) rotate(0.00, 476.00, 0.50)"><defs><mask id="d22e1b19-cdf0-4e9b-3bf5-a03a15862c9f_clip"><rect x="-100" y="-100" width="1152" height="201" fill="white"></rect><rect x="476" y="0" width="0" height="0" rx="4" ry="4" fill="black" opacity="1"></rect></mask></defs><g pointer-events="none" opacity="1" mask=""><path d="M952,0L0,0" fill="#7746f1" stroke="#7746f1" stroke-width="4.236000000000001" stroke-dasharray="none" stroke-dashoffset="none" stroke-linecap="round" stroke-linejoin="round" pointer-events="stroke"></path></g></g><g class="tl-centered-g" data-color="blue" data-fill="true" transform="translate(8.58, 406.00) rotate(0.00, 520.00, 0.50)"><defs><mask id="69d5b18d-926e-436b-0ec5-217293e2b2ef_clip"><rect x="-100" y="-100" width="1240" height="201" fill="white"></rect><rect x="520" y="0" width="0" height="0" rx="4" ry="4" fill="black" opacity="1"></rect></mask></defs><g pointer-events="none" opacity="1" mask=""><path d="M1040,0L0,0" fill="#1c7ed6" stroke="#1c7ed6" stroke-width="4.236000000000001" stroke-dasharray="none" stroke-dashoffset="none" stroke-linecap="round" stroke-linejoin="round" pointer-events="stroke"></path></g></g><g class="tl-centered-g" data-color="violet" data-fill="true" transform="translate(14.00, 539.00) rotate(0.00, 560.00, 0.50)"><defs><mask id="c21444f2-93d1-40d7-2a6a-f71d841e29a7_clip"><rect x="-100" y="-100" width="1320" height="201" fill="white"></rect><rect x="560" y="0" width="0" height="0" rx="4" ry="4" fill="black" opacity="1"></rect></mask></defs><g pointer-events="none" opacity="1" mask=""><path d="M1120,0L0,0" fill="#7746f1" stroke="#7746f1" stroke-width="4.236000000000001" stroke-dasharray="none" stroke-dashoffset="none" stroke-linecap="round" stroke-linejoin="round" pointer-events="stroke"></path></g></g><g class="tl-centered-g" data-color="blue" data-fill="true" transform="translate(6.00, 672.00) rotate(0.00, 604.00, 0.50)"><defs><mask id="b75e5507-249c-4a34-0df3-282340c3f21b_clip"><rect x="-100" y="-100" width="1408" height="201" fill="white"></rect><rect x="604" y="0" width="0" height="0" rx="4" ry="4" fill="black" opacity="1"></rect></mask></defs><g pointer-events="none" opacity="1" mask=""><path d="M1208,0L0,0" fill="#1c7ed6" stroke="#1c7ed6" stroke-width="4.236000000000001" stroke-dasharray="none" stroke-dashoffset="none" stroke-linecap="round" stroke-linejoin="round" pointer-events="stroke"></path></g></g><text font-size="47.43863889265829px" font-family="Caveat Brush" font-weight="normal" line-height="61.67023056045578px" letter-spacing="-0.03em" text-align="center" dominant-baseline="mathematical" alignment-baseline="mathematical" text-anchor="middle" fill="#7746f1" data-color="violet" transform="translate(1.
100, 209.00) rotate(0.00, 187.50, 36.00)"><tspan y="30.83511528022789px" x="191.5">Self-actualization\n</tspan></text><g class="tl-centered-g" data-color="violet" data-fill="true" transform="translate(6.00, 800.93) rotate(0.00, 140.25, 0.50)"><defs><mask id="18430d21-d0d1-4605-04d9-21dcd0f3c6a3_clip"><rect x="-100" y="-100" width="480.51" height="201" fill="white"></rect><rect x="140.255" y="0.020000000000000018" width="0" height="0" rx="4" ry="4" fill="black" opacity="1"></rect></mask></defs><g pointer-events="none" opacity="1" mask=""><path d="M280.51,0L0,0.04" fill="#7746f1" stroke="#7746f1" stroke-width="4.236000000000001" stroke-dasharray="none" stroke-dashoffset="none" stroke-linecap="round" stroke-linejoin="round" pointer-events="stroke"></path></g></g><text font-size="30.449877467957133px" font-family="Caveat Brush" font-weight="normal" line-height="39.584840708344274px" letter-spacing="-0.03em" text-align="center" dominant-baseline="mathematical" alignment-baseline="mathematical" text-anchor="middle" fill="#788492" data-color="gray" transform="translate(725.58, 147.62) rotate(0.00, 67.00, 44.50)"><tspan y="19.792420354172137px" x="71">morality,\n</tspan><tspan y="59.37726106251641px" x="71">\ncreativity\n</tspan></text><text font-size="47.43863889265829px" font-family="Caveat Brush" font-weight="normal" line-height="61.67023056045578px" letter-spacing="-0.03em" text-align="center" dominant-baseline="mathematical" alignment-baseline="mathematical" text-anchor="middle" fill="#1c7ed6" data-color="blue" transform="translate(1.00, 337.00) rotate(0.00, 84.00, 36.00)"><tspan y="30.83511528022789px" x="88">Esteem\n</tspan></text><text font-size="30.449877467957133px" font-family="Caveat Brush" font-weight="normal" line-height="39.584840708344274px" letter-spacing="-0.03em" text-align="center" dominant-baseline="mathematical" alignment-baseline="mathematical" text-anchor="middle" fill="#788492" data-color="gray" transform="translate(616.08, 292.50) rotate(0.00, 176.50, 44.50)"><tspan y="19.792420354172137px" x="180.5">self-esteem, confidence, \n</tspan><tspan y="59.37726106251641px" x="180.5">\nachievement, respect \n</tspan></text><text font-size="47.43863889265829px" font-family="Caveat Brush" font-weight="normal" line-height="61.67023056045578px" letter-spacing="-0.03em" text-align="center" dominant-baseline="mathematical" alignment-baseline="mathematical" text-anchor="middle" fill="#7746f1" data-color="violet" transform="translate(1.00, 465.00) rotate(0.00, 168.50, 36.00)"><tspan y="30.83511528022789px" x="172.5">Love/Belonging\n</tspan></text><text font-size="30.449877467957133px" font-family="Caveat Brush" font-weight="normal" line-height="39.584840708344274px" letter-spacing="-0.03em" text-align="center" dominant-baseline="mathematical" alignment-baseline="mathematical" text-anchor="middle" fill="#788492" data-color="gray" transform="translate(666.38, 451.00) rotate(0.00, 120.00, 25.00)"><tspan y="19.792420354172137px" x="124">friendship, family\n</tspan></text><text font-size="47.43863889265829px" font-family="Caveat Brush" font-weight="normal" line-height="61.67023056045578px" letter-spacing="-0.03em" text-align="center" dominant-baseline="mathematical" alignment-baseline="mathematical" text-anchor="middle" fill="#1c7ed6" data-color="blue" transform="translate(1.00, 601.00) rotate(0.00, 73.00, 36.00)"><tspan y="30.83511528022789px" x="77">Safety\n</tspan></text><text font-size="30.449877467957133px" font-family="Caveat Brush" font-weight="normal" line-height="39.584840708344274px" letter-spacing="-0.03em" text-align="center" dominant-baseline="mathematical" alignment-baseline="mathematical" text-anchor="middle" fill="#788492" data-color="gray" transform="translate(473.58, 564.81) rotate(0.00, 319.00, 44.50)"><tspan y="19.792420354172137px" x="323">security of body, of employment, of resources,\n</tspan><tspan y="59.37726106251641px" x="323">\nof morality, of the family, of health, of property\n</tspan></text><text font-size="47.43863889265829px" font-family="Caveat Brush" font-weight="normal" line-height="61.67023056045578px" letter-spacing="-0.03em" text-align="center" dominant-baseline="mathematical" alignment-baseline="mathematical" text-anchor="middle" fill="#7746f1" data-color="violet" transform="translate(1.
100, 721.00) rotate(0.00, 142.00, 36.00)"><tspan y="30.83511528022789px" x="146">Physiological\n</tspan></text><text font-size="30.449877467957133px" font-family="Caveat Brush" font-weight="normal" line-height="39.584840708344274px" letter-spacing="-0.03em" text-align="center" dominant-baseline="mathematical" alignment-baseline="mathematical" text-anchor="middle" fill="#788492" data-color="gray" transform="translate(501.58, 712.13) rotate(0.00, 291.00, 25.00)"><tspan y="19.792420354172137px" x="295">breathing, food, water, sleep, homeostasis\n</tspan></text></svg>'}},callouts3:{type:"drawing",attrs:{horizontalAlign:null,page:{id:"page",name:"Page 1",childIndex:1,shapes:{"c9608754-47d2-466e-02ab-b9a4b7b4f112":{id:"c9608754-47d2-466e-02ab-b9a4b7b4f112",type:"rectangle",name:"Rectangle",parentId:"page",childIndex:1,point:[392,184],size:[270,319.79],rotation:0,style:{color:"violet",size:"small",isFilled:!0,dash:"solid",scale:1},label:"",labelPoint:[.5,.5]},"123a9ace-99c9-4623-26a4-dd6d93bfd888":{id:"123a9ace-99c9-4623-26a4-dd6d93bfd888",type:"text",name:"Text",parentId:"page",childIndex:5,point:[452,264],rotation:0,text:"400",style:{color:"violet",size:"small",isFilled:!0,dash:"solid",scale:2.7834210526315784,font:"script",textAlign:"middle"}},"72ad12a3-8fb3-425f-012d-8ded026e8d7c":{id:"72ad12a3-8fb3-425f-012d-8ded026e8d7c",type:"text",name:"Text",parentId:"page",childIndex:6,point:[451,400],rotation:0,text:"companies\nsigned up",style:{color:"violet",size:"small",isFilled:!0,dash:"solid",scale:1.0448375929240272,font:"script",textAlign:"middle"}},"565769ca-a63a-47e9-3540-1e933937db31":{id:"565769ca-a63a-47e9-3540-1e933937db31",type:"rectangle",name:"Rectangle",parentId:"page",childIndex:5,point:[720,184],size:[270,319.79],rotation:0,style:{color:"violet",size:"small",isFilled:!0,dash:"solid",scale:1},label:"",labelPoint:[.5,.5]},"cf065500-ae12-4be8-2758-4c154ea8609c":{id:"cf065500-ae12-4be8-2758-4c154ea8609c",type:"text",name:"Text",parentId:"page",childIndex:6,point:[774,264],rotation:0,text:"92%",style:{color:"violet",size:"small",isFilled:!0,dash:"solid",scale:2.7834210526315784,font:"script",textAlign:"middle"}},"7348dda5-d071-4268-2c83-7c78c15134f9":{id:"7348dda5-d071-4268-2c83-7c78c15134f9",type:"text",name:"Text",parentId:"page",childIndex:7,point:[772,400],rotation:0,text:"monthly\nactive users",style:{color:"violet",size:"small",isFilled:!0,dash:"solid",scale:1.0448375929240272,font:"script",textAlign:"middle"}},"1ffb62ba-9ea5-4fd2-12eb-f02f395144ed":{id:"1ffb62ba-9ea5-4fd2-12eb-f02f395144ed",type:"rectangle",name:"Rectangle",parentId:"page",childIndex:6,point:[1048,184],size:[270,318.19],rotation:0,style:{color:"violet",size:"small",isFilled:!0,dash:"solid",scale:1},label:"",labelPoint:[.5,.5]},"ff1ea7c5-d930-4638-2c5b-c011b71a0c67":{id:"ff1ea7c5-d930-4638-2c5b-c011b71a0c67",type:"text",name:"Text",parentId:"page",childIndex:7,point:[1134.5,264],rotation:0,text:"76",style:{color:"violet",size:"small",isFilled:!0,dash:"solid",scale:2.7834210526315784,font:"script",textAlign:"middle"}},"5717d874-113c-4b0b-1cfe-029c85eb0269":{id:"5717d874-113c-4b0b-1cfe-029c85eb0269",type:"text",name:"Text",parentId:"page",childIndex:8,point:[1102,400],rotation:0,text:"weekly\nsubscribers",style:{color:"violet",size:"small",isFilled:!0,dash:"solid",scale:1.0448375929240272,font:"script",textAlign:"middle"}}},bindings:{}},assets:{},meta:{width:926,height:319.79},width:926,svg:'<svg viewBox="0 0 926 319.79" width="926" height="319.79" style="background-color: transparent;"><g class="" transform="translate(0.00, 0.00) rotate(0.00, 135.00, 159.90)"><rect x="2.1180000000000003" y="2.1180000000000003" width="267.882" height="317.672" fill="#e2daf8" pointer-events="none"></rect><g pointer-events="none" stroke="#7746f1" stroke-width="4.236000000000001" stroke-linecap="round"><line x1="2.1180000000000003" y1="2.1180000000000003" x2="267.882" y2="2.1180000000000003" stroke-dasharray="none" stroke-dashoffset="none"></line><line x1="267.882" y1="2.1180000000000003" x2="267.882" y2="317.672" stroke-dasharray="none" stroke-dashoffset="none"></line><line x1="267.882" y1="317.672" x2="2.1180000000000003" y2="317.672" stroke-dasharray="none" stroke-dashoffset="none"></line><line x1="2.1180000000000003" y1="317.672" x2="2.1180000000000003" y2="2.1180000000000003" stroke-dasharray="none" stroke-dashoffset="none"></line></g></g><g text-align="center" text-anchor="middle" fill="#7746f1" transform="translate(60.00, 80.00) rotate(0.00, 75.00, 44.00)"><text y="14" letter-spacing="-0.84" font-size="28px" font-family="Caveat Brush" text-align="center" alignment-baseline="central" transform="scale(2.7834210526315784)" x="26.945258579937605">400</text></g><g class="tl-centered-g" transform="translate(328.00, 0.00) rotate(0.00, 135.00, 159.90)"><rect x="2.1180000000000003" y="2.1180000000000003" width="267.882" height="317.672" fill="#e2daf8" pointer-events="none"></rect><g pointer-events="none" stroke="#7746f1" stroke-width="4.236000000000001" stroke-linecap="round"><line x1="2.1180000000000003" y1="2.1180000000000003" x2="267.882" y2="2.1180000000000003" stroke-dasharray="none" stroke-dashoffset="none"></line><line x1="267.882" y1="2.1180000000000003" x2="267.882" y2="317.672" stroke-dasharray="none" stroke-dashoffset="none"></line><line x1="267.882" y1="317.672" x2="2.1180000000000003" y2="317.672" stroke-dasharray="none" stroke-dashoffset="none"></line><line x1="2.1180000000000003" y1="317.672" x2="2.1180000000000003" y2="2.1180000000000003" stroke-dasharray="none" stroke-dashoffset="none"></line></g></g><g text-align="center" text-anchor="middle" fill="#7746f1" transform="translate(59.00, 216.00) rotate(0.00, 76.00, 34.50)"><text y="14" letter-spacing="-0.84" font-size="28px" font-family="Caveat Brush" text-align="center" alignment-baseline="central" transform="scale(1.0448375929240272)" x="72.73857728195864">companies</text><text y="42" letter-spacing="-0.84" font-size="28px" font-family="Caveat Brush" text-align="center" alignment-baseline="central" transform="scale(1.0448375929240272)" x="72.73857728195864">signed up</text></g><g text-align="center" text-anchor="middle" fill="#7746f1" transform="translate(382.00, 80.00) rotate(0.00, 81.00, 44.00)"><text y="14" letter-spacing="-0.84" font-size="28px" font-family="Caveat Brush" text-align="center" alignment-baseline="central" transform="scale(2.7834210526315784)" x="29.100879266332615">92%</text></g><g class="tl-centered-g" transform="translate(656.00, 0.00) rotate(0.00, 135.00, 159.09)"><rect x="2.1180000000000003" y="2.1180000000000003" width="267.882" height="316.072" fill="#e2daf8" pointer-events="none"></rect><g pointer-events="none" stroke="#7746f1" stroke-width="4.236000000000001" stroke-linecap="round"><line x1="2.1180000000000003" y1="2.1180000000000003" x2="267.882" y2="2.1180000000000003" stroke-dasharray="none" stroke-dashoffset="none"></line><line x1="267.882" y1="2.1180000000000003" x2="267.882" y2="316.072" stroke-dasharray="none" stroke-dashoffset="none"></line><line x1="267.882" y1="316.072" x2="2.1180000000000003" y2="316.072" stroke-dasharray="none" stroke-dashoffset="none"></line><line x1="2.1180000000000003" y1="316.072" x2="2.1180000000000003" y2="2.1180000000000003" stroke-dasharray="none" stroke-dashoffset="none"></line></g></g><g text-align="center" text-anchor="middle" fill="#7746f1" transform="translate(380.00, 216.00) rotate(0.00, 83.00, 34.50)"><text y="14" letter-spacing="-0.84" font-size="28px" font-family="Caveat Brush" text-align="center" alignment-baseline="central" transform="scale(1.0448375929240272)" x="79.43818308424432">monthly</text><text y="42" letter-spacing="-0.84" font-size="28px" font-family="Caveat Brush" text-align="center" alignment-baseline="central" transform="scale(1.0448375929240272)" x="79.43818308424432">active users</text></g><g text-align="center" text-anchor="middle" fill="#7746f1" transform="translate(742.50, 80.00) rotate(0.00, 48.50, 44.00)"><text y="14" letter-spacing="-0.84" font-size="28px" font-family="Caveat Brush" text-align="center" alignment-baseline="central" transform="scale(2.7834210526315784)" x="17.424600548359653">76</text></g><g text-align="center" text-anchor="middle" fill="#7746f1" transform="translate(710.00, 216.00) rotate(0.00, 81.00, 34.50)"><text y="14" letter-spacing="-0.84" font-size="28px" font-family="Caveat Brush" text-align="center" alignment-baseline="central" transform="scale(1.0448375929240272)" x="77.52400999787697">weekly</text><text y="42" letter-spacing="-0.84" font-size="28px" font-family="Caveat Brush" text-align="center" alignment-baseline="central" transform="scale(1.0448375929240272)" x="77.52400999787697">subscribers</text></g></svg>'}}};var o=n(82655),i=n(87254),a=n(9850),l=n.n(a),s=n(42111),d=n(86323),c=n(32398);let u=[{key:"diagram",name:()=>i.ag._({id:"G1q1hG"}),keywords:["sketch","drawing","shapes","diagram"],shortcut:"/diagram"},{key:"flywheel",name:()=>i.ag._({id:"6BBMcV"}),keywords:["cycle","circle","diagram","flywheel"],previewImage:{src:"/_next/static/media/Flywheel.fd4813bb.svg",height:96,width:254,blurWidth:0,blurHeight:0}},{key:"quadrant",name:()=>i.ag._({id:"tmk28W"}),keywords:["matrix","quadrant","diagram","2x2"],previewImage:{src:"/_next/static/media/Quadrants.61681555.svg",height:96,width:254,blurWidth:0,blurHeight:0}},{key:"venn",name:()=>i.ag._({id:"z5TX2d"}),previewImage:{src:"/_next/static/media/Venn.7a87e038.svg",height:96,width:254,blurWidth:0,blurHeight:0},keywords:["venn","diagram"]}].map(e=>{let t=s.VH.get("tldraw2"),n=r[e.key]||{type:t?"diagram":"drawing",attrs:{}};return{nodeName:"drawing",...e,icon:o.Kak,featureFlag:"drawingBlock",execute:e=>{let t=(0,c.RA)(),r=l()(n);r.attrs.id=t,(0,c.Sc)(t,!0),e.commands.insertContent(r)},dragStartFn:e=>{let t=(0,c.RA)(),r=l()(n);r.attrs.id=t,(0,c.Sc)(t,!0),(0,d.UV)(e,r)}}})},32398:function(e,t,n){"use strict";n.d(t,{RA:function(){return c},Sc:function(){return d},Us:function(){return l},ZF:function(){return s}});var r=n(37164),o=n(91994),i=n(16656),a=n(47968);
1let l=(e,t,n)=>{e&&t&&e.replacePageContent(t.shapes,t.bindings,n)},s=(e,t)=>{e.setSetting("isSnapping",t),setTimeout(()=>{(0,i.kC)(e,t?128:10)})},d=(e,t)=>{let n=(0,o.bh)(),r=t?{drawingId:e}:{drawingId:null};n.dispatch((0,a.h)(r))},c=()=>(0,r.x0)(5)},17487:function(e,t,n){"use strict";n.d(t,{Hy:function(){return S},Pi:function(){return A},HU:function(){return I}});var r=n(52322),o=n(72338),i=n(27191),a=n(2784),l=n(27354),s=n(68292),d=n(19283),c=n(33374);let u=(e,t)=>(n,r)=>{let o=n.getState(e.view.state),i={...o};i.active=!0,i.key=r,i.query="",t.setMeta(n,i)};var p=n(91994),m=n(47968),h=n(36651),g=n(66028);let f=e=>{let{ref:t,pickerInstance:n}=e;(0,a.useImperativeHandle)(t,()=>{let e=e=>{var t,r,o;let i=null===(o=n.component)||void 0===o?void 0:null===(r=o.refs)||void 0===r?void 0:null===(t=r.searchInput)||void 0===t?void 0:t.current;if(i){let{key:t,code:n}=e;i.dispatchEvent(new KeyboardEvent("keydown",{key:t,code:n}))}return e.stopPropagation(),e.preventDefault(),!0};return{onKeyDown:t=>{let{event:n}=t;return!!["ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Enter"].includes(n.key)&&e(n)}}})},x=(0,a.forwardRef)((e,t)=>{let{query:n,onSelect:o}=e,i=(0,p.CG)(m.yx),s=(0,h.py)("edit",i),[d,c]=(0,a.useState)(null),u=(0,a.useCallback)(e=>{if(c(e),e.shadowRoot){let t=document.createElement("style");t.innerHTML="nav + div.padding-lr { display: none }",e.shadowRoot.appendChild(t)}e.addEventListener("mousedown",g.br)},[]);f({ref:t,pickerInstance:d}),(0,a.useEffect)(()=>{var e,t,r;if(!d)return;let o=null===(r=d.component)||void 0===r?void 0:null===(t=r.refs)||void 0===t?void 0:null===(e=t.searchInput)||void 0===e?void 0:e.current;o&&(o.value=n,o.dispatchEvent(new Event("input",{bubbles:!0})))},[d,n]);let x=(0,a.useCallback)(e=>{let t=(0,l.Oj)(e.id);t&&o(t)},[o]);return s?(0,r.jsx)(l.h5,{onCreate:u,perLine:9,searchPosition:"sticky",handlePick:x,shouldFocusSearch:!1,dataTargetName:"emoji-list"}):(0,r.jsx)(r.Fragment,{})});var v=n(1365),b=n(66121);let y=/:([a-zA-Z0-9_+-]+):$/,C=RegExp(v.V.source+"$","g"),w=new i.H$("EmojiMenu"),k=e=>{let t=(0,l.vb)(e[0]);return{id:t,native:e[0]}},j=e=>{let t=(0,l.N$)(e);return{id:e.id,native:t}},S=o.NB.create({name:"emoji",group:"inline",inline:!0,selectable:!1,atom:!0,addAttributes:()=>({id:{},native:{}}),parseHTML:()=>[{tag:"span.emoji:not([id])",skip:!0},{tag:"span[class=emoji]"}],addCommands:()=>({openEmojiPicker:function(){let e=!(arguments.length>0)||void 0===arguments[0]||arguments[0];return t=>{let{commands:n,tr:r,editor:o}=t;return u(o,r)(w,":"),!e||n.insertContent(":")}}}),addInputRules(){return[new o.VK({find:y,handler:e=>{let{range:t,match:n,commands:r}=e,o=n[1],i=(0,l.Oj)(o);if(!i)return;let a=j(i);r.insertContentAt(t,{type:"emoji",attrs:a})}}),(0,o.x2)({find:e=>{var t;let n=[...e.matchAll(C)];if(!n||0===n.length)return null;let r=n[0],o={index:null!==(t=r.index)&&void 0!==t?t:-1,text:r[0],match:r};return console.debug("[EmojiNode] JAMES nodeInputRule",{matches:n,result:o}),o}
1,type:this.type,getAttributes:k})]},addPasteRules(){return[(0,s.S)({find:v.V,type:this.type,getAttributes:k})]},renderHTML(e){let{HTMLAttributes:t,node:n}=e;return["span",(0,o.P1)(t,{class:"emoji"}),"".concat(n.attrs.native||"�")]},renderHTMLforAI(e){let{node:t}=e;return t.attrs.native||""},renderText(e){let{node:t}=e;return"".concat(t.attrs.native||"�")}}),A=(0,c.ty)({name:"emojiShortcuts",char:":",pluginKey:w,MenuComponent:(0,a.forwardRef)((e,t)=>{let{query:n,editor:o}=e;return o.isEditable?(0,r.jsx)(x,{ref:t,query:n,onSelect:e=>{let{id:t}=e,r=(0,l.N$)(e),i=o.state.selection;o.chain().deleteRange({from:i.from-n.length-1,to:i.to}).insertContent({type:"emoji",attrs:{id:t,native:r}}).insertContent(" ").run()}}):null}),priority:d.a.EmojiShortcuts}),I=e=>{let{node:t,pos:n,tr:r,schema:o}=e;if(!(0,l.zx)())return!1;if(!t.isText||!t.text)return!0;let i=t.marks.map(e=>e.toJSON()),{replaced:a,nodes:s}=(0,b.W)(t.text,i);try{a&&r.replaceWith(r.mapping.map(n),r.mapping.map(n+t.nodeSize),s.map(e=>o.nodeFromJSON(e)))}catch(e){console.error("[migratePlugin] Error migrating emoji",{err:e,pos:n,text:t.text,node:t,nodes:s})}return!0}},1365:function(e,t,n){"use strict";n.d(t,{V:function(){return i}});var r=n(56230),o=n.n(r);let i=o()()},66121:function(e,t,n){"use strict";n.d(t,{W:function(){return i}});var r=n(27354),o=n(1365);let i=(e,t)=>{let n=[],i=e.matchAll(o.V),a=0;for(let o of i){let i=o.index;if(void 0===i)continue;let l=i+o[0].length,s=o[0],d=(0,r.vb)(s);if(!d)continue;let c=(0,r.Oj)(d),u=e.slice(a,i);u.length>0&&n.push({type:"text",text:u,marks:t});let p={type:"emoji",attrs:{native:s,id:null==c?void 0:c.id},marks:t};a=l,n.push(p),console.debug("[migratePlugin] Replacing bad emoji",{start:i,end:l,native:s,newNode:p,textBefore:u,match:o})}let l=e.slice(a);return 0===a?{replaced:!1,nodes:n}:(l&&n.push({type:"text",text:l,marks:t}),{replaced:!0,nodes:n})}},13180:function(e,t,n){"use strict";n.d(t,{R:function(){return d},_:function(){return s}});var r=n(72338),o=n(27191),i=n(52780),a=n(11093);let l=e=>e.isTextblock||["gallery","cardLayoutItem","buttonGroup","navbarLinks","navbarButtons","toggleSummary"].includes(e.type.name),s=r.hj.create({name:"emptyNodes",addOptions:()=>({emptyNodeClass:"is-empty",showOnlyWhenEditable:!0,showOnlyCurrent:!1}),addProseMirrorPlugins(){return[new o.Sy({key:new o.H$("emptyNodes"),props:{decorations:e=>{let{doc:t,selection:n}=e,r=[],o=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:s}=n;if(o)return t.descendants((e,t)=>{if(!l(e))return;let n=s>=t&&s<=t+e.nodeSize,o=(0,a.$y)(e);(n||!this.options.showOnlyCurrent)&&o&&r.push(i.p.node(t,t+e.nodeSize,{class:this.options.emptyNodeClass},{isEmpty:!0}))}),i.EH.create(t,r)}}})]}}),d=e=>e.some(e=>e.spec.isEmpty)},97857:function(e,t,n){"use strict";n.d(t,{_g:function(){return A},ei:function(){return C},yv:function(){return y}});var r=n(73200),o=n(72338),i=n(27191),a=n(52780),l=n(91994),s=n(24781),d=n(11050),c=n(47968),u=n(90604),p=n(11093),m=n(67748),h=n(52332),g=n(96255),f=n(82400),x=n(71474),v=n(54999);let b=new i.H$("expandableNodes"),y=e=>e.some(e=>e.spec.isExpandableNode),C=e=>e instanceof m.c&&0===e.side&&w(e.node),w=e=>!0===e.type.spec.expandable,k=(e,t)=>{if(!(null==t?void 0:t.from))return!1;let n=(0,p.Sh)(e,t.from),r=(0,s.v4)(n);return(null==r?void 0:r.inView)===!0},j=(e,t,n)=>{let r=(0,g.XE)(e.view.nodeDOM(t)),o=(0,s.v4)(r);if(!o)return!1;let{bottomInView:i,topInView:a}=o;return"top"===n?a:i},S=function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=e.state.selection,a=o instanceof m.c&&1===o.side?o.to:o.from;if(a<=t){let n=j(e,t,"top");if(n)return null}else if(a>=n){let n=j(e,t,"bottom");if(n)return null}else{if(k(e,o))return null;let t=e.state.doc.resolve(a);if(k(e,i.Y1.findFrom(t,-1,!1))||k(e,i.Y1.findFrom(t,1,!1)))return null}let l=(0,p.TV)({editor:e,side:r?"bottom":"top",margin:200});if(l.pos){let t=i.Y1.findFrom(e.state.doc.resolve(l.pos),r?1:-1,!1);return(null==t?void 0:t.from)||null}return null},A=o.hj.create({name:"expandableNodes",extendNodeSchema(e){var t;return{expandable:null!==(t=(0,o.nU)((0,o.Nl)(e,"expandable",e)))&&void 0!==t&&t}},addCommands:()=>({expandOrCollapseExpandableNode:e=>t=>{let{state:n,chain:r}=t,o=null!=e?e:n.selection.from,i=n.doc.nodeAt(o);if(!i||!w(i))return!1;let a=(0,l.bh)();switch(i.type.name){case"card":if(a.dispatch((0,c.Qx)({attached:!1})),null===d.co||void 0===d.co||d.co.track(d.AA.CARD_EXPANDED,{is_present_mode:!0,method:"enter_key"}),(0,h.HD)(i.attrs.id))return r().descendIntoCurrentCard(o).reHighlightExpandableNode().run();return r().spotlightCollapseCard(o).reHighlightExpandableNode().run();case"toggle":{(0,v.xB)(i.attrs.id,!(0,v.fH)(i.attrs.id));let t=r();return e&&t.spotlightNextBlock(),t.reHighlightExpandableNode().run(),!0}case"image":case"video":case"embed":return a.dispatch((0,c.RW)({nodeId:i.attrs.id})),!0;case"gallery":{let e=i.firstChild;if(e)return a.dispatch((0,c.RW)({nodeId:e.attrs.id})),!0;return!1}default:return!1}},goToNextExpandableNode:e=>t=>{var n;let{editor:r,tr:o,state:i}=t,a=x.M.getState(r.state),l=(0,g.Bw)(r,a.cardId);if(!l)return!1;
1let d=l.node.attrs.id,c=l.pos,u=l.pos+l.node.nodeSize,p=r.state.selection,h=C(p),v=p instanceof m.c,y=S(r,c,u,e),k=(null===(n=b.getState(i))||void 0===n?void 0:n.lastApplied)||+new Date,j=h&&!y&&+new Date-k>3e3;if(j)return r.commands.reHighlightExpandableNode();o.setMeta(b,{});let A=v&&(-1===p.side&&e||1===p.side&&!e)?-1:0,I=y||(h||!v?p.from:1===p.side?p.to+A:p.from+A),E=Math.min(Math.max(I,c),u-1),z=(0,f.xd)(r,d,E,w,e);if(console.debug("[ExpandableNodes] goToNextExpandableNode",{posToUse:E,overridePos:y},z),!z.pos||!z.domNode||z.cardId!==d)return o.setSelection(m.c.create(r.state.doc,c,e?-1:1)),!1;let T=(0,s.v4)(z.domNode,50);return(null==T?void 0:T.inView)?(o.setSelection(m.c.create(r.state.doc,z.pos)),(0,s.cC)("editor").scrollElementIntoView({element:z.domNode,attempts:0,offsetFromTop:null}),!0):(h&&o.setSelection(m.c.create(r.state.doc,p.from,e?-1:1)),!1)},reHighlightExpandableNode:()=>e=>{let{tr:t,editor:n}=e;return t.setMeta(b,{shouldAddResetClass:!0}),requestAnimationFrame(()=>{n.commands.command(e=>{let{tr:t}=e;return t.setMeta(b,{shouldAddResetClass:!1}),!0})}),!0}}),addProseMirrorPlugins:()=>[new i.Sy({key:b,state:{init:()=>({lastApplied:0,shouldAddResetClass:!1}),apply(e,t){let n=e.getMeta(b);return n?{...t,lastApplied:+new Date,...n}:t}},props:{decorations(e){let t=x.M.getState(e);if(null==t?void 0:t.pos)return a.EH.empty;let n=b.getState(e),o=(0,c.gh)((0,l.bh)().getState());if(o!==u.q.SLIDE_VIEW)return a.EH.empty;let i=e.selection;if(!C(i)||!(i instanceof m.c))return a.EH.empty;let s=i.node;return a.EH.create(e.doc,[a.p.node(i.from,i.from+s.nodeSize,{class:(0,r.cx)("expandable-node-selected",(null==n?void 0:n.shouldAddResetClass)&&"expandable-node-reset")},{isExpandableNode:!0})])}}})]})},79786:function(e,t,n){"use strict";n.d(t,{Bf:function(){return s},Zh:function(){return d},hY:function(){return c}});var r=n(72338),o=n(47577),i=n(98314),a=n(70952),l=n(43298);let s=r.hj.create({name:"fontSize",addProseMirrorPlugins:()=>[(0,a.a)()],addInputRules:()=>Object.entries((0,i.yw)()).map(e=>{let[t,{inputRegex:n,type:r}]=e;return n?(0,o.A0)({find:n,getAttributes:e=>"heading"!==r||c(e).includes("heading")?{fontSize:t}:null}):null}).filter(e=>!!e),addKeyboardShortcuts(){let e=Object.entries((0,i.yw)()).reduce((e,t)=>{let[n,{level:r,type:o}]=t;return"heading"===o&&r?{...e,["Mod-Alt-".concat(r)]:()=>this.editor.commands.setFontSize(n)}:e},{});return e},addCommands:()=>({setFontSize:e=>t=>{let{tr:n,dispatch:r,state:o}=t;return!r||(n.selection.ranges.forEach(t=>{let r=t.$from.pos,i=t.$to.pos,{type:a,level:s}=(0,l.hx)(e),{nodes:d}=o.schema;o.doc.nodesBetween(r,i,(t,r)=>{var o;if("footnote"===t.type.name)return!1;if(t.isTextblock){if("heading"===a&&!c(t).includes("heading")){n.setNodeMarkup(r,d.heading,{...t.attrs,level:s}).setMeta("annotationEvent",{type:"update-node-attrs",pos:r});return}if("title"===a&&!c(t).includes("title")){n.setNodeMarkup(r,d.title,{...t.attrs,level:s}).setMeta("annotationEvent",{type:"update-node-attrs",pos:r});return}(null===(o=t.type.spec.attrs)||void 0===o?void 0:o.fontSize)?n.setNodeMarkup(r,void 0,{...t.attrs,fontSize:e}).setMeta("annotationEvent",{type:"update-node-attrs",pos:r}):["heading","title"].includes(t.type.name)&&n.setNodeMarkup(r,d.paragraph,{...t.attrs,fontSize:e}).setMeta("annotationEvent",{type:"update-node-attrs",pos:r})}})}),!0)}}),extendNodeSchema(e){var t;return{allowFontSizes:null!==(t=(0,r.nU)((0,r.Nl)(e,"allowFontSizes",e)))&&void 0!==t?t:""}}}),d=e=>{let{state:t}=e,{from:n,to:o}=t.selection,i=(0,r.b5)(t.doc,{from:n,to:o},e=>e.isTextblock),a=i.reverse().map(e=>{let{node:t}=e;return t.attrs.fontSize}).filter(e=>void 0!==e);
1return[...new Set(a)]},c=e=>{var t,n;return null!==(n=null===(t=e.type.spec.allowFontSizes)||void 0===t?void 0:t.split(" "))&&void 0!==n?n:[]}},70952:function(e,t,n){"use strict";n.d(t,{a:function(){return l},z:function(){return s}});var r=n(27191),o=n(52780),i=n(43298);let a=e=>["calloutBox","smartLayoutCell"].includes(e.type.name),l=()=>new r.Sy({key:new r.H$("fontSize"),props:{decorations(e){let t=[];if(e.doc.descendants((e,n)=>{if(!a(e)||!e.firstChild)return;let r=(0,i.Aw)(e.firstChild);t.push(o.p.node(n,n+e.nodeSize,{},{isFirstChildFontSizeDecoration:!0,firstChildSize:r}))}),0!=t.length)return o.EH.create(e.doc,t)}}}),s=e=>{var t;return(null===(t=e.find(e=>e.spec.isFirstChildFontSizeDecoration))||void 0===t?void 0:t.spec)||{}}},98314:function(e,t,n){"use strict";n.d(t,{B8:function(){return l},Yt:function(){return s},be:function(){return d},yw:function(){return a}});var r=n(87254),o=n(829),i=n.n(o);let a=()=>({sm:{label:r.ag._({id:"LBkaLa"}),size:.8,flagged:!0,type:"body",shortcut:"/sm"},default:{label:r.ag._({id:"5NwZ8t"}),size:1,type:"body",shortcut:"/md"},lg:{label:r.ag._({id:"0Sz17G"}),size:1.25,flagged:!0,type:"body",shortcut:"/lg"},h4:{label:r.ag._({id:"nJeKmw"}),size:1.25,mobileSize:1.1,level:4,type:"heading",inputRegex:/^####\s$/,shortcut:"####"},h3:{label:r.ag._({id:"SFN6dN"}),size:1.5,mobileSize:1.25,level:3,type:"heading",inputRegex:/^###\s$/,shortcut:"###"},h2:{label:r.ag._({id:"El7NbA"}),size:2,mobileSize:1.5,level:2,type:"heading",inputRegex:/^##\s$/,shortcut:"##"},h1:{label:r.ag._({id:"lXKZGw"}),size:2.5,mobileSize:2,level:1,type:"heading",inputRegex:/^#\s$/,shortcut:"#"},title:{label:r.ag._({id:"MHrjPM"}),size:3,mobileSize:2.25,level:1,type:"title",shortcut:"/title"}}),l=()=>i()(Object.entries(a()).filter(e=>{let[t,{type:n}]=e;return"heading"===n}),e=>{let[t,{level:n}]=e;return n}),s=()=>i()(Object.entries(a()).filter(e=>{let[t,{type:n}]=e;return"title"===n}),e=>{let[t,{level:n}]=e;return n}),d=()=>i()(Object.entries(a()).filter(e=>{let[t,{type:n}]=e;return"body"===n}),e=>{let[t,{size:n}]=e;return n})},12304:function(e,t,n){"use strict";n.d(t,{I0:function(){return i},g6:function(){return l},v0:function(){return a}});var r=n(98314),o=n(43298);let i=1.6,a=e=>{let{size:t,mobileSize:n}=(0,o.hx)(e);return{fontSize:n?["".concat(n,"em"),"".concat(t,"em")]:"".concat(t,"em"),"@media print":{fontSize:"".concat(t,"em")},lineHeight:e&&(0,o.qx)(e)?1.25:i}},l={};Object.keys((0,r.yw)()).forEach(e=>{let t=a(e);l['[data-font-size="'.concat(e,'"]')]=t})},43298:function(e,t,n){"use strict";n.d(t,{Aw:function(){return a},hx:function(){return o},qx:function(){return l}});var r=n(98314);let o=e=>null==e||void 0==e?(0,r.yw)().default:(0,r.yw)()[e]||(0,r.yw)().default,i=e=>{var t;return null===(t=Object.entries((0,r.yw)()).find(t=>{let[n,r]=t;return"heading"===r.type&&r.level==e}))||void 0===t?void 0:t[0]},a=e=>"heading"===e.type.name?i(e.attrs.level):"title"===e.type.name?"title":e.attrs.fontSize,l=e=>{let{type:t}=o(e);return"heading"===t||"title"===t}},96693:function(e,t,n){"use strict";n.d(t,{AW:function(){return m},H:function(){return p},NX:function(){return c},RV:function(){return u},t0:function(){return d}});var r=n(54073),o=n.n(r),i=n(37164),a=n(27191),l=n(91994),s=n(47968);let d=(e,t)=>{let n=(0,l.bh)(),r=t?{noteId:e}:{noteId:null};n.dispatch((0,s.K7)(r));let o=n.getState();!t&&(0,s.tY)(o)&&n.dispatch((0,s.AK)({isEditingMedia:!1})),!t&&(0,s._I)(o)&&n.dispatch((0,s.RW)({nodeId:null}))},c=o()(d,30),u=()=>{let e=(0,l.bh)().getState();return(0,s.II)(e)},p=()=>(0,i.x0)(5),m=e=>e instanceof a.qv&&"footnote"===e.node.type.name},35251:function(e,t,n){"use strict";n.d(t,{e:function(){return r},z:function(){return o}});let r="fromInnerEditor",o="fromOuterEditor"},3452:function(e,t,n){"use strict";n.d(t,{M:function(){return i},W:function(){return a}});var r=n(26151),o=n(35251);let i=e=>"footnote"==e.schema.topNodeType.name,a=function(e,t,n,i){let a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"footnote";e.forEach(e=>{let t=e.steps.filter(e=>e instanceof r.WJ||e instanceof r.xu);0==t.length||e.getMeta(o.e)||e.getMeta("appendedTransaction")||t.forEach(e
1=>{let{from:t,to:o,mark:l}=e;n.doc.nodesBetween(t,o,(n,s)=>{n.type.name===a&&s<t&&(e instanceof r.WJ?i.removeMark(t,o,l):e instanceof r.xu&&i.addMark(t,o,l))})})})}},28041:function(e,t,n){"use strict";n.d(t,{U:function(){return o}});var r=n(39949);let o=r.U.extend({addKeyboardShortcuts(){return{"Shift-Enter":()=>this.editor.commands.setHardBreak()}}})},85818:function(e,t,n){"use strict";n.d(t,{X6:function(){return x},MQ:function(){return f}});var r=n(71391),o=n(90507),i=n(47577),a=n(86353),l=n(52322),s=n(73200),d=n(87254),c=n(27333),u=n(4030),p=n(77381),m=n(17630);let h=e=>{let{node:t,decorations:n}=e,{level:r,horizontalAlign:i,placeholder:a}=t.attrs,h=(0,p.V)(n),g=a||(h?d.ag._({id:"gLDJuJ"}):d.ag._({id:"1nLERW",values:{level:r}}));return(0,l.jsx)(u.lO,{...e,style:{display:"flex",flexDirection:"column",...(0,m.nN)(i)},children:(0,l.jsx)(o.ms,{level:r,"data-placeholder":g,className:(0,s.cx)("heading",c.A8),style:{minWidth:"min(100%, 10em)"}})})},g=[1,2,3,4],f=Math.max(...g),x=r.X.extend({selectable:!1,group:"block cardNotesBlock",addAttributes:()=>({level:{default:1,rendered:!1}}),addNodeView:()=>(0,o.fW)(h,{update:a.E7}),addInputRules(){return this.options.levels.map(e=>(0,i.Wy)({find:new RegExp("^(#{1,".concat(e,"}
1)\\s$")),type:this.type,getAttributes:{level:e}},[this.editor.state.schema.nodes.bullet,this.editor.state.schema.nodes.numbered,this.editor.state.schema.nodes.todo]))}}).configure({levels:g})},17630:function(e,t,n){"use strict";n.d(t,{Ec:function(){return x},Kq:function(){return h},ZE:function(){return u},nN:function(){return p},yg:function(){return m}});var r=n(42946),o=n(87254),i=n(72338),a=n(27191),l=n(11093),s=n(19283);let d=["paragraph","heading","title","drawing","diagram","image","contributors","mediaPlaceholder","buttonGroup","navbarLinks","gallery"],c=["left","right","center"],u=e=>c.find(t=>e.isActive({horizontalAlign:t})),p=e=>{let t=m(e);return{textAlign:e||void 0,alignItems:t||"var(--flex-align)","--flex-align":t}},m=e=>{if(e)return({left:"flex-start",center:"center",right:"flex-end"})[e]},h=i.hj.create({name:"horizontalAlign",priority:s.a.HorizontalAlign,addOptions:()=>({types:d,alignments:c,defaultAlignment:null}),addGlobalAttributes(){return[{types:this.options.types,attributes:{horizontalAlign:{default:this.options.defaultAlignment,keepOnSplit:!0,parseHTML:e=>e.style.textAlign||e.getAttribute("align")||this.options.defaultAlignment,renderHTML:e=>e.horizontalAlign?{style:"text-align: ".concat(e.horizontalAlign)}:{}}}}]},addCommands:()=>({toggleHorizontalAlign:e=>t=>{let{tr:n,dispatch:r,state:o,editor:i}=t;if(!r)return!0;let a=g(i,e),l=a?null:e;return n.selection.ranges.forEach(e=>{let t=e.$from.pos,r=e.$to.pos;o.doc.nodesBetween(t,r,(e,t)=>{if("footnote"===e.type.name)return!1;d.includes(e.type.name)&&n.setNodeMarkup(t,void 0,{...e.attrs,horizontalAlign:l}).setMeta("annotationEvent",{type:"update-node-attrs",pos:t})})}),!0}}),addKeyboardShortcuts(){return{"Mod-Shift-l":()=>this.editor.commands.toggleHorizontalAlign("left"),"Mod-Shift-e":()=>this.editor.commands.toggleHorizontalAlign("center"),"Mod-Shift-r":()=>this.editor.commands.toggleHorizontalAlign("right"),Backspace:()=>{let{selection:e}=this.editor.state;if(!(e instanceof a.Bs)||!e.empty)return!1;let t=e.$from.parent;return!!d.includes(t.type.name)&&!!t.isTextblock&&!(t.nodeSize>2)&&t.attrs.horizontalAlign!=this.options.defaultAlignment&&this.editor.commands.toggleHorizontalAlign(this.options.defaultAlignment)}}}}),g=(e,t)=>{let n=c.filter(e=>e!==t);return e.isActive({horizontalAlign:t})&&!n.some(t=>e.isActive({horizontalAlign:t}))},f=e=>!(0,l.V2)(e,"horizontalAlign"),x=[{key:"alignLeft",name:()=>o.ag._({id:"VjjKVj"}),icon:r.elf,checkActive:e=>g(e,"left"),checkDisabled:f,apply:e=>e.chain().toggleHorizontalAlign("left").run(),shortcut:"Mod+Shift+L",enabledForTables:!0,alignment:"left"},{key:"alignCenter",name:()=>o.ag._({id:"95ckMP"}),icon:r.MB3,checkActive:e=>g(e,"center"),checkDisabled:f,apply:e=>e.chain().toggleHorizontalAlign("center").run(),shortcut:"Mod+Shift+E",enabledForTables:!0,alignment:"center"},{key:"alignRight",name:()=>o.ag._({id:"vTKw81"}),icon:r.S3c,checkActive:e=>g(e,"right"),checkDisabled:f,apply:e=>e.chain().toggleHorizontalAlign("right").run(),shortcut:"Mod+Shift+R",enabledForTables:!0,alignment:"right"}]},89484:function(e,t,n){"use strict";n.d(t,{D:function(){return o}});var r=n(15690);let o=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=t.nodeAfter;if(!o)return!1;e.deleteRange(t.pos,t.pos+o.nodeSize);let i=e.doc.nodeAt(t.pos),a=t.pos,l=1;(!n&&t.nodeBefore||n&&!i&&t.nodeBefore)&&(a=t.pos-t.nodeBefore.nodeSize,l=-1);let s=e.doc.resolve(a+1),d=(0,r.E)(e.doc.resolve(l>0?s.pos:s.end()),l);return d&&e.setSelection(d),!0}},71986:function(e,t,n){"use strict";n.d(t,{h:function(){return r},x:function(){return o}});let r=4,o={type:"gridCell",content:[{type:"paragraph"}]}},35503:function(e,t,n){"use strict";n.d(t,{BF:function(){return d},SA:function(){return l},TH:function(){return f},Tl:function(){return b},_5:function(){return s},oc:function(){return x},ug:function(){return y}});var r=n(72338),o=n(11093);let i=["card","document","gridLayout","gallery"],a=e=>e.isBlock&&!i.includes(e.type.name)&&!(e.isTextblock&&(0,o.bR)(e)),l=e=>"gridLayout"===e.type.name,s=e=>"gridCell"===e.type.name,d=(e,t,n,r)=>{let o=n&&c(e,n,t);if(o)return o;if(n&&!h(n,e.state.schema)||r)return null;let i=u(e,t,"right")||u(e,t,"left");return!i||n&&n.content.firstChild===i.node?null:i},c=(e,t,n)=>{var i;if(!g(t,e.state.schema))return null;
1let a=null===(i=e.posAtCoords({left:n.clientX,top:n.clientY}))||void 0===i?void 0:i.inside;if(!a||-1==a)return null;let{doc:l}=e.state,d=l.resolve(a),c=l.nodeAt(a),u=c&&s(c)?{node:c,pos:a}:(0,r.qv)(d,s),p=(null==u?void 0:u.pos)&&(0,o.Fu)(u.pos,e);if(!u||!p)return null;let m=n.clientX>p.left+p.width/2?"right":"left";return{pos:u.pos,node:u.node,rect:p,side:m}},u=(e,t,n)=>{var i;let l=null===(i=e.posAtCoords({left:t.clientX+("left"==n?40:-40),top:t.clientY}))||void 0===i?void 0:i.inside;if(!l||-1==l)return null;let{doc:s,schema:d}=e.state,c=s.resolve(l),u=s.nodeAt(l),h=u&&a(u)?{node:u,pos:l}:(0,r.qv)(c,a);if(!h)return null;let g=(0,o.Fu)(l,e);if(!g)return null;let f="left"==n?t.clientX-g.left:g.right-t.clientX,x=f<0,v=x&&f>-40||"right"==n&&f<(g.right-g.left)*.15;if(!v)return null;let b=s.resolve(h.pos),y=(null==u?void 0:u.type.name)==="gridCell"&&p(b,d)||m(b,d);if(x||!y){let t=(0,r.qv)(c,e=>"gridCell"===e.type.name);if(t&&p(s.resolve(t.pos),d)){let r=(0,o.Fu)(t.pos,e);return r?{pos:t.pos,node:t.node,side:n,rect:r}:null}}return y?{pos:h.pos,rect:g,node:h.node,side:n}:null},p=(e,t)=>e.parent.canReplaceWith(e.index(),e.index(),t.nodes.gridCell),m=(e,t)=>e.parent.canReplaceWith(e.index(),e.indexAfter(),t.nodes.gridLayout),h=(e,t)=>t.nodes.gridCell.validContent(e.content),g=(e,t)=>t.nodes.gridLayout.validContent(e.content),f=e=>v(e,"gridLayout"),x=e=>{let t=v(e,"gridLayout");if(!t||!t.nodeAfter)throw Error();let n=t.nodeAfter,r=[],o=t.start(t.depth+1);for(let e=0;e<n.childCount;e++){let t=n.child(e);o+=0===e?0:n.child(e-1).nodeSize,r.push({node:t,pos:o})}return r},v=(e,t)=>{var n;if((null===(n=e.nodeAfter)||void 0===n?void 0:n.type.name)===t)return e;let r=e.doc;for(let n=e.depth;n>0;n--)if(e.node(n).type.name===t)return r.resolve(e.before(n));return null},b=(e,t)=>{let n=x(e),r=n[-1===t?n.length-1:t];return r?e.doc.resolve(r.pos):null},y=e=>{let t=x(e);return t.findIndex(t=>t.pos===e.pos)}},26737:function(e,t,n){"use strict";n.d(t,{v:function(){return r}});let r=["tel","mailto"]},50322:function(e,t,n){"use strict";n.d(t,{r:function(){return L}});var r=n(70675),o=n(27191),i=n(42111),a=n(11093),l=n(90221),s=n(90439),d=n(96374),c=n(19283),u=n(29596),p=n(66855),m=n(26737),h=n(91994),g=n(47968),f=n(71173);let x=e=>new o.Sy({key:new o.H$("handleCmdClickLink"),props:{handleDOMEvents:{click:(t,n)=>{var r;let o=(0,h.bh)(),i=(0,g.hN)(o.getState()),l=null===(r=n.target)||void 0===r?void 0:r.closest("a"),s=null==l?void 0:l.href;if(!s||(null==l?void 0:l.closest("[data-comments-wrapper]")))return!1;n.preventDefault();let d=n.ctrlKey||n.metaKey,c=(0,a.g)(s),u=(0,g.xb)(o.getState()),p=(0,a.NC)(s,u);
1if(i){if(!d)return!1;if(p)return(0,f.l)(e,n,c),!1}else if(!d&&p)return(0,f.l)(e,n,c),!1;return window.open(s,"_blank"),!1}}}});var v=n(52322),b=n(28535),y=n(77533),C=n(332),w=n(11881),k=n(38045),j=n(25925),S=n(2784),A=n(26803),I=n(50788),E=n(90507),z=n(93441),T=n(78277);let N=(0,k.E)(b.xu),M=e=>{let{node:t,children:n}=e,{href:r,meta:o}=t.attrs,i=(0,h.CG)(g.hN),a=(0,I.C7)(),{linkUrl:s,handleClick:d}=(0,A.H)({url:r||""}),c=(0,S.useCallback)(e=>{null==d||d(e),i&&e.preventDefault()},[i,d]),{popperRef:u,referenceRef:p,isHovering:m,onMouseOver:f,onMouseOut:x,getPopperProps:b}=(0,z.Ux)();return(0,v.jsxs)(E.T5,{as:"span",children:[(0,v.jsxs)(y.x,{as:"a",className:"link",href:s,onClick:c,onMouseOver:f,onMouseOut:x,ref:p,children:[(0,l.i7)()&&(0,v.jsx)("span",{contentEditable:!1,children:"â"}),a?n:(0,v.jsx)(E.ms,{as:"span"}),(0,l.i7)()&&(0,v.jsx)("span",{contentEditable:!1,children:"â"})]}),!1===a&&m&&s&&o?(0,v.jsx)(C.h,{children:(0,v.jsx)(j.M,{children:(0,v.jsx)(N,{position:"relative",zIndex:"popover",ref:u,onMouseOver:f,onMouseOut:x,className:"link-preview-hover",...b(),...z.rc,w:"min(500px, 80vw)",minW:"auto !important",children:(0,v.jsxs)(w.f,{backgroundColor:"white",border:"1px solid",borderColor:"gray.200",shadow:"lg",borderRadius:"lg",_hover:{backgroundColor:"trueblue.50"},children:[(0,v.jsx)(T.fu,{node:t}),(0,v.jsx)(w.A,{href:s,target:"_blank"})]})})})}):null]})};var _=n(84875);let L=r.Z.extend({priority:c.a.Link,inclusive:!1,excludes:"underline footnoteLabel link",addAttributes:()=>({href:{default:""},source:{},thumbnail:{...(0,a.sw)("thumbnail")},embed:{...(0,a.sw)("embed")},meta:{...(0,a.sw)("meta")}}),addCommands(){var e;return{...null===(e=this.parent)||void 0===e?void 0:e.call(this),convertLinkToMedia:e=>t=>{let{chain:n,editor:r}=t,{href:o,...i}=r.getAttributes("link");if(!o||(0,_.H7)(o))return!1;if(!i.source)return n().extendMarkRange("link").insertEmbedAndFetchMetadata(o,e,!1).run(),!0;let a=u.ah[i.source],l=(null==a?void 0:a.nodeName)||"embed";return n().extendMarkRange("link").insertContent({type:l,attrs:{...i,sourceUrl:o,url:o,displayStyle:e}}).selectInsertedNode().run(),!0},convertMediaToLink:()=>e=>{let{state:t,chain:n}=e;if(!(t.selection instanceof o.qv))return!1;let{from:r,to:i,node:a}=t.selection;if(!(0,p.Bp)(a))return!1;let{sourceUrl:l,meta:s}=a.attrs,d=(null==s?void 0:s.title)||l||"link",c={from:r+1,to:r+1+d.length};return n().insertContentAt({from:r,to:i},[{type:"paragraph",attrs:{},content:[{type:"text",text:d}]}],{updateSelection:!0}
1).setTextSelection(c).setMark(L.name,{...a.attrs,href:l}).run(),!0},updateSurroundingLink:e=>t=>{let{state:n,chain:r,editor:o}=t,{from:i,to:a}=n.selection;return(0,_.m7)(e,o),r().extendMarkRange("link").updateAttributes("link",{href:e}).setMeta("preventAutolink",!0).setTextSelection({from:i,to:a}),!0},removeSurroundingLink:()=>e=>{let{state:t,chain:n}=e,{from:r,to:o}=t.selection;return n().extendMarkRange("link").unsetMark("link").setMeta("preventAutolink",!0).setTextSelection({from:r,to:o}).focus(),!0}}},addKeyboardShortcuts(){return{"Mod-k":e=>{let{editor:t}=e,{selection:n}=t.state;return!n.empty&&t.commands.toggleMark(this.name)}}},addProseMirrorPlugins(){var e;let t=(null===(e=this.parent)||void 0===e?void 0:e.call(this))||[];return!(0,l.f_)()&&i.VH.get("linkMetadata")&&!s.cx&&t.push((0,d.r)(this,M)),t.push(x(this.editor)),t}}).configure({HTMLAttributes:{target:"_blank",rel:"noopener noreferrer",class:"link"},validate:_.DE,protocols:m.v,linkOnPaste:!1})},71173:function(e,t,n){"use strict";n.d(t,{l:function(){return a}});var r=n(34881),o=n(11093),i=n(7628);let a=(e,t,n)=>{if(!n)return;let a=(0,o.lI)(e,100);a&&(0,r.lO)({data:{fromPos:a.pos,fromPct:a.pct},emitChange:!1}),(0,i.D)({cardId:n,method:"push",data:{fromPos:null,fromPct:null}})}},84875:function(e,t,n){"use strict";n.d(t,{DE:function(){return a},H7:function(){return d},Td:function(){return s},m7:function(){return l}});var r=n(13833),o=n(83440),i=n(26737);let a=e=>{let t=!e.includes("://");return!t},l=(e,t)=>{d(e)||(0,r.ft)(e,n=>{let{doc:r,schema:i,tr:a}=t.state;(0,o.Nv)(r,t.schema.marks.link).forEach(t=>{let{node:r,pos:o}=t,l=r.marks.find(t=>"link"===t.type.name&&t.attrs.href==e);l&&a.removeMark(o,o+r.nodeSize,l).addMark(o,o+r.nodeSize,i.marks.link.create({...l.attrs,...n}))}),t.view.dispatch(a)}).catch(e=>{console.error("[Link.fetchUrlThenUpdateMarks]",e)})},s=e=>e.attrs.source||e.attrs.meta||e.attrs.embed,d=e=>{if(!e)return!1;let t=e&&e.toLowerCase();for(let e of i.v)if(t.startsWith(e+":"))return!0;return!1}},88959:function(e,t,n){"use strict";n.d(t,{Z:function(){return m},Q:function(){return h}});var r=n(72338);n(89902);var o=n(88892),i=n(27191),a=n(42111);let l=r.NB.create({name:"math_display",group:"block math",content:"text*",atom:!0,code:!0,renderHTML(e){let{HTMLAttributes:t}=e;return["math-display",(0,r.P1)(t,{class:"math-node"}),0]},parseHTML:()=>[{tag:"math-display"}]});var s=n(16190);let d=r.NB.create({name:"math_inline",group:"inline math",content:"text*",inline:!0,atom:!0,renderHTML(e){let{HTMLAttributes:t}=e;return["math-inline",(0,r.P1)(t,{class:"math-node"}),0]},parseHTML:()=>[{tag:"math-inline"}],addCommands(){return{insertMathInline:()=>e=>{let{state:t,dispatch:n,view:r}=e;return(0,s.$O)(this.type," ")(t,n,r)},convertToMathInline:()=>e=>{let{state:t,chain:n}=e,r=t.doc.textBetween(t.selection.from,t.selection.to);return n().insertContent({type:"math_inline",content:[{type:"text",text:r}]}).run(),!0}}}}),c=/\$([^ $]+)\$[ ]$/,u=/^\${2}\s+$/,p=/^\${2}(.+)\${2}$/,m=r.hj.create({name:"math",addExtensions:()=>[d,l],addProseMirrorPlugins(){let e=a.VH.get("math"),t=e?[new i.Sy({props:{clipboardTextSerializer:e=>s.qk.serializeSlice(e)}}),(0,o.Hw)({rules:[(0,s.Yx)(u,this.editor.schema.nodes.math_display),(0,s.Yx)(p,this.editor.schema.nodes.math_display),(0,s.Oi)(c,this.editor.schema.nodes.math_inline)]})]:[];return[(0,s.c1)({undo:()=>this.editor.commands.undo(),redo:()=>this.editor.commands.redo()})].concat(t)}}),h=e=>"math_display"===e.type.name||"math_inline"===e.type.name},16190:function(e,t,n){"use strict";let r;n.d(t,{$O:function(){return z},Yx:function(){return A},Oi:function(){return S},Ly:function(){return w},c1:function(){return m},qk:function(){return T}});var o=n(27191),i=n(52780),a=n(26151),l=n(17890),s=n(60737);function d(e,t,n){let r=!(arguments.length>3)||void 0===arguments[3]||arguments[3];return(i,a)=>{let l=e.state,{to:s,from:d}=l.selection,{to:c,from:u}=i.selection;if(r&&c!==u)return!1;let p=t>0?c:u;if(n){let e=i.doc.nodeSize-2;if(t>0&&p<e||t<0&&p>0)return!1}if(a){let n=t>0?s:d;e.dispatch(l.tr.setSelection(o.Bs.create(l.doc,n))),e.focus()}return!0}}class c{destroy(){this.closeEditor(!1),this._mathRenderElt&&(this._mathRenderElt.remove(),delete this._mathRenderElt),this._mathSrcElt&&(this._mathSrcElt.remove(),delete this._mathSrcElt),this.dom.remove()}ensureFocus(){this._innerView&&this._outerView.hasFocus()&&this._innerView.focus()}update(e,t){if(!e.sameMarkup(this._node))return!1;if(this._node=e,this._innerView){let t=this._innerView.state,n=e.content.findDiffStart(t.doc.content);if(null!=n){let r=e.content.findDiffEnd(t.doc.content);if(r){let{a:o,b:i}=r,a=n-Math.min(o,i);a>0&&(o+=a,i+=a),this._innerView.dispatch(t.tr.replace(n,i,e.slice(n,o)).setMeta("fromOutside",!0))}}}return this._isEditing||this.renderMath(),!0}updateCursorPos(e){let t=this._getPos(),n=this._node.nodeSize,r=e.selection.from<t+n&&t<e.selection.to;r||(this.cursorSide=t<e.selection.from?"end":"start")}selectNode(){this._outerView.editable&&(this.dom.classList.add("ProseMirror-selectednode"),this._isEditing||this.openEditor())}deselectNode(){this.dom.classList.remove("ProseMirror-selectednode"),this._isEditing&&this.closeEditor()}stopEvent(e){return void 0!==this._innerView&&void 0!==e.target&&this._innerView.dom.contains(e.target)}ignoreMutation(){return!0}renderMath(){if(!this._mathRenderElt)return;let e=this._node.content.content,t="";if(e.length>0&&null!==e[0].textContent&&(t=e[0].textContent.trim()),t.length<1){for(this.dom.classList.add("empty-math");this._mathRenderElt.firstChild;)this._mathRenderElt.firstChild.remove();return}if(this.dom.classList.remove("empty-math"),!r){this._mathRenderElt.textContent=t;return}try{r.render(t,this._mathRenderElt,this._katexOptions),this._mathRenderElt.classList.remove("parse-error"),this.dom.setAttribute("title","")}catch(e){if(e instanceof Error)console.error(e),this._mathRenderElt.classList.add("parse-error"),this.dom.setAttribute("title",e.toString());else throw e}}
1dispatchInner(e){if(!this._innerView)return;let{state:t,transactions:n}=this._innerView.state.applyTransaction(e);if(this._innerView.updateState(t),!e.getMeta("fromOutside")){let e=this._outerView.state.tr,t=a.KS.offset(this._getPos()+1);for(let r=0;r<n.length;r++){let o=n[r].steps;for(let n=0;n<o.length;n++){let r=o[n].map(t);if(!r)throw Error("step discarded!");e.step(r)}}e.docChanged&&this._outerView.dispatch(e)}}openEditor(){var e;this._innerView&&this.closeEditor(!1),this._innerView=new i.tk(this._mathSrcElt,{state:o.yy.create({doc:this._node,plugins:[(0,l.h)({Tab:(e,t)=>(t&&t(e.tr.insertText(" ")),!0),Backspace:(0,s.QF)(s.NE,(e,t,n)=>!!e.selection.empty&&!(this._node.textContent.length>0)&&(this._outerView.dispatch(this._outerView.state.tr.insertText("")),this._outerView.focus(),!0)),"Ctrl-Backspace":(e,t,n)=>(this._outerView.dispatch(this._outerView.state.tr.insertText("")),this._outerView.focus(),!0),Enter:(0,s.QF)(s.QK,d(this._outerView,1,!1)),"Ctrl-Enter":d(this._outerView,1,!1),ArrowLeft:d(this._outerView,-1,!0),ArrowRight:d(this._outerView,1,!0),ArrowUp:d(this._outerView,-1,!0),ArrowDown:d(this._outerView,1,!0),"Mod-z":this._options.undo,"Shift-Mod-z":this._options.redo})]}),dispatchTransaction:this.dispatchInner.bind(this)});let t=this._innerView.state;this._innerView.focus();let n=null===(e=this._mathPluginKey.getState(this._outerView.state))||void 0===e?void 0:e.prevCursorPos;null==n&&console.error("[prosemirror-math] Error: Unable to fetch math plugin state from key.");let r=(null!=n?n:0)<=this._getPos()?0:this._node.nodeSize-2;this._innerView.dispatch(t.tr.setSelection(o.Bs.create(t.doc,r))),this._isEditing=!0}closeEditor(){let e=!(arguments.length>0)||void 0===arguments[0]||arguments[0];this._innerView&&(this._innerView.destroy(),this._innerView=void 0),e&&this.renderMath(),this._isEditing=!1}constructor(e,t,o,i={},a,l){n.e(4620).then(n.bind(n,66929)).then(e=>{r=e.default,this.renderMath()}),this._node=e,this._outerView=t,this._getPos=o,this._onDestroy=l&&l.bind(this),this._mathPluginKey=a,this.cursorSide="start",this._isEditing=!1,this._options=i,this._katexOptions=Object.assign({globalGroup:!0,throwOnError:!1},i.katexOptions),this._tagName=i.tagName||this._node.type.name.replace("_","-"),this.dom=document.createElement(this._tagName),this.dom.classList.add("math-node"),this._mathRenderElt=document.createElement("span"),this._mathRenderElt.textContent="",this._mathRenderElt.classList.add("math-render"),this.dom.appendChild(this._mathRenderElt),this._mathSrcElt=document.createElement("span"),this._mathSrcElt.classList.add("math-src"),this.dom.appendChild(this._mathSrcElt),this.dom.addEventListener("click",()=>this.ensureFocus()),this.renderMath()}}let u=new o.H$("prosemirror-math");function p(e,t){return(n,r,o)=>{let i=u.getState(r.state);if(!i)throw Error("no math plugin!");let a=i.activeNodeViews,l=new c(n,r,o,{katexOptions:{displayMode:e,macros:i.macros},...t},u,()=>{a.splice(a.indexOf(l))});return a.push(l),l}}let m=e=>new o.Sy({key:u,state:{init:(e,t)=>({macros:{},activeNodeViews:[],prevCursorPos:0}),apply:(e,t,n,r)=>({activeNodeViews:t.activeNodeViews,macros:t.macros,prevCursorPos:n.selection.from})},props:{nodeViews:{math_inline:p(!1,e),math_display:p(!0,e)}}});var h=n(30764);function g(e,t){return h.HY.from(t.text(e))}function f(e){var t;let n=e.querySelector("img.mwe-math-fallback-image-inline[alt]");return null!==(t=null==n?void 0:n.getAttribute("alt"))&&void 0!==t&&t}function x(e){var t;let n=e.querySelector("math[alttext]");return null!==(t=null==n?void 0:n.getAttribute("alttext"))&&void 0!==t&&t}function v(e){var t;let n=e.querySelector("math annotation[encoding='application/x-tex'");return null!==(t=null==n?void 0:n.textContent)&&void 0!==t&&t}function b(e){return function(e,t){for(let n of t){let t=n(e);if(!1!==t)return t}return!1}(e,[f,x,v])}let y=[{tag:"span",getAttrs:e=>!!e.classList.contains("mwe-math-element")&&null,getContent:(e,t)=>g(b(e)||"\\text{\\color{red}(paste error)}",t)}],C=[{tag:"dl",getAttrs(e){if(1!==e.childElementCount)return!1;let t=e.firstChild;return!!("DD"===t.tagName&&1===t.childElementCount&&t.firstChild.classList.contains("mwe-math-element"))&&null},getContent:(e,t)=>
1g(b(e)||"\\text{\\color{red}(paste error)}",t)}];[...y],[...C],()=>["math-select",0];let w=(e,t)=>{let{$from:n}=e.selection,r=n.nodeBefore;if(!r)return!1;if("math_inline"==r.type.name){let r=n.index(n.depth),i=e.doc.resolve(n.posAtIndex(r-1));return t&&t(e.tr.setSelection(new o.qv(i))),!0}return r.type.name,!1};var k=n(88892);let j=/\$(.+)\$/;function S(e,t,n){return new k.VK(e,(e,r,o,i)=>{let a=e.doc.resolve(o),l=a.index(),s=e.doc.resolve(i),d=n instanceof Function?n(r):n;if(!a.parent.canReplaceWith(l,s.index(),t))return null;let c=[t.create(d,t.schema.text(r[1]))];if(r[0].endsWith(" ")){let n=e.doc.textBetween(i,i+1);" "!==n&&c.push(t.schema.text(" "))}return e.tr.replaceWith(o,i,c)})}function A(e,t,n){return new k.VK(e,(e,r,i,a)=>{let l=e.doc.resolve(i),s=n instanceof Function?n(r):n;if(!l.node(-1).canReplaceWith(l.index(-1),l.indexAfter(-1),t))return null;let d=e.tr.delete(i,a).setBlockType(i,i,t,s);return r[1]&&d.insertText(r[1],i,i),d.setSelection(o.qv.create(d.doc,d.mapping.map(l.pos-1)))})}(()=>{try{return RegExp("(?<!\\\\)\\$(.+)(?<!\\\\)\\$")}catch(e){return j}})();let I=e=>{let{from:t,to:n}=e.selection,r=e.selection.content().content,o=[];return r.descendants((e,n,r)=>
1"text"!=e.type.name&&(!e.type.name.startsWith("math_")||(o.push({start:Math.max(t+n-1,0),end:t+n+e.nodeSize-1}),!1))),i.EH.create(e.doc,o.map(e=>{let{start:t,end:n}=e;return i.p.node(t,n,{class:"math-select"})}))},E=new o.Sy({state:{init:(e,t)=>I(t),apply:(e,t)=>e.selection&&e.selectionSet?I(e):t},props:{decorations:e=>E.getState(e)}});function z(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return function(n,r){let{$from:i}=n.selection,a=i.index();if(!i.parent.canReplaceWith(a,a,e))return!1;if(r){let a=e.create({},t?n.schema.text(t):null),l=n.tr.replaceSelectionWith(a);r(l=l.setSelection(o.qv.create(l.doc,i.pos)))}return!0}}let T=new class{serializeFragment(e){let t;let n="",r=!0,o=e.size;return e.nodesBetween(0,o,(e,i)=>{let a=this.serializeNode(e);if(null!==a)return n+=a,!1;if(e.isText){var l;n+=(null===(l=e.text)||void 0===l?void 0:l.slice(Math.max(0,i)-i,o-i))||"",r=!1}else e.isLeaf&&t?(n+=t,r=!1):!r&&e.isBlock&&(n+="\n\n",r=!0)},0),n}serializeSlice(e){return this.serializeFragment(e.content)}serializeNode(e){let t=this.nodes[e.type.name];return void 0!==t?t(e):null}constructor(e,t){this.nodes={...null==t?void 0:t.nodes,...e.nodes},this.marks={...null==t?void 0:t.marks,...e.marks}}}({nodes:{math_inline:e=>"$".concat(e.textContent,"$"),math_display:e=>"\n\n$$\n".concat(e.textContent,"\n$$")}})},8904:function(e,t,n){"use strict";n.d(t,{f8:function(){return D},nk:function(){return F},s6:function(){return ei},cB:function(){return es}});var r=n(52322),o=n(77533),i=n(5740),a=n(42946),l=n(54933),s=n(94523),d=n(5879),c=n(72338),u=n(2784),p=n(48776),m=n(91994),h=n(50788),g=n(28535),f=n(49929);let x={card:a.lCX,doc:a.s2,user:a.IBq},v=e=>{let{type:t}=e,n=x[t];return(0,r.jsx)(g.xu,{as:"span",display:"inline-flex",className:"mention",minW:"5em",opacity:"0.6",borderRadius:"sm",color:"gray.800",children:(0,r.jsx)(g.xu,{display:"inline-flex",py:"0.125em",children:(0,r.jsx)(f.G,{icon:n,style:{marginLeft:"0.5em",alignSelf:"center"}})})})};var b=n(71173),y=n(90507),C=n(47968),w=n(90383),k=n(78462),j=n(19283),S=n(23450),A=n(86353),I=n(68292);let E=e=>{let{filterFn:t,getAttributesFn:n}=e;return e=>(0,I.S)({find:e=>{let n=[...e.matchAll(k.nP)];if(!n)return[];let r=n.map(e=>{var t;return{index:null!==(t=e.index)&&void 0!==t?t:-1,text:e[0],match:e}}).filter(e=>{let n=(0,k.Wp)(e.text),{cardId:r}=(0,k.sY)(e.text);return t(n,r,e)});return r},type:e,getAttributes:e=>{let t=(0,k.Wp)(e[0]),{cardId:r}=(0,k.sY)(e[0]);return n({match:e,docId:t,cardId:r})}})};var z=n(29117),T=n(11082),N=n(81540),M=n(39097),_=n.n(M),L=n(14274);let P={borderRadius:"md",padding:"0.05em 0.1em",display:"inline",color:"gray.800"},R=(0,u.forwardRef)((e,t)=>{let{mentionLabel:n,mentionIcon:i,mentionTargetUrl:a,onClick:l,hasError:s=!1,isSimpleLinkVersion:d=!1,...c}=e,u=d?_():"span";return(0,r.jsxs)(g.xu,{ref:t,position:"relative","data-selection-ring":!0,className:"mention",onClick:l,...P,color:s?"gray.600":P.color,...c,as:u,href:d?a:void 0,cursor:l||d?"pointer":"default",children:[(0,r.jsxs)(z.U,{display:"inline-flex",spacing:0,children:[i&&(0,r.jsx)(g.xu,{display:"inline-block",textAlign:"center",minWidth:4,children:(0,r.jsx)(f.G,{icon:i,fixedWidth:!0,size:"sm",style:{marginLeft:"0.1em",marginRight:"0.3em"}})}),(0,r.jsx)(o.x,{noOfLines:1,whiteSpace:"normal",wordBreak:"break-all",flex:1,lineHeight:"normal",children:n})]}),L.v.GAMMA_PUPPETEER_SERVICE&&a&&(0,r.jsx)(T.r,{href:a,h:"100%",w:"100%",position:"absolute",zIndex:"-10","data-pdf-link":!0,top:"0",left:"0"})]})});R.displayName="MentionTag";let H=()=>(0,r.jsx)(g.xu,{as:"span",className:"mention",...P,children:(0,r.jsx)(N.$,{size:"xs",opacity:"0.8",margin:"0 0.1em"})}),D="Untitled",O=e=>{let{node:t,editor:n}=e,{id:c}=t.attrs,g=(0,p.c)(c),f=(null==g?void 0:g.archived)===!1,x=null==g?void 0:g.title,v=(0,m.CG)(C.hN);(0,u.useEffect)(()=>{n.storage[F.name][c]=x},[x,n.storage,c]);let j=(0,u.useCallback)(e=>{(0,b.l)(n,e,c)},[n,c]),S=(0,h.C7)(),A=(0,u.useMemo)(()=>{let e=(0,k.gq)({cardId:c,docId:null==g?void 0:g.docId});return S?(0,w.Op)({url:e}):e},[c,null==g?void 0:g.docId,S]);return(0,r.jsx)(y.T5,{as:"span",children:f?(0,r.jsx)(R,{"data-testid":"card-mention",onClick:v?void 0:j,onDoubleClick:v?j:void 0,mentionLabel:x||D,mentionIcon:a.lCX,mentionTargetUrl:A}):(0,r.jsx)(s.kH,{label:(0,r.jsx)(o.x,{children:(0,r.jsx)(d.cC,{id:"HAIPtO",components:{0:(0,r.jsx)(i.T,{fontSize:"sm",color:"blackAlpha.800"})}})}),children:(0,r.jsx)(R,{"data-testid":"card-mention",hasError:!0,mentionLabel:"Cannot find referenced card",mentionIcon:l.QQm})})})},B=e=>(0,r.jsx)(y.T5,{as:"span",children:(0,r.jsx)(v,{type:"card"})}),F=c.NB.create({name:"cardMention",addStorage:()=>({}),addOptions:()=>({HTMLAttributes:{},suggestion:{char:S.p}}),priority:j.a.CardMention,group:"inline",inline:!0,selectable:!0,atom:!0,addAttributes:()=>({id:{default:null},docId:{default:null},mentionedById:{default:null}}
1),addPasteRules(){return[E({filterFn:(e,t)=>e===this.editor.gammaDocId&&!!t,getAttributesFn:e=>{let{docId:t,cardId:n}=e;return{id:n,docId:t}}})(this.type)]},addCommands(){return{addCardMention:(e,t)=>{let{id:n,docId:r,mentionedById:o}=e;return e=>{var i;let{state:a,chain:l}=e,s=a.selection.$to.nodeAfter,d=null==s?void 0:null===(i=s.text)||void 0===i?void 0:i.startsWith(" ");return d&&(t.to+=1),l().focus().insertContentAt(t,[{type:this.name,attrs:{id:n,docId:r,mentionedById:o}},{type:"text",text:" "}]).run(),!0}}}},parseHTML(){return[{tag:'a[data-type="'.concat(this.name,'"]'),priority:51}]},renderHTML(e){let{HTMLAttributes:t,node:n}=e,{id:r,docId:o}=n.attrs,i=this.storage[r]||D;return["a",(0,c.P1)({"data-type":this.name,href:(0,k.gq)({docId:o,cardId:r})},this.options.HTMLAttributes,t),i]},renderText(e){let{node:t}=e,{id:n,docId:r}=t.attrs,o=this.storage[n]||D,i=(0,k.gq)({docId:r,cardId:n});return"[".concat(o,"](").concat(i,")")},addNodeView(){return this.editor.isThumbnail?(0,y.fW)(B,{update:A.E7}):(0,y.fW)(O,{update:A.E7})}});var W=n(94199);let G="docMention";var U=n(332),V=n(38045),q=n(14223),$=n(16426),K=n(93202),Z=n(42111),Y=n(48832),X=n(26803),J=n(36651),Q=n(93441);let ee="Private ".concat(W.Yc),et=(0,V.E)(g.xu),en=e=>{var t,n;let{node:o,editor:i}=e,{id:l}=o.attrs,c=(0,Z.ye)("screenshotsEnabled"),p=(0,h.C7)(),{user:m}=(0,J.SE)(),[g]=(0,K.$4k)(),f=(0,Q.gF)(),{data:x,error:v,loading:b,subscribeToMore:C}=(0,K.y5Q)({variables:{id:l},skip:p||!l}),w=!!(!p&&m);(0,u.useEffect)(()=>{if(w)return C({document:K.dcb,variables:{id:l},updateQuery:(e,t)=>{let{subscriptionData:n}=t;return n.data&&n.data.doc?{doc:{...e.doc,...n.data.doc,__typename:"Doc"}}:e}})},[l,C,w]);let{title:j,createdTime:S,createdBy:A,editedTime:I,editors:E,docUser:z}=(null==x?void 0:x.doc)||{},{linkUrl:T,handleClick:N}=(0,X.H)({url:(0,k.Gn)({docId:l,docTitle:j,absolute:!0}),nonPublishedUrl:(0,k.Gn)({docId:l,docTitle:j})});(0,u.useEffect)(()=>{i.storage[G][l]=v?ee:j},[j,i.storage,l,v]);let M={src:c?null==x?void 0:null===(n=x.doc)||void 0===n?void 0:null===(t=n.titleCard)||void 0===t?void 0:t.previewUrl:$.Z.src,fallbackSrc:$.Z.src},_=e=>()=>{if(!m)return;let t={input:{docId:l,userId:m.id,favorited:e}};g({variables:t,update:(e,t)=>{let{data:n}=t;e.writeFragment({id:"Doc:".concat(l),fragment:K.VRt,data:{docUser:null==n?void 0:n.updateDocUser}})},optimisticResponse:{updateDocUser:{...z,favorited:t.input.favorited,__typename:"DocUser"}}})},{popperRef:L,referenceRef:P,isHovering:D,onMouseOver:O,onMouseOut:B,getPopperProps:F}=(0,Q.Ux)();return(0,r.jsxs)(y.T5,{as:"span",children:[b?(0,r.jsx)(H,{}):T?(0,r.jsx)(R,{onMouseOver:p?void 0:O,onMouseOut:p?void 0:B,onClick:N,ref:P,isSimpleLinkVersion:p,mentionLabel:j||"",mentionIcon:a.s2,mentionTargetUrl:T}):v?(0,r.jsx)(s.kH,{label:"You don't have access to the linked ".concat(W.Yc,". Try asking the owner of this ").concat(W.Yc," for access."),children:(0,r.jsx)(R,{hasError:!0,mentionLabel:ee,mentionIcon:a.byT})}):null,(0,r.jsx)(U.h,{children:D&&x&&x.doc&&!p&&(0,r.jsx)(et,{width:"320px","data-target-name":"doc-mention-popup",border:"1px solid",borderColor:"gray.200",borderRadius:"lg",overflow:"hidden",shadow:"lg",maxW:"80vw",zIndex:"tooltip",ref:L,onMouseOver:O,onMouseOut:B,...F(),...Q.rc,children:(0,r.jsx)(q.F7,{createdByYou:(null==A?void 0:A.id)===(null==m?void 0:m.id),title:j||"",timestampDescription:f?(0,r.jsx)(d.cC,{id:"yxz5Og",values:{0:(0,Y.Dw)(I)}}):"---",NextLink:null,href:T,onClick:N,id:l,createdByName:(null==A?void 0:A.displayName)||"",createdByEmail:(null==A?void 0:A.email)||"",createdByProfileImageUrl:(null==A?void 0:A.profileImageUrl)||"",createdTime:S,thumbnailImageUrl:M,editors:E,isFavorited:!!(null==z?void 0:z.favorited),onFavorite:_(new Date),onUnfavorite:_(null),menuEnabled:!1,openInNewWindow:!0})})})]})},er=e=>(0,r.jsx)(y.T5,{as:"span",children:(0,r.jsx)(v,{type:"doc"})}),eo="Unknown ".concat(W.Yc),ei=c.NB.create({name:G,addStorage:()=>({}),addOptions:()=>({HTMLAttributes:{},suggestion:{char:S.p}}),priority:j.a.DocMention,group:"inline",inline:!0,selectable:!0,atom:!0,addAttributes:()=>({id:{default:null},mentionedById:{default:null}}
1),addPasteRules(){return[E({filterFn:(e,t)=>e!==this.editor.gammaDocId||!t,getAttributesFn:e=>{let{docId:t}=e;return{id:t}}})(this.type)]},addCommands(){return{addDocMention:(e,t)=>{let{id:n,mentionedById:r}=e;return e=>{var o;let{state:i,chain:a}=e,l=i.selection.$to.nodeAfter,s=null==l?void 0:null===(o=l.text)||void 0===o?void 0:o.startsWith(" ");return s&&(t.to+=1),a().focus().insertContentAt(t,[{type:this.name,attrs:{id:n,mentionedById:r}},{type:"text",text:" "}]).run(),!0}}}},parseHTML(){return[{tag:'a[data-type="'.concat(this.name,'"]'),priority:51}]},renderHTML(e){let{HTMLAttributes:t,node:n}=e,r=this.storage[n.attrs.id]||eo;return["a",(0,c.P1)({"data-type":this.name,href:(0,k.Gn)({docId:n.attrs.id,absolute:!0})},this.options.HTMLAttributes,t),r]},renderText(e){let{node:t}=e,n=this.storage[t.attrs.id]||eo,r=(0,k.Gn)({docId:t.attrs.id,absolute:!0});return"[".concat(n,"](").concat(r,")")},addNodeView(){return this.editor.isThumbnail?(0,y.fW)(er,{update:A.E7}):(0,y.fW)(en,{update:A.E7})}}),ea=e=>{let{node:t}=e,{label:n}=t.attrs;return(0,r.jsx)(y.T5,{as:"span",children:(0,r.jsx)(R,{mentionLabel:"@".concat(n)})})},el=e=>(0,r.jsx)(y.T5,{as:"span",children:(0,r.jsx)(v,{type:"user"})}),es=c.NB.create({name:"mention",addOptions:()=>({HTMLAttributes:{},renderLabel(e){var t;let{options:n,node:r}=e;return"".concat(n.suggestion.char).concat(null!==(t=r.attrs.label)&&void 0!==t?t:r.attrs.id)},suggestion:{char:S.p}}),priority:j.a.UserMention,group:"inline",inline:!0,selectable:!0,atom:!0,addAttributes:()=>({id:{default:null,parseHTML:e=>e.getAttribute("data-id"),renderHTML:e=>e.id?{"data-id":e.id}:{}},label:{default:null,parseHTML:e=>e.getAttribute("data-label"),renderHTML:e=>e.label?{"data-label":e.label}:{}},profileImageUrl:{default:null,parseHTML:e=>e.getAttribute("data-profile-image-url"),renderHTML:e=>e.profileImageUrl?{"data-profile-image-url":e.profileImageUrl}:{}},mentionedById:{default:null,parseHTML:e=>e.getAttribute("data-mentioned-by-id"),renderHTML:e=>e.mentionedById?{"data-mentioned-by-id":e.mentionedById}:{}}}),addCommands(){return{addUserMention:(e,t)=>{let{id:n,label:r,profileImageUrl:o,mentionedById:i}=e;return e=>{var a;let{state:l,chain:s}=e,d=l.selection.$to.nodeAfter,c=null==d?void 0:null===(a=d.text)||void 0===a?void 0:a.startsWith(" ");return c&&(t.to+=1),s().focus().insertContentAt(t,[{type:this.name,attrs:{id:n,label:r,profileImageUrl:o,mentionedById:i}},{type:"text",text:" "}]).run(),!0}}}},parseHTML(){return[{tag:'span[data-type="'.concat(this.name,'"]')}]},renderHTML(e){let{node:t,HTMLAttributes:n}=e;return["span",(0,c.P1)({"data-type":this.name},this.options.HTMLAttributes,n),this.options.renderLabel({options:this.options,node:t})]},renderText(e){let{node:t}=e;return this.options.renderLabel({options:this.options,node:t})},addNodeView(){return this.editor.isThumbnail?(0,y.fW)(el,{update:A.E7}):(0,y.fW)(ea,{update:A.E7})}})},23450:function(e,t,n){"use strict";n.d(t,{p:function(){return W},L:function(){return G}});var r=n(27191),o=n(52322),i=n(77533),a=n(29117),l=n(109),s=n(38035),d=n(81540),c=n(42946),u=n(54933),p=n(49929),m=n(94523),h=n(5879),g=n(14304),f=n.n(g),x=n(82108),v=n.n(x),b=n(2784),y=n(93202),C=n(94199),w=n(20336),k=n(91994),j=n(31341),S=n(33374),A=n(36651),I=n(66028),E=n(47968);let z=(e,t,n)=>RegExp(t?e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"):e,n?"gu":"gui"),T="Type to mention a person or a ".concat(C.Yc),N=e=>{let{html:t}=e;return(0,o.jsx)(i.x,{paddingInlineStart:"0.2rem",wordBreak:"break-word",noOfLines:1,maxW:300,lineHeight:"1.5",dangerouslySetInnerHTML:{__html:t?f().sanitize(t):""}})},M=e=>e.replace(/(<em>|<\/em>)/g,""),_=e=>{let{result:t}=e,{__typename:n}=t;return"User"===n?(0,o.jsxs)(a.U,{children:[(0,o.jsx)(l.q,{size:"2xs",minWidth:4,m:0,name:t.displayName&&M(t.displayName),src:t.profileImageUrl}),(0,o.jsx)(N,{html:t.displayName})]}):"Card"===n?(0,o.jsxs)(a.U,{children:[(0,o.jsx)(s.k,{color:"gray.600",minWidth:4,justifyContent:"flex-end",children:(0,o.jsx)(p.G,{icon:u.nZ9,transform:{size:6}})}),(0,o.jsx)(N,{html:t.title})]}):"DocResult"===n?(0,o.jsx)(j.y5,{result:t,context:"mentionsList"}):(console.warn("[MentionList] Invalid __typename for search result:",t.__typename),null)},L=(0,b.forwardRef)((e,t)=>{let{result:n,index:r,selectedIndex:i,selectItem:a,...l}=e;return(0,o.jsx)(m.m9,{ref:t,tabIndex:r===i?0:-1,onClick:()=>a(r),onMouseDown:I.br,...l,children:(0,o.jsx)(_,{result:n})},r)}),P=(0,o.jsx)(p.G,{icon:c.lCX}),R=(0,o.jsx)(p.G,{icon:c.s2}),H=(0,o.jsx)(p.G,{icon:c.V3X}),D={Card:{title:(0,o.jsx)(h.cC,{id:"gXnPmp",values:{GAMMA_ARTIFACT_PROPER_NOUN:C.Yc}}),iconComponent:P},DocResult:{title:v()(C.aq),iconComponent:R},User:{title:(0,o.jsx)(h.cC,{id:"1wdjme"}),iconComponent:H}},O=(0,b.forwardRef)((e,t)=>{let{editor:n,query:r,command:l}=e,{isConnected:c}=(0,y.$gs)(),u=(0,k.CG)(e=>{var t;return((null===(t=(0,E.yx)(e))||void 0===t?void 0:t.collaborators)||[]).map(e=>e.user)}),p=!r||!n.gammaOrgId||!c,{data:g,previousData:f,error:x,loading:v}=function(e,t){let{isConnected:n}=(0,y.$gs)(),r=!e||!t||!n,o=(0,y.OY$)({variables:{workspaceId:t,types:[y.Sc3.User],query:e},skip:r}),i=(0,y.OY$)({variables:{workspaceId:t,types:[y.Sc3.Doc],query:e},skip:r});return function(e){function t(e,t,n){n&&(e[t]||(e[t]={search:[]}),e[t].search=[...e[t].search,...n.search])}let n=e.reduce((e,n)=>{let{data:r,previousData:o,error:i,loading:a}=n;return!r&&a&&o&&(r=o),t(e,"data",r),t(e,"previousData",o),a&&(e.loading=!0),i&&(e.error=i),e},{});return n}([o,i])}(r,n.gammaOrgId),{user:C}=(0,A.SE)(),{searchDocs:j,searchUsers:I}=(0,b.useMemo)(()=>{let e=z(r,!0,!1),t=(g?g.search:f?f.search:[]).filter(e=>"User"===e.__typename),n=(g?g.search:f?f.search:[]).filter(e=>"DocResult"===e.__typename),o=u.filter(e=>!t.find(t=>
1t.id===e.id)).filter(e=>{var t,n;return(null===(t=e.email)||void 0===t?void 0:t.startsWith(r.toLowerCase()))||(null===(n=e.displayName)||void 0===n?void 0:n.toLowerCase().includes(r.toLowerCase()))}),i=[...t,...o].map(t=>{var n;return{...t,displayName:null===(n=t.displayName)||void 0===n?void 0:n.replace(e,"<em>$&</em>")}});return{searchDocs:r?[...n]:[],searchUsers:r?i:[]}},[g,f,r,u]),{data:N}=(0,y.WHS)({variables:{docId:n.gammaDocId},skip:p,fetchPolicy:"cache-only",nextFetchPolicy:"cache-only",returnPartialData:!0}),_=(0,b.useMemo)(()=>{let e=z(r,!0,!1);return(null==N?void 0:N.docCards)&&r?N.docCards.map(t=>{let n=t.title||"";if(n.match(e)){let r=n.replace(e,"<em>$&</em>");return{...t,title:r}}return null}).filter(Boolean):[]},[N,r]),P=[...I,..._,...j],R=e=>{let t=P[e]?{...P[e]}:null;t&&("User"===t.__typename&&t.displayName&&(t.displayName=M(t.displayName)),l({item:t,user:C}))},{selectedIndex:H,selectedItemEl:O}=(0,S.Yg)({ref:t,selectItem:R,options:P}),B=n.state.selection,F=!B.$anchor.parent.isLeaf&&B.$anchor.parent.textContent===W;return 0===r.length&&F?(0,o.jsx)(s.k,{w:"100%",p:1,align:"flex-start",justify:"flex-start",flex:"1",mt:-9,ml:3,"data-testid":"mention-list-empty",children:(0,o.jsx)(i.x,{fontSize:"md",color:"gray.400",children:T})}):(0,o.jsx)(m.wb,{"data-testid":"mention-list",children:(0,o.jsxs)(m.Dw,{"data-target-name":"mention-list",w:"540px",maxW:"90vw",overflowY:"auto",maxH:"65vh",sx:{em:{bg:"var(--chakra-colors-trueblue-100)",fontStyle:"normal",borderRadius:"base",display:"inline-block",padding:"0px 2px",margin:"0px -2px"}},children:[(0,o.jsx)(w.V,{isConnected:c,label:(0,o.jsx)(h.cC,{id:"KnLL/m"})}),x?(0,o.jsx)(s.k,{p:1,align:"center",justify:"center",flex:"1",minH:12,children:(0,o.jsxs)(i.x,{fontSize:"sm",color:"gray.500",children:[(0,o.jsx)(h.cC,{id:"sBH7nV"}),x&&(null==x?void 0:x.message)]})}):0===r.length?(0,o.jsxs)(s.k,{p:1,align:"center",justify:"center",flex:"1",minH:12,"data-testid":"mention-list-empty",children:[(0,o.jsx)(i.x,{fontSize:"md",color:"gray.400",children:T})," "]}):!v&&r.length>1&&0===P.length?(0,o.jsx)(s.k,{p:1,align:"center",justify:"center",flex:"1",minH:12,children:(0,o.jsx)(i.x,{fontSize:"sm",color:"gray.500",children:"No results for this query."})}):null,P.map((e,t)=>{let n=P.findIndex(t=>t.__typename===e.__typename)===t,r=n&&e.__typename?D[e.__typename]:null;return(0,o.jsxs)(b.Fragment,{children:[r&&(0,o.jsxs)(a.U,{mt:4,mb:2,color:"gray.500",children:[r.iconComponent,(0,o.jsx)(m.NZ,{children:r.title})]}),(0,o.jsx)(L,{"data-testid":"mention-list-item-".concat(e.id),ref:t===H?O:null,result:e,index:t,selectedIndex:H,selectItem:R},t)]},e.id)}),v&&(0,o.jsx)(s.k,{p:1,align:"center",justify:"center",flex:"1",minH:12,children:(0,o.jsx)(d.$,{opacity:"0.8",size:"xs"})})]})})});var B=n(19283);let F=new r.H$("MentionGamma"),W="@",G=(0,S.ty)({name:"GammaMention",char:W,pluginKey:F,allowSpaces:!0,MenuComponent:O,priority:B.a.MentionSuggestionMenu,command:e=>{let{editor:t,range:n,props:r}=e,{item:o,user:i}=r;if("User"===o.__typename){let{id:e,displayName:r,profileImageUrl:a}=o,{id:l}=i;t.commands.addUserMention({id:e,label:r,profileImageUrl:a,mentionedById:l},n)}else if("Card"===o.__typename){let{id:e,docId:r}=o,{id:a}=i;t.commands.addCardMention({id:e,docId:r,mentionedById:a},n)}else if("DocResult"===o.__typename){let{id:e}=o,{id:r}=i;t.commands.addDocMention({id:e,mentionedById:r},n)}}})},41889:function(e,t,n){"use strict";n.d(t,{d:function(){return d}});var r=n(72338),o=n(27191),i=n(17487);let a=[i.HU],l=new o.H$("migrate"),s=new o.Sy({key:l,state:{init:()=>({hasRun:!1}),apply(e,t){let n=e.getMeta(l);return n||t}},appendTransaction:(e,t,n)=>{let r=l.getState(n);if(r.hasRun&&!e.some(e=>e.docChanged))return null;let{doc:o,tr:i,schema:s}=n,d=[];return(o.descendants((e,t,n)=>{d=a.map(r=>r({node:e,pos:t,tr:i,schema:s,parent:n}))}),!r.hasRun&&d.every(Boolean))?(i.setMeta(l,{hasRun:!0}),i):i.docChanged?i:null}}),d=r.hj.create({name:"migrate",addProseMirrorPlugins:()=>[s]})},74585:function(e,t,n){"use strict";n.d(t,{W:function(){return s}});var r=n(27191),o=n(5682),i=n(19283),a=n(33374);let l=new r.H$("SlashMenu"),s=(0,a.ty)({name:"slashMenu",char:"/",pluginKey:l,Me
1nuComponent:o.Z,priority:i.a.SlashMenu})},39951:function(e,t,n){"use strict";n.d(t,{z:function(){return T}});var r=n(72338),o=n(27191),i=n(5596),a=n(90507),l=n(11093),s=n(19283),d=n(89484),c=n(86353),u=n(23209),p=n(26282),m=n(37160),h=n(99914),g=n(26824);class f{constructor(e=null){this.dragging=e}}let x=new o.H$("smartLayoutPlugin"),v=e=>new o.Sy({key:x,state:{init:()=>new f,apply:(e,t)=>t},props:{decorations:e=>(0,h.r4)(e),handleDOMEvents:{drop(e){var t;let n=null===(t=e.dragging)||void 0===t?void 0:t.annotations,r=x.getState(e.state);if(!r)return!1;r.dragging=n}},handleDrop:(t,n,r)=>{let o=x.getState(t.state),i=null==o?void 0:o.dragging;return o&&(o.dragging=null),!!(y(e,t,n,r,i)||b(t,n,r))},handlePaste:(t,n,r)=>{let{selection:i}=t.state,a=i instanceof o.qv&&(0,p.E)(i.node);if(!a)return!1;let l=(0,m.O)(r);return!!l&&"image"===l.type.name&&e.commands.updateNestedAttributesAtPos(i.from,{image:l.attrs})}}}),b=(e,t,n)=>{let r=(0,g.fC)(e,t,n);if(!r)return!1;let o=e.state.tr;return o.setNodeAttribute(r.pos,"image",r.image),o.deleteSelection(),e.dispatch(o),!0},y=(e,t,n,r,o)=>{let i=null;try{if(!(i=(0,g.cQ)(t,n,r)))return!1}catch(e){return!1}try{let{selection:n}=t.state,a=!n.empty,{node:l,pos:s,side:d}=i;if(s>n.from&&s<n.to)return!0;let c=r.content.toJSON(),u="left"===d||"top"===d?s:s+l.nodeSize;e.chain().insertContentAt({from:u,to:u},c,{updateSelection:!1}).command(e=>{let{tr:t}=e;return a&&t.deleteSelection(),o&&t.setMeta("annotationEvent",{type:"drop",dragging:o,droppedBlockPos:u+1}),!0}).focusMapped(u,1).run()}catch(e){console.error("(caught) [SmartLayoutPlugin] handleDrop error:",e)}return!0};var C=n(52322),w=n(73200),k=n(87254),j=n(91994),S=n(47968),A=n(4030),I=n(86189),E=n(89064);let z=e=>{let{node:t,decorations:n}=e,r=t.attrs,o=(0,E.P)(r.variantKey),{Wrapper:i}=o,l=(0,h.Xo)(n),s=(0,g.jM)(r),d=(0,j.CG)(S.hN),c=(0,j.CG)(S.Pu);return(0,C.jsxs)(A.lO,{...e,className:(0,w.cx)(d&&"is-editable"),style:{position:"relative",display:"grid",gridTemplateColumns:"100%"},children:[(0,C.jsx)(i,{...l,options:s,theme:c,variant:o,node:t,children:(0,C.jsx)(a.ms,{"data-node-view-content-outer":"smartLayout"})}),(0,C.jsx)(I.A,{...e,label:k.ag._({id:"Szg6OU"}),"data-testid":"smart-layout-drag-handle"})]})},T=r.NB.create({name:"smartLayout",group:"cardBlock layoutBlock",content:"smartLayoutCell+",isolating:!0,containerHandle:!0,defining:!0,priority:s.a.SmartLayout,addAttributes:()=>({variantKey:{default:void 0},options:{default:{},...(0,l.sw)("options")},fullWidthBlock:{default:!1}}),parseHTML(){let e=Object.values((0,E.m)()).filter(e=>e.htmlTag).map(e=>({tag:e.htmlTag,getAttrs:t=>{let n={variantKey:e.key,options:e.defaultOptions||{}};return e.options.forEach(e=>{let r=t.getAttribute(e.key);if(r){try{n.options[e.key]=JSON.parse(r)}catch(e){}return}if(e.getDefaultOnParse&&!n.options[e.key]){n.options[e.key]=e.getDefaultOnParse(t);return}}),n}}));return[{tag:"div[class=smart-layout]"},...e]},renderHTMLforAI(e){let{node:t}=e,n=(0,E.P)(t.attrs.variantKey),r={};return n.options.forEach(e=>{var n;let o=null!==(n=t.attrs.options[e.key])&&void 0!==n?n:e.defaultValue;r[e.key]="string"==typeof o?o:JSON.stringify(o)}),[n.htmlTag||n.key,r,0]},renderHTML(e){let{HTMLAttributes:t}=e;return["div",(0,r.P1)(t,{class:"smart-layout"}),0]},addNodeView:()=>(0,a.fW)(z,{update:c.E7,ignoreMutation:i.j}),addProseMirrorPlugins(){return[v(this.editor)]},addCommands:()=>({insertSmartLayoutCell:e=>t=>{var n,o;let{chain:i,state:a}=t,l=a.doc.resolve(e),s=(0,r.qv)(l,e=>"smartLayout"===e.type.name),d=null==s?void 0:s.node.lastChild;if(!s||!d)return!1;let c=d.attrs,p=(0,u.J)(null===(n=d.firstChild)||void 0===n?void 0:n.attrs.level);return i().insertContentAt(e,{type:"smartLayoutCell",content:p,attrs:{image:{source:null===(o=c.image)||void 0===o?void 0:o.source}}}).selectInsertedNode().run(),!0},handleSmartLayoutDelete:function(e){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1];return n=>{let{dispatch:i,state:a,tr:l,chain:s}=n;if(!i)return!0;let{selection:c}=a,u=c instanceof o.qv&&(0,p.E)(c.node)?{node:c.node,pos:c.from}:(0,r.Kk)(e=>
1"smartLayoutCell"===e.type.name)(a.selection);if(e&&u&&u.pos!==c.from)return!1;let m=(0,r.Kk)(e=>"smartLayout"===e.type.name)(a.selection);if(!u||!m)return!1;if(1==m.node.childCount)s().selectNodeAtPos(m.pos).deleteSelectionAndSelectNear(t?1:-1).run();else{let e=l.doc.resolve(u.pos);(0,d.D)(l,e,t)}return!0}}})})},13988:function(e,t,n){"use strict";n.d(t,{Ne:function(){return m},js:function(){return p},ne:function(){return h}});var r=n(2689),o=n.n(r),i=n(86323),a=n(57336),l=n(23209),s=n(87254),d=n(26824),c=n(89064);let u=()=>(0,c.m)().filter(e=>!e.disabled),p=u().map(e=>{let{key:t,commandName:n,description:r,icon:a,keywords:s=[],defaultAttrs:c,defaultOptions:u,featureFlag:p}=e,m={type:"smartLayout",attrs:{variantKey:t,options:u},content:o()(3).map(()=>({type:"smartLayoutCell",content:(0,l.J)(),attrs:c}))};return{key:"smartLayout-".concat(t),name:n,keywords:[...s,"layout","smart"],description:r,nodeName:"smartLayout",icon:a,execute:e=>{e.chain().focus().insertContentAndSelect(m).run()},dragStartFn:e=>(0,i.UV)(e,m),dragEndFn:e=>{(0,d.X1)(e,e.state.selection.$from)},featureFlag:p}}),m=u().map(e=>{let{key:t,commandName:n,description:r,icon:o,featureFlag:i}=e,l="listToSmartLayout-".concat(t);return{key:l,name:n,icon:o,description:r,group:"list",apply:e=>e.commands.listToSmartLayout(t),checkDisabled:e=>!(0,a.Ah)(e),featureFlag:i}}),h=[{name:()=>s.ag._({id:"o6dKT5"}),key:"timelineVerticalTwoSided",keywords:["timeline","vertical","agenda","steps"],previewImage:{src:"/_next/static/media/TimelineVerticalTwoSided.e09967af.svg",height:151,width:253,blurWidth:0,blurHeight:0},content:{type:"smartLayout",attrs:{variantKey:"timeline",options:{numbered:!1,twoSided:!0,hasLine:!0},fullWidthBlock:!1},content:[{type:"smartLayoutCell",attrs:{options:{},width:null,label:null},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Vision"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:null},content:[{type:"text",text:"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor"}]}]},{type:"smartLayoutCell",attrs:{options:{},width:null,label:null},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Mission"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:null},content:[{type:"text",text:"Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim "}]}]},{type:"smartLayoutCell",attrs:{options:{},width:null,label:null},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Goal"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:null},content:[{type:"text",text:"Sed ut perspiciatis unde omnis iste natus error sit volupta tem accusa ntium eius modi tempora"}]}]},{type:"smartLayoutCell",attrs:{options:{},width:null,label:null},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Strategy"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:null},content:[{type:"text",text:"Foste natus error sit volupta tem accusa ntium eius modi tempora"}]}]}]}},{name:()=>s.ag._({id:"o2PvSp"}),key:"timelineVerticalNumbered",keywords:["timeline","vertical","agenda","steps"],previewImage:{src:"/_next/static/media/TimelineVerticalNumbered.e4851152.svg",height:111,width:253,blurWidth:0,blurHeight:0},content:{type:"smartLayout",attrs:{variantKey:"timeline",options:{numbered:!0,hasLine:!1,twoSided:!1,orientation:"vertical"},fullWidthBlock:!1},content:[{type:"smartLayoutCell",attrs:{options:{},width:null,label:null},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Vision"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:null},content:[{type:"text",text:"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor"}]}]},{type:"smartLayoutCell",attrs:{options:{},width:null,label:null},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Mission"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:null},content:[{type:"text",text:"Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim "}]}]}
1,{type:"smartLayoutCell",attrs:{options:{},width:null,label:null},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Goal"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:null},content:[{type:"text",text:"Sed ut perspiciatis unde omnis iste natus error sit volupta tem accusa ntium eius modi tempora"}]}]},{type:"smartLayoutCell",attrs:{options:{},width:null,label:null},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Strategy"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:null},content:[{type:"text",text:"Foste natus error sit volupta tem accusa ntium eius modi tempora"}]}]}]}},{name:()=>s.ag._({id:"EGQH/j"}),key:"timelineHorizontalTwoSided",keywords:["timeline","horizontal","agenda","steps"],previewImage:{src:"/_next/static/media/TimelineHorizontalTwoSided.acd4bc4a.svg",height:97,width:253,blurWidth:0,blurHeight:0},content:{type:"smartLayout",attrs:{variantKey:"timeline",options:{numbered:!1,hasLine:!0,twoSided:!0,orientation:"horizontal"},fullWidthBlock:!1},content:[{type:"smartLayoutCell",attrs:{options:{},width:null,label:null},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Vision"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:null},content:[{type:"text",text:"Lorem ipsum dolor sit amet, consectetur do"}]}]},{type:"smartLayoutCell",attrs:{options:{},width:null,label:null},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Mission"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:null},content:[{type:"text",text:"Excepteur sint occaecat cupidatat non proident"}]}]},{type:"smartLayoutCell",attrs:{options:{},width:null,label:null},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Goal"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:null},content:[{type:"text",text:"Sed ut perspiciatis unde omnis iste natus error sit "}]}]},{type:"smartLayoutCell",attrs:{options:{},width:null,image:null,label:null},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Strategy"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:null},content:[{type:"text",text:"Foste natus error sit volupta tem accusa ntium "}]}]}]}},{name:()=>s.ag._({id:"tmwL4E"}),key:"timelineHorizontalNumbered",keywords:["timeline","horizontal","agenda","steps"],previewImage:{src:"/_next/static/media/TimelineHorizontalNumbered.4bc4869b.svg",height:97,width:253,blurWidth:0,blurHeight:0},content:{type:"smartLayout",attrs:{variantKey:"timeline",options:{numbered:!0,hasLine:!1,twoSided:!1,orientation:"horizontal"},fullWidthBlock:!1},content:[{type:"smartLayoutCell",attrs:{options:{},width:null,label:null},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Vision"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:null},content:[{type:"text",text:"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor"}]}]},{type:"smartLayoutCell",attrs:{options:{},width:null,label:null},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Mission"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:null},content:[{type:"text",text:"Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim "}]}]},{type:"smartLayoutCell",attrs:{options:{},width:null,label:null},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Goal"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:null},content:[{type:"text",text:"Sed ut perspiciatis unde omnis iste natus error sit volupta tem accusa ntium eius modi tempora"}]}]}]}},{name:()=>s.ag._({id:"OsVXoX"}),key:"bulletsLg",keywords:["agenda","steps","bullets"],previewImage:{src:"/_next/static/media/BulletsLg.095a87c4.svg",height:97,width:253,blurWidth:0,blurHeight:0},content:{type:"smartLayout",attrs:{variantKey:"bullets",options:{cellSize:20},fullWidthBlock:!1},content:[{type:"smartLayoutCell",attrs:{options:{},width:null,label:null},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Vision"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:null},content:[{type:"text",text:"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor"}]}]}
1,{type:"smartLayoutCell",attrs:{options:{},width:null,label:null},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Mission"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:null},content:[{type:"text",text:"Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim "}]}]},{type:"smartLayoutCell",attrs:{options:{},width:null,label:null},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Goal"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:null},content:[{type:"text",text:"Sed ut perspiciatis unde omnis iste natus error sit volupta tem accusa ntium eius modi tempora"}]}]},{type:"smartLayoutCell",attrs:{options:{},width:null,label:null},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Strategy"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:null},content:[{type:"text",text:"Foste natus error sit volupta tem accusa ntium eius modi tempora"}]}]}]}},{name:()=>s.ag._({id:"XY2IHD"}),key:"bulletsSm",previewImage:{src:"/_next/static/media/BulletsSm.b752361e.svg",height:96,width:253,blurWidth:0,blurHeight:0},keywords:["agenda","steps","bullets"],content:{type:"smartLayout",attrs:{variantKey:"bullets",options:{cellSize:10},fullWidthBlock:!1},content:[{type:"smartLayoutCell",attrs:{options:{},width:null,image:null,label:null},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Vision"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:null},content:[{type:"text",text:"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor"}]}]},{type:"smartLayoutCell",attrs:{options:{},width:null,image:null,label:null},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Mission"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:null},content:[{type:"text",text:"Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim "}]}]},{type:"smartLayoutCell",attrs:{options:{},width:null,image:null,label:null},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Goal"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:null},content:[{type:"text",text:"Sed ut perspiciatis unde omnis iste natus error sit volupta tem accusa ntium eius modi tempora"}]}]}]}},{name:()=>s.ag._({id:"7xlpDo"}),key:"textBoxes3",keywords:["squares"],previewImage:{src:"/_next/static/media/TextBoxes3.f6cbbf0a.svg",height:97,width:253,blurWidth:0,blurHeight:0},content:{type:"smartLayout",attrs:{variantKey:"textBoxes",options:{cellSize:10},fullWidthBlock:!1},content:[{type:"smartLayoutCell",attrs:{options:{},width:null,image:null,label:null},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Item 1"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:null},content:[{type:"text",text:"Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident."}]}]},{type:"smartLayoutCell",attrs:{options:{},width:null,image:null,label:null},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Item 2"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:null},content:[{type:"text",text:"Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident."}]}]},{type:"smartLayoutCell",attrs:{options:{},width:null,image:null,label:null},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Item 3"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:null},content:[{type:"text",text:"Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident."}]}]}]}},{name:()=>s.ag._({id:"X4kXBV"}),key:"textBoxes4",previewImage:{src:"/_next/static/media/TextBoxes4.7125fc69.svg",height:110,width:253,blurWidth:0,blurHeight:0},keywords:["squares","callouts","matrix","quadrant"],content:{type:"smartLayout",attrs:{variantKey:"textBoxes",o
1ptions:{cellSize:20},fullWidthBlock:!1},content:[{type:"smartLayoutCell",attrs:{options:{},width:null,label:null},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Vision"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:null},content:[{type:"text",text:"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor"}]}]},{type:"smartLayoutCell",attrs:{options:{},width:null,label:null},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Mission"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:null},content:[{type:"text",text:"Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim "}]}]},{type:"smartLayoutCell",attrs:{options:{},width:null,label:null},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Goal"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:null},content:[{type:"text",text:"Sed ut perspiciatis unde omnis iste natus error sit volupta tem accusa ntium eius modi tempora"}]}]},{type:"smartLayoutCell",attrs:{options:{},width:null,label:null},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Strategy"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:null},content:[{type:"text",text:"Foste natus error sit volupta tem accusa ntium eius modi tempora"}]}]}]}},{name:()=>s.ag._({id:"+kQMBP"}),key:"imagesWithTextTeam",previewImage:{src:"/_next/static/media/ImagesWithTextTeam.af1be4d1.svg",height:97,width:253,blurWidth:0,blurHeight:0},keywords:["team","images","headshot","bio","roles"],content:{type:"smartLayout",attrs:{variantKey:"imagesText",options:{cellSize:10,imageSize:1,horizontalAlign:"center",imageShape:"circle"},fullWidthBlock:!1},content:[{type:"smartLayoutCell",attrs:{options:{},width:null,image:{source:"image.custom",uploadStatus:0,showPlaceholder:!1,src:"https://cdn.gamma.app/zc87vhr30n8uf3n/c1414815be03462f8862cb80f89f720d/optimized/tesla.jpg",meta:{width:820,height:709,date_file_modified:"2023/02/07 22:20:08 GMT",aspect_ratio:1.157,has_clipping_path:!1,frame_count:1,colorspace:"sRGB",has_transparency:!1,average_color:"#828282",orientation:"Horizontal (normal)"},name:"tesla.jpg"},label:null},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Nikola Tesla"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:"default"},content:[{type:"text",marks:[{type:"bold"}],text:"Inventor"},{type:"hardBreak"},{type:"text",text:"@ Tesla Inc. "}]}]},{type:"smartLayoutCell",attrs:{options:{},width:null,image:{source:"image.custom",uploadStatus:0,showPlaceholder:!1,src:"https://cdn.gamma.app/zc87vhr30n8uf3n/53ab692111294834a286002e3ecfdf2b/optimized/marie-curie.jpg",meta:{width:1200,height:1631,date_file_modified:"2023/02/07 22:20:11 GMT",aspect_ratio:.736,has_clipping_path:!1,frame_count:1,colorspace:"sRGB",has_transparency:!1,orientation:"Horizontal (normal)",average_color:"#3b3b3b"},name:"marie-curie.jpg"},label:null},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Marie Curie"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:"default"},content:[{type:"text",marks:[{type:"bold"}],text:"Physicist and Chemist"},{type:"hardBreak"},{type:"text",text:"@ Radioactivity"}]}]},{type:"smartLayoutCell",attrs:{options:{},width:null,image:{source:"image.custom",uploadStatus:0,showPlaceholder:!1,src:"https://cdn.gamma.app/zc87vhr30n8uf3n/e5d0250f2e054ee3a4c63a8e11f39c36/optimized/thomas-edison.webp",meta:{width:360,height:450,date_file_modified:"2023/02/07 22:20:22 GMT",aspect_ratio:.8,has_clipping_path:!1,frame_count:1,colorspace:"sRGB",has_transparency:!1,average_color:"#606060",orientation:"Horizontal (normal)"},name:"thomas edison.webp"},label:null},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Thomas Edison"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:"default"},content:[{type:"text",marks:[{type:"bold"}],text:"Inventor "},{type:"hardBreak"},{type:"text",text:"@ Light bulb "}]}]}
1,{type:"smartLayoutCell",attrs:{options:{},width:null,image:{source:"image.custom",uploadStatus:0,showPlaceholder:!1,src:"https://cdn.gamma.app/zc87vhr30n8uf3n/86aa2820df484599b26ab9bbb79737d3/optimized/einstein.jpg",meta:{width:500,height:500,date_file_modified:"2023/02/07 22:20:26 GMT",aspect_ratio:1,has_clipping_path:!1,frame_count:1,colorspace:"sRGB",has_transparency:!1,orientation:"Horizontal (normal)",average_color:"#575757"},name:"einstein.jpg"},label:null},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Albert Einstein"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:"default"},content:[{type:"text",marks:[{type:"bold"}],text:"Theoretical Physicist"},{type:"hardBreak"},{type:"text",text:"@ EMC2 "}]}]}]}},{name:()=>s.ag._({id:"kX68M5"}),key:"imagesWithTextIcons",previewImage:{src:"/_next/static/media/ImagesWithTextIcons.85edfaa6.svg",height:97,width:253,blurWidth:0,blurHeight:0},keywords:["icons"],content:{type:"smartLayout",attrs:{variantKey:"iconsText",options:{cellSize:10,shapeSize:"md",horizontalAlign:"center"},fullWidthBlock:!1},content:[{type:"smartLayoutCell",attrs:{options:{},width:null,image:{source:"image.icon",src:"https://cdn.gamma.app/zc87vhr30n8uf3n/e169d76934d642e2999d195fb50cfd88/optimized/mountain.svg",tempUrl:"https://gamma.app/api/icons/mountain.svg?provider=fa&style=light",meta:{height:512,width:512,svgViewBoxWidth:512,svgViewBoxHeight:512,date_file_modified:"2023/02/07 21:46:24 GMT",aspect_ratio:1,has_clipping_path:!1,frame_count:1,average_color:"#cbcbcb"},query:"mountain",providerMeta:{name:"fa",id:"mountain"},uploadStatus:0,showPlaceholder:!1,name:"mountain.svg"},label:null},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Vision"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:null},content:[{type:"text",text:"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor"}]}]},{type:"smartLayoutCell",attrs:{options:{},width:null,image:{source:"image.icon",src:"https://cdn.gamma.app/zc87vhr30n8uf3n/1f156e4486744695b40e109958afc3fb/optimized/user-astronaut.svg",tempUrl:"https://gamma.app/api/icons/user-astronaut.svg?provider=fa&style=light",meta:{height:512,width:448,svgViewBoxWidth:448,svgViewBoxHeight:512,date_file_modified:"2023/02/07 21:45:45 GMT",aspect_ratio:.875,has_clipping_path:!1,frame_count:1,average_color:"#9c9c9c"},query:"astronaut",providerMeta:{name:"fa",id:"user-astronaut"},uploadStatus:0,showPlaceholder:!1,name:"user-astronaut.svg"},label:null},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Mission"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:null},content:[{type:"text",text:"Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim "}]}]},{type:"smartLayoutCell",attrs:{options:{},width:null,image:{source:"image.icon",uploadStatus:0,showPlaceholder:!1,tempUrl:"https://gamma.app/api/icons/bullseye-arrow.svg?provider=fa&style=light",src:"https://cdn.gamma.app/zc87vhr30n8uf3n/69f7d571bf7d4af1b2aab06149d5ce4d/optimized/bullseye-arrow.svg",meta:{height:512,width:512,svgViewBoxWidth:512,svgViewBoxHeight:512,date_file_modified:"2023/02/07 21:47:16 GMT",aspect_ratio:1,has_clipping_path:!1,frame_count:1,average_color:"#acacac"},query:"goal",providerMeta:{name:"fa",id:"bullseye-arrow"},name:"bullseye-arrow.svg"},label:null},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Goal"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:null},content:[{type:"text",text:"Sed ut perspiciatis unde omnis iste natus error sit volupta tem accusa ntium eius modi tempora"}]}]},{type:"smartLayoutCell",attrs:{options:{},width:null,image:{source:"image.icon",src:"https://cdn.gamma.app/zc87vhr30n8uf3n/ce830d7ed3c543d5b88ecdf6ec6c26ad/optimized/chess-king-piece.svg",tempUrl:"https://gamma.app/api/icons/chess-king-piece.svg?provider=fa&style=light",meta:{height:512,width:256,svgViewBoxWidth:256,svgViewBoxHeight:512,date_file_modified:"2023/02/07 22:21:25 GMT",aspect_ratio:.5,has_clipping_path:!1,frame_count:1,average_color:"#a1a1a1"},providerMeta:{name:"fa",id:"chess-king-piece"},query:"strategy",uploadStatus:0,showPlaceholder:!1,name:"chess-king-piece.svg"},label:null},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Strategy"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:null},content:[{type:"text",text:"Foste natus error sit volupta tem accusa ntium eius modi tempora"}]}]}]}},{name:()=>s.ag._({id:"tVJ1RK"}),key:"imagesWithTextPhotos",keywords:["photos","captions"],previewImage:{src:"/_next/static/media/ImagesWithTextPhotos.a55ab106.svg",height:96,width:253,blurWidth:0,blurHeight:0},content:{type:"smartLayout",attrs:{variantKey:"imagesText",options:{cellSize:15,horizontalAlign:"left"},fullWidthBlock:!1},content:[{type:"smartLayoutCell",attrs:{options:{},width:null,image:{source:"image.unsplash",src:"https://images.unsplash.com/photo-1457459686225-c7db79d4e59f?ixid=MnwxOTgwNzN8MHwxfHNlYXJjaHwxOXx8bW91bnRhaW58ZW58MXx8fHwxNjc1ODA2MDQw&ixlib=rb-4.0.3&w=2592&q=25",tempUrl:"https://images.unsplash.com/photo-1457459686225-c7db79d4e59f?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=MnwxOTgwNzN8MHwxfHNlYXJjaHwxOXx8bW91bnRhaW58ZW58MXx8fHwxNjc1ODA2MDQw&ixlib=rb-4.0.3&q=80&w=200",meta:{height:3872,width:2592}
1,query:"mountain"},label:null},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Vision"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:null},content:[{type:"text",text:"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor"}]}]},{type:"smartLayoutCell",attrs:{options:{},width:null,image:{source:"image.unsplash",src:"https://images.unsplash.com/photo-1536697246787-1f7ae568d89a?ixid=MnwxOTgwNzN8MHwxfHNlYXJjaHwyfHxhc3Ryb25hdXR8ZW58MXx8fHwxNjc1ODA1OTkz&ixlib=rb-4.0.3&w=2731&q=25",tempUrl:"https://images.unsplash.com/photo-1536697246787-1f7ae568d89a?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=MnwxOTgwNzN8MHwxfHNlYXJjaHwyfHxhc3Ryb25hdXR8ZW58MXx8fHwxNjc1ODA1OTkz&ixlib=rb-4.0.3&q=80&w=200",meta:{height:4096,width:2731},query:"astronaut"},label:null},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Mission"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:null},content:[{type:"text",text:"Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim"}]}]},{type:"smartLayoutCell",attrs:{options:{},width:null,image:{source:"image.unsplash",src:"https://images.unsplash.com/photo-1598091874986-7da3b270fead?ixid=MnwxOTgwNzN8MHwxfHNlYXJjaHwyNHx8Z29hbHxlbnwxfHx8fDE2NzU4MDU4NjQ&ixlib=rb-4.0.3&w=2832&q=25",tempUrl:"https://images.unsplash.com/photo-1598091874986-7da3b270fead?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=MnwxOTgwNzN8MHwxfHNlYXJjaHwyNHx8Z29hbHxlbnwxfHx8fDE2NzU4MDU4NjQ&ixlib=rb-4.0.3&q=80&w=200",meta:{height:2832,width:2832},query:"goal"},label:null},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Goal"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:null},content:[{type:"text",text:"Sed ut perspiciatis unde omnis iste natus error sit volupta tem accusa ntium eius modi tempora"}]}]}]}},{name:()=>s.ag._({id:"B52ZvK"}),key:"pyramidOutside",previewImage:{src:"/_next/static/media/Pyramid.ef92f89c.svg",height:94,width:253,blurWidth:0,blurHeight:0},content:{type:"smartLayout",attrs:{variantKey:"pyramid",options:{numbered:!0,hasLine:!1,twoSided:!1,orientation:"horizontal",cellSize:10,outsideText:!0},fullWidthBlock:!1},content:[{type:"smartLayoutCell",attrs:{options:{},width:null,image:null,label:null},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Vision"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:null},content:[{type:"text",text:"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do "}]}]},{type:"smartLayoutCell",attrs:{options:{},width:null,image:null,label:null},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Mission"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:null},content:[{type:"text",text:"Excepteur sint occaecat cupidatat non proident, sunt in culpa "}]}]},{type:"smartLayoutCell",attrs:{options:{},width:null,image:null,label:null},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Goal"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:null},content:[{type:"text",text:"Sed ut perspiciatis unde omnis iste natus error sit "}]}]},{type:"smartLayoutCell",attrs:{options:{},width:null,image:null,label:null},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Strategy"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:null},content:[{type:"text",text:"Foste natus error sit volupta tem accusa ntium "}]}]}]}},{name:()=>s.ag._({id:"WJphpV"}),key:"funnelOutside",previewImage:{src:"/_next/static/media/Funnel.49ef311d.svg",height:94,width:253,blurWidth:0,blurHeight:0},content:{type:"smartLayout",attrs:{variantKey:"funnel",options:{numbered:!0,hasLine:!1,twoSided:!1,orientation:"horizontal",cellSize:10,outsideText:!0},fullWidthBlock:!1},content:[{type:"smartLayoutCell",attrs:{options:{},width:null,image:null,label:null},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Vision"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:null},content:[{type:"text",text:"Lorem ipsum dolor sit amet, consectetur "}]}]}
1,{type:"smartLayoutCell",attrs:{options:{},width:null,image:null,label:null},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Mission"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:null},content:[{type:"text",text:"Excepteur sint occaecat cupidatat non proident, sunt "}]}]},{type:"smartLayoutCell",attrs:{options:{},width:null,image:null,label:null},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Goal"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:null},content:[{type:"text",text:"Sed ut perspiciatis unde omnis iste natus error sit volupta"}]}]},{type:"smartLayoutCell",attrs:{options:{},width:null,image:null,label:null},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Strategy"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:null},content:[{type:"text",text:"Foste natus error sit volupta tem accusa ntium eius modi tempora"}]}]}]}},{name:()=>s.ag._({id:"crBPvK"}),key:"staircaseOutside",previewImage:{src:"/_next/static/media/Stairs.d60e32c7.svg",height:94,width:253,blurWidth:0,blurHeight:0},content:{type:"smartLayout",attrs:{variantKey:"staircase",options:{numbered:!0,hasLine:!1,twoSided:!1,orientation:"horizontal",cellSize:10,outsideText:!0,horizontalAlign:"left"},fullWidthBlock:!1},content:[{type:"smartLayoutCell",attrs:{options:{},width:null,image:null,label:null},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Vision"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:null},content:[{type:"text",text:"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor"}]}]},{type:"smartLayoutCell",attrs:{options:{},width:null,image:null,label:null},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Mission"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:null},content:[{type:"text",text:"Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim "}]}]},{type:"smartLayoutCell",attrs:{options:{},width:null,image:null,label:null},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Goal"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:null},content:[{type:"text",text:"Sed ut perspiciatis unde omnis iste natus error sit volupta tem accusa ntium eius modi tempora"}]}]},{type:"smartLayoutCell",attrs:{options:{},width:null,image:null,label:null},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Strategy"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:null},content:[{type:"text",text:"Foste natus error sit volupta tem accusa ntium eius modi tempora"}]}]}]}},{name:()=>s.ag._({id:"OxTZir"}),key:"steppedPyramid",previewImage:{src:"/_next/static/media/SteppedPyramid.def15490.svg",height:94,width:253,blurWidth:0,blurHeight:0},content:{type:"smartLayout",attrs:{variantKey:"staircase",options:{numbered:!0,hasLine:!1,twoSided:!1,orientation:"horizontal",cellSize:10,outsideText:!0,horizontalAlign:"center"},fullWidthBlock:!1},content:[{type:"smartLayoutCell",attrs:{options:{},width:null,image:null,label:null},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Vision"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:null},content:[{type:"text",text:"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor"}]}]},{type:"smartLayoutCell",attrs:{options:{},width:null,image:null,label:null},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Mission"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:null},content:[{type:"text",text:"Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim "}]}]},{type:"smartLayoutCell",attrs:{options:{},width:null,image:null,label:null},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Goal"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:null}
1,content:[{type:"text",text:"Sed ut perspiciatis unde omnis iste natus error sit volupta tem accusa ntium eius modi tempora"}]}]},{type:"smartLayoutCell",attrs:{options:{},width:null,image:null,label:null},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Strategy"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:null},content:[{type:"text",text:"Foste natus error sit volupta tem accusa ntium eius modi tempora"}]}]}]}},{name:()=>s.ag._({id:"zd+VK0"}),key:"horizontalArrows",previewImage:{src:"/_next/static/media/ArrowsHorizontal.a774f944.svg",height:71,width:253,blurWidth:0,blurHeight:0},content:{type:"smartLayout",attrs:{variantKey:"arrows",options:{numbered:!0,hasLine:!1,twoSided:!1,orientation:"horizontal",cellSize:10},fullWidthBlock:!1},content:[{type:"smartLayoutCell",attrs:{options:{},width:null,image:null,label:null},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Vision"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:null},content:[{type:"text",text:"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor"}]}]},{type:"smartLayoutCell",attrs:{options:{},width:null,image:null,label:null},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Mission"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:null},content:[{type:"text",text:"Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim "}]}]},{type:"smartLayoutCell",attrs:{options:{},width:null,image:null,label:null},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Goal"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:null},content:[{type:"text",text:"Sed ut perspiciatis unde omnis iste natus error sit volupta tem accusa ntium eius modi tempora"}]}]},{type:"smartLayoutCell",attrs:{options:{},width:null,image:null,label:null},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Strategy"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:null},content:[{type:"text",text:"Foste natus error sit volupta tem accusa ntium eius modi tempora"}]}]}]}},{name:()=>s.ag._({id:"bkPcLj"}),key:"verticalArrows",previewImage:{src:"/_next/static/media/ArrowsVertical.836da72e.svg",height:97,width:253,blurWidth:0,blurHeight:0},content:{type:"smartLayout",attrs:{variantKey:"arrows",options:{numbered:!0,hasLine:!1,twoSided:!1,orientation:"vertical",cellSize:10,horizontalAlign:"left"},fullWidthBlock:!1},content:[{type:"smartLayoutCell",attrs:{options:{},width:null,image:null,label:null},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Vision"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:null},content:[{type:"text",text:"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor"}]}]},{type:"smartLayoutCell",attrs:{options:{},width:null,image:null,label:null},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Mission"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:null},content:[{type:"text",text:"Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit"}]}]},{type:"smartLayoutCell",attrs:{options:{},width:null,image:null,label:null},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Goal"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:null},content:[{type:"text",text:"Sed ut perspiciatis unde omnis iste natus error sit volupta tem accusa ntium"}]}]}]}},{name:()=>s.ag._({id:"W78uBz"}),key:"stats3",previewImage:{src:"/_next/static/media/BigNumbers.a8dd3c72.svg",height:65,width:253,blurWidth:0,blurHeight:0},content:{type:"smartLayout",attrs:{variantKey:"stats",options:{cellSize:15,numberMax:100,shapeSize:"lg"},fullWidthBlock:!1},content:[{type:"smartLayoutCell",attrs:{options:{},width:null,image:null,label:"25%"},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Vision"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:null},content:[{type:"text",text:"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor"}]}]}
1,{type:"smartLayoutCell",attrs:{options:{},width:null,image:null,label:"3/4"},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Mission"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:null},content:[{type:"text",text:"Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit "}]}]},{type:"smartLayoutCell",attrs:{options:{numberMax:100},width:null,image:null,label:50},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Goal"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:null},content:[{type:"text",text:"Sed ut perspiciatis unde omnis iste natus error sit volupta tem accusa ntium eius modi tempora"}]}]}]}},{name:()=>s.ag._({id:"PFo2A/"}),key:"circleStats3",previewImage:{src:"/_next/static/media/CircleStats.d28f4999.svg",height:83,width:253,blurWidth:0,blurHeight:0},content:{type:"smartLayout",attrs:{variantKey:"circleStats",options:{cellSize:15,imageSize:.8,shapeSize:"lg"},fullWidthBlock:!1},content:[{type:"smartLayoutCell",attrs:{options:{},width:null,image:null,label:"54%"},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Vision"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:null},content:[{type:"text",text:"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor"}]}]},{type:"smartLayoutCell",attrs:{options:{},width:null,image:null,label:75},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Mission"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:null},content:[{type:"text",text:"Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit "}]}]},{type:"smartLayoutCell",attrs:{options:{},width:null,image:null,label:"1/3"},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Goal"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:null},content:[{type:"text",text:"Sed ut perspiciatis unde omnis iste natus error sit volupta tem accusa ntium eius modi tempora"}]}]}]}},{name:()=>s.ag._({id:"0LeG7j"}),key:"barStats3",previewImage:{src:"/_next/static/media/BarStats.f950fb86.svg",height:76,width:253,blurWidth:0,blurHeight:0},content:{type:"smartLayout",attrs:{variantKey:"barStats",options:{cellSize:10,numberMax:100},fullWidthBlock:!1},content:[{type:"smartLayoutCell",attrs:{options:{},width:null,image:null,label:"25%"},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Vision"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:null},content:[{type:"text",text:"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor"}]}]},{type:"smartLayoutCell",attrs:{options:{},width:null,image:null,label:"3/4"},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Mission"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:null},content:[{type:"text",text:"Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit "}]}]},{type:"smartLayoutCell",attrs:{options:{numberMax:100},width:null,image:null,label:50},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Goal"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:null},content:[{type:"text",text:"Sed ut perspiciatis unde omnis iste natus error sit volupta tem accusa ntium eius modi tempora"}]}]}]}}].map(e=>{let{name:t,key:n,keywords:r=[],content:o,previewImage:a}
1=e,l=(0,c.P)(o.attrs.variantKey);return{key:n,name:t,keywords:[...r,...l.keywords||[],"layout","smart"],nodeName:"smartLayout",icon:l.icon,previewImage:a,execute:e=>{e.chain().focus().insertContentAndSelect(o).run()},dragStartFn:e=>(0,i.UV)(e,o),dragEndFn:e=>{(0,d.X1)(e,e.state.selection.$from)},featureFlag:l.featureFlag}})},23209:function(e,t,n){"use strict";n.d(t,{J:function(){return i},p:function(){return a}});var r=n(87254),o=n(97724);let i=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:4;return[o.i.heading(r.ag._({id:"HX5SVx"}),{level:e}),o.i.paragraph(r.ag._({id:"Nu4oKW"}))]},a="1em"},99914:function(e,t,n){"use strict";n.d(t,{PX:function(){return h},Xo:function(){return m},r4:function(){return p}});var r=n(71644),o=n.n(r),i=n(27191),a=n(52780),l=n(11093),s=n(56253),d=n(48751),c=n(39951),u=n(72083);let p=e=>{let{doc:t}=e,n=[];return t.descendants((r,s)=>{if(r.type.name!==c.z.name)return;let d=o()((0,l.Jn)(r.content).map(e=>(0,u.g9)(e.attrs.label))),p=g(t.resolve(s)),m=e.selection instanceof i.qv&&e.selection.node===r||e.selection.from>s&&e.selection.to<s+r.nodeSize,h={isSmartLayoutDecoration:!0,numCells:r.childCount,containerSize:p};return n.push(a.p.node(s,s+r.nodeSize,{},h)),r.forEach((e,t,o)=>{let i=s+1+t,c={isSmartLayoutCellDecoration:!0,index:o,numCells:r.childCount,maxLabelValue:d,smartLayoutAttrs:r.attrs,layoutContainerSize:p,isContentEmpty:(0,l.$y)(e),isLayoutFocused:m};n.push(a.p.node(i,i+e.nodeSize,{},c))}),!1}),a.EH.create(t,n)},m=e=>{let t=e.find(e=>e.spec.isSmartLayoutDecoration);return t?t.spec:(console.error("[SmartLayout] Decoration not found. This should never happen!",e),{isSmartLayoutDecoration:!0,numCells:0,containerSize:1})},h=e=>{let t=e.find(e=>e.spec.isSmartLayoutCellDecoration);return t?t.spec:(console.error("[SmartLayoutCell] Decoration not found. This should never happen!",e),{isSmartLayoutCellDecoration:!0,numCells:0,index:0,smartLayoutAttrs:{options:{},fullWidthBlock:!1},layoutContainerSize:1,isContentEmpty:!1,isLayoutFocused:!1})},g=e=>{let t=1;try{for(let r=e.depth;r>0;r--){let o=e.node(r),i=e.index(r-1);if("gridCell"===o.type.name){let n=e.node(r-1),o=n.attrs.colWidths;o&&o[i]&&(t*=parseInt(o[i])/100)}if("card"===o.type.name){var n;let{layout:r,layoutTemplateColumns:i,container:a}=o.attrs;if("left"===r){let e=i?parseInt(i.split(" ")[1])/100:d.ZQ;t*=e}if("right"===r){let e=i?parseInt(i.split(" ")[0])/100:d.ZQ;t*=e}let l=e.doc.firstChild.attrs;(null!==(n=a.width)&&void 0!==n?n:l.settings.defaultContentWidth)==="lg"&&(t*=s.Bk/s.r1);break}}}catch(e){console.error("[SmartLayout] Error getting container size decoration",e)}return t}},26824:function(e,t,n){"use strict";n.d(t,{X1:function(){return h},cQ:function(){return m},fC:function(){return p},jM:function(){return d},yU:function(){return c}});var r=n(72338),o=n(11093),i=n(60742),a=n(37160),l=n(26282),s=n(89064);let d=e=>{let t=(0,s.P)(e.variantKey),n={};return t.options.forEach(t=>{var r;let{key:o,defaultValue:i}=t;n[o]=null!==(r=e.options[o])&&void 0!==r?r:i}),n},c=e=>{var t;let n=(0,s.P)(e.variantKey),r=d(e);return(null===(t=n.addDirection)||void 0===t?void 0:t.call(n,r))||"right"},u=(e,t)=>t.nodes.smartLayout.validContent(e.content),p=(e,t,n)=>{let r=e.posAtCoords({left:t.clientX,top:t.clientY});if(!r)return null;let s=e.state.doc.resolve(r.inside),d=(0,o.Ru)(s,l.E)[0],c=(0,o.Ru)(s,l.G)[0],u=n&&(0,a.O)(n);if(!d&&!c||!u||"image"!==u.type.name)return null;let p=(0,i.tl)(t.target,e.dom,e=>e.hasAttribute("data-smart-layout-image-drop-target"));if(p){let{src:e,source:t,query:n,name:o,uploadStatus:i}=u.attrs,a=p.getBoundingClientRect();return{pos:r.inside,node:u,rect:a,image:{src:e,source:t,query:n,name:o,uploadStatus:i}}}return null},m=(e,t,n)=>{let o;if(!n||!u(n,e.state.schema))return null;let i=e.posAtCoords({left:t.clientX,top:t.clientY});if(!i||-1==i.inside)return null;let{doc:a}=e.state,s=a.nodeAt(i.pos),d=a.nodeAt(i.inside);if(d&&(0,l.E)(d))o={node:d,pos:i.inside};else if(s&&(0,l.E)(s))o={node:s,pos:i.pos};else{let e=a.resolve(i.inside);o=(0,r.qv)(e,l.E)}let p=o&&e.nodeDOM(o.pos),m=null==p?void 0:p.querySelector("[data-content-reference]"),h=null==m?void 0:m.getBoundingClientRect();if(!o||!h)return null;
1let g=a.resolve(o.pos),f=g.parent;if(!f||!(0,l.G)(f))return null;let x=c(f.attrs),v="right"===x?t.clientX>h.left+h.width/2?"right":"left":t.clientY>h.top+h.height/2?"bottom":"top";return{pos:o.pos,node:o.node,rect:h,side:v}},h=(e,t)=>{let n=(0,r.qv)(t,l.G);n&&e.commands.selectNodeAtPos(n.pos)}},89064:function(e,t,n){"use strict";n.d(t,{P:function(){return tm},m:function(){return tu}});var r=n(52322),o=n(20437),i=n(38035),a=n(28535),l=n(73200),s=n(42946),d=n(87254),c=n(2784),u=n(27333),p=n(89098),m=n(4878),h=n(30733),g=n.n(h);class f{observe(e,t){this.observer.observe(e),this.observedElements.set(e,t)}unobserve(e){this.observer.unobserve(e),this.observedElements.delete(e),this.nextTickCallbacks.delete(e)}handleResize(e){let t=!1;for(let n of e){let e=this.observedElements.get(n.target);e&&(t=!0,this.nextTickCallbacks.set(n.target,()=>{e(n.contentRect)}))}t&&this.queueProcess()}queueProcess(){this.frameId&&(cancelAnimationFrame(this.frameId),this.frameId=null),this.frameId=requestAnimationFrame(()=>{for(let e of this.nextTickCallbacks.values())e();this.frameId=null})}constructor(){this.observedElements=new Map,this.nextTickCallbacks=new Map,this.frameId=null,this.observer=new ResizeObserver(e=>this.handleResize(e))}}let x=g()(()=>new f),v={x:0,y:0,width:0,height:0,top:0,left:0,bottom:0,right:0};function b(){let e=(0,c.useRef)(null),[{width:t,height:n},r]=(0,c.useState)(v);return(0,c.useEffect)(()=>{let t=e.current;return t&&x().observe(t,r),()=>{t&&x().unobserve(t)}},[]),{ref:e,width:t,height:n}}var y=n(90221),C=n(17630),w=n(58905),k=n(75230),j=n(64951),S=n(91994),A=n(47968);let I=e=>{let{updateAttributes:t,value:n,placeholder:o,inputProps:i,...a}=e,l=(0,c.useCallback)(e=>{t&&t({label:""===e?null:e})},[t]),s=(0,S.CG)(A.Pw)&&t;return(0,r.jsxs)(w.C,{value:n||"",placeholder:o,onChange:l,isDisabled:!s,...a,children:[(0,r.jsx)(k.w,{width:"100%",h:"1em",py:0,noOfLines:1}),(0,r.jsx)(j.V,{width:"100%",my:-1,py:1,...i})]})};var E=n(23209),z=n(19194);let T=function(e,t){var n;let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=(0,S.CG)(A.Pu),i=(0,p.c)(o),a=!r&&!i.hasTransparentShapes,l=null!==(n=null==t?void 0:t.color)&&void 0!==n?n:e.color,s=(0,c.useMemo)(()=>(0,z._M)(l,a),[l,a]),d=l?(0,u.Mt)(l):void 0;return{color:l,colorVars:s,headingColorCss:d}};var N=n(29117),M=n(17993),_=n(77533),L=n(55233),P=n(24772),R=n(49929),H=n(94523),D=n(27875),O=n.n(D),B=n(90604),F=n(90439);let W=()=>({sm:{targetColumns:4,label:d.ag._({id:"4Revpc"}),width:10},md:{targetColumns:3,label:d.ag._({id:"agPptk"}),width:15},lg:{targetColumns:2,label:d.ag._({id:"k7rCa/"}),width:20},xl:{targetColumns:1,label:d.ag._({id:"vp6Yr4"}),width:25}}),G={key:"cellSize",defaultValue:W().md.width,Control:e=>{let{value:t,updateValue:n,option:o}=e,i=Object.values(W()).find(e=>e.width===t);return(0,r.jsxs)(N.U,{spacing:2,mr:2,children:[(0,r.jsx)(H.kH,{placement:"top",label:(0,r.jsxs)(M.g,{spacing:0,children:[(0,r.jsx)(_.x,{color:"gray.400",children:o.name()}),(0,r.jsx)(_.x,{children:null==i?void 0:i.label})]}),children:(0,r.jsx)(_.x,{fontSize:"sm",fontWeight:"600",children:(0,r.jsx)(R.G,{icon:s.blG})})}),(0,r.jsxs)(L.iR,{min:W().sm.width,max:W().xl.width,step:5,value:t,onChange:n,w:"60px",focusThumbOnChange:!1,colorScheme:"trueblue",size:"sm",children:[(0,r.jsx)(L.Uj,{children:(0,r.jsx)(L.Ms,{})}),i?(0,r.jsx)(H.kH,{placement:"top",label:(0,r.jsxs)(M.g,{spacing:0,children:[(0,r.jsx)(_.x,{color:"gray.400",children:o.name()}),(0,r.jsx)(_.x,{children:i.label})]}),children:(0,r.jsx)(L.gs,{background:"trueblue.500"})}):(0,r.jsx)(L.gs,{background:"trueblue.500"})]})]})},getDefaultOnParse(e){let t=e.childElementCount;return t%2==0?W().lg.width:W().md.width},name:()=>d.ag._({id:"LNoaEH"})},U=e=>{var t;let{containerSize:n,numCells:r,options:o,mobileMaxColumns:i=2,forceBalance:a=!1}=e,l=(null===(t=Object.values(W()).find(e=>e.width===o.cellSize))||void 0===t?void 0:t.targetColumns)||3,s=40/l,d=(0,m.TZ)(),c=(0,S.CG)(A.gh),u=c===B.q.SLIDE_VIEW,p=(0,P.S)({base:i,sm:2,md:3,xl:4},{fallback:d?"base":"xl"})||i,h=F.cx||u?4:d?i:p,g=O()(40*n,10,10*h),f=Math.max(1,Math.floor(g/s)),x=Math.min(f,r);if(a&&r>x&&r<=4)for(;x>=1&&r%x!=0;x--);return{maxWidth:g,targetWidth:s,targetColumns:l,maxColumns:f,columns:x}};var V=n(12336);let q={key:"color",Control:e=>{let{value:t,updateValue:n,editor:o}=e;return(0,r.jsx)(V.E,{color:t,setColor:e=>n(e,!0),editor:o,analyticsSource:"SmartLayout"})},name:()=>"Color"};var $=n(29679);let K={key:"horizontalAlign",defaultValue:null,Control:e=>{let{value:t,updateValue:n}=e;return(0,r.jsx)(N.U,{spacing:0,children:C.Ec.map(e=>{let{name:o,icon:i,alignment:a}=e;return(0,r.jsx)($.h,{label:o(),icon:i,onClick:()=>{n(a===t?null:a)},isActive:t===a},o())})})},name:()=>d.ag._({id:"0j+RGO"})},Z={key:"orientation",defaultValue:"vertical",Control:e=>{let{value:t,updateValue:n,option:o}=e;return(0,r.jsx)($.h,{label:o.name(),onClick:()=>n("horizontal"===t?"vertical":"horizontal"),isActive:"horizontal"===t,icon:"horizontal"===t?s.eFW:s.r5q,testId:"smart-layout-orientation-option"})},name:()=>d.ag._({id:"MRB7nI"})},Y="1.5em",X=(e,t,n)=>{let r=(0,m.TZ)(),{columns:o}=U({containerSize:n,numCells:t,options:e,forceBalance:!0});return"vertical"===e.orientation||r||t>1&&1===o?{columns:1,isHorizontal:!1}:{columns:o,isHorizontal:!0}},J=(0,c.memo)(e=>{let{children:t,options:n,numCells:i,containerSize:a}=e,{isHorizontal:l,columns:s}=X(n,i,a),d=l?{columns:s,rowGap:Y}:{columns:1};return(0,r.jsx)(o.M,{"data-selection-ring":!0,...d,pos:"relative",children:t})});J.displayName="ArrowsWrapper";let Q=(0,c.memo)(e=>{let{layoutOptions:t,children:n,theme:o,numCells:l,layoutContainerSize:s,dragHandle:d,cellOptions:c}=e,u=(0,p.c)(o),{isHorizontal:m}=X(t,l,s),h=t.horizontalAlign,g=(0,C.nN)(h||"left"),{colorVars:f}=T(t,c,!0),x=m?{minW:0,transformOrigin:"center top",p:E.p,pt:0}:{transformOrigin:"left center",p:E.p,px:0};return(0,r.jsxs)(i.k,{direction:m?"column":"right"===h?"row-reverse":"row","data-selection-ring":!0,"data-content-reference":!0,pos:"relative",gap:Y,minH:m?void 0:"8em",children:[(0,r.jsx)(ee,{...e}),(0,r.jsx)(a.xu,{flex:"1",sx:{...x,...g,...f,...u.outsideTextSx},children:n}),d]})});Q.displayName="ArrowsCell";let ee=(0,c.memo)(e=>{let{layoutOptions:t,cellOptions:n,label:o,index:s,updateAttributes:d,theme:c,numCells:m,layoutContainerSize:h}=e,g=(0,p.c)(c),{colorVars:f}=T(t,n),{isHorizontal:x}=X(t,m,h),{width:v,height:w,ref:k}=b(),j=k.current?parseFloat(window.getComputedStyle(k.current).fontSize):16,S=(x?4:5)*j,A=1*j,E=x?"\n M ".concat(v-A," 0\n L ").concat(v," ").concat(S/2,"\n L ").concat(v-A," ").concat(S,"\n L 0 ").concat(S,"\n L ").concat(A," ").concat(S/2,"\n L 0 0 Z"):"\n M 0 ".concat(w-A,"\n L ").concat(S/2," ").concat(w,"\n L ").concat(S," ").concat(w-A,"\n L ").concat(S," 0\n L ").concat(S/2," ").concat(A,"\n L 0 0 Z"),z={fontSize:"1.5em",pos:"absolute",my:"0.5em",alignItems:"center",justifyContent:"center"};return(0,r.jsxs)(i.k,{lineHeight:"1",contentEditable:!1,align:"center",justify:"center",position:"relative",sx:{...f,...g.shapeBackgroun
1dSx,...(0,y.G6)()?(0,u.Mt)():void 0,...g.outsideTextSx,...(0,C.nN)("center")},...x?{width:"100%",height:"".concat(4,"em")}:{width:"".concat(5,"em"),height:"100%"},ref:k,"data-export-as-image":!0,children:[(0,r.jsx)(a.xu,{as:"svg",pos:"absolute",inset:"0",overflow:"visible",children:(0,r.jsx)(a.xu,{as:"path",d:E,sx:g.shapeBackgroundSx})}),x?(0,r.jsx)(I,{value:o||"",updateAttributes:d,placeholder:"".concat(s+1),className:(0,l.cx)(u.A8),sx:z,display:"flex",style:{width:"100%",userSelect:"none"}}):(0,r.jsx)(i.k,{sx:z,className:(0,l.cx)(u.A8),children:s+1})]})});ee.displayName="ArrowsLabel";let et={key:"arrows",name:()=>d.ag._({id:"YUGjgn"}),commandName:()=>d.ag._({id:"IsJ7Ns"}),icon:s.irl,options:[{...Z,defaultValue:"horizontal"},q,K,{...G,checkEnabled:e=>"vertical"!==e.options.orientation}],cellOptions:[q],Wrapper:J,Cell:Q,addDirection:e=>"horizontal"===e.orientation?"right":"bottom",isFullWidth:e=>"horizontal"===e.orientation,htmlTag:"arrows",keywords:["sequence","ordered","steps","arrows","chevrons","roadmap"],defaultOptions:{cellSize:W().sm.width}};var en=n(42822),er=n(98314),eo=n(12304),ei=n(26824);let ea=e=>{var t,n;let{index:o,theme:a,firstChildSize:s,layoutOptions:d,cellOptions:m,children:h,positionProps:g,markerProps:f,alignText:x,getPos:v,editor:b,markerFontSize:C}=e,w=(0,eo.v0)(s),k=null===(n=d.numbered)||void 0===n||n,j=null===(t=(0,er.yw)()[C||"h3"])||void 0===t?void 0:t.size,S="".concat((k?j:1)+.75,"em"),A=(0,p.c)(a),I=(0,c.useCallback)(()=>{if(!b.isEditable)return;let e=b.state.doc.resolve(v());(0,ei.X1)(b,e)},[v,b]),E=(0,c.useMemo)(()=>(0,eo.v0)(C||"h3"),[C]),{colorVars:z}=T(d,m),N={...(0,y.G6)()?(0,u.Mt)():void 0,...A.boxBackgroundSx||A.boxSx};return(0,r.jsxs)(i.k,{my:x?"var(--block-margin)":0,...g,contentEditable:!1,userSelect:"none",onMouseDown:I,cursor:"default",css:z,children:[(0,r.jsx)(en.M,{sx:w,h:"".concat(w.lineHeight,"em"),children:(0,r.jsx)(en.M,{fontSize:"var(--font-size)",h:S,w:S,sx:N,...f,children:(0,r.jsx)(_.x,{sx:E,className:(0,l.cx)(u.A8),textAlign:"center",children:k?o+1:""})})}),h]})},el={key:"numbered",defaultValue:!0,Control:e=>{let{value:t,updateValue:n,option:o}=e;return(0,r.jsx)($.h,{label:o.name(),onClick:()=>n(!t),isActive:t,icon:s.nFo})},name:()=>d.ag._({id:"mVQI+S"})},es=(0,c.memo)(e=>{let{children:t}=e;return(0,r.jsx)(i.k,{gap:"1em",direction:"row",wrap:"wrap","data-selection-ring":!0,pos:"relative",children:t})});es.displayName="BulletsWrapper";let ed=(0,c.memo)(e=>{let{children:t,...n}=e,{theme:o,layoutOptions:l,cellOptions:s,numCells:d,layoutContainerSize:c,dragHandle:u}=n,m=(0,p.c)(o),{columns:h}=U({options:l,numCells:d,containerSize:c}),{colorVars:g}=T(l,s,!0);return(0,r.jsxs)(i.k,{direction:"row",align:"flex-start",gap:E.p,flex:"1 1 auto",w:"calc(".concat(100/h,"% - ").concat("1em",")"),"data-selection-ring":!0,"data-content-reference":!0,pos:"relative",children:[(0,r.jsx)(ea,{...n,alignText:!0}),(0,r.jsx)(a.xu,{flex:"1",minW:"0",sx:m.outsideTextSx,css:g,pt:"var(--block-margin)",children:t}),u]})});ed.displayName="BulletsCell";let ec={key:"bullets",commandName:()=>d.ag._({id:"eKiifW"}),name:()=>d.ag._({id:"RYtHky"}),icon:s.M7i,options:[G,q,el],cellOptions:[q],Wrapper:es,Cell:ed,htmlTag:"bullets",keywords:["bullets","layout","list","bullet"]};var eu=n(69396),ep=n(62614),em=n(70723),eh=n(66028);let eg=e=>{var t;let{value:n,updateValue:o,choices:i,defaultIcon:a,option:l}=e;return(0,r.jsxs)(em.Lt,{isLazy:!0,children:[(0,r.jsx)(H.kH,{placement:"top",label:l.name(),shouldWrapChildren:!0,children:(0,r.jsx)(em.PS,{as:ep.z,variant:"toolbar",onMouseDown:eh.br,rightIcon:(0,r.jsx)(R.G,{icon:s.ptq,transform:"shrink-6"}),children:(0,r.jsx)(R.G,{icon:(null===(t=i[n])||void 0===t?void 0:t.icon)||a})})}),(0,r.jsx)(em.sV,{children:Object.entries(i).map(e=>{let[t,{icon:n,name:i,disabled:a}]=e;return a?null:(0,r.jsx)(em.hP,{icon:(0,r.jsx)(R.G,{icon:n,fixedWidth:!0}),onClick:()=>o(t),children:i},t)})})]})},ef=()=>({square:{name:d.ag._({id:"1DA6ap"}),icon:s.pL1},circle:{name:d.ag._({id:"7xMmki"}),icon:s.diR},landscape:{name:d.ag._({id:"XxIeKn"}),icon:s.r9b},portrait:{name:d.ag._({id:"3bV9gD"}),icon:s.j8N}}),ex={square:{aspectRatio:"1 / 1"},circle:{borderRadius:"full",aspectRatio:"1 / 1"},landscape:{aspectRatio:"1.618 / 1"},portrait:{aspectRatio:"4 / 5"}};var ev=n(12832);let eb=[{label:()=>d.ag._({id:"4Revpc"}),key:"sm"},{label:()=>d.ag._({id:"agPptk"}
1),key:"md"},{label:()=>d.ag._({id:"k7rCa/"}),key:"lg"},{label:()=>d.ag._({id:"g2Tj8R"}),key:"full"}],ey={key:"shapeSize",defaultValue:null,Control:e=>{let{value:t,updateValue:n,option:o}=e,i=eb.findIndex(e=>e.key===t);-1===i&&(i=3);let{label:a}=eb[i],l=(0,c.useCallback)(e=>{let{key:t}=eb[e];n(t)},[n]);return(0,r.jsxs)(N.U,{spacing:2,mr:2,children:[(0,r.jsx)(H.kH,{placement:"top",label:(0,r.jsxs)(M.g,{spacing:0,children:[(0,r.jsx)(_.x,{color:"gray.400",children:o.name()}),(0,r.jsx)(_.x,{children:a()})]}),children:(0,r.jsx)(_.x,{fontSize:"sm",fontWeight:"600",children:(0,r.jsx)(R.G,{icon:o.icon,fixedWidth:!0})})}),(0,r.jsxs)(L.iR,{min:0,max:eb.length-1,step:1,value:i,onChange:l,w:"60px",focusThumbOnChange:!1,colorScheme:"trueblue",size:"sm",children:[(0,r.jsx)(L.Uj,{children:(0,r.jsx)(L.Ms,{})}),(0,r.jsx)(H.kH,{placement:"top",label:(0,r.jsxs)(M.g,{spacing:0,children:[(0,r.jsx)(_.x,{color:"gray.400",children:o.name()}),(0,r.jsx)(_.x,{children:a()})]}),children:(0,r.jsx)(L.gs,{background:"trueblue.500"})})]})]})},name:()=>d.ag._({id:"FeDgKA"}),icon:s.cxi},eC=(0,c.memo)(e=>{let{children:t,options:n,numCells:i,containerSize:a}=e,l=U({containerSize:a,options:n,numCells:i});return(0,r.jsx)(o.M,{columns:l.columns,rowGap:"3em",columnGap:"1.5em","data-selection-ring":"padded",pos:"relative",borderRadius:"var(--box-border-radius)",children:t})});eC.displayName="ImagesWithTextWrapper";let ew={sm:.4,md:.6,lg:.8,full:1},ek={sm:.15,md:.2,lg:.25,full:.35},ej=(0,c.memo)(e=>{var t,n,o,s;let{children:d,image:c,layoutOptions:u,cellOptions:m,theme:h,numCells:g,layoutContainerSize:f,isContentEmpty:x,isLayoutFocused:v,variant:b,dragHandle:y,...w}=e,k="left"==u.imagePosition,j=(0,p.c)(h),S=null!==(o=null!==(n=u.imageShape)&&void 0!==n?n:j.smartLayoutImageShape)&&void 0!==o?o:"square",A=ex[S],I=b.key==eA.key,E=(null==c?void 0:c.source)==eu.j.key,z=u.shapeSize||!u.imageSize||E?E||I?ek[u.shapeSize||"md"]:ew[u.shapeSize||"full"]:u.imageSize,N=null==c?void 0:null===(t=c.meta)||void 0===t?void 0:t.has_transparency,M=null!==(s=u.horizontalAlign)&&void 0!==s?s:"center",_=(0,C.nN)(M),{color:L,colorVars:P}=T(u,m,!0),{columns:R}=U({containerSize:f,options:u,numCells:g,forceBalance:!0}),H=z<=.4,D=H?"min(100%, ".concat(W().sm.width*z,"em)"):1===R?"min(100%, ".concat(W().xl.width*z,"em)"):"100%",O=E?{"svg.colorable-icon path":{fill:L||"url(#theme-accent-gradient-linear) var(--accent-color)"}}:N?{...A}:{...j.smartLayoutImageSx||j.imageSx,...A},B={...j.outsideTextSx,...P};return(0,r.jsxs)(i.k,{borderRadius:"var(--box-border-radius)",gap:x&&!v?0:H?"1em":"1.25em",direction:k?"row":"column",align:"center",justify:"center",sx:_,"data-selection-ring":"padded","data-content-reference":!0,pos:"relative",children:[(0,r.jsx)(a.xu,{"data-smart-layout-image-drop-target":"true",className:(0,l.cx)("image"),w:"".concat(100*z,"%"),maxW:D,overflow:"hidden",sx:O,children:(0,r.jsx)(ev.Z,{image:c,...w})}),(0,r.jsx)(a.xu,{minW:k?"8em":"100%",maxW:"100%",flex:"1",sx:B,"data-content-empty":x,css:P,children:d}),y]})});ej.displayName="ImageWithTextCell";let eS={key:"imagesText",name:()=>d.ag._({id:"cDxTeG"}),commandName:()=>d.ag._({id:"d+mR/1"}),keywords:["team","caption","images","text","layout"],icon:s.dLO,options:[{...G,getDefaultOnParse:()=>W().sm.width},{...ey,icon:s.VmB,name:()=>d.ag._({id:"8J92vb"})},{key:"imageShape",defaultValue:null,Control:e=>{let{value:t,updateValue:n,editor:o,option:i}=e;return(0,r.jsx)(eg,{value:t,updateValue:n,editor:o,choices:ef(),option:i,defaultIcon:s.pL1})},name:()=>d.ag._({id:"JbOau/"})},K],cellOptions:[],Wrapper:eC,Cell:ej,addDirection:e=>"left"===e.imagePosition?"bottom":"right",htmlTag:"images",defaultOptions:{horizontalAlign:"left",imageShape:"landscape"}},eA={name:()=>d.ag._({id:"joUkNe"}),commandName:()=>d.ag._({id:"oEHjy6"}),key:"iconsText",icon:s.ocQ,keywords:["icons","text","layout"],options:[q,{...G,getDefaultOnParse:()=>W().sm.width},{...ey,icon:s.VmB,name:()=>d.ag._({id:"bwZEQG"})},K],cellOptions:[q],Wrapper:eC,Cell:ej,addDirection:e=>"left"===e.imagePosition?"bottom":"right",defaultOptions:{horizontalAlign:"left"},defaultAttrs:{image:{source:eu.j.key}},htmlTag:"icons"},eI="40em",eE="0.25em";var ez=n(2689),eT=n.n(ez);let eN=(e,t)=>{let n=(0,m.TZ)(),r=(0,P.S)({base:1,sm:2,md:3,xl:4})||2,o=F.cx?4:n?2:r;return o*e<(t?3:2)},eM=(0,c.memo)(e=>{let{Step:t=eD,node:n,...o}=e,{children:a,numCells:l,options:s,theme:d}=o,c=s.horizontalAlign||"center",u=(0,C.nN)(c),p="funnel"===o.variant.key,m="staircase"===o.variant.key,h=eT()(l).map(e=>{var o;let i=null===(o=n.maybeChild(e))||void 0===o?void 0:o.attrs.options;
1return(0,r.jsx)(e_,{index:e,numCells:l,theme:d,isFunnel:p,alignment:c,isStepped:m,cellOptions:i,layoutOptions:s,Step:t},e)});return(0,r.jsxs)(i.k,{direction:"column","data-selection-ring":!0,align:"stretch",gap:"1em",children:[(0,r.jsx)(i.k,{direction:"column",sx:u,contentEditable:!1,gap:eE,"data-alternate-colors":!0,children:h}),(0,r.jsx)(i.k,{gap:"0.5em",direction:"column",children:a})]})});eM.displayName="StackedPyramidWrapper";let e_=e=>{let{index:t,numCells:n,theme:o,cellOptions:i,layoutOptions:a,isFunnel:l,alignment:s,isStepped:d,Step:c}=e,u=(0,p.c)(o),m=!d&&l&&t===n-1?{pos:"relative",bottom:"0.25em"}:d||l||0!==t?{}:{pos:"relative",top:"0.25em"},{colorVars:h}=T(a,i,!1);return(0,r.jsx)(c,{index:t,numCells:n,base:u,isOutside:!0,isNumbered:!0,isStacked:!0,isFunnel:l,alignment:s,stepSx:h,children:(0,r.jsx)(eH,{index:t,...m})},t)},eL=(0,c.memo)(e=>{let{children:t,layoutOptions:n,...o}=e,{theme:l}=o,s=(0,p.c)(l),{colorVars:d}=T(n,e.cellOptions,!0);return(0,r.jsxs)(i.k,{direction:"row",align:"flex-start",gap:E.p,w:"100%","data-selection-ring":!0,"data-content-reference":!0,pos:"relative",children:[(0,r.jsx)(ea,{...o,layoutOptions:n,alignText:!0,markerFontSize:"h4"}),(0,r.jsx)(a.xu,{flex:"1",minW:"0",sx:s.outsideTextSx,css:d,pt:"var(--block-margin)",children:t})]})});eL.displayName="StackedPyramidCell";let eP=(0,c.memo)(e=>{let t=eN(e.containerSize,e.options.outsideText),{colorVars:n}=T(e.options,void 0,!0);return t?(0,r.jsx)(eM,{...e}):(0,r.jsx)(o.M,{columns:1,autoRows:"1fr","data-selection-ring":!0,gap:eE,sx:e.options.outsideText?n:void 0,children:e.children})});eP.displayName="PyramidWrapper";let eR=(0,c.memo)(e=>{let{Step:t=eD,isFunnel:n=!1,isStepped:o=!1,alignment:l="center",...s}=e,{children:d,layoutOptions:c,index:u,numCells:m,dragHandle:h}=s,g=c.outsideText,f=eN(s.layoutContainerSize,g),{colorVars:x}=T(c,s.cellOptions),{colorVars:v}=T(c,s.cellOptions,!0);if(f)return(0,r.jsx)(eL,{...s});let b=(0,p.c)(s.theme),y=c.numbered,w={...(0,C.nN)("right"===l?"right":"left"),...b.outsideTextSx},k=o?{bottom:"-1px"}:n?{top:"calc(-1px - ".concat(eE," / 2 )")}:{bottom:"calc(-1px - ".concat(eE," / 2 )")},j=n?0===u:u===m-1,S=o?"0.5em":eE,A=y&&g&&!o,I=A&&n&&u===m-1?{pos:"relative",bottom:"15%"}:A&&!n&&0===u?{pos:"relative",top:"15%"}:{};return(0,r.jsxs)(i.k,{"data-selection-ring":!0,"data-content-reference":!0,pos:"relative",w:"100%",direction:"right"===l?"row-reverse":"row",justify:g||"center"!==l?void 0:"center",children:[(0,r.jsxs)(t,{numCells:m,index:u,isFunnel:n,isOutside:g,isNumbered:y,base:b,alignment:l,selectCell:s.selectCell,stepSx:x,children:[g?y?(0,r.jsx)(eH,{index:u,...I}):null:d,h]}),g&&(0,r.jsxs)(i.k,{direction:"column",justify:"center",minW:0,flex:1,px:E.p,py:E.p,pos:"relative",sx:w,css:v,children:[d,!j&&(0,r.jsx)(a.xu,{contentEditable:!1,position:"absolute",...k,left:S,right:S,h:"var(--line-thickness)",transform:"scaleY(0.5)",sx:b.lineSx})]})]})});eR.displayName="PyramidCell";let eH=(0,c.memo)(e=>{let{index:t,...n}=e;return(0,r.jsx)(_.x,{className:(0,l.cx)(u.A8),fontSize:"1.25em",display:"flex",sx:(0,C.nN)("center"),pos:"relative",contentEditable:!1,...n,children:t+1})});eH.displayName="PyramidLabel";let eD=(0,c.memo)(e=>{let{numCells:t,index:n,isFunnel:o,isOutside:a,isStacked:l,children:s,base:d,alignment:c,selectCell:u,stepSx:p}=e,m=o?t-n-1:n,{width:h,height:g,ref:f}=b(),x=a?0:45,v=a&&!l?50:100,y=eB(t,m,x),w=.99*eB(t,m+1,x),k=w*(v/100),j=(v-k)/2,S=(0,C.nN)(c),A=l?void 0:a?{ml:"center"===c?"".concat(j,"%"):void 0}:{maxW:"calc(".concat(eI," * ").concat(k/100,")")};return(0,r.jsxs)(i.k,{direction:"column",ref:f,pos:"relative",w:"".concat(k,"%"),sx:{...S,...p},onClick:a?u:void 0,contentEditable:!a&&void 0,...A,children:[(0,r.jsx)(eO,{width:h,height:g,alignment:c,topSize:o?1:y/w,bottomSize:o?y/w:1,pathSx:d.shapeBackgroundSx}),(0,r.jsx)(i.k,{direction:"column",justify:"center",h:"100%",p:a?"0.5em":E.p,boxSizing:"border-box",sx:{...d.outsideTextSx,...S,alignItems:a?S.alignItems:"stretch"},w:"".concat(100*((y+w)/2/w),"%"),minW:"3em",children:s})]})});eD.displayName="PyramidStep";let eO=(0,c.memo)(e=>{let{width:t,height:n,topSize:o,bottomSize:i,alignment:l,pathSx:s}
1=e,d=t*(1-o)/2,c=t*(1-i)/2,u="left"===l?"\n M 0 0\n L ".concat(t-2*d," 0\n L ").concat(t-2*c," ").concat(n,"\n L 0 ").concat(n,"\n L 0 0 Z"):"right"===l?"\n M ".concat(2*d," 0\n L ").concat(t," 0\n L ").concat(t," ").concat(n,"\n L ").concat(2*c," ").concat(n,"\n L ").concat(2*d," 0 Z"):"\n M ".concat(d," 0\n L ").concat(t-d," 0\n L ").concat(t-c," ").concat(n,"\n L ").concat(c," ").concat(n,"\n L ").concat(d," 0 Z");return(0,r.jsx)(a.xu,{as:"svg",pos:"absolute",inset:"0",overflow:"visible",contentEditable:!1,w:"".concat(t,"px"),h:"".concat(n,"px"),children:(0,r.jsx)(a.xu,{as:"path",d:u,sx:s})})});eO.displayName="TrapezoidSVG";let eB=(e,t,n)=>n+t/e*(100-n),eF={...el,checkEnabled:e=>e.options.outsideText},eW={key:"pyramid",name:()=>d.ag._({id:"MYceoI"}),commandName:()=>d.ag._({id:"CPkQNq"}),icon:s.Ta_,options:[{key:"outsideText",defaultValue:!0,Control:e=>{let{value:t,updateValue:n,option:o}=e;return(0,r.jsx)($.h,{label:o.name(),onClick:()=>n(!t),isActive:t,icon:s.bnx})},name:()=>d.ag._({id:"OtsbQu"})},eF,q],cellOptions:[q],Wrapper:eP,Cell:eR,addDirection:()=>"bottom",htmlTag:"pyramid",featureFlag:"pyramidSmartLayouts"},eG=(0,c.memo)(e=>(0,r.jsx)(eR,{...e,isFunnel:!0}));eG.displayName="FunnelCell";let eU={...eW,key:"funnel",name:()=>d.ag._({id:"MWYJBI"}),commandName:()=>d.ag._({id:"HTZVrr"}),icon:s.Ct,htmlTag:"funnel",Cell:eG},eV=(0,c.memo)(e=>{let{children:t,options:n,containerSize:o}=e,a=(0,C.nN)(n.horizontalAlign||"left"),{colorVars:l}=T(n),s=eN(o,n.outsideText);if(s)return(0,r.jsx)(eM,{...e,Step:eq});let d={...a,...n.outsideText?l:{}};return(0,r.jsx)(i.k,{direction:"column","data-selection-ring":!0,gap:"0.5em",sx:d,children:t})});eV.displayName="StaircaseWrapper";let eq=(0,c.memo)(e=>{let{numCells:t,index:n,isOutside:o,isStacked:a,children:l,base:s,alignment:d,selectCell:c,stepSx:u}=e,p=(0,C.nN)(d),m={...p,alignItems:o?p.alignItems:"stretch",...u,...s.boxBackgroundSx||s.boxSx},h=o&&!a?50:100,g=eB(t,n+1,o?0:45),f=g*(h/100),x=(h-f)/2,v=a?void 0:o?{ml:"center"===d?"".concat(x,"%"):void 0}:{maxW:"calc(".concat(eI," * ").concat(f/100,")")};return(0,r.jsx)(i.k,{py:o?"0.5em":E.p,px:E.p,sx:m,w:"".concat(f,"%"),boxSizing:"border-box",...v,direction:"column",justify:"center",contentEditable:!o&&void 0,onClick:o?c:void 0,pos:"relative",children:l})});eq.displayName="StaircaseStep";let e$=(0,c.memo)(e=>{let t=e.layoutOptions.horizontalAlign||"left";return(0,r.jsx)(eR,{...e,Step:eq,isFunnel:!1,isStepped:!0,alignment:t})});e$.displayName="StaircaseCell";let eK={...eW,key:"staircase",name:()=>d.ag._({id:"CFVHFO"}),commandName:()=>d.ag._({id:"DuZtoX"}),options:[...eW.options,K],icon:s.jUS,Wrapper:eV,Cell:e$,htmlTag:"staircase"};var eZ=n(72083);let eY=(0,c.memo)(e=>{let{children:t,options:n,containerSize:i,numCells:a}=e,{columns:l}=U({containerSize:i,options:n,numCells:a,forceBalance:!0});return(0,r.jsx)(o.M,{columns:l,rowGap:"3em",columnGap:"1.5em","data-selection-ring":"padded",pos:"relative",borderRadius:"var(--box-border-radius)",children:t})});eY.displayName="BarStatsWrapper";let eX=(0,c.memo)(e=>{let{theme:t,children:n,layoutOptions:o,cellOptions:s,label:d,updateAttributes:c,isContentEmpty:m,isLayoutFocused:h,dragHandle:g}=e,f=(0,p.c)(t),x=o.horizontalAlign,v=(0,C.nN)(x||"left"),b=(0,eZ.y7)(e),{colorVars:y,color:w,headingColorCss:k}=T(o,s,!0),j=f.boxBackgroundSx||f.boxSx,S={...v,...y,...f.outsideTextSx};return(0,r.jsxs)(i.k,{borderRadius:"var(--box-border-radius)",direction:"column",align:"center",justify:"start",sx:S,"data-selection-ring":"padded","data-content-reference":!0,pos:"relative",gap:m&&!h?0:"0.75em",children:[(0,r.jsxs)(i.k,{direction:"row",align:"center",justify:"stretch",width:"100%",pos:"relative",contentEditable:!1,gap:"0.75em",css:k,children:[(0,r.jsxs)(a.xu,{flex:"1",sx:y,my:"0.5em",pos:"relative",borderRadius:null==j?void 0:j.borderRadius,children:[(0,r.jsx)(a.xu,{pos:"absolute",inset:"0",sx:j,opacity:w&&!f.hasTransparentShapes?.5:1}),(0,r.jsx)(a.xu,{w:"".concat(100*b,"%"),h:"1.25em",pos:"relative",sx:f.boxFillSx,borderRadius:"inherit"})]}),(0,r.jsx)(I,{value:d||"",updateAttributes:c,className:(0,l.cx)(u.A8),lineHeight:1,display:"flex",alignItems:"center",sx:v,fontSize:"1.25em",inputProps:{textAlign:"right",width:"4em",py:0},minW:"1em"})]}),(0,r.jsx)(a.xu,{w:"100%","data-content-empty":m,children:n}),g]})});eX.displayName="BarStatsCell";let eJ={key:"barStats",name:()=>d.ag._({id:"LYRXtx"}),commandName:()=>d.ag._({id:"MSp/ys"}),icon:s.xJn,options:[G,q,K],cellOptions:[q],Wrapper:eY,Cell:eX,defaultAttrs:{label:"50%"},addDirection:()=>"right",keywords:["stats","bar","progress","number","percentage"],htmlTag:"percentages",featureFlag:"statsSmartLayouts"};var eQ=n(30401);let e0=(0,c.memo)(e=>{let{children:t,options:n,containerSize:i,numCells:a}=e,{columns:l}=U({containerSize:i,options:n,numCells:a,forceBalance:!0});return(0,r.jsx)(o.M,{columns:l,rowGap:"3em",columnGap:"1.5em","data-selection-ring":"padded",pos:"relative",borderRadius:"var(--box-border-radius)",children:t})});e0.displayName="CircleStatsWrapper";let e1={sm:.4,md:.6,lg:.8,full:1},e2=(0,c.memo)(e=>{let{theme:t,children:n,layoutOptions:o,cellOptions:s,label:d,updateAttributes:c,isContentEmpty:h,isLayoutFocused:g,dragHandle:f}=e,x=(0,p.c)(t),v=o.horizontalAlign,b=(0,C.nN)(v||"center"),y=(0,eZ.y7)(e),w=(0,eQ.Nb)({innerRadius:41,outerRadius:50}),k=w({startAngle:0,endAngle:2*y*Math.PI}),j=w({startAngle:0,endAngle:2*Math.PI}),S=e1[o.shapeSize]||1,A="min(100%, ".concat(W().md.width*S,"em)"),E=(0,m.TZ)(),{colorVars:z,color:N,headingColorCss:M}=T(o,s,!0),_={...b,...z,...x.outsideTextSx};return(0,r.jsxs)(i.k,{borderRadius:"var(--box-border-radius)",direction:"column",align:"center",justify:"start","data-selection-ring":"padded","data-content-reference":!0,pos:"relative",gap:h&&!g?0:"1em",sx:_,children:[(0,r.jsxs)(i.k,{direction:"column",align:"center",justify:"center",width:"".concat(100*S,"%"),maxW:A,pos:"relative",contentEditable:!1,py:"0.25em",css:{...M,svg:z},children:[(0,r.jsx)(I,{value:d||"",updateAttributes:c,pos:"absolute",left:"".concat(9,"%"),className:(0,l.cx)(u.A8),fontSize:E?"".concat(2*S,"em"):"".concat(2.5*S,"em"),lineHeight:1,display:"flex",alignItems:"center",sx:(0,C.nN)("center"),style:{width:"".concat(82,"%")}}),(0,r.jsxs)("svg",{width:"100%",viewBox:"".concat(-50," ").concat(-50," ").concat(100," ").concat(100),overflow:"visible",children:[(0,r.jsx)(a.xu,{as:"path",d:j||void 0,sx:x.shapeBackgroun
1dSx,fillOpacity:N?.4:1,strokeOpacity:N?.6:1,"data-testid":"stats-track"}),(0,r.jsx)(a.xu,{as:"path",d:k||void 0,sx:x.shapeFillSx,"data-testid":"stats-fill"})]})]}),(0,r.jsx)(a.xu,{w:"100%","data-content-empty":h,children:n}),f]})});e2.displayName="CircleStatsCell";let e3={key:"circleStats",name:()=>d.ag._({id:"mvpFPS"}),commandName:()=>d.ag._({id:"4Rg7EO"}),icon:s.NWt,options:[G,{...ey,name:()=>d.ag._({id:"1C+7U1"}),icon:s.diR},q,K],cellOptions:[q],Wrapper:e0,Cell:e2,defaultAttrs:{label:"50%"},addDirection:()=>"right",keywords:["stats","circle"],htmlTag:"circles",featureFlag:"statsSmartLayouts"},e4=(0,c.memo)(e=>{let{children:t,options:n,containerSize:i,numCells:a}=e,{columns:l}=U({containerSize:i,options:n,numCells:a,mobileMaxColumns:1,forceBalance:!0});return(0,r.jsx)(o.M,{columns:l,rowGap:"3em",columnGap:"1.5em","data-selection-ring":"padded",pos:"relative",borderRadius:"var(--box-border-radius)",children:t})});e4.displayName="PlainStatsWrapper";let e5={sm:2,md:3,lg:4.25,full:5.25},e8=(0,c.memo)(e=>{let{theme:t,children:n,layoutOptions:o,cellOptions:s,label:d,isContentEmpty:c,isLayoutFocused:h,updateAttributes:g,dragHandle:f}=e,x=(0,p.c)(t),{headingColorCss:v,colorVars:b}=T(o,s,!0),y=o.horizontalAlign,w=(0,C.nN)(y||"center"),k=e5[o.shapeSize||"md"],j={...w,...b,...x.outsideTextSx},S=(0,m.TZ)();return(0,r.jsxs)(i.k,{borderRadius:"var(--box-border-radius)",direction:"column",align:"center",justify:"start","data-selection-ring":"padded","data-content-reference":!0,pos:"relative",gap:c&&!h?0:"0.75em",sx:j,children:[(0,r.jsx)(i.k,{direction:"column",align:"center",justify:"center",width:"100%",pos:"relative",contentEditable:!1,py:"0.5em",css:v,fontSize:S?"0.75em":"1em",children:(0,r.jsx)(I,{value:d||"",updateAttributes:g,className:(0,l.cx)(u.A8),fontSize:"".concat(k,"em"),lineHeight:1,display:"flex",alignItems:"center",sx:(0,C.nN)(y||"center"),style:{width:"100%"},placeholder:"â"})}),(0,r.jsx)(a.xu,{w:"100%","data-content-empty":c,children:n}),f]})});e8.displayName="PlainStatsCell";let e9={key:"stats",name:()=>d.ag._({id:"29Hx9U"}),commandName:()=>d.ag._({id:"v2fVzA"}),icon:s.jGC,options:[G,{...ey,name:()=>d.ag._({id:"IfKwpr"}),icon:s.UgL},q,K],cellOptions:[q],Wrapper:e4,Cell:e8,defaultAttrs:{label:"50%"},addDirection:()=>"right",keywords:["stats"],htmlTag:"numbers",featureFlag:"statsSmartLayouts"},e7=(0,c.memo)(e=>{let{children:t}=e;return(0,r.jsx)(i.k,{gap:"1em",wrap:"wrap","data-selection-ring":!0,pos:"relative",children:t})});e7.displayName="TextBoxesWrapper";let e6=(0,c.memo)(e=>{let{theme:t,children:n,layoutOptions:o,cellOptions:i,numCells:l,layoutContainerSize:s,dragHandle:d}=e,c=(0,p.c)(t),{columns:u}=U({options:o,numCells:l,containerSize:s}),{colorVars:m}=T(o,i),h=o.horizontalAlign,g=(0,C.nN)(h),f={...m,...g,...c.boxBackgroundSx||c.boxSx};return(0,r.jsxs)(a.xu,{flex:"1 1 auto",w:"calc(".concat(100/u,"% - ").concat("1em",")"),boxSizing:"border-box",p:E.p,"data-content-reference":!0,"data-selection-ring":!0,pos:"relative",sx:f,children:[n,d]})});e6.displayName="TextBoxCell";let te={key:"textBoxes",name:()=>d.ag._({id:"b7qbjN"}),commandName:()=>d.ag._({id:"xAk5nC"}),icon:s.Lc0,options:[G,q,K],cellOptions:[q],Wrapper:e7,Cell:e6,addDirection:()=>"right",htmlTag:"boxes",keywords:["textbox","layout"]};var tt=n(69251),tn=n(96933);let tr={base:!1,md:!0},to={base:!1,md:!0},ti=e=>{let t=(0,tn.i)(tr)||!1,n=(0,tn.i)(to)||!1,r="horizontal"===e.orientation&&n,o=e.twoSided&&(r||t);return{isHorizontal:r,isTwoSided:o}},ta=e=>e?1.5:.5,tl=(0,c.memo)(e=>{let{children:t,options:n,theme:o}=e,{isHorizontal:i,isTwoSided:l}=ti(n),s=ta(n.numbered),d=i?{templateRows:"auto 0px auto",autoColumns:"1fr",justifyContent:"center",columnGap:"1em",mt:l?void 0:"".concat(s,"em")}:{templateColumns:l?"1fr 0px 1fr":"0px 0px 1fr",autoRows:"auto",justifyContent:"center",rowGap:"1em",ml:l?void 0:"".concat(s,"em")},c=(0,p.c)(o),u=i?(0,r.jsx)(a.xu,{gridRow:2,gridColumn:1,"data-spotlight-dim":!0,contentEditable:!1,children:(0,r.jsx)(a.xu,{position:"absolute",height:"var(--line-thickness)",width:"100%",left:"0",right:"0",sx:c.lineSx})}):(0,r.jsx)(en.M,{gridColumn:2,gridRow:1,"data-spotlight-dim":!0,contentEditable:!1,
1children:(0,r.jsx)(a.xu,{position:"absolute",width:"var(--line-thickness)",top:"0",bottom:"0",sx:c.lineSx})});return(0,r.jsxs)(tt.r,{...d,"data-selection-ring":!0,pos:"relative",children:[u,t,l&&(0,r.jsx)(a.xu,{...i?{gridColumn:"1 / span 1",gridRow:3,minW:"0.5fr"}:{gridColumn:3,gridRow:"1 / span 1",minH:"".concat(4,"em")},contentEditable:!1})]})});tl.displayName="TimelineWrapper";let ts=(0,c.memo)(e=>{let{children:t,layoutOptions:n,index:o,theme:l,dragHandle:s,cellOptions:d}=e,c=(0,p.c)(l),{isHorizontal:u,isTwoSided:m}=ti(n),h=m&&(o+1)%2==1,g=n.hasLine?"inside":"none",f=ta(n.numbered),{colorVars:x}=T(n,d,!0),v="".concat(("inside"===g?3.5:0)+(u?"none"===g?f+1:1:2),"em"),b=u?{gridColumn:"span 2",gridRow:h?1:3,align:h?"flex-end":"flex-start",justify:"center",transformOrigin:h?"center bottom":"center top",pt:h?void 0:v,pb:h?v:void 0,px:"".concat(1,"em")}:{gridRow:"span 2",gridColumn:h?1:3,align:"flex-start",transformOrigin:h?"right center":"left center",pl:h?void 0:v,pr:h?v:void 0},y=u?{minW:"min(100%, ".concat(8,"em)"),...(0,C.nN)("center"),...c.outsideTextSx,...x}:{minH:m?"".concat(8,"em"):void 0,...(0,C.nN)(h?"right":"left"),...c.outsideTextSx,py:"".concat(1,"em"),...x};return(0,r.jsxs)(i.k,{minW:"0",position:"relative",transitionProperty:"border, padding, right, margin","data-selection-ring":!0,"data-content-reference":!0,...b,"data-test-timeline-item":o,children:[(0,r.jsx)(td,{...e}),(0,r.jsxs)(a.xu,{sx:y,flex:"1",maxW:"100%",children:[t,s]})]})});ts.displayName="TimelineCell";let td=(0,c.memo)(e=>{let{index:t,layoutOptions:n,theme:o}=e,{isHorizontal:i,isTwoSided:l}=ti(n),s=l&&t%2==0,d=n.hasLine?"inside":"none",c=(0,p.c)(o),u="none"===d?0:"inside"===d?"".concat(3.5,"em"):"100%",m=i?{height:u,width:"var(--line-thickness)",left:"50%",top:s?void 0:"50%",bottom:s?"50%":void 0,transform:"translateX(-50%)"}:{width:u,height:"var(--line-thickness)",top:"50%",transform:"translateY(-50%)",left:s?void 0:"100%",right:s?"100%":void 0};return(0,r.jsx)(ea,{...e,alignText:!i,positionProps:{...i?s?{bottom:0,transform:"translateY(50%)"}:{top:0,transform:"translateY(-50%)"}:s?{right:0,transform:"translateX(50%)"}:{left:0,transform:"translateX(-50%)"},position:"absolute"},children:"none"!==d&&(0,r.jsx)(a.xu,{position:"absolute",zIndex:"-1","data-testid":"timeline-line",...m,sx:c.lineSx})})});td.displayName="TimelineCellMarker";let tc={key:"timeline",name:()=>d.ag._({id:"cklVjM"}),commandName:()=>d.ag._({id:"jJ1FpU"}),icon:s.PZJ,options:[Z,{key:"twoSided",defaultValue:!0,Control:e=>{let{value:t,updateValue:n,option:o}=e;return(0,r.jsx)($.h,{label:o.name(),onClick:()=>n(!t),isActive:t,icon:s.cp3,testId:"smart-layout-two-sided-option"})},name:()=>d.ag._({id:"ovs7iP"})},el,{key:"hasLine",defaultValue:!0,Control:e=>{let{value:t,updateValue:n,option:o}=e;return(0,r.jsx)($.h,{label:o.name(),onClick:()=>n(!t),isActive:t,icon:s.ql$})},name:()=>d.ag._({id:"aPb1AT"})},q],cellOptions:[q],Wrapper:tl,Cell:ts,addDirection:e=>"horizontal"===e.orientation?"right":"bottom",isFullWidth:e=>"horizontal"===e.orientation,htmlTag:"timeline",keywords:["timeline","layout","list","horizontal","vertical"]},tu=()=>[ec,te,eS,eA,tc,et,e9,e3,eJ,eW,eU,eK],tp=()=>tu().reduce((e,t)=>(e[t.key]=t,e),{}),tm=e=>e&&tp()[e]||ec},72083:function(e,t,n){"use strict";n.d(t,{g9:function(){return d},y7:function(){return i}});var r=n(27875),o=n.n(r);let i=e=>{let{label:t}=e,n=d(t);return n?o()(n/100,0,1):0},a=/[0-9,.]+/g,l=/[,.](?=\d{3})/g,s=/([0-9]+)\s?\/\s?([0-9]+)/g,d=e=>{if(e){if("number"==typeof e)return e;try{var t,n;let r=null===(t=e.match(s))||void 0===t?void 0:t[0];if(r){let[e,t]=r.split("/").map(e=>e.trim());return 100*parseFloat(e)/parseFloat(t)}let o=null===(n=e.match(a))||void 0===n?void 0:n[0],i=null==o?void 0:o.replaceAll(l,"");return i?parseFloat(i):void 0}catch(t){console.error("[SmartLayout] Failed to parse label number: ".concat(e),t);return}}}},33374:function(e,t,n){"use strict";n.d(t,{ty:function(){return g},Yg:function(){return h}});var r=n(27191),o=n(52780),i=n(72338);let a=new r.H$("suggestion"),l={from:0,to:0};var s=n(94523),d=n(27875),c=n.n(d),u=n(2784),p=n(55079),m=n(59284);let h=e=>{let{ref:t,selectItem:n,options:r}=e,[o,i]=(0,u.useState)(0),a=(0,u.useRef)(null),l=(0,u.useRef)({selectedIndex:o,options:r,selectItem:n});return l.current={selectedIndex:o,options:r,selectItem:n},(0,u.useImperativeHandle)(t,()=>{let e=e=>{let{key:t}=e,n=l.current;return"ArrowUp"===t?(e.preventDefault(),n.selectedIndex<=0?i(r.length-1):i(c()(n.selectedIndex-1,0,n.options.length-1))):"ArrowDown"===t?(e.preventDefault(),n.selectedIndex>=n.options.length-1?i(0):i(c()(n.selectedIndex+1,0,n.options.length-1))):("Enter"===t||"Tab"===t)&&(e.preventDefault(),n.options.length>0&&n.selectItem(o)),e.stopPropagation(),e.preventDefault(),!0};return{onKeyDown:t=>{let{event:n}=t;return!!["ArrowUp","ArrowDown","Enter","Tab"].includes(n.key)&&e(n)}}}),(0,u.useEffect)(()=>
1{if(a.current){var e;null==a||null===(e=a.current)||void 0===e||e.scrollIntoView({behavior:"smooth",block:"center",inline:"nearest"})}},[o]),{selectedIndex:o,selectedItemEl:a}},g=e=>{let{char:t,MenuComponent:n,pluginKey:d,command:c,allowSpaces:u=!1,...h}=e;return i.hj.create({...h,addOptions:()=>({HTMLAttributes:{},suggestion:{char:t,pluginKey:d,allowSpaces:u,startOfLine:!1,command:c,render:()=>{let e=null,t=null;return{onStart:r=>{if(t&&e){e.updateProps(r),t.setProps({getReferenceClientRect:r.clientRect}),t.show();return}e=new m.M(n,{props:r,editor:r.editor});let o=r.editor.view.dom.parentElement;t=(0,p.ZP)(o,{getReferenceClientRect:r.clientRect,appendTo:()=>document.body,content:e.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"bottom-start",zIndex:s.qZ.zIndices.dropdown,popperOptions:{modifiers:[{name:"preventOverflow",options:{padding:{bottom:8}}},{name:"flip",options:{fallbackPlacements:["auto-start"]}}]}})},onUpdate(n){null==e||e.updateProps(n),null==t||t.setProps({getReferenceClientRect:n.clientRect})},onKeyDown(n){var r;return"Escape"===n.event.key?(null==t||t.destroy(),null==e||e.destroy(),t=null,e=null,!0):null==e?void 0:null===(r=e.ref)||void 0===r?void 0:r.onKeyDown(n)},onExit(n){let r=d.getState(n.editor.view.state);!0!==r.active&&(null==t||t.destroy(),null==e||e.destroy(),t=null,e=null)}}}}}),addProseMirrorPlugins(){return[function(e){let t,{pluginKey:n=a,editor:s,char:d="@",allowSpaces:c=!1,prefixSpace:u=!0,startOfLine:p=!1,decorationTag:m="span",decorationClass:h="suggestion",command:g=()=>null,items:f=()=>[],render:x=()=>({}),allow:v=()=>!0}=e,b=null==x?void 0:x(),y=e=>{e.dispatch(e.state.tr.setMeta(n,{active:!1,decorationId:"",key:null,range:l,query:null,text:null,composing:!1}))};return new r.Sy({key:n,view(){return{update:async(e,n)=>{var r,o,i,a,l;let d=null===(r=this.key)||void 0===r?void 0:r.getState(n),c=null===(o=this.key)||void 0===o?void 0:o.getState(e.state),u=d.active&&c.active&&d.range.from!==c.range.from,p=!d.active&&c.active,m=d.active&&!c.active,h=!p&&!m&&d.query!==c.query,x=p||u,v=h&&!u,y=m||u;if(!x&&!v&&!y)return;let C=y&&!x?d:c,w=document.querySelector('[data-decoration-id="'.concat(C.decorationId,'"]'));t={editor:s,range:C.range,query:C.query,text:C.text,items:v||x?await f({editor:s,query:C.query}):[],command:e=>{g({editor:s,range:C.range,props:e})},decorationNode:w,clientRect:w?()=>{var e;let{decorationId:t}=null===(e=this.key)||void 0===e?void 0:e.getState(s.state),n=document.querySelector('[data-decoration-id="'.concat(t,'"]'));return n.getBoundingClientRect()}:null},y&&(null==b||null===(i=b.onExit)||void 0===i||i.call(b,t)),v&&(null==b||null===(a=b.onUpdate)||void 0===a||a.call(b,t)),x&&(null==b||null===(l=b.onStart)||void 0===l||l.call(b,t))},destroy:()=>{var e;t&&(null==b||null===(e=b.onExit)||void 0===e||e.call(b,t))}}},state:{init:()=>({active:!1,decorationId:"",range:l,key:null,query:null,text:null,composing:!1}),apply(e,t,r,o){let a;a=e.getMeta(n)?{...e.getMeta(n)}:{...t};let{isEditable:m}=s,{composing:h}=s.view,{selection:g}=e,{empty:f,from:x}=g;if(a.composing=h,!a.active&&a.key!==d)return a;if(a.active&&a.key===d)return a.key=null,a;if(m&&(f||s.view.composing)){t.range&&(x<t.range.from||x>t.range.to)&&!h&&!t.composing&&(a.active=!1);let e=function(e){var t;let{char:n,allowSpaces:r,prefixSpace:o,startOfLine:a,$position:l}=e,s=(0,i.Ov)(n),d=new RegExp("\\s".concat(s,"$")),c=a?"^":"",u=r?RegExp("".concat(c).concat(s,".*?(?=\\s").concat(s,"|$)"),"gm"):RegExp("".concat(c,"(?:^)?").concat(s,"[^\\s").concat(s,"]*"),"gm"),p=null===(t=l.nodeBefore)||void 0===t?void 0:t.text;if(!p)return null;let m=l.pos-p.length,h=Array.from(p.matchAll(u)).pop();if(!h||void 0===h.input||void 0===h.index)return null;let g=h.input.slice(Math.max(0,h.index-1),h.index),f=/^[\s\0]?$/.test(g);if(o&&!f)return null;let x=m+h.index,v=x+h[0].length;return(r&&d.test(p.slice(v-1,v+1))&&(h[0]+=" ",v+=1),x<l.pos&&v>=l.pos)?{range:{from:x,to:v},query:h[0].slice(n.length),text:h[0]}:null}({char:d,allowSpaces:c,prefixSpace:u,startOfLine:p,$position:g.$from});e&&v({editor:s,state:o,range:e.range})?(a.active=!0,a.decorationId=t.decorationId?t.decorationId:"id_".concat(Math.floor(4294967295*Math.random())),a.range=e.range,a.query=e.query,a.text=e.text):a.active=!1}else a.active=!1;return a.active||(a.decorationId=null,a.range=l,a.query=null,a.text=null),a}},props:{handleKeyDown(e,t){var r;let o=e.state.tr,i=this.getState(e.state);if(!i)return!1;let{active:a,range:l}=i;if(!l)return!1;if(a||t.key!==d||t.metaKey){if(!a)return!1;"Escape"===t.key&&y(e)}else{let r={...i};r.active=!0,r.key=t.key,r.query="",e.dispatch(o.setMeta(n,r))}return(null==b?void 0:null===(r=b.onKeyDown)||void 0===r?void 0:r.call(b,{view:e,event:t,range:l}))||!1},decorations(e){let t=this.getState(e);if(!t)return null;let{active:n,range:r,decorationId:i}=t;return n&&r?o.EH.create(e.doc,[o.p.inline(r.from,r.to,{nodeName:m,class:h,"data-decoration-id":i||""})]):null}}})}({editor:this.editor,...this.options.suggestion})]}})}},97676:function(e,t,n){"use strict";n.d(t,{FC:function(){return i},KX:function(){return a},Ox:function(){return r}});let r={light:{gray:{hex:"#D6D6D6",name:"Gray"},red:{hex:"#FFBDBD",name:"Red"},orange:{hex:"#F8CB96",name:"Orange"},yellow:{hex:"#FBEB8F",name:"Yellow"},green:{hex:"#C9FDCB",name:"Green"},blue:{hex:"#D1E5FD",name:"Blue"},purple:{hex:"#D5CCFB",name:"Purple"},primary:{hex:"#FFD300"},secondary:{hex:"#FF7979"},tertiary:{hex:"#A9FF8B"}},dark:{gray:{hex:"#999999",name:"Gray"},red:{hex:"#EB5252",name:"Red"},orange:{hex:"#DD8404",name:"Orange"},yellow:{hex:"#CAAD07",name:"Yellow"},green:{hex:"#50BD3D",name:"Green"},blue:{hex:"#85BAFA",name:"Blue"},purple:{hex:"#B1A0F8",name:"Purple"},primary:{hex:"#856E01"},secondary:{hex:"#952222"},tertiary:{hex:"#257D04"}}},o=e=>Object.entries(r[e]).reduce((e,t)=>
1{let[n,r]=t,o={backgroundColor:r.hex};return e['&[variant="'.concat(n,'"]')]=o,e},{backgroundColor:"var(--highlight-color)"}),i={borderRadius:"0.125em",px:".05em",mx:"-.05em",boxDecorationBreak:"clone"},a={default:{"mark.highlight":{color:"black","--link-color":"black",...o("light"),...i}},dark:{"mark.highlight":{color:"black",...o("dark")}}}},89:function(e,t,n){"use strict";n.d(t,{E_:function(){return l},RJ:function(){return o},eR:function(){return r}});let r={light:{gray:{hex:"#7A7A7A",name:"Gray"},red:{hex:"#EB0000",name:"Red"},orange:{hex:"#BD6F00",name:"Orange"},yellow:{hex:"#B29500",name:"Yellow"},green:{hex:"#008545",name:"Green"},blue:{hex:"#006ED6",name:"Blue"},purple:{hex:"#7B57FF",name:"Purple"}},dark:{gray:{hex:"#AFAFAF",name:"Gray"},red:{hex:"#EF8784",name:"Red"},orange:{hex:"#F5C274",name:"Orange"},yellow:{hex:"#F5F380",name:"Yellow"},green:{hex:"#8CE29F",name:"Green"},blue:{hex:"#8DD4FB",name:"Blue"},purple:{hex:"#A08CF8",name:"Purple"}}},o=Object.keys(r.light),i=(e,t)=>Object.entries(r[e]).reduce((e,n)=>{let[r,o]=n,i={"--text-color":o.hex},a=t?t(r):'&[variant="'.concat(r,'"]');return e[a]=i,e},{}),a="var(--text-color, var(--body-color))",l={default:{"span.textColor":{...i("light"),color:a},".block-numbered":{...i("light",e=>'&[data-text-color="'.concat(e,'"] li::before')),"li::before":{color:a}},".block-bullet":{...i("light",e=>'&[data-text-color="'.concat(e,'"] li::marker')),"li::marker":{color:a}}},dark:{"span.textColor":{...i("dark"),color:a},".block-numbered":{...i("dark",e=>'&[data-text-color="'.concat(e,'"] li::before')),"li::before":{color:a}},".block-bullet":{...i("dark",e=>'&[data-text-color="'.concat(e,'"] li::marker')),"li::marker":{color:a}}}}},62198:function(e,t,n){"use strict";n.d(t,{D:function(){return g},Y:function(){return o}});var r,o,i=n(72338),a=n(90507),l=n(86353),s=n(52322),d=n(73200),c=n(87254),u=n(27333),p=n(4030),m=n(17630);let h=e=>{let{node:t}=e,{horizontalAlign:n,placeholder:r}=t.attrs,o=r||c.ag._({id:"wja8aL"});return(0,s.jsx)(p.lO,{...e,style:{display:"flex",flexDirection:"column",...(0,m.nN)(n)},children:(0,s.jsx)(a.ms,{className:(0,d.cx)("title",u.A8),"data-placeholder":o,style:{minWidth:"min(100%, 10em)"}})})};(r=o||(o={}))[r.DocTitle=1]="DocTitle";let g=i.NB.create({name:"title",content:"inline*",group:"block cardNotesBlock",defining:!0,selectable:!1,addAttributes:()=>({level:{default:o.DocTitle}}),addNodeView:()=>(0,a.fW)(h,{update:l.E7}),parseHTML:()=>[{tag:"h1[class=title]"}],renderHTML(e){let{HTMLAttributes:t}=e;return["h1",(0,i.P1)(t,{class:"title"}),0]}})},50177:function(e,t,n){"use strict";n.d(t,{C:function(){return l},w:function(){return s}});var r=n(38564),o=n(37164),i=n(27191),a=n(55850);let l=()=>(0,o.x0)(5),s=a.I.extend({name:"UniqueToggleId"}).configure({attributeName:"id",types:["toggle"],initialValue:l,filterTransaction:e=>{let t=e.getMeta(r.Gt);return(null==t?void 0:t.isChangeOrigin)!==!0},pluginKey:new i.H$("UniqueToggleId")})},54999:function(e,t,n){"use strict";n.d(t,{AH:function(){return s},O4:function(){return d},U6:function(){return l},fH:function(){return i},xB:function(){return a}});var r=n(91994),o=n(47968);let i=e=>{let t=(0,r.bh)();return(0,o.R)(e)(t.getState())||!1},a=(e,t)=>{let n=(0,r.bh)();n.dispatch((0,o.pD)({toggleIds:[e],isExpanded:t}))},l=(e,t)=>{let n=[],i=(0,r.bh)();e.state.doc.descendants(e=>{if(!s(e))return;let{id:t}=e.attrs;n.push(t)}),i.dispatch((0,o.pD)({toggleIds:n,isExpanded:t}))},s=e=>"toggle"===e.type.name,d=e=>"toggleSummary"===e.type.name},36909:function(e,t,n){"use strict";n.d(t,{_:function(){return a}});var r=n(72338),o=n(97030),i=n.n(o);let a=r.hj.create({name:"updateAttributesAtPos",addCommands:()=>({updateAttributesAtPos:(e,t)=>n=>{let{tr:r}=n;return Object.entries(t).forEach(t=>{let[n,o]=t;r.setNodeAttribute(e,n,o)}),!0},updateNestedAttributesAtPos:(e,t)=>n=>{let{tr:r}=n,o=r.doc.nodeAt(e);return!!o&&(Object.entries(t).forEach(t=>{let[n,a]=t,l=i()(a)?{...o.attrs[n],...a}:a;r.setNodeAttribute(e,n,l)}),!0)}})})},62047:function(e,t,n){"use strict";n.d(t,{RT:function(){return C},vz:function(){return x},Sz:function(){return f},iS:function(){return v},WE:function(){return b}});var r=n(72338),o=n(27191),i=n(52780),a=n(11093),l=n(90221),s=n(14657),d=n(13608),c=n(96255),u=n(37872),p=n(59080),m=n(46795);let h=new o.H$("BlockHoverKey");class g{getHoverAbsPos(e){return this.hoverPos?(0,m.XV)(e,this.hoverPos):null}getAnnotableAbsPos(e){return this.annotatablePos?(0,m.XV)(e,this.annotatablePos):null}apply(e,t){let n=e.getMeta(h);return n&&"setHoverPos"in n&&this.handleSetPos(t,n),this}handleSetPos(e,t){return this.hoverPos=null===t.setHoverPos?null:(0,m.jS)(e,t.setHoverPos),this.annotatablePos=null===t.setAnnotatablePos?null:(0,m.jS)(e,t.setAnnotatablePos),this}constructor(){this.hoverPos=null,this.annotatablePos=null}}let f=e=>{var t;return(null===(t=e.find(e=>e.spec.isTableHover))||void 0===t?void 0:t.spec)||{}},x=e=>{var t;return(null===(t=e.find(e=>e.spec.isTableFocus))||void 0===t?void 0:t.spec)||{}},v=e=>e.some(e=>e.spec.isAnnotatableHover),b=e=>e.some(e=>e.spec.isBlockHover),y=(e,t)=>(0,s.R1)(e,t)||(0,u.nM)(e);function C(e){let t=new o.Sy({key:h,state:{init:()=>new g,apply:(e,t,n,r)=>t.apply(e,r)},props:{handleDOMEvents:{mousemove(e,t){if((0,l.s2)()||!t.target.closest(".".concat(d.vD)))return;let{clientX:n,clientY:r}=t,o=e.posAtCoords({left:n,top:r}),i=o&&e.state.doc.resolve(o.inside),a=null,s=null;if((null==i?void 0:i.nodeAfter)&&(a=i.pos,(0,c.KH)(i.nodeAfter)||(0,c.pv)(i.nodeAfter)||(s=i.pos)),!s){let t=e.posAtCoords({left:n-100,top:r}),o=t&&e.state.doc.resolve(t.inside);(null==o?void 0:o.nodeAfter)&&!(0,c.KH)(o.nodeAfter)&&!(0,c.pv)(o.nodeAfter)&&(s=o.pos)}let u=h.getState(e.state);if(a!==u.getHoverAbsPos(e.state)||s!==u.getAnnotableAbsPos(e.state)){let t=e.state.tr;t.setMeta(h,{setHoverPos:a,setAnnotatablePos:s}),e.dispatch(t)}}},decorations(e){var t,n;let o;let l=h.getState(e),d=l.getHoverAbsPos(e);if(null===d)return i.EH.empty;try{o=e.doc.resolve(d)}catch(e){return i.EH.empty}let c=[],u=(0,a.Ru)(o,y);
1u.forEach(e=>{let{pos:t,node:n}=e;c.push(i.p.node(t,t+n.nodeSize,{},{isBlockHover:!0}))});let m=(0,r.qv)(o,e=>"table"===e.type.name),g=(null===(t=o.nodeAfter)||void 0===t?void 0:t.type.name)==="tableCell"?{pos:o.pos,node:o.nodeAfter}:(0,r.qv)(o,e=>"tableCell"===e.type.name);if(m&&g){let e=p.rU.get(m.node),{left:t,top:n}=e.findCell(g.pos-(m.pos+1));c.push(i.p.node(m.pos,m.pos+m.node.nodeSize,{},{isTableHover:!0,rowHover:n,colHover:t}))}let f=e.selection.$from,x=(0,r.qv)(f,e=>"table"===e.type.name),v=(null===(n=f.nodeAfter)||void 0===n?void 0:n.type.name)==="tableCell"?{pos:f.pos,node:f.nodeAfter}:(0,r.qv)(f,e=>"tableCell"===e.type.name);if(x&&v){let e=p.rU.get(x.node),{left:t}=e.findCell(v.pos-(x.pos+1));c.push(i.p.node(x.pos,x.pos+x.node.nodeSize,{},{isTableFocus:!0,colFocus:t}))}let b=l.getAnnotableAbsPos(e);if(null!==b){let t;try{t=e.doc.resolve(b)}catch(e){return i.EH.empty}let n=(0,a.Ru)(t,s.R1);n.forEach(e=>{let{pos:t,node:n}=e;c.push(i.p.node(t,t+n.nodeSize,{},{isAnnotatableHover:!0}))})}try{return i.EH.create(e.doc,c)}catch(e){return i.EH.empty}}}});return t}},55395:function(e,t,n){"use strict";n.d(t,{w:function(){return r}}),n(96255);let r=e=>{var t;return(null===(t=e.find(e=>e.spec.isBlockWidthDecoration))||void 0===t?void 0:t.spec)||{}}},93486:function(e,t,n){"use strict";n.d(t,{z:function(){return S}});var r=n(72338),o=n(15690),i=n(9726),a=n(90507),l=n(11093),s=n(86353),d=n(52322),c=n(62614),u=n(28535),p=n(11082),m=n(77533),h=n(73200),g=n(91994),f=n(26803),x=n(98285),v=n(27333),b=n(47968),y=n(13180),C=n(39540);let w="0.125em",k=e=>{let{node:t,decorations:n}=e,{href:r,variant:o}=t.attrs,i=(0,g.CG)(b.Pw),l=(0,C.v)(n),s=i&&l,k=(0,y.R)(n),{linkUrl:j,handleClick:S,isCurrentPage:A}=(0,f.H)({url:r}),I="solid"===o?{backgroundColor:"var(--link-color)",backgroundImage:"var(--accent-gradient)",border:"".concat(w," solid var(--link-color)")}:"outline"===o?{border:"".concat(w," solid var(--link-color)"),backgroundColor:"var(--card-color)"}:void 0;return(0,d.jsx)(a.T5,{children:(0,d.jsx)(c.z,{as:s?u.xu:p.r,variant:"unstyled",display:"inline-flex",cursor:i?"text":"pointer",userSelect:i?"auto":"none",href:j||void 0,onClick:S,pos:"relative",style:I,_hover:{textDecoration:"none"},minW:"min(100%, 12em)",maxW:"100%",fontSize:"1em",py:"0.5em",minH:"2.75em",w:"var(--button-width)",h:"auto",px:"link"===o?"0.5em":"1em",className:(0,h.cx)("button","link"!==o&&x.wY,"solid"===o&&v.LY),"data-variant":o,"data-export-as-image":!0,"data-export-link":r,transitionProperty:"none",sx:{"@media print":{width:"auto"},outline:l?"2px solid var(--chakra-ring-color) !important":void 0},"data-is-current-page":A,children:(0,d.jsxs)(m.x,{as:"div",noOfLines:s||k?void 0:1,wordBreak:"break-all",className:(0,h.cx)("link"!==o&&v.A8),style:{color:"solid"===o?"var(--link-color-inverted)":"outline"===o?"var(--link-color)":void 0},textAlign:"center",children:[k&&(0,d.jsx)(m.x,{opacity:"0.3",pointerEvents:"none",contentEditable:!1,pos:"absolute",w:"100%",left:"0",textAlign:"center",children:"â¦"}),(0,d.jsx)(a.ms,{})]})})})};var j=n(36781);let S=r.NB.create({name:"button",content:"(text | emoji)*",marks:"",defining:!0,isolating:!0,selectable:!1,addNodeView:()=>(0,a.fW)(k,{update:s.E7}),addAttributes:()=>({href:{default:""},variant:{default:"solid"}}),addCommands:()=>({addButtonToGroup:e=>t=>{let{state:n,chain:r}=t,o=n.doc.nodeAt(e);if(!o)return!1;let a=e+o.nodeSize-1;return r().insertContentAt(a,{...i.e.button,attrs:{variant:j.e6[o.type.name].defaultVariant,href:""}}).selectInsertedNode().run(),!0},handleButtonDelete:e=>t=>{let{dispatch:n,state:i,chain:a}=t;if(!n)return!0;let s=(0,r.Kk)(e=>"button"===e.type.name)(i.selection);if(!s||e&&!(0,l.bR)(s.node))return!1;let d=(0,r.Kk)(e=>"buttonGroup"===e.type.name)(i.selection);return d&&1===d.node.childCount?a().deleteNode("buttonGroup").command(e=>{let{tr:t}=e,n=(0,o.E)(t.doc.resolve(d.pos));return n&&t.setSelection(n),!0}).focus().run():a().deleteNode("button").command(e=>{let{tr:t}=e,n=(0,o.E)(t.doc.resolve(s.pos-1),-1);return n&&t.setSelection(n),!0}).focus().run(),!0}}),parseHTML:()=>[{tag:"button"}],renderHTML(e){let{HTMLAttributes:t}=e;return["button",(0,r.P1)(t),0]}})},50499:function(e,t,n){"use strict";n.d(t,{Ns:function(){return y},X0:function(){return w},mJ:function(){return C}});var r=n(52322),o=n(38035),i=n(32899),a=n(42946),l=n(49929),s=n(94523),d=n(5879),c=n(87254),u=n(2784),p=n(91994),m=n(4878),h=n(90507),g=n(47968),f=n(4030),x=n(13180),v=n(17630),b=n(36781);let y=e=>{let{node:t}=e,{horizontalAlign:n}=t.attrs,i=(0,m.TZ)(),a=i?"column":"row";return(0,r.jsx)(f.lO,{...e,children:(0,r.jsxs)(o.k,{w:"100%","data-selection-ring":"padded",borderRadius:"var(--box-border-radius)",direction:a,justify:(0,v.yg)(n)||"var(--flex-align)",sx:C(i),gap:"0.5em",children:[(0,r.jsx)(h.ms,{}),(0,r.jsx)(w,{...e,direction:a,maxButtons:b.YZ})]})})},C=e=>({"> [data-node-view-content]":{display:"contents","> [data-node-view-content-inner]":{display:"contents"}},"--button-width":e?"100%":"auto",".node-button":{width:"var(--button-width)",".button":{width:"100%"}},_hover:{".add-button":{opacity:1}}}),w=e=>{let{editor:t,getPos:n,decorations:m,node:h,direction:f,maxButtons:v,tooltip:b}=e,y=(0,p.CG)(g.Pw),C=(0,x.R)(m),w=!v||h.childCount<v,k=(0,u.useCallback)(()=>{t.commands.addButtonToGroup(n())},[t,n]);return w&&y?(0,r.jsx)(o.k,{position:"relative",children:(0,r.jsx)(s.kH,{label:b||(0,r.jsx)(d.cC,{id:"xe7fzh"}),placement:"top",children:(0,r.jsx)(i.h,{icon:(0,r.jsx)(l.G,{icon:a.r8p}),"aria-label":c.ag._({id:"6oU9VZ"}),size:"xs",variant:"plain",isRound:!0,onClick:k,opacity:C&&y?.5:0,className:"add-button",transitionProperty:"opacity",transitionDuration:"normal",position:C?"static":"absolute",left:"column"===f?"50%":0,top:"50%",transform:C?void 0:"column"===f?"translateX(-50%)":"row-reverse"===f?"translateY(-50%) translateX(-100%)":"translateY(-50%)"})})}):null}},36781:function(e,t,n){"use strict";n.d(t,{Y0:function(){return l},YZ:function(){return a},e6:function(){return s}});var r=n(42946),o=n(54933),i=n(87254);let a=3,l=()=>[{name:i.ag._({id:"bjuYAW"}),key:"solid",icon:o.r9b},{name:i.ag._({id:"bCuf07"}),key:"outline",icon:r.r9b},{name:i.ag._({id:"1lWK8g"}
1),key:"link",icon:r.nNP}],s={buttonGroup:{alignEnabled:!0,variants:["solid","outline"],defaultVariant:"solid"},navbarButtons:{alignEnabled:!1,variants:["solid","outline"],defaultVariant:"solid"},navbarLinks:{alignEnabled:!0,variants:["link"],defaultVariant:"link"}}},31230:function(e,t,n){"use strict";n.d(t,{d:function(){return d}});var r=n(52322),o=n(25059),i=n(90507),a=n(4030),l=n(86353);let s=e=>(0,r.jsx)(a.lO,{...e,children:(0,r.jsx)("pre",{children:(0,r.jsx)(i.ms,{as:"code"})})}),d=o.ZP.extend({selectable:!1,isolating:!0,addNodeView:()=>(0,i.fW)(s,{update:l.E7})})},19283:function(e,t,n){"use strict";n.d(t,{a:function(){return r}});let r={UniqueAttribute:1e4,CardMention:1001,DocMention:1001,UserMention:1001,UndoInputRuleKeymap:1001,HorizontalAlign:1001,Collaboration:1e3,Highlight:150,FootnoteLabel:150,TextColor:150,Code:150,Link:140,SlashMenu:104,EmojiShortcuts:104,MentionSuggestionMenu:104,List:103,Table:102,Image:102,Gallery:102,CardLayoutItem:101,MediaPlaceholder:101,Layout:101,Footnote:101,Card:101,Toggle:101,SmartLayout:101,KeyMapOverride:100,GlobalDragHandle:99,CardIds:1,KeyBoardCatchall:1,UndoHistory:-100}},45534:function(e,t,n){"use strict";n.d(t,{$7:function(){return f},$m:function(){return m},zL:function(){return h}});var r=n(72338),o=n(3027),i=n(27191),a=n(15690);function l(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=t>0,{parent:r,doc:o}=e,i=e.start(),s=e.after();if(r.type.spec.isolating){let e=o.resolve(n?s-1:i),t=(0,a.E)(e,n?1:-1);if(n){let e=o.resolve(t.to),n=e.node();if(n&&n.isTextblock&&0===n.content.size)return t.to+1}return n?t.to:t.from}let d=e.start(e.depth-1);return l(e.doc.resolve(d),t)}n(91073);var s=n(93814),d=n(19283),c=n(16190);let u=e=>{let t=l(e,-1);return e.pos===t?s.k_:t},p=(e,t)=>{let n=l(t,1);return t.pos===n?e.state.doc.content.size-s.k_:n},m=r.hj.create({name:"KeyMapOverride",priority:d.a.KeyMapOverride,addOptions:()=>({addSelectionKeyMaps:!1}),addKeyboardShortcuts(){let e=()=>this.editor.commands.first(e=>{let{commands:t}=e;return[()=>t.handleCardAccentDelete(),()=>{var e;return null===(e=t.handleSmartLayoutDelete)||void 0===e?void 0:e.call(t,!0,!1)},()=>t.deleteSelectionAndSelectNear(-1),()=>t.deleteSelection(),e=>{let{view:t,state:n,dispatch:r}=e;return(0,c.Ly)(n,r,t)},()=>t.unwrapQuoteOnDelete(),e=>{let{view:n,state:r,tr:o}=e,i=t.joinBackward();return i&&o.setMeta("annotationEvent",{type:"join-backward",joinPos:r.selection.from,atBeginning:n.endOfTextblock("backward")}),i},()=>t.selectNodeBackward(),()=>t.handleLayoutDelete(!1),()=>t.handleButtonDelete(!0),()=>t.deleteCardIfEmpty(!1),()=>t.mergeCardsOnDelete(!1)]}),t=()=>this.editor.commands.first(e=>{let{commands:t}=e;return[()=>t.handleCardAccentDelete(),()=>{var e;return null===(e=t.handleSmartLayoutDelete)||void 0===e?void 0:e.call(t,!0,!0)},()=>t.deleteSelectionAndSelectNear(),()=>t.deleteSelection(),e=>{let{view:n,state:r,tr:o}=e,i=t.joinForward();return i&&o.setMeta("annotationEvent",{type:"join-forward",joinPos:r.selection.from,atEnd:n.endOfTextblock("forward")}),i},()=>t.selectNodeForward(),()=>t.handleLayoutDelete(!0),()=>t.handleButtonDelete(!0),()=>t.deleteCardIfEmpty(!0),()=>t.mergeCardsOnDelete(!0)]}),n={};return this.options.addSelectionKeyMaps&&(n={"Mod-a":e=>{let{editor:t}=e,{selection:n}=t.state;if(n instanceof i.qv&&n.node.type.spec.isolating)return t.commands.selectAll();let r=l(t.state.selection.$from,-1),o=l(t.state.selection.$to,1);return n.from===r&&n.to===o?t.commands.selectAll():(t.commands.command(e=>{let{tr:t}=e;return t.setSelection(i.Bs.create(t.doc,r,o)),!0}),!0)},"Mod-ArrowUp":e=>{let{editor:t}=e,n=u(t.state.selection.$from);if(!n)return!1;let r=t.state.doc.resolve(n);if(o.Q.valid(r)){let e=new o.Q(r);return t.view.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}return t.chain().setTextSelection(n).scrollIntoView().run()},"Mod-Shift-ArrowUp":e=>{let{editor:t}=e,n=u(t.state.selection.$from);return!!n&&t.chain().setTextSelection({from:n,to:t.state.selection.to}).scrollIntoView().run()},"Mod-ArrowDown":e=>{let{editor:t}=e,n=p(t,t.state.selection.$to),r=t.state.doc.resolve(n);if(o.Q.valid(r)){let e=new o.Q(r);return t.view.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}return t.chain().setTextSelection(n).scrollIntoView().run()}
1,"Mod-Shift-ArrowDown":e=>{let{editor:t}=e,n=p(t,t.state.selection.$to);return t.chain().setTextSelection({from:t.state.selection.from,to:n}).scrollIntoView().run()},"Shift-Mod-a":e=>{let{editor:t}=e;return t.commands.selectAll()}}),{...n,Enter:()=>this.editor.commands.first(e=>{let{commands:t}=e;return[()=>t.newlineInCode(),()=>t.createParagraphNear(),()=>t.liftEmptyBlock(),e=>{let{view:n,state:r,tr:o}=e;return o.setMeta("annotationEvent",{type:"split-block",splitPos:r.selection.from,atBeginning:n.endOfTextblock("backward")}),t.splitBlock()}]}),Backspace:e,"Mod-Backspace":e,"Shift-Backspace":e,Delete:t,"Mod-Delete":t,Space:()=>this.editor.commands.first(e=>{let{commands:t}=e;return[()=>t.handleSpaceToZoom()]})}}}),h=r.hj.create({name:"UndoInputRuleKeymap",priority:d.a.UndoInputRuleKeymap,addKeyboardShortcuts:()=>({"Shift-Mod-a":e=>{let{editor:t}=e;return t.commands.selectAll()},"Mod-z":e=>{let{editor:t}=e;return t.commands.undoInputRule()},Backspace:e=>{let{editor:t}=e;return t.commands.undoInputRule()},"Mod-Backspace":e=>{let{editor:t}=e;return t.commands.undoInputRule()}})});var g=n(17292);let f=r.hj.create({name:"KeyBoardCatchall",priority:d.a.KeyBoardCatchall,addKeyboardShortcuts:()=>({Tab:e=>{let{editor:t}=e;return t.view.hasFocus()},"Shift-Tab":e=>{let{editor:t}=e;return t.view.hasFocus()}}),addProseMirrorPlugins:()=>[new i.Sy({key:new i.H$("KeyBoardCatchall"),props:{handleKeyDown:(e,t)=>g.F7.handleKeydown(t)}})]})},72762:function(e,t,n){"use strict";n.d(t,{g:function(){return p}});var r=n(72338),o=n(90507),i=n(86353),a=n(52322),l=n(4030);let s=e=>{let{node:t}=e,{fontSize:n,placeholder:r}=t.attrs;return(0,a.jsx)(l.lO,{...e,children:(0,a.jsx)(o.ms,{as:"li","data-testid":"bullet-list-item","data-font-size":n,"data-placeholder":r})})};var d=n(73528),c=n(44368);let u=/^\s*([-*])\s$/,p=r.NB.create({name:c.W.Bullet,content:"inline*",defining:!0,group:"block cardNotesBlock",selectable:!1,allowFontSizes:"body",addNodeView:()=>(0,o.fW)(s,{as:"ul",update:i.E7,updateWrapperEl:(e,t)=>{e.setAttribute("indent",t.node.attrs.indent)}}),addOptions:()=>({HTMLAttributes:{}}),addAttributes:()=>({indent:{default:0},fontSize:{default:null}}),addInputRules(){return[(0,d.Bx)({find:u,type:this.type},this.editor.state.schema)]},addKeyboardShortcuts:()=>
1({"Mod-Shift-8":e=>{let{editor:t}=e;return t.commands.setListItems({variant:c.W.Bullet})},"Mod-.":e=>{let{editor:t}=e;return t.commands.setListItems({variant:c.W.Bullet})}}),parseHTML(){return[{tag:'li[variant="'.concat(this.name,'"]')}]},renderHTML(e){let{HTMLAttributes:t}=e;return["li",(0,r.P1)(this.options.HTMLAttributes,t,{variant:this.name}),0]}})},73528:function(e,t,n){"use strict";n.d(t,{aV:function(){return v},N:function(){return x},S3:function(){return b},Bx:function(){return y}});var r=n(72338),o=n(47577),i=n(96255),a=n(19283),l=n(2689),s=n.n(l),d=n(27191),c=n(52780),u=n(44368);let p=s()(10),m=["blockquote","card","sectionBreak"],h=(e,t)=>"numbered"===e.type.name||(0,u.y)(e)&&e.attrs.indent>t||e.isAtom||m.includes(e.type.name),g=e=>new d.Sy({key:new d.H$("ListPlugin"),props:{decorations:e=>{let{doc:t}=e,n=[],r=new Map,o=(e,t)=>{var n;return(null===(n=r.get(e))||void 0===n?void 0:n[t])||1},i=(e,t,n)=>{let o=r.get(e);try{o[t]=n}catch(e){console.error("(caught) [ListPlugin] setCounter error",e)}},a=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=r.get(e)||{};p.filter(e=>e>=t).forEach(e=>{n[e]=1}),r.set(e,n)},l=0;return t.descendants((e,t,s)=>{if((0,u.y)(e)&&e.firstChild){let r=e.firstChild.marks.find(e=>"textColor"===e.type.name);(null==r?void 0:r.attrs.variant)&&n.push(c.p.node(t,t+e.nodeSize,{"data-text-color":r.attrs.variant})),(null==r?void 0:r.attrs.hex)&&n.push(c.p.node(t,t+e.nodeSize,{style:"--text-color: ".concat(r.attrs.hex)}))}if(!s||(h(e,l)||a(s),"numbered"!==e.type.name))return;r.get(s)||a(s);let d=e.attrs.indent;l=d;let p=o(s,d);i(s,d,p+1),a(s,d+1),n.push(c.p.node(t,t+e.nodeSize,{},{listNumber:p}))}),0==n.length?c.EH.empty:c.EH.create(t,n)}}});var f=n(57336);let x=8,v=r.hj.create({name:"list",priority:a.a.List,addProseMirrorPlugins(){return[g(this.editor)]},addCommands:()=>({listToCards:()=>e=>{let{chain:t,state:n}=e,{selection:o,doc:a}=n,{from:l,to:s}=o,d=(0,r.b5)(a,{from:l,to:s},u.y),c=(0,r.Kk)(i.KH)(o);if(!d.length||!c)return!1;let p=c.pos+c.node.nodeSize,m=(0,f.OH)(d),h=(0,f.GV)(m);return t().insertContentAt(p,h).scrollIntoView().run(),!0},listToSmartLayout:e=>t=>{let{chain:n,state:o}=t,{selection:i,doc:a}=o,{from:l,to:s,$from:d,$to:c}=i,p=d.blockRange(c),m=(0,r.b5)(a,{from:l,to:s},u.y);if(!m.length||!p)return!1;let h=(0,f.OH)(m),g=(0,f.Pl)(h,e);return n().insertContentAt({from:p.start,to:p.end},g).selectInsertedNode().scrollIntoView().run(),!0},indent:e=>t=>{let{tr:n,dispatch:r,state:o}=t;if(!r)return!0;let i=!1;return n.selection.ranges.forEach(t=>{let r=t.$from.pos,a=t.$to.pos;o.doc.nodesBetween(r,a,(t,r)=>{let{indent:o}=t.attrs,a=Object.values(u.W);a.includes(t.type.name)&&o+e>=0&&o+e<=x&&(n.setNodeMarkup(r,void 0,{...t.attrs,indent:o+e}),i=!0)})}),i},setListItems:e=>{let{variant:t}=e;return e=>{let{tr:n,dispatch:r,state:o}=e;return!r||(n.selection.ranges.forEach(e=>{let r=e.$from.pos,i=e.$to.pos;o.doc.nodesBetween(r,i,(e,r)=>{let i=Object.values(u.W);i.includes(e.type.name)?n.setNodeMarkup(r,o.schema.nodes[t],e.attrs):e.isTextblock&&n.setNodeMarkup(r,o.schema.nodes[t],{...e.attrs,indent:0})})}),!0)}},toggleListItems:e=>{let{variant:t}=e;return e=>{let{commands:n,editor:r}=e;return b(r,t)?n.setNode("paragraph"):n.setListItems({variant:t})}}}),addKeyboardShortcuts:()=>({Enter:e=>{let t,n,{editor:r}=e;for(let e of Object.values(u.W))if(r.isActive(e)){n=r.getAttributes(e),t=e;break}if(void 0===t)return!1;let{from:o,$from:i,empty:a}=r.state.selection;return!!a&&(0==i.parent.content.size?n.indent>0?r.commands.indent(-1):r.commands.setNode("paragraph",n):0===i.parentOffset?(n.checked&&(n.checked=!1),r.chain().insertContentAt(o-1,{type:t,attrs:n}).selectInsertedNode().run()):i.parentOffset===i.parent.content.size&&(n.checked&&(n.checked=!1),r.chain().insertContentAt(o+1,{type:t,attrs:n}).selectInsertedNode().run()))},Backspace:e=>{let t,n,{editor:r}=e;for(let e of Object.values(u.W))if(r.isActive(e)){n=r.getAttributes(e),t=e;break}if(void 0===t)return!1;let{$from:o,empty:i}=r.state.selection;return!!i&&0==o.parentOffset&&r.commands.setNode("paragraph",n)},Tab:e=>{let{editor:t}=e;return t.commands.indent(1)},"Shift-Tab":e=>{let{editor:t}=e;return t.commands.indent(-1)},"Mod-]":e=>{let{editor:t}=e;return t.commands.indent(1)},"Mod-[":e=>{let{editor:t}=e;return t.commands.indent(-1)}})}),b=(e,t)=>{let n=Object.values(u.W).filter(e=>e!==t);return e.isActive(t)&&!n.some(t=>e.isActive(t))},y=(e,t)=>(0,o.Wy)(e,[t.nodes.heading,t.nodes.title])},99173:function(e,t,n){"use strict";n.d(t,{k:function(){return m}});var r=n(72338),o=n(90507),i=n(86353),a=n(73528),l=n(44368),s=n(52322),d=n(4030);let c=[e=>e.toString(),e=>String.fromCharCode(96+e),e=>
1(function(e){let t={M:1e3,CM:900,D:500,CD:400,C:100,XC:90,L:50,XL:40,X:10,IX:9,V:5,IV:4,I:1},n="";for(let r of Object.keys(t)){let o=Math.floor(e/t[r]);e-=o*t[r],n+=r.repeat(o)}return n})(e).toLowerCase()],u=e=>{var t;let{decorations:n,node:r}=e,{indent:i,fontSize:a,placeholder:l}=r.attrs,u=null===(t=n.find(e=>e.spec.listNumber))||void 0===t?void 0:t.spec.listNumber,p=c[i%c.length]||c[0],m=p(u);return(0,s.jsx)(d.lO,{...e,children:(0,s.jsx)(o.ms,{as:"li","data-list-counter":m,"data-font-size":a,"data-placeholder":l})})},p=/^(\d+)\.\s$/,m=r.NB.create({name:l.W.Numbered,content:"inline*",defining:!0,group:"block cardNotesBlock",selectable:!1,allowFontSizes:"body",addOptions:()=>({HTMLAttributes:{}}),addNodeView:()=>(0,o.fW)(u,{as:"ol",update:i.E7,updateWrapperEl:(e,t)=>{e.setAttribute("indent",t.node.attrs.indent)}}),addAttributes:()=>({indent:{default:0},fontSize:{default:null}}),addInputRules(){return[(0,a.Bx)({find:p,type:this.type},this.editor.state.schema)]},addKeyboardShortcuts:()=>({"Mod-/":e=>{let{editor:t}=e;return t.commands.setListItems({variant:l.W.Numbered})},"Mod-Shift-7":e=>{let{editor:t}=e;return t.commands.setListItems({variant:l.W.Numbered})}}),parseHTML(){return[{tag:'li[variant="'.concat(this.name,'"]')}]},renderHTML(e){let{HTMLAttributes:t}=e;return["li",(0,r.P1)(this.options.HTMLAttributes,t,{variant:this.name}),0]}})},57336:function(e,t,n){"use strict";n.d(t,{Ah:function(){return p},GV:function(){return c},OH:function(){return s},Pl:function(){return u}});var r=n(54004),o=n.n(r),i=n(44368),a=n(11093),l=n(85818);let s=e=>{let t=[];for(let n=0;n<e.length;n++){let r=e[n],o=r.node.attrs.indent,i=d(e,n,e=>e.node.attrs.indent>o),a=s(i);t.push({node:r.node,pos:r.pos,children:a}),n+=i.length}return t},d=(e,t,n)=>{let r=[];for(let o=t+1;o<e.length;o++){let t=e[o];if(n(t))r.push(t);else break}return r},c=e=>e.map(e=>{let t=c(e.children);return{type:"card",content:[{type:"heading",attrs:{level:Math.min(e.node.attrs.indent+1,l.MQ)},content:[{type:"text",text:e.node.textContent}]},...t]}}),u=(e,t)=>({type:"smartLayout",attrs:{variantKey:t},content:e.map(e=>{let t=[{type:"heading",attrs:{level:4},content:o()(e.node.content.toJSON())}];return t.push(...e.children.map(e=>{let t=o()(e.node.toJSON());return t.attrs.indent-=1,t})),{type:"smartLayoutCell",content:t}})}),p=e=>(0,a.pm)(e,i.y)},78277:function(e,t,n){"use strict";n.d(t,{cx:function(){return eh},Yn:function(){return U},fu:function(){return es},CG:function(){return ed},XX:function(){return ec},v0:function(){return W}});var r=n(72338),o=n(99787),i=n(13833),a=n(4889),l=n(90507),s=n(11093),d=n(38372),c=n(86353),u=n(29596),p=n(80236),m=n(66855),h=n(52322),g=n(28535),f=n(38035),x=n(73200),v=n(38045),b=n(14274),y=n(91994),C=n(98285),w=n(4878),k=n(47968),j=n(65940),S=n(13653),A=n(27835),I=n(28390),E=n(50019),z=n(2784),T=n(580),N=n(66028),M=n(35477),_=n(85573),L=n(75768),P=n(32899),R=n(42946),H=n(49929),D=n(94523),O=n(5879),B=n(87254);let F=e=>{let{frameRef:t,node:n,isStealth:r=!1,isDark:o}=e,i=(0,m.iJ)(n.attrs);return(0,h.jsxs)(f.k,{direction:"row",background:o?"gray.800":"gray.50",align:"center",borderBottom:"1px solid",borderColor:o?"gray.600":"gray.200",w:"100%",p:1,zIndex:2,position:r?"absolute":"relative",transitionProperty:"common",transitionDuration:"normal",opacity:r?0:1,_hover:{opacity:1},children:[(0,h.jsx)(_.I,{size:"xs",value:i,border:"0",noOfLines:1,color:o?"gray.200":"gray.600",pointerEvents:"none",readOnly:!0}),(0,h.jsxs)(L.h,{size:"xs",spacing:1,variant:"ghost",colorScheme:"gray",ml:2,children:[(0,h.jsx)(D.kH,{label:(0,h.jsx)(O.cC,{id:"HpK/8d"}),placement:"top",children:(0,h.jsx)(P.h,{isRound:!0,"aria-label":B.ag._({id:"HpK/8d"}),icon:(0,h.jsx)(H.G,{icon:R.XSV}),onClick:()=>{if(!t.current)return;let e=t.current.src;t.current.src="about:blank",setTimeout(()=>{t.current&&(t.current.src=e)},50)}})}),(0,h.jsx)(D.kH,{label:(0,h.jsx)(O.cC,{id:"Alx2/L"}),placement:"top",children:(0,h.jsx)(P.h,{isRound:!0,"aria-label":B.ag._({id:"Alx2/L"}),icon:(0,h.jsx)(H.G,{icon:R.gJF}),onClick:()=>{window.open(i,"_blank")}})})]})]})},W=e=>e&&o.zX[e]?o.zX[e]:o.Hw,G=e=>"".concat(b.v.EMBED_PROXY_URL,"?alt_url=").concat(e),U=e=>{let{isZoomed:t,useStealthNav:n,...r}=e,{node:o}
1=r,i=(0,z.useRef)(null),{colorMode:a}=(0,E.If)(),l="dark"===a,s=(0,w.TZ)(),{url:d,proxy:c,source:u,embed:p}=o.attrs,m=W(u),g=m.preferHtml&&(null==p?void 0:p.html);if(g)return(0,h.jsx)(M.$,{html:p.html,w:t?"100%":void 0,onClick:t?N.UW:void 0});let v=m.rewriteEmbedUrl&&d?m.rewriteEmbedUrl(d):d,b=c?G(v):v||"about:blank";return(0,h.jsxs)(f.k,{direction:"column",h:"100%",w:"100%",maxW:"var(--media-maxW)",maxH:"var(--media-maxH)",borderRadius:t?"lg":"var(--box-border-radius)",border:"1px solid",borderColor:l?"gray.600":"gray.200",overflow:"hidden",position:"relative","data-selection-ring":"inside","data-selection-background":!0,className:(0,x.cx)("embed-viewer"),onClick:t?N.UW:void 0,children:[(0,h.jsx)(F,{...r,frameRef:i,isDark:l,isStealth:n}),!t&&(0,h.jsx)(I.Y$,{...r,frameRef:i}),(0,h.jsx)(T.A,{initialUrl:b,frameRef:i,iframeOptions:m.iframeOptions,css:{aspectRatio:s?"1 / 1.618":"1.618 / 1"},flex:"1"})]})};var V=n(11082),q=n(29117),$=n(77533),K=n(90439),Z=n(87205),Y=n(15425),X=n(17993),J=n(75009);let Q=e=>{var t;let{node:n,disableOpenButton:r=!1}=e,{meta:o,source:i}=n.attrs,a=(0,m.iJ)(n.attrs),l=W(i),s="embed.custom"===i||"video.custom"===i,d=(null==o?void 0:o.icon)||(null===(t=l.image)||void 0===t?void 0:t.src),c=(null==o?void 0:o.site)||(s?(0,Y.Gr)(a):l.label());return(0,h.jsxs)(X.g,{spacing:"0.25em",align:"flex-start",color:"black",w:"100%",fontSize:"0.9em",children:[(0,h.jsxs)(q.U,{align:"center",spacing:"0.25em",w:"100%",color:"var(--body-color-muted)",children:[(0,h.jsx)(ee,{icon:d}),(0,h.jsx)($.x,{noOfLines:1,flex:1,"data-testid":"site-name",fontSize:"0.9em",children:c}),l.downloadable&&a&&(0,h.jsx)(D.kH,{label:(0,h.jsx)(O.cC,{id:"mzI/c+"}),placement:"top",children:(0,h.jsx)(P.h,{"aria-label":B.ag._({id:"mzI/c+"}),icon:(0,h.jsx)(H.G,{icon:R.q7m}),onClick:()=>{let e=document.createElement("a");e.href=a,e.target="_blank",e.download=(null==o?void 0:o.title)||"file.pdf",e.dispatchEvent(new MouseEvent("click"))},variant:"unstyled",sx:C.un,fontSize:"0.7em",zIndex:2,onMouseDown:N.br})}),!r&&a&&(0,h.jsx)(D.kH,{label:(0,h.jsx)(O.cC,{id:"Alx2/L"}),placement:"top",children:(0,h.jsx)(P.h,{"aria-label":B.ag._({id:"Alx2/L"}),icon:(0,h.jsx)(H.G,{icon:R.gJF}),onClick:()=>{window.open(a,"_blank")},variant:"unstyled",zIndex:2,fontSize:"0.7em",onMouseDown:N.br,sx:C.un})})]}),(0,h.jsx)($.x,{fontWeight:"bold",noOfLines:1,maxW:"90%","data-testid":"title",color:"var(--body-color)",wordBreak:"break-all",children:null==o?void 0:o.title}),(null==o?void 0:o.description)&&(0,h.jsx)($.x,{noOfLines:[2,3],whiteSpace:"normal",maxW:"100%",color:"var(--body-color-muted)",children:o.description})]})},ee=e=>{let{icon:t,...n}=e;return t?(0,h.jsx)(J.E,{src:t,h:"1.5em",borderRadius:"sm",...n}):(0,h.jsx)($.x,{as:"span",...n,children:(0,h.jsx)(H.G,{icon:R.m6E})})};var et=n(54933),en=n(19034),er=n.n(en),eo=n(16494),ei=n(84286);let ea=e=>{let{node:t}=e,{thumbnail:n,meta:r,source:o}=t.attrs,i=(null==n?void 0:n.src)||(null==n?void 0:n.tempUrl);return(null==n?void 0:n.showPlaceholder)?(0,h.jsx)(ei.k3,{hasUploadError:n.uploadStatus===eo.D.Error,isUploading:n.uploadStatus===eo.D.Uploading,width:"100%",borderRadius:"none",icon:"embed.pdf"===o?R.gSj:R.m6E}):i?(0,h.jsxs)(f.k,{flex:1,color:"white",position:"relative",children:[(0,h.jsx)(g.xu,{flex:1,overflow:"hidden",bgColor:"white",children:(0,h.jsx)(J.E,{src:i,position:"absolute",objectFit:"cover",width:"100%",height:"100%"})}),(null==n?void 0:n.uploadStatus)===eo.D.Uploading&&(0,h.jsx)(ei.HI,{}),(null==r?void 0:r.duration)&&(0,h.jsxs)(q.U,{fontSize:"0.75em",backgroundColor:"blackAlpha.700",color:"white",position:"absolute",right:0,bottom:0,py:1,px:2,"data-thumbnail-hidden":!0,children:[(0,h.jsx)(H.G,{icon:et.zc}),(0,h.jsx)($.x,{children:function(e){let t=er().duration(e,"seconds"),n=t.hours().toString().padStart(2,"0"),r=t.minutes().toString().padStart(2,"0"),o=t.seconds().toString().padStart(2,"0");return t>=er().duration(1,"hour")?n+":"+r+":"+o:r+":"+o}(r.duration)})]})]}):null},el=e=>e&&(!e.height||e.height>=50)&&(!e.width||e.width>=50),es=e=>{let{node:t}=e,{thumbnail:n,sourceUrl:r}=t.attrs;return(0,h.jsxs)(f.k,{overflow:"hidden",direction:"row",align:"stretch",wrap:"wrap",contentEditable:!1,transitionProperty:"common",transitionDuration:"normal",position:"relative",borderRadius:"inherit","data-selection-ring":"inside","data-selection-background":!0,fontFamily:"Inter, sans-serif","data-drag-handle":!0,h:"100%",maxW:"var(--media-maxW)",maxH:"var(--media-maxH)",children:[n&&el(n)&&(0,h.jsx)(f.k,{flex:1,minH:"10em",minW:"min(10em, 100%)",maxW:"100%",maxH:"var(--media-maxH)",children:(0,h.jsx)(ea,{node:t})}),(0,h.jsx)(f.k,{flex:1.618,minW:"min(16em, 100%)",maxW:"100%",p:"1em",position:"relative",children:(0,h.jsx)(Q,{node:t})}),K.cx&&r&&(0,h.jsx)(V.r,{href:r,h:"100%",w:"100%",position:"absolute",zIndex:"-10","data-
1pdf-link":!0})]})},ed=e=>{var t;let{node:n}=e,{thumbnail:r,meta:o,sourceUrl:i,source:a}=n.attrs,l=W(a);return(0,h.jsxs)(f.k,{minW:"var(--media-maxH)",w:"100%",css:{aspectRatio:"16 / 9"},maxW:"100%",maxH:"var(--media-maxH)",h:"100%",align:"stretch",boxSizing:"content-box",overflow:"hidden","data-selection-ring":"inside",position:"relative",children:[r&&el(r)?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(ea,{node:n}),(0,h.jsxs)(q.U,{backgroundColor:"whiteAlpha.700",backdropFilter:"blur(8px)",py:1,px:2,position:"absolute",bottom:"0",fontSize:"0.75em","data-thumbnail-hidden":!0,children:[(0,h.jsx)(ee,{icon:(null==o?void 0:o.icon)||(null===(t=l.image)||void 0===t?void 0:t.src)}),i&&(0,h.jsx)($.x,{color:"black",noOfLines:1,children:(null==o?void 0:o.title)||(null==o?void 0:o.site)||(0,Y.Gr)(i)})]})]}):(0,h.jsx)(f.k,{align:"flex-start",flex:"1",p:4,children:(0,h.jsx)(Q,{node:n,disableOpenButton:!0})}),b.v.GAMMA_PUPPETEER_SERVICE&&i&&(0,h.jsx)(V.r,{href:i,h:"100%",w:"100%",position:"absolute",zIndex:"-10","data-pdf-link":!0})]})},ec=e=>{var t;let{node:n}=e,{meta:r,source:o,thumbnail:i}=n.attrs,a=W(o),l=(null==i?void 0:i.src)||(null==i?void 0:i.tempUrl),s=l&&(0,Z.SN)(l,Z.Iv);
1return(0,h.jsx)(f.k,{minW:"var(--media-maxH)",w:"100%",css:{aspectRatio:"16 / 9"},bg:"var(--body-color-muted)",align:"center",justify:"center",bgImage:(0,Z.Ly)(s),backgroundSize:"cover",children:(0,h.jsx)(ee,{icon:(null==r?void 0:r.icon)||(null===(t=a.image)||void 0===t?void 0:t.src),fontSize:"7.5em"})})},eu=(0,v.E)(g.xu),ep=(0,v.E)(f.k),em=e=>{let{node:t,editor:n,decorations:r}=e,{source:o,embed:i,displayStyle:a,id:l,sourceUrl:s}=t.attrs,d=W(o),{isZoomed:c,enterZoom:u,exitZoom:p}=(0,I.d8)(l),m=d.preferHtml&&(null==i?void 0:i.html),f=(0,A.Ah)(e),v=!b.v.GAMMA_PUPPETEER_SERVICE&&(m||"inline"===a)&&!f,E=(0,S.Od)(r)||!n.view.hasFocus(),z=(0,y.CG)(k.hN),T=(0,w.TZ)(),N=!f&&!n.isThumbnail;return(0,h.jsxs)(j.l,{...e,children:[(0,h.jsxs)(eu,{layoutDependency:c,layoutId:n.isThumbnail?void 0:(0,I.sB)(l),transition:I.yq,h:"100%",className:(0,x.cx)("embed-preview",!m&&!(d.inlineInteractive&&v)&&C.wY),"data-export-as-image":!0,"data-export-link":s,position:"relative",overflow:"hidden",children:[v&&n.isThumbnail?(0,h.jsx)(ec,{...e}):f?(0,h.jsx)(ed,{...e}):v?(0,h.jsx)(U,{...e,useStealthNav:!0}):(0,h.jsx)(es,{...e}),d.inlineInteractive&&!T&&v?(0,h.jsx)(g.xu,{position:"absolute",inset:0,zIndex:1,pointerEvents:z&&!E&&"inline"===a?"auto":"none",cursor:"default"}):(0,h.jsx)(I.cp,{enterZoom:u})]}),N&&(0,h.jsx)(I.aF,{isZoomed:c,exitZoom:p,editor:n,children:(0,h.jsx)(ep,{layoutDependency:c,layoutId:(0,I.sB)(l),transition:I.yq,h:"100%",w:"100%",direction:"column",justify:"center",align:"center",children:(0,h.jsx)(U,{...e,isZoomed:!0})})})]})},eh=r.NB.create({name:"embed",group:"block media",atom:!0,draggable:!0,selectable:!0,expandable:!0,addNodeView:()=>(0,l.fW)(em,{update:c.E7}),addAttributes:()=>({id:(0,a.b)(p.G),url:{},source:{default:o.Hw.key},thumbnail:{...(0,s.sw)("thumbnail")},embed:{...(0,s.sw)("embed")},meta:{...(0,s.sw)("meta")},proxy:{},sourceUrl:{},displayStyle:{default:"preview"},fullWidthBlock:{default:!1}}),parseHTML(){return[{tag:"div[class=embed]"},{tag:"iframe[bookmark]",getAttrs:(0,d.xF)(this.storage)}]},renderHTML(e){let{HTMLAttributes:t,node:n}=e;return["div",(0,r.P1)(t,{class:"embed"}),["a",{href:(0,m.iJ)(n),target:"_blank"},(0,m.k7)(n)]]},addStorage:d.gk,renderHTMLforAI(e){let{node:t}=e;return["iframe",{bookmark:(0,d.ml)(this.storage,t)}]},addCommands:()=>({replaceEmbedsById:(e,t)=>n=>{let{editor:o,chain:i}=n,a=(0,r.N2)(o.state.doc,t=>"embed"===t.type.name&&t.attrs.id===e),l=i();return a.forEach(e=>{let{pos:n,node:r}=e;l.insertContentAt({from:n,to:n+r.nodeSize},t,{updateSelection:!1})}),l.run(),!0},updateEmbedsById:(e,t)=>n=>{let{editor:o,chain:i}=n,a=(0,r.N2)(o.state.doc,t=>("embed"===t.type.name||"video"===t.type.name)&&t.attrs.id===e),l=i();return a.forEach(e=>{let{pos:n}=e;l.updateAttributesAtPos(n,{thumbnail:t.thumbnail})}),l.run(),!0},insertEmbedAndFetchMetadata:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"preview",n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return r=>{let{commands:o,editor:a}=r,l=(0,p.G)();o.insertContent({type:"embed",attrs:{id:l,url:e,sourceUrl:e,displayStyle:t,meta:{title:"Loading..."}}},{updateSelection:!1});let s=!1;return(0,i.ft)(e,e=>{if(s){a.commands.updateEmbedsById(l,e);return}let n=u.ah[e.source];a.commands.replaceEmbedsById(l,{type:(null==n?void 0:n.nodeName)||"embed",attrs:{...e,id:l},displayStyle:(null!=t?t:"video"===n.nodeName)?"inline":"preview"}),s=!0}).catch(t=>{console.warn("(caught) insertEmbedAndFetchMetadata error fetching url",t,e),n&&a.commands.replaceEmbedsById(l,e)}),!0}}})})},80759:function(e,t,n){"use strict";n.d(t,{r:function(){return q}});var r=n(72338),o=n(5596),i=n(90507),a=n(19283),l=n(86353),s=n(27191),d=n(52780),c=n(14657),u=n(66855),p=n(46188),m=n(27835);let h="gallery-prevent-flex";class g{constructor(e=null){this.dragging=e}}let f=new s.H$("galleryPlugin"),x=e=>new s.Sy({key:f,state:{init:()=>new g,apply:(e,t)=>t},props:{handleDOMEvents:{drop(e){var t;let n=null===(t=e.dragging)||void 0===t?void 0:t.annotations,r=f.getState(e.state);if(!r)return!1;r.dragging=n}},decorations:e=>{let{doc:t}=e,n=[];return t.descendants((e,t,r)=>{if((0,m.N5)(e))n.push(d.p.node(t,t+e.nodeSize,{},{children:e.content}));else if((0,m.N5)(r)){var o;
1let r="image"===e.type.name&&(null===(o=e.attrs.resize)||void 0===o?void 0:o.clipType)==="circle";n.push(d.p.node(t,t+e.nodeSize,{class:r?h:""},{inGallery:!0}))}}),d.EH.create(t,n)},handlePaste:(e,t,n)=>{let{selection:r,schema:o}=e.state,i=r instanceof s.qv&&(0,m.N5)(r.node);if(!i)return!1;if((0,p.cg)(o,n,t)){let t=e.state.tr.setSelection(s.Bs.create(e.state.doc,r.to-1));e.dispatch(t)}return!1},handleDrop:(t,n,r)=>{let o;let i=f.getState(t.state),a=null==i?void 0:i.dragging;i&&(i.dragging=null);try{if(!(o=(0,p.yT)(t,n,r,!1)))return!1}catch(e){return console.error("(caught) [GalleryPlugin] handleDrop checkGalleryDropTarget error:",e),!1}try{let{selection:n}=t.state,i=!n.empty,l=r.content.toJSON(),{pos:s,side:d,node:p}=o;if(p&&(0,m.N5)(p)){let t="left"===d?s:s+1;e.chain().insertContentAt({from:t,to:t},l,{updateSelection:!1}).command(n=>{let{tr:r}=n;if(i&&r.deleteSelection(),a){let n=e.state.tr;n.deleteSelection(),r.setMeta("annotationEvent",{type:"drop",dragging:a,droppedBlockPos:n.mapping.map(t)})}return!0}).focusMapped(t).run()}else if(p&&(0,u.fP)(p)){let n="left"===d?[...l,p.toJSON()]:[p.toJSON(),...l];e.chain().insertContentAt({from:s,to:s+p.nodeSize},{type:"gallery",content:n},{updateSelection:!1}).command(n=>{let{tr:r}=n;if(i&&r.deleteSelection(),a){let n=(0,c.mS)({side:d,view:t,tr:r,dragging:a,dropPos:s,dropNode:p});requestAnimationFrame(()=>{var t,r;null===(t=(r=e.commands).moveAnnotations)||void 0===t||t.call(r,n)})}return!0}).run()}}catch(e){console.error("(caught) [GalleryPlugin] handleDrop error:",e)}return!0}}});var v=n(52322),b=n(38035),y=n(17993),C=n(77533),w=n(62614),k=n(32899),j=n(42946),S=n(49929),A=n(94523),I=n(5879),E=n(87254),z=n(38045),T=n(2784),N=n(91994),M=n(29560),_=n(4878),L=n(24992),P=n(47968),R=n(4030),H=n(86189),D=n(17630),O=n(78277),B=n(48697),F=n(94567),W=n(28390),G=n(72318);let U=(0,z.E)(b.k),V=e=>{let{node:t,editor:n,getPos:r}=e,o=(0,_.TZ)(),a=(0,p.Dz)(e),l=0===a.length,s=l?G.vf:o?G.iC:t.attrs.thumbHeight||G.vf,d=(0,D.yg)(t.attrs.horizontalAlign||"center"),{isZoomed:c,isZoomComplete:u,exitZoom:m,zoomedId:g,setZoomedId:f}=(0,W.RM)(a.map(e=>e.attrs.id)),x=(0,N.CG)(P.hN),z=(0,T.useRef)(null),V=(0,L.Z)(z,e=>(0,p.nF)(n.view,e)),q=(0,T.useCallback)(e=>{try{var t;e.stopPropagation(),e.preventDefault();let o=r(),i=n.state.doc.nodeAt(o);if(!i)return;let a=null===(t=i.lastChild)||void 0===t?void 0:t.attrs.source,l=o+(null==i?void 0:i.nodeSize)-1;n.chain().insertContentAt(l,{type:"mediaPlaceholder",attrs:{source:a||"image.custom"}}).run(),setTimeout(()=>{n.commands.focus(),n.commands.setNodeSelection(l),(0,M.T)()})}catch(e){console.error("(caught) [GalleryView] addImage",e)}},[r,n]),$=(0,T.useCallback)(e=>{var t;n.isEditable&&(null===(t=e.target.closest(".gallery, .block"))||void 0===t?void 0:t.classList.contains("gallery"))&&n.commands.selectNodeAtPos(r())},[n,r]);return(0,v.jsxs)(R.lO,{...e,children:[(0,v.jsxs)(b.k,{className:"gallery",cursor:"default",onClick:$,ref:z,align:d,direction:"column",position:"relative","data-selection-ring":!0,"data-selection-background":!0,...l?V:{},css:{"--media-maxH":"".concat(s,"em"),"--media-maxW":"100%"},sx:{"[data-node-view-content-inner=gallery]":{display:"flex",flexDirection:"row",flexWrap:"wrap",alignItems:"center","@media print":{justifyContent:"center"},gap:"".concat(G.Nj,"em"),".block":{h:"".concat(s,"em"),flex:"1 1 auto","@media print":{flex:"unset !important"},["&.".concat(h)]:{flex:"0 0 auto"},my:0,transitionProperty:"filter",transitionDuration:"normal",_hover:{filter:"brightness(0.9)"},"[data-node-view-wrapper]":{h:"100%"}},_after:a.length<3?{flex:"10 10 auto",backgroundColor:"gray.100",width:"1px",content:'""'}:void 0}},children:[l?(0,v.jsxs)(y.g,{spacing:3,h:"".concat(s,"em"),justify:"center",contentEditable:!1,color:"gray.400",className:"gallery-placeholder","data-testid":"gallery-placeholder",userSelect:"none",children:[(0,v.jsx)(S.G,{size:"2x",icon:j.l9f}),x?(0,v.jsx)(C.x,{fontSize:"sm",textAlign:"center",children:(0,v.jsx)(I.cC,{id:"3MggZ2",components:{0:(0,v.jsx)(w.z,{size:"xs",onClick:q,mr:1})}})}):null]}):(0,v.jsx)(i.ms,{}),x&&!l&&(0,v.jsx)(b.k,{position:"absolute",bottom:"0",h:"".concat(s,"em"),align:"center",w:6,right:-3,className:"add-image",opacity:"0",transitionProperty:"opacity",transitionDuration:"normal",children:(0,v.jsx)(A.kH,{label:(0,v.jsx)(I.cC,{id:"P5MuiB"}),placement:"top",children:(0,v.jsx)(k.h,{icon:(0,v.jsx)(S.G,{icon:j.r8p}),"aria-label":E.ag._({id:"P5MuiB"}),position:"absolute",size:"xs",variant:"plain",isRound:!0,onClick:q})})}),(0,v.jsx)(H.A,{...e,label:E.ag._({id:"wnA/4R"})})]}),(0,v.jsx)(W.EW,{isZoomed:c,exitZoom:m,zoomedId:g,setZoomedId:f,editor:n,children:a.filter(e=>e.attrs.id).map(e=>{let{id:t}
1=e.attrs,r=e.type.name,o={layoutId:(0,W.sB)(t),transition:u&&c?{duration:0}:W.yq,layoutDependency:c};return{id:t,thumbnail:"image"===r?(0,v.jsx)(B.Ri,{imageAttrs:e.attrs,objectFit:"cover",isThumbnail:!0}):(0,v.jsx)(O.CG,{node:e}),full:(0,v.jsx)(b.k,{justify:"center",align:"center",h:"100%",w:"100%",children:"image"===r?(0,v.jsx)(B.Ri,{isZoomed:!0,imageAttrs:e.attrs,motionProps:o}):"video"===r?(0,v.jsx)(U,{...o,width:"var(--media-maxW)",height:"var(--media-maxH)",direction:"column",align:"center",justify:"center",children:(0,v.jsx)(F.Y7,{isZoomed:!0,node:e,decorations:[],editor:n})}):(0,v.jsx)(U,{...o,h:"100%",w:"100%",direction:"column",justify:"center",align:"center",children:(0,v.jsx)(O.Yn,{isZoomed:!0,node:e,decorations:[],editor:n})})})}})})]})},q=r.NB.create({name:"gallery",group:"cardBlock layoutBlock",content:"media*",isolating:!0,draggable:!0,selectable:!0,priority:a.a.Gallery,containerHandle:!0,expandable:!0,addNodeView:()=>(0,i.fW)(V,{update:l.E7,ignoreMutation:o.j}),addAttributes:()=>({thumbHeight:{},fullWidthBlock:{default:!1}}),addProseMirrorPlugins(){return[x(this.editor)]},parseHTML:()=>[{tag:"div[class=gallery]"},{tag:"gallery"}],renderHTMLforAI(e){let{node:t}=e;return["gallery",{thumbHeight:t.attrs.thumbHeight},0]},renderHTML(e){let{HTMLAttributes:t}=e;return["div",(0,r.P1)(t,{class:"gallery"}),0]}})},72318:function(e,t,n){"use strict";n.d(t,{Nj:function(){return r},iC:function(){return i},vf:function(){return o}});let r=.8,o=12,i=8},27835:function(e,t,n){"use strict";n.d(t,{Ah:function(){return r.Ah},N5:function(){return r.N5},rR:function(){return r.rR},u5:function(){return r.u5}});var r=n(46188);n(80759)},46188:function(e,t,n){"use strict";n.d(t,{Ah:function(){return f},Dz:function(){return x},N5:function(){return m},cg:function(){return w},nF:function(){return C},rR:function(){return v},u5:function(){return g},yT:function(){return b}});var r=n(72338),o=n(30764);n(2784);var i=n(69747),a=n(14647),l=n(11093),s=n(14657),d=n(96255),c=n(25819),u=n(15636),p=n(66855);let m=e=>"gallery"===e.type.name,h=e=>(0,r.qv)(e,m),g=e=>!!h(e),f=e=>{let{decorations:t}=e;return t.some(e=>e.spec.inGallery)},x=e=>{var t;let{decorations:n}=e,r=null===(t=n.find(e=>e.spec.children))||void 0===t?void 0:t.spec.children;return r?(0,l.Jn)(r):[]},v=e=>{let t=(0,s.bg)(e.$from);t&&!(0,d.KH)(t.node)?i.pw.emit(i.TI.CREATE_COMMENT_FROM_SELECTION,{selectionPos:e.from,parentPos:t.pos,text:(0,a.ho)(e.node)}
1):i.pw.emit(i.TI.CREATE_COMMENT_FROM_SELECTION,{selectionPos:e.from,parentPos:e.from,text:(0,a.ho)(e.node)})},b=(e,t,n,r)=>{let o,i;if(n&&!y(n,e.state.schema))return null;let a=e.posAtCoords({left:t.clientX,top:t.clientY});if(!a)return null;let{doc:s}=e.state,{pos:d}=a,c=s.resolve(d),u=h(c);if(u&&u.node.childCount>0)d=a.pos,(o=(0,l.Fu)(d,e))||d!=u.pos+u.node.nodeSize-1||(d-=1,o=(0,l.Fu)(d,e)),i=u.node;else{d=a.inside;try{i=s.resolve(d).nodeAfter}catch(e){return null}if(!i||!(0,p.fP)(i)||i==(null==n?void 0:n.content.firstChild)||r)return null;let t=c.parent;if(t&&!k(e.state.schema,t))return null;o=(0,l.Fu)(d,e)}if(!o)return null;let m=t.clientX-o.left,g=o.right-t.clientX,f=m>g?"right":"left";return("left"==f?m<0:g<0)&&!u?null:{pos:d,side:f,rect:o,node:i}},y=(e,t)=>e.content.size>0&&t.nodes.gallery.validContent(e.content),C=(e,t)=>{var n;let r=null===(n=e.dragging)||void 0===n?void 0:n.slice;if(!r){let e=[...t.dataTransfer.items];return e.length>0&&e.every(e=>e.type.startsWith("image/"))}return y(r,e.state.schema)},w=(e,t,n)=>{let r=(0,u.bC)(n,t);return(0,c.i1)(t)||y(t,e)||r&&r.length>0},k=(e,t)=>{let n=e.nodes[t.type.name];return!!n&&n.validContent(o.HY.fromJSON(e,[{type:"gallery",content:[]}]))}},35477:function(e,t,n){"use strict";n.d(t,{$:function(){return i}});var r=n(52322),o=n(28535);let i=e=>{let{html:t,...n}=e;return(0,r.jsx)(o.xu,{position:"relative",role:"group",className:"embed-viewer","data-selection-ring":!0,"data-selection-background":!0,borderRadius:"var(--box-border-radius)",contentEditable:!1,dangerouslySetInnerHTML:{__html:t},...n})}},12832:function(e,t,n){"use strict";n.d(t,{Z:function(){return k}});var r=n(52322),o=n(28535),i=n(42822),a=n(38035),l=n(42946),s=n(49929),d=n(94523),c=n(5879),u=n(2784),p=n(94804),m=n(16494),h=n(91994),g=n(29560),f=n(47968),x=n(66028),v=n(87205),b=n(22569),y=n(72975),C=n(84286),w=n(66855);let k=e=>{var t,n;let{image:k,editor:j,getPos:S,imageShape:A,imageSx:I}=e,E=(0,u.useCallback)(()=>{j.commands.selectNodeAtPos(S(),!1),(0,g.T)()},[j,S]),z=(0,w.zd)((null==k?void 0:k.src)||(null==k?void 0:k.tempUrl)),T=!k||k.showPlaceholder||!k.src&&!k.tempUrl,N=null!==(n=k&&(null===(t=k.loadImageParams)||void 0===t?void 0:t.provider))&&void 0!==n?n:void 0,M=k&&"queued"===k.loadImageStatus&&!j.isThumbnail,{src:_,tempUrl:L,uploadStatus:P,meta:R}=k||{},H=(0,h.CG)(f.hN),D=_&&(0,v.SN)(_,j.isThumbnail?v.Iv:j.isSiteNavbarEditor?v.gJ:{width:1e3,height:1e3},R),O=(0,v.Ly)(D,H?L:void 0),B=(0,b.x_)(k),F={backgroundSize:"cover",backgroundRepeat:"no-repeat",backgroundImage:z?void 0:O,backgroundPosition:B,width:"100%",height:"100%",borderRadius:"circle"!==A||z?"var(--box-border-radius)":"full",transitionProperty:"border-radius",transitionDuration:"normal",...I};return(0,r.jsxs)(o.xu,{position:"relative",cursor:"default",contentEditable:!1,h:"100%",children:[H&&(0,r.jsx)(d.kH,{placement:"top",label:(0,r.jsx)(c.cC,{id:"XQFMOm"}),children:(0,r.jsx)(i.M,{position:"absolute",inset:"0",color:"white",backgroundColor:"blackAlpha.400",opacity:"0",transitionProperty:"opacity, border-radius",transitionDuration:"fast",_hover:{opacity:.8},borderRadius:F.borderRadius,cursor:"pointer",onClick:E,onMouseDown:x.br,zIndex:"1",children:!T&&(0,r.jsx)(s.G,{icon:l.VmB})})}),T?(0,r.jsx)(C.k3,{...F,isLoading:!!M,loadingProvider:N,icon:l.VmB,iconSize:"1x",h:"100%"}):z?(0,r.jsx)(i.M,{...F,objectFit:"contain",sx:{svg:{width:"100%",aspectRatio:"1 / 1"}},children:(0,r.jsx)(p.Z,{src:_||L||"",className:"colorable-icon"})}):(0,r.jsx)(a.k,{"data-content-reference":!0,"data-change-focus-point-el":!0,className:"card-layout-cell-bg",position:"relative",sx:F}),P==m.D.Uploading&&H&&(0,r.jsx)(y.HI,{}),P==m.D.Error&&(0,r.jsx)(y.s7,{})]})}},94277:function(e,t,n){"use strict";n.d(t,{C3:function(){return S},CC:function(){return j},bn:function(){return w}});var r=n(52322),o=n(65610),i=n(87202),a=n(2784),l=n(42418),s=n(17292),d=n(91994),c=n(5626),u=n(95669),p=n(48697);let m=["0%","0%","0%","0%"],h="clippable-control-wrapper",g=(e,t,n)=>e/Math.sqrt((t*t+n*n)/2)*100,f=(e,t,n)=>Math.sqrt((t*t+n*n)/2)*(e/100),x=(e,t,n)=>{if("circle"===e){let e=Math.min(t,n)/2;return["".concat(g(e,t,n),"%"),"at","50%","50%"]}return m}
1,v=(e,t,n)=>"circle"===e?1:"inset"===e?t/n:null,b=(e,t)=>{if("inset"===t){let[t,n]=e[0],[r,o]=e[4];return(r-t)/(o-n)}return 1},y=(e,t,n,r)=>{let[o,i,a,l]=e;if("inset"===t){let t=parseFloat(o),s=parseFloat(i),d=parseFloat(a),u=parseFloat(l),p=c.lt/n*100,m=c.lt/r*100;if(100-u-s<p){let t=100-u-p;t>=0?e[1]="".concat(t,"%"):(e[1]="0%",e[3]="".concat(100-p,"%"))}if(100-t-d<m){let n=100-t-m;n>=0?e[2]="".concat(n,"%"):(e[2]="0%",e[0]="".concat(100-m,"%"))}}else if("circle"===t){let t=parseFloat(o),i=Math.max(f(t,n,r),c.lt);e[0]="".concat(g(i,n,r),"%")}},C=e=>{let{clipType:t,clipStyles:n,w:r,h:o}=e,[i,a,l,s]=n;if("inset"===t){let e=parseFloat(i),t=parseFloat(a),n=parseFloat(l),r=parseFloat(s),o=r/(t+r)*100,d=e/(e+n)*100,c=isNaN(o)?50:o,u=isNaN(d)?50:d,p=100-r-t,m=100-e-n;return{mask:"\n linear-gradient(#000 0 0) ".concat(c,"% ").concat(u,"% / ").concat(p,"% ").concat(m,"%,\n linear-gradient(rgba(0,0,0,0.4) 0 0)"),width:p,height:m,top:e,right:t,bottom:n,left:r}}if("circle"===t){let e=parseFloat(i),t=parseFloat(l),n=parseFloat(s),a=f(e,r,o),d=o*(n/100)-a,c=r*(t/100)-a,u=2*a/r*100,p=2*a/o*100,m=d/o*100,h=c/r*100,g="radial-gradient(".concat(u,"% ").concat(p,"% at ").concat(t,"% ").concat(n,"%, black 50%, rgba(0, 0, 0, 0.4) 50%) no-repeat");return{mask:g,width:u,height:p,top:Math.max(m,0),left:Math.max(h,0),bottom:0,right:0}}return{mask:"",width:0,height:0,top:0,left:0,bottom:0,right:0}},w=(e,t,n,r)=>{if(!e||!e.clipType||!r)return{clipType:"inset",scaleCrop:1,scaleX:1,scaleY:1,aspectRatio:r||void 0,referenceXOffset:1,referenceYOffset:1,clipPathCSSString:"",translateX:0,translateY:0};let o=e.clipPath||x(e.clipType,t,n),{clipType:i}=e,{width:a,height:l,top:s,left:d,right:c,bottom:u}=C({w:t,h:n,clipType:i,clipStyles:o}),p=100/a,m=100/l,h=(null==e?void 0:e.clipAspectRatio)||1,g=(null==e?void 0:e.clipAspectRatio)||r;return{scaleCrop:r/h<1?Math.min(m,p):Math.max(m,p),aspectRatio:g,scaleX:p,scaleY:m,translateX:d,translateY:s,referenceXOffset:t*(100/(100-d+c)-1),referenceYOffset:n*(100/(100-s+u)-1),clipPathCSSString:"".concat(i,"(").concat(o.join(" "),")"),clipType:i}},k=(0,l.mz)([l.Rn]),j={[".".concat(h)]:{zIndex:2,".moveable-control":{zIndex:2,_hover:{opacity:1},transitionProperty:"opacity",transitionDuration:"normal"},"&.data-clip-type-inset":{".moveable-control":{zIndex:2,bg:"0 none !important",borderRadius:"0px",width:"".concat(16,"px"),height:"".concat(16,"px"),border:"6px solid var(--chakra-colors-trueblue-300)",'&[data-clip-index="0"]':{borderRight:"0",borderBottom:"0",marginTop:"-".concat(2,"px"),marginLeft:"-".concat(2,"px"),cursor:"nw-resize"},'&[data-clip-index="1"]':{borderRight:"0",borderBottom:"0",borderLeft:"0",marginTop:"-".concat(2,"px"),cursor:"n-resize"},'&[data-clip-index="2"]':{borderLeft:"0",borderBottom:"0",marginTop:"-".concat(2,"px"),marginLeft:"-".concat(14,"px"),cursor:"ne-resize"},'&[data-clip-index="3"]':{borderBottom:"0",borderTop:"0",borderLeft:"0",marginLeft:"-".concat(14,"px"),cursor:"e-resize"},'&[data-clip-index="4"]':{borderTop:"0",borderLeft:"0",marginLeft:"-".concat(14,"px"),marginTop:"-".concat(14,"px"),cursor:"se-resize"},'&[data-clip-index="5"]':{borderTop:"0",borderLeft:"0",borderRight:"0",marginTop:"-".concat(14,"px"),cursor:"s-resize"},'&[data-clip-index="6"]':{borderTop:"0",borderRight:"0",marginTop:"-".concat(14,"px"),marginLeft:"-".concat(2,"px"),cursor:"sw-resize"},'&[data-clip-index="7"]':{borderTop:"0",borderBottom:"0",borderRight:"0",marginLeft:"-".concat(2,"px"),cursor:"w-resize"}}},"&.data-clip-type-circle":{".moveable-control":{bg:"trueblue.300"}},".moveable-clip-ellipse":{borderWidth:"2px",borderColor:"var(--chakra-colors-trueblue-300) !important"},".moveable-line":{display:"none"}}},S=e=>{let{clipPath:t,clipAspectRatio:n,updateResizeAttrs:l,imageWrapperRef:c,refreshDeps:m,currentWidth:g,currentHeight:f,onFinishCrop:w}=e,j=(0,d.TL)(),S=(0,d.CG)(p.Ig),A=(0,a.useRef)(null),[I,E]=(0,a.useState)({clipPath:t||x(S,g,f),clipAspectRatio:n||v(S,g,f)}),z=(0,a.useCallback)(e=>{if(!g||!f||!c.current)return;let{mask:t}=C({w:g,h:f,clipType:S,clipStyles:e});c.current.style["-webkit-mask"]=t,c.current.style["-webkit-mask-repeat"]="no-repeat"},[c,S,g,f]),T=JSON.stringify(I.clipPath);(0,a.useEffect)(()=>{z(I.clipPath)},[z,T,I.clipPath]),(0,o.r)(()=>{E(e=>({...e,clipPath:x(S,g,f),clipAspectRatio:v(S,g,f)}))},[S]),(0,a.useEffect)(()=>{var e;null===(e=A.current)||void 0===e||e.updateTarget()},[m]);let N=(0,a.useCallback)(()=>{let e={clipType:S,...I};e.clipAspectRatio&&e.clipPath&&l(e)},[l,I,S]),M=(0,a.useRef)({fn:N,confirmOnUnmount:!0});
1M.current.fn=N,(0,a.useEffect)(()=>u.T.on("endClip",e=>{let{confirm:t}=e;M.current.confirmOnUnmount=t,j((0,p.uR)()),w&&w()}),[j,w]),(0,a.useEffect)(()=>()=>{M.current.confirmOnUnmount&&M.current.fn()},[]),(0,a.useEffect)(()=>s.F7.on("keydown","CLIPPABLE",e=>!!(0,i.ZP)("mod+x")(e)&&(e.preventDefault(),!0)),[]);let _="".concat(S,"(").concat((I.clipPath||x(S,g,f)).join(" "),")");return(0,r.jsx)(k,{ref:e=>{A.current=e},className:"".concat(h," data-clip-type-").concat(S),target:c.current,renderDirections:["ne","nw","se","sw"],origin:!1,draggable:!1,clippable:!0,clipTargetBounds:!0,clipRelative:!0,clipArea:!0,defaultClipPath:S,customClipPath:_,dragWithClip:!0,keepRatio:!0,onClip:e=>{let{clipStyles:t,clipType:n}=e;y(t,n,g,f),z(t)},onClipEnd:e=>{let{lastEvent:t}=e;if(!(null==t?void 0:t.clipStyles))return;let{clipStyles:n,clipType:r}=t;y(n,r,g,f),E({clipPath:n,clipAspectRatio:b(t.poses,S)})}})}},40279:function(e,t,n){"use strict";n.d(t,{E:function(){return d}});var r=n(72338),o=n(24424),i=n(90507),a=n(19283),l=n(86353),s=n(11305);let d=o.ZP.extend({selectable:!0,draggable:!0,group:"block media",priority:a.a.Image,addOptions(){var e;return{...null===(e=this.parent)||void 0===e?void 0:e.call(this),placeholders:{}}},addNodeView:()=>(0,i.fW)(s.Y,{update:l.E7}),parseHTML:()=>[{tag:"img[src], img[tempUrl]"}],renderHTML(e){let{HTMLAttributes:t}=e;return["img",(0,r.P1)(t,{class:"gamma-simple-image"})]},addAttributes:()=>({src:{},tempUrl:{},uploadStatus:{},source:{},showPlaceholder:{}})})},11305:function(e,t,n){"use strict";n.d(t,{Y:function(){return c}});var r=n(52322),o=n(28535),i=n(11082),a=n(75009),l=n(16494),s=n(90507),d=n(72975);let c=e=>{let{node:t}=e,{src:n,tempUrl:c,uploadStatus:u,showPlaceholder:p,id:m}=t.attrs;return(0,r.jsxs)(s.T5,{as:"div",children:[p&&(0,r.jsx)(d.gH,{...e}),!p&&(n||c)&&(0,r.jsxs)(o.xu,{position:"relative",w:"100%",children:[(0,r.jsx)(i.r,{className:"image-link",href:n||c||"",target:"_blank",children:(0,r.jsx)(a.E,{src:n||c||""})}),u==l.D.Uploading&&(0,r.jsx)(d.HI,{}),u==l.D.Error&&(0,r.jsx)(d.s7,{})]})]})};c.displayName="simple-image-view"},67245:function(e,t,n){"use strict";n.d(t,{k:function(){return a}});var r=n(2784),o=n(91994),i=n(48697);let a=e=>{let t=(0,o.TL)(),n=(0,r.useCallback)(e=>{let{clipType:n}=e;n&&t((0,i.Nf)({clipType:n}))},[t]),a=(0,r.useCallback)(n=>{let{id:r}=n;i.TB.emit("endClip",{id:r,confirm:!1}),t((0,i.uR)()),e.commands.resetImageClip()},[t,e]),l=(0,r.useCallback)(e=>{let{id:n}=e;i.TB.emit("endClip",{id:n,confirm:!1}),t((0,i.uR)())},[t]),s=(0,r.useCallback)(e=>{let{id:n}=e;i.TB.emit("endClip",{id:n,confirm:!0}),t((0,i.uR)())},[t]),d=(0,r.useCallback)(e=>{let{id:n,clipType:r}=e;t((0,i.iq)({id:n,clipType:r})),i.TB.emit("startCrop",{id:n})},[t]);return{cancelCrop:l,startCrop:d,confirmCrop:s,resetCrop:a,setCropClipType:n}}},95669:function(e,t,n){"use strict";n.d(t,{T:function(){return o}});var r=n(76919);let o=new r.v},48697:function(e,t,n){"use strict";n.d(t,{Ri:function(){return $},OT:function(){return Q},Ee:function(){return ee},uR:function(){return Y.uR},TB:function(){return x.T},Ig:function(){return Y.Ig},v_:function(){return Y.v_},Nf:function(){return Y.Nf},iq:function(){return Y.iq}});var r=n(72338),o=n(24424),i=n(27191),a=n(65365),l=n(50279),s=n(91994),d=n(4889),c=n(90507),u=n(11093),p=n(38372),m=n(19283),h=n(86353),g=n(80236),f=n(66855),x=n(95669),v=n(52322),b=n(47968),y=n(38035),C=n(28535),w=n(75009),k=n(2784),j=n(16494),S=n(50260),A=n(89098),I=n(4878),E=n(93441),z=n(71997),T=n(4030),N=n(55395),M=n(27483),_=n(3452),L=n(17630),P=n(13653),R=n(5626),H=n(27835),D=n(72975),O=n(17955),B=n(28390),F=n(94277),W=n(38045),G=n(50788),U=n(87205),V=n(84286);let q=(0,W.E)(C.xu),$=(0,k.forwardRef)((e,t)=>{let{imageAttrs:{src:n,tempUrl:r,resize:o,meta:i},isCroppingThisImage:a=!1,motionProps:l={},isZoomed:d=!1,objectFit:c="contain",containerWidth:u,intrinsicAspectRatio:p,isThumbnail:m,...h}=e,g=(0,G.C7)(),x=(0,b.P7)((0,s.qr)().getState()),y=(null==i?void 0:i.frame_count)&&i.frame_count>1,C=d||!n||y?n:(0,U.SN)(n,m?{height:400}:{width:2e3},i),{scaleCrop:k,scaleY:j,clipPathCSSString:S,translateX:A,translateY:I,aspectRatio:E,referenceXOffset:z,referenceYOffset:T}=(0,F.bn)(o,u||(null==i?void 0:i.width)||1,u&&p?u/p:(null==i?void 0:i.height)||1,p||(i?i.width/i.height:1))||{},N=!a&&!!(null==o?void 0:o.clipPath),M=a?"":"scale(".concat(k,") translate(-").concat(A,"%, -").concat(I,"%)"),_=(0,f.zd)(n||r);return(0,v.jsx)(q,{css:{aspectRatio:"".concat(N?E:"")},className:"image","data-content-reference":"".concat(z,",").concat(T),maxH:"var(--media-maxH)",maxW:"var(--media-maxW)",overflow:"hidden",
1w:d?void 0:"100%",h:"cover"==c?"100%":void 0,sx:{"@media print":{height:"unset"}},...x?l:{},children:(0,v.jsx)(w.E,{alt:"",objectFit:c,maxH:"calc(var(--media-maxH) * ".concat(j||1,")"),minH:"cover"==c?"calc(var(--media-maxH) / ".concat(k||1,")"):void 0,transformOrigin:"left top",clipPath:a?"":S,ignoreFallback:d||g,transform:M,src:C||r||"",fallbackSrc:r||"",ref:t,w:_?"100%":void 0,...n||r?{}:V.W6,...h})})});$.displayName="CroppedImage";var K=n(67245),Z=n(31866),Y=n(14063);let X=e=>{let{theme:t,...n}=e,r=(0,s.TL)(),{node:o,editor:i,updateAttributes:a,selected:l,decorations:d}=n,{src:c,tempUrl:u,uploadStatus:p,meta:m,showPlaceholder:h,horizontalAlign:g,resize:W,id:G}=o.attrs,U=(null==W?void 0:W.width)||(null==m?void 0:m.width),V=(0,f.zd)(c||u),{isFullWidth:q}=(0,N.w)(d),X=(0,L.nN)(q?"center":g),J=(0,I.TZ)(),Q=(0,H.Ah)(n),ee=(0,P.Od)(d),et=(0,s.CG)(b.hN),en=(0,_.M)(i),{isCardDark:er}=(0,M.$D)(d),eo=null!=er?er:(0,S.wj)(t),ei=p===j.D.Uploading,{isZoomed:ea,enterZoom:el,exitZoom:es}=(0,B.d8)(G),{width:ed,height:ec,aspectRatio:eu,containerWrapperRef:ep,imageRef:em,setSize:eh}=(0,Z.A)();(0,k.useEffect)(()=>x.T.on("startCrop",e=>{let{id:t}=e;G===t&&(eh(),requestAnimationFrame(()=>{var e,t;null===(e=(t=i.commands).refreshBubbleMenu)||void 0===e||e.call(t)}))}),[G,eh,i]);let{ref:eg,isResizing:ef,setIsResizing:ex,resizeableSx:ev,isAnimating:eb,onLayoutAnimationStart:ey,onLayoutAnimationComplete:eC}=(0,O.ow)(i),ew=eg.current&&ee&&!Q&&!en,ek=eg.current&&!Q&&!en,ej=(0,A.c)(t),eS=(0,k.useCallback)((e,t)=>{a({...o.attrs,fullWidthBlock:void 0===t?o.attrs.fullWidthBlock:t,resize:{...o.attrs.resize,...e}})},[o.attrs,a]),eA=(0,E.lz)(),eI=(0,s.CG)((0,Y.v_)(G)),{confirmCrop:eE}=(0,K.k)(i);(0,E.vm)(()=>{if(eI&&!l&&eE({id:G}),!l){var e,t;ex(!1),null===(e=(t=i.commands).forceHideBubbleMenu)||void 0===e||e.call(t,!1)}},[i,r,l,eI,G,eE,ex],[l]);let ez=!eI&&!ef&&!Q&&!i.isThumbnail,eT=!i.isThumbnail,eN=(0,k.useCallback)(()=>{eI||ef||el()},[el,eI,ef]),eM=(0,k.useCallback)(()=>{if(l){var e,t;null===(e=(t=i.commands).refreshBubbleMenu)||void 0===e||e.call(t)}},[l,i]),e_=(0,s.CG)(b.P7),eL=e_?{layoutDependency:ea,layoutId:(0,B.sB)(G),transition:B.yq,onLayoutAnimationStart:ey,onLayoutAnimationComplete:eC}:void 0;return(0,v.jsxs)(T.lO,{...n,as:"div",style:{height:Q?"100%":void 0},children:[(h||!c&&!u)&&(0,v.jsx)(D.gH,{...n}),!h&&(c||u)&&(0,v.jsxs)(y.k,{"data-testid":"image-node-wrapper",ref:ep,h:"100%",w:"100%",direction:"column",className:z.d,sx:ev,css:X,children:[ek&&eI&&(0,v.jsx)(F.C3,{imageWrapperRef:eg,updateResizeAttrs:eS,refreshDeps:[eA,eb],currentWidth:ed,currentHeight:ec,clipPath:null==W?void 0:W.clipPath,clipAspectRatio:null==W?void 0:W.clipAspectRatio,onFinishCrop:()=>{requestAnimationFrame(()=>{var e,t;null===(e=(t=i.commands).refreshBubbleMenu)||void 0===e||e.call(t)})}}),ew&&!eI&&l&&!q&&(0,v.jsx)(O.R4,{imageWrapperRef:eg,setIsResizing:ex,updateResizeAttrs:eS,refreshDeps:[o.attrs,eb,eA]}),(0,v.jsxs)(C.xu,{ref:eg,css:{mask:eI?"":"none !important","--media-maxH":!ei||ef||(null==W?void 0:W.width)||Q?void 0:"".concat(100*R.m4,"vh")},sx:(null==m?void 0:m.has_transparency)?void 0:l&&ew?{...ej.imageSx,borderRadius:"0px"}:ej.imageSx,"data-drag-handle":!0,"data-image-node-element":!0,"data-selection-ring":"inside","data-selection-background":!0,"data-node-image-testid":G,w:q||Q?"100%":U?"calc(".concat(U," * var(--font-size) / 16)"):"fit-content",maxW:"100%",position:"relative",overflow:"hidden",children:[eT&&(0,v.jsx)(B.cp,{enterZoom:eN,as:w.E,src:J||!i.isEditable?void 0:c,loading:"lazy"}),(0,v.jsx)($,{containerWidth:ed,intrinsicAspectRatio:eu||void 0,isCroppingThisImage:eI,imageAttrs:o.attrs,onLoad:eM,ref:em,width:Q?"auto":U||ef||q||V?"100%":null==m?void 0:m.width,minW:Q?"100%":void 0,motionProps:eL,objectFit:Q?"cover":"contain",isThumbnail:Q||i.isThumbnail}),ez&&(0,v.jsx)(B.aF,{isZoomed:ea,exitZoom:es,editor:i,children:(0,v.jsx)($,{imageAttrs:o.attrs,backgroundColor:eo?"black":"white",w:V?"80vw":void 0,motionProps:{layoutDependency:ea,layoutId:(0,B.sB)(G),transition:B.yq},isZoomed:!0})}),ei&&et&&(0,v.jsx)(D.HI,{}),p==j.D.Error&&(0,v.jsx)(D.s7,{})]})]})]})},J=e=>{let t=(0,s.CG)(b.Pu);return t?(0,v.jsx)(X,{...e,theme:t}):null},Q={clipType:null,clipPath:null,clipAspectRatio:null,width:null},ee=o.ZP.extend({selectable:!0,draggable:!0,group:"block media",priority:m.a.Image,expandable:!0,addOptions(){var e;return{...null===(e=this.parent)||void 0===e?void 0:e.call(this),placeholders:{}}},addStorage:p.gk,addNodeView:()=>(0,c.fW)(J,{update:h.E7}),extendNodeSchema(e){var t;return{accessoryImageKey:(0,r.nU)((0,r.Nl)(e,"accessoryImageKey",e)),imageKeyPath:null!==(t=(0,r.nU)((0,r.Nl)(e,"imageKeyPath",e)))&&void 0!==t?t:""}},parseHTML(){return[{tag:"img[src], img[tempUrl]"},{tag:"img[bookmark]",getAttrs:(0,p.xF)(this.storage)},{tag:"img[".concat(a.L,"]"),getAttrs:e=>{try{let t=e.getAttribute(a.L),n=JSON.parse(t||"");return n}catch(t){return console.error("[Image] Error parsing ".concat(a.L," attrs"),e,t),!1}}},{tag:"div[class=card-accent-layout-item]",context:"cardLayoutItem//",getAttrs:e=>{try{let t=JSON.parse(e.getAttribute("data-background")||"{}");if("image"!==t.type||!t.image)return!1;let n={...t.image,source:t.source};return(0,f.UZ)(n)}catch(t){return console.error("[Image] Error parsing accent image background",e,t),!1}}}]},renderHTML(e){let{HTMLAttributes:t}=e;return["img",(0,r.P1)(this.options.HTMLAttributes,t,{loading:"lazy"})]},renderHTMLforAI(e){let{node:t}=e,n=(0,p.ml)(this.storage,t),r=(0,l.K)(t.attrs);return["img",{bookmark:n,alt:r}]},addAttributes:()=>({id:(0,d.b)(g.G),savedMediaId:{},src:{},tempUrl:{},uploadStatus:{},meta:{...(0,u.sw)("meta")},providerMeta:{...(0,u.sw)("providerMeta")},aiParams:{...(0,u.sw)("aiParams")},loadImageParams:{...(0,u.sw)("aiParams")},loadImageStatus:{},loadImageId:{},name:{},query:{},source:{},showPlaceholder:{},fullWidthBlock:{default:!1},resize:{...(0,u.sw)("resize"),default:Q}}),addKeyboardShortcuts:()=>({Enter:e=>{let{editor:t}=e,n=t.state.selection;
1if(n instanceof i.qv&&n.node.type.name===o.ZP.name){let e=(0,Y.kv)((0,s.bh)().getState()),{id:t}=n.node.attrs;if(e)return x.T.emit("endClip",{id:t,confirm:!0}),!0}return!1}}),addCommands(){let e=this.name,t=t=>{let{selection:n}=t;return n instanceof i.qv&&n.node.type.name===e?n.node:void 0};return{resetImageClip:()=>n=>{let{chain:r,state:o}=n,i=t(o);if(!i)return console.warn("[resetImageClip] Selected node is not an image: ",o.selection),!0;let{clipPath:a,clipType:l,clipAspectRatio:s}=Q;return r().updateAttributes(e,{resize:{...i.attrs.resize,clipPath:a,clipType:l,clipAspectRatio:s}}).run()},resetImageScale:()=>n=>{let{chain:r,state:o}=n,i=t(o);return i?r().updateAttributes(e,{resize:{...i.attrs.resize,width:null,isAuto:null}}).run():(console.warn("[resetImageClip] Selected node is not an image: ",o.selection),!0)}}}});n(40279),n(11305)},50593:function(e,t,n){"use strict";n.d(t,{c:function(){return a}});var r=n(93565),o=n(29560),i=n(29596);let a=Object.entries(i.ah).filter(e=>{let[t,n]=e;return n.nodeName&&!n.disabled}).map(e=>{let[t,n]=e;return{key:t,name:n.label,nodeName:n.nodeName||"mediaPlaceholder",execute:e=>e.commands.insertMediaBlock(n.key),dragStartFn:e=>{(0,r.U)(e,{type:"mediaPlaceholder",attrs:{source:n.key}})},dragEndFn:()=>{(0,o.T)()},description:n.description,icon:n.icon,image:n.image,testId:n.key,keywords:n.keywords,featureFlag:n.featureFlag,priority:n.priority,categories:n.categories,checkDisabled:n.checkDisabled,badge:n.badge}})},29596:function(e,t,n){"use strict";n.d(t,{dz:function(){return b},ah:function(){return y},mC:function(){return v},X8:function(){return C}});var r=n(52322),o=n(82655),i=n(87254),a=n(99787),l=n(50260),s=n(17993),d=n(47443),c=n(52929),u=n(74444),p=n(5879),m=n(91994),h=n(53701),g=n(47968),f=n(8624),x=n(13793);let v="default",b={Default:[{label:()=>i.ag._({id:"EdQY6l"}),availableOffline:!0,key:v,backgroundType:x.E.NONE,Panel:()=>(0,r.jsx)(r.Fragment,{})}],Image:[{...a.in,nodeName:"image",backgroundType:x.E.IMAGE,priority:10},{...a.ud,nodeName:"image",backgroundType:x.E.IMAGE},{...a.QT,nodeName:"image",backgroundType:x.E.IMAGE},{...a.jt,nodeName:"image",disabled:!0,backgroundType:x.E.IMAGE},{...a.NX,nodeName:"image",backgroundType:x.E.IMAGE},{...a.hq,nodeName:"image",backgroundType:x.E.IMAGE},{...a.$5,nodeName:"image",backgroundType:x.E.IMAGE},{...a.jS,nodeName:"image"},{...a.bD,nodeName:"image",disabled:!0,backgroundType:x.E.IMAGE},{label:()=>i.ag._({id:"COXEr5"}),key:l.cx,availableOffline:!0,icon:o.l9f,Panel:e=>{let{currentAttributes:t,updateAttributes:n,editType:o}=e,i=(0,m.CG)(g.Pu),{accentBackgrounds:a}=i.config;return(0,r.jsxs)(s.g,{align:"stretch",children:[a&&(0,r.jsx)(h.U,{currentAttributes:t,accentImages:a,isDark:(0,l.wj)(i),handleItemClick:n,editType:o}),(0,r.jsxs)(d.b,{status:"info",children:[(0,r.jsx)(c.z,{}),(0,r.jsx)(u.X,{children:(0,r.jsx)(p.cC,{id:"zOCB9A"})})]})]})},backgroundType:x.E.IMAGE,nodeName:"image",keywords:["accent image"]}],Video:[{...a.wj,nodeName:"video"},{...a.Vy,nodeName:"video"},{...a.qz,nodeName:"video"},{...a.oC,nodeName:"video"},{...a.BM,nodeName:"video"},{...a.zs,nodeName:"video"},{...a.p7,nodeName:"video"}],Embed:[{...a.Hw,nodeName:"embed",priority:10},{...a.bO,nodeName:"embed"},{...a.BR,nodeName:"embed"},{...a.DN,nodeName:"embed"},{...a.iL,nodeName:"embed"},{...a.Bo,nodeName:"embed"},{...a.LE,nodeName:"embed"},{...a.QR,nodeName:"embed"},{...a.Ds,nodeName:"embed"},{...a.FH,nodeName:"embed"},{...a.F6,nodeName:"embed"},{...a.w4,nodeName:"embed"},{...a.BF,nodeName:"embed"},{...a.DU,nodeName:"embed"},{...a.TQ,nodeName:"embed"}],Color:[{label:()=>i.ag._({id:"iFeLoB"}),key:"color.solid",availableOffline:!0,icon:o.q2v,Panel:f.c,backgroundType:x.E.COLOR,keywords:["solid color"]},{...a.eK,availableOffline:!0,backgroundType:x.E.GRADIENT}]},y=Object.fromEntries(Object.values(b).flat().map(e=>[e.key,e])),C={Default:()=>i.ag._({id:"ovBPCi"}),Image:()=>i.ag._({id:"hG89Ed"}),Video:()=>i.ag._({id:"vSJd18"}),Embed:()=>i.ag._({id:"KKBlUU"}),Color:()=>i.ag._({id:"jZlrte"})}},72975:function(e,t,n){"use strict";n.d(t,{om:function(){return y},gH:function(){return b},s7:function(){return x.s7},HI:function(){return x.HI}});var r=n(72338),o=n(55388),i=n(27191),a=n(29560),l=n(19283),s=n(66855),d=n(52322),c=n(38035),u=n(42946),p=n(16494),m=n(65940),h=n(55395),g=n(17630),f=n(27835),x=n(84286);let v=e=>(0,d.jsx)(m.l,{...e,as:"div",children:(0,d.jsx)(b,{...e})}),b=e=>{let{node:t,decorations:n,editor:r}=e,{source:o,horizontalAlign:i,uploadStatus:a,loadImageParams:l,loadImageStatus:s}=t.attrs,{isFullWidth:m}=(0,h.w)(n),v=(null==o?void 0:o.includes("embed."))?u.m6E:u.zxC,b=(0,f.Ah)(e);return(0,d.jsx)(c.k,{w:"100%",h:"100%",direction:"column",sx:(0,g.nN)(i),children:(0,d.jsx)(x.k3,{hasUploadError:a===p.D.Error,isUploading:a===p.D.Uploading,isLoading:"queued"===s&&!r.isThumbnail,loadingProvider:null==l?void 0:l.provider,"data-content-reference":!0,icon:v,width:m||b?"100%":"18em",maxW:"100%",h:b?"100%":"10em",maxH:"100%","data-drag-handle":!0,"data-selection-ring":!0,"data-selection-background":!0,borderRadius:"var(--box-border-radius)"})})},y=r.NB.create({name:"mediaPlaceholder",group:"block media",atom:!0,selectable:!0,draggable:!0,priority:l.a.MediaPlaceholder,addNodeView:()=>(0,o.fW)(v),addAttributes:()=>({source:{},fullWidthBlock:{default:!1}}),addKeyboardShortcuts:()=>({Enter:e=>{let{editor:t}=e,n=t.state.selection;return!!(n instanceof i.qv&&(0,s.fP)(n.node))&&((0,a.T)(),!0)}}),addCommands:()=>({insertMediaBlock:e=>t=>{let{commands:n}=t;return n.insertContentAndSelect({type:"mediaPlaceholder",attrs:{source:e}}),requestAnimationFrame(()=>{(0,a.T)()}),!0}}),parseHTML:()=>[{tag:"div[class=media-placeholder]"},{tag:"img[placeholder=true]",priority:60}],renderHTML(e){let{HTMLAttributes:t}=e;return["div",(0,r.P1)(t,{class:"media-placeholder"})]}})},17955:function(e,t,n){"use strict";n.d(t,{R4:function(){return x},Wv:function(){return f},ow:function(){return g}});var r=n(52322),o=n(65610),i=n(12436),a=n.n(i),l=n(2784),s=n(42418),d=n(5626),c=n(93441),u=n(86392);let p="resizeable-control-wrapper",m=(0,s.mz)([s.ez]),h=(e,t)=>{let n=d.lt*Math.max(t.clientWidth/t.clientHeight,1);return Math.max(e,n)};function g(e){let[t,n]=(0,l.useState)(!1),r=(0,c.lz)(),i=(0,l.useRef)(null),a=(0,u.Br)(i),[s,d]=(0,l.useState)(!1),p=(0,l.useCallback)(()=>{var t,r;null===(t=(r=e.commands).forceHideBubbleMenu)||void 0===t||t.call(r,!0),n(!0)},[e]),m=(0,l.useCallback)(()=>{var t,r;null===(t=(r=e.commands).forceHideBubbleMenu)||void 0===t||t.call(r,!1),n(!1)},[e]);return(0,o.r)(()=>{var t,n;null===(t=(n=e.commands).forceHideBubbleMenu)||void 0===t||t.call(n,s||a)},[e,s,a]),{ref:i,isResizing:s,setIsResizing:d,isAnimating:t,resizeableSx:{".moveable-control":{display:r||a||t?"none":""}},onLayoutAnimationStart:p,onLayoutAnimationComplete:m}}let f={[".".concat(p)]:{zIndex:11,".moveable-control":{bg:"white",border:"2px s
1olid var(--chakra-colors-trueblue-300)",w:"".concat(8,"px"),h:"".concat(8,"px"),opacity:1,zIndex:10,borderRadius:0,_hover:{opacity:1},transitionProperty:"opacity",transitionDuration:"normal","&.moveable-ne, &.moveable-sw":{cursor:"nesw-resize"},"&.moveable-nw, &.moveable-se":{cursor:"nwse-resize"},"&.moveable-se, &.moveable-ne, &.moveable-e":{marginLeft:"-".concat(5,"px")},"&.moveable-sw, &.moveable-nw, &.moveable-w":{marginLeft:"-".concat(3,"px")},"&.moveable-ne, &.moveable-nw, &.moveable-n":{marginTop:"-".concat(3,"px")},"&.moveable-se, &.moveable-sw, &.moveable-s":{marginTop:"-".concat(5,"px")},"&.moveable-e, &.moveable-w":{cursor:"ew-resize",marginTop:"-".concat(4,"px")},"&.moveable-n, &.moveable-s":{cursor:"ns-resize",marginLeft:"-".concat(4,"px")}},".moveable-line":{display:"none"}}},x=e=>{let{imageWrapperRef:t,setIsResizing:n,updateResizeAttrs:o,refreshDeps:i,keepRatio:s=!0,onResizing:c}=e,u=(0,l.useRef)(null);return(0,l.useEffect)(()=>{requestAnimationFrame(()=>{var e,t;null===(e=u.current)||void 0===e||e.updateRect(),null===(t=u.current)||void 0===t||t.updateTarget()})},[i]),(0,l.useEffect)(()=>{let e=()=>{var e;null===(e=u.current)||void 0===e||e.updateTarget()},t=a()(e,250);return document.addEventListener("drop",e),window.addEventListener("resize",t),()=>{document.removeEventListener("drop",e),window.removeEventListener("resize",t)}},[]),(0,r.jsx)(m,{ref:e=>{u.current=e},className:p,target:t.current,renderDirections:["se","nw","sw","ne","n","s","e","w"],keepRatio:s,draggable:!1,resizable:!0,origin:!1,onResizeStart:()=>{n(!0)},onResize:e=>{let{target:t,width:n,height:r}=e,o=h(n,t),i=s?r:h(r,t);t.style.width="".concat(o,"px"),s||(t.style.height="".concat(i,"px")),null==c||c({width:o,height:i})},onResizeEnd:e=>{let{target:t}=e,r=t.clientWidth,i=t.clientHeight,a=parseFloat(getComputedStyle(t).fontSize)/d.SV;o({width:r/a,height:s?null:i/a,isAuto:!1}),n(!1),t.style.width="",t.style.height=""}})}},80236:function(e,t,n){"use strict";n.d(t,{G:function(){return s},z:function(){return d}});var r=n(38564),o=n(37164),i=n(27191),a=n(55850);let l=new i.H$("UniqueMediaId"),s=()=>(0,o.x0)(5),d=a.I.extend({name:"UniqueMediaId"}).configure({attributeName:"id",types:["image","embed","video"],initialValue:s,filterTransaction:e=>{let t=e.getMeta(r.Gt);return(null==t?void 0:t.isChangeOrigin)!==!0},pluginKey:l})},94567:function(e,t,n){"use strict";n.d(t,{nk:function(){return _},Y7:function(){return z}});var r=n(72338),o=n(4889),i=n(90507),a=n(11093),l=n(38372),s=n(86353),d=n(80236),c=n(66855),u=n(52322),p=n(28535),m=n(38035),h=n(73200),g=n(38045),f=n(14274),x=n(98285),v=n(65940),b=n(78277),y=n(27835),C=n(28390),w=n(2784),k=n(580),j=n(66028),S=n(35477),A=n(99787);let I=e=>e&&A.zX[e]?A.zX[e]:A.wj,E=16/9,z=e=>{let{isZoomed:t,...n}=e,{node:r}=n,{embed:o,source:i,sourceUrl:a}=r.attrs,l=I(i),s=(0,w.useRef)(null),d=l.preferHtml&&(null==o?void 0:o.html),c=(null==o?void 0:o.height)&&!(null==o?void 0:o.width),m=(null==o?void 0:o.height)&&(null==o?void 0:o.width)?o.width/o.height:(null==o?void 0:o.aspectRatio)||E,g=t?{width:"min(var(--media-maxW), calc(var(--media-maxH) * ".concat(m,"))"),height:c?o.height:"min(var(--media-maxH), calc(var(--media-maxW) / ".concat(m,"))")}:d?void 0:c?{height:o.height}:{height:0,pb:"".concat(100/m,"%")},f=(null==o?void 0:o.url)||r.attrs.embedUrl||a,x=l&&l.rewriteEmbedUrl&&f?l.rewriteEmbedUrl(f):f;return(0,u.jsxs)(p.xu,{position:"relative","data-drag-handle":!0,...g,onClick:t?j.UW:void 0,children:[!t&&(0,u.jsx)(C.Y$,{...n,frameRef:s}),d?(0,u.jsx)(S.$,{html:o.html,w:t?"100%":void 0,onClick:t?j.UW:void 0}):(0,u.jsx)(k.A,{initialUrl:x,backgroundColor:"none",borderRadius:"var(--box-border-radius)",overflow:"hidden","data-selection-ring":"inside","data-selection-background":!0,className:(0,h.cx)("video-player"),iframeOptions:{preventScroll:!0,...l.iframeOptions},position:"absolute",inset:0,frameRef:s})]})},T=(0,g.E)(p.xu),N=(0,g.E)(m.k),M=e=>{let{node:t,editor:n}=e,{displayStyle:r,id:o,sourceUrl:i}=t.attrs,{isZoomed:a,enterZoom:l,exitZoom:s}=(0,C.d8)(o),d=(0,y.Ah)(e),c=!f.v.GAMMA_PUPPETEER_SERVICE&&"inline"===r,p=!d&&!n.isThumbnail;return(0,u.jsxs)(v.l,{...e,as:"div",children:[(0,u.jsx)(T,{layoutDependency:a,layoutId:n.isThumbnail?void 0:(0,C.sB)(o),transition:C.yq,h:"100%",className:(0,h.cx)("embed-preview",!c&&x.wY),"data-export-as-image":!0,"data-export-link":i,position:"relative",overflow:"hidden",children:n.isThumbnail?(0,u.jsx)(b.XX,{...e}):d?(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(C.cp,{enterZoom:l}),(0,u.jsx)(b.CG,{...e})]}):c?(0,u.jsx)(z,{...e}):(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(C.cp,{enterZoom:l}),(0,u.jsx)(b.fu,{...e})]})}),p&&(0,u.jsx)(C.aF,{isZoomed:a,exitZoom:s,editor:n,children:(0,u.jsx)(N,{layoutDependency:a,layoutId:(0,C.sB)(o),transition:C.yq,width:"var(--media-maxW)",height:"var(--media-maxH)",direction:"column",align:"center",justify:"center",children:(0,u.jsx)(z,{...e,isZoomed:!0})})})]})},_=r.NB.create({name:"video",group:"block media",atom:!0,draggable:!0,selectable:!0,expandable:!0,addNodeView:()=>(0,i.fW)(M,{update:s.E7}),addAttributes:()=>({id:(0,o.b)(d.G),embedUrl:{},source:{},thumbnail:{...(0,a.sw)("thumbnail")},embed:{...(0,a.sw)("embed")},meta:{...(0,a.sw)("meta")},sourceUrl:{},displayStyle:{default:"inline"},fullWidthBlock:{default:!1}}
1),parseHTML(){return[{tag:"div[class=video]"},{tag:"video[bookmark]",getAttrs:(0,l.xF)(this.storage)}]},addStorage:()=>({bookmarks:{}}),renderHTMLforAI(e){let{node:t}=e;return["video",{bookmark:(0,l.ml)(this.storage,t)}]},renderHTML(e){let{HTMLAttributes:t,node:n}=e;return["div",(0,r.P1)(t,{class:"video"}),["a",{href:(0,c.iJ)(n),target:"_blank"},(0,c.k7)(n)]]}})},28390:function(e,t,n){"use strict";n.d(t,{Y$:function(){return W},cp:function(){return F},yq:function(){return v},EW:function(){return R},aF:function(){return _},sB:function(){return $},RM:function(){return q},d8:function(){return V}});var r=n(52322),o=n(38035),i=n(29117),a=n(28535),l=n(38045),s=n(25925),d=n(12982),c=n.n(d),u=n(56974),p=n.n(u),m=n(2784),h=n(17292),g=n(90439),f=n(66028),x=n(90221);let v={type:"spring",duration:.5,bounce:0},b=(0,x.s2)()?"0.75rem":"2.5rem";var y=n(82642),C=n(332),w=n(32899),k=n(87254),j=n(87202),S=n(43997),A=n(87827),I=n(91994),E=n(34972),z=n(84698);let T=()=>{let e=(0,I.CG)(z.Lw),{inPreviewContext:t}=(0,E.My)();return e&&!t};var N=n(93441);let M=(0,l.E)(a.xu),_=e=>{let{children:t,isZoomed:n,exitZoom:i,editor:l}=e,s=(0,S.I0)(),d=T();(0,m.useEffect)(()=>{if(!d)return h.F7.on("keydown","ZOOMABLE_OVERLAY",e=>n&&["ArrowDown","ArrowUp"].includes(e.key)?(e.preventDefault(),!0):!!((0,j.P6)("Esc")(e)||(0,j.P6)("Enter")(e))&&!!n&&(i(),e.preventDefault(),!0))},[i,n,d]),(0,m.useEffect)(()=>{d||s((0,A.VN)({id:"zoomableOverlay",isOpen:n}))},[s,n,d]);let c=(0,m.useRef)(null);return((0,N.vm)(()=>{if(l.isEditable){if(n){var e;null===(e=c.current)||void 0===e||e.focus()}else l.commands.focus()}},[l,n],[n],!1),d)?null:(0,r.jsx)(C.h,{children:n&&(0,r.jsxs)(a.xu,{position:"fixed",inset:0,padding:b,zIndex:"modal",userSelect:"none",onClick:i,onMouseDown:f.br,"data-in-editor-focus":!0,"data-testid":"zoomable-overlay",children:[(0,r.jsx)(M,{position:"absolute",inset:0,initial:{opacity:0}
1,animate:{opacity:.8},transition:v,backgroundColor:"black"},"shade"),(0,r.jsx)(a.xu,{position:"absolute",right:2,top:2,zIndex:"docked",contentEditable:!1,suppressContentEditableWarning:!0,children:(0,r.jsx)(w.h,{"aria-label":k.ag._({id:"8qZ5De"}),colorScheme:"gray",size:"md",onClick:i,onMouseDown:f.br,icon:(0,r.jsx)(y.T,{}),className:"exit-button",ref:c})}),(0,r.jsx)(o.k,{position:"relative",zIndex:"1",h:"100%",w:"100%",align:"center",justify:"center",direction:"column",css:{"--overlay-maxH":"calc(100vh - 2 * ".concat(b,")"),"--overlay-maxW":"calc(100vw - 2 * ".concat(b,")"),"--media-maxH":"var(--overlay-maxH)","--media-maxW":"var(--overlay-maxW)"},children:t})]})})},L=(0,l.E)(o.k),P="80px",R=e=>{let{children:t,zoomedId:n,setZoomedId:l,isZoomed:d,exitZoom:u,editor:x}=e,y=c()(t,e=>e.id===n),C=t[y],w=(0,m.useRef)(null);return((0,m.useEffect)(()=>{if(d&&!(t.length<2))return h.F7.on("keydown","ZOOMABLE_OVERLAY",e=>{switch(e.key){case"ArrowLeft":return l((t[y-1]||p()(t)).id),!0;case"ArrowRight":return l((t[y+1]||t[0]).id),!0;default:return!1}})},[u,d,l,t,y]),(0,m.useEffect)(()=>{var e;w.current&&(null===(e=w.current.querySelector('[data-thumb-id="'.concat(n,'"]')))||void 0===e||e.scrollIntoView({inline:"center",behavior:"smooth"}))},[n]),g.cx)?null:(0,r.jsxs)(_,{isZoomed:d,exitZoom:u,editor:x,children:[(0,r.jsx)(o.k,{flex:1,w:"100%",justify:"center",align:"center","data-testid":"zoomable-carousel-expanded",children:(0,r.jsx)(s.M,{children:C&&(0,r.jsx)(L,{css:{"--media-maxH":"calc(var(--overlay-maxH) - ".concat(P," - ").concat(b,")")},initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.95},position:"absolute",transition:v,w:"100%",h:"100%",children:C.full},C.id)})}),(0,r.jsx)(o.k,{overflowX:"auto",mt:b,sx:{"::-webkit-scrollbar":{display:"none"}},children:(0,r.jsx)(i.U,{spacing:4,onClick:f.UW,"data-testid":"zoomable-carousel-thumbnails",ref:w,children:t.map(e=>{let t=e.id===n;return(0,r.jsx)(a.xu,{border:t?"2px solid white":"2px solid black",boxSizing:"content-box",borderRadius:"md",overflow:"hidden",onClick:()=>l(e.id),transitionProperty:"border",transitionDuration:"normal",h:P,css:{"--media-maxH":P,"--media-maxW":"200px",flexShrink:0},"data-thumb-id":e.id,cursor:"pointer",backgroundColor:"gray.100",children:e.thumbnail},e.id)})})})]})};var H=n(14274),D=n(11093),O=n(47968),B=n(13653);let F=e=>{let{enterZoom:t,...n}=e,o=(0,I.CG)(O.hN),i=!o;return H.v.GAMMA_PUPPETEER_SERVICE?null:(0,r.jsx)(a.xu,{inset:0,w:"100%",h:"100%",position:"absolute",zIndex:1,cursor:i?"zoom-in":"default",onDoubleClick:o?t:void 0,onClick:i?t:void 0,"data-drag-handle":!0,"data-testid":"zoom-click-capture",opacity:0,...n})},W=e=>{let{decorations:t,node:n,editor:o}=e,i=(0,B.Od)(t)||!(0,D.KB)(o),l=(0,I.CG)(O.hN),{displayStyle:s}=n.attrs;return(0,r.jsx)(a.xu,{position:"absolute",inset:0,zIndex:1,pointerEvents:l&&!i&&"inline"===s?"auto":"none",cursor:"default"})},G=e=>t=>(0,O._I)(t)===e,U=e=>t=>{let n=(0,O._I)(t);return n&&e.includes(n)?n:null},V=e=>{let t=(0,S.I0)(),n=(0,I.CG)(G(e)),r=(0,m.useCallback)(n=>{t((0,O.RW)({nodeId:n?e:null}))},[t,e]),o=(0,m.useCallback)(()=>r(!0),[r]),i=(0,m.useCallback)(()=>r(!1),[r]);return{isZoomed:n,setIsZoomed:r,enterZoom:o,exitZoom:i}},q=e=>{let t=(0,S.I0)(),n=(0,I.CG)(U(e)),r=!!n,o=(0,m.useCallback)(e=>{t((0,O.RW)({nodeId:e}))},[t]),i=(0,m.useCallback)(()=>o(null),[o]),[a,l]=(0,m.useState)(r);return(0,m.useEffect)(()=>{let e;return r?e=window.setTimeout(()=>{l(!0)},1e3*v.duration):l(!1),()=>clearTimeout(e)},[r]),{isZoomed:r,isZoomComplete:a,zoomedId:n,setZoomedId:o,exitZoom:i}},$=e=>"media-zoom-".concat(e)},71997:function(e,t,n){"use strict";n.d(t,{d:function(){return i},l:function(){return a}});var r=n(94277),o=n(17955);let i="gamma-moveable-wrapper",a={...r.CC,...o.Wv}},59799:function(e,t,n){"use strict";n.d(t,{U:function(){return l}});var r=n(72338),o=n(27191),i=n(38322),a=n(15690);let l=r.hj.create({name:"focusHelpers",addCommands:()=>({focusDelayed:()=>e=>{let{editor:t}=e;return requestAnimationFrame(()=>t.commands.focus()),!0},insertContentAndSelect:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return n=>{let{chain:r,state:o}=n,{from:i,$from:a}=o.selection;return 0===a.parentOffset?r().insertContentAt({from:i-1,to:i},e,{updateSelection:!1}).selectInsertedNode(t).run():r().insertContent(e,{updateSelection:!1}).selectInsertedNode(t).run()}},focusMapped:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1;return r=>
1{let{tr:o,view:a}=r,l=o.mapping.map(e,n)+t;try{let e=(0,i.t)(o.doc.resolve(l));e&&o.setSelection(e),a.focus()}catch(e){console.error("[focusMapped] error selecting pos",l,e)}return!0}},selectInsertedNode:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return t=>{let{tr:n,view:r}=t,o=(0,i.G)(n);if(!o)return!1;let a=(0,i.t)(o,e);return!!a&&(n.setSelection(a),r.focus(),!0)}},selectNodeAtPos:function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return n=>{let{state:r,tr:i,view:a}=n;try{i.setSelection(o.qv.create(r.doc,e)),t&&i.scrollIntoView(),a.focus()}catch(t){console.warn("[selectNodeAtPos] Error selecting node",e,t)}return!0}},selectInsideNodeAtPos:(e,t)=>n=>{let{tr:r,state:o}=n,a=o.doc.resolve(e),l=(0,i.t)(a,t);return!!l&&(r.setSelection(l),!0)},deleteSelectionAndSelectNear:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return t=>{let{tr:n,state:r}=t,{selection:o}=r;if(o.empty)return!1;n.deleteSelection().scrollIntoView();let i=(0,a.E)(n.doc.resolve(o.from),e);return i&&n.setSelection(i),!0}}})})},13653:function(e,t,n){"use strict";n.d(t,{EL:function(){return h},Jn:function(){return g},Od:function(){return m}});var r=n(72338),o=n(27191),i=n(52780),a=n(11093),l=n(27835),s=n(59080),d=n(20297),c=n(59322);let u=e=>e.isLeaf||["paragraph","table","tableRow","tableCell","gridLayout","gridCell","heading","title","card","cardLayoutItem","cardAccentLayoutItem","button","buttonGroup","gallery","blockquote","calloutBox","smartLayout","smartLayoutCell","toggle","navbar","navbarLinks"].includes(e.type.name),p=e=>e.isAtom||["gallery","card"].includes(e.type.name),m=e=>e.some(e=>e.spec.focusedNode),h=e=>e.some(e=>e.spec.isSelectingNode),g=r.hj.create({name:"focusedNodes",addProseMirrorPlugins(){let e=this.editor;return[new o.Sy({props:{decorations(t){var n;if(!e.isEditable||!(0,a.KB)(e))return;let r=(null===(n=document.activeElement)||void 0===n?void 0:n.tagName)==="IFRAME";if(r)return;let m=t.selection,h=[];return t.doc.nodesBetween(m.from,m.to,(e,t,n)=>{if(u(e)){let r=m instanceof d.hA&&"tableRow"===e.type.name&&m.getTableNode()===n&&m.isRowSelection()&&!m.isColSelection(),a=m instanceof d.hA&&(0,c.CU)(e)&&m.getTableNode()===e&&m.isSelectingAllCells(),l={focusedNode:!0,isSelected:m.from<=t,isFocusedInside:m.from>t||m.to<t+e.nodeSize,isSelectingNode:m instanceof o.qv&&m.node===e||r||a,isSelectingAround:p(e)&&m.from<=t&&m.to>=t+e.nodeSize&&!(m instanceof o.qv)},s=[l.focusedNode?"is-focused":"",l.isSelected?"is-selected":"",l.isFocusedInside?"is-focused-inside":"",l.isSelectingNode?"is-selecting-node":"",l.isSelectingAround?"is-selecting-around":""].join(" ");h.push(i.p.node(t,t+e.nodeSize,{class:s},l))}if((0,l.N5)(e)&&m.from<=t&&m.from<=t)return!1;if("table"===e.type.name&&m instanceof d.hA&&m.isColSelection()&&!m.isSelectingAllCells()){let n=m.$anchorCell.pos,r=s.rU.get(e),{left:o}=r.findCell(n-(t+1));h.push(i.p.node(t,t+e.nodeSize,{},{isColumnSelected:!0,colNumber:o}))}}),i.EH.create(t.doc,h)}}})]}})},39540:function(e,t,n){"use strict";n.d(t,{v:function(){return r}});let r=e=>e.some(e=>e.spec.isFocusedInside)},82400:function(e,t,n){"use strict";n.d(t,{$1:function(){return E},Jg:function(){return y},m8:function(){return I},xd:function(){return N},yV:function(){return A}});var r=n(72338),o=n(42111),i=n(34922),a=n(91994),l=n(24781),s=n(47968),d=n(91073),c=n(67748),u=n(7628),p=n(60742),m=n(11093),h=n(13608),g=n(52332),f=n(96255),x=n(54999),v=n(71474);let b=()=>o.VH.get("presentModeFlat"),y=(e,t)=>{let n=t.pos?e.state.doc.nodeAt(t.pos):null;return n&&A(n,t.cardId)},C=e=>{let{tr:t,editor:n,spotlight:r,bias:o=0,method:i="replace"}=e;t.setMeta(v.M,r);let a=v.M.getState(n.state);if(a.cardId!==r.cardId&&r.cardId){(0,u.D)({cardId:r.cardId,method:i,emitChange:!1});let e=(0,f.Bw)(n,r.cardId);e&&t.setSelection(c.c.create(t.doc,e.pos,o))}n.commands.user({spotlight:r})},w=(e,t)=>{if(!t)return;let n=document.querySelector("".concat(e," ").concat((0,h.U8)(t)));n&&(null==n||n.classList.add("cardWiggle"),setTimeout(()=>{null==n||n.classList.remove("cardWiggle")},750))},k=(e,t)=>{let n=y(e,t),r=n&&t.cardId&&t.pos&&N(e,t.cardId,t.pos,e=>A(e,t.cardId),!0).cardId!==t.cardId;return{isSpotlightingBlock:n,isSpotlightingFirstBlock:r}},j=e=>
1{switch(e.type.name){case"card":return!(0,g.HD)(e);case"toggle":return(0,x.fH)(e.attrs.id);default:return!1}},S=e=>{switch(e.type.name){case"card":return(0,g.Nn)(e.attrs.id,!0),!0;case"toggle":return(0,x.xB)(e.attrs.id,!1),!0;default:return!1}},A=(e,t)=>{switch(e.type.name){case"paragraph":case"heading":case"title":case"math_display":case"codeBlock":return e.textContent.trim().length>0||e.content.content.some(e=>"text"!==e.type.name);case"bullet":case"numbered":case"todo":case"embed":case"video":case"image":case"gallery":case"drawing":case"contributors":case"tableOfContents":case"toggleSummary":case"table":case"buttonGroup":case"gridCell":case"smartLayoutCell":return!0;case"toggle":return!(0,x.fH)(e.attrs.id);case"card":{let n=(0,s.X9)((0,a.bh)().getState()),r=n.parents[e.attrs.id].slice(-1)[0];if(b())return!0===(0,g.HD)(e)&&!1===(0,g.HD)(r);return r===t}default:return!1}},I=e=>{switch(e.type.name){case"toggle":return(0,x.fH)(e.attrs.id);case"card":return!(0,g.HD)(e);case"footnote":case"gallery":case"gridCell":case"smartLayoutCell":case"table":case"cardNotes":return!1;default:return!0}},E=r.hj.create({name:"spotlight",addOptions:()=>({scrollerSelector:"body"}),addCommands(){var e=this;return{syncSpotlightAndScroll:e=>{let{spotlight:t,scroll:n,scrollOffset:r,isFollowing:o=!1}=e;return e=>{let{editor:a,view:l,tr:s}=e,{pos:c,cardId:u}=t,p=v.M.getState(a.state),m=p.cardId!==u;if(c){let e=l.state.doc.nodeAt(c),t=l.nodeDOM(c);if(e&&t instanceof HTMLElement){console.debug("[Spotlight.syncSpotlight] Scrolling to specific card at pos: ".concat(c),t);let n=(0,d.KH)(e)&&e.attrs.id===u;setTimeout(()=>requestAnimationFrame(()=>{n?P({}):L({element:t})}),m?h.id:0)}}else if(null==n?void 0:n.pos){let{pos:e,pct:t}=n;setTimeout(()=>requestAnimationFrame(()=>{a.commands.scrollToPositionInCard(e,t||void 0,r)}),m?h.id:0)}return(0,i.p7)({following:o}),(0,i.Pp)({cardId:u}),C({editor:a,tr:s,spotlight:{pos:c,cardId:u}}),!0}},spotlightCardById:function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return n=>{let{editor:r,view:o}=n,i=v.M.getState(r.state),a=(0,f.Bw)(r,e);if(!a)return!0;let l=r.state.doc.resolve(a.pos),s=l.depth>1&&b(),d=s?(0,h.AQ)(r.state.doc,a.pos):a;if(d){let n=i.cardId!==e;if(s){(0,g.Nn)(e,!1),(0,h.pE)({pos:l.pos,editor:r});let t=o.nodeDOM(a.pos);t instanceof HTMLElement&&setTimeout(()=>requestAnimationFrame(()=>{L({element:t,behavior:"smooth"})}),n?h.id:0)}return t&&b()?r.commands.spotlightNextBlock(!1,{pos:a.pos,cardId:e}):r.commands.syncSpotlightAndScroll({spotlight:{pos:null,cardId:d.node.attrs.id}})}return!0}},spotlightCurrentCard:()=>e=>{let t,{editor:n,tr:r}=e,o=()=>{console.warn("[Spotlight.spotlightCurrentCard] Couldnt find a card to spotlight, so using first card.");let e=n.view.state.doc.nodeAt(1);return e&&(0,d.KH)(e)?C({editor:n,tr:r,spotlight:{pos:null,cardId:e.attrs.id}}):console.error("[Spotlight.spotlightCurrentCard] nodeAt(1) is unexpectedly not a card. Cannot spotlight"),!0},i=document.querySelector(this.options.scrollerSelector);if(!i)return o();let a=n.state.selection.from,l=a&&n.view.coordsAtPos(a);if(l&&l.top<window.innerHeight&&l.bottom>0)console.debug("%c [Spotlight.spotlightCurrentCard] Using cursor pos","background-color: deeppink",{posToUse:t=a});else{let e=(0,m.Je)(n,this.options.scrollerSelector,_+10).pos;console.debug("%c [Spotlight.spotlightCurrentCard] Using top center pos","background-color: deeppink",{posToUse:t=null==e?void 0:e.pos})}(!t||t<2)&&console.warn("%c [Spotlight.spotlightCurrentCard] Using fallback pos","background-color: deeppink",{posToUse:t=2});let s=b()?(0,h.AQ)(n.state.doc,t):(0,h.J9)(n,t,!1);return s&&s.pos?(b()&&(0,h.pE)({editor:n,pos:t}),C({editor:n,tr:r,spotlight:{pos:null,cardId:s.node.attrs.id}}),!0):o()},ascendUpToParentCard:function(){let t=!(arguments.length>0)||void 0===arguments[0]||arguments[0];return n=>{let{editor:o,view:a,tr:l}=n,s=v.M.getState(o.state),c=s.pos;if(!c){let t=(0,m.Je)(o,e.options.scrollerSelector,window.innerHeight/2).pos;c=null==t?void 0:t.pos}if(!c)return!1;let u=o.view.state.doc.nodeAt(c),p=(0,h.J9)(o,c,!1);if(b())return!!p&&!!t&&(w(e.options.scrollerSelector,s.cardId),!0);if(!p)return!1;let g=(0,r.qv)(o.state.doc.resolve(p.pos),d.KH);if(!g)return p&&t&&w(e.options.scrollerSelector,p.node.attrs.id),!1;{let e=a.nodeDOM(p.pos);if(!e)return console.warn("[Spotlight.ascendUpToParentCard] Cant find dom node",{domNo
1de:e,presentingCard:p,parentOfPresentingCard:g,node:u,lastSpotlight:s}),!1;let t=g.node.attrs.id,{isSpotlightingBlock:n}=k(o,s);if(n)return o.commands.spotlightNextBlock(!1,{pos:g.pos,cardId:t});(0,i.Pp)({cardId:t}),C({editor:o,tr:l,spotlight:{pos:null,cardId:t}}),M(L,h.nY)({element:e})}return!0}},descendIntoCurrentCard:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"replace";return n=>{let{editor:r,tr:o}=n,i=v.M.getState(r.state),a=e||i.pos;if(b())return r.commands.spotlightExpandCard(a);if(!a)return!0;let l=r.view.state.doc.nodeAt(a),s=l&&(0,d.KH)(l)&&l.attrs.id!==i.cardId;if(!s)return!0;let c=l.attrs.id,{isSpotlightingBlock:u}=k(r,i);return(console.debug("[Spotlight.descendIntoCurrentCard]",{node:l,isSpotlightingBlock:u}),u)?r.commands.spotlightNextBlock(!1,{pos:a,cardId:c}):(C({editor:r,tr:o,spotlight:{pos:null,cardId:c},method:t}),setTimeout(()=>{requestAnimationFrame(()=>{P({})})},h.id),!0)}},spotlightCollapseCard:e=>t=>{let{editor:n,tr:r}=t;if(!b())return n.commands.ascendUpToParentCard();let o=n.view.state.doc.nodeAt(e);if(!o||!(0,d.KH)(o))return console.warn("[Spotlight.spotlightCollapseCard] pos does not resolve to a card node. This is a noop",e),!0;let i=v.M.getState(n.state),a=o.attrs.id;return(0,g.Nn)(a,!0),C({editor:n,tr:r,spotlight:i}),(0,l.cC)("editor").scrollElementIntoView({element:n.view.nodeDOM(e),attempts:0,offsetFromTop:null}),!0},spotlightCollapseNearestExpandableNode:e=>t=>{let{editor:n,tr:o}=t,i=v.M.getState(n.state),a=e||n.state.selection.from,s={pos:a,node:n.view.state.doc.nodeAt(a)};if(!s.node||!j(s.node)){let e=(0,r.qv)(n.state.doc.resolve(a),j);s.node=(null==e?void 0:e.node)||null,s.pos=(null==e?void 0:e.pos)||0}let d=s.pos&&(0,h.AQ)(n.state.doc,s.pos);if(!s.node||!s.pos||!d||d.node.attrs.id===s.node.attrs.id)return console.warn("[Spotlight.spotlightCollapseNearestExpandableNode] pos does not resolve to a valid collapsible node. This is a noop",s.pos),!1;let u=d.pos<=s.pos&&d.pos+d.node.nodeSize>=s.pos;if(!u)return console.warn("[Spotlight.spotlightCollapseNearestExpandableNode] posToUse is outside of the presenting card. This is a noop",s.pos),!1;console.debug("[Spotlight.spotlightCollapseNearestExpandableNode]",{result:s});let p=S(s.node);return p&&((0,l.cC)("editor").scrollElementIntoView({element:n.view.nodeDOM(s.pos),attempts:0,offsetFromTop:null}),s.pos===n.state.selection.from?n.commands.reHighlightExpandableNode():o.setSelection(c.c.create(n.state.doc,s.pos)),y(n,i)&&C({editor:n,tr:o,spotlight:{pos:s.pos,cardId:d.node.attrs.id}})),p},spotlightExpandCard:e=>t=>{let{editor:n}=t,r=v.M.getState(n.state),o=e&&n.view.state.doc.nodeAt(e);if(!o||!(0,d.KH)(o))return console.warn("[Spotlight.spotlightExpandCard] pos does not resolve to a card node. This is a noop",e),!0;let i=o.attrs.id,{isSpotlightingBlock:a}=k(n,r);return(0,g.Nn)(i,!1),console.debug("[Spotlight.spotlightExpandCard]",{node:o,isSpotlightingBlock:a}),setTimeout(()=>{a?n.commands.spotlightNextBlock(!1,{pos:e,cardId:i},"smooth"):n.commands.scrollToPositionInCard(e,0,50)},h.nY),!0},spotlightNextExpandedCard:e=>t=>{let{editor:n,commands:r}=t,o=v.M.getState(n.state);if(!o.pos||!o.cardId)return!0;let i=(0,h.AQ)(n.state.doc,o.pos),a=(0,f._O)(n,o.pos);if(!i||!a)return!0;let l={node:null,pos:null,cardId:null},s=o.pos;return(n.state.doc.descendants((t,r,o)=>{if(!e&&l.pos)return!1;let i=!(0,g.HD)(t),c=(0,d.KH)(t)&&i&&(e?r<s:r>s);if(!c)return i;let u=t===a.node,p=!u||!e;if(!p){let{isSpotlightingFirstBlock:e}=k(n,{pos:s,cardId:t.attrs.id});p=!e}return p&&(l.node=t,l.pos=r,l.cardId=t.attrs.id),i}),l.pos&&l.cardId)?r.spotlightNextBlock(!1,{pos:l.pos,cardId:l.cardId}):(w(this.options.scrollerSelector,i.node.attrs.id),!0)},spotlightNextCard:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"top";return n=>{let{editor:o,commands:a,tr:l}=n,s=v.M.getState(o.state),c=s.pos,{isSpotlightingBlock:u,isSpotlightingFirstBlock:p}=k(o,s);if(u&&b())return a.spotlightNextExpandedCard(e);if(!c){let e=(0,f.Bw)(o,s.cardId);c=null==e?void 0:e.pos}if(!c)return console.warn("[Spotlight.spotlightNextCard] Could not find posToUse",{lastSpotlight:s}),!1;let m=o.view.state.doc.nodeAt(c),g=!!(m&&e&&u&&!p&&m.attrs.id!==s.cardId),x=m&&s.cardId&&m.attrs.id===s.cardId?{node:m,pos:c}:(0,r.qv)(o.state.doc.resolve(c),d.KH),y=g?x:(null==x?void 0:x.pos)?z(o,x.pos,e):null;if(y&&null!==y.pos){console.debug("[Spotlight.spotlightNextCard] Found next card:",{next:y,posToUse:c,isSpotlightingBlock:u});let n=y.node.attrs.id,r=y.pos;if(u)return o.commands.spotlightNextBlock(!1,{pos:r,cardId:n});(0,i.Pp)({cardId:n}),C({editor:o,tr:l,bias:e?1:-1,spotlight:{pos:null,cardId:n}});let a=s.cardId!==n,d="top"==t?P:R;null!==t&&setTimeout(()=>{d({sync:!0,behavior:"auto"})},a?h.id:0)}else console.debug("[Spotlight.spotlightNextCard] No next node. Will attempt to ascendUp",{lastSpotlight:s,posToUse:c,node:m}),o.commands.ascendUpToParentCard();return!0}},spotlightNextBlock:(e,t,n)=>r=>{let{editor:o,tr:a}
1=r,l=v.M.getState(o.state);if(!l.cardId)return!0;let s=o.state.selection,u=s instanceof c.c,p=u&&(-1===s.side&&e||1===s.side&&!e)?-1:0,m=u?e?s.to+p:s.from+p:void 0,g=(null==t?void 0:t.cardId)||l.cardId,f=(null==t?void 0:t.pos)||l.pos||m,x=u&&null===l.pos&&(0,d.KH)(s.node)&&1===s.$from.depth,{pos:y,cardId:w,domNode:k}=f&&!x?N(o,g,f,A,e):T(o,l.cardId,this.options.scrollerSelector,e);if(null!==y&&k instanceof HTMLElement){var j;let t=b()?null===(j=(0,h.AQ)(o.state.doc,y))||void 0===j?void 0:j.node.attrs.id:w;if(!t)return!0;(0,i.Pp)({cardId:t}),console.debug("%c [Spotlight.spotlightNextBlock]","background-color: deeppink",{prevCardId:l.cardId,cardId:t,pos:y}),setTimeout(()=>{L({element:k,behavior:n})},l.cardId===t?0:h.id),C({editor:o,tr:a,bias:e?1:-1,spotlight:{pos:y,cardId:t}})}else o.commands.ascendUpToParentCard();return!0},turnOffSpotlight:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return t=>{let{editor:n,tr:r}=t,o=v.M.getState(n.state);return C({editor:n,tr:r,spotlight:{pos:null,cardId:e?null:o.cardId}}),!0}},scrollToPositionInCard:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return r=>{let{editor:o}=r,i=(0,p.N_)((0,m.fW)(o,e)),a=null==i?void 0:i.getBoundingClientRect();if(!i||!a)return!0;let l=(t||0)*a.height;return console.debug("%c [Spotlight.scrollToPositionInCard]","background-color: deeppink",JSON.stringify({pos:e,offset:n-l}),i),(0,p.wO)({element:i,color:"deeppink",requiredCookie:"spotlightScrollDebug=true"}),L({element:i,offset:n-l}),!0}},scrollToNodeWithPin:(e,t)=>()=>(console.debug("%c [Spotlight.scrollToNodeWithPin] WITH NODE","background-color: deeppink",{scrollToNode:e}),M(L,h.nY,0)({element:e,offset:t}),!0)}},addProseMirrorPlugins:()=>[(0,v.O)((e,t)=>A(e,t))]}),z=function(e,t){var n;let o=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=e.view.state.doc.nodeAt(t),a=i&&(0,d.KH)(i)?{node:i,pos:t}:(0,r.qv)(e.state.doc.resolve(t),d.KH);if(!a)return;let l=e.state.doc.resolve(o?a.pos:a.pos+(null===(n=a.node)||void 0===n?void 0:n.nodeSize)),s=o?l.nodeBefore:l.nodeAfter;if(!s)return;let c=o?l.pos-s.nodeSize:l.pos,u=(0,d.KH)(s);if(u)return console.debug("[Spotlight.findNextDirectSiblingCard]",{nextNode:s,nextPos:c}),{node:s,pos:c}},T=function(e,t,n){var r;let o=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i={node:null,pos:null,cardId:null,domNode:null},a=(0,m.Je)(e,n,_+10),l=(null===(r=a.pos)||void 0===r?void 0:r.inside)||null,s=l?e.state.doc.nodeAt(l):null;if(!l||!s)return i;if(s.attrs.id===t)return N(e,t,l,e=>A(e,t),o);let d=e.state.doc.resolve(l),c=(0,f._O)(e,d.before());if(!c)return i;let u=d.before(c.depth+2),p=e.state.doc.nodeAt(u);if(p&&A(p,t)){let t=e.state.doc.resolve(u);return i.pos=t.pos,i.node=p,i.cardId=null==c?void 0:c.node.attrs.id,i.domNode=e.view.nodeDOM(i.pos),i}return N(e,t,u,e=>A(e,t),o)},N=function(e,t,n,o){let i=arguments.length>4&&void 0!==arguments[4]&&arguments[4],a={node:null,pos:null,cardId:null,domNode:null},l=e.state.doc.resolve(n),s=e.view.state.doc.nodeAt(n),c=(0,r.qv)(l,e=>(0,d.KH)(e)&&e.attrs.id===t),u=s&&(0,d.KH)(s)&&(null==s?void 0:s.attrs.id)===t?{node:s,pos:n}:c;if(!u)return console.debug("[Spotlight.findNextNode] - No card found:",{cardId:t,from:n,node:s}),a;let p=(e,t)=>{let r=e.attrs.id;e.descendants((l,s)=>{let d=t+s+1,c=o(l,r)&&(i?d<n:d>n);return(!!i||!a.node)&&(c&&(a.node=l,a.pos=d,a.cardId=e.attrs.id),I(l))})};p(u.node,u.pos);let m=u.pos;for(;null===a.pos;){let t=z(e,m,i);if(t)p(t.node,t.pos),m=t.pos;else break}return null!==a.pos&&(a.domNode=e.view.nodeDOM(a.pos)),console.debug("[Spotlight.findNextNode]",{result:a}),a},M=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return r=>{let o;let i={...r,sync:!0,behavior:"auto"};e(i);let a=!1;Promise.race([new Promise(e=>setTimeout(()=>e(!1),n+t+300)),new Promise(e=>{o=()=>e(!0),r.element.addEventListener("transitionend",o)})]).then(e=>{console.debug("[scrollTo withDurationPin] transitionend race result",e),a=!0}).finally(()=>{r.element.removeEventListener("transitionend",o)});let l=+new Date,s=()=>requestAnimationFrame(()=>{e(i);let r=+new Date-l;(r<t+n||!a)&&s()});setTimeout(s,n)}},_=150,L=e=>{let{element:t,sync:n=!1,behavior:r="smooth",offset:o=_}=e;if(!(0,p.cd)(t)){let e=t.querySelector("[data-content-reference]");if(!e||!(0,p.cd)(e))return;t=e}let i=(0,l.cC)("editor"),a=(0,p.LY)(t,i.scrollSelector);i.scrollTo({top:a-o,sync:n,behavior:r})},P=e=>{let{sync:t=!1,behavior:n="smooth"}=e;(0,l.cC)("editor").scrollTo({top:0,behavior:n,sync:t})},R=e=>{let{sync:t=!1,behavior:n="smooth"}=e,r=(0,l.cC)("editor"),o=r.scroller;o&&r.scrollTo({top:o.scrollHeight,behavior:n,sync:t})}},71474:function(e,t,n){"use strict";n.d(t,{M:function(){return d},O:function(){return u}});var r=n(73200),o=n(38564),i=n(27191),a=n(52780),l=n(91073),s=n(82400);let d=new i.H$("spotlight"),c=(e,t,n)=>{if(null===t.pos)return a.EH.create(e.doc,[]);let o=[],i=e.doc.nodeAt(t.pos);i&&(0,l.KH)(i)&&!n(i,t.cardId)?o.push(a.p.node(t.pos,t.pos+i.nodeSize,{class:"presenting-card"})):i&&n(i,t.cardId)&&o.push(a.p.node(t.pos,t.pos+i.nodeSize,{class:"spotlight-block"}));let d=t.pos;return e.doc.descendants((e,i)=>(n(e,t.cardId)&&o.push(a.p.node(i,i+e.nodeSize,{class:(0,r.cx)("spotlightable",i>d&&"after-spotlight")})),(0,s.m8)(e)||(0,l.KH)(e))),a.EH.create(e.doc,o)},u=e=>
1new i.Sy({key:d,state:{init:(t,n)=>{let r={pos:null,cardId:""};return{...r,decorations:c(n,r,e)}},apply(t,n,r,i){let a=o.Gt.getState(i),l=t.getMeta(d),s=a&&a.isChangeOrigin;if(l||s){let t=l||n;return{...t,decorations:c(i,t,e)}}let u=n.decorations.map(t.mapping,t.doc);return{...n,decorations:u}}},props:{attributes:t=>{let n=d.getState(t);if(!n||null===n.pos)return{class:""};let r=t.doc.nodeAt(n.pos);return r&&e(r,n.cardId)?{class:"spotlight-active"}:{class:""}},decorations:e=>{let t=d.getState(e);return t?t.decorations:null}}})},91887:function(e,t,n){"use strict";n.d(t,{i:function(){return P}});var r=n(72338),o=n(90507),i=n(19283),a=n(86353),l=n(59080),s=n(99137),d=n(52322),c=n(28535),u=n(62614),p=n(73200),m=n(42946),h=n(49929),g=n(94523),f=n(87254),x=n(68015),v=n.n(x),b=n(2784),y=n(91994),C=n(98285),w=n(89098),k=n(4878),j=n(47968),S=n(38322),A=n(66028),I=n(93441),E=n(4030),z=n(62047),T=n(86189);let N=e=>{let{colWidths:t}=e;return(0,d.jsxs)("colgroup",{children:[(0,d.jsx)("col",{style:{width:"0%"}}),t.map((e,t)=>(0,d.jsx)("col",{className:"col-width-control",style:{width:"".concat(e,"%")}},t))]})};N.displayName="ColGroup";let M=e=>{var t;let n=(0,k.TZ)(),{node:r,editor:i,getPos:a,decorations:x,updateAttributes:z}=e,{colMinPercent:M,newColSize:L}=i.schema.nodes.table.spec,P=(0,s.Ux)(r.attrs.colWidths,L,M),R=l.rU.get(r),H=x.some(e=>e.spec.isFocusedInside),D=null===(t=x.find(e=>e.spec.isColumnSelected))||void 0===t?void 0:t.spec.colNumber,{colWidths:O}=r.attrs,B=(0,y.CG)(j.Pu),F=(0,w.c)(B),W=(0,I.gF)();(0,b.useEffect)(()=>{R.width!==O.length&&setTimeout(()=>{z({colWidths:(0,s.RS)(R.width)})},0)},[R.width,O,z]);let G=(0,b.useCallback)(e=>{let t=a()+1;return t+R.positionAt(0,e,r)},[a,r,R]),U=(0,b.useCallback)(e=>{let t=G(e+1)+1;i.chain().addColumnAfter(e).command(e=>{let{tr:n}=e,r=(0,S.t)(n.doc.resolve(t));return r&&n.setSelection(r),!0}).run()},[i,G]),V=(0,b.useCallback)(()=>{let e=R.width-1;U(e)},[U,R.width]),q=v()(r.attrs.colWidths.reduce((e,t)=>e+t,0),20);return W?(0,d.jsx)(E.lO,{as:"div",...e,...r.attrs,children:(0,d.jsxs)(c.xu,{w:"fit-content",overflowX:n?"auto":void 0,position:"relative",width:"100%",className:(0,p.cx)("table-wrapper"),"data-selection-ring":!0,sx:F.tableSx,children:[(0,d.jsxs)("table",{style:{width:n?"max-content":"".concat(q,"%"),minWidth:n?"100%":void 0,maxWidth:n?"200vw":void 0,tableLayout:n?"auto":"fixed",position:"relative"},children:[(0,d.jsx)(N,{cols:R.width,colWidths:O}),(0,d.jsx)("thead",{children:(0,d.jsx)(_,{numColumns:R.width,selectedColumn:D,getColumnPosition:G,...e})}),(0,d.jsx)(o.ms,{as:"tbody",className:"table-content"})]}),(0,d.jsx)(T.A,{...e,"data-testid":"select-table-button",onClick:()=>{let e=G(0);i.chain().focus().selectTable(e).run()},label:f.ag._({id:"3xRGMR"})}),H&&(0,d.jsxs)(c.xu,{contentEditable:!1,suppressContentEditableWarning:!0,children:[(0,d.jsx)(g.kH,{placement:"right",label:f.ag._({id:"AgvHni"}),children:(0,d.jsx)(u.z,{position:"absolute",left:"100%",top:"0",height:"100%",onClick:V,onMouseDown:A.br,minWidth:"0",width:"auto",isDisabled:!P,zIndex:1,"data-testid":"add-col-end-button",size:"xs",shadow:"sm",variant:"unstyled",color:"var(--body-color)",className:C.wY,backgroundColor:"var(--clickable-background-color)",ml:1,w:5,children:(0,d.jsx)(h.G,{icon:m.r8p})})}),(0,d.jsx)(g.kH,{placement:"bottom",label:f.ag._({id:"qZd/ph"}),children:(0,d.jsx)(u.z,{position:"absolute",left:"0",top:"100%",width:"100%",onClick:()=>{let e=a()+1,t=R.height-1,n=R.width-1,o=e+R.positionAt(t,n,r);i.chain().focus(o).addRowAfter().run(),requestAnimationFrame(()=>i.chain().focus(o).goToNextCell().run())},onMouseDown:A.br,minHeight:"0",height:6,zIndex:4,"data-testid":"add-row-end-button",size:"xs",shadow:"sm",variant:"unstyled",color:"var(--body-color)",className:C.wY,mt:1,children:(0,d.jsx)(h.G,{icon:m.r8p})})})]})]})}):null},_=e=>{let{numColumns:t,selectedColumn:n,getColumnPosition:r,...o}=e,{editor:i}=o,a=(0,b.useCallback)(e=>{let t=r(e);i.chain().focus().selectColumn(t).run()},[i,r]);if(!t)return null;let l=Array.from(Array(t).keys());return(0,d.jsxs)("tr",{contentEditable:!1,suppressContentEditableWarning:!0,children:[(0,d.jsx)("th",{style:{padding:0}}),l.map(e=>(0,d.jsx)(L,{colNumber:e,selectColumn:a,isSelected:e===n,...o},e))]})},L=(0,b.memo)(e=>{let{colNumber:t,selectColumn:n,...r}=e,{decorations:o}=r,{colHover:i}=(0,z.Sz)(o),{colFocus:a}=(0,z.vz)(o),l=(0,b.useCallback)(()=>n(t),[t,n]);return(0,d.jsx)("th",{style:{position:"relative",padding:0,border:0},className:"table-col-control",children:(0,d.jsx)(T.A,{...r,handlePlacement:"top",label:f.ag._({i
1d:"K3GOZ1"}),zIndex:"3",isVisible:i===t||a===t,onClick:l,"data-test-column-control":t})},t)});L.displayName="SelectColumnHeader";let P=r.NB.create({name:"table",priority:i.a.Table,containerHandle:!0,addNodeView:()=>(0,o.fW)(M,{update:a.E7}),addOptions:()=>({resizable:!0,handleWidth:10,colMinPercent:10,newColSize:20,lastColumnResizable:!1,allowTableNodeSelection:!0}),content:"tableRow+",tableRole:"table",isolating:!0,allowGapCursor:!1,group:"cardBlock layoutBlock footnoteBlock calloutBlock",parseHTML:()=>[{tag:"table"}],renderHTML(e){let{HTMLAttributes:t}=e;return["table",(0,r.P1)(this.options.HTMLAttributes,t),["tbody",0]]},addAttributes:()=>({colWidths:{default:[],parseHTML:e=>{let t=e.getAttribute("data-".concat("colWidths"));if(t)return JSON.parse(t);let n=e.querySelector("tr");if(!n)return[];let r=0;return n.childNodes.forEach(e=>{"TD"===e.nodeName&&r++}),(0,s.RS)(r)}},fullWidthBlock:{default:!1}}),addCommands(){return{insertTable:function(){let{rows:e=3,cols:t=3,withHeaderRow:n=!0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return r=>{let{dispatch:o,editor:i,commands:a}=r;if(!o)return!1;let l=function(e,t,n,r,o){let i=function(e){if(e.cached.tableNodeTypes)return e.cached.tableNodeTypes;let t={};return Object.keys(e.nodes).forEach(n=>{let r=e.nodes[n];r.spec.tableRole&&(t[r.spec.tableRole]=r)}),e.cached.tableNodeTypes=t,t}(e),a=[],l=[];for(let e=0;e<n;e+=1){let e=i.cell.createAndFill();e&&l.push(e)}let d=[];for(let e=0;e<t;e+=1)d.push(i.row.createChecked(null,r&&0===e?a:l));return i.table.createChecked({colWidths:(0,s.RS)(n)},d)}(i.schema,e,t,n);return a.insertContentAndSelect(l.toJSON())}},addColumnBefore:e=>t=>{let{state:n,dispatch:r,tr:o}=t;if(!(0,l.Lw)(n.selection)||!r)return!1;let{table:i,tableStart:a}=(0,l.zN)(n.selection);return(0,l.Wf)(o,{table:i,col:e,tableStart:a,newColSize:this.options.newColSize,colMinPercent:this.options.colMinPercent})},addColumnAfter:e=>t=>{let{state:n,dispatch:r,tr:o}=t;if(!(0,l.Lw)(n.selection)||!r)return!1;let{table:i,tableStart:a}=(0,l.zN)(n.selection);return(0,l.Wf)(o,{table:i,col:e+1,tableStart:a,newColSize:this.options.newColSize,colMinPercent:this.options.colMinPercent})},equalizeColumns:()=>e=>{let{state:t,dispatch:n,tr:r}=e;if(!(0,l.Lw)(t.selection)||!n)return!1;let{map:o,tableStart:i}=(0,l.zN)(t.selection);return r.setNodeMarkup(i-1,void 0,{colWidths:(0,s.RS)(o.width)}),!0},visualizeTable:()=>e=>{let{state:t,dispatch:n,tr:r}=e;if(!(0,l.Lw)(t.selection)||!n)return!1;let{map:o,tableStart:i}=(0,l.zN)(t.selection);return r.setNodeMarkup(i-1,void 0,{colWidths:(0,s.RS)(o.width)}),!0},deleteColumn:()=>e=>{let{state:t,dispatch:n,tr:r}=e;return!!n&&(0,l.oU)(t.selection,r,n)},addRowBefore:()=>e=>{let{state:t,dispatch:n}=e;return(0,l.z2)(t,n)},addRowAfter:()=>e=>{let{state:t,dispatch:n}=e;return(0,l.dl)(t,n)},deleteRow:()=>e=>{let{state:t,dispatch:n,tr:r}=e;return(0,l.A_)(t.selection,r,n)},deleteTable:()=>e=>{let{state:t,tr:n,dispatch:r}=e;return!!r&&(0,l.Lh)(t.selection,n,r)},deleteTableWhenEmpty:()=>e=>{let{state:t,tr:n,dispatch:r}=e;return!!r&&(0,l.Fw)(t.selection,n,r)},deleteColWhenEmpty:()=>e=>{let{state:t,tr:n,dispatch:r}=e;return!!r&&(0,l.mh)(t.selection,n,r)},deleteRowWhenEmpty:()=>e=>{let{state:t,tr:n,dispatch:r}=e;return!!r&&(0,l._W)(t.selection,n,r)},mergeCells:()=>e=>{let{state:t,dispatch:n}=e;return(0,l.JX)(t,n)},splitCell:()=>e=>{let{state:t,dispatch:n}=e;return(0,l.Cr)(t,n)},toggleHeaderColumn:()=>e=>{let{state:t,dispatch:n}=e;return(0,l.sr)(t,n)},toggleHeaderRow:()=>e=>{let{state:t,dispatch:n}=e;return(0,l.lm)(t,n)},toggleHeaderCell:()=>e=>{let{state:t,dispatch:n}=e;return(0,l.II)(t,n)},mergeOrSplit:()=>e=>{let{state:t,dispatch:n}=e;return!!(0,l.JX)(t,n)||(0,l.Cr)(t,n)},setCellAttribute:(e,t)=>n=>{let{state:r,dispatch:o}=n;return(0,l.wb)(e,t)(r,o)},goToNextCell:()=>e=>{let{state:t,dispatch:n}=e;return(0,l.nA)(1)(t,n)},goToPreviousCell:()=>e=>{let{state:t,dispatch:n}=e;return(0,l.nA)(-1)(t,n)},fixTables:()=>e=>{let{state:t,dispatch:n}=e;return n&&(0,l.tp)(t),!0},setCellSelection:e=>t=>{let{tr:n,dispatch:r}=t;if(r){let t=l.Xc.create(n.doc,e.anchorCell,e.headCell);n.setSelection(t)}return!0}}},addKeyboardShortcuts(){let e=()=>this.editor.commands.first(e=>{let{commands:t}=e;return[()=>t.deleteTableWhenEmpty(),()=>
1t.deleteRowWhenEmpty(),()=>t.deleteColWhenEmpty()]});return{Tab:()=>!!this.editor.commands.goToNextCell()||!!this.editor.can().addRowAfter()&&this.editor.chain().addRowAfter().goToNextCell().run(),"Shift-Tab":()=>this.editor.commands.goToPreviousCell(),Backspace:e,"Mod-Backspace":e,Delete:e,"Mod-Delete":e}},addProseMirrorPlugins(){return this.options.resizable,[(0,l.VH)({handleWidth:this.options.handleWidth,colMinPercent:this.options.colMinPercent,lastColumnResizable:this.options.lastColumnResizable}),(0,l.G3)({allowTableNodeSelection:this.options.allowTableNodeSelection})]},extendNodeSchema(e){var t,n;let o={name:e.name,options:e.options,storage:e.storage};return{colMinPercent:null===(t=e.options)||void 0===t?void 0:t.colMinPercent,newColSize:null===(n=e.options)||void 0===n?void 0:n.newColSize,tableRole:(0,r.nU)((0,r.Nl)(e,"tableRole",o))}}})},20297:function(e,t,n){"use strict";n.d(t,{FK:function(){return p},fI:function(){return u},hA:function(){return d}});var r=n(30764),o=n(27191),i=n(52780),a=n(15401),l=n(15039),s=n(15034);class d extends o.Y1{map(e,t){let n=e.resolve(t.map(this.$anchorCell.pos)),r=e.resolve(t.map(this.$headCell.pos));if((0,s.Fn)(n)&&(0,s.Fn)(r)&&(0,s.yL)(n,r)){let e=this.$anchorCell.node(-1)!=n.node(-1);return e&&this.isRowSelection()?d.rowSelection(n,r):e&&this.isColSelection()?d.colSelection(n,r):new d(n,r)}return o.Bs.between(n,r)}content(){let e=this.$anchorCell.node(-1),t=l.r.get(e),n=this.$anchorCell.start(-1),o=t.rectBetween(this.$anchorCell.pos-n,this.$headCell.pos-n),i={},a=[];for(let n=o.top;n<o.bottom;n++){let l=[];for(let r=n*t.width+o.left,a=o.left;a<o.right;a++,r++){let n=t.map[r];if(!i[n]){i[n]=!0;let r=t.findCell(n),a=e.nodeAt(n),d=o.left-r.left,c=r.right-o.right;if(d>0||c>0){let e=a.attrs;d>0&&(e=(0,s.H6)(e,0,d)),c>0&&(e=(0,s.H6)(e,e.colspan-c,c)),a=r.left<o.left?a.type.createAndFill(e):a.type.create(e,a.content)}if(r.top<o.top||r.bottom>o.bottom){let e=(0,s.fi)(a.attrs,"rowspan",Math.min(r.bottom,o.bottom)-Math.max(r.top,o.top));a=r.top<o.top?a.type.createAndFill(e):a.type.create(e,a.content)}l.push(a)}}a.push(e.child(n).copy(r.HY.from(l)))}let d=this.isColSelection()&&this.isRowSelection()?e:a;return new r.p2(r.HY.from(d),1,1)}replace(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:r.p2.empty,n=e.steps.length,i=this.ranges;if(0===t.size){if(this.isSelectingAllCells()){(0,a.Lh)(this,e);return}if(this.isRowSelection()){(0,a.A_)(this,e);return}if(this.isColSelection()){(0,a.oU)(this,e);return}}for(let o=0;o<i.length;o++){let{$from:a,$to:l}=i[o],s=e.mapping.slice(n);e.replace(s.map(a.pos),s.map(l.pos),o?r.p2.empty:t)}let l=o.Y1.findFrom(e.doc.resolve(e.mapping.slice(n).map(this.to)),-1);l&&e.setSelection(l)}replaceWith(e,t){this.replace(e,new r.p2(r.HY.from(t),0,0))}getTableNode(){return this.$anchorCell.node(-1)}isSelectingAllCells(){let e=l.r.get(this.$anchorCell.node(-1));return e.map.length===this.ranges.length}everyCell(e){let t=!0;return this.forEachCell((n,r)=>{let o=e(n,r);o||(t=!1)}),t}forEachCell(e){let t=this.$anchorCell.node(-1),n=l.r.get(t),r=this.$anchorCell.start(-1),o=n.cellsInRect(n.rectBetween(this.$anchorCell.pos-r,this.$headCell.pos-r));for(let n=0;n<o.length;n++)e(t.nodeAt(o[n]),r+o[n])}isColSelection(){let e=this.$anchorCell.index(-1),t=this.$headCell.index(-1);if(Math.min(e,t)>0)return!1;let n=e+this.$anchorCell.nodeAfter.attrs.rowspan,r=t+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(n,r)==this.$headCell.node(-1).childCount}static colSelection(e){let t=arguments.length>
11&&void 0!==arguments[1]?arguments[1]:e,n=l.r.get(e.node(-1)),r=e.start(-1),o=n.findCell(e.pos-r),i=n.findCell(t.pos-r),a=e.node(0);return o.top<=i.top?(o.top>0&&(e=a.resolve(r+n.map[o.left])),i.bottom<n.height&&(t=a.resolve(r+n.map[n.width*(n.height-1)+i.right-1]))):(i.top>0&&(t=a.resolve(r+n.map[i.left])),o.bottom<n.height&&(e=a.resolve(r+n.map[n.width*(n.height-1)+o.right-1]))),new d(e,t)}isRowSelection(){let e=l.r.get(this.$anchorCell.node(-1)),t=this.$anchorCell.start(-1),n=e.colCount(this.$anchorCell.pos-t),r=e.colCount(this.$headCell.pos-t);if(Math.min(n,r)>0)return!1;let o=n+this.$anchorCell.nodeAfter.attrs.colspan,i=r+this.$headCell.nodeAfter.attrs.colspan;return Math.max(o,i)==e.width}eq(e){return e instanceof d&&e.$anchorCell.pos==this.$anchorCell.pos&&e.$headCell.pos==this.$headCell.pos}static rowSelection(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e,n=l.r.get(e.node(-1)),r=e.start(-1),o=n.findCell(e.pos-r),i=n.findCell(t.pos-r),a=e.node(0);return o.left<=i.left?(o.left>0&&(e=a.resolve(r+n.map[o.top*n.width])),i.right<n.width&&(t=a.resolve(r+n.map[n.width*(i.top+1)-1]))):(i.left>0&&(t=a.resolve(r+n.map[i.top*n.width])),o.right<n.width&&(e=a.resolve(r+n.map[n.width*(o.top+1)-1]))),new d(e,t)}toJSON(){return{type:"CellSelection2",anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(e,t){return new d(e.resolve(t.anchor),e.resolve(t.head))}static create(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t;return new d(e.resolve(t),e.resolve(n))}getBookmark(){return new c(this.$anchorCell.pos,this.$headCell.pos)}constructor(e,t=e){let n=e.node(-1),r=l.r.get(n),i=e.start(-1),a=r.rectBetween(e.pos-i,t.pos-i),s=e.node(0),d=r.cellsInRect(a).filter(e=>e!=t.pos-i);d.unshift(t.pos-i);let c=d.map(e=>{let t=n.nodeAt(e),r=e+i+1;return new o.xm(s.resolve(r),s.resolve(r+t.content.size))});super(c[0].$from,c[0].$to,c),this.$anchorCell=e,this.$headCell=t,this.$anchorCell=e,this.$headCell=t}}if(!d.prototype.jsonID)try{o.Y1.jsonID("CellSelection2",d)}catch(e){}class c{map(e){return new c(e.map(this.anchor),e.map(this.head))}resolve(e){let t=e.resolve(this.anchor),n=e.resolve(this.head);return"row"==t.parent.type.spec.tableRole&&"row"==n.parent.type.spec.tableRole&&t.index()<t.parent.childCount&&n.index()<n.parent.childCount&&(0,s.yL)(t,n)?new d(t,n):o.Y1.near(n,1)}constructor(e,t){this.anchor=e,this.head=t,this.anchor=e,this.head=t}}function u(e){if(!(e.selection instanceof d))return null;let t=[];return e.selection.forEachCell((e,n)=>{t.push(i.p.node(n,n+e.nodeSize,{class:"selectedCell"}))}),i.EH.create(e.doc,t)}function p(e,t,n){let r,i;let a=(t||e).selection,s=(t||e).doc;if(a instanceof o.qv&&(i=a.node.type.spec.tableRole)){if("cell"==i||"header_cell"==i)r=d.create(s,a.from);else if("row"==i){let e=s.resolve(a.from+1);r=d.rowSelection(e,e)}else if(!n){let e=l.r.get(a.node),t=a.from+1,n=t+e.map[e.width*e.height-1];r=d.create(s,t+1,n)}}else a instanceof o.Bs&&function(e){let{$from:t,$to:n}=e;if(t.pos==n.pos||t.pos<t.pos-6)return!1;let r=t.pos,o=n.pos,i=t.depth;for(;i>=0&&!(t.after(i+1)<t.end(i));i--,r++);for(let e=n.depth;e>=0&&!(n.before(e+1)>n.start(e));e--,o--);return r==o&&/row|table/.test(t.node(i).type.spec.tableRole)}(a)?r=o.Bs.create(s,a.from):a instanceof o.Bs&&function(e){let t,n,{$from:r,$to:o}=e;for(let e=r.depth;e>0;e--){let n=r.node(e);if("cell"===n.type.spec.tableRole||"header_cell"===n.type.spec.tableRole){t=n;break}}for(let e=o.depth;e>0;e--){let t=o.node(e);if("cell"===t.type.spec.tableRole||"header_cell"===t.type.spec.tableRole){n=t;break}}return t!==n&&0===o.parentOffset}(a)&&(r=o.Bs.create(s,a.$from.start(),a.$from.end()));return r&&(t||(t=e.tr)).setSelection(r),t}},99137:function(e,t,n){"use strict";n.d(t,{CO:function(){return h},GI:function(){return p},RS:function(){return i},Ux:function(){return m},Z7:function(){return g}});var r=n(68015),o=n.n(r);let i=e=>{let t=o()(100/e,2),n=[];for(let r=0;r<e;r++)n.push(t);return n},a=(e,t,n,r)=>r?s(e,t,n):l(e,t),l=(e,t)=>{let n=0,r=[];for(let o=t+1;o<e.length;o++){let t=e[o];n+=t,r.push(o)}let o=[];for(let t=0;t<e.length;t++){if(!r.includes(t)){o.push(0);continue}let i=e[t];o.push(i/n)}return o},s=(e,t,n)=>{let r=0,o=[];for(let i=t+1;i<e.length;i++){let t=e[i];t>n&&(r+=t,o.push(i))}let i=[];for(let t=0;t<e.length;t++){if(!o.includes(t)){i.push(0);continue}let n=e[t];i.push(n/r)}return i},d=e=>{let t=e.reduce((e,t)=>
1e+t,0),n=[];for(let r=0;r<e.length;r++)n.push(e[r]/t);return n},c=(e,t,n)=>{let r=0,o=[];for(let i=0;i<e.length;i++){if(i===t)continue;let a=e[i];a>n&&(r+=a,o.push(i))}let i=[];for(let o=0;o<e.length;o++){if(o===t){i.push(0);continue}let a=e[o];if(a<=n){i.push(0);continue}i.push(a/r)}return i},u=function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=0;for(let i=0;i<e.length;i++){let a=n[i],l=t*a;l<0&&(l=Math.max(r-e[i],l)),o+=l,e[i]+=l}return o},p=(e,t,n,r)=>{let o=[...e],i=e[t],l=i-r,s=e.reduce((e,n,o)=>o<t?e+n:o>t?e+r:e,0),d=n>0?Math.min(n,100-s-i):Math.max(-l,n),c=a(o,t,r,d>0),p=Math.abs(d),m=d>0,h=0;for(;p>.001;){let e=Math.min(p,1);m&&(e*=-1);let n=u(o,e,c,r);if(o[t]-=n,p-=Math.abs(n),c=a(o,t,r,d>0),++h>1e3)break}return f(o,r),o},m=(e,t,n)=>{let r=h(e,e.length,t,n);return r.length!==e.length},h=(e,t,n,r)=>{let o=n,i=[...e];i.splice(t,0,0);let a=c(i,t,r),l=!1;for(;o>.001;){if(a.every(e=>0===e)){l=!0;break}let e=Math.min(o,1),n=u(i,-e,a,r);i[t]-=n,a=c(i,t,r),o-=Math.abs(n)}return l?e:(f(i,r),i)},g=(e,t)=>{let n=0,r=t.sort((e,t)=>t-e),o=[...e];r.forEach(t=>{n+=e[t],o.splice(t,1)});let i=d(o);for(;n>.001;){let e=Math.min(n,1),t=u(o,e,i);i=d(o),n-=Math.abs(t)}return f(o,0),o},f=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:100,r=0;e.forEach((t,n)=>{let o=Math.round(100*t);e[n]=o,r+=o});let o=100*n-r,i=Math.abs(o),a=0;for(;i>0;){let n=o<0?-1:1,r=a%e.length;if(void 0!==t&&n<0&&e[r]<=100*t){a++;continue}e[r]+=n,a++,i--}for(let t=0;t<e.length;t++)e[t]=e[t]/100}},15401:function(e,t,n){"use strict";n.d(t,{A_:function(){return x},Cr:function(){return y},Fw:function(){return z},II:function(){return A},JX:function(){return b},Lh:function(){return E},Wf:function(){return p},_W:function(){return T},dl:function(){return f},lm:function(){return j},mh:function(){return N},nA:function(){return I},oU:function(){return m},sr:function(){return S},wb:function(){return C},z2:function(){return g},zN:function(){return u}});var r=n(30764),o=n(27191),i=n(15690),a=n(20297),l=n(99137),s=n(34332),d=n(15039),c=n(15034);function u(e){let t=(0,c.Le)(e),n=t.node(-1),r=t.start(-1),o=d.r.get(n),i=e instanceof a.hA?o.rectBetween(e.$anchorCell.pos-r,e.$headCell.pos-r):o.findCell(t.pos-r);return{...i,map:o,table:n,tableStart:r}}function p(e,t){let{tableStart:n,col:r,table:o,colMinPercent:i,newColSize:a=20}=t,u=d.r.get(o),p=r>0?-1:0;(0,c.a2)(u,o,r+p)&&(p=0==r||r==u.width?null:0);for(let t=0;t<u.height;t++){let i=t*u.width+r;if(r>0&&r<u.width&&u.map[i-1]==u.map[i]){let a=u.map[i],l=o.nodeAt(a);e.setNodeMarkup(e.mapping.map(n+a),void 0,(0,c.hl)(l.attrs,r-u.colCount(a))),t+=l.attrs.rowspan-1}else{let a=null==p?(0,s.F)(o.type.schema).cell:o.nodeAt(u.map[i+p]).type,l=u.positionAt(t,r,o);e.insert(e.mapping.map(n+l),a.createAndFill())}}let{colWidths:m}=o.attrs,h=(0,l.CO)(m,r,a,i);return m.length===h.length?(e.setMeta("preventDispatch",!0),!1):(e.setNodeMarkup(n-1,void 0,{colWidths:[...h]}),!0)}function m(e,t,n){if(!(0,c.Lw)(e))return!1;let r=u(e);if(0==r.left&&r.right==r.map.width)return!1;let i=[];for(let e=r.right-1;!function(e,t,n){let{map:r,tableStart:o,table:i}=t,a=e.mapping.maps.length;for(let t=0;t<r.height;){let l=t*r.width+n,s=r.map[l],d=i.nodeAt(s);if(n>0&&r.map[l-1]==s||n<r.width-1&&r.map[l+1]==s)e.setNodeMarkup(e.mapping.slice(a).map(o+s),void 0,(0,c.H6)(d.attrs,n-r.colCount(s)));else{let t=e.mapping.slice(a).map(o+s);e.delete(t,t+d.nodeSize)}t+=d.attrs.rowspan}}(t,r,e),i.push(e),e!=r.left;e--)r.table=r.tableStart?t.doc.nodeAt(r.tableStart-1):t.doc,r.map=d.r.get(r.table);let a=(0,l.Z7)(r.table.attrs.colWidths,i);if(t.setNodeMarkup(r.tableStart-1,void 0,{colWidths:a}),r.right===r.map.width){let e=r.tableStart+r.map.positionAt(0,r.left-1,r.table),n=t.doc.resolve(e),i=o.Y1.near(n);t.setSelection(i)}return n&&n(t),!0}function h(e,t,n){let{map:r,tableStart:o,table:i}=t,a=o;for(let e=0;e<n;e++)a+=i.child(e).nodeSize;let l=[],d=n>0?-1:0;(function(e,t,n){let r=(0,s.F)(t.type.schema).header_cell;for(let o=0;o<e.width;o++)if(t.nodeAt(e.map[o+n*e.width]).type!=r)return!1;return!0})(r,i,n+d)&&(d=0==n||n==r.height?null:0);for(let t=0,a=r.width*n;t<r.width;t++,a++)if(n>0&&n<r.height&&r.map[a]==r.map[a-r.width]){let n=r.map[a],l=i.nodeAt(n).attrs;e.setNodeMarkup(o+n,void 0,(0,c.fi)(l,"rowspan",l.rowspan+1)),t+=l.colspan-1}
1else{let e=null==d?(0,s.F)(i.type.schema).cell:i.nodeAt(r.map[a+d*r.width]).type;l.push(e.createAndFill())}return e.insert(a,(0,s.F)(i.type.schema).row.create(null,l)),e}function g(e,t){if(!(0,c.Lw)(e.selection))return!1;if(t){let n=u(e.selection);t(h(e.tr,n,n.top))}return!0}function f(e,t){if(!(0,c.Lw)(e.selection))return!1;if(t){let n=u(e.selection);t(h(e.tr,n,n.bottom))}return!0}function x(e,t,n){if(!(0,c.Lw)(e))return!1;let r=u(e);if(0==r.top&&r.bottom==r.map.height)return!1;for(let e=r.bottom-1;!function(e,t,n){let{map:r,table:o,tableStart:i}=t,a=0;for(let e=0;e<n;e++)a+=o.child(e).nodeSize;let l=a+o.child(n).nodeSize,s=e.mapping.maps.length;e.delete(a+i,l+i);for(let t=0,a=n*r.width;t<r.width;t++,a++){let l=r.map[a];if(n>0&&l==r.map[a-r.width]){let n=o.nodeAt(l).attrs;e.setNodeMarkup(e.mapping.slice(s).map(l+i),void 0,(0,c.fi)(n,"rowspan",n.rowspan-1)),t+=n.colspan-1}else if(n<r.width&&l==r.map[a+r.width]){let a=o.nodeAt(l),d=a.type.create((0,c.fi)(a.attrs,"rowspan",a.attrs.rowspan-1),a.content),u=r.positionAt(n+1,t,o);e.insert(e.mapping.slice(s).map(i+u),d),t+=a.attrs.colspan-1}}}(t,r,e),e!=r.top;e--)r.table=r.tableStart?t.doc.nodeAt(r.tableStart-1):t.doc,r.map=d.r.get(r.table);if(r.bottom===r.map.height){let e=r.tableStart+r.map.positionAt(r.top-1,0,r.table),n=t.doc.resolve(e),i=o.Y1.near(n);t.setSelection(i)}return n&&n(t),!0}function v(e){let t=e.content;return 1==t.childCount&&t.firstChild.isTextblock&&0==t.firstChild.childCount}function b(e,t){let n=e.selection;if(!(n instanceof a.hA)||n.$anchorCell.pos==n.$headCell.pos)return!1;let o=u(e.selection),{map:i}=o;if(function(e,t){let{width:n,height:r,map:o}=e,i=t.top*n+t.left,a=i,l=(t.bottom-1)*n+t.left,s=i+(t.right-t.left-1);for(let e=t.top;e<t.bottom;e++){if(t.left>0&&o[a]==o[a-1]||t.right<n&&o[s]==o[s+1])return!0;a+=n,s+=n}for(let e=t.left;e<t.right;e++){if(t.top>0&&o[i]==o[i-n]||t.bottom<r&&o[l]==o[l+n])return!0;i++,l++}return!1}(i,o))return!1;if(t){let n=e.tr,l={},s=r.HY.empty,d,u;for(let e=o.top;e<o.bottom;e++)for(let t=o.left;t<o.right;t++){let r=i.map[e*i.width+t],a=o.table.nodeAt(r);if(!l[r]){if(l[r]=!0,null==d)d=r,u=a;else{v(a)||(s=s.append(a.content));let e=n.mapping.map(r+o.tableStart);n.delete(e,e+a.nodeSize)}}}if(n.setNodeMarkup(d+o.tableStart,void 0,(0,c.fi)((0,c.hl)(u.attrs,u.attrs.colspan,o.right-o.left-u.attrs.colspan),"rowspan",o.bottom-o.top)),s.size){let e=d+1+u.content.size,t=v(u)?d+1:e;n.replaceWith(t+o.tableStart,e+o.tableStart,s)}n.setSelection(new a.hA(n.doc.resolve(d+o.tableStart))),t(n)}return!0}function y(e,t){var n;let r=(0,s.F)(e.schema);return(n=e=>{let{node:t}=e;return r[t.type.spec.tableRole]},(e,t)=>{let r,o;let i=e.selection;if(i instanceof a.hA){if(i.$anchorCell.pos!=i.$headCell.pos)return!1;r=i.$anchorCell.nodeAfter,o=i.$anchorCell.pos}else{if(!(r=(0,c.Dq)(i.$from)))return!1;o=(0,c.m9)(i.$from).pos}if(1==r.attrs.colspan&&1==r.attrs.rowspan)return!1;if(t){let l,s=r.attrs,d=[],p=s.colwidth;s.rowspan>1&&(s=(0,c.fi)(s,"rowspan",1)),s.colspan>1&&(s=(0,c.fi)(s,"colspan",1));let m=u(e.selection),h=e.tr;for(let e=0;e<m.right-m.left;e++)d.push(p?(0,c.fi)(s,"colwidth",p&&p[e]?[p[e]]:null):s);for(let e=m.top;e<m.bottom;e++){let t=m.map.positionAt(e,m.left,m.table);e==m.top&&(t+=r.nodeSize);for(let o=m.left,i=0;o<m.right;o++,i++)(o!=m.left||e!=m.top)&&h.insert(l=h.mapping.map(t+m.tableStart,1),n({node:r,row:e,col:o}).createAndFill(d[i]))}h.setNodeMarkup(o,n({node:r,row:m.top,col:m.left}),d[0]),i instanceof a.hA&&h.setSelection(new a.hA(h.doc.resolve(i.$anchorCell.pos),l&&h.doc.resolve(l))),t(h)}return!0})(e,t)}function C(e,t){return function(n,r){var o;if(!(0,c.Lw)(n.selection))return!1;let i=(0,c.Le)(n.selection);if((null===(o=i.nodeAfter)||void 0===o?void 0:o.attrs[e])===t)return!1;if(r){let o=n.tr;n.selection instanceof a.hA?n.selection.forEachCell((n,r)=>{n.attrs[e]!==t&&o.setNodeMarkup(r,void 0,(0,c.fi)(n.attrs,e,t))}):o.setNodeMarkup(i.pos,void 0,(0,c.fi)(i.nodeAfter.attrs,e,t)),r(o)}return!0}}function w(e,t,n){let r=t.map.cellsInRect({left:0,top:0,right:"row"==e?t.map.width:1,bottom:"column"==e?t.map.height:1});for(let e=0;e<r.length;e++){let o=t.table.nodeAt(r[e]);if(o&&o.type!==n.header_cell)return!1}return!0}function k(e,t){return(t=t||{useDeprecatedLogic:!1}).useDeprecatedLogic?function(t,n){if(!(0,c.Lw)(t.selection))return!1;if(n){let r=(0,s.F)(t.schema),o=u(t.selection),i=t.tr,a=o.map.cellsInRect("column"==e?new d.U(o.left,0,o.right,o.map.height):"row"==e?new d.U(0,o.top,o.map.width,o.bottom):o),l=a.map(e=>o.table.nodeAt(e));for(let e=0;e<a.length;e++)l[e].type==r.header_cell&&i.setNodeMarkup(o.tableStart+a[e],r.cell,l[e].attrs);if(0==i.steps.length)for(let e=0;e<a.length;e++)i.setNodeMarkup(o.tableStart+a[e],r.header_cell,l[e].attrs);n(i)}return!0}:function(t,n){if(!(0,c.Lw)(t.selection))return!1;if(n){let r=(0,s.F)(t.schema),o=u(t.selection),i=t.tr,a=w("row",o,r),l=w("column",o,r),c="c
1olumn"===e?a:"row"===e&&l,p=c?1:0,m="column"==e?new d.U(0,p,1,o.map.height):"row"==e?new d.U(p,0,o.map.width,1):o,h="column"==e?l?r.cell:r.header_cell:"row"==e?a?r.cell:r.header_cell:r.cell;o.map.cellsInRect(m).forEach(e=>{let t=e+o.tableStart,n=i.doc.nodeAt(t);n&&i.setNodeMarkup(t,h,n.attrs)}),n(i)}return!0}}let j=k("row",{useDeprecatedLogic:!0}),S=k("column",{useDeprecatedLogic:!0}),A=k("cell",{useDeprecatedLogic:!0});function I(e){return function(t,n){if(!(0,c.Lw)(t.selection))return!1;let r=function(e,t){if(t<0){let t=e.nodeBefore;if(t)return e.pos-t.nodeSize;for(let t=e.index(-1)-1,n=e.before();t>=0;t--){let r=e.node(-1).child(t);if(r.childCount)return n-1-r.lastChild.nodeSize;n-=r.nodeSize}}else{if(e.index()<e.parent.childCount-1)return e.pos+e.nodeAfter.nodeSize;let t=e.node(-1);for(let n=e.indexAfter(-1),r=e.after();n<t.childCount;n++){let e=t.child(n);if(e.childCount)return r+1;r+=e.nodeSize}}}((0,c.Le)(t.selection),e);if(null==r)return!1;if(n){let e=t.doc.resolve(r);n(t.tr.setSelection(o.Bs.between(e,(0,c.SZ)(e))).scrollIntoView())}return!0}}function E(e,t,n){let r=e.$anchor;for(let e=r.depth;e>0;e--){let o=r.node(e);if("table"==o.type.spec.tableRole){t.delete(r.before(e),r.after(e)).scrollIntoView();let o=(0,i.a)(t);return o&&t.setSelection(o),n&&n(t),!0}}return!1}let z=(e,t,n)=>e instanceof a.hA&&!!(e.isSelectingAllCells()&&e.everyCell(v))&&E(e,t,n),T=(e,t,n)=>!!(e instanceof a.hA&&e.isRowSelection())&&!!e.everyCell(v)&&x(e,t,n),N=(e,t,n)=>!!(e instanceof a.hA&&e.isColSelection())&&!!e.everyCell(v)&&m(e,t,n)},59080:function(e,t,n){"use strict";n.d(t,{Xc:function(){return o.hA},rU:function(){return a.r},Wf:function(){return U.Wf},dl:function(){return U.dl},z2:function(){return U.z2},VH:function(){return H},mh:function(){return U.mh},oU:function(){return U.oU},A_:function(){return U.A_},_W:function(){return U._W},Lh:function(){return U.Lh},Fw:function(){return U.Fw},tp:function(){return d},nA:function(){return U.nA},Lw:function(){return l.Lw},JX:function(){return U.JX},zN:function(){return U.zN},wb:function(){return U.wb},Cr:function(){return U.Cr},G3:function(){return V},II:function(){return U.II},sr:function(){return U.sr},lm:function(){return U.lm}});var r=n(27191),o=n(20297),i=n(34332),a=n(15039),l=n(15034);let s=new r.H$("fix-tables");function d(e,t){let n,r=(t,r)=>{"table"==t.type.spec.tableRole&&(n=function(e,t,n,r){let o,d;let c=a.r.get(t);if(!c.problems)return r;r||(r=e.tr);let u=[];for(let e=0;e<c.height;e++)u.push(0);for(let e=0;e<c.problems.length;e++){let o=c.problems[e];if("collision"==o.type){let e=t.nodeAt(o.pos);for(let t=0;t<e.attrs.rowspan;t++)u[o.row+t]+=o.n;r.setNodeMarkup(r.mapping.map(n+1+o.pos),void 0,(0,l.H6)(e.attrs,e.attrs.colspan-o.n,o.n))}else if("missing"==o.type)u[o.row]+=o.n;else if("overlong_rowspan"==o.type){let e=t.nodeAt(o.pos);r.setNodeMarkup(r.mapping.map(n+1+o.pos),void 0,(0,l.fi)(e.attrs,"rowspan",e.attrs.rowspan-o.n))}else if("colwidth mismatch"==o.type){let e=t.nodeAt(o.pos);r.setNodeMarkup(r.mapping.map(n+1+o.pos),void 0,(0,l.fi)(e.attrs,"colwidth",o.colwidth))}}for(let e=0;e<u.length;e++)u[e]&&(null==o&&(o=e),d=e);for(let a=0,l=n+1;a<c.height;a++){let n=t.child(a),s=l+n.nodeSize,c=u[a];if(c>0){let t="cell";n.firstChild&&(t=n.firstChild.type.spec.tableRole);let u=[];for(let n=0;n<c;n++)u.push((0,i.F)(e.schema)[t].createAndFill());let p=(0==a||o==a-1)&&d==a?l+1:s-1;r.insert(r.mapping.map(p),u)}l=s}return r.setMeta(s,{fixTables:!0})}(e,t,r,n))};return t?t.doc!=e.doc&&function e(t,n,r,o){let i=t.childCount,a=n.childCount;e:for(let l=0,s=0;l<a;l++){let a=n.child(l);for(let e=s,n=Math.min(i,l+3);e<n;e++)if(t.child(e)==a){s=e+1,r+=a.nodeSize;continue e}o(a,r),s<i&&t.child(s).sameMarkup(a)?e(t.child(s),a,r+1,o):a.nodesBetween(0,a.content.size,o,r+1),r+=a.nodeSize}}(t.doc,e.doc,0,r):e.doc.descendants(r),n}var c=n(17890),u=n(30764),p=n(26151);function m(e,t){let n=e.createAndFill(),r=new p.wx(n).replace(0,n.content.size,t);return r.doc}function h(e,t,n,r,o,i,a,s){if(0==a||a==t.height)return!1;let d=!1;for(let c=o;c<i;c++){let o=a*t.width+c,i=t.map[o];if(t.map[o-t.width]==i){d=!0;let o=n.nodeAt(i),{top:u,left:p}=t.findCell(i);e.setNodeMarkup(e.mapping.slice(s).map(i+r),void 0,(0,l.fi)(o.attrs,"rowspan",a-u)),e.insert(e.mapping.slice(s).map(t.positionAt(a,p,n)),o.type.createAndFill((0,l.fi)(o.attrs,"rowspan",u+o.attrs.rowspan-a))),c+=o.attrs.colspan-1}}return d}
1function g(e,t,n,r,o,i,a,s){if(0==a||a==t.width)return!1;let d=!1;for(let c=o;c<i;c++){let o=c*t.width+a,i=t.map[o];if(t.map[o-1]==i){d=!0;let o=n.nodeAt(i),u=t.colCount(i),p=e.mapping.slice(s).map(i+r);e.setNodeMarkup(p,void 0,(0,l.H6)(o.attrs,a-u,o.attrs.colspan-(a-u))),e.insert(p+o.nodeSize,o.type.createAndFill((0,l.H6)(o.attrs,0,a-u))),c+=o.attrs.rowspan-1}}return d}function f(e,t,n,r,l){let s=n?e.doc.nodeAt(n-1):e.doc,d=a.r.get(s),{top:c,left:p}=r,m=p+l.width,f=c+l.height,x=e.tr,v=0;function b(){s=n?x.doc.nodeAt(n-1):x.doc,d=a.r.get(s),v=x.mapping.maps.length}(function(e,t,n,r,o,a,l){let s,d;let c=e.doc.type.schema,p=(0,i.F)(c);if(o>t.width)for(let i=0,a=0;i<t.height;i++){let c=n.child(i);a+=c.nodeSize;let u=[],m=null==c.lastChild||c.lastChild.type==p.cell?s||(s=p.cell.createAndFill()):d||(d=p.header_cell.createAndFill());for(let e=t.width;e<o;e++)u.push(m);e.insert(e.mapping.slice(l).map(a-1+r),u)}if(a>t.height){let i=[];for(let e=0,r=(t.height-1)*t.width;e<Math.max(t.width,o);e++){let o=!(e>=t.width)&&n.nodeAt(t.map[r+e]).type==p.header_cell;i.push(o?d||(d=p.header_cell.createAndFill()):s||(s=p.cell.createAndFill()))}let c=p.row.create(null,u.HY.from(i)),m=[];for(let e=t.height;e<a;e++)m.push(c);e.insert(e.mapping.slice(l).map(r+n.nodeSize-2),m)}return!!(s||d)})(x,d,s,n,m,f,0)&&b(),h(x,d,s,n,p,m,c,v)&&b(),h(x,d,s,n,p,m,f,v)&&b(),g(x,d,s,n,c,f,p,v)&&b(),g(x,d,s,n,c,f,m,v)&&b();for(let e=c;e<f;e++){let t=d.positionAt(e,p,s),r=d.positionAt(e,m,s);x.replace(x.mapping.slice(v).map(t+n),x.mapping.slice(v).map(r+n),new u.p2(l.rows[e-c],0,0))}b(),x.setSelection(new o.hA(x.doc.resolve(n+d.positionAt(c,p,s)),x.doc.resolve(n+d.positionAt(f-1,m-1,s)))),t(x)}let x=(0,c.$)({ArrowLeft:b("horiz",-1),ArrowRight:b("horiz",1),ArrowUp:b("vert",-1),ArrowDown:b("vert",1),"Shift-ArrowLeft":y("horiz",-1),"Shift-ArrowRight":y("horiz",1),"Shift-ArrowUp":y("vert",-1),"Shift-ArrowDown":y("vert",1),Backspace:C,"Mod-Backspace":C,Delete:C,"Mod-Delete":C});function v(e,t,n){return!n.eq(e.selection)&&(t&&t(e.tr.setSelection(n).scrollIntoView()),!0)}function b(e,t){return(n,i,a)=>{let s=n.selection;if(s instanceof o.hA)return v(n,i,r.Y1.near(s.$headCell,t));if("horiz"!=e&&!s.empty)return!1;let d=j(a,e,t);if(null==d)return!1;if("horiz"==e)return v(n,i,r.Y1.near(n.doc.resolve(s.head+t),t));{let o=n.doc.resolve(d),a=(0,l.li)(o,e,t),s;return s=a?r.Y1.near(a,1):t<0?r.Y1.near(n.doc.resolve(o.before(-1)),-1):r.Y1.near(n.doc.resolve(o.after(-1)),1),v(n,i,s)}}}function y(e,t){return(n,r,i)=>{let a=n.selection;if(!(a instanceof o.hA)){let r=j(i,e,t);if(null==r)return!1;a=new o.hA(n.doc.resolve(r))}let s=(0,l.li)(a.$headCell,e,t);return!!s&&v(n,r,new o.hA(a.$anchorCell,s))}}function C(e,t){let n=e.selection;if(!(n instanceof o.hA))return!1;if(t){let r=e.tr,o=(0,i.F)(e.schema).cell.createAndFill().content;n.forEachCell((e,t)=>{e.content.eq(o)||r.replace(r.mapping.map(t+1),r.mapping.map(t+e.nodeSize-1),new u.p2(o,0,0))}),r.docChanged&&t(r)}return!0}function w(e,t,n){if(!(0,l.Lw)(e.state.selection))return!1;let r=function(e){if(!e.size)return null;let{content:t,openStart:n,openEnd:r}=e;for(;1==t.childCount&&(n>0&&r>0||"table"==t.firstChild.type.spec.tableRole);)n--,r--,t=t.firstChild.content;let o=t.firstChild,a=o.type.spec.tableRole,l=o.type.schema,s=[];if("row"==a)for(let e=0;e<t.childCount;e++){let o=t.child(e).content,a=e?0:Math.max(0,n-1),d=e<t.childCount-1?0:Math.max(0,r-1);(a||d)&&(o=m((0,i.F)(l).row,new u.p2(o,a,d)).content),s.push(o)}else{if("cell"!=a&&"header_cell"!=a)return null;s.push(n||r?m((0,i.F)(l).row,new u.p2(t,n,r)).content:t)}return function(e,t){let n=[];for(let e=0;e<t.length;e++){let r=t[e];for(let t=r.childCount-1;t>=0;t--){let{rowspan:o,colspan:i}=r.child(t).attrs;for(let t=e;t<e+o;t++)n[t]=(n[t]||0)+i}}let r=0;for(let e=0;e<n.length;e++)r=Math.max(r,n[e]);for(let o=0;o<n.length;o++)if(o>=t.length&&t.push(u.HY.empty),n[o]<r){let a=(0,i.F)(e).cell.createAndFill(),l=[];for(let e=n[o];e<r;e++)l.push(a);t[o]=t[o].append(u.HY.from(l))}return{height:t.length,width:r,rows:t}}(l,s)}(n),s=e.state.selection;if(s instanceof o.hA){r||(r={width:1,height:1,rows:[u.HY.from(m((0,i.F)(e.state.schema).cell,n))]});let t=s.$anchorCell.node(-1),o=s.$anchorCell.start(-1),d=a.r.get(t).rectBetween(s.$anchorCell.pos-o,s.$headCell.pos-o);return r=function(e,t,n){let{width:r,height:o,rows:i}=e;if(r!=t){let e=[],n=[];for(let r=0;r<i.length;r++){let o=i[r],a=[];for(let n=e[r]||0,i=0;n<t;i++){let s=o.child(i%o.childCount);n+s.attrs.colspan>t&&(s=s.type.create((0,l.H6)(s.attrs,s.attrs.colspan,n+s.attrs.colspan-t),s.c
1ontent)),a.push(s),n+=s.attrs.colspan;for(let t=1;t<s.attrs.rowspan;t++)e[r+t]=(e[r+t]||0)+s.attrs.colspan}n.push(u.HY.from(a))}i=n,r=t}if(o!=n){let e=[];for(let t=0,r=0;t<n;t++,r++){let a=[],s=i[r%o];for(let e=0;e<s.childCount;e++){let r=s.child(e);t+r.attrs.rowspan>n&&(r=r.type.create((0,l.fi)(r.attrs,"rowspan",Math.max(1,n-r.attrs.rowspan)),r.content)),a.push(r)}e.push(u.HY.from(a))}i=e,o=n}return{width:r,height:o,rows:i}}(r,d.right-d.left,d.bottom-d.top),f(e.state,e.dispatch,o,d,r),!0}if(!r)return!1;{let t=(0,l.Le)(e.state.selection),n=t.start(-1);return f(e.state,e.dispatch,n,a.r.get(t.node(-1)).findCell(t.pos-n),r),!0}}function k(e,t){var n;let r;if(t.ctrlKey||t.metaKey)return!1;let i=S(e,t.target);if(t.shiftKey&&e.state.selection instanceof o.hA)a(e.state.selection.$anchorCell,t),t.preventDefault();else if(t.shiftKey&&i&&null!=(r=(0,l.m9)(e.state.selection.$anchor))&&(null===(n=A(e,t))||void 0===n?void 0:n.pos)!=r.pos)a(r,t),t.preventDefault();else if(!i)return!1;function a(t,n){let r=A(e,n),i=null==l.Kv.getState(e.state);if(!r||!(0,l.yL)(t,r)){if(!i)return!1;r=t}let a=new o.hA(t,r);if(i||!e.state.selection.eq(a)){let n=e.state.tr.setSelection(a);i&&n.setMeta(l.Kv,t.pos),e.dispatch(n)}}function s(){e.root.removeEventListener("mouseup",s),e.root.removeEventListener("dragstart",s),e.root.removeEventListener("mousemove",d),null!=l.Kv.getState(e.state)&&e.dispatch(e.state.tr.setMeta(l.Kv,-1))}function d(n){let r=l.Kv.getState(e.state),o;if(null!=r)o=e.state.doc.resolve(r);else if(S(e,n.target)!=i&&!(o=A(e,t)))return s();o&&a(o,n)}return e.root.addEventListener("mouseup",s),e.root.addEventListener("dragstart",s),e.root.addEventListener("mousemove",d),!1}function j(e,t,n){if(!(e.state.selection instanceof r.Bs))return null;let{$head:o}=e.state.selection;for(let r=o.depth-1;r>=0;r--){let i=o.node(r),a=n<0?o.index(r):o.indexAfter(r);if(a!=(n<0?0:i.childCount))break;if("cell"==i.type.spec.tableRole||"header_cell"==i.type.spec.tableRole){let i=o.before(r),a="vert"==t?n>0?"down":"up":n>0?"right":"left";return e.endOfTextblock(a)?i:null}}return null}function S(e,t){for(;t&&t!=e.dom;t=t.parentNode)if("TD"==t.nodeName||"TH"==t.nodeName)return t}function A(e,t){let n=e.posAtCoords({left:t.clientX,top:t.clientY});return n&&n?(0,l.m9)(e.state.doc.resolve(n.pos)):null}var I=n(68015),E=n.n(I),z=n(52780),T=n(86392),N=n(38564),M=n(36069),_=n(46795);let L=new r.H$("tableColumnResizing");class P{getActiveHandleAbs(e){return null===this.activeHandle?null:(0,_.XV)(e,this.activeHandle)}reset(){return this.activeHandle=null,this.dragging=null,this}setHandle(e,t){if(null===t.setHandle)return this.activeHandle=null,this;let n=N.Gt.getState(e);if(!n)return this;let{type:r,binding:o}=n;return this.activeHandle=(0,M.JR)(t.setHandle,r,o.mapping),this}setDragging(e){return this.dragging=e.setDragging,this}apply(e,t){let n=e.getMeta(L);return n&&"setHandle"in n?this.setHandle(t,n):n&&"setDragging"in n?this.setDragging(n):n&&"reset"in n?this.reset():this}constructor(e=null,t=null){this.activeHandle=e,this.dragging=t}}var R=n(99137);function H(){let{handleWidth:e=5,colMinPercent:t=10,lastColumnResizable:n=!0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=new r.Sy({key:L,state:{init:()=>new P,apply:(e,t,n,r)=>t.apply(e,r)},props:{attributes(e){let t=L.getState(e),n=t.getActiveHandleAbs(e);return null!==n?{class:"resize-cursor"}:{class:""}},handleDOMEvents:{mousemove:(t,r)=>((function(e,t,n,r){if(!e.editable)return;let o=L.getState(e.state);if(o.dragging)return;let i=function(e){for(;e&&"TD"!=e.nodeName&&"TH"!=e.nodeName;)e=e.classList.contains("ProseMirror")?null:e.parentNode;return e}(t.target),a=null;if(i){let{left:r,right:o}=i.getBoundingClientRect();t.clientX-r<=n?a=D(e,t,"left"):o-t.clientX<=n&&(a=D(e,t,"right"))}let l=o.getActiveHandleAbs(e.state);if(a!==l){if(!r&&null!==a){let t=e.state.doc.resolve(a);if(F(t))return}O(e,a)}})(t,r,e,n),!1),mouseleave:e=>((function(e){let t=L.getState(e.state),n=t.getActiveHandleAbs(e.state);null===n||t.dragging||O(e,null)})(e),!1),mousedown:(e,n)=>((function(e,t,n){if(!e.editable)return;
1let o=L.getState(e.state),i=o.getActiveHandleAbs(e.state);if(null===i||o.dragging)return 0;let a=e.state.doc.resolve(i),l=a.node(-1),s=a.start(-1),d=[...l.attrs.colWidths],c=B(a),u=function(e,t){let n=e.domAtPos(t),r=e.domAtPos(t).node;for(;"TABLE"!=r.nodeName;)r=r.parentNode;let o=n.node.childNodes[n.offset];return o.scrollWidth}(e,i),p=W(e,a),m=G(e,a),h=e.state.doc.resolve(i+2),g=e.state.selection.from>s&&e.state.selection.from<s+l.nodeSize;g||e.dispatch(e.state.tr.setSelection(r.Y1.findFrom(h,1)));let f={setDragging:{startX:t.clientX,startWidth:u,colWidths:d,tableWidth:m,colIndex:c}};e.dispatch(e.state.tr.setMeta(L,f));let x=null;function v(t){window.removeEventListener("mouseup",v),window.removeEventListener("mousemove",b);let n=L.getState(e.state);if(n.dragging){if(null===x){e.dispatch(e.state.tr.setMeta(L,{setDragging:null}));return}if(n.dragging)try{let t=n.getActiveHandleAbs(e.state);(function(e,t,n){let r=e.state.doc.resolve(t),o=r.before(-1),i=e.state.tr;e.dispatch(i.setNodeMarkup(o,void 0,{colWidths:[...n]}).setMeta("annotationEvent",{type:"update-node-attrs",pos:o}))})(e,t,x),e.dispatch(e.state.tr.setMeta(L,{setDragging:null}))}catch(t){e.dispatch(e.state.tr.setMeta(L,{reset:!0}))}x=null}}function b(t){if(!t.which)return v(t);let r=L.getState(e.state),o=r.getActiveHandleAbs(e.state);if(!r.dragging||null===o)return;let{colIndex:i,colWidths:a}=r.dragging,l=function(e,t){let{tableWidth:n}=e,r=t.clientX-e.startX;return E()(100*r/n,2)}(r.dragging,t);(function(e,t,n){let r=e.state.doc.resolve(t),o=W(e,r),i=o.querySelectorAll("colgroup > col.col-width-control");n.forEach((e,t)=>{i.item(t).style.width="".concat(e,"%")})})(e,o,x=(0,R.GI)(a,i,l,n)),(0,T.CI)(p)}window.addEventListener("mouseup",v),window.addEventListener("mousemove",b),t.preventDefault()})(e,n,t),!1)},decorations(e){let t=L.getState(e),n=t.getActiveHandleAbs(e);if(null!==n)return function(e,t){let n=[];try{let r=e.doc.resolve(t),o=r.node(-1),i=a.r.get(o),l=r.start(-1),s=i.colCount(r.pos-l)+r.nodeAfter.attrs.colspan;for(let e=0;e<i.height;e++){let t=s+e*i.width-1;if((s==i.width||i.map[t]!=i.map[t+1])&&(0==e||i.map[t-1]!=i.map[t-1-i.width])){let e=i.map[t],r=l+e+o.nodeAt(e).nodeSize-1,a=document.createElement("div");a.className="column-resize-handle",n.push(z.p.widget(r,a))}}return z.EH.create(e.doc,n)}catch(e){return console.error("(caught) columnResizing error: ".concat(e.message)),z.EH.empty}}(e,n)},nodeViews:{}}});return o}function D(e,t,n){let r=e.posAtCoords({left:t.clientX,top:t.clientY});if(!r)return null;let{inside:o}=r,i=(0,l.m9)(e.state.doc.resolve(o+1));if(!i)return null;if("right"===n)return i.pos;let s=a.r.get(i.node(-1)),d=i.start(-1),c=s.map.indexOf(i.pos-d);return c%s.width==0?null:d+s.map[c-1]}function O(e,t){e.dispatch(e.state.tr.setMeta(L,{setHandle:t}))}let B=e=>{let t=e.node(-1),n=a.r.get(t),r=e.start(-1);return n.colCount(e.pos-r)},F=e=>{let t=e.node(-1),n=a.r.get(t),r=B(e);return r===n.width-1},W=(e,t)=>{let n=e.domAtPos(t.start(-1)).node;for(;"TABLE"!=n.nodeName;)n=n.parentNode;return n},G=(e,t)=>W(e,t).scrollWidth;var U=n(15401);function V(){let{allowTableNodeSelection:e=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new r.Sy({key:l.Kv,state:{init:()=>null,apply(e,t){let n=e.getMeta(l.Kv);if(null!=n)return -1==n?null:n;if(null==t||!e.docChanged)return t;let{deleted:r,pos:o}=e.mapping.mapResult(t);return r?null:o}},props:{decorations:o.fI,handleDOMEvents:{mousedown:k},createSelectionBetween:e=>null!=l.Kv.getState(e.state)?e.state.selection:null,handleKeyDown:x,handlePaste:w},appendTransaction:(t,n,r)=>(0,o.FK)(r,d(r,n),e)})}},34332:function(e,t,n){"use strict";function r(e){let t=e.cached.tableNodeTypes;if(!t)for(let n in t=e.cached.tableNodeTypes={},e.nodes){let r=e.nodes[n],o=r.spec.tableRole;o&&(t[o]=r)}return t}n.d(t,{F:function(){return r}})},15039:function(e,t,n){"use strict";let r,o;if(n.d(t,{U:function(){return i},r:function(){return a}}),"undefined"!=typeof WeakMap){let e=new WeakMap;r=t=>e.get(t),o=(t,n)=>(e.set(t,n),n)}else{let e=[],t=0;r=t=>{for(let n=0;n<e.length;n+=2)if(e[n]==t)return e[n+1]},o=(n,r)=>(10==t&&(t=0),e[t++]=n,e[t++]=r)}class i{constructor(e,t,n,r){this.left=e,this.top=t,this.right=n,this.bottom=r}}class a{findCell(e){for(let t=0;t<this.map.length;t++){let n=this.map[t];if(n!=e)continue;let r=t%this.width,o=t/this.width|0,a=r+1,l=o+1;for(let e=1;a<this.width&&this.map[t+e]==n;e++)a++;for(let e=1;l<this.height&&this.map[t+this.width*e]==n;e++)l++;return new i(r,o,a,l)}throw RangeError("No cell with offset "+e+" found")}firstRowCells(){return this.map.slice(0,this.width)}firstColCells(){return this.map.filter((e,t)=>
1t%this.width==0)}colCount(e){for(let t=0;t<this.map.length;t++)if(this.map[t]==e)return t%this.width;throw RangeError("No cell with offset "+e+" found")}nextCell(e,t,n){let{left:r,right:o,top:i,bottom:a}=this.findCell(e);return"horiz"==t?(n<0?0==r:o==this.width)?null:this.map[i*this.width+(n<0?r-1:o)]:(n<0?0==i:a==this.height)?null:this.map[r+this.width*(n<0?i-1:a)]}rectBetween(e,t){let{left:n,right:r,top:o,bottom:a}=this.findCell(e),{left:l,right:s,top:d,bottom:c}=this.findCell(t);return new i(Math.min(n,l),Math.min(o,d),Math.max(r,s),Math.max(a,c))}cellsInRect(e){let t=[],n={};for(let r=e.top;r<e.bottom;r++)for(let o=e.left;o<e.right;o++){let i=r*this.width+o,a=this.map[i];n[a]||(n[a]=!0,o==e.left&&o&&this.map[i-1]==a||r==e.top&&r&&this.map[i-this.width]==a||t.push(a))}return t}positionAt(e,t,n){for(let r=0,o=0;;r++){let i=o+n.child(r).nodeSize;if(r==e){let n=t+e*this.width,r=(e+1)*this.width;for(;n<r&&this.map[n]<o;)n++;return n==r?i-1:this.map[n]}o=i}}static get(e){return r(e)||o(e,function(e){if("table"!=e.type.spec.tableRole)throw RangeError("Not a table node: "+e.type.name);let t=function(e){let t=-1,n=!1;for(let r=0;r<e.childCount;r++){let o=e.child(r),i=0;if(n)for(let t=0;t<r;t++){let n=e.child(t);for(let e=0;e<n.childCount;e++){let o=n.child(e);t+o.attrs.rowspan>r&&(i+=o.attrs.colspan)}}for(let e=0;e<o.childCount;e++){let t=o.child(e);i+=t.attrs.colspan,t.attrs.rowspan>1&&(n=!0)}-1==t?t=i:t!=i&&(t=Math.max(t,i))}return t}(e),n=e.childCount,r=[],o=0,i=null,l=[];for(let e=0,o=t*n;e<o;e++)r[e]=0;for(let a=0,s=0;a<n;a++){let d=e.child(a);s++;for(let e=0;;e++){for(;o<r.length&&0!=r[o];)o++;if(e==d.childCount)break;let c=d.child(e),{colspan:u,rowspan:p,colwidth:m}=c.attrs;for(let e=0;e<p;e++){if(e+a>=n){(i||(i=[])).push({type:"overlong_rowspan",pos:s,n:p-e});break}let d=o+e*t;for(let e=0;e<u;e++){0==r[d+e]?r[d+e]=s:(i||(i=[])).push({type:"collision",row:a,pos:s,n:u-e});let n=m&&m[e];if(n){let r=(d+e)%t*2,o=l[r];null==o||o!=n&&1==l[r+1]?(l[r]=n,l[r+1]=1):o==n&&l[r+1]++}}}o+=u,s+=c.nodeSize}let c=(a+1)*t,u=0;for(;o<c;)0==r[o++]&&u++;u&&(i||(i=[])).push({type:"missing",row:a,n:u}),s++}let s=new a(t,n,r,i),d=!1;for(let e=0;!d&&e<l.length;e+=2)null!=l[e]&&l[e+1]<n&&(d=!0);return d&&function(e,t,n){e.problems||(e.problems=[]);for(let r=0,o={};r<e.map.length;r++){let i=e.map[r];if(o[i])continue;o[i]=!0;let a=n.nodeAt(i),l=null;for(let n=0;n<a.attrs.colspan;n++){let o=(r+n)%e.width,i=t[2*o];null==i||a.attrs.colwidth&&a.attrs.colwidth[n]==i||((l||(l=function(e){if(e.colwidth)return e.colwidth.slice();let t=[];for(let n=0;n<e.colspan;n++)t.push(0);return t}(a.attrs)))[n]=i)}l&&e.problems.unshift({type:"colwidth mismatch",pos:i,colwidth:l})}}(s,l,e),s}(e))}constructor(e,t,n,r){this.width=e,this.height=t,this.map=n,this.problems=r}}},15034:function(e,t,n){"use strict";n.d(t,{Dq:function(){return d},Fn:function(){return p},H6:function(){return x},Kv:function(){return l},Le:function(){return u},Lw:function(){return c},SZ:function(){return m},a2:function(){return b},fi:function(){return f},hl:function(){return v},li:function(){return g},m9:function(){return s},yL:function(){return h}});var r=n(27191),o=n(20297),i=n(34332),a=n(15039);let l=new r.H$("selectingCells");function s(e){for(let t=e.depth-1;t>0;t--)if("row"==e.node(t).type.spec.tableRole)return e.node(0).resolve(e.before(t+1));return null}function d(e){for(let t=e.depth;t>0;t--){let n=e.node(t).type.spec.tableRole;if("cell"===n||"header_cell"===n)return e.node(t)}return null}function c(e){let t=e.$head;for(let e=t.depth;e>0;e--)if("row"==t.node(e).type.spec.tableRole)return!0;return!1}function u(e){return e instanceof o.hA?e.$anchorCell.pos>e.$headCell.pos?e.$anchorCell:e.$headCell:e instanceof r.qv&&"cell"==e.node.type.spec.tableRole?e.$anchor:s(e.$head)||function(e){for(let t=e.nodeAfter,n=e.pos;t;t=t.firstChild,n++){let r=t.type.spec.tableRole;if("cell"==r||"header_cell"==r)return e.doc.resolve(n)}for(let t=e.nodeBefore,n=e.pos;t;t=t.lastChild,n--){let r=t.type.spec.tableRole;if("cell"==r||"header_cell"==r)return e.doc.resolve(n-t.nodeSize)}}(e.$head)}function p(e){return"row"==e.parent.type.spec.tableRole&&e.nodeAfter}
1function m(e){return e.node(0).resolve(e.pos+e.nodeAfter.nodeSize)}function h(e,t){return e.depth==t.depth&&e.pos>=t.start(-1)&&e.pos<=t.end(-1)}function g(e,t,n){let r=e.start(-1),o=a.r.get(e.node(-1)),i=o.nextCell(e.pos-r,t,n);return null==i?null:e.node(0).resolve(r+i)}function f(e,t,n){let r={};for(let t in e)r[t]=e[t];return r[t]=n,r}function x(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=f(e,"colspan",e.colspan-n);return r.colwidth&&(r.colwidth=r.colwidth.slice(),r.colwidth.splice(t,n),r.colwidth.some(e=>e>0)||(r.colwidth=null)),r}function v(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=f(e,"colspan",e.colspan+n);if(r.colwidth){r.colwidth=r.colwidth.slice();for(let e=0;e<n;e++)r.colwidth.splice(t,0,0)}return r}function b(e,t,n){let r=(0,i.F)(t.type.schema).header_cell;for(let o=0;o<e.height;o++)if(t.nodeAt(e.map[n+o*e.width]).type!=r)return!1;return!0}},59322:function(e,t,n){"use strict";n.d(t,{BF:function(){return o},CU:function(){return r}});let r=e=>"table"===e.type.name,o=e=>"tableCell"===e.type.name},86353:function(e,t,n){"use strict";n.d(t,{E7:function(){return a},I1:function(){return i},I_:function(){return l}});var r=n(42111);n(52332);let o=(e,t)=>{let n=e.filter(e=>Object.keys(e.spec).length>0),r=t.filter(e=>Object.keys(e.spec).length>0),o=n.map(e=>JSON.stringify(e.spec)),i=r.map(e=>JSON.stringify(e.spec)),a=o.filter(e=>!i.includes(e)),l=i.filter(e=>!o.includes(e));return{removed:a,added:l}},i=(e,t)=>{let n=e.filter(e=>Object.keys(e.spec).length>0),r=t.filter(e=>Object.keys(e.spec).length>0),o=n.length!==r.length||JSON.stringify(n.map(e=>e.spec))!==JSON.stringify(r.map(e=>e.spec));return o},a=e=>{let{newNode:t,oldNode:n,updateProps:a,oldDecorations:l,newDecorations:s}=e,d=JSON.stringify(t.attrs)!==JSON.stringify(n.attrs);if(d)return a(),!0;let c=i(l,s);if(c){if(r.VH.get("debugLogging")){let e=o(l,s);console.debug("============== decos ================"),console.debug("decos changed",t.type.name),e.removed.length>0&&console.debug("%c decos removed: ".concat(e.removed.join(" ")," "),"color: red"),e.added.length>0&&console.debug("%c decos added: ".concat(e.added.join(" ")," "),"color: green")}a()}return!0},l=e=>{let{newNode:t,oldNode:n,updateProps:r}=e,o=t.content.childCount!==n.content.childCount;return o?(r(),!0):a(e)}},4878:function(e,t,n){"use strict";n.d(t,{dh:function(){return N},Br:function(){return E},GX:function(){return S},LM:function(){return I},F1:function(){return A},vE:function(){return _},f3:function(){return z},Yk:function(){return T},p2:function(){return M},TZ:function(){return j}});var r=n(9850),o=n.n(r),i=n(3027),a=n(27191),l=n(2784);n(17292);var s=n(34972);let d={desktop:"xl",tablet:"md",mobile:"sm"};var c=n(84698),u=n(91994),p=n(36651),m=n(96933),h=n(90221),g=n(60742),f=n(93814),x=n(33169),v=n(96255),b=n(3402),y=n(61840),C=n(47968),w=n(11093),k=n(23147);function j(){let{inPreviewContext:e}=(0,s.My)(),t=(0,u.CG)(c.ws);return e?t:(0,h.s2)()}function S(e){let{inPreviewContext:t}=(0,s.My)(),n=(0,u.CG)(c.tv),r=(0,m.i)(e,t&&n?d[n]:void 0);return r}let A=e=>{let[t,n]=(0,l.useState)(0);return(0,l.useEffect)(()=>{let t=()=>{n(t=>!e.state.selection.empty||e.isActive("link")||e.isActive("button")?t+1:0)};return e.on("update",t),e.on("selectionUpdate",t),()=>{e.off("update",t),e.off("selectionUpdate",t)}},[e]),t},I=e=>{let[t,n]=(0,l.useState)(!!e&&(0,w.KB)(e));return(0,l.useEffect)(()=>{if(!e)return;let t=t=>{requestAnimationFrame(()=>{n((0,w.KB)(e))})};return e.on("blur",t).on("focus",t),()=>{e.off("blur",t).off("focus",t)}},[e]),t},E=e=>{let t=(0,p.we)();return(0,u.CG)(n=>{let r=(0,C.yx)(n);return!!r&&t.can(e,r)})},z=(e,t)=>{let n=(0,y.A)(e);(0,l.useEffect)(()=>{if(!e||!t)return;let r=e=>{e.defaultPrevented||n(e)};return window.addEventListener("keydown",r),()=>window.removeEventListener("keydown",r)},[e,n,t])},T=e=>{(0,l.useEffect)(()=>{if(!e)return;let t=t=>{t.defaultPrevented||!e.isEditable||!e.isFocused||!(e.state.selection instanceof a.qv)||!t.target||e.view.dom.contains(t.target)||e.view.dispatchEvent(t)};return document.addEventListener("copy",t),document.addEventListener("cut",t),document.addEventListener("paste",t),()=>{document.removeEventListener("copy",t),document.removeEventListener("cut",t),document.removeEventListener("paste",t)}},[e])}
1,N="tiptap-ignore-paste",M=e=>{(0,l.useEffect)(()=>{if(!e)return;let t=t=>{var n,r,i,a;let l=!!(null===(n=document.activeElement)||void 0===n?void 0:n.closest("[data-".concat(N,"]")));if(t.defaultPrevented||e.isFocused||!e.isEditable||!t.target||l||e.view.dom.contains(t.target))return;let s=null===(r=t.clipboardData)||void 0===r?void 0:r.getData("text/html");if(!s)return;let{content:d}=(0,b.T)(s,e.schema),c=(null===(i=d.firstChild)||void 0===i?void 0:i.type.name)==="document",u=c?null===(a=d.firstChild)||void 0===a?void 0:a.content.content:d.content,p=(u||[]).filter(e=>(0,v.KH)(e));if(p.length){let n=e.state.doc.content.size-1,r=p.map(e=>(0,k.hs)(o()(e.toJSON()))),i=r.map(e=>(0,x.Zs)(e));e.chain().insertContentAt(n,i).selectInsertedNode().scrollIntoView().setMeta("uiEvent","paste").run(),t.preventDefault()}};return document.addEventListener("paste",t),()=>{document.removeEventListener("paste",t)}},[e])},_=e=>{(0,l.useEffect)(()=>{if(!e)return;let t=t=>{let n=t.target;if(!n.closest(".".concat(f.ar))||n.closest(".drag-handle"))return;let r=e.view.posAtDOM(t.target,0);if(e.state.selection.from===r)return;let o=e.view.posAtCoords({left:t.clientX,top:t.clientY});if(!o)return;let a=e.state.doc.nodeAt(o.inside);if(!a||!a.type.spec.isolating||!1===a.type.spec.allowGapCursor)return;let{node:l,offset:s}=e.view.domAtPos(o.inside),d=l.childNodes[s];if(!d||!d.classList.contains("react-renderer"))return;let c=(0,g.tl)(t.target,d,e=>e.hasAttribute("data-node-view-content-inner"));if(!c)try{let n=e.state.doc.resolve(o.pos);if(!i.Q.valid(n))return!1;let r=new i.Q(n);e.view.dispatch(e.state.tr.setSelection(r)),t.stopPropagation(),t.preventDefault()}catch(e){console.error("[useFixReactNodeViewGapCursors] Error creating GapCursor",e)}};return e.view.dom.addEventListener("click",t),()=>e.view.dom.removeEventListener("click",t)},[e])}},17132:function(e,t,n){"use strict";n.d(t,{a:function(){return a}}),n(2784);var r=n(13265),o=n(31638),i=n(87428);let a=e=>{let{editorId:t,children:n}=e,a=(0,r.g)(),l=(0,o.H)(),s=(0,i.K)(t||l)&&a;return s?n:null}},31638:function(e,t,n){"use strict";n.d(t,{H:function(){return a},O:function(){return i}});var r=n(2784);let o=(0,r.createContext)(void 0),i=o.Provider,a=()=>(0,r.useContext)(o)},87428:function(e,t,n){"use strict";n.d(t,{K:function(){return d},O:function(){return s}});var r=n(30733),o=n.n(r),i=n(2784);class a{subscribe(e,t){return this.listeners[e]=this.listeners[e]||[],this.listeners[e].push(t),()=>{try{if(!this.listeners[e])return;let n=this.listeners[e].indexOf(t);n>-1&&this.listeners[e].splice(n,1)}catch(e){}}}isRendered(e){return this.renderedMap[e]}onRendered(e){var t;this.renderedMap[e]=!0,null===(t=this.listeners[e])||void 0===t||t.forEach(e=>e())}onEditorUnload(e){this.renderedMap[e]=!1,this.listeners[e]=[]}constructor(){this.renderedMap={main:!1},this.listeners={}}}let l=o()(()=>new a),s=e=>{let t=(0,i.useCallback)(()=>{e&&l().onRendered(e)},[e]),n=(0,i.useCallback)(()=>{e&&l().onEditorUnload(e)},[e]);return{setEditorRendered:t,onEditorUnload:n}},d=e=>{var t;let[n,r]=(0,i.useState)(void 0===e||null===(t=l().isRendered(e))||void 0===t||t);return(0,i.useEffect)(()=>{if(e)return l().subscribe(e,()=>{r(!0)})},[e]),n}},55850:function(e,t,n){"use strict";n.d(t,{I:function(){return u},q:function(){return c}});var r=n(72338),o=n(30764),i=n(27191),a=n(19283),l=n(26151),s=n(52336),d=n(52808);let c=new i.H$("UniqueAttribute"),u=r.hj.create({name:"UniqueAttribute",priority:a.a.UniqueAttribute,addOptions(){return{attributeName:"",pluginKey:new i.H$(this.name),types:[],initialValue:()=>void 0,filterTransaction:null}},addGlobalAttributes(){return[{types:this.options.types,attributes:{[this.options.attributeName]:{default:null,parseHTML:e=>this.options.parseHTML?this.options.parseHTML(e):e.getAttribute("data-".concat(this.options.attributeName)),renderHTML:e=>this.options.renderHTML?this.options.renderHTML(e):e[this.options.attributeName]?{["data-".concat(this.options.attributeName)]:e[this.options.attributeName]}:{}}}}]},onCreate(){let{view:e,state:t}=this.editor,{tr:n,doc:o}=t,{types:i,attributeName:a,initialValue:l,callback:s}=this.options,d=(0,r.N2)(o,e=>
1i.includes(e.type.name)&&null===e.attrs[a]),c=d.map(e=>{let{node:t,pos:r}=e,o=l();return n.setNodeMarkup(r,void 0,{...t.attrs,[a]:o}),{node:t,val:o,pos:r}});0!==c.length&&(e.dispatch(n),s&&s(this.editor,c,n.doc))},addProseMirrorPlugins(){let e=!1;return[new i.Sy({key:this.options.pluginKey,appendTransaction:(e,t,n)=>{let o=e.some(e=>e.docChanged)&&!t.doc.eq(n.doc),i=this.options.filterTransaction&&e.some(e=>{var t,n;return!(null===(t=(n=this.options).filterTransaction)||void 0===t?void 0:t.call(n,e))});if(!o||i)return;let{tr:a}=n,{types:u,attributeName:p,initialValue:m,callback:h}=this.options,g=function(e,t){let n=new l.wx(e);return t.forEach(e=>{e.steps.forEach(e=>{n.step(e)})}),n}(t.doc,e),{mapping:f}=g,x=(0,d.Z)(g),v=[],b=e.some(e=>!0===e.getMeta(c));if(x.forEach(e=>{let t={from:e.newStart,to:e.newEnd},o=(0,r.b5)(n.doc,t,e=>u.includes(e.type.name)),i=o.map(e=>{let{node:t}=e;return t.attrs[p]}).filter(e=>null!==e),l=function(e){let t=e.filter((t,n)=>e.indexOf(t)!==n),n=(0,s.Z)(t);return n}(i);o.forEach(e=>{var t;let{node:n,pos:r}=e,o=null===(t=a.doc.nodeAt(r))||void 0===t?void 0:t.attrs[p];if(!o){let e=m();a.setNodeMarkup(r,void 0,{...n.attrs,[p]:e}),v.push({node:n,val:e,pos:r});return}let{deleted:i}=f.invert().mapResult(r),s=i&&l.includes(o),d=i&&b;if(s||d){let e=m();a.setNodeMarkup(r,void 0,{...n.attrs,[p]:e}),v.push({node:n,val:e,pos:r}),console.debug("%c [UniqueAttribute][".concat(this.options.types,"] Replaced ").concat(n.attrs[p]," with new val: ").concat(e),"background-color: deeppink",{override:d,newNode:s})}})}),h&&h(this.editor,v,a.doc),a.steps.length)return a},props:{handleDOMEvents:{drop:(t,n)=>{var r,o;return((null===(r=t.dragging)||void 0===r?void 0:r.move)!==!0||(null===(o=n.dataTransfer)||void 0===o?void 0:o.effectAllowed)==="copy")&&(e=!0),!1},paste:()=>(e=!0,!1)},transformPasted:t=>{var n;if(!e)return t;let{types:r,attributeName:i}=this.options,a=e=>{let t=[];return e.forEach(e=>{if(e.isText){t.push(e);return}if(!r.includes(e.type.name)){t.push(e.copy(a(e.content)));return}let n=e.type.create({...e.attrs,[i]:null},a(e.content),e.marks);t.push(n)}),o.HY.from(t)},l=this.options.transformPasted?this.options.transformPasted(t,this.options,null===this||void 0===this?void 0:null===(n=this.editor)||void 0===n?void 0:n.gammaDocId):new o.p2(a(t.content),t.openStart,t.openEnd);return e=!1,l}}})]}})},4889:function(e,t,n){"use strict";n.d(t,{b:function(){return r}});let r=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"id";return{default:null,parseHTML:n=>{let r=n.getAttribute("data-".concat(t));if(r)return r;let o=e();return console.debug("[configureIdAttribute] generating id in parseHTML",o),o}}}},52808:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});var r=n(52336);function o(e){let{mapping:t,steps:n}=e,o=[];return t.maps.forEach((e,r)=>{if(e.ranges.length)e.forEach((e,n)=>{let i=t.slice(r).map(e,-1),a=t.slice(r).map(n),l=t.invert().map(i,-1),s=t.invert().map(a);o.push({oldStart:l,oldEnd:s,newStart:i,newEnd:a})});else{let e=n[r];if(void 0===e.from||void 0===e.to)return;o.push({oldStart:e.from,oldEnd:e.to,newStart:e.from,newEnd:e.to})}}),function(e){let t=(0,r.Z)(e);return 1===t.length?t:t.filter((e,n)=>{let r=t.filter((e,t)=>t!==n);return!r.some(t=>e.oldStart>=t.oldStart&&e.oldEnd<=t.oldEnd&&e.newStart>=t.newStart&&e.newEnd<=t.newEnd)})}(o)}},52336:function(e,t,n){"use strict";function r(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:JSON.stringify,n={};return e.filter(e=>{let r=t(e);return!Object.prototype.hasOwnProperty.call(n,r)&&(n[r]=!0)})}n.d(t,{Z:function(){return r}})},83440:function(e,t,n){"use strict";n.d(t,{B0:function(){return a},Nv:function(){return i},Tr:function(){return l}});var r=n(72338),o=n(27191);let i=(e,t)=>(0,r.N2)(e,e=>!!t.isInSet(e.marks)),a=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return n=>{let r=o.Y1.findFrom(n.doc.resolve(e),t,!0);return r?n.setSelection(r):n}},l=e=>t=>(0,r.Kk)(t=>s(e,t))(t),s=(e,t)=>Array.isArray(e)&&e.indexOf(t.type)>-1||t.type===e},75420:function(e,t,n){"use strict";n.d(t,{M:function(){return o}});var r=n(72338);n(2784);class o extends r.ML{constructor(...e){super(...e),this.contentComponent=null}}},91579:function(e,t,n){"use strict";n.d(t,{k:function(){return s}});var r=n(52322),o=n(2784),i=n(28316);let a=e=>{let{renderers:t}=e;return(0,r.jsx)(r.Fragment,{children:Object.entries(t).map(e=>{let[t,n]=e;return i.createPortal(n.reactElement,n.element,t)})})};class l extends o.Component{componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){let{editor:e}=this.props;if(e&&e.options.element){if(e.contentComponent)return;let t=this.editorContentRef.current;t.append(...e.options.element.childNodes),e.setOptions({element:t}),e.contentComponent=this,e.createNodeViews(),this.initialized=!0}}maybeFlushSync(e){this.initialized?(0,i.flushSync)(e):e()}setRenderer(e,t){this.maybeFlushSync(()=>{this.setState(n=>{let{renderers:r}=n;return{renderers:{...r,[e]:t}}})})}removeRenderer(e){this.maybeFlushSync(()=>{this.setState(t=>{let{renderers:n}=t,r={...n};return delete r[e],{renderers:r}})})}componentWillUnmount(){let{editor:e}=this.props;if(!e||(this.initialized=!1,e.isDestroyed||e.view.setProps({nodeViews:{}}),e.contentComponent=null,!e.options.element.firstChild))return;let t=document.createElement("div");t.append(...e.options.element.childNodes),e.setOptions({element:t})}render(){let{editor:e,...t}=this.props;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{ref:this.editorContentRef,...t}),(0,r.jsx)(this.portalComponent,{renderers:this.state.renderers})]})}constructor(e){super(e),this.editorContentRef=o.createRef(),this.initialized=!1,this.portalComponent=e.portalComponent||a,this.state={renderers:{}}}}let s=o.memo(l)},73544:function(e,t,n){"use strict";n.d(t,{T:function(){return a}});var r=n(52322),o=n(2784),i=n(80301);let a=o.forwardRef((e,t)=>
1{let{onDragStart:n}=(0,i.a)(),o=e.as||"div";return(0,r.jsx)(o,{...e,ref:t,"data-node-view-wrapper":"",onDragStart:n,style:{whiteSpace:"normal",...e.style}})})},70286:function(e,t,n){"use strict";n.d(t,{A:function(){return c},f:function(){return u}});var r=n(52322),o=n(72338),i=n(30764);n(2784);var a=n(90221),l=n(14657),s=n(59284),d=n(80301);class c extends o.DK{updateAttributes(e){this.editor.commands.command(t=>{let{tr:n}=t,r=this.getPos();if(void 0===r)return;let o={type:"move",insertPos:r,insertPosRaw:r,pos:r,end:r+this.node.content.size+1};return n.setNodeMarkup(r,void 0,{...this.node.attrs,...e}).setMeta("annotationEvent",o),!0})}mount(){var e,t=this;let n={editor:this.editor,node:this.node,decorations:this.decorations,selected:!1,extension:this.extension,getPos:()=>this.getPos(),updateAttributes:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t.updateAttributes(e)},deleteNode:()=>this.deleteNode()};this.component.displayName||(this.component.displayName=(e=this.extension.name).charAt(0).toUpperCase()+e.substring(1));let o=e=>{let t=this.component,n=this.onDragStart.bind(this);return(0,r.jsx)(d.j.Provider,{value:{onDragStart:n,nodeViewContentRef:e=>{e&&this.contentDOMElement&&e.firstChild!==this.contentDOMElement&&e.appendChild(this.contentDOMElement)},node:this.node,editor:this.editor,getPos:this.getPos},children:(0,r.jsx)(t,{...e})})};o.displayName="ReactNodeView",this.contentDOMElement=this.node.isLeaf?null:document.createElement(this.node.isInline||this.node instanceof i.vc?"span":"div"),this.contentDOMElement&&(this.contentDOMElement.style.whiteSpace="inherit",this.contentDOMElement.setAttribute("data-node-view-content-inner",this.node.type.name));let a=this.node.isInline?"span":"div";this.options.as&&(a=this.options.as);let{className:l=""}=this.options;this.renderer=new s.M(o,{editor:this.editor,props:n,as:a,className:"node-".concat(this.node.type.name," ").concat(l).trim(),updateWrapperEl:this.options.updateWrapperEl})}get dom(){var e;if(this.renderer.element.firstElementChild&&!(null===(e=this.renderer.element.firstElementChild)||void 0===e?void 0:e.hasAttribute("data-node-view-wrapper")))throw Error("Please use the NodeViewWrapper component for your node view.");return this.renderer.element}get contentDOM(){return this.node.isLeaf?null:this.contentDOMElement}update(e,t){let n=e=>{this.renderer.updateProps(e)};if(e.type!==this.node.type)return!1;if("function"==typeof this.options.update){let r=this.node,o=this.decorations;return this.node=e,this.decorations=t,this.options.update({oldNode:r,oldDecorations:o,newNode:e,newDecorations:t,updateProps:()=>n({node:e,decorations:t})})}return e===this.node&&this.decorations===t||(this.node=e,this.decorations=t,n({node:e,decorations:t}),!0)}selectNode(){this.renderer.updateProps({selected:!0})}deselectNode(){this.renderer.updateProps({selected:!1})}destroy(){this.renderer.destroy(),this.contentDOMElement=null}ignoreMutation(e){return!this.dom||!this.contentDOM||"function"==typeof this.options.ignoreMutation&&this.options.ignoreMutation({mutation:e})||this.defaultIgnoreMutation(e)}defaultIgnoreMutation(e){if(this.node.isLeaf||this.node.isAtom||"selection"===e.type&&e.target.closest("[data-comments-wrapper]"))return!0;if("selection"===e.type)return!1;if(this.dom.contains(e.target)&&"childList"===e.type&&(0,a.Tt)()&&this.editor.isFocused){let t=[...Array.from(e.addedNodes),...Array.from(e.removedNodes)];if(t.every(e=>e.isContentEditable))return!1}return this.contentDOM===e.target&&"attributes"===e.type||!this.contentDOM.contains(e.target)}onDragStart(e){var t,n,r,o,i;let a=e.target,s=a.querySelector("[data-drag-handle]");if(!s&&a.hasAttribute("data-drag-handle")&&(s=a),!this.dom||!s)return e.preventDefault(),!1;try{let e=this.editor.view.posAtDOM(s);if(!e||-1==e)return;let t=this.editor.state.doc.nodeAt(e),n=this.editor.state.selection;if(!n.empty&&e>n.from&&e<n.to&&this.editor.commands.setNodeSelection(e),!t)return;let r=(0,l.lG)({from:e,to:e+t.nodeSize,editor:this.editor,pos:e});r&&requestAnimationFrame(()=>{var e;null!==(e=this.editor.view.dragging)&&void 0!==e&&e.annotations||null==this.editor.view.dragging||"object"!=typeof this.editor.view.dragging||(this.editor.view.dragging.annotations=r)})}catch(e){console.warn("(caught) [ReactNodeViewRenderer] onDragStart error moving annotations",e)}
1let d=0,c=0;document.querySelectorAll("[data-nodeview-drag-preview]").forEach(e=>e.parentNode.removeChild(e));let u=s.cloneNode(!0);document.body.appendChild(u),u.dataset.nodeviewDragPreview=!0,u.style.maxWidth="250px",u.style.width=getComputedStyle(s).width;let p=()=>{var e;return null===(e=u.parentElement)||void 0===e?void 0:e.removeChild(u)};if(document.addEventListener("dragend",p,{once:!0}),document.addEventListener("drop",p,{once:!0}),document.addEventListener("mouseup",p,{once:!0}),this.dom!==s){let t=null!==(o=e.offsetX)&&void 0!==o?o:null===(n=e.nativeEvent)||void 0===n?void 0:n.offsetX,a=null!==(i=e.offsetY)&&void 0!==i?i:null===(r=e.nativeEvent)||void 0===r?void 0:r.offsetY;d=t,c=a}null===(t=e.dataTransfer)||void 0===t||t.setDragImage(u,d,c)}}function u(e,t){return n=>n.editor.contentComponent?new c(e,n,t):{}}},59284:function(e,t,n){"use strict";n.d(t,{M:function(){return o}});var r=n(52322);n(2784);class o{render(){var e,t,n;let o=this.component,i=this.props;("function"==typeof o&&o.prototype&&o.prototype.isReactComponent||"object"==typeof o&&(null===(n=o.$$typeof)||void 0===n?void 0:n.toString())==="Symbol(react.forward_ref)")&&(i.ref=e=>{this.ref=e}),this.reactElement=(0,r.jsx)(o,{...i}),this.updateWrapperEl&&this.updateWrapperEl(this.element,i),null===(t=this.editor)||void 0===t||null===(e=t.contentComponent)||void 0===e||e.setRenderer(this.id,this)}updateProps(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.props={...this.props,...e},this.render()}destroy(){var e,t;null===(t=this.editor)||void 0===t||null===(e=t.contentComponent)||void 0===e||e.removeRenderer(this.id)}constructor(e,{editor:t,props:n={},as:r="div",className:o="",updateWrapperEl:i}){this.ref=null,this.id=Math.floor(4294967295*Math.random()).toString(),this.component=e,this.editor=t,this.props=n,this.updateWrapperEl=i,this.element=document.createElement(r),this.element.classList.add("react-renderer"),o&&this.element.classList.add(...o.split(" ")),this.render()}}},96374:function(e,t,n){"use strict";n.d(t,{r:function(){return i}});var r=n(27191),o=n(70286);let i=(e,t)=>{let n=new r.Sy({key:new r.H$("".concat(e.name,"_markview")),props:{nodeViews:{[e.
1name]:(n,r,i,a)=>(0,o.f)(t,{as:"span"})({editor:e.editor,node:n,getPos:i,decorations:a,extension:{name:e.name,type:e.type.name,options:e.options,storage:e.storage},HTMLAttributes:{}})}}});return n}},90507:function(e,t,n){"use strict";n.d(t,{kg:function(){return r.k},ms:function(){return d},T5:function(){return u.T},Al:function(){return o.A},fW:function(){return o.f},jE:function(){return p.j}}),n(75420);var r=n(91579),o=n(70286),i=n(52322);n(2784);var a=n(50788),l=n(25198),s=n(80301);let d=e=>{let t=(0,a.C7)();return t?(0,i.jsx)(l.m,{...e}):(0,i.jsx)(c,{...e})},c=e=>{let t=e.as||"div",{nodeViewContentRef:n}=(0,s.a)();return(0,i.jsx)(t,{...e,ref:n,"data-node-view-content":"",style:{whiteSpace:"pre-wrap",...e.style}})};c.displayName="NodeViewContentCore";var u=n(73544),p=n(94465)},94465:function(e,t,n){"use strict";n.d(t,{j:function(){return i}});var r=n(2784),o=n(75420);let i=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=(0,r.useMemo)(()=>new o.M(e),[]),n=function(){let[,e]=(0,r.useState)(0);return()=>e(e=>e+1)}();return(0,r.useEffect)(()=>{let e=!0;return t.on("transaction",()=>{requestAnimationFrame(()=>{requestAnimationFrame(()=>{e&&n()})})}),()=>{t.destroy(),e=!1}},[t]),t}},80301:function(e,t,n){"use strict";n.d(t,{a:function(){return i},j:function(){return o}});var r=n(2784);let o=(0,r.createContext)({onDragStart:void 0}),i=()=>(0,r.useContext)(o)},40212:function(e,t,n){"use strict";n.d(t,{U:function(){return r}});let r={'&[contenteditable="true"]':{"&:focus-within":{".ProseMirror-gapcursor":{display:"block",height:"1.5em",position:"relative","&:after":{width:"0px",height:"100%",borderTop:"0px",borderLeft:"1px solid black"}},".grid-cell":{".ProseMirror-gapcursor:first-child":{marginTop:"1em"},".ProseMirror-gapcursor:last-child":{marginBottom:"1em"}},".block-table td":{".ProseMirror-gapcursor:first-child":{marginTop:".75em"},".ProseMirror-gapcursor:last-child":{marginBottom:".75em"}},".is-dark":{".ProseMirror-gapcursor:after":{borderLeftColor:"white"}}}},".collaboration-cursor__caret":{position:"relative",marginLeft:"-1px",marginRight:"-1px",borderLeft:"1px solid #0d0d0d",borderRight:"1px solid #0d0d0d",wordBreak:"normal",pointerEvents:"none",textIndent:0},".collaboration-cursor__label":{position:"absolute",top:"-1.4em",left:"-1px",fontSize:"12px",fontStyle:"normal",fontFamily:"'Inter', sans-serif",fontWeight:"600",lineHeight:"normal",letterSpacing:"normal",textTransform:"none",userSelect:"none",color:"#0d0d0d",padding:"0.1rem 0.3rem",borderRadius:"3px 3px 3px 0",whiteSpace:"nowrap",zIndex:1,pointerEvents:"auto",spellCheck:"false",_hover:{opacity:.1}},'&[contenteditable="false"]':{".ProseMirror-gapcursor":{display:"none"},".collaboration-cursor__caret:not(.streaming-cursor)":{display:"none"}}}},28858:function(e,t,n){"use strict";n.d(t,{I:function(){return j}});var r=n(28165),o=n(47016);let i="transparent",a=(0,r.F4)({"0%":{transform:"rotate(0deg)"},"100%":{transform:"rotate(360deg)"}}),l=(0,r.F4)({"0%":{opacity:.5,color:"var(--chakra-colors-trueblue-500)"},"100%":{opacity:1,color:"inherit"}}),s={display:"inline-block",borderColor:"currentColor",borderStyle:"solid",borderRadius:"99999px",borderWidth:"2px",borderBottomColor:i,borderLeftColor:i,animation:"".concat(a," ").concat("0.45s"," linear infinite"),width:"var(--spinner-size)",height:"var(--spinner-size)","--spinner-size":"1em",marginLeft:"0.25em",color:"var(--chakra-colors-trueblue-500)"},d={".autocomplete-loading":s,".autocomplete-inserted":{animation:"".concat(l," ").concat(o.X,"ms ease-out")}};var c=n(90221),u=n(97676);let p="%23553bff",m={backgroundRepeat:"no-repeat",backgroundSize:"11px",backgroundPosition:"8px center",fontSize:"13px",fontWeight:"bold",color:"var(--chakra-colors-trueblue-400)",position:"absolute",zIndex:1,top:"0px",left:"0px",backgroundColor:"var(--chakra-colors-trueblue-100)",padding:"4px 12px",paddingLeft:"24px",borderRadius:"0 0 4px 4px",pointerEvents:"none"},h={".block-card":{transitionProperty:"opacity",transitionDuration:"normal"},".ai-generate-streaming-card":{"&.node-card":{pointerEvents:(0,c.s2)()?void 0:"none !important"},"&.node-card > [data-node-view-wrapper] > .card-wrapper > .card-body":{_before:{content:"''",position:"absolute",inset:"0px",zIndex:1,boxShadow:"0px 0px 0px 5px var(--chakra-colors-trueblue-100)",borderRadius:"inherit",pointerEvents:"none"}},".streaming-cursor__label":{_after:{...m,backgroundImage:'url(\'data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 448 512" fill="'.concat(p,'"><!--! Font Awesome Pro 6.4.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. -->
1<path d="M245.8 45.9C241.9 37.4 233.4 32 224 32s-17.9 5.4-21.8 13.9L142.7 174.7 13.9 234.2C5.4 238.1 0 246.6 0 256s5.4 17.9 13.9 21.8l128.8 59.5 59.5 128.8c3.9 8.5 12.4 13.9 21.8 13.9s17.9-5.4 21.8-13.9l59.5-128.8 128.8-59.5c8.5-3.9 13.9-12.4 13.9-21.8s-5.4-17.9-13.9-21.8L305.3 174.7 245.8 45.9z"/></svg>\')'),content:"var(--ai-generating-label)"}}},"&.sal-active":{".block-card:not(.sal-active-card, .sal-active-card-parent)":{opacity:.5},".sal-active-card > [data-node-view-wrapper] > .card-wrapper > .card-body":{_before:{content:"''",position:"absolute",inset:"0px",zIndex:1,boxShadow:"0px 0px 0px 5px var(--chakra-colors-trueblue-100)",borderRadius:"inherit",pointerEvents:"none"},_after:{...m,backgroundImage:'url(\'data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" fill="'.concat(p,'"><!--! Font Awesome Pro 6.4.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --><path d="M327.5 85.2c-4.5 1.7-7.5 6-7.5 10.8s3 9.1 7.5 10.8L384 128l21.2 56.5c1.7 4.5 6 7.5 10.8 7.5s9.1-3 10.8-7.5L448 128l56.5-21.2c4.5-1.7 7.5-6 7.5-10.8s-3-9.1-7.5-10.8L448 64 426.8 7.5C425.1 3 420.8 0 416 0s-9.1 3-10.8 7.5L384 64 327.5 85.2zM205.1 73.3c-2.6-5.7-8.3-9.3-14.5-9.3s-11.9 3.6-14.5 9.3L123.3 187.3 9.3 240C3.6 242.6 0 248.3 0 254.6s3.6 11.9 9.3 14.5l114.1 52.7L176 435.8c2.6 5.7 8.3 9.3 14.5 9.3s11.9-3.6 14.5-9.3l52.7-114.1 114.1-52.7c5.7-2.6 9.3-8.3 9.3-14.5s-3.6-11.9-9.3-14.5L257.8 187.4 205.1 73.3zM384 384l-56.5 21.2c-4.5 1.7-7.5 6-7.5 10.8s3 9.1 7.5 10.8L384 448l21.2 56.5c1.7 4.5 6 7.5 10.8 7.5s9.1-3 10.8-7.5L448 448l56.5-21.2c4.5-1.7 7.5-6 7.5-10.8s-3-9.1-7.5-10.8L448 384l-21.2-56.5c-1.7-4.5-6-7.5-10.8-7.5s-9.1 3-10.8 7.5L384 384z"/></svg>\')'),content:"var(--ai-editing-label)",left:"50%",transform:"translate(-50%,0px)"}},".sal-active-card-parent":{".block:not(.sal-active-card)":{opacity:.5},".sal-active-card":{".block":{opacity:1}}},".sal-selection-text":{backgroundColor:"rgba(100, 100, 100, 0.25)",...u.FC}}};var g=n(40212);let f=".125em",x="scale(1.05)",v={transitionDuration:"slow",transitionTimingFunction:"ease-out"},b=".comments-wrapper, .block-comments-circle",y="> :is(".concat(b,")"),C="> :not(".concat(b,"), [data-spotlight-parent] > *"),w=e=>({"&.react-renderer > [data-node-view-wrapper]":{[C]:{transitionProperty:"filter, transform",...v,filter:"opacity(".concat(.2,") blur(").concat(e?f:"0",")")},[y]:{transitionProperty:"opacity",...v,filter:"opacity(".concat(.2,") blur(").concat(e?f:"0",")"),"&[data-is-popup-open=true]":{filter:"none"},_hover:{filter:"none"}}},"&:not(.react-renderer)":{transitionProperty:"filter, transform",...v,filter:"opacity(".concat(.2,") blur(").concat(e?f:"0",")")}}),k={"[data-spotlight-dim]":{opacity:.2},".spotlightable":w(!1),".spotlightable.after-spotlight":w(!0),".spotlightable.spotlight-block, .spotlight-block .spotlightable":{"&.react-renderer > [data-node-view-wrapper]":{[C]:{filter:"none",transform:"".concat(x," !important")},[y]:{filter:"none"}},"&:not(.react-renderer)":{filter:"none",transform:"".concat(x," !important")}}},j={".ProseMirror":{"&.spotlight-active":k,...h,".block-card":{transitionProperty:"opacity",transitionDuration:"normal"},"&.card-notes-active":{".block-card:not(.card-notes-active-parent-card)":{opacity:.5},".card-notes-active-parent-card .block-card":{opacity:"revert"},".card-notes-active-parent-card > [data-node-view-wrapper] > .card-wrapper > .card-body":{_before:{content:"''",position:"absolute",inset:"0px",zIndex:1,boxShadow:"0px 0px 0px 5px var(--chakra-colors-trueblue-100)",borderRadius:"inherit",pointerEvents:"none"}}},...g.U,...d,".card-present-mode":{"&--doc":{transform:"translateY(0)",position:"relative",zIndex:1},"&--presentCollapsed":{transform:"translateY(0)",position:"relative",zIndex:1},"&--presentPrev":{transform:"translateY(-100%)",position:"fixed",zIndex:2},"&--presentCurrent":{transform:"translateY(0)",position:"fixed",zIndex:3},"&--presentNext":{transform:"translateY(100%)",position:"fixed",zIndex:2},"&--presentParent":{transform:"translateY(0)",position:"fixed",zIndex:2}},".document-content.is-doc-mode":{".card-wrapper":{"&:hover":{".card-divider":{opacity:1},".manage-card-controls":{opacity:1}}}},".document-content":{".card-wrapper":{"&:hover":{".card-footer-reactions":{o
1pacity:1},".card-collapsed":{".card-footer-reactions":{display:"none"}}}}}},".is-selecting-node, .sal-selection-node, .sal-selection-card":{"[data-selection-ring]":{_before:{content:'""',position:"absolute",inset:0,borderRadius:"inherit",outline:"2px solid",outlineColor:"trueblue.300",pointerEvents:"none",zIndex:1}},'[data-selection-ring="inside"]':{_before:{zIndex:10,outlineOffset:"-2px"}},'[data-selection-ring="padded"]':{_before:{outlineOffset:"0.25em"}},".react-renderer [data-selection-ring]":{_before:{content:"none"}}},".is-selecting-around":{"[data-selection-background]":{_after:{content:'""',position:"absolute",inset:0,backgroundColor:"var(--chakra-ring-color)",borderRadius:"inherit",opacity:.75}},".react-renderer:not(.is-selecting-around) [data-selection-ring]":{_after:{content:"none"}}},".ProseMirror-dropcursor":{transitionProperty:"inset",transitionDuration:"fast",borderRadius:"md",position:"relative",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",color:"white",outline:"1px solid",outlineColor:"whiteAlpha.800",pointerEvents:"none",backdropFilter:"blur(4px)","&::after":{backgroundColor:"gray.700",color:"whiteAlpha.900",px:"8px",py:"2px",borderRadius:"sm",fontWeight:"medium",shadow:"md",fontSize:"sm",w:"max-content",pointerEvents:"none",display:"none"},'&[data-type="column"]::after':{content:'"Drop to add column"',position:"absolute",top:"-2em",display:"block"}}}},46741:function(e,t,n){"use strict";n.d(t,{Ky:function(){return s},dE:function(){return d},fY:function(){return l}});var r=n(73528);let o=[...Array(r.N+1).keys()],i="1.6em",a=["disc","circle","square"],l=e=>({listStyle:a[e%a.length],paddingLeft:"0.4em",_after:{paddingLeft:"0.4em"},marginLeft:"calc(".concat(e+1," * ").concat(i," - 0.4em)")}),s=".block-bullet, .block-numbered, .block-todo",d={[s]:{margin:"0",marginBottom:"0.4em",textAlign:"left","&:first-of-type":{marginTop:"var(--block-margin)"}},"ol.block-numbered":{listStyle:"none"},".block-todo":{listStyle:"none","label.chakra-checkbox":{pointerEvents:"none",".chakra-checkbox__control":{pointerEvents:"auto",width:"1em",height:"1em",top:"0.3em",position:"relative",borderRadius:"var(--box-border-radius)",borderColor:"var(--link-color)",borderWidth:"0.125em","&[data-checked]":{backgroundColor:"var(--link-color)",color:"var(--body-color-inverted)"},svg:{fontSize:"0.5em"}}}},".block-bullet, .block-todo":{li:{position:"relative"}}};o.forEach(e=>{d['ol.block-numbered[indent="'.concat(e,'"]')]={"li[data-node-view-content]":{marginLeft:"calc(".concat(e+1," * ").concat(i,")"),position:"relative",_before:{position:"absolute",left:"-".concat(i),content:'attr(data-list-counter) "."'}}}}),o.forEach(e=>{d['ul.block-bullet[indent="'.concat(e,'"]')]={"li[data-node-view-content]":l(e)},d['ul.block-todo[indent="'.concat(e,'"]')]={"li.todo":{marginLeft:"calc(".concat(e+1," * ").concat(i,")"),listStyle:"none"},".chakra-checkbox__control":{left:"-".concat(i)}}})},14647:function(e,t,n){"use strict";n.d(t,{ho:function(){return a},iJ:function(){return l}});var r=n(72338),o=n(77377);let i=new Set(["bullet","numbered","todo","title","heading","paragraph","image","blockquote","embed","video"]),a=(e,t)=>{if(i.has(e.type.name)){let n={type:"card",content:[e.toJSON()]},i=(0,o.e)().map(e=>(null==t?void 0:t.includes(e.name))?e instanceof r.vc?e.extend({renderHTML:()=>["span",0]}):e.extend({renderHTML:()=>""}):e);return(0,r.ar)(n||{},i)}return""},l=(e,t)=>{if(i.has(e.type.name)){let n={type:"card",content:[e.toJSON()]},i=(0,o.e)().map(e=>(null==t?void 0:t.includes(e.name))?(r.vc,e.extend({renderText:()=>""})):e);return(0,r._4)(n||{},i)}return""}},5596:function(e,t,n){"use strict";n.d(t,{j:function(){return r}});let r=e=>{var t;let{mutation:n}=e,r="attributes"===n.type&&(null===(t=n.attributeName)||void 0===t?void 0:t.startsWith("data-"));return!!r}},47577:function(e,t,n){"use strict";n.d(t,{A0:function(){return d},Wy:function(){return l},ok:function(){return s}});var r=n(72338),o=n(27191),i=n(11050),a=n(83440);let l=(e,t)=>{let n=new r.VK({find:e.find,handler:t=>{let{state:n,range:o,match:i}=t,a=n.doc.resolve(o.from),l=(0,r.nU)(e.getAttributes,void 0,i)||{},s={...a.parent.attrs,...l};if(!a.node(-1).canReplaceWith(a.index(-1),a.indexAfter(-1),e.type))return;let{tr:d}=n;d.delete(o.from,o.to).setBlockType(o.from,o.from,e.type,s)}});return new r.VK({find:e.find,handler:r=>{let{state:l,range:s}=r,d=new o.Bs(l.doc.resolve(s.from),l.doc.resolve(s.to)),c=(0,a.Tr)(t)(d);if(c)return null;let u=n.handler(r);return null!==u&&i.co.track(i.AA.NODE_INSERTED,{method:i.fe.INPUT_RULE,node_name:e.type.n
1ame}),u}})};function s(e){return new r.VK({find:e.find,handler:t=>{let{state:n,range:o,match:i}=t,a=(0,r.nU)(e.getAttributes,void 0,i)||{},{tr:l}=n,s=o.from,d=o.to,c=n.doc.resolve(s),u=c.before();l.replaceWith(u,d,e.type.create(a))}})}function d(e){return new r.VK({find:e.find,handler:t=>{let{state:n,range:o}=t,i=n.doc.resolve(o.from),a=(0,r.nU)(e.getAttributes,void 0,i.parent);if(!a)return;let l=n.tr.delete(o.from,o.to);Object.entries(a).forEach(e=>{let[t,n]=e;l.setNodeAttribute(o.from-1,t,n)})}})}},68292:function(e,t,n){"use strict";n.d(t,{S:function(){return o}});var r=n(72338);function o(e){let{type:t}=e;if(!t.isInline)throw Error("[nodePasteRule] This paste rule was only designed to consider inline nodes.");return new r.hD({find:e.find,handler:t=>{let{state:n,range:o,match:i}=t,{tr:a}=n,l=o.from,s=o.to,d=(0,r.nU)(e.getAttributes,void 0,i)||{};a.replaceWith(l,s,e.type.create(d))}})}},46795:function(e,t,n){"use strict";n.d(t,{G8:function(){return s},XV:function(){return a},bb:function(){return l},jS:function(){return i}});var r=n(38564),o=n(36069);let i=(e,t)=>{let n=r.Gt.getState(e);if(!n)return null;let{type:i,binding:a}=n;return n.binding?(0,o.JR)(t,i,a.mapping):null},a=(e,t)=>{let n=r.Gt.getState(e);if(!n)return null;let{doc:i,type:a,binding:l}=n;return n.binding?(0,o.SF)(i,a,t,l.mapping):null},l=(e,t)=>({from:i(e,t.from),to:i(e,t.to)}),s=(e,t)=>{if(!t.from||!t.to)return null;let n=a(e,t.from),r=a(e,t.to);return null==n||null==r?null:{from:n,to:r}}},67748:function(e,t,n){"use strict";n.d(t,{c:function(){return l}});var r=n(30764),o=n(27191),i=n(38322),a=n(15690);class l extends o.Y1{map(e,t){let{deleted:n,pos:r}=t.mapResult(this.anchor),i=e.resolve(r);return n?(0,a.E)(i)||o.Y1.near(i):new l(i,this.side)}content(){return new r.p2(r.HY.from(this.node),0,0)}eq(e){return e instanceof l&&e.anchor===this.anchor&&e.side===this.side}toJSON(){return{type:"presentation",anchor:this.anchor,side:this.side}}createSelectionNear(){let e=this.side<1?1:-1,t=(0,i.t)(this.$from,e);return t||o.Y1.near(this.$from)}static fromJSON(e,t){if("number"!=typeof t.anchor)throw RangeError("Invalid input for PresentationSelection.fromJSON");return new l(e.resolve(t.anchor))}static create(e,t,n){return new l(e.resolve(t),n)}static isSelectable(e){return!e.isText&&!1!==e.type.spec.selectable}constructor(e,t=0){let n=e.nodeAfter,r=e.node(0).resolve(e.pos+n.nodeSize);super(e,r),this.node=n,this.side=t}}if(l.prototype.visible=!1,!l.prototype.jsonID)try{o.Y1.jsonID("presentation",l)}catch(e){}},15690:function(e,t,n){"use strict";n.d(t,{E:function(){return c},a:function(){return u}});var r=n(3027),o=n(27191),i=n(26151);let a=(e,t,n)=>t&&o.qv.isSelectable(t)?o.qv.create(e,n):null,l=(e,t,n)=>t&&t.inlineContent?o.Bs.create(e,n):null;function s(e,t,n){return e&&n?n:e&&t?t:!e&&t?t:!e&&n?n:null}function d(e,t){let{doc:n,pos:i,parent:d,nodeAfter:c,nodeBefore:u}=e;if(d.inlineContent)return o.Bs.create(n,i);let p=t>0,m=s(p,l(n,u,i-1),l(n,c,i+1));if(m)return m;if(r.Q.valid(e))return new r.Q(e);if(d.type.spec.isolating){let t=s(p,a(n,u,i-((null==u?void 0:u.nodeSize)||0)),a(n,c,i));if(t)return t;if(0===d.childCount&&o.qv.isSelectable(d))return o.qv.create(n,e.before())}return null}function c(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=d(e,t);if(n)return n;for(let n=e.depth-1;n>=0&&!e.node(n+1).type.spec.isolating;n--){let r=t<0?e.before(n+1):e.after(n+1),o=d(e.doc.resolve(r),t);if(o)return o}return null}let u=(e,t)=>{let n;let r=e.steps.length-1,o=e.steps[r];if(!(o instanceof i.Pu||o instanceof i.FC))return null;let a=e.mapping.maps[r];return(a.forEach((e,t,r,o)=>{null==n&&(n=o)}),null==n)?null:c(e.doc.resolve(n),t)}},23147:function(e,t,n){"use strict";n.d(t,{G0:function(){return f},hs:function(){return m},qI:function(){return h}});var r=n(36069),o=n(72338),i=n(49431),a=n(55461),l=n.n(a),s=n(1842),d=n.n(s),c=n(69180),u=n(77377);let p=e=>{"card"===e.type&&e.attrs&&delete e.attrs.id},m=e=>{let t=e=>{var n;return null===(n=e.content)||void 0===n?void 0:n.map(e=>{if(!e.content)return e;let n={...e,attrs:{...e.attrs}};return p(n),n.content=t(n),n})};return p(e),Object.assign({},e,{content:t(e)})},h=e=>{let t=(0,u.e)(),n=(0,o.J1)(t),a=(0,r.uH)(n,e,"default"),l=(0,c.D$)(a);return(0,i.kZ)(l)},g=(e,t)=>!!(d()(e)&&d()(t))||void 0,f=(e,t)=>{let n=(0,r.uH)(e.schema,e.getJSON(),"default"),o=(0,r.R3)(n,"default"),i=(0,r.uH)(e.schema,t,"default"),a=(0,r.R3)(i,"default");return l()(o,a,g)}},96636:function(e,t,n){"use strict";n.d(t,{r:function(){return p}});var r=n(52322),o=n(38035),i=n(25237),a=n.n(i),l=n(5995),s=n(89098),d=n(14027),c=n(39823);let u=a()(async()=>(await Promise.all([n.e(2533),n.e(9646),n.e(339)]).then(n.bind(n,80339))).Tldraw,{loadableGenerated:{webpack:()=>[80339]},ssr:!1}),p=e=>{let{theme:t=d.g}=e,n=(0,s.c)(t),i=(0,l.l)(t),a=(0,c.c)(t);return(0,r.jsx)(o.k,{sx:{...i,".tl-container":{...a,"--tl-text-outline":"transparent","--color-background":"var(--card-color)","--tl-font-draw":"var(--body-font)",fontFamily:"var(--body-font)",fontWeight:"var(--body-font-weight)"}},position:"relative",h:"100%",w:"100%",className:"highlight-mask",children:(0,r.jsx)(u,{...e,defaultStyles:n.tldrawStyles})})}},39823:function(e,t,n){"use strict";n.d(t,{c:function(){return u},F:function(){return p}});var r,o=n(89098),i=n(90439),a=n(27333),l=n(12304);let s=e=>({"div.textbox":{display:"flex",flexDirection:"column",alignItems:"var(--horizontal-align)",justifyContent:"var(--vertical-align)",textAlign:"var(--text-align)","--flex-align":"var(--horizontal-align)",height:"100%",fontSize:"".concat((null!==(r=e.config.fontSize)&&void 0!==r?r:1)*20,"px"),color:"var(--body-color)",".ProseMirror":{padding:"1.25rem",...d(e),...e.config.contentStyles},"div.text":{padding:"1.25rem",...c(e),...e.config.contentStyles,".heading":{position:"static"}}}}),d=e=>({lineHeight:l.I0,".block":{my:"1rem"},"> .first-block":{mt:"0rem"},"> .last-block":{mb:"0rem"},...(0,a.A3)(e),'.heading[level="1"], h1':(0,l.v0)("h1"),'.heading[level="2"], h2':(0,l.v0)("h2"),'.heading[level="3"], h3':(0,l.v0)("h3"),'.heading[level="4"], h4':(0,l.v0)("h4"),".block-heading":{mt:"1rem",mb:"1rem","&.first-block":{mt:"0rem"},"&.last-block":{mb:"0rem"}}}),c=e=>({"> *":{my:"1rem",":first-child":{mt:"0rem"},":last-child":{mb:"0rem"}},h1:(0,l.v0)("h1"),h2:(0,l.v0)("h2"),h3:(0,l.v0)("h3"),h4:(0,l.v0)("h4"),"h1, h2, h3, h4":{mt:"1rem",mb:"1rem",width:"100%"}}),u=e=>{let t=(0,o.c)(e),n={text:{fill:"var(--body-color)"}
1,"[data-shape-type=geo]":{path:{...t.shapeBackgroundSx,strokeWidth:"var(--stroke-width)"},"&.tl-shape-background":{strokeWidth:0}},"[data-shape-type=arrow]":{"g, path":{stroke:"var(--shape-border-color-override, var(--shape-border-image-svg) var(--shape-border-color))",strokeWidth:"var(--stroke-width)"},".tl-arrow-label":{color:"var(--shape-border-color-override, var(--body-color)) !important"},text:{fill:"var(--shape-border-color-override, var(--body-color))"}},"[data-shape-type=line]":{path:{stroke:"var(--shape-border-color-override, var(--shape-border-image-svg) var(--shape-border-color))",strokeWidth:"var(--stroke-width)"}},"[data-shape-type=image]":{"[data-image-upload-status]":{".tl-image-container":{backgroundImage:"var(--temp-url)",objectFit:"cover",backgroundSize:"cover"}}},...s(e),foreignObject:i.QX?{visibility:"hidden"}:void 0},r={"[data-shape=image]":{".tl-inner-div":{}},img:{'&[src^="blob:"]':{animation:"loading-pulse-animation 1.5s infinite"}},...n};return r},p=(e,t)=>(t&&"none"===e&&(e="sm"),({none:0,sm:2,md:4,lg:6})[e])},48892:function(e,t,n){"use strict";n.d(t,{T:function(){return o}});var r=n(76919);let o=new r.v},56943:function(e,t,n){"use strict";n.d(t,{Hn:function(){return J},dU:function(){return X}});var r=n(73235),o=n(57981);function i(){let e=(0,r._)(["\n fragment DefaultThemeFontFields on ThemeFont {\n id\n name\n url\n }\n"]);return i=function(){return e},e}function a(){let e=(0,r._)(["\n ","\n fragment DefaultThemeFields on Theme {\n id\n workspaceId\n name\n headingFont\n headingFontWeight\n bodyFont\n bodyFontWeight\n accentColor\n logoUrl\n config\n priority\n archived\n createdTime\n updatedTime\n fonts {\n ... on ThemeFont {\n ...DefaultThemeFontFields\n }\n }\n }\n"]);return a=function(){return e},e}function l(){let e=(0,r._)(["\n ","\n mutation CreateTheme($input: CreateThemeInput!) {\n createTheme(input: $input) {\n ...DefaultThemeFields\n docCount\n }\n }\n\n mutation UpdateTheme($input: UpdateThemeInput!) {\n updateTheme(input: $input) {\n ...DefaultThemeFields\n docCount\n }\n }\n\n mutation MakeThemeStandard($id: ID!, $newId: ID) {\n makeThemeStandard(id: $id, newId: $newId) {\n ...DefaultThemeFields\n docCount\n }\n }\n\n mutation DuplicateTheme($id: ID!) {\n duplicateTheme(id: $id) {\n ...DefaultThemeFields\n }\n }\n\n query GetTheme($id: ID) {\n theme(id: $id) {\n ...DefaultThemeFields\n createdBy {\n id\n displayName\n email\n profileImageUrl\n }\n }\n }\n\n query GetThemeWithCount($id: ID) {\n theme(id: $id) {\n ...DefaultThemeFields\n docCount\n siteCount\n createdBy {\n id\n displayName\n email\n profileImageUrl\n }\n }\n }\n\n query GetThemes($workspaceId: ID, $archived: Boolean) {\n themes(workspaceId: $workspaceId, archived: $archived) {\n ...DefaultThemeFields\n createdBy {\n id\n displayName\n email\n profileImageUrl\n }\n }\n }\n\n mutation ArchiveTheme($id: ID!) {\n archiveTheme(id: $id) {\n ...DefaultThemeFields\n docCount\n siteCount\n }\n }\n\n mutation UnarchiveTheme($id: ID!) {\n unarchiveTheme(id: $id) {\n ...DefaultThemeFields\n }\n }\n"]);return l=function(){return e},e}let s=(0,o.Ps)(i()),d=(0,o.Ps)(a(),s);function c(){let e=(0,r._)(["\n query SearchMention(\n $workspaceId: ID!\n $query: String!\n $types: [SearchType!] = [user, doc]\n ) {\n search(orgId: $workspaceId, query: $query, types: $types) {\n __typename\n ... on DocResult {\n id\n title\n text\n archived\n previewUrl\n createdBy {\n id\n displayName\n profileImageUrl\n }\n organization {\n id\n }\n editors {\n user {\n id\n displayName\n profileImageUrl\n }\n lastViewed\n lastEdited\n }\n docUser {\n lastViewed\n lastEdited\n favorited\n }\n orgAccess\n publicAccess\n updatedTime\n createdTime\n editedTime\n }\n ... on User {\n id\n displayName\n email\n profileImageUrl\n }\n }\n }\n"]);return c=function(){return e},e}function u(){let e=(0,r._)(["\n fragment ReactionFields on Reaction {\n emoji\n count\n targetId\n targetType\n docId\n users {\n id\n displayName\n profileImageUrl\n }\n }\n"]);return u=function(){return e},e}function p(){let e=(0,r._)(["\n fragment CommentAuthorFields on User {\n id\n displayName\n profileImageUrl\n email\n }\n"]);return p=function(){return e},e}function m(){let e=(0,r._)(["\n ","\n ","\n fragment ReplyFields on Comment {\n id\n commentId\n content\n createdTime\n updatedTime\n archived\n user {\n ...CommentAuthorFields\n }\n reactions {\n ...ReactionFields\n }\n }\n"]);return m=function(){return e},e}function h(){let e=(0,r._)(["\n ","\n ","\n ","\n fragment CommentFields on Comment {\n id\n docId\n cardId\n content\n targetText\n targetHtml\n createdTime\n updatedTime\n archived\n targetId\n status\n user {\n ...CommentAuthorFields\n }\n replies {\n ...ReplyFields\n }\n reactions {\n ...ReactionFields\n }\n }\n"]);return h=function(){return e},e}function g(){let e=(0,r._)(["\n fragment DocCollaboratorFields on DocCollaborator {\n docId\n user {\n id\n displayName\n email\n profileImageUrl\n }\n permission\n guest\n accessLinkId\n }\n\n fragment DocInvitationsFields on DocInvitation {\n id\n docId\n email\n permission\n }\n"]);return g=function(){return e},e}function f(){let e=(0,r._)(["\n fragment DocChannelFields on DocChannel {\n id\n name\n slug\n permission\n }\n"]);return f=function(){return e},e}function x(){let e=(0,r._)(["\n fragment DocEditorsFields on DocEditor {\n user {\n id\n displayName\n email\n profileImageUrl\n }\n lastEdited\n }\n"]);return x=function(){return e},e}function v(){let e=(0,r._)(["\n ","\n fragment DocSiteFields on Site {\n id\n archived\n workspaceId\n name\n domains {\n id\n siteId\n name\n status\n builtin\n }\n routes {\n id\n siteId\n docId\n path\n offline\n doc {\n id\n title\n }\n }\n currentDeployment {\n id\n siteId\n buildHost\n deploymentTime\n }\n createdTime\n updatedTime\n previewUrl\n pageCount\n archived\n enabled\n faviconUrl\n themeId\n navEnabled\n navContent\n gtmContainerId\n }\n"]);return v=function(){return e},e}function b(){let e=(0,r._)(["\n ","\n mutation AddCollaborators(\n $docId: ID!\n $collaborators: [DocCollaboratorInput!]!\n ) {\n addCollaborators(docId: $docId, collaborators: $collaborators) {\n id\n collaborators {\n ...DocCollaboratorFields\n }\n invitations {\n ...DocInvitationsFields\n }\n }\n }\n"]);return b=function(){return e},e}function y(){let e=(0,r._)(["\n ","\n mutation RemoveCollaborators(\n $docId: ID!\n $collaborators: [DocCollaboratorRemovalInput!]!\n ) {\n removeCollaborators(docId: $docId, collaborators: $collaborators) {\n id\n collaborators {\n ...DocCollaboratorFields\n }\n invitations {\n ...DocInvitationsFields\n }\n }\n }\n"]);return y=function(){return e},e}function C(){let e=(0,r._)(["\n ","\n mutation AddCollaboratorByAccessLink($docId: ID!) {\n addCollaboratorByAccessLink(docId: $docId) {\n id\n collaborators {\n ...DocCollaboratorFields\n }\n }\n }\n"]);return C=function(){return e},e}function w(){let e=(0,r._)(["\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n query GetDoc($id: ID!) {\n doc(id: $id) {\n id\n title\n titleEdited\n archived\n createdTime\n updatedTime\n editedTime\n savedTime\n currentSnapshotId\n publishedSnapshotId\n publishedSnapshot {\n content\n }\n publishedTime\n publicAccess\n comments {\n ...CommentFields\n }\n reactions {\n ...ReactionFields\n }\n accessLinks {\n id\n docId\n type\n permission\n token\n url\n }\n orgAccess\n organization {\n id\n name\n products\n }\n theme {\n ...DefaultThemeFields\n fonts {\n id\n name\n url\n }\n }\n collaborators {\n ...DocCollaboratorFields\n }\n invitations {\n ...DocInvitationsFields\n }\n editors {\n ...DocEditorsFields\n }\n createdBy {\n displayName\n id\n email\n }\n channels {\n ...DocChannelFields\n }\n site {\n ...DocSiteFields\n }\n docGenerateInput {\n id\n docGeneration {\n id\n generationType\n }\n }\n }\n }\n"]);return w=function(){return e},e}function k(){let e=(0,r._)(["\n query GetDocRobots($id: ID!) {\n doc(id: $id) {\n id\n title\n createdTime\n updatedTime\n currentSnapshot {\n id\n docId\n content\n }\n titleCard {\n previewUrl\n text\n }\n organization {\n id\n name\n products\n }\n createdBy {\n displayName\n id\n email\n }\n }\n }\n"]);return k=function(){return e},e}function j(){let e=(0,r._)(["\n ","\n ","\n ","\n ","\n ","\n ","\n subscription SubscribeToDoc($id: ID!) {\n doc(id: $id) {\n ... on DocSubscription {\n id\n title\n titleEdited\n archived\n updatedTime\n editedTime\n savedTime\n publishedTime\n accessLinks {\n id\n docId\n permission\n token\n url\n }\n channels {\n ...DocChannelFields\n }\n collaborators {\n ...DocCollaboratorFields\n }\n editors {\n ...DocEditorsFields\n }\n invitations {\n ...DocInvitationsFields\n }\n theme {\n ...DefaultThemeFields\n }\n reactions {\n ...ReactionFields\n }\n orgAccess\n }\n\n ... on DocCommentsSubscription {\n id\n comments {\n ...CommentFields\n }\n }\n ... on DocReactionsSubscription {\n id\n reactions {\n ...ReactionFields\n }\n }\n }\n }\n"]);return j=function(){return e},e}function S(){let e=(0,r._)(["\n mutation UpdateDocTitle($id: ID!, $title: String, $titleEdited: Boolean) {\n updateDoc(input: { id: $id, title: $title, titleEdited: $titleEdited }) {\n id\n title\n titleEdited\n }\n }\n"]);return S=function(){return e},e}function A(){let e=(0,r._)(["\n mutation UpdateDocOrgAccess($id: ID!, $orgAccess: Permission) {\n updateDoc(input: { id: $id, orgAccess: $orgAccess }) {\n id\n orgAccess\n }\n }\n"]);return A=function(){return e},e}function I(){let e=(0,r._)(["\n mutation UpdateDocPublicAccess($id: ID!, $publicAccess: Permission) {\n updateDoc(input: { id: $id, publicAccess: $publicAccess }) {\n id\n publicAccess\n }\n }\n"]);return I=function(){return e},e}function E(){let e=(0,r._)(["\n mutation UpdateDocAccessLinks($id: ID!, $accessLinks: [AccessLinkInput!]) {\n updateDoc(input: { id: $id, accessLinks: $accessLinks }) {\n id\n accessLinks {\n permission\n id\n }\n }\n }\n"]);return E=function(){return e},e}function z(){let e=(0,r._)(["\n ","\n mutation UpdateDocTheme($id: ID!, $themeId: String) {\n updateDoc(input: { id: $id, themeId: $themeId }) {\n id\n theme {\n ...DefaultThemeFields\n }\n }\n }\n"]);return z=function(){return e},e}function T(){let e=(0,r._)(["\n mutation InviteMembers($workspaceId: ID!, $invitees: [InvitationInput!]!) {\n inviteMembers(orgId: $workspaceId, invitees: $invitees) {\n id\n name\n invitations {\n email\n }\n }\n }\n"]);return T=function(){return e},e}function N(){let e=(0,r._)(["\n ","\n ","\n ","\n mutation CreateComment($input: CreateCommentInput) {\n createComment(input: $input) {\n id\n docId\n cardId\n content\n targetText\n targetHtml\n createdTime\n updatedTime\n commentId\n archived\n targetId\n status\n user {\n ...CommentAuthorFields\n }\n replies {\n ...ReplyFields\n }\n reactions {\n ...ReactionFields\n }\n }\n }\n"]);return N=function(){return e},e}function M(){let e=(0,r._)(["\n mutation UpdateComment($input: UpdateCommentInput!) {\n updateComment(input: $input) {\n id\n docId\n content\n updatedTime\n }\n }\n"]);return M=function(){return e},e}function _(){let e=(0,r._)(["\n mutation UpdateCommentStatus($input
1: UpdateCommentStatusInput!) {\n updateCommentStatus(input: $input) {\n id\n status\n updatedTime\n }\n }\n"]);return _=function(){return e},e}function L(){let e=(0,r._)(["\n mutation RemoveComment($id: ID!) {\n archiveComment(id: $id) {\n id\n archived\n }\n }\n"]);return L=function(){return e},e}function P(){let e=(0,r._)(["\n ","\n fragment DocReactionsCreate on Doc {\n reactions {\n ...ReactionFields\n }\n }\n"]);return P=function(){return e},e}function R(){let e=(0,r._)(["\n ","\n ","\n fragment DocCommentsCreate on Doc {\n comments {\n id\n docId\n cardId\n content\n targetText\n targetHtml\n createdTime\n updatedTime\n archived\n targetId\n status\n user {\n ...CommentAuthorFields\n }\n }\n }\n fragment DocRepliesCreate on Doc {\n comments {\n id\n replies {\n ...ReplyFields\n }\n }\n }\n fragment DocCommentsUpdate on Doc {\n comments {\n id\n docId\n content\n updatedTime\n reactions {\n ...ReactionFields\n }\n }\n }\n fragment DocRepliesUpdate on Doc {\n comments {\n id\n replies {\n id\n docId\n content\n updatedTime\n reactions {\n ...ReactionFields\n }\n }\n }\n }\n fragment DocCommentsRemove on Doc {\n comments {\n id\n archived\n }\n }\n fragment DocRepliesRemove on Doc {\n comments {\n id\n replies {\n id\n archived\n }\n }\n }\n"]);return R=function(){return e},e}function H(){let e=(0,r._)(["\n ","\n mutation AddReaction($reactionInput: AddReactionInput!) {\n addReaction(input: $reactionInput) {\n ...ReactionFields\n }\n }\n"]);return H=function(){return e},e}function D(){let e=(0,r._)(["\n ","\n mutation RemoveReaction($reactionInput: RemoveReactionInput!) {\n removeReaction(input: $reactionInput) {\n ...ReactionFields\n }\n }\n"]);return D=function(){return e},e}function O(){let e=(0,r._)(["\n query GetMemoAnalytics($memoId: ID!) {\n memoStats(id: $memoId) {\n memoId\n uniqueViewers\n uniqueEditors\n cardCount\n lastOpened\n viewers {\n user {\n id\n displayName\n email\n profileImageUrl\n }\n visitorId\n lastOpened\n cardsViewed\n }\n dailyViews {\n dayCount\n timezone\n everyone {\n date\n uniqueVisitors\n }\n viewers {\n date\n uniqueVisitors\n }\n }\n }\n }\n\n query GetDocCardsAnalytics($docId: ID!, $userId: ID) {\n docCardsStats(docId: $docId, userId: $userId) {\n docId\n uniqueVisitors\n uniqueEditors\n cardCount\n everyone {\n cardId\n viewTimePercent\n viewersPercent\n }\n viewers {\n cardId\n viewTimePercent\n viewersPercent\n }\n }\n }\n"]);return O=function(){return e},e}function B(){let e=(0,r._)(["\n mutation SetDocPassword($docId: ID!, $password: String!) {\n setDocPassword(id: $docId, password: $password) {\n id\n accessLinks {\n id\n permission\n type\n }\n }\n }\n"]);return B=function(){return e},e}function F(){let e=(0,r._)(["\n mutation RemoveDocPassword($docId: ID!) {\n removeDocPassword(id: $docId) {\n id\n accessLinks {\n id\n permission\n type\n }\n }\n }\n"]);return F=function(){return e},e}function W(){let e=(0,r._)(["\n query GetDocPassword($docId: ID!) {\n getDocPassword(id: $docId)\n }\n"]);return W=function(){return e},e}(0,o.Ps)(l(),d),(0,o.Ps)(c());let G=(0,o.Ps)(u()),U=(0,o.Ps)(p()),V=(0,o.Ps)(m(),G,U),q=(0,o.Ps)(h(),V,G,U),$=(0,o.Ps)(g()),K=(0,o.Ps)(f()),Z=(0,o.Ps)(x()),Y=(0,o.Ps)(v(),d);(0,o.Ps)(b(),$),(0,o.Ps)(y(),$),(0,o.Ps)(C(),$),(0,o.Ps)(w(),q,$,Z,K,Y,d,G),(0,o.Ps)(k());let X=(0,o.Ps)(j(),q,$,Z,K,d,G);(0,o.Ps)(S()),(0,o.Ps)(A()),(0,o.Ps)(I()),(0,o.Ps)(E()),(0,o.Ps)(z(),d),(0,o.Ps)(T()),(0,o.Ps)(N(),V,G,U),(0,o.Ps)(M()),(0,o.Ps)(_()),(0,o.Ps)(L()),(0,o.Ps)(P(),G);let J=(0,o.Ps)(R(),V,U);
1(0,o.Ps)(H(),G),(0,o.Ps)(D(),G),(0,o.Ps)(O()),(0,o.Ps)(B()),(0,o.Ps)(F()),(0,o.Ps)(W())},1787:function(e,t,n){"use strict";n.d(t,{v:function(){return o}});var r=n(37164);let o={generate:(0,r.kP)("0123456789abcdefghijklmnopqrstuvwxyz",15)}},46640:function(e,t,n){"use strict";n.d(t,{P9:function(){return p},Yz:function(){return g},yd:function(){return x},z3:function(){return h}});var r=n(19293),o=n(43182),i=n(82282),a=n(33437),l=n(82236),s=n(21668),d=n(31807),c=n(96913),u=n(48832);let p=e=>{try{let t=(0,u.dN)(),n=(0,d.Z)(e),r=(0,c.Z)(n,0);if((0,l.Z)(n)||(0,s.Z)(n))return(0,a.Z)(r,new Date,{locale:t});return"".concat((0,i.Z)(n,"PPp",{locale:t}))}catch(e){return console.error("[normalizeDate] Error normalizing date:",e),"date unknown"}},m=e=>null==e?void 0:e.reduce((e,t)=>!e||t.updatedTime>(null==e?void 0:e.updatedTime)?t:e,null),h=e=>{let t=m(e.replies);return t?e.updatedTime>(null==t?void 0:t.updatedTime)?e.updatedTime:t.updatedTime:e.updatedTime},g=(e,t)=>{let n=m(e.replies),r=m(t.replies),o=n?n.updatedTime:e.updatedTime,i=r?r.updatedTime:t.updatedTime;return o>i?-1:i>o?1:0},f="createdTime",x=e=>{let{items:t,sortBy:n=f,latestTimeGetterFn:i}=e;return t.slice().sort((e,t)=>"function"==typeof n?n(e,t):(0,r.Z)((0,d.Z)(e[n]),(0,d.Z)(t[n]))).reduce((e,t)=>{let n=i?(0,d.Z)(i(t)):(0,d.Z)(t[f]),r=new Date;return(0,l.Z)(n)?e.today=e.today.concat(t):1>(0,o.Z)(r,n)?e.thisWeek=e.thisWeek.concat(t):e.earlier=e.earlier.concat(t),e},{today:[],thisWeek:[],earlier:[]})}},62549:function(e,t,n){"use strict";n.d(t,{Hs:function(){return r},Rf:function(){return o}}),n(84636),n(2784);let r=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:30;return e.length?1===e.length?e[0]:2===e.length?e.join(" and "):e.length<=t?"".concat([e.slice(0,e.length-1).join(", "),e[e.length-1]].join(", and ")):"".concat([e.slice(0,t).join(", "),"".concat(e.length-t," ").concat(e.length-t>1?"others":"other")].join(", and ")):null},o=e=>{let{users:t,selfUserId:n}=e,o=t?[...t].sort(e=>(null==e?void 0:e.id)===n?-1:1).map(e=>(null==e?void 0:e.id)===n?"You":(null==e?void 0:e.displayName)||""):[];return r(o)}},86392:function(e,t,n){"use strict";n.d(t,{Br:function(){return u},CI:function(){return p}});var r=n(30733),o=n.n(r),i=n(54073),a=n.n(i),l=n(2784),s=n(76919);class d extends s.v{cleanup(){document.removeEventListener("containerResize",this.emitResize)}constructor(){super(),this.emitResize=e=>{this.emit("resize",e)},document.addEventListener("containerResize",this.emitResize)}}let c=o()(()=>new d),u=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:250,[n,r]=(0,l.useState)(!1),o=(0,l.useMemo)(c,[]);return(0,l.useEffect)(()=>{let n;let i=a()(o=>{let{target:i}=o;i&&e.current&&m(e.current,i)&&(clearTimeout(n),r(!0),n=setTimeout(()=>{r(!1)},t+100))},t,{leading:!0,trailing:!1,maxWait:t});return o.on("resize",i)},[o,t,e]),n},p=e=>{e.dispatchEvent(new Event("containerResize",{bubbles:!0}))},m=(e,t)=>{let n=e;do{if(n!==t)continue;return!0}while(n=n.parentElement);return!1}},24992:function(e,t,n){"use strict";n.d(t,{A:function(){return i},Z:function(){return a}});var r=n(2784),o=n(66028);let i="is-dragging-over",a=(e,t)=>{let n=(0,r.useCallback)(n=>{var r;(!t||t(n))&&(null===(r=e.current)||void 0===r||r.classList.add(i))},[e]),a=(0,r.useCallback)(()=>{var t;return null===(t=e.current)||void 0===t?void 0:t.classList.remove(i)},[e]);return{onDragOver:o.Gb,onDragEnter:n,onDragLeave:a,onDrop:a}}},90775:function(e,t,n){"use strict";n.d(t,{N:function(){return r}});let r=(e,t)=>i(new o(e,null),t);class o{get type(){return this.jsonNode.type}get text(){return this.jsonNode.text}get content(){return this.jsonNode.content?this.jsonNode.content.map(e=>new o(e,this)):this.jsonNode.content}get attrs(){return this.jsonNode.attrs}set attrs(e){this.jsonNode.attrs=e}constructor(e,t){this.jsonNode=e,this.parent=t,this.__type="JSONContentNode"}}let i=(e,t)=>{if(t(e),e.content)for(let n of e.content)i(n,t)}},22596:function(e,t,n){"use strict";n.d(t,{N:function(){return l}});var r=n(6238),o=n.n(r),i=n(37164);class a{_flush(){this._handle=0;let e=this._queue;
1this._queue=[],e.forEach(e=>{let{fn:t}=e;t()})}push(e,t){if(t){let n=this._queue.findIndex(e=>e.id===t);n>-1?this._queue.splice(n,1,{fn:e,id:t}):this._queue.push({fn:e,id:t})}else this._queue.push({fn:e,id:(0,i.x0)(5)});this._handle||(this._handle=requestAnimationFrame(this._flush.bind(this)))}constructor(){this._queue=[],this._handle=0,this._handle=requestAnimationFrame(this._flush.bind(this))}}let l=o()(()=>new a)},20678:function(e,t,n){"use strict";n.d(t,{$:function(){return i}});var r=n(87254),o=n(94199);let i=e=>e&&e.length?e:r.ag._({id:"7ZviFu",values:{GAMMA_ARTIFACT_PROPER_NOUN:o.Yc}})},19576:function(e,t,n){"use strict";let r;n.d(t,{R:function(){return a}});var o=n(35368),i=n.n(o);let a=i()(r)},39402:function(e,t){"use strict";var n,r;t.L9=t.tX=void 0;let o=16/9;t.tX={fluid:o,"16x9":o,"16x9_portrait":9/16,letter:11/8.5,letter_portrait:8.5/11,a4:11.69/8.27,a4_portrait:8.27/11.69,square:1},(r=n||(t.L9=n={})).landscape="landscape",r.portrait="portrait"},80660:function(){}}]); 2//# sourceMappingURL=7174-e6d4128c527c7edf.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.