mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-03 20:27:20 +02:00
1 line
No EOL
52 KiB
JavaScript
1 line
No EOL
52 KiB
JavaScript
"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([["5584"],{36604:function(e,n,t){t.d(n,{Z:function(){return r}});let r=t.p+"assets/images/pwa_install-169e763a3e99bb01e41be11c1a4af51f.gif"},81536:function(e,n,t){t.d(n,{Z:function(){return r}});let r=t.p+"assets/images/pwa_reload-6af462b35d0ed752c44ad0899559bedf.gif"},23917:function(e,n,t){t.r(n),t.d(n,{metadata:()=>r,contentTitle:()=>u,default:()=>h,assets:()=>d,toc:()=>p,frontMatter:()=>c});var r=JSON.parse('{"id":"api/plugins/plugin-pwa","title":"\uD83D\uDCE6 plugin-pwa","description":"Docusaurus Plugin to add PWA support using Workbox. This plugin generates a Service Worker in production build only, and allows you to create fully PWA-compliant documentation site with offline and installation support.","source":"@site/docs/api/plugins/plugin-pwa.mdx","sourceDirName":"api/plugins","slug":"/api/plugins/@docusaurus/plugin-pwa","permalink":"/docs/api/plugins/@docusaurus/plugin-pwa","draft":false,"unlisted":false,"editUrl":"https://github.com/facebook/docusaurus/edit/main/website/docs/api/plugins/plugin-pwa.mdx","tags":[],"version":"current","lastUpdatedBy":"S\xe9bastien Lorber","lastUpdatedAt":1729166052000,"sidebarPosition":9,"frontMatter":{"sidebar_position":9,"slug":"/api/plugins/@docusaurus/plugin-pwa"},"sidebar":"api","previous":{"title":"\uD83D\uDCE6 plugin-ideal-image","permalink":"/docs/api/plugins/@docusaurus/plugin-ideal-image"},"next":{"title":"\uD83D\uDCE6 plugin-sitemap","permalink":"/docs/api/plugins/@docusaurus/plugin-sitemap"}}'),o=t("24246"),i=t("80980"),a=t("15398"),s=t("58636"),l=t("95998");let c={sidebar_position:9,slug:"/api/plugins/@docusaurus/plugin-pwa"},u="\uD83D\uDCE6 plugin-pwa",d={},p=[{value:"Installation",id:"installation",level:2},{value:"Configuration",id:"configuration",level:2},{value:"Progressive Web App",id:"progressive-web-app",level:2},{value:"App installation support",id:"app-installation-support",level:2},{value:"Offline mode (precaching)",id:"offline-mode-precaching",level:2},{value:"Options",id:"options",level:2},{value:"<code>debug</code>",id:"debug",level:3},{value:"<code>offlineModeActivationStrategies</code>",id:"offlinemodeactivationstrategies",level:3},{value:"<code>injectManifestConfig</code>",id:"injectmanifestconfig",level:3},{value:"<code>pwaHead</code>",id:"pwahead",level:3},{value:"<code>swCustom</code>",id:"swcustom",level:3},{value:"<code>swRegister</code>",id:"swregister",level:3},{value:"Manifest example",id:"manifest-example",level:2},{value:"Customizing reload popup",id:"customizing-reload-popup",level:2}];function f(e){let n={a:"a",admonition:"admonition",blockquote:"blockquote",code:"code",h1:"h1",h2:"h2",h3:"h3",header:"header",img:"img",li:"li",p:"p",pre:"pre",ul:"ul",...(0,i.a)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(n.header,{children:(0,o.jsx)(n.h1,{id:"-plugin-pwa",children:"\uD83D\uDCE6 plugin-pwa"})}),"\n",(0,o.jsxs)(n.p,{children:["Docusaurus Plugin to add PWA support using ",(0,o.jsx)(n.a,{href:"https://developers.google.com/web/tools/workbox",children:"Workbox"}),". This plugin generates a ",(0,o.jsx)(n.a,{href:"https://developers.google.com/web/fundamentals/primers/service-workers",children:"Service Worker"})," in production build only, and allows you to create fully PWA-compliant documentation site with offline and installation support."]}),"\n",(0,o.jsx)(n.h2,{id:"installation",children:"Installation"}),"\n",(0,o.jsxs)(a.Z,{groupId:"npm2yarn",children:[(0,o.jsx)(s.Z,{value:"npm",children:(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-bash",children:"npm install --save @docusaurus/plugin-pwa\n"})})}),(0,o.jsx)(s.Z,{value:"yarn",label:"Yarn",children:(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-bash",children:"yarn add @docusaurus/plugin-pwa\n"})})}),(0,o.jsx)(s.Z,{value:"pnpm",label:"pnpm",children:(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-bash",children:"pnpm add @docusaurus/plugin-pwa\n"})})})]}),"\n",(0,o.jsx)(n.h2,{id:"configuration",children:"Configuration"}),"\n",(0,o.jsxs)(n.p,{children:["Create a ",(0,o.jsx)(n.a,{href:"https://web.dev/add-manifest/",children:"PWA manifest"})," at ",(0,o.jsx)(n.code,{children:"./static/manifest.json"}),"."]}),"\n",(0,o.jsxs)(n.p,{children:["Modify ",(0,o.jsx)(n.code,{children:"docusaurus.config.js"})," with a minimal PWA config, like:"]}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-js",metastring:'title="docusaurus.config.js"',children:"export default {\n plugins: [\n [\n '@docusaurus/plugin-pwa',\n {\n debug: true,\n offlineModeActivationStrategies: [\n 'appInstalled',\n 'standalone',\n 'queryString',\n ],\n pwaHead: [\n {\n tagName: 'link',\n rel: 'icon',\n href: '/img/docusaurus.png',\n },\n {\n tagName: 'link',\n rel: 'manifest',\n href: '/manifest.json', // your PWA manifest\n },\n {\n tagName: 'meta',\n name: 'theme-color',\n content: 'rgb(37, 194, 160)',\n },\n ],\n },\n ],\n ],\n};\n"})}),"\n",(0,o.jsx)(n.h2,{id:"progressive-web-app",children:"Progressive Web App"}),"\n",(0,o.jsxs)(n.p,{children:["Having a service worker installed is not enough to make your application a PWA. You'll need to at least include a ",(0,o.jsx)(n.a,{href:"https://developer.mozilla.org/en-US/docs/Web/Manifest",children:"Web App Manifest"})," and have the correct tags in ",(0,o.jsx)(n.code,{children:"<head>"})," (",(0,o.jsx)(n.a,{href:"#pwahead",children:"Options > pwaHead"}),")."]}),"\n",(0,o.jsxs)(n.p,{children:["After deployment, you can use ",(0,o.jsx)(n.a,{href:"https://developers.google.com/web/tools/lighthouse",children:"Lighthouse"})," to run an audit on your site."]}),"\n",(0,o.jsxs)(n.p,{children:["For a more exhaustive list of what it takes for your site to be a PWA, refer to the ",(0,o.jsx)(n.a,{href:"https://developers.google.com/web/progressive-web-apps/checklist",children:"PWA Checklist"})]}),"\n",(0,o.jsx)(n.h2,{id:"app-installation-support",children:"App installation support"}),"\n",(0,o.jsx)(n.p,{children:"If your browser supports it, you should be able to install a Docusaurus site as an app."}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.img,{alt:"A screen recording of the installation process. A button appears in the address bar of the browser, which displays a dialog asking "install this application?" when clicked. After clicking the "Install" button, a new application is opened in the operating system, opening to the Docusaurus homepage.",src:t(36604).Z+"",width:"640",height:"505"})}),"\n",(0,o.jsx)(n.admonition,{type:"note",children:(0,o.jsx)(n.p,{children:"App installation requires the HTTPS protocol and a valid manifest."})}),"\n",(0,o.jsx)(n.h2,{id:"offline-mode-precaching",children:"Offline mode (precaching)"}),"\n",(0,o.jsx)(n.p,{children:"We enable users to browse a Docusaurus site offline, by using service-worker precaching."}),"\n",(0,o.jsxs)(n.p,{children:["The ",(0,o.jsx)(n.a,{href:"https://developers.google.com/web/tools/workbox/modules/workbox-precaching",children:"workbox-precaching"})," page explains the idea:"]}),"\n",(0,o.jsxs)(n.blockquote,{children:["\n",(0,o.jsx)(n.p,{children:'One feature of service workers is the ability to save a set of files to the cache when the service worker is installing. This is often referred to as "precaching", since you are caching content ahead of the service worker being used.'}),"\n",(0,o.jsx)(n.p,{children:"The main reason for doing this is that it gives developers control over the cache, meaning they can determine when and how long a file is cached as well as serve it to the browser without going to the network, meaning it can be used to create web apps that work offline."}),"\n",(0,o.jsx)(n.p,{children:"Workbox takes a lot of the heavy lifting out of precaching by simplifying the API and ensuring assets are downloaded efficiently."}),"\n"]}),"\n",(0,o.jsxs)(n.p,{children:["By default, offline mode is enabled when the site is installed as an app. See the ",(0,o.jsx)(n.code,{children:"offlineModeActivationStrategies"})," option for details."]}),"\n",(0,o.jsxs)(n.p,{children:["After the site has been precached, the service worker will serve cached responses for later visits. When a new build is deployed along with a new service worker, the new one will begin installing and eventually move to a waiting state. During this waiting state, a reload popup will show and ask the user to reload the page for new content. Until the user either clears the application cache or clicks the ",(0,o.jsx)(n.code,{children:"reload"})," button on the popup, the service worker will continue serving the old content."]}),"\n",(0,o.jsx)(n.admonition,{type:"warning",children:(0,o.jsx)(n.p,{children:"Offline mode / precaching requires downloading all the static assets of the site ahead of time, and can consume unnecessary bandwidth. It may not be a good idea to activate it for all kind of sites."})}),"\n",(0,o.jsx)(n.h2,{id:"options",children:"Options"}),"\n",(0,o.jsx)(n.h3,{id:"debug",children:(0,o.jsx)(n.code,{children:"debug"})}),"\n",(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsxs)(n.li,{children:["Type: ",(0,o.jsx)(n.code,{children:"boolean"})]}),"\n",(0,o.jsxs)(n.li,{children:["Default: ",(0,o.jsx)(n.code,{children:"false"})]}),"\n"]}),"\n",(0,o.jsx)(n.p,{children:"Turn debug mode on:"}),"\n",(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsx)(n.li,{children:"Workbox logs"}),"\n",(0,o.jsx)(n.li,{children:"Additional Docusaurus logs"}),"\n",(0,o.jsx)(n.li,{children:"Unoptimized SW file output"}),"\n",(0,o.jsx)(n.li,{children:"Source maps"}),"\n"]}),"\n",(0,o.jsx)(n.h3,{id:"offlinemodeactivationstrategies",children:(0,o.jsx)(n.code,{children:"offlineModeActivationStrategies"})}),"\n",(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsxs)(n.li,{children:["Type: ",(0,o.jsx)(n.code,{children:"('appInstalled' | 'mobile' | 'saveData'| 'queryString' | 'always')[]"})]}),"\n",(0,o.jsxs)(n.li,{children:["Default: ",(0,o.jsx)(n.code,{children:"['appInstalled', 'queryString', 'standalone']"})]}),"\n"]}),"\n",(0,o.jsx)(n.p,{children:"Strategies used to turn the offline mode on:"}),"\n",(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsxs)(n.li,{children:[(0,o.jsx)(n.code,{children:"appInstalled"}),": activates for users having installed the site as an app (not 100% reliable)"]}),"\n",(0,o.jsxs)(n.li,{children:[(0,o.jsx)(n.code,{children:"standalone"}),": activates for users running the app as standalone (often the case once a PWA is installed)"]}),"\n",(0,o.jsxs)(n.li,{children:[(0,o.jsx)(n.code,{children:"queryString"}),": activates if queryString contains ",(0,o.jsx)(n.code,{children:"offlineMode=true"})," (convenient for PWA debugging)"]}),"\n",(0,o.jsxs)(n.li,{children:[(0,o.jsx)(n.code,{children:"mobile"}),": activates for mobile users (",(0,o.jsx)(n.code,{children:"width <= 996px"}),")"]}),"\n",(0,o.jsxs)(n.li,{children:[(0,o.jsx)(n.code,{children:"saveData"}),": activates for users with ",(0,o.jsx)(n.code,{children:"navigator.connection.saveData === true"})]}),"\n",(0,o.jsxs)(n.li,{children:[(0,o.jsx)(n.code,{children:"always"}),": activates for all users"]}),"\n"]}),"\n",(0,o.jsx)(n.admonition,{type:"warning",children:(0,o.jsx)(n.p,{children:"Use this carefully: some users may not like to be forced to use the offline mode."})}),"\n",(0,o.jsxs)(n.admonition,{type:"danger",children:[(0,o.jsx)(n.p,{children:"It is not possible to detect if a page is rendered as a PWA in a reliable manner."}),(0,o.jsxs)(n.p,{children:["The ",(0,o.jsx)(n.code,{children:"appinstalled"})," event has been ",(0,o.jsx)(n.a,{href:"https://github.com/w3c/manifest/pull/836",children:"removed from the specification"}),", and the ",(0,o.jsx)(n.a,{href:"https://web.dev/get-installed-related-apps/",children:(0,o.jsx)(n.code,{children:"navigator.getInstalledRelatedApps()"})})," API is only supported in recent Chrome versions and require ",(0,o.jsx)(n.code,{children:"related_applications"})," declared in the manifest."]}),(0,o.jsxs)(n.p,{children:["The ",(0,o.jsxs)(n.a,{href:"https://petelepage.com/blog/2019/07/is-my-pwa-installed/",children:[(0,o.jsx)(n.code,{children:"standalone"})," strategy"]})," is a nice fallback to activate the offline mode (at least when running the installed app)."]})]}),"\n",(0,o.jsx)(n.h3,{id:"injectmanifestconfig",children:(0,o.jsx)(n.code,{children:"injectManifestConfig"})}),"\n",(0,o.jsxs)(n.p,{children:[(0,o.jsx)(n.a,{href:"https://developer.chrome.com/docs/workbox/reference/workbox-build/#type-InjectManifestOptions",children:"Workbox options"})," to pass to ",(0,o.jsx)(n.code,{children:"workbox.injectManifest()"}),". This gives you control over which assets will be precached, and be available offline."]}),"\n",(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsxs)(n.li,{children:["Type: ",(0,o.jsx)(n.code,{children:"InjectManifestOptions"})]}),"\n",(0,o.jsxs)(n.li,{children:["Default: ",(0,o.jsx)(n.code,{children:"{}"})]}),"\n"]}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-js",metastring:'title="docusaurus.config.js"',children:"export default {\n plugins: [\n [\n '@docusaurus/plugin-pwa',\n {\n injectManifestConfig: {\n manifestTransforms: [\n //...\n ],\n modifyURLPrefix: {\n //...\n },\n // We already add regular static assets (HTML, images...) to be available offline\n // You can add more files according to your needs\n globPatterns: ['**/*.{pdf,docx,xlsx}'],\n // ...\n },\n },\n ],\n ],\n};\n"})}),"\n",(0,o.jsx)(n.h3,{id:"pwahead",children:(0,o.jsx)(n.code,{children:"pwaHead"})}),"\n",(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsxs)(n.li,{children:["Type: ",(0,o.jsx)(n.code,{children:"({ tagName: string; [attributeName: string]: string })[]"})]}),"\n",(0,o.jsxs)(n.li,{children:["Default: ",(0,o.jsx)(n.code,{children:"[]"})]}),"\n"]}),"\n",(0,o.jsxs)(n.p,{children:["Array of objects containing ",(0,o.jsx)(n.code,{children:"tagName"})," and key-value pairs for attributes to inject into the ",(0,o.jsx)(n.code,{children:"<head>"})," tag. Technically you can inject any head tag through this, but it's ideally used for tags to make your site PWA compliant. Here's a list of tag to make your app fully compliant:"]}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-js",children:"export default {\n plugins: [\n [\n '@docusaurus/plugin-pwa',\n {\n pwaHead: [\n {\n tagName: 'link',\n rel: 'icon',\n href: '/img/docusaurus.png',\n },\n {\n tagName: 'link',\n rel: 'manifest',\n href: '/manifest.json',\n },\n {\n tagName: 'meta',\n name: 'theme-color',\n content: 'rgb(37, 194, 160)',\n },\n {\n tagName: 'meta',\n name: 'apple-mobile-web-app-capable',\n content: 'yes',\n },\n {\n tagName: 'meta',\n name: 'apple-mobile-web-app-status-bar-style',\n content: '#000',\n },\n {\n tagName: 'link',\n rel: 'apple-touch-icon',\n href: '/img/docusaurus.png',\n },\n {\n tagName: 'link',\n rel: 'mask-icon',\n href: '/img/docusaurus.svg',\n color: 'rgb(37, 194, 160)',\n },\n {\n tagName: 'meta',\n name: 'msapplication-TileImage',\n content: '/img/docusaurus.png',\n },\n {\n tagName: 'meta',\n name: 'msapplication-TileColor',\n content: '#000',\n },\n ],\n },\n ],\n ],\n};\n"})}),"\n",(0,o.jsx)(n.h3,{id:"swcustom",children:(0,o.jsx)(n.code,{children:"swCustom"})}),"\n",(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsxs)(n.li,{children:["Type: ",(0,o.jsx)(n.code,{children:"string | undefined"})]}),"\n",(0,o.jsxs)(n.li,{children:["Default: ",(0,o.jsx)(n.code,{children:"undefined"})]}),"\n"]}),"\n",(0,o.jsx)(n.p,{children:"Useful for additional Workbox rules. You can do whatever a service worker can do here, and use the full power of workbox libraries. The code is transpiled, so you can use modern ES6+ syntax here."}),"\n",(0,o.jsx)(n.p,{children:"For example, to cache files from external routes:"}),"\n",(0,o.jsx)(n.pre,{children:(0,o.jsx)(n.code,{className:"language-js",children:"import {registerRoute} from 'workbox-routing';\nimport {StaleWhileRevalidate} from 'workbox-strategies';\n\n// default fn export receiving some useful params\nexport default function swCustom(params) {\n const {\n debug, // :boolean\n offlineMode, // :boolean\n } = params;\n\n // Cache responses from external resources\n registerRoute((context) => {\n return [\n /graph\\.facebook\\.com\\/.*\\/picture/,\n /netlify\\.com\\/img/,\n /avatars1\\.githubusercontent/,\n ].some((regex) => context.url.href.match(regex));\n }, new StaleWhileRevalidate());\n}\n"})}),"\n",(0,o.jsxs)(n.p,{children:["The module should have a ",(0,o.jsx)(n.code,{children:"default"})," function export, and receives some params."]}),"\n",(0,o.jsx)(n.h3,{id:"swregister",children:(0,o.jsx)(n.code,{children:"swRegister"})}),"\n",(0,o.jsxs)(n.ul,{children:["\n",(0,o.jsxs)(n.li,{children:["Type: ",(0,o.jsx)(n.code,{children:"string | false"})]}),"\n",(0,o.jsxs)(n.li,{children:["Default: ",(0,o.jsx)(n.code,{children:"'docusaurus-plugin-pwa/src/registerSW.js'"})]}),"\n"]}),"\n",(0,o.jsxs)(n.p,{children:["Adds an entry before the Docusaurus app so that registration can happen before the app runs. The default ",(0,o.jsx)(n.code,{children:"registerSW.js"})," file is enough for simple registration."]}),"\n",(0,o.jsxs)(n.p,{children:["Passing ",(0,o.jsx)(n.code,{children:"false"})," will disable registration entirely."]}),"\n",(0,o.jsx)(n.h2,{id:"manifest-example",children:"Manifest example"}),"\n",(0,o.jsx)(n.p,{children:"The Docusaurus site manifest can serve as an inspiration:"}),"\n","\n",(0,o.jsx)(l.Z,{className:"language-json",children:JSON.stringify(t(27105),null,2)}),"\n",(0,o.jsx)(n.h2,{id:"customizing-reload-popup",children:"Customizing reload popup"}),"\n",(0,o.jsxs)(n.p,{children:["The ",(0,o.jsx)(n.code,{children:"@theme/PwaReloadPopup"})," component is rendered when a new service worker is waiting to be installed, and we suggest a reload to the user. You can ",(0,o.jsx)(n.a,{href:"/docs/swizzling",children:"swizzle"})," this component and implement your own UI. It will receive an ",(0,o.jsx)(n.code,{children:"onReload"})," callback as props, which should be called when the ",(0,o.jsx)(n.code,{children:"reload"})," button is clicked. This will tell the service worker to install the waiting service worker and reload the page."]}),"\n",(0,o.jsxs)(n.p,{children:["The default theme includes an implementation for the reload popup and uses ",(0,o.jsx)(n.a,{href:"https://infima.dev/docs/components/alert",children:"Infima Alerts"}),"."]}),"\n",(0,o.jsx)(n.p,{children:(0,o.jsx)(n.img,{alt:"A screen recording of the reload process. An alert box shows in the bottom right of the window, saying "New content available". After clicking the "Refresh" button, the page's main heading changes from "Introduction" to "PWA :))".",src:t(81536).Z+"",width:"1000",height:"502"})}),"\n",(0,o.jsxs)(n.p,{children:["Your component can render ",(0,o.jsx)(n.code,{children:"null"}),", but this is not recommended: users won't have a way to get up-to-date content."]})]})}function h(e={}){let{wrapper:n}={...(0,i.a)(),...e.components};return n?(0,o.jsx)(n,{...e,children:(0,o.jsx)(f,{...e})}):f(e)}},58636:function(e,n,t){t.d(n,{Z:()=>a});var r=t("24246");t("27378");var o=t("90496");let i="tabItem_pnkT";function a(e){var n=e.children,t=e.hidden,a=e.className;return(0,r.jsx)("div",{role:"tabpanel",className:(0,o.Z)(i,a),hidden:t,children:n})}},15398:function(e,n,t){t.d(n,{Z:()=>k});var r=t("24246"),o=t("27378"),i=t("90496"),a=t("54947"),s=t("3620"),l=t("844"),c=t("97486"),u=t("32263"),d=t("16971");function p(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function f(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var t,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,s=!1;try{for(o=o.call(e);!(a=(t=o.next()).done)&&(i.push(t.value),!n||i.length!==n);a=!0);}catch(e){s=!0,r=e}finally{try{!a&&null!=o.return&&o.return()}finally{if(s)throw r}}return i}}(e,n)||function(e,n){if(e){if("string"==typeof e)return p(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return p(e,n)}}(e,n)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function h(e){var n,t;return null!==(t=null===(n=o.Children.toArray(e).filter(function(e){return"\n"!==e}).map(function(e){var n,t;if(!e||(0,o.isValidElement)(e)&&(n=e.props)&&(void 0===n?"undefined":(t=n)&&"undefined"!=typeof Symbol&&t.constructor===Symbol?"symbol":typeof t)=="object"&&"value"in n)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===n?void 0:n.filter(Boolean))&&void 0!==t?t:[]}function b(e){var n=e.value;return e.tabValues.some(function(e){return e.value===n})}var g=t("71607");let m="tabList_Qoir",j="tabItem_AQgk";function y(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.forEach(function(n){var r,o,i;r=e,o=n,i=t[n],o in r?Object.defineProperty(r,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[o]=i})}return e}function v(e,n){return n=null!=n?n:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):(function(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t.push.apply(t,r)}return t})(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}),e}function x(e){var n=e.className,t=e.block,o=e.selectedValue,s=e.selectValue,l=e.tabValues,c=[],u=(0,a.o5)().blockElementScrollPositionUntilNextRender,d=function(e){var n=e.currentTarget,t=l[c.indexOf(n)].value;t!==o&&(u(n),s(t))},p=function(e){var n=null;switch(e.key){case"Enter":d(e);break;case"ArrowRight":var t,r=c.indexOf(e.currentTarget)+1;n=null!==(t=c[r])&&void 0!==t?t:c[0];break;case"ArrowLeft":var o,i=c.indexOf(e.currentTarget)-1;n=null!==(o=c[i])&&void 0!==o?o:c[c.length-1]}null==n||n.focus()};return(0,r.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,i.Z)("tabs",{"tabs--block":t},n),children:l.map(function(e){var n=e.value,t=e.label,a=e.attributes;return(0,r.jsx)("li",v(y({role:"tab",tabIndex:o===n?0:-1,"aria-selected":o===n,ref:function(e){return c.push(e)},onKeyDown:p,onClick:d},a),{className:(0,i.Z)("tabs__item",j,null==a?void 0:a.className,{"tabs__item--active":o===n}),children:null!=t?t:n}),n)})})}function w(e){var n=e.lazy,t=e.children,a=e.selectedValue,s=(Array.isArray(t)?t:[t]).filter(Boolean);if(n){var l=s.find(function(e){return e.props.value===a});return l?(0,o.cloneElement)(l,{className:(0,i.Z)("margin-top--md",l.props.className)}):null}return(0,r.jsx)("div",{className:"margin-top--md",children:s.map(function(e,n){return(0,o.cloneElement)(e,{key:n,hidden:e.props.value!==a})})})}function O(e){var n=function(e){var n,t,r,i,a,p,g,m,j,y,v,x,w,O,k=e.defaultValue,P=e.queryString,S=e.groupId;var N=(t=(n=e).values,r=n.children,(0,o.useMemo)(function(){var e=null!=t?t:h(r).map(function(e){var n=e.props;return{value:n.value,label:n.label,attributes:n.attributes,default:n.default}});return!function(e){var n=(0,u.lx)(e,function(e,n){return e.value===n.value});if(n.length>0)throw Error('Docusaurus error: Duplicate values "'.concat(n.map(function(e){return e.value}).join(", "),'" found in <Tabs>. Every value needs to be unique.'))}(e),e},[t,r])),A=f((0,o.useState)(function(){return function(e){var n,t=e.defaultValue,r=e.tabValues;if(0===r.length)throw Error("Docusaurus error: the <Tabs> component requires at least one <TabItem> children component");if(t){if(!b({value:t,tabValues:r}))throw Error('Docusaurus error: The <Tabs> has a defaultValue "'.concat(t,'" but none of its children has the corresponding value. Available values are: ').concat(r.map(function(e){return e.value}).join(", "),". If you intend to show no default tab, use defaultValue={null} instead."));return t}var o=null!==(n=r.find(function(e){return e.default}))&&void 0!==n?n:r[0];if(!o)throw Error("Unexpected error: 0 tabValues");return o.value}({defaultValue:k,tabValues:N})}),2),E=A[0],D=A[1];var C=f((a=(i={queryString:void 0!==P&&P,groupId:S}).queryString,p=i.groupId,g=(0,s.k6)(),m=function(e){var n=e.queryString,t=void 0!==n&&n,r=e.groupId;if("string"==typeof t)return t;if(!1===t)return null;if(!0===t&&!r)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!=r?r:null}({queryString:void 0!==a&&a,groupId:p}),[(0,c._X)(m),(0,o.useCallback)(function(e){if(!!m){var n,t,r=new URLSearchParams(g.location.search);r.set(m,e),g.replace((n=function(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.forEach(function(n){var r,o,i;r=e,o=n,i=t[n],o in r?Object.defineProperty(r,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[o]=i})}return e}({},g.location),t=(t={search:r.toString()},t),Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):(function(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t.push.apply(t,r)}return t})(Object(t)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(t,e))}),n))}},[m,g])]),2),I=C[0],T=C[1];var B=f((y=(j=({groupId:S}).groupId)?"docusaurus.tab.".concat(j):null,x=(v=f((0,d.Nk)(y),2))[0],w=v[1],[x,(0,o.useCallback)(function(e){if(!!y)w.set(e)},[y,w])]),2),W=B[0],L=B[1];var _=b({value:O=null!=I?I:W,tabValues:N})?O:null;return(0,l.Z)(function(){_&&D(_)},[_]),{selectedValue:E,selectValue:(0,o.useCallback)(function(e){if(!b({value:e,tabValues:N}))throw Error("Can't select invalid tab value=".concat(e));D(e),T(e),L(e)},[T,L,N]),tabValues:N}}(e);return(0,r.jsxs)("div",{className:(0,i.Z)("tabs-container",m),children:[(0,r.jsx)(x,y({},n,e)),(0,r.jsx)(w,y({},n,e))]})}function k(e){var n=(0,g.Z)();return(0,r.jsx)(O,v(y({},e),{children:h(e.children)}),String(n))}},56497:function(e,n,t){t.d(n,{Z:function(){return i}});var r=t(24246);t(27378);var o=t(71607);function i(e){var n=e.children,t=e.fallback;return(0,o.Z)()?(0,r.jsx)(r.Fragment,{children:null==n?void 0:n()}):null!=t?t:null}},95998:function(e,n,t){t.d(n,{Z:()=>em});var r,o,i,a={};t.r(a),t.d(a,{ButtonExample:()=>B});var s=t("24246"),l=t("27378"),c=t("90496"),u=t("71607"),d=t("10075"),p=t("77827"),f=t("8156"),h=t("56497"),b=t("85108"),g=t("45245"),m=t("26378");function j(){var e=(0,m.L)().prism,n=(0,g.I)().colorMode,t=e.theme,r=e.darkTheme||t;return"dark"===n?r:t}var y=t("67490");let v="playgroundContainer_6Ior",x="playgroundHeader_Tvsk",w="playgroundEditor_TySg",O="playgroundPreview_mApW";function k(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.forEach(function(n){var r,o,i;r=e,o=n,i=t[n],o in r?Object.defineProperty(r,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[o]=i})}return e}function P(e){var n=e.children;return(0,s.jsx)("div",{className:(0,c.Z)(x),children:n})}function S(){return(0,s.jsx)("div",{children:"Loading..."})}function N(){return(0,s.jsx)(h.Z,{fallback:(0,s.jsx)(S,{}),children:function(){return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(y.Z,{fallback:function(e){return(0,s.jsx)(b.Ac,k({},e))},children:(0,s.jsx)(d.i5,{})}),(0,s.jsx)(d.IF,{})]})}})}function A(){return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(P,{children:(0,s.jsx)(p.Z,{id:"theme.Playground.result",description:"The result label of the live codeblocks",children:"Result"})}),(0,s.jsx)("div",{className:O,children:(0,s.jsx)(N,{})})]})}function E(){var e=(0,u.Z)();return(0,s.jsx)(d.uz,{className:w},String(e))}function D(){return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(P,{children:(0,s.jsx)(p.Z,{id:"theme.Playground.liveEditor",description:"The live editor label of the live codeblocks",children:"Live Editor"})}),(0,s.jsx)(E,{})]})}var C=function(e){return"".concat(e,";")};function I(e){var n,t,r,o,i=e.children,a=e.transformCode,l=function(e,n){if(null==e)return{};var t,r,o=function(e,n){if(null==e)return{};var t,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)t=i[r],!(n.indexOf(t)>=0)&&(o[t]=e[t]);return o}(e,n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++){if(t=i[r],!(n.indexOf(t)>=0))Object.prototype.propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}}return o}(e,["children","transformCode"]),c=(0,f.Z)().siteConfig.themeConfig.liveCodeBlock.playgroundPosition,u=j(),p=null!==(o=null===(r=l.metastring)||void 0===r?void 0:r.includes("noInline"))&&void 0!==o&&o;return(0,s.jsx)("div",{className:v,children:(0,s.jsx)(d.nu,(n=k({code:null==i?void 0:i.replace(/\n$/,""),noInline:p,transformCode:null!=a?a:C,theme:u},l),t=(t={children:"top"===c?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(A,{}),(0,s.jsx)(D,{})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(D,{}),(0,s.jsx)(A,{})]})},t),Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):(function(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t.push.apply(t,r)}return t})(Object(t)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(t,e))}),n))})}function T(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.forEach(function(n){var r,o,i;r=e,o=n,i=t[n],o in r?Object.defineProperty(r,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[o]=i})}return e}function B(e){var n,t;return(0,s.jsx)("button",(n=T({type:"button"},e),t=(t={style:T({backgroundColor:"white",color:"black",border:"solid red",borderRadius:20,padding:10,cursor:"pointer"},e.style)},t),Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):(function(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t.push.apply(t,r)}return t})(Object(t)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(t,e))}),n))}let W=function(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.forEach(function(n){var r,o,i;r=e,o=n,i=t[n],o in r?Object.defineProperty(r,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[o]=i})}return e}({React:l},l,a);var L=t("55951"),_=t("6324"),q=t.n(_);function Z(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function M(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var t,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,s=!1;try{for(o=o.call(e);!(a=(t=o.next()).done)&&(i.push(t.value),!n||i.length!==n);a=!0);}catch(e){s=!0,r=e}finally{try{!a&&null!=o.return&&o.return()}finally{if(s)throw r}}return i}}(e,n)||function(e,n){if(e){if("string"==typeof e)return Z(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Z(e,n)}}(e,n)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var V=RegExp("title=(?<quote>[\"'])(?<title>.*?)\\1"),z=RegExp("\\{(?<range>[\\d,-]+)\\}"),R={js:{start:"\\/\\/",end:""},jsBlock:{start:"\\/\\*",end:"\\*\\/"},jsx:{start:"\\{\\s*\\/\\*",end:"\\*\\/\\s*\\}"},bash:{start:"#",end:""},html:{start:"\x3c!--",end:"--\x3e"}};var H=(r=function(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.forEach(function(n){var r,o,i;r=e,o=n,i=t[n],o in r?Object.defineProperty(r,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[o]=i})}return e}({},R),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(r,Object.getOwnPropertyDescriptors(o)):(function(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t.push.apply(t,r)}return t})(Object(o)).forEach(function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(o,e))}),r),U=Object.keys(R);function F(e,n){var t=e.map(function(e){var t=H[e],r=t.start,o=t.end;return"(?:".concat(r,"\\s*(").concat(n.flatMap(function(e){var n,t;return[e.line,null===(n=e.block)||void 0===n?void 0:n.start,null===(t=e.block)||void 0===t?void 0:t.end].filter(Boolean)}).join("|"),")\\s*").concat(o,")")}).join("|");return new RegExp("^\\s*(?:".concat(t,")\\s*$"))}let Y="codeBlockContainer_jDV4";function $(e){var n,t,r,o,i=e.as,a=function(e,n){if(null==e)return{};var t,r,o=function(e,n){if(null==e)return{};var t,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)t=i[r],!(n.indexOf(t)>=0)&&(o[t]=e[t]);return o}(e,n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++){if(t=i[r],!(n.indexOf(t)>=0))Object.prototype.propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}}return o}(e,["as"]);var l=(n={color:"--prism-color",backgroundColor:"--prism-background-color"},t={},Object.entries(j().plain).forEach(function(e){var r=M(e,2),o=r[0],i=r[1],a=n[o];a&&"string"==typeof i&&(t[a]=i)}),t);return(0,s.jsx)(i,(r=function(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.forEach(function(n){var r,o,i;r=e,o=n,i=t[n],o in r?Object.defineProperty(r,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[o]=i})}return e}({},a),o=(o={style:l,className:(0,c.Z)(a.className,Y,L.k.common.codeBlock)},o),Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):(function(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t.push.apply(t,r)}return t})(Object(o)).forEach(function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(o,e))}),r))}let G={codeBlockContent:"codeBlockContent_vx7S",codeBlockTitle:"codeBlockTitle_bdru",codeBlock:"codeBlock_Gebt",codeBlockStandalone:"codeBlockStandalone_i_cY",codeBlockLines:"codeBlockLines_FJaf",codeBlockLinesWithNumbering:"codeBlockLinesWithNumbering_FU9Q",buttonGroup:"buttonGroup_cUGO"};function Q(e){var n=e.children,t=e.className;return(0,s.jsx)($,{as:"pre",tabIndex:0,className:(0,c.Z)(G.codeBlockStandalone,"thin-scrollbar",t),children:(0,s.jsx)("code",{className:G.codeBlockLines,children:n})})}var J=t("50923"),X={attributes:!0,characterData:!0,childList:!0,subtree:!0};function K(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function ee(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var t,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,s=!1;try{for(o=o.call(e);!(a=(t=o.next()).done)&&(i.push(t.value),!n||i.length!==n);a=!0);}catch(e){s=!0,r=e}finally{try{!a&&null!=o.return&&o.return()}finally{if(s)throw r}}return i}}(e,n)||function(e,n){if(e){if("string"==typeof e)return K(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return K(e,n)}}(e,n)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var en=t("7316");let et={codeLine:"codeLine_qRmp",codeLineNumber:"codeLineNumber_dS_J",codeLineContent:"codeLineContent_XF5l"};function er(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.forEach(function(n){var r,o,i;r=e,o=n,i=t[n],o in r?Object.defineProperty(r,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[o]=i})}return e}function eo(e){var n,t,r=e.line,o=e.classNames,i=e.showLineNumbers,a=e.getLineProps,l=e.getTokenProps;1===r.length&&"\n"===r[0].content&&(r[0].content="");var u=a({line:r,className:(0,c.Z)(o,i&&et.codeLine)}),d=r.map(function(e,n){return(0,s.jsx)("span",er({},l({token:e})),n)});return(0,s.jsxs)("span",(n=er({},u),t=(t={children:[i?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{className:et.codeLineNumber}),(0,s.jsx)("span",{className:et.codeLineContent,children:d})]}):d,(0,s.jsx)("br",{})]},t),Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):(function(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t.push.apply(t,r)}return t})(Object(t)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(t,e))}),n))}var ei=t("44771");function ea(e){var n,t;return(0,s.jsx)("svg",(n=function(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.forEach(function(n){var r,o,i;r=e,o=n,i=t[n],o in r?Object.defineProperty(r,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[o]=i})}return e}({viewBox:"0 0 24 24"},e),t=(t={children:(0,s.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),Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):(function(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t.push.apply(t,r)}return t})(Object(t)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(t,e))}),n))}function es(e){var n,t;return(0,s.jsx)("svg",(n=function(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.forEach(function(n){var r,o,i;r=e,o=n,i=t[n],o in r?Object.defineProperty(r,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[o]=i})}return e}({viewBox:"0 0 24 24"},e),t=(t={children:(0,s.jsx)("path",{fill:"currentColor",d:"M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"})},t),Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):(function(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t.push.apply(t,r)}return t})(Object(t)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(t,e))}),n))}let el={copyButtonCopied:"copyButtonCopied_OkN_",copyButtonIcons:"copyButtonIcons_OqsO",copyButtonIcon:"copyButtonIcon_PgCn",copyButtonSuccessIcon:"copyButtonSuccessIcon_bsQG"};function ec(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function eu(e){var n,t,r=e.code,o=e.className;var i=(n=(0,l.useState)(!1),t=2,function(e){if(Array.isArray(e))return e}(n)||function(e,n){var t,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,s=!1;try{for(o=o.call(e);!(a=(t=o.next()).done)&&(i.push(t.value),!n||i.length!==n);a=!0);}catch(e){s=!0,r=e}finally{try{!a&&null!=o.return&&o.return()}finally{if(s)throw r}}return i}}(n,2)||function(e,n){if(e){if("string"==typeof e)return ec(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return ec(e,n)}}(n,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.")}()),a=i[0],u=i[1],d=(0,l.useRef)(void 0),f=(0,l.useCallback)(function(){(0,ei.Z)(r),u(!0),d.current=window.setTimeout(function(){u(!1)},1e3)},[r]);return(0,l.useEffect)(function(){return function(){return window.clearTimeout(d.current)}},[]),(0,s.jsx)("button",{type:"button","aria-label":a?(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,c.Z)("clean-btn",o,el.copyButton,a&&el.copyButtonCopied),onClick:f,children:(0,s.jsxs)("span",{className:el.copyButtonIcons,"aria-hidden":"true",children:[(0,s.jsx)(ea,{className:el.copyButtonIcon}),(0,s.jsx)(es,{className:el.copyButtonSuccessIcon})]})})}function ed(e){var n,t;return(0,s.jsx)("svg",(n=function(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.forEach(function(n){var r,o,i;r=e,o=n,i=t[n],o in r?Object.defineProperty(r,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[o]=i})}return e}({viewBox:"0 0 24 24"},e),t=(t={children:(0,s.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),Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):(function(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t.push.apply(t,r)}return t})(Object(t)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(t,e))}),n))}let ep={wordWrapButtonIcon:"wordWrapButtonIcon_MQXS",wordWrapButtonEnabled:"wordWrapButtonEnabled_TBIH"};function ef(e){var n=e.className,t=e.onClick,r=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,s.jsx)("button",{type:"button",onClick:t,className:(0,c.Z)("clean-btn",n,r&&ep.wordWrapButtonEnabled),"aria-label":o,title:o,children:(0,s.jsx)(ed,{className:ep.wordWrapButtonIcon,"aria-hidden":"true"})})}function eh(e){var n,t,r,o,i,a,u,d,p,f,h,b,g,y,v,x,w,O,k,P,S,N,A=e.children,E=e.className,D=void 0===E?"":E,C=e.metastring,I=e.title,T=e.showLineNumbers,B=e.language,W=(0,m.L)().prism,L=W.defaultLanguage,_=W.magicComments;var Z=null==(t=null!==(N=null!=B?B:null==(n=D.split(" ").find(function(e){return e.startsWith("language-")}))?void 0:n.replace(/language-/,""))&&void 0!==N?N:L)?void 0:t.toLowerCase(),R=j();var H=(o=(r=ee((0,l.useState)(!1),2))[0],i=r[1],u=(a=ee((0,l.useState)(!1),2))[0],d=a[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"),i(function(e){return!e})},[p,o]),h=(0,l.useCallback)(function(){var e=p.current;d(e.scrollWidth>e.clientWidth||p.current.querySelector("code").hasAttribute("style"))},[p]),b=p,g=h,v=(y=ee((0,l.useState)(),2))[0],x=y[1],w=(0,l.useCallback)(function(){var e;x(null===(e=b.current)||void 0===e?void 0:e.closest("[role=tabpanel][hidden]"))},[b,x]),(0,l.useEffect)(function(){w()},[w]),function(e,n){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:X,r=(0,J.zX)(n),o=(0,J.Ql)(t);(0,l.useEffect)(function(){var n=new MutationObserver(r);return e&&n.observe(e,o),function(){return n.disconnect()}},[e,r,o])}(v,function(e){e.forEach(function(e){"attributes"===e.type&&"hidden"===e.attributeName&&(g(),w())})},{attributes:!0,characterData:!1,childList:!1,subtree:!1}),(0,l.useEffect)(function(){h()},[o,h]),(0,l.useEffect)(function(){return window.addEventListener("resize",h,{passive:!0}),function(){window.removeEventListener("resize",h)}},[h]),{codeBlockRef:p,isEnabled:o,isCodeScrollable:u,toggle:f});var Y=(null!==(P=null==(O=C)?void 0:null===(k=O.match(V))||void 0===k?void 0:k.groups.title)&&void 0!==P?P:"")||I,Q=function(e,n){var t=e.replace(/\n$/,""),r=n.language,o=n.magicComments,i=n.metastring;if(i&&z.test(i)){var a=i.match(z).groups.range;if(0===o.length)throw Error("A highlight range has been given in code block's metastring (``` ".concat(i,"), but no magic comment config is available. Docusaurus applies the first magic comment entry's className for metastring ranges."));var s=o[0].className;return{lineClassNames:Object.fromEntries(q()(a).filter(function(e){return e>0}).map(function(e){return[e-1,[s]]})),code:t}}if(void 0===r)return{lineClassNames:{},code:t};for(var l=function(e,n){switch(e){case"js":case"javascript":case"ts":case"typescript":return F(["js","jsBlock"],n);case"jsx":case"tsx":return F(["js","jsBlock","jsx"],n);case"html":return F(["js","jsBlock","html"],n);case"python":case"py":case"bash":return F(["bash"],n);case"markdown":case"md":return F(["html","jsx","bash"],n);case"tex":case"latex":case"matlab":return F(["tex"],n);case"lua":case"haskell":case"sql":return F(["lua"],n);case"wasm":return F(["wasm"],n);case"vb":case"vba":case"visual-basic":return F(["vb","rem"],n);case"vbnet":return F(["vbnet","rem"],n);case"batch":return F(["rem"],n);case"basic":return F(["rem","f90"],n);case"fsharp":return F(["js","ml"],n);case"ocaml":case"sml":return F(["ml"],n);case"fortran":return F(["f90"],n);case"cobol":return F(["cobol"],n);default:return F(U,n)}}(r,o),c=t.split("\n"),u=Object.fromEntries(o.map(function(e){return[e.className,{start:0,range:""}]})),d=Object.fromEntries(o.filter(function(e){return e.line}).map(function(e){var n=e.className;return[e.line,n]})),p=Object.fromEntries(o.filter(function(e){return e.block}).map(function(e){var n=e.className;return[e.block.start,n]})),f=Object.fromEntries(o.filter(function(e){return e.block}).map(function(e){var n=e.className;return[e.block.end,n]})),h=0;h<c.length;){var b=c[h].match(l);if(!b){h+=1;continue}var g=b.slice(1).find(function(e){return void 0!==e});d[g]?u[d[g]].range+="".concat(h,","):p[g]?u[p[g]].start=h:f[g]&&(u[f[g]].range+="".concat(u[f[g]].start,"-").concat(h-1,",")),c.splice(h,1)}t=c.join("\n");var m={};return Object.entries(u).forEach(function(e){var n=M(e,2),t=n[0],r=n[1].range;q()(r).forEach(function(e){var n;null!==(n=m[e])&&void 0!==n||(m[e]=[]),m[e].push(t)})}),{lineClassNames:m,code:t}}(A,{metastring:C,language:Z,magicComments:_}),K=Q.lineClassNames,et=Q.code;var er=null!=T?T:!!(null==(S=C)?void 0:S.includes("showLineNumbers"));return(0,s.jsxs)($,{as:"div",className:(0,c.Z)(D,Z&&!D.includes("language-".concat(Z))&&"language-".concat(Z)),children:[Y&&(0,s.jsx)("div",{className:G.codeBlockTitle,children:Y}),(0,s.jsxs)("div",{className:G.codeBlockContent,children:[(0,s.jsx)(en.y$,{theme:R,code:et,language:null!=Z?Z:"text",children:function(e){var n=e.className,t=e.style,r=e.tokens,o=e.getLineProps,i=e.getTokenProps;return(0,s.jsx)("pre",{tabIndex:0,ref:H.codeBlockRef,className:(0,c.Z)(n,G.codeBlock,"thin-scrollbar"),style:t,children:(0,s.jsx)("code",{className:(0,c.Z)(G.codeBlockLines,er&&G.codeBlockLinesWithNumbering),children:r.map(function(e,n){return(0,s.jsx)(eo,{line:e,getLineProps:o,getTokenProps:i,classNames:K[n],showLineNumbers:er},n)})})})}}),(0,s.jsxs)("div",{className:G.buttonGroup,children:[(H.isEnabled||H.isCodeScrollable)&&(0,s.jsx)(ef,{className:G.codeButton,onClick:function(){return H.toggle()},isEnabled:H.isEnabled}),(0,s.jsx)(eu,{className:G.codeButton,code:et})]})]})]})}function eb(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.forEach(function(n){var r,o,i;r=e,o=n,i=t[n],o in r?Object.defineProperty(r,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[o]=i})}return e}let eg=(i=function(e){var n,t,r,o=e.children,i=function(e,n){if(null==e)return{};var t,r,o=function(e,n){if(null==e)return{};var t,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)t=i[r],!(n.indexOf(t)>=0)&&(o[t]=e[t]);return o}(e,n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++){if(t=i[r],!(n.indexOf(t)>=0))Object.prototype.propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}}return o}(e,["children"]),a=(0,u.Z)();var c=(n=o,l.Children.toArray(n).some(function(e){return(0,l.isValidElement)(e)})?n:Array.isArray(n)?n.join(""):n),d="string"==typeof c?eh:Q;return(0,s.jsx)(d,(t=function(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.forEach(function(n){var r,o,i;r=e,o=n,i=t[n],o in r?Object.defineProperty(r,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[o]=i})}return e}({},i),r=(r={children:c},r),Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):(function(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t.push.apply(t,r)}return t})(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}),t),String(a))},function(e){return e.live?(0,s.jsx)(I,eb({scope:W},e)):(0,s.jsx)(i,eb({},e))});function em(e){return(0,s.jsx)(eg,function(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.forEach(function(n){var r,o,i;r=e,o=n,i=t[n],o in r?Object.defineProperty(r,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[o]=i})}return e}({},e))}},27105:function(e){e.exports=JSON.parse('{"name":"Docusaurus","short_name":"Docusaurus","theme_color":"#2196f3","background_color":"#424242","display":"standalone","scope":"./","start_url":"./index.html","related_applications":[{"platform":"webapp","url":"https://docusaurus.io/manifest.json"}],"icons":[{"src":"img/icons/icon-72x72.png","sizes":"72x72","type":"image/png"},{"src":"img/icons/icon-96x96.png","sizes":"96x96","type":"image/png"},{"src":"img/icons/icon-128x128.png","sizes":"128x128","type":"image/png"},{"src":"img/icons/icon-144x144.png","sizes":"144x144","type":"image/png"},{"src":"img/icons/icon-152x152.png","sizes":"152x152","type":"image/png"},{"src":"img/icons/icon-192x192.png","sizes":"192x192","type":"image/png"},{"src":"img/icons/icon-384x384.png","sizes":"384x384","type":"image/png"},{"src":"img/icons/icon-512x512.png","sizes":"512x512","type":"image/png"}]}')}}]); |