mirror of
https://github.com/facebook/docusaurus.git
synced 2025-12-26 01:33:02 +00:00
22 lines
30 KiB
JavaScript
22 lines
30 KiB
JavaScript
"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([["23432"],{15028:function(e,t,n){n.d(t,{A:()=>r});let r={copyButtonCopied:"copyButtonCopied_wDuR",copyButtonIcons:"copyButtonIcons_gMWc",copyButtonIcon:"copyButtonIcon_GXfb",copyButtonSuccessIcon:"copyButtonSuccessIcon_ktUX"}},143:function(e,t,n){n.d(t,{A:()=>r});let r={wordWrapButtonIcon:"wordWrapButtonIcon___5r",wordWrapButtonEnabled:"wordWrapButtonEnabled_nam_"}},75864:function(e,t,n){n.d(t,{A:()=>r});let r={buttonGroup:"buttonGroup_KXnS"}},37322:function(e,t,n){n.d(t,{A:()=>r});let r={codeBlockContainer:"codeBlockContainer_jDV4"}},81772:function(e,t,n){n.d(t,{A:()=>r});let r={codeBlock:"codeBlock_Gebt",codeBlockStandalone:"codeBlockStandalone_i_cY",codeBlockLines:"codeBlockLines_FJaf",codeBlockLinesWithNumbering:"codeBlockLinesWithNumbering_FU9Q"}},73215:function(e,t,n){n.d(t,{A:()=>r});let r={codeBlockContent:"codeBlockContent_cKMj",codeBlockTitle:"codeBlockTitle_U6Q0",codeBlock:"codeBlock_QST6"}},631:function(e,t,n){n.d(t,{A:()=>r});let r={codeLine:"codeLine_qRmp",codeLineNumber:"codeLineNumber_dS_J",codeLineContent:"codeLineContent_XF5l"}},41452:function(e,t,n){n.d(t,{A:()=>r});let r={tabItem:"tabItem_pnkT"}},18416:function(e,t,n){n.d(t,{A:()=>r});let r={tabList:"tabList_Qoir",tabItem:"tabItem_AQgk"}},85120:function(e,t,n){n.d(t,{A:()=>r});let r={playgroundContainer:"playgroundContainer_TDLX"}},19304:function(e,t,n){n.d(t,{A:()=>r});let r={playgroundEditor:"playgroundEditor_uqZ4"}},79820:function(e,t,n){n.d(t,{A:()=>r});let r={playgroundHeader:"playgroundHeader_h_Hu"}},60477:function(e,t,n){n.d(t,{A:()=>r});let r={playgroundPreview:"playgroundPreview_u2xE"}},11344:function(e,t,n){n.d(t,{A:()=>r});let r={apiTable:"apiTable_e8hp"}},18079:function(e,t,n){n.r(t),n.d(t,{assets:()=>g,contentTitle:()=>d,default:()=>f,frontMatter:()=>u,metadata:()=>r,toc:()=>h});var r=n(35687),a=n(74848),o=n(56151),s=n(14729),i=n(13899),l=n(6125),c=n(63402);let u={sidebar_position:7,slug:"/api/plugins/@docusaurus/plugin-google-gtag"},d="\u{1F4E6} plugin-google-gtag",g={},h=[{value:"Installation",id:"installation",level:2},{value:"Configuration",id:"configuration",level:2},{value:"Example configuration",id:"ex-config",level:3}];function p(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,o.R)(),...e.components};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(t.header,{children:(0,a.jsx)(t.h1,{id:"-plugin-google-gtag",children:"\u{1F4E6} plugin-google-gtag"})}),"\n","\n",(0,a.jsxs)(t.p,{children:["The default ",(0,a.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,a.jsx)(t.admonition,{type:"tip",children:(0,a.jsxs)(t.p,{children:["You can use ",(0,a.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,a.jsx)(t.admonition,{title:"production only",type:"warning",children:(0,a.jsxs)(t.p,{children:["This plugin is always inactive in development and ",(0,a.jsx)(t.strong,{children:"only active in production"})," to avoid polluting the analytics statistics."]})}),"\n",(0,a.jsx)(t.h2,{id:"installation",children:"Installation"}),"\n",(0,a.jsxs)(s.A,{groupId:"npm2yarn",children:[(0,a.jsx)(i.A,{value:"npm",children:(0,a.jsx)(t.pre,{children:(0,a.jsx)(t.code,{className:"language-bash",children:"npm install --save @docusaurus/plugin-google-gtag\n"})})}),(0,a.jsx)(i.A,{value:"yarn",label:"Yarn",children:(0,a.jsx)(t.pre,{children:(0,a.jsx)(t.code,{className:"language-bash",children:"yarn add @docusaurus/plugin-google-gtag\n"})})}),(0,a.jsx)(i.A,{value:"pnpm",label:"pnpm",children:(0,a.jsx)(t.pre,{children:(0,a.jsx)(t.code,{className:"language-bash",children:"pnpm add @docusaurus/plugin-google-gtag\n"})})}),(0,a.jsx)(i.A,{value:"bun",label:"Bun",children:(0,a.jsx)(t.pre,{children:(0,a.jsx)(t.code,{className:"language-bash",children:"bun add @docusaurus/plugin-google-gtag\n"})})})]}),"\n",(0,a.jsxs)(t.admonition,{type:"tip",children:[(0,a.jsxs)(t.p,{children:["If you use the preset ",(0,a.jsx)(t.code,{children:"@docusaurus/preset-classic"}),", you don't need to install this plugin as a dependency."]}),(0,a.jsxs)(t.p,{children:["You can configure this plugin through the ",(0,a.jsx)(t.a,{href:"/docs/using-plugins#docusauruspreset-classic",children:"preset options"}),"."]})]}),"\n",(0,a.jsx)(t.h2,{id:"configuration",children:"Configuration"}),"\n",(0,a.jsx)(t.p,{children:"Accepted fields:"}),"\n",(0,a.jsx)(l.A,{children:(0,a.jsxs)(t.table,{children:[(0,a.jsx)(t.thead,{children:(0,a.jsxs)(t.tr,{children:[(0,a.jsx)(t.th,{children:"Name"}),(0,a.jsx)(t.th,{children:"Type"}),(0,a.jsx)(t.th,{children:"Default"}),(0,a.jsx)(t.th,{children:"Description"})]})}),(0,a.jsxs)(t.tbody,{children:[(0,a.jsxs)(t.tr,{children:[(0,a.jsx)(t.td,{children:(0,a.jsx)(t.code,{children:"trackingID"})}),(0,a.jsx)(t.td,{children:(0,a.jsx)("code",{children:"string | string[]"})}),(0,a.jsx)(t.td,{children:(0,a.jsx)(t.strong,{children:"Required"})}),(0,a.jsx)(t.td,{children:"The tracking ID of your gtag service. It is possible to provide multiple ids."})]}),(0,a.jsxs)(t.tr,{children:[(0,a.jsx)(t.td,{children:(0,a.jsx)(t.code,{children:"anonymizeIP"})}),(0,a.jsx)(t.td,{children:(0,a.jsx)(t.code,{children:"boolean"})}),(0,a.jsx)(t.td,{children:(0,a.jsx)(t.code,{children:"false"})}),(0,a.jsx)(t.td,{children:"Whether the IP should be anonymized when sending requests."})]})]})]})}),"\n",(0,a.jsx)(t.h3,{id:"ex-config",children:"Example configuration"}),"\n",(0,a.jsx)(t.p,{children:"You can configure this plugin through preset options or plugin options."}),"\n",(0,a.jsx)(t.admonition,{type:"tip",children:(0,a.jsx)(t.p,{children:"Most Docusaurus users configure this plugin through the preset options."})}),"\n","\n",(0,a.jsx)(c.A,{pluginName:"@docusaurus/plugin-google-gtag",presetOptionName:"gtag",code:"{\n trackingID: 'G-999X9XX9XX',\n anonymizeIP: true,\n}"})]})}function f(e={}){let{wrapper:t}={...(0,o.R)(),...e.components};return t?(0,a.jsx)(t,{...e,children:(0,a.jsx)(p,{...e})}):p(e)}},14992:function(e,t,n){n.d(t,{A:()=>o});var r=n(74848);n(96540);var a=n(11118);function o({className:e,...t}){return(0,r.jsx)("button",{type:"button",...t,className:(0,a.A)("clean-btn",e)})}},46221:function(e,t,n){n.d(t,{A:()=>g});var r=n(74848),a=n(96540),o=n(11118),s=n(33977),i=n(47466),l=n(14992),c=n(11912),u=n(32732),d=n(15028);function g({className:e}){let{copyCode:t,isCopied:n}=function(){let{metadata:{code:e}}=(0,i.Ph)(),[t,n]=(0,a.useState)(!1),r=(0,a.useRef)(void 0),o=(0,a.useCallback)(()=>{navigator.clipboard.writeText(e).then(()=>{n(!0),r.current=window.setTimeout(()=>{n(!1)},1e3)})},[e]);return(0,a.useEffect)(()=>()=>window.clearTimeout(r.current),[]),{copyCode:o,isCopied:t}}();return(0,r.jsx)(l.A,{"aria-label":n?(0,s.T)({id:"theme.CodeBlock.copied",message:"Copied",description:"The copied button label on code blocks"}):(0,s.T)({id:"theme.CodeBlock.copyButtonAriaLabel",message:"Copy code to clipboard",description:"The ARIA label for copy code blocks button"}),title:(0,s.T)({id:"theme.CodeBlock.copy",message:"Copy",description:"The copy button label on code blocks"}),className:(0,o.A)(e,d.A.copyButton,n&&d.A.copyButtonCopied),onClick:t,children:(0,r.jsxs)("span",{className:d.A.copyButtonIcons,"aria-hidden":"true",children:[(0,r.jsx)(c.A,{className:d.A.copyButtonIcon}),(0,r.jsx)(u.A,{className:d.A.copyButtonSuccessIcon})]})})}},90644:function(e,t,n){n.d(t,{A:()=>u});var r=n(74848);n(96540);var a=n(11118),o=n(33977),s=n(47466),i=n(14992),l=n(22993),c=n(143);function u({className:e}){let{wordWrap:t}=(0,s.Ph)();if(!(t.isEnabled||t.isCodeScrollable))return!1;let n=(0,o.T)({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.A,{onClick:()=>t.toggle(),className:(0,a.A)(e,t.isEnabled&&c.A.wordWrapButtonEnabled),"aria-label":n,title:n,children:(0,r.jsx)(l.A,{className:c.A.wordWrapButtonIcon,"aria-hidden":"true"})})}},22207:function(e,t,n){n.d(t,{A:()=>c});var r=n(74848);n(96540);var a=n(11118),o=n(74253),s=n(46221),i=n(90644),l=n(75864);function c({className:e}){return(0,r.jsx)(o.A,{children:()=>(0,r.jsxs)("div",{className:(0,a.A)(e,l.A.buttonGroup),children:[(0,r.jsx)(i.A,{}),(0,r.jsx)(s.A,{})]})})}},78209:function(e,t,n){n.d(t,{A:()=>c});var r=n(74848);n(96540);var a=n(11118),o=n(2933),s=n(85208),i=n(47466),l=n(37322);function c({as:e,...t}){let n=(0,o.A)(),c=(0,i.M$)(n);return(0,r.jsx)(e,{...t,style:c,className:(0,a.A)(t.className,l.A.codeBlockContainer,s.G.common.codeBlock)})}},52779:function(e,t,n){n.d(t,{A:()=>i});var r=n(74848);n(96540);var a=n(11118),o=n(78209),s=n(81772);function i({children:e,className:t}){return(0,r.jsx)(o.A,{as:"pre",tabIndex:0,className:(0,a.A)(s.A.codeBlockStandalone,"thin-scrollbar",t),children:(0,r.jsx)("code",{className:s.A.codeBlockLines,children:e})})}},15318:function(e,t,n){n.d(t,{A:()=>l});var r=n(74848);n(96540);var a=n(60191),o=n(47466),s=n(38542),i=n(57940);function l(e){let t=function(e){let{prism:t}=(0,a.p)();return(0,o.mU)({code:e.children,className:e.className,metastring:e.metastring,magicComments:t.magicComments,defaultLanguage:t.defaultLanguage,language:e.language,title:e.title,showLineNumbers:e.showLineNumbers})}(e),n=(0,s.f)();return(0,r.jsx)(o.l8,{metadata:t,wordWrap:n,children:(0,r.jsx)(i.A,{})})}},31415:function(e,t,n){n.d(t,{A:()=>h});var r=n(74848),a=n(96540),o=n(11118),s=n(47466),i=n(2933),l=n(57767),c=n(4520),u=n(81772);let d=a.forwardRef((e,t)=>(0,r.jsx)("pre",{ref:t,tabIndex:0,...e,className:(0,o.A)(e.className,u.A.codeBlock,"thin-scrollbar")}));function g(e){let{metadata:t}=(0,s.Ph)();return(0,r.jsx)("code",{...e,className:(0,o.A)(e.className,u.A.codeBlockLines,void 0!==t.lineNumbersStart&&u.A.codeBlockLinesWithNumbering),style:{...e.style,counterReset:void 0===t.lineNumbersStart?void 0:`line-count ${t.lineNumbersStart-1}`}})}function h({className:e}){let{metadata:t,wordWrap:n}=(0,s.Ph)(),a=(0,i.A)(),{code:u,language:h,lineNumbersStart:p,lineClassNames:f}=t;return(0,r.jsx)(l.f4,{theme:a,code:u,language:h,children:({className:t,style:a,tokens:s,getLineProps:i,getTokenProps:l})=>(0,r.jsx)(d,{ref:n.codeBlockRef,className:(0,o.A)(e,t),style:a,children:(0,r.jsx)(g,{children:s.map((e,t)=>(0,r.jsx)(c.A,{line:e,getLineProps:i,getTokenProps:l,classNames:f[t],showLineNumbers:void 0!==p},t))})})})}},57940:function(e,t,n){n.d(t,{A:()=>d});var r=n(74848);n(96540);var a=n(11118),o=n(47466),s=n(78209),i=n(11684),l=n(31415),c=n(22207),u=n(73215);function d({className:e}){let{metadata:t}=(0,o.Ph)();return(0,r.jsxs)(s.A,{as:"div",className:(0,a.A)(e,t.className),children:[t.title&&(0,r.jsx)("div",{className:u.A.codeBlockTitle,children:(0,r.jsx)(i.A,{children:t.title})}),(0,r.jsxs)("div",{className:u.A.codeBlockContent,children:[(0,r.jsx)(l.A,{}),(0,r.jsx)(c.A,{})]})]})}},80510:function(e,t,n){n.d(t,{A:()=>a});var r=n(74848);function a({line:e,token:t,...n}){return(0,r.jsx)("span",{...n})}n(96540)},4520:function(e,t,n){n.d(t,{A:()=>l});var r=n(74848);n(96540);var a=n(11118),o=n(80510),s=n(631);function i(){return(0,r.jsx)("br",{})}function l({line:e,classNames:t,showLineNumbers:n,getLineProps:l,getTokenProps:c}){let u,d=(u=1===e.length&&"\n"===e[0].content?e[0]:void 0)?[{...u,content:""}]:e,g=l({line:d,className:(0,a.A)(t,n&&s.A.codeLine)}),h=d.map((e,t)=>{let n=c({token:e});return(0,r.jsx)(o.A,{...n,line:d,token:e,children:n.children},t)});return(0,r.jsxs)("div",{...g,children:[n?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("span",{className:s.A.codeLineNumber}),(0,r.jsx)("span",{className:s.A.codeLineContent,children:h})]}):h,(0,r.jsx)(i,{})]})}},11684:function(e,t,n){n.d(t,{A:()=>r});function r({children:e}){return e}},26473:function(e,t,n){n.d(t,{A:()=>l});var r=n(74848),a=n(96540),o=n(30926),s=n(52779),i=n(15318);function l({children:e,...t}){let n=(0,o.A)(),l=a.Children.toArray(e).some(e=>(0,a.isValidElement)(e))?e:Array.isArray(e)?e.join(""):e,c="string"==typeof l?i.A:s.A;return(0,r.jsx)(c,{...t,children:l},String(n))}},11912:function(e,t,n){n.d(t,{A:()=>a});var r=n(74848);function a(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"})})}n(96540)},32732:function(e,t,n){n.d(t,{A:()=>a});var r=n(74848);function a(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"})})}n(96540)},22993:function(e,t,n){n.d(t,{A:()=>a});var r=n(74848);function a(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"})})}n(96540)},13899:function(e,t,n){n.d(t,{A:()=>s});var r=n(74848);n(96540);var a=n(11118),o=n(41452);function s({children:e,hidden:t,className:n}){return(0,r.jsx)("div",{role:"tabpanel",className:(0,a.A)(o.A.tabItem,n),hidden:t,children:e})}},14729:function(e,t,n){n.d(t,{A:()=>p});var r=n(74848),a=n(96540),o=n(11118),s=n(85208),i=n(31191),l=n(17060),c=n(30926),u=n(18416);function d({className:e,block:t,selectedValue:n,selectValue:a,tabValues:s}){let l=[],{blockElementScrollPositionUntilNextRender:c}=(0,i.a_)(),d=e=>{let t=e.currentTarget,r=s[l.indexOf(t)].value;r!==n&&(c(t),a(r))},g=e=>{let t=null;switch(e.key){case"Enter":d(e);break;case"ArrowRight":{let n=l.indexOf(e.currentTarget)+1;t=l[n]??l[0];break}case"ArrowLeft":{let n=l.indexOf(e.currentTarget)-1;t=l[n]??l[l.length-1]}}t?.focus()};return(0,r.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,o.A)("tabs",{"tabs--block":t},e),children:s.map(({value:e,label:t,attributes:a})=>(0,r.jsx)("li",{role:"tab",tabIndex:n===e?0:-1,"aria-selected":n===e,ref:e=>{l.push(e)},onKeyDown:g,onClick:d,...a,className:(0,o.A)("tabs__item",u.A.tabItem,a?.className,{"tabs__item--active":n===e}),children:t??e},e))})}function g({lazy:e,children:t,selectedValue:n}){let s=(Array.isArray(t)?t:[t]).filter(Boolean);if(e){let e=s.find(e=>e.props.value===n);return e?(0,a.cloneElement)(e,{className:(0,o.A)("margin-top--md",e.props.className)}):null}return(0,r.jsx)("div",{className:"margin-top--md",children:s.map((e,t)=>(0,a.cloneElement)(e,{key:t,hidden:e.props.value!==n}))})}function h(e){let t=(0,l.u)(e);return(0,r.jsxs)("div",{className:(0,o.A)(s.G.tabs.container,"tabs-container",u.A.tabList),children:[(0,r.jsx)(d,{...t,...e}),(0,r.jsx)(g,{...t,...e})]})}function p(e){let t=(0,c.A)();return(0,r.jsx)(h,{...e,children:(0,l.v)(e.children)},String(t))}},38542:function(e,t,n){n.d(t,{f:()=>o});var r=n(96540),a=n(93802);function o(){let[e,t]=(0,r.useState)(!1),[n,o]=(0,r.useState)(!1),s=(0,r.useRef)(null),i=(0,r.useCallback)(()=>{let n=s.current.querySelector("code");e?n.removeAttribute("style"):(n.style.whiteSpace="pre-wrap",n.style.overflowWrap="anywhere"),t(e=>!e)},[s,e]),l=(0,r.useCallback)(()=>{let{scrollWidth:e,clientWidth:t}=s.current;o(e>t||s.current.querySelector("code").hasAttribute("style"))},[s]);return!function(e,t){let[n,o]=(0,r.useState)(),s=(0,r.useCallback)(()=>{o(e.current?.closest("[role=tabpanel][hidden]"))},[e,o]);(0,r.useEffect)(()=>{s()},[s]),(0,a.P)(n,e=>{e.forEach(e=>{"attributes"===e.type&&"hidden"===e.attributeName&&(t(),s())})},{attributes:!0,characterData:!1,childList:!1,subtree:!1})}(s,l),(0,r.useEffect)(()=>{l()},[e,l]),(0,r.useEffect)(()=>(window.addEventListener("resize",l,{passive:!0}),()=>{window.removeEventListener("resize",l)}),[l]),{codeBlockRef:s,isEnabled:e,isCodeScrollable:n,toggle:i}}},93802:function(e,t,n){n.d(t,{P:()=>s});var r=n(96540),a=n(28413);let o={attributes:!0,characterData:!0,childList:!0,subtree:!0};function s(e,t,n=o){let i=(0,a._q)(t),l=(0,a.Be)(n);(0,r.useEffect)(()=>{let t=new MutationObserver(i);return e&&t.observe(e,l),()=>t.disconnect()},[e,i,l])}},2933:function(e,t,n){n.d(t,{A:()=>o});var r=n(51696),a=n(60191);function o(){let{prism:e}=(0,a.p)(),{colorMode:t}=(0,r.G)(),n=e.theme,o=e.darkTheme||n;return"dark"===t?o:n}},47466:function(e,t,n){n.d(t,{M$:()=>m,Ph:()=>j,l8:()=>x,mU:()=>f});var r=n(74848),a=n(96540),o=n(11118),s=n(19934),i=n.n(s),l=n(28413);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"}},g={...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:""}},h=Object.keys(d);function p(e,t){let n=e.map(e=>{let{start:n,end:r}=g[e];return`(?:${n}\\s*(${t.flatMap(e=>[e.line,e.block?.start,e.block?.end].filter(Boolean)).join("|")})\\s*${r})`}).join("|");return RegExp(`^\\s*(?:${n})\\s*$`)}function f(e){var t,n,r,a,s;let l,d=(n=(t={language:e.language,defaultLanguage:e.defaultLanguage,className:e.className}).language??function(e){if(!e)return;let t=e.split(" ").find(e=>e.startsWith("language-"));return t?.replace(/language-/,"")}(t.className)??t.defaultLanguage,n?.toLowerCase()??"text"),{lineClassNames:g,code:f}=(r=e.code,a={metastring:e.metastring,magicComments:e.magicComments,language:d},function(e,{metastring:t,magicComments:n}){if(t&&u.test(t)){let r=t.match(u).groups.range;if(0===n.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 a=n[0].className;return{lineClassNames:Object.fromEntries(i()(r).filter(e=>e>0).map(e=>[e-1,[a]])),code:e}}return null}(l=r.replace(/\r?\n$/,""),{...a})??function(e,t){let{language:n,magicComments:r}=t;if(void 0===n)return{lineClassNames:{},code:e};let a=function(e,t){switch(e){case"js":case"javascript":case"ts":case"typescript":return p(["js","jsBlock"],t);case"jsx":case"tsx":return p(["js","jsBlock","jsx"],t);case"html":return p(["js","jsBlock","html"],t);case"python":case"py":case"bash":return p(["bash"],t);case"markdown":case"md":return p(["html","jsx","bash"],t);case"tex":case"latex":case"matlab":return p(["tex"],t);case"lua":case"haskell":return p(["lua"],t);case"sql":return p(["lua","jsBlock"],t);case"wasm":return p(["wasm"],t);case"vb":case"vba":case"visual-basic":return p(["vb","rem"],t);case"vbnet":return p(["vbnet","rem"],t);case"batch":return p(["rem"],t);case"basic":return p(["rem","f90"],t);case"fsharp":return p(["js","ml"],t);case"ocaml":case"sml":return p(["ml"],t);case"fortran":return p(["f90"],t);case"cobol":return p(["cobol"],t);default:return p(h,t)}}(n,r),o=e.split(/\r?\n/),s=Object.fromEntries(r.map(e=>[e.className,{start:0,range:""}])),l=Object.fromEntries(r.filter(e=>e.line).map(({className:e,line:t})=>[t,e])),c=Object.fromEntries(r.filter(e=>e.block).map(({className:e,block:t})=>[t.start,e])),u=Object.fromEntries(r.filter(e=>e.block).map(({className:e,block:t})=>[t.end,e]));for(let e=0;e<o.length;){let t=o[e].match(a);if(!t){e+=1;continue}let n=t.slice(1).find(e=>void 0!==e);l[n]?s[l[n]].range+=`${e},`:c[n]?s[c[n]].start=e:u[n]&&(s[u[n]].range+=`${s[u[n]].start}-${e-1},`),o.splice(e,1)}let d={};return Object.entries(s).forEach(([e,{range:t}])=>{i()(t).forEach(t=>{d[t]??=[],d[t].push(e)})}),{code:o.join("\n"),lineClassNames:d}}(l,{...a})),m=function({className:e,language:t}){return(0,o.A)(e,t&&!e?.includes(`language-${t}`)&&`language-${t}`)}({className:e.className,language:d}),b=(s=e.metastring,(s?.match(c)?.groups.title??"")||e.title),x=function({showLineNumbers:e,metastring:t}){if("boolean"==typeof e)return e?1:void 0;if("number"==typeof e)return e;let n=t?.split(" ").find(e=>e.startsWith("showLineNumbers"));if(n)return n.startsWith("showLineNumbers=")?parseInt(n.replace("showLineNumbers=",""),10):1}({showLineNumbers:e.showLineNumbers,metastring:e.metastring});return{codeInput:e.code,code:f,className:m,language:d,title:b,lineNumbersStart:x,lineClassNames:g}}function m(e){let t={color:"--prism-color",backgroundColor:"--prism-background-color"},n={};return Object.entries(e.plain).forEach(([e,r])=>{let a=t[e];a&&"string"==typeof r&&(n[a]=r)}),n}let b=(0,a.createContext)(null);function x({metadata:e,wordWrap:t,children:n}){let o=(0,a.useMemo)(()=>({metadata:e,wordWrap:t}),[e,t]);return(0,r.jsx)(b.Provider,{value:o,children:n})}function j(){let e=(0,a.useContext)(b);if(null===e)throw new l.dV("CodeBlockContextProvider");return e}},17060:function(e,t,n){n.d(t,{u:()=>d,v:()=>c});var r=n(96540),a=n(49519),o=n(57190),s=n(11864),i=n(84329),l=n(34123);function c(e){return r.Children.toArray(e).filter(e=>"\n"!==e).map(e=>{if(!e||(0,r.isValidElement)(e)&&function(e){let{props:t}=e;return!!t&&"object"==typeof t&&"value"in t}(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({value:e,tabValues:t}){return t.some(t=>t.value===e)}function d(e){let t,{defaultValue:n,queryString:d=!1,groupId:g}=e,h=function(e){let{values:t,children:n}=e;return(0,r.useMemo)(()=>{let e=t??c(n).map(({props:{value:e,label:t,attributes:n,default:r}})=>({value:e,label:t,attributes:n,default:r})),r=(0,i.XI)(e,(e,t)=>e.value===t.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},[t,n])}(e),[p,f]=(0,r.useState)(()=>(function({defaultValue:e,tabValues:t}){if(0===t.length)throw Error("Docusaurus error: the <Tabs> component requires at least one <TabItem> children component");if(e){if(!u({value:e,tabValues:t}))throw Error(`Docusaurus error: The <Tabs> has a defaultValue "${e}" 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 e}let n=t.find(e=>e.default)??t[0];if(!n)throw Error("Unexpected error: 0 tabValues");return n.value})({defaultValue:n,tabValues:h})),[m,b]=function({queryString:e=!1,groupId:t}){let n=(0,a.W6)(),o=function({queryString:e=!1,groupId:t}){if("string"==typeof e)return e;if(!1===e)return null;if(!0===e&&!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:e,groupId:t});return[(0,s.aZ)(o),(0,r.useCallback)(e=>{if(!o)return;let t=new URLSearchParams(n.location.search);t.set(o,e),n.replace({...n.location,search:t.toString()})},[o,n])]}({queryString:d,groupId:g}),[x,j]=function({groupId:e}){let t=e?`docusaurus.tab.${e}`:null,[n,a]=(0,l.Dv)(t);return[n,(0,r.useCallback)(e=>{t&&a.set(e)},[t,a])]}({groupId:g}),A=u({value:t=m??x,tabValues:h})?t:null;return(0,o.A)(()=>{A&&f(A)},[A]),{selectedValue:p,selectValue:(0,r.useCallback)(e=>{if(!u({value:e,tabValues:h}))throw Error(`Can't select invalid tab value=${e}`);f(e),b(e),j(e)},[b,j,h]),tabValues:h}}},78020:function(e,t,n){n.d(t,{A:()=>s});var r=n(74848);n(96540);var a=n(26473),o=n(18738);function s(e){return e.live?(0,r.jsx)(o.A,{...e}):(0,r.jsx)(a.A,{...e})}},18738:function(e,t,n){n.d(t,{A:()=>s});var r=n(74848);n(96540);var a=n(8607),o=n(92883);function s(e){return(0,r.jsx)(a.A,{scope:o.A,...e})}},151:function(e,t,n){n.d(t,{A:()=>o});var r=n(74848);n(96540);var a=n(85120);function o({children:e}){return(0,r.jsx)("div",{className:a.A.playgroundContainer,children:e})}},50045:function(e,t,n){n.d(t,{A:()=>c});var r=n(74848);n(96540);var a=n(370),o=n(30926),s=n(33977),i=n(98673),l=n(19304);function c(){let e=(0,o.A)();return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(i.A,{children:(0,r.jsx)(s.A,{id:"theme.Playground.liveEditor",description:"The live editor label of the live codeblocks",children:"Live Editor"})}),(0,r.jsx)(a.w,{className:l.A.playgroundEditor},String(e))]})}},98673:function(e,t,n){n.d(t,{A:()=>s});var r=n(74848);n(96540);var a=n(11118),o=n(79820);function s({children:e}){return(0,r.jsx)("div",{className:(0,a.A)(o.A.playgroundHeader),children:e})}},89142:function(e,t,n){n.d(t,{A:()=>i});var r=n(74848);n(96540);var a=n(60191),o=n(89344),s=n(50045);function i(){let{playgroundPosition:e}=(0,a.p)().liveCodeBlock;return(0,r.jsx)(r.Fragment,{children:"top"===e?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(o.A,{}),(0,r.jsx)(s.A,{})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(s.A,{}),(0,r.jsx)(o.A,{})]})})}},89344:function(e,t,n){n.d(t,{A:()=>h});var r=n(74848);n(96540);var a=n(370),o=n(74253),s=n(65840),i=n(78339),l=n(33977),c=n(98673),u=n(60477);function d(){return(0,r.jsx)("div",{children:"Loading..."})}function g(){return(0,r.jsx)(o.A,{fallback:(0,r.jsx)(d,{}),children:()=>(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(i.A,{fallback:e=>(0,r.jsx)(s.MN,{...e}),children:(0,r.jsx)(a.pA,{})}),(0,r.jsx)(a.p1,{})]})})}function h(){return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(c.A,{children:(0,r.jsx)(l.A,{id:"theme.Playground.result",description:"The result label of the live codeblocks",children:"Result"})}),(0,r.jsx)("div",{className:u.A.playgroundPreview,children:(0,r.jsx)(g,{})})]})}},65593:function(e,t,n){n.d(t,{A:()=>i});var r=n(74848);n(96540);var a=n(370),o=n(2933);let s=e=>`${e};`;function i({code:e,children:t,...n}){let i=(0,o.A)(),l=n.metastring?.includes("noInline")??!1;return(0,r.jsx)(a.Q,{noInline:l,theme:i,...n,code:e?.replace(/\n$/,""),transformCode:n.transformCode??s,children:t})}},8607:function(e,t,n){n.d(t,{A:()=>i});var r=n(74848);n(96540);var a=n(65593),o=n(151),s=n(89142);function i({children:e,transformCode:t,...n}){return(0,r.jsx)(o.A,{children:(0,r.jsx)(a.A,{code:e,...n,children:(0,r.jsx)(s.A,{})})})}},74253:function(e,t,n){n.d(t,{A:()=>o});var r=n(74848);n(96540);var a=n(30926);function o({children:e,fallback:t}){return(0,a.A)()?(0,r.jsx)(r.Fragment,{children:e?.()}):t??null}},6125:function(e,t,n){n.d(t,{A:()=>c});var r=n(74848),a=n(96540),o=n(79024),s=n(49519),i=n(11344);let l=a.forwardRef(function({name:e,children:t},n){let i=function(e){let t=e;for(;(0,a.isValidElement)(t);)[t]=a.Children.toArray(t.props.children);if("string"!=typeof t)throw Error(`Could not extract APITable row name from JSX tree:
|
|
${JSON.stringify(e,null,2)}`);return t}(t),l=e?`${e}-${i}`:i,c=`#${l}`,u=(0,s.W6)();return(0,o.A)().collectAnchor(l),(0,r.jsx)("tr",{id:l,tabIndex:0,ref:u.location.hash===c?n:void 0,onClick:e=>{let t="TD"===e.target.tagName.toUpperCase(),n=!!window.getSelection()?.toString();t&&!n&&u.push(c)},onKeyDown:e=>{"Enter"===e.key&&u.push(c)},children:t.props.children})});function c({children:e,name:t}){if("table"!==e.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[n,o]=a.Children.toArray(e.props.children),s=(0,a.useRef)(null);(0,a.useEffect)(()=>{s.current?.focus()},[s]);let c=a.Children.map(o.props.children,e=>(0,r.jsx)(l,{name:t,ref:s,children:e}));return(0,r.jsxs)("table",{className:i.A.apiTable,children:[n,(0,r.jsx)("tbody",{children:c})]})}},63402:function(e,t,n){let r;n.d(t,{A:()=>d});var a=n(74848);n(96540);var o=n(55831),s=n(86151),i=n(33977),l=n(14729),c=n(13899),u=n(70590);function d({code:e,pluginName:t,presetOptionName:n}){let d=(0,s.ir)(r).path;return(0,a.jsxs)(l.A,{groupId:"api-config-ex",children:[(0,a.jsxs)(c.A,{value:"preset",label:(0,i.T)({message:"Preset options"}),children:[(0,a.jsx)("p",{children:(0,a.jsx)(i.A,{id:"apiDocs.configTabs.presetOptions.description",values:{presetLink:(0,a.jsx)(o.A,{to:`${d}/using-plugins#docusauruspreset-classic`,children:(0,a.jsx)(i.A,{children:"preset options"})})},children:"If you use a preset, configure this plugin through the {presetLink}:"})}),(0,a.jsx)(u.A,{language:"js",title:"docusaurus.config.js",children:`module.exports = {
|
|
presets: [
|
|
[
|
|
'@docusaurus/preset-classic',
|
|
{
|
|
// highlight-start
|
|
${n}: ${e.replace(/\n/g,"\n ")},
|
|
// highlight-end
|
|
},
|
|
],
|
|
],
|
|
};`})]}),(0,a.jsxs)(c.A,{value:"plugin",label:(0,i.T)({message:"Plugin options"}),children:[(0,a.jsx)("p",{children:(0,a.jsx)(i.A,{children:"If you are using a standalone plugin, provide options directly to the plugin:"})}),(0,a.jsx)(u.A,{language:"js",title:"docusaurus.config.js",children:`module.exports = {
|
|
plugins: [
|
|
[
|
|
'${t}',
|
|
// highlight-start
|
|
${e.replace(/\n/g,"\n ")},
|
|
// highlight-end
|
|
],
|
|
],
|
|
};`})]})]})}},70590:function(e,t,n){n.d(t,{A:()=>o});var r=n(74848);n(96540);var a=n(78020);function o(e){return(0,r.jsx)(a.A,{...e})}},93721:function(e,t,n){n.r(t),n.d(t,{ButtonExample:()=>a});var r=n(74848);function a(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}})}n(96540)},92883:function(e,t,n){n.d(t,{A:()=>o});var r=n(96540),a=n(93721);let o={React:r,...r,...a}},35687:function(e){e.exports=JSON.parse('{"id":"api/plugins/plugin-google-gtag","title":"\u{1F4E6} 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":"dependabot[bot]","lastUpdatedAt":1764857819000,"sidebarPosition":7,"frontMatter":{"sidebar_position":7,"slug":"/api/plugins/@docusaurus/plugin-google-gtag"},"sidebar":"api","previous":{"title":"\u{1F4E6} plugin-google-analytics","permalink":"/docs/api/plugins/@docusaurus/plugin-google-analytics"},"next":{"title":"\u{1F4E6} plugin-rsdoctor","permalink":"/docs/api/plugins/@docusaurus/plugin-rsdoctor"}}')}}]); |