docusaurus/assets/js/03a06760.d2d311f1.js
2024-10-22 10:43:30 +00:00

1 line
No EOL
42 KiB
JavaScript

"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([["37874"],{97199:function(e,t,r){r.r(t),r.d(t,{metadata:()=>n,contentTitle:()=>d,default:()=>g,assets:()=>p,toc:()=>f,frontMatter:()=>u});var n=JSON.parse('{"id":"api/plugins/plugin-google-analytics","title":"\uD83D\uDCE6 plugin-google-analytics","description":"The default Google Analytics plugin. It is a JavaScript library for measuring how users interact with your website in the production build. If you are using Google Analytics 4 you might need to consider using plugin-google-gtag instead.","source":"@site/docs/api/plugins/plugin-google-analytics.mdx","sourceDirName":"api/plugins","slug":"/api/plugins/@docusaurus/plugin-google-analytics","permalink":"/docs/api/plugins/@docusaurus/plugin-google-analytics","draft":false,"unlisted":false,"editUrl":"https://github.com/facebook/docusaurus/edit/main/website/docs/api/plugins/plugin-google-analytics.mdx","tags":[],"version":"current","lastUpdatedBy":"S\xe9bastien Lorber","lastUpdatedAt":1729593657000,"sidebarPosition":6,"frontMatter":{"sidebar_position":6,"slug":"/api/plugins/@docusaurus/plugin-google-analytics"},"sidebar":"api","previous":{"title":"\uD83D\uDCE6 plugin-debug","permalink":"/docs/api/plugins/@docusaurus/plugin-debug"},"next":{"title":"\uD83D\uDCE6 plugin-google-gtag","permalink":"/docs/api/plugins/@docusaurus/plugin-google-gtag"}}'),o=r("24246"),a=r("80980"),i=r("15398"),c=r("58636"),l=r("32240"),s=r("66359");let u={sidebar_position:6,slug:"/api/plugins/@docusaurus/plugin-google-analytics"},d="\uD83D\uDCE6 plugin-google-analytics",p={},f=[{value:"Installation",id:"installation",level:2},{value:"Configuration",id:"configuration",level:2},{value:"Example configuration",id:"ex-config",level:3}];function b(e){let t={a:"a",admonition:"admonition",code:"code",h1:"h1",h2:"h2",h3:"h3",header:"header",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",...(0,a.a)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(t.header,{children:(0,o.jsx)(t.h1,{id:"-plugin-google-analytics",children:"\uD83D\uDCE6 plugin-google-analytics"})}),"\n","\n",(0,o.jsxs)(t.p,{children:["The default ",(0,o.jsx)(t.a,{href:"https://developers.google.com/analytics/devguides/collection/analyticsjs/",children:"Google Analytics"})," plugin. It is a JavaScript library for measuring how users interact with your website ",(0,o.jsx)(t.strong,{children:"in the production build"}),". If you are using Google Analytics 4 you might need to consider using ",(0,o.jsx)(t.a,{href:"/docs/api/plugins/@docusaurus/plugin-google-gtag",children:"plugin-google-gtag"})," instead."]}),"\n",(0,o.jsxs)(t.admonition,{title:"Deprecated",type:"danger",children:[(0,o.jsxs)(t.p,{children:["This plugin is ",(0,o.jsx)(t.strong,{children:"deprecated"})," and became useless on July 1, 2023."]}),(0,o.jsxs)(t.p,{children:["Google is ",(0,o.jsx)(t.a,{href:"https://blog.google/products/marketingplatform/analytics/prepare-for-future-with-google-analytics-4/",children:"moving away from Universal Analytics"}),"."]}),(0,o.jsxs)(t.p,{children:["If you are still using this plugin with a ",(0,o.jsx)(t.code,{children:"UA-*"})," tracking id, you should create a Google Analytics 4 account as soon as possible, and use ",(0,o.jsx)(t.a,{href:"/docs/api/plugins/@docusaurus/plugin-google-gtag",children:(0,o.jsx)(t.code,{children:"@docusaurus/plugin-google-gtag"})})," instead of this plugin. More details ",(0,o.jsx)(t.a,{href:"https://github.com/facebook/docusaurus/issues/7221",children:"here"}),"."]})]}),"\n",(0,o.jsx)(t.admonition,{title:"production only",type:"warning",children:(0,o.jsxs)(t.p,{children:["This plugin is always inactive in development and ",(0,o.jsx)(t.strong,{children:"only active in production"})," to avoid polluting the analytics statistics."]})}),"\n",(0,o.jsx)(t.h2,{id:"installation",children:"Installation"}),"\n",(0,o.jsxs)(i.Z,{groupId:"npm2yarn",children:[(0,o.jsx)(c.Z,{value:"npm",children:(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{className:"language-bash",children:"npm install --save @docusaurus/plugin-google-analytics\n"})})}),(0,o.jsx)(c.Z,{value:"yarn",label:"Yarn",children:(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{className:"language-bash",children:"yarn add @docusaurus/plugin-google-analytics\n"})})}),(0,o.jsx)(c.Z,{value:"pnpm",label:"pnpm",children:(0,o.jsx)(t.pre,{children:(0,o.jsx)(t.code,{className:"language-bash",children:"pnpm add @docusaurus/plugin-google-analytics\n"})})})]}),"\n",(0,o.jsxs)(t.admonition,{type:"tip",children:[(0,o.jsxs)(t.p,{children:["If you use the preset ",(0,o.jsx)(t.code,{children:"@docusaurus/preset-classic"}),", you don't need to install this plugin as a dependency."]}),(0,o.jsxs)(t.p,{children:["You can configure this plugin through the ",(0,o.jsx)(t.a,{href:"/docs/using-plugins#docusauruspreset-classic",children:"preset options"}),"."]})]}),"\n",(0,o.jsx)(t.h2,{id:"configuration",children:"Configuration"}),"\n",(0,o.jsx)(t.p,{children:"Accepted fields:"}),"\n",(0,o.jsx)(l.Z,{children:(0,o.jsxs)(t.table,{children:[(0,o.jsx)(t.thead,{children:(0,o.jsxs)(t.tr,{children:[(0,o.jsx)(t.th,{children:"Name"}),(0,o.jsx)(t.th,{children:"Type"}),(0,o.jsx)(t.th,{children:"Default"}),(0,o.jsx)(t.th,{children:"Description"})]})}),(0,o.jsxs)(t.tbody,{children:[(0,o.jsxs)(t.tr,{children:[(0,o.jsx)(t.td,{children:(0,o.jsx)(t.code,{children:"trackingID"})}),(0,o.jsx)(t.td,{children:(0,o.jsx)(t.code,{children:"string"})}),(0,o.jsx)(t.td,{children:(0,o.jsx)(t.strong,{children:"Required"})}),(0,o.jsx)(t.td,{children:"The tracking ID of your analytics service."})]}),(0,o.jsxs)(t.tr,{children:[(0,o.jsx)(t.td,{children:(0,o.jsx)(t.code,{children:"anonymizeIP"})}),(0,o.jsx)(t.td,{children:(0,o.jsx)(t.code,{children:"boolean"})}),(0,o.jsx)(t.td,{children:(0,o.jsx)(t.code,{children:"false"})}),(0,o.jsx)(t.td,{children:"Whether the IP should be anonymized when sending requests."})]})]})]})}),"\n",(0,o.jsx)(t.h3,{id:"ex-config",children:"Example configuration"}),"\n",(0,o.jsx)(t.p,{children:"You can configure this plugin through preset options or plugin options."}),"\n",(0,o.jsx)(t.admonition,{type:"tip",children:(0,o.jsx)(t.p,{children:"Most Docusaurus users configure this plugin through the preset options."})}),"\n","\n",(0,o.jsx)(s.Z,{pluginName:"@docusaurus/plugin-google-analytics",presetOptionName:"googleAnalytics",code:"{\n trackingID: 'UA-141789564-1',\n anonymizeIP: true,\n}"})]})}function g(e={}){let{wrapper:t}={...(0,a.a)(),...e.components};return t?(0,o.jsx)(t,{...e,children:(0,o.jsx)(b,{...e})}):b(e)}},58636:function(e,t,r){r.d(t,{Z:()=>i});var n=r("24246");r("27378");var o=r("90496");let a="tabItem_pnkT";function i(e){var t=e.children,r=e.hidden,i=e.className;return(0,n.jsx)("div",{role:"tabpanel",className:(0,o.Z)(a,i),hidden:r,children:t})}},15398:function(e,t,r){r.d(t,{Z:()=>P});var n=r("24246"),o=r("27378"),a=r("90496"),i=r("54947"),c=r("3620"),l=r("844"),s=r("97486"),u=r("32263"),d=r("16971");function p(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function f(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r,n,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var a=[],i=!0,c=!1;try{for(o=o.call(e);!(i=(r=o.next()).done)&&(a.push(r.value),!t||a.length!==t);i=!0);}catch(e){c=!0,n=e}finally{try{!i&&null!=o.return&&o.return()}finally{if(c)throw n}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return p(e,t);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 p(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function b(e){var t,r;return null!==(r=null===(t=o.Children.toArray(e).filter(function(e){return"\n"!==e}).map(function(e){var t,r;if(!e||(0,o.isValidElement)(e)&&(t=e.props)&&(void 0===t?"undefined":(r=t)&&"undefined"!=typeof Symbol&&r.constructor===Symbol?"symbol":typeof r)=="object"&&"value"in t)return e;throw Error("Docusaurus error: Bad <Tabs> child <".concat("string"==typeof e.type?e.type:e.type.name,'>: all children of the <Tabs> component should be <TabItem>, and every <TabItem> should have a unique "value" prop.'))}))||void 0===t?void 0:t.filter(Boolean))&&void 0!==r?r:[]}function g(e){var t=e.value;return e.tabValues.some(function(e){return e.value===t})}var y=r("71607");let h="tabList_Qoir",m="tabItem_AQgk";function j(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n,o,a;n=e,o=t,a=r[t],o in n?Object.defineProperty(n,o,{value:a,enumerable:!0,configurable:!0,writable:!0}):n[o]=a})}return e}function v(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e}function O(e){var t=e.className,r=e.block,o=e.selectedValue,c=e.selectValue,l=e.tabValues,s=[],u=(0,i.o5)().blockElementScrollPositionUntilNextRender,d=function(e){var t=e.currentTarget,r=l[s.indexOf(t)].value;r!==o&&(u(t),c(r))},p=function(e){var t=null;switch(e.key){case"Enter":d(e);break;case"ArrowRight":var r,n=s.indexOf(e.currentTarget)+1;t=null!==(r=s[n])&&void 0!==r?r:s[0];break;case"ArrowLeft":var o,a=s.indexOf(e.currentTarget)-1;t=null!==(o=s[a])&&void 0!==o?o:s[s.length-1]}null==t||t.focus()};return(0,n.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,a.Z)("tabs",{"tabs--block":r},t),children:l.map(function(e){var t=e.value,r=e.label,i=e.attributes;return(0,n.jsx)("li",v(j({role:"tab",tabIndex:o===t?0:-1,"aria-selected":o===t,ref:function(e){return s.push(e)},onKeyDown:p,onClick:d},i),{className:(0,a.Z)("tabs__item",m,null==i?void 0:i.className,{"tabs__item--active":o===t}),children:null!=r?r:t}),t)})})}function w(e){var t=e.lazy,r=e.children,i=e.selectedValue,c=(Array.isArray(r)?r:[r]).filter(Boolean);if(t){var l=c.find(function(e){return e.props.value===i});return l?(0,o.cloneElement)(l,{className:(0,a.Z)("margin-top--md",l.props.className)}):null}return(0,n.jsx)("div",{className:"margin-top--md",children:c.map(function(e,t){return(0,o.cloneElement)(e,{key:t,hidden:e.props.value!==i})})})}function x(e){var t=function(e){var t,r,n,a,i,p,y,h,m,j,v,O,w,x,P=e.defaultValue,k=e.queryString,S=e.groupId;var E=(r=(t=e).values,n=t.children,(0,o.useMemo)(function(){var e=null!=r?r:b(n).map(function(e){var t=e.props;return{value:t.value,label:t.label,attributes:t.attributes,default:t.default}});return!function(e){var t=(0,u.lx)(e,function(e,t){return e.value===t.value});if(t.length>0)throw Error('Docusaurus error: Duplicate values "'.concat(t.map(function(e){return e.value}).join(", "),'" found in <Tabs>. Every value needs to be unique.'))}(e),e},[r,n])),I=f((0,o.useState)(function(){return function(e){var t,r=e.defaultValue,n=e.tabValues;if(0===n.length)throw Error("Docusaurus error: the <Tabs> component requires at least one <TabItem> children component");if(r){if(!g({value:r,tabValues:n}))throw Error('Docusaurus error: The <Tabs> has a defaultValue "'.concat(r,'" but none of its children has the corresponding value. Available values are: ').concat(n.map(function(e){return e.value}).join(", "),". If you intend to show no default tab, use defaultValue={null} instead."));return r}var o=null!==(t=n.find(function(e){return e.default}))&&void 0!==t?t:n[0];if(!o)throw Error("Unexpected error: 0 tabValues");return o.value}({defaultValue:P,tabValues:E})}),2),N=I[0],A=I[1];var C=f((i=(a={queryString:void 0!==k&&k,groupId:S}).queryString,p=a.groupId,y=(0,c.k6)(),h=function(e){var t=e.queryString,r=void 0!==t&&t,n=e.groupId;if("string"==typeof r)return r;if(!1===r)return null;if(!0===r&&!n)throw Error('Docusaurus error: The <Tabs> component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return null!=n?n:null}({queryString:void 0!==i&&i,groupId:p}),[(0,s._X)(h),(0,o.useCallback)(function(e){if(!!h){var t,r,n=new URLSearchParams(y.location.search);n.set(h,e),y.replace((t=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n,o,a;n=e,o=t,a=r[t],o in n?Object.defineProperty(n,o,{value:a,enumerable:!0,configurable:!0,writable:!0}):n[o]=a})}return e}({},y.location),r=(r={search:n.toString()},r),Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}),t))}},[h,y])]),2),D=C[0],B=C[1];var T=f((j=(m=({groupId:S}).groupId)?"docusaurus.tab.".concat(m):null,O=(v=f((0,d.Nk)(j),2))[0],w=v[1],[O,(0,o.useCallback)(function(e){if(!!j)w.set(e)},[j,w])]),2),Z=T[0],L=T[1];var _=g({value:x=null!=D?D:Z,tabValues:E})?x:null;return(0,l.Z)(function(){_&&A(_)},[_]),{selectedValue:N,selectValue:(0,o.useCallback)(function(e){if(!g({value:e,tabValues:E}))throw Error("Can't select invalid tab value=".concat(e));A(e),B(e),L(e)},[B,L,E]),tabValues:E}}(e);return(0,n.jsxs)("div",{className:(0,a.Z)("tabs-container",h),children:[(0,n.jsx)(O,j({},t,e)),(0,n.jsx)(w,j({},t,e))]})}function P(e){var t=(0,y.Z)();return(0,n.jsx)(x,v(j({},e),{children:b(e.children)}),String(t))}},56497:function(e,t,r){r.d(t,{Z:function(){return a}});var n=r(24246);r(27378);var o=r(71607);function a(e){var t=e.children,r=e.fallback;return(0,o.Z)()?(0,n.jsx)(n.Fragment,{children:null==t?void 0:t()}):null!=r?r:null}},32240:function(e,t,r){r.d(t,{Z:()=>d});var n=r("24246"),o=r("27378"),a=r("96700"),i=r("3620");let c="apiTable_e8hp";function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function s(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r,n,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var a=[],i=!0,c=!1;try{for(o=o.call(e);!(i=(r=o.next()).done)&&(a.push(r.value),!t||a.length!==t);i=!0);}catch(e){c=!0,n=e}finally{try{!i&&null!=o.return&&o.return()}finally{if(c)throw n}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return l(e,t);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 l(e,t)}}(e,t)||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 u=o.forwardRef(function(e,t){var r=e.name,c=e.children,l=function(e){for(var t=e;(0,o.isValidElement)(t);)t=s(o.Children.toArray(t.props.children),1)[0];if("string"!=typeof t)throw Error("Could not extract APITable row name from JSX tree:\n".concat(JSON.stringify(e,null,2)));return t}(c),u=r?"".concat(r,"-").concat(l):l,d="#".concat(u),p=(0,i.k6)();return(0,a.Z)().collectAnchor(u),(0,n.jsx)("tr",{id:u,tabIndex:0,ref:p.location.hash===d?t:void 0,onClick:function(e){var t,r="TD"===e.target.tagName.toUpperCase(),n=!!(null===(t=window.getSelection())||void 0===t?void 0:t.toString());r&&!n&&p.push(d)},onKeyDown:function(e){"Enter"===e.key&&p.push(d)},children:c.props.children})});function d(e){var t=e.children,r=e.name;if("table"!==t.type)throw Error("Bad usage of APITable component.\nIt is probably that your Markdown table is malformed.\nMake sure to double-check you have the appropriate number of columns for each table row.");var a=s(o.Children.toArray(t.props.children),2),i=a[0],l=a[1],d=(0,o.useRef)(null);(0,o.useEffect)(function(){var e;null===(e=d.current)||void 0===e||e.focus()},[d]);var p=o.Children.map(l.props.children,function(e){return(0,n.jsx)(u,{name:r,ref:d,children:e})});return(0,n.jsxs)("table",{className:c,children:[i,(0,n.jsx)("tbody",{children:p})]})}},66359:function(e,t,r){r.d(t,{Z:function(){return d}});var n=r(24246);r(27378);var o=r(35363),a=r(90158),i=r(77827),c=r(15398),l=r(58636),s=r(95998),u=void 0;function d(e){var t=e.code,r=e.pluginName,d=e.presetOptionName,p=(0,a.useActiveVersion)(u).path;return(0,n.jsxs)(c.Z,{groupId:"api-config-ex",children:[(0,n.jsxs)(l.Z,{value:"preset",label:(0,i.I)({message:"Preset options"}),children:[(0,n.jsx)("p",{children:(0,n.jsx)(i.Z,{id:"apiDocs.configTabs.presetOptions.description",values:{presetLink:(0,n.jsx)(o.Z,{to:"".concat(p,"/using-plugins#docusauruspreset-classic"),children:(0,n.jsx)(i.Z,{children:"preset options"})})},children:"If you use a preset, configure this plugin through the {presetLink}:"})}),(0,n.jsx)(s.Z,{language:"js",title:"docusaurus.config.js",children:"module.exports = {\n presets: [\n [\n '@docusaurus/preset-classic',\n {\n // highlight-start\n ".concat(d,": ").concat(t.replace(/\n/g,"\n "),",\n // highlight-end\n },\n ],\n ],\n};")})]}),(0,n.jsxs)(l.Z,{value:"plugin",label:(0,i.I)({message:"Plugin options"}),children:[(0,n.jsx)("p",{children:(0,n.jsx)(i.Z,{children:"If you are using a standalone plugin, provide options directly to the plugin:"})}),(0,n.jsx)(s.Z,{language:"js",title:"docusaurus.config.js",children:"module.exports = {\n plugins: [\n [\n '".concat(r,"',\n // highlight-start\n ").concat(t.replace(/\n/g,"\n "),",\n // highlight-end\n ],\n ],\n};")})]})]})}},95998:function(e,t,r){r.d(t,{Z:()=>eh});var n,o,a,i={};r.r(i),r.d(i,{ButtonExample:()=>T});var c=r("24246"),l=r("27378"),s=r("90496"),u=r("71607"),d=r("10075"),p=r("77827"),f=r("8156"),b=r("56497"),g=r("85108"),y=r("45245"),h=r("26378");function m(){var e=(0,h.L)().prism,t=(0,y.I)().colorMode,r=e.theme,n=e.darkTheme||r;return"dark"===t?n:r}var j=r("67490");let v="playgroundContainer_6Ior",O="playgroundHeader_Tvsk",w="playgroundEditor_TySg",x="playgroundPreview_mApW";function P(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n,o,a;n=e,o=t,a=r[t],o in n?Object.defineProperty(n,o,{value:a,enumerable:!0,configurable:!0,writable:!0}):n[o]=a})}return e}function k(e){var t=e.children;return(0,c.jsx)("div",{className:(0,s.Z)(O),children:t})}function S(){return(0,c.jsx)("div",{children:"Loading..."})}function E(){return(0,c.jsx)(b.Z,{fallback:(0,c.jsx)(S,{}),children:function(){return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(j.Z,{fallback:function(e){return(0,c.jsx)(g.Ac,P({},e))},children:(0,c.jsx)(d.i5,{})}),(0,c.jsx)(d.IF,{})]})}})}function I(){return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(k,{children:(0,c.jsx)(p.Z,{id:"theme.Playground.result",description:"The result label of the live codeblocks",children:"Result"})}),(0,c.jsx)("div",{className:x,children:(0,c.jsx)(E,{})})]})}function N(){var e=(0,u.Z)();return(0,c.jsx)(d.uz,{className:w},String(e))}function A(){return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(k,{children:(0,c.jsx)(p.Z,{id:"theme.Playground.liveEditor",description:"The live editor label of the live codeblocks",children:"Live Editor"})}),(0,c.jsx)(N,{})]})}var C=function(e){return"".concat(e,";")};function D(e){var t,r,n,o,a=e.children,i=e.transformCode,l=function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],!(t.indexOf(r)>=0)&&(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++){if(r=a[n],!(t.indexOf(r)>=0))Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}}return o}(e,["children","transformCode"]),s=(0,f.Z)().siteConfig.themeConfig.liveCodeBlock.playgroundPosition,u=m(),p=null!==(o=null===(n=l.metastring)||void 0===n?void 0:n.includes("noInline"))&&void 0!==o&&o;return(0,c.jsx)("div",{className:v,children:(0,c.jsx)(d.nu,(t=P({code:null==a?void 0:a.replace(/\n$/,""),noInline:p,transformCode:null!=i?i:C,theme:u},l),r=(r={children:"top"===s?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(I,{}),(0,c.jsx)(A,{})]}):(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(A,{}),(0,c.jsx)(I,{})]})},r),Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}),t))})}function B(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n,o,a;n=e,o=t,a=r[t],o in n?Object.defineProperty(n,o,{value:a,enumerable:!0,configurable:!0,writable:!0}):n[o]=a})}return e}function T(e){var t,r;return(0,c.jsx)("button",(t=B({type:"button"},e),r=(r={style:B({backgroundColor:"white",color:"black",border:"solid red",borderRadius:20,padding:10,cursor:"pointer"},e.style)},r),Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}),t))}let Z=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n,o,a;n=e,o=t,a=r[t],o in n?Object.defineProperty(n,o,{value:a,enumerable:!0,configurable:!0,writable:!0}):n[o]=a})}return e}({React:l},l,i);var L=r("55951"),_=r("6324"),V=r.n(_);function M(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function q(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r,n,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var a=[],i=!0,c=!1;try{for(o=o.call(e);!(i=(r=o.next()).done)&&(a.push(r.value),!t||a.length!==t);i=!0);}catch(e){c=!0,n=e}finally{try{!i&&null!=o.return&&o.return()}finally{if(c)throw n}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return M(e,t);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 M(e,t)}}(e,t)||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"),U=RegExp("\\{(?<range>[\\d,-]+)\\}"),W={js:{start:"\\/\\/",end:""},jsBlock:{start:"\\/\\*",end:"\\*\\/"},jsx:{start:"\\{\\s*\\/\\*",end:"\\*\\/\\s*\\}"},bash:{start:"#",end:""},html:{start:"\x3c!--",end:"--\x3e"}};var H=(n=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n,o,a;n=e,o=t,a=r[t],o in n?Object.defineProperty(n,o,{value:a,enumerable:!0,configurable:!0,writable:!0}):n[o]=a})}return e}({},W),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(n,Object.getOwnPropertyDescriptors(o)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(o)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}),n),z=Object.keys(W);function F(e,t){var r=e.map(function(e){var r=H[e],n=r.start,o=r.end;return"(?:".concat(n,"\\s*(").concat(t.flatMap(function(e){var t,r;return[e.line,null===(t=e.block)||void 0===t?void 0:t.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 G="codeBlockContainer_jDV4";function $(e){var t,r,n,o,a=e.as,i=function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],!(t.indexOf(r)>=0)&&(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++){if(r=a[n],!(t.indexOf(r)>=0))Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}}return o}(e,["as"]);var l=(t={color:"--prism-color",backgroundColor:"--prism-background-color"},r={},Object.entries(m().plain).forEach(function(e){var n=q(e,2),o=n[0],a=n[1],i=t[o];i&&"string"==typeof a&&(r[i]=a)}),r);return(0,c.jsx)(a,(n=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n,o,a;n=e,o=t,a=r[t],o in n?Object.defineProperty(n,o,{value:a,enumerable:!0,configurable:!0,writable:!0}):n[o]=a})}return e}({},i),o=(o={style:l,className:(0,s.Z)(i.className,G,L.k.common.codeBlock)},o),Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(o)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}),n))}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 t=e.children,r=e.className;return(0,c.jsx)($,{as:"pre",tabIndex:0,className:(0,s.Z)(J.codeBlockStandalone,"thin-scrollbar",r),children:(0,c.jsx)("code",{className:J.codeBlockLines,children:t})})}var X=r("50923"),Y={attributes:!0,characterData:!0,childList:!0,subtree:!0};function K(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function ee(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r,n,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var a=[],i=!0,c=!1;try{for(o=o.call(e);!(i=(r=o.next()).done)&&(a.push(r.value),!t||a.length!==t);i=!0);}catch(e){c=!0,n=e}finally{try{!i&&null!=o.return&&o.return()}finally{if(c)throw n}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return K(e,t);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,t)}}(e,t)||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 et=r("7316");let er={codeLine:"codeLine_qRmp",codeLineNumber:"codeLineNumber_dS_J",codeLineContent:"codeLineContent_XF5l"};function en(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n,o,a;n=e,o=t,a=r[t],o in n?Object.defineProperty(n,o,{value:a,enumerable:!0,configurable:!0,writable:!0}):n[o]=a})}return e}function eo(e){var t,r,n=e.line,o=e.classNames,a=e.showLineNumbers,i=e.getLineProps,l=e.getTokenProps;1===n.length&&"\n"===n[0].content&&(n[0].content="");var u=i({line:n,className:(0,s.Z)(o,a&&er.codeLine)}),d=n.map(function(e,t){return(0,c.jsx)("span",en({},l({token:e})),t)});return(0,c.jsxs)("span",(t=en({},u),r=(r={children:[a?(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(t,Object.getOwnPropertyDescriptors(r)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}),t))}var ea=r("44771");function ei(e){var t,r;return(0,c.jsx)("svg",(t=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n,o,a;n=e,o=t,a=r[t],o in n?Object.defineProperty(n,o,{value:a,enumerable:!0,configurable:!0,writable:!0}):n[o]=a})}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(t,Object.getOwnPropertyDescriptors(r)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}),t))}function ec(e){var t,r;return(0,c.jsx)("svg",(t=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n,o,a;n=e,o=t,a=r[t],o in n?Object.defineProperty(n,o,{value:a,enumerable:!0,configurable:!0,writable:!0}):n[o]=a})}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(t,Object.getOwnPropertyDescriptors(r)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}),t))}let el={copyButtonCopied:"copyButtonCopied_OkN_",copyButtonIcons:"copyButtonIcons_OqsO",copyButtonIcon:"copyButtonIcon_PgCn",copyButtonSuccessIcon:"copyButtonSuccessIcon_bsQG"};function es(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function eu(e){var t,r,n=e.code,o=e.className;var a=(t=(0,l.useState)(!1),r=2,function(e){if(Array.isArray(e))return e}(t)||function(e,t){var r,n,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var a=[],i=!0,c=!1;try{for(o=o.call(e);!(i=(r=o.next()).done)&&(a.push(r.value),!t||a.length!==t);i=!0);}catch(e){c=!0,n=e}finally{try{!i&&null!=o.return&&o.return()}finally{if(c)throw n}}return a}}(t,2)||function(e,t){if(e){if("string"==typeof e)return es(e,t);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 es(e,t)}}(t,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=a[0],u=a[1],d=(0,l.useRef)(void 0),f=(0,l.useCallback)(function(){(0,ea.Z)(n),u(!0),d.current=window.setTimeout(function(){u(!1)},1e3)},[n]);return(0,l.useEffect)(function(){return function(){return window.clearTimeout(d.current)}},[]),(0,c.jsx)("button",{type:"button","aria-label":i?(0,p.I)({id:"theme.CodeBlock.copied",message:"Copied",description:"The copied button label on code blocks"}):(0,p.I)({id:"theme.CodeBlock.copyButtonAriaLabel",message:"Copy code to clipboard",description:"The ARIA label for copy code blocks button"}),title:(0,p.I)({id:"theme.CodeBlock.copy",message:"Copy",description:"The copy button label on code blocks"}),className:(0,s.Z)("clean-btn",o,el.copyButton,i&&el.copyButtonCopied),onClick:f,children:(0,c.jsxs)("span",{className:el.copyButtonIcons,"aria-hidden":"true",children:[(0,c.jsx)(ei,{className:el.copyButtonIcon}),(0,c.jsx)(ec,{className:el.copyButtonSuccessIcon})]})})}function ed(e){var t,r;return(0,c.jsx)("svg",(t=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n,o,a;n=e,o=t,a=r[t],o in n?Object.defineProperty(n,o,{value:a,enumerable:!0,configurable:!0,writable:!0}):n[o]=a})}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(t,Object.getOwnPropertyDescriptors(r)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}),t))}let ep={wordWrapButtonIcon:"wordWrapButtonIcon_MQXS",wordWrapButtonEnabled:"wordWrapButtonEnabled_TBIH"};function ef(e){var t=e.className,r=e.onClick,n=e.isEnabled,o=(0,p.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,s.Z)("clean-btn",t,n&&ep.wordWrapButtonEnabled),"aria-label":o,title:o,children:(0,c.jsx)(ed,{className:ep.wordWrapButtonIcon,"aria-hidden":"true"})})}function eb(e){var t,r,n,o,a,i,u,d,p,f,b,g,y,j,v,O,w,x,P,k,S,E,I=e.children,N=e.className,A=void 0===N?"":N,C=e.metastring,D=e.title,B=e.showLineNumbers,T=e.language,Z=(0,h.L)().prism,L=Z.defaultLanguage,_=Z.magicComments;var M=null==(r=null!==(E=null!=T?T:null==(t=A.split(" ").find(function(e){return e.startsWith("language-")}))?void 0:t.replace(/language-/,""))&&void 0!==E?E:L)?void 0:r.toLowerCase(),W=m();var H=(o=(n=ee((0,l.useState)(!1),2))[0],a=n[1],u=(i=ee((0,l.useState)(!1),2))[0],d=i[1],p=(0,l.useRef)(null),f=(0,l.useCallback)(function(){var e=p.current.querySelector("code");o?e.removeAttribute("style"):(e.style.whiteSpace="pre-wrap",e.style.overflowWrap="anywhere"),a(function(e){return!e})},[p,o]),b=(0,l.useCallback)(function(){var e=p.current;d(e.scrollWidth>e.clientWidth||p.current.querySelector("code").hasAttribute("style"))},[p]),g=p,y=b,v=(j=ee((0,l.useState)(),2))[0],O=j[1],w=(0,l.useCallback)(function(){var e;O(null===(e=g.current)||void 0===e?void 0:e.closest("[role=tabpanel][hidden]"))},[g,O]),(0,l.useEffect)(function(){w()},[w]),function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Y,n=(0,X.zX)(t),o=(0,X.Ql)(r);(0,l.useEffect)(function(){var t=new MutationObserver(n);return e&&t.observe(e,o),function(){return t.disconnect()}},[e,n,o])}(v,function(e){e.forEach(function(e){"attributes"===e.type&&"hidden"===e.attributeName&&(y(),w())})},{attributes:!0,characterData:!1,childList:!1,subtree:!1}),(0,l.useEffect)(function(){b()},[o,b]),(0,l.useEffect)(function(){return window.addEventListener("resize",b,{passive:!0}),function(){window.removeEventListener("resize",b)}},[b]),{codeBlockRef:p,isEnabled:o,isCodeScrollable:u,toggle:f});var G=(null!==(k=null==(x=C)?void 0:null===(P=x.match(R))||void 0===P?void 0:P.groups.title)&&void 0!==k?k:"")||D,Q=function(e,t){var r=e.replace(/\n$/,""),n=t.language,o=t.magicComments,a=t.metastring;if(a&&U.test(a)){var i=a.match(U).groups.range;if(0===o.length)throw Error("A highlight range has been given in code block's metastring (``` ".concat(a,"), 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(V()(i).filter(function(e){return e>0}).map(function(e){return[e-1,[c]]})),code:r}}if(void 0===n)return{lineClassNames:{},code:r};for(var l=function(e,t){switch(e){case"js":case"javascript":case"ts":case"typescript":return F(["js","jsBlock"],t);case"jsx":case"tsx":return F(["js","jsBlock","jsx"],t);case"html":return F(["js","jsBlock","html"],t);case"python":case"py":case"bash":return F(["bash"],t);case"markdown":case"md":return F(["html","jsx","bash"],t);case"tex":case"latex":case"matlab":return F(["tex"],t);case"lua":case"haskell":case"sql":return F(["lua"],t);case"wasm":return F(["wasm"],t);case"vb":case"vba":case"visual-basic":return F(["vb","rem"],t);case"vbnet":return F(["vbnet","rem"],t);case"batch":return F(["rem"],t);case"basic":return F(["rem","f90"],t);case"fsharp":return F(["js","ml"],t);case"ocaml":case"sml":return F(["ml"],t);case"fortran":return F(["f90"],t);case"cobol":return F(["cobol"],t);default:return F(z,t)}}(n,o),s=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 t=e.className;return[e.line,t]})),p=Object.fromEntries(o.filter(function(e){return e.block}).map(function(e){var t=e.className;return[e.block.start,t]})),f=Object.fromEntries(o.filter(function(e){return e.block}).map(function(e){var t=e.className;return[e.block.end,t]})),b=0;b<s.length;){var g=s[b].match(l);if(!g){b+=1;continue}var y=g.slice(1).find(function(e){return void 0!==e});d[y]?u[d[y]].range+="".concat(b,","):p[y]?u[p[y]].start=b:f[y]&&(u[f[y]].range+="".concat(u[f[y]].start,"-").concat(b-1,",")),s.splice(b,1)}r=s.join("\n");var h={};return Object.entries(u).forEach(function(e){var t=q(e,2),r=t[0],n=t[1].range;V()(n).forEach(function(e){var t;null!==(t=h[e])&&void 0!==t||(h[e]=[]),h[e].push(r)})}),{lineClassNames:h,code:r}}(I,{metastring:C,language:M,magicComments:_}),K=Q.lineClassNames,er=Q.code;var en=null!=B?B:!!(null==(S=C)?void 0:S.includes("showLineNumbers"));return(0,c.jsxs)($,{as:"div",className:(0,s.Z)(A,M&&!A.includes("language-".concat(M))&&"language-".concat(M)),children:[G&&(0,c.jsx)("div",{className:J.codeBlockTitle,children:G}),(0,c.jsxs)("div",{className:J.codeBlockContent,children:[(0,c.jsx)(et.y$,{theme:W,code:er,language:null!=M?M:"text",children:function(e){var t=e.className,r=e.style,n=e.tokens,o=e.getLineProps,a=e.getTokenProps;return(0,c.jsx)("pre",{tabIndex:0,ref:H.codeBlockRef,className:(0,s.Z)(t,J.codeBlock,"thin-scrollbar"),style:r,children:(0,c.jsx)("code",{className:(0,s.Z)(J.codeBlockLines,en&&J.codeBlockLinesWithNumbering),children:n.map(function(e,t){return(0,c.jsx)(eo,{line:e,getLineProps:o,getTokenProps:a,classNames:K[t],showLineNumbers:en},t)})})})}}),(0,c.jsxs)("div",{className:J.buttonGroup,children:[(H.isEnabled||H.isCodeScrollable)&&(0,c.jsx)(ef,{className:J.codeButton,onClick:function(){return H.toggle()},isEnabled:H.isEnabled}),(0,c.jsx)(eu,{className:J.codeButton,code:er})]})]})]})}function eg(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n,o,a;n=e,o=t,a=r[t],o in n?Object.defineProperty(n,o,{value:a,enumerable:!0,configurable:!0,writable:!0}):n[o]=a})}return e}let ey=(a=function(e){var t,r,n,o=e.children,a=function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],!(t.indexOf(r)>=0)&&(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++){if(r=a[n],!(t.indexOf(r)>=0))Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}}return o}(e,["children"]),i=(0,u.Z)();var s=(t=o,l.Children.toArray(t).some(function(e){return(0,l.isValidElement)(e)})?t:Array.isArray(t)?t.join(""):t),d="string"==typeof s?eb:Q;return(0,c.jsx)(d,(r=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n,o,a;n=e,o=t,a=r[t],o in n?Object.defineProperty(n,o,{value:a,enumerable:!0,configurable:!0,writable:!0}):n[o]=a})}return e}({},a),n=(n={children:s},n),Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(n)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(n)).forEach(function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(n,e))}),r),String(i))},function(e){return e.live?(0,c.jsx)(D,eg({scope:Z},e)):(0,c.jsx)(a,eg({},e))});function eh(e){return(0,c.jsx)(ey,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n,o,a;n=e,o=t,a=r[t],o in n?Object.defineProperty(n,o,{value:a,enumerable:!0,configurable:!0,writable:!0}):n[o]=a})}return e}({},e))}}}]);