Skip to content

Soul-driven AI agent with permission-hardened tools, token budgets, and multi-channel access. Runs 24/7 from CLI, Telegram or More.

57.6 KB
Raw Blame
"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([["6074"],{17645(e,t,r){r.d(t,{J_:()=>g,x:()=>l,Gx:()=>k,Ki:()=>N,kJ:()=>x,OU:()=>C,e7:()=>d,in:()=>c});var a=r(74848),s=r(96540),n=r(52260),i=r(78491);function l(){let e=(0,i.A)(),t=e?.data?.blogMetadata;if(!t)throw Error("useBlogMetadata() can't be called on the current route because the blog metadata could not be found in route context");return t}let o=s.createContext(null);function c({children:e,content:t,isBlogPostPage:r=!1}){let n=function({content:e,isBlogPostPage:t}){return(0,s.useMemo)(()=>({metadata:e.metadata,frontMatter:e.frontMatter,assets:e.assets,toc:e.toc,isBlogPostPage:t}),[e,t])}({content:t,isBlogPostPage:r});return(0,a.jsx)(o.Provider,{value:n,children:e})}function d(){let e=(0,s.useContext)(o);if(null===e)throw new n.dV("BlogPostProvider");return e}var m=r(66497),h=r(10898);let u=e=>new Date(e).toISOString();function j(e){let t=e.map(f);return{author:1===t.length?t[0]:t}}function p(e,t,r){return e?{image:function({imageUrl:e,caption:t}){return{"@type":"ImageObject","@id":e,url:e,contentUrl:e,caption:t}}({imageUrl:t(e,{absolute:!0}),caption:`title image for the blog post: ${r}`})}:{}}function x(e){let{siteConfig:t}=(0,h.A)(),{withBaseUrl:r}=(0,m.hH)(),{metadata:{blogDescription:a,blogTitle:s,permalink:n}}=e,i=`${t.url}${n}`;return{"@context":"https://schema.org","@type":"Blog","@id":i,mainEntityOfPage:i,headline:s,description:a,blogPost:e.items.map(e=>(function(e,t,r){let{assets:a,frontMatter:s,metadata:n}=e,{date:i,title:l,description:o,lastUpdatedAt:c}=n,d=a.image??s.image,m=s.keywords??[],h=`${t.url}${n.permalink}`,x=c?u(c):void 0;return{"@type":"BlogPosting","@id":h,mainEntityOfPage:h,url:h,headline:l,name:l,description:o,datePublished:i,...x?{dateModified:x}:{},...j(n.authors),...p(d,r,l),...m?{keywords:m}:{}}})(e.content,t,r))}}function g(){let e=l(),{assets:t,metadata:r}=d(),{siteConfig:a}=(0,h.A)(),{withBaseUrl:s}=(0,m.hH)(),{date:n,title:i,description:o,frontMatter:c,lastUpdatedAt:x}=r,g=t.image??c.image,f=c.keywords??[],b=x?u(x):void 0,v=`${a.url}${r.permalink}`;return{"@context":"https://schema.org","@type":"BlogPosting","@id":v,mainEntityOfPage:v,url:v,headline:i,name:i,description:o,datePublished:n,...b?{dateModified:b}:{},...j(r.authors),...p(g,s,i),...f?{keywords:f}:{},isPartOf:{"@type":"Blog","@id":`${a.url}${e.blogBasePath}`,name:e.blogTitle}}}function f(e){return{"@type":"Person",...e.name?{name:e.name}:{},...e.title?{description:e.title}:{},...e.url?{url:e.url}:{},...e.email?{email:e.email}:{},...e.imageURL?{image:e.imageURL}:{}}}var b=r(56347),v=r(95310),y=r(80618),w=r(19209);function k(e){let{pathname:t}=(0,b.zy)();return(0,s.useMemo)(()=>e.filter(e=>!e.unlisted||!!(0,w.ys)(e.permalink,t)),[e,t])}function N(e){let t=Object.entries((0,y.$z)(e,e=>`${new Date(e.date).getFullYear()}`));return t.reverse(),t}function C({items:e,ulClassName:t,liClassName:r,linkClassName:s,linkActiveClassName:n}){return(0,a.jsx)("ul",{className:t,children:e.map(e=>(0,a.jsx)("li",{className:r,children:(0,a.jsx)(v.A,{isNavLink:!0,to:e.permalink,className:s,activeClassName:n,children:e.title})},e.permalink))})}},99978(e,t,r){r.d(t,{A:()=>i});var a=r(74848);r(96540);var s=r(53572),n=r(10898);function i({permalink:e,title:t,imageAlt:r,image:l,labels:o=[],creators:c=[],section:d,breadcrumbs:m}){let{siteConfig:h}=(0,n.A)(),u=e=>/^https?:/.test(e)?e:`${h.url}${e}`,j=u(l??`/img/og${e.replace(/\/$/,"")}.jpg?v=2`),p=/\.jpe?g(\?|$)/i.test(j),x=m&&{"@context":"https://schema.org","@type":"BreadcrumbList",itemListElement:m.map((e,t)=>({"@type":"ListItem",position:t+1,name:e.name,item:u(e.path)}))};return(0,a.jsxs)(s.A,{children:[(0,a.jsx)("meta",{property:"og:image",content:j}),(0,a.jsx)("meta",{property:"og:image:secure_url",content:j}),!l&&(0,a.jsx)("meta",{property:"og:image:type",content:p?"image/jpeg":"image/png"}),!l&&(0,a.jsx)("meta",{property:"og:image:width",content:"1200"}),!l&&(0,a.jsx)("meta",{property:"og:image:height",content:"630"}),(0,a.jsx)("meta",{property:"og:image:alt",content:r}),(0,a.jsx)("meta",{name:"twitter:card",content:"summary_large_image"}),(0,a.jsx)("meta",{name:"twitter:image",content:j}),(0,a.jsx)("meta",{name:"twitter:image:alt",content:r}),(0,a.jsx)("meta",{property:"og:title",content:t}),(0,a.jsx)("meta",{name:"twitter:title",content:t}),c[0]&&(0,a.jsx)("meta",{name:"twitter:creator",content:c[0]}),d&&(0,a.jsx)("meta",{property:"article:section",content:d}),o.slice(0,2).flatMap(([e,t],r)=>[(0,a.jsx)("meta",{name:`twitter:label${r+1}`,content:e},`l${r}`),(0,a.jsx)("meta",{name:`twitter:data${r+1}`,content:t},`d${r}`)]),x&&(0,a.jsx)("script",{type:"application/ld+json",children:JSON.stringify(x)})]})}},21677(e,t,r){function a(e){return new Date(e).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric",timeZone:"UTC"})}function s(e){return e.map(({content:e})=>{let t=e.metadata;return{permalink:t.permalink,title:t.title,description:t.description,date:t.date,formattedDate:a(t.date),readingMinutes:Math.max(1,Math.round(t.readingTime??1)),category:t.tags[0]??null,tags:t.tags,authors:t.authors,image:e.assets?.image??t.frontMatter.image,featured:!0===t.frontMatter.featured}})}function n(e){return[e.title,e.description,e.category?.label,...e.tags.map(e=>e.label),...e.authors.map(e=>e.name)].filter(Boolean).join(" ").toLowerCase()}r.d(t,{Iw:()=>s,Yq:()=>a,wK:()=>n})},42595(e,t,r){r.r(t),r.d(t,{default:()=>I});var a=r(74848),s=r(96540),n=r(34164),i=r(60816),l=r(95310),o=r(53572),c=r(10898),d=r(34308),m=r(88287),h=r(17645);function u(){let{assets:e,metadata:t}=(0,h.e7)(),{title:r,description:s,date:n,tags:i,authors:l,frontMatter:o}=t,{keywords:c}=o,m=e.image??o.image;return(0,a.jsxs)(d.be,{title:o.title_meta??r,description:s,keywords:c,image:m,children:[(0,a.jsx)("meta",{property:"og:type",content:"article"}),(0,a.jsx)("meta",{property:"article:published_time",content:n}),l.some(e=>e.url)&&(0,a.jsx)("meta",{property:"article:author",content:l.map(e=>e.url).filter(Boolean).join(",")}),i.length>0&&(0,a.jsx)("meta",{property:"article:tag",content:i.map(e=>e.label).join(",")})]})}function j(){let e=(0,h.J_)();return(0,a.jsx)(o.A,{children:(0,a.jsx)("script",{type:"application/ld+json",children:JSON.stringify(e)})})}var p=r(64417),x=r(10254);function g({toc:e,minHeadingLevel:t,maxHeadingLevel:r}){return(0,a.jsx)("div",{className:"tableOfContentsInline_prmo",children:(0,a.jsx)(x.A,{toc:e,minHeadingLevel:t,maxHeadingLevel:r,className:"table-of-contents",linkClassName:null})})}var f=r(46318),b=r(21677),v=r(99978);function y(e){return e.ratio>=.995?"Finished":e.minutesLeft<=1?"Under a minute left":`${e.minutesLeft} min left`}function w({progress:e}){let t=Math.round(100*e.ratio);return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"mj-progress",role:"progressbar","aria-label":"Reading progress","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":t,children:(0,a.jsx)("span",{style:{transform:`scaleX(${e.ratio})`}})}),(0,a.jsxs)("button",{type:"button",className:`mj-progress-pill${e.started?" is-on":""}`,onClick:()=>window.scrollTo({top:0,behavior:"smooth"}),"aria-label":`${y(e)}. Back to top`,tabIndex:e.started?0:-1,children:[(0,a.jsxs)("svg",{viewBox:"0 0 20 20",width:"18",height:"18","aria-hidden":"true",children:[(0,a.jsx)("circle",{cx:"10",cy:"10",r:"8",className:"mj-ring-bg"}),(0,a.jsx)("circle",{cx:"10",cy:"10",r:"8",className:"mj-ring",style:{strokeDashoffset:50.27*(1-e.ratio)}})]}),(0,a.jsx)("span",{children:y(e)})]})]})}let k=[.75,1,1.25,1.5,1.75,2],N="mj-listen-voice",C="mj-listen-rate",$=/\b(albert|bad news|bahh|bells|boing|bubbles|cellos|good news|jester|organ|superstar|trinoids|whisper|wobble|zarvox|junior|ralph|kathy|fred|grandma|grandpa|rocko|shelley|sandy|flo|eddy|reed)\b/i;function M(e){let t=e.name.toLowerCase(),r=0;return/^en(-|_|$)/i.test(e.lang)?(r+=100,/en[-_]us/i.test(e.lang)?r+=12:/en[-_](gb|au|ca|ie|nz)/i.test(e.lang)&&(r+=8),/natural|neural/.test(t)&&(r+=60),/online/.test(t)&&(r+=20),/premium/.test(t)&&(r+=45),/enhanced/.test(t)&&(r+=35),/^google/.test(t)&&(r+=40),/siri/.test(t)&&(r+=30),/samantha|ava|allison|evan|zoe|serena|daniel|karen|moira/.test(t)&&(r+=10),/compact|espeak|mbrola/.test(t)&&(r-=50),$.test(t)&&(r-=80),e.default&&(r+=2),r):-1}function S(e){return e.name.replace(/^Microsoft\s+/i,"").replace(/\s+Online\s+\(Natural\)/i," (Natural)").replace(/\s+-\s+English.*$/i,"").trim()}function B(e,t){try{if(void 0===t)return window.localStorage.getItem(e);window.localStorage.setItem(e,t)}catch{}return null}let L=[[".theme-code-block, .mj-gh-code, pre","Code sample skipped."],["table, .mj-compare","Table skipped."],[".mj-diagram","Diagram skipped."],[".mj-chart, .mj-stats","Chart skipped."]];function A(e){return e.replace(/[\u200b\u200c\u200d\ufeff]/g,"").replace(/\s+/g," ").trim()}function E(e){return e<1?"under a minute":`${Math.round(e)} min`}let T={play:(0,a.jsx)("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:(0,a.jsx)("path",{fill:"currentColor",d:"M8 5.5v13a1 1 0 0 0 1.5.86l10.4-6.5a1 1 0 0 0 0-1.72L9.5 4.64A1 1 0 0 0 8 5.5Z"})}),pause:(0,a.jsxs)("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:[(0,a.jsx)("rect",{x:"6.5",y:"5",width:"4",height:"14",rx:"1.2",fill:"currentColor"}),(0,a.jsx)("rect",{x:"13.5",y:"5",width:"4",height:"14",rx:"1.2",fill:"currentColor"})]}),back:(0,a.jsx)("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:(0,a.jsx)("path",{fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",d:"M11 7 6 12l5 5M18 7l-5 5 5 5"})}),fwd:(0,a.jsx)("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:(0,a.jsx)("path",{fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",d:"m13 7 5 5-5 5M6 7l5 5-5 5"})}),close:(0,a.jsx)("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:(0,a.jsx)("path",{fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",d:"m7 7 10 10M17 7 7 17"})}),wave:(0,a.jsx)("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:(0,a.jsxs)("g",{fill:"currentColor",children:[(0,a.jsx)("rect",{x:"3",y:"10",width:"2.2",height:"4",rx:"1.1"}),(0,a.jsx)("rect",{x:"7.2",y:"7",width:"2.2",height:"10",rx:"1.1"}),(0,a.jsx)("rect",{x:"11.4",y:"4",width:"2.2",height:"16",rx:"1.1"}),(0,a.jsx)("rect",{x:"15.6",y:"7.5",width:"2.2",height:"9",rx:"1.1"}),(0,a.jsx)("rect",{x:"19.8",y:"10",width:"2.2",height:"4",rx:"1.1"})]})})};function R({title:e,articleRef:t,minutes:r}){let[n,i]=(0,s.useState)(!1),[l,o]=(0,s.useState)([]),[c,d]=(0,s.useState)(null),[m,h]=(0,s.useState)(1),[u,j]=(0,s.useState)(!1),[p,x]=(0,s.useState)(!1),[g,f]=(0,s.useState)(0),[b,v]=(0,s.useState)(!1),[y,w]=(0,s.useState)(!1),$=(0,s.useRef)([]),P=(0,s.useRef)(0),_=(0,s.useRef)(!1),Z=(0,s.useRef)(1),I=(0,s.useRef)(null),q=(0,s.useRef)(0),D=(0,s.useRef)(null),O=(0,s.useRef)(null);(0,s.useEffect)(()=>{if("u"<typeof window||!("speechSynthesis"in window)||"u"<typeof SpeechSynthesisUtterance)return;let e=window.speechSynthesis,t=()=>{let t=e.getVoices().filter(e=>M(e)>0).sort((e,t)=>M(t)-M(e));if(0===t.length)return;o(t),i(!0);let r=B(N),a=t.find(e=>e.name===r)??t[0];I.current=a,d(a.name)};t(),e.addEventListener?.("voiceschanged",t);let r=Number(B(C));return k.includes(r)&&(Z.current=r,h(r)),()=>{e.removeEventListener?.("voiceschanged",t),q.current+=1,e.cancel()}},[]);let z=(0,s.useCallback)(()=>{let e=$.current,t=e[e.length-1];return t?t.offset+t.text.length:1},[]),V=(0,s.useCallback)(e=>{if(O.current===e||(O.current?.classList.remove("mj-listen-active"),O.current=e,!e))return;e.classList.add("mj-listen-active");let t=e.getBoundingClientRect();(t.top<90||t.bottom>window.innerHeight-110)&&e.scrollIntoView({behavior:"smooth",block:"center"})},[]),F=(0,s.useCallback)(e=>{let t=window.speechSynthesis,r=++q.current;t.cancel();let a=e=>{if(r!==q.current)return;let s=$.current;if(e>=s.length){_.current=!1,x(!1),P.current=0,f(0),V(null);return}P.current=e,f(e),V(s[e].el);let n=new SpeechSynthesisUtterance(s[e].text);I.current&&(n.voice=I.current,n.lang=I.current.lang),n.rate=Z.current,n.onend=()=>a(e+1),n.onerror=t=>{"interrupted"!==t.error&&"canceled"!==t.error&&a(e+1)},t.speak(n)};a(e)},[V]),W=(0,s.useCallback)(()=>(0===$.current.length&&t.current&&($.current=function(e,t){let r,a,s=[],n=0,i=(e,t)=>{s.push({text:e,el:t,offset:n}),n+=e.length+1};for(let s of(i(e.endsWith(".")?e:`${e}.`,null),r=[],a=e=>{for(let[t,a]of L)if(e.matches(t))return void r.push({text:a,el:e});if(e.matches(".mj-embed, img, hr, details, .mj-tools, script, style, svg"))return;if(e.matches("ul, ol, blockquote, .theme-admonition, div")&&(e.children.length>0||e.matches(".theme-admonition"))){if(e.matches(".theme-admonition")){let t=e.querySelector('[class*="admonitionHeading"]');t&&r.push({text:A(t.textContent??""),el:e});let s=e.querySelector('[class*="admonitionContent"]');s&&[...s.children].forEach(a);return}[...e.children].forEach(a);return}if(e.matches("li")){let t=e.cloneNode(!0);t.querySelectorAll("ul, ol, pre, .theme-code-block, figure").forEach(e=>e.remove());let s=A(t.textContent??"");s&&r.push({text:s,el:e}),e.querySelectorAll(":scope > ul, :scope > ol").forEach(a);return}if(e.matches("figure"))return;let t=A(e.textContent??"");t&&r.push({text:t,el:e})},[...t.children].forEach(a),r))for(let e of function(e){let t=Intl.Segmenter;return(t?[...new t("en",{granularity:"sentence"}).segment(e)].map(e=>e.segment):e.match(/[^.!?]+[.!?]+["')\]]*\s*|[^.!?]+$/g)??[e]).flatMap(e=>e.length>280?e.split(/(?<=[,;:])\s+/):[e]).map(A).filter(Boolean)}(s.text))i(e,s.el);return s}(e,t.current)),$.current.length>0),[t,e]),H=(0,s.useCallback)(()=>{W()&&(j(!0),_.current=!0,x(!0),F(P.current))},[W,F]),U=(0,s.useCallback)(()=>{_.current=!1,x(!1),q.current+=1,window.speechSynthesis.cancel()},[]),G=(0,s.useCallback)(()=>{U(),P.current=0,f(0),j(!1),v(!1),V(null)},[U,V]),J=(0,s.useCallback)(e=>{let t=$.current,r=Math.max(0,Math.min(t.length-1,e));P.current=r,f(r),V(t[r]?.el??null),_.current&&F(r)},[V,F]),X=(0,s.useCallback)(e=>{let t=$.current,r=P.current,a=t[r]?.el;if(e>0)for(;r<t.length-1&&t[r].el===a;)r+=1;else{for(;r>0&&t[r-1].el===a;)r-=1;if(r===P.current&&r>0){let e=t[r-1].el;for(r-=1;r>0&&t[r-1].el===e;)r-=1}}J(r)},[J]);(0,s.useEffect)(()=>{let e=D.current;if(!e||!u)return void w(!1);let t=()=>w(e.getBoundingClientRect().bottom<64);return t(),window.addEventListener("scroll",t,{passive:!0}),window.addEventListener("resize",t),()=>{window.removeEventListener("scroll",t),window.removeEventListener("resize",t)}},[u]),(0,s.useEffect)(()=>(document.documentElement.classList.toggle("mj-listen-floating",u&&y),()=>document.documentElement.classList.remove("mj-listen-floating")),[u,y]);let Y=e=>{"Escape"===e.key&&v(!1)},[K,Q]=(0,s.useState)(0);(0,s.useEffect)(()=>{if(!n)return;let e=window.setTimeout(()=>{W()&&Q($.current.reduce((e,t)=>e+t.text.split(/\s+/).length,0))},400);return()=>window.clearTimeout(e)},[n,W]);let ee=K?K/165:1.3*r;if(!n)return null;let et=$.current,er=et.length?(et[g]?.offset??0)/z():0,ea=ee/m*(1-er),es=l.find(e=>e.name===c),en=e=>{if(!W())return;let t=e.currentTarget.getBoundingClientRect(),r=Math.min(1,Math.max(0,(e.clientX-t.left)/t.width))*z(),a=0;for(;a<et.length-1&&$.current[a+1].offset<=r;)a+=1;J(a)},ei=e=>(0,a.jsxs)("div",{className:`mj-listen-bar${e?" is-compact":""}`,onKeyDown:Y,children:[(0,a.jsx)("button",{type:"button",className:"mj-listen-main",onClick:p?U:H,"aria-label":p?"Pause":"Play",children:p?T.pause:T.play}),!e&&(0,a.jsx)("button",{type:"button",className:"mj-listen-icon",onClick:()=>X(-1),"aria-label":"Previous paragraph",children:T.back}),(0,a.jsxs)("div",{className:"mj-listen-track-wrap",children:[(0,a.jsxs)("div",{className:"mj-listen-track",role:"slider",tabIndex:0,"aria-label":"Position in article","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(100*er),onPointerDown:en,onKeyDown:e=>{"ArrowRight"===e.key&&X(1),"ArrowLeft"===e.key&&X(-1)},children:[(0,a.jsx)("span",{style:{width:`${100*er}%`}}),(0,a.jsx)("i",{style:{left:`${100*er}%`}})]}),(0,a.jsxs)("div",{className:"mj-listen-time","aria-live":"polite",children:[(0,a.jsx)("span",{children:p?"Playing":er>0?"Paused":"Ready"}),(0,a.jsxs)("span",{children:[E(ea)," left"]})]})]}),!e&&(0,a.jsx)("button",{type:"button",className:"mj-listen-icon",onClick:()=>X(1),"aria-label":"Next paragraph",children:T.fwd}),(0,a.jsxs)("div",{className:"mj-listen-menu-wrap",children:[(0,a.jsxs)("button",{type:"button",className:"mj-listen-rate",onClick:()=>v(e=>!e),"aria-expanded":b,"aria-label":"Speed and voice",children:[m,"\xd7"]}),b&&(0,a.jsxs)("div",{className:"mj-listen-menu",role:"menu",children:[(0,a.jsx)("p",{children:"Speed"}),(0,a.jsx)("div",{className:"mj-listen-rates",children:k.map(e=>(0,a.jsxs)("button",{type:"button",className:e===m?"is-on":"",onClick:()=>{Z.current=e,h(e),B(C,String(e)),_.current&&F(P.current)},children:[e,"\xd7"]},e))}),(0,a.jsx)("p",{children:"Voice"}),(0,a.jsx)("select",{value:c??"",onChange:e=>{var t;let r;return t=e.target.value,void((r=l.find(e=>e.name===t))&&(I.current=r,d(r.name),B(N,r.name),_.current&&F(P.current)))},"aria-label":"Voice",children:l.slice(0,24).map(e=>(0,a.jsx)("option",{value:e.name,children:S(e)},e.name))}),(0,a.jsx)("small",{children:"Uses your device's built-in voices. Nothing is downloaded."})]})]}),(0,a.jsx)("button",{type:"button",className:"mj-listen-icon",onClick:G,"aria-label":"Close player",children:T.close})]});return(0,a.jsxs)("div",{className:"mj-listen",ref:D,children:[u?ei(!1):(0,a.jsxs)("button",{type:"button",className:"mj-listen-pill",onClick:H,title:es?`Voice: ${S(es)}`:void 0,children:[(0,a.jsx)("span",{className:"mj-listen-pill-icon",children:T.play}),(0,a.jsx)("span",{children:"Listen to article"}),(0,a.jsx)("span",{className:"mj-listen-pill-time",children:E(ee)})]}),u&&y&&(0,a.jsxs)("div",{className:"mj-listen-float",role:"region","aria-label":"Article audio",children:[(0,a.jsxs)("span",{className:"mj-listen-float-title",children:[(0,a.jsx)("span",{className:`mj-listen-eq${p?" is-on":""}`,children:T.wave}),e]}),ei(!0)]})]})}function P(){let[e,t]=(0,s.useState)("");return[e,e=>{e().then(e=>navigator.clipboard.writeText(e)).then(()=>t("copied")).catch(()=>t("failed")).finally(()=>setTimeout(()=>t(""),2200))}]}function _({permalink:e,url:t,title:r}){let[s,n]=P(),[i,l]=P(),o=`${e}.md`,c=encodeURIComponent(t);return(0,a.jsxs)("div",{className:"mj-tools","aria-label":"Share and export",children:[(0,a.jsx)("button",{type:"button",onClick:()=>n(()=>fetch(o).then(e=>{if(!e.ok)throw Error();return e.text()})),children:"copied"===s?"Copied Markdown":"failed"===s?"Copy failed":"Copy as Markdown"}),(0,a.jsx)("a",{href:o,children:"View .md"}),(0,a.jsx)("button",{type:"button",onClick:()=>l(async()=>t),children:"copied"===i?"Link copied":"Copy link"}),(0,a.jsx)("a",{href:`https://x.com/intent/post?url=${c}&text=${encodeURIComponent(r)}`,target:"_blank",rel:"noopener noreferrer",children:"Share on X"}),(0,a.jsx)("a",{href:`https://www.linkedin.com/sharing/share-offsite/?url=${c}`,target:"_blank",rel:"noopener noreferrer",children:"LinkedIn"})]})}function Z({sidebar:e,children:t}){let{metadata:r,toc:i,assets:d}=(0,h.e7)(),{siteConfig:m}=(0,c.A)(),{title:u,description:j,date:x,readingTime:f,authors:k,tags:N,permalink:C,nextItem:$,prevItem:M,frontMatter:S}=r,B=`${m.url}${C}`,L=d.image??S.image,A=N[0],E=Math.max(1,Math.round(f??1)),T=(e?.items??[]).filter(e=>e.permalink!==C).slice(0,3),P=!S.hide_table_of_contents&&i.length>2,I=(0,s.useRef)(null),q=(0,s.useRef)(null),D=function(e,t){let[r,a]=(0,s.useState)({ratio:0,minutesLeft:t,started:!1,activeId:null});return(0,s.useEffect)(()=>{let r=e.current;if(!r)return;let s=0,n=()=>{s=0;let e=r.getBoundingClientRect(),n=e.height-.6*window.innerHeight,i=n<=0?1:Math.min(1,Math.max(0,-e.top/n)),l=r.querySelectorAll("h2[id], h3[id]"),o=null;for(let e of l)if(e.getBoundingClientRect().top<140)o=e.id;else break;a({ratio:i,minutesLeft:Math.max(0,Math.ceil(t*(1-i))),started:e.top<0,activeId:o})},i=()=>{s||(s=requestAnimationFrame(n))};return n(),window.addEventListener("scroll",i,{passive:!0}),window.addEventListener("resize",i),()=>{window.removeEventListener("scroll",i),window.removeEventListener("resize",i),s&&cancelAnimationFrame(s)}},[e,t]),r}(I,E),O=k.map(e=>e.socials?.x??e.socials?.twitter).filter(e=>!!e).map(e=>`@${e.replace(/\/+$/,"").split("/").pop()}`),z="string"==typeof S.social_image?S.social_image:void 0;return(0,s.useEffect)(()=>{(q.current?.querySelectorAll('a[href^="#"]')??[]).forEach(e=>e.classList.toggle("is-active",e.getAttribute("href")===`#${D.activeId}`))},[D.activeId]),(0,a.jsxs)("main",{className:(0,n.A)("mj-post",!P&&"no-toc"),children:[(0,a.jsx)(o.A,{children:(0,a.jsx)("link",{rel:"alternate",type:"text/markdown",href:`${C}.md`,title:"Markdown version"})}),(0,a.jsx)(v.A,{permalink:C,title:u,image:z,imageAlt:`${u}. ${A?`${A.label} \xb7 `:""}${E} min read. Mercury Blog`,labels:[...A?[["Topic",A.label]]:[],["Reading time",`${E} min read`]],creators:O,section:A?.label,breadcrumbs:[{name:"Mercury",path:"/"},{name:"Blog",path:"/blog"},...A?[{name:A.label,path:A.permalink}]:[],{name:u,path:C}]}),(0,a.jsx)(w,{progress:D}),(0,a.jsx)(p.A,{metadata:r}),(0,a.jsxs)("header",{className:"mj-post-head",children:[(0,a.jsx)(l.A,{to:"/blog",className:"mj-back",children:"\u2190 Blog"}),A&&(0,a.jsx)(l.A,{to:A.permalink,className:"mj-post-cat",children:A.label}),(0,a.jsx)("h1",{className:"mj-post-title",children:u}),j&&(0,a.jsx)("p",{className:"mj-post-dek",children:j}),(0,a.jsxs)("div",{className:"mj-post-byline",children:[(0,a.jsx)("div",{className:"mj-post-authors",children:k.map(e=>{let t=(0,a.jsxs)(a.Fragment,{children:[e.imageURL&&(0,a.jsx)("img",{src:e.imageURL,alt:"",width:36,height:36}),(0,a.jsxs)("span",{children:[(0,a.jsx)("strong",{children:e.name}),e.title&&(0,a.jsx)("em",{children:e.title})]})]});return e.page?(0,a.jsx)(l.A,{to:e.page.permalink,className:"mj-post-author",children:t},e.key??e.name):(0,a.jsx)("span",{className:"mj-post-author",children:t},e.key??e.name)})}),(0,a.jsxs)("div",{className:"mj-meta",children:[(0,a.jsx)("time",{dateTime:x,children:(0,b.Yq)(x)}),(0,a.jsx)("span",{"aria-hidden":"true",children:"\xb7"}),(0,a.jsxs)("span",{children:[E," min read"]})]})]}),(0,a.jsx)(R,{title:u,articleRef:I,minutes:E})]}),L&&(0,a.jsx)("div",{className:"mj-post-banner",children:(0,a.jsx)("img",{src:L,alt:"",width:1600,height:900,fetchPriority:"high",decoding:"async"})}),(0,a.jsxs)("div",{className:(0,n.A)("mj-post-layout",P&&"has-toc"),children:[P&&(0,a.jsxs)("aside",{className:"mj-post-toc","aria-label":"On this page",ref:q,children:[(0,a.jsxs)("div",{className:"mj-toc-head",children:[(0,a.jsx)("p",{children:"On this page"}),(0,a.jsx)("span",{className:"mj-toc-left",children:y(D)})]}),(0,a.jsx)("div",{className:"mj-toc-meter","aria-hidden":"true",children:(0,a.jsx)("span",{style:{transform:`scaleX(${D.ratio})`}})}),(0,a.jsx)(g,{toc:i,maxHeadingLevel:3})]}),(0,a.jsx)("article",{className:"mj-prose markdown",ref:I,children:t})]}),(0,a.jsxs)("footer",{className:"mj-post-foot",children:[(0,a.jsx)(_,{permalink:C,url:B,title:u}),N.length>0&&(0,a.jsx)("div",{className:"mj-post-tags",children:N.map(e=>(0,a.jsx)(l.A,{to:e.permalink,children:e.label},e.permalink))}),(M||$)&&(0,a.jsxs)("nav",{className:"mj-pager","aria-label":"More posts",children:[M?(0,a.jsxs)(l.A,{to:M.permalink,children:[(0,a.jsx)("small",{children:"Newer"}),M.title]}):(0,a.jsx)("span",{}),$?(0,a.jsxs)(l.A,{to:$.permalink,className:"is-next",children:[(0,a.jsx)("small",{children:"Older"}),$.title]}):(0,a.jsx)("span",{})]}),T.length>0&&(0,a.jsxs)("section",{className:"mj-more",children:[(0,a.jsx)("h2",{children:"More from the blog"}),(0,a.jsx)("ul",{children:T.map(e=>(0,a.jsxs)("li",{children:[(0,a.jsx)(l.A,{to:e.permalink,children:e.title}),(0,a.jsx)("time",{dateTime:new Date(e.date).toISOString(),children:(0,b.Yq)(e.date)})]},e.permalink))})]})]})]})}function I(e){let t=e.content;return(0,a.jsx)(h.in,{content:e.content,isBlogPostPage:!0,children:(0,a.jsxs)(d.e3,{className:(0,n.A)(m.G.wrapper.blogPages,m.G.page.blogPostPage,"mj-root"),children:[(0,a.jsx)(u,{}),(0,a.jsx)(j,{}),(0,a.jsx)(i.A,{children:(0,a.jsx)(Z,{sidebar:e.sidebar,children:(0,a.jsx)(f.A,{children:(0,a.jsx)(t,{})})})})]})})}},80016(e,t,r){r.d(t,{A:()=>B});var a=r(77760),s=r(74848),n=r(96540),i=r(83941),l=r(1113);let o=new Map;function c(e,t=!1){return t&&(document.querySelectorAll(`script[src="${e}"]`).forEach(e=>e.remove()),o.delete(e)),o.has(e)||o.set(e,new Promise((t,r)=>{let a=document.createElement("script");a.src=e,a.async=!0,a.onload=()=>t(),a.onerror=()=>{o.delete(e),r(Error(`blocked: ${e}`))},document.body.appendChild(a)})),o.get(e)}function d(){let e=(0,n.useRef)(null),[t,r]=(0,n.useState)(!1);return(0,n.useEffect)(()=>{let a=e.current;if(!a||t)return;if(!("IntersectionObserver"in window))return void r(!0);let s=new IntersectionObserver(e=>{e.some(e=>e.isIntersecting)&&(r(!0),s.disconnect())},{rootMargin:"600px 0px"});return s.observe(a),()=>s.disconnect()},[t]),[e,t]}function m(e,t){let r=0,a=new WeakSet,s=e=>a.add(e.target);e.addEventListener("load",s,!0);let n=()=>{window.clearInterval(i),e.removeEventListener("load",s,!0)},i=window.setInterval(()=>{r+=1;let s=e.querySelector("iframe");s&&a.has(s)&&parseFloat(s.style.height)>80&&!e.querySelector("blockquote")?(n(),t()):r>80&&n()},250);return n}let h=e=>"number"==typeof e?new Intl.NumberFormat("en",{notation:"compact",maximumFractionDigits:1}).format(e):"",u=e=>e?new Date(e).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}):"",j=e=>{try{return new URL(e).hostname.replace(/^www\./,"")}catch{return e}},p={x:(0,s.jsx)("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:(0,s.jsx)("path",{fill:"currentColor",d:"M18.9 2H22l-6.8 7.8L23 22h-6.2l-4.8-6.3L6.4 22H3.3l7.3-8.3L1 2h6.3l4.4 5.8L18.9 2Zm-1.1 18h1.7L6.3 3.9H4.5L17.8 20Z"})}),github:(0,s.jsx)("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:(0,s.jsx)("path",{fill:"currentColor",d:"M8 0C3.58 0 0 3.58 0 8a8 8 0 0 0 5.47 7.59c.4.07.55-.17.55-.38v-1.33c-2.23.48-2.7-1.07-2.7-1.07-.36-.92-.89-1.17-.89-1.17-.73-.5.05-.49.05-.49.8.06 1.23.83 1.23.83.72 1.22 1.88.87 2.33.66.07-.52.28-.87.5-1.07-1.78-.2-3.65-.89-3.65-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82a7.6 7.6 0 0 1 4 0c1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48v2.2c0 .21.15.46.55.38A8 8 0 0 0 16 8c0-4.42-3.58-8-8-8Z"})}),instagram:(0,s.jsx)("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:(0,s.jsx)("path",{fill:"currentColor",d:"M12 2.2c3.2 0 3.6 0 4.8.1 3.3.1 4.8 1.7 4.9 4.9.1 1.3.1 1.6.1 4.8s0 3.6-.1 4.8c-.1 3.2-1.7 4.8-4.9 4.9-1.3.1-1.6.1-4.8.1s-3.6 0-4.8-.1c-3.3-.1-4.8-1.7-4.9-4.9C2.2 15.6 2.2 15.2 2.2 12s0-3.6.1-4.8C2.4 3.9 3.9 2.4 7.2 2.3 8.4 2.2 8.8 2.2 12 2.2Zm0 4.9a4.9 4.9 0 1 0 0 9.8 4.9 4.9 0 0 0 0-9.8Zm0 8.1a3.2 3.2 0 1 1 0-6.4 3.2 3.2 0 0 1 0 6.4Zm5.1-9.4a1.2 1.2 0 1 0 0 2.4 1.2 1.2 0 0 0 0-2.4Z"})}),youtube:(0,s.jsxs)("svg",{viewBox:"0 0 68 48","aria-hidden":"true",children:[(0,s.jsx)("path",{fill:"#f00",d:"M66.5 7.7a8.5 8.5 0 0 0-6-6C55.3.3 34 .3 34 .3s-21.3 0-26.5 1.4a8.5 8.5 0 0 0-6 6C.1 13 .1 24 .1 24s0 11 1.4 16.3a8.5 8.5 0 0 0 6 6C12.7 47.7 34 47.7 34 47.7s21.3 0 26.5-1.4a8.5 8.5 0 0 0 6-6C67.9 35 67.9 24 67.9 24s0-11-1.4-16.3Z"}),(0,s.jsx)("path",{fill:"#fff",d:"m27 34.3 17.8-10.3L27 13.7v20.6Z"})]}),play:(0,s.jsxs)("svg",{viewBox:"0 0 48 48","aria-hidden":"true",children:[(0,s.jsx)("circle",{cx:"24",cy:"24",r:"24",fill:"rgba(0,0,0,.6)"}),(0,s.jsx)("path",{fill:"#fff",d:"m19 15 15 9-15 9z"})]}),bluesky:(0,s.jsx)("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:(0,s.jsx)("path",{fill:"currentColor",d:"M5.2 3.5C7.9 5.5 10.8 9.6 12 12c1.2-2.4 4.1-6.5 6.8-8.5 2-1.4 5.2-2.6 5.2 1 0 .7-.4 6-.7 6.8-.9 3-4 3.8-6.8 3.3 4.9.8 6.1 3.6 3.4 6.3-5.1 5.2-7.3-1.3-7.9-3l-.1-.3-.1.3c-.6 1.7-2.8 8.2-7.9 3-2.7-2.7-1.5-5.5 3.4-6.3-2.8.5-5.9-.3-6.8-3.3C.4 10.5 0 5.2 0 4.5c0-3.6 3.2-2.4 5.2-1Z"})}),link:(0,s.jsx)("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:(0,s.jsx)("path",{fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",d:"M10 14a4.5 4.5 0 0 0 6.4 0l3-3a4.5 4.5 0 0 0-6.4-6.4l-1 1M14 10a4.5 4.5 0 0 0-6.4 0l-3 3a4.5 4.5 0 0 0 6.4 6.4l1-1"})}),star:(0,s.jsx)("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:(0,s.jsx)("path",{fill:"currentColor",d:"M8 .25a.75.75 0 0 1 .67.42l1.88 3.8 4.2.61a.75.75 0 0 1 .41 1.28l-3.04 2.96.72 4.18a.75.75 0 0 1-1.09.79L8 12.32l-3.75 1.97a.75.75 0 0 1-1.09-.79l.72-4.18L.84 6.36a.75.75 0 0 1 .41-1.28l4.2-.61L7.33.67A.75.75 0 0 1 8 .25Z"})}),fork:(0,s.jsx)("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:(0,s.jsx)("path",{fill:"currentColor",d:"M5 5.37v.25A2.25 2.25 0 0 0 7.25 7.9h1.5A2.25 2.25 0 0 0 11 5.62v-.25a2.25 2.25 0 1 1 1.5 0v.25a3.75 3.75 0 0 1-3.75 3.75h-.5v1.26a2.25 2.25 0 1 1-1.5 0V9.37h-.5A3.75 3.75 0 0 1 3.5 5.62v-.25a2.25 2.25 0 1 1 1.5 0ZM5 3.25a.75.75 0 1 0-1.5 0 .75.75 0 0 0 1.5 0Zm6.75.75a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5ZM8.75 12.75a.75.75 0 1 0-1.5 0 .75.75 0 0 0 1.5 0Z"})}),open:(0,s.jsxs)("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[(0,s.jsx)("path",{fill:"currentColor",d:"M8 9.5a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Z"}),(0,s.jsx)("path",{fill:"currentColor",d:"M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0ZM1.5 8a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0Z"})]}),pr:(0,s.jsx)("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:(0,s.jsx)("path",{fill:"currentColor",d:"M1.5 3.25a2.25 2.25 0 1 1 3 2.12v5.26a2.25 2.25 0 1 1-1.5 0V5.37A2.25 2.25 0 0 1 1.5 3.25Zm5.68-1.03L9.25 0v1.5h1.5a2.75 2.75 0 0 1 2.75 2.75v6.38a2.25 2.25 0 1 1-1.5 0V4.25c0-.69-.56-1.25-1.25-1.25h-1.5v1.5L7.18 2.43a.25.25 0 0 1 0-.21ZM3.75 2.5a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Zm0 9.5a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Zm8.25.75a.75.75 0 1 0 1.5 0 .75.75 0 0 0-1.5 0Z"})}),merged:(0,s.jsx)("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:(0,s.jsx)("path",{fill:"currentColor",d:"M5.45 5.15A2.25 2.25 0 1 0 4 5.37v5.26a2.25 2.25 0 1 0 1.5 0V8.05A4.48 4.48 0 0 0 9 9.75h1.13a2.25 2.25 0 1 0 0-1.5H9a3 3 0 0 1-2.95-2.47l-.6-.63ZM4.75 2.5a.75.75 0 1 1 0 1.5.75.75 0 0 1 0-1.5Zm0 9.5a.75.75 0 1 1 0 1.5.75.75 0 0 1 0-1.5Zm7.5-3a.75.75 0 1 1 0-1.5.75.75 0 0 1 0 1.5Z"})}),closed:(0,s.jsx)("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:(0,s.jsx)("path",{fill:"currentColor",d:"M11.28 6.78a.75.75 0 0 0-1.06-1.06L7.25 8.69 5.78 7.22a.75.75 0 0 0-1.06 1.06l2 2a.75.75 0 0 0 1.06 0l3.5-3.5ZM16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0Zm-1.5 0a6.5 6.5 0 1 0-13 0 6.5 6.5 0 0 0 13 0Z"})}),tag:(0,s.jsx)("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:(0,s.jsx)("path",{fill:"currentColor",d:"M1 7.78V2.75C1 1.78 1.78 1 2.75 1h5.03c.46 0 .9.18 1.23.51l5.75 5.75a1.75 1.75 0 0 1 0 2.47l-5.03 5.03a1.75 1.75 0 0 1-2.47 0L1.5 9.01A1.73 1.73 0 0 1 1 7.78Zm1.5 0c0 .07.03.13.07.18l5.75 5.75a.25.25 0 0 0 .35 0l5.03-5.03a.25.25 0 0 0 0-.35L7.96 2.57a.25.25 0 0 0-.18-.07H2.75a.25.25 0 0 0-.25.25ZM6 5a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"})})},x={TypeScript:"#3178c6",JavaScript:"#f1e05a",Python:"#3572A5",Go:"#00ADD8",Rust:"#dea584",Shell:"#89e051",Swift:"#F05138",Kotlin:"#A97BFF",Java:"#b07219","C++":"#f34b7d",C:"#555555",Ruby:"#701516",HTML:"#e34c26",CSS:"#563d7c",MDX:"#fcb32c"};function g({provider:e,url:t,children:r,label:a}){return(0,s.jsxs)("figure",{className:`mj-embed mj-embed--${e}`,"data-provider":e,children:[r,a&&(0,s.jsx)("figcaption",{children:(0,s.jsx)("a",{href:t,target:"_blank",rel:"noopener noreferrer",children:a})})]})}function f({url:e,d:t}){let{colorMode:r}=(0,i.G)(),[a,l]=d(),o=(0,n.useRef)(null),[h,u]=(0,n.useState)(!1);(0,n.useEffect)(()=>{if(!l||!o.current)return;let e=!1,a=o.current;a.innerHTML="",u(!1);let s=m(a,()=>{e||u(!0)});return c("https://platform.twitter.com/widgets.js").then(()=>window.twttr?.widgets?.createTweet(t.id,a,{theme:r,dnt:!0,align:"center",conversation:"none"})).catch(()=>void 0),()=>{e=!0,s()}},[l,r,t.id]);let x=t.handle&&"i"!==t.handle?`@${t.handle}`:"";return(0,s.jsx)(g,{provider:"x",url:e,children:(0,s.jsxs)("div",{ref:a,children:[(0,s.jsx)("div",{ref:o,className:h?"mj-embed-live":"mj-embed-staging","aria-hidden":!h}),!h&&(0,s.jsxs)("a",{className:"mj-ecard mj-social",href:e,target:"_blank",rel:"noopener noreferrer",children:[(0,s.jsxs)("header",{children:[(0,s.jsxs)("span",{className:"mj-social-who",children:[(0,s.jsx)("strong",{children:t.author||x||"Post on X"}),t.author&&x&&(0,s.jsx)("span",{children:x})]}),(0,s.jsx)("span",{className:"mj-brand mj-brand--x",children:p.x})]}),t.text?(0,s.jsx)("p",{className:"mj-social-text",children:t.text}):(0,s.jsx)("p",{className:"mj-social-text is-dim",children:"View this post on X"}),(0,s.jsx)("footer",{children:t.date||j(e)})]})]})})}function b({url:e,provider:t,d:r,markup:a,script:i,fresh:l,rescan:o,fallback:h}){let[u,j]=d(),p=(0,n.useRef)(null),[x,f]=(0,n.useState)(!1),v=(0,n.useRef)({markup:a,script:i,fresh:l,rescan:o});return(0,n.useEffect)(()=>{let e=p.current,{markup:t,script:r,fresh:a,rescan:s}=v.current;if(!j||!e||!t)return;e.innerHTML=t;let n=m(e,()=>f(!0));return c(r,a).then(()=>s?.()).catch(()=>void 0),n},[j]),(0,s.jsx)(g,{provider:t,url:e,children:(0,s.jsxs)("div",{ref:u,children:[(0,s.jsx)("div",{ref:p,className:x?"mj-embed-live":"mj-embed-staging","aria-hidden":!x}),!x&&h]})})}let v=e=>e.replace(/[&<>"']/g,e=>`&#${e.charCodeAt(0)};`);function y({url:e,d:t}){let r=`https://www.instagram.com/${t.kind??"p"}/${t.id}/`,a=`<blockquote class="instagram-media" data-instgrm-captioned data-instgrm-permalink="${v(r)}?utm_source=ig_embed" data-instgrm-version="14" style="margin:0 auto;max-width:540px;min-width:280px;width:100%"><a href="${v(r)}">View on Instagram</a></blockquote>`;return(0,s.jsx)(b,{url:e,provider:"instagram",d:t,markup:a,script:"https://www.instagram.com/embed.js",rescan:()=>window.instgrm?.Embeds?.process(),fallback:(0,s.jsxs)("a",{className:"mj-ecard mj-social mj-social--ig",href:e,target:"_blank",rel:"noopener noreferrer",children:[(0,s.jsxs)("header",{children:[(0,s.jsxs)("span",{className:"mj-social-who",children:[(0,s.jsx)("strong",{children:"Instagram"}),(0,s.jsx)("span",{children:"reel"===t.kind?"Reel":"Post"})]}),(0,s.jsx)("span",{className:"mj-brand mj-brand--ig",children:p.instagram})]}),(0,s.jsxs)("p",{className:"mj-social-text is-dim",children:["View this ","reel"===t.kind?"reel":"post"," on Instagram"]}),(0,s.jsx)("footer",{children:"instagram.com"})]})})}function w({url:e,d:t}){let r=t.uri&&t.cid?`<blockquote class="bluesky-embed" data-bluesky-uri="${v(t.uri)}" data-bluesky-cid="${v(t.cid)}"><p>${v(t.text??"")}</p></blockquote>`:null;return(0,s.jsx)(b,{url:e,provider:"bluesky",d:t,markup:r,script:"https://embed.bsky.app/static/embed.js",rescan:()=>window.bluesky?.scan?.(),fallback:(0,s.jsxs)("a",{className:"mj-ecard mj-social",href:e,target:"_blank",rel:"noopener noreferrer",children:[(0,s.jsxs)("header",{children:[(0,s.jsxs)("span",{className:"mj-social-who",children:[(0,s.jsx)("strong",{children:t.author||`@${t.handle}`}),(0,s.jsxs)("span",{children:["@",t.handle]})]}),(0,s.jsx)("span",{className:"mj-brand mj-brand--bsky",children:p.bluesky})]}),(0,s.jsx)("p",{className:`mj-social-text${t.text?"":" is-dim"}`,children:t.text||"View this post on Bluesky"}),(0,s.jsx)("footer",{children:"bsky.app"})]})})}function k({url:e,d:t}){let r=`<blockquote class="tiktok-embed" cite="${v(e)}" data-video-id="${v(t.id)}" style="max-width:605px;min-width:325px;margin:0 auto"><section><a href="${v(e)}">TikTok</a></section></blockquote>`;return(0,s.jsx)(b,{url:e,provider:"tiktok",d:t,markup:r,script:"https://www.tiktok.com/embed.js",fresh:!0,fallback:(0,s.jsx)(M,{url:e,d:{title:t.title||"Video on TikTok",description:t.author?`@${t.handle} \xb7 ${t.author}`:`@${t.handle}`,image:t.thumbnail,siteName:"TikTok"}})})}function N({url:e,provider:t,thumb:r,title:a,author:i,iframe:l,vertical:o}){let[c,d]=(0,n.useState)(!1),m="youtube"===t?"YouTube":"vimeo"===t?"Vimeo":j(e),h=`${i?`${i} \xb7 `:""}Watch on ${m}`;return(0,s.jsx)(g,{provider:t,url:e,label:h,children:(0,s.jsx)("div",{className:`mj-video${o?" is-vertical":""}`,children:c?(0,s.jsx)("iframe",{src:l,title:a??"Video",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share",allowFullScreen:!0,referrerPolicy:"strict-origin-when-cross-origin"}):(0,s.jsxs)("button",{type:"button",onClick:()=>d(!0),"aria-label":`Play: ${a??"video"}`,children:[r&&(0,s.jsx)("img",{src:r,alt:"",loading:"lazy",decoding:"async"}),a&&(0,s.jsx)("span",{className:"mj-video-title",children:a}),(0,s.jsx)("span",{className:"mj-video-play",children:"youtube"===t?p.youtube:p.play})]})})})}function C({url:e,d:t}){let r=t.parts??[],a=t.fullName??t.repo??r.slice(0,2).join("/"),[n,i]=String(a).split("/");if("code"===t.kind){let r=String(t.sha??t.ref??""),n=/^[0-9a-f]{7,40}$/i.test(r),i=t.start===t.end?`L${t.start}`:`L${t.start}\u{2013}${t.end}`;return(0,s.jsxs)("figure",{className:"mj-embed mj-embed--github mj-gh-code","data-provider":"github",children:[(0,s.jsxs)("header",{className:"mj-gh mj-gh-code-head",children:[(0,s.jsx)("span",{className:"mj-gh-mark",children:p.github}),(0,s.jsx)("a",{href:`https://github.com/${a}`,target:"_blank",rel:"noopener noreferrer",className:"mj-gh-code-repo",children:a}),(0,s.jsxs)("span",{className:`mj-gh-ref${n?" is-sha":""}`,title:n?`Pinned to commit ${r}`:`Branch or tag ${r}`,children:[n?"@ ":"",n?r.slice(0,7):r]}),(0,s.jsx)("a",{className:"mj-gh-code-link",href:e,target:"_blank",rel:"noopener noreferrer",children:"View on GitHub \u2197"})]}),(0,s.jsx)(l.A,{language:t.language??"text",title:`${t.path}  \xb7  ${i}`,showLineNumbers:t.start??1,children:String(t.code??"")}),t.commitTitle&&(0,s.jsxs)("figcaption",{className:"mj-gh-code-foot",children:["At ",(0,s.jsx)("a",{href:`https://github.com/${a}/commit/${r}`,target:"_blank",rel:"noopener noreferrer",children:(0,s.jsx)("code",{children:r.slice(0,7)})})," \xb7 ",t.commitTitle,t.commitDate?` \xb7 ${u(t.commitDate)}`:""]})]})}if("commit"===t.kind){let r=Math.max(1,...(t.files??[]).map(e=>e.additions+e.deletions));return(0,s.jsx)(g,{provider:"github",url:e,children:(0,s.jsxs)("a",{className:"mj-ecard mj-gh mj-gh-commit",href:e,target:"_blank",rel:"noopener noreferrer",children:[(0,s.jsxs)("div",{className:"mj-gh-repo",children:[(0,s.jsx)("span",{className:"mj-gh-mark",children:p.github}),a,(0,s.jsx)("span",{className:"mj-gh-ref is-sha",children:String(t.sha??"").slice(0,7)})]}),(0,s.jsx)("strong",{className:"mj-gh-title mj-gh-commit-title",children:t.title}),t.body&&(0,s.jsx)("p",{className:"mj-gh-desc",children:t.body}),(0,s.jsxs)("div",{className:"mj-gh-meta",children:[t.avatar&&(0,s.jsx)("img",{src:t.avatar,alt:"",width:18,height:18,loading:"lazy"}),t.author&&(0,s.jsxs)("span",{children:[(0,s.jsx)("b",{children:t.author})," committed ",u(t.date)]}),"number"==typeof t.fileCount&&(0,s.jsxs)("span",{children:[t.fileCount," file",1===t.fileCount?"":"s"," changed"]}),"number"==typeof t.additions&&(0,s.jsxs)("span",{className:"mj-gh-diff",children:[(0,s.jsxs)("ins",{children:["+",h(t.additions)]})," ",(0,s.jsxs)("del",{children:["\u2212",h(t.deletions)]})]})]}),t.files?.length>0&&(0,s.jsx)("ul",{className:"mj-gh-files",children:t.files.map(e=>(0,s.jsxs)("li",{children:[(0,s.jsx)("code",{children:e.name}),(0,s.jsxs)("span",{className:"mj-gh-bar","aria-label":`${e.additions} added, ${e.deletions} removed`,children:[(0,s.jsx)("i",{className:"is-add",style:{width:`${e.additions/r*100}%`}}),(0,s.jsx)("i",{className:"is-del",style:{width:`${e.deletions/r*100}%`}})]}),(0,s.jsxs)("span",{className:"mj-gh-diff",children:[(0,s.jsxs)("ins",{children:["+",e.additions]})," ",(0,s.jsxs)("del",{children:["\u2212",e.deletions]})]})]},e.name))})]})})}if("issue"===t.kind||"pull"===t.kind){let n="pull"===t.kind?t.merged?"merged":t.draft?"draft":t.state:"closed"===t.state&&"not_planned"===t.stateReason?"not-planned":t.state,i="pull"===t.kind?t.merged?p.merged:p.pr:"closed"===t.state?p.closed:p.open;return(0,s.jsx)(g,{provider:"github",url:e,children:(0,s.jsxs)("a",{className:"mj-ecard mj-gh",href:e,target:"_blank",rel:"noopener noreferrer",children:[(0,s.jsxs)("div",{className:"mj-gh-repo",children:[(0,s.jsx)("span",{className:"mj-gh-mark",children:p.github}),a,(0,s.jsxs)("span",{className:"mj-gh-num",children:["#",t.number??r[3]]})]}),(0,s.jsxs)("div",{className:"mj-gh-title-row",children:[(0,s.jsxs)("span",{className:`mj-gh-state is-${n}`,children:[i,{open:"Open",closed:"Closed",merged:"Merged",draft:"Draft","not-planned":"Closed"}[n]??"Open"]}),(0,s.jsx)("strong",{className:"mj-gh-title",children:t.title??`${"pull"===t.kind?"Pull request":"Issue"} #${r[3]}`})]}),t.labels?.length>0&&(0,s.jsx)("div",{className:"mj-gh-labels",children:t.labels.map(e=>(0,s.jsx)("span",{style:{"--l":`#${e.color}`},children:e.name},e.name))}),(0,s.jsxs)("div",{className:"mj-gh-meta",children:[t.avatar&&(0,s.jsx)("img",{src:t.avatar,alt:"",width:18,height:18,loading:"lazy"}),t.author&&(0,s.jsxs)("span",{children:[(0,s.jsx)("b",{children:t.author})," opened ",u(t.created)]}),"number"==typeof t.comments&&(0,s.jsxs)("span",{children:[t.comments," comment",1===t.comments?"":"s"]}),"number"==typeof t.additions&&(0,s.jsxs)("span",{className:"mj-gh-diff",children:[(0,s.jsxs)("ins",{children:["+",h(t.additions)]})," ",(0,s.jsxs)("del",{children:["\u2212",h(t.deletions)]})]})]})]})})}if("release"===t.kind)return(0,s.jsx)(g,{provider:"github",url:e,children:(0,s.jsxs)("a",{className:"mj-ecard mj-gh",href:e,target:"_blank",rel:"noopener noreferrer",children:[(0,s.jsxs)("div",{className:"mj-gh-repo",children:[(0,s.jsx)("span",{className:"mj-gh-mark",children:p.github}),a]}),(0,s.jsxs)("div",{className:"mj-gh-title-row",children:[(0,s.jsxs)("span",{className:"mj-gh-state is-release",children:[p.tag,t.tag]}),(0,s.jsx)("strong",{className:"mj-gh-title",children:t.name}),t.prerelease&&(0,s.jsx)("span",{className:"mj-gh-pill",children:"Pre-release"})]}),t.body&&(0,s.jsx)("p",{className:"mj-gh-desc",children:t.body}),(0,s.jsx)("div",{className:"mj-gh-meta",children:t.published&&(0,s.jsxs)("span",{children:["Released ",u(t.published)]})})]})});if("user"===t.kind)return(0,s.jsx)(g,{provider:"github",url:e,children:(0,s.jsxs)("a",{className:"mj-ecard mj-gh mj-gh-user",href:e,target:"_blank",rel:"noopener noreferrer",children:[t.avatar&&(0,s.jsx)("img",{src:t.avatar,alt:"",width:64,height:64,loading:"lazy",className:"Organization"===t.type?"is-org":""}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"mj-gh-title-row",children:[(0,s.jsx)("strong",{className:"mj-gh-title",children:t.name||t.login}),(0,s.jsx)("span",{className:"mj-gh-dim",children:t.login})]}),t.bio&&(0,s.jsx)("p",{className:"mj-gh-desc",children:t.bio}),(0,s.jsxs)("div",{className:"mj-gh-meta",children:[(0,s.jsx)("span",{className:"mj-gh-mark",children:p.github}),"number"==typeof t.followers&&(0,s.jsxs)("span",{children:[(0,s.jsx)("b",{children:h(t.followers)})," followers"]}),"number"==typeof t.repos&&(0,s.jsxs)("span",{children:[(0,s.jsx)("b",{children:h(t.repos)})," repositories"]})]})]})]})});if("repo"===t.kind)return(0,s.jsx)(g,{provider:"github",url:e,children:(0,s.jsxs)("a",{className:"mj-ecard mj-gh mj-gh-repo-card",href:e,target:"_blank",rel:"noopener noreferrer",children:[(0,s.jsxs)("div",{className:"mj-gh-body",children:[(0,s.jsxs)("div",{className:"mj-gh-repo is-big",children:[(0,s.jsx)("span",{className:"mj-gh-mark",children:p.github}),(0,s.jsxs)("span",{className:"mj-gh-dim",children:[n,"/"]}),(0,s.jsx)("b",{children:i})]}),t.description&&(0,s.jsx)("p",{className:"mj-gh-desc",children:t.description}),t.topics?.length>0&&(0,s.jsx)("div",{className:"mj-gh-topics",children:t.topics.map(e=>(0,s.jsx)("span",{children:e},e))}),(0,s.jsxs)("div",{className:"mj-gh-meta",children:[t.language&&(0,s.jsxs)("span",{children:[(0,s.jsx)("i",{style:{background:x[t.language]??"#8b949e"}}),t.language]}),"number"==typeof t.stars&&(0,s.jsxs)("span",{children:[p.star,h(t.stars)]}),"number"==typeof t.forks&&(0,s.jsxs)("span",{children:[p.fork,h(t.forks)]}),t.license&&"NOASSERTION"!==t.license&&(0,s.jsx)("span",{children:t.license})]})]}),t.avatar&&(0,s.jsx)("img",{className:"mj-gh-owner",src:t.avatar,alt:"",width:72,height:72,loading:"lazy"})]})});let o=t.og??`https://opengraph.githubassets.com/mercury/${r.slice(0,4).join("/")}`;return(0,s.jsx)(M,{url:e,d:{title:t.title||a,description:t.description,image:o,siteName:"GitHub",icon:void 0},brand:p.github,wide:!0})}function $({url:e,d:t}){return(0,s.jsx)(g,{provider:"github",url:e,children:(0,s.jsxs)("a",{className:"mj-ecard mj-gh mj-gh-gist",href:e,target:"_blank",rel:"noopener noreferrer",children:[(0,s.jsxs)("div",{className:"mj-gh-repo",children:[(0,s.jsx)("span",{className:"mj-gh-mark",children:p.github}),(0,s.jsxs)("span",{className:"mj-gh-dim",children:[t.owner??"gist"," /"]})," ",(0,s.jsx)("b",{children:t.filename??"gist"}),t.files>1&&(0,s.jsxs)("span",{className:"mj-gh-dim",children:["+",t.files-1," files"]})]}),t.description&&(0,s.jsx)("p",{className:"mj-gh-desc",children:t.description}),t.code&&(0,s.jsx)("pre",{children:(0,s.jsx)("code",{children:t.code})})]})})}function M({url:e,d:t,brand:r,wide:a}){let[i,l]=(0,n.useState)(!0),o=t.siteName||j(e);return(0,s.jsx)(g,{provider:"link",url:e,children:(0,s.jsxs)("a",{className:`mj-ecard mj-link${t.image&&i?" has-image":""}${a?" is-wide":""}`,href:e,target:"_blank",rel:"noopener noreferrer",children:[(0,s.jsxs)("div",{className:"mj-link-body",children:[(0,s.jsxs)("div",{className:"mj-link-site",children:[r?(0,s.jsx)("span",{className:"mj-gh-mark",children:r}):t.icon?(0,s.jsx)("img",{src:t.icon,alt:"",width:16,height:16,loading:"lazy",onError:e=>{e.target.style.display="none"}}):(0,s.jsx)("span",{className:"mj-gh-mark",children:p.link}),(0,s.jsx)("span",{children:o})]}),(0,s.jsx)("strong",{children:t.title||e}),t.description&&(0,s.jsx)("p",{children:t.description}),(0,s.jsx)("span",{className:"mj-link-host",children:j(e)})]}),t.image&&i&&(0,s.jsx)("img",{className:"mj-link-img",src:t.image,alt:"",loading:"lazy",decoding:"async",onError:()=>l(!1)})]})})}let S={"\u2713":"yes","\u25D0":"partial","\u2715":"no","?":"unknown"},B={...a.A,td:function(e){let t=(function e(t){let r=n.Children.toArray(t)[0];return"string"==typeof r?r:(0,n.isValidElement)(r)?e(r.props.children):""})(e.children).trimStart().charAt(0),r=S[t];if(!r)return(0,s.jsx)("td",{...e});let a=n.Children.toArray(e.children);return"string"==typeof a[0]&&(a[0]=a[0].trimStart().slice(1).trimStart()),(0,s.jsxs)("td",{...e,className:`mj-cell is-${r}${e.className?` ${e.className}`:""}`,children:[(0,s.jsx)("span",{className:"mj-mark","aria-hidden":"true",children:t}),(0,s.jsx)("span",{className:"mj-cell-text",children:a})]})},SocialEmbed:function({url:e,provider:t,data:r}){let{colorMode:a}=(0,i.G)(),n={};try{n=r?JSON.parse(r):{}}catch{n={}}switch(t){case"x":return(0,s.jsx)(f,{url:e,d:n});case"youtube":return(0,s.jsx)(N,{url:e,provider:"youtube",vertical:n.short,title:n.title,author:n.author,thumb:`https://i.ytimg.com/vi/${n.id}/hqdefault.jpg`,iframe:`https://www.youtube-nocookie.com/embed/${n.id}?autoplay=1&rel=0&modestbranding=1${n.start?`&start=${n.start}`:""}`});case"vimeo":return(0,s.jsx)(N,{url:e,provider:"vimeo",title:n.title,author:n.author,thumb:n.thumbnail,iframe:`https://player.vimeo.com/video/${n.id}?autoplay=1&dnt=1`});case"loom":return(0,s.jsx)(g,{provider:"loom",url:e,label:"Watch on Loom",children:(0,s.jsx)("div",{className:"mj-video",children:(0,s.jsx)("iframe",{src:`https://www.loom.com/embed/${n.id}`,title:"Loom video",loading:"lazy",allowFullScreen:!0})})});case"instagram":return(0,s.jsx)(y,{url:e,d:n});case"bluesky":return(0,s.jsx)(w,{url:e,d:n});case"tiktok":return(0,s.jsx)(k,{url:e,d:n});case"spotify":{let t=!["track","episode"].includes(n.kind);return(0,s.jsx)(g,{provider:"spotify",url:e,children:(0,s.jsx)("iframe",{className:"mj-spotify",style:{height:t?352:152},src:`https://open.spotify.com/embed/${n.kind}/${n.id}?utm_source=mercury&theme=${+("dark"!==a)}`,title:"Spotify",loading:"lazy",allow:"autoplay; clipboard-write; encrypted-media; fullscreen; picture-in-picture"})})}case"codepen":return(0,s.jsx)(g,{provider:"codepen",url:e,label:"Open on CodePen",children:(0,s.jsx)("iframe",{className:"mj-codepen",src:`https://codepen.io/${n.user}/embed/${n.id}?default-tab=result&theme-id=${a}`,title:"CodePen",loading:"lazy",allowFullScreen:!0})});case"mastodon":return(0,s.jsx)(g,{provider:"mastodon",url:e,label:`Open on ${j(e)}`,children:(0,s.jsx)("iframe",{className:"mj-mastodon",src:`${e}/embed`,title:"Mastodon post",loading:"lazy",sandbox:"allow-scripts allow-same-origin allow-popups allow-popups-to-escape-sandbox"})});case"github":return(0,s.jsx)(C,{url:e,d:n});case"gist":return(0,s.jsx)($,{url:e,d:n});default:return(0,s.jsx)(M,{url:e,d:n})}},Compare:function({children:e,caption:t,highlight:r}){return(0,s.jsxs)("figure",{className:`mj-compare${r?` hl-${r}`:""}`,children:[(0,s.jsx)("div",{className:"mj-compare-scroll",tabIndex:0,role:"region","aria-label":t??"Comparison table",children:e}),(0,s.jsxs)("div",{className:"mj-compare-legend","aria-hidden":"true",children:[(0,s.jsxs)("span",{className:"is-yes",children:[(0,s.jsx)("b",{children:"\u2713"})," Yes"]}),(0,s.jsxs)("span",{className:"is-partial",children:[(0,s.jsx)("b",{children:"\u25D0"})," Partly or opt-in"]}),(0,s.jsxs)("span",{className:"is-no",children:[(0,s.jsx)("b",{children:"\u2715"})," No"]}),(0,s.jsxs)("span",{className:"is-unknown",children:[(0,s.jsx)("b",{children:"?"})," Not documented"]})]}),t&&(0,s.jsx)("figcaption",{children:t})]})},BarChart:function({title:e,subtitle:t,data:r,unit:a="",reference:n,source:i,max:l}){let o=l??1.04*Math.max(...r.map(e=>e.value),n?.value??0),c=e=>`${new Intl.NumberFormat("en",{notation:"compact",maximumFractionDigits:1}).format(e)}${a?` ${a}`:""}`,d=`${e}. ${r.map(e=>`${e.label}: ${c(e.value)}`).join("; ")}${n?`; ${n.label}: ${c(n.value)}`:""}.`;return(0,s.jsxs)("figure",{className:"mj-chart",children:[(0,s.jsxs)("header",{children:[(0,s.jsx)("strong",{children:e}),t&&(0,s.jsx)("span",{children:t})]}),(0,s.jsxs)("div",{className:"mj-bars",role:"img","aria-label":d,children:[n&&(0,s.jsx)("div",{className:"mj-ref",style:{left:`calc(var(--mj-label-w) + (100% - var(--mj-label-w) - var(--mj-value-w)) * ${n.value/o})`},children:(0,s.jsxs)("span",{children:[n.label," \xb7 ",c(n.value)]})}),r.map(e=>{let t;return(0,s.jsxs)("div",{className:`mj-bar-row tone-${e.tone??"base"}`,tabIndex:0,children:[(0,s.jsx)("span",{className:"mj-bar-label",children:e.label}),(0,s.jsx)("span",{className:"mj-bar-track",children:(0,s.jsx)("i",{style:{width:(t=e.value,`${Math.max(.6,t/o*100)}%`)}})}),(0,s.jsx)("span",{className:"mj-bar-value",children:c(e.value)}),e.note&&(0,s.jsxs)("span",{className:"mj-bar-tip",role:"tooltip",children:[e.label,": ",c(e.value),". ",e.note]})]},e.label)})]}),(0,s.jsxs)("details",{className:"mj-chart-table",children:[(0,s.jsx)("summary",{children:"View as table"}),(0,s.jsxs)("table",{children:[(0,s.jsx)("thead",{children:(0,s.jsxs)("tr",{children:[(0,s.jsx)("th",{children:"Measure"}),(0,s.jsx)("th",{children:"Value"}),(0,s.jsx)("th",{children:"Note"})]})}),(0,s.jsxs)("tbody",{children:[r.map(e=>(0,s.jsxs)("tr",{children:[(0,s.jsx)("td",{children:e.label}),(0,s.jsxs)("td",{children:[e.value.toLocaleString("en-US"),a?` ${a}`:""]}),(0,s.jsx)("td",{children:e.note??""})]},e.label)),n&&(0,s.jsxs)("tr",{children:[(0,s.jsx)("td",{children:n.label}),(0,s.jsxs)("td",{children:[n.value.toLocaleString("en-US"),a?` ${a}`:""]}),(0,s.jsx)("td",{children:"Reference line"})]})]})]})]}),i&&(0,s.jsx)("figcaption",{children:i})]})},Stats:function({items:e,source:t}){return(0,s.jsxs)("figure",{className:"mj-stats",children:[(0,s.jsx)("dl",{children:e.map(e=>(0,s.jsxs)("div",{children:[(0,s.jsx)("dt",{children:e.label}),(0,s.jsx)("dd",{children:e.value})]},e.label))}),t&&(0,s.jsx)("figcaption",{children:t})]})}}},47369(e,t,r){r.d(t,{A:()=>j});var a=r(74848),s=r(96540),n=r(11701),i=r(83941),l=r(952);let o="Geist, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif",c={dark:{background:"transparent",primaryColor:"#121c23",primaryTextColor:"#e8eef3",primaryBorderColor:"#2f5966",secondaryColor:"#1a1628",secondaryTextColor:"#e8eef3",secondaryBorderColor:"#4a3f73",tertiaryColor:"#1f1810",tertiaryTextColor:"#e8eef3",tertiaryBorderColor:"#6b4f2e",lineColor:"#5e7a86",textColor:"#c9d3d9",mainBkg:"#121c23",nodeBorder:"#2f5966",clusterBkg:"rgba(125, 211, 224, 0.04)",clusterBorder:"#21404a",titleColor:"#e8eef3",edgeLabelBackground:"#0d1216",noteBkgColor:"#1f1810",noteTextColor:"#f3e6d2",noteBorderColor:"#6b4f2e",actorBkg:"#121c23",actorBorder:"#2f5966",actorTextColor:"#e8eef3",actorLineColor:"#3a4d55",signalColor:"#9fb2bb",signalTextColor:"#d6dee3",labelBoxBkgColor:"#121c23",labelBoxBorderColor:"#2f5966",labelTextColor:"#e8eef3",loopTextColor:"#c9d3d9",activationBkgColor:"#1a2a33",activationBorderColor:"#3f7584",sequenceNumberColor:"#0b0e12"},light:{background:"transparent",primaryColor:"#eef6f8",primaryTextColor:"#111416",primaryBorderColor:"#93c4cf",secondaryColor:"#f3effb",secondaryTextColor:"#111416",secondaryBorderColor:"#bcaee6",tertiaryColor:"#fbf2e6",tertiaryTextColor:"#111416",tertiaryBorderColor:"#e3c193",lineColor:"#7f9199",textColor:"#2b3236",mainBkg:"#eef6f8",nodeBorder:"#93c4cf",clusterBkg:"rgba(11, 114, 133, 0.035)",clusterBorder:"#d3e2e6",titleColor:"#111416",edgeLabelBackground:"#fbfbf8",noteBkgColor:"#fbf2e6",noteTextColor:"#4a3418",noteBorderColor:"#e3c193",actorBkg:"#eef6f8",actorBorder:"#93c4cf",actorTextColor:"#111416",actorLineColor:"#c4d3d8",signalColor:"#5d6c73",signalTextColor:"#2b3236",labelBoxBkgColor:"#eef6f8",labelBoxBorderColor:"#93c4cf",labelTextColor:"#111416",loopTextColor:"#2b3236",activationBkgColor:"#dcedf1",activationBorderColor:"#6aaab8",sequenceNumberColor:"#ffffff"}},d=[[/^(flowchart|graph)\b/,"Flowchart"],[/^sequenceDiagram/,"Sequence"],[/^stateDiagram/,"State machine"],[/^classDiagram/,"Class diagram"],[/^erDiagram/,"Data model"],[/^gantt/,"Timeline"],[/^timeline/,"Timeline"],[/^journey/,"Journey"],[/^mindmap/,"Mind map"],[/^pie/,"Chart"],[/^xychart/,"Chart"],[/^quadrantChart/,"Quadrant"],[/^architecture/,"Architecture"],[/^block/,"Block diagram"],[/^gitGraph/,"Git graph"]];function m({result:e,onReady:t}){let r=(0,s.useRef)(null);return(0,s.useEffect)(()=>{let a=r.current;if(!a)return;e.bindFunctions?.(a);let s=a.querySelector("svg");if(s){let e,t=(e=s?.viewBox?.baseVal)&&e.width?e.width:s?.getBoundingClientRect().width??0;s.removeAttribute("height"),s.style.maxWidth=`${t}px`,s.style.minWidth=`${Math.round(Math.min(t,Math.max(460,.66*t)))}px`,s.style.width="100%",s.style.height="auto"}t?.(s)},[e,t]),(0,a.jsx)("div",{ref:r,className:`${l.MO} mj-diagram-svg`,dangerouslySetInnerHTML:{__html:e.svg}})}function h({svg:e,title:t,onClose:r}){let[n,i]=(0,s.useState)(1),l=(0,s.useRef)(null);return(0,s.useEffect)(()=>{let e=document.body.style.overflow;document.body.style.overflow="hidden";let t=e=>{"Escape"===e.key&&r(),("+"===e.key||"="===e.key)&&i(e=>Math.min(4,e+.25)),"-"===e.key&&i(e=>Math.max(.5,e-.25))};return window.addEventListener("keydown",t),l.current?.focus(),()=>{document.body.style.overflow=e,window.removeEventListener("keydown",t)}},[r]),(0,a.jsxs)("div",{className:"mj-diagram-viewer",role:"dialog","aria-modal":"true","aria-label":t??"Diagram",onClick:r,children:[(0,a.jsxs)("div",{className:"mj-diagram-viewer-bar",onClick:e=>e.stopPropagation(),children:[(0,a.jsx)("strong",{children:t??"Diagram"}),(0,a.jsxs)("div",{children:[(0,a.jsx)("button",{type:"button",onClick:()=>i(e=>Math.max(.5,e-.25)),"aria-label":"Zoom out",children:"\u2212"}),(0,a.jsxs)("button",{type:"button",onClick:()=>i(1),"aria-label":"Reset zoom",children:[Math.round(100*n),"%"]}),(0,a.jsx)("button",{type:"button",onClick:()=>i(e=>Math.min(4,e+.25)),"aria-label":"Zoom in",children:"+"}),(0,a.jsx)("button",{type:"button",onClick:r,"aria-label":"Close",children:"Close"})]})]}),(0,a.jsx)("div",{className:"mj-diagram-viewer-stage",ref:l,tabIndex:-1,onClick:e=>e.stopPropagation(),children:(0,a.jsx)("div",{className:"mj-diagram-viewer-svg",style:{width:`${100*n}%`},dangerouslySetInnerHTML:{__html:e}})})]})}function u({value:e}){let{colorMode:t}=(0,i.G)(),{source:r,title:n,caption:j,kind:p}=(0,s.useMemo)(()=>{let t,r,a,s,n;return a=e.split("\n").filter(e=>{let a=e.match(/^\s*%%\s*(title|caption)\s*:\s*(.+)$/i);return!a||("title"===a[1].toLowerCase()?t=a[2].trim():r=a[2].trim(),!1)}).join("\n").trim(),s=a.split("\n").find(e=>e.trim()&&!e.trim().startsWith("%%"))?.trim()??"",n=d.find(([e])=>e.test(s))?.[1]??"Diagram",{source:a,title:t,caption:r,kind:n}},[e]),x=(0,s.useMemo)(()=>({startOnLoad:!1,theme:"base",securityLevel:"strict",fontFamily:o,themeVariables:{...c["dark"===t?"dark":"light"],fontFamily:o,fontSize:"16px"},flowchart:{curve:"basis",padding:16,nodeSpacing:44,rankSpacing:52,htmlLabels:!0,useMaxWidth:!1,diagramPadding:12,wrappingWidth:280},sequence:{useMaxWidth:!1,mirrorActors:!1,width:112,actorMargin:18,wrap:!0,boxMargin:12,messageMargin:40,noteMargin:12,rightAngles:!1,showSequenceNumbers:!1},state:{useMaxWidth:!1},class:{useMaxWidth:!1},er:{useMaxWidth:!1},gantt:{useMaxWidth:!1}}),[t]),g=(0,l.cE)({text:r,config:x}),[f,b]=(0,s.useState)(!1),[v,y]=(0,s.useState)(!1),[w,k]=(0,s.useState)(!1),N=(0,s.useRef)(null),C=(0,s.useCallback)(()=>{let e=N.current;e&&k(e.scrollWidth>e.clientWidth+4)},[]);return(0,s.useEffect)(()=>{let e=N.current;if(!e||!("ResizeObserver"in window))return;let t=new ResizeObserver(()=>k(e.scrollWidth>e.clientWidth+4));return t.observe(e),()=>t.disconnect()},[g]),(0,a.jsxs)("figure",{className:"mj-diagram",children:[(0,a.jsxs)("header",{className:"mj-diagram-head",children:[(0,a.jsx)("span",{className:"mj-diagram-kind",children:p}),n&&(0,a.jsx)("strong",{className:"mj-diagram-title",children:n}),(0,a.jsxs)("span",{className:"mj-diagram-actions",children:[(0,a.jsx)("button",{type:"button",onClick:()=>{navigator.clipboard?.writeText(e).then(()=>{y(!0),setTimeout(()=>y(!1),1800)}).catch(()=>void 0)},children:v?"Copied":"Copy source"}),(0,a.jsx)("button",{type:"button",onClick:()=>b(!0),disabled:!g,children:"Expand"})]})]}),(0,a.jsx)("div",{className:`mj-diagram-canvas${w?" is-scrolling":""}`,ref:N,children:g?(0,a.jsx)(m,{result:g,onReady:C}):(0,a.jsx)("div",{className:"mj-diagram-loading","aria-hidden":"true"})}),w&&(0,a.jsx)("div",{className:"mj-diagram-hint",children:"Scroll sideways or tap Expand to see the whole diagram"}),j&&(0,a.jsx)("figcaption",{children:j}),f&&g&&(0,a.jsx)(h,{svg:g.svg,title:n,onClose:()=>b(!1)})]})}function j({value:e}){return(0,a.jsx)(n.A,{fallback:({error:t})=>(0,a.jsxs)("figure",{className:"mj-diagram is-error",children:[(0,a.jsxs)("header",{className:"mj-diagram-head",children:[(0,a.jsx)("span",{className:"mj-diagram-kind",children:"Diagram error"}),(0,a.jsx)("strong",{className:"mj-diagram-title",children:String(t?.message??t).split("\n")[0]})]}),(0,a.jsx)("pre",{className:"mj-diagram-source",children:e})]}),children:(0,a.jsx)(u,{value:e})})}}}]);