From f61eee507a8c2a41c743386de28a043b7b9e89b8 Mon Sep 17 00:00:00 2001 From: gh-actions Date: Tue, 29 Nov 2022 14:16:18 +0000 Subject: [PATCH] Deploy website - based on c311020ea4351d96efb3213142e32efa87da188a --- 404.html | 8 +++--- assets/js/020a1d6e.c322f2ee.js | 1 + assets/js/03d72bfc.d026b8f6.js | 1 - ...fa0dd.5237b454.js => 0a5fa0dd.254638ce.js} | 2 +- assets/js/1ca91aca.0f1a6915.js | 1 + assets/js/2cb19d2e.1eb0d460.js | 1 + assets/js/2cb19d2e.bda18d6b.js | 1 - assets/js/43141670.8d01935a.js | 1 - assets/js/5ce51c20.40687f90.js | 1 - assets/js/935f2afb.7d9a5250.js | 1 - assets/js/935f2afb.b4b29c59.js | 1 + assets/js/9a0007dd.e9d28fd7.js | 1 - assets/js/a2518eb5.2e7d10a4.js | 1 + assets/js/c0f96715.7ee87254.js | 1 - assets/js/dc1592f9.f45a8b5d.js | 1 + assets/js/e42b69fc.c8379fe0.js | 1 + assets/js/e7bf32fe.930ab807.js | 1 + ...ae7d6.54a46c0f.js => f12ae7d6.7f067890.js} | 2 +- assets/js/f46e16a6.3cc6cd55.js | 1 - ...a6906.3c4612fa.js => feda6906.463da885.js} | 2 +- assets/js/main.3103020b.js | 2 -- assets/js/main.7a94fae6.js | 2 ++ ...CENSE.txt => main.7a94fae6.js.LICENSE.txt} | 0 assets/js/runtime~main.761912a1.js | 1 - assets/js/runtime~main.b4ebacdc.js | 1 + awesome-software.html | 8 +++--- blog.html | 8 +++--- blog/archive.html | 8 +++--- blog/debugging-go-map-races-in-k8s.html | 8 +++--- ...t-of-3rd-party-scripts-on-performance.html | 8 +++--- blog/prometheus-cardinality-issues.html | 8 +++--- blog/searching-for-search-engines.html | 8 +++--- blog/tags.html | 8 +++--- blog/tags/backend.html | 8 +++--- blog/tags/bundle-size.html | 8 +++--- blog/tags/bundle.html | 8 +++--- blog/tags/cardinality.html | 8 +++--- blog/tags/debugging.html | 8 +++--- blog/tags/devops.html | 8 +++--- blog/tags/foomo.html | 8 +++--- blog/tags/frontend.html | 8 +++--- blog/tags/go.html | 8 +++--- blog/tags/javascript.html | 8 +++--- blog/tags/k-8-s.html | 8 +++--- blog/tags/memory.html | 8 +++--- blog/tags/oom.html | 8 +++--- blog/tags/ops.html | 8 +++--- blog/tags/performance.html | 8 +++--- blog/tags/prometheus.html | 8 +++--- blog/tags/search-engine.html | 8 +++--- blog/tags/search.html | 8 +++--- blog/welcome-back-2021.html | 8 +++--- blog/why-bundle-size-is-important.html | 8 +++--- docs/backend/go-by-example/map-racing.html | 10 +++---- docs/backend/go-by-example/nil-maps.html | 10 +++---- .../go-by-example/panic-and-recover.html | 10 +++---- docs/backend/go-by-example/ranging.html | 10 +++---- docs/backend/go-by-example/yaml-magic.html | 12 ++++---- .../backend/gocontentful/getting-started.html | 26 ----------------- docs/backend/gocontentful/introduction.html | 21 -------------- docs/backend/gograpple.html | 10 +++---- docs/backend/intro.html | 10 +++---- docs/backend/rtfm.html | 10 +++---- docs/backend/setup.html | 10 +++---- docs/devops/bookmarks.html | 8 +++--- docs/devops/intro.html | 8 +++--- docs/devops/k8s.html | 8 +++--- .../kubernetes/spot-instance-node-pools.html | 8 +++--- docs/devops/monitoring/grafana.html | 8 +++--- docs/devops/monitoring/intro.html | 8 +++--- docs/devops/monitoring/jaeger.html | 8 +++--- docs/frontend/css.html | 8 +++--- docs/frontend/debugging_js.html | 8 +++--- docs/frontend/intro.html | 8 +++--- docs/frontend/performance.html | 8 +++--- docs/frontend/pitfalls.html | 8 +++--- docs/frontend/rtfm.html | 8 +++--- docs/frontend/setup.html | 8 +++--- docs/frontend/stack.html | 8 +++--- docs/frontend/typescript/objects.html | 8 +++--- docs/frontend/typescript/spreading.html | 8 +++--- docs/frontend/vscode.html | 8 +++--- docs/general/essentials.html | 8 +++--- docs/general/intro.html | 8 +++--- docs/general/package-managers.html | 8 +++--- docs/general/security.html | 8 +++--- docs/general/setup/computer.html | 8 +++--- docs/general/setup/workplace.html | 8 +++--- docs/general/technologies/sse.html | 8 +++--- docs/general/utilities/k9s.html | 8 +++--- docs/general/work/general.html | 8 +++--- docs/general/work/remote-work.html | 8 +++--- docs/project-management/intro.html | 8 +++--- docs/project-management/responsibility.html | 8 +++--- docs/projects/architecture.html | 10 +++---- docs/projects/cms/contentful.html | 10 +++---- docs/projects/cms/contentserver.html | 10 +++---- .../cms}/gocontentful/api-reference.html | 16 +++++------ .../cms}/gocontentful/caching.html | 18 ++++++------ .../cms/gocontentful/getting-started.html | 26 +++++++++++++++++ .../cms/gocontentful/introduction.html | 21 ++++++++++++++ .../cms}/gocontentful/test-api.html | 16 +++++------ .../working-with-gocontentful-api.html | 28 +++++++++---------- docs/projects/cms/intro.html | 10 +++---- docs/projects/gotsrpc.html | 10 +++---- docs/projects/intro.html | 10 +++---- docs/projects/libraries/keel.html | 10 +++---- docs/projects/pagespeed-exporter.html | 10 +++---- docs/projects/site-reliability.html | 10 +++---- docs/projects/utilities/gograpple.html | 10 +++---- docs/projects/webgrapple.html | 10 +++---- docs/tags.html | 8 +++--- docs/tags/frontend.html | 8 +++--- docs/tags/go.html | 8 +++--- docs/tags/javascript.html | 8 +++--- docs/tags/overview.html | 8 +++--- docs/tags/sse.html | 8 +++--- etc/imprint.html | 8 +++--- index.html | 8 +++--- search.html | 8 +++--- sitemap.xml | 2 +- 121 files changed, 474 insertions(+), 474 deletions(-) create mode 100644 assets/js/020a1d6e.c322f2ee.js delete mode 100644 assets/js/03d72bfc.d026b8f6.js rename assets/js/{0a5fa0dd.5237b454.js => 0a5fa0dd.254638ce.js} (63%) create mode 100644 assets/js/1ca91aca.0f1a6915.js create mode 100644 assets/js/2cb19d2e.1eb0d460.js delete mode 100644 assets/js/2cb19d2e.bda18d6b.js delete mode 100644 assets/js/43141670.8d01935a.js delete mode 100644 assets/js/5ce51c20.40687f90.js delete mode 100644 assets/js/935f2afb.7d9a5250.js create mode 100644 assets/js/935f2afb.b4b29c59.js delete mode 100644 assets/js/9a0007dd.e9d28fd7.js create mode 100644 assets/js/a2518eb5.2e7d10a4.js delete mode 100644 assets/js/c0f96715.7ee87254.js create mode 100644 assets/js/dc1592f9.f45a8b5d.js create mode 100644 assets/js/e42b69fc.c8379fe0.js create mode 100644 assets/js/e7bf32fe.930ab807.js rename assets/js/{f12ae7d6.54a46c0f.js => f12ae7d6.7f067890.js} (90%) delete mode 100644 assets/js/f46e16a6.3cc6cd55.js rename assets/js/{feda6906.3c4612fa.js => feda6906.463da885.js} (84%) delete mode 100644 assets/js/main.3103020b.js create mode 100644 assets/js/main.7a94fae6.js rename assets/js/{main.3103020b.js.LICENSE.txt => main.7a94fae6.js.LICENSE.txt} (100%) delete mode 100644 assets/js/runtime~main.761912a1.js create mode 100644 assets/js/runtime~main.b4ebacdc.js delete mode 100644 docs/backend/gocontentful/getting-started.html delete mode 100644 docs/backend/gocontentful/introduction.html rename docs/{backend => projects/cms}/gocontentful/api-reference.html (85%) rename docs/{backend => projects/cms}/gocontentful/caching.html (58%) create mode 100644 docs/projects/cms/gocontentful/getting-started.html create mode 100644 docs/projects/cms/gocontentful/introduction.html rename docs/{backend => projects/cms}/gocontentful/test-api.html (83%) rename docs/{backend => projects/cms}/gocontentful/working-with-gocontentful-api.html (83%) diff --git a/404.html b/404.html index 05458ee..71f97d5 100644 --- a/404.html +++ b/404.html @@ -9,13 +9,13 @@ - - + +
Skip to main content

Page Not Found

We could not find what you were looking for.

Please contact the owner of the site that linked you to the original URL and let them know their link is broken.

- - + + \ No newline at end of file diff --git a/assets/js/020a1d6e.c322f2ee.js b/assets/js/020a1d6e.c322f2ee.js new file mode 100644 index 0000000..a55effb --- /dev/null +++ b/assets/js/020a1d6e.c322f2ee.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkfoomo=self.webpackChunkfoomo||[]).push([[3174],{3905:(e,t,n)=>{n.d(t,{Zo:()=>u,kt:()=>d});var a=n(7294);function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function c(e){for(var t=1;t=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var i=a.createContext({}),l=function(e){var t=a.useContext(i),n=t;return e&&(n="function"==typeof e?e(t):c(c({},t),e)),n},u=function(e){var t=l(e.components);return a.createElement(i.Provider,{value:t},e.children)},h={inlineCode:"code",wrapper:function(e){var t=e.children;return a.createElement(a.Fragment,{},t)}},p=a.forwardRef((function(e,t){var n=e.components,o=e.mdxType,r=e.originalType,i=e.parentName,u=s(e,["components","mdxType","originalType","parentName"]),p=l(n),d=o,f=p["".concat(i,".").concat(d)]||p[d]||h[d]||r;return n?a.createElement(f,c(c({ref:t},u),{},{components:n})):a.createElement(f,c({ref:t},u))}));function d(e,t){var n=arguments,o=t&&t.mdxType;if("string"==typeof e||o){var r=n.length,c=new Array(r);c[0]=p;var s={};for(var i in t)hasOwnProperty.call(t,i)&&(s[i]=t[i]);s.originalType=e,s.mdxType="string"==typeof e?e:o,c[1]=s;for(var l=2;l{n.r(t),n.d(t,{assets:()=>i,contentTitle:()=>c,default:()=>h,frontMatter:()=>r,metadata:()=>s,toc:()=>l});var a=n(7462),o=(n(7294),n(3905));const r={},c="Caching",s={unversionedId:"projects/cms/gocontentful/caching",id:"projects/cms/gocontentful/caching",title:"Caching",description:"Caching is a fundamental part of working with remote data across the Internet,",source:"@site/docs/projects/cms/gocontentful/05-caching.md",sourceDirName:"projects/cms/gocontentful",slug:"/projects/cms/gocontentful/caching",permalink:"/docs/projects/cms/gocontentful/caching",draft:!1,editUrl:"https://github.com/foomo/foomo-docs/tree/main/foomo/docs/projects/cms/gocontentful/05-caching.md",tags:[],version:"current",sidebarPosition:5,frontMatter:{},sidebar:"projectsSidebar",previous:{title:"Working with the Gocontentful API",permalink:"/docs/projects/cms/gocontentful/working-with-gocontentful-api"},next:{title:"API Reference",permalink:"/docs/projects/cms/gocontentful/api-reference"}},i={},l=[{value:"Full cache init and rebuild",id:"full-cache-init-and-rebuild",level:4},{value:"Sync API support",id:"sync-api-support",level:4},{value:"Cache timeout",id:"cache-timeout",level:3},{value:"Asset caching",id:"asset-caching",level:3},{value:"When to use and not use caching",id:"when-to-use-and-not-use-caching",level:3}],u={toc:l};function h(e){let{components:t,...n}=e;return(0,o.kt)("wrapper",(0,a.Z)({},u,n,{components:t,mdxType:"MDXLayout"}),(0,o.kt)("h1",{id:"caching"},"Caching"),(0,o.kt)("p",null,"Caching is a fundamental part of working with remote data across the Internet,\nwhere access is severely impacted by latency and transfer time. In real-world scenarios,\nyou'll always need to keep all the data you need close and sync the changes with the remote\nCMS when they happen. "),(0,o.kt)("p",null,"Gocontentful supports caching out of the box. The client can maintain a cache of an entire space\nor a subset of the content types that can be initialized with a single method call:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-go"},'contentTypes := []string{"person", "pet"}\nerr = cc.UpdateCache(context, contentTypes, true)\n')),(0,o.kt)("p",null,"This makes sense for client modes ",(0,o.kt)("inlineCode",{parentName:"p"},"ClientModeCDA")," and ",(0,o.kt)("inlineCode",{parentName:"p"},"ClientModeCPA")," and not for the management API.\nThe client will download all the entries, convert and store them in the case as\nnative Go value objects. This makes subsequent accesses to the space data an in-memory operation removing all the HTTP\noverhead."),(0,o.kt)("p",null,"The first parameter is the context. If you don't use a context in your application or service just pass ",(0,o.kt)("em",{parentName:"p"},"context.Background()")),(0,o.kt)("p",null,"The third parameter of UpdateCache toggles asset caching on or off. If you deal with assets you want this to be always on."),(0,o.kt)("h4",{id:"full-cache-init-and-rebuild"},"Full cache init and rebuild"),(0,o.kt)("p",null,"By default the client will cache the whole space using 4 parallel workers to speed up the process.\nThis is safe since Contentful allows up to 5 concurrent connections.\nIf you have content types that have a lot of entries, it might make sense to keep them close to each other\nin the content types slice passed to UpdateCache(), so that they will run in parallel and not one after the other."),(0,o.kt)("p",null,"All gocontentful functions that query the space cache-transparent: if a cache is available data will be loaded from\nthere, otherwise it will be sourced from Contentful. This doesn't apply to ",(0,o.kt)("em",{parentName:"p"},"GetFilteredXYZ()")," calls that\nalways need to pass the query to Contentful. "),(0,o.kt)("p",null,"Gocontentful also supports selective entry and asset cache updates through the following method:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-go"},"err = cc.UpdateCacheForEntity(context, sysType, contentType, entityID string)\n")),(0,o.kt)("p",null,"When something changes in the space at Contentful you need to update the cache. For this to happen you need to set\nup a webhook at Contentful and handle its calls in your service through a public HTTP listener.\nWhen a webhook call gets in, you have the choice of updating your cache in different ways:"),(0,o.kt)("ul",null,(0,o.kt)("li",{parentName:"ul"},"You can regenerate the entire CDA cache when something is published because you want production data to\nbe 100% up to date in your application. This can get slow and expensive."),(0,o.kt)("li",{parentName:"ul"},"You can alternatively update a single entry in the cache. This is usually the case for the CPA cache because\nit's a lot faster and that works well for preview features."),(0,o.kt)("li",{parentName:"ul"},"You can use the Sync API, but only limited to ",(0,o.kt)("inlineCode",{parentName:"li"},"ClientModeCDA"),", as explained in the following paragraph.")),(0,o.kt)("p",null,"In any case, if an update fails the previous cache is preserved to prevent service disruption.\nIn the unfortunate case a service or application needs to start and Contentful is not available, Gocontentful can work\nin an offline mode if you call ",(0,o.kt)("em",{parentName:"p"},"SetOfflineFallback")," on the client after you create it passing the path to a space export file."),(0,o.kt)("p",null,"The gocontentful API can work entirely offline too. In this case a cache is created from a space export file and most of the\nfeatures are available (pretty obviously, those that don't require live access to the space, like custom queries). If you update\nthe export file periodically you can even update the cache from the updated file."),(0,o.kt)("h4",{id:"sync-api-support"},"Sync API support"),(0,o.kt)("p",null,"In versions v1.0.12 and newer, gocontentful supports the Contentful Sync API and that's now the recommended way to cache spaces and manage updates.\nSync is enabled by default when you create a client with CDA mode.\nTo enable or disable support for the Sync API explicitly, you can call the SetSyncMode method on the client:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-go"},"cc.SetSyncMode(true)\n")),(0,o.kt)("p",null,"With sync on, the cache updates will happen transparently through downloads of incremental changes.\nThe syntax to update the cache doesn't change, just call ",(0,o.kt)("em",{parentName:"p"},"UpdateCache")," on the client as usual."),(0,o.kt)("p",null,"The initialization of the cache will be slower when ",(0,o.kt)("em",{parentName:"p"},"SyncMode")," is on compared to the legacy full cache init because sync calls cannot be parallelized.\nSubsequent updates though will be much faster because only changes in the space from the previous sync will be downloaded.\nThis includes entries and assets that were deleted. In case of need you can call ",(0,o.kt)("em",{parentName:"p"},"ResetSync()")," to start over from a fresh empty cache."),(0,o.kt)("p",null,"Note that the Sync API is not officially supported by Contentful on the Preview API. At the time of this writing it seems to work but use it at your own risk."),(0,o.kt)("h3",{id:"cache-timeout"},"Cache timeout"),(0,o.kt)("p",null,"Cache update operations time out by default after 120 seconds. This makes sure that no\nroutine is left hanging, blocking subsequent updates in case the main application or service\nrecovers from a panic. If you need to increase this limit because you have a huge space with\na lot of entries you can use the ",(0,o.kt)("em",{parentName:"p"},"SetCacheUpdateTimeout")," method. See the ",(0,o.kt)("a",{parentName:"p",href:"./api-reference"},"API Reference")," for details."),(0,o.kt)("h3",{id:"asset-caching"},"Asset caching"),(0,o.kt)("p",null,"If you use assets in your space, then you absolutely need to enable them in the ",(0,o.kt)("em",{parentName:"p"},"UpdateCache")," call.\nOtherwise, every time an entry needs to resolve a reference to an asset that single asset will be downloaded\nand that for large spaces with thousands of assets can lead to incredibly slow operation."),(0,o.kt)("h3",{id:"when-to-use-and-not-use-caching"},"When to use and not use caching"),(0,o.kt)("p",null,"Simple answer is: you should almost always use caching. The only scenario where not using\na cache on the client is better is when you only need to download a very limited amount\nof entries (in the order of less than some hundreds) and do that at significant distance in time\n(e.g. every hour). In this case your application code can be simpler and there won't be any\nperformance penalty. The other case is when you need to run a lot of custom queries or\nuse XPath, which is currently not supported by gocontentful directly."))}h.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/03d72bfc.d026b8f6.js b/assets/js/03d72bfc.d026b8f6.js deleted file mode 100644 index 835bdf3..0000000 --- a/assets/js/03d72bfc.d026b8f6.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkfoomo=self.webpackChunkfoomo||[]).push([[2193],{3905:(e,t,n)=>{n.d(t,{Zo:()=>u,kt:()=>p});var o=n(7294);function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function i(e){for(var t=1;t=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var l=o.createContext({}),s=function(e){var t=o.useContext(l),n=t;return e&&(n="function"==typeof e?e(t):i(i({},t),e)),n},u=function(e){var t=s(e.components);return o.createElement(l.Provider,{value:t},e.children)},d={inlineCode:"code",wrapper:function(e){var t=e.children;return o.createElement(o.Fragment,{},t)}},f=o.forwardRef((function(e,t){var n=e.components,r=e.mdxType,a=e.originalType,l=e.parentName,u=c(e,["components","mdxType","originalType","parentName"]),f=s(n),p=r,h=f["".concat(l,".").concat(p)]||f[p]||d[p]||a;return n?o.createElement(h,i(i({ref:t},u),{},{components:n})):o.createElement(h,i({ref:t},u))}));function p(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var a=n.length,i=new Array(a);i[0]=f;var c={};for(var l in t)hasOwnProperty.call(t,l)&&(c[l]=t[l]);c.originalType=e,c.mdxType="string"==typeof e?e:r,i[1]=c;for(var s=2;s{n.r(t),n.d(t,{assets:()=>l,contentTitle:()=>i,default:()=>d,frontMatter:()=>a,metadata:()=>c,toc:()=>s});var o=n(7462),r=(n(7294),n(3905));const a={},i="Introduction",c={unversionedId:"backend/gocontentful/introduction",id:"backend/gocontentful/introduction",title:"Introduction",description:"What is Contentful",source:"@site/docs/backend/gocontentful/01-introduction.md",sourceDirName:"backend/gocontentful",slug:"/backend/gocontentful/introduction",permalink:"/docs/backend/gocontentful/introduction",draft:!1,editUrl:"https://github.com/foomo/foomo-docs/tree/main/foomo/docs/backend/gocontentful/01-introduction.md",tags:[],version:"current",sidebarPosition:1,frontMatter:{},sidebar:"backendSidebar",previous:{title:"yaml magic",permalink:"/docs/backend/go-by-example/yaml-magic"},next:{title:"Getting started",permalink:"/docs/backend/gocontentful/getting-started"}},l={},s=[{value:"What is Contentful",id:"what-is-contentful",level:2},{value:"What is gocontentful",id:"what-is-gocontentful",level:2},{value:"Rationale",id:"rationale",level:2}],u={toc:s};function d(e){let{components:t,...n}=e;return(0,r.kt)("wrapper",(0,o.Z)({},u,n,{components:t,mdxType:"MDXLayout"}),(0,r.kt)("h1",{id:"introduction"},"Introduction"),(0,r.kt)("h2",{id:"what-is-contentful"},"What is Contentful"),(0,r.kt)("p",null,(0,r.kt)("a",{parentName:"p",href:"https://www.contentful.com/"},"Contentful")," is a content platform (often referred to as headless CMS) for ",(0,r.kt)("a",{parentName:"p",href:"https://www.contentful.com/r/knowledgebase/content-as-a-microservice/"},"micro-content"),". There's no pages or content trees in Contentful, the CMS focuses on structured data. The data model is built from scratch for the purpose of the consuming application, is completely flexible and can be created and hot-changed through the same Web UI that the content editors use. The model dictates which content types can reference others and the final structure is a graph."),(0,r.kt)("h2",{id:"what-is-gocontentful"},"What is gocontentful"),(0,r.kt)("p",null,"A golang API code generator that simplifies interacting with a Contentful space. The generated API:"),(0,r.kt)("ul",null,(0,r.kt)("li",{parentName:"ul"},"Supports most of the Contentful APIs to perform all read/write operation on entries and assets"),(0,r.kt)("li",{parentName:"ul"},"Hides the complexity of the Contentful REST/JSON APIs behind an idiomatic set of golang functions and methods"),(0,r.kt)("li",{parentName:"ul"},"Allows for in-memory caching of an entire Contentful space")),(0,r.kt)("h2",{id:"rationale"},"Rationale"),(0,r.kt)("p",null,"Calling a remote CMS repository across the Internet whenever your service needs a piece of content is not an option because of latency and response time. Hence, you need to cache all the content at the running service and make sure your cache is always up-to-date. In addition, you need to deal with generic entries in JSON format and maintain a Go model with value objects to reflect every change at the CMS' content model, writing functions and methods to import and export entries to/from typed objects. "),(0,r.kt)("p",null,"Trust me: both things quickly scale to royal-PITA level. "),(0,r.kt)("p",null,"Gocontentful wipes out both complexities by generating the content model automatically and providing an idiomatic API to handle interaction with remote content while keeping a cache stays constantly in-sync with the Contentful space. If the content model changes, running gocontentful again will update the Go code for the model and API to reflect those changes automatically."),(0,r.kt)("p",null,"How much code is that? As an example of a real-world production scenario where gocontentful is in use as of 2022, a space content model with 11 content types ranging from 3 to over 40 fields each generated around 50,000 lines of Go code. Do you need all those lines? You might not need all setters if you don't manage content through the API but you'll definitely need most of the getters otherwise those should not be in the model at all."))}d.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/0a5fa0dd.5237b454.js b/assets/js/0a5fa0dd.254638ce.js similarity index 63% rename from assets/js/0a5fa0dd.5237b454.js rename to assets/js/0a5fa0dd.254638ce.js index d369d00..8714beb 100644 --- a/assets/js/0a5fa0dd.5237b454.js +++ b/assets/js/0a5fa0dd.254638ce.js @@ -1 +1 @@ -"use strict";(self.webpackChunkfoomo=self.webpackChunkfoomo||[]).push([[8495],{3905:(e,t,r)=>{r.d(t,{Zo:()=>l,kt:()=>m});var o=r(7294);function n(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function c(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,o)}return r}function p(e){for(var t=1;t=0||(n[r]=e[r]);return n}(e,t);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(o=0;o=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}var s=o.createContext({}),i=function(e){var t=o.useContext(s),r=t;return e&&(r="function"==typeof e?e(t):p(p({},t),e)),r},l=function(e){var t=i(e.components);return o.createElement(s.Provider,{value:t},e.children)},u={inlineCode:"code",wrapper:function(e){var t=e.children;return o.createElement(o.Fragment,{},t)}},f=o.forwardRef((function(e,t){var r=e.components,n=e.mdxType,c=e.originalType,s=e.parentName,l=a(e,["components","mdxType","originalType","parentName"]),f=i(r),m=n,g=f["".concat(s,".").concat(m)]||f[m]||u[m]||c;return r?o.createElement(g,p(p({ref:t},l),{},{components:r})):o.createElement(g,p({ref:t},l))}));function m(e,t){var r=arguments,n=t&&t.mdxType;if("string"==typeof e||n){var c=r.length,p=new Array(c);p[0]=f;var a={};for(var s in t)hasOwnProperty.call(t,s)&&(a[s]=t[s]);a.originalType=e,a.mdxType="string"==typeof e?e:n,p[1]=a;for(var i=2;i{r.r(t),r.d(t,{assets:()=>s,contentTitle:()=>p,default:()=>u,frontMatter:()=>c,metadata:()=>a,toc:()=>i});var o=r(7462),n=(r(7294),r(3905));const c={},p="gotsrpc",a={unversionedId:"projects/gotsrpc",id:"projects/gotsrpc",title:"gotsrpc",description:"https://github.com/foomo/gotsrpc",source:"@site/docs/projects/gotsrpc.md",sourceDirName:"projects",slug:"/projects/gotsrpc",permalink:"/docs/projects/gotsrpc",draft:!1,editUrl:"https://github.com/foomo/foomo-docs/tree/main/foomo/docs/projects/gotsrpc.md",tags:[],version:"current",frontMatter:{},sidebar:"projectsSidebar",previous:{title:"contentful",permalink:"/docs/projects/cms/contentful"},next:{title:"keel",permalink:"/docs/projects/libraries/keel"}},s={},i=[],l={toc:i};function u(e){let{components:t,...r}=e;return(0,n.kt)("wrapper",(0,o.Z)({},l,r,{components:t,mdxType:"MDXLayout"}),(0,n.kt)("h1",{id:"gotsrpc"},"gotsrpc"),(0,n.kt)("p",null,(0,n.kt)("a",{parentName:"p",href:"https://github.com/foomo/gotsrpc"},"https://github.com/foomo/gotsrpc")),(0,n.kt)("p",null,"Since we are using go when writing"))}u.isMDXComponent=!0}}]); \ No newline at end of file +"use strict";(self.webpackChunkfoomo=self.webpackChunkfoomo||[]).push([[8495],{3905:(e,t,r)=>{r.d(t,{Zo:()=>l,kt:()=>m});var o=r(7294);function n(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function c(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,o)}return r}function p(e){for(var t=1;t=0||(n[r]=e[r]);return n}(e,t);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(o=0;o=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}var i=o.createContext({}),s=function(e){var t=o.useContext(i),r=t;return e&&(r="function"==typeof e?e(t):p(p({},t),e)),r},l=function(e){var t=s(e.components);return o.createElement(i.Provider,{value:t},e.children)},u={inlineCode:"code",wrapper:function(e){var t=e.children;return o.createElement(o.Fragment,{},t)}},f=o.forwardRef((function(e,t){var r=e.components,n=e.mdxType,c=e.originalType,i=e.parentName,l=a(e,["components","mdxType","originalType","parentName"]),f=s(r),m=n,g=f["".concat(i,".").concat(m)]||f[m]||u[m]||c;return r?o.createElement(g,p(p({ref:t},l),{},{components:r})):o.createElement(g,p({ref:t},l))}));function m(e,t){var r=arguments,n=t&&t.mdxType;if("string"==typeof e||n){var c=r.length,p=new Array(c);p[0]=f;var a={};for(var i in t)hasOwnProperty.call(t,i)&&(a[i]=t[i]);a.originalType=e,a.mdxType="string"==typeof e?e:n,p[1]=a;for(var s=2;s{r.r(t),r.d(t,{assets:()=>i,contentTitle:()=>p,default:()=>u,frontMatter:()=>c,metadata:()=>a,toc:()=>s});var o=r(7462),n=(r(7294),r(3905));const c={},p="gotsrpc",a={unversionedId:"projects/gotsrpc",id:"projects/gotsrpc",title:"gotsrpc",description:"https://github.com/foomo/gotsrpc",source:"@site/docs/projects/gotsrpc.md",sourceDirName:"projects",slug:"/projects/gotsrpc",permalink:"/docs/projects/gotsrpc",draft:!1,editUrl:"https://github.com/foomo/foomo-docs/tree/main/foomo/docs/projects/gotsrpc.md",tags:[],version:"current",frontMatter:{},sidebar:"projectsSidebar",previous:{title:"API Reference",permalink:"/docs/projects/cms/gocontentful/api-reference"},next:{title:"keel",permalink:"/docs/projects/libraries/keel"}},i={},s=[],l={toc:s};function u(e){let{components:t,...r}=e;return(0,n.kt)("wrapper",(0,o.Z)({},l,r,{components:t,mdxType:"MDXLayout"}),(0,n.kt)("h1",{id:"gotsrpc"},"gotsrpc"),(0,n.kt)("p",null,(0,n.kt)("a",{parentName:"p",href:"https://github.com/foomo/gotsrpc"},"https://github.com/foomo/gotsrpc")),(0,n.kt)("p",null,"Since we are using go when writing"))}u.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/1ca91aca.0f1a6915.js b/assets/js/1ca91aca.0f1a6915.js new file mode 100644 index 0000000..6591769 --- /dev/null +++ b/assets/js/1ca91aca.0f1a6915.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkfoomo=self.webpackChunkfoomo||[]).push([[3925],{3905:(e,t,n)=>{n.d(t,{Zo:()=>u,kt:()=>f});var o=n(7294);function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function l(e){for(var t=1;t=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(o=0;o=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var s=o.createContext({}),c=function(e){var t=o.useContext(s),n=t;return e&&(n="function"==typeof e?e(t):l(l({},t),e)),n},u=function(e){var t=c(e.components);return o.createElement(s.Provider,{value:t},e.children)},p={inlineCode:"code",wrapper:function(e){var t=e.children;return o.createElement(o.Fragment,{},t)}},h=o.forwardRef((function(e,t){var n=e.components,a=e.mdxType,r=e.originalType,s=e.parentName,u=i(e,["components","mdxType","originalType","parentName"]),h=c(n),f=a,d=h["".concat(s,".").concat(f)]||h[f]||p[f]||r;return n?o.createElement(d,l(l({ref:t},u),{},{components:n})):o.createElement(d,l({ref:t},u))}));function f(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var r=n.length,l=new Array(r);l[0]=h;var i={};for(var s in t)hasOwnProperty.call(t,s)&&(i[s]=t[s]);i.originalType=e,i.mdxType="string"==typeof e?e:a,l[1]=i;for(var c=2;c{n.r(t),n.d(t,{assets:()=>s,contentTitle:()=>l,default:()=>p,frontMatter:()=>r,metadata:()=>i,toc:()=>c});var o=n(7462),a=(n(7294),n(3905));const r={},l="Working with the Gocontentful API",i={unversionedId:"projects/cms/gocontentful/working-with-gocontentful-api",id:"projects/cms/gocontentful/working-with-gocontentful-api",title:"Working with the Gocontentful API",description:"Let's consider a very simple use case where you have a Contentful space where you store information",source:"@site/docs/projects/cms/gocontentful/04-working-with-gocontentful-api.md",sourceDirName:"projects/cms/gocontentful",slug:"/projects/cms/gocontentful/working-with-gocontentful-api",permalink:"/docs/projects/cms/gocontentful/working-with-gocontentful-api",draft:!1,editUrl:"https://github.com/foomo/foomo-docs/tree/main/foomo/docs/projects/cms/gocontentful/04-working-with-gocontentful-api.md",tags:[],version:"current",sidebarPosition:4,frontMatter:{},sidebar:"projectsSidebar",previous:{title:"Play with the test API",permalink:"/docs/projects/cms/gocontentful/test-api"},next:{title:"Caching",permalink:"/docs/projects/cms/gocontentful/caching"}},s={},c=[{value:"Get a client",id:"get-a-client",level:3},{value:"Environments support",id:"environments-support",level:3},{value:"Working with entries",id:"working-with-entries",level:3},{value:"Assets",id:"assets",level:3},{value:"Working with RichText",id:"working-with-richtext",level:3},{value:"More on references",id:"more-on-references",level:3},{value:"Other useful functions",id:"other-useful-functions",level:3},{value:"Caveats and limitations",id:"caveats-and-limitations",level:3}],u={toc:c};function p(e){let{components:t,...n}=e;return(0,a.kt)("wrapper",(0,o.Z)({},u,n,{components:t,mdxType:"MDXLayout"}),(0,a.kt)("h1",{id:"working-with-the-gocontentful-api"},"Working with the Gocontentful API"),(0,a.kt)("p",null,"Let's consider a very simple use case where you have a Contentful space where you store information\nabout people and their pets.\nTo generate a go package to manipulate those entries, run the following in your terminal:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-shell"},"$ gocontentful -spaceid YOUR_SPACE_ID -cmakey YOUR_CMA_API_TOKEN -contenttypes person,pet path/to/your/go/project/folder/people \n")),(0,a.kt)("p",null,"The ",(0,a.kt)("strong",{parentName:"p"},"-contenttypes")," parameter is optional. If not specified, gocontentful will generate an API that supports all the content types of the space."),(0,a.kt)("p",null,"Gocontentful will scan the space, download locales and content types and generate the Go API files in the target path:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-shell"},"path/to/your/go/project/folder/people\n|-gocontentfulvobase.go\n|-gocontentfulvolib_person.go // One file for each content type\n|-gocontentfulvolib_pet.go // One file for each content type\n|-gocontentfulvolib.go\n|-gocontentfulvo.go\n")),(0,a.kt)("p",null,"We recommend not passing the ",(0,a.kt)("em",{parentName:"p"},"-cmakey")," parameter but rather log in first using the Contentful CLI.\nThis will be remembered in all subsequent runs. See the ",(0,a.kt)("a",{parentName:"p",href:"./getting-started#optional-tools"},"Getting started chapter")," "),(0,a.kt)("p",null,"Note: Do NOT modify the generated files! If you change the content model in Contentful just run gocontentful\nagain. This will update the files for you."),(0,a.kt)("h3",{id:"get-a-client"},"Get a client"),(0,a.kt)("p",null,'The generated files will be in the "people" subdirectory of your project. Your go program can get a Contentful\nclient from them:'),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"cc, err := people.NewContentfulClient(YOUR_SPACE_ID, people.ClientModeCDA, YOUR_API_KEY, 1000, contentfulLogger, people.LogDebug,false)\n")),(0,a.kt)("p",null,"The parameters to pass to NewContentfulClient are:"),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("em",{parentName:"li"},"spaceID")," (string)"),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("em",{parentName:"li"},"clientMode")," (string) supports the constants ClientModeCDA, ClientModeCPA and ClientModeCMA. If you need to operate\non multiple APIs (e.g. one for reading and CMA for writing) you need to get two clients"),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("em",{parentName:"li"},"clientKey")," (string) is your API key (generate one for your API at Contentful)"),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("em",{parentName:"li"},"optimisticPageSize")," (uint16) is the page size the client will use to download entries from the space for caching.\nContentful's default is 100 but you can specify up to 1000: this might get you into an error because Contentful\nlimits the payload response size to 70 KB but the client will handle the error and reduce the page size automatically\nuntil it finds a proper value. Hint: using a big page size that always fails is a waste of time and resources because\na lot of initial calls will fail, whereas a too small one will not leverage the full download bandwidth. It's a\ntrial-and-error and you need to find the best value for your case. For simple content types you can start with 1000,\nfor very complex ones that include fat fields you might want to get down to 100 or even less."),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("em",{parentName:"li"},"logFn")," is a func(fields map","[string]","interface{}, level int, args ...interface{}) that the client will call whenever\nit needs to log something. It can be nil if you don't need logging and that will be handled gracefully but it's not\nrecommended. A simple function you can pass that uses the ",(0,a.kt)("a",{parentName:"li",href:"https://github.com/Sirupsen/logrus"},"https://github.com/Sirupsen/logrus")," package might look\nsomething like this:")),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"contentfulLogger := func(fields map[string]interface{}, level int, args ...interface{}) {\n switch level {\n case people.LogDebug:\n log.WithFields(fields).Debug(args)\n case people.LogInfo:\n log.WithFields(fields).Info(args)\n case people.LogWarn:\n log.WithFields(fields).Warn(args)\n case people.LogError:\n log.WithFields(fields).Error(args)\n default:\n return\n }\n}\n")),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("em",{parentName:"li"},"logLevel")," (int) is the debug level (see function above). Please note that LogDebug is very verbose and even logs\nwhen you request a field value but that is not set for the entry."),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("em",{parentName:"li"},"debug")," (bool) is the Contentful API client debug switch. If set to ",(0,a.kt)("em",{parentName:"li"},"true")," it will log on stdout all the CURL calls\nto Contentful. This is extremely verbose and extremely valuable when something fails in a call to the API because\nit's the only way to see the REST API response.")),(0,a.kt)("p",null,(0,a.kt)("em",{parentName:"p"},"NOTE:")," Gocontentful provides an offline version of the client that can load data from a JSON space export file\n(as exported by the ",(0,a.kt)("em",{parentName:"p"},"contentful")," CLI tool). This is the way you can write unit tests against your generated API that\ndon't require to be online and the management of a safe API key storage. See the ",(0,a.kt)("a",{parentName:"p",href:"./api-reference"},"API Reference")),(0,a.kt)("h3",{id:"environments-support"},"Environments support"),(0,a.kt)("p",null,"Gocontentful supports Contentful environments in two ways:"),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},"Code can be generated loading the content model from an environment other than master.\nThis is done passing the -environment flag on the command line to specify the environment you want to load the model from."),(0,a.kt)("li",{parentName:"ul"},'The gocontentful client in your application can be switched to any environment with the SetEnvironment method.\nFor example, if your space has an extra environment named "devplayground" you can switch the API to use it with:')),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'cc.SetEnvironment("devplayground") \n')),(0,a.kt)("p",null,"To reset the environment to master pass an empty string."),(0,a.kt)("h3",{id:"working-with-entries"},"Working with entries"),(0,a.kt)("p",null,"See ",(0,a.kt)("a",{parentName:"p",href:"./test-api"},"the previous chapter")," for an introduction on entry operations.\nWith your newly created client you can do things like:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'// Load all persons\npersons, err := cc.GetAllPerson() \n// Load a specific person\nperson, err := cc.GetPersonByID(THE_PERSON_ID)\n// or pass a query\nperson, err := GetFilteredPerson(&contentful.Query{\n "contentType":"person",\n "exists": []string{"fields.resume"}\n})\n// The person\'s name\nname := person.Name()\n// The work title in a different localization. Available locales are generated as constants.\n// If a space is configured to have a fallback from one locale to the default one, \n// the getter functions will return that if the value is not set for locale passed to the function.\nname := person.Title(people.SpaceLocaleItalian) \n// Get references to the person\'s pets\npetRefs := person.Pets()\n// Deal with pets\nfor _, pet := range petRefs {\nswitch pet.ContentType {\ncase people.ContentTypeDog: // you have these constants in the generated code\ndog := pet.VO.(*people.Dog)\n// do something with dog\ncase people.ContentTypeCat:\n// ...\n}\n')),(0,a.kt)("p",null,"Once you have loaded an entry, you can use any of the setter methods to alter the fields. For example:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"dog.SetAge(7)\n")),(0,a.kt)("p",null,"This will only affect the Go object and doesn't automatically propagate to the space.\nTo save the entry to Contentful you need to explicitly call one of these methods:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"// Upsert (save) an entry\nerr := dog.UpsertEntry()\n// Publish it (after it's been upserted)\nerr := dog.PublishEntry() // change your mind with err := dog.UnpublishEntry()\n// Or do it in one step\nerr := dog.UpdateEntry() // upserts and publishes\n// And delete it\nerr := dog.DeleteEntry()\n")),(0,a.kt)("p",null,"If you want to know the publication status of an entry as represented in Contentful's UI you\ncan use the ",(0,a.kt)("inlineCode",{parentName:"p"},"GetPublishingStatus()")," method on the entry itself. Possible return values are the\npredefined constants ",(0,a.kt)("inlineCode",{parentName:"p"},"StatusDraft"),", ",(0,a.kt)("inlineCode",{parentName:"p"},"StatusChanged")," and ",(0,a.kt)("inlineCode",{parentName:"p"},"StatusPublished"),"."),(0,a.kt)("p",null,"When saving, publishing or deleting entries:"),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},"You need a client that uses mode ",(0,a.kt)("em",{parentName:"li"},"ClientModeCMA"),". Entries retrieved with ClientModeCDA\nor ClientModeCPA can be saved in memory (for example if you need to enrich the built-in cache) but not persisted to\nContentful."),(0,a.kt)("li",{parentName:"ul"},"Make sure you Get a fresh copy of the entry right before you manipulate it and upsert it / publish it to Contentful. In case it's\nsaved by someone else in the meantime, the upsert will fail with a version mismatch error. ")),(0,a.kt)("p",null,"In case you need a completely new entry just create it, Contentful will fill in the technical details for you:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"NewCfPerson(contentfulClient ...*ContentfulClient) (cfPerson *CfPerson)\n")),(0,a.kt)("h3",{id:"assets"},"Assets"),(0,a.kt)("p",null,"Contentful allows upload and reference of binary assets and gocontentful fully supports them.\nAssuming the dog entry references a picture in a field you can get it with:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"picture := dog.Picture() // you can pass a locale to this function as usual\n")),(0,a.kt)("p",null,"This returns a *contenful.AssetNoLocale object handling localization for you in two ways.\nFirst, the field itself could be localized in the model, referencing two different assets altogether.\nSecondly, the asset itself can have different files uploaded for different locales.\nNo matter what, the gocontentful API will return the right file: "),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"// Get the asset's URL at Contentful's CDN\nif picture != nil && picture.Fields != nil && picture.Fields.File != nil {\n theURL := picture.Fields.File.URL\n // ...then do something with it\n}\n")),(0,a.kt)("p",null,"There are various functions and methods to work with assets, for example to create an asset\nstarting from an URL or to convert an asset to a reference to store it in a parent entry\nfield. See the ",(0,a.kt)("a",{parentName:"p",href:"./api-reference"},"API Reference")," chapter for details."),(0,a.kt)("p",null,"Note: there is no function to create a new asset in the generated code because the type ",(0,a.kt)("inlineCode",{parentName:"p"},"AssetNoLocale"),"\nis from the ",(0,a.kt)("em",{parentName:"p"},"github.com/foomo/contentful")," package, just instantiate one if you need a blank asset."),(0,a.kt)("h3",{id:"working-with-richtext"},"Working with RichText"),(0,a.kt)("p",null,"Contentful supports Rich Text fields. Behind the scenes, these are JSON objects that represent\nthe content through a Contentful-specific data model. Sooner or later you might want to convert such values to and from HTML.\nGocontentful supports the conversion both ways. For instance, you want a person's resume to be converted to HTML:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"htmlText := people.RichTextToHtml(person.Resume(), linkResolver, entryLinkResolver, imageResolver, embeddedEntryResolver locale)\n")),(0,a.kt)("p",null,"The parameters linkResolver, entryLinkResolver, embeddedEntryResolver and imageResolver are all functions that you can pass\nto convert various elements inserted by the user into the RichText field:"),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},"linkResolver will allow you to create custom HTML tags for hyperlinks. If left blank, RichTextToHtml will just output an A tag."),(0,a.kt)("li",{parentName:"ul"},"entryLinkResolver is used to create hyperlinks with custom URLs when the destination in Contentful is another entry.\nIf you allow such links to be created in the editor then you must pass this function."),(0,a.kt)("li",{parentName:"ul"},"imageResolver and embebbedEntryResolver are needed when the field accepts assets and entries embedded into the content, to turn\nthese into actual HTML snippets")),(0,a.kt)("p",null,"The conversion works the other way around too, when you need to source data from outside and create Contentful entries:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"myRichText := HtmlToRichText(htmlSrc)\n")),(0,a.kt)("p",null,"See the ",(0,a.kt)("a",{parentName:"p",href:"./api-reference"},"API Reference")," for more details about these functions."),(0,a.kt)("h3",{id:"more-on-references"},"More on references"),(0,a.kt)("p",null,"When working with references it's often useful to know if there are any broken ones in the space.\nThis happens when a published entry references another that has been deleted after the parent\nwas published. This might create issues if your application code doesn't degrade content gracefully.\nTo get a report of all broken references you can use the following function:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"(cc *ContentfulClient) BrokenReferences() (brokenReferences []BrokenReference)\n")),(0,a.kt)("p",null,"Note that this only works with cached clients. See ",(0,a.kt)("a",{parentName:"p",href:"./caching"},"the next chapter on caching"),"."),(0,a.kt)("p",null,"Also on references: when you want to reference entry B from entry A, you cannot assign\nthe value object of entry B to the reference field in A. First you need to convert the\nobject to a ",(0,a.kt)("inlineCode",{parentName:"p"},"ContentTypeSys")," object because that's what Contentful expects in reference fields:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"(vo *CfPerson) ToReference() (refSys ContentTypeSys)\n")),(0,a.kt)("p",null,"Finally, you can get the parents (AKA referring) entries of either an entry or\nan EntryReference with the ",(0,a.kt)("em",{parentName:"p"},"GetParents()")," method. This returns a slice of ",(0,a.kt)("inlineCode",{parentName:"p"},"[]EntryReference"),":"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"(vo *CfPerson) GetParents() (parents []EntryReference, err error)\n(ref *EntryReference) GetParents(cc *ContentfulClient) (parents []EntryReference, err error)\n")),(0,a.kt)("h3",{id:"other-useful-functions"},"Other useful functions"),(0,a.kt)("p",null,"Another thing you might want to know is the content type of an entry with a given ID:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"(cc *ContentfulClient) GetContentTypeOfID(ID string) (contentType string)\n")),(0,a.kt)("h3",{id:"caveats-and-limitations"},"Caveats and limitations"),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},'Avoid creating content types that have field IDs equal to reserved Go words (e.g. "type").\nGocontentful won\'t scan for them and the generated code will break.')))}p.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/2cb19d2e.1eb0d460.js b/assets/js/2cb19d2e.1eb0d460.js new file mode 100644 index 0000000..63887dc --- /dev/null +++ b/assets/js/2cb19d2e.1eb0d460.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkfoomo=self.webpackChunkfoomo||[]).push([[6579],{3905:(t,e,n)=>{n.d(e,{Zo:()=>s,kt:()=>m});var o=n(7294);function r(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function c(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,o)}return n}function l(t){for(var e=1;e=0||(r[n]=t[n]);return r}(t,e);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(t);for(o=0;o=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}var u=o.createContext({}),a=function(t){var e=o.useContext(u),n=e;return t&&(n="function"==typeof t?t(e):l(l({},e),t)),n},s=function(t){var e=a(t.components);return o.createElement(u.Provider,{value:e},t.children)},i={inlineCode:"code",wrapper:function(t){var e=t.children;return o.createElement(o.Fragment,{},e)}},f=o.forwardRef((function(t,e){var n=t.components,r=t.mdxType,c=t.originalType,u=t.parentName,s=p(t,["components","mdxType","originalType","parentName"]),f=a(n),m=r,y=f["".concat(u,".").concat(m)]||f[m]||i[m]||c;return n?o.createElement(y,l(l({ref:e},s),{},{components:n})):o.createElement(y,l({ref:e},s))}));function m(t,e){var n=arguments,r=e&&e.mdxType;if("string"==typeof t||r){var c=n.length,l=new Array(c);l[0]=f;var p={};for(var u in e)hasOwnProperty.call(e,u)&&(p[u]=e[u]);p.originalType=t,p.mdxType="string"==typeof t?t:r,l[1]=p;for(var a=2;a{n.r(e),n.d(e,{assets:()=>u,contentTitle:()=>l,default:()=>i,frontMatter:()=>c,metadata:()=>p,toc:()=>a});var o=n(7462),r=(n(7294),n(3905));const c={},l="contentful",p={unversionedId:"projects/cms/contentful",id:"projects/cms/contentful",title:"contentful",description:"https://app.contentful.com is one of the very few not open source tools, that we use / support.",source:"@site/docs/projects/cms/contentful.md",sourceDirName:"projects/cms",slug:"/projects/cms/contentful",permalink:"/docs/projects/cms/contentful",draft:!1,editUrl:"https://github.com/foomo/foomo-docs/tree/main/foomo/docs/projects/cms/contentful.md",tags:[],version:"current",frontMatter:{},sidebar:"projectsSidebar",previous:{title:"contentserver",permalink:"/docs/projects/cms/contentserver"},next:{title:"Introduction",permalink:"/docs/projects/cms/gocontentful/introduction"}},u={},a=[{value:"gocontentful",id:"gocontentful",level:2},{value:"contentfulproxy",id:"contentfulproxy",level:2}],s={toc:a};function i(t){let{components:e,...n}=t;return(0,r.kt)("wrapper",(0,o.Z)({},s,n,{components:e,mdxType:"MDXLayout"}),(0,r.kt)("h1",{id:"contentful"},"contentful"),(0,r.kt)("p",null,(0,r.kt)("a",{parentName:"p",href:"https://app.contentful.com"},"https://app.contentful.com")," is one of the very few not open source tools, that we use / support."),(0,r.kt)("h2",{id:"gocontentful"},"gocontentful"),(0,r.kt)("p",null,(0,r.kt)("a",{parentName:"p",href:"https://github.com/foomo/gocontentful"},"https://github.com/foomo/gocontentful")),(0,r.kt)("p",null,"gocontentful is a command line utility and a go librabry."),(0,r.kt)("h2",{id:"contentfulproxy"},"contentfulproxy"),(0,r.kt)("p",null,(0,r.kt)("a",{parentName:"p",href:"https://github.com/foomo/contentfulproxy"},"https://github.com/foomo/contentfulproxy")),(0,r.kt)("p",null,"Is a caching reserve proxy that allows you to save money, when using contentful."))}i.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/2cb19d2e.bda18d6b.js b/assets/js/2cb19d2e.bda18d6b.js deleted file mode 100644 index 55ee267..0000000 --- a/assets/js/2cb19d2e.bda18d6b.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkfoomo=self.webpackChunkfoomo||[]).push([[6579],{3905:(t,e,n)=>{n.d(e,{Zo:()=>s,kt:()=>m});var o=n(7294);function r(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function c(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,o)}return n}function l(t){for(var e=1;e=0||(r[n]=t[n]);return r}(t,e);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(t);for(o=0;o=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}var a=o.createContext({}),u=function(t){var e=o.useContext(a),n=e;return t&&(n="function"==typeof t?t(e):l(l({},e),t)),n},s=function(t){var e=u(t.components);return o.createElement(a.Provider,{value:e},t.children)},f={inlineCode:"code",wrapper:function(t){var e=t.children;return o.createElement(o.Fragment,{},e)}},i=o.forwardRef((function(t,e){var n=t.components,r=t.mdxType,c=t.originalType,a=t.parentName,s=p(t,["components","mdxType","originalType","parentName"]),i=u(n),m=r,y=i["".concat(a,".").concat(m)]||i[m]||f[m]||c;return n?o.createElement(y,l(l({ref:e},s),{},{components:n})):o.createElement(y,l({ref:e},s))}));function m(t,e){var n=arguments,r=e&&e.mdxType;if("string"==typeof t||r){var c=n.length,l=new Array(c);l[0]=i;var p={};for(var a in e)hasOwnProperty.call(e,a)&&(p[a]=e[a]);p.originalType=t,p.mdxType="string"==typeof t?t:r,l[1]=p;for(var u=2;u{n.r(e),n.d(e,{assets:()=>a,contentTitle:()=>l,default:()=>f,frontMatter:()=>c,metadata:()=>p,toc:()=>u});var o=n(7462),r=(n(7294),n(3905));const c={},l="contentful",p={unversionedId:"projects/cms/contentful",id:"projects/cms/contentful",title:"contentful",description:"https://app.contentful.com is one of the very few not open source tools, that we use / support.",source:"@site/docs/projects/cms/contentful.md",sourceDirName:"projects/cms",slug:"/projects/cms/contentful",permalink:"/docs/projects/cms/contentful",draft:!1,editUrl:"https://github.com/foomo/foomo-docs/tree/main/foomo/docs/projects/cms/contentful.md",tags:[],version:"current",frontMatter:{},sidebar:"projectsSidebar",previous:{title:"contentserver",permalink:"/docs/projects/cms/contentserver"},next:{title:"gotsrpc",permalink:"/docs/projects/gotsrpc"}},a={},u=[{value:"gocontentful",id:"gocontentful",level:2},{value:"contentfulproxy",id:"contentfulproxy",level:2}],s={toc:u};function f(t){let{components:e,...n}=t;return(0,r.kt)("wrapper",(0,o.Z)({},s,n,{components:e,mdxType:"MDXLayout"}),(0,r.kt)("h1",{id:"contentful"},"contentful"),(0,r.kt)("p",null,(0,r.kt)("a",{parentName:"p",href:"https://app.contentful.com"},"https://app.contentful.com")," is one of the very few not open source tools, that we use / support."),(0,r.kt)("h2",{id:"gocontentful"},"gocontentful"),(0,r.kt)("p",null,(0,r.kt)("a",{parentName:"p",href:"https://github.com/foomo/gocontentful"},"https://github.com/foomo/gocontentful")),(0,r.kt)("p",null,"gocontentful is a command line utility and a go librabry."),(0,r.kt)("h2",{id:"contentfulproxy"},"contentfulproxy"),(0,r.kt)("p",null,(0,r.kt)("a",{parentName:"p",href:"https://github.com/foomo/contentfulproxy"},"https://github.com/foomo/contentfulproxy")),(0,r.kt)("p",null,"Is a caching reserve proxy that allows you to save money, when using contentful."))}f.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/43141670.8d01935a.js b/assets/js/43141670.8d01935a.js deleted file mode 100644 index 70a012c..0000000 --- a/assets/js/43141670.8d01935a.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkfoomo=self.webpackChunkfoomo||[]).push([[3732],{3905:(e,t,n)=>{n.d(t,{Zo:()=>p,kt:()=>h});var o=n(7294);function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function i(e){for(var t=1;t=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var s=o.createContext({}),c=function(e){var t=o.useContext(s),n=t;return e&&(n="function"==typeof e?e(t):i(i({},t),e)),n},p=function(e){var t=c(e.components);return o.createElement(s.Provider,{value:t},e.children)},d={inlineCode:"code",wrapper:function(e){var t=e.children;return o.createElement(o.Fragment,{},t)}},u=o.forwardRef((function(e,t){var n=e.components,r=e.mdxType,a=e.originalType,s=e.parentName,p=l(e,["components","mdxType","originalType","parentName"]),u=c(n),h=r,f=u["".concat(s,".").concat(h)]||u[h]||d[h]||a;return n?o.createElement(f,i(i({ref:t},p),{},{components:n})):o.createElement(f,i({ref:t},p))}));function h(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var a=n.length,i=new Array(a);i[0]=u;var l={};for(var s in t)hasOwnProperty.call(t,s)&&(l[s]=t[s]);l.originalType=e,l.mdxType="string"==typeof e?e:r,i[1]=l;for(var c=2;c{n.r(t),n.d(t,{assets:()=>s,contentTitle:()=>i,default:()=>d,frontMatter:()=>a,metadata:()=>l,toc:()=>c});var o=n(7462),r=(n(7294),n(3905));const a={},i="Play with the test API",l={unversionedId:"backend/gocontentful/test-api",id:"backend/gocontentful/test-api",title:"Play with the test API",description:"Clone the gocontentful repository from [github.com/foomo/gocontentful] and open it",source:"@site/docs/backend/gocontentful/03-test-api.md",sourceDirName:"backend/gocontentful",slug:"/backend/gocontentful/test-api",permalink:"/docs/backend/gocontentful/test-api",draft:!1,editUrl:"https://github.com/foomo/foomo-docs/tree/main/foomo/docs/backend/gocontentful/03-test-api.md",tags:[],version:"current",sidebarPosition:3,frontMatter:{},sidebar:"backendSidebar",previous:{title:"Getting started",permalink:"/docs/backend/gocontentful/getting-started"},next:{title:"Working with the Gocontentful API",permalink:"/docs/backend/gocontentful/working-with-gocontentful-api"}},s={},c=[],p={toc:c};function d(e){let{components:t,...n}=e;return(0,r.kt)("wrapper",(0,o.Z)({},p,n,{components:t,mdxType:"MDXLayout"}),(0,r.kt)("h1",{id:"play-with-the-test-api"},"Play with the test API"),(0,r.kt)("p",null,"Clone the gocontentful repository from ","[github.com/foomo/gocontentful]"," and open it\nin your IDE. "),(0,r.kt)("p",null,"The repository includes an offline representation of a Contentful space that can is used for testing gocontentful\nwithout depending on an online connection and an existing Contentful space. "),(0,r.kt)("p",null,"Create a file in the repository home directory and name it ",(0,r.kt)("inlineCode",{parentName:"p"},"untracked_test.go"),". This ensures it's not tracked by git.\nPaste the following into the file:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go"},'package main\n\nimport (\n "testing"\n\n "github.com/foomo/gocontentful/test"\n "github.com/foomo/gocontentful/test/testapi"\n "github.com/sirupsen/logrus"\n "github.com/stretchr/testify/require"\n)\n\nfunc TestTheAPI(t *testing.T) {\n testLogger := logrus.StandardLogger()\n cc, errClient := testapi.NewOfflineContentfulClient("./test/test-space-export.json",\n test.GetContenfulLogger(testLogger),\n test.LogDebug,\n true)\n require.NoError(t, errClient)\n prods, errProds := cc.GetAllProduct()\n require.NoError(t, errProds)\n testLogger.WithField("prods", len(prods)).Info("Loaded products")\n}\n')),(0,r.kt)("p",null,"The first two lines in the unit test create a logger and an offline gocontentful client. This also\ncaches the content of the space in memory and lets you play with the API. The space includes three\ncontent types (",(0,r.kt)("inlineCode",{parentName:"p"},"brand"),", ",(0,r.kt)("inlineCode",{parentName:"p"},"product")," and ",(0,r.kt)("inlineCode",{parentName:"p"},"category"),") and their relative entries.\nA product has a reference to a brand and to one or more categories. If you open the ",(0,r.kt)("inlineCode",{parentName:"p"},"./test/test-space-export.json")," file\nyou can see how the JSON representation of those entries is. "),(0,r.kt)("p",null,"Getting all the products using the Contentful\nContent Delivery API would normally require dealing with the connection, query and JSON payload, having\nvalue object defined for all content types and functions to convert from/to those structs. With the Go API generated\nby gocontentful all you need to do to load all the products looks like this single line:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go"}," prods, errProds := cc.GetAllProduct()\n")),(0,r.kt)("p",null,"Open a terminal and from the repository home directory run the test. Your output should looks similar to this:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-shell"},"$ go test -run TestTheAPI\nINFO[0000] loading space from local file assets=12 entries=9\nINFO[0000] contentful cache update queued task=UpdateCache\nINFO[0000] contentful cache worker starting task=UpdateCache\nINFO[0000] gonna use a local file task=UpdateCache\nINFO[0000] cached all entries of content type contentType=product method=updateCacheForContentType size=4\nINFO[0000] cached all assets contentType=asset method=updateCacheForContentType size=12\nINFO[0000] cached all entries of content type contentType=brand method=updateCacheForContentType size=3\nINFO[0000] cached all entries of content type contentType=category method=updateCacheForContentType size=2\nINFO[0000] space caching done, time recorded task=UpdateCache time elapsed=179.357792ms\nINFO[0000] contentful cache update returning task=UpdateCache\nINFO[0000] contentful cache update returning task=UpdateCache\nINFO[0000] Loaded products prods=4\nPASS\nok github.com/foomo/gocontentful 0.484s\n")),(0,r.kt)("p",null,"The last line shows that we loaded 4 products. Let's go ahead and play with the API.\nWe'll load a specific product and log its name. Add this at the end of the unit test:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go"},'prod, errProd := cc.GetProductByID("6dbjWqNd9SqccegcqYq224")\nrequire.NoError(t, errProd)\nprodName := prod.ProductName("de")\ntestLogger.WithField("name", prodName).Info("Product loaded")\n')),(0,r.kt)("p",null,"This will be the output at the end of the log when you run the test:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-shell"},'INFO[0000] Product loaded name="Whisk Beater"\n')),(0,r.kt)("p",null,"The first line loads the product from the space. This is a ",(0,r.kt)("inlineCode",{parentName:"p"},"*testapi.CfProduct")," pointer. The type is generated\nand carries all the getter and setter methods to access all the fields and more, e.g. ProductName().\nNote that when calling ProductName() we passed ",(0,r.kt)("inlineCode",{parentName:"p"},'"de"')," as a parameter. This is the locale and it's\nentirely optional and useful when your space supports multiple locales for translation.\nIf you omit it, the default space locale will be used."),(0,r.kt)("p",null,"Let's load the product's brand:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go"},'// Get the brand\nbrandReference := prod.Brand()\nbrand := brandReference.VO.(*testapi.CfBrand)\ntestLogger.WithField("name", brand.CompanyName()).Info("Brand")\n')),(0,r.kt)("p",null,"Note a couple of things here:"),(0,r.kt)("ul",null,(0,r.kt)("li",{parentName:"ul"},"The product has a Brand() method that represents and retrieves the reference from the product entry to the brand entry"),(0,r.kt)("li",{parentName:"ul"},"The returned object is not a ",(0,r.kt)("inlineCode",{parentName:"li"},"*testapi.CfBrand")," pointer as you might expect. This is because a reference field in Contentful\ncan point to entries of multiple content types and that doesn't play nice with Go's static typing.\nThe object returned is a generic ",(0,r.kt)("inlineCode",{parentName:"li"},"*testapi.EntryReference")," that, among other, includes an ",(0,r.kt)("inlineCode",{parentName:"li"},"interface{}")," attribute (VO) that\nis the actual ",(0,r.kt)("inlineCode",{parentName:"li"},"*testapi.CfBrand"),". That's why in the second line we had to cast it.")),(0,r.kt)("p",null,"The test now logs the brand company name:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-shell"},'INFO[0000] Brand name="Normann Copenhagen"\n')),(0,r.kt)("p",null,"What if we want to follow the reference the other way around and find out which entries link to this brand?"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go"},'parentRefs, errParents := brand.GetParents()\nrequire.NoError(t, errParents)\ntestLogger.WithField("parent count", len(parentRefs)).Info("Parents")\nfor _, parentRef := range parentRefs {\n switch parentRef.ContentType {\n case testapi.ContentTypeProduct:\n parentProduct := parentRef.VO.(*testapi.CfProduct)\n testLogger.WithField("name", parentProduct.ProductName()).Info("Parent product")\n }\n}\n')),(0,r.kt)("p",null,"Again, the ",(0,r.kt)("inlineCode",{parentName:"p"},"GetParents()")," method returns references and not objects. It's a good idea to use the reference ",(0,r.kt)("inlineCode",{parentName:"p"},"ContentType")," attribute\nto switch before casting the VO to the type, because as we just said referenced objects can come in different types and casting\nto the wrong one would make the runtime panic. Running the test we find out the two products that belong to this brand:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-shell"},'INFO[0000] Parents parent count=2\nINFO[0000] Parent product name="Whisk Beater"\nINFO[0000] Parent product name="Hudson Wall Cup"\n')))}d.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/5ce51c20.40687f90.js b/assets/js/5ce51c20.40687f90.js deleted file mode 100644 index cb91895..0000000 --- a/assets/js/5ce51c20.40687f90.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkfoomo=self.webpackChunkfoomo||[]).push([[3122],{3905:(e,t,n)=>{n.d(t,{Zo:()=>u,kt:()=>h});var r=n(7294);function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function l(e){for(var t=1;t=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var i=r.createContext({}),c=function(e){var t=r.useContext(i),n=t;return e&&(n="function"==typeof e?e(t):l(l({},t),e)),n},u=function(e){var t=c(e.components);return r.createElement(i.Provider,{value:t},e.children)},p={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},f=r.forwardRef((function(e,t){var n=e.components,a=e.mdxType,o=e.originalType,i=e.parentName,u=s(e,["components","mdxType","originalType","parentName"]),f=c(n),h=a,d=f["".concat(i,".").concat(h)]||f[h]||p[h]||o;return n?r.createElement(d,l(l({ref:t},u),{},{components:n})):r.createElement(d,l({ref:t},u))}));function h(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var o=n.length,l=new Array(o);l[0]=f;var s={};for(var i in t)hasOwnProperty.call(t,i)&&(s[i]=t[i]);s.originalType=e,s.mdxType="string"==typeof e?e:a,l[1]=s;for(var c=2;c{n.r(t),n.d(t,{assets:()=>i,contentTitle:()=>l,default:()=>p,frontMatter:()=>o,metadata:()=>s,toc:()=>c});var r=n(7462),a=(n(7294),n(3905));const o={},l="API Reference",s={unversionedId:"backend/gocontentful/api-reference",id:"backend/gocontentful/api-reference",title:"API Reference",description:"Client and cache",source:"@site/docs/backend/gocontentful/99-api-reference.md",sourceDirName:"backend/gocontentful",slug:"/backend/gocontentful/api-reference",permalink:"/docs/backend/gocontentful/api-reference",draft:!1,editUrl:"https://github.com/foomo/foomo-docs/tree/main/foomo/docs/backend/gocontentful/99-api-reference.md",tags:[],version:"current",sidebarPosition:99,frontMatter:{},sidebar:"backendSidebar",previous:{title:"Caching",permalink:"/docs/backend/gocontentful/caching"},next:{title:"Gograpple",permalink:"/docs/backend/gograpple"}},i={},c=[{value:"Client and cache",id:"client-and-cache",level:2},{value:"Content functions and methods",id:"content-functions-and-methods",level:2},{value:"Entry field getters and setters",id:"entry-field-getters-and-setters",level:2},{value:"Entry write ops (only available for ClientModeCMA)",id:"entry-write-ops--only-available-for-clientmodecma",level:2},{value:"Asset functions",id:"asset-functions",level:3},{value:"Other helper functions and methods",id:"other-helper-functions-and-methods",level:3},{value:"Constants and global variables",id:"constants-and-global-variables",level:3}],u={toc:c};function p(e){let{components:t,...n}=e;return(0,a.kt)("wrapper",(0,r.Z)({},u,n,{components:t,mdxType:"MDXLayout"}),(0,a.kt)("h1",{id:"api-reference"},"API Reference"),(0,a.kt)("h2",{id:"client-and-cache"},"Client and cache"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"NewContentfulClient(\n spaceID string, \n clientMode string, \n clientKey string, \n optimisticPageSize uint16, \n logFn func(fields map[string]interface{}, level int, args ...interface{}), \n logLevel int, \n debug bool,\n ) (*ContentfulClient, error)\n")),(0,a.kt)("p",null,"Creates a Contentful client, ",(0,a.kt)("a",{parentName:"p",href:"./working-with-gocontentful-api#get-a-client"},"read this")," for an explanation of all parameters."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"SetOfflineFallback(filename string) error\n")),(0,a.kt)("p",null,"Sets a path to a space export JSON file to be used as a fallback in case\nContentful is not reachable when you call UpdateCache() on the client. This ensures availability\nbut can make your content look outdated if the export file is older (and typically it is)."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"NewOfflineContentfulClient(\n filename string, \n logFn func(fields map[string]interface{}, level int, args ...interface{}), \n logLevel int, \n cacheAssets bool,\n ) (*ContentfulClient, error)\n")),(0,a.kt)("p",null,"Creates an offline Contentful client that loads space data from a JSON file containing a space export. "),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"(cc *ContentfulClient) SetEnvironment(environment string)\n")),(0,a.kt)("p",null,"Sets the Contentful client's environment. All subsequent API calls will be directed to that environment in the selected\nspace. Pass an empty string to reset to the ",(0,a.kt)("em",{parentName:"p"},"master")," environment."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"(cc *ContentfulClient) CacheHasContentType(contentTypeID string) bool\n")),(0,a.kt)("p",null,"Returns true if the specified contentTypeID is cached by the client, false otherwise."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"(cc *ContentfulClient) SetCacheUpdateTimeout(seconds int64)\n")),(0,a.kt)("p",null,"Sets the cache update timeout to the specified length. A new client by default times out\ncaching in 120 seconds. A timeout is used to prevent deadlocks when a service panics and recovers\nwhile the gocontentful goroutines are running and the main caching job is waiting for all\nthem to finish."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"(cc *ContentfulClient) SetSyncMode(mode bool) error\n")),(0,a.kt)("p",null,"Switches on/off the cache sync mode. This method will return an error if called on an offline client. "),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"(cc *ContentfulClient) ResetSync()\n")),(0,a.kt)("p",null,"Resets the sync token: the next call to UpdateCache() will rebuild the cache from scratch."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"(cc *ContentfulClient) UpdateCache(ctx context.Context, contentTypes []string, cacheAssets bool) error\n")),(0,a.kt)("p",null,"Builds or re-builds the entire client cache."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"(cc *ContentfulClient) UpdateCacheForEntity(ctx context.Context, sysType string, contentType string, entityID string) error\n")),(0,a.kt)("p",null,"Updates a single entry or asset (the sysType can take const sysTypeEntry or sysTypeAsset values) in the cache."),(0,a.kt)("h2",{id:"content-functions-and-methods"},"Content functions and methods"),(0,a.kt)("p",null,(0,a.kt)("em",{parentName:"p"},'For these we\'re assuming a content type named "Person".')),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"NewCfPerson(contentfulClient ...*ContentfulClient) (cfPerson *CfPerson)\n")),(0,a.kt)("p",null,"Creates a new Person entry. You can manipulate and upsert this later. The contentfulClient parameter is optional but you\nmight want to pass it most of the times or you won't be able to save the entry."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"(cc *ContentfulClient) GetAllPerson() (voMap map[string]*CfPerson, err error)\n")),(0,a.kt)("p",null,"Retrieves all Person entries from the client and returnes a map where the key is the ID of the entry and the value is\nthe Go value object for that entry."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"(cc *ContentfulClient) GetFilteredPerson(query *contentful.Query) (voMap map[string]*CfPerson, err error)\n")),(0,a.kt)("p",null,"Retrieves Person entries matching the specified query."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"(cc *ContentfulClient) GetPersonByID(id string, forceNoCache ...bool) (vo *CfPerson, err error)\n")),(0,a.kt)("p",null,"Retrieves the Person entry with the specified ID. The optional ",(0,a.kt)("em",{parentName:"p"},"forceNoCache")," parameter, if true,\nmakes the function bypass the existing cache and load a fresh copy of the entry from Contentful."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"(ref ContentfulReferencedEntry) ContentType() (contentType string)\n\n")),(0,a.kt)("p",null,"Returns the Sys.ID of the content type of the referenced entry"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"(cc *ContentfulClient) GetContentTypeOfID(ID string) (contentType string)\n")),(0,a.kt)("p",null,"Returns the Contentful content type of an entry ID."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"(vo *CfPerson) ToReference() (refSys ContentTypeSys)\n")),(0,a.kt)("p",null,"Converts a value object into a reference that can be added to a reference field of an entry. Note that functions that\nretrieve referenced entries return a more flexible and useful ",(0,a.kt)("em",{parentName:"p"},"[]*EntryReference")," (see Quickstart above) but to store\na reference you need a ContentTypeSys."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"(vo *CfPerson) GetParents() (parents []EntryReference, err error)\n(ref *EntryReference) GetParents(cc *ContentfulClient) (parents []EntryReference, err error)\n")),(0,a.kt)("p",null,"Return a slice of EntryReference objects that represent entries that reference the value object or the entry reference."),(0,a.kt)("p",null,"Note that in case of parents of an entry reference you need to pass a pointer to a ContentfulClient because\nEntryReference objects are generic and can't carry any."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"(vo *CfPerson) GetPublishingStatus() string\n")),(0,a.kt)("p",null,"Returns the publishing status of the entry as per the Contentful editor UI.\nValue returned is one of the following:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'const (\n StatusDraft = "draft"\n StatusChanged = "changed"\n StatusPublished = "published"\n)\n')),(0,a.kt)("h2",{id:"entry-field-getters-and-setters"},"Entry field getters and setters"),(0,a.kt)("p",null,"Field getters are named after the field ID in Contentful and return the proper type. For example, if the Person content\ntype has a Symbol (short text) field named 'Name', this will be the getter:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"(vo *CfPerson) Name(locale ...string) (string)\n")),(0,a.kt)("p",null,"The locale parameter is optional and if not passed, the function will return the value for the default locale of the\nspace. If the locale is specified and it's not available for the space, an error is returned. If the locale is valid\nbut a value doesn't exist for the field and locale, the function will return the value for the default locale if that's\nspecified as a fallback locale in the space definition in Contentful, otherwise will return an error."),(0,a.kt)("p",null,"Possible return types are:"),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("em",{parentName:"li"},"string")," for fields of types Symbol, Text, Date"),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("em",{parentName:"li"},"[]string")," for fields of type List"),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("em",{parentName:"li"},"float64")," for fields of type Integer or Number"),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("em",{parentName:"li"},"bool")," for fields of type Boolean"),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("em",{parentName:"li"},"*ContentTypeSys")," for single reference fields"),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("em",{parentName:"li"},"[]*ContentTypeSys")," for multiple reference fields"),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("em",{parentName:"li"},"*ContentTypeFieldLocation")," for fields of type Location"),(0,a.kt)("li",{parentName:"ul"},"*interface{} for fields of type Object or RichText")),(0,a.kt)("p",null,"If logLevel is set to LogDebug retrieving the value of a field that is not set and so not available in the API response\neven as a fallback to the default locale will log the event. This can become incredibly verbose, use with care."),(0,a.kt)("p",null,"Field setters are named after the field ID in Contentful and require to pass in the proper type. See FIELD GETTERS above\nfor a reference. Example:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"(vo *CfPerson) SetName(title string, locale ...string) (err error)\n")),(0,a.kt)("h2",{id:"entry-write-ops--only-available-for-clientmodecma"},"Entry write ops (only available for ",(0,a.kt)("em",{parentName:"h2"},"ClientModeCMA"),")"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"(vo *CfPerson) UpsertEntry(cc *ContentfulClient) (err error)\n")),(0,a.kt)("p",null,'Upserts the entry. This will appear as "Draft" (if it\'s a new entry) or "Changed" if it\'s already existing. In the\nlatter case, you will need to retrieve the entry with one of the Manage* functions above to acquire the Sys object\nthat contains the version information. Otherwise the API call will fail with a "Version mismatch" error.'),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"(vo *CfPerson) PublishEntry(cc *ContentfulClient) (err error)\n")),(0,a.kt)("p",null,'Publishes the entry. Note that before publishing you will need to retrieve the entry with one of the Manage* functions\nabove to acquire the Sys object that contains the version information. Otherwise the API call will fail with a "Version\nmismatch" error. This is needed even if you have just upserted the entry with the function above!'),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"(vo *CfPerson) UnpublishEntry(cc *ContentfulClient) (err error)\n")),(0,a.kt)("p",null,'Unpublishes the entry. Note that before unpublishing you will need to retrieve the entry with one of the Manage*\nfunctions above to acquire the Sys object that contains the version information. Otherwise the API call will fail with\na "Version mismatch" error. This is needed even if you have just upserted the entry with the function above!'),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"(vo *CfPerson) UpdateEntry(cc *ContentfulClient) (err error)\n")),(0,a.kt)("p",null,'Shortcut function that upserts and publishes the entry. Note that before calling this you will need to retrieve the\nentry with one of the Manage* functions above to acquire the Sys object that contains the version information. Otherwise\nthe API call will fail with a "Version mismatch" error. Using this shortcut function avoids retrieving the entry twice.'),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"(vo *CfPerson) DeleteEntry(cc *ContentfulClient) (err error)\n")),(0,a.kt)("p",null,"Unpublishes and deletes the entry"),(0,a.kt)("h3",{id:"asset-functions"},"Asset functions"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"(cc *ContentfulClient) DeleteAsset(asset *contentful.Asset) error\n")),(0,a.kt)("p",null,"Deletes an asset from the space (only available in CMA)"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"(cc *ContentfulClient) DeleteAssetFromCache(key string) error {\n")),(0,a.kt)("p",null,"Deletes an asset from the client's cache"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"(cc *ContentfulClient) GetAllAssets() (map[string]*contentful.Asset, error)\n")),(0,a.kt)("p",null,"Retrieve all assets from a space"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"(cc *ContentfulClient) GetAssetByID(id string, forceNoCache ...bool) (*contentful.Asset, error)\n")),(0,a.kt)("p",null,"Retrieve an asset from a space by its ID. The optional ",(0,a.kt)("em",{parentName:"p"},"forceNoCache")," parameter, if true,\nmakes the function bypass the existing cache and load a fresh copy of the asset from Contentful."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"NewAssetFromURL(id string, uploadUrl string, imageFileType string, title string, locale ...string) *contentful.Asset\n")),(0,a.kt)("p",null,"Creates an Asset from an URL of an existing file online (you still need to upsert it later)."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"ToAssetReference(asset *contentful.Asset) (refSys ContentTypeSys)\n")),(0,a.kt)("p",null,"Converts the asset to a reference. You need to do this before you add the asset to a reference field of an entry."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"(cc *ContentfulClient) DeleteAsset(asset *contentful.Asset) error\n")),(0,a.kt)("p",null,"Deletes an asset from a space by its ID (only available for ",(0,a.kt)("em",{parentName:"p"},"ClientModeCMA"),")"),(0,a.kt)("h3",{id:"other-helper-functions-and-methods"},"Other helper functions and methods"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"(cc *ContentfulClient) BrokenReferences() (brokenReferences []BrokenReference)\n")),(0,a.kt)("p",null,"Returns a slice of BrokenReference objects with details of where entries have been\nreferenced but they are not found in the cache. This might naturally return false\npositives for content types that are in the space but not included in the cache."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"FieldToObject(jsonField interface{}, targetObject interface{}) error\n")),(0,a.kt)("p",null,"Converts a JSON field into an object. Make sure you pass a pointer to an object which type has JSON definition for all\nfields you want to retrieve."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"HtmlToRichText(htmlSrc string) *RichTextNode\n")),(0,a.kt)("p",null,"Converts an HTML fragment to a RichTextNode. This is useful to migrate data from third-party systems to Contentful or\nsupport HTML paste operations in Web applications. It currently supports headings, paragraphs, hyperlinks, italic and\nbold tags, horizontal rules, blockquote, ordered and unordered lists, code. Unknown tags are stripped. This function\ndoesn't return any error as it converts the input text into something as good as possible, without validation."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"RichTextToHtml(rt interface{}, linkResolver LinkResolverFunc, entryLinkResolver EntryLinkResolverFunc, imageResolver ImageResolverFunc, locale Locale) (string, error) {\n")),(0,a.kt)("p",null,"Converts an interface representing a Contentful RichText value (usually from a field getter) into HTML.\nThe function takes in three (optional) functions as parameters to resolve\nhyperlink URLs, permalinks to entries and to derive IMG tag attributes for embedded image assets. The three functions\nreturn a map of attributes for the HTML tag the RichTextToHtml function will emit (either an A or an IMG) and have the\nfollowing signature. Note that the ImageResolverFunc function must return a customHTML value that can be empty but if\nset it will substitute the IMG tag with the returned HTML snippet. This allows you to emit custom mark-up for your\nimages, e.g. a PICTURE tag."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"type LinkResolverFunc func(url string) (resolvedAttrs map[string]string, resolveError error)\n\ntype EntryLinkResolverFunc func(entryID string, locale Locale) (resolvedAttrs map[string]string, resolveError error)\n\ntype ImageResolverFunc func(assetID string, locale Locale) (attrs map[string]string, customHTML string, resolveError error)\n\ntype EmbeddedEntryResolverFunc func(entryID string, locale Locale) (html string, resolveError error)\n")),(0,a.kt)("p",null,"All the three functions above can be passed as nil with different levels of graceful degrading."),(0,a.kt)("h3",{id:"constants-and-global-variables"},"Constants and global variables"),(0,a.kt)("p",null,"Each generated content type library file exports a constant with the Contentful ID of the content type itself, for\nexample in ",(0,a.kt)("em",{parentName:"p"},"contentful_vo_lib_person.go"),":"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'const ContentTypePerson = "person"\n')),(0,a.kt)("p",null,"Constants are available for each locale supported by the space at the time of code generation, e.g.:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'const SpaceLocaleGerman Locale = "de"\nconst SpaceLocaleFrench Locale = "fr"\nconst defaultLocale Locale = SpaceLocaleGerman\n')),(0,a.kt)("p",null,"Four levels of logging are supported (even if only partially used at this time):"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"const (\n LogDebug = 0\n LogInfo = 1\n LogWarn = 2\n LogError = 3\n)\n")),(0,a.kt)("p",null,"A global variable named ",(0,a.kt)("em",{parentName:"p"},"SpaceContentTypeInfoMap")," contains an ID-indexed map of all content types\nwith their names and descriptions"))}p.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/935f2afb.7d9a5250.js b/assets/js/935f2afb.7d9a5250.js deleted file mode 100644 index af7195b..0000000 --- a/assets/js/935f2afb.7d9a5250.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkfoomo=self.webpackChunkfoomo||[]).push([[53],{1109:e=>{e.exports=JSON.parse('{"pluginId":"default","version":"current","label":"Next","banner":null,"badge":false,"noIndex":false,"className":"docs-version-current","isLast":true,"docsSidebars":{"generalSidebar":[{"type":"link","label":"Intro","href":"/docs/general/intro","docId":"general/intro"},{"type":"category","label":"Setup","collapsible":true,"collapsed":false,"items":[{"type":"link","label":"Workplace","href":"/docs/general/setup/workplace","docId":"general/setup/workplace"},{"type":"link","label":"Computer","href":"/docs/general/setup/computer","docId":"general/setup/computer"}]},{"type":"category","label":"Work","collapsible":true,"collapsed":false,"items":[{"type":"link","label":"Working as a software developer","href":"/docs/general/work/general","docId":"general/work/general"},{"type":"link","label":"Working remotely","href":"/docs/general/work/remote-work","docId":"general/work/remote-work"}]},{"type":"link","label":"Package managers","href":"/docs/general/package-managers","docId":"general/package-managers"},{"type":"category","label":"Technologies","collapsible":true,"collapsed":false,"items":[{"type":"link","label":"SSE Server Sent Events","href":"/docs/general/technologies/sse","docId":"general/technologies/SSE"}]},{"type":"link","label":"(Random) essentials","href":"/docs/general/essentials","docId":"general/essentials"},{"type":"link","label":"Security","href":"/docs/general/security","docId":"general/security"},{"type":"category","label":"utilities","collapsible":true,"collapsed":false,"items":[{"type":"link","label":"k9s","href":"/docs/general/utilities/k9s","docId":"general/utilities/k9s"}]}],"pmSidebar":[{"type":"link","label":"Project Managament","href":"/docs/project-management/intro","docId":"project-management/intro"},{"type":"link","label":"Responsibility","href":"/docs/project-management/responsibility","docId":"project-management/responsibility"}],"backendSidebar":[{"type":"link","label":"Intro","href":"/docs/backend/intro","docId":"backend/intro"},{"type":"link","label":"RTFM","href":"/docs/backend/rtfm","docId":"backend/rtfm"},{"type":"link","label":"Setup","href":"/docs/backend/setup","docId":"backend/setup"},{"type":"category","label":"Go by example","collapsible":true,"collapsed":false,"items":[{"type":"link","label":"map races","href":"/docs/backend/go-by-example/map-racing","docId":"backend/go-by-example/map-racing"},{"type":"link","label":"what you should now about nil maps","href":"/docs/backend/go-by-example/nil-maps","docId":"backend/go-by-example/nil-maps"},{"type":"link","label":"panic and recover","href":"/docs/backend/go-by-example/panic-and-recover","docId":"backend/go-by-example/panic-and-recover"},{"type":"link","label":"ranging and looping","href":"/docs/backend/go-by-example/ranging","docId":"backend/go-by-example/ranging"},{"type":"link","label":"yaml magic","href":"/docs/backend/go-by-example/yaml-magic","docId":"backend/go-by-example/yaml-magic"}]},{"type":"category","label":"gocontentful","collapsible":true,"collapsed":false,"items":[{"type":"link","label":"Introduction","href":"/docs/backend/gocontentful/introduction","docId":"backend/gocontentful/introduction"},{"type":"link","label":"Getting started","href":"/docs/backend/gocontentful/getting-started","docId":"backend/gocontentful/getting-started"},{"type":"link","label":"Play with the test API","href":"/docs/backend/gocontentful/test-api","docId":"backend/gocontentful/test-api"},{"type":"link","label":"Working with the Gocontentful API","href":"/docs/backend/gocontentful/working-with-gocontentful-api","docId":"backend/gocontentful/working-with-gocontentful-api"},{"type":"link","label":"Caching","href":"/docs/backend/gocontentful/caching","docId":"backend/gocontentful/caching"},{"type":"link","label":"API Reference","href":"/docs/backend/gocontentful/api-reference","docId":"backend/gocontentful/api-reference"}]},{"type":"link","label":"Gograpple","href":"/docs/backend/gograpple","docId":"backend/gograpple"}],"frontendSidebar":[{"type":"link","label":"Intro","href":"/docs/frontend/intro","docId":"frontend/intro"},{"type":"link","label":"CSS","href":"/docs/frontend/css","docId":"frontend/css"},{"type":"link","label":"RTFM","href":"/docs/frontend/rtfm","docId":"frontend/rtfm"},{"type":"link","label":"Setup","href":"/docs/frontend/setup","docId":"frontend/setup"},{"type":"link","label":"Stack","href":"/docs/frontend/stack","docId":"frontend/stack"},{"type":"link","label":"Performance","href":"/docs/frontend/performance","docId":"frontend/performance"},{"type":"category","label":"TypeScript","collapsible":true,"collapsed":false,"items":[{"type":"link","label":"Objects","href":"/docs/frontend/typescript/objects","docId":"frontend/typescript/objects"},{"type":"link","label":"Spreading","href":"/docs/frontend/typescript/spreading","docId":"frontend/typescript/spreading"}]},{"type":"link","label":"Debugging in JavaScript","href":"/docs/frontend/debugging_js","docId":"frontend/debugging_js"},{"type":"link","label":"Pittfals","href":"/docs/frontend/pitfalls","docId":"frontend/pitfalls"},{"type":"link","label":"vscode","href":"/docs/frontend/vscode","docId":"frontend/vscode"}],"devopsSidebar":[{"type":"link","label":"Intro","href":"/docs/devops/intro","docId":"devops/intro"},{"type":"category","label":"Kubernetes","collapsible":true,"collapsed":false,"items":[{"type":"link","label":"Spot Instance Node Pools","href":"/docs/devops/kubernetes/spot-instance-node-pools","docId":"devops/kubernetes/spot-instance-node-pools"}]},{"type":"link","label":"k8s","href":"/docs/devops/k8s","docId":"devops/k8s"},{"type":"category","label":"Monitoring","collapsible":true,"collapsed":false,"items":[{"type":"link","label":"Intro","href":"/docs/devops/monitoring/intro","docId":"devops/monitoring/intro"},{"type":"link","label":"Grafana","href":"/docs/devops/monitoring/grafana","docId":"devops/monitoring/grafana"},{"type":"link","label":"Jaeger","href":"/docs/devops/monitoring/jaeger","docId":"devops/monitoring/jaeger"}]},{"type":"link","label":"Bookmarks","href":"/docs/devops/bookmarks","docId":"devops/bookmarks"}],"projectsSidebar":[{"type":"link","label":"Intro","href":"/docs/projects/intro","docId":"projects/intro"},{"type":"link","label":"Architecture","href":"/docs/projects/architecture","docId":"projects/architecture"},{"type":"category","label":"CMS","collapsible":true,"collapsed":false,"items":[{"type":"link","label":"Intro","href":"/docs/projects/cms/intro","docId":"projects/cms/intro"},{"type":"link","label":"contentserver","href":"/docs/projects/cms/contentserver","docId":"projects/cms/contentserver"},{"type":"link","label":"contentful","href":"/docs/projects/cms/contentful","docId":"projects/cms/contentful"}]},{"type":"link","label":"gotsrpc","href":"/docs/projects/gotsrpc","docId":"projects/gotsrpc"},{"type":"category","label":"libraries","collapsible":true,"collapsed":false,"items":[{"type":"link","label":"keel","href":"/docs/projects/libraries/keel","docId":"projects/libraries/keel"}]},{"type":"link","label":"pagespeed exporter","href":"/docs/projects/pagespeed-exporter","docId":"projects/pagespeed-exporter"},{"type":"link","label":"Site reliability","href":"/docs/projects/site-reliability/","docId":"projects/site-reliability/site-reliability"},{"type":"category","label":"utilities","collapsible":true,"collapsed":false,"items":[{"type":"link","label":"gograpple","href":"/docs/projects/utilities/gograpple","docId":"projects/utilities/gograpple"}]},{"type":"link","label":"webgrapple","href":"/docs/projects/webgrapple","docId":"projects/webgrapple"}]},"docs":{"backend/go-by-example/map-racing":{"id":"backend/go-by-example/map-racing","title":"map races","description":"","sidebar":"backendSidebar"},"backend/go-by-example/nil-maps":{"id":"backend/go-by-example/nil-maps","title":"what you should now about nil maps","description":"{e.exports=JSON.parse('{"pluginId":"default","version":"current","label":"Next","banner":null,"badge":false,"noIndex":false,"className":"docs-version-current","isLast":true,"docsSidebars":{"generalSidebar":[{"type":"link","label":"Intro","href":"/docs/general/intro","docId":"general/intro"},{"type":"category","label":"Setup","collapsible":true,"collapsed":false,"items":[{"type":"link","label":"Workplace","href":"/docs/general/setup/workplace","docId":"general/setup/workplace"},{"type":"link","label":"Computer","href":"/docs/general/setup/computer","docId":"general/setup/computer"}]},{"type":"category","label":"Work","collapsible":true,"collapsed":false,"items":[{"type":"link","label":"Working as a software developer","href":"/docs/general/work/general","docId":"general/work/general"},{"type":"link","label":"Working remotely","href":"/docs/general/work/remote-work","docId":"general/work/remote-work"}]},{"type":"link","label":"Package managers","href":"/docs/general/package-managers","docId":"general/package-managers"},{"type":"category","label":"Technologies","collapsible":true,"collapsed":false,"items":[{"type":"link","label":"SSE Server Sent Events","href":"/docs/general/technologies/sse","docId":"general/technologies/SSE"}]},{"type":"link","label":"(Random) essentials","href":"/docs/general/essentials","docId":"general/essentials"},{"type":"link","label":"Security","href":"/docs/general/security","docId":"general/security"},{"type":"category","label":"utilities","collapsible":true,"collapsed":false,"items":[{"type":"link","label":"k9s","href":"/docs/general/utilities/k9s","docId":"general/utilities/k9s"}]}],"pmSidebar":[{"type":"link","label":"Project Managament","href":"/docs/project-management/intro","docId":"project-management/intro"},{"type":"link","label":"Responsibility","href":"/docs/project-management/responsibility","docId":"project-management/responsibility"}],"backendSidebar":[{"type":"link","label":"Intro","href":"/docs/backend/intro","docId":"backend/intro"},{"type":"link","label":"RTFM","href":"/docs/backend/rtfm","docId":"backend/rtfm"},{"type":"link","label":"Setup","href":"/docs/backend/setup","docId":"backend/setup"},{"type":"category","label":"Go by example","collapsible":true,"collapsed":false,"items":[{"type":"link","label":"map races","href":"/docs/backend/go-by-example/map-racing","docId":"backend/go-by-example/map-racing"},{"type":"link","label":"what you should now about nil maps","href":"/docs/backend/go-by-example/nil-maps","docId":"backend/go-by-example/nil-maps"},{"type":"link","label":"panic and recover","href":"/docs/backend/go-by-example/panic-and-recover","docId":"backend/go-by-example/panic-and-recover"},{"type":"link","label":"ranging and looping","href":"/docs/backend/go-by-example/ranging","docId":"backend/go-by-example/ranging"},{"type":"link","label":"yaml magic","href":"/docs/backend/go-by-example/yaml-magic","docId":"backend/go-by-example/yaml-magic"}]},{"type":"link","label":"Gograpple","href":"/docs/backend/gograpple","docId":"backend/gograpple"}],"frontendSidebar":[{"type":"link","label":"Intro","href":"/docs/frontend/intro","docId":"frontend/intro"},{"type":"link","label":"CSS","href":"/docs/frontend/css","docId":"frontend/css"},{"type":"link","label":"RTFM","href":"/docs/frontend/rtfm","docId":"frontend/rtfm"},{"type":"link","label":"Setup","href":"/docs/frontend/setup","docId":"frontend/setup"},{"type":"link","label":"Stack","href":"/docs/frontend/stack","docId":"frontend/stack"},{"type":"link","label":"Performance","href":"/docs/frontend/performance","docId":"frontend/performance"},{"type":"category","label":"TypeScript","collapsible":true,"collapsed":false,"items":[{"type":"link","label":"Objects","href":"/docs/frontend/typescript/objects","docId":"frontend/typescript/objects"},{"type":"link","label":"Spreading","href":"/docs/frontend/typescript/spreading","docId":"frontend/typescript/spreading"}]},{"type":"link","label":"Debugging in JavaScript","href":"/docs/frontend/debugging_js","docId":"frontend/debugging_js"},{"type":"link","label":"Pittfals","href":"/docs/frontend/pitfalls","docId":"frontend/pitfalls"},{"type":"link","label":"vscode","href":"/docs/frontend/vscode","docId":"frontend/vscode"}],"devopsSidebar":[{"type":"link","label":"Intro","href":"/docs/devops/intro","docId":"devops/intro"},{"type":"category","label":"Kubernetes","collapsible":true,"collapsed":false,"items":[{"type":"link","label":"Spot Instance Node Pools","href":"/docs/devops/kubernetes/spot-instance-node-pools","docId":"devops/kubernetes/spot-instance-node-pools"}]},{"type":"link","label":"k8s","href":"/docs/devops/k8s","docId":"devops/k8s"},{"type":"category","label":"Monitoring","collapsible":true,"collapsed":false,"items":[{"type":"link","label":"Intro","href":"/docs/devops/monitoring/intro","docId":"devops/monitoring/intro"},{"type":"link","label":"Grafana","href":"/docs/devops/monitoring/grafana","docId":"devops/monitoring/grafana"},{"type":"link","label":"Jaeger","href":"/docs/devops/monitoring/jaeger","docId":"devops/monitoring/jaeger"}]},{"type":"link","label":"Bookmarks","href":"/docs/devops/bookmarks","docId":"devops/bookmarks"}],"projectsSidebar":[{"type":"link","label":"Intro","href":"/docs/projects/intro","docId":"projects/intro"},{"type":"link","label":"Architecture","href":"/docs/projects/architecture","docId":"projects/architecture"},{"type":"category","label":"CMS","collapsible":true,"collapsed":false,"items":[{"type":"link","label":"Intro","href":"/docs/projects/cms/intro","docId":"projects/cms/intro"},{"type":"link","label":"contentserver","href":"/docs/projects/cms/contentserver","docId":"projects/cms/contentserver"},{"type":"link","label":"contentful","href":"/docs/projects/cms/contentful","docId":"projects/cms/contentful"},{"type":"category","label":"Gocontentful","collapsible":true,"collapsed":false,"items":[{"type":"link","label":"Introduction","href":"/docs/projects/cms/gocontentful/introduction","docId":"projects/cms/gocontentful/introduction"},{"type":"link","label":"Getting started","href":"/docs/projects/cms/gocontentful/getting-started","docId":"projects/cms/gocontentful/getting-started"},{"type":"link","label":"Play with the test API","href":"/docs/projects/cms/gocontentful/test-api","docId":"projects/cms/gocontentful/test-api"},{"type":"link","label":"Working with the Gocontentful API","href":"/docs/projects/cms/gocontentful/working-with-gocontentful-api","docId":"projects/cms/gocontentful/working-with-gocontentful-api"},{"type":"link","label":"Caching","href":"/docs/projects/cms/gocontentful/caching","docId":"projects/cms/gocontentful/caching"},{"type":"link","label":"API Reference","href":"/docs/projects/cms/gocontentful/api-reference","docId":"projects/cms/gocontentful/api-reference"}]}]},{"type":"link","label":"gotsrpc","href":"/docs/projects/gotsrpc","docId":"projects/gotsrpc"},{"type":"category","label":"libraries","collapsible":true,"collapsed":false,"items":[{"type":"link","label":"keel","href":"/docs/projects/libraries/keel","docId":"projects/libraries/keel"}]},{"type":"link","label":"pagespeed exporter","href":"/docs/projects/pagespeed-exporter","docId":"projects/pagespeed-exporter"},{"type":"link","label":"Site reliability","href":"/docs/projects/site-reliability/","docId":"projects/site-reliability/site-reliability"},{"type":"category","label":"utilities","collapsible":true,"collapsed":false,"items":[{"type":"link","label":"gograpple","href":"/docs/projects/utilities/gograpple","docId":"projects/utilities/gograpple"}]},{"type":"link","label":"webgrapple","href":"/docs/projects/webgrapple","docId":"projects/webgrapple"}]},"docs":{"backend/go-by-example/map-racing":{"id":"backend/go-by-example/map-racing","title":"map races","description":"","sidebar":"backendSidebar"},"backend/go-by-example/nil-maps":{"id":"backend/go-by-example/nil-maps","title":"what you should now about nil maps","description":"{n.d(t,{Zo:()=>u,kt:()=>d});var a=n(7294);function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function c(e){for(var t=1;t=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var l=a.createContext({}),s=function(e){var t=a.useContext(l),n=t;return e&&(n="function"==typeof e?e(t):c(c({},t),e)),n},u=function(e){var t=s(e.components);return a.createElement(l.Provider,{value:t},e.children)},h={inlineCode:"code",wrapper:function(e){var t=e.children;return a.createElement(a.Fragment,{},t)}},p=a.forwardRef((function(e,t){var n=e.components,o=e.mdxType,r=e.originalType,l=e.parentName,u=i(e,["components","mdxType","originalType","parentName"]),p=s(n),d=o,f=p["".concat(l,".").concat(d)]||p[d]||h[d]||r;return n?a.createElement(f,c(c({ref:t},u),{},{components:n})):a.createElement(f,c({ref:t},u))}));function d(e,t){var n=arguments,o=t&&t.mdxType;if("string"==typeof e||o){var r=n.length,c=new Array(r);c[0]=p;var i={};for(var l in t)hasOwnProperty.call(t,l)&&(i[l]=t[l]);i.originalType=e,i.mdxType="string"==typeof e?e:o,c[1]=i;for(var s=2;s{n.r(t),n.d(t,{assets:()=>l,contentTitle:()=>c,default:()=>h,frontMatter:()=>r,metadata:()=>i,toc:()=>s});var a=n(7462),o=(n(7294),n(3905));const r={},c="Caching",i={unversionedId:"backend/gocontentful/caching",id:"backend/gocontentful/caching",title:"Caching",description:"Caching is a fundamental part of working with remote data across the Internet,",source:"@site/docs/backend/gocontentful/05-caching.md",sourceDirName:"backend/gocontentful",slug:"/backend/gocontentful/caching",permalink:"/docs/backend/gocontentful/caching",draft:!1,editUrl:"https://github.com/foomo/foomo-docs/tree/main/foomo/docs/backend/gocontentful/05-caching.md",tags:[],version:"current",sidebarPosition:5,frontMatter:{},sidebar:"backendSidebar",previous:{title:"Working with the Gocontentful API",permalink:"/docs/backend/gocontentful/working-with-gocontentful-api"},next:{title:"API Reference",permalink:"/docs/backend/gocontentful/api-reference"}},l={},s=[{value:"Full cache init and rebuild",id:"full-cache-init-and-rebuild",level:4},{value:"Sync API support",id:"sync-api-support",level:4},{value:"Cache timeout",id:"cache-timeout",level:3},{value:"Asset caching",id:"asset-caching",level:3},{value:"When to use and not use caching",id:"when-to-use-and-not-use-caching",level:3}],u={toc:s};function h(e){let{components:t,...n}=e;return(0,o.kt)("wrapper",(0,a.Z)({},u,n,{components:t,mdxType:"MDXLayout"}),(0,o.kt)("h1",{id:"caching"},"Caching"),(0,o.kt)("p",null,"Caching is a fundamental part of working with remote data across the Internet,\nwhere access is severely impacted by latency and transfer time. In real-world scenarios,\nyou'll always need to keep all the data you need close and sync the changes with the remote\nCMS when they happen. "),(0,o.kt)("p",null,"Gocontentful supports caching out of the box. The client can maintain a cache of an entire space\nor a subset of the content types that can be initialized with a single method call:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-go"},'contentTypes := []string{"person", "pet"}\nerr = cc.UpdateCache(context, contentTypes, true)\n')),(0,o.kt)("p",null,"This makes sense for client modes ",(0,o.kt)("inlineCode",{parentName:"p"},"ClientModeCDA")," and ",(0,o.kt)("inlineCode",{parentName:"p"},"ClientModeCPA")," and not for the management API.\nThe client will download all the entries, convert and store them in the case as\nnative Go value objects. This makes subsequent accesses to the space data an in-memory operation removing all the HTTP\noverhead."),(0,o.kt)("p",null,"The first parameter is the context. If you don't use a context in your application or service just pass ",(0,o.kt)("em",{parentName:"p"},"context.Background()")),(0,o.kt)("p",null,"The third parameter of UpdateCache toggles asset caching on or off. If you deal with assets you want this to be always on."),(0,o.kt)("h4",{id:"full-cache-init-and-rebuild"},"Full cache init and rebuild"),(0,o.kt)("p",null,"By default the client will cache the whole space using 4 parallel workers to speed up the process.\nThis is safe since Contentful allows up to 5 concurrent connections.\nIf you have content types that have a lot of entries, it might make sense to keep them close to each other\nin the content types slice passed to UpdateCache(), so that they will run in parallel and not one after the other."),(0,o.kt)("p",null,"All gocontentful functions that query the space cache-transparent: if a cache is available data will be loaded from\nthere, otherwise it will be sourced from Contentful. This doesn't apply to ",(0,o.kt)("em",{parentName:"p"},"GetFilteredXYZ()")," calls that\nalways need to pass the query to Contentful. "),(0,o.kt)("p",null,"Gocontentful also supports selective entry and asset cache updates through the following method:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-go"},"err = cc.UpdateCacheForEntity(context, sysType, contentType, entityID string)\n")),(0,o.kt)("p",null,"When something changes in the space at Contentful you need to update the cache. For this to happen you need to set\nup a webhook at Contentful and handle its calls in your service through a public HTTP listener.\nWhen a webhook call gets in, you have the choice of updating your cache in different ways:"),(0,o.kt)("ul",null,(0,o.kt)("li",{parentName:"ul"},"You can regenerate the entire CDA cache when something is published because you want production data to\nbe 100% up to date in your application. This can get slow and expensive."),(0,o.kt)("li",{parentName:"ul"},"You can alternatively update a single entry in the cache. This is usually the case for the CPA cache because\nit's a lot faster and that works well for preview features."),(0,o.kt)("li",{parentName:"ul"},"You can use the Sync API, but only limited to ",(0,o.kt)("inlineCode",{parentName:"li"},"ClientModeCDA"),", as explained in the following paragraph.")),(0,o.kt)("p",null,"In any case, if an update fails the previous cache is preserved to prevent service disruption.\nIn the unfortunate case a service or application needs to start and Contentful is not available, Gocontentful can work\nin an offline mode if you call ",(0,o.kt)("em",{parentName:"p"},"SetOfflineFallback")," on the client after you create it passing the path to a space export file."),(0,o.kt)("p",null,"The gocontentful API can work entirely offline too. In this case a cache is created from a space export file and most of the\nfeatures are available (pretty obviously, those that don't require live access to the space, like custom queries). If you update\nthe export file periodically you can even update the cache from the updated file."),(0,o.kt)("h4",{id:"sync-api-support"},"Sync API support"),(0,o.kt)("p",null,"In versions v1.0.12 and newer, gocontentful supports the Contentful Sync API and that's now the recommended way to cache spaces and manage updates.\nSync is enabled by default when you create a client with CDA mode.\nTo enable or disable support for the Sync API explicitly, you can call the SetSyncMode method on the client:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-go"},"cc.SetSyncMode(true)\n")),(0,o.kt)("p",null,"With sync on, the cache updates will happen transparently through downloads of incremental changes.\nThe syntax to update the cache doesn't change, just call ",(0,o.kt)("em",{parentName:"p"},"UpdateCache")," on the client as usual."),(0,o.kt)("p",null,"The initialization of the cache will be slower when ",(0,o.kt)("em",{parentName:"p"},"SyncMode")," is on compared to the legacy full cache init because sync calls cannot be parallelized.\nSubsequent updates though will be much faster because only changes in the space from the previous sync will be downloaded.\nThis includes entries and assets that were deleted. In case of need you can call ",(0,o.kt)("em",{parentName:"p"},"ResetSync()")," to start over from a fresh empty cache."),(0,o.kt)("p",null,"Note that the Sync API is not officially supported by Contentful on the Preview API. At the time of this writing it seems to work but use it at your own risk."),(0,o.kt)("h3",{id:"cache-timeout"},"Cache timeout"),(0,o.kt)("p",null,"Cache update operations time out by default after 120 seconds. This makes sure that no\nroutine is left hanging, blocking subsequent updates in case the main application or service\nrecovers from a panic. If you need to increase this limit because you have a huge space with\na lot of entries you can use the ",(0,o.kt)("em",{parentName:"p"},"SetCacheUpdateTimeout")," method. See the ",(0,o.kt)("a",{parentName:"p",href:"./api-reference"},"API Reference")," for details."),(0,o.kt)("h3",{id:"asset-caching"},"Asset caching"),(0,o.kt)("p",null,"If you use assets in your space, then you absolutely need to enable them in the ",(0,o.kt)("em",{parentName:"p"},"UpdateCache")," call.\nOtherwise, every time an entry needs to resolve a reference to an asset that single asset will be downloaded\nand that for large spaces with thousands of assets can lead to incredibly slow operation."),(0,o.kt)("h3",{id:"when-to-use-and-not-use-caching"},"When to use and not use caching"),(0,o.kt)("p",null,"Simple answer is: you should almost always use caching. The only scenario where not using\na cache on the client is better is when you only need to download a very limited amount\nof entries (in the order of less than some hundreds) and do that at significant distance in time\n(e.g. every hour). In this case your application code can be simpler and there won't be any\nperformance penalty. The other case is when you need to run a lot of custom queries or\nuse XPath, which is currently not supported by gocontentful directly."))}h.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/a2518eb5.2e7d10a4.js b/assets/js/a2518eb5.2e7d10a4.js new file mode 100644 index 0000000..d5d065a --- /dev/null +++ b/assets/js/a2518eb5.2e7d10a4.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkfoomo=self.webpackChunkfoomo||[]).push([[4794],{3905:(e,t,n)=>{n.d(t,{Zo:()=>p,kt:()=>h});var r=n(7294);function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function l(e){for(var t=1;t=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var i=r.createContext({}),c=function(e){var t=r.useContext(i),n=t;return e&&(n="function"==typeof e?e(t):l(l({},t),e)),n},p=function(e){var t=c(e.components);return r.createElement(i.Provider,{value:t},e.children)},u={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},f=r.forwardRef((function(e,t){var n=e.components,a=e.mdxType,o=e.originalType,i=e.parentName,p=s(e,["components","mdxType","originalType","parentName"]),f=c(n),h=a,d=f["".concat(i,".").concat(h)]||f[h]||u[h]||o;return n?r.createElement(d,l(l({ref:t},p),{},{components:n})):r.createElement(d,l({ref:t},p))}));function h(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var o=n.length,l=new Array(o);l[0]=f;var s={};for(var i in t)hasOwnProperty.call(t,i)&&(s[i]=t[i]);s.originalType=e,s.mdxType="string"==typeof e?e:a,l[1]=s;for(var c=2;c{n.r(t),n.d(t,{assets:()=>i,contentTitle:()=>l,default:()=>u,frontMatter:()=>o,metadata:()=>s,toc:()=>c});var r=n(7462),a=(n(7294),n(3905));const o={},l="API Reference",s={unversionedId:"projects/cms/gocontentful/api-reference",id:"projects/cms/gocontentful/api-reference",title:"API Reference",description:"Client and cache",source:"@site/docs/projects/cms/gocontentful/99-api-reference.md",sourceDirName:"projects/cms/gocontentful",slug:"/projects/cms/gocontentful/api-reference",permalink:"/docs/projects/cms/gocontentful/api-reference",draft:!1,editUrl:"https://github.com/foomo/foomo-docs/tree/main/foomo/docs/projects/cms/gocontentful/99-api-reference.md",tags:[],version:"current",sidebarPosition:99,frontMatter:{},sidebar:"projectsSidebar",previous:{title:"Caching",permalink:"/docs/projects/cms/gocontentful/caching"},next:{title:"gotsrpc",permalink:"/docs/projects/gotsrpc"}},i={},c=[{value:"Client and cache",id:"client-and-cache",level:2},{value:"Content functions and methods",id:"content-functions-and-methods",level:2},{value:"Entry field getters and setters",id:"entry-field-getters-and-setters",level:2},{value:"Entry write ops (only available for ClientModeCMA)",id:"entry-write-ops--only-available-for-clientmodecma",level:2},{value:"Asset functions",id:"asset-functions",level:3},{value:"Other helper functions and methods",id:"other-helper-functions-and-methods",level:3},{value:"Constants and global variables",id:"constants-and-global-variables",level:3}],p={toc:c};function u(e){let{components:t,...n}=e;return(0,a.kt)("wrapper",(0,r.Z)({},p,n,{components:t,mdxType:"MDXLayout"}),(0,a.kt)("h1",{id:"api-reference"},"API Reference"),(0,a.kt)("h2",{id:"client-and-cache"},"Client and cache"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"NewContentfulClient(\n spaceID string, \n clientMode string, \n clientKey string, \n optimisticPageSize uint16, \n logFn func(fields map[string]interface{}, level int, args ...interface{}), \n logLevel int, \n debug bool,\n ) (*ContentfulClient, error)\n")),(0,a.kt)("p",null,"Creates a Contentful client, ",(0,a.kt)("a",{parentName:"p",href:"./working-with-gocontentful-api#get-a-client"},"read this")," for an explanation of all parameters."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"SetOfflineFallback(filename string) error\n")),(0,a.kt)("p",null,"Sets a path to a space export JSON file to be used as a fallback in case\nContentful is not reachable when you call UpdateCache() on the client. This ensures availability\nbut can make your content look outdated if the export file is older (and typically it is)."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"NewOfflineContentfulClient(\n filename string, \n logFn func(fields map[string]interface{}, level int, args ...interface{}), \n logLevel int, \n cacheAssets bool,\n ) (*ContentfulClient, error)\n")),(0,a.kt)("p",null,"Creates an offline Contentful client that loads space data from a JSON file containing a space export. "),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"(cc *ContentfulClient) SetEnvironment(environment string)\n")),(0,a.kt)("p",null,"Sets the Contentful client's environment. All subsequent API calls will be directed to that environment in the selected\nspace. Pass an empty string to reset to the ",(0,a.kt)("em",{parentName:"p"},"master")," environment."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"(cc *ContentfulClient) CacheHasContentType(contentTypeID string) bool\n")),(0,a.kt)("p",null,"Returns true if the specified contentTypeID is cached by the client, false otherwise."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"(cc *ContentfulClient) SetCacheUpdateTimeout(seconds int64)\n")),(0,a.kt)("p",null,"Sets the cache update timeout to the specified length. A new client by default times out\ncaching in 120 seconds. A timeout is used to prevent deadlocks when a service panics and recovers\nwhile the gocontentful goroutines are running and the main caching job is waiting for all\nthem to finish."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"(cc *ContentfulClient) SetSyncMode(mode bool) error\n")),(0,a.kt)("p",null,"Switches on/off the cache sync mode. This method will return an error if called on an offline client. "),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"(cc *ContentfulClient) ResetSync()\n")),(0,a.kt)("p",null,"Resets the sync token: the next call to UpdateCache() will rebuild the cache from scratch."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"(cc *ContentfulClient) UpdateCache(ctx context.Context, contentTypes []string, cacheAssets bool) error\n")),(0,a.kt)("p",null,"Builds or re-builds the entire client cache."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"(cc *ContentfulClient) UpdateCacheForEntity(ctx context.Context, sysType string, contentType string, entityID string) error\n")),(0,a.kt)("p",null,"Updates a single entry or asset (the sysType can take const sysTypeEntry or sysTypeAsset values) in the cache."),(0,a.kt)("h2",{id:"content-functions-and-methods"},"Content functions and methods"),(0,a.kt)("p",null,(0,a.kt)("em",{parentName:"p"},'For these we\'re assuming a content type named "Person".')),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"NewCfPerson(contentfulClient ...*ContentfulClient) (cfPerson *CfPerson)\n")),(0,a.kt)("p",null,"Creates a new Person entry. You can manipulate and upsert this later. The contentfulClient parameter is optional but you\nmight want to pass it most of the times or you won't be able to save the entry."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"(cc *ContentfulClient) GetAllPerson() (voMap map[string]*CfPerson, err error)\n")),(0,a.kt)("p",null,"Retrieves all Person entries from the client and returnes a map where the key is the ID of the entry and the value is\nthe Go value object for that entry."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"(cc *ContentfulClient) GetFilteredPerson(query *contentful.Query) (voMap map[string]*CfPerson, err error)\n")),(0,a.kt)("p",null,"Retrieves Person entries matching the specified query."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"(cc *ContentfulClient) GetPersonByID(id string, forceNoCache ...bool) (vo *CfPerson, err error)\n")),(0,a.kt)("p",null,"Retrieves the Person entry with the specified ID. The optional ",(0,a.kt)("em",{parentName:"p"},"forceNoCache")," parameter, if true,\nmakes the function bypass the existing cache and load a fresh copy of the entry from Contentful."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"(ref ContentfulReferencedEntry) ContentType() (contentType string)\n\n")),(0,a.kt)("p",null,"Returns the Sys.ID of the content type of the referenced entry"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"(cc *ContentfulClient) GetContentTypeOfID(ID string) (contentType string)\n")),(0,a.kt)("p",null,"Returns the Contentful content type of an entry ID."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"(vo *CfPerson) ToReference() (refSys ContentTypeSys)\n")),(0,a.kt)("p",null,"Converts a value object into a reference that can be added to a reference field of an entry. Note that functions that\nretrieve referenced entries return a more flexible and useful ",(0,a.kt)("em",{parentName:"p"},"[]*EntryReference")," (see Quickstart above) but to store\na reference you need a ContentTypeSys."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"(vo *CfPerson) GetParents() (parents []EntryReference, err error)\n(ref *EntryReference) GetParents(cc *ContentfulClient) (parents []EntryReference, err error)\n")),(0,a.kt)("p",null,"Return a slice of EntryReference objects that represent entries that reference the value object or the entry reference."),(0,a.kt)("p",null,"Note that in case of parents of an entry reference you need to pass a pointer to a ContentfulClient because\nEntryReference objects are generic and can't carry any."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"(vo *CfPerson) GetPublishingStatus() string\n")),(0,a.kt)("p",null,"Returns the publishing status of the entry as per the Contentful editor UI.\nValue returned is one of the following:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'const (\n StatusDraft = "draft"\n StatusChanged = "changed"\n StatusPublished = "published"\n)\n')),(0,a.kt)("h2",{id:"entry-field-getters-and-setters"},"Entry field getters and setters"),(0,a.kt)("p",null,"Field getters are named after the field ID in Contentful and return the proper type. For example, if the Person content\ntype has a Symbol (short text) field named 'Name', this will be the getter:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"(vo *CfPerson) Name(locale ...string) (string)\n")),(0,a.kt)("p",null,"The locale parameter is optional and if not passed, the function will return the value for the default locale of the\nspace. If the locale is specified and it's not available for the space, an error is returned. If the locale is valid\nbut a value doesn't exist for the field and locale, the function will return the value for the default locale if that's\nspecified as a fallback locale in the space definition in Contentful, otherwise will return an error."),(0,a.kt)("p",null,"Possible return types are:"),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("em",{parentName:"li"},"string")," for fields of types Symbol, Text, Date"),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("em",{parentName:"li"},"[]string")," for fields of type List"),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("em",{parentName:"li"},"float64")," for fields of type Integer or Number"),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("em",{parentName:"li"},"bool")," for fields of type Boolean"),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("em",{parentName:"li"},"*ContentTypeSys")," for single reference fields"),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("em",{parentName:"li"},"[]*ContentTypeSys")," for multiple reference fields"),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("em",{parentName:"li"},"*ContentTypeFieldLocation")," for fields of type Location"),(0,a.kt)("li",{parentName:"ul"},"*interface{} for fields of type Object or RichText")),(0,a.kt)("p",null,"If logLevel is set to LogDebug retrieving the value of a field that is not set and so not available in the API response\neven as a fallback to the default locale will log the event. This can become incredibly verbose, use with care."),(0,a.kt)("p",null,"Field setters are named after the field ID in Contentful and require to pass in the proper type. See FIELD GETTERS above\nfor a reference. Example:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"(vo *CfPerson) SetName(title string, locale ...string) (err error)\n")),(0,a.kt)("h2",{id:"entry-write-ops--only-available-for-clientmodecma"},"Entry write ops (only available for ",(0,a.kt)("em",{parentName:"h2"},"ClientModeCMA"),")"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"(vo *CfPerson) UpsertEntry(cc *ContentfulClient) (err error)\n")),(0,a.kt)("p",null,'Upserts the entry. This will appear as "Draft" (if it\'s a new entry) or "Changed" if it\'s already existing. In the\nlatter case, you will need to retrieve the entry with one of the Manage* functions above to acquire the Sys object\nthat contains the version information. Otherwise the API call will fail with a "Version mismatch" error.'),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"(vo *CfPerson) PublishEntry(cc *ContentfulClient) (err error)\n")),(0,a.kt)("p",null,'Publishes the entry. Note that before publishing you will need to retrieve the entry with one of the Manage* functions\nabove to acquire the Sys object that contains the version information. Otherwise the API call will fail with a "Version\nmismatch" error. This is needed even if you have just upserted the entry with the function above!'),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"(vo *CfPerson) UnpublishEntry(cc *ContentfulClient) (err error)\n")),(0,a.kt)("p",null,'Unpublishes the entry. Note that before unpublishing you will need to retrieve the entry with one of the Manage*\nfunctions above to acquire the Sys object that contains the version information. Otherwise the API call will fail with\na "Version mismatch" error. This is needed even if you have just upserted the entry with the function above!'),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"(vo *CfPerson) UpdateEntry(cc *ContentfulClient) (err error)\n")),(0,a.kt)("p",null,'Shortcut function that upserts and publishes the entry. Note that before calling this you will need to retrieve the\nentry with one of the Manage* functions above to acquire the Sys object that contains the version information. Otherwise\nthe API call will fail with a "Version mismatch" error. Using this shortcut function avoids retrieving the entry twice.'),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"(vo *CfPerson) DeleteEntry(cc *ContentfulClient) (err error)\n")),(0,a.kt)("p",null,"Unpublishes and deletes the entry"),(0,a.kt)("h3",{id:"asset-functions"},"Asset functions"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"(cc *ContentfulClient) DeleteAsset(asset *contentful.Asset) error\n")),(0,a.kt)("p",null,"Deletes an asset from the space (only available in CMA)"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"(cc *ContentfulClient) DeleteAssetFromCache(key string) error {\n")),(0,a.kt)("p",null,"Deletes an asset from the client's cache"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"(cc *ContentfulClient) GetAllAssets() (map[string]*contentful.Asset, error)\n")),(0,a.kt)("p",null,"Retrieve all assets from a space"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"(cc *ContentfulClient) GetAssetByID(id string, forceNoCache ...bool) (*contentful.Asset, error)\n")),(0,a.kt)("p",null,"Retrieve an asset from a space by its ID. The optional ",(0,a.kt)("em",{parentName:"p"},"forceNoCache")," parameter, if true,\nmakes the function bypass the existing cache and load a fresh copy of the asset from Contentful."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"NewAssetFromURL(id string, uploadUrl string, imageFileType string, title string, locale ...string) *contentful.Asset\n")),(0,a.kt)("p",null,"Creates an Asset from an URL of an existing file online (you still need to upsert it later)."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"ToAssetReference(asset *contentful.Asset) (refSys ContentTypeSys)\n")),(0,a.kt)("p",null,"Converts the asset to a reference. You need to do this before you add the asset to a reference field of an entry."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"(cc *ContentfulClient) DeleteAsset(asset *contentful.Asset) error\n")),(0,a.kt)("p",null,"Deletes an asset from a space by its ID (only available for ",(0,a.kt)("em",{parentName:"p"},"ClientModeCMA"),")"),(0,a.kt)("h3",{id:"other-helper-functions-and-methods"},"Other helper functions and methods"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"(cc *ContentfulClient) BrokenReferences() (brokenReferences []BrokenReference)\n")),(0,a.kt)("p",null,"Returns a slice of BrokenReference objects with details of where entries have been\nreferenced but they are not found in the cache. This might naturally return false\npositives for content types that are in the space but not included in the cache."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"FieldToObject(jsonField interface{}, targetObject interface{}) error\n")),(0,a.kt)("p",null,"Converts a JSON field into an object. Make sure you pass a pointer to an object which type has JSON definition for all\nfields you want to retrieve."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"HtmlToRichText(htmlSrc string) *RichTextNode\n")),(0,a.kt)("p",null,"Converts an HTML fragment to a RichTextNode. This is useful to migrate data from third-party systems to Contentful or\nsupport HTML paste operations in Web applications. It currently supports headings, paragraphs, hyperlinks, italic and\nbold tags, horizontal rules, blockquote, ordered and unordered lists, code. Unknown tags are stripped. This function\ndoesn't return any error as it converts the input text into something as good as possible, without validation."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"RichTextToHtml(rt interface{}, linkResolver LinkResolverFunc, entryLinkResolver EntryLinkResolverFunc, imageResolver ImageResolverFunc, locale Locale) (string, error) {\n")),(0,a.kt)("p",null,"Converts an interface representing a Contentful RichText value (usually from a field getter) into HTML.\nThe function takes in three (optional) functions as parameters to resolve\nhyperlink URLs, permalinks to entries and to derive IMG tag attributes for embedded image assets. The three functions\nreturn a map of attributes for the HTML tag the RichTextToHtml function will emit (either an A or an IMG) and have the\nfollowing signature. Note that the ImageResolverFunc function must return a customHTML value that can be empty but if\nset it will substitute the IMG tag with the returned HTML snippet. This allows you to emit custom mark-up for your\nimages, e.g. a PICTURE tag."),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"type LinkResolverFunc func(url string) (resolvedAttrs map[string]string, resolveError error)\n\ntype EntryLinkResolverFunc func(entryID string, locale Locale) (resolvedAttrs map[string]string, resolveError error)\n\ntype ImageResolverFunc func(assetID string, locale Locale) (attrs map[string]string, customHTML string, resolveError error)\n\ntype EmbeddedEntryResolverFunc func(entryID string, locale Locale) (html string, resolveError error)\n")),(0,a.kt)("p",null,"All the three functions above can be passed as nil with different levels of graceful degrading."),(0,a.kt)("h3",{id:"constants-and-global-variables"},"Constants and global variables"),(0,a.kt)("p",null,"Each generated content type library file exports a constant with the Contentful ID of the content type itself, for\nexample in ",(0,a.kt)("em",{parentName:"p"},"contentful_vo_lib_person.go"),":"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'const ContentTypePerson = "person"\n')),(0,a.kt)("p",null,"Constants are available for each locale supported by the space at the time of code generation, e.g.:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'const SpaceLocaleGerman Locale = "de"\nconst SpaceLocaleFrench Locale = "fr"\nconst defaultLocale Locale = SpaceLocaleGerman\n')),(0,a.kt)("p",null,"Four levels of logging are supported (even if only partially used at this time):"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"const (\n LogDebug = 0\n LogInfo = 1\n LogWarn = 2\n LogError = 3\n)\n")),(0,a.kt)("p",null,"A global variable named ",(0,a.kt)("em",{parentName:"p"},"SpaceContentTypeInfoMap")," contains an ID-indexed map of all content types\nwith their names and descriptions"))}u.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/c0f96715.7ee87254.js b/assets/js/c0f96715.7ee87254.js deleted file mode 100644 index 7740790..0000000 --- a/assets/js/c0f96715.7ee87254.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunkfoomo=self.webpackChunkfoomo||[]).push([[4192],{3905:(e,t,n)=>{n.d(t,{Zo:()=>c,kt:()=>f});var o=n(7294);function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function l(e){for(var t=1;t=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(o=0;o=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var s=o.createContext({}),u=function(e){var t=o.useContext(s),n=t;return e&&(n="function"==typeof e?e(t):l(l({},t),e)),n},c=function(e){var t=u(e.components);return o.createElement(s.Provider,{value:t},e.children)},p={inlineCode:"code",wrapper:function(e){var t=e.children;return o.createElement(o.Fragment,{},t)}},h=o.forwardRef((function(e,t){var n=e.components,a=e.mdxType,r=e.originalType,s=e.parentName,c=i(e,["components","mdxType","originalType","parentName"]),h=u(n),f=a,d=h["".concat(s,".").concat(f)]||h[f]||p[f]||r;return n?o.createElement(d,l(l({ref:t},c),{},{components:n})):o.createElement(d,l({ref:t},c))}));function f(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var r=n.length,l=new Array(r);l[0]=h;var i={};for(var s in t)hasOwnProperty.call(t,s)&&(i[s]=t[s]);i.originalType=e,i.mdxType="string"==typeof e?e:a,l[1]=i;for(var u=2;u{n.r(t),n.d(t,{assets:()=>s,contentTitle:()=>l,default:()=>p,frontMatter:()=>r,metadata:()=>i,toc:()=>u});var o=n(7462),a=(n(7294),n(3905));const r={},l="Working with the Gocontentful API",i={unversionedId:"backend/gocontentful/working-with-gocontentful-api",id:"backend/gocontentful/working-with-gocontentful-api",title:"Working with the Gocontentful API",description:"Let's consider a very simple use case where you have a Contentful space where you store information",source:"@site/docs/backend/gocontentful/04-working-with-gocontentful-api.md",sourceDirName:"backend/gocontentful",slug:"/backend/gocontentful/working-with-gocontentful-api",permalink:"/docs/backend/gocontentful/working-with-gocontentful-api",draft:!1,editUrl:"https://github.com/foomo/foomo-docs/tree/main/foomo/docs/backend/gocontentful/04-working-with-gocontentful-api.md",tags:[],version:"current",sidebarPosition:4,frontMatter:{},sidebar:"backendSidebar",previous:{title:"Play with the test API",permalink:"/docs/backend/gocontentful/test-api"},next:{title:"Caching",permalink:"/docs/backend/gocontentful/caching"}},s={},u=[{value:"Get a client",id:"get-a-client",level:3},{value:"Environments support",id:"environments-support",level:3},{value:"Working with entries",id:"working-with-entries",level:3},{value:"Assets",id:"assets",level:3},{value:"Working with RichText",id:"working-with-richtext",level:3},{value:"More on references",id:"more-on-references",level:3},{value:"Other useful functions",id:"other-useful-functions",level:3},{value:"Caveats and limitations",id:"caveats-and-limitations",level:3}],c={toc:u};function p(e){let{components:t,...n}=e;return(0,a.kt)("wrapper",(0,o.Z)({},c,n,{components:t,mdxType:"MDXLayout"}),(0,a.kt)("h1",{id:"working-with-the-gocontentful-api"},"Working with the Gocontentful API"),(0,a.kt)("p",null,"Let's consider a very simple use case where you have a Contentful space where you store information\nabout people and their pets.\nTo generate a go package to manipulate those entries, run the following in your terminal:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-shell"},"$ gocontentful -spaceid YOUR_SPACE_ID -cmakey YOUR_CMA_API_TOKEN -contenttypes person,pet path/to/your/go/project/folder/people \n")),(0,a.kt)("p",null,"The ",(0,a.kt)("strong",{parentName:"p"},"-contenttypes")," parameter is optional. If not specified, gocontentful will generate an API that supports all the content types of the space."),(0,a.kt)("p",null,"Gocontentful will scan the space, download locales and content types and generate the Go API files in the target path:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-shell"},"path/to/your/go/project/folder/people\n|-gocontentfulvobase.go\n|-gocontentfulvolib_person.go // One file for each content type\n|-gocontentfulvolib_pet.go // One file for each content type\n|-gocontentfulvolib.go\n|-gocontentfulvo.go\n")),(0,a.kt)("p",null,"We recommend not passing the ",(0,a.kt)("em",{parentName:"p"},"-cmakey")," parameter but rather log in first using the Contentful CLI.\nThis will be remembered in all subsequent runs. See the ",(0,a.kt)("a",{parentName:"p",href:"./getting-started#optional-tools"},"Getting started chapter")," "),(0,a.kt)("p",null,"Note: Do NOT modify the generated files! If you change the content model in Contentful just run gocontentful\nagain. This will update the files for you."),(0,a.kt)("h3",{id:"get-a-client"},"Get a client"),(0,a.kt)("p",null,'The generated files will be in the "people" subdirectory of your project. Your go program can get a Contentful\nclient from them:'),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"cc, err := people.NewContentfulClient(YOUR_SPACE_ID, people.ClientModeCDA, YOUR_API_KEY, 1000, contentfulLogger, people.LogDebug,false)\n")),(0,a.kt)("p",null,"The parameters to pass to NewContentfulClient are:"),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("em",{parentName:"li"},"spaceID")," (string)"),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("em",{parentName:"li"},"clientMode")," (string) supports the constants ClientModeCDA, ClientModeCPA and ClientModeCMA. If you need to operate\non multiple APIs (e.g. one for reading and CMA for writing) you need to get two clients"),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("em",{parentName:"li"},"clientKey")," (string) is your API key (generate one for your API at Contentful)"),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("em",{parentName:"li"},"optimisticPageSize")," (uint16) is the page size the client will use to download entries from the space for caching.\nContentful's default is 100 but you can specify up to 1000: this might get you into an error because Contentful\nlimits the payload response size to 70 KB but the client will handle the error and reduce the page size automatically\nuntil it finds a proper value. Hint: using a big page size that always fails is a waste of time and resources because\na lot of initial calls will fail, whereas a too small one will not leverage the full download bandwidth. It's a\ntrial-and-error and you need to find the best value for your case. For simple content types you can start with 1000,\nfor very complex ones that include fat fields you might want to get down to 100 or even less."),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("em",{parentName:"li"},"logFn")," is a func(fields map","[string]","interface{}, level int, args ...interface{}) that the client will call whenever\nit needs to log something. It can be nil if you don't need logging and that will be handled gracefully but it's not\nrecommended. A simple function you can pass that uses the ",(0,a.kt)("a",{parentName:"li",href:"https://github.com/Sirupsen/logrus"},"https://github.com/Sirupsen/logrus")," package might look\nsomething like this:")),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"contentfulLogger := func(fields map[string]interface{}, level int, args ...interface{}) {\n switch level {\n case people.LogDebug:\n log.WithFields(fields).Debug(args)\n case people.LogInfo:\n log.WithFields(fields).Info(args)\n case people.LogWarn:\n log.WithFields(fields).Warn(args)\n case people.LogError:\n log.WithFields(fields).Error(args)\n default:\n return\n }\n}\n")),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("em",{parentName:"li"},"logLevel")," (int) is the debug level (see function above). Please note that LogDebug is very verbose and even logs\nwhen you request a field value but that is not set for the entry."),(0,a.kt)("li",{parentName:"ul"},(0,a.kt)("em",{parentName:"li"},"debug")," (bool) is the Contentful API client debug switch. If set to ",(0,a.kt)("em",{parentName:"li"},"true")," it will log on stdout all the CURL calls\nto Contentful. This is extremely verbose and extremely valuable when something fails in a call to the API because\nit's the only way to see the REST API response.")),(0,a.kt)("p",null,(0,a.kt)("em",{parentName:"p"},"NOTE:")," Gocontentful provides an offline version of the client that can load data from a JSON space export file\n(as exported by the ",(0,a.kt)("em",{parentName:"p"},"contentful")," CLI tool). This is the way you can write unit tests against your generated API that\ndon't require to be online and the management of a safe API key storage. See the ",(0,a.kt)("a",{parentName:"p",href:"./api-reference"},"API Reference")),(0,a.kt)("h3",{id:"environments-support"},"Environments support"),(0,a.kt)("p",null,"Gocontentful supports Contentful environments in two ways:"),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},"Code can be generated loading the content model from an environment other than master.\nThis is done passing the -environment flag on the command line to specify the environment you want to load the model from."),(0,a.kt)("li",{parentName:"ul"},'The gocontentful client in your application can be switched to any environment with the SetEnvironment method.\nFor example, if your space has an extra environment named "devplayground" you can switch the API to use it with:')),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'cc.SetEnvironment("devplayground") \n')),(0,a.kt)("p",null,"To reset the environment to master pass an empty string."),(0,a.kt)("h3",{id:"working-with-entries"},"Working with entries"),(0,a.kt)("p",null,"See ",(0,a.kt)("a",{parentName:"p",href:"./test-api"},"the previous chapter")," for an introduction on entry operations.\nWith your newly created client you can do things like:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},'// Load all persons\npersons, err := cc.GetAllPerson() \n// Load a specific person\nperson, err := cc.GetPersonByID(THE_PERSON_ID)\n// or pass a query\nperson, err := GetFilteredPerson(&contentful.Query{\n "contentType":"person",\n "exists": []string{"fields.resume"}\n})\n// The person\'s name\nname := person.Name()\n// The work title in a different localization. Available locales are generated as constants.\n// If a space is configured to have a fallback from one locale to the default one, \n// the getter functions will return that if the value is not set for locale passed to the function.\nname := person.Title(people.SpaceLocaleItalian) \n// Get references to the person\'s pets\npetRefs := person.Pets()\n// Deal with pets\nfor _, pet := range petRefs {\nswitch pet.ContentType {\ncase people.ContentTypeDog: // you have these constants in the generated code\ndog := pet.VO.(*people.Dog)\n// do something with dog\ncase people.ContentTypeCat:\n// ...\n}\n')),(0,a.kt)("p",null,"Once you have loaded an entry, you can use any of the setter methods to alter the fields. For example:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"dog.SetAge(7)\n")),(0,a.kt)("p",null,"This will only affect the Go object and doesn't automatically propagate to the space.\nTo save the entry to Contentful you need to explicitly call one of these methods:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"// Upsert (save) an entry\nerr := dog.UpsertEntry()\n// Publish it (after it's been upserted)\nerr := dog.PublishEntry() // change your mind with err := dog.UnpublishEntry()\n// Or do it in one step\nerr := dog.UpdateEntry() // upserts and publishes\n// And delete it\nerr := dog.DeleteEntry()\n")),(0,a.kt)("p",null,"If you want to know the publication status of an entry as represented in Contentful's UI you\ncan use the ",(0,a.kt)("inlineCode",{parentName:"p"},"GetPublishingStatus()")," method on the entry itself. Possible return values are the\npredefined constants ",(0,a.kt)("inlineCode",{parentName:"p"},"StatusDraft"),", ",(0,a.kt)("inlineCode",{parentName:"p"},"StatusChanged")," and ",(0,a.kt)("inlineCode",{parentName:"p"},"StatusPublished"),"."),(0,a.kt)("p",null,"When saving, publishing or deleting entries:"),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},"You need a client that uses mode ",(0,a.kt)("em",{parentName:"li"},"ClientModeCMA"),". Entries retrieved with ClientModeCDA\nor ClientModeCPA can be saved in memory (for example if you need to enrich the built-in cache) but not persisted to\nContentful."),(0,a.kt)("li",{parentName:"ul"},"Make sure you Get a fresh copy of the entry right before you manipulate it and upsert it / publish it to Contentful. In case it's\nsaved by someone else in the meantime, the upsert will fail with a version mismatch error. ")),(0,a.kt)("p",null,"In case you need a completely new entry just create it, Contentful will fill in the technical details for you:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"NewCfPerson(contentfulClient ...*ContentfulClient) (cfPerson *CfPerson)\n")),(0,a.kt)("h3",{id:"assets"},"Assets"),(0,a.kt)("p",null,"Contentful allows upload and reference of binary assets and gocontentful fully supports them.\nAssuming the dog entry references a picture in a field you can get it with:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"picture := dog.Picture() // you can pass a locale to this function as usual\n")),(0,a.kt)("p",null,"This returns a *contenful.AssetNoLocale object handling localization for you in two ways.\nFirst, the field itself could be localized in the model, referencing two different assets altogether.\nSecondly, the asset itself can have different files uploaded for different locales.\nNo matter what, the gocontentful API will return the right file: "),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"// Get the asset's URL at Contentful's CDN\nif picture != nil && picture.Fields != nil && picture.Fields.File != nil {\n theURL := picture.Fields.File.URL\n // ...then do something with it\n}\n")),(0,a.kt)("p",null,"There are various functions and methods to work with assets, for example to create an asset\nstarting from an URL or to convert an asset to a reference to store it in a parent entry\nfield. See the ",(0,a.kt)("a",{parentName:"p",href:"./api-reference"},"API Reference")," chapter for details."),(0,a.kt)("p",null,"Note: there is no function to create a new asset in the generated code because the type ",(0,a.kt)("inlineCode",{parentName:"p"},"AssetNoLocale"),"\nis from the ",(0,a.kt)("em",{parentName:"p"},"github.com/foomo/contentful")," package, just instantiate one if you need a blank asset."),(0,a.kt)("h3",{id:"working-with-richtext"},"Working with RichText"),(0,a.kt)("p",null,"Contentful supports Rich Text fields. Behind the scenes, these are JSON objects that represent\nthe content through a Contentful-specific data model. Sooner or later you might want to convert such values to and from HTML.\nGocontentful supports the conversion both ways. For instance, you want a person's resume to be converted to HTML:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"htmlText := people.RichTextToHtml(person.Resume(), linkResolver, entryLinkResolver, imageResolver, embeddedEntryResolver locale)\n")),(0,a.kt)("p",null,"The parameters linkResolver, entryLinkResolver, embeddedEntryResolver and imageResolver are all functions that you can pass\nto convert various elements inserted by the user into the RichText field:"),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},"linkResolver will allow you to create custom HTML tags for hyperlinks. If left blank, RichTextToHtml will just output an A tag."),(0,a.kt)("li",{parentName:"ul"},"entryLinkResolver is used to create hyperlinks with custom URLs when the destination in Contentful is another entry.\nIf you allow such links to be created in the editor then you must pass this function."),(0,a.kt)("li",{parentName:"ul"},"imageResolver and embebbedEntryResolver are needed when the field accepts assets and entries embedded into the content, to turn\nthese into actual HTML snippets")),(0,a.kt)("p",null,"The conversion works the other way around too, when you need to source data from outside and create Contentful entries:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"myRichText := HtmlToRichText(htmlSrc)\n")),(0,a.kt)("p",null,"See the ",(0,a.kt)("a",{parentName:"p",href:"./api-reference"},"API Reference")," for more details about these functions."),(0,a.kt)("h3",{id:"more-on-references"},"More on references"),(0,a.kt)("p",null,"When working with references it's often useful to know if there are any broken ones in the space.\nThis happens when a published entry references another that has been deleted after the parent\nwas published. This might create issues if your application code doesn't degrade content gracefully.\nTo get a report of all broken references you can use the following function:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"(cc *ContentfulClient) BrokenReferences() (brokenReferences []BrokenReference)\n")),(0,a.kt)("p",null,"Note that this only works with cached clients. See ",(0,a.kt)("a",{parentName:"p",href:"./caching"},"the next chapter on caching"),"."),(0,a.kt)("p",null,"Also on references: when you want to reference entry B from entry A, you cannot assign\nthe value object of entry B to the reference field in A. First you need to convert the\nobject to a ",(0,a.kt)("inlineCode",{parentName:"p"},"ContentTypeSys")," object because that's what Contentful expects in reference fields:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"(vo *CfPerson) ToReference() (refSys ContentTypeSys)\n")),(0,a.kt)("p",null,"Finally, you can get the parents (AKA referring) entries of either an entry or\nan EntryReference with the ",(0,a.kt)("em",{parentName:"p"},"GetParents()")," method. This returns a slice of ",(0,a.kt)("inlineCode",{parentName:"p"},"[]EntryReference"),":"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"(vo *CfPerson) GetParents() (parents []EntryReference, err error)\n(ref *EntryReference) GetParents(cc *ContentfulClient) (parents []EntryReference, err error)\n")),(0,a.kt)("h3",{id:"other-useful-functions"},"Other useful functions"),(0,a.kt)("p",null,"Another thing you might want to know is the content type of an entry with a given ID:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-go"},"(cc *ContentfulClient) GetContentTypeOfID(ID string) (contentType string)\n")),(0,a.kt)("h3",{id:"caveats-and-limitations"},"Caveats and limitations"),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},'Avoid creating content types that have field IDs equal to reserved Go words (e.g. "type").\nGocontentful won\'t scan for them and the generated code will break.')))}p.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/dc1592f9.f45a8b5d.js b/assets/js/dc1592f9.f45a8b5d.js new file mode 100644 index 0000000..2dc4c40 --- /dev/null +++ b/assets/js/dc1592f9.f45a8b5d.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkfoomo=self.webpackChunkfoomo||[]).push([[1937],{3905:(e,t,n)=>{n.d(t,{Zo:()=>p,kt:()=>m});var o=n(7294);function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function l(e){for(var t=1;t=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var s=o.createContext({}),c=function(e){var t=o.useContext(s),n=t;return e&&(n="function"==typeof e?e(t):l(l({},t),e)),n},p=function(e){var t=c(e.components);return o.createElement(s.Provider,{value:t},e.children)},u={inlineCode:"code",wrapper:function(e){var t=e.children;return o.createElement(o.Fragment,{},t)}},f=o.forwardRef((function(e,t){var n=e.components,r=e.mdxType,a=e.originalType,s=e.parentName,p=i(e,["components","mdxType","originalType","parentName"]),f=c(n),m=r,g=f["".concat(s,".").concat(m)]||f[m]||u[m]||a;return n?o.createElement(g,l(l({ref:t},p),{},{components:n})):o.createElement(g,l({ref:t},p))}));function m(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var a=n.length,l=new Array(a);l[0]=f;var i={};for(var s in t)hasOwnProperty.call(t,s)&&(i[s]=t[s]);i.originalType=e,i.mdxType="string"==typeof e?e:r,l[1]=i;for(var c=2;c{n.r(t),n.d(t,{assets:()=>s,contentTitle:()=>l,default:()=>u,frontMatter:()=>a,metadata:()=>i,toc:()=>c});var o=n(7462),r=(n(7294),n(3905));const a={},l="Getting started",i={unversionedId:"projects/cms/gocontentful/getting-started",id:"projects/cms/gocontentful/getting-started",title:"Getting started",description:"Installation",source:"@site/docs/projects/cms/gocontentful/02-getting-started.md",sourceDirName:"projects/cms/gocontentful",slug:"/projects/cms/gocontentful/getting-started",permalink:"/docs/projects/cms/gocontentful/getting-started",draft:!1,editUrl:"https://github.com/foomo/foomo-docs/tree/main/foomo/docs/projects/cms/gocontentful/02-getting-started.md",tags:[],version:"current",sidebarPosition:2,frontMatter:{},sidebar:"projectsSidebar",previous:{title:"Introduction",permalink:"/docs/projects/cms/gocontentful/introduction"},next:{title:"Play with the test API",permalink:"/docs/projects/cms/gocontentful/test-api"}},s={},c=[{value:"Installation",id:"installation",level:2},{value:"Optional tools",id:"optional-tools",level:2}],p={toc:c};function u(e){let{components:t,...n}=e;return(0,r.kt)("wrapper",(0,o.Z)({},p,n,{components:t,mdxType:"MDXLayout"}),(0,r.kt)("h1",{id:"getting-started"},"Getting started"),(0,r.kt)("h2",{id:"installation"},"Installation"),(0,r.kt)("p",null,"Prerequisite: you need Go 1.16+. Upgrade if you still haven't, then run:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-shell"},"go get github.com/foomo/gocontentful\n")),(0,r.kt)("p",null,"If you trust us there are ",(0,r.kt)("a",{parentName:"p",href:"https://github.com/foomo/gocontentful/releases"},"precompiled versions on Github")),(0,r.kt)("p",null,"On the mac:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-shell"},"brew install foomo/gocontentful/gocontentful\n")),(0,r.kt)("p",null,"Test the installation (make sure $GOPATH/bin is in your $PATH):"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-shell"},"$ gocontentful -version\nv1.0.13\n")),(0,r.kt)("h2",{id:"optional-tools"},"Optional tools"),(0,r.kt)("p",null,"Gocontentful requires a CMA API key to scan the Contentful space and generate the model.\nThis can be passed as a CLI parameter but that's tedious and your management key will remain in your shell history.\nA better approach is to log in to Contentful using the official ",(0,r.kt)("em",{parentName:"p"},"Contentful CLI"),". Gocontentful will get the key automatically.\nTo install the CLI refer to the ",(0,r.kt)("a",{parentName:"p",href:"https://www.contentful.com/developers/docs/tutorials/cli/installation/"},"official documentation at Contentful.com"),"."),(0,r.kt)("p",null,"After installing the CLI log in inside your terminal with:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-shell"},"$ contentful login\n")),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-shell"},"$ gocontentful\n\nERROR: Please specify either a Contentful Space ID and CMA access token or an export file name\n\nSYNOPSIS\n gocontentful -spaceid SpaceID -cmakey CMAKey [-contenttypes firsttype,secondtype...lasttype] path/to/target/package\n\n -cmakey string\n [Optional] Contentful CMA key\n -contenttypes string\n [Optional] Content type IDs to parse, comma separated\n -environment string\n [Optional] Contentful space environment\n -exportfile string\n Space export file to generate the API from\n -help\n Print version and exit\n -spaceid string\n Contentful space ID\n -version\n Print version and exit\n\nNotes:\n- The last segment of the path/to/target/package will be used as package name\n- The -cmakey parameter can be omitted if you logged in with the Contentful CLI\n")),(0,r.kt)("p",null,"Notes:"),(0,r.kt)("ul",null,(0,r.kt)("li",{parentName:"ul"},"The last segment of the path/to/target/package will be used as package name"),(0,r.kt)("li",{parentName:"ul"},"You need to pass gocontentful either cmakey/spaceid (and optional environment) to generate\nthe API from a live space or exportfile to generate it from a local space export file. The cmakey\ncan be omitted if you are logged in through the Contentful CLI.")))}u.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/e42b69fc.c8379fe0.js b/assets/js/e42b69fc.c8379fe0.js new file mode 100644 index 0000000..ce323dc --- /dev/null +++ b/assets/js/e42b69fc.c8379fe0.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkfoomo=self.webpackChunkfoomo||[]).push([[9976],{3905:(e,t,n)=>{n.d(t,{Zo:()=>u,kt:()=>p});var o=n(7294);function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function i(e){for(var t=1;t=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var l=o.createContext({}),s=function(e){var t=o.useContext(l),n=t;return e&&(n="function"==typeof e?e(t):i(i({},t),e)),n},u=function(e){var t=s(e.components);return o.createElement(l.Provider,{value:t},e.children)},d={inlineCode:"code",wrapper:function(e){var t=e.children;return o.createElement(o.Fragment,{},t)}},f=o.forwardRef((function(e,t){var n=e.components,r=e.mdxType,a=e.originalType,l=e.parentName,u=c(e,["components","mdxType","originalType","parentName"]),f=s(n),p=r,m=f["".concat(l,".").concat(p)]||f[p]||d[p]||a;return n?o.createElement(m,i(i({ref:t},u),{},{components:n})):o.createElement(m,i({ref:t},u))}));function p(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var a=n.length,i=new Array(a);i[0]=f;var c={};for(var l in t)hasOwnProperty.call(t,l)&&(c[l]=t[l]);c.originalType=e,c.mdxType="string"==typeof e?e:r,i[1]=c;for(var s=2;s{n.r(t),n.d(t,{assets:()=>l,contentTitle:()=>i,default:()=>d,frontMatter:()=>a,metadata:()=>c,toc:()=>s});var o=n(7462),r=(n(7294),n(3905));const a={},i="Introduction",c={unversionedId:"projects/cms/gocontentful/introduction",id:"projects/cms/gocontentful/introduction",title:"Introduction",description:"What is Contentful",source:"@site/docs/projects/cms/gocontentful/01-introduction.md",sourceDirName:"projects/cms/gocontentful",slug:"/projects/cms/gocontentful/introduction",permalink:"/docs/projects/cms/gocontentful/introduction",draft:!1,editUrl:"https://github.com/foomo/foomo-docs/tree/main/foomo/docs/projects/cms/gocontentful/01-introduction.md",tags:[],version:"current",sidebarPosition:1,frontMatter:{},sidebar:"projectsSidebar",previous:{title:"contentful",permalink:"/docs/projects/cms/contentful"},next:{title:"Getting started",permalink:"/docs/projects/cms/gocontentful/getting-started"}},l={},s=[{value:"What is Contentful",id:"what-is-contentful",level:2},{value:"What is gocontentful",id:"what-is-gocontentful",level:2},{value:"Rationale",id:"rationale",level:2}],u={toc:s};function d(e){let{components:t,...n}=e;return(0,r.kt)("wrapper",(0,o.Z)({},u,n,{components:t,mdxType:"MDXLayout"}),(0,r.kt)("h1",{id:"introduction"},"Introduction"),(0,r.kt)("h2",{id:"what-is-contentful"},"What is Contentful"),(0,r.kt)("p",null,(0,r.kt)("a",{parentName:"p",href:"https://www.contentful.com/"},"Contentful")," is a content platform (often referred to as headless CMS) for ",(0,r.kt)("a",{parentName:"p",href:"https://www.contentful.com/r/knowledgebase/content-as-a-microservice/"},"micro-content"),". There's no pages or content trees in Contentful, the CMS focuses on structured data. The data model is built from scratch for the purpose of the consuming application, is completely flexible and can be created and hot-changed through the same Web UI that the content editors use. The model dictates which content types can reference others and the final structure is a graph."),(0,r.kt)("h2",{id:"what-is-gocontentful"},"What is gocontentful"),(0,r.kt)("p",null,"A golang API code generator that simplifies interacting with a Contentful space. The generated API:"),(0,r.kt)("ul",null,(0,r.kt)("li",{parentName:"ul"},"Supports most of the Contentful APIs to perform all read/write operation on entries and assets"),(0,r.kt)("li",{parentName:"ul"},"Hides the complexity of the Contentful REST/JSON APIs behind an idiomatic set of golang functions and methods"),(0,r.kt)("li",{parentName:"ul"},"Allows for in-memory caching of an entire Contentful space")),(0,r.kt)("h2",{id:"rationale"},"Rationale"),(0,r.kt)("p",null,"Calling a remote CMS repository across the Internet whenever your service needs a piece of content is not an option because of latency and response time. Hence, you need to cache all the content at the running service and make sure your cache is always up-to-date. In addition, you need to deal with generic entries in JSON format and maintain a Go model with value objects to reflect every change at the CMS' content model, writing functions and methods to import and export entries to/from typed objects. "),(0,r.kt)("p",null,"Trust me: both things quickly scale to royal-PITA level. "),(0,r.kt)("p",null,"Gocontentful wipes out both complexities by generating the content model automatically and providing an idiomatic API to handle interaction with remote content while keeping a cache stays constantly in-sync with the Contentful space. If the content model changes, running gocontentful again will update the Go code for the model and API to reflect those changes automatically."),(0,r.kt)("p",null,"How much code is that? As an example of a real-world production scenario where gocontentful is in use as of 2022, a space content model with 11 content types ranging from 3 to over 40 fields each generated around 50,000 lines of Go code. Do you need all those lines? You might not need all setters if you don't manage content through the API but you'll definitely need most of the getters otherwise those should not be in the model at all."))}d.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/e7bf32fe.930ab807.js b/assets/js/e7bf32fe.930ab807.js new file mode 100644 index 0000000..19204b5 --- /dev/null +++ b/assets/js/e7bf32fe.930ab807.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkfoomo=self.webpackChunkfoomo||[]).push([[874],{3905:(e,t,n)=>{n.d(t,{Zo:()=>p,kt:()=>h});var o=n(7294);function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function s(e){for(var t=1;t=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var l=o.createContext({}),c=function(e){var t=o.useContext(l),n=t;return e&&(n="function"==typeof e?e(t):s(s({},t),e)),n},p=function(e){var t=c(e.components);return o.createElement(l.Provider,{value:t},e.children)},d={inlineCode:"code",wrapper:function(e){var t=e.children;return o.createElement(o.Fragment,{},t)}},u=o.forwardRef((function(e,t){var n=e.components,r=e.mdxType,a=e.originalType,l=e.parentName,p=i(e,["components","mdxType","originalType","parentName"]),u=c(n),h=r,f=u["".concat(l,".").concat(h)]||u[h]||d[h]||a;return n?o.createElement(f,s(s({ref:t},p),{},{components:n})):o.createElement(f,s({ref:t},p))}));function h(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var a=n.length,s=new Array(a);s[0]=u;var i={};for(var l in t)hasOwnProperty.call(t,l)&&(i[l]=t[l]);i.originalType=e,i.mdxType="string"==typeof e?e:r,s[1]=i;for(var c=2;c{n.r(t),n.d(t,{assets:()=>l,contentTitle:()=>s,default:()=>d,frontMatter:()=>a,metadata:()=>i,toc:()=>c});var o=n(7462),r=(n(7294),n(3905));const a={},s="Play with the test API",i={unversionedId:"projects/cms/gocontentful/test-api",id:"projects/cms/gocontentful/test-api",title:"Play with the test API",description:"Clone the gocontentful repository from [github.com/foomo/gocontentful] and open it",source:"@site/docs/projects/cms/gocontentful/03-test-api.md",sourceDirName:"projects/cms/gocontentful",slug:"/projects/cms/gocontentful/test-api",permalink:"/docs/projects/cms/gocontentful/test-api",draft:!1,editUrl:"https://github.com/foomo/foomo-docs/tree/main/foomo/docs/projects/cms/gocontentful/03-test-api.md",tags:[],version:"current",sidebarPosition:3,frontMatter:{},sidebar:"projectsSidebar",previous:{title:"Getting started",permalink:"/docs/projects/cms/gocontentful/getting-started"},next:{title:"Working with the Gocontentful API",permalink:"/docs/projects/cms/gocontentful/working-with-gocontentful-api"}},l={},c=[],p={toc:c};function d(e){let{components:t,...n}=e;return(0,r.kt)("wrapper",(0,o.Z)({},p,n,{components:t,mdxType:"MDXLayout"}),(0,r.kt)("h1",{id:"play-with-the-test-api"},"Play with the test API"),(0,r.kt)("p",null,"Clone the gocontentful repository from ","[github.com/foomo/gocontentful]"," and open it\nin your IDE. "),(0,r.kt)("p",null,"The repository includes an offline representation of a Contentful space that can is used for testing gocontentful\nwithout depending on an online connection and an existing Contentful space. "),(0,r.kt)("p",null,"Create a file in the repository home directory and name it ",(0,r.kt)("inlineCode",{parentName:"p"},"untracked_test.go"),". This ensures it's not tracked by git.\nPaste the following into the file:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go"},'package main\n\nimport (\n "testing"\n\n "github.com/foomo/gocontentful/test"\n "github.com/foomo/gocontentful/test/testapi"\n "github.com/sirupsen/logrus"\n "github.com/stretchr/testify/require"\n)\n\nfunc TestTheAPI(t *testing.T) {\n testLogger := logrus.StandardLogger()\n cc, errClient := testapi.NewOfflineContentfulClient("./test/test-space-export.json",\n test.GetContenfulLogger(testLogger),\n test.LogDebug,\n true)\n require.NoError(t, errClient)\n prods, errProds := cc.GetAllProduct()\n require.NoError(t, errProds)\n testLogger.WithField("prods", len(prods)).Info("Loaded products")\n}\n')),(0,r.kt)("p",null,"The first two lines in the unit test create a logger and an offline gocontentful client. This also\ncaches the content of the space in memory and lets you play with the API. The space includes three\ncontent types (",(0,r.kt)("inlineCode",{parentName:"p"},"brand"),", ",(0,r.kt)("inlineCode",{parentName:"p"},"product")," and ",(0,r.kt)("inlineCode",{parentName:"p"},"category"),") and their relative entries.\nA product has a reference to a brand and to one or more categories. If you open the ",(0,r.kt)("inlineCode",{parentName:"p"},"./test/test-space-export.json")," file\nyou can see how the JSON representation of those entries is. "),(0,r.kt)("p",null,"Getting all the products using the Contentful\nContent Delivery API would normally require dealing with the connection, query and JSON payload, having\nvalue object defined for all content types and functions to convert from/to those structs. With the Go API generated\nby gocontentful all you need to do to load all the products looks like this single line:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go"}," prods, errProds := cc.GetAllProduct()\n")),(0,r.kt)("p",null,"Open a terminal and from the repository home directory run the test. Your output should looks similar to this:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-shell"},"$ go test -run TestTheAPI\nINFO[0000] loading space from local file assets=12 entries=9\nINFO[0000] contentful cache update queued task=UpdateCache\nINFO[0000] contentful cache worker starting task=UpdateCache\nINFO[0000] gonna use a local file task=UpdateCache\nINFO[0000] cached all entries of content type contentType=product method=updateCacheForContentType size=4\nINFO[0000] cached all assets contentType=asset method=updateCacheForContentType size=12\nINFO[0000] cached all entries of content type contentType=brand method=updateCacheForContentType size=3\nINFO[0000] cached all entries of content type contentType=category method=updateCacheForContentType size=2\nINFO[0000] space caching done, time recorded task=UpdateCache time elapsed=179.357792ms\nINFO[0000] contentful cache update returning task=UpdateCache\nINFO[0000] contentful cache update returning task=UpdateCache\nINFO[0000] Loaded products prods=4\nPASS\nok github.com/foomo/gocontentful 0.484s\n")),(0,r.kt)("p",null,"The last line shows that we loaded 4 products. Let's go ahead and play with the API.\nWe'll load a specific product and log its name. Add this at the end of the unit test:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go"},'prod, errProd := cc.GetProductByID("6dbjWqNd9SqccegcqYq224")\nrequire.NoError(t, errProd)\nprodName := prod.ProductName("de")\ntestLogger.WithField("name", prodName).Info("Product loaded")\n')),(0,r.kt)("p",null,"This will be the output at the end of the log when you run the test:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-shell"},'INFO[0000] Product loaded name="Whisk Beater"\n')),(0,r.kt)("p",null,"The first line loads the product from the space. This is a ",(0,r.kt)("inlineCode",{parentName:"p"},"*testapi.CfProduct")," pointer. The type is generated\nand carries all the getter and setter methods to access all the fields and more, e.g. ProductName().\nNote that when calling ProductName() we passed ",(0,r.kt)("inlineCode",{parentName:"p"},'"de"')," as a parameter. This is the locale and it's\nentirely optional and useful when your space supports multiple locales for translation.\nIf you omit it, the default space locale will be used."),(0,r.kt)("p",null,"Let's load the product's brand:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go"},'// Get the brand\nbrandReference := prod.Brand()\nbrand := brandReference.VO.(*testapi.CfBrand)\ntestLogger.WithField("name", brand.CompanyName()).Info("Brand")\n')),(0,r.kt)("p",null,"Note a couple of things here:"),(0,r.kt)("ul",null,(0,r.kt)("li",{parentName:"ul"},"The product has a Brand() method that represents and retrieves the reference from the product entry to the brand entry"),(0,r.kt)("li",{parentName:"ul"},"The returned object is not a ",(0,r.kt)("inlineCode",{parentName:"li"},"*testapi.CfBrand")," pointer as you might expect. This is because a reference field in Contentful\ncan point to entries of multiple content types and that doesn't play nice with Go's static typing.\nThe object returned is a generic ",(0,r.kt)("inlineCode",{parentName:"li"},"*testapi.EntryReference")," that, among other, includes an ",(0,r.kt)("inlineCode",{parentName:"li"},"interface{}")," attribute (VO) that\nis the actual ",(0,r.kt)("inlineCode",{parentName:"li"},"*testapi.CfBrand"),". That's why in the second line we had to cast it.")),(0,r.kt)("p",null,"The test now logs the brand company name:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-shell"},'INFO[0000] Brand name="Normann Copenhagen"\n')),(0,r.kt)("p",null,"What if we want to follow the reference the other way around and find out which entries link to this brand?"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-go"},'parentRefs, errParents := brand.GetParents()\nrequire.NoError(t, errParents)\ntestLogger.WithField("parent count", len(parentRefs)).Info("Parents")\nfor _, parentRef := range parentRefs {\n switch parentRef.ContentType {\n case testapi.ContentTypeProduct:\n parentProduct := parentRef.VO.(*testapi.CfProduct)\n testLogger.WithField("name", parentProduct.ProductName()).Info("Parent product")\n }\n}\n')),(0,r.kt)("p",null,"Again, the ",(0,r.kt)("inlineCode",{parentName:"p"},"GetParents()")," method returns references and not objects. It's a good idea to use the reference ",(0,r.kt)("inlineCode",{parentName:"p"},"ContentType")," attribute\nto switch before casting the VO to the type, because as we just said referenced objects can come in different types and casting\nto the wrong one would make the runtime panic. Running the test we find out the two products that belong to this brand:"),(0,r.kt)("pre",null,(0,r.kt)("code",{parentName:"pre",className:"language-shell"},'INFO[0000] Parents parent count=2\nINFO[0000] Parent product name="Whisk Beater"\nINFO[0000] Parent product name="Hudson Wall Cup"\n')))}d.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/f12ae7d6.54a46c0f.js b/assets/js/f12ae7d6.7f067890.js similarity index 90% rename from assets/js/f12ae7d6.54a46c0f.js rename to assets/js/f12ae7d6.7f067890.js index 25f50ff..3012ac4 100644 --- a/assets/js/f12ae7d6.54a46c0f.js +++ b/assets/js/f12ae7d6.7f067890.js @@ -1 +1 @@ -"use strict";(self.webpackChunkfoomo=self.webpackChunkfoomo||[]).push([[2364],{1259:(e,t,o)=>{o.d(t,{X:()=>m});var a=o(7462),n=o(2801),l=o(7294),r=o(4991),c=o(9030),i=o(3746),s=o(9960);const m=e=>{const[t,o]=(0,l.useState)(!1),[m,d]=(0,l.useState)(""),p=(0,n.r)();(0,l.useEffect)((()=>{""==m&&""!==e.id&&fetch("https://docs.bestbytes.com/services/playground?id="+e.id,{mode:"cors"}).then((e=>e.text().then((e=>d(e))))).catch((e=>d("can not load source yet")))}),[m]);const g="https://goplay.tools/snippet/"+e.id;return l.createElement(l.Fragment,null,l.createElement("div",{style:{paddingBottom:"1rem",width:"100%"}},t?l.createElement(l.Fragment,null,l.createElement("button",{className:"button button--primary",onClick:e=>{o(!1)}},"close playground")," ",l.createElement("button",{className:"button button--primary"+(t?"":" disabled"),onClick:e=>{p.enter()}},"fullscreen")," "):l.createElement("button",{className:"button button--primary",onClick:e=>{o(!0)}},"open playground")," ",l.createElement(s.Z,{href:g},"go to ",g)),!t&&l.createElement(i.ZP,(0,a.Z)({},i.lG,{code:m,language:"go"}),(e=>{let{className:t,style:o,tokens:a,getLineProps:n,getTokenProps:r}=e;return l.createElement("pre",{className:t,style:o},""==m?"... loading sources":"",a.map(((e,t)=>l.createElement("div",n({line:e,key:t}),e.map(((e,t)=>l.createElement("span",r({token:e,key:t}))))))))})),l.createElement("div",{style:{display:t?"block":"none"}},l.createElement(c.k,{topic:"load external go playground, with all it\xb4s potentially evil cookies coming from https://goplay.tools",id:"goPlaygroundIsCool"},l.createElement("div",null,l.createElement(n.I,{handle:p},l.createElement(r.h,{src:g,proportion:e.proportion}))))))}},4991:(e,t,o)=>{o.d(t,{h:()=>n});var a=o(7294);const n=e=>{let{proportion:t,src:o}=e;return t||(t=4/3),a.createElement("div",{style:{width:"100%",height:0,paddingTop:100/t+"%",position:"relative",float:"left"}},a.createElement("iframe",{style:{width:"100%",height:"100%",display:"block",position:"absolute",top:0,left:0},src:o,frameBorder:"0",scrolling:"no",allowFullScreen:!0}))}},9030:(e,t,o)=>{o.d(t,{k:()=>l});var a=o(7294);const n="undefined"==typeof localStorage,l=e=>{const[t,o]=(0,a.useState)((l=e.id,"undefined"!=typeof localStorage&&localStorage.getItem(l)));var l;return(0,a.useEffect)((()=>{console.log("well it is cool",e.id,{isCool:t,SSR:n})}),[t,n]),t?e.children:a.createElement("div",null,a.createElement("button",{className:"button button--lg button--secondary",onClick:t=>{localStorage.setItem(e.id,"yes"),o(!0)}},e.topic))}},3179:(e,t,o)=>{o.r(t),o.d(t,{assets:()=>s,contentTitle:()=>c,default:()=>p,frontMatter:()=>r,metadata:()=>i,toc:()=>m});var a=o(7462),n=(o(7294),o(3905)),l=o(1259);const r={},c="yaml magic",i={unversionedId:"backend/go-by-example/yaml-magic",id:"backend/go-by-example/yaml-magic",title:"yaml magic",description:"{o.d(t,{X:()=>m});var a=o(7462),n=o(2801),l=o(7294),r=o(4991),c=o(9030),i=o(3746),s=o(9960);const m=e=>{const[t,o]=(0,l.useState)(!1),[m,d]=(0,l.useState)(""),p=(0,n.r)();(0,l.useEffect)((()=>{""==m&&""!==e.id&&fetch("https://docs.bestbytes.com/services/playground?id="+e.id,{mode:"cors"}).then((e=>e.text().then((e=>d(e))))).catch((e=>d("can not load source yet")))}),[m]);const g="https://goplay.tools/snippet/"+e.id;return l.createElement(l.Fragment,null,l.createElement("div",{style:{paddingBottom:"1rem",width:"100%"}},t?l.createElement(l.Fragment,null,l.createElement("button",{className:"button button--primary",onClick:e=>{o(!1)}},"close playground")," ",l.createElement("button",{className:"button button--primary"+(t?"":" disabled"),onClick:e=>{p.enter()}},"fullscreen")," "):l.createElement("button",{className:"button button--primary",onClick:e=>{o(!0)}},"open playground")," ",l.createElement(s.Z,{href:g},"go to ",g)),!t&&l.createElement(i.ZP,(0,a.Z)({},i.lG,{code:m,language:"go"}),(e=>{let{className:t,style:o,tokens:a,getLineProps:n,getTokenProps:r}=e;return l.createElement("pre",{className:t,style:o},""==m?"... loading sources":"",a.map(((e,t)=>l.createElement("div",n({line:e,key:t}),e.map(((e,t)=>l.createElement("span",r({token:e,key:t}))))))))})),l.createElement("div",{style:{display:t?"block":"none"}},l.createElement(c.k,{topic:"load external go playground, with all it\xb4s potentially evil cookies coming from https://goplay.tools",id:"goPlaygroundIsCool"},l.createElement("div",null,l.createElement(n.I,{handle:p},l.createElement(r.h,{src:g,proportion:e.proportion}))))))}},4991:(e,t,o)=>{o.d(t,{h:()=>n});var a=o(7294);const n=e=>{let{proportion:t,src:o}=e;return t||(t=4/3),a.createElement("div",{style:{width:"100%",height:0,paddingTop:100/t+"%",position:"relative",float:"left"}},a.createElement("iframe",{style:{width:"100%",height:"100%",display:"block",position:"absolute",top:0,left:0},src:o,frameBorder:"0",scrolling:"no",allowFullScreen:!0}))}},9030:(e,t,o)=>{o.d(t,{k:()=>l});var a=o(7294);const n="undefined"==typeof localStorage,l=e=>{const[t,o]=(0,a.useState)((l=e.id,"undefined"!=typeof localStorage&&localStorage.getItem(l)));var l;return(0,a.useEffect)((()=>{console.log("well it is cool",e.id,{isCool:t,SSR:n})}),[t,n]),t?e.children:a.createElement("div",null,a.createElement("button",{className:"button button--lg button--secondary",onClick:t=>{localStorage.setItem(e.id,"yes"),o(!0)}},e.topic))}},3179:(e,t,o)=>{o.r(t),o.d(t,{assets:()=>s,contentTitle:()=>c,default:()=>p,frontMatter:()=>r,metadata:()=>i,toc:()=>m});var a=o(7462),n=(o(7294),o(3905)),l=o(1259);const r={},c="yaml magic",i={unversionedId:"backend/go-by-example/yaml-magic",id:"backend/go-by-example/yaml-magic",title:"yaml magic",description:"{n.d(t,{Zo:()=>p,kt:()=>g});var o=n(7294);function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function l(e){for(var t=1;t=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(o=0;o=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var c=o.createContext({}),s=function(e){var t=o.useContext(c),n=t;return e&&(n="function"==typeof e?e(t):l(l({},t),e)),n},p=function(e){var t=s(e.components);return o.createElement(c.Provider,{value:t},e.children)},u={inlineCode:"code",wrapper:function(e){var t=e.children;return o.createElement(o.Fragment,{},t)}},f=o.forwardRef((function(e,t){var n=e.components,a=e.mdxType,r=e.originalType,c=e.parentName,p=i(e,["components","mdxType","originalType","parentName"]),f=s(n),g=a,m=f["".concat(c,".").concat(g)]||f[g]||u[g]||r;return n?o.createElement(m,l(l({ref:t},p),{},{components:n})):o.createElement(m,l({ref:t},p))}));function g(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var r=n.length,l=new Array(r);l[0]=f;var i={};for(var c in t)hasOwnProperty.call(t,c)&&(i[c]=t[c]);i.originalType=e,i.mdxType="string"==typeof e?e:a,l[1]=i;for(var s=2;s{n.r(t),n.d(t,{assets:()=>c,contentTitle:()=>l,default:()=>u,frontMatter:()=>r,metadata:()=>i,toc:()=>s});var o=n(7462),a=(n(7294),n(3905));const r={},l="Getting started",i={unversionedId:"backend/gocontentful/getting-started",id:"backend/gocontentful/getting-started",title:"Getting started",description:"Installation",source:"@site/docs/backend/gocontentful/02-getting-started.md",sourceDirName:"backend/gocontentful",slug:"/backend/gocontentful/getting-started",permalink:"/docs/backend/gocontentful/getting-started",draft:!1,editUrl:"https://github.com/foomo/foomo-docs/tree/main/foomo/docs/backend/gocontentful/02-getting-started.md",tags:[],version:"current",sidebarPosition:2,frontMatter:{},sidebar:"backendSidebar",previous:{title:"Introduction",permalink:"/docs/backend/gocontentful/introduction"},next:{title:"Play with the test API",permalink:"/docs/backend/gocontentful/test-api"}},c={},s=[{value:"Installation",id:"installation",level:2},{value:"Optional tools",id:"optional-tools",level:2}],p={toc:s};function u(e){let{components:t,...n}=e;return(0,a.kt)("wrapper",(0,o.Z)({},p,n,{components:t,mdxType:"MDXLayout"}),(0,a.kt)("h1",{id:"getting-started"},"Getting started"),(0,a.kt)("h2",{id:"installation"},"Installation"),(0,a.kt)("p",null,"Prerequisite: you need Go 1.16+. Upgrade if you still haven't, then run:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-shell"},"go get github.com/foomo/gocontentful\n")),(0,a.kt)("p",null,"If you trust us there are ",(0,a.kt)("a",{parentName:"p",href:"https://github.com/foomo/gocontentful/releases"},"precompiled versions on Github")),(0,a.kt)("p",null,"On the mac:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-shell"},"brew install foomo/gocontentful/gocontentful\n")),(0,a.kt)("p",null,"Test the installation (make sure $GOPATH/bin is in your $PATH):"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-shell"},"$ gocontentful -version\nv1.0.13\n")),(0,a.kt)("h2",{id:"optional-tools"},"Optional tools"),(0,a.kt)("p",null,"Gocontentful requires a CMA API key to scan the Contentful space and generate the model.\nThis can be passed as a CLI parameter but that's tedious and your management key will remain in your shell history.\nA better approach is to log in to Contentful using the official ",(0,a.kt)("em",{parentName:"p"},"Contentful CLI"),". Gocontentful will get the key automatically.\nTo install the CLI refer to the ",(0,a.kt)("a",{parentName:"p",href:"https://www.contentful.com/developers/docs/tutorials/cli/installation/"},"official documentation at Contentful.com"),"."),(0,a.kt)("p",null,"After installing the CLI log in inside your terminal with:"),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-shell"},"$ contentful login\n")),(0,a.kt)("pre",null,(0,a.kt)("code",{parentName:"pre",className:"language-shell"},"$ gocontentful\n\nERROR: Please specify either a Contentful Space ID and CMA access token or an export file name\n\nSYNOPSIS\n gocontentful -spaceid SpaceID -cmakey CMAKey [-contenttypes firsttype,secondtype...lasttype] path/to/target/package\n\n -cmakey string\n [Optional] Contentful CMA key\n -contenttypes string\n [Optional] Content type IDs to parse, comma separated\n -environment string\n [Optional] Contentful space environment\n -exportfile string\n Space export file to generate the API from\n -help\n Print version and exit\n -spaceid string\n Contentful space ID\n -version\n Print version and exit\n\nNotes:\n- The last segment of the path/to/target/package will be used as package name\n- The -cmakey parameter can be omitted if you logged in with the Contentful CLI\n")),(0,a.kt)("p",null,"Notes:"),(0,a.kt)("ul",null,(0,a.kt)("li",{parentName:"ul"},"The last segment of the path/to/target/package will be used as package name"),(0,a.kt)("li",{parentName:"ul"},"You need to pass gocontentful either cmakey/spaceid (and optional environment) to generate\nthe API from a live space or exportfile to generate it from a local space export file. The cmakey\ncan be omitted if you are logged in through the Contentful CLI.")))}u.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/feda6906.3c4612fa.js b/assets/js/feda6906.463da885.js similarity index 84% rename from assets/js/feda6906.3c4612fa.js rename to assets/js/feda6906.463da885.js index 7cb8330..ab594cf 100644 --- a/assets/js/feda6906.3c4612fa.js +++ b/assets/js/feda6906.463da885.js @@ -1 +1 @@ -"use strict";(self.webpackChunkfoomo=self.webpackChunkfoomo||[]).push([[5867],{3905:(e,t,r)=>{r.d(t,{Zo:()=>s,kt:()=>f});var o=r(7294);function n(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,o)}return r}function c(e){for(var t=1;t=0||(n[r]=e[r]);return n}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}var i=o.createContext({}),p=function(e){var t=o.useContext(i),r=t;return e&&(r="function"==typeof e?e(t):c(c({},t),e)),r},s=function(e){var t=p(e.components);return o.createElement(i.Provider,{value:t},e.children)},d={inlineCode:"code",wrapper:function(e){var t=e.children;return o.createElement(o.Fragment,{},t)}},u=o.forwardRef((function(e,t){var r=e.components,n=e.mdxType,a=e.originalType,i=e.parentName,s=l(e,["components","mdxType","originalType","parentName"]),u=p(r),f=n,m=u["".concat(i,".").concat(f)]||u[f]||d[f]||a;return r?o.createElement(m,c(c({ref:t},s),{},{components:r})):o.createElement(m,c({ref:t},s))}));function f(e,t){var r=arguments,n=t&&t.mdxType;if("string"==typeof e||n){var a=r.length,c=new Array(a);c[0]=u;var l={};for(var i in t)hasOwnProperty.call(t,i)&&(l[i]=t[i]);l.originalType=e,l.mdxType="string"==typeof e?e:n,c[1]=l;for(var p=2;p{r.d(t,{h:()=>n});var o=r(7294);const n=e=>{let{proportion:t,src:r}=e;return t||(t=4/3),o.createElement("div",{style:{width:"100%",height:0,paddingTop:100/t+"%",position:"relative",float:"left"}},o.createElement("iframe",{style:{width:"100%",height:"100%",display:"block",position:"absolute",top:0,left:0},src:r,frameBorder:"0",scrolling:"no",allowFullScreen:!0}))}},9030:(e,t,r)=>{r.d(t,{k:()=>a});var o=r(7294);const n="undefined"==typeof localStorage,a=e=>{const[t,r]=(0,o.useState)((a=e.id,"undefined"!=typeof localStorage&&localStorage.getItem(a)));var a;return(0,o.useEffect)((()=>{console.log("well it is cool",e.id,{isCool:t,SSR:n})}),[t,n]),t?e.children:o.createElement("div",null,o.createElement("button",{className:"button button--lg button--secondary",onClick:t=>{localStorage.setItem(e.id,"yes"),r(!0)}},e.topic))}},9850:(e,t,r)=>{r.d(t,{O:()=>c});var o=r(7294),n=r(4991),a=r(9030);const c=e=>o.createElement(a.k,{topic:"load miro board from https://miro.com",id:"miroIsCool"},o.createElement(n.h,{src:"https://miro.com/app/embed/"+e.id+"/?pres=1&autoplay=yep",proportion:e.proportion}))},111:(e,t,r)=>{r.r(t),r.d(t,{assets:()=>p,contentTitle:()=>l,default:()=>u,frontMatter:()=>c,metadata:()=>i,toc:()=>s});var o=r(7462),n=(r(7294),r(3905)),a=r(9850);const c={},l="Gograpple",i={unversionedId:"backend/gograpple",id:"backend/gograpple",title:"Gograpple",description:"",source:"@site/docs/backend/gograpple.mdx",sourceDirName:"backend",slug:"/backend/gograpple",permalink:"/docs/backend/gograpple",draft:!1,editUrl:"https://github.com/foomo/foomo-docs/tree/main/foomo/docs/backend/gograpple.mdx",tags:[],version:"current",frontMatter:{},sidebar:"backendSidebar",previous:{title:"API Reference",permalink:"/docs/backend/gocontentful/api-reference"}},p={},s=[],d={toc:s};function u(e){let{components:t,...r}=e;return(0,n.kt)("wrapper",(0,o.Z)({},d,r,{components:t,mdxType:"MDXLayout"}),(0,n.kt)("h1",{id:"gograpple"},"Gograpple"),(0,n.kt)(a.O,{id:"o9J_lICItlI=",proportion:1.6,mdxType:"Miro"}))}u.isMDXComponent=!0}}]); \ No newline at end of file +"use strict";(self.webpackChunkfoomo=self.webpackChunkfoomo||[]).push([[5867],{3905:(e,t,r)=>{r.d(t,{Zo:()=>s,kt:()=>m});var o=r(7294);function n(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,o)}return r}function c(e){for(var t=1;t=0||(n[r]=e[r]);return n}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}var i=o.createContext({}),p=function(e){var t=o.useContext(i),r=t;return e&&(r="function"==typeof e?e(t):c(c({},t),e)),r},s=function(e){var t=p(e.components);return o.createElement(i.Provider,{value:t},e.children)},d={inlineCode:"code",wrapper:function(e){var t=e.children;return o.createElement(o.Fragment,{},t)}},u=o.forwardRef((function(e,t){var r=e.components,n=e.mdxType,a=e.originalType,i=e.parentName,s=l(e,["components","mdxType","originalType","parentName"]),u=p(r),m=n,f=u["".concat(i,".").concat(m)]||u[m]||d[m]||a;return r?o.createElement(f,c(c({ref:t},s),{},{components:r})):o.createElement(f,c({ref:t},s))}));function m(e,t){var r=arguments,n=t&&t.mdxType;if("string"==typeof e||n){var a=r.length,c=new Array(a);c[0]=u;var l={};for(var i in t)hasOwnProperty.call(t,i)&&(l[i]=t[i]);l.originalType=e,l.mdxType="string"==typeof e?e:n,c[1]=l;for(var p=2;p{r.d(t,{h:()=>n});var o=r(7294);const n=e=>{let{proportion:t,src:r}=e;return t||(t=4/3),o.createElement("div",{style:{width:"100%",height:0,paddingTop:100/t+"%",position:"relative",float:"left"}},o.createElement("iframe",{style:{width:"100%",height:"100%",display:"block",position:"absolute",top:0,left:0},src:r,frameBorder:"0",scrolling:"no",allowFullScreen:!0}))}},9030:(e,t,r)=>{r.d(t,{k:()=>a});var o=r(7294);const n="undefined"==typeof localStorage,a=e=>{const[t,r]=(0,o.useState)((a=e.id,"undefined"!=typeof localStorage&&localStorage.getItem(a)));var a;return(0,o.useEffect)((()=>{console.log("well it is cool",e.id,{isCool:t,SSR:n})}),[t,n]),t?e.children:o.createElement("div",null,o.createElement("button",{className:"button button--lg button--secondary",onClick:t=>{localStorage.setItem(e.id,"yes"),r(!0)}},e.topic))}},9850:(e,t,r)=>{r.d(t,{O:()=>c});var o=r(7294),n=r(4991),a=r(9030);const c=e=>o.createElement(a.k,{topic:"load miro board from https://miro.com",id:"miroIsCool"},o.createElement(n.h,{src:"https://miro.com/app/embed/"+e.id+"/?pres=1&autoplay=yep",proportion:e.proportion}))},111:(e,t,r)=>{r.r(t),r.d(t,{assets:()=>p,contentTitle:()=>l,default:()=>u,frontMatter:()=>c,metadata:()=>i,toc:()=>s});var o=r(7462),n=(r(7294),r(3905)),a=r(9850);const c={},l="Gograpple",i={unversionedId:"backend/gograpple",id:"backend/gograpple",title:"Gograpple",description:"",source:"@site/docs/backend/gograpple.mdx",sourceDirName:"backend",slug:"/backend/gograpple",permalink:"/docs/backend/gograpple",draft:!1,editUrl:"https://github.com/foomo/foomo-docs/tree/main/foomo/docs/backend/gograpple.mdx",tags:[],version:"current",frontMatter:{},sidebar:"backendSidebar",previous:{title:"yaml magic",permalink:"/docs/backend/go-by-example/yaml-magic"}},p={},s=[],d={toc:s};function u(e){let{components:t,...r}=e;return(0,n.kt)("wrapper",(0,o.Z)({},d,r,{components:t,mdxType:"MDXLayout"}),(0,n.kt)("h1",{id:"gograpple"},"Gograpple"),(0,n.kt)(a.O,{id:"o9J_lICItlI=",proportion:1.6,mdxType:"Miro"}))}u.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/assets/js/main.3103020b.js b/assets/js/main.3103020b.js deleted file mode 100644 index 0787748..0000000 --- a/assets/js/main.3103020b.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! For license information please see main.3103020b.js.LICENSE.txt */ -(self.webpackChunkfoomo=self.webpackChunkfoomo||[]).push([[179],{830:(e,t,n)=>{"use strict";n.d(t,{W:()=>a});var r=n(7294);function a(){return r.createElement("svg",{width:"20",height:"20",className:"DocSearch-Search-Icon",viewBox:"0 0 20 20"},r.createElement("path",{d:"M14.386 14.386l4.0877 4.0877-4.0877-4.0877c-2.9418 2.9419-7.7115 2.9419-10.6533 0-2.9419-2.9418-2.9419-7.7115 0-10.6533 2.9418-2.9419 7.7115-2.9419 10.6533 0 2.9419 2.9418 2.9419 7.7115 0 10.6533z",stroke:"currentColor",fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"}))}},723:(e,t,n)=>{"use strict";n.d(t,{Z:()=>f});var r=n(7294),a=n(7462),o=n(8356),i=n.n(o),l=n(6887);const s={"01a85c17":[()=>Promise.all([n.e(532),n.e(4013)]).then(n.bind(n,4524)),"@theme/BlogTagsListPage",4524],"02493ab9":[()=>n.e(4761).then(n.t.bind(n,7,19)),"~blog/default/blog-tags-search-engine-7d1.json",7],"03d72bfc":[()=>n.e(2193).then(n.bind(n,1569)),"@site/docs/backend/gocontentful/01-introduction.md",1569],"04056cce":[()=>n.e(6660).then(n.bind(n,7506)),"@site/docs/devops/kubernetes/spot-instance-node-pools.md",7506],"050cf89e":[()=>n.e(6788).then(n.t.bind(n,4252,19)),"~blog/default/blog-tags-k-8-s-77c.json",4252],"0606a637":[()=>n.e(2648).then(n.bind(n,9342)),"@site/docs/frontend/setup.md",9342],"075f70f6":[()=>n.e(41).then(n.t.bind(n,366,19)),"~blog/default/blog-tags-bundle-size-fd8-list.json",366],"0911540a":[()=>n.e(7566).then(n.bind(n,9088)),"@site/docs/general/work/remote-work.md",9088],"0a5fa0dd":[()=>n.e(8495).then(n.bind(n,3572)),"@site/docs/projects/gotsrpc.md",3572],"0fc9ee27":[()=>n.e(1658).then(n.t.bind(n,8682,19)),"~blog/default/blog-tags-foomo-fcf-list.json",8682],"12623ccc":[()=>n.e(8423).then(n.bind(n,4782)),"@site/docs/projects/architecture.mdx",4782],"146489e7":[()=>n.e(6083).then(n.t.bind(n,8090,19)),"~blog/default/blog-tags-foomo-fcf.json",8090],"15d070c3":[()=>n.e(4963).then(n.t.bind(n,8055,19)),"~blog/default/blog-tags-backend-232-list.json",8055],17896441:[()=>Promise.all([n.e(532),n.e(5203),n.e(7918)]).then(n.bind(n,9055)),"@theme/DocItem",9055],"1a4e3797":[()=>Promise.all([n.e(532),n.e(7920)]).then(n.bind(n,9172)),"@theme/SearchPage",9172],"1aa4b20d":[()=>n.e(1911).then(n.bind(n,1877)),"@site/docs/general/utilities/k9s.md",1877],"1b3e71b9":[()=>n.e(9543).then(n.bind(n,7562)),"@site/docs/general/package-managers.md",7562],"1be78505":[()=>Promise.all([n.e(532),n.e(9514)]).then(n.bind(n,9963)),"@theme/DocPage",9963],"1df93b7f":[()=>Promise.all([n.e(532),n.e(3237)]).then(n.bind(n,8368)),"@site/src/pages/index.tsx",8368],"1f391b9e":[()=>Promise.all([n.e(532),n.e(5203),n.e(3085)]).then(n.bind(n,4247)),"@theme/MDXPage",4247],"26ea2a44":[()=>n.e(1435).then(n.bind(n,8493)),"@site/blog/2022-03-17-why-bundle-size-is-important/index.mdx?truncated=true",8493],"29f10043":[()=>n.e(4622).then(n.t.bind(n,9059,19)),"~blog/default/blog-tags-debugging-75f.json",9059],"2b6f3ca6":[()=>n.e(801).then(n.bind(n,4262)),"@site/blog/2022-01-19-map-race-debugging/index.mdx",4262],"2b793916":[()=>n.e(7696).then(n.bind(n,7624)),"@site/docs/devops/k8s.md",7624],"2cb19d2e":[()=>n.e(6579).then(n.bind(n,2892)),"@site/docs/projects/cms/contentful.md",2892],"2e75142e":[()=>n.e(7779).then(n.t.bind(n,873,19)),"~blog/default/blog-tags-search-engine-7d1-list.json",873],"2e7a3344":[()=>n.e(9142).then(n.t.bind(n,7718,19)),"~blog/default/blog-tags-search-304-list.json",7718],"3338c0e0":[()=>n.e(5791).then(n.t.bind(n,3592,19)),"~docs/default/tag-docs-tags-frontend-43f.json",3592],"3352bb21":[()=>n.e(2233).then(n.bind(n,2187)),"@site/docs/devops/bookmarks.md",2187],"35b210c0":[()=>n.e(5900).then(n.bind(n,4116)),"@site/blog/2022-01-19-map-race-debugging/index.mdx?truncated=true",4116],"36213d62":[()=>n.e(4574).then(n.bind(n,8492)),"@site/src/pages/awesome-software.md",8492],"3720c009":[()=>Promise.all([n.e(532),n.e(3751)]).then(n.bind(n,727)),"@theme/DocTagsListPage",727],"37e97a4e":[()=>n.e(8735).then(n.bind(n,6247)),"@site/blog/2022-01-20-exploring-partytown/index.mdx?truncated=true",6247],"395ebfc6":[()=>n.e(2416).then(n.bind(n,5943)),"@site/docs/frontend/rtfm.md",5943],"3b233ea0":[()=>n.e(7533).then(n.bind(n,1623)),"@site/blog/2022-01-20-exploring-partytown/index.mdx",1623],"3d3976a7":[()=>n.e(7785).then(n.bind(n,2145)),"@site/docs/backend/rtfm.md",2145],43141670:[()=>n.e(3732).then(n.bind(n,2411)),"@site/docs/backend/gocontentful/03-test-api.md",2411],"43dc0045":[()=>n.e(206).then(n.bind(n,4311)),"@site/docs/backend/go-by-example/panic-and-recover.md",4311],"45c436a9":[()=>n.e(5260).then(n.bind(n,4956)),"@site/blog/2022-01-25-prometheus-cardinality-issues/index.mdx?truncated=true",4956],"4709a4ae":[()=>n.e(7583).then(n.t.bind(n,4257,19)),"~blog/default/blog-tags-debugging-75f-list.json",4257],"4c37729a":[()=>n.e(3223).then(n.t.bind(n,3712,19)),"~blog/default/blog-tags-devops-5ce.json",3712],"4d194efc":[()=>n.e(7958).then(n.bind(n,1513)),"@site/blog/2022-01-20-searching-for-search-engines.mdx",1513],"4ec6c0ec":[()=>n.e(6222).then(n.bind(n,4628)),"@site/docs/frontend/performance.md",4628],"5039a037":[()=>n.e(6227).then(n.bind(n,2054)),"@site/docs/general/work/general.md",2054],"53c6067e":[()=>n.e(5331).then(n.t.bind(n,1459,19)),"~blog/default/blog-tags-oom-358-list.json",1459],"55960ee5":[()=>n.e(4121).then(n.t.bind(n,8070,19)),"~docs/default/tags-list-current-prop-15a.json",8070],"559c04ef":[()=>n.e(1213).then(n.t.bind(n,4203,19)),"~blog/default/blog-tags-memory-b07.json",4203],"588f630f":[()=>n.e(4168).then(n.t.bind(n,760,19)),"~blog/default/blog-tags-ops-377-list.json",760],"5ce51c20":[()=>n.e(3122).then(n.bind(n,667)),"@site/docs/backend/gocontentful/99-api-reference.md",667],"5d6cc085":[()=>n.e(4894).then(n.bind(n,5806)),"@site/docs/backend/setup.md",5806],"5e9f5e1a":[()=>Promise.resolve().then(n.bind(n,6809)),"@generated/docusaurus.config",6809],"5e9fc3ef":[()=>n.e(5709).then(n.bind(n,9494)),"@site/docs/general/intro.md",9494],"5f154b3e":[()=>n.e(6840).then(n.t.bind(n,3896,19)),"~blog/default/blog-tags-search-304.json",3896],"61e4c616":[()=>n.e(1654).then(n.t.bind(n,1042,19)),"~blog/default/blog-tags-prometheus-d87-list.json",1042],"66aa330a":[()=>n.e(7602).then(n.t.bind(n,8513,19)),"~blog/default/blog-tags-ops-377.json",8513],"6875c492":[()=>Promise.all([n.e(532),n.e(5203),n.e(2529),n.e(8610)]).then(n.bind(n,1714)),"@theme/BlogTagsPostsPage",1714],"6a670c2a":[()=>n.e(5211).then(n.bind(n,2262)),"@site/docs/projects/intro.md",2262],"6ae7c37b":[()=>n.e(7369).then(n.t.bind(n,4469,19)),"/home/runner/work/foomo-docs/foomo-docs/foomo/.docusaurus/docusaurus-plugin-content-blog/default/plugin-route-context-module-100.json",4469],"70617f54":[()=>n.e(7027).then(n.bind(n,7169)),"@site/docs/devops/monitoring/jaeger.md",7169],"7071e909":[()=>n.e(5500).then(n.bind(n,232)),"@site/docs/frontend/typescript/spreading.md",232],"72cf7f21":[()=>n.e(6073).then(n.bind(n,5500)),"@site/docs/projects/webgrapple.md",5500],"73d13a5e":[()=>n.e(5012).then(n.t.bind(n,4860,19)),"~blog/default/blog-tags-bundle-fd9-list.json",4860],"78460e70":[()=>n.e(9746).then(n.bind(n,1359)),"@site/docs/frontend/intro.md",1359],"78a933e5":[()=>n.e(3411).then(n.t.bind(n,2653,19)),"~docs/default/tag-docs-tags-overview-0e5.json",2653],"7c1f10d1":[()=>n.e(2302).then(n.bind(n,80)),"@site/docs/project-management/responsibility.md",80],"7fdf1619":[()=>n.e(5839).then(n.bind(n,5244)),"@site/blog/2022-01-20-searching-for-search-engines.mdx?truncated=true",5244],"8047a11d":[()=>n.e(405).then(n.bind(n,9232)),"@site/docs/frontend/stack.md",9232],"8077e178":[()=>n.e(8503).then(n.bind(n,4170)),"@site/docs/backend/go-by-example/map-racing.md",4170],"8139c962":[()=>n.e(3626).then(n.bind(n,930)),"@site/docs/general/setup/workplace.md",930],"814f3328":[()=>n.e(2535).then(n.t.bind(n,5641,19)),"~blog/default/blog-post-list-prop-default.json",5641],"852c116a":[()=>n.e(3306).then(n.t.bind(n,1234,19)),"~blog/default/blog-tags-cardinality-850-list.json",1234],"866d8221":[()=>n.e(2471).then(n.t.bind(n,6287,19)),"~blog/default/blog-tags-bundle-size-fd8.json",6287],"87b8e9c4":[()=>n.e(2423).then(n.bind(n,3059)),"@site/blog/2022-03-17-why-bundle-size-is-important/index.mdx",3059],"935f2afb":[()=>n.e(53).then(n.t.bind(n,1109,19)),"~docs/default/version-current-metadata-prop-751.json",1109],"96e76de9":[()=>n.e(9493).then(n.t.bind(n,7804,19)),"~blog/default/blog-tags-performance-e1d-list.json",7804],"99a66f7b":[()=>n.e(259).then(n.t.bind(n,8769,19)),"~blog/default/blog-tags-frontend-1ec-list.json",8769],"99bb4438":[()=>n.e(3899).then(n.bind(n,1437)),"@site/docs/projects/pagespeed-exporter.md",1437],"9a0007dd":[()=>n.e(4298).then(n.bind(n,5754)),"@site/docs/backend/gocontentful/05-caching.md",5754],"9a50dba7":[()=>n.e(2833).then(n.bind(n,1641)),"@site/docs/frontend/typescript/objects.mdx",1641],"9e4087bc":[()=>n.e(3608).then(n.bind(n,3169)),"@theme/BlogArchivePage",3169],a15e8276:[()=>Promise.all([n.e(8576),n.e(4033)]).then(n.bind(n,888)),"@site/docs/backend/intro.mdx",888],a2a43668:[()=>n.e(2289).then(n.t.bind(n,7085,19)),"/home/runner/work/foomo-docs/foomo-docs/foomo/.docusaurus/docusaurus-theme-search-algolia/default/plugin-route-context-module-100.json",7085],a6aa9e1f:[()=>Promise.all([n.e(532),n.e(5203),n.e(2529),n.e(3089)]).then(n.bind(n,46)),"@theme/BlogListPage",46],a7023ddc:[()=>n.e(1713).then(n.t.bind(n,3457,19)),"~blog/default/blog-tags-tags-4c2.json",3457],a8a1ab13:[()=>n.e(1064).then(n.bind(n,9532)),"@site/blog/2021-11-12-welcome/index.md",9532],ac94ec9c:[()=>n.e(2672).then(n.bind(n,7148)),"@site/docs/frontend/debugging.md",7148],b0751d67:[()=>n.e(8666).then(n.bind(n,2246)),"@site/docs/devops/monitoring/intro.md",2246],b2b675dd:[()=>n.e(533).then(n.t.bind(n,8017,19)),"~blog/default/blog-c06.json",8017],b2f554cd:[()=>n.e(1477).then(n.t.bind(n,10,19)),"~blog/default/blog-archive-80c.json",10],b3d5163b:[()=>n.e(4195).then(n.bind(n,6710)),"@site/docs/projects/cms/intro.md",6710],b59d5feb:[()=>n.e(6512).then(n.bind(n,5121)),"@site/docs/projects/libraries/keel.md",5121],b8302cf9:[()=>n.e(899).then(n.t.bind(n,9749,19)),"~blog/default/blog-tags-bundle-fd9.json",9749],b93844a0:[()=>n.e(2911).then(n.t.bind(n,5601,19)),"~blog/default/blog-tags-devops-5ce-list.json",5601],ba52226f:[()=>n.e(2880).then(n.bind(n,8262)),"@site/docs/general/essentials.md",8262],bee3f77a:[()=>n.e(1880).then(n.bind(n,1657)),"@site/docs/frontend/css.md",1657],beea6c26:[()=>n.e(4170).then(n.t.bind(n,3576,19)),"~blog/default/blog-tags-javascript-251.json",3576],c00dc5e0:[()=>n.e(3363).then(n.bind(n,9097)),"@site/docs/projects/site-reliability/site-reliability.md",9097],c0f96715:[()=>n.e(4192).then(n.bind(n,9233)),"@site/docs/backend/gocontentful/04-working-with-gocontentful-api.md",9233],c1acf0e3:[()=>n.e(3969).then(n.t.bind(n,5475,19)),"~blog/default/blog-tags-prometheus-d87.json",5475],c2b2df4f:[()=>n.e(6582).then(n.t.bind(n,3573,19)),"~blog/default/blog-tags-backend-232.json",3573],c3ad09c3:[()=>n.e(6465).then(n.bind(n,3309)),"@site/docs/devops/monitoring/grafana.md",3309],c5cdc278:[()=>n.e(6516).then(n.t.bind(n,1087,19)),"~docs/default/tag-docs-tags-sse-82f.json",1087],c6d1405e:[()=>n.e(3866).then(n.t.bind(n,6310,19)),"~blog/default/blog-tags-cardinality-850.json",6310],c6f71f2b:[()=>n.e(4491).then(n.t.bind(n,8590,19)),"~blog/default/blog-tags-frontend-1ec.json",8590],c99de435:[()=>Promise.all([n.e(8576),n.e(3181)]).then(n.bind(n,9220)),"@site/docs/backend/go-by-example/nil-maps.mdx",9220],ccc49370:[()=>Promise.all([n.e(532),n.e(5203),n.e(2529),n.e(6103)]).then(n.bind(n,9178)),"@theme/BlogPostPage",9178],cce51cf2:[()=>n.e(6447).then(n.t.bind(n,2932,19)),"~blog/default/blog-tags-go-099-list.json",2932],cce78ecb:[()=>n.e(7183).then(n.bind(n,9498)),"@site/docs/project-management/intro.md",9498],cd2041f2:[()=>n.e(6009).then(n.bind(n,9619)),"@site/blog/2021-11-12-welcome/index.md?truncated=true",9619],d1323eba:[()=>n.e(2078).then(n.bind(n,8059)),"@site/src/pages/etc/imprint.md",8059],d694a256:[()=>n.e(4636).then(n.t.bind(n,5745,19)),"/home/runner/work/foomo-docs/foomo-docs/foomo/.docusaurus/docusaurus-plugin-content-pages/default/plugin-route-context-module-100.json",5745],d7c843b2:[()=>n.e(6487).then(n.bind(n,9544)),"@site/docs/devops/intro.md",9544],d9c065e5:[()=>n.e(5398).then(n.bind(n,9808)),"@site/docs/frontend/vscode.md",9808],da5526be:[()=>n.e(2115).then(n.t.bind(n,6826,19)),"~blog/default/blog-tags-k-8-s-77c-list.json",6826],dd79439c:[()=>n.e(7355).then(n.bind(n,1345)),"@site/blog/2022-01-25-prometheus-cardinality-issues/index.mdx",1345],df203c0f:[()=>n.e(9924).then(n.bind(n,491)),"@theme/DocTagDocListPage",491],e25ea6ac:[()=>n.e(5408).then(n.bind(n,5285)),"@site/docs/general/security.md",5285],e35f371e:[()=>n.e(5817).then(n.bind(n,777)),"@site/docs/projects/cms/contentserver.md",777],e62c5aa0:[()=>n.e(9116).then(n.t.bind(n,3417,19)),"~blog/default/blog-tags-performance-e1d.json",3417],e6e8ac82:[()=>n.e(1186).then(n.t.bind(n,8548,19)),"~blog/default/blog-tags-javascript-251-list.json",8548],e8b8784f:[()=>n.e(8462).then(n.t.bind(n,1895,19)),"~docs/default/tag-docs-tags-javascript-c37.json",1895],f0d1e73f:[()=>n.e(4742).then(n.bind(n,5238)),"@site/docs/frontend/pitfalls.md",5238],f11ea25e:[()=>n.e(8868).then(n.bind(n,3061)),"@site/docs/projects/utilities/gograpple.md",3061],f12ae7d6:[()=>Promise.all([n.e(8576),n.e(2364)]).then(n.bind(n,3179)),"@site/docs/backend/go-by-example/yaml-magic.mdx",3179],f1808d3f:[()=>Promise.all([n.e(8576),n.e(5902)]).then(n.bind(n,5794)),"@site/docs/backend/go-by-example/ranging.mdx",5794],f258ed81:[()=>n.e(3393).then(n.bind(n,3650)),"@site/docs/general/technologies/SSE.md",3650],f46e16a6:[()=>n.e(6608).then(n.bind(n,3667)),"@site/docs/backend/gocontentful/02-getting-started.md",3667],f768d962:[()=>n.e(9196).then(n.bind(n,603)),"@site/docs/general/setup/computer.md",603],f7d870b9:[()=>n.e(4859).then(n.t.bind(n,9592,19)),"~blog/default/blog-tags-oom-358.json",9592],f9b88137:[()=>n.e(4080).then(n.t.bind(n,3769,19)),"/home/runner/work/foomo-docs/foomo-docs/foomo/.docusaurus/docusaurus-plugin-content-docs/default/plugin-route-context-module-100.json",3769],fc3deafd:[()=>n.e(7659).then(n.t.bind(n,4568,19)),"~blog/default/blog-tags-go-099.json",4568],fd894448:[()=>n.e(8180).then(n.t.bind(n,5278,19)),"~blog/default/blog-tags-memory-b07-list.json",5278],fe08baec:[()=>n.e(5477).then(n.t.bind(n,4106,19)),"~docs/default/tag-docs-tags-go-519.json",4106],feda6906:[()=>n.e(5867).then(n.bind(n,111)),"@site/docs/backend/gograpple.mdx",111]};function c(e){let{error:t,retry:n,pastDelay:a}=e;return t?r.createElement("div",{style:{textAlign:"center",color:"#fff",backgroundColor:"#fa383e",borderColor:"#fa383e",borderStyle:"solid",borderRadius:"0.25rem",borderWidth:"1px",boxSizing:"border-box",display:"block",padding:"1rem",flex:"0 0 50%",marginLeft:"25%",marginRight:"25%",marginTop:"5rem",maxWidth:"50%",width:"100%"}},r.createElement("p",null,String(t)),r.createElement("div",null,r.createElement("button",{type:"button",onClick:n},"Retry"))):a?r.createElement("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",height:"100vh"}},r.createElement("svg",{id:"loader",style:{width:128,height:110,position:"absolute",top:"calc(100vh - 64%)"},viewBox:"0 0 45 45",xmlns:"http://www.w3.org/2000/svg",stroke:"#61dafb"},r.createElement("g",{fill:"none",fillRule:"evenodd",transform:"translate(1 1)",strokeWidth:"2"},r.createElement("circle",{cx:"22",cy:"22",r:"6",strokeOpacity:"0"},r.createElement("animate",{attributeName:"r",begin:"1.5s",dur:"3s",values:"6;22",calcMode:"linear",repeatCount:"indefinite"}),r.createElement("animate",{attributeName:"stroke-opacity",begin:"1.5s",dur:"3s",values:"1;0",calcMode:"linear",repeatCount:"indefinite"}),r.createElement("animate",{attributeName:"stroke-width",begin:"1.5s",dur:"3s",values:"2;0",calcMode:"linear",repeatCount:"indefinite"})),r.createElement("circle",{cx:"22",cy:"22",r:"6",strokeOpacity:"0"},r.createElement("animate",{attributeName:"r",begin:"3s",dur:"3s",values:"6;22",calcMode:"linear",repeatCount:"indefinite"}),r.createElement("animate",{attributeName:"stroke-opacity",begin:"3s",dur:"3s",values:"1;0",calcMode:"linear",repeatCount:"indefinite"}),r.createElement("animate",{attributeName:"stroke-width",begin:"3s",dur:"3s",values:"2;0",calcMode:"linear",repeatCount:"indefinite"})),r.createElement("circle",{cx:"22",cy:"22",r:"8"},r.createElement("animate",{attributeName:"r",begin:"0s",dur:"1.5s",values:"6;1;2;3;4;5;6",calcMode:"linear",repeatCount:"indefinite"}))))):null}var u=n(9670),d=n(226);function p(e,t){if("*"===e)return i()({loading:c,loader:()=>n.e(4972).then(n.bind(n,4972)),modules:["@theme/NotFound"],webpack:()=>[4972],render(e,t){const n=e.default;return r.createElement(d.z,{value:{plugin:{name:"native",id:"default"}}},r.createElement(n,t))}});const o=l[`${e}-${t}`],p={},f=[],m=[],g=(0,u.Z)(o);return Object.entries(g).forEach((e=>{let[t,n]=e;const r=s[n];r&&(p[t]=r[0],f.push(r[1]),m.push(r[2]))})),i().Map({loading:c,loader:p,modules:f,webpack:()=>m,render(t,n){const i=JSON.parse(JSON.stringify(o));Object.entries(t).forEach((t=>{let[n,r]=t;const a=r.default;if(!a)throw new Error(`The page component at ${e} doesn't have a default export. This makes it impossible to render anything. Consider default-exporting a React component.`);"object"!=typeof a&&"function"!=typeof a||Object.keys(r).filter((e=>"default"!==e)).forEach((e=>{a[e]=r[e]}));let o=i;const l=n.split(".");l.slice(0,-1).forEach((e=>{o=o[e]})),o[l[l.length-1]]=a}));const l=i.__comp;delete i.__comp;const s=i.__context;return delete i.__context,r.createElement(d.z,{value:s},r.createElement(l,(0,a.Z)({},i,n)))}})}const f=[{path:"/awesome-software",component:p("/awesome-software","b51"),exact:!0},{path:"/blog",component:p("/blog","8ba"),exact:!0},{path:"/blog/archive",component:p("/blog/archive","561"),exact:!0},{path:"/blog/debugging-go-map-races-in-k8s",component:p("/blog/debugging-go-map-races-in-k8s","936"),exact:!0},{path:"/blog/impact-of-3rd-party-scripts-on-performance",component:p("/blog/impact-of-3rd-party-scripts-on-performance","60d"),exact:!0},{path:"/blog/prometheus-cardinality-issues",component:p("/blog/prometheus-cardinality-issues","d7d"),exact:!0},{path:"/blog/searching-for-search-engines",component:p("/blog/searching-for-search-engines","99e"),exact:!0},{path:"/blog/tags",component:p("/blog/tags","4bc"),exact:!0},{path:"/blog/tags/backend",component:p("/blog/tags/backend","179"),exact:!0},{path:"/blog/tags/bundle",component:p("/blog/tags/bundle","3a7"),exact:!0},{path:"/blog/tags/bundle-size",component:p("/blog/tags/bundle-size","c06"),exact:!0},{path:"/blog/tags/cardinality",component:p("/blog/tags/cardinality","fc7"),exact:!0},{path:"/blog/tags/debugging",component:p("/blog/tags/debugging","81f"),exact:!0},{path:"/blog/tags/devops",component:p("/blog/tags/devops","70b"),exact:!0},{path:"/blog/tags/foomo",component:p("/blog/tags/foomo","063"),exact:!0},{path:"/blog/tags/frontend",component:p("/blog/tags/frontend","4b3"),exact:!0},{path:"/blog/tags/go",component:p("/blog/tags/go","b16"),exact:!0},{path:"/blog/tags/javascript",component:p("/blog/tags/javascript","d18"),exact:!0},{path:"/blog/tags/k-8-s",component:p("/blog/tags/k-8-s","782"),exact:!0},{path:"/blog/tags/memory",component:p("/blog/tags/memory","01a"),exact:!0},{path:"/blog/tags/oom",component:p("/blog/tags/oom","43f"),exact:!0},{path:"/blog/tags/ops",component:p("/blog/tags/ops","e2a"),exact:!0},{path:"/blog/tags/performance",component:p("/blog/tags/performance","ad9"),exact:!0},{path:"/blog/tags/prometheus",component:p("/blog/tags/prometheus","672"),exact:!0},{path:"/blog/tags/search",component:p("/blog/tags/search","298"),exact:!0},{path:"/blog/tags/search-engine",component:p("/blog/tags/search-engine","f20"),exact:!0},{path:"/blog/welcome-back-2021",component:p("/blog/welcome-back-2021","719"),exact:!0},{path:"/blog/why-bundle-size-is-important",component:p("/blog/why-bundle-size-is-important","245"),exact:!0},{path:"/docs/tags",component:p("/docs/tags","6a9"),exact:!0},{path:"/docs/tags/frontend",component:p("/docs/tags/frontend","b2a"),exact:!0},{path:"/docs/tags/go",component:p("/docs/tags/go","ddd"),exact:!0},{path:"/docs/tags/javascript",component:p("/docs/tags/javascript","9e8"),exact:!0},{path:"/docs/tags/overview",component:p("/docs/tags/overview","180"),exact:!0},{path:"/docs/tags/sse",component:p("/docs/tags/sse","c80"),exact:!0},{path:"/etc/imprint",component:p("/etc/imprint","401"),exact:!0},{path:"/search",component:p("/search","c08"),exact:!0},{path:"/docs",component:p("/docs","d88"),routes:[{path:"/docs/backend/go-by-example/map-racing",component:p("/docs/backend/go-by-example/map-racing","37f"),exact:!0,sidebar:"backendSidebar"},{path:"/docs/backend/go-by-example/nil-maps",component:p("/docs/backend/go-by-example/nil-maps","7b0"),exact:!0,sidebar:"backendSidebar"},{path:"/docs/backend/go-by-example/panic-and-recover",component:p("/docs/backend/go-by-example/panic-and-recover","a47"),exact:!0,sidebar:"backendSidebar"},{path:"/docs/backend/go-by-example/ranging",component:p("/docs/backend/go-by-example/ranging","5e2"),exact:!0,sidebar:"backendSidebar"},{path:"/docs/backend/go-by-example/yaml-magic",component:p("/docs/backend/go-by-example/yaml-magic","e58"),exact:!0,sidebar:"backendSidebar"},{path:"/docs/backend/gocontentful/api-reference",component:p("/docs/backend/gocontentful/api-reference","918"),exact:!0,sidebar:"backendSidebar"},{path:"/docs/backend/gocontentful/caching",component:p("/docs/backend/gocontentful/caching","acd"),exact:!0,sidebar:"backendSidebar"},{path:"/docs/backend/gocontentful/getting-started",component:p("/docs/backend/gocontentful/getting-started","4ac"),exact:!0,sidebar:"backendSidebar"},{path:"/docs/backend/gocontentful/introduction",component:p("/docs/backend/gocontentful/introduction","c0b"),exact:!0,sidebar:"backendSidebar"},{path:"/docs/backend/gocontentful/test-api",component:p("/docs/backend/gocontentful/test-api","e6d"),exact:!0,sidebar:"backendSidebar"},{path:"/docs/backend/gocontentful/working-with-gocontentful-api",component:p("/docs/backend/gocontentful/working-with-gocontentful-api","223"),exact:!0,sidebar:"backendSidebar"},{path:"/docs/backend/gograpple",component:p("/docs/backend/gograpple","40b"),exact:!0,sidebar:"backendSidebar"},{path:"/docs/backend/intro",component:p("/docs/backend/intro","da8"),exact:!0,sidebar:"backendSidebar"},{path:"/docs/backend/rtfm",component:p("/docs/backend/rtfm","a20"),exact:!0,sidebar:"backendSidebar"},{path:"/docs/backend/setup",component:p("/docs/backend/setup","c4b"),exact:!0,sidebar:"backendSidebar"},{path:"/docs/devops/bookmarks",component:p("/docs/devops/bookmarks","c10"),exact:!0,sidebar:"devopsSidebar"},{path:"/docs/devops/intro",component:p("/docs/devops/intro","d26"),exact:!0,sidebar:"devopsSidebar"},{path:"/docs/devops/k8s",component:p("/docs/devops/k8s","1e2"),exact:!0,sidebar:"devopsSidebar"},{path:"/docs/devops/kubernetes/spot-instance-node-pools",component:p("/docs/devops/kubernetes/spot-instance-node-pools","7b7"),exact:!0,sidebar:"devopsSidebar"},{path:"/docs/devops/monitoring/grafana",component:p("/docs/devops/monitoring/grafana","9f4"),exact:!0,sidebar:"devopsSidebar"},{path:"/docs/devops/monitoring/intro",component:p("/docs/devops/monitoring/intro","269"),exact:!0,sidebar:"devopsSidebar"},{path:"/docs/devops/monitoring/jaeger",component:p("/docs/devops/monitoring/jaeger","6e8"),exact:!0,sidebar:"devopsSidebar"},{path:"/docs/frontend/css",component:p("/docs/frontend/css","f9c"),exact:!0,sidebar:"frontendSidebar"},{path:"/docs/frontend/debugging_js",component:p("/docs/frontend/debugging_js","9af"),exact:!0,sidebar:"frontendSidebar"},{path:"/docs/frontend/intro",component:p("/docs/frontend/intro","696"),exact:!0,sidebar:"frontendSidebar"},{path:"/docs/frontend/performance",component:p("/docs/frontend/performance","e5f"),exact:!0,sidebar:"frontendSidebar"},{path:"/docs/frontend/pitfalls",component:p("/docs/frontend/pitfalls","2d0"),exact:!0,sidebar:"frontendSidebar"},{path:"/docs/frontend/rtfm",component:p("/docs/frontend/rtfm","63f"),exact:!0,sidebar:"frontendSidebar"},{path:"/docs/frontend/setup",component:p("/docs/frontend/setup","cef"),exact:!0,sidebar:"frontendSidebar"},{path:"/docs/frontend/stack",component:p("/docs/frontend/stack","405"),exact:!0,sidebar:"frontendSidebar"},{path:"/docs/frontend/typescript/objects",component:p("/docs/frontend/typescript/objects","911"),exact:!0,sidebar:"frontendSidebar"},{path:"/docs/frontend/typescript/spreading",component:p("/docs/frontend/typescript/spreading","165"),exact:!0,sidebar:"frontendSidebar"},{path:"/docs/frontend/vscode",component:p("/docs/frontend/vscode","afd"),exact:!0,sidebar:"frontendSidebar"},{path:"/docs/general/essentials",component:p("/docs/general/essentials","c69"),exact:!0,sidebar:"generalSidebar"},{path:"/docs/general/intro",component:p("/docs/general/intro","23c"),exact:!0,sidebar:"generalSidebar"},{path:"/docs/general/package-managers",component:p("/docs/general/package-managers","954"),exact:!0,sidebar:"generalSidebar"},{path:"/docs/general/security",component:p("/docs/general/security","029"),exact:!0,sidebar:"generalSidebar"},{path:"/docs/general/setup/computer",component:p("/docs/general/setup/computer","f7c"),exact:!0,sidebar:"generalSidebar"},{path:"/docs/general/setup/workplace",component:p("/docs/general/setup/workplace","24c"),exact:!0,sidebar:"generalSidebar"},{path:"/docs/general/technologies/sse",component:p("/docs/general/technologies/sse","f75"),exact:!0,sidebar:"generalSidebar"},{path:"/docs/general/utilities/k9s",component:p("/docs/general/utilities/k9s","c9c"),exact:!0,sidebar:"generalSidebar"},{path:"/docs/general/work/general",component:p("/docs/general/work/general","09b"),exact:!0,sidebar:"generalSidebar"},{path:"/docs/general/work/remote-work",component:p("/docs/general/work/remote-work","022"),exact:!0,sidebar:"generalSidebar"},{path:"/docs/project-management/intro",component:p("/docs/project-management/intro","519"),exact:!0,sidebar:"pmSidebar"},{path:"/docs/project-management/responsibility",component:p("/docs/project-management/responsibility","162"),exact:!0,sidebar:"pmSidebar"},{path:"/docs/projects/architecture",component:p("/docs/projects/architecture","6a5"),exact:!0,sidebar:"projectsSidebar"},{path:"/docs/projects/cms/contentful",component:p("/docs/projects/cms/contentful","d87"),exact:!0,sidebar:"projectsSidebar"},{path:"/docs/projects/cms/contentserver",component:p("/docs/projects/cms/contentserver","ff1"),exact:!0,sidebar:"projectsSidebar"},{path:"/docs/projects/cms/intro",component:p("/docs/projects/cms/intro","4b4"),exact:!0,sidebar:"projectsSidebar"},{path:"/docs/projects/gotsrpc",component:p("/docs/projects/gotsrpc","5c4"),exact:!0,sidebar:"projectsSidebar"},{path:"/docs/projects/intro",component:p("/docs/projects/intro","9f4"),exact:!0,sidebar:"projectsSidebar"},{path:"/docs/projects/libraries/keel",component:p("/docs/projects/libraries/keel","d5c"),exact:!0,sidebar:"projectsSidebar"},{path:"/docs/projects/pagespeed-exporter",component:p("/docs/projects/pagespeed-exporter","385"),exact:!0,sidebar:"projectsSidebar"},{path:"/docs/projects/site-reliability",component:p("/docs/projects/site-reliability","93a"),exact:!0,sidebar:"projectsSidebar"},{path:"/docs/projects/utilities/gograpple",component:p("/docs/projects/utilities/gograpple","f1d"),exact:!0,sidebar:"projectsSidebar"},{path:"/docs/projects/webgrapple",component:p("/docs/projects/webgrapple","f6b"),exact:!0,sidebar:"projectsSidebar"}]},{path:"/",component:p("/","110"),exact:!0},{path:"*",component:p("*")}]},8934:(e,t,n)=>{"use strict";n.d(t,{_:()=>a,t:()=>o});var r=n(7294);const a=r.createContext(!1);function o(e){let{children:t}=e;const[n,o]=(0,r.useState)(!1);return(0,r.useEffect)((()=>{o(!0)}),[]),r.createElement(a.Provider,{value:n},t)}},9383:(e,t,n)=>{"use strict";var r=n(7294),a=n(3935),o=n(3727),i=n(405),l=n(412);const s=[n(2497),n(3310),n(8320),n(2295)];var c=n(723),u=n(6775),d=n(8790);function p(e){let{children:t}=e;return r.createElement(r.Fragment,null,t)}var f=n(7462),m=n(5742),g=n(2263),h=n(4996),b=n(6668),v=n(833),y=n(4711),w=n(9727),k=n(3320),S=n(197);function E(){const{i18n:{defaultLocale:e,localeConfigs:t}}=(0,g.Z)(),n=(0,y.l)();return r.createElement(m.Z,null,Object.entries(t).map((e=>{let[t,{htmlLang:a}]=e;return r.createElement("link",{key:t,rel:"alternate",href:n.createUrl({locale:t,fullyQualified:!0}),hrefLang:a})})),r.createElement("link",{rel:"alternate",href:n.createUrl({locale:e,fullyQualified:!0}),hrefLang:"x-default"}))}function x(e){let{permalink:t}=e;const{siteConfig:{url:n}}=(0,g.Z)(),a=function(){const{siteConfig:{url:e}}=(0,g.Z)(),{pathname:t}=(0,u.TH)();return e+(0,h.Z)(t)}(),o=t?`${n}${t}`:a;return r.createElement(m.Z,null,r.createElement("meta",{property:"og:url",content:o}),r.createElement("link",{rel:"canonical",href:o}))}function _(){const{i18n:{currentLocale:e}}=(0,g.Z)(),{metadata:t,image:n}=(0,b.L)();return r.createElement(r.Fragment,null,r.createElement(m.Z,null,r.createElement("meta",{name:"twitter:card",content:"summary_large_image"}),r.createElement("body",{className:w.h})),n&&r.createElement(v.d,{image:n}),r.createElement(x,null),r.createElement(E,null),r.createElement(S.Z,{tag:k.HX,locale:e}),r.createElement(m.Z,null,t.map(((e,t)=>r.createElement("meta",(0,f.Z)({key:t},e))))))}const T=new Map;function C(e){if(T.has(e.pathname))return{...e,pathname:T.get(e.pathname)};if((0,d.f)(c.Z,e.pathname).some((e=>{let{route:t}=e;return!0===t.exact})))return T.set(e.pathname,e.pathname),e;const t=e.pathname.trim().replace(/(?:\/index)?\.html$/,"")||"/";return T.set(e.pathname,t),{...e,pathname:t}}var A=n(8934),L=n(8940);function R(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r{var r;const a=(null==(r=t.default)?void 0:r[e])??t[e];return null==a?void 0:a(...n)}));return()=>a.forEach((e=>null==e?void 0:e()))}const P=function(e){let{children:t,location:n,previousLocation:a}=e;return(0,r.useLayoutEffect)((()=>{a!==n&&(a&&function(e){const{hash:t}=e;if(t){const e=decodeURIComponent(t.substring(1)),n=document.getElementById(e);null==n||n.scrollIntoView()}else window.scrollTo(0,0)}(n),R("onRouteDidUpdate",{previousLocation:a,location:n}))}),[a,n]),t};function O(e){const t=Array.from(new Set([e,decodeURI(e)])).map((e=>(0,d.f)(c.Z,e))).flat();return Promise.all(t.map((e=>null==e.route.component.preload?void 0:e.route.component.preload())))}class N extends r.Component{constructor(e){super(e),this.previousLocation=void 0,this.routeUpdateCleanupCb=void 0,this.previousLocation=null,this.routeUpdateCleanupCb=l.Z.canUseDOM?R("onRouteUpdate",{previousLocation:null,location:this.props.location}):()=>{},this.state={nextRouteHasLoaded:!0}}shouldComponentUpdate(e,t){if(e.location===this.props.location)return t.nextRouteHasLoaded;const n=e.location;return this.previousLocation=this.props.location,this.setState({nextRouteHasLoaded:!1}),this.routeUpdateCleanupCb=R("onRouteUpdate",{previousLocation:this.previousLocation,location:n}),O(n.pathname).then((()=>{this.routeUpdateCleanupCb(),this.setState({nextRouteHasLoaded:!0})})).catch((e=>{console.warn(e),window.location.reload()})),!1}render(){const{children:e,location:t}=this.props;return r.createElement(P,{previousLocation:this.previousLocation,location:t},r.createElement(u.AW,{location:t,render:()=>e}))}}const I=N,D="docusaurus-base-url-issue-banner-container",M="docusaurus-base-url-issue-banner-suggestion-container",j="__DOCUSAURUS_INSERT_BASEURL_BANNER";function F(e){return`\nwindow['${j}'] = true;\n\ndocument.addEventListener('DOMContentLoaded', maybeInsertBanner);\n\nfunction maybeInsertBanner() {\n var shouldInsert = window['${j}'];\n shouldInsert && insertBanner();\n}\n\nfunction insertBanner() {\n var bannerContainer = document.getElementById('${D}');\n if (!bannerContainer) {\n return;\n }\n var bannerHtml = ${JSON.stringify(function(e){return`\n
\n

Your Docusaurus site did not load properly.

\n

A very common reason is a wrong site baseUrl configuration.

\n

Current configured baseUrl = ${e} ${"/"===e?" (default value)":""}

\n

We suggest trying baseUrl =

\n
\n`}(e)).replace(/{window[j]=!1}),[]),r.createElement(r.Fragment,null,!l.Z.canUseDOM&&r.createElement(m.Z,null,r.createElement("script",null,F(e))),r.createElement("div",{id:D}))}function z(){const{siteConfig:{baseUrl:e,baseUrlIssueBanner:t}}=(0,g.Z)(),{pathname:n}=(0,u.TH)();return t&&n===e?r.createElement(B,null):null}function U(){const{siteConfig:{favicon:e,title:t,noIndex:n},i18n:{currentLocale:a,localeConfigs:o}}=(0,g.Z)(),i=(0,h.Z)(e),{htmlLang:l,direction:s}=o[a];return r.createElement(m.Z,null,r.createElement("html",{lang:l,dir:s}),r.createElement("title",null,t),r.createElement("meta",{property:"og:title",content:t}),r.createElement("meta",{name:"viewport",content:"width=device-width, initial-scale=1.0"}),n&&r.createElement("meta",{name:"robots",content:"noindex, nofollow"}),e&&r.createElement("link",{rel:"icon",href:i}))}var $=n(4763);function q(){const e=(0,d.H)(c.Z),t=(0,u.TH)();return r.createElement($.Z,null,r.createElement(L.M,null,r.createElement(A.t,null,r.createElement(p,null,r.createElement(U,null),r.createElement(_,null),r.createElement(z,null),r.createElement(I,{location:C(t)},e)))))}var G=n(6887);const H=function(e){try{return document.createElement("link").relList.supports(e)}catch{return!1}}("prefetch")?function(e){return new Promise(((t,n)=>{var r;if("undefined"==typeof document)return void n();const a=document.createElement("link");a.setAttribute("rel","prefetch"),a.setAttribute("href",e),a.onload=()=>t(),a.onerror=()=>n();const o=document.getElementsByTagName("head")[0]??(null==(r=document.getElementsByName("script")[0])?void 0:r.parentNode);null==o||o.appendChild(a)}))}:function(e){return new Promise(((t,n)=>{const r=new XMLHttpRequest;r.open("GET",e,!0),r.withCredentials=!0,r.onload=()=>{200===r.status?t():n()},r.send(null)}))};var Z=n(9670);const V=new Set,W=new Set,K=()=>{var e,t;return(null==(e=navigator.connection)?void 0:e.effectiveType.includes("2g"))||(null==(t=navigator.connection)?void 0:t.saveData)},Y={prefetch(e){if(!(e=>!K()&&!W.has(e)&&!V.has(e))(e))return!1;V.add(e);const t=(0,d.f)(c.Z,e).flatMap((e=>{return t=e.route.path,Object.entries(G).filter((e=>{let[n]=e;return n.replace(/-[^-]+$/,"")===t})).flatMap((e=>{let[,t]=e;return Object.values((0,Z.Z)(t))}));var t}));return Promise.all(t.map((e=>{const t=n.gca(e);return t&&!t.includes("undefined")?H(t).catch((()=>{})):Promise.resolve()})))},preload:e=>!!(e=>!K()&&!W.has(e))(e)&&(W.add(e),O(e))},Q=Object.freeze(Y);if(l.Z.canUseDOM){window.docusaurus=Q;const e=a.hydrate;O(window.location.pathname).then((()=>{e(r.createElement(i.B6,null,r.createElement(o.VK,null,r.createElement(q,null))),document.getElementById("__docusaurus"))}))}},8940:(e,t,n)=>{"use strict";n.d(t,{_:()=>u,M:()=>d});var r=n(7294),a=n(6809);const o=JSON.parse('{"docusaurus-plugin-content-docs":{"default":{"path":"/docs","versions":[{"name":"current","label":"Next","isLast":true,"path":"/docs","mainDocId":"general/intro","docs":[{"id":"backend/go-by-example/map-racing","path":"/docs/backend/go-by-example/map-racing","sidebar":"backendSidebar"},{"id":"backend/go-by-example/nil-maps","path":"/docs/backend/go-by-example/nil-maps","sidebar":"backendSidebar"},{"id":"backend/go-by-example/panic-and-recover","path":"/docs/backend/go-by-example/panic-and-recover","sidebar":"backendSidebar"},{"id":"backend/go-by-example/ranging","path":"/docs/backend/go-by-example/ranging","sidebar":"backendSidebar"},{"id":"backend/go-by-example/yaml-magic","path":"/docs/backend/go-by-example/yaml-magic","sidebar":"backendSidebar"},{"id":"backend/gocontentful/api-reference","path":"/docs/backend/gocontentful/api-reference","sidebar":"backendSidebar"},{"id":"backend/gocontentful/caching","path":"/docs/backend/gocontentful/caching","sidebar":"backendSidebar"},{"id":"backend/gocontentful/getting-started","path":"/docs/backend/gocontentful/getting-started","sidebar":"backendSidebar"},{"id":"backend/gocontentful/introduction","path":"/docs/backend/gocontentful/introduction","sidebar":"backendSidebar"},{"id":"backend/gocontentful/test-api","path":"/docs/backend/gocontentful/test-api","sidebar":"backendSidebar"},{"id":"backend/gocontentful/working-with-gocontentful-api","path":"/docs/backend/gocontentful/working-with-gocontentful-api","sidebar":"backendSidebar"},{"id":"backend/gograpple","path":"/docs/backend/gograpple","sidebar":"backendSidebar"},{"id":"backend/intro","path":"/docs/backend/intro","sidebar":"backendSidebar"},{"id":"backend/rtfm","path":"/docs/backend/rtfm","sidebar":"backendSidebar"},{"id":"backend/setup","path":"/docs/backend/setup","sidebar":"backendSidebar"},{"id":"devops/bookmarks","path":"/docs/devops/bookmarks","sidebar":"devopsSidebar"},{"id":"devops/intro","path":"/docs/devops/intro","sidebar":"devopsSidebar"},{"id":"devops/k8s","path":"/docs/devops/k8s","sidebar":"devopsSidebar"},{"id":"devops/kubernetes/spot-instance-node-pools","path":"/docs/devops/kubernetes/spot-instance-node-pools","sidebar":"devopsSidebar"},{"id":"devops/monitoring/grafana","path":"/docs/devops/monitoring/grafana","sidebar":"devopsSidebar"},{"id":"devops/monitoring/intro","path":"/docs/devops/monitoring/intro","sidebar":"devopsSidebar"},{"id":"devops/monitoring/jaeger","path":"/docs/devops/monitoring/jaeger","sidebar":"devopsSidebar"},{"id":"frontend/css","path":"/docs/frontend/css","sidebar":"frontendSidebar"},{"id":"frontend/debugging_js","path":"/docs/frontend/debugging_js","sidebar":"frontendSidebar"},{"id":"frontend/intro","path":"/docs/frontend/intro","sidebar":"frontendSidebar"},{"id":"frontend/performance","path":"/docs/frontend/performance","sidebar":"frontendSidebar"},{"id":"frontend/pitfalls","path":"/docs/frontend/pitfalls","sidebar":"frontendSidebar"},{"id":"frontend/rtfm","path":"/docs/frontend/rtfm","sidebar":"frontendSidebar"},{"id":"frontend/setup","path":"/docs/frontend/setup","sidebar":"frontendSidebar"},{"id":"frontend/stack","path":"/docs/frontend/stack","sidebar":"frontendSidebar"},{"id":"frontend/typescript/objects","path":"/docs/frontend/typescript/objects","sidebar":"frontendSidebar"},{"id":"frontend/typescript/spreading","path":"/docs/frontend/typescript/spreading","sidebar":"frontendSidebar"},{"id":"frontend/vscode","path":"/docs/frontend/vscode","sidebar":"frontendSidebar"},{"id":"general/essentials","path":"/docs/general/essentials","sidebar":"generalSidebar"},{"id":"general/intro","path":"/docs/general/intro","sidebar":"generalSidebar"},{"id":"general/package-managers","path":"/docs/general/package-managers","sidebar":"generalSidebar"},{"id":"general/security","path":"/docs/general/security","sidebar":"generalSidebar"},{"id":"general/setup/computer","path":"/docs/general/setup/computer","sidebar":"generalSidebar"},{"id":"general/setup/workplace","path":"/docs/general/setup/workplace","sidebar":"generalSidebar"},{"id":"general/technologies/SSE","path":"/docs/general/technologies/sse","sidebar":"generalSidebar"},{"id":"general/utilities/k9s","path":"/docs/general/utilities/k9s","sidebar":"generalSidebar"},{"id":"general/work/general","path":"/docs/general/work/general","sidebar":"generalSidebar"},{"id":"general/work/remote-work","path":"/docs/general/work/remote-work","sidebar":"generalSidebar"},{"id":"project-management/intro","path":"/docs/project-management/intro","sidebar":"pmSidebar"},{"id":"project-management/responsibility","path":"/docs/project-management/responsibility","sidebar":"pmSidebar"},{"id":"projects/architecture","path":"/docs/projects/architecture","sidebar":"projectsSidebar"},{"id":"projects/cms/contentful","path":"/docs/projects/cms/contentful","sidebar":"projectsSidebar"},{"id":"projects/cms/contentserver","path":"/docs/projects/cms/contentserver","sidebar":"projectsSidebar"},{"id":"projects/cms/intro","path":"/docs/projects/cms/intro","sidebar":"projectsSidebar"},{"id":"projects/gotsrpc","path":"/docs/projects/gotsrpc","sidebar":"projectsSidebar"},{"id":"projects/intro","path":"/docs/projects/intro","sidebar":"projectsSidebar"},{"id":"projects/libraries/keel","path":"/docs/projects/libraries/keel","sidebar":"projectsSidebar"},{"id":"projects/pagespeed-exporter","path":"/docs/projects/pagespeed-exporter","sidebar":"projectsSidebar"},{"id":"projects/site-reliability/site-reliability","path":"/docs/projects/site-reliability/","sidebar":"projectsSidebar"},{"id":"projects/utilities/gograpple","path":"/docs/projects/utilities/gograpple","sidebar":"projectsSidebar"},{"id":"projects/webgrapple","path":"/docs/projects/webgrapple","sidebar":"projectsSidebar"}],"draftIds":[],"sidebars":{"generalSidebar":{"link":{"path":"/docs/general/intro","label":"Intro"}},"pmSidebar":{"link":{"path":"/docs/project-management/intro","label":"project-management/intro"}},"backendSidebar":{"link":{"path":"/docs/backend/intro","label":"Intro"}},"frontendSidebar":{"link":{"path":"/docs/frontend/intro","label":"Intro"}},"devopsSidebar":{"link":{"path":"/docs/devops/intro","label":"Intro"}},"projectsSidebar":{"link":{"path":"/docs/projects/intro","label":"Intro"}}}}],"breadcrumbs":true}}}'),i=JSON.parse('{"defaultLocale":"en","locales":["en"],"path":"i18n","currentLocale":"en","localeConfigs":{"en":{"label":"English","direction":"ltr","htmlLang":"en","calendar":"gregory","path":"en"}}}');var l=n(7529);const s=JSON.parse('{"docusaurusVersion":"2.1.0","siteVersion":"0.0.0","pluginVersions":{"docusaurus-plugin-content-docs":{"type":"package","name":"@docusaurus/plugin-content-docs","version":"2.1.0"},"docusaurus-plugin-content-blog":{"type":"package","name":"@docusaurus/plugin-content-blog","version":"2.1.0"},"docusaurus-plugin-content-pages":{"type":"package","name":"@docusaurus/plugin-content-pages","version":"2.1.0"},"docusaurus-plugin-sitemap":{"type":"package","name":"@docusaurus/plugin-sitemap","version":"2.1.0"},"docusaurus-theme-classic":{"type":"package","name":"@docusaurus/theme-classic","version":"2.1.0"},"docusaurus-theme-search-algolia":{"type":"package","name":"@docusaurus/theme-search-algolia","version":"2.1.0"},"docusaurus-theme-live-codeblock":{"type":"package","name":"@docusaurus/theme-live-codeblock","version":"2.1.0"},"docusaurus-theme-github-codeblock":{"type":"package","name":"@saucelabs/theme-github-codeblock","version":"0.1.1"}}}'),c={siteConfig:a.default,siteMetadata:s,globalData:o,i18n:i,codeTranslations:l},u=r.createContext(c);function d(e){let{children:t}=e;return r.createElement(u.Provider,{value:c},t)}},4763:(e,t,n)=>{"use strict";n.d(t,{Z:()=>u});var r=n(7294),a=n(412),o=n(5742),i=n(7767);function l(e){let{error:t,tryAgain:n}=e;return r.createElement("div",{style:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",height:"50vh",width:"100%",fontSize:"20px"}},r.createElement("h1",null,"This page crashed."),r.createElement("p",null,t.message),r.createElement("button",{type:"button",onClick:n},"Try again"))}function s(e){let{error:t,tryAgain:n}=e;return r.createElement(u,{fallback:()=>r.createElement(l,{error:t,tryAgain:n})},r.createElement(o.Z,null,r.createElement("title",null,"Page Error")),r.createElement(i.Z,null,r.createElement(l,{error:t,tryAgain:n})))}const c=e=>r.createElement(s,e);class u extends r.Component{constructor(e){super(e),this.state={error:null}}componentDidCatch(e){a.Z.canUseDOM&&this.setState({error:e})}render(){const{children:e}=this.props,{error:t}=this.state;if(t){const e={error:t,tryAgain:()=>this.setState({error:null})};return(this.props.fallback??c)(e)}return e??null}}},412:(e,t,n)=>{"use strict";n.d(t,{Z:()=>a});const r="undefined"!=typeof window&&"document"in window&&"createElement"in window.document,a={canUseDOM:r,canUseEventListeners:r&&("addEventListener"in window||"attachEvent"in window),canUseIntersectionObserver:r&&"IntersectionObserver"in window,canUseViewport:r&&"screen"in window}},5742:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(7294),a=n(405);function o(e){return r.createElement(a.ql,e)}},9960:(e,t,n)=>{"use strict";n.d(t,{Z:()=>f});var r=n(7462),a=n(7294),o=n(3727),i=n(8780),l=n(2263),s=n(3919),c=n(412);const u=a.createContext({collectLink:()=>{}});var d=n(4996);function p(e,t){var n;let{isNavLink:p,to:f,href:m,activeClassName:g,isActive:h,"data-noBrokenLinkCheck":b,autoAddBaseUrl:v=!0,...y}=e;const{siteConfig:{trailingSlash:w,baseUrl:k}}=(0,l.Z)(),{withBaseUrl:S}=(0,d.C)(),E=(0,a.useContext)(u),x=(0,a.useRef)(null);(0,a.useImperativeHandle)(t,(()=>x.current));const _=f||m;const T=(0,s.Z)(_),C=null==_?void 0:_.replace("pathname://","");let A=void 0!==C?(L=C,v&&(e=>e.startsWith("/"))(L)?S(L):L):void 0;var L;A&&T&&(A=(0,i.applyTrailingSlash)(A,{trailingSlash:w,baseUrl:k}));const R=(0,a.useRef)(!1),P=p?o.OL:o.rU,O=c.Z.canUseIntersectionObserver,N=(0,a.useRef)();(0,a.useEffect)((()=>(!O&&T&&null!=A&&window.docusaurus.prefetch(A),()=>{O&&N.current&&N.current.disconnect()})),[N,A,O,T]);const I=(null==(n=A)?void 0:n.startsWith("#"))??!1,D=!A||!T||I;return D||b||E.collectLink(A),D?a.createElement("a",(0,r.Z)({ref:x,href:A},_&&!T&&{target:"_blank",rel:"noopener noreferrer"},y)):a.createElement(P,(0,r.Z)({},y,{onMouseEnter:()=>{R.current||null==A||(window.docusaurus.preload(A),R.current=!0)},innerRef:e=>{x.current=e,O&&e&&T&&(N.current=new window.IntersectionObserver((t=>{t.forEach((t=>{e===t.target&&(t.isIntersecting||t.intersectionRatio>0)&&(N.current.unobserve(e),N.current.disconnect(),null!=A&&window.docusaurus.prefetch(A))}))})),N.current.observe(e))},to:A},p&&{isActive:h,activeClassName:g}))}const f=a.forwardRef(p)},5999:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s,I:()=>l});var r=n(7294);function a(e,t){const n=e.split(/(\{\w+\})/).map(((e,n)=>{if(n%2==1){const n=null==t?void 0:t[e.slice(1,-1)];if(void 0!==n)return n}return e}));return n.some((e=>(0,r.isValidElement)(e)))?n.map(((e,t)=>(0,r.isValidElement)(e)?r.cloneElement(e,{key:t}):e)).filter((e=>""!==e)):n.join("")}var o=n(7529);function i(e){let{id:t,message:n}=e;if(void 0===t&&void 0===n)throw new Error("Docusaurus translation declarations must have at least a translation id or a default translation message");return o[t??n]??n??t}function l(e,t){let{message:n,id:r}=e;return a(i({message:n,id:r}),t)}function s(e){let{children:t,id:n,values:o}=e;if(t&&"string"!=typeof t)throw console.warn("Illegal children",t),new Error("The Docusaurus component only accept simple string values");const l=i({message:t,id:n});return r.createElement(r.Fragment,null,a(l,o))}},9935:(e,t,n)=>{"use strict";n.d(t,{m:()=>r});const r="default"},3919:(e,t,n)=>{"use strict";function r(e){return/^(?:\w*:|\/\/)/.test(e)}function a(e){return void 0!==e&&!r(e)}n.d(t,{Z:()=>a,b:()=>r})},4996:(e,t,n)=>{"use strict";n.d(t,{C:()=>o,Z:()=>i});var r=n(2263),a=n(3919);function o(){const{siteConfig:{baseUrl:e,url:t}}=(0,r.Z)();return{withBaseUrl:(n,r)=>function(e,t,n,r){let{forcePrependBaseUrl:o=!1,absolute:i=!1}=void 0===r?{}:r;if(!n||n.startsWith("#")||(0,a.b)(n))return n;if(o)return t+n.replace(/^\//,"");if(n===t.replace(/\/$/,""))return t;const l=n.startsWith(t)?n:t+n.replace(/^\//,"");return i?e+l:l}(t,e,n,r)}}function i(e,t){void 0===t&&(t={});const{withBaseUrl:n}=o();return n(e,t)}},2263:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(7294),a=n(8940);function o(){return(0,r.useContext)(a._)}},2389:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(7294),a=n(8934);function o(){return(0,r.useContext)(a._)}},9670:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});function r(e){const t={};return function e(n,r){Object.entries(n).forEach((n=>{let[a,o]=n;const i=r?`${r}.${a}`:a;var l;"object"==typeof(l=o)&&l&&Object.keys(l).length>0?e(o,i):t[i]=o}))}(e),t}},226:(e,t,n)=>{"use strict";n.d(t,{_:()=>a,z:()=>o});var r=n(7294);const a=r.createContext(null);function o(e){let{children:t,value:n}=e;const o=r.useContext(a),i=(0,r.useMemo)((()=>function(e){let{parent:t,value:n}=e;if(!t){if(!n)throw new Error("Unexpected: no Docusaurus route context found");if(!("plugin"in n))throw new Error("Unexpected: Docusaurus topmost route context has no `plugin` attribute");return n}const r={...t.data,...null==n?void 0:n.data};return{plugin:t.plugin,data:r}}({parent:o,value:n})),[o,n]);return r.createElement(a.Provider,{value:i},t)}},143:(e,t,n)=>{"use strict";n.d(t,{Iw:()=>b,gA:()=>f,WS:()=>m,_r:()=>d,Jo:()=>v,zh:()=>p,yW:()=>h,gB:()=>g});var r=n(6775),a=n(2263),o=n(9935);function i(e,t){void 0===t&&(t={});const n=function(){const{globalData:e}=(0,a.Z)();return e}()[e];if(!n&&t.failfast)throw new Error(`Docusaurus plugin global data not found for "${e}" plugin.`);return n}const l=e=>e.versions.find((e=>e.isLast));function s(e,t){const n=l(e);return[...e.versions.filter((e=>e!==n)),n].find((e=>!!(0,r.LX)(t,{path:e.path,exact:!1,strict:!1})))}function c(e,t){const n=s(e,t),a=null==n?void 0:n.docs.find((e=>!!(0,r.LX)(t,{path:e.path,exact:!0,strict:!1})));return{activeVersion:n,activeDoc:a,alternateDocVersions:a?function(t){const n={};return e.versions.forEach((e=>{e.docs.forEach((r=>{r.id===t&&(n[e.name]=r)}))})),n}(a.id):{}}}const u={},d=()=>i("docusaurus-plugin-content-docs")??u,p=e=>function(e,t,n){void 0===t&&(t=o.m),void 0===n&&(n={});const r=i(e),a=null==r?void 0:r[t];if(!a&&n.failfast)throw new Error(`Docusaurus plugin global data not found for "${e}" plugin with id "${t}".`);return a}("docusaurus-plugin-content-docs",e,{failfast:!0});function f(e){void 0===e&&(e={});const t=d(),{pathname:n}=(0,r.TH)();return function(e,t,n){void 0===n&&(n={});const a=Object.entries(e).sort(((e,t)=>t[1].path.localeCompare(e[1].path))).find((e=>{let[,n]=e;return!!(0,r.LX)(t,{path:n.path,exact:!1,strict:!1})})),o=a?{pluginId:a[0],pluginData:a[1]}:void 0;if(!o&&n.failfast)throw new Error(`Can't find active docs plugin for "${t}" pathname, while it was expected to be found. Maybe you tried to use a docs feature that can only be used on a docs-related page? Existing docs plugin paths are: ${Object.values(e).map((e=>e.path)).join(", ")}`);return o}(t,n,e)}function m(e){void 0===e&&(e={});const t=f(e),{pathname:n}=(0,r.TH)();if(!t)return;return{activePlugin:t,activeVersion:s(t.pluginData,n)}}function g(e){return p(e).versions}function h(e){const t=p(e);return l(t)}function b(e){const t=p(e),{pathname:n}=(0,r.TH)();return c(t,n)}function v(e){const t=p(e),{pathname:n}=(0,r.TH)();return function(e,t){const n=l(e);return{latestDocSuggestion:c(e,t).alternateDocVersions[n.name],latestVersionSuggestion:n}}(t,n)}},8320:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>o});var r=n(4865),a=n.n(r);a().configure({showSpinner:!1});const o={onRouteUpdate(e){let{location:t,previousLocation:n}=e;if(n&&t.pathname!==n.pathname){const e=window.setTimeout((()=>{a().start()}),200);return()=>window.clearTimeout(e)}},onRouteDidUpdate(){a().done()}}},3310:(e,t,n)=>{"use strict";n.r(t);var r=n(7410),a=n(6809);!function(e){const{themeConfig:{prism:t}}=a.default,{additionalLanguages:r}=t;globalThis.Prism=e,r.forEach((e=>{n(6726)(`./prism-${e}`)})),delete globalThis.Prism}(r.Z)},9471:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(7294);const a="iconExternalLink_nPIU";function o(e){let{width:t=13.5,height:n=13.5}=e;return r.createElement("svg",{width:t,height:n,"aria-hidden":"true",viewBox:"0 0 24 24",className:a},r.createElement("path",{fill:"currentColor",d:"M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"}))}},7767:(e,t,n)=>{"use strict";n.d(t,{Z:()=>_t});var r=n(7294),a=n(6010),o=n(4763),i=n(833),l=n(5281),s=n(9727),c=n(5999),u=n(6775),d=n(5936);function p(e){e.setAttribute("tabindex","-1"),e.focus(),e.removeAttribute("tabindex")}const f="skipToContent_fXgn";function m(){const{containerRef:e,handleSkip:t}=function(){const e=(0,r.useRef)(null),{action:t}=(0,u.k6)(),n=(0,r.useCallback)((e=>{e.preventDefault();const t=document.querySelector("main:first-of-type")??document.querySelector(`.${l.k.wrapper.main}`);t&&p(t)}),[]);return(0,d.S)((n=>{let{location:r}=n;e.current&&!r.hash&&"PUSH"===t&&p(e.current)})),{containerRef:e,handleSkip:n}}();return r.createElement("div",{ref:e,role:"region","aria-label":(0,c.I)({id:"theme.common.skipToMainContent"})},r.createElement("a",{href:"#",className:f,onClick:t},r.createElement(c.Z,{id:"theme.common.skipToMainContent",description:"The skip to content label used for accessibility, allowing to rapidly navigate to main content with keyboard tab/enter navigation"},"Skip to main content")))}var g=n(6668),h=n(9689),b=n(7462);function v(e){let{width:t=21,height:n=21,color:a="currentColor",strokeWidth:o=1.2,className:i,...l}=e;return r.createElement("svg",(0,b.Z)({viewBox:"0 0 15 15",width:t,height:n},l),r.createElement("g",{stroke:a,strokeWidth:o},r.createElement("path",{d:"M.75.75l13.5 13.5M14.25.75L.75 14.25"})))}const y="closeButton_CVFx";function w(e){return r.createElement("button",(0,b.Z)({type:"button","aria-label":(0,c.I)({id:"theme.AnnouncementBar.closeButtonAriaLabel",message:"Close",description:"The ARIA label for close button of announcement bar"})},e,{className:(0,a.Z)("clean-btn close",y,e.className)}),r.createElement(v,{width:14,height:14,strokeWidth:3.1}))}const k="content_knG7";function S(e){const{announcementBar:t}=(0,g.L)(),{content:n}=t;return r.createElement("div",(0,b.Z)({},e,{className:(0,a.Z)(k,e.className),dangerouslySetInnerHTML:{__html:n}}))}const E="announcementBar_mb4j",x="announcementBarPlaceholder_vyr4",_="announcementBarClose_gvF7",T="announcementBarContent_xLdY";function C(){const{announcementBar:e}=(0,g.L)(),{isActive:t,close:n}=(0,h.nT)();if(!t)return null;const{backgroundColor:a,textColor:o,isCloseable:i}=e;return r.createElement("div",{className:E,style:{backgroundColor:a,color:o},role:"banner"},i&&r.createElement("div",{className:x}),r.createElement(S,{className:T}),i&&r.createElement(w,{onClick:n,className:_}))}var A=n(2961),L=n(2466);var R=n(902),P=n(3102);const O=r.createContext(null);function N(e){let{children:t}=e;const n=function(){const e=(0,A.e)(),t=(0,P.HY)(),[n,a]=(0,r.useState)(!1),o=null!==t.component,i=(0,R.D9)(o);return(0,r.useEffect)((()=>{o&&!i&&a(!0)}),[o,i]),(0,r.useEffect)((()=>{o?e.shown||a(!0):a(!1)}),[e.shown,o]),(0,r.useMemo)((()=>[n,a]),[n])}();return r.createElement(O.Provider,{value:n},t)}function I(e){if(e.component){const t=e.component;return r.createElement(t,e.props)}}function D(){const e=(0,r.useContext)(O);if(!e)throw new R.i6("NavbarSecondaryMenuDisplayProvider");const[t,n]=e,a=(0,r.useCallback)((()=>n(!1)),[n]),o=(0,P.HY)();return(0,r.useMemo)((()=>({shown:t,hide:a,content:I(o)})),[a,o,t])}function M(e){let{header:t,primaryMenu:n,secondaryMenu:o}=e;const{shown:i}=D();return r.createElement("div",{className:"navbar-sidebar"},t,r.createElement("div",{className:(0,a.Z)("navbar-sidebar__items",{"navbar-sidebar__items--show-secondary":i})},r.createElement("div",{className:"navbar-sidebar__item menu"},n),r.createElement("div",{className:"navbar-sidebar__item menu"},o)))}var j=n(2949),F=n(2389);function B(e){return r.createElement("svg",(0,b.Z)({viewBox:"0 0 24 24",width:24,height:24},e),r.createElement("path",{fill:"currentColor",d:"M12,9c1.65,0,3,1.35,3,3s-1.35,3-3,3s-3-1.35-3-3S10.35,9,12,9 M12,7c-2.76,0-5,2.24-5,5s2.24,5,5,5s5-2.24,5-5 S14.76,7,12,7L12,7z M2,13l2,0c0.55,0,1-0.45,1-1s-0.45-1-1-1l-2,0c-0.55,0-1,0.45-1,1S1.45,13,2,13z M20,13l2,0c0.55,0,1-0.45,1-1 s-0.45-1-1-1l-2,0c-0.55,0-1,0.45-1,1S19.45,13,20,13z M11,2v2c0,0.55,0.45,1,1,1s1-0.45,1-1V2c0-0.55-0.45-1-1-1S11,1.45,11,2z M11,20v2c0,0.55,0.45,1,1,1s1-0.45,1-1v-2c0-0.55-0.45-1-1-1C11.45,19,11,19.45,11,20z M5.99,4.58c-0.39-0.39-1.03-0.39-1.41,0 c-0.39,0.39-0.39,1.03,0,1.41l1.06,1.06c0.39,0.39,1.03,0.39,1.41,0s0.39-1.03,0-1.41L5.99,4.58z M18.36,16.95 c-0.39-0.39-1.03-0.39-1.41,0c-0.39,0.39-0.39,1.03,0,1.41l1.06,1.06c0.39,0.39,1.03,0.39,1.41,0c0.39-0.39,0.39-1.03,0-1.41 L18.36,16.95z M19.42,5.99c0.39-0.39,0.39-1.03,0-1.41c-0.39-0.39-1.03-0.39-1.41,0l-1.06,1.06c-0.39,0.39-0.39,1.03,0,1.41 s1.03,0.39,1.41,0L19.42,5.99z M7.05,18.36c0.39-0.39,0.39-1.03,0-1.41c-0.39-0.39-1.03-0.39-1.41,0l-1.06,1.06 c-0.39,0.39-0.39,1.03,0,1.41s1.03,0.39,1.41,0L7.05,18.36z"}))}function z(e){return r.createElement("svg",(0,b.Z)({viewBox:"0 0 24 24",width:24,height:24},e),r.createElement("path",{fill:"currentColor",d:"M9.37,5.51C9.19,6.15,9.1,6.82,9.1,7.5c0,4.08,3.32,7.4,7.4,7.4c0.68,0,1.35-0.09,1.99-0.27C17.45,17.19,14.93,19,12,19 c-3.86,0-7-3.14-7-7C5,9.07,6.81,6.55,9.37,5.51z M12,3c-4.97,0-9,4.03-9,9s4.03,9,9,9s9-4.03,9-9c0-0.46-0.04-0.92-0.1-1.36 c-0.98,1.37-2.58,2.26-4.4,2.26c-2.98,0-5.4-2.42-5.4-5.4c0-1.81,0.89-3.42,2.26-4.4C12.92,3.04,12.46,3,12,3L12,3z"}))}const U={toggle:"toggle_vylO",toggleButton:"toggleButton_gllP",darkToggleIcon:"darkToggleIcon_wfgR",lightToggleIcon:"lightToggleIcon_pyhR",toggleButtonDisabled:"toggleButtonDisabled_aARS"};function $(e){let{className:t,value:n,onChange:o}=e;const i=(0,F.Z)(),l=(0,c.I)({message:"Switch between dark and light mode (currently {mode})",id:"theme.colorToggle.ariaLabel",description:"The ARIA label for the navbar color mode toggle"},{mode:"dark"===n?(0,c.I)({message:"dark mode",id:"theme.colorToggle.ariaLabel.mode.dark",description:"The name for the dark color mode"}):(0,c.I)({message:"light mode",id:"theme.colorToggle.ariaLabel.mode.light",description:"The name for the light color mode"})});return r.createElement("div",{className:(0,a.Z)(U.toggle,t)},r.createElement("button",{className:(0,a.Z)("clean-btn",U.toggleButton,!i&&U.toggleButtonDisabled),type:"button",onClick:()=>o("dark"===n?"light":"dark"),disabled:!i,title:l,"aria-label":l},r.createElement(B,{className:(0,a.Z)(U.toggleIcon,U.lightToggleIcon)}),r.createElement(z,{className:(0,a.Z)(U.toggleIcon,U.darkToggleIcon)})))}const q=r.memo($);function G(e){let{className:t}=e;const n=(0,g.L)().colorMode.disableSwitch,{colorMode:a,setColorMode:o}=(0,j.I)();return n?null:r.createElement(q,{className:t,value:a,onChange:o})}var H=n(1327);function Z(){return r.createElement(H.Z,{className:"navbar__brand",imageClassName:"navbar__logo",titleClassName:"navbar__title text--truncate"})}function V(){const e=(0,A.e)();return r.createElement("button",{type:"button",className:"clean-btn navbar-sidebar__close",onClick:()=>e.toggle()},r.createElement(v,{color:"var(--ifm-color-emphasis-600)"}))}function W(){return r.createElement("div",{className:"navbar-sidebar__brand"},r.createElement(Z,null),r.createElement(G,{className:"margin-right--md"}),r.createElement(V,null))}var K=n(9960),Y=n(4996),Q=n(3919),X=n(8022),J=n(9471);function ee(e){let{activeBasePath:t,activeBaseRegex:n,to:a,href:o,label:i,html:l,isDropdownLink:s,prependBaseUrlToHref:c,...u}=e;const d=(0,Y.Z)(a),p=(0,Y.Z)(t),f=(0,Y.Z)(o,{forcePrependBaseUrl:!0}),m=i&&o&&!(0,Q.Z)(o),g=l?{dangerouslySetInnerHTML:{__html:l}}:{children:r.createElement(r.Fragment,null,i,m&&r.createElement(J.Z,s&&{width:12,height:12}))};return o?r.createElement(K.Z,(0,b.Z)({href:c?f:o},u,g)):r.createElement(K.Z,(0,b.Z)({to:d,isNavLink:!0},(t||n)&&{isActive:(e,t)=>n?(0,X.F)(n,t.pathname):t.pathname.startsWith(p)},u,g))}function te(e){let{className:t,isDropdownItem:n=!1,...o}=e;const i=r.createElement(ee,(0,b.Z)({className:(0,a.Z)(n?"dropdown__link":"navbar__item navbar__link",t),isDropdownLink:n},o));return n?r.createElement("li",null,i):i}function ne(e){let{className:t,isDropdownItem:n,...o}=e;return r.createElement("li",{className:"menu__list-item"},r.createElement(ee,(0,b.Z)({className:(0,a.Z)("menu__link",t)},o)))}function re(e){let{mobile:t=!1,position:n,...a}=e;const o=t?ne:te;return r.createElement(o,(0,b.Z)({},a,{activeClassName:a.activeClassName??(t?"menu__link--active":"navbar__link--active")}))}var ae=n(6043),oe=n(8596),ie=n(2263);function le(e,t){return e.some((e=>function(e,t){return!!(0,oe.Mg)(e.to,t)||!!(0,X.F)(e.activeBaseRegex,t)||!(!e.activeBasePath||!t.startsWith(e.activeBasePath))}(e,t)))}function se(e){let{items:t,position:n,className:o,onClick:i,...l}=e;const s=(0,r.useRef)(null),[c,u]=(0,r.useState)(!1);return(0,r.useEffect)((()=>{const e=e=>{s.current&&!s.current.contains(e.target)&&u(!1)};return document.addEventListener("mousedown",e),document.addEventListener("touchstart",e),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("touchstart",e)}}),[s]),r.createElement("div",{ref:s,className:(0,a.Z)("navbar__item","dropdown","dropdown--hoverable",{"dropdown--right":"right"===n,"dropdown--show":c})},r.createElement(ee,(0,b.Z)({"aria-haspopup":"true","aria-expanded":c,role:"button",href:l.to?void 0:"#",className:(0,a.Z)("navbar__link",o)},l,{onClick:l.to?void 0:e=>e.preventDefault(),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),u(!c))}}),l.children??l.label),r.createElement("ul",{className:"dropdown__menu"},t.map(((e,n)=>r.createElement(ze,(0,b.Z)({isDropdownItem:!0,onKeyDown:e=>{if(n===t.length-1&&"Tab"===e.key){e.preventDefault(),u(!1);const t=s.current.nextElementSibling;if(t){(t instanceof HTMLAnchorElement?t:t.querySelector("a")).focus()}}},activeClassName:"dropdown__link--active"},e,{key:n}))))))}function ce(e){let{items:t,className:n,position:o,onClick:i,...l}=e;const s=function(){const{siteConfig:{baseUrl:e}}=(0,ie.Z)(),{pathname:t}=(0,u.TH)();return t.replace(e,"/")}(),c=le(t,s),{collapsed:d,toggleCollapsed:p,setCollapsed:f}=(0,ae.u)({initialState:()=>!c});return(0,r.useEffect)((()=>{c&&f(!c)}),[s,c,f]),r.createElement("li",{className:(0,a.Z)("menu__list-item",{"menu__list-item--collapsed":d})},r.createElement(ee,(0,b.Z)({role:"button",className:(0,a.Z)("menu__link menu__link--sublist menu__link--sublist-caret",n)},l,{onClick:e=>{e.preventDefault(),p()}}),l.children??l.label),r.createElement(ae.z,{lazy:!0,as:"ul",className:"menu__list",collapsed:d},t.map(((e,t)=>r.createElement(ze,(0,b.Z)({mobile:!0,isDropdownItem:!0,onClick:i,activeClassName:"menu__link--active"},e,{key:t}))))))}function ue(e){let{mobile:t=!1,...n}=e;const a=t?ce:se;return r.createElement(a,n)}var de=n(4711);function pe(e){let{width:t=20,height:n=20,...a}=e;return r.createElement("svg",(0,b.Z)({viewBox:"0 0 24 24",width:t,height:n,"aria-hidden":!0},a),r.createElement("path",{fill:"currentColor",d:"M12.87 15.07l-2.54-2.51.03-.03c1.74-1.94 2.98-4.17 3.71-6.53H17V4h-7V2H8v2H1v1.99h11.17C11.5 7.92 10.44 9.75 9 11.35 8.07 10.32 7.3 9.19 6.69 8h-2c.73 1.63 1.73 3.17 2.98 4.56l-5.09 5.02L4 19l5-5 3.11 3.11.76-2.04zM18.5 10h-2L12 22h2l1.12-3h4.75L21 22h2l-4.5-12zm-2.62 7l1.62-4.33L19.12 17h-3.24z"}))}const fe="iconLanguage_nlXk";var me=n(3935),ge=n(5742),he=n(6177);function be(){return r.createElement("svg",{width:"15",height:"15",className:"DocSearch-Control-Key-Icon"},r.createElement("path",{d:"M4.505 4.496h2M5.505 5.496v5M8.216 4.496l.055 5.993M10 7.5c.333.333.5.667.5 1v2M12.326 4.5v5.996M8.384 4.496c1.674 0 2.116 0 2.116 1.5s-.442 1.5-2.116 1.5M3.205 9.303c-.09.448-.277 1.21-1.241 1.203C1 10.5.5 9.513.5 8V7c0-1.57.5-2.5 1.464-2.494.964.006 1.134.598 1.24 1.342M12.553 10.5h1.953",strokeWidth:"1.2",stroke:"currentColor",fill:"none",strokeLinecap:"square"}))}var ve=n(830),ye=["translations"];function we(){return we=Object.assign||function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var xe="Ctrl";var _e=r.forwardRef((function(e,t){var n=e.translations,a=void 0===n?{}:n,o=Ee(e,ye),i=a.buttonText,l=void 0===i?"Search":i,s=a.buttonAriaLabel,c=void 0===s?"Search":s,u=ke((0,r.useState)(null),2),d=u[0],p=u[1];return(0,r.useEffect)((function(){"undefined"!=typeof navigator&&(/(Mac|iPhone|iPod|iPad)/i.test(navigator.platform)?p("\u2318"):p(xe))}),[]),r.createElement("button",we({type:"button",className:"DocSearch DocSearch-Button","aria-label":c},o,{ref:t}),r.createElement("span",{className:"DocSearch-Button-Container"},r.createElement(ve.W,null),r.createElement("span",{className:"DocSearch-Button-Placeholder"},l)),r.createElement("span",{className:"DocSearch-Button-Keys"},null!==d&&r.createElement(r.Fragment,null,r.createElement("kbd",{className:"DocSearch-Button-Key"},d===xe?r.createElement(be,null):d),r.createElement("kbd",{className:"DocSearch-Button-Key"},"K"))))})),Te=n(3320);const Ce={button:{buttonText:(0,c.I)({id:"theme.SearchBar.label",message:"Search",description:"The ARIA label and placeholder for search button"}),buttonAriaLabel:(0,c.I)({id:"theme.SearchBar.label",message:"Search",description:"The ARIA label and placeholder for search button"})},modal:{searchBox:{resetButtonTitle:(0,c.I)({id:"theme.SearchModal.searchBox.resetButtonTitle",message:"Clear the query",description:"The label and ARIA label for search box reset button"}),resetButtonAriaLabel:(0,c.I)({id:"theme.SearchModal.searchBox.resetButtonTitle",message:"Clear the query",description:"The label and ARIA label for search box reset button"}),cancelButtonText:(0,c.I)({id:"theme.SearchModal.searchBox.cancelButtonText",message:"Cancel",description:"The label and ARIA label for search box cancel button"}),cancelButtonAriaLabel:(0,c.I)({id:"theme.SearchModal.searchBox.cancelButtonText",message:"Cancel",description:"The label and ARIA label for search box cancel button"})},startScreen:{recentSearchesTitle:(0,c.I)({id:"theme.SearchModal.startScreen.recentSearchesTitle",message:"Recent",description:"The title for recent searches"}),noRecentSearchesText:(0,c.I)({id:"theme.SearchModal.startScreen.noRecentSearchesText",message:"No recent searches",description:"The text when no recent searches"}),saveRecentSearchButtonTitle:(0,c.I)({id:"theme.SearchModal.startScreen.saveRecentSearchButtonTitle",message:"Save this search",description:"The label for save recent search button"}),removeRecentSearchButtonTitle:(0,c.I)({id:"theme.SearchModal.startScreen.removeRecentSearchButtonTitle",message:"Remove this search from history",description:"The label for remove recent search button"}),favoriteSearchesTitle:(0,c.I)({id:"theme.SearchModal.startScreen.favoriteSearchesTitle",message:"Favorite",description:"The title for favorite searches"}),removeFavoriteSearchButtonTitle:(0,c.I)({id:"theme.SearchModal.startScreen.removeFavoriteSearchButtonTitle",message:"Remove this search from favorites",description:"The label for remove favorite search button"})},errorScreen:{titleText:(0,c.I)({id:"theme.SearchModal.errorScreen.titleText",message:"Unable to fetch results",description:"The title for error screen of search modal"}),helpText:(0,c.I)({id:"theme.SearchModal.errorScreen.helpText",message:"You might want to check your network connection.",description:"The help text for error screen of search modal"})},footer:{selectText:(0,c.I)({id:"theme.SearchModal.footer.selectText",message:"to select",description:"The explanatory text of the action for the enter key"}),selectKeyAriaLabel:(0,c.I)({id:"theme.SearchModal.footer.selectKeyAriaLabel",message:"Enter key",description:"The ARIA label for the Enter key button that makes the selection"}),navigateText:(0,c.I)({id:"theme.SearchModal.footer.navigateText",message:"to navigate",description:"The explanatory text of the action for the Arrow up and Arrow down key"}),navigateUpKeyAriaLabel:(0,c.I)({id:"theme.SearchModal.footer.navigateUpKeyAriaLabel",message:"Arrow up",description:"The ARIA label for the Arrow up key button that makes the navigation"}),navigateDownKeyAriaLabel:(0,c.I)({id:"theme.SearchModal.footer.navigateDownKeyAriaLabel",message:"Arrow down",description:"The ARIA label for the Arrow down key button that makes the navigation"}),closeText:(0,c.I)({id:"theme.SearchModal.footer.closeText",message:"to close",description:"The explanatory text of the action for Escape key"}),closeKeyAriaLabel:(0,c.I)({id:"theme.SearchModal.footer.closeKeyAriaLabel",message:"Escape key",description:"The ARIA label for the Escape key button that close the modal"}),searchByText:(0,c.I)({id:"theme.SearchModal.footer.searchByText",message:"Search by",description:"The text explain that the search is making by Algolia"})},noResultsScreen:{noResultsText:(0,c.I)({id:"theme.SearchModal.noResultsScreen.noResultsText",message:"No results for",description:"The text explains that there are no results for the following search"}),suggestedQueryText:(0,c.I)({id:"theme.SearchModal.noResultsScreen.suggestedQueryText",message:"Try searching for",description:"The text for the suggested query when no results are found for the following search"}),reportMissingResultsText:(0,c.I)({id:"theme.SearchModal.noResultsScreen.reportMissingResultsText",message:"Believe this query should return results?",description:"The text for the question where the user thinks there are missing results"}),reportMissingResultsLinkText:(0,c.I)({id:"theme.SearchModal.noResultsScreen.reportMissingResultsLinkText",message:"Let us know.",description:"The text for the link to report missing results"})}},placeholder:(0,c.I)({id:"theme.SearchModal.placeholder",message:"Search docs",description:"The placeholder of the input of the DocSearch pop-up modal"})};let Ae=null;function Le(e){let{hit:t,children:n}=e;return r.createElement(K.Z,{to:t.url},n)}function Re(e){let{state:t,onClose:n}=e;const{generateSearchPageLink:a}=(0,he.O)();return r.createElement(K.Z,{to:a(t.query),onClick:n},r.createElement(c.Z,{id:"theme.SearchBar.seeAll",values:{count:t.context.nbHits}},"See all {count} results"))}function Pe(e){var t;let{contextualSearch:a,externalUrlRegex:o,...i}=e;const{siteMetadata:l}=(0,ie.Z)(),s=function(){const{locale:e,tags:t}=(0,Te._q)();return[`language:${e}`,t.map((e=>`docusaurus_tag:${e}`))]}(),c=(null==(t=i.searchParameters)?void 0:t.facetFilters)??[],d=a?function(e,t){const n=e=>"string"==typeof e?[e]:e;return[...n(e),...n(t)]}(s,c):c,p={...i.searchParameters,facetFilters:d},{withBaseUrl:f}=(0,Y.C)(),m=(0,u.k6)(),g=(0,r.useRef)(null),h=(0,r.useRef)(null),[v,y]=(0,r.useState)(!1),[w,k]=(0,r.useState)(void 0),S=(0,r.useCallback)((()=>Ae?Promise.resolve():Promise.all([n.e(6780).then(n.bind(n,6780)),Promise.all([n.e(532),n.e(6945)]).then(n.bind(n,6945)),Promise.all([n.e(532),n.e(8894)]).then(n.bind(n,8894))]).then((e=>{let[{DocSearchModal:t}]=e;Ae=t}))),[]),E=(0,r.useCallback)((()=>{S().then((()=>{g.current=document.createElement("div"),document.body.insertBefore(g.current,document.body.firstChild),y(!0)}))}),[S,y]),x=(0,r.useCallback)((()=>{var e;y(!1),null==(e=g.current)||e.remove()}),[y]),_=(0,r.useCallback)((e=>{S().then((()=>{y(!0),k(e.key)}))}),[S,y,k]),T=(0,r.useRef)({navigate(e){let{itemUrl:t}=e;(0,X.F)(o,t)?window.location.href=t:m.push(t)}}).current,C=(0,r.useRef)((e=>e.map((e=>{if((0,X.F)(o,e.url))return e;const t=new URL(e.url);return{...e,url:f(`${t.pathname}${t.hash}`)}})))).current,A=(0,r.useMemo)((()=>e=>r.createElement(Re,(0,b.Z)({},e,{onClose:x}))),[x]),L=(0,r.useCallback)((e=>(e.addAlgoliaAgent("docusaurus",l.docusaurusVersion),e)),[l.docusaurusVersion]);return function(e){var t=e.isOpen,n=e.onOpen,a=e.onClose,o=e.onInput,i=e.searchButtonRef;r.useEffect((function(){function e(e){(27===e.keyCode&&t||"k"===e.key&&(e.metaKey||e.ctrlKey)||!function(e){var t=e.target,n=t.tagName;return t.isContentEditable||"INPUT"===n||"SELECT"===n||"TEXTAREA"===n}(e)&&"/"===e.key&&!t)&&(e.preventDefault(),t?a():document.body.classList.contains("DocSearch--active")||document.body.classList.contains("DocSearch--active")||n()),i&&i.current===document.activeElement&&o&&/[a-zA-Z0-9]/.test(String.fromCharCode(e.keyCode))&&o(e)}return window.addEventListener("keydown",e),function(){window.removeEventListener("keydown",e)}}),[t,n,a,o,i])}({isOpen:v,onOpen:E,onClose:x,onInput:_,searchButtonRef:h}),r.createElement(r.Fragment,null,r.createElement(ge.Z,null,r.createElement("link",{rel:"preconnect",href:`https://${i.appId}-dsn.algolia.net`,crossOrigin:"anonymous"})),r.createElement(_e,{onTouchStart:S,onFocus:S,onMouseOver:S,onClick:E,ref:h,translations:Ce.button}),v&&Ae&&g.current&&(0,me.createPortal)(r.createElement(Ae,(0,b.Z)({onClose:x,initialScrollY:window.scrollY,initialQuery:w,navigator:T,transformItems:C,hitComponent:Le,transformSearchClient:L},i.searchPagePath&&{resultsFooterComponent:A},i,{searchParameters:p,placeholder:Ce.placeholder,translations:Ce.modal})),g.current))}function Oe(){const{siteConfig:e}=(0,ie.Z)();return r.createElement(Pe,e.themeConfig.algolia)}const Ne="searchBox_ZlJk";function Ie(e){let{children:t,className:n}=e;return r.createElement("div",{className:(0,a.Z)(n,Ne)},t)}var De=n(143),Me=n(2802);var je=n(373);const Fe=e=>e.docs.find((t=>t.id===e.mainDocId));const Be={default:re,localeDropdown:function(e){let{mobile:t,dropdownItemsBefore:n,dropdownItemsAfter:a,...o}=e;const{i18n:{currentLocale:i,locales:l,localeConfigs:s}}=(0,ie.Z)(),u=(0,de.l)(),d=[...n,...l.map((e=>{const n=`pathname://${u.createUrl({locale:e,fullyQualified:!1})}`;return{label:s[e].label,lang:s[e].htmlLang,to:n,target:"_self",autoAddBaseUrl:!1,className:e===i?t?"menu__link--active":"dropdown__link--active":""}})),...a],p=t?(0,c.I)({message:"Languages",id:"theme.navbar.mobileLanguageDropdown.label",description:"The label for the mobile language switcher dropdown"}):s[i].label;return r.createElement(ue,(0,b.Z)({},o,{mobile:t,label:r.createElement(r.Fragment,null,r.createElement(pe,{className:fe}),p),items:d}))},search:function(e){let{mobile:t,className:n}=e;return t?null:r.createElement(Ie,{className:n},r.createElement(Oe,null))},dropdown:ue,html:function(e){let{value:t,className:n,mobile:o=!1,isDropdownItem:i=!1}=e;const l=i?"li":"div";return r.createElement(l,{className:(0,a.Z)({navbar__item:!o&&!i,"menu__list-item":o},n),dangerouslySetInnerHTML:{__html:t}})},doc:function(e){let{docId:t,label:n,docsPluginId:a,...o}=e;const{activeDoc:i}=(0,De.Iw)(a),l=(0,Me.vY)(t,a);return null===l?null:r.createElement(re,(0,b.Z)({exact:!0},o,{isActive:()=>(null==i?void 0:i.path)===l.path||!(null==i||!i.sidebar)&&i.sidebar===l.sidebar,label:n??l.id,to:l.path}))},docSidebar:function(e){let{sidebarId:t,label:n,docsPluginId:a,...o}=e;const{activeDoc:i}=(0,De.Iw)(a),l=(0,Me.oz)(t,a).link;if(!l)throw new Error(`DocSidebarNavbarItem: Sidebar with ID "${t}" doesn't have anything to be linked to.`);return r.createElement(re,(0,b.Z)({exact:!0},o,{isActive:()=>(null==i?void 0:i.sidebar)===t,label:n??l.label,to:l.path}))},docsVersion:function(e){let{label:t,to:n,docsPluginId:a,...o}=e;const i=(0,Me.lO)(a)[0],l=t??i.label,s=n??(e=>e.docs.find((t=>t.id===e.mainDocId)))(i).path;return r.createElement(re,(0,b.Z)({},o,{label:l,to:s}))},docsVersionDropdown:function(e){let{mobile:t,docsPluginId:n,dropdownActiveClassDisabled:a,dropdownItemsBefore:o,dropdownItemsAfter:i,...l}=e;const s=(0,De.Iw)(n),u=(0,De.gB)(n),{savePreferredVersionName:d}=(0,je.J)(n),p=[...o,...u.map((e=>{const t=s.alternateDocVersions[e.name]??Fe(e);return{label:e.label,to:t.path,isActive:()=>e===s.activeVersion,onClick:()=>d(e.name)}})),...i],f=(0,Me.lO)(n)[0],m=t&&p.length>1?(0,c.I)({id:"theme.navbar.mobileVersionsDropdown.label",message:"Versions",description:"The label for the navbar versions dropdown on mobile view"}):f.label,g=t&&p.length>1?void 0:Fe(f).path;return p.length<=1?r.createElement(re,(0,b.Z)({},l,{mobile:t,label:m,to:g,isActive:a?()=>!1:void 0})):r.createElement(ue,(0,b.Z)({},l,{mobile:t,label:m,to:g,items:p,isActive:a?()=>!1:void 0}))}};function ze(e){let{type:t,...n}=e;const a=function(e,t){return e&&"default"!==e?e:"items"in t?"dropdown":"default"}(t,n),o=Be[a];if(!o)throw new Error(`No NavbarItem component found for type "${t}".`);return r.createElement(o,n)}function Ue(){const e=(0,A.e)(),t=(0,g.L)().navbar.items;return r.createElement("ul",{className:"menu__list"},t.map(((t,n)=>r.createElement(ze,(0,b.Z)({mobile:!0},t,{onClick:()=>e.toggle(),key:n})))))}function $e(e){return r.createElement("button",(0,b.Z)({},e,{type:"button",className:"clean-btn navbar-sidebar__back"}),r.createElement(c.Z,{id:"theme.navbar.mobileSidebarSecondaryMenu.backButtonLabel",description:"The label of the back button to return to main menu, inside the mobile navbar sidebar secondary menu (notably used to display the docs sidebar)"},"\u2190 Back to main menu"))}function qe(){const e=0===(0,g.L)().navbar.items.length,t=D();return r.createElement(r.Fragment,null,!e&&r.createElement($e,{onClick:()=>t.hide()}),t.content)}function Ge(){const e=(0,A.e)();var t;return void 0===(t=e.shown)&&(t=!0),(0,r.useEffect)((()=>(document.body.style.overflow=t?"hidden":"visible",()=>{document.body.style.overflow="visible"})),[t]),e.shouldRender?r.createElement(M,{header:r.createElement(W,null),primaryMenu:r.createElement(Ue,null),secondaryMenu:r.createElement(qe,null)}):null}const He="navbarHideable_m1mJ",Ze="navbarHidden_jGov";function Ve(e){return r.createElement("div",(0,b.Z)({role:"presentation"},e,{className:(0,a.Z)("navbar-sidebar__backdrop",e.className)}))}function We(e){let{children:t}=e;const{navbar:{hideOnScroll:n,style:o}}=(0,g.L)(),i=(0,A.e)(),{navbarRef:l,isNavbarVisible:s}=function(e){const[t,n]=(0,r.useState)(e),a=(0,r.useRef)(!1),o=(0,r.useRef)(0),i=(0,r.useCallback)((e=>{null!==e&&(o.current=e.getBoundingClientRect().height)}),[]);return(0,L.RF)(((t,r)=>{let{scrollY:i}=t;if(!e)return;if(i=l?n(!1):i+c{if(e)return t.location.hash?(a.current=!0,void n(!1)):void n(!0)})),{navbarRef:i,isNavbarVisible:t}}(n);return r.createElement("nav",{ref:l,className:(0,a.Z)("navbar","navbar--fixed-top",n&&[He,!s&&Ze],{"navbar--dark":"dark"===o,"navbar--primary":"primary"===o,"navbar-sidebar--show":i.shown})},t,r.createElement(Ve,{onClick:i.toggle}),r.createElement(Ge,null))}function Ke(e){let{width:t=30,height:n=30,className:a,...o}=e;return r.createElement("svg",(0,b.Z)({className:a,width:t,height:n,viewBox:"0 0 30 30","aria-hidden":"true"},o),r.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeMiterlimit:"10",strokeWidth:"2",d:"M4 7h22M4 15h22M4 23h22"}))}function Ye(){const e=(0,A.e)();return r.createElement("button",{onClick:e.toggle,onKeyDown:e.toggle,"aria-label":"Navigation bar toggle",className:"navbar__toggle clean-btn",type:"button",tabIndex:0},r.createElement(Ke,null))}const Qe="colorModeToggle_DEke";function Xe(e){let{items:t}=e;return r.createElement(r.Fragment,null,t.map(((e,t)=>r.createElement(ze,(0,b.Z)({},e,{key:t})))))}function Je(e){let{left:t,right:n}=e;return r.createElement("div",{className:"navbar__inner"},r.createElement("div",{className:"navbar__items"},t),r.createElement("div",{className:"navbar__items navbar__items--right"},n))}function et(){const e=(0,A.e)(),t=(0,g.L)().navbar.items,[n,a]=function(e){function t(e){return"left"===(e.position??"right")}return[e.filter(t),e.filter((e=>!t(e)))]}(t),o=t.find((e=>"search"===e.type));return r.createElement(Je,{left:r.createElement(r.Fragment,null,!e.disabled&&r.createElement(Ye,null),r.createElement(Z,null),r.createElement(Xe,{items:n})),right:r.createElement(r.Fragment,null,r.createElement(Xe,{items:a}),r.createElement(G,{className:Qe}),!o&&r.createElement(Ie,null,r.createElement(Oe,null)))})}function tt(){return r.createElement(We,null,r.createElement(et,null))}function nt(e){let{item:t}=e;const{to:n,href:a,label:o,prependBaseUrlToHref:i,...l}=t,s=(0,Y.Z)(n),c=(0,Y.Z)(a,{forcePrependBaseUrl:!0});return r.createElement(K.Z,(0,b.Z)({className:"footer__link-item"},a?{href:i?c:a}:{to:s},l),o,a&&!(0,Q.Z)(a)&&r.createElement(J.Z,null))}function rt(e){let{item:t}=e;return t.html?r.createElement("li",{className:"footer__item",dangerouslySetInnerHTML:{__html:t.html}}):r.createElement("li",{key:t.href??t.to,className:"footer__item"},r.createElement(nt,{item:t}))}function at(e){let{column:t}=e;return r.createElement("div",{className:"col footer__col"},r.createElement("div",{className:"footer__title"},t.title),r.createElement("ul",{className:"footer__items clean-list"},t.items.map(((e,t)=>r.createElement(rt,{key:t,item:e})))))}function ot(e){let{columns:t}=e;return r.createElement("div",{className:"row footer__links"},t.map(((e,t)=>r.createElement(at,{key:t,column:e}))))}function it(){return r.createElement("span",{className:"footer__link-separator"},"\xb7")}function lt(e){let{item:t}=e;return t.html?r.createElement("span",{className:"footer__link-item",dangerouslySetInnerHTML:{__html:t.html}}):r.createElement(nt,{item:t})}function st(e){let{links:t}=e;return r.createElement("div",{className:"footer__links text--center"},r.createElement("div",{className:"footer__links"},t.map(((e,n)=>r.createElement(r.Fragment,{key:n},r.createElement(lt,{item:e}),t.length!==n+1&&r.createElement(it,null))))))}function ct(e){let{links:t}=e;return function(e){return"title"in e[0]}(t)?r.createElement(ot,{columns:t}):r.createElement(st,{links:t})}var ut=n(941);const dt="footerLogoLink_BH7S";function pt(e){let{logo:t}=e;const{withBaseUrl:n}=(0,Y.C)(),o={light:n(t.src),dark:n(t.srcDark??t.src)};return r.createElement(ut.Z,{className:(0,a.Z)("footer__logo",t.className),alt:t.alt,sources:o,width:t.width,height:t.height,style:t.style})}function ft(e){let{logo:t}=e;return t.href?r.createElement(K.Z,{href:t.href,className:dt,target:t.target},r.createElement(pt,{logo:t})):r.createElement(pt,{logo:t})}function mt(e){let{copyright:t}=e;return r.createElement("div",{className:"footer__copyright",dangerouslySetInnerHTML:{__html:t}})}function gt(e){let{style:t,links:n,logo:o,copyright:i}=e;return r.createElement("footer",{className:(0,a.Z)("footer",{"footer--dark":"dark"===t})},r.createElement("div",{className:"container container-fluid"},n,(o||i)&&r.createElement("div",{className:"footer__bottom text--center"},o&&r.createElement("div",{className:"margin-bottom--sm"},o),i)))}function ht(){const{footer:e}=(0,g.L)();if(!e)return null;const{copyright:t,links:n,logo:a,style:o}=e;return r.createElement(gt,{style:o,links:n&&n.length>0&&r.createElement(ct,{links:n}),logo:a&&r.createElement(ft,{logo:a}),copyright:t&&r.createElement(mt,{copyright:t})})}const bt=r.memo(ht);var vt=n(12);const yt="docusaurus.tab.",wt=r.createContext(void 0);const kt=(0,R.Qc)([j.S,h.pl,function(e){let{children:t}=e;const n=function(){const[e,t]=(0,r.useState)({}),n=(0,r.useCallback)(((e,t)=>{(0,vt.W)(`docusaurus.tab.${e}`).set(t)}),[]);(0,r.useEffect)((()=>{try{const e={};(0,vt._)().forEach((t=>{if(t.startsWith(yt)){const n=t.substring(yt.length);e[n]=(0,vt.W)(t).get()}})),t(e)}catch(e){console.error(e)}}),[]);const a=(0,r.useCallback)(((e,r)=>{t((t=>({...t,[e]:r}))),n(e,r)}),[n]);return(0,r.useMemo)((()=>({tabGroupChoices:e,setTabGroupChoices:a})),[e,a])}();return r.createElement(wt.Provider,{value:n},t)},L.OC,je.L5,i.VC,function(e){let{children:t}=e;return r.createElement(P.n2,null,r.createElement(A.M,null,r.createElement(N,null,t)))}]);function St(e){let{children:t}=e;return r.createElement(kt,null,t)}function Et(e){let{error:t,tryAgain:n}=e;return r.createElement("main",{className:"container margin-vert--xl"},r.createElement("div",{className:"row"},r.createElement("div",{className:"col col--6 col--offset-3"},r.createElement("h1",{className:"hero__title"},r.createElement(c.Z,{id:"theme.ErrorPageContent.title",description:"The title of the fallback page when the page crashed"},"This page crashed.")),r.createElement("p",null,t.message),r.createElement("div",null,r.createElement("button",{type:"button",onClick:n},r.createElement(c.Z,{id:"theme.ErrorPageContent.tryAgain",description:"The label of the button to try again when the page crashed"},"Try again"))))))}const xt="mainWrapper_z2l0";function _t(e){const{children:t,noFooter:n,wrapperClassName:c,title:u,description:d}=e;return(0,s.t)(),r.createElement(St,null,r.createElement(i.d,{title:u,description:d}),r.createElement(m,null),r.createElement(C,null),r.createElement(tt,null),r.createElement("div",{className:(0,a.Z)(l.k.wrapper.main,xt,c)},r.createElement(o.Z,{fallback:e=>r.createElement(Et,e)},t)),!n&&r.createElement(bt,null))}},1327:(e,t,n)=>{"use strict";n.d(t,{Z:()=>d});var r=n(7462),a=n(7294),o=n(9960),i=n(4996),l=n(2263),s=n(6668),c=n(941);function u(e){let{logo:t,alt:n,imageClassName:r}=e;const o={light:(0,i.Z)(t.src),dark:(0,i.Z)(t.srcDark||t.src)},l=a.createElement(c.Z,{className:t.className,sources:o,height:t.height,width:t.width,alt:n,style:t.style});return r?a.createElement("div",{className:r},l):l}function d(e){const{siteConfig:{title:t}}=(0,l.Z)(),{navbar:{title:n,logo:c}}=(0,s.L)(),{imageClassName:d,titleClassName:p,...f}=e,m=(0,i.Z)((null==c?void 0:c.href)||"/"),g=n?"":t,h=(null==c?void 0:c.alt)??g;return a.createElement(o.Z,(0,r.Z)({to:m},f,(null==c?void 0:c.target)&&{target:c.target}),c&&a.createElement(u,{logo:c,alt:h,imageClassName:d}),null!=n&&a.createElement("b",{className:p},n))}},197:(e,t,n)=>{"use strict";n.d(t,{Z:()=>o});var r=n(7294),a=n(5742);function o(e){let{locale:t,version:n,tag:o}=e;const i=t;return r.createElement(a.Z,null,t&&r.createElement("meta",{name:"docusaurus_locale",content:t}),n&&r.createElement("meta",{name:"docusaurus_version",content:n}),o&&r.createElement("meta",{name:"docusaurus_tag",content:o}),i&&r.createElement("meta",{name:"docsearch:language",content:i}),n&&r.createElement("meta",{name:"docsearch:version",content:n}),o&&r.createElement("meta",{name:"docsearch:docusaurus_tag",content:o}))}},941:(e,t,n)=>{"use strict";n.d(t,{Z:()=>c});var r=n(7462),a=n(7294),o=n(6010),i=n(2389),l=n(2949);const s={themedImage:"themedImage_ToTc","themedImage--light":"themedImage--light_HNdA","themedImage--dark":"themedImage--dark_i4oU"};function c(e){const t=(0,i.Z)(),{colorMode:n}=(0,l.I)(),{sources:c,className:u,alt:d,...p}=e,f=t?"dark"===n?["dark"]:["light"]:["light","dark"];return a.createElement(a.Fragment,null,f.map((e=>a.createElement("img",(0,r.Z)({key:e,src:c[e],alt:d,className:(0,o.Z)(s.themedImage,s[`themedImage--${e}`],u)},p)))))}},6043:(e,t,n)=>{"use strict";n.d(t,{u:()=>i,z:()=>m});var r=n(7462),a=n(7294),o=n(412);function i(e){let{initialState:t}=e;const[n,r]=(0,a.useState)(t??!1),o=(0,a.useCallback)((()=>{r((e=>!e))}),[]);return{collapsed:n,setCollapsed:r,toggleCollapsed:o}}const l={display:"none",overflow:"hidden",height:"0px"},s={display:"block",overflow:"visible",height:"auto"};function c(e,t){const n=t?l:s;e.style.display=n.display,e.style.overflow=n.overflow,e.style.height=n.height}function u(e){let{collapsibleRef:t,collapsed:n,animation:r}=e;const o=(0,a.useRef)(!1);(0,a.useEffect)((()=>{const e=t.current;function a(){const t=e.scrollHeight,n=(null==r?void 0:r.duration)??function(e){const t=e/36;return Math.round(10*(4+15*t**.25+t/5))}(t);return{transition:`height ${n}ms ${(null==r?void 0:r.easing)??"ease-in-out"}`,height:`${t}px`}}function i(){const t=a();e.style.transition=t.transition,e.style.height=t.height}if(!o.current)return c(e,n),void(o.current=!0);return e.style.willChange="height",function(){const t=requestAnimationFrame((()=>{n?(i(),requestAnimationFrame((()=>{e.style.height=l.height,e.style.overflow=l.overflow}))):(e.style.display="block",requestAnimationFrame((()=>{i()})))}));return()=>cancelAnimationFrame(t)}()}),[t,n,r])}function d(e){if(!o.Z.canUseDOM)return e?l:s}function p(e){let{as:t="div",collapsed:n,children:r,animation:o,onCollapseTransitionEnd:i,className:l,disableSSRStyle:s}=e;const p=(0,a.useRef)(null);return u({collapsibleRef:p,collapsed:n,animation:o}),a.createElement(t,{ref:p,style:s?void 0:d(n),onTransitionEnd:e=>{"height"===e.propertyName&&(c(p.current,n),null==i||i(n))},className:l},r)}function f(e){let{collapsed:t,...n}=e;const[o,i]=(0,a.useState)(!t),[l,s]=(0,a.useState)(t);return(0,a.useLayoutEffect)((()=>{t||i(!0)}),[t]),(0,a.useLayoutEffect)((()=>{o&&s(t)}),[o,t]),o?a.createElement(p,(0,r.Z)({},n,{collapsed:l})):null}function m(e){let{lazy:t,...n}=e;const r=t?f:p;return a.createElement(r,n)}},9689:(e,t,n)=>{"use strict";n.d(t,{nT:()=>m,pl:()=>f});var r=n(7294),a=n(2389),o=n(12),i=n(902),l=n(6668);const s=(0,o.W)("docusaurus.announcement.dismiss"),c=(0,o.W)("docusaurus.announcement.id"),u=()=>"true"===s.get(),d=e=>s.set(String(e)),p=r.createContext(null);function f(e){let{children:t}=e;const n=function(){const{announcementBar:e}=(0,l.L)(),t=(0,a.Z)(),[n,o]=(0,r.useState)((()=>!!t&&u()));(0,r.useEffect)((()=>{o(u())}),[]);const i=(0,r.useCallback)((()=>{d(!0),o(!0)}),[]);return(0,r.useEffect)((()=>{if(!e)return;const{id:t}=e;let n=c.get();"annoucement-bar"===n&&(n="announcement-bar");const r=t!==n;c.set(t),r&&d(!1),!r&&u()||o(!1)}),[e]),(0,r.useMemo)((()=>({isActive:!!e&&!n,close:i})),[e,n,i])}();return r.createElement(p.Provider,{value:n},t)}function m(){const e=(0,r.useContext)(p);if(!e)throw new i.i6("AnnouncementBarProvider");return e}},2949:(e,t,n)=>{"use strict";n.d(t,{I:()=>h,S:()=>g});var r=n(7294),a=n(412),o=n(902),i=n(12),l=n(6668);const s=r.createContext(void 0),c="theme",u=(0,i.W)(c),d="light",p="dark",f=e=>e===p?p:d;function m(){const{colorMode:{defaultMode:e,disableSwitch:t,respectPrefersColorScheme:n}}=(0,l.L)(),[o,i]=(0,r.useState)((e=>a.Z.canUseDOM?f(document.documentElement.getAttribute("data-theme")):f(e))(e));(0,r.useEffect)((()=>{t&&u.del()}),[t]);const s=(0,r.useCallback)((function(t,r){void 0===r&&(r={});const{persist:a=!0}=r;t?(i(t),a&&(e=>{u.set(f(e))})(t)):(i(n?window.matchMedia("(prefers-color-scheme: dark)").matches?p:d:e),u.del())}),[n,e]);(0,r.useEffect)((()=>{document.documentElement.setAttribute("data-theme",f(o))}),[o]),(0,r.useEffect)((()=>{if(t)return;const e=e=>{if(e.key!==c)return;const t=u.get();null!==t&&s(f(t))};return window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)}),[t,s]);const m=(0,r.useRef)(!1);return(0,r.useEffect)((()=>{if(t&&!n)return;const e=window.matchMedia("(prefers-color-scheme: dark)"),r=()=>{window.matchMedia("print").matches||m.current?m.current=window.matchMedia("print").matches:s(null)};return e.addListener(r),()=>e.removeListener(r)}),[s,t,n]),(0,r.useMemo)((()=>({colorMode:o,setColorMode:s,get isDarkTheme(){return o===p},setLightTheme(){s(d)},setDarkTheme(){s(p)}})),[o,s])}function g(e){let{children:t}=e;const n=m();return r.createElement(s.Provider,{value:n},t)}function h(){const e=(0,r.useContext)(s);if(null==e)throw new o.i6("ColorModeProvider","Please see https://docusaurus.io/docs/api/themes/configuration#use-color-mode.");return e}},373:(e,t,n)=>{"use strict";n.d(t,{J:()=>y,L5:()=>b,Oh:()=>w});var r=n(7294),a=n(143),o=n(9935),i=n(6668),l=n(2802),s=n(902),c=n(12);const u=e=>`docs-preferred-version-${e}`,d=(e,t,n)=>{(0,c.W)(u(e),{persistence:t}).set(n)},p=(e,t)=>(0,c.W)(u(e),{persistence:t}).get(),f=(e,t)=>{(0,c.W)(u(e),{persistence:t}).del()};const m=r.createContext(null);function g(){const e=(0,a._r)(),t=(0,i.L)().docs.versionPersistence,n=(0,r.useMemo)((()=>Object.keys(e)),[e]),[o,l]=(0,r.useState)((()=>(e=>Object.fromEntries(e.map((e=>[e,{preferredVersionName:null}]))))(n)));(0,r.useEffect)((()=>{l(function(e){let{pluginIds:t,versionPersistence:n,allDocsData:r}=e;function a(e){const t=p(e,n);return r[e].versions.some((e=>e.name===t))?{preferredVersionName:t}:(f(e,n),{preferredVersionName:null})}return Object.fromEntries(t.map((e=>[e,a(e)])))}({allDocsData:e,versionPersistence:t,pluginIds:n}))}),[e,t,n]);return[o,(0,r.useMemo)((()=>({savePreferredVersion:function(e,n){d(e,t,n),l((t=>({...t,[e]:{preferredVersionName:n}})))}})),[t])]}function h(e){let{children:t}=e;const n=g();return r.createElement(m.Provider,{value:n},t)}function b(e){let{children:t}=e;return l.cE?r.createElement(h,null,t):r.createElement(r.Fragment,null,t)}function v(){const e=(0,r.useContext)(m);if(!e)throw new s.i6("DocsPreferredVersionContextProvider");return e}function y(e){void 0===e&&(e=o.m);const t=(0,a.zh)(e),[n,i]=v(),{preferredVersionName:l}=n[e];return{preferredVersion:t.versions.find((e=>e.name===l))??null,savePreferredVersionName:(0,r.useCallback)((t=>{i.savePreferredVersion(e,t)}),[i,e])}}function w(){const e=(0,a._r)(),[t]=v();function n(n){const r=e[n],{preferredVersionName:a}=t[n];return r.versions.find((e=>e.name===a))??null}const r=Object.keys(e);return Object.fromEntries(r.map((e=>[e,n(e)])))}},1116:(e,t,n)=>{"use strict";n.d(t,{V:()=>s,b:()=>l});var r=n(7294),a=n(902);const o=Symbol("EmptyContext"),i=r.createContext(o);function l(e){let{children:t,name:n,items:a}=e;const o=(0,r.useMemo)((()=>n&&a?{name:n,items:a}:null),[n,a]);return r.createElement(i.Provider,{value:o},t)}function s(){const e=(0,r.useContext)(i);if(e===o)throw new a.i6("DocsSidebarProvider");return e}},2961:(e,t,n)=>{"use strict";n.d(t,{M:()=>p,e:()=>f});var r=n(7294),a=n(3102),o=n(7524),i=n(6775),l=n(902);function s(e){!function(e){const t=(0,i.k6)(),n=(0,l.zX)(e);(0,r.useEffect)((()=>t.block(((e,t)=>n(e,t)))),[t,n])}(((t,n)=>{if("POP"===n)return e(t,n)}))}var c=n(6668);const u=r.createContext(void 0);function d(){const e=function(){const e=(0,a.HY)(),{items:t}=(0,c.L)().navbar;return 0===t.length&&!e.component}(),t=(0,o.i)(),n=!e&&"mobile"===t,[i,l]=(0,r.useState)(!1);s((()=>{if(i)return l(!1),!1}));const u=(0,r.useCallback)((()=>{l((e=>!e))}),[]);return(0,r.useEffect)((()=>{"desktop"===t&&l(!1)}),[t]),(0,r.useMemo)((()=>({disabled:e,shouldRender:n,toggle:u,shown:i})),[e,n,u,i])}function p(e){let{children:t}=e;const n=d();return r.createElement(u.Provider,{value:n},t)}function f(){const e=r.useContext(u);if(void 0===e)throw new l.i6("NavbarMobileSidebarProvider");return e}},3102:(e,t,n)=>{"use strict";n.d(t,{HY:()=>l,Zo:()=>s,n2:()=>i});var r=n(7294),a=n(902);const o=r.createContext(null);function i(e){let{children:t}=e;const n=(0,r.useState)({component:null,props:null});return r.createElement(o.Provider,{value:n},t)}function l(){const e=(0,r.useContext)(o);if(!e)throw new a.i6("NavbarSecondaryMenuContentProvider");return e[0]}function s(e){let{component:t,props:n}=e;const i=(0,r.useContext)(o);if(!i)throw new a.i6("NavbarSecondaryMenuContentProvider");const[,l]=i,s=(0,a.Ql)(n);return(0,r.useEffect)((()=>{l({component:t,props:s})}),[l,t,s]),(0,r.useEffect)((()=>()=>l({component:null,props:null})),[l]),null}},9727:(e,t,n)=>{"use strict";n.d(t,{h:()=>a,t:()=>o});var r=n(7294);const a="navigation-with-keyboard";function o(){(0,r.useEffect)((()=>{function e(e){"keydown"===e.type&&"Tab"===e.key&&document.body.classList.add(a),"mousedown"===e.type&&document.body.classList.remove(a)}return document.addEventListener("keydown",e),document.addEventListener("mousedown",e),()=>{document.body.classList.remove(a),document.removeEventListener("keydown",e),document.removeEventListener("mousedown",e)}}),[])}},6177:(e,t,n)=>{"use strict";n.d(t,{O:()=>l});var r=n(7294),a=n(6775),o=n(2263);const i="q";function l(){const e=(0,a.k6)(),{siteConfig:{baseUrl:t}}=(0,o.Z)(),[n,l]=(0,r.useState)("");(0,r.useEffect)((()=>{const e=new URLSearchParams(window.location.search).get(i)??"";l(e)}),[]);return{searchQuery:n,setSearchQuery:(0,r.useCallback)((t=>{const n=new URLSearchParams(window.location.search);t?n.set(i,t):n.delete(i),e.replace({search:n.toString()}),l(t)}),[e]),generateSearchPageLink:(0,r.useCallback)((e=>`${t}search?q=${encodeURIComponent(e)}`),[t])}}},7524:(e,t,n)=>{"use strict";n.d(t,{i:()=>c});var r=n(7294),a=n(412);const o="desktop",i="mobile",l="ssr";function s(){return a.Z.canUseDOM?window.innerWidth>996?o:i:l}function c(){const[e,t]=(0,r.useState)((()=>s()));return(0,r.useEffect)((()=>{function e(){t(s())}return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e),clearTimeout(undefined)}}),[]),e}},5281:(e,t,n)=>{"use strict";n.d(t,{k:()=>r});const r={page:{blogListPage:"blog-list-page",blogPostPage:"blog-post-page",blogTagsListPage:"blog-tags-list-page",blogTagPostListPage:"blog-tags-post-list-page",docsDocPage:"docs-doc-page",docsTagsListPage:"docs-tags-list-page",docsTagDocListPage:"docs-tags-doc-list-page",mdxPage:"mdx-page"},wrapper:{main:"main-wrapper",blogPages:"blog-wrapper",docsPages:"docs-wrapper",mdxPages:"mdx-wrapper"},common:{editThisPage:"theme-edit-this-page",lastUpdated:"theme-last-updated",backToTopButton:"theme-back-to-top-button",codeBlock:"theme-code-block",admonition:"theme-admonition",admonitionType:e=>`theme-admonition-${e}`},layout:{},docs:{docVersionBanner:"theme-doc-version-banner",docVersionBadge:"theme-doc-version-badge",docBreadcrumbs:"theme-doc-breadcrumbs",docMarkdown:"theme-doc-markdown",docTocMobile:"theme-doc-toc-mobile",docTocDesktop:"theme-doc-toc-desktop",docFooter:"theme-doc-footer",docFooterTagsRow:"theme-doc-footer-tags-row",docFooterEditMetaRow:"theme-doc-footer-edit-meta-row",docSidebarContainer:"theme-doc-sidebar-container",docSidebarMenu:"theme-doc-sidebar-menu",docSidebarItemCategory:"theme-doc-sidebar-item-category",docSidebarItemLink:"theme-doc-sidebar-item-link",docSidebarItemCategoryLevel:e=>`theme-doc-sidebar-item-category-level-${e}`,docSidebarItemLinkLevel:e=>`theme-doc-sidebar-item-link-level-${e}`},blog:{}}},2802:(e,t,n)=>{"use strict";n.d(t,{Wl:()=>p,_F:()=>m,cE:()=>d,hI:()=>w,lO:()=>b,vY:()=>y,oz:()=>v,s1:()=>h});var r=n(7294),a=n(6775),o=n(8790),i=n(143),l=n(373),s=n(1116);function c(e){return Array.from(new Set(e))}var u=n(8596);const d=!!i._r;function p(e){if(e.href)return e.href;for(const t of e.items){if("link"===t.type)return t.href;if("category"===t.type){const e=p(t);if(e)return e}}}const f=(e,t)=>void 0!==e&&(0,u.Mg)(e,t);function m(e,t){return"link"===e.type?f(e.href,t):"category"===e.type&&(f(e.href,t)||((e,t)=>e.some((e=>m(e,t))))(e.items,t))}function g(e){let{sidebarItems:t,pathname:n,onlyCategories:r=!1}=e;const a=[];return function e(t){for(const o of t)if("category"===o.type&&((0,u.Mg)(o.href,n)||e(o.items))||"link"===o.type&&(0,u.Mg)(o.href,n)){return r&&"category"!==o.type||a.unshift(o),!0}return!1}(t),a}function h(){var e;const t=(0,s.V)(),{pathname:n}=(0,a.TH)();return!1!==(null==(e=(0,i.gA)())?void 0:e.pluginData.breadcrumbs)&&t?g({sidebarItems:t.items,pathname:n}):null}function b(e){const{activeVersion:t}=(0,i.Iw)(e),{preferredVersion:n}=(0,l.J)(e),a=(0,i.yW)(e);return(0,r.useMemo)((()=>c([t,n,a].filter(Boolean))),[t,n,a])}function v(e,t){const n=b(t);return(0,r.useMemo)((()=>{const t=n.flatMap((e=>e.sidebars?Object.entries(e.sidebars):[])),r=t.find((t=>t[0]===e));if(!r)throw new Error(`Can't find any sidebar with id "${e}" in version${n.length>1?"s":""} ${n.map((e=>e.name)).join(", ")}".\n Available sidebar ids are:\n - ${Object.keys(t).join("\n- ")}`);return r[1]}),[e,n])}function y(e,t){const n=b(t);return(0,r.useMemo)((()=>{const t=n.flatMap((e=>e.docs)),r=t.find((t=>t.id===e));if(!r){if(n.flatMap((e=>e.draftIds)).includes(e))return null;throw new Error(`DocNavbarItem: couldn't find any doc with id "${e}" in version${n.length>1?"s":""} ${n.map((e=>e.name)).join(", ")}".\nAvailable doc ids are:\n- ${c(t.map((e=>e.id))).join("\n- ")}`)}return r}),[e,n])}function w(e){let{route:t,versionMetadata:n}=e;const r=(0,a.TH)(),i=t.routes,l=i.find((e=>(0,a.LX)(r.pathname,e)));if(!l)return null;const s=l.sidebar,c=s?n.docsSidebars[s]:void 0;return{docElement:(0,o.H)(i),sidebarName:s,sidebarItems:c}}},2128:(e,t,n)=>{"use strict";n.d(t,{p:()=>a});var r=n(2263);function a(e){const{siteConfig:t}=(0,r.Z)(),{title:n,titleDelimiter:a}=t;return null!=e&&e.trim().length?`${e.trim()} ${a} ${n}`:n}},833:(e,t,n)=>{"use strict";n.d(t,{FG:()=>p,d:()=>u,VC:()=>f});var r=n(7294),a=n(6010),o=n(5742),i=n(226);function l(){const e=r.useContext(i._);if(!e)throw new Error("Unexpected: no Docusaurus route context found");return e}var s=n(4996),c=n(2128);function u(e){let{title:t,description:n,keywords:a,image:i,children:l}=e;const u=(0,c.p)(t),{withBaseUrl:d}=(0,s.C)(),p=i?d(i,{absolute:!0}):void 0;return r.createElement(o.Z,null,t&&r.createElement("title",null,u),t&&r.createElement("meta",{property:"og:title",content:u}),n&&r.createElement("meta",{name:"description",content:n}),n&&r.createElement("meta",{property:"og:description",content:n}),a&&r.createElement("meta",{name:"keywords",content:Array.isArray(a)?a.join(","):a}),p&&r.createElement("meta",{property:"og:image",content:p}),p&&r.createElement("meta",{name:"twitter:image",content:p}),l)}const d=r.createContext(void 0);function p(e){let{className:t,children:n}=e;const i=r.useContext(d),l=(0,a.Z)(i,t);return r.createElement(d.Provider,{value:l},r.createElement(o.Z,null,r.createElement("html",{className:l})),n)}function f(e){let{children:t}=e;const n=l(),o=`plugin-${n.plugin.name.replace(/docusaurus-(?:plugin|theme)-(?:content-)?/gi,"")}`;const i=`plugin-id-${n.plugin.id}`;return r.createElement(p,{className:(0,a.Z)(o,i)},t)}},902:(e,t,n)=>{"use strict";n.d(t,{D9:()=>i,Qc:()=>c,Ql:()=>s,i6:()=>l,zX:()=>o});var r=n(7294);const a=n(412).Z.canUseDOM?r.useLayoutEffect:r.useEffect;function o(e){const t=(0,r.useRef)(e);return a((()=>{t.current=e}),[e]),(0,r.useCallback)((function(){return t.current(...arguments)}),[])}function i(e){const t=(0,r.useRef)();return a((()=>{t.current=e})),t.current}class l extends Error{constructor(e,t){var n,r,a;super(),this.name="ReactContextError",this.message=`Hook ${(null==(n=this.stack)||null==(r=n.split("\n")[1])||null==(a=r.match(/at (?:\w+\.)?(?\w+)/))?void 0:a.groups.name)??""} is called outside the <${e}>. ${t??""}`}}function s(e){const t=Object.entries(e);return t.sort(((e,t)=>e[0].localeCompare(t[0]))),(0,r.useMemo)((()=>e),t.flat())}function c(e){return t=>{let{children:n}=t;return r.createElement(r.Fragment,null,e.reduceRight(((e,t)=>r.createElement(t,null,e)),n))}}},8022:(e,t,n)=>{"use strict";function r(e,t){return void 0!==e&&void 0!==t&&new RegExp(e,"gi").test(t)}n.d(t,{F:()=>r})},8596:(e,t,n)=>{"use strict";n.d(t,{Mg:()=>i,Ns:()=>l});var r=n(7294),a=n(723),o=n(2263);function i(e,t){const n=e=>{var t;return null==(t=!e||e.endsWith("/")?e:`${e}/`)?void 0:t.toLowerCase()};return n(e)===n(t)}function l(){const{baseUrl:e}=(0,o.Z)().siteConfig;return(0,r.useMemo)((()=>function(e){let{baseUrl:t,routes:n}=e;function r(e){return e.path===t&&!0===e.exact}function a(e){return e.path===t&&!e.exact}return function e(t){if(0===t.length)return;return t.find(r)||e(t.filter(a).flatMap((e=>e.routes??[])))}(n)}({routes:a.Z,baseUrl:e})),[e])}},2466:(e,t,n)=>{"use strict";n.d(t,{Ct:()=>p,OC:()=>s,RF:()=>d});var r=n(7294),a=n(412),o=n(2389),i=n(902);const l=r.createContext(void 0);function s(e){let{children:t}=e;const n=function(){const e=(0,r.useRef)(!0);return(0,r.useMemo)((()=>({scrollEventsEnabledRef:e,enableScrollEvents:()=>{e.current=!0},disableScrollEvents:()=>{e.current=!1}})),[])}();return r.createElement(l.Provider,{value:n},t)}function c(){const e=(0,r.useContext)(l);if(null==e)throw new i.i6("ScrollControllerProvider");return e}const u=()=>a.Z.canUseDOM?{scrollX:window.pageXOffset,scrollY:window.pageYOffset}:null;function d(e,t){void 0===t&&(t=[]);const{scrollEventsEnabledRef:n}=c(),a=(0,r.useRef)(u()),o=(0,i.zX)(e);(0,r.useEffect)((()=>{const e=()=>{if(!n.current)return;const e=u();o(e,a.current),a.current=e},t={passive:!0};return e(),window.addEventListener("scroll",e,t),()=>window.removeEventListener("scroll",e,t)}),[o,n,...t])}function p(){const e=(0,r.useRef)(null),t=(0,o.Z)()&&"smooth"===getComputedStyle(document.documentElement).scrollBehavior;return{startScroll:n=>{e.current=t?function(e){return window.scrollTo({top:e,behavior:"smooth"}),()=>{}}(n):function(e){let t=null;const n=document.documentElement.scrollTop>e;return function r(){const a=document.documentElement.scrollTop;(n&&a>e||!n&&at&&cancelAnimationFrame(t)}(n)},cancelScroll:()=>null==e.current?void 0:e.current()}}},3320:(e,t,n)=>{"use strict";n.d(t,{HX:()=>i,_q:()=>s,os:()=>l});var r=n(143),a=n(2263),o=n(373);const i="default";function l(e,t){return`docs-${e}-${t}`}function s(){const{i18n:e}=(0,a.Z)(),t=(0,r._r)(),n=(0,r.WS)(),s=(0,o.Oh)();const c=[i,...Object.keys(t).map((function(e){const r=(null==n?void 0:n.activePlugin.pluginId)===e?n.activeVersion:void 0,a=s[e],o=t[e].versions.find((e=>e.isLast));return l(e,(r??a??o).name)}))];return{locale:e.currentLocale,tags:c}}},12:(e,t,n)=>{"use strict";n.d(t,{W:()=>l,_:()=>s});const r="localStorage";function a(e){if(void 0===e&&(e=r),"undefined"==typeof window)throw new Error("Browser storage is not available on Node.js/Docusaurus SSR process.");if("none"===e)return null;try{return window[e]}catch(n){return t=n,o||(console.warn("Docusaurus browser storage is not available.\nPossible reasons: running Docusaurus in an iframe, in an incognito browser session, or using too strict browser privacy settings.",t),o=!0),null}var t}let o=!1;const i={get:()=>null,set:()=>{},del:()=>{}};function l(e,t){if("undefined"==typeof window)return function(e){function t(){throw new Error(`Illegal storage API usage for storage key "${e}".\nDocusaurus storage APIs are not supposed to be called on the server-rendering process.\nPlease only call storage APIs in effects and event handlers.`)}return{get:t,set:t,del:t}}(e);const n=a(null==t?void 0:t.persistence);return null===n?i:{get:()=>{try{return n.getItem(e)}catch(t){return console.error(`Docusaurus storage error, can't get key=${e}`,t),null}},set:t=>{try{n.setItem(e,t)}catch(r){console.error(`Docusaurus storage error, can't set ${e}=${t}`,r)}},del:()=>{try{n.removeItem(e)}catch(t){console.error(`Docusaurus storage error, can't delete key=${e}`,t)}}}}function s(e){void 0===e&&(e=r);const t=a(e);if(!t)return[];const n=[];for(let r=0;r{"use strict";n.d(t,{l:()=>o});var r=n(2263),a=n(6775);function o(){const{siteConfig:{baseUrl:e,url:t},i18n:{defaultLocale:n,currentLocale:o}}=(0,r.Z)(),{pathname:i}=(0,a.TH)(),l=o===n?e:e.replace(`/${o}/`,"/"),s=i.replace(e,"");return{createUrl:function(e){let{locale:r,fullyQualified:a}=e;return`${a?t:""}${function(e){return e===n?`${l}`:`${l}${e}/`}(r)}${s}`}}}},5936:(e,t,n)=>{"use strict";n.d(t,{S:()=>i});var r=n(7294),a=n(6775),o=n(902);function i(e){const t=(0,a.TH)(),n=(0,o.D9)(t),i=(0,o.zX)(e);(0,r.useEffect)((()=>{n&&t!==n&&i({location:t,previousLocation:n})}),[i,t,n])}},6668:(e,t,n)=>{"use strict";n.d(t,{L:()=>a});var r=n(2263);function a(){return(0,r.Z)().siteConfig.themeConfig}},8802:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){const{trailingSlash:n,baseUrl:r}=t;if(e.startsWith("#"))return e;if(void 0===n)return e;const[a]=e.split(/[#?]/),o="/"===a||a===r?a:(i=a,n?function(e){return e.endsWith("/")?e:`${e}/`}(i):function(e){return e.endsWith("/")?e.slice(0,-1):e}(i));var i;return e.replace(a,o)}},8780:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.applyTrailingSlash=t.blogPostContainerID=void 0,t.blogPostContainerID="post-content";var a=n(8802);Object.defineProperty(t,"applyTrailingSlash",{enumerable:!0,get:function(){return r(a).default}})},6010:(e,t,n)=>{"use strict";function r(e){var t,n,a="";if("string"==typeof e||"number"==typeof e)a+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;ta});const a=function(){for(var e,t,n=0,a="";n{"use strict";n.d(t,{lX:()=>w,q_:()=>T,ob:()=>f,PP:()=>A,Ep:()=>p});var r=n(7462);function a(e){return"/"===e.charAt(0)}function o(e,t){for(var n=t,r=n+1,a=e.length;r=0;p--){var f=i[p];"."===f?o(i,p):".."===f?(o(i,p),d++):d&&(o(i,p),d--)}if(!c)for(;d--;d)i.unshift("..");!c||""===i[0]||i[0]&&a(i[0])||i.unshift("");var m=i.join("/");return n&&"/"!==m.substr(-1)&&(m+="/"),m};var l=n(2177);function s(e){return"/"===e.charAt(0)?e:"/"+e}function c(e){return"/"===e.charAt(0)?e.substr(1):e}function u(e,t){return function(e,t){return 0===e.toLowerCase().indexOf(t.toLowerCase())&&-1!=="/?#".indexOf(e.charAt(t.length))}(e,t)?e.substr(t.length):e}function d(e){return"/"===e.charAt(e.length-1)?e.slice(0,-1):e}function p(e){var t=e.pathname,n=e.search,r=e.hash,a=t||"/";return n&&"?"!==n&&(a+="?"===n.charAt(0)?n:"?"+n),r&&"#"!==r&&(a+="#"===r.charAt(0)?r:"#"+r),a}function f(e,t,n,a){var o;"string"==typeof e?(o=function(e){var t=e||"/",n="",r="",a=t.indexOf("#");-1!==a&&(r=t.substr(a),t=t.substr(0,a));var o=t.indexOf("?");return-1!==o&&(n=t.substr(o),t=t.substr(0,o)),{pathname:t,search:"?"===n?"":n,hash:"#"===r?"":r}}(e),o.state=t):(void 0===(o=(0,r.Z)({},e)).pathname&&(o.pathname=""),o.search?"?"!==o.search.charAt(0)&&(o.search="?"+o.search):o.search="",o.hash?"#"!==o.hash.charAt(0)&&(o.hash="#"+o.hash):o.hash="",void 0!==t&&void 0===o.state&&(o.state=t));try{o.pathname=decodeURI(o.pathname)}catch(l){throw l instanceof URIError?new URIError('Pathname "'+o.pathname+'" could not be decoded. This is likely caused by an invalid percent-encoding.'):l}return n&&(o.key=n),a?o.pathname?"/"!==o.pathname.charAt(0)&&(o.pathname=i(o.pathname,a.pathname)):o.pathname=a.pathname:o.pathname||(o.pathname="/"),o}function m(){var e=null;var t=[];return{setPrompt:function(t){return e=t,function(){e===t&&(e=null)}},confirmTransitionTo:function(t,n,r,a){if(null!=e){var o="function"==typeof e?e(t,n):e;"string"==typeof o?"function"==typeof r?r(o,a):a(!0):a(!1!==o)}else a(!0)},appendListener:function(e){var n=!0;function r(){n&&e.apply(void 0,arguments)}return t.push(r),function(){n=!1,t=t.filter((function(e){return e!==r}))}},notifyListeners:function(){for(var e=arguments.length,n=new Array(e),r=0;rt?n.splice(t,n.length-t,a):n.push(a),d({action:r,location:a,index:t,entries:n})}}))},replace:function(e,t){var r="REPLACE",a=f(e,t,g(),w.location);u.confirmTransitionTo(a,r,n,(function(e){e&&(w.entries[w.index]=a,d({action:r,location:a}))}))},go:y,goBack:function(){y(-1)},goForward:function(){y(1)},canGo:function(e){var t=w.index+e;return t>=0&&t{"use strict";var r=n(9864),a={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},o={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},i={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},l={};function s(e){return r.isMemo(e)?i:l[e.$$typeof]||a}l[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},l[r.Memo]=i;var c=Object.defineProperty,u=Object.getOwnPropertyNames,d=Object.getOwnPropertySymbols,p=Object.getOwnPropertyDescriptor,f=Object.getPrototypeOf,m=Object.prototype;e.exports=function e(t,n,r){if("string"!=typeof n){if(m){var a=f(n);a&&a!==m&&e(t,a,r)}var i=u(n);d&&(i=i.concat(d(n)));for(var l=s(t),g=s(n),h=0;h{"use strict";e.exports=function(e,t,n,r,a,o,i,l){if(!e){var s;if(void 0===t)s=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[n,r,a,o,i,l],u=0;(s=new Error(t.replace(/%s/g,(function(){return c[u++]})))).name="Invariant Violation"}throw s.framesToPop=1,s}}},5826:e=>{e.exports=Array.isArray||function(e){return"[object Array]"==Object.prototype.toString.call(e)}},2497:(e,t,n)=>{"use strict";n.r(t)},2295:(e,t,n)=>{"use strict";n.r(t)},4865:function(e,t,n){var r,a;r=function(){var e,t,n={version:"0.2.0"},r=n.settings={minimum:.08,easing:"ease",positionUsing:"",speed:200,trickle:!0,trickleRate:.02,trickleSpeed:800,showSpinner:!0,barSelector:'[role="bar"]',spinnerSelector:'[role="spinner"]',parent:"body",template:'
'};function a(e,t,n){return en?n:e}function o(e){return 100*(-1+e)}function i(e,t,n){var a;return(a="translate3d"===r.positionUsing?{transform:"translate3d("+o(e)+"%,0,0)"}:"translate"===r.positionUsing?{transform:"translate("+o(e)+"%,0)"}:{"margin-left":o(e)+"%"}).transition="all "+t+"ms "+n,a}n.configure=function(e){var t,n;for(t in e)void 0!==(n=e[t])&&e.hasOwnProperty(t)&&(r[t]=n);return this},n.status=null,n.set=function(e){var t=n.isStarted();e=a(e,r.minimum,1),n.status=1===e?null:e;var o=n.render(!t),c=o.querySelector(r.barSelector),u=r.speed,d=r.easing;return o.offsetWidth,l((function(t){""===r.positionUsing&&(r.positionUsing=n.getPositioningCSS()),s(c,i(e,u,d)),1===e?(s(o,{transition:"none",opacity:1}),o.offsetWidth,setTimeout((function(){s(o,{transition:"all "+u+"ms linear",opacity:0}),setTimeout((function(){n.remove(),t()}),u)}),u)):setTimeout(t,u)})),this},n.isStarted=function(){return"number"==typeof n.status},n.start=function(){n.status||n.set(0);var e=function(){setTimeout((function(){n.status&&(n.trickle(),e())}),r.trickleSpeed)};return r.trickle&&e(),this},n.done=function(e){return e||n.status?n.inc(.3+.5*Math.random()).set(1):this},n.inc=function(e){var t=n.status;return t?("number"!=typeof e&&(e=(1-t)*a(Math.random()*t,.1,.95)),t=a(t+e,0,.994),n.set(t)):n.start()},n.trickle=function(){return n.inc(Math.random()*r.trickleRate)},e=0,t=0,n.promise=function(r){return r&&"resolved"!==r.state()?(0===t&&n.start(),e++,t++,r.always((function(){0==--t?(e=0,n.done()):n.set((e-t)/e)})),this):this},n.render=function(e){if(n.isRendered())return document.getElementById("nprogress");u(document.documentElement,"nprogress-busy");var t=document.createElement("div");t.id="nprogress",t.innerHTML=r.template;var a,i=t.querySelector(r.barSelector),l=e?"-100":o(n.status||0),c=document.querySelector(r.parent);return s(i,{transition:"all 0 linear",transform:"translate3d("+l+"%,0,0)"}),r.showSpinner||(a=t.querySelector(r.spinnerSelector))&&f(a),c!=document.body&&u(c,"nprogress-custom-parent"),c.appendChild(t),t},n.remove=function(){d(document.documentElement,"nprogress-busy"),d(document.querySelector(r.parent),"nprogress-custom-parent");var e=document.getElementById("nprogress");e&&f(e)},n.isRendered=function(){return!!document.getElementById("nprogress")},n.getPositioningCSS=function(){var e=document.body.style,t="WebkitTransform"in e?"Webkit":"MozTransform"in e?"Moz":"msTransform"in e?"ms":"OTransform"in e?"O":"";return t+"Perspective"in e?"translate3d":t+"Transform"in e?"translate":"margin"};var l=function(){var e=[];function t(){var n=e.shift();n&&n(t)}return function(n){e.push(n),1==e.length&&t()}}(),s=function(){var e=["Webkit","O","Moz","ms"],t={};function n(e){return e.replace(/^-ms-/,"ms-").replace(/-([\da-z])/gi,(function(e,t){return t.toUpperCase()}))}function r(t){var n=document.body.style;if(t in n)return t;for(var r,a=e.length,o=t.charAt(0).toUpperCase()+t.slice(1);a--;)if((r=e[a]+o)in n)return r;return t}function a(e){return e=n(e),t[e]||(t[e]=r(e))}function o(e,t,n){t=a(t),e.style[t]=n}return function(e,t){var n,r,a=arguments;if(2==a.length)for(n in t)void 0!==(r=t[n])&&t.hasOwnProperty(n)&&o(e,n,r);else o(e,a[1],a[2])}}();function c(e,t){return("string"==typeof e?e:p(e)).indexOf(" "+t+" ")>=0}function u(e,t){var n=p(e),r=n+t;c(n,t)||(e.className=r.substring(1))}function d(e,t){var n,r=p(e);c(e,t)&&(n=r.replace(" "+t+" "," "),e.className=n.substring(1,n.length-1))}function p(e){return(" "+(e.className||"")+" ").replace(/\s+/gi," ")}function f(e){e&&e.parentNode&&e.parentNode.removeChild(e)}return n},void 0===(a="function"==typeof r?r.call(t,n,t,e):r)||(e.exports=a)},7418:e=>{"use strict";var t=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;function a(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(a){return!1}}()?Object.assign:function(e,o){for(var i,l,s=a(e),c=1;c{"use strict";n.d(t,{Z:()=>o});var r=function(){var e=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,t=0,n={},r={util:{encode:function e(t){return t instanceof a?new a(t.type,e(t.content),t.alias):Array.isArray(t)?t.map(e):t.replace(/&/g,"&").replace(/=d.reach);E+=S.value.length,S=S.next){var x=S.value;if(t.length>e.length)return;if(!(x instanceof a)){var _,T=1;if(v){if(!(_=o(k,E,e,b))||_.index>=e.length)break;var C=_.index,A=_.index+_[0].length,L=E;for(L+=S.value.length;C>=L;)L+=(S=S.next).value.length;if(E=L-=S.value.length,S.value instanceof a)continue;for(var R=S;R!==t.tail&&(Ld.reach&&(d.reach=I);var D=S.prev;if(O&&(D=s(t,D,O),E+=O.length),c(t,D,T),S=s(t,D,new a(p,h?r.tokenize(P,h):P,y,P)),N&&s(t,S,N),T>1){var M={cause:p+","+m,reach:I};i(e,t,n,S.prev,E,M),d&&M.reach>d.reach&&(d.reach=M.reach)}}}}}}function l(){var e={value:null,prev:null,next:null},t={value:null,prev:e,next:null};e.next=t,this.head=e,this.tail=t,this.length=0}function s(e,t,n){var r=t.next,a={value:n,prev:t,next:r};return t.next=a,r.prev=a,e.length++,a}function c(e,t,n){for(var r=t.next,a=0;a"+o.content+""},r}(),a=r;r.default=r,a.languages.markup={comment:{pattern://,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern://i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},a.languages.markup.tag.inside["attr-value"].inside.entity=a.languages.markup.entity,a.languages.markup.doctype.inside["internal-subset"].inside=a.languages.markup,a.hooks.add("wrap",(function(e){"entity"===e.type&&(e.attributes.title=e.content.replace(/&/,"&"))})),Object.defineProperty(a.languages.markup.tag,"addInlined",{value:function(e,t){var n={};n["language-"+t]={pattern:/(^$)/i,lookbehind:!0,inside:a.languages[t]},n.cdata=/^$/i;var r={"included-cdata":{pattern://i,inside:n}};r["language-"+t]={pattern:/[\s\S]+/,inside:a.languages[t]};var o={};o[e]={pattern:RegExp(/(<__[^>]*>)(?:))*\]\]>|(?!)/.source.replace(/__/g,(function(){return e})),"i"),lookbehind:!0,greedy:!0,inside:r},a.languages.insertBefore("markup","cdata",o)}}),Object.defineProperty(a.languages.markup.tag,"addAttribute",{value:function(e,t){a.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+e+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[t,"language-"+t],inside:a.languages[t]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),a.languages.html=a.languages.markup,a.languages.mathml=a.languages.markup,a.languages.svg=a.languages.markup,a.languages.xml=a.languages.extend("markup",{}),a.languages.ssml=a.languages.xml,a.languages.atom=a.languages.xml,a.languages.rss=a.languages.xml,function(e){var t="\\b(?:BASH|BASHOPTS|BASH_ALIASES|BASH_ARGC|BASH_ARGV|BASH_CMDS|BASH_COMPLETION_COMPAT_DIR|BASH_LINENO|BASH_REMATCH|BASH_SOURCE|BASH_VERSINFO|BASH_VERSION|COLORTERM|COLUMNS|COMP_WORDBREAKS|DBUS_SESSION_BUS_ADDRESS|DEFAULTS_PATH|DESKTOP_SESSION|DIRSTACK|DISPLAY|EUID|GDMSESSION|GDM_LANG|GNOME_KEYRING_CONTROL|GNOME_KEYRING_PID|GPG_AGENT_INFO|GROUPS|HISTCONTROL|HISTFILE|HISTFILESIZE|HISTSIZE|HOME|HOSTNAME|HOSTTYPE|IFS|INSTANCE|JOB|LANG|LANGUAGE|LC_ADDRESS|LC_ALL|LC_IDENTIFICATION|LC_MEASUREMENT|LC_MONETARY|LC_NAME|LC_NUMERIC|LC_PAPER|LC_TELEPHONE|LC_TIME|LESSCLOSE|LESSOPEN|LINES|LOGNAME|LS_COLORS|MACHTYPE|MAILCHECK|MANDATORY_PATH|NO_AT_BRIDGE|OLDPWD|OPTERR|OPTIND|ORBIT_SOCKETDIR|OSTYPE|PAPERSIZE|PATH|PIPESTATUS|PPID|PS1|PS2|PS3|PS4|PWD|RANDOM|REPLY|SECONDS|SELINUX_INIT|SESSION|SESSIONTYPE|SESSION_MANAGER|SHELL|SHELLOPTS|SHLVL|SSH_AUTH_SOCK|TERM|UID|UPSTART_EVENTS|UPSTART_INSTANCE|UPSTART_JOB|UPSTART_SESSION|USER|WINDOWID|XAUTHORITY|XDG_CONFIG_DIRS|XDG_CURRENT_DESKTOP|XDG_DATA_DIRS|XDG_GREETER_DATA_DIR|XDG_MENU_PREFIX|XDG_RUNTIME_DIR|XDG_SEAT|XDG_SEAT_PATH|XDG_SESSION_DESKTOP|XDG_SESSION_ID|XDG_SESSION_PATH|XDG_SESSION_TYPE|XDG_VTNR|XMODIFIERS)\\b",n={pattern:/(^(["']?)\w+\2)[ \t]+\S.*/,lookbehind:!0,alias:"punctuation",inside:null},r={bash:n,environment:{pattern:RegExp("\\$"+t),alias:"constant"},variable:[{pattern:/\$?\(\([\s\S]+?\)\)/,greedy:!0,inside:{variable:[{pattern:/(^\$\(\([\s\S]+)\)\)/,lookbehind:!0},/^\$\(\(/],number:/\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee]-?\d+)?/,operator:/--|\+\+|\*\*=?|<<=?|>>=?|&&|\|\||[=!+\-*/%<>^&|]=?|[?~:]/,punctuation:/\(\(?|\)\)?|,|;/}},{pattern:/\$\((?:\([^)]+\)|[^()])+\)|`[^`]+`/,greedy:!0,inside:{variable:/^\$\(|^`|\)$|`$/}},{pattern:/\$\{[^}]+\}/,greedy:!0,inside:{operator:/:[-=?+]?|[!\/]|##?|%%?|\^\^?|,,?/,punctuation:/[\[\]]/,environment:{pattern:RegExp("(\\{)"+t),lookbehind:!0,alias:"constant"}}},/\$(?:\w+|[#?*!@$])/],entity:/\\(?:[abceEfnrtv\\"]|O?[0-7]{1,3}|U[0-9a-fA-F]{8}|u[0-9a-fA-F]{4}|x[0-9a-fA-F]{1,2})/};e.languages.bash={shebang:{pattern:/^#!\s*\/.*/,alias:"important"},comment:{pattern:/(^|[^"{\\$])#.*/,lookbehind:!0},"function-name":[{pattern:/(\bfunction\s+)[\w-]+(?=(?:\s*\(?:\s*\))?\s*\{)/,lookbehind:!0,alias:"function"},{pattern:/\b[\w-]+(?=\s*\(\s*\)\s*\{)/,alias:"function"}],"for-or-select":{pattern:/(\b(?:for|select)\s+)\w+(?=\s+in\s)/,alias:"variable",lookbehind:!0},"assign-left":{pattern:/(^|[\s;|&]|[<>]\()\w+(?=\+?=)/,inside:{environment:{pattern:RegExp("(^|[\\s;|&]|[<>]\\()"+t),lookbehind:!0,alias:"constant"}},alias:"variable",lookbehind:!0},string:[{pattern:/((?:^|[^<])<<-?\s*)(\w+)\s[\s\S]*?(?:\r?\n|\r)\2/,lookbehind:!0,greedy:!0,inside:r},{pattern:/((?:^|[^<])<<-?\s*)(["'])(\w+)\2\s[\s\S]*?(?:\r?\n|\r)\3/,lookbehind:!0,greedy:!0,inside:{bash:n}},{pattern:/(^|[^\\](?:\\\\)*)"(?:\\[\s\S]|\$\([^)]+\)|\$(?!\()|`[^`]+`|[^"\\`$])*"/,lookbehind:!0,greedy:!0,inside:r},{pattern:/(^|[^$\\])'[^']*'/,lookbehind:!0,greedy:!0},{pattern:/\$'(?:[^'\\]|\\[\s\S])*'/,greedy:!0,inside:{entity:r.entity}}],environment:{pattern:RegExp("\\$?"+t),alias:"constant"},variable:r.variable,function:{pattern:/(^|[\s;|&]|[<>]\()(?:add|apropos|apt|apt-cache|apt-get|aptitude|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|composer|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|docker|docker-compose|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|ip|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|node|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|podman|podman-compose|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vcpkg|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\s;|&])/,lookbehind:!0},keyword:{pattern:/(^|[\s;|&]|[<>]\()(?:case|do|done|elif|else|esac|fi|for|function|if|in|select|then|until|while)(?=$|[)\s;|&])/,lookbehind:!0},builtin:{pattern:/(^|[\s;|&]|[<>]\()(?:\.|:|alias|bind|break|builtin|caller|cd|command|continue|declare|echo|enable|eval|exec|exit|export|getopts|hash|help|let|local|logout|mapfile|printf|pwd|read|readarray|readonly|return|set|shift|shopt|source|test|times|trap|type|typeset|ulimit|umask|unalias|unset)(?=$|[)\s;|&])/,lookbehind:!0,alias:"class-name"},boolean:{pattern:/(^|[\s;|&]|[<>]\()(?:false|true)(?=$|[)\s;|&])/,lookbehind:!0},"file-descriptor":{pattern:/\B&\d\b/,alias:"important"},operator:{pattern:/\d?<>|>\||\+=|=[=~]?|!=?|<<[<-]?|[&\d]?>>|\d[<>]&?|[<>][&=]?|&[>&]?|\|[&|]?/,inside:{"file-descriptor":{pattern:/^\d/,alias:"important"}}},punctuation:/\$?\(\(?|\)\)?|\.\.|[{}[\];\\]/,number:{pattern:/(^|\s)(?:[1-9]\d*|0)(?:[.,]\d+)?\b/,lookbehind:!0}},n.inside=e.languages.bash;for(var a=["comment","function-name","for-or-select","assign-left","string","environment","function","keyword","builtin","boolean","file-descriptor","operator","punctuation","number"],o=r.variable[1].inside,i=0;i]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},a.languages.c=a.languages.extend("clike",{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,lookbehind:!0},keyword:/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/}),a.languages.insertBefore("c","string",{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}}),a.languages.insertBefore("c","string",{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:"property",inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},a.languages.c.string],char:a.languages.c.char,comment:a.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:"function"}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:"keyword"},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:a.languages.c}}}}),a.languages.insertBefore("c","function",{constant:/\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/}),delete a.languages.c.boolean,function(e){var t=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,n=/\b(?!)\w+(?:\s*\.\s*\w+)*\b/.source.replace(//g,(function(){return t.source}));e.languages.cpp=e.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!)\w+/.source.replace(//g,(function(){return t.source}))),lookbehind:!0},/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,/\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/],keyword:t,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,greedy:!0},operator:/>>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:false|true)\b/}),e.languages.insertBefore("cpp","string",{module:{pattern:RegExp(/(\b(?:import|module)\s+)/.source+"(?:"+/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|<[^<>\r\n]*>/.source+"|"+/(?:\s*:\s*)?|:\s*/.source.replace(//g,(function(){return n}))+")"),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:"string",greedy:!0}}),e.languages.insertBefore("cpp","keyword",{"generic-function":{pattern:/\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,inside:{function:/^\w+/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:e.languages.cpp}}}}),e.languages.insertBefore("cpp","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}}),e.languages.insertBefore("cpp","class-name",{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:e.languages.extend("cpp",{})}}),e.languages.insertBefore("inside","double-colon",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},e.languages.cpp["base-clause"])}(a),function(e){var t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:/@[\w-](?:[^;{\s]|\s+(?![\s{]))*(?:;|(?=\s*\{))/,inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+t.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+t.source+"$"),alias:"url"}}},selector:{pattern:RegExp("(^|[{}\\s])[^{}\\s](?:[^{};\"'\\s]|\\s+(?![\\s{])|"+t.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:t,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css;var n=e.languages.markup;n&&(n.tag.addInlined("style","css"),n.tag.addAttribute("style","css"))}(a),function(e){var t,n=/("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/;e.languages.css.selector={pattern:e.languages.css.selector.pattern,lookbehind:!0,inside:t={"pseudo-element":/:(?:after|before|first-letter|first-line|selection)|::[-\w]+/,"pseudo-class":/:[-\w]+/,class:/\.[-\w]+/,id:/#[-\w]+/,attribute:{pattern:RegExp("\\[(?:[^[\\]\"']|"+n.source+")*\\]"),greedy:!0,inside:{punctuation:/^\[|\]$/,"case-sensitivity":{pattern:/(\s)[si]$/i,lookbehind:!0,alias:"keyword"},namespace:{pattern:/^(\s*)(?:(?!\s)[-*\w\xA0-\uFFFF])*\|(?!=)/,lookbehind:!0,inside:{punctuation:/\|$/}},"attr-name":{pattern:/^(\s*)(?:(?!\s)[-\w\xA0-\uFFFF])+/,lookbehind:!0},"attr-value":[n,{pattern:/(=\s*)(?:(?!\s)[-\w\xA0-\uFFFF])+(?=\s*$)/,lookbehind:!0}],operator:/[|~*^$]?=/}},"n-th":[{pattern:/(\(\s*)[+-]?\d*[\dn](?:\s*[+-]\s*\d+)?(?=\s*\))/,lookbehind:!0,inside:{number:/[\dn]+/,operator:/[+-]/}},{pattern:/(\(\s*)(?:even|odd)(?=\s*\))/i,lookbehind:!0}],combinator:/>|\+|~|\|\|/,punctuation:/[(),]/}},e.languages.css.atrule.inside["selector-function-argument"].inside=t,e.languages.insertBefore("css","property",{variable:{pattern:/(^|[^-\w\xA0-\uFFFF])--(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*/i,lookbehind:!0}});var r={pattern:/(\b\d+)(?:%|[a-z]+(?![\w-]))/,lookbehind:!0},a={pattern:/(^|[^\w.-])-?(?:\d+(?:\.\d+)?|\.\d+)/,lookbehind:!0};e.languages.insertBefore("css","function",{operator:{pattern:/(\s)[+\-*\/](?=\s)/,lookbehind:!0},hexcode:{pattern:/\B#[\da-f]{3,8}\b/i,alias:"color"},color:[{pattern:/(^|[^\w-])(?:AliceBlue|AntiqueWhite|Aqua|Aquamarine|Azure|Beige|Bisque|Black|BlanchedAlmond|Blue|BlueViolet|Brown|BurlyWood|CadetBlue|Chartreuse|Chocolate|Coral|CornflowerBlue|Cornsilk|Crimson|Cyan|DarkBlue|DarkCyan|DarkGoldenRod|DarkGr[ae]y|DarkGreen|DarkKhaki|DarkMagenta|DarkOliveGreen|DarkOrange|DarkOrchid|DarkRed|DarkSalmon|DarkSeaGreen|DarkSlateBlue|DarkSlateGr[ae]y|DarkTurquoise|DarkViolet|DeepPink|DeepSkyBlue|DimGr[ae]y|DodgerBlue|FireBrick|FloralWhite|ForestGreen|Fuchsia|Gainsboro|GhostWhite|Gold|GoldenRod|Gr[ae]y|Green|GreenYellow|HoneyDew|HotPink|IndianRed|Indigo|Ivory|Khaki|Lavender|LavenderBlush|LawnGreen|LemonChiffon|LightBlue|LightCoral|LightCyan|LightGoldenRodYellow|LightGr[ae]y|LightGreen|LightPink|LightSalmon|LightSeaGreen|LightSkyBlue|LightSlateGr[ae]y|LightSteelBlue|LightYellow|Lime|LimeGreen|Linen|Magenta|Maroon|MediumAquaMarine|MediumBlue|MediumOrchid|MediumPurple|MediumSeaGreen|MediumSlateBlue|MediumSpringGreen|MediumTurquoise|MediumVioletRed|MidnightBlue|MintCream|MistyRose|Moccasin|NavajoWhite|Navy|OldLace|Olive|OliveDrab|Orange|OrangeRed|Orchid|PaleGoldenRod|PaleGreen|PaleTurquoise|PaleVioletRed|PapayaWhip|PeachPuff|Peru|Pink|Plum|PowderBlue|Purple|Red|RosyBrown|RoyalBlue|SaddleBrown|Salmon|SandyBrown|SeaGreen|SeaShell|Sienna|Silver|SkyBlue|SlateBlue|SlateGr[ae]y|Snow|SpringGreen|SteelBlue|Tan|Teal|Thistle|Tomato|Transparent|Turquoise|Violet|Wheat|White|WhiteSmoke|Yellow|YellowGreen)(?![\w-])/i,lookbehind:!0},{pattern:/\b(?:hsl|rgb)\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*\)\B|\b(?:hsl|rgb)a\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*,\s*(?:0|0?\.\d+|1)\s*\)\B/i,inside:{unit:r,number:a,function:/[\w-]+(?=\()/,punctuation:/[(),]/}}],entity:/\\[\da-f]{1,8}/i,unit:r,number:a})}(a),a.languages.javascript=a.languages.extend("clike",{"class-name":[a.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),a.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,a.languages.insertBefore("javascript","keyword",{regex:{pattern:/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)\/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/,lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:a.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:a.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:a.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:a.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:a.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),a.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:a.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),a.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),a.languages.markup&&(a.languages.markup.tag.addInlined("script","javascript"),a.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),a.languages.js=a.languages.javascript,function(e){var t=/#(?!\{).+/,n={pattern:/#\{[^}]+\}/,alias:"variable"};e.languages.coffeescript=e.languages.extend("javascript",{comment:t,string:[{pattern:/'(?:\\[\s\S]|[^\\'])*'/,greedy:!0},{pattern:/"(?:\\[\s\S]|[^\\"])*"/,greedy:!0,inside:{interpolation:n}}],keyword:/\b(?:and|break|by|catch|class|continue|debugger|delete|do|each|else|extend|extends|false|finally|for|if|in|instanceof|is|isnt|let|loop|namespace|new|no|not|null|of|off|on|or|own|return|super|switch|then|this|throw|true|try|typeof|undefined|unless|until|when|while|window|with|yes|yield)\b/,"class-member":{pattern:/@(?!\d)\w+/,alias:"variable"}}),e.languages.insertBefore("coffeescript","comment",{"multiline-comment":{pattern:/###[\s\S]+?###/,alias:"comment"},"block-regex":{pattern:/\/{3}[\s\S]*?\/{3}/,alias:"regex",inside:{comment:t,interpolation:n}}}),e.languages.insertBefore("coffeescript","string",{"inline-javascript":{pattern:/`(?:\\[\s\S]|[^\\`])*`/,inside:{delimiter:{pattern:/^`|`$/,alias:"punctuation"},script:{pattern:/[\s\S]+/,alias:"language-javascript",inside:e.languages.javascript}}},"multiline-string":[{pattern:/'''[\s\S]*?'''/,greedy:!0,alias:"string"},{pattern:/"""[\s\S]*?"""/,greedy:!0,alias:"string",inside:{interpolation:n}}]}),e.languages.insertBefore("coffeescript","keyword",{property:/(?!\d)\w+(?=\s*:(?!:))/}),delete e.languages.coffeescript["template-string"],e.languages.coffee=e.languages.coffeescript}(a),function(e){var t=/[*&][^\s[\]{},]+/,n=/!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/,r="(?:"+n.source+"(?:[ \t]+"+t.source+")?|"+t.source+"(?:[ \t]+"+n.source+")?)",a=/(?:[^\s\x00-\x08\x0e-\x1f!"#%&'*,\-:>?@[\]`{|}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]|[?:-])(?:[ \t]*(?:(?![#:])|:))*/.source.replace(//g,(function(){return/[^\s\x00-\x08\x0e-\x1f,[\]{}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]/.source})),o=/"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\\\r\n]|\\.)*'/.source;function i(e,t){t=(t||"").replace(/m/g,"")+"m";var n=/([:\-,[{]\s*(?:\s<>[ \t]+)?)(?:<>)(?=[ \t]*(?:$|,|\]|\}|(?:[\r\n]\s*)?#))/.source.replace(/<>/g,(function(){return r})).replace(/<>/g,(function(){return e}));return RegExp(n,t)}e.languages.yaml={scalar:{pattern:RegExp(/([\-:]\s*(?:\s<>[ \t]+)?[|>])[ \t]*(?:((?:\r?\n|\r)[ \t]+)\S[^\r\n]*(?:\2[^\r\n]+)*)/.source.replace(/<>/g,(function(){return r}))),lookbehind:!0,alias:"string"},comment:/#.*/,key:{pattern:RegExp(/((?:^|[:\-,[{\r\n?])[ \t]*(?:<>[ \t]+)?)<>(?=\s*:\s)/.source.replace(/<>/g,(function(){return r})).replace(/<>/g,(function(){return"(?:"+a+"|"+o+")"}))),lookbehind:!0,greedy:!0,alias:"atrule"},directive:{pattern:/(^[ \t]*)%.+/m,lookbehind:!0,alias:"important"},datetime:{pattern:i(/\d{4}-\d\d?-\d\d?(?:[tT]|[ \t]+)\d\d?:\d{2}:\d{2}(?:\.\d*)?(?:[ \t]*(?:Z|[-+]\d\d?(?::\d{2})?))?|\d{4}-\d{2}-\d{2}|\d\d?:\d{2}(?::\d{2}(?:\.\d*)?)?/.source),lookbehind:!0,alias:"number"},boolean:{pattern:i(/false|true/.source,"i"),lookbehind:!0,alias:"important"},null:{pattern:i(/null|~/.source,"i"),lookbehind:!0,alias:"important"},string:{pattern:i(o),lookbehind:!0,greedy:!0},number:{pattern:i(/[+-]?(?:0x[\da-f]+|0o[0-7]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?|\.inf|\.nan)/.source,"i"),lookbehind:!0},tag:n,important:t,punctuation:/---|[:[\]{}\-,|>?]|\.\.\./},e.languages.yml=e.languages.yaml}(a),function(e){var t=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function n(e){return e=e.replace(//g,(function(){return t})),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+e+")")}var r=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,a=/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g,(function(){return r})),o=/\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source;e.languages.markdown=e.languages.extend("markup",{}),e.languages.insertBefore("markdown","prolog",{"front-matter-block":{pattern:/(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,lookbehind:!0,greedy:!0,inside:{punctuation:/^---|---$/,"front-matter":{pattern:/\S+(?:\s+\S+)*/,alias:["yaml","language-yaml"],inside:e.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},table:{pattern:RegExp("^"+a+o+"(?:"+a+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+a+o+")(?:"+a+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(r),inside:e.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+a+")"+o+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+a+"$"),inside:{"table-header":{pattern:RegExp(r),alias:"important",inside:e.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,lookbehind:!0,alias:"keyword"},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,alias:"important",inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#.+/m,lookbehind:!0,alias:"important",inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:"punctuation"},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:"punctuation"},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:"url"},bold:{pattern:n(/\b__(?:(?!_)|_(?:(?!_))+_)+__\b|\*\*(?:(?!\*)|\*(?:(?!\*))+\*)+\*\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:n(/\b_(?:(?!_)|__(?:(?!_))+__)+_\b|\*(?:(?!\*)|\*\*(?:(?!\*))+\*\*)+\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:n(/(~~?)(?:(?!~))+\2/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},"code-snippet":{pattern:/(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,lookbehind:!0,greedy:!0,alias:["code","keyword"]},url:{pattern:n(/!?\[(?:(?!\]))+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)|[ \t]?\[(?:(?!\]))+\])/.source),lookbehind:!0,greedy:!0,inside:{operator:/^!/,content:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},variable:{pattern:/(^\][ \t]?\[)[^\]]+(?=\]$)/,lookbehind:!0},url:{pattern:/(^\]\()[^\s)]+/,lookbehind:!0},string:{pattern:/(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,lookbehind:!0}}}}),["url","bold","italic","strike"].forEach((function(t){["url","bold","italic","strike","code-snippet"].forEach((function(n){t!==n&&(e.languages.markdown[t].inside.content.inside[n]=e.languages.markdown[n])}))})),e.hooks.add("after-tokenize",(function(e){"markdown"!==e.language&&"md"!==e.language||function e(t){if(t&&"string"!=typeof t)for(var n=0,r=t.length;n",quot:'"'},s=String.fromCodePoint||String.fromCharCode;e.languages.md=e.languages.markdown}(a),a.languages.graphql={comment:/#.*/,description:{pattern:/(?:"""(?:[^"]|(?!""")")*"""|"(?:\\.|[^\\"\r\n])*")(?=\s*[a-z_])/i,greedy:!0,alias:"string",inside:{"language-markdown":{pattern:/(^"(?:"")?)(?!\1)[\s\S]+(?=\1$)/,lookbehind:!0,inside:a.languages.markdown}}},string:{pattern:/"""(?:[^"]|(?!""")")*"""|"(?:\\.|[^\\"\r\n])*"/,greedy:!0},number:/(?:\B-|\b)\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,boolean:/\b(?:false|true)\b/,variable:/\$[a-z_]\w*/i,directive:{pattern:/@[a-z_]\w*/i,alias:"function"},"attr-name":{pattern:/\b[a-z_]\w*(?=\s*(?:\((?:[^()"]|"(?:\\.|[^\\"\r\n])*")*\))?:)/i,greedy:!0},"atom-input":{pattern:/\b[A-Z]\w*Input\b/,alias:"class-name"},scalar:/\b(?:Boolean|Float|ID|Int|String)\b/,constant:/\b[A-Z][A-Z_\d]*\b/,"class-name":{pattern:/(\b(?:enum|implements|interface|on|scalar|type|union)\s+|&\s*|:\s*|\[)[A-Z_]\w*/,lookbehind:!0},fragment:{pattern:/(\bfragment\s+|\.{3}\s*(?!on\b))[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},"definition-mutation":{pattern:/(\bmutation\s+)[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},"definition-query":{pattern:/(\bquery\s+)[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},keyword:/\b(?:directive|enum|extend|fragment|implements|input|interface|mutation|on|query|repeatable|scalar|schema|subscription|type|union)\b/,operator:/[!=|&]|\.{3}/,"property-query":/\w+(?=\s*\()/,object:/\w+(?=\s*\{)/,punctuation:/[!(){}\[\]:=,]/,property:/\w+/},a.hooks.add("after-tokenize",(function(e){if("graphql"===e.language)for(var t=e.tokens.filter((function(e){return"string"!=typeof e&&"comment"!==e.type&&"scalar"!==e.type})),n=0;n0)){var l=p(/^\{$/,/^\}$/);if(-1===l)continue;for(var s=n;s=0&&f(c,"variable-input")}}}}function u(e){return t[n+e]}function d(e,t){t=t||0;for(var n=0;n?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/},function(e){var t=e.languages.javascript["template-string"],n=t.pattern.source,r=t.inside.interpolation,a=r.inside["interpolation-punctuation"],o=r.pattern.source;function i(t,r){if(e.languages[t])return{pattern:RegExp("((?:"+r+")\\s*)"+n),lookbehind:!0,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},"embedded-code":{pattern:/[\s\S]+/,alias:t}}}}function l(e,t){return"___"+t.toUpperCase()+"_"+e+"___"}function s(t,n,r){var a={code:t,grammar:n,language:r};return e.hooks.run("before-tokenize",a),a.tokens=e.tokenize(a.code,a.grammar),e.hooks.run("after-tokenize",a),a.tokens}function c(t){var n={};n["interpolation-punctuation"]=a;var o=e.tokenize(t,n);if(3===o.length){var i=[1,1];i.push.apply(i,s(o[1],e.languages.javascript,"javascript")),o.splice.apply(o,i)}return new e.Token("interpolation",o,r.alias,t)}function u(t,n,r){var a=e.tokenize(t,{interpolation:{pattern:RegExp(o),lookbehind:!0}}),i=0,u={},d=s(a.map((function(e){if("string"==typeof e)return e;for(var n,a=e.content;-1!==t.indexOf(n=l(i++,r)););return u[n]=a,n})).join(""),n,r),p=Object.keys(u);return i=0,function e(t){for(var n=0;n=p.length)return;var r=t[n];if("string"==typeof r||"string"==typeof r.content){var a=p[i],o="string"==typeof r?r:r.content,l=o.indexOf(a);if(-1!==l){++i;var s=o.substring(0,l),d=c(u[a]),f=o.substring(l+a.length),m=[];if(s&&m.push(s),m.push(d),f){var g=[f];e(g),m.push.apply(m,g)}"string"==typeof r?(t.splice.apply(t,[n,1].concat(m)),n+=m.length-1):r.content=m}}else{var h=r.content;Array.isArray(h)?e(h):e([h])}}}(d),new e.Token(r,d,"language-"+r,t)}e.languages.javascript["template-string"]=[i("css",/\b(?:styled(?:\([^)]*\))?(?:\s*\.\s*\w+(?:\([^)]*\))*)*|css(?:\s*\.\s*(?:global|resolve))?|createGlobalStyle|keyframes)/.source),i("html",/\bhtml|\.\s*(?:inner|outer)HTML\s*\+?=/.source),i("svg",/\bsvg/.source),i("markdown",/\b(?:markdown|md)/.source),i("graphql",/\b(?:gql|graphql(?:\s*\.\s*experimental)?)/.source),i("sql",/\bsql/.source),t].filter(Boolean);var d={javascript:!0,js:!0,typescript:!0,ts:!0,jsx:!0,tsx:!0};function p(e){return"string"==typeof e?e:Array.isArray(e)?e.map(p).join(""):p(e.content)}e.hooks.add("after-tokenize",(function(t){t.language in d&&function t(n){for(var r=0,a=n.length;r]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/}),e.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete e.languages.typescript.parameter,delete e.languages.typescript["literal-property"];var t=e.languages.extend("typescript",{});delete t["class-name"],e.languages.typescript["class-name"].inside=t,e.languages.insertBefore("typescript","function",{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:"operator"},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:t}}}}),e.languages.ts=e.languages.typescript}(a),function(e){function t(e,t){return RegExp(e.replace(//g,(function(){return/(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/.source})),t)}e.languages.insertBefore("javascript","function-variable",{"method-variable":{pattern:RegExp("(\\.\\s*)"+e.languages.javascript["function-variable"].pattern.source),lookbehind:!0,alias:["function-variable","method","function","property-access"]}}),e.languages.insertBefore("javascript","function",{method:{pattern:RegExp("(\\.\\s*)"+e.languages.javascript.function.source),lookbehind:!0,alias:["function","property-access"]}}),e.languages.insertBefore("javascript","constant",{"known-class-name":[{pattern:/\b(?:(?:Float(?:32|64)|(?:Int|Uint)(?:8|16|32)|Uint8Clamped)?Array|ArrayBuffer|BigInt|Boolean|DataView|Date|Error|Function|Intl|JSON|(?:Weak)?(?:Map|Set)|Math|Number|Object|Promise|Proxy|Reflect|RegExp|String|Symbol|WebAssembly)\b/,alias:"class-name"},{pattern:/\b(?:[A-Z]\w*)Error\b/,alias:"class-name"}]}),e.languages.insertBefore("javascript","keyword",{imports:{pattern:t(/(\bimport\b\s*)(?:(?:\s*,\s*(?:\*\s*as\s+|\{[^{}]*\}))?|\*\s*as\s+|\{[^{}]*\})(?=\s*\bfrom\b)/.source),lookbehind:!0,inside:e.languages.javascript},exports:{pattern:t(/(\bexport\b\s*)(?:\*(?:\s*as\s+)?(?=\s*\bfrom\b)|\{[^{}]*\})/.source),lookbehind:!0,inside:e.languages.javascript}}),e.languages.javascript.keyword.unshift({pattern:/\b(?:as|default|export|from|import)\b/,alias:"module"},{pattern:/\b(?:await|break|catch|continue|do|else|finally|for|if|return|switch|throw|try|while|yield)\b/,alias:"control-flow"},{pattern:/\bnull\b/,alias:["null","nil"]},{pattern:/\bundefined\b/,alias:"nil"}),e.languages.insertBefore("javascript","operator",{spread:{pattern:/\.{3}/,alias:"operator"},arrow:{pattern:/=>/,alias:"operator"}}),e.languages.insertBefore("javascript","punctuation",{"property-access":{pattern:t(/(\.\s*)#?/.source),lookbehind:!0},"maybe-class-name":{pattern:/(^|[^$\w\xA0-\uFFFF])[A-Z][$\w\xA0-\uFFFF]+/,lookbehind:!0},dom:{pattern:/\b(?:document|(?:local|session)Storage|location|navigator|performance|window)\b/,alias:"variable"},console:{pattern:/\bconsole(?=\s*\.)/,alias:"class-name"}});for(var n=["function","function-variable","method","method-variable","property-access"],r=0;r*\.{3}(?:[^{}]|)*\})/.source;function o(e,t){return e=e.replace(//g,(function(){return n})).replace(//g,(function(){return r})).replace(//g,(function(){return a})),RegExp(e,t)}a=o(a).source,e.languages.jsx=e.languages.extend("markup",t),e.languages.jsx.tag.pattern=o(/<\/?(?:[\w.:-]+(?:+(?:[\w.:$-]+(?:=(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s{'"/>=]+|))?|))**\/?)?>/.source),e.languages.jsx.tag.inside.tag.pattern=/^<\/?[^\s>\/]*/,e.languages.jsx.tag.inside["attr-value"].pattern=/=(?!\{)(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s'">]+)/,e.languages.jsx.tag.inside.tag.inside["class-name"]=/^[A-Z]\w*(?:\.[A-Z]\w*)*$/,e.languages.jsx.tag.inside.comment=t.comment,e.languages.insertBefore("inside","attr-name",{spread:{pattern:o(//.source),inside:e.languages.jsx}},e.languages.jsx.tag),e.languages.insertBefore("inside","special-attr",{script:{pattern:o(/=/.source),alias:"language-javascript",inside:{"script-punctuation":{pattern:/^=(?=\{)/,alias:"punctuation"},rest:e.languages.jsx}}},e.languages.jsx.tag);var i=function(e){return e?"string"==typeof e?e:"string"==typeof e.content?e.content:e.content.map(i).join(""):""},l=function(t){for(var n=[],r=0;r0&&n[n.length-1].tagName===i(a.content[0].content[1])&&n.pop():"/>"===a.content[a.content.length-1].content||n.push({tagName:i(a.content[0].content[1]),openedBraces:0}):n.length>0&&"punctuation"===a.type&&"{"===a.content?n[n.length-1].openedBraces++:n.length>0&&n[n.length-1].openedBraces>0&&"punctuation"===a.type&&"}"===a.content?n[n.length-1].openedBraces--:o=!0),(o||"string"==typeof a)&&n.length>0&&0===n[n.length-1].openedBraces){var s=i(a);r0&&("string"==typeof t[r-1]||"plain-text"===t[r-1].type)&&(s=i(t[r-1])+s,t.splice(r-1,1),r--),t[r]=new e.Token("plain-text",s,null,s)}a.content&&"string"!=typeof a.content&&l(a.content)}};e.hooks.add("after-tokenize",(function(e){"jsx"!==e.language&&"tsx"!==e.language||l(e.tokens)}))}(a),function(e){e.languages.diff={coord:[/^(?:\*{3}|-{3}|\+{3}).*$/m,/^@@.*@@$/m,/^\d.*$/m]};var t={"deleted-sign":"-","deleted-arrow":"<","inserted-sign":"+","inserted-arrow":">",unchanged:" ",diff:"!"};Object.keys(t).forEach((function(n){var r=t[n],a=[];/^\w+$/.test(n)||a.push(/\w+/.exec(n)[0]),"diff"===n&&a.push("bold"),e.languages.diff[n]={pattern:RegExp("^(?:["+r+"].*(?:\r\n?|\n|(?![\\s\\S])))+","m"),alias:a,inside:{line:{pattern:/(.)(?=[\s\S]).*(?:\r\n?|\n)?/,lookbehind:!0},prefix:{pattern:/[\s\S]/,alias:/\w+/.exec(n)[0]}}}})),Object.defineProperty(e.languages.diff,"PREFIXES",{value:t})}(a),a.languages.git={comment:/^#.*/m,deleted:/^[-\u2013].*/m,inserted:/^\+.*/m,string:/("|')(?:\\.|(?!\1)[^\\\r\n])*\1/,command:{pattern:/^.*\$ git .*$/m,inside:{parameter:/\s--?\w+/}},coord:/^@@.*@@$/m,"commit-sha1":/^commit \w{40}$/m},a.languages.go=a.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"|`[^`]*`/,lookbehind:!0,greedy:!0},keyword:/\b(?:break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(?:to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/,boolean:/\b(?:_|false|iota|nil|true)\b/,number:[/\b0(?:b[01_]+|o[0-7_]+)i?\b/i,/\b0x(?:[a-f\d_]+(?:\.[a-f\d_]*)?|\.[a-f\d_]+)(?:p[+-]?\d+(?:_\d+)*)?i?(?!\w)/i,/(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?[\d_]+)?i?(?!\w)/i],operator:/[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./,builtin:/\b(?:append|bool|byte|cap|close|complex|complex(?:64|128)|copy|delete|error|float(?:32|64)|u?int(?:8|16|32|64)?|imag|len|make|new|panic|print(?:ln)?|real|recover|rune|string|uintptr)\b/}),a.languages.insertBefore("go","string",{char:{pattern:/'(?:\\.|[^'\\\r\n]){0,10}'/,greedy:!0}}),delete a.languages.go["class-name"],function(e){function t(e,t){return"___"+e.toUpperCase()+t+"___"}Object.defineProperties(e.languages["markup-templating"]={},{buildPlaceholders:{value:function(n,r,a,o){if(n.language===r){var i=n.tokenStack=[];n.code=n.code.replace(a,(function(e){if("function"==typeof o&&!o(e))return e;for(var a,l=i.length;-1!==n.code.indexOf(a=t(r,l));)++l;return i[l]=e,a})),n.grammar=e.languages.markup}}},tokenizePlaceholders:{value:function(n,r){if(n.language===r&&n.tokenStack){n.grammar=e.languages[r];var a=0,o=Object.keys(n.tokenStack);!function i(l){for(var s=0;s=o.length);s++){var c=l[s];if("string"==typeof c||c.content&&"string"==typeof c.content){var u=o[a],d=n.tokenStack[u],p="string"==typeof c?c:c.content,f=t(r,u),m=p.indexOf(f);if(m>-1){++a;var g=p.substring(0,m),h=new e.Token(r,e.tokenize(d,n.grammar),"language-"+r,d),b=p.substring(m+f.length),v=[];g&&v.push.apply(v,i([g])),v.push(h),b&&v.push.apply(v,i([b])),"string"==typeof c?l.splice.apply(l,[s,1].concat(v)):c.content=v}}else c.content&&i(c.content)}return l}(n.tokens)}}}})}(a),function(e){e.languages.handlebars={comment:/\{\{![\s\S]*?\}\}/,delimiter:{pattern:/^\{\{\{?|\}\}\}?$/,alias:"punctuation"},string:/(["'])(?:\\.|(?!\1)[^\\\r\n])*\1/,number:/\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee][+-]?\d+)?/,boolean:/\b(?:false|true)\b/,block:{pattern:/^(\s*(?:~\s*)?)[#\/]\S+?(?=\s*(?:~\s*)?$|\s)/,lookbehind:!0,alias:"keyword"},brackets:{pattern:/\[[^\]]+\]/,inside:{punctuation:/\[|\]/,variable:/[\s\S]+/}},punctuation:/[!"#%&':()*+,.\/;<=>@\[\\\]^`{|}~]/,variable:/[^!"#%&'()*+,\/;<=>@\[\\\]^`{|}~\s]+/},e.hooks.add("before-tokenize",(function(t){e.languages["markup-templating"].buildPlaceholders(t,"handlebars",/\{\{\{[\s\S]+?\}\}\}|\{\{[\s\S]+?\}\}/g)})),e.hooks.add("after-tokenize",(function(t){e.languages["markup-templating"].tokenizePlaceholders(t,"handlebars")})),e.languages.hbs=e.languages.handlebars}(a),a.languages.json={property:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,lookbehind:!0,greedy:!0},string:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,lookbehind:!0,greedy:!0},comment:{pattern:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},number:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,punctuation:/[{}[\],]/,operator:/:/,boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"}},a.languages.webmanifest=a.languages.json,a.languages.less=a.languages.extend("css",{comment:[/\/\*[\s\S]*?\*\//,{pattern:/(^|[^\\])\/\/.*/,lookbehind:!0}],atrule:{pattern:/@[\w-](?:\((?:[^(){}]|\([^(){}]*\))*\)|[^(){};\s]|\s+(?!\s))*?(?=\s*\{)/,inside:{punctuation:/[:()]/}},selector:{pattern:/(?:@\{[\w-]+\}|[^{};\s@])(?:@\{[\w-]+\}|\((?:[^(){}]|\([^(){}]*\))*\)|[^(){};@\s]|\s+(?!\s))*?(?=\s*\{)/,inside:{variable:/@+[\w-]+/}},property:/(?:@\{[\w-]+\}|[\w-])+(?:\+_?)?(?=\s*:)/,operator:/[+\-*\/]/}),a.languages.insertBefore("less","property",{variable:[{pattern:/@[\w-]+\s*:/,inside:{punctuation:/:/}},/@@?[\w-]+/],"mixin-usage":{pattern:/([{;]\s*)[.#](?!\d)[\w-].*?(?=[(;])/,lookbehind:!0,alias:"function"}}),a.languages.makefile={comment:{pattern:/(^|[^\\])#(?:\\(?:\r\n|[\s\S])|[^\\\r\n])*/,lookbehind:!0},string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"builtin-target":{pattern:/\.[A-Z][^:#=\s]+(?=\s*:(?!=))/,alias:"builtin"},target:{pattern:/^(?:[^:=\s]|[ \t]+(?![\s:]))+(?=\s*:(?!=))/m,alias:"symbol",inside:{variable:/\$+(?:(?!\$)[^(){}:#=\s]+|(?=[({]))/}},variable:/\$+(?:(?!\$)[^(){}:#=\s]+|\([@*%<^+?][DF]\)|(?=[({]))/,keyword:/-include\b|\b(?:define|else|endef|endif|export|ifn?def|ifn?eq|include|override|private|sinclude|undefine|unexport|vpath)\b/,function:{pattern:/(\()(?:abspath|addsuffix|and|basename|call|dir|error|eval|file|filter(?:-out)?|findstring|firstword|flavor|foreach|guile|if|info|join|lastword|load|notdir|or|origin|patsubst|realpath|shell|sort|strip|subst|suffix|value|warning|wildcard|word(?:list|s)?)(?=[ \t])/,lookbehind:!0},operator:/(?:::|[?:+!])?=|[|@]/,punctuation:/[:;(){}]/},a.languages.objectivec=a.languages.extend("c",{string:{pattern:/@?"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},keyword:/\b(?:asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|in|inline|int|long|register|return|self|short|signed|sizeof|static|struct|super|switch|typedef|typeof|union|unsigned|void|volatile|while)\b|(?:@interface|@end|@implementation|@protocol|@class|@public|@protected|@private|@property|@try|@catch|@finally|@throw|@synthesize|@dynamic|@selector)\b/,operator:/-[->]?|\+\+?|!=?|<>?=?|==?|&&?|\|\|?|[~^%?*\/@]/}),delete a.languages.objectivec["class-name"],a.languages.objc=a.languages.objectivec,a.languages.ocaml={comment:{pattern:/\(\*[\s\S]*?\*\)/,greedy:!0},char:{pattern:/'(?:[^\\\r\n']|\\(?:.|[ox]?[0-9a-f]{1,3}))'/i,greedy:!0},string:[{pattern:/"(?:\\(?:[\s\S]|\r\n)|[^\\\r\n"])*"/,greedy:!0},{pattern:/\{([a-z_]*)\|[\s\S]*?\|\1\}/,greedy:!0}],number:[/\b(?:0b[01][01_]*|0o[0-7][0-7_]*)\b/i,/\b0x[a-f0-9][a-f0-9_]*(?:\.[a-f0-9_]*)?(?:p[+-]?\d[\d_]*)?(?!\w)/i,/\b\d[\d_]*(?:\.[\d_]*)?(?:e[+-]?\d[\d_]*)?(?!\w)/i],directive:{pattern:/\B#\w+/,alias:"property"},label:{pattern:/\B~\w+/,alias:"property"},"type-variable":{pattern:/\B'\w+/,alias:"function"},variant:{pattern:/`\w+/,alias:"symbol"},keyword:/\b(?:as|assert|begin|class|constraint|do|done|downto|else|end|exception|external|for|fun|function|functor|if|in|include|inherit|initializer|lazy|let|match|method|module|mutable|new|nonrec|object|of|open|private|rec|sig|struct|then|to|try|type|val|value|virtual|when|where|while|with)\b/,boolean:/\b(?:false|true)\b/,"operator-like-punctuation":{pattern:/\[[<>|]|[>|]\]|\{<|>\}/,alias:"punctuation"},operator:/\.[.~]|:[=>]|[=<>@^|&+\-*\/$%!?~][!$%&*+\-.\/:<=>?@^|~]*|\b(?:and|asr|land|lor|lsl|lsr|lxor|mod|or)\b/,punctuation:/;;|::|[(){}\[\].,:;#]|\b_\b/},a.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern:/![sra](?=[:}]$)/,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},a.languages.python["string-interpolation"].inside.interpolation.inside.rest=a.languages.python,a.languages.py=a.languages.python,a.languages.reason=a.languages.extend("clike",{string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^\\\r\n"])*"/,greedy:!0},"class-name":/\b[A-Z]\w*/,keyword:/\b(?:and|as|assert|begin|class|constraint|do|done|downto|else|end|exception|external|for|fun|function|functor|if|in|include|inherit|initializer|lazy|let|method|module|mutable|new|nonrec|object|of|open|or|private|rec|sig|struct|switch|then|to|try|type|val|virtual|when|while|with)\b/,operator:/\.{3}|:[:=]|\|>|->|=(?:==?|>)?|<=?|>=?|[|^?'#!~`]|[+\-*\/]\.?|\b(?:asr|land|lor|lsl|lsr|lxor|mod)\b/}),a.languages.insertBefore("reason","class-name",{char:{pattern:/'(?:\\x[\da-f]{2}|\\o[0-3][0-7][0-7]|\\\d{3}|\\.|[^'\\\r\n])'/,greedy:!0},constructor:/\b[A-Z]\w*\b(?!\s*\.)/,label:{pattern:/\b[a-z]\w*(?=::)/,alias:"symbol"}}),delete a.languages.reason.function,function(e){e.languages.sass=e.languages.extend("css",{comment:{pattern:/^([ \t]*)\/[\/*].*(?:(?:\r?\n|\r)\1[ \t].+)*/m,lookbehind:!0,greedy:!0}}),e.languages.insertBefore("sass","atrule",{"atrule-line":{pattern:/^(?:[ \t]*)[@+=].+/m,greedy:!0,inside:{atrule:/(?:@[\w-]+|[+=])/}}}),delete e.languages.sass.atrule;var t=/\$[-\w]+|#\{\$[-\w]+\}/,n=[/[+*\/%]|[=!]=|<=?|>=?|\b(?:and|not|or)\b/,{pattern:/(\s)-(?=\s)/,lookbehind:!0}];e.languages.insertBefore("sass","property",{"variable-line":{pattern:/^[ \t]*\$.+/m,greedy:!0,inside:{punctuation:/:/,variable:t,operator:n}},"property-line":{pattern:/^[ \t]*(?:[^:\s]+ *:.*|:[^:\s].*)/m,greedy:!0,inside:{property:[/[^:\s]+(?=\s*:)/,{pattern:/(:)[^:\s]+/,lookbehind:!0}],punctuation:/:/,variable:t,operator:n,important:e.languages.sass.important}}}),delete e.languages.sass.property,delete e.languages.sass.important,e.languages.insertBefore("sass","punctuation",{selector:{pattern:/^([ \t]*)\S(?:,[^,\r\n]+|[^,\r\n]*)(?:,[^,\r\n]+)*(?:,(?:\r?\n|\r)\1[ \t]+\S(?:,[^,\r\n]+|[^,\r\n]*)(?:,[^,\r\n]+)*)*/m,lookbehind:!0,greedy:!0}})}(a),a.languages.scss=a.languages.extend("css",{comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|\/\/.*)/,lookbehind:!0},atrule:{pattern:/@[\w-](?:\([^()]+\)|[^()\s]|\s+(?!\s))*?(?=\s+[{;])/,inside:{rule:/@[\w-]+/}},url:/(?:[-a-z]+-)?url(?=\()/i,selector:{pattern:/(?=\S)[^@;{}()]?(?:[^@;{}()\s]|\s+(?!\s)|#\{\$[-\w]+\})+(?=\s*\{(?:\}|\s|[^}][^:{}]*[:{][^}]))/,inside:{parent:{pattern:/&/,alias:"important"},placeholder:/%[-\w]+/,variable:/\$[-\w]+|#\{\$[-\w]+\}/}},property:{pattern:/(?:[-\w]|\$[-\w]|#\{\$[-\w]+\})+(?=\s*:)/,inside:{variable:/\$[-\w]+|#\{\$[-\w]+\}/}}}),a.languages.insertBefore("scss","atrule",{keyword:[/@(?:content|debug|each|else(?: if)?|extend|for|forward|function|if|import|include|mixin|return|use|warn|while)\b/i,{pattern:/( )(?:from|through)(?= )/,lookbehind:!0}]}),a.languages.insertBefore("scss","important",{variable:/\$[-\w]+|#\{\$[-\w]+\}/}),a.languages.insertBefore("scss","function",{"module-modifier":{pattern:/\b(?:as|hide|show|with)\b/i,alias:"keyword"},placeholder:{pattern:/%[-\w]+/,alias:"selector"},statement:{pattern:/\B!(?:default|optional)\b/i,alias:"keyword"},boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"},operator:{pattern:/(\s)(?:[-+*\/%]|[=!]=|<=?|>=?|and|not|or)(?=\s)/,lookbehind:!0}}),a.languages.scss.atrule.inside.rest=a.languages.scss,function(e){var t={pattern:/(\b\d+)(?:%|[a-z]+)/,lookbehind:!0},n={pattern:/(^|[^\w.-])-?(?:\d+(?:\.\d+)?|\.\d+)/,lookbehind:!0},r={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|\/\/.*)/,lookbehind:!0},url:{pattern:/\burl\((["']?).*?\1\)/i,greedy:!0},string:{pattern:/("|')(?:(?!\1)[^\\\r\n]|\\(?:\r\n|[\s\S]))*\1/,greedy:!0},interpolation:null,func:null,important:/\B!(?:important|optional)\b/i,keyword:{pattern:/(^|\s+)(?:(?:else|for|if|return|unless)(?=\s|$)|@[\w-]+)/,lookbehind:!0},hexcode:/#[\da-f]{3,6}/i,color:[/\b(?:AliceBlue|AntiqueWhite|Aqua|Aquamarine|Azure|Beige|Bisque|Black|BlanchedAlmond|Blue|BlueViolet|Brown|BurlyWood|CadetBlue|Chartreuse|Chocolate|Coral|CornflowerBlue|Cornsilk|Crimson|Cyan|DarkBlue|DarkCyan|DarkGoldenRod|DarkGr[ae]y|DarkGreen|DarkKhaki|DarkMagenta|DarkOliveGreen|DarkOrange|DarkOrchid|DarkRed|DarkSalmon|DarkSeaGreen|DarkSlateBlue|DarkSlateGr[ae]y|DarkTurquoise|DarkViolet|DeepPink|DeepSkyBlue|DimGr[ae]y|DodgerBlue|FireBrick|FloralWhite|ForestGreen|Fuchsia|Gainsboro|GhostWhite|Gold|GoldenRod|Gr[ae]y|Green|GreenYellow|HoneyDew|HotPink|IndianRed|Indigo|Ivory|Khaki|Lavender|LavenderBlush|LawnGreen|LemonChiffon|LightBlue|LightCoral|LightCyan|LightGoldenRodYellow|LightGr[ae]y|LightGreen|LightPink|LightSalmon|LightSeaGreen|LightSkyBlue|LightSlateGr[ae]y|LightSteelBlue|LightYellow|Lime|LimeGreen|Linen|Magenta|Maroon|MediumAquaMarine|MediumBlue|MediumOrchid|MediumPurple|MediumSeaGreen|MediumSlateBlue|MediumSpringGreen|MediumTurquoise|MediumVioletRed|MidnightBlue|MintCream|MistyRose|Moccasin|NavajoWhite|Navy|OldLace|Olive|OliveDrab|Orange|OrangeRed|Orchid|PaleGoldenRod|PaleGreen|PaleTurquoise|PaleVioletRed|PapayaWhip|PeachPuff|Peru|Pink|Plum|PowderBlue|Purple|Red|RosyBrown|RoyalBlue|SaddleBrown|Salmon|SandyBrown|SeaGreen|SeaShell|Sienna|Silver|SkyBlue|SlateBlue|SlateGr[ae]y|Snow|SpringGreen|SteelBlue|Tan|Teal|Thistle|Tomato|Transparent|Turquoise|Violet|Wheat|White|WhiteSmoke|Yellow|YellowGreen)\b/i,{pattern:/\b(?:hsl|rgb)\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*\)\B|\b(?:hsl|rgb)a\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*,\s*(?:0|0?\.\d+|1)\s*\)\B/i,inside:{unit:t,number:n,function:/[\w-]+(?=\()/,punctuation:/[(),]/}}],entity:/\\[\da-f]{1,8}/i,unit:t,boolean:/\b(?:false|true)\b/,operator:[/~|[+!\/%<>?=]=?|[-:]=|\*[*=]?|\.{2,3}|&&|\|\||\B-\B|\b(?:and|in|is(?: a| defined| not|nt)?|not|or)\b/],number:n,punctuation:/[{}()\[\];:,]/};r.interpolation={pattern:/\{[^\r\n}:]+\}/,alias:"variable",inside:{delimiter:{pattern:/^\{|\}$/,alias:"punctuation"},rest:r}},r.func={pattern:/[\w-]+\([^)]*\).*/,inside:{function:/^[^(]+/,rest:r}},e.languages.stylus={"atrule-declaration":{pattern:/(^[ \t]*)@.+/m,lookbehind:!0,inside:{atrule:/^@[\w-]+/,rest:r}},"variable-declaration":{pattern:/(^[ \t]*)[\w$-]+\s*.?=[ \t]*(?:\{[^{}]*\}|\S.*|$)/m,lookbehind:!0,inside:{variable:/^\S+/,rest:r}},statement:{pattern:/(^[ \t]*)(?:else|for|if|return|unless)[ \t].+/m,lookbehind:!0,inside:{keyword:/^\S+/,rest:r}},"property-declaration":{pattern:/((?:^|\{)([ \t]*))(?:[\w-]|\{[^}\r\n]+\})+(?:\s*:\s*|[ \t]+)(?!\s)[^{\r\n]*(?:;|[^{\r\n,]$(?!(?:\r?\n|\r)(?:\{|\2[ \t])))/m,lookbehind:!0,inside:{property:{pattern:/^[^\s:]+/,inside:{interpolation:r.interpolation}},rest:r}},selector:{pattern:/(^[ \t]*)(?:(?=\S)(?:[^{}\r\n:()]|::?[\w-]+(?:\([^)\r\n]*\)|(?![\w-]))|\{[^}\r\n]+\})+)(?:(?:\r?\n|\r)(?:\1(?:(?=\S)(?:[^{}\r\n:()]|::?[\w-]+(?:\([^)\r\n]*\)|(?![\w-]))|\{[^}\r\n]+\})+)))*(?:,$|\{|(?=(?:\r?\n|\r)(?:\{|\1[ \t])))/m,lookbehind:!0,inside:{interpolation:r.interpolation,comment:r.comment,punctuation:/[{},]/}},func:r.func,string:r.string,comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|\/\/.*)/,lookbehind:!0,greedy:!0},interpolation:r.interpolation,punctuation:/[{}()\[\];:.]/}}(a),function(e){var t=e.util.clone(e.languages.typescript);e.languages.tsx=e.languages.extend("jsx",t),delete e.languages.tsx.parameter,delete e.languages.tsx["literal-property"];var n=e.languages.tsx.tag;n.pattern=RegExp(/(^|[^\w$]|(?=<\/))/.source+"(?:"+n.pattern.source+")",n.pattern.flags),n.lookbehind=!0}(a),a.languages.wasm={comment:[/\(;[\s\S]*?;\)/,{pattern:/;;.*/,greedy:!0}],string:{pattern:/"(?:\\[\s\S]|[^"\\])*"/,greedy:!0},keyword:[{pattern:/\b(?:align|offset)=/,inside:{operator:/=/}},{pattern:/\b(?:(?:f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|neg?|nearest|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|sqrt|store(?:8|16|32)?|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))?|memory\.(?:grow|size))\b/,inside:{punctuation:/\./}},/\b(?:anyfunc|block|br(?:_if|_table)?|call(?:_indirect)?|data|drop|elem|else|end|export|func|get_(?:global|local)|global|if|import|local|loop|memory|module|mut|nop|offset|param|result|return|select|set_(?:global|local)|start|table|tee_local|then|type|unreachable)\b/],variable:/\$[\w!#$%&'*+\-./:<=>?@\\^`|~]+/,number:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/,punctuation:/[()]/};const o=a},9901:e=>{e.exports&&(e.exports={core:{meta:{path:"components/prism-core.js",option:"mandatory"},core:"Core"},themes:{meta:{path:"themes/{id}.css",link:"index.html?theme={id}",exclusive:!0},prism:{title:"Default",option:"default"},"prism-dark":"Dark","prism-funky":"Funky","prism-okaidia":{title:"Okaidia",owner:"ocodia"},"prism-twilight":{title:"Twilight",owner:"remybach"},"prism-coy":{title:"Coy",owner:"tshedor"},"prism-solarizedlight":{title:"Solarized Light",owner:"hectormatos2011 "},"prism-tomorrow":{title:"Tomorrow Night",owner:"Rosey"}},languages:{meta:{path:"components/prism-{id}",noCSS:!0,examplesPath:"examples/prism-{id}",addCheckAll:!0},markup:{title:"Markup",alias:["html","xml","svg","mathml","ssml","atom","rss"],aliasTitles:{html:"HTML",xml:"XML",svg:"SVG",mathml:"MathML",ssml:"SSML",atom:"Atom",rss:"RSS"},option:"default"},css:{title:"CSS",option:"default",modify:"markup"},clike:{title:"C-like",option:"default"},javascript:{title:"JavaScript",require:"clike",modify:"markup",optional:"regex",alias:"js",option:"default"},abap:{title:"ABAP",owner:"dellagustin"},abnf:{title:"ABNF",owner:"RunDevelopment"},actionscript:{title:"ActionScript",require:"javascript",modify:"markup",owner:"Golmote"},ada:{title:"Ada",owner:"Lucretia"},agda:{title:"Agda",owner:"xy-ren"},al:{title:"AL",owner:"RunDevelopment"},antlr4:{title:"ANTLR4",alias:"g4",owner:"RunDevelopment"},apacheconf:{title:"Apache Configuration",owner:"GuiTeK"},apex:{title:"Apex",require:["clike","sql"],owner:"RunDevelopment"},apl:{title:"APL",owner:"ngn"},applescript:{title:"AppleScript",owner:"Golmote"},aql:{title:"AQL",owner:"RunDevelopment"},arduino:{title:"Arduino",require:"cpp",alias:"ino",owner:"dkern"},arff:{title:"ARFF",owner:"Golmote"},armasm:{title:"ARM Assembly",alias:"arm-asm",owner:"RunDevelopment"},arturo:{title:"Arturo",alias:"art",optional:["bash","css","javascript","markup","markdown","sql"],owner:"drkameleon"},asciidoc:{alias:"adoc",title:"AsciiDoc",owner:"Golmote"},aspnet:{title:"ASP.NET (C#)",require:["markup","csharp"],owner:"nauzilus"},asm6502:{title:"6502 Assembly",owner:"kzurawel"},asmatmel:{title:"Atmel AVR Assembly",owner:"cerkit"},autohotkey:{title:"AutoHotkey",owner:"aviaryan"},autoit:{title:"AutoIt",owner:"Golmote"},avisynth:{title:"AviSynth",alias:"avs",owner:"Zinfidel"},"avro-idl":{title:"Avro IDL",alias:"avdl",owner:"RunDevelopment"},awk:{title:"AWK",alias:"gawk",aliasTitles:{gawk:"GAWK"},owner:"RunDevelopment"},bash:{title:"Bash",alias:["sh","shell"],aliasTitles:{sh:"Shell",shell:"Shell"},owner:"zeitgeist87"},basic:{title:"BASIC",owner:"Golmote"},batch:{title:"Batch",owner:"Golmote"},bbcode:{title:"BBcode",alias:"shortcode",aliasTitles:{shortcode:"Shortcode"},owner:"RunDevelopment"},bbj:{title:"BBj",owner:"hyyan"},bicep:{title:"Bicep",owner:"johnnyreilly"},birb:{title:"Birb",require:"clike",owner:"Calamity210"},bison:{title:"Bison",require:"c",owner:"Golmote"},bnf:{title:"BNF",alias:"rbnf",aliasTitles:{rbnf:"RBNF"},owner:"RunDevelopment"},bqn:{title:"BQN",owner:"yewscion"},brainfuck:{title:"Brainfuck",owner:"Golmote"},brightscript:{title:"BrightScript",owner:"RunDevelopment"},bro:{title:"Bro",owner:"wayward710"},bsl:{title:"BSL (1C:Enterprise)",alias:"oscript",aliasTitles:{oscript:"OneScript"},owner:"Diversus23"},c:{title:"C",require:"clike",owner:"zeitgeist87"},csharp:{title:"C#",require:"clike",alias:["cs","dotnet"],owner:"mvalipour"},cpp:{title:"C++",require:"c",owner:"zeitgeist87"},cfscript:{title:"CFScript",require:"clike",alias:"cfc",owner:"mjclemente"},chaiscript:{title:"ChaiScript",require:["clike","cpp"],owner:"RunDevelopment"},cil:{title:"CIL",owner:"sbrl"},cilkc:{title:"Cilk/C",require:"c",alias:"cilk-c",owner:"OpenCilk"},cilkcpp:{title:"Cilk/C++",require:"cpp",alias:["cilk-cpp","cilk"],owner:"OpenCilk"},clojure:{title:"Clojure",owner:"troglotit"},cmake:{title:"CMake",owner:"mjrogozinski"},cobol:{title:"COBOL",owner:"RunDevelopment"},coffeescript:{title:"CoffeeScript",require:"javascript",alias:"coffee",owner:"R-osey"},concurnas:{title:"Concurnas",alias:"conc",owner:"jasontatton"},csp:{title:"Content-Security-Policy",owner:"ScottHelme"},cooklang:{title:"Cooklang",owner:"ahue"},coq:{title:"Coq",owner:"RunDevelopment"},crystal:{title:"Crystal",require:"ruby",owner:"MakeNowJust"},"css-extras":{title:"CSS Extras",require:"css",modify:"css",owner:"milesj"},csv:{title:"CSV",owner:"RunDevelopment"},cue:{title:"CUE",owner:"RunDevelopment"},cypher:{title:"Cypher",owner:"RunDevelopment"},d:{title:"D",require:"clike",owner:"Golmote"},dart:{title:"Dart",require:"clike",owner:"Golmote"},dataweave:{title:"DataWeave",owner:"machaval"},dax:{title:"DAX",owner:"peterbud"},dhall:{title:"Dhall",owner:"RunDevelopment"},diff:{title:"Diff",owner:"uranusjr"},django:{title:"Django/Jinja2",require:"markup-templating",alias:"jinja2",owner:"romanvm"},"dns-zone-file":{title:"DNS zone file",owner:"RunDevelopment",alias:"dns-zone"},docker:{title:"Docker",alias:"dockerfile",owner:"JustinBeckwith"},dot:{title:"DOT (Graphviz)",alias:"gv",optional:"markup",owner:"RunDevelopment"},ebnf:{title:"EBNF",owner:"RunDevelopment"},editorconfig:{title:"EditorConfig",owner:"osipxd"},eiffel:{title:"Eiffel",owner:"Conaclos"},ejs:{title:"EJS",require:["javascript","markup-templating"],owner:"RunDevelopment",alias:"eta",aliasTitles:{eta:"Eta"}},elixir:{title:"Elixir",owner:"Golmote"},elm:{title:"Elm",owner:"zwilias"},etlua:{title:"Embedded Lua templating",require:["lua","markup-templating"],owner:"RunDevelopment"},erb:{title:"ERB",require:["ruby","markup-templating"],owner:"Golmote"},erlang:{title:"Erlang",owner:"Golmote"},"excel-formula":{title:"Excel Formula",alias:["xlsx","xls"],owner:"RunDevelopment"},fsharp:{title:"F#",require:"clike",owner:"simonreynolds7"},factor:{title:"Factor",owner:"catb0t"},false:{title:"False",owner:"edukisto"},"firestore-security-rules":{title:"Firestore security rules",require:"clike",owner:"RunDevelopment"},flow:{title:"Flow",require:"javascript",owner:"Golmote"},fortran:{title:"Fortran",owner:"Golmote"},ftl:{title:"FreeMarker Template Language",require:"markup-templating",owner:"RunDevelopment"},gml:{title:"GameMaker Language",alias:"gamemakerlanguage",require:"clike",owner:"LiarOnce"},gap:{title:"GAP (CAS)",owner:"RunDevelopment"},gcode:{title:"G-code",owner:"RunDevelopment"},gdscript:{title:"GDScript",owner:"RunDevelopment"},gedcom:{title:"GEDCOM",owner:"Golmote"},gettext:{title:"gettext",alias:"po",owner:"RunDevelopment"},gherkin:{title:"Gherkin",owner:"hason"},git:{title:"Git",owner:"lgiraudel"},glsl:{title:"GLSL",require:"c",owner:"Golmote"},gn:{title:"GN",alias:"gni",owner:"RunDevelopment"},"linker-script":{title:"GNU Linker Script",alias:"ld",owner:"RunDevelopment"},go:{title:"Go",require:"clike",owner:"arnehormann"},"go-module":{title:"Go module",alias:"go-mod",owner:"RunDevelopment"},gradle:{title:"Gradle",require:"clike",owner:"zeabdelkhalek-badido18"},graphql:{title:"GraphQL",optional:"markdown",owner:"Golmote"},groovy:{title:"Groovy",require:"clike",owner:"robfletcher"},haml:{title:"Haml",require:"ruby",optional:["css","css-extras","coffeescript","erb","javascript","less","markdown","scss","textile"],owner:"Golmote"},handlebars:{title:"Handlebars",require:"markup-templating",alias:["hbs","mustache"],aliasTitles:{mustache:"Mustache"},owner:"Golmote"},haskell:{title:"Haskell",alias:"hs",owner:"bholst"},haxe:{title:"Haxe",require:"clike",optional:"regex",owner:"Golmote"},hcl:{title:"HCL",owner:"outsideris"},hlsl:{title:"HLSL",require:"c",owner:"RunDevelopment"},hoon:{title:"Hoon",owner:"matildepark"},http:{title:"HTTP",optional:["csp","css","hpkp","hsts","javascript","json","markup","uri"],owner:"danielgtaylor"},hpkp:{title:"HTTP Public-Key-Pins",owner:"ScottHelme"},hsts:{title:"HTTP Strict-Transport-Security",owner:"ScottHelme"},ichigojam:{title:"IchigoJam",owner:"BlueCocoa"},icon:{title:"Icon",owner:"Golmote"},"icu-message-format":{title:"ICU Message Format",owner:"RunDevelopment"},idris:{title:"Idris",alias:"idr",owner:"KeenS",require:"haskell"},ignore:{title:".ignore",owner:"osipxd",alias:["gitignore","hgignore","npmignore"],aliasTitles:{gitignore:".gitignore",hgignore:".hgignore",npmignore:".npmignore"}},inform7:{title:"Inform 7",owner:"Golmote"},ini:{title:"Ini",owner:"aviaryan"},io:{title:"Io",owner:"AlesTsurko"},j:{title:"J",owner:"Golmote"},java:{title:"Java",require:"clike",owner:"sherblot"},javadoc:{title:"JavaDoc",require:["markup","java","javadoclike"],modify:"java",optional:"scala",owner:"RunDevelopment"},javadoclike:{title:"JavaDoc-like",modify:["java","javascript","php"],owner:"RunDevelopment"},javastacktrace:{title:"Java stack trace",owner:"RunDevelopment"},jexl:{title:"Jexl",owner:"czosel"},jolie:{title:"Jolie",require:"clike",owner:"thesave"},jq:{title:"JQ",owner:"RunDevelopment"},jsdoc:{title:"JSDoc",require:["javascript","javadoclike","typescript"],modify:"javascript",optional:["actionscript","coffeescript"],owner:"RunDevelopment"},"js-extras":{title:"JS Extras",require:"javascript",modify:"javascript",optional:["actionscript","coffeescript","flow","n4js","typescript"],owner:"RunDevelopment"},json:{title:"JSON",alias:"webmanifest",aliasTitles:{webmanifest:"Web App Manifest"},owner:"CupOfTea696"},json5:{title:"JSON5",require:"json",owner:"RunDevelopment"},jsonp:{title:"JSONP",require:"json",owner:"RunDevelopment"},jsstacktrace:{title:"JS stack trace",owner:"sbrl"},"js-templates":{title:"JS Templates",require:"javascript",modify:"javascript",optional:["css","css-extras","graphql","markdown","markup","sql"],owner:"RunDevelopment"},julia:{title:"Julia",owner:"cdagnino"},keepalived:{title:"Keepalived Configure",owner:"dev-itsheng"},keyman:{title:"Keyman",owner:"mcdurdin"},kotlin:{title:"Kotlin",alias:["kt","kts"],aliasTitles:{kts:"Kotlin Script"},require:"clike",owner:"Golmote"},kumir:{title:"KuMir (\u041a\u0443\u041c\u0438\u0440)",alias:"kum",owner:"edukisto"},kusto:{title:"Kusto",owner:"RunDevelopment"},latex:{title:"LaTeX",alias:["tex","context"],aliasTitles:{tex:"TeX",context:"ConTeXt"},owner:"japborst"},latte:{title:"Latte",require:["clike","markup-templating","php"],owner:"nette"},less:{title:"Less",require:"css",optional:"css-extras",owner:"Golmote"},lilypond:{title:"LilyPond",require:"scheme",alias:"ly",owner:"RunDevelopment"},liquid:{title:"Liquid",require:"markup-templating",owner:"cinhtau"},lisp:{title:"Lisp",alias:["emacs","elisp","emacs-lisp"],owner:"JuanCaicedo"},livescript:{title:"LiveScript",owner:"Golmote"},llvm:{title:"LLVM IR",owner:"porglezomp"},log:{title:"Log file",optional:"javastacktrace",owner:"RunDevelopment"},lolcode:{title:"LOLCODE",owner:"Golmote"},lua:{title:"Lua",owner:"Golmote"},magma:{title:"Magma (CAS)",owner:"RunDevelopment"},makefile:{title:"Makefile",owner:"Golmote"},markdown:{title:"Markdown",require:"markup",optional:"yaml",alias:"md",owner:"Golmote"},"markup-templating":{title:"Markup templating",require:"markup",owner:"Golmote"},mata:{title:"Mata",owner:"RunDevelopment"},matlab:{title:"MATLAB",owner:"Golmote"},maxscript:{title:"MAXScript",owner:"RunDevelopment"},mel:{title:"MEL",owner:"Golmote"},mermaid:{title:"Mermaid",owner:"RunDevelopment"},metafont:{title:"METAFONT",owner:"LaeriExNihilo"},mizar:{title:"Mizar",owner:"Golmote"},mongodb:{title:"MongoDB",owner:"airs0urce",require:"javascript"},monkey:{title:"Monkey",owner:"Golmote"},moonscript:{title:"MoonScript",alias:"moon",owner:"RunDevelopment"},n1ql:{title:"N1QL",owner:"TMWilds"},n4js:{title:"N4JS",require:"javascript",optional:"jsdoc",alias:"n4jsd",owner:"bsmith-n4"},"nand2tetris-hdl":{title:"Nand To Tetris HDL",owner:"stephanmax"},naniscript:{title:"Naninovel Script",owner:"Elringus",alias:"nani"},nasm:{title:"NASM",owner:"rbmj"},neon:{title:"NEON",owner:"nette"},nevod:{title:"Nevod",owner:"nezaboodka"},nginx:{title:"nginx",owner:"volado"},nim:{title:"Nim",owner:"Golmote"},nix:{title:"Nix",owner:"Golmote"},nsis:{title:"NSIS",owner:"idleberg"},objectivec:{title:"Objective-C",require:"c",alias:"objc",owner:"uranusjr"},ocaml:{title:"OCaml",owner:"Golmote"},odin:{title:"Odin",owner:"edukisto"},opencl:{title:"OpenCL",require:"c",modify:["c","cpp"],owner:"Milania1"},openqasm:{title:"OpenQasm",alias:"qasm",owner:"RunDevelopment"},oz:{title:"Oz",owner:"Golmote"},parigp:{title:"PARI/GP",owner:"Golmote"},parser:{title:"Parser",require:"markup",owner:"Golmote"},pascal:{title:"Pascal",alias:"objectpascal",aliasTitles:{objectpascal:"Object Pascal"},owner:"Golmote"},pascaligo:{title:"Pascaligo",owner:"DefinitelyNotAGoat"},psl:{title:"PATROL Scripting Language",owner:"bertysentry"},pcaxis:{title:"PC-Axis",alias:"px",owner:"RunDevelopment"},peoplecode:{title:"PeopleCode",alias:"pcode",owner:"RunDevelopment"},perl:{title:"Perl",owner:"Golmote"},php:{title:"PHP",require:"markup-templating",owner:"milesj"},phpdoc:{title:"PHPDoc",require:["php","javadoclike"],modify:"php",owner:"RunDevelopment"},"php-extras":{title:"PHP Extras",require:"php",modify:"php",owner:"milesj"},"plant-uml":{title:"PlantUML",alias:"plantuml",owner:"RunDevelopment"},plsql:{title:"PL/SQL",require:"sql",owner:"Golmote"},powerquery:{title:"PowerQuery",alias:["pq","mscript"],owner:"peterbud"},powershell:{title:"PowerShell",owner:"nauzilus"},processing:{title:"Processing",require:"clike",owner:"Golmote"},prolog:{title:"Prolog",owner:"Golmote"},promql:{title:"PromQL",owner:"arendjr"},properties:{title:".properties",owner:"Golmote"},protobuf:{title:"Protocol Buffers",require:"clike",owner:"just-boris"},pug:{title:"Pug",require:["markup","javascript"],optional:["coffeescript","ejs","handlebars","less","livescript","markdown","scss","stylus","twig"],owner:"Golmote"},puppet:{title:"Puppet",owner:"Golmote"},pure:{title:"Pure",optional:["c","cpp","fortran"],owner:"Golmote"},purebasic:{title:"PureBasic",require:"clike",alias:"pbfasm",owner:"HeX0R101"},purescript:{title:"PureScript",require:"haskell",alias:"purs",owner:"sriharshachilakapati"},python:{title:"Python",alias:"py",owner:"multipetros"},qsharp:{title:"Q#",require:"clike",alias:"qs",owner:"fedonman"},q:{title:"Q (kdb+ database)",owner:"Golmote"},qml:{title:"QML",require:"javascript",owner:"RunDevelopment"},qore:{title:"Qore",require:"clike",owner:"temnroegg"},r:{title:"R",owner:"Golmote"},racket:{title:"Racket",require:"scheme",alias:"rkt",owner:"RunDevelopment"},cshtml:{title:"Razor C#",alias:"razor",require:["markup","csharp"],optional:["css","css-extras","javascript","js-extras"],owner:"RunDevelopment"},jsx:{title:"React JSX",require:["markup","javascript"],optional:["jsdoc","js-extras","js-templates"],owner:"vkbansal"},tsx:{title:"React TSX",require:["jsx","typescript"]},reason:{title:"Reason",require:"clike",owner:"Golmote"},regex:{title:"Regex",owner:"RunDevelopment"},rego:{title:"Rego",owner:"JordanSh"},renpy:{title:"Ren'py",alias:"rpy",owner:"HyuchiaDiego"},rescript:{title:"ReScript",alias:"res",owner:"vmarcosp"},rest:{title:"reST (reStructuredText)",owner:"Golmote"},rip:{title:"Rip",owner:"ravinggenius"},roboconf:{title:"Roboconf",owner:"Golmote"},robotframework:{title:"Robot Framework",alias:"robot",owner:"RunDevelopment"},ruby:{title:"Ruby",require:"clike",alias:"rb",owner:"samflores"},rust:{title:"Rust",owner:"Golmote"},sas:{title:"SAS",optional:["groovy","lua","sql"],owner:"Golmote"},sass:{title:"Sass (Sass)",require:"css",optional:"css-extras",owner:"Golmote"},scss:{title:"Sass (SCSS)",require:"css",optional:"css-extras",owner:"MoOx"},scala:{title:"Scala",require:"java",owner:"jozic"},scheme:{title:"Scheme",owner:"bacchus123"},"shell-session":{title:"Shell session",require:"bash",alias:["sh-session","shellsession"],owner:"RunDevelopment"},smali:{title:"Smali",owner:"RunDevelopment"},smalltalk:{title:"Smalltalk",owner:"Golmote"},smarty:{title:"Smarty",require:"markup-templating",optional:"php",owner:"Golmote"},sml:{title:"SML",alias:"smlnj",aliasTitles:{smlnj:"SML/NJ"},owner:"RunDevelopment"},solidity:{title:"Solidity (Ethereum)",alias:"sol",require:"clike",owner:"glachaud"},"solution-file":{title:"Solution file",alias:"sln",owner:"RunDevelopment"},soy:{title:"Soy (Closure Template)",require:"markup-templating",owner:"Golmote"},sparql:{title:"SPARQL",require:"turtle",owner:"Triply-Dev",alias:"rq"},"splunk-spl":{title:"Splunk SPL",owner:"RunDevelopment"},sqf:{title:"SQF: Status Quo Function (Arma 3)",require:"clike",owner:"RunDevelopment"},sql:{title:"SQL",owner:"multipetros"},squirrel:{title:"Squirrel",require:"clike",owner:"RunDevelopment"},stan:{title:"Stan",owner:"RunDevelopment"},stata:{title:"Stata Ado",require:["mata","java","python"],owner:"RunDevelopment"},iecst:{title:"Structured Text (IEC 61131-3)",owner:"serhioromano"},stylus:{title:"Stylus",owner:"vkbansal"},supercollider:{title:"SuperCollider",alias:"sclang",owner:"RunDevelopment"},swift:{title:"Swift",owner:"chrischares"},systemd:{title:"Systemd configuration file",owner:"RunDevelopment"},"t4-templating":{title:"T4 templating",owner:"RunDevelopment"},"t4-cs":{title:"T4 Text Templates (C#)",require:["t4-templating","csharp"],alias:"t4",owner:"RunDevelopment"},"t4-vb":{title:"T4 Text Templates (VB)",require:["t4-templating","vbnet"],owner:"RunDevelopment"},tap:{title:"TAP",owner:"isaacs",require:"yaml"},tcl:{title:"Tcl",owner:"PeterChaplin"},tt2:{title:"Template Toolkit 2",require:["clike","markup-templating"],owner:"gflohr"},textile:{title:"Textile",require:"markup",optional:"css",owner:"Golmote"},toml:{title:"TOML",owner:"RunDevelopment"},tremor:{title:"Tremor",alias:["trickle","troy"],owner:"darach",aliasTitles:{trickle:"trickle",troy:"troy"}},turtle:{title:"Turtle",alias:"trig",aliasTitles:{trig:"TriG"},owner:"jakubklimek"},twig:{title:"Twig",require:"markup-templating",owner:"brandonkelly"},typescript:{title:"TypeScript",require:"javascript",optional:"js-templates",alias:"ts",owner:"vkbansal"},typoscript:{title:"TypoScript",alias:"tsconfig",aliasTitles:{tsconfig:"TSConfig"},owner:"dkern"},unrealscript:{title:"UnrealScript",alias:["uscript","uc"],owner:"RunDevelopment"},uorazor:{title:"UO Razor Script",owner:"jaseowns"},uri:{title:"URI",alias:"url",aliasTitles:{url:"URL"},owner:"RunDevelopment"},v:{title:"V",require:"clike",owner:"taggon"},vala:{title:"Vala",require:"clike",optional:"regex",owner:"TemplarVolk"},vbnet:{title:"VB.Net",require:"basic",owner:"Bigsby"},velocity:{title:"Velocity",require:"markup",owner:"Golmote"},verilog:{title:"Verilog",owner:"a-rey"},vhdl:{title:"VHDL",owner:"a-rey"},vim:{title:"vim",owner:"westonganger"},"visual-basic":{title:"Visual Basic",alias:["vb","vba"],aliasTitles:{vba:"VBA"},owner:"Golmote"},warpscript:{title:"WarpScript",owner:"RunDevelopment"},wasm:{title:"WebAssembly",owner:"Golmote"},"web-idl":{title:"Web IDL",alias:"webidl",owner:"RunDevelopment"},wgsl:{title:"WGSL",owner:"Dr4gonthree"},wiki:{title:"Wiki markup",require:"markup",owner:"Golmote"},wolfram:{title:"Wolfram language",alias:["mathematica","nb","wl"],aliasTitles:{mathematica:"Mathematica",nb:"Mathematica Notebook"},owner:"msollami"},wren:{title:"Wren",owner:"clsource"},xeora:{title:"Xeora",require:"markup",alias:"xeoracube",aliasTitles:{xeoracube:"XeoraCube"},owner:"freakmaxi"},"xml-doc":{title:"XML doc (.net)",require:"markup",modify:["csharp","fsharp","vbnet"],owner:"RunDevelopment"},xojo:{title:"Xojo (REALbasic)",owner:"Golmote"},xquery:{title:"XQuery",require:"markup",owner:"Golmote"},yaml:{title:"YAML",alias:"yml",owner:"hason"},yang:{title:"YANG",owner:"RunDevelopment"},zig:{title:"Zig",owner:"RunDevelopment"}},plugins:{meta:{path:"plugins/{id}/prism-{id}",link:"plugins/{id}/"},"line-highlight":{title:"Line Highlight",description:"Highlights specific lines and/or line ranges."},"line-numbers":{title:"Line Numbers",description:"Line number at the beginning of code lines.",owner:"kuba-kubula"},"show-invisibles":{title:"Show Invisibles",description:"Show hidden characters such as tabs and line breaks.",optional:["autolinker","data-uri-highlight"]},autolinker:{title:"Autolinker",description:"Converts URLs and emails in code to clickable links. Parses Markdown links in comments."},wpd:{title:"WebPlatform Docs",description:'Makes tokens link to WebPlatform.org documentation. The links open in a new tab.'},"custom-class":{title:"Custom Class",description:"This plugin allows you to prefix Prism's default classes (.comment can become .namespace--comment) or replace them with your defined ones (like .editor__comment). You can even add new classes.",owner:"dvkndn",noCSS:!0},"file-highlight":{title:"File Highlight",description:"Fetch external files and highlight them with Prism. Used on the Prism website itself.",noCSS:!0},"show-language":{title:"Show Language",description:"Display the highlighted language in code blocks (inline code does not show the label).",owner:"nauzilus",noCSS:!0,require:"toolbar"},"jsonp-highlight":{title:"JSONP Highlight",description:"Fetch content with JSONP and highlight some interesting content (e.g. GitHub/Gists or Bitbucket API).",noCSS:!0,owner:"nauzilus"},"highlight-keywords":{title:"Highlight Keywords",description:"Adds special CSS classes for each keyword for fine-grained highlighting.",owner:"vkbansal",noCSS:!0},"remove-initial-line-feed":{title:"Remove initial line feed",description:"Removes the initial line feed in code blocks.",owner:"Golmote",noCSS:!0},"inline-color":{title:"Inline color",description:"Adds a small inline preview for colors in style sheets.",require:"css-extras",owner:"RunDevelopment"},previewers:{title:"Previewers",description:"Previewers for angles, colors, gradients, easing and time.",require:"css-extras",owner:"Golmote"},autoloader:{title:"Autoloader",description:"Automatically loads the needed languages to highlight the code blocks.",owner:"Golmote",noCSS:!0},"keep-markup":{title:"Keep Markup",description:"Prevents custom markup from being dropped out during highlighting.",owner:"Golmote",optional:"normalize-whitespace",noCSS:!0},"command-line":{title:"Command Line",description:"Display a command line with a prompt and, optionally, the output/response from the commands.",owner:"chriswells0"},"unescaped-markup":{title:"Unescaped Markup",description:"Write markup without having to escape anything."},"normalize-whitespace":{title:"Normalize Whitespace",description:"Supports multiple operations to normalize whitespace in code blocks.",owner:"zeitgeist87",optional:"unescaped-markup",noCSS:!0},"data-uri-highlight":{title:"Data-URI Highlight",description:"Highlights data-URI contents.",owner:"Golmote",noCSS:!0},toolbar:{title:"Toolbar",description:"Attach a toolbar for plugins to easily register buttons on the top of a code block.",owner:"mAAdhaTTah"},"copy-to-clipboard":{title:"Copy to Clipboard Button",description:"Add a button that copies the code block to the clipboard when clicked.",owner:"mAAdhaTTah",require:"toolbar",noCSS:!0},"download-button":{title:"Download Button",description:"A button in the toolbar of a code block adding a convenient way to download a code file.",owner:"Golmote",require:"toolbar",noCSS:!0},"match-braces":{title:"Match braces",description:"Highlights matching braces.",owner:"RunDevelopment"},"diff-highlight":{title:"Diff Highlight",description:"Highlights the code inside diff blocks.",owner:"RunDevelopment",require:"diff"},"filter-highlight-all":{title:"Filter highlightAll",description:"Filters the elements the highlightAll and highlightAllUnder methods actually highlight.",owner:"RunDevelopment",noCSS:!0},treeview:{title:"Treeview",description:"A language with special styles to highlight file system tree structures.",owner:"Golmote"}}})},2885:(e,t,n)=>{const r=n(9901),a=n(9642),o=new Set;function i(e){void 0===e?e=Object.keys(r.languages).filter((e=>"meta"!=e)):Array.isArray(e)||(e=[e]);const t=[...o,...Object.keys(Prism.languages)];a(r,e,t).load((e=>{if(!(e in r.languages))return void(i.silent||console.warn("Language does not exist: "+e));const t="./prism-"+e;delete n.c[n(6500).resolve(t)],delete Prism.languages[e],n(6500)(t),o.add(e)}))}i.silent=!1,e.exports=i},6726:(e,t,n)=>{var r={"./":2885};function a(e){var t=o(e);return n(t)}function o(e){if(!n.o(r,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return r[e]}a.keys=function(){return Object.keys(r)},a.resolve=o,e.exports=a,a.id=6726},6500:(e,t,n)=>{var r={"./":2885};function a(e){var t=o(e);return n(t)}function o(e){if(!n.o(r,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return r[e]}a.keys=function(){return Object.keys(r)},a.resolve=o,e.exports=a,a.id=6500},9642:e=>{"use strict";var t=function(){var e=function(){};function t(e,t){Array.isArray(e)?e.forEach(t):null!=e&&t(e,0)}function n(e){for(var t={},n=0,r=e.length;n "));var l={},s=e[r];if(s){function c(t){if(!(t in e))throw new Error(r+" depends on an unknown component "+t);if(!(t in l))for(var i in a(t,o),l[t]=!0,n[t])l[i]=!0}t(s.require,c),t(s.optional,c),t(s.modify,c)}n[r]=l,o.pop()}}return function(e){var t=n[e];return t||(a(e,r),t=n[e]),t}}function a(e){for(var t in e)return!0;return!1}return function(o,i,l){var s=function(e){var t={};for(var n in e){var r=e[n];for(var a in r)if("meta"!=a){var o=r[a];t[a]="string"==typeof o?{title:o}:o}}return t}(o),c=function(e){var n;return function(r){if(r in e)return r;if(!n)for(var a in n={},e){var o=e[a];t(o&&o.alias,(function(t){if(t in n)throw new Error(t+" cannot be alias for both "+a+" and "+n[t]);if(t in e)throw new Error(t+" cannot be alias of "+a+" because it is a component.");n[t]=a}))}return n[r]||r}}(s);i=i.map(c),l=(l||[]).map(c);var u=n(i),d=n(l);i.forEach((function e(n){var r=s[n];t(r&&r.require,(function(t){t in d||(u[t]=!0,e(t))}))}));for(var p,f=r(s),m=u;a(m);){for(var g in p={},m){var h=s[g];t(h&&h.modify,(function(e){e in d&&(p[e]=!0)}))}for(var b in d)if(!(b in u))for(var v in f(b))if(v in u){p[b]=!0;break}for(var y in m=p)u[y]=!0}var w={getIds:function(){var e=[];return w.load((function(t){e.push(t)})),e},load:function(t,n){return function(t,n,r,a){var o=a?a.series:void 0,i=a?a.parallel:e,l={},s={};function c(e){if(e in l)return l[e];s[e]=!0;var a,u=[];for(var d in t(e))d in n&&u.push(d);if(0===u.length)a=r(e);else{var p=i(u.map((function(e){var t=c(e);return delete s[e],t})));o?a=o(p,(function(){return r(e)})):r(e)}return l[e]=a}for(var u in n)c(u);var d=[];for(var p in s)d.push(l[p]);return i(d)}(f,u,t,n)}};return w}}();e.exports=t},2703:(e,t,n)=>{"use strict";var r=n(414);function a(){}function o(){}o.resetWarningCache=a,e.exports=function(){function e(e,t,n,a,o,i){if(i!==r){var l=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw l.name="Invariant Violation",l}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:o,resetWarningCache:a};return n.PropTypes=n,n}},5697:(e,t,n)=>{e.exports=n(2703)()},414:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},4448:(e,t,n)=>{"use strict";var r=n(7294),a=n(7418),o=n(3840);function i(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n