mirror of
https://github.com/facebook/docusaurus.git
synced 2025-04-29 18:27:56 +02:00
1 line
No EOL
42 KiB
JavaScript
1 line
No EOL
42 KiB
JavaScript
"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([["85936"],{11313: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-gtag","title":"\uD83D\uDCE6 plugin-google-gtag","description":"The default Global Site Tag (gtag.js) plugin. It is a JavaScript tagging framework and API that allows you to send event data to Google Analytics, Google Ads, and Google Marketing Platform. This section describes how to configure a Docusaurus site to enable global site tag for Google Analytics.","source":"@site/docs/api/plugins/plugin-google-gtag.mdx","sourceDirName":"api/plugins","slug":"/api/plugins/@docusaurus/plugin-google-gtag","permalink":"/docs/api/plugins/@docusaurus/plugin-google-gtag","draft":false,"unlisted":false,"editUrl":"https://github.com/facebook/docusaurus/edit/main/website/docs/api/plugins/plugin-google-gtag.mdx","tags":[],"version":"current","lastUpdatedBy":"moonrailgun","lastUpdatedAt":1729270082000,"sidebarPosition":7,"frontMatter":{"sidebar_position":7,"slug":"/api/plugins/@docusaurus/plugin-google-gtag"},"sidebar":"api","previous":{"title":"\uD83D\uDCE6 plugin-google-analytics","permalink":"/docs/api/plugins/@docusaurus/plugin-google-analytics"},"next":{"title":"\uD83D\uDCE6 plugin-rsdoctor","permalink":"/docs/api/plugins/@docusaurus/plugin-rsdoctor"}}'),o=r("24246"),a=r("80980"),c=r("15398"),i=r("58636"),l=r("32240"),s=r("66359");let u={sidebar_position:7,slug:"/api/plugins/@docusaurus/plugin-google-gtag"},d="\uD83D\uDCE6 plugin-google-gtag",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-gtag",children:"\uD83D\uDCE6 plugin-google-gtag"})}),"\n","\n",(0,o.jsxs)(t.p,{children:["The default ",(0,o.jsx)(t.a,{href:"https://developers.google.com/tag-platform/gtagjs",children:"Global Site Tag (gtag.js)"})," plugin. It is a JavaScript tagging framework and API that allows you to send event data to Google Analytics, Google Ads, and Google Marketing Platform. This section describes how to configure a Docusaurus site to enable global site tag for Google Analytics."]}),"\n",(0,o.jsx)(t.admonition,{type:"tip",children:(0,o.jsxs)(t.p,{children:["You can use ",(0,o.jsx)(t.a,{href:"https://tagassistant.google.com/",children:"Google's Tag Assistant"})," tool to check if your gtag is set up correctly!"]})}),"\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)(c.Z,{groupId:"npm2yarn",children:[(0,o.jsx)(i.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-gtag\n"})})}),(0,o.jsx)(i.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-gtag\n"})})}),(0,o.jsx)(i.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-gtag\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)("code",{children:"string | 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 gtag service. It is possible to provide multiple ids."})]}),(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-gtag",presetOptionName:"gtag",code:"{\n trackingID: 'G-999X9XX9XX',\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:()=>c});var n=r("24246");r("27378");var o=r("90496");let a="tabItem_pnkT";function c(e){var t=e.children,r=e.hidden,c=e.className;return(0,n.jsx)("div",{role:"tabpanel",className:(0,o.Z)(a,c),hidden:r,children:t})}},15398:function(e,t,r){r.d(t,{Z:()=>P});var n=r("24246"),o=r("27378"),a=r("90496"),c=r("54947"),i=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=[],c=!0,i=!1;try{for(o=o.call(e);!(c=(r=o.next()).done)&&(a.push(r.value),!t||a.length!==t);c=!0);}catch(e){i=!0,n=e}finally{try{!c&&null!=o.return&&o.return()}finally{if(i)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 h=r("71607");let y="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,i=e.selectValue,l=e.tabValues,s=[],u=(0,c.o5)().blockElementScrollPositionUntilNextRender,d=function(e){var t=e.currentTarget,r=l[s.indexOf(t)].value;r!==o&&(u(t),i(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,c=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},c),{className:(0,a.Z)("tabs__item",m,null==c?void 0:c.className,{"tabs__item--active":o===t}),children:null!=r?r:t}),t)})})}function w(e){var t=e.lazy,r=e.children,c=e.selectedValue,i=(Array.isArray(r)?r:[r]).filter(Boolean);if(t){var l=i.find(function(e){return e.props.value===c});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:i.map(function(e,t){return(0,o.cloneElement)(e,{key:t,hidden:e.props.value!==c})})})}function x(e){var t=function(e){var t,r,n,a,c,p,h,y,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((c=(a={queryString:void 0!==k&&k,groupId:S}).queryString,p=a.groupId,h=(0,i.k6)(),y=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!==c&&c,groupId:p}),[(0,s._X)(y),(0,o.useCallback)(function(e){if(!!y){var t,r,n=new URLSearchParams(h.location.search);n.set(y,e),h.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}({},h.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))}},[y,h])]),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",y),children:[(0,n.jsx)(O,j({},t,e)),(0,n.jsx)(w,j({},t,e))]})}function P(e){var t=(0,h.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"),c=r("3620");let i="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=[],c=!0,i=!1;try{for(o=o.call(e);!(c=(r=o.next()).done)&&(a.push(r.value),!t||a.length!==t);c=!0);}catch(e){i=!0,n=e}finally{try{!c&&null!=o.return&&o.return()}finally{if(i)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,i=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}(i),u=r?"".concat(r,"-").concat(l):l,d="#".concat(u),p=(0,c.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:i.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),c=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:i,children:[c,(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),c=r(77827),i=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)(i.Z,{groupId:"api-config-ex",children:[(0,n.jsxs)(l.Z,{value:"preset",label:(0,c.I)({message:"Preset options"}),children:[(0,n.jsx)("p",{children:(0,n.jsx)(c.Z,{id:"apiDocs.configTabs.presetOptions.description",values:{presetLink:(0,n.jsx)(o.Z,{to:"".concat(p,"/using-plugins#docusauruspreset-classic"),children:(0,n.jsx)(c.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,c.I)({message:"Plugin options"}),children:[(0,n.jsx)("p",{children:(0,n.jsx)(c.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:()=>ey});var n,o,a,c={};r.r(c),r.d(c,{ButtonExample:()=>T});var i=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"),h=r("45245"),y=r("26378");function m(){var e=(0,y.L)().prism,t=(0,h.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,i.jsx)("div",{className:(0,s.Z)(O),children:t})}function S(){return(0,i.jsx)("div",{children:"Loading..."})}function E(){return(0,i.jsx)(b.Z,{fallback:(0,i.jsx)(S,{}),children:function(){return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(j.Z,{fallback:function(e){return(0,i.jsx)(g.Ac,P({},e))},children:(0,i.jsx)(d.i5,{})}),(0,i.jsx)(d.IF,{})]})}})}function I(){return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(k,{children:(0,i.jsx)(p.Z,{id:"theme.Playground.result",description:"The result label of the live codeblocks",children:"Result"})}),(0,i.jsx)("div",{className:x,children:(0,i.jsx)(E,{})})]})}function N(){var e=(0,u.Z)();return(0,i.jsx)(d.uz,{className:w},String(e))}function A(){return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(k,{children:(0,i.jsx)(p.Z,{id:"theme.Playground.liveEditor",description:"The live editor label of the live codeblocks",children:"Live Editor"})}),(0,i.jsx)(N,{})]})}var C=function(e){return"".concat(e,";")};function D(e){var t,r,n,o,a=e.children,c=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,i.jsx)("div",{className:v,children:(0,i.jsx)(d.nu,(t=P({code:null==a?void 0:a.replace(/\n$/,""),noInline:p,transformCode:null!=c?c:C,theme:u},l),r=(r={children:"top"===s?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(I,{}),(0,i.jsx)(A,{})]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(A,{}),(0,i.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,i.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,c);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=[],c=!0,i=!1;try{for(o=o.call(e);!(c=(r=o.next()).done)&&(a.push(r.value),!t||a.length!==t);c=!0);}catch(e){i=!0,n=e}finally{try{!c&&null!=o.return&&o.return()}finally{if(i)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"),G=RegExp("\\{(?<range>[\\d,-]+)\\}"),W={js:{start:"\\/\\/",end:""},jsBlock:{start:"\\/\\*",end:"\\*\\/"},jsx:{start:"\\{\\s*\\/\\*",end:"\\*\\/\\s*\\}"},bash:{start:"#",end:""},html:{start:"\x3c!--",end:"--\x3e"}};var U=(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),H=Object.keys(W);function z(e,t){var r=e.map(function(e){var r=U[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 F="codeBlockContainer_jDV4";function X(e){var t,r,n,o,a=e.as,c=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],c=t[o];c&&"string"==typeof a&&(r[c]=a)}),r);return(0,i.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}({},c),o=(o={style:l,className:(0,s.Z)(c.className,F,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 $={codeBlockContent:"codeBlockContent_vx7S",codeBlockTitle:"codeBlockTitle_bdru",codeBlock:"codeBlock_Gebt",codeBlockStandalone:"codeBlockStandalone_i_cY",codeBlockLines:"codeBlockLines_FJaf",codeBlockLinesWithNumbering:"codeBlockLinesWithNumbering_FU9Q",buttonGroup:"buttonGroup_cUGO"};function J(e){var t=e.children,r=e.className;return(0,i.jsx)(X,{as:"pre",tabIndex:0,className:(0,s.Z)($.codeBlockStandalone,"thin-scrollbar",r),children:(0,i.jsx)("code",{className:$.codeBlockLines,children:t})})}var Q=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=[],c=!0,i=!1;try{for(o=o.call(e);!(c=(r=o.next()).done)&&(a.push(r.value),!t||a.length!==t);c=!0);}catch(e){i=!0,n=e}finally{try{!c&&null!=o.return&&o.return()}finally{if(i)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,c=e.getLineProps,l=e.getTokenProps;1===n.length&&"\n"===n[0].content&&(n[0].content="");var u=c({line:n,className:(0,s.Z)(o,a&&er.codeLine)}),d=n.map(function(e,t){return(0,i.jsx)("span",en({},l({token:e})),t)});return(0,i.jsxs)("span",(t=en({},u),r=(r={children:[a?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("span",{className:er.codeLineNumber}),(0,i.jsx)("span",{className:er.codeLineContent,children:d})]}):d,(0,i.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 ec(e){var t,r;return(0,i.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,i.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 ei(e){var t,r;return(0,i.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,i.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=[],c=!0,i=!1;try{for(o=o.call(e);!(c=(r=o.next()).done)&&(a.push(r.value),!t||a.length!==t);c=!0);}catch(e){i=!0,n=e}finally{try{!c&&null!=o.return&&o.return()}finally{if(i)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.")}()),c=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,i.jsx)("button",{type:"button","aria-label":c?(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,c&&el.copyButtonCopied),onClick:f,children:(0,i.jsxs)("span",{className:el.copyButtonIcons,"aria-hidden":"true",children:[(0,i.jsx)(ec,{className:el.copyButtonIcon}),(0,i.jsx)(ei,{className:el.copyButtonSuccessIcon})]})})}function ed(e){var t,r;return(0,i.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,i.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,i.jsx)("button",{type:"button",onClick:r,className:(0,s.Z)("clean-btn",t,n&&ep.wordWrapButtonEnabled),"aria-label":o,title:o,children:(0,i.jsx)(ed,{className:ep.wordWrapButtonIcon,"aria-hidden":"true"})})}function eb(e){var t,r,n,o,a,c,u,d,p,f,b,g,h,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,y.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 U=(o=(n=ee((0,l.useState)(!1),2))[0],a=n[1],u=(c=ee((0,l.useState)(!1),2))[0],d=c[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,h=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,Q.zX)(t),o=(0,Q.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&&(h(),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 F=(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,J=function(e,t){var r=e.replace(/\n$/,""),n=t.language,o=t.magicComments,a=t.metastring;if(a&&G.test(a)){var c=a.match(G).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 i=o[0].className;return{lineClassNames:Object.fromEntries(V()(c).filter(function(e){return e>0}).map(function(e){return[e-1,[i]]})),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 z(["js","jsBlock"],t);case"jsx":case"tsx":return z(["js","jsBlock","jsx"],t);case"html":return z(["js","jsBlock","html"],t);case"python":case"py":case"bash":return z(["bash"],t);case"markdown":case"md":return z(["html","jsx","bash"],t);case"tex":case"latex":case"matlab":return z(["tex"],t);case"lua":case"haskell":case"sql":return z(["lua"],t);case"wasm":return z(["wasm"],t);case"vb":case"vba":case"visual-basic":return z(["vb","rem"],t);case"vbnet":return z(["vbnet","rem"],t);case"batch":return z(["rem"],t);case"basic":return z(["rem","f90"],t);case"fsharp":return z(["js","ml"],t);case"ocaml":case"sml":return z(["ml"],t);case"fortran":return z(["f90"],t);case"cobol":return z(["cobol"],t);default:return z(H,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 h=g.slice(1).find(function(e){return void 0!==e});d[h]?u[d[h]].range+="".concat(b,","):p[h]?u[p[h]].start=b:f[h]&&(u[f[h]].range+="".concat(u[f[h]].start,"-").concat(b-1,",")),s.splice(b,1)}r=s.join("\n");var y={};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=y[e])&&void 0!==t||(y[e]=[]),y[e].push(r)})}),{lineClassNames:y,code:r}}(I,{metastring:C,language:M,magicComments:_}),K=J.lineClassNames,er=J.code;var en=null!=B?B:!!(null==(S=C)?void 0:S.includes("showLineNumbers"));return(0,i.jsxs)(X,{as:"div",className:(0,s.Z)(A,M&&!A.includes("language-".concat(M))&&"language-".concat(M)),children:[F&&(0,i.jsx)("div",{className:$.codeBlockTitle,children:F}),(0,i.jsxs)("div",{className:$.codeBlockContent,children:[(0,i.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,i.jsx)("pre",{tabIndex:0,ref:U.codeBlockRef,className:(0,s.Z)(t,$.codeBlock,"thin-scrollbar"),style:r,children:(0,i.jsx)("code",{className:(0,s.Z)($.codeBlockLines,en&&$.codeBlockLinesWithNumbering),children:n.map(function(e,t){return(0,i.jsx)(eo,{line:e,getLineProps:o,getTokenProps:a,classNames:K[t],showLineNumbers:en},t)})})})}}),(0,i.jsxs)("div",{className:$.buttonGroup,children:[(U.isEnabled||U.isCodeScrollable)&&(0,i.jsx)(ef,{className:$.codeButton,onClick:function(){return U.toggle()},isEnabled:U.isEnabled}),(0,i.jsx)(eu,{className:$.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 eh=(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"]),c=(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:J;return(0,i.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(c))},function(e){return e.live?(0,i.jsx)(D,eg({scope:Z},e)):(0,i.jsx)(a,eg({},e))});function ey(e){return(0,i.jsx)(eh,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))}}}]); |