mirror of
https://github.com/facebook/docusaurus.git
synced 2025-08-02 16:29:47 +02:00
1 line
No EOL
43 KiB
JavaScript
1 line
No EOL
43 KiB
JavaScript
"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([["37251"],{71317:function(e,n,r){r.r(n),r.d(n,{metadata:()=>t,contentTitle:()=>a,default:()=>h,assets:()=>l,toc:()=>u,frontMatter:()=>c});var t=JSON.parse('{"id":"release-process","title":"Release process","description":"Let\'s see how Docusaurus handles versioning, releases and breaking changes.","source":"@site/community/5-release-process.mdx","sourceDirName":".","slug":"/release-process","permalink":"/community/release-process","draft":false,"unlisted":false,"editUrl":"https://github.com/facebook/docusaurus/edit/main/website/community/5-release-process.mdx","tags":[],"version":"current","lastUpdatedBy":"S\xe9bastien Lorber","lastUpdatedAt":1729598021000,"sidebarPosition":5,"frontMatter":{},"sidebar":"community","previous":{"title":"Canary releases","permalink":"/community/canary"}}'),o=r("24246"),s=r("80980"),i=r("21143");let c={},a="Release process",l={},u=[{value:"Semantic versioning",id:"semantic-versioning",level:2},{value:"Major versions",id:"major-versions",level:3},{value:"Minor versions",id:"minor-versions",level:3},{value:"Patch versions",id:"patch-versions",level:3},{value:"Versions",id:"versions",level:2},{value:"Stable version",id:"stable-version",level:3},{value:"Next version",id:"next-version",level:3},{value:"Public API surface",id:"public-api-surface",level:2},{value:"Core public API",id:"core-public-api",level:3},{value:"Theming public API",id:"theming-public-api",level:3}];function d(e){let n={a:"a",admonition:"admonition",code:"code",h1:"h1",h2:"h2",h3:"h3",header:"header",li:"li",p:"p",strong:"strong",ul:"ul",...(0,s.a)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(n.header,{children:(0,o.jsx)(n.h1,{id:"release-process",children:"Release process"})}),"\n",(0,o.jsxs)(n.p,{children:["Let's see how Docusaurus handles ",(0,o.jsx)(n.strong,{children:"versioning, releases and breaking changes"}),"."]}),"\n",(0,o.jsx)(n.admonition,{type:"info",children:(0,o.jsx)(n.p,{children:"This topic is particularly important for highly customized sites that may have difficulties to upgrade."})}),"\n",(0,o.jsx)(n.h2,{id:"semantic-versioning",children:"Semantic versioning"}),"\n",(0,o.jsxs)(n.p,{children:["Docusaurus versioning is based on the ",(0,o.jsx)(n.code,{children:"major.minor.patch"})," scheme and respects ",(0,o.jsx)(n.a,{href:"https://semver.org/",children:"Semantic Versioning"}),"."]}),"\n",(0,o.jsx)(n.p,{children:"Respecting Semantic Versioning is important for multiple reasons:"}),"\n",(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsxs)(n.li,{children:["It ",(0,o.jsx)(n.strong,{children:"guarantees simple minor version upgrades"}),", as long as you only use the ",(0,o.jsx)(n.a,{href:"/community/release-process#public-api-surface",children:"public API"})]}),"\n",(0,o.jsx)(n.li,{children:"It follows front-end ecosystem conventions"}),"\n",(0,o.jsx)(n.li,{children:"A new major version is an opportunity to thoroughly document breaking changes"}),"\n",(0,o.jsx)(n.li,{children:"A new major/minor version is an opportunity to communicate new features through a blog post"}),"\n"]}),"\n",(0,o.jsxs)(n.admonition,{type:"note",children:[(0,o.jsxs)(n.p,{children:["Releasing Docusaurus 2.0 took a very long time. From now on, Docusaurus will ",(0,o.jsx)(n.strong,{children:"release new major versions more regularly"}),". In practice, you can expect a new major version every 2\u20134 months."]}),(0,o.jsxs)(n.p,{children:[(0,o.jsx)(n.a,{href:"https://tom.preston-werner.com/2022/05/23/major-version-numbers-are-not-sacred.html",children:"Major version numbers are not sacred"}),", but we still group breaking changes together and avoid releasing major versions too often."]})]}),"\n",(0,o.jsx)(n.h3,{id:"major-versions",children:"Major versions"}),"\n",(0,o.jsxs)(n.p,{children:["The ",(0,o.jsx)(n.code,{children:"major"})," version number is incremented on ",(0,o.jsx)(n.strong,{children:"every breaking change"}),"."]}),"\n",(0,o.jsx)(n.p,{children:"Whenever a new major version is released, we publish:"}),"\n",(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsxs)(n.li,{children:["a blog post with feature highlights, major bug fixes, ",(0,o.jsx)(n.strong,{children:"breaking changes, and upgrade instructions"}),"."]}),"\n",(0,o.jsx)(n.li,{children:"an exhaustive changelog entry"}),"\n"]}),"\n",(0,o.jsx)(n.admonition,{type:"tip",children:(0,o.jsxs)(n.p,{children:["Read our ",(0,o.jsx)(n.a,{href:"#public-api-surface",children:"public API surface"})," section to clearly understand what we consider as a breaking change."]})}),"\n",(0,o.jsx)(n.h3,{id:"minor-versions",children:"Minor versions"}),"\n",(0,o.jsxs)(n.p,{children:["The ",(0,o.jsx)(n.code,{children:"minor"})," version number is incremented on every significant retro-compatible change."]}),"\n",(0,o.jsx)(n.p,{children:"Whenever a new minor version is released, we publish:"}),"\n",(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsx)(n.li,{children:"a blog post with a list of feature highlights and major bug fixes"}),"\n",(0,o.jsx)(n.li,{children:"an exhaustive changelog entry"}),"\n"]}),"\n",(0,o.jsx)(n.admonition,{type:"tip",children:(0,o.jsxs)(n.p,{children:["If you only use our ",(0,o.jsx)(n.a,{href:"#public-api-surface",children:"public API surface"}),", you should be able to upgrade in no time!"]})}),"\n",(0,o.jsx)(n.h3,{id:"patch-versions",children:"Patch versions"}),"\n",(0,o.jsxs)(n.p,{children:["The ",(0,o.jsx)(n.code,{children:"patch"})," version number is incremented on bugfixes releases."]}),"\n",(0,o.jsx)(n.p,{children:"Whenever a new patch version is released, we publish:"}),"\n",(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsx)(n.li,{children:"an exhaustive changelog entry"}),"\n"]}),"\n",(0,o.jsx)(n.h2,{id:"versions",children:"Versions"}),"\n","\n",(0,o.jsx)(n.p,{children:"The Docusaurus team is usually working on 2 major versions at the same time:"}),"\n",(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsxs)(n.li,{children:[(0,o.jsxs)(n.strong,{children:["Docusaurus ",(0,o.jsx)(i.Fr,{})]}),": the ",(0,o.jsx)(n.strong,{children:"stable"})," version, on the ",(0,o.jsx)(i.Zl,{})," branch"]}),"\n",(0,o.jsxs)(n.li,{children:[(0,o.jsxs)(n.strong,{children:["Docusaurus ",(0,o.jsx)(i.CW,{})]}),": the ",(0,o.jsx)(n.strong,{children:"next"})," version, on the ",(0,o.jsx)(i.mq,{})," branch"]}),"\n"]}),"\n",(0,o.jsx)(n.admonition,{type:"note",children:(0,o.jsxs)(n.p,{children:["The ",(0,o.jsx)(i.Zl,{})," branch is created just before releasing the first v",(0,o.jsx)(i.Fr,{})," release candidate."]})}),"\n",(0,o.jsx)(n.h3,{id:"stable-version",children:"Stable version"}),"\n",(0,o.jsxs)(n.p,{children:["The stable version (v",(0,o.jsx)(i.Fr,{}),", on ",(0,o.jsx)(i.Zl,{}),") is recommended for most Docusaurus users."]}),"\n",(0,o.jsxs)(n.p,{children:["We regularly backport retro-compatible features, bug and security fixes from ",(0,o.jsx)(i.mq,{})," to ",(0,o.jsx)(i.Zl,{})," with ",(0,o.jsx)(n.code,{children:"git cherry-pick"})," to make them available to those not ready for the next version."]}),"\n",(0,o.jsxs)(n.admonition,{type:"info",children:[(0,o.jsxs)(n.p,{children:["After a new stable version has been released, the former stable version will continue to receive support only for ",(0,o.jsx)(n.strong,{children:"major security issues"})," for ",(0,o.jsx)(n.strong,{children:"3 months"}),". Otherwise, all features will be frozen and non-critical bugs will not be fixed."]}),(0,o.jsx)(n.p,{children:"It is recommended to upgrade within that time frame to the new stable version."})]}),"\n",(0,o.jsx)(n.h3,{id:"next-version",children:"Next version"}),"\n",(0,o.jsxs)(n.p,{children:["The next version (v",(0,o.jsx)(i.CW,{}),", on ",(0,o.jsx)(i.mq,{}),") is the version the Docusaurus team is currently working on."]}),"\n",(0,o.jsxs)(n.p,{children:["The ",(0,o.jsx)(i.mq,{})," branch is the ",(0,o.jsx)(n.strong,{children:"default target branch"})," for all pull requests, including core team and external contributions."]}),"\n",(0,o.jsxs)(n.p,{children:["This version is recommended for ",(0,o.jsx)(n.strong,{children:"early adopters"})," that want to use the latest Docusaurus features as soon as possible. It is also a good way to help us by reporting bugs and giving some feedback."]}),"\n",(0,o.jsx)(n.p,{children:"There are 3 ways to use the next version:"}),"\n",(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsxs)(n.li,{children:["with an ",(0,o.jsx)(n.code,{children:"alpha"}),", ",(0,o.jsx)(n.code,{children:"beta"})," or ",(0,o.jsx)(n.code,{children:"rc"})," pre-release"]}),"\n",(0,o.jsxs)(n.li,{children:["with the ",(0,o.jsx)(n.code,{children:"@next"})," npm dist tag for the latest pre-release"]}),"\n",(0,o.jsxs)(n.li,{children:["with a ",(0,o.jsx)(n.a,{href:"/community/canary",children:"canary release"})," for the very latest features"]}),"\n"]}),"\n",(0,o.jsx)(n.admonition,{type:"tip",children:(0,o.jsx)(n.p,{children:"The next version passes all our automated tests and is used by the Docusaurus site itself. It is relatively safe: don't be afraid to give it a try."})}),"\n",(0,o.jsxs)(n.admonition,{type:"warning",children:[(0,o.jsx)(n.p,{children:"Breaking changes can happen on the next version: detailed upgrade instructions are available in the changelog and pull requests."}),(0,o.jsxs)(n.p,{children:["At the ",(0,o.jsx)(n.code,{children:"beta"})," and ",(0,o.jsx)(n.code,{children:"rc"})," (release candidate) phases, we avoid introducing major breaking changes."]})]}),"\n",(0,o.jsx)(n.h2,{id:"public-api-surface",children:"Public API surface"}),"\n",(0,o.jsxs)(n.p,{children:["Docusaurus commits to respecting Semantic Versioning. This means that whenever changes occur in Docusaurus public APIs and break backward compatibility, we will increment the ",(0,o.jsx)(n.code,{children:"major"})," version number."]}),"\n",(0,o.jsx)(n.admonition,{type:"tip",children:(0,o.jsxs)(n.p,{children:["Docusaurus guarantees public API retro-compatibility across ",(0,o.jsx)(n.code,{children:"minor"})," versions. Unless you use internal APIs, ",(0,o.jsx)(n.code,{children:"minor"})," version upgrades should be easy."]})}),"\n",(0,o.jsx)(n.p,{children:"We will outline what accounts as the public API surface."}),"\n",(0,o.jsx)(n.h3,{id:"core-public-api",children:"Core public API"}),"\n",(0,o.jsx)(n.p,{children:"\u2705 Our public API includes:"}),"\n",(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsx)(n.li,{children:"Docusaurus config"}),"\n",(0,o.jsx)(n.li,{children:"Docusaurus client APIs"}),"\n",(0,o.jsx)(n.li,{children:"Docusaurus CLI"}),"\n",(0,o.jsx)(n.li,{children:"Preset options"}),"\n",(0,o.jsx)(n.li,{children:"Plugin options"}),"\n",(0,o.jsx)(n.li,{children:"Plugin lifecycle APIs"}),"\n",(0,o.jsx)(n.li,{children:"Theme config"}),"\n",(0,o.jsx)(n.li,{children:"Core plugins route component props"}),"\n",(0,o.jsxs)(n.li,{children:[(0,o.jsx)(n.code,{children:"@docusaurus/types"})," TypeScript types","\n",(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsx)(n.li,{children:"We still retain the freedom to make types stricter (which may break type-checking)."}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,o.jsxs)(n.p,{children:["\u274C Our public API ",(0,o.jsx)(n.strong,{children:"excludes"}),":"]}),"\n",(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsxs)(n.li,{children:["Docusaurus config ",(0,o.jsx)(n.code,{children:"future"})]}),"\n",(0,o.jsxs)(n.li,{children:["All features prefixed by ",(0,o.jsx)(n.code,{children:"experimental_"})," or ",(0,o.jsx)(n.code,{children:"unstable_"})]}),"\n",(0,o.jsxs)(n.li,{children:["All features prefixed by ",(0,o.jsx)(n.code,{children:"v<MajorVersion>_"})," (",(0,o.jsx)(n.code,{children:"v6_"})," ",(0,o.jsx)(n.code,{children:"v7_"}),", etc.)"]}),"\n"]}),"\n",(0,o.jsx)(n.admonition,{type:"tip",children:(0,o.jsx)(n.p,{children:"For non-theme APIs, any documented API is considered public (and will be stable); any undocumented API is considered internal."})}),"\n",(0,o.jsxs)(n.p,{children:['An API being "stable" means if you increment the patch or minor version of your Docusaurus installation without any other change, running ',(0,o.jsx)(n.code,{children:"docusaurus start"})," or ",(0,o.jsx)(n.code,{children:"docusaurus build"})," should not throw an error."]}),"\n",(0,o.jsx)(n.h3,{id:"theming-public-api",children:"Theming public API"}),"\n",(0,o.jsx)(n.p,{children:"Docusaurus has a very flexible theming system:"}),"\n",(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsx)(n.li,{children:"You can use custom CSS"}),"\n",(0,o.jsxs)(n.li,{children:["You can ",(0,o.jsx)(n.a,{href:"/docs/swizzling",children:"swizzle"})," any React theme component"]}),"\n"]}),"\n",(0,o.jsx)(n.p,{children:"This system also implicitly creates a very large API surface. To be able to move fast and improve Docusaurus, we can't guarantee retro-compatibility."}),"\n",(0,o.jsx)(n.p,{children:"\u2705 Our public theming API includes:"}),"\n",(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsx)(n.li,{children:(0,o.jsx)(n.a,{href:"/docs/styling-layout#theme-class-names",children:"Theme class names"})}),"\n",(0,o.jsxs)(n.li,{children:[(0,o.jsx)(n.a,{href:"/docs/styling-layout#styling-your-site-with-infima",children:"Infima"})," class names and CSS variables"]}),"\n",(0,o.jsxs)(n.li,{children:["React components that are ",(0,o.jsx)(n.a,{href:"/docs/swizzling#what-is-safe-to-swizzle",children:"safe to swizzle"})]}),"\n",(0,o.jsx)(n.li,{children:"The theme user experience"}),"\n",(0,o.jsx)(n.li,{children:"Browser support"}),"\n"]}),"\n",(0,o.jsxs)(n.admonition,{type:"tip",children:[(0,o.jsx)(n.p,{children:"You may not be able to achieve your site customization through this public API."}),(0,o.jsxs)(n.p,{children:["In this case, please ",(0,o.jsx)(n.a,{href:"https://github.com/facebook/docusaurus/discussions/5468",children:"report your customization use case"})," and we will figure out how to expand our public API."]})]}),"\n",(0,o.jsxs)(n.p,{children:["\u274C Our public theming API ",(0,o.jsx)(n.strong,{children:"excludes"}),":"]}),"\n",(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsx)(n.li,{children:"The DOM structure"}),"\n",(0,o.jsxs)(n.li,{children:["CSS module class names with a hash suffix (usually targeted with ",(0,o.jsx)(n.code,{children:"[class*='myClassName']"})," selectors)"]}),"\n",(0,o.jsxs)(n.li,{children:["React components that are ",(0,o.jsx)(n.a,{href:"/docs/swizzling#what-is-safe-to-swizzle",children:"unsafe or forbidden to swizzle"})]}),"\n",(0,o.jsxs)(n.li,{children:["React components that import from ",(0,o.jsx)(n.code,{children:"@docusaurus/theme-common/internal"})]}),"\n",(0,o.jsx)(n.li,{children:"The exact visual appearance of the theme"}),"\n"]}),"\n",(0,o.jsxs)(n.admonition,{type:"note",children:[(0,o.jsxs)(n.p,{children:["When ",(0,o.jsx)(n.a,{href:"/docs/swizzling",children:"swizzling"})," safe components, you might encounter components that import undocumented APIs from ",(0,o.jsx)(n.code,{children:"@docusaurus/theme-common"})," (without the ",(0,o.jsx)(n.code,{children:"/internal"})," subpath)."]}),(0,o.jsx)(n.p,{children:'We still maintain retro-compatibility on those APIs (hence they are marked as "safe"), but we don\'t encourage a direct usage.'})]})]})}function h(e={}){let{wrapper:n}={...(0,s.a)(),...e.components};return n?(0,o.jsx)(n,{...e,children:(0,o.jsx)(d,{...e})}):d(e)}},56497:function(e,n,r){r.d(n,{Z:function(){return s}});var t=r(24246);r(27378);var o=r(71607);function s(e){var n=e.children,r=e.fallback;return(0,o.Z)()?(0,t.jsx)(t.Fragment,{children:null==n?void 0:n()}):null!=r?r:null}},21143:function(e,n,r){r.d(n,{CW:function(){return y},FS:function(){return P},Fr:function(){return g},Hc:function(){return k},I1:function(){return f},SR:function(){return b},UM:function(){return w},Zl:function(){return x},mC:function(){return h},mq:function(){return O},rv:function(){return S}});var t=r(24246),o=r(27378),s=r(99887),i=r(90158),c=r(77827),a=r(35363),l=r(95998);function u(e,n){(null==n||n>e.length)&&(n=e.length);for(var r=0,t=Array(n);r<n;r++)t[r]=e[r];return t}var d=o.createContext(null);function h(e){var n,r,s=e.children;var i=(n=(0,o.useState)(null),r=2,function(e){if(Array.isArray(e))return e}(n)||function(e,n){var r,t,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var s=[],i=!0,c=!1;try{for(o=o.call(e);!(i=(r=o.next()).done)&&(s.push(r.value),!n||s.length!==n);i=!0);}catch(e){c=!0,t=e}finally{try{!i&&null!=o.return&&o.return()}finally{if(c)throw t}}return s}}(n,2)||function(e,n){if(e){if("string"==typeof e)return u(e,n);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return u(e,n)}}(n,r)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),c=i[0],a=i[1],l=(0,o.useRef)(!0);return(0,o.useEffect)(function(){return l.current=!0,function(){l.current=!1}},[]),(0,o.useEffect)(function(){fetch("https://registry.npmjs.org/@docusaurus/core").then(function(e){return e.json()}).then(function(e){if(!!l.current){var n=Object.keys(e.versions).at(-1),r=e.time[n];a({name:n,time:r})}})},[]),(0,t.jsx)(d.Provider,{value:c,children:s})}function p(){var e,n,r=null===(e=(0,s.J)("default").preferredVersion)||void 0===e?void 0:e.name,t=(0,i.useVersions)("default"),o=(null!==(n=t.find(function(e){return"current"!==e.name}))&&void 0!==n?n:t[0]).name;return r&&"current"!==r?r:o}function f(){var e=(0,o.useContext)(d);return e?(0,t.jsx)("span",{children:(0,t.jsx)(c.Z,{description:"The hint text for the current canary version tag.",values:{canaryVersionName:(0,t.jsx)("b",{children:e.name})},children:"Current: {canaryVersionName}"})}):(0,t.jsx)("span",{children:(0,t.jsx)(c.Z,{description:"An example canary version tag when the actual version can't be fetched.",children:"Example: 0.0.0-4922"})})}function b(){var e=p();return(0,t.jsx)("span",{children:e})}function m(){return 3}function j(){return 2}function y(){return(0,t.jsx)("span",{children:3})}function g(){return(0,t.jsx)("span",{children:2})}function v(e){var n=e.branch;return(0,t.jsx)(a.Z,{to:"https://github.com/facebook/docusaurus/tree/".concat(n),children:(0,t.jsx)("code",{children:n})})}function x(){return(0,t.jsx)(v,{branch:"docusaurus-v".concat(2)})}function O(){return(0,t.jsx)(v,{branch:"main"})}function w(e){var n=e.children;return(0,o.useContext)(d)?null:n}function P(e){var n=e.children;return(0,o.useContext)(d)?n:null}function k(){var e,n,r=null!==(n=null===(e=(0,o.useContext)(d))||void 0===e?void 0:e.name)&&void 0!==n?n:"0.0.0-4922",s=p();return(0,t.jsx)(l.Z,{language:"diff",children:'- "@docusaurus/core": "^'.concat(s,'",\n- "@docusaurus/preset-classic": "^').concat(s,'",\n+ "@docusaurus/core": "').concat(r,'",\n+ "@docusaurus/preset-classic": "').concat(r,'",\n')})}function S(){var e,n=null===(e=(0,o.useContext)(d))||void 0===e?void 0:e.time;return n?(0,t.jsx)(c.Z,{values:{time:(0,t.jsx)("b",{children:new Date(n).toLocaleString()})},children:"The latest canary version that's available on npm is published at {time}."}):null}},95998:function(e,n,r){r.d(n,{Z:()=>ej});var t,o,s,i={};r.r(i),r.d(i,{ButtonExample:()=>T});var c=r("24246"),a=r("27378"),l=r("90496"),u=r("71607"),d=r("10075"),h=r("77827"),p=r("8156"),f=r("56497"),b=r("85108"),m=r("45245"),j=r("26378");function y(){var e=(0,j.L)().prism,n=(0,m.I)().colorMode,r=e.theme,t=e.darkTheme||r;return"dark"===n?t:r}var g=r("67490");let v="playgroundContainer_6Ior",x="playgroundHeader_Tvsk",O="playgroundEditor_TySg",w="playgroundPreview_mApW";function P(e){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{},t=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(t=t.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),t.forEach(function(n){var t,o,s;t=e,o=n,s=r[n],o in t?Object.defineProperty(t,o,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[o]=s})}return e}function k(e){var n=e.children;return(0,c.jsx)("div",{className:(0,l.Z)(x),children:n})}function S(){return(0,c.jsx)("div",{children:"Loading..."})}function I(){return(0,c.jsx)(f.Z,{fallback:(0,c.jsx)(S,{}),children:function(){return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(g.Z,{fallback:function(e){return(0,c.jsx)(b.Ac,P({},e))},children:(0,c.jsx)(d.i5,{})}),(0,c.jsx)(d.IF,{})]})}})}function A(){return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(k,{children:(0,c.jsx)(h.Z,{id:"theme.Playground.result",description:"The result label of the live codeblocks",children:"Result"})}),(0,c.jsx)("div",{className:w,children:(0,c.jsx)(I,{})})]})}function C(){var e=(0,u.Z)();return(0,c.jsx)(d.uz,{className:O},String(e))}function D(){return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(k,{children:(0,c.jsx)(h.Z,{id:"theme.Playground.liveEditor",description:"The live editor label of the live codeblocks",children:"Live Editor"})}),(0,c.jsx)(C,{})]})}var E=function(e){return"".concat(e,";")};function B(e){var n,r,t,o,s=e.children,i=e.transformCode,a=function(e,n){if(null==e)return{};var r,t,o=function(e,n){if(null==e)return{};var r,t,o={},s=Object.keys(e);for(t=0;t<s.length;t++)r=s[t],!(n.indexOf(r)>=0)&&(o[r]=e[r]);return o}(e,n);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(t=0;t<s.length;t++){if(r=s[t],!(n.indexOf(r)>=0))Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}}return o}(e,["children","transformCode"]),l=(0,p.Z)().siteConfig.themeConfig.liveCodeBlock.playgroundPosition,u=y(),h=null!==(o=null===(t=a.metastring)||void 0===t?void 0:t.includes("noInline"))&&void 0!==o&&o;return(0,c.jsx)("div",{className:v,children:(0,c.jsx)(d.nu,(n=P({code:null==s?void 0:s.replace(/\n$/,""),noInline:h,transformCode:null!=i?i:E,theme:u},a),r=(r={children:"top"===l?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(A,{}),(0,c.jsx)(D,{})]}):(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(D,{}),(0,c.jsx)(A,{})]})},r),Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(r)):(function(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);r.push.apply(r,t)}return r})(Object(r)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(r,e))}),n))})}function N(e){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{},t=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(t=t.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),t.forEach(function(n){var t,o,s;t=e,o=n,s=r[n],o in t?Object.defineProperty(t,o,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[o]=s})}return e}function T(e){var n,r;return(0,c.jsx)("button",(n=N({type:"button"},e),r=(r={style:N({backgroundColor:"white",color:"black",border:"solid red",borderRadius:20,padding:10,cursor:"pointer"},e.style)},r),Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(r)):(function(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);r.push.apply(r,t)}return r})(Object(r)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(r,e))}),n))}let L=function(e){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{},t=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(t=t.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),t.forEach(function(n){var t,o,s;t=e,o=n,s=r[n],o in t?Object.defineProperty(t,o,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[o]=s})}return e}({React:a},a,i);var Z=r("55951"),z=r("6324"),_=r.n(z);function W(e,n){(null==n||n>e.length)&&(n=e.length);for(var r=0,t=Array(n);r<n;r++)t[r]=e[r];return t}function M(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var r,t,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var s=[],i=!0,c=!1;try{for(o=o.call(e);!(i=(r=o.next()).done)&&(s.push(r.value),!n||s.length!==n);i=!0);}catch(e){c=!0,t=e}finally{try{!i&&null!=o.return&&o.return()}finally{if(c)throw t}}return s}}(e,n)||function(e,n){if(e){if("string"==typeof e)return W(e,n);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return W(e,n)}}(e,n)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var R=RegExp("title=(?<quote>[\"'])(?<title>.*?)\\1"),F=RegExp("\\{(?<range>[\\d,-]+)\\}"),V={js:{start:"\\/\\/",end:""},jsBlock:{start:"\\/\\*",end:"\\*\\/"},jsx:{start:"\\{\\s*\\/\\*",end:"\\*\\/\\s*\\}"},bash:{start:"#",end:""},html:{start:"\x3c!--",end:"--\x3e"}};var H=(t=function(e){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{},t=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(t=t.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),t.forEach(function(n){var t,o,s;t=e,o=n,s=r[n],o in t?Object.defineProperty(t,o,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[o]=s})}return e}({},V),o=(o={lua:{start:"--",end:""},wasm:{start:"\\;\\;",end:""},tex:{start:"%",end:""},vb:{start:"['\u2018\u2019]",end:""},vbnet:{start:"(?:_\\s*)?['\u2018\u2019]",end:""},rem:{start:"[Rr][Ee][Mm]\\b",end:""},f90:{start:"!",end:""},ml:{start:"\\(\\*",end:"\\*\\)"},cobol:{start:"\\*>",end:""}},o),Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):(function(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);r.push.apply(r,t)}return r})(Object(o)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))}),t),q=Object.keys(V);function U(e,n){var r=e.map(function(e){var r=H[e],t=r.start,o=r.end;return"(?:".concat(t,"\\s*(").concat(n.flatMap(function(e){var n,r;return[e.line,null===(n=e.block)||void 0===n?void 0:n.start,null===(r=e.block)||void 0===r?void 0:r.end].filter(Boolean)}).join("|"),")\\s*").concat(o,")")}).join("|");return new RegExp("^\\s*(?:".concat(r,")\\s*$"))}let $="codeBlockContainer_jDV4";function G(e){var n,r,t,o,s=e.as,i=function(e,n){if(null==e)return{};var r,t,o=function(e,n){if(null==e)return{};var r,t,o={},s=Object.keys(e);for(t=0;t<s.length;t++)r=s[t],!(n.indexOf(r)>=0)&&(o[r]=e[r]);return o}(e,n);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(t=0;t<s.length;t++){if(r=s[t],!(n.indexOf(r)>=0))Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}}return o}(e,["as"]);var a=(n={color:"--prism-color",backgroundColor:"--prism-background-color"},r={},Object.entries(y().plain).forEach(function(e){var t=M(e,2),o=t[0],s=t[1],i=n[o];i&&"string"==typeof s&&(r[i]=s)}),r);return(0,c.jsx)(s,(t=function(e){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{},t=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(t=t.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),t.forEach(function(n){var t,o,s;t=e,o=n,s=r[n],o in t?Object.defineProperty(t,o,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[o]=s})}return e}({},i),o=(o={style:a,className:(0,l.Z)(i.className,$,Z.k.common.codeBlock)},o),Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):(function(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);r.push.apply(r,t)}return r})(Object(o)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))}),t))}let J={codeBlockContent:"codeBlockContent_vx7S",codeBlockTitle:"codeBlockTitle_bdru",codeBlock:"codeBlock_Gebt",codeBlockStandalone:"codeBlockStandalone_i_cY",codeBlockLines:"codeBlockLines_FJaf",codeBlockLinesWithNumbering:"codeBlockLinesWithNumbering_FU9Q",buttonGroup:"buttonGroup_cUGO"};function Q(e){var n=e.children,r=e.className;return(0,c.jsx)(G,{as:"pre",tabIndex:0,className:(0,l.Z)(J.codeBlockStandalone,"thin-scrollbar",r),children:(0,c.jsx)("code",{className:J.codeBlockLines,children:n})})}var Y=r("50923"),X={attributes:!0,characterData:!0,childList:!0,subtree:!0};function K(e,n){(null==n||n>e.length)&&(n=e.length);for(var r=0,t=Array(n);r<n;r++)t[r]=e[r];return t}function ee(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var r,t,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var s=[],i=!0,c=!1;try{for(o=o.call(e);!(i=(r=o.next()).done)&&(s.push(r.value),!n||s.length!==n);i=!0);}catch(e){c=!0,t=e}finally{try{!i&&null!=o.return&&o.return()}finally{if(c)throw t}}return s}}(e,n)||function(e,n){if(e){if("string"==typeof e)return K(e,n);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return K(e,n)}}(e,n)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var en=r("7316");let er={codeLine:"codeLine_qRmp",codeLineNumber:"codeLineNumber_dS_J",codeLineContent:"codeLineContent_XF5l"};function et(e){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{},t=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(t=t.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),t.forEach(function(n){var t,o,s;t=e,o=n,s=r[n],o in t?Object.defineProperty(t,o,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[o]=s})}return e}function eo(e){var n,r,t=e.line,o=e.classNames,s=e.showLineNumbers,i=e.getLineProps,a=e.getTokenProps;1===t.length&&"\n"===t[0].content&&(t[0].content="");var u=i({line:t,className:(0,l.Z)(o,s&&er.codeLine)}),d=t.map(function(e,n){return(0,c.jsx)("span",et({},a({token:e})),n)});return(0,c.jsxs)("span",(n=et({},u),r=(r={children:[s?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("span",{className:er.codeLineNumber}),(0,c.jsx)("span",{className:er.codeLineContent,children:d})]}):d,(0,c.jsx)("br",{})]},r),Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(r)):(function(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);r.push.apply(r,t)}return r})(Object(r)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(r,e))}),n))}var es=r("44771");function ei(e){var n,r;return(0,c.jsx)("svg",(n=function(e){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{},t=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(t=t.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),t.forEach(function(n){var t,o,s;t=e,o=n,s=r[n],o in t?Object.defineProperty(t,o,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[o]=s})}return e}({viewBox:"0 0 24 24"},e),r=(r={children:(0,c.jsx)("path",{fill:"currentColor",d:"M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"})},r),Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(r)):(function(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);r.push.apply(r,t)}return r})(Object(r)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(r,e))}),n))}function ec(e){var n,r;return(0,c.jsx)("svg",(n=function(e){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{},t=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(t=t.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),t.forEach(function(n){var t,o,s;t=e,o=n,s=r[n],o in t?Object.defineProperty(t,o,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[o]=s})}return e}({viewBox:"0 0 24 24"},e),r=(r={children:(0,c.jsx)("path",{fill:"currentColor",d:"M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"})},r),Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(r)):(function(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);r.push.apply(r,t)}return r})(Object(r)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(r,e))}),n))}let ea={copyButtonCopied:"copyButtonCopied_OkN_",copyButtonIcons:"copyButtonIcons_OqsO",copyButtonIcon:"copyButtonIcon_PgCn",copyButtonSuccessIcon:"copyButtonSuccessIcon_bsQG"};function el(e,n){(null==n||n>e.length)&&(n=e.length);for(var r=0,t=Array(n);r<n;r++)t[r]=e[r];return t}function eu(e){var n,r,t=e.code,o=e.className;var s=(n=(0,a.useState)(!1),r=2,function(e){if(Array.isArray(e))return e}(n)||function(e,n){var r,t,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var s=[],i=!0,c=!1;try{for(o=o.call(e);!(i=(r=o.next()).done)&&(s.push(r.value),!n||s.length!==n);i=!0);}catch(e){c=!0,t=e}finally{try{!i&&null!=o.return&&o.return()}finally{if(c)throw t}}return s}}(n,2)||function(e,n){if(e){if("string"==typeof e)return el(e,n);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return el(e,n)}}(n,r)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),i=s[0],u=s[1],d=(0,a.useRef)(void 0),p=(0,a.useCallback)(function(){(0,es.Z)(t),u(!0),d.current=window.setTimeout(function(){u(!1)},1e3)},[t]);return(0,a.useEffect)(function(){return function(){return window.clearTimeout(d.current)}},[]),(0,c.jsx)("button",{type:"button","aria-label":i?(0,h.I)({id:"theme.CodeBlock.copied",message:"Copied",description:"The copied button label on code blocks"}):(0,h.I)({id:"theme.CodeBlock.copyButtonAriaLabel",message:"Copy code to clipboard",description:"The ARIA label for copy code blocks button"}),title:(0,h.I)({id:"theme.CodeBlock.copy",message:"Copy",description:"The copy button label on code blocks"}),className:(0,l.Z)("clean-btn",o,ea.copyButton,i&&ea.copyButtonCopied),onClick:p,children:(0,c.jsxs)("span",{className:ea.copyButtonIcons,"aria-hidden":"true",children:[(0,c.jsx)(ei,{className:ea.copyButtonIcon}),(0,c.jsx)(ec,{className:ea.copyButtonSuccessIcon})]})})}function ed(e){var n,r;return(0,c.jsx)("svg",(n=function(e){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{},t=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(t=t.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),t.forEach(function(n){var t,o,s;t=e,o=n,s=r[n],o in t?Object.defineProperty(t,o,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[o]=s})}return e}({viewBox:"0 0 24 24"},e),r=(r={children:(0,c.jsx)("path",{fill:"currentColor",d:"M4 19h6v-2H4v2zM20 5H4v2h16V5zm-3 6H4v2h13.25c1.1 0 2 .9 2 2s-.9 2-2 2H15v-2l-3 3l3 3v-2h2c2.21 0 4-1.79 4-4s-1.79-4-4-4z"})},r),Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(r)):(function(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);r.push.apply(r,t)}return r})(Object(r)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(r,e))}),n))}let eh={wordWrapButtonIcon:"wordWrapButtonIcon_MQXS",wordWrapButtonEnabled:"wordWrapButtonEnabled_TBIH"};function ep(e){var n=e.className,r=e.onClick,t=e.isEnabled,o=(0,h.I)({id:"theme.CodeBlock.wordWrapToggle",message:"Toggle word wrap",description:"The title attribute for toggle word wrapping button of code block lines"});return(0,c.jsx)("button",{type:"button",onClick:r,className:(0,l.Z)("clean-btn",n,t&&eh.wordWrapButtonEnabled),"aria-label":o,title:o,children:(0,c.jsx)(ed,{className:eh.wordWrapButtonIcon,"aria-hidden":"true"})})}function ef(e){var n,r,t,o,s,i,u,d,h,p,f,b,m,g,v,x,O,w,P,k,S,I,A=e.children,C=e.className,D=void 0===C?"":C,E=e.metastring,B=e.title,N=e.showLineNumbers,T=e.language,L=(0,j.L)().prism,Z=L.defaultLanguage,z=L.magicComments;var W=null==(r=null!==(I=null!=T?T:null==(n=D.split(" ").find(function(e){return e.startsWith("language-")}))?void 0:n.replace(/language-/,""))&&void 0!==I?I:Z)?void 0:r.toLowerCase(),V=y();var H=(o=(t=ee((0,a.useState)(!1),2))[0],s=t[1],u=(i=ee((0,a.useState)(!1),2))[0],d=i[1],h=(0,a.useRef)(null),p=(0,a.useCallback)(function(){var e=h.current.querySelector("code");o?e.removeAttribute("style"):(e.style.whiteSpace="pre-wrap",e.style.overflowWrap="anywhere"),s(function(e){return!e})},[h,o]),f=(0,a.useCallback)(function(){var e=h.current;d(e.scrollWidth>e.clientWidth||h.current.querySelector("code").hasAttribute("style"))},[h]),b=h,m=f,v=(g=ee((0,a.useState)(),2))[0],x=g[1],O=(0,a.useCallback)(function(){var e;x(null===(e=b.current)||void 0===e?void 0:e.closest("[role=tabpanel][hidden]"))},[b,x]),(0,a.useEffect)(function(){O()},[O]),function(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:X,t=(0,Y.zX)(n),o=(0,Y.Ql)(r);(0,a.useEffect)(function(){var n=new MutationObserver(t);return e&&n.observe(e,o),function(){return n.disconnect()}},[e,t,o])}(v,function(e){e.forEach(function(e){"attributes"===e.type&&"hidden"===e.attributeName&&(m(),O())})},{attributes:!0,characterData:!1,childList:!1,subtree:!1}),(0,a.useEffect)(function(){f()},[o,f]),(0,a.useEffect)(function(){return window.addEventListener("resize",f,{passive:!0}),function(){window.removeEventListener("resize",f)}},[f]),{codeBlockRef:h,isEnabled:o,isCodeScrollable:u,toggle:p});var $=(null!==(k=null==(w=E)?void 0:null===(P=w.match(R))||void 0===P?void 0:P.groups.title)&&void 0!==k?k:"")||B,Q=function(e,n){var r=e.replace(/\n$/,""),t=n.language,o=n.magicComments,s=n.metastring;if(s&&F.test(s)){var i=s.match(F).groups.range;if(0===o.length)throw Error("A highlight range has been given in code block's metastring (``` ".concat(s,"), but no magic comment config is available. Docusaurus applies the first magic comment entry's className for metastring ranges."));var c=o[0].className;return{lineClassNames:Object.fromEntries(_()(i).filter(function(e){return e>0}).map(function(e){return[e-1,[c]]})),code:r}}if(void 0===t)return{lineClassNames:{},code:r};for(var a=function(e,n){switch(e){case"js":case"javascript":case"ts":case"typescript":return U(["js","jsBlock"],n);case"jsx":case"tsx":return U(["js","jsBlock","jsx"],n);case"html":return U(["js","jsBlock","html"],n);case"python":case"py":case"bash":return U(["bash"],n);case"markdown":case"md":return U(["html","jsx","bash"],n);case"tex":case"latex":case"matlab":return U(["tex"],n);case"lua":case"haskell":case"sql":return U(["lua"],n);case"wasm":return U(["wasm"],n);case"vb":case"vba":case"visual-basic":return U(["vb","rem"],n);case"vbnet":return U(["vbnet","rem"],n);case"batch":return U(["rem"],n);case"basic":return U(["rem","f90"],n);case"fsharp":return U(["js","ml"],n);case"ocaml":case"sml":return U(["ml"],n);case"fortran":return U(["f90"],n);case"cobol":return U(["cobol"],n);default:return U(q,n)}}(t,o),l=r.split("\n"),u=Object.fromEntries(o.map(function(e){return[e.className,{start:0,range:""}]})),d=Object.fromEntries(o.filter(function(e){return e.line}).map(function(e){var n=e.className;return[e.line,n]})),h=Object.fromEntries(o.filter(function(e){return e.block}).map(function(e){var n=e.className;return[e.block.start,n]})),p=Object.fromEntries(o.filter(function(e){return e.block}).map(function(e){var n=e.className;return[e.block.end,n]})),f=0;f<l.length;){var b=l[f].match(a);if(!b){f+=1;continue}var m=b.slice(1).find(function(e){return void 0!==e});d[m]?u[d[m]].range+="".concat(f,","):h[m]?u[h[m]].start=f:p[m]&&(u[p[m]].range+="".concat(u[p[m]].start,"-").concat(f-1,",")),l.splice(f,1)}r=l.join("\n");var j={};return Object.entries(u).forEach(function(e){var n=M(e,2),r=n[0],t=n[1].range;_()(t).forEach(function(e){var n;null!==(n=j[e])&&void 0!==n||(j[e]=[]),j[e].push(r)})}),{lineClassNames:j,code:r}}(A,{metastring:E,language:W,magicComments:z}),K=Q.lineClassNames,er=Q.code;var et=null!=N?N:!!(null==(S=E)?void 0:S.includes("showLineNumbers"));return(0,c.jsxs)(G,{as:"div",className:(0,l.Z)(D,W&&!D.includes("language-".concat(W))&&"language-".concat(W)),children:[$&&(0,c.jsx)("div",{className:J.codeBlockTitle,children:$}),(0,c.jsxs)("div",{className:J.codeBlockContent,children:[(0,c.jsx)(en.y$,{theme:V,code:er,language:null!=W?W:"text",children:function(e){var n=e.className,r=e.style,t=e.tokens,o=e.getLineProps,s=e.getTokenProps;return(0,c.jsx)("pre",{tabIndex:0,ref:H.codeBlockRef,className:(0,l.Z)(n,J.codeBlock,"thin-scrollbar"),style:r,children:(0,c.jsx)("code",{className:(0,l.Z)(J.codeBlockLines,et&&J.codeBlockLinesWithNumbering),children:t.map(function(e,n){return(0,c.jsx)(eo,{line:e,getLineProps:o,getTokenProps:s,classNames:K[n],showLineNumbers:et},n)})})})}}),(0,c.jsxs)("div",{className:J.buttonGroup,children:[(H.isEnabled||H.isCodeScrollable)&&(0,c.jsx)(ep,{className:J.codeButton,onClick:function(){return H.toggle()},isEnabled:H.isEnabled}),(0,c.jsx)(eu,{className:J.codeButton,code:er})]})]})]})}function eb(e){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{},t=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(t=t.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),t.forEach(function(n){var t,o,s;t=e,o=n,s=r[n],o in t?Object.defineProperty(t,o,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[o]=s})}return e}let em=(s=function(e){var n,r,t,o=e.children,s=function(e,n){if(null==e)return{};var r,t,o=function(e,n){if(null==e)return{};var r,t,o={},s=Object.keys(e);for(t=0;t<s.length;t++)r=s[t],!(n.indexOf(r)>=0)&&(o[r]=e[r]);return o}(e,n);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(t=0;t<s.length;t++){if(r=s[t],!(n.indexOf(r)>=0))Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}}return o}(e,["children"]),i=(0,u.Z)();var l=(n=o,a.Children.toArray(n).some(function(e){return(0,a.isValidElement)(e)})?n:Array.isArray(n)?n.join(""):n),d="string"==typeof l?ef:Q;return(0,c.jsx)(d,(r=function(e){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{},t=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(t=t.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),t.forEach(function(n){var t,o,s;t=e,o=n,s=r[n],o in t?Object.defineProperty(t,o,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[o]=s})}return e}({},s),t=(t={children:l},t),Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):(function(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);r.push.apply(r,t)}return r})(Object(t)).forEach(function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(t,e))}),r),String(i))},function(e){return e.live?(0,c.jsx)(B,eb({scope:L},e)):(0,c.jsx)(s,eb({},e))});function ej(e){return(0,c.jsx)(em,function(e){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{},t=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(t=t.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),t.forEach(function(n){var t,o,s;t=e,o=n,s=r[n],o in t?Object.defineProperty(t,o,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[o]=s})}return e}({},e))}}}]); |