mirror of
https://github.com/facebook/docusaurus.git
synced 2025-06-06 04:42:40 +02:00
22 lines
No EOL
31 KiB
JavaScript
22 lines
No EOL
31 KiB
JavaScript
"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([["37874"],{16688:function(e,n,t){t.d(n,{Z:()=>r});let r={copyButtonCopied:"copyButtonCopied_wDuR",copyButtonIcons:"copyButtonIcons_gMWc",copyButtonIcon:"copyButtonIcon_GXfb",copyButtonSuccessIcon:"copyButtonSuccessIcon_ktUX"}},61475:function(e,n,t){t.d(n,{Z:()=>r});let r={wordWrapButtonIcon:"wordWrapButtonIcon___5r",wordWrapButtonEnabled:"wordWrapButtonEnabled_nam_"}},62081:function(e,n,t){t.d(n,{Z:()=>r});let r={buttonGroup:"buttonGroup_KXnS"}},58683:function(e,n,t){t.d(n,{Z:()=>r});let r={codeBlockContainer:"codeBlockContainer_jDV4"}},18314:function(e,n,t){t.d(n,{Z:()=>r});let r={codeBlock:"codeBlock_Gebt",codeBlockStandalone:"codeBlockStandalone_i_cY",codeBlockLines:"codeBlockLines_FJaf",codeBlockLinesWithNumbering:"codeBlockLinesWithNumbering_FU9Q"}},13112:function(e,n,t){t.d(n,{Z:()=>r});let r={codeBlockContent:"codeBlockContent_cKMj",codeBlockTitle:"codeBlockTitle_U6Q0",codeBlock:"codeBlock_QST6"}},61562:function(e,n,t){t.d(n,{Z:()=>r});let r={codeLine:"codeLine_qRmp",codeLineNumber:"codeLineNumber_dS_J",codeLineContent:"codeLineContent_XF5l"}},55701:function(e,n,t){t.d(n,{Z:()=>r});let r={tabItem:"tabItem_pnkT"}},93195:function(e,n,t){t.d(n,{Z:()=>r});let r={tabList:"tabList_Qoir",tabItem:"tabItem_AQgk"}},43335:function(e,n,t){t.d(n,{Z:()=>r});let r={playgroundContainer:"playgroundContainer_TDLX"}},7512:function(e,n,t){t.d(n,{Z:()=>r});let r={playgroundEditor:"playgroundEditor_uqZ4"}},926:function(e,n,t){t.d(n,{Z:()=>r});let r={playgroundHeader:"playgroundHeader_h_Hu"}},25562:function(e,n,t){t.d(n,{Z:()=>r});let r={playgroundPreview:"playgroundPreview_u2xE"}},5759:function(e,n,t){t.d(n,{Z:()=>r});let r={apiTable:"apiTable_e8hp"}},70788:function(e,n,t){t.r(n),t.d(n,{assets:()=>h,contentTitle:()=>d,default:()=>f,frontMatter:()=>u,metadata:()=>r,toc:()=>p});var r=t(82802),s=t(85893),a=t(80980),o=t(4575),i=t(54636),l=t(7450),c=t(66359);let u={sidebar_position:6,slug:"/api/plugins/@docusaurus/plugin-google-analytics"},d="\uD83D\uDCE6 plugin-google-analytics",h={},p=[{value:"Installation",id:"installation",level:2},{value:"Configuration",id:"configuration",level:2},{value:"Example configuration",id:"ex-config",level:3}];function g(e){let n={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,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.header,{children:(0,s.jsx)(n.h1,{id:"-plugin-google-analytics",children:"\uD83D\uDCE6 plugin-google-analytics"})}),"\n","\n",(0,s.jsxs)(n.p,{children:["The default ",(0,s.jsx)(n.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,s.jsx)(n.strong,{children:"in the production build"}),". If you are using Google Analytics 4 you might need to consider using ",(0,s.jsx)(n.a,{href:"/docs/api/plugins/@docusaurus/plugin-google-gtag",children:"plugin-google-gtag"})," instead."]}),"\n",(0,s.jsxs)(n.admonition,{title:"Deprecated",type:"danger",children:[(0,s.jsxs)(n.p,{children:["This plugin is ",(0,s.jsx)(n.strong,{children:"deprecated"})," and became useless on July 1, 2023."]}),(0,s.jsxs)(n.p,{children:["Google is ",(0,s.jsx)(n.a,{href:"https://blog.google/products/marketingplatform/analytics/prepare-for-future-with-google-analytics-4/",children:"moving away from Universal Analytics"}),"."]}),(0,s.jsxs)(n.p,{children:["If you are still using this plugin with a ",(0,s.jsx)(n.code,{children:"UA-*"})," tracking id, you should create a Google Analytics 4 account as soon as possible, and use ",(0,s.jsx)(n.a,{href:"/docs/api/plugins/@docusaurus/plugin-google-gtag",children:(0,s.jsx)(n.code,{children:"@docusaurus/plugin-google-gtag"})})," instead of this plugin. More details ",(0,s.jsx)(n.a,{href:"https://github.com/facebook/docusaurus/issues/7221",children:"here"}),"."]})]}),"\n",(0,s.jsx)(n.admonition,{title:"production only",type:"warning",children:(0,s.jsxs)(n.p,{children:["This plugin is always inactive in development and ",(0,s.jsx)(n.strong,{children:"only active in production"})," to avoid polluting the analytics statistics."]})}),"\n",(0,s.jsx)(n.h2,{id:"installation",children:"Installation"}),"\n",(0,s.jsxs)(o.Z,{groupId:"npm2yarn",children:[(0,s.jsx)(i.Z,{value:"npm",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",children:"npm install --save @docusaurus/plugin-google-analytics\n"})})}),(0,s.jsx)(i.Z,{value:"yarn",label:"Yarn",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",children:"yarn add @docusaurus/plugin-google-analytics\n"})})}),(0,s.jsx)(i.Z,{value:"pnpm",label:"pnpm",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",children:"pnpm add @docusaurus/plugin-google-analytics\n"})})}),(0,s.jsx)(i.Z,{value:"bun",label:"Bun",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",children:"bun add @docusaurus/plugin-google-analytics\n"})})})]}),"\n",(0,s.jsxs)(n.admonition,{type:"tip",children:[(0,s.jsxs)(n.p,{children:["If you use the preset ",(0,s.jsx)(n.code,{children:"@docusaurus/preset-classic"}),", you don't need to install this plugin as a dependency."]}),(0,s.jsxs)(n.p,{children:["You can configure this plugin through the ",(0,s.jsx)(n.a,{href:"/docs/using-plugins#docusauruspreset-classic",children:"preset options"}),"."]})]}),"\n",(0,s.jsx)(n.h2,{id:"configuration",children:"Configuration"}),"\n",(0,s.jsx)(n.p,{children:"Accepted fields:"}),"\n",(0,s.jsx)(l.Z,{children:(0,s.jsxs)(n.table,{children:[(0,s.jsx)(n.thead,{children:(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.th,{children:"Name"}),(0,s.jsx)(n.th,{children:"Type"}),(0,s.jsx)(n.th,{children:"Default"}),(0,s.jsx)(n.th,{children:"Description"})]})}),(0,s.jsxs)(n.tbody,{children:[(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"trackingID"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"string"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.strong,{children:"Required"})}),(0,s.jsx)(n.td,{children:"The tracking ID of your analytics service."})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"anonymizeIP"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"boolean"})}),(0,s.jsx)(n.td,{children:(0,s.jsx)(n.code,{children:"false"})}),(0,s.jsx)(n.td,{children:"Whether the IP should be anonymized when sending requests."})]})]})]})}),"\n",(0,s.jsx)(n.h3,{id:"ex-config",children:"Example configuration"}),"\n",(0,s.jsx)(n.p,{children:"You can configure this plugin through preset options or plugin options."}),"\n",(0,s.jsx)(n.admonition,{type:"tip",children:(0,s.jsx)(n.p,{children:"Most Docusaurus users configure this plugin through the preset options."})}),"\n","\n",(0,s.jsx)(c.Z,{pluginName:"@docusaurus/plugin-google-analytics",presetOptionName:"googleAnalytics",code:"{\n trackingID: 'UA-141789564-1',\n anonymizeIP: true,\n}"})]})}function f(e={}){let{wrapper:n}={...(0,a.a)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(g,{...e})}):g(e)}},5343:function(e,n,t){t.d(n,{Z:()=>a});var r=t(85893);t(67294);var s=t(90496);function a(e){let{className:n,...t}=e;return(0,r.jsx)("button",{type:"button",...t,className:(0,s.Z)("clean-btn",n)})}},2556:function(e,n,t){t.d(n,{Z:()=>p});var r=t(85893),s=t(67294),a=t(90496),o=t(44771),i=t(77827),l=t(88568),c=t(5343),u=t(31660),d=t(87545),h=t(16688);function p(e){let{className:n}=e,{copyCode:t,isCopied:p}=function(){let{metadata:{code:e}}=(0,l.LS)(),[n,t]=(0,s.useState)(!1),r=(0,s.useRef)(void 0),a=(0,s.useCallback)(()=>{(0,o.Z)(e),t(!0),r.current=window.setTimeout(()=>{t(!1)},1e3)},[e]);return(0,s.useEffect)(()=>()=>window.clearTimeout(r.current),[]),{copyCode:a,isCopied:n}}();return(0,r.jsx)(c.Z,{"aria-label":p?(0,i.I)({id:"theme.CodeBlock.copied",message:"Copied",description:"The copied button label on code blocks"}):(0,i.I)({id:"theme.CodeBlock.copyButtonAriaLabel",message:"Copy code to clipboard",description:"The ARIA label for copy code blocks button"}),title:(0,i.I)({id:"theme.CodeBlock.copy",message:"Copy",description:"The copy button label on code blocks"}),className:(0,a.Z)(n,h.Z.copyButton,p&&h.Z.copyButtonCopied),onClick:t,children:(0,r.jsxs)("span",{className:h.Z.copyButtonIcons,"aria-hidden":"true",children:[(0,r.jsx)(u.Z,{className:h.Z.copyButtonIcon}),(0,r.jsx)(d.Z,{className:h.Z.copyButtonSuccessIcon})]})})}},93757:function(e,n,t){t.d(n,{Z:()=>u});var r=t(85893);t(67294);var s=t(90496),a=t(77827),o=t(88568),i=t(5343),l=t(67379),c=t(61475);function u(e){let{className:n}=e,{wordWrap:t}=(0,o.LS)();if(!(t.isEnabled||t.isCodeScrollable))return!1;let u=(0,a.I)({id:"theme.CodeBlock.wordWrapToggle",message:"Toggle word wrap",description:"The title attribute for toggle word wrapping button of code block lines"});return(0,r.jsx)(i.Z,{onClick:()=>t.toggle(),className:(0,s.Z)(n,t.isEnabled&&c.Z.wordWrapButtonEnabled),"aria-label":u,title:u,children:(0,r.jsx)(l.Z,{className:c.Z.wordWrapButtonIcon,"aria-hidden":"true"})})}},37457:function(e,n,t){t.d(n,{Z:()=>c});var r=t(85893);t(67294);var s=t(90496),a=t(56497),o=t(2556),i=t(93757),l=t(62081);function c(e){let{className:n}=e;return(0,r.jsx)(a.Z,{children:()=>(0,r.jsxs)("div",{className:(0,s.Z)(n,l.Z.buttonGroup),children:[(0,r.jsx)(i.Z,{}),(0,r.jsx)(o.Z,{})]})})}},62302:function(e,n,t){t.d(n,{Z:()=>c});var r=t(85893);t(67294);var s=t(90496),a=t(10099),o=t(55951),i=t(88568),l=t(58683);function c(e){let{as:n,...t}=e,c=(0,a.p)(),u=(0,i.QC)(c);return(0,r.jsx)(n,{...t,style:u,className:(0,s.Z)(t.className,l.Z.codeBlockContainer,o.k.common.codeBlock)})}},93002:function(e,n,t){t.d(n,{Z:()=>i});var r=t(85893);t(67294);var s=t(90496),a=t(62302),o=t(18314);function i(e){let{children:n,className:t}=e;return(0,r.jsx)(a.Z,{as:"pre",tabIndex:0,className:(0,s.Z)(o.Z.codeBlockStandalone,"thin-scrollbar",t),children:(0,r.jsx)("code",{className:o.Z.codeBlockLines,children:n})})}},97061:function(e,n,t){t.d(n,{Z:()=>l});var r=t(85893);t(67294);var s=t(26378),a=t(88568),o=t(63461),i=t(65802);function l(e){let n=function(e){let{prism:n}=(0,s.L)();return(0,a.MA)({code:e.children,className:e.className,metastring:e.metastring,magicComments:n.magicComments,defaultLanguage:n.defaultLanguage,language:e.language,title:e.title,showLineNumbers:e.showLineNumbers})}(e),t=(0,o.F)();return(0,r.jsx)(a.EF,{metadata:n,wordWrap:t,children:(0,r.jsx)(i.Z,{})})}},26965:function(e,n,t){t.d(n,{Z:()=>p});var r=t(85893),s=t(67294),a=t(90496),o=t(88568),i=t(10099),l=t(7316),c=t(32028),u=t(18314);let d=s.forwardRef((e,n)=>(0,r.jsx)("pre",{ref:n,tabIndex:0,...e,className:(0,a.Z)(e.className,u.Z.codeBlock,"thin-scrollbar")}));function h(e){let{metadata:n}=(0,o.LS)();return(0,r.jsx)("code",{...e,className:(0,a.Z)(e.className,u.Z.codeBlockLines,void 0!==n.lineNumbersStart&&u.Z.codeBlockLinesWithNumbering),style:{...e.style,counterReset:void 0===n.lineNumbersStart?void 0:`line-count ${n.lineNumbersStart-1}`}})}function p(e){let{className:n}=e,{metadata:t,wordWrap:s}=(0,o.LS)(),u=(0,i.p)(),{code:p,language:g,lineNumbersStart:f,lineClassNames:m}=t;return(0,r.jsx)(l.y$,{theme:u,code:p,language:g,children:e=>{let{className:t,style:o,tokens:i,getLineProps:l,getTokenProps:u}=e;return(0,r.jsx)(d,{ref:s.codeBlockRef,className:(0,a.Z)(n,t),style:o,children:(0,r.jsx)(h,{children:i.map((e,n)=>(0,r.jsx)(c.Z,{line:e,getLineProps:l,getTokenProps:u,classNames:m[n],showLineNumbers:void 0!==f},n))})})}})}},65802:function(e,n,t){t.d(n,{Z:()=>d});var r=t(85893);t(67294);var s=t(90496),a=t(88568),o=t(62302),i=t(923),l=t(26965),c=t(37457),u=t(13112);function d(e){let{className:n}=e,{metadata:t}=(0,a.LS)();return(0,r.jsxs)(o.Z,{as:"div",className:(0,s.Z)(n,t.className),children:[t.title&&(0,r.jsx)("div",{className:u.Z.codeBlockTitle,children:(0,r.jsx)(i.Z,{children:t.title})}),(0,r.jsxs)("div",{className:u.Z.codeBlockContent,children:[(0,r.jsx)(l.Z,{}),(0,r.jsx)(c.Z,{})]})]})}},76458:function(e,n,t){t.d(n,{Z:()=>s});var r=t(85893);function s(e){let{line:n,token:t,...s}=e;return(0,r.jsx)("span",{...s})}t(67294)},32028:function(e,n,t){t.d(n,{Z:()=>i});var r=t(85893);t(67294);var s=t(90496),a=t(76458),o=t(61562);function i(e){let{line:n,classNames:t,showLineNumbers:i,getLineProps:l,getTokenProps:c}=e,u=function(e){let n=1===e.length&&"\n"===e[0].content?e[0]:void 0;return n?[{...n,content:""}]:e}(n),d=l({line:u,className:(0,s.Z)(t,i&&o.Z.codeLine)}),h=u.map((e,n)=>{let t=c({token:e});return(0,r.jsx)(a.Z,{...t,line:u,token:e,children:t.children},n)});return(0,r.jsxs)("span",{...d,children:[i?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("span",{className:o.Z.codeLineNumber}),(0,r.jsx)("span",{className:o.Z.codeLineContent,children:h})]}):h,(0,r.jsx)("br",{})]})}},923:function(e,n,t){t.d(n,{Z:()=>r});function r(e){let{children:n}=e;return n}},8110:function(e,n,t){t.d(n,{Z:()=>l});var r=t(85893),s=t(67294),a=t(71607),o=t(93002),i=t(97061);function l(e){let{children:n,...t}=e,l=(0,a.Z)(),c=s.Children.toArray(n).some(e=>(0,s.isValidElement)(e))?n:Array.isArray(n)?n.join(""):n,u="string"==typeof c?i.Z:o.Z;return(0,r.jsx)(u,{...t,children:c},String(l))}},31660:function(e,n,t){t.d(n,{Z:()=>s});var r=t(85893);function s(e){return(0,r.jsx)("svg",{viewBox:"0 0 24 24",...e,children:(0,r.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"})})}t(67294)},87545:function(e,n,t){t.d(n,{Z:()=>s});var r=t(85893);function s(e){return(0,r.jsx)("svg",{viewBox:"0 0 24 24",...e,children:(0,r.jsx)("path",{fill:"currentColor",d:"M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"})})}t(67294)},67379:function(e,n,t){t.d(n,{Z:()=>s});var r=t(85893);function s(e){return(0,r.jsx)("svg",{viewBox:"0 0 24 24",...e,children:(0,r.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"})})}t(67294)},54636:function(e,n,t){t.d(n,{Z:()=>o});var r=t(85893);t(67294);var s=t(90496),a=t(55701);function o(e){let{children:n,hidden:t,className:o}=e;return(0,r.jsx)("div",{role:"tabpanel",className:(0,s.Z)(a.Z.tabItem,o),hidden:t,children:n})}},4575:function(e,n,t){t.d(n,{Z:()=>p});var r=t(85893),s=t(67294),a=t(90496),o=t(54947),i=t(30623),l=t(71607),c=t(93195);function u(e){let{className:n,block:t,selectedValue:s,selectValue:i,tabValues:l}=e,u=[],{blockElementScrollPositionUntilNextRender:d}=(0,o.o5)(),h=e=>{let n=e.currentTarget,t=l[u.indexOf(n)].value;t!==s&&(d(n),i(t))},p=e=>{let n=null;switch(e.key){case"Enter":h(e);break;case"ArrowRight":{let t=u.indexOf(e.currentTarget)+1;n=u[t]??u[0];break}case"ArrowLeft":{let t=u.indexOf(e.currentTarget)-1;n=u[t]??u[u.length-1]}}n?.focus()};return(0,r.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,a.Z)("tabs",{"tabs--block":t},n),children:l.map(e=>{let{value:n,label:t,attributes:o}=e;return(0,r.jsx)("li",{role:"tab",tabIndex:s===n?0:-1,"aria-selected":s===n,ref:e=>{u.push(e)},onKeyDown:p,onClick:h,...o,className:(0,a.Z)("tabs__item",c.Z.tabItem,o?.className,{"tabs__item--active":s===n}),children:t??n},n)})})}function d(e){let{lazy:n,children:t,selectedValue:o}=e,i=(Array.isArray(t)?t:[t]).filter(Boolean);if(n){let e=i.find(e=>e.props.value===o);return e?(0,s.cloneElement)(e,{className:(0,a.Z)("margin-top--md",e.props.className)}):null}return(0,r.jsx)("div",{className:"margin-top--md",children:i.map((e,n)=>(0,s.cloneElement)(e,{key:n,hidden:e.props.value!==o}))})}function h(e){let n=(0,i.Y)(e);return(0,r.jsxs)("div",{className:(0,a.Z)("tabs-container",c.Z.tabList),children:[(0,r.jsx)(u,{...n,...e}),(0,r.jsx)(d,{...n,...e})]})}function p(e){let n=(0,l.Z)();return(0,r.jsx)(h,{...e,children:(0,i.h)(e.children)},String(n))}},63461:function(e,n,t){t.d(n,{F:()=>a});var r=t(67294),s=t(9219);function a(){let[e,n]=(0,r.useState)(!1),[t,a]=(0,r.useState)(!1),o=(0,r.useRef)(null),i=(0,r.useCallback)(()=>{let t=o.current.querySelector("code");e?t.removeAttribute("style"):(t.style.whiteSpace="pre-wrap",t.style.overflowWrap="anywhere"),n(e=>!e)},[o,e]),l=(0,r.useCallback)(()=>{let{scrollWidth:e,clientWidth:n}=o.current;a(e>n||o.current.querySelector("code").hasAttribute("style"))},[o]),[c,u]=(0,r.useState)(),d=(0,r.useCallback)(()=>{u(o.current?.closest("[role=tabpanel][hidden]"))},[o,u]);return(0,r.useEffect)(()=>{d()},[d]),(0,s.I)(c,e=>{e.forEach(e=>{"attributes"===e.type&&"hidden"===e.attributeName&&(l(),d())})},{attributes:!0,characterData:!1,childList:!1,subtree:!1}),(0,r.useEffect)(()=>{l()},[e,l]),(0,r.useEffect)(()=>(window.addEventListener("resize",l,{passive:!0}),()=>{window.removeEventListener("resize",l)}),[l]),{codeBlockRef:o,isEnabled:e,isCodeScrollable:t,toggle:i}}},9219:function(e,n,t){t.d(n,{I:()=>o});var r=t(67294),s=t(50923);let a={attributes:!0,characterData:!0,childList:!0,subtree:!0};function o(e,n){let t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:a,o=(0,s.zX)(n),i=(0,s.Ql)(t);(0,r.useEffect)(()=>{let n=new MutationObserver(o);return e&&n.observe(e,i),()=>n.disconnect()},[e,o,i])}},10099:function(e,n,t){t.d(n,{p:()=>a});var r=t(45245),s=t(26378);function a(){let{prism:e}=(0,s.L)(),{colorMode:n}=(0,r.I)(),t=e.theme,a=e.darkTheme||t;return"dark"===n?a:t}},88568:function(e,n,t){t.d(n,{EF:()=>x,LS:()=>j,MA:()=>f,QC:()=>m});var r=t(85893),s=t(67294),a=t(90496),o=t(6324),i=t.n(o),l=t(50923);let c=/title=(?<quote>["'])(?<title>.*?)\1/,u=/\{(?<range>[\d,-]+)\}/,d={js:{start:"\\/\\/",end:""},jsBlock:{start:"\\/\\*",end:"\\*\\/"},jsx:{start:"\\{\\s*\\/\\*",end:"\\*\\/\\s*\\}"},bash:{start:"#",end:""},html:{start:"\x3c!--",end:"--\x3e"}},h={...d,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:""}},p=Object.keys(d);function g(e,n){let t=e.map(e=>{let{start:t,end:r}=h[e];return`(?:${t}\\s*(${n.flatMap(e=>[e.line,e.block?.start,e.block?.end].filter(Boolean)).join("|")})\\s*${r})`}).join("|");return RegExp(`^\\s*(?:${t})\\s*$`)}function f(e){var n,t,r;let s=(t=(n={language:e.language,defaultLanguage:e.defaultLanguage,className:e.className}).language??function(e){if(!e)return;let n=e.split(" ").find(e=>e.startsWith("language-"));return n?.replace(/language-/,"")}(n.className)??n.defaultLanguage,t?.toLowerCase()??"text"),{lineClassNames:o,code:l}=function(e,n){let t=e.replace(/\r?\n$/,"");return function(e,n){let{metastring:t,magicComments:r}=n;if(t&&u.test(t)){let n=t.match(u).groups.range;if(0===r.length)throw Error(`A highlight range has been given in code block's metastring (\`\`\` ${t}), but no magic comment config is available. Docusaurus applies the first magic comment entry's className for metastring ranges.`);let s=r[0].className;return{lineClassNames:Object.fromEntries(i()(n).filter(e=>e>0).map(e=>[e-1,[s]])),code:e}}return null}(t,{...n})??function(e,n){let{language:t,magicComments:r}=n;if(void 0===t)return{lineClassNames:{},code:e};let s=function(e,n){switch(e){case"js":case"javascript":case"ts":case"typescript":return g(["js","jsBlock"],n);case"jsx":case"tsx":return g(["js","jsBlock","jsx"],n);case"html":return g(["js","jsBlock","html"],n);case"python":case"py":case"bash":return g(["bash"],n);case"markdown":case"md":return g(["html","jsx","bash"],n);case"tex":case"latex":case"matlab":return g(["tex"],n);case"lua":case"haskell":return g(["lua"],n);case"sql":return g(["lua","jsBlock"],n);case"wasm":return g(["wasm"],n);case"vb":case"vba":case"visual-basic":return g(["vb","rem"],n);case"vbnet":return g(["vbnet","rem"],n);case"batch":return g(["rem"],n);case"basic":return g(["rem","f90"],n);case"fsharp":return g(["js","ml"],n);case"ocaml":case"sml":return g(["ml"],n);case"fortran":return g(["f90"],n);case"cobol":return g(["cobol"],n);default:return g(p,n)}}(t,r),a=e.split(/\r?\n/),o=Object.fromEntries(r.map(e=>[e.className,{start:0,range:""}])),l=Object.fromEntries(r.filter(e=>e.line).map(e=>{let{className:n,line:t}=e;return[t,n]})),c=Object.fromEntries(r.filter(e=>e.block).map(e=>{let{className:n,block:t}=e;return[t.start,n]})),u=Object.fromEntries(r.filter(e=>e.block).map(e=>{let{className:n,block:t}=e;return[t.end,n]}));for(let e=0;e<a.length;){let n=a[e].match(s);if(!n){e+=1;continue}let t=n.slice(1).find(e=>void 0!==e);l[t]?o[l[t]].range+=`${e},`:c[t]?o[c[t]].start=e:u[t]&&(o[u[t]].range+=`${o[u[t]].start}-${e-1},`),a.splice(e,1)}let d={};return Object.entries(o).forEach(e=>{let[n,{range:t}]=e;i()(t).forEach(e=>{d[e]??=[],d[e].push(n)})}),{code:a.join("\n"),lineClassNames:d}}(t,{...n})}(e.code,{metastring:e.metastring,magicComments:e.magicComments,language:s}),d=function(e){let{className:n,language:t}=e;return(0,a.Z)(n,t&&!n?.includes(`language-${t}`)&&`language-${t}`)}({className:e.className,language:s}),h=(r=e.metastring,(r?.match(c)?.groups.title??"")||e.title),f=function(e){let{showLineNumbers:n,metastring:t}=e;if("boolean"==typeof n)return n?1:void 0;if("number"==typeof n)return n;let r=t?.split(" ").find(e=>e.startsWith("showLineNumbers"));if(r)return r.startsWith("showLineNumbers=")?parseInt(r.replace("showLineNumbers=",""),10):1}({showLineNumbers:e.showLineNumbers,metastring:e.metastring});return{codeInput:e.code,code:l,className:d,language:s,title:h,lineNumbersStart:f,lineClassNames:o}}function m(e){let n={color:"--prism-color",backgroundColor:"--prism-background-color"},t={};return Object.entries(e.plain).forEach(e=>{let[r,s]=e,a=n[r];a&&"string"==typeof s&&(t[a]=s)}),t}let b=(0,s.createContext)(null);function x(e){let{metadata:n,wordWrap:t,children:a}=e,o=(0,s.useMemo)(()=>({metadata:n,wordWrap:t}),[n,t]);return(0,r.jsx)(b.Provider,{value:o,children:a})}function j(){let e=(0,s.useContext)(b);if(null===e)throw new l.i6("CodeBlockContextProvider");return e}},30623:function(e,n,t){t.d(n,{Y:()=>d,h:()=>c});var r=t(67294),s=t(3620),a=t(844),o=t(97486),i=t(32263),l=t(16971);function c(e){return r.Children.toArray(e).filter(e=>"\n"!==e).map(e=>{if(!e||(0,r.isValidElement)(e)&&function(e){let{props:n}=e;return!!n&&"object"==typeof n&&"value"in n}(e))return e;throw Error(`Docusaurus error: Bad <Tabs> child <${"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.`)})?.filter(Boolean)??[]}function u(e){let{value:n,tabValues:t}=e;return t.some(e=>e.value===n)}function d(e){let{defaultValue:n,queryString:t=!1,groupId:d}=e,h=function(e){let{values:n,children:t}=e;return(0,r.useMemo)(()=>{let e=n??c(t).map(e=>{let{props:{value:n,label:t,attributes:r,default:s}}=e;return{value:n,label:t,attributes:r,default:s}}),r=(0,i.lx)(e,(e,n)=>e.value===n.value);if(r.length>0)throw Error(`Docusaurus error: Duplicate values "${r.map(e=>e.value).join(", ")}" found in <Tabs>. Every value needs to be unique.`);return e},[n,t])}(e),[p,g]=(0,r.useState)(()=>(function(e){let{defaultValue:n,tabValues:t}=e;if(0===t.length)throw Error("Docusaurus error: the <Tabs> component requires at least one <TabItem> children component");if(n){if(!u({value:n,tabValues:t}))throw Error(`Docusaurus error: The <Tabs> has a defaultValue "${n}" but none of its children has the corresponding value. Available values are: ${t.map(e=>e.value).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return n}let r=t.find(e=>e.default)??t[0];if(!r)throw Error("Unexpected error: 0 tabValues");return r.value})({defaultValue:n,tabValues:h})),[f,m]=function(e){let{queryString:n=!1,groupId:t}=e,a=(0,s.k6)(),i=function(e){let{queryString:n=!1,groupId:t}=e;if("string"==typeof n)return n;if(!1===n)return null;if(!0===n&&!t)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 t??null}({queryString:n,groupId:t});return[(0,o._X)(i),(0,r.useCallback)(e=>{if(!i)return;let n=new URLSearchParams(a.location.search);n.set(i,e),a.replace({...a.location,search:n.toString()})},[i,a])]}({queryString:t,groupId:d}),[b,x]=function(e){let{groupId:n}=e,t=n?`docusaurus.tab.${n}`:null,[s,a]=(0,l.Nk)(t);return[s,(0,r.useCallback)(e=>{t&&a.set(e)},[t,a])]}({groupId:d}),j=(()=>{let e=f??b;return u({value:e,tabValues:h})?e:null})();return(0,a.Z)(()=>{j&&g(j)},[j]),{selectedValue:p,selectValue:(0,r.useCallback)(e=>{if(!u({value:e,tabValues:h}))throw Error(`Can't select invalid tab value=${e}`);g(e),m(e),x(e)},[m,x,h]),tabValues:h}}},5626:function(e,n,t){t.d(n,{Z:()=>o});var r=t(85893);t(67294);var s=t(8110),a=t(80483);function o(e){return e.live?(0,r.jsx)(a.Z,{...e}):(0,r.jsx)(s.Z,{...e})}},80483:function(e,n,t){t.d(n,{Z:()=>o});var r=t(85893);t(67294);var s=t(35010),a=t(62529);function o(e){return(0,r.jsx)(s.Z,{scope:a.Z,...e})}},57829:function(e,n,t){t.d(n,{Z:()=>a});var r=t(85893);t(67294);var s=t(43335);function a(e){let{children:n}=e;return(0,r.jsx)("div",{className:s.Z.playgroundContainer,children:n})}},49522:function(e,n,t){t.d(n,{Z:()=>c});var r=t(85893);t(67294);var s=t(62905),a=t(71607),o=t(77827),i=t(83372),l=t(7512);function c(){let e=(0,a.Z)();return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(i.Z,{children:(0,r.jsx)(o.Z,{id:"theme.Playground.liveEditor",description:"The live editor label of the live codeblocks",children:"Live Editor"})}),(0,r.jsx)(s.uz,{className:l.Z.playgroundEditor},String(e))]})}},83372:function(e,n,t){t.d(n,{Z:()=>o});var r=t(85893);t(67294);var s=t(90496),a=t(926);function o(e){let{children:n}=e;return(0,r.jsx)("div",{className:(0,s.Z)(a.Z.playgroundHeader),children:n})}},45188:function(e,n,t){t.d(n,{Z:()=>i});var r=t(85893);t(67294);var s=t(26378),a=t(67191),o=t(49522);function i(){let{playgroundPosition:e}=(0,s.L)().liveCodeBlock;return(0,r.jsx)(r.Fragment,{children:"top"===e?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(a.Z,{}),(0,r.jsx)(o.Z,{})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(o.Z,{}),(0,r.jsx)(a.Z,{})]})})}},67191:function(e,n,t){t.d(n,{Z:()=>p});var r=t(85893);t(67294);var s=t(62905),a=t(56497),o=t(12565),i=t(83176),l=t(77827),c=t(83372),u=t(25562);function d(){return(0,r.jsx)("div",{children:"Loading..."})}function h(){return(0,r.jsx)(a.Z,{fallback:(0,r.jsx)(d,{}),children:()=>(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(i.Z,{fallback:e=>(0,r.jsx)(o.Ac,{...e}),children:(0,r.jsx)(s.i5,{})}),(0,r.jsx)(s.IF,{})]})})}function p(){return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(c.Z,{children:(0,r.jsx)(l.Z,{id:"theme.Playground.result",description:"The result label of the live codeblocks",children:"Result"})}),(0,r.jsx)("div",{className:u.Z.playgroundPreview,children:(0,r.jsx)(h,{})})]})}},9002:function(e,n,t){t.d(n,{Z:()=>i});var r=t(85893);t(67294);var s=t(62905),a=t(10099);let o=e=>`${e};`;function i(e){let{code:n,children:t,...i}=e,l=(0,a.p)(),c=i.metastring?.includes("noInline")??!1;return(0,r.jsx)(s.nu,{noInline:c,theme:l,...i,code:n?.replace(/\n$/,""),transformCode:i.transformCode??o,children:t})}},35010:function(e,n,t){t.d(n,{Z:()=>i});var r=t(85893);t(67294);var s=t(9002),a=t(57829),o=t(45188);function i(e){let{children:n,transformCode:t,...i}=e;return(0,r.jsx)(a.Z,{children:(0,r.jsx)(s.Z,{code:n,...i,children:(0,r.jsx)(o.Z,{})})})}},56497:function(e,n,t){t.d(n,{Z:()=>a});var r=t(85893);t(67294);var s=t(71607);function a(e){let{children:n,fallback:t}=e;return(0,s.Z)()?(0,r.jsx)(r.Fragment,{children:n?.()}):t??null}},7450:function(e,n,t){t.d(n,{Z:()=>c});var r=t(85893),s=t(67294),a=t(30576),o=t(3620),i=t(5759);let l=s.forwardRef(function(e,n){let{name:t,children:i}=e,l=function(e){let n=e;for(;(0,s.isValidElement)(n);)[n]=s.Children.toArray(n.props.children);if("string"!=typeof n)throw Error(`Could not extract APITable row name from JSX tree:
|
|
${JSON.stringify(e,null,2)}`);return n}(i),c=t?`${t}-${l}`:l,u=`#${c}`,d=(0,o.k6)();return(0,a.Z)().collectAnchor(c),(0,r.jsx)("tr",{id:c,tabIndex:0,ref:d.location.hash===u?n:void 0,onClick:e=>{let n="TD"===e.target.tagName.toUpperCase(),t=!!window.getSelection()?.toString();n&&!t&&d.push(u)},onKeyDown:e=>{"Enter"===e.key&&d.push(u)},children:i.props.children})});function c(e){let{children:n,name:t}=e;if("table"!==n.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.");let[a,o]=s.Children.toArray(n.props.children),c=(0,s.useRef)(null);(0,s.useEffect)(()=>{c.current?.focus()},[c]);let u=s.Children.map(o.props.children,e=>(0,r.jsx)(l,{name:t,ref:c,children:e}));return(0,r.jsxs)("table",{className:i.Z.apiTable,children:[a,(0,r.jsx)("tbody",{children:u})]})}},66359:function(e,n,t){t.d(n,{Z:()=>d});var r=t(85893);t(67294);var s=t(35363),a=t(38514),o=t(77827),i=t(4575),l=t(54636),c=t(14547);let u=void 0;function d(e){let{code:n,pluginName:t,presetOptionName:d}=e,h=(0,a.zu)(u).path;return(0,r.jsxs)(i.Z,{groupId:"api-config-ex",children:[(0,r.jsxs)(l.Z,{value:"preset",label:(0,o.I)({message:"Preset options"}),children:[(0,r.jsx)("p",{children:(0,r.jsx)(o.Z,{id:"apiDocs.configTabs.presetOptions.description",values:{presetLink:(0,r.jsx)(s.Z,{to:`${h}/using-plugins#docusauruspreset-classic`,children:(0,r.jsx)(o.Z,{children:"preset options"})})},children:"If you use a preset, configure this plugin through the {presetLink}:"})}),(0,r.jsx)(c.Z,{language:"js",title:"docusaurus.config.js",children:`module.exports = {
|
|
presets: [
|
|
[
|
|
'@docusaurus/preset-classic',
|
|
{
|
|
// highlight-start
|
|
${d}: ${n.replace(/\n/g,"\n ")},
|
|
// highlight-end
|
|
},
|
|
],
|
|
],
|
|
};`})]}),(0,r.jsxs)(l.Z,{value:"plugin",label:(0,o.I)({message:"Plugin options"}),children:[(0,r.jsx)("p",{children:(0,r.jsx)(o.Z,{children:"If you are using a standalone plugin, provide options directly to the plugin:"})}),(0,r.jsx)(c.Z,{language:"js",title:"docusaurus.config.js",children:`module.exports = {
|
|
plugins: [
|
|
[
|
|
'${t}',
|
|
// highlight-start
|
|
${n.replace(/\n/g,"\n ")},
|
|
// highlight-end
|
|
],
|
|
],
|
|
};`})]})]})}},14547:function(e,n,t){t.d(n,{Z:()=>a});var r=t(85893);t(67294);var s=t(5626);function a(e){return(0,r.jsx)(s.Z,{...e})}},63627:function(e,n,t){t.r(n),t.d(n,{ButtonExample:()=>s});var r=t(85893);function s(e){return(0,r.jsx)("button",{type:"button",...e,style:{backgroundColor:"white",color:"black",border:"solid red",borderRadius:20,padding:10,cursor:"pointer",...e.style}})}t(67294)},62529:function(e,n,t){t.d(n,{Z:()=>a});var r=t(67294),s=t(63627);let a={React:r,...r,...s}},82802:function(e){e.exports=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":1748625776000,"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"}}')}}]); |