@llmops/app 0.2.0 → 0.2.1-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.
- package/dist/index.cjs +1180 -17
- package/dist/index.mjs +1181 -18
- package/package.json +4 -4
- package/dist/.vite/manifest.json +0 -932
- package/dist/assets/DialogTitle-UCL-cueg.js +0 -1
- package/dist/assets/Form-DCtoTR-p.js +0 -1
- package/dist/assets/_environment-DK0RuLfe.js +0 -1
- package/dist/assets/_observability-BsCcZkih.js +0 -1
- package/dist/assets/_observability-CBX-o26D.css +0 -1
- package/dist/assets/_settings-B87EsM9n.css +0 -1
- package/dist/assets/_settings-BBP4PpLX.js +0 -1
- package/dist/assets/_tabs-DhgOS8ht.js +0 -1
- package/dist/assets/_tabs-DrzB5Z0A.js +0 -1
- package/dist/assets/_variant-CD-PVgqt.css +0 -1
- package/dist/assets/_variant-CnHZzp0Z.js +0 -30
- package/dist/assets/_variants-B1QyPFs9.js +0 -1
- package/dist/assets/area-DoOD1Loz.css +0 -1
- package/dist/assets/area.css-CLOfP5iE.js +0 -1
- package/dist/assets/arrow-left-lxisLR8v.js +0 -1
- package/dist/assets/auth-Bfx1NO3t.css +0 -1
- package/dist/assets/auth.css-B5Lrnlbx.js +0 -1
- package/dist/assets/button-BOiGz4Ne.js +0 -1
- package/dist/assets/check-CPNSKHk4.js +0 -1
- package/dist/assets/chevron-right-BtD8s6fj.js +0 -1
- package/dist/assets/combobox-JWj_3Y0m.js +0 -1
- package/dist/assets/configs-BKxrD14d.css +0 -1
- package/dist/assets/configs-CWaFij7a.js +0 -1
- package/dist/assets/configs-_Qxo3N29.css +0 -1
- package/dist/assets/configs.css-C0mqmoVB.js +0 -1
- package/dist/assets/copy-Dyj2k1Sq.js +0 -1
- package/dist/assets/costs-5Vkkcitr.js +0 -1
- package/dist/assets/en-US-C8ut0f5H.js +0 -1
- package/dist/assets/environments-BHZ_35T8.js +0 -1
- package/dist/assets/favicon.ico +0 -0
- package/dist/assets/formatDistance-Bok3-MB1.js +0 -1
- package/dist/assets/index-Ba7KtRo4.js +0 -1
- package/dist/assets/index-Bx54WVNn.js +0 -1
- package/dist/assets/index-CKUiONR1.js +0 -4
- package/dist/assets/index-CgbnU9Zg.css +0 -1
- package/dist/assets/index-CmwqDWtN.js +0 -1
- package/dist/assets/index-D7CjbFS0.js +0 -1
- package/dist/assets/index-DWCIocaw.js +0 -27
- package/dist/assets/index-DcAb9uJ1.css +0 -1
- package/dist/assets/index-DdbFK5pg.js +0 -1
- package/dist/assets/index.esm-Cx4qB0Tk.js +0 -1
- package/dist/assets/info-box-JXSyJ9E4.css +0 -1
- package/dist/assets/info-box.css-qBxEQPo-.js +0 -1
- package/dist/assets/logo-D4ybjOzp.css +0 -1
- package/dist/assets/logo.css-CYdOI33_.js +0 -1
- package/dist/assets/new-config-state-B8sMe-TC.css +0 -1
- package/dist/assets/new-config-state.css-BQLyMmey.js +0 -1
- package/dist/assets/observability-DEEfw22p.css +0 -1
- package/dist/assets/observability.css-ScdW-rjk.js +0 -1
- package/dist/assets/overview-BhnAFrza.js +0 -33
- package/dist/assets/plus-BwJa6tsj.js +0 -1
- package/dist/assets/popover-CWoAmEjp.js +0 -1
- package/dist/assets/requests-jUGszjv8.js +0 -1
- package/dist/assets/route-BlPm4saZ.js +0 -1
- package/dist/assets/route-D4DCefa9.js +0 -1
- package/dist/assets/route-DHkrULGT.js +0 -1
- package/dist/assets/route-mr2mV0Yu.js +0 -1
- package/dist/assets/route-v7PO6657.js +0 -1
- package/dist/assets/secrets-BGHMIr_s.css +0 -1
- package/dist/assets/secrets-Bn-e_u13.js +0 -1
- package/dist/assets/settings-BwmM525w.css +0 -1
- package/dist/assets/settings-CvvrMdCu.css +0 -1
- package/dist/assets/settings-DmnvYt0Y.js +0 -1
- package/dist/assets/settings-IRh_XlY0.js +0 -1
- package/dist/assets/setup-CIRVKcq-.js +0 -1
- package/dist/assets/signin-B_kUyGAp.js +0 -1
- package/dist/assets/styles-Ds0dHEK-.css +0 -1
- package/dist/assets/table-49TSZbdr.js +0 -1
- package/dist/assets/tabs.css-BIuQQZaU.js +0 -1
- package/dist/assets/tabs.css.ts-9m2TgQoD.css +0 -1
- package/dist/assets/targeting-CbWcgm3w.js +0 -1
- package/dist/assets/tooltip-CkWL0dMr.js +0 -1
- package/dist/assets/update-or-create-name-BGp6o60I.js +0 -1
- package/dist/assets/update-or-create-name-DW-QlCah.css +0 -1
- package/dist/assets/useAnalytics-DiWjBhLw.js +0 -1
- package/dist/assets/useConfigList-DuUKjCrF.js +0 -1
- package/dist/assets/useConfigVariants-ChEQ-YUl.js +0 -1
- package/dist/assets/useEnvironments-WGqvCy8N.js +0 -1
- package/dist/assets/useMutation-DflbfH1f.js +0 -1
- package/dist/assets/usePopupAutoResize-RFCDgOFp.js +0 -1
- package/dist/assets/useProvidersList-DtWn_MJs.js +0 -1
- package/dist/assets/useSetTargeting-CQWutQzN.css +0 -1
- package/dist/assets/useSetTargeting-DCF7D6n-.js +0 -1
- package/dist/assets/useTargetingRules-1RFyDPYx.js +0 -1
- package/dist/assets/useValueChanged-CIhVK-Fa.js +0 -1
- package/dist/assets/user-profile-CbijLYlM.js +0 -1
- package/dist/assets/variants-9qaqEb_G.css +0 -1
- package/dist/assets/variants-Bgidd8eE.js +0 -1
- package/dist/assets/variants.css-BI8mTlOx.js +0 -1
- package/dist/assets/workspace-general-CRDqD2_R.js +0 -1
- package/dist/assets/workspace-general-ET4CEZQV.css +0 -1
- package/dist/assets/workspace-providers-B6qtGU0q.css +0 -1
- package/dist/assets/workspace-providers-CBKGYtAx.js +0 -2
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import{co as Af,r as F,cp as Nc,j as T,cq as Ff,cr as kc,bU as Ac,cs as Pf,ap as si,ct as If,cu as Of,a6 as Fc,cv as $f,ar as Rf,as as Mf,aS as Lf,an as Df,at as Gn,au as Bf,a0 as We,bB as Pc,Y as dr,Z as jf,aV as Ic,W as ws,cw as Oc,bN as or,bS as zf,cx as Uf,bE as Kf,aA as $c,bx as Yi,cy as Wf,cz as fa,bh as Vf,a4 as qf,bk as Rc,bJ as ga,cA as Hf,a$ as Jf,cB as Mc,cC as Lc,cD as Dc,cE as Bc,cF as jc,cG as zc,bI as Gf,v as Zf,c as Le,h as Yf,I as Uc,H as ha,cH as pa,u as Kc,o as vo,cI as ma,cJ as ya,cK as _a,cL as Xf,z as Wc,cM as Qf,m as Vc,cN as eg,g as tg,cO as ng}from"./index-DWCIocaw.js";import{u as qc,b as rg,c as ig,d as sg,e as og,a as xo}from"./combobox-JWj_3Y0m.js";import{a as Ut,u as ag}from"./index.esm-Cx4qB0Tk.js";import{S as lg,v as va,a as cg,b as ug,m as dg,c as fg,d as gg,g as hg,u as pg,e as mg,f as yg,h as _g,i as vg}from"./useSetTargeting-DCF7D6n-.js";import{e as Hc}from"./configs.css-C0mqmoVB.js";import{a as Jc,b as Gc,P as Zc}from"./popover-CWoAmEjp.js";import{a as xg,u as bg}from"./useValueChanged-CIhVK-Fa.js";import{u as Sg,a as Cg}from"./useProvidersList-DtWn_MJs.js";import{C as Eg}from"./chevron-right-BtD8s6fj.js";import{C as Yc}from"./check-CPNSKHk4.js";import{u as Xc}from"./useMutation-DflbfH1f.js";import{g as wg,u as Tg}from"./useConfigVariants-ChEQ-YUl.js";import{u as Ng}from"./useTargetingRules-1RFyDPYx.js";import{B as Xi}from"./button-BOiGz4Ne.js";import{u as kg}from"./useEnvironments-WGqvCy8N.js";/* empty css *//* empty css */import"./usePopupAutoResize-RFCDgOFp.js";function Ag(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 Fg(n,e){const{shouldBlockFn:t,enableBeforeUnload:r=!0,disabled:i=!1,withResolver:s=!1}=Ag(n),o=Af(),{history:a}=o,[l,u]=F.useState({status:"idle",current:void 0,next:void 0,action:void 0,proceed:void 0,reset:void 0});return F.useEffect(()=>{const c=async f=>{function d(p){const _=o.parseLocation(p),S=o.getMatchedRoutes(_.pathname);return S.foundRoute===void 0?{routeId:"__notFound__",fullPath:_.pathname,pathname:_.pathname,params:S.routeParams,search:o.options.parseSearch(p.search)}:{routeId:S.foundRoute.id,fullPath:S.foundRoute.fullPath,pathname:_.pathname,params:S.routeParams,search:o.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(!s)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 i?void 0:a.block({blockerFn:c,enableBeforeUnload:r})},[t,r,i,s,a,o]),l}function Qc(n,e,t=(r,i)=>r===i){return n.length===e.length&&n.every((r,i)=>t(r,e[i]))}function Pg(n){const e=Nc().store,t=F.useMemo(()=>({parentMenu:e}),[e]);return T.jsx(Ff.Provider,{value:t,children:T.jsx(kc,{...n})})}const Ig=F.forwardRef(function(e,t){const{render:r,className:i,label:s,id:o,nativeButton:a=!1,openOnHover:l=!0,delay:u=100,closeDelay:c=0,disabled:f=!1,...d}=e,h=Ac(),g=Pf(),{store:m}=Nc(),y=si(o),x=m.useState("open"),p=m.useState("floatingRootContext"),_=m.useState("floatingTreeRoot"),S=If(y,m),C=F.useCallback(Y=>{const X=S(Y);return Y!==null&&m.select("open")&&m.select("activeTriggerId")==null&&m.update({activeTriggerId:y,activeTriggerElement:Y,closeDelay:c}),X},[S,c,m,y]),v=F.useRef(null),b=F.useCallback(Y=>{v.current=Y,m.set("activeTriggerElement",Y)},[m]),w=Of();if(!w?.parentMenu)throw new Error(Fc(37));m.useSyncedValue("closeDelay",c);const E=w.parentMenu,N=E.useState("itemProps"),A=E.useState("isActive",h.index),L=F.useMemo(()=>({type:"submenu-trigger",setActive:()=>E.set("activeIndex",h.index)}),[E,h.index]),R=m.useState("disabled"),I=f||R,{getItemProps:D,itemRef:K}=$f({closeOnClick:!1,disabled:I,highlighted:A,id:y,store:m,nativeButton:a,itemMetadata:L,nodeId:g?.nodeId}),j=m.useState("hoverEnabled"),U=m.useState("allowMouseEnter"),B=Rf(p,{enabled:j&&l&&!I&&U,handleClose:Mf({blockPointerEvents:!0}),mouseOnly:!0,move:!0,restMs:u,delay:{open:u,close:c},triggerElementRef:v,externalTree:_}),re=Lf(p,{enabled:!I,event:"mousedown",toggle:!l,ignoreMouse:l,stickIfOpen:!1}),te=Df([re]),G=m.useState("triggerProps",!0);delete G.id;const de=F.useMemo(()=>({disabled:I,highlighted:A,open:x}),[I,A,x]);return Gn("div",e,{state:de,stateAttributesMapping:Bf,props:[te.getReferenceProps(),B,G,N,{tabIndex:x||A?0:-1,onBlur(){A&&E.set("activeIndex",null)}},d,D],ref:[t,h.ref,K,C,b]})}),xa=new Map;function Og(n,e){const t=JSON.stringify({locale:n,options:e}),r=xa.get(t);if(r)return r;const i=new Intl.NumberFormat(n,e);return xa.set(t,i),i}function Yr(n,e,t){return n==null?"":Og(e,t).format(n)}function Ts(n,e,t){return(n-e)*100/(t-e)}function ut(n,e=Number.MIN_SAFE_INTEGER,t=Number.MAX_SAFE_INTEGER){return Math.max(e,Math.min(n,t))}function eu(n,e){return n-e}function $g(n,e,t){const r=n.slice();return r[e]=t,r.sort(eu)}function tu(n,e,t,r,i,s){let o=n;return o=ut(o,t,r),i&&(o=$g(s,e,ut(o,s[e-1]||-1/0,s[e+1]||1/0))),o}function nu(n,e,t){if(!Array.isArray(n))return!0;const r=n.reduce((i,s,o,a)=>(o===a.length-1||i.push(Math.abs(s-a[o+1])),i),[]);return Math.min(...r)>=e*t}const Cr={activeThumbIndex:()=>null,max:()=>null,min:()=>null,minStepsBetweenValues:()=>null,step:()=>null,values:()=>null},ru=F.createContext(void 0);function Ti(){const n=F.useContext(ru);if(n===void 0)throw new Error(Fc(62));return n}function Rg(n){return"key"in n?Uf:Kf}function Mg(n,e){return typeof n=="number"&&typeof e=="number"?n===e:Array.isArray(n)&&Array.isArray(e)?Qc(n,e):!1}const Lg=F.forwardRef(function(e,t){const{"aria-labelledby":r,className:i,defaultValue:s,disabled:o=!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:S="push",thumbAlignment:C="center",value:v,...b}=e,w=si(a),E=We(y),N=We(x),{clearErrors:A}=xg(),{state:L,disabled:R,name:I,setTouched:D,setDirty:K,validityData:j,shouldValidateOnChange:U,validation:B}=qc(),{labelId:re}=rg(),te=r??re,G=R||o,de=I??m,[V,Y]=ig({controlled:v,default:s??h,name:"Slider"}),X=F.useRef(null),le=F.useRef(null),Z=F.useRef([]),Q=F.useRef(null),he=F.useRef(null),Ce=F.useRef(-1),H=F.useRef(null),ce=F.useRef(null),De=F.useRef("none"),W=Pc(l),[oe,ie]=F.useState(-1),[fe,se]=F.useState(-1),[Be,mt]=F.useState(!1),[Ze,Pt]=F.useState(()=>new Map),[An,Qt]=F.useState([void 0,void 0]),ye=We(pe=>{ie(pe),pe!==-1&&se(pe)});sg({id:w,commit:B.commit,value:V,controlRef:le,name:de,getValue:()=>V}),bg(V,()=>{A(de),U()?B.commit(V):B.commit(V,!0);const pe=j.initialValue;let yt;Array.isArray(V)&&Array.isArray(pe)?yt=!Qc(V,pe):yt=V!==pe,K(yt)});const en=We(pe=>{pe&&(le.current=pe)}),Ye=Array.isArray(V),Xe=F.useMemo(()=>Ye?V.slice().sort(eu):[ut(V,h,d)],[d,h,Ye,V]),He=We((pe,yt)=>{if(Number.isNaN(pe)||Mg(pe,V))return;const lt=yt??dr(jf,void 0,void 0,{activeThumbIndex:-1});De.current=lt.reason;const zt=new event.constructor(event.type,event);Object.defineProperty(zt,"target",{writable:!0,value:{value:pe,name:de}}),lt.event=zt,ce.current=pe,E(pe,lt),!lt.isCanceled&&Y(pe)}),tn=We((pe,yt,lt)=>{const zt=tu(pe,yt,h,d,Ye,Xe);if(nu(zt,_,g)){const Mr=Rg(lt);He(zt,dr(Mr,lt.nativeEvent,void 0,{activeThumbIndex:yt})),D(!0);const da=ce.current??zt;N(da,Ic(Mr,lt.nativeEvent))}});ws(()=>{const pe=Oc(or(X.current));G&&pe&&X.current?.contains(pe)&&pe.blur()},[G]),G&&oe!==-1&&ye(-1);const nt=F.useMemo(()=>({...L,activeThumbIndex:oe,disabled:G,dragging:Be,orientation:p,max:d,min:h,minStepsBetweenValues:g,step:_,values:Xe}),[L,oe,G,Be,d,h,g,p,_,Xe]),Ji=F.useMemo(()=>({active:oe,controlRef:le,disabled:G,dragging:Be,validation:B,formatOptionsRef:W,handleInputChange:tn,indicatorPosition:An,inset:C!=="center",labelId:te,largeStep:u,lastUsedThumbIndex:fe,lastChangedValueRef:ce,lastChangeReasonRef:De,locale:c,max:d,min:h,minStepsBetweenValues:g,name:de,onValueCommitted:N,orientation:p,pressedInputRef:Q,pressedThumbCenterOffsetRef:he,pressedThumbIndexRef:Ce,pressedValuesRef:H,registerFieldControlRef:en,renderBeforeHydration:C==="edge",setActive:ye,setDragging:mt,setIndicatorPosition:Qt,setValue:He,state:nt,step:_,thumbCollisionBehavior:S,thumbMap:Ze,thumbRefs:Z,values:Xe}),[oe,le,te,G,Be,B,W,tn,An,u,fe,ce,De,c,d,h,g,de,N,p,Q,he,Ce,H,en,ye,mt,Qt,He,nt,_,S,C,Ze,Z,Xe]),Rr=Gn("div",e,{state:nt,ref:[t,X],props:[{"aria-labelledby":te,id:w,role:"group"},B.getValidationProps,b],stateAttributesMapping:Cr});return T.jsx(ru.Provider,{value:Ji,children:T.jsx(zf,{elementsRef:Z,onMapChange:Pt,children:Rr})})});function iu(n){const e=n.getBoundingClientRect();return{x:(e.left+e.right)/2,y:(e.top+e.bottom)/2}}function Dg(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 su(n,e,t){const r=Math.round((n-t)/e)*e+t;return Number(r.toFixed(Dg(e)))}function ba({values:n,index:e,nextValue:t,min:r,max:i,step:s,minStepsBetweenValues:o,initialValues:a}){if(n.length===0)return[];const l=n.slice(),u=s*o,c=l.length-1,f=a??n,d=r+e*u,h=i-(c-e)*u;l[e]=ut(t,d,h);for(let g=e+1;g<=c;g+=1){const m=l[g-1]+u,y=i-(c-g)*u,x=f[g]??l[g];let p=Math.max(l[g],m);x<p&&(p=Math.max(x,m)),l[g]=ut(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]=ut(p,y,m)}for(let g=0;g<=c;g+=1)l[g]=Number(l[g].toFixed(12));return l}function Bg({behavior:n,values:e,currentValues:t,initialValues:r,pressedIndex:i,nextValue:s,min:o,max:a,step:l,minStepsBetweenValues:u}){const c=t??e,f=r??e;if(!(c.length>1))return{value:s,thumbIndex:0,didSwap:!1};const h=l*u;switch(n){case"swap":{const g=c[i],m=1e-7,y=c.slice(),x=y[i-1],p=y[i+1],_=x!=null?x+h:o,S=p!=null?p-h:a,C=ut(s,_,S),v=Number(C.toFixed(12));y[i]=v;const b=s>g,w=s<g,E=b&&p!=null&&s>=p-m,N=w&&x!=null&&s<=x+m;if(!E&&!N)return{value:y,thumbIndex:i,didSwap:!1};const A=E?i+1:i-1,L=y.map((K,j)=>{if(j===i)return v;const U=f[j];return U??c[j]});let R=s;E?R=Math.max(s,y[A]):R=Math.min(s,y[A]);const I=ba({values:y,index:A,nextValue:R,min:o,max:a,step:l,minStepsBetweenValues:u,initialValues:L}),D=E?A-1:A+1;if(D>=0&&D<I.length){const K=I[D-1],j=I[D+1];let U=K!=null?K+h:o;U=Math.max(U,o+D*h);let B=j!=null?j-h:a;B=Math.min(B,a-(I.length-1-D)*h);const re=ut(v,U,B);I[D]=Number(re.toFixed(12))}return{value:I,thumbIndex:A,didSwap:!0}}case"push":return{value:ba({values:c,index:i,nextValue:s,min:o,max:a,step:l,minStepsBetweenValues:u}),thumbIndex:i,didSwap:!1};case"none":default:{const g=c.slice(),m=g[i-1],y=g[i+1],x=m!=null?m+h:o,p=y!=null?y-h:a,_=ut(s,x,p);return g[i]=Number(_.toFixed(12)),{value:g,thumbIndex:i,didSwap:!1}}}}const jg=2;function zg(n,e){if(!n)return{start:0,end:0};function t(s){const o=s!=null?parseFloat(s):0;return Number.isNaN(o)?0:o}const r=e?"Top":"InlineStart",i=e?"Bottom":"InlineEnd";return{start:t(n[`border${r}Width`])+t(n[`padding${r}`]),end:t(n[`border${i}Width`])+t(n[`padding${i}`])}}function Br(n,e){if(e.current!=null&&n.changedTouches){const t=n;for(let r=0;r<t.changedTouches.length;r+=1){const i=t.changedTouches[r];if(i.identifier===e.current)return{x:i.clientX,y:i.clientY}}return null}return{x:n.clientX,y:n.clientY}}const Ug=F.forwardRef(function(e,t){const{render:r,className:i,...s}=e,{disabled:o,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:S,registerFieldControlRef:C,renderBeforeHydration:v,setActive:b,setDragging:w,setValue:E,state:N,step:A,thumbCollisionBehavior:L,thumbRefs:R,values:I}=Ti(),D=$c(),K=I.length>1,j=y==="vertical",U=F.useRef(null),B=F.useRef(null),re=We(W=>{W&&B.current==null&&B.current==null&&(B.current=getComputedStyle(W))}),te=F.useRef(null),G=F.useRef(0),de=F.useRef(0),V=Pc(I),Y=We(W=>{_.current!==W&&(_.current=W);const oe=R.current[W];if(!oe){p.current=null,x.current=null;return}x.current=oe.querySelector('input[type="range"]')}),X=We(W=>{const oe=U.current;if(!oe)return null;const{width:ie,height:fe,bottom:se,left:Be,right:mt}=oe.getBoundingClientRect(),Ze=zg(B.current,j),Pt=de.current,An=(j?fe:ie)-Ze.start-Ze.end-Pt*2,Qt=p.current??0,ye=W.x-Qt,en=W.y-Qt,Ye=j?se-en-Ze.end:(D==="rtl"?mt-ye:ye-Be)-Ze.start,Xe=ut((Ye-Pt)/An,0,1);let He=(d-h)*Xe+h;if(He=su(He,A,h),He=ut(He,h,d),!K)return{value:He,thumbIndex:0,didSwap:!1};const tn=_.current;if(tn<0)return null;const nt=Bg({behavior:L,values:I,currentValues:V.current??I,initialValues:S.current,pressedIndex:tn,nextValue:He,min:h,max:d,step:A,minStepsBetweenValues:g});return L==="swap"&&nt.didSwap?Y(nt.thumbIndex):_.current=nt.thumbIndex,nt}),le=We(W=>{S.current=K?I.slice():null,V.current=I;const oe=_.current;let ie=oe;if(oe>-1&&oe<I.length){if(I[oe]===d){let fe=oe;for(;fe>0&&I[fe-1]===d;)fe-=1;ie=fe}}else{const fe=j?"y":"x";let se;ie=-1;for(let Be=0;Be<R.current.length;Be+=1){const mt=R.current[Be];if(Yi(mt)){const Ze=iu(mt),Pt=Math.abs(W[fe]-Ze[fe]);(se===void 0||Pt<=se)&&(ie=Be,se=Pt)}}}if(ie>-1&&ie!==oe&&Y(ie),u){const fe=R.current[ie];if(Yi(fe)){const se=fe.getBoundingClientRect(),Be=j?"height":"width";de.current=se[Be]/2}}}),Z=We(W=>{R.current?.[W]?.querySelector('input[type="range"]')?.focus({preventScroll:!0})}),Q=We(W=>{const oe=Br(W,te);if(oe==null)return;if(G.current+=1,W.type==="pointermove"&&W.buttons===0){he(W);return}const ie=X(oe);ie!=null&&nu(ie.value,A,g)&&(!a&&G.current>jg&&w(!0),E(ie.value,dr(Wf,W,void 0,{activeThumbIndex:ie.thumbIndex})),V.current=Array.isArray(ie.value)?ie.value:[ie.value],ie.didSwap&&Z(ie.thumbIndex))});function he(W){b(-1),w(!1),x.current=null,p.current=null,_.current=-1;const oe=Br(W,te),ie=oe!=null?X(oe):null;if(ie!=null){const fe=f.current;l.commit(c.current??ie.value),m(c.current??ie.value,Ic(fe,W))}"pointerType"in W&&U.current?.hasPointerCapture(W.pointerId)&&U.current?.releasePointerCapture(W.pointerId),te.current=null,S.current=null,H()}const Ce=We(W=>{if(o)return;const oe=W.changedTouches[0];oe!=null&&(te.current=oe.identifier);const ie=Br(W,te);if(ie!=null){le(ie);const se=X(ie);if(se==null)return;Z(se.thumbIndex),E(se.value,dr(fa,W,void 0,{activeThumbIndex:se.thumbIndex})),V.current=Array.isArray(se.value)?se.value:[se.value],se.didSwap&&Z(se.thumbIndex)}G.current=0;const fe=or(U.current);fe.addEventListener("touchmove",Q,{passive:!0}),fe.addEventListener("touchend",he,{passive:!0})}),H=We(()=>{const W=or(U.current);W.removeEventListener("pointermove",Q),W.removeEventListener("pointerup",he),W.removeEventListener("touchmove",Q),W.removeEventListener("touchend",he),S.current=null}),ce=Vf();return F.useEffect(()=>{const W=U.current;return W?(W.addEventListener("touchstart",Ce,{passive:!0}),()=>{W.removeEventListener("touchstart",Ce),ce.cancel(),H()}):()=>H()},[H,Ce,U,ce]),F.useEffect(()=>{o&&H()},[o,H]),Gn("div",e,{state:N,ref:[t,C,U,re],props:[{"data-base-ui-slider-control":v?"":void 0,onPointerDown(W){const oe=U.current;if(!oe||o||W.defaultPrevented||!Yi(W.target)||W.button!==0)return;const ie=Br(W,te);if(ie!=null){le(ie);const se=X(ie);if(se==null)return;qf(R.current[se.thumbIndex],Oc(or(oe)))?W.preventDefault():ce.request(()=>{Z(se.thumbIndex)}),w(!0),p.current!=null||(E(se.value,dr(fa,W.nativeEvent,void 0,{activeThumbIndex:se.thumbIndex})),V.current=Array.isArray(se.value)?se.value:[se.value],se.didSwap&&Z(se.thumbIndex))}W.nativeEvent.pointerId&&oe.setPointerCapture(W.nativeEvent.pointerId),G.current=0;const fe=or(U.current);fe.addEventListener("pointermove",Q,{passive:!0}),fe.addEventListener("pointerup",he,{once:!0})},tabIndex:-1},s],stateAttributesMapping:Cr})}),Kg=F.forwardRef(function(e,t){const{render:r,className:i,...s}=e,{state:o}=Ti();return Gn("div",e,{state:o,ref:t,props:[{style:{position:"relative"}},s],stateAttributesMapping:Cr})});let Wg=(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 Vg='!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"))))}}();',ou="PageUp",au="PageDown",qg=new Set([zc,Bc,Dc,jc,Mc,Lc,ou,au]);function Hg(n,e,t,r){if(!(e<0))return n.length===2?e===0?`${Yr(n[e],r,t)} start range`:`${Yr(n[e],r,t)} end range`:t?Yr(n[e],r,t):void 0}function Fn(n,e,t,r,i){return t===1?Math.min(n+e,i):Math.max(n-e,r)}const Jg=F.forwardRef(function(e,t){const{render:r,children:i,className:s,"aria-describedby":o,"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,S=si(d),{active:C,lastUsedThumbIndex:v,controlRef:b,disabled:w,validation:E,formatOptionsRef:N,handleInputChange:A,inset:L,labelId:R,largeStep:I,locale:D,max:K,min:j,minStepsBetweenValues:U,name:B,orientation:re,pressedInputRef:te,pressedThumbCenterOffsetRef:G,pressedThumbIndexRef:de,renderBeforeHydration:V,setActive:Y,setIndicatorPosition:X,state:le,step:Z,values:Q}=Ti(),he=$c(),Ce=u||w,H=Q.length>1,ce=re==="vertical",De=he==="rtl",{setTouched:W,setFocused:oe,validationMode:ie}=qc(),fe=F.useRef(null),se=F.useRef(null),Be=si(),mt=og(),Ze=H?Be:mt,Pt=F.useMemo(()=>({inputId:Ze}),[Ze]),{ref:An,index:Qt}=Ac({metadata:Pt}),ye=H?h??Qt:0,en=ye===Q.length-1,Ye=Q[ye],Xe=Ts(Ye,j,K),[He,tn]=F.useState(!1),[nt,Ji]=F.useState();Rc(()=>tn(!0));const Rr=v>=0&&v<Q.length?v:-1,pe=We(()=>{const Ee=b.current,we=fe.current;if(!Ee||!we)return;const $e=we.getBoundingClientRect(),Lr=Ee.getBoundingClientRect(),Dr=ce?"height":"width",kf=Lr[Dr]-$e[Dr],Gi=($e[Dr]/2+kf*Xe/100)/Lr[Dr]*100;Ji(Gi),ye===0?X(Zi=>[Gi,Zi[1]]):en&&X(Zi=>[Zi[0],Gi])});ws(()=>{L&&queueMicrotask(pe)},[pe,L]),ws(()=>{L&&pe()},[pe,L,Xe]);const yt=F.useCallback(()=>{const Ee=ce?"bottom":"insetInlineStart",we=ce?"left":"top";let $e;return H?C===ye?$e=2:Rr===ye&&($e=1):C===ye&&($e=1),L?{"--position":`${nt}%`,visibility:V&&!He||nt===void 0?"hidden":void 0,position:"absolute",[Ee]:"var(--position)",[we]:"50%",translate:`${(ce||!De?-1:1)*50}% ${(ce?1:-1)*50}%`,zIndex:$e}:Number.isFinite(Xe)?{position:"absolute",[Ee]:`${Xe}%`,[we]:"50%",translate:`${(ce||!De?-1:1)*50}% ${(ce?1:-1)*50}%`,zIndex:$e}:ga},[C,ye,L,He,nt,H,V,De,Rr,Xe,ce]);let lt;re==="vertical"&&(lt=De?"vertical-rl":"vertical-lr");const zt=Hf({"aria-label":typeof c=="function"?c(ye):a,"aria-labelledby":l??R,"aria-describedby":o,"aria-orientation":re,"aria-valuenow":Ye,"aria-valuetext":typeof f=="function"?f(Yr(Ye,D,N.current??void 0),Ye,ye):Hg(Q,ye,N.current??void 0,D),disabled:Ce,id:Ze,max:K,min:j,name:B,onChange(Ee){A(Ee.target.valueAsNumber,ye,Ee)},onFocus(){Y(ye),oe(!0)},onBlur(){fe.current&&(Y(-1),W(!0),oe(!1),ie==="onBlur"&&E.commit(tu(Ye,ye,j,K,H,Q)))},onKeyDown(Ee){if(!qg.has(Ee.key))return;Jf.has(Ee.key)&&Ee.stopPropagation();let we=null;const $e=su(Ye,Z,j);switch(Ee.key){case zc:we=Fn($e,Ee.shiftKey?I:Z,1,j,K);break;case jc:we=Fn($e,Ee.shiftKey?I:Z,De?-1:1,j,K);break;case Bc:we=Fn($e,Ee.shiftKey?I:Z,-1,j,K);break;case Dc:we=Fn($e,Ee.shiftKey?I:Z,De?1:-1,j,K);break;case ou:we=Fn($e,I,1,j,K);break;case au:we=Fn($e,I,-1,j,K);break;case Lc:we=K,H&&(we=Number.isFinite(Q[ye+1])?Q[ye+1]-Z*U:K);break;case Mc:we=j,H&&(we=Number.isFinite(Q[ye-1])?Q[ye-1]+Z*U:j);break}we!==null&&(A(we,ye,Ee),Ee.preventDefault())},step:Z,style:{...ga,width:"100%",height:"100%",writingMode:lt},tabIndex:p??void 0,type:"range",value:Ye??""},E.getInputValidationProps),Mr=Gf(se,E.inputRef,g);return Gn("div",e,{state:le,ref:[t,An,fe],props:[{[Wg.index]:ye,children:T.jsxs(F.Fragment,{children:[i,T.jsx("input",{ref:Mr,...zt}),L&&!He&&V&&en&&T.jsx("script",{dangerouslySetInnerHTML:{__html:Vg},suppressHydrationWarning:!0})]}),id:S,onBlur:m,onFocus:y,onPointerDown(Ee){if(de.current=ye,fe.current!=null){const we=re==="horizontal"?"x":"y",$e=iu(fe.current),Lr=(re==="horizontal"?Ee.clientX:Ee.clientY)-$e[we];G.current=Lr}se.current!=null&&te.current!==se.current&&(te.current=se.current)},style:yt(),suppressHydrationWarning:V||void 0,tabIndex:-1},_],stateAttributesMapping:Cr})});function Gg(n,e,t,r,i,s){const o=t===void 0||e&&r===void 0?"hidden":void 0,a=n?"bottom":"insetInlineStart",l=n?"height":"width",c={visibility:i&&!s?"hidden":o,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 Zg(n,e,t,r){const i=n?"bottom":"insetInlineStart",s=n?"height":"width",a={position:n?"absolute":"relative",[n?"width":"height"]:"inherit"};if(!e)return a[i]=0,a[s]=`${t}%`,a;const l=r-t;return a[i]=`${t}%`,a[s]=`${l}%`,a}const Yg=F.forwardRef(function(e,t){const{render:r,className:i,...s}=e,{indicatorPosition:o,inset:a,max:l,min:u,orientation:c,renderBeforeHydration:f,state:d,values:h}=Ti(),[g,m]=F.useState(!1);Rc(()=>m(!0));const y=c==="vertical",x=h.length>1,p=a?Gg(y,x,o[0],o[1],f,g):Zg(y,x,Ts(h[0],u,l),Ts(h[h.length-1],u,l));return Gn("div",e,{state:d,ref:t,props:[{"data-base-ui-slider-indicator":f?"":void 0,style:p,suppressHydrationWarning:f||void 0},s],stateAttributesMapping:Cr})});const Xg=[["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"}]],Qg=Zf("brain-circuit",Xg);var eh="vpj4en0",th="vpj4en1",nh="vpj4en2",rh="vpj4en3",ih="vpj4en4",sh="vpj4en5",oh="vpj4en6";function jr(n){const e=Le.c(25),{label:t,value:r,defaultValue:i,min:s,max:o,step:a,onValueChange:l,onValueCommitted:u,disabled:c,className:f,showValue:d,formatValue:h}=n,g=s===void 0?0:s,m=o===void 0?100:o,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 S=_;let C;e[2]!==u?(C=I=>{typeof I=="number"?u?.(I):Array.isArray(I)&&u?.(I[0])},e[2]=u,e[3]=C):C=e[3];const v=C,b=r??i??g;let w;e[4]!==b||e[5]!==h?(w=h?h(b):String(b),e[4]=b,e[5]=h,e[6]=w):w=e[6];const E=w;let N;e[7]!==f?(N=Yf(eh,f),e[7]=f,e[8]=N):N=e[8];let A;e[9]!==E||e[10]!==t||e[11]!==p?(A=(t||p)&&T.jsxs("div",{className:th,children:[t&&T.jsx("span",{children:t}),p&&T.jsx("span",{className:nh,children:E})]}),e[9]=E,e[10]=t,e[11]=p,e[12]=A):A=e[12];let L;e[13]===Symbol.for("react.memo_cache_sentinel")?(L=T.jsx(Ug,{className:rh,children:T.jsxs(Kg,{className:ih,children:[T.jsx(Yg,{className:sh}),T.jsx(Jg,{className:oh})]})}),e[13]=L):L=e[13];let R;return e[14]!==i||e[15]!==x||e[16]!==S||e[17]!==v||e[18]!==m||e[19]!==g||e[20]!==y||e[21]!==A||e[22]!==N||e[23]!==r?(R=T.jsxs(Lg,{value:r,defaultValue:i,min:g,max:m,step:y,onValueChange:S,onValueCommitted:v,disabled:x,className:N,children:[A,L]}),e[14]=i,e[15]=x,e[16]=S,e[17]=v,e[18]=m,e[19]=g,e[20]=y,e[21]=A,e[22]=N,e[23]=r,e[24]=R):R=e[24],R}var ah="_7ucatj0",lh="_7ucatj1",ch="_7ucatj2",Sa="_7ucatj3",Ca="_7ucatj4",Ea="_7ucatj5",wa="_7ucatj6",Ta="_7ucatj7",Na="_7ucatj8",ka="_7ucatj9",Aa="_7ucatja",uh="_7ucatjb",dh="_7ucatjc",fh="_7ucatjd",gh="_7ucatje",hh="_7ucatjf",ph="_7ucatjg",mh="_7ucatjh",yh="_7ucatji";function _h(n){const e=Le.c(69),{isNewVariant:t,onSave:r,isSaving:i}=n,s=i===void 0?!1:i,[o,a]=F.useState(!1),[l,u]=F.useState(t?"new_variant":"new_version"),[c,f]=F.useState(!1),[d,h]=F.useState(null),{data:g}=kg();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?(_=W=>{a(W),W&&(u(t?"new_variant":"new_version"),f(!1),h(null))},e[7]=t,e[8]=_):_=e[8];const S=_;let C;e[9]===Symbol.for("react.memo_cache_sentinel")?(C=T.jsx(Uc,{icon:lg,size:"xs"}),e[9]=C):C=e[9];const v=s?"Saving...":"Save";let b;e[10]!==s||e[11]!==v?(b=T.jsx(Jc,{asChild:!0,children:T.jsxs(Xi,{variant:"primary",size:"default",type:"button",disabled:s,children:[C,v]})}),e[10]=s,e[11]=v,e[12]=b):b=e[12];let w;e[13]===Symbol.for("react.memo_cache_sentinel")?(w=T.jsx("div",{className:lh,children:"Save Options"}),e[13]=w):w=e[13];const E=`${Sa} ${l==="new_variant"?Ca:""}`;let N,A;e[14]===Symbol.for("react.memo_cache_sentinel")?(N=()=>u("new_variant"),A=W=>W.key==="Enter"&&u("new_variant"),e[14]=N,e[15]=A):(N=e[14],A=e[15]);const L=l==="new_variant",R=`${Ea} ${l==="new_variant"?wa:""}`;let I;e[16]!==l?(I=l==="new_variant"&&T.jsx("div",{className:Ta}),e[16]=l,e[17]=I):I=e[17];let D;e[18]!==R||e[19]!==I?(D=T.jsx("div",{className:R,children:I}),e[18]=R,e[19]=I,e[20]=D):D=e[20];let K;e[21]===Symbol.for("react.memo_cache_sentinel")?(K=T.jsxs("div",{className:Na,children:[T.jsx("span",{className:ka,children:"Save as new variant"}),T.jsx("span",{className:Aa,children:"Creates a new variant with version 1"})]}),e[21]=K):K=e[21];let j;e[22]!==E||e[23]!==L||e[24]!==D?(j=T.jsxs("div",{className:E,onClick:N,onKeyDown:A,role:"radio","aria-checked":L,tabIndex:0,children:[D,K]}),e[22]=E,e[23]=L,e[24]=D,e[25]=j):j=e[25];let U;e[26]!==t||e[27]!==l?(U=!t&&T.jsxs("div",{className:`${Sa} ${l==="new_version"?Ca:""}`,onClick:()=>u("new_version"),onKeyDown:W=>W.key==="Enter"&&u("new_version"),role:"radio","aria-checked":l==="new_version",tabIndex:0,children:[T.jsx("div",{className:`${Ea} ${l==="new_version"?wa:""}`,children:l==="new_version"&&T.jsx("div",{className:Ta})}),T.jsxs("div",{className:Na,children:[T.jsx("span",{className:ka,children:"Update as new version"}),T.jsx("span",{className:Aa,children:"Creates a new version of this variant"})]})]}),e[26]=t,e[27]=l,e[28]=U):U=e[28];let B;e[29]!==j||e[30]!==U?(B=T.jsxs("div",{className:ch,children:[j,U]}),e[29]=j,e[30]=U,e[31]=B):B=e[31];const re=`${fh} ${c?gh:""}`;let te,G;e[32]!==c?(te=()=>f(!c),G=W=>W.key==="Enter"&&f(!c),e[32]=c,e[33]=te,e[34]=G):(te=e[33],G=e[34]);let de;e[35]!==c?(de=c&&T.jsx(Yc,{className:hh}),e[35]=c,e[36]=de):de=e[36];let V;e[37]!==c||e[38]!==re||e[39]!==te||e[40]!==G||e[41]!==de?(V=T.jsx("div",{className:re,onClick:te,onKeyDown:G,role:"checkbox","aria-checked":c,tabIndex:0,children:de}),e[37]=c,e[38]=re,e[39]=te,e[40]=G,e[41]=de,e[42]=V):V=e[42];let Y;e[43]!==c?(Y=T.jsx("span",{className:ph,onClick:()=>f(!c),children:"Deploy to environment"}),e[43]=c,e[44]=Y):Y=e[44];let X;e[45]!==V||e[46]!==Y?(X=T.jsxs("div",{className:dh,children:[V,Y]}),e[45]=V,e[46]=Y,e[47]=X):X=e[47];let le;e[48]!==c||e[49]!==y||e[50]!==d?(le=c&&T.jsx("div",{className:mh,children:T.jsx(xo,{items:y,value:d,onValueChange:h,itemToString:vh,placeholder:"Select environment"})}),e[48]=c,e[49]=y,e[50]=d,e[51]=le):le=e[51];let Z;e[52]!==X||e[53]!==le?(Z=T.jsxs("div",{className:uh,children:[X,le]}),e[52]=X,e[53]=le,e[54]=Z):Z=e[54];let Q;e[55]===Symbol.for("react.memo_cache_sentinel")?(Q=T.jsx(Xi,{variant:"ghost",scheme:"gray",size:"sm",type:"button",onClick:()=>a(!1),children:"Cancel"}),e[55]=Q):Q=e[55];const he=s||c&&!d,Ce=s?"Saving...":"Confirm";let H;e[56]!==p||e[57]!==he||e[58]!==Ce?(H=T.jsxs("div",{className:yh,children:[Q,T.jsx(Xi,{variant:"primary",size:"sm",type:"button",onClick:p,disabled:he,children:Ce})]}),e[56]=p,e[57]=he,e[58]=Ce,e[59]=H):H=e[59];let ce;e[60]!==B||e[61]!==Z||e[62]!==H?(ce=T.jsx(Gc,{side:"bottom",align:"end",sideOffset:4,children:T.jsxs("div",{className:ah,children:[w,B,Z,H]})}),e[60]=B,e[61]=Z,e[62]=H,e[63]=ce):ce=e[63];let De;return e[64]!==S||e[65]!==o||e[66]!==ce||e[67]!==b?(De=T.jsxs(Zc,{open:o,onOpenChange:S,children:[b,ce]}),e[64]=S,e[65]=o,e[66]=ce,e[67]=b,e[68]=De):De=e[68],De}function vh(n){return n?.name||""}const lu=F.createContext(null);function xh(n,e){return{getTheme:function(){return e??null}}}function Ue(){const n=F.useContext(lu);return n==null&&(function(e,...t){const r=new URL("https://lexical.dev/docs/error"),i=new URLSearchParams;i.append("code",e);for(const s of t)i.append("v",s);throw r.search=i.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 O(n,...e){const t=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",n);for(const i of e)r.append("v",i);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 cu(n,...e){const t=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",n);for(const i of e)r.append("v",i);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 ht=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,bh=ht&&"documentMode"in document?document.documentMode:null,ct=ht&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),fn=ht&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),oi=!(!ht||!("InputEvent"in window)||bh)&&"getTargetRanges"in new window.InputEvent("input"),Er=ht&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),Zn=ht&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,Sh=ht&&/Android/.test(navigator.userAgent),uu=ht&&/^(?=.*Chrome).*/i.test(navigator.userAgent),Fa=ht&&Sh&&uu,wr=ht&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&ct&&!uu;function du(...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 Ch=0,Eh=1,wh=2,fu=128,Th=1,Nh=2,kh=3,Ah=4,Fh=5,Ph=6,Ni=Er||Zn||wr?" ":"",Jt=`
|
|
2
|
-
|
|
3
|
-
`,Ih=fn?" ":Ni,gn={bold:1,capitalize:1024,code:16,highlight:fu,italic:2,lowercase:256,strikethrough:4,subscript:32,superscript:64,underline:8,uppercase:512},Oh={directionless:1,unmergeable:2},Pa={center:2,end:6,justify:4,left:1,right:3,start:5},$h={[Nh]:"center",[Ph]:"end",[Ah]:"justify",[Th]:"left",[kh]:"right",[Fh]:"start"},Rh={normal:0,segmented:2,token:1},Mh={[Ch]:"normal",[wh]:"segmented",[Eh]:"token"},Ia="$config";function gu(n,e,t,r,i,s){let o=n.getFirstChild();for(;o!==null;){const a=o.__key;o.__parent===e&&(k(o)&&gu(o,a,t,r,i,s),t.has(a)||s.delete(a),i.push(a)),o=o.getNextSibling()}}let Ns=!1,bo=0;function Lh(n){bo=n.timeStamp}function Qi(n,e,t){const r=n.nodeName==="BR",i=e.__lexicalLineBreak;return i&&(n===i||r&&n.previousSibling===i)||r&&Li(n,t)!==void 0}function Dh(n,e,t){const r=pt(ot(t));let i=null,s=null;r!==null&&r.anchorNode===n&&(i=r.anchorOffset,s=r.focusOffset);const o=n.nodeValue;o!==null&&Ko(e,o,i,s,!1)}function Bh(n,e,t){if(P(n)){const r=n.anchor.getNode();if(r.is(t)&&n.format!==r.getFormat())return!1}return jt(e)&&t.isAttached()}function jh(n,e,t,r){for(let i=n;i&&!Up(i);i=Fr(i)){const s=Li(i,e);if(s!==void 0){const o=Te(s,t);if(o)return ae(o)||!Se(i)?void 0:[i,o]}else if(i===r)return[r,yd(t)]}}function hu(n,e,t){Ns=!0;const r=performance.now()-bo>100;try{Et(n,()=>{const i=M()||(function(d){return d.getEditorState().read(()=>{const h=M();return h!==null?h.clone():null})})(n),s=new Map,o=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=jh(m,n,a,o);if(!y)continue;const[x,p]=y;if(g==="characterData")r&&$(p)&&jt(m)&&Bh(i,m,p)&&Dh(m,p,n);else if(g==="childList"){u=!0;const _=h.addedNodes;for(let v=0;v<_.length;v++){const b=_[v],w=pd(b),E=b.parentNode;if(E!=null&&b!==l&&w===null&&!Qi(b,E,n)){if(fn){const N=(Se(b)?b.innerText:null)||b.nodeValue;N&&(c+=N)}E.removeChild(b)}}const S=h.removedNodes,C=S.length;if(C>0){let v=0;for(let b=0;b<C;b++){const w=S[b];(Qi(w,m,n)||l===w)&&(m.appendChild(w),v++)}C!==v&&s.set(x,p)}}}if(s.size>0)for(const[d,h]of s)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"||Qi(x,m,n)||p.removeChild(x)}}t.takeRecords()}i!==null&&(u&&Me(i),fn&&bd(n)&&i.insertRawText(c))})}finally{Ns=!1}}function pu(n){const e=n._observer;e!==null&&hu(n,e.takeRecords(),e)}function mu(n){(function(e){bo===0&&ot(e).addEventListener("textInput",Lh,!0)})(n),n._observer=new MutationObserver((e,t)=>{hu(n,e,t)})}let zh=class{key;parse;unparse;isEqual;defaultValue;constructor(e,t){this.key=e,this.parse=t.parse.bind(t),this.unparse=(t.unparse||Vh).bind(t),this.isEqual=(t.isEqual||Object.is).bind(t),this.defaultValue=this.parse(void 0)}};function Uh(n,e){return new zh(n,e)}function yu(n,e,t="latest"){const r=(t==="latest"?n.getLatest():n).__state;return r?r.getValue(e):e.defaultValue}function es(n,e,t){let r;if(Pe(),typeof t=="function"){const s=n.getLatest(),o=yu(s,e);if(r=t(o),e.isEqual(o,r))return s}else r=t;const i=n.getWritable();return vu(i).updateFromKnown(e,r),i}function Kh(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:i}=ji(r);if(i&&i.stateConfigs)for(const s of i.stateConfigs){let o;"stateConfig"in s?(o=s.stateConfig,s.flat&&t.add(o.key)):o=s,e.set(o.key,o)}}return{flatKeys:t,sharedConfigMap:e}}let Wh=class _u{node;knownState;unknownState;sharedNodeState;size;constructor(e,t,r=void 0,i=new Map,s=void 0){this.node=e,this.sharedNodeState=t,this.unknownState=r,this.knownState=i;const{sharedConfigMap:o}=this.sharedNodeState,a=s!==void 0?s:(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})(o,r,i);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 i=this.unknownState[e.key];i!==void 0&&(r=e.parse(i)),this.updateFromKnown(e,r)}return r}getInternalState(){return[this.unknownState,this.knownState]}toJSON(){const e={...this.unknownState},t={};for(const[r,i]of this.knownState)r.isEqual(i,r.defaultValue)?delete e[r.key]:e[r.key]=r.unparse(i);for(const r of this.sharedNodeState.flatKeys)r in e&&(t[r]=e[r],delete e[r]);return Oa(e)&&(t.$=e),t}getWritable(e){if(this.node===e)return this;const{sharedNodeState:t,unknownState:r}=this,i=new Map(this.knownState);return new _u(e,t,(function(s,o,a){let l;if(a)for(const[u,c]of Object.entries(a)){const f=s.get(u);f?o.has(f)||o.set(f,f.parse(c)):(l=l||{},l[u]=c)}return l})(t.sharedConfigMap,i,r),i,this.size)}updateFromKnown(e,t){const r=e.key;this.sharedNodeState.sharedConfigMap.set(r,e);const{knownState:i,unknownState:s}=this;i.has(e)||s&&r in s||(s&&(delete s[r],this.unknownState=Oa(s)),this.size++),i.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,i]of Object.entries(e))this.updateFromUnknown(r,i)}};function vu(n){const e=n.getWritable(),t=e.__state?e.__state.getWritable(e):new Wh(e,xu(e));return e.__state=t,t}function xu(n){return n.__state?n.__state.sharedNodeState:ud(Bi(),n.getType()).sharedNodeState}function Oa(n){if(n)for(const e in n)return n}function Vh(n){return n}function $a(n,e,t){for(const[r,i]of e.knownState){if(n.has(r.key))continue;n.add(r.key);const s=t?t.getValue(r):r.defaultValue;if(s!==i&&!r.isEqual(s,i))return!0}return!1}function Ra(n,e,t){const{unknownState:r}=e,i=t?t.unknownState:void 0;if(r){for(const[s,o]of Object.entries(r))if(!n.has(s)&&(n.add(s),o!==(i?i[s]:void 0)))return!0}return!1}function Ma(n,e){const t=n.__state;return t&&t.node===n?t.getWritable(e):t}function La(n,e){const t=n.__mode,r=n.__format,i=n.__style,s=e.__mode,o=e.__format,a=e.__style,l=n.__state,u=e.__state;return(t===null||t===s)&&(r===null||r===o)&&(i===null||i===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&&$a(d,c,f)||f&&$a(d,f,c)||c&&Ra(d,c,f)||f&&Ra(d,f,c))})(l,u))}function Da(n,e){const t=n.mergeWithSibling(e),r=me()._normalizedNodes;return r.add(n.__key),r.add(e.__key),t}function Ba(n){let e,t,r=n;if(r.__text!==""||!r.isSimpleText()||r.isUnmergeable()){for(;(e=r.getPreviousSibling())!==null&&$(e)&&e.isSimpleText()&&!e.isUnmergeable();){if(e.__text!==""){if(La(e,r)){r=Da(e,r);break}break}e.remove()}for(;(t=r.getNextSibling())!==null&&$(t)&&t.isSimpleText()&&!t.isUnmergeable();){if(t.__text!==""){if(La(r,t)){r=Da(r,t);break}break}t.remove()}}else r.remove()}function hn(n){return ja(n.anchor),ja(n.focus),n}function ja(n){for(;n.type==="element";){const e=n.getNode(),t=n.offset;let r,i;if(t===e.getChildrenSize()?(r=e.getChildAtIndex(t-1),i=!0):(r=e.getChildAtIndex(t),i=!1),$(r)){n.set(r.__key,i?r.getTextContentSize():0,"text",!0);break}if(!k(r))break;n.set(r.__key,i?r.getChildrenSize():0,"element",!0)}}let pn,je,mr,ki,ks,As,mn,dt,Fs,yr,Ae="",_t=null,rn=null,Mt="",Rn=!1,ai=!1;function li(n,e){const t=mn.get(n);if(e!==null){const r=$s(n);r.parentNode===e&&e.removeChild(r)}if(dt.has(n)||je._keyToDOMMap.delete(n),k(t)){const r=ui(t,mn);Ps(r,0,r.length-1,null)}t!==void 0&&Wo(yr,mr,ki,t,"destroyed")}function Ps(n,e,t,r){let i=e;for(;i<=t;++i){const s=n[i];s!==void 0&&li(s,r)}}function nn(n,e){n.setProperty("text-align",e)}const qh="40px";function bu(n,e){const t=pn.theme.indent;if(typeof t=="string"){const i=n.classList.contains(t);e>0&&!i?n.classList.add(t):e<1&&i&&n.classList.remove(t)}const r=getComputedStyle(n).getPropertyValue("--lexical-indent-base-value")||qh;n.style.setProperty("padding-inline-start",e===0?"":`calc(${e} * ${r})`)}function Su(n,e){const t=n.style;e===0?nn(t,""):e===1?nn(t,"left"):e===2?nn(t,"center"):e===3?nn(t,"right"):e===4?nn(t,"justify"):e===5?nn(t,"start"):e===6&&nn(t,"end")}function Is(n,e){const t=(function(r){const i=r.__dir;if(i!==null)return i;if(Fe(r))return null;const s=r.getParentOrThrow();return Fe(s)&&s.__dir===null?"auto":null})(e);t!==null?n.dir=t:n.removeAttribute("dir")}function ci(n,e){const t=dt.get(n);t===void 0&&O(60);const r=t.createDOM(pn,je);if((function(i,s,o){const a=o._keyToDOMMap;(function(l,u,c){const f=`__lexicalKey_${u._key}`;l[f]=c})(s,o,i),a.set(i,s)})(n,r,je),$(t)?r.setAttribute("data-lexical-text","true"):ae(t)&&r.setAttribute("data-lexical-decorator","true"),k(t)){const i=t.__indent,s=t.__size;if(Is(r,t),i!==0&&bu(r,i),s!==0){const a=s-1;Os(ui(t,dt),t,0,a,t.getDOMSlot(r))}const o=t.__format;o!==0&&Su(r,o),t.isInline()||Cu(null,t,r),Di(t)&&(Ae+=Jt,Mt+=Jt)}else{const i=t.getTextContent();if(ae(t)){const s=t.decorate(je,pn);s!==null&&Eu(n,s),r.contentEditable="false"}Ae+=i,Mt+=i}return e!==null&&e.insertChild(r),Wo(yr,mr,ki,t,"created"),r}function Os(n,e,t,r,i){const s=Ae;Ae="";let o=t;for(;o<=r;++o){ci(n[o],i);const a=dt.get(n[o]);a!==null&&$(a)&&_t===null&&(_t=a.getFormat(),rn=a.getStyle())}Di(e)&&(Ae+=Jt),i.element.__lexicalTextContent=Ae,Ae=s+Ae}function za(n,e){if(n){const t=n.__last;if(t){const r=e.get(t);if(r)return Ct(r)?"line-break":ae(r)&&r.isInline()?"decorator":null}return"empty"}return null}function Cu(n,e,t){const r=za(n,mn),i=za(e,dt);r!==i&&e.getDOMSlot(t).setManagedLineBreak(i)}function Hh(n,e,t){var r;_t=null,rn=null,(function(i,s,o){const a=Ae,l=i.__size,u=s.__size;Ae="";const c=o.element;if(l===1&&u===1){const f=i.__first,d=s.__first;if(f===d)ar(f,c);else{const g=$s(f),m=ci(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}li(f,null)}const h=dt.get(d);$(h)&&_t===null&&(_t=h.getFormat(),rn=h.getStyle())}else{const f=ui(i,mn),d=ui(s,dt);if(f.length!==l&&O(227),d.length!==u&&O(228),l===0)u!==0&&Os(d,s,0,u-1,o);else if(u===0){if(l!==0){const h=o.after==null&&o.before==null&&o.element.__lexicalLineBreak==null;Ps(f,0,l-1,h?null:c),h&&(c.textContent="")}}else(function(h,g,m,y,x,p){const _=y-1,S=x-1;let C,v,b=p.getFirstChild(),w=0,E=0;for(;w<=_&&E<=S;){const L=g[w],R=m[E];if(L===R)b=ts(ar(R,p.element)),w++,E++;else{C===void 0&&(C=new Set(g)),v===void 0&&(v=new Set(m));const D=v.has(L),K=C.has(R);if(D)if(K){const j=yn(je,R);j===b?b=ts(ar(R,p.element)):(p.withBefore(b).insertChild(j),ar(R,p.element)),w++,E++}else ci(R,p.withBefore(b)),E++;else b=ts($s(L)),li(L,p.element),w++}const I=dt.get(R);I!==null&&$(I)&&_t===null&&(_t=I.getFormat(),rn=I.getStyle())}const N=w>_,A=E>S;if(N&&!A){const L=m[S+1],R=L===void 0?null:je.getElementByKey(L);Os(m,h,E,S,p.withBefore(R))}else A&&!N&&Ps(g,w,_,p.element)})(s,f,d,l,u,o)}Di(s)&&(Ae+=Jt),c.__lexicalTextContent=Ae,Ae=a+Ae})(n,e,e.getDOMSlot(t)),r=e,_t==null||_t===r.__textFormat||ai||r.setTextFormat(_t),(function(i){rn==null||rn===i.__textStyle||ai||i.setTextStyle(rn)})(e)}function ui(n,e){const t=[];let r=n.__first;for(;r!==null;){const i=e.get(r);i===void 0&&O(101),t.push(r),r=i.__next}return t}function ar(n,e){const t=mn.get(n);let r=dt.get(n);t!==void 0&&r!==void 0||O(61);const i=Rn||As.has(n)||ks.has(n),s=yn(je,n);if(t===r&&!i){if(k(t)){const o=s.__lexicalTextContent;o!==void 0&&(Ae+=o,Mt+=o)}else{const o=t.getTextContent();Mt+=o,Ae+=o}return s}if(t!==r&&i&&Wo(yr,mr,ki,r,"updated"),r.updateDOM(t,s,pn)){const o=ci(n,null);return e===null&&O(62),e.replaceChild(o,s),li(n,null),o}if(k(t)&&k(r)){const o=r.__indent;(Rn||o!==t.__indent)&&bu(s,o);const a=r.__format;if((Rn||a!==t.__format)&&Su(s,a),i&&(Hh(t,r,s),Fe(r)||r.isInline()||Cu(t,r,s)),Di(r)&&(Ae+=Jt,Mt+=Jt),(Rn||r.__dir!==t.__dir)&&(Is(s,r),Fe(r)&&!Rn))for(const l of r.getChildren())k(l)&&Is(yn(je,l.getKey()),l)}else{const o=r.getTextContent();if(ae(r)){const a=r.decorate(je,pn);a!==null&&Eu(n,a)}Ae+=o,Mt+=o}if(!ai&&Fe(r)&&r.__cachedText!==Mt){const o=r.getWritable();o.__cachedText=Mt,r=o}return s}function Eu(n,e){let t=je._pendingDecorators;const r=je._decorators;if(t===null){if(r[n]===e)return;t=md(je)}t[n]=e}function ts(n){let e=n.nextSibling;return e!==null&&e===je._blockCursorElement&&(e=e.nextSibling),e}function Jh(n,e,t,r,i,s){Ae="",Mt="",Rn=r===2,je=t,pn=t._config,mr=t._nodes,ki=je._listeners.mutation,ks=i,As=s,mn=n._nodeMap,dt=e._nodeMap,ai=e._readOnly,Fs=new Map(t._keyToDOMMap);const o=new Map;return yr=o,ar("root",null),je=void 0,mr=void 0,ks=void 0,As=void 0,mn=void 0,dt=void 0,pn=void 0,Fs=void 0,yr=void 0,o}function $s(n){const e=Fs.get(n);return e===void 0&&O(75,n),e}function q(n){return{type:n}}const wu=q("SELECTION_CHANGE_COMMAND"),Gh=q("SELECTION_INSERT_CLIPBOARD_NODES_COMMAND"),So=q("CLICK_COMMAND"),Tu=q("BEFORE_INPUT_COMMAND"),Nu=q("INPUT_COMMAND"),ku=q("COMPOSITION_START_COMMAND"),Au=q("COMPOSITION_END_COMMAND"),ln=q("DELETE_CHARACTER_COMMAND"),jn=q("INSERT_LINE_BREAK_COMMAND"),_r=q("INSERT_PARAGRAPH_COMMAND"),zn=q("CONTROLLED_TEXT_INSERTION_COMMAND"),Ai=q("PASTE_COMMAND"),Rs=q("REMOVE_TEXT_COMMAND"),vr=q("DELETE_WORD_COMMAND"),xr=q("DELETE_LINE_COMMAND"),Wt=q("FORMAT_TEXT_COMMAND"),Fu=q("UNDO_COMMAND"),Pu=q("REDO_COMMAND"),Iu=q("KEYDOWN_COMMAND"),Ou=q("KEY_ARROW_RIGHT_COMMAND"),Zh=q("MOVE_TO_END"),Co=q("KEY_ARROW_LEFT_COMMAND"),Yh=q("MOVE_TO_START"),Eo=q("KEY_ARROW_UP_COMMAND"),wo=q("KEY_ARROW_DOWN_COMMAND"),di=q("KEY_ENTER_COMMAND"),To=q("KEY_SPACE_COMMAND"),$u=q("KEY_BACKSPACE_COMMAND"),No=q("KEY_ESCAPE_COMMAND"),Ru=q("KEY_DELETE_COMMAND"),ko=q("KEY_TAB_COMMAND"),Mu=q("INSERT_TAB_COMMAND"),Ms=q("INDENT_CONTENT_COMMAND"),Ls=q("OUTDENT_CONTENT_COMMAND"),Lu=q("DROP_COMMAND"),Xh=q("FORMAT_ELEMENT_COMMAND"),Du=q("DRAGSTART_COMMAND"),Bu=q("DRAGOVER_COMMAND"),Qh=q("DRAGEND_COMMAND"),Fi=q("COPY_COMMAND"),Ao=q("CUT_COMMAND"),Ds=q("SELECT_ALL_COMMAND"),ep=q("FOCUS_COMMAND"),tp=q("BLUR_COMMAND"),np=q("KEY_MODIFIER_COMMAND"),It=Object.freeze({}),Bs=[["keydown",function(n,e){br=n.timeStamp,ju=n.key,!e.isComposing()&&z(e,Iu,n)}],["pointerdown",function(n,e){const t=n.target,r=n.pointerType;wn(t)&&r!=="touch"&&r!=="pen"&&n.button===0&&Et(e,()=>{dd(t)||(Us=!0)})}],["compositionstart",function(n,e){z(e,ku,n)}],["compositionend",function(n,e){fn?lr=!0:Zn||!Er&&!wr?z(e,Au,n):(Ks=!0,Ws=n.data)}],["input",function(n,e){n.stopPropagation(),Et(e,()=>{e.dispatchCommand(Nu,n)},{event:n}),Mn=null}],["click",function(n,e){Et(e,()=>{const t=M(),r=pt(ot(e)),i=En();if(r){if(P(t)){const s=t.anchor,o=s.getNode();if(s.type==="element"&&s.offset===0&&t.isCollapsed()&&!Fe(o)&&be().getChildrenSize()===1&&o.getTopLevelElementOrThrow().isEmpty()&&i!==null&&t.is(i))r.removeAllRanges(),t.dirty=!0;else if(n.detail===3&&!t.isCollapsed()&&o!==t.focus.getNode()){const a=qe(o,l=>k(l)&&!l.isInline());k(a)&&a.select(0)}}else if(n.pointerType==="touch"||n.pointerType==="pen"){const s=r.anchorNode;(Se(s)||jt(s))&&Me(Io(i,r,e,n))}}z(e,So,n)})}],["cut",It],["copy",It],["dragstart",It],["dragover",It],["dragend",It],["paste",It],["focus",It],["blur",It],["drop",It]];oi&&Bs.push(["beforeinput",(n,e)=>(function(t,r){const i=t.inputType;i==="deleteCompositionText"||fn&&bd(r)||i!=="insertCompositionText"&&z(r,Tu,t)})(n,e)]);let br=0,ju=null,zu=0,Mn=null;const js=new WeakMap,fi=new WeakMap;let zs=!1,Us=!1,fr=!1,lr=!1,Ks=!1,Ws="",an=null,Uu=[0,"",0,"root",0];function Ku(n,e,t,r,i){const s=n.anchor,o=n.focus,a=s.getNode(),l=me(),u=pt(ot(l)),c=u!==null?u.anchorNode:null,f=s.key,d=l.getElementByKey(f),h=t.length;return f!==o.key||!$(a)||(!i&&(!oi||zu<r+50)||a.isDirty()&&h<2||_d(t))&&s.offset!==o.offset&&!a.isComposing()||Rt(a)||a.isDirty()&&h>1||(i||!oi)&&d!==null&&!a.isComposing()&&c!==Hn(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=cn(m);return y===0?!m.canInsertTextBefore()||!x.canInsertTextBefore()&&!m.isComposing()||p||(function(_){const S=_.getPreviousSibling();return($(S)||k(S)&&S.isInline())&&!S.canInsertTextAfter()})(m):y===m.getTextContentSize()&&(!m.canInsertTextAfter()||!x.canInsertTextAfter()&&!m.isComposing()||p)})(n,a)}function Ua(n,e){return jt(n)&&n.nodeValue!==null&&e!==0&&e!==n.nodeValue.length}function Ka(n,e,t){const{anchorNode:r,anchorOffset:i,focusNode:s,focusOffset:o}=n;zs&&(zs=!1,Ua(r,i)&&Ua(s,o)&&!an)||Et(e,()=>{if(!t)return void Me(null);if(!Ar(e,r,s))return;let a=M();if(an&&P(a)&&a.isCollapsed()){const l=a.anchor,u=an.anchor;(l.key===u.key&&l.offset===u.offset+1||l.offset===1&&u.getNode().is(l.getNode().getPreviousSibling()))&&(a=an.clone(),Me(a))}if(an=null,P(a)){const l=a.anchor,u=l.getNode();if(a.isCollapsed()){n.type==="Range"&&n.anchorNode===n.focusNode&&(a.dirty=!0);const c=ot(e).event,f=c?c.timeStamp:performance.now(),[d,h,g,m,y]=Uu,x=be(),p=e.isComposing()===!1&&x.getTextContent()==="";if(f<y+200&&l.offset===g&&l.key===m)Xr(a,d,h);else if(l.type==="text")$(u)||O(141),Wu(a,u);else if(l.type==="element"&&!p){k(u)||O(259);const _=l.getNode();_.isEmpty()?(function(S,C){const v=C.getTextFormat(),b=C.getTextStyle();Xr(S,v,b)})(a,_):Xr(a,0,"")}}else{const c=l.key,f=a.focus.key,d=a.getNodes(),h=d.length,g=a.isBackward(),m=g?o:i,y=g?i:o,x=g?f:c,p=g?c:f;let _=2047,S=!1;for(let C=0;C<h;C++){const v=d[C],b=v.getTextContentSize();if($(v)&&b!==0&&!(C===0&&v.__key===x&&m===b||C===h-1&&v.__key===p&&y===0)&&(S=!0,_&=v.getFormat(),_===0))break}a.format=S?_:0}}z(e,wu,void 0)})}function Xr(n,e,t){n.format===e&&n.style===t||(n.format=e,n.style=t,n.dirty=!0)}function Wu(n,e){Xr(n,e.getFormat(),e.getStyle())}function Vu(n){if(!n.getTargetRanges)return null;const e=n.getTargetRanges();return e.length===0?null:e[0]}function rp(n){const e=n.inputType,t=Vu(n),r=me(),i=M();if(e==="deleteContentBackward"){if(i===null){const f=En();if(!P(f))return!0;Me(f.clone())}if(P(i)){const f=i.anchor.key===i.focus.key;if(s=n.timeStamp,ju==="MediaLast"&&s<br+30&&r.isComposing()&&f){if(Re(null),br=0,setTimeout(()=>{Et(r,()=>{Re(null)})},30),P(i)){const d=i.anchor.getNode();d.markDirty(),$(d)||O(142),Wu(i,d)}}else{Re(null),n.preventDefault();const d=i.anchor.getNode(),h=d.getTextContent(),g=d.canInsertTextAfter(),m=i.anchor.offset===0&&i.focus.offset===h.length;let y=Fa&&f&&!m&&g;if(y&&i.isCollapsed()&&(y=!ae(Js(i.anchor,!0))),!y){z(r,ln,!0);const x=M();Fa&&P(x)&&x.isCollapsed()&&(an=x,setTimeout(()=>an=null))}}return!0}}var s;if(!P(i))return!0;const o=n.data;Mn!==null&&Uo(!1,r,Mn),i.dirty&&Mn===null||!i.isCollapsed()||Fe(i.anchor.getNode())||t===null||i.applyDOMRange(t),Mn=null;const a=i.anchor,l=i.focus,u=a.getNode(),c=l.getNode();if(e==="insertText"||e==="insertTranspose"){if(o===`
|
|
4
|
-
`)n.preventDefault(),z(r,jn,!1);else if(o===Jt)n.preventDefault(),z(r,_r,void 0);else if(o==null&&n.dataTransfer){const f=n.dataTransfer.getData("text/plain");n.preventDefault(),i.insertRawText(f)}else o!=null&&Ku(i,t,o,n.timeStamp,!0)?(n.preventDefault(),z(r,zn,o)):Mn=o;return zu=n.timeStamp,!0}switch(n.preventDefault(),e){case"insertFromYank":case"insertFromDrop":case"insertReplacementText":z(r,zn,n);break;case"insertFromComposition":Re(null),z(r,zn,n);break;case"insertLineBreak":Re(null),z(r,jn,!1);break;case"insertParagraph":Re(null),fr&&!Zn?(fr=!1,z(r,jn,!1)):z(r,_r,void 0);break;case"insertFromPaste":case"insertFromPasteAsQuotation":z(r,Ai,n);break;case"deleteByComposition":(function(f,d){return f!==d||k(f)||k(d)||!cn(f)||!cn(d)})(u,c)&&z(r,Rs,n);break;case"deleteByDrag":case"deleteByCut":z(r,Rs,n);break;case"deleteContent":z(r,ln,!1);break;case"deleteWordBackward":z(r,vr,!0);break;case"deleteWordForward":z(r,vr,!1);break;case"deleteHardLineBackward":case"deleteSoftLineBackward":z(r,xr,!0);break;case"deleteContentForward":case"deleteHardLineForward":case"deleteSoftLineForward":z(r,xr,!1);break;case"formatStrikeThrough":z(r,Wt,"strikethrough");break;case"formatBold":z(r,Wt,"bold");break;case"formatItalic":z(r,Wt,"italic");break;case"formatUnderline":z(r,Wt,"underline");break;case"historyUndo":z(r,Fu,void 0);break;case"historyRedo":z(r,Pu,void 0)}return!0}function ip(n){if(Se(n.target)&&dd(n.target))return!0;const e=me(),t=M(),r=n.data,i=Vu(n);if(r!=null&&P(t)&&Ku(t,i,r,n.timeStamp,!1)){lr&&(gi(e,r),lr=!1);const s=t.anchor.getNode(),o=pt(ot(e));if(o===null)return!0;const a=t.isBackward(),l=a?t.anchor.offset:t.focus.offset,u=a?t.focus.offset:t.anchor.offset;oi&&!t.isCollapsed()&&$(s)&&o.anchorNode!==null&&s.getTextContent().slice(0,l)+r+s.getTextContent().slice(l+u)===xd(o.anchorNode)||z(e,zn,r);const c=r.length;fn&&c>1&&n.inputType==="insertCompositionText"&&!e.isComposing()&&(t.anchor.offset-=c),Er||Zn||wr||!e.isComposing()||(br=0,Re(null))}else Uo(!1,e,r!==null?r:void 0),lr&&(gi(e,r||void 0),lr=!1);return(function(){Pe();const s=me();pu(s)})(),!0}function sp(n){const e=me(),t=M();if(P(t)&&!e.isComposing()){const r=t.anchor,i=t.anchor.getNode();Re(r.key),(n.timeStamp<br+30||r.type==="element"||!t.isCollapsed()||i.getFormat()!==t.format||$(i)&&i.getStyle()!==t.style)&&z(e,zn,Ih)}return!0}function op(n){return gi(me(),n.data),!0}function gi(n,e){const t=n._compositionKey;if(Re(null),t!==null&&e!=null){if(e===""){const r=Te(t),i=Hn(n.getElementByKey(t));return void(i!==null&&i.nodeValue!==null&&$(r)&&Ko(r,i.nodeValue,null,null,!0))}if(e[e.length-1]===`
|
|
5
|
-
`){const r=M();if(P(r)){const i=r.focus;return r.anchor.set(i.key,i.offset,i.type),void z(n,di,null)}}}Uo(!0,n,e)}function ap(n){const e=me();if(n.key==null)return!0;if(Ks&&hl(n))return Et(e,()=>{gi(e,Ws)}),Ks=!1,Ws="",!0;if((function(t){return ge(t,"ArrowRight",{shiftKey:"any"})})(n))z(e,Ou,n);else if((function(t){return ge(t,"ArrowRight",$t)})(n))z(e,Zh,n);else if((function(t){return ge(t,"ArrowLeft",{shiftKey:"any"})})(n))z(e,Co,n);else if((function(t){return ge(t,"ArrowLeft",$t)})(n))z(e,Yh,n);else if((function(t){return ge(t,"ArrowUp",{altKey:"any",shiftKey:"any"})})(n))z(e,Eo,n);else if((function(t){return ge(t,"ArrowDown",{altKey:"any",shiftKey:"any"})})(n))z(e,wo,n);else if((function(t){return ge(t,"Enter",{altKey:"any",ctrlKey:"any",metaKey:"any",shiftKey:!0})})(n))fr=!0,z(e,di,n);else if((function(t){return t.key===" "})(n))z(e,To,n);else if((function(t){return ct&&ge(t,"o",{ctrlKey:!0})})(n))n.preventDefault(),fr=!0,z(e,jn,!0);else if((function(t){return ge(t,"Enter",{altKey:"any",ctrlKey:"any",metaKey:"any"})})(n))fr=!1,z(e,di,n);else if((function(t){return ge(t,"Backspace",{shiftKey:"any"})||ct&&ge(t,"h",{ctrlKey:!0})})(n))hl(n)?z(e,$u,n):(n.preventDefault(),z(e,ln,!0));else if((function(t){return t.key==="Escape"})(n))z(e,No,n);else if((function(t){return ge(t,"Delete",{})||ct&&ge(t,"d",{ctrlKey:!0})})(n))(function(t){return t.key==="Delete"})(n)?z(e,Ru,n):(n.preventDefault(),z(e,ln,!1));else if((function(t){return ge(t,"Backspace",gl)})(n))n.preventDefault(),z(e,vr,!0);else if((function(t){return ge(t,"Delete",gl)})(n))n.preventDefault(),z(e,vr,!1);else if((function(t){return ct&&ge(t,"Backspace",{metaKey:!0})})(n))n.preventDefault(),z(e,xr,!0);else if((function(t){return ct&&(ge(t,"Delete",{metaKey:!0})||ge(t,"k",{ctrlKey:!0}))})(n))n.preventDefault(),z(e,xr,!1);else if((function(t){return ge(t,"b",$t)})(n))n.preventDefault(),z(e,Wt,"bold");else if((function(t){return ge(t,"u",$t)})(n))n.preventDefault(),z(e,Wt,"underline");else if((function(t){return ge(t,"i",$t)})(n))n.preventDefault(),z(e,Wt,"italic");else if((function(t){return ge(t,"Tab",{shiftKey:"any"})})(n))z(e,ko,n);else if((function(t){return ge(t,"z",$t)})(n))n.preventDefault(),z(e,Fu,void 0);else if((function(t){return ct?ge(t,"z",{metaKey:!0,shiftKey:!0}):ge(t,"y",{ctrlKey:!0})||ge(t,"z",{ctrlKey:!0,shiftKey:!0})})(n))n.preventDefault(),z(e,Pu,void 0);else{const t=e._editorState._selection;t===null||P(t)?pl(n)&&(n.preventDefault(),z(e,Ds,n)):(function(r){return ge(r,"c",$t)})(n)?(n.preventDefault(),z(e,Fi,n)):(function(r){return ge(r,"x",$t)})(n)?(n.preventDefault(),z(e,Ao,n)):pl(n)&&(n.preventDefault(),z(e,Ds,n))}return(function(t){return t.ctrlKey||t.shiftKey||t.altKey||t.metaKey})(n)&&e.dispatchCommand(np,n),!0}function qu(n){let e=n.__lexicalEventHandles;return e===void 0&&(e=[],n.__lexicalEventHandles=e),e}const Un=new Map;function Hu(n){const e=Bp(n.target);if(e===null)return;const t=Ri(e.anchorNode);if(t===null)return;Us&&(Us=!1,Et(t,()=>{const l=En(),u=e.anchorNode;(Se(u)||jt(u))&&Me(Io(l,e,t,n))}));const r=zo(t),i=r[r.length-1],s=i._key,o=Un.get(s),a=o||i;a!==t&&Ka(e,a,!1),Ka(e,t,!0),t!==i?Un.set(s,t):o&&Un.delete(s)}function Wa(n){n._lexicalHandled=!0}function Va(n){return n._lexicalHandled===!0}function lp(n){const e=js.get(n);if(e===void 0)return;const t=fi.get(e);if(t===void 0)return;const r=t-1;r>=0||O(164),js.delete(n),fi.set(e,r),r===0&&e.removeEventListener("selectionchange",Hu);const i=Mi(n);jo(i)?((function(o){if(o._parentEditor!==null){const a=zo(o),l=a[a.length-1]._key;Un.get(l)===o&&Un.delete(l)}else Un.delete(o._key)})(i),n.__lexicalEditor=null):i&&O(198);const s=qu(n);for(let o=0;o<s.length;o++)s[o]();n.__lexicalEventHandles=[]}function Vs(n,e,t){Pe();const r=n.__key,i=n.getParent();if(i===null)return;const s=(function(a){const l=M();if(!P(l)||!k(a))return l;const{anchor:u,focus:c}=l,f=u.getNode(),d=c.getNode();return Gs(f,a)&&u.set(a.__key,0,"element"),Gs(d,a)&&c.set(a.__key,0,"element"),l})(n);let o=!1;if(P(s)&&e){const a=s.anchor,l=s.focus;a.key===r&&(yi(a,n,i,n.getPreviousSibling(),n.getNextSibling()),o=!0),l.key===r&&(yi(l,n,i,n.getPreviousSibling(),n.getNextSibling()),o=!0)}else ke(s)&&e&&n.isSelected()&&n.selectPrevious();if(P(s)&&e&&!o){const a=n.getIndexWithinParent();un(n),mi(s,i,a,-1)}else un(n);t||ze(i)||i.canBeEmpty()||!i.isEmpty()||Vs(i,e),e&&s&&Fe(i)&&i.isEmpty()&&i.selectEnd()}const Ju=Symbol.for("ephemeral");function hi(n){return n[Ju]||!1}class St{__type;__key;__parent;__prev;__next;__state;static getType(){const{ownNodeType:e}=ji(this);return e===void 0&&O(64,this.name),e}static clone(e){O(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}),hd(this,e)}getType(){return this.__type}isInline(){O(137,this.constructor.name)}isAttached(){let e=this.__key;for(;e!==null;){if(e==="root")return!0;const t=Te(e);if(t===null)break;e=t.__parent}return!1}isSelected(e){const t=e||M();if(t==null)return!1;const r=t.getNodes().some(i=>i.__key===this.__key);if($(this))return r;if(P(t)&&t.anchor.type==="element"&&t.focus.type==="element"){if(t.isCollapsed())return!1;const i=this.getParent();if(ae(this)&&this.isInline()&&i){const s=t.isBackward()?t.focus:t.anchor;if(i.is(s.getNode())&&s.offset===i.getChildrenSize()&&this.is(i.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:Te(e)}getParentOrThrow(){const e=this.getParent();return e===null&&O(66,this.__key),e}getTopLevelElement(){let e=this;for(;e!==null;){const t=e.getParent();if(ze(t))return k(e)||e===this&&ae(e)||O(194),e;e=t}return null}getTopLevelElementOrThrow(){const e=this.getTopLevelElement();return e===null&&O(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:Te(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:Te(e)}getNextSiblings(){const e=[];let t=this.getNextSibling();for(;t!==null;)e.push(t),t=t.getNextSibling();return e}getCommonAncestor(e){const t=k(this)?this:this.getParent(),r=k(e)?e:e.getParent(),i=t&&r?ei(t,r):null;return i?i.commonAncestor:null}is(e){return e!=null&&this.__key===e.__key}isBefore(e){const t=ei(this,e);return t!==null&&(t.type==="descendant"||(t.type==="branch"?kd(t)===-1:(t.type!=="same"&&t.type!=="ancestor"&&O(279),!1)))}isParentOf(e){const t=ei(this,e);return t!==null&&t.type==="ancestor"}getNodesBetween(e){const t=this.isBefore(e),r=[],i=new Set;let s=this;for(;s!==null;){const o=s.__key;if(i.has(o)||(i.add(o),r.push(s)),s===e)break;const a=k(s)?t?s.getFirstChild():s.getLastChild():null;if(a!==null){s=a;continue}const l=t?s.getNextSibling():s.getPreviousSibling();if(l!==null){s=l;continue}const u=s.getParentOrThrow();if(i.has(u.__key)||r.push(u),u===e)break;let c=null,f=u;do{if(f===null&&O(68),c=t?f.getNextSibling():f.getPreviousSibling(),f=f.getParent(),f===null)break;c!==null||i.has(f.__key)||r.push(f)}while(c===null);s=c}return t||r.reverse(),r}isDirty(){const e=me()._dirtyLeaves;return e!==null&&e.has(this.__key)}getLatest(){if(hi(this))return this;const e=Te(this.__key);return e===null&&O(113),e}getWritable(){if(hi(this))return this;Pe();const e=Zt(),t=me(),r=e._nodeMap,i=this.__key,s=this.getLatest(),o=t._cloneNotNeeded,a=M();if(a!==null&&a.setCachedNodes(null),o.has(i))return vi(s),s;const l=Cd(s);return o.add(i),vi(l),r.set(i,l),l}getTextContent(){return""}getTextContentSize(){return this.getTextContent().length}createDOM(e,t){O(70)}updateDOM(e,t,r){O(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){O(18,this.name)}updateFromJSON(e){return(function(t,r){const i=t.getWritable(),s=r.$;let o=s;for(const a of xu(i).flatKeys)a in r&&(o!==void 0&&o!==s||(o={...s}),o[a]=r[a]);return(i.__state||o)&&vu(t).updateFromJSON(o),i})(this,e)}static transform(){return null}remove(e){Vs(this,!0,e)}replace(e,t){Pe();let r=M();r!==null&&(r=r.clone()),as(this,e);const i=this.getLatest(),s=this.__key,o=e.__key,a=e.getWritable(),l=this.getParentOrThrow().getWritable(),u=l.__size;un(a);const c=i.getPreviousSibling(),f=i.getNextSibling(),d=i.__prev,h=i.__next,g=i.__parent;if(Vs(i,!1,!0),c===null?l.__first=o:c.getWritable().__next=o,a.__prev=d,f===null?l.__last=o:f.getWritable().__prev=o,a.__next=h,a.__parent=g,l.__size=u,t&&(k(this)&&k(a)||O(139),this.getChildren().forEach(m=>{a.append(m)})),P(r)){Me(r);const m=r.anchor,y=r.focus;m.key===s&&Ga(m,a),y.key===s&&Ga(y,a)}return Vt()===s&&Re(o),a}insertAfter(e,t=!0){Pe(),as(this,e);const r=this.getWritable(),i=e.getWritable(),s=i.getParent(),o=M();let a=!1,l=!1;if(s!==null){const h=e.getIndexWithinParent();if(un(i),P(o)){const g=s.__key,m=o.anchor,y=o.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=i.__key,d=r.__next;if(u===null?c.__last=f:u.getWritable().__prev=f,c.__size++,r.__next=f,i.__next=d,i.__prev=r.__key,i.__parent=r.__parent,t&&P(o)){const h=this.getIndexWithinParent();mi(o,c,h+1);const g=c.__key;a&&o.anchor.set(g,h+2,"element"),l&&o.focus.set(g,h+2,"element")}return e}insertBefore(e,t=!0){Pe(),as(this,e);const r=this.getWritable(),i=e.getWritable(),s=i.__key;un(i);const o=this.getPreviousSibling(),a=this.getParentOrThrow().getWritable(),l=r.__prev,u=this.getIndexWithinParent();o===null?a.__first=s:o.getWritable().__next=s,a.__size++,r.__prev=s,i.__prev=l,i.__next=r.__key,i.__parent=r.__parent;const c=M();return t&&P(c)&&mi(c,this.getParentOrThrow(),u),e}isParentRequired(){return!1}createParentElementNode(){return ve()}selectStart(){return this.selectPrevious()}selectEnd(){return this.selectNext(0,0)}selectPrevious(e,t){Pe();const r=this.getPreviousSibling(),i=this.getParentOrThrow();if(r===null)return i.select(0,0);if(k(r))return r.select();if(!$(r)){const s=r.getIndexWithinParent()+1;return i.select(s,s)}return r.select(e,t)}selectNext(e,t){Pe();const r=this.getNextSibling(),i=this.getParentOrThrow();if(r===null)return i.select();if(k(r))return r.select(0,0);if(!$(r)){const s=r.getIndexWithinParent();return i.select(s,s)}return r.select(e,t)}markDirty(){this.getWritable()}reconcileObservedMutation(e,t){this.markDirty()}}const cp="historic",Kn="history-merge",up="paste",Gu="collaboration",dp="skip-scroll-into-view",fp="skip-dom-selection",gp="skip-selection-focus";class Yn extends St{static getType(){return"linebreak"}static clone(e){return new Yn(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&&xi(r)){const i=r.firstChild;if(i===t||i.nextSibling===t&&zr(i)){const s=r.lastChild;if(s===t||s.previousSibling===t&&zr(s))return!0}}return!1})(e)||(function(t){const r=t.parentElement;if(r!==null&&xi(r)){const i=r.firstChild;if(i===t||i.nextSibling===t&&zr(i))return!1;const s=r.lastChild;if(s===t||s.previousSibling===t&&zr(s))return!0}return!1})(e)?null:{conversion:hp,priority:0}}}static importJSON(e){return ft().updateFromJSON(e)}}function hp(n){return{node:ft()}}function ft(){return at(new Yn)}function Ct(n){return n instanceof Yn}function zr(n){return jt(n)&&/^( |\t|\r?\n)+$/.test(n.textContent||"")}function ns(n,e){return 16&e?"code":e&fu?"mark":32&e?"sub":64&e?"sup":null}function rs(n,e){return 1&e?"strong":2&e?"em":"span"}function Zu(n,e,t,r,i){const s=r.classList;let o=Wn(i,"base");o!==void 0&&s.add(...o),o=Wn(i,"underlineStrikethrough");let a=!1;const l=8&e&&4&e;o!==void 0&&(8&t&&4&t?(a=!0,l||s.add(...o)):l&&s.remove(...o));for(const u in gn){const c=gn[u];if(o=Wn(i,u),o!==void 0)if(t&c){if(a&&(u==="underline"||u==="strikethrough")){e&c&&s.remove(...o);continue}((e&c)===0||l&&u==="underline"||u==="strikethrough")&&s.add(...o)}else e&c&&s.remove(...o)}}function Yu(n,e,t){const r=e.firstChild,i=t.isComposing(),s=n+(i?Ni:"");if(r==null)e.textContent=s;else{const o=r.nodeValue;if(o!==s)if(i||fn){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)]})(o,s);l!==0&&r.deleteData(a,l),r.insertData(a,u)}else r.nodeValue=s}}function qa(n,e,t,r,i,s){Yu(i,n,e);const o=s.theme.text;o!==void 0&&Zu(0,0,r,n,o)}function Ur(n,e){const t=document.createElement(e);return t.appendChild(n),t}class Ft extends St{__text;__format;__style;__mode;__detail;static getType(){return"text"}static clone(e){return new Ft(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 Mh[e.__mode]}getStyle(){return this.getLatest().__style}isToken(){return this.getLatest().__mode===1}isComposing(){return this.__key===Vt()}isSegmented(){return this.getLatest().__mode===2}isDirectionless(){return!!(1&this.getLatest().__detail)}isUnmergeable(){return!!(2&this.getLatest().__detail)}hasFormat(e){const t=gn[e];return(this.getFormat()&t)!==0}isSimpleText(){return this.__type==="text"&&this.__mode===0}getTextContent(){return this.getLatest().__text}getFormatFlags(e,t){return _i(this.getLatest().__format,e,t)}canHaveFormat(){return!0}isInline(){return!0}createDOM(e,t){const r=this.__format,i=ns(0,r),s=rs(0,r),o=i===null?s:i,a=document.createElement(o);let l=a;this.hasFormat("code")&&a.setAttribute("spellcheck","false"),i!==null&&(l=document.createElement(s),a.appendChild(l)),qa(l,this,0,r,this.__text,e);const u=this.__style;return u!==""&&(a.style.cssText=u),a}updateDOM(e,t,r){const i=this.__text,s=e.__format,o=this.__format,a=ns(0,s),l=ns(0,o),u=rs(0,s),c=rs(0,o);if((a===null?u:a)!==(l===null?c:l))return!0;if(a===l&&u!==c){const m=t.firstChild;m==null&&O(48);const y=document.createElement(c);return qa(y,this,0,o,i,r),t.replaceChild(y,m),!1}let f=t;l!==null&&a!==null&&(f=t.firstChild,f==null&&O(49)),Yu(i,f,this);const d=r.theme.text;d!==void 0&&s!==o&&Zu(0,s,o,f,d);const h=e.__style,g=this.__style;return h!==g&&(t.style.cssText=g),!1}static importDOM(){return{"#text":()=>({conversion:_p,priority:0}),b:()=>({conversion:mp,priority:0}),code:()=>({conversion:Ot,priority:0}),em:()=>({conversion:Ot,priority:0}),i:()=>({conversion:Ot,priority:0}),mark:()=>({conversion:Ot,priority:0}),s:()=>({conversion:Ot,priority:0}),span:()=>({conversion:pp,priority:0}),strong:()=>({conversion:Ot,priority:0}),sub:()=>({conversion:Ot,priority:0}),sup:()=>({conversion:Ot,priority:0}),u:()=>({conversion:Ot,priority:0})}}static importJSON(e){return xe().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 Se(t)||O(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=Ur(t,"b")),this.hasFormat("italic")&&(t=Ur(t,"i")),this.hasFormat("strikethrough")&&(t=Ur(t,"s")),this.hasFormat("underline")&&(t=Ur(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"?gn[e]:e,t}setDetail(e){const t=this.getWritable();return t.__detail=typeof e=="string"?Oh[e]:e,t}setStyle(e){const t=this.getWritable();return t.__style=e,t}toggleFormat(e){const t=_i(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=Rh[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){Pe();let r=e,i=t;const s=M(),o=this.getTextContent(),a=this.__key;if(typeof o=="string"){const l=o.length;r===void 0&&(r=l),i===void 0&&(i=l)}else r=0,i=0;if(!P(s))return ed(a,r,a,i,"text","text");{const l=Vt();l!==s.anchor.key&&l!==s.focus.key||Re(a),s.setTextNodeRange(this,r,this,i)}return s}selectStart(){return this.select(0,0)}selectEnd(){const e=this.getTextContentSize();return this.select(e,e)}spliceText(e,t,r,i){const s=this.getWritable(),o=s.__text,a=r.length;let l=e;l<0&&(l=a+l,l<0&&(l=0));const u=M();if(i&&P(u)){const f=e+a;u.setTextNodeRange(s,f,s,f)}const c=o.slice(0,l)+r+o.slice(l+t);return s.__text=c,s}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}splitText(...e){Pe();const t=this.getLatest(),r=t.getTextContent();if(r==="")return[];const i=t.__key,s=Vt(),o=r.length;e.sort((w,E)=>w-E),e.push(o);const a=[],l=e.length;for(let w=0,E=0;w<o&&E<=l;E++){const N=e[E];N>w&&(a.push(r.slice(w,N)),w=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 _=M();if(P(_)){const[w,E]=_.isBackward()?[_.focus,_.anchor]:[_.anchor,_.focus];w.type==="text"&&w.key===i&&(x=w),E.type==="text"&&E.key===i&&(p=E)}t.isSegmented()?(d=xe(c),d.__format=h,d.__style=g,d.__detail=m,d.__state=Ma(t,d),y=!0):d=t.setTextContent(c);const S=[d];for(let w=1;w<u;w++){const E=xe(a[w]);E.__format=h,E.__style=g,E.__detail=m,E.__state=Ma(t,E);const N=E.__key;s===i&&Re(N),S.push(E)}const C=x?x.offset:null,v=p?p.offset:null;let b=0;for(const w of S){if(!x&&!p)break;const E=b+w.getTextContentSize();if(x!==null&&C!==null&&C<=E&&C>=b&&(x.set(w.getKey(),C-b,"text"),C<E&&(x=null)),p!==null&&v!==null&&v<=E&&v>=b){p.set(w.getKey(),v-b,"text");break}b=E}if(f!==null){(function(N){const A=N.getPreviousSibling(),L=N.getNextSibling();A!==null&&vi(A),L!==null&&vi(L)})(this);const w=f.getWritable(),E=this.getIndexWithinParent();y?(w.splice(E,0,S),this.remove()):w.splice(E,1,S),P(_)&&mi(_,f,E,u-1)}return S}mergeWithSibling(e){const t=e===this.getPreviousSibling();t||e===this.getNextSibling()||O(50);const r=this.__key,i=e.__key,s=this.__text,o=s.length;Vt()===i&&Re(r);const a=M();if(P(a)){const f=a.anchor,d=a.focus;f!==null&&f.key===i&&nl(f,t,r,e,o),d!==null&&d.key===i&&nl(d,t,r,e,o)}const l=e.__text,u=t?l+s:s+l;this.setTextContent(u);const c=this.getWritable();return e.remove(),c}isTextEntity(){return!1}}function pp(n){return{forChild:Fo(n.style),node:null}}function mp(n){const e=n,t=e.style.fontWeight==="normal";return{forChild:Fo(e.style,t?void 0:"bold"),node:null}}const Ha=new WeakMap;function yp(n){if(!Se(n))return!1;if(n.nodeName==="PRE")return!0;const e=n.style.whiteSpace;return typeof e=="string"&&e.startsWith("pre")}function _p(n){const e=n;n.parentElement===null&&O(129);let t=e.textContent||"";if((function(r){let i,s=r.parentNode;const o=[r];for(;s!==null&&(i=Ha.get(s))===void 0&&!yp(s);)o.push(s),s=s.parentNode;const a=i===void 0?s:i;for(let l=0;l<o.length;l++)Ha.set(o[l],a);return a})(e)!==null){const r=t.split(/(\r?\n|\t)/),i=[],s=r.length;for(let o=0;o<s;o++){const a=r[o];a===`
|
|
7
|
-
`||a===`\r
|
|
8
|
-
`?i.push(ft()):a===" "?i.push(Qn()):a!==""&&i.push(xe(a))}return{node:i}}if(t=t.replace(/\r/g,"").replace(/[ \t\n]+/g," "),t==="")return{node:null};if(t[0]===" "){let r=e,i=!0;for(;r!==null&&(r=Ja(r,!1))!==null;){const s=r.textContent||"";if(s.length>0){/[ \t\n]$/.test(s)&&(t=t.slice(1)),i=!1;break}}i&&(t=t.slice(1))}if(t[t.length-1]===" "){let r=e,i=!0;for(;r!==null&&(r=Ja(r,!0))!==null;)if((r.textContent||"").replace(/^( |\t|\r?\n)+/,"").length>0){i=!1;break}i&&(t=t.slice(0,t.length-1))}return t===""?{node:null}:{node:xe(t)}}function Ja(n,e){let t=n;for(;;){let r;for(;(r=e?t.nextSibling:t.previousSibling)===null;){const s=t.parentElement;if(s===null)return null;t=s}if(t=r,Se(t)){const s=t.style.display;if(s===""&&!Xs(t)||s!==""&&!s.startsWith("inline"))return null}let i=t;for(;(i=e?t.firstChild:t.lastChild)!==null;)t=i;if(jt(t))return t;if(t.nodeName==="BR")return null}}const vp={code:"code",em:"italic",i:"italic",mark:"highlight",s:"strikethrough",strong:"bold",sub:"subscript",sup:"superscript",u:"underline"};function Ot(n){const e=vp[n.nodeName.toLowerCase()];return e===void 0?{node:null}:{forChild:Fo(n.style,e),node:null}}function xe(n=""){return at(new Ft(n))}function $(n){return n instanceof Ft}function Fo(n,e){const t=n.fontWeight,r=n.textDecoration.split(" "),i=t==="700"||t==="bold",s=r.includes("line-through"),o=n.fontStyle==="italic",a=r.includes("underline"),l=n.verticalAlign;return u=>($(u)&&(i&&!u.hasFormat("bold")&&u.toggleFormat("bold"),s&&!u.hasFormat("strikethrough")&&u.toggleFormat("strikethrough"),o&&!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 Xn extends Ft{static getType(){return"tab"}static clone(e){return new Xn(e.__key)}constructor(e){super(" ",e),this.__detail=2}static importDOM(){return null}createDOM(e){const t=super.createDOM(e),r=Wn(e.theme,"tab");return r!==void 0&&t.classList.add(...r),t}static importJSON(e){return Qn().updateFromJSON(e)}setTextContent(e){return e!==" "&&e!==""&&cu(126),super.setTextContent(" ")}spliceText(e,t,r,i){return r===""&&t===0||r===" "&&t===1||O(286),this}setDetail(e){return e!==2&&O(127),this}setMode(e){return e!=="normal"&&O(128),this}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}}function Qn(){return at(new Xn)}function Pi(n){return n instanceof Xn}class xp{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:Nd(Qe(At(this,"next")),Qe(At(e,"next")))<0}getNode(){const e=Te(this.key);return e===null&&O(20),e}set(e,t,r,i){const s=this._selection,o=this.key;i&&this.key===e&&this.offset===t&&this.type===r||(this.key=e,this.offset=t,this.type=r,Tr()||(Vt()===o&&Re(e),s!==null&&(s.setCachedNodes(null),s.dirty=!0)))}}function Nt(n,e,t){return new xp(n,e,t)}function is(n,e){let t=e.__key,r=n.offset,i="element";if($(e)){i="text";const s=e.getTextContentSize();r>s&&(r=s)}else if(!k(e)){const s=e.getNextSibling();if($(s))t=s.__key,r=0,i="text";else{const o=e.getParent();o&&(t=o.__key,r=e.getIndexWithinParent()+1)}}n.set(t,r,i)}function Ga(n,e){if(k(e)){const t=e.getLastDescendant();k(t)||$(t)?is(n,t):is(n,e)}else is(n,e)}class Ii{_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(!ke(e))return!1;const t=this._nodes,r=e._nodes;return t.size===r.size&&Array.from(t).every(i=>r.has(i))}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 Ii(new Set(this._nodes))}extract(){return this.getNodes()}insertRawText(e){}insertText(){}insertNodes(e){const t=this.getNodes(),r=t.length,i=t[r-1];let s;if($(i))s=i.select();else{const o=i.getIndexWithinParent()+1;s=i.getParentOrThrow().select(o,o)}s.insertNodes(e);for(let o=0;o<r;o++)t[o].remove()}getNodes(){const e=this._cachedNodes;if(e!==null)return e;const t=this._nodes,r=[];for(const i of t){const s=Te(i);s!==null&&r.push(s)}return Tr()||(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((M()||En())===this&&e[0]){const t=Ne(e[0],"next");Ad(Gt(t,t))}for(const t of e)t.remove()}}function P(n){return n instanceof Cn}class Cn{format;style;anchor;focus;_cachedNodes;dirty;constructor(e,t,r,i){this.anchor=e,this.focus=t,e._selection=this,t._selection=this,this._cachedNodes=null,this.format=r,this.style=i,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(e){this._cachedNodes=e}is(e){return!!P(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 i=[],[s,o]=r.getTextSlices();s&&i.push(s.caret.origin);const a=new Set,l=new Set;for(const u of r)if(rt(u)){const{origin:c}=u;i.length===0?a.add(c):(l.add(c),i.push(c))}else{const{origin:c}=u;k(c)&&l.has(c)||i.push(c)}if(o&&i.push(o.caret.origin),Jn(r.focus)&&k(r.focus.origin)&&r.focus.getNodeAtCaret()===null)for(let u=it(r.focus.origin,"previous");rt(u)&&a.has(u.origin)&&!u.origin.isEmpty()&&u.origin.is(i[i.length-1]);u=zi(u))a.delete(u.origin),i.pop();for(;i.length>1;){const u=i[i.length-1];if(!k(u)||l.has(u)||u.isEmpty()||a.has(u))break;i.pop()}if(i.length===0&&r.isCollapsed()){const u=Qe(r.anchor),c=Qe(r.anchor.getFlipped()),f=h=>wt(h)?h.origin:h.getNodeAtCaret(),d=f(u)||f(c)||(r.anchor.getNodeAtCaret()?u.origin:c.origin);i.push(d)}return i})(Pd(bl(this),"next"));return Tr()||(this._cachedNodes=t),t}setTextNodeRange(e,t,r,i){this.anchor.set(e.__key,t,"text"),this.focus.set(r.__key,i,"text")}getTextContent(){const e=this.getNodes();if(e.length===0)return"";const t=e[0],r=e[e.length-1],i=this.anchor,s=this.focus,o=i.isBefore(s),[a,l]=qs(this);let u="",c=!0;for(let f=0;f<e.length;f++){const d=e[f];if(k(d)&&!d.isInline())c||(u+=`
|
|
9
|
-
`),c=!d.isEmpty();else if(c=!1,$(d)){let h=d.getTextContent();d===t?d===r?i.type==="element"&&s.type==="element"&&s.offset!==i.offset||(h=a<l?h.slice(a,l):h.slice(l,a)):h=o?h.slice(a):h.slice(l):d===r&&(h=o?h.slice(0,l):h.slice(0,a)),u+=h}else!ae(d)&&!Ct(d)||d===r&&this.isCollapsed()||(u+=d.getTextContent())}return u}applyDOMRange(e){const t=me(),r=t.getEditorState()._selection,i=Qu(e.startContainer,e.startOffset,e.endContainer,e.endOffset,t,r);if(i===null)return;const[s,o]=i;this.anchor.set(s.key,s.offset,s.type,!0),this.focus.set(o.key,o.offset,o.type,!0),hn(this)}clone(){const e=this.anchor,t=this.focus;return new Cn(Nt(e.key,e.offset,e.type),Nt(t.key,t.offset,t.type),this.format,this.style)}toggleFormat(e){this.format=_i(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=gn[e];return(this.format&t)!==0}insertRawText(e){const t=e.split(/(\r?\n|\t)/),r=[],i=t.length;for(let s=0;s<i;s++){const o=t[s];o===`
|
|
10
|
-
`||o===`\r
|
|
11
|
-
`?r.push(ft()):o===" "?r.push(Qn()):r.push(xe(o))}this.insertNodes(r)}insertText(e){const t=this.anchor,r=this.focus,i=this.format,s=this.style;let o=t,a=r;!this.isCollapsed()&&r.isBefore(t)&&(o=r,a=t),o.type==="element"&&(function(y,x,p,_){const S=y.getNode(),C=S.getChildAtIndex(y.offset),v=xe();if(v.setFormat(p),v.setStyle(_),kr(C))C.splice(0,0,[v]);else{const b=Fe(S)?ve().append(v):v;C===null?S.append(b):C.insertBefore(b)}y.is(x)&&x.set(v.__key,0,"text"),y.set(v.__key,0,"text")})(o,a,i,s),a.type==="element"&&bn(a,Qe(At(a,"next")));const l=o.offset;let u=a.offset;const c=this.getNodes(),f=c.length;let d=c[0];$(d)||O(26);const h=d.getTextContent().length,g=d.getParentOrThrow();let m=c[f-1];if(f===1&&a.type==="element"&&(u=h,a.set(o.key,u,"text")),this.isCollapsed()&&l===h&&(Rt(d)||!d.canInsertTextAfter()||!g.canInsertTextAfter()&&d.getNextSibling()===null)){let y=d.getNextSibling();if($(y)&&y.canInsertTextBefore()&&!Rt(y)||(y=xe(),y.setFormat(i),y.setStyle(s),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&&(Rt(d)||!d.canInsertTextBefore()||!g.canInsertTextBefore()&&d.getPreviousSibling()===null)){let y=d.getPreviousSibling();if($(y)&&!Rt(y)||(y=xe(),y.setFormat(i),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=xe(d.getTextContent());y.setFormat(i),d.replace(y),d=y}else if(!this.isCollapsed()&&e!==""){const y=m.getParent();if(!g.canInsertTextBefore()||!g.canInsertTextAfter()||k(y)&&(!y.canInsertTextBefore()||!y.canInsertTextAfter()))return this.insertText(""),Xu(this.anchor,this.focus,null),void this.insertText(e)}if(f===1){if(cn(d)){const _=xe(e);return _.select(),void d.replace(_)}const y=d.getFormat(),x=d.getStyle();if(l!==u||y===i&&x===s){if(Pi(d)){const _=xe(e);return _.setFormat(i),_.setStyle(s),_.select(),void d.replace(_)}}else{if(d.getTextContent()!==""){const _=xe(e);if(_.setFormat(i),_.setStyle(s),_.select(),l===0)d.insertBefore(_,!1);else{const[S]=d.splitText(l);S.insertAfter(_,!1)}return void(_.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=e.length))}d.setFormat(i),d.setStyle(s)}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=k(d)?d:d.getParentOrThrow();let p=k(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($(m)&&!cn(m)&&u!==m.getTextContentSize()){if(m.isSegmented()){const w=xe(m.getTextContent());m.replace(w),m=w}Fe(a.getNode())||a.type!=="text"||(m=m.spliceText(0,u,"")),y.add(m.__key)}else{const w=m.getParentOrThrow();w.canBeEmpty()||w.getChildrenSize()!==1?m.remove():w.remove()}else y.add(m.__key);const S=p.getChildren(),C=new Set(c),v=x.is(p),b=x.isInline()&&d.getNextSibling()===null?x:d;for(let w=S.length-1;w>=0;w--){const E=S[w];if(E.is(d)||k(E)&&E.isParentOf(d))break;E.isAttached()&&(!C.has(E)||E.is(_)?v||b.insertAfter(E,!1):E.remove())}if(!v){let w=p,E=null;for(;w!==null;){const N=w.getChildren(),A=N.length;(A===0||N[A-1].is(E))&&(y.delete(w.__key),E=w),w=w.getParent()}}if(cn(d))if(l===h)d.select();else{const w=xe(e);w.select(),d.replace(w)}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 w=1;w<f;w++){const E=c[w],N=E.__key;y.has(N)||E.remove()}}}removeText(){const e=M()===this;ti(this,Zp(bl(this))),e&&M()!==this&&Me(this)}formatText(e,t=null){if(this.isCollapsed())return this.toggleFormat(e),void Re(null);const r=this.getNodes(),i=[];for(const S of r)$(S)&&i.push(S);const s=S=>{r.forEach(C=>{if(k(C)){const v=C.getFormatFlags(e,S);C.setTextFormat(v)}})},o=i.length;if(o===0)return this.toggleFormat(e),Re(null),void s(t);const a=this.anchor,l=this.focus,u=this.isBackward(),c=u?l:a,f=u?a:l;let d=0,h=i[0],g=c.type==="element"?0:c.offset;if(c.type==="text"&&g===h.getTextContentSize()&&(d=1,h=i[1],g=0),h==null)return;const m=h.getFormatFlags(e,t);s(m);const y=o-1;let x=i[y];const p=f.type==="text"?f.offset:x.getTextContentSize();if(h.is(x)){if(g===p)return;if(Rt(h)||g===0&&p===h.getTextContentSize())h.setFormat(m);else{const S=h.splitText(g,p),C=g===0?S[0]:S[1];C.setFormat(m),c.type==="text"&&c.set(C.__key,0,"text"),f.type==="text"&&f.set(C.__key,p-g,"text")}return void(this.format=m)}g===0||Rt(h)||([,h]=h.splitText(g),g=0),h.setFormat(m);const _=x.getFormatFlags(e,m);p>0&&(p===x.getTextContentSize()||Rt(x)||([x]=x.splitText(p)),x.setFormat(_));for(let S=d+1;S<y;S++){const C=i[S],v=C.getFormatFlags(e,_);C.setFormat(v)}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=M();return P(g)||O(134),g.insertNodes(e)}const t=(this.isBackward()?this.focus:this.anchor).getNode(),r=qe(t,Kt),i=e[e.length-1];if(k(r)&&"__language"in r){if("__language"in e[0])this.insertText(e[0].getTextContent());else{const g=ss(this);r.splice(g,0,e),i.selectEnd()}return}if(!e.some(g=>(k(g)||ae(g))&&!g.isInline())){k(r)||O(211,t.constructor.name,t.getType());const g=ss(this);return r.splice(g,0,e),void i.selectEnd()}const s=(function(g){const m=ve();let y=null;for(let x=0;x<g.length;x++){const p=g[x],_=Ct(p);if(_||ae(p)&&p.isInline()||k(p)&&p.isInline()||$(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),o=s.getLastDescendant(),a=s.getChildren(),l=!k(r)||!r.isEmpty()?this.insertParagraph():null,u=a[a.length-1];let c=a[0];var f;k(f=c)&&Kt(f)&&!f.isEmpty()&&k(r)&&(!r.isEmpty()||r.canMergeWhenEmpty())&&(k(r)||O(211,t.constructor.name,t.getType()),r.append(...c.getChildren()),c=a[1]),c&&(r===null&&O(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()||O(140),x=x.getNextSibling(),p.push(x);let _=g;for(const S of p)_=_.insertAfter(S)})(r,c));const d=qe(o,Kt);l&&k(d)&&(l.canMergeWhenEmpty()||Kt(u))&&(d.append(...l.getChildren()),l.remove()),k(r)&&r.isEmpty()&&r.remove(),o.selectEnd();const h=k(r)?r.getLastChild():null;Ct(h)&&d!==r&&h.remove()}insertParagraph(){if(this.anchor.key==="root"){const o=ve();return be().splice(this.anchor.offset,0,[o]),o.select(),o}const e=ss(this),t=qe(this.anchor.getNode(),Kt);k(t)||O(213);const r=t.getChildAtIndex(e),i=r?[r,...r.getNextSiblings()]:[],s=t.insertNewAfter(this,!1);return s?(s.append(...i),s.selectStart(),s):null}insertLineBreak(e){const t=ft();if(this.insertNodes([t]),e){const r=t.getParentOrThrow(),i=t.getIndexWithinParent();r.select(i,i)}}extract(){const e=[...this.getNodes()],t=e.length;let r=e[0],i=e[t-1];const[s,o]=qs(this),a=this.isBackward(),[l,u]=a?[this.focus,this.anchor]:[this.anchor,this.focus],[c,f]=a?[o,s]:[s,o];if(t===0)return[];if(t===1){if($(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($(r)&&(c===r.getTextContentSize()?e.shift():c!==0&&([,r]=r.splitText(c),e[0]=r,l.set(r.getKey(),0,"text"))),$(i)){const d=i.getTextContent().length;f===0?e.pop():f!==d&&([i]=i.splitText(f),e[e.length-1]=i,u.set(i.getKey(),i.getTextContentSize(),"text"))}return e}modify(e,t,r){if(rl(this,e,t,r))return;const i=e==="move",s=me(),o=pt(ot(s));if(!o)return;const a=s._blockCursorElement,l=s._rootElement,u=this.focus.getNode();if(l===null||a===null||!k(u)||u.isInline()||u.canBeEmpty()||Zs(a,s,l),this.dirty){let c=yn(s,this.anchor.key),f=yn(s,this.focus.key);this.anchor.type==="text"&&(c=Hn(c)),this.focus.type==="text"&&(f=Hn(f)),c&&f&&td(o,c,this.anchor.offset,f,this.focus.offset)}if((function(c,f,d,h){c.modify(f,d,h)})(o,e,t?"backward":"forward",r),o.rangeCount>0){const c=o.getRangeAt(0),f=this.anchor.getNode(),d=Fe(f)?f:Mp(f);if(this.applyDOMRange(c),this.dirty=!0,!i){const h=this.getNodes(),g=[];let m=!1;for(let y=0;y<h.length;y++){const x=h[y];Gs(x,d)?g.push(x):m=!0}if(m&&g.length>0)if(t){const y=g[0];k(y)?y.selectStart():y.getParentOrThrow().selectStart()}else{const y=g[g.length-1];k(y)?y.selectEnd():y.getParentOrThrow().selectEnd()}o.anchorNode===c.startContainer&&o.anchorOffset===c.startOffset||(function(y){const x=y.focus,p=y.anchor,_=p.key,S=p.offset,C=p.type;p.set(x.key,x.offset,x.type,!0),x.set(_,S,C,!0)})(this)}}r==="lineboundary"&&rl(this,e,t,r,"decorators")}forwardDeletion(e,t,r){if(!r&&(e.type==="element"&&k(t)&&e.offset===t.getChildrenSize()||e.type==="text"&&e.offset===t.getTextContentSize())){const i=t.getParent(),s=t.getNextSibling()||(i===null?null:i.getNextSibling());if(k(s)&&s.isShadowRoot())return!0}return!1}deleteCharacter(e){const t=this.isCollapsed();if(this.isCollapsed()){const r=this.anchor;let i=r.getNode();if(this.forwardDeletion(r,i,e))return;const s=Yo(At(r,e?"previous":"next"));if(s.getTextSlices().every(a=>a===null||a.distance===0)){let a={type:"initial"};for(const l of s.iterNodeCarets("shadowRoot"))if(rt(l)){if(!l.origin.isInline()){if(l.origin.isShadowRoot()){if(a.type==="merge-block")break;if(k(s.anchor.origin)&&s.anchor.origin.isEmpty()){const u=Qe(l);ti(this,Gt(u,u)),s.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(Jn(l)){if(k(l.origin)){if(l.origin.isInline()){if(!l.origin.isParentOf(s.anchor.origin))break}else a={block:l.origin,type:"merge-next-block"};continue}if(ae(l.origin)){if(!l.origin.isIsolated())if(a.type==="merge-next-block"&&(l.origin.isKeyboardSelectable()||!l.origin.isInline())&&k(s.anchor.origin)&&s.anchor.origin.isEmpty()){s.anchor.origin.remove();const u=Po();u.add(l.origin.getKey()),Me(u)}else l.origin.remove();return}break}}if(a.type==="merge-block"){const{caret:l,block:u}=a;return ti(this,Gt(!l.origin.isEmpty()&&u.isEmpty()?Pr(Ne(u,l.direction)):s.anchor,l)),this.removeText()}}const o=this.focus;if(this.modify("extend",e,"character"),this.isCollapsed()){if(e&&r.offset===0&&Ya(this,r.getNode()))return}else{const a=o.type==="text"?o.getNode():null;if(i=r.type==="text"?r.getNode():null,a!==null&&a.isSegmented()){const l=o.offset,u=a.getTextContentSize();if(a.is(i)||e&&l!==u||!e&&l!==0)return void Xa(a,e,l)}else if(i!==null&&i.isSegmented()){const l=r.offset,u=i.getTextContentSize();if(i.is(a)||e&&l!==0||!e&&l!==u)return void Xa(i,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(S){return!(_d(S)||bp(S))})(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()&&Fe(r.getParent())&&r.getPreviousSibling()===null&&Ya(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 ke(n){return n instanceof Ii}function Za(n){const e=n.offset;if(n.type==="text")return e;const t=n.getNode();return e===t.getChildrenSize()?t.getTextContent().length:0}function qs(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]:[Za(t),Za(r)]}function Ya(n,e){for(let t=e;t;t=t.getParent()){if(k(t)){if(t.collapseAtStart(n))return!0;if(ze(t))break}if(t.getPreviousSibling())break}return!1}const bp=(()=>{try{const n=new RegExp("\\p{Emoji}","u"),e=n.test.bind(n);if(e("❤️")&&e("#️⃣")&&e("👍"))return e}catch{}return()=>!1})();function Xa(n,e,t){const r=n,i=r.getTextContent().split(/(?=\s)/g),s=i.length;let o=0,a=0;for(let u=0;u<s;u++){const c=u===s-1;if(a=o,o+=i[u].length,e&&o===t||o>t||c){i.splice(u,1),c&&(a=void 0);break}}const l=i.join("").trim();l===""?r.remove():(r.setTextContent(l),r.select(a,a))}function Qa(n,e,t,r){let i,s=e;if(Se(n)){let o=!1;const a=n.childNodes,l=a.length,u=r._blockCursorElement;s===l&&(o=!0,s=l-1);let c=a[s],f=!1;if(c===u)c=a[s+1],f=!0;else if(u!==null){const d=u.parentNode;n===d&&e>Array.prototype.indexOf.call(d.children,u)&&s--}if(i=Dn(c),$(i))s=Tt(i,o?"next":"previous");else{let d=Dn(n);if(d===null)return null;if(k(d)){const h=r.getElementByKey(d.getKey());h===null&&O(214),[d,s]=d.getDOMSlot(h).resolveChildIndex(d,h,n,e),k(d)||O(215),o&&s>=d.getChildrenSize()&&(s=Math.max(0,d.getChildrenSize()-1));let m=d.getChildAtIndex(s);if(k(m)&&(function(y,x,p){const _=y.getParent();return p===null||_===null||!_.canBeEmpty()||_!==p.getNode()})(m,0,t)){const y=o?m.getLastDescendant():m.getFirstDescendant();y===null?d=m:(m=y,d=k(m)?m:m.getParentOrThrow()),s=0}$(m)?(i=m,d=null,s=Tt(m,o?"next":"previous")):m!==d&&o&&!f&&(k(d)||O(216),s=Math.min(d.getChildrenSize(),s+1))}else{const h=d.getIndexWithinParent();s=e===0&&ae(d)&&Dn(n)===d?h:h+1,d=d.getParentOrThrow()}if(k(d))return Nt(d.__key,s,"element")}}else i=Dn(n);return $(i)?Nt(i.__key,Tt(i,s,"clamp"),"text"):null}function el(n,e,t){const r=n.offset,i=n.getNode();if(r===0){const s=i.getPreviousSibling(),o=i.getParent();if(e){if((t||!e)&&s===null&&k(o)&&o.isInline()){const a=o.getPreviousSibling();$(a)&&n.set(a.__key,a.getTextContent().length,"text")}}else k(s)&&!t&&s.isInline()?n.set(s.__key,s.getChildrenSize(),"element"):$(s)&&n.set(s.__key,s.getTextContent().length,"text")}else if(r===i.getTextContent().length){const s=i.getNextSibling(),o=i.getParent();if(e&&k(s)&&s.isInline())n.set(s.__key,0,"element");else if((t||e)&&s===null&&k(o)&&o.isInline()&&!o.canInsertTextAfter()){const a=o.getNextSibling();$(a)&&n.set(a.__key,0,"text")}}}function Xu(n,e,t){if(n.type==="text"&&e.type==="text"){const r=n.isBefore(e),i=n.is(e);el(n,r,i),el(e,!r,i),i&&e.set(n.key,n.offset,n.type);const s=me();if(s.isComposing()&&s._compositionKey!==n.key&&P(t)){const o=t.anchor,a=t.focus;n.set(o.key,o.offset,o.type,!0),e.set(a.key,a.offset,a.type,!0)}}}function Qu(n,e,t,r,i,s){if(n===null||t===null||!Ar(i,n,t))return null;const o=Qa(n,e,P(s)?s.anchor:null,i);if(o===null)return null;const a=Qa(t,r,P(s)?s.focus:null,i);if(a===null)return null;if(o.type==="element"&&a.type==="element"){const l=Dn(n),u=Dn(t);if(ae(l)&&ae(u))return null}return Xu(o,a,s),[o,a]}function pi(n){return k(n)&&!n.isInline()}function ed(n,e,t,r,i,s){const o=Zt(),a=new Cn(Nt(n,e,i),Nt(t,r,s),0,"");return a.dirty=!0,o._selection=a,a}function Oi(){const n=Nt("root",0,"element"),e=Nt("root",0,"element");return new Cn(n,e,0,"")}function Po(){return new Ii(new Set)}function Io(n,e,t,r){const i=t._window;if(i===null)return null;const s=r||i.event,o=s?s.type:void 0,a=o==="selectionchange",l=!Ns&&(a||o==="beforeinput"||o==="compositionstart"||o==="compositionend"||o==="click"&&s&&s.detail===3||o==="drop"||o===void 0);let u,c,f,d;if(P(n)&&!l)return n.clone();if(e===null)return null;if(u=e.anchorNode,c=e.focusNode,f=e.anchorOffset,d=e.focusOffset,(a||o===void 0)&&P(n)&&!Ar(t,u,c))return n.clone();const h=Qu(u,f,c,d,t,n);if(h===null)return null;const[g,m]=h;return new Cn(g,m,P(n)?n.format:0,P(n)?n.style:"")}function M(){return Zt()._selection}function En(){return me()._editorState._selection}function mi(n,e,t,r=1){const i=n.anchor,s=n.focus,o=i.getNode(),a=s.getNode();if(!e.is(o)&&!e.is(a))return;const l=e.__key;if(n.isCollapsed()){const u=i.offset;if(t<=u&&r>0||t<u&&r<0){const c=Math.max(0,u+r);i.set(l,c,"element"),s.set(l,c,"element"),tl(n)}}else{const u=n.isBackward(),c=u?s:i,f=c.getNode(),d=u?i:s,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")}}tl(n)}function tl(n){const e=n.anchor,t=e.offset,r=n.focus,i=r.offset,s=e.getNode(),o=r.getNode();if(n.isCollapsed()){if(!k(s))return;const a=s.getChildrenSize(),l=t>=a,u=l?s.getChildAtIndex(a-1):s.getChildAtIndex(t);if($(u)){let c=0;l&&(c=u.getTextContentSize()),e.set(u.__key,c,"text"),r.set(u.__key,c,"text")}return}if(k(s)){const a=s.getChildrenSize(),l=t>=a,u=l?s.getChildAtIndex(a-1):s.getChildAtIndex(t);if($(u)){let c=0;l&&(c=u.getTextContentSize()),e.set(u.__key,c,"text")}}if(k(o)){const a=o.getChildrenSize(),l=i>=a,u=l?o.getChildAtIndex(a-1):o.getChildAtIndex(i);if($(u)){let c=0;l&&(c=u.getTextContentSize()),r.set(u.__key,c,"text")}}}function yi(n,e,t,r,i){let s=null,o=0,a=null;r!==null?(s=r.__key,$(r)?(o=r.getTextContentSize(),a="text"):k(r)&&(o=r.getChildrenSize(),a="element")):i!==null&&(s=i.__key,$(i)?a="text":k(i)&&(a="element")),s!==null&&a!==null?n.set(s,o,a):(o=e.getIndexWithinParent(),o===-1&&(o=t.getChildrenSize()),n.set(t.__key,o,"element"))}function nl(n,e,t,r,i){n.type==="text"?n.set(t,n.offset+(e?0:i),"text"):n.offset>r.getIndexWithinParent()&&n.set(n.key,n.offset-1,"element")}function td(n,e,t,r,i){try{n.setBaseAndExtent(e,t,r,i)}catch{}}function Sp(n,e,t,r,i,s,o){const a=r.anchorNode,l=r.focusNode,u=r.anchorOffset,c=r.focusOffset,f=document.activeElement;if(i.has(Gu)&&f!==s||f!==null&&Bo(f))return;if(!P(e))return void(n!==null&&Ar(t,a,l)&&r.removeAllRanges());const d=e.anchor,h=e.focus,g=d.key,m=h.key,y=yn(t,g),x=yn(t,m),p=d.offset,_=h.offset,S=e.format,C=e.style,v=e.isCollapsed();let b=y,w=x,E=!1;if(d.type==="text"){b=Hn(y);const D=d.getNode();E=D.getFormat()!==S||D.getStyle()!==C}else P(n)&&n.anchor.type==="text"&&(E=!0);var N,A,L,R,I;if(h.type==="text"&&(w=Hn(x)),b!==null&&w!==null&&(v&&(n===null||E||P(n)&&(n.format!==S||n.style!==C))&&(N=S,A=C,L=p,R=g,I=performance.now(),Uu=[N,A,L,R,I]),u!==p||c!==_||a!==b||l!==w||r.type==="Range"&&v||(f!==null&&s.contains(f)||i.has(gp)||s.focus({preventScroll:!0}),d.type==="element"))){if(td(r,b,p,w,_),!i.has(dp)&&e.isCollapsed()&&s!==null&&s===document.activeElement){const D=P(e)&&e.anchor.type==="element"?b.childNodes[p]||null:r.rangeCount>0?r.getRangeAt(0):null;if(D!==null){let K;if(D instanceof Text){const j=document.createRange();j.selectNode(D),K=j.getBoundingClientRect()}else K=D.getBoundingClientRect();(function(j,U,B){const re=Sd(B),te=Vo(re);if(re===null||te===null)return;let{top:G,bottom:de}=U,V=0,Y=0,X=B;for(;X!==null;){const le=X===re.body;if(le)V=0,Y=ot(j).innerHeight;else{const Q=X.getBoundingClientRect();V=Q.top,Y=Q.bottom}let Z=0;if(G<V?Z=-(V-G):de>Y&&(Z=de-Y),Z!==0)if(le)te.scrollBy(0,Z);else{const Q=X.scrollTop;X.scrollTop+=Z;const he=X.scrollTop-Q;G-=he,de-=he}if(le)break;X=Fr(X)}})(t,K,s)}}zs=!0}}function Cp(n){let e=M()||En();e===null&&(e=be().selectEnd()),e.insertNodes(n)}function ss(n){let e=n;n.isCollapsed()||e.removeText();const t=M();P(t)&&(e=t),P(e)||O(161);const r=e.anchor;let i=r.getNode(),s=r.offset;for(;!Kt(i);){const o=i;if([i,s]=Ep(i,s),o.is(i))break}return s}function Ep(n,e){const t=n.getParent();if(!t){const i=ve();return be().append(i),i.select(),[be(),0]}if($(n)){const i=n.splitText(e);if(i.length===0)return[t,n.getIndexWithinParent()];const s=e===0?0:1;return[t,i[0].getIndexWithinParent()+s]}if(!k(n)||e===0)return[t,n.getIndexWithinParent()];const r=n.getChildAtIndex(e);if(r){const i=new Cn(Nt(n.__key,e,"element"),Nt(n.__key,e,"element"),0,""),s=n.insertNewAfter(i);s&&s.append(r,...r.getNextSiblings())}return[t,n.getIndexWithinParent()+1]}function rl(n,e,t,r,i="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 s=At(n.focus,t?"previous":"next"),o=r==="lineboundary",a=e==="move";let l=s,u=i==="decorators-and-blocks";if(!Fd(l)){for(const c of l){u=!1;const{origin:f}=c;if(!ae(f)||f.isIsolated()||(l=c,!o||!f.isInline()))break}if(u)for(const c of Yo(s).iterNodeCarets(e==="extend"?"shadowRoot":"root")){if(rt(c))c.origin.isInline()||(l=c);else{if(k(c.origin))continue;ae(c.origin)&&!c.origin.isInline()&&(l=c)}break}}if(l===s)return!1;if(a&&!o&&ae(l.origin)&&l.origin.isKeyboardSelectable()){const c=Po();return c.add(l.origin.getKey()),Me(c),!0}return l=Qe(l),a&&bn(n.anchor,l),bn(n.focus,l),u||!o}let Ie=null,Oe=null,Je=!1,os=!1,Qr=0;const il={characterData:!0,childList:!0,subtree:!0};function Tr(){return Je||Ie!==null&&Ie._readOnly}function Pe(){Je&&O(13)}function nd(){Qr>99&&O(14)}function Zt(){return Ie===null&&O(195,rd()),Ie}function me(){return Oe===null&&O(196,rd()),Oe}function rd(){let n=0;const e=new Set,t=qn.version;if(typeof window<"u")for(const i of document.querySelectorAll("[contenteditable]")){const s=Mi(i);if(jo(s))n++;else if(s){let o=String(s.constructor.version||"<0.17.1");o===t&&(o+=" (separately built, likely a bundler configuration issue)"),e.add(o)}}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 wp(){return Oe}function sl(n,e,t){const r=e.__type,i=ud(n,r);let s=t.get(r);s===void 0&&(s=Array.from(i.transforms),t.set(r,s));const o=s.length;for(let a=0;a<o&&(s[a](e),e.isAttached());a++);}function ol(n,e){return n!==void 0&&n.__key!==e&&n.isAttached()}function id(n,e){if(!e)return;const t=n._updateTags;let r=e;Array.isArray(e)||(r=[e]);for(const i of r)t.add(i)}function Tp(n){return Oo(n,me()._nodes)}function Oo(n,e){const t=n.type,r=e.get(t);r===void 0&&O(17,t);const i=r.klass;n.type!==i.getType()&&O(18,i.name);const s=i.importJSON(n),o=n.children;if(k(s)&&Array.isArray(o))for(let a=0;a<o.length;a++){const l=Oo(o[a],e);s.append(l)}return s}function al(n,e,t){const r=Ie,i=Je,s=Oe;Ie=e,Je=!0,Oe=n;try{return t()}finally{Ie=r,Je=i,Oe=s}}function Lt(n,e){const t=n._pendingEditorState,r=n._rootElement,i=n._headless||r===null;if(t===null)return;const s=n._editorState,o=s._selection,a=t._selection,l=n._dirtyType!==0,u=Ie,c=Je,f=Oe,d=n._updating,h=n._observer;let g=null;if(n._pendingEditorState=null,n._editorState=t,!i&&l&&h!==null){Oe=n,Ie=t,Je=!1,n._updating=!0;try{const v=n._dirtyType,b=n._dirtyElements,w=n._dirtyLeaves;h.disconnect(),g=Jh(s,t,n,v,b,w)}catch(v){if(v instanceof Error&&n._onError(v),os)throw v;return ld(n,null,r,t),mu(n),n._dirtyType=2,os=!0,Lt(n,s),void(os=!1)}finally{h.observe(r,il),n._updating=d,Ie=u,Je=c,Oe=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(v,b){const w=v._decorators;let E=v._pendingDecorators||w;const N=b._nodeMap;let A;for(A in E)N.has(A)||(E===w&&(E=md(v)),delete E[A])})(n,t);const S=i?null:pt(ot(n));if(n._editable&&S!==null&&(l||a===null||a.dirty||!a.is(o))&&r!==null&&!p.has(fp)){Oe=n,Ie=t;try{if(h!==null&&h.disconnect(),l||a===null||a.dirty){const v=n._blockCursorElement;v!==null&&Zs(v,n,r),Sp(o,a,n,S,p,r)}(function(v,b,w){let E=v._blockCursorElement;if(P(w)&&w.isCollapsed()&&w.anchor.type==="element"&&b.contains(document.activeElement)){const N=w.anchor,A=N.getNode(),L=N.offset;let R=!1,I=null;if(L===A.getChildrenSize())ls(A.getChildAtIndex(L-1))&&(R=!0);else{const D=A.getChildAtIndex(L);if(D!==null&&ls(D)){const K=D.getPreviousSibling();(K===null||ls(K))&&(R=!0,I=v.getElementByKey(D.__key))}}if(R){const D=v.getElementByKey(A.__key);return E===null&&(v._blockCursorElement=E=(function(K){const j=K.theme,U=document.createElement("div");U.contentEditable="false",U.setAttribute("data-lexical-cursor","true");let B=j.blockCursor;if(B!==void 0){if(typeof B=="string"){const re=du(B);B=j.blockCursor=re}B!==void 0&&U.classList.add(...B)}return U})(v._config)),b.style.caretColor="transparent",void(I===null?D.appendChild(E):D.insertBefore(E,I))}}E!==null&&Zs(E,v,b)})(n,r,a)}finally{h!==null&&h.observe(r,il),Oe=f,Ie=u}}g!==null&&(function(v,b,w,E,N){const A=Array.from(v._listeners.mutation),L=A.length;for(let R=0;R<L;R++){const[I,D]=A[R];for(const K of D){const j=b.get(K);j!==void 0&&I(j,{dirtyLeaves:E,prevEditorState:N,updateTags:w})}}})(n,g,p,m,s),P(a)||a===null||o!==null&&o.is(a)||n.dispatchCommand(wu,void 0);const C=n._pendingDecorators;C!==null&&(n._decorators=C,n._pendingDecorators=null,gr("decorator",n,!0,C)),(function(v,b,w){const E=dl(b),N=dl(w);E!==N&&gr("textcontent",v,!0,N)})(n,e||s,t),gr("update",n,!0,{dirtyElements:y,dirtyLeaves:m,editorState:t,mutatedNodes:g,normalizedNodes:x,prevEditorState:e||s,tags:p}),(function(v,b){if(v._deferred=[],b.length!==0){const w=v._updating;v._updating=!0;try{for(let E=0;E<b.length;E++)b[E]()}finally{v._updating=w}}})(n,_),(function(v){const b=v._updates;if(b.length!==0){const w=b.shift();if(w){const[E,N]=w;$i(v,E,N)}}})(n)}function gr(n,e,t,...r){const i=e._updating;e._updating=t;try{const s=Array.from(e._listeners[n]);for(let o=0;o<s.length;o++)s[o].apply(null,r)}finally{e._updating=i}}function ll(n,e){const t=n._updates;let r=e||!1;for(;t.length!==0;){const i=t.shift();if(i){const[s,o]=i,a=n._pendingEditorState;let l;o!==void 0&&(l=o.onUpdate,o.skipTransforms&&(r=!0),o.discrete&&(a===null&&O(191),a._flushSync=!0),l&&n._deferred.push(l),id(n,o.tag)),a==null?$i(n,s,o):s()}}return r}function $i(n,e,t){const r=n._updateTags;let i,s=!1,o=!1;t!==void 0&&(i=t.onUpdate,id(n,t.tag),s=t.skipTransforms||!1,o=t.discrete||!1),i&&n._deferred.push(i);const a=n._editorState;let l=n._pendingEditorState,u=!1;(l===null||l._readOnly)&&(l=n._pendingEditorState=sd(l||a),u=!0),l._flushSync=o;const c=Ie,f=Je,d=Oe,h=n._updating;Ie=l,Je=!1,n._updating=!0,Oe=n;const g=n._headless||n.getRootElement()===null;Lo(null);try{u&&(g?a._selection!==null&&(l._selection=a._selection.clone()):l._selection=(function(p,_){const S=p.getEditorState()._selection,C=pt(ot(p));return P(S)||S==null?Io(S,C,p,_):S.clone()})(n,t&&t.event||null));const y=n._compositionKey;e(),s=ll(n,s),(function(p,_){const S=_.getEditorState()._selection,C=p._selection;if(P(C)){const v=C.anchor,b=C.focus;let w;if(v.type==="text"&&(w=v.getNode(),w.selectionTransform(S,C)),b.type==="text"){const E=b.getNode();w!==E&&E.selectionTransform(S,C)}}})(l,n),n._dirtyType!==0&&(s?(function(p,_){const S=_._dirtyLeaves,C=p._nodeMap;for(const v of S){const b=C.get(v);$(b)&&b.isAttached()&&b.isSimpleText()&&!b.isUnmergeable()&&Ba(b)}})(l,n):(function(p,_){const S=_._dirtyLeaves,C=_._dirtyElements,v=p._nodeMap,b=Vt(),w=new Map;let E=S,N=E.size,A=C,L=A.size;for(;N>0||L>0;){if(N>0){_._dirtyLeaves=new Set;for(const R of E){const I=v.get(R);$(I)&&I.isAttached()&&I.isSimpleText()&&!I.isUnmergeable()&&Ba(I),I!==void 0&&ol(I,b)&&sl(_,I,w),S.add(R)}if(E=_._dirtyLeaves,N=E.size,N>0){Qr++;continue}}_._dirtyLeaves=new Set,_._dirtyElements=new Map,A.delete("root")&&A.set("root",!0);for(const R of A){const I=R[0],D=R[1];if(C.set(I,D),!D)continue;const K=v.get(I);K!==void 0&&ol(K,b)&&sl(_,K,w)}E=_._dirtyLeaves,N=E.size,A=_._dirtyElements,L=A.size,Qr++}_._dirtyLeaves=S,_._dirtyElements=C})(l,n),ll(n),(function(p,_,S,C){const v=p._nodeMap,b=_._nodeMap,w=[];for(const[E]of C){const N=b.get(E);N!==void 0&&(N.isAttached()||(k(N)&&gu(N,E,v,b,w,C),v.has(E)||C.delete(E),w.push(E)))}for(const E of w)b.delete(E);for(const E of S){const N=b.get(E);N===void 0||N.isAttached()||(v.has(E)||S.delete(E),b.delete(E))}})(a,l,n._dirtyLeaves,n._dirtyElements)),y!==n._compositionKey&&(l._flushSync=!0);const x=l._selection;if(P(x)){const p=l._nodeMap,_=x.anchor.key,S=x.focus.key;p.get(_)!==void 0&&p.get(S)!==void 0||O(19)}else ke(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 Lt(n)}finally{Ie=c,Je=f,Oe=d,n._updating=h,Qr=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,Lt(n)):u&&Pp(()=>{Lt(n)}):(l._flushSync=!1,u&&(r.clear(),n._deferred=[],n._pendingEditorState=null))}function Et(n,e,t){Oe===n&&t===void 0?e():$i(n,e,t)}class hr{element;before;after;constructor(e,t,r){this.element=e,this.before=t||null,this.after=r||null}withBefore(e){return new hr(this.element,e,this.after)}withAfter(e){return new hr(this.element,this.before,e)}withElement(e){return this.element===e?this:new hr(e,this.before,this.after)}insertChild(e){const t=this.before||this.getManagedLineBreak();return t!==null&&t.parentElement!==this.element&&O(222),this.element.insertBefore(e,t),this}removeChild(e){return e.parentElement!==this.element&&O(223),this.element.removeChild(e),this}replaceChild(e,t){return t.parentElement!==this.element&&O(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"&&(wr||Zn||Er);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,i=this.before,s=document.createElement("br");if(r.insertBefore(s,i),e){const o=document.createElement("img");o.setAttribute("data-lexical-linebreak","true"),o.style.cssText="display: inline !important; border: 0px !important; margin: 0px !important;",o.alt="",r.insertBefore(o,s),r.__lexicalLineBreak=o}else r.__lexicalLineBreak=s}getFirstChildOffset(){let e=0;for(let t=this.after;t!==null;t=t.previousSibling)e++;return e}resolveChildIndex(e,t,r,i){if(r===this.element){const l=this.getFirstChildOffset();return[e,Math.min(l+e.getChildrenSize(),Math.max(l,i))]}const s=cl(t,r);s.push(i);const o=cl(t,this.element);let a=e.getIndexWithinParent();for(let l=0;l<o.length;l++){const u=s[l],c=o[l];if(u===void 0||u<c)break;if(u>c){a+=1;break}}return[e.getParentOrThrow(),a]}}function cl(n,e){const t=[];let r=e;for(;r!==n&&r!==null;r=r.parentNode){let i=0;for(let s=r.previousSibling;s!==null;s=s.previousSibling)i++;t.push(i)}return r!==n&&O(225),t.reverse()}class et extends St{__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 $h[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=me()._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($(t)&&e.push(t),k(t)){const r=t.getAllTextNodes();e.push(...r)}t=t.getNextSibling()}return e}getFirstDescendant(){let e=this.getFirstChild();for(;k(e);){const t=e.getFirstChild();if(t===null)break;e=t}return e}getLastDescendant(){let e=this.getLastChild();for(;k(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 s=t[r-1];return k(s)&&s.getLastDescendant()||s||null}const i=t[e];return k(i)&&i.getFirstDescendant()||i||null}getFirstChild(){const e=this.getLatest().__first;return e===null?null:Te(e)}getFirstChildOrThrow(){const e=this.getFirstChild();return e===null&&O(45,this.__key),e}getLastChild(){const e=this.getLatest().__last;return e===null?null:Te(e)}getLastChildOrThrow(){const e=this.getLastChild();return e===null&&O(96,this.__key),e}getChildAtIndex(e){const t=this.getChildrenSize();let r,i;if(e<t/2){for(r=this.getFirstChild(),i=0;r!==null&&i<=e;){if(i===e)return r;r=r.getNextSibling(),i++}return null}for(r=this.getLastChild(),i=t-1;r!==null&&i>=e;){if(i===e)return r;r=r.getPreviousSibling(),i--}return null}getTextContent(){let e="";const t=this.getChildren(),r=t.length;for(let i=0;i<r;i++){const s=t[i];e+=s.getTextContent(),k(s)&&i!==r-1&&!s.isInline()&&(e+=Jt)}return e}getTextContentSize(){let e=0;const t=this.getChildren(),r=t.length;for(let i=0;i<r;i++){const s=t[i];e+=s.getTextContentSize(),k(s)&&i!==r-1&&!s.isInline()&&(e+=2)}return e}getDirection(){return this.getLatest().__dir}getTextFormat(){return this.getLatest().__textFormat}hasFormat(e){if(e!==""){const t=Pa[e];return(this.getFormat()&t)!==0}return!1}hasTextFormat(e){const t=gn[e];return(this.getTextFormat()&t)!==0}getFormatFlags(e,t){return _i(this.getLatest().__textFormat,e,t)}getTextStyle(){return this.getLatest().__textStyle}select(e,t){Pe();const r=M();let i=e,s=t;const o=this.getChildrenSize();if(!this.canBeEmpty()){if(e===0&&t===0){const l=this.getFirstChild();if($(l)||k(l))return l.select(0,0)}else if(!(e!==void 0&&e!==o||t!==void 0&&t!==o)){const l=this.getLastChild();if($(l)||k(l))return l.select()}}i===void 0&&(i=o),s===void 0&&(s=o);const a=this.__key;return P(r)?(r.anchor.set(a,i,"element"),r.focus.set(a,s,"element"),r.dirty=!0,r):ed(a,i,a,s,"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!==""?Pa[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){hi(this)&&O(324,this.__key,this.__type);const i=this.getChildrenSize(),s=this.getWritable();e+t<=i||O(226,String(e),String(t),String(i));const o=s.__key,a=[],l=[],u=this.getChildAtIndex(e+t);let c=null,f=i-t+r.length;if(e!==0)if(e===i)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&&O(100);const m=h.getNextSibling(),y=h.__key;un(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===o&&f--,un(g);const m=h.__key;if(d===null)s.__first=m,g.__prev=null;else{const y=d.getWritable();y.__next=m,g.__prev=y.__key}h.__key===o&&O(76),g.__parent=o,a.push(m),d=h}if(e+t===i)d!==null&&(d.getWritable().__next=null,s.__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(s.__size=f,l.length){const h=M();if(P(h)){const g=new Set(l),m=new Set(a),{anchor:y,focus:x}=h;ul(y,g,m)&&yi(y,y.getNode(),this,c,u),ul(x,g,m)&&yi(x,x.getNode(),this,c,u),f!==0||this.canBeEmpty()||ze(this)||this.remove()}}return s}getDOMSlot(e){return new hr(e)}exportDOM(e){const{element:t}=super.exportDOM(e);if(Se(t)){const r=this.getIndent();r>0&&(t.style.paddingInlineStart=40*r+"px");const i=this.getDirection();i&&(t.dir=i)}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===""||ze(this)||this.getChildren().some($)||(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 i=r.getFirstChild();for(let s=this.getFirstChild();s;s=s.getNextSibling()){const o=t.getElementByKey(s.getKey());o!==null&&(i==null?(r.insertChild(o),i=o):i!==o&&r.replaceChild(o,i),i=i.nextSibling)}}}function k(n){return n instanceof et}function ul(n,e,t){let r=n.getNode();for(;r;){const i=r.__key;if(e.has(i)&&!t.has(i))return!0;r=r.getParent()}return!1}class $o extends St{decorate(e,t){return null}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}}function ae(n){return n instanceof $o}class er extends et{__cachedText;static getType(){return"root"}static clone(){return new er}constructor(){super("root"),this.__cachedText=null}getTopLevelElementOrThrow(){O(51)}getTextContent(){const e=this.__cachedText;return!Tr()&&me()._dirtyType!==0||e===null?super.getTextContent():e}remove(){O(52)}replace(e){O(53)}insertBefore(e){O(54)}insertAfter(e){O(55)}updateDOM(e,t){return!1}splice(e,t,r){for(const i of r)k(i)||ae(i)||O(282);return super.splice(e,t,r)}static importJSON(e){return be().updateFromJSON(e)}collapseAtStart(){return!0}}function Fe(n){return n instanceof er}function sd(n){return new Nr(new Map(n._nodeMap))}function Ro(){return new Nr(new Map([["root",new er]]))}function od(n){const e=n.exportJSON(),t=n.constructor;if(e.type!==t.getType()&&O(130,t.name),k(n)){const r=e.children;Array.isArray(r)||O(59,t.name);const i=n.getChildren();for(let s=0;s<i.length;s++){const o=od(i[s]);r.push(o)}}return e}function Np(n){return n instanceof Nr}class Nr{_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 al(t&&t.editor||null,this,e)}clone(e){const t=new Nr(this._nodeMap,e===void 0?this._selection:e);return t._readOnly=!0,t}toJSON(){return al(null,this,()=>({root:od(be())}))}}class Mo extends et{static getType(){return"artificial"}createDOM(e){return document.createElement("div")}}class tr extends et{static getType(){return"paragraph"}static clone(e){return new tr(e.__key)}createDOM(e){const t=document.createElement("p"),r=Wn(e.theme,"paragraph");return r!==void 0&&t.classList.add(...r),t}updateDOM(e,t,r){return!1}static importDOM(){return{p:e=>({conversion:kp,priority:0})}}exportDOM(e){const{element:t}=super.exportDOM(e);if(Se(t)){this.isEmpty()&&t.append(document.createElement("br"));const r=this.getFormatType();r&&(t.style.textAlign=r)}return{element:t}}static importJSON(e){return ve().updateFromJSON(e)}exportJSON(){const e=super.exportJSON();if(e.textFormat===void 0||e.textStyle===void 0){const t=this.getChildren().find($);t?(e.textFormat=t.getFormat(),e.textStyle=t.getStyle()):(e.textFormat=this.getTextFormat(),e.textStyle=this.getTextStyle())}return e}insertNewAfter(e,t){const r=ve();r.setTextFormat(e.format),r.setTextStyle(e.style);const i=this.getDirection();return r.setDirection(i),r.setFormat(this.getFormatType()),r.setStyle(this.getStyle()),this.insertAfter(r,t),r}collapseAtStart(){const e=this.getChildren();if(e.length===0||$(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 kp(n){const e=ve();return n.style&&(e.setFormat(n.style.textAlign),Ho(n,e)),{node:e}}function ve(){return at(new tr)}function kr(n){return n instanceof tr}const ne=0,Ve=1,ad=4;function ld(n,e,t,r){const i=n._keyToDOMMap;i.clear(),n._editorState=Ro(),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 s=n._observer;s!==null&&(s.disconnect(),n._observer=null),e!==null&&(e.textContent=""),t!==null&&(t.textContent="",i.set("root",t))}function Ap(n){const e=new Set,t=new Set;let r=n;for(;r;){const{ownNodeConfig:i}=ji(r),s=r.transform;if(!t.has(s)){t.add(s);const o=r.transform();o&&e.add(o)}if(i){const o=i.$transform;o&&e.add(o),r=i.extends}else{const o=Object.getPrototypeOf(r);r=o.prototype instanceof St&&o!==St?o:void 0}}return e}function cd(n){const e=n||{},t=wp(),r=e.theme||{},i=n===void 0?t:e.parentEditor||null,s=e.disableEvents||!1,o=Ro(),a=e.namespace||(i!==null?i._config.namespace:vd()),l=e.editorState,u=[er,Ft,Yn,Xn,tr,Mo,...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 C=y;y=C.replace,x=C.with,p=C.withKlass||null}ji(y);const _=y.getType(),S=Ap(y);h.set(_,{exportDOM:f&&f.export?f.export.get(y):void 0,klass:y,replace:x,replaceWithKlass:p,sharedNodeState:Kh(u[m]),transforms:S})}}const g=new qn(o,i,h,{disableEvents:s,namespace:a,theme:r},c||console.error,(function(m,y){const x=new Map,p=new Set,_=S=>{Object.keys(S).forEach(C=>{let v=x.get(C);v===void 0&&(v=[],x.set(C,v)),v.push(S[C])})};return m.forEach(S=>{const C=S.klass.importDOM;if(C==null||p.has(C))return;p.add(C);const v=C.call(S.klass);v!==null&&_(v)}),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(Tu,rp,ne),m.registerCommand(Nu,ip,ne),m.registerCommand(ku,sp,ne),m.registerCommand(Au,op,ne),m.registerCommand(Iu,ap,ne)})(g),g}class qn{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,i,s,o,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=i,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=vd(),this._onError=s,this._htmlConversions=o,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&&O(35);const i=this._commands;i.has(e)||i.set(e,[new Set,new Set,new Set,new Set,new Set]);const s=i.get(e);s===void 0&&O(36,String(e));const o=s[r];return o.add(t),()=>{o.delete(t),s.every(a=>a.size===0)&&i.delete(e)}}registerMutationListener(e,t,r){const i=this.resolveRegisteredNodeAfterReplacements(this.getRegisteredNode(e)).klass,s=this._listeners.mutation;let o=s.get(t);o===void 0&&(o=new Set,s.set(t,o)),o.add(i);const a=r&&r.skipInitialization;return a!==void 0&&a||this.initializeMutationListener(t,i),()=>{o.delete(i),o.size===0&&s.delete(t)}}getRegisteredNode(e){const t=this._nodes.get(e.getType());return t===void 0&&O(37,e.name),t}resolveRegisteredNodeAfterReplacements(e){for(;e.replaceWithKlass;)e=this.getRegisteredNode(e.replaceWithKlass);return e}initializeMutationListener(e,t){const r=this._editorState,i=_l(r).get(t.getType());if(!i)return;const s=new Map;for(const o of i.keys())s.set(o,"created");s.size>0&&e(s,{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),i=[r],s=r.replaceWithKlass;if(s!=null){const o=this.registerNodeTransformToKlass(s,t);i.push(o)}return(function(o,a){const l=_l(o.getEditorState()),u=[];for(const c of a){const f=l.get(c);f&&u.push(f)}u.length!==0&&o.update(()=>{for(const c of u)for(const f of c.keys()){const d=Te(f);d&&d.markDirty()}},o._pendingEditorState===null?{tag:Kn}:void 0)})(this,i.map(o=>o.klass.getType())),()=>{i.forEach(o=>o.transforms.delete(t))}}hasNode(e){return this._nodes.has(e.getType())}hasNodes(e){return e.every(this.hasNode.bind(this))}dispatchCommand(e,t){return z(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=Wn(this._config.theme,"root"),i=this._pendingEditorState||this._editorState;if(this._rootElement=e,ld(this,t,e,i),t!==null&&(this._config.disableEvents||lp(t),r!=null&&t.classList.remove(...r)),e!==null){const s=Vo(e),o=e.style;o.userSelect="text",o.whiteSpace="pre-wrap",o.wordBreak="break-word",e.setAttribute("data-lexical-editor","true"),this._window=s,this._dirtyType=2,mu(this),this._updateTags.add(Kn),Lt(this),this._config.disableEvents||(function(a,l){const u=a.ownerDocument;js.set(a,u);const c=fi.get(u)??0;c<1&&u.addEventListener("selectionchange",Hu),fi.set(u,c+1),a.__lexicalEditor=l;const f=qu(a);for(let d=0;d<Bs.length;d++){const[h,g]=Bs[d],m=typeof g=="function"?y=>{Va(y)||(Wa(y),(l.isEditable()||h==="click")&&g(y,l))}:y=>{if(Va(y))return;Wa(y);const x=l.isEditable();switch(h){case"cut":return x&&z(l,Ao,y);case"copy":return z(l,Fi,y);case"paste":return x&&z(l,Ai,y);case"dragstart":return x&&z(l,Du,y);case"dragover":return x&&z(l,Bu,y);case"dragend":return x&&z(l,Qh,y);case"focus":return x&&z(l,ep,y);case"blur":return x&&z(l,tp,y);case"drop":return x&&z(l,Lu,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(Kn),Lt(this);gr("root",this,!1,e,t)}}getElementByKey(e){return this._keyToDOMMap.get(e)||null}getEditorState(){return this._editorState}setEditorState(e,t){e.isEmpty()&&O(38);let r=e;r._readOnly&&(r=sd(e),r._selection=e._selection?e._selection.clone():null),pu(this);const i=this._pendingEditorState,s=this._updateTags,o=t!==void 0?t.tag:null;i===null||i.isEmpty()||(o!=null&&s.add(o),Lt(this)),this._pendingEditorState=r,this._dirtyType=2,this._dirtyElements.set("root",!1),this._compositionKey=null,o!=null&&s.add(o),this._updating||Lt(this)}parseEditorState(e,t){return(function(r,i,s){const o=Ro(),a=Ie,l=Je,u=Oe,c=i._dirtyElements,f=i._dirtyLeaves,d=i._cloneNotNeeded,h=i._dirtyType;i._dirtyElements=new Map,i._dirtyLeaves=new Set,i._cloneNotNeeded=new Set,i._dirtyType=0,Ie=o,Je=!1,Oe=i,Lo(null);try{const g=i._nodes;Oo(r.root,g),s&&s(),o._readOnly=!0}catch(g){g instanceof Error&&i._onError(g)}finally{i._dirtyElements=c,i._dirtyLeaves=f,i._cloneNotNeeded=d,i._dirtyType=h,Ie=a,Je=l,Oe=u}return o})(typeof e=="string"?JSON.parse(e):e,this,t)}read(e){return Lt(this),this.getEditorState().read(e,{editor:this})}update(e,t){(function(r,i,s){r._updating?r._updates.push([i,s]):$i(r,i,s)})(this,e,t)}focus(e,t={}){const r=this._rootElement;r!==null&&(r.setAttribute("autocapitalize","off"),Et(this,()=>{const i=M(),s=be();i!==null?i.dirty||Me(i.clone()):s.getChildrenSize()!==0&&(t.defaultSelection==="rootStart"?s.selectStart():s.selectEnd()),$p("focus"),Rp(()=>{r.removeAttribute("autocapitalize"),e&&e()})}),this._pendingEditorState===null&&r.removeAttribute("autocapitalize"))}blur(){const e=this._rootElement;e!==null&&e.blur();const t=pt(this._window);t!==null&&t.removeAllRanges()}isEditable(){return this._editable}setEditable(e){this._editable!==e&&(this._editable=e,gr("editable",this,!0,e))}toJSON(){return{editorState:this._editorState.toJSON()}}}qn.version="0.39.0+prod.esm";let Hs=null;function Lo(n){Hs=n}let Fp=1;function ud(n,e){const t=Do(n,e);return t===void 0&&O(30,e),t}function Do(n,e){return n._nodes.get(e)}const Pp=typeof queueMicrotask=="function"?queueMicrotask:n=>{Promise.resolve().then(n)};function dd(n){return ae(kt(n))}function Bo(n){const e=document.activeElement;if(!Se(e))return!1;const t=e.nodeName;return ae(kt(n))&&(t==="INPUT"||t==="TEXTAREA"||e.contentEditable==="true"&&Mi(e)==null)}function Ar(n,e,t){const r=n.getRootElement();try{return r!==null&&r.contains(e)&&r.contains(t)&&e!==null&&!Bo(e)&&Ri(e)===n}catch{return!1}}function jo(n){return n instanceof qn}function Ri(n){let e=n;for(;e!=null;){const t=Mi(e);if(jo(t))return t;e=Fr(e)}return null}function Mi(n){return n?n.__lexicalEditor:null}function cn(n){return Pi(n)||n.isToken()}function Rt(n){return cn(n)||n.isSegmented()}function jt(n){return wn(n)&&n.nodeType===3}function fd(n){return wn(n)&&n.nodeType===9}function Hn(n){let e=n;for(;e!=null;){if(jt(e))return e;e=e.firstChild}return null}function _i(n,e,t){const r=gn[e];if(t!==null&&(n&r)===(t&r))return n;let i=n^r;return e==="subscript"?i&=-65:e==="superscript"?i&=-33:e==="lowercase"?(i&=-513,i&=-1025):e==="uppercase"?(i&=-257,i&=-1025):e==="capitalize"&&(i&=-257,i&=-513),i}function gd(n){return $(n)||Ct(n)||ae(n)}function hd(n,e){const t=(function(){const o=Hs;return Hs=null,o})();if((e=e||t&&t.__key)!=null)return void(n.__key=e);Pe(),nd();const r=me(),i=Zt(),s=""+Fp++;i._nodeMap.set(s,n),k(n)?r._dirtyElements.set(s,!0):r._dirtyLeaves.add(s),r._cloneNotNeeded.add(s),r._dirtyType=1,n.__key=s}function un(n){const e=n.getParent();if(e!==null){const t=n.getWritable(),r=e.getWritable(),i=n.getPreviousSibling(),s=n.getNextSibling(),o=s!==null?s.__key:null,a=i!==null?i.__key:null,l=i!==null?i.getWritable():null,u=s!==null?s.getWritable():null;i===null&&(r.__first=o),s===null&&(r.__last=a),l!==null&&(l.__next=o),u!==null&&(u.__prev=a),t.__prev=null,t.__next=null,t.__parent=null,r.__size--}}function vi(n){nd(),hi(n)&&O(323,n.__key,n.__type);const e=n.getLatest(),t=e.__parent,r=Zt(),i=me(),s=r._nodeMap,o=i._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,s,o);const a=e.__key;i._dirtyType=1,k(n)?o.set(a,!0):i._dirtyLeaves.add(a)}function Re(n){Pe();const e=me(),t=e._compositionKey;if(n!==t){if(e._compositionKey=n,t!==null){const r=Te(t);r!==null&&r.getWritable()}if(n!==null){const r=Te(n);r!==null&&r.getWritable()}}}function Vt(){return Tr()?null:me()._compositionKey}function Te(n,e){const t=(e||Zt())._nodeMap.get(n);return t===void 0?null:t}function pd(n,e){const t=Li(n,me());return t!==void 0?Te(t,e):null}function Li(n,e){return n[`__lexicalKey_${e._key}`]}function kt(n,e){let t=n;for(;t!=null;){const r=pd(t,e);if(r!==null)return r;t=Fr(t)}return null}function md(n){const e=n._decorators,t=Object.assign({},e);return n._pendingDecorators=t,t}function dl(n){return n.read(()=>be().getTextContent())}function be(){return yd(Zt())}function yd(n){return n._nodeMap.get("root")}function Me(n){Pe();const e=Zt();n!==null&&(n.dirty=!0,n.setCachedNodes(null)),e._selection=n}function Dn(n){const e=me(),t=(function(r,i){let s=r;for(;s!=null;){const o=Li(s,i);if(o!==void 0)return o;s=Fr(s)}return null})(n,e);return t===null?n===e.getRootElement()?Te("root"):null:Te(t)}function _d(n){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(n)}function zo(n){const e=[];let t=n;for(;t!==null;)e.push(t),t=t._parentEditor;return e}function vd(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substring(0,5)}function xd(n){return jt(n)?n.nodeValue:null}function Uo(n,e,t){const r=pt(ot(e));if(r===null)return;const i=r.anchorNode;let{anchorOffset:s,focusOffset:o}=r;if(i!==null){let a=xd(i);const l=kt(i);if(a!==null&&$(l)){if(a===Ni&&t){const u=t.length;a=t,s=u,o=u}a!==null&&Ko(l,a,s,o,n)}}}function Ko(n,e,t,r,i){let s=n;if(s.isAttached()&&(i||!s.isDirty())){const o=s.isComposing();let a=e;(o||i)&&e[e.length-1]===Ni&&(a=e.slice(0,-1));const l=s.getTextContent();if(i||a!==l){if(a===""){if(Re(null),Er||Zn||wr)s.remove();else{const m=me();setTimeout(()=>{m.update(()=>{s.isAttached()&&s.remove()})},20)}return}const u=s.getParent(),c=En(),f=s.getTextContentSize(),d=Vt(),h=s.getKey();if(s.isToken()||d!==null&&h===d&&!o||P(c)&&(u!==null&&!u.canInsertTextBefore()&&c.anchor.offset===0||c.anchor.key===n.__key&&c.anchor.offset===0&&!s.canInsertTextBefore()&&!o||c.focus.key===n.__key&&c.focus.offset===f&&!s.canInsertTextAfter()&&!o))return void s.markDirty();const g=M();if(!P(g)||t===null||r===null)return void fl(s,a,g);if(g.setTextNodeRange(s,t,s,r),s.isSegmented()){const m=xe(s.getTextContent());s.replace(m),s=m}fl(s,a,g)}}}function fl(n,e,t){if(n.setTextContent(e),P(t)){const r=n.getKey();for(const i of["anchor","focus"]){const s=t[i];s.type==="text"&&s.key===r&&(s.offset=Tt(n,s.offset,"clamp"))}}}function Kr(n,e,t){const r=e[t]||!1;return r==="any"||r===n[t]}function Ip(n,e){return Kr(n,e,"altKey")&&Kr(n,e,"ctrlKey")&&Kr(n,e,"shiftKey")&&Kr(n,e,"metaKey")}function ge(n,e,t){return Ip(n,t)&&n.key.toLowerCase()===e.toLowerCase()}const $t={ctrlKey:!ct,metaKey:ct},gl={altKey:ct,ctrlKey:!ct};function hl(n){return n.key==="Backspace"}function pl(n){return ge(n,"a",$t)}function Op(n){const e=be();if(P(n)){const t=n.anchor,r=n.focus,i=t.getNode().getTopLevelElementOrThrow().getParentOrThrow();return t.set(i.getKey(),0,"element"),r.set(i.getKey(),i.getChildrenSize(),"element"),hn(n),n}{const t=e.select(0,e.getChildrenSize());return Me(hn(t)),t}}function Wn(n,e){n.__lexicalClassNameCache===void 0&&(n.__lexicalClassNameCache={});const t=n.__lexicalClassNameCache,r=t[e];if(r!==void 0)return r;const i=n[e];if(typeof i=="string"){const s=du(i);return t[e]=s,s}return i}function Wo(n,e,t,r,i){if(t.size===0)return;const s=r.__type,o=r.__key,a=e.get(s);a===void 0&&O(33,s);const l=a.klass;let u=n.get(l);u===void 0&&(u=new Map,n.set(l,u));const c=u.get(o),f=c==="destroyed"&&i==="created";(c===void 0||f)&&u.set(o,f?"updated":i)}function ml(n,e,t){const r=n.getParent();let i=t,s=n;return r!==null&&(e&&t===0?(i=s.getIndexWithinParent(),s=r):e||t!==s.getChildrenSize()||(i=s.getIndexWithinParent()+1,s=r)),s.getChildAtIndex(e?i-1:i)}function Js(n,e){const t=n.offset;if(n.type==="element")return ml(n.getNode(),e,t);{const r=n.getNode();if(e&&t===0||!e&&t===r.getTextContentSize()){const i=e?r.getPreviousSibling():r.getNextSibling();return i===null?ml(r.getParentOrThrow(),e,r.getIndexWithinParent()+(e?0:1)):i}}return null}function bd(n){const e=ot(n).event,t=e&&e.inputType;return t==="insertFromPaste"||t==="insertFromPasteAsQuotation"}function z(n,e,t){return(function(r,i,s){const o=zo(r);for(let a=4;a>=0;a--)for(let l=0;l<o.length;l++){const u=o[l],c=u._commands.get(i);if(c!==void 0){const f=c[a];if(f!==void 0){const d=Array.from(f),h=d.length;let g=!1;if(Et(u,()=>{for(let m=0;m<h;m++)if(d[m](s,r))return void(g=!0)}),g)return g}}}return!1})(n,e,t)}function Di(n){return!Fe(n)&&!n.isLastChild()&&!n.isInline()}function yn(n,e){const t=n._keyToDOMMap.get(e);return t===void 0&&O(75,e),t}function Fr(n){const e=n.assignedSlot||n.parentElement;return Ys(e)?e.host:e}function Sd(n){return fd(n)?n:Se(n)?n.ownerDocument:null}function $p(n){Pe(),me()._updateTags.add(n)}function Rp(n){Pe(),me()._deferred.push(n)}function Gs(n,e){let t=n.getParent();for(;t!==null;){if(t.is(e))return!0;t=t.getParent()}return!1}function Vo(n){const e=Sd(n);return e?e.defaultView:null}function ot(n){const e=n._window;return e===null&&O(78),e}function Mp(n){let e=n.getParentOrThrow();for(;e!==null;){if(ze(e))return e;e=e.getParentOrThrow()}return e}function ze(n){return Fe(n)||k(n)&&n.isShadowRoot()}function Lp(n){const e=n.constructor.clone(n);return hd(e,null),e.afterCloneFrom(n),e}function at(n){const e=me(),t=n.getType(),r=Do(e,t);r===void 0&&O(200,n.constructor.name,t);const{replace:i,replaceWithKlass:s}=r;if(i!==null){const o=i(n),a=o.constructor;return s!==null?o instanceof s||O(201,s.name,s.getType(),a.name,a.getType(),n.constructor.name,t):o instanceof n.constructor&&a!==n.constructor||O(202,a.name,a.getType(),n.constructor.name,t),o.__key===n.__key&&O(203,n.constructor.name,t,a.name,a.getType()),o}return n}function as(n,e){!Fe(n.getParent())||k(e)||ae(e)||O(99)}function Dp(n){const e=Te(n);return e===null&&O(63,n),e}function ls(n){return(ae(n)||k(n)&&!n.canBeEmpty())&&!n.isInline()}function Zs(n,e,t){t.style.removeProperty("caret-color"),e._blockCursorElement=null;const r=n.parentElement;r!==null&&r.removeChild(n)}function pt(n){return ht?(n||window).getSelection():null}function Bp(n){const e=Vo(n);return e?e.getSelection():null}function qo(n){return Se(n)&&n.tagName==="A"}function Se(n){return wn(n)&&n.nodeType===1}function wn(n){return typeof n=="object"&&n!==null&&"nodeType"in n&&typeof n.nodeType=="number"}function Ys(n){return wn(n)&&n.nodeType===11}function Xs(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 xi(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 Kt(n){if(ae(n)&&!n.isInline())return!0;if(!k(n)||ze(n))return!1;const e=n.getFirstChild(),t=e===null||Ct(e)||$(e)||e.isInline();return!n.isInline()&&n.canBeEmpty()!==!1&&t}function Bi(){return me()}const yl=new WeakMap,jp=new Map;function _l(n){if(!n._readOnly&&n.isEmpty())return jp;n._readOnly||O(192);let e=yl.get(n);return e||(e=(function(t){const r=new Map;for(const[i,s]of t._nodeMap){const o=s.__type;let a=r.get(o);a||(a=new Map,r.set(o,a)),a.set(i,s)}return r})(n),yl.set(n,e)),e}function Cd(n){const e=n.constructor.clone(n);return e.afterCloneFrom(n),e}function zp(n){return(e=Cd(n))[Ju]=!0,e;var e}function Ho(n,e){const t=parseInt(n.style.paddingInlineStart,10)||0,r=Math.round(t/40);e.setIndent(r)}function Up(n){return n.__lexicalUnmanaged===!0}function rr(n,e){return(function(t,r){return Object.prototype.hasOwnProperty.call(t,r)})(n,e)&&n[e]!==St[e]}function ji(n){const e=Ia in n.prototype?n.prototype[Ia]():void 0,t=(function(o){if(!(o===St||o.prototype instanceof St)){let a="<unknown>",l="<unknown>";try{a=o.getType()}catch{}try{qn.version&&(l=JSON.parse(qn.version))}catch{}O(290,o.name,a,l)}return o===$o||o===et||o===St})(n),r=!t&&rr(n,"getType")?n.getType():void 0;let i,s=r;if(e)if(r)i=e[r];else for(const[o,a]of Object.entries(e))s=o,i=a;if(!t&&s&&(rr(n,"getType")||(n.getType=()=>s),rr(n,"clone")||(n.clone=o=>(Lo(o),new n)),rr(n,"importJSON")||(n.importJSON=i&&i.$importJSON||(o=>new n().updateFromJSON(o))),!rr(n,"importDOM")&&i)){const{importDOM:o}=i;o&&(n.importDOM=()=>o)}return{ownNodeConfig:i,ownNodeType:s}}function Ed(n){const e=Bi();return Pe(),new(e.resolveRegisteredNodeAfterReplacements(e.getRegisteredNode(n))).klass}const qe=(n,e)=>{let t=n;for(;t!=null&&!Fe(t);){if(e(t))return t;t=t.getParent()}return null},Kp={next:"previous",previous:"next"};class Jo{origin;constructor(e){this.origin=e}[Symbol.iterator](){return Td({hasNext:Jn,initial:this.getAdjacentCaret(),map:e=>e,step:e=>e.getAdjacentCaret()})}getAdjacentCaret(){return Ne(this.getNodeAtCaret(),this.direction)}getSiblingCaret(){return Ne(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 i=r===this.direction?t:Array.from(t).reverse();let s=this;const o=this.getParentAtCaret(),a=new Map;for(let l=s.getAdjacentCaret();l!==null&&a.size<e;l=l.getAdjacentCaret()){const u=l.origin.getWritable();a.set(u.getKey(),u)}for(const l of i){if(a.size>0){const u=s.getNodeAtCaret();if(u){if(a.delete(u.getKey()),a.delete(l.getKey()),!(u.is(l)||s.origin.is(l))){const c=l.getParent();c&&c.is(o)&&l.remove(),u.replace(l)}}else u===null&&O(263,Array.from(a).join(" "))}else s.insert(l);s=Ne(l,this.direction)}for(const l of a.values())l.remove();return this}}class Sr extends Jo{type="child";getLatest(){const e=this.origin.getLatest();return e===this.origin?this:it(e,this.direction)}getParentCaret(e="root"){return Ne(Go(this.getParentAtCaret(),e),this.direction)}getFlipped(){const e=Tn(this.direction);return Ne(this.getNodeAtCaret(),e)||it(this.origin,e)}getParentAtCaret(){return this.origin}getChildCaret(){return this}isSameNodeCaret(e){return e instanceof Sr&&this.direction===e.direction&&this.origin.is(e.origin)}isSamePointCaret(e){return this.isSameNodeCaret(e)}}const Wp={root:Fe,shadowRoot:ze};function Tn(n){return Kp[n]}function Go(n,e="root"){return Wp[e](n)?null:n}class _n extends Jo{type="sibling";getLatest(){const e=this.origin.getLatest();return e===this.origin?this:Ne(e,this.direction)}getSiblingCaret(){return this}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return k(this.origin)?it(this.origin,this.direction):null}getParentCaret(e="root"){return Ne(Go(this.getParentAtCaret(),e),this.direction)}getFlipped(){const e=Tn(this.direction);return Ne(this.getNodeAtCaret(),e)||it(this.origin.getParentOrThrow(),e)}isSamePointCaret(e){return e instanceof _n&&this.direction===e.direction&&this.origin.is(e.origin)}isSameNodeCaret(e){return(e instanceof _n||e instanceof vn)&&this.direction===e.direction&&this.origin.is(e.origin)}}class vn extends Jo{type="text";offset;constructor(e,t){super(e),this.offset=t}getLatest(){const e=this.origin.getLatest();return e===this.origin?this:xn(e,this.direction,this.offset)}getParentAtCaret(){return this.origin.getParent()}getChildCaret(){return null}getParentCaret(e="root"){return Ne(Go(this.getParentAtCaret(),e),this.direction)}getFlipped(){return xn(this.origin,Tn(this.direction),this.offset)}isSamePointCaret(e){return e instanceof vn&&this.direction===e.direction&&this.origin.is(e.origin)&&this.offset===e.offset}isSameNodeCaret(e){return(e instanceof _n||e instanceof vn)&&this.direction===e.direction&&this.origin.is(e.origin)}getSiblingCaret(){return Ne(this.origin,this.direction)}}function wt(n){return n instanceof vn}function Jn(n){return n instanceof _n}function rt(n){return n instanceof Sr}const Vp={next:class extends vn{direction="next";getNodeAtCaret(){return this.origin.getNextSibling()}insert(n){return this.origin.insertAfter(n),this}},previous:class extends vn{direction="previous";getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(n){return this.origin.insertBefore(n),this}}},qp={next:class extends _n{direction="next";getNodeAtCaret(){return this.origin.getNextSibling()}insert(n){return this.origin.insertAfter(n),this}},previous:class extends _n{direction="previous";getNodeAtCaret(){return this.origin.getPreviousSibling()}insert(n){return this.origin.insertBefore(n),this}}},Hp={next:class extends Sr{direction="next";getNodeAtCaret(){return this.origin.getFirstChild()}insert(n){return this.origin.splice(0,0,[n]),this}},previous:class extends Sr{direction="previous";getNodeAtCaret(){return this.origin.getLastChild()}insert(n){return this.origin.splice(this.origin.getChildrenSize(),0,[n]),this}}};function Ne(n,e){return n?new qp[e](n):null}function xn(n,e,t){return n?new Vp[e](n,Tt(n,t)):null}function Tt(n,e,t="error"){const r=n.getTextContentSize();let i=e==="next"?r:e==="previous"?0:e;return(i<0||i>r)&&(t!=="clamp"&&cu(284,String(e),String(r),n.getKey()),i=i<0?0:r),i}function vl(n,e){return new Gp(n,e)}function it(n,e){return k(n)?new Hp[e](n):null}function Jp(n){return n&&n.getChildCaret()||n}function zi(n){return n&&Jp(n.getAdjacentCaret())}class Zo{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 Zo(e,t,this.direction)}isCollapsed(){return this.anchor.isSamePointCaret(this.focus)}getTextSlices(){const e=i=>{const s=this[i].getLatest();return wt(s)?(function(o,a){const{direction:l,origin:u}=o,c=Tt(u,a==="focus"?Tn(l):l);return vl(o,c-o.offset)})(s,i):null},t=e("anchor"),r=e("focus");if(t&&r){const{caret:i}=t,{caret:s}=r;if(i.isSameNodeCaret(s))return[vl(i,s.offset-i.offset),null]}return[t,r]}iterNodeCarets(e="root"){const t=wt(this.anchor)?this.anchor.getSiblingCaret():this.anchor.getLatest(),r=this.focus.getLatest(),i=wt(r),s=o=>o.isSameNodeCaret(r)?null:zi(o)||o.getParentCaret(e);return Td({hasNext:o=>o!==null&&!(i&&r.isSameNodeCaret(o)),initial:t.isSameNodeCaret(r)?null:s(t),map:o=>o,step:s})}[Symbol.iterator](){return this.iterNodeCarets("root")}}class Gp{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,i]=this.getSliceIndices(),s=e.getTextContent();return xn(e.setTextContent(s.slice(0,r)+s.slice(i)),t,r)}}function Yo(n){return Gt(n,Ne(be(),n.direction))}function wd(n){return Gt(n,n)}function Gt(n,e){return n.direction!==e.direction&&O(265),new Zo(n,e,n.direction)}function Td(n){const{initial:e,hasNext:t,step:r,map:i}=n;let s=e;return{[Symbol.iterator](){return this},next(){if(!t(s))return{done:!0,value:void 0};const o={done:!1,value:i(s)};return s=r(s),o}}}function Nd(n,e){const t=ei(n.origin,e.origin);switch(t===null&&O(275,n.origin.getKey(),e.origin.getKey()),t.type){case"same":{const r=n.type==="text",i=e.type==="text";return r&&i?(function(s,o){return Math.sign(s-o)})(n.offset,e.offset):n.type===e.type?0:r?-1:i?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 kd(t)}}function kd(n){const{a:e,b:t}=n,r=e.__key,i=t.__key;let s=e,o=t;for(;s&&o;s=s.getNextSibling(),o=o.getNextSibling()){if(s.__key===i)return-1;if(o.__key===r)return 1}return s===null?1:-1}function Wr(n,e){return e.is(n)}function xl(n){return k(n)?[n.getLatest(),null]:[n.getParent(),n.getLatest()]}function ei(n,e){if(n.is(e))return{commonAncestor:n,type:"same"};const t=new Map;for(let[r,i]=xl(n);r;i=r,r=r.getParent())t.set(r,i);for(let[r,i]=xl(e);r;i=r,r=r.getParent()){const s=t.get(r);if(s!==void 0)return s===null?(Wr(n,r)||O(276),{commonAncestor:r,type:"ancestor"}):i===null?(Wr(e,r)||O(277),{commonAncestor:r,type:"descendant"}):((k(s)||Wr(n,s))&&(k(i)||Wr(e,i))&&r.is(s.getParent())&&r.is(i.getParent())||O(278),{a:s,b:i,commonAncestor:r,type:"branch"})}return null}function At(n,e){const{type:t,key:r,offset:i}=n,s=Dp(n.key);return t==="text"?($(s)||O(266,s.getType(),r),xn(s,e,i)):(k(s)||O(267,s.getType(),r),Yp(s,n.offset,e))}function bn(n,e){const{origin:t,direction:r}=e,i=r==="next";wt(e)?n.set(t.getKey(),e.offset,"text"):Jn(e)?$(t)?n.set(t.getKey(),Tt(t,r),"text"):n.set(t.getParentOrThrow().getKey(),t.getIndexWithinParent()+(i?1:0),"element"):(rt(e)&&k(t)||O(268),n.set(t.getKey(),i?0:t.getChildrenSize(),"element"))}function Ad(n){const e=M(),t=P(e)?e:Oi();return ti(t,n),Me(t),t}function ti(n,e){bn(n.anchor,e.anchor),bn(n.focus,e.focus)}function bl(n){const{anchor:e,focus:t}=n,r=At(e,"next"),i=At(t,"next"),s=Nd(r,i)<=0?"next":"previous";return Gt(Bt(r,s),Bt(i,s))}function Pr(n){const{direction:e,origin:t}=n,r=Ne(t,Tn(e)).getNodeAtCaret();return r?Ne(r,e):it(t.getParentOrThrow(),e)}function Sl(n,e="root"){const t=[n];for(let r=rt(n)?n.getParentCaret(e):n.getSiblingCaret();r!==null;r=r.getParentCaret(e))t.push(Pr(r));return t}function cs(n){return!!n&&n.origin.isAttached()}function Zp(n,e="removeEmptySlices"){if(n.isCollapsed())return n;const t="root",r="next";let i=e;const s=Pd(n,r),o=Sl(s.anchor,t),a=Sl(s.focus.getFlipped(),t),l=new Set,u=[];for(const g of s.iterNodeCarets(t))if(rt(g))l.add(g.origin.getKey());else if(Jn(g)){const{origin:m}=g;k(m)&&!l.has(m.getKey())||u.push(m)}for(const g of u)g.remove();for(const g of s.getTextSlices()){if(!g)continue;const{origin:m}=g.caret,y=m.getTextContentSize(),x=Pr(Ne(m,r)),p=m.getMode();if(Math.abs(g.distance)===y&&i==="removeEmptySlices"||p==="token"&&g.distance!==0)x.remove();else if(g.distance!==0){i="removeEmptySlices";let _=g.removeTextSlice();const S=g.caret.origin;if(p==="segmented"){const C=_.origin,v=xe(C.getTextContent()).setStyle(C.getStyle()).setFormat(C.getFormat());x.replaceOrInsert(v),_=xn(v,r,_.offset)}S.is(o[0].origin)&&(o[0]=_),S.is(a[0].origin)&&(a[0]=_.getFlipped())}}let c,f;for(const g of o)if(cs(g)){c=Qe(g);break}for(const g of a)if(cs(g)){f=Qe(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 S=p.getParents().reverse();S.push(p);const C=Math.min(_.length,S.length);let v;for(v=0;v<C&&_[v]===S[v];v++);const b=(N,A)=>{let L;for(let R=v;R<N.length;R++){const I=N[R];if(ze(I))return;!L&&A(I)&&(L=I)}return L},w=b(_,Kt),E=w&&b(S,N=>y.has(N.getKey())&&Kt(N));return w&&E?[w,E]:null})(c,f,l);if(d){const[g,m]=d;it(g,"previous").splice(0,m.getChildren()),m.remove()}const h=[c,f,...o,...a].find(cs);if(h)return wd(Bt(Qe(h),n.direction));O(269,JSON.stringify(o.map(g=>g.origin.__key)))}function Qe(n){const e=(function(i){let s=i;for(;rt(s);){const o=zi(s);if(!rt(o))break;s=o}return s})(n.getLatest()),{direction:t}=e;if($(e.origin))return wt(e)?e:xn(e.origin,t,t);const r=e.getAdjacentCaret();return Jn(r)&&$(r.origin)?xn(r.origin,t,Tn(t)):e}function Fd(n){return wt(n)&&n.offset!==Tt(n.origin,n.direction)}function Bt(n,e){return n.direction===e?n:n.getFlipped()}function Pd(n,e){return n.direction===e?n:Gt(Bt(n.focus,e),Bt(n.anchor,e))}function Yp(n,e,t){let r=it(n,"next");for(let i=0;i<e;i++){const s=r.getAdjacentCaret();if(s===null)break;r=s}return Bt(r,t)}function Xp(n){const{origin:e,offset:t,direction:r}=n;if(t===Tt(e,r))return n.getSiblingCaret();if(t===Tt(e,Tn(r)))return Pr(n.getSiblingCaret());const[i]=e.splitText(t);return $(i)||O(281),Bt(Ne(i,"next"),r)}function Qp(n,e){return!0}function em(n,{$copyElementNode:e=Lp,$splitTextPointCaretNext:t=Xp,rootMode:r="shadowRoot",$shouldSplit:i=Qp}={}){if(wt(n))return t(n);const s=n.getParentCaret(r);if(s){const{origin:o}=s;if(rt(n)&&(!o.canBeEmpty()||!i(o,"first")))return Pr(s);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||o.canBeEmpty()&&i(o,"last"))&&s.insert(e(o).splice(0,0,a))}return s}function tm(n,e){if(!e||n===e)return n;for(const t in e)if(n[t]!==e[t])return{...n,...e};return n}const Id=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,nm=Id?F.useLayoutEffect:F.useEffect,Vr={tag:Kn};function rm({initialConfig:n,children:e}){const t=F.useMemo(()=>{const{theme:r,namespace:i,nodes:s,onError:o,editorState:a,html:l}=n,u=xh(null,r),c=cd({editable:n.editable,html:l,namespace:i,nodes:s,onError:f=>o(f,c),theme:r});return(function(f,d){if(d!==null){if(d===void 0)f.update(()=>{const h=be();if(h.isEmpty()){const g=ve();h.append(g);const m=Id?document.activeElement:null;(M()!==null||m!==null&&m===f.getRootElement())&&g.select()}},Vr);else if(d!==null)switch(typeof d){case"string":{const h=f.parseEditorState(d);f.setEditorState(h,Vr);break}case"object":f.setEditorState(d,Vr);break;case"function":f.update(()=>{be().isEmpty()&&d(f)},Vr)}}})(c,a),[c,u]},[]);return nm(()=>{const r=n.editable,[i]=t;i.setEditable(r===void 0||r)},[]),T.jsx(lu.Provider,{value:t,children:e})}const im=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?F.useLayoutEffect:F.useEffect;function sm(n){return{initialValueFn:()=>n.isEditable(),subscribe:e=>n.registerEditableListener(e)}}function om(){return(function(n){const[e]=Ue(),t=F.useMemo(()=>n(e),[e,n]),[r,i]=F.useState(()=>t.initialValueFn()),s=F.useRef(r);return im(()=>{const{initialValueFn:o,subscribe:a}=t,l=o();return s.current!==l&&(s.current=l,i(l)),a(u=>{s.current=u,i(u)})},[t,n]),r})(sm)}const Qs=new Map;function Od(n){const e={};if(!n)return e;const t=n.split(";");for(const r of t)if(r!==""){const[i,s]=r.split(/:([^]+)/);i&&s&&(e[i.trim()]=s.trim())}return e}function Cl(n){let e=Qs.get(n);return e===void 0&&(e=Od(n),Qs.set(n,e)),e}function $d(n){const e=Bi().getElementByKey(n.getKey());if(e===null)return null;const t=e.ownerDocument.defaultView;return t===null?null:t.getComputedStyle(e)}function Rd(n){return $d(Fe(n)?n:n.getParentOrThrow())}function El(n){const e=Rd(n);return e!==null&&e.direction==="rtl"}function Md(n,e,t="self"){const r=n.getStartEndPoints();if(e.isSelected(n)&&!Rt(e)&&r!==null){const[i,s]=r,o=n.isBackward(),a=i.getNode(),l=s.getNode(),u=e.is(a),c=e.is(l);if(u||c){const[f,d]=qs(n),h=a.is(l),g=e.is(o?l:a),m=e.is(o?a:l);let y,x=0;h?(x=f>d?d:f,y=f>d?f:d):g?(x=o?d:f,y=void 0):m&&(x=0,y=o?f:d);const p=e.__text.slice(x,y);p!==e.__text&&(t==="clone"&&(e=zp(e)),e.__text=p)}}return e}function am(n){const e=n.getStyle(),t=Od(e);Qs.set(e,t)}function Ld(n){const e=Dd(n);return e!==null&&e.writingMode==="vertical-rl"}function Dd(n){const e=n.anchor.getNode();return k(e)?$d(e):Rd(e)}function wl(n,e){let t=Ld(n)?!e:e;Bd(n)&&(t=!t);const r=At(n.focus,t?"previous":"next");if(Fd(r))return!1;for(const i of Yo(r)){if(rt(i))return!i.origin.isInline();if(!k(i.origin)){if(ae(i.origin))return!0;break}}return!1}function lm(n,e,t,r){n.modify(e?"extend":"move",t,r)}function Bd(n){const e=Dd(n);return e!==null&&e.direction==="rtl"}function Tl(n,e,t){const r=Bd(n);let i;i=Ld(n)||r?!t:t,lm(n,e,i,"character")}function jd(n,...e){const t=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",n);for(const i of e)r.append("v",i);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 Ui=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,cm=Ui&&"documentMode"in document?document.documentMode:null,um=Ui&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent);!(!Ui||!("InputEvent"in window)||cm)&&"getTargetRanges"in new window.InputEvent("input");function zd(...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 st(...n){return()=>{for(let e=n.length-1;e>=0;e--)n[e]();n.length=0}}const dm=Ui,fm=um;function gt(n,...e){const t=zd(...e);t.length>0&&n.classList.add(...t)}function Ki(n,...e){const t=zd(...e);t.length>0&&n.classList.remove(...t)}function gm(n){return n?n.getAdjacentCaret():null}function hm(n,e){let t=n;for(;t!=null;){if(t instanceof e)return t;t=t.getParent()}return null}function eo(n){const e=qe(n,t=>k(t)&&!t.isInline());return k(e)||jd(4,n.__key),e}function pm(n){const e=M()||En();let t;if(P(e))t=At(e.focus,"next");else{if(e!=null){const o=e.getNodes(),a=o[o.length-1];a&&(t=Ne(a,"next"))}t=t||it(be(),"previous").getFlipped().insert(ve())}const r=mm(n,t),i=zi(r),s=rt(i)?Qe(i):r;return Ad(wd(s)),n.getLatest()}function mm(n,e,t){let r=Bt(e,"next");for(let i=r;i;i=em(i,t))r=i;return wt(r)&&jd(283),r.insert(n.isInline()?ve().append(n):n),Bt(Ne(n.getLatest(),"next"),e.direction)}function qt(n,e){return n!==null&&Object.getPrototypeOf(n).constructor.name===e.name}function ym(n,e){const t=[];for(let r=0;r<n.length;r++){const i=e(n[r]);i!==null&&t.push(i)}return t}let us=!(fm||!dm)&&void 0;function _m(n){let e=1;if((function(){if(us===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"),us=t.getBoundingClientRect().width===r.width,document.body.removeChild(t)}return us})())for(;n;)e*=Number(window.getComputedStyle(n).getPropertyValue("zoom")),n=n.parentElement;return e}const vm=Symbol.for("preact-signals");function Xo(){if(Vn>1)return void Vn--;let n,e=!1;for(;pr!==void 0;){let t=pr;for(pr=void 0,to++;t!==void 0;){const r=t.o;if(t.o=void 0,t.f&=-3,!(8&t.f)&&Ud(t))try{t.c()}catch(i){e||(n=i,e=!0)}t=r}}if(to=0,Vn--,e)throw n}let ue,pr;function Nl(n){const e=ue;ue=void 0;try{return n()}finally{ue=e}}let Vn=0,to=0,ni=0;function kl(n){if(ue===void 0)return;let e=n.n;return e===void 0||e.t!==ue?(e={i:0,S:n,p:ue.s,n:void 0,t:ue,e:void 0,x:void 0,r:e},ue.s!==void 0&&(ue.s.n=e),ue.s=e,n.n=e,32&ue.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=ue.s,e.n=void 0,ue.s.n=e,ue.s=e),e):void 0}function Ke(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 xm(n,e){return new Ke(n,e)}function Ud(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 Al(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 Kd(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 Pn(n,e){Ke.call(this,void 0),this.x=n,this.s=void 0,this.g=ni-1,this.f=4,this.W=e?.watched,this.Z=e?.unwatched,this.name=e?.name}function Wd(n){const e=n.u;if(n.u=void 0,typeof e=="function"){Vn++;const t=ue;ue=void 0;try{e()}catch(r){throw n.f&=-2,n.f|=8,Qo(n),r}finally{ue=t,Xo()}}}function Qo(n){for(let e=n.s;e!==void 0;e=e.n)e.S.U(e);n.x=void 0,n.s=void 0,Wd(n)}function bm(n){if(ue!==this)throw new Error("Out-of-order effect");Kd(this),ue=n,this.f&=-2,8&this.f&&Qo(this),Xo()}function Ln(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 no(n,e){const t=new Ln(n,e);try{t.c()}catch(i){throw t.d(),i}const r=t.d.bind(t);return r[Symbol.dispose]=r,r}function Vd(n,e={}){const t={};for(const r in n){const i=e[r],s=xm(i===void 0?n[r]:i);t[r]=s}return t}Ke.prototype.brand=vm,Ke.prototype.h=function(){return!0},Ke.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:Nl(()=>{var t;(t=this.W)==null||t.call(this)}))},Ke.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&&Nl(()=>{var r;(r=this.Z)==null||r.call(this)}))}},Ke.prototype.subscribe=function(n){return no(()=>{const e=this.value,t=ue;ue=void 0;try{n(e)}finally{ue=t}},{name:"sub"})},Ke.prototype.valueOf=function(){return this.value},Ke.prototype.toString=function(){return this.value+""},Ke.prototype.toJSON=function(){return this.value},Ke.prototype.peek=function(){const n=ue;ue=void 0;try{return this.value}finally{ue=n}},Object.defineProperty(Ke.prototype,"value",{get(){const n=kl(this);return n!==void 0&&(n.i=this.i),this.v},set(n){if(n!==this.v){if(to>100)throw new Error("Cycle detected");this.v=n,this.i++,ni++,Vn++;try{for(let e=this.t;e!==void 0;e=e.x)e.t.N()}finally{Xo()}}}}),Pn.prototype=new Ke,Pn.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===ni))return!0;if(this.g=ni,this.f|=1,this.i>0&&!Ud(this))return this.f&=-2,!0;const n=ue;try{Al(this),ue=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 ue=n,Kd(this),this.f&=-2,!0},Pn.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)}Ke.prototype.S.call(this,n)},Pn.prototype.U=function(n){if(this.t!==void 0&&(Ke.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)}},Pn.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(Pn.prototype,"value",{get(){if(1&this.f)throw new Error("Cycle detected");const n=kl(this);if(this.h(),n!==void 0&&(n.i=this.i),16&this.f)throw this.v;return this.v}}),Ln.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()}},Ln.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,Wd(this),Al(this),Vn++;const n=ue;return ue=this,bm.bind(this,n)},Ln.prototype.N=function(){2&this.f||(this.f|=2,this.o=pr,pr=this)},Ln.prototype.d=function(){this.f|=8,1&this.f||Qo(this)},Ln.prototype.dispose=function(){this.d()};function Sm(n){return(typeof n.nodes=="function"?n.nodes():n.nodes)||[]}function _e(n,...e){const t=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",n);for(const i of e)r.append("v",i);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 qd(n,e){if(n&&e&&!Array.isArray(e)&&typeof n=="object"&&typeof e=="object"){const t=n,r=e;for(const i in r)t[i]=qd(t[i],r[i]);return n}return e}const ea=0,ro=1,Hd=2,ds=3,qr=4,In=5,fs=6,ir=7;function gs(n){return n.id===ea}function Jd(n){return n.id===Hd}function Cm(n){return(function(e){return e.id===ro})(n)||_e(305,String(n.id),String(ro)),Object.assign(n,{id:Hd})}const Em=new Set;let wm=class{builder;configs;_dependency;_peerNameSet;extension;state;_signal;constructor(e,t){this.builder=e,this.extension=t,this.configs=new Set,this.state={id:ea}}mergeConfigs(){let e=this.extension.config||{};const t=this.extension.mergeConfig?this.extension.mergeConfig.bind(this.extension):tm;for(const r of this.configs)e=t(e,r);return e}init(e){const t=this.state;Jd(t)||_e(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)},i={...r,getDependency:this.getDependency.bind(this),getInitResult:this.getInitResult.bind(this),getPeer:this.getPeer.bind(this)},s=(function(a,l,u){return Object.assign(a,{config:l,id:ds,registerState:u})})(t,this.mergeConfigs(),r);let o;this.state=s,this.extension.init&&(o=this.extension.init(e,s.config,r)),this.state=(function(a,l,u){return Object.assign(a,{id:qr,initResult:l,registerState:u})})(s,o,i)}build(e){const t=this.state;let r;t.id!==qr&&_e(307,String(t.id),String(In)),this.extension.build&&(r=this.extension.build(e,t.config,t.registerState));const i={...t.registerState,getOutput:()=>r,getSignal:this.getSignal.bind(this)};this.state=(function(s,o,a){return Object.assign(s,{id:In,output:o,registerState:a})})(t,r,i)}register(e,t){this._signal=t;const r=this.state;r.id!==In&&_e(308,String(r.id),String(In));const i=this.extension.register&&this.extension.register(e,r.config,r.registerState);return this.state=(function(s){return Object.assign(s,{id:fs})})(r),()=>{const s=this.state;s.id!==ir&&_e(309,String(r.id),String(ir)),this.state=(function(o){return Object.assign(o,{id:In})})(s),i&&i()}}afterRegistration(e){const t=this.state;let r;return t.id!==fs&&_e(310,String(t.id),String(fs)),this.extension.afterRegistration&&(r=this.extension.afterRegistration(e,t.config,t.registerState)),this.state=(function(i){return Object.assign(i,{id:ir})})(t),r}getSignal(){return this._signal===void 0&&_e(311),this._signal}getInitResult(){this.extension.init===void 0&&_e(312,this.extension.name);const e=this.state;return(function(t){return t.id>=qr})(e)||_e(313,String(e.id),String(qr)),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>=ds})(e)||_e(314,String(e.id),String(ds)),{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&&_e(315,this.extension.name,e.name),t.getExtensionInitDependency()}getDependency(e){const t=this.builder.getExtensionRep(e);return t===void 0&&_e(315,this.extension.name,e.name),t.getExtensionDependency()}getState(){const e=this.state;return(function(t){return t.id>=ir})(e)||_e(316,String(e.id),String(ir)),e}getDirectDependentNames(){return this.builder.incomingEdges.get(this.extension.name)||Em}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>=In})(e)||_e(317,this.extension.name),this._dependency={config:e.config,init:e.initResult,output:e.output}}return this._dependency}};const Fl={tag:Kn};function Tm(){const n=be();n.isEmpty()&&n.append(ve())}const Nm={config:{setOptions:Fl,updateOptions:Fl},init:({$initialEditorState:n=Tm})=>({$initialEditorState:n,initialized:!1}),afterRegistration(n,{updateOptions:e,setOptions:t},r){const i=r.getInitResult();if(!i.initialized){i.initialized=!0;const{$initialEditorState:s}=i;if(Np(s))n.setEditorState(s,t);else if(typeof s=="function")n.update(()=>{s(n)},e);else if(s&&(typeof s=="string"||typeof s=="object")){const o=n.parseEditorState(s);n.setEditorState(o,t)}}return()=>{}},name:"@lexical/extension/InitialState",nodes:[er,Ft,Yn,Xn,tr]},Pl=Symbol.for("@lexical/extension/LexicalBuilder");function Il(){}function km(n){throw n}function Hr(n){return Array.isArray(n)?n:[n]}const hs="0.39.0+prod.esm";let Am=class ri{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=hs,this.roots=e;for(const t of e)this.addExtension(t)}static fromExtensions(e){const t=[Hr(Nm)];for(const r of e)t.push(Hr(r));return new ri(t)}static maybeFromEditor(e){const t=e[Pl];return t&&(t.PACKAGE_VERSION!==hs&&_e(292,t.PACKAGE_VERSION,hs),t instanceof ri||_e(293)),t}static fromEditor(e){const t=ri.maybeFromEditor(e);return t===void 0&&_e(294),t}constructEditor(){const{$initialEditorState:e,onError:t,...r}=this.buildCreateEditorArgs(),i=Object.assign(cd({...r,...t?{onError:s=>{t(s,i)}}:{}}),{[Pl]:this});for(const s of this.sortedExtensionReps())s.build(i);return i}buildEditor(){let e=Il;function t(){try{e()}finally{e=Il}}const r=Object.assign(this.constructEditor(),{dispose:t,[Symbol.dispose]:t});return e=st(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&&_e(295,e.name),t}addEdge(e,t,r){const i=this.outgoingConfigEdges.get(e);i?i.set(t,r):this.outgoingConfigEdges.set(e,new Map([[t,r]]));const s=this.incomingEdges.get(t);s?s.add(e):this.incomingEdges.set(t,new Set([e]))}addExtension(e){this._sortedExtensionReps!==void 0&&_e(296);const t=Hr(e),[r]=t;typeof r.name!="string"&&_e(297,typeof r.name);let i=this.extensionNameMap.get(r.name);if(i!==void 0&&i.extension!==r&&_e(298,r.name),!i){i=new wm(this,r),this.extensionNameMap.set(r.name,i);const s=this.conflicts.get(r.name);typeof s=="string"&&_e(299,r.name,s);for(const o of r.conflictsWith||[])this.extensionNameMap.has(o)&&_e(299,r.name,o),this.conflicts.set(o,r.name);for(const o of r.dependencies||[]){const a=Hr(o);this.addEdge(r.name,a[0].name,a.slice(1)),this.addExtension(a)}for(const[o,a]of r.peerDependencies||[])this.addEdge(r.name,o,a?[a]:[])}}sortedExtensionReps(){if(this._sortedExtensionReps)return this._sortedExtensionReps;const e=[],t=(r,i)=>{let s=r.state;if(Jd(s))return;const o=r.extension.name;var a;gs(s)||_e(300,o,i||"[unknown]"),gs(a=s)||_e(304,String(a.id),String(ea)),s=Object.assign(a,{id:ro}),r.state=s;const l=this.outgoingConfigEdges.get(o);if(l)for(const u of l.keys()){const c=this.extensionNameMap.get(u);c&&t(c,o)}s=Cm(s),r.state=s,e.push(r)};for(const r of this.extensionNameMap.values())gs(r.state)&&t(r);for(const r of e)for(const[i,s]of this.outgoingConfigEdges.get(r.extension.name)||[])if(s.length>0){const o=this.extensionNameMap.get(i);if(o)for(const a of s)o.configs.add(a)}for(const[r,...i]of this.roots)if(i.length>0){const s=this.extensionNameMap.get(r.name);s===void 0&&_e(301,r.name);for(const o of i)s.configs.add(o)}return this._sortedExtensionReps=e,this._sortedExtensionReps}registerEditor(e){const t=this.sortedExtensionReps(),r=new AbortController,i=[()=>r.abort()],s=r.signal;for(const o of t){const a=o.register(e,s);a&&i.push(a)}for(const o of t){const a=o.afterRegistration(e);a&&i.push(a)}return st(...i)}buildCreateEditorArgs(){const e={},t=new Set,r=new Map,i=new Map,s={},o={},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 Sm(f)){if(typeof d!="function"){const h=r.get(d.replace);h&&_e(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())i.set(d,h);f.html.import&&Object.assign(s,f.html.import)}f.theme&&qd(o,f.theme)}Object.keys(o).length>0&&(e.theme=o),t.size&&(e.nodes=[...t]);const l=Object.keys(s).length>0,u=i.size>0;(l||u)&&(e.html={},l&&(e.html.import=s),u&&(e.html.export=i));for(const c of a)c.init(e);return e.onError||(e.onError=km),e}};const Fm=q("INSERT_HORIZONTAL_RULE_COMMAND");class Ir extends $o{static getType(){return"horizontalrule"}static clone(e){return new Ir(e.__key)}static importJSON(e){return Gd().updateFromJSON(e)}static importDOM(){return{hr:()=>({conversion:Pm,priority:0})}}exportDOM(){return{element:document.createElement("hr")}}createDOM(e){const t=document.createElement("hr");return gt(t,e.theme.hr),t}getTextContent(){return`
|
|
12
|
-
`}isInline(){return!1}updateDOM(){return!1}}function Pm(){return{node:Gd()}}function Gd(){return Ed(Ir)}function Im(n){return n instanceof Ir}function Om(n,e){return st(n.registerCommand(ko,t=>{const r=M();if(!P(r))return!1;t.preventDefault();const i=(function(s){const o=s.getNodes();if(ym(o,d=>pi(d)&&d.canIndent()?d:null).length>0)return!0;const a=s.anchor,l=s.focus,u=l.isBefore(a)?l:a,c=u.getNode(),f=eo(c);if(f.canIndent()){const d=f.getKey();let h=Oi();if(h.anchor.set(d,0,"element"),h.focus.set(d,0,"element"),h=hn(h),h.anchor.is(u))return!0}return!1})(r)?t.shiftKey?Ls:Ms:Mu;return n.dispatchCommand(i,void 0)},ne),n.registerCommand(Ms,()=>{const t=typeof e=="number"?e:e?e.peek():null;if(t==null)return!1;const r=M();if(!P(r))return!1;const i=r.getNodes().map(s=>eo(s).getIndent());return Math.max(...i)+1>=t},ad))}const $m={name:"@lexical/react/ReactProvider"};function Rm(){return be().getTextContent()}function Mm(n,e=!0){if(n)return!1;let t=Rm();return e&&(t=t.trim()),t===""}function Lm(n){if(!Mm(n,!1))return!1;const e=be().getChildren(),t=e.length;if(t>1)return!1;for(let r=0;r<t;r++){const i=e[r];if(ae(i))return!1;if(k(i)){if(!kr(i)||i.__indent!==0)return!1;const s=i.getChildren(),o=s.length;for(let a=0;a<o;a++){const l=s[r];if(!$(l))return!1}}}return!0}function Zd(n){return()=>Lm(n)}function Dm(n){const e=window.location.origin,t=r=>{if(r.origin!==e)return;const i=n.getRootElement();if(document.activeElement!==i)return;const s=r.data;if(typeof s=="string"){let o;try{o=JSON.parse(s)}catch{return}if(o&&o.protocol==="nuanria_messaging"&&o.type==="request"){const a=o.payload;if(a&&a.functionId==="makeChanges"){const l=a.args;if(l){const[u,c,f,d,h]=l;n.update(()=>{const g=M();if(P(g)){const m=g.anchor;let y=m.getNode(),x=0,p=0;if($(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()),$(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 Bm(n,e){const t=fd(e)?e.body.childNodes:e.childNodes;let r=[];const i=[];for(const s of t)if(!Xd.has(s.nodeName)){const o=Qd(s,n,i,!1);o!==null&&(r=r.concat(o))}return(function(s){for(const o of s)o.getNextSibling()instanceof Mo&&o.insertAfter(ft());for(const o of s){const a=o.getChildren();for(const l of a)o.insertBefore(l);o.remove()}})(i),r}function jm(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=be().getChildren();for(let i=0;i<r.length;i++)Yd(n,r[i],t,e);return t.innerHTML}function Yd(n,e,t,r=null){let i=r===null||e.isSelected(r);const s=k(e)&&e.excludeFromCopy("html");let o=e;r!==null&&$(e)&&(o=Md(r,e,"clone"));const a=k(o)?o.getChildren():[],l=Do(n,o.getType());let u;u=l&&l.exportDOM!==void 0?l.exportDOM(n,o):o.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=Yd(n,g,d,r);!i&&k(e)&&m&&e.extractWithChild(g,r,"html")&&(i=!0)}if(i&&!s){if((Se(c)||Ys(c))&&c.append(d),t.append(c),f){const h=f.call(o,c);h&&(Ys(c)?c.replaceChildren(h):c.replaceWith(h))}}else t.append(d);return i}const Xd=new Set(["STYLE","SCRIPT"]);function Qd(n,e,t,r,i=new Map,s){let o=[];if(Xd.has(n.nodeName))return o;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 S=_(g);S!==null&&(p===null||(p.priority||0)<=(S.priority||0))&&(p=S)}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 i)if(a=m(a,s),!a)break;a&&o.push(...Array.isArray(g)?g:[a])}u.forChild!=null&&i.set(n.nodeName,u.forChild)}const f=n.childNodes;let d=[];const h=(a==null||!ze(a))&&(a!=null&&pi(a)||r);for(let g=0;g<f.length;g++)d.push(...Qd(f[g],e,t,h,new Map(i),a));return c!=null&&(d=c(d)),xi(n)&&(d=zm(n,d,h?()=>{const g=new Mo;return t.push(g),g}:ve)),a==null?d.length>0?o=o.concat(d):xi(n)&&(function(g){return g.nextSibling==null||g.previousSibling==null?!1:Xs(g.nextSibling)&&Xs(g.previousSibling)})(n)&&(o=o.concat(ft())):k(a)&&a.append(...d),o}function zm(n,e,t){const r=n.style.textAlign,i=[];let s=[];for(let o=0;o<e.length;o++){const a=e[o];if(pi(a))r&&!a.getFormat()&&a.setFormat(r),i.push(a);else if(s.push(a),o===e.length-1||o<e.length-1&&pi(e[o+1])){const l=t();l.setFormat(r),l.append(...s),i.push(l),s=[]}}return i}function bi(n,...e){const t=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",n);for(const i of e)r.append("v",i);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 Um(n,e=M()){return e==null&&bi(166),P(e)&&e.isCollapsed()||e.getNodes().length===0?"":jm(n,e)}function Km(n,e=M()){return e==null&&bi(166),P(e)&&e.isCollapsed()||e.getNodes().length===0?null:JSON.stringify(Wm(n,e))}function Ol(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 $l(t,Vm(a.nodes),e)}catch(a){console.error(a)}const i=n.getData("text/html"),s=n.getData("text/plain");if(i&&s!==i)try{const a=new DOMParser().parseFromString((function(l){return window.trustedTypes&&window.trustedTypes.createPolicy?window.trustedTypes.createPolicy("lexical",{createHTML:u=>u}).createHTML(l):l})(i),"text/html");return $l(t,Bm(t,a),e)}catch(a){console.error(a)}const o=s||n.getData("text/uri-list");if(o!=null)if(P(e)){const a=o.split(/(\r?\n|\t)/);a[a.length-1]===""&&a.pop();for(let l=0;l<a.length;l++){const u=M();if(P(u)){const c=a[l];c===`
|
|
13
|
-
`||c===`\r
|
|
14
|
-
`?u.insertParagraph():c===" "?u.insertNodes([Qn()]):u.insertText(c)}}}else e.insertRawText(o)}function $l(n,e,t){n.dispatchCommand(Gh,{nodes:e,selection:t})||(t.insertNodes(e),(function(r){if(P(r)&&r.isCollapsed()){const i=r.anchor;let s=null;const o=At(i,"previous");if(o)if(wt(o))s=o.origin;else{const a=Gt(o,it(be(),"next").getFlipped());for(const l of a){if($(l.origin)){s=l.origin;break}if(k(l.origin)&&!l.origin.isInline())break}}if(s&&$(s)){const a=s.getFormat(),l=s.getStyle();r.format===a&&r.style===l||(r.format=a,r.style=l,r.dirty=!0)}}})(t))}function ef(n,e,t,r=[]){let i=e===null||t.isSelected(e);const s=k(t)&&t.excludeFromCopy("html");let o=t;e!==null&&$(o)&&(o=Md(e,o,"clone"));const a=k(o)?o.getChildren():[],l=(function(u){const c=u.exportJSON(),f=u.constructor;if(c.type!==f.getType()&&bi(58,f.name),k(u)){const d=c.children;Array.isArray(d)||bi(59,f.name)}return c})(o);$(o)&&o.getTextContentSize()===0&&(i=!1);for(let u=0;u<a.length;u++){const c=a[u],f=ef(n,e,c,l.children);!i&&k(t)&&f&&t.extractWithChild(c,e,"clone")&&(i=!0)}if(i&&!s)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 i}function Wm(n,e){const t=[],r=be().getChildren();for(let i=0;i<r.length;i++)ef(n,e,r[i],t);return{namespace:n._config.namespace,nodes:t}}function Vm(n){const e=[];for(let t=0;t<n.length;t++){const r=n[t],i=Tp(r);$(i)&&am(i),e.push(i)}return e}let On=null;async function Rl(n,e,t){if(On!==null)return!1;if(e!==null)return new Promise((u,c)=>{n.update(()=>{u(Ml(n,e,t))})});const r=n.getRootElement(),i=n._window||window,s=i.document,o=pt(i);if(r===null||o===null)return!1;const a=s.createElement("span");a.style.cssText="position: fixed; top: -1000px;",a.append(s.createTextNode("#")),r.append(a);const l=new Range;return l.setStart(a,0),l.setEnd(a,1),o.removeAllRanges(),o.addRange(l),new Promise((u,c)=>{const f=n.registerCommand(Fi,d=>(qt(d,ClipboardEvent)&&(f(),On!==null&&(i.clearTimeout(On),On=null),u(Ml(n,d,t))),!0),ad);On=i.setTimeout(()=>{f(),On=null,u(!1)},50),s.execCommand("copy"),a.remove()})}function Ml(n,e,t){if(t===void 0){const i=pt(n._window),s=M();if(!s||s.isCollapsed()||!i)return!1;const o=i.anchorNode,a=i.focusNode;if(o!==null&&a!==null&&!Ar(n,o,a))return!1;t=qm(s)}e.preventDefault();const r=e.clipboardData;return r!==null&&(Hm(r,t),!0)}const tf=[["text/html",Um],["application/x-lexical-editor",Km]];function qm(n=M()){const e={"text/plain":n?n.getTextContent():""};if(n){const t=Bi();for(const[r,i]of tf){const s=i(t,n);s!==null&&(e[r]=s)}}return e}function Hm(n,e){for(const[t]of tf)e[t]===void 0&&n.setData(t,"");for(const t in e){const r=e[t];r!==void 0&&n.setData(t,r)}}function Ll(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 Nn=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,Jm=Nn&&"documentMode"in document?document.documentMode:null,Gm=Nn&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),Zm=!(!Nn||!("InputEvent"in window)||Jm)&&"getTargetRanges"in new window.InputEvent("input"),Ym=Nn&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),Dl=Nn&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,Xm=Nn&&/^(?=.*Chrome).*/i.test(navigator.userAgent),Qm=Nn&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&Gm&&!Xm,Bl=q("DRAG_DROP_PASTE_FILE");let Wi=class nf extends et{static getType(){return"quote"}static clone(e){return new nf(e.__key)}createDOM(e){const t=document.createElement("blockquote");return gt(t,e.theme.quote),t}updateDOM(e,t){return!1}static importDOM(){return{blockquote:e=>({conversion:ey,priority:0})}}exportDOM(e){const{element:t}=super.exportDOM(e);if(Se(t)){this.isEmpty()&&t.append(document.createElement("br"));const r=this.getFormatType();r&&(t.style.textAlign=r);const i=this.getDirection();i&&(t.dir=i)}return{element:t}}static importJSON(e){return ta().updateFromJSON(e)}insertNewAfter(e,t){const r=ve(),i=this.getDirection();return r.setDirection(i),this.insertAfter(r,t),r}collapseAtStart(){const e=ve();return this.getChildren().forEach(t=>e.append(t)),this.replace(e),!0}canMergeWhenEmpty(){return!0}};function ta(){return at(new Wi)}function io(n){return n instanceof Wi}let Vi=class rf extends et{__tag;static getType(){return"heading"}static clone(e){return new rf(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),i=e.theme.heading;if(i!==void 0){const s=i[t];gt(r,s)}return r}updateDOM(e,t,r){return e.__tag!==this.__tag}static importDOM(){return{h1:e=>({conversion:$n,priority:0}),h2:e=>({conversion:$n,priority:0}),h3:e=>({conversion:$n,priority:0}),h4:e=>({conversion:$n,priority:0}),h5:e=>({conversion:$n,priority:0}),h6:e=>({conversion:$n,priority:0}),p:e=>{const t=e.firstChild;return t!==null&&jl(t)?{conversion:()=>({node:null}),priority:3}:null},span:e=>jl(e)?{conversion:t=>({node:Bn("h1")}),priority:3}:null}}exportDOM(e){const{element:t}=super.exportDOM(e);if(Se(t)){this.isEmpty()&&t.append(document.createElement("br"));const r=this.getFormatType();r&&(t.style.textAlign=r);const i=this.getDirection();i&&(t.dir=i)}return{element:t}}static importJSON(e){return Bn(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,i=this.getLastDescendant(),s=!i||e&&e.anchor.key===i.getKey()&&r===i.getTextContentSize()||!e?ve():Bn(this.getTag()),o=this.getDirection();if(s.setDirection(o),this.insertAfter(s,t),r===0&&!this.isEmpty()&&e){const a=ve();a.select(),this.replace(a,!0)}return s}collapseAtStart(){const e=this.isEmpty()?ve():Bn(this.getTag());return this.getChildren().forEach(t=>e.append(t)),this.replace(e),!0}extractWithChild(){return!0}};function jl(n){return n.nodeName.toLowerCase()==="span"&&n.style.fontSize==="26pt"}function $n(n){const e=n.nodeName.toLowerCase();let t=null;return e!=="h1"&&e!=="h2"&&e!=="h3"&&e!=="h4"&&e!=="h5"&&e!=="h6"||(t=Bn(e),n.style!==null&&(Ho(n,t),t.setFormat(n.style.textAlign))),{node:t}}function ey(n){const e=ta();return n.style!==null&&(e.setFormat(n.style.textAlign),Ho(n,e)),{node:e}}function Bn(n="h1"){return at(new Vi(n))}function ty(n){return n instanceof Vi}function Jr(n){let e=null;if(qt(n,DragEvent)?e=n.dataTransfer:qt(n,ClipboardEvent)&&(e=n.clipboardData),e===null)return[!1,[],!1];const t=e.types,r=t.includes("Files"),i=t.includes("text/html")||t.includes("text/plain");return[r,Array.from(e.files),i]}function zl(n){const e=M();if(!P(e))return!1;const t=new Set,r=e.getNodes();for(let i=0;i<r.length;i++){const s=r[i],o=s.getKey();if(t.has(o))continue;const a=qe(s,u=>k(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 Ul(n){const e=kt(n);return ae(e)}function ps(n){for(const e of["lowercase","uppercase","capitalize"])n.hasFormat(e)&&n.toggleFormat(e)}function ny(n){return st(n.registerCommand(So,e=>{const t=M();return!!ke(t)&&(t.clear(),!0)},ne),n.registerCommand(ln,e=>{const t=M();return P(t)?(t.deleteCharacter(e),!0):!!ke(t)&&(t.deleteNodes(),!0)},ne),n.registerCommand(vr,e=>{const t=M();return!!P(t)&&(t.deleteWord(e),!0)},ne),n.registerCommand(xr,e=>{const t=M();return!!P(t)&&(t.deleteLine(e),!0)},ne),n.registerCommand(zn,e=>{const t=M();if(typeof e=="string")t!==null&&t.insertText(e);else{if(t===null)return!1;const r=e.dataTransfer;if(r!=null)Ol(r,t,n);else if(P(t)){const i=e.data;return i&&t.insertText(i),!0}}return!0},ne),n.registerCommand(Rs,()=>{const e=M();return!!P(e)&&(e.removeText(),!0)},ne),n.registerCommand(Wt,e=>{const t=M();return!!P(t)&&(t.formatText(e),!0)},ne),n.registerCommand(Xh,e=>{const t=M();if(!P(t)&&!ke(t))return!1;const r=t.getNodes();for(const i of r){const s=qe(i,o=>k(o)&&!o.isInline());s!==null&&s.setFormat(e)}return!0},ne),n.registerCommand(jn,e=>{const t=M();return!!P(t)&&(t.insertLineBreak(e),!0)},ne),n.registerCommand(_r,()=>{const e=M();return!!P(e)&&(e.insertParagraph(),!0)},ne),n.registerCommand(Mu,()=>(Cp([Qn()]),!0),ne),n.registerCommand(Ms,()=>zl(e=>{const t=e.getIndent();e.setIndent(t+1)}),ne),n.registerCommand(Ls,()=>zl(e=>{const t=e.getIndent();t>0&&e.setIndent(Math.max(0,t-1))}),ne),n.registerCommand(Eo,e=>{const t=M();if(ke(t)){const r=t.getNodes();if(r.length>0)return e.preventDefault(),r[0].selectPrevious(),!0}else if(P(t)){const r=Js(t.focus,!0);if(!e.shiftKey&&ae(r)&&!r.isIsolated()&&!r.isInline())return r.selectPrevious(),e.preventDefault(),!0}return!1},ne),n.registerCommand(wo,e=>{const t=M();if(ke(t)){const r=t.getNodes();if(r.length>0)return e.preventDefault(),r[0].selectNext(0,0),!0}else if(P(t)){if((function(i){const s=i.focus;return s.key==="root"&&s.offset===be().getChildrenSize()})(t))return e.preventDefault(),!0;const r=Js(t.focus,!1);if(!e.shiftKey&&ae(r)&&!r.isIsolated()&&!r.isInline())return r.selectNext(),e.preventDefault(),!0}return!1},ne),n.registerCommand(Co,e=>{const t=M();if(ke(t)){const r=t.getNodes();if(r.length>0)return e.preventDefault(),El(r[0])?r[0].selectNext(0,0):r[0].selectPrevious(),!0}if(!P(t))return!1;if(wl(t,!0)){const r=e.shiftKey;return e.preventDefault(),Tl(t,r,!0),!0}return!1},ne),n.registerCommand(Ou,e=>{const t=M();if(ke(t)){const i=t.getNodes();if(i.length>0)return e.preventDefault(),El(i[0])?i[0].selectPrevious():i[0].selectNext(0,0),!0}if(!P(t))return!1;const r=e.shiftKey;return!!wl(t,!1)&&(e.preventDefault(),Tl(t,r,!1),!0)},ne),n.registerCommand($u,e=>{if(Ul(e.target))return!1;const t=M();if(P(t)){if((function(r){if(!r.isCollapsed())return!1;const{anchor:i}=r;if(i.offset!==0)return!1;const s=i.getNode();if(Fe(s))return!1;const o=eo(s);return o.getIndent()>0&&(o.is(s)||s.is(o.getFirstDescendant()))})(t))return e.preventDefault(),n.dispatchCommand(Ls,void 0);if(Dl&&navigator.language==="ko-KR")return!1}else if(!ke(t))return!1;return e.preventDefault(),n.dispatchCommand(ln,!0)},ne),n.registerCommand(Ru,e=>{if(Ul(e.target))return!1;const t=M();return!(!P(t)&&!ke(t))&&(e.preventDefault(),n.dispatchCommand(ln,!1))},ne),n.registerCommand(di,e=>{const t=M();if(!P(t))return!1;if(ps(t),e!==null){if((Dl||Ym||Qm)&&Zm)return!1;if(e.preventDefault(),e.shiftKey)return n.dispatchCommand(jn,!1)}return n.dispatchCommand(_r,void 0)},ne),n.registerCommand(No,()=>{const e=M();return!!P(e)&&(n.blur(),!0)},ne),n.registerCommand(Lu,e=>{const[,t]=Jr(e);if(t.length>0){const i=Ll(e.clientX,e.clientY);if(i!==null){const{offset:s,node:o}=i,a=kt(o);if(a!==null){const l=Oi();if($(a))l.anchor.set(a.getKey(),s,"text"),l.focus.set(a.getKey(),s,"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=hn(l);Me(u)}n.dispatchCommand(Bl,t)}return e.preventDefault(),!0}const r=M();return!!P(r)},ne),n.registerCommand(Du,e=>{const[t]=Jr(e),r=M();return!(t&&!P(r))},ne),n.registerCommand(Bu,e=>{const[t]=Jr(e),r=M();if(t&&!P(r))return!1;const i=Ll(e.clientX,e.clientY);if(i!==null){const s=kt(i.node);ae(s)&&e.preventDefault()}return!0},ne),n.registerCommand(Ds,()=>(Op(),!0),ne),n.registerCommand(Fi,e=>(Rl(n,qt(e,ClipboardEvent)?e:null),!0),ne),n.registerCommand(Ao,e=>((async function(t,r){await Rl(r,qt(t,ClipboardEvent)?t:null),r.update(()=>{const i=M();P(i)?i.removeText():ke(i)&&i.getNodes().forEach(s=>s.remove())})})(e,n),!0),ne),n.registerCommand(Ai,e=>{const[,t,r]=Jr(e);return t.length>0&&!r?(n.dispatchCommand(Bl,t),!0):wn(e.target)&&Bo(e.target)?!1:M()!==null&&((function(i,s){i.preventDefault(),s.update(()=>{const o=M(),a=qt(i,InputEvent)||qt(i,KeyboardEvent)?null:i.clipboardData;a!=null&&o!==null&&Ol(a,o,s)},{tag:up})})(e,n),!0)},ne),n.registerCommand(To,e=>{const t=M();return P(t)&&ps(t),!1},ne),n.registerCommand(ko,e=>{const t=M();return P(t)&&ps(t),!1},ne))}function ry(n,...e){const t=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",n);for(const i of e)r.append("v",i);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 na=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?F.useLayoutEffect:F.useEffect;function iy({editor:n,ErrorBoundary:e}){return(function(t,r){const[i,s]=F.useState(()=>t.getDecorators());return na(()=>t.registerDecoratorListener(o=>{ha.flushSync(()=>{s(o)})}),[t]),F.useEffect(()=>{s(t.getDecorators())},[t]),F.useMemo(()=>{const o=[],a=Object.keys(i);for(let l=0;l<a.length;l++){const u=a[l],c=T.jsx(r,{onError:d=>t._onError(d),children:T.jsx(F.Suspense,{fallback:null,children:i[u]})}),f=t.getElementByKey(u);f!==null&&o.push(ha.createPortal(c,f,u))}return o},[r,i,t])})(n,e)}function sy({editor:n,ErrorBoundary:e}){return(function(t){const r=Am.maybeFromEditor(t);if(r&&r.hasExtensionByName($m.name)){for(const i of["@lexical/plain-text","@lexical/rich-text"])r.hasExtensionByName(i)&&ry(320,i);return!0}return!1})(n)?null:T.jsx(iy,{editor:n,ErrorBoundary:e})}function Kl(n){return n.getEditorState().read(Zd(n.isComposing()))}function oy({contentEditable:n,placeholder:e=null,ErrorBoundary:t}){const[r]=Ue();return(function(i){na(()=>st(ny(i),Dm(i)),[i])})(r),T.jsxs(T.Fragment,{children:[n,T.jsx(ay,{content:e}),T.jsx(sy,{editor:r,ErrorBoundary:t})]})}function ay({content:n}){const[e]=Ue(),t=(function(i){const[s,o]=F.useState(()=>Kl(i));return na(()=>{function a(){const l=Kl(i);o(l)}return a(),st(i.registerUpdateListener(()=>{a()}),i.registerEditableListener(()=>{a()}))},[i]),s})(e),r=om();return t?typeof n=="function"?n(r):n:null}const sf=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?F.useLayoutEffect:F.useEffect;function ly({editor:n,ariaActiveDescendant:e,ariaAutoComplete:t,ariaControls:r,ariaDescribedBy:i,ariaErrorMessage:s,ariaExpanded:o,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":S,...C},v){const[b,w]=F.useState(n.isEditable()),E=F.useCallback(A=>{A&&A.ownerDocument&&A.ownerDocument.defaultView?n.setRootElement(A):n.setRootElement(null)},[n]),N=F.useMemo(()=>(function(...A){return L=>{for(const R of A)typeof R=="function"?R(L):R!=null&&(R.current=L)}})(v,E),[E,v]);return sf(()=>(w(n.isEditable()),n.registerEditableListener(A=>{w(A)})),[n]),T.jsx("div",{"aria-activedescendant":b?e:void 0,"aria-autocomplete":b?t:"none","aria-controls":b?r:void 0,"aria-describedby":i,...s!=null?{"aria-errormessage":s}:{},"aria-expanded":b&&y==="combobox"?!!o:void 0,...a!=null?{"aria-invalid":a}:{},"aria-label":l,"aria-labelledby":u,"aria-multiline":c,"aria-owns":b?f:void 0,"aria-readonly":!b||void 0,"aria-required":d,autoCapitalize:h,className:g,contentEditable:b,"data-testid":S,id:m,ref:N,role:y,spellCheck:x,style:p,tabIndex:_,...C})}const cy=F.forwardRef(ly);function Wl(n){return n.getEditorState().read(Zd(n.isComposing()))}const uy=F.forwardRef(dy);function dy(n,e){const{placeholder:t,...r}=n,[i]=Ue();return T.jsxs(T.Fragment,{children:[T.jsx(cy,{editor:i,...r,ref:e}),t!=null&&T.jsx(fy,{editor:i,content:t})]})}function fy({content:n,editor:e}){const t=(function(o){const[a,l]=F.useState(()=>Wl(o));return sf(()=>{function u(){const c=Wl(o);l(c)}return u(),st(o.registerUpdateListener(()=>{u()}),o.registerEditableListener(()=>{u()}))},[o]),a})(e),[r,i]=F.useState(e.isEditable());if(F.useLayoutEffect(()=>(i(e.isEditable()),e.registerEditableListener(o=>{i(o)})),[e]),!t)return null;let s=null;return typeof n=="function"?s=n(r):n!==null&&(s=n),s===null?null:T.jsx("div",{"aria-hidden":!0,children:s})}const gy=F.createContext(null),ms={didCatch:!1,error:null};class hy extends F.Component{constructor(e){super(e),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=ms}static getDerivedStateFromError(e){return{didCatch:!0,error:e}}resetErrorBoundary(){const{error:e}=this.state;if(e!==null){for(var t,r,i=arguments.length,s=new Array(i),o=0;o<i;o++)s[o]=arguments[o];(t=(r=this.props).onReset)===null||t===void 0||t.call(r,{args:s,reason:"imperative-api"}),this.setState(ms)}}componentDidCatch(e,t){var r,i;(r=(i=this.props).onError)===null||r===void 0||r.call(i,e,t)}componentDidUpdate(e,t){const{didCatch:r}=this.state,{resetKeys:i}=this.props;if(r&&t.error!==null&&py(e.resetKeys,i)){var s,o;(s=(o=this.props).onReset)===null||s===void 0||s.call(o,{next:i,prev:e.resetKeys,reason:"keys"}),this.setState(ms)}}render(){const{children:e,fallbackRender:t,FallbackComponent:r,fallback:i}=this.props,{didCatch:s,error:o}=this.state;let a=e;if(s){const l={error:o,resetErrorBoundary:this.resetErrorBoundary};if(typeof t=="function")a=t(l);else if(r)a=F.createElement(r,l);else if(i!==void 0)a=i;else throw o}return F.createElement(gy.Provider,{value:{didCatch:s,error:o,resetErrorBoundary:this.resetErrorBoundary}},a)}}function py(){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 my({children:n,onError:e}){return T.jsx(hy,{fallback:T.jsx("div",{style:{border:"1px solid #f00",color:"#f00",padding:"8px"},children:"An error was thrown."}),onError:e,children:n})}function Ht(n,...e){const t=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",n);for(const i of e)r.append("v",i);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 so(n){let e=1,t=n.getParent();for(;t!=null;){if(ee(t)){const r=t.getParent();if(J(r)){e++,t=r.getParent();continue}Ht(40)}return e}return e}function oo(n){let e=n.getParent();J(e)||Ht(40);let t=e;for(;t!==null;)t=t.getParent(),J(t)&&(e=t);return e}function of(n){let e=[];const t=n.getChildren().filter(ee);for(let r=0;r<t.length;r++){const i=t[r],s=i.getFirstChild();J(s)?e=e.concat(of(s)):e.push(i)}return e}function xt(n){return ee(n)&&J(n.getFirstChild())}function Vl(n){return tt().append(n)}function af(n,e){return ee(n)&&(e.length===0||e.length===1&&n.is(e[0])&&n.getChildrenSize()===0)}function ao(n){const e=M();if(e!==null){let t=e.getNodes();if(P(e)){const i=e.getStartEndPoints();i===null&&Ht(143);const[s]=i,o=s.getNode(),a=o.getParent();if(ze(o)){const l=o.getFirstChild();if(l)t=l.selectStart().getNodes();else{const u=ve();o.append(u),t=u.select().getNodes()}}else if(af(o,t)){const l=Ge(n);if(ze(a)){o.replace(l);const u=tt();k(o)&&(u.setFormat(o.getFormatType()),u.setIndent(o.getIndent())),l.append(u)}else if(ee(o)){const u=o.getParentOrThrow();Sn(l,u.getChildren()),u.replace(l)}return}}const r=new Set;for(let i=0;i<t.length;i++){const s=t[i];if(k(s)&&s.isEmpty()&&!ee(s)&&!r.has(s.getKey())){ql(s,n);continue}let o=gd(s)?s.getParent():ee(s)&&s.isEmpty()?s:null;for(;o!=null;){const a=o.getKey();if(J(o)){if(!r.has(a)){const l=Ge(n);Sn(l,o.getChildren()),o.replace(l),r.add(a)}break}{const l=o.getParent();if(ze(l)&&!r.has(a)){r.add(a),ql(o,n);break}o=l}}}}}function Sn(n,e){n.splice(n.getChildrenSize(),0,e)}function ql(n,e){if(J(n))return n;const t=n.getPreviousSibling(),r=n.getNextSibling(),i=tt();let s;if(Sn(i,n.getChildren()),J(t)&&e===t.getListType())t.append(i),J(r)&&e===r.getListType()&&(Sn(t,r.getChildren()),r.remove()),s=t;else if(J(r)&&e===r.getListType())r.getFirstChildOrThrow().insertBefore(i),s=r;else{const o=Ge(e);o.append(i),n.replace(o),s=o}return i.setFormat(n.getFormatType()),i.setIndent(n.getIndent()),n.remove(),s}function ra(n,e){const t=n.getLastChild(),r=e.getFirstChild();t&&r&&xt(t)&&xt(r)&&(ra(t.getFirstChild(),r.getFirstChild()),r.remove());const i=e.getChildren();i.length>0&&n.append(...i),e.remove()}function yy(){const n=M();if(P(n)){const e=new Set,t=n.getNodes(),r=n.anchor.getNode();if(af(r,t))e.add(oo(r));else for(let i=0;i<t.length;i++){const s=t[i];if(gd(s)){const o=hm(s,Yt);o!=null&&e.add(oo(o))}}for(const i of e){let s=i;const o=of(i);for(const a of o){const l=ve().setTextStyle(n.style).setTextFormat(n.format);Sn(l,a.getChildren()),s.insertAfter(l),s=l,a.__key===n.anchor.key&&bn(n.anchor,Qe(it(l,"next"))),a.__key===n.focus.key&&bn(n.focus,Qe(it(l,"next"))),a.remove()}i.remove()}}}function lf(n){const e=n.getListType()!=="check";let t=n.getStart();for(const r of n.getChildren())ee(r)&&(r.getValue()!==t&&r.setValue(t),e&&r.getLatest().__checked!=null&&r.setChecked(void 0),J(r.getFirstChild())||t++)}function _y(n){const e=new Set;if(xt(n)||e.has(n.getKey()))return;const t=n.getParent(),r=n.getNextSibling(),i=n.getPreviousSibling();if(xt(r)&&xt(i)){const s=i.getFirstChild();if(J(s)){s.append(n);const o=r.getFirstChild();J(o)&&(Sn(s,o.getChildren()),r.remove(),e.add(r.getKey()))}}else if(xt(r)){const s=r.getFirstChild();if(J(s)){const o=s.getFirstChild();o!==null&&o.insertBefore(n)}}else if(xt(i)){const s=i.getFirstChild();J(s)&&s.append(n)}else if(J(t)){const s=tt().setTextFormat(n.getTextFormat()).setTextStyle(n.getTextStyle()),o=Ge(t.getListType()).setTextFormat(t.getTextFormat()).setTextStyle(t.getTextStyle());s.append(o),o.append(n),i?i.insertAfter(s):r?r.insertBefore(s):t.append(s)}}function vy(n){if(xt(n))return;const e=n.getParent(),t=e?e.getParent():void 0;if(J(t?t.getParent():void 0)&&ee(t)&&J(e)){const r=e?e.getFirstChild():void 0,i=e?e.getLastChild():void 0;if(n.is(r))t.insertBefore(n),e.isEmpty()&&t.remove();else if(n.is(i))t.insertAfter(n),e.isEmpty()&&t.remove();else{const s=e.getListType(),o=tt(),a=Ge(s);o.append(a),n.getPreviousSiblings().forEach(c=>a.append(c));const l=tt(),u=Ge(s);l.append(u),Sn(u,n.getNextSiblings()),t.insertBefore(o),t.insertAfter(l),t.replace(n)}}}function xy(){const n=M();if(!P(n)||!n.isCollapsed())return!1;const e=n.anchor.getNode();if(!ee(e)||e.getChildrenSize()!==0)return!1;const t=oo(e),r=e.getParent();J(r)||Ht(40);const i=r.getParent();let s;if(ze(i))s=ve(),t.insertAfter(s);else{if(!ee(i))return!1;s=tt(),i.insertAfter(s)}s.setTextStyle(n.style).setTextFormat(n.format).select();const o=e.getNextSiblings();if(o.length>0){const a=Ge(r.getListType());if(ee(s)){const l=tt();l.append(a),s.insertAfter(l)}else s.insertAfter(a);a.append(...o)}return(function(a){let l=a;for(;l.getNextSibling()==null&&l.getPreviousSibling()==null;){const u=l.getParent();if(u==null||!ee(u)&&!J(u))break;l=u}l.remove()})(e),!0}function Si(...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 Yt=class extends et{__value;__checked;$config(){return this.config("listitem",{$transform:e=>{if(e.__checked==null)return;const t=e.getParent();J(t)&&t.getListType()!=="check"&&e.getChecked()!=null&&e.setChecked(void 0)},extends:et,importDOM:{li:()=>({conversion:by,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(o,a,l){const u=a.getParent();!J(u)||u.getListType()!=="check"||J(a.getFirstChild())?(o.removeAttribute("role"),o.removeAttribute("tabIndex"),o.removeAttribute("aria-checked")):(o.setAttribute("role","checkbox"),o.setAttribute("tabIndex","-1"),l&&a.__checked===l.__checked||o.setAttribute("aria-checked",a.getChecked()?"true":"false"))})(t,this,e),t.value=this.__value,(function(o,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(...Si(d)),f){const g=l.getParent(),m=J(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=Si(h);l.getChildren().some(m=>J(m))?u.push(...g):c.push(...g)}c.length>0&&Ki(o,...c),u.length>0&>(o,...u)})(t,r.theme,this);const i=e?e.__style:"",s=this.__style;i!==s&&(s===""?t.removeAttribute("style"):t.style.cssText=s),(function(o,a,l){const u=Cl(a.__textStyle);for(const c in u)o.style.setProperty(`--listitem-marker-${c}`,u[c]);if(l)for(const c in Cl(l.__textStyle))c in u||o.style.removeProperty(`--listitem-marker-${c}`)})(t,this,e)}updateDOM(e,t,r){const i=t;return this.updateListItemDOM(e,i,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 i=this.getDirection();return i&&(t.dir=i),{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(k(r)&&this.canMergeWith(r)){const i=r.getChildren();this.append(...i),r.remove()}else super.append(r)}return this}replace(e,t){if(ee(e))return super.replace(e);this.setIndent(0);const r=this.getParentOrThrow();if(!J(r))return e;if(r.__first===this.getKey())r.insertBefore(e);else if(r.__last===this.getKey())r.insertAfter(e);else{const i=Ge(r.getListType());let s=this.getNextSibling();for(;s;){const o=s;s=s.getNextSibling(),i.append(o)}r.insertAfter(e),e.insertAfter(i)}return t&&(k(e)||Ht(139),this.getChildren().forEach(i=>{e.append(i)})),this.remove(),r.getChildrenSize()===0&&r.remove(),e}insertAfter(e,t=!0){const r=this.getParentOrThrow();if(J(r)||Ht(39),ee(e))return super.insertAfter(e,t);const i=this.getNextSiblings();if(r.insertAfter(e,t),i.length!==0){const s=Ge(r.getListType());i.forEach(o=>s.append(o)),e.insertAfter(s,t)}return e}remove(e){const t=this.getPreviousSibling(),r=this.getNextSibling();super.remove(e),t&&r&&xt(t)&&xt(r)&&(ra(t.getFirstChild(),r.getFirstChild()),r.remove())}insertNewAfter(e,t=!0){const r=tt().updateFromJSON(this.exportJSON()).setChecked(!this.getChecked()&&void 0);return this.insertAfter(r,t),r}collapseAtStart(e){const t=ve();this.getChildren().forEach(o=>t.append(o));const r=this.getParentOrThrow(),i=r.getParentOrThrow(),s=ee(i);if(r.getChildrenSize()===1)if(s)r.remove(),i.select();else{r.insertBefore(t),r.remove();const o=e.anchor,a=e.focus,l=t.getKey();o.type==="element"&&o.getNode().is(this)&&o.set(l,o.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 J(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(;ee(t);)t=t.getParentOrThrow().getParentOrThrow(),r++;return r}setIndent(e){typeof e!="number"&&Ht(117),(e=Math.floor(e))>=0||Ht(199);let t=this.getIndent();for(;t!==e;)t<e?(_y(this),t++):(vy(this),t--);return this}canInsertAfter(e){return ee(e)}canReplaceWith(e){return ee(e)}canMergeWith(e){return ee(e)||kr(e)}extractWithChild(e,t){if(!P(t))return!1;const r=t.anchor.getNode(),i=t.focus.getNode();return this.isParentOf(r)&&this.isParentOf(i)&&this.getTextContent().length===t.getTextContent().length}isParentRequired(){return!0}createParentElementNode(){return Ge("bullet")}canMergeWhenEmpty(){return!0}};function by(n){if(n.classList.contains("task-list-item")){for(const t of n.children)if(t.tagName==="INPUT")return Hl(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 Hl(t.children[0])}const e=n.getAttribute("aria-checked");return{node:tt(e==="true"||e!=="false"&&void 0)}}function Hl(n){return n.getAttribute("type")!=="checkbox"?{node:null}:{node:tt(n.hasAttribute("checked"))}}function tt(n){return at(new Yt(void 0,n))}function ee(n){return n instanceof Yt}let kn=class extends et{__tag;__start;__listType;$config(){return this.config("list",{$transform:e=>{(function(t){const r=t.getNextSibling();J(r)&&t.getListType()===r.getListType()&&ra(t,r)})(e),lf(e)},extends:et,importDOM:{ol:()=>({conversion:Gl,priority:0}),ul:()=>({conversion:Gl,priority:0})}})}constructor(e="number",t=1,r){super(r);const i=Cy[e]||e;this.__listType=i,this.__tag=i==="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,i=document.createElement(r);return this.__start!==1&&i.setAttribute("start",String(this.__start)),i.__lexicalListType=this.__listType,Jl(i,e.theme,this),i}updateDOM(e,t,r){return e.__tag!==this.__tag||e.__listType!==this.__listType||(Jl(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 Se(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 i=r;for(let s=0;s<r.length;s++){const o=r[s];ee(o)||(i===r&&(i=[...r]),i[s]=tt().append(!k(o)||J(o)||o.isInline()?o:xe(o.getTextContent())))}return super.splice(e,t,i)}extractWithChild(e){return ee(e)}};function Jl(n,e,t){const r=[],i=[],s=e.list;if(s!==void 0){const o=s[`${t.__tag}Depth`]||[],a=so(t)-1,l=a%o.length,u=o[l],c=s[t.__tag];let f;const d=s.nested,h=s.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(...Si(u));for(let g=0;g<o.length;g++)g!==l&&i.push(t.__tag+g)}if(f!==void 0){const g=Si(f);a>1?r.push(...g):i.push(...g)}}i.length>0&&Ki(n,...i),r.length>0&>(n,...r)}function Sy(n){const e=[];for(let t=0;t<n.length;t++){const r=n[t];if(ee(r)){e.push(r);const i=r.getChildren();i.length>1&&i.forEach(s=>{J(s)&&e.push(Vl(s))})}else e.push(Vl(r))}return e}function Gl(n){const e=n.nodeName.toLowerCase();let t=null;return e==="ol"?t=Ge("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 i of r.childNodes)if(Se(i)&&i.hasAttribute("aria-checked"))return!0;return!1})(n)?Ge("check"):Ge("bullet")),{after:Sy,node:t}}const Cy={ol:"number",ul:"bullet"};function Ge(n="number",e=1){return at(new kn(n,e))}function J(n){return n instanceof kn}const Ey=q("INSERT_CHECK_LIST_COMMAND");function wy(n){return st(n.registerCommand(Ey,()=>(ao("check"),!0),Ve),n.registerCommand(wo,e=>Xl(e,n,!1),Ve),n.registerCommand(Eo,e=>Xl(e,n,!0),Ve),n.registerCommand(No,()=>{if(lo()!=null){const e=n.getRootElement();return e?.focus(),!0}return!1},Ve),n.registerCommand(To,e=>{const t=lo();return!(t==null||!n.isEditable())&&(n.update(()=>{const r=kt(t);ee(r)&&(e.preventDefault(),r.toggleChecked())}),!0)},Ve),n.registerCommand(Co,e=>n.getEditorState().read(()=>{const t=M();if(P(t)&&t.isCollapsed()){const{anchor:r}=t,i=r.type==="element";if(i||r.offset===0){const s=r.getNode(),o=qe(s,a=>k(a)&&!a.isInline());if(ee(o)){const a=o.getParent();if(J(a)&&a.getListType()==="check"&&(i||o.getFirstDescendant()===s)){const l=n.getElementByKey(o.__key);if(l!=null&&document.activeElement!==l)return l.focus(),e.preventDefault(),!0}}}}return!1}),Ve),n.registerRootListener((e,t)=>{e!==null&&(e.addEventListener("click",Zl),e.addEventListener("pointerdown",Yl)),t!==null&&(t.removeEventListener("click",Zl),t.removeEventListener("pointerdown",Yl))}))}function cf(n,e){const t=n.target;if(!Se(t))return;const r=t.firstChild;if(Se(r)&&(r.tagName==="UL"||r.tagName==="OL"))return;const i=t.parentNode;if(!i||i.__lexicalListType!=="check")return;const s=t.getBoundingClientRect(),o=_m(t),a=n.clientX/o,l=window.getComputedStyle?window.getComputedStyle(t,"::before"):{width:"0px"},u=parseFloat(l.width),c=n.pointerType==="touch"?32:0;(t.dir==="rtl"?a<s.right+c&&a>s.right-u-c:a>s.left-c&&a<s.left+u+c)&&e()}function Zl(n){cf(n,()=>{if(Se(n.target)){const e=n.target,t=Ri(e);t!=null&&t.isEditable()&&t.update(()=>{const r=kt(e);ee(r)&&(e.focus(),r.toggleChecked())})}})}function Yl(n){cf(n,()=>{n.preventDefault()})}function lo(){const n=document.activeElement;return Se(n)&&n.tagName==="LI"&&n.parentNode!=null&&n.parentNode.__lexicalListType==="check"?n:null}function Xl(n,e,t){const r=lo();return r!=null&&e.update(()=>{const i=kt(r);if(!ee(i))return;const s=(function(o,a){let l=a?o.getPreviousSibling():o.getNextSibling(),u=o;for(;l==null&&ee(u);)u=u.getParentOrThrow().getParent(),u!=null&&(l=a?u.getPreviousSibling():u.getNextSibling());for(;ee(l);){const c=a?l.getLastChild():l.getFirstChild();if(!J(c))return l;l=a?c.getLastChild():c.getFirstChild()}return null})(i,t);if(s!=null){s.selectStart();const o=e.getElementByKey(s.__key);o!=null&&(n.preventDefault(),setTimeout(()=>{o.focus()},0))}}),!1}const Ty=q("UPDATE_LIST_START_COMMAND"),Ny=q("INSERT_UNORDERED_LIST_COMMAND"),ky=q("INSERT_ORDERED_LIST_COMMAND"),Ay=q("REMOVE_LIST_COMMAND");function Fy(n){return st(n.registerCommand(ky,()=>(ao("number"),!0),Ve),n.registerCommand(Ty,e=>{const{listNodeKey:t,newStart:r}=e,i=Te(t);return!!J(i)&&(i.getListType()==="number"&&(i.setStart(r),lf(i)),!0)},Ve),n.registerCommand(Ny,()=>(ao("bullet"),!0),Ve),n.registerCommand(Ay,()=>(yy(),!0),Ve),n.registerCommand(_r,()=>xy(),Ve),n.registerNodeTransform(Yt,e=>{const t=e.getFirstChild();if(t){if($(t)){const r=t.getStyle(),i=t.getFormat();e.getTextStyle()!==r&&e.setTextStyle(r),e.getTextFormat()!==i&&e.setTextFormat(i)}}else{const r=M();P(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(Ft,e=>{const t=e.getParent();if(ee(t)&&e.is(t.getFirstChild())){const r=e.getStyle(),i=e.getFormat();r===t.getTextStyle()&&i===t.getTextFormat()||t.setTextStyle(r).setTextFormat(i)}}))}function Py(n){const e=t=>{const r=t.getParent();if(J(t.getFirstChild())||!J(r))return;const i=qe(t,s=>ee(s)&&J(s.getParent())&&ee(s.getPreviousSibling()));if(i===null&&t.getIndent()>0)t.setIndent(0);else if(ee(i)){const s=i.getPreviousSibling();if(ee(s)){const o=(function(l){let u=l,c=u.getFirstChild();for(;J(c);){const f=c.getLastChild();if(!ee(f))break;u=f,c=u.getFirstChild()}return u})(s),a=o.getParent();if(J(a)){const l=so(a);l+1<so(r)&&t.setIndent(l)}}}};return n.registerNodeTransform(kn,t=>{const r=[t];for(;r.length>0;){const i=r.shift();if(J(i)){for(const s of i.getChildren())if(ee(s)){e(s);const o=s.getFirstChild();J(o)&&r.push(o)}}}})}var ys={exports:{}},Ql;function Iy(){return Ql||(Ql=1,(function(n){var e=typeof window<"u"?window:typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:{};var t=(function(r){var i=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,s=0,o={},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,"&").replace(/</g,"<").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:++s}),p.__id},clone:function p(_,S){S=S||{};var C,v;switch(a.util.type(_)){case"Object":if(v=a.util.objId(_),S[v])return S[v];C={},S[v]=C;for(var b in _)_.hasOwnProperty(b)&&(C[b]=p(_[b],S));return C;case"Array":return v=a.util.objId(_),S[v]?S[v]:(C=[],S[v]=C,_.forEach(function(w,E){C[E]=p(w,S)}),C);default:return _}},getLanguage:function(p){for(;p;){var _=i.exec(p.className);if(_)return _[1].toLowerCase();p=p.parentElement}return"none"},setLanguage:function(p,_){p.className=p.className.replace(RegExp(i,"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(C){var p=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(C.stack)||[])[1];if(p){var _=document.getElementsByTagName("script");for(var S in _)if(_[S].src==p)return _[S]}return null}},isActive:function(p,_,S){for(var C="no-"+_;p;){var v=p.classList;if(v.contains(_))return!0;if(v.contains(C))return!1;p=p.parentElement}return!!S}},languages:{plain:o,plaintext:o,text:o,txt:o,extend:function(p,_){var S=a.util.clone(a.languages[p]);for(var C in _)S[C]=_[C];return S},insertBefore:function(p,_,S,C){C=C||a.languages;var v=C[p],b={};for(var w in v)if(v.hasOwnProperty(w)){if(w==_)for(var E in S)S.hasOwnProperty(E)&&(b[E]=S[E]);S.hasOwnProperty(w)||(b[w]=v[w])}var N=C[p];return C[p]=b,a.languages.DFS(a.languages,function(A,L){L===N&&A!=p&&(this[A]=b)}),b},DFS:function p(_,S,C,v){v=v||{};var b=a.util.objId;for(var w in _)if(_.hasOwnProperty(w)){S.call(_,w,_[w],C||w);var E=_[w],N=a.util.type(E);N==="Object"&&!v[b(E)]?(v[b(E)]=!0,p(E,S,null,v)):N==="Array"&&!v[b(E)]&&(v[b(E)]=!0,p(E,S,w,v))}}},plugins:{},highlightAll:function(p,_){a.highlightAllUnder(document,p,_)},highlightAllUnder:function(p,_,S){var C={callback:S,container:p,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};a.hooks.run("before-highlightall",C),C.elements=Array.prototype.slice.apply(C.container.querySelectorAll(C.selector)),a.hooks.run("before-all-elements-highlight",C);for(var v=0,b;b=C.elements[v++];)a.highlightElement(b,_===!0,C.callback)},highlightElement:function(p,_,S){var C=a.util.getLanguage(p),v=a.languages[C];a.util.setLanguage(p,C);var b=p.parentElement;b&&b.nodeName.toLowerCase()==="pre"&&a.util.setLanguage(b,C);var w=p.textContent,E={element:p,language:C,grammar:v,code:w};function N(L){E.highlightedCode=L,a.hooks.run("before-insert",E),E.element.innerHTML=E.highlightedCode,a.hooks.run("after-highlight",E),a.hooks.run("complete",E),S&&S.call(E.element)}if(a.hooks.run("before-sanity-check",E),b=E.element.parentElement,b&&b.nodeName.toLowerCase()==="pre"&&!b.hasAttribute("tabindex")&&b.setAttribute("tabindex","0"),!E.code){a.hooks.run("complete",E),S&&S.call(E.element);return}if(a.hooks.run("before-highlight",E),!E.grammar){N(a.util.encode(E.code));return}if(_&&r.Worker){var A=new Worker(a.filename);A.onmessage=function(L){N(L.data)},A.postMessage(JSON.stringify({language:E.language,code:E.code,immediateClose:!0}))}else N(a.highlight(E.code,E.grammar,E.language))},highlight:function(p,_,S){var C={code:p,grammar:_,language:S};if(a.hooks.run("before-tokenize",C),!C.grammar)throw new Error('The language "'+C.language+'" has no grammar.');return C.tokens=a.tokenize(C.code,C.grammar),a.hooks.run("after-tokenize",C),l.stringify(a.util.encode(C.tokens),C.language)},tokenize:function(p,_){var S=_.rest;if(S){for(var C in S)_[C]=S[C];delete _.rest}var v=new f;return d(v,v.head,p),c(p,v,_,v.head,0),g(v)},hooks:{all:{},add:function(p,_){var S=a.hooks.all;S[p]=S[p]||[],S[p].push(_)},run:function(p,_){var S=a.hooks.all[p];if(!(!S||!S.length))for(var C=0,v;v=S[C++];)v(_)}},Token:l};r.Prism=a;function l(p,_,S,C){this.type=p,this.content=_,this.alias=S,this.length=(C||"").length|0}l.stringify=function p(_,S){if(typeof _=="string")return _;if(Array.isArray(_)){var C="";return _.forEach(function(N){C+=p(N,S)}),C}var v={type:_.type,content:p(_.content,S),tag:"span",classes:["token",_.type],attributes:{},language:S},b=_.alias;b&&(Array.isArray(b)?Array.prototype.push.apply(v.classes,b):v.classes.push(b)),a.hooks.run("wrap",v);var w="";for(var E in v.attributes)w+=" "+E+'="'+(v.attributes[E]||"").replace(/"/g,""")+'"';return"<"+v.tag+' class="'+v.classes.join(" ")+'"'+w+">"+v.content+"</"+v.tag+">"};function u(p,_,S,C){p.lastIndex=_;var v=p.exec(S);if(v&&C&&v[1]){var b=v[1].length;v.index+=b,v[0]=v[0].slice(b)}return v}function c(p,_,S,C,v,b){for(var w in S)if(!(!S.hasOwnProperty(w)||!S[w])){var E=S[w];E=Array.isArray(E)?E:[E];for(var N=0;N<E.length;++N){if(b&&b.cause==w+","+N)return;var A=E[N],L=A.inside,R=!!A.lookbehind,I=!!A.greedy,D=A.alias;if(I&&!A.pattern.global){var K=A.pattern.toString().match(/[imsuy]*$/)[0];A.pattern=RegExp(A.pattern.source,K+"g")}for(var j=A.pattern||A,U=C.next,B=v;U!==_.tail&&!(b&&B>=b.reach);B+=U.value.length,U=U.next){var re=U.value;if(_.length>p.length)return;if(!(re instanceof l)){var te=1,G;if(I){if(G=u(j,B,p,R),!G||G.index>=p.length)break;var X=G.index,de=G.index+G[0].length,V=B;for(V+=U.value.length;X>=V;)U=U.next,V+=U.value.length;if(V-=U.value.length,B=V,U.value instanceof l)continue;for(var Y=U;Y!==_.tail&&(V<de||typeof Y.value=="string");Y=Y.next)te++,V+=Y.value.length;te--,re=p.slice(B,V),G.index-=B}else if(G=u(j,0,re,R),!G)continue;var X=G.index,le=G[0],Z=re.slice(0,X),Q=re.slice(X+le.length),he=B+re.length;b&&he>b.reach&&(b.reach=he);var Ce=U.prev;Z&&(Ce=d(_,Ce,Z),B+=Z.length),h(_,Ce,te);var H=new l(w,L?a.tokenize(le,L):le,D,le);if(U=d(_,Ce,H),Q&&d(_,U,Q),te>1){var ce={cause:w+","+N,reach:he};c(p,_,S,U.prev,B,ce),b&&ce.reach>b.reach&&(b.reach=ce.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,_,S){var C=_.next,v={value:S,prev:_,next:C};return _.next=v,C.prev=v,p.length++,v}function h(p,_,S){for(var C=_.next,v=0;v<S&&C!==p.tail;v++)C=C.next;_.next=C,C.prev=_,p.length-=v}function g(p){for(var _=[],S=p.head.next;S!==p.tail;)_.push(S.value),S=S.next;return _}if(!r.document)return r.addEventListener&&(a.disableWorkerMessageHandler||r.addEventListener("message",function(p){var _=JSON.parse(p.data),S=_.language,C=_.code,v=_.immediateClose;r.postMessage(a.highlight(C,a.languages[S],S)),v&&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 pa<"u"&&(pa.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(/&/,"&"))}),Object.defineProperty(t.languages.markup.tag,"addInlined",{value:function(i,s){var o={};o["language-"+s]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:t.languages[s]},o.cdata=/^<!\[CDATA\[|\]\]>$/i;var a={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:o}};a["language-"+s]={pattern:/[\s\S]+/,inside:t.languages[s]};var l={};l[i]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return i}),"i"),lookbehind:!0,greedy:!0,inside:a},t.languages.insertBefore("markup","cdata",l)}}),Object.defineProperty(t.languages.markup.tag,"addAttribute",{value:function(r,i){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:[i,"language-"+i],inside:t.languages[i]},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 i=/(?:"(?:\\(?:\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+"|"+i.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\\((?:"+i.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+i.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+i.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:i,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 s=r.languages.markup;s&&(s.tag.addInlined("style","css"),s.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…",i=function(m,y){return"✖ Error "+m+" while fetching file: "+y},s="✖ Error: File does not exist or is empty",o={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(i(p.status,p.statusText)):x(s))},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 S=(/\.(\w+)$/.exec(p)||[,"none"])[1];_=o[S]||S}t.util.setLanguage(x,_),t.util.setLanguage(y,_);var C=t.plugins.autoloader;C&&C.loadLanguages(_),d(p,function(v){y.setAttribute(a,u);var b=h(y.getAttribute("data-range"));if(b){var w=v.split(/\r\n?|\n/g),E=b[0],N=b[1]==null?w.length:b[1];E<0&&(E+=w.length),E=Math.max(0,Math.min(E-1,w.length)),N<0&&(N+=w.length),N=Math.max(0,Math.min(N,w.length)),v=w.slice(E,N).join(`
|
|
15
|
-
`),y.hasAttribute("data-start")||y.setAttribute("data-start",String(E+1))}x.textContent=v,t.highlightElement(x)},function(v){y.setAttribute(a,c),x.textContent=v})}}),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)}})()})(ys)),ys.exports}Iy();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(/&/,"&"))});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 i={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:r}};i["language-"+t]={pattern:/[\s\S]+/,inside:Prism.languages[t]};var s={};s[e]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return e}),"i"),lookbehind:!0,greedy:!0,inside:i},Prism.languages.insertBefore("markup","cdata",s)}});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,i=/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g,function(){return r}),s=/\|?[ \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("^"+i+s+"(?:"+i+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+i+s+")(?:"+i+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(r),inside:n.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+i+")"+s+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+i+"$"),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 o=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(o,"");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 ec={},tc;function Oy(){return tc||(tc=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://,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),ec}Oy();var nc={},rc;function $y(){return rc||(rc=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)),nc}$y();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 ic={},sc;function Ry(){return sc||(sc=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)),ic}Ry();var oc={},ac;function My(){return ac||(ac=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)),oc}My();var lc={},cc;function Ly(){return cc||(cc=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)),lc}Ly();function uf(n,e){for(const t of n.childNodes){if(Se(t)&&t.tagName===e)return!0;uf(t,e)}return!1}const cr="data-language",sr="data-highlight-language",Gr="data-theme";let qi=class df extends et{__language;__theme;__isSyntaxHighlightSupported;static getType(){return"code"}static clone(e){return new df(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");gt(t,e.theme.code),t.setAttribute("spellcheck","false");const r=this.getLanguage();r&&(t.setAttribute(cr,r),this.getIsSyntaxHighlightSupported()&&t.setAttribute(sr,r));const i=this.getTheme();i&&t.setAttribute(Gr,i);const s=this.getStyle();return s&&t.setAttribute("style",s),t}updateDOM(e,t,r){const i=this.__language,s=e.__language;i?i!==s&&t.setAttribute(cr,i):s&&t.removeAttribute(cr);const o=this.__isSyntaxHighlightSupported;e.__isSyntaxHighlightSupported&&s?o&&i?i!==s&&t.setAttribute(sr,i):t.removeAttribute(sr):o&&i&&t.setAttribute(sr,i);const a=this.__theme,l=e.__theme;a?a!==l&&t.setAttribute(Gr,a):l&&t.removeAttribute(Gr);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");gt(t,e._config.theme.code),t.setAttribute("spellcheck","false");const r=this.getLanguage();r&&(t.setAttribute(cr,r),this.getIsSyntaxHighlightSupported()&&t.setAttribute(sr,r));const i=this.getTheme();i&&t.setAttribute(Gr,i);const s=this.getStyle();return s&&t.setAttribute("style",s),{element:t}}static importDOM(){return{code:e=>e.textContent!=null&&(/\r?\n/.test(e.textContent)||uf(e,"BR"))?{conversion:uc,priority:1}:null,div:()=>({conversion:Dy,priority:1}),pre:()=>({conversion:uc,priority:0}),table:e=>_s(e)?{conversion:By,priority:3}:null,td:e=>{const t=e,r=t.closest("table");return t.classList.contains("js-file-line")||r&&_s(r)?{conversion:dc,priority:3}:null},tr:e=>{const t=e.closest("table");return t&&_s(t)?{conversion:dc,priority:3}:null}}}static importJSON(e){return Dt().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(),i=r.length;if(i>=2&&r[i-1].getTextContent()===`
|
|
16
|
-
`&&r[i-2].getTextContent()===`
|
|
17
|
-
`&&e.isCollapsed()&&e.anchor.key===this.__key&&e.anchor.offset===i){r[i-1].remove(),r[i-2].remove();const l=ve();return this.insertAfter(l,t),l}const{anchor:s,focus:o}=e,a=(s.isBefore(o)?s:o).getNode();if($(a)){let l=zy(a);const u=[];for(;;)if(Pi(l))u.push(Qn()),l=l.getNextSibling();else{if(!hf(l))break;{let y=0;const x=l.getTextContent(),p=l.getTextContentSize();for(;y<p&&x[y]===" ";)y++;if(y!==0&&u.push(gf(" ".repeat(y))),y!==p)break;l=l.getNextSibling()}}const c=a.splitText(s.offset)[0],f=s.offset===0?0:1,d=c.getIndexWithinParent()+f,h=a.getParentOrThrow(),g=[ft(),...u];h.splice(d,0,g);const m=u[u.length-1];m?m.select():s.offset===0?c.selectPrevious():c.getNextSibling().selectNext(0,0)}if(ia(a)){const{offset:l}=e.anchor;a.splice(l,0,[ft()]),a.select(l+1,l+1)}return null}canIndent(){return!1}collapseAtStart(){const e=ve();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 Dt(n,e){return Ed(qi).setLanguage(n).setTheme(e)}function ia(n){return n instanceof qi}function uc(n){return{node:Dt(n.getAttribute(cr))}}function Dy(n){const e=n,t=fc(e);return t||(function(r){let i=r.parentElement;for(;i!==null;){if(fc(i))return!0;i=i.parentElement}return!1})(e)?{node:t?Dt():null}:{node:null}}function By(){return{node:Dt()}}function dc(){return{node:null}}function fc(n){return n.style.fontFamily.match("monospace")!==null}function _s(n){return n.classList.contains("js-file-line-container")}let sa=class ff extends Ft{__highlightType;constructor(e="",t,r){super(e,r),this.__highlightType=t}static getType(){return"code-highlight"}static clone(e){return new ff(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=vs(e.theme,this.__highlightType);return gt(t,r),t}updateDOM(e,t,r){const i=super.updateDOM(e,t,r),s=vs(r.theme,e.__highlightType),o=vs(r.theme,this.__highlightType);return s!==o&&(s&&Ki(t,s),o&>(t,o)),i}static importJSON(e){return gf().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 Dt()}};function vs(n,e){return e&&n&&n.codeHighlight&&n.codeHighlight[e]}function gf(n="",e){return at(new sa(n,e))}function hf(n){return n instanceof sa}function jy(n,e){let t=n;for(let r=Ne(n,e);r&&(hf(r.origin)||Pi(r.origin));r=gm(r))t=r.origin;return t}function zy(n){return jy(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],i=[];/^\w+$/.test(t)||i.push(/\w+/.exec(t)[0]),t==="diff"&&i.push("bold"),n.languages.diff[t]={pattern:RegExp("^(?:["+r+`].*(?:\r
|
|
18
|
-
?|
|
|
19
|
-
|(?![\\s\\S])))+`,"m"),alias:i,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 Uy=new Set(["http:","https:","mailto:","sms:","tel:"]);class Xt extends et{__url;__target;__rel;__title;static getType(){return"link"}static clone(e){return new Xt(e.__url,{rel:e.__rel,target:e.__target,title:e.__title},e.__key)}constructor(e="",t={},r){super(r);const{target:i=null,rel:s=null,title:o=null}=t;this.__url=e,this.__target=i,this.__rel=s,this.__title=o}createDOM(e){const t=document.createElement("a");return this.updateLinkDOM(null,t,e),gt(t,e.theme.link),t}updateLinkDOM(e,t,r){if(qo(t)){e&&e.__url===this.__url||(t.href=this.sanitizeUrl(this.__url));for(const i of["target","rel","title"]){const s=`__${i}`,o=this[s];e&&e[s]===o||(o?t[i]=o:t.removeAttribute(i))}}}updateDOM(e,t,r){return this.updateLinkDOM(e,t,r),!1}static importDOM(){return{a:e=>({conversion:Ky,priority:1})}}static importJSON(e){return dn().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=hc(e);try{const t=new URL(hc(e));if(!Uy.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=dn(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(!P(t))return!1;const i=t.anchor.getNode(),s=t.focus.getNode();return this.isParentOf(i)&&this.isParentOf(s)&&t.getTextContent().length>0}isEmailURI(){return this.__url.startsWith("mailto:")}isWebSiteURI(){return this.__url.startsWith("https://")||this.__url.startsWith("http://")}}function Ky(n){let e=null;if(qo(n)){const t=n.textContent;(t!==null&&t!==""||n.children.length>0)&&(e=dn(n.getAttribute("href")||"",{rel:n.getAttribute("rel"),target:n.getAttribute("target"),title:n.getAttribute("title")}))}return{node:e}}function dn(n="",e){return at(new Xt(n,e))}function vt(n){return n instanceof Xt}class nr extends Xt{__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 nr(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 co().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(k(r)){const i=co(this.__url,{isUnlinked:this.__isUnlinked,rel:this.__rel,target:this.__target,title:this.__title});return r.append(i),i}return null}}function co(n="",e){return at(new nr(n,e))}function bt(n){return n instanceof nr}const uo=q("TOGGLE_LINK_COMMAND");function gc(n,e){if(n.type==="element"){const t=n.getNode();return k(t)||(function(r,...i){const s=new URL("https://lexical.dev/docs/error"),o=new URLSearchParams;o.append("code",r);for(const a of i)o.append("v",a);throw s.search=o.toString(),Error(`Minified Lexical error #${r}; visit ${s.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 xs(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:i}=e,s=e.rel===void 0?"noreferrer":e.rel,o=M();if(o===null||!P(o)&&!ke(o))return;if(ke(o)){const c=o.getNodes();return c.length===0?void 0:void c.forEach(f=>{if(t===null){const d=qe(f,h=>!bt(h)&&vt(h));d&&(d.insertBefore(f),d.getChildren().length===0&&d.remove())}else{const d=qe(f,h=>!bt(h)&&vt(h));if(d)d.setURL(t),r!==void 0&&d.setTarget(r),s!==void 0&&d.setRel(s);else{const h=dn(t,{rel:s,target:r});f.insertBefore(h),h.append(f)}}})}const a=o.extract();if(t===null){const c=new Set;return void a.forEach(f=>{const d=f.getParent();if(vt(d)&&!bt(d)){const h=d.getKey();if(c.has(h))return;(function(g,m){const y=new Set(m.filter(b=>g.isParentOf(b)).map(b=>b.getKey())),x=g.getChildren(),p=x.filter(b=>y.has(b.getKey()));if(p.length===x.length)return x.forEach(b=>g.insertBefore(b)),void g.remove();const _=x.findIndex(b=>y.has(b.getKey())),S=x.findLastIndex(b=>y.has(b.getKey())),C=_===0,v=S===x.length-1;if(C)p.forEach(b=>g.insertBefore(b));else if(v)for(let b=p.length-1;b>=0;b--)g.insertAfter(p[b]);else{for(let w=p.length-1;w>=0;w--)g.insertAfter(p[w]);const b=x.slice(S+1);if(b.length>0){const w=dn(g.getURL(),{rel:g.getRel(),target:g.getTarget(),title:g.getTitle()});p[p.length-1].insertAfter(w),b.forEach(E=>w.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),s!==void 0&&c.setRel(s),i!==void 0&&c.setTitle(i))};if(a.length===1){const c=a[0],f=qe(c,vt);if(f!==null)return u(f)}(function(c){const f=M();if(!P(f))return c();const d=hn(f),h=d.isBackward(),g=gc(d.anchor,h?-1:0),m=gc(d.focus,h?0:-1);if(c(),g||m){const y=M();if(P(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")}Me(hn(x))}}})(()=>{let c=null;for(const f of a){if(!f.isAttached())continue;const d=qe(f,vt);if(d){u(d);continue}if(k(f)){if(!f.isInline())continue;if(vt(f)){if(!(bt(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();vt(h)&&h.is(c)?h.append(f):(c=dn(t,{rel:s,target:r,title:i}),f.insertAfter(c),c.append(f))}})}const Wy=/^\+?[0-9\s()-]{5,}$/;function hc(n){return n.match(/^[a-z][a-z0-9+.-]*:/i)||n.match(/^[/#.]/)?n:n.includes("@")?`mailto:${n}`:Wy.test(n)?`tel:${n}`:`https://${n}`}function Vy(n,e){return st(no(()=>n.registerCommand(uo,t=>{const r=e.validateUrl.peek(),i=e.attributes.peek();if(t===null)return xs(null),!0;if(typeof t=="string")return!(r!==void 0&&!r(t))&&(xs(t,i),!0);{const{url:s,target:o,rel:a,title:l}=t;return xs(s,{...i,rel:a,target:o,title:l}),!0}},Ve)),no(()=>{const t=e.validateUrl.value;if(!t)return;const r=e.attributes.value;return n.registerCommand(Ai,i=>{const s=M();if(!P(s)||s.isCollapsed()||!qt(i,ClipboardEvent)||i.clipboardData===null)return!1;const o=i.clipboardData.getData("text");return!!t(o)&&!s.getNodes().some(a=>k(a))&&(n.dispatchCommand(uo,{...r,url:o}),i.preventDefault(),!0)},Ve)}))}function qy(n,e,t={}){const r=s=>{const o=s.target;if(!wn(o))return;const a=Ri(o);if(a===null)return;let l=null,u=null;if(a.update(()=>{const d=kt(o);if(d!==null){const h=qe(d,k);if(!e.disabled.peek())if(vt(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})(o,qo);g!==null&&(l=g.href,u=g.target)}}}),l===null||l==="")return;const c=n.getEditorState().read(M);if(P(c)&&!c.isCollapsed())return void s.preventDefault();const f=s.type==="auxclick"&&s.button===1;window.open(l,e.newTab.peek()||f||s.metaKey||s.ctrlKey||u==="_blank"?"_blank":"_self"),s.preventDefault()},i=s=>{s.button===1&&r(s)};return n.registerRootListener((s,o)=>{o!==null&&(o.removeEventListener("click",r),o.removeEventListener("mouseup",i)),s!==null&&(s.addEventListener("click",r,t),s.addEventListener("mouseup",i,t))})}function pc(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 pf(n,e){for(let t=0;t<e.length;t++){const r=e[t](n);if(r)return r}return null}const Hy=/[.,;\s]/;function Ci(n){return Hy.test(n)}function mf(n){return Ci(n[n.length-1])}function fo(n){return Ci(n[0])}function yf(n){let e=n.getPreviousSibling();return k(e)&&(e=e.getLastDescendant()),e===null||Ct(e)||$(e)&&mf(e.getTextContent())}function _f(n){let e=n.getNextSibling();return k(e)&&(e=e.getFirstDescendant()),e===null||Ct(e)||$(e)&&fo(e.getTextContent())}function Jy(n,e,t,r){return(n>0?Ci(t[n-1]):yf(r[0]))?e<t.length?Ci(t[e]):_f(r[r.length-1]):!1}function Gy(n,e,t){const r=[],i=[],s=[];let o=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),o+=c):f>=t?s.push(u):i.push(u),a+=c,l.shift()}return[o,r,i,s]}function Zy(n,e,t,r){const i=co(r.url,r.attributes);if(n.length===1){let s,o=n[0];e===0?[s,o]=o.splitText(t):[,s,o]=o.splitText(e,t);const a=xe(r.text);return a.setFormat(s.getFormat()),a.setDetail(s.getDetail()),a.setStyle(s.getStyle()),i.append(a),s.replace(i),o}if(n.length>1){const s=n[0];let o,a=s.getTextContent().length;e===0?o=s:[,o]=s.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=M(),f=c?c.getNodes().find($):void 0,d=xe(o.getTextContent());return d.setFormat(o.getFormat()),d.setDetail(o.getDetail()),d.setStyle(o.getStyle()),i.append(d,...l),f&&f===o&&(P(c)?d.select(c.anchor.offset,c.focus.offset):ke(c)&&d.select(0,d.getTextContent().length)),o.replace(i),u}}function bs(n,e,t){const r=n.getChildren(),i=r.length;for(let l=0;l<i;l++){const u=r[l];if(!$(u)||!u.isSimpleText())return ii(n),void t(null,n.getURL())}const s=n.getTextContent(),o=pf(s,e);if(o===null||o.text!==s||!yf(n)||!_f(n))return ii(n),void t(null,n.getURL());const a=n.getURL();if(a!==o.url&&(n.setURL(o.url),t(o.url,a)),o.attributes){const l=n.getRel();l!==o.attributes.rel&&(n.setRel(o.attributes.rel||null),t(o.attributes.rel||null,l));const u=n.getTarget();u!==o.attributes.target&&(n.setTarget(o.attributes.target||null),t(o.attributes.target||null,u))}}function ii(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 Yy={changeHandlers:[],matchers:[]};function Xy(n,e=Yy){const{matchers:t,changeHandlers:r}=e,i=(s,o)=>{for(const a of r)a(s,o)};return st(n.registerNodeTransform(Ft,s=>{const o=s.getParentOrThrow(),a=s.getPreviousSibling();if(bt(o)&&!o.getIsUnlinked())bs(o,t,i);else if(!vt(o)){if(s.isSimpleText()&&(fo(s.getTextContent())||!bt(a))){const l=(function(u){const c=[u];let f=u.getNextSibling();for(;f!==null&&$(f)&&f.isSimpleText()&&(c.push(f),!/[\s]/.test(f.getTextContent()));)f=f.getNextSibling();return c})(s);(function(u,c,f){let d=[...u];const h=d.map(x=>x.getTextContent()).join("");let g,m=h,y=0;for(;(g=pf(m,c))&&g!==null;){const x=g.index,p=x+g.length;if(Jy(y+x,y+p,h,d)){const[_,,S,C]=Gy(d,y+x,y+p),v=Zy(S,y+x-_,y+p-_,g);d=v?[v,...C]:C,f(g.url,null),y=0}else y+=p;m=m.substring(p)}})(l,t,i)}(function(l,u,c){const f=l.getPreviousSibling(),d=l.getNextSibling(),h=l.getTextContent();var g;!bt(f)||f.getIsUnlinked()||fo(h)&&(g=h,!(f.isEmailURI()?/^\.[a-zA-Z]{2,}/.test(g):/^\.[a-zA-Z0-9]{1,}/.test(g)))||(f.append(l),bs(f,u,c),c(null,f.getURL())),!bt(d)||d.getIsUnlinked()||mf(h)||(ii(d),bs(d,u,c),c(null,d.getURL()))})(s,t,i)}}),n.registerCommand(uo,s=>{const o=M();return s!==null||!P(o)||o.extract().forEach(a=>{const l=a.getParent();bt(l)&&(l.setIsUnlinked(!l.getIsUnlinked()),l.markDirty())}),!1},Ve))}function go(n,e){const t={};for(const r of n){const i=e(r);i&&(t[i]?t[i].push(r):t[i]=[r])}return t}function oa(n){const e=go(n,t=>t.type);return{element:e.element||[],multilineElement:e["multiline-element"]||[],textFormat:e["text-format"]||[],textMatch:e["text-match"]||[]}}const Ei=/[!-/:-@[-`{-~\s]/,Qy=/^\s{0,3}$/;function ho(n){if(!kr(n))return!1;const e=n.getFirstChild();return e==null||n.getChildrenSize()===1&&$(e)&&Qy.test(e.getTextContent())}function e_(n,e,t,r){for(const i of e){if(!i.export)continue;const s=i.export(n,o=>wi(o,t,r));if(s!=null)return s}return k(n)?wi(n,t,r):ae(n)?n.getTextContent():null}function wi(n,e,t,r,i){const s=[],o=n.getChildren();r||(r=[]),i||(i=[]);e:for(const a of o){for(const l of t){if(!l.export)continue;const u=l.export(a,c=>wi(c,e,t,r,[...i,...r]),(c,f)=>mc(c,f,e,r,i));if(u!=null){s.push(u);continue e}}Ct(a)?s.push(`
|
|
20
|
-
`):$(a)?s.push(mc(a,a.getTextContent(),e,r,i)):k(a)?s.push(wi(a,e,t,r,i)):ae(a)&&s.push(a.getTextContent())}return s.join("")}function mc(n,e,t,r,i){let s=n.getFormat()===0?e:(function(d){return d.replace(/^\s+|\s+$/g,h=>[...h].map(g=>"&#"+g.codePointAt(0)+";").join(""))})(e);n.hasFormat("code")||(s=s.replace(/([*_`~\\])/g,"\\$1"));let o="",a="",l="";const u=yc(n,!0),c=yc(n,!1),f=new Set;for(const d of t){const h=d.format[0],g=d.tag;Zr(n,h)&&!f.has(h)&&(f.add(h),Zr(u,h)&&r.find(m=>m.tag===g)||(r.push({format:h,tag:g}),o+=g))}for(let d=0;d<r.length;d++){const h=Zr(n,r[d].format),g=Zr(c,r[d].format);if(h&&g)continue;const m=[...r];for(;m.length>d;){const y=m.pop();i&&y&&i.find(x=>x.tag===y.tag)||(y&&typeof y.tag=="string"&&(h?g||(l+=y.tag):a+=y.tag),r.pop())}break}return s=o+s+l,a+s}function yc(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(k(t)){if(!t.isInline())break;const r=e?t.getLastDescendant():t.getFirstDescendant();if($(r))return r;t=e?t.getPreviousSibling():t.getNextSibling()}if($(t))return t;if(!k(t))return null}return null}function Zr(n,e){return $(n)&&n.hasFormat(e)}function t_(n,e){const t=(function(i,s){const o=i.match(s.openTagsRegExp);if(o==null)return null;for(const a of o){const l=a.replace(/^\s/,""),u=s.fullMatchRegExpByTag[l];if(u==null)continue;const c=i.match(u),f=s.transformersByTag[l];if(c!=null&&f!=null){if(f.intraword!==!1)return c;const{index:d=0}=c,h=i[d-1],g=i[d+c[0].length];if((!h||Ei.test(h))&&(!g||Ei.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 sn(n){return $(n)&&!n.hasFormat("code")}function on(n,e,t){let r=t_(n,e),i=(function(o,a){const l=o;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&&i&&(r.startIndex<=i.startIndex&&r.endIndex>=i.endIndex||i.startIndex>r.endIndex?i=null:r=null),r){const o=(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);sn(o.nodeAfter)&&on(o.nodeAfter,e,t),sn(o.nodeBefore)&&on(o.nodeBefore,e,t),sn(o.transformedNode)&&on(o.transformedNode,e,t)}else if(i){const o=(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,i.startIndex,i.endIndex,i.transformer,i.match);if(!o)return;sn(o.nodeAfter)&&on(o.nodeAfter,e,t),sn(o.nodeBefore)&&on(o.nodeBefore,e,t),sn(o.transformedNode)&&on(o.transformedNode,e,t)}const s=n.getTextContent().replace(/\\([*_`~\\])/g,"$1").replace(/&#(\d+);/g,(o,a)=>String.fromCodePoint(a));n.setTextContent(s)}function n_(n,e=!1){const t=oa(n),r=(function(i){const s={},o={},a=[],l="(?<![\\\\])";for(const u of i){const{tag:c}=u;s[c]=u;const f=c.replace(/(\*|\^|\+)/g,"\\$1");a.push(f),c.length===1?o[c]=c==="`"?new RegExp("(?<![\\\\`])(`)((?:\\\\`|[^`])+?)(`)(?!`)"):new RegExp(`(?<![\\\\${f}])(${f})((\\\\${f})?.*?[^${f}\\s](\\\\${f})?)((?<!\\\\)|(?<=\\\\\\\\))(${f})(?![\\\\${f}])`):o[c]=new RegExp(`(?<!\\\\)(${f})((\\\\${f})?.*?[^\\s](\\\\${f})?)((?<!\\\\)|(?<=\\\\\\\\))(${f})(?!\\\\)`)}return{fullMatchRegExpByTag:o,openTagsRegExp:new RegExp(`${l}(${a.join("|")})`,"g"),transformersByTag:s}})(t.textFormat);return(i,s)=>{const o=i.split(`
|
|
21
|
-
`),a=o.length,l=s||be();l.clear();for(let c=0;c<a;c++){const f=o[c],[d,h]=r_(o,c,t.multilineElement,l);d?c=h:i_(f,l,t.element,r,t.textMatch,e)}const u=l.getChildren();for(const c of u)!e&&ho(c)&&l.getChildrenSize()>1&&c.remove();M()!==null&&l.selectStart()}}function r_(n,e,t,r){for(const i of t){const{handleImportAfterStartMatch:s,regExpEnd:o,regExpStart:a,replace:l}=i,u=n[e].match(a);if(!u)continue;if(s){const g=s({lines:n,rootNode:r,startLineIndex:e,startMatch:u,transformer:i});if(g===null)continue;if(g)return g}const c=typeof o=="object"&&"regExp"in o?o.regExp:o,f=o&&typeof o=="object"&&"optional"in o?o.optional:!o;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 i_(n,e,t,r,i,s){const o=xe(n),a=ve();a.append(o),e.append(a);for(const{regExp:l,replace:u}of t){const c=n.match(l);if(c&&(o.setTextContent(n.slice(c[0].length)),u(a,[o],c,!0)!==!1))break}if(on(o,r,i),a.isAttached()&&n.length>0){const l=a.getPreviousSibling();if(!s&&(kr(l)||io(l)||J(l))){let u=l;if(J(l)){const c=l.getLastDescendant();u=c==null?null:qe(c,ee)}u!=null&&u.getTextContentSize()>0&&(u.splice(u.getChildrenSize(),0,[ft(),...a.getChildren()]),a.remove())}}}function s_(n,...e){const t=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",n);for(const i of e)r.append("v",i);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 vf=/^(\s*)(\d{1,})\.\s/,xf=/^(\s*)[-*+]\s/,o_=/^(\s*)(?:[-*+]\s)?\s?(\[(\s|x)?\])\s/i,po=/^(#{1,6})\s/,bf=/^>\s/,Sf=/^[ \t]*```([\w-]+)?/,mo=/[ \t]*```$/,a_=/^[ \t]*```[^`]+(?:(?:`{1,2}|`{4,})[^`]+)*```(?:[^`]|$)/,l_=/^(?:\|)(.+)(?:\|)\s?$/,c_=/^(\| ?:?-*:? ?)+\|\s?$/,_c=/^<[a-z_][\w-]*(?:\s[^<>]*)?\/?>/i,vc=/^<\/[a-z_][\w-]*\s*>/i,xc=n=>new RegExp(`(?:${n.source})$`,n.flags),ur=Uh("mdListMarker",{parse:n=>typeof n=="string"&&/^[-*+]$/.test(n)?n:"-"}),Cf=n=>(e,t,r,i)=>{const s=n(r);s.append(...t),e.replace(s),i||s.select(0,0)},Ef=n=>(e,t,r,i)=>{const s=e.getPreviousSibling(),o=e.getNextSibling(),a=tt(n==="check"?r[3]==="x":void 0),l=r[0].trim()[0],u=n!=="bullet"&&n!=="check"||l!==ur.parse(l)?void 0:l;if(J(o)&&o.getListType()===n){u&&es(o,ur,u);const f=o.getFirstChild();f!==null?f.insertBefore(a):o.append(a),e.remove()}else if(J(s)&&s.getListType()===n)u&&es(s,ur,u),s.append(a),e.remove();else{const f=Ge(n,n==="number"?Number(r[2]):void 0);u&&es(f,ur,u),f.append(a),e.replace(f)}a.append(...t),i||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)},aa=(n,e,t)=>{const r=[],i=n.getChildren();let s=0;for(const o of i)if(ee(o)){if(o.getChildrenSize()===1){const f=o.getFirstChild();if(J(f)){r.push(aa(f,e,t+1));continue}}const a=" ".repeat(4*t),l=n.getListType(),u=yu(n,ur),c=l==="number"?`${n.getStart()+s}. `:l==="check"?`${u} [${o.getChecked()?"x":" "}] `:u+" ";r.push(a+c+e(o)),s++}return r.join(`
|
|
22
|
-
`)},u_={dependencies:[Vi],export:(n,e)=>{if(!ty(n))return null;const t=Number(n.getTag().slice(1));return"#".repeat(t)+" "+e(n)},regExp:po,replace:Cf(n=>{const e="h"+n[1].length;return Bn(e)}),type:"element"},d_={dependencies:[Wi],export:(n,e)=>{if(!io(n))return null;const t=e(n).split(`
|
|
23
|
-
`),r=[];for(const i of t)r.push("> "+i);return r.join(`
|
|
24
|
-
`)},regExp:bf,replace:(n,e,t,r)=>{if(r){const s=n.getPreviousSibling();if(io(s))return s.splice(s.getChildrenSize(),0,[ft(),...e]),void n.remove()}const i=ta();i.append(...e),n.replace(i),r||i.select(0,0)},type:"element"},f_={dependencies:[qi],export:n=>{if(!ia(n))return null;const e=n.getTextContent();return"```"+(n.getLanguage()||"")+(e?`
|
|
25
|
-
`+e:"")+"\n```"},regExpEnd:{optional:!0,regExp:mo},regExpStart:Sf,replace:(n,e,t,r,i,s)=>{let o,a;if(!e&&i){if(i.length===1)r?(o=Dt(),a=t[1]+i[0]):(o=Dt(t[1]),a=i[0].startsWith(" ")?i[0].slice(1):i[0]);else{if(o=Dt(t[1]),i[0].trim().length===0)for(;i.length>0&&!i[0].length;)i.shift();else i[0]=i[0].startsWith(" ")?i[0].slice(1):i[0];for(;i.length>0&&!i[i.length-1].length;)i.pop();a=i.join(`
|
|
26
|
-
`)}const l=xe(a);o.append(l),n.append(o)}else e&&Cf(l=>Dt(l?l[1]:void 0))(n,e,t,s)},type:"multiline-element"},g_={dependencies:[kn,Yt],export:(n,e)=>J(n)?aa(n,e,0):null,regExp:xf,replace:Ef("bullet"),type:"element"},h_={dependencies:[kn,Yt],export:(n,e)=>J(n)?aa(n,e,0):null,regExp:vf,replace:Ef("number"),type:"element"},p_={format:["code"],tag:"`",type:"text-format"},m_={format:["highlight"],tag:"==",type:"text-format"},y_={format:["bold","italic"],tag:"***",type:"text-format"},__={format:["bold","italic"],intraword:!1,tag:"___",type:"text-format"},v_={format:["bold"],tag:"**",type:"text-format"},x_={format:["bold"],intraword:!1,tag:"__",type:"text-format"},b_={format:["strikethrough"],tag:"~~",type:"text-format"},S_={format:["italic"],tag:"*",type:"text-format"},C_={format:["italic"],intraword:!1,tag:"_",type:"text-format"},la={dependencies:[Xt],export:(n,e,t)=>{if(!vt(n)||bt(n))return null;const r=n.getTitle(),i=e(n);return r?`[${i}](${n.getURL()} "${r}")`:`[${i}](${n.getURL()})`},importRegExp:/(?:\[(.+?)\])(?:\((?:([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?)\))/,regExp:/(?:\[(.+?)\])(?:\((?:([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?)\))$/,replace:(n,e)=>{const[,t,r,i]=e,s=dn(r,{title:i}),o=t.split("[").length-1,a=t.split("]").length-1;let l=t,u="";if(o<a)return;if(o>a){const f=t.split("[");u="["+f[0],l=f.slice(1).join("[")}const c=xe(l);return c.setFormat(n.getFormat()),s.append(c),n.replace(s),u&&s.insertBefore(xe(u)),c},trigger:")",type:"text-match"},E_=[u_,d_,g_,h_],w_=[f_],T_=[p_,y_,__,v_,x_,m_,S_,C_,b_],N_=[la],Or=[...E_,...w_,...T_,...N_];function bc(n,e,t){const r=t.length;for(let i=e;i>=r;i--){const s=i-r;if(wf(n,s,t,0,r)&&n[s+r]!==" ")return s}return-1}function wf(n,e,t,r,i){for(let s=0;s<i;s++)if(n[e+s]!==t[r+s])return!1;return!0}function k_(n,e=Or){const t=oa(e),r=go(t.textFormat,({tag:o})=>o[o.length-1]),i=go(t.textMatch,({trigger:o})=>o);for(const o of e){const a=o.type;if(a==="element"||a==="text-match"||a==="multiline-element"){const l=o.dependencies;for(const u of l)n.hasNode(u)||s_(173,u.getType())}}const s=(o,a,l)=>{(function(u,c,f,d){const h=u.getParent();if(!ze(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(),[_,S]=c.splitText(f);if(y(u,S?[S,...p]:p,x,!1)!==!1)return _.remove(),!0}}return!1})(o,a,l,t.element)||(function(u,c,f,d){const h=u.getParent();if(!ze(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(),[S,C]=c.splitText(f);if(y(u,C?[C,..._]:_,p,null,null,!1)!==!1)return S.remove(),!0}}return!1})(o,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,i)||(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&&!wf(d,_,x,0,p)||d[_-1]===" ")continue;const S=d[h+1];if(y.intraword===!1&&S&&!Ei.test(S))continue;const C=u;let v=C,b=bc(d,_,x),w=v;for(;b<0&&(w=w.getPreviousSibling())&&!Ct(w);)if($(w)){if(w.hasFormat("code"))continue;const j=w.getTextContent();v=w,b=bc(j,j.length,x)}if(b<0||v===C&&b+p===_)continue;const E=v.getTextContent();if(b>0&&E[b-1]===g)continue;const N=E[b-1];if(y.intraword===!1&&N&&!Ei.test(N))continue;const A=C.getTextContent(),L=A.slice(0,_)+A.slice(h+1);C.setTextContent(L);const R=v===C?L:E;v.setTextContent(R.slice(0,b)+R.slice(b+p));const I=M(),D=Oi();Me(D);const K=h-p*(v===C?2:1)+1;D.anchor.set(v.__key,b,"text"),D.focus.set(C.__key,K,"text");for(const j of y.format)D.hasFormat(j)||D.formatText(j);D.anchor.set(D.focus.key,D.focus.offset,D.focus.type);for(const j of y.format)D.hasFormat(j)&&D.toggleFormat(j);return P(I)&&(D.format=I.format),!0}})(a,l,r)};return n.registerUpdateListener(({tags:o,dirtyLeaves:a,editorState:l,prevEditorState:u})=>{if(o.has(Gu)||o.has(cp)||n.isComposing())return;const c=l.read(M),f=u.read(M);if(!P(f)||!P(c)||!c.isCollapsed()||c.is(f))return;const d=c.anchor.key,h=c.anchor.offset,g=l._nodeMap.get(d);!$(g)||!a.has(d)||h!==1&&h>f.anchor.offset+1||n.update(()=>{if(!sn(g))return;const m=g.getParent();m===null||ia(m)||s(m,g,c.anchor.offset)})})}function A_(n,e=Or,t,r=!1,i=!1){const s=r?n:(function(o,a=!1){const l=o.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];a_.test(d)?c.push(d):Sf.test(d)||mo.test(d)?(u=!u,c.push(d)):u||d===""||h===""||!h||po.test(h)||po.test(d)||bf.test(d)||vf.test(d)||xf.test(d)||o_.test(d)||l_.test(d)||c_.test(d)||!a||_c.test(d)||vc.test(d)||xc(vc).test(h)||xc(_c).test(h)||mo.test(h)?c.push(d):c[c.length-1]=h+" "+d.trimStart()}return c.join(`
|
|
28
|
-
`)})(n,i);return n_(e,r)(s,t)}function F_(n=Or,e,t=!1){return(function(i,s=!1){const o=oa(i),a=[...o.multilineElement,...o.element],l=!s,u=o.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||be()).getChildren();for(let h=0;h<d.length;h++){const g=d[h],m=e_(g,a,u,o.textMatch);m!=null&&f.push(l&&h>0&&!ho(g)&&!ho(d[h-1])?`
|
|
29
|
-
`.concat(m):m)}return f.join(`
|
|
30
|
-
`)}})(n,t)(e)}function Sc(n,e){return n.getEditorState().read(()=>{const t=Te(e);return t!==null&&t.isSelected()})}function P_(n){const[e]=Ue(),[t,r]=F.useState(()=>Sc(e,n));return F.useEffect(()=>{let i=!0;const s=e.registerUpdateListener(()=>{i&&r(Sc(e,n))});return()=>{i=!1,s()}},[e,n]),[t,F.useCallback(i=>{e.update(()=>{let s=M();ke(s)||(s=Po(),Me(s)),ke(s)&&(i?s.add(n):s.delete(n))})},[e,n]),F.useCallback(()=>{e.update(()=>{const i=M();ke(i)&&i.clear()})},[e])]}function I_({nodeKey:n}){const[e]=Ue(),[t,r,i]=P_(n);return F.useEffect(()=>st(e.registerCommand(So,s=>{const o=e.getElementByKey(n);return s.target===o&&(s.shiftKey||i(),r(!t),!0)},Ve)),[i,e,t,n,r]),F.useEffect(()=>{const s=e.getElementByKey(n),o=e._config.theme.hrSelected??"selected";s!==null&&(t?gt(s,o):Ki(s,o))},[e,t,n]),null}class $r extends Ir{static getType(){return"horizontalrule"}static clone(e){return new $r(e.__key)}static importJSON(e){return Hi().updateFromJSON(e)}static importDOM(){return{hr:()=>({conversion:O_,priority:0})}}decorate(){return T.jsx(I_,{nodeKey:this.__key})}}function O_(){return{node:Hi()}}function Hi(){return at(new $r)}const $_=[{dependencies:[$r],export:n=>Im(n)?"***":null,regExp:/^(---|\*\*\*|___)\s?$/,replace:(n,e,t,r)=>{const i=Hi();r||n.getNextSibling()!=null?n.replace(i):n.insertBefore(i),i.selectNext()},type:"element"},...Or];function R_({transformers:n=$_}){const[e]=Ue();return F.useEffect(()=>k_(e,n),[e,n]),null}function M_({hasStrictIndent:n=!1}){const[e]=Ue();return F.useEffect(()=>{if(!e.hasNodes([kn,Yt]))throw new Error("ListPlugin: ListNode and/or ListItemNode not registered on editor")},[e]),F.useEffect(()=>{if(n)return Py(e)},[e,n]),(function(t){F.useEffect(()=>Fy(t),[t])})(e),null}var L_="uf0wxx0",D_="uf0wxx1",B_="uf0wxx2";function j_(n,e,t){F.useEffect(()=>{n.hasNodes([nr])||(function(r,...i){const s=new URL("https://lexical.dev/docs/error"),o=new URLSearchParams;o.append("code",r);for(const a of i)o.append("v",a);throw s.search=o.toString(),Error(`Minified Lexical error #${r}; visit ${s.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)})(77)}),F.useEffect(()=>Xy(n,{changeHandlers:t?[t]:[],matchers:e}),[n,e,t])}function z_({matchers:n,onChange:e}){const[t]=Ue();return j_(t,n,e),null}function U_(){const[n]=Ue();return F.useEffect(()=>wy(n),[n]),null}function K_({newTab:n=!0,disabled:e=!1}){const[t]=Ue();return F.useEffect(()=>qy(t,Vd({disabled:e,newTab:n})),[t,n,e]),null}function W_(){const[n]=Ue();return F.useEffect(()=>n.registerCommand(Fm,e=>{const t=M();if(!P(t))return!1;if(t.focus.getNode()!==null){const r=Hi();pm(r)}return!0},ne),[n]),null}function V_({validateUrl:n,attributes:e}){const[t]=Ue();return F.useEffect(()=>{if(!t.hasNodes([Xt]))throw new Error("LinkPlugin: LinkNode not registered on editor")}),F.useEffect(()=>Vy(t,Vd({attributes:e,validateUrl:n})),[t,n,e]),null}function q_({maxIndent:n}){const[e]=Ue();return F.useEffect(()=>Om(e,n),[e,n]),null}const H_=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?F.useLayoutEffect:F.useEffect;function J_({ignoreHistoryMergeTagChange:n=!0,ignoreSelectionChange:e=!1,onChange:t}){const[r]=Ue();return H_(()=>{if(t)return r.registerUpdateListener(({editorState:i,dirtyElements:s,dirtyLeaves:o,prevEditorState:a,tags:l})=>{e&&s.size===0&&o.size===0||n&&l.has(Kn)||a.isEmpty()||t(i,r,l)})},[r,n,e,t]),null}const G_=new RegExp(/((([A-Za-z]{3,9}:(?:\/\/)?)(?:[-;:&=+$,\w]+@)?[A-Za-z0-9.-]+|(?:www.|[-;:&=+$,\w]+@)[A-Za-z0-9.-]+)((?:\/[+~%/.\w-_]*)?\??(?:[-+=&;%@.\w_]*)#?(?:[\w]*))?)/);function Z_(n){return n==="https://"||G_.test(n)}function Y_(n){const e=Le.c(4),{hasLinkAttributes:t}=n,r=t===void 0?!1:t;let i;e[0]!==r?(i=r?{rel:"noopener noreferrer",target:"_blank"}:void 0,e[0]=r,e[1]=i):i=e[1];let s;return e[2]!==i?(s=T.jsx(V_,{validateUrl:Z_,attributes:i}),e[2]=i,e[3]=s):s=e[3],s}const X_=new RegExp("((https?:\\/\\/(www\\.)?)|(www\\.))[-a-zA-Z0-9@:%._+~#=]{1,256}\\.[a-zA-Z0-9()]{1,6}\\b([-a-zA-Z0-9()@:%_+.~#?&//=]*)(?<![-.+():%])"),Q_=/(([^<>()[\]\\.,;:\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,}))/,ev=[pc(X_,n=>n.startsWith("http")?n:`https://${n}`),pc(Q_,n=>`mailto:${n}`)];function tv(){const n=Le.c(1);let e;return n[0]===Symbol.for("react.memo_cache_sentinel")?(e=T.jsx(z_,{matchers:ev}),n[0]=e):e=n[0],e}const nv={...la,regExp:/(?:\[(.+?)\])(?:\((?:([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?)\))/},ca=Or.map(n=>n===la?nv:n),rv={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"},iv=[Vi,Wi,kn,Yt,qi,sa,Xt,nr,$r];function sv(n){const e=Le.c(2),{text:t}=n;let r;return e[0]!==t?(r=T.jsx("div",{className:B_,children:t}),e[0]=t,e[1]=r):r=e[1],r}function ov(n){const e=Le.c(4),{value:t}=n,[r]=Ue();let i;e[0]!==r||e[1]!==t?(i=()=>{t!==void 0&&r.update(()=>{A_(t,ca)})},e[0]=r,e[1]=t,e[2]=i):i=e[2];let s;return e[3]===Symbol.for("react.memo_cache_sentinel")?(s=[],e[3]=s):s=e[3],F.useEffect(i,s),null}function av(n){const e=Le.c(4),{onChange:t}=n;let r;e[0]!==t?(r=o=>{t&&o.read(()=>{const a=F_(ca);t(a)})},e[0]=t,e[1]=r):r=e[1];const i=r;let s;return e[2]!==i?(s=T.jsx(J_,{onChange:i}),e[2]=i,e[3]=s):s=e[3],s}function lv(n){const e=Le.c(20),{placeholder:t,value:r,onChange:i}=n,s=t===void 0?"Write your content here...":t;let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o={namespace:"MarkdownEditor",theme:rv,nodes:iv,onError:cv},e[0]=o):o=e[0];const a=o;let l;e[1]===Symbol.for("react.memo_cache_sentinel")?(l=T.jsx(uy,{className:D_}),e[1]=l):l=e[1];let u;e[2]!==s?(u=T.jsx(oy,{contentEditable:l,placeholder:T.jsx(sv,{text:s}),ErrorBoundary:my}),e[2]=s,e[3]=u):u=e[3];let c,f,d,h,g,m,y,x;e[4]===Symbol.for("react.memo_cache_sentinel")?(h=T.jsx(R_,{transformers:ca}),g=T.jsx(M_,{}),m=T.jsx(U_,{}),y=T.jsx(q_,{}),x=T.jsx(K_,{}),c=T.jsx(W_,{}),f=T.jsx(Y_,{}),d=T.jsx(tv,{}),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=T.jsx(ov,{value:r}),e[12]=r,e[13]=p):p=e[13];let _;e[14]!==i?(_=T.jsx(av,{onChange:i}),e[14]=i,e[15]=_):_=e[15];let S;return e[16]!==p||e[17]!==_||e[18]!==u?(S=T.jsx("div",{className:L_,children:T.jsxs(rm,{initialConfig:a,children:[u,h,g,m,y,x,c,f,d,p,_]})}),e[16]=p,e[17]=_,e[18]=u,e[19]=S):S=e[19],S}function cv(n){console.error("Lexical error:",n)}const uv=n=>{const e=Le.c(4);let t,r;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=T.jsx("title",{children:"Markdown"}),r=T.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 i;return e[2]!==n?(i=T.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]=i):i=e[3],i},dv=n=>{const e=Le.c(7),t=!!(n&&n.length>0);let r,i;e[0]!==n?(r=["provider-models",n],i=async()=>{if(!n)return[];const a=await(await vo.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]=i):(r=e[1],i=e[2]);let s;return e[3]!==t||e[4]!==r||e[5]!==i?(s={queryKey:r,queryFn:i,enabled:t,staleTime:3e5},e[3]=t,e[4]=r,e[5]=i,e[6]=s):s=e[6],Kc(s)},fv=()=>{const n=Le.c(12),{data:e,isLoading:t}=Sg(),{data:r,isLoading:i}=Cg();let s;n[0]!==e?(s=e?.map(gv),n[0]=e,n[1]=s):s=n[1];const o=r?.length;let a;n[2]!==s||n[3]!==o?(a=["configured-providers",s,o],n[2]=s,n[3]=o,n[4]=a):a=n[4];let l;n[5]!==e||n[6]!==r?(l=()=>{if(!e||!r)return[];const f=[];for(const d of e){if(!d.enabled)continue;const h=r.find(g=>g.id===d.providerId);h?f.push({id:h.id,name:h.name,logo:h.logo,configId:d.id,enabled:d.enabled}):f.push({id:d.providerId,name:d.providerId.charAt(0).toUpperCase()+d.providerId.slice(1),logo:`https://models.dev/logos/${d.providerId}.svg`,configId:d.id,enabled:d.enabled})}return f},n[5]=e,n[6]=r,n[7]=l):l=n[7];const u=!t&&!i;let c;return n[8]!==a||n[9]!==l||n[10]!==u?(c={queryKey:a,queryFn:l,enabled:u,staleTime:3e5},n[8]=a,n[9]=l,n[10]=u,n[11]=c):c=n[11],Kc(c)};function gv(n){return n.id}var hv="_1nagll30",Tf="_1nagll31",Cc="_1nagll32",pv="_1nagll33",mv="_1nagll34",Ss="_1nagll35",Cs="_1nagll36",yv="_1nagll37",_v="_1nagll38",vv="_1nagll39",xv="_1nagll3d",yo="_1nagll3e",Ec="_1nagll3f",wc="_1nagll3g",bv="_1nagll3h",Sv="_1nagll3i",Es="_1nagll3k",Tc="_1nagll3l",Cv="_1nagll3o",Ev="_1nagll3p",wv="_1nagll3q",ua="_1nagll3r";function Tv(n){const e=Le.c(2),{className:t}=n;let r;return e[0]!==t?(r=T.jsx(Wc,{className:t}),e[0]=t,e[1]=r):r=e[1],r}function Nv(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 Nf(n){const e=n.split("/");return e.length>1&&e[0].length>0?e[0]:null}function _o(n){return`https://models.dev/logos/${n}.svg`}function kv(n){const e=Le.c(47),{models:t,isLoading:r,selectedModelName:i,onSelect:s}=n;let o,a,l,u,c,f,d,h,g,m,y,x,p,_;if(e[0]!==r||e[1]!==t||e[2]!==s||e[3]!==i){const w=t?.reduce(Av,{}),E=w?Object.keys(w).sort():[];let N;e[18]!==t||e[19]!==i?(N=t?.find(D=>D.id===i),e[18]=t,e[19]=i,e[20]=N):N=e[20];const L=N?.name||i||"Select a model";u=kc,_=!1;let R;e[21]!==L?(R=T.jsx("span",{className:Es,children:L}),e[21]=L,e[22]=R):R=e[22];let I;e[23]===Symbol.for("react.memo_cache_sentinel")?(I=T.jsx(Wc,{className:Tc}),e[23]=I):I=e[23],e[24]!==R?(f=T.jsxs(Qf,{className:yo,children:[R,I]}),e[24]=R,e[25]=f):f=e[25],l=ma,a=ya,h=Ec,g="bottom",m=4,y="start",x="fixed",p=!0,o=_a,c=wc,d=r?T.jsx("div",{className:Ev,children:"Loading models..."}):E.length===0?T.jsx("div",{className:Cv,children:"No models available"}):E.map(D=>{const K=w?.[D],j=K?.providerId,U=K?.models;return T.jsxs(Pg,{children:[T.jsxs(Ig,{className:Sv,openOnHover:!0,delay:100,children:[j&&T.jsx("img",{src:_o(j),alt:"",className:ua}),T.jsx("span",{className:Es,children:D}),T.jsx(Eg,{className:Tc})]}),T.jsx(ma,{children:T.jsx(ya,{className:Ec,side:"right",sideOffset:4,align:"start",positionMethod:"fixed",sticky:!0,children:T.jsx(_a,{className:wc,children:U?.map(B=>{const re=i===B.id;return T.jsxs(Xf,{className:bv,onClick:()=>s(B.id),children:[T.jsx("span",{className:Es,children:B.name.split(":")[1]||B.id}),re&&T.jsx(Yc,{className:wv})]},B.id)})})})})]},D)}),e[0]=r,e[1]=t,e[2]=s,e[3]=i,e[4]=o,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 o=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 S;e[26]!==o||e[27]!==c||e[28]!==d?(S=T.jsx(o,{className:c,children:d}),e[26]=o,e[27]=c,e[28]=d,e[29]=S):S=e[29];let C;e[30]!==a||e[31]!==S||e[32]!==h||e[33]!==g||e[34]!==m||e[35]!==y||e[36]!==x||e[37]!==p?(C=T.jsx(a,{className:h,side:g,sideOffset:m,align:y,positionMethod:x,sticky:p,children:S}),e[30]=a,e[31]=S,e[32]=h,e[33]=g,e[34]=m,e[35]=y,e[36]=x,e[37]=p,e[38]=C):C=e[38];let v;e[39]!==l||e[40]!==C?(v=T.jsx(l,{children:C}),e[39]=l,e[40]=C,e[41]=v):v=e[41];let b;return e[42]!==u||e[43]!==f||e[44]!==v||e[45]!==_?(b=T.jsxs(u,{modal:_,children:[f,v]}),e[42]=u,e[43]=f,e[44]=v,e[45]=_,e[46]=b):b=e[46],b}function Av(n,e){const t=Nv(e.id),r=Nf(e.id);return n[t]||(n[t]={models:[],providerId:r}),n[t].models.push(e),n}function Fv(n){const e=Le.c(78),{value:t,onChange:r}=n,{data:i}=fv(),{data:s,isLoading:o}=dv(t.provider);let a,l;e[0]!==i||e[1]!==t.provider?(a=i?.map(Lv)||[],l=a.find(H=>H.value===t.provider)||null,e[0]=i,e[1]=t.provider,e[2]=a,e[3]=l):(a=e[2],l=e[3]);const u=l,c=t.modelName?t.modelName:(t.provider,"Select model");let f;e[4]!==r||e[5]!==t?(f=H=>{H&&r({...t,provider:H.value,modelName:""})},e[4]=r,e[5]=t,e[6]=f):f=e[6];const d=f;let h;e[7]!==r||e[8]!==t?(h=H=>{r({...t,modelName:H})},e[7]=r,e[8]=t,e[9]=h):h=e[9];const g=h;let m;e[10]!==r||e[11]!==t?(m=(H,ce)=>{r({...t,[H]:ce})},e[10]=r,e[11]=t,e[12]=m):m=e[12];const y=m;let x;if(e[13]!==t.modelName||e[14]!==t.provider){const H=Nf(t.modelName);x=H?_o(H):t.provider?_o(t.provider):null,e[13]=t.modelName,e[14]=t.provider,e[15]=x}else x=e[15];const p=x;let _;e[16]!==p?(_=p?T.jsx("img",{src:p,alt:"",className:ua}):T.jsx("span",{className:Tf,children:"?"}),e[16]=p,e[17]=_):_=e[17];const S=t.modelName?Cc:`${Cc} ${pv}`;let C;e[18]!==c||e[19]!==S?(C=T.jsx("span",{className:S,children:c}),e[18]=c,e[19]=S,e[20]=C):C=e[20];let v;e[21]===Symbol.for("react.memo_cache_sentinel")?(v=T.jsx(Tv,{className:xv}),e[21]=v):v=e[21];let b;e[22]!==_||e[23]!==C?(b=T.jsxs(Jc,{className:hv,children:[_,C,v]}),e[22]=_,e[23]=C,e[24]=b):b=e[24];let w;e[25]===Symbol.for("react.memo_cache_sentinel")?(w=T.jsx("span",{className:Cs,children:"Provider"}),e[25]=w):w=e[25];let E;e[26]!==d||e[27]!==a||e[28]!==u?(E=T.jsxs("div",{className:Ss,children:[w,a.length>0?T.jsx(xo,{items:a,value:u,onValueChange:d,itemToString:Mv,itemToIcon:Rv,placeholder:"Select provider"}):T.jsx("div",{className:yo,style:{color:"var(--gray9)"},children:"No providers configured"})]}),e[26]=d,e[27]=a,e[28]=u,e[29]=E):E=e[29];let N;e[30]===Symbol.for("react.memo_cache_sentinel")?(N=T.jsx("span",{className:Cs,children:"Model"}),e[30]=N):N=e[30];let A;e[31]!==g||e[32]!==o||e[33]!==s||e[34]!==t.modelName||e[35]!==t.provider?(A=T.jsxs("div",{className:Ss,children:[N,t.provider?T.jsx(kv,{models:s,isLoading:o,selectedModelName:t.modelName,onSelect:g}):T.jsx("div",{className:yo,style:{color:"var(--gray9)"},children:"Select a provider first"})]}),e[31]=g,e[32]=o,e[33]=s,e[34]=t.modelName,e[35]=t.provider,e[36]=A):A=e[36];let L;e[37]===Symbol.for("react.memo_cache_sentinel")?(L=T.jsx("span",{className:Cs,children:"Parameters"}),e[37]=L):L=e[37];const R=t.temperature??1;let I;e[38]!==y?(I=H=>y("temperature",H),e[38]=y,e[39]=I):I=e[39];let D;e[40]!==R||e[41]!==I?(D=T.jsx(jr,{label:"Temperature",value:R,min:0,max:2,step:.1,onValueChange:I,formatValue:$v}),e[40]=R,e[41]=I,e[42]=D):D=e[42];let K;e[43]===Symbol.for("react.memo_cache_sentinel")?(K=T.jsx("label",{className:vv,children:"Max Tokens"}),e[43]=K):K=e[43];const j=t.maxTokens??"";let U;e[44]!==r||e[45]!==t?(U=H=>{const ce=H.target.value?parseInt(H.target.value,10):void 0;r({...t,maxTokens:ce})},e[44]=r,e[45]=t,e[46]=U):U=e[46];let B;e[47]!==j||e[48]!==U?(B=T.jsxs("div",{className:_v,children:[K,T.jsx("input",{type:"number",className:Hc,value:j,placeholder:"Default",min:1,onChange:U})]}),e[47]=j,e[48]=U,e[49]=B):B=e[49];const re=t.topP??1;let te;e[50]!==y?(te=H=>y("topP",H),e[50]=y,e[51]=te):te=e[51];let G;e[52]!==re||e[53]!==te?(G=T.jsx(jr,{label:"Top P",value:re,min:0,max:1,step:.05,onValueChange:te,formatValue:Ov}),e[52]=re,e[53]=te,e[54]=G):G=e[54];const de=t.frequencyPenalty??0;let V;e[55]!==y?(V=H=>y("frequencyPenalty",H),e[55]=y,e[56]=V):V=e[56];let Y;e[57]!==de||e[58]!==V?(Y=T.jsx(jr,{label:"Frequency Penalty",value:de,min:-2,max:2,step:.1,onValueChange:V,formatValue:Iv}),e[57]=de,e[58]=V,e[59]=Y):Y=e[59];const X=t.presencePenalty??0;let le;e[60]!==y?(le=H=>y("presencePenalty",H),e[60]=y,e[61]=le):le=e[61];let Z;e[62]!==X||e[63]!==le?(Z=T.jsx(jr,{label:"Presence Penalty",value:X,min:-2,max:2,step:.1,onValueChange:le,formatValue:Pv}),e[62]=X,e[63]=le,e[64]=Z):Z=e[64];let Q;e[65]!==D||e[66]!==B||e[67]!==G||e[68]!==Y||e[69]!==Z?(Q=T.jsxs("div",{className:Ss,children:[L,T.jsxs("div",{className:yv,children:[D,B,G,Y,Z]})]}),e[65]=D,e[66]=B,e[67]=G,e[68]=Y,e[69]=Z,e[70]=Q):Q=e[70];let he;e[71]!==E||e[72]!==A||e[73]!==Q?(he=T.jsx(Gc,{side:"bottom",align:"start",sideOffset:4,positionMethod:"fixed",children:T.jsxs("div",{className:mv,children:[E,A,Q]})}),e[71]=E,e[72]=A,e[73]=Q,e[74]=he):he=e[74];let Ce;return e[75]!==b||e[76]!==he?(Ce=T.jsxs(Zc,{children:[b,he]}),e[75]=b,e[76]=he,e[77]=Ce):Ce=e[77],Ce}function Pv(n){return n.toFixed(1)}function Iv(n){return n.toFixed(1)}function Ov(n){return n.toFixed(2)}function $v(n){return n.toFixed(1)}function Rv(n){return n?.icon?T.jsx("img",{src:n.icon,alt:"",className:ua}):T.jsx("span",{className:Tf,children:n?.label?.charAt(0).toUpperCase()||"?"})}function Mv(n){return n?.label||""}function Lv(n){return{label:n.name,icon:n.logo,value:n.id}}const Dv=n=>{const e=Le.c(48),{form:t,editorKey:r}=n,{setValue:i,control:s}=t;let o;e[0]!==t.control?(o={control:t.control,name:"provider"},e[0]=t.control,e[1]=o):o=e[1];const a=Ut(o);let l;e[2]!==s?(l={control:s,name:"modelName"},e[2]=s,e[3]=l):l=e[3];const u=Ut(l);let c;e[4]!==s?(c={control:s,name:"system_prompt"},e[4]=s,e[5]=c):c=e[5];const f=Ut(c);let d;e[6]!==s?(d={control:s,name:"temperature"},e[6]=s,e[7]=d):d=e[7];const h=Ut(d);let g;e[8]!==s?(g={control:s,name:"maxTokens"},e[8]=s,e[9]=g):g=e[9];const m=Ut(g);let y;e[10]!==s?(y={control:s,name:"topP"},e[10]=s,e[11]=y):y=e[11];const x=Ut(y);let p;e[12]!==s?(p={control:s,name:"frequencyPenalty"},e[12]=s,e[13]=p):p=e[13];const _=Ut(p);let S;e[14]!==s?(S={control:s,name:"presencePenalty"},e[14]=s,e[15]=S):S=e[15];const C=Ut(S),v=a||"",b=u||"";let w;e[16]!==_||e[17]!==m||e[18]!==C||e[19]!==b||e[20]!==v||e[21]!==h||e[22]!==x?(w={provider:v,modelName:b,temperature:h,maxTokens:m,topP:x,frequencyPenalty:_,presencePenalty:C},e[16]=_,e[17]=m,e[18]=C,e[19]=b,e[20]=v,e[21]=h,e[22]=x,e[23]=w):w=e[23];const E=w;let N;e[24]!==_||e[25]!==m||e[26]!==C||e[27]!==u||e[28]!==a||e[29]!==i||e[30]!==h||e[31]!==x?(N=B=>{B.provider!==a&&i("provider",B.provider,{shouldValidate:!0,shouldDirty:!0}),B.modelName!==u&&i("modelName",B.modelName,{shouldValidate:!0,shouldDirty:!0}),B.temperature!==h&&i("temperature",B.temperature,{shouldValidate:!0,shouldDirty:!0}),B.maxTokens!==m&&i("maxTokens",B.maxTokens,{shouldValidate:!0,shouldDirty:!0}),B.topP!==x&&i("topP",B.topP,{shouldValidate:!0,shouldDirty:!0}),B.frequencyPenalty!==_&&i("frequencyPenalty",B.frequencyPenalty,{shouldValidate:!0,shouldDirty:!0}),B.presencePenalty!==C&&i("presencePenalty",B.presencePenalty,{shouldValidate:!0,shouldDirty:!0})},e[24]=_,e[25]=m,e[26]=C,e[27]=u,e[28]=a,e[29]=i,e[30]=h,e[31]=x,e[32]=N):N=e[32];const A=N;let L;e[33]===Symbol.for("react.memo_cache_sentinel")?(L=T.jsxs("div",{className:va,children:[T.jsx(Uc,{icon:Qg,size:"xs"}),T.jsx("span",{children:"Model"})]}),e[33]=L):L=e[33];let R;e[34]!==A||e[35]!==E?(R=T.jsxs("div",{className:cg,children:[L,T.jsx("div",{className:ug,children:T.jsx(Fv,{value:E,onChange:A})})]}),e[34]=A,e[35]=E,e[36]=R):R=e[36];let I;e[37]===Symbol.for("react.memo_cache_sentinel")?(I=T.jsx("span",{children:"System"}),e[37]=I):I=e[37];let D;e[38]===Symbol.for("react.memo_cache_sentinel")?(D=T.jsxs("div",{className:va,children:[I,T.jsxs("div",{className:dg,children:[T.jsx(uv,{width:14,height:14}),T.jsx("span",{children:"Markdown Supported"})]})]}),e[38]=D):D=e[38];let K;e[39]!==i?(K=B=>i("system_prompt",B,{shouldValidate:!0,shouldDirty:!0}),e[39]=i,e[40]=K):K=e[40];let j;e[41]!==r||e[42]!==f||e[43]!==K?(j=T.jsxs("div",{className:fg,children:[D,T.jsx(lv,{value:f,onChange:K},r)]}),e[41]=r,e[42]=f,e[43]=K,e[44]=j):j=e[44];let U;return e[45]!==R||e[46]!==j?(U=T.jsxs("div",{className:gg,children:[R,j]}),e[45]=R,e[46]=j,e[47]=U):U=e[47],U},Bv=["variants-list"],jv=()=>{const n=Le.c(2),e=Vc();let t;return n[0]!==e?(t={mutationFn:zv,onSuccess:(r,i)=>{e.invalidateQueries({queryKey:Bv}),e.invalidateQueries({queryKey:wg(i.configId)})}},n[0]=e,n[1]=t):t=n[1],Xc(t)};async function zv(n){const t=await(await vo.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 Uv=()=>{const n=Le.c(2),e=Vc();let t;return n[0]!==e?(t={mutationFn:Kv,onSuccess:(r,i)=>{e.invalidateQueries({queryKey:hg(i.variantId)}),e.invalidateQueries({queryKey:["variant",i.variantId]})}},n[0]=e,n[1]=t):t=n[1],Xc(t)};async function Kv(n){const e=await vo.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 gx(){const{id:n,variant:e}=eg.useParams(),t=tg(),r=jv(),i=Uv(),s=pg(),{data:o}=ng(e==="new"?"":e),{data:a}=Tg(n),{data:l}=mg(e==="new"?"":e),{data:u}=Ng(n),[c,f]=F.useState("new"),[d,h]=F.useState(null),g=e==="new",m=ag({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||i.isPending||s.isPending,p=l?[...l].sort((v,b)=>b.version-v.version):[];F.useEffect(()=>{if(l&&l.length>0&&!d){const v=a?.find(w=>w.variantId===e),b=u?.find(w=>v&&w.configVariantId===v.id&&w.variantVersionId);if(b?.variantVersionId)h(b.variantVersionId);else{const w=l.reduce((E,N)=>N.version>E.version?N:E);h(w.id)}}},[l,d,a,u,e]),Fg({shouldBlockFn:()=>x?!1:y?!confirm("You have unsaved changes. Are you sure you want to move away from the form?"):!1}),F.useEffect(()=>{if(o&&d&&l){const v=l.find(w=>w.id===d);if(!v)return;const b=typeof v.jsonData=="string"?JSON.parse(v.jsonData):v.jsonData;m.reset({variant_name:o.name||"",provider:v.provider||"",modelName:b?.model||v.modelName||"",system_prompt:b?.system_prompt||"",temperature:b?.temperature,maxTokens:b?.max_tokens,topP:b?.top_p,frequencyPenalty:b?.frequency_penalty,presencePenalty:b?.presence_penalty},{keepDirty:!1}),f(`${o.id}-${d}`)}},[o,d,l]);const _=v=>{const b={system_prompt:v.system_prompt,model:v.modelName};return v.temperature!==void 0&&(b.temperature=v.temperature),v.maxTokens!==void 0&&(b.max_tokens=v.maxTokens),v.topP!==void 0&&(b.top_p=v.topP),v.frequencyPenalty!==void 0&&(b.frequency_penalty=v.frequencyPenalty),v.presencePenalty!==void 0&&(b.presence_penalty=v.presencePenalty),b},S=v=>{if(!a||a.length===0)return v;const b=new Set(a.map(N=>N.name));if(!b.has(v))return v;let w=2,E=`${v} (${w})`;for(;b.has(E);)w++,E=`${v} (${w})`;return E},C=async v=>{const b=m.getValues();if(!(!b.variant_name.trim()||!b.provider||!b.modelName))try{const w=_(b);if(v.mode==="new_variant"||g){const E=v.mode==="new_variant"&&!g?S(b.variant_name):b.variant_name,N=await r.mutateAsync({configId:n,name:E,provider:b.provider,modelName:b.modelName,jsonData:w});v.deployToEnvironment&&v.environmentId&&N&&await s.mutateAsync({environmentId:v.environmentId,configId:n,configVariantId:N.configVariant.id,variantVersionId:N.version.id})}else{const E=await i.mutateAsync({variantId:e,provider:b.provider,modelName:b.modelName,jsonData:w});if(v.deployToEnvironment&&v.environmentId){const N=a?.find(A=>A.variantId===e);N&&E&&await s.mutateAsync({environmentId:v.environmentId,configId:n,configVariantId:N.id,variantVersionId:E.id})}}m.reset(),t({to:"/configs/$id/variants",params:{id:n}})}catch(w){console.error("Error saving variant:",w)}};return T.jsxs("div",{children:[T.jsxs("div",{className:yg,children:[T.jsx("input",{title:"Variant Name","data-1p-ignore":!0,autoComplete:"off",placeholder:"Variant Name",className:Hc,...m.register("variant_name")}),T.jsxs("div",{className:_g,children:[!g&&p.length>0&&T.jsx(xo,{items:p,value:p.find(v=>v.id===d)??null,onValueChange:v=>{(v&&!y||v&&y&&confirm("You have unsaved changes. Switching versions will discard them. Continue?"))&&h(v.id)},placeholder:"Select version...",itemToString:v=>v?`Version ${v.version}`:""}),T.jsx(_h,{isNewVariant:g,onSave:C,isSaving:x})]})]}),T.jsx("div",{className:vg,children:T.jsx(Dv,{form:m,editorKey:c})})]})}export{gx as component};
|