1 line
40 KiB
JavaScript
1 line
40 KiB
JavaScript
|
"use strict";(self.webpackChunkmas_docs=self.webpackChunkmas_docs||[]).push([[7559],{8128:(t,e,s)=>{s.r(e),s.d(e,{assets:()=>b,contentTitle:()=>k,default:()=>P,frontMatter:()=>S,metadata:()=>v,toc:()=>w});var i=s(4848),r=s(8453),c=s(6540),l=s(4164),n=s(3104),o=s(6347),d=s(205),a=s(7485),f=s(1682),h=s(9466);function _(t){return c.Children.toArray(t).filter((t=>"\n"!==t)).map((t=>{if(!t||(0,c.isValidElement)(t)&&function(t){const{props:e}=t;return!!e&&"object"==typeof e&&"value"in e}(t))return t;throw new Error(`Docusaurus error: Bad <Tabs> child <${"string"==typeof t.type?t.type:t.type.name}>: all children of the <Tabs> component should be <TabItem>, and every <TabItem> should have a unique "value" prop.`)}))?.filter(Boolean)??[]}function p(t){const{values:e,children:s}=t;return(0,c.useMemo)((()=>{const t=e??function(t){return _(t).map((t=>{let{props:{value:e,label:s,attributes:i,default:r}}=t;return{value:e,label:s,attributes:i,default:r}}))}(s);return function(t){const e=(0,f.X)(t,((t,e)=>t.value===e.value));if(e.length>0)throw new Error(`Docusaurus error: Duplicate values "${e.map((t=>t.value)).join(", ")}" found in <Tabs>. Every value needs to be unique.`)}(t),t}),[e,s])}function x(t){let{value:e,tabValues:s}=t;return s.some((t=>t.value===e))}function u(t){let{queryString:e=!1,groupId:s}=t;const i=(0,o.W6)(),r=function(t){let{queryString:e=!1,groupId:s}=t;if("string"==typeof e)return e;if(!1===e)return null;if(!0===e&&!s)throw new Error('Docusaurus error: The <Tabs> component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return s??null}({queryString:e,groupId:s});return[(0,a.aZ)(r),(0,c.useCallback)((t=>{if(!r)return;const e=new URLSearchParams(i.location.search);e.set(r,t),i.replace({...i.location,search:e.toString()})}),[r,i])]}function A(t){const{defaultValue:e,queryString:s=!1,groupId:i}=t,r=p(t),[l,n]=(0,c.useState)((()=>function(t){let{defaultValue:e,tabValues:s}=t;if(0===s.length)throw new Error("Docusaurus error: the <Tabs> component requires at least one <TabItem> children component");if(e){if(!x({value:e,tabValues:s}))throw new Error(`Docusaurus error: The <Tabs> has a defaultValue "${e}" but none of its children has the corresponding value. Available values are: ${s.map((t=>t.value)).join(", ")}. If you intend to show no default tab, use defaultValue={null} instead.`);return e}const i=s.find((t=>t.default))??s[0];if(!i)throw new Error("Unexpected error: 0 tabValues");return i.value}({defaultValue:e,tabValues:r}))),[o,a]=u({queryString:s,groupId:i}),[f,_]=function(t){let{groupId:e}=t;const s=function(t){return t?`docusaurus.tab.${t}`:null}(e),[i,r]=(0,h.Dv)(s);return[i,(0,c.useCallback)((t=>{s&&r.set(t)}),[s,r])]}({groupId:i}),A=(()=>{const t=o??f;return x({value:t,tabValues:r})?t:null})();(0,d.A)((()=>{A&&n(A)}),[A]);return{selectedValue:l,selectValue:(0,c.useCallback)((t=>{if(!x({value:t,tabValues:r}))throw new Error(`Can't select invalid tab value=${t}`);n(t),a(t),_(t)}),[a,_,r]),tabValues:r}}var j=s(2303);const m={tabList:"tabList__CuJ",tabItem:"tabItem_LNqP"};function g(t){let{className:e,block:s,selectedValue:r,selectValue:c,tabValues:o}=t;const d=[],{blockElementScrollPositionUntilNextRender:a}=(0,n.a_)(),f=t=>{const e=t.currentTarget,s=d.indexOf(e),i=o[s].value;i!==r&&(a(e),c(i))},h=t=>{let e=null;switch(t.key){case"Enter":f(t);break;case"ArrowRight":{const s=d.indexOf(t.currentTarget)+1;e=d[s]??d[0];break}case"ArrowLeft":{const s=d.indexOf(t.currentTarget)-1;e=d[s]??d[d.length-1];break}}e?.focus()};return(0,i.jsx)("ul",{role:"tablist","aria-orientation":"horizontal",className:(0,l.A)("tabs",{"tabs--block":s},e),children:o.map((t=>{let{value:e,label:s,attributes:c}=t;return(0,i.jsx)("li",{role:"tab",tabIndex:r===e?0:-1,"aria-selected":r===e,ref:t=>d.push(t),onKeyDown:h,onClick:f,...c,className:(0,l.A)("tabs__item",m.tabItem,c?.className,{"tabs__item--active":r===e}),children:s??e},e)}))})}function F(t){let{lazy:e,children:s,selectedValue:r}=t;const l=(Array.isArray(s)?
|