puppeteer/assets/js/1a4e3797.dd1e74a2.js

1 line
15 KiB
JavaScript
Raw Normal View History

"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[97920],{79935:(e,t,a)=>{a.r(t),a.d(t,{default:()=>H});var r=a(58087),c=a(71098),n=a(31984),l=a(55995),s=a(40060),o=a(18168),u=a(37806),i=a(89712),m=a(80958),h=a(54995),g=a(92210),p=a(8241),d=a(37728),f=a(70290),v=a.n(f),b=a(8131),y=a.n(b),E=a(86010),P=a(67294),w=a(68263);const O="searchQueryInput_cpyO",S="searchVersionInput_wf2r",_="searchResultsColumn_PLpb",j="algoliaLogo_YElR",z="algoliaLogoPathFill_grp5",R="searchResultItem_AlWU",V="searchResultItemHeading_HJFH",N="searchResultItemPath_x9Ef",I="searchResultItemSummary_jej3",k="searchQueryColumn_hQFc",M="searchVersionColumn_GkmC",T="searchLogoColumn_Mj_0",F="loadingSpinner_E_zt",C="loader_ujSQ";function D(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function Z(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{},r=Object.keys(a);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(a).filter((function(e){return Object.getOwnPropertyDescriptor(a,e).enumerable})))),r.forEach((function(t){D(e,t,a[t])}))}return e}function x(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,r)}return a}(Object(t)).forEach((function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(t,a))})),e}function L({docsSearchVersionsHelpers:e}){const t=Object.entries(e.allDocsData).filter((([,e])=>e.versions.length>1));return P.createElement("div",{className:(0,E.Z)("col","col--3","padding-left--none",M)},t.map((([a,r])=>{const c=t.length>1?`${a}: `:"";return P.createElement("select",{key:a,onChange:t=>e.setSearchVersion(a,t.target.value),defaultValue:e.searchVersions[a],className:S},r.versions.map(((e,t)=>P.createElement("option",{key:t,label:`${c}${e.label}`,value:e.name}))))})))}function A(){const{siteConfig:{themeConfig:e},i18n:{currentLocale:t}}=(0,p.Z)(),{algolia:{appId:a,apiKey:i,indexName:f,externalUrlRegex:b}}=e,S=function(){const{selectMessage:e}=(0,s.c)();return t=>e(t,(0,g.I)({id:"theme.SearchPage.documentsFound.plurals",description:'Pluralized label for "{count} documents found". Use as much plural forms (separated by "|") as your language support (see https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html)',message:"One document found|{count} documents found"},{count:t}))}(),M=function(){const e=(0,l._r)(),[t,a]=(0,P.useState)((()=>Object.entries(e).reduce(((e,[t,a])=>x(Z({},e),{[t]:a.versions[0].name})),{}))),r=Object.values(e).some((e=>e.versions.length>1));return{allDocsData:e,versioningEnabled:r,searchVersions:t,setSearchVersion:(e,t)=>a((a=>x(Z({},a),{[e]:t})))}}(),{searchQuery:D,setSearchQuery:A}=(0,m.O)(),H={items:[],query:null,totalResults:null,totalPages:null,lastPage:null,hasMore:null,loading:null},[q,Q]=(0,P.useReducer)(((e,t)=>{switch(t.type){case"reset":return H;case"loading":return x(Z({},e),{loading:!0});case"update":return D!==t.value.query?e:x(Z({},t.value),{items:0===t.value.lastPage?t.value.items:e.items.concat(t.value.items)});case"advance":{const t=e.totalPages>e.lastPage+1;return x(Z({},e),{lastPage:t?e.lastPage+1:e.lastPage,hasMore:t})}default:return e}}),H),$=v()(a,i),U=y()($,f,{hitsPerPage:15,advancedSyntax:!0,disjunctiveFacets:["language","counter"]});U.on("result",(({results:{query:e,hits:t,page:a,nbHits:r,nbPages:c}})=>{if(""===e||!Array.isArray(t))return void Q({type:"reset"});const n=e=>e.replace(/algolia-docsearch-suggestion--highlight/g,"search-result-match"),l=t.map((({url:e,_highlightResult:{hierarchy:t},_snippetResult:a={}})=>{const r=new URL(e),c=Object.keys(t).map((e=>n(t[e].value)));return{title:c.pop(),url:(0,o.F)(b,r.href)?r.href:r.pathname+r.hash,summary:a.content?`${n(a.content.value)}...`:"",breadcrumbs:c}}));Q({type:"update",v