@llmops/app 0.1.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/LICENSE +201 -0
  2. package/dist/.vite/manifest.json +544 -0
  3. package/dist/assets/Form-BqIR54aK.js +1 -0
  4. package/dist/assets/_environment-B9slLxIM.js +1 -0
  5. package/dist/assets/_tabs-8WlaRf6k.js +1 -0
  6. package/dist/assets/_tabs-CGwO4MTn.js +1 -0
  7. package/dist/assets/_variant-COPD7jVX.js +30 -0
  8. package/dist/assets/_variant-DY7Due1K.css +1 -0
  9. package/dist/assets/_variants-D4jD1121.js +1 -0
  10. package/dist/assets/button-SaGwF9Mc.js +1 -0
  11. package/dist/assets/check-ZX167PJq.js +1 -0
  12. package/dist/assets/chevron-right-BVwp1PEQ.js +1 -0
  13. package/dist/assets/configs-Cn2mggPE.js +1 -0
  14. package/dist/assets/copy-DuziMpq3.js +1 -0
  15. package/dist/assets/environments-CDgsUGPY.js +1 -0
  16. package/dist/assets/formatDistance-BVFQcxMW.js +1 -0
  17. package/dist/assets/formatDistance-DoOD1Loz.css +1 -0
  18. package/dist/assets/index-CzBp_9q8.css +1 -0
  19. package/dist/assets/index-D11QRy5x.js +16 -0
  20. package/dist/assets/index-DVICBb7E.js +1 -0
  21. package/dist/assets/index-Dp_a_2-B.css +1 -0
  22. package/dist/assets/index-_Qxo3N29.css +1 -0
  23. package/dist/assets/index-g0mwFYMe.js +1 -0
  24. package/dist/assets/index-qZssbb5m.js +1 -0
  25. package/dist/assets/index.esm-Di60kgGW.js +1 -0
  26. package/dist/assets/new-config-state-B8sMe-TC.css +1 -0
  27. package/dist/assets/new-config-state.css-DDvxSlIO.js +1 -0
  28. package/dist/assets/plus-D8bVejky.js +1 -0
  29. package/dist/assets/route-BAJxFoUd.js +1 -0
  30. package/dist/assets/route-Cve62xlf.js +1 -0
  31. package/dist/assets/secrets-BGHMIr_s.css +1 -0
  32. package/dist/assets/secrets-Dfc4KsFB.js +1 -0
  33. package/dist/assets/settings-9UcgXAim.js +1 -0
  34. package/dist/assets/settings-BwmM525w.css +1 -0
  35. package/dist/assets/settings-CkD4z_Hv.js +1 -0
  36. package/dist/assets/settings-CvvrMdCu.css +1 -0
  37. package/dist/assets/styles-Ds0dHEK-.css +1 -0
  38. package/dist/assets/table-Drk2TD58.js +1 -0
  39. package/dist/assets/tabs.css-DM-zwDZg.js +1 -0
  40. package/dist/assets/tabs.css.ts-9m2TgQoD.css +1 -0
  41. package/dist/assets/targeting-BjdUM5MM.js +1 -0
  42. package/dist/assets/update-or-create-name-ChvLM3HZ.js +4 -0
  43. package/dist/assets/update-or-create-name-DW-QlCah.css +1 -0
  44. package/dist/assets/useButton-B0pv7V1F.js +1 -0
  45. package/dist/assets/useConfigList-C8a_Opd6.js +1 -0
  46. package/dist/assets/useConfigVariants-COgsOizX.js +1 -0
  47. package/dist/assets/useEnvironments-Byl0U2nG.js +1 -0
  48. package/dist/assets/useMutation-BfQR89Gz.js +1 -0
  49. package/dist/assets/useRole-BYxeh9v-.js +1 -0
  50. package/dist/assets/useSetTargeting-DIyb-zyZ.css +1 -0
  51. package/dist/assets/useSetTargeting-DcIQi2U_.js +1 -0
  52. package/dist/assets/useTargetingRules-BcM1fgTv.js +1 -0
  53. package/dist/assets/useValueChanged-D6EOv1Ly.js +12 -0
  54. package/dist/assets/variants-9qaqEb_G.css +1 -0
  55. package/dist/assets/variants-BiG-9VgB.js +1 -0
  56. package/dist/assets/variants.css-CN3aJiTg.js +1 -0
  57. package/dist/index.d.mts +30 -0
  58. package/dist/index.mjs +13673 -0
  59. package/package.json +84 -0
@@ -0,0 +1,30 @@
1
+ import{al as op,r as w,a0 as St,am as xs,an as uu,ao as zi,ab as Cn,a7 as st,ad as du,ap as fu,aq as ip,j as k,V as et,a8 as Ws,ar as Ui,a9 as gu,ae as pu,as as ap,at as hu,au as mu,av as Gt,aw as yu,ax as vr,a1 as _u,a2 as vu,a3 as ve,a4 as xu,a6 as bu,ai as Vs,ay as Su,a5 as Cu,az as Ki,aA as Wi,aB as En,aC as lp,P as Eu,Q as Tu,aD as bs,U as Pe,aE as Ha,aF as Ss,aG as an,aH as or,aI as cp,aJ as wu,W as ku,X as Nu,Y as Au,aK as Hs,Z as $r,aL as Pu,aM as Iu,aN as Jo,aO as up,aP as Ru,aQ as dp,aR as fp,aS as tn,aT as gp,af as Ou,$ as Er,aU as pp,aV as Vi,aW as Hi,aX as hp,aY as Fu,aZ as Mu,a_ as $u,a$ as Lu,b0 as Go,b1 as Cs,b2 as Du,b3 as mp,ah as ju,b4 as yp,b5 as qi,ag as _p,b6 as vp,b7 as xp,b8 as bp,b9 as Bu,ak as Sp,aj as zu,ba as Uu,bb as Cp,bc as Ep,bd as xo,be as Tp,bf as qa,bg as Ja,k as Ku,a as De,d as Wu,I as Vu,bh as Ga,w as wp,h as Ji,f as Hu,bi as kp,b as Np,bj as Ap}from"./index-D11QRy5x.js";import{u as qs,C as qu,a as Pp,b as Ip,g as Rp,c as Ju,d as Op,e as Fp,f as Mp,h as $p,S as Lp,i as Gi,v as Ya,j as Dp,k as jp,m as Bp,l as zp,n as Up,o as Kp,p as Wp,q as Vp,r as Hp,s as qp,t as Jp}from"./useSetTargeting-DcIQi2U_.js";import{e as Gu,i as Qt,u as Gp}from"./index.esm-Di60kgGW.js";import{F as Yu,I as Zu,i as Xu,u as Qu,a as ed,b as Yi,e as Yp,c as Zp}from"./useValueChanged-D6EOv1Ly.js";import{C as Zi,u as td,H as nd,E as rd,A as sd,a as od,b as id,c as ad}from"./useRole-BYxeh9v-.js";import{u as Xi,a as ld}from"./useButton-B0pv7V1F.js";import{C as Xp}from"./chevron-right-BVwp1PEQ.js";import{C as cd}from"./check-ZX167PJq.js";import{u as ud}from"./useMutation-BfQR89Gz.js";import{g as Qp,u as eh}from"./useConfigVariants-COgsOizX.js";import{u as th}from"./useTargetingRules-BcM1fgTv.js";import{B as bo}from"./button-SaGwF9Mc.js";import{u as nh}from"./useEnvironments-Byl0U2nG.js";/* empty css *//* empty css */function rh(n,e){if(n===void 0)return{shouldBlockFn:()=>!0,withResolver:!1};if("shouldBlockFn"in n)return n;if(typeof n=="function")return{shouldBlockFn:async()=>await n(),enableBeforeUnload:!0,withResolver:!1};const t=!!(n.condition??!0),r=n.blockerFn;return{shouldBlockFn:async()=>t&&r!==void 0?await r():t,enableBeforeUnload:t,withResolver:r===void 0}}function sh(n,e){const{shouldBlockFn:t,enableBeforeUnload:r=!0,disabled:s=!1,withResolver:o=!1}=rh(n),i=op(),{history:a}=i,[l,u]=w.useState({status:"idle",current:void 0,next:void 0,action:void 0,proceed:void 0,reset:void 0});return w.useEffect(()=>{const c=async f=>{function d(p){const _=i.parseLocation(p),C=i.getMatchedRoutes(_.pathname);return C.foundRoute===void 0?{routeId:"__notFound__",fullPath:_.pathname,pathname:_.pathname,params:C.routeParams,search:i.options.parseSearch(p.search)}:{routeId:C.foundRoute.id,fullPath:C.foundRoute.fullPath,pathname:_.pathname,params:C.routeParams,search:i.options.parseSearch(p.search)}}const h=d(f.currentLocation),g=d(f.nextLocation);if(h.routeId==="__notFound__"&&g.routeId!=="__notFound__")return!1;const m=await t({action:f.action,current:h,next:g});if(!o)return m;if(!m)return!1;const x=await new Promise(p=>{u({status:"blocked",current:h,next:g,action:f.action,proceed:()=>p(!1),reset:()=>p(!0)})});return u({status:"idle",current:void 0,next:void 0,action:void 0,proceed:void 0,reset:void 0}),x};return s?void 0:a.block({blockerFn:c,enableBeforeUnload:r})},[t,r,s,o,a,i]),l}function dd(n,e,t=(r,s)=>r===s){return n.length===e.length&&n.every((r,s)=>t(r,e[s]))}const oh=w.createContext(void 0);function Js(n=!0){const e=w.useContext(oh);if(e===void 0&&!n)throw new Error(St(25));return e}const fd=w.createContext(void 0);function Qi(n){const e=w.useContext(fd);if(e===void 0&&!n)throw new Error(St(33));return e}const gd=w.createContext(void 0);function Zt(n){const e=w.useContext(gd);if(e===void 0&&!n)throw new Error(St(36));return e}const ih={type:"regular-item"};function pd(n){const{closeOnClick:e,disabled:t=!1,highlighted:r,id:s,store:o,nativeButton:i,itemMetadata:a,nodeId:l}=n,u=w.useRef(null),c=Js(!0),f=c!==void 0,{events:d}=o.useState("floatingTreeRoot"),{getButtonProps:h,buttonRef:g}=Xi({disabled:t,focusableWhenDisabled:!0,native:i}),m=w.useCallback(x=>xs({id:s,role:"menuitem",tabIndex:r?0:-1,onMouseMove(p){l&&d.emit("itemhover",{nodeId:l,target:p.currentTarget})},onMouseEnter(){a.type==="submenu-trigger"&&a.setActive()},onKeyUp(p){p.key===" "&&o.context.typingRef.current&&p.preventBaseUIHandler()},onClick(p){e&&d.emit("close",{domEvent:p,reason:uu})},onMouseUp(p){if(c){const _=c.initialCursorPointRef.current;if(c.initialCursorPointRef.current=null,f&&_&&Math.abs(p.clientX-_.x)<=1&&Math.abs(p.clientY-_.y)<=1)return}u.current&&o.context.allowMouseUpTriggerRef.current&&(!f||p.button===2)&&a.type==="regular-item"&&u.current.click()}},x,h),[s,r,h,e,d,o,f,c,a,l]),y=zi(u,g);return w.useMemo(()=>({getItemProps:m,itemRef:y}),[m,y])}const ah=w.forwardRef(function(e,t){const{render:r,className:s,id:o,label:i,nativeButton:a=!1,disabled:l=!1,closeOnClick:u=!0,...c}=e,f=qs({label:i}),d=Qi(!0),h=Cn(o),{store:g}=Zt(),m=g.useState("isActive",f.index),y=g.useState("itemProps"),{getItemProps:x,itemRef:p}=pd({closeOnClick:u,disabled:l,highlighted:m,id:h,store:g,nativeButton:a,nodeId:d?.nodeId,itemMetadata:ih}),_=w.useMemo(()=>({disabled:l,highlighted:m}),[l,m]);return st("div",e,{state:_,props:[y,c,x],ref:[p,t,f.ref]})}),lh=w.createContext(void 0);function hd(n){return w.useContext(lh)}const ch={...Ws,...gu},Za=w.forwardRef(function(e,t){const{render:r,className:s,finalFocus:o,...i}=e,{store:a}=Zt(),{side:l,align:u}=Qi(),c=hd()!=null,f=a.useState("open"),d=a.useState("transitionStatus"),h=a.useState("popupProps"),g=a.useState("mounted"),m=a.useState("instantType"),y=a.useState("activeTriggerElement"),x=a.useState("parent"),p=a.useState("lastOpenChangeReason"),_=a.useState("rootId"),C=a.useState("floatingRootContext"),v=a.useState("floatingTreeRoot"),b=a.useState("closeDelay"),S=a.useState("activeTriggerElement");du({open:f,ref:a.context.popupRef,onComplete(){f&&a.context.onOpenChangeComplete?.(!0)}}),w.useEffect(()=>{function R(I){a.setOpen(!1,et(I.reason,I.domEvent))}return v.events.on("close",R),()=>{v.events.off("close",R)}},[v.events,a]);const T=a.useState("hoverEnabled"),E=a.useState("disabled");fu(C,{enabled:T&&!E&&x.type!=="context-menu"&&x.type!=="menubar",closeDelay:b});const N=w.useMemo(()=>({transitionStatus:d,side:l,align:u,open:f,nested:x.type==="menu",instant:m}),[d,l,u,f,x.type,m]),P=st("div",e,{state:N,ref:[t,a.context.popupRef],stateAttributesMapping:ch,props:[h,{onKeyDown(R){c&&Zi.has(R.key)&&R.stopPropagation()}},Ui(d),i,{"data-rootownerid":_}]});let M=x.type===void 0||x.type==="context-menu";return(y||x.type==="menubar"&&p!==ip)&&(M=!0),k.jsx(Yu,{context:C,modal:!1,disabled:!g,returnFocus:o===void 0?M:o,initialFocus:x.type!=="menu",restoreFocus:!0,externalTree:x.type!=="menubar"?v:void 0,previousFocusableElement:S,nextFocusableElement:x.type===void 0?a.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:x.type===void 0?a.context.beforeContentFocusGuardRef:void 0,children:P})}),md=w.createContext(void 0);function uh(){const n=w.useContext(md);if(n===void 0)throw new Error(St(32));return n}const Xa=w.forwardRef(function(e,t){const{keepMounted:r=!1,...s}=e,{store:o}=Zt();return o.useState("mounted")||r?k.jsx(md.Provider,{value:r,children:k.jsx(pu,{ref:t,...s})}):null}),Qa=w.forwardRef(function(e,t){const{anchor:r,positionMethod:s="absolute",className:o,render:i,side:a,align:l,sideOffset:u=0,alignOffset:c=0,collisionBoundary:f="clipping-ancestors",collisionPadding:d=5,arrowPadding:h=5,sticky:g=!1,disableAnchorTracking:m=!1,collisionAvoidance:y=ap,...x}=e,{store:p}=Zt(),_=uh(),C=Js(!0),v=p.useState("parent"),b=p.useState("floatingRootContext"),S=p.useState("floatingTreeRoot"),T=p.useState("mounted"),E=p.useState("open"),N=p.useState("modal"),P=p.useState("activeTriggerElement"),M=p.useState("lastOpenChangeReason"),R=p.useState("floatingNodeId"),I=p.useState("floatingParentNodeId");let D=r,L=u,F=c,j=l,B=y;v.type==="context-menu"&&(D=r??v.context?.anchor,j=j??"start",!a&&j!=="center"&&(F=e.alignOffset??2,L=e.sideOffset??-5));let G=a,Y=j;v.type==="menu"?(G=G??"inline-end",Y=Y??"start",B=e.collisionAvoidance??hu):v.type==="menubar"&&(G=G??"bottom",Y=Y??"start");const K=v.type==="context-menu",W=mu({anchor:D,floatingRootContext:b,positionMethod:C?"fixed":s,mounted:T,side:G,sideOffset:L,align:Y,alignOffset:F,arrowPadding:K?0:h,collisionBoundary:f,collisionPadding:d,sticky:g,nodeId:R,keepMounted:_,disableAnchorTracking:m,collisionAvoidance:B,shiftCrossAxis:K,externalTree:S}),V=w.useMemo(()=>{const ie={};return E||(ie.pointerEvents="none"),{role:"presentation",hidden:!T,style:{...W.positionerStyles,...ie}}},[E,T,W.positionerStyles]);w.useEffect(()=>{function ie(J){J.open?(J.parentNodeId===R&&p.set("hoverEnabled",!1),J.nodeId!==R&&J.parentNodeId===p.select("floatingParentNodeId")&&p.setOpen(!1,et(vr))):J.parentNodeId===R&&J.reason!==vr&&p.set("hoverEnabled",!0)}return S.events.on("menuopenchange",ie),()=>{S.events.off("menuopenchange",ie)}},[p,S.events,R]),w.useEffect(()=>{if(p.select("floatingParentNodeId")==null)return;function ie(J){if(J.open||J.nodeId!==p.select("floatingParentNodeId"))return;const ue=J.reason??vr;p.setOpen(!1,et(ue))}return S.events.on("menuopenchange",ie),()=>{S.events.off("menuopenchange",ie)}},[S.events,p]),w.useEffect(()=>{function ie(J){!E||J.nodeId!==p.select("floatingParentNodeId")||J.target&&P&&P!==J.target&&p.setOpen(!1,et(vr))}return S.events.on("itemhover",ie),()=>{S.events.off("itemhover",ie)}},[S.events,E,P,p]),w.useEffect(()=>{const ie={open:E,nodeId:R,parentNodeId:I,reason:p.select("lastOpenChangeReason")};S.events.emit("menuopenchange",ie)},[S.events,E,p,R,I]);const oe=w.useMemo(()=>({open:E,side:W.side,align:W.align,anchorHidden:W.anchorHidden,nested:v.type==="menu"}),[E,W.side,W.align,W.anchorHidden,v.type]),re=w.useMemo(()=>({side:W.side,align:W.align,arrowRef:W.arrowRef,arrowUncentered:W.arrowUncentered,arrowStyles:W.arrowStyles,nodeId:W.context.nodeId}),[W.side,W.align,W.arrowRef,W.arrowUncentered,W.arrowStyles,W.context.nodeId]),le=st("div",e,{state:oe,stateAttributesMapping:Ws,ref:[t,p.useStateSetter("positionerElement")],props:[V,x]}),ee=T&&v.type!=="menu"&&(v.type!=="menubar"&&N&&M!==Gt||v.type==="menubar"&&v.context.modal);let ne=null;return v.type==="menubar"?ne=v.context.contentElement:v.type===void 0&&(ne=P),k.jsxs(fd.Provider,{value:re,children:[ee&&k.jsx(Zu,{ref:v.type==="context-menu"||v.type==="nested-context-menu"?v.context.internalBackdropRef:null,inert:Xu(!E),cutout:ne}),k.jsx(yu,{id:R,children:k.jsx(qu,{elementsRef:p.context.itemDomElements,labelsRef:p.context.itemLabels,children:le})})]})}),dh=w.createContext(null);function yd(n){return w.useContext(dh)}const fh={...xu,disabled:ve(n=>n.parent.type==="menubar"&&n.parent.context.disabled||n.disabled),modal:ve(n=>(n.parent.type===void 0||n.parent.type==="context-menu")&&(n.modal??!0)),allowMouseEnter:ve(n=>n.parent.type==="menu"?n.parent.store.select("allowMouseEnter"):n.allowMouseEnter),stickIfOpen:ve(n=>n.stickIfOpen),parent:ve(n=>n.parent),rootId:ve(n=>n.parent.type==="menu"?n.parent.store.select("rootId"):n.parent.type!==void 0?n.parent.context.rootId:n.rootId),activeIndex:ve(n=>n.activeIndex),isActive:ve((n,e)=>n.activeIndex===e),hoverEnabled:ve(n=>n.hoverEnabled),instantType:ve(n=>n.instantType),lastOpenChangeReason:ve(n=>n.openChangeReason),floatingTreeRoot:ve(n=>n.parent.type==="menu"?n.parent.store.select("floatingTreeRoot"):n.floatingTreeRoot),floatingNodeId:ve(n=>n.floatingNodeId),floatingParentNodeId:ve(n=>n.floatingParentNodeId),itemProps:ve(n=>n.itemProps),closeDelay:ve(n=>n.closeDelay),keyboardEventRelay:ve(n=>{if(n.keyboardEventRelay)return n.keyboardEventRelay;if(n.parent.type==="menu")return n.parent.store.select("keyboardEventRelay")})};class ea extends _u{constructor(e){super({...gh(),...e},{positionerRef:w.createRef(),popupRef:w.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},allowMouseUpTriggerRef:{current:!1},triggerFocusTargetRef:w.createRef(),beforeContentFocusGuardRef:w.createRef(),onOpenChangeComplete:void 0,triggerElements:new vu},fh),this.observe(ve(t=>t.allowMouseEnter),(t,r)=>{this.state.parent.type==="menu"&&t!==r&&this.state.parent.store.set("allowMouseEnter",t)}),this.unsubscribeParentListener=this.observe("parent",t=>{if(this.unsubscribeParentListener?.(),t.type==="menu"){this.unsubscribeParentListener=t.store.subscribe(()=>{this.notifyAll()}),this.context.allowMouseUpTriggerRef=t.store.context.allowMouseUpTriggerRef;return}t.type!==void 0&&(this.context.allowMouseUpTriggerRef=t.context.allowMouseUpTriggerRef),this.unsubscribeParentListener=null})}setOpen(e,t){this.state.floatingRootContext.context.events.emit("setOpen",{open:e,eventDetails:t})}static useStore(e,t){return bu(()=>e??new ea(t)).current}unsubscribeParentListener=null}function gh(){return{...Cu(),disabled:!1,modal:!0,allowMouseEnter:!0,stickIfOpen:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new Su,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:Vs,keyboardEventRelay:void 0,closeDelay:0}}const _d=w.createContext(void 0);function vd(){return w.useContext(_d)}function xd(n){const{children:e,open:t,onOpenChange:r,onOpenChangeComplete:s,defaultOpen:o=!1,disabled:i=!1,modal:a,loopFocus:l=!0,orientation:u="vertical",actionsRef:c,closeParentOnEsc:f=!1,handle:d,triggerId:h,defaultTriggerId:g=null,highlightItemOnHover:m=!0}=n,y=Js(!0),x=Zt(!0),p=yd(),_=vd(),C=w.useMemo(()=>_&&x?{type:"menu",store:x.store}:p?{type:"menubar",context:p}:y&&!x?{type:"context-menu",context:y}:{type:void 0},[y,x,p,_]),v=ea.useStore(d?.store,{parent:C}),b=v.useState("floatingTreeRoot"),S=Ki(b),T=Wi();En(()=>{y&&!x?v.update({parent:{type:"context-menu",context:y},floatingNodeId:S,floatingParentNodeId:T}):x&&v.update({floatingNodeId:S,floatingParentNodeId:T})},[y,x,S,T,v]),v.useControlledProp("open",t,o),v.useControlledProp("activeTriggerId",h,g),v.useContextCallback("onOpenChangeComplete",s);const E=v.useState("open"),N=v.useState("activeTriggerElement"),P=v.useState("positionerElement"),M=v.useState("hoverEnabled"),R=v.useState("modal"),I=v.useState("disabled"),D=v.useState("lastOpenChangeReason"),L=v.useState("parent"),F=v.useState("activeIndex"),j=v.useState("payload"),B=v.useState("floatingParentNodeId"),G=w.useRef(null),Y=B!=null;let K;v.useSyncedValues({disabled:i,modal:L.type===void 0?a:void 0,rootId:lp()});const{openMethod:W,triggerProps:V,reset:oe}=Qu(E);Eu(v);const{forceUnmount:re}=Tu(E,v,()=>{v.update({allowMouseEnter:!1,stickIfOpen:!0}),oe()}),le=w.useRef(L.type!=="context-menu"),ee=bs();w.useEffect(()=>{if(E||(G.current=null),L.type==="context-menu"){if(!E){ee.clear(),le.current=!1;return}ee.start(500,()=>{le.current=!0})}},[ee,E,L.type]),ed(E&&R&&D!==Gt&&W!=="touch",P),En(()=>{!E&&!M&&v.set("hoverEnabled",!0)},[E,M,v]);const ne=w.useRef(!0),ie=bs(),J=Pe((de,X)=>{const Ce=X.reason;if(E===de&&X.trigger===N||(X.preventUnmountOnClose=()=>{v.set("preventUnmountingOnClose",!0)},!de&&X.trigger==null&&(X.trigger=N??void 0),r?.(de,X),X.isCanceled))return;const ot={open:de,nativeEvent:X.event,reason:X.reason,nested:Y};K?.emit("openchange",ot);const it=X.event;if(de===!1&&it?.type==="click"&&it.pointerType==="touch"&&!ne.current)return;if(!de&&F!==null){const Se=v.context.itemDomElements.current[F];queueMicrotask(()=>{Se?.setAttribute("tabindex","-1")})}de&&Ce===Ha?(ne.current=!1,ie.start(300,()=>{ne.current=!0})):(ne.current=!0,ie.clear());const gn=(Ce===Ss||Ce===uu)&&it.detail===0&&it?.isTrusted,Yr=!de&&(Ce===wu||Ce==null);function Ee(){const Se={open:de,openChangeReason:Ce};G.current=X.event??null;const Re=X.trigger?.id??null;(Re||de)&&(Se.activeTriggerId=Re,Se.activeTriggerElement=X.trigger??null),v.update(Se)}Ce===Gt?an.flushSync(Ee):Ee(),L.type==="menubar"&&(Ce===Ha||Ce===or||Ce===Gt||Ce===cp||Ce===vr)?v.set("instantType","group"):gn||Yr?v.set("instantType",gn?"click":"dismiss"):v.set("instantType",void 0)}),ue=w.useCallback(de=>{const X=et(de);return X.preventUnmountOnClose=()=>{v.set("preventUnmountingOnClose",!0)},X},[v]),pe=w.useCallback(()=>{v.setOpen(!1,ue(ku))},[v,ue]);w.useImperativeHandle(c,()=>({unmount:re,close:pe}),[re,pe]);let Ae;L.type==="context-menu"&&(Ae=L.context),w.useImperativeHandle(Ae?.positionerRef,()=>P,[P]),w.useImperativeHandle(Ae?.actionsRef,()=>({setOpen:J}),[J]);const q=Nu({popupStore:v,onOpenChange:J});K=q.context.events,w.useEffect(()=>{const de=({open:X,eventDetails:Ce})=>J(X,Ce);return K.on("setOpen",de),()=>{K?.off("setOpen",de)}},[K,J]);const ce=Au(q,{enabled:!I,bubbles:f&&L.type==="menu",outsidePress(){return L.type!=="context-menu"||G.current?.type==="contextmenu"?!0:le.current},externalTree:Y?b:void 0}),Z=td(q,{role:"menu"}),ae=Hs(),te=w.useCallback(de=>{v.select("activeIndex")!==de&&v.set("activeIndex",de)},[v]),Ie=Pp(q,{enabled:!I,listRef:v.context.itemDomElements,activeIndex:F,nested:L.type!==void 0,loopFocus:l,orientation:u,parentOrientation:L.type==="menubar"?L.context.orientation:void 0,rtl:ae==="rtl",disabledIndices:Jo,onNavigate:te,openOnArrowKeyDown:L.type!=="context-menu",externalTree:Y?b:void 0,focusItemOnHover:m}),ut=w.useCallback(de=>{v.context.typingRef.current=de},[v]),Ge=Ip(q,{listRef:v.context.itemLabels,activeIndex:F,resetMs:up,onMatch:de=>{E&&de!==F&&v.set("activeIndex",de)},onTypingChange:ut}),{getReferenceProps:dt,getFloatingProps:jt,getItemProps:Tt,getTriggerProps:me}=$r([ce,Z,Ie,Ge]),Bt=w.useMemo(()=>{const de=xs(dt(),{onMouseEnter(){v.set("hoverEnabled",!0)},onMouseMove(){v.set("allowMouseEnter",!0)}},V);return delete de.role,de},[dt,v,V]),Ye=w.useMemo(()=>{const de=me();if(!de)return de;const X=xs(de,V);return delete X.role,delete X["aria-controls"],X},[me,V]),We=Pu(),Ve=w.useMemo(()=>jt({onMouseEnter(){L.type==="menu"&&We.request(()=>v.set("hoverEnabled",!1))},onMouseMove(){v.set("allowMouseEnter",!0)},onClick(){v.select("hoverEnabled")&&v.set("hoverEnabled",!1)},onKeyDown(de){const X=v.select("keyboardEventRelay");X&&!de.isPropagationStopped()&&X(de)}}),[jt,L.type,We,v]),zt=w.useMemo(()=>Tt(),[Tt]);v.useSyncedValues({floatingRootContext:q,activeTriggerProps:Bt,inactiveTriggerProps:Ye,popupProps:Ve,itemProps:zt});const tt=w.useMemo(()=>({store:v,parent:C}),[v,C]),Un=k.jsx(gd.Provider,{value:tt,children:typeof e=="function"?e({payload:j}):e});return L.type===void 0||L.type==="context-menu"?k.jsx(Iu,{externalTree:b,children:Un}):Un}function ph(n){const e=Zt().store,t=w.useMemo(()=>({parentMenu:e}),[e]);return k.jsx(_d.Provider,{value:t,children:k.jsx(xd,{...n})})}function hh(n={}){const{highlightItemOnHover:e,highlightedIndex:t,onHighlightedIndexChange:r}=ld(),{ref:s,index:o}=qs(n),i=t===o,a=w.useRef(null),l=zi(s,a);return{compositeProps:w.useMemo(()=>({tabIndex:i?0:-1,onFocus(){r(o)},onMouseMove(){const c=a.current;if(!e||!c)return;const f=c.hasAttribute("disabled")||c.ariaDisabled==="true";!i&&!f&&c.focus()}}),[i,r,o,e]),compositeRef:l,index:o}}function mh(n){const{render:e,className:t,state:r=Vs,props:s=Jo,refs:o=Jo,metadata:i,stateAttributesMapping:a,tag:l="div",...u}=n,{compositeProps:c,compositeRef:f}=hh({metadata:i});return st(l,n,{state:r,ref:[...o,f],props:[c,...s,u],stateAttributesMapping:a})}function bd(n){if(Ru(n)&&n.hasAttribute("data-rootownerid"))return n.getAttribute("data-rootownerid")??void 0;if(!dp(n))return bd(fp(n))}function yh(n){const{enabled:e=!0,mouseDownAction:t,open:r}=n,s=w.useRef(!1);return w.useMemo(()=>e?{onMouseDown:o=>{(t==="open"&&!r||t==="close"&&r)&&(s.current=!0,tn(o.currentTarget).addEventListener("click",()=>{s.current=!1},{once:!0}))},onClick:o=>{s.current&&(s.current=!1,o.preventBaseUIHandler())}}:Vs,[e,t,r])}const Qr=2,_h=w.forwardRef(function(e,t){const{render:r,className:s,disabled:o=!1,nativeButton:i=!0,id:a,openOnHover:l,delay:u=100,closeDelay:c=0,handle:f,payload:d,...h}=e,g=Zt(!0),m=f?.store??g?.store;if(!m)throw new Error(St(85));const y=Cn(a),x=m.useState("isTriggerActive",y),p=m.useState("floatingRootContext"),_=m.useState("isOpenedByTrigger",y),C=w.useRef(null),v=xh(),b=ld(!0),S=gp(),T=w.useMemo(()=>S??new Su,[S]),E=Ki(T),N=Wi(),{registerTrigger:P,isMountedByThisTrigger:M}=Ou(y,C,m,{payload:d,closeDelay:c,parent:v,floatingTreeRoot:T,floatingNodeId:E,floatingParentNodeId:N,keyboardEventRelay:b?.relayKeyboardEvent}),R=m.useState("disabled"),I=o||R||v.type==="menubar"&&v.context.disabled,{getButtonProps:D,buttonRef:L}=Xi({disabled:I,native:i});w.useEffect(()=>{!_&&v.type===void 0&&(m.context.allowMouseUpTriggerRef.current=!1)},[m,_,v.type]);const F=w.useRef(null),j=bs(),B=Pe(Z=>{if(!F.current)return;j.clear(),m.context.allowMouseUpTriggerRef.current=!1;const ae=Z.target;if(Er(F.current,ae)||Er(m.select("positionerElement"),ae)||ae===F.current||ae!=null&&bd(ae)===m.select("rootId"))return;const te=Rp(F.current);Z.clientX>=te.left-Qr&&Z.clientX<=te.right+Qr&&Z.clientY>=te.top-Qr&&Z.clientY<=te.bottom+Qr||T.events.emit("close",{domEvent:Z,reason:pp})});w.useEffect(()=>{_&&m.select("lastOpenChangeReason")===Gt&&tn(F.current).addEventListener("mouseup",B,{once:!0})},[_,B,m]);const G=v.type==="menubar"&&v.context.hasSubmenuOpen,K=Vi(p,{enabled:(l??G??!1)&&!I&&v.type!=="context-menu"&&(v.type!=="menubar"||G&&!M),handleClose:Hi({blockPointerEvents:v.type!=="menubar"}),mouseOnly:!0,move:!1,restMs:v.type===void 0?u:void 0,delay:{close:c},triggerElementRef:C,externalTree:T,isActiveTrigger:x}),W=vh(_,m.select("lastOpenChangeReason")),V=Yi(p,{enabled:!I&&v.type!=="context-menu",event:_&&v.type==="menubar"?"click":"mousedown",toggle:!0,ignoreMouse:!1,stickIfOpen:v.type===void 0?W:!1}),oe=hp(p,{enabled:!I&&(v.type!=="menubar"&&_||G)}),re=yh({open:_,enabled:v.type==="menubar",mouseDownAction:"open"}),le=$r([V,oe]),ee=v.type==="menubar",ne=w.useMemo(()=>({disabled:I,open:_}),[I,_]),ie=m.useState("triggerProps",M),J=[F,t,L,P,C],ue=[le.getReferenceProps(),K??Vs,ie,{"aria-haspopup":"menu",id:y,onMouseDown:Z=>{if(m.select("open"))return;j.start(200,()=>{m.context.allowMouseUpTriggerRef.current=!0}),tn(Z.currentTarget).addEventListener("mouseup",B,{once:!0})}},ee?{role:"menuitem"}:{},re,h,D],pe=w.useRef(null),Ae=Pe(Z=>{an.flushSync(()=>{m.setOpen(!1,et(or,Z.nativeEvent,Z.currentTarget))}),Fu(pe.current)?.focus()}),q=Pe(Z=>{const ae=m.select("positionerElement");if(ae&&Mu(Z,ae))m.context.beforeContentFocusGuardRef.current?.focus();else{an.flushSync(()=>{m.setOpen(!1,et(or,Z.nativeEvent,Z.currentTarget))});let te=$u(C.current);for(;te!==null&&Er(ae,te)||te?.hasAttribute("aria-hidden");){const Ie=te;if(te=Lu(te),te===Ie)break}te?.focus()}}),ce=st("button",e,{enabled:!ee,stateAttributesMapping:Go,state:ne,ref:J,props:ue});return ee?k.jsx(mh,{tag:"button",render:r,className:s,state:ne,refs:J,props:ue,stateAttributesMapping:Go}):_?k.jsxs(w.Fragment,{children:[k.jsx(Cs,{ref:pe,onFocus:Ae},`${y}-pre-focus-guard`),k.jsx(w.Fragment,{children:ce},y),k.jsx(Cs,{ref:m.context.triggerFocusTargetRef,onFocus:q},`${y}-post-focus-guard`)]}):k.jsx(w.Fragment,{children:ce},y)});function vh(n,e){const t=bs(),[r,s]=w.useState(!1);return En(()=>{n&&e==="trigger-hover"?(s(!0),t.start(Du,()=>{s(!1)})):n||(t.clear(),s(!1))},[n,e,t]),r}function xh(){const n=Js(!0),e=Zt(!0),t=yd();return w.useMemo(()=>t?{type:"menubar",context:t}:n&&!e?{type:"context-menu",context:n}:{type:void 0},[n,e,t])}const bh=w.forwardRef(function(e,t){const{render:r,className:s,label:o,id:i,nativeButton:a=!1,openOnHover:l=!0,delay:u=100,closeDelay:c=0,disabled:f=!1,...d}=e,h=qs(),g=Qi(),{store:m}=Zt(),y=Cn(i),x=m.useState("open"),p=m.useState("floatingRootContext"),_=m.useState("floatingTreeRoot"),C=mp(y,m),v=w.useCallback(oe=>{const re=C(oe);return oe!==null&&m.select("open")&&m.select("activeTriggerId")==null&&m.update({activeTriggerId:y,activeTriggerElement:oe,closeDelay:c}),re},[C,c,m,y]),b=w.useRef(null),S=w.useCallback(oe=>{b.current=oe,m.set("activeTriggerElement",oe)},[m]),T=vd();if(!T?.parentMenu)throw new Error(St(37));m.useSyncedValue("closeDelay",c);const E=T.parentMenu,N=E.useState("itemProps"),P=E.useState("isActive",h.index),M=w.useMemo(()=>({type:"submenu-trigger",setActive:()=>E.set("activeIndex",h.index)}),[E,h.index]),R=m.useState("disabled"),I=f||R,{getItemProps:D,itemRef:L}=pd({closeOnClick:!1,disabled:I,highlighted:P,id:y,store:m,nativeButton:a,itemMetadata:M,nodeId:g?.nodeId}),F=m.useState("hoverEnabled"),j=m.useState("allowMouseEnter"),B=Vi(p,{enabled:F&&l&&!I&&j,handleClose:Hi({blockPointerEvents:!0}),mouseOnly:!0,move:!0,restMs:u,delay:{open:u,close:c},triggerElementRef:b,externalTree:_}),G=Yi(p,{enabled:!I,event:"mousedown",toggle:!l,ignoreMouse:l,stickIfOpen:!1}),Y=$r([G]),K=m.useState("triggerProps",!0);delete K.id;const W=w.useMemo(()=>({disabled:I,highlighted:P,open:x}),[I,P,x]);return st("div",e,{state:W,stateAttributesMapping:ju,props:[Y.getReferenceProps(),B,K,N,{tabIndex:x||P?0:-1,onBlur(){P&&E.set("activeIndex",null)}},d,D],ref:[t,h.ref,L,v,S]})}),el=new Map;function Sh(n,e){const t=JSON.stringify({locale:n,options:e}),r=el.get(t);if(r)return r;const s=new Intl.NumberFormat(n,e);return el.set(t,s),s}function fs(n,e,t){return n==null?"":Sh(e,t).format(n)}function Yo(n,e,t){return(n-e)*100/(t-e)}function _t(n,e=Number.MIN_SAFE_INTEGER,t=Number.MAX_SAFE_INTEGER){return Math.max(e,Math.min(n,t))}const Sd=w.createContext(void 0);function Lr(n){const e=w.useContext(Sd);if(e===void 0&&!n)throw new Error(St(47));return e}function Ch(){return{...Cu(),disabled:!1,modal:!1,instantType:void 0,openMethod:null,openChangeReason:null,titleElementId:void 0,descriptionElementId:void 0,stickIfOpen:!0,nested:!1,openOnHover:!1,closeDelay:0}}const Eh={...xu,disabled:ve(n=>n.disabled),instantType:ve(n=>n.instantType),openMethod:ve(n=>n.openMethod),openChangeReason:ve(n=>n.openChangeReason),modal:ve(n=>n.modal),stickIfOpen:ve(n=>n.stickIfOpen),titleElementId:ve(n=>n.titleElementId),descriptionElementId:ve(n=>n.descriptionElementId),openOnHover:ve(n=>n.openOnHover),closeDelay:ve(n=>n.closeDelay)};class ta extends _u{constructor(e){const t={...Ch(),...e};t.open&&e?.mounted===void 0&&(t.mounted=!0),super(t,{popupRef:w.createRef(),backdropRef:w.createRef(),internalBackdropRef:w.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:w.createRef(),beforeContentFocusGuardRef:w.createRef(),stickIfOpenTimeout:new yp,triggerElements:new vu},Eh)}setOpen=(e,t)=>{const r=t.reason===Gt,s=t.reason===Ss&&t.event.detail===0,o=!e&&(t.reason===wu||t.reason==null);if(t.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},this.context.onOpenChange?.(e,t),t.isCanceled)return;const i={open:e,nativeEvent:t.event,reason:t.reason,nested:this.state.nested,triggerElement:t.trigger};this.state.floatingRootContext.context.events?.emit("openchange",i);const l=()=>{const u={open:e,openChangeReason:t.reason},c=t.trigger?.id??null;(c||e)&&(u.activeTriggerId=c,u.activeTriggerElement=t.trigger??null),this.update(u)};r?(this.set("stickIfOpen",!0),this.context.stickIfOpenTimeout.start(Du,()=>{this.set("stickIfOpen",!1)}),an.flushSync(l)):l(),s||o?this.set("instantType",s?"click":"dismiss"):t.reason===or?this.set("instantType","focus"):this.set("instantType",void 0)};static useStore(e,t){const r=bu(()=>e??new ta(t)).current;return qi(r.disposeEffect),r}disposeEffect=()=>this.context.stickIfOpenTimeout.disposeEffect()}function tl({props:n}){const{children:e,open:t,defaultOpen:r=!1,onOpenChange:s,onOpenChangeComplete:o,modal:i=!1,handle:a,triggerId:l,defaultTriggerId:u=null}=n,c=ta.useStore(a?.store,{open:t??r,modal:i,activeTriggerId:l!==void 0?l:u});c.useControlledProp("open",t,r),c.useControlledProp("activeTriggerId",l,u);const f=c.useState("open"),d=c.useState("positionerElement"),h=c.useState("payload"),g=c.useState("openChangeReason");c.useContextCallback("onOpenChange",s),c.useContextCallback("onOpenChangeComplete",o);const{openMethod:m,triggerProps:y,reset:x}=Qu(f);Eu(c);const{forceUnmount:p}=Tu(f,c,()=>{c.update({stickIfOpen:!0,openChangeReason:null}),x()});ed(f&&i===!0&&g!==Gt&&m!=="touch",d),w.useEffect(()=>{f||c.context.stickIfOpenTimeout.clear()},[c,f]);const _=w.useCallback(D=>{const L=et(D);return L.preventUnmountOnClose=()=>{c.set("preventUnmountingOnClose",!0)},L},[c]),C=w.useCallback(()=>{c.setOpen(!1,_(ku))},[c,_]);w.useImperativeHandle(n.actionsRef,()=>({unmount:p,close:C}),[p,C]);const v=Nu({popupStore:c,onOpenChange:c.setOpen}),b=Au(v,{outsidePressEvent:{mouse:i==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}}),S=td(v),{getReferenceProps:T,getFloatingProps:E,getTriggerProps:N}=$r([b,S]),P=w.useMemo(()=>T(y),[T,y]),M=w.useMemo(()=>N(y),[N,y]),R=w.useMemo(()=>E(),[E]);c.useSyncedValues({modal:i,openMethod:m,activeTriggerProps:P,inactiveTriggerProps:M,popupProps:R,floatingRootContext:v,nested:Wi()!=null});const I=w.useMemo(()=>({store:c}),[c]);return k.jsx(Sd.Provider,{value:I,children:typeof e=="function"?e({payload:h}):e})}function Th(n){return Lr(!0)?k.jsx(tl,{props:n}):k.jsx(Iu,{children:k.jsx(tl,{props:n})})}const wh=300,nl=w.forwardRef(function(e,t){const{render:r,className:s,disabled:o=!1,nativeButton:i=!0,handle:a,payload:l,openOnHover:u=!1,delay:c=wh,closeDelay:f=0,id:d,...h}=e,g=Lr(!0),m=a?.store??g?.store;if(!m)throw new Error(St(74));const y=Cn(d),x=m.useState("isTriggerActive",y),p=m.useState("floatingRootContext"),_=m.useState("isOpenedByTrigger",y),C=w.useRef(null),{registerTrigger:v,isMountedByThisTrigger:b}=Ou(y,C,m,{payload:l,disabled:o,openOnHover:u,closeDelay:f}),S=m.useState("openChangeReason"),T=m.useState("stickIfOpen"),E=m.useState("openMethod"),N=Vi(p,{enabled:p!=null&&u&&(E!=="touch"||S!==Ss),mouseOnly:!0,move:!1,handleClose:Hi(),restMs:c,delay:{close:f},triggerElementRef:C,isActiveTrigger:x}),P=Yi(p,{enabled:p!=null,stickIfOpen:T}),M=$r([P]),R=m.useState("triggerProps",b),I=w.useMemo(()=>({disabled:o,open:_}),[o,_]),{getButtonProps:D,buttonRef:L}=Xi({disabled:o,native:i}),F=w.useMemo(()=>({open(K){return K&&S===Ss?Go.open(K):ju.open(K)}}),[S]),j=st("button",e,{state:I,ref:[L,t,v,C],props:[M.getReferenceProps(),N,R,{[_p]:"",id:y},h,D],stateAttributesMapping:F}),B=w.useRef(null),G=Pe(K=>{an.flushSync(()=>{m.setOpen(!1,et(or,K.nativeEvent,K.currentTarget))}),Fu(B.current)?.focus()}),Y=Pe(K=>{const W=m.select("positionerElement");if(W&&Mu(K,W))m.context.beforeContentFocusGuardRef.current?.focus();else{an.flushSync(()=>{m.setOpen(!1,et(or,K.nativeEvent,K.currentTarget))});let V=$u(C.current);for(;V!==null&&Er(W,V)||V?.hasAttribute("aria-hidden");){const oe=V;if(V=Lu(V),V===oe)break}V?.focus()}});return x?k.jsxs(w.Fragment,{children:[k.jsx(Cs,{ref:B,onFocus:G}),k.jsx(w.Fragment,{children:j},y),k.jsx(Cs,{ref:m.context.triggerFocusTargetRef,onFocus:Y})]}):k.jsx(w.Fragment,{children:j},y)}),Cd=w.createContext(void 0);function kh(){const n=w.useContext(Cd);if(n===void 0)throw new Error(St(45));return n}const Nh=w.forwardRef(function(e,t){const{keepMounted:r=!1,...s}=e,{store:o}=Lr();return o.useState("mounted")||r?k.jsx(Cd.Provider,{value:r,children:k.jsx(pu,{ref:t,...s,renderGuards:!1})}):null}),Ed=w.createContext(void 0);function Ah(){const n=w.useContext(Ed);if(!n)throw new Error(St(46));return n}const Ph=w.forwardRef(function(e,t){const{render:r,className:s,anchor:o,positionMethod:i="absolute",side:a="bottom",align:l="center",sideOffset:u=0,alignOffset:c=0,collisionBoundary:f="clipping-ancestors",collisionPadding:d=5,arrowPadding:h=5,sticky:g=!1,disableAnchorTracking:m=!1,collisionAvoidance:y=hu,...x}=e,{store:p}=Lr(),_=kh(),C=Ki(),v=p.useState("floatingRootContext"),b=p.useState("mounted"),S=p.useState("open"),T=p.useState("openChangeReason"),E=p.useState("activeTriggerElement"),N=p.useState("modal"),P=p.useState("positionerElement"),M=p.useState("instantType"),R=p.useState("transitionStatus"),I=w.useRef(null),D=vp(P,!1,!1),L=mu({anchor:o,floatingRootContext:v,positionMethod:i,mounted:b,side:a,sideOffset:u,align:l,alignOffset:c,arrowPadding:h,collisionBoundary:f,collisionPadding:d,sticky:g,disableAnchorTracking:m,keepMounted:_,nodeId:C,collisionAvoidance:y,adaptiveOrigin:xp}),F=w.useMemo(()=>{const W={};return S||(W.pointerEvents="none"),{role:"presentation",hidden:!b,style:{...L.positionerStyles,...W}}},[S,b,L.positionerStyles]),j=w.useMemo(()=>({props:F,...L}),[F,L]),B=v?.select("domReferenceElement");En(()=>{const W=B,V=I.current;if(W&&(I.current=W),V&&W&&W!==V){p.set("instantType",void 0);const oe=new AbortController;return D(()=>{p.set("instantType","trigger-change")},oe.signal),()=>{oe.abort()}}},[B,D,p]);const G=w.useMemo(()=>({open:S,side:j.side,align:j.align,anchorHidden:j.anchorHidden,instant:M}),[S,j.side,j.align,j.anchorHidden,M]),Y=w.useCallback(W=>{p.set("positionerElement",W)},[p]),K=st("div",e,{state:G,props:[j.props,Ui(R),x],ref:[t,Y],stateAttributesMapping:Ws});return k.jsxs(Ed.Provider,{value:j,children:[b&&N===!0&&T!==Gt&&k.jsx(Zu,{ref:p.context.internalBackdropRef,inert:Xu(!S),cutout:E}),k.jsx(yu,{id:C,children:K})]})}),Ih={...Ws,...gu},Rh=w.forwardRef(function(e,t){const{className:r,render:s,initialFocus:o,finalFocus:i,...a}=e,{store:l}=Lr(),u=Ah(),c=hd()!=null,f=Hs(),d=l.useState("open"),h=l.useState("openMethod"),g=l.useState("instantType"),m=l.useState("transitionStatus"),y=l.useState("popupProps"),x=l.useState("titleElementId"),p=l.useState("descriptionElementId"),_=l.useState("modal"),C=l.useState("mounted"),v=l.useState("openChangeReason"),b=l.useState("popupElement"),S=l.useState("payload"),T=l.useState("positionerElement"),E=l.useState("activeTriggerElement"),N=l.useState("floatingRootContext");du({open:d,ref:l.context.popupRef,onComplete(){d&&l.context.onOpenChangeComplete?.(!0)}});const P=l.useState("disabled"),M=l.useState("openOnHover"),R=l.useState("closeDelay");fu(N,{enabled:M&&!P,closeDelay:R});function I(K){return K==="touch"?l.context.popupRef.current:!0}const D=o===void 0?I:o,L=w.useMemo(()=>({open:d,side:u.side,align:u.align,instant:g,transitionStatus:m}),[d,u.side,u.align,g,m]),F=w.useCallback(K=>{l.set("popupElement",K)},[l]);function j(){N.context.events.emit("measure-layout")}function B(K,W){N.context.events.emit("measure-layout-complete",{previousDimensions:K,nextDimensions:W})}const G=w.useCallback(()=>l.context.triggerElements.size>1,[l]);bp({popupElement:b,positionerElement:T,mounted:C,content:S,enabled:G,onMeasureLayout:j,onMeasureLayoutComplete:B,side:u.side,direction:f});const Y=st("div",e,{state:L,ref:[t,l.context.popupRef,F],props:[y,{"aria-labelledby":x,"aria-describedby":p,onKeyDown(K){c&&Zi.has(K.key)&&K.stopPropagation()}},Ui(m),a],stateAttributesMapping:Ih});return k.jsx(Yu,{context:N,openInteractionType:h,modal:_==="trap-focus",disabled:!C||v===Gt,initialFocus:D,returnFocus:i,restoreFocus:"popup",previousFocusableElement:Ru(E)?E:void 0,nextFocusableElement:l.context.triggerFocusTargetRef,beforeContentFocusGuardRef:l.context.beforeContentFocusGuardRef,children:Y})});function Td(n,e){return n-e}function Oh(n,e,t){const r=n.slice();return r[e]=t,r.sort(Td)}function wd(n,e,t,r,s,o){let i=n;return i=_t(i,t,r),s&&(i=Oh(o,e,_t(i,o[e-1]||-1/0,o[e+1]||1/0))),i}function kd(n,e,t){if(!Array.isArray(n))return!0;const r=n.reduce((s,o,i,a)=>(i===a.length-1||s.push(Math.abs(o-a[i+1])),s),[]);return Math.min(...r)>=e*t}const Dr={activeThumbIndex:()=>null,max:()=>null,min:()=>null,minStepsBetweenValues:()=>null,step:()=>null,values:()=>null},Nd=w.createContext(void 0);function Gs(){const n=w.useContext(Nd);if(n===void 0)throw new Error(St(62));return n}function Fh(n){return"key"in n?Cp:Ep}function Mh(n,e){return typeof n=="number"&&typeof e=="number"?n===e:Array.isArray(n)&&Array.isArray(e)?dd(n,e):!1}const $h=w.forwardRef(function(e,t){const{"aria-labelledby":r,className:s,defaultValue:o,disabled:i=!1,id:a,format:l,largeStep:u=10,locale:c,render:f,max:d=100,min:h=0,minStepsBetweenValues:g=0,name:m,onValueChange:y,onValueCommitted:x,orientation:p="horizontal",step:_=1,thumbCollisionBehavior:C="push",thumbAlignment:v="center",value:b,...S}=e,T=Cn(a),E=Pe(y),N=Pe(x),{clearErrors:P}=Yp(),{state:M,disabled:R,name:I,setTouched:D,setDirty:L,validityData:F,shouldValidateOnChange:j,validation:B}=Ju(),{labelId:G}=Op(),Y=r??G,K=R||i,W=I??m,[V,oe]=Fp({controlled:b,default:o??h,name:"Slider"}),re=w.useRef(null),le=w.useRef(null),ee=w.useRef([]),ne=w.useRef(null),ie=w.useRef(null),J=w.useRef(-1),ue=w.useRef(null),pe=w.useRef(null),Ae=w.useRef("none"),q=Bu(l),[ce,Z]=w.useState(-1),[ae,te]=w.useState(-1),[Ie,ut]=w.useState(!1),[Ge,dt]=w.useState(()=>new Map),[jt,Tt]=w.useState([void 0,void 0]),me=Pe(X=>{Z(X),X!==-1&&te(X)});Mp({id:T,commit:B.commit,value:V,controlRef:le,name:W,getValue:()=>V}),Zp(V,()=>{P(W),j()?B.commit(V):B.commit(V,!0);const X=F.initialValue;let Ce;Array.isArray(V)&&Array.isArray(X)?Ce=!dd(V,X):Ce=V!==X,L(Ce)});const Bt=Pe(X=>{X&&(le.current=X)}),Ye=Array.isArray(V),We=w.useMemo(()=>Ye?V.slice().sort(Td):[_t(V,h,d)],[d,h,Ye,V]),Ve=Pe((X,Ce)=>{if(Number.isNaN(X)||Mh(X,V))return;const ot=Ce??et(Sp,void 0,void 0,{activeThumbIndex:-1});Ae.current=ot.reason;const it=new event.constructor(event.type,event);Object.defineProperty(it,"target",{writable:!0,value:{value:X,name:W}}),ot.event=it,pe.current=X,E(X,ot),!ot.isCanceled&&oe(X)}),zt=Pe((X,Ce,ot)=>{const it=wd(X,Ce,h,d,Ye,We);if(kd(it,_,g)){const gn=Fh(ot);Ve(it,et(gn,ot.nativeEvent,void 0,{activeThumbIndex:Ce})),D(!0);const Yr=pe.current??it;N(Yr,zu(gn,ot.nativeEvent))}});En(()=>{const X=Uu(tn(re.current));K&&X&&re.current?.contains(X)&&X.blur()},[K]),K&&ce!==-1&&me(-1);const tt=w.useMemo(()=>({...M,activeThumbIndex:ce,disabled:K,dragging:Ie,orientation:p,max:d,min:h,minStepsBetweenValues:g,step:_,values:We}),[M,ce,K,Ie,d,h,g,p,_,We]),Un=w.useMemo(()=>({active:ce,controlRef:le,disabled:K,dragging:Ie,validation:B,formatOptionsRef:q,handleInputChange:zt,indicatorPosition:jt,inset:v!=="center",labelId:Y,largeStep:u,lastUsedThumbIndex:ae,lastChangedValueRef:pe,lastChangeReasonRef:Ae,locale:c,max:d,min:h,minStepsBetweenValues:g,name:W,onValueCommitted:N,orientation:p,pressedInputRef:ne,pressedThumbCenterOffsetRef:ie,pressedThumbIndexRef:J,pressedValuesRef:ue,registerFieldControlRef:Bt,renderBeforeHydration:v==="edge",setActive:me,setDragging:ut,setIndicatorPosition:Tt,setValue:Ve,state:tt,step:_,thumbCollisionBehavior:C,thumbMap:Ge,thumbRefs:ee,values:We}),[ce,le,Y,K,Ie,B,q,zt,jt,u,ae,pe,Ae,c,d,h,g,W,N,p,ne,ie,J,ue,Bt,me,ut,Tt,Ve,tt,_,C,v,Ge,ee,We]),de=st("div",e,{state:tt,ref:[t,re],props:[{"aria-labelledby":Y,id:T,role:"group"},B.getValidationProps,S],stateAttributesMapping:Dr});return k.jsx(Nd.Provider,{value:Un,children:k.jsx(qu,{elementsRef:ee,onMapChange:dt,children:de})})});function Ad(n){const e=n.getBoundingClientRect();return{x:(e.left+e.right)/2,y:(e.top+e.bottom)/2}}function Lh(n){if(Math.abs(n)<1){const t=n.toExponential().split("e-"),r=t[0].split(".")[1];return(r?r.length:0)+parseInt(t[1],10)}const e=n.toString().split(".")[1];return e?e.length:0}function Pd(n,e,t){const r=Math.round((n-t)/e)*e+t;return Number(r.toFixed(Lh(e)))}function rl({values:n,index:e,nextValue:t,min:r,max:s,step:o,minStepsBetweenValues:i,initialValues:a}){if(n.length===0)return[];const l=n.slice(),u=o*i,c=l.length-1,f=a??n,d=r+e*u,h=s-(c-e)*u;l[e]=_t(t,d,h);for(let g=e+1;g<=c;g+=1){const m=l[g-1]+u,y=s-(c-g)*u,x=f[g]??l[g];let p=Math.max(l[g],m);x<p&&(p=Math.max(x,m)),l[g]=_t(p,m,y)}for(let g=e-1;g>=0;g-=1){const m=l[g+1]-u,y=r+g*u,x=f[g]??l[g];let p=Math.min(l[g],m);x>p&&(p=Math.min(x,m)),l[g]=_t(p,y,m)}for(let g=0;g<=c;g+=1)l[g]=Number(l[g].toFixed(12));return l}function Dh({behavior:n,values:e,currentValues:t,initialValues:r,pressedIndex:s,nextValue:o,min:i,max:a,step:l,minStepsBetweenValues:u}){const c=t??e,f=r??e;if(!(c.length>1))return{value:o,thumbIndex:0,didSwap:!1};const h=l*u;switch(n){case"swap":{const g=c[s],m=1e-7,y=c.slice(),x=y[s-1],p=y[s+1],_=x!=null?x+h:i,C=p!=null?p-h:a,v=_t(o,_,C),b=Number(v.toFixed(12));y[s]=b;const S=o>g,T=o<g,E=S&&p!=null&&o>=p-m,N=T&&x!=null&&o<=x+m;if(!E&&!N)return{value:y,thumbIndex:s,didSwap:!1};const P=E?s+1:s-1,M=y.map((L,F)=>{if(F===s)return b;const j=f[F];return j??c[F]});let R=o;E?R=Math.max(o,y[P]):R=Math.min(o,y[P]);const I=rl({values:y,index:P,nextValue:R,min:i,max:a,step:l,minStepsBetweenValues:u,initialValues:M}),D=E?P-1:P+1;if(D>=0&&D<I.length){const L=I[D-1],F=I[D+1];let j=L!=null?L+h:i;j=Math.max(j,i+D*h);let B=F!=null?F-h:a;B=Math.min(B,a-(I.length-1-D)*h);const G=_t(b,j,B);I[D]=Number(G.toFixed(12))}return{value:I,thumbIndex:P,didSwap:!0}}case"push":return{value:rl({values:c,index:s,nextValue:o,min:i,max:a,step:l,minStepsBetweenValues:u}),thumbIndex:s,didSwap:!1};case"none":default:{const g=c.slice(),m=g[s-1],y=g[s+1],x=m!=null?m+h:i,p=y!=null?y-h:a,_=_t(o,x,p);return g[s]=Number(_.toFixed(12)),{value:g,thumbIndex:s,didSwap:!1}}}}const jh=2;function Bh(n,e){if(!n)return{start:0,end:0};function t(o){const i=o!=null?parseFloat(o):0;return Number.isNaN(i)?0:i}const r=e?"Top":"InlineStart",s=e?"Bottom":"InlineEnd";return{start:t(n[`border${r}Width`])+t(n[`padding${r}`]),end:t(n[`border${s}Width`])+t(n[`padding${s}`])}}function es(n,e){if(e.current!=null&&n.changedTouches){const t=n;for(let r=0;r<t.changedTouches.length;r+=1){const s=t.changedTouches[r];if(s.identifier===e.current)return{x:s.clientX,y:s.clientY}}return null}return{x:n.clientX,y:n.clientY}}const zh=w.forwardRef(function(e,t){const{render:r,className:s,...o}=e,{disabled:i,dragging:a,validation:l,inset:u,lastChangedValueRef:c,lastChangeReasonRef:f,max:d,min:h,minStepsBetweenValues:g,onValueCommitted:m,orientation:y,pressedInputRef:x,pressedThumbCenterOffsetRef:p,pressedThumbIndexRef:_,pressedValuesRef:C,registerFieldControlRef:v,renderBeforeHydration:b,setActive:S,setDragging:T,setValue:E,state:N,step:P,thumbCollisionBehavior:M,thumbRefs:R,values:I}=Gs(),D=Hs(),L=I.length>1,F=y==="vertical",j=w.useRef(null),B=w.useRef(null),G=Pe(q=>{q&&B.current==null&&B.current==null&&(B.current=getComputedStyle(q))}),Y=w.useRef(null),K=w.useRef(0),W=w.useRef(0),V=Bu(I),oe=Pe(q=>{_.current!==q&&(_.current=q);const ce=R.current[q];if(!ce){p.current=null,x.current=null;return}x.current=ce.querySelector('input[type="range"]')}),re=Pe(q=>{const ce=j.current;if(!ce)return null;const{width:Z,height:ae,bottom:te,left:Ie,right:ut}=ce.getBoundingClientRect(),Ge=Bh(B.current,F),dt=W.current,jt=(F?ae:Z)-Ge.start-Ge.end-dt*2,Tt=p.current??0,me=q.x-Tt,Bt=q.y-Tt,Ye=F?te-Bt-Ge.end:(D==="rtl"?ut-me:me-Ie)-Ge.start,We=_t((Ye-dt)/jt,0,1);let Ve=(d-h)*We+h;if(Ve=Pd(Ve,P,h),Ve=_t(Ve,h,d),!L)return{value:Ve,thumbIndex:0,didSwap:!1};const zt=_.current;if(zt<0)return null;const tt=Dh({behavior:M,values:I,currentValues:V.current??I,initialValues:C.current,pressedIndex:zt,nextValue:Ve,min:h,max:d,step:P,minStepsBetweenValues:g});return M==="swap"&&tt.didSwap?oe(tt.thumbIndex):_.current=tt.thumbIndex,tt}),le=Pe(q=>{C.current=L?I.slice():null,V.current=I;const ce=_.current;let Z=ce;if(ce>-1&&ce<I.length){if(I[ce]===d){let ae=ce;for(;ae>0&&I[ae-1]===d;)ae-=1;Z=ae}}else{const ae=F?"y":"x";let te;Z=-1;for(let Ie=0;Ie<R.current.length;Ie+=1){const ut=R.current[Ie];if(xo(ut)){const Ge=Ad(ut),dt=Math.abs(q[ae]-Ge[ae]);(te===void 0||dt<=te)&&(Z=Ie,te=dt)}}}if(Z>-1&&Z!==ce&&oe(Z),u){const ae=R.current[Z];if(xo(ae)){const te=ae.getBoundingClientRect(),Ie=F?"height":"width";W.current=te[Ie]/2}}}),ee=Pe(q=>{R.current?.[q]?.querySelector('input[type="range"]')?.focus({preventScroll:!0})}),ne=Pe(q=>{const ce=es(q,Y);if(ce==null)return;if(K.current+=1,q.type==="pointermove"&&q.buttons===0){ie(q);return}const Z=re(ce);Z!=null&&kd(Z.value,P,g)&&(!a&&K.current>jh&&T(!0),E(Z.value,et(Tp,q,void 0,{activeThumbIndex:Z.thumbIndex})),V.current=Array.isArray(Z.value)?Z.value:[Z.value],Z.didSwap&&ee(Z.thumbIndex))});function ie(q){S(-1),T(!1),x.current=null,p.current=null,_.current=-1;const ce=es(q,Y),Z=ce!=null?re(ce):null;if(Z!=null){const ae=f.current;l.commit(c.current??Z.value),m(c.current??Z.value,zu(ae,q))}"pointerType"in q&&j.current?.hasPointerCapture(q.pointerId)&&j.current?.releasePointerCapture(q.pointerId),Y.current=null,C.current=null,ue()}const J=Pe(q=>{if(i)return;const ce=q.changedTouches[0];ce!=null&&(Y.current=ce.identifier);const Z=es(q,Y);if(Z!=null){le(Z);const te=re(Z);if(te==null)return;ee(te.thumbIndex),E(te.value,et(qa,q,void 0,{activeThumbIndex:te.thumbIndex})),V.current=Array.isArray(te.value)?te.value:[te.value],te.didSwap&&ee(te.thumbIndex)}K.current=0;const ae=tn(j.current);ae.addEventListener("touchmove",ne,{passive:!0}),ae.addEventListener("touchend",ie,{passive:!0})}),ue=Pe(()=>{const q=tn(j.current);q.removeEventListener("pointermove",ne),q.removeEventListener("pointerup",ie),q.removeEventListener("touchmove",ne),q.removeEventListener("touchend",ie),C.current=null}),pe=Pu();return w.useEffect(()=>{const q=j.current;return q?(q.addEventListener("touchstart",J,{passive:!0}),()=>{q.removeEventListener("touchstart",J),pe.cancel(),ue()}):()=>ue()},[ue,J,j,pe]),w.useEffect(()=>{i&&ue()},[i,ue]),st("div",e,{state:N,ref:[t,v,j,G],props:[{"data-base-ui-slider-control":b?"":void 0,onPointerDown(q){const ce=j.current;if(!ce||i||q.defaultPrevented||!xo(q.target)||q.button!==0)return;const Z=es(q,Y);if(Z!=null){le(Z);const te=re(Z);if(te==null)return;Er(R.current[te.thumbIndex],Uu(tn(ce)))?q.preventDefault():pe.request(()=>{ee(te.thumbIndex)}),T(!0),p.current!=null||(E(te.value,et(qa,q.nativeEvent,void 0,{activeThumbIndex:te.thumbIndex})),V.current=Array.isArray(te.value)?te.value:[te.value],te.didSwap&&ee(te.thumbIndex))}q.nativeEvent.pointerId&&ce.setPointerCapture(q.nativeEvent.pointerId),K.current=0;const ae=tn(j.current);ae.addEventListener("pointermove",ne,{passive:!0}),ae.addEventListener("pointerup",ie,{once:!0})},tabIndex:-1},o],stateAttributesMapping:Dr})}),Uh=w.forwardRef(function(e,t){const{render:r,className:s,...o}=e,{state:i}=Gs();return st("div",e,{state:i,ref:t,props:[{style:{position:"relative"}},o],stateAttributesMapping:Dr})});let Kh=(function(n){return n.index="data-index",n.dragging="data-dragging",n.orientation="data-orientation",n.disabled="data-disabled",n.readonly="data-readonly",n.required="data-required",n.valid="data-valid",n.invalid="data-invalid",n.touched="data-touched",n.dirty="data-dirty",n.focused="data-focused",n})({});const Wh='!function(){const t=document.currentScript?.parentElement;if(!t)return;const e=t.closest("[data-base-ui-slider-control]");if(!e)return;const r=e.querySelector("[data-base-ui-slider-indicator]"),i=e.getBoundingClientRect(),n="vertical"===e.getAttribute("data-orientation")?"height":"width",o=e.querySelectorAll(\'input[type="range"]\'),l=o.length>1,s=o.length-1;let a=null,u=null;for(let t=0;t<o.length;t+=1){const e=o[t],y=parseFloat(e.getAttribute("value")??"");if(Number.isNaN(y))return;const c=e.parentElement;if(!c)return;const p=parseFloat(e.getAttribute("max")??"100"),g=parseFloat(e.getAttribute("min")??"0"),b=c?.getBoundingClientRect(),d=i[n]-b[n],m=100*(y-g)/(p-g),v=(b[n]/2+d*m/100)/i[n]*100;c.style.setProperty("--position",`${v}%`),Number.isFinite(v)&&(c.style.removeProperty("visibility"),r&&(0===t?(a=v,r.style.setProperty("--start-position",`${v}%`),l||r.style.removeProperty("visibility")):t===s&&(u=v-(a??0),r.style.setProperty("--end-position",`${v}%`),r.style.setProperty("--relative-size",`${u}%`),r.style.removeProperty("visibility"))))}}();',Id="PageUp",Rd="PageDown",Vh=new Set([ad,od,sd,id,nd,rd,Id,Rd]);function Hh(n,e,t,r){if(!(e<0))return n.length===2?e===0?`${fs(n[e],r,t)} start range`:`${fs(n[e],r,t)} end range`:t?fs(n[e],r,t):void 0}function Kn(n,e,t,r,s){return t===1?Math.min(n+e,s):Math.max(n-e,r)}const qh=w.forwardRef(function(e,t){const{render:r,children:s,className:o,"aria-describedby":i,"aria-label":a,"aria-labelledby":l,disabled:u=!1,getAriaLabel:c,getAriaValueText:f,id:d,index:h,inputRef:g,onBlur:m,onFocus:y,onKeyDown:x,tabIndex:p,..._}=e,C=Cn(d),{active:v,lastUsedThumbIndex:b,controlRef:S,disabled:T,validation:E,formatOptionsRef:N,handleInputChange:P,inset:M,labelId:R,largeStep:I,locale:D,max:L,min:F,minStepsBetweenValues:j,name:B,orientation:G,pressedInputRef:Y,pressedThumbCenterOffsetRef:K,pressedThumbIndexRef:W,renderBeforeHydration:V,setActive:oe,setIndicatorPosition:re,state:le,step:ee,values:ne}=Gs(),ie=Hs(),J=u||T,ue=ne.length>1,pe=G==="vertical",Ae=ie==="rtl",{setTouched:q,setFocused:ce,validationMode:Z}=Ju(),ae=w.useRef(null),te=w.useRef(null),Ie=Cn(),ut=$p(),Ge=ue?Ie:ut,dt=w.useMemo(()=>({inputId:Ge}),[Ge]),{ref:jt,index:Tt}=qs({metadata:dt}),me=ue?h??Tt:0,Bt=me===ne.length-1,Ye=ne[me],We=Yo(Ye,F,L),[Ve,zt]=w.useState(!1),[tt,Un]=w.useState();qi(()=>zt(!0));const de=b>=0&&b<ne.length?b:-1,X=Pe(()=>{const Ee=S.current,Se=ae.current;if(!Ee||!Se)return;const Re=Se.getBoundingClientRect(),Zr=Ee.getBoundingClientRect(),Xr=pe?"height":"width",sp=Zr[Xr]-Re[Xr],_o=(Re[Xr]/2+sp*We/100)/Zr[Xr]*100;Un(_o),me===0?re(vo=>[_o,vo[1]]):Bt&&re(vo=>[vo[0],_o])});En(()=>{M&&queueMicrotask(X)},[X,M]),En(()=>{M&&X()},[X,M,We]);const Ce=w.useCallback(()=>{const Ee=pe?"bottom":"insetInlineStart",Se=pe?"left":"top";let Re;return ue?v===me?Re=2:de===me&&(Re=1):v===me&&(Re=1),M?{"--position":`${tt}%`,visibility:V&&!Ve||tt===void 0?"hidden":void 0,position:"absolute",[Ee]:"var(--position)",[Se]:"50%",translate:`${(pe||!Ae?-1:1)*50}% ${(pe?1:-1)*50}%`,zIndex:Re}:Number.isFinite(We)?{position:"absolute",[Ee]:`${We}%`,[Se]:"50%",translate:`${(pe||!Ae?-1:1)*50}% ${(pe?1:-1)*50}%`,zIndex:Re}:Ja},[v,me,M,Ve,tt,ue,V,Ae,de,We,pe]);let ot;G==="vertical"&&(ot=Ae?"vertical-rl":"vertical-lr");const it=xs({"aria-label":typeof c=="function"?c(me):a,"aria-labelledby":l??R,"aria-describedby":i,"aria-orientation":G,"aria-valuenow":Ye,"aria-valuetext":typeof f=="function"?f(fs(Ye,D,N.current??void 0),Ye,me):Hh(ne,me,N.current??void 0,D),disabled:J,id:Ge,max:L,min:F,name:B,onChange(Ee){P(Ee.target.valueAsNumber,me,Ee)},onFocus(){oe(me),ce(!0)},onBlur(){ae.current&&(oe(-1),q(!0),ce(!1),Z==="onBlur"&&E.commit(wd(Ye,me,F,L,ue,ne)))},onKeyDown(Ee){if(!Vh.has(Ee.key))return;Zi.has(Ee.key)&&Ee.stopPropagation();let Se=null;const Re=Pd(Ye,ee,F);switch(Ee.key){case ad:Se=Kn(Re,Ee.shiftKey?I:ee,1,F,L);break;case id:Se=Kn(Re,Ee.shiftKey?I:ee,Ae?-1:1,F,L);break;case od:Se=Kn(Re,Ee.shiftKey?I:ee,-1,F,L);break;case sd:Se=Kn(Re,Ee.shiftKey?I:ee,Ae?1:-1,F,L);break;case Id:Se=Kn(Re,I,1,F,L);break;case Rd:Se=Kn(Re,I,-1,F,L);break;case rd:Se=L,ue&&(Se=Number.isFinite(ne[me+1])?ne[me+1]-ee*j:L);break;case nd:Se=F,ue&&(Se=Number.isFinite(ne[me-1])?ne[me-1]+ee*j:F);break}Se!==null&&(P(Se,me,Ee),Ee.preventDefault())},step:ee,style:{...Ja,width:"100%",height:"100%",writingMode:ot},tabIndex:p??void 0,type:"range",value:Ye??""},E.getInputValidationProps),gn=zi(te,E.inputRef,g);return st("div",e,{state:le,ref:[t,jt,ae],props:[{[Kh.index]:me,children:k.jsxs(w.Fragment,{children:[s,k.jsx("input",{ref:gn,...it}),M&&!Ve&&V&&Bt&&k.jsx("script",{dangerouslySetInnerHTML:{__html:Wh},suppressHydrationWarning:!0})]}),id:C,onBlur:m,onFocus:y,onPointerDown(Ee){if(W.current=me,ae.current!=null){const Se=G==="horizontal"?"x":"y",Re=Ad(ae.current),Zr=(G==="horizontal"?Ee.clientX:Ee.clientY)-Re[Se];K.current=Zr}te.current!=null&&Y.current!==te.current&&(Y.current=te.current)},style:Ce(),suppressHydrationWarning:V||void 0,tabIndex:-1},_],stateAttributesMapping:Dr})});function Jh(n,e,t,r,s,o){const i=t===void 0||e&&r===void 0?"hidden":void 0,a=n?"bottom":"insetInlineStart",l=n?"height":"width",c={visibility:s&&!o?"hidden":i,position:n?"absolute":"relative",[n?"width":"height"]:"inherit"};return c["--start-position"]=`${t??0}%`,e?(c["--relative-size"]=`${(r??0)-(t??0)}%`,c[a]="var(--start-position)",c[l]="var(--relative-size)",c):(c[a]=0,c[l]="var(--start-position)",c)}function Gh(n,e,t,r){const s=n?"bottom":"insetInlineStart",o=n?"height":"width",a={position:n?"absolute":"relative",[n?"width":"height"]:"inherit"};if(!e)return a[s]=0,a[o]=`${t}%`,a;const l=r-t;return a[s]=`${t}%`,a[o]=`${l}%`,a}const Yh=w.forwardRef(function(e,t){const{render:r,className:s,...o}=e,{indicatorPosition:i,inset:a,max:l,min:u,orientation:c,renderBeforeHydration:f,state:d,values:h}=Gs(),[g,m]=w.useState(!1);qi(()=>m(!0));const y=c==="vertical",x=h.length>1,p=a?Jh(y,x,i[0],i[1],f,g):Gh(y,x,Yo(h[0],u,l),Yo(h[h.length-1],u,l));return st("div",e,{state:d,ref:t,props:[{"data-base-ui-slider-indicator":f?"":void 0,style:p,suppressHydrationWarning:f||void 0},o],stateAttributesMapping:Dr})});const Zh=[["path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z",key:"l5xja"}],["path",{d:"M9 13a4.5 4.5 0 0 0 3-4",key:"10igwf"}],["path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5",key:"105sqy"}],["path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396",key:"ql3yin"}],["path",{d:"M6 18a4 4 0 0 1-1.967-.516",key:"2e4loj"}],["path",{d:"M12 13h4",key:"1ku699"}],["path",{d:"M12 18h6a2 2 0 0 1 2 2v1",key:"105ag5"}],["path",{d:"M12 8h8",key:"1lhi5i"}],["path",{d:"M16 8V5a2 2 0 0 1 2-2",key:"u6izg6"}],["circle",{cx:"16",cy:"13",r:".5",key:"ry7gng"}],["circle",{cx:"18",cy:"3",r:".5",key:"1aiba7"}],["circle",{cx:"20",cy:"21",r:".5",key:"yhc1fs"}],["circle",{cx:"20",cy:"8",r:".5",key:"1e43v0"}]],Xh=Ku("brain-circuit",Zh);const Qh=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Od=Ku("chevron-down",Qh);var em="_1ffqjcq4",tm="_1ffqjcq5";function Fd(n){const e=De.c(9),{children:t,open:r,defaultOpen:s,onOpenChange:o,modal:i,preventCloseOnNestedPortals:a}=n,l=i===void 0?!1:i,u=a===void 0?!0:a;let c;e[0]!==o||e[1]!==u?(c=(h,g)=>{if(!h&&u&&g.reason==="outside-press"&&g.event){const m=g.event.target;if(m?.closest("[data-open]")||m?.closest('[role="listbox"]')||m?.closest('[role="option"]')){g.cancel?.();return}}o?.(h)},e[0]=o,e[1]=u,e[2]=c):c=e[2];const f=c;let d;return e[3]!==t||e[4]!==s||e[5]!==f||e[6]!==l||e[7]!==r?(d=k.jsx(Th,{open:r,defaultOpen:s,onOpenChange:f,modal:l,children:t}),e[3]=t,e[4]=s,e[5]=f,e[6]=l,e[7]=r,e[8]=d):d=e[8],d}function Md(n){const e=De.c(6),{children:t,className:r,asChild:s}=n;if(s&&w.isValidElement(t)){let i;return e[0]!==t||e[1]!==r?(i=k.jsx(nl,{render:t,className:r,children:t}),e[0]=t,e[1]=r,e[2]=i):i=e[2],i}let o;return e[3]!==t||e[4]!==r?(o=k.jsx(nl,{className:r,children:t}),e[3]=t,e[4]=r,e[5]=o):o=e[5],o}function $d(n){const e=De.c(11),{children:t,className:r,sideOffset:s,align:o,side:i,positionMethod:a}=n,l=s===void 0?8:s,u=o===void 0?"center":o,c=i===void 0?"bottom":i,f=a===void 0?"absolute":a;let d;e[0]!==r?(d=Wu(tm,r),e[0]=r,e[1]=d):d=e[1];let h;e[2]!==t||e[3]!==d?(h=k.jsx(Rh,{className:d,children:t}),e[2]=t,e[3]=d,e[4]=h):h=e[4];let g;return e[5]!==u||e[6]!==f||e[7]!==c||e[8]!==l||e[9]!==h?(g=k.jsx(Nh,{children:k.jsx(Ph,{className:em,sideOffset:l,align:u,side:c,positionMethod:f,children:h})}),e[5]=u,e[6]=f,e[7]=c,e[8]=l,e[9]=h,e[10]=g):g=e[10],g}var nm="vpj4en0",rm="vpj4en1",sm="vpj4en2",om="vpj4en3",im="vpj4en4",am="vpj4en5",lm="vpj4en6";function ts(n){const e=De.c(25),{label:t,value:r,defaultValue:s,min:o,max:i,step:a,onValueChange:l,onValueCommitted:u,disabled:c,className:f,showValue:d,formatValue:h}=n,g=o===void 0?0:o,m=i===void 0?100:i,y=a===void 0?1:a,x=c===void 0?!1:c,p=d===void 0?!0:d;let _;e[0]!==l?(_=I=>{typeof I=="number"?l?.(I):Array.isArray(I)&&l?.(I[0])},e[0]=l,e[1]=_):_=e[1];const C=_;let v;e[2]!==u?(v=I=>{typeof I=="number"?u?.(I):Array.isArray(I)&&u?.(I[0])},e[2]=u,e[3]=v):v=e[3];const b=v,S=r??s??g;let T;e[4]!==S||e[5]!==h?(T=h?h(S):String(S),e[4]=S,e[5]=h,e[6]=T):T=e[6];const E=T;let N;e[7]!==f?(N=Wu(nm,f),e[7]=f,e[8]=N):N=e[8];let P;e[9]!==E||e[10]!==t||e[11]!==p?(P=(t||p)&&k.jsxs("div",{className:rm,children:[t&&k.jsx("span",{children:t}),p&&k.jsx("span",{className:sm,children:E})]}),e[9]=E,e[10]=t,e[11]=p,e[12]=P):P=e[12];let M;e[13]===Symbol.for("react.memo_cache_sentinel")?(M=k.jsx(zh,{className:om,children:k.jsxs(Uh,{className:im,children:[k.jsx(Yh,{className:am}),k.jsx(qh,{className:lm})]})}),e[13]=M):M=e[13];let R;return e[14]!==s||e[15]!==x||e[16]!==C||e[17]!==b||e[18]!==m||e[19]!==g||e[20]!==y||e[21]!==P||e[22]!==N||e[23]!==r?(R=k.jsxs($h,{value:r,defaultValue:s,min:g,max:m,step:y,onValueChange:C,onValueCommitted:b,disabled:x,className:N,children:[P,M]}),e[14]=s,e[15]=x,e[16]=C,e[17]=b,e[18]=m,e[19]=g,e[20]=y,e[21]=P,e[22]=N,e[23]=r,e[24]=R):R=e[24],R}var cm="_7ucatj0",um="_7ucatj1",dm="_7ucatj2",sl="_7ucatj3",ol="_7ucatj4",il="_7ucatj5",al="_7ucatj6",ll="_7ucatj7",cl="_7ucatj8",ul="_7ucatj9",dl="_7ucatja",fm="_7ucatjb",gm="_7ucatjc",pm="_7ucatjd",hm="_7ucatje",mm="_7ucatjf",ym="_7ucatjg",_m="_7ucatjh",vm="_7ucatji";function xm(n){const e=De.c(69),{isNewVariant:t,onSave:r,isSaving:s}=n,o=s===void 0?!1:s,[i,a]=w.useState(!1),[l,u]=w.useState(t?"new_variant":"new_version"),[c,f]=w.useState(!1),[d,h]=w.useState(null),{data:g}=nh();let m;e[0]!==g?(m=g===void 0?[]:g,e[0]=g,e[1]=m):m=e[1];const y=m;let x;e[2]!==c||e[3]!==l||e[4]!==r||e[5]!==d?.id?(x=()=>{r({mode:l,deployToEnvironment:c,environmentId:c?d?.id??null:null}),a(!1)},e[2]=c,e[3]=l,e[4]=r,e[5]=d?.id,e[6]=x):x=e[6];const p=x;let _;e[7]!==t?(_=q=>{a(q),q&&(u(t?"new_variant":"new_version"),f(!1),h(null))},e[7]=t,e[8]=_):_=e[8];const C=_;let v;e[9]===Symbol.for("react.memo_cache_sentinel")?(v=k.jsx(Vu,{icon:Lp,size:"xs"}),e[9]=v):v=e[9];const b=o?"Saving...":"Save";let S;e[10]!==o||e[11]!==b?(S=k.jsx(Md,{asChild:!0,children:k.jsxs(bo,{variant:"primary",size:"default",type:"button",disabled:o,children:[v,b]})}),e[10]=o,e[11]=b,e[12]=S):S=e[12];let T;e[13]===Symbol.for("react.memo_cache_sentinel")?(T=k.jsx("div",{className:um,children:"Save Options"}),e[13]=T):T=e[13];const E=`${sl} ${l==="new_variant"?ol:""}`;let N,P;e[14]===Symbol.for("react.memo_cache_sentinel")?(N=()=>u("new_variant"),P=q=>q.key==="Enter"&&u("new_variant"),e[14]=N,e[15]=P):(N=e[14],P=e[15]);const M=l==="new_variant",R=`${il} ${l==="new_variant"?al:""}`;let I;e[16]!==l?(I=l==="new_variant"&&k.jsx("div",{className:ll}),e[16]=l,e[17]=I):I=e[17];let D;e[18]!==R||e[19]!==I?(D=k.jsx("div",{className:R,children:I}),e[18]=R,e[19]=I,e[20]=D):D=e[20];let L;e[21]===Symbol.for("react.memo_cache_sentinel")?(L=k.jsxs("div",{className:cl,children:[k.jsx("span",{className:ul,children:"Save as new variant"}),k.jsx("span",{className:dl,children:"Creates a new variant with version 1"})]}),e[21]=L):L=e[21];let F;e[22]!==E||e[23]!==M||e[24]!==D?(F=k.jsxs("div",{className:E,onClick:N,onKeyDown:P,role:"radio","aria-checked":M,tabIndex:0,children:[D,L]}),e[22]=E,e[23]=M,e[24]=D,e[25]=F):F=e[25];let j;e[26]!==t||e[27]!==l?(j=!t&&k.jsxs("div",{className:`${sl} ${l==="new_version"?ol:""}`,onClick:()=>u("new_version"),onKeyDown:q=>q.key==="Enter"&&u("new_version"),role:"radio","aria-checked":l==="new_version",tabIndex:0,children:[k.jsx("div",{className:`${il} ${l==="new_version"?al:""}`,children:l==="new_version"&&k.jsx("div",{className:ll})}),k.jsxs("div",{className:cl,children:[k.jsx("span",{className:ul,children:"Update as new version"}),k.jsx("span",{className:dl,children:"Creates a new version of this variant"})]})]}),e[26]=t,e[27]=l,e[28]=j):j=e[28];let B;e[29]!==F||e[30]!==j?(B=k.jsxs("div",{className:dm,children:[F,j]}),e[29]=F,e[30]=j,e[31]=B):B=e[31];const G=`${pm} ${c?hm:""}`;let Y,K;e[32]!==c?(Y=()=>f(!c),K=q=>q.key==="Enter"&&f(!c),e[32]=c,e[33]=Y,e[34]=K):(Y=e[33],K=e[34]);let W;e[35]!==c?(W=c&&k.jsx(cd,{className:mm}),e[35]=c,e[36]=W):W=e[36];let V;e[37]!==c||e[38]!==G||e[39]!==Y||e[40]!==K||e[41]!==W?(V=k.jsx("div",{className:G,onClick:Y,onKeyDown:K,role:"checkbox","aria-checked":c,tabIndex:0,children:W}),e[37]=c,e[38]=G,e[39]=Y,e[40]=K,e[41]=W,e[42]=V):V=e[42];let oe;e[43]!==c?(oe=k.jsx("span",{className:ym,onClick:()=>f(!c),children:"Deploy to environment"}),e[43]=c,e[44]=oe):oe=e[44];let re;e[45]!==V||e[46]!==oe?(re=k.jsxs("div",{className:gm,children:[V,oe]}),e[45]=V,e[46]=oe,e[47]=re):re=e[47];let le;e[48]!==c||e[49]!==y||e[50]!==d?(le=c&&k.jsx("div",{className:_m,children:k.jsx(Gi,{items:y,value:d,onValueChange:h,itemToString:bm,placeholder:"Select environment"})}),e[48]=c,e[49]=y,e[50]=d,e[51]=le):le=e[51];let ee;e[52]!==re||e[53]!==le?(ee=k.jsxs("div",{className:fm,children:[re,le]}),e[52]=re,e[53]=le,e[54]=ee):ee=e[54];let ne;e[55]===Symbol.for("react.memo_cache_sentinel")?(ne=k.jsx(bo,{variant:"ghost",scheme:"gray",size:"sm",type:"button",onClick:()=>a(!1),children:"Cancel"}),e[55]=ne):ne=e[55];const ie=o||c&&!d,J=o?"Saving...":"Confirm";let ue;e[56]!==p||e[57]!==ie||e[58]!==J?(ue=k.jsxs("div",{className:vm,children:[ne,k.jsx(bo,{variant:"primary",size:"sm",type:"button",onClick:p,disabled:ie,children:J})]}),e[56]=p,e[57]=ie,e[58]=J,e[59]=ue):ue=e[59];let pe;e[60]!==B||e[61]!==ee||e[62]!==ue?(pe=k.jsx($d,{side:"bottom",align:"end",sideOffset:4,children:k.jsxs("div",{className:cm,children:[T,B,ee,ue]})}),e[60]=B,e[61]=ee,e[62]=ue,e[63]=pe):pe=e[63];let Ae;return e[64]!==C||e[65]!==i||e[66]!==pe||e[67]!==S?(Ae=k.jsxs(Fd,{open:i,onOpenChange:C,children:[S,pe]}),e[64]=C,e[65]=i,e[66]=pe,e[67]=S,e[68]=Ae):Ae=e[68],Ae}function bm(n){return n?.name||""}const Ld=w.createContext(null);function Sm(n,e){return{getTheme:function(){return e??null}}}function Je(){const n=w.useContext(Ld);return n==null&&(function(e,...t){const r=new URL("https://lexical.dev/docs/error"),s=new URLSearchParams;s.append("code",e);for(const o of t)s.append("v",o);throw r.search=s.toString(),Error(`Minified Lexical error #${e}; visit ${r.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)})(8),n}function $(n,...e){const t=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",n);for(const s of e)r.append("v",s);throw t.search=r.toString(),Error(`Minified Lexical error #${n}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function Dd(n,...e){const t=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",n);for(const s of e)r.append("v",s);t.search=r.toString(),console.warn(`Minified Lexical warning #${n}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}const Ct=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,Cm=Ct&&"documentMode"in document?document.documentMode:null,yt=Ct&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),Tn=Ct&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),Es=!(!Ct||!("InputEvent"in window)||Cm)&&"getTargetRanges"in new window.InputEvent("input"),jr=Ct&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),cr=Ct&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,Em=Ct&&/Android/.test(navigator.userAgent),jd=Ct&&/^(?=.*Chrome).*/i.test(navigator.userAgent),fl=Ct&&Em&&jd,Br=Ct&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&yt&&!jd;function Bd(...n){const e=[];for(const t of n)if(t&&typeof t=="string")for(const[r]of t.matchAll(/\S+/g))e.push(r);return e}const Tm=0,wm=1,km=2,zd=128,Nm=1,Am=2,Pm=3,Im=4,Rm=5,Om=6,Ys=jr||cr||Br?" ":"​",ln=`
2
+
3
+ `,Fm=Tn?" ":Ys,wn={bold:1,capitalize:1024,code:16,highlight:zd,italic:2,lowercase:256,strikethrough:4,subscript:32,superscript:64,underline:8,uppercase:512},Mm={directionless:1,unmergeable:2},gl={center:2,end:6,justify:4,left:1,right:3,start:5},$m={[Am]:"center",[Om]:"end",[Im]:"justify",[Nm]:"left",[Pm]:"right",[Rm]:"start"},Lm={normal:0,segmented:2,token:1},Dm={[Tm]:"normal",[km]:"segmented",[wm]:"token"},pl="$config";function Ud(n,e,t,r,s,o){let i=n.getFirstChild();for(;i!==null;){const a=i.__key;i.__parent===e&&(A(i)&&Ud(i,a,t,r,s,o),t.has(a)||o.delete(a),s.push(a)),i=i.getNextSibling()}}let Zo=!1,na=0;function jm(n){na=n.timeStamp}function So(n,e,t){const r=n.nodeName==="BR",s=e.__lexicalLineBreak;return s&&(n===s||r&&n.previousSibling===s)||r&&io(n,t)!==void 0}function Bm(n,e,t){const r=Et(ht(t));let s=null,o=null;r!==null&&r.anchorNode===n&&(s=r.anchorOffset,o=r.focusOffset);const i=n.nodeValue;i!==null&&Ea(e,i,s,o,!1)}function zm(n,e,t){if(O(n)){const r=n.anchor.getNode();if(r.is(t)&&n.format!==r.getFormat())return!1}return Xt(e)&&t.isAttached()}function Um(n,e,t,r){for(let s=n;s&&!Wy(s);s=Vr(s)){const o=io(s,e);if(o!==void 0){const i=Oe(o,t);if(i)return he(i)||!Ne(s)?void 0:[s,i]}else if(s===r)return[r,qf(t)]}}function Kd(n,e,t){Zo=!0;const r=performance.now()-na>100;try{Rt(n,()=>{const s=U()||(function(d){return d.getEditorState().read(()=>{const h=U();return h!==null?h.clone():null})})(n),o=new Map,i=n.getRootElement(),a=n._editorState,l=n._blockCursorElement;let u=!1,c="";for(let d=0;d<e.length;d++){const h=e[d],g=h.type,m=h.target,y=Um(m,n,a,i);if(!y)continue;const[x,p]=y;if(g==="characterData")r&&z(p)&&Xt(m)&&zm(s,m,p)&&Bm(m,p,n);else if(g==="childList"){u=!0;const _=h.addedNodes;for(let b=0;b<_.length;b++){const S=_[b],T=Vf(S),E=S.parentNode;if(E!=null&&S!==l&&T===null&&!So(S,E,n)){if(Tn){const N=(Ne(S)?S.innerText:null)||S.nodeValue;N&&(c+=N)}E.removeChild(S)}}const C=h.removedNodes,v=C.length;if(v>0){let b=0;for(let S=0;S<v;S++){const T=C[S];(So(T,m,n)||l===T)&&(m.appendChild(T),b++)}v!==b&&o.set(x,p)}}}if(o.size>0)for(const[d,h]of o)h.reconcileObservedMutation(d,n);const f=t.takeRecords();if(f.length>0){for(let d=0;d<f.length;d++){const h=f[d],g=h.addedNodes,m=h.target;for(let y=0;y<g.length;y++){const x=g[y],p=x.parentNode;p==null||x.nodeName!=="BR"||So(x,m,n)||p.removeChild(x)}}t.takeRecords()}s!==null&&(u&&Ke(s),Tn&&Zf(n)&&s.insertRawText(c))})}finally{Zo=!1}}function Wd(n){const e=n._observer;e!==null&&Kd(n,e.takeRecords(),e)}function Vd(n){(function(e){na===0&&ht(e).addEventListener("textInput",jm,!0)})(n),n._observer=new MutationObserver((e,t)=>{Kd(n,e,t)})}let Km=class{key;parse;unparse;isEqual;defaultValue;constructor(e,t){this.key=e,this.parse=t.parse.bind(t),this.unparse=(t.unparse||qm).bind(t),this.isEqual=(t.isEqual||Object.is).bind(t),this.defaultValue=this.parse(void 0)}};function Wm(n,e){return new Km(n,e)}function Hd(n,e,t="latest"){const r=(t==="latest"?n.getLatest():n).__state;return r?r.getValue(e):e.defaultValue}function Co(n,e,t){let r;if(je(),typeof t=="function"){const o=n.getLatest(),i=Hd(o,e);if(r=t(i),e.isEqual(i,r))return o}else r=t;const s=n.getWritable();return Jd(s).updateFromKnown(e,r),s}function Vm(n){const e=new Map,t=new Set;for(let r=typeof n=="function"?n:n.replace;r.prototype&&r.prototype.getType!==void 0;r=Object.getPrototypeOf(r)){const{ownNodeConfig:s}=co(r);if(s&&s.stateConfigs)for(const o of s.stateConfigs){let i;"stateConfig"in o?(i=o.stateConfig,o.flat&&t.add(i.key)):i=o,e.set(i.key,i)}}return{flatKeys:t,sharedConfigMap:e}}let Hm=class qd{node;knownState;unknownState;sharedNodeState;size;constructor(e,t,r=void 0,s=new Map,o=void 0){this.node=e,this.sharedNodeState=t,this.unknownState=r,this.knownState=s;const{sharedConfigMap:i}=this.sharedNodeState,a=o!==void 0?o:(function(l,u,c){let f=c.size;if(u)for(const d in u){const h=l.get(d);h&&c.has(h)||f++}return f})(i,r,s);this.size=a}getValue(e){const t=this.knownState.get(e);if(t!==void 0)return t;this.sharedNodeState.sharedConfigMap.set(e.key,e);let r=e.defaultValue;if(this.unknownState&&e.key in this.unknownState){const s=this.unknownState[e.key];s!==void 0&&(r=e.parse(s)),this.updateFromKnown(e,r)}return r}getInternalState(){return[this.unknownState,this.knownState]}toJSON(){const e={...this.unknownState},t={};for(const[r,s]of this.knownState)r.isEqual(s,r.defaultValue)?delete e[r.key]:e[r.key]=r.unparse(s);for(const r of this.sharedNodeState.flatKeys)r in e&&(t[r]=e[r],delete e[r]);return hl(e)&&(t.$=e),t}getWritable(e){if(this.node===e)return this;const{sharedNodeState:t,unknownState:r}=this,s=new Map(this.knownState);return new qd(e,t,(function(o,i,a){let l;if(a)for(const[u,c]of Object.entries(a)){const f=o.get(u);f?i.has(f)||i.set(f,f.parse(c)):(l=l||{},l[u]=c)}return l})(t.sharedConfigMap,s,r),s,this.size)}updateFromKnown(e,t){const r=e.key;this.sharedNodeState.sharedConfigMap.set(r,e);const{knownState:s,unknownState:o}=this;s.has(e)||o&&r in o||(o&&(delete o[r],this.unknownState=hl(o)),this.size++),s.set(e,t)}updateFromUnknown(e,t){const r=this.sharedNodeState.sharedConfigMap.get(e);r?this.updateFromKnown(r,r.parse(t)):(this.unknownState=this.unknownState||{},e in this.unknownState||this.size++,this.unknownState[e]=t)}updateFromJSON(e){const{knownState:t}=this;for(const r of t.keys())t.set(r,r.defaultValue);if(this.size=t.size,this.unknownState=void 0,e)for(const[r,s]of Object.entries(e))this.updateFromUnknown(r,s)}};function Jd(n){const e=n.getWritable(),t=e.__state?e.__state.getWritable(e):new Hm(e,Gd(e));return e.__state=t,t}function Gd(n){return n.__state?n.__state.sharedNodeState:Bf(lo(),n.getType()).sharedNodeState}function hl(n){if(n)for(const e in n)return n}function qm(n){return n}function ml(n,e,t){for(const[r,s]of e.knownState){if(n.has(r.key))continue;n.add(r.key);const o=t?t.getValue(r):r.defaultValue;if(o!==s&&!r.isEqual(o,s))return!0}return!1}function yl(n,e,t){const{unknownState:r}=e,s=t?t.unknownState:void 0;if(r){for(const[o,i]of Object.entries(r))if(!n.has(o)&&(n.add(o),i!==(s?s[o]:void 0)))return!0}return!1}function _l(n,e){const t=n.__state;return t&&t.node===n?t.getWritable(e):t}function vl(n,e){const t=n.__mode,r=n.__format,s=n.__style,o=e.__mode,i=e.__format,a=e.__style,l=n.__state,u=e.__state;return(t===null||t===o)&&(r===null||r===i)&&(s===null||s===a)&&(n.__state===null||l===u||(function(c,f){if(c===f)return!0;if(c&&f&&c.size!==f.size)return!1;const d=new Set;return!(c&&ml(d,c,f)||f&&ml(d,f,c)||c&&yl(d,c,f)||f&&yl(d,f,c))})(l,u))}function xl(n,e){const t=n.mergeWithSibling(e),r=xe()._normalizedNodes;return r.add(n.__key),r.add(e.__key),t}function bl(n){let e,t,r=n;if(r.__text!==""||!r.isSimpleText()||r.isUnmergeable()){for(;(e=r.getPreviousSibling())!==null&&z(e)&&e.isSimpleText()&&!e.isUnmergeable();){if(e.__text!==""){if(vl(e,r)){r=xl(e,r);break}break}e.remove()}for(;(t=r.getNextSibling())!==null&&z(t)&&t.isSimpleText()&&!t.isUnmergeable();){if(t.__text!==""){if(vl(r,t)){r=xl(r,t);break}break}t.remove()}}else r.remove()}function kn(n){return Sl(n.anchor),Sl(n.focus),n}function Sl(n){for(;n.type==="element";){const e=n.getNode(),t=n.offset;let r,s;if(t===e.getChildrenSize()?(r=e.getChildAtIndex(t-1),s=!0):(r=e.getChildAtIndex(t),s=!1),z(r)){n.set(r.__key,s?r.getTextContentSize():0,"text",!0);break}if(!A(r))break;n.set(r.__key,s?r.getChildrenSize():0,"element",!0)}}let Nn,He,Ar,Zs,Xo,Qo,An,vt,ei,Pr,$e="",wt=null,hn=null,Ht="",Jn=!1,Ts=!1;function ws(n,e){const t=An.get(n);if(e!==null){const r=si(n);r.parentNode===e&&e.removeChild(r)}if(vt.has(n)||He._keyToDOMMap.delete(n),A(t)){const r=Ns(t,An);ti(r,0,r.length-1,null)}t!==void 0&&Ta(Pr,Ar,Zs,t,"destroyed")}function ti(n,e,t,r){let s=e;for(;s<=t;++s){const o=n[s];o!==void 0&&ws(o,r)}}function pn(n,e){n.setProperty("text-align",e)}const Jm="40px";function Yd(n,e){const t=Nn.theme.indent;if(typeof t=="string"){const s=n.classList.contains(t);e>0&&!s?n.classList.add(t):e<1&&s&&n.classList.remove(t)}const r=getComputedStyle(n).getPropertyValue("--lexical-indent-base-value")||Jm;n.style.setProperty("padding-inline-start",e===0?"":`calc(${e} * ${r})`)}function Zd(n,e){const t=n.style;e===0?pn(t,""):e===1?pn(t,"left"):e===2?pn(t,"center"):e===3?pn(t,"right"):e===4?pn(t,"justify"):e===5?pn(t,"start"):e===6&&pn(t,"end")}function ni(n,e){const t=(function(r){const s=r.__dir;if(s!==null)return s;if(Le(r))return null;const o=r.getParentOrThrow();return Le(o)&&o.__dir===null?"auto":null})(e);t!==null?n.dir=t:n.removeAttribute("dir")}function ks(n,e){const t=vt.get(n);t===void 0&&$(60);const r=t.createDOM(Nn,He);if((function(s,o,i){const a=i._keyToDOMMap;(function(l,u,c){const f=`__lexicalKey_${u._key}`;l[f]=c})(o,i,s),a.set(s,o)})(n,r,He),z(t)?r.setAttribute("data-lexical-text","true"):he(t)&&r.setAttribute("data-lexical-decorator","true"),A(t)){const s=t.__indent,o=t.__size;if(ni(r,t),s!==0&&Yd(r,s),o!==0){const a=o-1;ri(Ns(t,vt),t,0,a,t.getDOMSlot(r))}const i=t.__format;i!==0&&Zd(r,i),t.isInline()||Xd(null,t,r),ao(t)&&($e+=ln,Ht+=ln)}else{const s=t.getTextContent();if(he(t)){const o=t.decorate(He,Nn);o!==null&&Qd(n,o),r.contentEditable="false"}$e+=s,Ht+=s}return e!==null&&e.insertChild(r),Ta(Pr,Ar,Zs,t,"created"),r}function ri(n,e,t,r,s){const o=$e;$e="";let i=t;for(;i<=r;++i){ks(n[i],s);const a=vt.get(n[i]);a!==null&&z(a)&&wt===null&&(wt=a.getFormat(),hn=a.getStyle())}ao(e)&&($e+=ln),s.element.__lexicalTextContent=$e,$e=o+$e}function Cl(n,e){if(n){const t=n.__last;if(t){const r=e.get(t);if(r)return It(r)?"line-break":he(r)&&r.isInline()?"decorator":null}return"empty"}return null}function Xd(n,e,t){const r=Cl(n,An),s=Cl(e,vt);r!==s&&e.getDOMSlot(t).setManagedLineBreak(s)}function Gm(n,e,t){var r;wt=null,hn=null,(function(s,o,i){const a=$e,l=s.__size,u=o.__size;$e="";const c=i.element;if(l===1&&u===1){const f=s.__first,d=o.__first;if(f===d)xr(f,c);else{const g=si(f),m=ks(d,null);try{c.replaceChild(m,g)}catch(y){if(typeof y=="object"&&y!=null){const x=`${y.toString()} Parent: ${c.tagName}, new child: {tag: ${m.tagName} key: ${d}}, old child: {tag: ${g.tagName}, key: ${f}}.`;throw new Error(x)}throw y}ws(f,null)}const h=vt.get(d);z(h)&&wt===null&&(wt=h.getFormat(),hn=h.getStyle())}else{const f=Ns(s,An),d=Ns(o,vt);if(f.length!==l&&$(227),d.length!==u&&$(228),l===0)u!==0&&ri(d,o,0,u-1,i);else if(u===0){if(l!==0){const h=i.after==null&&i.before==null&&i.element.__lexicalLineBreak==null;ti(f,0,l-1,h?null:c),h&&(c.textContent="")}}else(function(h,g,m,y,x,p){const _=y-1,C=x-1;let v,b,S=p.getFirstChild(),T=0,E=0;for(;T<=_&&E<=C;){const M=g[T],R=m[E];if(M===R)S=Eo(xr(R,p.element)),T++,E++;else{v===void 0&&(v=new Set(g)),b===void 0&&(b=new Set(m));const D=b.has(M),L=v.has(R);if(D)if(L){const F=Pn(He,R);F===S?S=Eo(xr(R,p.element)):(p.withBefore(S).insertChild(F),xr(R,p.element)),T++,E++}else ks(R,p.withBefore(S)),E++;else S=Eo(si(M)),ws(M,p.element),T++}const I=vt.get(R);I!==null&&z(I)&&wt===null&&(wt=I.getFormat(),hn=I.getStyle())}const N=T>_,P=E>C;if(N&&!P){const M=m[C+1],R=M===void 0?null:He.getElementByKey(M);ri(m,h,E,C,p.withBefore(R))}else P&&!N&&ti(g,T,_,p.element)})(o,f,d,l,u,i)}ao(o)&&($e+=ln),c.__lexicalTextContent=$e,$e=a+$e})(n,e,e.getDOMSlot(t)),r=e,wt==null||wt===r.__textFormat||Ts||r.setTextFormat(wt),(function(s){hn==null||hn===s.__textStyle||Ts||s.setTextStyle(hn)})(e)}function Ns(n,e){const t=[];let r=n.__first;for(;r!==null;){const s=e.get(r);s===void 0&&$(101),t.push(r),r=s.__next}return t}function xr(n,e){const t=An.get(n);let r=vt.get(n);t!==void 0&&r!==void 0||$(61);const s=Jn||Qo.has(n)||Xo.has(n),o=Pn(He,n);if(t===r&&!s){if(A(t)){const i=o.__lexicalTextContent;i!==void 0&&($e+=i,Ht+=i)}else{const i=t.getTextContent();Ht+=i,$e+=i}return o}if(t!==r&&s&&Ta(Pr,Ar,Zs,r,"updated"),r.updateDOM(t,o,Nn)){const i=ks(n,null);return e===null&&$(62),e.replaceChild(i,o),ws(n,null),i}if(A(t)&&A(r)){const i=r.__indent;(Jn||i!==t.__indent)&&Yd(o,i);const a=r.__format;if((Jn||a!==t.__format)&&Zd(o,a),s&&(Gm(t,r,o),Le(r)||r.isInline()||Xd(t,r,o)),ao(r)&&($e+=ln,Ht+=ln),(Jn||r.__dir!==t.__dir)&&(ni(o,r),Le(r)&&!Jn))for(const l of r.getChildren())A(l)&&ni(Pn(He,l.getKey()),l)}else{const i=r.getTextContent();if(he(r)){const a=r.decorate(He,Nn);a!==null&&Qd(n,a)}$e+=i,Ht+=i}if(!Ts&&Le(r)&&r.__cachedText!==Ht){const i=r.getWritable();i.__cachedText=Ht,r=i}return o}function Qd(n,e){let t=He._pendingDecorators;const r=He._decorators;if(t===null){if(r[n]===e)return;t=Hf(He)}t[n]=e}function Eo(n){let e=n.nextSibling;return e!==null&&e===He._blockCursorElement&&(e=e.nextSibling),e}function Ym(n,e,t,r,s,o){$e="",Ht="",Jn=r===2,He=t,Nn=t._config,Ar=t._nodes,Zs=He._listeners.mutation,Xo=s,Qo=o,An=n._nodeMap,vt=e._nodeMap,Ts=e._readOnly,ei=new Map(t._keyToDOMMap);const i=new Map;return Pr=i,xr("root",null),He=void 0,Ar=void 0,Xo=void 0,Qo=void 0,An=void 0,vt=void 0,Nn=void 0,ei=void 0,Pr=void 0,i}function si(n){const e=ei.get(n);return e===void 0&&$(75,n),e}function Q(n){return{type:n}}const ef=Q("SELECTION_CHANGE_COMMAND"),Zm=Q("SELECTION_INSERT_CLIPBOARD_NODES_COMMAND"),ra=Q("CLICK_COMMAND"),tf=Q("BEFORE_INPUT_COMMAND"),nf=Q("INPUT_COMMAND"),rf=Q("COMPOSITION_START_COMMAND"),sf=Q("COMPOSITION_END_COMMAND"),vn=Q("DELETE_CHARACTER_COMMAND"),Qn=Q("INSERT_LINE_BREAK_COMMAND"),Ir=Q("INSERT_PARAGRAPH_COMMAND"),er=Q("CONTROLLED_TEXT_INSERTION_COMMAND"),Xs=Q("PASTE_COMMAND"),oi=Q("REMOVE_TEXT_COMMAND"),Rr=Q("DELETE_WORD_COMMAND"),Or=Q("DELETE_LINE_COMMAND"),nn=Q("FORMAT_TEXT_COMMAND"),of=Q("UNDO_COMMAND"),af=Q("REDO_COMMAND"),lf=Q("KEYDOWN_COMMAND"),cf=Q("KEY_ARROW_RIGHT_COMMAND"),Xm=Q("MOVE_TO_END"),sa=Q("KEY_ARROW_LEFT_COMMAND"),Qm=Q("MOVE_TO_START"),oa=Q("KEY_ARROW_UP_COMMAND"),ia=Q("KEY_ARROW_DOWN_COMMAND"),As=Q("KEY_ENTER_COMMAND"),aa=Q("KEY_SPACE_COMMAND"),uf=Q("KEY_BACKSPACE_COMMAND"),la=Q("KEY_ESCAPE_COMMAND"),df=Q("KEY_DELETE_COMMAND"),ca=Q("KEY_TAB_COMMAND"),ff=Q("INSERT_TAB_COMMAND"),ii=Q("INDENT_CONTENT_COMMAND"),ai=Q("OUTDENT_CONTENT_COMMAND"),gf=Q("DROP_COMMAND"),ey=Q("FORMAT_ELEMENT_COMMAND"),pf=Q("DRAGSTART_COMMAND"),hf=Q("DRAGOVER_COMMAND"),ty=Q("DRAGEND_COMMAND"),Qs=Q("COPY_COMMAND"),ua=Q("CUT_COMMAND"),li=Q("SELECT_ALL_COMMAND"),ny=Q("FOCUS_COMMAND"),ry=Q("BLUR_COMMAND"),sy=Q("KEY_MODIFIER_COMMAND"),Ut=Object.freeze({}),ci=[["keydown",function(n,e){Fr=n.timeStamp,mf=n.key,!e.isComposing()&&H(e,lf,n)}],["pointerdown",function(n,e){const t=n.target,r=n.pointerType;Dn(t)&&r!=="touch"&&r!=="pen"&&n.button===0&&Rt(e,()=>{zf(t)||(fi=!0)})}],["compositionstart",function(n,e){H(e,rf,n)}],["compositionend",function(n,e){Tn?br=!0:cr||!jr&&!Br?H(e,sf,n):(gi=!0,pi=n.data)}],["input",function(n,e){n.stopPropagation(),Rt(e,()=>{e.dispatchCommand(nf,n)},{event:n}),Gn=null}],["click",function(n,e){Rt(e,()=>{const t=U(),r=Et(ht(e)),s=Ln();if(r){if(O(t)){const o=t.anchor,i=o.getNode();if(o.type==="element"&&o.offset===0&&t.isCollapsed()&&!Le(i)&&ke().getChildrenSize()===1&&i.getTopLevelElementOrThrow().isEmpty()&&s!==null&&t.is(s))r.removeAllRanges(),t.dirty=!0;else if(n.detail===3&&!t.isCollapsed()&&i!==t.focus.getNode()){const a=Qe(i,l=>A(l)&&!l.isInline());A(a)&&a.select(0)}}else if(n.pointerType==="touch"||n.pointerType==="pen"){const o=r.anchorNode;(Ne(o)||Xt(o))&&Ke(ga(s,r,e,n))}}H(e,ra,n)})}],["cut",Ut],["copy",Ut],["dragstart",Ut],["dragover",Ut],["dragend",Ut],["paste",Ut],["focus",Ut],["blur",Ut],["drop",Ut]];Es&&ci.push(["beforeinput",(n,e)=>(function(t,r){const s=t.inputType;s==="deleteCompositionText"||Tn&&Zf(r)||s!=="insertCompositionText"&&H(r,tf,t)})(n,e)]);let Fr=0,mf=null,yf=0,Gn=null;const ui=new WeakMap,Ps=new WeakMap;let di=!1,fi=!1,Tr=!1,br=!1,gi=!1,pi="",_n=null,_f=[0,"",0,"root",0];function vf(n,e,t,r,s){const o=n.anchor,i=n.focus,a=o.getNode(),l=xe(),u=Et(ht(l)),c=u!==null?u.anchorNode:null,f=o.key,d=l.getElementByKey(f),h=t.length;return f!==i.key||!z(a)||(!s&&(!Es||yf<r+50)||a.isDirty()&&h<2||Jf(t))&&o.offset!==i.offset&&!a.isComposing()||Vt(a)||a.isDirty()&&h>1||(s||!Es)&&d!==null&&!a.isComposing()&&c!==ar(d)||u!==null&&e!==null&&(!e.collapsed||e.startContainer!==u.anchorNode||e.startOffset!==u.anchorOffset)||a.getFormat()!==n.format||a.getStyle()!==n.style||(function(g,m){if(m.isSegmented())return!0;if(!g.isCollapsed())return!1;const y=g.anchor.offset,x=m.getParentOrThrow(),p=xn(m);return y===0?!m.canInsertTextBefore()||!x.canInsertTextBefore()&&!m.isComposing()||p||(function(_){const C=_.getPreviousSibling();return(z(C)||A(C)&&C.isInline())&&!C.canInsertTextAfter()})(m):y===m.getTextContentSize()&&(!m.canInsertTextAfter()||!x.canInsertTextAfter()&&!m.isComposing()||p)})(n,a)}function El(n,e){return Xt(n)&&n.nodeValue!==null&&e!==0&&e!==n.nodeValue.length}function Tl(n,e,t){const{anchorNode:r,anchorOffset:s,focusNode:o,focusOffset:i}=n;di&&(di=!1,El(r,s)&&El(o,i)&&!_n)||Rt(e,()=>{if(!t)return void Ke(null);if(!Wr(e,r,o))return;let a=U();if(_n&&O(a)&&a.isCollapsed()){const l=a.anchor,u=_n.anchor;(l.key===u.key&&l.offset===u.offset+1||l.offset===1&&u.getNode().is(l.getNode().getPreviousSibling()))&&(a=_n.clone(),Ke(a))}if(_n=null,O(a)){const l=a.anchor,u=l.getNode();if(a.isCollapsed()){n.type==="Range"&&n.anchorNode===n.focusNode&&(a.dirty=!0);const c=ht(e).event,f=c?c.timeStamp:performance.now(),[d,h,g,m,y]=_f,x=ke(),p=e.isComposing()===!1&&x.getTextContent()==="";if(f<y+200&&l.offset===g&&l.key===m)gs(a,d,h);else if(l.type==="text")z(u)||$(141),xf(a,u);else if(l.type==="element"&&!p){A(u)||$(259);const _=l.getNode();_.isEmpty()?(function(C,v){const b=v.getTextFormat(),S=v.getTextStyle();gs(C,b,S)})(a,_):gs(a,0,"")}}else{const c=l.key,f=a.focus.key,d=a.getNodes(),h=d.length,g=a.isBackward(),m=g?i:s,y=g?s:i,x=g?f:c,p=g?c:f;let _=2047,C=!1;for(let v=0;v<h;v++){const b=d[v],S=b.getTextContentSize();if(z(b)&&S!==0&&!(v===0&&b.__key===x&&m===S||v===h-1&&b.__key===p&&y===0)&&(C=!0,_&=b.getFormat(),_===0))break}a.format=C?_:0}}H(e,ef,void 0)})}function gs(n,e,t){n.format===e&&n.style===t||(n.format=e,n.style=t,n.dirty=!0)}function xf(n,e){gs(n,e.getFormat(),e.getStyle())}function bf(n){if(!n.getTargetRanges)return null;const e=n.getTargetRanges();return e.length===0?null:e[0]}function oy(n){const e=n.inputType,t=bf(n),r=xe(),s=U();if(e==="deleteContentBackward"){if(s===null){const f=Ln();if(!O(f))return!0;Ke(f.clone())}if(O(s)){const f=s.anchor.key===s.focus.key;if(o=n.timeStamp,mf==="MediaLast"&&o<Fr+30&&r.isComposing()&&f){if(Ue(null),Fr=0,setTimeout(()=>{Rt(r,()=>{Ue(null)})},30),O(s)){const d=s.anchor.getNode();d.markDirty(),z(d)||$(142),xf(s,d)}}else{Ue(null),n.preventDefault();const d=s.anchor.getNode(),h=d.getTextContent(),g=d.canInsertTextAfter(),m=s.anchor.offset===0&&s.focus.offset===h.length;let y=fl&&f&&!m&&g;if(y&&s.isCollapsed()&&(y=!he(_i(s.anchor,!0))),!y){H(r,vn,!0);const x=U();fl&&O(x)&&x.isCollapsed()&&(_n=x,setTimeout(()=>_n=null))}}return!0}}var o;if(!O(s))return!0;const i=n.data;Gn!==null&&Ca(!1,r,Gn),s.dirty&&Gn===null||!s.isCollapsed()||Le(s.anchor.getNode())||t===null||s.applyDOMRange(t),Gn=null;const a=s.anchor,l=s.focus,u=a.getNode(),c=l.getNode();if(e==="insertText"||e==="insertTranspose"){if(i===`
4
+ `)n.preventDefault(),H(r,Qn,!1);else if(i===ln)n.preventDefault(),H(r,Ir,void 0);else if(i==null&&n.dataTransfer){const f=n.dataTransfer.getData("text/plain");n.preventDefault(),s.insertRawText(f)}else i!=null&&vf(s,t,i,n.timeStamp,!0)?(n.preventDefault(),H(r,er,i)):Gn=i;return yf=n.timeStamp,!0}switch(n.preventDefault(),e){case"insertFromYank":case"insertFromDrop":case"insertReplacementText":H(r,er,n);break;case"insertFromComposition":Ue(null),H(r,er,n);break;case"insertLineBreak":Ue(null),H(r,Qn,!1);break;case"insertParagraph":Ue(null),Tr&&!cr?(Tr=!1,H(r,Qn,!1)):H(r,Ir,void 0);break;case"insertFromPaste":case"insertFromPasteAsQuotation":H(r,Xs,n);break;case"deleteByComposition":(function(f,d){return f!==d||A(f)||A(d)||!xn(f)||!xn(d)})(u,c)&&H(r,oi,n);break;case"deleteByDrag":case"deleteByCut":H(r,oi,n);break;case"deleteContent":H(r,vn,!1);break;case"deleteWordBackward":H(r,Rr,!0);break;case"deleteWordForward":H(r,Rr,!1);break;case"deleteHardLineBackward":case"deleteSoftLineBackward":H(r,Or,!0);break;case"deleteContentForward":case"deleteHardLineForward":case"deleteSoftLineForward":H(r,Or,!1);break;case"formatStrikeThrough":H(r,nn,"strikethrough");break;case"formatBold":H(r,nn,"bold");break;case"formatItalic":H(r,nn,"italic");break;case"formatUnderline":H(r,nn,"underline");break;case"historyUndo":H(r,of,void 0);break;case"historyRedo":H(r,af,void 0)}return!0}function iy(n){if(Ne(n.target)&&zf(n.target))return!0;const e=xe(),t=U(),r=n.data,s=bf(n);if(r!=null&&O(t)&&vf(t,s,r,n.timeStamp,!1)){br&&(Is(e,r),br=!1);const o=t.anchor.getNode(),i=Et(ht(e));if(i===null)return!0;const a=t.isBackward(),l=a?t.anchor.offset:t.focus.offset,u=a?t.focus.offset:t.anchor.offset;Es&&!t.isCollapsed()&&z(o)&&i.anchorNode!==null&&o.getTextContent().slice(0,l)+r+o.getTextContent().slice(l+u)===Yf(i.anchorNode)||H(e,er,r);const c=r.length;Tn&&c>1&&n.inputType==="insertCompositionText"&&!e.isComposing()&&(t.anchor.offset-=c),jr||cr||Br||!e.isComposing()||(Fr=0,Ue(null))}else Ca(!1,e,r!==null?r:void 0),br&&(Is(e,r||void 0),br=!1);return(function(){je();const o=xe();Wd(o)})(),!0}function ay(n){const e=xe(),t=U();if(O(t)&&!e.isComposing()){const r=t.anchor,s=t.anchor.getNode();Ue(r.key),(n.timeStamp<Fr+30||r.type==="element"||!t.isCollapsed()||s.getFormat()!==t.format||z(s)&&s.getStyle()!==t.style)&&H(e,er,Fm)}return!0}function ly(n){return Is(xe(),n.data),!0}function Is(n,e){const t=n._compositionKey;if(Ue(null),t!==null&&e!=null){if(e===""){const r=Oe(t),s=ar(n.getElementByKey(t));return void(s!==null&&s.nodeValue!==null&&z(r)&&Ea(r,s.nodeValue,null,null,!0))}if(e[e.length-1]===`
5
+ `){const r=U();if(O(r)){const s=r.focus;return r.anchor.set(s.key,s.offset,s.type),void H(n,As,null)}}}Ca(!0,n,e)}function cy(n){const e=xe();if(n.key==null)return!0;if(gi&&Yl(n))return Rt(e,()=>{Is(e,pi)}),gi=!1,pi="",!0;if((function(t){return _e(t,"ArrowRight",{shiftKey:"any"})})(n))H(e,cf,n);else if((function(t){return _e(t,"ArrowRight",Wt)})(n))H(e,Xm,n);else if((function(t){return _e(t,"ArrowLeft",{shiftKey:"any"})})(n))H(e,sa,n);else if((function(t){return _e(t,"ArrowLeft",Wt)})(n))H(e,Qm,n);else if((function(t){return _e(t,"ArrowUp",{altKey:"any",shiftKey:"any"})})(n))H(e,oa,n);else if((function(t){return _e(t,"ArrowDown",{altKey:"any",shiftKey:"any"})})(n))H(e,ia,n);else if((function(t){return _e(t,"Enter",{altKey:"any",ctrlKey:"any",metaKey:"any",shiftKey:!0})})(n))Tr=!0,H(e,As,n);else if((function(t){return t.key===" "})(n))H(e,aa,n);else if((function(t){return yt&&_e(t,"o",{ctrlKey:!0})})(n))n.preventDefault(),Tr=!0,H(e,Qn,!0);else if((function(t){return _e(t,"Enter",{altKey:"any",ctrlKey:"any",metaKey:"any"})})(n))Tr=!1,H(e,As,n);else if((function(t){return _e(t,"Backspace",{shiftKey:"any"})||yt&&_e(t,"h",{ctrlKey:!0})})(n))Yl(n)?H(e,uf,n):(n.preventDefault(),H(e,vn,!0));else if((function(t){return t.key==="Escape"})(n))H(e,la,n);else if((function(t){return _e(t,"Delete",{})||yt&&_e(t,"d",{ctrlKey:!0})})(n))(function(t){return t.key==="Delete"})(n)?H(e,df,n):(n.preventDefault(),H(e,vn,!1));else if((function(t){return _e(t,"Backspace",Gl)})(n))n.preventDefault(),H(e,Rr,!0);else if((function(t){return _e(t,"Delete",Gl)})(n))n.preventDefault(),H(e,Rr,!1);else if((function(t){return yt&&_e(t,"Backspace",{metaKey:!0})})(n))n.preventDefault(),H(e,Or,!0);else if((function(t){return yt&&(_e(t,"Delete",{metaKey:!0})||_e(t,"k",{ctrlKey:!0}))})(n))n.preventDefault(),H(e,Or,!1);else if((function(t){return _e(t,"b",Wt)})(n))n.preventDefault(),H(e,nn,"bold");else if((function(t){return _e(t,"u",Wt)})(n))n.preventDefault(),H(e,nn,"underline");else if((function(t){return _e(t,"i",Wt)})(n))n.preventDefault(),H(e,nn,"italic");else if((function(t){return _e(t,"Tab",{shiftKey:"any"})})(n))H(e,ca,n);else if((function(t){return _e(t,"z",Wt)})(n))n.preventDefault(),H(e,of,void 0);else if((function(t){return yt?_e(t,"z",{metaKey:!0,shiftKey:!0}):_e(t,"y",{ctrlKey:!0})||_e(t,"z",{ctrlKey:!0,shiftKey:!0})})(n))n.preventDefault(),H(e,af,void 0);else{const t=e._editorState._selection;t===null||O(t)?Zl(n)&&(n.preventDefault(),H(e,li,n)):(function(r){return _e(r,"c",Wt)})(n)?(n.preventDefault(),H(e,Qs,n)):(function(r){return _e(r,"x",Wt)})(n)?(n.preventDefault(),H(e,ua,n)):Zl(n)&&(n.preventDefault(),H(e,li,n))}return(function(t){return t.ctrlKey||t.shiftKey||t.altKey||t.metaKey})(n)&&e.dispatchCommand(sy,n),!0}function Sf(n){let e=n.__lexicalEventHandles;return e===void 0&&(e=[],n.__lexicalEventHandles=e),e}const tr=new Map;function Cf(n){const e=zy(n.target);if(e===null)return;const t=so(e.anchorNode);if(t===null)return;fi&&(fi=!1,Rt(t,()=>{const l=Ln(),u=e.anchorNode;(Ne(u)||Xt(u))&&Ke(ga(l,e,t,n))}));const r=Sa(t),s=r[r.length-1],o=s._key,i=tr.get(o),a=i||s;a!==t&&Tl(e,a,!1),Tl(e,t,!0),t!==s?tr.set(o,t):i&&tr.delete(o)}function wl(n){n._lexicalHandled=!0}function kl(n){return n._lexicalHandled===!0}function uy(n){const e=ui.get(n);if(e===void 0)return;const t=Ps.get(e);if(t===void 0)return;const r=t-1;r>=0||$(164),ui.delete(n),Ps.set(e,r),r===0&&e.removeEventListener("selectionchange",Cf);const s=oo(n);ba(s)?((function(i){if(i._parentEditor!==null){const a=Sa(i),l=a[a.length-1]._key;tr.get(l)===i&&tr.delete(l)}else tr.delete(i._key)})(s),n.__lexicalEditor=null):s&&$(198);const o=Sf(n);for(let i=0;i<o.length;i++)o[i]();n.__lexicalEventHandles=[]}function hi(n,e,t){je();const r=n.__key,s=n.getParent();if(s===null)return;const o=(function(a){const l=U();if(!O(l)||!A(a))return l;const{anchor:u,focus:c}=l,f=u.getNode(),d=c.getNode();return vi(f,a)&&u.set(a.__key,0,"element"),vi(d,a)&&c.set(a.__key,0,"element"),l})(n);let i=!1;if(O(o)&&e){const a=o.anchor,l=o.focus;a.key===r&&(Ms(a,n,s,n.getPreviousSibling(),n.getNextSibling()),i=!0),l.key===r&&(Ms(l,n,s,n.getPreviousSibling(),n.getNextSibling()),i=!0)}else Me(o)&&e&&n.isSelected()&&n.selectPrevious();if(O(o)&&e&&!i){const a=n.getIndexWithinParent();bn(n),Fs(o,s,a,-1)}else bn(n);t||qe(s)||s.canBeEmpty()||!s.isEmpty()||hi(s,e),e&&o&&Le(s)&&s.isEmpty()&&s.selectEnd()}const Ef=Symbol.for("ephemeral");function Rs(n){return n[Ef]||!1}class Pt{__type;__key;__parent;__prev;__next;__state;static getType(){const{ownNodeType:e}=co(this);return e===void 0&&$(64,this.name),e}static clone(e){$(65,this.name)}$config(){return{}}config(e,t){const r=t.extends||Object.getPrototypeOf(this.constructor);return Object.assign(t,{extends:r,type:e}),{[e]:t}}afterCloneFrom(e){this.__key===e.__key?(this.__parent=e.__parent,this.__next=e.__next,this.__prev=e.__prev,this.__state=e.__state):e.__state&&(this.__state=e.__state.getWritable(this))}static importDOM;constructor(e){this.__type=this.constructor.getType(),this.__parent=null,this.__prev=null,this.__next=null,Object.defineProperty(this,"__state",{configurable:!0,enumerable:!1,value:void 0,writable:!0}),Wf(this,e)}getType(){return this.__type}isInline(){$(137,this.constructor.name)}isAttached(){let e=this.__key;for(;e!==null;){if(e==="root")return!0;const t=Oe(e);if(t===null)break;e=t.__parent}return!1}isSelected(e){const t=e||U();if(t==null)return!1;const r=t.getNodes().some(s=>s.__key===this.__key);if(z(this))return r;if(O(t)&&t.anchor.type==="element"&&t.focus.type==="element"){if(t.isCollapsed())return!1;const s=this.getParent();if(he(this)&&this.isInline()&&s){const o=t.isBackward()?t.focus:t.anchor;if(s.is(o.getNode())&&o.offset===s.getChildrenSize()&&this.is(s.getLastChild()))return!1}}return r}getKey(){return this.__key}getIndexWithinParent(){const e=this.getParent();if(e===null)return-1;let t=e.getFirstChild(),r=0;for(;t!==null;){if(this.is(t))return r;r++,t=t.getNextSibling()}return-1}getParent(){const e=this.getLatest().__parent;return e===null?null:Oe(e)}getParentOrThrow(){const e=this.getParent();return e===null&&$(66,this.__key),e}getTopLevelElement(){let e=this;for(;e!==null;){const t=e.getParent();if(qe(t))return A(e)||e===this&&he(e)||$(194),e;e=t}return null}getTopLevelElementOrThrow(){const e=this.getTopLevelElement();return e===null&&$(67,this.__key),e}getParents(){const e=[];let t=this.getParent();for(;t!==null;)e.push(t),t=t.getParent();return e}getParentKeys(){const e=[];let t=this.getParent();for(;t!==null;)e.push(t.__key),t=t.getParent();return e}getPreviousSibling(){const e=this.getLatest().__prev;return e===null?null:Oe(e)}getPreviousSiblings(){const e=[],t=this.getParent();if(t===null)return e;let r=t.getFirstChild();for(;r!==null&&!r.is(this);)e.push(r),r=r.getNextSibling();return e}getNextSibling(){const e=this.getLatest().__next;return e===null?null:Oe(e)}getNextSiblings(){const e=[];let t=this.getNextSibling();for(;t!==null;)e.push(t),t=t.getNextSibling();return e}getCommonAncestor(e){const t=A(this)?this:this.getParent(),r=A(e)?e:e.getParent(),s=t&&r?hs(t,r):null;return s?s.commonAncestor:null}is(e){return e!=null&&this.__key===e.__key}isBefore(e){const t=hs(this,e);return t!==null&&(t.type==="descendant"||(t.type==="branch"?sg(t)===-1:(t.type!=="same"&&t.type!=="ancestor"&&$(279),!1)))}isParentOf(e){const t=hs(this,e);return t!==null&&t.type==="ancestor"}getNodesBetween(e){const t=this.isBefore(e),r=[],s=new Set;let o=this;for(;o!==null;){const i=o.__key;if(s.has(i)||(s.add(i),r.push(o)),o===e)break;const a=A(o)?t?o.getFirstChild():o.getLastChild():null;if(a!==null){o=a;continue}const l=t?o.getNextSibling():o.getPreviousSibling();if(l!==null){o=l;continue}const u=o.getParentOrThrow();if(s.has(u.__key)||r.push(u),u===e)break;let c=null,f=u;do{if(f===null&&$(68),c=t?f.getNextSibling():f.getPreviousSibling(),f=f.getParent(),f===null)break;c!==null||s.has(f.__key)||r.push(f)}while(c===null);o=c}return t||r.reverse(),r}isDirty(){const e=xe()._dirtyLeaves;return e!==null&&e.has(this.__key)}getLatest(){if(Rs(this))return this;const e=Oe(this.__key);return e===null&&$(113),e}getWritable(){if(Rs(this))return this;je();const e=un(),t=xe(),r=e._nodeMap,s=this.__key,o=this.getLatest(),i=t._cloneNotNeeded,a=U();if(a!==null&&a.setCachedNodes(null),i.has(s))return Ls(o),o;const l=Qf(o);return i.add(s),Ls(l),r.set(s,l),l}getTextContent(){return""}getTextContentSize(){return this.getTextContent().length}createDOM(e,t){$(70)}updateDOM(e,t,r){$(71)}exportDOM(e){return{element:this.createDOM(e._config,e)}}exportJSON(){const e=this.__state?this.__state.toJSON():void 0;return{type:this.__type,version:1,...e}}static importJSON(e){$(18,this.name)}updateFromJSON(e){return(function(t,r){const s=t.getWritable(),o=r.$;let i=o;for(const a of Gd(s).flatKeys)a in r&&(i!==void 0&&i!==o||(i={...o}),i[a]=r[a]);return(s.__state||i)&&Jd(t).updateFromJSON(i),s})(this,e)}static transform(){return null}remove(e){hi(this,!0,e)}replace(e,t){je();let r=U();r!==null&&(r=r.clone()),Po(this,e);const s=this.getLatest(),o=this.__key,i=e.__key,a=e.getWritable(),l=this.getParentOrThrow().getWritable(),u=l.__size;bn(a);const c=s.getPreviousSibling(),f=s.getNextSibling(),d=s.__prev,h=s.__next,g=s.__parent;if(hi(s,!1,!0),c===null?l.__first=i:c.getWritable().__next=i,a.__prev=d,f===null?l.__last=i:f.getWritable().__prev=i,a.__next=h,a.__parent=g,l.__size=u,t&&(A(this)&&A(a)||$(139),this.getChildren().forEach(m=>{a.append(m)})),O(r)){Ke(r);const m=r.anchor,y=r.focus;m.key===o&&Il(m,a),y.key===o&&Il(y,a)}return rn()===o&&Ue(i),a}insertAfter(e,t=!0){je(),Po(this,e);const r=this.getWritable(),s=e.getWritable(),o=s.getParent(),i=U();let a=!1,l=!1;if(o!==null){const h=e.getIndexWithinParent();if(bn(s),O(i)){const g=o.__key,m=i.anchor,y=i.focus;a=m.type==="element"&&m.key===g&&m.offset===h+1,l=y.type==="element"&&y.key===g&&y.offset===h+1}}const u=this.getNextSibling(),c=this.getParentOrThrow().getWritable(),f=s.__key,d=r.__next;if(u===null?c.__last=f:u.getWritable().__prev=f,c.__size++,r.__next=f,s.__next=d,s.__prev=r.__key,s.__parent=r.__parent,t&&O(i)){const h=this.getIndexWithinParent();Fs(i,c,h+1);const g=c.__key;a&&i.anchor.set(g,h+2,"element"),l&&i.focus.set(g,h+2,"element")}return e}insertBefore(e,t=!0){je(),Po(this,e);const r=this.getWritable(),s=e.getWritable(),o=s.__key;bn(s);const i=this.getPreviousSibling(),a=this.getParentOrThrow().getWritable(),l=r.__prev,u=this.getIndexWithinParent();i===null?a.__first=o:i.getWritable().__next=o,a.__size++,r.__prev=o,s.__prev=l,s.__next=r.__key,s.__parent=r.__parent;const c=U();return t&&O(c)&&Fs(c,this.getParentOrThrow(),u),e}isParentRequired(){return!1}createParentElementNode(){return Te()}selectStart(){return this.selectPrevious()}selectEnd(){return this.selectNext(0,0)}selectPrevious(e,t){je();const r=this.getPreviousSibling(),s=this.getParentOrThrow();if(r===null)return s.select(0,0);if(A(r))return r.select();if(!z(r)){const o=r.getIndexWithinParent()+1;return s.select(o,o)}return r.select(e,t)}selectNext(e,t){je();const r=this.getNextSibling(),s=this.getParentOrThrow();if(r===null)return s.select();if(A(r))return r.select(0,0);if(!z(r)){const o=r.getIndexWithinParent();return s.select(o,o)}return r.select(e,t)}markDirty(){this.getWritable()}reconcileObservedMutation(e,t){this.markDirty()}}const dy="historic",nr="history-merge",fy="paste",Tf="collaboration",gy="skip-scroll-into-view",py="skip-dom-selection",hy="skip-selection-focus";class ur extends Pt{static getType(){return"linebreak"}static clone(e){return new ur(e.__key)}constructor(e){super(e)}getTextContent(){return`
6
+ `}createDOM(){return document.createElement("br")}updateDOM(){return!1}isInline(){return!0}static importDOM(){return{br:e=>(function(t){const r=t.parentElement;if(r!==null&&Ds(r)){const s=r.firstChild;if(s===t||s.nextSibling===t&&ns(s)){const o=r.lastChild;if(o===t||o.previousSibling===t&&ns(o))return!0}}return!1})(e)||(function(t){const r=t.parentElement;if(r!==null&&Ds(r)){const s=r.firstChild;if(s===t||s.nextSibling===t&&ns(s))return!1;const o=r.lastChild;if(o===t||o.previousSibling===t&&ns(o))return!0}return!1})(e)?null:{conversion:my,priority:0}}}static importJSON(e){return xt().updateFromJSON(e)}}function my(n){return{node:xt()}}function xt(){return mt(new ur)}function It(n){return n instanceof ur}function ns(n){return Xt(n)&&/^( |\t|\r?\n)+$/.test(n.textContent||"")}function To(n,e){return 16&e?"code":e&zd?"mark":32&e?"sub":64&e?"sup":null}function wo(n,e){return 1&e?"strong":2&e?"em":"span"}function wf(n,e,t,r,s){const o=r.classList;let i=rr(s,"base");i!==void 0&&o.add(...i),i=rr(s,"underlineStrikethrough");let a=!1;const l=8&e&&4&e;i!==void 0&&(8&t&&4&t?(a=!0,l||o.add(...i)):l&&o.remove(...i));for(const u in wn){const c=wn[u];if(i=rr(s,u),i!==void 0)if(t&c){if(a&&(u==="underline"||u==="strikethrough")){e&c&&o.remove(...i);continue}((e&c)===0||l&&u==="underline"||u==="strikethrough")&&o.add(...i)}else e&c&&o.remove(...i)}}function kf(n,e,t){const r=e.firstChild,s=t.isComposing(),o=n+(s?Ys:"");if(r==null)e.textContent=o;else{const i=r.nodeValue;if(i!==o)if(s||Tn){const[a,l,u]=(function(c,f){const d=c.length,h=f.length;let g=0,m=0;for(;g<d&&g<h&&c[g]===f[g];)g++;for(;m+g<d&&m+g<h&&c[d-m-1]===f[h-m-1];)m++;return[g,d-g-m,f.slice(g,h-m)]})(i,o);l!==0&&r.deleteData(a,l),r.insertData(a,u)}else r.nodeValue=o}}function Nl(n,e,t,r,s,o){kf(s,n,e);const i=o.theme.text;i!==void 0&&wf(0,0,r,n,i)}function rs(n,e){const t=document.createElement(e);return t.appendChild(n),t}class Dt extends Pt{__text;__format;__style;__mode;__detail;static getType(){return"text"}static clone(e){return new Dt(e.__text,e.__key)}afterCloneFrom(e){super.afterCloneFrom(e),this.__text=e.__text,this.__format=e.__format,this.__style=e.__style,this.__mode=e.__mode,this.__detail=e.__detail}constructor(e="",t){super(t),this.__text=e,this.__format=0,this.__style="",this.__mode=0,this.__detail=0}getFormat(){return this.getLatest().__format}getDetail(){return this.getLatest().__detail}getMode(){const e=this.getLatest();return Dm[e.__mode]}getStyle(){return this.getLatest().__style}isToken(){return this.getLatest().__mode===1}isComposing(){return this.__key===rn()}isSegmented(){return this.getLatest().__mode===2}isDirectionless(){return!!(1&this.getLatest().__detail)}isUnmergeable(){return!!(2&this.getLatest().__detail)}hasFormat(e){const t=wn[e];return(this.getFormat()&t)!==0}isSimpleText(){return this.__type==="text"&&this.__mode===0}getTextContent(){return this.getLatest().__text}getFormatFlags(e,t){return $s(this.getLatest().__format,e,t)}canHaveFormat(){return!0}isInline(){return!0}createDOM(e,t){const r=this.__format,s=To(0,r),o=wo(0,r),i=s===null?o:s,a=document.createElement(i);let l=a;this.hasFormat("code")&&a.setAttribute("spellcheck","false"),s!==null&&(l=document.createElement(o),a.appendChild(l)),Nl(l,this,0,r,this.__text,e);const u=this.__style;return u!==""&&(a.style.cssText=u),a}updateDOM(e,t,r){const s=this.__text,o=e.__format,i=this.__format,a=To(0,o),l=To(0,i),u=wo(0,o),c=wo(0,i);if((a===null?u:a)!==(l===null?c:l))return!0;if(a===l&&u!==c){const m=t.firstChild;m==null&&$(48);const y=document.createElement(c);return Nl(y,this,0,i,s,r),t.replaceChild(y,m),!1}let f=t;l!==null&&a!==null&&(f=t.firstChild,f==null&&$(49)),kf(s,f,this);const d=r.theme.text;d!==void 0&&o!==i&&wf(0,o,i,f,d);const h=e.__style,g=this.__style;return h!==g&&(t.style.cssText=g),!1}static importDOM(){return{"#text":()=>({conversion:xy,priority:0}),b:()=>({conversion:_y,priority:0}),code:()=>({conversion:Kt,priority:0}),em:()=>({conversion:Kt,priority:0}),i:()=>({conversion:Kt,priority:0}),mark:()=>({conversion:Kt,priority:0}),s:()=>({conversion:Kt,priority:0}),span:()=>({conversion:yy,priority:0}),strong:()=>({conversion:Kt,priority:0}),sub:()=>({conversion:Kt,priority:0}),sup:()=>({conversion:Kt,priority:0}),u:()=>({conversion:Kt,priority:0})}}static importJSON(e){return we().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setTextContent(e.text).setFormat(e.format).setDetail(e.detail).setMode(e.mode).setStyle(e.style)}exportDOM(e){let{element:t}=super.exportDOM(e);return Ne(t)||$(132),t.style.whiteSpace="pre-wrap",this.hasFormat("lowercase")?t.style.textTransform="lowercase":this.hasFormat("uppercase")?t.style.textTransform="uppercase":this.hasFormat("capitalize")&&(t.style.textTransform="capitalize"),this.hasFormat("bold")&&(t=rs(t,"b")),this.hasFormat("italic")&&(t=rs(t,"i")),this.hasFormat("strikethrough")&&(t=rs(t,"s")),this.hasFormat("underline")&&(t=rs(t,"u")),{element:t}}exportJSON(){return{detail:this.getDetail(),format:this.getFormat(),mode:this.getMode(),style:this.getStyle(),text:this.getTextContent(),...super.exportJSON()}}selectionTransform(e,t){}setFormat(e){const t=this.getWritable();return t.__format=typeof e=="string"?wn[e]:e,t}setDetail(e){const t=this.getWritable();return t.__detail=typeof e=="string"?Mm[e]:e,t}setStyle(e){const t=this.getWritable();return t.__style=e,t}toggleFormat(e){const t=$s(this.getFormat(),e,null);return this.setFormat(t)}toggleDirectionless(){const e=this.getWritable();return e.__detail^=1,e}toggleUnmergeable(){const e=this.getWritable();return e.__detail^=2,e}setMode(e){const t=Lm[e];if(this.__mode===t)return this;const r=this.getWritable();return r.__mode=t,r}setTextContent(e){if(this.__text===e)return this;const t=this.getWritable();return t.__text=e,t}select(e,t){je();let r=e,s=t;const o=U(),i=this.getTextContent(),a=this.__key;if(typeof i=="string"){const l=i.length;r===void 0&&(r=l),s===void 0&&(s=l)}else r=0,s=0;if(!O(o))return Pf(a,r,a,s,"text","text");{const l=rn();l!==o.anchor.key&&l!==o.focus.key||Ue(a),o.setTextNodeRange(this,r,this,s)}return o}selectStart(){return this.select(0,0)}selectEnd(){const e=this.getTextContentSize();return this.select(e,e)}spliceText(e,t,r,s){const o=this.getWritable(),i=o.__text,a=r.length;let l=e;l<0&&(l=a+l,l<0&&(l=0));const u=U();if(s&&O(u)){const f=e+a;u.setTextNodeRange(o,f,o,f)}const c=i.slice(0,l)+r+i.slice(l+t);return o.__text=c,o}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}splitText(...e){je();const t=this.getLatest(),r=t.getTextContent();if(r==="")return[];const s=t.__key,o=rn(),i=r.length;e.sort((T,E)=>T-E),e.push(i);const a=[],l=e.length;for(let T=0,E=0;T<i&&E<=l;E++){const N=e[E];N>T&&(a.push(r.slice(T,N)),T=N)}const u=a.length;if(u===1)return[t];const c=a[0],f=t.getParent();let d;const h=t.getFormat(),g=t.getStyle(),m=t.__detail;let y=!1,x=null,p=null;const _=U();if(O(_)){const[T,E]=_.isBackward()?[_.focus,_.anchor]:[_.anchor,_.focus];T.type==="text"&&T.key===s&&(x=T),E.type==="text"&&E.key===s&&(p=E)}t.isSegmented()?(d=we(c),d.__format=h,d.__style=g,d.__detail=m,d.__state=_l(t,d),y=!0):d=t.setTextContent(c);const C=[d];for(let T=1;T<u;T++){const E=we(a[T]);E.__format=h,E.__style=g,E.__detail=m,E.__state=_l(t,E);const N=E.__key;o===s&&Ue(N),C.push(E)}const v=x?x.offset:null,b=p?p.offset:null;let S=0;for(const T of C){if(!x&&!p)break;const E=S+T.getTextContentSize();if(x!==null&&v!==null&&v<=E&&v>=S&&(x.set(T.getKey(),v-S,"text"),v<E&&(x=null)),p!==null&&b!==null&&b<=E&&b>=S){p.set(T.getKey(),b-S,"text");break}S=E}if(f!==null){(function(N){const P=N.getPreviousSibling(),M=N.getNextSibling();P!==null&&Ls(P),M!==null&&Ls(M)})(this);const T=f.getWritable(),E=this.getIndexWithinParent();y?(T.splice(E,0,C),this.remove()):T.splice(E,1,C),O(_)&&Fs(_,f,E,u-1)}return C}mergeWithSibling(e){const t=e===this.getPreviousSibling();t||e===this.getNextSibling()||$(50);const r=this.__key,s=e.__key,o=this.__text,i=o.length;rn()===s&&Ue(r);const a=U();if(O(a)){const f=a.anchor,d=a.focus;f!==null&&f.key===s&&Dl(f,t,r,e,i),d!==null&&d.key===s&&Dl(d,t,r,e,i)}const l=e.__text,u=t?l+o:o+l;this.setTextContent(u);const c=this.getWritable();return e.remove(),c}isTextEntity(){return!1}}function yy(n){return{forChild:da(n.style),node:null}}function _y(n){const e=n,t=e.style.fontWeight==="normal";return{forChild:da(e.style,t?void 0:"bold"),node:null}}const Al=new WeakMap;function vy(n){if(!Ne(n))return!1;if(n.nodeName==="PRE")return!0;const e=n.style.whiteSpace;return typeof e=="string"&&e.startsWith("pre")}function xy(n){const e=n;n.parentElement===null&&$(129);let t=e.textContent||"";if((function(r){let s,o=r.parentNode;const i=[r];for(;o!==null&&(s=Al.get(o))===void 0&&!vy(o);)i.push(o),o=o.parentNode;const a=s===void 0?o:s;for(let l=0;l<i.length;l++)Al.set(i[l],a);return a})(e)!==null){const r=t.split(/(\r?\n|\t)/),s=[],o=r.length;for(let i=0;i<o;i++){const a=r[i];a===`
7
+ `||a===`\r
8
+ `?s.push(xt()):a===" "?s.push(fr()):a!==""&&s.push(we(a))}return{node:s}}if(t=t.replace(/\r/g,"").replace(/[ \t\n]+/g," "),t==="")return{node:null};if(t[0]===" "){let r=e,s=!0;for(;r!==null&&(r=Pl(r,!1))!==null;){const o=r.textContent||"";if(o.length>0){/[ \t\n]$/.test(o)&&(t=t.slice(1)),s=!1;break}}s&&(t=t.slice(1))}if(t[t.length-1]===" "){let r=e,s=!0;for(;r!==null&&(r=Pl(r,!0))!==null;)if((r.textContent||"").replace(/^( |\t|\r?\n)+/,"").length>0){s=!1;break}s&&(t=t.slice(0,t.length-1))}return t===""?{node:null}:{node:we(t)}}function Pl(n,e){let t=n;for(;;){let r;for(;(r=e?t.nextSibling:t.previousSibling)===null;){const o=t.parentElement;if(o===null)return null;t=o}if(t=r,Ne(t)){const o=t.style.display;if(o===""&&!Si(t)||o!==""&&!o.startsWith("inline"))return null}let s=t;for(;(s=e?t.firstChild:t.lastChild)!==null;)t=s;if(Xt(t))return t;if(t.nodeName==="BR")return null}}const by={code:"code",em:"italic",i:"italic",mark:"highlight",s:"strikethrough",strong:"bold",sub:"subscript",sup:"superscript",u:"underline"};function Kt(n){const e=by[n.nodeName.toLowerCase()];return e===void 0?{node:null}:{forChild:da(n.style,e),node:null}}function we(n=""){return mt(new Dt(n))}function z(n){return n instanceof Dt}function da(n,e){const t=n.fontWeight,r=n.textDecoration.split(" "),s=t==="700"||t==="bold",o=r.includes("line-through"),i=n.fontStyle==="italic",a=r.includes("underline"),l=n.verticalAlign;return u=>(z(u)&&(s&&!u.hasFormat("bold")&&u.toggleFormat("bold"),o&&!u.hasFormat("strikethrough")&&u.toggleFormat("strikethrough"),i&&!u.hasFormat("italic")&&u.toggleFormat("italic"),a&&!u.hasFormat("underline")&&u.toggleFormat("underline"),l!=="sub"||u.hasFormat("subscript")||u.toggleFormat("subscript"),l!=="super"||u.hasFormat("superscript")||u.toggleFormat("superscript"),e&&!u.hasFormat(e)&&u.toggleFormat(e)),u)}class dr extends Dt{static getType(){return"tab"}static clone(e){return new dr(e.__key)}constructor(e){super(" ",e),this.__detail=2}static importDOM(){return null}createDOM(e){const t=super.createDOM(e),r=rr(e.theme,"tab");return r!==void 0&&t.classList.add(...r),t}static importJSON(e){return fr().updateFromJSON(e)}setTextContent(e){return e!==" "&&e!==""&&Dd(126),super.setTextContent(" ")}spliceText(e,t,r,s){return r===""&&t===0||r===" "&&t===1||$(286),this}setDetail(e){return e!==2&&$(127),this}setMode(e){return e!=="normal"&&$(128),this}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}}function fr(){return mt(new dr)}function eo(n){return n instanceof dr}class Sy{key;offset;type;_selection;constructor(e,t,r){this._selection=null,this.key=e,this.offset=t,this.type=r}is(e){return this.key===e.key&&this.offset===e.offset&&this.type===e.type}isBefore(e){return this.key===e.key?this.offset<e.offset:rg(at(Lt(this,"next")),at(Lt(e,"next")))<0}getNode(){const e=Oe(this.key);return e===null&&$(20),e}set(e,t,r,s){const o=this._selection,i=this.key;s&&this.key===e&&this.offset===t&&this.type===r||(this.key=e,this.offset=t,this.type=r,zr()||(rn()===i&&Ue(e),o!==null&&(o.setCachedNodes(null),o.dirty=!0)))}}function Mt(n,e,t){return new Sy(n,e,t)}function ko(n,e){let t=e.__key,r=n.offset,s="element";if(z(e)){s="text";const o=e.getTextContentSize();r>o&&(r=o)}else if(!A(e)){const o=e.getNextSibling();if(z(o))t=o.__key,r=0,s="text";else{const i=e.getParent();i&&(t=i.__key,r=e.getIndexWithinParent()+1)}}n.set(t,r,s)}function Il(n,e){if(A(e)){const t=e.getLastDescendant();A(t)||z(t)?ko(n,t):ko(n,e)}else ko(n,e)}class to{_nodes;_cachedNodes;dirty;constructor(e){this._cachedNodes=null,this._nodes=e,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){if(!Me(e))return!1;const t=this._nodes,r=e._nodes;return t.size===r.size&&Array.from(t).every(s=>r.has(s))}isCollapsed(){return!1}isBackward(){return!1}getStartEndPoints(){return null}add(e){this.dirty=!0,this._nodes.add(e),this._cachedNodes=null}delete(e){this.dirty=!0,this._nodes.delete(e),this._cachedNodes=null}clear(){this.dirty=!0,this._nodes.clear(),this._cachedNodes=null}has(e){return this._nodes.has(e)}clone(){return new to(new Set(this._nodes))}extract(){return this.getNodes()}insertRawText(e){}insertText(){}insertNodes(e){const t=this.getNodes(),r=t.length,s=t[r-1];let o;if(z(s))o=s.select();else{const i=s.getIndexWithinParent()+1;o=s.getParentOrThrow().select(i,i)}o.insertNodes(e);for(let i=0;i<r;i++)t[i].remove()}getNodes(){const e=this._cachedNodes;if(e!==null)return e;const t=this._nodes,r=[];for(const s of t){const o=Oe(s);o!==null&&r.push(o)}return zr()||(this._cachedNodes=r),r}getTextContent(){const e=this.getNodes();let t="";for(let r=0;r<e.length;r++)t+=e[r].getTextContent();return t}deleteNodes(){const e=this.getNodes();if((U()||Ln())===this&&e[0]){const t=Fe(e[0],"next");og(cn(t,t))}for(const t of e)t.remove()}}function O(n){return n instanceof $n}class $n{format;style;anchor;focus;_cachedNodes;dirty;constructor(e,t,r,s){this.anchor=e,this.focus=t,e._selection=this,t._selection=this,this._cachedNodes=null,this.format=r,this.style=s,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){return!!O(e)&&this.anchor.is(e.anchor)&&this.focus.is(e.focus)&&this.format===e.format&&this.style===e.style}isCollapsed(){return this.anchor.is(this.focus)}getNodes(){const e=this._cachedNodes;if(e!==null)return e;const t=(function(r){const s=[],[o,i]=r.getTextSlices();o&&s.push(o.caret.origin);const a=new Set,l=new Set;for(const u of r)if(ft(u)){const{origin:c}=u;s.length===0?a.add(c):(l.add(c),s.push(c))}else{const{origin:c}=u;A(c)&&l.has(c)||s.push(c)}if(i&&s.push(i.caret.origin),lr(r.focus)&&A(r.focus.origin)&&r.focus.getNodeAtCaret()===null)for(let u=gt(r.focus.origin,"previous");ft(u)&&a.has(u.origin)&&!u.origin.isEmpty()&&u.origin.is(s[s.length-1]);u=uo(u))a.delete(u.origin),s.pop();for(;s.length>1;){const u=s[s.length-1];if(!A(u)||l.has(u)||u.isEmpty()||a.has(u))break;s.pop()}if(s.length===0&&r.isCollapsed()){const u=at(r.anchor),c=at(r.anchor.getFlipped()),f=h=>Ot(h)?h.origin:h.getNodeAtCaret(),d=f(u)||f(c)||(r.anchor.getNodeAtCaret()?u.origin:c.origin);s.push(d)}return s})(ag(rc(this),"next"));return zr()||(this._cachedNodes=t),t}setTextNodeRange(e,t,r,s){this.anchor.set(e.__key,t,"text"),this.focus.set(r.__key,s,"text")}getTextContent(){const e=this.getNodes();if(e.length===0)return"";const t=e[0],r=e[e.length-1],s=this.anchor,o=this.focus,i=s.isBefore(o),[a,l]=mi(this);let u="",c=!0;for(let f=0;f<e.length;f++){const d=e[f];if(A(d)&&!d.isInline())c||(u+=`
9
+ `),c=!d.isEmpty();else if(c=!1,z(d)){let h=d.getTextContent();d===t?d===r?s.type==="element"&&o.type==="element"&&o.offset!==s.offset||(h=a<l?h.slice(a,l):h.slice(l,a)):h=i?h.slice(a):h.slice(l):d===r&&(h=i?h.slice(0,l):h.slice(0,a)),u+=h}else!he(d)&&!It(d)||d===r&&this.isCollapsed()||(u+=d.getTextContent())}return u}applyDOMRange(e){const t=xe(),r=t.getEditorState()._selection,s=Af(e.startContainer,e.startOffset,e.endContainer,e.endOffset,t,r);if(s===null)return;const[o,i]=s;this.anchor.set(o.key,o.offset,o.type,!0),this.focus.set(i.key,i.offset,i.type,!0),kn(this)}clone(){const e=this.anchor,t=this.focus;return new $n(Mt(e.key,e.offset,e.type),Mt(t.key,t.offset,t.type),this.format,this.style)}toggleFormat(e){this.format=$s(this.format,e,null),this.dirty=!0}setFormat(e){this.format=e,this.dirty=!0}setStyle(e){this.style=e,this.dirty=!0}hasFormat(e){const t=wn[e];return(this.format&t)!==0}insertRawText(e){const t=e.split(/(\r?\n|\t)/),r=[],s=t.length;for(let o=0;o<s;o++){const i=t[o];i===`
10
+ `||i===`\r
11
+ `?r.push(xt()):i===" "?r.push(fr()):r.push(we(i))}this.insertNodes(r)}insertText(e){const t=this.anchor,r=this.focus,s=this.format,o=this.style;let i=t,a=r;!this.isCollapsed()&&r.isBefore(t)&&(i=r,a=t),i.type==="element"&&(function(y,x,p,_){const C=y.getNode(),v=C.getChildAtIndex(y.offset),b=we();if(b.setFormat(p),b.setStyle(_),Kr(v))v.splice(0,0,[b]);else{const S=Le(C)?Te().append(b):b;v===null?C.append(S):v.insertBefore(S)}y.is(x)&&x.set(b.__key,0,"text"),y.set(b.__key,0,"text")})(i,a,s,o),a.type==="element"&&Fn(a,at(Lt(a,"next")));const l=i.offset;let u=a.offset;const c=this.getNodes(),f=c.length;let d=c[0];z(d)||$(26);const h=d.getTextContent().length,g=d.getParentOrThrow();let m=c[f-1];if(f===1&&a.type==="element"&&(u=h,a.set(i.key,u,"text")),this.isCollapsed()&&l===h&&(Vt(d)||!d.canInsertTextAfter()||!g.canInsertTextAfter()&&d.getNextSibling()===null)){let y=d.getNextSibling();if(z(y)&&y.canInsertTextBefore()&&!Vt(y)||(y=we(),y.setFormat(s),y.setStyle(o),g.canInsertTextAfter()?d.insertAfter(y):g.insertAfter(y)),y.select(0,0),d=y,e!=="")return void this.insertText(e)}else if(this.isCollapsed()&&l===0&&(Vt(d)||!d.canInsertTextBefore()||!g.canInsertTextBefore()&&d.getPreviousSibling()===null)){let y=d.getPreviousSibling();if(z(y)&&!Vt(y)||(y=we(),y.setFormat(s),g.canInsertTextBefore()?d.insertBefore(y):g.insertBefore(y)),y.select(),d=y,e!=="")return void this.insertText(e)}else if(d.isSegmented()&&l!==h){const y=we(d.getTextContent());y.setFormat(s),d.replace(y),d=y}else if(!this.isCollapsed()&&e!==""){const y=m.getParent();if(!g.canInsertTextBefore()||!g.canInsertTextAfter()||A(y)&&(!y.canInsertTextBefore()||!y.canInsertTextAfter()))return this.insertText(""),Nf(this.anchor,this.focus,null),void this.insertText(e)}if(f===1){if(xn(d)){const _=we(e);return _.select(),void d.replace(_)}const y=d.getFormat(),x=d.getStyle();if(l!==u||y===s&&x===o){if(eo(d)){const _=we(e);return _.setFormat(s),_.setStyle(o),_.select(),void d.replace(_)}}else{if(d.getTextContent()!==""){const _=we(e);if(_.setFormat(s),_.setStyle(o),_.select(),l===0)d.insertBefore(_,!1);else{const[C]=d.splitText(l);C.insertAfter(_,!1)}return void(_.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=e.length))}d.setFormat(s),d.setStyle(o)}const p=u-l;d=d.spliceText(l,p,e,!0),d.getTextContent()===""?d.remove():this.anchor.type==="text"&&(d.isComposing()?this.anchor.offset-=e.length:(this.format=y,this.style=x))}else{const y=new Set([...d.getParentKeys(),...m.getParentKeys()]),x=A(d)?d:d.getParentOrThrow();let p=A(m)?m:m.getParentOrThrow(),_=m;if(!x.is(p)&&p.isInline())do _=p,p=p.getParentOrThrow();while(p.isInline());if(a.type==="text"&&(u!==0||m.getTextContent()==="")||a.type==="element"&&m.getIndexWithinParent()<u)if(z(m)&&!xn(m)&&u!==m.getTextContentSize()){if(m.isSegmented()){const T=we(m.getTextContent());m.replace(T),m=T}Le(a.getNode())||a.type!=="text"||(m=m.spliceText(0,u,"")),y.add(m.__key)}else{const T=m.getParentOrThrow();T.canBeEmpty()||T.getChildrenSize()!==1?m.remove():T.remove()}else y.add(m.__key);const C=p.getChildren(),v=new Set(c),b=x.is(p),S=x.isInline()&&d.getNextSibling()===null?x:d;for(let T=C.length-1;T>=0;T--){const E=C[T];if(E.is(d)||A(E)&&E.isParentOf(d))break;E.isAttached()&&(!v.has(E)||E.is(_)?b||S.insertAfter(E,!1):E.remove())}if(!b){let T=p,E=null;for(;T!==null;){const N=T.getChildren(),P=N.length;(P===0||N[P-1].is(E))&&(y.delete(T.__key),E=T),T=T.getParent()}}if(xn(d))if(l===h)d.select();else{const T=we(e);T.select(),d.replace(T)}else d=d.spliceText(l,h-l,e,!0),d.getTextContent()===""?d.remove():d.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=e.length);for(let T=1;T<f;T++){const E=c[T],N=E.__key;y.has(N)||E.remove()}}}removeText(){const e=U()===this;ms(this,Xy(rc(this))),e&&U()!==this&&Ke(this)}formatText(e,t=null){if(this.isCollapsed())return this.toggleFormat(e),void Ue(null);const r=this.getNodes(),s=[];for(const C of r)z(C)&&s.push(C);const o=C=>{r.forEach(v=>{if(A(v)){const b=v.getFormatFlags(e,C);v.setTextFormat(b)}})},i=s.length;if(i===0)return this.toggleFormat(e),Ue(null),void o(t);const a=this.anchor,l=this.focus,u=this.isBackward(),c=u?l:a,f=u?a:l;let d=0,h=s[0],g=c.type==="element"?0:c.offset;if(c.type==="text"&&g===h.getTextContentSize()&&(d=1,h=s[1],g=0),h==null)return;const m=h.getFormatFlags(e,t);o(m);const y=i-1;let x=s[y];const p=f.type==="text"?f.offset:x.getTextContentSize();if(h.is(x)){if(g===p)return;if(Vt(h)||g===0&&p===h.getTextContentSize())h.setFormat(m);else{const C=h.splitText(g,p),v=g===0?C[0]:C[1];v.setFormat(m),c.type==="text"&&c.set(v.__key,0,"text"),f.type==="text"&&f.set(v.__key,p-g,"text")}return void(this.format=m)}g===0||Vt(h)||([,h]=h.splitText(g),g=0),h.setFormat(m);const _=x.getFormatFlags(e,m);p>0&&(p===x.getTextContentSize()||Vt(x)||([x]=x.splitText(p)),x.setFormat(_));for(let C=d+1;C<y;C++){const v=s[C],b=v.getFormatFlags(e,_);v.setFormat(b)}c.type==="text"&&c.set(h.__key,g,"text"),f.type==="text"&&f.set(x.__key,p,"text"),this.format=m|_}insertNodes(e){if(e.length===0)return;if(this.isCollapsed()||this.removeText(),this.anchor.key==="root"){this.insertParagraph();const g=U();return O(g)||$(134),g.insertNodes(e)}const t=(this.isBackward()?this.focus:this.anchor).getNode(),r=Qe(t,en),s=e[e.length-1];if(A(r)&&"__language"in r){if("__language"in e[0])this.insertText(e[0].getTextContent());else{const g=No(this);r.splice(g,0,e),s.selectEnd()}return}if(!e.some(g=>(A(g)||he(g))&&!g.isInline())){A(r)||$(211,t.constructor.name,t.getType());const g=No(this);return r.splice(g,0,e),void s.selectEnd()}const o=(function(g){const m=Te();let y=null;for(let x=0;x<g.length;x++){const p=g[x],_=It(p);if(_||he(p)&&p.isInline()||A(p)&&p.isInline()||z(p)||p.isParentRequired()){if(y===null&&(y=p.createParentElementNode(),m.append(y),_))continue;y!==null&&y.append(p)}else m.append(p),y=null}return m})(e),i=o.getLastDescendant(),a=o.getChildren(),l=!A(r)||!r.isEmpty()?this.insertParagraph():null,u=a[a.length-1];let c=a[0];var f;A(f=c)&&en(f)&&!f.isEmpty()&&A(r)&&(!r.isEmpty()||r.canMergeWhenEmpty())&&(A(r)||$(211,t.constructor.name,t.getType()),r.append(...c.getChildren()),c=a[1]),c&&(r===null&&$(212,t.constructor.name,t.getType()),(function(g,m){const y=m.getParentOrThrow().getLastChild();let x=m;const p=[m];for(;x!==y;)x.getNextSibling()||$(140),x=x.getNextSibling(),p.push(x);let _=g;for(const C of p)_=_.insertAfter(C)})(r,c));const d=Qe(i,en);l&&A(d)&&(l.canMergeWhenEmpty()||en(u))&&(d.append(...l.getChildren()),l.remove()),A(r)&&r.isEmpty()&&r.remove(),i.selectEnd();const h=A(r)?r.getLastChild():null;It(h)&&d!==r&&h.remove()}insertParagraph(){if(this.anchor.key==="root"){const i=Te();return ke().splice(this.anchor.offset,0,[i]),i.select(),i}const e=No(this),t=Qe(this.anchor.getNode(),en);A(t)||$(213);const r=t.getChildAtIndex(e),s=r?[r,...r.getNextSiblings()]:[],o=t.insertNewAfter(this,!1);return o?(o.append(...s),o.selectStart(),o):null}insertLineBreak(e){const t=xt();if(this.insertNodes([t]),e){const r=t.getParentOrThrow(),s=t.getIndexWithinParent();r.select(s,s)}}extract(){const e=[...this.getNodes()],t=e.length;let r=e[0],s=e[t-1];const[o,i]=mi(this),a=this.isBackward(),[l,u]=a?[this.focus,this.anchor]:[this.anchor,this.focus],[c,f]=a?[i,o]:[o,i];if(t===0)return[];if(t===1){if(z(r)&&!this.isCollapsed()){const d=r.splitText(c,f),h=c===0?d[0]:d[1];return h?(l.set(h.getKey(),0,"text"),u.set(h.getKey(),h.getTextContentSize(),"text"),[h]):[]}return[r]}if(z(r)&&(c===r.getTextContentSize()?e.shift():c!==0&&([,r]=r.splitText(c),e[0]=r,l.set(r.getKey(),0,"text"))),z(s)){const d=s.getTextContent().length;f===0?e.pop():f!==d&&([s]=s.splitText(f),e[e.length-1]=s,u.set(s.getKey(),s.getTextContentSize(),"text"))}return e}modify(e,t,r){if(jl(this,e,t,r))return;const s=e==="move",o=xe(),i=Et(ht(o));if(!i)return;const a=o._blockCursorElement,l=o._rootElement,u=this.focus.getNode();if(l===null||a===null||!A(u)||u.isInline()||u.canBeEmpty()||xi(a,o,l),this.dirty){let c=Pn(o,this.anchor.key),f=Pn(o,this.focus.key);this.anchor.type==="text"&&(c=ar(c)),this.focus.type==="text"&&(f=ar(f)),c&&f&&If(i,c,this.anchor.offset,f,this.focus.offset)}if((function(c,f,d,h){c.modify(f,d,h)})(i,e,t?"backward":"forward",r),i.rangeCount>0){const c=i.getRangeAt(0),f=this.anchor.getNode(),d=Le(f)?f:Dy(f);if(this.applyDOMRange(c),this.dirty=!0,!s){const h=this.getNodes(),g=[];let m=!1;for(let y=0;y<h.length;y++){const x=h[y];vi(x,d)?g.push(x):m=!0}if(m&&g.length>0)if(t){const y=g[0];A(y)?y.selectStart():y.getParentOrThrow().selectStart()}else{const y=g[g.length-1];A(y)?y.selectEnd():y.getParentOrThrow().selectEnd()}i.anchorNode===c.startContainer&&i.anchorOffset===c.startOffset||(function(y){const x=y.focus,p=y.anchor,_=p.key,C=p.offset,v=p.type;p.set(x.key,x.offset,x.type,!0),x.set(_,C,v,!0)})(this)}}r==="lineboundary"&&jl(this,e,t,r,"decorators")}forwardDeletion(e,t,r){if(!r&&(e.type==="element"&&A(t)&&e.offset===t.getChildrenSize()||e.type==="text"&&e.offset===t.getTextContentSize())){const s=t.getParent(),o=t.getNextSibling()||(s===null?null:s.getNextSibling());if(A(o)&&o.isShadowRoot())return!0}return!1}deleteCharacter(e){const t=this.isCollapsed();if(this.isCollapsed()){const r=this.anchor;let s=r.getNode();if(this.forwardDeletion(r,s,e))return;const o=Ra(Lt(r,e?"previous":"next"));if(o.getTextSlices().every(a=>a===null||a.distance===0)){let a={type:"initial"};for(const l of o.iterNodeCarets("shadowRoot"))if(ft(l)){if(!l.origin.isInline()){if(l.origin.isShadowRoot()){if(a.type==="merge-block")break;if(A(o.anchor.origin)&&o.anchor.origin.isEmpty()){const u=at(l);ms(this,cn(u,u)),o.anchor.origin.remove()}return}a.type!=="merge-next-block"&&a.type!=="merge-block"||(a={block:a.block,caret:l,type:"merge-block"})}}else{if(a.type==="merge-block")break;if(lr(l)){if(A(l.origin)){if(l.origin.isInline()){if(!l.origin.isParentOf(o.anchor.origin))break}else a={block:l.origin,type:"merge-next-block"};continue}if(he(l.origin)){if(!l.origin.isIsolated())if(a.type==="merge-next-block"&&(l.origin.isKeyboardSelectable()||!l.origin.isInline())&&A(o.anchor.origin)&&o.anchor.origin.isEmpty()){o.anchor.origin.remove();const u=fa();u.add(l.origin.getKey()),Ke(u)}else l.origin.remove();return}break}}if(a.type==="merge-block"){const{caret:l,block:u}=a;return ms(this,cn(!l.origin.isEmpty()&&u.isEmpty()?Hr(Fe(u,l.direction)):o.anchor,l)),this.removeText()}}const i=this.focus;if(this.modify("extend",e,"character"),this.isCollapsed()){if(e&&r.offset===0&&Ol(this,r.getNode()))return}else{const a=i.type==="text"?i.getNode():null;if(s=r.type==="text"?r.getNode():null,a!==null&&a.isSegmented()){const l=i.offset,u=a.getTextContentSize();if(a.is(s)||e&&l!==u||!e&&l!==0)return void Fl(a,e,l)}else if(s!==null&&s.isSegmented()){const l=r.offset,u=s.getTextContentSize();if(s.is(a)||e&&l!==0||!e&&l!==u)return void Fl(s,e,l)}(function(l,u){const c=l.anchor,f=l.focus,d=c.getNode(),h=f.getNode();if(d===h&&c.type==="text"&&f.type==="text"){const g=c.offset,m=f.offset,y=g<m,x=y?g:m,p=y?m:g,_=p-1;x!==_&&(function(C){return!(Jf(C)||Cy(C))})(d.getTextContent().slice(x,p))&&(u?f.set(f.key,_,f.type):c.set(c.key,_,c.type))}})(this,e)}}if(this.removeText(),e&&!t&&this.isCollapsed()&&this.anchor.type==="element"&&this.anchor.offset===0){const r=this.anchor.getNode();r.isEmpty()&&Le(r.getParent())&&r.getPreviousSibling()===null&&Ol(this,r)}}deleteLine(e){this.isCollapsed()&&this.modify("extend",e,"lineboundary"),this.isCollapsed()?this.deleteCharacter(e):this.removeText()}deleteWord(e){if(this.isCollapsed()){const t=this.anchor,r=t.getNode();if(this.forwardDeletion(t,r,e))return;this.modify("extend",e,"word")}this.removeText()}isBackward(){return this.focus.isBefore(this.anchor)}getStartEndPoints(){return[this.anchor,this.focus]}}function Me(n){return n instanceof to}function Rl(n){const e=n.offset;if(n.type==="text")return e;const t=n.getNode();return e===t.getChildrenSize()?t.getTextContent().length:0}function mi(n){const e=n.getStartEndPoints();if(e===null)return[0,0];const[t,r]=e;return t.type==="element"&&r.type==="element"&&t.key===r.key&&t.offset===r.offset?[0,0]:[Rl(t),Rl(r)]}function Ol(n,e){for(let t=e;t;t=t.getParent()){if(A(t)){if(t.collapseAtStart(n))return!0;if(qe(t))break}if(t.getPreviousSibling())break}return!1}const Cy=(()=>{try{const n=new RegExp("\\p{Emoji}","u"),e=n.test.bind(n);if(e("❤️")&&e("#️⃣")&&e("👍"))return e}catch{}return()=>!1})();function Fl(n,e,t){const r=n,s=r.getTextContent().split(/(?=\s)/g),o=s.length;let i=0,a=0;for(let u=0;u<o;u++){const c=u===o-1;if(a=i,i+=s[u].length,e&&i===t||i>t||c){s.splice(u,1),c&&(a=void 0);break}}const l=s.join("").trim();l===""?r.remove():(r.setTextContent(l),r.select(a,a))}function Ml(n,e,t,r){let s,o=e;if(Ne(n)){let i=!1;const a=n.childNodes,l=a.length,u=r._blockCursorElement;o===l&&(i=!0,o=l-1);let c=a[o],f=!1;if(c===u)c=a[o+1],f=!0;else if(u!==null){const d=u.parentNode;n===d&&e>Array.prototype.indexOf.call(d.children,u)&&o--}if(s=Zn(c),z(s))o=Ft(s,i?"next":"previous");else{let d=Zn(n);if(d===null)return null;if(A(d)){const h=r.getElementByKey(d.getKey());h===null&&$(214),[d,o]=d.getDOMSlot(h).resolveChildIndex(d,h,n,e),A(d)||$(215),i&&o>=d.getChildrenSize()&&(o=Math.max(0,d.getChildrenSize()-1));let m=d.getChildAtIndex(o);if(A(m)&&(function(y,x,p){const _=y.getParent();return p===null||_===null||!_.canBeEmpty()||_!==p.getNode()})(m,0,t)){const y=i?m.getLastDescendant():m.getFirstDescendant();y===null?d=m:(m=y,d=A(m)?m:m.getParentOrThrow()),o=0}z(m)?(s=m,d=null,o=Ft(m,i?"next":"previous")):m!==d&&i&&!f&&(A(d)||$(216),o=Math.min(d.getChildrenSize(),o+1))}else{const h=d.getIndexWithinParent();o=e===0&&he(d)&&Zn(n)===d?h:h+1,d=d.getParentOrThrow()}if(A(d))return Mt(d.__key,o,"element")}}else s=Zn(n);return z(s)?Mt(s.__key,Ft(s,o,"clamp"),"text"):null}function $l(n,e,t){const r=n.offset,s=n.getNode();if(r===0){const o=s.getPreviousSibling(),i=s.getParent();if(e){if((t||!e)&&o===null&&A(i)&&i.isInline()){const a=i.getPreviousSibling();z(a)&&n.set(a.__key,a.getTextContent().length,"text")}}else A(o)&&!t&&o.isInline()?n.set(o.__key,o.getChildrenSize(),"element"):z(o)&&n.set(o.__key,o.getTextContent().length,"text")}else if(r===s.getTextContent().length){const o=s.getNextSibling(),i=s.getParent();if(e&&A(o)&&o.isInline())n.set(o.__key,0,"element");else if((t||e)&&o===null&&A(i)&&i.isInline()&&!i.canInsertTextAfter()){const a=i.getNextSibling();z(a)&&n.set(a.__key,0,"text")}}}function Nf(n,e,t){if(n.type==="text"&&e.type==="text"){const r=n.isBefore(e),s=n.is(e);$l(n,r,s),$l(e,!r,s),s&&e.set(n.key,n.offset,n.type);const o=xe();if(o.isComposing()&&o._compositionKey!==n.key&&O(t)){const i=t.anchor,a=t.focus;n.set(i.key,i.offset,i.type,!0),e.set(a.key,a.offset,a.type,!0)}}}function Af(n,e,t,r,s,o){if(n===null||t===null||!Wr(s,n,t))return null;const i=Ml(n,e,O(o)?o.anchor:null,s);if(i===null)return null;const a=Ml(t,r,O(o)?o.focus:null,s);if(a===null)return null;if(i.type==="element"&&a.type==="element"){const l=Zn(n),u=Zn(t);if(he(l)&&he(u))return null}return Nf(i,a,o),[i,a]}function Os(n){return A(n)&&!n.isInline()}function Pf(n,e,t,r,s,o){const i=un(),a=new $n(Mt(n,e,s),Mt(t,r,o),0,"");return a.dirty=!0,i._selection=a,a}function no(){const n=Mt("root",0,"element"),e=Mt("root",0,"element");return new $n(n,e,0,"")}function fa(){return new to(new Set)}function ga(n,e,t,r){const s=t._window;if(s===null)return null;const o=r||s.event,i=o?o.type:void 0,a=i==="selectionchange",l=!Zo&&(a||i==="beforeinput"||i==="compositionstart"||i==="compositionend"||i==="click"&&o&&o.detail===3||i==="drop"||i===void 0);let u,c,f,d;if(O(n)&&!l)return n.clone();if(e===null)return null;if(u=e.anchorNode,c=e.focusNode,f=e.anchorOffset,d=e.focusOffset,(a||i===void 0)&&O(n)&&!Wr(t,u,c))return n.clone();const h=Af(u,f,c,d,t,n);if(h===null)return null;const[g,m]=h;return new $n(g,m,O(n)?n.format:0,O(n)?n.style:"")}function U(){return un()._selection}function Ln(){return xe()._editorState._selection}function Fs(n,e,t,r=1){const s=n.anchor,o=n.focus,i=s.getNode(),a=o.getNode();if(!e.is(i)&&!e.is(a))return;const l=e.__key;if(n.isCollapsed()){const u=s.offset;if(t<=u&&r>0||t<u&&r<0){const c=Math.max(0,u+r);s.set(l,c,"element"),o.set(l,c,"element"),Ll(n)}}else{const u=n.isBackward(),c=u?o:s,f=c.getNode(),d=u?s:o,h=d.getNode();if(e.is(f)){const g=c.offset;(t<=g&&r>0||t<g&&r<0)&&c.set(l,Math.max(0,g+r),"element")}if(e.is(h)){const g=d.offset;(t<=g&&r>0||t<g&&r<0)&&d.set(l,Math.max(0,g+r),"element")}}Ll(n)}function Ll(n){const e=n.anchor,t=e.offset,r=n.focus,s=r.offset,o=e.getNode(),i=r.getNode();if(n.isCollapsed()){if(!A(o))return;const a=o.getChildrenSize(),l=t>=a,u=l?o.getChildAtIndex(a-1):o.getChildAtIndex(t);if(z(u)){let c=0;l&&(c=u.getTextContentSize()),e.set(u.__key,c,"text"),r.set(u.__key,c,"text")}return}if(A(o)){const a=o.getChildrenSize(),l=t>=a,u=l?o.getChildAtIndex(a-1):o.getChildAtIndex(t);if(z(u)){let c=0;l&&(c=u.getTextContentSize()),e.set(u.__key,c,"text")}}if(A(i)){const a=i.getChildrenSize(),l=s>=a,u=l?i.getChildAtIndex(a-1):i.getChildAtIndex(s);if(z(u)){let c=0;l&&(c=u.getTextContentSize()),r.set(u.__key,c,"text")}}}function Ms(n,e,t,r,s){let o=null,i=0,a=null;r!==null?(o=r.__key,z(r)?(i=r.getTextContentSize(),a="text"):A(r)&&(i=r.getChildrenSize(),a="element")):s!==null&&(o=s.__key,z(s)?a="text":A(s)&&(a="element")),o!==null&&a!==null?n.set(o,i,a):(i=e.getIndexWithinParent(),i===-1&&(i=t.getChildrenSize()),n.set(t.__key,i,"element"))}function Dl(n,e,t,r,s){n.type==="text"?n.set(t,n.offset+(e?0:s),"text"):n.offset>r.getIndexWithinParent()&&n.set(n.key,n.offset-1,"element")}function If(n,e,t,r,s){try{n.setBaseAndExtent(e,t,r,s)}catch{}}function Ey(n,e,t,r,s,o,i){const a=r.anchorNode,l=r.focusNode,u=r.anchorOffset,c=r.focusOffset,f=document.activeElement;if(s.has(Tf)&&f!==o||f!==null&&xa(f))return;if(!O(e))return void(n!==null&&Wr(t,a,l)&&r.removeAllRanges());const d=e.anchor,h=e.focus,g=d.key,m=h.key,y=Pn(t,g),x=Pn(t,m),p=d.offset,_=h.offset,C=e.format,v=e.style,b=e.isCollapsed();let S=y,T=x,E=!1;if(d.type==="text"){S=ar(y);const D=d.getNode();E=D.getFormat()!==C||D.getStyle()!==v}else O(n)&&n.anchor.type==="text"&&(E=!0);var N,P,M,R,I;if(h.type==="text"&&(T=ar(x)),S!==null&&T!==null&&(b&&(n===null||E||O(n)&&(n.format!==C||n.style!==v))&&(N=C,P=v,M=p,R=g,I=performance.now(),_f=[N,P,M,R,I]),u!==p||c!==_||a!==S||l!==T||r.type==="Range"&&b||(f!==null&&o.contains(f)||s.has(hy)||o.focus({preventScroll:!0}),d.type==="element"))){if(If(r,S,p,T,_),!s.has(gy)&&e.isCollapsed()&&o!==null&&o===document.activeElement){const D=O(e)&&e.anchor.type==="element"?S.childNodes[p]||null:r.rangeCount>0?r.getRangeAt(0):null;if(D!==null){let L;if(D instanceof Text){const F=document.createRange();F.selectNode(D),L=F.getBoundingClientRect()}else L=D.getBoundingClientRect();(function(F,j,B){const G=Xf(B),Y=wa(G);if(G===null||Y===null)return;let{top:K,bottom:W}=j,V=0,oe=0,re=B;for(;re!==null;){const le=re===G.body;if(le)V=0,oe=ht(F).innerHeight;else{const ne=re.getBoundingClientRect();V=ne.top,oe=ne.bottom}let ee=0;if(K<V?ee=-(V-K):W>oe&&(ee=W-oe),ee!==0)if(le)Y.scrollBy(0,ee);else{const ne=re.scrollTop;re.scrollTop+=ee;const ie=re.scrollTop-ne;K-=ie,W-=ie}if(le)break;re=Vr(re)}})(t,L,o)}}di=!0}}function Ty(n){let e=U()||Ln();e===null&&(e=ke().selectEnd()),e.insertNodes(n)}function No(n){let e=n;n.isCollapsed()||e.removeText();const t=U();O(t)&&(e=t),O(e)||$(161);const r=e.anchor;let s=r.getNode(),o=r.offset;for(;!en(s);){const i=s;if([s,o]=wy(s,o),i.is(s))break}return o}function wy(n,e){const t=n.getParent();if(!t){const s=Te();return ke().append(s),s.select(),[ke(),0]}if(z(n)){const s=n.splitText(e);if(s.length===0)return[t,n.getIndexWithinParent()];const o=e===0?0:1;return[t,s[0].getIndexWithinParent()+o]}if(!A(n)||e===0)return[t,n.getIndexWithinParent()];const r=n.getChildAtIndex(e);if(r){const s=new $n(Mt(n.__key,e,"element"),Mt(n.__key,e,"element"),0,""),o=n.insertNewAfter(s);o&&o.append(r,...r.getNextSiblings())}return[t,n.getIndexWithinParent()+1]}function jl(n,e,t,r,s="decorators-and-blocks"){if(e==="move"&&r==="character"&&!n.isCollapsed()){const[c,f]=t===n.isBackward()?[n.focus,n.anchor]:[n.anchor,n.focus];return f.set(c.key,c.offset,c.type),!0}const o=Lt(n.focus,t?"previous":"next"),i=r==="lineboundary",a=e==="move";let l=o,u=s==="decorators-and-blocks";if(!ig(l)){for(const c of l){u=!1;const{origin:f}=c;if(!he(f)||f.isIsolated()||(l=c,!i||!f.isInline()))break}if(u)for(const c of Ra(o).iterNodeCarets(e==="extend"?"shadowRoot":"root")){if(ft(c))c.origin.isInline()||(l=c);else{if(A(c.origin))continue;he(c.origin)&&!c.origin.isInline()&&(l=c)}break}}if(l===o)return!1;if(a&&!i&&he(l.origin)&&l.origin.isKeyboardSelectable()){const c=fa();return c.add(l.origin.getKey()),Ke(c),!0}return l=at(l),a&&Fn(n.anchor,l),Fn(n.focus,l),u||!i}let Be=null,ze=null,nt=!1,Ao=!1,ps=0;const Bl={characterData:!0,childList:!0,subtree:!0};function zr(){return nt||Be!==null&&Be._readOnly}function je(){nt&&$(13)}function Rf(){ps>99&&$(14)}function un(){return Be===null&&$(195,Of()),Be}function xe(){return ze===null&&$(196,Of()),ze}function Of(){let n=0;const e=new Set,t=ir.version;if(typeof window<"u")for(const s of document.querySelectorAll("[contenteditable]")){const o=oo(s);if(ba(o))n++;else if(o){let i=String(o.constructor.version||"<0.17.1");i===t&&(i+=" (separately built, likely a bundler configuration issue)"),e.add(i)}}let r=` Detected on the page: ${n} compatible editor(s) with version ${t}`;return e.size&&(r+=` and incompatible editors with versions ${Array.from(e).join(", ")}`),r}function ky(){return ze}function zl(n,e,t){const r=e.__type,s=Bf(n,r);let o=t.get(r);o===void 0&&(o=Array.from(s.transforms),t.set(r,o));const i=o.length;for(let a=0;a<i&&(o[a](e),e.isAttached());a++);}function Ul(n,e){return n!==void 0&&n.__key!==e&&n.isAttached()}function Ff(n,e){if(!e)return;const t=n._updateTags;let r=e;Array.isArray(e)||(r=[e]);for(const s of r)t.add(s)}function Ny(n){return pa(n,xe()._nodes)}function pa(n,e){const t=n.type,r=e.get(t);r===void 0&&$(17,t);const s=r.klass;n.type!==s.getType()&&$(18,s.name);const o=s.importJSON(n),i=n.children;if(A(o)&&Array.isArray(i))for(let a=0;a<i.length;a++){const l=pa(i[a],e);o.append(l)}return o}function Kl(n,e,t){const r=Be,s=nt,o=ze;Be=e,nt=!0,ze=n;try{return t()}finally{Be=r,nt=s,ze=o}}function qt(n,e){const t=n._pendingEditorState,r=n._rootElement,s=n._headless||r===null;if(t===null)return;const o=n._editorState,i=o._selection,a=t._selection,l=n._dirtyType!==0,u=Be,c=nt,f=ze,d=n._updating,h=n._observer;let g=null;if(n._pendingEditorState=null,n._editorState=t,!s&&l&&h!==null){ze=n,Be=t,nt=!1,n._updating=!0;try{const b=n._dirtyType,S=n._dirtyElements,T=n._dirtyLeaves;h.disconnect(),g=Ym(o,t,n,b,S,T)}catch(b){if(b instanceof Error&&n._onError(b),Ao)throw b;return Df(n,null,r,t),Vd(n),n._dirtyType=2,Ao=!0,qt(n,o),void(Ao=!1)}finally{h.observe(r,Bl),n._updating=d,Be=u,nt=c,ze=f}}t._readOnly||(t._readOnly=!0);const m=n._dirtyLeaves,y=n._dirtyElements,x=n._normalizedNodes,p=n._updateTags,_=n._deferred;l&&(n._dirtyType=0,n._cloneNotNeeded.clear(),n._dirtyLeaves=new Set,n._dirtyElements=new Map,n._normalizedNodes=new Set,n._updateTags=new Set),(function(b,S){const T=b._decorators;let E=b._pendingDecorators||T;const N=S._nodeMap;let P;for(P in E)N.has(P)||(E===T&&(E=Hf(b)),delete E[P])})(n,t);const C=s?null:Et(ht(n));if(n._editable&&C!==null&&(l||a===null||a.dirty||!a.is(i))&&r!==null&&!p.has(py)){ze=n,Be=t;try{if(h!==null&&h.disconnect(),l||a===null||a.dirty){const b=n._blockCursorElement;b!==null&&xi(b,n,r),Ey(i,a,n,C,p,r)}(function(b,S,T){let E=b._blockCursorElement;if(O(T)&&T.isCollapsed()&&T.anchor.type==="element"&&S.contains(document.activeElement)){const N=T.anchor,P=N.getNode(),M=N.offset;let R=!1,I=null;if(M===P.getChildrenSize())Io(P.getChildAtIndex(M-1))&&(R=!0);else{const D=P.getChildAtIndex(M);if(D!==null&&Io(D)){const L=D.getPreviousSibling();(L===null||Io(L))&&(R=!0,I=b.getElementByKey(D.__key))}}if(R){const D=b.getElementByKey(P.__key);return E===null&&(b._blockCursorElement=E=(function(L){const F=L.theme,j=document.createElement("div");j.contentEditable="false",j.setAttribute("data-lexical-cursor","true");let B=F.blockCursor;if(B!==void 0){if(typeof B=="string"){const G=Bd(B);B=F.blockCursor=G}B!==void 0&&j.classList.add(...B)}return j})(b._config)),S.style.caretColor="transparent",void(I===null?D.appendChild(E):D.insertBefore(E,I))}}E!==null&&xi(E,b,S)})(n,r,a)}finally{h!==null&&h.observe(r,Bl),ze=f,Be=u}}g!==null&&(function(b,S,T,E,N){const P=Array.from(b._listeners.mutation),M=P.length;for(let R=0;R<M;R++){const[I,D]=P[R];for(const L of D){const F=S.get(L);F!==void 0&&I(F,{dirtyLeaves:E,prevEditorState:N,updateTags:T})}}})(n,g,p,m,o),O(a)||a===null||i!==null&&i.is(a)||n.dispatchCommand(ef,void 0);const v=n._pendingDecorators;v!==null&&(n._decorators=v,n._pendingDecorators=null,wr("decorator",n,!0,v)),(function(b,S,T){const E=ql(S),N=ql(T);E!==N&&wr("textcontent",b,!0,N)})(n,e||o,t),wr("update",n,!0,{dirtyElements:y,dirtyLeaves:m,editorState:t,mutatedNodes:g,normalizedNodes:x,prevEditorState:e||o,tags:p}),(function(b,S){if(b._deferred=[],S.length!==0){const T=b._updating;b._updating=!0;try{for(let E=0;E<S.length;E++)S[E]()}finally{b._updating=T}}})(n,_),(function(b){const S=b._updates;if(S.length!==0){const T=S.shift();if(T){const[E,N]=T;ro(b,E,N)}}})(n)}function wr(n,e,t,...r){const s=e._updating;e._updating=t;try{const o=Array.from(e._listeners[n]);for(let i=0;i<o.length;i++)o[i].apply(null,r)}finally{e._updating=s}}function Wl(n,e){const t=n._updates;let r=e||!1;for(;t.length!==0;){const s=t.shift();if(s){const[o,i]=s,a=n._pendingEditorState;let l;i!==void 0&&(l=i.onUpdate,i.skipTransforms&&(r=!0),i.discrete&&(a===null&&$(191),a._flushSync=!0),l&&n._deferred.push(l),Ff(n,i.tag)),a==null?ro(n,o,i):o()}}return r}function ro(n,e,t){const r=n._updateTags;let s,o=!1,i=!1;t!==void 0&&(s=t.onUpdate,Ff(n,t.tag),o=t.skipTransforms||!1,i=t.discrete||!1),s&&n._deferred.push(s);const a=n._editorState;let l=n._pendingEditorState,u=!1;(l===null||l._readOnly)&&(l=n._pendingEditorState=Mf(l||a),u=!0),l._flushSync=i;const c=Be,f=nt,d=ze,h=n._updating;Be=l,nt=!1,n._updating=!0,ze=n;const g=n._headless||n.getRootElement()===null;_a(null);try{u&&(g?a._selection!==null&&(l._selection=a._selection.clone()):l._selection=(function(p,_){const C=p.getEditorState()._selection,v=Et(ht(p));return O(C)||C==null?ga(C,v,p,_):C.clone()})(n,t&&t.event||null));const y=n._compositionKey;e(),o=Wl(n,o),(function(p,_){const C=_.getEditorState()._selection,v=p._selection;if(O(v)){const b=v.anchor,S=v.focus;let T;if(b.type==="text"&&(T=b.getNode(),T.selectionTransform(C,v)),S.type==="text"){const E=S.getNode();T!==E&&E.selectionTransform(C,v)}}})(l,n),n._dirtyType!==0&&(o?(function(p,_){const C=_._dirtyLeaves,v=p._nodeMap;for(const b of C){const S=v.get(b);z(S)&&S.isAttached()&&S.isSimpleText()&&!S.isUnmergeable()&&bl(S)}})(l,n):(function(p,_){const C=_._dirtyLeaves,v=_._dirtyElements,b=p._nodeMap,S=rn(),T=new Map;let E=C,N=E.size,P=v,M=P.size;for(;N>0||M>0;){if(N>0){_._dirtyLeaves=new Set;for(const R of E){const I=b.get(R);z(I)&&I.isAttached()&&I.isSimpleText()&&!I.isUnmergeable()&&bl(I),I!==void 0&&Ul(I,S)&&zl(_,I,T),C.add(R)}if(E=_._dirtyLeaves,N=E.size,N>0){ps++;continue}}_._dirtyLeaves=new Set,_._dirtyElements=new Map,P.delete("root")&&P.set("root",!0);for(const R of P){const I=R[0],D=R[1];if(v.set(I,D),!D)continue;const L=b.get(I);L!==void 0&&Ul(L,S)&&zl(_,L,T)}E=_._dirtyLeaves,N=E.size,P=_._dirtyElements,M=P.size,ps++}_._dirtyLeaves=C,_._dirtyElements=v})(l,n),Wl(n),(function(p,_,C,v){const b=p._nodeMap,S=_._nodeMap,T=[];for(const[E]of v){const N=S.get(E);N!==void 0&&(N.isAttached()||(A(N)&&Ud(N,E,b,S,T,v),b.has(E)||v.delete(E),T.push(E)))}for(const E of T)S.delete(E);for(const E of C){const N=S.get(E);N===void 0||N.isAttached()||(b.has(E)||C.delete(E),S.delete(E))}})(a,l,n._dirtyLeaves,n._dirtyElements)),y!==n._compositionKey&&(l._flushSync=!0);const x=l._selection;if(O(x)){const p=l._nodeMap,_=x.anchor.key,C=x.focus.key;p.get(_)!==void 0&&p.get(C)!==void 0||$(19)}else Me(x)&&x._nodes.size===0&&(l._selection=null)}catch(y){return y instanceof Error&&n._onError(y),n._pendingEditorState=a,n._dirtyType=2,n._cloneNotNeeded.clear(),n._dirtyLeaves=new Set,n._dirtyElements.clear(),void qt(n)}finally{Be=c,nt=f,ze=d,n._updating=h,ps=0}n._dirtyType!==0||n._deferred.length>0||(function(y,x){const p=x.getEditorState()._selection,_=y._selection;if(_!==null){if(_.dirty||!_.is(p))return!0}else if(p!==null)return!0;return!1})(l,n)?l._flushSync?(l._flushSync=!1,qt(n)):u&&Oy(()=>{qt(n)}):(l._flushSync=!1,u&&(r.clear(),n._deferred=[],n._pendingEditorState=null))}function Rt(n,e,t){ze===n&&t===void 0?e():ro(n,e,t)}class kr{element;before;after;constructor(e,t,r){this.element=e,this.before=t||null,this.after=r||null}withBefore(e){return new kr(this.element,e,this.after)}withAfter(e){return new kr(this.element,this.before,e)}withElement(e){return this.element===e?this:new kr(e,this.before,this.after)}insertChild(e){const t=this.before||this.getManagedLineBreak();return t!==null&&t.parentElement!==this.element&&$(222),this.element.insertBefore(e,t),this}removeChild(e){return e.parentElement!==this.element&&$(223),this.element.removeChild(e),this}replaceChild(e,t){return t.parentElement!==this.element&&$(224),this.element.replaceChild(e,t),this}getFirstChild(){const e=this.after?this.after.nextSibling:this.element.firstChild;return e===this.before||e===this.getManagedLineBreak()?null:e}getManagedLineBreak(){return this.element.__lexicalLineBreak||null}setManagedLineBreak(e){if(e===null)this.removeManagedLineBreak();else{const t=e==="decorator"&&(Br||cr||jr);this.insertManagedLineBreak(t)}}removeManagedLineBreak(){const e=this.getManagedLineBreak();if(e){const t=this.element,r=e.nodeName==="IMG"?e.nextSibling:null;r&&t.removeChild(r),t.removeChild(e),t.__lexicalLineBreak=void 0}}insertManagedLineBreak(e){const t=this.getManagedLineBreak();if(t){if(e===(t.nodeName==="IMG"))return;this.removeManagedLineBreak()}const r=this.element,s=this.before,o=document.createElement("br");if(r.insertBefore(o,s),e){const i=document.createElement("img");i.setAttribute("data-lexical-linebreak","true"),i.style.cssText="display: inline !important; border: 0px !important; margin: 0px !important;",i.alt="",r.insertBefore(i,o),r.__lexicalLineBreak=i}else r.__lexicalLineBreak=o}getFirstChildOffset(){let e=0;for(let t=this.after;t!==null;t=t.previousSibling)e++;return e}resolveChildIndex(e,t,r,s){if(r===this.element){const l=this.getFirstChildOffset();return[e,Math.min(l+e.getChildrenSize(),Math.max(l,s))]}const o=Vl(t,r);o.push(s);const i=Vl(t,this.element);let a=e.getIndexWithinParent();for(let l=0;l<i.length;l++){const u=o[l],c=i[l];if(u===void 0||u<c)break;if(u>c){a+=1;break}}return[e.getParentOrThrow(),a]}}function Vl(n,e){const t=[];let r=e;for(;r!==n&&r!==null;r=r.parentNode){let s=0;for(let o=r.previousSibling;o!==null;o=o.previousSibling)s++;t.push(s)}return r!==n&&$(225),t.reverse()}class lt extends Pt{__first;__last;__size;__format;__style;__indent;__dir;__textFormat;__textStyle;constructor(e){super(e),this.__first=null,this.__last=null,this.__size=0,this.__format=0,this.__style="",this.__indent=0,this.__dir=null,this.__textFormat=0,this.__textStyle=""}afterCloneFrom(e){super.afterCloneFrom(e),this.__key===e.__key&&(this.__first=e.__first,this.__last=e.__last,this.__size=e.__size),this.__indent=e.__indent,this.__format=e.__format,this.__style=e.__style,this.__dir=e.__dir,this.__textFormat=e.__textFormat,this.__textStyle=e.__textStyle}getFormat(){return this.getLatest().__format}getFormatType(){const e=this.getFormat();return $m[e]||""}getStyle(){return this.getLatest().__style}getIndent(){return this.getLatest().__indent}getChildren(){const e=[];let t=this.getFirstChild();for(;t!==null;)e.push(t),t=t.getNextSibling();return e}getChildrenKeys(){const e=[];let t=this.getFirstChild();for(;t!==null;)e.push(t.__key),t=t.getNextSibling();return e}getChildrenSize(){return this.getLatest().__size}isEmpty(){return this.getChildrenSize()===0}isDirty(){const e=xe()._dirtyElements;return e!==null&&e.has(this.__key)}isLastChild(){const e=this.getLatest(),t=this.getParentOrThrow().getLastChild();return t!==null&&t.is(e)}getAllTextNodes(){const e=[];let t=this.getFirstChild();for(;t!==null;){if(z(t)&&e.push(t),A(t)){const r=t.getAllTextNodes();e.push(...r)}t=t.getNextSibling()}return e}getFirstDescendant(){let e=this.getFirstChild();for(;A(e);){const t=e.getFirstChild();if(t===null)break;e=t}return e}getLastDescendant(){let e=this.getLastChild();for(;A(e);){const t=e.getLastChild();if(t===null)break;e=t}return e}getDescendantByIndex(e){const t=this.getChildren(),r=t.length;if(e>=r){const o=t[r-1];return A(o)&&o.getLastDescendant()||o||null}const s=t[e];return A(s)&&s.getFirstDescendant()||s||null}getFirstChild(){const e=this.getLatest().__first;return e===null?null:Oe(e)}getFirstChildOrThrow(){const e=this.getFirstChild();return e===null&&$(45,this.__key),e}getLastChild(){const e=this.getLatest().__last;return e===null?null:Oe(e)}getLastChildOrThrow(){const e=this.getLastChild();return e===null&&$(96,this.__key),e}getChildAtIndex(e){const t=this.getChildrenSize();let r,s;if(e<t/2){for(r=this.getFirstChild(),s=0;r!==null&&s<=e;){if(s===e)return r;r=r.getNextSibling(),s++}return null}for(r=this.getLastChild(),s=t-1;r!==null&&s>=e;){if(s===e)return r;r=r.getPreviousSibling(),s--}return null}getTextContent(){let e="";const t=this.getChildren(),r=t.length;for(let s=0;s<r;s++){const o=t[s];e+=o.getTextContent(),A(o)&&s!==r-1&&!o.isInline()&&(e+=ln)}return e}getTextContentSize(){let e=0;const t=this.getChildren(),r=t.length;for(let s=0;s<r;s++){const o=t[s];e+=o.getTextContentSize(),A(o)&&s!==r-1&&!o.isInline()&&(e+=2)}return e}getDirection(){return this.getLatest().__dir}getTextFormat(){return this.getLatest().__textFormat}hasFormat(e){if(e!==""){const t=gl[e];return(this.getFormat()&t)!==0}return!1}hasTextFormat(e){const t=wn[e];return(this.getTextFormat()&t)!==0}getFormatFlags(e,t){return $s(this.getLatest().__textFormat,e,t)}getTextStyle(){return this.getLatest().__textStyle}select(e,t){je();const r=U();let s=e,o=t;const i=this.getChildrenSize();if(!this.canBeEmpty()){if(e===0&&t===0){const l=this.getFirstChild();if(z(l)||A(l))return l.select(0,0)}else if(!(e!==void 0&&e!==i||t!==void 0&&t!==i)){const l=this.getLastChild();if(z(l)||A(l))return l.select()}}s===void 0&&(s=i),o===void 0&&(o=i);const a=this.__key;return O(r)?(r.anchor.set(a,s,"element"),r.focus.set(a,o,"element"),r.dirty=!0,r):Pf(a,s,a,o,"element","element")}selectStart(){const e=this.getFirstDescendant();return e?e.selectStart():this.select()}selectEnd(){const e=this.getLastDescendant();return e?e.selectEnd():this.select()}clear(){const e=this.getWritable();return this.getChildren().forEach(t=>t.remove()),e}append(...e){return this.splice(this.getChildrenSize(),0,e)}setDirection(e){const t=this.getWritable();return t.__dir=e,t}setFormat(e){return this.getWritable().__format=e!==""?gl[e]:0,this}setStyle(e){return this.getWritable().__style=e||"",this}setTextFormat(e){const t=this.getWritable();return t.__textFormat=e,t}setTextStyle(e){const t=this.getWritable();return t.__textStyle=e,t}setIndent(e){return this.getWritable().__indent=e,this}splice(e,t,r){Rs(this)&&$(324,this.__key,this.__type);const s=this.getChildrenSize(),o=this.getWritable();e+t<=s||$(226,String(e),String(t),String(s));const i=o.__key,a=[],l=[],u=this.getChildAtIndex(e+t);let c=null,f=s-t+r.length;if(e!==0)if(e===s)c=this.getLastChild();else{const h=this.getChildAtIndex(e);h!==null&&(c=h.getPreviousSibling())}if(t>0){let h=c===null?this.getFirstChild():c.getNextSibling();for(let g=0;g<t;g++){h===null&&$(100);const m=h.getNextSibling(),y=h.__key;bn(h.getWritable()),l.push(y),h=m}}let d=c;for(const h of r){d!==null&&h.is(d)&&(c=d=d.getPreviousSibling());const g=h.getWritable();g.__parent===i&&f--,bn(g);const m=h.__key;if(d===null)o.__first=m,g.__prev=null;else{const y=d.getWritable();y.__next=m,g.__prev=y.__key}h.__key===i&&$(76),g.__parent=i,a.push(m),d=h}if(e+t===s)d!==null&&(d.getWritable().__next=null,o.__last=d.__key);else if(u!==null){const h=u.getWritable();if(d!==null){const g=d.getWritable();h.__prev=d.__key,g.__next=u.__key}else h.__prev=null}if(o.__size=f,l.length){const h=U();if(O(h)){const g=new Set(l),m=new Set(a),{anchor:y,focus:x}=h;Hl(y,g,m)&&Ms(y,y.getNode(),this,c,u),Hl(x,g,m)&&Ms(x,x.getNode(),this,c,u),f!==0||this.canBeEmpty()||qe(this)||this.remove()}}return o}getDOMSlot(e){return new kr(e)}exportDOM(e){const{element:t}=super.exportDOM(e);if(Ne(t)){const r=this.getIndent();r>0&&(t.style.paddingInlineStart=40*r+"px");const s=this.getDirection();s&&(t.dir=s)}return{element:t}}exportJSON(){const e={children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),...super.exportJSON()},t=this.getTextFormat(),r=this.getTextStyle();return t===0&&r===""||qe(this)||this.getChildren().some(z)||(t!==0&&(e.textFormat=t),r!==""&&(e.textStyle=r)),e}updateFromJSON(e){return super.updateFromJSON(e).setFormat(e.format).setIndent(e.indent).setDirection(e.direction).setTextFormat(e.textFormat||0).setTextStyle(e.textStyle||"")}insertNewAfter(e,t){return null}canIndent(){return!0}collapseAtStart(e){return!1}excludeFromCopy(e){return!1}canReplaceWith(e){return!0}canInsertAfter(e){return!0}canBeEmpty(){return!0}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}isInline(){return!1}isShadowRoot(){return!1}canMergeWith(e){return!1}extractWithChild(e,t,r){return!1}canMergeWhenEmpty(){return!1}reconcileObservedMutation(e,t){const r=this.getDOMSlot(e);let s=r.getFirstChild();for(let o=this.getFirstChild();o;o=o.getNextSibling()){const i=t.getElementByKey(o.getKey());i!==null&&(s==null?(r.insertChild(i),s=i):s!==i&&r.replaceChild(i,s),s=s.nextSibling)}}}function A(n){return n instanceof lt}function Hl(n,e,t){let r=n.getNode();for(;r;){const s=r.__key;if(e.has(s)&&!t.has(s))return!0;r=r.getParent()}return!1}class ha extends Pt{decorate(e,t){return null}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}}function he(n){return n instanceof ha}class gr extends lt{__cachedText;static getType(){return"root"}static clone(){return new gr}constructor(){super("root"),this.__cachedText=null}getTopLevelElementOrThrow(){$(51)}getTextContent(){const e=this.__cachedText;return!zr()&&xe()._dirtyType!==0||e===null?super.getTextContent():e}remove(){$(52)}replace(e){$(53)}insertBefore(e){$(54)}insertAfter(e){$(55)}updateDOM(e,t){return!1}splice(e,t,r){for(const s of r)A(s)||he(s)||$(282);return super.splice(e,t,r)}static importJSON(e){return ke().updateFromJSON(e)}collapseAtStart(){return!0}}function Le(n){return n instanceof gr}function Mf(n){return new Ur(new Map(n._nodeMap))}function ma(){return new Ur(new Map([["root",new gr]]))}function $f(n){const e=n.exportJSON(),t=n.constructor;if(e.type!==t.getType()&&$(130,t.name),A(n)){const r=e.children;Array.isArray(r)||$(59,t.name);const s=n.getChildren();for(let o=0;o<s.length;o++){const i=$f(s[o]);r.push(i)}}return e}function Ay(n){return n instanceof Ur}class Ur{_nodeMap;_selection;_flushSync;_readOnly;constructor(e,t){this._nodeMap=e,this._selection=t||null,this._flushSync=!1,this._readOnly=!1}isEmpty(){return this._nodeMap.size===1&&this._selection===null}read(e,t){return Kl(t&&t.editor||null,this,e)}clone(e){const t=new Ur(this._nodeMap,e===void 0?this._selection:e);return t._readOnly=!0,t}toJSON(){return Kl(null,this,()=>({root:$f(ke())}))}}class ya extends lt{static getType(){return"artificial"}createDOM(e){return document.createElement("div")}}class pr extends lt{static getType(){return"paragraph"}static clone(e){return new pr(e.__key)}createDOM(e){const t=document.createElement("p"),r=rr(e.theme,"paragraph");return r!==void 0&&t.classList.add(...r),t}updateDOM(e,t,r){return!1}static importDOM(){return{p:e=>({conversion:Py,priority:0})}}exportDOM(e){const{element:t}=super.exportDOM(e);if(Ne(t)){this.isEmpty()&&t.append(document.createElement("br"));const r=this.getFormatType();r&&(t.style.textAlign=r)}return{element:t}}static importJSON(e){return Te().updateFromJSON(e)}exportJSON(){const e=super.exportJSON();if(e.textFormat===void 0||e.textStyle===void 0){const t=this.getChildren().find(z);t?(e.textFormat=t.getFormat(),e.textStyle=t.getStyle()):(e.textFormat=this.getTextFormat(),e.textStyle=this.getTextStyle())}return e}insertNewAfter(e,t){const r=Te();r.setTextFormat(e.format),r.setTextStyle(e.style);const s=this.getDirection();return r.setDirection(s),r.setFormat(this.getFormatType()),r.setStyle(this.getStyle()),this.insertAfter(r,t),r}collapseAtStart(){const e=this.getChildren();if(e.length===0||z(e[0])&&e[0].getTextContent().trim()===""){if(this.getNextSibling()!==null)return this.selectNext(),this.remove(),!0;if(this.getPreviousSibling()!==null)return this.selectPrevious(),this.remove(),!0}return!1}}function Py(n){const e=Te();return n.style&&(e.setFormat(n.style.textAlign),Na(n,e)),{node:e}}function Te(){return mt(new pr)}function Kr(n){return n instanceof pr}const ge=0,Xe=1,Lf=4;function Df(n,e,t,r){const s=n._keyToDOMMap;s.clear(),n._editorState=ma(),n._pendingEditorState=r,n._compositionKey=null,n._dirtyType=0,n._cloneNotNeeded.clear(),n._dirtyLeaves=new Set,n._dirtyElements.clear(),n._normalizedNodes=new Set,n._updateTags=new Set,n._updates=[],n._blockCursorElement=null;const o=n._observer;o!==null&&(o.disconnect(),n._observer=null),e!==null&&(e.textContent=""),t!==null&&(t.textContent="",s.set("root",t))}function Iy(n){const e=new Set,t=new Set;let r=n;for(;r;){const{ownNodeConfig:s}=co(r),o=r.transform;if(!t.has(o)){t.add(o);const i=r.transform();i&&e.add(i)}if(s){const i=s.$transform;i&&e.add(i),r=s.extends}else{const i=Object.getPrototypeOf(r);r=i.prototype instanceof Pt&&i!==Pt?i:void 0}}return e}function jf(n){const e=n||{},t=ky(),r=e.theme||{},s=n===void 0?t:e.parentEditor||null,o=e.disableEvents||!1,i=ma(),a=e.namespace||(s!==null?s._config.namespace:Gf()),l=e.editorState,u=[gr,Dt,ur,dr,pr,ya,...e.nodes||[]],{onError:c,html:f}=e,d=e.editable===void 0||e.editable;let h;if(n===void 0&&t!==null)h=t._nodes;else{h=new Map;for(let m=0;m<u.length;m++){let y=u[m],x=null,p=null;if(typeof y!="function"){const v=y;y=v.replace,x=v.with,p=v.withKlass||null}co(y);const _=y.getType(),C=Iy(y);h.set(_,{exportDOM:f&&f.export?f.export.get(y):void 0,klass:y,replace:x,replaceWithKlass:p,sharedNodeState:Vm(u[m]),transforms:C})}}const g=new ir(i,s,h,{disableEvents:o,namespace:a,theme:r},c||console.error,(function(m,y){const x=new Map,p=new Set,_=C=>{Object.keys(C).forEach(v=>{let b=x.get(v);b===void 0&&(b=[],x.set(v,b)),b.push(C[v])})};return m.forEach(C=>{const v=C.klass.importDOM;if(v==null||p.has(v))return;p.add(v);const b=v.call(C.klass);b!==null&&_(b)}),y&&_(y),x})(h,f?f.import:void 0),d,n);return l!==void 0&&(g._pendingEditorState=l,g._dirtyType=2),(function(m){m.registerCommand(tf,oy,ge),m.registerCommand(nf,iy,ge),m.registerCommand(rf,ay,ge),m.registerCommand(sf,ly,ge),m.registerCommand(lf,cy,ge)})(g),g}class ir{static version;_headless;_parentEditor;_rootElement;_editorState;_pendingEditorState;_compositionKey;_deferred;_keyToDOMMap;_updates;_updating;_listeners;_commands;_nodes;_decorators;_pendingDecorators;_config;_dirtyType;_cloneNotNeeded;_dirtyLeaves;_dirtyElements;_normalizedNodes;_updateTags;_observer;_key;_onError;_htmlConversions;_window;_editable;_blockCursorElement;_createEditorArgs;constructor(e,t,r,s,o,i,a,l){this._createEditorArgs=l,this._parentEditor=t,this._rootElement=null,this._editorState=e,this._pendingEditorState=null,this._compositionKey=null,this._deferred=[],this._keyToDOMMap=new Map,this._updates=[],this._updating=!1,this._listeners={decorator:new Set,editable:new Set,mutation:new Map,root:new Set,textcontent:new Set,update:new Set},this._commands=new Map,this._config=s,this._nodes=r,this._decorators={},this._pendingDecorators=null,this._dirtyType=0,this._cloneNotNeeded=new Set,this._dirtyLeaves=new Set,this._dirtyElements=new Map,this._normalizedNodes=new Set,this._updateTags=new Set,this._observer=null,this._key=Gf(),this._onError=o,this._htmlConversions=i,this._editable=a,this._headless=t!==null&&t._headless,this._window=null,this._blockCursorElement=null}isComposing(){return this._compositionKey!=null}registerUpdateListener(e){const t=this._listeners.update;return t.add(e),()=>{t.delete(e)}}registerEditableListener(e){const t=this._listeners.editable;return t.add(e),()=>{t.delete(e)}}registerDecoratorListener(e){const t=this._listeners.decorator;return t.add(e),()=>{t.delete(e)}}registerTextContentListener(e){const t=this._listeners.textcontent;return t.add(e),()=>{t.delete(e)}}registerRootListener(e){const t=this._listeners.root;return e(this._rootElement,null),t.add(e),()=>{e(null,this._rootElement),t.delete(e)}}registerCommand(e,t,r){r===void 0&&$(35);const s=this._commands;s.has(e)||s.set(e,[new Set,new Set,new Set,new Set,new Set]);const o=s.get(e);o===void 0&&$(36,String(e));const i=o[r];return i.add(t),()=>{i.delete(t),o.every(a=>a.size===0)&&s.delete(e)}}registerMutationListener(e,t,r){const s=this.resolveRegisteredNodeAfterReplacements(this.getRegisteredNode(e)).klass,o=this._listeners.mutation;let i=o.get(t);i===void 0&&(i=new Set,o.set(t,i)),i.add(s);const a=r&&r.skipInitialization;return a!==void 0&&a||this.initializeMutationListener(t,s),()=>{i.delete(s),i.size===0&&o.delete(t)}}getRegisteredNode(e){const t=this._nodes.get(e.getType());return t===void 0&&$(37,e.name),t}resolveRegisteredNodeAfterReplacements(e){for(;e.replaceWithKlass;)e=this.getRegisteredNode(e.replaceWithKlass);return e}initializeMutationListener(e,t){const r=this._editorState,s=ec(r).get(t.getType());if(!s)return;const o=new Map;for(const i of s.keys())o.set(i,"created");o.size>0&&e(o,{dirtyLeaves:new Set,prevEditorState:r,updateTags:new Set(["registerMutationListener"])})}registerNodeTransformToKlass(e,t){const r=this.getRegisteredNode(e);return r.transforms.add(t),r}registerNodeTransform(e,t){const r=this.registerNodeTransformToKlass(e,t),s=[r],o=r.replaceWithKlass;if(o!=null){const i=this.registerNodeTransformToKlass(o,t);s.push(i)}return(function(i,a){const l=ec(i.getEditorState()),u=[];for(const c of a){const f=l.get(c);f&&u.push(f)}u.length!==0&&i.update(()=>{for(const c of u)for(const f of c.keys()){const d=Oe(f);d&&d.markDirty()}},i._pendingEditorState===null?{tag:nr}:void 0)})(this,s.map(i=>i.klass.getType())),()=>{s.forEach(i=>i.transforms.delete(t))}}hasNode(e){return this._nodes.has(e.getType())}hasNodes(e){return e.every(this.hasNode.bind(this))}dispatchCommand(e,t){return H(this,e,t)}getDecorators(){return this._decorators}getRootElement(){return this._rootElement}getKey(){return this._key}setRootElement(e){const t=this._rootElement;if(e!==t){const r=rr(this._config.theme,"root"),s=this._pendingEditorState||this._editorState;if(this._rootElement=e,Df(this,t,e,s),t!==null&&(this._config.disableEvents||uy(t),r!=null&&t.classList.remove(...r)),e!==null){const o=wa(e),i=e.style;i.userSelect="text",i.whiteSpace="pre-wrap",i.wordBreak="break-word",e.setAttribute("data-lexical-editor","true"),this._window=o,this._dirtyType=2,Vd(this),this._updateTags.add(nr),qt(this),this._config.disableEvents||(function(a,l){const u=a.ownerDocument;ui.set(a,u);const c=Ps.get(u)??0;c<1&&u.addEventListener("selectionchange",Cf),Ps.set(u,c+1),a.__lexicalEditor=l;const f=Sf(a);for(let d=0;d<ci.length;d++){const[h,g]=ci[d],m=typeof g=="function"?y=>{kl(y)||(wl(y),(l.isEditable()||h==="click")&&g(y,l))}:y=>{if(kl(y))return;wl(y);const x=l.isEditable();switch(h){case"cut":return x&&H(l,ua,y);case"copy":return H(l,Qs,y);case"paste":return x&&H(l,Xs,y);case"dragstart":return x&&H(l,pf,y);case"dragover":return x&&H(l,hf,y);case"dragend":return x&&H(l,ty,y);case"focus":return x&&H(l,ny,y);case"blur":return x&&H(l,ry,y);case"drop":return x&&H(l,gf,y)}};a.addEventListener(h,m),f.push(()=>{a.removeEventListener(h,m)})}})(e,this),r!=null&&e.classList.add(...r)}else this._window=null,this._updateTags.add(nr),qt(this);wr("root",this,!1,e,t)}}getElementByKey(e){return this._keyToDOMMap.get(e)||null}getEditorState(){return this._editorState}setEditorState(e,t){e.isEmpty()&&$(38);let r=e;r._readOnly&&(r=Mf(e),r._selection=e._selection?e._selection.clone():null),Wd(this);const s=this._pendingEditorState,o=this._updateTags,i=t!==void 0?t.tag:null;s===null||s.isEmpty()||(i!=null&&o.add(i),qt(this)),this._pendingEditorState=r,this._dirtyType=2,this._dirtyElements.set("root",!1),this._compositionKey=null,i!=null&&o.add(i),this._updating||qt(this)}parseEditorState(e,t){return(function(r,s,o){const i=ma(),a=Be,l=nt,u=ze,c=s._dirtyElements,f=s._dirtyLeaves,d=s._cloneNotNeeded,h=s._dirtyType;s._dirtyElements=new Map,s._dirtyLeaves=new Set,s._cloneNotNeeded=new Set,s._dirtyType=0,Be=i,nt=!1,ze=s,_a(null);try{const g=s._nodes;pa(r.root,g),o&&o(),i._readOnly=!0}catch(g){g instanceof Error&&s._onError(g)}finally{s._dirtyElements=c,s._dirtyLeaves=f,s._cloneNotNeeded=d,s._dirtyType=h,Be=a,nt=l,ze=u}return i})(typeof e=="string"?JSON.parse(e):e,this,t)}read(e){return qt(this),this.getEditorState().read(e,{editor:this})}update(e,t){(function(r,s,o){r._updating?r._updates.push([s,o]):ro(r,s,o)})(this,e,t)}focus(e,t={}){const r=this._rootElement;r!==null&&(r.setAttribute("autocapitalize","off"),Rt(this,()=>{const s=U(),o=ke();s!==null?s.dirty||Ke(s.clone()):o.getChildrenSize()!==0&&(t.defaultSelection==="rootStart"?o.selectStart():o.selectEnd()),$y("focus"),Ly(()=>{r.removeAttribute("autocapitalize"),e&&e()})}),this._pendingEditorState===null&&r.removeAttribute("autocapitalize"))}blur(){const e=this._rootElement;e!==null&&e.blur();const t=Et(this._window);t!==null&&t.removeAllRanges()}isEditable(){return this._editable}setEditable(e){this._editable!==e&&(this._editable=e,wr("editable",this,!0,e))}toJSON(){return{editorState:this._editorState.toJSON()}}}ir.version="0.39.0+prod.esm";let yi=null;function _a(n){yi=n}let Ry=1;function Bf(n,e){const t=va(n,e);return t===void 0&&$(30,e),t}function va(n,e){return n._nodes.get(e)}const Oy=typeof queueMicrotask=="function"?queueMicrotask:n=>{Promise.resolve().then(n)};function zf(n){return he($t(n))}function xa(n){const e=document.activeElement;if(!Ne(e))return!1;const t=e.nodeName;return he($t(n))&&(t==="INPUT"||t==="TEXTAREA"||e.contentEditable==="true"&&oo(e)==null)}function Wr(n,e,t){const r=n.getRootElement();try{return r!==null&&r.contains(e)&&r.contains(t)&&e!==null&&!xa(e)&&so(e)===n}catch{return!1}}function ba(n){return n instanceof ir}function so(n){let e=n;for(;e!=null;){const t=oo(e);if(ba(t))return t;e=Vr(e)}return null}function oo(n){return n?n.__lexicalEditor:null}function xn(n){return eo(n)||n.isToken()}function Vt(n){return xn(n)||n.isSegmented()}function Xt(n){return Dn(n)&&n.nodeType===3}function Uf(n){return Dn(n)&&n.nodeType===9}function ar(n){let e=n;for(;e!=null;){if(Xt(e))return e;e=e.firstChild}return null}function $s(n,e,t){const r=wn[e];if(t!==null&&(n&r)===(t&r))return n;let s=n^r;return e==="subscript"?s&=-65:e==="superscript"?s&=-33:e==="lowercase"?(s&=-513,s&=-1025):e==="uppercase"?(s&=-257,s&=-1025):e==="capitalize"&&(s&=-257,s&=-513),s}function Kf(n){return z(n)||It(n)||he(n)}function Wf(n,e){const t=(function(){const i=yi;return yi=null,i})();if((e=e||t&&t.__key)!=null)return void(n.__key=e);je(),Rf();const r=xe(),s=un(),o=""+Ry++;s._nodeMap.set(o,n),A(n)?r._dirtyElements.set(o,!0):r._dirtyLeaves.add(o),r._cloneNotNeeded.add(o),r._dirtyType=1,n.__key=o}function bn(n){const e=n.getParent();if(e!==null){const t=n.getWritable(),r=e.getWritable(),s=n.getPreviousSibling(),o=n.getNextSibling(),i=o!==null?o.__key:null,a=s!==null?s.__key:null,l=s!==null?s.getWritable():null,u=o!==null?o.getWritable():null;s===null&&(r.__first=i),o===null&&(r.__last=a),l!==null&&(l.__next=i),u!==null&&(u.__prev=a),t.__prev=null,t.__next=null,t.__parent=null,r.__size--}}function Ls(n){Rf(),Rs(n)&&$(323,n.__key,n.__type);const e=n.getLatest(),t=e.__parent,r=un(),s=xe(),o=r._nodeMap,i=s._dirtyElements;t!==null&&(function(l,u,c){let f=l;for(;f!==null;){if(c.has(f))return;const d=u.get(f);if(d===void 0)break;c.set(f,!1),f=d.__parent}})(t,o,i);const a=e.__key;s._dirtyType=1,A(n)?i.set(a,!0):s._dirtyLeaves.add(a)}function Ue(n){je();const e=xe(),t=e._compositionKey;if(n!==t){if(e._compositionKey=n,t!==null){const r=Oe(t);r!==null&&r.getWritable()}if(n!==null){const r=Oe(n);r!==null&&r.getWritable()}}}function rn(){return zr()?null:xe()._compositionKey}function Oe(n,e){const t=(e||un())._nodeMap.get(n);return t===void 0?null:t}function Vf(n,e){const t=io(n,xe());return t!==void 0?Oe(t,e):null}function io(n,e){return n[`__lexicalKey_${e._key}`]}function $t(n,e){let t=n;for(;t!=null;){const r=Vf(t,e);if(r!==null)return r;t=Vr(t)}return null}function Hf(n){const e=n._decorators,t=Object.assign({},e);return n._pendingDecorators=t,t}function ql(n){return n.read(()=>ke().getTextContent())}function ke(){return qf(un())}function qf(n){return n._nodeMap.get("root")}function Ke(n){je();const e=un();n!==null&&(n.dirty=!0,n.setCachedNodes(null)),e._selection=n}function Zn(n){const e=xe(),t=(function(r,s){let o=r;for(;o!=null;){const i=io(o,s);if(i!==void 0)return i;o=Vr(o)}return null})(n,e);return t===null?n===e.getRootElement()?Oe("root"):null:Oe(t)}function Jf(n){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(n)}function Sa(n){const e=[];let t=n;for(;t!==null;)e.push(t),t=t._parentEditor;return e}function Gf(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substring(0,5)}function Yf(n){return Xt(n)?n.nodeValue:null}function Ca(n,e,t){const r=Et(ht(e));if(r===null)return;const s=r.anchorNode;let{anchorOffset:o,focusOffset:i}=r;if(s!==null){let a=Yf(s);const l=$t(s);if(a!==null&&z(l)){if(a===Ys&&t){const u=t.length;a=t,o=u,i=u}a!==null&&Ea(l,a,o,i,n)}}}function Ea(n,e,t,r,s){let o=n;if(o.isAttached()&&(s||!o.isDirty())){const i=o.isComposing();let a=e;(i||s)&&e[e.length-1]===Ys&&(a=e.slice(0,-1));const l=o.getTextContent();if(s||a!==l){if(a===""){if(Ue(null),jr||cr||Br)o.remove();else{const m=xe();setTimeout(()=>{m.update(()=>{o.isAttached()&&o.remove()})},20)}return}const u=o.getParent(),c=Ln(),f=o.getTextContentSize(),d=rn(),h=o.getKey();if(o.isToken()||d!==null&&h===d&&!i||O(c)&&(u!==null&&!u.canInsertTextBefore()&&c.anchor.offset===0||c.anchor.key===n.__key&&c.anchor.offset===0&&!o.canInsertTextBefore()&&!i||c.focus.key===n.__key&&c.focus.offset===f&&!o.canInsertTextAfter()&&!i))return void o.markDirty();const g=U();if(!O(g)||t===null||r===null)return void Jl(o,a,g);if(g.setTextNodeRange(o,t,o,r),o.isSegmented()){const m=we(o.getTextContent());o.replace(m),o=m}Jl(o,a,g)}}}function Jl(n,e,t){if(n.setTextContent(e),O(t)){const r=n.getKey();for(const s of["anchor","focus"]){const o=t[s];o.type==="text"&&o.key===r&&(o.offset=Ft(n,o.offset,"clamp"))}}}function ss(n,e,t){const r=e[t]||!1;return r==="any"||r===n[t]}function Fy(n,e){return ss(n,e,"altKey")&&ss(n,e,"ctrlKey")&&ss(n,e,"shiftKey")&&ss(n,e,"metaKey")}function _e(n,e,t){return Fy(n,t)&&n.key.toLowerCase()===e.toLowerCase()}const Wt={ctrlKey:!yt,metaKey:yt},Gl={altKey:yt,ctrlKey:!yt};function Yl(n){return n.key==="Backspace"}function Zl(n){return _e(n,"a",Wt)}function My(n){const e=ke();if(O(n)){const t=n.anchor,r=n.focus,s=t.getNode().getTopLevelElementOrThrow().getParentOrThrow();return t.set(s.getKey(),0,"element"),r.set(s.getKey(),s.getChildrenSize(),"element"),kn(n),n}{const t=e.select(0,e.getChildrenSize());return Ke(kn(t)),t}}function rr(n,e){n.__lexicalClassNameCache===void 0&&(n.__lexicalClassNameCache={});const t=n.__lexicalClassNameCache,r=t[e];if(r!==void 0)return r;const s=n[e];if(typeof s=="string"){const o=Bd(s);return t[e]=o,o}return s}function Ta(n,e,t,r,s){if(t.size===0)return;const o=r.__type,i=r.__key,a=e.get(o);a===void 0&&$(33,o);const l=a.klass;let u=n.get(l);u===void 0&&(u=new Map,n.set(l,u));const c=u.get(i),f=c==="destroyed"&&s==="created";(c===void 0||f)&&u.set(i,f?"updated":s)}function Xl(n,e,t){const r=n.getParent();let s=t,o=n;return r!==null&&(e&&t===0?(s=o.getIndexWithinParent(),o=r):e||t!==o.getChildrenSize()||(s=o.getIndexWithinParent()+1,o=r)),o.getChildAtIndex(e?s-1:s)}function _i(n,e){const t=n.offset;if(n.type==="element")return Xl(n.getNode(),e,t);{const r=n.getNode();if(e&&t===0||!e&&t===r.getTextContentSize()){const s=e?r.getPreviousSibling():r.getNextSibling();return s===null?Xl(r.getParentOrThrow(),e,r.getIndexWithinParent()+(e?0:1)):s}}return null}function Zf(n){const e=ht(n).event,t=e&&e.inputType;return t==="insertFromPaste"||t==="insertFromPasteAsQuotation"}function H(n,e,t){return(function(r,s,o){const i=Sa(r);for(let a=4;a>=0;a--)for(let l=0;l<i.length;l++){const u=i[l],c=u._commands.get(s);if(c!==void 0){const f=c[a];if(f!==void 0){const d=Array.from(f),h=d.length;let g=!1;if(Rt(u,()=>{for(let m=0;m<h;m++)if(d[m](o,r))return void(g=!0)}),g)return g}}}return!1})(n,e,t)}function ao(n){return!Le(n)&&!n.isLastChild()&&!n.isInline()}function Pn(n,e){const t=n._keyToDOMMap.get(e);return t===void 0&&$(75,e),t}function Vr(n){const e=n.assignedSlot||n.parentElement;return bi(e)?e.host:e}function Xf(n){return Uf(n)?n:Ne(n)?n.ownerDocument:null}function $y(n){je(),xe()._updateTags.add(n)}function Ly(n){je(),xe()._deferred.push(n)}function vi(n,e){let t=n.getParent();for(;t!==null;){if(t.is(e))return!0;t=t.getParent()}return!1}function wa(n){const e=Xf(n);return e?e.defaultView:null}function ht(n){const e=n._window;return e===null&&$(78),e}function Dy(n){let e=n.getParentOrThrow();for(;e!==null;){if(qe(e))return e;e=e.getParentOrThrow()}return e}function qe(n){return Le(n)||A(n)&&n.isShadowRoot()}function jy(n){const e=n.constructor.clone(n);return Wf(e,null),e.afterCloneFrom(n),e}function mt(n){const e=xe(),t=n.getType(),r=va(e,t);r===void 0&&$(200,n.constructor.name,t);const{replace:s,replaceWithKlass:o}=r;if(s!==null){const i=s(n),a=i.constructor;return o!==null?i instanceof o||$(201,o.name,o.getType(),a.name,a.getType(),n.constructor.name,t):i instanceof n.constructor&&a!==n.constructor||$(202,a.name,a.getType(),n.constructor.name,t),i.__key===n.__key&&$(203,n.constructor.name,t,a.name,a.getType()),i}return n}function Po(n,e){!Le(n.getParent())||A(e)||he(e)||$(99)}function By(n){const e=Oe(n);return e===null&&$(63,n),e}function Io(n){return(he(n)||A(n)&&!n.canBeEmpty())&&!n.isInline()}function xi(n,e,t){t.style.removeProperty("caret-color"),e._blockCursorElement=null;const r=n.parentElement;r!==null&&r.removeChild(n)}function Et(n){return Ct?(n||window).getSelection():null}function zy(n){const e=wa(n);return e?e.getSelection():null}function ka(n){return Ne(n)&&n.tagName==="A"}function Ne(n){return Dn(n)&&n.nodeType===1}function Dn(n){return typeof n=="object"&&n!==null&&"nodeType"in n&&typeof n.nodeType=="number"}function bi(n){return Dn(n)&&n.nodeType===11}function Si(n){const e=new RegExp(/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|mark|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var|#text)$/,"i");return n.nodeName.match(e)!==null}function Ds(n){const e=new RegExp(/^(address|article|aside|blockquote|canvas|dd|div|dl|dt|fieldset|figcaption|figure|footer|form|h1|h2|h3|h4|h5|h6|header|hr|li|main|nav|noscript|ol|p|pre|section|table|td|tfoot|ul|video)$/,"i");return n.nodeName.match(e)!==null}function en(n){if(he(n)&&!n.isInline())return!0;if(!A(n)||qe(n))return!1;const e=n.getFirstChild(),t=e===null||It(e)||z(e)||e.isInline();return!n.isInline()&&n.canBeEmpty()!==!1&&t}function lo(){return xe()}const Ql=new WeakMap,Uy=new Map;function ec(n){if(!n._readOnly&&n.isEmpty())return Uy;n._readOnly||$(192);let e=Ql.get(n);return e||(e=(function(t){const r=new Map;for(const[s,o]of t._nodeMap){const i=o.__type;let a=r.get(i);a||(a=new Map,r.set(i,a)),a.set(s,o)}return r})(n),Ql.set(n,e)),e}function Qf(n){const e=n.constructor.clone(n);return e.afterCloneFrom(n),e}function Ky(n){return(e=Qf(n))[Ef]=!0,e;var e}function Na(n,e){const t=parseInt(n.style.paddingInlineStart,10)||0,r=Math.round(t/40);e.setIndent(r)}function Wy(n){return n.__lexicalUnmanaged===!0}function mr(n,e){return(function(t,r){return Object.prototype.hasOwnProperty.call(t,r)})(n,e)&&n[e]!==Pt[e]}function co(n){const e=pl in n.prototype?n.prototype[pl]():void 0,t=(function(i){if(!(i===Pt||i.prototype instanceof Pt)){let a="<unknown>",l="<unknown>";try{a=i.getType()}catch{}try{ir.version&&(l=JSON.parse(ir.version))}catch{}$(290,i.name,a,l)}return i===ha||i===lt||i===Pt})(n),r=!t&&mr(n,"getType")?n.getType():void 0;let s,o=r;if(e)if(r)s=e[r];else for(const[i,a]of Object.entries(e))o=i,s=a;if(!t&&o&&(mr(n,"getType")||(n.getType=()=>o),mr(n,"clone")||(n.clone=i=>(_a(i),new n)),mr(n,"importJSON")||(n.importJSON=s&&s.$importJSON||(i=>new n().updateFromJSON(i))),!mr(n,"importDOM")&&s)){const{importDOM:i}=s;i&&(n.importDOM=()=>i)}return{ownNodeConfig:s,ownNodeType:o}}function eg(n){const e=lo();return je(),new(e.resolveRegisteredNodeAfterReplacements(e.getRegisteredNode(n))).klass}const Qe=(n,e)=>{let t=n;for(;t!=null&&!Le(t);){if(e(t))return t;t=t.getParent()}return null},Vy={next:"previous",previous:"next"};class Aa{origin;constructor(e){this.origin=e}[Symbol.iterator](){return ng({hasNext:lr,initial:this.getAdjacentCaret(),map:e=>e,step:e=>e.getAdjacentCaret()})}getAdjacentCaret(){return Fe(this.getNodeAtCaret(),this.direction)}getSiblingCaret(){return Fe(this.origin,this.direction)}remove(){const e=this.getNodeAtCaret();return e&&e.remove(),this}replaceOrInsert(e,t){const r=this.getNodeAtCaret();return e.is(this.origin)||e.is(r)||(r===null?this.insert(e):r.replace(e,t)),this}splice(e,t,r="next"){const s=r===this.direction?t:Array.from(t).reverse();let o=this;const i=this.getParentAtCaret(),a=new Map;for(let l=o.getAdjacentCaret();l!==null&&a.size<e;l=l.getAdjacentCaret()){const u=l.origin.getWritable();a.set(u.getKey(),u)}for(const l of s){if(a.size>0){const u=o.getNodeAtCaret();if(u){if(a.delete(u.getKey()),a.delete(l.getKey()),!(u.is(l)||o.origin.is(l))){const c=l.getParent();c&&c.is(i)&&l.remove(),u.replace(l)}}else u===null&&$(263,Array.from(a).join(" "))}else o.insert(l);o=Fe(l,this.direction)}for(const l of a.values())l.remove();return this}}class Mr extends Aa{type="child";getLatest(){const e=this.origin.getLatest();return e===this.origin?this:gt(e,this.direction)}getParentCaret(e="root"){return Fe(Pa(this.getParentAtCaret(),e),this.direction)}getFlipped(){const e=jn(this.direction);return Fe(this.getNodeAtCaret(),e)||gt(this.origin,e)}getParentAtCaret(){return this.origin}getChildCaret(){return this}isSameNodeCaret(e){return e instanceof Mr&&this.direction===e.direction&&this.origin.is(e.origin)}isSamePointCaret(e){return this.isSameNodeCaret(e)}}const Hy={root:Le,shadowRoot:qe};function jn(n){return Vy[n]}function Pa(n,e="root"){return Hy[e](n)?null:n}class In extends Aa{type="sibling";getLatest(){const e=this.origin.getLatest();return e===this.origin?this:Fe(e,this.direction)}getSiblingCaret(){return this}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return A(this.origin)?gt(this.origin,this.direction):null}getParentCaret(e="root"){return Fe(Pa(this.getParentAtCaret(),e),this.direction)}getFlipped(){const e=jn(this.direction);return Fe(this.getNodeAtCaret(),e)||gt(this.origin.getParentOrThrow(),e)}isSamePointCaret(e){return e instanceof In&&this.direction===e.direction&&this.origin.is(e.origin)}isSameNodeCaret(e){return(e instanceof In||e instanceof Rn)&&this.direction===e.direction&&this.origin.is(e.origin)}}class Rn extends Aa{type="text";offset;constructor(e,t){super(e),this.offset=t}getLatest(){const e=this.origin.getLatest();return e===this.origin?this:On(e,this.direction,this.offset)}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return null}getParentCaret(e="root"){return Fe(Pa(this.getParentAtCaret(),e),this.direction)}getFlipped(){return On(this.origin,jn(this.direction),this.offset)}isSamePointCaret(e){return e instanceof Rn&&this.direction===e.direction&&this.origin.is(e.origin)&&this.offset===e.offset}isSameNodeCaret(e){return(e instanceof In||e instanceof Rn)&&this.direction===e.direction&&this.origin.is(e.origin)}getSiblingCaret(){return Fe(this.origin,this.direction)}}function Ot(n){return n instanceof Rn}function lr(n){return n instanceof In}function ft(n){return n instanceof Mr}const qy={next:class extends Rn{direction="next";getNodeAtCaret(){return this.origin.getNextSibling()}insert(n){return this.origin.insertAfter(n),this}},previous:class extends Rn{direction="previous";getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(n){return this.origin.insertBefore(n),this}}},Jy={next:class extends In{direction="next";getNodeAtCaret(){return this.origin.getNextSibling()}insert(n){return this.origin.insertAfter(n),this}},previous:class extends In{direction="previous";getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(n){return this.origin.insertBefore(n),this}}},Gy={next:class extends Mr{direction="next";getNodeAtCaret(){return this.origin.getFirstChild()}insert(n){return this.origin.splice(0,0,[n]),this}},previous:class extends Mr{direction="previous";getNodeAtCaret(){return this.origin.getLastChild()}insert(n){return this.origin.splice(this.origin.getChildrenSize(),0,[n]),this}}};function Fe(n,e){return n?new Jy[e](n):null}function On(n,e,t){return n?new qy[e](n,Ft(n,t)):null}function Ft(n,e,t="error"){const r=n.getTextContentSize();let s=e==="next"?r:e==="previous"?0:e;return(s<0||s>r)&&(t!=="clamp"&&Dd(284,String(e),String(r),n.getKey()),s=s<0?0:r),s}function tc(n,e){return new Zy(n,e)}function gt(n,e){return A(n)?new Gy[e](n):null}function Yy(n){return n&&n.getChildCaret()||n}function uo(n){return n&&Yy(n.getAdjacentCaret())}class Ia{type="node-caret-range";direction;anchor;focus;constructor(e,t,r){this.anchor=e,this.focus=t,this.direction=r}getLatest(){const e=this.anchor.getLatest(),t=this.focus.getLatest();return e===this.anchor&&t===this.focus?this:new Ia(e,t,this.direction)}isCollapsed(){return this.anchor.isSamePointCaret(this.focus)}getTextSlices(){const e=s=>{const o=this[s].getLatest();return Ot(o)?(function(i,a){const{direction:l,origin:u}=i,c=Ft(u,a==="focus"?jn(l):l);return tc(i,c-i.offset)})(o,s):null},t=e("anchor"),r=e("focus");if(t&&r){const{caret:s}=t,{caret:o}=r;if(s.isSameNodeCaret(o))return[tc(s,o.offset-s.offset),null]}return[t,r]}iterNodeCarets(e="root"){const t=Ot(this.anchor)?this.anchor.getSiblingCaret():this.anchor.getLatest(),r=this.focus.getLatest(),s=Ot(r),o=i=>i.isSameNodeCaret(r)?null:uo(i)||i.getParentCaret(e);return ng({hasNext:i=>i!==null&&!(s&&r.isSameNodeCaret(i)),initial:t.isSameNodeCaret(r)?null:o(t),map:i=>i,step:o})}[Symbol.iterator](){return this.iterNodeCarets("root")}}class Zy{type="slice";caret;distance;constructor(e,t){this.caret=e,this.distance=t}getSliceIndices(){const{distance:e,caret:{offset:t}}=this,r=t+e;return r<t?[r,t]:[t,r]}getTextContent(){const[e,t]=this.getSliceIndices();return this.caret.origin.getTextContent().slice(e,t)}getTextContentSize(){return Math.abs(this.distance)}removeTextSlice(){const{caret:{origin:e,direction:t}}=this,[r,s]=this.getSliceIndices(),o=e.getTextContent();return On(e.setTextContent(o.slice(0,r)+o.slice(s)),t,r)}}function Ra(n){return cn(n,Fe(ke(),n.direction))}function tg(n){return cn(n,n)}function cn(n,e){return n.direction!==e.direction&&$(265),new Ia(n,e,n.direction)}function ng(n){const{initial:e,hasNext:t,step:r,map:s}=n;let o=e;return{[Symbol.iterator](){return this},next(){if(!t(o))return{done:!0,value:void 0};const i={done:!1,value:s(o)};return o=r(o),i}}}function rg(n,e){const t=hs(n.origin,e.origin);switch(t===null&&$(275,n.origin.getKey(),e.origin.getKey()),t.type){case"same":{const r=n.type==="text",s=e.type==="text";return r&&s?(function(o,i){return Math.sign(o-i)})(n.offset,e.offset):n.type===e.type?0:r?-1:s?1:n.type==="child"?-1:1}case"ancestor":return n.type==="child"?-1:1;case"descendant":return e.type==="child"?1:-1;case"branch":return sg(t)}}function sg(n){const{a:e,b:t}=n,r=e.__key,s=t.__key;let o=e,i=t;for(;o&&i;o=o.getNextSibling(),i=i.getNextSibling()){if(o.__key===s)return-1;if(i.__key===r)return 1}return o===null?1:-1}function os(n,e){return e.is(n)}function nc(n){return A(n)?[n.getLatest(),null]:[n.getParent(),n.getLatest()]}function hs(n,e){if(n.is(e))return{commonAncestor:n,type:"same"};const t=new Map;for(let[r,s]=nc(n);r;s=r,r=r.getParent())t.set(r,s);for(let[r,s]=nc(e);r;s=r,r=r.getParent()){const o=t.get(r);if(o!==void 0)return o===null?(os(n,r)||$(276),{commonAncestor:r,type:"ancestor"}):s===null?(os(e,r)||$(277),{commonAncestor:r,type:"descendant"}):((A(o)||os(n,o))&&(A(s)||os(e,s))&&r.is(o.getParent())&&r.is(s.getParent())||$(278),{a:o,b:s,commonAncestor:r,type:"branch"})}return null}function Lt(n,e){const{type:t,key:r,offset:s}=n,o=By(n.key);return t==="text"?(z(o)||$(266,o.getType(),r),On(o,e,s)):(A(o)||$(267,o.getType(),r),Qy(o,n.offset,e))}function Fn(n,e){const{origin:t,direction:r}=e,s=r==="next";Ot(e)?n.set(t.getKey(),e.offset,"text"):lr(e)?z(t)?n.set(t.getKey(),Ft(t,r),"text"):n.set(t.getParentOrThrow().getKey(),t.getIndexWithinParent()+(s?1:0),"element"):(ft(e)&&A(t)||$(268),n.set(t.getKey(),s?0:t.getChildrenSize(),"element"))}function og(n){const e=U(),t=O(e)?e:no();return ms(t,n),Ke(t),t}function ms(n,e){Fn(n.anchor,e.anchor),Fn(n.focus,e.focus)}function rc(n){const{anchor:e,focus:t}=n,r=Lt(e,"next"),s=Lt(t,"next"),o=rg(r,s)<=0?"next":"previous";return cn(Yt(r,o),Yt(s,o))}function Hr(n){const{direction:e,origin:t}=n,r=Fe(t,jn(e)).getNodeAtCaret();return r?Fe(r,e):gt(t.getParentOrThrow(),e)}function sc(n,e="root"){const t=[n];for(let r=ft(n)?n.getParentCaret(e):n.getSiblingCaret();r!==null;r=r.getParentCaret(e))t.push(Hr(r));return t}function Ro(n){return!!n&&n.origin.isAttached()}function Xy(n,e="removeEmptySlices"){if(n.isCollapsed())return n;const t="root",r="next";let s=e;const o=ag(n,r),i=sc(o.anchor,t),a=sc(o.focus.getFlipped(),t),l=new Set,u=[];for(const g of o.iterNodeCarets(t))if(ft(g))l.add(g.origin.getKey());else if(lr(g)){const{origin:m}=g;A(m)&&!l.has(m.getKey())||u.push(m)}for(const g of u)g.remove();for(const g of o.getTextSlices()){if(!g)continue;const{origin:m}=g.caret,y=m.getTextContentSize(),x=Hr(Fe(m,r)),p=m.getMode();if(Math.abs(g.distance)===y&&s==="removeEmptySlices"||p==="token"&&g.distance!==0)x.remove();else if(g.distance!==0){s="removeEmptySlices";let _=g.removeTextSlice();const C=g.caret.origin;if(p==="segmented"){const v=_.origin,b=we(v.getTextContent()).setStyle(v.getStyle()).setFormat(v.getFormat());x.replaceOrInsert(b),_=On(b,r,_.offset)}C.is(i[0].origin)&&(i[0]=_),C.is(a[0].origin)&&(a[0]=_.getFlipped())}}let c,f;for(const g of i)if(Ro(g)){c=at(g);break}for(const g of a)if(Ro(g)){f=at(g);break}const d=(function(g,m,y){if(!g||!m)return null;const x=g.getParentAtCaret(),p=m.getParentAtCaret();if(!x||!p)return null;const _=x.getParents().reverse();_.push(x);const C=p.getParents().reverse();C.push(p);const v=Math.min(_.length,C.length);let b;for(b=0;b<v&&_[b]===C[b];b++);const S=(N,P)=>{let M;for(let R=b;R<N.length;R++){const I=N[R];if(qe(I))return;!M&&P(I)&&(M=I)}return M},T=S(_,en),E=T&&S(C,N=>y.has(N.getKey())&&en(N));return T&&E?[T,E]:null})(c,f,l);if(d){const[g,m]=d;gt(g,"previous").splice(0,m.getChildren()),m.remove()}const h=[c,f,...i,...a].find(Ro);if(h)return tg(Yt(at(h),n.direction));$(269,JSON.stringify(i.map(g=>g.origin.__key)))}function at(n){const e=(function(s){let o=s;for(;ft(o);){const i=uo(o);if(!ft(i))break;o=i}return o})(n.getLatest()),{direction:t}=e;if(z(e.origin))return Ot(e)?e:On(e.origin,t,t);const r=e.getAdjacentCaret();return lr(r)&&z(r.origin)?On(r.origin,t,jn(t)):e}function ig(n){return Ot(n)&&n.offset!==Ft(n.origin,n.direction)}function Yt(n,e){return n.direction===e?n:n.getFlipped()}function ag(n,e){return n.direction===e?n:cn(Yt(n.focus,e),Yt(n.anchor,e))}function Qy(n,e,t){let r=gt(n,"next");for(let s=0;s<e;s++){const o=r.getAdjacentCaret();if(o===null)break;r=o}return Yt(r,t)}function e_(n){const{origin:e,offset:t,direction:r}=n;if(t===Ft(e,r))return n.getSiblingCaret();if(t===Ft(e,jn(r)))return Hr(n.getSiblingCaret());const[s]=e.splitText(t);return z(s)||$(281),Yt(Fe(s,"next"),r)}function t_(n,e){return!0}function n_(n,{$copyElementNode:e=jy,$splitTextPointCaretNext:t=e_,rootMode:r="shadowRoot",$shouldSplit:s=t_}={}){if(Ot(n))return t(n);const o=n.getParentCaret(r);if(o){const{origin:i}=o;if(ft(n)&&(!i.canBeEmpty()||!s(i,"first")))return Hr(o);const a=(function(l){const u=[];for(let c=l.getAdjacentCaret();c;c=c.getAdjacentCaret())u.push(c.origin);return u})(n);(a.length>0||i.canBeEmpty()&&s(i,"last"))&&o.insert(e(i).splice(0,0,a))}return o}function r_(n,e){if(!e||n===e)return n;for(const t in e)if(n[t]!==e[t])return{...n,...e};return n}const lg=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,s_=lg?w.useLayoutEffect:w.useEffect,is={tag:nr};function o_({initialConfig:n,children:e}){const t=w.useMemo(()=>{const{theme:r,namespace:s,nodes:o,onError:i,editorState:a,html:l}=n,u=Sm(null,r),c=jf({editable:n.editable,html:l,namespace:s,nodes:o,onError:f=>i(f,c),theme:r});return(function(f,d){if(d!==null){if(d===void 0)f.update(()=>{const h=ke();if(h.isEmpty()){const g=Te();h.append(g);const m=lg?document.activeElement:null;(U()!==null||m!==null&&m===f.getRootElement())&&g.select()}},is);else if(d!==null)switch(typeof d){case"string":{const h=f.parseEditorState(d);f.setEditorState(h,is);break}case"object":f.setEditorState(d,is);break;case"function":f.update(()=>{ke().isEmpty()&&d(f)},is)}}})(c,a),[c,u]},[]);return s_(()=>{const r=n.editable,[s]=t;s.setEditable(r===void 0||r)},[]),k.jsx(Ld.Provider,{value:t,children:e})}const i_=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?w.useLayoutEffect:w.useEffect;function a_(n){return{initialValueFn:()=>n.isEditable(),subscribe:e=>n.registerEditableListener(e)}}function l_(){return(function(n){const[e]=Je(),t=w.useMemo(()=>n(e),[e,n]),[r,s]=w.useState(()=>t.initialValueFn()),o=w.useRef(r);return i_(()=>{const{initialValueFn:i,subscribe:a}=t,l=i();return o.current!==l&&(o.current=l,s(l)),a(u=>{o.current=u,s(u)})},[t,n]),r})(a_)}const Ci=new Map;function cg(n){const e={};if(!n)return e;const t=n.split(";");for(const r of t)if(r!==""){const[s,o]=r.split(/:([^]+)/);s&&o&&(e[s.trim()]=o.trim())}return e}function oc(n){let e=Ci.get(n);return e===void 0&&(e=cg(n),Ci.set(n,e)),e}function ug(n){const e=lo().getElementByKey(n.getKey());if(e===null)return null;const t=e.ownerDocument.defaultView;return t===null?null:t.getComputedStyle(e)}function dg(n){return ug(Le(n)?n:n.getParentOrThrow())}function ic(n){const e=dg(n);return e!==null&&e.direction==="rtl"}function fg(n,e,t="self"){const r=n.getStartEndPoints();if(e.isSelected(n)&&!Vt(e)&&r!==null){const[s,o]=r,i=n.isBackward(),a=s.getNode(),l=o.getNode(),u=e.is(a),c=e.is(l);if(u||c){const[f,d]=mi(n),h=a.is(l),g=e.is(i?l:a),m=e.is(i?a:l);let y,x=0;h?(x=f>d?d:f,y=f>d?f:d):g?(x=i?d:f,y=void 0):m&&(x=0,y=i?f:d);const p=e.__text.slice(x,y);p!==e.__text&&(t==="clone"&&(e=Ky(e)),e.__text=p)}}return e}function c_(n){const e=n.getStyle(),t=cg(e);Ci.set(e,t)}function gg(n){const e=pg(n);return e!==null&&e.writingMode==="vertical-rl"}function pg(n){const e=n.anchor.getNode();return A(e)?ug(e):dg(e)}function ac(n,e){let t=gg(n)?!e:e;hg(n)&&(t=!t);const r=Lt(n.focus,t?"previous":"next");if(ig(r))return!1;for(const s of Ra(r)){if(ft(s))return!s.origin.isInline();if(!A(s.origin)){if(he(s.origin))return!0;break}}return!1}function u_(n,e,t,r){n.modify(e?"extend":"move",t,r)}function hg(n){const e=pg(n);return e!==null&&e.direction==="rtl"}function lc(n,e,t){const r=hg(n);let s;s=gg(n)||r?!t:t,u_(n,e,s,"character")}function mg(n,...e){const t=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",n);for(const s of e)r.append("v",s);throw t.search=r.toString(),Error(`Minified Lexical error #${n}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}const fo=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,d_=fo&&"documentMode"in document?document.documentMode:null,f_=fo&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent);!(!fo||!("InputEvent"in window)||d_)&&"getTargetRanges"in new window.InputEvent("input");function yg(...n){const e=[];for(const t of n)if(t&&typeof t=="string")for(const[r]of t.matchAll(/\S+/g))e.push(r);return e}function pt(...n){return()=>{for(let e=n.length-1;e>=0;e--)n[e]();n.length=0}}const g_=fo,p_=f_;function bt(n,...e){const t=yg(...e);t.length>0&&n.classList.add(...t)}function go(n,...e){const t=yg(...e);t.length>0&&n.classList.remove(...t)}function h_(n){return n?n.getAdjacentCaret():null}function m_(n,e){let t=n;for(;t!=null;){if(t instanceof e)return t;t=t.getParent()}return null}function Ei(n){const e=Qe(n,t=>A(t)&&!t.isInline());return A(e)||mg(4,n.__key),e}function y_(n){const e=U()||Ln();let t;if(O(e))t=Lt(e.focus,"next");else{if(e!=null){const i=e.getNodes(),a=i[i.length-1];a&&(t=Fe(a,"next"))}t=t||gt(ke(),"previous").getFlipped().insert(Te())}const r=__(n,t),s=uo(r),o=ft(s)?at(s):r;return og(tg(o)),n.getLatest()}function __(n,e,t){let r=Yt(e,"next");for(let s=r;s;s=n_(s,t))r=s;return Ot(r)&&mg(283),r.insert(n.isInline()?Te().append(n):n),Yt(Fe(n.getLatest(),"next"),e.direction)}function sn(n,e){return n!==null&&Object.getPrototypeOf(n).constructor.name===e.name}function v_(n,e){const t=[];for(let r=0;r<n.length;r++){const s=e(n[r]);s!==null&&t.push(s)}return t}let Oo=!(p_||!g_)&&void 0;function x_(n){let e=1;if((function(){if(Oo===void 0){const t=document.createElement("div");t.style.cssText="position: absolute; opacity: 0; width: 100px; left: -1000px;",document.body.appendChild(t);const r=t.getBoundingClientRect();t.style.setProperty("zoom","2"),Oo=t.getBoundingClientRect().width===r.width,document.body.removeChild(t)}return Oo})())for(;n;)e*=Number(window.getComputedStyle(n).getPropertyValue("zoom")),n=n.parentElement;return e}const b_=Symbol.for("preact-signals");function Oa(){if(sr>1)return void sr--;let n,e=!1;for(;Nr!==void 0;){let t=Nr;for(Nr=void 0,Ti++;t!==void 0;){const r=t.o;if(t.o=void 0,t.f&=-3,!(8&t.f)&&_g(t))try{t.c()}catch(s){e||(n=s,e=!0)}t=r}}if(Ti=0,sr--,e)throw n}let ye,Nr;function cc(n){const e=ye;ye=void 0;try{return n()}finally{ye=e}}let sr=0,Ti=0,ys=0;function uc(n){if(ye===void 0)return;let e=n.n;return e===void 0||e.t!==ye?(e={i:0,S:n,p:ye.s,n:void 0,t:ye,e:void 0,x:void 0,r:e},ye.s!==void 0&&(ye.s.n=e),ye.s=e,n.n=e,32&ye.f&&n.S(e),e):e.i===-1?(e.i=0,e.n!==void 0&&(e.n.p=e.p,e.p!==void 0&&(e.p.n=e.n),e.p=ye.s,e.n=void 0,ye.s.n=e,ye.s=e),e):void 0}function Ze(n,e){this.v=n,this.i=0,this.n=void 0,this.t=void 0,this.W=e?.watched,this.Z=e?.unwatched,this.name=e?.name}function S_(n,e){return new Ze(n,e)}function _g(n){for(let e=n.s;e!==void 0;e=e.n)if(e.S.i!==e.i||!e.S.h()||e.S.i!==e.i)return!0;return!1}function dc(n){for(let e=n.s;e!==void 0;e=e.n){const t=e.S.n;if(t!==void 0&&(e.r=t),e.S.n=e,e.i=-1,e.n===void 0){n.s=e;break}}}function vg(n){let e,t=n.s;for(;t!==void 0;){const r=t.p;t.i===-1?(t.S.U(t),r!==void 0&&(r.n=t.n),t.n!==void 0&&(t.n.p=r)):e=t,t.S.n=t.r,t.r!==void 0&&(t.r=void 0),t=r}n.s=e}function Wn(n,e){Ze.call(this,void 0),this.x=n,this.s=void 0,this.g=ys-1,this.f=4,this.W=e?.watched,this.Z=e?.unwatched,this.name=e?.name}function xg(n){const e=n.u;if(n.u=void 0,typeof e=="function"){sr++;const t=ye;ye=void 0;try{e()}catch(r){throw n.f&=-2,n.f|=8,Fa(n),r}finally{ye=t,Oa()}}}function Fa(n){for(let e=n.s;e!==void 0;e=e.n)e.S.U(e);n.x=void 0,n.s=void 0,xg(n)}function C_(n){if(ye!==this)throw new Error("Out-of-order effect");vg(this),ye=n,this.f&=-2,8&this.f&&Fa(this),Oa()}function Yn(n,e){this.x=n,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32,this.name=e?.name}function wi(n,e){const t=new Yn(n,e);try{t.c()}catch(s){throw t.d(),s}const r=t.d.bind(t);return r[Symbol.dispose]=r,r}function bg(n,e={}){const t={};for(const r in n){const s=e[r],o=S_(s===void 0?n[r]:s);t[r]=o}return t}Ze.prototype.brand=b_,Ze.prototype.h=function(){return!0},Ze.prototype.S=function(n){const e=this.t;e!==n&&n.e===void 0&&(n.x=e,this.t=n,e!==void 0?e.e=n:cc(()=>{var t;(t=this.W)==null||t.call(this)}))},Ze.prototype.U=function(n){if(this.t!==void 0){const e=n.e,t=n.x;e!==void 0&&(e.x=t,n.e=void 0),t!==void 0&&(t.e=e,n.x=void 0),n===this.t&&(this.t=t,t===void 0&&cc(()=>{var r;(r=this.Z)==null||r.call(this)}))}},Ze.prototype.subscribe=function(n){return wi(()=>{const e=this.value,t=ye;ye=void 0;try{n(e)}finally{ye=t}},{name:"sub"})},Ze.prototype.valueOf=function(){return this.value},Ze.prototype.toString=function(){return this.value+""},Ze.prototype.toJSON=function(){return this.value},Ze.prototype.peek=function(){const n=ye;ye=void 0;try{return this.value}finally{ye=n}},Object.defineProperty(Ze.prototype,"value",{get(){const n=uc(this);return n!==void 0&&(n.i=this.i),this.v},set(n){if(n!==this.v){if(Ti>100)throw new Error("Cycle detected");this.v=n,this.i++,ys++,sr++;try{for(let e=this.t;e!==void 0;e=e.x)e.t.N()}finally{Oa()}}}}),Wn.prototype=new Ze,Wn.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===ys))return!0;if(this.g=ys,this.f|=1,this.i>0&&!_g(this))return this.f&=-2,!0;const n=ye;try{dc(this),ye=this;const e=this.x();(16&this.f||this.v!==e||this.i===0)&&(this.v=e,this.f&=-17,this.i++)}catch(e){this.v=e,this.f|=16,this.i++}return ye=n,vg(this),this.f&=-2,!0},Wn.prototype.S=function(n){if(this.t===void 0){this.f|=36;for(let e=this.s;e!==void 0;e=e.n)e.S.S(e)}Ze.prototype.S.call(this,n)},Wn.prototype.U=function(n){if(this.t!==void 0&&(Ze.prototype.U.call(this,n),this.t===void 0)){this.f&=-33;for(let e=this.s;e!==void 0;e=e.n)e.S.U(e)}},Wn.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(let n=this.t;n!==void 0;n=n.x)n.t.N()}},Object.defineProperty(Wn.prototype,"value",{get(){if(1&this.f)throw new Error("Cycle detected");const n=uc(this);if(this.h(),n!==void 0&&(n.i=this.i),16&this.f)throw this.v;return this.v}}),Yn.prototype.c=function(){const n=this.S();try{if(8&this.f||this.x===void 0)return;const e=this.x();typeof e=="function"&&(this.u=e)}finally{n()}},Yn.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,xg(this),dc(this),sr++;const n=ye;return ye=this,C_.bind(this,n)},Yn.prototype.N=function(){2&this.f||(this.f|=2,this.o=Nr,Nr=this)},Yn.prototype.d=function(){this.f|=8,1&this.f||Fa(this)},Yn.prototype.dispose=function(){this.d()};function E_(n){return(typeof n.nodes=="function"?n.nodes():n.nodes)||[]}function be(n,...e){const t=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",n);for(const s of e)r.append("v",s);throw t.search=r.toString(),Error(`Minified Lexical error #${n}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function Sg(n,e){if(n&&e&&!Array.isArray(e)&&typeof n=="object"&&typeof e=="object"){const t=n,r=e;for(const s in r)t[s]=Sg(t[s],r[s]);return n}return e}const Ma=0,ki=1,Cg=2,Fo=3,as=4,Vn=5,Mo=6,yr=7;function $o(n){return n.id===Ma}function Eg(n){return n.id===Cg}function T_(n){return(function(e){return e.id===ki})(n)||be(305,String(n.id),String(ki)),Object.assign(n,{id:Cg})}const w_=new Set;let k_=class{builder;configs;_dependency;_peerNameSet;extension;state;_signal;constructor(e,t){this.builder=e,this.extension=t,this.configs=new Set,this.state={id:Ma}}mergeConfigs(){let e=this.extension.config||{};const t=this.extension.mergeConfig?this.extension.mergeConfig.bind(this.extension):r_;for(const r of this.configs)e=t(e,r);return e}init(e){const t=this.state;Eg(t)||be(306,String(t.id));const r={getDependency:this.getInitDependency.bind(this),getDirectDependentNames:this.getDirectDependentNames.bind(this),getPeer:this.getInitPeer.bind(this),getPeerNameSet:this.getPeerNameSet.bind(this)},s={...r,getDependency:this.getDependency.bind(this),getInitResult:this.getInitResult.bind(this),getPeer:this.getPeer.bind(this)},o=(function(a,l,u){return Object.assign(a,{config:l,id:Fo,registerState:u})})(t,this.mergeConfigs(),r);let i;this.state=o,this.extension.init&&(i=this.extension.init(e,o.config,r)),this.state=(function(a,l,u){return Object.assign(a,{id:as,initResult:l,registerState:u})})(o,i,s)}build(e){const t=this.state;let r;t.id!==as&&be(307,String(t.id),String(Vn)),this.extension.build&&(r=this.extension.build(e,t.config,t.registerState));const s={...t.registerState,getOutput:()=>r,getSignal:this.getSignal.bind(this)};this.state=(function(o,i,a){return Object.assign(o,{id:Vn,output:i,registerState:a})})(t,r,s)}register(e,t){this._signal=t;const r=this.state;r.id!==Vn&&be(308,String(r.id),String(Vn));const s=this.extension.register&&this.extension.register(e,r.config,r.registerState);return this.state=(function(o){return Object.assign(o,{id:Mo})})(r),()=>{const o=this.state;o.id!==yr&&be(309,String(r.id),String(yr)),this.state=(function(i){return Object.assign(i,{id:Vn})})(o),s&&s()}}afterRegistration(e){const t=this.state;let r;return t.id!==Mo&&be(310,String(t.id),String(Mo)),this.extension.afterRegistration&&(r=this.extension.afterRegistration(e,t.config,t.registerState)),this.state=(function(s){return Object.assign(s,{id:yr})})(t),r}getSignal(){return this._signal===void 0&&be(311),this._signal}getInitResult(){this.extension.init===void 0&&be(312,this.extension.name);const e=this.state;return(function(t){return t.id>=as})(e)||be(313,String(e.id),String(as)),e.initResult}getInitPeer(e){const t=this.builder.extensionNameMap.get(e);return t?t.getExtensionInitDependency():void 0}getExtensionInitDependency(){const e=this.state;return(function(t){return t.id>=Fo})(e)||be(314,String(e.id),String(Fo)),{config:e.config}}getPeer(e){const t=this.builder.extensionNameMap.get(e);return t?t.getExtensionDependency():void 0}getInitDependency(e){const t=this.builder.getExtensionRep(e);return t===void 0&&be(315,this.extension.name,e.name),t.getExtensionInitDependency()}getDependency(e){const t=this.builder.getExtensionRep(e);return t===void 0&&be(315,this.extension.name,e.name),t.getExtensionDependency()}getState(){const e=this.state;return(function(t){return t.id>=yr})(e)||be(316,String(e.id),String(yr)),e}getDirectDependentNames(){return this.builder.incomingEdges.get(this.extension.name)||w_}getPeerNameSet(){let e=this._peerNameSet;return e||(e=new Set((this.extension.peerDependencies||[]).map(([t])=>t)),this._peerNameSet=e),e}getExtensionDependency(){if(!this._dependency){const e=this.state;(function(t){return t.id>=Vn})(e)||be(317,this.extension.name),this._dependency={config:e.config,init:e.initResult,output:e.output}}return this._dependency}};const fc={tag:nr};function N_(){const n=ke();n.isEmpty()&&n.append(Te())}const A_={config:{setOptions:fc,updateOptions:fc},init:({$initialEditorState:n=N_})=>({$initialEditorState:n,initialized:!1}),afterRegistration(n,{updateOptions:e,setOptions:t},r){const s=r.getInitResult();if(!s.initialized){s.initialized=!0;const{$initialEditorState:o}=s;if(Ay(o))n.setEditorState(o,t);else if(typeof o=="function")n.update(()=>{o(n)},e);else if(o&&(typeof o=="string"||typeof o=="object")){const i=n.parseEditorState(o);n.setEditorState(i,t)}}return()=>{}},name:"@lexical/extension/InitialState",nodes:[gr,Dt,ur,dr,pr]},gc=Symbol.for("@lexical/extension/LexicalBuilder");function pc(){}function P_(n){throw n}function ls(n){return Array.isArray(n)?n:[n]}const Lo="0.39.0+prod.esm";let I_=class _s{roots;extensionNameMap;outgoingConfigEdges;incomingEdges;conflicts;_sortedExtensionReps;PACKAGE_VERSION;constructor(e){this.outgoingConfigEdges=new Map,this.incomingEdges=new Map,this.extensionNameMap=new Map,this.conflicts=new Map,this.PACKAGE_VERSION=Lo,this.roots=e;for(const t of e)this.addExtension(t)}static fromExtensions(e){const t=[ls(A_)];for(const r of e)t.push(ls(r));return new _s(t)}static maybeFromEditor(e){const t=e[gc];return t&&(t.PACKAGE_VERSION!==Lo&&be(292,t.PACKAGE_VERSION,Lo),t instanceof _s||be(293)),t}static fromEditor(e){const t=_s.maybeFromEditor(e);return t===void 0&&be(294),t}constructEditor(){const{$initialEditorState:e,onError:t,...r}=this.buildCreateEditorArgs(),s=Object.assign(jf({...r,...t?{onError:o=>{t(o,s)}}:{}}),{[gc]:this});for(const o of this.sortedExtensionReps())o.build(s);return s}buildEditor(){let e=pc;function t(){try{e()}finally{e=pc}}const r=Object.assign(this.constructEditor(),{dispose:t,[Symbol.dispose]:t});return e=pt(this.registerEditor(r),()=>r.setRootElement(null)),r}hasExtensionByName(e){return this.extensionNameMap.has(e)}getExtensionRep(e){const t=this.extensionNameMap.get(e.name);if(t)return t.extension!==e&&be(295,e.name),t}addEdge(e,t,r){const s=this.outgoingConfigEdges.get(e);s?s.set(t,r):this.outgoingConfigEdges.set(e,new Map([[t,r]]));const o=this.incomingEdges.get(t);o?o.add(e):this.incomingEdges.set(t,new Set([e]))}addExtension(e){this._sortedExtensionReps!==void 0&&be(296);const t=ls(e),[r]=t;typeof r.name!="string"&&be(297,typeof r.name);let s=this.extensionNameMap.get(r.name);if(s!==void 0&&s.extension!==r&&be(298,r.name),!s){s=new k_(this,r),this.extensionNameMap.set(r.name,s);const o=this.conflicts.get(r.name);typeof o=="string"&&be(299,r.name,o);for(const i of r.conflictsWith||[])this.extensionNameMap.has(i)&&be(299,r.name,i),this.conflicts.set(i,r.name);for(const i of r.dependencies||[]){const a=ls(i);this.addEdge(r.name,a[0].name,a.slice(1)),this.addExtension(a)}for(const[i,a]of r.peerDependencies||[])this.addEdge(r.name,i,a?[a]:[])}}sortedExtensionReps(){if(this._sortedExtensionReps)return this._sortedExtensionReps;const e=[],t=(r,s)=>{let o=r.state;if(Eg(o))return;const i=r.extension.name;var a;$o(o)||be(300,i,s||"[unknown]"),$o(a=o)||be(304,String(a.id),String(Ma)),o=Object.assign(a,{id:ki}),r.state=o;const l=this.outgoingConfigEdges.get(i);if(l)for(const u of l.keys()){const c=this.extensionNameMap.get(u);c&&t(c,i)}o=T_(o),r.state=o,e.push(r)};for(const r of this.extensionNameMap.values())$o(r.state)&&t(r);for(const r of e)for(const[s,o]of this.outgoingConfigEdges.get(r.extension.name)||[])if(o.length>0){const i=this.extensionNameMap.get(s);if(i)for(const a of o)i.configs.add(a)}for(const[r,...s]of this.roots)if(s.length>0){const o=this.extensionNameMap.get(r.name);o===void 0&&be(301,r.name);for(const i of s)o.configs.add(i)}return this._sortedExtensionReps=e,this._sortedExtensionReps}registerEditor(e){const t=this.sortedExtensionReps(),r=new AbortController,s=[()=>r.abort()],o=r.signal;for(const i of t){const a=i.register(e,o);a&&s.push(a)}for(const i of t){const a=i.afterRegistration(e);a&&s.push(a)}return pt(...s)}buildCreateEditorArgs(){const e={},t=new Set,r=new Map,s=new Map,o={},i={},a=this.sortedExtensionReps();for(const c of a){const{extension:f}=c;if(f.onError!==void 0&&(e.onError=f.onError),f.disableEvents!==void 0&&(e.disableEvents=f.disableEvents),f.parentEditor!==void 0&&(e.parentEditor=f.parentEditor),f.editable!==void 0&&(e.editable=f.editable),f.namespace!==void 0&&(e.namespace=f.namespace),f.$initialEditorState!==void 0&&(e.$initialEditorState=f.$initialEditorState),f.nodes)for(const d of E_(f)){if(typeof d!="function"){const h=r.get(d.replace);h&&be(302,f.name,d.replace.name,h.extension.name),r.set(d.replace,c)}t.add(d)}if(f.html){if(f.html.export)for(const[d,h]of f.html.export.entries())s.set(d,h);f.html.import&&Object.assign(o,f.html.import)}f.theme&&Sg(i,f.theme)}Object.keys(i).length>0&&(e.theme=i),t.size&&(e.nodes=[...t]);const l=Object.keys(o).length>0,u=s.size>0;(l||u)&&(e.html={},l&&(e.html.import=o),u&&(e.html.export=s));for(const c of a)c.init(e);return e.onError||(e.onError=P_),e}};const R_=Q("INSERT_HORIZONTAL_RULE_COMMAND");class qr extends ha{static getType(){return"horizontalrule"}static clone(e){return new qr(e.__key)}static importJSON(e){return Tg().updateFromJSON(e)}static importDOM(){return{hr:()=>({conversion:O_,priority:0})}}exportDOM(){return{element:document.createElement("hr")}}createDOM(e){const t=document.createElement("hr");return bt(t,e.theme.hr),t}getTextContent(){return`
12
+ `}isInline(){return!1}updateDOM(){return!1}}function O_(){return{node:Tg()}}function Tg(){return eg(qr)}function F_(n){return n instanceof qr}function M_(n,e){return pt(n.registerCommand(ca,t=>{const r=U();if(!O(r))return!1;t.preventDefault();const s=(function(o){const i=o.getNodes();if(v_(i,d=>Os(d)&&d.canIndent()?d:null).length>0)return!0;const a=o.anchor,l=o.focus,u=l.isBefore(a)?l:a,c=u.getNode(),f=Ei(c);if(f.canIndent()){const d=f.getKey();let h=no();if(h.anchor.set(d,0,"element"),h.focus.set(d,0,"element"),h=kn(h),h.anchor.is(u))return!0}return!1})(r)?t.shiftKey?ai:ii:ff;return n.dispatchCommand(s,void 0)},ge),n.registerCommand(ii,()=>{const t=typeof e=="number"?e:e?e.peek():null;if(t==null)return!1;const r=U();if(!O(r))return!1;const s=r.getNodes().map(o=>Ei(o).getIndent());return Math.max(...s)+1>=t},Lf))}const $_={name:"@lexical/react/ReactProvider"};function L_(){return ke().getTextContent()}function D_(n,e=!0){if(n)return!1;let t=L_();return e&&(t=t.trim()),t===""}function j_(n){if(!D_(n,!1))return!1;const e=ke().getChildren(),t=e.length;if(t>1)return!1;for(let r=0;r<t;r++){const s=e[r];if(he(s))return!1;if(A(s)){if(!Kr(s)||s.__indent!==0)return!1;const o=s.getChildren(),i=o.length;for(let a=0;a<i;a++){const l=o[r];if(!z(l))return!1}}}return!0}function wg(n){return()=>j_(n)}function B_(n){const e=window.location.origin,t=r=>{if(r.origin!==e)return;const s=n.getRootElement();if(document.activeElement!==s)return;const o=r.data;if(typeof o=="string"){let i;try{i=JSON.parse(o)}catch{return}if(i&&i.protocol==="nuanria_messaging"&&i.type==="request"){const a=i.payload;if(a&&a.functionId==="makeChanges"){const l=a.args;if(l){const[u,c,f,d,h]=l;n.update(()=>{const g=U();if(O(g)){const m=g.anchor;let y=m.getNode(),x=0,p=0;if(z(y)&&u>=0&&c>=0&&(x=u,p=u+c,g.setTextNodeRange(y,x,y,p)),x===p&&f===""||(g.insertRawText(f),y=m.getNode()),z(y)){x=d,p=d+h;const _=y.getTextContentSize();x=x>_?_:x,p=p>_?_:p,g.setTextNodeRange(y,x,y,p)}r.stopImmediatePropagation()}})}}}}};return window.addEventListener("message",t,!0),()=>{window.removeEventListener("message",t,!0)}}function z_(n,e){const t=Uf(e)?e.body.childNodes:e.childNodes;let r=[];const s=[];for(const o of t)if(!Ng.has(o.nodeName)){const i=Ag(o,n,s,!1);i!==null&&(r=r.concat(i))}return(function(o){for(const i of o)i.getNextSibling()instanceof ya&&i.insertAfter(xt());for(const i of o){const a=i.getChildren();for(const l of a)i.insertBefore(l);i.remove()}})(s),r}function U_(n,e){if(typeof document>"u"||typeof window>"u"&&global.window===void 0)throw new Error("To use $generateHtmlFromNodes in headless mode please initialize a headless browser implementation such as JSDom before calling this function.");const t=document.createElement("div"),r=ke().getChildren();for(let s=0;s<r.length;s++)kg(n,r[s],t,e);return t.innerHTML}function kg(n,e,t,r=null){let s=r===null||e.isSelected(r);const o=A(e)&&e.excludeFromCopy("html");let i=e;r!==null&&z(e)&&(i=fg(r,e,"clone"));const a=A(i)?i.getChildren():[],l=va(n,i.getType());let u;u=l&&l.exportDOM!==void 0?l.exportDOM(n,i):i.exportDOM(n);const{element:c,after:f}=u;if(!c)return!1;const d=document.createDocumentFragment();for(let h=0;h<a.length;h++){const g=a[h],m=kg(n,g,d,r);!s&&A(e)&&m&&e.extractWithChild(g,r,"html")&&(s=!0)}if(s&&!o){if((Ne(c)||bi(c))&&c.append(d),t.append(c),f){const h=f.call(i,c);h&&(bi(c)?c.replaceChildren(h):c.replaceWith(h))}}else t.append(d);return s}const Ng=new Set(["STYLE","SCRIPT"]);function Ag(n,e,t,r,s=new Map,o){let i=[];if(Ng.has(n.nodeName))return i;let a=null;const l=(function(g,m){const{nodeName:y}=g,x=m._htmlConversions.get(y.toLowerCase());let p=null;if(x!==void 0)for(const _ of x){const C=_(g);C!==null&&(p===null||(p.priority||0)<=(C.priority||0))&&(p=C)}return p!==null?p.conversion:null})(n,e),u=l?l(n):null;let c=null;if(u!==null){c=u.after;const g=u.node;if(a=Array.isArray(g)?g[g.length-1]:g,a!==null){for(const[,m]of s)if(a=m(a,o),!a)break;a&&i.push(...Array.isArray(g)?g:[a])}u.forChild!=null&&s.set(n.nodeName,u.forChild)}const f=n.childNodes;let d=[];const h=(a==null||!qe(a))&&(a!=null&&Os(a)||r);for(let g=0;g<f.length;g++)d.push(...Ag(f[g],e,t,h,new Map(s),a));return c!=null&&(d=c(d)),Ds(n)&&(d=K_(n,d,h?()=>{const g=new ya;return t.push(g),g}:Te)),a==null?d.length>0?i=i.concat(d):Ds(n)&&(function(g){return g.nextSibling==null||g.previousSibling==null?!1:Si(g.nextSibling)&&Si(g.previousSibling)})(n)&&(i=i.concat(xt())):A(a)&&a.append(...d),i}function K_(n,e,t){const r=n.style.textAlign,s=[];let o=[];for(let i=0;i<e.length;i++){const a=e[i];if(Os(a))r&&!a.getFormat()&&a.setFormat(r),s.push(a);else if(o.push(a),i===e.length-1||i<e.length-1&&Os(e[i+1])){const l=t();l.setFormat(r),l.append(...o),s.push(l),o=[]}}return s}function js(n,...e){const t=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",n);for(const s of e)r.append("v",s);throw t.search=r.toString(),Error(`Minified Lexical error #${n}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function W_(n,e=U()){return e==null&&js(166),O(e)&&e.isCollapsed()||e.getNodes().length===0?"":U_(n,e)}function V_(n,e=U()){return e==null&&js(166),O(e)&&e.isCollapsed()||e.getNodes().length===0?null:JSON.stringify(H_(n,e))}function hc(n,e,t){const r=n.getData("application/x-lexical-editor");if(r)try{const a=JSON.parse(r);if(a.namespace===t._config.namespace&&Array.isArray(a.nodes))return mc(t,q_(a.nodes),e)}catch(a){console.error(a)}const s=n.getData("text/html"),o=n.getData("text/plain");if(s&&o!==s)try{const a=new DOMParser().parseFromString((function(l){return window.trustedTypes&&window.trustedTypes.createPolicy?window.trustedTypes.createPolicy("lexical",{createHTML:u=>u}).createHTML(l):l})(s),"text/html");return mc(t,z_(t,a),e)}catch(a){console.error(a)}const i=o||n.getData("text/uri-list");if(i!=null)if(O(e)){const a=i.split(/(\r?\n|\t)/);a[a.length-1]===""&&a.pop();for(let l=0;l<a.length;l++){const u=U();if(O(u)){const c=a[l];c===`
13
+ `||c===`\r
14
+ `?u.insertParagraph():c===" "?u.insertNodes([fr()]):u.insertText(c)}}}else e.insertRawText(i)}function mc(n,e,t){n.dispatchCommand(Zm,{nodes:e,selection:t})||(t.insertNodes(e),(function(r){if(O(r)&&r.isCollapsed()){const s=r.anchor;let o=null;const i=Lt(s,"previous");if(i)if(Ot(i))o=i.origin;else{const a=cn(i,gt(ke(),"next").getFlipped());for(const l of a){if(z(l.origin)){o=l.origin;break}if(A(l.origin)&&!l.origin.isInline())break}}if(o&&z(o)){const a=o.getFormat(),l=o.getStyle();r.format===a&&r.style===l||(r.format=a,r.style=l,r.dirty=!0)}}})(t))}function Pg(n,e,t,r=[]){let s=e===null||t.isSelected(e);const o=A(t)&&t.excludeFromCopy("html");let i=t;e!==null&&z(i)&&(i=fg(e,i,"clone"));const a=A(i)?i.getChildren():[],l=(function(u){const c=u.exportJSON(),f=u.constructor;if(c.type!==f.getType()&&js(58,f.name),A(u)){const d=c.children;Array.isArray(d)||js(59,f.name)}return c})(i);z(i)&&i.getTextContentSize()===0&&(s=!1);for(let u=0;u<a.length;u++){const c=a[u],f=Pg(n,e,c,l.children);!s&&A(t)&&f&&t.extractWithChild(c,e,"clone")&&(s=!0)}if(s&&!o)r.push(l);else if(Array.isArray(l.children))for(let u=0;u<l.children.length;u++){const c=l.children[u];r.push(c)}return s}function H_(n,e){const t=[],r=ke().getChildren();for(let s=0;s<r.length;s++)Pg(n,e,r[s],t);return{namespace:n._config.namespace,nodes:t}}function q_(n){const e=[];for(let t=0;t<n.length;t++){const r=n[t],s=Ny(r);z(s)&&c_(s),e.push(s)}return e}let Hn=null;async function yc(n,e,t){if(Hn!==null)return!1;if(e!==null)return new Promise((u,c)=>{n.update(()=>{u(_c(n,e,t))})});const r=n.getRootElement(),s=n._window||window,o=s.document,i=Et(s);if(r===null||i===null)return!1;const a=o.createElement("span");a.style.cssText="position: fixed; top: -1000px;",a.append(o.createTextNode("#")),r.append(a);const l=new Range;return l.setStart(a,0),l.setEnd(a,1),i.removeAllRanges(),i.addRange(l),new Promise((u,c)=>{const f=n.registerCommand(Qs,d=>(sn(d,ClipboardEvent)&&(f(),Hn!==null&&(s.clearTimeout(Hn),Hn=null),u(_c(n,d,t))),!0),Lf);Hn=s.setTimeout(()=>{f(),Hn=null,u(!1)},50),o.execCommand("copy"),a.remove()})}function _c(n,e,t){if(t===void 0){const s=Et(n._window),o=U();if(!o||o.isCollapsed()||!s)return!1;const i=s.anchorNode,a=s.focusNode;if(i!==null&&a!==null&&!Wr(n,i,a))return!1;t=J_(o)}e.preventDefault();const r=e.clipboardData;return r!==null&&(G_(r,t),!0)}const Ig=[["text/html",W_],["application/x-lexical-editor",V_]];function J_(n=U()){const e={"text/plain":n?n.getTextContent():""};if(n){const t=lo();for(const[r,s]of Ig){const o=s(t,n);o!==null&&(e[r]=o)}}return e}function G_(n,e){for(const[t]of Ig)e[t]===void 0&&n.setData(t,"");for(const t in e){const r=e[t];r!==void 0&&n.setData(t,r)}}function vc(n,e){if(document.caretRangeFromPoint!==void 0){const t=document.caretRangeFromPoint(n,e);return t===null?null:{node:t.startContainer,offset:t.startOffset}}if(document.caretPositionFromPoint!=="undefined"){const t=document.caretPositionFromPoint(n,e);return t===null?null:{node:t.offsetNode,offset:t.offset}}return null}const Bn=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,Y_=Bn&&"documentMode"in document?document.documentMode:null,Z_=Bn&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),X_=!(!Bn||!("InputEvent"in window)||Y_)&&"getTargetRanges"in new window.InputEvent("input"),Q_=Bn&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),xc=Bn&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,ev=Bn&&/^(?=.*Chrome).*/i.test(navigator.userAgent),tv=Bn&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&Z_&&!ev,bc=Q("DRAG_DROP_PASTE_FILE");let po=class Rg extends lt{static getType(){return"quote"}static clone(e){return new Rg(e.__key)}createDOM(e){const t=document.createElement("blockquote");return bt(t,e.theme.quote),t}updateDOM(e,t){return!1}static importDOM(){return{blockquote:e=>({conversion:nv,priority:0})}}exportDOM(e){const{element:t}=super.exportDOM(e);if(Ne(t)){this.isEmpty()&&t.append(document.createElement("br"));const r=this.getFormatType();r&&(t.style.textAlign=r);const s=this.getDirection();s&&(t.dir=s)}return{element:t}}static importJSON(e){return $a().updateFromJSON(e)}insertNewAfter(e,t){const r=Te(),s=this.getDirection();return r.setDirection(s),this.insertAfter(r,t),r}collapseAtStart(){const e=Te();return this.getChildren().forEach(t=>e.append(t)),this.replace(e),!0}canMergeWhenEmpty(){return!0}};function $a(){return mt(new po)}function Ni(n){return n instanceof po}let ho=class Og extends lt{__tag;static getType(){return"heading"}static clone(e){return new Og(e.__tag,e.__key)}constructor(e,t){super(t),this.__tag=e}getTag(){return this.__tag}setTag(e){const t=this.getWritable();return this.__tag=e,t}createDOM(e){const t=this.__tag,r=document.createElement(t),s=e.theme.heading;if(s!==void 0){const o=s[t];bt(r,o)}return r}updateDOM(e,t,r){return e.__tag!==this.__tag}static importDOM(){return{h1:e=>({conversion:qn,priority:0}),h2:e=>({conversion:qn,priority:0}),h3:e=>({conversion:qn,priority:0}),h4:e=>({conversion:qn,priority:0}),h5:e=>({conversion:qn,priority:0}),h6:e=>({conversion:qn,priority:0}),p:e=>{const t=e.firstChild;return t!==null&&Sc(t)?{conversion:()=>({node:null}),priority:3}:null},span:e=>Sc(e)?{conversion:t=>({node:Xn("h1")}),priority:3}:null}}exportDOM(e){const{element:t}=super.exportDOM(e);if(Ne(t)){this.isEmpty()&&t.append(document.createElement("br"));const r=this.getFormatType();r&&(t.style.textAlign=r);const s=this.getDirection();s&&(t.dir=s)}return{element:t}}static importJSON(e){return Xn(e.tag).updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setTag(e.tag)}exportJSON(){return{...super.exportJSON(),tag:this.getTag()}}insertNewAfter(e,t=!0){const r=e?e.anchor.offset:0,s=this.getLastDescendant(),o=!s||e&&e.anchor.key===s.getKey()&&r===s.getTextContentSize()||!e?Te():Xn(this.getTag()),i=this.getDirection();if(o.setDirection(i),this.insertAfter(o,t),r===0&&!this.isEmpty()&&e){const a=Te();a.select(),this.replace(a,!0)}return o}collapseAtStart(){const e=this.isEmpty()?Te():Xn(this.getTag());return this.getChildren().forEach(t=>e.append(t)),this.replace(e),!0}extractWithChild(){return!0}};function Sc(n){return n.nodeName.toLowerCase()==="span"&&n.style.fontSize==="26pt"}function qn(n){const e=n.nodeName.toLowerCase();let t=null;return e!=="h1"&&e!=="h2"&&e!=="h3"&&e!=="h4"&&e!=="h5"&&e!=="h6"||(t=Xn(e),n.style!==null&&(Na(n,t),t.setFormat(n.style.textAlign))),{node:t}}function nv(n){const e=$a();return n.style!==null&&(e.setFormat(n.style.textAlign),Na(n,e)),{node:e}}function Xn(n="h1"){return mt(new ho(n))}function rv(n){return n instanceof ho}function cs(n){let e=null;if(sn(n,DragEvent)?e=n.dataTransfer:sn(n,ClipboardEvent)&&(e=n.clipboardData),e===null)return[!1,[],!1];const t=e.types,r=t.includes("Files"),s=t.includes("text/html")||t.includes("text/plain");return[r,Array.from(e.files),s]}function Cc(n){const e=U();if(!O(e))return!1;const t=new Set,r=e.getNodes();for(let s=0;s<r.length;s++){const o=r[s],i=o.getKey();if(t.has(i))continue;const a=Qe(o,u=>A(u)&&!u.isInline());if(a===null)continue;const l=a.getKey();a.canIndent()&&!t.has(l)&&(t.add(l),n(a))}return t.size>0}function Ec(n){const e=$t(n);return he(e)}function Do(n){for(const e of["lowercase","uppercase","capitalize"])n.hasFormat(e)&&n.toggleFormat(e)}function sv(n){return pt(n.registerCommand(ra,e=>{const t=U();return!!Me(t)&&(t.clear(),!0)},ge),n.registerCommand(vn,e=>{const t=U();return O(t)?(t.deleteCharacter(e),!0):!!Me(t)&&(t.deleteNodes(),!0)},ge),n.registerCommand(Rr,e=>{const t=U();return!!O(t)&&(t.deleteWord(e),!0)},ge),n.registerCommand(Or,e=>{const t=U();return!!O(t)&&(t.deleteLine(e),!0)},ge),n.registerCommand(er,e=>{const t=U();if(typeof e=="string")t!==null&&t.insertText(e);else{if(t===null)return!1;const r=e.dataTransfer;if(r!=null)hc(r,t,n);else if(O(t)){const s=e.data;return s&&t.insertText(s),!0}}return!0},ge),n.registerCommand(oi,()=>{const e=U();return!!O(e)&&(e.removeText(),!0)},ge),n.registerCommand(nn,e=>{const t=U();return!!O(t)&&(t.formatText(e),!0)},ge),n.registerCommand(ey,e=>{const t=U();if(!O(t)&&!Me(t))return!1;const r=t.getNodes();for(const s of r){const o=Qe(s,i=>A(i)&&!i.isInline());o!==null&&o.setFormat(e)}return!0},ge),n.registerCommand(Qn,e=>{const t=U();return!!O(t)&&(t.insertLineBreak(e),!0)},ge),n.registerCommand(Ir,()=>{const e=U();return!!O(e)&&(e.insertParagraph(),!0)},ge),n.registerCommand(ff,()=>(Ty([fr()]),!0),ge),n.registerCommand(ii,()=>Cc(e=>{const t=e.getIndent();e.setIndent(t+1)}),ge),n.registerCommand(ai,()=>Cc(e=>{const t=e.getIndent();t>0&&e.setIndent(Math.max(0,t-1))}),ge),n.registerCommand(oa,e=>{const t=U();if(Me(t)){const r=t.getNodes();if(r.length>0)return e.preventDefault(),r[0].selectPrevious(),!0}else if(O(t)){const r=_i(t.focus,!0);if(!e.shiftKey&&he(r)&&!r.isIsolated()&&!r.isInline())return r.selectPrevious(),e.preventDefault(),!0}return!1},ge),n.registerCommand(ia,e=>{const t=U();if(Me(t)){const r=t.getNodes();if(r.length>0)return e.preventDefault(),r[0].selectNext(0,0),!0}else if(O(t)){if((function(s){const o=s.focus;return o.key==="root"&&o.offset===ke().getChildrenSize()})(t))return e.preventDefault(),!0;const r=_i(t.focus,!1);if(!e.shiftKey&&he(r)&&!r.isIsolated()&&!r.isInline())return r.selectNext(),e.preventDefault(),!0}return!1},ge),n.registerCommand(sa,e=>{const t=U();if(Me(t)){const r=t.getNodes();if(r.length>0)return e.preventDefault(),ic(r[0])?r[0].selectNext(0,0):r[0].selectPrevious(),!0}if(!O(t))return!1;if(ac(t,!0)){const r=e.shiftKey;return e.preventDefault(),lc(t,r,!0),!0}return!1},ge),n.registerCommand(cf,e=>{const t=U();if(Me(t)){const s=t.getNodes();if(s.length>0)return e.preventDefault(),ic(s[0])?s[0].selectPrevious():s[0].selectNext(0,0),!0}if(!O(t))return!1;const r=e.shiftKey;return!!ac(t,!1)&&(e.preventDefault(),lc(t,r,!1),!0)},ge),n.registerCommand(uf,e=>{if(Ec(e.target))return!1;const t=U();if(O(t)){if((function(r){if(!r.isCollapsed())return!1;const{anchor:s}=r;if(s.offset!==0)return!1;const o=s.getNode();if(Le(o))return!1;const i=Ei(o);return i.getIndent()>0&&(i.is(o)||o.is(i.getFirstDescendant()))})(t))return e.preventDefault(),n.dispatchCommand(ai,void 0);if(xc&&navigator.language==="ko-KR")return!1}else if(!Me(t))return!1;return e.preventDefault(),n.dispatchCommand(vn,!0)},ge),n.registerCommand(df,e=>{if(Ec(e.target))return!1;const t=U();return!(!O(t)&&!Me(t))&&(e.preventDefault(),n.dispatchCommand(vn,!1))},ge),n.registerCommand(As,e=>{const t=U();if(!O(t))return!1;if(Do(t),e!==null){if((xc||Q_||tv)&&X_)return!1;if(e.preventDefault(),e.shiftKey)return n.dispatchCommand(Qn,!1)}return n.dispatchCommand(Ir,void 0)},ge),n.registerCommand(la,()=>{const e=U();return!!O(e)&&(n.blur(),!0)},ge),n.registerCommand(gf,e=>{const[,t]=cs(e);if(t.length>0){const s=vc(e.clientX,e.clientY);if(s!==null){const{offset:o,node:i}=s,a=$t(i);if(a!==null){const l=no();if(z(a))l.anchor.set(a.getKey(),o,"text"),l.focus.set(a.getKey(),o,"text");else{const c=a.getParentOrThrow().getKey(),f=a.getIndexWithinParent()+1;l.anchor.set(c,f,"element"),l.focus.set(c,f,"element")}const u=kn(l);Ke(u)}n.dispatchCommand(bc,t)}return e.preventDefault(),!0}const r=U();return!!O(r)},ge),n.registerCommand(pf,e=>{const[t]=cs(e),r=U();return!(t&&!O(r))},ge),n.registerCommand(hf,e=>{const[t]=cs(e),r=U();if(t&&!O(r))return!1;const s=vc(e.clientX,e.clientY);if(s!==null){const o=$t(s.node);he(o)&&e.preventDefault()}return!0},ge),n.registerCommand(li,()=>(My(),!0),ge),n.registerCommand(Qs,e=>(yc(n,sn(e,ClipboardEvent)?e:null),!0),ge),n.registerCommand(ua,e=>((async function(t,r){await yc(r,sn(t,ClipboardEvent)?t:null),r.update(()=>{const s=U();O(s)?s.removeText():Me(s)&&s.getNodes().forEach(o=>o.remove())})})(e,n),!0),ge),n.registerCommand(Xs,e=>{const[,t,r]=cs(e);return t.length>0&&!r?(n.dispatchCommand(bc,t),!0):Dn(e.target)&&xa(e.target)?!1:U()!==null&&((function(s,o){s.preventDefault(),o.update(()=>{const i=U(),a=sn(s,InputEvent)||sn(s,KeyboardEvent)?null:s.clipboardData;a!=null&&i!==null&&hc(a,i,o)},{tag:fy})})(e,n),!0)},ge),n.registerCommand(aa,e=>{const t=U();return O(t)&&Do(t),!1},ge),n.registerCommand(ca,e=>{const t=U();return O(t)&&Do(t),!1},ge))}function ov(n,...e){const t=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",n);for(const s of e)r.append("v",s);throw t.search=r.toString(),Error(`Minified Lexical error #${n}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}const La=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?w.useLayoutEffect:w.useEffect;function iv({editor:n,ErrorBoundary:e}){return(function(t,r){const[s,o]=w.useState(()=>t.getDecorators());return La(()=>t.registerDecoratorListener(i=>{an.flushSync(()=>{o(i)})}),[t]),w.useEffect(()=>{o(t.getDecorators())},[t]),w.useMemo(()=>{const i=[],a=Object.keys(s);for(let l=0;l<a.length;l++){const u=a[l],c=k.jsx(r,{onError:d=>t._onError(d),children:k.jsx(w.Suspense,{fallback:null,children:s[u]})}),f=t.getElementByKey(u);f!==null&&i.push(an.createPortal(c,f,u))}return i},[r,s,t])})(n,e)}function av({editor:n,ErrorBoundary:e}){return(function(t){const r=I_.maybeFromEditor(t);if(r&&r.hasExtensionByName($_.name)){for(const s of["@lexical/plain-text","@lexical/rich-text"])r.hasExtensionByName(s)&&ov(320,s);return!0}return!1})(n)?null:k.jsx(iv,{editor:n,ErrorBoundary:e})}function Tc(n){return n.getEditorState().read(wg(n.isComposing()))}function lv({contentEditable:n,placeholder:e=null,ErrorBoundary:t}){const[r]=Je();return(function(s){La(()=>pt(sv(s),B_(s)),[s])})(r),k.jsxs(k.Fragment,{children:[n,k.jsx(cv,{content:e}),k.jsx(av,{editor:r,ErrorBoundary:t})]})}function cv({content:n}){const[e]=Je(),t=(function(s){const[o,i]=w.useState(()=>Tc(s));return La(()=>{function a(){const l=Tc(s);i(l)}return a(),pt(s.registerUpdateListener(()=>{a()}),s.registerEditableListener(()=>{a()}))},[s]),o})(e),r=l_();return t?typeof n=="function"?n(r):n:null}const Fg=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?w.useLayoutEffect:w.useEffect;function uv({editor:n,ariaActiveDescendant:e,ariaAutoComplete:t,ariaControls:r,ariaDescribedBy:s,ariaErrorMessage:o,ariaExpanded:i,ariaInvalid:a,ariaLabel:l,ariaLabelledBy:u,ariaMultiline:c,ariaOwns:f,ariaRequired:d,autoCapitalize:h,className:g,id:m,role:y="textbox",spellCheck:x=!0,style:p,tabIndex:_,"data-testid":C,...v},b){const[S,T]=w.useState(n.isEditable()),E=w.useCallback(P=>{P&&P.ownerDocument&&P.ownerDocument.defaultView?n.setRootElement(P):n.setRootElement(null)},[n]),N=w.useMemo(()=>(function(...P){return M=>{for(const R of P)typeof R=="function"?R(M):R!=null&&(R.current=M)}})(b,E),[E,b]);return Fg(()=>(T(n.isEditable()),n.registerEditableListener(P=>{T(P)})),[n]),k.jsx("div",{"aria-activedescendant":S?e:void 0,"aria-autocomplete":S?t:"none","aria-controls":S?r:void 0,"aria-describedby":s,...o!=null?{"aria-errormessage":o}:{},"aria-expanded":S&&y==="combobox"?!!i:void 0,...a!=null?{"aria-invalid":a}:{},"aria-label":l,"aria-labelledby":u,"aria-multiline":c,"aria-owns":S?f:void 0,"aria-readonly":!S||void 0,"aria-required":d,autoCapitalize:h,className:g,contentEditable:S,"data-testid":C,id:m,ref:N,role:y,spellCheck:x,style:p,tabIndex:_,...v})}const dv=w.forwardRef(uv);function wc(n){return n.getEditorState().read(wg(n.isComposing()))}const fv=w.forwardRef(gv);function gv(n,e){const{placeholder:t,...r}=n,[s]=Je();return k.jsxs(k.Fragment,{children:[k.jsx(dv,{editor:s,...r,ref:e}),t!=null&&k.jsx(pv,{editor:s,content:t})]})}function pv({content:n,editor:e}){const t=(function(i){const[a,l]=w.useState(()=>wc(i));return Fg(()=>{function u(){const c=wc(i);l(c)}return u(),pt(i.registerUpdateListener(()=>{u()}),i.registerEditableListener(()=>{u()}))},[i]),a})(e),[r,s]=w.useState(e.isEditable());if(w.useLayoutEffect(()=>(s(e.isEditable()),e.registerEditableListener(i=>{s(i)})),[e]),!t)return null;let o=null;return typeof n=="function"?o=n(r):n!==null&&(o=n),o===null?null:k.jsx("div",{"aria-hidden":!0,children:o})}const hv=w.createContext(null),jo={didCatch:!1,error:null};class mv extends w.Component{constructor(e){super(e),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=jo}static getDerivedStateFromError(e){return{didCatch:!0,error:e}}resetErrorBoundary(){const{error:e}=this.state;if(e!==null){for(var t,r,s=arguments.length,o=new Array(s),i=0;i<s;i++)o[i]=arguments[i];(t=(r=this.props).onReset)===null||t===void 0||t.call(r,{args:o,reason:"imperative-api"}),this.setState(jo)}}componentDidCatch(e,t){var r,s;(r=(s=this.props).onError)===null||r===void 0||r.call(s,e,t)}componentDidUpdate(e,t){const{didCatch:r}=this.state,{resetKeys:s}=this.props;if(r&&t.error!==null&&yv(e.resetKeys,s)){var o,i;(o=(i=this.props).onReset)===null||o===void 0||o.call(i,{next:s,prev:e.resetKeys,reason:"keys"}),this.setState(jo)}}render(){const{children:e,fallbackRender:t,FallbackComponent:r,fallback:s}=this.props,{didCatch:o,error:i}=this.state;let a=e;if(o){const l={error:i,resetErrorBoundary:this.resetErrorBoundary};if(typeof t=="function")a=t(l);else if(r)a=w.createElement(r,l);else if(s!==void 0)a=s;else throw i}return w.createElement(hv.Provider,{value:{didCatch:o,error:i,resetErrorBoundary:this.resetErrorBoundary}},a)}}function yv(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return n.length!==e.length||n.some((t,r)=>!Object.is(t,e[r]))}function _v({children:n,onError:e}){return k.jsx(mv,{fallback:k.jsx("div",{style:{border:"1px solid #f00",color:"#f00",padding:"8px"},children:"An error was thrown."}),onError:e,children:n})}function on(n,...e){const t=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",n);for(const s of e)r.append("v",s);throw t.search=r.toString(),Error(`Minified Lexical error #${n}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function Ai(n){let e=1,t=n.getParent();for(;t!=null;){if(fe(t)){const r=t.getParent();if(se(r)){e++,t=r.getParent();continue}on(40)}return e}return e}function Pi(n){let e=n.getParent();se(e)||on(40);let t=e;for(;t!==null;)t=t.getParent(),se(t)&&(e=t);return e}function Mg(n){let e=[];const t=n.getChildren().filter(fe);for(let r=0;r<t.length;r++){const s=t[r],o=s.getFirstChild();se(o)?e=e.concat(Mg(o)):e.push(s)}return e}function Nt(n){return fe(n)&&se(n.getFirstChild())}function kc(n){return ct().append(n)}function $g(n,e){return fe(n)&&(e.length===0||e.length===1&&n.is(e[0])&&n.getChildrenSize()===0)}function Ii(n){const e=U();if(e!==null){let t=e.getNodes();if(O(e)){const s=e.getStartEndPoints();s===null&&on(143);const[o]=s,i=o.getNode(),a=i.getParent();if(qe(i)){const l=i.getFirstChild();if(l)t=l.selectStart().getNodes();else{const u=Te();i.append(u),t=u.select().getNodes()}}else if($g(i,t)){const l=rt(n);if(qe(a)){i.replace(l);const u=ct();A(i)&&(u.setFormat(i.getFormatType()),u.setIndent(i.getIndent())),l.append(u)}else if(fe(i)){const u=i.getParentOrThrow();Mn(l,u.getChildren()),u.replace(l)}return}}const r=new Set;for(let s=0;s<t.length;s++){const o=t[s];if(A(o)&&o.isEmpty()&&!fe(o)&&!r.has(o.getKey())){Nc(o,n);continue}let i=Kf(o)?o.getParent():fe(o)&&o.isEmpty()?o:null;for(;i!=null;){const a=i.getKey();if(se(i)){if(!r.has(a)){const l=rt(n);Mn(l,i.getChildren()),i.replace(l),r.add(a)}break}{const l=i.getParent();if(qe(l)&&!r.has(a)){r.add(a),Nc(i,n);break}i=l}}}}}function Mn(n,e){n.splice(n.getChildrenSize(),0,e)}function Nc(n,e){if(se(n))return n;const t=n.getPreviousSibling(),r=n.getNextSibling(),s=ct();let o;if(Mn(s,n.getChildren()),se(t)&&e===t.getListType())t.append(s),se(r)&&e===r.getListType()&&(Mn(t,r.getChildren()),r.remove()),o=t;else if(se(r)&&e===r.getListType())r.getFirstChildOrThrow().insertBefore(s),o=r;else{const i=rt(e);i.append(s),n.replace(i),o=i}return s.setFormat(n.getFormatType()),s.setIndent(n.getIndent()),n.remove(),o}function Da(n,e){const t=n.getLastChild(),r=e.getFirstChild();t&&r&&Nt(t)&&Nt(r)&&(Da(t.getFirstChild(),r.getFirstChild()),r.remove());const s=e.getChildren();s.length>0&&n.append(...s),e.remove()}function vv(){const n=U();if(O(n)){const e=new Set,t=n.getNodes(),r=n.anchor.getNode();if($g(r,t))e.add(Pi(r));else for(let s=0;s<t.length;s++){const o=t[s];if(Kf(o)){const i=m_(o,dn);i!=null&&e.add(Pi(i))}}for(const s of e){let o=s;const i=Mg(s);for(const a of i){const l=Te().setTextStyle(n.style).setTextFormat(n.format);Mn(l,a.getChildren()),o.insertAfter(l),o=l,a.__key===n.anchor.key&&Fn(n.anchor,at(gt(l,"next"))),a.__key===n.focus.key&&Fn(n.focus,at(gt(l,"next"))),a.remove()}s.remove()}}}function Lg(n){const e=n.getListType()!=="check";let t=n.getStart();for(const r of n.getChildren())fe(r)&&(r.getValue()!==t&&r.setValue(t),e&&r.getLatest().__checked!=null&&r.setChecked(void 0),se(r.getFirstChild())||t++)}function xv(n){const e=new Set;if(Nt(n)||e.has(n.getKey()))return;const t=n.getParent(),r=n.getNextSibling(),s=n.getPreviousSibling();if(Nt(r)&&Nt(s)){const o=s.getFirstChild();if(se(o)){o.append(n);const i=r.getFirstChild();se(i)&&(Mn(o,i.getChildren()),r.remove(),e.add(r.getKey()))}}else if(Nt(r)){const o=r.getFirstChild();if(se(o)){const i=o.getFirstChild();i!==null&&i.insertBefore(n)}}else if(Nt(s)){const o=s.getFirstChild();se(o)&&o.append(n)}else if(se(t)){const o=ct().setTextFormat(n.getTextFormat()).setTextStyle(n.getTextStyle()),i=rt(t.getListType()).setTextFormat(t.getTextFormat()).setTextStyle(t.getTextStyle());o.append(i),i.append(n),s?s.insertAfter(o):r?r.insertBefore(o):t.append(o)}}function bv(n){if(Nt(n))return;const e=n.getParent(),t=e?e.getParent():void 0;if(se(t?t.getParent():void 0)&&fe(t)&&se(e)){const r=e?e.getFirstChild():void 0,s=e?e.getLastChild():void 0;if(n.is(r))t.insertBefore(n),e.isEmpty()&&t.remove();else if(n.is(s))t.insertAfter(n),e.isEmpty()&&t.remove();else{const o=e.getListType(),i=ct(),a=rt(o);i.append(a),n.getPreviousSiblings().forEach(c=>a.append(c));const l=ct(),u=rt(o);l.append(u),Mn(u,n.getNextSiblings()),t.insertBefore(i),t.insertAfter(l),t.replace(n)}}}function Sv(){const n=U();if(!O(n)||!n.isCollapsed())return!1;const e=n.anchor.getNode();if(!fe(e)||e.getChildrenSize()!==0)return!1;const t=Pi(e),r=e.getParent();se(r)||on(40);const s=r.getParent();let o;if(qe(s))o=Te(),t.insertAfter(o);else{if(!fe(s))return!1;o=ct(),s.insertAfter(o)}o.setTextStyle(n.style).setTextFormat(n.format).select();const i=e.getNextSiblings();if(i.length>0){const a=rt(r.getListType());if(fe(o)){const l=ct();l.append(a),o.insertAfter(l)}else o.insertAfter(a);a.append(...i)}return(function(a){let l=a;for(;l.getNextSibling()==null&&l.getPreviousSibling()==null;){const u=l.getParent();if(u==null||!fe(u)&&!se(u))break;l=u}l.remove()})(e),!0}function Bs(...n){const e=[];for(const t of n)if(t&&typeof t=="string")for(const[r]of t.matchAll(/\S+/g))e.push(r);return e}let dn=class extends lt{__value;__checked;$config(){return this.config("listitem",{$transform:e=>{if(e.__checked==null)return;const t=e.getParent();se(t)&&t.getListType()!=="check"&&e.getChecked()!=null&&e.setChecked(void 0)},extends:lt,importDOM:{li:()=>({conversion:Cv,priority:0})}})}constructor(e=1,t=void 0,r){super(r),this.__value=e===void 0?1:e,this.__checked=t}afterCloneFrom(e){super.afterCloneFrom(e),this.__value=e.__value,this.__checked=e.__checked}createDOM(e){const t=document.createElement("li");return this.updateListItemDOM(null,t,e),t}updateListItemDOM(e,t,r){(function(i,a,l){const u=a.getParent();!se(u)||u.getListType()!=="check"||se(a.getFirstChild())?(i.removeAttribute("role"),i.removeAttribute("tabIndex"),i.removeAttribute("aria-checked")):(i.setAttribute("role","checkbox"),i.setAttribute("tabIndex","-1"),l&&a.__checked===l.__checked||i.setAttribute("aria-checked",a.getChecked()?"true":"false"))})(t,this,e),t.value=this.__value,(function(i,a,l){const u=[],c=[],f=a.list,d=f?f.listitem:void 0;let h;if(f&&f.nested&&(h=f.nested.listitem),d!==void 0&&u.push(...Bs(d)),f){const g=l.getParent(),m=se(g)&&g.getListType()==="check",y=l.getChecked();m&&!y||c.push(f.listitemUnchecked),m&&y||c.push(f.listitemChecked),m&&u.push(y?f.listitemChecked:f.listitemUnchecked)}if(h!==void 0){const g=Bs(h);l.getChildren().some(m=>se(m))?u.push(...g):c.push(...g)}c.length>0&&go(i,...c),u.length>0&&bt(i,...u)})(t,r.theme,this);const s=e?e.__style:"",o=this.__style;s!==o&&(o===""?t.removeAttribute("style"):t.style.cssText=o),(function(i,a,l){const u=oc(a.__textStyle);for(const c in u)i.style.setProperty(`--listitem-marker-${c}`,u[c]);if(l)for(const c in oc(l.__textStyle))c in u||i.style.removeProperty(`--listitem-marker-${c}`)})(t,this,e)}updateDOM(e,t,r){const s=t;return this.updateListItemDOM(e,s,r),!1}updateFromJSON(e){return super.updateFromJSON(e).setValue(e.value).setChecked(e.checked)}exportDOM(e){const t=this.createDOM(e._config),r=this.getFormatType();r&&(t.style.textAlign=r);const s=this.getDirection();return s&&(t.dir=s),{element:t}}exportJSON(){return{...super.exportJSON(),checked:this.getChecked(),value:this.getValue()}}append(...e){for(let t=0;t<e.length;t++){const r=e[t];if(A(r)&&this.canMergeWith(r)){const s=r.getChildren();this.append(...s),r.remove()}else super.append(r)}return this}replace(e,t){if(fe(e))return super.replace(e);this.setIndent(0);const r=this.getParentOrThrow();if(!se(r))return e;if(r.__first===this.getKey())r.insertBefore(e);else if(r.__last===this.getKey())r.insertAfter(e);else{const s=rt(r.getListType());let o=this.getNextSibling();for(;o;){const i=o;o=o.getNextSibling(),s.append(i)}r.insertAfter(e),e.insertAfter(s)}return t&&(A(e)||on(139),this.getChildren().forEach(s=>{e.append(s)})),this.remove(),r.getChildrenSize()===0&&r.remove(),e}insertAfter(e,t=!0){const r=this.getParentOrThrow();if(se(r)||on(39),fe(e))return super.insertAfter(e,t);const s=this.getNextSiblings();if(r.insertAfter(e,t),s.length!==0){const o=rt(r.getListType());s.forEach(i=>o.append(i)),e.insertAfter(o,t)}return e}remove(e){const t=this.getPreviousSibling(),r=this.getNextSibling();super.remove(e),t&&r&&Nt(t)&&Nt(r)&&(Da(t.getFirstChild(),r.getFirstChild()),r.remove())}insertNewAfter(e,t=!0){const r=ct().updateFromJSON(this.exportJSON()).setChecked(!this.getChecked()&&void 0);return this.insertAfter(r,t),r}collapseAtStart(e){const t=Te();this.getChildren().forEach(i=>t.append(i));const r=this.getParentOrThrow(),s=r.getParentOrThrow(),o=fe(s);if(r.getChildrenSize()===1)if(o)r.remove(),s.select();else{r.insertBefore(t),r.remove();const i=e.anchor,a=e.focus,l=t.getKey();i.type==="element"&&i.getNode().is(this)&&i.set(l,i.offset,"element"),a.type==="element"&&a.getNode().is(this)&&a.set(l,a.offset,"element")}else r.insertBefore(t),this.remove();return!0}getValue(){return this.getLatest().__value}setValue(e){const t=this.getWritable();return t.__value=e,t}getChecked(){const e=this.getLatest();let t;const r=this.getParent();return se(r)&&(t=r.getListType()),t==="check"?!!e.__checked:void 0}setChecked(e){const t=this.getWritable();return t.__checked=e,t}toggleChecked(){const e=this.getWritable();return e.setChecked(!e.__checked)}getIndent(){const e=this.getParent();if(e===null||!this.isAttached())return this.getLatest().__indent;let t=e.getParentOrThrow(),r=0;for(;fe(t);)t=t.getParentOrThrow().getParentOrThrow(),r++;return r}setIndent(e){typeof e!="number"&&on(117),(e=Math.floor(e))>=0||on(199);let t=this.getIndent();for(;t!==e;)t<e?(xv(this),t++):(bv(this),t--);return this}canInsertAfter(e){return fe(e)}canReplaceWith(e){return fe(e)}canMergeWith(e){return fe(e)||Kr(e)}extractWithChild(e,t){if(!O(t))return!1;const r=t.anchor.getNode(),s=t.focus.getNode();return this.isParentOf(r)&&this.isParentOf(s)&&this.getTextContent().length===t.getTextContent().length}isParentRequired(){return!0}createParentElementNode(){return rt("bullet")}canMergeWhenEmpty(){return!0}};function Cv(n){if(n.classList.contains("task-list-item")){for(const t of n.children)if(t.tagName==="INPUT")return Ac(t)}if(n.classList.contains("joplin-checkbox")){for(const t of n.children)if(t.classList.contains("checkbox-wrapper")&&t.children.length>0&&t.children[0].tagName==="INPUT")return Ac(t.children[0])}const e=n.getAttribute("aria-checked");return{node:ct(e==="true"||e!=="false"&&void 0)}}function Ac(n){return n.getAttribute("type")!=="checkbox"?{node:null}:{node:ct(n.hasAttribute("checked"))}}function ct(n){return mt(new dn(void 0,n))}function fe(n){return n instanceof dn}let zn=class extends lt{__tag;__start;__listType;$config(){return this.config("list",{$transform:e=>{(function(t){const r=t.getNextSibling();se(r)&&t.getListType()===r.getListType()&&Da(t,r)})(e),Lg(e)},extends:lt,importDOM:{ol:()=>({conversion:Ic,priority:0}),ul:()=>({conversion:Ic,priority:0})}})}constructor(e="number",t=1,r){super(r);const s=Tv[e]||e;this.__listType=s,this.__tag=s==="number"?"ol":"ul",this.__start=t}afterCloneFrom(e){super.afterCloneFrom(e),this.__listType=e.__listType,this.__tag=e.__tag,this.__start=e.__start}getTag(){return this.getLatest().__tag}setListType(e){const t=this.getWritable();return t.__listType=e,t.__tag=e==="number"?"ol":"ul",t}getListType(){return this.getLatest().__listType}getStart(){return this.getLatest().__start}setStart(e){const t=this.getWritable();return t.__start=e,t}createDOM(e,t){const r=this.__tag,s=document.createElement(r);return this.__start!==1&&s.setAttribute("start",String(this.__start)),s.__lexicalListType=this.__listType,Pc(s,e.theme,this),s}updateDOM(e,t,r){return e.__tag!==this.__tag||e.__listType!==this.__listType||(Pc(t,r.theme,this),!1)}updateFromJSON(e){return super.updateFromJSON(e).setListType(e.listType).setStart(e.start)}exportDOM(e){const t=this.createDOM(e._config,e);return Ne(t)&&(this.__start!==1&&t.setAttribute("start",String(this.__start)),this.__listType==="check"&&t.setAttribute("__lexicalListType","check")),{element:t}}exportJSON(){return{...super.exportJSON(),listType:this.getListType(),start:this.getStart(),tag:this.getTag()}}canBeEmpty(){return!1}canIndent(){return!1}splice(e,t,r){let s=r;for(let o=0;o<r.length;o++){const i=r[o];fe(i)||(s===r&&(s=[...r]),s[o]=ct().append(!A(i)||se(i)||i.isInline()?i:we(i.getTextContent())))}return super.splice(e,t,s)}extractWithChild(e){return fe(e)}};function Pc(n,e,t){const r=[],s=[],o=e.list;if(o!==void 0){const i=o[`${t.__tag}Depth`]||[],a=Ai(t)-1,l=a%i.length,u=i[l],c=o[t.__tag];let f;const d=o.nested,h=o.checklist;if(d!==void 0&&d.list&&(f=d.list),c!==void 0&&r.push(c),h!==void 0&&t.__listType==="check"&&r.push(h),u!==void 0){r.push(...Bs(u));for(let g=0;g<i.length;g++)g!==l&&s.push(t.__tag+g)}if(f!==void 0){const g=Bs(f);a>1?r.push(...g):s.push(...g)}}s.length>0&&go(n,...s),r.length>0&&bt(n,...r)}function Ev(n){const e=[];for(let t=0;t<n.length;t++){const r=n[t];if(fe(r)){e.push(r);const s=r.getChildren();s.length>1&&s.forEach(o=>{se(o)&&e.push(kc(o))})}else e.push(kc(r))}return e}function Ic(n){const e=n.nodeName.toLowerCase();let t=null;return e==="ol"?t=rt("number",n.start):e==="ul"&&(t=(function(r){if(r.getAttribute("__lexicallisttype")==="check"||r.classList.contains("contains-task-list")||r.getAttribute("data-is-checklist")==="1")return!0;for(const s of r.childNodes)if(Ne(s)&&s.hasAttribute("aria-checked"))return!0;return!1})(n)?rt("check"):rt("bullet")),{after:Ev,node:t}}const Tv={ol:"number",ul:"bullet"};function rt(n="number",e=1){return mt(new zn(n,e))}function se(n){return n instanceof zn}const wv=Q("INSERT_CHECK_LIST_COMMAND");function kv(n){return pt(n.registerCommand(wv,()=>(Ii("check"),!0),Xe),n.registerCommand(ia,e=>Fc(e,n,!1),Xe),n.registerCommand(oa,e=>Fc(e,n,!0),Xe),n.registerCommand(la,()=>{if(Ri()!=null){const e=n.getRootElement();return e?.focus(),!0}return!1},Xe),n.registerCommand(aa,e=>{const t=Ri();return!(t==null||!n.isEditable())&&(n.update(()=>{const r=$t(t);fe(r)&&(e.preventDefault(),r.toggleChecked())}),!0)},Xe),n.registerCommand(sa,e=>n.getEditorState().read(()=>{const t=U();if(O(t)&&t.isCollapsed()){const{anchor:r}=t,s=r.type==="element";if(s||r.offset===0){const o=r.getNode(),i=Qe(o,a=>A(a)&&!a.isInline());if(fe(i)){const a=i.getParent();if(se(a)&&a.getListType()==="check"&&(s||i.getFirstDescendant()===o)){const l=n.getElementByKey(i.__key);if(l!=null&&document.activeElement!==l)return l.focus(),e.preventDefault(),!0}}}}return!1}),Xe),n.registerRootListener((e,t)=>{e!==null&&(e.addEventListener("click",Rc),e.addEventListener("pointerdown",Oc)),t!==null&&(t.removeEventListener("click",Rc),t.removeEventListener("pointerdown",Oc))}))}function Dg(n,e){const t=n.target;if(!Ne(t))return;const r=t.firstChild;if(Ne(r)&&(r.tagName==="UL"||r.tagName==="OL"))return;const s=t.parentNode;if(!s||s.__lexicalListType!=="check")return;const o=t.getBoundingClientRect(),i=x_(t),a=n.clientX/i,l=window.getComputedStyle?window.getComputedStyle(t,"::before"):{width:"0px"},u=parseFloat(l.width),c=n.pointerType==="touch"?32:0;(t.dir==="rtl"?a<o.right+c&&a>o.right-u-c:a>o.left-c&&a<o.left+u+c)&&e()}function Rc(n){Dg(n,()=>{if(Ne(n.target)){const e=n.target,t=so(e);t!=null&&t.isEditable()&&t.update(()=>{const r=$t(e);fe(r)&&(e.focus(),r.toggleChecked())})}})}function Oc(n){Dg(n,()=>{n.preventDefault()})}function Ri(){const n=document.activeElement;return Ne(n)&&n.tagName==="LI"&&n.parentNode!=null&&n.parentNode.__lexicalListType==="check"?n:null}function Fc(n,e,t){const r=Ri();return r!=null&&e.update(()=>{const s=$t(r);if(!fe(s))return;const o=(function(i,a){let l=a?i.getPreviousSibling():i.getNextSibling(),u=i;for(;l==null&&fe(u);)u=u.getParentOrThrow().getParent(),u!=null&&(l=a?u.getPreviousSibling():u.getNextSibling());for(;fe(l);){const c=a?l.getLastChild():l.getFirstChild();if(!se(c))return l;l=a?c.getLastChild():c.getFirstChild()}return null})(s,t);if(o!=null){o.selectStart();const i=e.getElementByKey(o.__key);i!=null&&(n.preventDefault(),setTimeout(()=>{i.focus()},0))}}),!1}const Nv=Q("UPDATE_LIST_START_COMMAND"),Av=Q("INSERT_UNORDERED_LIST_COMMAND"),Pv=Q("INSERT_ORDERED_LIST_COMMAND"),Iv=Q("REMOVE_LIST_COMMAND");function Rv(n){return pt(n.registerCommand(Pv,()=>(Ii("number"),!0),Xe),n.registerCommand(Nv,e=>{const{listNodeKey:t,newStart:r}=e,s=Oe(t);return!!se(s)&&(s.getListType()==="number"&&(s.setStart(r),Lg(s)),!0)},Xe),n.registerCommand(Av,()=>(Ii("bullet"),!0),Xe),n.registerCommand(Iv,()=>(vv(),!0),Xe),n.registerCommand(Ir,()=>Sv(),Xe),n.registerNodeTransform(dn,e=>{const t=e.getFirstChild();if(t){if(z(t)){const r=t.getStyle(),s=t.getFormat();e.getTextStyle()!==r&&e.setTextStyle(r),e.getTextFormat()!==s&&e.setTextFormat(s)}}else{const r=U();O(r)&&(r.style!==e.getTextStyle()||r.format!==e.getTextFormat())&&r.isCollapsed()&&e.is(r.anchor.getNode())&&e.setTextStyle(r.style).setTextFormat(r.format)}}),n.registerNodeTransform(Dt,e=>{const t=e.getParent();if(fe(t)&&e.is(t.getFirstChild())){const r=e.getStyle(),s=e.getFormat();r===t.getTextStyle()&&s===t.getTextFormat()||t.setTextStyle(r).setTextFormat(s)}}))}function Ov(n){const e=t=>{const r=t.getParent();if(se(t.getFirstChild())||!se(r))return;const s=Qe(t,o=>fe(o)&&se(o.getParent())&&fe(o.getPreviousSibling()));if(s===null&&t.getIndent()>0)t.setIndent(0);else if(fe(s)){const o=s.getPreviousSibling();if(fe(o)){const i=(function(l){let u=l,c=u.getFirstChild();for(;se(c);){const f=c.getLastChild();if(!fe(f))break;u=f,c=u.getFirstChild()}return u})(o),a=i.getParent();if(se(a)){const l=Ai(a);l+1<Ai(r)&&t.setIndent(l)}}}};return n.registerNodeTransform(zn,t=>{const r=[t];for(;r.length>0;){const s=r.shift();if(se(s)){for(const o of s.getChildren())if(fe(o)){e(o);const i=o.getFirstChild();se(i)&&r.push(i)}}}})}var Bo={exports:{}},Mc;function Fv(){return Mc||(Mc=1,(function(n){var e=typeof window<"u"?window:typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:{};var t=(function(r){var s=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,o=0,i={},a={manual:r.Prism&&r.Prism.manual,disableWorkerMessageHandler:r.Prism&&r.Prism.disableWorkerMessageHandler,util:{encode:function p(_){return _ instanceof l?new l(_.type,p(_.content),_.alias):Array.isArray(_)?_.map(p):_.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/\u00a0/g," ")},type:function(p){return Object.prototype.toString.call(p).slice(8,-1)},objId:function(p){return p.__id||Object.defineProperty(p,"__id",{value:++o}),p.__id},clone:function p(_,C){C=C||{};var v,b;switch(a.util.type(_)){case"Object":if(b=a.util.objId(_),C[b])return C[b];v={},C[b]=v;for(var S in _)_.hasOwnProperty(S)&&(v[S]=p(_[S],C));return v;case"Array":return b=a.util.objId(_),C[b]?C[b]:(v=[],C[b]=v,_.forEach(function(T,E){v[E]=p(T,C)}),v);default:return _}},getLanguage:function(p){for(;p;){var _=s.exec(p.className);if(_)return _[1].toLowerCase();p=p.parentElement}return"none"},setLanguage:function(p,_){p.className=p.className.replace(RegExp(s,"gi"),""),p.classList.add("language-"+_)},currentScript:function(){if(typeof document>"u")return null;if(document.currentScript&&document.currentScript.tagName==="SCRIPT")return document.currentScript;try{throw new Error}catch(v){var p=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(v.stack)||[])[1];if(p){var _=document.getElementsByTagName("script");for(var C in _)if(_[C].src==p)return _[C]}return null}},isActive:function(p,_,C){for(var v="no-"+_;p;){var b=p.classList;if(b.contains(_))return!0;if(b.contains(v))return!1;p=p.parentElement}return!!C}},languages:{plain:i,plaintext:i,text:i,txt:i,extend:function(p,_){var C=a.util.clone(a.languages[p]);for(var v in _)C[v]=_[v];return C},insertBefore:function(p,_,C,v){v=v||a.languages;var b=v[p],S={};for(var T in b)if(b.hasOwnProperty(T)){if(T==_)for(var E in C)C.hasOwnProperty(E)&&(S[E]=C[E]);C.hasOwnProperty(T)||(S[T]=b[T])}var N=v[p];return v[p]=S,a.languages.DFS(a.languages,function(P,M){M===N&&P!=p&&(this[P]=S)}),S},DFS:function p(_,C,v,b){b=b||{};var S=a.util.objId;for(var T in _)if(_.hasOwnProperty(T)){C.call(_,T,_[T],v||T);var E=_[T],N=a.util.type(E);N==="Object"&&!b[S(E)]?(b[S(E)]=!0,p(E,C,null,b)):N==="Array"&&!b[S(E)]&&(b[S(E)]=!0,p(E,C,T,b))}}},plugins:{},highlightAll:function(p,_){a.highlightAllUnder(document,p,_)},highlightAllUnder:function(p,_,C){var v={callback:C,container:p,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};a.hooks.run("before-highlightall",v),v.elements=Array.prototype.slice.apply(v.container.querySelectorAll(v.selector)),a.hooks.run("before-all-elements-highlight",v);for(var b=0,S;S=v.elements[b++];)a.highlightElement(S,_===!0,v.callback)},highlightElement:function(p,_,C){var v=a.util.getLanguage(p),b=a.languages[v];a.util.setLanguage(p,v);var S=p.parentElement;S&&S.nodeName.toLowerCase()==="pre"&&a.util.setLanguage(S,v);var T=p.textContent,E={element:p,language:v,grammar:b,code:T};function N(M){E.highlightedCode=M,a.hooks.run("before-insert",E),E.element.innerHTML=E.highlightedCode,a.hooks.run("after-highlight",E),a.hooks.run("complete",E),C&&C.call(E.element)}if(a.hooks.run("before-sanity-check",E),S=E.element.parentElement,S&&S.nodeName.toLowerCase()==="pre"&&!S.hasAttribute("tabindex")&&S.setAttribute("tabindex","0"),!E.code){a.hooks.run("complete",E),C&&C.call(E.element);return}if(a.hooks.run("before-highlight",E),!E.grammar){N(a.util.encode(E.code));return}if(_&&r.Worker){var P=new Worker(a.filename);P.onmessage=function(M){N(M.data)},P.postMessage(JSON.stringify({language:E.language,code:E.code,immediateClose:!0}))}else N(a.highlight(E.code,E.grammar,E.language))},highlight:function(p,_,C){var v={code:p,grammar:_,language:C};if(a.hooks.run("before-tokenize",v),!v.grammar)throw new Error('The language "'+v.language+'" has no grammar.');return v.tokens=a.tokenize(v.code,v.grammar),a.hooks.run("after-tokenize",v),l.stringify(a.util.encode(v.tokens),v.language)},tokenize:function(p,_){var C=_.rest;if(C){for(var v in C)_[v]=C[v];delete _.rest}var b=new f;return d(b,b.head,p),c(p,b,_,b.head,0),g(b)},hooks:{all:{},add:function(p,_){var C=a.hooks.all;C[p]=C[p]||[],C[p].push(_)},run:function(p,_){var C=a.hooks.all[p];if(!(!C||!C.length))for(var v=0,b;b=C[v++];)b(_)}},Token:l};r.Prism=a;function l(p,_,C,v){this.type=p,this.content=_,this.alias=C,this.length=(v||"").length|0}l.stringify=function p(_,C){if(typeof _=="string")return _;if(Array.isArray(_)){var v="";return _.forEach(function(N){v+=p(N,C)}),v}var b={type:_.type,content:p(_.content,C),tag:"span",classes:["token",_.type],attributes:{},language:C},S=_.alias;S&&(Array.isArray(S)?Array.prototype.push.apply(b.classes,S):b.classes.push(S)),a.hooks.run("wrap",b);var T="";for(var E in b.attributes)T+=" "+E+'="'+(b.attributes[E]||"").replace(/"/g,"&quot;")+'"';return"<"+b.tag+' class="'+b.classes.join(" ")+'"'+T+">"+b.content+"</"+b.tag+">"};function u(p,_,C,v){p.lastIndex=_;var b=p.exec(C);if(b&&v&&b[1]){var S=b[1].length;b.index+=S,b[0]=b[0].slice(S)}return b}function c(p,_,C,v,b,S){for(var T in C)if(!(!C.hasOwnProperty(T)||!C[T])){var E=C[T];E=Array.isArray(E)?E:[E];for(var N=0;N<E.length;++N){if(S&&S.cause==T+","+N)return;var P=E[N],M=P.inside,R=!!P.lookbehind,I=!!P.greedy,D=P.alias;if(I&&!P.pattern.global){var L=P.pattern.toString().match(/[imsuy]*$/)[0];P.pattern=RegExp(P.pattern.source,L+"g")}for(var F=P.pattern||P,j=v.next,B=b;j!==_.tail&&!(S&&B>=S.reach);B+=j.value.length,j=j.next){var G=j.value;if(_.length>p.length)return;if(!(G instanceof l)){var Y=1,K;if(I){if(K=u(F,B,p,R),!K||K.index>=p.length)break;var re=K.index,W=K.index+K[0].length,V=B;for(V+=j.value.length;re>=V;)j=j.next,V+=j.value.length;if(V-=j.value.length,B=V,j.value instanceof l)continue;for(var oe=j;oe!==_.tail&&(V<W||typeof oe.value=="string");oe=oe.next)Y++,V+=oe.value.length;Y--,G=p.slice(B,V),K.index-=B}else if(K=u(F,0,G,R),!K)continue;var re=K.index,le=K[0],ee=G.slice(0,re),ne=G.slice(re+le.length),ie=B+G.length;S&&ie>S.reach&&(S.reach=ie);var J=j.prev;ee&&(J=d(_,J,ee),B+=ee.length),h(_,J,Y);var ue=new l(T,M?a.tokenize(le,M):le,D,le);if(j=d(_,J,ue),ne&&d(_,j,ne),Y>1){var pe={cause:T+","+N,reach:ie};c(p,_,C,j.prev,B,pe),S&&pe.reach>S.reach&&(S.reach=pe.reach)}}}}}}function f(){var p={value:null,prev:null,next:null},_={value:null,prev:p,next:null};p.next=_,this.head=p,this.tail=_,this.length=0}function d(p,_,C){var v=_.next,b={value:C,prev:_,next:v};return _.next=b,v.prev=b,p.length++,b}function h(p,_,C){for(var v=_.next,b=0;b<C&&v!==p.tail;b++)v=v.next;_.next=v,v.prev=_,p.length-=b}function g(p){for(var _=[],C=p.head.next;C!==p.tail;)_.push(C.value),C=C.next;return _}if(!r.document)return r.addEventListener&&(a.disableWorkerMessageHandler||r.addEventListener("message",function(p){var _=JSON.parse(p.data),C=_.language,v=_.code,b=_.immediateClose;r.postMessage(a.highlight(v,a.languages[C],C)),b&&r.close()},!1)),a;var m=a.util.currentScript();m&&(a.filename=m.src,m.hasAttribute("data-manual")&&(a.manual=!0));function y(){a.manual||a.highlightAll()}if(!a.manual){var x=document.readyState;x==="loading"||x==="interactive"&&m&&m.defer?document.addEventListener("DOMContentLoaded",y):window.requestAnimationFrame?window.requestAnimationFrame(y):window.setTimeout(y,16)}return a})(e);n.exports&&(n.exports=t),typeof Ga<"u"&&(Ga.Prism=t),t.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},t.languages.markup.tag.inside["attr-value"].inside.entity=t.languages.markup.entity,t.languages.markup.doctype.inside["internal-subset"].inside=t.languages.markup,t.hooks.add("wrap",function(r){r.type==="entity"&&(r.attributes.title=r.content.replace(/&amp;/,"&"))}),Object.defineProperty(t.languages.markup.tag,"addInlined",{value:function(s,o){var i={};i["language-"+o]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:t.languages[o]},i.cdata=/^<!\[CDATA\[|\]\]>$/i;var a={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:i}};a["language-"+o]={pattern:/[\s\S]+/,inside:t.languages[o]};var l={};l[s]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return s}),"i"),lookbehind:!0,greedy:!0,inside:a},t.languages.insertBefore("markup","cdata",l)}}),Object.defineProperty(t.languages.markup.tag,"addAttribute",{value:function(r,s){t.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+r+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[s,"language-"+s],inside:t.languages[s]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),t.languages.html=t.languages.markup,t.languages.mathml=t.languages.markup,t.languages.svg=t.languages.markup,t.languages.xml=t.languages.extend("markup",{}),t.languages.ssml=t.languages.xml,t.languages.atom=t.languages.xml,t.languages.rss=t.languages.xml,(function(r){var s=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;r.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+s.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+s.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+s.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+s.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:s,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},r.languages.css.atrule.inside.rest=r.languages.css;var o=r.languages.markup;o&&(o.tag.addInlined("style","css"),o.tag.addAttribute("style","css"))})(t),t.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},t.languages.javascript=t.languages.extend("clike",{"class-name":[t.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+(/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source)+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),t.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,t.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:t.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:t.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:t.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:t.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:t.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),t.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:t.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),t.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),t.languages.markup&&(t.languages.markup.tag.addInlined("script","javascript"),t.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),t.languages.js=t.languages.javascript,(function(){if(typeof t>"u"||typeof document>"u")return;Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector);var r="Loading…",s=function(m,y){return"✖ Error "+m+" while fetching file: "+y},o="✖ Error: File does not exist or is empty",i={js:"javascript",py:"python",rb:"ruby",ps1:"powershell",psm1:"powershell",sh:"bash",bat:"batch",h:"c",tex:"latex"},a="data-src-status",l="loading",u="loaded",c="failed",f="pre[data-src]:not(["+a+'="'+u+'"]):not(['+a+'="'+l+'"])';function d(m,y,x){var p=new XMLHttpRequest;p.open("GET",m,!0),p.onreadystatechange=function(){p.readyState==4&&(p.status<400&&p.responseText?y(p.responseText):p.status>=400?x(s(p.status,p.statusText)):x(o))},p.send(null)}function h(m){var y=/^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(m||"");if(y){var x=Number(y[1]),p=y[2],_=y[3];return p?_?[x,Number(_)]:[x,void 0]:[x,x]}}t.hooks.add("before-highlightall",function(m){m.selector+=", "+f}),t.hooks.add("before-sanity-check",function(m){var y=m.element;if(y.matches(f)){m.code="",y.setAttribute(a,l);var x=y.appendChild(document.createElement("CODE"));x.textContent=r;var p=y.getAttribute("data-src"),_=m.language;if(_==="none"){var C=(/\.(\w+)$/.exec(p)||[,"none"])[1];_=i[C]||C}t.util.setLanguage(x,_),t.util.setLanguage(y,_);var v=t.plugins.autoloader;v&&v.loadLanguages(_),d(p,function(b){y.setAttribute(a,u);var S=h(y.getAttribute("data-range"));if(S){var T=b.split(/\r\n?|\n/g),E=S[0],N=S[1]==null?T.length:S[1];E<0&&(E+=T.length),E=Math.max(0,Math.min(E-1,T.length)),N<0&&(N+=T.length),N=Math.max(0,Math.min(N,T.length)),b=T.slice(E,N).join(`
15
+ `),y.hasAttribute("data-start")||y.setAttribute("data-start",String(E+1))}x.textContent=b,t.highlightElement(x)},function(b){y.setAttribute(a,c),x.textContent=b})}}),t.plugins.fileHighlight={highlight:function(y){for(var x=(y||document).querySelectorAll(f),p=0,_;_=x[p++];)t.highlightElement(_)}};var g=!1;t.fileHighlight=function(){g||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),g=!0),t.plugins.fileHighlight.highlight.apply(this,arguments)}})()})(Bo)),Bo.exports}Fv();Prism.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/};Prism.languages.javascript=Prism.languages.extend("clike",{"class-name":[Prism.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+(/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source)+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/});Prism.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/;Prism.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:Prism.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:Prism.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/});Prism.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:Prism.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}});Prism.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}});Prism.languages.markup&&(Prism.languages.markup.tag.addInlined("script","javascript"),Prism.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript"));Prism.languages.js=Prism.languages.javascript;Prism.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]};Prism.languages.markup.tag.inside["attr-value"].inside.entity=Prism.languages.markup.entity;Prism.languages.markup.doctype.inside["internal-subset"].inside=Prism.languages.markup;Prism.hooks.add("wrap",function(n){n.type==="entity"&&(n.attributes.title=n.content.replace(/&amp;/,"&"))});Object.defineProperty(Prism.languages.markup.tag,"addInlined",{value:function(e,t){var r={};r["language-"+t]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:Prism.languages[t]},r.cdata=/^<!\[CDATA\[|\]\]>$/i;var s={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:r}};s["language-"+t]={pattern:/[\s\S]+/,inside:Prism.languages[t]};var o={};o[e]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return e}),"i"),lookbehind:!0,greedy:!0,inside:s},Prism.languages.insertBefore("markup","cdata",o)}});Object.defineProperty(Prism.languages.markup.tag,"addAttribute",{value:function(n,e){Prism.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+n+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[e,"language-"+e],inside:Prism.languages[e]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}});Prism.languages.html=Prism.languages.markup;Prism.languages.mathml=Prism.languages.markup;Prism.languages.svg=Prism.languages.markup;Prism.languages.xml=Prism.languages.extend("markup",{});Prism.languages.ssml=Prism.languages.xml;Prism.languages.atom=Prism.languages.xml;Prism.languages.rss=Prism.languages.xml;(function(n){var e=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function t(c){return c=c.replace(/<inner>/g,function(){return e}),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+c+")")}var r=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,s=/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g,function(){return r}),o=/\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source;n.languages.markdown=n.languages.extend("markup",{}),n.languages.insertBefore("markdown","prolog",{"front-matter-block":{pattern:/(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,lookbehind:!0,greedy:!0,inside:{punctuation:/^---|---$/,"front-matter":{pattern:/\S+(?:\s+\S+)*/,alias:["yaml","language-yaml"],inside:n.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},table:{pattern:RegExp("^"+s+o+"(?:"+s+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+s+o+")(?:"+s+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(r),inside:n.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+s+")"+o+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+s+"$"),inside:{"table-header":{pattern:RegExp(r),alias:"important",inside:n.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,lookbehind:!0,alias:"keyword"},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,alias:"important",inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#.+/m,lookbehind:!0,alias:"important",inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:"punctuation"},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:"punctuation"},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:"url"},bold:{pattern:t(/\b__(?:(?!_)<inner>|_(?:(?!_)<inner>)+_)+__\b|\*\*(?:(?!\*)<inner>|\*(?:(?!\*)<inner>)+\*)+\*\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:t(/\b_(?:(?!_)<inner>|__(?:(?!_)<inner>)+__)+_\b|\*(?:(?!\*)<inner>|\*\*(?:(?!\*)<inner>)+\*\*)+\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:t(/(~~?)(?:(?!~)<inner>)+\2/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},"code-snippet":{pattern:/(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,lookbehind:!0,greedy:!0,alias:["code","keyword"]},url:{pattern:t(/!?\[(?:(?!\])<inner>)+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)|[ \t]?\[(?:(?!\])<inner>)+\])/.source),lookbehind:!0,greedy:!0,inside:{operator:/^!/,content:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},variable:{pattern:/(^\][ \t]?\[)[^\]]+(?=\]$)/,lookbehind:!0},url:{pattern:/(^\]\()[^\s)]+/,lookbehind:!0},string:{pattern:/(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,lookbehind:!0}}}}),["url","bold","italic","strike"].forEach(function(c){["url","bold","italic","strike","code-snippet"].forEach(function(f){c!==f&&(n.languages.markdown[c].inside.content.inside[f]=n.languages.markdown[f])})}),n.hooks.add("after-tokenize",function(c){if(c.language!=="markdown"&&c.language!=="md")return;function f(d){if(!(!d||typeof d=="string"))for(var h=0,g=d.length;h<g;h++){var m=d[h];if(m.type!=="code"){f(m.content);continue}var y=m.content[1],x=m.content[3];if(y&&x&&y.type==="code-language"&&x.type==="code-block"&&typeof y.content=="string"){var p=y.content.replace(/\b#/g,"sharp").replace(/\b\+\+/g,"pp");p=(/[a-z][\w-]*/i.exec(p)||[""])[0].toLowerCase();var _="language-"+p;x.alias?typeof x.alias=="string"?x.alias=[x.alias,_]:x.alias.push(_):x.alias=[_]}}}f(c.tokens)}),n.hooks.add("wrap",function(c){if(c.type==="code-block"){for(var f="",d=0,h=c.classes.length;d<h;d++){var g=c.classes[d],m=/language-(.+)/.exec(g);if(m){f=m[1];break}}var y=n.languages[f];if(y)c.content=n.highlight(u(c.content),y,f);else if(f&&f!=="none"&&n.plugins.autoloader){var x="md-"+new Date().valueOf()+"-"+Math.floor(Math.random()*1e16);c.attributes.id=x,n.plugins.autoloader.loadLanguages(f,function(){var p=document.getElementById(x);p&&(p.innerHTML=n.highlight(p.textContent,n.languages[f],f))})}}});var i=RegExp(n.languages.markup.tag.pattern.source,"gi"),a={amp:"&",lt:"<",gt:">",quot:'"'},l=String.fromCodePoint||String.fromCharCode;function u(c){var f=c.replace(i,"");return f=f.replace(/&(\w{1,8}|#x?[\da-f]{1,8});/gi,function(d,h){if(h=h.toLowerCase(),h[0]==="#"){var g;return h[1]==="x"?g=parseInt(h.slice(2),16):g=Number(h.slice(1)),l(g)}else{var m=a[h];return m||d}}),f}n.languages.md=n.languages.markdown})(Prism);Prism.languages.c=Prism.languages.extend("clike",{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,lookbehind:!0},keyword:/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/});Prism.languages.insertBefore("c","string",{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}});Prism.languages.insertBefore("c","string",{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:"property",inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},Prism.languages.c.string],char:Prism.languages.c.char,comment:Prism.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:"function"}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:"keyword"},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:Prism.languages.c}}}});Prism.languages.insertBefore("c","function",{constant:/\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/});delete Prism.languages.c.boolean;(function(n){var e=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;n.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+e.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+e.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+e.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+e.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:e,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},n.languages.css.atrule.inside.rest=n.languages.css;var t=n.languages.markup;t&&(t.tag.addInlined("style","css"),t.tag.addAttribute("style","css"))})(Prism);Prism.languages.objectivec=Prism.languages.extend("c",{string:{pattern:/@?"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},keyword:/\b(?:asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|in|inline|int|long|register|return|self|short|signed|sizeof|static|struct|super|switch|typedef|typeof|union|unsigned|void|volatile|while)\b|(?:@interface|@end|@implementation|@protocol|@class|@public|@protected|@private|@property|@try|@catch|@finally|@throw|@synthesize|@dynamic|@selector)\b/,operator:/-[->]?|\+\+?|!=?|<<?=?|>>?=?|==?|&&?|\|\|?|[~^%?*\/@]/});delete Prism.languages.objectivec["class-name"];Prism.languages.objc=Prism.languages.objectivec;Prism.languages.sql={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,lookbehind:!0},variable:[{pattern:/@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/,greedy:!0},/@[\w.$]+/],string:{pattern:/(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/,greedy:!0,lookbehind:!0},identifier:{pattern:/(^|[^@\\])`(?:\\[\s\S]|[^`\\]|``)*`/,greedy:!0,lookbehind:!0,inside:{punctuation:/^`|`$/}},function:/\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i,keyword:/\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:COL|_INSERT)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:ING|S)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i,boolean:/\b(?:FALSE|NULL|TRUE)\b/i,number:/\b0x[\da-f]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,operator:/[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/};(function(n){var e=n.languages.powershell={comment:[{pattern:/(^|[^`])<#[\s\S]*?#>/,lookbehind:!0},{pattern:/(^|[^`])#.*/,lookbehind:!0}],string:[{pattern:/"(?:`[\s\S]|[^`"])*"/,greedy:!0,inside:null},{pattern:/'(?:[^']|'')*'/,greedy:!0}],namespace:/\[[a-z](?:\[(?:\[[^\]]*\]|[^\[\]])*\]|[^\[\]])*\]/i,boolean:/\$(?:false|true)\b/i,variable:/\$\w+\b/,function:[/\b(?:Add|Approve|Assert|Backup|Block|Checkpoint|Clear|Close|Compare|Complete|Compress|Confirm|Connect|Convert|ConvertFrom|ConvertTo|Copy|Debug|Deny|Disable|Disconnect|Dismount|Edit|Enable|Enter|Exit|Expand|Export|Find|ForEach|Format|Get|Grant|Group|Hide|Import|Initialize|Install|Invoke|Join|Limit|Lock|Measure|Merge|Move|New|Open|Optimize|Out|Ping|Pop|Protect|Publish|Push|Read|Receive|Redo|Register|Remove|Rename|Repair|Request|Reset|Resize|Resolve|Restart|Restore|Resume|Revoke|Save|Search|Select|Send|Set|Show|Skip|Sort|Split|Start|Step|Stop|Submit|Suspend|Switch|Sync|Tee|Test|Trace|Unblock|Undo|Uninstall|Unlock|Unprotect|Unpublish|Unregister|Update|Use|Wait|Watch|Where|Write)-[a-z]+\b/i,/\b(?:ac|cat|chdir|clc|cli|clp|clv|compare|copy|cp|cpi|cpp|cvpa|dbp|del|diff|dir|ebp|echo|epal|epcsv|epsn|erase|fc|fl|ft|fw|gal|gbp|gc|gci|gcs|gdr|gi|gl|gm|gp|gps|group|gsv|gu|gv|gwmi|iex|ii|ipal|ipcsv|ipsn|irm|iwmi|iwr|kill|lp|ls|measure|mi|mount|move|mp|mv|nal|ndr|ni|nv|ogv|popd|ps|pushd|pwd|rbp|rd|rdr|ren|ri|rm|rmdir|rni|rnp|rp|rv|rvpa|rwmi|sal|saps|sasv|sbp|sc|select|set|shcm|si|sl|sleep|sls|sort|sp|spps|spsv|start|sv|swmi|tee|trcm|type|write)\b/i],keyword:/\b(?:Begin|Break|Catch|Class|Continue|Data|Define|Do|DynamicParam|Else|ElseIf|End|Exit|Filter|Finally|For|ForEach|From|Function|If|InlineScript|Parallel|Param|Process|Return|Sequence|Switch|Throw|Trap|Try|Until|Using|Var|While|Workflow)\b/i,operator:{pattern:/(^|\W)(?:!|-(?:b?(?:and|x?or)|as|(?:Not)?(?:Contains|In|Like|Match)|eq|ge|gt|is(?:Not)?|Join|le|lt|ne|not|Replace|sh[lr])\b|-[-=]?|\+[+=]?|[*\/%]=?)/i,lookbehind:!0},punctuation:/[|{}[\];(),.]/};e.string[0].inside={function:{pattern:/(^|[^`])\$\((?:\$\([^\r\n()]*\)|(?!\$\()[^\r\n)])*\)/,lookbehind:!0,inside:e},boolean:e.boolean,variable:e.variable}})(Prism);var $c={},Lc;function Mv(){return Lc||(Lc=1,Prism.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern:/![sra](?=[:}]$)/,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},Prism.languages.python["string-interpolation"].inside.interpolation.inside.rest=Prism.languages.python,Prism.languages.py=Prism.languages.python),$c}Mv();var Dc={},jc;function $v(){return jc||(jc=1,(function(n){for(var e=/\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|<self>)*\*\//.source,t=0;t<2;t++)e=e.replace(/<self>/g,function(){return e});e=e.replace(/<self>/g,function(){return/[^\s\S]/.source}),n.languages.rust={comment:[{pattern:RegExp(/(^|[^\\])/.source+e),lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/b?"(?:\\[\s\S]|[^\\"])*"|b?r(#*)"(?:[^"]|"(?!\1))*"\1/,greedy:!0},char:{pattern:/b?'(?:\\(?:x[0-7][\da-fA-F]|u\{(?:[\da-fA-F]_*){1,6}\}|.)|[^\\\r\n\t'])'/,greedy:!0},attribute:{pattern:/#!?\[(?:[^\[\]"]|"(?:\\[\s\S]|[^\\"])*")*\]/,greedy:!0,alias:"attr-name",inside:{string:null}},"closure-params":{pattern:/([=(,:]\s*|\bmove\s*)\|[^|]*\||\|[^|]*\|(?=\s*(?:\{|->))/,lookbehind:!0,greedy:!0,inside:{"closure-punctuation":{pattern:/^\||\|$/,alias:"punctuation"},rest:null}},"lifetime-annotation":{pattern:/'\w+/,alias:"symbol"},"fragment-specifier":{pattern:/(\$\w+:)[a-z]+/,lookbehind:!0,alias:"punctuation"},variable:/\$\w+/,"function-definition":{pattern:/(\bfn\s+)\w+/,lookbehind:!0,alias:"function"},"type-definition":{pattern:/(\b(?:enum|struct|trait|type|union)\s+)\w+/,lookbehind:!0,alias:"class-name"},"module-declaration":[{pattern:/(\b(?:crate|mod)\s+)[a-z][a-z_\d]*/,lookbehind:!0,alias:"namespace"},{pattern:/(\b(?:crate|self|super)\s*)::\s*[a-z][a-z_\d]*\b(?:\s*::(?:\s*[a-z][a-z_\d]*\s*::)*)?/,lookbehind:!0,alias:"namespace",inside:{punctuation:/::/}}],keyword:[/\b(?:Self|abstract|as|async|await|become|box|break|const|continue|crate|do|dyn|else|enum|extern|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|override|priv|pub|ref|return|self|static|struct|super|trait|try|type|typeof|union|unsafe|unsized|use|virtual|where|while|yield)\b/,/\b(?:bool|char|f(?:32|64)|[ui](?:8|16|32|64|128|size)|str)\b/],function:/\b[a-z_]\w*(?=\s*(?:::\s*<|\())/,macro:{pattern:/\b\w+!/,alias:"property"},constant:/\b[A-Z_][A-Z_\d]+\b/,"class-name":/\b[A-Z]\w*\b/,namespace:{pattern:/(?:\b[a-z][a-z_\d]*\s*::\s*)*\b[a-z][a-z_\d]*\s*::(?!\s*<)/,inside:{punctuation:/::/}},number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)(?:_?(?:f32|f64|[iu](?:8|16|32|64|size)?))?\b/,boolean:/\b(?:false|true)\b/,punctuation:/->|\.\.=|\.{1,3}|::|[{}[\];(),:]/,operator:/[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<<?=?|>>?=?|[@?]/},n.languages.rust["closure-params"].inside.rest=n.languages.rust,n.languages.rust.attribute.inside.string=n.languages.rust.string})(Prism)),Dc}$v();Prism.languages.swift={comment:{pattern:/(^|[^\\:])(?:\/\/.*|\/\*(?:[^/*]|\/(?!\*)|\*(?!\/)|\/\*(?:[^*]|\*(?!\/))*\*\/)*\*\/)/,lookbehind:!0,greedy:!0},"string-literal":[{pattern:RegExp(/(^|[^"#])/.source+"(?:"+/"(?:\\(?:\((?:[^()]|\([^()]*\))*\)|\r\n|[^(])|[^\\\r\n"])*"/.source+"|"+/"""(?:\\(?:\((?:[^()]|\([^()]*\))*\)|[^(])|[^\\"]|"(?!""))*"""/.source+")"+/(?!["#])/.source),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\\($/,alias:"punctuation"},punctuation:/\\(?=[\r\n])/,string:/[\s\S]+/}},{pattern:RegExp(/(^|[^"#])(#+)/.source+"(?:"+/"(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|\r\n|[^#])|[^\\\r\n])*?"/.source+"|"+/"""(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|[^#])|[^\\])*?"""/.source+")\\2"),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\#+\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\#+\($/,alias:"punctuation"},string:/[\s\S]+/}}],directive:{pattern:RegExp(/#/.source+"(?:"+(/(?:elseif|if)\b/.source+"(?:[ ]*"+/(?:![ \t]*)?(?:\b\w+\b(?:[ \t]*\((?:[^()]|\([^()]*\))*\))?|\((?:[^()]|\([^()]*\))*\))(?:[ \t]*(?:&&|\|\|))?/.source+")+")+"|"+/(?:else|endif)\b/.source+")"),alias:"property",inside:{"directive-name":/^#\w+/,boolean:/\b(?:false|true)\b/,number:/\b\d+(?:\.\d+)*\b/,operator:/!|&&|\|\||[<>]=?/,punctuation:/[(),]/}},literal:{pattern:/#(?:colorLiteral|column|dsohandle|file(?:ID|Literal|Path)?|function|imageLiteral|line)\b/,alias:"constant"},"other-directive":{pattern:/#\w+\b/,alias:"property"},attribute:{pattern:/@\w+/,alias:"atrule"},"function-definition":{pattern:/(\bfunc\s+)\w+/,lookbehind:!0,alias:"function"},label:{pattern:/\b(break|continue)\s+\w+|\b[a-zA-Z_]\w*(?=\s*:\s*(?:for|repeat|while)\b)/,lookbehind:!0,alias:"important"},keyword:/\b(?:Any|Protocol|Self|Type|actor|as|assignment|associatedtype|associativity|async|await|break|case|catch|class|continue|convenience|default|defer|deinit|didSet|do|dynamic|else|enum|extension|fallthrough|fileprivate|final|for|func|get|guard|higherThan|if|import|in|indirect|infix|init|inout|internal|is|isolated|lazy|left|let|lowerThan|mutating|none|nonisolated|nonmutating|open|operator|optional|override|postfix|precedencegroup|prefix|private|protocol|public|repeat|required|rethrows|return|right|safe|self|set|some|static|struct|subscript|super|switch|throw|throws|try|typealias|unowned|unsafe|var|weak|where|while|willSet)\b/,boolean:/\b(?:false|true)\b/,nil:{pattern:/\bnil\b/,alias:"constant"},"short-argument":/\$\d+\b/,omit:{pattern:/\b_\b/,alias:"keyword"},number:/\b(?:[\d_]+(?:\.[\de_]+)?|0x[a-f0-9_]+(?:\.[a-f0-9p_]+)?|0b[01_]+|0o[0-7_]+)\b/i,"class-name":/\b[A-Z](?:[A-Z_\d]*[a-z]\w*)?\b/,function:/\b[a-z_]\w*(?=\s*\()/i,constant:/\b(?:[A-Z_]{2,}|k[A-Z][A-Za-z_]+)\b/,operator:/[-+*/%=!<>&|^~?]+|\.[.\-+*/%=!<>&|^~?]+/,punctuation:/[{}[\]();,.:\\]/};Prism.languages.swift["string-literal"].forEach(function(n){n.inside.interpolation.inside=Prism.languages.swift});var Bc={},zc;function Lv(){return zc||(zc=1,(function(n){n.languages.typescript=n.languages.extend("javascript",{"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/}),n.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete n.languages.typescript.parameter,delete n.languages.typescript["literal-property"];var e=n.languages.extend("typescript",{});delete e["class-name"],n.languages.typescript["class-name"].inside=e,n.languages.insertBefore("typescript","function",{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:"operator"},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:e}}}}),n.languages.ts=n.languages.typescript})(Prism)),Bc}Lv();var Uc={},Kc;function Dv(){return Kc||(Kc=1,(function(n){var e=/\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record(?!\s*[(){}[\]<>=%~.:,;?+\-*/&|^])|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/,t=/(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source,r={pattern:RegExp(/(^|[^\w.])/.source+t+/[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source),lookbehind:!0,inside:{namespace:{pattern:/^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,inside:{punctuation:/\./}},punctuation:/\./}};n.languages.java=n.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"/,lookbehind:!0,greedy:!0},"class-name":[r,{pattern:RegExp(/(^|[^\w.])/.source+t+/[A-Z]\w*(?=\s+\w+\s*[;,=()]|\s*(?:\[[\s,]*\]\s*)?::\s*new\b)/.source),lookbehind:!0,inside:r.inside},{pattern:RegExp(/(\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\s+)/.source+t+/[A-Z]\w*\b/.source),lookbehind:!0,inside:r.inside}],keyword:e,function:[n.languages.clike.function,{pattern:/(::\s*)[a-z_]\w*/,lookbehind:!0}],number:/\b0b[01][01_]*L?\b|\b0x(?:\.[\da-f_p+-]+|[\da-f_]+(?:\.[\da-f_p+-]+)?)\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfl]?/i,operator:{pattern:/(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m,lookbehind:!0},constant:/\b[A-Z][A-Z_\d]+\b/}),n.languages.insertBefore("java","string",{"triple-quoted-string":{pattern:/"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,greedy:!0,alias:"string"},char:{pattern:/'(?:\\.|[^'\\\r\n]){1,6}'/,greedy:!0}}),n.languages.insertBefore("java","class-name",{annotation:{pattern:/(^|[^.])@\w+(?:\s*\.\s*\w+)*/,lookbehind:!0,alias:"punctuation"},generics:{pattern:/<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&))*>)*>)*>)*>/,inside:{"class-name":r,keyword:e,punctuation:/[<>(),.:]/,operator:/[?&|]/}},import:[{pattern:RegExp(/(\bimport\s+)/.source+t+/(?:[A-Z]\w*|\*)(?=\s*;)/.source),lookbehind:!0,inside:{namespace:r.inside.namespace,punctuation:/\./,operator:/\*/,"class-name":/\w+/}},{pattern:RegExp(/(\bimport\s+static\s+)/.source+t+/(?:\w+|\*)(?=\s*;)/.source),lookbehind:!0,alias:"static",inside:{namespace:r.inside.namespace,static:/\b\w+$/,punctuation:/\./,operator:/\*/,"class-name":/\w+/}}],namespace:{pattern:RegExp(/(\b(?:exports|import(?:\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\s+)(?!<keyword>)[a-z]\w*(?:\.[a-z]\w*)*\.?/.source.replace(/<keyword>/g,function(){return e.source})),lookbehind:!0,inside:{punctuation:/\./}}})})(Prism)),Uc}Dv();var Wc={},Vc;function jv(){return Vc||(Vc=1,(function(n){var e=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,t=/\b(?!<keyword>)\w+(?:\s*\.\s*\w+)*\b/.source.replace(/<keyword>/g,function(){return e.source});n.languages.cpp=n.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!<keyword>)\w+/.source.replace(/<keyword>/g,function(){return e.source})),lookbehind:!0},/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,/\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/],keyword:e,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,greedy:!0},operator:/>>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:false|true)\b/}),n.languages.insertBefore("cpp","string",{module:{pattern:RegExp(/(\b(?:import|module)\s+)/.source+"(?:"+/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|<[^<>\r\n]*>/.source+"|"+/<mod-name>(?:\s*:\s*<mod-name>)?|:\s*<mod-name>/.source.replace(/<mod-name>/g,function(){return t})+")"),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:"string",greedy:!0}}),n.languages.insertBefore("cpp","keyword",{"generic-function":{pattern:/\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,inside:{function:/^\w+/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:n.languages.cpp}}}}),n.languages.insertBefore("cpp","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}}),n.languages.insertBefore("cpp","class-name",{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:n.languages.extend("cpp",{})}}),n.languages.insertBefore("inside","double-colon",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},n.languages.cpp["base-clause"])})(Prism)),Wc}jv();function jg(n,e){for(const t of n.childNodes){if(Ne(t)&&t.tagName===e)return!0;jg(t,e)}return!1}const Sr="data-language",_r="data-highlight-language",us="data-theme";let mo=class Bg extends lt{__language;__theme;__isSyntaxHighlightSupported;static getType(){return"code"}static clone(e){return new Bg(e.__language,e.__key)}constructor(e,t){super(t),this.__language=e||void 0,this.__isSyntaxHighlightSupported=!1,this.__theme=void 0}afterCloneFrom(e){super.afterCloneFrom(e),this.__language=e.__language,this.__theme=e.__theme,this.__isSyntaxHighlightSupported=e.__isSyntaxHighlightSupported}createDOM(e){const t=document.createElement("code");bt(t,e.theme.code),t.setAttribute("spellcheck","false");const r=this.getLanguage();r&&(t.setAttribute(Sr,r),this.getIsSyntaxHighlightSupported()&&t.setAttribute(_r,r));const s=this.getTheme();s&&t.setAttribute(us,s);const o=this.getStyle();return o&&t.setAttribute("style",o),t}updateDOM(e,t,r){const s=this.__language,o=e.__language;s?s!==o&&t.setAttribute(Sr,s):o&&t.removeAttribute(Sr);const i=this.__isSyntaxHighlightSupported;e.__isSyntaxHighlightSupported&&o?i&&s?s!==o&&t.setAttribute(_r,s):t.removeAttribute(_r):i&&s&&t.setAttribute(_r,s);const a=this.__theme,l=e.__theme;a?a!==l&&t.setAttribute(us,a):l&&t.removeAttribute(us);const u=this.__style,c=e.__style;return u?u!==c&&t.setAttribute("style",u):c&&t.removeAttribute("style"),!1}exportDOM(e){const t=document.createElement("pre");bt(t,e._config.theme.code),t.setAttribute("spellcheck","false");const r=this.getLanguage();r&&(t.setAttribute(Sr,r),this.getIsSyntaxHighlightSupported()&&t.setAttribute(_r,r));const s=this.getTheme();s&&t.setAttribute(us,s);const o=this.getStyle();return o&&t.setAttribute("style",o),{element:t}}static importDOM(){return{code:e=>e.textContent!=null&&(/\r?\n/.test(e.textContent)||jg(e,"BR"))?{conversion:Hc,priority:1}:null,div:()=>({conversion:Bv,priority:1}),pre:()=>({conversion:Hc,priority:0}),table:e=>zo(e)?{conversion:zv,priority:3}:null,td:e=>{const t=e,r=t.closest("table");return t.classList.contains("js-file-line")||r&&zo(r)?{conversion:qc,priority:3}:null},tr:e=>{const t=e.closest("table");return t&&zo(t)?{conversion:qc,priority:3}:null}}}static importJSON(e){return Jt().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setLanguage(e.language).setTheme(e.theme)}exportJSON(){return{...super.exportJSON(),language:this.getLanguage(),theme:this.getTheme()}}insertNewAfter(e,t=!0){const r=this.getChildren(),s=r.length;if(s>=2&&r[s-1].getTextContent()===`
16
+ `&&r[s-2].getTextContent()===`
17
+ `&&e.isCollapsed()&&e.anchor.key===this.__key&&e.anchor.offset===s){r[s-1].remove(),r[s-2].remove();const l=Te();return this.insertAfter(l,t),l}const{anchor:o,focus:i}=e,a=(o.isBefore(i)?o:i).getNode();if(z(a)){let l=Kv(a);const u=[];for(;;)if(eo(l))u.push(fr()),l=l.getNextSibling();else{if(!Kg(l))break;{let y=0;const x=l.getTextContent(),p=l.getTextContentSize();for(;y<p&&x[y]===" ";)y++;if(y!==0&&u.push(Ug(" ".repeat(y))),y!==p)break;l=l.getNextSibling()}}const c=a.splitText(o.offset)[0],f=o.offset===0?0:1,d=c.getIndexWithinParent()+f,h=a.getParentOrThrow(),g=[xt(),...u];h.splice(d,0,g);const m=u[u.length-1];m?m.select():o.offset===0?c.selectPrevious():c.getNextSibling().selectNext(0,0)}if(ja(a)){const{offset:l}=e.anchor;a.splice(l,0,[xt()]),a.select(l+1,l+1)}return null}canIndent(){return!1}collapseAtStart(){const e=Te();return this.getChildren().forEach(t=>e.append(t)),this.replace(e),!0}setLanguage(e){const t=this.getWritable();return t.__language=e||void 0,t}getLanguage(){return this.getLatest().__language}setIsSyntaxHighlightSupported(e){const t=this.getWritable();return t.__isSyntaxHighlightSupported=e,t}getIsSyntaxHighlightSupported(){return this.getLatest().__isSyntaxHighlightSupported}setTheme(e){const t=this.getWritable();return t.__theme=e||void 0,t}getTheme(){return this.getLatest().__theme}};function Jt(n,e){return eg(mo).setLanguage(n).setTheme(e)}function ja(n){return n instanceof mo}function Hc(n){return{node:Jt(n.getAttribute(Sr))}}function Bv(n){const e=n,t=Jc(e);return t||(function(r){let s=r.parentElement;for(;s!==null;){if(Jc(s))return!0;s=s.parentElement}return!1})(e)?{node:t?Jt():null}:{node:null}}function zv(){return{node:Jt()}}function qc(){return{node:null}}function Jc(n){return n.style.fontFamily.match("monospace")!==null}function zo(n){return n.classList.contains("js-file-line-container")}let Ba=class zg extends Dt{__highlightType;constructor(e="",t,r){super(e,r),this.__highlightType=t}static getType(){return"code-highlight"}static clone(e){return new zg(e.__text,e.__highlightType||void 0,e.__key)}getHighlightType(){return this.getLatest().__highlightType}setHighlightType(e){const t=this.getWritable();return t.__highlightType=e||void 0,t}canHaveFormat(){return!1}createDOM(e){const t=super.createDOM(e),r=Uo(e.theme,this.__highlightType);return bt(t,r),t}updateDOM(e,t,r){const s=super.updateDOM(e,t,r),o=Uo(r.theme,e.__highlightType),i=Uo(r.theme,this.__highlightType);return o!==i&&(o&&go(t,o),i&&bt(t,i)),s}static importJSON(e){return Ug().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setHighlightType(e.highlightType)}exportJSON(){return{...super.exportJSON(),highlightType:this.getHighlightType()}}setFormat(e){return this}isParentRequired(){return!0}createParentElementNode(){return Jt()}};function Uo(n,e){return e&&n&&n.codeHighlight&&n.codeHighlight[e]}function Ug(n="",e){return mt(new Ba(n,e))}function Kg(n){return n instanceof Ba}function Uv(n,e){let t=n;for(let r=Fe(n,e);r&&(Kg(r.origin)||eo(r.origin));r=h_(r))t=r.origin;return t}function Kv(n){return Uv(n,"previous")}(function(n){n.languages.diff={coord:[/^(?:\*{3}|-{3}|\+{3}).*$/m,/^@@.*@@$/m,/^\d.*$/m]};var e={"deleted-sign":"-","deleted-arrow":"<","inserted-sign":"+","inserted-arrow":">",unchanged:" ",diff:"!"};Object.keys(e).forEach(function(t){var r=e[t],s=[];/^\w+$/.test(t)||s.push(/\w+/.exec(t)[0]),t==="diff"&&s.push("bold"),n.languages.diff[t]={pattern:RegExp("^(?:["+r+`].*(?:\r
18
+ ?|
19
+ |(?![\\s\\S])))+`,"m"),alias:s,inside:{line:{pattern:/(.)(?=[\s\S]).*(?:\r\n?|\n)?/,lookbehind:!0},prefix:{pattern:/[\s\S]/,alias:/\w+/.exec(t)[0]}}}}),Object.defineProperty(n.languages.diff,"PREFIXES",{value:e})})(Prism);const Wv=new Set(["http:","https:","mailto:","sms:","tel:"]);class fn extends lt{__url;__target;__rel;__title;static getType(){return"link"}static clone(e){return new fn(e.__url,{rel:e.__rel,target:e.__target,title:e.__title},e.__key)}constructor(e="",t={},r){super(r);const{target:s=null,rel:o=null,title:i=null}=t;this.__url=e,this.__target=s,this.__rel=o,this.__title=i}createDOM(e){const t=document.createElement("a");return this.updateLinkDOM(null,t,e),bt(t,e.theme.link),t}updateLinkDOM(e,t,r){if(ka(t)){e&&e.__url===this.__url||(t.href=this.sanitizeUrl(this.__url));for(const s of["target","rel","title"]){const o=`__${s}`,i=this[o];e&&e[o]===i||(i?t[s]=i:t.removeAttribute(s))}}}updateDOM(e,t,r){return this.updateLinkDOM(e,t,r),!1}static importDOM(){return{a:e=>({conversion:Vv,priority:1})}}static importJSON(e){return Sn().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setURL(e.url).setRel(e.rel||null).setTarget(e.target||null).setTitle(e.title||null)}sanitizeUrl(e){e=Yc(e);try{const t=new URL(Yc(e));if(!Wv.has(t.protocol))return"about:blank"}catch{return e}return e}exportJSON(){return{...super.exportJSON(),rel:this.getRel(),target:this.getTarget(),title:this.getTitle(),url:this.getURL()}}getURL(){return this.getLatest().__url}setURL(e){const t=this.getWritable();return t.__url=e,t}getTarget(){return this.getLatest().__target}setTarget(e){const t=this.getWritable();return t.__target=e,t}getRel(){return this.getLatest().__rel}setRel(e){const t=this.getWritable();return t.__rel=e,t}getTitle(){return this.getLatest().__title}setTitle(e){const t=this.getWritable();return t.__title=e,t}insertNewAfter(e,t=!0){const r=Sn(this.__url,{rel:this.__rel,target:this.__target,title:this.__title});return this.insertAfter(r,t),r}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(e,t,r){if(!O(t))return!1;const s=t.anchor.getNode(),o=t.focus.getNode();return this.isParentOf(s)&&this.isParentOf(o)&&t.getTextContent().length>0}isEmailURI(){return this.__url.startsWith("mailto:")}isWebSiteURI(){return this.__url.startsWith("https://")||this.__url.startsWith("http://")}}function Vv(n){let e=null;if(ka(n)){const t=n.textContent;(t!==null&&t!==""||n.children.length>0)&&(e=Sn(n.getAttribute("href")||"",{rel:n.getAttribute("rel"),target:n.getAttribute("target"),title:n.getAttribute("title")}))}return{node:e}}function Sn(n="",e){return mt(new fn(n,e))}function kt(n){return n instanceof fn}class hr extends fn{__isUnlinked;constructor(e="",t={},r){super(e,t,r),this.__isUnlinked=t.isUnlinked!==void 0&&t.isUnlinked!==null&&t.isUnlinked}static getType(){return"autolink"}static clone(e){return new hr(e.__url,{isUnlinked:e.__isUnlinked,rel:e.__rel,target:e.__target,title:e.__title},e.__key)}getIsUnlinked(){return this.__isUnlinked}setIsUnlinked(e){const t=this.getWritable();return t.__isUnlinked=e,t}createDOM(e){return this.__isUnlinked?document.createElement("span"):super.createDOM(e)}updateDOM(e,t,r){return super.updateDOM(e,t,r)||e.__isUnlinked!==this.__isUnlinked}static importJSON(e){return Oi().updateFromJSON(e)}updateFromJSON(e){return super.updateFromJSON(e).setIsUnlinked(e.isUnlinked||!1)}static importDOM(){return null}exportJSON(){return{...super.exportJSON(),isUnlinked:this.__isUnlinked}}insertNewAfter(e,t=!0){const r=this.getParentOrThrow().insertNewAfter(e,t);if(A(r)){const s=Oi(this.__url,{isUnlinked:this.__isUnlinked,rel:this.__rel,target:this.__target,title:this.__title});return r.append(s),s}return null}}function Oi(n="",e){return mt(new hr(n,e))}function At(n){return n instanceof hr}const Fi=Q("TOGGLE_LINK_COMMAND");function Gc(n,e){if(n.type==="element"){const t=n.getNode();return A(t)||(function(r,...s){const o=new URL("https://lexical.dev/docs/error"),i=new URLSearchParams;i.append("code",r);for(const a of s)i.append("v",a);throw o.search=i.toString(),Error(`Minified Lexical error #${r}; visit ${o.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)})(252),t.getChildren()[n.offset+e]||null}return null}function Ko(n,e={}){let t;if(n&&typeof n=="object"){const{url:c,...f}=n;t=c,e={...f,...e}}else t=n;const{target:r,title:s}=e,o=e.rel===void 0?"noreferrer":e.rel,i=U();if(i===null||!O(i)&&!Me(i))return;if(Me(i)){const c=i.getNodes();return c.length===0?void 0:void c.forEach(f=>{if(t===null){const d=Qe(f,h=>!At(h)&&kt(h));d&&(d.insertBefore(f),d.getChildren().length===0&&d.remove())}else{const d=Qe(f,h=>!At(h)&&kt(h));if(d)d.setURL(t),r!==void 0&&d.setTarget(r),o!==void 0&&d.setRel(o);else{const h=Sn(t,{rel:o,target:r});f.insertBefore(h),h.append(f)}}})}const a=i.extract();if(t===null){const c=new Set;return void a.forEach(f=>{const d=f.getParent();if(kt(d)&&!At(d)){const h=d.getKey();if(c.has(h))return;(function(g,m){const y=new Set(m.filter(S=>g.isParentOf(S)).map(S=>S.getKey())),x=g.getChildren(),p=x.filter(S=>y.has(S.getKey()));if(p.length===x.length)return x.forEach(S=>g.insertBefore(S)),void g.remove();const _=x.findIndex(S=>y.has(S.getKey())),C=x.findLastIndex(S=>y.has(S.getKey())),v=_===0,b=C===x.length-1;if(v)p.forEach(S=>g.insertBefore(S));else if(b)for(let S=p.length-1;S>=0;S--)g.insertAfter(p[S]);else{for(let T=p.length-1;T>=0;T--)g.insertAfter(p[T]);const S=x.slice(C+1);if(S.length>0){const T=Sn(g.getURL(),{rel:g.getRel(),target:g.getTarget(),title:g.getTitle()});p[p.length-1].insertAfter(T),S.forEach(E=>T.append(E))}}})(d,a),c.add(h)}})}const l=new Set,u=c=>{l.has(c.getKey())||(l.add(c.getKey()),c.setURL(t),r!==void 0&&c.setTarget(r),o!==void 0&&c.setRel(o),s!==void 0&&c.setTitle(s))};if(a.length===1){const c=a[0],f=Qe(c,kt);if(f!==null)return u(f)}(function(c){const f=U();if(!O(f))return c();const d=kn(f),h=d.isBackward(),g=Gc(d.anchor,h?-1:0),m=Gc(d.focus,h?0:-1);if(c(),g||m){const y=U();if(O(y)){const x=y.clone();if(g){const p=g.getParent();p&&x.anchor.set(p.getKey(),g.getIndexWithinParent()+(h?1:0),"element")}if(m){const p=m.getParent();p&&x.focus.set(p.getKey(),m.getIndexWithinParent()+(h?0:1),"element")}Ke(kn(x))}}})(()=>{let c=null;for(const f of a){if(!f.isAttached())continue;const d=Qe(f,kt);if(d){u(d);continue}if(A(f)){if(!f.isInline())continue;if(kt(f)){if(!(At(f)||c!==null&&c.getParentOrThrow().isParentOf(f))){u(f),c=f;continue}for(const g of f.getChildren())f.insertBefore(g);f.remove();continue}}const h=f.getPreviousSibling();kt(h)&&h.is(c)?h.append(f):(c=Sn(t,{rel:o,target:r,title:s}),f.insertAfter(c),c.append(f))}})}const Hv=/^\+?[0-9\s()-]{5,}$/;function Yc(n){return n.match(/^[a-z][a-z0-9+.-]*:/i)||n.match(/^[/#.]/)?n:n.includes("@")?`mailto:${n}`:Hv.test(n)?`tel:${n}`:`https://${n}`}function qv(n,e){return pt(wi(()=>n.registerCommand(Fi,t=>{const r=e.validateUrl.peek(),s=e.attributes.peek();if(t===null)return Ko(null),!0;if(typeof t=="string")return!(r!==void 0&&!r(t))&&(Ko(t,s),!0);{const{url:o,target:i,rel:a,title:l}=t;return Ko(o,{...s,rel:a,target:i,title:l}),!0}},Xe)),wi(()=>{const t=e.validateUrl.value;if(!t)return;const r=e.attributes.value;return n.registerCommand(Xs,s=>{const o=U();if(!O(o)||o.isCollapsed()||!sn(s,ClipboardEvent)||s.clipboardData===null)return!1;const i=s.clipboardData.getData("text");return!!t(i)&&!o.getNodes().some(a=>A(a))&&(n.dispatchCommand(Fi,{...r,url:i}),s.preventDefault(),!0)},Xe)}))}function Jv(n,e,t={}){const r=o=>{const i=o.target;if(!Dn(i))return;const a=so(i);if(a===null)return;let l=null,u=null;if(a.update(()=>{const d=$t(i);if(d!==null){const h=Qe(d,A);if(!e.disabled.peek())if(kt(h))l=h.sanitizeUrl(h.getURL()),u=h.getTarget();else{const g=(function(m,y){let x=m;for(;x!=null;){if(y(x))return x;x=x.parentNode}return null})(i,ka);g!==null&&(l=g.href,u=g.target)}}}),l===null||l==="")return;const c=n.getEditorState().read(U);if(O(c)&&!c.isCollapsed())return void o.preventDefault();const f=o.type==="auxclick"&&o.button===1;window.open(l,e.newTab.peek()||f||o.metaKey||o.ctrlKey||u==="_blank"?"_blank":"_self"),o.preventDefault()},s=o=>{o.button===1&&r(o)};return n.registerRootListener((o,i)=>{i!==null&&(i.removeEventListener("click",r),i.removeEventListener("mouseup",s)),o!==null&&(o.addEventListener("click",r,t),o.addEventListener("mouseup",s,t))})}function Zc(n,e=t=>t){return t=>{const r=n.exec(t);return r===null?null:{index:r.index,length:r[0].length,text:r[0],url:e(r[0])}}}function Wg(n,e){for(let t=0;t<e.length;t++){const r=e[t](n);if(r)return r}return null}const Gv=/[.,;\s]/;function zs(n){return Gv.test(n)}function Vg(n){return zs(n[n.length-1])}function Mi(n){return zs(n[0])}function Hg(n){let e=n.getPreviousSibling();return A(e)&&(e=e.getLastDescendant()),e===null||It(e)||z(e)&&Vg(e.getTextContent())}function qg(n){let e=n.getNextSibling();return A(e)&&(e=e.getFirstDescendant()),e===null||It(e)||z(e)&&Mi(e.getTextContent())}function Yv(n,e,t,r){return(n>0?zs(t[n-1]):Hg(r[0]))?e<t.length?zs(t[e]):qg(r[r.length-1]):!1}function Zv(n,e,t){const r=[],s=[],o=[];let i=0,a=0;const l=[...n];for(;l.length>0;){const u=l[0],c=u.getTextContent().length,f=a;a+c<=e?(r.push(u),i+=c):f>=t?o.push(u):s.push(u),a+=c,l.shift()}return[i,r,s,o]}function Xv(n,e,t,r){const s=Oi(r.url,r.attributes);if(n.length===1){let o,i=n[0];e===0?[o,i]=i.splitText(t):[,o,i]=i.splitText(e,t);const a=we(r.text);return a.setFormat(o.getFormat()),a.setDetail(o.getDetail()),a.setStyle(o.getStyle()),s.append(a),o.replace(s),i}if(n.length>1){const o=n[0];let i,a=o.getTextContent().length;e===0?i=o:[,i]=o.splitText(e);const l=[];let u;for(let h=1;h<n.length;h++){const g=n[h],m=g.getTextContent().length,y=a;if(y<t)if(a+m<=t)l.push(g);else{const[x,p]=g.splitText(t-y);l.push(x),u=p}a+=m}const c=U(),f=c?c.getNodes().find(z):void 0,d=we(i.getTextContent());return d.setFormat(i.getFormat()),d.setDetail(i.getDetail()),d.setStyle(i.getStyle()),s.append(d,...l),f&&f===i&&(O(c)?d.select(c.anchor.offset,c.focus.offset):Me(c)&&d.select(0,d.getTextContent().length)),i.replace(s),u}}function Wo(n,e,t){const r=n.getChildren(),s=r.length;for(let l=0;l<s;l++){const u=r[l];if(!z(u)||!u.isSimpleText())return vs(n),void t(null,n.getURL())}const o=n.getTextContent(),i=Wg(o,e);if(i===null||i.text!==o||!Hg(n)||!qg(n))return vs(n),void t(null,n.getURL());const a=n.getURL();if(a!==i.url&&(n.setURL(i.url),t(i.url,a)),i.attributes){const l=n.getRel();l!==i.attributes.rel&&(n.setRel(i.attributes.rel||null),t(i.attributes.rel||null,l));const u=n.getTarget();u!==i.attributes.target&&(n.setTarget(i.attributes.target||null),t(i.attributes.target||null,u))}}function vs(n){const e=n.getChildren();for(let t=e.length-1;t>=0;t--)n.insertAfter(e[t]);return n.remove(),e.map(t=>t.getLatest())}const Qv={changeHandlers:[],matchers:[]};function ex(n,e=Qv){const{matchers:t,changeHandlers:r}=e,s=(o,i)=>{for(const a of r)a(o,i)};return pt(n.registerNodeTransform(Dt,o=>{const i=o.getParentOrThrow(),a=o.getPreviousSibling();if(At(i)&&!i.getIsUnlinked())Wo(i,t,s);else if(!kt(i)){if(o.isSimpleText()&&(Mi(o.getTextContent())||!At(a))){const l=(function(u){const c=[u];let f=u.getNextSibling();for(;f!==null&&z(f)&&f.isSimpleText()&&(c.push(f),!/[\s]/.test(f.getTextContent()));)f=f.getNextSibling();return c})(o);(function(u,c,f){let d=[...u];const h=d.map(x=>x.getTextContent()).join("");let g,m=h,y=0;for(;(g=Wg(m,c))&&g!==null;){const x=g.index,p=x+g.length;if(Yv(y+x,y+p,h,d)){const[_,,C,v]=Zv(d,y+x,y+p),b=Xv(C,y+x-_,y+p-_,g);d=b?[b,...v]:v,f(g.url,null),y=0}else y+=p;m=m.substring(p)}})(l,t,s)}(function(l,u,c){const f=l.getPreviousSibling(),d=l.getNextSibling(),h=l.getTextContent();var g;!At(f)||f.getIsUnlinked()||Mi(h)&&(g=h,!(f.isEmailURI()?/^\.[a-zA-Z]{2,}/.test(g):/^\.[a-zA-Z0-9]{1,}/.test(g)))||(f.append(l),Wo(f,u,c),c(null,f.getURL())),!At(d)||d.getIsUnlinked()||Vg(h)||(vs(d),Wo(d,u,c),c(null,d.getURL()))})(o,t,s)}}),n.registerCommand(Fi,o=>{const i=U();return o!==null||!O(i)||i.extract().forEach(a=>{const l=a.getParent();At(l)&&(l.setIsUnlinked(!l.getIsUnlinked()),l.markDirty())}),!1},Xe))}function $i(n,e){const t={};for(const r of n){const s=e(r);s&&(t[s]?t[s].push(r):t[s]=[r])}return t}function za(n){const e=$i(n,t=>t.type);return{element:e.element||[],multilineElement:e["multiline-element"]||[],textFormat:e["text-format"]||[],textMatch:e["text-match"]||[]}}const Us=/[!-/:-@[-`{-~\s]/,tx=/^\s{0,3}$/;function Li(n){if(!Kr(n))return!1;const e=n.getFirstChild();return e==null||n.getChildrenSize()===1&&z(e)&&tx.test(e.getTextContent())}function nx(n,e,t,r){for(const s of e){if(!s.export)continue;const o=s.export(n,i=>Ks(i,t,r));if(o!=null)return o}return A(n)?Ks(n,t,r):he(n)?n.getTextContent():null}function Ks(n,e,t,r,s){const o=[],i=n.getChildren();r||(r=[]),s||(s=[]);e:for(const a of i){for(const l of t){if(!l.export)continue;const u=l.export(a,c=>Ks(c,e,t,r,[...s,...r]),(c,f)=>Xc(c,f,e,r,s));if(u!=null){o.push(u);continue e}}It(a)?o.push(`
20
+ `):z(a)?o.push(Xc(a,a.getTextContent(),e,r,s)):A(a)?o.push(Ks(a,e,t,r,s)):he(a)&&o.push(a.getTextContent())}return o.join("")}function Xc(n,e,t,r,s){let o=n.getFormat()===0?e:(function(d){return d.replace(/^\s+|\s+$/g,h=>[...h].map(g=>"&#"+g.codePointAt(0)+";").join(""))})(e);n.hasFormat("code")||(o=o.replace(/([*_`~\\])/g,"\\$1"));let i="",a="",l="";const u=Qc(n,!0),c=Qc(n,!1),f=new Set;for(const d of t){const h=d.format[0],g=d.tag;ds(n,h)&&!f.has(h)&&(f.add(h),ds(u,h)&&r.find(m=>m.tag===g)||(r.push({format:h,tag:g}),i+=g))}for(let d=0;d<r.length;d++){const h=ds(n,r[d].format),g=ds(c,r[d].format);if(h&&g)continue;const m=[...r];for(;m.length>d;){const y=m.pop();s&&y&&s.find(x=>x.tag===y.tag)||(y&&typeof y.tag=="string"&&(h?g||(l+=y.tag):a+=y.tag),r.pop())}break}return o=i+o+l,a+o}function Qc(n,e){let t=e?n.getPreviousSibling():n.getNextSibling();if(!t){const r=n.getParentOrThrow();r.isInline()&&(t=e?r.getPreviousSibling():r.getNextSibling())}for(;t;){if(A(t)){if(!t.isInline())break;const r=e?t.getLastDescendant():t.getFirstDescendant();if(z(r))return r;t=e?t.getPreviousSibling():t.getNextSibling()}if(z(t))return t;if(!A(t))return null}return null}function ds(n,e){return z(n)&&n.hasFormat(e)}function rx(n,e){const t=(function(s,o){const i=s.match(o.openTagsRegExp);if(i==null)return null;for(const a of i){const l=a.replace(/^\s/,""),u=o.fullMatchRegExpByTag[l];if(u==null)continue;const c=s.match(u),f=o.transformersByTag[l];if(c!=null&&f!=null){if(f.intraword!==!1)return c;const{index:d=0}=c,h=s[d-1],g=s[d+c[0].length];if((!h||Us.test(h))&&(!g||Us.test(g)))return c}}return null})(n.getTextContent(),e);if(!t)return null;const r=t.index||0;return{endIndex:r+t[0].length,match:t,startIndex:r,transformer:e.transformersByTag[t[1]]}}function mn(n){return z(n)&&!n.hasFormat("code")}function yn(n,e,t){let r=rx(n,e),s=(function(i,a){const l=i;let u,c,f,d;for(const h of a){if(!h.replace||!h.importRegExp)continue;const g=l.getTextContent().match(h.importRegExp);if(!g)continue;const m=g.index||0,y=h.getEndIndex?h.getEndIndex(l,g):m+g[0].length;y!==!1&&(u===void 0||c===void 0||m<u&&(y>c||y<=u))&&(u=m,c=y,f=h,d=g)}return u===void 0||c===void 0||f===void 0||d===void 0?null:{endIndex:c,match:d,startIndex:u,transformer:f}})(n,t);if(r&&s&&(r.startIndex<=s.startIndex&&r.endIndex>=s.endIndex||s.startIndex>r.endIndex?s=null:r=null),r){const i=(function(a,l,u,c,f){const d=a.getTextContent();let h,g,m;if(f[0]===d?h=a:l===0?[h,g]=a.splitText(u):[m,h,g]=a.splitText(l,u),h.setTextContent(f[2]),c)for(const y of c.format)h.hasFormat(y)||h.toggleFormat(y);return{nodeAfter:g,nodeBefore:m,transformedNode:h}})(n,r.startIndex,r.endIndex,r.transformer,r.match);mn(i.nodeAfter)&&yn(i.nodeAfter,e,t),mn(i.nodeBefore)&&yn(i.nodeBefore,e,t),mn(i.transformedNode)&&yn(i.transformedNode,e,t)}else if(s){const i=(function(a,l,u,c,f){let d,h,g;return l===0?[d,h]=a.splitText(u):[g,d,h]=a.splitText(l,u),c.replace?{nodeAfter:h,nodeBefore:g,transformedNode:c.replace(d,f)||void 0}:null})(n,s.startIndex,s.endIndex,s.transformer,s.match);if(!i)return;mn(i.nodeAfter)&&yn(i.nodeAfter,e,t),mn(i.nodeBefore)&&yn(i.nodeBefore,e,t),mn(i.transformedNode)&&yn(i.transformedNode,e,t)}const o=n.getTextContent().replace(/\\([*_`~\\])/g,"$1").replace(/&#(\d+);/g,(i,a)=>String.fromCodePoint(a));n.setTextContent(o)}function sx(n,e=!1){const t=za(n),r=(function(s){const o={},i={},a=[],l="(?<![\\\\])";for(const u of s){const{tag:c}=u;o[c]=u;const f=c.replace(/(\*|\^|\+)/g,"\\$1");a.push(f),c.length===1?i[c]=c==="`"?new RegExp("(?<![\\\\`])(`)((?:\\\\`|[^`])+?)(`)(?!`)"):new RegExp(`(?<![\\\\${f}])(${f})((\\\\${f})?.*?[^${f}\\s](\\\\${f})?)((?<!\\\\)|(?<=\\\\\\\\))(${f})(?![\\\\${f}])`):i[c]=new RegExp(`(?<!\\\\)(${f})((\\\\${f})?.*?[^\\s](\\\\${f})?)((?<!\\\\)|(?<=\\\\\\\\))(${f})(?!\\\\)`)}return{fullMatchRegExpByTag:i,openTagsRegExp:new RegExp(`${l}(${a.join("|")})`,"g"),transformersByTag:o}})(t.textFormat);return(s,o)=>{const i=s.split(`
21
+ `),a=i.length,l=o||ke();l.clear();for(let c=0;c<a;c++){const f=i[c],[d,h]=ox(i,c,t.multilineElement,l);d?c=h:ix(f,l,t.element,r,t.textMatch,e)}const u=l.getChildren();for(const c of u)!e&&Li(c)&&l.getChildrenSize()>1&&c.remove();U()!==null&&l.selectStart()}}function ox(n,e,t,r){for(const s of t){const{handleImportAfterStartMatch:o,regExpEnd:i,regExpStart:a,replace:l}=s,u=n[e].match(a);if(!u)continue;if(o){const g=o({lines:n,rootNode:r,startLineIndex:e,startMatch:u,transformer:s});if(g===null)continue;if(g)return g}const c=typeof i=="object"&&"regExp"in i?i.regExp:i,f=i&&typeof i=="object"&&"optional"in i?i.optional:!i;let d=e;const h=n.length;for(;d<h;){const g=c?n[d].match(c):null;if(!g&&(!f||f&&d<h-1)){d++;continue}if(g&&e===d&&g.index===u.index){d++;continue}const m=[];if(g&&e===d)m.push(n[e].slice(u[0].length,-g[0].length));else for(let y=e;y<=d;y++)if(y===e){const x=n[y].slice(u[0].length);m.push(x)}else if(y===d&&g){const x=n[y].slice(0,-g[0].length);m.push(x)}else m.push(n[y]);if(l(r,null,u,g,m,!0)!==!1)return[!0,d];break}}return[!1,e]}function ix(n,e,t,r,s,o){const i=we(n),a=Te();a.append(i),e.append(a);for(const{regExp:l,replace:u}of t){const c=n.match(l);if(c&&(i.setTextContent(n.slice(c[0].length)),u(a,[i],c,!0)!==!1))break}if(yn(i,r,s),a.isAttached()&&n.length>0){const l=a.getPreviousSibling();if(!o&&(Kr(l)||Ni(l)||se(l))){let u=l;if(se(l)){const c=l.getLastDescendant();u=c==null?null:Qe(c,fe)}u!=null&&u.getTextContentSize()>0&&(u.splice(u.getChildrenSize(),0,[xt(),...a.getChildren()]),a.remove())}}}function ax(n,...e){const t=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",n);for(const s of e)r.append("v",s);throw t.search=r.toString(),Error(`Minified Lexical error #${n}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}const Jg=/^(\s*)(\d{1,})\.\s/,Gg=/^(\s*)[-*+]\s/,lx=/^(\s*)(?:[-*+]\s)?\s?(\[(\s|x)?\])\s/i,Di=/^(#{1,6})\s/,Yg=/^>\s/,Zg=/^[ \t]*```([\w-]+)?/,ji=/[ \t]*```$/,cx=/^[ \t]*```[^`]+(?:(?:`{1,2}|`{4,})[^`]+)*```(?:[^`]|$)/,ux=/^(?:\|)(.+)(?:\|)\s?$/,dx=/^(\| ?:?-*:? ?)+\|\s?$/,eu=/^<[a-z_][\w-]*(?:\s[^<>]*)?\/?>/i,tu=/^<\/[a-z_][\w-]*\s*>/i,nu=n=>new RegExp(`(?:${n.source})$`,n.flags),Cr=Wm("mdListMarker",{parse:n=>typeof n=="string"&&/^[-*+]$/.test(n)?n:"-"}),Xg=n=>(e,t,r,s)=>{const o=n(r);o.append(...t),e.replace(o),s||o.select(0,0)},Qg=n=>(e,t,r,s)=>{const o=e.getPreviousSibling(),i=e.getNextSibling(),a=ct(n==="check"?r[3]==="x":void 0),l=r[0].trim()[0],u=n!=="bullet"&&n!=="check"||l!==Cr.parse(l)?void 0:l;if(se(i)&&i.getListType()===n){u&&Co(i,Cr,u);const f=i.getFirstChild();f!==null?f.insertBefore(a):i.append(a),e.remove()}else if(se(o)&&o.getListType()===n)u&&Co(o,Cr,u),o.append(a),e.remove();else{const f=rt(n,n==="number"?Number(r[2]):void 0);u&&Co(f,Cr,u),f.append(a),e.replace(f)}a.append(...t),s||a.select(0,0);const c=(function(f){const d=f.match(/\t/g),h=f.match(/ /g);let g=0;return d&&(g+=d.length),h&&(g+=Math.floor(h.length/4)),g})(r[1]);c&&a.setIndent(c)},Ua=(n,e,t)=>{const r=[],s=n.getChildren();let o=0;for(const i of s)if(fe(i)){if(i.getChildrenSize()===1){const f=i.getFirstChild();if(se(f)){r.push(Ua(f,e,t+1));continue}}const a=" ".repeat(4*t),l=n.getListType(),u=Hd(n,Cr),c=l==="number"?`${n.getStart()+o}. `:l==="check"?`${u} [${i.getChecked()?"x":" "}] `:u+" ";r.push(a+c+e(i)),o++}return r.join(`
22
+ `)},fx={dependencies:[ho],export:(n,e)=>{if(!rv(n))return null;const t=Number(n.getTag().slice(1));return"#".repeat(t)+" "+e(n)},regExp:Di,replace:Xg(n=>{const e="h"+n[1].length;return Xn(e)}),type:"element"},gx={dependencies:[po],export:(n,e)=>{if(!Ni(n))return null;const t=e(n).split(`
23
+ `),r=[];for(const s of t)r.push("> "+s);return r.join(`
24
+ `)},regExp:Yg,replace:(n,e,t,r)=>{if(r){const o=n.getPreviousSibling();if(Ni(o))return o.splice(o.getChildrenSize(),0,[xt(),...e]),void n.remove()}const s=$a();s.append(...e),n.replace(s),r||s.select(0,0)},type:"element"},px={dependencies:[mo],export:n=>{if(!ja(n))return null;const e=n.getTextContent();return"```"+(n.getLanguage()||"")+(e?`
25
+ `+e:"")+"\n```"},regExpEnd:{optional:!0,regExp:ji},regExpStart:Zg,replace:(n,e,t,r,s,o)=>{let i,a;if(!e&&s){if(s.length===1)r?(i=Jt(),a=t[1]+s[0]):(i=Jt(t[1]),a=s[0].startsWith(" ")?s[0].slice(1):s[0]);else{if(i=Jt(t[1]),s[0].trim().length===0)for(;s.length>0&&!s[0].length;)s.shift();else s[0]=s[0].startsWith(" ")?s[0].slice(1):s[0];for(;s.length>0&&!s[s.length-1].length;)s.pop();a=s.join(`
26
+ `)}const l=we(a);i.append(l),n.append(i)}else e&&Xg(l=>Jt(l?l[1]:void 0))(n,e,t,o)},type:"multiline-element"},hx={dependencies:[zn,dn],export:(n,e)=>se(n)?Ua(n,e,0):null,regExp:Gg,replace:Qg("bullet"),type:"element"},mx={dependencies:[zn,dn],export:(n,e)=>se(n)?Ua(n,e,0):null,regExp:Jg,replace:Qg("number"),type:"element"},yx={format:["code"],tag:"`",type:"text-format"},_x={format:["highlight"],tag:"==",type:"text-format"},vx={format:["bold","italic"],tag:"***",type:"text-format"},xx={format:["bold","italic"],intraword:!1,tag:"___",type:"text-format"},bx={format:["bold"],tag:"**",type:"text-format"},Sx={format:["bold"],intraword:!1,tag:"__",type:"text-format"},Cx={format:["strikethrough"],tag:"~~",type:"text-format"},Ex={format:["italic"],tag:"*",type:"text-format"},Tx={format:["italic"],intraword:!1,tag:"_",type:"text-format"},Ka={dependencies:[fn],export:(n,e,t)=>{if(!kt(n)||At(n))return null;const r=n.getTitle(),s=e(n);return r?`[${s}](${n.getURL()} "${r}")`:`[${s}](${n.getURL()})`},importRegExp:/(?:\[(.+?)\])(?:\((?:([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?)\))/,regExp:/(?:\[(.+?)\])(?:\((?:([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?)\))$/,replace:(n,e)=>{const[,t,r,s]=e,o=Sn(r,{title:s}),i=t.split("[").length-1,a=t.split("]").length-1;let l=t,u="";if(i<a)return;if(i>a){const f=t.split("[");u="["+f[0],l=f.slice(1).join("[")}const c=we(l);return c.setFormat(n.getFormat()),o.append(c),n.replace(o),u&&o.insertBefore(we(u)),c},trigger:")",type:"text-match"},wx=[fx,gx,hx,mx],kx=[px],Nx=[yx,vx,xx,bx,Sx,_x,Ex,Tx,Cx],Ax=[Ka],Jr=[...wx,...kx,...Nx,...Ax];function ru(n,e,t){const r=t.length;for(let s=e;s>=r;s--){const o=s-r;if(ep(n,o,t,0,r)&&n[o+r]!==" ")return o}return-1}function ep(n,e,t,r,s){for(let o=0;o<s;o++)if(n[e+o]!==t[r+o])return!1;return!0}function Px(n,e=Jr){const t=za(e),r=$i(t.textFormat,({tag:i})=>i[i.length-1]),s=$i(t.textMatch,({trigger:i})=>i);for(const i of e){const a=i.type;if(a==="element"||a==="text-match"||a==="multiline-element"){const l=i.dependencies;for(const u of l)n.hasNode(u)||ax(173,u.getType())}}const o=(i,a,l)=>{(function(u,c,f,d){const h=u.getParent();if(!qe(h)||u.getFirstChild()!==c)return!1;const g=c.getTextContent();if(g[f-1]!==" ")return!1;for(const{regExp:m,replace:y}of d){const x=g.match(m);if(x&&x[0].length===(x[0].endsWith(" ")?f:f-1)){const p=c.getNextSiblings(),[_,C]=c.splitText(f);if(y(u,C?[C,...p]:p,x,!1)!==!1)return _.remove(),!0}}return!1})(i,a,l,t.element)||(function(u,c,f,d){const h=u.getParent();if(!qe(h)||u.getFirstChild()!==c)return!1;const g=c.getTextContent();if(g[f-1]!==" ")return!1;for(const{regExpStart:m,replace:y,regExpEnd:x}of d){if(x&&!("optional"in x)||x&&"optional"in x&&!x.optional)continue;const p=g.match(m);if(p&&p[0].length===(p[0].endsWith(" ")?f:f-1)){const _=c.getNextSiblings(),[C,v]=c.splitText(f);if(y(u,v?[v,..._]:_,p,null,null,!1)!==!1)return C.remove(),!0}}return!1})(i,a,l,t.multilineElement)||(function(u,c,f){let d=u.getTextContent();const h=f[d[c-1]];if(h==null)return!1;c<d.length&&(d=d.slice(0,c));for(const g of h){if(!g.replace||!g.regExp)continue;const m=d.match(g.regExp);if(m===null)continue;const y=m.index||0,x=y+m[0].length;let p;return y===0?[p]=u.splitText(x):[,p]=u.splitText(y,x),p.selectNext(0,0),g.replace(p,m),!0}return!1})(a,l,s)||(function(u,c,f){const d=u.getTextContent(),h=c-1,g=d[h],m=f[g];if(!m)return!1;for(const y of m){const{tag:x}=y,p=x.length,_=h-p+1;if(p>1&&!ep(d,_,x,0,p)||d[_-1]===" ")continue;const C=d[h+1];if(y.intraword===!1&&C&&!Us.test(C))continue;const v=u;let b=v,S=ru(d,_,x),T=b;for(;S<0&&(T=T.getPreviousSibling())&&!It(T);)if(z(T)){if(T.hasFormat("code"))continue;const F=T.getTextContent();b=T,S=ru(F,F.length,x)}if(S<0||b===v&&S+p===_)continue;const E=b.getTextContent();if(S>0&&E[S-1]===g)continue;const N=E[S-1];if(y.intraword===!1&&N&&!Us.test(N))continue;const P=v.getTextContent(),M=P.slice(0,_)+P.slice(h+1);v.setTextContent(M);const R=b===v?M:E;b.setTextContent(R.slice(0,S)+R.slice(S+p));const I=U(),D=no();Ke(D);const L=h-p*(b===v?2:1)+1;D.anchor.set(b.__key,S,"text"),D.focus.set(v.__key,L,"text");for(const F of y.format)D.hasFormat(F)||D.formatText(F);D.anchor.set(D.focus.key,D.focus.offset,D.focus.type);for(const F of y.format)D.hasFormat(F)&&D.toggleFormat(F);return O(I)&&(D.format=I.format),!0}})(a,l,r)};return n.registerUpdateListener(({tags:i,dirtyLeaves:a,editorState:l,prevEditorState:u})=>{if(i.has(Tf)||i.has(dy)||n.isComposing())return;const c=l.read(U),f=u.read(U);if(!O(f)||!O(c)||!c.isCollapsed()||c.is(f))return;const d=c.anchor.key,h=c.anchor.offset,g=l._nodeMap.get(d);!z(g)||!a.has(d)||h!==1&&h>f.anchor.offset+1||n.update(()=>{if(!mn(g))return;const m=g.getParent();m===null||ja(m)||o(m,g,c.anchor.offset)})})}function Ix(n,e=Jr,t,r=!1,s=!1){const o=r?n:(function(i,a=!1){const l=i.split(`
27
+ `);let u=!1;const c=[];for(let f=0;f<l.length;f++){const d=l[f].trimEnd(),h=c[c.length-1];cx.test(d)?c.push(d):Zg.test(d)||ji.test(d)?(u=!u,c.push(d)):u||d===""||h===""||!h||Di.test(h)||Di.test(d)||Yg.test(d)||Jg.test(d)||Gg.test(d)||lx.test(d)||ux.test(d)||dx.test(d)||!a||eu.test(d)||tu.test(d)||nu(tu).test(h)||nu(eu).test(h)||ji.test(h)?c.push(d):c[c.length-1]=h+" "+d.trimStart()}return c.join(`
28
+ `)})(n,s);return sx(e,r)(o,t)}function Rx(n=Jr,e,t=!1){return(function(s,o=!1){const i=za(s),a=[...i.multilineElement,...i.element],l=!o,u=i.textFormat.filter(c=>c.format.length===1).sort((c,f)=>Number(c.format.includes("code"))-Number(f.format.includes("code")));return c=>{const f=[],d=(c||ke()).getChildren();for(let h=0;h<d.length;h++){const g=d[h],m=nx(g,a,u,i.textMatch);m!=null&&f.push(l&&h>0&&!Li(g)&&!Li(d[h-1])?`
29
+ `.concat(m):m)}return f.join(`
30
+ `)}})(n,t)(e)}function su(n,e){return n.getEditorState().read(()=>{const t=Oe(e);return t!==null&&t.isSelected()})}function Ox(n){const[e]=Je(),[t,r]=w.useState(()=>su(e,n));return w.useEffect(()=>{let s=!0;const o=e.registerUpdateListener(()=>{s&&r(su(e,n))});return()=>{s=!1,o()}},[e,n]),[t,w.useCallback(s=>{e.update(()=>{let o=U();Me(o)||(o=fa(),Ke(o)),Me(o)&&(s?o.add(n):o.delete(n))})},[e,n]),w.useCallback(()=>{e.update(()=>{const s=U();Me(s)&&s.clear()})},[e])]}function Fx({nodeKey:n}){const[e]=Je(),[t,r,s]=Ox(n);return w.useEffect(()=>pt(e.registerCommand(ra,o=>{const i=e.getElementByKey(n);return o.target===i&&(o.shiftKey||s(),r(!t),!0)},Xe)),[s,e,t,n,r]),w.useEffect(()=>{const o=e.getElementByKey(n),i=e._config.theme.hrSelected??"selected";o!==null&&(t?bt(o,i):go(o,i))},[e,t,n]),null}class Gr extends qr{static getType(){return"horizontalrule"}static clone(e){return new Gr(e.__key)}static importJSON(e){return yo().updateFromJSON(e)}static importDOM(){return{hr:()=>({conversion:Mx,priority:0})}}decorate(){return k.jsx(Fx,{nodeKey:this.__key})}}function Mx(){return{node:yo()}}function yo(){return mt(new Gr)}const $x=[{dependencies:[Gr],export:n=>F_(n)?"***":null,regExp:/^(---|\*\*\*|___)\s?$/,replace:(n,e,t,r)=>{const s=yo();r||n.getNextSibling()!=null?n.replace(s):n.insertBefore(s),s.selectNext()},type:"element"},...Jr];function Lx({transformers:n=$x}){const[e]=Je();return w.useEffect(()=>Px(e,n),[e,n]),null}function Dx({hasStrictIndent:n=!1}){const[e]=Je();return w.useEffect(()=>{if(!e.hasNodes([zn,dn]))throw new Error("ListPlugin: ListNode and/or ListItemNode not registered on editor")},[e]),w.useEffect(()=>{if(n)return Ov(e)},[e,n]),(function(t){w.useEffect(()=>Rv(t),[t])})(e),null}var jx="uf0wxx0",Bx="uf0wxx1",zx="uf0wxx2";function Ux(n,e,t){w.useEffect(()=>{n.hasNodes([hr])||(function(r,...s){const o=new URL("https://lexical.dev/docs/error"),i=new URLSearchParams;i.append("code",r);for(const a of s)i.append("v",a);throw o.search=i.toString(),Error(`Minified Lexical error #${r}; visit ${o.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)})(77)}),w.useEffect(()=>ex(n,{changeHandlers:t?[t]:[],matchers:e}),[n,e,t])}function Kx({matchers:n,onChange:e}){const[t]=Je();return Ux(t,n,e),null}function Wx(){const[n]=Je();return w.useEffect(()=>kv(n),[n]),null}function Vx({newTab:n=!0,disabled:e=!1}){const[t]=Je();return w.useEffect(()=>Jv(t,bg({disabled:e,newTab:n})),[t,n,e]),null}function Hx(){const[n]=Je();return w.useEffect(()=>n.registerCommand(R_,e=>{const t=U();if(!O(t))return!1;if(t.focus.getNode()!==null){const r=yo();y_(r)}return!0},ge),[n]),null}function qx({validateUrl:n,attributes:e}){const[t]=Je();return w.useEffect(()=>{if(!t.hasNodes([fn]))throw new Error("LinkPlugin: LinkNode not registered on editor")}),w.useEffect(()=>qv(t,bg({attributes:e,validateUrl:n})),[t,n,e]),null}function Jx({maxIndent:n}){const[e]=Je();return w.useEffect(()=>M_(e,n),[e,n]),null}const Gx=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?w.useLayoutEffect:w.useEffect;function Yx({ignoreHistoryMergeTagChange:n=!0,ignoreSelectionChange:e=!1,onChange:t}){const[r]=Je();return Gx(()=>{if(t)return r.registerUpdateListener(({editorState:s,dirtyElements:o,dirtyLeaves:i,prevEditorState:a,tags:l})=>{e&&o.size===0&&i.size===0||n&&l.has(nr)||a.isEmpty()||t(s,r,l)})},[r,n,e,t]),null}const Zx=new RegExp(/((([A-Za-z]{3,9}:(?:\/\/)?)(?:[-;:&=+$,\w]+@)?[A-Za-z0-9.-]+|(?:www.|[-;:&=+$,\w]+@)[A-Za-z0-9.-]+)((?:\/[+~%/.\w-_]*)?\??(?:[-+=&;%@.\w_]*)#?(?:[\w]*))?)/);function Xx(n){return n==="https://"||Zx.test(n)}function Qx(n){const e=De.c(4),{hasLinkAttributes:t}=n,r=t===void 0?!1:t;let s;e[0]!==r?(s=r?{rel:"noopener noreferrer",target:"_blank"}:void 0,e[0]=r,e[1]=s):s=e[1];let o;return e[2]!==s?(o=k.jsx(qx,{validateUrl:Xx,attributes:s}),e[2]=s,e[3]=o):o=e[3],o}const eb=new RegExp("((https?:\\/\\/(www\\.)?)|(www\\.))[-a-zA-Z0-9@:%._+~#=]{1,256}\\.[a-zA-Z0-9()]{1,6}\\b([-a-zA-Z0-9()@:%_+.~#?&//=]*)(?<![-.+():%])"),tb=/(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))/,nb=[Zc(eb,n=>n.startsWith("http")?n:`https://${n}`),Zc(tb,n=>`mailto:${n}`)];function rb(){const n=De.c(1);let e;return n[0]===Symbol.for("react.memo_cache_sentinel")?(e=k.jsx(Kx,{matchers:nb}),n[0]=e):e=n[0],e}const sb={...Ka,regExp:/(?:\[(.+?)\])(?:\((?:([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?)\))/},Wa=Jr.map(n=>n===Ka?sb:n),ob={paragraph:"editor-paragraph",heading:{h1:"editor-heading-h1",h2:"editor-heading-h2",h3:"editor-heading-h3",h4:"editor-heading-h4",h5:"editor-heading-h5",h6:"editor-heading-h6"},text:{bold:"editor-text-bold",italic:"editor-text-italic",underline:"editor-text-underline",strikethrough:"editor-text-strikethrough",code:"editor-text-code"},list:{ul:"editor-list-ul",ol:"editor-list-ol",listitem:"editor-listitem",nested:{listitem:"editor-nested-listitem"}},quote:"editor-quote",code:"editor-code",codeHighlight:{},link:"editor-link",horizontalRule:"editor-hr"},ib=[ho,po,zn,dn,mo,Ba,fn,hr,Gr];function ab(n){const e=De.c(2),{text:t}=n;let r;return e[0]!==t?(r=k.jsx("div",{className:zx,children:t}),e[0]=t,e[1]=r):r=e[1],r}function lb(n){const e=De.c(4),{value:t}=n,[r]=Je();let s;e[0]!==r||e[1]!==t?(s=()=>{t!==void 0&&r.update(()=>{Ix(t,Wa)})},e[0]=r,e[1]=t,e[2]=s):s=e[2];let o;return e[3]===Symbol.for("react.memo_cache_sentinel")?(o=[],e[3]=o):o=e[3],w.useEffect(s,o),null}function cb(n){const e=De.c(4),{onChange:t}=n;let r;e[0]!==t?(r=i=>{t&&i.read(()=>{const a=Rx(Wa);t(a)})},e[0]=t,e[1]=r):r=e[1];const s=r;let o;return e[2]!==s?(o=k.jsx(Yx,{onChange:s}),e[2]=s,e[3]=o):o=e[3],o}function ub(n){const e=De.c(20),{placeholder:t,value:r,onChange:s}=n,o=t===void 0?"Write your content here...":t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i={namespace:"MarkdownEditor",theme:ob,nodes:ib,onError:db},e[0]=i):i=e[0];const a=i;let l;e[1]===Symbol.for("react.memo_cache_sentinel")?(l=k.jsx(fv,{className:Bx}),e[1]=l):l=e[1];let u;e[2]!==o?(u=k.jsx(lv,{contentEditable:l,placeholder:k.jsx(ab,{text:o}),ErrorBoundary:_v}),e[2]=o,e[3]=u):u=e[3];let c,f,d,h,g,m,y,x;e[4]===Symbol.for("react.memo_cache_sentinel")?(h=k.jsx(Lx,{transformers:Wa}),g=k.jsx(Dx,{}),m=k.jsx(Wx,{}),y=k.jsx(Jx,{}),x=k.jsx(Vx,{}),c=k.jsx(Hx,{}),f=k.jsx(Qx,{}),d=k.jsx(rb,{}),e[4]=c,e[5]=f,e[6]=d,e[7]=h,e[8]=g,e[9]=m,e[10]=y,e[11]=x):(c=e[4],f=e[5],d=e[6],h=e[7],g=e[8],m=e[9],y=e[10],x=e[11]);let p;e[12]!==r?(p=k.jsx(lb,{value:r}),e[12]=r,e[13]=p):p=e[13];let _;e[14]!==s?(_=k.jsx(cb,{onChange:s}),e[14]=s,e[15]=_):_=e[15];let C;return e[16]!==p||e[17]!==_||e[18]!==u?(C=k.jsx("div",{className:jx,children:k.jsxs(o_,{initialConfig:a,children:[u,h,g,m,y,x,c,f,d,p,_]})}),e[16]=p,e[17]=_,e[18]=u,e[19]=C):C=e[19],C}function db(n){console.error("Lexical error:",n)}const fb=n=>{const e=De.c(4);let t,r;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=k.jsx("title",{children:"Markdown"}),r=k.jsx("path",{fill:"currentColor",d:"M22.27 19.385H1.73A1.73 1.73 0 010 17.655V6.345a1.73 1.73 0 011.73-1.73h20.54A1.73 1.73 0 0124 6.345v11.308a1.73 1.73 0 01-1.73 1.731zM5.769 15.923v-4.5l2.308 2.885 2.307-2.885v4.5h2.308V8.078h-2.308l-2.307 2.885-2.308-2.885H3.46v7.847zM21.232 12h-2.309V8.077h-2.307V12h-2.308l3.461 4.039z"}),e[0]=t,e[1]=r):(t=e[0],r=e[1]);let s;return e[2]!==n?(s=k.jsxs("svg",{role:"img",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",...n,children:[t,r]}),e[2]=n,e[3]=s):s=e[3],s},gb=n=>{const e=De.c(7),t=!!(n&&n.length>0);let r,s;e[0]!==n?(r=["provider-models",n],s=async()=>{if(!n)return[];const a=await(await Ji.v1.providers[":providerId"].models.$get({param:{providerId:n}})).json();return"data"in a&&a.data?a.data:[]},e[0]=n,e[1]=r,e[2]=s):(r=e[1],s=e[2]);let o;return e[3]!==t||e[4]!==r||e[5]!==s?(o={queryKey:r,queryFn:s,enabled:t,staleTime:3e5},e[3]=t,e[4]=r,e[5]=s,e[6]=o):o=e[6],wp(o)};var pb="_1nagll30",tp="_1nagll31",ou="_1nagll32",hb="_1nagll33",mb="_1nagll34",Vo="_1nagll35",Ho="_1nagll36",yb="_1nagll37",_b="_1nagll38",vb="_1nagll39",xb="_1nagll3d",np="_1nagll3e",iu="_1nagll3f",au="_1nagll3g",bb="_1nagll3h",Sb="_1nagll3i",qo="_1nagll3k",lu="_1nagll3l",Cb="_1nagll3o",Eb="_1nagll3p",Tb="_1nagll3q",Va="_1nagll3r";const cu=window.bootstrapData?.llmProviders?.map(n=>({label:n.name,icon:n.imageURI,value:n.key}));function wb(n){const e=De.c(2),{className:t}=n;let r;return e[0]!==t?(r=k.jsx(Od,{className:t}),e[0]=t,e[1]=r):r=e[1],r}function kb(n,e){const t=n.split("/");return t.length>1&&t[0].length>0?t[0].charAt(0).toUpperCase()+t[0].slice(1):"Other"}function rp(n){const e=n.split("/");return e.length>1&&e[0].length>0?e[0]:null}function Bi(n){return`https://models.dev/logos/${n}.svg`}function Nb(n){const e=De.c(47),{models:t,isLoading:r,selectedModelName:s,onSelect:o}=n;let i,a,l,u,c,f,d,h,g,m,y,x,p,_;if(e[0]!==r||e[1]!==t||e[2]!==o||e[3]!==s){const T=t?.reduce(Ab,{}),E=T?Object.keys(T).sort():[];let N;e[18]!==t||e[19]!==s?(N=t?.find(D=>D.id===s),e[18]=t,e[19]=s,e[20]=N):N=e[20];const M=N?.name||s||"Select a model";u=xd,_=!1;let R;e[21]!==M?(R=k.jsx("span",{className:qo,children:M}),e[21]=M,e[22]=R):R=e[22];let I;e[23]===Symbol.for("react.memo_cache_sentinel")?(I=k.jsx(Od,{className:lu}),e[23]=I):I=e[23],e[24]!==R?(f=k.jsxs(_h,{className:np,children:[R,I]}),e[24]=R,e[25]=f):f=e[25],l=Xa,a=Qa,h=iu,g="bottom",m=4,y="start",x="fixed",p=!0,i=Za,c=au,d=r?k.jsx("div",{className:Eb,children:"Loading models..."}):E.length===0?k.jsx("div",{className:Cb,children:"No models available"}):E.map(D=>{const L=T?.[D],F=L?.providerId,j=L?.models;return k.jsxs(ph,{children:[k.jsxs(bh,{className:Sb,openOnHover:!0,delay:100,children:[F&&k.jsx("img",{src:Bi(F),alt:"",className:Va}),k.jsx("span",{className:qo,children:D}),k.jsx(Xp,{className:lu})]}),k.jsx(Xa,{children:k.jsx(Qa,{className:iu,side:"right",sideOffset:4,align:"start",positionMethod:"fixed",sticky:!0,children:k.jsx(Za,{className:au,children:j?.map(B=>{const G=s===B.id;return k.jsxs(ah,{className:bb,onClick:()=>o(B.id),children:[k.jsx("span",{className:qo,children:B.name.split(":")[1]||B.id}),G&&k.jsx(cd,{className:Tb})]},B.id)})})})})]},D)}),e[0]=r,e[1]=t,e[2]=o,e[3]=s,e[4]=i,e[5]=a,e[6]=l,e[7]=u,e[8]=c,e[9]=f,e[10]=d,e[11]=h,e[12]=g,e[13]=m,e[14]=y,e[15]=x,e[16]=p,e[17]=_}else i=e[4],a=e[5],l=e[6],u=e[7],c=e[8],f=e[9],d=e[10],h=e[11],g=e[12],m=e[13],y=e[14],x=e[15],p=e[16],_=e[17];let C;e[26]!==i||e[27]!==c||e[28]!==d?(C=k.jsx(i,{className:c,children:d}),e[26]=i,e[27]=c,e[28]=d,e[29]=C):C=e[29];let v;e[30]!==a||e[31]!==C||e[32]!==h||e[33]!==g||e[34]!==m||e[35]!==y||e[36]!==x||e[37]!==p?(v=k.jsx(a,{className:h,side:g,sideOffset:m,align:y,positionMethod:x,sticky:p,children:C}),e[30]=a,e[31]=C,e[32]=h,e[33]=g,e[34]=m,e[35]=y,e[36]=x,e[37]=p,e[38]=v):v=e[38];let b;e[39]!==l||e[40]!==v?(b=k.jsx(l,{children:v}),e[39]=l,e[40]=v,e[41]=b):b=e[41];let S;return e[42]!==u||e[43]!==f||e[44]!==b||e[45]!==_?(S=k.jsxs(u,{modal:_,children:[f,b]}),e[42]=u,e[43]=f,e[44]=b,e[45]=_,e[46]=S):S=e[46],S}function Ab(n,e){const t=kb(e.id),r=rp(e.id);return n[t]||(n[t]={models:[],providerId:r}),n[t].models.push(e),n}function Pb(n){const e=De.c(76),{value:t,onChange:r}=n,{data:s,isLoading:o}=gb(t.provider);let i;e[0]!==t.provider?(i=cu?.find(J=>J.value===t.provider)||null,e[0]=t.provider,e[1]=i):i=e[1];const a=i,l=t.modelName?t.modelName:(t.provider,"Select model");let u;e[2]!==r||e[3]!==t?(u=J=>{J&&r({...t,provider:J.value,modelName:""})},e[2]=r,e[3]=t,e[4]=u):u=e[4];const c=u;let f;e[5]!==r||e[6]!==t?(f=J=>{r({...t,modelName:J})},e[5]=r,e[6]=t,e[7]=f):f=e[7];const d=f;let h;e[8]!==r||e[9]!==t?(h=(J,ue)=>{r({...t,[J]:ue})},e[8]=r,e[9]=t,e[10]=h):h=e[10];const g=h;let m;if(e[11]!==t.modelName||e[12]!==t.provider){const J=rp(t.modelName);m=J?Bi(J):t.provider?Bi(t.provider):null,e[11]=t.modelName,e[12]=t.provider,e[13]=m}else m=e[13];const y=m;let x;e[14]!==y?(x=y?k.jsx("img",{src:y,alt:"",className:Va}):k.jsx("span",{className:tp,children:"?"}),e[14]=y,e[15]=x):x=e[15];const p=t.modelName?ou:`${ou} ${hb}`;let _;e[16]!==l||e[17]!==p?(_=k.jsx("span",{className:p,children:l}),e[16]=l,e[17]=p,e[18]=_):_=e[18];let C;e[19]===Symbol.for("react.memo_cache_sentinel")?(C=k.jsx(wb,{className:xb}),e[19]=C):C=e[19];let v;e[20]!==x||e[21]!==_?(v=k.jsxs(Md,{className:pb,children:[x,_,C]}),e[20]=x,e[21]=_,e[22]=v):v=e[22];let b;e[23]===Symbol.for("react.memo_cache_sentinel")?(b=k.jsx("span",{className:Ho,children:"Provider"}),e[23]=b):b=e[23];let S;e[24]===Symbol.for("react.memo_cache_sentinel")?(S=cu||[],e[24]=S):S=e[24];let T;e[25]!==c||e[26]!==a?(T=k.jsxs("div",{className:Vo,children:[b,k.jsx(Gi,{items:S,value:a,onValueChange:c,itemToString:$b,itemToIcon:Mb,placeholder:"Select provider"})]}),e[25]=c,e[26]=a,e[27]=T):T=e[27];let E;e[28]===Symbol.for("react.memo_cache_sentinel")?(E=k.jsx("span",{className:Ho,children:"Model"}),e[28]=E):E=e[28];let N;e[29]!==d||e[30]!==o||e[31]!==s||e[32]!==t.modelName||e[33]!==t.provider?(N=k.jsxs("div",{className:Vo,children:[E,t.provider?k.jsx(Nb,{models:s,isLoading:o,selectedModelName:t.modelName,onSelect:d}):k.jsx("div",{className:np,style:{color:"var(--gray9)"},children:"Select a provider first"})]}),e[29]=d,e[30]=o,e[31]=s,e[32]=t.modelName,e[33]=t.provider,e[34]=N):N=e[34];let P;e[35]===Symbol.for("react.memo_cache_sentinel")?(P=k.jsx("span",{className:Ho,children:"Parameters"}),e[35]=P):P=e[35];const M=t.temperature??1;let R;e[36]!==g?(R=J=>g("temperature",J),e[36]=g,e[37]=R):R=e[37];let I;e[38]!==M||e[39]!==R?(I=k.jsx(ts,{label:"Temperature",value:M,min:0,max:2,step:.1,onValueChange:R,formatValue:Fb}),e[38]=M,e[39]=R,e[40]=I):I=e[40];let D;e[41]===Symbol.for("react.memo_cache_sentinel")?(D=k.jsx("label",{className:vb,children:"Max Tokens"}),e[41]=D):D=e[41];const L=t.maxTokens??"";let F;e[42]!==r||e[43]!==t?(F=J=>{const ue=J.target.value?parseInt(J.target.value,10):void 0;r({...t,maxTokens:ue})},e[42]=r,e[43]=t,e[44]=F):F=e[44];let j;e[45]!==L||e[46]!==F?(j=k.jsxs("div",{className:_b,children:[D,k.jsx("input",{type:"number",className:Gu,value:L,placeholder:"Default",min:1,onChange:F})]}),e[45]=L,e[46]=F,e[47]=j):j=e[47];const B=t.topP??1;let G;e[48]!==g?(G=J=>g("topP",J),e[48]=g,e[49]=G):G=e[49];let Y;e[50]!==B||e[51]!==G?(Y=k.jsx(ts,{label:"Top P",value:B,min:0,max:1,step:.05,onValueChange:G,formatValue:Ob}),e[50]=B,e[51]=G,e[52]=Y):Y=e[52];const K=t.frequencyPenalty??0;let W;e[53]!==g?(W=J=>g("frequencyPenalty",J),e[53]=g,e[54]=W):W=e[54];let V;e[55]!==K||e[56]!==W?(V=k.jsx(ts,{label:"Frequency Penalty",value:K,min:-2,max:2,step:.1,onValueChange:W,formatValue:Rb}),e[55]=K,e[56]=W,e[57]=V):V=e[57];const oe=t.presencePenalty??0;let re;e[58]!==g?(re=J=>g("presencePenalty",J),e[58]=g,e[59]=re):re=e[59];let le;e[60]!==oe||e[61]!==re?(le=k.jsx(ts,{label:"Presence Penalty",value:oe,min:-2,max:2,step:.1,onValueChange:re,formatValue:Ib}),e[60]=oe,e[61]=re,e[62]=le):le=e[62];let ee;e[63]!==I||e[64]!==j||e[65]!==Y||e[66]!==V||e[67]!==le?(ee=k.jsxs("div",{className:Vo,children:[P,k.jsxs("div",{className:yb,children:[I,j,Y,V,le]})]}),e[63]=I,e[64]=j,e[65]=Y,e[66]=V,e[67]=le,e[68]=ee):ee=e[68];let ne;e[69]!==T||e[70]!==N||e[71]!==ee?(ne=k.jsx($d,{side:"bottom",align:"start",sideOffset:4,positionMethod:"fixed",children:k.jsxs("div",{className:mb,children:[T,N,ee]})}),e[69]=T,e[70]=N,e[71]=ee,e[72]=ne):ne=e[72];let ie;return e[73]!==v||e[74]!==ne?(ie=k.jsxs(Fd,{children:[v,ne]}),e[73]=v,e[74]=ne,e[75]=ie):ie=e[75],ie}function Ib(n){return n.toFixed(1)}function Rb(n){return n.toFixed(1)}function Ob(n){return n.toFixed(2)}function Fb(n){return n.toFixed(1)}function Mb(n){return n?.icon?k.jsx("img",{src:n.icon,alt:"",className:Va}):k.jsx("span",{className:tp,children:n?.label?.charAt(0).toUpperCase()||"?"})}function $b(n){return n?.label||""}const Lb=n=>{const e=De.c(48),{form:t,editorKey:r}=n,{setValue:s,control:o}=t;let i;e[0]!==t.control?(i={control:t.control,name:"provider"},e[0]=t.control,e[1]=i):i=e[1];const a=Qt(i);let l;e[2]!==o?(l={control:o,name:"modelName"},e[2]=o,e[3]=l):l=e[3];const u=Qt(l);let c;e[4]!==o?(c={control:o,name:"system_prompt"},e[4]=o,e[5]=c):c=e[5];const f=Qt(c);let d;e[6]!==o?(d={control:o,name:"temperature"},e[6]=o,e[7]=d):d=e[7];const h=Qt(d);let g;e[8]!==o?(g={control:o,name:"maxTokens"},e[8]=o,e[9]=g):g=e[9];const m=Qt(g);let y;e[10]!==o?(y={control:o,name:"topP"},e[10]=o,e[11]=y):y=e[11];const x=Qt(y);let p;e[12]!==o?(p={control:o,name:"frequencyPenalty"},e[12]=o,e[13]=p):p=e[13];const _=Qt(p);let C;e[14]!==o?(C={control:o,name:"presencePenalty"},e[14]=o,e[15]=C):C=e[15];const v=Qt(C),b=a||"",S=u||"";let T;e[16]!==_||e[17]!==m||e[18]!==v||e[19]!==S||e[20]!==b||e[21]!==h||e[22]!==x?(T={provider:b,modelName:S,temperature:h,maxTokens:m,topP:x,frequencyPenalty:_,presencePenalty:v},e[16]=_,e[17]=m,e[18]=v,e[19]=S,e[20]=b,e[21]=h,e[22]=x,e[23]=T):T=e[23];const E=T;let N;e[24]!==_||e[25]!==m||e[26]!==v||e[27]!==u||e[28]!==a||e[29]!==s||e[30]!==h||e[31]!==x?(N=B=>{B.provider!==a&&s("provider",B.provider,{shouldValidate:!0,shouldDirty:!0}),B.modelName!==u&&s("modelName",B.modelName,{shouldValidate:!0,shouldDirty:!0}),B.temperature!==h&&s("temperature",B.temperature,{shouldValidate:!0,shouldDirty:!0}),B.maxTokens!==m&&s("maxTokens",B.maxTokens,{shouldValidate:!0,shouldDirty:!0}),B.topP!==x&&s("topP",B.topP,{shouldValidate:!0,shouldDirty:!0}),B.frequencyPenalty!==_&&s("frequencyPenalty",B.frequencyPenalty,{shouldValidate:!0,shouldDirty:!0}),B.presencePenalty!==v&&s("presencePenalty",B.presencePenalty,{shouldValidate:!0,shouldDirty:!0})},e[24]=_,e[25]=m,e[26]=v,e[27]=u,e[28]=a,e[29]=s,e[30]=h,e[31]=x,e[32]=N):N=e[32];const P=N;let M;e[33]===Symbol.for("react.memo_cache_sentinel")?(M=k.jsxs("div",{className:Ya,children:[k.jsx(Vu,{icon:Xh,size:"xs"}),k.jsx("span",{children:"Model"})]}),e[33]=M):M=e[33];let R;e[34]!==P||e[35]!==E?(R=k.jsxs("div",{className:Dp,children:[M,k.jsx("div",{className:jp,children:k.jsx(Pb,{value:E,onChange:P})})]}),e[34]=P,e[35]=E,e[36]=R):R=e[36];let I;e[37]===Symbol.for("react.memo_cache_sentinel")?(I=k.jsx("span",{children:"System"}),e[37]=I):I=e[37];let D;e[38]===Symbol.for("react.memo_cache_sentinel")?(D=k.jsxs("div",{className:Ya,children:[I,k.jsxs("div",{className:Bp,children:[k.jsx(fb,{width:14,height:14}),k.jsx("span",{children:"Markdown Supported"})]})]}),e[38]=D):D=e[38];let L;e[39]!==s?(L=B=>s("system_prompt",B,{shouldValidate:!0,shouldDirty:!0}),e[39]=s,e[40]=L):L=e[40];let F;e[41]!==r||e[42]!==f||e[43]!==L?(F=k.jsxs("div",{className:zp,children:[D,k.jsx(ub,{value:f,onChange:L},r)]}),e[41]=r,e[42]=f,e[43]=L,e[44]=F):F=e[44];let j;return e[45]!==R||e[46]!==F?(j=k.jsxs("div",{className:Up,children:[R,F]}),e[45]=R,e[46]=F,e[47]=j):j=e[47],j},Db=["variants-list"],jb=()=>{const n=De.c(2),e=Hu();let t;return n[0]!==e?(t={mutationFn:Bb,onSuccess:(r,s)=>{e.invalidateQueries({queryKey:Db}),e.invalidateQueries({queryKey:Qp(s.configId)})}},n[0]=e,n[1]=t):t=n[1],ud(t)};async function Bb(n){const t=await(await Ji.v1.configs[":configId"].variants.$post({param:{configId:n.configId},json:{name:n.name,provider:n.provider,modelName:n.modelName,jsonData:n.jsonData}})).json();if("data"in t&&t.data)return t.data}const zb=()=>{const n=De.c(2),e=Hu();let t;return n[0]!==e?(t={mutationFn:Ub,onSuccess:(r,s)=>{e.invalidateQueries({queryKey:Kp(s.variantId)}),e.invalidateQueries({queryKey:["variant",s.variantId]})}},n[0]=e,n[1]=t):t=n[1],ud(t)};async function Ub(n){const e=await Ji.v1.variants[":id"].versions.$post({param:{id:n.variantId},json:{provider:n.provider,modelName:n.modelName,jsonData:n.jsonData}}),t=await e.json();if(!e.ok||!("data"in t))throw new Error("message"in t?t.message:"Failed to create variant version");return t.data}function c0(){const{id:n,variant:e}=kp.useParams(),t=Np(),r=jb(),s=zb(),o=Wp(),{data:i}=Ap(e==="new"?"":e),{data:a}=eh(n),{data:l}=Vp(e==="new"?"":e),{data:u}=th(n),[c,f]=w.useState("new"),[d,h]=w.useState(null),g=e==="new",m=Gp({defaultValues:{variant_name:"",provider:"",modelName:"",system_prompt:"",temperature:void 0,maxTokens:void 0,topP:void 0,frequencyPenalty:void 0,presencePenalty:void 0}}),y=m.formState.isDirty,x=r.isPending||s.isPending||o.isPending,p=l?[...l].sort((b,S)=>S.version-b.version):[];w.useEffect(()=>{if(l&&l.length>0&&!d){const b=a?.find(T=>T.variantId===e),S=u?.find(T=>b&&T.configVariantId===b.id&&T.variantVersionId);if(S?.variantVersionId)h(S.variantVersionId);else{const T=l.reduce((E,N)=>N.version>E.version?N:E);h(T.id)}}},[l,d,a,u,e]),sh({shouldBlockFn:()=>x?!1:y?!confirm("You have unsaved changes. Are you sure you want to move away from the form?"):!1}),w.useEffect(()=>{if(i&&d&&l){const b=l.find(T=>T.id===d);if(!b)return;const S=typeof b.jsonData=="string"?JSON.parse(b.jsonData):b.jsonData;m.reset({variant_name:i.name||"",provider:b.provider||"",modelName:S?.model||b.modelName||"",system_prompt:S?.system_prompt||"",temperature:S?.temperature,maxTokens:S?.max_tokens,topP:S?.top_p,frequencyPenalty:S?.frequency_penalty,presencePenalty:S?.presence_penalty},{keepDirty:!1}),f(`${i.id}-${d}`)}},[i,d,l]);const _=b=>{const S={system_prompt:b.system_prompt,model:b.modelName};return b.temperature!==void 0&&(S.temperature=b.temperature),b.maxTokens!==void 0&&(S.max_tokens=b.maxTokens),b.topP!==void 0&&(S.top_p=b.topP),b.frequencyPenalty!==void 0&&(S.frequency_penalty=b.frequencyPenalty),b.presencePenalty!==void 0&&(S.presence_penalty=b.presencePenalty),S},C=b=>{if(!a||a.length===0)return b;const S=new Set(a.map(N=>N.name));if(!S.has(b))return b;let T=2,E=`${b} (${T})`;for(;S.has(E);)T++,E=`${b} (${T})`;return E},v=async b=>{const S=m.getValues();if(!(!S.variant_name.trim()||!S.provider||!S.modelName))try{const T=_(S);if(b.mode==="new_variant"||g){const E=b.mode==="new_variant"&&!g?C(S.variant_name):S.variant_name,N=await r.mutateAsync({configId:n,name:E,provider:S.provider,modelName:S.modelName,jsonData:T});b.deployToEnvironment&&b.environmentId&&N&&await o.mutateAsync({environmentId:b.environmentId,configId:n,configVariantId:N.configVariant.id,variantVersionId:N.version.id})}else{const E=await s.mutateAsync({variantId:e,provider:S.provider,modelName:S.modelName,jsonData:T});if(b.deployToEnvironment&&b.environmentId){const N=a?.find(P=>P.variantId===e);N&&E&&await o.mutateAsync({environmentId:b.environmentId,configId:n,configVariantId:N.id,variantVersionId:E.id})}}m.reset(),t({to:"/configs/$id/variants",params:{id:n}})}catch(T){console.error("Error saving variant:",T)}};return k.jsxs("div",{children:[k.jsxs("div",{className:Hp,children:[k.jsx("input",{title:"Variant Name","data-1p-ignore":!0,autoComplete:"off",placeholder:"Variant Name",className:Gu,...m.register("variant_name")}),k.jsxs("div",{className:qp,children:[!g&&p.length>0&&k.jsx(Gi,{items:p,value:p.find(b=>b.id===d)??null,onValueChange:b=>{(b&&!y||b&&y&&confirm("You have unsaved changes. Switching versions will discard them. Continue?"))&&h(b.id)},placeholder:"Select version...",itemToString:b=>b?`Version ${b.version}`:""}),k.jsx(xm,{isNewVariant:g,onSave:v,isSaving:x})]})]}),k.jsx("div",{className:Jp,children:k.jsx(Lb,{form:m,editorKey:c})})]})}export{c0 as component};